forked from typesense/typesense-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypesense.min.js
More file actions
3 lines (3 loc) · 132 KB
/
Copy pathtypesense.min.js
File metadata and controls
3 lines (3 loc) · 132 KB
1
2
3
/*! For license information please see typesense.min.js.LICENSE.txt */
var Typesense;(()=>{var e={65: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 p(e,n){var a,s,c,p=this,h="loglevel";function f(){var e;if(typeof window!==t&&h){try{e=window.localStorage[h]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(h),i=n.indexOf(r+"=");-1!==i&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(e){}return void 0===p.levels[e]&&(e=void 0),e}}function d(e){var t=e;if("string"==typeof t&&void 0!==p.levels[t.toUpperCase()]&&(t=p.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=p.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?h+=":"+e:"symbol"==typeof e&&(h=void 0),p.name=e,p.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},p.methodFactory=n||l,p.getLevel=function(){return null!=c?c:null!=s?s:a},p.setLevel=function(e,n){return c=d(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&h){try{return void(window.localStorage[h]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"="+n+";"}catch(e){}}}(c),u.call(p)},p.setDefaultLevel=function(e){s=d(e),f()||p.setLevel(e,!1)},p.resetLevel=function(){c=null,function(){if(typeof window!==t&&h){try{window.localStorage.removeItem(h)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(p)},p.enableAll=function(e){p.setLevel(p.levels.TRACE,e)},p.disableAll=function(e){p.setLevel(p.levels.SILENT,e)},p.rebuild=function(){if(o!==p&&(a=d(o.getLevel())),u.call(p),o===p)for(var e in i)i[e].rebuild()},a=d(o?o.getLevel():"WARN");var y=f();null!=y&&(c=d(y)),u.call(p)}(o=new p).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 p(e,o.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(t,n,t,e))||(e.exports=i)}()},612:()=>{},939:()=>{},82:()=>{},633:(e,t,n)=>{var r=n(738).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",p=u.toStringTag||"@@toStringTag";function h(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(t){h=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var i=t&&t.prototype instanceof w?t:w,o=Object.create(i.prototype),a=new U(r||[]);return s(o,"_invoke",{value:A(e,n,a)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var y="suspendedStart",v="suspendedYield",m="executing",g="completed",b={};function w(){}function C(){}function k(){}var S={};h(S,c,(function(){return this}));var R=Object.getPrototypeOf,O=R&&R(R(_([])));O&&O!==o&&a.call(O,c)&&(S=O);var P=k.prototype=w.prototype=Object.create(S);function E(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(i,o,s,u){var c=d(e[i],e,o);if("throw"!==c.type){var l=c.arg,p=l.value;return p&&"object"==r(p)&&a.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(p).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 A(e,n,r){var i=y;return function(o,a){if(i===m)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===b)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=m;var c=d(e,n,r);if("normal"===c.type){if(i=r.done?g:v,c.arg===b)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")),b;var o=d(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;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,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}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 j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function U(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function _(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 C.prototype=k,s(P,"constructor",{value:k,configurable:!0}),s(k,"constructor",{value:C,configurable:!0}),C.displayName=h(k,p,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===C||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,h(e,p,"GeneratorFunction")),e.prototype=Object.create(P),e},n.awrap=function(e){return{__await:e}},E(x.prototype),h(x.prototype,l,(function(){return this})),n.AsyncIterator=x,n.async=function(e,t,r,i,o){void 0===o&&(o=Promise);var a=new x(f(e,t,r,i),o);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(P),h(P,p,"Generator"),h(P,c,(function(){return this})),h(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=_,U.prototype={constructor:U,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(j),!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,b):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),b},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),j(n),b}},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;j(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},738: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},756:(e,t,n)=>{var r=n(633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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.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={};(()=>{"use strict";n.r(r),n.d(r,{Client:()=>Dr,Errors:()=>t,SearchClient:()=>Br,default:()=>Mr});var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>Le,hasStandardBrowserEnv:()=>De,hasStandardBrowserWebWorkerEnv:()=>Fe,navigator:()=>qe,origin:()=>He});var t={};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}function c(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}n.r(t),n.d(t,{HTTPError:()=>hn,ImportError:()=>En,MissingConfigurationError:()=>S,ObjectAlreadyExists:()=>nn,ObjectNotFound:()=>Zt,ObjectUnprocessable:()=>an,RequestMalformed:()=>Vt,RequestUnauthorized:()=>$t,ServerError:()=>cn,TypesenseError:()=>w});var l=n(65);function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(v())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&d(i,n.prototype),i}(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)},m(e)}function g(e,t,n){return t=f(t),h(e,b()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(b=function(){return!!e})()}var w=function(e){function t(e,n,r){var o;return i(this,t),(o=g(this,t,[e])).name=(this instanceof t?this.constructor:void 0).name,o.httpBody=n,o.httpStatus=r,Object.setPrototypeOf(p(o),(this instanceof t?this.constructor:void 0).prototype),o}return y(t,e),u(t)}(m(Error));function C(e,t,n){return t=f(t),h(e,k()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(k=function(){return!!e})()}var S=function(e){function t(){return i(this,t),C(this,t,arguments)}return y(t,e),u(t)}(w);function R(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}var O=function(){function e(t){var n=this;i(this,e),this.nodes=t.nodes||[],this.nodes=this.nodes.map((function(e){return n.setDefaultPathInNode(e)})).map((function(e){return n.setDefaultPortInNode(e)})).map((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e)})),null==t.randomizeNodes&&(t.randomizeNodes=!0),!0===t.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=t.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=t.connectionTimeoutSeconds||t.timeoutSeconds||5,this.healthcheckIntervalSeconds=t.healthcheckIntervalSeconds||60,this.numRetries=(void 0!==t.numRetries&&t.numRetries>=0?t.numRetries:this.nodes.length+(null==this.nearestNode?0:1))||3,this.retryIntervalSeconds=t.retryIntervalSeconds||.1,this.apiKey=t.apiKey,this.sendApiKeyAsQueryParam=t.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=t.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=t.useServerSideSearchCache||!1,this.axiosAdapter=t.axiosAdapter,this.logger=t.logger||l,this.logLevel=t.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=t.additionalHeaders,this.httpAgent=t.httpAgent,this.httpsAgent=t.httpsAgent,this.paramsSerializer=t.paramsSerializer,this.showDeprecationWarnings(t),this.validate()}return u(e,[{key:"validate",value:function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new S("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new S("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new S("Ensure that apiKey is set");return!0}},{key:"validateNodes",value:function(){var e=this;return this.nodes.some((function(t){return e.isNodeMissingAnyParameters(t)}))}},{key:"isNodeMissingAnyParameters",value:function(e){return!["protocol","host","port","path"].every((function(t){return e.hasOwnProperty(t)}))&&null==e.url}},{key:"setDefaultPathInNode",value:function(e){return null==e||e.hasOwnProperty("path")||(e.path=""),e}},{key:"setDefaultPortInNode",value: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}},{key:"showDeprecationWarnings",value: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")}},{key:"shuffleArray",value:function(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}}}]),e}();function P(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 E(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){P(o,r,i,a,s,"next",e)}function s(e){P(o,r,i,a,s,"throw",e)}a(void 0)}))}}var x=n(756),A=n.n(x);function T(e,t){return function(){return e.apply(t,arguments)}}const{toString:N}=Object.prototype,{getPrototypeOf:j}=Object,U=(_=Object.create(null),e=>{const t=N.call(e);return _[t]||(_[t]=t.slice(8,-1).toLowerCase())});var _;const I=e=>(e=e.toLowerCase(),t=>U(t)===e),L=e=>t=>typeof t===e,{isArray:q}=Array,D=L("undefined"),F=I("ArrayBuffer"),H=L("string"),B=L("function"),M=L("number"),K=e=>null!==e&&"object"==typeof e,z=e=>{if("object"!==U(e))return!1;const t=j(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},J=I("Date"),W=I("File"),V=I("Blob"),G=I("FileList"),Q=I("URLSearchParams"),[$,X,Y,Z]=["ReadableStream","Request","Response","Headers"].map(I);function ee(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),q(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{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 te(e,t){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 ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,re=e=>!D(e)&&e!==ne,ie=(oe="undefined"!=typeof Uint8Array&&j(Uint8Array),e=>oe&&e instanceof oe);var oe;const ae=I("HTMLFormElement"),se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ue=I("RegExp"),ce=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ee(n,((n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)})),Object.defineProperties(e,r)},le=I("AsyncFunction"),pe=(he="function"==typeof setImmediate,fe=B(ne.postMessage),he?setImmediate:fe?(de=`axios@${Math.random()}`,ye=[],ne.addEventListener("message",(({source:e,data:t})=>{e===ne&&t===de&&ye.length&&ye.shift()()}),!1),e=>{ye.push(e),ne.postMessage(de,"*")}):e=>setTimeout(e));var he,fe,de,ye;const ve="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ne):"undefined"!=typeof process&&process.nextTick||pe,me={isArray:q,isArrayBuffer:F,isBuffer:function(e){return null!==e&&!D(e)&&null!==e.constructor&&!D(e.constructor)&&B(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||B(e.append)&&("formdata"===(t=U(e))||"object"===t&&B(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&F(e.buffer),t},isString:H,isNumber:M,isBoolean:e=>!0===e||!1===e,isObject:K,isPlainObject:z,isReadableStream:$,isRequest:X,isResponse:Y,isHeaders:Z,isUndefined:D,isDate:J,isFile:W,isBlob:V,isRegExp:ue,isFunction:B,isStream:e=>K(e)&&B(e.pipe),isURLSearchParams:Q,isTypedArray:ie,isFileList:G,forEach:ee,merge:function e(){const{caseless:t}=re(this)&&this||{},n={},r=(r,i)=>{const o=t&&te(n,i)||i;z(n[o])&&z(r)?n[o]=e(n[o],r):z(r)?n[o]=e({},r):q(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ee(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(ee(t,((t,r)=>{n&&B(t)?e[r]=T(t,n):e[r]=t}),{allOwnKeys:r}),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),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&j(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:U,kindOfTest:I,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(q(e))return e;let t=e.length;if(!M(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).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:ae,hasOwnProperty:se,hasOwnProp:se,reduceDescriptors:ce,freezeMethods:e=>{ce(e,((t,n)=>{if(B(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];B(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 q(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:te,global:ne,isContextDefined:re,isSpecCompliantForm:function(e){return!!(e&&B(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(K(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=q(e)?[]:{};return ee(e,((e,t)=>{const o=n(e,r+1);!D(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:le,isThenable:e=>e&&(K(e)||B(e))&&B(e.then)&&B(e.catch),setImmediate:pe,asap:ve};function ge(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}me.inherits(ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:me.toJSONObject(this.config),code:this.code,status:this.status}}});const be=ge.prototype,we={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{we[e]={value:e}})),Object.defineProperties(ge,we),Object.defineProperty(be,"isAxiosError",{value:!0}),ge.from=(e,t,n,r,i,o)=>{const a=Object.create(be);return me.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ge.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const Ce=ge;function ke(e){return me.isPlainObject(e)||me.isArray(e)}function Se(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,n){return e?e.concat(t).map((function(e,t){return e=Se(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Oe=me.toFlatObject(me,{},null,(function(e){return/^is[A-Z]/.test(e)})),Pe=function(e,t,n){if(!me.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!me.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&me.isSpecCompliantForm(t);if(!me.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(me.isDate(e))return e.toISOString();if(!s&&me.isBlob(e))throw new Ce("Blob is not supported. Use a Buffer instead.");return me.isArrayBuffer(e)||me.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(me.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(me.isArray(e)&&function(e){return me.isArray(e)&&!e.some(ke)}(e)||(me.isFileList(e)||me.endsWith(n,"[]"))&&(s=me.toArray(e)))return n=Se(n),s.forEach((function(e,r){!me.isUndefined(e)&&null!==e&&t.append(!0===a?Re([n],r,o):null===a?n:n+"[]",u(e))})),!1;return!!ke(e)||(t.append(Re(i,n,o),u(e)),!1)}const l=[],p=Object.assign(Oe,{defaultVisitor:c,convertValue:u,isVisitable:ke});if(!me.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!me.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),me.forEach(n,(function(n,o){!0===(!(me.isUndefined(n)||null===n)&&i.call(t,n,me.isString(o)?o.trim():o,r,p))&&e(n,r?r.concat(o):[o])})),l.pop()}}(e),t};function Ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function xe(e,t){this._pairs=[],e&&Pe(e,this,t)}const Ae=xe.prototype;Ae.append=function(e,t){this._pairs.push([e,t])},Ae.toString=function(e){const t=e?function(t){return e.call(this,t,Ee)}:Ee;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Te=xe;function Ne(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function je(e,t,n){if(!t)return e;const r=n&&n.encode||Ne;me.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(o=i?i(t,n):me.isURLSearchParams(t)?t.toString():new Te(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const Ue=class{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){me.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},_e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Te,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Le="undefined"!=typeof window&&"undefined"!=typeof document,qe="object"==typeof navigator&&navigator||void 0,De=Le&&(!qe||["ReactNative","NativeScript","NS"].indexOf(qe.product)<0),Fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,He=Le&&window.location.href||"http://localhost",Be={...e,...Ie},Me=function(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&me.isArray(r)?r.length:o,s?(me.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&me.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&me.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(me.isFormData(e)&&me.isFunction(e.entries)){const n={};return me.forEachEntry(e,((e,r)=>{t(function(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},Ke={transitional:_e,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=me.isObject(e);if(i&&me.isHTMLForm(e)&&(e=new FormData(e)),me.isFormData(e))return r?JSON.stringify(Me(e)):e;if(me.isArrayBuffer(e)||me.isBuffer(e)||me.isStream(e)||me.isFile(e)||me.isBlob(e)||me.isReadableStream(e))return e;if(me.isArrayBufferView(e))return e.buffer;if(me.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Pe(e,new Be.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Be.isNode&&me.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=me.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Pe(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(me.isString(e))try{return(0,JSON.parse)(e),me.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ke.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(me.isResponse(e)||me.isReadableStream(e))return e;if(e&&me.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ce.from(e,Ce.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Be.classes.FormData,Blob:Be.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};me.forEach(["delete","get","head","post","put","patch"],(e=>{Ke.headers[e]={}}));const ze=Ke,Je=me.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"]),We=Symbol("internals");function Ve(e){return e&&String(e).trim().toLowerCase()}function Ge(e){return!1===e||null==e?e:me.isArray(e)?e.map(Ge):String(e)}function Qe(e,t,n,r,i){return me.isFunction(r)?r.call(this,t,n):(i&&(t=n),me.isString(t)?me.isString(r)?-1!==t.indexOf(r):me.isRegExp(r)?r.test(t):void 0:void 0)}class $e{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Ve(t);if(!i)throw new Error("header name must be a non-empty string");const o=me.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=Ge(e))}const o=(e,t)=>me.forEach(e,((e,n)=>i(e,n,t)));if(me.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(me.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]&&Je[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(me.isHeaders(e))for(const[t,r]of e.entries())i(r,t,n);else null!=e&&i(t,e,n);return this}get(e,t){if(e=Ve(e)){const n=me.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(me.isFunction(t))return t.call(this,e,n);if(me.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ve(e)){const n=me.findKey(this,e);return!(!n||void 0===this[n]||t&&!Qe(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Ve(e)){const i=me.findKey(n,e);!i||t&&!Qe(0,n[i],i,t)||(delete n[i],r=!0)}}return me.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&&!Qe(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return me.forEach(this,((r,i)=>{const o=me.findKey(n,i);if(o)return t[o]=Ge(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]=Ge(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return me.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&me.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")}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[We]=this[We]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ve(e);t[r]||(function(e,t){const n=me.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return me.isArray(e)?e.forEach(r):r(e),this}}$e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),me.reduceDescriptors($e.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),me.freezeMethods($e);const Xe=$e;function Ye(e,t){const n=this||ze,r=t||n,i=Xe.from(r.headers);let o=r.data;return me.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Ze(e){return!(!e||!e.__CANCEL__)}function et(e,t,n){Ce.call(this,null==e?"canceled":e,Ce.ERR_CANCELED,t,n),this.name="CanceledError"}me.inherits(et,Ce,{__CANCEL__:!0});const tt=et;function nt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ce("Request failed with status code "+n.status,[Ce.ERR_BAD_REQUEST,Ce.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const rt=(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,p=0;for(;l!==o;)p+=n[l++],l%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),u-i<t)return;const h=c&&u-c;return h?Math.round(1e3*p/h):void 0}}(50,250);return function(e,t){let n,r,i=0,o=1e3/t;const a=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-i;s>=o?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),o-s)))},()=>n&&a(n)]}((n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,u=i(s);r=o,e({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&o<=a?(a-o)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},it=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ot=e=>(...t)=>me.asap((()=>e(...t))),at=Be.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Be.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Be.origin),Be.navigator&&/(msie|trident)/i.test(Be.navigator.userAgent)):()=>!0,st=Be.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const a=[e+"="+encodeURIComponent(t)];me.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),me.isString(r)&&a.push("path="+r),me.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ut(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ct=e=>e instanceof Xe?{...e}:e;function lt(e,t){t=t||{};const n={};function r(e,t,n,r){return me.isPlainObject(e)&&me.isPlainObject(t)?me.merge.call({caseless:r},e,t):me.isPlainObject(t)?me.merge({},t):me.isArray(t)?t.slice():t}function i(e,t,n,i){return me.isUndefined(t)?me.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!me.isUndefined(t))return r(void 0,t)}function a(e,t){return me.isUndefined(t)?me.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 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,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(ct(e),ct(t),0,!0)};return me.forEach(Object.keys(Object.assign({},e,t)),(function(r){const o=u[r]||i,a=o(e[r],t[r],r);me.isUndefined(a)&&o!==s||(n[r]=a)})),n}const pt=e=>{const t=lt({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:u}=t;if(t.headers=s=Xe.from(s),t.url=je(ut(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&s.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),me.isFormData(r))if(Be.hasStandardBrowserEnv||Be.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(Be.hasStandardBrowserEnv&&(i&&me.isFunction(i)&&(i=i(t)),i||!1!==i&&at(t.url))){const e=o&&a&&st.read(a);e&&s.set(o,e)}return t},ht="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=pt(e);let i=r.data;const o=Xe.from(r.headers).normalize();let a,s,u,c,l,{responseType:p,onUploadProgress:h,onDownloadProgress:f}=r;function d(){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=Xe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());nt((function(e){t(e),d()}),(function(e){n(e),d()}),{data:p&&"text"!==p&&"json"!==p?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&&0===y.responseURL.indexOf("file:"))&&setTimeout(v)},y.onabort=function(){y&&(n(new Ce("Request aborted",Ce.ECONNABORTED,e,y)),y=null)},y.onerror=function(){n(new Ce("Network Error",Ce.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||_e;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ce(t,i.clarifyTimeoutError?Ce.ETIMEDOUT:Ce.ECONNABORTED,e,y)),y=null},void 0===i&&o.setContentType(null),"setRequestHeader"in y&&me.forEach(o.toJSON(),(function(e,t){y.setRequestHeader(t,e)})),me.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),p&&"json"!==p&&(y.responseType=r.responseType),f&&([u,l]=rt(f,!0),y.addEventListener("progress",u)),h&&y.upload&&([s,c]=rt(h),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new tt(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===Be.protocols.indexOf(m)?n(new Ce("Unsupported protocol "+m+":",Ce.ERR_BAD_REQUEST,e)):y.send(i||null)}))},ft=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ce?t:new tt(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new Ce(`timeout ${t} of 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)));const{signal:s}=r;return s.unsubscribe=()=>me.asap(a),s}},dt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},yt=(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*dt(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})},vt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,mt=vt&&"function"==typeof ReadableStream,gt=vt&&("function"==typeof TextEncoder?(bt=new TextEncoder,e=>bt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var bt;const wt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ct=mt&&wt((()=>{let e=!1;const t=new Request(Be.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),kt=mt&&wt((()=>me.isReadableStream(new Response("").body))),St={stream:kt&&(e=>e.body)};var Rt;vt&&(Rt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!St[e]&&(St[e]=me.isFunction(Rt[e])?t=>t[e]():(t,n)=>{throw new Ce(`Response type '${e}' is not supported`,Ce.ERR_NOT_SUPPORT,n)})})));const Ot={http:null,xhr:ht,fetch:vt&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:u,responseType:c,headers:l,withCredentials:p="same-origin",fetchOptions:h}=pt(e);c=c?(c+"").toLowerCase():"text";let f,d=ft([i,o&&o.toAbortSignal()],a);const y=d&&d.unsubscribe&&(()=>{d.unsubscribe()});let v;try{if(u&&Ct&&"get"!==n&&"head"!==n&&0!==(v=await(async(e,t)=>{const n=me.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(me.isBlob(e))return e.size;if(me.isSpecCompliantForm(e)){const t=new Request(Be.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return me.isArrayBufferView(e)||me.isArrayBuffer(e)?e.byteLength:(me.isURLSearchParams(e)&&(e+=""),me.isString(e)?(await gt(e)).byteLength:void 0)})(t):n})(l,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(me.isFormData(r)&&(e=n.headers.get("content-type"))&&l.setContentType(e),n.body){const[e,t]=it(v,rt(ot(u)));r=yt(n.body,65536,e,t)}}me.isString(p)||(p=p?"include":"omit");const i="credentials"in Request.prototype;f=new Request(t,{...h,signal:d,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:i?p:void 0});let o=await fetch(f);const a=kt&&("stream"===c||"response"===c);if(kt&&(s||a&&y)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=o[t]}));const t=me.toFiniteNumber(o.headers.get("content-length")),[n,r]=s&&it(t,rt(ot(s),!0))||[];o=new Response(yt(o.body,65536,n,(()=>{r&&r(),y&&y()})),e)}c=c||"text";let m=await St[me.findKey(St,c)||"text"](o,e);return!a&&y&&y(),await new Promise(((t,n)=>{nt(t,n,{data:m,headers:Xe.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:f})}))}catch(t){if(y&&y(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Ce("Network Error",Ce.ERR_NETWORK,e,f),{cause:t.cause||t});throw Ce.from(t,t&&t.code,e,f)}})};me.forEach(Ot,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Pt=e=>`- ${e}`,Et=e=>me.isFunction(e)||null===e||!1===e,xt=e=>{e=me.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){let t;if(n=e[o],r=n,!Et(n)&&(r=Ot[(t=String(n)).toLowerCase()],void 0===r))throw new Ce(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+o]=r}if(!r){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Pt).join("\n"):" "+Pt(e[0]):"as no adapter specified";throw new Ce("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function At(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tt(null,e)}function Tt(e){return At(e),e.headers=Xe.from(e.headers),e.data=Ye.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xt(e.adapter||ze.adapter)(e).then((function(t){return At(e),t.data=Ye.call(e,e.transformResponse,t),t.headers=Xe.from(t.headers),t}),(function(t){return Ze(t)||(At(e),t&&t.response&&(t.response.data=Ye.call(e,e.transformResponse,t.response),t.response.headers=Xe.from(t.response.headers))),Promise.reject(t)}))}const Nt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Nt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const jt={};Nt.transitional=function(e,t,n){function r(e,t){return"[Axios v1.8.4] 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&&!jt[i]&&(jt[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)}},Nt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Ut={assertOptions:function(e,t,n){if("object"!=typeof 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=t[o];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:Nt},_t=Ut.validators;class It{constructor(e){this.defaults=e,this.interceptors={request:new Ue,response:new Ue}}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=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=lt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Ut.assertOptions(n,{silentJSONParsing:_t.transitional(_t.boolean),forcedJSONParsing:_t.transitional(_t.boolean),clarifyTimeoutError:_t.transitional(_t.boolean)},!1),null!=r&&(me.isFunction(r)?t.paramsSerializer={serialize:r}:Ut.assertOptions(r,{encode:_t.function,serialize:_t.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ut.assertOptions(t,{baseUrl:_t.spelling("baseURL"),withXsrfToken:_t.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&me.merge(i.common,i[t.method]);i&&me.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Xe.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,p=0;if(!s){const e=[Tt.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,u),l=e.length,c=Promise.resolve(t);p<l;)c=c.then(e[p++],e[p++]);return c}l=a.length;let h=t;for(p=0;p<l;){const e=a[p++],t=a[p++];try{h=e(h)}catch(e){t.call(this,e);break}}try{c=Tt.call(this,h)}catch(e){return Promise.reject(e)}for(p=0,l=u.length;p<l;)c=c.then(u[p++],u[p++]);return c}getUri(e){return je(ut((e=lt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}me.forEach(["delete","get","head","options"],(function(e){It.prototype[e]=function(t,n){return this.request(lt(n||{},{method:e,url:t,data:(n||{}).data}))}})),me.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(lt(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}It.prototype[e]=t(),It.prototype[e+"Form"]=t(!0)}));const Lt=It;class qt{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 tt(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 qt((function(t){e=t})),cancel:e}}}const Dt=qt,Ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ft).forEach((([e,t])=>{Ft[t]=e}));const Ht=Ft,Bt=function e(t){const n=new Lt(t),r=T(Lt.prototype.request,n);return me.extend(r,Lt.prototype,n,{allOwnKeys:!0}),me.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(lt(t,n))},r}(ze);Bt.Axios=Lt,Bt.CanceledError=tt,Bt.CancelToken=Dt,Bt.isCancel=Ze,Bt.VERSION="1.8.4",Bt.toFormData=Pe,Bt.AxiosError=Ce,Bt.Cancel=Bt.CanceledError,Bt.all=function(e){return Promise.all(e)},Bt.spread=function(e){return function(t){return e.apply(null,t)}},Bt.isAxiosError=function(e){return me.isObject(e)&&!0===e.isAxiosError},Bt.mergeConfig=lt,Bt.AxiosHeaders=Xe,Bt.formToJSON=e=>Me(me.isHTMLForm(e)?new FormData(e):e),Bt.getAdapter=xt,Bt.HttpStatusCode=Ht,Bt.default=Bt;const Mt=Bt;var Kt=n(939),zt=n(82);function Jt(e,t,n){return t=f(t),h(e,Wt()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wt=function(){return!!e})()}var Vt=function(e){function t(){return i(this,t),Jt(this,t,arguments)}return y(t,e),u(t)}(w);function Gt(e,t,n){return t=f(t),h(e,Qt()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qt=function(){return!!e})()}var $t=function(e){function t(){return i(this,t),Gt(this,t,arguments)}return y(t,e),u(t)}(w);function Xt(e,t,n){return t=f(t),h(e,Yt()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yt=function(){return!!e})()}var Zt=function(e){function t(){return i(this,t),Xt(this,t,arguments)}return y(t,e),u(t)}(w);function en(e,t,n){return t=f(t),h(e,tn()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function tn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tn=function(){return!!e})()}var nn=function(e){function t(){return i(this,t),en(this,t,arguments)}return y(t,e),u(t)}(w);function rn(e,t,n){return t=f(t),h(e,on()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function on(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(on=function(){return!!e})()}var an=function(e){function t(){return i(this,t),rn(this,t,arguments)}return y(t,e),u(t)}(w);function sn(e,t,n){return t=f(t),h(e,un()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function un(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(un=function(){return!!e})()}var cn=function(e){function t(){return i(this,t),sn(this,t,arguments)}return y(t,e),u(t)}(w);function ln(e,t,n){return t=f(t),h(e,pn()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pn=function(){return!!e})()}var hn=function(e){function t(){return i(this,t),ln(this,t,arguments)}return y(t,e),u(t)}(w),fn={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"};function dn(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 yn(e){return Object.keys(fn).filter((function(t){return void 0!==e[t]})).every((function(t){return n=e[t],!Array.isArray(n);var n}))}function vn(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);if(!Object.keys(fn).filter((function(e){return Array.isArray(t[e])})).map((function(e){return t[e]=t[e].join(","),e})).length&&yn(t))return t;if(!yn(t))throw new Error("Failed to normalize arrayable params: ".concat(JSON.stringify(t)));return t}function mn(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 gn(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 bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gn(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wn=!0,Cn="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node&&"undefined"==typeof window,kn=function(){function e(t){i(this,e),this.configuration=t,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}var t,n,r,a,s,c,l,p,h;return u(e,[{key:"get",value:(h=E(A().mark((function e(t){var n,r,i,o,a,s,u,c,l,p=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>1&&void 0!==p[1]?p[1]:{},i=(r=p.length>2&&void 0!==p[2]?p[2]:{}).abortSignal,o=void 0===i?null:i,a=r.responseType,s=void 0===a?void 0:a,u=r.streamConfig,c=void 0===u?void 0:u,l=r.isStreamingRequest,e.abrupt("return",this.performRequest("get",t,{queryParameters:n,abortSignal:o,responseType:s,streamConfig:c,isStreamingRequest:l}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"delete",value:(p=E(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",this.performRequest("delete",t,{queryParameters:n,isStreamingRequest:!1}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"post",value:(l=E(A().mark((function e(t){var n,r,i,o,a,s,u,c,l,p,h,f=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>1&&void 0!==f[1]?f[1]:{},r=f.length>2&&void 0!==f[2]?f[2]:{},i=f.length>3&&void 0!==f[3]?f[3]:{},a=(o=f.length>4&&void 0!==f[4]?f[4]:{}).abortSignal,s=void 0===a?null:a,u=o.responseType,c=void 0===u?void 0:u,l=o.streamConfig,p=void 0===l?void 0:l,h=o.isStreamingRequest,e.abrupt("return",this.performRequest("post",t,{queryParameters:r,bodyParameters:n,additionalHeaders:i,abortSignal:s,responseType:c,streamConfig:p,isStreamingRequest:h}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"put",value:(c=E(A().mark((function e(t){var n,r,i=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},r=i.length>2&&void 0!==i[2]?i[2]:{},e.abrupt("return",this.performRequest("put",t,{queryParameters:r,bodyParameters:n,isStreamingRequest:!1}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"patch",value:(s=E(A().mark((function e(t){var n,r,i=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},r=i.length>2&&void 0!==i[2]?i[2]:{},e.abrupt("return",this.performRequest("patch",t,{queryParameters:r,bodyParameters:n,isStreamingRequest:!1}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"getAdapter",value:function(){if(this.configuration.axiosAdapter)return"function"==typeof this.configuration.axiosAdapter?this.configuration.axiosAdapter:"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent?Mt.getAdapter(this.configuration.axiosAdapter).bind(globalThis):Mt.getAdapter(this.configuration.axiosAdapter)}},{key:"performRequest",value:(a=E(A().mark((function e(t,n,r){var i,a,s,u,c,l,p,h,f,d,y,v,m,g,b,w,C,k,S,R,O,P,E,x=this;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=r.queryParameters,a=void 0===i?null:i,s=r.bodyParameters,u=void 0===s?null:s,c=r.additionalHeaders,l=void 0===c?{}:c,p=r.abortSignal,h=void 0===p?null:p,f=r.responseType,d=void 0===f?void 0:f,y=r.skipConnectionTimeout,v=void 0!==y&&y,m=r.enableKeepAlive,g=void 0===m?void 0:m,b=r.streamConfig,w=void 0===b?void 0:b,C=r.isStreamingRequest,this.configuration.validate(),C&&(this.logger.debug("Request: Performing streaming request to ".concat(n)),Cn||"undefined"==typeof fetch||(this.logger.debug("Using fetch adapter for browser streaming"),d="stream")),k=Date.now(),R=!1,this.logger.debug("Request #".concat(k,": Performing ").concat(t.toUpperCase()," request: ").concat(n)),O=A().mark((function e(){var r,i,s,c,p,f,y,m,b,O;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=x.getNextNode(k),x.logger.debug("Request #".concat(k,": Attempting ").concat(t.toUpperCase()," request Try #").concat(E," to Node ").concat(r.index)),!h||!h.aborted){e.next=4;break}return e.abrupt("return",{v:Promise.reject(new Error("Request aborted by caller."))});case 4:return e.prev=4,(s={method:t,url:x.uriFor(n,r),headers:Object.assign({},x.defaultHeaders(),l,x.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=C&&!Cn?"fetch":x.getAdapter(),!0!==v&&(s.timeout=1e3*x.connectionTimeoutSeconds),a&&0!==Object.keys(a).length&&(s.params=a),x.sendApiKeyAsQueryParam&&(s.params=s.params||{},s.params["x-typesense-api-key"]=x.apiKey),x.configuration.httpAgent?(x.logger.debug("Request #".concat(k,": Using custom httpAgent")),s.httpAgent=x.configuration.httpAgent):!0===g&&(Cn?(x.logger.debug("Request #".concat(k,": Enabling KeepAlive")),s.httpAgent=new Kt.Agent({keepAlive:!0})):x.logger.warn("Request #".concat(k,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),x.configuration.httpsAgent?(x.logger.debug("Request #".concat(k,": Using custom httpsAgent")),s.httpsAgent=x.configuration.httpsAgent):!0===g&&(Cn?(x.logger.debug("Request #".concat(k,": Enabling keepAlive")),s.httpsAgent=new zt.Agent({keepAlive:!0})):x.logger.warn("Request #".concat(k,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),x.configuration.paramsSerializer&&(x.logger.debug("Request #".concat(k,": Using custom paramsSerializer")),s.paramsSerializer=x.configuration.paramsSerializer),u&&("string"==typeof u&&0!==u.length||"object"===o(u)&&0!==Object.keys(u).length)&&(s.data=u),h&&(c=Mt.CancelToken,p=c.source(),i=function(){R=!0,p.cancel()},h.addEventListener("abort",i),s.cancelToken=p.token),C?(s.responseType="stream",Cn||(s.headers=bn(bn({},s.headers),{},{Accept:"text/event-stream"}))):d&&(s.responseType=d),e.next=18,Mt(s);case 18:if((f=e.sent).status>=1&&f.status<=499&&x.setNodeHealthcheck(r,wn),x.logger.debug("Request #".concat(k,": Request to Node ").concat(r.index," was made. Response Code was ").concat(f.status,".")),!(f.status>=200&&f.status<300)){e.next=27;break}if(!C){e.next=24;break}return e.abrupt("return",{v:x.handleStreamingResponse(f,w)});case 24:return e.abrupt("return",{v:Promise.resolve(f.data)});case 27:if(!(f.status<500)){e.next=31;break}return e.abrupt("return",{v:Promise.reject(x.customErrorForResponse(f,null===(y=f.data)||void 0===y?void 0:y.message,s.data))});case 31:throw x.customErrorForResponse(f,null===(m=f.data)||void 0===m?void 0:m.message,s.data);case 32:e.next=50;break;case 34:if(e.prev=34,e.t0=e.catch(4),R||x.setNodeHealthcheck(r,!1),S=e.t0,x.logger.warn("Request #".concat(k,": Request to Node ").concat(r.index,' failed due to "').concat(null!==(b=null===e.t0||void 0===e.t0?void 0:e.t0.code)&&void 0!==b?b:""," ").concat(e.t0.message).concat(null==e.t0.response?"":" - "+JSON.stringify(null===(O=e.t0.response)||void 0===O?void 0:O.data),'"')),!R){e.next=41;break}return e.abrupt("return",{v:Promise.reject(new Error("Request aborted by caller."))});case 41:if(C&&x.invokeOnErrorCallback(e.t0,w),!(E<x.numRetriesPerRequest+1)){e.next=46;break}x.logger.warn("Request #".concat(k,": Sleeping for ").concat(x.retryIntervalSeconds,"s and then retrying request...")),e.next=48;break;case 46:return x.logger.debug("Request #".concat(k,": No retries left. Raising last error")),e.abrupt("return",{v:Promise.reject(S)});case 48:return e.next=50,x.timer(x.retryIntervalSeconds);case 50:return e.prev=50,h&&i&&h.removeEventListener("abort",i),e.finish(50);case 53:case"end":return e.stop()}}),e,null,[[4,34,50,53]])})),E=1;case 8:if(!(E<=this.numRetriesPerRequest+1)){e.next=16;break}return e.delegateYield(O(),"t0",10);case 10:if(!(P=e.t0)){e.next=13;break}return e.abrupt("return",P.v);case 13:E++,e.next=8;break;case 16:return this.logger.debug("Request #".concat(k,": No retries left. Raising last error")),e.abrupt("return",Promise.reject(S));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return a.apply(this,arguments)})},{key:"processStreamingLine",value: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"===o(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()}}},{key:"processDataLine",value:function(e){if(!e)return null;if(e.startsWith("{"))try{var t=JSON.parse(e);return t&&"object"===o(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}}},{key:"handleStreamingResponse",value:(r=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.debug("Handling streaming response. Environment: ".concat(Cn?"Node.js":"Browser")),!Cn||!t.data){e.next=3;break}return e.abrupt("return",this.handleNodeStreaming(t,n));case 3:if(Cn){e.next=5;break}return e.abrupt("return",this.handleBrowserStreaming(t,n));case 5:return this.logger.debug("Processing non-streaming response"),this.invokeOnCompleteCallback(t.data,n),e.abrupt("return",Promise.resolve(t.data));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"handleNodeStreaming",value: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){try{var r,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)}))}))}},{key:"handleBrowserStreaming",value:function(e,t){var n=this;return this.logger.debug("Processing browser stream"),new Promise(function(){var r=E(A().mark((function r(i,a){return A().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!e.data||"function"!=typeof e.data.getReader){r.next=3;break}return r.abrupt("return",n.handleBrowserReadableStream(e.data,i,a,e,t));case 3:if("string"!=typeof e.data){r.next=5;break}return r.abrupt("return",n.handleBrowserStringResponse(e.data,i,e,t));case 5:if("object"!==o(e.data)||null===e.data){r.next=9;break}return n.logger.debug("No stream found, but data object is available"),n.invokeOnCompleteCallback(e.data,t),r.abrupt("return",i(e.data));case 9:return n.logger.error("No usable data found in response"),r.abrupt("return",a(new Error("No usable data found in response")));case 13:r.prev=13,r.t0=r.catch(0),n.logger.error("Error processing streaming response: ".concat(r.t0)),n.invokeOnErrorCallback(r.t0,t),a(r.t0);case 18:case"end":return r.stop()}}),r,null,[[0,13]])})));return function(e,t){return r.apply(this,arguments)}}())}},{key:"handleBrowserReadableStream",value:(n=E(A().mark((function e(t,n,r,i,o){var a,s,u,c,l,p,h,f,d;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("Found ReadableStream in response.data"),a=t.getReader(),s=[],u="",e.prev=4;case 5:return e.next=8,a.read();case 8:if(c=e.sent,l=c.done,p=c.value,!l){e.next=15;break}return this.logger.debug("Stream reading complete"),u.trim()&&(h=u.split("\n"),this.processStreamLines(h,s,o)),e.abrupt("break",23);case 15:f=(new TextDecoder).decode(p),this.logger.debug("Received chunk: ".concat(f.length," bytes")),d=(u+=f).split("\n"),u=d.pop()||"",this.processStreamLines(d,s,o),e.next=5;break;case 23:this.finalizeStreamResult(s,n,i,o),e.next=31;break;case 26:e.prev=26,e.t0=e.catch(4),this.logger.error("Stream error: ".concat(e.t0)),this.invokeOnErrorCallback(e.t0,o),r(e.t0);case 31:case"end":return e.stop()}}),e,this,[[4,26]])}))),function(e,t,r,i,o){return n.apply(this,arguments)})},{key:"handleBrowserStringResponse",value: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)}},{key:"processStreamLines",value:function(e,t,n){var r,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mn(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)?mn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.trim()&&"data: [DONE]"!==o){var a=this.processStreamingLine(o);null!==a&&(this.invokeOnChunkCallback(a,n),t.push(a))}}}catch(e){i.e(e)}finally{i.f()}}},{key:"finalizeStreamResult",value: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)}},{key:"combineStreamingChunks",value: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}},{key:"getMessageChunks",value:function(e){return e.filter(this.isChunkMessage)}},{key:"isChunkMessage",value:function(e){return"object"===o(e)&&null!==e&&"message"in e&&"conversation_id"in e}},{key:"combineMessageChunks",value: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}},{key:"isCompleteSearchResponse",value:function(e){return"object"===o(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)}},{key:"getNextNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(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}},{key:"nodeDueForHealthcheck",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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}},{key:"initializeMetadataForNodes",value:function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,wn)),this.nodes.forEach((function(t,n){t.index=n,e.setNodeHealthcheck(t,wn)}))}},{key:"setNodeHealthcheck",value:function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()}},{key:"uriFor",value: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)}},{key:"defaultHeaders",value:function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e}},{key:"timer",value:(t=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return setTimeout(e,1e3*t)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"customErrorForResponse",value: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 w(r,n,e.status),400===e.status?new Vt(r,n,e.status):401===e.status?new $t(r,n,e.status):404===e.status?new Zt(r,n,e.status):409===e.status?new nn(r,n,e.status):422===e.status?new an(r,n,e.status):e.status>=500&&e.status<=599?new cn(r,n,e.status):new hn(r,n,e.status)}},{key:"invokeOnChunkCallback",value:function(e,t){if(null!=t&&t.onChunk)try{t.onChunk(e)}catch(e){this.logger.warn("Error in onChunk callback: ".concat(e))}}},{key:"invokeOnCompleteCallback",value:function(e,t){if(null!=t&&t.onComplete)try{t.onComplete(e)}catch(e){this.logger.warn("Error in onComplete callback: ".concat(e))}}},{key:"invokeOnErrorCallback",value:function(e,t){if(null!=t&&t.onError){var n=function(e){if("object"===o(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))}}(e);try{t.onError(n)}catch(e){this.logger.warn("Error in onError callback: ".concat(e))}}}}]),e}(),Sn="/collections",Rn=function(){function e(t){i(this,e),this.apiCall=t}var t,n;return u(e,[{key:"create",value:(n=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.post(Sn,t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.get(Sn,t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"RESOURCEPATH",get:function(){return Sn}}]),e}();function On(e,t,n){return t=f(t),h(e,Pn()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pn=function(){return!!e})()}var En=function(e){function t(e,n,r){var o;return i(this,t),(o=On(this,t,[e])).importResults=n,o.payload=r,o}return y(t,e),u(t)}(w);function xn(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}var An=function(){function e(){i(this,e),c(this,"responseCache",new Map),c(this,"responsePromiseCache",new Map)}var t;return u(e,[{key:"clearCache",value:function(){this.responseCache=new Map,this.responsePromiseCache=new Map}},{key:"perform",value:(t=E(A().mark((function e(t,n,r,i){var o,a,s,u,c,l,p,h,f,d,y,v,m,g,b,w,C,k,S,R,O,P;return A().wrap((function(e){for(;;)switch(e.prev=e.next){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,p=r.path,h=r.queryParams,f=r.body,d=r.headers,y=r.streamConfig,v=r.abortSignal,m=r.responseType,g=r.isStreamingRequest,!l){e.next=5;break}return e.abrupt("return",this.executeRequest(t,n,p,h,f,d,{abortSignal:v,responseType:m,streamConfig:y,isStreamingRequest:g}));case 5:if(b=JSON.stringify(r),w=this.responseCache.get(b),C=Date.now(),!w){e.next=17;break}if(!(C-w.requestTimestamp<1e3*s)){e.next=16;break}return this.responseCache.delete(b),this.responseCache.set(b,w),e.abrupt("return",w.response);case 16:this.responseCache.delete(b);case 17:if(!(k=this.responsePromiseCache.get(b))){e.next=27;break}if(!(C-k.requestTimestamp<1e3*s)){e.next=26;break}return this.responsePromiseCache.delete(b),this.responsePromiseCache.set(b,k),e.abrupt("return",k.responsePromise);case 26:this.responsePromiseCache.delete(b);case 27:return S=this.executeRequest(t,n,p,h,f,d,{abortSignal:v,responseType:m,streamConfig:y,isStreamingRequest:g}),this.responsePromiseCache.set(b,{requestTimestamp:C,responsePromise:S}),e.next=31,S;case 31:return R=e.sent,this.responseCache.set(b,{requestTimestamp:C,response:R}),this.responseCache.size>c&&(O=this.responseCache.keys().next().value)&&this.responseCache.delete(O),this.responsePromiseCache.size>c&&(P=this.responsePromiseCache.keys().next().value)&&this.responsePromiseCache.delete(P),e.abrupt("return",R);case 38:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"executeRequest",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,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}(),Tn=["streamConfig"];function Nn(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 jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Un="/documents",_n=function(){function e(t,n,r){i(this,e),c(this,"requestWithCache",new An),this.collectionName=t,this.apiCall=n,this.configuration=r}var t;return u(e,[{key:"clearCache",value:function(){this.requestWithCache.clearCache()}},{key:"search",value:(t=E(A().mark((function e(t){var n,r,i,o,a,s,u,c,l,p,h,f=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=f.length>1&&void 0!==f[1]?f[1]:{}).cacheSearchResultsForSeconds,i=void 0===r?this.configuration.cacheSearchResultsForSeconds:r,o=n.abortSignal,a=void 0===o?null:o,s={},!0===this.configuration.useServerSideSearchCache&&(s.use_cache=!0),u=vn(t),c=u.streamConfig,l=xn(u,Tn),p=jn(jn({},s),l),h=!0===p.conversation_stream,e.abrupt("return",this.requestWithCache.perform(this.apiCall,"get",{path:this.endpointPath("search"),queryParams:p,streamConfig:c,abortSignal:a,isStreamingRequest:h},{cacheResponseForSeconds:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(Rn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(Un).concat(void 0===e?"":"/"+e)}}],[{key:"RESOURCEPATH",get:function(){return Un}}]),e}();function In(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 Ln(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?In(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):In(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qn(e,t,n){return t=f(t),h(e,Dn()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Dn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dn=function(){return!!e})()}var Fn="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,Hn=function(e){function t(e,n,r){return i(this,t),qn(this,t,[e,n,r])}var n,r,o,a,s,c,l,p,h;return y(t,e),u(t,[{key:"create",value:(h=E(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},t){e.next=3;break}throw new Error("No document provided");case 3:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"upsert",value:(p=E(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},t){e.next=3;break}throw new Error("No document provided");case 3:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t,Object.assign({},n,{action:"upsert"})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"update",value:(l=E(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},t){e.next=3;break}throw new Error("No document provided");case 3:if(null==n.filter_by){e.next=7;break}return e.abrupt("return",this.apiCall.patch(this.endpointPath(),t,Object.assign({},n)));case 7:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t,Object.assign({},n,{action:"update"})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"delete",value:(c=E(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.delete(this.endpointPath(),t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"createMany",value:(s=E(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},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"),e.abrupt("return",this.import(t,n));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"import",value:(a=E(A().mark((function e(t){var n,r,i,o,a,s=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Ln({throwOnFail:!0},s.length>1&&void 0!==s[1]?s[1]:{}),!Array.isArray(t)){e.next=16;break}if(0!==t.length){e.next=5;break}throw new Vt("No documents provided");case 5:e.prev=5,r=t.map((function(e){return JSON.stringify(e)})).join("\n"),e.next=14;break;case 9:if(e.prev=9,e.t0=e.catch(5),!(e.t0 instanceof RangeError&&e.t0.message.includes("Too many properties to enumerate"))){e.next=13;break}throw new Error("".concat(e.t0,"\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 "));case 13:throw new Error(e.t0);case 14:e.next=19;break;case 16:if(null!=(u=r=t)&&""!==u&&0!==u.length){e.next=19;break}throw new Vt("No documents provided");case 19:return e.next=21,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:r,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!Fn});case 21:if(i=e.sent,!Array.isArray(t)){e.next=32;break}if(o=i.split("\n").map((function(e){return JSON.parse(e)})),!((a=o.filter((function(e){return!1===e.success}))).length>0&&n.throwOnFail)){e.next=29;break}throw new En("".concat(o.length-a.length," documents imported successfully, ").concat(a.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),o,{documentsInJSONLFormat:r,options:n,failedItems:a,successCount:o.length-a.length});case 29:return e.abrupt("return",o);case 30:e.next=33;break;case 32:return e.abrupt("return",i);case 33:case"end":return e.stop()}var u}),e,this,[[5,9]])}))),function(e){return a.apply(this,arguments)})},{key:"importStream",value:(o=E(A().mark((function e(t){var n,r,i,o,a=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Ln({throwOnFail:!0},a.length>1&&void 0!==a[1]?a[1]:{}),e.next=4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:t,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!Fn});case 4:if(r=e.sent,i=r.split("\n").map((function(e){return JSON.parse(e)})),!((o=i.filter((function(e){return!1===e.success}))).length>0&&n.throwOnFail)){e.next=11;break}throw new En("".concat(i.length-o.length," documents imported successfully, ").concat(o.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),i,{documentsInJSONLFormat:t,options:n,failedItems:o,successCount:i.length-o.length});case 11:return e.abrupt("return",i);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"export",value:(r=E(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.get(this.endpointPath("export"),t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"exportStream",value:(n=E(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.get(this.endpointPath("export"),t,{responseType:"stream"}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}]),t}(_n),Bn=function(){function e(t,n){i(this,e),this.collectionName=t,this.apiCall=n}var t,n;return u(e,[{key:"upsert",value:(n=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(Rn.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/overrides"}}]),e}(),Mn=function(){function e(t,n,r){i(this,e),this.collectionName=t,this.overrideId=n,this.apiCall=r}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Rn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(Bn.RESOURCEPATH,"/").concat(encodeURIComponent(this.overrideId))}}]),e}(),Kn=function(){function e(t,n){i(this,e),this.collectionName=t,this.apiCall=n}var t,n;return u(e,[{key:"upsert",value:(n=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value: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(Rn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/synonyms"}}]),e}();c(Kn,"hasWarnedDeprecation",!1);var zn=function(){function e(t,n,r){i(this,e),this.collectionName=t,this.synonymId=n,this.apiCall=r}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value: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(Rn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(Kn.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymId))}}]),e}();c(zn,"hasWarnedDeprecation",!1);var Jn=function(){function e(t,n,r){i(this,e),this.collectionName=t,this.documentId=n,this.apiCall=r}var t,n,r;return u(e,[{key:"retrieve",value:(r=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"delete",value:(n=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"update",value:(t=E(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",this.apiCall.patch(this.endpointPath(),t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Rn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(Hn.RESOURCEPATH,"/").concat(encodeURIComponent(this.documentId))}}]),e}(),Wn=function(){function e(t,n,r){i(this,e),c(this,"individualDocuments",{}),c(this,"individualOverrides",{}),c(this,"individualSynonyms",{}),this.name=t,this.apiCall=n,this.configuration=r,this.name=t,this.apiCall=n,this.configuration=r,this._documents=new Hn(this.name,this.apiCall,this.configuration),this._overrides=new Bn(this.name,this.apiCall),this._synonyms=new Kn(this.name,this.apiCall)}var t,n,r,o;return u(e,[{key:"retrieve",value:(o=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"update",value:(r=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.patch(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"delete",value:(n=E(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.delete(this.endpointPath(),t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"exists",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.retrieve();case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),!(e.t0 instanceof Zt)){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return t.apply(this,arguments)})},{key:"documents",value:function(e){return e?(void 0===this.individualDocuments[e]&&(this.individualDocuments[e]=new Jn(this.name,e,this.apiCall)),this.individualDocuments[e]):this._documents}},{key:"overrides",value:function(e){return void 0===e?this._overrides:(void 0===this.individualOverrides[e]&&(this.individualOverrides[e]=new Mn(this.name,e,this.apiCall)),this.individualOverrides[e])}},{key:"synonyms",value:function(e){return void 0===e?this._synonyms:(void 0===this.individualSynonyms[e]&&(this.individualSynonyms[e]=new zn(this.name,e,this.apiCall)),this.individualSynonyms[e])}},{key:"endpointPath",value:function(){return"".concat(Rn.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))}}]),e}(),Vn="/aliases",Gn=function(){function e(t){i(this,e),this.apiCall=t}var t,n;return u(e,[{key:"upsert",value:(n=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(Vn));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return Vn}}]),e}(),Qn=function(){function e(t,n){i(this,e),this.name=t,this.apiCall=n}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Gn.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))}}]),e}(),$n=n(612),Xn="/keys",Yn=function(){function e(t){i(this,e),this.apiCall=t,this.apiCall=t}var t,n;return u(e,[{key:"create",value:(n=E(A().mark((function t(n){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.post(e.RESOURCEPATH,n));case 1:case"end":return t.stop()}}),t,this)}))),function(e){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(Xn));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"generateScopedSearchKey",value:function(e,t){var n=vn(t),r=JSON.stringify(n),i=Buffer.from((0,$n.createHmac)("sha256",e).update(r).digest("base64")),o=e.substr(0,4),a="".concat(i).concat(o).concat(r);return Buffer.from(a).toString("base64")}}],[{key:"RESOURCEPATH",get:function(){return Xn}}]),e}(),Zn=function(){function e(t,n){i(this,e),this.id=t,this.apiCall=n}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Yn.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))}}]),e}(),er=function(){function e(t){i(this,e),this.apiCall=t}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get("/debug"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),tr=function(){function e(t){i(this,e),this.apiCall=t}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get("/metrics.json"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),nr=function(){function e(t){i(this,e),this.apiCall=t}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get("/stats.json"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),rr=function(){function e(t){i(this,e),this.apiCall=t}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get("/health"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),ir=function(){function e(t){i(this,e),this.apiCall=t}var t;return u(e,[{key:"perform",value:(t=E(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",this.apiCall.post("".concat("/operations","/").concat(t),{},n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),or=["streamConfig"];function ar(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 sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ar(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ar(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ur=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i(this,e),this.apiCall=t,this.configuration=n,this.useTextContentType=r,this.requestWithCache=new An,this.logger=this.apiCall.logger}var t;return u(e,[{key:"clearCache",value:function(){this.requestWithCache.clearCache()}},{key:"perform",value:(t=E(A().mark((function e(t,n,r){var i,o,a,s,u;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n?sr({},n):{},!0===this.configuration.useServerSideSearchCache&&(i.use_cache=!0),!0===t.union&&this.hasAnySearchObjectPagination(t)&&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"),o={union:t.union,searches:t.searches.map(vn)},a=i.streamConfig,s=xn(i,or),u=vn(s),e.abrupt("return",this.requestWithCache.perform(this.apiCall,"post",{path:"/multi_search",body:o,queryParams:u,headers:this.useTextContentType?{"content-type":"text/plain"}:{},streamConfig:a,abortSignal:null==r?void 0:r.abortSignal,isStreamingRequest:this.isStreamingRequest(i)},void 0!==(null==r?void 0:r.cacheSearchResultsForSeconds)?{cacheResponseForSeconds:r.cacheSearchResultsForSeconds}:void 0));case 7:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"isStreamingRequest",value:function(e){return void 0!==e.streamConfig}},{key:"hasAnySearchObjectPagination",value: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}(),cr=function(){function e(t){i(this,e),this.apiCall=t}var t,n;return u(e,[{key:"upsert",value:(n=E(A().mark((function e(t,n){var r,i;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("object"!==o(n.value)||!("searches"in n.value)){e.next=3;break}return r=n.value.searches.map((function(e){return vn(e)})),e.abrupt("return",this.apiCall.put(this.endpointPath(t),{value:{searches:r}}));case 3:return i=vn(n.value),e.abrupt("return",this.apiCall.put(this.endpointPath(t),{value:i}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/presets"}}]),e}(),lr=function(){function e(t,n){i(this,e),this.presetId=t,this.apiCall=n}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(cr.RESOURCEPATH,"/").concat(encodeURIComponent(this.presetId))}}]),e}(),pr=function(){function e(t){i(this,e),this.apiCall=t,this.apiCall=t}var t,n;return u(e,[{key:"upsert",value:(n=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/analytics/rules"}}]),e}(),hr=function(){function e(t,n){i(this,e),this.name=t,this.apiCall=n}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(pr.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))}}]),e}(),fr=function(){function e(t){i(this,e),this.apiCall=t,this.apiCall=t}var t,n;return u(e,[{key:"create",value:(n=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/analytics/events"}}]),e}(),dr=function(){function e(t){i(this,e),c(this,"individualAnalyticsRules",{}),this.apiCall=t,this.apiCall=t,this._analyticsRules=new pr(this.apiCall),this._analyticsEvents=new fr(this.apiCall)}return u(e,[{key:"rules",value: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 hr(t,this.apiCall)),this.individualAnalyticsRules[t])}},{key:"events",value:function(){return this._analyticsEvents}}],[{key:"RESOURCEPATH",get:function(){return"/analytics"}}]),e}();c(dr,"hasWarnedDeprecation",!1);var yr=function(){function e(t){i(this,e),this.apiCall=t,this.apiCall=t}var t,n,r;return u(e,[{key:"create",value:(r=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t,{},{}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"upsert",value:(n=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(t){var n;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t&&(n.rule_tag=t),e.abrupt("return",this.apiCall.get(this.endpointPath(),n));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/analytics/rules"}}]),e}(),vr=function(){function e(t,n){i(this,e),this.name=t,this.apiCall=n}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(yr.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))}}]),e}(),mr=function(){function e(t){i(this,e),c(this,"individualAnalyticsRules",{}),this.apiCall=t,this.apiCall=t,this._analyticsRules=new yr(this.apiCall),this._analyticsEvents=new fr(this.apiCall)}return u(e,[{key:"rules",value:function(e){return void 0===e?this._analyticsRules:(void 0===this.individualAnalyticsRules[e]&&(this.individualAnalyticsRules[e]=new vr(e,this.apiCall)),this.individualAnalyticsRules[e])}},{key:"events",value:function(){return this._analyticsEvents}}],[{key:"RESOURCEPATH",get:function(){return"/analytics"}}]),e}(),gr=function(){function e(t){i(this,e),this.apiCall=t}var t,n;return u(e,[{key:"upsert",value:(n=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/stopwords"}}]),e}(),br=function(){function e(t,n){i(this,e),this.stopwordId=t,this.apiCall=n}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(gr.RESOURCEPATH,"/").concat(encodeURIComponent(this.stopwordId))}}]),e}(),wr=function(){function e(t){i(this,e),this.apiCall=t,this.apiCall=t}var t,n;return u(e,[{key:"create",value:(n=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/conversations/models"}}]),e}(),Cr=function(){function e(t,n){i(this,e),this.id=t,this.apiCall=n}var t,n,r;return u(e,[{key:"update",value:(r=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(wr.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))}}]),e}(),kr="/conversations",Sr=function(){function e(t){i(this,e),c(this,"individualConversationModels",{}),this.apiCall=t,this.apiCall=t,this._conversationsModels=new wr(this.apiCall)}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(kr));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"models",value:function(e){return void 0===e?this._conversationsModels:(void 0===this.individualConversationModels[e]&&(this.individualConversationModels[e]=new Cr(e,this.apiCall)),this.individualConversationModels[e])}}],[{key:"RESOURCEPATH",get:function(){return kr}}]),e}(),Rr=function(){function e(t,n){i(this,e),this.id=t,this.apiCall=n}var t,n,r;return u(e,[{key:"retrieve",value:(r=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"update",value:(n=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Sr.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))}}]),e}(),Or=function(){function e(t){i(this,e),this.apiCall=t,this.apiCall=t}var t,n;return u(e,[{key:"upsert",value:(n=E(A().mark((function e(t,n){var r,i;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Array.isArray(n)?n.map((function(e){return JSON.stringify(e)})).join("\n"):n,e.next=3,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:{id:t},bodyParameters:r,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0});case 3:return i=e.sent,e.abrupt("return",Array.isArray(n)?i.split("\n").map((function(e){return JSON.parse(e)})):i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return void 0===t?"".concat(e.RESOURCEPATH):"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/stemming/dictionaries"}}]),e}(),Pr=function(){function e(t,n){i(this,e),this.id=t,this.apiCall=n}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Or.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))}}]),e}(),Er=function(){function e(t){i(this,e),c(this,"individualStemmingDictionaries",{}),this.apiCall=t,this.apiCall=t,this._stemmingDictionaries=new Or(this.apiCall)}return u(e,[{key:"dictionaries",value:function(e){return void 0===e?this._stemmingDictionaries:(void 0===this.individualStemmingDictionaries[e]&&(this.individualStemmingDictionaries[e]=new Pr(e,this.apiCall)),this.individualStemmingDictionaries[e])}}],[{key:"RESOURCEPATH",get:function(){return"/stemming"}}]),e}(),xr=function(){function e(t){i(this,e),this.apiCall=t}var t,n;return u(e,[{key:"create",value:(n=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return e.RESOURCEPATH}}],[{key:"RESOURCEPATH",get:function(){return"/nl_search_models"}}]),e}(),Ar=function(){function e(t,n){i(this,e),this.id=t,this.apiCall=n}var t,n,r;return u(e,[{key:"retrieve",value:(r=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"update",value:(n=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(xr.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))}}]),e}(),Tr=function(){function e(t){i(this,e),this.apiCall=t}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(e.RESOURCEPATH));case 1:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]),e}();c(Tr,"RESOURCEPATH","/synonym_sets");var Nr=function(){function e(t,n){i(this,e),this.synonymSetName=t,this.apiCall=n}var t,n;return u(e,[{key:"upsert",value:(n=E(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(Tr.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))}}]),e}(),jr=function(){function e(t,n,r){i(this,e),this.synonymSetName=t,this.itemId=n,this.apiCall=r}var t,n;return u(e,[{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Tr.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items/").concat(encodeURIComponent(this.itemId))}}]),e}(),Ur=function(){function e(t,n){i(this,e),c(this,"individualItems",{}),this.synonymSetName=t,this.apiCall=n,this._items=new Nr(this.synonymSetName,n)}var t,n,r;return u(e,[{key:"upsert",value:(r=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"items",value:function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new jr(this.synonymSetName,e,this.apiCall)),this.individualItems[e])}},{key:"endpointPath",value:function(){return"".concat(Tr.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName))}}]),e}(),_r=function(){function e(t){i(this,e),this.apiCall=t}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(e.RESOURCEPATH));case 1:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]),e}();c(_r,"RESOURCEPATH","/curation_sets");var Ir=function(){function e(t,n){i(this,e),this.name=t,this.apiCall=n}var t;return u(e,[{key:"retrieve",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(_r.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))}}]),e}(),Lr=function(){function e(t,n,r){i(this,e),this.name=t,this.itemId=n,this.apiCall=r}var t,n,r;return u(e,[{key:"retrieve",value:(r=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"upsert",value:(n=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(_r.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items/").concat(encodeURIComponent(this.itemId))}}]),e}(),qr=function(){function e(t,n){i(this,e),c(this,"individualItems",{}),this.name=t,this.apiCall=n,this._items=new Ir(this.name,n)}var t,n,r;return u(e,[{key:"upsert",value:(r=E(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"retrieve",value:(n=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=E(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"items",value:function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new Lr(this.name,e,this.apiCall)),this.individualItems[e])}},{key:"endpointPath",value:function(){return"".concat(_r.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))}}]),e}(),Dr=function(){function e(t){var n;i(this,e),t.sendApiKeyAsQueryParam=null!==(n=t.sendApiKeyAsQueryParam)&&void 0!==n&&n,this.configuration=new O(t),this.apiCall=new kn(this.configuration),this.debug=new er(this.apiCall),this.metrics=new tr(this.apiCall),this.stats=new nr(this.apiCall),this.health=new rr(this.apiCall),this.operations=new ir(this.apiCall),this.multiSearch=new ur(this.apiCall,this.configuration),this._collections=new Rn(this.apiCall),this.individualCollections={},this._aliases=new Gn(this.apiCall),this.individualAliases={},this._keys=new Yn(this.apiCall),this.individualKeys={},this._presets=new cr(this.apiCall),this.individualPresets={},this._stopwords=new gr(this.apiCall),this.individualStopwords={},this.analytics=new mr(this.apiCall),this.analyticsV1=new dr(this.apiCall),this.stemming=new Er(this.apiCall),this._conversations=new Sr(this.apiCall),this.individualConversations={},this._nlSearchModels=new xr(this.apiCall),this.individualNLSearchModels={},this._synonymSets=new Tr(this.apiCall),this.individualSynonymSets={},this._curationSets=new _r(this.apiCall),this.individualCurationSets={}}return u(e,[{key:"collections",value:function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new Wn(e,this.apiCall,this.configuration)),this.individualCollections[e])}},{key:"aliases",value:function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new Qn(e,this.apiCall)),this.individualAliases[e])}},{key:"keys",value:function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new Zn(e,this.apiCall)),this.individualKeys[e])}},{key:"presets",value:function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new lr(e,this.apiCall)),this.individualPresets[e])}},{key:"stopwords",value:function(e){return void 0===e?this._stopwords:(void 0===this.individualStopwords[e]&&(this.individualStopwords[e]=new br(e,this.apiCall)),this.individualStopwords[e])}},{key:"conversations",value:function(e){return void 0===e?this._conversations:(void 0===this.individualConversations[e]&&(this.individualConversations[e]=new Rr(e,this.apiCall)),this.individualConversations[e])}},{key:"nlSearchModels",value:function(e){return void 0===e?this._nlSearchModels:(void 0===this.individualNLSearchModels[e]&&(this.individualNLSearchModels[e]=new Ar(e,this.apiCall)),this.individualNLSearchModels[e])}},{key:"synonymSets",value:function(e){return void 0===e?this._synonymSets:(void 0===this.individualSynonymSets[e]&&(this.individualSynonymSets[e]=new Ur(e,this.apiCall)),this.individualSynonymSets[e])}},{key:"curationSets",value:function(e){return void 0===e?this._curationSets:(void 0===this.individualCurationSets[e]&&(this.individualCurationSets[e]=new qr(e,this.apiCall)),this.individualCurationSets[e])}}]),e}();function Fr(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}var Hr=function(){function e(t,n,r){i(this,e),this.name=t,this.apiCall=n,this.configuration=r,this._documents=new _n(this.name,this.apiCall,this.configuration)}return u(e,[{key:"documents",value:function(){return this._documents}}]),e}(),Br=function(){function e(t){var n;i(this,e),t.sendApiKeyAsQueryParam=null===(n=t.sendApiKeyAsQueryParam)||void 0===n||n,!0===t.sendApiKeyAsQueryParam&&(t.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."),t.sendApiKeyAsQueryParam=!1),this.configuration=new O(t),this.apiCall=new kn(this.configuration),this.multiSearch=new ur(this.apiCall,this.configuration,!0),this.individualCollections={}}return u(e,[{key:"clearCache",value:function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(e){var t,n,r=(n=2,function(e){if(Array.isArray(e))return e}(t=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}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Fr(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)?Fr(e,t):void 0}}(t,n)||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.")}());r[0],r[1].documents().clearCache()}))}},{key:"collections",value:function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new Hr(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}();const Mr={Client:Dr,SearchClient:Br,Errors:t}})(),Typesense=r})();
//# sourceMappingURL=typesense.min.js.map