1var Nn=Object.defineProperty;var $n=(e,t,r)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ae=(e,t,r)=>$n(e,typeof t!="symbol"?t+"":t,r);import{g as vr,r as T,a as Dn,R as C}from"./index-BJXKT1MV.js";import{q as Ot}from"./index-BC-CY9FK.js";import{s as Wn}from"./index-mUq3626T.js";import{e as ge}from"./utils-BQ1LWcQ9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"818024d729f87bbd540c77bc2ba4ef8ff6487be6"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7c9f2530-8c32-4efc-a78f-48ef3dbfae07",e._sentryDebugIdIdentifier="sentry-dbid-7c9f2530-8c32-4efc-a78f-48ef3dbfae07")}catch{}})();var st="7.41.0";function Un(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Un(e,i,r[i])})}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){w(e,i,r[i])})}return e}function Ln(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}function H(e,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ln(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function B(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var yt=B;B.prototype._events=void 0;B.prototype._maxListeners=void 0;B.defaultMaxListeners=10;B.prototype.setMaxListeners=function(e){if(!kn(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this};B.prototype.emit=function(e){var t,r,n,i,a,o;if(this._events||(this._events={}),e==="error"&&(!this._events.error||Ne(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(r=this._events[e],pr(r))return!1;if(le(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(Ne(r))for(i=Array.prototype.slice.call(arguments,1),o=r.slice(),n=o.length,a=0;a<n;a++)o[a].apply(this,i);return!0};B.prototype.addListener=function(e,t){var r;if(!le(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,le(t.listener)?t.listener:t),this._events[e]?Ne(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Ne(this._events[e])&&!this._events[e].warned&&(pr(this._maxListeners)?r=B.defaultMaxListeners:r=this._maxListeners,r&&r>0&&this._events[e].length>r&&(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),typeof console.trace=="function"&&console.trace())),this};B.prototype.on=B.prototype.addListener;B.prototype.once=function(e,t){if(!le(t))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}return n.listener=t,this.on(e,n),this};B.prototype.removeListener=function(e,t){var r,n,i,a;if(!le(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],i=r.length,n=-1,r===t||le(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit
1("removeListener",e,t);else if(Ne(r)){for(a=i;a-- >0;)if(r[a]===t||r[a].listener&&r[a].listener===t){n=a;break}if(n<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this};B.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(t in this._events)t!=="removeListener"&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],le(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this};B.prototype.listeners=function(e){var t;return!this._events||!this._events[e]?t=[]:le(this._events[e])?t=[this._events[e]]:t=this._events[e].slice(),t};B.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(le(t))return 1;if(t)return t.length}return 0};B.listenerCount=function(e,t){return e.listenerCount(t)};function le(e){return typeof e=="function"}function kn(e){return typeof e=="number"}function Ne(e){return typeof e=="object"&&e!==null}function pr(e){return e===void 0}const Qn=vr(yt);function Mn(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}var yr=Mn,qn=yt,Bn=yr;function De(e,t,r){this.main=e,this.fn=t,this.recommendFn=r,this.lastResults=null,this.lastRecommendResults=null}Bn(De,qn);De.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)};De.prototype.getModifiedState=function(e){return this.fn(e)};De.prototype.getModifiedRecommendState=function(e){return this.recommendFn(e)};var Vn=De;function zn(e){return typeof e!="string"?e:String(e).replace(/^-/,"\\-")}function Jn(e){return typeof e!="string"?e:e.replace(/^\\-/,"-")}var Rt={escapeFacetValue:zn,unescapeFacetValue:Jn};function Kn(e){return typeof e=="object"&&e!==null?_t(Array.isArray(e)?[]:{},e):e}function Qe(e){return typeof e=="function"||Array.isArray(e)||Object.prototype.toString.call(e)==="[object Object]"}function _t(e,t){if(e===t)return e;for(var r in t)if(!(!Object.prototype.hasOwnProperty.call(t,r)||r==="__proto__"||r==="constructor")){var n=t[r],i=e[r];typeof i<"u"&&typeof n>"u"||(Qe(i)&&Qe(n)?e[r]=_t(i,n):e[r]=Kn(n))}return e}function Gn(e){Qe(e)||(e={});for(var t=1,r=arguments.length;t<r;t++){var n=arguments[t];Qe(n)&&_t(e,n)}return e}var St=Gn;function Yn(e){return e&&Object.keys(e).length>0}var bt=Yn;function Xn(e,t){if(e===null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var Ft=Xn;function Te(e){e=e||{},this.params=e.params||[]}Te.prototype={constructor:Te,addParams:function(e){var t=this.params.slice();return t.push(e),new Te({params:t})},removeParams:function(e){return new Te({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(r){return t[r.$$id]===void 0}).map(function(r){var n=Object.assign({},r,{indexName:e,threshold:r.threshold||0});return delete n.$$id,n})}};var Rr=Te;function ot(e,t){this._state=e,this._rawResults={};var r=this;e.params.forEach(function(n){var i=n.$$id;r[i]=t[i],r._rawResults[i]=t[i]})}ot.prototype={constructor:ot};var _r=ot,Le=St;function ke(e){return Object.keys(e).sort().reduce(function(t,r){return t[r]=e[r],t},{})}var Q={_getQueries:function(t,r){var n=[];return n.push({indexName:t,params:Q._getHitsSearchParams(r)}
1),r.getRefinedDisjunctiveFacets().forEach(function(i){n.push({indexName:t,params:Q._getDisjunctiveFacetSearchParams(r,i)})}),r.getRefinedHierarchicalFacets().forEach(function(i){var a=r.getHierarchicalFacetByName(i),o=r.getHierarchicalRefinement(i),s=r._getHierarchicalFacetSeparator(a);if(o.length>0&&o[0].split(s).length>1){var c=o[0].split(s).slice(0,-1).reduce(function(f,l,d){return f.concat({attribute:a.attributes[d],value:d===0?l:[f[f.length-1].value,l].join(s)})},[]);c.forEach(function(u,f){var l=Q._getDisjunctiveFacetSearchParams(r,u.attribute,f===0);function d(p){return a.attributes.some(function(_){return _===p.split(":")[0]})}var h=(l.facetFilters||[]).reduce(function(p,_){if(Array.isArray(_)){var v=_.filter(function(g){return!d(g)});v.length>0&&p.push(v)}return typeof _=="string"&&!d(_)&&p.push(_),p},[]),m=c[f-1];f>0?l.facetFilters=h.concat(m.attribute+":"+m.value):h.length>0?l.facetFilters=h:delete l.facetFilters,n.push({indexName:t,params:l})})}}),n},_getCompositionQueries:function(t){return[{compositionID:t.index,requestBody:{params:Q._getCompositionHitsSearchParams(t)}}]},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(Q._getHitsHierarchicalFacetsAttributes(e)).sort(),r=Q._getFacetFilters(e),n=Q._getNumericFilters(e),i=Q._getTagFilters(e),a={};return t.length>0&&(a.facets=t.indexOf("*")>-1?["*"]:t),i.length>0&&(a.tagFilters=i),r.length>0&&(a.facetFilters=r),n.length>0&&(a.numericFilters=n),ke(Le({},e.getQueryParams(),a))},_getCompositionHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets.map(function(s){return e.disjunctiveFacetsRefinements&&e.disjunctiveFacetsRefinements[s]&&e.disjunctiveFacetsRefinements[s].length>0?"disjunctive("+s+")":s})).concat(Q._getHitsHierarchicalFacetsAttributes(e)).sort(),r=Q._getFacetFilters(e),n=Q._getNumericFilters(e),i=Q._getTagFilters(e),a={};t.length>0&&(a.facets=t.indexOf("*")>-1?["*"]:t),i.length>0&&(a.tagFilters=i),r.length>0&&(a.facetFilters=r),n.length>0&&(a.numericFilters=n);var o=e.getQueryParams();return delete o.highlightPreTag,delete o.highlightPostTag,delete o.index,ke(Le({},o,a))},_getDisjunctiveFacetSearchParams:function(e,t,r){var n=Q._getFacetFilters(e,t,r),i=Q._getNumericFilters(e,t),a=Q._getTagFilters(e),o={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};a.length>0&&(o.tagFilters=a);var s=e.getHierarchicalFacetByName(t);return s?o.facets=Q._getDisjunctiveHierarchicalFacetAttribute(e,s,r):o.facets=t,i.length>0&&(o.numericFilters=i),n.length>0&&(o.facetFilters=n),ke(Le({},e.getQueryParams(),o))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach(function(n){var i=e.numericRefinements[n]||{};
1Object.keys(i).forEach(function(a){var o=i[a]||[];t!==n&&o.forEach(function(s){if(Array.isArray(s)){var c=s.map(function(u){return n+a+u});r.push(c)}else r.push(n+a+s)})})}),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach(function(c){var u=i[c]||[];u.slice().sort().forEach(function(f){n.push(c+":"+f)})});var a=e.facetsExcludes||{};Object.keys(a).sort().forEach(function(c){var u=a[c]||[];u.sort().forEach(function(f){n.push(c+":-"+f)})});var o=e.disjunctiveFacetsRefinements||{};Object.keys(o).sort().forEach(function(c){var u=o[c]||[];if(!(c===t||!u||u.length===0)){var f=[];u.slice().sort().forEach(function(l){f.push(c+":"+l)}),n.push(f)}});var s=e.hierarchicalFacetsRefinements||{};return Object.keys(s).sort().forEach(function(c){var u=s[c]||[],f=u[0];if(f!==void 0){var l=e.getHierarchicalFacetByName(c),d=e._getHierarchicalFacetSeparator(l),h=e._getHierarchicalRootPath(l),m,p;if(t===c){if(f.indexOf(d)===-1||!h&&r===!0||h&&h.split(d).length===f.split(d).length)return;h?(p=h.split(d).length-1,f=h):(p=f.split(d).length-2,f=f.slice(0,f.lastIndexOf(d))),m=l.attributes[p]}else p=f.split(d).length-1,m=l.attributes[p];m&&n.push([m+":"+f])}}),n},_getHitsHierarchicalFacetsAttributes:function(e){var t=[];return e.hierarchicalFacets.reduce(function(n,i){var a=e.getHierarchicalRefinement(i.name)[0];if(!a)return n.push(i.attributes[0]),n;var o=e._getHierarchicalFacetSeparator(i),s=a.split(o).length,c=i.attributes.slice(0,s+1);return n.concat(c)},t)},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(r===!0){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var o=e.getHierarchicalRefinement(t.name)[0]||"",s=o.split(n).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,r,n){var i=n.isDisjunctiveFacet(e)?n.clearRefinements(e):n,a={facetQuery:t,facetName:e};return typeof r=="number"&&(a.maxFacetHits=r),ke(Le({},Q._getHitsSearchParams(i),a))}},Zn=Q,wt=function(){var t=Array.prototype.slice.call(arguments);return t.reduceRight(function(r,n){return Object.keys(Object(n)).forEach(function(i){n[i]!==void 0&&(r[i]!==void 0&&delete r[i],r[i]=n[i])}),r},{})},We=function(t,r){if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(r(t[n]))return t[n]}};function ei(e,t){return e.filter(function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n})}var ti=ei;function Sr(e){if(typeof e=="number")return e;if(typeof e=="string")return parseFloat(e);if(Array.isArray(e))return e.map(Sr);throw new Error("The value should be a number, a parsable string or an array of those.")}var ri=Sr,ni=function(t){return t===null?!1:/^[a-zA-Z0-9_-]{1,64}$/.test(t)},ii=wt,ai=bt,si=Ft,ve={addRefinement:function(t,r,n){if(ve.isRefined(t,r,n))return t;var i=""+n,a=t[r]?t[r].concat(i):[i],o={};return o[r]=a,ii(o,t)},removeRefinement:function(t,r,n){if(n===void 0)return ve.clearRefinement(t,function(a,o){return r===o});var i=""+n;return ve.clearRefinement(t,function(a,o){return r===o&&i===a})},toggleRefinement:function(t,r,n){if(n===void 0)throw new Error("toggleRefinement should be used with a value");return ve.isRefined(t,r,n)?ve.removeRefinement(t,r,n):ve.addRefinement(t,r,n)},clearRefinement:function(t,r,n){if(r===void 0)return ai(t)?{}:t;if(typeof r=="string")return si(t,[r]);if(typeof r=="function"){var i=!1,a=Object.keys(t).reduce(function(o,s){var c=t[s]||[],u=c.filter(function(f){return!r(f,s,n)});return u.length!==c.length&&(i=!0),o[s]=u,o},{});return i?a:t}},isRefined:function(t,r,n){var i=!!t[r]&&t[r].length>0;if(n===void 0||!i)return i;var a=""+n;return t[r].indexOf(a)!==-1}},oi=ve,Ge=wt,br=We,It=ti,ct=St,ut=bt,At=Ft,Ye=ri,ci=ni,L=oi;function Pt(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(function(r,n){return Pt(t[n],r)}):e===t}function ui(e,t){return br(e,function(r){return Pt(r,t)})}function G(e){var t=e?G._parseNumbers(e):{};t.userToken!==void 0&&!ci(t.userToken)&&console.warn("[algoliasearch-helper] The `userToken` parameter is invali
1d. 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 r=this;Object.keys(t).forEach(function(n){var i=G.PARAMETERS.indexOf(n)!==-1,a=t[n]!==void 0;!i&&a&&(r[n]=t[n])})}G.PARAMETERS=Object.keys(new G);function Xe(e){var t=parseFloat(e);return isFinite(t)?t:null}G._parseNumbers=function(e){if(e instanceof G)return e;var t={},r=["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"];if(r.forEach(function(i){var a=e[i];if(typeof a=="string"){var o=parseFloat(a);isNaN(o)?t[i]=a:isFinite(o)?t[i]=o:t[i]=null}else typeof a=="number"&&!isFinite(a)&&(t[i]=null)}),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map(function(i){return Array.isArray(i)?i.map(function(a){return typeof a=="string"?Xe(a):typeof a=="number"&&!isFinite(a)?null:a}):i})),e.numericRefinements){var n={};Object.keys(e.numericRefinements).forEach(function(i){var a=e.numericRefinements[i]||{};n[i]={},Object.keys(a).forEach(function(o){var s=a[o],c=s.map(function(u){return Array.isArray(u)?u.map(function(f){return typeof f=="string"?Xe(f):typeof f=="number"&&!isFinite(f)?null:f}):typeof u=="string"?Xe(u):typeof u=="number"&&!isFinite(u)?null:u});n[i][o]=c})}),t.numericRefinements=n}return ct(e,t)};G.make=function(t){var r=new G(t),n=t.hierarchicalFacets||[];return n.forEach(function(i){if(i.rootPath){var a=r.getHierarchicalRefinement(i.name);a.length>0&&a[0].indexOf(i.rootPath)!==0&&(r=r.clearRefinements(i.name)),a=r.getHierarchicalRefinement(i.name),a.length===0&&(r=r.toggleHierarchicalFacetRefinement(i.name,i.rootPath))}}),r};G.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.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&&r.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&&r.numericRefinements&&ut(r.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."):ut(e.numericRefinements)&&r.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};G.prototype={constructor:G,clearRefinements:function(t){var r={numericRefinements:this._clearNumericRefinements(t),facetsRefinements:L.clearRefinement(this.facetsRefinements,t,"conjunctiveFacet"),facetsExcludes:L.clearRefinement(this.facetsExcludes,t,"exclude"),disjunctiveFacetsRefinements:L.clearRefinement(this.disjunctiveFacetsRefinements,t,"disjunctiveFacet"),hierarchicalFacetsRefinements:L.clearRefinement(this.hierarchicalFacetsRefinements,t,"hierarchicalFacet")};return r.numericRefinements===this.numericRefinements&&r.facetsRefinements===this.facetsRefinements&&r.facetsExcludes===this.facetsExcludes&&r.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&r.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(r)},clearTags:function(){return this.tagFilters===void 0&&this.tagRefinements.length===0?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(t){return t===this.index?this:this.setQueryParameters({index:t})},setQuery:function(t){return t===this.query?this:this.setQueryParameters({query:t})},setPage:function(t){return t===this.page?this:this.setQueryParameters({page:t})},setFacets:function(t){return this.setQueryParameters({facets:t})},setDisjunctiveFacets:function(t){return this.setQueryParameters({disjunctiveFacets:t})},setHitsPerPage:function(t){return this.hitsPerPage===t?this:this.setQueryParameters({hitsPerPage:t})},setTypoTolerance:function(t){return this.typoTolerance===t?this:this.setQueryParameters({typoTolerance:t})},addNumericRefinement:function(e,t,r){var n=Ye(r);if(this.isNumericRefined(e,t,n))return this;var i=ct({},this.numericRefinements);return i[e]=ct({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(n)):i[e][t]=[n],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,r){var n=r;return n!==void 0?this.isNumericRefined(e,t,n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(i,a){return a===e&&i.op===t&&Pt(i.val,Ye(n))})}):this:t!==void 0?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(i,a){return a===e&&i.op===t})}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(i,a){return a===e})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(t){if(t===void 0)return ut(this.numericRefinements)?{}:this.numericRefinements;if(typeof t=="string")return At(this.numericRefinements,[t]);if(typeof t=="function"){var r=!1,n=this.numericRefinements,i=Object.keys(n).reduce(function(a,o){var s=n[o],c={};return s=s||{}
1,Object.keys(s).forEach(function(u){var f=s[u]||[],l=[];f.forEach(function(d){var h=t({val:d,op:u},o,"numeric");h||l.push(d)}),l.length!==f.length&&(r=!0),c[u]=l}),a[o]=c,a},{});return r?i:this.numericRefinements}},addFacet:function(t){return this.isConjunctiveFacet(t)?this:this.setQueryParameters({facets:this.facets.concat([t])})},addDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([t])})},addHierarchicalFacet:function(t){if(this.isHierarchicalFacet(t.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+t.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([t])})},addFacetRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return L.isRefined(this.facetsRefinements,t,r)?this:this.setQueryParameters({facetsRefinements:L.addRefinement(this.facetsRefinements,t,r)})},addExcludeRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return L.isRefined(this.facetsExcludes,t,r)?this:this.setQueryParameters({facetsExcludes:L.addRefinement(this.facetsExcludes,t,r)})},addDisjunctiveFacetRefinement:function(t,r){if(!this.isDisjunctiveFacet(t))throw new Error(t+" is not defined in the disjunctiveFacets attribute of the helper configuration");return L.isRefined(this.disjunctiveFacetsRefinements,t,r)?this:this.setQueryParameters({disjunctiveFacetsRefinements:L.addRefinement(this.disjunctiveFacetsRefinements,t,r)})},addTagRefinement:function(t){if(this.isTagRefined(t))return this;var r={tagRefinements:this.tagRefinements.concat(t)};return this.setQueryParameters(r)},removeFacet:function(t){return this.isConjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({facets:this.facets.filter(function(r){return r!==t})}):this},removeDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(r){return r!==t})}):this},removeHierarchicalFacet:function(t){return this.isHierarchicalFacet(t)?this.clearRefinements(t).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(r){return r.name!==t})}):this},removeFacetRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return L.isRefined(this.facetsRefinements,t,r)?this.setQueryParameters({facetsRefinements:L.removeRefinement(this.facetsRefinements,t,r)}):this},removeExcludeRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return L.isRefined(this.facetsExcludes,t,r)?this.setQueryParameters({facetsExcludes:L.removeRefinement(this.facetsExcludes,t,r)}):this},removeDisjunctiveFacetRefinement:function(t,r){if(!this.isDisjunctiveFacet(t))throw new Error(t+" is not defined in the disjunctiveFacets attribute of the helper configuration");return L.isRefined(this.disjunctiveFacetsRefinements,t,r)?this.setQueryParameters({disjunctiveFacetsRefinements:L.removeRefinement(this.disjunctiveFacetsRefinements,t,r)}):this},removeTagRefinement:function(t){if(!this.isTagRefined(t))return this;var r={tagRefinements:this.tagRefinements.filter(function(n){return n!==t})};return this.setQueryParameters(r)},toggleRefinement:function(t,r){return this.toggleFacetRefinement(t,r)},toggleFacetRefinement:function(t,r){if(this.isHierarchicalFacet(t))return this.toggleHierarchicalFacetRefinement(t,r);if(this.isConjunctiveFacet(t))return this.toggleConjunctiveFacetRefinement(t,r);if(this.isDisjunctiveFacet(t))return this.toggleDisjunctiveFacetRefinement(t,r);throw new Error("Cannot refine the undeclared facet "+t+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:L.toggleRefinement(this.facetsRefinements,t,r)})},toggleExcludeFacetRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:L.toggleRefinement(this.facetsExcludes,t,r)})},toggleDisjunctiveFacetRefinement:function(t,r){if(!this.isDisjunctiveFacet(t))throw new Error(t+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:L.toggleRefinement(this.disjunctiveFacetsRefinements,t,r)})},toggleHierarchicalFacetRefinement:function(t,r){if(!this.isHierarchicalFacet(t))throw new Error(t+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(t)),i={},a=this.hierarchicalFacetsRefinements[t]!==void 0&&this.hierarchicalFacetsRefinements[t].length>0&&(this.hierarchicalFacetsRefinements[t][0]===r||this.hierarchicalFacetsRefinements[t][0].indexOf(r+n)===0);return a?r.indexOf(n)===-1?i[t]=[]:i[t]=[r.slice(0,r.lastIndexOf(n))]:i[t]=[r],this.setQueryParameters({hierarchicalFacetsRefinements:Ge(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 r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:Ge(r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:Ge(t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(t){return this.isTagRefined(t)?this.removeTagRefinement(t):this.addTagRefinement(t)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return this.getHierarchicalFacetByName(e)!==void 0},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(t,r){return this.isConjunctiveFacet(t)?L.isRefined(this.facetsRefinements,t,r):!1},isExcludeRefined:function(t,r){return this.isConjunctiveFacet(t)?L.isRefined(this.facetsExcludes,t,r):!1},isDisjunctiveFacetRefined:function(t,r){return this.isDisjunctiveFacet(t)?L.isRefined(this.disjunctiveFacetsRefinements,t,r):!1},isHierarchicalFacetRefined:function(t,r){if(!this.isHierarchicalFacet(t))return!1;var n=this.getHierarchicalRefinement(t);return r?n.indexOf(r)!==-1:n.length>0},isNumericRefined:function(t,r,n){if(n===void 0&&r===void 0)return!!this.numericRefinements[t];var i=this.numericRefinements[t]&&this.numericRefinements[t][r]!==void 0;if(n===void 0||!i)return i;var a=Ye(n),o=ui(this.numericRefinements[t][r],a)!==void 0;return i&&o},isTagRefined:function(t){return this.tagRefinements.indexOf(t)!==-1},getRefinedDisjunctiveFacets:function(){var t=this,r=It(Object.keys(this.numericRefinements).filter(function(n){return Object.keys(t.numericRefinements[n]).length>0}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(n){return t.disjunctiveFacetsRefinements[n].length>0}).concat(r).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var t=this;return It(this.hierarchicalFacets.map(function(r){return r.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(r){return t.hierarchicalFacetsRefinements[r].length>0})).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(t){return e.indexOf(t)===-1})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var t=this.managedParameters,r={},n=this;
1return Object.keys(this).forEach(function(i){var a=n[i];t.indexOf(i)===-1&&a!==void 0&&(r[i]=a)}),r},setQueryParameter:function(t,r){if(this[t]===r)return this;var n={};return n[t]=r,this.setQueryParameters(n)},setQueryParameters:function(t){if(!t)return this;var r=G.validate(this,t);if(r)throw r;var n=this,i=G._parseNumbers(t),a=Object.keys(this).reduce(function(s,c){return s[c]=n[c],s},{}),o=Object.keys(i).reduce(function(s,c){var u=s[c]!==void 0,f=i[c]!==void 0;return u&&!f?At(s,[c]):(f&&(s[c]=i[c]),s)},a);return new this.constructor(o)},resetPage:function(){return this.page===void 0?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 typeof e.showParentLevel=="boolean"?e.showParentLevel:!0},getHierarchicalFacetByName:function(e){return br(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 r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),n=t.split(r);return n.map(function(i){return i.trim()})},toString:function(){return JSON.stringify(this,null,2)}};var Fr=G,li=function(t){return Array.isArray(t)?t.filter(Boolean):[]},fi=function(t,r){if(!Array.isArray(t))return-1;for(var n=0;n<t.length;n++)if(r(t[n]))return n;return-1},hi=We,wr=function(t,r){var n=(r||[]).map(function(i){return i.split(":")});return t.reduce(function(a,o){var s=o.split(":"),c=hi(n,function(u){return u[0]===s[0]});return s.length>1||!c?(a[0].push(s[0]),a[1].push(s[1]),a):(a[0].push(c[0]),a[1].push(c[1]),a)},[[],[]])};function di(){var e=Array.prototype.slice.call(arguments);return e.reduceRight(function(t,r){return Object.keys(Object(r)).forEach(function(n){var i=typeof t[n]=="number"?t[n]:0,a=r[n];a!==void 0&&a>=i&&(t[n]!==void 0&&delete t[n],t[n]=a)}),t},{})}var mi=di;function gi(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=t!==void 0,a=t===null;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e<t||a&&r||!i)return-1}return 0}function vi(e,t,r){if(!Array.isArray(e))return[];Array.isArray(r)||(r=[]);var n=e.map(function(i,a){return{criteria:t.map(function(o){return i[o]}),index:a,value:i}});return n.sort(function(a,o){for(var s=-1;++s<a.criteria.length;){var c=gi(a.criteria[s],o.criteria[s]);if(c)return s>=r.length?c:r[s]==="desc"?-c:c}return a.index-o.index}),n.map(function(i){return i.value})}var Pr=vi,pi=Fi,xr=Rt,yi=We,Ri=wr,_i=Pr,Si=xr.escapeFacetValue,bi=xr.unescapeFacetValue;function Fi(e){return function(r,n){var i=e.hierarchicalFacets[n],a=e.hierarchicalFacetsRefinements[i.name]&&e.hierarchicalFacetsRefinements[i.name][0]||"",o=e._getHierarchicalFacetSeparator(i),s=e._getHierarchicalRootPath(i),c=e._getHierarchicalShowParentLevel(i),u=Ri(e._getHierarchicalFacetSortBy(i)),f=r.every(function(h){return h.exhaustive}),l=wi(u,o,s,c,a),d=r;return s&&(d=r.slice(s.split(o).length)),d.reduce(l,{name:e.hierarchicalFacets[n].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:f,data:null})}}function wi(e,t,r,n,i){return function(o,s,c){var u=o;if(c>0){var f=0;for(u=o;f<c;){var l=u&&Array.isArray(u.data)?u.data:[];u=yi(l,function(h){return h.isRefined}),f++}}if(u){var d=Object.keys(s.data).map(function(h){return[h,s.data[h]]}).filter(function(h){var m=h[0];return Pi(m,u.path||r,i,t,r,n)});u.data=_i(d.map(function(h){var m=h[0],p=h[1];return xi(p,m,t,bi(i),s.exhaustive)}),e[0],e[1])}return o}}function Pi(e,t,r,n,i,a){return i&&(e.indexOf(i)!==0||i===e)?!1:!i&&e.indexOf(n)===-1||i&&e.split(n).length-i.split(n).length===1||e.indexOf(n)===-1&&r.indexOf(n)===-1||r.indexOf(e)===0||e.indexOf(t+n)===0&&(a||e.indexOf(r)===0)}function xi(e,t,r,n,i){var a=t.split(r);return{name:a[a.length-1].trim(),path:t,escapedValue:Si(t),count:e,isRefined:n===t||n.indexOf(t+r)===0,exhaustive:i,data:null}}var Ze=li,Ie=wt,Er=Rt,ne=We,Pe=fi,Ei=wr,Ct=mi,jr=Pr,Ht=Er.escapeFacetValue,Tr=Er.unescapeFacetValue,ji=pi;function Nt(e){var t={};return e.forEach(function(r,n){t[r]=n}),t}function et(e,t,r){t&&t[r]&&(e.stats=t[r])}function Ti(e,t){return ne(e,function(n){var i=n.attributes||[];return i.indexOf(t)>-1})}function de(e,t,r){var n=t[0]||{};this._rawResults=t;var i=this;
1Object.keys(n).forEach(function(l){i[l]=n[l]});var a=Ie(r,{persistHierarchicalRootCount:!1});Object.keys(a).forEach(function(l){i[l]=a[l]}),this.processingTimeMS=t.reduce(function(l,d){return d.processingTimeMS===void 0?l:l+d.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map(function(){return[]}),this.facets=[];var o=e.getRefinedDisjunctiveFacets(),s=Nt(e.facets),c=Nt(e.disjunctiveFacets),u=1,f=n.facets||{};Object.keys(f).forEach(function(l){var d=f[l],h=Ti(e.hierarchicalFacets,l);if(h){var m=h.attributes.indexOf(l),p=Pe(e.hierarchicalFacets,function(S){return S.name===h.name});i.hierarchicalFacets[p][m]={attribute:l,data:d,exhaustive:n.exhaustiveFacetsCount}}else{var _=e.disjunctiveFacets.indexOf(l)!==-1,v=e.facets.indexOf(l)!==-1,g;_&&(g=c[l],i.disjunctiveFacets[g]={name:l,data:d,exhaustive:n.exhaustiveFacetsCount},et(i.disjunctiveFacets[g],n.facets_stats,l)),v&&(g=s[l],i.facets[g]={name:l,data:d,exhaustive:n.exhaustiveFacetsCount},et(i.facets[g],n.facets_stats,l))}}),this.hierarchicalFacets=Ze(this.hierarchicalFacets),o.forEach(function(l){var d=t[u],h=d&&d.facets?d.facets:{},m=e.getHierarchicalFacetByName(l);Object.keys(h).forEach(function(p){var _=h[p],v;if(m){v=Pe(e.hierarchicalFacets,function(y){return y.name===m.name});var g=Pe(i.hierarchicalFacets[v],function(y){return y.attribute===p});if(g===-1)return;i.hierarchicalFacets[v][g].data=i.persistHierarchicalRootCount?Ct(i.hierarchicalFacets[v][g].data,_):Ie(_,i.hierarchicalFacets[v][g].data)}else{v=c[p];var S=n.facets&&n.facets[p]||{};i.disjunctiveFacets[v]={name:p,data:Ct(S,_),exhaustive:d.exhaustiveFacetsCount},et(i.disjunctiveFacets[v],d.facets_stats,p),e.disjunctiveFacetsRefinements[p]&&e.disjunctiveFacetsRefinements[p].forEach(function(y){!i.disjunctiveFacets[v].data[y]&&e.disjunctiveFacetsRefinements[p].indexOf(Tr(y))>-1&&(i.disjunctiveFacets[v].data[y]=0)})}}),u++}),e.getRefinedHierarchicalFacets().forEach(function(l){var d=e.getHierarchicalFacetByName(l),h=e._getHierarchicalFacetSeparator(d),m=e.getHierarchicalRefinement(l);m.length===0||m[0].split(h).length<2||t.slice(u).forEach(function(p){var _=p&&p.facets?p.facets:{};Object.keys(_).forEach(function(v){var g=_[v],S=Pe(e.hierarchicalFacets,function(b){return b.name===d.name}),y=Pe(i.hierarchicalFacets[S],function(b){return b.attribute===v});if(y!==-1){var P={};if(m.length>0&&!i.persistHierarchicalRootCount){var F=m[0].split(h)[0];P[F]=i.hierarchicalFacets[S][y].data[F]}i.hierarchicalFacets[S][y].data=Ie(P,g,i.hierarchicalFacets[S][y].data)}}),u++})}),Object.keys(e.facetsExcludes).forEach(function(l){var d=e.facetsExcludes[l],h=s[l];i.facets[h]={name:l,data:f[l],exhaustive:n.exhaustiveFacetsCount},d.forEach(function(m){i.facets[h]=i.facets[h]||{name:l},i.facets[h].data=i.facets[h].data||{},i.facets[h].data[m]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(ji(e)),this.facets=Ze(this.facets),this.disjunctiveFacets=Ze(this.disjunctiveFacets),this._state=e}de.prototype.getFacetByName=function(e){function t(r){return r.name===e}return ne(this.facets,t)||ne(this.disjunctiveFacets,t)||ne(this.hierarchicalFacets,t)};function Oi(e,t){function r(f){return f.name===t}if(e._state.isConjunctiveFacet(t)){var n=ne(e.facets,r);return n?Object.keys(n.data).map(function(f){var l=Ht(f);return{name:f,escapedValue:l,count:n.data[f],isRefined:e._state.isFacetRefined(t,l),isExcluded:e._state.isExcludeRefined(t,f)}}):[]}else if(e._state.isDisjunctiveFacet(t)){var i=ne(e.disjunctiveFacets,r);return i?Object.keys(i.data).map(function(f){var l=Ht(f);return{name:f,escapedValue:l,count:i.data[f],isRefined:e._state.isDisjunctiveFacetRefined(t,l)}}):[]}else if(e._state.isHierarchicalFacet(t)){var a=ne(e.hierarchicalFacets,r);if(!a)return a;var o=e._state.getHierarchicalFacetByName(t),s=e._state._getHierarchicalFacetSeparator(o),c=Tr(e._state.getHierarchicalRefinement(t)[0]||"");c.indexOf(o.rootPath)===0&&(c=c.replace(o.rootPath+s,""));var u=c.split(s);return u.unshift(t),Or(a,u,0),a}}function Or(e,t,r){e.isRefined=e.name===(t[r]&&t[r].trim()),e.data&&e.data.forEach(function(n){Or(n,t,r+1)})}function Ir(e,t,r,n){if(n=n||0,Array.isArray(t))return e(t,r[n]);if(!t.data||t.data.length===0)return t;var i=t.data.map(function(s){return Ir(e,s,r,n+1)}),a=e(i,r[n]),o=Ie({data:a},t);return o}
1de.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"];function Ii(e,t){return t.sort(e)}function Ai(e,t){var r=[],n=[],i=t.hide||[],a=t.order||[],o=a.reduce(function(u,f,l){return u[f]=l,u},{});e.forEach(function(u){var f=u.path||u.name,l=i.indexOf(f)>-1;!l&&o[f]!==void 0?r[o[f]]=u:l||n.push(u)}),r=r.filter(function(u){return u});var s=t.sortRemainingBy,c;return s==="hidden"?r:(s==="alpha"?c=[["path","name"],["asc","asc"]]:c=[["count"],["desc"]],r.concat(jr(n,c[0],c[1])))}function Ci(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}de.prototype.getFacetValues=function(e,t){var r=Oi(this,e);if(r){var n=Ie(t,{sortBy:de.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),i=this,a;if(Array.isArray(r))a=[e];else{var o=i._state.getHierarchicalFacetByName(r.name);a=o.attributes}return Ir(function(s,c){var u=Ci(i,c);if(n.facetOrdering&&u)return Ai(s,u);if(Array.isArray(n.sortBy)){var f=Ei(n.sortBy,de.DEFAULT_SORT),l=jr(s,f[0],f[1]),d=u&&u.hide?u.hide:[];if(d.length>0){var h=[];return l.forEach(function(m){var p=m.path||m.name;d.indexOf(p)===-1&&h.push(m)}),h}return l}else if(typeof n.sortBy=="function")return Ii(n.sortBy,s);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},r,a)}};de.prototype.getFacetStats=function(e){if(this._state.isConjunctiveFacet(e))return $t(this.facets,e);if(this._state.isDisjunctiveFacet(e))return $t(this.disjunctiveFacets,e)};function $t(e,t){var r=ne(e,function(n){return n.name===t});return r&&r.stats}de.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach(function(n){e.facetsRefinements[n].forEac
1h(function(i){r.push(tt(e,"facet",n,i,t.facets))})}),Object.keys(e.facetsExcludes).forEach(function(n){e.facetsExcludes[n].forEach(function(i){r.push(tt(e,"exclude",n,i,t.facets))})}),Object.keys(e.disjunctiveFacetsRefinements).forEach(function(n){e.disjunctiveFacetsRefinements[n].forEach(function(i){r.push(tt(e,"disjunctive",n,i,t.disjunctiveFacets))})}),Object.keys(e.hierarchicalFacetsRefinements).forEach(function(n){e.hierarchicalFacetsRefinements[n].forEach(function(i){r.push(Hi(e,n,i,t.hierarchicalFacets))})}),Object.keys(e.numericRefinements).forEach(function(n){var i=e.numericRefinements[n];Object.keys(i).forEach(function(a){i[a].forEach(function(o){r.push({type:"numeric",attributeName:n,name:o,numericValue:o,operator:a})})})}),e.tagRefinements.forEach(function(n){r.push({type:"tag",attributeName:"_tags",name:n})}),r};function tt(e,t,r,n,i){var a=ne(i,function(c){return c.name===r}),o=a&&a.data&&a.data[n]?a.data[n]:0,s=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:o,exhaustive:s}}function Hi(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),o=r.split(a),s=ne(n,function(d){return d.name===t}),c=o.reduce(function(d,h){var m=d&&ne(d.data,function(p){return p.name===h});return m!==void 0?m:d},s),u=c&&c.count||0,f=c&&c.exhaustive||!1,l=c&&c.path||"";return{type:"hierarchical",attributeName:t,name:l,count:u,exhaustive:f}}var Ar=de,Ni=function(t){return t.reduce(function(r,n){return r.concat(n)},[])},$i=We,Di=Ni;function Wi(e,t){var r=[];return Object.keys(e).forEach(function(n){e[n].count<2&&(e[n].indexSum+=100),r.push({objectID:n,avgOfIndices:e[n].indexSum/t})}),r.sort(function(n,i){return n.avgOfIndices>i.avgOfIndices?1:-1})}function Ui(e,t){var r={};t.forEach(function(a){a.forEach(function(o,s){e.includes(o.objectID)||(r[o.objectID]?r[o.objectID]={indexSum:r[o.objectID].indexSum+s,count:r[o.objectID].count+1}:r[o.objectID]={indexSum:s,count:1})})});var n=Wi(r,t.length),i=n.reduce(function(a,o){var s=$i(Di(t),function(c){return c.objectID===o.objectID});return s?a.concat(s):a},[]);return i}var Li=Ui,Cr="3.29.2",ki=yt,Qi=Vn,Hr=Rt.escapeFacetValue,Mi=yr,qi=St,Bi=bt,Vi=Ft,Nr=Rr,zi=_r,me=Zn,xt=Fr,Ae=Ar,Ji=Li,$r=Cr;function R(e,t,r,n){typeof e.addAlgoliaAgent=="function"&&e.addAlgoliaAgent("JS Helper ("+$r+")"),this.setClient(e);var i=r||{};i.index=t,this.state=xt.make(i),this.recommendState=new Nr({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=n,this._recommendCache={}}Mi(R,ki);R.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this};R.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this};R.prototype.searchWithComposition=function(){return this._runComposition({onlyWithDerivedHelpers:!0}),this};R.prototype.recommend=function(){return this._recommend(),this};R.prototype.getQuery=function(){var e=this.state;return me._getHitsSearchParams(e)};R.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=me._getQueries(r.index,r),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),t){this.client.search(n).then(function(a){i._currentNbQueries--,i._currentNbQueries===0&&i.emit("searchQueueEmpty"),t(null,new Ae(r,a.results),r)}).catch(function(a){i._currentNbQueries--,i._currentNbQueries===0&&i.emit("searchQueueEmpty"),t(a,null,r)});return}return this.client.search(n).then(function(a){return i._currentNbQueries--,i._currentNbQueries===0&&i.emit("searchQueueEmpty"),{content:new Ae(r,a.results),state:r,_originalResponse:a}},function(a){throw i._currentNbQueries--,i._currentNbQueries===0&&i.emit("searchQueueEmpty"),a})};R.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,r=this.derivedHelpers[0];if(!r)return Promise.resolve([]);var n=r.getModifiedState(t),i=qi({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:Vi(me._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if(typeof this.client.initIndex!="function")throw new Error(a);var o=this.client.initIndex(n.index);if(typeof o.findAnswers!="function")throw new Error(a);return o.findAnswers(n.query,e.queryLanguages,i)};R.prototype.searchForFacetValues=function(e,t,r,n){var i=typeof this.client.searchForFacetValues=="function"&&typeof this.client.searchForFacets!="function",a=typeof this.client.initIndex=="function";if(!i&&!a&&typeof this.client.search!="function")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(n||{}),s=o.isDisjunctiveFacet(e),c=me.getSearchForFacetQuery(e,t,r,o);this._currentNbQueries++;var u=this,f;i?f=this.client.searchForFacetValues([{indexName:o.index,params:c}]):a?f=this.client.initIndex(o.index).searchForFacetValues(c):(delete c.facetName,f=this.client.search([{type:"facet",facet:e,indexName:o.index,params:c}]).then(function(h){return h.results[0]}
1)),this.emit("searchForFacetValues",{state:o,facet:e,query:t});var l=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 f.then(function(h){return u._currentNbQueries--,u._currentNbQueries===0&&u.emit("searchQueueEmpty"),h=Array.isArray(h)?h[0]:h,h.facetHits=h.facetHits.reduce(function(m,p){return l.indexOf(p.value)>-1||(p.escapedValue=Hr(p.value),p.isRefined=s?o.isDisjunctiveFacetRefined(e,p.escapedValue):o.isFacetRefined(e,p.escapedValue),m.push(p)),m},[]),h},function(d){throw u._currentNbQueries--,u._currentNbQueries===0&&u.emit("searchQueueEmpty"),d})};R.prototype.searchForCompositionFacetValues=function(e,t,r,n){if(typeof this.client.searchForFacetValues!="function")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(n||{}),a=i.isDisjunctiveFacet(e);this._currentNbQueries++;var o=this,s;return s=this.client.searchForFacetValues({compositionID:i.index,facetName:e,searchForFacetValuesRequest:{params:{query:t,maxFacetHits:r,searchQuery:me._getCompositionHitsSearchParams(i)}}}),this.emit("searchForFacetValues",{state:i,facet:e,query:t}),s.then(function(u){return o._currentNbQueries--,o._currentNbQueries===0&&o.emit("searchQueueEmpty"),u=u.results[0],u.facetHits.forEach(function(f){f.escapedValue=Hr(f.value),f.isRefined=a?i.isDisjunctiveFacetRefined(e,f.escapedValue):i.isFacetRefined(e,f.escapedValue)}),u},function(c){throw o._currentNbQueries--,o._currentNbQueries===0&&o.emit("searchQueueEmpty"),c})};R.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this};R.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this};R.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this};R.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this};R.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)};R.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this};R.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this};R.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this};R.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)};R.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this};R.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)};R.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this};R.prototype.addFrequentlyBoughtTogether=function(e){return this._recommendChange({state:this.recommendState.addFrequentlyBoughtTogether(e)}),this};R.prototype.addRelatedProducts=function(e){return this._recommendChange({state:this.recommendState.addRelatedProducts(e)}),this};R.prototype.addTrendingItems=function(e){return this._recommendChange({state:this.recommendState.addTrendingItems(e)}),this};R.prototype.addTrendingFacets=function(e){return this._recommendChange({state:this.recommendState.addTrendingFacets(e)}),this};R.prototype.addLookingSimilar=function(e){return this._recommendChange({state:this.recommendState.addLookingSimilar(e)}),this};R.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this};R.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this};R.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)};R.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this};R.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this};R.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)};R.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this};R.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)};R.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this};R.prototype.removeFrequentlyBoughtTogether=function(e){return this._recommendChange({state:this.recommendState.removeParam
1s(e)}),this};R.prototype.removeRelatedProducts=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this};R.prototype.removeTrendingItems=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this};R.prototype.removeTrendingFacets=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this};R.prototype.removeLookingSimilar=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this};R.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this};R.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)};R.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)};R.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this};R.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)};R.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this};R.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)};R.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)};function Dr(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}R.prototype.setCurrentPage=Dr;R.prototype.setPage=Dr;R.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this};R.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this};R.prototype.setState=function(e){return this._change({state:xt.make(e),isPageReset:!1}),this};R.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new xt(e),this};R.prototype.hasRefinements=function(e){return Bi(this.state.getNumericRefinements(e))?!0:this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):this.state.isHierarchicalFacet(e)?this.state.isHierarchicalFacetRefined(e):!1}
1;R.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)};R.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)};R.prototype.hasTag=function(e){return this.state.isTagRefined(e)};R.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)};R.prototype.getIndex=function(){return this.state.index};function Wr(){return this.state.page}R.prototype.getCurrentPage=Wr;R.prototype.getPage=Wr;R.prototype.getTags=function(){return this.state.tagRefinements};R.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e)){var r=this.state.getConjunctiveRefinements(e);r.forEach(function(o){t.push({value:o,type:"conjunctive"})});var n=this.state.getExcludeRefinements(e);n.forEach(function(o){t.push({value:o,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(e)){var i=this.state.getDisjunctiveRefinements(e);i.forEach(function(o){t.push({value:o,type:"disjunctive"})})}var a=this.state.getNumericRefinements(e);return Object.keys(a).forEach(function(o){var s=a[o];t.push({value:s,operator:o,type:"numeric"})}),t};R.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)};R.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)};R.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=me._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map(function(s){var c=s.getModifiedState(t),u=c.index?me._getQueries(c.index,c):[];return r.push({state:c,queriesCount:u.length,helper:s}),s.emit("search",{state:c,results:s.lastResults}),u}),a=Array.prototype.concat.apply(n,i),o=this._queryId++;if(this._currentNbQueries++,!a.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,r,o));try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,o)).catch(this._dispatchAlgoliaError.bind(this,o))}catch(s){this.emit("error",{error:s})}};R.prototype._runComposition=function(){var e=this.state,t=[],r=[],n=this.derivedHelpers.map(function(s){var c=s.getModifiedState(e),u=me._getCompositionQueries(c);return t.push({state:c,helper:s}),s.emit("search",{state:c,results:s.lastResults}),u}),i=Array.prototype.concat.apply(r,n),a=this._queryId++;if(this._currentNbQueries++,!i.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,t,a));if(i.length>1)throw new Error("Only one query is allowed when using a composition.");var o=i[0];try{this.client.search(o).then(this._dispatchAlgoliaResponse.bind(this,t,a)).catch(this._dispatchAlgoliaError.bind(this,a))}catch(s){this.emit("error",{error:s})}};R.prototype._recommend=function(){var e=this.state,t=this.recommendState,r=this.getIndex(),n=[{state:t,index:r,helper:this}],i=t.params.map(function(u){return u.$$id});this.emit("fetch",{recommend:{state:t,results:this.lastRecommendResults}});var a=this._recommendCache,o=this.derivedHelpers.map(function(u){var f=u.getModifiedState(e).index;if(!f)return[];var l=u.getModifiedRecommendState(new Nr);return n.push({state:l,index:f,helper:u}),i=Array.prototype.concat.apply(i,l.params.map(function(d){return d.$$id})),u.emit("fetch",{recommend:{state:l,results:u.lastRecommendResults}}),l._buildQueries(f,a)}),s=Array.prototype.concat.apply(this.recommendState._buildQueries(r,a),o);if(s.length!==0){if(s.length>0&&typeof this.client.getRecommendations>"u"){console.warn("Please update algoliasearch/lite to the latest version in order to use recommend widgets.");return}var c=this._recommendQueryId++;this._currentNbRecommendQueries++;try{this.client.getRecommendations(s).then(this._dispatchRecommendResponse.bind(this,c,n,i)).catch(this._dispatchRecommendError.bind(this,c))}catch(u){this.emit("error",{error:u})}}};R.prototype._dispatchAlgoliaResponse=function(e,t,r){var n=this;if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,this._currentNbQueries===0&&this.emit
1("searchQueueEmpty");var i=r.results.slice(),a=Object.keys(r).reduce(function(o,s){return s!=="results"&&(o[s]=r[s]),o},{});Object.keys(a).length<=0&&(a=void 0),e.forEach(function(o){var s=o.state,c=o.queriesCount,u=o.helper,f=c!==void 0?i.splice(0,c):i;if(!s.index){u.emit("result",{results:null,state:s});return}if(f.length>0&&f[0].feedID){var l=f.map(function(d){var h=new Ae(s,[d],n._searchResultsOptions);return a!==void 0&&(h._rawContent=a),h});u.lastResults=new Ae(s,[f[0]],n._searchResultsOptions),u.lastResults.feeds=l,a!==void 0&&(u.lastResults._rawContent=a)}else u.lastResults=new Ae(s,f,n._searchResultsOptions),a!==void 0&&(u.lastResults._rawContent=a);u.emit("result",{results:u.lastResults,state:s})})}};R.prototype._dispatchRecommendResponse=function(e,t,r,n){if(!(e<this._lastRecommendQueryIdReceived)){this._currentNbRecommendQueries-=e-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=e,this._currentNbRecommendQueries===0&&this.emit("recommendQueueEmpty");var i=this._recommendCache,a={};r.filter(function(s){return i[s]===void 0}).forEach(function(s,c){a[s]||(a[s]=[]),a[s].push(c)}),Object.keys(a).forEach(function(s){var c=a[s],u=n.results[c[0]];if(c.length===1){i[s]=u;return}i[s]=Object.assign({},u,{hits:Ji(r,c.map(function(f){return n.results[f].hits}))})});var o={};r.forEach(function(s){o[s]=i[s]}),t.forEach(function(s){var c=s.state,u=s.helper;if(!s.index){u.emit("recommend:result",{results:null,state:c});return}u.lastRecommendResults=new zi(c,o),u.emit("recommend:result",{recommend:{results:u.lastRecommendResults,state:c}})})}};R.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),this._currentNbQueries===0&&this.emit("searchQueueEmpty"))};R.prototype._dispatchRecommendError=function(e,t){e<this._lastRecommendQueryIdReceived||(this._currentNbRecommendQueries-=e-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=e,this.emit("error",{error:t}),this._currentNbRecommendQueries===0&&this.emit("recommendQueueEmpty"))};R.prototype.containsRefinement=function(e,t,r,n){return e||t.length!==0||r.length!==0||n.length!==0};R.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0};R.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))};R.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}}))};R.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this};R.prototype.setClient=function(e){return this.client===e?this:(typeof e.addAlgoliaAgent=="function"&&e.addAlgoliaAgent("JS Helper ("+$r+")"),this.client=e,this)};R.prototype.getClient=function(){return this.client};R.prototype.derive=function(e,t){var r=new Qi(this,e,t);return this.derivedHelpers.push(r),r};R.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(t===-1)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)};R.prototype.hasPendingRequests=function(){return this._currentNbQueries>0};var Ki=R,Ur=Ki,Gi=Rr,Yi=_r,Xi=Fr,Zi=Ar;function ye(e,t,r,n){return new Ur(e,t,r,n)}ye.version=Cr;ye.AlgoliaSearchHelper=Ur;ye.SearchParameters=Xi;ye.RecommendParameters=Gi;ye.SearchResults=Zi;ye.RecommendResults=Yi;var ea=ye;const M=vr(ea);function Re(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function ta(e){return e===null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function ra(e){return(typeof e>"u"?"undefined":Re(e))==="object"&&e!==null}function Lr(e){if(!ra(e)||ta(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function na(e){var t=e.name,r=e.connector,n=r===void 0?!1:r;return["https://www.algolia.com/doc/api-reference/widgets/",t,"/js/",n?"#connector":""].join("")}function Ve(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map(function(i){return na(i)}).join(", ");return function(i){return[i,"See documentation: ".concat(n)].filter(
1Boolean).join(` 2 3`)}}function ia(e,t){if(e==null)return{};var r={},n=Object.getOwnPropertyNames(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}function ze(e,t){if(e==null)return{};var r={},n,i,a;if(typeof Reflect<"u"&&Reflect.ownKeys){for(n=Reflect.ownKeys(e),a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}if(r=ia(e,t),Object.getOwnPropertySymbols)for(n=Object.getOwnPropertySymbols(e),a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}function aa(e,t){if(!Array.isArray(e))return-1;for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1}function sa(e){return e.filter(function(t,r,n){return n.indexOf(t)===r})}var oa=function(t,r){r.facets,r.disjunctiveFacets,r.facetsRefinements,r.facetsExcludes,r.disjunctiveFacetsRefinements,r.numericRefinements,r.tagRefinements,r.hierarchicalFacets,r.hierarchicalFacetsRefinements,r.ruleContexts;var n=ze(r,["facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements","ruleContexts"]);return t.setQueryParameters(n)},ca=function(t,r){return r.facets.reduce(function(n,i){return n.addFacet(i)},t)},ua=function(t,r){return r.disjunctiveFacets.reduce(function(n,i){return n.addDisjunctiveFacet(i)},t)},la=function(t,r){return t.setQueryParameters({hierarchicalFacets:r.hierarchicalFacets.reduce(function(n,i){var a=aa(n,function(s){return s.name===i.name});if(a===-1)return n.concat(i);var o=n.slice();return o.splice(a,1,i),o},t.hierarchicalFacets)})},fa=function(t,r){return r.tagRefinements.reduce(function(n,i){return n.addTagRefinement(i)},t)},ha=function(t,r){return t.setQueryParameters({facetsRefinements:x({},t.facetsRefinements,r.facetsRefinements)})},da=function(t,r){return t.setQueryParameters({facetsExcludes:x({},t.facetsExcludes,r.facetsExcludes)})},ma=function(t,r){return t.setQueryParameters({disjunctiveFacetsRefinements:x({},t.disjunctiveFacetsRefinements,r.disjunctiveFacetsRefinements)})},ga=function(t,r){return t.setQueryParameters({numericRefinements:x({},t.numericRefinements,r.numericRefinements)})},va=function(t,r){return t.setQueryParameters({hierarchicalFacetsRefinements:x({},t.hierarchicalFacetsRefinements,r.hierarchicalFacetsRefinements)})},pa=function(t,r){var n=sa([].concat(t.ruleContexts).concat(r.ruleContexts).filter(Boolean));return n.length>0?t.setQueryParameters({ruleContexts:n}):t},Ce=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce(function(i,a){var o=va(i,a),s=la(o,a),c=fa(s,a),u=ga(c,a),f=ma(u,a),l=da(f,a),d=ha(l,a),h=ua(d,a),m=pa(h,a),p=ca(m,a);return oa(p,a)})};function te(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r]}var ya=Ve({name:"configure",connector:!0});function Dt(e,t){return e.setQueryParameters(Object.keys(t.searchParameters).reduce(function(r,n){return H(x({},r),w({},n,void 0))},{}))}var Ra=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:te,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te;return function(n){if(!n||!Lr(n.searchParameters))throw new Error(ya("The `searchParameters` option expects an object."));var i={};function a(o){return function(s){var c=Dt(o.state,n),u=Ce(c,new M.SearchParameters(s));n.searchParameters=s,o.setState(u).search()}}return{$$type:"ais.configure",init:function(s){var c=s.instantSearchInstance;t(H(x({},this.getWidgetRenderState(s)),{instantSearchInstance:c}),!0)},render:function(s){var c=s.instantSearchInstance;t(H(x({},this.getWidgetRenderState(s)),{instantSearchInstance:c}),!1)},dispose:function(s){var c=s.state;return r(),Dt(c,n)},getRenderState:function(s,c){var u,f=this.getWidgetRenderState(c);return H(x({},s),{configure:H(x({},f),{widgetParams:H(x({},f.widgetParams),{searchParameters:Ce(new M.SearchParameters((u=s.configure)===null||u===void 0?void 0:u.widgetParams.searchParameters),new M.SearchParameters(f.widgetParams.searchParameters)).getQueryParams()})})})},getWidgetRenderState:function(s){var c=s.helper;return i.refine||(i.refine=a(c)),{refine:i.refine,widgetParams:n}},getWidgetSearchParameters:function(s,c){var u=c.uiState;return Ce(s,new M.SearchParameters(x({},u.configure,n.searchParameters)))},getWidgetUiState:function(s){return H(x({}
3,s),{configure:x({},s.configure,n.searchParameters)})}}}};function _a(e,t){if(e==null)return{};var r={},n=Object.getOwnPropertyNames(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}function He(e,t){if(e==null)return{};var r={},n,i,a;if(typeof Reflect<"u"&&Reflect.ownKeys){for(n=Reflect.ownKeys(e),a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}if(r=_a(e,t),Object.getOwnPropertySymbols)for(n=Object.getOwnPropertySymbols(e),a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}function kr(e){if(Array.isArray(e))return e}function Sa(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,s=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function Qr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Et(e,t){if(e){if(typeof e=="string")return lt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lt(e,t)}}function pe(e,t){return kr(e)||Sa(e,t)||Et(e,t)||Qr()}function Mr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ba(e){return kr(e)||Mr(e)||Et(e)||Qr()}function Fa(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var Wt=Object.prototype.hasOwnProperty;function Fe(e,t,r){if(r!=null&&r(e,t))return!0;var n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&Fe(e[i],t[i],r););return i===-1}if(!n||(typeof e>"u"?"undefined":Fa(e))==="object"){i=0;for(n in e)if(Wt.call(e,n)&&++i&&!Wt.call(t,n)||!(n in t)||!Fe(e[n],t[n],r))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}function wa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}function qr(e,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):wa(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function Ut(e){var t,r,n;return new M.SearchResults(e,[{query:(t=e.query)!==null&&t!==void 0?t:"",page:(r=e.page)!==null&&r!==void 0?r:0,hitsPerPage:(n=e.hitsPerPage)!==null&&n!==void 0?n:20,hits:[],nbHits:0,nbPages:0,params:"",exhaustiveNbHits:!0,exhaustiveFacetsCount:!0,processingTimeMS:0,index:e.index}],{__isArtificial:!0})}function ft(e){var t=e.getHelper(),r=e.getResults()||Ut(t.state),n=e.getScopedResults().map(function(i){var a=i.indexId===e.getIndexId()?r:Ut(i.helper.state);return qr($e({},i),{results:i.results||a})});return{results:r,scopedResults:n,recommendResults:t.lastRecommendResults}}var Br=T.createContext(null);function Vr(e,t){if(!e)throw new Error("Invariant failed")}function jt(){var e=T.useContext(Br);return Vr(e!==null),e}var zr=T.createContext(null);function Ue(){var e=T.useContext(zr);return Vr(e!==null),e}var Pa=T.createContext(null);function Jr(){return T.useContext(Pa)}var Kr=T.createContext(null);function Gr(){return T.useContext(Kr)}function Lt(e){var t=pe(T.useState(function(){return e}),2),r=t[0],n=t[1];return Fe(r,e)||n(e),r}var xa=0;function Ea(e){e.dependsOn==="recommend"&&(e.$$id=xa++)}function ja(e){if(Array.isArray(e))return e}function Ta(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,s=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}
4function Oa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 5In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ht(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Yr(e,t){if(e){if(typeof e=="string")return ht(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ht(e,t)}}function re(e,t){return ja(e)||Ta(e,t)||Yr(e,t)||Oa()}function Ia(e){if(Array.isArray(e))return ht(e)}function Aa(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ca(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 6In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fe(e){return Ia(e)||Aa(e)||Yr(e)||Ca()}function Ha(e){return Object.prototype.toString.call(e).slice(8,-1)}function Na(e,t){if(e===void 0||typeof e!="function")throw new Error("The render function is not valid (received type ".concat(Ha(e),`). 7 8`).concat(t))}function dt(){return dt=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},dt.apply(this,arguments)}function $a(e){if(e==null)throw new TypeError("Cannot destructure "+e);return e}var Da={"&":"&","<":"<",">":">",'"':""","'":"'"},Xr=/[&<>"']/g,Wa=RegExp(Xr.source);function Ua(e){return e&&Wa.test(e)?e.replace(Xr,function(t){return Da[t]}):e}var La={"&":"&","<":"<",">":">",""":'"',"'":"'"},Zr=/&(amp|quot|lt|gt|#39);/g,ka=RegExp(Zr.source);function Qa(e){return e&&ka.test(e)?e.replace(Zr,function(t){return La[t]}):e}var kt={highlightPreTag:"__ais-highlight__",highlightPostTag:"__/ais-highlight__"},X={highlightPreTag:"<mark>",highlightPostTag:"</mark>"};function en(e){return Ua(e).replace(new RegExp(kt.highlightPreTag,"g"),X.highlightPreTag).replace(new RegExp(kt.highlightPostTag,"g"),X.highlightPostTag)}function Me(e){return Lr(e)&&typeof e.value!="string"?Object.keys(e).reduce(function(t,r){return H(x({},t),w({},r,Me(e[r])))},{}):Array.isArray(e)?e.map(Me):H(x({},e),{value:en(e.value)})}function sc(e){return e.__escaped===void 0&&(e=e.map(function(t){$a(t);var r=dt({},t);return r._highlightResult&&(r._highlightResult=Me(r._highlightResult)),r._snippetResult&&(r._snippetResult=Me(r._snippetResult)),r}),e.__escaped=!0),e}function oc(e){return e.map(function(t){return H(x({},t),{highlighted:en(t.highlighted)})})}function tn(e){var t=X.highlightPreTag,r=X.highlightPostTag;return e.map(function(n){return n.isHighlighted?t+n.value+r:n.value}).join("")}function rn(e){return btoa(encodeURIComponent(JSON.stringify(e)))}function Ma(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,r=[],n=0;n<Math.ceil(e.length/t);n++)r.push(e.slice(n*t,(n+1)*t));return r}function nn(e){var t=e.helper,r=e.widgetType;e.methodName;var n=e.args,i=e.instantSearchInstance;if(n.length===1&&Re(n[0])==="object")return[n[0]];var a=re(n[0].split(":"),2),o=a[0],s=a[1],c=n[1],u=n[2],f=n[3]||{};if(!c)return[];if((o==="click"||o==="conversion")&&!u)return[];var l=Array.isArray(c)?c:[c];if(l.length===0)return[];var d=l[0].__queryID,h=Ma(l),m=h.map(function(_){return _.map(function(v){return v.objectID})}),p=h.map(function(_){return _.map(function(v){return v.__position})});return o==="view"?i.status!=="idle"?[]:h.map(function(_,v){var g;return{insightsMethod:"viewedObjectIDs",widgetType:r,eventType:o,payload:x({eventName:u||"Hits Viewed",index:((g=t.lastResults)===null||g===void 0?void 0:g.index)||t.state.index,objectIDs:m[v]},f),hits:_,eventModifier:s}}):o==="click"?h.map(function(_,v){var g;return{insightsMethod:"clickedObjectIDsAfterSearch",widgetType:r,eventType:o,payload:x({eventName:u||"Hit Clicked",index:((g=t.lastResults)===null||g===void 0?void 0:g.index)||t.state.index,queryID:d,objectIDs:m[v],positions:p[v]},f),hits:_,eventModifier:s}}):o==="conversion"?h.map(function(_,v){var g;return{insightsMethod:"convertedObjectIDsAfterSearch",widgetType:r,eventType:o,payload:x({eventName:u||"Hit Converted",index:((g=t.lastResults)===null||g===void 0?void 0:g.index)||t.state.index,queryID:d,objectIDs:m[v]},f),hits:_,eventModifier:s}}):[]}function cc(e){var t=e.instantSearchInstance,r=e.helper,n=e.widgetType,i={},a=void 0,o=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];var l=nn({widgetType:n,helper:r,methodName:"sendEvent",args:u,instantSearchInstance:t});l.forEach(function(d){d.eventType==="click"&&d.eventModifier==="internal"&&i[d.eventType]||(i[d.eventType]=!0,t.sendEventToInsights(d))}),clearTimeout(a),a=setTimeout(function(){i={}},0)};return o}function uc(e){var t=e.helper,r=e.widgetType,n=e.instantSearchInstance,i=function(){for(var o=arguments.length,s=new Array(o),c=0;c<o;c++)s[c]=arguments[c];var u=nn({widgetType:r,helper:t,methodName:"bindEvent",args:s,instantSearchInstance:n});return u.length?"data-insights-event=".concat(rn(u)):""};return i}var qa=["ais.index","ais.feedContainer"];function Y(e){return qa.includes(e.$$type)}function mt(e,t){var r=e[t.getIndexId()]||{};
8t.getHelper().setState(t.getWidgetSearchParameters(t.getHelper().state,{uiState:r})),t.getWidgets().filter(Y).forEach(function(n){return mt(e,n)})}var Ba=Promise.resolve();function _e(e){var t=null,r=!1,n=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];t===null&&(t=Ba.then(function(){if(t=null,r){r=!1;return}e.apply(void 0,fe(o))}))};return n.wait=function(){if(t===null)throw new Error("The deferred function should be called before calling `wait()`");return t},n.cancel=function(){t!==null&&(r=!0)},n}function Qt(e,t){for(var r,n=0;n<e.length;n++)if(r=e[n],t(r,n,e))return r}function an(e){var t=e;return t.transporter&&t.transporter.userAgent?t.transporter.userAgent.value:t._ua}function Mt(e){if(e.appId&&e.apiKey)return[e.appId,e.apiKey];if(e.transporter){var t=e.transporter,r=t.headers||t.baseHeaders,n=t.queryParameters||t.baseQueryParameters,i="x-algolia-application-id",a="x-algolia-api-key",o=r[i]||n[i],s=r[a]||n[a];return[o,s]}else return[e.applicationID,e.apiKey]}function sn(e,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function on(e){var t=X.highlightPostTag,r=X.highlightPreTag,n=e.split(r),i=n.shift(),a=i?[{value:i,isHighlighted:!1}]:[];return n.forEach(function(o){var s=o.split(t);a.push({value:s[0],isHighlighted:!0}),s[1]!==""&&a.push({value:s[1],isHighlighted:!1})}),a}var Va=new RegExp(/\w/i);function za(e,t){var r,n,i,a,o=e[t],s=(r=(i=e[t+1])===null||i===void 0?void 0:i.isHighlighted)!==null&&r!==void 0?r:!0,c=(n=(a=e[t-1])===null||a===void 0?void 0:a.isHighlighted)!==null&&n!==void 0?n:!0;return!Va.test(Qa(o.value))&&c===s?c:o.isHighlighted}function Je(e,t){var r=Array.isArray(t)?t:t.split(".");return r.reduce(function(n,i){return n&&n[i]},e)}function lc(e,t,r){return e.map(function(n,i){return H(x({},n),{__position:r*t+i+1})})}function fc(e,t){return t?e.map(function(r){return H(x({},r),{__queryID:t})}):e}function Ja(e,t){var r=Object.keys(t).reduce(function(n,i){var a=t[i];return a.recommendResults?x({},n,a.recommendResults.results):n},{});e._recommendCache=r}function rt(e){var t;return!((t=e.compositionFeedsResults)===null||t===void 0)&&t.length?e.compositionFeedsResults:e.results||[]}function Ka(e,t){if(t&&!((!("transporter"in e)||e._cacheHydrated)&&(!e._useCache||typeof e.addAlgoliaAgent!="function"))){var r=[Object.keys(t).reduce(function(o,s){var c=t[s],u=c.state,f=c.requestParams,l=rt(c),d=l&&u?l.map(function(h,m){return x({indexName:u.index||h.index},f!=null&&f[m]||h.params?{params:nt((f==null?void 0:f[m])||Ga(h.params))}:{})}):[];return o.concat(d)},[])],n=Object.keys(t).reduce(function(o,s){var c=rt(t[s]);return c?o.concat(c):o},[]);if("transporter"in e&&!e._cacheHydrated){e._cacheHydrated=!0;var i=e.search.bind(e);e.search=function(o){for(var s=arguments.length,c=new Array(s>1?s-1:0),u=1;u<s;u++)c[u-1]=arguments[u];var f=Array.isArray(o)?o.map(function(l){return H(x({},l),{params:nt(l.params)})}):nt(o.requestBody.params);return e.transporter.responsesCache.get({method:"search",args:[f].concat(fe(c))},function(){return i.apply(void 0,[o].concat(fe(c)))})},e.transporter.responsesCache.set({method:"search",args:r},{results:n})}if(!("transporter"in e)){var a="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:r}));e.cache=H(x({},e.cache),w({},a,JSON.stringify({results:Object.keys(t).map(function(o){return rt(t[o])})})))}}}function Ga(e){return e.split("&").reduce(function(t,r){var n=re(r.split("="),2),i=n[0],a=n[1];return t[i]=a?decodeURIComponent(a):"",t},{})}function nt(e){var t=function(i){return Object.prototype.toString.call(i)==="[object Object]"||Object.prototype.toString.call(i)==="[object Array]"},r=function(i){for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];var c=0;return i.replace(/%s/g,function(){return encodeURIComponent(o[c++])})};return Object.keys(e).map(function(n){return r("%s=%s",n,t(e[n])?JSON.stringify(e[n]):e[n])}).join("&")}function qt(e){return e!==Object(e)}function cn(e,t){if(e===t)return!0;if(qt(e)||qt(t)||typeof e=="function"||typeof t=="function")return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;var r=!0,n=!1,i=void 0;try{for(var a=Object.keys(e)[Symbol.iterator](),o;!(r=(o=a.next()).done);r=!0){var s=o.value;if(!(s in t)||!cn(e[s],t[s]))return!1}}catch(c){n=!0,i=c}finally{try{!r&&a.return!=null&&a.return()}finally{if(n)throw i}}return!0}function Ya(e){return e.$$type==="ais.dynamicWidgets"||e.$$type==="ais.feeds"}function Xa(e,t){return e==null?e:Object.keys(e).reduce(function(r,n){if(t.indexOf(n)>=0)return r;var i=n;return r[i]=e[i],r},{})}function Se(e,t,r){var n=t.getHelper();return{uiState:r,helper:n,parent:t,instantSearchInstance:e,state:n.state,render
8State:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,scopedResults:[],searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function Bt(e,t,r){var n=t.getResultsForWidget(r),i=t.getHelper();return{helper:i,parent:t,instantSearchInstance:e,results:n,scopedResults:t.getScopedResults(),state:n&&"_state"in n?n._state:i.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function it(e){var t=e.renderState,r=e.instantSearchInstance,n=e.parent,i=n?n.getIndexId():r.mainIndex.getIndexId();r.renderState=H(x({},r.renderState),w({},i,x({},r.renderState[i],t)))}function Za(e){if(e==null)return null;var t=typeof e>"u"?"undefined":Re(e);if(t==="string"||t==="number"||t==="boolean")return{value:String(e),type:t};if(Array.isArray(e)||t==="object"){var r=Array.isArray(e)?"array":"object";try{return{value:JSON.stringify(e),type:r}}catch{return{type:r}}}return t==="function"?{value:e.name,type:"function"}:null}function un(e){var t=[];return Object.keys(e).forEach(function(r){var n=e[r];if(n!==void 0){var i=Za(n);i?t.push(x({name:r},i)):t.push({name:r})}}),t}function ln(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.mainIndex,n=Se(t,r,t._initialUiState);return e.map(function(i){var a={};if(i.getWidgetRenderState){var o=i.getWidgetRenderState(n);o&&o.widgetParams&&(a=o.widgetParams)}var s=un(a),c=Y(i)?ln(i.getWidgets(),t,i):[];return{type:i.$$widgetType||i.$$type||"unknown",params:s,children:c}})}function fn(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t.mainIndex,i=Se(t,n,t._initialUiState);e.forEach(function(a){var o={};if(a.getWidgetRenderState){var s=a.getWidgetRenderState(i);s&&s.widgetParams&&(o=s.widgetParams)}var c=Object.keys(o).filter(function(u){return o[u]!==void 0});r.widgets.push({type:a.$$type,widgetType:a.$$widgetType,params:c}),Y(a)&&fn(a.getWidgets(),t,r,a)})}var hn=typeof performance<"u"?function(){return performance.now()}:function(){return Date.now()};function Vt(e){for(var t=e.getParent(),r=[e.getHelper().state];t!==null;)r=[t.getHelper().state].concat(r),t=t.getParent();return r}function dn(e){return e.some(function(t){return t.isHighlighted})?e.map(function(t,r){return H(x({},t),{isHighlighted:!za(e,r)})}):e.map(function(t){return H(x({},t),{isHighlighted:!1})})}function ue(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{fallback:function(){}}).fallback;return typeof window>"u"?t():e({window})}var es="use",zt=Dn[es],mn=typeof window<"u"?T.useLayoutEffect:T.useEffect,ts=T.createContext({countRef:{current:0},waitForResultsRef:null,resolveWaitForResultsRef:{current:null},ignoreMultipleHooksWarning:!1});function gn(){return T.useContext(ts)}function rs(e){var t=e.widget,r=e.parentIndex,n=e.props,i=e.shouldSsr,a=e.skipSuspense,o,s,c=gn(),u=c.waitForResultsRef,f=c.countRef;c.ignoreMultipleHooksWarning;var l=T.useRef(n);T.useEffect(function(){l.current=n},[n]);var d=T.useRef(t);T.useEffect(function(){d.current=t},[t]);var h=T.useRef(null),m=i&&!r.getWidgets().includes(t),p=Ue();if(mn(function(){var v=d.current;if(!h.current)i||r.addWidgets([t]);else{clearTimeout(h.current);var g=Fe(n,l.current);g||(r.removeWidgets([v]),r.addWidgets([t]))}return function(){h.current=setTimeout(function(){p._schedule(function(){p._preventWidgetCleanup||r.removeWidgets([v])})})}},[r,t,i,p,n]),(m||(u==null||(o=u.current)===null||o===void 0?void 0:o.status)==="pending")&&r.addWidgets([t]),u!=null&&u.current&&!a){var _;zt(u.current),!Ya(t)&&(!((_=p.helper)===null||_===void 0)&&_.lastResults)&&zt(u.current)}(u==null||(s=u.current)===null||s===void 0?void 0:s.status)==="fulfilled"&&(f.current+=1)}function vn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,n=[t,r],i=ba(n),a=i[0],o=a===void 0?{}:a,s=i.slice(1),c=pe(s,1),u=c[0],f=u===void 0?{}:u,l=f.skipSuspense,d=l===void 0?!1:l,h=He(f,["skipSuspense"]),m=Jr(),p=Gr(),_=Ue(),v=jt(),g=Lt(o),S=Lt(h),y=T.useRef(!0),P=T.useRef(null),F=T.useRef(_.status),b=T.useMemo(function(){var A=e(function(D,I){if(I){y.current=!0;return}if(y.current){var N=D.instantSearchInstance;D.widgetParams;var K=He(D,["instantSearchInstance","widgetParams"]);(!Fe(K,P.current,function(O,W){return(O==null?void 0:O.constructor)===Function&&(W==null?void 0:W.constructor)===Function})||N.status!==F.current)&&(U(K),P.current=K,F.current=N.status)}},function(){y.current=!1});return $e({},A(g),S)},[e,g,S]),E=pe(T.useState(function(){if(b.getWidgetRenderState){var A,D=v.getHelper(),I=v.getWidgetUiState({})[v.getIndexId()];D.state=((A=b.getWidgetSearchParameters)===null||A===void 0?void 0:A.call(b,D.state,{uiState:I}))||D.state;var N=ft(v),K=N.results,O=N.scopedResults,W=N.recommendResults,V=b.getWidgetRenderState({helper:D,parent:v,instantSearchInstance:_,results:b.dependsOn==="recommend"&&W&&p?W[p.recommendIdx.current++]:K,scopedResults:O,state:D.state,render
8State:_.renderState,templatesConfig:_.templatesConfig,createURL:v.createURL,searchMetadata:{isSearchStalled:_.status==="stalled"},status:_.status,error:_.error});V.widgetParams;var Z=He(V,["widgetParams"]);return Z}return{}}),2),j=E[0],U=E[1];return rs({widget:b,parentIndex:v,props:[g,S],shouldSsr:!!m,skipSuspense:d}),j}function ns(e,t){return vn(Ra,{searchParameters:e},t)}function hc(e){return ns($e({},e),{$$widgetType:"ais.configure"}),null}function is(e){if(Array.isArray(e))return lt(e)}function as(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 9In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qe(e){return is(e)||Mr(e)||Et(e)||as()}var xe=Ve({name:"index-widget"});function pn(e,t){var r=t.state,n=t.recommendState,i=t.isPageReset,a=t._uiState;r!==e.state&&(e.state=r,e.emit("change",{state:e.state,results:e.lastResults,isPageReset:i,_uiState:a})),n!==e.recommendState&&(e.recommendState=n)}function Ee(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.reduce(function(n,i){return Y(i)||!i.getWidgetUiState&&!i.getWidgetState?n:i.getWidgetUiState?i.getWidgetUiState(n,t):i.getWidgetState(n,t)},r)}function je(e,t){var r=t.initialSearchParameters,n=ze(t,["initialSearchParameters"]);return e.reduce(function(i,a){return!a.getWidgetSearchParameters||Y(a)?i:a.dependsOn==="search"&&a.getWidgetParameters?a.getWidgetParameters(i,n):a.getWidgetSearchParameters(i,n)},r)}function Jt(e,t){var r=t.initialRecommendParameters,n=ze(t,["initialRecommendParameters"]);return e.reduce(function(i,a){return!Y(a)&&a.dependsOn==="recommend"&&a.getWidgetParameters?a.getWidgetParameters(i,n):i},r)}function yn(e){var t=e.filter(Y);t.length!==0&&t.forEach(function(r){var n=r.getHelper();pn(n,{state:n.state.resetPage(),recommendState:n.recommendState,isPageReset:!0}),yn(r.getWidgets())})}function Rn(e){var t=e.filter(Y);return t.reduce(function(r,n){var i;return(i=r).concat.apply(i,[{indexId:n.getIndexId(),results:n.getResults(),helper:n.getHelper()}].concat(fe(Rn(n.getWidgets()))))},[])}function _n(e){return e.reduce(function(t,r){if(Y(r)){if(r._isolated)return t;var n=_n(r.getWidgets());return{hasSearchWidget:t.hasSearchWidget||n.hasSearchWidget,hasRecommendWidget:t.hasRecommendWidget||n.hasRecommendWidget}}return r.dependsOn==="recommend"?H(x({},t),{hasRecommendWidget:!0}):r.dependsOn==="none"?t:H(x({},t),{hasSearchWidget:!0})},{hasSearchWidget:!1,hasRecommendWidget:!1})}function ss(e){var t=_n(e.mainIndex.getWidgets()),r=t.hasSearchWidget,n=t.hasRecommendWidget;e._hasSearchWidget=r,e._hasRecommendWidget=n}var os=function(t){var r;if(t===void 0||t.indexName===void 0&&!t.isolated&&!t.EXPERIMENTAL_isolated)throw new Error(xe("The `indexName` option is required."));var n=t.indexName,i=n===void 0?"":n,a=t.indexId,o=a===void 0?i:a,s=t.isolated,c=s===void 0?(r=t.EXPERIMENTAL_isolated)!==null&&r!==void 0?r:!1:s,u=[],f={},l=null,d=null,h=null,m=null,p=null,_=function(){l&&ss(l)};return{$$type:"ais.index",$$widgetType:"ais.index",_isolated:c,getIndexName:function(){return i},getIndexId:function(){return o},getHelper:function(){return h},getResults:function(){return m!=null&&m.lastResults?(m.lastResults._state=h.state,m.lastResults):null},getResultsForWidget:function(g){return g.dependsOn!=="recommend"||Y(g)||g.$$id===void 0?this.getResults():h!=null&&h.lastRecommendResults?h.lastRecommendResults[g.$$id]:null},getPreviousState:function(){return p},getScopedResults:function(){var g=this.getParent(),S;return g?S=g.getWidgets():i.length===0?S=this.getWidgets():S=[this],Rn(S)},getParent:function(){return c?null:d},createURL:function(g){return typeof g=="function"?l._createURL(w({},o,g(f))):l._createURL(w({},o,Ee(u,{searchParameters:g,helper:h})))},scheduleLocalSearch:_e(function(){c&&(h==null||h.search())}),getWidgets:function(){return u},addWidgets:function(g){var S=this;if(!Array.isArray(g))throw new Error(xe("The `addWidgets` method expects an array of widgets."));var y=g.reduce(function(P,F){return P.concat(Array.isArray(F)?F:[F])},[]);if(y.some(function(P){return typeof P.init!="function"&&typeof P.render!="function"}))throw new Error(xe("The widget definition expects a `render` and/or an `init` method."));
9return y.forEach(function(P){P.parent=S,Y(P)||Ea(P)}),u=u.concat(y),_(),l&&y.length&&(pn(h,{state:je(u,{uiState:f,initialSearchParameters:h.state}),recommendState:Jt(u,{uiState:f,initialRecommendParameters:h.recommendState}),_uiState:f}),y.forEach(function(P){if(P.getRenderState){var F=P.getRenderState(l.renderState[S.getIndexId()]||{},Se(l,S,l._initialUiState));it({renderState:F,instantSearchInstance:l,parent:S})}}),y.forEach(function(P){P.init&&P.init(Se(l,S,l._initialUiState))}),c?this.scheduleLocalSearch():l.scheduleSearch()),this},removeWidgets:function(g){var S=this;if(!Array.isArray(g))throw new Error(xe("The `removeWidgets` method expects an array of widgets."));var y=g.reduce(function(j,U){return j.concat(Array.isArray(U)?U:[U])},[]);if(y.some(function(j){return typeof j.dispose!="function"}))throw new Error(xe("The widget definition expects a `dispose` method."));if(u=u.filter(function(j){return y.indexOf(j)===-1}),y.forEach(function(j){j.parent=void 0}),_(),l&&y.length){var P=y.reduce(function(j,U){var A=U.dispose({helper:h,state:j.cleanedSearchState,recommendState:j.cleanedRecommendState,parent:S});return sn(A,M.RecommendParameters)?j.cleanedRecommendState=A:A&&(j.cleanedSearchState=A),j},{cleanedSearchState:h.state,cleanedRecommendState:h.recommendState}),F=P.cleanedSearchState,b=P.cleanedRecommendState,E=l.future.preserveSharedStateOnUnmount?je(u,{uiState:f,initialSearchParameters:new M.SearchParameters({index:this.getIndexName()})}):je(u,{uiState:Ee(u,{searchParameters:F,helper:h}),initialSearchParameters:F});f=Ee(u,{searchParameters:E,helper:h}),h.setState(E),h.recommendState=b,u.length&&(c?this.scheduleLocalSearch():l.scheduleSearch())}return this},init:function(g){var S=this,y=g.instantSearchInstance,P=g.parent,F=g.uiState,b;if(h===null){l=y,d=P,f=F[o]||{};var E=y.mainHelper,j=je(u,{uiState:f,initialSearchParameters:new M.SearchParameters({index:i})}),U=Jt(u,{uiState:f,initialRecommendParameters:new M.RecommendParameters});h=M(E.getClient(),j.index,j),h.recommendState=U,h.search=function(){return c?(y.status="loading",S.render({instantSearchInstance:y}),y.compositionID?h.searchWithComposition():h.searchOnlyWithDerivedHelpers()):y.onStateChange?(y.onStateChange({uiState:y.mainIndex.getWidgetUiState({}),setUiState:function(W){return y.setUiState(W,!1)}}),E):E.search()},h.searchWithoutTriggeringOnStateChange=function(){return E.search()},h.searchForFacetValues=function(O,W,V,Z){var he=Ce.apply(void 0,[E.state].concat(fe(Vt(S)))).setQueryParameters(Z);return E.searchForFacetValues(O,W,V,he)};var A=i?h:M({},"__empty_index__",{}),D=c?A:cs(P,E);m=D.derive(function(){return Ce.apply(void 0,[E.state].concat(fe(Vt(S))))},function(){return S.getHelper().recommendState});var I=(b=y._initialResults)===null||b===void 0?void 0:b[this.getIndexId()];if(I!=null&&I.results){var N=new M.SearchResults(new M.SearchParameters(I.state),I.results);m.lastResults=N,h.lastResults=N}if(I!=null&&I.recommendResults){var K=new M.RecommendResults(new M.RecommendParameters({params:I.recommendResults.params}),I.recommendResults.results);m.lastRecommendResults=K,h.lastRecommendResults=K}h.on("change",function(O){var W=O.isPageReset;W&&yn(u)}),m.on("search",function(){y.scheduleStalledRender()}),m.on("result",function(O){var W=O.results;y.scheduleRender(),h.lastResults=W,p=W==null?void 0:W._state}),m.on("recommend:result",function(O){var W=O.recommend;y.scheduleRender(),h.lastRecommendResults=W.results}),u.forEach(function(O){if(O.getRenderState){var W=O.getRenderState(y.renderState[S.getIndexId()]||{},Se(y,S,F));it({renderState:W,instantSearchInstance:y,parent:S})}}),u.forEach(function(O){O.init&&O.init(Se(y,S,F))}),h.on("change",function(O){var W=O.state,V=O._uiState;f=Ee(u,{searchParameters:W,helper:h},V||{}),y.onStateChange||y.onInternalStateChange()}),I&&y.scheduleRender(),_()}},render:function(g){var S=this,y=g.instantSearchInstance;y.status==="error"&&!y.mainHelper.hasPendingRequests()&&p&&h.setState(p);var P=this.getResults()||m!=null&&m.lastRecommendResults||c&&!i?u:u.filter(function(F){return F.shouldRender});P=P.filter(function(F){return F.shouldRender?F.shouldRender({instantSearchInstance:y}):!0}),P.forEach(function(F){if(F.getRenderState){var b=F.getRenderState(y.renderState[S.getIndexId()]||{},Bt(y,S,F));
9it({renderState:b,instantSearchInstance:y,parent:S})}}),P.forEach(function(F){F.render&&F.render(Bt(y,S,F))})},dispose:function(){var g=this;u.forEach(function(S){S.dispose&&h&&S.dispose({helper:h,state:h.state,recommendState:h.recommendState,parent:g})}),l=null,d=null,h==null||h.removeAllListeners(),h=null,m==null||m.detach(),m=null},getWidgetUiState:function(g){return u.filter(Y).filter(function(S){return!S._isolated}).reduce(function(S,y){return y.getWidgetUiState(S)},H(x({},g),w({},o,x({},g[o],f))))},getWidgetState:function(g){return this.getWidgetUiState(g)},getWidgetSearchParameters:function(g,S){var y=S.uiState;return je(u,{uiState:y,initialSearchParameters:g})},shouldRender:function(){return!0},refreshUiState:function(){f=Ee(u,{searchParameters:this.getHelper().state,helper:this.getHelper()},f)},setIndexUiState:function(g){var S=typeof g=="function"?g(f):g;l.setUiState(function(y){return H(x({},y),w({},o,S))})}}};function cs(e,t){for(;e;){if(e._isolated)return e.getHelper();e=e.getParent()}return t}function us(){var e=pe(T.useReducer(function(r){return r+1},0),2),t=e[1];return t}function Be(e){return Be=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Be(e)}function Sn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Sn=function(){return!!e})()}function ls(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fs(e,t){return t&&(Re(t)==="object"||typeof t=="function")?t:ls(e)}function hs(e,t,r){return t=Be(t),fs(e,Sn()?Reflect.construct(t,[],Be(e).constructor):t.apply(e,r))}function bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ds(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Fn(e,t,r){return t&&ds(e.prototype,t),e}function gt(e,t){return gt=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},gt(e,t)}function ms(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&>(e,t)}function vt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}var wn="4.108.0",gs="_ALGOLIA";function vs(e){if(!((typeof document>"u"?"undefined":Re(document))!=="object"||typeof document.cookie!="string"))for(var t="".concat(e,"="),r=document.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}}function ps(){return vs(gs)}var Kt="ais.usage.sessionId",oe=null;function ys(){if(oe)return oe;try{var e=sessionStorage.getItem(Kt);return e?(oe=e,oe):(oe=vt(),sessionStorage.setItem(Kt,oe),oe)}catch{return oe=vt(),oe}}function Rs(e){var t=e.method,r=e.payload;if((typeof r>"u"?"undefined":Re(r))!=="object")throw new Error("The insights helper expects the payload to be an object.");var n;try{n=rn(r)}catch{throw new Error("Could not JSON serialize the payload object.")}return'data-insights-method="'.concat(t,'" data-insights-payload="').concat(n,'"')}function _s(e,t){return Rs({method:e,payload:t})}var Pn="2.17.2",Ss="https://cdn.jsdelivr.net/npm/search-insights@".concat(Pn,"/dist/search-insights.min.js"),bs=["searchClient","insightsClient","initialUiState"];function Gt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.insightsClient,r=e.insightsInitParams,n=e.onEvent,i=e.$$internal,a=i===void 0?!1:i,o=e.$$automatic,s=o===void 0?!1:o,c=t;!t&&t!==null&&ue(function(f){var l=f.window,d=l.AlgoliaAnalyticsObject||"aa";typeof d=="string"&&(c=l[d]),c||(l.AlgoliaAnalyticsObject=d,l[d]||(l[d]=function(){for(var h=arguments.length,m=new Array(h),p=0;p<h;p++)m[p]=arguments[p];l[d].queue||(l[d].queue=[]),l[d].queue.push(m)},l[d].version=Pn,l[d].shouldAddScript=!0),c=l[d])});var u=c||te;return function(f){var l=f.instantSearchInstance,d,h=l.middleware.filter(function(j){return j.instance.$$type==="ais.insights"&&j.instance.$$internal}).map(function(j){return j.creator});(d=l).unuse.apply(d,fe(h));var m=re(Mt(l.client),2),p=m[0],_=m[1],v=void 0,g=void 0,S=void 0,y=u.queue;if(Array.isArray(y)){var P;P=re(["setUserToken","init"].map(function(j){var U=re(Qt(y.slice().reverse(),function(D){var I=re(D,1),N=I[0];return N===j})||[],2),A=U[1];return A}),2),g=P[0],v=P[1]}u("getUserToken",null,function(j,U){S=Xt(U)}),(r||!Yt(u))&&u("init",x({appId:p,apiKey:_,partial:!0},r));var F,b,E=null;return{$$type:"ais.insights",$$internal:a,$$automatic:s,onStateChange:function(){},subscribe:function(){if(u.shouldAddScript){var U="[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init";try{var A=document.createElement("script");A.async=!0,A.src=Ss,A.onerror=function(){l.emit("error",new Error(U))},document.body.appendChild(A),u.shouldAddScript=!1}catch{u.shouldAddScript=!1,l.emit("error",new Error(U))}}},started:function(){u("addAlgoliaAgent","insights-middleware"),b=l.mainHelper;var U=u.queue;if(Array.isArray(U)){var A;A=re(["setUserToken","init"].map(function($){var k=re(Qt(U.slice().reverse(),function(J){var ee=re(J,1),ie=ee[0];return ie===$})||[],2),z=k[1];return z}),2),g=A[0],v=A[1]}F=Fs(l),s||b.overrideStateWithoutTriggeringChangeEvent(H(x({},b.state),{clickAnalytics:!0})),a||l.scheduleSearch();var D=function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,J=Xt(k);if(!J)return;var ee=b.state.userToken;function ie(){b.overrideStateWithoutTriggeringChangeEvent(H(x({},b.state),{userToken:J})),ee&&ee!==k&&l.scheduleSearch()}z?ie():setTimeout(ie,0)};function I($){D($,!0),u("setUserToken",$)}var N=void 0,K=ps();if(K)N=K;else{var O="anonymous-".concat(vt());N=O}var W,V=F.userToken;r!=null&&r.userToken&&(W=r.userToken),W?I(W):V?I(V):S?I(S):g?I(g):N&&(I(N),(r!=null&&r.useCookie||v!=null&&v.useCookie)&&ws(N,(r==null?void 0:r.cookieDuration)||(v==null?void 0:v.cookieDuration))),u("onUserTokenChange",function($){return D($,!0)},{immediate:!0});var Z=u;Yt(u)&&(Z=function(k,z){var J=re(Mt(l.client),2),ee=J[0],ie=J[1],Hn={headers:{"X-Algolia-Application-Id":ee,"X-Algolia-API-Key":ie}};return u(k,z,Hn)});var he=new Set,we;l.mainHelper.derivedHelpers[0].on("result",function($){var k=$.results;k&&(!k.queryID||k.queryID!==we)&&(we=k.queryID,he.clear())}),l.sendEventToInsights=function($){if(n)n($,Z);else if($.insightsMethod){if($.insightsMethod==="viewedObjectIDs"){var k=$.payload,z=k.objectIDs.filter(function(J){return!he.has(J)});if(z.length===0)return;z.forEach(function(J){return he.add(J)}),k.objectIDs=z}$.payload.algoliaSource=["instantsearch"],s&&$.payload.algoliaSource.pu
9sh("instantsearch-automatic"),$.eventModifier==="internal"&&$.payload.algoliaSource.push("instantsearch-internal"),Z($.insightsMethod,$.payload)}},ue(function(){var $=ys();function k(J){var ee,ie=(ee=b.state)===null||ee===void 0?void 0:ee.userToken;Z("sendEvents",[x({eventType:"instantsearch",timestamp:Date.now(),sessionID:$,userToken:ie?String(ie):void 0},J)])}var z=function(){try{var ee=Math.round(hn()-l._createdAt);k({eventName:"__start__",algoliaAgent:an(l.client),version:wn,applicationId:p,performance:{bootstrapMs:ee},widgets:[{type:"ais.instantSearch",params:l._initialOptions?un(Xa(l._initialOptions,fe(bs))):[],children:ln(l.mainIndex.getWidgets(),l)}]})}catch{}};l.once("render",z),E=function(){return l.removeListener("render",z)}})},unsubscribe:function(){E&&E(),u("onUserTokenChange",void 0),l.sendEventToInsights=te,b&&F&&(b.overrideStateWithoutTriggeringChangeEvent(x({},b.state,F)),l.scheduleSearch())}}}}function Fs(e){var t,r,n=((r=e._initialResults)===null||r===void 0||(t=r[e.indexName])===null||t===void 0?void 0:t.state)||{},i=e.mainHelper.state;return{userToken:n.userToken||i.userToken,clickAnalytics:n.clickAnalytics||i.clickAnalytics}}function ws(e,t){var r=2592e6,n=new Date;n.setTime(n.getTime()+(t||r*6));var i="expires=".concat(n.toUTCString());document.cookie="_ALGOLIA=".concat(e,";").concat(i,";path=/")}
9function Yt(e){var t=re((e.version||"").split(".").map(Number),2),r=t[0],n=t[1],i=r>=3,a=r===2&&n>=6,o=r===1&&n>=10;return i||a||o}function Xt(e){if(e)return typeof e=="number"?e.toString():e}function Ps(){return ue(function(e){var t=e.window,r,n;return((n=t.navigator)===null||n===void 0||(r=n.userAgent)===null||r===void 0?void 0:r.indexOf("Algolia Crawler"))>-1},{fallback:function(){return!1}})}function xs(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.$$internal,r=t===void 0?!1:t;return function(n){var i=n.instantSearchInstance,a={widgets:[]},o=document.createElement("meta"),s=document.querySelector("head");return o.name="instantsearch:widgets",{$$type:"ais.metadata",$$internal:r,onStateChange:function(){},subscribe:function(){setTimeout(function(){a.ua=an(i.client),fn(i.mainIndex.getWidgets(),i,a),i.middleware.forEach(function(u){return a.widgets.push({middleware:!0,type:u.instance.$$type,internal:u.instance.$$internal})}),o.content=JSON.stringify(a),s.appendChild(o)},0)},started:function(){},unsubscribe:function(){o.remove()}}}}var Zt=function(t){t&&(window.document.title=t)},Es=function(){function e(t){var r=this,n=t.windowTitle,i=t.writeDelay,a=i===void 0?400:i,o=t.createURL,s=t.parseURL,c=t.getLocation,u=t.start,f=t.dispose,l=t.push,d=t.cleanUrlOnDispose;bn(this,e),w(this,"$$type","ais.browser"),w(this,"windowTitle",void 0),w(this,"writeDelay",void 0),w(this,"_createURL",void 0),w(this,"parseURL",void 0),w(this,"getLocation",void 0),w(this,"writeTimer",void 0),w(this,"_onPopState",void 0),w(this,"inPopState",!1),w(this,"isDisposed",!1),w(this,"latestAcknowledgedHistory",0),w(this,"_start",void 0),w(this,"_dispose",void 0),w(this,"_push",void 0),w(this,"_cleanUrlOnDispose",void 0),this.windowTitle=n,this.writeTimer=void 0,this.writeDelay=a,this._createURL=o,this.parseURL=s,this.getLocation=c,this._start=u,this._dispose=f,this._push=l,this._cleanUrlOnDispose=typeof d>"u"?!0:d,ue(function(h){var m=h.window,p=r.windowTitle&&r.windowTitle(r.read());Zt(p),r.latestAcknowledgedHistory=m.history.length})}return Fn(e,[{key:"read",value:function(){return this.parseURL({qsModule:Ot,location:this.getLocation()})}},{key:"write",value:function(r){var n=this;ue(function(i){var a=i.window,o=n.createURL(r),s=n.windowTitle&&n.windowTitle(r);n.writeTimer&&clearTimeout(n.writeTimer),n.writeTimer=setTimeout(function(){Zt(s),n.shouldWrite(o)&&(n._push?n._push(o):a.history.pushState(r,s||"",o),n.latestAcknowledgedHistory=a.history.length),n.inPopState=!1,n.writeTimer=void 0},n.writeDelay)})}},{key:"onUpdate",value:function(r){var n=this;this._start&&this._start(function(){r(n.read())}),this._onPopState=function(){n.writeTimer&&(clearTimeout(n.writeTimer),n.writeTimer=void 0),n.inPopState=!0,r(n.read())},ue(function(i){var a=i.window;a.addEventListener("popstate",n._onPopState)})}},{key:"createURL",value:function(r){var n=this._createURL({qsModule:Ot,routeState:r,location:this.getLocation()});return n}},{key:"dispose",value:function(){var r=this;this._dispose&&this._dispose(),this.isDisposed=!0,ue(function(n){var i=n.window;r._onPopState&&i.removeEventListener("popstate",r._onPopState)}),this.writeTimer&&clearTimeout(this.writeTimer),this._cleanUrlOnDispose&&this.write({})}},{key:"start",value:function(){this.isDisposed=!1}},{key:"shouldWrite",value:function(r){var n=this;return ue(function(i){var a=i.window;if(n.isDisposed&&!n._cleanUrlOnDispose)return!1;var o=!(n.isDisposed&&n.latestAcknowledgedHistory!==a.history.length);return!n.inPopState&&o&&r!==a.location.href})}}]),e}();function js(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.createURL,r=t===void 0?function(m){var p=m.qsModule,_=m.routeState,v=m.location,g=v.protocol,S=v.hostname,y=v.port,P=y===void 0?"":y,F=v.pathname,b=v.hash,E=p.stringify(_),j=P===""?"":":".concat(P);return E?"".concat(g,"//").concat(S).concat(j).concat(F,"?").concat(E).concat(b):"".concat(g,"//").concat(S).concat(j).concat(F).concat(b)}:t,n=e.parseURL,i=n===void 0?function(m){var p=m.qsModule,_=m.location;return p.parse(_.search.slice(1),{arrayLimit:99})}:n,a=e.writeDelay,o=a===void 0?400:a,s=e.windowTitle,c=e.getLocation,u=c===void 0?function(){return ue(function(m){var p=m.window;return p.location},{fallback:function(){throw new Error("You need to provide `getLocation` to the `history` router in environments where `window` does not exist.")}})}:c,f=e.start,l=e.dispose,d=e.push,h=e.cleanUrlOnDispose;return new Es({createURL:r,parseURL:i,writeDelay:o,windowTitle:s,getLocation:u,start:f,dispose:l,push:d,cleanUrlOnDispose:h})}function er(e){e.configure;var t=ze(e,["configure"]);return t}function Ts(){return{$$type:"ais.simple",stateToRoute:function(t){return Object.keys(t).reduce(function(r,n){return H(x({},r),w({},n,er(t[n])))},{})},routeToState:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(r,n){var i=t[n];return(typeof i>"u"?"undefined":Re(i))!=="object"||i===null?r:H(x({},r),w({},n,er(i)))},{})}}}var Os=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.router,n=r===void 0?js():r,i=t.stateMapping,a=i===void 0?Ts():i,o=t.$$internal,s=o===void 0?!1:o;return function(c){var u=c.instantSearchInstance;function f(h){var m=u.mainIndex.getWidgets().length===0?u._initialUiState:u.mainIndex.getWidgetUiState({}),p=Object.keys(h).reduce(function(v,g){return H(x({},v),w({},g,h[g]))},m),_=a.stateToRoute(p);return n.createURL(_)}u._createURL=f;var l=void 0,d=u._initialUiState;return{$$type:"ais.router({router:".concat(n.$$type||"__unknown__",", stateMapping:").concat(a.$$type||"__unknown__","})"),$$internal:s,onStateChange:function(m){var p=m.uiState,_=a.stateToRoute(p);(l===void 0||!cn(l,_))&&(n.write(_),l=_)},subscribe:function(){u._initialUiState=x({},d,a.routeToState(n.read())),n.onUpdate(function(m){u.mainIndex.getWidgets().length>0&&u.setUiState(a.routeToState(m))})},started:function(){var m;(m=n.start)===null||m===void 0||m.call(n)},unsubscribe:function(){n.dispose()}}}};
9function Is(e,t){return e.toLocaleString(t)}var As="ais",Ke=function(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=r.descendantName,i=r.modifierName,a=n?"-".concat(n):"",o=i?"--".concat(i):"";return"".concat(As,"-").concat(t).concat(a).concat(o)}},Cs=Ke("Highlight");function Hs(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,o=a===void 0?{}:a,s=Je(i._highlightResult,t),c=s||{},u=c.value,f=u===void 0?"":u,l=Cs({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):"");return f.replace(new RegExp(X.highlightPreTag,"g"),"<".concat(n,' class="').concat(l,'">')).replace(new RegExp(X.highlightPostTag,"g"),"</".concat(n,">"))}var Ns=Ke("ReverseHighlight");function $s(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,o=a===void 0?{}:a,s=Je(i._highlightResult,t),c=s||{},u=c.value,f=u===void 0?"":u,l=Ns({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):""),d=tn(dn(on(f)));return d.replace(new RegExp(X.highlightPreTag,"g"),"<".concat(n,' class="').concat(l,'">')).replace(new RegExp(X.highlightPostTag,"g"),"</".concat(n,">"))}var Ds=Ke("Snippet");function Ws(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,o=a===void 0?{}:a,s=Je(i._snippetResult,t),c=s||{},u=c.value,f=u===void 0?"":u,l=Ds({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):"");return f.replace(new RegExp(X.highlightPreTag,"g"),"<".concat(n,' class="').concat(l,'">')).replace(new RegExp(X.highlightPostTag,"g"),"</".concat(n,">"))}var Us=Ke("ReverseSnippet");function Ls(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,o=a===void 0?{}:a,s=Je(i._snippetResult,t),c=s||{},u=c.value,f=u===void 0?"":u,l=Us({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):""),d=tn(dn(on(f)));return d.replace(new RegExp(X.highlightPreTag,"g"),"<".concat(n,' class="').concat(l,'">')).replace(new RegExp(X.highlightPostTag,"g"),"</".concat(n,">"))}function ks(e){var t=e.numberLocale;return{formatNumber:function(n,i){return Is(Number(i(n)),t)},highlight:function(n,i){try{var a=JSON.parse(n);return i(Hs(H(x({},a),{hit:this})))}catch{throw new Error(` 10The highlight helper expects a JSON object of the format: 11{ "attribute": "name", "highlightedTagName": "mark" }`)}},reverseHighlight:function(n,i){try{var a=JSON.parse(n);return i($s(H(x({},a),{hit:this})))}catch{throw new Error(` 12 The reverseHighlight helper expects a JSON object of the format: 13 { "attribute": "name", "highlightedTagName": "mark" }`)}},snippet:function(n,i){try{var a=JSON.parse(n);return i(Ws(H(x({},a),{hit:this})))}catch{throw new Error(` 14The snippet helper expects a JSON object of the format: 15{ "attribute": "name", "highlightedTagName": "mark" }`)}},reverseSnippet:function(n,i){try{var a=JSON.parse(n);return i(Ls(H(x({},a),{hit:this})))}catch{throw new Error(` 16 The reverseSnippet helper expects a JSON object of the format: 17 { "attribute": "name", "highlightedTagName": "mark" }`)}},insights:function(n,i){try{var a=JSON.parse(n),o=a.method,s=a.payload;return i(_s(o,x({objectIDs:[this.objectID]},s)))}catch{throw new Error(` 18The insights helper expects a JSON object of the format: 19{ "method": "method-name", "payload": { "eventName": "name of the event" } }`)}}}}var ce=Ve({name:"instantsearch"});function Qs(){return"#"}var xn={preserveSharedStateOnUnmount:!1,persistHierarchicalRootCount:!1},Ms=function(e){ms(t,e);function t(r){bn(this,t);var n;n=hs(this,t),w(n,"client",void 0),w(n,"indexName",void 0),w(n,"compositionID",void 0),w(n,"insightsClient",void 0),w(n,"onStateChange",null),w(n,"future",void 0),w(n,"helper",void 0),w(n,"mainHelper",void 0),w(n,"mainIndex",void 0),w(n,"started",void 0),w(n,"templatesConfig",void 0),w(n,"renderState",{}),w(n,"_stalledSearchDelay",void 0),w(n,"_searchStalledTimer",void 0),w(n,"_initialUiState",void 0),w(n,"_initialResults",void 0),w(n,"_manuallyResetScheduleSearch",!1),w(n,"_resetScheduleSearch",void 0),w(n,"_createURL",void 0),w(n,"_searchFunction",void 0),w(n,"_mainHelperSearch",void 0),w(n,"_hasSearchWidget",!1),w(n,"_hasRecommendWidget",!1),w(n,"_insights",void 0),w(n,"_initialOptions",void 0),w(n,"middleware",[]),w(n,"sendEventToInsights",void 0),w(n,"_createdAt",hn()),w(n,"status","idle"),w(n,"error",void 0),w(n,"scheduleSearch",_e(function(){n.started&&n.mainHelper.search()})),w(n,"scheduleRender",_e(function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,D;!((D=n.mainHelper)===null||D===void 0)&&D.hasPendingRequests()||(clearTimeout(n._searchStalledTimer),n._searchStalledTimer=null,A&&(n.status="idle",n.error=void 0)),n.mainIndex.render({instantSearchInstance:n}),n.emit("render")})),w(n,"onInternalStateChange",_e(function(){var A=n.mainIndex.getWidgetUiState({});n.middleware.forEach(function(D){var I=D.instance;I.onStateChange({uiState:A})})})),n.setMaxListeners(100);var i=r.indexName,a=i===void 0?"":i,o=r.compositionID,s=r.numberLocale,c=r.initialUiState,u=c===void 0?{}:c,f=r.routing,l=f===void 0?null:f,d=r.insights,h=d===void 0?void 0:d,m=r.searchFunction,p=r.stalledSearchDelay,_=p===void 0?200:p,v=r.searchClient,g=v===void 0?null:v,S=r.insightsClient,y=S===void 0?null:S,P=r.onStateChange,F=P===void 0?null:P,b=r.future,E=b===void 0?x({},xn,r.future||{}):b;if(g===null)throw new Error(ce("The `searchClient` option is required."));if(typeof g.search!="function")throw new Error("The `searchClient` must implement a `search` method.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/");if(typeof g.addAlgoliaAgent=="function"&&g.addAlgoliaAgent("instantsearch.js (".concat(wn,")")),y&&typeof y!="function")throw new Error(ce("The `insightsClient` option should be a function."));if(n._initialOptions=r,n.client=g,n.future=E,n.insightsClient=y,n.indexName=a,n.compositionID=o,n.helper=null,n.mainHelper=null,n.mainIndex=os({indexName:n.compositionID||n.indexName}),n.onStateChange=F,n.started=!1,n.templatesConfig={helpers:ks({numberLocale:s}),compileOptions:{}},n._stalledSearchDelay=_,n._searchStalledTimer=null,n._createURL=Qs,n._initialUiState=u,n._initialResults=null,n._insights=h,m&&(n._searchFunction=m),n.sendEventToInsights=te,l){var j=typeof l=="boolean"?{}:l;j.$$internal=!0,n.use(Os(j))}if(h){var U=typeof h=="boolean"?{}:h;U.$$internal=!0,n.use(Gt(U))}return Ps()&&n.use(xs({$$internal:!0})),n}return Fn(t,[{key:"_isSearchStalled",get:function(){return this.status==="stalled"}},{key:"use",value:function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=a.map(function(c){var u=x({$$type:"__unknown__",$$internal:!1,subscribe:te,started:te,unsubscribe:te,onStateChange:te},c({instantSearchInstance:n}));return n.middleware.push({creator:c,instance:u}),u});
19return this.started&&s.forEach(function(c){c.subscribe(),c.started()}),this}},{key:"unuse",value:function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return this.middleware.filter(function(o){return i.includes(o.creator)}).forEach(function(o){return o.instance.unsubscribe()}),this.middleware=this.middleware.filter(function(o){return!i.includes(o.creator)}),this}},{key:"EXPERIMENTAL_use",value:function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return this.use.apply(this,fe(i))}},{key:"addWidget",value:function(n){return this.addWidgets([n])}},{key:"addWidgets",value:function(n){if(!Array.isArray(n))throw new Error(ce("The `addWidgets` method expects an array of widgets. Please use `addWidget`."));if(this.compositionID&&n.some(function(i){return!Array.isArray(i)&&Y(i)&&!i._isolated}))throw new Error(ce("The `index` widget cannot be used with a composition-based InstantSearch implementation."));return this.mainIndex.addWidgets(n),this}},{key:"removeWidget",value:function(n){return this.removeWidgets([n])}},{key:"removeWidgets",value:function(n){if(!Array.isArray(n))throw new Error(ce("The `removeWidgets` method expects an array of widgets. Please use `removeWidget`."));return this.mainIndex.removeWidgets(n),this}},{key:"start",value:function(){var n=this;if(this.started)throw new Error(ce("The `start` method has already been called once."));var i=this.mainHelper||M(this.client,this.indexName,void 0,{persistHierarchicalRootCount:this.future.persistHierarchicalRootCount});if(this.compositionID&&(i.searchForFacetValues=i.searchForCompositionFacetValues.bind(i)),i.search=function(){var s=n._hasSearchWidget||n._hasRecommendWidget;return s&&(n.status="loading"),n.scheduleRender(!s),n._hasSearchWidget&&(n.compositionID?i.searchWithComposition():i.searchOnlyWithDerivedHelpers()),n._hasRecommendWidget&&i.recommend(),i},this._searchFunction){var a={search:function(){return new Promise(te)}};this._mainHelperSearch=i.search.bind(i),i.search=function(){var s=n.mainIndex.getHelper(),c=M(a,s.state.index,s.state);return c.once("search",function(u){var f=u.state;s.overrideStateWithoutTriggeringChangeEvent(f),n._mainHelperSearch()}),c.on("change",function(u){var f=u.state;s.setState(f)}),n._searchFunction(c),i}}if(i.on("error",function(s){var c=s.error;if(!sn(c,Error)){var u=c;c=Object.keys(u).reduce(function(f,l){return f[l]=u[l],f},new Error(u.message))}c.error=c,n.error=c,n.status="error",n.scheduleRender(!n._hasSearchWidget&&!n._hasRecommendWidget),n.emit("error",c)}),this.mainHelper=i,this.middleware.forEach(function(s){var c=s.instance;c.subscribe()}),this.mainIndex.init({instantSearchInstance:this,parent:null,uiState:this._initialUiState}),this._initialResults){Ka(this.client,this._initialResults),Ja(this.mainHelper,this._initialResults);var o=this.scheduleSearch;this.scheduleSearch=_e(te),this._manuallyResetScheduleSearch?this._resetScheduleSearch=function(){n.scheduleSearch=o}:_e(function(){n.scheduleSearch=o})()}else this.mainIndex.getWidgets().length>0&&this.scheduleSearch();this.helper=this.mainIndex.getHelper(),this.started=!0,this.middleware.forEach(function(s){var c=s.instance;c.started()}),typeof this._insights>"u"&&i.derivedHelpers[0].once("result",function(){var s=n.mainIndex.getScopedResults().some(function(c){var u=c.results;return u==null?void 0:u._automaticInsights});s&&n.use(Gt({$$internal:!0,$$automatic:!0}))})}},{key:"dispose",value:function(){var n;this.scheduleSearch.cancel(),this.scheduleRender.cancel(),clearTimeout(this._searchStalledTimer),this.removeWidgets(this.mainIndex.getWidgets()),this.mainIndex.dispose(),this.started=!1,this.removeAllListeners(),(n=this.mainHelper)===null||n===void 0||n.removeAllListeners(),this.mainHelper=null,this.helper=null,this.middleware.forEach(function(i){var a=i.instance;a.unsubscribe()}),this._initialOptions=null}},{key:"scheduleStalledRender",value:function(){var n=this;this._searchStalledTimer||(this._searchStalledTimer=setTimeout(function(){n.status="stalled",n.scheduleRender()},this._stalledSearchDelay))}},{key:"setUiState",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!this.mainHelper)throw new Error(ce("The `start` method needs to be called before `setUiState`."));this.mainIndex.refreshUiState();var o=typeof n=="function"?n(this.mainIndex.getWidgetUiState({})):n;this.onStateChange&&a?this.onStateChange({uiState:o,setUiState:function(c){mt(typeof c=="function"?c(o):c,i.mainIndex),i.scheduleSearch(),i.onInternalStateChange()}}):(mt(o,this.mainIndex),this.scheduleSearch(),this.onInternalStateChange())}},{key:"getUiState",value:function(){return this.started&&this.mainIndex.refreshUiState(),this.mainIndex.getWidgetUiState({})}},{key:"createURL",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.started)throw new Error(ce("The `start` method needs to be called before `createURL`."));return this._createURL(n)}},{key:"refresh",value:function(){if(!this.mainHelper)throw new Error(ce("The `start` method needs to be called before `refresh`."));this.mainHelper.clearCache().search()}}]),t}(Qn),qs={},tr=["react (".concat(T.version,")"),"react-instantsearch (".concat(st,")"),"react-instantsearch-core (".concat(st,")")],rr="react-instantsearch-server (".concat(st,")"),Bs=function(t){return t?"next.js (".concat(t,")"):null};function Vs(e){var t=us(),r=Jr(),n=Gr(),i=gn().waitForResultsRef,a=n==null?void 0:n.initialResults,o=T.useRef(e),s=r||a||i,c=T.useRef(null);if(n!=null&&n.ssrSearchRef&&(c=n.ssrSearchRef),c.current===null){var u=new Ms(e);u._schedule=function(_){u._schedule.queue.push(_),clearTimeout(u._schedule.timer),u._schedule.timer=setTimeout(function(){u._schedule.queue.forEach(function(v){v()}),u._schedule.queue=[]},0)},u._schedule.queue=[],s&&(u._initialResults=a||{},u._manuallyResetScheduleSearch=!0),nr(e.searchClient,qe(tr).concat([r&&rr,Bs(zs())])),s&&u.start(),r&&r.notifyServer({search:u}
19),e.routing,c.current=u}{var f=c.current,l=o.current;if(l.indexName!==e.indexName&&(f.helper.setIndex(e.indexName||"").search(),o.current=e),l.searchClient!==e.searchClient&&(nr(e.searchClient,qe(tr).concat([r&&rr])),f.mainHelper.setClient(e.searchClient).search(),o.current=e),l.onStateChange!==e.onStateChange&&(f.onStateChange=e.onStateChange,o.current=e),l.searchFunction!==e.searchFunction&&(f._searchFunction=e.searchFunction,o.current=e),l.stalledSearchDelay!==e.stalledSearchDelay){var d;f._stalledSearchDelay=(d=e.stalledSearchDelay)!==null&&d!==void 0?d:200,o.current=e}Fe(l.future,e.future)||(f.future=$e({},xn,e.future),o.current=e)}var h=T.useRef(null),m=Wn.useSyncExternalStore(T.useCallback(function(){var p=c.current;return h.current===null?p.started||(p.start(),t()):(clearTimeout(h.current),p._preventWidgetCleanup=!1),function(){if(n!=null&&n.ssrSearchRef)return;function _(){p.dispose()}clearTimeout(p._schedule.timer),h.current=setTimeout(_),p._preventWidgetCleanup=!0}},[t,n]),function(){return c.current},function(){return c.current});return m}function nr(e,t){typeof e.addAlgoliaAgent=="function"&&t.filter(Boolean).forEach(function(r){e.addAlgoliaAgent(r)})}function zs(){var e,t;return typeof window<"u"&&((e=window.next)===null||e===void 0?void 0:e.version)||(typeof process<"u"?(t=qs)===null||t===void 0?void 0:t.NEXT_RUNTIME:void 0)}function dc(e){var t=e.children,r=He(e,["children"]),n=Vs(r);return n.started?C.createElement(zr.Provider,{value:n},C.createElement(Br.Provider,{value:n.mainIndex},t,C.createElement(Js,{search:n}))):null}function Js(e){var t=e.search;return T.useEffect(function(){t._resetScheduleSearch&&t._resetScheduleSearch()},[t]),null}function mc(e){var t=e.children,r=He(e,["children"]),n=C.useRef(null),i=C.useRef(0);return Object.keys(r).length===0?C.createElement(C.Fragment,null,t):C.createElement(Kr.Provider,{value:qr($e({},r),{ssrSearchRef:n,recommendIdx:i})},t)}function Ks(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.message,n=t.referer,i,a;if(!e)return!1;(a=e.setOpen)===null||a===void 0||a.call(e,!0);var o=(i=r==null?void 0:r.trim())!==null&&i!==void 0?i:"";if(!o){var s;return(s=e.focusInput)===null||s===void 0||s.call(e),!1}return En(e)||!e.sendMessage?!1:(e.sendMessage({text:o},n?{headers:{"x-algolia-referer":n}}:void 0),!0)}function En(e){return(e==null?void 0:e.status)==="submitted"||(e==null?void 0:e.status)==="streaming"}var Gs=Ve({name:"search-box",connector:!0}),Ys=function(t,r){return r(t)},Xs=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te;return Na(t,Gs()),function(n){var i=n||{},a=i.queryHook,o=a===void 0?Ys:a,s,c;return{$$type:"ais.searchBox",init:function(f){var l=f.instantSearchInstance;t(H(x({},this.getWidgetRenderState(f)),{instantSearchInstance:l}),!0)},render:function(f){var l=f.instantSearchInstance;t(H(x({},this.getWidgetRenderState(f)),{instantSearchInstance:l}),!1)},dispose:function(f){var l=f.state;return r(),l.setQueryParameter("query",void 0)},getRenderState:function(f,l){return H(x({},f),{searchBox:this.getWidgetRenderState(l)})},getWidgetRenderState:function(f){var l=f.helper,d=f.instantSearchInstance,h=f.state;return s||(s=function(p){o(p,function(_){return l.setQuery(_).search()})},c=function(){l.setQuery("").search()}),{query:h.query||"",refine:s,clear:c,widgetParams:n,isSearchStalled:d.status==="stalled"}},getWidgetUiState:function(f,l){var d=l.searchParameters,h=d.query||"";return h===""||f&&f.query===h?f:H(x({},f),{query:h})},getWidgetSearchParameters:function(f,l){var d=l.uiState;return f.setQueryParameter("query",d.query||"")}}}};function Zs(e,t){return vn(Xs,e,t)}function eo(){var e=Ue(),t=jt(),r=pe(T.useState(function(){var a=ft(t);return{results:a.results,scopedResults:a.scopedResults}}),2),n=r[0],i=r[1];return T.useEffect(function(){function a(){var o=t.getResults();if(o!==null)i({results:o,scopedResults:t.getScopedResults()});else if(e.mainIndex.getIndexName().length===0){var s=e.mainIndex.getWidgets().find(Y);s&&i({results:ft(t).results,scopedResults:s.getScopedResults()})}}return e.addListener("render",a),a(),function(){e.removeListener("render",a)}},[e,t]),n}function to(){var e=Ue(),t=jt(),r=t.getIndexId(),n=pe(T.useState(function(){return e.getUiState()}),2),i=n[0],a=n[1],o=i[r],s=pe(T.useState(function(){return e.render
19State}),2),c=s[0],u=s[1],f=c[r]||{},l=T.useCallback(function(h){e.setUiState(h)},[e]),d=T.useCallback(function(h){t.setIndexUiState(h)},[t]);return T.useEffect(function(){function h(){a(e.getUiState()),u(e.renderState)}return e.addListener("render",h),h(),function(){e.removeListener("render",h)}},[e]),{uiState:i,setUiState:l,indexUiState:o,setIndexUiState:d,renderState:c,indexRenderState:f}}function ro(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).catchError,t=Ue(),r=to(),n=r.uiState,i=r.setUiState,a=r.indexUiState,o=r.setIndexUiState,s=r.renderState,c=r.indexRenderState,u=eo(),f=u.results,l=u.scopedResults,d=T.useCallback(function(){for(var m=arguments.length,p=new Array(m),_=0;_<m;_++)p[_]=arguments[_];var v;return(v=t).use.apply(v,qe(p)),function(){var g;(g=t).unuse.apply(g,qe(p))}},[t]),h=T.useCallback(function(){t.refresh()},[t]);return mn(function(){if(e){var m=function(){};return t.addListener("error",m),function(){return t.removeListener("error",m)}}return function(){}},[t,e]),{results:f,scopedResults:l,uiState:n,setUiState:i,indexUiState:a,setIndexUiState:o,renderState:s,indexRenderState:c,addMiddlewares:d,refresh:h,status:t.status,error:t.error}}function no(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function io(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){no(e,i,r[i])})}return e}function ao(e,t){if(e==null)return{};var r={},n=Object.getOwnPropertyNames(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}function so(e,t){if(e==null)return{};var r={},n,i,a;if(typeof Reflect<"u"&&Reflect.ownKeys){for(n=Reflect.ownKeys(e),a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}if(r=ao(e,t),Object.getOwnPropertySymbols)for(n=Object.getOwnPropertySymbols(e),a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}function q(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(n,i){return Array.isArray(i)?n.concat(i):n.concat([i])},[]).filter(Boolean).join(" ")}function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}function co(e,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function uo(e){var t=e.createElement;return function(n){var i=n.classNames,a=n.children,o=n.highlightedTagName,s=n.isHighlighted,c=n.nonHighlightedTagName,u=s?o:c;return t(u,{className:s?i.highlighted:i.nonHighlighted},a)}}function lo(e){var t=e.createElement,r=e.Fragment,n=uo({createElement:t});return function(a){var o=a.parts,s=a.highlightedTagName,c=s===void 0?"mark":s,u=a.nonHighlightedTagName,f=u===void 0?"span":u,l=a.separator,d=l===void 0?", ":l,h=a.className,m=a.classNames,p=m===void 0?{}:m,_=so(a,["parts","highlightedTagName","nonHighlightedTagName","separator","className","classNames"]);return t("span",co(io({},_),{className:q(p.root,h)}),o.map(function(v,g){var S=g===o.length-1;return t(r,{key:g},v.map(function(y,P){return t(n,{key:P,classNames:p,highlightedTagName:c,nonHighlightedTagName:f,isHighlighted:y.isHighlighted},y.value)}),!S&&t("span",{className:p.separator},d))}))}}function fo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}
19))),n.forEach(function(i){fo(e,i,r[i])})}return e}function ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}function ir(e,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ho(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function mo(e,t){if(e==null)return{};var r={},n=Object.getOwnPropertyNames(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}function Tt(e,t){if(e==null)return{};var r={},n,i,a;if(typeof Reflect<"u"&&Reflect.ownKeys){for(n=Reflect.ownKeys(e),a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}if(r=mo(e,t),Object.getOwnPropertySymbols)for(n=Object.getOwnPropertySymbols(e),a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i]);return r}function go(e){if(Array.isArray(e))return e}function vo(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,s=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function po(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 20In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ar(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yo(e,t){if(e){if(typeof e=="string")return ar(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ar(e,t)}}function Ro(e,t){return go(e)||vo(e,t)||yo(e,t)||po()}var _o=lo({createElement:T.createElement,Fragment:T.Fragment});function gc(e){var t=e.classNames,r=t===void 0?{}:t,n=Tt(e,["classNames"]);return C.createElement(_o,be({classNames:{root:q("ais-Highlight",r.root),highlighted:q("ais-Highlight-highlighted",r.highlighted),nonHighlighted:q("ais-Highlight-nonHighlighted",r.nonHighlighted),separator:q("ais-Highlight-separator",r.separator)}},n))}function So(e){var t=e.classNames;return C.createElement("svg",{className:q("ais-SearchBox-submitIcon",t.submitIcon),width:"10",height:"10",viewBox:"0 0 40 40","aria-hidden":"true"},C.createElement("path",{d:"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"}))}function bo(e){var t=e.classNames;return C.createElement("svg",{className:q("ais-SearchBox-resetIcon",t.resetIcon),viewBox:"0 0 20 20",width:"10",height:"10","aria-hidden":"true"},C.createElement("path",{d:"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"}))}function Fo(e){var t=e.classNames;return C.createElement("svg",{"aria-label":"Results are loading",width:"16",height:"16",viewBox:"0 0 38 38",stroke:"#444",className:q("ais-SearchBox-loadingIcon",t.loadingIcon),"aria-hidden":"true"},C.createElement("g",{fill:"none",fillRule:"evenodd"},C.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},C.createElement("circle",{strokeOpacity:".5",cx:"18",cy:"18",r:"18"}),C.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},C.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}function wo(e){var t=e.classNames;return C.createElement("svg",{className:q("ais-AiModeButton-icon",t.aiModeIcon),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",width:"16",height:"16","aria-hidden":"true"},C.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M10 1.875c.27 0 .51.173.594.43l1.593 4.844a1.043 1.043 0 0 0 .664.664l4.844 1.593a.625.625 0 0 1 0 1.188l-4.844 1.593a1.043 1.043 0 0 0-.664.664l-1.593 4.844a.625.625 0 0 1-1.188 0l-1.593-4.844a1.042 1.042 0 0 0-.664-.664l-4.844-1.593a.625.625 0 0 1 0-1.188l4.844-1.593a1.042
201.042 0 0 0 .664-.664l1.593-4.844a.625.625 0 0 1 .594-.43ZM9 7.539A2.292 2.292 0 0 1 7.54 9L4.5 10l3.04 1A2.292 2.292 0 0 1 9 12.46l1 3.04 1-3.04A2.293 2.293 0 0 1 12.46 11l3.04-1-3.04-1A2.292 2.292 0 0 1 11 7.54L10 4.5 9 7.54ZM4.167 1.875c.345 0 .625.28.625.625v3.333a.625.625 0 0 1-1.25 0V2.5c0-.345.28-.625.625-.625ZM15.833 13.542c.345 0 .625.28.625.625V17.5a.625.625 0 1 1-1.25 0v-3.333c0-.345.28-.625.625-.625Z",clipRule:"evenodd"}),C.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.875 4.167c0-.346.28-.625.625-.625h3.333a.625.625 0 1 1 0 1.25H2.5a.625.625 0 0 1-.625-.625ZM13.542 15.833c0-.345.28-.625.625-.625H17.5a.625.625 0 0 1 0 1.25h-3.333a.625.625 0 0 1-.625-.625Z",clipRule:"evenodd"}))}function Po(e){var t=e.formRef,r=e.inputRef,n=e.inputProps,i=e.isSearchStalled,a=e.onChange,o=e.onReset,s=e.onSubmit,c=e.placeholder,u=c===void 0?"":c,f=e.value,l=e.autoFocus,d=e.resetIconComponent,h=d===void 0?bo:d,m=e.submitIconComponent,p=m===void 0?So:m,_=e.loadingIconComponent,v=_===void 0?Fo:_,g=e.aiModeIconComponent,S=g===void 0?wo:g,y=e.onAiModeClick,P=e.aiModeButtonDisabled,F=P===void 0?!1:P,b=e.classNames,E=b===void 0?{}:b,j=e.translations,U=Tt(e,["formRef","inputRef","inputProps","isSearchStalled","onChange","onReset","onSubmit","placeholder","value","autoFocus","resetIconComponent","submitIconComponent","loadingIconComponent","aiModeIconComponent","onAiModeClick","aiModeButtonDisabled","classNames","translations"]);function A(I){I.preventDefault(),I.stopPropagation(),s&&s(I),r.current&&r.current.blur()}function D(I){I.preventDefault(),I.stopPropagation(),o(I),r.current&&r.current.focus()}return C.createElement("div",ir(be({},U),{className:q("ais-SearchBox",E.root,U.className)}),C.createElement("form",{ref:t,action:"",className:q("ais-SearchBox-form",E.form),noValidate:!0,onSubmit:A,onReset:D,role:"search"},C.createElement("input",ir(be({},n),{ref:r,className:q("ais-SearchBox-input",E.input,n==null?void 0:n.className),"aria-label":"Search",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",placeholder:u,spellCheck:!1,maxLength:512,type:"search",value:f,onChange:a,onCompositionEnd:a,autoFocus:l})),C.createElement("button",{className:q("ais-SearchBox-submit",E.submit),type:"submit",title:j.submitButtonTitle,"aria-label":j.submitButtonTitle},C.createElement(p,{classNames:E})),C.createElement("button",{className:q("ais-SearchBox-reset",E.reset),type:"reset",title:j.resetButtonTitle,"aria-label":j.resetButtonTitle,hidden:f.length===0||i},C.createElement(h,{classNames:E})),y&&C.createElement("button",{className:q("ais-AiModeButton",E.aiModeButton),type:"button",title:j.aiModeButtonTitle||"AI Mode",disabled:F,onClick:function(N){N.preventDefault(),y()}},C.createElement(S,{classNames:E}),C.createElement("span",{className:"ais-AiModeButton-label"},j.aiModeButtonTitle||"AI Mode")),C.createElement("span",{className:q("ais-SearchBox-loadingIndicator",E.loadingIndicator),hidden:!i},C.createElement(v,{classNames:E}))))}function vc(e){var t=e.queryHook,r=e.searchAsYouType,n=r===void 0?!0:r,i=e.ignoreCompositionEvents,a=i===void 0?!1:i,o=e.aiMode,s=e.translations,c=Tt(e,["queryHook","searchAsYouType","ignoreCompositionEvents","aiMode","translations"]),u=Zs({queryHook:t},be({$$widgetType:"ais.searchBox"},o?{opensChat:!0}:{})),f=u.query,l=u.refine,d=u.isSearchStalled,h=ro().indexRenderState,m=Ro(T.useState(f),2),p=m[0],_=m[1],v=T.useRef(null);function g(E){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;_(E),n&&!(a&&j)&&l(E)}function S(){g(""),n||l("")}function y(E){g(E.currentTarget.value,E.nativeEvent.isComposing)}function P(E){n||l(p),c.onSubmit&&c.onSubmit(E)}f!==p&&document.activeElement!==v.current&&_(f);var F=h.chat,b={inputRef:v,isSearchStalled:d,onChange:y,onReset:S,onSubmit:P,onAiModeClick:o?function(){Ks(F,{message:p,referer:"ai-mode"})&&S()}:void 0,aiModeButtonDisabled:o?En(F):void 0,value:p,translations:be({submitButtonTitle:"Submit the search query",resetButtonTitle:"Clear the search query",aiModeButtonTitle:"AI Mode"},s)};return C.createElement(Po,be({},c,b))}function xo(e){let t;const r=`algolia-client-js-${e.key}`;function n(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function i(){return JSON.parse(n().getItem(r)||"{}")}function a(c){n().setItem(r,JSON.stringify(c))}function o(){return new Promise(c=>setTimeout(c,0))}function s(){const c=e.timeToLive?e.timeToLive*1e3:null,u=i(),f=new Date().getTime();let l=!1;return{namespace:Object.fromEntries(Object.entries(u).filter(([,h])=>!h||h.timestamp===void 0||c&&h.timestamp+c<f?(l=!0,!1):!0)),changed:l}}return{get(c,u,f={miss:()=>Promise.resolve()}){return o().then(()=>{const{namespace:l,changed:d}=s(),h=l[JSON.stringify(c)];return d&&a(l),h?h.value:u().then(m=>f.miss(m).then(()=>m))})},set(c,u){return o().then(()=>{const f=i();return f[JSON.stringify(c)]={timestamp:new Date().getTime(),value:u},n().setItem(r,JSON.stringify(f)),u})},delete(c){return o().then(()=>{const u=i();delete u[JSON.stringify(c)],n().setItem(r,JSON.stringify(u))})},clear(){return Promise.resolve().then(()=>{n().removeItem(r)})}}}function Eo(){return{get(e,t,r={miss:()=>Promise.resolve()}){return t().then(i=>Promise.all([i,r.miss(i)])).then(([i])=>i)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function Oe(e){const t=[...e.caches],r=t.shift();return r===void 0?Eo():{get(n,i,a={miss:()=>Promise.resolve()}){return r.get(n,i,a).catch(()=>Oe({caches:t}).get(n,i,a))},set(n,i){return r.set(n,i).catch(()=>Oe({caches:t}).set(n,i))},delete(n){return r.delete(n).catch(()=>Oe({caches:t}).delete(n))}
20,clear(){return r.clear().catch(()=>Oe({caches:t}).clear())}}}function at(e={serializable:!0}){let t={};return{get(r,n,i={miss:()=>Promise.resolve()}){const a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);const o=n();return o.then(s=>i.miss(s)).then(()=>o)},set(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete(r){return delete t[JSON.stringify(r)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function jo(e){const t={value:`Algolia for JavaScript (${e})`,add(r){const n=`; ${r.segment}${r.version!==void 0?` (${r.version})`:""}`;return t.value.indexOf(n)===-1&&(t.value=`${t.value}${n}`),t}};return t}function To(e,t,r="WithinHeaders"){const n={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers(){return r==="WithinHeaders"?n:{}},queryParameters(){return r==="WithinQueryParameters"?n:{}}}}function Oo({algoliaAgents:e,client:t,version:r}){const n=jo(r).add({segment:t,version:r});return e.forEach(i=>n.add(i)),n}function Io(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var Ao=10*1024*1024;async function*Co(e){const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)return;yield n}}finally{t.releaseLock()}}function Ho(e){return Symbol.asyncIterator in e?e:Co(e)}async function*No(e){const t=new TextDecoder("utf-8"),r=[];let n=0,i=!1,a=!0;for await(const s of Ho(e)){const c=t.decode(s,{stream:!0});let u=0;for(i&&(i=!1,c.length>0&&c[0]===` 21`&&(u=1));u<c.length;){const f=c.indexOf("\r",u),l=c.indexOf(` 22`,u);if(f===-1&&l===-1){const _=c.slice(u);if(r.push(_),n+=_.length,n>Ao)throw new Error("SSE line buffer exceeded 10MB");break}let d,h;f!==-1&&(l===-1||f<l)?(d=f,f+1<c.length?h=c[f+1]===` 23`?2:1:(i=!0,h=1)):(d=l,h=1);const m=c.slice(u,d);r.push(m);let p=r.length===1?r[0]:r.join("");r.length=0,n=0,a&&(p.startsWith("\uFEFF")&&(p=p.slice(1)),a=!1),yield p,u=d+h}}const o=t.decode();if(o&&r.push(o),r.length>0){let s=r.join("");a&&s.startsWith("\uFEFF")&&(s=s.slice(1)),yield s}}var $o=class{constructor(){ae(this,"data",[]);ae(this,"eventType","");ae(this,"lastEventId",null);ae(this,"retry",null)}decode(e){if(e==="")return this.dispatch();if(e[0]===":")return null;const t=e.indexOf(":");let r,n;switch(t===-1?(r=e,n=""):(r=e.slice(0,t),n=e.slice(t+1),n[0]===" "&&(n=n.slice(1))),r){case"data":this.data.push(n);break;case"event":this.eventType=n;break;case"id":n.includes("\0")||(this.lastEventId=n);break;case"retry":/^[0-9]+$/.test(n)&&(this.retry=parseInt(n,10));break}return null}dispatch(){const e=this.eventType;if(this.eventType="",this.data.length===0)return null;const t={data:this.data.join(` 24`),event:e,id:this.lastEventId,retry:this.retry};return this.data=[],t}};async function*Do(e){const t=new $o;for await(const r of No(e)){const n=t.decode(r);n!==null&&(yield n)}}var Wo=750,sr=2*60*1e3;function or(e,t="up"){const r=Date.now();function n(){return t==="up"||Date.now()-r>sr}function i(){return t==="timed out"&&Date.now()-r<=sr}return{...e,status:t,lastUpdate:r,isUp:n,isTimedOut:i}}var jn=class extends Error{constructor(t,r){super(t);ae(this,"name","AlgoliaError");r&&(this.name=r)}},Tn=class extends jn{constructor(t,r,n){super(t,n);ae(this,"stackTrace");this.stackTrace=r}},cr=class extends Tn{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError")}},pt=class extends Tn{constructor(t,r,n,i="ApiError"){super(t,n,i);ae(this,"status");this.status=r}},Uo=class extends jn{constructor(t,r){super(t,"DeserializationError");ae(this,"response");this.response=r}},Lo=class extends pt{constructor(t,r,n,i){super(t,r,i,"DetailedApiError");ae(this,"error");this.error=n}};function ko(e){const t=e;for(let r=e.length-1;r>0;r--){const n=Math.floor(Math.random()*(r+1)),i=e[r];t[r]=e[n],t[n]=i}return t}function ur(e,t,r){const n=Qo(r);let i=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return n.length&&(i+=`?${n}`),i}function Qo(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])==="[object Array]"?e[t].join(","):e[t]).replace(/\+/g,"%20")}`).join("&")}function lr(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}function fr(e,t,r){const n={Accept:"application/json",...e,...t,...r},i={};
24return Object.keys(n).forEach(a=>{const o=n[a];i[a.toLowerCase()]=o}),i}function On(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new Uo(t.message,e)}}function Mo(e){return{status:e.status,headers:e.headers,content:e.content,data:On(e)}}function qo({content:e,status:t},r){try{const n=JSON.parse(e);return"error"in n?new Lo(n.message,t,n.error,r):new pt(n.message,t,r)}catch{}return new pt(e,t,r)}function Bo({isTimedOut:e,status:t}){return!e&&~~t===0}function Vo({isTimedOut:e,status:t}){return e||Bo({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function zo({status:e}){return~~(e/100)===2}function Jo(e){return e.map(t=>In(t))}function In(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function Ko({hosts:e,hostsCache:t,baseHeaders:r,logger:n,baseQueryParameters:i,algoliaAgent:a,timeouts:o,requester:s,requestsCache:c,responsesCache:u,compress:f,compression:l}){async function d(v){const g=await Promise.all(v.map(b=>t.get(b,()=>Promise.resolve(or(b))))),S=g.filter(b=>b.isUp()),y=g.filter(b=>b.isTimedOut()),P=[...S,...y];return{hosts:P.length>0?P:v,getTimeout(b,E){return(y.length===0&&b===0?1:y.length+3+b)*E}}}async function h(v,g,S){const y=[],P=lr(v,g),F=fr(r,v.headers,g.headers),b=l==="gzip"&&P!==void 0&&P.length>Wo&&(v.method==="POST"||v.method==="PUT");b&&f===void 0&&n.info("Compression is disabled because no compress method is available.");const E=b&&f!==void 0,j=E?await f(P):P;E&&(F["content-encoding"]="gzip");const U=v.method==="GET"?{...v.data,...g.data}:{},A={...i,...v.queryParameters,...U};if(a.value&&(A["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const O of Object.keys(g.queryParameters))!g.queryParameters[O]||Object.prototype.toString.call(g.queryParameters[O])==="[object Object]"?A[O]=g.queryParameters[O]:A[O]=g.queryParameters[O].toString();let D=0;const I=async(O,W)=>{const V=O.pop();if(V===void 0)throw new cr(Jo(y));const Z={...o,...g.timeouts},he={data:j,headers:F,method:v.method,url:ur(V,v.path,A),connectTimeout:W(D,Z.connect),responseTimeout:W(D,S?Z.read:Z.write)},we=k=>{const z={request:he,response:k,host:V,triesLeft:O.length};return y.push(z),z},$=await s.send(he);if(Vo($)){const k=we($);return $.isTimedOut&&D++,n.info("Retryable failure",In(k)),await t.set(V,or(V,$.isTimedOut?"timed out":"down")),I(O,W)}if(zo($))return $;throw we($),qo($,y)},N=e.filter(O=>O.accept==="readWrite"||(S?O.accept==="read":O.accept==="write")),K=await d(N);return I([...K.hosts].reverse(),K.getTimeout)}function m(v,g={}){const S=()=>h(v,g,y).then(b=>On(b)),y=v.useReadTransporter||v.method==="GET";if((g.cacheable||v.cacheable)!==!0)return S();const F={request:v,requestOptions:g,transporter:{queryParameters:i,headers:r}};return u.get(F,()=>c.get(F,()=>c.set(F,S()).then(b=>Promise.all([c.delete(F),b]),b=>Promise.all([c.delete(F),Promise.reject(b)])).then(([b,E])=>E)),{miss:b=>u.set(F,b)})}function p(v,g={}){const S=v.useReadTransporter||v.method==="GET";return h(v,g,S).then(y=>Mo(y))}async function*_(v,g={}){if(!s.sendStream)throw new Error("This requester does not support streaming");const S=lr(v,g),y=fr(r,v.headers,g.headers);y.accept="text/event-stream";const P=v.method==="GET"?{...v.data,...g.data}:{},F={...i,...v.queryParameters,...P};if(a.value&&(F["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const N of Object.keys(g.queryParameters))!g.queryParameters[N]||Object.prototype.toString.call(g.queryParameters[N])==="[object Object]"?F[N]=g.queryParameters[N]:F[N]=g.queryParameters[N].toString();const b=v.useReadTransporter||v.method==="GET",E=e.filter(N=>N.accept==="readWrite"||(b?N.accept==="read":N.accept==="write")),U=(await d(E)).hosts[0];if(!U)throw new cr([]);const A={...o,...g.timeouts},D={data:S,headers:y,method:v.method,url:ur(U,v.path,F),connectTimeout:A.connect,responseTimeout:b?A.read:A.write},I=await s.sendStream(D);yield*Do(I)}return{hostsCache:t,requester:s,timeouts:o,logger:n,algoliaAgent:a,baseHeaders:r,baseQueryParameters:i,hosts:e,request:m,requestWithHttpInfo:p,requestStream:_,requestsCache:c,responsesCache:u}}function se(e,t,r){if(r==null||typeof r=="string"&&r.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function Go(e){let t={};for(let r of e.trim().split(/[\r\n]+/)){let n=r.indexOf(": ");
24n>0&&(t[r.slice(0,n).toLowerCase()]=r.slice(n+2))}return t}function Yo(){function e(t){return new Promise(r=>{let n=new XMLHttpRequest;n.open(t.method,t.url,!0),Object.keys(t.headers).forEach(s=>n.setRequestHeader(s,t.headers[s]));let i=(s,c)=>setTimeout(()=>{n.abort(),r({status:0,content:c,isTimedOut:!0})},s),a=i(t.connectTimeout,"Connection timeout"),o;n.onreadystatechange=()=>{n.readyState>n.OPENED&&o===void 0&&(clearTimeout(a),o=i(t.responseTimeout,"Socket timeout"))},n.onerror=()=>{n.status===0&&(clearTimeout(a),clearTimeout(o),r({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=()=>{clearTimeout(a),clearTimeout(o),r({content:n.responseText,headers:Go(n.getAllResponseHeaders()),status:n.status,isTimedOut:!1})},n.send(t.data)})}return{send:e}}var An="5.56.0";function Xo(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(ko([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function Zo({appId:e,apiKey:t,authMode:r,algoliaAgents:n,...i}){const a=To(e,t,r),o=Ko({hosts:Xo(e),...i,algoliaAgent:Oo({algoliaAgents:n,client:"Lite",version:An}),baseHeaders:{"content-type":"text/plain",...a.headers(),...i.baseHeaders},baseQueryParameters:{...a.queryParameters(),...i.baseQueryParameters}});return{transporter:o,appId:e,apiKey:t,clearCache(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{})},get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(s,c){o.algoliaAgent.add({segment:s,version:c})},setClientApiKey({apiKey:s}){!r||r==="WithinHeaders"?o.baseHeaders["x-algolia-api-key"]=s:o.baseQueryParameters["x-algolia-api-key"]=s},searchForHits(s,c){return this.search(s,c)},searchForFacets(s,c){return this.search(s,c)},customPost({path:s,parameters:c,body:u},f){se("path","customPost",s);const m={method:"POST",path:"/{path}".replace("{path}",s),queryParameters:c||{},headers:{},data:u||{}};return o.request(m,f)},customPostWithHTTPInfo({path:s,parameters:c,body:u},f){se("path","customPostWithHTTPInfo",s);const m={method:"POST",path:"/{path}".replace("{path}",s),queryParameters:c||{},headers:{},data:u||{}};return o.requestWithHttpInfo(m,f)},getRecommendations(s,c){s&&Array.isArray(s)&&(s={requests:s}),se("getRecommendationsParams","getRecommendations",s),se("getRecommendationsParams.requests","getRecommendations",s.requests);const d={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:s,useReadTransporter:!0,cacheable:!0};return o.request(d,c)},getRecommendationsWithHTTPInfo(s,c){s&&Array.isArray(s)&&(s={requests:s}),se("getRecommendationsParams","getRecommendationsWithHTTPInfo",s),se("getRecommendationsParams.requests","getRecommendationsWithHTTPInfo",s.requests);const d={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:s,useReadTransporter:!0,cacheable:!0};return o.requestWithHttpInfo(d,c)},search(s,c){s&&Array.isArray(s)&&(s={requests:s.map(({params:m,...p})=>p.type==="facet"?{...p,...m,type:"facet"}:{...p,...m,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),se("searchMethodParams","search",s),se("searchMethodParams.requests","search",s.requests);const d={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:s,useReadTransporter:!0,cacheable:!0};return o.request(d,c)},searchWithHTTPInfo(s,c){s&&Array.isArray(s)&&(s={requests:s.map(({params:m,...p})=>p.type==="facet"?{...p,...m,type:"facet"}:{...p,...m,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),se("searchMethodParams","searchWithHTTPInfo",s),se("searchMethodParams.requests","searchWithHTTPInfo",s.requests);const d={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:s,useReadTransporter:!0,cacheable:!0};return o.requestWithHttpInfo(d,c)}}}function ec(e,t,r){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");const{compression:n,...i}={};return Zo({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:Io(),requester:Yo(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:at(),requestsCache:at({serializable:!1}),hostsCache:Oe({caches:[xo({key:`${An}-${e}`}),at()]}),...i})}var Cn={},mr;const hr=typeof window<"u"?(mr=window==null?void 0:window.ENV)==null?void 0:mr.ALGOLIA_APP_ID:Cn.ALGOLIA_APP_ID;var gr;const dr=typeof window<"u"?(gr=window==null?void 0:window.ENV)==null?void 0:gr.ALGOLIA_SEARCH_API_KEY:Cn.ALGOLIA_SEARCH_API_KEY,pc=hr&&dr?ec(hr,dr):null,yc={creditCards:{indexName:ge("api::credit-card.credit-card"),type:"Credit Card",label:"Credit Cards",fields:["id","cardName","issuerName"],highlightAttributeName:"cardName",getLink:e=>`/credit-cards/${e.slug}`},tags:{indexName:ge("api::tag.tag"),type:"Tag",label:"Tags",fields:["id","name","slug"],highlightAttributeName:"name",getLink:e=>`/credit-cards/reviews/${e.slug}`},creditCardCategories:{indexName:ge("api::credit-card-category.credit-card-category"),type:"Credit Card Category",label:"Credit Card Categories",fields:["id","name","slug"],highlightAttributeName:"name",getLink:e=>`/cards/${e.slug}`},creditCardIssuers:{indexName:ge("api::credit-card-issuer.credit-card-issuer"),type:"Card Issuer",label:"Credit Card Issuers",fields:["id","issuerName","slug"],highlightAttributeName:"issuerName",getLink:e=>`/issuers/${e.slug}`},blogs:{indexName:ge("api::blog.blog"),type:"Article",label:"Articles",fields:["id","title","subtitle","slug"],highlightAttributeName:"title",getLink:e=>`/articles/${e.slug}`,getSubText:e=>e.subtitle},hotels:{indexName:ge("api::hotel.hotel"),type:"Hotel",label:"Hotels",fields:["id","name","slug"],highlightAttributeName:"name",getLink:e=>`/hotels/${e.slug}`,getSubText:()=>""},tripReports:{indexName:ge("api::trip-report.trip-report"),type:"Trip Report",label:"Trip Reports",fields:["id","title","tagline","slug"],highlightAttributeName:"title",getLink:e=>`/trip-reports/${e.slug}`,getSubText:e=>e.tagline}};export{He as $,re as A,ir as B,hc as C,Qt as D,Re as E,sa as F,Ce as G,X as H,dc as I,oc as J,gc as K,on as L,Qa as M,Ro as N,Po as O,Zs as P,Jr as Q,Gr as R,vc as S,kt as T,jt as U,Lt as V,os as W,us as X,mn as Y,rs as Z,H as _,mc as a,Br as a0,Je as a1,yc as a2,Na as b,Ve as c,w as d,x as e,cc as f,uc as g,js as h,sc as i,lc as j,fc as k,so as l,co as m,te as n,q as o,io as p,Tt as q,be as r,pc as s,ro as t,vn as u,Y as v,fe as w,ze as x,Ya as y,cn as z}; 25//# sourceMappingURL=search-DIKjhQK0.js.map
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.