typesense-instantsearch-adapter 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see typesense-instantsearch-adapter.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TypesenseInstantSearchAdapter=t():e.TypesenseInstantSearchAdapter=t()}(self,(()=>(()=>{var e={3065:function(e,t,n){var r,i;!function(o,a){"use strict";r=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?e:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function c(e){return function(){typeof console!==t&&(u.call(this),this[e].apply(this,arguments))}}function l(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):e)}(r)||c.apply(this,arguments)}function d(e,n){var a,s,c,d=this,f="loglevel";function p(){var e;if(typeof window!==t&&f){try{e=window.localStorage[f]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+"=");-1!==i&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(e){}return void 0===d.levels[e]&&(e=void 0),e}}function h(e){var t=e;if("string"==typeof t&&void 0!==d.levels[t.toUpperCase()]&&(t=d.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=d.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?f+=":"+e:"symbol"==typeof e&&(f=void 0),d.name=e,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=n||l,d.getLevel=function(){return null!=c?c:null!=s?s:a},d.setLevel=function(e,n){return c=h(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&f){try{return void(window.localStorage[f]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(f)+"="+n+";"}catch(e){}}}(c),u.call(d)},d.setDefaultLevel=function(e){s=h(e),p()||d.setLevel(e,!1)},d.resetLevel=function(){c=null,function(){if(typeof window!==t&&f){try{window.localStorage.removeItem(f)}catch(e){}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(d)},d.enableAll=function(e){d.setLevel(d.levels.TRACE,e)},d.disableAll=function(e){d.setLevel(d.levels.SILENT,e)},d.rebuild=function(){if(o!==d&&(a=h(o.getLevel())),u.call(d),o===d)for(var e in i)i[e].rebuild()},a=h(o?o.getLevel():"WARN");var y=p();null!=y&&(c=h(y)),u.call(d)}(o=new d).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new d(e,o.methodFactory)),t};var f=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=f),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(t,n,t,e))||(e.exports=i)}()},8567:(e,t,n)=>{"use strict";t._t=void 0;var r=n(3301),i=r.__importDefault(n(5641));i.default;var o=r.__importDefault(n(8557));t._t=o.default;r.__importStar(n(4410));i.default,o.default},5300:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(612)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},612:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/aliases",o=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(i)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=o},800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(9813)),o=r.__importDefault(n(3614)),a=r.__importDefault(n(4145)),s=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new a.default(this.apiCall)}return e.prototype.rules=function(e){return void 0===e?this._analyticsRules:(void 0===this.individualAnalyticsRules[e]&&(this.individualAnalyticsRules[e]=new o.default(e,this.apiCall)),this.individualAnalyticsRules[e])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e}();t.default=s},4145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath(),e)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/events"},enumerable:!1,configurable:!0}),e}();t.default=i},3614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(9813)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},4695:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5276)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},9813:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e,{},{})]}))}))},e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){return t={},e&&(t.rule_tag=e),[2,this.apiCall.get(this.endpointPath(),t)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();t.default=i},5276:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();t.default=i},3421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5276)),o=r.__importDefault(n(4695)),a=r.__importDefault(n(4145)),s=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new a.default(this.apiCall)}return e.prototype.rules=function(t){return e.hasWarnedDeprecation||(console.warn("[typesense] 'analyticsV1' is deprecated starting with Typesense Server v30 and will be removed in a future release. Please use 'analytics' instead."),e.hasWarnedDeprecation=!0),void 0===t?this._analyticsRules:(void 0===this.individualAnalyticsRules[t]&&(this.individualAnalyticsRules[t]=new o.default(t,this.apiCall)),this.individualAnalyticsRules[t])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e.hasWarnedDeprecation=!1,e}();t.default=s},5996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(6425)),o=n(5978),a=n(7205),s=n(4410),u=r.__importDefault(n(7796)),c=n(7353),l=!0,d="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node&&"undefined"==typeof window,f=function(){function e(e){this.configuration=e,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return e.prototype.get=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){void 0===t&&(t={});var i=void 0===n?{}:n,o=i.abortSignal,a=void 0===o?null:o,s=i.responseType,u=void 0===s?void 0:s,c=i.streamConfig,l=void 0===c?void 0:c,d=i.isStreamingRequest;return r.__generator(this,(function(n){return[2,this.performRequest("get",e,{queryParameters:t,abortSignal:a,responseType:u,streamConfig:l,isStreamingRequest:d})]}))}))},e.prototype.delete=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.performRequest("delete",e,{queryParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.post=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n,i,o){void 0===t&&(t={}),void 0===n&&(n={}),void 0===i&&(i={});var a=void 0===o?{}:o,s=a.abortSignal,u=void 0===s?null:s,c=a.responseType,l=void 0===c?void 0:c,d=a.streamConfig,f=void 0===d?void 0:d,p=a.isStreamingRequest;return r.__generator(this,(function(r){return[2,this.performRequest("post",e,{queryParameters:n,bodyParameters:t,additionalHeaders:i,abortSignal:u,responseType:l,streamConfig:f,isStreamingRequest:p})]}))}))},e.prototype.put=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__generator(this,(function(r){return[2,this.performRequest("put",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.patch=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__generator(this,(function(r){return[2,this.performRequest("patch",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.getAdapter=function(){if(this.configuration.axiosAdapter)return"function"==typeof this.configuration.axiosAdapter?this.configuration.axiosAdapter:"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent?i.default.getAdapter(this.configuration.axiosAdapter).bind(globalThis):i.default.getAdapter(this.configuration.axiosAdapter)},e.prototype.performRequest=function(e,t,n){return r.__awaiter(this,arguments,void 0,(function(e,t,n){var s,u,c,f,p,h,y,v,_,g,m,b=n.queryParameters,w=void 0===b?null:b,C=n.bodyParameters,R=void 0===C?null:C,O=n.additionalHeaders,S=void 0===O?{}:O,P=n.abortSignal,E=void 0===P?null:P,A=n.responseType,j=void 0===A?void 0:A,T=n.skipConnectionTimeout,N=void 0!==T&&T,x=n.enableKeepAlive,D=void 0===x?void 0:x,k=n.streamConfig,U=void 0===k?void 0:k,F=n.isStreamingRequest;return r.__generator(this,(function(n){switch(n.label){case 0:this.configuration.validate(),F&&(this.logger.debug("Request: Performing streaming request to ".concat(t)),d||"undefined"==typeof fetch||(this.logger.debug("Using fetch adapter for browser streaming"),j="stream")),s=Date.now(),c=!1,this.logger.debug("Request #".concat(s,": Performing ").concat(e.toUpperCase()," request: ").concat(t)),f=function(n){var f,h,y,b,C,O,P;return r.__generator(this,(function(A){switch(A.label){case 0:if(f=p.getNextNode(s),p.logger.debug("Request #".concat(s,": Attempting ").concat(e.toUpperCase()," request Try #").concat(n," to Node ").concat(f.index)),E&&E.aborted)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];h=void 0,A.label=1;case 1:return A.trys.push([1,3,5,6]),(y={method:e,url:p.uriFor(t,f),headers:Object.assign({},p.defaultHeaders(),S,p.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,validateStatus:function(e){return e>0},transformResponse:[function(e,t){var n=e;return void 0!==t&&"string"==typeof e&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(n=JSON.parse(e)),n}]}).adapter=F&&!d?"fetch":p.getAdapter(),!0!==N&&(y.timeout=1e3*p.connectionTimeoutSeconds),w&&0!==Object.keys(w).length&&(y.params=w),p.sendApiKeyAsQueryParam&&(y.params=y.params||{},y.params["x-typesense-api-key"]=p.apiKey),p.configuration.httpAgent?(p.logger.debug("Request #".concat(s,": Using custom httpAgent")),y.httpAgent=p.configuration.httpAgent):!0===D&&(d?(p.logger.debug("Request #".concat(s,": Enabling KeepAlive")),y.httpAgent=new o.Agent({keepAlive:!0})):p.logger.warn("Request #".concat(s,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),p.configuration.httpsAgent?(p.logger.debug("Request #".concat(s,": Using custom httpsAgent")),y.httpsAgent=p.configuration.httpsAgent):!0===D&&(d?(p.logger.debug("Request #".concat(s,": Enabling keepAlive")),y.httpsAgent=new a.Agent({keepAlive:!0})):p.logger.warn("Request #".concat(s,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),p.configuration.paramsSerializer&&(p.logger.debug("Request #".concat(s,": Using custom paramsSerializer")),y.paramsSerializer=p.configuration.paramsSerializer),R&&("string"==typeof R&&0!==R.length||"object"==typeof R&&0!==Object.keys(R).length)&&(y.data=R),E&&(b=i.default.CancelToken,C=b.source(),h=function(){c=!0,C.cancel()},E.addEventListener("abort",h),y.cancelToken=C.token),F?(y.responseType="stream",d||(y.headers=r.__assign(r.__assign({},y.headers),{Accept:"text/event-stream"}))):j&&(y.responseType=j),[4,(0,i.default)(y)];case 2:if((O=A.sent()).status>=1&&O.status<=499&&p.setNodeHealthcheck(f,l),p.logger.debug("Request #".concat(s,": Request to Node ").concat(f.index," was made. Response Code was ").concat(O.status,".")),O.status>=200&&O.status<300)return F?[2,{value:p.handleStreamingResponse(O,U)}]:[2,{value:Promise.resolve(O.data)}];if(O.status<500)return[2,{value:Promise.reject(p.customErrorForResponse(O,null===(v=O.data)||void 0===v?void 0:v.message,y.data))}];throw p.customErrorForResponse(O,null===(_=O.data)||void 0===_?void 0:_.message,y.data);case 3:return P=A.sent(),c||p.setNodeHealthcheck(f,!1),u=P,p.logger.warn("Request #".concat(s,": Request to Node ").concat(f.index,' failed due to "').concat(null!==(g=null==P?void 0:P.code)&&void 0!==g?g:""," ").concat(P.message).concat(null==P.response?"":" - "+JSON.stringify(null===(m=P.response)||void 0===m?void 0:m.data),'"')),c?[2,{value:Promise.reject(new Error("Request aborted by caller."))}]:(F&&p.invokeOnErrorCallback(P,U),n<p.numRetriesPerRequest+1?(p.logger.warn("Request #".concat(s,": Sleeping for ").concat(p.retryIntervalSeconds,"s and then retrying request...")),[4,p.timer(p.retryIntervalSeconds)]):(p.logger.debug("Request #".concat(s,": No retries left. Raising last error")),[2,{value:Promise.reject(u)}]));case 4:return A.sent(),[3,6];case 5:return E&&h&&E.removeEventListener("abort",h),[7];case 6:return[2]}}))},p=this,h=1,n.label=1;case 1:return h<=this.numRetriesPerRequest+1?[5,f(h)]:[3,4];case 2:if("object"==typeof(y=n.sent()))return[2,y.value];n.label=3;case 3:return h++,[3,1];case 4:return this.logger.debug("Request #".concat(s,": No retries left. Raising last error")),[2,Promise.reject(u)]}}))}))},e.prototype.processStreamingLine=function(e){if(!e.trim()||"data: [DONE]"===e)return null;if(e.startsWith("data: "))return this.processDataLine(e.slice(6).trim());if(e.trim().startsWith("{"))try{var t=JSON.parse(e.trim());return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(t){return{conversation_id:"unknown",message:e.trim()}}return{conversation_id:"unknown",message:e.trim()}},e.prototype.processDataLine=function(e){if(!e)return null;if(e.startsWith("{"))try{var t=JSON.parse(e);return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(t){return{conversation_id:"unknown",message:e}}return{conversation_id:"unknown",message:e}},e.prototype.handleStreamingResponse=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return this.logger.debug("Handling streaming response. Environment: ".concat(d?"Node.js":"Browser")),d&&e.data?[2,this.handleNodeStreaming(e,t)]:d?(this.logger.debug("Processing non-streaming response"),this.invokeOnCompleteCallback(e.data,t),[2,Promise.resolve(e.data)]):[2,this.handleBrowserStreaming(e,t)]}))}))},e.prototype.handleNodeStreaming=function(e,t){var n=this;return this.logger.debug("Processing Node.js stream"),new Promise((function(r,i){var o=e.data,a=[],s="";o.on("data",(function(e){var r;try{var o=e.toString(),u=(s+=o).split("\n");s=null!==(r=u.pop())&&void 0!==r?r:"",n.processStreamLines(u,a,t)}catch(e){i(e)}})),o.on("end",(function(){if(s.trim().length>0){var i=s.split("\n");n.processStreamLines(i,a,t)}n.finalizeStreamResult(a,r,e,t)})),o.on("error",(function(e){n.logger.error("Stream error: ".concat(e)),n.invokeOnErrorCallback(e,t),i(e)}))}))},e.prototype.handleBrowserStreaming=function(e,t){var n=this;return this.logger.debug("Processing browser stream"),new Promise((function(i,o){return r.__awaiter(n,void 0,void 0,(function(){return r.__generator(this,(function(n){try{return e.data&&"function"==typeof e.data.getReader?[2,this.handleBrowserReadableStream(e.data,i,o,e,t)]:"string"==typeof e.data?[2,this.handleBrowserStringResponse(e.data,i,e,t)]:"object"==typeof e.data&&null!==e.data?(this.logger.debug("No stream found, but data object is available"),this.invokeOnCompleteCallback(e.data,t),[2,i(e.data)]):(this.logger.error("No usable data found in response"),[2,o(new Error("No usable data found in response"))])}catch(e){this.logger.error("Error processing streaming response: ".concat(e)),this.invokeOnErrorCallback(e,t),o(e)}return[2]}))}))}))},e.prototype.handleBrowserReadableStream=function(e,t,n,i,o){return r.__awaiter(this,void 0,void 0,(function(){var a,s,u,c,l,d,f,p,h,y;return r.__generator(this,(function(r){switch(r.label){case 0:this.logger.debug("Found ReadableStream in response.data"),a=e.getReader(),s=[],u="",r.label=1;case 1:r.trys.push([1,5,,6]),r.label=2;case 2:return[4,a.read()];case 3:return c=r.sent(),l=c.done,d=c.value,l?(this.logger.debug("Stream reading complete"),u.trim()&&(f=u.split("\n"),this.processStreamLines(f,s,o)),[3,4]):(p=(new TextDecoder).decode(d),this.logger.debug("Received chunk: ".concat(p.length," bytes")),h=(u+=p).split("\n"),u=h.pop()||"",this.processStreamLines(h,s,o),[3,2]);case 4:return this.finalizeStreamResult(s,t,i,o),[3,6];case 5:return y=r.sent(),this.logger.error("Stream error: ".concat(y)),this.invokeOnErrorCallback(y,o),n(y),[3,6];case 6:return[2]}}))}))},e.prototype.handleBrowserStringResponse=function(e,t,n,r){this.logger.debug("Processing text response as stream data");var i=[],o=e.split("\n");if(this.processStreamLines(o,i,r),i.length>0){var a=this.combineStreamingChunks(i);this.invokeOnCompleteCallback(a,r),t(a)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.processStreamLines=function(e,t,n){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.trim()&&"data: [DONE]"!==o){var a=this.processStreamingLine(o);null!==a&&(this.invokeOnChunkCallback(a,n),t.push(a))}}},e.prototype.finalizeStreamResult=function(e,t,n,r){if(e.length>0){var i=this.combineStreamingChunks(e);this.logger.debug("Stream processing complete"),this.invokeOnCompleteCallback(i,r),t(i)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.combineStreamingChunks=function(e){if(0===e.length)return{};if(1===e.length)return e[0];var t=this.getMessageChunks(e);if(t.length>0)return this.combineMessageChunks(e,t);var n=e[e.length-1];if(!this.isCompleteSearchResponse(n))throw new Error("Last chunk is not a complete search response");return n},e.prototype.getMessageChunks=function(e){return e.filter(this.isChunkMessage)},e.prototype.isChunkMessage=function(e){return"object"==typeof e&&null!==e&&"message"in e&&"conversation_id"in e},e.prototype.combineMessageChunks=function(e,t){this.logger.debug("Found ".concat(t.length," message chunks to combine"));var n=e[e.length-1];if(this.isCompleteSearchResponse(n))return n;var r=e.find(this.isCompleteSearchResponse);if(!r)throw new Error("No metadata chunk found");return r},e.prototype.isCompleteSearchResponse=function(e){return"object"==typeof e&&null!==e&&Object.keys(e).length>0&&("results"in e||"found"in e||"hits"in e||"page"in e||"search_time_ms"in e)},e.prototype.getNextNode=function(e){if(void 0===e&&(e=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(e,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(e,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(e,": Nodes Health: ").concat(this.nodes.map((function(e){return"Node ".concat(e.index," is ").concat(!0===e.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(e,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},e.prototype.nodeDueForHealthcheck=function(e,t){void 0===t&&(t=0);var n=Date.now()-e.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(t,": Node ").concat(e.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n},e.prototype.initializeMetadataForNodes=function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,l)),this.nodes.forEach((function(t,n){t.index=n,e.setNodeHealthcheck(t,l)}))},e.prototype.setNodeHealthcheck=function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()},e.prototype.uriFor=function(e,t){return null!=t.url?"".concat(t.url).concat(e):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(e)},e.prototype.defaultHeaders=function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e},e.prototype.timer=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*e)}))]}))}))},e.prototype.customErrorForResponse=function(e,t,n){var r="Request failed with HTTP code ".concat(e.status);return"string"==typeof t&&""!==t.trim()&&(r+=" | Server said: ".concat(t)),new u.default(r,n,e.status),400===e.status?new s.RequestMalformed(r,n,e.status):401===e.status?new s.RequestUnauthorized(r,n,e.status):404===e.status?new s.ObjectNotFound(r,n,e.status):409===e.status?new s.ObjectAlreadyExists(r,n,e.status):422===e.status?new s.ObjectUnprocessable(r,n,e.status):e.status>=500&&e.status<=599?new s.ServerError(r,n,e.status):new s.HTTPError(r,n,e.status)},e.prototype.invokeOnChunkCallback=function(e,t){if(null==t?void 0:t.onChunk)try{t.onChunk(e)}catch(e){this.logger.warn("Error in onChunk callback: ".concat(e))}},e.prototype.invokeOnCompleteCallback=function(e,t){if(null==t?void 0:t.onComplete)try{t.onComplete(e)}catch(e){this.logger.warn("Error in onComplete callback: ".concat(e))}},e.prototype.invokeOnErrorCallback=function(e,t){if(null==t?void 0:t.onError){var n=(0,c.toErrorWithMessage)(e);try{t.onError(n)}catch(e){this.logger.warn("Error in onError callback: ".concat(e))}}},e}();t.default=f},5641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5706)),o=r.__importDefault(n(5996)),a=r.__importDefault(n(7361)),s=r.__importDefault(n(2626)),u=r.__importDefault(n(612)),c=r.__importDefault(n(5300)),l=r.__importDefault(n(326)),d=r.__importDefault(n(2275)),f=r.__importDefault(n(3343)),p=r.__importDefault(n(657)),h=r.__importDefault(n(4955)),y=r.__importDefault(n(8231)),v=r.__importDefault(n(3684)),_=r.__importDefault(n(8621)),g=r.__importDefault(n(5156)),m=r.__importDefault(n(3777)),b=r.__importDefault(n(3421)),w=r.__importDefault(n(800)),C=r.__importDefault(n(3533)),R=r.__importDefault(n(4646)),O=r.__importDefault(n(8700)),S=r.__importDefault(n(8313)),P=r.__importDefault(n(2786)),E=r.__importDefault(n(5350)),A=r.__importDefault(n(7187)),j=r.__importDefault(n(4200)),T=r.__importDefault(n(2077)),N=r.__importDefault(n(476)),x=r.__importDefault(n(1049)),D=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null!==(t=e.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new i.default(e),this.apiCall=new o.default(this.configuration),this.debug=new f.default(this.apiCall),this.metrics=new p.default(this.apiCall),this.stats=new h.default(this.apiCall),this.health=new y.default(this.apiCall),this.operations=new v.default(this.apiCall),this.multiSearch=new _.default(this.apiCall,this.configuration),this._collections=new a.default(this.apiCall),this.individualCollections={},this._aliases=new u.default(this.apiCall),this.individualAliases={},this._keys=new l.default(this.apiCall),this.individualKeys={},this._presets=new g.default(this.apiCall),this.individualPresets={},this._stopwords=new C.default(this.apiCall),this.individualStopwords={},this.analytics=new w.default(this.apiCall),this.analyticsV1=new b.default(this.apiCall),this.stemming=new P.default(this.apiCall),this._conversations=new O.default(this.apiCall),this.individualConversations={},this._nlSearchModels=new E.default(this.apiCall),this.individualNLSearchModels={},this._synonymSets=new j.default(this.apiCall),this.individualSynonymSets={},this._curationSets=new N.default(this.apiCall),this.individualCurationSets={}}return e.prototype.collections=function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.default(e,this.apiCall,this.configuration)),this.individualCollections[e])},e.prototype.aliases=function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new c.default(e,this.apiCall)),this.individualAliases[e])},e.prototype.keys=function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new d.default(e,this.apiCall)),this.individualKeys[e])},e.prototype.presets=function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new m.default(e,this.apiCall)),this.individualPresets[e])},e.prototype.stopwords=function(e){return void 0===e?this._stopwords:(void 0===this.individualStopwords[e]&&(this.individualStopwords[e]=new R.default(e,this.apiCall)),this.individualStopwords[e])},e.prototype.conversations=function(e){return void 0===e?this._conversations:(void 0===this.individualConversations[e]&&(this.individualConversations[e]=new S.default(e,this.apiCall)),this.individualConversations[e])},e.prototype.nlSearchModels=function(e){return void 0===e?this._nlSearchModels:(void 0===this.individualNLSearchModels[e]&&(this.individualNLSearchModels[e]=new A.default(e,this.apiCall)),this.individualNLSearchModels[e])},e.prototype.synonymSets=function(e){return void 0===e?this._synonymSets:(void 0===this.individualSynonymSets[e]&&(this.individualSynonymSets[e]=new T.default(e,this.apiCall)),this.individualSynonymSets[e])},e.prototype.curationSets=function(e){return void 0===e?this._curationSets:(void 0===this.individualCurationSets[e]&&(this.individualCurationSets[e]=new x.default(e,this.apiCall)),this.individualCurationSets[e])},e}();t.default=D},2626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(9078)),a=n(4410),s=r.__importDefault(n(3629)),u=r.__importDefault(n(6582)),c=r.__importDefault(n(1104)),l=r.__importDefault(n(6821)),d=n(9459),f=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=e,this.apiCall=t,this.configuration=n,this._documents=new o.default(this.name,this.apiCall,this.configuration),this._overrides=new s.default(this.name,this.apiCall),this._synonyms=new c.default(this.name,this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},e.prototype.exists=function(){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return t.sent(),[2,!0];case 2:if((e=t.sent())instanceof a.ObjectNotFound)return[2,!1];throw e;case 3:return[2]}}))}))},e.prototype.documents=function(e){return e?(void 0===this.individualDocuments[e]&&(this.individualDocuments[e]=new d.Document(this.name,e,this.apiCall)),this.individualDocuments[e]):this._documents},e.prototype.overrides=function(e){return void 0===e?this._overrides:(void 0===this.individualOverrides[e]&&(this.individualOverrides[e]=new u.default(this.name,e,this.apiCall)),this.individualOverrides[e])},e.prototype.synonyms=function(e){return void 0===e?this._synonyms:(void 0===this.individualSynonyms[e]&&(this.individualSynonyms[e]=new l.default(this.name,e,this.apiCall)),this.individualSynonyms[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=f},7361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/collections",o=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.post(i,e,t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(i,e)]}))}))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=o},5706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importStar(n(3065)),o=n(4410),a=function(){function e(e){var t=this;this.nodes=e.nodes||[],this.nodes=this.nodes.map((function(e){return t.setDefaultPathInNode(e)})).map((function(e){return t.setDefaultPortInNode(e)})).map((function(e){return r.__assign({},e)})),null==e.randomizeNodes&&(e.randomizeNodes=!0),!0===e.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=e.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=e.connectionTimeoutSeconds||e.timeoutSeconds||5,this.healthcheckIntervalSeconds=e.healthcheckIntervalSeconds||60,this.numRetries=(void 0!==e.numRetries&&e.numRetries>=0?e.numRetries:this.nodes.length+(null==this.nearestNode?0:1))||3,this.retryIntervalSeconds=e.retryIntervalSeconds||.1,this.apiKey=e.apiKey,this.sendApiKeyAsQueryParam=e.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=e.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=e.useServerSideSearchCache||!1,this.axiosAdapter=e.axiosAdapter,this.logger=e.logger||i,this.logLevel=e.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=e.additionalHeaders,this.httpAgent=e.httpAgent,this.httpsAgent=e.httpsAgent,this.paramsSerializer=e.paramsSerializer,this.showDeprecationWarnings(e),this.validate()}return e.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new o.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new o.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new o.MissingConfigurationError("Ensure that apiKey is set");return!0},e.prototype.validateNodes=function(){var e=this;return this.nodes.some((function(t){return e.isNodeMissingAnyParameters(t)}))},e.prototype.isNodeMissingAnyParameters=function(e){return!["protocol","host","port","path"].every((function(t){return e.hasOwnProperty(t)}))&&null==e.url},e.prototype.setDefaultPathInNode=function(e){return null==e||e.hasOwnProperty("path")||(e.path=""),e},e.prototype.setDefaultPortInNode=function(e){if(null!=e&&!e.hasOwnProperty("port")&&e.hasOwnProperty("protocol"))switch(e.protocol){case"https":e.port=443;break;case"http":e.port=80}return e},e.prototype.showDeprecationWarnings=function(e){e.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),e.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),e.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},e.prototype.shuffleArray=function(e){for(var t,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1));t=[e[r],e[n]],e[n]=t[0],e[r]=t[1]}},e}();t.default=a},8313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(8700)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},5168:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(2783)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},2783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/conversations/models"},enumerable:!1,configurable:!0}),e}();t.default=i},8700:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(2783)),o=r.__importDefault(n(5168)),a="/conversations",s=function(){function e(e){this.apiCall=e,this.individualConversationModels={},this.apiCall=e,this._conversationsModels=new i.default(this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(a)]}))}))},e.prototype.models=function(e){return void 0===e?this._conversationsModels:(void 0===this.individualConversationModels[e]&&(this.individualConversationModels[e]=new o.default(e,this.apiCall)),this.individualConversationModels[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),e}();t.default=s},1049:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=r.__importDefault(n(285)),a=r.__importDefault(n(4326)),s=function(){function e(e,t){this.name=e,this.apiCall=t,this.individualItems={},this._items=new o.default(this.name,t)}return e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.items=function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new a.default(this.name,e,this.apiCall)),this.individualItems[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=s},4326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=function(){function e(e,t,n){this.name=e,this.itemId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items/").concat(encodeURIComponent(this.itemId))},e}();t.default=o},285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(e){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))},e}();t.default=o},476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(e.RESOURCEPATH)]}))}))},e.RESOURCEPATH="/curation_sets",e}();t.default=i},3343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/debug")]}))}))},e}();t.default=i},9459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Document=void 0;var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(9078)),a=function(){function e(e,t,n){this.collectionName=e,this.documentId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},e.prototype.update=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.apiCall.patch(this.endpointPath(),e,t)]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.documentId))},e}();t.Document=a},9078:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(4410),o=n(6124),a="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,s=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return r.__extends(t,e),t.prototype.create=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,t)]}))}))},t.prototype.upsert=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"upsert"}))]}))}))},t.prototype.update=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),e,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"update"}))]}))}))},t.prototype.delete=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},t.prototype.createMany=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(e,t)]}))}))},t.prototype.import=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,o,s,u,c;return void 0===t&&(t={}),r.__generator(this,(function(l){switch(l.label){case 0:if(n=r.__assign({throwOnFail:!0},t),Array.isArray(e)){if(0===e.length)throw new i.RequestMalformed("No documents provided");try{o=e.map((function(e){return JSON.stringify(e)})).join("\n")}catch(e){if(e instanceof RangeError&&e.message.includes("Too many properties to enumerate"))throw new Error("".concat(e,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));throw new Error(e)}}else if(null==(d=o=e)||""===d||0===d.length)throw new i.RequestMalformed("No documents provided");return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:o,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!a})];case 1:if(s=l.sent(),Array.isArray(e)){if(u=s.split("\n").map((function(e){return JSON.parse(e)})),(c=u.filter((function(e){return!1===e.success}))).length>0&&n.throwOnFail)throw new i.ImportError("".concat(u.length-c.length," documents imported successfully, ").concat(c.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),u,{documentsInJSONLFormat:o,options:n,failedItems:c,successCount:u.length-c.length});return[2,u]}return[2,s]}var d}))}))},t.prototype.importStream=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,o,s,u;return void 0===t&&(t={}),r.__generator(this,(function(c){switch(c.label){case 0:return n=r.__assign({throwOnFail:!0},t),[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:e,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!a})];case 1:if(o=c.sent(),s=o.split("\n").map((function(e){return JSON.parse(e)})),(u=s.filter((function(e){return!1===e.success}))).length>0&&n.throwOnFail)throw new i.ImportError("".concat(s.length-u.length," documents imported successfully, ").concat(u.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),s,{documentsInJSONLFormat:e,options:n,failedItems:u,successCount:s.length-u.length});return[2,s]}}))}))},t.prototype.export=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e)]}))}))},t.prototype.exportStream=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e,{responseType:"stream"})]}))}))},t}(o.SearchOnlyDocuments);t.default=s},2144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8331:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.importResults=n,i.payload=r,i}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},2426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},6731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},2703:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},6909:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},1081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},7796:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(t,n,r){var i=this.constructor,o=e.call(this,t)||this;return o.name=i.name,o.httpBody=n,o.httpStatus=r,Object.setPrototypeOf(o,i.prototype),o}return r.__extends(t,e),t}(Error);t.default=i},4410:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImportError=t.TypesenseError=t.ServerError=t.RequestUnauthorized=t.RequestMalformed=t.ObjectUnprocessable=t.ObjectNotFound=t.ObjectAlreadyExists=t.MissingConfigurationError=t.HTTPError=void 0;var r=n(3301),i=r.__importDefault(n(2144));t.HTTPError=i.default;var o=r.__importDefault(n(2426));t.MissingConfigurationError=o.default;var a=r.__importDefault(n(6731));t.ObjectAlreadyExists=a.default;var s=r.__importDefault(n(8280));t.ObjectNotFound=s.default;var u=r.__importDefault(n(2703));t.ObjectUnprocessable=u.default;var c=r.__importDefault(n(8274));t.RequestMalformed=c.default;var l=r.__importDefault(n(6909));t.RequestUnauthorized=l.default;var d=r.__importDefault(n(1081));t.ServerError=d.default;var f=r.__importDefault(n(8331));t.ImportError=f.default;var p=r.__importDefault(n(7796));t.TypesenseError=p.default},8231:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/health")]}))}))},e}();t.default=i},2275:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(326)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(3529),o=n(7353),a="/keys",s=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.post(e.RESOURCEPATH,t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(a)]}))}))},e.prototype.generateScopedSearchKey=function(e,t){var n=(0,o.normalizeArrayableParams)(t),r=JSON.stringify(n),a=Buffer.from((0,i.createHmac)("sha256",e).update(r).digest("base64")),s=e.substr(0,4),u="".concat(a).concat(s).concat(r);return Buffer.from(u).toString("base64")},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),e}();t.default=s},657:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/metrics.json")]}))}))},e}();t.default=i},8621:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(875)),o=n(7353),a=function(){function e(e,t,n){void 0===n&&(n=!1),this.apiCall=e,this.configuration=t,this.useTextContentType=n,this.requestWithCache=new i.default,this.logger=this.apiCall.logger}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.perform=function(e,t,n){return r.__awaiter(this,void 0,void 0,(function(){var i,a,s,u,c,l,d;return r.__generator(this,(function(f){return i=t?r.__assign({},t):{},a=null!==(d=null==n?void 0:n.cacheSearchResultsForSeconds)&&void 0!==d?d:this.configuration.cacheSearchResultsForSeconds,!0===this.configuration.useServerSideSearchCache&&(i.use_cache=!0),!0===e.union&&this.hasAnySearchObjectPagination(e)&&this.logger.warn("Individual `searches` pagination parameters are ignored when `union: true` is set. Use a top-level pagination parameter instead. See https://typesense.org/docs/29.0/api/federated-multi-search.html#union-search"),s={union:e.union,searches:e.searches.map(o.normalizeArrayableParams)},u=i.streamConfig,c=r.__rest(i,["streamConfig"]),l=(0,o.normalizeArrayableParams)(c),[2,this.requestWithCache.perform(this.apiCall,"post",{path:"/multi_search",body:s,queryParams:l,headers:this.useTextContentType?{"content-type":"text/plain"}:{},streamConfig:u,abortSignal:null==n?void 0:n.abortSignal,isStreamingRequest:this.isStreamingRequest(i)},void 0!==a?{cacheResponseForSeconds:a}:void 0)]}))}))},e.prototype.isStreamingRequest=function(e){return void 0!==e.streamConfig},e.prototype.hasAnySearchObjectPagination=function(e){return e.searches.some((function(e){return void 0!==e.page||void 0!==e.per_page||void 0!==e.offset||void 0!==e.limit||void 0!==e.limit_hits}))},e}();t.default=a},7187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5350)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},5350:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return e.RESOURCEPATH},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/nl_search_models"},enumerable:!1,configurable:!0}),e}();t.default=i},3684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/operations",o=function(){function e(e){this.apiCall=e}return e.prototype.perform=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.apiCall.post("".concat(i,"/").concat(e),{},t)]}))}))},e.prototype.getSchemaChanges=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("".concat(i,"/schema_changes"))]}))}))},e}();t.default=o},6582:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(3629)),a=function(){function e(e,t,n){this.collectionName=e,this.overrideId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.overrideId))},e}();t.default=a},3629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),e}();t.default=o},3777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5156)),o=function(){function e(e,t){this.presetId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.presetId))},e}();t.default=o},5156:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(7353),o=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,o;return r.__generator(this,(function(r){return"object"==typeof t.value&&"searches"in t.value?(n=t.value.searches.map((function(e){return(0,i.normalizeArrayableParams)(e)})),[2,this.apiCall.put(this.endpointPath(e),{value:{searches:n}})]):(o=(0,i.normalizeArrayableParams)(t.value),[2,this.apiCall.put(this.endpointPath(e),{value:o})])}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),e}();t.default=o},875:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(){this.responseCache=new Map,this.responsePromiseCache=new Map}return e.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},e.prototype.perform=function(e,t,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,f,p,h,y,v,_,g,m,b,w,C,R,O,S;return r.__generator(this,(function(r){switch(r.label){case 0:if(a=(o=i||{}).cacheResponseForSeconds,s=void 0===a?120:a,u=o.maxSize,c=void 0===u?100:u,l=void 0===i||s<=0||c<=0,d=n.path,f=n.queryParams,p=n.body,h=n.headers,y=n.streamConfig,v=n.abortSignal,_=n.responseType,g=n.isStreamingRequest,l)return[2,this.executeRequest(e,t,d,f,p,h,{abortSignal:v,responseType:_,streamConfig:y,isStreamingRequest:g})];if(m=JSON.stringify(n),b=this.responseCache.get(m),w=Date.now(),b){if(w-b.requestTimestamp<1e3*s)return this.responseCache.delete(m),this.responseCache.set(m,b),[2,b.response];this.responseCache.delete(m)}if(C=this.responsePromiseCache.get(m)){if(w-C.requestTimestamp<1e3*s)return this.responsePromiseCache.delete(m),this.responsePromiseCache.set(m,C),[2,C.responsePromise];this.responsePromiseCache.delete(m)}return R=this.executeRequest(e,t,d,f,p,h,{abortSignal:v,responseType:_,streamConfig:y,isStreamingRequest:g}),this.responsePromiseCache.set(m,{requestTimestamp:w,responsePromise:R}),[4,R];case 1:return O=r.sent(),this.responseCache.set(m,{requestTimestamp:w,response:O}),this.responseCache.size>c&&(S=this.responseCache.keys().next().value)&&this.responseCache.delete(S),this.responsePromiseCache.size>c&&(S=this.responsePromiseCache.keys().next().value)&&this.responsePromiseCache.delete(S),[2,O]}}))}))},e.prototype.executeRequest=function(e,t,n,r,i,o,a){void 0===r&&(r={});var s=e[t];switch(t){case"get":return s.call(e,n,r,{abortSignal:null==a?void 0:a.abortSignal,responseType:null==a?void 0:a.responseType,streamConfig:null==a?void 0:a.streamConfig,isStreamingRequest:null==a?void 0:a.isStreamingRequest});case"delete":return s.call(e,n,r);case"post":return s.call(e,n,i,r,o||{},{abortSignal:null==a?void 0:a.abortSignal,responseType:null==a?void 0:a.responseType,streamConfig:null==a?void 0:a.streamConfig,isStreamingRequest:null==a?void 0:a.isStreamingRequest});case"put":case"patch":return s.call(e,n,i,r);default:throw new Error("Unsupported method: ".concat(String(t)))}},e}();t.default=i},8557:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5706)),o=r.__importDefault(n(5996)),a=r.__importDefault(n(8621)),s=n(7112),u=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null===(t=e.sendApiKeyAsQueryParam)||void 0===t||t,!0===e.sendApiKeyAsQueryParam&&(e.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),e.sendApiKeyAsQueryParam=!1),this.configuration=new i.default(e),this.apiCall=new o.default(this.configuration),this.multiSearch=new a.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return e.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(e){e[0],e[1].documents().clearCache()}))},e.prototype.collections=function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.SearchOnlyCollection(e,this.apiCall,this.configuration)),this.individualCollections[e];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},e}();t.default=u},7112:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyCollection=void 0;var r=n(6124),i=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this._documents=new r.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return e.prototype.documents=function(){return this._documents},e}();t.SearchOnlyCollection=i},6124:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyDocuments=void 0;var r=n(3301),i=r.__importDefault(n(875)),o=r.__importDefault(n(7361)),a=n(7353),s="/documents",u=function(){function e(e,t,n){this.collectionName=e,this.apiCall=t,this.configuration=n,this.requestWithCache=new i.default}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.search=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,i,o,s,u,c,l=void 0===t?{}:t,d=l.cacheSearchResultsForSeconds,f=void 0===d?this.configuration.cacheSearchResultsForSeconds:d,p=l.abortSignal,h=void 0===p?null:p;return r.__generator(this,(function(t){return n={},!0===this.configuration.useServerSideSearchCache&&(n.use_cache=!0),i=(0,a.normalizeArrayableParams)(e),o=i.streamConfig,s=r.__rest(i,["streamConfig"]),u=r.__assign(r.__assign({},n),s),c=!0===u.conversation_stream,[2,this.requestWithCache.perform(this.apiCall,"get",{path:this.endpointPath("search"),queryParams:u,streamConfig:o,abortSignal:h,isStreamingRequest:c},{cacheResponseForSeconds:f})]}))}))},e.prototype.endpointPath=function(e){return"".concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(s).concat(void 0===e?"":"/"+e)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return s},enumerable:!1,configurable:!0}),e}();t.SearchOnlyDocuments=u},4955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/stats.json")]}))}))},e}();t.default=i},2786:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5214)),o=r.__importDefault(n(5426)),a=function(){function e(e){this.apiCall=e,this.individualStemmingDictionaries={},this.apiCall=e,this._stemmingDictionaries=new i.default(this.apiCall)}return e.prototype.dictionaries=function(e){return void 0===e?this._stemmingDictionaries:(void 0===this.individualStemmingDictionaries[e]&&(this.individualStemmingDictionaries[e]=new o.default(e,this.apiCall)),this.individualStemmingDictionaries[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming"},enumerable:!1,configurable:!0}),e}();t.default=a},5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return n=Array.isArray(t)?t.map((function(e){return JSON.stringify(e)})).join("\n"):t,[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:{id:e},bodyParameters:n,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:return i=r.sent(),[2,Array.isArray(t)?i.split("\n").map((function(e){return JSON.parse(e)})):i]}}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return void 0===t?"".concat(e.RESOURCEPATH):"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming/dictionaries"},enumerable:!1,configurable:!0}),e}();t.default=i},5426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5214)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},4646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(3533)),o=function(){function e(e,t){this.stopwordId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.stopwordId))},e}();t.default=o},3533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),e}();t.default=i},6821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(1104)),a=function(){function e(e,t,n){this.collectionName=e,this.synonymId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return e.hasWarnedDeprecation||(console.warn("[typesense] 'synonym' APIs are deprecated starting with Typesense Server v30. Please migrate to synonym sets 'synonym_sets'."),e.hasWarnedDeprecation=!0),"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymId))},e.hasWarnedDeprecation=!1,e}();t.default=a},2077:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=r.__importDefault(n(3905)),a=r.__importDefault(n(7394)),s=function(){function e(e,t){this.synonymSetName=e,this.apiCall=t,this.individualItems={},this._items=new o.default(this.synonymSetName,t)}return e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.items=function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new a.default(this.synonymSetName,e,this.apiCall)),this.individualItems[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName))},e}();t.default=s},7394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=function(){function e(e,t,n){this.synonymSetName=e,this.itemId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items/").concat(encodeURIComponent(this.itemId))},e}();t.default=o},3905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=function(){function e(e,t){this.synonymSetName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(e){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))},e}();t.default=o},4200:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(e.RESOURCEPATH)]}))}))},e.RESOURCEPATH="/synonym_sets",e}();t.default=i},1104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return e.hasWarnedDeprecation||(console.warn("[typesense] 'synonyms' APIs are deprecated starting with Typesense Server v30. Please migrate to synonym sets ('synonym_sets')."),e.hasWarnedDeprecation=!0),"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),e.hasWarnedDeprecation=!1,e}();t.default=o},7765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayableParams=void 0,t.arrayableParams={query_by:"query_by",query_by_weights:"query_by_weights",facet_by:"facet_by",group_by:"group_by",include_fields:"include_fields",exclude_fields:"exclude_fields",highlight_fields:"highlight_fields",highlight_full_fields:"highlight_full_fields",pinned_hits:"pinned_hits",hidden_hits:"hidden_hits",infix:"infix",override_tags:"override_tags",num_typos:"num_typos",prefix:"prefix",synonym_sets:"synonym_sets",sort_by:"sort_by"}},7353:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeArrayableParams=function(e){var t=r.__assign({},e);if(!Object.keys(i.arrayableParams).filter((function(e){return Array.isArray(t[e])})).map((function(e){return t[e]=t[e].join(","),e})).length&&o(t))return t;if(!o(t))throw new Error("Failed to normalize arrayable params: ".concat(JSON.stringify(t)));return t},t.toErrorWithMessage=function(e){if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return"string"==typeof e?new Error(e):new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}};var r=n(3301),i=n(7765);function o(e){return Object.keys(i.arrayableParams).filter((function(t){return void 0!==e[t]})).every((function(t){return n=e[t],!Array.isArray(n);var n}))}},3529:()=>{},5978:()=>{},7205:()=>{},4633:(e,t,n)=>{var r=n(3738).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",d=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),a=new D(r||[]);return s(o,"_invoke",{value:j(e,n,a)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var y="suspendedStart",v="suspendedYield",_="executing",g="completed",m={};function b(){}function w(){}function C(){}var R={};f(R,c,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(k([])));S&&S!==o&&a.call(S,c)&&(R=S);var P=C.prototype=b.prototype=Object.create(R);function E(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,o,s,u){var c=h(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function j(e,n,r){var i=y;return function(o,a){if(i===_)throw Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===m)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===y)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=_;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?g:v,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=g,r.method="throw",r.arg=c.arg)}}}function T(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=C,s(P,"constructor",{value:C,configurable:!0}),s(C,"constructor",{value:w,configurable:!0}),w.displayName=f(C,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,C):(e.__proto__=C,f(e,d,"GeneratorFunction")),e.prototype=Object.create(P),e},n.awrap=function(e){return{__await:e}},E(A.prototype),f(A.prototype,l,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,i,o){void 0===o&&(o=Promise);var a=new A(p(e,t,r,i),o);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(P),f(P,d,"Generator"),f(P,c,(function(){return this})),f(P,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=k,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},6425:(e,t,n)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:a,toStringTag:s}=Symbol,u=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),c=(e,t)=>{let n=e;const r=[];for(;null!=n&&n!==Object.prototype;){if(-1!==r.indexOf(n))return!1;if(r.push(n),u(n,t))return!0;n=o(n)}return!1},l=(d=Object.create(null),e=>{const t=i.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const f=e=>(e=e.toLowerCase(),t=>l(t)===e),p=e=>t=>typeof t===e,{isArray:h}=Array,y=p("undefined");function v(e){return null!==e&&!y(e)&&null!==e.constructor&&!y(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _=f("ArrayBuffer"),g=p("string"),m=p("function"),b=p("number"),w=e=>null!==e&&"object"==typeof e,C=e=>{if(!w(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==o(t)||c(e,s)||c(e,a))},R=f("Date"),O=f("File"),S=f("Blob"),P=f("FileList"),E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},A=void 0!==E.FormData?E.FormData:void 0,j=f("URLSearchParams"),[T,N,x,D]=["ReadableStream","Request","Response","Headers"].map(f);function k(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),h(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(v(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function U(e,t){if(v(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,I=e=>!y(e)&&e!==F,q=(L="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>L&&e instanceof L);var L;const M=f("HTMLFormElement"),{propertyIsEnumerable:H}=Object.prototype,B=f("RegExp"),W=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};k(n,((n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)})),Object.defineProperties(e,r)},z=f("AsyncFunction"),V=(K="function"==typeof setImmediate,J=m(F.postMessage),K?setImmediate:J?(G=`axios@${Math.random()}`,$=[],F.addEventListener("message",(({source:e,data:t})=>{e===F&&t===G&&$.length&&$.shift()()}),!1),e=>{$.push(e),F.postMessage(G,"*")}):e=>setTimeout(e));var K,J,G,$;const X="undefined"!=typeof queueMicrotask?queueMicrotask.bind(F):"undefined"!=typeof process&&process.nextTick||V,Q=e=>null!=e&&m(e[a]);var Y={isArray:h,isArrayBuffer:_,isBuffer:v,isFormData:e=>{if(!e)return!1;if(A&&e instanceof A)return!0;const t=o(e);if(!t||t===Object.prototype)return!1;if(!m(e.append))return!1;const n=l(e);return"formdata"===n||"object"===n&&m(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&_(e.buffer),t},isString:g,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:C,isEmptyObject:e=>{if(!w(e)||v(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:T,isRequest:N,isResponse:x,isHeaders:D,isUndefined:y,isDate:R,isFile:O,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:S,isRegExp:B,isFunction:m,isStream:e=>w(e)&&m(e.pipe),isURLSearchParams:j,isTypedArray:q,isFileList:P,forEach:k,merge:function e(...t){const{caseless:n,skipUndefined:r}=I(this)&&this||{},i={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=n&&"string"==typeof o&&U(i,o)||o,s=u(i,a)?i[a]:void 0;C(s)&&C(t)?i[a]=e(s,t):C(t)?i[a]=e({},t):h(t)?i[a]=t.slice():r&&y(t)||(i[a]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||v(n))continue;if(k(n,o),"object"!=typeof n||h(n))continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];H.call(n,t)&&o(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:i}={})=>(k(t,((t,i)=>{n&&m(t)?Object.defineProperty(e,i,{__proto__:null,value:r(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,s;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],r&&!r(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:f,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:M,hasOwnProperty:u,hasOwnProp:u,hasOwnInPrototypeChain:c,getSafeProp:(e,t)=>null!=e&&c(e,t)?e[t]:void 0,reduceDescriptors:W,freezeMethods:e=>{W(e,((t,n)=>{if(m(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];m(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return h(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:U,global:F,isContextDefined:I,isSpecCompliantForm:function(e){return!!(e&&m(e.append)&&"FormData"===e[s]&&e[a])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(w(e)){if(t.has(e))return;if(v(e))return e;if(!("toJSON"in e)){t.add(e);const r=h(e)?[]:{};return k(e,((e,t)=>{const i=n(e);!y(i)&&(r[t]=i)})),t.delete(e),r}}return e};return n(e)},isAsyncFn:z,isThenable:e=>e&&(w(e)||m(e))&&m(e.then)&&m(e.catch),setImmediate:V,asap:X,isIterable:Q,isSafeIterable:e=>null!=e&&c(e,a)&&Q(e)};const Z=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ee=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),te=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ne(e,t){return Y.isArray(e)?e.map((e=>ne(e,t))):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function re(e){const t=Object.create(null);return Y.forEach(e.toJSON(),((e,n)=>{t[n]=(e=>ne(e,te))(e)})),t}const ie=Symbol("internals");function oe(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:Y.isArray(e)?e.map(ae):(e=>ne(e,ee))(String(e))}function se(e,t,n,r,i){return Y.isFunction(r)?r.call(this,t,n):(i&&(t=n),Y.isString(t)?Y.isString(r)?-1!==t.indexOf(r):Y.isRegExp(r)?r.test(t):void 0:void 0)}class ue{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=oe(t);if(!i)return;const o=Y.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ae(e))}const o=(e,t)=>Y.forEach(e,((e,n)=>i(e,n,t)));if(Y.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Y.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&Z[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(Y.isObject(e)&&Y.isSafeIterable(e)){let n,r,i=Object.create(null);for(const t of e){if(!Y.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],Y.hasOwnProp(i,r)?(n=i[r],i[r]=Y.isArray(n)?[...n,t[1]]:[n,t[1]]):i[r]=t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=oe(e)){const n=Y.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Y.isFunction(t))return t.call(this,e,n);if(Y.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=oe(e)){const n=Y.findKey(this,e);return!(!n||void 0===this[n]||t&&!se(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=oe(e)){const i=Y.findKey(n,e);!i||t&&!se(0,n[i],i,t)||(delete n[i],r=!0)}}return Y.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!se(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return Y.forEach(this,((r,i)=>{const o=Y.findKey(n,i);if(o)return t[o]=ae(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=ae(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Y.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Y.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=oe(e);t[r]||(function(e,t){const n=Y.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return Y.isArray(e)?e.forEach(r):r(e),this}}ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(ue.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Y.freezeMethods(ue);class ce extends Error{static from(e,t,n,r,i,o){const a=new ce(e.message,t||e.code,n,r,i);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),o&&Object.assign(a,o),a}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,t=e&&Y.hasOwnProp(e,"redact")?e.redact:void 0,n=Y.isArray(t)&&t.length>0?function(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),r=[],i=e=>{if(null===e||"object"!=typeof e)return e;if(Y.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ue&&(e=e.toJSON()),r.push(e),Y.isArray(e))t=[],e.forEach(((e,n)=>{const r=i(e);Y.isUndefined(r)||(t[n]=r)}));else{if(!Y.isPlainObject(e)&&function(e){if(Y.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Y.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,o]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":i(o);Y.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}(e,t):Y.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}ce.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ce.ERR_BAD_OPTION="ERR_BAD_OPTION",ce.ECONNABORTED="ECONNABORTED",ce.ETIMEDOUT="ETIMEDOUT",ce.ECONNREFUSED="ECONNREFUSED",ce.ERR_NETWORK="ERR_NETWORK",ce.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ce.ERR_DEPRECATED="ERR_DEPRECATED",ce.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ce.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ce.ERR_CANCELED="ERR_CANCELED",ce.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ce.ERR_INVALID_URL="ERR_INVALID_URL",ce.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const le=100;function de(e){return Y.isPlainObject(e)||Y.isArray(e)}function fe(e){return Y.endsWith(e,"[]")?e.slice(0,-2):e}function pe(e,t,n){return e?e.concat(t).map((function(e,t){return e=fe(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const he=Y.toFlatObject(Y,{},null,(function(e){return/^is[A-Z]/.test(e)}));function ye(e,t,n){if(!Y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Y.isUndefined(t[e])}))).metaTokens,i=n.visitor||p,o=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,u=void 0===n.maxDepth?le:n.maxDepth,c=s&&Y.isSpecCompliantForm(t),l=[];if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Y.isDate(e))return e.toISOString();if(Y.isBoolean(e))return e.toString();if(!c&&Y.isBlob(e))throw new ce("Blob is not supported. Use a Buffer instead.");if(Y.isArrayBuffer(e)||Y.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if("undefined"!=typeof Buffer)return Buffer.from(e);throw new ce("Blob is not supported. Use a Buffer instead.",ce.ERR_NOT_SUPPORT)}return e}function f(e){if(e>u)throw new ce("Object is too deeply nested ("+e+" levels). Max depth: "+u,ce.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,i){let s=e;if(Y.isReactNative(t)&&Y.isReactNativeBlob(e))return t.append(pe(i,n,o),d(e)),!1;if(e&&!i&&"object"==typeof e)if(Y.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(u===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,(function(e,t){if(!Y.isObject(t))return t;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(t),f(1+n.length-1),t}))}(e);else if(Y.isArray(e)&&function(e){return Y.isArray(e)&&!e.some(de)}(e)||(Y.isFileList(e)||Y.endsWith(n,"[]"))&&(s=Y.toArray(e)))return n=fe(n),s.forEach((function(e,r){!Y.isUndefined(e)&&null!==e&&t.append(!0===a?pe([n],r,o):null===a?n:n+"[]",d(e))})),!1;return!!de(e)||(t.append(pe(i,n,o),d(e)),!1)}const h=Object.assign(he,{defaultVisitor:p,convertValue:d,isVisitable:de});if(!Y.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!Y.isUndefined(n)){if(f(o),-1!==l.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));l.push(n),Y.forEach(n,(function(n,a){!0===(!(Y.isUndefined(n)||null===n)&&i.call(t,n,Y.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a],o+1)})),l.pop()}}(e),t}function ve(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function _e(e,t){this._pairs=[],e&&ye(e,this,t)}const ge=_e.prototype;function me(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function be(e,t,n){if(!t)return e;e=e||"";const r=Y.isFunction(n)?{serialize:n}:n,i=Y.getSafeProp(r,"encode")||me,o=Y.getSafeProp(r,"serialize");let a;if(a=o?o(t,r):Y.isURLSearchParams(t)?t.toString():new _e(t,r).toString(i),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}ge.append=function(e,t){this._pairs.push([e,t])},ge.toString=function(e){const t=e?t=>e.call(this,t,ve):ve;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class we{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:_e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Oe="undefined"!=typeof window&&"undefined"!=typeof document,Se="object"==typeof navigator&&navigator||void 0,Pe=Oe&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),Ee="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ae=Oe&&window.location.href||"http://localhost";var je={...Object.freeze({__proto__:null,hasBrowserEnv:Oe,hasStandardBrowserEnv:Pe,hasStandardBrowserWebWorkerEnv:Ee,navigator:Se,origin:Ae}),...Re};const Te=le;function Ne(e){if(e>Te)throw new ce("FormData field is too deeply nested ("+e+" levels). Max depth: "+Te,ce.ERR_FORM_DATA_DEPTH_EXCEEDED)}function xe(e){function t(e,n,r,i){Ne(i);let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&Y.isArray(r)?r.length:o,s?(Y.hasOwnProp(r,o)?r[o]=Y.isArray(r[o])?r[o].concat(n):[r[o],n]:r[o]=n,!a):(Y.hasOwnProp(r,o)&&Y.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&Y.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!a)}if(Y.isFormData(e)&&Y.isFunction(e.entries)){const n={};return Y.forEachEntry(e,((e,r)=>{t(function(e){const t=[],n=/\w+|\[(\w*)]/g;let r;for(;null!==(r=n.exec(e));)Ne(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)})),n}return null}const De=(e,t)=>null!=e&&Y.hasOwnProp(e,t)?e[t]:void 0,ke={transitional:Ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=Y.isObject(e);if(i&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return r?JSON.stringify(xe(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e)||Y.isReadableStream(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){const t=De(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ye(e,new je.classes.URLSearchParams,{visitor:function(e,t,n,r){return je.isNode&&Y.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=Y.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=De(this,"env"),r=n&&n.FormData;return ye(o?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(Y.isString(e))try{return(0,JSON.parse)(e),Y.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=De(this,"transitional")||ke.transitional,n=t&&t.forcedJSONParsing,r=De(this,"responseType"),i="json"===r;if(Y.isResponse(e)||Y.isReadableStream(e))return e;if(e&&Y.isString(e)&&(n&&!r||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,De(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw ce.from(e,ce.ERR_BAD_RESPONSE,this,null,De(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:je.classes.FormData,Blob:je.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function Ue(e,t){const n=this||ke,r=t||n,i=ue.from(r.headers);let o=r.data;return Y.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Fe(e){return!(!e||!e.__CANCEL__)}Y.forEach(["delete","get","head","post","put","patch","query"],(e=>{ke.headers[e]={}}));class Ie extends ce{constructor(e,t,n){super(null==e?"canceled":e,ce.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}}function qe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ce("Request failed with status code "+n.status,n.status>=400&&n.status<500?ce.ERR_BAD_REQUEST:ce.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Le=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[a];i||(i=u),n[o]=s,r[o]=u;let l=a,d=0;for(;l!==o;)d+=n[l++],l%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(n,o){let a,s,u=0,c=1e3/o;const l=(n,o=Date.now())=>{u=o,a=null,s&&(clearTimeout(s),s=null),(n=>{if(!n||"number"!=typeof n.loaded)return;const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(o,a):o,u=Math.max(0,s-r),c=i(u);r=Math.max(r,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-u;n>=c?l(e,t):(a=e,s||(s=setTimeout((()=>{s=null,l(a)}),c-n)))},()=>a&&l(a)]}(0,n)},Me=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},He=e=>(...t)=>Y.asap((()=>e(...t)));var Be=je.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(je.origin),je.navigator&&/(msie|trident)/i.test(je.navigator.userAgent)):()=>!0,We=je.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Y.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Y.isString(r)&&s.push(`path=${r}`),Y.isString(i)&&s.push(`domain=${i}`),!0===o&&s.push("secure"),Y.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),i=r.indexOf("=");if(-1!==i&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch(e){return r.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const ze=/^https?:(?!\/\/)/i,Ve=/[\t\n\r]/g;function Ke(e,t){if("string"==typeof e&&ze.test(function(e){return function(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(Ve,"")}(e)))throw new ce('Invalid URL: missing "//" after protocol',ce.ERR_INVALID_URL,t)}function Je(e,t,n,r){Ke(t,r);let i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(i||!1===n)?(Ke(e,r),function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)):t}const Ge=e=>e instanceof ue?{...e}:e;function $e(e,t){e=e||{},t=t||{};const n=Object.create(null);function r(e,t,n,r){return Y.isPlainObject(e)&&Y.isPlainObject(t)?Y.merge.call({caseless:r},e,t):Y.isPlainObject(t)?Y.merge({},t):Y.isArray(t)?t.slice():t}function i(e,t,n,i){return Y.isUndefined(t)?Y.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!Y.isUndefined(t))return r(void 0,t)}function a(e,t){return Y.isUndefined(t)?Y.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return Y.hasOwnProp(t,o)?r(n,i):Y.hasOwnProp(e,o)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(Ge(e),Ge(t),0,!0)};return Y.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=Y.hasOwnProp(u,r)?u[r]:i,a=o(Y.hasOwnProp(e,r)?e[r]:void 0,Y.hasOwnProp(t,r)?t[r]:void 0,r);Y.isUndefined(a)&&o!==s||(n[r]=a)})),Y.hasOwnProp(t,"validateStatus")&&Y.isUndefined(t.validateStatus)&&!1===function(n){const r=Y.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Y.isUndefined(r)){if(!Y.isPlainObject(r))return;if(Y.hasOwnProp(r,n))return r[n]}const i=Y.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Y.isPlainObject(i)&&Y.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Y.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const Xe=["content-type","content-length"];function Qe(e){const t=$e({},e),n=e=>Y.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let i=n("withXSRFToken");const o=n("xsrfHeaderName"),a=n("xsrfCookieName");let s=n("headers");const u=n("auth"),c=n("baseURL"),l=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=ue.from(s),t.url=be(Je(c,d,l,t),n("params"),n("paramsSerializer")),u){const t=Y.getSafeProp(u,"username")||"",n=Y.getSafeProp(u,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))):"")))}catch(t){throw ce.from(t,ce.ERR_BAD_OPTION_VALUE,e)}}if(Y.isFormData(r)&&(je.hasStandardBrowserEnv||je.hasStandardBrowserWebWorkerEnv||Y.isReactNative(r)?s.setContentType(void 0):Y.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((([t,n])=>{Xe.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(s,r.getHeaders(),n("formDataHeaderPolicy"))),je.hasStandardBrowserEnv&&(Y.isFunction(i)&&(i=i(t)),!0===i||null==i&&Be(t.url))){const e=o&&a&&We.read(a);e&&s.set(o,e)}return t}var Ye="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Qe(e);let i=r.data;const o=ue.from(r.headers).normalize();let a,s,u,c,l,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function v(){if(!y)return;const r=ue.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());qe((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&y.responseURL.startsWith("file:"))&&setTimeout(v)},y.onabort=function(){y&&(n(new ce("Request aborted",ce.ECONNABORTED,e,y)),h(),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new ce(r,ce.ERR_NETWORK,e,y);i.event=t||null,n(i),h(),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ce(t,i.clarifyTimeoutError?ce.ETIMEDOUT:ce.ECONNABORTED,e,y)),h(),y=null},void 0===i&&o.setContentType(null),"setRequestHeader"in y&&Y.forEach(re(o),(function(e,t){y.setRequestHeader(t,e)})),Y.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),p&&([u,l]=Le(p,!0),y.addEventListener("progress",u)),f&&y.upload&&([s,c]=Le(f),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new Ie(null,e,y):t),y.abort(),h(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const _=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(r.url);if(_&&!je.protocols.includes(_))return n(new ce("Unsupported protocol "+_+":",ce.ERR_BAD_REQUEST,e)),void h();y.send(i||null)}))};const Ze=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const i=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof ce?t:new Ie(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new ce(`timeout of ${t}ms exceeded`,ce.ETIMEDOUT))}),t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i,{once:!0})));const{signal:s}=n;return s.unsubscribe=()=>Y.asap(a),s},et=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},tt=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*et(n,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},nt=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,rt=(e,t,n)=>t+2<n&&nt(e.charCodeAt(t+1))&&nt(e.charCodeAt(t+2)),it="1.18.1",{isFunction:ot}=Y,at=e=>{if(!Y.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},st=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ut=e=>{const t=void 0!==Y.global&&null!==Y.global?Y.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Y.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:o,Response:a}=e,s=i?ot(i):"function"==typeof fetch,u=ot(o),c=ot(a);if(!s)return!1;const l=s&&ot(n),d=s&&("function"==typeof r?(f=new r,e=>f.encode(e)):async e=>new Uint8Array(await new o(e).arrayBuffer()));var f;const p=u&&l&&st((()=>{let e=!1;const t=new o(je.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),h=c&&l&&st((()=>Y.isReadableStream(new a("").body))),y={stream:h&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!y[e]&&(y[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ce(`Response type '${e}' is not supported`,ce.ERR_NOT_SUPPORT,n)})}));const v=async e=>{if(null==e)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e)){const t=new o(je.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Y.isArrayBufferView(e)||Y.isArrayBuffer(e)?e.byteLength:(Y.isURLSearchParams(e)&&(e+=""),Y.isString(e)?(await d(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:s,signal:c,cancelToken:d,timeout:f,onDownloadProgress:_,onUploadProgress:g,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:C,maxContentLength:R,maxBodyLength:O}=Qe(e);const S=Y.isNumber(R)&&R>-1,P=Y.isNumber(O)&&O>-1;let E=i||fetch;m=m?(m+"").toLowerCase():"text";let A=Ze([c,d&&d.toAbortSignal()],f),j=null;const T=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let N,x=null;const D=()=>new ce("Request body larger than maxBodyLength limit",ce.ERR_BAD_REQUEST,e,j);try{let i;const c=(U="auth",Y.hasOwnProp(e,U)?e[U]:void 0);if(c){i={username:Y.getSafeProp(c,"username")||"",password:Y.getSafeProp(c,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,je.origin);if(!i&&(e.username||e.password)){i={username:at(e.username),password:at(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(i&&(b.delete("authorization"),b.set("Authorization","Basic "+btoa((k=(i.username||"")+":"+(i.password||""),encodeURIComponent(k).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))),S&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length;const t=r.length;for(let n=0;n<t;n++)if(37===r.charCodeAt(n)&&n+2<t){const t=r.charCodeAt(n+1),i=r.charCodeAt(n+2);nt(t)&&nt(i)&&(e-=2,n+=2)}let n=0,i=t-1;const o=e=>e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e));i>=0&&(61===r.charCodeAt(i)?(n++,i--):o(i)&&(n++,i-=3)),1===n&&i>=0&&(61===r.charCodeAt(i)||o(i))&&n++;const a=3*Math.floor(e/4)-(n||0);return a>0?a:0}let i=0;for(let e=0,t=r.length;e<t;e++){const n=r.charCodeAt(e);if(37===n&&rt(r,e,t))i+=1,e+=2;else if(n<128)i+=1;else if(n<2048)i+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=r.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}(t);if(n>R)throw new ce("maxContentLength size of "+R+" exceeded",ce.ERR_BAD_RESPONSE,e,j)}if(P&&"get"!==n&&"head"!==n){const e=await v(s);if("number"==typeof e&&isFinite(e)&&(N=e,e>O))throw D()}const d=P&&(Y.isReadableStream(s)||Y.isStream(s)),f=(e,t,n)=>tt(e,65536,(e=>{if(P&&e>O)throw x=D();t&&t(e)}),n);if(p&&"get"!==n&&"head"!==n&&(g||d)){if(N=null==N?await(async(e,t)=>{const n=Y.toFiniteNumber(e.getContentLength());return null==n?v(t):n})(b,s):N,0!==N||d){let e,n=new o(t,{method:"POST",body:s,duplex:"half"});if(Y.isFormData(s)&&(e=n.headers.get("content-type"))&&b.setContentType(e),n.body){const[e,t]=g&&Me(N,Le(He(g)))||[];s=f(n.body,e,t)}}}else if(d&&!u&&l&&"get"!==n&&"head"!==n)s=f(s);else if(d&&u&&!p&&"get"!==n&&"head"!==n)throw new ce("Stream request bodies are not supported by the current fetch implementation",ce.ERR_NOT_SUPPORT,e,j);Y.isString(w)||(w=w?"include":"omit");const F=u&&"credentials"in o.prototype;if(Y.isFormData(s)){const e=b.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&b.delete("content-type")}b.set("User-Agent","axios/"+it,!1);const I={...C,signal:A,method:n.toUpperCase(),headers:re(b.normalize()),body:s,duplex:"half",credentials:F?w:void 0};j=u&&new o(t,I);let q=await(u?E(j,C):E(t,I));const L=ue.from(q.headers);if(S){const t=Y.toFiniteNumber(L.getContentLength());if(null!=t&&t>R)throw new ce("maxContentLength size of "+R+" exceeded",ce.ERR_BAD_RESPONSE,e,j)}const M=h&&("stream"===m||"response"===m);if(h&&q.body&&(_||S||M&&T)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=q[e]}));const n=Y.toFiniteNumber(L.getContentLength()),[r,i]=_&&Me(n,Le(He(_),!0))||[];let o=0;const s=t=>{if(S&&(o=t,o>R))throw new ce("maxContentLength size of "+R+" exceeded",ce.ERR_BAD_RESPONSE,e,j);r&&r(t)};q=new a(tt(q.body,65536,s,(()=>{i&&i(),T&&T()})),t)}m=m||"text";let H=await y[Y.findKey(y,m)||"text"](q,e);if(S&&!h&&!M){let t;if(null!=H&&("number"==typeof H.byteLength?t=H.byteLength:"number"==typeof H.size?t=H.size:"string"==typeof H&&(t="function"==typeof r?(new r).encode(H).byteLength:H.length)),"number"==typeof t&&t>R)throw new ce("maxContentLength size of "+R+" exceeded",ce.ERR_BAD_RESPONSE,e,j)}return!M&&T&&T(),await new Promise(((t,n)=>{qe(t,n,{data:H,headers:ue.from(q.headers),status:q.status,statusText:q.statusText,config:e,request:j})}))}catch(t){if(T&&T(),A&&A.aborted&&A.reason instanceof ce){const n=A.reason;throw n.config=e,j&&(n.request=j),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(x)throw j&&!x.request&&(x.request=j),x;if(t instanceof ce)throw j&&!t.request&&(t.request=j),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new ce("Network Error",ce.ERR_NETWORK,e,j,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw ce.from(t,t&&t.code,e,j,t&&t.response)}var k,U}},ct=new Map,lt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a,s,u=o.length,c=ct;for(;u--;)a=o[u],s=c.get(a),void 0===s&&c.set(a,s=u?new Map:ut(t)),c=s;return s};lt();const dt={http:null,xhr:Ye,fetch:{get:lt}};Y.forEach(dt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const ft=e=>`- ${e}`,pt=e=>Y.isFunction(e)||null===e||!1===e;var ht=function(e,t){e=Y.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){let n;if(r=e[a],i=r,!pt(r)&&(i=dt[(n=String(r)).toLowerCase()],void 0===i))throw new ce(`Unknown adapter '${n}'`);if(i&&(Y.isFunction(i)||(i=i.get(t))))break;o[n||"#"+a]=i}if(!i){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(ft).join("\n"):" "+ft(e[0]):"as no adapter specified";throw new ce("There is no suitable adapter to dispatch the request "+t,ce.ERR_NOT_SUPPORT)}return i};function yt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ie(null,e)}function vt(e){return yt(e),e.headers=ue.from(e.headers),e.data=Ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ht(e.adapter||ke.adapter,e)(e).then((function(t){yt(e),e.response=t;try{t.data=Ue.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=ue.from(t.headers),t}),(function(t){if(!Fe(t)&&(yt(e),t&&t.response)){e.response=t.response;try{t.response.data=Ue.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=ue.from(t.response.headers)}return Promise.reject(t)}))}const _t={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{_t[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const gt={};_t.transitional=function(e,t,n){function r(e,t){return"[Axios v"+it+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new ce(r(i," has been removed"+(t?" in "+t:"")),ce.ERR_DEPRECATED);return t&&!gt[i]&&(gt[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},_t.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var mt={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new ce("options must be an object",ce.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new ce("option "+o+" must be "+n,ce.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ce("Unknown option "+o,ce.ERR_BAD_OPTION)}},validators:_t};const bt=mt.validators;class wt{constructor(e){this.defaults=e||{},this.interceptors={request:new we,response:new we}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),i=-1===r?"":n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=$e(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&mt.assertOptions(n,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean),legacyInterceptorReqResOrdering:bt.transitional(bt.boolean),advertiseZstdAcceptEncoding:bt.transitional(bt.boolean),validateStatusUndefinedResolves:bt.transitional(bt.boolean)},!1),null!=r&&(Y.isFunction(r)?t.paramsSerializer={serialize:r}:mt.assertOptions(r,{encode:bt.function,serialize:bt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),mt.assertOptions(t,{baseUrl:bt.spelling("baseURL"),withXsrfToken:bt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&Y.merge(i.common,i[t.method]);i&&Y.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete i[e]})),t.headers=ue.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||Ce;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,d=0;if(!s){const e=[vt.bind(this),void 0];for(e.unshift(...a),e.push(...u),l=e.length,c=Promise.resolve(t);d<l;)c=c.then(e[d++],e[d++]);return c}l=a.length;let f=t;for(;d<l;){const e=a[d++],t=a[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=vt.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=u.length;d<l;)c=c.then(u[d++],u[d++]);return c}getUri(e){return be(Je((e=$e(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}Y.forEach(["delete","get","head","options"],(function(e){wt.prototype[e]=function(t,n){return this.request($e(n||{},{method:e,url:t,data:n&&Y.hasOwnProp(n,"data")?n.data:void 0}))}})),Y.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,i){return this.request($e(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}wt.prototype[e]=t(),"query"!==e&&(wt.prototype[e+"Form"]=t(!0))}));class Ct{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Ie(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Ct((function(t){e=t})),cancel:e}}}const Rt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Rt).forEach((([e,t])=>{Rt[t]=e}));const Ot=function e(t){const n=new wt(t),i=r(wt.prototype.request,n);return Y.extend(i,wt.prototype,n,{allOwnKeys:!0}),Y.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e($e(t,n))},i}(ke);Ot.Axios=wt,Ot.CanceledError=Ie,Ot.CancelToken=Ct,Ot.isCancel=Fe,Ot.VERSION=it,Ot.toFormData=ye,Ot.AxiosError=ce,Ot.Cancel=Ot.CanceledError,Ot.all=function(e){return Promise.all(e)},Ot.spread=function(e){return function(t){return e.apply(null,t)}},Ot.isAxiosError=function(e){return Y.isObject(e)&&!0===e.isAxiosError},Ot.mergeConfig=$e,Ot.AxiosHeaders=ue,Ot.formToJSON=e=>xe(Y.isHTMLForm(e)?new FormData(e):e),Ot.getAdapter=ht,Ot.HttpStatusCode=Rt,Ot.default=Ot,e.exports=Ot},3301:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>U,__assign:()=>o,__asyncDelegator:()=>S,__asyncGenerator:()=>O,__asyncValues:()=>P,__await:()=>R,__awaiter:()=>h,__classPrivateFieldGet:()=>x,__classPrivateFieldIn:()=>k,__classPrivateFieldSet:()=>D,__createBinding:()=>v,__decorate:()=>s,__disposeResources:()=>I,__esDecorate:()=>c,__exportStar:()=>_,__extends:()=>i,__generator:()=>y,__importDefault:()=>N,__importStar:()=>T,__makeTemplateObject:()=>E,__metadata:()=>p,__param:()=>u,__propKey:()=>d,__read:()=>m,__rest:()=>a,__rewriteRelativeImportExtension:()=>q,__runInitializers:()=>l,__setFunctionName:()=>f,__spread:()=>b,__spreadArray:()=>C,__spreadArrays:()=>w,__values:()=>g,default:()=>L});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function a(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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t,n,r,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=r.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?r.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f=!1,p=n.length-1;p>=0;p--){var h={};for(var y in r)h[y]="access"===y?{}:r[y];for(var y in r.access)h.access[y]=r.access[y];h.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var v=(0,n[p])("accessor"===u?{get:d.get,set:d.set}:d[c],h);if("accessor"===u){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(d.get=s),(s=a(v.set))&&(d.set=s),(s=a(v.init))&&i.unshift(s)}else(s=a(v))&&("field"===u?i.unshift(s):d[c]=s)}l&&Object.defineProperty(l,r.name,d),f=!0}function l(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function y(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var v=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function _(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||v(t,e,n)}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function w(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function C(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function R(e){return this instanceof R?(this.v=e,this):new R(e)}function O(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof R?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function S(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:R(e[r](t)),done:!1}:i?i(t):t}:i}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=g(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},j=function(e){return j=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},j(e)};function T(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=j(e),r=0;r<n.length;r++)"default"!==n[r]&&v(t,e,n[r]);return A(t,e),t}function N(e){return e&&e.__esModule?e:{default:e}}function x(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function D(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}function k(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function U(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var F="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function I(e){function t(t){e.error=e.hasError?new F(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,r=0;return function i(){for(;n=e.stack.pop();)try{if(!n.async&&1===r)return r=0,e.stack.push(n),Promise.resolve().then(i);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(o).then(i,(function(e){return t(e),i()}))}else r|=1}catch(e){t(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function q(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,r,i,o){return n?t?".jsx":".js":!r||i&&o?r+i+"."+o.toLowerCase()+"js":e})):e}const L={__extends:i,__assign:o,__rest:a,__decorate:s,__param:u,__esDecorate:c,__runInitializers:l,__propKey:d,__setFunctionName:f,__metadata:p,__awaiter:h,__generator:y,__createBinding:v,__exportStar:_,__values:g,__read:m,__spread:b,__spreadArrays:w,__spreadArray:C,__await:R,__asyncGenerator:O,__asyncDelegator:S,__asyncValues:P,__makeTemplateObject:E,__importStar:T,__importDefault:N,__classPrivateFieldGet:x,__classPrivateFieldSet:D,__classPrivateFieldIn:k,__addDisposableResource:U,__disposeResources:I,__rewriteRelativeImportExtension:q}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function e(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(r,{default:()=>S});var c=n(4756),l=function(){return u((function e(){var t,n,r,o,a,s,u,c,l,d,f,p,h,y,v,_,g,m,b,w,C,R,O,S,P=this,E=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.server=E.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=null!==(t=this.server.cacheSearchResultsForSeconds)&&void 0!==t?t:120,this.additionalSearchParameters=null!==(n=E.additionalSearchParameters)&&void 0!==n?n:{},this.additionalSearchParameters.query_by=null!==(r=null!==(o=this.additionalSearchParameters.queryBy)&&void 0!==o?o:this.additionalSearchParameters.query_by)&&void 0!==r?r:"",this.additionalSearchParameters.preset=null!==(a=null!==(s=this.additionalSearchParameters.preset)&&void 0!==s?s:this.additionalSearchParameters.preset)&&void 0!==a?a:"",this.additionalSearchParameters.sort_by=null!==(u=null!==(c=this.additionalSearchParameters.sortBy)&&void 0!==c?c:this.additionalSearchParameters.sort_by)&&void 0!==u?u:"",this.additionalSearchParameters.highlight_full_fields=null!==(l=null!==(d=this.additionalSearchParameters.highlightFullFields)&&void 0!==d?d:this.additionalSearchParameters.highlight_full_fields)&&void 0!==l?l:this.additionalSearchParameters.query_by,this.geoLocationField=null!==(f=E.geoLocationField)&&void 0!==f?f:"_geoloc",this.facetableFieldsWithSpecialCharacters=null!==(p=E.facetableFieldsWithSpecialCharacters)&&void 0!==p?p:[],this.collectionSpecificSearchParameters=null!==(h=E.collectionSpecificSearchParameters)&&void 0!==h?h:{},Object.keys(this.collectionSpecificSearchParameters).forEach((function(e){var t,n,r,i,o,a,s=P.collectionSpecificSearchParameters[e];s.query_by=null!==(t=s.queryBy)&&void 0!==t?t:s.query_by,s.preset=null!==(n=s.preset)&&void 0!==n?n:s.preset,s.sort_by=null!==(r=s.sortBy)&&void 0!==r?r:s.sort_by,s.highlight_full_fields=null!==(i=null!==(o=null!==(a=s.highlightFullFields)&&void 0!==a?a:s.highlight_full_fields)&&void 0!==o?o:P.additionalSearchParameters.highlight_full_fields)&&void 0!==i?i:s.query_by,Object.keys(s).forEach((function(e){return void 0===s[e]?delete s[e]:{}}))})),this.renderingContent=E.renderingContent,this.flattenGroupedHits=null===(y=E.flattenGroupedHits)||void 0===y||y,this.facetByOptions=null!==(v=E.facetByOptions)&&void 0!==v?v:{},this.filterByOptions=null!==(_=E.filterByOptions)&&void 0!==_?_:{},this.sortByOptions=null!==(g=E.sortByOptions)&&void 0!==g?g:{},this.collectionSpecificFacetByOptions=null!==(m=E.collectionSpecificFacetByOptions)&&void 0!==m?m:{},this.collectionSpecificFilterByOptions=null!==(b=E.collectionSpecificFilterByOptions)&&void 0!==b?b:{},this.collectionSpecificSortByOptions=null!==(w=E.collectionSpecificSortByOptions)&&void 0!==w?w:{},this.union=null!==(C=E.union)&&void 0!==C&&C,this.useOverrideTags=null!==(R=E.useOverrideTags)&&void 0!==R&&R,this.flipNegativeRefinementOperator=null!==(O=E.flipNegativeRefinementOperator)&&void 0!==O&&O,this.interpretNegativeNumericFacetFiltersAsExclusions=null!==(S=E.interpretNegativeNumericFacetFiltersAsExclusions)&&void 0!==S&&S}),[{key:"validate",value:function(){if((this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some((function(e){return e.queryBy})))&&console.warn("[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in additionalSearchParameters instead of camelCased parameters. For example: Use query_by instead of queryBy. camelCased parameters will be deprecated in a future version. We're making this change so that parameter names are identical to the ones sent to Typesense (which are all snake_cased), and to also keep the types for these parameters in sync with the types defined in typesense-js."),0===this.additionalSearchParameters.query_by.length&&0===this.additionalSearchParameters.preset.length&&(0===Object.keys(this.collectionSpecificSearchParameters).length||Object.values(this.collectionSpecificSearchParameters).some((function(e){return 0===(e.query_by||"").length&&0===(e.preset||"").length}))))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}])}(),d=n(8567);function f(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v=["q","conversation","conversation_id","conversation_model_id"],_=function(){return u((function e(t,n,r){i(this,e),this.instantsearchRequests=t,this.typesenseClient=n,this.configuration=r,this.additionalSearchParameters=r.additionalSearchParameters,this.collectionSpecificSearchParameters=r.collectionSpecificSearchParameters}),[{key:"_shouldUseExactMatchForField",value:function(e,t){var n,r;return!1!==(null===(n=this.configuration.collectionSpecificFilterByOptions)||void 0===n||null===(n=n[t])||void 0===n||null===(n=n[e])||void 0===n?void 0:n.exactMatch)&&!1!==(null===(r=this.configuration.filterByOptions)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.exactMatch)}},{key:"_adaptFacetFilters",value:function(e,t){var n=this,r="";return e?r=e.map((function(e){if(Array.isArray(e)){var r={};e.forEach((function(e){var t=n._parseFacetFilter(e),i=t.fieldName,o=t.fieldValue;r[i]=r[i]||[],r[i].push(o)})),Object.keys(r).length>1&&console.error("[Typesense-Instantsearch-Adapter] Typesense does not support cross-field ORs at the moment. The adapter could not OR values between these fields: ".concat(Object.keys(r).join(",")));var i=Object.keys(r)[0],o=r[i].reduce((function(e,t){return n._isExcludedFacetValue(t)?e[0].push(t.substring(1)):e[1].push(t),e}),[[],[]]),a=y(o,2),s=a[0],u=a[1],c=[];if(u.length>0){var l=n._shouldUseExactMatchForField(i,t)?":=":":";c.push("".concat(i).concat(l,"[").concat(u.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}if(s.length>0){var d=n._shouldUseExactMatchForField(i,t)?":!=":":!";n.configuration.flipNegativeRefinementOperator?c.push("(".concat(s.map((function(e){return"".concat(i).concat(d).concat(n._escapeFacetValue(e))})).join(" || "),")")):c.push("".concat(i).concat(d,"[").concat(s.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}return c.filter((function(e){return e})).join(" && ")}var f,p=n._parseFacetFilter(e),h=p.fieldName,v=p.fieldValue;if(n._isExcludedFacetValue(v)){var _=n._shouldUseExactMatchForField(h,t)?":!=":":!";f="".concat(h).concat(_,"[").concat(n._escapeFacetValue(v.substring(1)),"]")}else{var g=n._shouldUseExactMatchForField(h,t)?":=":":";f="".concat(h).concat(g,"[").concat(n._escapeFacetValue(v),"]")}return f})).join(" && "):r}},{key:"_parseFacetFilter",value:function(e){var t,n,r,i,o;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var a=this.configuration.facetableFieldsWithSpecialCharacters.flat().map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(a.join("|"),"):(.*)$")),null!=(r=e.match(n)))return{fieldName:i="".concat(r[1]),fieldValue:o="".concat(r[2])}}return n=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n))?console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a facet filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter.")):(i="".concat(r[1]).concat(r[2]),o="".concat(r[3])),{fieldName:i,fieldValue:o}}},{key:"_isExcludedFacetValue",value:function(e){return e.startsWith("-")&&(this.configuration.interpretNegativeNumericFacetFiltersAsExclusions||!this._isNumber(e))}},{key:"_escapeFacetValue",value:function(e){return"string"==typeof e&&e.startsWith("\\-")&&(e=e.substring(1)),"boolean"==typeof e||"true"===e||"false"===e||this._isNumber(e)?e:"`".concat(e,"`")}},{key:"_isNumber",value:function(e){return Number.isInteger(e%1)||!!(e%1)}},{key:"_adaptNumericFilters",value:function(e){var t=this,n="";if(!e)return n;var r={};e.forEach((function(e){var n=t._parseNumericFilter(e),i=n.fieldName,o=n.operator,a=n.fieldValue;r[i]=r[i]||{},r[i][o]=a}));var i=[];return Object.keys(r).forEach((function(e){null!=r[e]["<="]&&null!=r[e][">="]?i.push("".concat(e,":=[").concat(r[e][">="],"..").concat(r[e]["<="],"]")):null!=r[e]["<="]?i.push("".concat(e,":<=").concat(r[e]["<="])):null!=r[e][">="]?i.push("".concat(e,":>=").concat(r[e][">="])):null!=r[e]["="]?i.push("".concat(e,":=").concat(r[e]["="])):console.warn("[Typesense-Instantsearch-Adapter] Unsupported operator found ".concat(JSON.stringify(r[e])))})),i.join(" && ")}},{key:"_parseNumericFilter",value:function(e){var t,n,r,i,o,a;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var s=this.configuration.facetableFieldsWithSpecialCharacters.map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(s.join("|"),")(<=|>=|>|<|=)(.*)$")),null!=(r=e.match(n))){var u=y(r,4);return{fieldName:i=u[1],operator:o=u[2],fieldValue:a=u[3]}}}if(n=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n)))console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a numeric filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter."));else{var c=y(r,4);i=c[1],o=c[2],a=c[3]}return{fieldName:i,operator:o,fieldValue:a}}},{key:"_adaptGeoFilter",value:function(e){var t=e.insideBoundingBox,n=e.aroundRadius,r=e.aroundLatLng,i=e.insidePolygon;if(t){var o,a,s,u;if(Array.isArray(t)){var c=y(t.flat(),4);o=c[0],a=c[1],s=c[2],u=c[3]}else{var l=y(t.split(","),4);o=l[0],a=l[1],s=l[2],u=l[3]}return"".concat(this.configuration.geoLocationField,":(").concat(o,", ").concat(a,", ").concat(o,", ").concat(u,", ").concat(s,", ").concat(u,", ").concat(s,", ").concat(a,")")}if(r||n){if(!n||"all"===n)throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var d="".concat(parseFloat(n)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(r,", ").concat(d,")")}if(i){var f=i;return Array.isArray(i)&&(f=i.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(f,")")}}},{key:"_splitByTopLevelAnd",value:function(e){for(var t=[],n="",r=!1,i=0;i<e.length;i+=1){var o=e[i],a=e[i+1];"`"===o&&(r=!r),r||"&"!==o||"&"!==a?n+=o:(""!==n.trim()&&t.push(n.trim()),n="",i+=1)}return""!==n.trim()&&t.push(n.trim()),t}},{key:"_splitListValues",value:function(e){for(var t=[],n="",r=!1,i=0;i<e.length;i+=1){var o=e[i];"`"===o&&(r=!r),r||","!==o?n+=o:(""!==n.trim()&&t.push(n.trim()),n="")}return""!==n.trim()&&t.push(n.trim()),t}},{key:"_parseListClause",value:function(e){var t=e.trim(),n=t.indexOf("["),r=t.lastIndexOf("]");if(-1===n||-1===r||r!==t.length-1)return null;var i=t.slice(0,n).trim(),o=t.slice(n+1,r),a=[":!=",":=",":!",":"].find((function(e){return i.endsWith(e)}));if(!a)return null;var s=i.slice(0,i.length-a.length).trim();return s?{fieldName:s,operator:a,values:this._splitListValues(o)}:null}},{key:"_mergeSameFieldExclusionListClauses",value:function(e){var t=this;if(!e)return e;var n=this._splitByTopLevelAnd(e),r={},i=[];return n.forEach((function(e,n){var o=t._parseListClause(e);if(o){var a=":!"===o.operator||":!="===o.operator?"exclude":null;if(null!=a){var s="".concat(o.fieldName,"|").concat(a);r[s]||(r[s]={clauseIndex:n,fieldName:o.fieldName,operator:o.operator,normalizedOperator:a,values:[]}),o.values.forEach((function(e){r[s].values.includes(e)||r[s].values.push(e)}))}else i.push({clauseIndex:n,clause:e})}else i.push({clauseIndex:n,clause:e})})),Object.values(r).forEach((function(e){i.push({clauseIndex:e.clauseIndex,clause:"".concat(e.fieldName).concat(e.operator,"[").concat(e.values.join(","),"]")})})),i.sort((function(e,t){return e.clauseIndex-t.clauseIndex})).map((function(e){return e.clause})).join(" && ")}},{key:"_adaptFilters",value:function(e,t){var n=[];e.filters&&n.push(e.filters),n.push(this._adaptFacetFilters(e.facetFilters,t)),n.push(this._adaptNumericFilters(e.numericFilters)),n.push(this._adaptGeoFilter(e));var r=n.filter((function(e){return e&&""!==e})).join(" && ");return this.configuration.flipNegativeRefinementOperator?this._mergeSameFieldExclusionListClauses(r):r}},{key:"_adaptIndexName",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_adaptFacetBy",value:function(e,t){var n=this;return[e].flat().map((function(e){var r;return null!==(r=n.configuration.collectionSpecificFacetByOptions)&&void 0!==r&&null!==(r=r[t])&&void 0!==r&&r[e]?"".concat(e).concat(n.configuration.collectionSpecificFacetByOptions[t][e]):n.configuration.facetByOptions[e]?"".concat(e).concat(n.configuration.facetByOptions[e]):e})).join(",")}},{key:"_adaptRulesContextsToOverrideTags",value:function(e){return e.join(",")}},{key:"_buildSearchParameters",value:function(e){for(var t,n,r=e.params,i=e.indexName,o=this._adaptIndexName(i),a={},s=0,u=Object.entries(this.additionalSearchParameters);s<u.length;s++){var c=y(u[s],2),l=c[0],d=c[1];a[this._camelToSnakeCase(l)]=d}if(this.collectionSpecificSearchParameters[o])for(var f=0,p=Object.entries(this.collectionSpecificSearchParameters[o]);f<p.length;f++){var h=y(p[f],2),v=h[0],_=h[1];a[this._camelToSnakeCase(v)]=_}var g=Object.assign({},a),m=this._adaptSortBy(i);Object.assign(g,{collection:o,q:""===r.query||void 0===r.query?"*":r.query,facet_by:a.facet_by||this._adaptFacetBy(r.facets,o),filter_by:this._adaptFilters(r,o)||a.filter_by,sort_by:m||a.sort_by,max_facet_values:r.maxValuesPerFacet,page:(r.page||0)+1}),null!=r.hitsPerPage&&(g.per_page=r.hitsPerPage),r.facetQuery&&(g.facet_query="".concat(r.facetName,":").concat(r.facetQuery),g.per_page=0),r.ruleContexts&&r.ruleContexts.length>0&&(g[this.configuration.useOverrideTags?"override_tags":"curation_tags"]=this._adaptRulesContextsToOverrideTags(r.ruleContexts)),r.typesenseVectorQuery&&(g.vector_query=r.typesenseVectorQuery);var b=(null===(t=this.configuration.collectionSpecificSortByOptions)||void 0===t||null===(t=t[o])||void 0===t?void 0:t[g.sort_by])||(null===(n=this.configuration.sortByOptions)||void 0===n?void 0:n[g.sort_by]);return null!=(null==b?void 0:b.enable_overrides)&&(g.enable_overrides=b.enable_overrides),Object.fromEntries(Object.entries(g).filter((function(e){var t=y(e,2),n=(t[0],t[1]);return null!=n&&""!==n})))}},{key:"_camelToSnakeCase",value:function(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}},{key:"request",value:(e=t(c.mark((function e(){var t,n,r,i,o,a,s,u,l,d,p=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.instantsearchRequests.map((function(e){return p._buildSearchParameters(e)})),i={},!0!==(null===(t=r[0])||void 0===t?void 0:t.conversation)&&"true"!==(null===(n=r[0])||void 0===n?void 0:n.conversation)||(o=r[0],a=o.q,s=o.conversation,u=o.conversation_id,l=o.conversation_model_id,i={q:a,conversation:s,conversation_id:u,conversation_model_id:l},r=r.map((function(e){return e.q,e.conversation,e.conversation_id,e.conversation_model_id,f(e,v)}))),d={searches:r},this.configuration.union&&(d.union=this.configuration.union,["page","per_page","offset","limit","limit_hits"].forEach((function(e){null!=r[0][e]&&(i[e]=r[0][e])}))),e.abrupt("return",this.typesenseClient.multiSearch.perform(d,i));case 6:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}],[{key:"INDEX_NAME_MATCHING_REGEX",get:function(){return new RegExp("^(.+?)(?=(/sort/(.*))|$)")}},{key:"DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*)((?!:).):(?!:)(.*)")}},{key:"DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*?)(<=|>=|>|<|=)(.*)")}}]);var e}();function g(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b={_adaptHighlightTag:function(e,t,n){return e.replace(new RegExp("<mark>","g"),t||"<mark>").replace(new RegExp("</mark>","g"),n||"</mark>")},_adaptNumberOfPages:function(){var e=this.typesenseResponse.union_request_params?this.typesenseResponse.union_request_params[0]:this.typesenseResponse.request_params,t=(null==e?void 0:e.per_page)||10,n=this.typesenseResponse.found/t;return Number.isFinite(n)?Math.ceil(n):1}};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(){return u((function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};i(this,e),this.typesenseResponse=t,this.instantsearchRequest=n,this.configuration=r,this.allTypesenseResults=o,this.fullTypesenseResponse=a}),[{key:"_adaptGroupedHits",value:function(e){var t=this,n=[];return n=e.map((function(e){var n=t._adaptHits(e.hits);return n.forEach((function(t){t.group_key=t._group_key=e.group_key,e.found&&(t._group_found=e.found)})),n})),this.configuration.flattenGroupedHits?n.flat():n.map((function(e){return C(C({},e[0]),{},{_grouped_hits:e})}))}},{key:"_adaptHits",value:function(e){var t=this;return e.map((function(e){var n=C({},e.document);n.objectID=e.document.id,n._snippetResult=t._adaptHighlightResult(e,"snippet"),n._highlightResult=t._adaptHighlightResult(e,"value"),n._rawTypesenseHit=e,t.fullTypesenseResponse.conversation&&(n._rawTypesenseConversation=t.fullTypesenseResponse.conversation),["text_match","geo_distance_meters","curated","text_match_info","hybrid_search_info","vector_distance","collection","search_index"].forEach((function(t){Object.keys(e).includes(t)&&!Object.keys(n).includes(t)&&(n[t]=e[t])}));var r=n[t.configuration.geoLocationField];return r&&(n._geoloc={lat:r[0],lng:r[1]}),n}))}},{key:"_adaptHighlightResult",value:function(e,t){var n={};return null!=e.highlight&&this.isHighlightPost0240RCN32Format(e.highlight)?this.adaptHighlightObject(e,n,t):this.adaptHighlightsArray(e,n,t),n}},{key:"isHighlightPost0240RCN32Format",value:function(e){return null==e.full&&null==e.snippet}},{key:"adaptHighlightsArray",value:function(e,t,n){var r=this;Object.assign.apply(Object,[t].concat(g(Object.entries(e.document).map((function(e){var t=y(e,2);return m({},t[0],{value:t[1],matchLevel:"none",matchedWords:[]})}))))),e.highlights.forEach((function(e){t[e.field]={value:e[n]||e["".concat(n,"s")],matchLevel:"full",matchedWords:e.matched_tokens},e.indices&&(t[e.field].matchedIndices=e.indices)})),Object.entries(t).forEach((function(i){var a=y(i,2),s=a[0],u=a[1],c=s,l=u.value,d=u.matchLevel,f=u.matchedWords,p=u.matchedIndices;null==l?t[c]=r._adaptHighlightNullValue():Array.isArray(l)?(t[c]=[],e.document[c].forEach((function(e,i){p&&p.includes(i)?t[c].push({value:r._adaptHighlightTag("".concat(l[p.indexOf(i)]),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag),matchLevel:d,matchedWords:f[i]}):"object"===o(e)?t[c].push(r._adaptHighlightInObjectValue(e,{},n)):t[c].push({value:"".concat(e),matchLevel:"none",matchedWords:[]})}))):"object"===o(l)?t[c]=r._adaptHighlightInObjectValue(l,{},n):t[c].value=r._adaptHighlightTag("".concat(l),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag)}))}},{key:"adaptHighlightObject",value:function(e,t,n){Object.assign(t,this._adaptHighlightInObjectValue(e.document,e.highlight,n))}},{key:"_adaptHighlightInObjectValue",value:function(e,t,n){var r=this;return Object.assign.apply(Object,[{}].concat(g(Object.entries(e).map((function(e){var i,a=y(e,2),s=a[0],u=a[1];if(null==u)i=r._adaptHighlightNullValue();else if(Array.isArray(u)){var c;i=r._adaptHighlightInArrayValue(u,null!==(c=null==t?void 0:t[s])&&void 0!==c?c:[],n)}else if("object"===o(u)){var l;i=r._adaptHighlightInObjectValue(u,null!==(l=null==t?void 0:t[s])&&void 0!==l?l:{},n)}else i=r._adaptHighlightInPrimitiveValue(u,null==t?void 0:t[s],n);return m({},s,i)})))))}},{key:"_adaptHighlightInArrayValue",value:function(e,t,n){var r=this;return e.map((function(e,i){var a;if(null==e)a=r._adaptHighlightNullValue();else if(Array.isArray(e)){var s;a=r._adaptHighlightInArrayValue(e,null!==(s=null==t?void 0:t[i])&&void 0!==s?s:[],n)}else if("object"===o(e)){var u;a=r._adaptHighlightInObjectValue(e,null!==(u=null==t?void 0:t[i])&&void 0!==u?u:{},n)}else a=r._adaptHighlightInPrimitiveValue(e,null==t?void 0:t[i],n);return a}))}},{key:"_adaptHighlightInPrimitiveValue",value:function(e,t,n){if(null!=t){var r,i,o,a=null!==(r=null!==(i=null!==(o=t[n])&&void 0!==o?o:t.highlight)&&void 0!==i?i:t.snippet)&&void 0!==r?r:e;return{value:this._adaptHighlightTag("".concat(a),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:(t.matched_tokens||[]).length>0?"full":"none",matchedWords:t.matched_tokens||[]}}return{value:this._adaptHighlightTag("".concat(e),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:"none",matchedWords:[]}}},{key:"_adaptHighlightNullValue",value:function(){return{value:"",matchLevel:"none",matchedWords:[]}}},{key:"_adaptFacets",value:function(e){var t={};return Array.isArray(e)&&e.forEach((function(e){Object.assign(t,m({},e.field_name,Object.assign.apply(Object,[{}].concat(g(e.counts.map((function(e){return m({},e.value,e.count)})))))))})),t}},{key:"_adaptFacetStats",value:function(e){var t={};return Array.isArray(e)&&e.forEach((function(e){e.stats&&Object.keys(e.stats).length>0&&Object.assign(t,m({},e.field_name,e.stats))})),t}},{key:"_adaptRenderingContent",value:function(e){var t,n=Object.assign({},this.configuration.renderingContent);return null==(null===(t=n.facetOrdering)||void 0===t||null===(t=t.facets)||void 0===t?void 0:t.order)&&(n.facetOrdering=n.facetOrdering||{},n.facetOrdering.facets=n.facetOrdering.facets||{},n.facetOrdering.facets.order=g(new Set((Array.isArray(e)?e:[]).map((function(e){return e.field_name})).concat(this.allTypesenseResults.map((function(e){return e.facet_counts||[]})).flat().map((function(e){return e.field_name})).filter((function(e){return e})))))),n}},{key:"_adaptUserData",value:function(e){return e?Array.isArray(e)?e:[e]:[]}},{key:"adapt",value:function(){var e=this._adaptRenderingContent(this.typesenseResponse.facet_counts||[]),t=this.typesenseResponse.union_request_params?this.typesenseResponse.union_request_params[0]:this.typesenseResponse.request_params,n=C({hits:this.typesenseResponse.grouped_hits?this._adaptGroupedHits(this.typesenseResponse.grouped_hits):this._adaptHits(this.typesenseResponse.hits),nbHits:this.typesenseResponse.found,page:this.typesenseResponse.union_request_params?this.typesenseResponse.page:this.typesenseResponse.page-1,nbPages:this._adaptNumberOfPages(),hitsPerPage:(null==t?void 0:t.per_page)||10,facets:this._adaptFacets(this.typesenseResponse.facet_counts||[]),facets_stats:this._adaptFacetStats(this.typesenseResponse.facet_counts||[]),query:(null==t?void 0:t.q)||"",processingTimeMS:this.typesenseResponse.search_time_ms},Object.keys(e).length>0?{renderingContent:e}:null);return this.typesenseResponse.metadata&&(n.appliedRules=["typesense-override"],n.userData=this._adaptUserData(this.typesenseResponse.metadata)),this.typesenseResponse.parsed_nl_query&&(n.parsed_nl_query=this.typesenseResponse.parsed_nl_query),this.fullTypesenseResponse.conversation&&0===n.hits.length&&(n.hits=[{_rawTypesenseConversation:this.fullTypesenseResponse.conversation}]),n}}])}();Object.assign(R.prototype,b);var O=function(){return u((function e(t,n){i(this,e),this.typesenseResponse=t,this.instantsearchRequest=n}),[{key:"_adaptFacetHits",value:function(e){var t=this,n=[],r=e.find((function(e){return e.field_name===t.instantsearchRequest.params.facetName}));return void 0!==r&&(n=r.counts.map((function(e){return{value:e.value,highlighted:t._adaptHighlightTag(e.highlighted,t.instantsearchRequest.params.highlightPreTag,t.instantsearchRequest.params.highlightPostTag),count:e.count}}))),n}},{key:"adapt",value:function(){return{facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms}}}])}();Object.assign(O.prototype,b);var S=function(){return u((function e(t){var n=this;i(this,e),this.updateConfiguration(t),this.searchClient={clearCache:function(){return n.clearCache()},search:function(e){return n.searchTypesenseAndAdapt(e)},searchForFacetValues:function(e){return n.searchTypesenseForFacetValuesAndAdapt(e)}}}),[{key:"searchTypesenseAndAdapt",value:(r=t(c.mark((function e(t){var n,r,i,o,a,s=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:if(!(n=e.sent).union_request_params){e.next=12;break}return this._validateTypesenseResult(n),r=new R(n,t[0],this.configuration,[n],n),i=r.adapt(),o=t.map((function(){return i})),e.abrupt("return",{results:o});case 12:return a=n.results.map((function(e,r){return s._validateTypesenseResult(e),new R(e,t[r],s.configuration,n.results,n).adapt()})),e.abrupt("return",{results:a});case 14:e.next=20;break;case 16:throw e.prev=16,e.t0=e.catch(0),console.error(e.t0),e.t0;case 20:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return r.apply(this,arguments)})},{key:"searchTypesenseForFacetValuesAndAdapt",value:(n=t(c.mark((function e(t){var n,r,i=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,r=n.results.map((function(e,n){return i._validateTypesenseResult(e),new O(e,t[n],i.configuration).adapt()})),e.abrupt("return",r);case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return n.apply(this,arguments)})},{key:"_adaptAndPerformTypesenseRequest",value:(e=t(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new _(t,this.typesenseClient,this.configuration),e.next=3,n.request();case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"clearCache",value:function(){return this.typesenseClient=new d._t(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(e){return this.configuration=new l(e),this.configuration.validate(),this.typesenseClient=new d._t(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(e){if(e.error)throw new Error("".concat(e.code," - ").concat(e.error));if(!e.hits&&!e.grouped_hits)throw new Error("Did not find any hits. ".concat(e.code," - ").concat(e.error))}}]);var e,n,r}()})(),r.default})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TypesenseInstantSearchAdapter=t():e.TypesenseInstantSearchAdapter=t()}(self,(()=>(()=>{var e={3065:function(e,t,n){var r,i;!function(o,a){"use strict";r=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?e:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function c(e){return function(){typeof console!==t&&(u.call(this),this[e].apply(this,arguments))}}function l(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):e)}(r)||c.apply(this,arguments)}function d(e,n){var a,s,c,d=this,f="loglevel";function h(){var e;if(typeof window!==t&&f){try{e=window.localStorage[f]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+"=");-1!==i&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(e){}return void 0===d.levels[e]&&(e=void 0),e}}function p(e){var t=e;if("string"==typeof t&&void 0!==d.levels[t.toUpperCase()]&&(t=d.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=d.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?f+=":"+e:"symbol"==typeof e&&(f=void 0),d.name=e,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=n||l,d.getLevel=function(){return null!=c?c:null!=s?s:a},d.setLevel=function(e,n){return c=p(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&f){try{return void(window.localStorage[f]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(f)+"="+n+";"}catch(e){}}}(c),u.call(d)},d.setDefaultLevel=function(e){s=p(e),h()||d.setLevel(e,!1)},d.resetLevel=function(){c=null,function(){if(typeof window!==t&&f){try{window.localStorage.removeItem(f)}catch(e){}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(d)},d.enableAll=function(e){d.setLevel(d.levels.TRACE,e)},d.disableAll=function(e){d.setLevel(d.levels.SILENT,e)},d.rebuild=function(){if(o!==d&&(a=p(o.getLevel())),u.call(d),o===d)for(var e in i)i[e].rebuild()},a=p(o?o.getLevel():"WARN");var y=h();null!=y&&(c=p(y)),u.call(d)}(o=new d).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new d(e,o.methodFactory)),t};var f=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=f),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(t,n,t,e))||(e.exports=i)}()},8567:(e,t,n)=>{"use strict";t._t=void 0;var r=n(3301),i=r.__importDefault(n(5641));i.default;var o=r.__importDefault(n(8557));t._t=o.default;r.__importStar(n(4410));i.default,o.default},5300:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(612)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},612:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/aliases",o=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(i)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=o},800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(9813)),o=r.__importDefault(n(3614)),a=r.__importDefault(n(4145)),s=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new a.default(this.apiCall)}return e.prototype.rules=function(e){return void 0===e?this._analyticsRules:(void 0===this.individualAnalyticsRules[e]&&(this.individualAnalyticsRules[e]=new o.default(e,this.apiCall)),this.individualAnalyticsRules[e])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e}();t.default=s},4145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath(),e)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/events"},enumerable:!1,configurable:!0}),e}();t.default=i},3614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(9813)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},4695:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5276)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},9813:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e,{},{})]}))}))},e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){return t={},e&&(t.rule_tag=e),[2,this.apiCall.get(this.endpointPath(),t)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();t.default=i},5276:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();t.default=i},3421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5276)),o=r.__importDefault(n(4695)),a=r.__importDefault(n(4145)),s=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new a.default(this.apiCall)}return e.prototype.rules=function(t){return e.hasWarnedDeprecation||(console.warn("[typesense] 'analyticsV1' is deprecated starting with Typesense Server v30 and will be removed in a future release. Please use 'analytics' instead."),e.hasWarnedDeprecation=!0),void 0===t?this._analyticsRules:(void 0===this.individualAnalyticsRules[t]&&(this.individualAnalyticsRules[t]=new o.default(t,this.apiCall)),this.individualAnalyticsRules[t])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e.hasWarnedDeprecation=!1,e}();t.default=s},5996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(6425)),o=n(5978),a=n(7205),s=n(4410),u=r.__importDefault(n(7796)),c=n(7353),l=!0,d="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node&&"undefined"==typeof window,f=function(){function e(e){this.configuration=e,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return e.prototype.get=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){void 0===t&&(t={});var i=void 0===n?{}:n,o=i.abortSignal,a=void 0===o?null:o,s=i.responseType,u=void 0===s?void 0:s,c=i.streamConfig,l=void 0===c?void 0:c,d=i.isStreamingRequest;return r.__generator(this,(function(n){return[2,this.performRequest("get",e,{queryParameters:t,abortSignal:a,responseType:u,streamConfig:l,isStreamingRequest:d})]}))}))},e.prototype.delete=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.performRequest("delete",e,{queryParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.post=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n,i,o){void 0===t&&(t={}),void 0===n&&(n={}),void 0===i&&(i={});var a=void 0===o?{}:o,s=a.abortSignal,u=void 0===s?null:s,c=a.responseType,l=void 0===c?void 0:c,d=a.streamConfig,f=void 0===d?void 0:d,h=a.isStreamingRequest;return r.__generator(this,(function(r){return[2,this.performRequest("post",e,{queryParameters:n,bodyParameters:t,additionalHeaders:i,abortSignal:u,responseType:l,streamConfig:f,isStreamingRequest:h})]}))}))},e.prototype.put=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__generator(this,(function(r){return[2,this.performRequest("put",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.patch=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__generator(this,(function(r){return[2,this.performRequest("patch",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.getAdapter=function(){if(this.configuration.axiosAdapter)return"function"==typeof this.configuration.axiosAdapter?this.configuration.axiosAdapter:"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent?i.default.getAdapter(this.configuration.axiosAdapter).bind(globalThis):i.default.getAdapter(this.configuration.axiosAdapter)},e.prototype.performRequest=function(e,t,n){return r.__awaiter(this,arguments,void 0,(function(e,t,n){var s,u,c,f,h,p,y,g,v,m,_,b=n.queryParameters,w=void 0===b?null:b,O=n.bodyParameters,S=void 0===O?null:O,P=n.additionalHeaders,R=void 0===P?{}:P,C=n.abortSignal,E=void 0===C?null:C,A=n.responseType,j=void 0===A?void 0:A,T=n.skipConnectionTimeout,N=void 0!==T&&T,x=n.enableKeepAlive,k=void 0===x?void 0:x,D=n.streamConfig,U=void 0===D?void 0:D,F=n.isStreamingRequest;return r.__generator(this,(function(n){switch(n.label){case 0:this.configuration.validate(),F&&(this.logger.debug("Request: Performing streaming request to ".concat(t)),d||"undefined"==typeof fetch||(this.logger.debug("Using fetch adapter for browser streaming"),j="stream")),s=Date.now(),c=!1,this.logger.debug("Request #".concat(s,": Performing ").concat(e.toUpperCase()," request: ").concat(t)),f=function(n){var f,p,y,b,O,P,C;return r.__generator(this,(function(A){switch(A.label){case 0:if(f=h.getNextNode(s),h.logger.debug("Request #".concat(s,": Attempting ").concat(e.toUpperCase()," request Try #").concat(n," to Node ").concat(f.index)),E&&E.aborted)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];p=void 0,A.label=1;case 1:return A.trys.push([1,3,5,6]),(y={method:e,url:h.uriFor(t,f),headers:Object.assign({},h.defaultHeaders(),R,h.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,validateStatus:function(e){return e>0},transformResponse:[function(e,t){var n=e;return void 0!==t&&"string"==typeof e&&"string"==typeof t["content-type"]&&t["content-type"].startsWith("application/json")&&(n=JSON.parse(e)),n}]}).adapter=F&&!d?"fetch":h.getAdapter(),!0!==N&&(y.timeout=1e3*h.connectionTimeoutSeconds),w&&0!==Object.keys(w).length&&(y.params=w),h.sendApiKeyAsQueryParam&&(y.params=y.params||{},y.params["x-typesense-api-key"]=h.apiKey),h.configuration.httpAgent?(h.logger.debug("Request #".concat(s,": Using custom httpAgent")),y.httpAgent=h.configuration.httpAgent):!0===k&&(d?(h.logger.debug("Request #".concat(s,": Enabling KeepAlive")),y.httpAgent=new o.Agent({keepAlive:!0})):h.logger.warn("Request #".concat(s,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),h.configuration.httpsAgent?(h.logger.debug("Request #".concat(s,": Using custom httpsAgent")),y.httpsAgent=h.configuration.httpsAgent):!0===k&&(d?(h.logger.debug("Request #".concat(s,": Enabling keepAlive")),y.httpsAgent=new a.Agent({keepAlive:!0})):h.logger.warn("Request #".concat(s,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),h.configuration.paramsSerializer&&(h.logger.debug("Request #".concat(s,": Using custom paramsSerializer")),y.paramsSerializer=h.configuration.paramsSerializer),S&&("string"==typeof S&&0!==S.length||"object"==typeof S&&0!==Object.keys(S).length)&&(y.data=S),E&&(b=i.default.CancelToken,O=b.source(),p=function(){c=!0,O.cancel()},E.addEventListener("abort",p),y.cancelToken=O.token),F?(y.responseType="stream",d||(y.headers=r.__assign(r.__assign({},y.headers),{Accept:"text/event-stream"}))):j&&(y.responseType=j),[4,(0,i.default)(y)];case 2:if((P=A.sent()).status>=1&&P.status<=499&&h.setNodeHealthcheck(f,l),h.logger.debug("Request #".concat(s,": Request to Node ").concat(f.index," was made. Response Code was ").concat(P.status,".")),P.status>=200&&P.status<300)return F?[2,{value:h.handleStreamingResponse(P,U)}]:[2,{value:Promise.resolve(P.data)}];if(P.status<500)return[2,{value:Promise.reject(h.customErrorForResponse(P,null===(g=P.data)||void 0===g?void 0:g.message,y.data))}];throw h.customErrorForResponse(P,null===(v=P.data)||void 0===v?void 0:v.message,y.data);case 3:return C=A.sent(),c||h.setNodeHealthcheck(f,!1),u=C,h.logger.warn("Request #".concat(s,": Request to Node ").concat(f.index,' failed due to "').concat(null!==(m=null==C?void 0:C.code)&&void 0!==m?m:""," ").concat(C.message).concat(null==C.response?"":" - "+JSON.stringify(null===(_=C.response)||void 0===_?void 0:_.data),'"')),c?[2,{value:Promise.reject(new Error("Request aborted by caller."))}]:(F&&h.invokeOnErrorCallback(C,U),n<h.numRetriesPerRequest+1?(h.logger.warn("Request #".concat(s,": Sleeping for ").concat(h.retryIntervalSeconds,"s and then retrying request...")),[4,h.timer(h.retryIntervalSeconds)]):(h.logger.debug("Request #".concat(s,": No retries left. Raising last error")),[2,{value:Promise.reject(u)}]));case 4:return A.sent(),[3,6];case 5:return E&&p&&E.removeEventListener("abort",p),[7];case 6:return[2]}}))},h=this,p=1,n.label=1;case 1:return p<=this.numRetriesPerRequest+1?[5,f(p)]:[3,4];case 2:if("object"==typeof(y=n.sent()))return[2,y.value];n.label=3;case 3:return p++,[3,1];case 4:return this.logger.debug("Request #".concat(s,": No retries left. Raising last error")),[2,Promise.reject(u)]}}))}))},e.prototype.processStreamingLine=function(e){if(!e.trim()||"data: [DONE]"===e)return null;if(e.startsWith("data: "))return this.processDataLine(e.slice(6).trim());if(e.trim().startsWith("{"))try{var t=JSON.parse(e.trim());return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(t){return{conversation_id:"unknown",message:e.trim()}}return{conversation_id:"unknown",message:e.trim()}},e.prototype.processDataLine=function(e){if(!e)return null;if(e.startsWith("{"))try{var t=JSON.parse(e);return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(t){return{conversation_id:"unknown",message:e}}return{conversation_id:"unknown",message:e}},e.prototype.handleStreamingResponse=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return this.logger.debug("Handling streaming response. Environment: ".concat(d?"Node.js":"Browser")),d&&e.data?[2,this.handleNodeStreaming(e,t)]:d?(this.logger.debug("Processing non-streaming response"),this.invokeOnCompleteCallback(e.data,t),[2,Promise.resolve(e.data)]):[2,this.handleBrowserStreaming(e,t)]}))}))},e.prototype.handleNodeStreaming=function(e,t){var n=this;return this.logger.debug("Processing Node.js stream"),new Promise((function(r,i){var o=e.data,a=[],s="";o.on("data",(function(e){var r;try{var o=e.toString(),u=(s+=o).split("\n");s=null!==(r=u.pop())&&void 0!==r?r:"",n.processStreamLines(u,a,t)}catch(e){i(e)}})),o.on("end",(function(){if(s.trim().length>0){var i=s.split("\n");n.processStreamLines(i,a,t)}n.finalizeStreamResult(a,r,e,t)})),o.on("error",(function(e){n.logger.error("Stream error: ".concat(e)),n.invokeOnErrorCallback(e,t),i(e)}))}))},e.prototype.handleBrowserStreaming=function(e,t){var n=this;return this.logger.debug("Processing browser stream"),new Promise((function(i,o){return r.__awaiter(n,void 0,void 0,(function(){return r.__generator(this,(function(n){try{return e.data&&"function"==typeof e.data.getReader?[2,this.handleBrowserReadableStream(e.data,i,o,e,t)]:"string"==typeof e.data?[2,this.handleBrowserStringResponse(e.data,i,e,t)]:"object"==typeof e.data&&null!==e.data?(this.logger.debug("No stream found, but data object is available"),this.invokeOnCompleteCallback(e.data,t),[2,i(e.data)]):(this.logger.error("No usable data found in response"),[2,o(new Error("No usable data found in response"))])}catch(e){this.logger.error("Error processing streaming response: ".concat(e)),this.invokeOnErrorCallback(e,t),o(e)}return[2]}))}))}))},e.prototype.handleBrowserReadableStream=function(e,t,n,i,o){return r.__awaiter(this,void 0,void 0,(function(){var a,s,u,c,l,d,f,h,p,y;return r.__generator(this,(function(r){switch(r.label){case 0:this.logger.debug("Found ReadableStream in response.data"),a=e.getReader(),s=[],u="",r.label=1;case 1:r.trys.push([1,5,,6]),r.label=2;case 2:return[4,a.read()];case 3:return c=r.sent(),l=c.done,d=c.value,l?(this.logger.debug("Stream reading complete"),u.trim()&&(f=u.split("\n"),this.processStreamLines(f,s,o)),[3,4]):(h=(new TextDecoder).decode(d),this.logger.debug("Received chunk: ".concat(h.length," bytes")),p=(u+=h).split("\n"),u=p.pop()||"",this.processStreamLines(p,s,o),[3,2]);case 4:return this.finalizeStreamResult(s,t,i,o),[3,6];case 5:return y=r.sent(),this.logger.error("Stream error: ".concat(y)),this.invokeOnErrorCallback(y,o),n(y),[3,6];case 6:return[2]}}))}))},e.prototype.handleBrowserStringResponse=function(e,t,n,r){this.logger.debug("Processing text response as stream data");var i=[],o=e.split("\n");if(this.processStreamLines(o,i,r),i.length>0){var a=this.combineStreamingChunks(i);this.invokeOnCompleteCallback(a,r),t(a)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.processStreamLines=function(e,t,n){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.trim()&&"data: [DONE]"!==o){var a=this.processStreamingLine(o);null!==a&&(this.invokeOnChunkCallback(a,n),t.push(a))}}},e.prototype.finalizeStreamResult=function(e,t,n,r){if(e.length>0){var i=this.combineStreamingChunks(e);this.logger.debug("Stream processing complete"),this.invokeOnCompleteCallback(i,r),t(i)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.combineStreamingChunks=function(e){if(0===e.length)return{};if(1===e.length)return e[0];var t=this.getMessageChunks(e);if(t.length>0)return this.combineMessageChunks(e,t);var n=e[e.length-1];if(!this.isCompleteSearchResponse(n))throw new Error("Last chunk is not a complete search response");return n},e.prototype.getMessageChunks=function(e){return e.filter(this.isChunkMessage)},e.prototype.isChunkMessage=function(e){return"object"==typeof e&&null!==e&&"message"in e&&"conversation_id"in e},e.prototype.combineMessageChunks=function(e,t){this.logger.debug("Found ".concat(t.length," message chunks to combine"));var n=e[e.length-1];if(this.isCompleteSearchResponse(n))return n;var r=e.find(this.isCompleteSearchResponse);if(!r)throw new Error("No metadata chunk found");return r},e.prototype.isCompleteSearchResponse=function(e){return"object"==typeof e&&null!==e&&Object.keys(e).length>0&&("results"in e||"found"in e||"hits"in e||"page"in e||"search_time_ms"in e)},e.prototype.getNextNode=function(e){if(void 0===e&&(e=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(e,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(e,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(e,": Nodes Health: ").concat(this.nodes.map((function(e){return"Node ".concat(e.index," is ").concat(!0===e.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(e,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},e.prototype.nodeDueForHealthcheck=function(e,t){void 0===t&&(t=0);var n=Date.now()-e.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(t,": Node ").concat(e.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n},e.prototype.initializeMetadataForNodes=function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,l)),this.nodes.forEach((function(t,n){t.index=n,e.setNodeHealthcheck(t,l)}))},e.prototype.setNodeHealthcheck=function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()},e.prototype.uriFor=function(e,t){return null!=t.url?"".concat(t.url).concat(e):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(e)},e.prototype.defaultHeaders=function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e},e.prototype.timer=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*e)}))]}))}))},e.prototype.customErrorForResponse=function(e,t,n){var r="Request failed with HTTP code ".concat(e.status);return"string"==typeof t&&""!==t.trim()&&(r+=" | Server said: ".concat(t)),new u.default(r,n,e.status),400===e.status?new s.RequestMalformed(r,n,e.status):401===e.status?new s.RequestUnauthorized(r,n,e.status):404===e.status?new s.ObjectNotFound(r,n,e.status):409===e.status?new s.ObjectAlreadyExists(r,n,e.status):422===e.status?new s.ObjectUnprocessable(r,n,e.status):e.status>=500&&e.status<=599?new s.ServerError(r,n,e.status):new s.HTTPError(r,n,e.status)},e.prototype.invokeOnChunkCallback=function(e,t){if(null==t?void 0:t.onChunk)try{t.onChunk(e)}catch(e){this.logger.warn("Error in onChunk callback: ".concat(e))}},e.prototype.invokeOnCompleteCallback=function(e,t){if(null==t?void 0:t.onComplete)try{t.onComplete(e)}catch(e){this.logger.warn("Error in onComplete callback: ".concat(e))}},e.prototype.invokeOnErrorCallback=function(e,t){if(null==t?void 0:t.onError){var n=(0,c.toErrorWithMessage)(e);try{t.onError(n)}catch(e){this.logger.warn("Error in onError callback: ".concat(e))}}},e}();t.default=f},5641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5706)),o=r.__importDefault(n(5996)),a=r.__importDefault(n(7361)),s=r.__importDefault(n(2626)),u=r.__importDefault(n(612)),c=r.__importDefault(n(5300)),l=r.__importDefault(n(326)),d=r.__importDefault(n(2275)),f=r.__importDefault(n(3343)),h=r.__importDefault(n(657)),p=r.__importDefault(n(4955)),y=r.__importDefault(n(8231)),g=r.__importDefault(n(3684)),v=r.__importDefault(n(8621)),m=r.__importDefault(n(5156)),_=r.__importDefault(n(3777)),b=r.__importDefault(n(3421)),w=r.__importDefault(n(800)),O=r.__importDefault(n(3533)),S=r.__importDefault(n(4646)),P=r.__importDefault(n(8700)),R=r.__importDefault(n(8313)),C=r.__importDefault(n(2786)),E=r.__importDefault(n(5350)),A=r.__importDefault(n(7187)),j=r.__importDefault(n(4200)),T=r.__importDefault(n(2077)),N=r.__importDefault(n(476)),x=r.__importDefault(n(1049)),k=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null!==(t=e.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new i.default(e),this.apiCall=new o.default(this.configuration),this.debug=new f.default(this.apiCall),this.metrics=new h.default(this.apiCall),this.stats=new p.default(this.apiCall),this.health=new y.default(this.apiCall),this.operations=new g.default(this.apiCall),this.multiSearch=new v.default(this.apiCall,this.configuration),this._collections=new a.default(this.apiCall),this.individualCollections={},this._aliases=new u.default(this.apiCall),this.individualAliases={},this._keys=new l.default(this.apiCall),this.individualKeys={},this._presets=new m.default(this.apiCall),this.individualPresets={},this._stopwords=new O.default(this.apiCall),this.individualStopwords={},this.analytics=new w.default(this.apiCall),this.analyticsV1=new b.default(this.apiCall),this.stemming=new C.default(this.apiCall),this._conversations=new P.default(this.apiCall),this.individualConversations={},this._nlSearchModels=new E.default(this.apiCall),this.individualNLSearchModels={},this._synonymSets=new j.default(this.apiCall),this.individualSynonymSets={},this._curationSets=new N.default(this.apiCall),this.individualCurationSets={}}return e.prototype.collections=function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.default(e,this.apiCall,this.configuration)),this.individualCollections[e])},e.prototype.aliases=function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new c.default(e,this.apiCall)),this.individualAliases[e])},e.prototype.keys=function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new d.default(e,this.apiCall)),this.individualKeys[e])},e.prototype.presets=function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new _.default(e,this.apiCall)),this.individualPresets[e])},e.prototype.stopwords=function(e){return void 0===e?this._stopwords:(void 0===this.individualStopwords[e]&&(this.individualStopwords[e]=new S.default(e,this.apiCall)),this.individualStopwords[e])},e.prototype.conversations=function(e){return void 0===e?this._conversations:(void 0===this.individualConversations[e]&&(this.individualConversations[e]=new R.default(e,this.apiCall)),this.individualConversations[e])},e.prototype.nlSearchModels=function(e){return void 0===e?this._nlSearchModels:(void 0===this.individualNLSearchModels[e]&&(this.individualNLSearchModels[e]=new A.default(e,this.apiCall)),this.individualNLSearchModels[e])},e.prototype.synonymSets=function(e){return void 0===e?this._synonymSets:(void 0===this.individualSynonymSets[e]&&(this.individualSynonymSets[e]=new T.default(e,this.apiCall)),this.individualSynonymSets[e])},e.prototype.curationSets=function(e){return void 0===e?this._curationSets:(void 0===this.individualCurationSets[e]&&(this.individualCurationSets[e]=new x.default(e,this.apiCall)),this.individualCurationSets[e])},e}();t.default=k},2626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(9078)),a=n(4410),s=r.__importDefault(n(3629)),u=r.__importDefault(n(6582)),c=r.__importDefault(n(1104)),l=r.__importDefault(n(6821)),d=n(9459),f=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=e,this.apiCall=t,this.configuration=n,this._documents=new o.default(this.name,this.apiCall,this.configuration),this._overrides=new s.default(this.name,this.apiCall),this._synonyms=new c.default(this.name,this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},e.prototype.exists=function(){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return t.sent(),[2,!0];case 2:if((e=t.sent())instanceof a.ObjectNotFound)return[2,!1];throw e;case 3:return[2]}}))}))},e.prototype.documents=function(e){return e?(void 0===this.individualDocuments[e]&&(this.individualDocuments[e]=new d.Document(this.name,e,this.apiCall)),this.individualDocuments[e]):this._documents},e.prototype.overrides=function(e){return void 0===e?this._overrides:(void 0===this.individualOverrides[e]&&(this.individualOverrides[e]=new u.default(this.name,e,this.apiCall)),this.individualOverrides[e])},e.prototype.synonyms=function(e){return void 0===e?this._synonyms:(void 0===this.individualSynonyms[e]&&(this.individualSynonyms[e]=new l.default(this.name,e,this.apiCall)),this.individualSynonyms[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=f},7361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/collections",o=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.post(i,e,t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(i,e)]}))}))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=o},5706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importStar(n(3065)),o=n(4410),a=function(){function e(e){var t=this;this.nodes=e.nodes||[],this.nodes=this.nodes.map((function(e){return r.__assign({},e)})).map((function(e){return t.setDefaultPathInNode(e)})).map((function(e){return t.setDefaultPortInNode(e)})),null==e.randomizeNodes&&(e.randomizeNodes=!0),!0===e.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=null==e.nearestNode?e.nearestNode:r.__assign({},e.nearestNode),this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=e.connectionTimeoutSeconds||e.timeoutSeconds||5,this.healthcheckIntervalSeconds=e.healthcheckIntervalSeconds||60,this.numRetries=void 0!==e.numRetries&&e.numRetries>=0?e.numRetries:this.nodes.length+(null==this.nearestNode?0:1)||3,this.retryIntervalSeconds=e.retryIntervalSeconds||.1,this.apiKey=e.apiKey,this.sendApiKeyAsQueryParam=e.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=e.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=e.useServerSideSearchCache||!1,this.axiosAdapter=e.axiosAdapter,this.logger=e.logger||i,this.logLevel=e.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=e.additionalHeaders,this.httpAgent=e.httpAgent,this.httpsAgent=e.httpsAgent,this.paramsSerializer=e.paramsSerializer,this.showDeprecationWarnings(e),this.validate()}return e.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new o.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new o.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new o.MissingConfigurationError("Ensure that apiKey is set");return!0},e.prototype.validateNodes=function(){var e=this;return this.nodes.some((function(t){return e.isNodeMissingAnyParameters(t)}))},e.prototype.isNodeMissingAnyParameters=function(e){return!["protocol","host","port","path"].every((function(t){return e.hasOwnProperty(t)}))&&null==e.url},e.prototype.setDefaultPathInNode=function(e){return null==e||e.hasOwnProperty("path")||(e.path=""),e},e.prototype.setDefaultPortInNode=function(e){if(null!=e&&!e.hasOwnProperty("port")&&e.hasOwnProperty("protocol"))switch(e.protocol){case"https":e.port=443;break;case"http":e.port=80}return e},e.prototype.showDeprecationWarnings=function(e){e.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),e.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),e.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},e.prototype.shuffleArray=function(e){for(var t,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1));t=[e[r],e[n]],e[n]=t[0],e[r]=t[1]}},e}();t.default=a},8313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(8700)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},5168:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(2783)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},2783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/conversations/models"},enumerable:!1,configurable:!0}),e}();t.default=i},8700:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(2783)),o=r.__importDefault(n(5168)),a="/conversations",s=function(){function e(e){this.apiCall=e,this.individualConversationModels={},this.apiCall=e,this._conversationsModels=new i.default(this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(a)]}))}))},e.prototype.models=function(e){return void 0===e?this._conversationsModels:(void 0===this.individualConversationModels[e]&&(this.individualConversationModels[e]=new o.default(e,this.apiCall)),this.individualConversationModels[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),e}();t.default=s},1049:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=r.__importDefault(n(285)),a=r.__importDefault(n(4326)),s=function(){function e(e,t){this.name=e,this.apiCall=t,this.individualItems={},this._items=new o.default(this.name,t)}return e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.items=function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new a.default(this.name,e,this.apiCall)),this.individualItems[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=s},4326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=function(){function e(e,t,n){this.name=e,this.itemId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items/").concat(encodeURIComponent(this.itemId))},e}();t.default=o},285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(e){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))},e}();t.default=o},476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(e.RESOURCEPATH)]}))}))},e.RESOURCEPATH="/curation_sets",e}();t.default=i},3343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/debug")]}))}))},e}();t.default=i},9459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Document=void 0;var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(9078)),a=n(7353),s=function(){function e(e,t,n){this.collectionName=e,this.documentId=t,this.apiCall=n}return e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){return t=(0,a.normalizeArrayableParams)(null!=e?e:{}),[2,this.apiCall.get(this.endpointPath(),t)]}))}))},e.prototype.delete=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},e.prototype.update=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.apiCall.patch(this.endpointPath(),e,t)]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.documentId))},e}();t.Document=s},9078:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(4410),o=n(6124),a="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,s=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return r.__extends(t,e),t.prototype.create=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,t)]}))}))},t.prototype.upsert=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"upsert"}))]}))}))},t.prototype.update=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),e,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"update"}))]}))}))},t.prototype.emplace=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),e,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"emplace"}))]}))}))},t.prototype.delete=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},t.prototype.createMany=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(e,t)]}))}))},t.prototype.import=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){var o,s,u,c,l;void 0===t&&(t={});var d=(void 0===n?{}:n).abortSignal,f=void 0===d?null:d;return r.__generator(this,(function(n){switch(n.label){case 0:if(o=r.__assign({throwOnFail:!0},t),Array.isArray(e)){if(0===e.length)throw new i.RequestMalformed("No documents provided");try{s=e.map((function(e){return JSON.stringify(e)})).join("\n")}catch(e){if(e instanceof RangeError&&e.message.includes("Too many properties to enumerate"))throw new Error("".concat(e,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));throw new Error(e)}}else if(null==(d=s=e)||""===d||0===d.length)throw new i.RequestMalformed("No documents provided");return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:o,bodyParameters:s,additionalHeaders:{"Content-Type":"text/plain"},abortSignal:f,skipConnectionTimeout:!0,enableKeepAlive:!!a})];case 1:if(u=n.sent(),Array.isArray(e)){if(c=u.split("\n").map((function(e){return JSON.parse(e)})),(l=c.filter((function(e){return!1===e.success}))).length>0&&o.throwOnFail)throw new i.ImportError("".concat(c.length-l.length," documents imported successfully, ").concat(l.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),c,{documentsInJSONLFormat:s,options:o,failedItems:l,successCount:c.length-l.length});return[2,c]}return[2,u]}var d}))}))},t.prototype.importStream=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){var o,s,u,c;void 0===t&&(t={});var l=(void 0===n?{}:n).abortSignal,d=void 0===l?null:l;return r.__generator(this,(function(n){switch(n.label){case 0:return o=r.__assign({throwOnFail:!0},t),[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:o,bodyParameters:e,additionalHeaders:{"Content-Type":"text/plain"},abortSignal:d,skipConnectionTimeout:!0,enableKeepAlive:!!a})];case 1:if(s=n.sent(),u=s.split("\n").map((function(e){return JSON.parse(e)})),(c=u.filter((function(e){return!1===e.success}))).length>0&&o.throwOnFail)throw new i.ImportError("".concat(u.length-c.length," documents imported successfully, ").concat(c.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),u,{documentsInJSONLFormat:e,options:o,failedItems:c,successCount:u.length-c.length});return[2,u]}}))}))},t.prototype.export=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e)]}))}))},t.prototype.exportStream=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e,{responseType:"stream"})]}))}))},t}(o.SearchOnlyDocuments);t.default=s},2144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8331:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.importResults=n,i.payload=r,i}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},2426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},6731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},2703:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},6909:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},1081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},7796:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(t,n,r){var i=this.constructor,o=e.call(this,t)||this;return o.name=i.name,o.httpBody=n,o.httpStatus=r,Object.setPrototypeOf(o,i.prototype),o}return r.__extends(t,e),t}(Error);t.default=i},4410:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImportError=t.TypesenseError=t.ServerError=t.RequestUnauthorized=t.RequestMalformed=t.ObjectUnprocessable=t.ObjectNotFound=t.ObjectAlreadyExists=t.MissingConfigurationError=t.HTTPError=void 0;var r=n(3301),i=r.__importDefault(n(2144));t.HTTPError=i.default;var o=r.__importDefault(n(2426));t.MissingConfigurationError=o.default;var a=r.__importDefault(n(6731));t.ObjectAlreadyExists=a.default;var s=r.__importDefault(n(8280));t.ObjectNotFound=s.default;var u=r.__importDefault(n(2703));t.ObjectUnprocessable=u.default;var c=r.__importDefault(n(8274));t.RequestMalformed=c.default;var l=r.__importDefault(n(6909));t.RequestUnauthorized=l.default;var d=r.__importDefault(n(1081));t.ServerError=d.default;var f=r.__importDefault(n(8331));t.ImportError=f.default;var h=r.__importDefault(n(7796));t.TypesenseError=h.default},8231:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/health")]}))}))},e}();t.default=i},2275:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(326)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(3529),o=n(7353),a="/keys",s=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.post(e.RESOURCEPATH,t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(a)]}))}))},e.prototype.generateScopedSearchKey=function(e,t){var n=(0,o.normalizeArrayableParams)(t),r=JSON.stringify(n),a=Buffer.from((0,i.createHmac)("sha256",e).update(r).digest("base64")),s=e.substr(0,4),u="".concat(a).concat(s).concat(r);return Buffer.from(u).toString("base64")},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),e}();t.default=s},657:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/metrics.json")]}))}))},e}();t.default=i},8621:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(875)),o=n(7353),a=function(){function e(e,t,n){void 0===n&&(n=!1),this.apiCall=e,this.configuration=t,this.useTextContentType=n,this.requestWithCache=new i.default,this.logger=this.apiCall.logger}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.perform=function(e,t,n){return r.__awaiter(this,void 0,void 0,(function(){var i,a,s,u,c,l,d;return r.__generator(this,(function(f){return i=t?r.__assign({},t):{},a=null!==(d=null==n?void 0:n.cacheSearchResultsForSeconds)&&void 0!==d?d:this.configuration.cacheSearchResultsForSeconds,!0===this.configuration.useServerSideSearchCache&&(i.use_cache=!0),!0===e.union&&this.hasAnySearchObjectPagination(e)&&this.logger.warn("Individual `searches` pagination parameters are ignored when `union: true` is set. Use a top-level pagination parameter instead. See https://typesense.org/docs/29.0/api/federated-multi-search.html#union-search"),s={union:e.union,remove_duplicates:"remove_duplicates"in e?e.remove_duplicates:void 0,searches:e.searches.map(o.normalizeArrayableParams)},u=i.streamConfig,c=r.__rest(i,["streamConfig"]),l=(0,o.normalizeArrayableParams)(c),[2,this.requestWithCache.perform(this.apiCall,"post",{path:"/multi_search",body:s,queryParams:l,headers:this.useTextContentType?{"content-type":"text/plain"}:{},streamConfig:u,abortSignal:null==n?void 0:n.abortSignal,isStreamingRequest:this.isStreamingRequest(i)},void 0!==a?{cacheResponseForSeconds:a}:void 0)]}))}))},e.prototype.isStreamingRequest=function(e){return!0===e.conversation_stream},e.prototype.hasAnySearchObjectPagination=function(e){return e.searches.some((function(e){return void 0!==e.page||void 0!==e.per_page||void 0!==e.offset||void 0!==e.limit||void 0!==e.limit_hits}))},e}();t.default=a},7187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5350)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},5350:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return e.RESOURCEPATH},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/nl_search_models"},enumerable:!1,configurable:!0}),e}();t.default=i},3684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/operations",o=function(){function e(e){this.apiCall=e}return e.prototype.perform=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.apiCall.post("".concat(i,"/").concat(e),{},t)]}))}))},e.prototype.getSchemaChanges=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("".concat(i,"/schema_changes"))]}))}))},e}();t.default=o},6582:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(3629)),a=function(){function e(e,t,n){this.collectionName=e,this.overrideId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.overrideId))},e}();t.default=a},3629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),e}();t.default=o},3777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5156)),o=function(){function e(e,t){this.presetId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.presetId))},e}();t.default=o},5156:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(7353),o=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,o;return r.__generator(this,(function(r){return"object"==typeof t.value&&"searches"in t.value?(n=t.value.searches.map((function(e){return(0,i.normalizeArrayableParams)(e)})),[2,this.apiCall.put(this.endpointPath(e),{value:{searches:n}})]):(o=(0,i.normalizeArrayableParams)(t.value),[2,this.apiCall.put(this.endpointPath(e),{value:o})])}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),e}();t.default=o},875:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(){this.responseCache=new Map,this.responsePromiseCache=new Map}return e.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},e.prototype.perform=function(e,t,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,f,h,p,y,g,v,m,_,b,w,O,S,P,R,C,E;return r.__generator(this,(function(r){switch(r.label){case 0:if(a=(o=i||{}).cacheResponseForSeconds,s=void 0===a?120:a,u=o.maxSize,c=void 0===u?100:u,l=void 0===i||s<=0||c<=0,d=n.path,f=n.queryParams,h=n.body,p=n.headers,y=n.streamConfig,g=n.abortSignal,v=n.responseType,m=n.isStreamingRequest,l)return[2,this.executeRequest(e,t,d,f,h,p,{abortSignal:g,responseType:v,streamConfig:y,isStreamingRequest:m})];if(_=JSON.stringify(n),b=this.responseCache.get(_),w=Date.now(),b){if(w-b.requestTimestamp<1e3*s)return this.responseCache.delete(_),this.responseCache.set(_,b),[2,b.response];this.responseCache.delete(_)}if(O=this.responsePromiseCache.get(_)){if(w-O.requestTimestamp<1e3*s)return this.responsePromiseCache.delete(_),this.responsePromiseCache.set(_,O),[2,O.responsePromise];this.responsePromiseCache.delete(_)}S=this.executeRequest(e,t,d,f,h,p,{abortSignal:g,responseType:v,streamConfig:y,isStreamingRequest:m}),this.responsePromiseCache.set(_,{requestTimestamp:w,responsePromise:S}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,S];case 2:return P=r.sent(),[3,4];case 3:throw R=r.sent(),(null===(E=this.responsePromiseCache.get(_))||void 0===E?void 0:E.responsePromise)===S&&this.responsePromiseCache.delete(_),R;case 4:return this.responseCache.set(_,{requestTimestamp:w,response:P}),this.responseCache.size>c&&(C=this.responseCache.keys().next().value)&&this.responseCache.delete(C),this.responsePromiseCache.size>c&&(C=this.responsePromiseCache.keys().next().value)&&this.responsePromiseCache.delete(C),[2,P]}}))}))},e.prototype.executeRequest=function(e,t,n,r,i,o,a){void 0===r&&(r={});var s=e[t];switch(t){case"get":return s.call(e,n,r,{abortSignal:null==a?void 0:a.abortSignal,responseType:null==a?void 0:a.responseType,streamConfig:null==a?void 0:a.streamConfig,isStreamingRequest:null==a?void 0:a.isStreamingRequest});case"delete":return s.call(e,n,r);case"post":return s.call(e,n,i,r,o||{},{abortSignal:null==a?void 0:a.abortSignal,responseType:null==a?void 0:a.responseType,streamConfig:null==a?void 0:a.streamConfig,isStreamingRequest:null==a?void 0:a.isStreamingRequest});case"put":case"patch":return s.call(e,n,i,r);default:throw new Error("Unsupported method: ".concat(String(t)))}},e}();t.default=i},8557:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5706)),o=r.__importDefault(n(5996)),a=r.__importDefault(n(8621)),s=n(7112),u=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null===(t=e.sendApiKeyAsQueryParam)||void 0===t||t,!0===e.sendApiKeyAsQueryParam&&(e.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),e.sendApiKeyAsQueryParam=!1),this.configuration=new i.default(e),this.apiCall=new o.default(this.configuration),this.multiSearch=new a.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return e.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(e){e[0],e[1].documents().clearCache()}))},e.prototype.collections=function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.SearchOnlyCollection(e,this.apiCall,this.configuration)),this.individualCollections[e];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},e}();t.default=u},7112:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyCollection=void 0;var r=n(6124),i=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this._documents=new r.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return e.prototype.documents=function(){return this._documents},e}();t.SearchOnlyCollection=i},6124:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyDocuments=void 0;var r=n(3301),i=r.__importDefault(n(875)),o=r.__importDefault(n(7361)),a=n(7353),s="/documents",u=function(){function e(e,t,n){this.collectionName=e,this.apiCall=t,this.configuration=n,this.requestWithCache=new i.default}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.search=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,i,o,s,u,c,l=void 0===t?{}:t,d=l.cacheSearchResultsForSeconds,f=void 0===d?this.configuration.cacheSearchResultsForSeconds:d,h=l.abortSignal,p=void 0===h?null:h;return r.__generator(this,(function(t){return n={},!0===this.configuration.useServerSideSearchCache&&(n.use_cache=!0),i=(0,a.normalizeArrayableParams)(e),o=i.streamConfig,s=r.__rest(i,["streamConfig"]),u=r.__assign(r.__assign({},n),s),c=!0===u.conversation_stream,[2,this.requestWithCache.perform(this.apiCall,"get",{path:this.endpointPath("search"),queryParams:u,streamConfig:o,abortSignal:p,isStreamingRequest:c},{cacheResponseForSeconds:f})]}))}))},e.prototype.endpointPath=function(e){return"".concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(s).concat(void 0===e?"":"/"+e)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return s},enumerable:!1,configurable:!0}),e}();t.SearchOnlyDocuments=u},4955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/stats.json")]}))}))},e}();t.default=i},2786:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5214)),o=r.__importDefault(n(5426)),a=function(){function e(e){this.apiCall=e,this.individualStemmingDictionaries={},this.apiCall=e,this._stemmingDictionaries=new i.default(this.apiCall)}return e.prototype.dictionaries=function(e){return void 0===e?this._stemmingDictionaries:(void 0===this.individualStemmingDictionaries[e]&&(this.individualStemmingDictionaries[e]=new o.default(e,this.apiCall)),this.individualStemmingDictionaries[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming"},enumerable:!1,configurable:!0}),e}();t.default=a},5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return n=Array.isArray(t)?t.map((function(e){return JSON.stringify(e)})).join("\n"):t,[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:{id:e},bodyParameters:n,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:return i=r.sent(),[2,Array.isArray(t)?i.split("\n").map((function(e){return JSON.parse(e)})):i]}}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return void 0===t?"".concat(e.RESOURCEPATH):"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming/dictionaries"},enumerable:!1,configurable:!0}),e}();t.default=i},5426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5214)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},4646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(3533)),o=function(){function e(e,t){this.stopwordId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.stopwordId))},e}();t.default=o},3533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),e}();t.default=i},6821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(1104)),a=function(){function e(e,t,n){this.collectionName=e,this.synonymId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return e.hasWarnedDeprecation||(console.warn("[typesense] 'synonym' APIs are deprecated starting with Typesense Server v30. Please migrate to synonym sets 'synonym_sets'."),e.hasWarnedDeprecation=!0),"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymId))},e.hasWarnedDeprecation=!1,e}();t.default=a},2077:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=r.__importDefault(n(3905)),a=r.__importDefault(n(7394)),s=function(){function e(e,t){this.synonymSetName=e,this.apiCall=t,this.individualItems={},this._items=new o.default(this.synonymSetName,t)}return e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.items=function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new a.default(this.synonymSetName,e,this.apiCall)),this.individualItems[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName))},e}();t.default=s},7394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=function(){function e(e,t,n){this.synonymSetName=e,this.itemId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items/").concat(encodeURIComponent(this.itemId))},e}();t.default=o},3905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=function(){function e(e,t){this.synonymSetName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(e){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))},e}();t.default=o},4200:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(e.RESOURCEPATH)]}))}))},e.RESOURCEPATH="/synonym_sets",e}();t.default=i},1104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return e.hasWarnedDeprecation||(console.warn("[typesense] 'synonyms' APIs are deprecated starting with Typesense Server v30. Please migrate to synonym sets ('synonym_sets')."),e.hasWarnedDeprecation=!0),"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),e.hasWarnedDeprecation=!1,e}();t.default=o},7765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayableParams=void 0,t.arrayableParams={query_by:"query_by",query_by_weights:"query_by_weights",facet_by:"facet_by",group_by:"group_by",include_fields:"include_fields",exclude_fields:"exclude_fields",highlight_fields:"highlight_fields",highlight_full_fields:"highlight_full_fields",pinned_hits:"pinned_hits",hidden_hits:"hidden_hits",infix:"infix",override_tags:"override_tags",num_typos:"num_typos",prefix:"prefix",synonym_sets:"synonym_sets",sort_by:"sort_by"}},7353:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeArrayableParams=function(e){var t=r.__assign({},e);if(!Object.keys(i.arrayableParams).filter((function(e){return Array.isArray(t[e])})).map((function(e){return t[e]=t[e].join(","),e})).length&&o(t))return t;if(!o(t))throw new Error("Failed to normalize arrayable params: ".concat(JSON.stringify(t)));return t},t.toErrorWithMessage=function(e){if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return"string"==typeof e?new Error(e):new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}};var r=n(3301),i=n(7765);function o(e){return Object.keys(i.arrayableParams).filter((function(t){return void 0!==e[t]})).every((function(t){return n=e[t],!Array.isArray(n);var n}))}},3529:()=>{},5978:()=>{},7205:()=>{},4633:(e,t,n)=>{var r=n(3738).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",d=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),a=new k(r||[]);return s(o,"_invoke",{value:j(e,n,a)}),o}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var y="suspendedStart",g="suspendedYield",v="executing",m="completed",_={};function b(){}function w(){}function O(){}var S={};f(S,c,(function(){return this}));var P=Object.getPrototypeOf,R=P&&P(P(D([])));R&&R!==o&&a.call(R,c)&&(S=R);var C=O.prototype=b.prototype=Object.create(S);function E(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,o,s,u){var c=p(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function j(e,n,r){var i=y;return function(o,a){if(i===v)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===_)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===y)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var c=p(e,n,r);if("normal"===c.type){if(i=r.done?m:g,c.arg===_)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=m,r.method="throw",r.arg=c.arg)}}}function T(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var o=p(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,_;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,_):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,_)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=O,s(C,"constructor",{value:O,configurable:!0}),s(O,"constructor",{value:w,configurable:!0}),w.displayName=f(O,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,f(e,d,"GeneratorFunction")),e.prototype=Object.create(C),e},n.awrap=function(e){return{__await:e}},E(A.prototype),f(A.prototype,l,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,i,o){void 0===o&&(o=Promise);var a=new A(h(e,t,r,i),o);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(C),f(C,d,"Generator"),f(C,c,(function(){return this})),f(C,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=D,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,_):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),_}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},6425:(e,t,n)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:a,toStringTag:s}=Symbol,u=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),c=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),l=(e,t,n)=>e===Object.prototype||!n&&null===t,d=(e,t)=>{let n=e;const r=[];for(;null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);const i=o(n);if(l(n,i,n===e))return!1;if(u(n,t))return!0;n=i}return!1},f=(h=Object.create(null),e=>{const t=i.call(e);return h[t]||(h[t]=t.slice(8,-1).toLowerCase())});var h;const p=e=>(e=e.toLowerCase(),t=>f(t)===e),y=e=>t=>typeof t===e,{isArray:g}=Array,v=y("undefined");function m(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&w(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _=p("ArrayBuffer"),b=y("string"),w=y("function"),O=y("number"),S=e=>null!==e&&"object"==typeof e,P=e=>{if(!S(e))return!1;const t=o(e);return(null===t||t===Object.prototype||null===o(t))&&(l(e,t,!0)||!u(e,s)&&!u(e,a))},R=p("Date"),C=p("File"),E=p("Blob"),A=p("FileList"),j=p("Set"),T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},N=void 0!==T.FormData?T.FormData:void 0,x=p("URLSearchParams"),[k,D,U,F]=["ReadableStream","Request","Response","Headers"].map(p);function I(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),g(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(m(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,q=e=>!v(e)&&e!==L,M=(H="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>H&&e instanceof H);var H;const B=p("HTMLFormElement"),{propertyIsEnumerable:z}=Object.prototype,W=p("RegExp"),V=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};I(n,((n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)})),Object.defineProperties(e,r)},K=p("AsyncFunction"),J=(G="function"==typeof setImmediate,$=w(L.postMessage),G?setImmediate:$?(X=`axios@${Math.random()}`,Q=[],L.addEventListener("message",(({source:e,data:t})=>{e===L&&t===X&&Q.length&&Q.shift()()}),!1),e=>{Q.push(e),L.postMessage(X,"*")}):e=>setTimeout(e));var G,$,X,Q;const Y="undefined"!=typeof queueMicrotask?queueMicrotask.bind(L):"undefined"!=typeof process&&process.nextTick||J,Z=e=>null!=e&&w(e[a]);var ee={isArray:g,isArrayBuffer:_,isBuffer:m,isFormData:e=>{if(!e)return!1;if(N&&e instanceof N)return!0;const t=o(e);if(!t||t===Object.prototype)return!1;if(!w(e.append))return!1;const n=f(e);return"formdata"===n||"object"===n&&w(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&_(e.buffer),t},isString:b,isNumber:O,isBoolean:e=>!0===e||!1===e,isObject:S,isPlainObject:P,isEmptyObject:e=>{if(!S(e)||m(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:k,isRequest:D,isResponse:U,isHeaders:F,isUndefined:v,isDate:R,isFile:C,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:E,isRegExp:W,isFunction:w,isStream:e=>S(e)&&w(e.pipe),isURLSearchParams:x,isTypedArray:M,isFileList:A,forEach:I,merge:function e(...t){const{caseless:n,skipUndefined:r}=q(this)&&this||{},i={},o=n?Object.create(null):null,a=(t,n)=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;let a=n;if(o&&"string"==typeof n){const e=n.toLowerCase(),t=o[e];void 0!==t&&u(i,t)?a=t:o[e]=n}const s=u(i,a)?i[a]:void 0;P(s)&&P(t)?i[a]=e(s,t):P(t)?i[a]=e({},t):g(t)?i[a]=t.slice():r&&v(t)||(i[a]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||m(n))continue;if(I(n,a),"object"!=typeof n||g(n)||!Object.getOwnPropertySymbols)continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];z.call(n,t)&&a(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:i}={})=>(I(t,((t,i)=>{n&&w(t)?Object.defineProperty(e,i,{__proto__:null,value:r(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,s;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],r&&!r(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:f,kindOfTest:p,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(g(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,r=new Set;let i=e;for(;null!=i&&n.size<t;){if(r.has(i))return null;r.add(i);const a=o(i);if(l(i,a,i===e))break;Object.getOwnPropertyNames(i).forEach((e=>{const r=+e;Number.isInteger(r)&&r>=0&&r<t&&String(r)===e&&u(i,e)&&n.add(r)})),i=a}if(n.size!==t)return null;const a=new Array(t);for(;t-- >0;)a[t]=e[t];return a},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:B,hasOwnProperty:u,hasOwnProp:u,hasOwnInPrototypeChain:d,getSafeProp:(e,t)=>null!=e&&d(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=o(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every((t=>{if(c(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable}))})(e))return e;const n=Object.create(null),r=Object.create(null),i=[];let a=e;for(;null!=a&&-1===i.indexOf(a);){i.push(a);const s=a===e?t:o(a);if(l(a,s,a===e))break;const d=Object.getOwnPropertyNames(a);Object.getOwnPropertySymbols&&d.push(...Object.getOwnPropertySymbols(a));for(const t of d)c(t)||u(r,t)||(n[t]=e[t],r[t]=!0);a=s}return n},reduceDescriptors:V,freezeMethods:e=>{V(e,((t,n)=>{if(w(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];w(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return g(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:function(e,t){if(m(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null},global:L,isContextDefined:q,isSpecCompliantForm:function(e){return!!(e&&w(e.append)&&"FormData"===e[s]&&e[a])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(S(e)){if(t.has(e))return;if(m(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),j(e)){r=[];for(const t of e){const e=n(t);!v(e)&&r.push(e)}}else r=g(e)?[]:{},I(e,((e,t)=>{const i=n(e);!v(i)&&(r[t]=i)}));return t.delete(e),r}}return e};return n(e)},isAsyncFn:K,isThenable:e=>e&&(S(e)||w(e))&&w(e.then)&&w(e.catch),setImmediate:J,asap:Y,isIterable:Z,isSafeIterable:e=>null!=e&&d(e,a)&&Z(e)};const te=ee.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ne=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),re=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ie(e,t){return ee.isArray(e)?e.map((e=>ie(e,t))):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function oe(e){const t=Object.create(null);return ee.forEach(e.toJSON(),((e,n)=>{t[n]=(e=>ie(e,re))(e)})),t}const ae=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:ee.isArray(e)?e.map(ue):(e=>ie(e,ne))(String(e))}const ce=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function le(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}const de=e=>"__proto__"===e?"__Proto__":e;function fe(e,t,n,r,i){return ee.isFunction(r)?r.call(e,t,n):(i&&(t=n),ee.isString(t)?ee.isString(r)?-1!==t.indexOf(r):ee.isRegExp(r)?r.test(t):void 0:void 0)}class he{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=se(t);if(!i)return;const o=ee.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[de(o||t)]=ue(e))}const o=(e,t)=>ee.forEach(e,((e,n)=>i(e,n,t)));if(ee.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(ee.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t=Object.create(null);let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim();const o=ee.hasOwnProp(t,n);!n||o&&ee.hasOwnProp(te,n)||("set-cookie"===n?o?t[n].push(r):t[n]=[r]:t[n]=o?t[n]+", "+r:r)})),t})(e),t);else if(ee.isObject(e)&&ee.isSafeIterable(e)){let n,r,i=Object.create(null);for(const t of e){if(!ee.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],ee.hasOwnProp(i,r)?(n=i[r],i[r]=ee.isArray(n)?[...n,t[1]]:[n,t[1]]):i[r]=t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=se(e)){const n=ee.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(ee.isFunction(t))return t.call(this,e,n);if(ee.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=ee.findKey(this,e);return!(!n||void 0===this[n]||t&&!fe(this,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=se(e)){const i=ee.findKey(n,e);!i||t&&!fe(n,n[i],i,t)||(delete n[i],r=!0)}}return ee.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!fe(this,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n=Object.create(null);return ee.forEach(this,((r,i)=>{const o=ee.findKey(n,i);if(o)return t[o]=ue(r),void delete t[i];const a=de(e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim());a!==i&&delete t[i],t[a]=ue(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ee.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ee.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){const e=this.get("set-cookie");return ee.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,i=!1,o=!1;function a(e){const i=le(n.slice(r,e)),o=i.indexOf("=");if(o<1)return;const a=le(i.slice(0,o));if(!ce.test(a))return;const s=a.toLowerCase();if("__proto__"===s||"constructor"===s||"prototype"===s)return;const u=le(i.slice(o+1));t[s]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const i=e.charCodeAt(r);if(34===i)return e;if(92===i&&(r+=1,r>=t))return e;n+=e[r]}return n}(u)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);i?o?o=!1:92===t?o=!0:34===t&&(i=!1):34===t?i=!0:44!==t&&59!==t||(a(e),r=e+1)}return a(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ae]=this[ae]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(function(e,t){const n=ee.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return ee.isArray(e)?e.forEach(r):r(e),this}}he.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ee.reduceDescriptors(he.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),ee.freezeMethods(he);const pe="[REDACTED ****]";function ye(e){try{return String(e)}catch(e){return""}}const ge=Symbol("causeStack");class ve extends Error{static from(e,t,n,r,i,o){let a=e.message;!a&&ee.isArray(e.errors)&&e.errors.length&&(a=function(e){return e.errors.map((e=>{try{return e&&e.message?ye(e.message):ye(e)}catch(e){return""}})).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const s=new ve(a,t||e.code,n,r,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,function(e,t){try{const n=t&&t.stack;if("string"!=typeof n||!n)return;const r=e.stack;if("string"!=typeof r||!r)return;const i="\nCaused by: "+n;e.stack=r+i,Object.defineProperty(e,ge,{__proto__:null,value:i})}catch(e){}}(s,e),null!=e.status&&null==s.status&&(s.status=e.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,t=e&&ee.hasOwnProp(e,"redact")?e.redact:void 0,n=ee.isArray(t)&&t.length>0?function(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),r=[],i=e=>{if(null===e||"object"!=typeof e)return e;if(ee.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof he&&(e=e.toJSON()),r.push(e),ee.isArray(e))t=[],e.forEach(((e,n)=>{const r=i(e);ee.isUndefined(r)||(t[n]=r)}));else{if(!ee.isPlainObject(e)&&function(e){if(ee.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(ee.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,o]of Object.entries(e)){const e=n.has(r.toLowerCase())?pe:i(o);ee.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}(e,t):ee.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}ve.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ve.ERR_BAD_OPTION="ERR_BAD_OPTION",ve.ECONNABORTED="ECONNABORTED",ve.ETIMEDOUT="ETIMEDOUT",ve.ECONNREFUSED="ECONNREFUSED",ve.ERR_NETWORK="ERR_NETWORK",ve.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ve.ERR_DEPRECATED="ERR_DEPRECATED",ve.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ve.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ve.ERR_CANCELED="ERR_CANCELED",ve.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ve.ERR_INVALID_URL="ERR_INVALID_URL",ve.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const me=100;function _e(e){return ee.isPlainObject(e)||ee.isArray(e)}function be(e){return ee.endsWith(e,"[]")?e.slice(0,-2):e}function we(e,t,n){return e?e.concat(t).map((function(e,t){return e=be(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Oe=ee.toFlatObject(ee,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Se(e,t,n){if(!ee.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=ee.getSafeProp(n,e);return ee.isUndefined(r)?t:r},i=r("metaTokens",!0),o=r("visitor")||p,a=r("dots",!1),s=r("indexes",!1),u=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",me),l=u&&ee.isSpecCompliantForm(t),d=[];if(!ee.isFunction(o))throw new TypeError("visitor must be a function");function f(e){if(null===e)return"";if(ee.isDate(e))return e.toISOString();if(ee.isBoolean(e))return e.toString();if(!l&&ee.isBlob(e))throw new ve("Blob is not supported. Use a Buffer instead.");if(ee.isArrayBuffer(e)||ee.isTypedArray(e)){if(l&&"function"==typeof u)return new u([e]);throw new ve("Blob is not supported. Use a Buffer instead.",ve.ERR_NOT_SUPPORT)}return e}function h(e){if(e>c)throw new ve("Object is too deeply nested ("+e+" levels). Max depth: "+c,ve.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,r){let o=e;if(ee.isReactNative(t)&&ee.isReactNativeBlob(e))return t.append(we(r,n,a),f(e)),!1;if(e&&!r&&"object"==typeof e)if(ee.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,(function(e,t){if(!ee.isObject(t))return t;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(t),h(1+n.length-1),t}))}(e);else if(ee.isArray(e)&&function(e){return ee.isArray(e)&&!e.some(_e)}(e)||(ee.isFileList(e)||ee.endsWith(n,"[]"))&&(o=ee.toArray(e)))return n=be(n),o.forEach((function(e,r){!ee.isUndefined(e)&&null!==e&&t.append(!0===s?we([n],r,a):null===s?n:n+"[]",f(e))})),!1;return!!_e(e)||(t.append(we(r,n,a),f(e)),!1)}const y=Object.assign(Oe,{defaultVisitor:p,convertValue:f,isVisitable:_e});if(!ee.isObject(e))throw new TypeError("data must be an object");return function e(n,r,i=0){if(!ee.isUndefined(n)){if(h(i),-1!==d.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));d.push(n),ee.forEach(n,(function(n,a){!0===(!(ee.isUndefined(n)||null===n)&&o.call(t,n,ee.isString(a)?a.trim():a,r,y))&&e(n,r?r.concat(a):[a],i+1)})),d.pop()}}(e),t}function Pe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Re(e,t){this._pairs=[],e&&Se(e,this,t)}const Ce=Re.prototype;function Ee(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ae(e,t,n){if(!t)return e;e=e||"";const r=ee.isFunction(n)?{serialize:n}:n,i=ee.getSafeProp(r,"encode")||Ee,o=ee.getSafeProp(r,"serialize");let a;if(a=o?o(t,r):ee.isURLSearchParams(t)?t.toString():new Re(t,r).toString(i),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Ce.append=function(e,t){this._pairs.push([e,t])},Ce.toString=function(e){const t=e?t=>e.call(this,t,Pe):Pe;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const je=Symbol("internals");function Te(e){return e?e.length:0}function Ne(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function xe(e,t){const n=e.handlers,r=Te(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach((function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)})):t.handlerEntries.clear()),t.handlersLength=r}class ke{constructor(){this.handlers=[],this[je]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},i=this[je];null==this.handlers&&(this.handlers=[]),xe(this,i);const o=i.nextId++;return this.handlers.push(r),i.handlerEntries.set(o,{handler:r,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,o}eject(e){const t=this[je];xe(this,t);const n=function(e){return"string"==typeof e&&""!==e&&String(Number(e))===e?Number(e):e}(e),r=t.handlerEntries.get(n);if(r){if(t.handlerEntries.delete(n),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,t.iterationDepth||(Ne(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],xe(this,this[je]))}forEach(e){const t=this[je];xe(this,t),t.iterationDepth++;try{ee.forEach(this.handlers,(function(t){null!==t&&e(t)}))}finally{--t.iterationDepth||(xe(this,t),Ne(this.handlers),t.handlersLength=Te(this.handlers))}}}var De={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0,encodeBasicAuthUsername:!1},Ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Fe="undefined"!=typeof window&&"undefined"!=typeof document,Ie="object"==typeof navigator&&navigator||void 0,Le=Fe&&(!Ie||["ReactNative","NativeScript","NS"].indexOf(Ie.product)<0),qe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Me=Fe&&window.location.href||"http://localhost";var He={...Object.freeze({__proto__:null,hasBrowserEnv:Fe,hasStandardBrowserEnv:Le,hasStandardBrowserWebWorkerEnv:qe,navigator:Ie,origin:Me}),...Ue};const Be=me;function ze(e){if(e>Be)throw new ve("FormData field is too deeply nested ("+e+" levels). Max depth: "+Be,ve.ERR_FORM_DATA_DEPTH_EXCEEDED)}function We(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function Ve(e){if(!ee.isArray(e))return e;const t=Object.keys(e);return t.length!==e.length||t.some(((e,t)=>e!==String(t)))?We(e):e}function Ke(e){function t(e,n,r,i){ze(i);let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&ee.isArray(r)?r.length:o,s?(ee.hasOwnProp(r,o)?(r[o]=Ve(r[o]),r[o]=ee.isArray(r[o])?r[o].concat(n):[r[o],n]):r[o]=n,!a):(ee.hasOwnProp(r,o)&&ee.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&ee.isArray(r[o])&&(r[o]=We(r[o])),!a)}if(ee.isFormData(e)&&ee.isFunction(e.entries)){const n={};return ee.forEachEntry(e,((e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)ze(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)})),function(e){const t=[e];for(;t.length;){const e=t.pop();Object.keys(e).forEach((n=>{const r=e[n]=Ve(e[n]);(ee.isArray(r)||ee.isPlainObject(r))&&t.push(r)}))}return e}(n)}return null}const Je=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Ge=(e,t)=>null!=e&&ee.hasOwnProp(e,t)?e[t]:void 0,$e={transitional:De,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=ee.isObject(e);if(i&&ee.isHTMLForm(e)&&(e=new FormData(e)),ee.isFormData(e))return r?JSON.stringify(Ke(e)):e;if(ee.isArrayBuffer(e)||ee.isBuffer(e)||ee.isStream(e)||ee.isFile(e)||ee.isBlob(e)||ee.isReadableStream(e))return e;if(ee.isArrayBufferView(e))return e.buffer;if(ee.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){const t=Ge(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Se(e,new He.classes.URLSearchParams,{visitor:function(e,t,n,r){return He.isNode&&ee.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=ee.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ge(this,"env"),r=n&&n.FormData;return Se(o?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(ee.isString(e))try{return(0,JSON.parse)(e),ee.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ge(this,"transitional")||$e.transitional,n=t&&t.forcedJSONParsing,r=Ge(this,"responseType"),i="json"===r;if(ee.isResponse(e)||ee.isReadableStream(e))return e;if(e&&ee.isString(e)&&(n&&!r||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Ge(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw ve.from(e,ve.ERR_BAD_RESPONSE,this,null,Ge(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:He.classes.FormData,Blob:He.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function Xe(e,t){const n=this||$e,r=t||n,i=he.from(r.headers);let o=r.data;return ee.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Qe(e){return!(!e||!e.__CANCEL__)}ee.forEach(Je,(e=>{$e.headers[e]={}}));class Ye extends ve{constructor(e,t,n){super(null==e?"canceled":e,ve.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}}function Ze(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ve("Request failed with status code "+n.status,n.status>=400&&n.status<500?ve.ERR_BAD_REQUEST:ve.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const et=/[\t\n\r]/g;function tt(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(et,"")}function nt(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1].toLowerCase()||""}const rt=e=>{try{return decodeURIComponent(e)}catch(t){return e}};var it=He.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];ee.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),ee.isString(r)&&s.push(`path=${r}`),ee.isString(i)&&s.push(`domain=${i}`),!0===o&&s.push("secure"),ee.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie;if(!t)return null;const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t].replace(/^\s+/,""),i=r.indexOf("=");if(-1!==i&&r.slice(0,i)===e)return rt(r.slice(i+1))}return null},async readAsync(e){try{const t="undefined"!=typeof window&&window.cookieStore;if(t&&ee.isFunction(t.get)){const n=await t.get(e);return n?rt(n.value):null}}catch(e){}return this.read(e)},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,readAsync:async()=>null,remove(){}};const ot=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[a];i||(i=u),n[o]=s,r[o]=u;let l=a,d=0;for(;l!==o;)d+=n[l++],l%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(n,o){let a,s,u=0,c=1e3/o;const l=(n,o=Date.now())=>{u=o,a=null,s&&(clearTimeout(s),s=null),(n=>{if(!n||!ee.isNumber(n.loaded))return;const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=Math.max(0,null!=a?Math.min(o,a):o),u=Math.max(0,s-r),c=i(u);r=Math.max(r,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-u;n>=c?l(e,t):(a=e,s||(s=setTimeout((()=>{s=null,l(a)}),c-n)))},()=>a&&l(a),(...e)=>l(e)]}(0,n)},at=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},st=(e,t=ee.asap)=>(...n)=>t((()=>e(...n)));var ut=He.hasStandardBrowserEnv?(e=>t=>(t=new URL(t,document.baseURI||He.origin),e.protocol===t.protocol&&e.host===t.host&&e.port===t.port))(new URL(He.origin)):()=>!0;const ct=/^https?:(?!\/\/)/i;function lt(e,t){if("string"==typeof e){const n=tt(e);if(ct.test(n))throw new ve(`Invalid URL ${JSON.stringify(function(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${pe}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${pe}`);return-1===n?r:`${r}#${i=t.slice(n+1),i?i.replace(/(^|&)([^=&]*=)?[^&]+/g,((e,t,n="")=>`${t}${n}${pe}`)):i}`;var i}(n))}: missing "//" after protocol`,ve.ERR_INVALID_URL,t)}}function dt(e,t,n,r){lt(t,r);let i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(i||!1===n)?(lt(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const ft=e=>e instanceof he?{...e}:e,ht=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter((t=>{const n=Object.getOwnPropertyDescriptor(e,t);return n&&n.enumerable}))):Object.keys(e);function pt(e,t,n,r){return ee.isPlainObject(e)&&ee.isPlainObject(t)?ee.merge.call({caseless:r},e,t):ee.isPlainObject(t)?ee.merge({},t):ee.isArray(t)?t.slice():t}function yt(e,t,n,r){return ee.isUndefined(t)?ee.isUndefined(e)?void 0:pt(void 0,e,0,r):pt(e,t,0,r)}function gt(e,t){if(!ee.isUndefined(t))return pt(void 0,t)}function vt(e,t){return ee.isUndefined(t)?ee.isUndefined(e)?void 0:pt(void 0,e):pt(void 0,t)}function mt(e,t,n,r,i){return ee.hasOwnProp(i,n)?pt(e,t):ee.hasOwnProp(r,n)?pt(void 0,e):void 0}const _t=Object.freeze({__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0}),bt={url:gt,method:gt,data:gt,baseURL:vt,transformRequest:vt,transformResponse:vt,params:function(e,t){const n=[],r=new WeakMap,i={};function o(e,t){if(!ee.isPlainObject(t))return ee.isArray(t)?t.slice():t;const o=ee.isPlainObject(e)?e:i;let a=r.get(t);if(a||(a=new WeakMap,r.set(t,a)),a.has(o))return a.get(o);const s={};return a.set(o,s),n.push({base:o,source:t,result:s}),s}const a=ee.isUndefined(t)?o(void 0,e):o(e,t);for(;n.length;){const{base:e,source:t,result:r}=n.pop(),i=new Set(ht(e)),a=new Set(ht(t));new Set([...i,...a]).forEach((n=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;const s=a.has(n),u=s?t[n]:void 0,c=s&&!ee.isPlainObject(u)||!i.has(n)?void 0:e[n];r[n]=s?o(c,u):o(void 0,c)}))}return function(e){const t=[{value:e}],n=new WeakSet,r=new WeakSet;for(;t.length;){const{value:e,done:i}=t.pop();if(!ee.isPlainObject(e)&&!ee.isArray(e))continue;if(i){n.delete(e);continue}if(n.has(e))throw new ve("Circular reference detected in params",ve.ERR_BAD_OPTION_VALUE);if(r.has(e))continue;r.add(e),n.add(e),t.push({value:e,done:!0});const o=Object.keys(e);Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertySymbols(e).forEach((t=>{const n=Object.getOwnPropertyDescriptor(e,t);n&&n.enumerable&&o.push(t)})),o.forEach((n=>{if("__proto__"===n||"constructor"===n||"prototype"===n){const r=Object.getOwnPropertyDescriptor(e,n);r&&ee.hasOwnProp(r,"value")&&t.push({value:r.value})}else t.push({value:e[n]})}))}}(a),a},paramsSerializer:vt,timeout:vt,timeoutErrorMessage:vt,withCredentials:vt,withXSRFToken:vt,adapter:vt,responseType:vt,xsrfCookieName:vt,xsrfHeaderName:vt,onUploadProgress:vt,onDownloadProgress:vt,decompress:vt,maxContentLength:vt,maxBodyLength:vt,beforeRedirect:vt,transport:vt,httpAgent:vt,httpsAgent:vt,cancelToken:vt,socketPath:vt,allowedSocketPaths:vt,responseEncoding:vt,validateStatus:mt,headers:function(e,t,n){return yt(ft(e),ft(t),0,!0)}};function wt(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",_t);const r=ht({...e,...t});for(let i=0,o=r.length;i<o;i++){const o=r[i];if("__proto__"===o||"constructor"===o||"prototype"===o)continue;const a=ee.hasOwnProp(bt,o)?bt[o]:yt,s=ee.hasOwnProp(e,o)?e[o]:void 0,u=ee.hasOwnProp(t,o)?t[o]:void 0,c=a===mt?a(s,u,o,e,t):a(s,u,o);ee.isUndefined(c)&&a!==mt||(n[o]=c)}return ee.hasOwnProp(t,"validateStatus")&&ee.isUndefined(t.validateStatus)&&!1===function(e,t,n){const r=ee.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!ee.isUndefined(r)){if(!ee.isPlainObject(r))return;if(ee.hasOwnProp(r,n))return r[n]}const i=ee.hasOwnProp(e,"transitional")?e.transitional:void 0;if(ee.isPlainObject(i)&&ee.hasOwnProp(i,n))return i[n]}(e,t,"validateStatusUndefinedResolves")&&(ee.hasOwnProp(e,"validateStatus")?n.validateStatus=pt(void 0,e.validateStatus):delete n.validateStatus),n}const Ot=["content-type","content-length"],St=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))),Pt=e=>it.read(e);function Rt(e,t=Pt){const n=wt({},e),r=e=>ee.hasOwnProp(n,e)?n[e]:void 0,i=r("data");let o=r("withXSRFToken");const a=r("xsrfHeaderName"),s=r("xsrfCookieName");let u=r("headers");const c=r("auth"),l=r("baseURL"),d=r("allowAbsoluteUrls"),f=r("url");if(n.headers=u=he.from(u),n.url=Ae(dt(l,f,d,n),r("params"),r("paramsSerializer")),c){const t=ee.getSafeProp(c,"username")||"",n=ee.getSafeProp(c,"password")||"",i=r("transitional"),o=i&&ee.hasOwnProp(i,"encodeBasicAuthUsername")&&!0===i.encodeBasicAuthUsername;try{u.set("Authorization","Basic "+btoa((o?St(t):t)+":"+(n?St(n):"")))}catch(t){throw ve.from(t,ve.ERR_BAD_OPTION_VALUE,e)}}if(ee.isFormData(i)){const e=ee.getSafeProp(i,"getHeaders");He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv||ee.isReactNative(i)?u.setContentType(void 0):ee.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((([t,n])=>{Ot.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(u,e.call(i),r("formDataHeaderPolicy"))}if(He.hasStandardBrowserEnv&&(ee.isFunction(o)&&(o=o(n)),!0===o||null==o&&ut(n.url))){const e=a&&s&&t(s);e&&u.set(a,e)}return n}var Ct="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r,i;try{const e=He.hasStandardBrowserEnv&&"undefined"!=typeof window&&window.cookieStore;r=e&&ee.isFunction(e.get)}catch(e){}const o=Rt(e,r?e=>(i=e,null):void 0);let a=o.data;const s=he.from(o.headers).normalize();let u,c,l,d,f,h,p,{responseType:y,onUploadProgress:g,onDownloadProgress:v}=o;function m(){clearTimeout(c);try{f&&f()}catch(e){setTimeout((()=>{throw e}))}try{h&&h()}catch(e){setTimeout((()=>{throw e}))}_&&(d&&_.removeEventListener("progress",d),_.upload&&(l&&_.upload.removeEventListener("progress",l),f&&_.upload.removeEventListener("loadend",f))),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;function b(r){if(!_)return;if(!(0!==_.status||"file"===(nt(tt(o.url))||nt(He.origin))||_.responseURL&&_.responseURL.startsWith("file:")))return n(new ve("Request aborted",ve.ECONNABORTED,e,_)),m(),void(_=null);try{r?p&&p(r):h&&h()}catch(e){setTimeout((()=>{throw e}))}if(!_)return;const i=he.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());Ze((function(e){t(e),m()}),(function(e){n(e),m()}),{data:y&&"text"!==y&&"json"!==y?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:i,config:e,request:_}),_=null}if(_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout,"onloadend"in _?_.onloadend=b:_.onreadystatechange=function(){_&&4===_.readyState&&(0!==_.status||_.responseURL&&_.responseURL.startsWith("file:"))&&setTimeout(b)},_.onabort=function(){_&&(n(new ve("Request aborted",ve.ECONNABORTED,e,_)),m(),_=null)},_.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new ve(r,ve.ERR_NETWORK,e,_);i.event=t||null,n(i),m(),_=null},_.ontimeout=function(){if(!_)return;let t=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const r=o.transitional||De;o.timeoutErrorMessage&&(t=o.timeoutErrorMessage),n(new ve(t,r.clarifyTimeoutError?ve.ETIMEDOUT:ve.ECONNABORTED,e,_)),m(),_=null},void 0===a&&s.setContentType(null),ee.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),y&&"json"!==y&&(_.responseType=o.responseType),v&&([d,h,p]=ot(v,!0),_.addEventListener("progress",d)),g&&_.upload&&([l,f]=ot(g),_.upload.addEventListener("progress",l),_.upload.addEventListener("loadend",f)),o.cancelToken||o.signal){if(u=t=>{if(!_)return;n(!t||t.type?new Ye(null,e,_):t);const r=_;m(),_=null,r.abort()},o.cancelToken&&o.cancelToken.subscribe(u),!_)return;o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u))}if(!_)return;const w=nt(o.url);if(w&&!He.protocols.includes(w))return n(new ve("Unsupported protocol "+w+":",ve.ERR_BAD_REQUEST,e)),void m();const O=()=>{_&&("setRequestHeader"in _&&ee.forEach(oe(s),(function(e,t){_.setRequestHeader(t,e)})),_.send(a||null))};if(i){const t="undefined"!=typeof performance&&ee.isFunction(performance.now)?()=>performance.now():Date.now,r=_.timeout>0?t()+Number(_.timeout):void 0,a=()=>{if(!_)return;const e=_;e.ontimeout(),e.abort()};if(void 0!==r){const e=()=>{const n=r-t();n>0?c=setTimeout(e,Math.min(n,2147483647)):a()};e()}it.readAsync(i).then((e=>{if(_)if(void 0!==r&&t()>=r)a();else{if(e){const t=ee.hasOwnProp(o,"xsrfHeaderName")&&o.xsrfHeaderName;s.set(t,e)}O()}})).catch((t=>{_&&(n(ve.from(t,null,e,_)),m(),_=null)}))}else O()}))};const Et=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const i=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof ve?t:new Ye(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new ve(`timeout of ${t}ms exceeded`,ve.ETIMEDOUT))}),t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{const t=ee.getSafeProp(e,"unsubscribe");ee.isFunction(t)?t.call(e,i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>{r||(e.aborted?i.call(e):e.addEventListener("abort",i,{once:!0}))}));const{signal:s}=n;return s.unsubscribe=()=>ee.asap(a),s},At=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},jt=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*At(n,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},Tt="\r\n",Nt=e=>String(e).replace(/\r\n|\r|\n/g,Tt),xt=e=>String(e).replace(/[\r\n"]/g,(e=>"\r"===e?"%0D":"\n"===e?"%0A":"%22")),kt=(e,t)=>{let n=0;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);!t||13!==i&&10!==i?i<128?n++:i<2048?n+=2:i>=55296&&i<=56319&&e.charCodeAt(r+1)>=56320&&e.charCodeAt(r+1)<=57343?(n+=4,r++):n+=3:(13===i&&10===e.charCodeAt(r+1)&&r++,n+=2)}return n};class Dt extends TypeError{constructor(e,t){super(e),this.name="FormDataError",this.reason=t}}const Ut=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Ft=(e,t,n)=>t+2<n&&Ut(e.charCodeAt(t+1))&&Ut(e.charCodeAt(t+2)),It=e=>e<=57?e-48:(223&e)-55,Lt=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,qt=e=>{const t=e.length;let n=0,r=0,i=!1;for(let a=0;a<t;a++){let s=e.charCodeAt(a);37===s&&Ft(e,a,t)&&(s=16*It(e.charCodeAt(a+1))+It(e.charCodeAt(a+2)),a+=2),9!==(o=s)&&10!==o&&12!==o&&13!==o&&32!==o&&(61!==s?!Lt(s)||r>0?i=!0:n++:r++)}var o;return i||r>2||r>0&&(n+r)%4!=0||n%4==1?(e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)})(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)};const Mt="1.21.1",Ht={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:Bt}=ee,zt=e=>{if(!ee.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Wt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Vt=e=>{const t=void 0!==ee.global&&null!==ee.global?ee.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=ee.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response,Blob:t.Blob},e);const i=ee.hasOwnProp(e,"fetch")?e.fetch:void 0,{Request:o,Response:a,Blob:s}=e,u=i?Bt(i):"function"==typeof fetch,c=Bt(o),l=Bt(a);if(!u)return!1;const d=u&&Bt(n),f=u&&("function"==typeof r?(h=new r,e=>h.encode(e)):async e=>new Uint8Array(await new o(e).arrayBuffer()));var h;const p=c&&d&&Wt((()=>{let e=!1;const t=new o(He.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),y=l&&d&&Wt((()=>ee.isReadableStream(new a("").body))),g=Object.assign(Object.create(null),Ht);c&&!Wt((()=>new o(He.origin,g)))&&(delete g.cache,Wt((()=>new o(He.origin,g)))||(g.cache=Ht.cache));const v={stream:y&&(e=>e.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!v[e]&&(v[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ve(`Response type '${e}' is not supported`,ve.ERR_NOT_SUPPORT,n)})}));const m=async e=>null==e?0:ee.isBlob(e)?e.size:ee.isArrayBufferView(e)||ee.isArrayBuffer(e)?e.byteLength:(ee.isURLSearchParams(e)&&(e+=""),ee.isString(e)?(await f(e)).byteLength:void 0);return async e=>{let{url:t,method:n,data:u,signal:l,cancelToken:f,timeout:h,onDownloadProgress:_,onUploadProgress:b,responseType:w,headers:O,withCredentials:S="same-origin",fetchOptions:P,maxContentLength:R,maxBodyLength:C,maxRedirects:E}=Rt(e);const A=ee.isNumber(R)&&R>-1,j=ee.isNumber(C)&&C>-1,T=t=>ee.hasOwnProp(e,t)?e[t]:void 0;let N=i||fetch;w=w?(w+"").toLowerCase():"text";let x=Et([l,f&&f.toAbortSignal()],h),k=null;const D=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let U,F=null,I=null;const L=()=>new ve("Request body larger than maxBodyLength limit",ve.ERR_BAD_REQUEST,e,k);try{let i;const l=T("auth");if(l){i={username:ee.getSafeProp(l,"username")||"",password:ee.getSafeProp(l,"password")||""}}let f;if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){if(f=new URL(t,He.origin),!i&&(f.username||f.password)){i={username:zt(f.username),password:zt(f.password)}}(f.username||f.password)&&(f.username="",f.password="",t=f.href)}if(i&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa((q=(i.username||"")+":"+(i.password||""),encodeURIComponent(q).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))),A&&f&&"data:"===f.protocol&&function(e){const t="string"==typeof e?e.indexOf("#"):-1;return((e,t,n)=>{if(!e||"string"!=typeof e)return 0;if(!/^data:/i.test(e))return 0;const r=e.indexOf(",");if(r<0)return 0;const i=e.slice(5,r),o=e.slice(r+1);if(/; *base64[\t\n\f\r ]*$/i.test(i))return t(o);let a=0;for(let e=0,t=o.length;e<t;e++){const n=o.charCodeAt(e);if(37===n&&Ft(o,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=o.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a})(-1===t?e:e.slice(0,t),qt)}(f.href)>R)throw new ve("maxContentLength size of "+R+" exceeded",ve.ERR_BAD_RESPONSE,e,k);const h=ee.isSpecCompliantForm(u)&&he.from(T("headers")).getContentType();let M;if(ee.isString(h)&&/^multipart\/form-data(?:\s*;|$)/i.test(h.trim())){const e=he.parseParameters(h);ee.hasOwnProp(e,"boundary")&&(M=e.boundary)}if(ee.isSpecCompliantForm(u)&&"get"!==n&&"head"!==n&&(j||b&&p||void 0!==M)&&(u=function(e,t,n,r,i){if(!ee.isFunction(t))throw new ve("Blob is not supported",ve.ERR_NOT_SUPPORT);if(void 0===i)if(ee.isFunction(He.generateString))i="axios-"+He.generateString(36,"0123456789abcdef");else{const e=ee.global.crypto;if(!e||!ee.isFunction(e.getRandomValues))throw new ve("Random byte generation is not supported",ve.ERR_NOT_SUPPORT);const t=new Uint8Array(18);e.getRandomValues(t),i="axios-"+Array.from(t,(e=>("0"+e.toString(16)).slice(-2))).join("")}try{return function(e,t,n,r,i){if(!ee.isFunction(t))throw new Dt("Blob is not supported","blob");if(!ee.isString(i)||!/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(i)||/ $/.test(i))throw new Dt("Invalid multipart boundary","boundary");const o="--"+i+"--"+Tt;let a=o.length;const s=[],u=e=>{if(a+e>n)throw r()};u(0);for(const[t,n]of e){const e=ee.isString(n),r=e?kt(n,!0):n.size;if(!Number.isFinite(r)||r<0)throw new Dt("Unsupported FormData part size","part");u(r+kt(t,!0)+(!e&&n.name?kt(n.name,!1):0)+(!e&&n.type?kt(n.type,!1):0));let o="--"+i+'\r\nContent-Disposition: form-data; name="'+xt(Nt(t))+'"';e||(o+='; filename="'+xt(ee.isString(n.name)?n.name:"blob")+'"\r\nContent-Type: '+String(n.type||"application/octet-stream").replace(/[\r\n]/g,"")),o+=Tt+Tt;const c=kt(o,!1)+r+2;u(c),a+=c,s.push({header:o,value:n,isString:e})}const c=[];for(const e of s)c.push(e.header,e.isString?Nt(e.value):e.value,Tt);return c.push(o),new t(c,{type:"multipart/form-data; boundary="+i})}(e,t,n,r,i)}catch(e){if(e instanceof Dt){const t="boundary"===e.reason?ve.ERR_BAD_OPTION_VALUE:ve.ERR_BAD_REQUEST;throw new ve(e.message,t)}throw e}}(u,s,j?C:1/0,L,M),O.setContentType(void 0===M?u.type:h),U=u.size),j&&"get"!==n&&"head"!==n){const e=await m(u);if("number"==typeof e&&isFinite(e)&&(U=e,e>C))throw L()}const H=j&&(ee.isReadableStream(u)||ee.isStream(u)),B=(e,t,n)=>jt(e,65536,(e=>{if(j&&e>C)throw F=L();t&&t(e)}),n);if(p&&"get"!==n&&"head"!==n&&(b||H)){if(U=null==U?await(async(e,t)=>{const n=ee.toFiniteNumber(e.getContentLength());return null==n?m(t):n})(O,u):U,0!==U||H){let e,n=new o(t,{method:"POST",body:u,duplex:"half"});if(ee.isFormData(u)&&(e=n.headers.get("content-type"))&&O.setContentType(e),n.body){const[e,t]=b&&at(U,ot(st(b)))||[];u=B(n.body,e,t)}}}else if(H&&!c&&d&&"get"!==n&&"head"!==n)u=B(u);else if(H&&c&&!p&&"get"!==n&&"head"!==n)throw new ve("Stream request bodies are not supported by the current fetch implementation",ve.ERR_NOT_SUPPORT,e,k);ee.isString(S)||(S=S?"include":"omit");const z=c&&"credentials"in o.prototype;if(ee.isFormData(u)){const e=O.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&O.delete("content-type")}O.set("User-Agent","axios/"+Mt,!1);const W=null==P?P:Object.assign(Object.create(null),P);W&&(delete W.body,delete W.headers,delete W.method,delete W.signal,delete W.duplex,delete W.credentials);const V=Object.assign(Object.create(null),W,{signal:x,method:n.toUpperCase(),headers:oe(O.normalize()),body:u,duplex:"half",credentials:z?S:void 0});c&&(ee.forEach(g,((e,t)=>{void 0===V[t]&&(V[t]=e)})),void 0===V.signal&&(V.signal=null),void 0===V.body&&(V.body=null)),0===E&&(V.redirect="manual",W&&(W.redirect="manual")),k=c&&new o(t,V);let K=await(c?N(k,W):N(t,V));const J=he.from(K.headers);if(A){const t=ee.toFiniteNumber(J.getContentLength());if(null!=t&&t>R)throw new ve("maxContentLength size of "+R+" exceeded",ve.ERR_BAD_RESPONSE,e,k)}const G=y&&("stream"===w||"response"===w);if(y&&K.body&&(_||A||G&&D)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=K[e]}));const n=ee.toFiniteNumber(J.getContentLength()),[r,i]=_&&at(n,ot(st(_),!0))||[];let o=0;const s=t=>{if(A&&(o=t,o>R))throw I=new ve("maxContentLength size of "+R+" exceeded",ve.ERR_BAD_RESPONSE,e,k);r&&r(t)};K=new a(jt(K.body,65536,s,(()=>{i&&i(),D&&D()})),t)}w=w||"text";let $=await v[ee.findKey(v,w)||"text"](K,e);if(A&&!y&&!G){let t;if(null!=$&&("number"==typeof $.byteLength?t=$.byteLength:"number"==typeof $.size?t=$.size:"string"==typeof $&&(t="function"==typeof r?(new r).encode($).byteLength:$.length)),"number"==typeof t&&t>R)throw new ve("maxContentLength size of "+R+" exceeded",ve.ERR_BAD_RESPONSE,e,k)}return!G&&D&&D(),await new Promise(((t,n)=>{Ze(t,n,{data:$,headers:he.from(K.headers),status:K.status,statusText:K.statusText,config:e,request:k})}))}catch(t){if(D&&D(),x&&x.aborted&&x.reason instanceof ve){const n=x.reason;throw n.config=e,k&&(n.request=k),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(F)throw k&&!F.request&&(F.request=k),F;if(I)throw I;if(t instanceof ve)throw k&&!t.request&&(t.request=k),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new ve("Network Error",ve.ERR_NETWORK,e,k,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw ve.from(t,t&&t.code,e,k,t&&t.response)}var q}},Kt=new Map,Jt=e=>{const t=Object.create(null),n=e&&ee.hasOwnProp(e,"env")&&e.env;["fetch","Request","Response","Blob"].forEach((e=>{n&&ee.hasOwnProp(n,e)&&(t[e]=n[e])}));const{fetch:r,Request:i,Response:o,Blob:a}=t,s=[i,o,r,a];let u,c,l=s.length,d=Kt;for(;l--;)u=s[l],c=d.get(u),void 0===c&&d.set(u,c=l?new Map:Vt(t)),d=c;return c};Jt();const Gt={http:null,xhr:Ct,fetch:{get:Jt}};ee.forEach(Gt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const $t=e=>`- ${e}`,Xt=e=>ee.isFunction(e)||null===e||!1===e;var Qt=function(e,t){e=ee.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){let n;if(r=e[a],i=r,!Xt(r)&&(i=Gt[(n=String(r)).toLowerCase()],void 0===i))throw new ve(`Unknown adapter '${n}'`);if(i&&(ee.isFunction(i)||(i=i.get(t))))break;o[n||"#"+a]=i}if(!i){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map($t).join("\n"):" "+$t(e[0]):"as no adapter specified";throw new ve("There is no suitable adapter to dispatch the request "+t,ve.ERR_NOT_SUPPORT)}return i};function Yt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ye(null,e)}function Zt(e,t){return Math.max(0,Math.round(e()-t))}function en(e){const t=ee.toSafeFlatObject(e);Yt(t),t.headers=he.from(ee.getSafeProp(t,"headers")),t.data=Xe.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);const n=Qt(t.adapter||$e.adapter,t),r="undefined"!=typeof performance&&ee.isFunction(performance.now)?()=>performance.now():Date.now,i=r();return n(t).then((function(e){Yt(t),e.duration=Zt(r,i),t.response=e;try{e.data=Xe.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=he.from(e.headers),e}),(function(e){if(!Qe(e)&&(Yt(t),e&&e.response)){e.response.duration=Zt(r,i),t.response=e.response;try{e.response.data=Xe.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=he.from(e.response.headers)}return Promise.reject(e)}))}const tn={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{tn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const nn={};tn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Mt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new ve(r(i," has been removed"+(t?" in "+t:"")),ve.ERR_DEPRECATED);return t&&!nn[i]&&(nn[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},tn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var rn={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new ve("options must be an object",ve.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new ve("option "+o+" must be "+n,ve.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ve("Unknown option "+o,ve.ERR_BAD_OPTION)}},validators:tn};const on=rn.validators,an=e=>{if(null==e||ee.isPlainObject(e)||e instanceof he)return!0;try{return ee.isObject(e)&&"AxiosHeaders"===ee.getSafeProp(e,Symbol.toStringTag)&&["toJSON","set","get","has","delete","clear","normalize","concat","toString",Symbol.iterator].every((t=>ee.isFunction(ee.getSafeProp(e,t))))}catch(e){return!1}};class sn{constructor(e){this.defaults=e||{},this.interceptors={request:new ke,response:new ke}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),i=-1===n?r:r.slice(n+1),o=String(e.stack),a=function(e,t){const n=ee.hasOwnProp(e,ge)&&e[ge];return n&&t.endsWith(n)?t.length-n.length:-1}(e,o),s=-1===a?o:o.slice(0,a),u=-1===a?"":o.slice(a);s.endsWith(i)||(e.stack=s+"\n"+r+u)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=wt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&rn.assertOptions(n,{silentJSONParsing:on.transitional(on.boolean),forcedJSONParsing:on.transitional(on.boolean),clarifyTimeoutError:on.transitional(on.boolean),legacyInterceptorReqResOrdering:on.transitional(on.boolean),advertiseZstdAcceptEncoding:on.transitional(on.boolean),validateStatusUndefinedResolves:on.transitional(on.boolean),encodeBasicAuthUsername:on.transitional(on.boolean)},!1),null!=r&&(ee.isFunction(r)?t.paramsSerializer={serialize:r}:rn.assertOptions(r,{encode:on.function,serialize:on.function},!0)),void 0!==t.allowAbsoluteUrls||(ee.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rn.assertOptions(t,{baseUrl:on.spelling("baseURL"),withXsrfToken:on.spelling("withXSRFToken")},!0),t.method=(ee.getSafeProp(t,"method")||ee.getSafeProp(this.defaults,"method")||"get").toLowerCase();const o=ee.getSafeProp(i,"common"),a=ee.getSafeProp(i,t.method),s=i&&ee.merge(an(o)?o:void 0,an(a)?a:void 0);i&&ee.forEach(Je.concat("common"),(e=>{an(ee.getSafeProp(i,e))&&delete i[e]})),t.headers=he.concat(s,i);const u=[];let c=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;const n=t.transitional||De;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)}));const l=[];let d;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let f,h=0;if(!c){const e=[en.bind(this),void 0];for(e.unshift(...u),e.push(...l),f=e.length,d=Promise.resolve(t);h<f;)d=d.then(e[h++],e[h++]);return d}f=u.length;let p=t;for(;h<f;){const e=u[h++],t=u[h++];try{p=e?e(p):p}catch(e){if(!t){d=Promise.reject(e);break}try{const n=t.call(this,e);ee.isThenable(n)&&(d=Promise.resolve(n).then((()=>en.call(this,p))))}catch(e){d=Promise.reject(e)}break}}if(!d)try{d=en.call(this,p)}catch(e){d=Promise.reject(e)}for(h=0,f=l.length;h<f;)d=d.then(l[h++],l[h++]);return d}getUri(e){return Ae(dt((e=wt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}ee.forEach(["delete","get","head","options"],(function(e){sn.prototype[e]=async function(t,n){return this.request(wt(n||{},{method:e,url:t,data:n&&ee.hasOwnProp(n,"data")?n.data:void 0}))}})),ee.forEach(["post","put","patch","query"],(function(e){function t(t){return async function(n,r,i){return this.request(wt(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}sn.prototype[e]=t(),"query"!==e&&(sn.prototype[e+"Form"]=t(!0))}));class un{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Ye(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new un((function(t){e=t})),cancel:e}}}const cn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(cn).forEach((([e,t])=>{void 0===cn[t]&&(cn[t]=e)}));const ln=function e(t){const n=new sn(t),i=r(sn.prototype.request,n);return ee.extend(i,sn.prototype,n,{allOwnKeys:!0}),ee.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(wt(t,n))},i}($e);ln.Axios=sn,ln.CanceledError=Ye,ln.CancelToken=un,ln.isCancel=Qe,ln.VERSION=Mt,ln.toFormData=Se,ln.AxiosError=ve,ln.Cancel=ln.CanceledError,ln.all=function(e){return Promise.all(e)},ln.spread=function(e){return function(t){return e.apply(null,t)}},ln.isAxiosError=function(e){return ee.isObject(e)&&!0===e.isAxiosError},ln.mergeConfig=wt,ln.AxiosHeaders=he,ln.formToJSON=e=>Ke(ee.isHTMLForm(e)?new FormData(e):e),ln.getAdapter=Qt,ln.HttpStatusCode=cn,ln.default=ln,e.exports=ln},3301:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>U,__assign:()=>o,__asyncDelegator:()=>R,__asyncGenerator:()=>P,__asyncValues:()=>C,__await:()=>S,__awaiter:()=>p,__classPrivateFieldGet:()=>x,__classPrivateFieldIn:()=>D,__classPrivateFieldSet:()=>k,__createBinding:()=>g,__decorate:()=>s,__disposeResources:()=>I,__esDecorate:()=>c,__exportStar:()=>v,__extends:()=>i,__generator:()=>y,__importDefault:()=>N,__importStar:()=>T,__makeTemplateObject:()=>E,__metadata:()=>h,__param:()=>u,__propKey:()=>d,__read:()=>_,__rest:()=>a,__rewriteRelativeImportExtension:()=>L,__runInitializers:()=>l,__setFunctionName:()=>f,__spread:()=>b,__spreadArray:()=>O,__spreadArrays:()=>w,__values:()=>m,default:()=>q});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function a(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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t,n,r,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=r.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?r.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f=!1,h=n.length-1;h>=0;h--){var p={};for(var y in r)p[y]="access"===y?{}:r[y];for(var y in r.access)p.access[y]=r.access[y];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var g=(0,n[h])("accessor"===u?{get:d.get,set:d.set}:d[c],p);if("accessor"===u){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(d.get=s),(s=a(g.set))&&(d.set=s),(s=a(g.init))&&i.unshift(s)}else(s=a(g))&&("field"===u?i.unshift(s):d[c]=s)}l&&Object.defineProperty(l,r.name,d),f=!0}function l(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function y(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var g=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function v(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||g(t,e,n)}function m(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_(arguments[t]));return e}function w(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function O(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function S(e){return this instanceof S?(this.v=e,this):new S(e)}function P(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof S?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function R(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:S(e[r](t)),done:!1}:i?i(t):t}:i}}function C(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=m(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},j=function(e){return j=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},j(e)};function T(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=j(e),r=0;r<n.length;r++)"default"!==n[r]&&g(t,e,n[r]);return A(t,e),t}function N(e){return e&&e.__esModule?e:{default:e}}function x(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function k(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function U(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var F="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function I(e){function t(t){e.error=e.hasError?new F(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,r=0;return function i(){for(;n=e.stack.pop();)try{if(!n.async&&1===r)return r=0,e.stack.push(n),Promise.resolve().then(i);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(o).then(i,(function(e){return t(e),i()}))}else r|=1}catch(e){t(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function L(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,r,i,o){return n?t?".jsx":".js":!r||i&&o?r+i+"."+o.toLowerCase()+"js":e})):e}const q={__extends:i,__assign:o,__rest:a,__decorate:s,__param:u,__esDecorate:c,__runInitializers:l,__propKey:d,__setFunctionName:f,__metadata:h,__awaiter:p,__generator:y,__createBinding:g,__exportStar:v,__values:m,__read:_,__spread:b,__spreadArrays:w,__spreadArray:O,__await:S,__asyncGenerator:P,__asyncDelegator:R,__asyncValues:C,__makeTemplateObject:E,__importStar:T,__importDefault:N,__classPrivateFieldGet:x,__classPrivateFieldSet:k,__classPrivateFieldIn:D,__addDisposableResource:U,__disposeResources:I,__rewriteRelativeImportExtension:L}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function e(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(r,{default:()=>R});var c=n(4756),l=function(){return u((function e(){var t,n,r,o,a,s,u,c,l,d,f,h,p,y,g,v,m,_,b,w,O,S,P,R,C=this,E=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.server=E.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=null!==(t=this.server.cacheSearchResultsForSeconds)&&void 0!==t?t:120,this.additionalSearchParameters=null!==(n=E.additionalSearchParameters)&&void 0!==n?n:{},this.additionalSearchParameters.query_by=null!==(r=null!==(o=this.additionalSearchParameters.queryBy)&&void 0!==o?o:this.additionalSearchParameters.query_by)&&void 0!==r?r:"",this.additionalSearchParameters.preset=null!==(a=null!==(s=this.additionalSearchParameters.preset)&&void 0!==s?s:this.additionalSearchParameters.preset)&&void 0!==a?a:"",this.additionalSearchParameters.sort_by=null!==(u=null!==(c=this.additionalSearchParameters.sortBy)&&void 0!==c?c:this.additionalSearchParameters.sort_by)&&void 0!==u?u:"",this.additionalSearchParameters.highlight_full_fields=null!==(l=null!==(d=this.additionalSearchParameters.highlightFullFields)&&void 0!==d?d:this.additionalSearchParameters.highlight_full_fields)&&void 0!==l?l:this.additionalSearchParameters.query_by,this.geoLocationField=null!==(f=E.geoLocationField)&&void 0!==f?f:"_geoloc",this.facetableFieldsWithSpecialCharacters=null!==(h=E.facetableFieldsWithSpecialCharacters)&&void 0!==h?h:[],this.collectionSpecificSearchParameters=null!==(p=E.collectionSpecificSearchParameters)&&void 0!==p?p:{},Object.keys(this.collectionSpecificSearchParameters).forEach((function(e){var t,n,r,i,o,a,s=C.collectionSpecificSearchParameters[e];s.query_by=null!==(t=s.queryBy)&&void 0!==t?t:s.query_by,s.preset=null!==(n=s.preset)&&void 0!==n?n:s.preset,s.sort_by=null!==(r=s.sortBy)&&void 0!==r?r:s.sort_by,s.highlight_full_fields=null!==(i=null!==(o=null!==(a=s.highlightFullFields)&&void 0!==a?a:s.highlight_full_fields)&&void 0!==o?o:C.additionalSearchParameters.highlight_full_fields)&&void 0!==i?i:s.query_by,Object.keys(s).forEach((function(e){return void 0===s[e]?delete s[e]:{}}))})),this.renderingContent=E.renderingContent,this.flattenGroupedHits=null===(y=E.flattenGroupedHits)||void 0===y||y,this.facetByOptions=null!==(g=E.facetByOptions)&&void 0!==g?g:{},this.filterByOptions=null!==(v=E.filterByOptions)&&void 0!==v?v:{},this.sortByOptions=null!==(m=E.sortByOptions)&&void 0!==m?m:{},this.collectionSpecificFacetByOptions=null!==(_=E.collectionSpecificFacetByOptions)&&void 0!==_?_:{},this.collectionSpecificFilterByOptions=null!==(b=E.collectionSpecificFilterByOptions)&&void 0!==b?b:{},this.collectionSpecificSortByOptions=null!==(w=E.collectionSpecificSortByOptions)&&void 0!==w?w:{},this.union=null!==(O=E.union)&&void 0!==O&&O,this.useOverrideTags=null!==(S=E.useOverrideTags)&&void 0!==S&&S,this.flipNegativeRefinementOperator=null!==(P=E.flipNegativeRefinementOperator)&&void 0!==P&&P,this.interpretNegativeNumericFacetFiltersAsExclusions=null!==(R=E.interpretNegativeNumericFacetFiltersAsExclusions)&&void 0!==R&&R}),[{key:"validate",value:function(){if((this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some((function(e){return e.queryBy})))&&console.warn("[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in additionalSearchParameters instead of camelCased parameters. For example: Use query_by instead of queryBy. camelCased parameters will be deprecated in a future version. We're making this change so that parameter names are identical to the ones sent to Typesense (which are all snake_cased), and to also keep the types for these parameters in sync with the types defined in typesense-js."),0===this.additionalSearchParameters.query_by.length&&0===this.additionalSearchParameters.preset.length&&(0===Object.keys(this.collectionSpecificSearchParameters).length||Object.values(this.collectionSpecificSearchParameters).some((function(e){return 0===(e.query_by||"").length&&0===(e.preset||"").length}))))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}])}(),d=n(8567);function f(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var g=["q","conversation","conversation_id","conversation_model_id"],v=function(){return u((function e(t,n,r){i(this,e),this.instantsearchRequests=t,this.typesenseClient=n,this.configuration=r,this.additionalSearchParameters=r.additionalSearchParameters,this.collectionSpecificSearchParameters=r.collectionSpecificSearchParameters}),[{key:"_shouldUseExactMatchForField",value:function(e,t){var n,r;return!1!==(null===(n=this.configuration.collectionSpecificFilterByOptions)||void 0===n||null===(n=n[t])||void 0===n||null===(n=n[e])||void 0===n?void 0:n.exactMatch)&&!1!==(null===(r=this.configuration.filterByOptions)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.exactMatch)}},{key:"_adaptFacetFilters",value:function(e,t){var n=this,r="";return e?r=e.map((function(e){if(Array.isArray(e)){var r={};e.forEach((function(e){var t=n._parseFacetFilter(e),i=t.fieldName,o=t.fieldValue;r[i]=r[i]||[],r[i].push(o)})),Object.keys(r).length>1&&console.error("[Typesense-Instantsearch-Adapter] Typesense does not support cross-field ORs at the moment. The adapter could not OR values between these fields: ".concat(Object.keys(r).join(",")));var i=Object.keys(r)[0],o=r[i].reduce((function(e,t){return n._isExcludedFacetValue(t)?e[0].push(t.substring(1)):e[1].push(t),e}),[[],[]]),a=y(o,2),s=a[0],u=a[1],c=[];if(u.length>0){var l=n._shouldUseExactMatchForField(i,t)?":=":":";c.push("".concat(i).concat(l,"[").concat(u.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}if(s.length>0){var d=n._shouldUseExactMatchForField(i,t)?":!=":":!";n.configuration.flipNegativeRefinementOperator?c.push("(".concat(s.map((function(e){return"".concat(i).concat(d).concat(n._escapeFacetValue(e))})).join(" || "),")")):c.push("".concat(i).concat(d,"[").concat(s.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}return c.filter((function(e){return e})).join(" && ")}var f,h=n._parseFacetFilter(e),p=h.fieldName,g=h.fieldValue;if(n._isExcludedFacetValue(g)){var v=n._shouldUseExactMatchForField(p,t)?":!=":":!";f="".concat(p).concat(v,"[").concat(n._escapeFacetValue(g.substring(1)),"]")}else{var m=n._shouldUseExactMatchForField(p,t)?":=":":";f="".concat(p).concat(m,"[").concat(n._escapeFacetValue(g),"]")}return f})).join(" && "):r}},{key:"_parseFacetFilter",value:function(e){var t,n,r,i,o;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var a=this.configuration.facetableFieldsWithSpecialCharacters.flat().map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(a.join("|"),"):(.*)$")),null!=(r=e.match(n)))return{fieldName:i="".concat(r[1]),fieldValue:o="".concat(r[2])}}return n=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n))?console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a facet filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter.")):(i="".concat(r[1]).concat(r[2]),o="".concat(r[3])),{fieldName:i,fieldValue:o}}},{key:"_isExcludedFacetValue",value:function(e){return e.startsWith("-")&&(this.configuration.interpretNegativeNumericFacetFiltersAsExclusions||!this._isNumber(e))}},{key:"_escapeFacetValue",value:function(e){return"string"==typeof e&&e.startsWith("\\-")&&(e=e.substring(1)),"boolean"==typeof e||"true"===e||"false"===e||this._isNumber(e)?e:"`".concat(e,"`")}},{key:"_isNumber",value:function(e){return Number.isInteger(e%1)||!!(e%1)}},{key:"_adaptNumericFilters",value:function(e){var t=this,n="";if(!e)return n;var r={};e.forEach((function(e){var n=t._parseNumericFilter(e),i=n.fieldName,o=n.operator,a=n.fieldValue;r[i]=r[i]||{},r[i][o]=a}));var i=[];return Object.keys(r).forEach((function(e){null!=r[e]["<="]&&null!=r[e][">="]?i.push("".concat(e,":=[").concat(r[e][">="],"..").concat(r[e]["<="],"]")):null!=r[e]["<="]?i.push("".concat(e,":<=").concat(r[e]["<="])):null!=r[e][">="]?i.push("".concat(e,":>=").concat(r[e][">="])):null!=r[e]["="]?i.push("".concat(e,":=").concat(r[e]["="])):console.warn("[Typesense-Instantsearch-Adapter] Unsupported operator found ".concat(JSON.stringify(r[e])))})),i.join(" && ")}},{key:"_parseNumericFilter",value:function(e){var t,n,r,i,o,a;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var s=this.configuration.facetableFieldsWithSpecialCharacters.map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(s.join("|"),")(<=|>=|>|<|=)(.*)$")),null!=(r=e.match(n))){var u=y(r,4);return{fieldName:i=u[1],operator:o=u[2],fieldValue:a=u[3]}}}if(n=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n)))console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a numeric filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter."));else{var c=y(r,4);i=c[1],o=c[2],a=c[3]}return{fieldName:i,operator:o,fieldValue:a}}},{key:"_adaptGeoFilter",value:function(e){var t=e.insideBoundingBox,n=e.aroundRadius,r=e.aroundLatLng,i=e.insidePolygon;if(t){var o,a,s,u;if(Array.isArray(t)){var c=y(t.flat(),4);o=c[0],a=c[1],s=c[2],u=c[3]}else{var l=y(t.split(","),4);o=l[0],a=l[1],s=l[2],u=l[3]}return"".concat(this.configuration.geoLocationField,":(").concat(o,", ").concat(a,", ").concat(o,", ").concat(u,", ").concat(s,", ").concat(u,", ").concat(s,", ").concat(a,")")}if(r||n){if(!n||"all"===n)throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var d="".concat(parseFloat(n)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(r,", ").concat(d,")")}if(i){var f=i;return Array.isArray(i)&&(f=i.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(f,")")}}},{key:"_splitByTopLevelAnd",value:function(e){for(var t=[],n="",r=!1,i=0;i<e.length;i+=1){var o=e[i],a=e[i+1];"`"===o&&(r=!r),r||"&"!==o||"&"!==a?n+=o:(""!==n.trim()&&t.push(n.trim()),n="",i+=1)}return""!==n.trim()&&t.push(n.trim()),t}},{key:"_splitListValues",value:function(e){for(var t=[],n="",r=!1,i=0;i<e.length;i+=1){var o=e[i];"`"===o&&(r=!r),r||","!==o?n+=o:(""!==n.trim()&&t.push(n.trim()),n="")}return""!==n.trim()&&t.push(n.trim()),t}},{key:"_parseListClause",value:function(e){var t=e.trim(),n=t.indexOf("["),r=t.lastIndexOf("]");if(-1===n||-1===r||r!==t.length-1)return null;var i=t.slice(0,n).trim(),o=t.slice(n+1,r),a=[":!=",":=",":!",":"].find((function(e){return i.endsWith(e)}));if(!a)return null;var s=i.slice(0,i.length-a.length).trim();return s?{fieldName:s,operator:a,values:this._splitListValues(o)}:null}},{key:"_mergeSameFieldExclusionListClauses",value:function(e){var t=this;if(!e)return e;var n=this._splitByTopLevelAnd(e),r={},i=[];return n.forEach((function(e,n){var o=t._parseListClause(e);if(o){var a=":!"===o.operator||":!="===o.operator?"exclude":null;if(null!=a){var s="".concat(o.fieldName,"|").concat(a);r[s]||(r[s]={clauseIndex:n,fieldName:o.fieldName,operator:o.operator,normalizedOperator:a,values:[]}),o.values.forEach((function(e){r[s].values.includes(e)||r[s].values.push(e)}))}else i.push({clauseIndex:n,clause:e})}else i.push({clauseIndex:n,clause:e})})),Object.values(r).forEach((function(e){i.push({clauseIndex:e.clauseIndex,clause:"".concat(e.fieldName).concat(e.operator,"[").concat(e.values.join(","),"]")})})),i.sort((function(e,t){return e.clauseIndex-t.clauseIndex})).map((function(e){return e.clause})).join(" && ")}},{key:"_adaptFilters",value:function(e,t){var n=[];e.filters&&n.push(e.filters),n.push(this._adaptFacetFilters(e.facetFilters,t)),n.push(this._adaptNumericFilters(e.numericFilters)),n.push(this._adaptGeoFilter(e));var r=n.filter((function(e){return e&&""!==e})).join(" && ");return this.configuration.flipNegativeRefinementOperator?this._mergeSameFieldExclusionListClauses(r):r}},{key:"_adaptIndexName",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_adaptFacetBy",value:function(e,t){var n=this;return[e].flat().map((function(e){var r;return null!==(r=n.configuration.collectionSpecificFacetByOptions)&&void 0!==r&&null!==(r=r[t])&&void 0!==r&&r[e]?"".concat(e).concat(n.configuration.collectionSpecificFacetByOptions[t][e]):n.configuration.facetByOptions[e]?"".concat(e).concat(n.configuration.facetByOptions[e]):e})).join(",")}},{key:"_adaptRulesContextsToOverrideTags",value:function(e){return e.join(",")}},{key:"_buildSearchParameters",value:function(e){for(var t,n,r=e.params,i=e.indexName,o=this._adaptIndexName(i),a={},s=0,u=Object.entries(this.additionalSearchParameters);s<u.length;s++){var c=y(u[s],2),l=c[0],d=c[1];a[this._camelToSnakeCase(l)]=d}if(this.collectionSpecificSearchParameters[o])for(var f=0,h=Object.entries(this.collectionSpecificSearchParameters[o]);f<h.length;f++){var p=y(h[f],2),g=p[0],v=p[1];a[this._camelToSnakeCase(g)]=v}var m=Object.assign({},a),_=this._adaptSortBy(i);Object.assign(m,{collection:o,q:""===r.query||void 0===r.query?"*":r.query,facet_by:a.facet_by||this._adaptFacetBy(r.facets,o),filter_by:this._adaptFilters(r,o)||a.filter_by,sort_by:_||a.sort_by,max_facet_values:r.maxValuesPerFacet,page:(r.page||0)+1}),null!=r.hitsPerPage&&(m.per_page=r.hitsPerPage),r.facetQuery&&(m.facet_query="".concat(r.facetName,":").concat(r.facetQuery),m.per_page=0),r.ruleContexts&&r.ruleContexts.length>0&&(m[this.configuration.useOverrideTags?"override_tags":"curation_tags"]=this._adaptRulesContextsToOverrideTags(r.ruleContexts)),r.typesenseVectorQuery&&(m.vector_query=r.typesenseVectorQuery);var b=(null===(t=this.configuration.collectionSpecificSortByOptions)||void 0===t||null===(t=t[o])||void 0===t?void 0:t[m.sort_by])||(null===(n=this.configuration.sortByOptions)||void 0===n?void 0:n[m.sort_by]);return null!=(null==b?void 0:b.enable_overrides)&&(m.enable_overrides=b.enable_overrides),Object.fromEntries(Object.entries(m).filter((function(e){var t=y(e,2),n=(t[0],t[1]);return null!=n&&""!==n})))}},{key:"_camelToSnakeCase",value:function(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}},{key:"request",value:(e=t(c.mark((function e(){var t,n,r,i,o,a,s,u,l,d,h=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.instantsearchRequests.map((function(e){return h._buildSearchParameters(e)})),i={},!0!==(null===(t=r[0])||void 0===t?void 0:t.conversation)&&"true"!==(null===(n=r[0])||void 0===n?void 0:n.conversation)||(o=r[0],a=o.q,s=o.conversation,u=o.conversation_id,l=o.conversation_model_id,i={q:a,conversation:s,conversation_id:u,conversation_model_id:l},r=r.map((function(e){return e.q,e.conversation,e.conversation_id,e.conversation_model_id,f(e,g)}))),d={searches:r},this.configuration.union&&(d.union=this.configuration.union,["page","per_page","offset","limit","limit_hits"].forEach((function(e){null!=r[0][e]&&(i[e]=r[0][e])}))),e.abrupt("return",this.typesenseClient.multiSearch.perform(d,i));case 6:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}],[{key:"INDEX_NAME_MATCHING_REGEX",get:function(){return new RegExp("^(.+?)(?=(/sort/(.*))|$)")}},{key:"DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*)((?!:).):(?!:)(.*)")}},{key:"DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*?)(<=|>=|>|<|=)(.*)")}}]);var e}();function m(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b={_adaptHighlightTag:function(e,t,n){return e.replace(new RegExp("<mark>","g"),t||"<mark>").replace(new RegExp("</mark>","g"),n||"</mark>")},_adaptNumberOfPages:function(){var e=this.typesenseResponse.union_request_params?this.typesenseResponse.union_request_params[0]:this.typesenseResponse.request_params,t=(null==e?void 0:e.per_page)||10,n=this.typesenseResponse.found/t;return Number.isFinite(n)?Math.ceil(n):1}};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var S=function(){return u((function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};i(this,e),this.typesenseResponse=t,this.instantsearchRequest=n,this.configuration=r,this.allTypesenseResults=o,this.fullTypesenseResponse=a}),[{key:"_adaptGroupedHits",value:function(e){var t=this,n=[];return n=e.map((function(e){var n=t._adaptHits(e.hits);return n.forEach((function(t){t.group_key=t._group_key=e.group_key,e.found&&(t._group_found=e.found)})),n})),this.configuration.flattenGroupedHits?n.flat():n.map((function(e){return O(O({},e[0]),{},{_grouped_hits:e})}))}},{key:"_adaptHits",value:function(e){var t=this;return e.map((function(e){var n=O({},e.document);n.objectID=e.document.id,n._snippetResult=t._adaptHighlightResult(e,"snippet"),n._highlightResult=t._adaptHighlightResult(e,"value"),n._rawTypesenseHit=e,t.fullTypesenseResponse.conversation&&(n._rawTypesenseConversation=t.fullTypesenseResponse.conversation),["text_match","geo_distance_meters","curated","text_match_info","hybrid_search_info","vector_distance","collection","search_index"].forEach((function(t){Object.keys(e).includes(t)&&!Object.keys(n).includes(t)&&(n[t]=e[t])}));var r=n[t.configuration.geoLocationField];return r&&(n._geoloc={lat:r[0],lng:r[1]}),n}))}},{key:"_adaptHighlightResult",value:function(e,t){var n={};return null!=e.highlight&&this.isHighlightPost0240RCN32Format(e.highlight)?this.adaptHighlightObject(e,n,t):this.adaptHighlightsArray(e,n,t),n}},{key:"isHighlightPost0240RCN32Format",value:function(e){return null==e.full&&null==e.snippet}},{key:"adaptHighlightsArray",value:function(e,t,n){var r=this;Object.assign.apply(Object,[t].concat(m(Object.entries(e.document).map((function(e){var t=y(e,2);return _({},t[0],{value:t[1],matchLevel:"none",matchedWords:[]})}))))),e.highlights.forEach((function(e){t[e.field]={value:e[n]||e["".concat(n,"s")],matchLevel:"full",matchedWords:e.matched_tokens},e.indices&&(t[e.field].matchedIndices=e.indices)})),Object.entries(t).forEach((function(i){var a=y(i,2),s=a[0],u=a[1],c=s,l=u.value,d=u.matchLevel,f=u.matchedWords,h=u.matchedIndices;null==l?t[c]=r._adaptHighlightNullValue():Array.isArray(l)?(t[c]=[],e.document[c].forEach((function(e,i){h&&h.includes(i)?t[c].push({value:r._adaptHighlightTag("".concat(l[h.indexOf(i)]),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag),matchLevel:d,matchedWords:f[i]}):"object"===o(e)?t[c].push(r._adaptHighlightInObjectValue(e,{},n)):t[c].push({value:"".concat(e),matchLevel:"none",matchedWords:[]})}))):"object"===o(l)?t[c]=r._adaptHighlightInObjectValue(l,{},n):t[c].value=r._adaptHighlightTag("".concat(l),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag)}))}},{key:"adaptHighlightObject",value:function(e,t,n){Object.assign(t,this._adaptHighlightInObjectValue(e.document,e.highlight,n))}},{key:"_adaptHighlightInObjectValue",value:function(e,t,n){var r=this;return Object.assign.apply(Object,[{}].concat(m(Object.entries(e).map((function(e){var i,a=y(e,2),s=a[0],u=a[1];if(null==u)i=r._adaptHighlightNullValue();else if(Array.isArray(u)){var c;i=r._adaptHighlightInArrayValue(u,null!==(c=null==t?void 0:t[s])&&void 0!==c?c:[],n)}else if("object"===o(u)){var l;i=r._adaptHighlightInObjectValue(u,null!==(l=null==t?void 0:t[s])&&void 0!==l?l:{},n)}else i=r._adaptHighlightInPrimitiveValue(u,null==t?void 0:t[s],n);return _({},s,i)})))))}},{key:"_adaptHighlightInArrayValue",value:function(e,t,n){var r=this;return e.map((function(e,i){var a;if(null==e)a=r._adaptHighlightNullValue();else if(Array.isArray(e)){var s;a=r._adaptHighlightInArrayValue(e,null!==(s=null==t?void 0:t[i])&&void 0!==s?s:[],n)}else if("object"===o(e)){var u;a=r._adaptHighlightInObjectValue(e,null!==(u=null==t?void 0:t[i])&&void 0!==u?u:{},n)}else a=r._adaptHighlightInPrimitiveValue(e,null==t?void 0:t[i],n);return a}))}},{key:"_adaptHighlightInPrimitiveValue",value:function(e,t,n){if(null!=t){var r,i,o,a=null!==(r=null!==(i=null!==(o=t[n])&&void 0!==o?o:t.highlight)&&void 0!==i?i:t.snippet)&&void 0!==r?r:e;return{value:this._adaptHighlightTag("".concat(a),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:(t.matched_tokens||[]).length>0?"full":"none",matchedWords:t.matched_tokens||[]}}return{value:this._adaptHighlightTag("".concat(e),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:"none",matchedWords:[]}}},{key:"_adaptHighlightNullValue",value:function(){return{value:"",matchLevel:"none",matchedWords:[]}}},{key:"_adaptFacets",value:function(e){var t={};return Array.isArray(e)&&e.forEach((function(e){Object.assign(t,_({},e.field_name,Object.assign.apply(Object,[{}].concat(m(e.counts.map((function(e){return _({},e.value,e.count)})))))))})),t}},{key:"_adaptFacetStats",value:function(e){var t={};return Array.isArray(e)&&e.forEach((function(e){e.stats&&Object.keys(e.stats).length>0&&Object.assign(t,_({},e.field_name,e.stats))})),t}},{key:"_adaptRenderingContent",value:function(e){var t,n=Object.assign({},this.configuration.renderingContent);return null==(null===(t=n.facetOrdering)||void 0===t||null===(t=t.facets)||void 0===t?void 0:t.order)&&(n.facetOrdering=n.facetOrdering||{},n.facetOrdering.facets=n.facetOrdering.facets||{},n.facetOrdering.facets.order=m(new Set((Array.isArray(e)?e:[]).map((function(e){return e.field_name})).concat(this.allTypesenseResults.map((function(e){return e.facet_counts||[]})).flat().map((function(e){return e.field_name})).filter((function(e){return e})))))),n}},{key:"_adaptUserData",value:function(e){return e?Array.isArray(e)?e:[e]:[]}},{key:"adapt",value:function(){var e=this._adaptRenderingContent(this.typesenseResponse.facet_counts||[]),t=this.typesenseResponse.union_request_params?this.typesenseResponse.union_request_params[0]:this.typesenseResponse.request_params,n=O({hits:this.typesenseResponse.grouped_hits?this._adaptGroupedHits(this.typesenseResponse.grouped_hits):this._adaptHits(this.typesenseResponse.hits),nbHits:this.typesenseResponse.found,page:this.typesenseResponse.union_request_params?this.typesenseResponse.page:this.typesenseResponse.page-1,nbPages:this._adaptNumberOfPages(),hitsPerPage:(null==t?void 0:t.per_page)||10,facets:this._adaptFacets(this.typesenseResponse.facet_counts||[]),facets_stats:this._adaptFacetStats(this.typesenseResponse.facet_counts||[]),query:(null==t?void 0:t.q)||"",processingTimeMS:this.typesenseResponse.search_time_ms},Object.keys(e).length>0?{renderingContent:e}:null);return this.typesenseResponse.metadata&&(n.appliedRules=["typesense-override"],n.userData=this._adaptUserData(this.typesenseResponse.metadata)),this.typesenseResponse.parsed_nl_query&&(n.parsed_nl_query=this.typesenseResponse.parsed_nl_query),this.fullTypesenseResponse.conversation&&0===n.hits.length&&(n.hits=[{_rawTypesenseConversation:this.fullTypesenseResponse.conversation}]),n}}])}();Object.assign(S.prototype,b);var P=function(){return u((function e(t,n){i(this,e),this.typesenseResponse=t,this.instantsearchRequest=n}),[{key:"_adaptFacetHits",value:function(e){var t=this,n=[],r=e.find((function(e){return e.field_name===t.instantsearchRequest.params.facetName}));return void 0!==r&&(n=r.counts.map((function(e){return{value:e.value,highlighted:t._adaptHighlightTag(e.highlighted,t.instantsearchRequest.params.highlightPreTag,t.instantsearchRequest.params.highlightPostTag),count:e.count}}))),n}},{key:"adapt",value:function(){return{facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms}}}])}();Object.assign(P.prototype,b);var R=function(){return u((function e(t){var n=this;i(this,e),this.updateConfiguration(t),this.searchClient={clearCache:function(){return n.clearCache()},search:function(e){return n.searchTypesenseAndAdapt(e)},searchForFacetValues:function(e){return n.searchTypesenseForFacetValuesAndAdapt(e)}}}),[{key:"searchTypesenseAndAdapt",value:(r=t(c.mark((function e(t){var n,r,i,o,a,s=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:if(!(n=e.sent).union_request_params){e.next=12;break}return this._validateTypesenseResult(n),r=new S(n,t[0],this.configuration,[n],n),i=r.adapt(),o=t.map((function(){return i})),e.abrupt("return",{results:o});case 12:return a=n.results.map((function(e,r){return s._validateTypesenseResult(e),new S(e,t[r],s.configuration,n.results,n).adapt()})),e.abrupt("return",{results:a});case 14:e.next=20;break;case 16:throw e.prev=16,e.t0=e.catch(0),console.error(e.t0),e.t0;case 20:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return r.apply(this,arguments)})},{key:"searchTypesenseForFacetValuesAndAdapt",value:(n=t(c.mark((function e(t){var n,r,i=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,r=n.results.map((function(e,n){return i._validateTypesenseResult(e),new P(e,t[n],i.configuration).adapt()})),e.abrupt("return",r);case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return n.apply(this,arguments)})},{key:"_adaptAndPerformTypesenseRequest",value:(e=t(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new v(t,this.typesenseClient,this.configuration),e.next=3,n.request();case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"clearCache",value:function(){return this.typesenseClient=new d._t(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(e){return this.configuration=new l(e),this.configuration.validate(),this.typesenseClient=new d._t(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(e){if(e.error)throw new Error("".concat(e.code," - ").concat(e.error));if(!e.hits&&!e.grouped_hits)throw new Error("Did not find any hits. ".concat(e.code," - ").concat(e.error))}}]);var e,n,r}()})(),r.default})()));
3
3
  //# sourceMappingURL=typesense-instantsearch-adapter.min.js.map