1import{bA as nr,r as C,gk as Mi,bG as Bi,aD as Vi,a5 as et,j as he,w as V,a as Ki,at as zi,Q as hr,U as Ji,bj as Gi,aW as Xi,dd as Yi,k as Zi}from"../index-Dwetrij8.js";import{u as ea}from"./useGtm-DvTbcLBc.js";const Mt="7.16.3";var tt,dr;function ir(){if(dr)return tt;dr=1;function e(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}tt=e,e.prototype._events=void 0,e.prototype._maxListeners=void 0,e.defaultMaxListeners=10,e.prototype.setMaxListeners=function(a){if(!r(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},e.prototype.emit=function(a){var c,f,h,d,m,S;if(this._events||(this._events={}),a==="error"&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if(c=arguments[1],c instanceof Error)throw c;var l=new Error('Uncaught, unspecified "error" event. ('+c+")");throw l.context=c,l}if(f=this._events[a],i(f))return!1;if(t(f))switch(arguments.length){case 1:f.call(this);break;case 2:f.call(this,arguments[1]);break;case 3:f.call(this,arguments[1],arguments[2]);break;default:d=Array.prototype.slice.call(arguments,1),f.apply(this,d)}else if(n(f))for(d=Array.prototype.slice.call(arguments,1),S=f.slice(),h=S.length,m=0;m<h;m++)S[m].apply(this,d);return!0},e.prototype.addListener=function(a,c){var f;if(!t(c))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,t(c.listener)?c.listener:c),this._events[a]?n(this._events[a])?this._events[a].push(c):this._events[a]=[this._events[a],c]:this._events[a]=c,n(this._events[a])&&!this._events[a].warned&&(i(this._maxListeners)?f=e.defaultMaxListeners:f=this._maxListeners,f&&f>0&&this._events[a].length>f&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),typeof console.trace=="function"&&console.trace())),this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(a,c){if(!t(c))throw TypeError("listener must be a function");var f=!1;function h(){this.removeListener(a,h),f||(f=!0,c.apply(this,arguments))}return h.listener=c,this.on(a,h),this},e.prototype.removeListener=function(a,c){var f,h,d,m;if(!t(c))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(f=this._events[a],d=f.length,h=-1,f===c||t(f.listener)&&f.listener===c)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,c);else if(n(f)){for(m=d;m-- >0;)if(f[m]===c||f[m].listener&&f[m].listener===c){h=m;break}if(h<0)return this;f.length===1?(f.length=0,delete this._events[a]):f.splice(h,1),this._events.removeListener&&this.emit("removeListener",a,c)}return this},e.prototype.removeAllListeners=function(a){var c,f;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[a]&&delete this._events[a],this;if(arguments.length===0){for(c in this._events)c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events={},this}if(f=this._events[a],t(f))this.removeListener(a,f);else if(f)for(;f.length;)this.removeListener(a,f[f.length-1]);return delete this._events[a],this},e.prototype.listeners=function(a){var c;return!this._events||!this._events[a]?c=[]:t(this._events[a])?c=[this._events[a]]:c=this._events[a].slice(),c},e.prototype.listenerCount=function(a){if(this._events){var c=this._events[a];if(t(c))return 1;if(c)return c.length}return 0},e.listenerCount=function(a,c){return a.listenerCount(c)};function t(a){return typeof a=="function"}function r(a){return typeof a=="number"}function n(a){return typeof a=="object"&&a!==null}function i(a){return a===void 0}return tt}var rt,mr;function Xn(){if(mr)return rt;mr=1;function e(t,r){t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}return rt=e,rt}var nt,pr;function ta(){if(pr)return nt;pr=1;var e=ir(),t=Xn();function r(n,i,a){this.main=n,this.fn=i,this.recommendFn=a,this.lastResults=null,this.lastRecommendResults=null}return t(r,e),r.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},r.prototype.getModifiedState=function(n){return this.fn(n)},r.prototype.getModifiedRecommendState=function(n){return this.recommendFn(n)},nt=r,nt}var it,vr;function ar(){if(vr)return it;vr=1;function e(r){return typeof r!="string"?r:String(r).replace(/^-/,"\\-")}function t(r){return typeof r!="string"?r:r.replace(/^\\-/,"-")}return it={escapeFacetValue:e,unescapeFacetValue:t},it}var at,gr;function sr(){if(gr)return at;gr=1;function e(i){return typeof i=="object"&&i!==null?r(Array.isArray(i)?[]:{},i):i}function t(i){return typeof i=="function"||Array.isArray(i)||Object.prototype.toString.call(i)==="[object Object]"}function r(i,a){if(i===a)return i;for(var c in a)if(!(!Object.prototype.hasOwnProperty.call(a,c)||c==="__proto__"||c==="constructor")){var f=a[c],h=i[c];typeof h<"u"&&typeof f>"u"||(t(h)&&t(f)?i[c]=r(h,f):i[c]=e(f))}return i}function n(i){t(i)||(i={});for(var a=1,c=arguments.length;a<c;a++){var f=arguments[a];t(f)&&r(i,f)}return i}return at=n,at}var st,yr;function or(){if(yr)return st;yr=1;function e(t){return t&&Object.keys(t).length>0}return st=e,st}var ot,br;function ur(){if(br)return ot;br=1;function e(t,r){if(t===null)return{};var n={},i=Object.keys(t),a,c;for(c=0;c<i.length;c++)a=i[c],!(r.indexOf(a)>=0)&&(n[a]=t[a]);return n}return ot=e,ot}var ut,Sr;function Yn(){if(Sr)return ut;Sr=1;function e(t){t=t||{},this.params=t.params||[]}return e.prototype={constructor:e,addParams:function(t){var r=this.params.slice();return r.push(t),new e({params:r})}
1,removeParams:function(t){return new e({params:this.params.filter(function(r){return r.$$id!==t})})},addFrequentlyBoughtTogether:function(t){return this.addParams(Object.assign({},t,{model:"bought-together"}))},addRelatedProducts:function(t){return this.addParams(Object.assign({},t,{model:"related-products"}))},addTrendingItems:function(t){return this.addParams(Object.assign({},t,{model:"trending-items"}))},addTrendingFacets:function(t){return this.addParams(Object.assign({},t,{model:"trending-facets"}))},addLookingSimilar:function(t){return this.addParams(Object.assign({},t,{model:"looking-similar"}))},_buildQueries:function(t,r){return this.params.filter(function(n){return r[n.$$id]===void 0}).map(function(n){var i=Object.assign({},n,{indexName:t,threshold:n.threshold||0});return delete i.$$id,i})}},ut=e,ut}var ct,Rr;function Zn(){if(Rr)return ct;Rr=1;function e(t,r){this._state=t,this._rawResults={};var n=this;t.params.forEach(function(i){var a=i.$$id;n[a]=r[a],n._rawResults[a]=r[a]})}return e.prototype={constructor:e},ct=e,ct}var ft,Pr;function ra(){if(Pr)return ft;Pr=1;var e=sr();function t(n){return Object.keys(n).sort().reduce(function(i,a){return i[a]=n[a],i},{})}var r={_getQueries:function(i,a){var c=[];return c.push({indexName:i,params:r._getHitsSearchParams(a)}),a.getRefinedDisjunctiveFacets().forEach(function(f){c.push({indexName:i,params:r._getDisjunctiveFacetSearchParams(a,f)})}),a.getRefinedHierarchicalFacets().forEach(function(f){var h=a.getHierarchicalFacetByName(f),d=a.getHierarchicalRefinement(f),m=a._getHierarchicalFacetSeparator(h);if(d.length>0&&d[0].split(m).length>1){var S=d[0].split(m).slice(0,-1).reduce(function(s,o,v){return s.concat({attribute:h.attributes[v],value:v===0?o:[s[s.length-1].value,o].join(m)})},[]);S.forEach(function(l,s){var o=r._getDisjunctiveFacetSearchParams(a,l.attribute,s===0);function v(p){return h.attributes.some(function(b){return b===p.split(":")[0]})}var g=(o.facetFilters||[]).reduce(function(p,b){if(Array.isArray(b)){var P=b.filter(function(R){return!v(R)});P.length>0&&p.push(P)}return typeof b=="string"&&!v(b)&&p.push(b),p},[]),u=S[s-1];s>0?o.facetFilters=g.concat(u.attribute+":"+u.value):g.length>0?o.facetFilters=g:delete o.facetFilters,c.push({indexName:i,params:o})})}}),c},_getCompositionQueries:function(i){return[{compositionID:i.index,requestBody:{params:r._getCompositionHitsSearchParams(i)}}]},_getHitsSearchParams:function(n){var i=n.facets.concat(n.disjunctiveFacets).concat(r._getHitsHierarchicalFacetsAttributes(n)).sort(),a=r._getFacetFilters(n),c=r._getNumericFilters(n),f=r._getTagFilters(n),h={};return i.length>0&&(h.facets=i.indexOf("*")>-1?["*"]:i),f.length>0&&(h.tagFilters=f),a.length>0&&(h.facetFilters=a),c.length>0&&(h.numericFilters=c),t(e({},n.getQueryParams(),h))},_getCompositionHitsSearchParams:function(n){var i=n.facets.concat(n.disjunctiveFacets.map(function(m){return n.disjunctiveFacetsRefinements&&n.disjunctiveFacetsRefinements[m]&&n.disjunctiveFacetsRefinements[m].length>0?"disjunctive("+m+")":m})).concat(r._getHitsHierarchicalFacetsAttributes(n)).sort(),a=r._getFacetFilters(n),c=r._getNumericFilters(n),f=r._getTagFilters(n),h={};i.length>0&&(h.facets=i.indexOf("*")>-1?["*"]:i),f.length>0&&(h.tagFilters=f),a.length>0&&(h.facetFilters=a),c.length>0&&(h.numericFilters=c);var d=n.getQueryParams();return delete d.highlightPreTag,delete d.highlightPostTag,delete d.index,t(e({},d,h))},_getDisjunctiveFacetSearchParams:function(n,i,a){var c=r._getFacetFilters(n,i,a),f=r._getNumericFilters(n,i),h=r._getTagFilters(n),d={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};h.length>0&&(d.tagFilters=h);var m=n.getHierarchicalFacetByName(i);return m?d.facets=r._getDisjunctiveHierarchicalFacetAttribute(n,m,a):d.facets=i,f.length>0&&(d.numericFilters=f),c.length>0&&(d.facetFilters=c),t(e({},n.getQueryParams(),d))},_getNumericFilters:function(n,i){if(n.numericFilters)return n.numericFilters;var a=[];return Object.keys(n.numericRefinements).forEach(function(c){var f=n.numericRefinements[c]||{};Object.keys(f).forEach(function(h){var d=f[h]||[];i!==c&&d.forEach(function(m){if(Array.isArray(m)){var S=m.map(function(l){return c+h+l});a.push(S)}else a.push(c+h+m)})})}),a},_getTagFilters:function(n){return n.tagFilters?n.tagFilters:n.tagRefinements.join(",")},_getFacetFilters:function(n,i,a){var c=[],f=n.facetsRefinements||{};
1Object.keys(f).sort().forEach(function(S){var l=f[S]||[];l.slice().sort().forEach(function(s){c.push(S+":"+s)})});var h=n.facetsExcludes||{};Object.keys(h).sort().forEach(function(S){var l=h[S]||[];l.sort().forEach(function(s){c.push(S+":-"+s)})});var d=n.disjunctiveFacetsRefinements||{};Object.keys(d).sort().forEach(function(S){var l=d[S]||[];if(!(S===i||!l||l.length===0)){var s=[];l.slice().sort().forEach(function(o){s.push(S+":"+o)}),c.push(s)}});var m=n.hierarchicalFacetsRefinements||{};return Object.keys(m).sort().forEach(function(S){var l=m[S]||[],s=l[0];if(s!==void 0){var o=n.getHierarchicalFacetByName(S),v=n._getHierarchicalFacetSeparator(o),g=n._getHierarchicalRootPath(o),u,p;if(i===S){if(s.indexOf(v)===-1||!g&&a===!0||g&&g.split(v).length===s.split(v).length)return;g?(p=g.split(v).length-1,s=g):(p=s.split(v).length-2,s=s.slice(0,s.lastIndexOf(v))),u=o.attributes[p]}else p=s.split(v).length-1,u=o.attributes[p];u&&c.push([u+":"+s])}}),c},_getHitsHierarchicalFacetsAttributes:function(n){var i=[];return n.hierarchicalFacets.reduce(function(c,f){var h=n.getHierarchicalRefinement(f.name)[0];if(!h)return c.push(f.attributes[0]),c;var d=n._getHierarchicalFacetSeparator(f),m=h.split(d).length,S=f.attributes.slice(0,m+1);return c.concat(S)},i)},_getDisjunctiveHierarchicalFacetAttribute:function(n,i,a){var c=n._getHierarchicalFacetSeparator(i);if(a===!0){var f=n._getHierarchicalRootPath(i),h=0;return f&&(h=f.split(c).length),[i.attributes[h]]}var d=n.getHierarchicalRefinement(i.name)[0]||"",m=d.split(c).length-1;return i.attributes.slice(0,m+1)},getSearchForFacetQuery:function(n,i,a,c){var f=c.isDisjunctiveFacet(n)?c.clearRefinements(n):c,h={facetQuery:i,facetName:n};return typeof a=="number"&&(h.maxFacetHits=a),t(e({},r._getHitsSearchParams(f),h))}};return ft=r,ft}var lt,Or;function cr(){return Or||(Or=1,lt=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},{})}),lt}var ht,wr;function Qe(){return wr||(wr=1,ht=function(t,r){if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(r(t[n]))return t[n]}}),ht}var dt,jr;function na(){if(jr)return dt;jr=1;function e(t,r){return t.filter(function(n,i){return r.indexOf(n)>-1&&t.indexOf(n)===i})}return dt=e,dt}var mt,_r;function ia(){if(_r)return mt;_r=1;function e(t){if(typeof t=="number")return t;if(typeof t=="string")return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}return mt=e,mt}var pt,Fr;function aa(){return Fr||(Fr=1,pt=function(t){return t===null?!1:/^[a-zA-Z0-9_-]{1,64}$/.test(t)}),pt}var vt,xr;function sa(){if(xr)return vt;xr=1;var e=cr(),t=or(),r=ur(),n={addRefinement:function(a,c,f){if(n.isRefined(a,c,f))return a;var h=""+f,d=a[c]?a[c].concat(h):[h],m={};return m[c]=d,e(m,a)},removeRefinement:function(a,c,f){if(f===void 0)return n.clearRefinement(a,function(d,m){return c===m});var h=""+f;return n.clearRefinement(a,function(d,m){return c===m&&h===d})},toggleRefinement:function(a,c,f){if(f===void 0)throw new Error("toggleRefinement should be used with a value");return n.isRefined(a,c,f)?n.removeRefinement(a,c,f):n.addRefinement(a,c,f)},clearRefinement:function(a,c,f){if(c===void 0)return t(a)?{}:a;if(typeof c=="string")return r(a,[c]);if(typeof c=="function"){var h=!1,d=Object.keys(a).reduce(function(m,S){var l=a[S]||[],s=l.filter(function(o){return!c(o,S,f)});return s.length!==l.length&&(h=!0),m[S]=s,m},{});return h?d:a}},isRefined:function(a,c,f){var h=!!a[c]&&a[c].length>0;if(f===void 0||!h)return h;var d=""+f;return a[c].indexOf(d)!==-1}};return vt=n,vt}var gt,Er;function ei(){if(Er)return gt;Er=1;var e=cr(),t=Qe(),r=na(),n=sr(),i=or(),a=ur(),c=ia(),f=aa(),h=sa();function d(l,s){return Array.isArray(l)&&Array.isArray(s)?l.length===s.length&&l.every(function(o,v){return d(s[v],o)}):l===s}function m(l,s){return t(l,function(o){return d(o,s)})}function S(l){var s=l?S._parseNumbers(l):{};s.userToken!==void 0&&!f(s.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=s.facets||[],this.disjunctiveFacets=s.disjunctiveFacets||[],this.hierarchicalFacets=s.hierarchicalFacets||[],this.facetsRefinements=s.facetsRefinements||{},this.facetsExcludes=s.facetsExcludes||{},this.disjunctiveFacetsRefinements=s.disjunctiveFacetsRefinements||{},this.numericRefinements=s.numericRefinements||{},this.tagRefinements=s.tagRefinements||[],this.hierarchicalFacetsRefinements=s.hierarchicalFacetsRefinements||{};var o=this;Object.keys(s).forEach(function(v){var g=S.PARAMETERS.indexOf(v)!==-1,u=s[v]!==void 0;!g&&u&&(o[v]=s[v])})}return S.PARAMETERS=Object.keys(new S),S._parseNumbers=function(l){if(l instanceof S)return l;var s={},o=["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"];if(o.forEach(function(g){var u=l[g];if(typeof u=="string"){var p=parseFloat(u);s[g]=isNaN(p)?u:p}}),Array.isArray(l.insideBoundingBox)&&(s.insideBoundingBox=l.insideBoundingBox.map(function(g){return Array.isArray(g)?g.map(function(u){return parseFloat(u)}):g})),l.numericRefinements){var v={};Object.keys(l.numericRefinements).forEach(function(g){var u=l.numericRefinements[g]||{};v[g]={},Object.keys(u).forEach(function(p){var b=u[p],P=b.map(function(R){return Array.isArray(R)?R.map(function(j){return typeof j=="string"?parseFloat(j):j}):typeof R=="string"?parseFloat(R):R});v[g][p]=P})}),s.numericRefinements=v}return n(l,s)},S.make=function(s){var o=new S(s),v=s.hierarchicalFacets||[];return v.forEach(function(g){if(g.rootPath){var u=o.getHierarchicalRefinement(g.name);u.length>0&&u[0].indexOf(g.rootPath)!==0&&(o=o.clearRefinements(g.name)),u=o.getHierarchicalRefinement(g.name),u.length===0&&(o=o.toggleHierarchicalFacetRefinement(g.name,g.rootPath))}}),o},S.validate=function(l,s){var o=s||{};return l.tagFilters&&o.tagRefinements&&o.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."):l.tagRefinements.length>0&&o.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."):l.numericFilters&&o.numericRefinements&&i(o.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."):i(l.numericRefinements)&&o.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},S.prototype={constructor:S,clearRefinements:function(s){var o={numericRefinements:this._clearNumericRefinements(s),facetsRefinements:h.clearRefinement(this.facetsRefinements,s,"conjunctiveFacet"),facetsExcludes:h.clearRefinement(this.facetsExcludes,s,"exclude"),disjunctiveFacetsRefinements:h.clearRefinement(this.disjunctiveFacetsRefinements,s,"disjunctiveFacet"),hierarchicalFacetsRefinements:h.clearRefinement(this.hierarchicalFacetsRefinements,s,"hierarchicalFacet")};return o.numericRefinements===this.numericRefinements&&o.facetsRefinements===this.facetsRefinements&&o.facetsExcludes===this.facetsExcludes&&o.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&o.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(o)},clearTags:function(){return this.tagFilters===void 0&&this.tagRefinements.length===0?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(s){return s===this.index?this:this.setQueryParameters({index:s})},setQuery:function(s){return s===this.query?this:this.setQueryParameters({query:s})},setPage:function(s){return s===this.page?this:this.setQueryParameters({page:s})},setFacets:function(s){return this.setQueryParameters({facets:s})},setDisjunctiveFacets:function(s){return this.setQueryParameters({disjunctiveFacets:s})},setHitsPerPage:function(s){return this.hitsPerPage===s?this:this.setQueryParameters({hitsPerPage:s})},setTypoTolerance:function(s){return this.typoTolerance===s?this:this.setQueryParameters({typoTolerance:s})},addNumericRefinement:function(l,s,o){var v=c(o);if(this.isNumericRefined(l,s,v))return this;var g=n({},this.numericRefinements);return g[l]=n({},g[l]),g[l][s]?(g[l][s]=g[l][s].slice(),g[l][s].push(v)):g[l][s]=[v],this.setQueryParameters({numericRefinements:g})},getConjunctiveRefinements:function(l){return this.isConjunctiveFacet(l)?this.facetsRefinements[l]||[]:[]},getDisjunctiveRefinements:function(l){return this.isDisjunctiveFacet(l)?this.disjunctiveFacetsRefinements[l]||[]:[]},getHierarchicalRefinement:function(l){return this.hierarchicalFacetsRefinements[l]||[]},getExcludeRefinements:function(l){return this.isConjunctiveFacet(l)?this.facetsExcludes[l]||[]:[]},removeNumericRefinement:function(l,s,o){var v=o;return v!==void 0?this.isNumericRefined(l,s,v)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(g,u){return u===l&&g.op===s&&d(g.val,c(v))})}):this:s!==void 0?this.isNumericRefined(l,s)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(g,u){return u===l&&g.op===s})}):this:this.isNumericRefined(l)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(g,u){return u===l})}):this},getNumericRefinements:function(l){return this.numericRefinements[l]||{}},getNumericRefinement:function(l,s){return this.numericRefinements[l]&&this.numericRefinements[l][s]},_clearNumericRefinements:function(s){if(s===void 0)return i(this.numericRefinements)?{}:this.numericRefinements;if(typeof s=="string")return a(this.numericRefinements,[s]);if(typeof s=="function"){var o=!1,v=this.numericRefinements,g=Object.keys(v).reduce(function(u,p){var b=v[p],P={};return b=b||{},Object.keys(b).forEach(function(R){var j=b[R]||[],_=[];
1j.forEach(function(y){var O=s({val:y,op:R},p,"numeric");O||_.push(y)}),_.length!==j.length&&(o=!0),P[R]=_}),u[p]=P,u},{});return o?g:this.numericRefinements}},addFacet:function(s){return this.isConjunctiveFacet(s)?this:this.setQueryParameters({facets:this.facets.concat([s])})},addDisjunctiveFacet:function(s){return this.isDisjunctiveFacet(s)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([s])})},addHierarchicalFacet:function(s){if(this.isHierarchicalFacet(s.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+s.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([s])})},addFacetRefinement:function(s,o){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsRefinements,s,o)?this:this.setQueryParameters({facetsRefinements:h.addRefinement(this.facetsRefinements,s,o)})},addExcludeRefinement:function(s,o){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsExcludes,s,o)?this:this.setQueryParameters({facetsExcludes:h.addRefinement(this.facetsExcludes,s,o)})},addDisjunctiveFacetRefinement:function(s,o){if(!this.isDisjunctiveFacet(s))throw new Error(s+" is not defined in the disjunctiveFacets attribute of the helper configuration");return h.isRefined(this.disjunctiveFacetsRefinements,s,o)?this:this.setQueryParameters({disjunctiveFacetsRefinements:h.addRefinement(this.disjunctiveFacetsRefinements,s,o)})},addTagRefinement:function(s){if(this.isTagRefined(s))return this;var o={tagRefinements:this.tagRefinements.concat(s)};return this.setQueryParameters(o)},removeFacet:function(s){return this.isConjunctiveFacet(s)?this.clearRefinements(s).setQueryParameters({facets:this.facets.filter(function(o){return o!==s})}):this},removeDisjunctiveFacet:function(s){return this.isDisjunctiveFacet(s)?this.clearRefinements(s).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(o){return o!==s})}):this},removeHierarchicalFacet:function(s){return this.isHierarchicalFacet(s)?this.clearRefinements(s).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(o){return o.name!==s})}):this},removeFacetRefinement:function(s,o){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsRefinements,s,o)?this.setQueryParameters({facetsRefinements:h.removeRefinement(this.facetsRefinements,s,o)}):this},removeExcludeRefinement:function(s,o){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsExcludes,s,o)?this.setQueryParameters({facetsExcludes:h.removeRefinement(this.facetsExcludes,s,o)}):this},removeDisjunctiveFacetRefinement:function(s,o){if(!this.isDisjunctiveFacet(s))throw new Error(s+" is not defined in the disjunctiveFacets attribute of the helper configuration");return h.isRefined(this.disjunctiveFacetsRefinements,s,o)?this.setQueryParameters({disjunctiveFacetsRefinements:h.removeRefinement(this.disjunctiveFacetsRefinements,s,o)}):this},removeTagRefinement:function(s){if(!this.isTagRefined(s))return this;var o={tagRefinements:this.tagRefinements.filter(function(v){return v!==s})};return this.setQueryParameters(o)},toggleRefinement:function(s,o){return this.toggleFacetRefinement(s,o)},toggleFacetRefinement:function(s,o){if(this.isHierarchicalFacet(s))return this.toggleHierarchicalFacetRefinement(s,o);if(this.isConjunctiveFacet(s))return this.toggleConjunctiveFacetRefinement(s,o);if(this.isDisjunctiveFacet(s))return this.toggleDisjunctiveFacetRefinement(s,o);throw new Error("Cannot refine the undeclared facet "+s+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(s,o){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:h.toggleRefinement(this.facetsRefinements,s,o)})},toggleExcludeFacetRefinement:function(s,o){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:h.toggleRefinement(this.facetsExcludes,s,o)})},toggleDisjunctiveFacetRefinement:function(s,o){if(!this.isDisjunctiveFacet(s))throw new Error(s+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:h.toggleRefinement(this.disjunctiveFacetsRefinements,s,o)})},toggleHierarchicalFacetRefinement:function(s,o){if(!this.isHierarchicalFacet(s))throw new Error(s+" is not defined in the hierarchicalFacets attribute of the helper configuration");var v=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(s)),g={},u=this.hierarchicalFacetsRefinements[s]!==void 0&&this.hierarchicalFacetsRefinements[s].length>0&&(this.hierarchicalFacetsRefinements[s][0]===o||this.hierarchicalFacetsRefinements[s][0].indexOf(o+v)===0);return u?o.indexOf(v)===-1?g[s]=[]:g[s]=[o.slice(0,o.lastIndexOf(v))]:g[s]=[o],this.setQueryParameters({hierarchicalFacetsRefinements:e(g,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(l,s){if(this.isHierarchicalFacetRefined(l))throw new Error(l+" is already refined.");if(!this.isHierarchicalFacet(l))throw new Error(l+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var o={};return o[l]=[s],this.setQueryParameters({hierarchicalFacetsRefinements:e(o,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(l){if(!this.isHierarchicalFacetRefined(l))return this;var s={};return s[l]=[],this.setQueryParameters({hierarchicalFacetsRefinements:e(s,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(s){return this.isTagRefined(s)?this.removeTagRefinement(s):this.addTagRefinement(s)},isDisjunctiveFacet:function(l){return this.disjunctiveFacets.indexOf(l)>-1},isHierarchicalFacet:function(l){return this.getHierarchicalFacetByName(l)!==void 0},isConjunctiveFacet:function(l){return this.facets.indexOf(l)>-1},isFacetRefined:function(s,o){return this.isConjunctiveFacet(s)?h.isRefined(this.facetsRefinements,s,o):!1},isExcludeRefined:function(s,o){return this.isConjunctiveFacet(s)?h.isRefined(this.facetsExcludes,s,o):!1},isDisjunctiveFacetRefined:function(s,o){return this.isDisjunctiveFacet(s)?h.isRefined(this.disjunctiveFacetsRefinements,s,o):!1},isHierarchicalFacetRefined:function(s,o){if(!this.isHierarchicalFacet(s))return!1;var v=this.getHierarchicalRefinement(s);return o?v.indexOf(o)!==-1:v.length>0},isNumericRefined:function(s,o,v){if(v===void 0&&o===void 0)return!!this.numericRefinements[s];var g=this.numericRefinements[s]&&this.numericRefinements[s][o]!==void 0;if(v===void 0||!g)return g;var u=c(v),p=m(this.numericRefinements[s][o],u)!==void 0;return g&&p},isTagRefined:function(s){return this.tagRefinements.indexOf(s)!==-1},getRefinedDisjunctiveFacets:function(){var s=this,o=r(Object.keys(this.numericRefinements).filter(function(v){return Object.keys(s.numericRefinements[v]).length>0}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(v){return s.disjunctiveFacetsRefinements[v].length>0}).concat(o).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var s=this;return r(this.hierarchicalFacets.map(function(o){return o.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(o){return s.hierarchicalFacetsRefinements[o].length>0})).sort()},getUnrefinedDisjunctiveFacets:function(){var l=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(s){return l.indexOf(s)===-1})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var s=this.managedParameters,o={},v=this;
1return Object.keys(this).forEach(function(g){var u=v[g];s.indexOf(g)===-1&&u!==void 0&&(o[g]=u)}),o},setQueryParameter:function(s,o){if(this[s]===o)return this;var v={};return v[s]=o,this.setQueryParameters(v)},setQueryParameters:function(s){if(!s)return this;var o=S.validate(this,s);if(o)throw o;var v=this,g=S._parseNumbers(s),u=Object.keys(this).reduce(function(b,P){return b[P]=v[P],b},{}),p=Object.keys(g).reduce(function(b,P){var R=b[P]!==void 0,j=g[P]!==void 0;return R&&!j?a(b,[P]):(j&&(b[P]=g[P]),b)},u);return new this.constructor(p)},resetPage:function(){return this.page===void 0?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(l){return l.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(l){return l.separator||" > "},_getHierarchicalRootPath:function(l){return l.rootPath||null},_getHierarchicalShowParentLevel:function(l){return typeof l.showParentLevel=="boolean"?l.showParentLevel:!0},getHierarchicalFacetByName:function(l){return t(this.hierarchicalFacets,function(s){return s.name===l})},getHierarchicalFacetBreadcrumb:function(l){if(!this.isHierarchicalFacet(l))return[];var s=this.getHierarchicalRefinement(l)[0];if(!s)return[];var o=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(l)),v=s.split(o);return v.map(function(g){return g.trim()})},toString:function(){return JSON.stringify(this,null,2)}},gt=S,gt}var yt,Tr;function oa(){return Tr||(Tr=1,yt=function(t){return Array.isArray(t)?t.filter(Boolean):[]}),yt}var bt,Ar;function ua(){return Ar||(Ar=1,bt=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}),bt}var St,$r;function ti(){if($r)return St;$r=1;var e=Qe();return St=function(r,n){var i=(n||[]).map(function(a){return a.split(":")});return r.reduce(function(c,f){var h=f.split(":"),d=e(i,function(m){return m[0]===h[0]});return h.length>1||!d?(c[0].push(h[0]),c[1].push(h[1]),c):(c[0].push(d[0]),c[1].push(d[1]),c)},[[],[]])},St}var Rt,Ir;function ca(){if(Ir)return Rt;Ir=1;function e(){var t=Array.prototype.slice.call(arguments);return t.reduceRight(function(r,n){return Object.keys(Object(n)).forEach(function(i){var a=typeof r[i]=="number"?r[i]:0,c=n[i];c!==void 0&&c>=a&&(r[i]!==void 0&&delete r[i],r[i]=c)}),r},{})}return Rt=e,Rt}var Pt,Hr;function ri(){if(Hr)return Pt;Hr=1;function e(r,n){if(r!==n){var i=r!==void 0,a=r===null,c=n!==void 0,f=n===null;if(!f&&r>n||a&&c||!i)return 1;if(!a&&r<n||f&&i||!c)return-1}return 0}function t(r,n,i){if(!Array.isArray(r))return[];Array.isArray(i)||(i=[]);var a=r.map(function(c,f){return{criteria:n.map(function(h){return c[h]}),index:f,value:c}});return a.sort(function(f,h){for(var d=-1;++d<f.criteria.length;){var m=e(f.criteria[d],h.criteria[d]);if(m)return d>=i.length?m:i[d]==="desc"?-m:m}return f.index-h.index}),a.map(function(c){return c.value})}return Pt=t,Pt}var Ot,Cr;function fa(){if(Cr)return Ot;Cr=1,Ot=c;var e=ar(),t=Qe(),r=ti(),n=ri(),i=e.escapeFacetValue,a=e.unescapeFacetValue;function c(m){return function(l,s){var o=m.hierarchicalFacets[s],v=m.hierarchicalFacetsRefinements[o.name]&&m.hierarchicalFacetsRefinements[o.name][0]||"",g=m._getHierarchicalFacetSeparator(o),u=m._getHierarchicalRootPath(o),p=m._getHierarchicalShowParentLevel(o),b=r(m._getHierarchicalFacetSortBy(o)),P=l.every(function(_){return _.exhaustive}),R=f(b,g,u,p,v),j=l;return u&&(j=l.slice(u.split(g).length)),j.reduce(R,{name:m.hierarchicalFacets[s].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:P,data:null})}}function f(m,S,l,s,o){return function(g,u,p){var b=g;if(p>0){var P=0;for(b=g;P<p;){var R=b&&Array.isArray(b.data)?b.data:[];b=t(R,function(_){return _.isRefined}),P++}}if(b){var j=Object.keys(u.data).map(function(_){return[_,u.data[_]]}).filter(function(_){var y=_[0];return h(y,b.path||l,o,S,l,s)});b.data=n(j.map(function(_){var y=_[0],O=_[1];return d(O,y,S,a(o),u.exhaustive)}),m[0],m[1])}return g}}function h(m,S,l,s,o,v){return o&&(m.indexOf(o)!==0||o===m)?!1:!o&&m.indexOf(s)===-1||o&&m.split(s).length-o.split(s).length===1||m.indexOf(s)===-1&&l.indexOf(s)===-1||l.indexOf(m)===0||m.indexOf(S+s)===0&&(v||m.indexOf(l)===0)}function d(m,S,l,s,o){var v=S.split(l);return{name:v[v.length-1].trim(),path:S,escapedValue:i(S),count:m,isRefined:s===S||s.indexOf(S+l)===0,exhaustive:o,data:null}}return Ot}var wt,Dr;function ni(){if(Dr)return wt;Dr=1;var e=oa(),t=cr(),r=ar(),n=Qe(),i=ua(),a=ti(),c=ca(),f=ri(),h=r.escapeFacetValue,d=r.unescapeFacetValue,m=fa();function S(y){var O={};
1return y.forEach(function(w,F){O[w]=F}),O}function l(y,O,w){O&&O[w]&&(y.stats=O[w])}function s(y,O){return n(y,function(F){var x=F.attributes||[];return x.indexOf(O)>-1})}function o(y,O,w){var F=O[0]||{};this._rawResults=O;var x=this;Object.keys(F).forEach(function(T){x[T]=F[T]});var E=t(w,{persistHierarchicalRootCount:!1});Object.keys(E).forEach(function(T){x[T]=E[T]}),this.processingTimeMS=O.reduce(function(T,W){return W.processingTimeMS===void 0?T:T+W.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=y.hierarchicalFacets.map(function(){return[]}),this.facets=[];var I=y.getRefinedDisjunctiveFacets(),H=S(y.facets),A=S(y.disjunctiveFacets),$=1,N=F.facets||{};Object.keys(N).forEach(function(T){var W=N[T],Q=s(y.hierarchicalFacets,T);if(Q){var k=Q.attributes.indexOf(T),M=i(y.hierarchicalFacets,function(K){return K.name===Q.name});x.hierarchicalFacets[M][k]={attribute:T,data:W,exhaustive:F.exhaustiveFacetsCount}}else{var Y=y.disjunctiveFacets.indexOf(T)!==-1,D=y.facets.indexOf(T)!==-1,L;Y&&(L=A[T],x.disjunctiveFacets[L]={name:T,data:W,exhaustive:F.exhaustiveFacetsCount},l(x.disjunctiveFacets[L],F.facets_stats,T)),D&&(L=H[T],x.facets[L]={name:T,data:W,exhaustive:F.exhaustiveFacetsCount},l(x.facets[L],F.facets_stats,T))}}),this.hierarchicalFacets=e(this.hierarchicalFacets),I.forEach(function(T){var W=O[$],Q=W&&W.facets?W.facets:{},k=y.getHierarchicalFacetByName(T);Object.keys(Q).forEach(function(M){var Y=Q[M],D;if(k){D=i(y.hierarchicalFacets,function(B){return B.name===k.name});var L=i(x.hierarchicalFacets[D],function(B){return B.attribute===M});if(L===-1)return;x.hierarchicalFacets[D][L].data=x.persistHierarchicalRootCount?c(x.hierarchicalFacets[D][L].data,Y):t(Y,x.hierarchicalFacets[D][L].data)}else{D=A[M];var K=F.facets&&F.facets[M]||{};x.disjunctiveFacets[D]={name:M,data:c(K,Y),exhaustive:W.exhaustiveFacetsCount},l(x.disjunctiveFacets[D],W.facets_stats,M),y.disjunctiveFacetsRefinements[M]&&y.disjunctiveFacetsRefinements[M].forEach(function(B){!x.disjunctiveFacets[D].data[B]&&y.disjunctiveFacetsRefinements[M].indexOf(d(B))>-1&&(x.disjunctiveFacets[D].data[B]=0)})}}),$++}),y.getRefinedHierarchicalFacets().forEach(function(T){var W=y.getHierarchicalFacetByName(T),Q=y._getHierarchicalFacetSeparator(W),k=y.getHierarchicalRefinement(T);k.length===0||k[0].split(Q).length<2||O.slice($).forEach(function(M){var Y=M&&M.facets?M.facets:{};Object.keys(Y).forEach(function(D){var L=Y[D],K=i(y.hierarchicalFacets,function(fe){return fe.name===W.name}),B=i(x.hierarchicalFacets[K],function(fe){return fe.attribute===D});if(B!==-1){var te={};if(k.length>0&&!x.persistHierarchicalRootCount){var ie=k[0].split(Q)[0];te[ie]=x.hierarchicalFacets[K][B].data[ie]}x.hierarchicalFacets[K][B].data=t(te,L,x.hierarchicalFacets[K][B].data)}}),$++})}),Object.keys(y.facetsExcludes).forEach(function(T){var W=y.facetsExcludes[T],Q=H[T];x.facets[Q]={name:T,data:N[T],exhaustive:F.exhaustiveFacetsCount},W.forEach(function(k){x.facets[Q]=x.facets[Q]||{name:T},x.facets[Q].data=x.facets[Q].data||{},x.facets[Q].data[k]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(m(y)),this.facets=e(this.facets),this.disjunctiveFacets=e(this.disjunctiveFacets),this._state=y}o.prototype.getFacetByName=function(y){function O(w){return w.name===y}return n(this.facets,O)||n(this.disjunctiveFacets,O)||n(this.hierarchicalFacets,O)};function v(y,O){function w(N){return N.name===O}if(y._state.isConjunctiveFacet(O)){var F=n(y.facets,w);return F?Object.keys(F.data).map(function(N){var T=h(N);return{name:N,escapedValue:T,count:F.data[N],isRefined:y._state.isFacetRefined(O,T),isExcluded:y._state.isExcludeRefined(O,N)}}):[]}else if(y._state.isDisjunctiveFacet(O)){var x=n(y.disjunctiveFacets,w);return x?Object.keys(x.data).map(function(N){var T=h(N);return{name:N,escapedValue:T,count:x.data[N],isRefined:y._state.isDisjunctiveFacetRefined(O,T)}}):[]}else if(y._state.isHierarchicalFacet(O)){var E=n(y.hierarchicalFacets,w);if(!E)return E;var I=y._state.getHierarchicalFacetByName(O),H=y._state._getHierarchicalFacetSeparator(I),A=d(y._state.getHierarchicalRefinement(O)[0]||"");A.indexOf(I.rootPath)===0&&(A=A.replace(I.rootPath+H,""));var $=A.split(H);return $.unshift(O),g(E,$,0),E}}function g(y,O,w){y.isRefined=y.name===(O[w]&&O[w].trim()),y.data&&y.data.forEach(function(F){g(F,O,w+1)})}function u(y,O,w,F){if(F=F||0,Array.isArray(O))return y(O,w[F]);if(!O.data||O.data.length===0)return O;var x=O.data.map(function(H){return u(y,H,w,F+1)}),E=y(x,w[F]),I=t({data:E},O);return I}
1o.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"];function p(y,O){return O.sort(y)}function b(y,O){var w=[],F=[],x=O.hide||[],E=O.order||[],I=E.reduce(function($,N,T){return $[N]=T,$},{});y.forEach(function($){var N=$.path||$.name,T=x.indexOf(N)>-1;!T&&I[N]!==void 0?w[I[N]]=$:T||F.push($)}),w=w.filter(function($){return $});var H=O.sortRemainingBy,A;return H==="hidden"?w:(H==="alpha"?A=[["path","name"],["asc","asc"]]:A=[["count"],["desc"]],w.concat(f(F,A[0],A[1])))}function P(y,O){return y.renderingContent&&y.renderingContent.facetOrdering&&y.renderingContent.facetOrdering.values&&y.renderingContent.facetOrdering.values[O]}o.prototype.getFacetValues=function(y,O){var w=v(this,y);if(w){var F=t(O,{sortBy:o.DEFAULT_SORT,facetOrdering:!(O&&O.sortBy)}),x=this,E;if(Array.isArray(w))E=[y];else{var I=x._state.getHierarchicalFacetByName(w.name);E=I.attributes}return u(function(H,A){if(F.facetOrdering){var $=P(x,A);if($)return b(H,$)}if(Array.isArray(F.sortBy)){var N=a(F.sortBy,o.DEFAULT_SORT);return f(H,N[0],N[1])}else if(typeof F.sortBy=="function")return p(F.sortBy,H);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},w,E)}},o.prototype.getFacetStats=function(y){if(this._state.isConjunctiveFacet(y))return R(this.facets,y);if(this._state.isDisjunctiveFacet(y))return R(this.disjunctiveFacets,y)};function R(y,O){var w=n(y,function(F){return F.name===O});return w&&w.stats}o.prototype.getRefinements=function(){var y=this._state,O=this,w=[];return Object.keys(y.facetsRefinements).forEach(function(F){y.facetsRefinements[F].forEach(function(x){w.push(j(y,"facet",F,x,O.facets))})}),Object.keys(y.facetsExcludes).forEach(function(F){y.facetsExcludes[F].forEach(function(x){w.push(j(y,"exclude",F,x,O.facets))})}),Object.keys(y.disjunctiveFacetsRefinements).forEach(function(F){y.disjunctiveFacetsRefinements[F].forEach(function(x){w.push(j(y,"disjunctive",F,x,O.disjunctiveFacets))})}),Object.keys(y.hierarchicalFacetsRefinements).forEach(function(F){y.hierarchicalFacetsRefinements[F].forEach(function(x){w.push(_(y,F,x,O.hierarchicalFacets))})}),Object.keys(y.numericRefinements).forEach(function(F){var x=y.numericRefinements[F];Object.keys(x).forEach(function(E){x[E].forEach(function(I){w.push({type:"numeric",attributeName:F,name:I,numericValue:I,operator:E})})})}),y.tagRefinements.forEach(function(F){w.push({type:"tag",attributeName:"_tags",name:F})}),w};function j(y,O,w,F,x){var E=n(x,function(A){return A.name===w}),I=E&&E.data&&E.data[F]?E.data[F]:0,H=E&&E.exhaustive||!1;return{type:O,attributeName:w,name:F,count:I,exhaustive:H}}function _(y,O,w,F){var x=y.getHierarchicalFacetByName(O),E=y._getHierarchicalFacetSeparator(x),I=w.split(E),H=n(F,function(W){return W.name===O}),A=I.reduce(function(W,Q){var k=W&&n(W.data,function(M){return M.name===Q});return k!==void 0?k:W},H),$=A&&A.count||0,N=A&&A.exhaustive||!1,T=A&&A.path||"";return{type:"hierarchical",attributeName:O,name:T,count:$,exhaustive:N}}return wt=o,wt}var jt,Nr;function la(){return Nr||(Nr=1,jt=function(t){return t.reduce(function(r,n){return r.concat(n)},[])}),jt}var _t,Ur;function ha(){if(Ur)return _t;Ur=1;var e=Qe(),t=la();function r(i,a){var c=[];
1return Object.keys(i).forEach(function(f){i[f].count<2&&(i[f].indexSum+=100),c.push({objectID:f,avgOfIndices:i[f].indexSum/a})}),c.sort(function(f,h){return f.avgOfIndices>h.avgOfIndices?1:-1})}function n(i,a){var c={};a.forEach(function(d){d.forEach(function(m,S){i.includes(m.objectID)||(c[m.objectID]?c[m.objectID]={indexSum:c[m.objectID].indexSum+S,count:c[m.objectID].count+1}:c[m.objectID]={indexSum:S,count:1})})});var f=r(c,a.length),h=f.reduce(function(d,m){var S=e(t(a),function(l){return l.objectID===m.objectID});return S?d.concat(S):d},[]);return h}return _t=n,_t}var Ft,Wr;function ii(){return Wr||(Wr=1,Ft="3.26.0"),Ft}var xt,qr;function da(){if(qr)return xt;qr=1;var e=ir(),t=ta(),r=ar().escapeFacetValue,n=Xn(),i=sr(),a=or(),c=ur(),f=Yn(),h=Zn(),d=ra(),m=ei(),S=ni(),l=ha(),s=ii();function o(u,p,b,P){typeof u.addAlgoliaAgent=="function"&&u.addAlgoliaAgent("JS Helper ("+s+")"),this.setClient(u);var R=b||{};R.index=p,this.state=m.make(R),this.recommendState=new f({params:R.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=P,this._recommendCache={}}n(o,e),o.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},o.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},o.prototype.searchWithComposition=function(){return this._runComposition({onlyWithDerivedHelpers:!0}),this},o.prototype.recommend=function(){return this._recommend(),this},o.prototype.getQuery=function(){var u=this.state;return d._getHitsSearchParams(u)},o.prototype.searchOnce=function(u,p){var b=u?this.state.setQueryParameters(u):this.state,P=d._getQueries(b.index,b),R=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:b}),p){this.client.search(P).then(function(j){R._currentNbQueries--,R._currentNbQueries===0&&R.emit("searchQueueEmpty"),p(null,new S(b,j.results),b)}).catch(function(j){R._currentNbQueries--,R._currentNbQueries===0&&R.emit("searchQueueEmpty"),p(j,null,b)});return}return this.client.search(P).then(function(j){return R._currentNbQueries--,R._currentNbQueries===0&&R.emit("searchQueueEmpty"),{content:new S(b,j.results),state:b,_originalResponse:j}},function(j){throw R._currentNbQueries--,R._currentNbQueries===0&&R.emit("searchQueueEmpty"),j})},o.prototype.findAnswers=function(u){console.warn("[algoliasearch-helper] answers is no longer supported");var p=this.state,b=this.derivedHelpers[0];if(!b)return Promise.resolve([]);var P=b.getModifiedState(p),R=i({attributesForPrediction:u.attributesForPrediction,nbHits:u.nbHits},{params:c(d._getHitsSearchParams(P),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),j="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(j);var _=this.client.initIndex(P.index);if(typeof _.findAnswers!="function")throw new Error(j);return _.findAnswers(P.query,u.queryLanguages,R)},o.prototype.searchForFacetValues=function(u,p,b,P){var R=typeof this.client.searchForFacetValues=="function"&&typeof this.client.searchForFacets!="function",j=typeof this.client.initIndex=="function";if(!R&&!j&&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 _=this.state.setQueryParameters(P||{}),y=_.isDisjunctiveFacet(u),O=d.getSearchForFacetQuery(u,p,b,_);this._currentNbQueries++;var w=this,F;R?F=this.client.searchForFacetValues([{indexName:_.index,params:O}]):j?F=this.client.initIndex(_.index).searchForFacetValues(O):(delete O.facetName,F=this.client.search([{type:"facet",facet:u,indexName:_.index,params:O}]).then(function(I){return I.results[0]})),this.emit("searchForFacetValues",{state:_,facet:u,query:p});var x=this.lastResults&&this.lastResults.index===_.index&&this.lastResults.renderingContent&&this.lastResults.renderingContent.facetOrdering&&this.lastResults.renderingContent.facetOrdering.values&&this.lastResults.renderingContent.facetOrdering.values[u]&&this.lastResults.renderingContent.facetOrdering.values[u].hide||[];return F.then(function(I){return w._currentNbQueries--,w._currentNbQueries===0&&w.emit("searchQueueEmpty"),I=Array.isArray(I)?I[0]:I,I.facetHits.forEac
1h(function(H,A){if(x.indexOf(H.value)>-1){I.facetHits.splice(A,1);return}H.escapedValue=r(H.value),H.isRefined=y?_.isDisjunctiveFacetRefined(u,H.escapedValue):_.isFacetRefined(u,H.escapedValue)}),I},function(E){throw w._currentNbQueries--,w._currentNbQueries===0&&w.emit("searchQueueEmpty"),E})},o.prototype.searchForCompositionFacetValues=function(u,p,b,P){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 R=this.state.setQueryParameters(P||{}),j=R.isDisjunctiveFacet(u);this._currentNbQueries++;var _=this,y;return y=this.client.searchForFacetValues({compositionID:R.index,facetName:u,searchForFacetValuesRequest:{params:{query:p,maxFacetHits:b,searchQuery:d._getCompositionHitsSearchParams(R)}}}),this.emit("searchForFacetValues",{state:R,facet:u,query:p}),y.then(function(w){return _._currentNbQueries--,_._currentNbQueries===0&&_.emit("searchQueueEmpty"),w=w.results[0],w.facetHits.forEach(function(F){F.escapedValue=r(F.value),F.isRefined=j?R.isDisjunctiveFacetRefined(u,F.escapedValue):R.isFacetRefined(u,F.escapedValue)}),w},function(O){throw _._currentNbQueries--,_._currentNbQueries===0&&_.emit("searchQueueEmpty"),O})},o.prototype.setQuery=function(u){return this._change({state:this.state.resetPage().setQuery(u),isPageReset:!0}),this},o.prototype.clearRefinements=function(u){return this._change({state:this.state.resetPage().clearRefinements(u),isPageReset:!0}),this},o.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},o.prototype.addDisjunctiveFacetRefinement=function(u,p){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(u,p),isPageReset:!0}),this},o.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},o.prototype.addHierarchicalFacetRefinement=function(u,p){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(u,p),isPageReset:!0}),this},o.prototype.addNumericRefinement=function(u,p,b){return this._change({state:this.state.resetPage().addNumericRefinement(u,p,b),isPageReset:!0}),this},o.prototype.addFacetRefinement=function(u,p){return this._change({state:this.state.resetPage().addFacetRefinement(u,p),isPageReset:!0}),this},o.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},o.prototype.addFacetExclusion=function(u,p){return this._change({state:this.state.resetPage().addExcludeRefinement(u,p),isPageReset:!0}),this},o.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},o.prototype.addTag=function(u){return this._change({state:this.state.resetPage().addTagRefinement(u),isPageReset:!0}),this},o.prototype.addFrequentlyBoughtTogether=function(u){return this._recommendChange({state:this.recommendState.addFrequentlyBoughtTogether(u)}),this},o.prototype.addRelatedProducts=function(u){return this._recommendChange({state:this.recommendState.addRelatedProducts(u)}),this},o.prototype.addTrendingItems=function(u){return this._recommendChange({state:this.recommendState.addTrendingItems(u)}),this},o.prototype.addTrendingFacets=function(u){return this._recommendChange({state:this.recommendState.addTrendingFacets(u)}),this},o.prototype.addLookingSimilar=function(u){return this._recommendChange({state:this.recommendState.addLookingSimilar(u)}),this},o.prototype.removeNumericRefinement=function(u,p,b){return this._change({state:this.state.resetPage().removeNumericRefinement(u,p,b),isPageReset:!0}),this},o.prototype.removeDisjunctiveFacetRefinement=function(u,p){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(u,p),isPageReset:!0}),this},o.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},o.prototype.removeHierarchicalFacetRefinement=function(u){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(u),isPageReset:!0}),this},o.prototype.removeFacetRefinement=function(u,p){return this._change({state:this.state.resetPage().removeFacetRefinement(u,p),isPageReset:!0}),this},o.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},o.prototype.removeFacetExclusion=function(u,p){return this._change({state:this.state.resetPage().removeExcludeRefinement(u,p),isPageReset:!0}),this},o.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},o.prototype.removeTag=function(u){return this._change({state:this.state.resetPage().removeTagRefinement(u),isPageReset:!0}),this},o.prototype.removeFrequentlyBoughtTogether=function(u){return this._recommendChange({state:this.recommendState.removeParam
1s(u)}),this},o.prototype.removeRelatedProducts=function(u){return this._recommendChange({state:this.recommendState.removeParams(u)}),this},o.prototype.removeTrendingItems=function(u){return this._recommendChange({state:this.recommendState.removeParams(u)}),this},o.prototype.removeTrendingFacets=function(u){return this._recommendChange({state:this.recommendState.removeParams(u)}),this},o.prototype.removeLookingSimilar=function(u){return this._recommendChange({state:this.recommendState.removeParams(u)}),this},o.prototype.toggleFacetExclusion=function(u,p){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(u,p),isPageReset:!0}),this},o.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},o.prototype.toggleRefinement=function(u,p){return this.toggleFacetRefinement(u,p)},o.prototype.toggleFacetRefinement=function(u,p){return this._change({state:this.state.resetPage().toggleFacetRefinement(u,p),isPageReset:!0}),this},o.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},o.prototype.toggleTag=function(u){return this._change({state:this.state.resetPage().toggleTagRefinement(u),isPageReset:!0}),this},o.prototype.nextPage=function(){var u=this.state.page||0;return this.setPage(u+1)},o.prototype.previousPage=function(){var u=this.state.page||0;return this.setPage(u-1)};function v(u){if(u<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(u),isPageReset:!1}),this}o.prototype.setCurrentPage=v,o.prototype.setPage=v,o.prototype.setIndex=function(u){return this._change({state:this.state.resetPage().setIndex(u),isPageReset:!0}),this},o.prototype.setQueryParameter=function(u,p){return this._change({state:this.state.resetPage().setQueryParameter(u,p),isPageReset:!0}),this},o.prototype.setState=function(u){return this._change({state:m.make(u),isPageReset:!1}),this},o.prototype.overrideStateWithoutTriggeringChangeEvent=function(u){return this.state=new m(u),this},o.prototype.hasRefinements=function(u){return a(this.state.getNumericRefinements(u))?!0:this.state.isConjunctiveFacet(u)?this.state.isFacetRefined(u):this.state.isDisjunctiveFacet(u)?this.state.isDisjunctiveFacetRefined(u):this.state.isHierarchicalFacet(u)?this.state.isHierarchicalFacetRefined(u):!1},o.prototype.isExcluded=function(u,p){return this.state.isExcludeRefined(u,p)},o.prototype.isDisjunctiveRefined=function(u,p){return this.state.isDisjunctiveFacetRefined(u,p)},o.prototype.hasTag=function(u){return this.state.isTagRefined(u)},o.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},o.prototype.getIndex=function(){return this.state.index};function g(){return this.state.page}return o.prototype.getCurrentPage=g,o.prototype.getPage=g,o.prototype.getTags=function(){return this.state.tagRefinements},o.prototype.getRefinements=function(u){var p=[];if(this.state.isConjunctiveFacet(u)){var b=this.state.getConjunctiveRefinements(u);b.forEach(function(_){p.push({value:_,type:"conjunctive"})});var P=this.state.getExcludeRefinements(u);P.forEach(function(_){p.push({value:_,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(u)){var R=this.state.getDisjunctiveRefinements(u);R.forEach(function(_){p.push({value:_,type:"disjunctive"})})}var j=this.state.getNumericRefinements(u);return Object.keys(j).forEach(function(_){var y=j[_];p.push({value:y,operator:_,type:"numeric"})}),p},o.prototype.getNumericRefinement=function(u,p){return this.state.getNumericRefinement(u,p)},o.prototype.getHierarchicalFacetBreadcrumb=function(u){return this.state.getHierarchicalFacetBreadcrumb(u)},o.prototype._search=function(u){var p=this.state,b=[],P=[];u.onlyWithDerivedHelpers||(P=d._getQueries(p.index,p),b.push({state:p,queriesCount:P.length,helper:this}),this.emit("search",{state:p,results:this.lastResults}));var R=this.derivedHelpers.map(function(y){var O=y.getModifiedState(p),w=O.index?d._getQueries(O.index,O):[];return b.push({state:O,queriesCount:w.length,helper:y}),y.emit("search",{state:O,results:y.lastResults}),w}),j=Array.prototype.concat.apply(P,R),_=this._queryId++;if(this._currentNbQueries++,!j.length)return Promise.resolve({results:[]}
1).then(this._dispatchAlgoliaResponse.bind(this,b,_));try{this.client.search(j).then(this._dispatchAlgoliaResponse.bind(this,b,_)).catch(this._dispatchAlgoliaError.bind(this,_))}catch(y){this.emit("error",{error:y})}},o.prototype._runComposition=function(){var u=this.state,p=[],b=[],P=this.derivedHelpers.map(function(y){var O=y.getModifiedState(u),w=d._getCompositionQueries(O);return p.push({state:O,queriesCount:w.length,helper:y}),y.emit("search",{state:O,results:y.lastResults}),w}),R=Array.prototype.concat.apply(b,P),j=this._queryId++;if(this._currentNbQueries++,!R.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,p,j));if(R.length>1)throw new Error("Only one query is allowed when using a composition.");var _=R[0];try{this.client.search(_).then(this._dispatchAlgoliaResponse.bind(this,p,j)).catch(this._dispatchAlgoliaError.bind(this,j))}catch(y){this.emit("error",{error:y})}},o.prototype._recommend=function(){var u=this.state,p=this.recommendState,b=this.getIndex(),P=[{state:p,index:b,helper:this}],R=p.params.map(function(w){return w.$$id});this.emit("fetch",{recommend:{state:p,results:this.lastRecommendResults}});var j=this._recommendCache,_=this.derivedHelpers.map(function(w){var F=w.getModifiedState(u).index;if(!F)return[];var x=w.getModifiedRecommendState(new f);return P.push({state:x,index:F,helper:w}),R=Array.prototype.concat.apply(R,x.params.map(function(E){return E.$$id})),w.emit("fetch",{recommend:{state:x,results:w.lastRecommendResults}}),x._buildQueries(F,j)}),y=Array.prototype.concat.apply(this.recommendState._buildQueries(b,j),_);if(y.length!==0){if(y.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 O=this._recommendQueryId++;this._currentNbRecommendQueries++;try{this.client.getRecommendations(y).then(this._dispatchRecommendResponse.bind(this,O,P,R)).catch(this._dispatchRecommendError.bind(this,O))}catch(w){this.emit("error",{error:w})}}},o.prototype._dispatchAlgoliaResponse=function(u,p,b){var P=this;if(!(p<this._lastQueryIdReceived)){this._currentNbQueries-=p-this._lastQueryIdReceived,this._lastQueryIdReceived=p,this._currentNbQueries===0&&this.emit("searchQueueEmpty");var R=b.results.slice(),j=Object.keys(b).reduce(function(_,y){return y!=="results"&&(_[y]=b[y]),_},{});Object.keys(j).length<=0&&(j=void 0),u.forEach(function(_){var y=_.state,O=_.queriesCount,w=_.helper,F=R.splice(0,O);if(!y.index){w.emit("result",{results:null,state:y});return}w.lastResults=new S(y,F,P._searchResultsOptions),j!==void 0&&(w.lastResults._rawContent=j),w.emit("result",{results:w.lastResults,state:y})})}},o.prototype._dispatchRecommendResponse=function(u,p,b,P){if(!(u<this._lastRecommendQueryIdReceived)){this._currentNbRecommendQueries-=u-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=u,this._currentNbRecommendQueries===0&&this.emit("recommendQueueEmpty");var R=this._recommendCache,j={};b.filter(function(y){return R[y]===void 0}).forEach(function(y,O){j[y]||(j[y]=[]),j[y].push(O)}),Object.keys(j).forEach(function(y){var O=j[y],w=P.results[O[0]];if(O.length===1){R[y]=w;return}R[y]=Object.assign({},w,{hits:l(b,O.map(function(F){return P.results[F].hits}))})});var _={};b.forEach(function(y){_[y]=R[y]}),p.forEach(function(y){var O=y.state,w=y.helper;if(!y.index){w.emit("recommend:result",{results:null,state:O});return}w.lastRecommendResults=new h(O,_),w.emit("recommend:result",{recommend:{results:w.lastRecommendResults,state:O}})})}},o.prototype._dispatchAlgoliaError=function(u,p){u<this._lastQueryIdReceived||(this._currentNbQueries-=u-this._lastQueryIdReceived,this._lastQueryIdReceived=u,this.emit("error",{error:p}),this._currentNbQueries===0&&this.emit("searchQueueEmpty"))},o.prototype._dispatchRecommendError=function(u,p){u<this._lastRecommendQueryIdReceived||(this._currentNbRecommendQueries-=u-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=u,this.emit("error",{error:p}),this._currentNbRecommendQueries===0&&this.emit("recommendQueueEmpty"))},o.prototype.containsRefinement=function(u,p,b,P){return u||p.length!==0||b.length!==0||P.length!==0},o.prototype._hasDisjunctiveRefinements=function(u){return this.state.disjunctiveRefinements[u]&&this.state.disjunctiveRefinements[u].length>0},o.prototype._change=function(u){var p=u.state,b=u.isPageReset;
1p!==this.state&&(this.state=p,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:b}))},o.prototype._recommendChange=function(u){var p=u.state;p!==this.recommendState&&(this.recommendState=p,this.emit("recommend:change",{search:{results:this.lastResults,state:this.state},recommend:{results:this.lastRecommendResults,state:this.recommendState}}))},o.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},o.prototype.setClient=function(u){return this.client===u?this:(typeof u.addAlgoliaAgent=="function"&&u.addAlgoliaAgent("JS Helper ("+s+")"),this.client=u,this)},o.prototype.getClient=function(){return this.client},o.prototype.derive=function(u,p){var b=new t(this,u,p);return this.derivedHelpers.push(b),b},o.prototype.detachDerivedHelper=function(u){var p=this.derivedHelpers.indexOf(u);if(p===-1)throw new Error("Derived helper already detached");this.derivedHelpers.splice(p,1)},o.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},xt=o,xt}var Et,Lr;function ma(){if(Lr)return Et;Lr=1;var e=da(),t=Yn(),r=Zn(),n=ei(),i=ni();function a(c,f,h,d){return new e(c,f,h,d)}return a.version=ii(),a.AlgoliaSearchHelper=e,a.SearchParameters=n,a.RecommendParameters=t,a.SearchResults=i,a.RecommendResults=r,Et=a,Et}var pa=ma();const J=nr(pa);var va=0;function ga(e){e.dependsOn==="recommend"&&(e.$$id=va++)}function ee(){}function ya(e){return Object.prototype.toString.call(e).slice(8,-1)}function ba(e,t){if(e===void 0||typeof e!="function")throw new Error("The render function is not valid (received type ".concat(ya(e),`). 2 3`).concat(t))}var Sa={"&":"&","<":"<",">":">",'"':""","'":"'"},ai=/[&<>"']/g,Ra=RegExp(ai.source);function Pa(e){return e&&Ra.test(e)?e.replace(ai,function(t){return Sa[t]}):e}var Oa={"&":"&","<":"<",">":">",""":'"',"'":"'"},si=/&(amp|quot|lt|gt|#39);/g,wa=RegExp(si.source);function ja(e){return e&&wa.test(e)?e.replace(si,function(t){return Oa[t]}):e}function Bt(e){"@babel/helpers - typeof";return Bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(e)}function _a(e){return e===null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function Fa(e){return Bt(e)==="object"&&e!==null}function oi(e){if(!Fa(e)||_a(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 we(e){"@babel/helpers - typeof";return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(e)}function xa(e){if(e==null)throw new TypeError("Cannot destructure "+e)}function Vt(){return Vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vt.apply(this,arguments)}function Qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qr(Object(r),!0).forEach(function(n){ui(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ui(e,t,r){return t=Ea(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ea(e){var t=Ta(e,"string");return we(t)=="symbol"?t:String(t)}function Ta(e,t){if(we(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(we(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kr={highlightPreTag:"__ais-highlight__",highlightPostTag:"__/ais-highlight__"},X={highlightPreTag:"<mark>",highlightPostTag:"</mark>"};function Aa(e){return Pa(e).replace(new RegExp(kr.highlightPreTag,"g"),X.highlightPreTag).replace(new RegExp(kr.highlightPostTag,"g"),X.highlightPostTag)}function Je(e){return oi(e)&&typeof e.value!="string"?Object.keys(e).reduce(function(t,r){return Me(Me({},t),{},ui({},r,Je(e[r])))},{}):Array.isArray(e)?e.map(Je):Me(Me({},e),{},{value:Aa(e.value)})}function Yc(e){return e.__escaped===void 0&&(e=e.map(function(t){var r=Vt({},(xa(t),t));return r._highlightResult&&(r._highlightResult=Je(r._highlightResult)),r._snippetResult&&(r._snippetResult=Je(r._snippetResult)),r}),e.__escaped=!0),e}function ci(e){var t=X.highlightPreTag,r=X.highlightPostTag;return e.map(function(n){return n.isHighlighted?t+n.value+r:n.value}).join("")}function fi(e){return btoa(encodeURIComponent(JSON.stringify(e)))}function Mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
3t%2?Mr(Object(r),!0).forEach(function(n){$a(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $a(e,t,r){return t=Ia(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ia(e){var t=Ha(e,"string");return me(t)=="symbol"?t:String(t)}function Ha(e,t){if(me(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(me(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ca(e,t){return Wa(e)||Ua(e,t)||Na(e,t)||Da()}function Da(){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 Na(e,t){if(e){if(typeof e=="string")return Br(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Br(e,t)}}function Br(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 Ua(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,c,f=[],h=!0,d=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(h=(n=a.call(r)).done)&&(f.push(n.value),f.length!==t);h=!0);}catch(m){d=!0,i=m}finally{try{if(!h&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function Wa(e){if(Array.isArray(e))return e}function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(e)}function qa(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 li(e){var t=e.helper,r=e.widgetType;e.methodName;var n=e.args,i=e.instantSearchInstance;if(n.length===1&&me(n[0])==="object")return[n[0]];var a=n[0].split(":"),c=Ca(a,2),f=c[0],h=c[1],d=n[1],m=n[2],S=n[3]||{};if(!d)return[];if((f==="click"||f==="conversion")&&!m)return[];var l=Array.isArray(d)?d:[d];if(l.length===0)return[];var s=l[0].__queryID,o=qa(l),v=o.map(function(u){return u.map(function(p){return p.objectID})}),g=o.map(function(u){return u.map(function(p){return p.__position})});return f==="view"?i.status!=="idle"?[]:o.map(function(u,p){var b;return{insightsMethod:"viewedObjectIDs",widgetType:r,eventType:f,payload:Tt({eventName:m||"Hits Viewed",index:((b=t.lastResults)===null||b===void 0?void 0:b.index)||t.state.index,objectIDs:v[p]},S),hits:u,eventModifier:h}}):f==="click"?o.map(function(u,p){var b;return{insightsMethod:"clickedObjectIDsAfterSearch",widgetType:r,eventType:f,payload:Tt({eventName:m||"Hit Clicked",index:((b=t.lastResults)===null||b===void 0?void 0:b.index)||t.state.index,queryID:s,objectIDs:v[p],positions:g[p]},S),hits:u,eventModifier:h}}):f==="conversion"?o.map(function(u,p){var b;return{insightsMethod:"convertedObjectIDsAfterSearch",widgetType:r,eventType:f,payload:Tt({eventName:m||"Hit Converted",index:((b=t.lastResults)===null||b===void 0?void 0:b.index)||t.state.index,queryID:s,objectIDs:v[p]},S),hits:u,eventModifier:h}}):[]}function Zc(e){var t=e.instantSearchInstance,r=e.helper,n=e.widgetType,i={},a=void 0,c=function(){for(var h=arguments.length,d=new Array(h),m=0;m<h;m++)d[m]=arguments[m];var S=li({widgetType:n,helper:r,methodName:"sendEvent",args:d,instantSearchInstance:t});S.forEach(function(l){l.eventType==="click"&&l.eventModifier==="internal"&&i[l.eventType]||(i[l.eventType]=!0,t.sendEventToInsights(l))}),clearTimeout(a),a=setTimeout(function(){i={}},0)};return c}function ef(e){var t=e.helper,r=e.widgetType,n=e.instantSearchInstance,i=function(){for(var c=arguments.length,f=new Array(c),h=0;h<c;h++)f[h]=arguments[h];var d=li({widgetType:r,helper:t,methodName:"bindEvent",args:f,instantSearchInstance:n});return d.length?"data-insights-event=".concat(fi(d)):""};return i}function Z(e){return e.$$type==="ais.index"}function Kt(e,t){var r=e[t.getIndexId()]||{};
4t.getHelper().setState(t.getWidgetSearchParameters(t.getHelper().state,{uiState:r})),t.getWidgets().filter(Z).forEach(function(n){return Kt(e,n)})}var La=Promise.resolve();function ge(e){var t=null,r=!1,n=function(){for(var a=arguments.length,c=new Array(a),f=0;f<a;f++)c[f]=arguments[f];t===null&&(t=La.then(function(){if(t=null,r){r=!1;return}e.apply(void 0,c)}))};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 Qa(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 Xe(){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 Qa(i)}).join(", ");return function(i){return[i,"See documentation: ".concat(n)].filter(Boolean).join(` 5 6`)}}function Vr(e,t){for(var r,n=0;n<e.length;n++)if(r=e[n],t(r,n,e))return r}function ka(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 Kr(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",c=r[i]||n[i],f=r[a
6]||n[a];return[c,f]}else return[e.applicationID,e.apiKey]}function hi(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(c){var f=c.split(t);a.push({value:f[0],isHighlighted:!0}),f[1]!==""&&a.push({value:f[1],isHighlighted:!1})}),a}var Ma=new RegExp(/\w/i);function Ba(e,t){var r,n,i=e[t],a=((r=e[t+1])===null||r===void 0?void 0:r.isHighlighted)||!0,c=((n=e[t-1])===null||n===void 0?void 0:n.isHighlighted)||!0;return!Ma.test(ja(i.value))&&c===a?c:i.isHighlighted}function Ye(e,t){var r=Array.isArray(t)?t:t.split(".");return r.reduce(function(n,i){return n&&n[i]},e)}function je(e){"@babel/helpers - typeof";return je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(e)}function zr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zr(Object(r),!0).forEach(function(n){Va(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Va(e,t,r){return t=Ka(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ka(e){var t=za(e,"string");return je(t)=="symbol"?t:String(t)}function za(e,t){if(je(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(je(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tf(e,t,r){return e.map(function(n,i){return Jr(Jr({},n),{},{__position:r*t+i+1})})}function _e(e){"@babel/helpers - typeof";return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_e(e)}function Gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gr(Object(r),!0).forEach(function(n){Ja(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ja(e,t,r){return t=Ga(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ga(e){var t=Xa(e,"string");return _e(t)=="symbol"?t:String(t)}function Xa(e,t){if(_e(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_e(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rf(e,t){return t?e.map(function(r){return Xr(Xr({},r),{},{__queryID:t})}):e}function Fe(e){"@babel/helpers - typeof";return Fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(e)}function Yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yr(Object(r),!0).forEach(function(n){Ya(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEac
6h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ya(e,t,r){return t=Za(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Za(e){var t=es(e,"string");return Fe(t)=="symbol"?t:String(t)}function es(e,t){if(Fe(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fe(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ts(e,t){var r=Object.keys(t).reduce(function(n,i){var a=t[i];return a.recommendResults?Zr(Zr({},n),a.recommendResults.results):n},{});e._recommendCache=r}function xe(e){"@babel/helpers - typeof";return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(e)}function rs(e,t){return ss(e)||as(e,t)||is(e,t)||ns()}function ns(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 7In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function is(e,t){if(e){if(typeof e=="string")return en(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return en(e,t)}}function en(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 as(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,c,f=[],h=!0,d=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(h=(n=a.call(r)).done)&&(f.push(n.value),f.length!==t);h=!0);}catch(m){d=!0,i=m}finally{try{if(!h&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function ss(e){if(Array.isArray(e))return e}function tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tn(Object(r),!0).forEach(function(n){di(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function di(e,t,r){return t=os(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function os(e){var t=us(e,"string");return xe(t)=="symbol"?t:String(t)}function us(e,t){if(xe(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xe(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cs(e,t){if(t&&!((!("transporter"in e)||e._cacheHydrated)&&(!e._useCache||typeof e.addAlgoliaAgent!="function"))){var r=[Object.keys(t).reduce(function(c,f){var h=t[f],d=h.state,m=h.requestParams,S=h.results,l=S&&d?S.map(function(s,o){return ye({indexName:d.index||s.index},m!=null&&m[o]||s.params?{params:At(m?.[o]||fs(s.params))}:{})}):[];return c.concat(l)},[])],n=Object.keys(t).reduce(function(c,f){var h=t[f].results;return h?c.concat(h):c},[]);if("transporter"in e&&!e._cacheHydrated){e._cacheHydrated=!0;var i=e.search.bind(e);e.search=function(c){for(var f=arguments.length,h=new Array(f>1?f-1:0),d=1;d<f;d++)h[d-1]=arguments[d];var m=Array.isArray(c)?c.map(function(S){return ye(ye({},S),{},{params:At(S.params)})}):At(c.requestBody.params);return e.transporter.responsesCache.get({method:"search",args:[m].concat(h)},function(){return i.apply(void 0,[c].concat(h))})},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=ye(ye({},e.cache),{},di({},a,JSON.stringify({results:Object.keys(t).map(function(c){return t[c].results})})))}}}function fs(e){return e.split("&").reduce(function(t,r){var n=r.split("="),i=rs(n,2),a=i[0],c=i[1];
7return t[a]=c?decodeURIComponent(c):"",t},{})}function At(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,c=new Array(a>1?a-1:0),f=1;f<a;f++)c[f-1]=arguments[f];var h=0;return i.replace(/%s/g,function(){return encodeURIComponent(c[h++])})};return Object.keys(e).map(function(n){return r("%s=%s",n,t(e[n])?JSON.stringify(e[n]):e[n])}).join("&")}function rn(e){return e!==Object(e)}function mi(e,t){if(e===t)return!0;if(rn(e)||rn(t)||typeof e=="function"||typeof t=="function")return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(!(i in t)||!mi(e[i],t[i]))return!1}return!0}function ls(e){return e.filter(function(t,r,n){return n.indexOf(t)===r})}function Ee(e){"@babel/helpers - typeof";return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(e)}var hs=["facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements","ruleContexts"];function nn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nn(Object(r),!0).forEach(function(n){ds(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ds(e,t,r){return t=ms(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ms(e){var t=ps(e,"string");return Ee(t)=="symbol"?t:String(t)}function ps(e,t){if(Ee(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ee(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vs(e,t){if(e==null)return{};var r=gs(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gs(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 ys=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=vs(r,hs);return t.setQueryParameters(n)},bs=function(t,r){return r.facets.reduce(function(n,i){return n.addFacet(i)},t)},Ss=function(t,r){return r.disjunctiveFacets.reduce(function(n,i){return n.addDisjunctiveFacet(i)},t)},Rs=function(t,r){return t.setQueryParameters({hierarchicalFacets:r.hierarchicalFacets.reduce(function(n,i){var a=ka(n,function(f){return f.name===i.name});if(a===-1)return n.concat(i);var c=n.slice();return c.splice(a,1,i),c},t.hierarchicalFacets)})},Ps=function(t,r){return r.tagRefinements.reduce(function(n,i){return n.addTagRefinement(i)},t)},Os=function(t,r){return t.setQueryParameters({facetsRefinements:ne(ne({},t.facetsRefinements),r.facetsRefinements)})},ws=function(t,r){return t.setQueryParameters({facetsExcludes:ne(ne({},t.facetsExcludes),r.facetsExcludes)})},js=function(t,r){return t.setQueryParameters({disjunctiveFacetsRefinements:ne(ne({},t.disjunctiveFacetsRefinements),r.disjunctiveFacetsRefinements)})},_s=function(t,r){return t.setQueryParameters({numericRefinements:ne(ne({},t.numericRefinements),r.numericRefinements)})},Fs=function(t,r){return t.setQueryParameters({hierarchicalFacetsRefinements:ne(ne({},t.hierarchicalFacetsRefinements),r.hierarchicalFacetsRefinements)})},xs=function(t,r){var n=ls([].concat(t.ruleContexts).concat(r.ruleContexts).filter(
7Boolean));return n.length>0?t.setQueryParameters({ruleContexts:n}):t},ze=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 c=Fs(i,a),f=Rs(c,a),h=Ps(f,a),d=_s(h,a),m=js(d,a),S=ws(m,a),l=Os(S,a),s=Ss(l,a),o=xs(s,a),v=bs(o,a);return ys(v,a)})};function Pe(e,t,r){var n=t.getHelper();return{uiState:r,helper:n,parent:t,instantSearchInstance:e,state:n.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,scopedResults:[],searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function an(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 Es(e){for(var t=e.getParent(),r=[e.getHelper().state];t!==null;)r=[t.getHelper().state].concat(r),t=t.getParent();return r}function Te(e){"@babel/helpers - typeof";return Te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Te(e)}function sn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sn(Object(r),!0).forEach(function(n){Ts(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ts(e,t,r){return t=As(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function As(e){var t=$s(e,"string");return Te(t)=="symbol"?t:String(t)}function $s(e,t){if(Te(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Te(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pi(e){return e.some(function(t){return t.isHighlighted})?e.map(function(t,r){return Be(Be({},t),{},{isHighlighted:!Ba(e,r)})}):e.map(function(t){return Be(Be({},t),{},{isHighlighted:!1})})}function ce(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{fallback:function(){}},r=t.fallback;return typeof window>"u"?r():e({window})}function Ae(e){"@babel/helpers - typeof";return Ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(e)}function on(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?on(Object(r),!0).forEach(function(n){vi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):on(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vi(e,t,r){return t=Is(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Is(e){var t=Hs(e,"string");return Ae(t)=="symbol"?t:String(t)}function Hs(e,t){if(Ae(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ae(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Cs=Xe({name:"configure",connector:!0});function un(e,t){return e.setQueryParameters(Object.keys(t.searchParameters).reduce(function(r,n){return z(z({},r),{},vi({},n,void 0))},{}))}var Ds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ee,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee;return function(n){if(!n||!oi(n.searchParameters))throw new Error(Cs("The `searchParameters` option expects an object."));var i={};function a(c){return function(f){var h=un(c.state,n),d=ze(h,new J.SearchParameters(f));n.searchParameters=f,c.setState(d).search()}}return{$$type:"ais.configure",init:function(f){var h=f.instantSearchInstance;t(z(z({},this.getWidgetRenderState(f)),{},{instantSearchInstance:h}),!0)},render:function(f){var h=f.instantSearchInstance;t(z(z({},this.getWidgetRenderState(f)),{},{instantSearchInstance:h}),!1)},dispose:function(f){var h=f.state;return r(),un(h,n)},getRenderState:function(f,h){var d,m=this.getWidgetRenderState(h);return z(z({},f),{},{configure:z(z({},m),{},{widgetParams:z(z({},m.widgetParams),{},{searchParameters:ze(new J.SearchParameters((d=f.configure)===null||d===void 0?void 0:d.widgetParams.searchParameters),new J.SearchParameters(m.widgetParams.searchParameters)).getQueryParams()})})})},getWidgetRenderState:function(f){var h=f.helper;return i.refine||(i.refine=a(h)),{refine:i.refine,widgetParams:n}},getWidgetSearchParameters:function(f,h){var d=h.uiState;return ze(f,new J.SearchParameters(z(z({},d.configure),n.searchParameters)))},getWidgetUiState:function(f){return z(z({},f),{},{configure:z(z({},f.configure),n.searchParameters)})}}}};function zt(e){"@babel/helpers - typeof";return zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(e)}var cn=Object.prototype.hasOwnProperty;function pe(e,t,r){if(r!=null&&r(e,t))return!0;var n,i;if(e===t)return!0;
7if(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--&&pe(e[i],t[i],r););return i===-1}if(!n||zt(e)==="object"){i=0;for(n in e)if(cn.call(e,n)&&++i&&!cn.call(t,n)||!(n in t)||!pe(e[n],t[n],r))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}function fn(e){var t,r,n;return new J.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 $e(e){"@babel/helpers - typeof";return $e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$e(e)}function ln(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ln(Object(r),!0).forEach(function(n){Ns(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ns(e,t,r){return t=Us(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Us(e){var t=Ws(e,"string");return $e(t)=="symbol"?t:String(t)}function Ws(e,t){if($e(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($e(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jt(e){var t=e.getHelper(),r=e.getResults()||fn(t.state),n=e.getScopedResults().map(function(i){var a=i.indexId===e.getIndexId()?r:fn(i.helper.state);return hn(hn({},i),{},{results:i.results||a})});return{results:r,scopedResults:n,recommendResults:t.lastRecommendResults}}var gi=C.createContext(null);function yi(e,t){if(!e)throw new Error("Invariant failed")}function fr(){var e=C.useContext(gi);return yi(e!==null),e}var bi=C.createContext(null);function ke(){var e=C.useContext(bi);return yi(e!==null),e}var qs=C.createContext(null);function Si(){return C.useContext(qs)}var Ls=C.createContext(null);function Ri(){return C.useContext(Ls)}function Qs(e,t){return Vs(e)||Bs(e,t)||Ms(e,t)||ks()}function ks(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 8In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ms(e,t){if(e){if(typeof e=="string")return dn(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dn(e,t)}}function dn(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 Bs(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,c,f=[],h=!0,d=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(h=(n=a.call(r)).done)&&(f.push(n.value),f.length!==t);h=!0);}catch(m){d=!0,i=m}finally{try{if(!h&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function Vs(e){if(Array.isArray(e))return e}function mn(e){var t=C.useState(function(){return e}),r=Qs(t,2),n=r[0],i=r[1];return pe(n,e)||i(e),n}var Ks="use",pn=Mi[Ks],Pi=typeof window<"u"?C.useLayoutEffect:C.useEffect,zs=C.createContext({countRef:{current:0},waitForResultsRef:null,ignoreMultipleHooksWarning:!1});function Oi(){return C.useContext(zs)}function Js(e){var t,r,n=e.widget,i=e.parentIndex,a=e.props,c=e.shouldSsr,f=e.skipSuspense,h=Oi(),d=h.waitForResultsRef,m=h.countRef;h.ignoreMultipleHooksWarning;var S=C.useRef(a);C.useEffect(function(){S.current=a},[a]);var l=C.useRef(n);C.useEffect(function(){l.current=n},[n]);var s=C.useRef(null),o=c&&!i.getWidgets().includes(n),v=ke();if(Pi(function(){var u=l.current;if(!s.current)c||i.addWidgets([n]);else{clearTimeout(s.current);var p=pe(a,S.current);p||(i.removeWidgets([u]),i.addWidgets([n]))}return function(){s.current=setTimeout(function(){v._schedule(function(){v._preventWidgetCleanup||i.removeWidgets([u])})})}},[i,n,c,v,a]),(o||(d==null||(t=d.current)===null||t===void 0?void 0:t.status)==="pending")&&i.addWidgets([n]),d!=null&&d.current&&!f){var g;pn(d.current),n.$$type!=="ais.dynamicWidgets"&&(g=v.helper)!==null&&g!==void 0&&g.lastResults&&pn(d.current)}(d==null||(r=d.current)===null||r===void 0?void 0:r.status)==="fulfilled"&&(m.current+=1)}function Ie(e){"@babel/helpers - typeof";return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(e)}var Gs=["skipSuspense"],Xs=["instantSearchInstance","widgetParams"],Ys=["widgetParams"];function Zs(e,t){return no(e)||ro(e,t)||to(e,t)||eo()}
8function eo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 9In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function to(e,t){if(e){if(typeof e=="string")return vn(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vn(e,t)}}function vn(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 ro(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,c,f=[],h=!0,d=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(h=(n=a.call(r)).done)&&(f.push(n.value),f.length!==t);h=!0);}catch(m){d=!0,i=m}finally{try{if(!h&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function no(e){if(Array.isArray(e))return e}function gn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gn(Object(r),!0).forEach(function(n){io(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function io(e,t,r){return t=ao(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ao(e){var t=so(e,"string");return Ie(t)=="symbol"?t:String(t)}function so(e,t){if(Ie(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ie(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $t(e,t){if(e==null)return{};var r=oo(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oo(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}function wi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.skipSuspense,i=n===void 0?!1:n,a=$t(r,Gs),c=Si(),f=Ri(),h=ke(),d=fr(),m=mn(t),S=mn(a),l=C.useRef(!0),s=C.useRef(null),o=C.useRef(h.status),v=C.useMemo(function(){var P=e(function(R,j){if(j){l.current=!0;return}if(l.current){var _=R.instantSearchInstance;R.widgetParams;var y=$t(R,Xs);(!pe(y,s.current,function(O,w){return O?.constructor===Function&&w?.constructor===Function})||_.status!==o.current)&&(b(y),s.current=y,o.current=_.status)}},function(){l.current=!1});return yn(yn({},P(m)),S)},[e,m,S]),g=C.useState(function(){if(v.getWidgetRenderState){var P,R=d.getHelper(),j=d.getWidgetUiState({})[d.getIndexId()];R.state=((P=v.getWidgetSearchParameters)===null||P===void 0?void 0:P.call(v,R.state,{uiState:j}))||R.state;var _=Jt(d),y=_.results,O=_.scopedResults,w=_.recommendResults,F=v.getWidgetRenderState({helper:R,parent:d,instantSearchInstance:h,results:v.dependsOn==="recommend"&&w&&f?w[f.recommendIdx.current++]:y,scopedResults:O,state:R.state,renderState:h.renderState,templatesConfig:h.templatesConfig,createURL:d.createURL,searchMetadata:{isSearchStalled:h.status==="stalled"},status:h.status,error:h.error});F.widgetParams;var x=$t(F,Ys);return x}return{}}),u=Zs(g,2),p=u[0],b=u[1];return Js({widget:v,parentIndex:d,props:m,shouldSsr:!!c,skipSuspense:i}),p}function uo(e,t){return wi(Ds,{searchParameters:e},t)}function He(e){"@babel/helpers - typeof";return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},He(e)}var co=["initialSearchParameters"],fo=["initialRecommendParameters"];function bn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
9t%2?bn(Object(r),!0).forEach(function(n){de(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t,r){return t=lo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lo(e){var t=ho(e,"string");return He(t)=="symbol"?t:String(t)}function ho(e,t){if(He(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(He(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ji(e){return go(e)||vo(e)||po(e)||mo()}function mo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 10In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function po(e,t){if(e){if(typeof e=="string")return Gt(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gt(e,t)}}function vo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function go(e){if(Array.isArray(e))return Gt(e)}function Gt(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 _i(e,t){if(e==null)return{};var r=yo(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yo(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 be=Xe({name:"index-widget"});function Fi(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 Se(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.reduce(function(n,i){return Z(i)||!i.getWidgetUiState&&!i.getWidgetState?n:i.getWidgetUiState?i.getWidgetUiState(n,t):i.getWidgetState(n,t)},r)}function Re(e,t){var r=t.initialSearchParameters,n=_i(t,co);return e.reduce(function(i,a){return!a.getWidgetSearchParameters||Z(a)?i:a.dependsOn==="search"&&a.getWidgetParameters?a.getWidgetParameters(i,n):a.getWidgetSearchParameters(i,n)},r)}function Sn(e,t){var r=t.initialRecommendParameters,n=_i(t,fo);return e.reduce(function(i,a){return!Z(a)&&a.dependsOn==="recommend"&&a.getWidgetParameters?a.getWidgetParameters(i,n):i},r)}function xi(e){var t=e.filter(Z);t.length!==0&&t.forEach(function(r){var n=r.getHelper();Fi(n,{state:n.state.resetPage(),recommendState:n.recommendState,isPageReset:!0}),xi(r.getWidgets())})}function Ei(e){var t=e.filter(Z);return t.reduce(function(r,n){return r.concat.apply(r,[{indexId:n.getIndexId(),results:n.getResults(),helper:n.getHelper()}].concat(ji(Ei(n.getWidgets()))))},[])}var bo=function(t){if(t===void 0||t.indexName===void 0&&!t.EXPERIMENTAL_isolated)throw new Error(be("The `indexName` option is required."));var r=t.indexName,n=r===void 0?"":r,i=t.indexId,a=i===void 0?n:i,c=t.EXPERIMENTAL_isolated,f=c===void 0?!1:c,h=[],d={},m=null,S=null,l=null,s=null,o=null,v=!1,g=!1;return{$$type:"ais.index",$$widgetType:"ais.index",_isolated:f,getIndexName:function(){return n},getIndexId:function(){return a},getHelper:function(){return l},getResults:function(){var p;return(p=s)!==null&&p!==void 0&&p.lastResults?(s.lastResults._state=l.state,s.lastResults):null},getResultsForWidget:function(p){var b;return p.dependsOn!=="recommend"||Z(p)||p.$$id===void 0?this.getResults():(b=l)!==null&&b!==void 0&&b.lastRecommendResults?l.lastRecommendResults[p.$$id]:null},getPreviousState:function(){return o},getScopedResults:function(){var p=this.getParent(),b;return p?b=p.getWidgets():n.length===0?b=this.getWidgets():b=[this],Ei(b)},getParent:function(){return f?null:S},createURL:function(p){return typeof p=="function"?m._createURL(de({},a,p(d))):m._createURL(de({},a,Se(h,{searchParameters:p,helper:l})))},getWidgets:function(){return h},addWidgets:function(p){var b=this;if(!Array.isArray(p))throw new Error(be("The `addWidgets` method expects an array of widgets."));var P=p.reduce(function(j,_){return j.concat(Array.isArray(_)?_:[_])},[]);if(P.some(function(j){return typeof j.init!="function"&&typeof j.render!="function"}))throw new Error(be("The widget definition expects a `render` and/or an `init` method."));if(P.forEach(function(j){Z(j)||(m&&j.dependsOn==="recommend"?m._hasRecommendWidget=!0:m?m._hasSearchWidget=!0:j.dependsOn==="recommend"?v=!0:g=!0,ga(j))}),h=h.concat(P),m&&P.length)if(Fi(l,{state:Re(h,{uiState:d,initialSearchParameters:l.state}),recommendState:Sn(h,{uiState:d,initialRecommendParameters:l.recommendState}),_uiState:d}),P.forEach(function(j){if(j.getRenderState){var _=j.getRenderState(m.renderState[b.getIndexId()]||{},Pe(m,b,m._initialUiState));
10It({renderState:_,instantSearchInstance:m,parent:b})}}),P.forEach(function(j){j.init&&j.init(Pe(m,b,m._initialUiState))}),f){var R;(R=l)===null||R===void 0||R.search()}else m.scheduleSearch();return this},removeWidgets:function(p){var b=this;if(!Array.isArray(p))throw new Error(be("The `removeWidgets` method expects an array of widgets."));var P=p.reduce(function(w,F){return w.concat(Array.isArray(F)?F:[F])},[]);if(P.some(function(w){return typeof w.dispose!="function"}))throw new Error(be("The widget definition expects a `dispose` method."));if(h=h.filter(function(w){return P.indexOf(w)===-1}),h.forEach(function(w){Z(w)||(m&&w.dependsOn==="recommend"?m._hasRecommendWidget=!0:m?m._hasSearchWidget=!0:w.dependsOn==="recommend"?v=!0:g=!0)}),m&&P.length){var R=P.reduce(function(w,F){var x=F.dispose({helper:l,state:w.cleanedSearchState,recommendState:w.cleanedRecommendState,parent:b});return x instanceof J.RecommendParameters?w.cleanedRecommendState=x:x&&(w.cleanedSearchState=x),w},{cleanedSearchState:l.state,cleanedRecommendState:l.recommendState}),j=R.cleanedSearchState,_=R.cleanedRecommendState,y=m.future.preserveSharedStateOnUnmount?Re(h,{uiState:d,initialSearchParameters:new J.SearchParameters({index:this.getIndexName()})}):Re(h,{uiState:Se(h,{searchParameters:j,helper:l}),initialSearchParameters:j});if(d=Se(h,{searchParameters:y,helper:l}),l.setState(y),l.recommendState=_,h.length)if(f){var O;(O=l)===null||O===void 0||O.search()}else m.scheduleSearch()}return this},init:function(p){var b=this,P,R=p.instantSearchInstance,j=p.parent,_=p.uiState;if(l===null){m=R,S=j,d=_[a]||{};var y=R.mainHelper,O=Re(h,{uiState:d,initialSearchParameters:new J.SearchParameters({index:n})}),w=Sn(h,{uiState:d,initialRecommendParameters:new J.RecommendParameters});l=J(y.getClient(),O.index,O),l.recommendState=w,l.search=function(){return f?(R.status="loading",b.render({instantSearchInstance:R}),R.compositionID?l.searchWithComposition():l.searchOnlyWithDerivedHelpers()):R.onStateChange?(R.onStateChange({uiState:R.mainIndex.getWidgetUiState({}),setUiState:function($){return R.setUiState($,!1)}}),y):y.search()},l.searchWithoutTriggeringOnStateChange=function(){return y.search()},l.searchForFacetValues=function(A,$,N,T){var W=l.state.setQueryParameters(T);return y.searchForFacetValues(A,$,N,W)};var F=n?l:J({},"__empty_index__",{}),x=f?F:So(j,y);s=x.derive(function(){return ze.apply(void 0,[y.state].concat(ji(Es(b))))},function(){return b.getHelper().recommendState});var E=(P=R._initialResults)===null||P===void 0?void 0:P[this.getIndexId()];if(E!=null&&E.results){var I=new J.SearchResults(new J.SearchParameters(E.state),E.results);s.lastResults=I,l.lastResults=I}if(E!=null&&E.recommendResults){var H=new J.RecommendResults(new J.RecommendParameters({params:E.recommendResults.params}),E.recommendResults.results);s.lastRecommendResults=H,l.lastRecommendResults=H}l.on("change",function(A){var $=A.isPageReset;$&&xi(h)}),s.on("search",function(){R.scheduleStalledRender()}),s.on("result",function(A){var $=A.results;R.scheduleRender(),l.lastResults=$,o=$?._state}),s.on("recommend:result",function(A){var $=A.recommend;R.scheduleRender(),l.lastRecommendResults=$.results}),h.forEach(function(A){if(A.getRenderState){var $=A.getRenderState(R.renderState[b.getIndexId()]||{},Pe(R,b,_));It({renderState:$,instantSearchInstance:R,parent:b})}}),h.forEach(function(A){A.init&&A.init(Pe(R,b,_))}),l.on("change",function(A){var $=A.state,N=A._uiState;d=Se(h,{searchParameters:$,helper:l},N||{}),R.onStateChange||R.onInternalStateChange()}),E&&R.scheduleRender(),v&&(R._hasRecommendWidget=!0),g&&(R._hasSearchWidget=!0)}},render:function(p){var b,P=this,R=p.instantSearchInstance;R.status==="error"&&!R.mainHelper.hasPendingRequests()&&o&&l.setState(o);var j=this.getResults()||(b=s)!==null&&b!==void 0&&b.lastRecommendResults||f&&!n?h:h.filter(Z);j=j.filter(function(_){return _.shouldRender?_.shouldRender({instantSearchInstance:R}):!0}),j.forEach(function(_){if(_.getRenderState){var y=_.getRenderState(R.renderState[P.getIndexId()]||{},an(R,P,_));It({renderState:y,instantSearchInstance:R,parent:P})}}
10),j.forEach(function(_){_.render&&_.render(an(R,P,_))})},dispose:function(){var p=this,b,P;h.forEach(function(R){R.dispose&&l&&R.dispose({helper:l,state:l.state,recommendState:l.recommendState,parent:p})}),m=null,S=null,(b=l)===null||b===void 0||b.removeAllListeners(),l=null,(P=s)===null||P===void 0||P.detach(),s=null},getWidgetUiState:function(p){return h.filter(Z).filter(function(b){return!b._isolated}).reduce(function(b,P){return P.getWidgetUiState(b)},re(re({},p),{},de({},a,re(re({},p[a]),d))))},getWidgetState:function(p){return this.getWidgetUiState(p)},getWidgetSearchParameters:function(p,b){var P=b.uiState;return Re(h,{uiState:P,initialSearchParameters:p})},refreshUiState:function(){d=Se(h,{searchParameters:this.getHelper().state,helper:this.getHelper()},d)},setIndexUiState:function(p){var b=typeof p=="function"?p(d):p;m.setUiState(function(P){return re(re({},P),{},de({},a,b))})}}};function It(e){var t=e.renderState,r=e.instantSearchInstance,n=e.parent,i=n?n.getIndexId():r.mainIndex.getIndexId();r.renderState=re(re({},r.renderState),{},de({},i,re(re({},r.renderState[i]),t)))}function So(e,t){for(;e;){if(e._isolated)return e.getHelper();e=e.getParent()}return t}function Ro(e,t){return jo(e)||wo(e,t)||Oo(e,t)||Po()}function Po(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 11In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(e,t){if(e){if(typeof e=="string")return Rn(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rn(e,t)}}function Rn(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 wo(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,c,f=[],h=!0,d=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(h=(n=a.call(r)).done)&&(f.push(n.value),f.length!==t);h=!0);}catch(m){d=!0,i=m}finally{try{if(!h&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function jo(e){if(Array.isArray(e))return e}function _o(){var e=C.useReducer(function(n){return n+1},0),t=Ro(e,2),r=t[1];return r}var Fo=ir();const xo=nr(Fo);var Eo="ais",Ze=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):"",c=i?"--".concat(i):"";return"".concat(Eo,"-").concat(t).concat(a).concat(c)}},To=Ze("Highlight");function Ao(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,c=a===void 0?{}:a,f=Ye(i._highlightResult,t),h=f||{},d=h.value,m=d===void 0?"":d,S=To({descendantName:"highlighted"})+(c.highlighted?" ".concat(c.highlighted):"");return m.replace(new RegExp(X.highlightPreTag,"g"),"<".concat(n,' class="').concat(S,'">')).replace(new RegExp(X.highlightPostTag,"g"),"</".concat(n,">"))}var $o=Ze("ReverseHighlight");function Io(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,c=a===void 0?{}:a,f=Ye(i._highlightResult,t),h=f||{},d=h.value,m=d===void 0?"":d,S=$o({descendantName:"highlighted"})+(c.highlighted?" ".concat(c.highlighted):""),l=ci(pi(hi(m)));return l.replace(new RegExp(X.highlightPreTag,"g"),"<".concat(n,' class="').concat(S,'">')).replace(new RegExp(X.highlightPostTag,"g"),"</".concat(n,">"))}var Ho=Ze("Snippet");function Co(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,c=a===void 0?{}:a,f=Ye(i._snippetResult,t),h=f||{},d=h.value,m=d===void 0?"":d,S=Ho({descendantName:"highlighted"})+(c.highlighted?" ".concat(c.highlighted):"");return m.replace(new RegExp(X.highlightPreTag,"g"),"<".concat(n,' class="').concat(S,'">')).replace(new RegExp(X.highlightPostTag,"g"),"</".concat(n,">"))}var Do=Ze("ReverseSnippet");function No(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,c=a===void 0?{}:a,f=Ye(i._snippetResult,t),h=f||{}
11,d=h.value,m=d===void 0?"":d,S=Do({descendantName:"highlighted"})+(c.highlighted?" ".concat(c.highlighted):""),l=ci(pi(hi(m)));return l.replace(new RegExp(X.highlightPreTag,"g"),"<".concat(n,' class="').concat(S,'">')).replace(new RegExp(X.highlightPostTag,"g"),"</".concat(n,">"))}function Xt(e){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(e)}function Uo(e){var t=e.method,r=e.payload;if(Xt(r)!=="object")throw new Error("The insights helper expects the payload to be an object.");var n;try{n=fi(r)}catch{throw new Error("Could not JSON serialize the payload object.")}return'data-insights-method="'.concat(t,'" data-insights-payload="').concat(n,'"')}function Wo(e,t){return Uo({method:e,payload:t})}function Yt(e){"@babel/helpers - typeof";return Yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(e)}var qo="_ALGOLIA";function Lo(e){if(!((typeof document>"u"?"undefined":Yt(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 Qo(){return Lo(qo)}function ko(){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)})}function Ce(e){"@babel/helpers - typeof";return Ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(e)}function Pn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pn(Object(r),!0).forEach(function(n){Mo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mo(e,t,r){return t=Bo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bo(e){var t=Vo(e,"string");return Ce(t)=="symbol"?t:String(t)}function Vo(e,t){if(Ce(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ce(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oe(e,t){return Jo(e)||zo(e,t)||Ti(e,t)||Ko()}function Ko(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 12In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zo(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,c,f=[],h=!0,d=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;h=!1}else for(;!(h=(n=a.call(r)).done)&&(f.push(n.value),f.length!==t);h=!0);}catch(m){d=!0,i=m}finally{try{if(!h&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function Jo(e){if(Array.isArray(e))return e}function Go(e){return Zo(e)||Yo(e)||Ti(e)||Xo()}function Xo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 13In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ti(e,t){if(e){if(typeof e=="string")return Zt(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zt(e,t)}}function Yo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zo(e){if(Array.isArray(e))return Zt(e)}function Zt(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}var Ai="2.17.2",eu="https://cdn.jsdelivr.net/npm/search-insights@".concat(Ai,"/dist/search-insights.min.js");function On(){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,c=e.$$automatic,f=c===void 0?!1:c,h=t;!t&&t!==null&&ce(function(m){var S=m.window,l=S.AlgoliaAnalyticsObject||"aa";typeof l=="string"&&(h=S[l]),h||(S.AlgoliaAnalyticsObject=l,S[l]||(S[l]=function(){S[l].queue||(S[l].queue=[]);for(var s=arguments.length,o=new Array(s),v=0;v<s;v++)o[v]=arguments[v];S[l].queue.push(o)},S[l].version=Ai,S[l].shouldAddScript=!0),h=S[l])});var d=h||ee;return function(m){var S=m.instantSearchInstance,l=S.middleware.filter(function(O){return O.instance.$$type==="ais.insights"&&O.instance.$$internal}).map(function(O){return O.creator});S.unuse.apply(S,Go(l));var s=Kr(S.client),o=oe(s,2),v=o[0],g=o[1],u=void 0,p=void 0,b=void 0,P=d.queue;if(Array.isArray(P)){var R=["setUserToken","init"].map(function(O){var w=Vr(P.slice().reverse(),function(E){var I=oe(E,1),H=I[0];return H===O}
13)||[],F=oe(w,2),x=F[1];return x}),j=oe(R,2);p=j[0],u=j[1]}d("getUserToken",null,function(O,w){b=jn(w)}),(r||!wn(d))&&d("init",le({appId:v,apiKey:g,partial:!0},r));var _,y;return{$$type:"ais.insights",$$internal:a,$$automatic:f,onStateChange:function(){},subscribe:function(){if(d.shouldAddScript){var w="[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init";try{var F=document.createElement("script");F.async=!0,F.src=eu,F.onerror=function(){S.emit("error",new Error(w))},document.body.appendChild(F),d.shouldAddScript=!1}catch{d.shouldAddScript=!1,S.emit("error",new Error(w))}}},started:function(){d("addAlgoliaAgent","insights-middleware"),y=S.mainHelper;var w=d.queue;if(Array.isArray(w)){var F=["setUserToken","init"].map(function(D){var L=Vr(w.slice().reverse(),function(te){var ie=oe(te,1),fe=ie[0];return fe===D})||[],K=oe(L,2),B=K[1];return B}),x=oe(F,2);p=x[0],u=x[1]}_=tu(S),f||y.overrideStateWithoutTriggeringChangeEvent(le(le({},y.state),{},{clickAnalytics:!0})),a||S.scheduleSearch();var E=function(L){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,B=jn(L);if(!B)return;var te=y.state.userToken;function ie(){y.overrideStateWithoutTriggeringChangeEvent(le(le({},y.state),{},{userToken:B})),te&&te!==L&&S.scheduleSearch()}K?ie():setTimeout(ie,0)};function I(D){E(D,!0),d("setUserToken",D)}var H=void 0,A=Qo();if(A)H=A;else{var $="anonymous-".concat(ko());H=$}var N,T=_.userToken;if(r!=null&&r.userToken&&(N=r.userToken),N)I(N);else if(T)I(T);else if(b)I(b);else if(p)I(p);else if(H){var W;if(I(H),r!=null&&r.useCookie||(W=u)!==null&&W!==void 0&&W.useCookie){var Q;ru(H,r?.cookieDuration||((Q=u)===null||Q===void 0?void 0:Q.cookieDuration))}}d("onUserTokenChange",function(D){return E(D,!0)},{immediate:!0});var k=d;wn(d)&&(k=function(L,K){var B=Kr(S.client),te=oe(B,2),ie=te[0],fe=te[1],ki={headers:{"X-Algolia-Application-Id":ie,"X-Algolia-API-Key":fe}};return d(L,K,ki)});var M=new Set,Y;S.mainHelper.derivedHelpers[0].on("result",function(D){var L=D.results;L&&(!L.queryID||L.queryID!==Y)&&(Y=L.queryID,M.clear())}),S.sendEventToInsights=function(D){if(n)n(D,k);else if(D.insightsMethod){if(D.insightsMethod==="viewedObjectIDs"){var L=D.payload,K=L.objectIDs.filter(function(B){return!M.has(B)});if(K.length===0)return;K.forEach(function(B){return M.add(B)}),L.objectIDs=K}D.payload.algoliaSource=["instantsearch"],f&&D.payload.algoliaSource.push("instantsearch-automatic"),D.eventModifier==="internal"&&D.payload.algoliaSource.push("instantsearch-internal"),k(D.insightsMethod,D.payload)}}},unsubscribe:function(){d("onUserTokenChange",void 0),S.sendEventToInsights=ee,y&&_&&(y.overrideStateWithoutTriggeringChangeEvent(le(le({},y.state),_)),S.scheduleSearch())}}}}function tu(e){var t,r,n=((t=e._initialResults)===null||t===void 0||(r=t[e.indexName])===null||r===void 0?void 0:r.state)||{},i=e.mainHelper.state;return{userToken:n.userToken||i.userToken,clickAnalytics:n.clickAnalytics||i.clickAnalytics}}function ru(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=/")}
13function wn(e){var t=(e.version||"").split(".").map(Number),r=oe(t,2),n=r[0],i=r[1],a=n>=3,c=n===2&&i>=6,f=n===1&&i>=10;return a||c||f}function jn(e){if(e)return typeof e=="number"?e.toString():e}function $i(e,t,r){var n=Pe(t,t.mainIndex,t._initialUiState);e.forEach(function(i){var a={};if(i.getWidgetRenderState){var c=i.getWidgetRenderState(n);c&&c.widgetParams&&(a=c.widgetParams)}var f=Object.keys(a).filter(function(h){return a[h]!==void 0});r.widgets.push({type:i.$$type,widgetType:i.$$widgetType,params:f}),i.$$type==="ais.index"&&$i(i.getWidgets(),t,r)})}function nu(){return ce(function(e){var t,r,n=e.window;return((t=n.navigator)===null||t===void 0||(r=t.userAgent)===null||r===void 0?void 0:r.indexOf("Algolia Crawler"))>-1},{fallback:function(){return!1}})}function iu(){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:[]},c=document.createElement("meta"),f=document.querySelector("head");return c.name="instantsearch:widgets",{$$type:"ais.metadata",$$internal:r,onStateChange:function(){},subscribe:function(){setTimeout(function(){var d=i.client;a.ua=d.transporter&&d.transporter.userAgent?d.transporter.userAgent.value:d._ua,$i(i.mainIndex.getWidgets(),i,a),i.middleware.forEach(function(m){return a.widgets.push({middleware:!0,type:m.instance.$$type,internal:m.instance.$$internal})}),c.content=JSON.stringify(a),f.appendChild(c)},0)},started:function(){},unsubscribe:function(){c.remove()}}}}var Ht,_n;function lr(){if(_n)return Ht;_n=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Ht={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},Ht}var Ct,Fn;function Ii(){if(Fn)return Ct;Fn=1;var e=lr(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=(function(){for(var v=[],g=0;g<256;++g)v.push("%"+((g<16?"0":"")+g.toString(16)).toUpperCase());return v})(),i=function(g){for(;g.length>1;){var u=g.pop(),p=u.obj[u.prop];if(r(p)){for(var b=[],P=0;P<p.length;++P)typeof p[P]<"u"&&b.push(p[P]);u.obj[u.prop]=b}}},a=function(g,u){for(var p=u&&u.plainObjects?Object.create(null):{},b=0;b<g.length;++b)typeof g[b]<"u"&&(p[b]=g[b]);return p},c=function v(g,u,p){if(!u)return g;if(typeof u!="object"){if(r(g))g.push(u);else if(g&&typeof g=="object")(p&&(p.plainObjects||p.allowPrototypes)||!t.call(Object.prototype,u))&&(g[u]=!0);else return[g,u];return g}if(!g||typeof g!="object")return[g].concat(u);var b=g;return r(g)&&!r(u)&&(b=a(g,p)),r(g)&&r(u)?(u.forEach(function(P,R){if(t.call(g,R)){var j=g[R];j&&typeof j=="object"&&P&&typeof P=="object"?g[R]=v(j,P,p):g.push(P)}else g[R]=P}),g):Object.keys(u).reduce(function(P,R){var j=u[R];return t.call(P,R)?P[R]=v(P[R],j,p):P[R]=j,P},b)},f=function(g,u){return Object.keys(u).reduce(function(p,b){return p[b]=u[b],p},g)},h=function(v,g,u){var p=v.replace(/\+/g," ");if(u==="iso-8859-1")return p.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(p)}catch{return p}},d=function(g,u,p,b,P){if(g.length===0)return g;var R=g;if(typeof g=="symbol"?R=Symbol.prototype.toString.call(g):typeof g!="string"&&(R=String(g)),p==="iso-8859-1")return escape(R).replace(/%u[0-9a-f]{4}/gi,function(O){return"%26%23"+parseInt(O.slice(2),16)+"%3B"});for(var j="",_=0;_<R.length;++_){var y=R.charCodeAt(_);if(y===45||y===46||y===95||y===126||y>=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||P===e.RFC1738&&(y===40||y===41)){j+=R.charAt(_);continue}if(y<128){j=j+n[y];continue}if(y<2048){j=j+(n[192|y>>6]+n[128|y&63]);continue}if(y<55296||y>=57344){j=j+(n[224|y>>12]+n[128|y>>6&63]+n[128|y&63]);continue}_+=1,y=65536+((y&1023)<<10|R.charCodeAt(_)&1023),j+=n[240|y>>18]+n[128|y>>12&63]+n[128|y>>6&63]+n[128|y&63]}return j},m=function(g){for(var u=[{obj:{o:g},prop:"o"}],p=[],b=0;b<u.length;++b)for(var P=u[b],R=P.obj[P.prop],j=Object.keys(R),_=0;_<j.length;++_){var y=j[_],O=R[y];typeof O=="object"&&O!==null&&p.indexOf(O)===-1&&(u.push({obj:R,prop:y}),p.push(O))}return i(u),g},S=function(g){return Object.prototype.toString.call(g)==="[object RegExp]"},l=function(g){return!g||typeof g!="object"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))},s=function(g,u){return[].concat(g,u)},o=function(g,u){if(r(g)){for(var p=[],b=0;b<g.length;b+=1)p.push(u(g[b]));return p}return u(g)};return Ct={arrayToObject:a,assign:f,combine:s,compact:m,decode:h,encode:d,isBuffer:l,isRegExp:S,maybeMap:o,merge:c},Ct}var Dt,xn;function au(){if(xn)return Dt;xn=1;var e=Ii(),t=lr(),r=Object.prototype.hasOwnProperty,n={brackets:function(v){return v+"[]"},comma:"comma",indices:function(v,g){return v+"["+g+"]"},repeat:function(v){return v}},i=Array.isArray,a=String.prototype.split,c=Array.prototype.push,f=function(o,v){c.apply(o,i(v)?v:[v])},h=Date.prototype.toISOString,d=t.default,m={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:e.encode,encodeValuesOnly:!1,format:d,formatter:t.formatters[d],indices:!1,serializeDate:function(v){return h.call(v)},skipNulls:!1,strictNullHandling:!1},S=function(v){return typeof v=="string"||typeof v=="number"||typeof v=="boolean"||typeof v=="symbol"||typeof v=="bigint"},l=function o(v,g,u,p,b,P,R,j,_,y,O,w,F,x){var E=v;if(typeof R=="function"?E=R(g,E):E instanceof Date?E=y(E):u==="comma"&&i(E)&&(E=e.maybeMap(E,function(D){return D instanceof Date?y(D):D})),E===null){if(p)return P&&!F?P(g,m.encoder,x,"key",O):g;E=""}if(S(E)||e.isBuffer(E)){if(P){var I=F?g:P(g,m.encoder,x,"key",O);if(u==="comma"&&F){for(var H=a.call(String(E),","),A="",$=0;$<H.length;++$)A+=($===0?"":",")+w(P(H[$],m.encoder,x,"value",O));return[w(I)+"="+A]}return[w(I)+"="+w(P(E,m.encoder,x,"value",O))]}return[w(g)+"="+w(String(E))]}var N=[];if(typeof E>"u")return N;var T;if(u==="comma"&&i(E))T=[{value:E.length>0?E.join(",")||null:void 0}];else if(i(R))T=R;else{var W=Object.keys(E);T=j?W.sort(j):W}for(var Q=0;Q<T.length;++Q){var k=T[Q],M=typeof k=="object"&&typeof k.value<"u"?k.value:E[k];if(!(b&&M===null)){var Y=i(E)?typeof u=="function"?u(g,k):g:g+(_?"."+k:"["+k+"]");f(N,o(M,Y,u,p,b,P,R,j,_,y,O,w,F,x))}}return N},s=function(v){if(!v)return m;if(v.encoder!==null&&typeof v.encoder<"u"&&typeof v.encoder!="function")throw new TypeError("Encoder has to be a function.");var g=v.charset||m.charset;if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var u=t.default;if(typeof v.format<"u"){if(!r.call(t.formatters,v.format))throw new TypeError("Unknown format option provided.");u=v.format}var p=t.formatters[u],b=m.filter;return(typeof v.filter=="function"||i(v.filter))&&(b=v.filter),{addQueryPrefix:typeof v.addQueryPrefix=="boolean"?v.addQueryPrefix:m.addQueryPrefix,allowDots:typeof v.allowDots>"u"?m.allowDots:!!v.allowDots,charset:g,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:m.charsetSentinel,delimiter:typeof v.delimiter>"u"?m.delimiter:v.delimiter,encode:typeof v.encode=="boolean"?v.encode:m.encode,encoder:typeof v.encoder=="function"?v.encoder:m.encoder,encodeValuesOnly:typeof v.encodeValuesOnly=="boolean"?v.encodeValuesOnly:m.encodeValuesOnly,filter:b,format:u,formatter:p,serializeDate:typeof v.serializeDate=="function"?v.serializeDate:m.serializeDate,skipNulls:typeof v.skipNulls=="boolean"?v.skipNulls:m.skipNulls,sort:typeof v.sort=="function"?v.sort:null,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:m.strictNullHandling}};return Dt=function(o,v){var g=o,u=s(v),p,b;typeof u.filter=="function"?(b=u.filter,g=b("",g)):i(u.filter)&&(b=u.filter,p=b);var P=[];if(typeof g!="object"||g===null)return"";var R;v&&v.arrayFormat in n?R=v.arrayFormat:v&&"indices"in v?R=v.indices?"indices":"repeat":R="indices";var j=n[R];p||(p=Object.keys(g)),u.sort&&p.sort(u.sort);for(var _=0;_<p.length;++_){var y=p[_];u.skipNulls&&g[y]===null||f(P,l(g[y],y,j,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset))}var O=P.join(u.delimiter),w=u.addQueryPrefix===!0?"?":"";return u.charsetSentinel&&(u.charset==="iso-8859-1"?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),O.length>0?w+O:""},Dt}var Nt,En;
13function su(){if(En)return Nt;En=1;var e=Ii(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:e.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(l){return l.replace(/&#(\d+);/g,function(s,o){return String.fromCharCode(parseInt(o,10))})},a=function(l,s){return l&&typeof l=="string"&&s.comma&&l.indexOf(",")>-1?l.split(","):l},c="utf8=%26%2310003%3B",f="utf8=%E2%9C%93",h=function(s,o){var v={},g=o.ignoreQueryPrefix?s.replace(/^\?/,""):s,u=o.parameterLimit===1/0?void 0:o.parameterLimit,p=g.split(o.delimiter,u),b=-1,P,R=o.charset;if(o.charsetSentinel)for(P=0;P<p.length;++P)p[P].indexOf("utf8=")===0&&(p[P]===f?R="utf-8":p[P]===c&&(R="iso-8859-1"),b=P,P=p.length);for(P=0;P<p.length;++P)if(P!==b){var j=p[P],_=j.indexOf("]="),y=_===-1?j.indexOf("="):_+1,O,w;y===-1?(O=o.decoder(j,n.decoder,R,"key"),w=o.strictNullHandling?null:""):(O=o.decoder(j.slice(0,y),n.decoder,R,"key"),w=e.maybeMap(a(j.slice(y+1),o),function(F){return o.decoder(F,n.decoder,R,"value")})),w&&o.interpretNumericEntities&&R==="iso-8859-1"&&(w=i(w)),j.indexOf("[]=")>-1&&(w=r(w)?[w]:w),t.call(v,O)?v[O]=e.combine(v[O],w):v[O]=w}return v},d=function(l,s,o,v){for(var g=v?s:a(s,o),u=l.length-1;u>=0;--u){var p,b=l[u];if(b==="[]"&&o.parseArrays)p=[].concat(g);else{p=o.plainObjects?Object.create(null):{};var P=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,R=parseInt(P,10);!o.parseArrays&&P===""?p={0:g}:!isNaN(R)&&b!==P&&String(R)===P&&R>=0&&o.parseArrays&&R<=o.arrayLimit?(p=[],p[R]=g):P!=="__proto__"&&(p[P]=g)}g=p}return g},m=function(s,o,v,g){if(s){var u=v.allowDots?s.replace(/\.([^.[]+)/g,"[$1]"):s,p=/(\[[^[\]]*])/,b=/(\[[^[\]]*])/g,P=v.depth>0&&p.exec(u),R=P?u.slice(0,P.index):u,j=[];if(R){if(!v.plainObjects&&t.call(Object.prototype,R)&&!v.allowPrototypes)return;j.push(R)}for(var _=0;v.depth>0&&(P=b.exec(u))!==null&&_<v.depth;){if(_+=1,!v.plainObjects&&t.call(Object.prototype,P[1].slice(1,-1))&&!v.allowPrototypes)return;j.push(P[1])}return P&&j.push("["+u.slice(P.index)+"]"),d(j,o,v,g)}},S=function(s){if(!s)return n;if(s.decoder!==null&&s.decoder!==void 0&&typeof s.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof s.charset<"u"&&s.charset!=="utf-8"&&s.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var o=typeof s.charset>"u"?n.charset:s.charset;return{allowDots:typeof s.allowDots>"u"?n.allowDots:!!s.allowDots,allowPrototypes:typeof s.allowPrototypes=="boolean"?s.allowPrototypes:n.allowPrototypes,arrayLimit:typeof s.arrayLimit=="number"?s.arrayLimit:n.arrayLimit,charset:o,charsetSentinel:typeof s.charsetSentinel=="boolean"?s.charsetSentinel:n.charsetSentinel,comma:typeof s.comma=="boolean"?s.comma:n.comma,decoder:typeof s.decoder=="function"?s.decoder:n.decoder,delimiter:typeof s.delimiter=="string"||e.isRegExp(s.delimiter)?s.delimiter:n.delimiter,depth:typeof s.depth=="number"||s.depth===!1?+s.depth:n.depth,ignoreQueryPrefix:s.ignoreQueryPrefix===!0,interpretNumericEntities:typeof s.interpretNumericEntities=="boolean"?s.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof s.parameterLimit=="number"?s.parameterLimit:n.parameterLimit,parseArrays:s.parseArrays!==!1,plainObjects:typeof s.plainObjects=="boolean"?s.plainObjects:n.plainObjects,strictNullHandling:typeof s.strictNullHandling=="boolean"?s.strictNullHandling:n.strictNullHandling}};return Nt=function(l,s){var o=S(s);if(l===""||l===null||typeof l>"u")return o.plainObjects?Object.create(null):{};for(var v=typeof l=="string"?h(l,o):l,g=o.plainObjects?Object.create(null):{},u=Object.keys(v),p=0;p<u.length;++p){var b=u[p],P=m(b,v[b],o,typeof l=="string");g=e.merge(g,P,o)}return e.compact(g)},Nt}var Ut,Tn;function ou(){if(Tn)return Ut;Tn=1;var e=au(),t=su(),r=lr();return Ut={formats:r,parse:t,stringify:e},Ut}var uu=ou();const An=nr(uu);function De(e){"@babel/helpers - typeof";return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(e)}function cu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fu(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,Hi(n.key),n)}}function lu(e,t,r){return t&&fu(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function G(e,t,r){return t=Hi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e){var t=hu(e,"string");return De(t)=="symbol"?t:String(t)}function hu(e,t){if(De(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(De(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $n=function(t){t&&(window.document.title=t)},du=(function(){function e(t){var r=this,n=t.windowTitle,i=t.writeDelay,a=i===void 0?400:i,c=t.createURL,f=t.parseURL,h=t.getLocation,d=t.start,m=t.dispose,S=t.push,l=t.cleanUrlOnDispose;cu(this,e),G(this,"$$type","ais.browser"),G(this,"windowTitle",void 0),G(this,"writeDelay",void 0),G(this,"_createURL",void 0),G(this,"parseURL",void 0),G(this,"getLocation",void 0),G(this,"writeTimer",void 0),G(this,"_onPopState",void 0),G(this,"inPopState",!1),G(this,"isDisposed",!1),G(this,"latestAcknowledgedHistory",0),G(this,"_start",void 0),G(this,"_dispose",void 0),G(this,"_push",void 0),G(this,"_cleanUrlOnDispose",void 0),this.windowTitle=n,this.writeTimer=void 0,this.writeDelay=a,this._createURL=c,this.parseURL=f,this.getLocation=h,this._start=d,this._dispose=m,this._push=S,this._cleanUrlOnDispose=typeof l>"u"?!0:l,ce(function(s){var o=s.window,v=r.windowTitle&&r.windowTitle(r.read());$n(v),r.latestAcknowledgedHistory=o.history.length})}return lu(e,[{key:"read",value:function(){return this.parseURL({qsModule:An,location:this.getLocation()})}},{key:"write",value:function(r){var n=this;ce(function(i){var a=i.window,c=n.createURL(r),f=n.windowTitle&&n.windowTitle(r);n.writeTimer&&clearTimeout(n.writeTimer),n.writeTimer=setTimeout(function(){$n(f),n.shouldWrite(c)&&(n._push?n._push(c):a.history.pushState(r,f||"",c),n.latestAcknowledgedHistory=a.history.length),n.inPopState=!1,n.writeTimer=void 0},n.writeDelay)})}}
13,{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())},ce(function(i){var a=i.window;a.addEventListener("popstate",n._onPopState)})}},{key:"createURL",value:function(r){var n=this._createURL({qsModule:An,routeState:r,location:this.getLocation()});return n}},{key:"dispose",value:function(){var r=this;this._dispose&&this._dispose(),this.isDisposed=!0,ce(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 ce(function(i){var a=i.window;if(n.isDisposed&&!n._cleanUrlOnDispose)return!1;var c=!(n.isDisposed&&n.latestAcknowledgedHistory!==a.history.length);return!n.inPopState&&c&&r!==a.location.href})}}]),e})();function mu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.createURL,r=t===void 0?function(o){var v=o.qsModule,g=o.routeState,u=o.location,p=u.protocol,b=u.hostname,P=u.port,R=P===void 0?"":P,j=u.pathname,_=u.hash,y=v.stringify(g),O=R===""?"":":".concat(R);return y?"".concat(p,"//").concat(b).concat(O).concat(j,"?").concat(y).concat(_):"".concat(p,"//").concat(b).concat(O).concat(j).concat(_)}:t,n=e.parseURL,i=n===void 0?function(o){var v=o.qsModule,g=o.location;return v.parse(g.search.slice(1),{arrayLimit:99})}:n,a=e.writeDelay,c=a===void 0?400:a,f=e.windowTitle,h=e.getLocation,d=h===void 0?function(){return ce(function(o){var v=o.window;return v.location},{fallback:function(){throw new Error("You need to provide `getLocation` to the `history` router in environments where `window` does not exist.")}})}:h,m=e.start,S=e.dispose,l=e.push,s=e.cleanUrlOnDispose;return new du({createURL:r,parseURL:i,writeDelay:c,windowTitle:f,getLocation:d,start:m,dispose:S,push:l,cleanUrlOnDispose:s})}function Ne(e){"@babel/helpers - typeof";return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}var pu=["configure"];function In(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?In(Object(r),!0).forEach(function(n){er(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):In(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function er(e,t,r){return t=vu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vu(e){var t=gu(e,"string");return Ne(t)=="symbol"?t:String(t)}function gu(e,t){if(Ne(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ne(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yu(e,t){if(e==null)return{};var r=bu(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bu(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}function Hn(e){e.configure;var t=yu(e,pu);return t}function Su(){return{$$type:"ais.simple",stateToRoute:function(t){return Object.keys(t).reduce(function(r,n){return Ve(Ve({},r),{},er({},n,Hn(t[n])))},{})},routeToState:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(r,n){return Ve(Ve({},r),{},er({},n,Hn(t[n])))},{})}}}function Ue(e){"@babel/helpers - typeof";return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(e)}function Cn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
13t%2?Cn(Object(r),!0).forEach(function(n){Ci(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ci(e,t,r){return t=Ru(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ru(e){var t=Pu(e,"string");return Ue(t)=="symbol"?t:String(t)}function Pu(e,t){if(Ue(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ue(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ou=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.router,n=r===void 0?mu():r,i=t.stateMapping,a=i===void 0?Su():i,c=t.$$internal,f=c===void 0?!1:c;return function(h){var d=h.instantSearchInstance;function m(s){var o=d.mainIndex.getWidgets().length===0?d._initialUiState:d.mainIndex.getWidgetUiState({}),v=Object.keys(s).reduce(function(u,p){return Ke(Ke({},u),{},Ci({},p,s[p]))},o),g=a.stateToRoute(v);return n.createURL(g)}d._createURL=m;var S=void 0,l=d._initialUiState;return{$$type:"ais.router({router:".concat(n.$$type||"__unknown__",", stateMapping:").concat(a.$$type||"__unknown__","})"),$$internal:f,onStateChange:function(o){var v=o.uiState,g=a.stateToRoute(v);(S===void 0||!mi(S,g))&&(n.write(g),S=g)},subscribe:function(){d._initialUiState=Ke(Ke({},l),a.routeToState(n.read())),n.onUpdate(function(o){d.mainIndex.getWidgets().length>0&&d.setUiState(a.routeToState(o))})},started:function(){var o;(o=n.start)===null||o===void 0||o.call(n)},unsubscribe:function(){n.dispose()}}}};function wu(e,t){return e.toLocaleString(t)}function We(e){"@babel/helpers - typeof";return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(e)}function Dn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dn(Object(r),!0).forEach(function(n){ju(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ju(e,t,r){return t=_u(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _u(e){var t=Fu(e,"string");return We(t)=="symbol"?t:String(t)}function Fu(e,t){if(We(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(We(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xu(e){var t=e.numberLocale;return{formatNumber:function(n,i){return wu(Number(i(n)),t)},highlight:function(n,i){try{var a=JSON.parse(n);return i(Ao(ae(ae({},a),{},{hit:this})))}catch{throw new Error(` 14The highlight helper expects a JSON object of the format: 15{ "attribute": "name", "highlightedTagName": "mark" }`)}},reverseHighlight:function(n,i){try{var a=JSON.parse(n);return i(Io(ae(ae({},a),{},{hit:this})))}catch{throw new Error(` 16 The reverseHighlight helper expects a JSON object of the format: 17 { "attribute": "name", "highlightedTagName": "mark" }`)}},snippet:function(n,i){try{var a=JSON.parse(n);return i(Co(ae(ae({},a),{},{hit:this})))}catch{throw new Error(` 18The snippet helper expects a JSON object of the format: 19{ "attribute": "name", "highlightedTagName": "mark" }`)}},reverseSnippet:function(n,i){try{var a=JSON.parse(n);return i(No(ae(ae({},a),{},{hit:this})))}catch{throw new Error(` 20 The reverseSnippet helper expects a JSON object of the format: 21 { "attribute": "name", "highlightedTagName": "mark" }`)}},insights:function(n,i){try{var a=JSON.parse(n),c=a.method,f=a.payload;return i(Wo(c,ae({objectIDs:[this.objectID]},f)))}catch{throw new Error(` 22The insights helper expects a JSON object of the format: 23{ "method": "method-name", "payload": { "eventName": "name of the event" } }`)}}}}const Eu="4.80.0";function ve(e){"@babel/helpers - typeof";return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(e)}function Nn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
23t%2?Nn(Object(r),!0).forEach(function(n){q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Au(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,Di(n.key),n)}}function $u(e,t,r){return t&&Au(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iu(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tr(e,t)}function tr(e,t){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tr(e,t)}function Hu(e){var t=Du();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Cu(this,i)}}function Cu(e,t){if(t&&(ve(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U(e)}function U(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Du(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ge(e){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ge(e)}function q(e,t,r){return t=Di(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Di(e){var t=Nu(e,"string");return ve(t)=="symbol"?t:String(t)}function Nu(e,t){if(ve(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ve(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var se=Xe({name:"instantsearch"});function Uu(){return"#"}var Ni={preserveSharedStateOnUnmount:!1,persistHierarchicalRootCount:!1},Wu=(function(e){Iu(r,e);var t=Hu(r);function r(n){var i;Tu(this,r),i=t.call(this),q(U(i),"client",void 0),q(U(i),"indexName",void 0),q(U(i),"compositionID",void 0),q(U(i),"insightsClient",void 0),q(U(i),"onStateChange",null),q(U(i),"future",void 0),q(U(i),"helper",void 0),q(U(i),"mainHelper",void 0),q(U(i),"mainIndex",void 0),q(U(i),"started",void 0),q(U(i),"templatesConfig",void 0),q(U(i),"renderState",{}),q(U(i),"_stalledSearchDelay",void 0),q(U(i),"_searchStalledTimer",void 0),q(U(i),"_initialUiState",void 0),q(U(i),"_initialResults",void 0),q(U(i),"_manuallyResetScheduleSearch",!1),q(U(i),"_resetScheduleSearch",void 0),q(U(i),"_createURL",void 0),q(U(i),"_searchFunction",void 0),q(U(i),"_mainHelperSearch",void 0),q(U(i),"_hasSearchWidget",!1),q(U(i),"_hasRecommendWidget",!1),q(U(i),"_insights",void 0),q(U(i),"middleware",[]),q(U(i),"sendEventToInsights",void 0),q(U(i),"status","idle"),q(U(i),"error",void 0),q(U(i),"scheduleSearch",ge(function(){i.started&&i.mainHelper.search()})),q(U(i),"scheduleRender",ge(function(){var x,E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;(x=i.mainHelper)!==null&&x!==void 0&&x.hasPendingRequests()||(clearTimeout(i._searchStalledTimer),i._searchStalledTimer=null,E&&(i.status="idle",i.error=void 0)),i.mainIndex.render({instantSearchInstance:U(i)}),i.emit("render")})),q(U(i),"onInternalStateChange",ge(function(){var x=i.mainIndex.getWidgetUiState({});i.middleware.forEach(function(E){var I=E.instance;I.onStateChange({uiState:x})})})),i.setMaxListeners(100);var a=n.indexName,c=a===void 0?"":a,f=n.compositionID,h=n.numberLocale,d=n.initialUiState,m=d===void 0?{}:d,S=n.routing,l=S===void 0?null:S,s=n.insights,o=s===void 0?void 0:s,v=n.searchFunction,g=n.stalledSearchDelay,u=g===void 0?200:g,p=n.searchClient,b=p===void 0?null:p,P=n.insightsClient,R=P===void 0?null:P,j=n.onStateChange,_=j===void 0?null:j,y=n.future,O=y===void 0?Wt(Wt({},Ni),n.future||{}):y;if(b===null)throw new Error(se("The `searchClient` option is required."));if(typeof b.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 b.addAlgoliaAgent=="function"&&b.addAlgoliaAgent("instantsearch.js (".concat(Eu,")")),R&&typeof R!="function")throw new Error(se("The `insightsClient` option should be a function."));
23if(i.client=b,i.future=O,i.insightsClient=R,i.indexName=c,i.compositionID=f,i.helper=null,i.mainHelper=null,i.mainIndex=bo({indexName:i.compositionID||i.indexName}),i.onStateChange=_,i.started=!1,i.templatesConfig={helpers:xu({numberLocale:h}),compileOptions:{}},i._stalledSearchDelay=u,i._searchStalledTimer=null,i._createURL=Uu,i._initialUiState=m,i._initialResults=null,i._insights=o,v&&(i._searchFunction=v),i.sendEventToInsights=ee,l){var w=typeof l=="boolean"?{}:l;w.$$internal=!0,i.use(Ou(w))}if(o){var F=typeof o=="boolean"?{}:o;F.$$internal=!0,i.use(On(F))}return nu()&&i.use(iu({$$internal:!0})),i}return $u(r,[{key:"_isSearchStalled",get:(function(){return this.status==="stalled"})},{key:"use",value:function(){for(var i=this,a=arguments.length,c=new Array(a),f=0;f<a;f++)c[f]=arguments[f];var h=c.map(function(d){var m=Wt({$$type:"__unknown__",$$internal:!1,subscribe:ee,started:ee,unsubscribe:ee,onStateChange:ee},d({instantSearchInstance:i}));return i.middleware.push({creator:d,instance:m}),m});return this.started&&h.forEach(function(d){d.subscribe(),d.started()}),this}},{key:"unuse",value:function(){for(var i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];return this.middleware.filter(function(f){return a.includes(f.creator)}).forEach(function(f){return f.instance.unsubscribe()}),this.middleware=this.middleware.filter(function(f){return!a.includes(f.creator)}),this}},{key:"EXPERIMENTAL_use",value:function(){return this.use.apply(this,arguments)}},{key:"addWidget",value:function(i){return this.addWidgets([i])}},{key:"addWidgets",value:function(i){if(!Array.isArray(i))throw new Error(se("The `addWidgets` method expects an array of widgets. Please use `addWidget`."));if(this.compositionID&&i.some(function(a){return!Array.isArray(a)&&Z(a)&&!a._isolated}))throw new Error(se("The `index` widget cannot be used with a composition-based InstantSearch implementation."));return this.mainIndex.addWidgets(i),this}},{key:"removeWidget",value:function(i){return this.removeWidgets([i])}},{key:"removeWidgets",value:function(i){if(!Array.isArray(i))throw new Error(se("The `removeWidgets` method expects an array of widgets. Please use `removeWidget`."));return this.mainIndex.removeWidgets(i),this}},{key:"start",value:function(){var i=this;if(this.started)throw new Error(se("The `start` method has already been called once."));var a=this.mainHelper||J(this.client,this.indexName,void 0,{persistHierarchicalRootCount:this.future.persistHierarchicalRootCount});if(this.compositionID&&(a.searchForFacetValues=a.searchForCompositionFacetValues.bind(a)),a.search=function(){return i.status="loading",i.scheduleRender(!1),i._hasSearchWidget&&(i.compositionID?a.searchWithComposition():a.searchOnlyWithDerivedHelpers()),i._hasRecommendWidget&&a.recommend(),a},this._searchFunction){var c={search:function(){return new Promise(ee)}};this._mainHelperSearch=a.search.bind(a),a.search=function(){var h=i.mainIndex.getHelper(),d=J(c,h.state.index,h.state);return d.once("search",function(m){var S=m.state;h.overrideStateWithoutTriggeringChangeEvent(S),i._mainHelperSearch()}),d.on("change",function(m){var S=m.state;h.setState(S)}),i._searchFunction(d),a}}if(a.on("error",function(h){var d=h.error;if(!(d instanceof Error)){var m=d;d=Object.keys(m).reduce(function(S,l){return S[l]=m[l],S},new Error(m.message))}d.error=d,i.error=d,i.status="error",i.scheduleRender(!1),i.emit("error",d)}),this.mainHelper=a,this.middleware.forEach(function(h){var d=h.instance;d.subscribe()}),this.mainIndex.init({instantSearchInstance:this,parent:null,uiState:this._initialUiState}),this._initialResults){cs(this.client,this._initialResults),ts(this.mainHelper,this._initialResults);var f=this.scheduleSearch;this.scheduleSearch=ge(ee),this._manuallyResetScheduleSearch?this._resetScheduleSearch=function(){i.scheduleSearch=f}:ge(function(){i.scheduleSearch=f})()}else this.mainIndex.getWidgets().length>0&&this.scheduleSearch();this.helper=this.mainIndex.getHelper(),this.started=!0,this.middleware.forEach(function(h){var d=h.instance;d.started()}),typeof this._insights>"u"&&a.derivedHelpers[0].once("result",function(){var h=i.mainIndex.getScopedResults().some(function(d){var m=d.results;return m?._automaticInsights});h&&i.use(On({$$internal:!0,$$automatic:!0}))})}},{key:"dispose",value:function(){var i;this.scheduleSearch.cancel(),this.scheduleRender.cancel(),clearTimeout(this._searchStalledTimer),this.removeWidgets(this.mainIndex.getWidgets()),this.mainIndex.dispose(),this.started=!1,this.removeAllListeners(),(i=this.mainHelper)===null||i===void 0||i.removeAllListeners(),this.mainHelper=null,this.helper=null,this.middleware.forEach(function(a){var c=a.instance;c.unsubscribe()})}},{key:"scheduleStalledRender",value:function(){var i=this;this._searchStalledTimer||(this._searchStalledTimer=setTimeout(function(){i.status="stalled",i.scheduleRender()},this._stalledSearchDelay))}},{key:"setUiState",value:function(i){var a=this,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!this.mainHelper)throw new Error(se("The `start` method needs to be called before `setUiState`."));this.mainIndex.refreshUiState();var f=typeof i=="function"?i(this.mainIndex.getWidgetUiState({})):i;this.onStateChange&&c?this.onStateChange({uiState:f,setUiState:function(d){Kt(typeof d=="function"?d(f):d,a.mainIndex),a.scheduleSearch(),a.onInternalStateChange()}}):(Kt(f,this.mainIndex),this.scheduleSearch(),this.onInternalStateChange())}},{key:"getUiState",value:function(){return this.started&&this.mainIndex.refreshUiState(),this.mainIndex.getWidgetUiState({})}},{key:"createURL",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.started)throw new Error(se("The `start` method needs to be called before `createURL`."));return this._createURL(i)}},{key:"refresh",value:function(){if(!this.mainHelper)throw new Error(se("The `start` method needs to be called before `refresh`."));this.mainHelper.clearCache().search()}}]),r})(xo),qt={exports:{}},Lt={};var Un;function qu(){if(Un)return Lt;Un=1;var e=Bi();function t(S,l){return S===l&&(S!==0||1/S===1/l)||S!==S&&l!==l}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,c=e.useDebugValue;function f(S,l){var s=l(),o=n({inst:{value:s,getSnapshot:l}}),v=o[0].inst,g=o[1];return a(function(){v.value=s,v.getSnapshot=l,h(v)&&g({inst:v})},[S,s,l]),i(function(){return h(v)&&g({inst:v}),S(function(){h(v)&&g({inst:v})})},[S]),c(s),s}function h(S){var l=S.getSnapshot;S=S.value;try{var s=l();return!r(S,s)}catch{return!0}}function d(S,l){return l()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Lt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Lt}var Wn;
23function Lu(){return Wn||(Wn=1,qt.exports=qu()),qt.exports}var Qu=Lu(),ku={};function qe(e){"@babel/helpers - typeof";return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qe(e)}function qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ln(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qn(Object(r),!0).forEach(function(n){Mu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mu(e,t,r){return t=Bu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bu(e){var t=Vu(e,"string");return qe(t)=="symbol"?t:String(t)}function Vu(e,t){if(qe(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qe(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qn=["react (".concat(C.version,")"),"react-instantsearch (".concat(Mt,")"),"react-instantsearch-core (".concat(Mt,")")],kn="react-instantsearch-server (".concat(Mt,")"),Ku=function(t){return t?"next.js (".concat(t,")"):null};function zu(e){var t=_o(),r=Si(),n=Ri(),i=Oi(),a=i.waitForResultsRef,c=n?.initialResults,f=C.useRef(e),h=r||c||a,d=C.useRef(null);if(n!=null&&n.ssrSearchRef&&(d=n.ssrSearchRef),d.current===null){var m=new Wu(e);m._schedule=function(u){m._schedule.queue.push(u),clearTimeout(m._schedule.timer),m._schedule.timer=setTimeout(function(){m._schedule.queue.forEach(function(p){p()}),m._schedule.queue=[]},0)},m._schedule.queue=[],h&&(m._initialResults=c||{},m._manuallyResetScheduleSearch=!0),Mn(e.searchClient,[].concat(Qn,[r&&kn,Ku(Ju())])),h&&m.start(),r&&r.notifyServer({search:m}),e.routing,d.current=m}{var S=d.current,l=f.current;if(l.indexName!==e.indexName&&(S.helper.setIndex(e.indexName||"").search(),f.current=e),l.searchClient!==e.searchClient&&(Mn(e.searchClient,[].concat(Qn,[r&&kn])),S.mainHelper.setClient(e.searchClient).search(),f.current=e),l.onStateChange!==e.onStateChange&&(S.onStateChange=e.onStateChange,f.current=e),l.searchFunction!==e.searchFunction&&(S._searchFunction=e.searchFunction,f.current=e),l.stalledSearchDelay!==e.stalledSearchDelay){var s;S._stalledSearchDelay=(s=e.stalledSearchDelay)!==null&&s!==void 0?s:200,f.current=e}pe(l.future,e.future)||(S.future=Ln(Ln({},Ni),e.future),f.current=e)}var o=C.useRef(null),v=Qu.useSyncExternalStore(C.useCallback(function(){var g=d.current;return o.current===null?g.started||(g.start(),t()):(clearTimeout(o.current),g._preventWidgetCleanup=!1),function(){if(n!=null&&n.ssrSearchRef)return;function u(){g.dispose()}clearTimeout(g._schedule.timer),o.current=setTimeout(u),g._preventWidgetCleanup=!0}},[t,n]),function(){return d.current},function(){return d.current});return v}function Mn(e,t){typeof e.addAlgoliaAgent=="function"&&t.filter(Boolean).forEach(function(r){e.addAlgoliaAgent(r)})}function Ju(){var e,t;return typeof window<"u"&&((e=window.next)===null||e===void 0?void 0:e.version)||(typeof Vi<"u"?(t=ku)===null||t===void 0?void 0:t.NEXT_RUNTIME:void 0)}var Gu=["children"];function Xu(e,t){if(e==null)return{};var r=Yu(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yu(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}function Zu(e){var t=e.children,r=Xu(e,Gu),n=zu(r);return n.started?et.createElement(bi.Provider,{value:n},et.createElement(gi.Provider,{value:n.mainIndex},t,et.createElement(ec,{search:n}))):null}function ec(e){var t=e.search;return C.useEffect(function(){t._resetScheduleSearch&&t._resetScheduleSearch()},[t]),null}function Le(e){"@babel/helpers - typeof";return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(e)}function Bn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
23t%2?Bn(Object(r),!0).forEach(function(n){tc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tc(e,t,r){return t=rc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rc(e){var t=nc(e,"string");return Le(t)=="symbol"?t:String(t)}function nc(e,t){if(Le(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Le(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ic=Xe({name:"search-box",connector:!0}),ac=function(t,r){return r(t)},sc=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee;return ba(t,ic()),function(n){var i=n||{},a=i.queryHook,c=a===void 0?ac:a,f,h;return{$$type:"ais.searchBox",init:function(m){var S=m.instantSearchInstance;t(ue(ue({},this.getWidgetRenderState(m)),{},{instantSearchInstance:S}),!0)},render:function(m){var S=m.instantSearchInstance;t(ue(ue({},this.getWidgetRenderState(m)),{},{instantSearchInstance:S}),!1)},dispose:function(m){var S=m.state;return r(),S.setQueryParameter("query",void 0)},getRenderState:function(m,S){return ue(ue({},m),{},{searchBox:this.getWidgetRenderState(S)})},getWidgetRenderState:function(m){var S=m.helper,l=m.instantSearchInstance,s=m.state;return f||(f=function(v){c(v,function(g){return S.setQuery(g).search()})},h=function(){S.setQuery("").search()}),{query:s.query||"",refine:f,clear:h,widgetParams:n,isSearchStalled:l.status==="stalled"}},getWidgetUiState:function(m,S){var l=S.searchParameters,s=l.query||"";return s===""||m&&m.query===s?m:ue(ue({},m),{},{query:s})},getWidgetSearchParameters:function(m,S){var l=S.uiState;return m.setQueryParameter("query",l.query||"")}}}};function oc(e,t){return wi(sc,e,t)}function uc(e,t){return hc(e)||lc(e,t)||fc(e,t)||cc()}function cc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 24In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fc(e,t){if(e){if(typeof e=="string")return Vn(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vn(e,t)}}function Vn(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 lc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,c,f=[],h=!0,d=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(h=(n=a.call(r)).done)&&(f.push(n.value),f.length!==t);h=!0);}catch(m){d=!0,i=m}finally{try{if(!h&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function hc(e){if(Array.isArray(e))return e}function dc(){var e=ke(),t=fr(),r=C.useState(function(){var c=Jt(t);return{results:c.results,scopedResults:c.scopedResults}}),n=uc(r,2),i=n[0],a=n[1];return C.useEffect(function(){function c(){var f=t.getResults();if(f!==null)a({results:f,scopedResults:t.getScopedResults()});else if(e.mainIndex.getIndexName().length===0){var h=e.mainIndex.getWidgets().find(Z);h&&a({results:Jt(t).results,scopedResults:h.getScopedResults()})}}return e.addListener("render",c),c(),function(){e.removeListener("render",c)}},[e,t]),i}function Kn(e,t){return gc(e)||vc(e,t)||pc(e,t)||mc()}function mc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 25In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pc(e,t){if(e){if(typeof e=="string")return zn(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(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zn(e,t)}}function zn(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 vc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,c,f=[],h=!0,d=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(h=(n=a.call(r)).done)&&(f.push(n.value),f.length!==t);h=!0);}catch(m){d=!0,i=m}
25finally{try{if(!h&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function gc(e){if(Array.isArray(e))return e}function yc(){var e=ke(),t=fr(),r=t.getIndexId(),n=C.useState(function(){return e.getUiState()}),i=Kn(n,2),a=i[0],c=i[1],f=a[r],h=C.useState(function(){return e.renderState}),d=Kn(h,2),m=d[0],S=d[1],l=m[r]||{},s=C.useCallback(function(v){e.setUiState(v)},[e]),o=C.useCallback(function(v){t.setIndexUiState(v)},[t]);return C.useEffect(function(){function v(){c(e.getUiState()),S(e.renderState)}return e.addListener("render",v),v(),function(){e.removeListener("render",v)}},[e]),{uiState:a,setUiState:s,indexUiState:f,setIndexUiState:o,renderState:m,indexRenderState:l}}function bc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.catchError,r=ke(),n=yc(),i=n.uiState,a=n.setUiState,c=n.indexUiState,f=n.setIndexUiState,h=n.renderState,d=n.indexRenderState,m=dc(),S=m.results,l=m.scopedResults,s=C.useCallback(function(){for(var v=arguments.length,g=new Array(v),u=0;u<v;u++)g[u]=arguments[u];return r.use.apply(r,g),function(){r.unuse.apply(r,g)}},[r]),o=C.useCallback(function(){r.refresh()},[r]);return Pi(function(){if(t){var v=function(){};return r.addListener("error",v),function(){return r.removeListener("error",v)}}return function(){}},[r,t]),{results:S,scopedResults:l,uiState:i,setUiState:a,indexUiState:c,setIndexUiState:f,renderState:h,indexRenderState:d,addMiddlewares:s,refresh:o,status:r.status,error:r.error}}const Qt=Object.freeze({LOADING:"loading",STALLED:"stalled",ERROR:"error",IDLE:"idle"}),Sc=C.memo(({headerSlot:e,emptySearchSlot:t,searchResultsSkeletonSlot:r,filtersSlot:n,resultsSlot:i,resultsSlotProps:a,inputSlot:c,initialQueryObject:f={},loading:h=!1,isSearch:d=!1})=>{const{status:m}=bc(),{query:S}=f,{query:l}=oc();uo({});const s=m===Qt.LOADING||m===Qt.STALLED,{trackVirtualPageView:o}=ea(),v=i;return C.useEffect(()=>{S&&l!==S&&d&&o({name:"search",term:l})},[S,l]),he.jsxs(he.Fragment,{children:[e,c,!l&&t,n,v?he.jsx(C.Suspense,{fallback:he.jsx("span",{}),children:he.jsx(v,{searchTerm:l,...a,isLoading:s||h,isIdle:m===Qt.IDLE,skeletonSlot:r})}):null]})});Sc.propTypes={headerSlot:V.node,inputSlot:V.node,filtersSlot:V.node,emptySearchSlot:V.node,searchResultsSkeletonSlot:V.node,resultsSlot:V.elementType,resultsSlotProps:V.shape({}),initialQueryObject:V.shape({facetFilters:V.arrayOf(V.arrayOf(V.string)),query:V.string}),loading:V.bool,isSearch:V.bool};function Rc(){function e(t){return new Promise(r=>{let n=new XMLHttpRequest;n.open(t.method,t.url,!0),Object.keys(t.headers).forEach(f=>n.setRequestHeader(f,t.headers[f]));let i=(f,h)=>setTimeout(()=>{n.abort(),r({status:0,content:h,isTimedOut:!0})},f),a=i(t.connectTimeout,"Connection timeout"),c;n.onreadystatechange=()=>{n.readyState>n.OPENED&&c===void 0&&(clearTimeout(a),c=i(t.responseTimeout,"Socket timeout"))},n.onerror=()=>{n.status===0&&(clearTimeout(a),clearTimeout(c),r({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=()=>{clearTimeout(a),clearTimeout(c),r({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(t.data)})}return{send:e}}function Pc(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(f){n().setItem(r,JSON.stringify(f))}function c(){const f=e.timeToLive?e.timeToLive*1e3:null,h=i(),d=Object.fromEntries(Object.entries(h).filter(([,S])=>S.timestamp!==void 0));if(a(d),!f)return;const m=Object.fromEntries(Object.entries(d).filter(([,S])=>{const l=new Date().getTime();return!(S.timestamp+f<l)}));a(m)}return{get(f,h,d={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(c(),i()[JSON.stringify(f)])).then(m=>Promise.all([m?m.value:h(),m!==void 0])).then(([m,S])=>Promise.all([m,S||d.miss(m)])).then(([m])=>m)},set(f,h){return Promise.resolve().then(()=>{const d=i();return d[JSON.stringify(f)]={timestamp:new Date().getTime(),value:h},n().setItem(r,JSON.stringify(d)),h})},delete(f){return Promise.resolve().then(()=>{const h=i();delete h[JSON.stringify(f)],n().setItem(r,JSON.stringify(h))})},clear(){return Promise.resolve().then(()=>{n().removeItem(r)})}}}function Oc(){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?Oc():{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))}
25,clear(){return r.clear().catch(()=>Oe({caches:t}).clear())}}}function kt(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 c=n();return c.then(f=>i.miss(f)).then(()=>c)},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 wc(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 jc(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 _c({algoliaAgents:e,client:t,version:r}){const n=wc(r).add({segment:t,version:r});return e.forEach(i=>n.add(i)),n}function Fc(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var Jn=120*1e3;function Gn(e,t="up"){const r=Date.now();function n(){return t==="up"||Date.now()-r>Jn}function i(){return t==="timed out"&&Date.now()-r<=Jn}return{...e,status:t,lastUpdate:r,isUp:n,isTimedOut:i}}var Ui=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t)}},Wi=class extends Ui{stackTrace;constructor(e,t,r){super(e,r),this.stackTrace=t}},xc=class extends Wi{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")}},rr=class extends Wi{status;constructor(e,t,r,n="ApiError"){super(e,r,n),this.status=t}},Ec=class extends Ui{response;constructor(e,t){super(e,"DeserializationError"),this.response=t}},Tc=class extends rr{error;constructor(e,t,r,n){super(e,t,n,"DetailedApiError"),this.error=r}};function Ac(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 $c(e,t,r){const n=Ic(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 Ic(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 Hc(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 Cc(e,t,r){const n={Accept:"application/json",...e,...t,...r},i={};return Object.keys(n).forEach(a=>{const c=n[a];i[a.toLowerCase()]=c}),i}function Dc(e){try{return JSON.parse(e.content)}catch(t){throw new Ec(t.message,e)}}function Nc({content:e,status:t},r){try{const n=JSON.parse(e);return"error"in n?new Tc(n.message,t,n.error,r):new rr(n.message,t,r)}catch{}return new rr(e,t,r)}function Uc({isTimedOut:e,status:t}){return!e&&~~t===0}function Wc({isTimedOut:e,status:t}){return e||Uc({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function qc({status:e}){return~~(e/100)===2}function Lc(e){return e.map(t=>qi(t))}function qi(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 Qc({hosts:e,hostsCache:t,baseHeaders:r,logger:n,baseQueryParameters:i,algoliaAgent:a,timeouts:c,requester:f,requestsCache:h,responsesCache:d}){async function m(s){const o=await Promise.all(s.map(b=>t.get(b,()=>Promise.resolve(Gn(b))))),v=o.filter(b=>b.isUp()),g=o.filter(b=>b.isTimedOut()),u=[...v,...g];return{hosts:u.length>0?u:s,getTimeout(b,P){return(g.length===0&&b===0?1:g.length+3+b)*P}}}async function S(s,o,v=!0){const g=[],u=Hc(s,o),p=Cc(r,s.headers,o.headers),b=s.method==="GET"?{...s.data,...o.data}:{},P={...i,...s.queryParameters,...b};
25if(a.value&&(P["x-algolia-agent"]=a.value),o&&o.queryParameters)for(const O of Object.keys(o.queryParameters))!o.queryParameters[O]||Object.prototype.toString.call(o.queryParameters[O])==="[object Object]"?P[O]=o.queryParameters[O]:P[O]=o.queryParameters[O].toString();let R=0;const j=async(O,w)=>{const F=O.pop();if(F===void 0)throw new xc(Lc(g));const x={...c,...o.timeouts},E={data:u,headers:p,method:s.method,url:$c(F,s.path,P),connectTimeout:w(R,x.connect),responseTimeout:w(R,v?x.read:x.write)},I=A=>{const $={request:E,response:A,host:F,triesLeft:O.length};return g.push($),$},H=await f.send(E);if(Wc(H)){const A=I(H);return H.isTimedOut&&R++,n.info("Retryable failure",qi(A)),await t.set(F,Gn(F,H.isTimedOut?"timed out":"down")),j(O,w)}if(qc(H))return Dc(H);throw I(H),Nc(H,g)},_=e.filter(O=>O.accept==="readWrite"||(v?O.accept==="read":O.accept==="write")),y=await m(_);return j([...y.hosts].reverse(),y.getTimeout)}function l(s,o={}){const v=s.useReadTransporter||s.method==="GET";if(!v)return S(s,o,v);const g=()=>S(s,o);if((o.cacheable||s.cacheable)!==!0)return g();const p={request:s,requestOptions:o,transporter:{queryParameters:i,headers:r}};return d.get(p,()=>h.get(p,()=>h.set(p,g()).then(b=>Promise.all([h.delete(p),b]),b=>Promise.all([h.delete(p),Promise.reject(b)])).then(([b,P])=>P)),{miss:b=>d.set(p,b)})}return{hostsCache:t,requester:f,timeouts:c,logger:n,algoliaAgent:a,baseHeaders:r,baseQueryParameters:i,hosts:e,request:l,requestsCache:h,responsesCache:d}}var Li="5.38.0";function kc(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(Ac([{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 Mc({appId:e,apiKey:t,authMode:r,algoliaAgents:n,...i}){const a=jc(e,t,r),c=Qc({hosts:kc(e),...i,algoliaAgent:_c({algoliaAgents:n,client:"Lite",version:Li}),baseHeaders:{"content-type":"text/plain",...a.headers(),...i.baseHeaders},baseQueryParameters:{...a.queryParameters(),...i.baseQueryParameters}});return{transporter:c,appId:e,apiKey:t,clearCache(){return Promise.all([c.requestsCache.clear(),c.responsesCache.clear()]).then(()=>{})},get _ua(){return c.algoliaAgent.value},addAlgoliaAgent(f,h){c.algoliaAgent.add({segment:f,version:h})},setClientApiKey({apiKey:f}){!r||r==="WithinHeaders"?c.baseHeaders["x-algolia-api-key"]=f:c.baseQueryParameters["x-algolia-api-key"]=f},searchForHits(f,h){return this.search(f,h)},searchForFacets(f,h){return this.search(f,h)},customPost({path:f,parameters:h,body:d},m){if(!f)throw new Error("Parameter `path` is required when calling `customPost`.");const o={method:"POST",path:"/{path}".replace("{path}",f),queryParameters:h||{},headers:{},data:d||{}};return c.request(o,m)},getRecommendations(f,h){if(f&&Array.isArray(f)&&(f={requests:f}),!f)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!f.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const l={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:f,useReadTransporter:!0,cacheable:!0};return c.request(l,h)},search(f,h){if(f&&Array.isArray(f)&&(f={requests:f.map(({params:o,...v})=>v.type==="facet"?{...v,...o,type:"facet"}:{...v,...o,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),!f)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!f.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");const l={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:f,useReadTransporter:!0,cacheable:!0};return c.request(l,h)}}}function Bc(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.");return Mc({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:Fc(),requester:Rc(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:kt(),requestsCache:kt({serializable:!1}),hostsCache:Oe({caches:[Pc({key:`${Li}-${e}`}),kt()]}),...r})}const Qi={hits:[],nbHits:0,nbPages:0,page:0,processingTimeMS:0},Vc=e=>({...e,results:[Qi,...e.results]}),Kc=300*1e3,zc=e=>JSON.stringify(e),Jc=({proxy:e=!0,children:t,context:r="",indexName:n="",stalledSearchDelayTime:i=1e3,initialUiState:a,initialQuery:c})=>{const{currentUser:f,currentUserLoaded:h}=Ki(),{settings:{algolia:d}}=zi(),m=n||d.indexName,S=c?{[m]:{query:c}}:a,l=C.useRef(new Map),s=C.useMemo(()=>{const o=Bc(d.id,d.searchKey);return{...o,async search(v){if(!h||v.every(({params:R})=>!R.query))return Promise.resolve({results:v.map(()=>Qi)});const g=v.filter(R=>R.params?.query&&!hr(R.params?.query)),u=v.some(R=>
25!R.params?.query||hr(R.params?.query)),p=g.map(R=>({...R,params:{page:0,...R.params,ruleContexts:r}})),b=!e||Ji.isPaid(f);let P;if(b)P=await o.search(p);else{const R=zc(p),j=l.current.get(R);j?P=j:(P=(await Gi.get(Xi.algoliaSearchProxy(),{params:p,paramsSerializer:y=>Yi.stringify(y,{encode:!1})})).data,l.current.set(R,P),setTimeout(()=>{l.current.delete(R)},Kc))}return u?Vc(P):P}}},[h,f,d,r,m,e]);return C.useEffect(()=>()=>{l.current.clear()},[]),C.useEffect(()=>{if(d.id&&d.searchKey)try{window.aa("init",{appId:d.id,apiKey:d.searchKey,useCookie:!0})}catch(o){Zi.logError(`Failed to initialize search-insights: ${o}`)}},[d.id,d.searchKey]),he.jsx(Zu,{searchClient:s,insights:!0,stalledSearchDelay:i,indexName:m,initialUiState:S,future:{preserveSharedStateOnUnmount:!0},children:t})};Jc.propTypes={proxy:V.bool,children:V.node.isRequired,context:V.string,indexName:V.string,stalledSearchDelayTime:V.number,initialUiState:V.shape(),initialQuery:V.string};export{Jc as A,gi as I,Sc as S,kr as T,Ri as a,fr as b,mn as c,_o as d,Pi as e,Js as f,Xe as g,ba as h,bo as i,Zc as j,ef as k,Yc as l,tf as m,rf as n,ee as o,wi as p,bc as q,Z as r,mi as s,Vr as t,Si as u};
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.