vendor: 33,295 bytes, line 1
1(self.webpackChunktsdoc_org=self.webpackChunktsdoc_org||[]).push([[2222],{25(e){function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function r(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,a,s,o,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(i(a=this._events[e]))return!1;if(n(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),a.apply(this,o)}else if(r(a))for(o=Array.prototype.slice.call(arguments,1),s=(u=a.slice()).length,c=0;c<s;c++)u[c].apply(this,o);return!0},t.prototype.addListener=function(e,a){var s;if(!n(a))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(a.listener)?a.listener:a),this._events[e]?r(this._events[e])?this._events[e].push(a):this._events[e]=[this._events[e],a]:this._events[e]=a,r(this._events[e])&&!this._events[e].warned&&(s=i(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},t.prototype.removeListener=function(e,t){var i,a,s,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(i=this._events[e]).length,a=-1,i===t||n(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(r(i)){for(o=s;o-- >0;)if(i[o]===t||i[o].listener&&i[o].listener===t){a=o;break}if(a<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},3244(e,t,n){"use strict";var r=n(8250),i=n(8296),a=n(1302),s=n(9986),o=n(7908);function c(e,t,n,i){return new r(e,t,n,i)}c.version=n(2261),c.AlgoliaSearchHelper=r,c.SearchParameters=s,c.RecommendParameters=i,c.SearchResults=o,c.RecommendResults=a,e.exports=c},2587(e,t,n){"use strict";var r=n(25);function i(e,t,n){this.main=e,this.fn=t,this.recommendFn=n,this.lastResults=null,this.lastRecommendResults=null}n(2771)(i,r),i.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},i.prototype.getModifiedState=function(e){return this.fn(e)},i.prototype.getModifiedRecommendState=function(e){return this.recommendFn(e)},e.exports=i},8296(e){"use strict";function t(e){e=e||{},this.params=e.params||[]}t.prototype={constructor:t,addParams:function(e){var n=this.params.slice();return n.push(e),new t({params:n})},removeParams:function(e){return new t({params:this.params.filter(function(t){return t.$$id!==e})})},addFrequentlyBoughtTogether:function(e){return this.addParams(Object.assign({},e,{model:"bought-together"}))},addRelatedProducts:function(e){return this.addParams(Object.assign({},e,{model:"related-products"}))},addTrendingItems:function(e){return this.addParams(Object.assign({},e,{model:"trending-items"}))},addTrendingFacets:function(e){return this.addParams(Object.assign({},e,{model:"trending-facets"}))},addLookingSimilar:function(e){return this.addParams(Object.assign({},e,{model:"looking-similar"}))},_buildQueries:function(e,t){return this.params.filter(function(e){return void 0===t[e.$$id]}).map(function(t){var n=Object.assign({},t,{indexName:e,threshold:t.threshold||0});return delete n.$$id,n})}},e.exports=t},1302(e){"use strict";function t(e,t){this._state=e,this._rawResults={};var n=this;e.params.forEach(function(e){var r=e.$$id;n[r]=t[r],n._rawResults[r]=t[r]})}t.prototype={constructor:t},e.exports=t},4777(e,t,n){"use strict";var r=n(5623),i=n(586),a=n(5306),s={addRefinement:function(e,t,n){if(s.isRefined(e,t,n))return e;var i=""+n,a=e[t]?e[t].concat(i):[i],o={};return o[t]=a,r(o,e)},removeRefinement:function(e,t,n){if(void 0===n)return s.clearRefinement(e,function(e,n){return t===n});var r=""+n;return s.clearRefinement(e,function(e,n){return t===n&&r===e})},toggleRefinement:function(e,t,n){if(void 0===n)throw new Error("toggleRefinement should be used with a value");return s.isRefined(e,t,n)?s.removeRefinement(e,t,n):s.addRefinement(e,t,n)},clearRefinement:function(e,t,n){if(void 0===t)return i(e)?{}:e;if("string"==typeof t)return a(e,[t]);if("function"==typeof t){var r=!1,s=Object.keys(e).reduce(function(i,a){var s=e[a]||[],o=s.filter(function(e){return!t(e,a,n)});return o.length!==s.length&&(r=!0),i[a]=o,i},{});return r?s:e}},isRefined:function(e,t,n){var r=Boolean(e[t])&&e[t].length>0;if(void 0===n||!r)return r;var i=""+n;return-1!==e[t].indexOf(i)}};e.exports=s},9986(e,t,n){"use strict";var r=n(5623),i=n(7404),a=n(7042),s=n(5023),o=n(586),c=n(5306),u=n(4912),l=n(5321),h=n(4777);function d(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(function(e,n){return d(t[n],e)}):e===t}function f(e){var t=e?f._parseNumbers(e):{};void 0===t.userToken||l(t.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var n=this;Object.keys(t).forEach(function(e){var r=-1!==f.PARAMETERS.indexOf(e),i=void 0!==t[e];!r&&i&&(n[e]=t[e])})}f.PARAMETERS=Object.keys(new f),f._parseNumbers=function(e){if(e instanceof f)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach(function(n){var r=e[n];if("string"==typeof r){var i=parseFloat(r);t[n]=isNaN(i)?r:i}}),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map(function(e){return Array.isArray(e)?e.map(function(e){return parseFloat(e)}):e})),e.numericRefinements){var n={};Object.keys(e.numericRefinements).forEach(function(t){var r=e.numericRefinements[t]||{};n[t]={},Object.keys(r).forEach(function(e){var i=r[e].map(function(e){return Array.isArray(e)?e.map(function(e){return"string"==typeof e?parseFloat(e):e}):"string"==typeof e?parseFloat(e):e});n[t][e]=i})}),t.numericRefinements=n}return s(e,t)},f.make=function(e){var t=new f(e);return(e.hierarchicalFacets||[]).forEach(function(e){if(e.rootPath){var n=t.getHierarchicalRefinement(e.name);n.length>0&&0!==n[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(n=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}}),t},f.validate=function(e,t){var n=t||{};return e.tagFilters&&n.tagRefinements&&n.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&n.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&n.numericRefinements&&o(n.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):o(e.numericRefinements)&&n.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},f.prototype={constructor:f,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:h.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:h.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:h.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:h.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,n){var r=u(n);if(this.isNumericRefined(e,t,r))return this;var i=s({},this.numericRefinements);return i[e]=s({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(r)):i[e][t]=[r],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,n){var r=n;return void 0!==r?this.isNumericRefined(e,t,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(n,i){return i===e&&n.op===t&&d(n.val,u(r))})}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(n,r){return r===e&&n.op===t})}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(t,n){return n===e})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return o(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return c(this.numericRefinements,[e]);if("function"==typeof e){var t=!1,n=this.numericRefinements,r=Object.keys(n).reduce(function(r,i){var a=n[i],s={};return a=a||{},Object.keys(a).forEach(function(n){var r=a[n]||[],o=[];r.forEach(function(t){e({val:t,op:n},i,"numeric")||o.push(t)}),o.length!==r.length&&(t=!0),s[n]=o}),r[i]=s,r},{});return t?r:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:h.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:h.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return h.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:h.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter(function(t){return t!==e})}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(t){return t!==e})}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(t){return t.name!==e})}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:h.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:h.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return h.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:h.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter(function(t){return t!==e})};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:h.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:h.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:h.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),i={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n))?-1===t.indexOf(n)?i[e]=[]:i[e]=[t.slice(0,t.lastIndexOf(n))]:i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:r(i,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var n={};return n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:r(n,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:r(t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&h.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&h.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&h.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var n=this.getHierarchicalRefinement(e);return t?-1!==n.indexOf(t):n.length>0},isNumericRefined:function(e,t,n){if(void 0===n&&void 0===t)return Boolean(this.numericRefinements[e]);var r=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===n||!r)return r;var a,s,o=u(n),c=void 0!==(a=this.numericRefinements[e][t],s=o,i(a,function(e){return d(e,s)}));return r&&c},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter(function(t){return Object.keys(e.numericRefinements[t]).length>0}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(t){return e.disjunctiveFacetsRefinements[t].length>0}).concat(t).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map(function(e){return e.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(t){return e.hierarchicalFacetsRefinements[t].length>0})).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(t){return-1===e.indexOf(t)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},n=this;return Object.keys(this).forEach(function(r){var i=n[r];-1===e.indexOf(r)&&void 0!==i&&(t[r]=i)}),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var n={};return n[e]=t,this.setQueryParameters(n)},setQueryParameters:function(e){if(!e)return this;var t=f.validate(this,e);if(t)throw t;var n=this,r=f._parseNumbers(e),i=Object.keys(this).reduce(function(e,t){return e[t]=n[t],e},{}),a=Object.keys(r).reduce(function(e,t){var n=void 0!==e[t],i=void 0!==r[t];return n&&!i?c(e,[t]):(i&&(e[t]=r[t]),e)},i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return i(this.hierarchicalFacets,function(t){return t.name===e})},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(n).map(function(e){return e.trim()})},toString:function(){return JSON.stringify(this,null,2)}},e.exports=f},4544(e,t,n){"use strict";e.exports=function(e){return function(t,n){var r=e.hierarchicalFacets[n],u=e.hierarchicalFacetsRefinements[r.name]&&e.hierarchicalFacetsRefinements[r.name][0]||"",l=e._getHierarchicalFacetSeparator(r),h=e._getHierarchicalRootPath(r),d=e._getHierarchicalShowParentLevel(r),f=a(e._getHierarchicalFacetSortBy(r)),p=t.every(function(e){return e.exhaustive}),m=function(e,t,n,r,a){return function(u,l,h){var d=u;if(h>0){var f=0;for(d=u;f<h;){var p=d&&Array.isArray(d.data)?d.data:[];d=i(p,function(e){return e.isRefined}),f++}}if(d){var m=Object.keys(l.data).map(function(e){return[e,l.data[e]]}).filter(function(e){return function(e,t,n,r,i,a){if(i&&(0!==e.indexOf(i)||i===e))return!1;return!i&&-1===e.indexOf(r)||i&&e.split(r).length-i.split(r).length===1||-1===e.indexOf(r)&&-1===n.indexOf(r)||0===n.indexOf(e)||0===e.indexOf(t+r)&&(a||0===e.indexOf(n))}(e[0],d.path||n,a,t,n,r)});d.data=s(m.map(function(e){var n=e[0];return function(e,t,n,r,i){var a=t.split(n);return{name:a[a.length-1].trim(),path:t,escapedValue:o(t),count:e,isRefined:r===t||0===r.indexOf(t+n),exhaustive:i,data:null}}(e[1],n,t,c(a),l.exhaustive)}),e[0],e[1])}return u}}(f,l,h,d,u),v=t;return h&&(v=t.slice(h.split(l).length)),v.reduce(m,{name:e.hierarchicalFacets[n].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:p,data:null})}};var r=n(8116),i=n(7404),a=n(1212),s=n(1253),o=r.escapeFacetValue,c=r.unescapeFacetValue},7908(e,t,n){"use strict";var r=n(8754),i=n(5623),a=n(8116),s=n(7404),o=n(7414),c=n(1212),u=n(9296),l=n(1253),h=a.escapeFacetValue,d=a.unescapeFacetValue,f=n(4544);function p(e){var t={};return e.forEach(function(e,n){t[e]=n}),t}function m(e,t,n){t&&t[n]&&(e.stats=t[n])}function v(e,t,n){var a=t[0]||{};this._rawResults=t;var c=this;Object.keys(a).forEach(function(e){c[e]=a[e]});var l=i(n,{persistHierarchicalRootCount:!1});Object.keys(l).forEach(function(e){c[e]=l[e]}),this.processingTimeMS=t.reduce(function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map(function(){return[]}),this.facets=[];var h=e.getRefinedDisjunctiveFacets(),v=p(e.facets),g=p(e.disjunctiveFacets),y=1,_=a.facets||{};Object.keys(_).forEach(function(t){var n,r,i=_[t],u=(n=e.hierarchicalFacets,r=t,s(n,function(e){return(e.attributes||[]).indexOf(r)>-1}));if(u){var l=u.attributes.indexOf(t),h=o(e.hierarchicalFacets,function(e){return e.name===u.name});c.hierarchicalFacets[h][l]={attribute:t,data:i,exhaustive:a.exhaustiveFacetsCount}}else{var d,f=-1!==e.disjunctiveFacets.indexOf(t),p=-1!==e.facets.indexOf(t);f&&(d=g[t],c.disjunctiveFacets[d]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},m(c.disjunctiveFacets[d],a.facets_stats,t)),p&&(d=v[t],c.facets[d]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},m(c.facets[d],a.facets_stats,t))}}),this.hierarchicalFacets=r(this.hierarchicalFacets),h.forEach(function(n){var r=t[y],s=r&&r.facets?r.facets:{},l=e.getHierarchicalFacetByName(n);Object.keys(s).forEach(function(t){var n,h=s[t];if(l){n=o(e.hierarchicalFacets,function(e){return e.name===l.name});var f=o(c.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1===f)return;c.hierarchicalFacets[n][f].data=c.persistHierarchicalRootCount?u(c.hierarchicalFacets[n][f].data,h):i(h,c.hierarchicalFacets[n][f].data)}else{n=g[t];var p=a.facets&&a.facets[t]||{};c.disjunctiveFacets[n]={name:t,data:u(p,h),exhaustive:r.exhaustiveFacetsCount},m(c.disjunctiveFacets[n],r.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach(function(r){!c.disjunctiveFacets[n].data[r]&&e.disjunctiveFacetsRefinements[t].indexOf(d(r))>-1&&(c.disjunctiveFacets[n].data[r]=0)})}}),y++}),e.getRefinedHierarchicalFacets().forEach(function(n){var r=e.getHierarchicalFacetByName(n),a=e._getHierarchicalFacetSeparator(r),s=e.getHierarchicalRefinement(n);0===s.length||s[0].split(a).length<2||t.slice(y).forEach(function(t){var n=t&&t.facets?t.facets:{};Object.keys(n).forEach(function(t){var u=n[t],l=o(e.hierarchicalFacets,function(e){return e.name===r.name}),h=o(c.hierarchicalFacets[l],function(e){return e.attribute===t});if(-1!==h){var d={};if(s.length>0&&!c.persistHierarchicalRootCount){var f=s[0].split(a)[0];d[f]=c.hierarchicalFacets[l][h].data[f]}c.hierarchicalFacets[l][h].data=i(d,u,c.hierarchicalFacets[l][h].data)}}),y++})}),Object.keys(e.facetsExcludes).forEach(function(t){var n=e.facetsExcludes[t],r=v[t];c.facets[r]={name:t,data:_[t],exhaustive:a.exhaustiveFacetsCount},n.forEach(function(e){c.facets[r]=c.facets[r]||{name:t},c.facets[r].data=c.facets[r].data||{},c.facets[r].data[e]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(f(e)),this.facets=r(this.facets),this.disjunctiveFacets=r(this.disjunctiveFacets),this._state=e}function g(e,t){function n(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var r=s(e.facets,n);return r?Object.keys(r.data).map(function(n){var i=h(n);return{name:n,escapedValue:i,count:r.data[n],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,n)}}):[]}if(e._state.isDisjunctiveFacet(t)){var i=s(e.disjunctiveFacets,n);return i?Object.keys(i.data).map(function(n){var r=h(n);return{name:n,escapedValue:r,count:i.data[n],isRefined:e._state.isDisjunctiveFacetRefined(t,r)}}):[]}if(e._state.isHierarchicalFacet(t)){var a=s(e.hierarchicalFacets,n);if(!a)return a;var o=e._state.getHierarchicalFacetByName(t),c=e._state._getHierarchicalFacetSeparator(o),u=d(e._state.getHierarchicalRefinement(t)[0]||"");0===u.indexOf(o.rootPath)&&(u=u.replace(o.rootPath+c,""));var l=u.split(c);return l.unshift(t),y(a,l,0),a}}function y(e,t,n){e.isRefined=e.name===(t[n]&&t[n].trim()),e.data&&e.data.forEach(function(e){y(e,t,n+1)})}function _(e,t,n,r){if(r=r||0,Array.isArray(t))return e(t,n[r]);if(!t.data||0===t.data.length)return t;var a=t.data.map(function(t){return _(e,t,n,r+1)}),s=e(a,n[r]);return i({data:s},t)}function R(e,t){var n=s(e,function(e){return e.name===t});return n&&n.stats}function b(e,t,n,r,i){var a=s(i,function(e){return e.name===n}),o=a&&a.data&&a.data[r]?a.data[r]:0,c=a&&a.exhaustive||!1;return{type:t,attributeName:n,name:r,count:o,exhaustive:c}}v.prototype.getFacetByName=function(e){function t(t){return t.name===e}return s(this.facets,t)||s(this.disjunctiveFacets,t)||s(this.hierarchicalFacets,t)},v.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],v.prototype.getFacetValues=function(e,t){var n=g(this,e);if(n){var r,a=i(t,{sortBy:v.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),s=this;if(Array.isArray(n))r=[e];else r=s._state.getHierarchicalFacetByName(n.name).attributes;return _(function(e,t){var n=function(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}(s,t);if(a.facetOrdering&&n)return function(e,t){var n=[],r=[],i=t.hide||[],a=(t.order||[]).reduce(function(e,t,n){return e[t]=n,e},{});e.forEach(function(e){var t=e.path||e.name,s=i.indexOf(t)>-1;s||void 0===a[t]?s||r.push(e):n[a[t]]=e}),n=n.filter(function(e){return e});var s,o=t.sortRemainingBy;return"hidden"===o?n:(s="alpha"===o?[["path","name"],["asc","asc"]]:[["count"],["desc"]],n.concat(l(r,s[0],s[1])))}(e,n);if(Array.isArray(a.sortBy)){var r=c(a.sortBy,v.DEFAULT_SORT),i=l(e,r[0],r[1]),o=n&&n.hide?n.hide:[];if(o.length>0){var u=[];return i.forEach(function(e){var t=e.path||e.name;-1===o.indexOf(t)&&u.push(e)}),u}return i}if("function"==typeof a.sortBy)return function(e,t){return t.sort(e)}(a.sortBy,e);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},n,r)}},v.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?R(this.facets,e):this._state.isDisjunctiveFacet(e)?R(this.disjunctiveFacets,e):void 0},v.prototype.getRefinements=function(){var e=this._state,t=this,n=[];return Object.keys(e.facetsRefinements).forEach(function(r){e.facetsRefinements[r].forEach(function(i){n.push(b(e,"facet",r,i,t.facets))})}),Object.keys(e.facetsExcludes).forEach(function(r){e.facetsExcludes[r].forEach(function(i){n.push(b(e,"exclude",r,i,t.facets))})}),Object.keys(e.disjunctiveFacetsRefinements).forEach(function(r){e.disjunctiveFacetsRefinements[r].forEach(function(i){n.push(b(e,"disjunctive",r,i,t.disjunctiveFacets))})}),Object.keys(e.hierarchicalFacetsRefinements).forEach(function(r){e.hierarchicalFacetsRefinements[r].forEach(function(i){n.push(function(e,t,n,r){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),o=n.split(a),c=s(r,function(e){return e.name===t}),u=o.reduce(function(e,t){var n=e&&s(e.data,function(e){return e.name===t});return void 0!==n?n:e},c),l=u&&u.count||0,h=u&&u.exhaustive||!1,d=u&&u.path||"";return{type:"hierarchical",attributeName:t,name:d,count:l,exhaustive:h}}(e,r,i,t.hierarchicalFacets))})}),Object.keys(e.numericRefinements).forEach(function(t){var r=e.numericRefinements[t];Object.keys(r).forEach(function(e){r[e].forEach(function(r){n.push({type:"numeric",attributeName:t,name:r,numericValue:r,operator:e})})})}),e.tagRefinements.forEach(function(e){n.push({type:"tag",attributeName:"_tags",name:e})}),n},e.exports=v},8250(e,t,n){"use strict";var r=n(25),i=n(2587),a=n(8116).escapeFacetValue,s=n(2771),o=n(5023),c=n(586),u=n(5306),l=n(8296),h=n(1302),d=n(1341),f=n(9986),p=n(7908),m=n(9841),v=n(2261);function g(e,t,n,r){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+v+")"),this.setClient(e);var i=n||{};i.index=t,this.state=f.make(i),this.recommendState=new l({params:i.recommendState}),this.lastResults=null,this.lastRecommendResults=null,this._queryId=0,this._recommendQueryId=0,this._lastQueryIdReceived=-1,this._lastRecommendQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0,this._currentNbRecommendQueries=0,this._searchResultsOptions=r,this._recommendCache={}}function y(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function _(){return this.state.page}s(g,r),g.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},g.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},g.prototype.searchWithComposition=function(){return this._runComposition({onlyWithDerivedHelpers:!0}),this},g.prototype.recommend=function(){return this._recommend(),this},g.prototype.getQuery=function(){var e=this.state;return d._getHitsSearchParams(e)},g.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,r=d._getQueries(n.index,n),i=this;
vendor: 7,518 bytes, line 1
1if(this._currentNbQueries++,this.emit("searchOnce",{state:n}),!t)return this.client.search(r).then(function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new p(n,e.results),state:n,_originalResponse:e}},function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e});this.client.search(r).then(function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new p(n,e.results),n)}).catch(function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,n)})},g.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,n=this.derivedHelpers[0];if(!n)return Promise.resolve([]);var r=n.getModifiedState(t),i=o({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:u(d._getHitsSearchParams(r),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var s=this.client.initIndex(r.index);if("function"!=typeof s.findAnswers)throw new Error(a);return s.findAnswers(r.query,e.queryLanguages,i)},g.prototype.searchForFacetValues=function(e,t,n,r){var i="function"==typeof this.client.searchForFacetValues&&"function"!=typeof this.client.searchForFacets,s="function"==typeof this.client.initIndex;if(!i&&!s&&"function"!=typeof this.client.search)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var o=this.state.setQueryParameters(r||{}),c=o.isDisjunctiveFacet(e),u=d.getSearchForFacetQuery(e,t,n,o);this._currentNbQueries++;var l,h=this;i?l=this.client.searchForFacetValues([{indexName:o.index,params:u}]):s?l=this.client.initIndex(o.index).searchForFacetValues(u):(delete u.facetName,l=this.client.search([{type:"facet",facet:e,indexName:o.index,params:u}]).then(function(e){return e.results[0]})),this.emit("searchForFacetValues",{state:o,facet:e,query:t});var f=this.lastResults&&this.lastResults.index===o.index&&this.lastResults.renderingContent&&this.lastResults.renderingContent.facetOrdering&&this.lastResults.renderingContent.facetOrdering.values&&this.lastResults.renderingContent.facetOrdering.values[e]&&this.lastResults.renderingContent.facetOrdering.values[e].hide||[];return l.then(function(t){return h._currentNbQueries--,0===h._currentNbQueries&&h.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits=t.facetHits.reduce(function(t,n){return f.indexOf(n.value)>-1||(n.escapedValue=a(n.value),n.isRefined=c?o.isDisjunctiveFacetRefined(e,n.escapedValue):o.isFacetRefined(e,n.escapedValue),t.push(n)),t},[]),t},function(e){throw h._currentNbQueries--,0===h._currentNbQueries&&h.emit("searchQueueEmpty"),e})},g.prototype.searchForCompositionFacetValues=function(e,t,n,r){if("function"!=typeof this.client.searchForFacetValues)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues");var i=this.state.setQueryParameters(r||{}),s=i.isDisjunctiveFacet(e);this._currentNbQueries++;var o,c=this;return o=this.client.searchForFacetValues({compositionID:i.index,facetName:e,searchForFacetValuesRequest:{params:{query:t,maxFacetHits:n,searchQuery:d._getCompositionHitsSearchParams(i)}}}),this.emit("searchForFacetValues",{state:i,facet:e,query:t}),o.then(function(t){return c._currentNbQueries--,0===c._currentNbQueries&&c.emit("searchQueueEmpty"),(t=t.results[0]).facetHits.forEach(function(t){t.escapedValue=a(t.value),t.isRefined=s?i.isDisjunctiveFacetRefined(e,t.escapedValue):i.isFacetRefined(e,t.escapedValue)}),t},function(e){throw c._currentNbQueries--,0===c._currentNbQueries&&c.emit("searchQueueEmpty"),e})},g.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},g.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},g.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},g.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},g.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},g.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},g.prototype.addNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,n),isPageReset:!0}),this},g.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},g.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},g.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},g.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},g.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},g.prototype.addFrequentlyBoughtTogether=function(e){return this._recommendChange({state:this.recommendState.addFrequentlyBoughtTogether(e)}),this},g.prototype.addRelatedProducts=function(e){return this._recommendChange({state:this.recommendState.addRelatedProducts(e)}),this},g.prototype.addTrendingItems=function(e){return this._recommendChange({state:this.recommendState.addTrendingItems(e)}),this},g.prototype.addTrendingFacets=function(e){return this._recommendChange({state:this.recommendState.addTrendingFacets(e)}),this},g.prototype.addLookingSimilar=function(e){return this._recommendChange({state:this.recommendState.addLookingSimilar(e)}),this},g.prototype.removeNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,n),isPageReset:!0}),this},g.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},g.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},g.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},g.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},g.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},g.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},g.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},g.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},g.prototype.removeFrequentlyBoughtTogether=function(e){return this._recommendChange({state:this.recommendState.removeParam
vendor: 8,392 bytes, line 1
1s(e)}),this},g.prototype.removeRelatedProducts=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},g.prototype.removeTrendingItems=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},g.prototype.removeTrendingFacets=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},g.prototype.removeLookingSimilar=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},g.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},g.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},g.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},g.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},g.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},g.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},g.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},g.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},g.prototype.setCurrentPage=y,g.prototype.setPage=y,g.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},g.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},g.prototype.setState=function(e){return this._change({state:f.make(e),isPageReset:!1}),this},g.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new f(e),this},g.prototype.hasRefinements=function(e){return!!c(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},g.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},g.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},g.prototype.hasTag=function(e){return this.state.isTagRefined(e)},g.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},g.prototype.getIndex=function(){return this.state.index},g.prototype.getCurrentPage=_,g.prototype.getPage=_,g.prototype.getTags=function(){return this.state.tagRefinements},g.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach(function(e){t.push({value:e,type:"conjunctive"})}),this.state.getExcludeRefinements(e).forEach(function(e){t.push({value:e,type:"exclude"})});else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach(function(e){t.push({value:e,type:"disjunctive"})})}var n=this.state.getNumericRefinements(e);return Object.keys(n).forEach(function(e){var r=n[e];t.push({value:r,operator:e,type:"numeric"})}),t},g.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},g.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},g.prototype._search=function(e){var t=this.state,n=[],r=[];e.onlyWithDerivedHelpers||(r=d._getQueries(t.index,t),n.push({state:t,queriesCount:r.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map(function(e){var r=e.getModifiedState(t),i=r.index?d._getQueries(r.index,r):[];return n.push({state:r,queriesCount:i.length,helper:e}),e.emit("search",{state:r,results:e.lastResults}),i}),a=Array.prototype.concat.apply(r,i),s=this._queryId++;if(this._currentNbQueries++,!a.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,n,s));try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,n,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(o){this.emit("error",{error:o})}},g.prototype._runComposition=function(){var e=this.state,t=[],n=this.derivedHelpers.map(function(n){var r=n.getModifiedState(e),i=d._getCompositionQueries(r);return t.push({state:r,queriesCount:i.length,helper:n}),n.emit("search",{state:r,results:n.lastResults}),i}),r=Array.prototype.concat.apply([],n),i=this._queryId++;if(this._currentNbQueries++,!r.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,t,i));if(r.length>1)throw new Error("Only one query is allowed when using a composition.");var a=r[0];try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,t,i)).catch(this._dispatchAlgoliaError.bind(this,i))}catch(s){this.emit("error",{error:s})}},g.prototype._recommend=function(){var e=this.state,t=this.recommendState,n=this.getIndex(),r=[{state:t,index:n,helper:this}],i=t.params.map(function(e){return e.$$id});this.emit("fetch",{recommend:{state:t,results:this.lastRecommendResults}});var a=this._recommendCache,s=this.derivedHelpers.map(function(t){var n=t.getModifiedState(e).index;if(!n)return[];var s=t.getModifiedRecommendState(new l);return r.push({state:s,index:n,helper:t}),i=Array.prototype.concat.apply(i,s.params.map(function(e){return e.$$id})),t.emit("fetch",{recommend:{state:s,results:t.lastRecommendResults}}),s._buildQueries(n,a)}),o=Array.prototype.concat.apply(this.recommendState._buildQueries(n,a),s);if(0!==o.length)if(o.length>0&&void 0===this.client.getRecommendations)console.warn("Please update algoliasearch/lite to the latest version in order to use recommend widgets.");else{var c=this._recommendQueryId++;this._currentNbRecommendQueries++;try{this.client.getRecommendations(o).then(this._dispatchRecommendResponse.bind(this,c,r,i)).catch(this._dispatchRecommendError.bind(this,c))}catch(u){this.emit("error",{error:u})}}},g.prototype._dispatchAlgoliaResponse=function(e,t,n){var r=this;if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty");var i=n.results.slice(),a=Object.keys(n).reduce(function(e,t){return"results"!==t&&(e[t]=n[t]),e},{});Object.keys(a).length<=0&&(a=void 0),e.forEach(function(e){var t=e.state,n=e.queriesCount,s=e.helper,o=i.splice(0,n);t.index?(s.lastResults=new p(t,o,r._searchResultsOptions),void 0!==a&&(s.lastResults._rawContent=a),s.emit("result",{results:s.lastResults,state:t})):s.emit("result",{results:null,state:t})})}},g.prototype._dispatchRecommendResponse=function(e,t,n,r){if(!(e<this._lastRecommendQueryIdReceived)){this._currentNbRecommendQueries-=e-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=e,0===this._currentNbRecommendQueries&&this.emit("recommendQueueEmpty");var i=this._recommendCache,a={};n.filter(function(e){return void 0===i[e]}).forEach(function(e,t){a[e]||(a[e]=[]),a[e].push(t)}),Object.keys(a).forEach(function(e){var t=a[e],s=r.results[t[0]];1!==t.length?i[e]=Object.assign({},s,{hits:m(n,t.map(function(e){return r.results[e].hits}))}):i[e]=s});var s={};n.forEach(function(e){s[e]=i[e]}),t.forEach(function(e){var t=e.state,n=e.helper;e.index?(n.lastRecommendResults=new h(t,s),n.emit("recommend:result",{recommend:{results:n.lastRecommendResults,state:t}})):n.emit("recommend:result",{results:null,state:t})})}},g.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},g.prototype._dispatchRecommendError=function(e,t){e<this._lastRecommendQueryIdReceived||(this._currentNbRecommendQueries-=e-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbRecommendQueries&&this.emit("recommendQueueEmpty"))},g.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},g.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0},g.prototype._change=function(e){var t=e.state,n=e.isPageReset;
1t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:n}))},g.prototype._recommendChange=function(e){var t=e.state;t!==this.recommendState&&(this.recommendState=t,this.emit("recommend:change",{search:{results:this.lastResults,state:this.state},recommend:{results:this.lastRecommendResults,state:this.recommendState}}))},g.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},g.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+v+")"),this.client=e),this},g.prototype.getClient=function(){return this.client},g.prototype.derive=function(e,t){var n=new i(this,e,t);return this.derivedHelpers.push(n),n},g.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},g.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=g},8754(e){"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},5623(e){"use strict";e.exports=function(){return Array.prototype.slice.call(arguments).reduceRight(function(e,t){return Object.keys(Object(t)).forEach(function(n){void 0!==t[n]&&(void 0!==e[n]&&delete e[n],e[n]=t[n])}),e},{})}},8116(e){"use strict";e.exports={escapeFacetValue:function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},unescapeFacetValue:function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")}}},7404(e){"use strict";e.exports=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}},7414(e){"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}},6200(e){e.exports=function(e){return e.reduce(function(e,t){return e.concat(t)},[])}},1212(e,t,n){"use strict";var r=n(7404);e.exports=function(e,t){var n=(t||[]).map(function(e){return e.split(":")});return e.reduce(function(e,t){var i=t.split(":"),a=r(n,function(e){return e[0]===i[0]});return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)},[[],[]])}},2771(e){"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},7042(e){"use strict";e.exports=function(e,t){return e.filter(function(n,r){return t.indexOf(n)>-1&&e.indexOf(n)===r})}},5023(e){"use strict";function t(e){return"object"==typeof e&&null!==e?r(Array.isArray(e)?[]:{},e):e}function n(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function r(e,i){if(e===i)return e;for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&"__proto__"!==a&&"constructor"!==a){var s=i[a],o=e[a];void 0!==o&&void 0===s||(n(o)&&n(s)?e[a]=r(o,s):e[a]=t(s))}return e}e.exports=function(e){n(e)||(e={});for(var t=1,i=arguments.length;t<i;t++){var a=arguments[t];n(a)&&r(e,a)}return e}},9296(e){"use strict";e.exports=function(){return Array.prototype.slice.call(arguments).reduceRight(function(e,t){return Object.keys(Object(t)).forEach(function(n){var r="number"==typeof e[n]?e[n]:0,i=t[n];void 0!==i&&i>=r&&(void 0!==e[n]&&delete e[n],e[n]=i)}),e},{})}},586(e){"use strict";e.exports=function(e){return e&&Object.keys(e).length>0}},5306(e){"use strict";e.exports=function(e,t){if(null===e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}},1253(e){"use strict";function t(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||r&&i||!n)return 1;if(!r&&e<t||a&&n||!i)return-1}return 0}e.exports=function(e,n,r){if(!Array.isArray(e))return[];Array.isArray(r)||(r=[]);var i=e.map(function(e,t){return{criteria:n.map(function(t){return e[t]}),index:t,value:e}});return i.sort(function(e,n){for(var i=-1;++i<e.criteria.length;){var a=t(e.criteria[i],n.criteria[i]);if(a)return i>=r.length?a:"desc"===r[i]?-a:a}return e.index-n.index}),i.map(function(e){return e.value})}},4912(e){"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}}
vendor: 2,955 bytes, line 1
1,1341(e,t,n){"use strict";var r=n(5023);function i(e){return Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{})}var a={_getQueries:function(e,t){var n=[];return n.push({indexName:e,params:a._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach(function(r){n.push({indexName:e,params:a._getDisjunctiveFacetSearchParams(t,r)})}),t.getRefinedHierarchicalFacets().forEach(function(r){var i=t.getHierarchicalFacetByName(r),s=t.getHierarchicalRefinement(r),o=t._getHierarchicalFacetSeparator(i);if(s.length>0&&s[0].split(o).length>1){var c=s[0].split(o).slice(0,-1).reduce(function(e,t,n){return e.concat({attribute:i.attributes[n],value:0===n?t:[e[e.length-1].value,t].join(o)})},[]);c.forEach(function(r,s){var o=a._getDisjunctiveFacetSearchParams(t,r.attribute,0===s);function u(e){return i.attributes.some(function(t){return t===e.split(":")[0]})}var l=(o.facetFilters||[]).reduce(function(e,t){if(Array.isArray(t)){var n=t.filter(function(e){return!u(e)});n.length>0&&e.push(n)}return"string"!=typeof t||u(t)||e.push(t),e},[]),h=c[s-1];s>0?o.facetFilters=l.concat(h.attribute+":"+h.value):l.length>0?o.facetFilters=l:delete o.facetFilters,n.push({indexName:e,params:o})})}}),n},_getCompositionQueries:function(e){return[{compositionID:e.index,requestBody:{params:a._getCompositionHitsSearchParams(e)}}]},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(a._getHitsHierarchicalFacetsAttributes(e)).sort(),n=a._getFacetFilters(e),s=a._getNumericFilters(e),o=a._getTagFilters(e),c={};return t.length>0&&(c.facets=t.indexOf("*")>-1?["*"]:t),o.length>0&&(c.tagFilters=o),n.length>0&&(c.facetFilters=n),s.length>0&&(c.numericFilters=s),i(r({},e.getQueryParams(),c))},_getCompositionHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets.map(function(t){return e.disjunctiveFacetsRefinements&&e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].length>0?"disjunctive("+t+")":t})).concat(a._getHitsHierarchicalFacetsAttributes(e)).sort(),n=a._getFacetFilters(e),s=a._getNumericFilters(e),o=a._getTagFilters(e),c={};t.length>0&&(c.facets=t.indexOf("*")>-1?["*"]:t),o.length>0&&(c.tagFilters=o),n.length>0&&(c.facetFilters=n),s.length>0&&(c.numericFilters=s);var u=e.getQueryParams();return delete u.highlightPreTag,delete u.highlightPostTag,delete u.index,i(r({},u,c))},_getDisjunctiveFacetSearchParams:function(e,t,n){var s=a._getFacetFilters(e,t,n),o=a._getNumericFilters(e,t),c=a._getTagFilters(e),u={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};c.length>0&&(u.tagFilters=c);var l=e.getHierarchicalFacetByName(t);return u.facets=l?a._getDisjunctiveHierarchicalFacetAttribute(e,l,n):t,o.length>0&&(u.numericFilters=o),s.length>0&&(u.facetFilters=s),i(r({},e.getQueryParams(),u))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var n=[];return Object.keys(e.numericRefinements).forEach(function(r){var i=e.numericRefinements[r]||{};
1Object.keys(i).forEach(function(e){var a=i[e]||[];t!==r&&a.forEach(function(t){if(Array.isArray(t)){var i=t.map(function(t){return r+e+t});n.push(i)}else n.push(r+e+t)})})}),n},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,n){var r=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach(function(e){(i[e]||[]).slice().sort().forEach(function(t){r.push(e+":"+t)})});var a=e.facetsExcludes||{};Object.keys(a).sort().forEach(function(e){(a[e]||[]).sort().forEach(function(t){r.push(e+":-"+t)})});var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).sort().forEach(function(e){var n=s[e]||[];if(e!==t&&n&&0!==n.length){var i=[];n.slice().sort().forEach(function(t){i.push(e+":"+t)}),r.push(i)}});var o=e.hierarchicalFacetsRefinements||{};return Object.keys(o).sort().forEach(function(i){var a=(o[i]||[])[0];if(void 0!==a){var s,c,u=e.getHierarchicalFacetByName(i),l=e._getHierarchicalFacetSeparator(u),h=e._getHierarchicalRootPath(u);if(t===i){if(-1===a.indexOf(l)||!h&&!0===n||h&&h.split(l).length===a.split(l).length)return;h?(c=h.split(l).length-1,a=h):(c=a.split(l).length-2,a=a.slice(0,a.lastIndexOf(l))),s=u.attributes[c]}else c=a.split(l).length-1,s=u.attributes[c];s&&r.push([s+":"+a])}}),r},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce(function(t,n){var r=e.getHierarchicalRefinement(n.name)[0];if(!r)return t.push(n.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(n),a=r.split(i).length,s=n.attributes.slice(0,a+1);return t.concat(s)},[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r=e._getHierarchicalFacetSeparator(t);if(!0===n){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(r).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(r).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,n,s){var o=s.isDisjunctiveFacet(e)?s.clearRefinements(e):s,c={facetQuery:t,facetName:e};return"number"==typeof n&&(c.maxFacetHits=n),i(r({},a._getHitsSearchParams(o),c))}};e.exports=a},5321(e){"use strict";e.exports=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)}},9841(e,t,n){"use strict";var r=n(7404),i=n(6200);e.exports=function(e,t){var n={};return t.forEach(function(t){t.forEach(function(t,r){e.includes(t.objectID)||(n[t.objectID]?n[t.objectID]={indexSum:n[t.objectID].indexSum+r,count:n[t.objectID].count+1}:n[t.objectID]={indexSum:r,count:1})})}),function(e,t){var n=[];return Object.keys(e).forEach(function(r){e[r].count<2&&(e[r].indexSum+=100),n.push({objectID:r,avgOfIndices:e[r].indexSum/t})}),n.sort(function(e,t){return e.avgOfIndices>t.avgOfIndices?1:-1})}(n,t.length).reduce(function(e,n){var a=r(i(t),function(e){return e.objectID===n.objectID});return a?e.concat(a):e},[])}},2261(e){"use strict";e.exports="3.27.1"},2222(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>M});var r=n(829),i=n(2663),a=n(3244),s=n.n(a),o=n(4627),c=n(6227),u=n(386),l=n(7865),h=["zero","one","two","few","many","other"];function d(e){return h.filter(function(t){return e.includes(t)})}var f={locale:"en",pluralForms:d(["one","other"]),select:function(e){return 1===e?"one":"other"}};function p(){var e=(0,l.default)().i18n.currentLocale;return(0,r.useMemo)(function(){try{return t=e,n=new Intl.PluralRules(t),{locale:t,pluralForms:d(n.resolvedOptions().pluralCategories),select:function(e){return n.select(e)}}}catch(r){return console.error('Failed to use Intl.PluralRules for locale "'+e+'".\nDocusaurus will fallback to the default (English) implementation.\nError: '+r.message+"\n"),f}var t,n},[e])}function m(){var e=p();return{selectMessage:function(t,n){return function(e,t,n){var r=e.split("|");if(1===r.length)return r[0];r.length>n.pluralForms.length&&console.error("For locale="+n.locale+", a maximum of "+n.pluralForms.length+" plural forms are expected ("+n.pluralForms.join(",")+"), but the message contains "+r.length+": "+e);var i=n.select(t),a=n.pluralForms.indexOf(i);return r[Math.min(a,r.length-1)]}(n,t,e)}}}var v=n(7105),g=n(834),y=n(6552),_=n(1862),R=n(9078),b=n(5024),P=n(3310),C=n(4305);const F="searchQueryInput_tDIH",w="searchVersionInput_lRzj",S="searchResultsColumn_RzHk",E="searchResultItem_uUaw",j="searchResultItemHeading_VJFv",O="searchResultItemPath_kh_V",x="searchResultItemSummary_ShlA",A="searchQueryColumn_Q8Mk",N="searchVersionColumn_mCGV",T="searchLogoColumn__5As",k="loadingSpinner_CIfr",H="loader_oaB9";var D=n(8790);function I(e){var t=e.docsSearchVersionsHelpers,n=Object.entries(t.allDocsData).filter(function(e){return e[1].versions.length>1});return r.createElement("div",{className:(0,i.A)("col","col--3","padding-left--none",N)},n.map(function(e){var i=e[0],a=e[1],s=n.length>1?i+": ":"";return r.createElement("select",{key:i,onChange:function(e){return t.setSearchVersion(i,e.target.value)},defaultValue:t.searchVersions[i],className:w},a.versions.map(function(e,t){return r.createElement("option",{key:t,label:""+s+e.label,value:e.name})}))}))}function q(){var e,t,n,a,h,d,f=(0,l.default)(),p=f.siteConfig.themeConfig,y=f.i18n.currentLocale,w=p.typesense,N=w.typesenseCollectionName,q=w.typesenseServerConfig,M=w.typesenseSearchParameters,Q=w.externalUrlRegex,U=(e=m().selectMessage,function(t){return e(t,(0,P.T)({id:"theme.SearchPage.documentsFound.plurals",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One document found|{count} documents found"},{count:t}))}),L=(t=(0,b.Gy)(),n=(0,r.useState)(function(){return Object.entries(t).reduce(function(e,t){var n,r=t[0],i=t[1];return Object.assign({},e,((n={})[r]=i.versions[0].name,n))},{})}),a=n[0],h=n[1],d=Object.values(t).some(function(e){return e.versions.length>1}),{allDocsData:t,versioningEnabled:d,searchVersions:a,setSearchVersion:function(e,t){return h(function(n){var r;return Object.assign({},n,((r={})[e]=t,r))})}}),B=(0,_.n)(),V=B.searchQuery,z=B.setSearchQuery,W={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},K=(0,r.useReducer)(function(e,t){switch(t.type){case"reset":return W;case"loading":return Object.assign({},e,{loading:!0});case"update":return V!==t.value.query?e:Object.assign({},t.value,{items:0===t.value.lastPage?t.value.items:e.items.concat(t.value.items)});case"advance":var n=e.totalPages>e.lastPage+1;return Object.assign({},e,{lastPage:n?e.lastPage+1:e.lastPage,hasMore:n});default:return e}},W),J=K[0],G=K[1],$=new D.A({server:q,additionalSearchParameters:Object.assign({query_by:"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content",include_fields:"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content,anchor,url,type,id",highlight_full_fields:"hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3,hierarchy.lvl4,hierarchy.lvl5,hierarchy.lvl6,content",group_by:"url",group_limit:3},M)}),X=s()($.searchClient,N,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["language","docusaurus_tag"]});X.on("result",function(e){var t=e.results,n=t.query,r=t.hits,i=t.page,a=t.nbHits,s=t.nbPages;if(""!==n&&Array.isArray(r)){var o=function(e){return e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match")},c=r.map(function(e){var t=e.url,n=e._highlightResult,r=e._snippetResult,i=void 0===r?{}:r,a=new URL(t),s=[0,1,2,3,4,5,6].map(function(e){var t=n["hierarchy.lvl"+e];return t?o(t.value):""}).filter(function(e){return e});return{title:s.pop(),url:(0,v.G)(Q,a.href)?a.href:a.pathname+a.hash,summary:i.
1content?o(i.content.value)+"...":"",breadcrumbs:s}});G({type:"update",value:{items:c,query:n,totalResults:a,totalPages:s,lastPage:i,hasMore:s>i+1,loading:!1}})}else G({type:"reset"})}),X.on("error",function(e){console.error(e)});var Z=(0,r.useState)(null),Y=Z[0],ee=Z[1],te=(0,r.useRef)(0),ne=(0,r.useRef)(u.A.canUseIntersectionObserver&&new IntersectionObserver(function(e){var t=e[0],n=t.isIntersecting,r=t.boundingClientRect.y;n&&te.current>r&&G({type:"advance"}),te.current=r},{threshold:1})),re=function(){return V?(0,P.T)({id:"theme.SearchPage.existingResultsTitle",message:'Search results for "{query}"',description:"The search page title for non-empty query"},{query:V}):(0,P.T)({id:"theme.SearchPage.emptyResultsTitle",message:"Search the documentation",description:"The search page title for empty query"})},ie=(0,g._q)(function(e){void 0===e&&(e=0),X.addDisjunctiveFacetRefinement("docusaurus_tag","default"),X.addDisjunctiveFacetRefinement("language",y),Object.entries(L.searchVersions).forEach(function(e){var t=e[0],n=e[1];X.addDisjunctiveFacetRefinement("docusaurus_tag","docs-"+t+"-"+n)}),X.setQuery(V).setPage(e).search()});return(0,r.useEffect)(function(){if(Y){var e=ne.current;return e?(e.observe(Y),function(){return e.unobserve(Y)}):function(){return!0}}},[Y]),(0,r.useEffect)(function(){G({type:"reset"}),V&&(G({type:"loading"}),setTimeout(function(){ie()},300))},[V,L.searchVersions,ie]),(0,r.useEffect)(function(){J.lastPage&&0!==J.lastPage&&ie(J.lastPage)},[ie,J.lastPage]),r.createElement(C.A,null,r.createElement(o.A,null,r.createElement("title",null,(0,R.s)(re())),r.createElement("meta",{property:"robots",content:"noindex, follow"})),r.createElement("div",{className:"container margin-vert--lg"},r.createElement("h1",null,re()),r.createElement("form",{className:"row",onSubmit:function(e){return e.preventDefault()}},r.createElement("div",{className:(0,i.A)("col",A,{"col--9":L.versioningEnabled,"col--12":!L.versioningEnabled})},r.createElement("input",{type:"search",name:"q",className:F,placeholder:(0,P.T)({id:"theme.SearchPage.inputPlaceholder",message:"Type your search here",description:"The placeholder for search page input"}),"aria-label":(0,P.T)({id:"theme.SearchPage.inputLabel",message:"Search",description:"The ARIA label for search page input"}),onChange:function(e){return z(e.target.value)},value:V,autoComplete:"off",autoFocus:!0})),L.versioningEnabled&&r.createElement(I,{docsSearchVersionsHelpers:L})),r.createElement("div",{className:"row"},r.createElement("div",{className:(0,i.A)("col","col--8",S)},!!J.totalResults&&U(J.totalResults)),r.createElement("div",{className:(0,i.A)("col","col--4","text--right",T)},r.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://typesense.org/?utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch","aria-label":(0,P.T)({id:"theme.SearchPage.typesenseLabel",message:"Search by Typesense",description:"The ARIA label for Typesense mention"})},r.createElement("svg",{fill:"none",height:"21",viewBox:"0 0 141 21",width:"141",xmlns:"http://www.w3.org/2000/svg"},r.createElement("clipPath",{id:"a"},r.createElement("path",{d:"m0 0h141v21h-141z"})),r.createElement("g",{clipPath:"url(#a)"},r.createElement("g",{fill:"#1035bc"},r.createElement("path",{d:"m62.0647 6.453c.0371.19.0557.37367.0557.551 0 .16467-.0186.342-.0557.532l-2.3561-.019v6.384c0 .532.2412.798.7235.798h1.41c.0866.2153.1299.4307.1299.646s-.0124.3483-.0371.399c-.569.076-1.1564.114-1.7625.114-1.1997 0-1.7995-.5257-1.7995-1.577v-6.764l-1.3172.019c-.0371-.19-.0557-.36733-.0557-.532 0-.17733.0186-.361.0557-.551l1.3172.019v-1.995c0-.342.0494-.58267.1484-.722.0989-.152.2906-.228.5751-.228h.5009l.1113.114v2.85z"}),r.createElement("path",{d:"m71.0419 6.548-2.5416 8.911c-.47 1.634-.9709 2.7867-1.5027 3.458s-1.3296 1.007-2.3932 1.007c-.5442 0-1.0452-.0823-1.5028-.247-.0371-.3547.0619-.6967.2969-1.026.3834.1393.7915.209 1.2244.209.6555 0 1.1564-.228 1.5027-.684s.6617-1.1653.9462-2.128l.0556-.19c-.3215-.0253-.5689-.1013-.742-.228-.1608-.1267-.2969-.361-.4082-.703l-2.5973-8.36c.3834-.16467.6555-.247.8163-.247.3587 0 .5999.22167.7235.665l1.4657 4.769c.0494.152.3339 1.14.8534 2.964.0247.0887.0865.133.1855.133l2.2633-8.398c.1608-.05067.3711-.076.6308-.076.2721 0 .5009.038.6864.114z"}),r.createElement("path",{d:"m74.6067 15.155v3.762c0 .342-.0495.5827-.1484.722-.0989.152-.2968.228-.5937.228h-.5009l-.1113-.114v-13.243l.1113-.114h.4824c.2968 0 .4947.08233.5936.247.1114.152.167.40533.167.76v.095c.7421-.84867 1.6264-1.273 2.653-1.273 1.0513 0 1.8428.437 2.3746 1.311.5319.86133.7978 2.05834.7978 3.591 0 .7473-.099 1.4187-.2968 2.014-.1856.5953-.4391 1.102-.7607 1.52-.3092.4053-.6679.722-1.076.95-.4082.2153-.8287.323-1.2616.323-.8534 0-1.6635-.2597-2.4303-.779zm0-6.175v4.883c.7545.57 1.4656.855 2.1335.855s1.2183-.304 1.6512-.912c.4328-.608.6493-1.5263.6493-2.755 0-.608-.0557-1.13366-.167-1.577-.0989-.456-.235-.82967-.4081-1.121-.1732-.304-.3773-.52567-.6123-.665-.2226-.152-.4638-.228-.7235-.228-.4947 0-.9647.133-1.41.399-.4452.266-.8163.63967-1.1131 1.121z"}),r.createElement("path",{d:"m89.8263 11.545h-5.7512c.0619 2.1533.8596 3.23 2.3932 3.23.8411 0 1.7378-.266 2.6901-.798.2721.2533.4391.5763.5009.969-1.0142.7093-2.152 1.064-3.4136 1.064-.6431 0-1.1935-.12
103-1.6511-.361-.4576-.2533-.8349-.5953-1.1317-1.026-.2845-.4433-.4947-.9627-.6308-1.558-.136-.5953-.204-1.2477-.204-1.957 0-.722.0803-1.38067.2411-1.976.1732-.59533.4205-1.10833.7421-1.539s.705-.76633 1.1503-1.007c.4576-.24067.977-.361 1.5583-.361.569 0 1.0761.10767 1.5213.323.4576.20267.8349.48767 1.1317.855.3092.35467.5442.78533.705 1.292.1608.494.2411 1.026.2411 1.596 0 .228-.0123.4497-.0371.665-.0123.2027-.0309.399-.0556.589zm-5.7512-1.083h4.4525v-.247c0-.874-.1793-1.577-.538-2.109s-.8967-.798-1.614-.798c-.705 0-1.2554.285-1.6512.855-.3834.57-.5998 1.33633-.6493 2.299z"}),r.createElement("path",{d:"m91.7359 15.117c.0123-.2787.0865-.5827.2226-.912.1484-.342.3154-.608.5009-.798.9771.5447 1.8367.817 2.5787.817.4082 0 .7359-.0823.9833-.247.2597-.1647.3896-.3863.3896-.665 0-.4433-.3339-.798-1.0018-1.064l-1.0389-.399c-1.5584-.5827-2.3376-1.5137-2.3376-2.793 0-.456.0804-.86133.2412-1.216.1731-.36733.4081-.67767.705-.931.3092-.266.674-.46867 1.0945-.608s.8905-.209 1.41-.209c.235 0 .4947.019.7792.057.2968.038.5937.095.8905.171.2968.06333.5813.13933.8534.228s.5071.18367.705.285c0 .31667-.0619.646-.1856.988-.1236.342-.2906.59533-.5009.76-.977-.44333-1.8243-.665-2.5416-.665-.3216 0-.5751.08233-.7606.247-.1856.152-.2783.35467-.2783.608 0 .39267.3092.703.9276.931l1.1317.418c.8163.2913 1.4223.6903 1.8181 1.197.3957.5067.5936 1.0957.5936 1.767 0 .8993-.3277 1.6213-.9832 2.166-.6555.532-1.5955.798-2.8199.798-1.1998 0-2.3253-.3103-3.3765-.931z"}),r.createElement("path",{d:"m107.996 11.868h-5.121c.037.6967.192 1.2477.464 1.653.284.3927.773.589 1.466.589.717 0 1.539-.2153 2.467-.646.359.38.587.8803.686 1.501-.989.722-2.176 1.083-3.562 1.083-1.311 0-2.306-.4117-2.987-1.235-.667-.836-1.001-2.071-1.001-3.705 0-.76.086-1.444.259-2.052.174-.62067.427-1.14633.761-1.577.334-.44333.742-.78533 1.224-1.026.483-.24067 1.033-.361 1.652-.361.63 0 1.187.10133 1.669.304.483.19.891.46867 1.225.836.334.35467.581.779.742 1.273.173.494.26 1.03233.26 1.615 0 .3167-.019.6207-.056.912-.037.2787-.087.5573-.148.836zm-3.581-3.99c-.965 0-1.484.74733-1.558 2.242h3.079v-.228c0-.608-.123-1.09567-.371-1.463-.247-.36733-.631-.551-1.15-.551z"}),r.createElement("path",{d:"m118.163 9.436v4.142c0 .8107.13 1.4123.39 1.805-.396.3547-.872.532-1.429.532-.532 0-.897-.1203-1.095-.361-.197-.2533-.296-.646-.296-1.178v-4.427c0-.57-.068-.969-.204-1.197-.137-.228-.39-.342-.761-.342-.656 0-1.268.304-1.837.912v6.46c-.185.038-.383.0633-.593.076-.198.0127-.402.019-.613.019-.21 0-.42-.0063-.63-.019-.198-.0127-.39-.038-.576-.076v-9.405l.112-.133h.927c.693 0 1.126.38 1.299 1.14.903-.798 1.8-1.197 2.69-1.197.891 0 1.546.29767 1.9
167.893.433.58267.649 1.368.649 2.356z"}),r.createElement("path",{d:"m120.109 15.117c.012-.2787.087-.5827.223-.912.148-.342.315-.608.501-.798.977.5447 1.836.817 2.578.817.408 0 .736-.0823.984-.247.259-.1647.389-.3863.389-.665 0-.4433-.334-.798-1.002-1.064l-1.039-.399c-1.558-.5827-2.337-1.5137-2.337-2.793 0-.456.08-.86133.241-1.216.173-.36733.408-.67767.705-.931.309-.266.674-.46867 1.095-.608.42-.13933.89-.209 1.41-.209.235 0 .494.019.779.057.297.038.593.095.89.171.297.06333.582.13933.854.228s.507.18367.705.285c0 .31667-.062.646-.186.988s-.291.59533-.501.76c-.977-.44333-1.824-.665-2.541-.665-.322 0-.576.08233-.761.247-.186.152-.278.35467-.278.608 0 .39267.309.703.927.931l1.132.418c.816.2913 1.422.6903 1.818 1.197s.594 1.0957.594 1.767c0 .8993-.328 1.6213-.984 2.166-.655.532-1.595.798-2.819.798-1.2 0-2.326-.3103-3.377-.931z"}),r.createElement("path",{d:"m136.369 11.868h-5.121c.037.6967.192 1.2477.464 1.653.285.3927.773.589 1.466.589.717 0 1.54-.2153 2.467-.646.359.38.588.8803.687 1.501-.99.722-2.177 1.083-3.562 1.083-1.311 0-2.307-.4117-2.987-1.235-.668-.836-1.002-2.071-1.002-3.705 0-.76.086-1.444.26-2.052.173-.62067.426-1.14633.76-1.577.334-.44333.742-.78533 1.225-1.026.482-.24067 1.032-.361 1.651-.361.631 0 1.187.10133 1.67.304.482.19.89.46867 1.224.836.334.35467.581.779.742 1.273.173.494.26 1.03233.26 1.615 0 .3167-.019.6207-.056.912-.037.2787-.086.5573-.148.836zm-3.581-3.99c-.965 0-1.484.74733-1.558 2.242h3.079v-.228c0-.608-.123-1.09567-.371-1.463-.247-.36733-.63-.551-1.15-.551z"}),r.createElement("path",{d:"m139.245 18.442v-17.385c.186-.038.396-.057.631-.057.247 0 .476.019.686.057v17.385c-.21.038-.439.057-.686.057-.235 0-.445-.019-.631-.057z"})),r.createElement("path",{d:"m2.648 14.604c.216.144.556.272 1.02.384s.872.168 1.224.168c.592 0 1.104-.092 1.536-.276.44-.184.772-.436.996-.756.232-.32.348-.688.348-1.104 0-.384-.08-.712-.24-.984-.16-.28-.396-.528-.708-.744-.304-.216-.708-.44-1.212-.672-.56-.256-.984-.468-1.272-.636s-.512-.352-.672-.552c-.152-.208-.228-.456-.228-.744 0-.384.156-.684.468-.9.32-.216.744-.324 1.272-.324.352 0 .648.036.888.108.248.072.52.176.816.312l.324-.732c-.28-.144-.604-.264-.972-.36-.36-.096-.732-.144-1.116-.144-.52 0-.98.092-1.38.276-.392.176-.696.42-.912.732-.208.312-.312.66-.312 1.044 0 .544.172 1.004.516 1.38.352.376.9.724 1.644 1.044.52.224.928.424 1.224.6.304.168.536.36.696.576.16.208.24.452.24.732 0 .392-.172.712-.516.96-.336.24-.816.36-1.44.36-.352 0-.712-.048-1.08-.144-.36-.104-.668-.22-.924-.348zm11.0963-2.364c0-.96-.204-1.736-.612-2.328-.4-.592-1.024-.888-1.872-.888-.56 0-1.048.132-1.46396.396-.408.256-.72.616-.936 1.08-.208.456-.312.98-.312 1.572 0 .936.26 1.684.78 2.244s1.27596.84 2.26796.84c.4 0 .764-.052 1.092-.156.328-.112.656-.26.984-.444l-.3-.696c-.36.176-.672.304-.936.384-.256.08-.54.12-.852.12-.688 0-1.2-.188-1.536-.564-.32796-.384-.50396-.904-.52796-1.56zm-4.19996-.648c.056-.544.224-.972.50396-1.284.288-.32.68-.48 1.176-.48.92 0 1.448.588 1.584 1.764zm5.84426-1.344c.288-.128.552-.224.792-.288.248-.072.544-.108.888-.108.44 0 .76.124.96.372.208.248.312.588.312 1.02v.324h-1.5c-.632 0-1.14.156-1.524.468s-.576.748-.576 1.308c0 .536.168.972.504 1.308.344.336.84.504 1.488.504.304 0 .616-.072.936-.216.32-.152.588-.328.804-.528l.12.588h.708v-4.02c0-.376-.096-.712-.288-1.008s-.46-.528-.804-.696-.736-.252-1.176-.252c-.264 0-.6.048-1.008.144-.4.096-.704.216-.912.36zm.228 3.096c0-.32.104-.588.312-.804.216-.224.512-.336.888-.336h1.536v1.32c-.216.256-.468.464-.756.624-.28.16-.576.24-.888.24-.36 0-.632-.104-.816-.312s-.276-.452-.276-.732zm6.0874-2.352c.272-.28.604-.524.996-.732.392-.216.748-.324 1.068-.324l-.228-.756c-.28 0-.604.1-.972.3s-.684.412-.948.636l-.3-.936h-.564v5.82h.948zm6.9986 2.952c-.28.144-.532.248-.756.312s-.512.096-.864.096c-.584 0-1.036-.212-1.356-.636s-.48-.976-.48-1.656c.008-.648.18-1.18.516-1.596.336-.424.792-.636 1.368-.636.336 0 .608.032.816.096.216.064.484.164.804.3l.288-.672c-.232-.152-.54-.276-.924-.372-.376-.104-.696-.156-.96-.156-.576 0-1.08.132-1.512.396-.432.256-.768.616-1.008 1.08-.232.456-.348.98-.348 1.572 0 .6.112 1.136.336 1.608.224.464.548.828.972 1.092.424.256.924.384 1.5.384.264 0 .588-.052.972-.156.384-.096.696-.22.936-.372zm4.6201-4.944c.616 0 1.072.188 1.368.564.304.368.456.864.456 1.488v3.936h-.948v-3.804c0-.432-.08-.768-.24-1.008s-.428-.36-.804-.36c-.288 0-.616.1-.984.3-.36.2-.68.452-.96.756v4.128h-.948v-8.352l.948-.12v3.396c.28-.272.612-.492.996-.
166.392-.176.764-.264 1.116-.264zm8.5136.024c.864 0 1.54.284 2.028.852.496.56.744 1.304.744 2.232 0 .592-.116 1.12-.348 1.584-.224.456-.548.816-.972 1.08-.416.256-.908.384-1.476.384-.24 0-.496-.052-.768-.156-.264-.096-.512-.236-.744-.42l-.204.42h-.564v-8.352l.948-.12v2.94c.216-.144.444-.252.684-.324.24-.08.464-.12.672-.12zm0 5.328c.576 0 1.02-.208 1.332-.624s.472-.952.48-1.608c0-.688-.156-1.24-.468-1.656-.304-.424-.748-.636-1.332-.636-.288 0-.54.044-.756.132s-.42.224-.612.408v3.468c.192.168.396.296.612.384s.464.132.744.132zm5.0915 1.608c-.088.24-.224.42-.408.54-.176.128-.452.28-.828.456l.288.684c.424-.088.796-.26 1.116-.516.328-.256.56-.564.696-.924l2.568-7.02h-.96l-1.668 4.5-1.764-4.68-.84.36 2.16 5.604z",fill:"#000",fillOpacity:".25"})))))),J.items.length>0?r.createElement("main",null,J.items.map(function(e,t){var n=e.title,a=e.url,s=e.summary,o=e.breadcrumbs;return r.createElement("article",{key:t,className:E},r.createElement("h2",{className:j},r.createElement(c.A,{to:a,dangerouslySetInnerHTML:{__html:n}})),o.length>0&&r.createElement("nav",{"aria-label":"breadcrumbs"},r.createElement("ul",{className:(0,i.A)("breadcrumbs",O)},o.map(function(e,t){return r.createElement("li",{key:t,className:"breadcrumbs__item",dangerouslySetInnerHTML:{__html:e}})}))),s&&r.createElement("p",{className:x,dangerouslySetInnerHTML:{__html:s}}))})):[V&&!J.loading&&r.createElement("p",{key:"no-results"},r.createElement(P.A,{id:"theme.SearchPage.noResultsText",description:"The paragraph for empty search result"},"No results were found")),!!J.loading&&r.createElement("div",{key:"spinner",className:k})],J.hasMore&&r.createElement("div",{className:H,ref:ee},r.createElement(P.A,{id:"theme.SearchPage.fetchingNewResults",description:"The paragraph for fetching new search results"},"Fetching new results..."))))}function M(){return r.createElement(y.e3,{className:"search-page-wrapper"},r.createElement(q,null))}},9078(e,t,n){"use strict";t.s=void 0;var r=n(5866).__importDefault(n(7865));t.s=function(e){var t=(0,r.default)().siteConfig,n=t.title,i=t.titleDelimiter;return null!=e&&e.trim().length?e.trim()+" "+i+" "+n:n}},3370(e,t,n){"use strict";var r=n(5777);Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=void 0;var i=r(n(8166)),a=r(n(4432));t.Configuration=function(){return(0,a.default)(function e(){var t,n,r,a,s,o,c,u,l,h,d,f,p,m,v,g,y,_,R,b,P=this,C=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(this,e),this.server=C.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=null!==(t=this.server.cacheSearchResultsForSeconds)&&void 0!==t?t:120,this.additionalSearchParameters=null!==(n=C.additionalSearchParameters)&&void 0!==n?n:{},this.additionalSearchParameters.query_by=null!==(r=null!==(a=this.additionalSearchParameters.queryBy)&&void 0!==a?a:this.additionalSearchParameters.query_by)&&void 0!==r?r:"",this.additionalSearchParameters.preset=null!==(s=null!==(o=this.additionalSearchParameters.preset)&&void 0!==o?o:this.additionalSearchParameters.preset)&&void 0!==s?s:"",this.additionalSearchParameters.sort_by=null!==(c=null!==(u=this.additionalSearchParameters.sortBy)&&void 0!==u?u:this.additionalSearchParameters.sort_by)&&void 0!==c?c:"",this.additionalSearchParameters.highlight_full_fields=null!==(l=null!==(h=this.additionalSearchParameters.highlightFullFields)&&void 0!==h?h:this.additionalSearchParameters.highlight_full_fields)&&void 0!==l?l:this.additionalSearchParameters.query_by,this.geoLocationField=null!==(d=C.geoLocationField)&&void 0!==d?d:"_geoloc",this.facetableFieldsWithSpecialCharacters=null!==(f=C.facetableFieldsWithSpecialCharacters)&&void 0!==f?f:[],this.collectionSpecificSearchParameters=null!==(p=C.collectionSpecificSearchParameters)&&void 0!==p?p:{},Object.keys(this.collectionSpecificSearchParameters).forEach(function(e){var t,n,r,i,a,s,o=P.collectionSpecificSearchParameters[e];o.query_by=null!==(t=o.queryBy)&&void 0!==t?t:o.query_by,o.preset=null!==(n=o.preset)&&void 0!==n?n:o.preset,o.sort_by=null!==(r=o.sortBy)&&void 0!==r?r:o.sort_by,o.highlight_full_fields=null!==(i=null!==(a=null!==(s=o.highlightFullFields)&&void 0!==s?s:o.highlight_full_fields)&&void 0!==a?a:P.additionalSearchParameters.highlight_full_fields)&&void 0!==i?i:o.query_by,Object.keys(o).forEac
1h(function(e){return void 0===o[e]?delete o[e]:{}})}),this.renderingContent=C.renderingContent,this.flattenGroupedHits=null===(m=C.flattenGroupedHits)||void 0===m||m,this.facetByOptions=null!==(v=C.facetByOptions)&&void 0!==v?v:{},this.filterByOptions=null!==(g=C.filterByOptions)&&void 0!==g?g:{},this.sortByOptions=null!==(y=C.sortByOptions)&&void 0!==y?y:{},this.collectionSpecificFacetByOptions=null!==(_=C.collectionSpecificFacetByOptions)&&void 0!==_?_:{},this.collectionSpecificFilterByOptions=null!==(R=C.collectionSpecificFilterByOptions)&&void 0!==R?R:{},this.collectionSpecificSortByOptions=null!==(b=C.collectionSpecificSortByOptions)&&void 0!==b?b:{}},[{key:"validate",value:function(){if((this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some(function(e){return e.queryBy}))&&console.warn("[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in additionalSearchParameters instead of camelCased parameters. For example: Use query_by instead of queryBy. camelCased parameters will be deprecated
1in a future version. We're making this change so that parameter names are identical to the ones sent to Typesense (which are all snake_cased), and to also keep the types for these parameters in sync with the types defined in typesense-js."),0===this.additionalSearchParameters.query_by.length&&0===this.additionalSearchParameters.preset.length&&(0===Object.keys(this.collectionSpecificSearchParameters).length||Object.values(this.collectionSpecificSearchParameters).some(function(e){return 0===(e.query_by||"").length&&0===(e.preset||"").length})))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}])}()},4021(e,t,n){"use strict";var r=n(5777);Object.defineProperty(t,"__esModule",{value:!0}),t.FacetSearchResponseAdapter=void 0;var i=r(n(8166)),a=r(n(4432)),s=n(1289),o=t.FacetSearchResponseAdapter=function(){return(0,a.default)(function e(t,n){(0,i.default)(this,e),this.typesenseResponse=t,this.instantsearchRequest=n},[{key:"_adaptFacetHits",value:function(e){var t=this;return e.find(function(e){return e.field_name===t.instantsearchRequest.params.facetName}).counts.map(function(e){return{value:e.value,highlighted:t._adaptHighlightTag(e.highlighted,t.instantsearchRequest.params.highlightPreTag,t.instantsearchRequest.params.highlightPostTag),count:e.count}})}},{key:"adapt",value:function(){return{facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms}}}])}();Object.assign(o.prototype,s.utils)},6926(e,t,n){"use strict";var r=n(5777);Object.defineProperty(t,"__esModule",{value:!0}),t.SearchRequestAdapter=void 0;var i=r(n(4115)),a=r(n(2800)),s=r(n(4032)),o=r(n(3791)),c=r(n(8166)),u=r(n(4432)),l=["q","conversation","conversation_id","conversation_model_id"];t.SearchRequestAdapter=function(){return(0,u.default)(function e(t,n,r){(0,c.default)(this,e),this.instantsearchRequests=t,this.typesenseClient=n,this.configuration=r,this.additionalSearchParameters=r.additionalSearchParameters,this.collectionSpecificSearchParameters=r.collectionSpecificSearchParameters},[{key:"_shouldUseExactMatchForField",value:function(e,t){var n,r;return!1!==(null===(n=this.configuration.collectionSpecificFilterByOptions)||void 0===n||null===(n=n[t])||void 0===n||null===(n=n[e])||void 0===n?void 0:n.exactMatch)&&!1!==(null===(r=this.configuration.filterByOptions)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.exactMatch)}},{key:"_adaptFacetFilters",value:function(e,t){var n=this,r="";return e?r=e.map(function(e){if(Array.isArray(e)){var r={};e.forEach(function(e){var t=n._parseFacetFilter(e),i=t.fieldName,a=t.fieldValue;r[i]=r[i]||[],r[i].push(a)}),Object.keys(r).length>1&&console.error("[Typesense-Instantsearch-Adapter] Typesense does not support cross-field ORs at the moment. The adapter could not OR values between these fields: ".concat(Object.keys(r).join(",")));var i=Object.keys(r)[0],a=r[i].reduce(function(e,t){return t.startsWith("-")&&!n._isNumber(t)?e[0].push(t.substring(1)):e[1].push(t),e},[[],[]]),s=(0,o.default)(a,2),c=s[0],u=s[1],l=[];if(u.length>0){var h=n._shouldUseExactMatchForField(i,t)?":=":":";l.push("".concat(i).concat(h,"[").concat(u.map(function(e){return n._escapeFacetValue(e)}).join(","),"]"))}if(c.length>0){var d=n._shouldUseExactMatchForField(i,t)?":!=":":!";l.push("".concat(i).concat(d,"[").concat(c.map(function(e){return n._escapeFacetValue(e)}).join(","),"]"))}return l.filter(function(e){return e}).join(" && ")}var f,p=n._parseFacetFilter(e),m=p.fieldName,v=p.fieldValue;if(v.startsWith("-")&&!n._isNumber(v)){var g=n._shouldUseExactMatchForField(m,t)?":!=":":!";f="".concat(m).concat(g,"[").concat(n._escapeFacetValue(v.substring(1)),"]")}else{var y=n._shouldUseExactMatchForField(m,t)?":=":":";f="".concat(m).concat(y,"[").concat(n._escapeFacetValue(v),"]")}return f}).join(" && "):r}},{key:"_parseFacetFilter",value:function(e){var t,n,r,i,a;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var s=this.configuration.facetableFieldsWithSpecialCharacters.flat().map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(n=new RegExp("^(".concat(s.join("|"),"):(.*)$")),null!=(r=e.match(n)))return{fieldName:i="".concat(r[1]),fieldValue:a="".concat(r[2])}}return n=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n))?console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a facet filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter.")):(i="".concat(r[1]).concat(r[2]),a="".concat(r[3])),{fieldName:i,fieldValue:a}}},{key:"_escapeFacetValue",value:function(e){return"boolean"==typeof e||"true"===e||"false"===e||this._isNumber(e)?e:"`".concat(e,"`")}},{key:"_isNumber",value:function(e){return Number.isInteger(e%1)||!!(e%1)}},{key:"_adaptNumericFilters",value:function(e){var t=this,n="";if(!e)return n;var r={};e.forEach(function(e){var n=t._parseNumericFilter(e),i=n.fieldName,a=n.operator,s=n.fieldValue;r[i]=r[i]||{},r[i][a]=s});var i=[];return Object.keys(r).forEach(function(e){null!=r[e]["<="]&&null!=r[e][">="]?i.push("".concat(e,":=[").concat(r[e][">="],"..").concat(r[e]["<="],"]")):null!=r[e]["<="]?i.push("".concat(e,":<=").concat(r[e]["<="])):null!=r[e][">="]?i.push("".concat(e,":>=").concat(r[e][">="])):null!=r[e]["="]?i.push("".concat(e,":=").concat(r[e]["="])):console.warn("[Typesense-Instantsearch-Adapter] Unsupported operator found ".concat(JSON.stringify(r[e])))}),n=i.join(" && ")}},{key:"_parseNumericFilter",value:function(e){var t,n,r,i,a,s;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var c=this.configuration.facetableFieldsWithSpecialCharacters.map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(n=new RegExp("^(".concat(c.join("|"),")(<=|>=|>|<|=)(.*)$")),null!=(r=e.match(n))){var u=r,l=(0,o.default)(u,4);return{fieldName:i=l[1],operator:a=l[2],fieldValue:s=l[3]}}}if(n=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n)))console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a numeric filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter."));else{var h=r,d=(0,o.default)(h,4);i=d[1],a=d[2],s=d[3]}return{fieldName:i,operator:a,fieldValue:s}}},{key:"_adaptGeoFilter",value:function(e){var t=e.insideBoundingBox,n=e.aroundRadius,r=e.aroundLatLng,i=e.insidePolygon;if(t){var a,s,c,u;if(Array.isArray(t)){var l=t.flat(),h=(0,o.default)(l,4);a=h[0],s=h[1],c=h[2],u=h[3]}else{var d=t.split(","),f=(0,o.default)(d,4);a=f[0],s=f[1],c=f[2],u=f[3]}return"".concat(this.configuration.geoLocationField,":(").concat(a,", ").concat(s,", ").concat(a,", ").concat(u,", ").concat(c,", ").concat(u,", ").concat(c,", ").concat(s,")")}if(r||n){if(!n||"all"===n)throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var p="".concat(parseFloat(n)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(r,", ").concat(p,")")}if(i){var m=i;return Array.isArray(i)&&(m=i.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(m,")")}}},{key:"_adaptFilters",value:function(e,t){var n=[];return e.filters&&n.push(e.filters),n.push(this._adaptFacetFilters(e.facetFilters,t)),n.push(this._adaptNumericFilters(e.numericFilters)),n.push(this._adaptGeoFilter(e)),n.filter(function(e){return e&&""!==e}).join(" && ")}},{key:"_adaptIndexName",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_adaptFacetBy",value:function(e,t){var n=this;return[e].flat().map(function(e){var r;return null!==(r=n.configuration.collectionSpecificFacetByOptions)&&void 0!==r&&null!==(r=r[t])&&void 0!==r&&r[e]?"".concat(e).concat(n.configuration.collectionSpecificFacetByOptions[t][e]):n.configuration.facetByOptions[e]?"".concat(e).concat(n.configuration.facetByOptions[e]):e}).join(",")}},{key:"_adaptRulesContextsToOverrideTags",value:function(e){return e.join(",")}},{key:"_buildSearchParameters",value:function(e){for(var t,n,r=e.params,i=e.indexName,a=this._adaptIndexName(i),s={},c=0,u=Object.entries(this.additionalSearchParameters);c<u.length;c++){var l=(0,o.default)(u[c],2),h=l[0],d=l[1];s[this._camelToSnakeCase(h)]=d}if(this.collectionSpecificSearchParameters[a])for(var f=0,p=Object.entries(this.collectionSpecificSearchParameters[a]);f<p.length;f++){var m=(0,o.default)(p[f],2),v=m[0],g=m[1];s[this._camelToSnakeCase(v)]=g}var y=Object.assign({},s),_=this._adaptSortBy(i);Object.assign(y,{collection:a,q:""===r.query||void 0===r.query?"*":r.query,facet_by:s.facet_by||this._adaptFacetBy(r.facets,a),filter_by:this._adaptFilters(r,a)||s.filter_by,sort_by:_||s.sort_by,max_facet_values:r.maxValuesPerFacet,page:(r.page||0)+1}),null!=r.hitsPerPage&&(y.per_page=r.hitsPerPage),r.facetQuery&&(y.facet_query="".concat(r.facetName,":").concat(r.facetQuery),y.per_page=0),r.ruleContexts&&r.ruleContexts.length>0&&(y.override_tags=this._adaptRulesContextsToOverrideTags(r.ruleContexts)),r.typesenseVectorQuery&&(y.vector_query=r.typesenseVectorQuery);var R=(null===(t=this.configuration.collectionSpecificSortByOptions)||void 0===t||null===(t=t[a])||void 0===t?void 0:t[y.sort_by])||
1(null===(n=this.configuration.sortByOptions)||void 0===n?void 0:n[y.sort_by]);return null!=(null==R?void 0:R.enable_overrides)&&(y.enable_overrides=R.enable_overrides),Object.fromEntries(Object.entries(y).filter(function(e){var t=(0,o.default)(e,2),n=(t[0],t[1]);return null!=n&&""!==n}))}},{key:"_camelToSnakeCase",value:function(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}},{key:"request",value:(e=(0,s.default)(i.default.mark(function e(){var t,n,r,s,o,c,u,h,d,f=this;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.instantsearchRequests.map(function(e){return f._buildSearchParameters(e)}),s={},!0!==(null===(t=r[0])||void 0===t?void 0:t.conversation)&&"true"!==(null===(n=r[0])||void 0===n?void 0:n.conversation)||(o=r[0],c=o.q,u=o.conversation,h=o.conversation_id,d=o.conversation_model_id,s={q:c,conversation:u,conversation_id:h,conversation_model_id:d},r=r.map(function(e){return e.q,e.conversation,e.conversation_id,e.conversation_model_id,(0,a.default)(e,l)})),e.abrupt("return",this.typesenseClient.multiSearch.perform({searches:r},s));case 4:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}],[{key:"INDEX_NAME_MATCHING_REGEX",get:function(){return new RegExp("^(.+?)(?=(/sort/(.*))|$)")}},{key:"DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*)((?!:).):(?!:)(.*)")}},{key:"DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*?)(<=|>=|>|<|=)(.*)")}}]);var e}()},8790(e,t,n){"use strict";var r=n(5777);t.A=void 0;var i=r(n(4115)),a=r(n(4032)),s=r(n(8166)),o=r(n(4432)),c=n(3370),u=n(5294),l=n(6926),h=n(8770),d=n(4021);t.A=function(){return(0,o.default)(function e(t){var n=this;(0,s.default)(this,e),this.updateConfiguration(t),this.searchClient={clearCache:function(){return n.clearCache()},search:function(e){return n.searchTypesenseAndAdapt(e)},searchForFacetValues:function(e){return n.searchTypesenseForFacetValuesAndAdapt(e)}}},[{key:"searchTypesenseAndAdapt",value:(n=(0,a.default)(i.default.mark(function e(t){var n,r,a=this;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,r=n.results.map(function(e,r){return a._validateTypesenseResult(e),new h.SearchResponseAdapter(e,t[r],a.configuration,n.results,n).adapt()}),e.abrupt("return",{results:r});case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}},e,this,[[0,8]])})),function(e){return n.apply(this,arguments)})},{key:"searchTypesenseForFacetValuesAndAdapt",value:(t=(0,a.default)(i.default.mark(function e(t){var n,r,a=this;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,r=n.results.map(function(e,n){return a._validateTypesenseResult(e),new d.FacetSearchResponseAdapter(e,t[n],a.configuration).adapt()}),e.abrupt("return",r);case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}},e,this,[[0,8]])})),function(e){return t.apply(this,arguments)})},{key:"_adaptAndPerformTypesenseRequest",value:(e=(0,a.default)(i.default.mark(function e(t){var n,r;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=new l.SearchRequestAdapter(t,this.typesenseClient,this.configuration),e.next=3,n.request();case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}},e,this)})),function(t){return e.apply(this,arguments)})},{key:"clearCache",value:function(){return this.typesenseClient=new u.SearchClient(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(e){return this.configuration=new c.Configuration(e),this.configuration.validate(),this.typesenseClient=new u.SearchClient(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(e){if(e.error)throw new Error("".concat(e.code," - ").concat(e.error));if(!e.hits&&!e.grouped_hits)throw new Error("Did not find any hits. ".concat(e.code," - ").concat(e.error))}}]);var e,t,n}()},5294(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Errors=t.SearchClient=t.Client=void 0;var r=n(5866),i=r.__importDefault(n(422));t.Client=i.default;var a=r.__importDefault(n(6750));t.SearchClient=a.default;var s=r.__importStar(n(8209));t.Errors=s,t.default={Client:i.default,SearchClient:a.default,Errors:s}},2789(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(5949)),a=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=a},5949(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i="/aliases",a=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(i)]})})},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=a},4185(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(5898)),a=r.__importDefault(n(5743)),s=r.__importDefault(n(1592)),o=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new s.default(this.apiCall)}return e.prototype.rules=function(e){return void 0===e?this._analyticsRules:(void 0===this.individualAnalyticsRules[e]&&(this.individualAnalyticsRules[e]=new a.default(e,this.apiCall)),this.individualAnalyticsRules[e])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e}();t.default=o},1592(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.post(this.endpointPath(),e)]})})},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/events"},enumerable:!1,configurable:!0}),e}();t.default=i},5743(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(5898)),a=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=a},5898(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"}
vendor: 9,101 bytes, line 1
1,enumerable:!1,configurable:!0}),e}();t.default=i},9817(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(57)),a=n(3251),s=n(3154),o=n(8209),c=r.__importDefault(n(6857)),u=n(3720),l=!0,h="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node&&"undefined"==typeof window,d=function(){function e(e){this.configuration=e,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return e.prototype.get=function(e,t,n){void 0===t&&(t={});var i=void 0===n?{}:n,a=i.abortSignal,s=void 0===a?null:a,o=i.responseType,c=void 0===o?void 0:o,u=i.streamConfig,l=void 0===u?void 0:u,h=i.isStreamingRequest;return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.performRequest("get",e,{queryParameters:t,abortSignal:s,responseType:c,streamConfig:l,isStreamingRequest:h})]})})},e.prototype.delete=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.performRequest("delete",e,{queryParameters:t,isStreamingRequest:!1})]})})},e.prototype.post=function(e,t,n,i,a){void 0===t&&(t={}),void 0===n&&(n={}),void 0===i&&(i={});var s=void 0===a?{}:a,o=s.abortSignal,c=void 0===o?null:o,u=s.responseType,l=void 0===u?void 0:u,h=s.streamConfig,d=void 0===h?void 0:h,f=s.isStreamingRequest;return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.performRequest("post",e,{queryParameters:n,bodyParameters:t,additionalHeaders:i,abortSignal:c,responseType:l,streamConfig:d,isStreamingRequest:f})]})})},e.prototype.put=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.performRequest("put",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]})})},e.prototype.patch=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.performRequest("patch",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]})})},e.prototype.getAdapter=function(){if(this.configuration.axiosAdapter)return"function"==typeof this.configuration.axiosAdapter?this.configuration.axiosAdapter:"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent?i.default.getAdapter(this.configuration.axiosAdapter).bind(globalThis):i.default.getAdapter(this.configuration.axiosAdapter)},e.prototype.performRequest=function(e,t,n){var o,c,u,d,f=n.queryParameters,p=void 0===f?null:f,m=n.bodyParameters,v=void 0===m?null:m,g=n.additionalHeaders,y=void 0===g?{}:g,_=n.abortSignal,R=void 0===_?null:_,b=n.responseType,P=void 0===b?void 0:b,C=n.skipConnectionTimeout,F=void 0!==C&&C,w=n.enableKeepAlive,S=void 0===w?void 0:w,E=n.streamConfig,j=void 0===E?void 0:E,O=n.isStreamingRequest;return r.__awaiter(this,void 0,void 0,function(){var n,f,m,g,_,b,C;return r.__generator(this,function(w){switch(w.label){case 0:this.configuration.validate(),O&&(this.logger.debug("Request: Performing streaming request to ".concat(t)),h||"undefined"==typeof fetch||(this.logger.debug("Using fetch adapter for browser streaming"),P="stream")),n=Date.now(),m=!1,this.logger.debug("Request #".concat(n,": Performing ").concat(e.toUpperCase()," request: ").concat(t)),g=function(g){var b,C,w,E,x,A,N;return r.__generator(this,function(T){switch(T.label){case 0:if(b=_.getNextNode(n),_.logger.debug("Request #".concat(n,": Attempting ").concat(e.toUpperCase()," request Try #").concat(g," to Node ").concat(b.index)),R&&R.aborted)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];C=void 0,T.label=1;case 1:return T.trys.push([1,3,5,6]),(w={method:e,url:_.uriFor(t,b),headers:Object.assign({},_.defaultHeaders(),y,_.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=O&&!h?"fetch":_.getAdapter(),!0!==F&&(w.timeout=1e3*_.connectionTimeoutSeconds),p&&0!==Object.keys(p).length&&(w.params=p),_.sendApiKeyAsQueryParam&&(w.params=w.params||{},w.params["x-typesense-api-key"]=_.apiKey),_.configuration.httpAgent?(_.logger.debug("Request #".concat(n,": Using custom httpAgent")),w.httpAgent=_.configuration.httpAgent):!0===S&&(h?(_.logger.debug("Request #".concat(n,": Enabling KeepAlive")),w.httpAgent=new a.Agent({keepAlive:!0})):_.logger.warn("Request #".concat(n,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),_.configuration.httpsAgent?(_.logger.debug("Request #".concat(n,": Using custom httpsAgent")),w.httpsAgent=_.configuration.httpsAgent):!0===S&&(h?(_.logger.debug("Request #".concat(n,": Enabling keepAlive")),w.httpsAgent=new s.Agent({keepAlive:!0})):_.logger.warn("Request #".concat(n,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),_.configuration.paramsSerializer&&(_.logger.debug("Request #".concat(n,": Using custom paramsSerializer")),w.paramsSerializer=_.configuration.paramsSerializer),v&&("string"==typeof v&&0!==v.length||"object"==typeof v&&0!==Object.keys(v).length)&&(w.data=v),R&&(E=i.default.CancelToken,x=E.source(),C=function(){m=!0,x.cancel()},R.addEventListener("abort",C),w.cancelToken=x.token),O?(w.responseType="stream",h||(w.headers=r.__assign(r.__assign({},w.headers),{Accept:"text/event-stream"}))):P&&(w.responseType=P),[4,(0,i.default)(w)];case 2:if((A=T.sent()).status>=1&&A.status<=499&&_.setNodeHealthcheck(b,l),_.logger.debug("Request #".concat(n,": Request to Node ").concat(b.index," was made. Response Code was ").concat(A.status,".")),A.status>=200&&A.status<300)return O?[2,{value:_.handleStreamingResponse(A,j)}]:[2,{value:Promise.resolve(A.data)}];if(A.status<500)return[2,{value:Promise.reject(_.customErrorForResponse(A,null===(o=A.data)||void 0===o?void 0:o.message,w.data))}];throw _.customErrorForResponse(A,null===(c=A.data)||void 0===c?void 0:c.message,w.data);case 3:return N=T.sent(),m||_.setNodeHealthcheck(b,false),f=N,_.logger.warn("Request #".concat(n,": Request to Node ").concat(b.index,' failed due to "').concat(null!==(u=null==N?void 0:N.code)&&void 0!==u?u:""," ").concat(N.message).concat(null==N.response?"":" - "+JSON.stringify(null===(d=N.response)||void 0===d?void 0:d.data),'"')),m?[2,{value:Promise.reject(new Error("Request aborted by caller."))}]:(O&&_.invokeOnErrorCallback(N,j),g<_.numRetriesPerRequest+1?(_.logger.warn("Request #".concat(n,": Sleeping for ").concat(_.retryIntervalSeconds,"s and then retrying request...")),[4,_.timer(_.retryIntervalSeconds)]):(_.logger.debug("Request #".concat(n,": No retries left. Raising last error")),[2,{value:Promise.reject(f)}]));case 4:return T.sent(),[3,6];case 5:return R&&C&&R.removeEventListener("abort",C),[7];case 6:return[2]}})},_=this,b=1,w.label=1;case 1:return b<=this.numRetriesPerRequest+1?[5,g(b)]:[3,4];case 2:if("object"==typeof(C=w.sent()))return[2,C.value];w.label=3;case 3:return b++,[3,1];case 4:return this.logger.debug("Request #".concat(n,": No retries left. Raising last error")),[2,Promise.reject(f)]}})})},e.prototype.processStreamingLine=function(e){if(!e.trim()||"data: [DONE]"===e)return null;if(e.startsWith("data: "))return this.processDataLine(e.slice(6).trim());if(e.trim().startsWith("{"))try{var t=JSON.parse(e.trim());return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(n){return{conversation_id:"unknown",message:e.trim()}}return{conversation_id:"unknown",message:e.trim()}},e.prototype.processDataLine=function(e){if(!e)return null;if(e.startsWith("{"))try{var t=JSON.parse(e);return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(n){return{conversation_id:"unknown",message:e}}return{conversation_id:"unknown",message:e}},e.prototype.handleStreamingResponse=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return this.logger.debug("Handling streaming response. Env
1ironment: ".concat(h?"Node.js":"Browser")),h&&e.data?[2,this.handleNodeStreaming(e,t)]:h?(this.logger.debug("Processing non-streaming response"),this.invokeOnCompleteCallback(e.data,t),[2,Promise.resolve(e.data)]):[2,this.handleBrowserStreaming(e,t)]})})},e.prototype.handleNodeStreaming=function(e,t){var n=this;return this.logger.debug("Processing Node.js stream"),new Promise(function(r,i){var a=e.data,s=[],o="";a.on("data",function(e){var r;try{var a=e.toString(),c=(o+=a).split("\n");o=null!==(r=c.pop())&&void 0!==r?r:"",n.processStreamLines(c,s,t)}catch(u){i(u)}}),a.on("end",function(){if(o.trim().length>0){var i=o.split("\n");n.processStreamLines(i,s,t)}n.finalizeStreamResult(s,r,e,t)}),a.on("error",function(e){n.logger.error("Stream error: ".concat(e)),n.invokeOnErrorCallback(e,t),i(e)})})},e.prototype.handleBrowserStreaming=function(e,t){var n=this;return this.logger.debug("Processing browser stream"),new Promise(function(i,a){return r.__awaiter(n,void 0,void 0,function(){return r.__generator(this,function(n){try{return e.data&&"function"==typeof e.data.getReader?[2,this.handleBrowserReadableStream(e.data,i,a,e,t)]:"string"==typeof e.data?[2,this.handleBrowserStringResponse(e.data,i,e,t)]:"object"==typeof e.data&&null!==e.data?(this.logger.debug("No stream found, but data object is available"),this.invokeOnCompleteCallback(e.data,t),[2,i(e.data)]):(this.logger.error("No usable data found in response"),[2,a(new Error("No usable data found in response"))])}catch(r){this.logger.error("Error processing streaming response: ".concat(r)),this.invokeOnErrorCallback(r,t),a(r)}return[2]})})})},e.prototype.handleBrowserReadableStream=function(e,t,n,i,a){return r.__awaiter(this,void 0,void 0,function(){var s,o,c,u,l,h,d,f,p,m;return r.__generator(this,function(r){switch(r.label){case 0:this.logger.debug("Found ReadableStream in response.data"),s=e.getReader(),o=[],c="",r.label=1;case 1:r.trys.push([1,5,,6]),r.label=2;case 2:return[4,s.read()];case 3:return u=r.sent(),l=u.done,h=u.value,l?(this.logger.debug("Stream reading complete"),c.trim()&&(d=c.split("\n"),this.processStreamLines(d,o,a)),[3,4]):(f=(new TextDecoder).decode(h),this.logger.debug("Received chunk: ".concat(f.length," bytes")),p=(c+=f).split("\n"),c=p.pop()||"",this.processStreamLines(p,o,a),[3,2]);case 4:return this.finalizeStreamResult(o,t,i,a),[3,6];case 5:return m=r.sent(),this.logger.error("Stream error: ".concat(m)),this.invokeOnErrorCallback(m,a),n(m),[3,6];case 6:return[2]}})})},e.prototype.handleBrowserStringResponse=function(e,t,n,r){this.logger.debug("Processing text response as stream data");var i=[],a=e.split("\n");if(this.processStreamLines(a,i,r),i.length>0){var s=this.combineStreamingChunks(i);this.invokeOnCompleteCallback(s,r),t(s)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.processStreamLines=function(e,t,n){for(var r=0,i=e;r<i.length;r++){var a=i[r];if(a.trim()&&"data: [DONE]"!==a){var s=this.processStreamingLine(a);null!==s&&(this.invokeOnChunkCallback(s,n),t.push(s))}}},e.prototype.finalizeStreamResult=function(e,t,n,r){if(e.length>0){var i=this.combineStreamingChunks(e);this.logger.debug("Stream processing complete"),this.invokeOnCompleteCallback(i,r),t(i)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.combineStreamingChunks=function(e){if(0===e.length)return{};if(1===e.length)return e[0];var t=this.getMessageChunks(e);if(t.length>0)return this.combineMessageChunks(e,t);var n=e[e.length-1];if(!this.isCompleteSearchResponse(n))throw new Error("Last chunk is not a complete search response");return n},e.prototype.getMessageChunks=function(e){return e.filter(this.isChunkMessage)},e.prototype.isChunkMessage=function(e){return"object"==typeof e&&null!==e&&"message"in e&&"conversation_id"in e},e.prototype.combineMessageChunks=function(e,t){this.logger.debug("Found ".concat(t.length," message chunks to combine"));var n=e[e.length-1];if(this.isCompleteSearchResponse(n))return n;var r=e.find(this.isCompleteSearchResponse);
1if(!r)throw new Error("No metadata chunk found");return r},e.prototype.isCompleteSearchResponse=function(e){return"object"==typeof e&&null!==e&&Object.keys(e).length>0&&("results"in e||"found"in e||"hits"in e||"page"in e||"search_time_ms"in e)},e.prototype.getNextNode=function(e){if(void 0===e&&(e=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(e,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(e,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(e,": Nodes Health: ").concat(this.nodes.map(function(e){return"Node ".concat(e.index," is ").concat(!0===e.isHealthy?"Healthy":"Unhealthy")}).join(" || ")));for(var t=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(e,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},e.prototype.nodeDueForHealthcheck=function(e,t){void 0===t&&(t=0);var n=Date.now()-e.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(t,": Node ").concat(e.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n},e.prototype.initializeMetadataForNodes=function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,l)),this.nodes.forEach(function(t,n){t.index=n,e.setNodeHealthcheck(t,l)})},e.prototype.setNodeHealthcheck=function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()},e.prototype.uriFor=function(e,t){return null!=t.url?"".concat(t.url).concat(e):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(e)},e.prototype.defaultHeaders=function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e},e.prototype.timer=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,new Promise(function(t){return setTimeout(t,1e3*e)})]})})},e.prototype.customErrorForResponse=function(e,t,n){var r="Request failed with HTTP code ".concat(e.status);"string"==typeof t&&""!==t.trim()&&(r+=" | Server said: ".concat(t));new c.default(r,n,e.status);return 400===e.status?new o.RequestMalformed(r,n,e.status):401===e.status?new o.RequestUnauthorized(r,n,e.status):404===e.status?new o.ObjectNotFound(r,n,e.status):409===e.status?new o.ObjectAlreadyExists(r,n,e.status):422===e.status?new o.ObjectUnprocessable(r,n,e.status):e.status>=500&&e.status<=599?new o.ServerError(r,n,e.status):new o.HTTPError(r,n,e.status)},e.prototype.invokeOnChunkCallback=function(e,t){if(null==t?void 0:t.onChunk)try{t.onChunk(e)}catch(n){this.logger.warn("Error in onChunk callback: ".concat(n))}},e.prototype.invokeOnCompleteCallback=function(e,t){if(null==t?void 0:t.onComplete)try{t.onComplete(e)}catch(n){this.logger.warn("Error in onComplete callback: ".concat(n))}},e.prototype.invokeOnErrorCallback=function(e,t){if(null==t?void 0:t.onError){var n=(0,u.toErrorWithMessage)(e);try{t.onError(n)}catch(r){this.logger.warn("Error in onError callback: ".concat(r))}}},e}();t.default=d},422(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(3323)),a=r.__importDefault(n(9817)),s=r.__importDefault(n(2884)),o=r.__importDefault(n(3905)),c=r.__importDefault(n(5949)),u=r.__importDefault(n(2789)),l=r.__importDefault(n(3813)),h=r.__importDefault(n(4910)),d=r.__importDefault(n(1746)),f=r.__importDefault(n(264)),p=r.__importDefault(n(6198)),m=r.__importDefault(n(6611)),v=r.__importDefault(n(7215)),g=r.__importDefault(n(6092)),y=r.__importDefault(n(965)),_=r.__importDefault(n(9918)),R=r.__importDefault(n(4185)),b=r.__importDefault(n(6928)),P=r.__importDefault(n(213)),C=r.__importDefault(n(1149)),F=r.__importDefault(n(3062)),w=r.__importDefault(n(5121)),S=r.__importDefault(n(2429)),E=r.__importDefault(n(3478)),j=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null!==(t=e.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new i.default(e),this.apiCall=new a.default(this.configuration),this.debug=new d.default(this.apiCall),this.metrics=new f.default(this.apiCall),this.stats=new p.default(this.apiCall),this.health=new m.default(this.apiCall),this.operations=new v.default(this.apiCall),this.multiSearch=new g.default(this.apiCall,this.configuration),this._collections=new s.default(this.apiCall),this.individualCollections={},this._aliases=new c.default(this.apiCall),this.individualAliases={},this._keys=new l.default(this.apiCall),this.individualKeys={},this._presets=new y.default(this.apiCall),this.individualPresets={},this._stopwords=new b.default(this.apiCall),this.individualStopwords={},this.analytics=new R.default(this.apiCall),this.stemming=new w.default(this.apiCall),this._conversations=new C.default(this.apiCall),this.individualConversations={},this._nlSearchModels=new S.default(this.apiCall),this.individualNLSearchModels={}}return e.prototype.collections=function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new o.default(e,this.apiCall,this.configuration)),this.individualCollections[e])},e.prototype.aliases=function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new u.default(e,this.apiCall)),this.individualAliases[e])},e.prototype.keys=function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new h.default(e,this.apiCall)),this.individualKeys[e])},e.prototype.presets=function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new _.default(e,this.apiCall)),this.individualPresets[e])},e.prototype.stopwords=function(e){return void 0===e?this._stopwords:(void 0===this.individualStopwords[e]&&(this.individualStopwords[e]=new P.default(e,this.apiCall)),this.individualStopwords[e])},e.prototype.conversations=function(e){return void 0===e?this._conversations:(void 0===this.individualConversations[e]&&(this.individualConversations[e]=new F.default(e,this.apiCall)),this.individualConversations[e])},e.prototype.nlSearchModels=function(e){return void 0===e?this._nlSearchModels:(void 0===this.individualNLSearchModels[e]&&(this.individualNLSearchModels[e]=new E.default(e,this.apiCall)),this.individualNLSearchModels[e])},e}();t.default=j}
1,3905(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(2884)),a=r.__importDefault(n(1447)),s=n(8209),o=r.__importDefault(n(6172)),c=r.__importDefault(n(8905)),u=r.__importDefault(n(111)),l=r.__importDefault(n(2880)),h=n(1128),d=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=e,this.apiCall=t,this.configuration=n,this._documents=new a.default(this.name,this.apiCall,this.configuration),this._overrides=new o.default(this.name,this.apiCall),this._synonyms=new u.default(this.name,this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.patch(this.endpointPath(),e)]})})},e.prototype.delete=function(e){return void 0===e&&(e={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]})})},e.prototype.exists=function(){return r.__awaiter(this,void 0,void 0,function(){var e;return r.__generator(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return t.sent(),[2,!0];case 2:if((e=t.sent())instanceof s.ObjectNotFound)return[2,!1];throw e;case 3:return[2]}})})},e.prototype.documents=function(e){return e?(void 0===this.individualDocuments[e]&&(this.individualDocuments[e]=new h.Document(this.name,e,this.apiCall)),this.individualDocuments[e]):this._documents},e.prototype.overrides=function(e){return void 0===e?this._overrides:(void 0===this.individualOverrides[e]&&(this.individualOverrides[e]=new c.default(this.name,e,this.apiCall)),this.individualOverrides[e])},e.prototype.synonyms=function(e){return void 0===e?this._synonyms:(void 0===this.individualSynonyms[e]&&(this.individualSynonyms[e]=new l.default(this.name,e,this.apiCall)),this.individualSynonyms[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=d},2884(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i="/collections",a=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.post(i,e,t)]})})},e.prototype.retrieve=function(e){return void 0===e&&(e={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.get(i,e)]})})},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=a},3323(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importStar(n(2919)),a=n(8209),s=function(){function e(e){var t=this;this.nodes=e.nodes||[],this.nodes=this.nodes.map(function(e){return t.setDefaultPathInNode(e)}).map(function(e){return t.setDefaultPortInNode(e)}).map(function(e){return r.__assign({},e)}),null==e.randomizeNodes&&(e.randomizeNodes=!0),!0===e.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=e.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=e.connectionTimeoutSeconds||e.timeoutSeconds||5,this.healthcheckIntervalSeconds=e.healthcheckIntervalSeconds||60,this.numRetries=(void 0!==e.numRetries&&e.numRetries>=0?e.numRetries:this.nodes.length+(null==this.nearestNode?0:1))||3,this.retryIntervalSeconds=e.retryIntervalSeconds||.1,this.apiKey=e.apiKey,this.sendApiKeyAsQueryParam=e.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=e.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=e.useServerSideSearchCache||!1,this.axiosAdapter=e.axiosAdapter,this.logger=e.logger||i,this.logLevel=e.logLevel||"w
1arn",this.logger.setLevel(this.logLevel),this.additionalHeaders=e.additionalHeaders,this.httpAgent=e.httpAgent,this.httpsAgent=e.httpsAgent,this.paramsSerializer=e.paramsSerializer,this.showDeprecationWarnings(e),this.validate()}return e.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new a.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new a.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new a.MissingConfigurationError("Ensure that apiKey is set");return!0},e.prototype.validateNodes=function(){var e=this;return this.nodes.some(function(t){return e.isNodeMissingAnyParameters(t)})},e.prototype.isNodeMissingAnyParameters=function(e){return!["protocol","host","port","path"].every(function(t){return e.hasOwnProperty(t)})&&null==e.url},e.prototype.setDefaultPathInNode=function(e){return null==e||e.hasOwnProperty("path")||(e.path=""),e},e.prototype.setDefaultPortInNode=function(e){if(null!=e&&!e.hasOwnProperty("port")&&e.hasOwnProperty("protocol"))switch(e.protocol){case"https":e.port=443;break;case"http":e.port=80}return e},e.prototype.showDeprecationWarnings=function(e){e.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),e.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),e.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},e.prototype.shuffleArray=function(e){for(var t,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1));t=[e[r],e[n]],e[n]=t[0],e[r]=t[1]}},e}();t.default=s},3062(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(1149)),a=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.put(this.endpointPath(),e)]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=a},6749(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(1864)),a=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.put(this.endpointPath(),e)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=a},1864(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.post(this.endpointPath(),e)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/conversations/models"}
1,enumerable:!1,configurable:!0}),e}();t.default=i},1149(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(1864)),a=r.__importDefault(n(6749)),s="/conversations",o=function(){function e(e){this.apiCall=e,this.individualConversationModels={},this.apiCall=e,this._conversationsModels=new i.default(this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(s)]})})},e.prototype.models=function(e){return void 0===e?this._conversationsModels:(void 0===this.individualConversationModels[e]&&(this.individualConversationModels[e]=new a.default(e,this.apiCall)),this.individualConversationModels[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return s},enumerable:!1,configurable:!0}),e}();t.default=o},1746(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get("/debug")]})})},e}();t.default=i},1128(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Document=void 0;var r=n(5866),i=r.__importDefault(n(2884)),a=r.__importDefault(n(1447)),s=function(){function e(e,t,n){this.collectionName=e,this.documentId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]})})},e.prototype.update=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.patch(this.endpointPath(),e,t)]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(a.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.documentId))},e}();t.Document=s},1447(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=n(8209),a=n(6265),s="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,o=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return r.__extends(t,e),t.prototype.create=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,t)]})})},t.prototype.upsert=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"upsert"}))]})})},t.prototype.update=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){if(!e)throw new Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),e,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"update"}))]})})},t.prototype.delete=function(e){return void 0===e&&(e={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]})})},t.prototype.createMany=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(e,t)]})})},t.prototype.import=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){var n,a,o,c,u;return r.__generator(this,function(l){switch(l.label){case 0:if(n=r.__assign({throwOnFail:!0},t),Array.isArray(e)){if(0===e.length)throw new i.RequestMalformed("No documents provided");try{a=e.map(function(e){return JSON.stringify(e)}).join("\n")}catch(d){if(d instanceof RangeError&&d.message.includes("Too many properties to enumerate"))throw new Error("".concat(d,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));throw new Error(d)}}else if(null==(h=a=e)||""===h||0===h.length)throw new i.RequestMalformed("No documents provided");return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:a,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!s})];case 1:if(o=l.sent(),Array.isArray(e)){if(c=o.split("\n").map(function(e){return JSON.parse(e)}),(u=c.filter(function(e){return!1===e.success})).length>0&&n.throwOnFail)throw new i.ImportError("".concat(c.length-u.length," documents imported successfully, ").concat(u.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),c,{documentsInJSONLFormat:a,options:n,failedItems:u,successCount:c.length-u.length});return[2,c]}return[2,o]}var h})})},t.prototype.importStream=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){var n,a,o,c;return r.__generator(this,function(u){switch(u.label){case 0:return n=r.__assign({throwOnFail:!0},t),[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:e,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!s})];case 1:if(a=u.sent(),o=a.split("\n").map(function(e){return JSON.parse(e)}),(c=o.filter(function(e){return!1===e.success})).length>0&&n.throwOnFail)throw new i.ImportError("".concat(o.length-c.length," documents imported successfully, ").concat(c.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),o,{documentsInJSONLFormat:e,options:n,failedItems:c,successCount:o.length-c.length});return[2,o]}})})}
1,t.prototype.export=function(e){return void 0===e&&(e={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.get(this.endpointPath("export"),e)]})})},t.prototype.exportStream=function(e){return void 0===e&&(e={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.get(this.endpointPath("export"),e,{responseType:"stream"})]})})},t}(a.SearchOnlyDocuments);t.default=o},6123(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},636(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.importResults=n,i.payload=r,i}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},4909(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},3128(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},4565(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},2684(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},7671(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},8494(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},2554(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(6857)).default);t.default=i},6857(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(e){function t(t,n,r){var i=this.constructor,a=e.call(this,t)||this;return a.name=i.name,a.httpBody=n,a.httpStatus=r,Object.setPrototypeOf(a,i.prototype),a}return r.__extends(t,e),t}(Error);t.default=i},8209(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImportError=t.TypesenseError=t.ServerError=t.RequestUnauthorized=t.RequestMalformed=t.ObjectUnprocessable=t.ObjectNotFound=t.ObjectAlreadyExists=t.MissingConfigurationError=t.HTTPError=void 0;var r=n(5866),i=r.__importDefault(n(6123));t.HTTPError=i.default;var a=r.__importDefault(n(4909));t.MissingConfigurationError=a.default;var s=r.__importDefault(n(3128));t.ObjectAlreadyExists=s.default;var o=r.__importDefault(n(4565));t.ObjectNotFound=o.default;var c=r.__importDefault(n(2684));t.ObjectUnprocessable=c.default;var u=r.__importDefault(n(7671));t.RequestMalformed=u.default;var l=r.__importDefault(n(8494));t.RequestUnauthorized=l.default;var h=r.__importDefault(n(2554));t.ServerError=h.default;var d=r.__importDefault(n(636));t.ImportError=d.default;var f=r.__importDefault(n(6857));t.TypesenseError=f.default},6611(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get("/health")]})})},e}();t.default=i},4910(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(3813)),a=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=a},3813(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=n(6740),a=n(3720),s="/keys",o=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.post(e.RESOURCEPATH,t)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(s)]})})},e.prototype.generateScopedSearchKey=function(e,t){var n=(0,a.normalizeArrayableParams)(t),r=JSON.stringify(n),s=Buffer.from((0,i.createHmac)("sha256",e).update(r).digest("base64")),o=e.substr(0,4),c="".concat(s).concat(o).concat(r);return Buffer.from(c).toString("base64")},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return s},enumerable:!1,configurable:!0}),e}();t.default=o},264(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get("/metrics.json")]})})},e}();t.default=i},6092(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(6316)),a=n(3720),s=function(){function e(e,t,n){void 0===n&&(n=!1),this.apiCall=e,this.configuration=t,this.useTextContentType=n,this.requestWithCache=new i.default}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.perform=function(e,t,n){return r.__awaiter(this,void 0,void 0,function(){var i,s,o,c,u;return r.__generator(this,function(l){return i=t?r.__assign({},t):{},!0===this.configuration.useServerSideSearchCache&&(i.use_cache=!0),s={union:e.union,searches:e.searches.map(a.normalizeArrayableParams)},o=i.streamConfig,c=r.__rest(i,["streamConfig"]),u=(0,a.normalizeArrayableParams)(c),[2,this.requestWithCache.perform(this.apiCall,"post",{path:"/multi_search",body:s,queryParams:u,headers:this.useTextContentType?{"content-type":"text/plain"}:{}
1,streamConfig:o,abortSignal:null==n?void 0:n.abortSignal,isStreamingRequest:this.isStreamingRequest(i)},void 0!==(null==n?void 0:n.cacheSearchResultsForSeconds)?{cacheResponseForSeconds:n.cacheSearchResultsForSeconds}:void 0)]})})},e.prototype.isStreamingRequest=function(e){return void 0!==e.streamConfig},e}();t.default=s},3478(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(2429)),a=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.put(this.endpointPath(),e)]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=a},2429(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.apiCall.post(this.endpointPath(),e)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(){return e.RESOURCEPATH},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/nl_search_models"},enumerable:!1,configurable:!0}),e}();t.default=i},7215(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e}return e.prototype.perform=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.post("".concat("/operations","/").concat(e),{},t)]})})},e}();t.default=i},8905(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(2884)),a=r.__importDefault(n(6172)),s=function(){function e(e,t,n){this.collectionName=e,this.overrideId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(a.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.overrideId))},e}();t.default=s},6172(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(2884)),a=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(t){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),e}();t.default=a},9918(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(965)),a=function(){function e(e,t){this.presetId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.presetId))},e}();t.default=a}
1,965(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=n(3720),a=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,function(){var n,a;return r.__generator(this,function(r){return"object"==typeof t.value&&"searches"in t.value?(n=t.value.searches.map(function(e){return(0,i.normalizeArrayableParams)(e)}),[2,this.apiCall.put(this.endpointPath(e),{value:{searches:n}})]):(a=(0,i.normalizeArrayableParams)(t.value),[2,this.apiCall.put(this.endpointPath(e),{value:a})])})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),e}();t.default=a},6316(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(){this.responseCache=new Map,this.responsePromiseCache=new Map}return e.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},e.prototype.perform=function(e,t,n,i){return r.__awaiter(this,void 0,void 0,function(){var a,s,o,c,u,l,h,d,f,p,m,v,g,y,_,R,b,P,C,F,w;return r.__generator(this,function(r){switch(r.label){case 0:if(s=(a=i||{}).cacheResponseForSeconds,o=void 0===s?120:s,c=a.maxSize,u=void 0===c?100:c,l=void 0===i||o<=0||u<=0,h=n.path,d=n.queryParams,f=n.body,p=n.headers,m=n.streamConfig,v=n.abortSignal,g=n.responseType,y=n.isStreamingRequest,l)return[2,this.executeRequest(e,t,h,d,f,p,{abortSignal:v,responseType:g,streamConfig:m,isStreamingRequest:y})];if(_=JSON.stringify(n),R=this.responseCache.get(_),b=Date.now(),R){if(b-R.requestTimestamp<1e3*o)return this.responseCache.delete(_),this.responseCache.set(_,R),[2,R.response];this.responseCache.delete(_)}if(P=this.responsePromiseCache.get(_)){if(b-P.requestTimestamp<1e3*o)return this.responsePromiseCache.delete(_),this.responsePromiseCache.set(_,P),[2,P.responsePromise];this.responsePromiseCache.delete(_)}return C=this.executeRequest(e,t,h,d,f,p,{abortSignal:v,responseType:g,streamConfig:m,isStreamingRequest:y}),this.responsePromiseCache.set(_,{requestTimestamp:b,responsePromise:C}),[4,C];case 1:return F=r.sent(),this.responseCache.set(_,{requestTimestamp:b,response:F}),this.responseCache.size>u&&(w=this.responseCache.keys().next().value)&&this.responseCache.delete(w),this.responsePromiseCache.size>u&&(w=this.responsePromiseCache.keys().next().value)&&this.responsePromiseCache.delete(w),[2,F]}})})},e.prototype.executeRequest=function(e,t,n,r,i,a,s){void 0===r&&(r={});var o=e[t];switch(t){case"get":return o.call(e,n,r,{abortSignal:null==s?void 0:s.abortSignal,responseType:null==s?void 0:s.responseType,streamConfig:null==s?void 0:s.streamConfig,isStreamingRequest:null==s?void 0:s.isStreamingRequest});case"delete":return o.call(e,n,r);case"post":return o.call(e,n,i,r,a||{},{abortSignal:null==s?void 0:s.abortSignal,responseType:null==s?void 0:s.responseType,streamConfig:null==s?void 0:s.streamConfig,isStreamingRequest:null==s?void 0:s.isStreamingRequest});case"put":case"patch":return o.call(e,n,i,r);default:throw new Error("Unsupported method: ".concat(String(t)))}},e}();t.default=i},6750(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(3323)),a=r.__importDefault(n(9817)),s=r.__importDefault(n(6092)),o=n(843),c=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null===(t=e.sendApiKeyAsQueryParam)||void 0===t||t,!0===e.sendApiKeyAsQueryParam&&(e.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),e.sendApiKeyAsQueryParam=!1),this.configuration=new i.default(e),this.apiCall=new a.default(this.configuration),this.multiSearch=new s.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return e.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEac
1h(function(e){e[0];e[1].documents().clearCache()})},e.prototype.collections=function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new o.SearchOnlyCollection(e,this.apiCall,this.configuration)),this.individualCollections[e];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},e}();t.default=c},843(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyCollection=void 0;var r=n(6265),i=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this._documents=new r.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return e.prototype.documents=function(){return this._documents},e}();t.SearchOnlyCollection=i},6265(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyDocuments=void 0;var r=n(5866),i=r.__importDefault(n(6316)),a=r.__importDefault(n(2884)),s=n(3720),o="/documents",c=function(){function e(e,t,n){this.collectionName=e,this.apiCall=t,this.configuration=n,this.requestWithCache=new i.default}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.search=function(e,t){var n=void 0===t?{}:t,i=n.cacheSearchResultsForSeconds,a=void 0===i?this.configuration.cacheSearchResultsForSeconds:i,o=n.abortSignal,c=void 0===o?null:o;return r.__awaiter(this,void 0,void 0,function(){var t,n,i,o,u,l;return r.__generator(this,function(h){return t={},!0===this.configuration.useServerSideSearchCache&&(t.use_cache=!0),n=(0,s.normalizeArrayableParams)(e),i=n.streamConfig,o=r.__rest(n,["streamConfig"]),u=r.__assign(r.__assign({},t),o),l=!0===u.conversation_stream,[2,this.requestWithCache.perform(this.apiCall,"get",{path:this.endpointPath("search"),queryParams:u,streamConfig:i,abortSignal:c,isStreamingRequest:l},{cacheResponseForSeconds:a})]})})},e.prototype.endpointPath=function(e){return"".concat(a.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o).concat(void 0===e?"":"/"+e)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return o},enumerable:!1,configurable:!0}),e}();t.SearchOnlyDocuments=c},6198(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get("/stats.json")]})})},e}();t.default=i},5121(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(4357)),a=r.__importDefault(n(6909)),s=function(){function e(e){this.apiCall=e,this.individualStemmingDictionaries={},this.apiCall=e,this._stemmingDictionaries=new i.default(this.apiCall)}return e.prototype.dictionaries=function(e){return void 0===e?this._stemmingDictionaries:(void 0===this.individualStemmingDictionaries[e]&&(this.individualStemmingDictionaries[e]=new a.default(e,this.apiCall)),this.individualStemmingDictionaries[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming"},enumerable:!1,configurable:!0}),e}();t.default=s},4357(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,function(){var n,i;return r.__generator(this,function(r){switch(r.label){case 0:return n=Array.isArray(t)?t.map(function(e){return JSON.stringify(e)}).join("\n"):t,[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:{id:e},bodyParameters:n,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:return i=r.sent(),[2,Array.isArray(t)?i.split("\n").map(function(e){return JSON.parse(e)}):i]}})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(t){return void 0===t?"".concat(e.RESOURCEPATH):"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming/dictionaries"}
1,enumerable:!1,configurable:!0}),e}();t.default=i},6909(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(4357)),a=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=a},213(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(6928)),a=function(){function e(e,t){this.stopwordId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.stopwordId))},e}();t.default=a},6928(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),e}();t.default=i},2880(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(2884)),a=r.__importDefault(n(111)),s=function(){function e(e,t,n){this.collectionName=e,this.synonymId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.delete(this.endpointPath())]})})},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(a.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymId))},e}();t.default=s},111(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5866),i=r.__importDefault(n(2884)),a=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]})})},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.apiCall.get(this.endpointPath())]})})},e.prototype.endpointPath=function(t){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),e}();t.default=a},9428(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayableParams=void 0,t.arrayableParams={query_by:"query_by",query_by_weights:"query_by_weights",facet_by:"facet_by",group_by:"group_by",include_fields:"include_fields",exclude_fields:"exclude_fields",highlight_fields:"highlight_fields",highlight_full_fields:"highlight_full_fields",pinned_hits:"pinned_hits",hidden_hits:"hidden_hits",infix:"infix",override_tags:"override_tags",num_typos:"num_typos",prefix:"prefix",sort_by:"sort_by"}},3720(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.toErrorWithMessage=t.normalizeArrayableParams=void 0;var r=n(5866),i=n(9428);function a(e){return Object.keys(i.arrayableParams).filter(function(t){return void 0!==e[t]}).every(function(t){return n=e[t],!Array.isArray(n);var n})}t.normalizeArrayableParams=function(e){var t=r.__assign({},e);if(!Object.keys(i.arrayableParams).filter(function(e){return Array.isArray(t[e])}).map(function(e){return t[e]=t[e].join(","),e}).length&&a(t))return t;if(!a(t))throw new Error("Failed to normalize arrayable params: ".concat(JSON.stringify(t)));return t},t.toErrorWithMessage=function(e){if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return"string"==typeof e?new Error(e):new Error(JSON.stringify(e))}catch(n){return new Error(String(e))}}},4032(e){function t(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var s=e.apply(n,r);function o(e){t(s,i,a,o,c,"next",e)}function c(e){t(s,i,a,o,c,"throw",e)}o(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},2800(e,t,n){var r=n(1092);e.exports=function(e,t){if(null==e)return{};var n,i,a=r(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.__esModule=!0,e.exports.default=e.exports},1092(e){e.exports=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.exports.__esModule=!0,e.exports.default=e.exports}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.