@seekora-ai/ui-sdk-react 0.2.28 → 0.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("@seekora-ai/search-sdk")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@seekora-ai/search-sdk"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SeekoraUI={},e.React,e.ReactDOM,e.SeekoraSDK)}(this,function(e,t,r,a){"use strict";var o;!function(e){e[e.VERBOSE=0]="VERBOSE",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT"}(o||(o={}));class n{constructor(e={}){this.level=e.level??this.getDefaultLevel(),this.prefix=e.prefix??"[Seekora UI SDK]",this.enableTimestamp=e.enableTimestamp??!1}getDefaultLevel(){switch(void 0){case"VERBOSE":return o.VERBOSE;case"INFO":return o.INFO;case"WARN":return o.WARN;case"ERROR":return o.ERROR;case"SILENT":return o.SILENT}return"undefined"!=typeof window&&window.__SEEKORA_DEBUG__?o.VERBOSE:o.INFO}formatMessage(e,...t){const r=[];return this.enableTimestamp&&r.push(`[${(new Date).toISOString()}]`),r.push(this.prefix,`[${e}]`),[...r,...t]}verbose(...e){this.level<=o.VERBOSE&&console.log(...this.formatMessage("VERBOSE",...e))}info(...e){this.level<=o.INFO&&console.info(...this.formatMessage("INFO",...e))}warn(...e){this.level<=o.WARN&&console.warn(...this.formatMessage("WARN",...e))}error(...e){this.level<=o.ERROR&&console.error(...this.formatMessage("ERROR",...e))}setLevel(e){this.level=e}getLevel(){return this.level}setPrefix(e){this.prefix=e}setTimestamp(e){this.enableTimestamp=e}}let s=null;function i(){return s||(s=function(e={}){return new n(e)}()),s}const l=(...e)=>i().verbose(...e),c=(...e)=>i().info(...e),d=(...e)=>i().warn(...e),u=(...e)=>i().error(...e);function p(e){const{attribute:t,hit:r,preTag:a="<mark>",postTag:o="</mark>",fallback:n}=e,s=r._highlightResult?.[t]?.value||r.highlight_result?.[t]?.value||r._highlight?.[t]||r.highlight?.[t];if(s)return s.replace(/<em>/g,a).replace(/<\/em>/g,o).replace(/<mark>/g,a).replace(/<\/mark>/g,o);const i=(l=r,t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:void 0,l));var l;return void 0!==i?String(i):n||""}function m(e,t="<mark>",r="</mark>"){const a=[];let o=e;for(;o.length>0;){const e=o.indexOf(t);if(-1===e){o.length>0&&a.push({value:o,isHighlighted:!1});break}e>0&&a.push({value:o.substring(0,e),isHighlighted:!1});const n=o.substring(e+t.length),s=n.indexOf(r);if(-1===s){a.push({value:o.substring(e),isHighlighted:!1});break}a.push({value:n.substring(0,s),isHighlighted:!0}),o=n.substring(s+r.length)}return a}function g(e,t,r=!1){if(!t||!e)return[{value:e,isHighlighted:!1}];const a=[],o=r?"g":"gi",n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp(n,o);let i,l=0;for(;null!==(i=s.exec(e));)i.index>l&&a.push({value:e.substring(l,i.index),isHighlighted:!1}),a.push({value:i[0],isHighlighted:!0}),l=s.lastIndex;return l<e.length&&a.push({value:e.substring(l),isHighlighted:!1}),a.length>0?a:[{value:e,isHighlighted:!1}]}i();class f{constructor(e){this.listeners=[],this.debounceTimer=null,this.notifyScheduled=!1,this.searchCoalesceTimer=null,this.searchCoalesceResolvers=[],this.client=e.client,this.autoSearch=!1!==e.autoSearch,this.debounceMs=e.debounceMs||300,this.defaultSearchOptions=e.defaultSearchOptions||{widget_mode:!0},this.keepResultsOnClear=!1!==e.keepResultsOnClear,this.abTestId=e.abTestId,this.abVariant=e.abVariant,this.state={query:e.initialQuery||"",refinements:[],currentPage:1,itemsPerPage:e.itemsPerPage||10,sortBy:void 0,results:null,loading:!1,error:null},c("SearchStateManager: Initialized",{autoSearch:this.autoSearch,debounceMs:this.debounceMs})}getState(){return{...this.state}}getQuery(){return this.state.query}getRefinements(){return[...this.state.refinements]}getCurrentPage(){return this.state.currentPage}getResults(){return this.state.results}getLoading(){return this.state.loading}getError(){return this.state.error}setQuery(e,t=!0){return this.state.query===e?(l("SearchStateManager: Query unchanged, skipping update",{query:e}),void(t&&this.autoSearch&&(l("SearchStateManager: Query unchanged but triggerSearch=true, triggering search"),this.debouncedSearch()))):""===e&&this.keepResultsOnClear?(l("SearchStateManager: Query cleared, keeping previous results"),this.state.query="",this.state.currentPage=1,void this.notifyListeners()):(this.state.query=e,this.state.currentPage=1,l("SearchStateManager: Query updated",{query:e,triggerSearch:t,autoSearch:this.autoSearch}),this.notifyListeners(),void(this.autoSearch&&t?(l("SearchStateManager: Triggering debounced search"),this.debouncedSearch()):l("SearchStateManager: Search not triggered",{autoSearch:this.autoSearch,triggerSearch:t})))}addRefinement(e,t,r=!0){const a=this.state.refinements.some(r=>r.field===e&&r.value===t);a||(this.state.refinements.push({field:e,value:t}),this.state.currentPage=1,l("SearchStateManager: Refinement added",{field:e,value:t}),this.notifyListeners(),this.autoSearch&&r&&this.debouncedSearch())}removeRefinement(e,t,r=!0){const a=this.state.refinements.findIndex(r=>r.field===e&&r.value===t);-1!==a&&(this.state.refinements.splice(a,1),this.state.currentPage=1,l("SearchStateManager: Refinement removed",{field:e,value:t}),this.notifyListeners(),this.autoSearch&&r&&this.debouncedSearch())}clearRefinements(e=!0){0!==this.state.refinements.length&&(this.state.refinements=[],this.state.currentPage=1,l("SearchStateManager: Refinements cleared"),this.notifyListeners(),this.autoSearch&&e&&this.debouncedSearch())}setPage(e,t=!0){this.state.currentPage!==e&&(this.state.currentPage=e,l("SearchStateManager: Page updated",{page:e}),this.notifyListeners(),this.autoSearch&&t&&this.debouncedSearch())}setSortBy(e,t=!0){this.state.sortBy!==e&&(this.state.sortBy=e,this.state.currentPage=1,l("SearchStateManager: Sort updated",{sortBy:e}),this.notifyListeners(),this.autoSearch&&t&&this.debouncedSearch())}setItemsPerPage(e,t=!0){this.state.itemsPerPage!==e&&(this.state.itemsPerPage=e,this.state.currentPage=1,l("SearchStateManager: Items per page updated",{itemsPerPage:e}),this.notifyListeners(),this.autoSearch&&t&&this.debouncedSearch())}async search(e){return this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),new Promise((t,r)=>{this.searchCoalesceResolvers.push({resolve:t,reject:r}),this.searchCoalesceTimer&&clearTimeout(this.searchCoalesceTimer),this.searchCoalesceTimer=setTimeout(()=>{this.searchCoalesceTimer=null;const t=[...this.searchCoalesceResolvers];this.searchCoalesceResolvers=[],this._executeSearch(e).then(e=>t.forEach(t=>t.resolve(e)),e=>t.forEach(t=>t.reject(e)))},10)})}async _executeSearch(e){this.setState({loading:!0,error:null});try{const t=this.buildSearchOptions(e);l("SearchStateManager: Performing search",{query:this.state.query,refinementsCount:this.state.refinements.length,currentPage:this.state.currentPage,sortBy:this.state.sortBy,filter_by:t.filter_by});const r=await this.client.search(this.state.query,t);return this.setState({results:r,loading:!1,error:null}),c("SearchStateManager: Search completed",{query:this.state.query,resultsCount:r?.results?.length||0,totalResults:r?.totalResults||0}),r}catch(e){const t=e instanceof Error?e:new Error(String(e));return this.setState({results:null,loading:!1,error:t}),u("SearchStateManager: Search failed",{query:this.state.query,error:t.message}),null}}buildSearchOptions(e){const t={...this.defaultSearchOptions,page:this.state.currentPage,per_page:this.state.itemsPerPage,...e};if(this.state.sortBy&&"relevance"!==this.state.sortBy&&(t.sort_by=this.state.sortBy),this.state.refinements.length>0){const e={};this.state.refinements.forEach(t=>{e[t.field]||(e[t.field]=[]),e[t.field].push(t.value)});const r=[];Object.entries(e).forEach(([e,t])=>{t.forEach(t=>{r.push(`${e}:${t}`)})}),r.length>0&&(t.filter_by=r.join(" && "))}return t}debouncedSearch(){this.debounceTimer&&clearTimeout(this.debounceTimer),l("SearchStateManager: Scheduling debounced search",{debounceMs:this.debounceMs}),this.debounceTimer=setTimeout(()=>{l("SearchStateManager: Debounce timer fired, calling search()"),this.search()},this.debounceMs)}subscribe(e){return this.listeners.push(e),e(this.getState()),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}setState(e){this.state={...this.state,...e},this.notifyListeners()}notifyListeners(){this.notifyScheduled||(this.notifyScheduled=!0,queueMicrotask(()=>{this.notifyScheduled=!1;const e=this.getState();this.listeners.forEach(t=>{try{t(e)}catch(e){const t=e instanceof Error?e:new Error(String(e));u("SearchStateManager: Error in listener",{error:t.message})}})}))}clearResults(){this.setState({results:null,loading:!1,error:null}),l("SearchStateManager: Results explicitly cleared")}getAbTestId(){return this.abTestId}getAbVariant(){return this.abVariant}setAbTest(e,t){this.abTestId=e,this.abVariant=t,l("SearchStateManager: A/B test updated",{abTestId:e,abVariant:t})}buildFilterString(){if(0===this.state.refinements.length)return"";const e={};this.state.refinements.forEach(t=>{e[t.field]||(e[t.field]=[]),e[t.field].push(t.value)});const t=[];return Object.entries(e).forEach(([e,r])=>{r.forEach(r=>{t.push(`${e}:${r}`)})}),t.join(" && ")}async fetchFilters(e){l("SearchStateManager: Fetching filters",{options:e});try{const t=await this.client.getFilters({q:this.state.query||void 0,...e});return c("SearchStateManager: Filters fetched",{filterCount:t?.filters?.length}),t}catch(e){const t=e instanceof Error?e:new Error(String(e));throw u("SearchStateManager: Failed to fetch filters",{error:t.message}),t}}async searchFacetValues(e,t){l("SearchStateManager: Searching facet values",{facetName:e,query:t});try{const r=this.buildFilterString(),a=await this.client.searchFacetValues(e,{q:this.state.query||void 0,filter:r||void 0,facetQuery:t});return c("SearchStateManager: Facet values fetched",{facetName:e,valueCount:a?.values?.length}),a}catch(t){const r=t instanceof Error?t:new Error(String(t));throw u("SearchStateManager: Failed to search facet values",{facetName:e,error:r.message}),r}}async getFiltersSchema(){l("SearchStateManager: Getting filters schema");try{const e=await this.client.getFiltersSchema();return c("SearchStateManager: Filters schema fetched",{fieldCount:e?.fields?.length}),e}catch(e){const t=e instanceof Error?e:new Error(String(e));throw u("SearchStateManager: Failed to get filters schema",{error:t.message}),t}}clear(){this.state={query:"",refinements:[],currentPage:1,itemsPerPage:this.state.itemsPerPage,sortBy:void 0,results:null,loading:!1,error:null},this.notifyListeners()}}function h(e,t=0){return function(e,t=0){const r=3&e.length,a=e.length-r;let o=t;const n=3432918353,s=461845907;let i,l=0;for(;l<a;)i=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,i=Math.imul(i,n),i=i<<15|i>>>17,i=Math.imul(i,s),o^=i,o=o<<13|o>>>19,o=Math.imul(o,5)+3864292196;switch(i=0,r){case 3:i^=(255&e.charCodeAt(l+2))<<16;case 2:i^=(255&e.charCodeAt(l+1))<<8;case 1:i^=255&e.charCodeAt(l),i=Math.imul(i,n),i=i<<15|i>>>17,i=Math.imul(i,s),o^=i}return o^=e.length,o^=o>>>16,o=Math.imul(o,2246822507),o^=o>>>13,o=Math.imul(o,3266489909),o^=o>>>16,o>>>0}(e,t).toString(16).padStart(8,"0")}const y={enableCanvas:!0,enableWebGL:!0,enableAudio:!0,enableFonts:!0,enableHardware:!0,timeout:5e3},b=["Arial","Arial Black","Calibri","Cambria","Comic Sans MS","Consolas","Courier New","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Microsoft Sans Serif","Palatino Linotype","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Andale Mono","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arial Hebrew","Avenir","Baskerville","Big Caslon","Brush Script MT","Chalkboard","Cochin","Copperplate","Didot","Futura","Geneva","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Lucida Grande","Marker Felt","Menlo","Monaco","Noteworthy","Optima","Papyrus","Phosphate","Rockwell","San Francisco","Savoye LET","SignPainter","Skia","Snell Roundhand","Zapfino","Cantarell","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Droid Sans","Droid Sans Mono","Droid Serif","FreeMono","FreeSans","FreeSerif","Liberation Mono","Liberation Sans","Liberation Serif","Noto Sans","Noto Serif","Open Sans","Roboto","Ubuntu","Ubuntu Mono","Lato","Montserrat","Oswald","Raleway","Source Sans Pro","PT Sans","Merriweather","Nunito","Playfair Display","Poppins"];class v{constructor(e){this.cachedResult=null,this.config={...y,...e}}async get(){if(this.cachedResult)return this.cachedResult;const e=await this.collectComponents(),t=this.calculateConfidence(e),r=this.generateVisitorId(e);return this.cachedResult={visitorId:r,confidence:t,components:e},this.cachedResult}clearCache(){this.cachedResult=null}async collectComponents(){const[e,t,r,a,o]=await Promise.all([this.config.enableCanvas?this.getCanvasFingerprint():{hash:""},this.config.enableWebGL?this.getWebGLFingerprint():{renderer:"",vendor:"",hash:""},this.config.enableAudio?this.getAudioFingerprint():{hash:""},this.detectAdBlocker(),this.detectIncognito()]);return{canvas:e,webgl:t,audio:r,fonts:this.config.enableFonts?this.detectFonts():[],hardware:this.config.enableHardware?this.getHardwareInfo():{concurrency:0,deviceMemory:0,maxTouchPoints:0,platform:""},screen:this.getScreenInfo(),browser:this.getBrowserInfo(),adBlockerDetected:a,incognitoDetected:o}}async getCanvasFingerprint(){try{const e=document.createElement("canvas");e.width=256,e.height=128;const t=e.getContext("2d");if(!t)return{hash:""};t.fillStyle="#f8f8f8",t.fillRect(0,0,e.width,e.height);const r=t.createLinearGradient(0,0,e.width,0);r.addColorStop(0,"#ff6b6b"),r.addColorStop(.5,"#4ecdc4"),r.addColorStop(1,"#45b7d1"),t.fillStyle=r,t.fillRect(10,10,100,50),t.font="18px Arial",t.fillStyle="#333",t.textBaseline="alphabetic",t.fillText("Seekora Fingerprint 🔐",20,90),t.font="bold 14px Georgia",t.fillStyle="rgba(102, 204, 153, 0.7)",t.fillText("Test String @#$%",130,40),t.beginPath(),t.arc(200,70,30,0,2*Math.PI),t.fillStyle="rgba(255, 165, 0, 0.5)",t.fill(),t.strokeStyle="#333",t.lineWidth=2,t.stroke(),t.beginPath(),t.moveTo(10,120),t.bezierCurveTo(50,80,100,120,140,100),t.strokeStyle="#9b59b6",t.lineWidth=3,t.stroke(),t.save(),t.translate(180,100),t.rotate(.5),t.fillStyle="rgba(52, 152, 219, 0.6)",t.fillRect(-20,-10,40,20),t.restore();const a=e.toDataURL("image/png");return{hash:h(a),data:a}}catch{return{hash:""}}}async getWebGLFingerprint(){try{const e=document.createElement("canvas");e.width=256,e.height=256;const t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{renderer:"",vendor:"",hash:""};const r=t.getExtension("WEBGL_debug_renderer_info"),a=r&&t.getParameter(r.UNMASKED_RENDERER_WEBGL)||"",o=r&&t.getParameter(r.UNMASKED_VENDOR_WEBGL)||"",n=[],s=[t.ALIASED_LINE_WIDTH_RANGE,t.ALIASED_POINT_SIZE_RANGE,t.ALPHA_BITS,t.BLUE_BITS,t.DEPTH_BITS,t.GREEN_BITS,t.MAX_COMBINED_TEXTURE_IMAGE_UNITS,t.MAX_CUBE_MAP_TEXTURE_SIZE,t.MAX_FRAGMENT_UNIFORM_VECTORS,t.MAX_RENDERBUFFER_SIZE,t.MAX_TEXTURE_IMAGE_UNITS,t.MAX_TEXTURE_SIZE,t.MAX_VARYING_VECTORS,t.MAX_VERTEX_ATTRIBS,t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,t.MAX_VERTEX_UNIFORM_VECTORS,t.MAX_VIEWPORT_DIMS,t.RED_BITS,t.RENDERER,t.SHADING_LANGUAGE_VERSION,t.STENCIL_BITS,t.VENDOR,t.VERSION];for(const e of s)try{const r=t.getParameter(e);null!=r&&(r instanceof Float32Array||r instanceof Int32Array?n.push(Array.from(r).join(",")):n.push(String(r)))}catch{}const i=t.getSupportedExtensions()||[];n.push(i.sort().join(","));try{const e="\n attribute vec2 position;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n }\n ",r="\n precision mediump float;\n void main() {\n gl_FragColor = vec4(0.812, 0.373, 0.784, 1.0);\n }\n ",a=t.createShader(t.VERTEX_SHADER);t.shaderSource(a,e),t.compileShader(a);const o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,r),t.compileShader(o);const s=t.createProgram();t.attachShader(s,a),t.attachShader(s,o),t.linkProgram(s),t.useProgram(s);const i=new Float32Array([0,.5,-.5,-.5,.5,-.5]),l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW);const c=t.getAttribLocation(s,"position");t.enableVertexAttribArray(c),t.vertexAttribPointer(c,2,t.FLOAT,!1,0,0),t.clearColor(.1,.1,.1,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLES,0,3);const d=new Uint8Array(262144);t.readPixels(0,0,256,256,t.RGBA,t.UNSIGNED_BYTE,d);const u=[0,1e3,5e3,1e4,25e3,5e4,1e5,2e5];for(const e of u)e<d.length&&n.push(String(d[e]))}catch{}const l=`${a}|${o}|${n.join("|")}`;return{renderer:a,vendor:o,hash:h(l)}}catch{return{renderer:"",vendor:"",hash:""}}}async getAudioFingerprint(){try{const e=window.AudioContext||window.webkitAudioContext;if(!e)return{hash:""};const t=new e,r=t.createOscillator();r.type="triangle",r.frequency.setValueAtTime(1e4,t.currentTime);const a=t.createDynamicsCompressor();a.threshold.setValueAtTime(-50,t.currentTime),a.knee.setValueAtTime(40,t.currentTime),a.ratio.setValueAtTime(12,t.currentTime),a.attack.setValueAtTime(0,t.currentTime),a.release.setValueAtTime(.25,t.currentTime);const o=t.createAnalyser();return o.fftSize=2048,r.connect(a),a.connect(o),o.connect(t.destination),r.start(0),new Promise(e=>{const a=setTimeout(()=>{try{r.stop(),t.close()}catch{}e({hash:""})},this.config.timeout);setTimeout(()=>{try{const n=new Float32Array(o.frequencyBinCount);o.getFloatFrequencyData(n);let s=0,i=0;for(let e=0;e<n.length;e++)isFinite(n[e])&&0!==n[e]&&(s+=Math.abs(n[e]),i++);const l=i>0?s/i:0,c=Array.from(n.slice(0,100)).filter(e=>isFinite(e)).map(e=>e.toFixed(4)).join(",");clearTimeout(a),r.stop(),t.close();const d=h(c+String(l));e({hash:d,value:l})}catch{clearTimeout(a);try{r.stop(),t.close()}catch{}e({hash:""})}},200)})}catch{return{hash:""}}}detectFonts(){const e=[];try{const t=["monospace","sans-serif","serif"],r="mmmmmmmmmmlli",a="72px",o=document.createElement("canvas");o.width=500,o.height=100;const n=o.getContext("2d");if(!n)return e;const s={};for(const e of t)n.font=`${a} ${e}`,s[e]=n.measureText(r).width;for(const o of b){let i=!1;for(const e of t){n.font=`${a} "${o}", ${e}`;if(n.measureText(r).width!==s[e]){i=!0;break}}i&&e.push(o)}}catch{}return e}getHardwareInfo(){const e=navigator;return{concurrency:e.hardwareConcurrency||0,deviceMemory:e.deviceMemory||0,maxTouchPoints:e.maxTouchPoints||0,platform:e.platform||""}}getScreenInfo(){return{width:screen.width||0,height:screen.height||0,colorDepth:screen.colorDepth||0,pixelRatio:window.devicePixelRatio||1}}getBrowserInfo(){const e=navigator;return{language:e.language||"",languages:Array.from(e.languages||[]),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"",timezoneOffset:(new Date).getTimezoneOffset(),cookieEnabled:e.cookieEnabled??!1,doNotTrack:"1"===e.doNotTrack||"yes"===e.doNotTrack}}async detectAdBlocker(){try{const e=document.createElement("div");e.className="adsbox ad-banner ad_banner textAd text_ad text-ad",e.style.cssText="position: absolute; left: -9999px; width: 1px; height: 1px;",e.innerHTML="&nbsp;",document.body.appendChild(e),await new Promise(e=>setTimeout(e,100));const t=null===e.offsetParent||0===e.offsetHeight||0===e.offsetWidth||"none"===getComputedStyle(e).display||"hidden"===getComputedStyle(e).visibility;document.body.removeChild(e);try{await fetch("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",{method:"HEAD",mode:"no-cors"});return t}catch{return!0}}catch{return!1}}async detectIncognito(){if("storage"in navigator&&"estimate"in navigator.storage)try{const e=await navigator.storage.estimate();if(e.quota&&e.quota<136314880)return!0}catch{}try{const e=indexedDB.open("test-private-mode");return new Promise(t=>{e.onerror=()=>t(!0),e.onsuccess=()=>{e.result.close(),indexedDB.deleteDatabase("test-private-mode"),t(!1)},setTimeout(()=>t(!1),500)})}catch{return!0}}generateHash(e){return h(e)}generateVisitorId(e){const t=JSON.stringify({canvas:e.canvas.hash,webgl:e.webgl.hash,audio:e.audio.hash,fonts:e.fonts.sort().join(","),hardware:e.hardware,screen:e.screen,browser:{...e.browser,languages:e.browser.languages.sort().join(",")}});return`${h(t,0)}${h(t,1)}${h(t,2)}${h(t,3)}`}calculateConfidence(e){let t=0,r=0;return r+=.2,e.canvas.hash&&(t+=.2),r+=.2,e.webgl.hash&&e.webgl.renderer?t+=.2:e.webgl.hash&&(t+=.1),r+=.15,e.audio.hash&&(t+=.15),r+=.15,e.fonts.length>10?t+=.15:e.fonts.length>5?t+=.1:e.fonts.length>0&&(t+=.05),r+=.1,e.hardware.concurrency>0&&e.hardware.platform?t+=.1:e.hardware.platform&&(t+=.05),r+=.1,e.screen.width>0&&e.screen.height>0&&(t+=.1),r+=.1,e.browser.timezone&&e.browser.language?t+=.1:e.browser.language&&(t+=.05),Math.min(1,t/1)}}const k={colors:{primary:"#007bff",secondary:"#6c757d",background:"#ffffff",surface:"#f8f9fa",text:"#212529",textSecondary:"#6c757d",border:"#dee2e6",hover:"#f8f9fa",focus:"#007bff",error:"#dc3545",success:"#28a745",warning:"#ffc107"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:{small:"0.875rem",medium:"1rem",large:"1.25rem"},fontWeight:{normal:400,medium:500,semibold:600,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},borderRadius:{none:"0",small:"0.25rem",medium:"0.375rem",large:"0.5rem",full:"9999px"},shadows:{small:"0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)",medium:"0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)",large:"0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23)"},transitions:{fast:"150ms ease-in-out",normal:"250ms ease-in-out",slow:"350ms ease-in-out"},breakpoints:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},zIndex:{dropdown:1e3,modal:2e3,tooltip:3e3}},x=e=>((e,t)=>({colors:{...t.colors,...e.colors},typography:{...t.typography,...e.typography,fontSize:{...t.typography.fontSize,...e.typography?.fontSize}},spacing:{...t.spacing,...e.spacing},borderRadius:e.borderRadius??t.borderRadius,shadows:{...t.shadows,...e.shadows},transitions:{...t.transitions,...e.transitions},breakpoints:{...t.breakpoints,...e.breakpoints},zIndex:{...t.zIndex,...e.zIndex}}))(e,k),E=t.createContext(null),w=()=>{const e=t.useContext(E);if(!e){const e=new Error("useSearchContext must be used within a SearchProvider");throw u("SearchProvider: Context not available",{error:e.message}),e}return e},S=()=>{const{stateManager:e}=w(),[r,a]=t.useState(e.getState());t.useEffect(()=>e.subscribe(e=>{a(e)}),[e]);const o=t.useCallback((t,r=!0)=>{e.setQuery(t,r)},[e]),n=t.useCallback((t,r,a=!0)=>{e.addRefinement(t,r,a)},[e]),s=t.useCallback((t,r,a=!0)=>{e.removeRefinement(t,r,a)},[e]),i=t.useCallback((t=!0)=>{e.clearRefinements(t)},[e]),l=t.useCallback((t,r=!0)=>{e.setPage(t,r)},[e]),c=t.useCallback((t,r=!0)=>{e.setSortBy(t,r)},[e]),d=t.useCallback(t=>e.search(t),[e]),u=t.useCallback(()=>{e.clear()},[e]);return{query:r.query,refinements:r.refinements,currentPage:r.currentPage,itemsPerPage:r.itemsPerPage,sortBy:r.sortBy,results:r.results,loading:r.loading,error:r.error,setQuery:o,addRefinement:n,removeRefinement:s,clearRefinements:i,setPage:l,setSortBy:c,search:d,clear:u}},C=({client:e,query:r,enabled:a=!0,debounceMs:o=300,maxSuggestions:n=10})=>{const[s,i]=t.useState([]),[c,d]=t.useState(!1),[p,m]=t.useState(null),g=t.useRef(null);return t.useEffect(()=>(g.current&&clearTimeout(g.current),a&&r.trim()?(d(!0),m(null),g.current=setTimeout(async()=>{try{const t=await(e.getSuggestions?.(r,n)),a=(Array.isArray(t)?t:[]).map(e=>{const t=e.query||e.text||e,r=void 0!==e.popularity?e.popularity:void 0!==e.count?e.count:void 0;return{query:"string"==typeof t?t:String(t),count:"number"==typeof r?r:void 0,metadata:e}});i(a)}catch(e){const t=e instanceof Error?e:new Error(String(e)),r=t.message||"";404===e?.response?.status||404===e?.status||/\(404\)/.test(r)?(l("Query suggestions not enabled for this store (404)"),i([]),m(null)):(u("Error in useQuerySuggestions:",t),m(t),i([]))}finally{d(!1)}},o),()=>{g.current&&clearTimeout(g.current)}):(i([]),d(!1),void m(null))),[e,r,a,o,n]),{suggestions:s,loading:c,error:p}};function R(e){var t,r,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=R(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function I(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=R(e))&&(a&&(a+=" "),a+=t);return a}const N=100,z={small:{padding:"0.375rem 0.5rem",fontSize:"0.875rem",iconSize:14,iconPaddingLeft:"1.75rem",iconPaddingRight:"1.75rem",iconLeft:"0.5rem",iconRight:"0.5rem"},medium:{padding:"0.625rem 1rem",fontSize:"1rem",iconSize:18,iconPaddingLeft:"2.25rem",iconPaddingRight:"2.25rem",iconLeft:"0.625rem",iconRight:"0.625rem"},large:{padding:"0.875rem 1.25rem",fontSize:"1.25rem",iconSize:22,iconPaddingLeft:"2.75rem",iconPaddingRight:"2.75rem",iconLeft:"0.75rem",iconRight:"0.75rem"}},T=({size:e=18})=>t.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("circle",{cx:"11",cy:"11",r:"8"}),t.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),M=({size:e=14})=>t.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),A="seekora-stats-animate",_="seekora-stats-styles";const $=576,L=768,P=992,D=1200,F=1400;function B(){const[e,r]=t.useState("lg");return t.useEffect(()=>{const e=()=>{var e;r((e=window.innerWidth)>=F?"xxl":e>=D?"xl":e>=P?"lg":e>=L?"md":e>=$?"sm":"xs")};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}function W(){return function(e){const[r,a]=t.useState(!1);return t.useEffect(()=>{const t=window.matchMedia(e),r=()=>a(t.matches);return r(),t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e]),r}(`(max-width: ${L-1}px)`)}function q(e=4){return function(e,t=4){switch(e){case"xs":return Math.min(t,1);case"sm":return Math.min(t,2);case"md":return Math.min(t,3);case"lg":return Math.min(t,4);case"xl":return Math.min(t,5);default:return t}}(B(),e)}function H(e=32){return function(e,t=32){return e?Math.max(44,t):t}(W(),e)}function O(e=12){return function(e,t=12){switch(e){case"xs":return Math.max(4,.5*t);case"sm":return Math.max(6,.75*t);case"md":case"lg":default:return t;case"xl":case"xxl":return 1.25*t}}(B(),e)}function j(e=12){return function(e,t=12){switch(e){case"xs":return Math.max(8,.67*t);case"sm":return Math.max(10,.83*t);case"md":case"lg":default:return t;case"xl":case"xxl":return 1.33*t}}(B(),e)}const V=({value:e,onChange:r,options:a,placeholder:o="Select...",className:n,style:s,theme:i,"aria-label":l,disabled:c=!1})=>{const[d,u]=t.useState(!1),[p,m]=t.useState(-1),g=t.useRef(null),f=t.useRef(null),h=t.useId(),y=i||{},b=a.find(t=>t.value===e),v=b?.label??o;t.useEffect(()=>{if(!d)return;const e=e=>{g.current&&!g.current.contains(e.target)&&(u(!1),m(-1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[d]),t.useEffect(()=>{if(!d||p<0||!f.current)return;const e=f.current.children[p];e?.scrollIntoView?.({block:"nearest"})},[p,d]);const k=t.useCallback(()=>{c||u(t=>{if(!t){const t=a.findIndex(t=>t.value===e);m(t>=0?t:0)}return!t})},[c,a,e]),x=t.useCallback(e=>{e.disabled||(r(e.value),u(!1),m(-1))},[r]),E=(e,t)=>{let r=e;for(let e=0;e<a.length;e++)if(r+=t,r<0&&(r=a.length-1),r>=a.length&&(r=0),!a[r].disabled)return r;return e},w=t.useCallback(e=>{if(!c)if(d)switch(e.key){case"ArrowDown":e.preventDefault(),m(e=>E(e,1));break;case"ArrowUp":e.preventDefault(),m(e=>E(e,-1));break;case"Enter":case" ":e.preventDefault(),p>=0&&!a[p].disabled&&x(a[p]);break;case"Escape":e.preventDefault(),u(!1),m(-1);break;case"Home":e.preventDefault(),m(E(-1,1));break;case"End":e.preventDefault(),m(E(a.length,-1));break;case"Tab":u(!1),m(-1)}else["ArrowDown","ArrowUp","Enter"," "].includes(e.key)&&(e.preventDefault(),k())},[c,d,p,a,k,x]),S=`seekora-select-menu-${h}`;return t.createElement("div",{ref:g,className:I("seekora-select",n),style:{position:"relative",display:"inline-block",...s},onKeyDown:w},t.createElement("button",{type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":d,"aria-controls":S,"aria-label":l,"aria-activedescendant":d&&p>=0?`${S}-opt-${p}`:void 0,disabled:c,onClick:k,className:I("seekora-select__trigger",y.trigger),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,width:"100%",padding:"8px 12px",fontSize:"var(--seekora-select-font-size, 0.875rem)",lineHeight:1.4,border:"1px solid var(--seekora-select-border, rgba(128,128,128,0.3))",borderRadius:"var(--seekora-select-radius, 6px)",backgroundColor:"var(--seekora-select-bg, #fff)",color:"var(--seekora-select-color, inherit)",cursor:c?"not-allowed":"pointer",outline:"none",textAlign:"left",fontFamily:"inherit",opacity:c?.5:1}},t.createElement("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},v),t.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0,transition:"transform 0.15s ease",transform:d?"rotate(180deg)":"rotate(0deg)"}},t.createElement("path",{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))),d&&t.createElement("div",{ref:f,id:S,role:"listbox",className:I("seekora-select__menu",y.menu),style:{position:"absolute",top:"100%",left:0,right:0,zIndex:9999,marginTop:4,padding:"4px 0",border:"1px solid var(--seekora-select-border, rgba(128,128,128,0.3))",borderRadius:"var(--seekora-select-radius, 6px)",backgroundColor:"var(--seekora-select-bg, #fff)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",maxHeight:220,overflowY:"auto"}},a.map((r,a)=>{const o=r.value===e,n=a===p;return t.createElement("div",{key:r.value,id:`${S}-opt-${a}`,role:"option","aria-selected":o,"aria-disabled":r.disabled||void 0,className:I("seekora-select__option",y.option,o&&"seekora-select__option--selected",n&&(y.optionActive||"seekora-select__option--highlighted"),r.disabled&&(y.optionDisabled||"seekora-select__option--disabled")),onMouseEnter:()=>!r.disabled&&m(a),onMouseDown:e=>{e.preventDefault(),r.disabled||x(r)},style:{padding:"6px 12px",fontSize:"var(--seekora-select-font-size, 0.875rem)",cursor:r.disabled?"not-allowed":"pointer",backgroundColor:n?"var(--seekora-select-hover-bg, #f3f4f6)":o?"var(--seekora-select-active-bg, #eff6ff)":"transparent",color:r.disabled?"rgba(128,128,128,0.5)":o?"var(--seekora-select-active-color, inherit)":"var(--seekora-select-color, inherit)",fontWeight:o?500:400,opacity:r.disabled?.5:1,transition:"background-color 0.1s ease"}},r.label)})))};const U=e=>{const{stateManager:r}=w(),[a,o]=t.useState([]),[n,s]=t.useState(null),[i,l]=t.useState(!1),[c,d]=t.useState(null),u=t.useRef(!0),p=!1!==e?.autoFetch,m=t.useRef(!1),g=t.useCallback(async()=>{m.current||l(!0),d(null);try{const{autoFetch:t,...a}=e||{},n=await r.fetchFilters(a);u.current&&(o(n?.filters||[]),m.current=!0,l(!1))}catch(e){u.current&&(d(e instanceof Error?e:new Error(String(e))),l(!1))}},[r,e?.facetBy,e?.maxFacetValues,e?.disjunctiveFacets?.join(",")]),f=t.useRef(null);t.useEffect(()=>{if(!p)return;return r.subscribe(e=>{const t=e.query;t!==f.current&&(f.current=t,g())})},[r,p,g]),t.useEffect(()=>{r.getFiltersSchema().then(e=>{u.current&&s(e)}).catch(()=>{})},[r]),t.useEffect(()=>()=>{u.current=!1},[]);return{filters:a,schema:n,loading:i,error:c,searchFacetValues:t.useCallback((e,t)=>r.searchFacetValues(e,t),[r]),refetch:t.useCallback(async()=>{await g()},[g])}},K="0 2px 4px rgba(0,0,0,0.1)",Q=({field:e,label:r,min:a,max:o,step:n=1,currentMin:s,currentMax:i,onRangeChange:l,formatValue:c=e=>e.toString(),className:d,style:u,theme:p,showValues:m=!0,syncWithState:g=!0,debounceMs:f=300})=>{const{theme:h}=w(),{refinements:y,addRefinement:b,removeRefinement:v}=S(),k=p||{},x=k.thumb||"seekora-range-slider__thumb";let E;if(g){let t,r;y.forEach(a=>{if(a.field===e){const e=a.value.match(/^>=(\d+(?:\.\d+)?)$/);e&&(t=parseFloat(e[1]));const o=a.value.match(/^<=(\d+(?:\.\d+)?)$/);o&&(r=parseFloat(o[1]))}}),E={min:t,max:r}}else E={min:void 0,max:void 0};const[C,R]=t.useState(s??E.min??a),[N,z]=t.useState(i??E.max??o),T=t.useRef(!1),M=t.useRef(null),A=t.useRef(C),_=t.useRef(N);t.useEffect(()=>{g&&!T.current&&(void 0!==E.min?R(E.min):R(a),void 0!==E.max?z(E.max):z(o))},[g,E.min,E.max,a,o]);const $=t.useCallback((t,r)=>{if(!g)return;y.forEach(t=>{t.field===e&&v(e,t.value,!1)});const n=t>a,s=r<o;n&&s?(b(e,`>=${t}`,!1),b(e,`<=${r}`,!0)):n?b(e,`>=${t}`,!0):s&&b(e,`<=${r}`,!0)},[g,e,y,b,v,a,o]),L=t.useCallback((e,t)=>{A.current=e,_.current=t,M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{$(e,t),l&&l(e,t)},f)},[$,l,f]),P=()=>{T.current=!1,M.current&&(clearTimeout(M.current),M.current=null),$(A.current,_.current),l&&l(A.current,_.current)},D=(C-a)/(o-a)*100,F=(N-a)/(o-a)*100;return t.createElement("div",{className:I(k.root,d),style:{fontFamily:"inherit",...u}},r&&t.createElement("label",{className:k.label,style:{display:"block",marginBottom:h.spacing.small,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.medium||500,color:h.colors.text}},r),t.createElement("div",{className:k.slider,style:{position:"relative",minHeight:"40px",display:"flex",alignItems:"center"}},t.createElement("div",{className:k.track,style:{position:"absolute",width:"100%",height:"4px",backgroundColor:h.colors.border,borderRadius:"2px"}}),t.createElement("div",{className:k.trackFilled,style:{position:"absolute",left:`${D}%`,width:F-D+"%",height:"4px",backgroundColor:h.colors.primary,borderRadius:"2px"}}),t.createElement("input",{type:"range",min:a,max:o,step:n,value:C,onChange:e=>{const t=Math.min(Number(e.target.value),N-n);R(t),T.current=!0,L(t,N)},onMouseUp:P,onTouchEnd:P,onKeyDown:e=>{let t=null;"Home"===e.key?(e.preventDefault(),t=a):"End"===e.key?(e.preventDefault(),t=N-n):!e.shiftKey||"ArrowLeft"!==e.key&&"ArrowDown"!==e.key?!e.shiftKey||"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),t=Math.min(N-n,C+10*n)):(e.preventDefault(),t=Math.max(a,C-10*n)),null!==t&&(R(t),L(t,N))},tabIndex:0,"aria-valuenow":C,"aria-valuemin":a,"aria-valuemax":o,className:x,style:{position:"absolute",width:"100%",height:"4px",background:"transparent",WebkitAppearance:"none",appearance:"none",cursor:"pointer",pointerEvents:"none"},"aria-label":`Minimum ${r||e}`}),t.createElement("input",{type:"range",min:a,max:o,step:n,value:N,onChange:e=>{const t=Math.max(Number(e.target.value),C+n);z(t),T.current=!0,L(C,t)},onMouseUp:P,onTouchEnd:P,onKeyDown:e=>{let t=null;"Home"===e.key?(e.preventDefault(),t=C+n):"End"===e.key?(e.preventDefault(),t=o):!e.shiftKey||"ArrowLeft"!==e.key&&"ArrowDown"!==e.key?!e.shiftKey||"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),t=Math.min(o,N+10*n)):(e.preventDefault(),t=Math.max(C+n,N-10*n)),null!==t&&(z(t),L(C,t))},tabIndex:0,"aria-valuenow":N,"aria-valuemin":a,"aria-valuemax":o,className:x,style:{position:"absolute",width:"100%",height:"4px",background:"transparent",WebkitAppearance:"none",appearance:"none",cursor:"pointer",pointerEvents:"none"},"aria-label":`Maximum ${r||e}`})),m&&t.createElement("div",{className:k.values,style:{display:"flex",justifyContent:"space-between",marginTop:h.spacing.small,fontSize:h.typography.fontSize.small,color:h.colors.textSecondary}},t.createElement("span",{className:k.value},c(C)),t.createElement("span",{className:k.value},c(N))),t.createElement("style",null,`\n .${x}::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: ${h.colors.primary};\n border-radius: 50%;\n cursor: pointer;\n pointer-events: all;\n box-shadow: ${K};\n }\n .${x}::-moz-range-thumb {\n width: 20px;\n height: 20px;\n background: ${h.colors.primary};\n border-radius: 50%;\n cursor: pointer;\n pointer-events: all;\n border: none;\n box-shadow: ${K};\n }\n `))};const G=({expanded:e,color:r="currentColor",size:a=16})=>t.createElement("svg",{width:a,height:a,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:"transform 200ms ease",flexShrink:0},"aria-hidden":"true"},t.createElement("path",{d:"M4 6L8 10L12 6",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),X=({size:e=16})=>t.createElement("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},t.createElement("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),Y={"--seekora-facet-bg":"transparent","--seekora-facet-border":"#dee2e6","--seekora-facet-active-bg":"rgba(0, 0, 0, 0.05)","--seekora-facet-swatch-size":"32px","--seekora-facet-count-bg":"#e9ecef","--seekora-facet-count-color":"#495057","--seekora-primary":"#3b82f6","--seekora-primary-text":"#ffffff"},Z=150,J="150ms ease-in-out",ee="200ms ease-in-out";const te=({title:e,items:r,renderItem:a,onItemClick:o,className:n,style:s,theme:i,layout:l="horizontal",currencySymbol:c="$"})=>{const{theme:d}=w(),u=i||{},p=()=>{switch(l){case"horizontal":return{flexShrink:0,width:"150px",scrollSnapAlign:"start"};case"grid":default:return{};case"list":return{display:"flex",gap:d.spacing.medium,padding:d.spacing.small,borderBottom:`1px solid ${d.colors.border}`}}};return t.createElement("div",{className:I(u.root,n),style:s},e&&t.createElement("h3",{className:u.title,style:{margin:`0 0 ${d.spacing.medium} 0`,fontSize:d.typography.fontSize.large,fontWeight:d.typography.fontWeight?.semibold||600,color:d.colors.text}},e),t.createElement("div",{className:u.list,style:(()=>{switch(l){case"horizontal":return{display:"flex",gap:d.spacing.medium,overflowX:"auto",scrollSnapType:"x mandatory",paddingBottom:d.spacing.small};case"grid":return{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:d.spacing.medium};case"list":return{display:"flex",flexDirection:"column",gap:d.spacing.small};default:return{}}})()},r.map((e,r)=>t.createElement("div",{key:e.id||r,className:u.item,onClick:()=>o?.(e,r),style:{...p(),cursor:o?"pointer":"default"}},a?a(e,r):t.createElement(re,{item:e,theme:u,currencySymbol:c,layout:l})))))},re=({item:e,theme:r,currencySymbol:a,layout:o})=>{const{theme:n}=w(),s=e.image||e.imageUrl||"",i=e.title||e.name||"",l=e.price,c="list"===o?"60px":"100%";return t.createElement(t.Fragment,null,s&&t.createElement("img",{src:s,alt:i,className:r.image,style:{width:c,height:"list"===o?"60px":"120px",objectFit:"cover",borderRadius:"string"==typeof n.borderRadius?n.borderRadius:n.borderRadius.small}}),t.createElement("div",{className:r.content,style:{flex:"list"===o?1:void 0}},t.createElement("div",{className:r.name,style:{marginTop:"list"===o?0:n.spacing.small,fontSize:n.typography.fontSize.small,fontWeight:n.typography.fontWeight?.medium||500,color:n.colors.text,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},i),void 0!==l&&t.createElement("div",{className:r.price,style:{marginTop:n.spacing.small,fontSize:n.typography.fontSize.small,fontWeight:n.typography.fontWeight?.bold||700,color:n.colors.primary}},a,"number"==typeof l?l.toFixed(2):l)))},ae="seekora_recent_searches",oe=10;function ne(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,JSON.stringify(t))}catch(e){d("Failed to save recent searches to localStorage",{error:e})}}function se(e){const t=e.query||e.text||String(e),r=e._highlightResult?.query?.value;return{query:t,popularity:e.popularity,count:e.instant_search?.exact_nb_hits??e.popularity??e.count,objectID:e.objectID,highlightedQuery:r?ie(r):void 0,categories:e.categories?.map(e=>({value:e.value||e.name,count:e.count,path:e.path})),facets:e.instant_search?.facets||e.facets,metadata:e}}function ie(e){return e.replace(/__ais-highlight__/g,"<mark>").replace(/__\/ais-highlight__/g,"</mark>")}function le(e){const t=e.metadata||{};return{id:e.id||e.objectID,objectID:e.objectID||e.id,title:e.title||e.name||e.productName||t.name||t.productName||"",name:e.name||e.title||t.name||t.productName||"",image:e.image||e.imageUrl||t.image||t.image_url||t.images?.[0]||"",price:e.price??e.sellPrice??t.sellPrice??t.price,currency:e.currency||t.currency||"",url:e.url||e.productId||t.url||t.productId||"",clicks:e.clicks,conversions:e.conversions,revenue:e.revenue,trend_score:e.trend_score,metadata:e.metadata||e}}function ce(e){return{id:e.id,label:e.label,filter:e.filter,products:e.products?.map(le)||[],nb_hits:e.nb_hits,processing_time_ms:e.processing_time_ms}}function de(e){const{client:r,query:a,enabled:o=!0,prefetch:n=!1,debounceMs:s=200,maxSuggestions:i=10,minQueryLength:c=1,includeDropdownRecommendations:d=!1,includeDropdownProductList:p=!0,includeFilteredTabs:m=!0,includeCategories:g=!0,includeFacets:f=!0,maxCategories:h=3,maxFacets:y=5,filteredTabs:b,minPopularity:v,timeRange:k,disableTypoTolerance:x,analyticsTags:E,enableRecentSearches:w=!0,maxRecentSearches:S=oe,recentSearchesKey:C=ae,onSuggestionsLoaded:R,onError:I}=e,[N,z]=t.useState([]),[T,M]=t.useState(!1),[A,_]=t.useState(null),[$,L]=t.useState(null),[P,D]=t.useState([]),[F,B]=t.useState(null),[W,q]=t.useState(0),[H,O]=t.useState(0),[j,V]=t.useState(0),[U,K]=t.useState(""),Q=t.useRef(null),G=t.useRef(null),X=t.useRef(!0);t.useEffect(()=>{if(w){const e=function(e){if("undefined"==typeof window)return[];try{const t=localStorage.getItem(e);return t?JSON.parse(t):[]}catch{return[]}}(C);D(e.slice(0,S))}return()=>{X.current=!1}},[w,C,S]);const Y=t.useCallback(async e=>{if(r){if(!e.trim()&&c>0)return z([]),void L(null);G.current&&G.current.abort(),G.current=new AbortController,M(!0),_(null);try{const t=await(r.getSuggestions?.(e,{hitsPerPage:i,include_dropdown_recommendations:d||b&&b.length>0,include_dropdown_product_list:p,include_filtered_tabs:m,include_categories:g,include_facets:f,max_categories:h,max_facets:y,filtered_tabs:b,min_popularity:v,time_range:k,disable_typo_tolerance:x,analytics_tags:E,returnFullResponse:!0}));if(!X.current)return;const a=(t.suggestions||[]).map(se);z(a);const o=t.extensions||{},n=t.results,s=Array.isArray(n?.[1]?.hits)?n[1].hits:[],c=s.length>0?s.map(e=>le(e)):[],u={trending_searches:Array.isArray(o.trending_searches)?o.trending_searches:[],top_searches:Array.isArray(o.top_searches)?o.top_searches:[],related_searches:Array.isArray(o.related_searches)?o.related_searches:[],trending_products:Array.isArray(o.trending_products)?o.trending_products.map(le):[],item_recommendations:Array.isArray(o.item_recommendations)?o.item_recommendations.map(le):[],product_hits:c.length>0?c:void 0,popular_brands:Array.isArray(o.popular_brands)?o.popular_brands:[],filtered_tabs:Array.isArray(o.filtered_tabs)?o.filtered_tabs.map(ce):[],processing_time_ms:"number"==typeof o.processing_time_ms?o.processing_time_ms:void 0,cached_at:"string"==typeof o.cached_at?o.cached_at:void 0};L(u);const w=t.raw,S=w?.results,C=S?.[0]??w??{},I=e=>"number"!=typeof e||Number.isNaN(e)?0:e,N=e=>"string"==typeof e?e:"";B("number"==typeof C.processingTimeMS?C.processingTimeMS:null),q(I(C.nbHits)||a.length),O(I(C.page)||0),V(I(C.nbPages)||1),K(N(C.query)||e),R&&R({suggestions:a,nbHits:I(C.nbHits)||a.length,page:I(C.page)||0,nbPages:I(C.nbPages)||1,hitsPerPage:I(C.hitsPerPage)||i,processingTimeMS:"number"==typeof C.processingTimeMS?C.processingTimeMS:void 0,query:N(C.query)||e,dropdownRecommendations:u,results:Array.isArray(t.results)?t.results:void 0,extensions:o}),l("Query suggestions loaded",{query:e,suggestionsCount:a.length,hasRecommendations:Object.keys(u).some(e=>Array.isArray(u[e])&&u[e].length>0)})}catch(t){if(!X.current)return;const r=t instanceof Error?t:new Error(String(t));if("AbortError"===r.name)return;const a=r.message||"";404===t?.response?.status||404===t?.status||/\(404\)/.test(a)?(l("Query suggestions not enabled for this store (404)"),z([]),L(null),_(null)):(u("Failed to fetch query suggestions",{query:e,error:r.message}),_(r),z([]),L(null),I&&I(r))}finally{X.current&&M(!1)}}},[r,c,i,d,p,m,g,f,h,y,b,v,k,x,E,R,I]),Z=t.useRef(!1);t.useEffect(()=>{n&&!Z.current&&(c>0||r?.getSuggestions&&(Z.current=!0,Y("")))},[n,r,c,Y]),t.useEffect(()=>(Q.current&&clearTimeout(Q.current),!o||a.length<c?n&&Z.current&&""===a?(M(!1),void _(null)):(z([]),L(null),M(!1),void _(null)):n&&Z.current&&""===a?void 0:(M(!0),Q.current=setTimeout(()=>{Y(a)},s),()=>{Q.current&&clearTimeout(Q.current)})),[a,o,n,c,s,Y]);const J=t.useCallback((e,t)=>{w&&e.trim()&&D(r=>{const a=r.filter(t=>t.query.toLowerCase()!==e.toLowerCase()),o=[{query:e.trim(),timestamp:Date.now(),resultsCount:t},...a].slice(0,S);return ne(C,o),o})},[w,S,C]),ee=t.useCallback(e=>{D(t=>{const r=t.filter(t=>t.query!==e);return ne(C,r),r})},[C]),te=t.useCallback(()=>{D([]),ne(C,[])},[C]),re=t.useCallback(async()=>{a.length>=c&&await Y(a)},[a,c,Y]),ie=$?.trending_searches||[],de=$?.top_searches||[],ue=$?.related_searches||[],pe=$?.popular_brands||[],me=$?.filtered_tabs||[],ge=t.useMemo(()=>{const e=$?.trending_products;if(e&&e.length>0)return e;const t=$?.item_recommendations;if(t&&t.length>0)return t;const r=$?.filtered_tabs?.[0];return r?.products&&r.products.length>0?r.products:$?.product_hits??[]},[$?.trending_products,$?.item_recommendations,$?.filtered_tabs,$?.product_hits]),fe=t.useMemo(()=>N.length>0||P.length>0||ie.length>0||de.length>0||ue.length>0||pe.length>0||me.length>0||ge.length>0,[N,P,ie,de,ue,pe,me,ge]),he=t.useCallback(()=>{const e=[];let t=0;return 0===a.length&&P.length>0&&P.forEach(r=>{e.push({type:"recent",index:t++,data:r})}),N.forEach(r=>{e.push({type:"suggestion",index:t++,data:r})}),ie.forEach(r=>{e.push({type:"trending",index:t++,data:r})}),ge.forEach(r=>{e.push({type:"product",index:t++,data:r})}),pe.forEach(r=>{e.push({type:"brand",index:t++,data:r})}),e},[a,P,N,ie,ge,pe]);return{suggestions:N,loading:T,error:A,dropdownRecommendations:$,trendingSearches:ie,topSearches:de,relatedSearches:ue,popularBrands:pe,filteredTabs:me,trendingProducts:ge,recentSearches:P,processingTimeMs:F,totalHits:W,currentPage:H,totalPages:j,originalQuery:U,addRecentSearch:J,removeRecentSearch:ee,clearRecentSearches:te,refetch:re,hasContent:fe,getAllNavigableItems:he}}const ue="150ms ease-in-out",pe=4,me={container:{backgroundColor:"var(--seekora-bg-surface, transparent)",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`var(--seekora-border-radius, ${8}px)`,boxShadow:"var(--seekora-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05))",maxHeight:"400px",overflowY:"auto",overflowX:"hidden"},sectionTitle:{fontSize:"12px",fontWeight:600,color:"var(--seekora-text-secondary, inherit)",textTransform:"uppercase",letterSpacing:"0.05em",padding:"8px 16px 4px",margin:0},suggestionItem:{display:"flex",alignItems:"center",padding:"10px 16px",cursor:"pointer",transition:`background-color ${ue}`,fontSize:"14px",color:"var(--seekora-text-primary, inherit)",gap:"12px"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, #f3f4f6)"},suggestionQuery:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},suggestionCount:{fontSize:"12px",color:"var(--seekora-text-secondary, #9ca3af)",marginLeft:"auto",flexShrink:0},highlight:{fontWeight:600,color:"var(--seekora-text-primary, inherit)",backgroundColor:"var(--seekora-highlight-bg, #fef3c7)",padding:"0 2px",borderRadius:pe/2+"px"},recentIcon:{width:"16px",height:"16px",color:"var(--seekora-text-secondary, #9ca3af)",flexShrink:0},removeButton:{padding:"4px",borderRadius:`${pe}px`,border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-secondary, #9ca3af)",opacity:0,transition:`opacity ${ue}, color ${ue}`},removeButtonVisible:{opacity:1},emptyState:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px 16px",color:"var(--seekora-text-secondary, inherit)",fontSize:"14px",textAlign:"center"},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, rgba(128,128,128,0.2))",margin:"4px 0"},footer:{borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",padding:"8px 16px",fontSize:"12px",color:"var(--seekora-text-secondary, inherit)",display:"flex",alignItems:"center",justifyContent:"space-between"},keyboardHint:{display:"flex",alignItems:"center",gap:"8px",fontSize:"11px"},keyboardKey:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"18px",padding:"0 4px",borderRadius:pe-1+"px",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",fontSize:"10px",fontWeight:500}},ge=({className:e,style:r})=>t.createElement("svg",{className:e,style:r,viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),fe=({className:e,style:r})=>t.createElement("svg",{className:e,style:r,viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),he=({className:e,style:r})=>t.createElement("svg",{className:e,style:r,viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})),ye=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,maxSuggestions:n=8,minQueryLength:s=1,debounceMs:i=200,showRecentSearches:l=!0,maxRecentSearches:c=5,showCounts:d=!0,showEmptyState:u=!0,highlight:p={enabled:!0,preTag:"<mark>",postTag:"</mark>"},keyboardNav:m={enabled:!0},animation:g={enabled:!0,duration:150,entrance:"fade"},classNames:f={},style:h,renderSuggestion:y,renderRecentSearch:b,renderEmpty:v,footer:k,position:x="absolute",width:E="100%",zIndex:S=1e3,closeOnClickOutside:C=!0,closeOnEscape:R=!0,ariaLabel:N="Search suggestions",onSuggestionSelect:z,onRecentSearchClick:T,onRecentSearchRemove:M,onOpen:A,onClose:_,onNavigate:$}=e,{client:L,theme:P}=w(),D=t.useRef(null),[F,B]=t.useState(-1),[W,q]=t.useState(!1),{suggestions:H,loading:O,error:j,recentSearches:V,addRecentSearch:U,removeRecentSearch:K,hasContent:Q}=de({client:L,query:a,enabled:o&&a.length>=s,debounceMs:i,maxSuggestions:n,minQueryLength:s,enableRecentSearches:l,maxRecentSearches:c}),G=t.useMemo(()=>{const e=[];return l&&0===a.length&&V.length>0&&V.slice(0,c).forEach(t=>{e.push({type:"recent",data:t})}),H.forEach(t=>{e.push({type:"suggestion",data:t})}),e},[H,V,a,l,c]);t.useEffect(()=>{if(o&&(Q||O))q(!0),A?.();else{if(g.enabled){const e=setTimeout(()=>q(!1),g.duration);return()=>clearTimeout(e)}q(!1),_?.()}},[o,Q,O,g.enabled,g.duration,A,_]),t.useEffect(()=>{B(-1)},[G.length]);const X=t.useCallback(()=>{m.enabled&&B(e=>{const t=e<G.length-1?e+1:0;return $?.("down",t),t})},[m.enabled,G.length,$]),Y=t.useCallback(()=>{m.enabled&&B(e=>{const t=e>0?e-1:G.length-1;return $?.("up",t),t})},[m.enabled,G.length,$]),Z=t.useCallback(()=>{if(F<0||F>=G.length)return;const e=G[F];if("recent"===e.type){const t=e.data;T?.(t)}else{const t=e.data;z?.(t),U(t.query,t.count)}},[F,G,T,z,U]),J=t.useCallback(()=>{B(-1)},[]);t.useImperativeHandle(r,()=>({selectActive:Z,navigateNext:X,navigatePrevious:Y,resetSelection:J,getActiveIndex:()=>F,getTotalItems:()=>G.length}),[Z,X,Y,J,F,G.length]),t.useEffect(()=>{if(!C||!o)return;const e=e=>{D.current&&!D.current.contains(e.target)&&_?.()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[C,o,_]);const ee=t.useCallback((e,r)=>{if(!p.enabled||!r)return e;return e.split(new RegExp(`(${r})`,"gi")).map((e,a)=>e.toLowerCase()===r.toLowerCase()?t.createElement("mark",{key:a,className:f.suggestionItemHighlight,style:me.highlight},e):e)},[p.enabled,f.suggestionItemHighlight]),te=t.useCallback(e=>e.highlightedQuery&&p.enabled?t.createElement("span",{dangerouslySetInnerHTML:{__html:e.highlightedQuery},style:{display:"inline"}}):ee(e.query,a),[p.enabled,ee,a]);if(!W&&!o)return null;const re=l&&0===a.length&&V.length>0,ae=H.length>0,oe=u&&!O&&!re&&!ae&&a.length>=s,ne=g.enabled?{opacity:o?1:0,transform:o?"translateY(0)":"translateY(-8px)",transition:`opacity ${g.duration}ms ease, transform ${g.duration}ms ease`}:{};return t.createElement("div",{ref:D,role:"listbox","aria-label":N,"aria-expanded":o,className:I("seekora-suggestions-dropdown",f.root,f.container),style:{position:x,width:E,zIndex:S,...me.container,...ne,...h}},re&&t.createElement("div",{className:I("seekora-suggestions-section",f.section,f.recentSearches)},t.createElement("div",{className:f.sectionTitle,style:me.sectionTitle},"Recent Searches"),V.slice(0,c).map((e,r)=>{const a=F===r;return t.createElement("div",{key:`recent-${e.query}-${r}`,role:"option","aria-selected":a,className:I(f.recentItem,a&&f.suggestionItemActive),onClick:()=>{T?.(e)},onMouseEnter:()=>B(r)},((e,r,a)=>b?b(e,r,a):t.createElement("div",{style:{...me.suggestionItem,...a?me.suggestionItemActive:{}}},t.createElement(fe,{style:me.recentIcon}),t.createElement("span",{style:me.suggestionQuery},e.query),t.createElement("button",{type:"button",onClick:t=>{t.stopPropagation(),K(e.query),M?.(e)},style:{...me.removeButton,...a?me.removeButtonVisible:{}},"aria-label":`Remove ${e.query} from recent searches`},t.createElement(he,null))))(e,r,a))})),re&&ae&&t.createElement("div",{style:me.divider}),ae&&t.createElement("div",{className:I("seekora-suggestions-section",f.section,f.suggestionsList)},a.length>0&&t.createElement("div",{className:f.sectionTitle,style:me.sectionTitle},"Suggestions"),H.map((e,r)=>{const o=re?V.length+r:r,n=F===o;return t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,className:I(f.suggestionItem,n&&f.suggestionItemActive),onClick:()=>{z?.(e),U(e.query,e.count)},onMouseEnter:()=>B(o)},((e,r,o)=>y?y(e,r,o,e=>ee(e,a)):t.createElement("div",{style:{...me.suggestionItem,...o?me.suggestionItemActive:{}}},t.createElement(ge,{style:me.recentIcon}),t.createElement("span",{style:me.suggestionQuery},te(e)),d&&void 0!==e.count&&t.createElement("span",{style:me.suggestionCount},e.count.toLocaleString())))(e,r,n))})),oe&&t.createElement("div",{className:f.emptyState,style:me.emptyState},v?v():t.createElement(t.Fragment,null,t.createElement(ge,{style:{width:24,height:24,marginBottom:8,opacity:.5}}),t.createElement("span",null,'No suggestions found for "',a,'"'))),k||m.enabled&&G.length>0?t.createElement("div",{className:f.footer,style:me.footer},k||t.createElement("div",{style:me.keyboardHint},t.createElement("span",{style:me.keyboardKey},"↑"),t.createElement("span",{style:me.keyboardKey},"↓"),t.createElement("span",null,"to navigate"),t.createElement("span",{style:me.keyboardKey},"↵"),t.createElement("span",null,"to select"),t.createElement("span",{style:me.keyboardKey},"esc"),t.createElement("span",null,"to close"))):null,t.createElement("style",null,'\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n .seekora-suggestions-dropdown mark {\n background-color: var(--seekora-highlight-bg, #fef3c7);\n font-weight: 600;\n padding: 0 2px;\n border-radius: 2px;\n }\n .seekora-suggestions-dropdown [role="option"]:hover button {\n opacity: 1;\n }\n '))}),be="150ms ease-in-out",ve=8,ke=9999,xe=[{id:"recent",title:"Recent Searches",maxItems:5,enabled:!0,order:1},{id:"suggestions",title:"Suggestions",maxItems:8,enabled:!0,order:2},{id:"trending",title:"Trending",maxItems:5,enabled:!0,order:3},{id:"categories",title:"Categories",maxItems:6,enabled:!1,order:4}],Ee={container:{backgroundColor:"var(--seekora-bg-surface, transparent)",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`var(--seekora-border-radius-lg, ${1.5*ve}px)`,boxShadow:"var(--seekora-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04))",overflow:"hidden"},header:{padding:"12px 16px",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))"},content:{overflowY:"auto",overflowX:"hidden"},sectionHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px 4px"},sectionTitle:{fontSize:"11px",fontWeight:600,color:"var(--seekora-text-tertiary, #9ca3af)",textTransform:"uppercase",letterSpacing:"0.05em",margin:0},sectionAction:{fontSize:"12px",color:"var(--seekora-primary, #3b82f6)",cursor:"pointer",textDecoration:"none",fontWeight:500},item:{display:"flex",alignItems:"flex-start",padding:"10px 16px",cursor:"pointer",transition:`background-color ${be}`,gap:"12px"},itemActive:{backgroundColor:"var(--seekora-bg-hover, #f3f4f6)"},itemIcon:{width:"18px",height:"18px",color:"var(--seekora-text-secondary, #6b7280)",flexShrink:0,marginTop:"2px"},itemContent:{flex:1,minWidth:0},itemQuery:{fontSize:"14px",color:"var(--seekora-text-primary, inherit)",fontWeight:500,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},itemCount:{fontSize:"12px",color:"var(--seekora-text-tertiary, #9ca3af)",flexShrink:0},categoriesContainer:{display:"flex",flexWrap:"wrap",gap:"6px",marginTop:"6px"},categoryPill:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"3px 8px",fontSize:"11px",fontWeight:500,color:"var(--seekora-text-secondary, inherit)",backgroundColor:"var(--seekora-bg-tertiary, rgba(255, 255, 255, 0.1))",borderRadius:1.5*ve+"px",cursor:"pointer",transition:`all ${be}`},categoryPillHover:{backgroundColor:"var(--seekora-primary-light, #dbeafe)",color:"var(--seekora-primary, #3b82f6)"},categoryCount:{color:"var(--seekora-text-tertiary, #9ca3af)"},trendingList:{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 16px"},trendingChip:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`${ke}px`,cursor:"pointer",transition:`all ${be}`},trendingChipHover:{borderColor:"var(--seekora-primary, #3b82f6)",backgroundColor:"var(--seekora-primary-light, #eff6ff)"},trendingIcon:{width:"14px",height:"14px",color:"var(--seekora-success, #10b981)"},trendingRank:{width:"18px",height:"18px",borderRadius:`${ke}px`,backgroundColor:"var(--seekora-primary, #3b82f6)",color:"white",fontSize:"10px",fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center"},removeButton:{padding:"4px",marginLeft:"auto",borderRadius:`${4}px`,border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-tertiary, #9ca3af)",opacity:0,transition:`opacity ${be}`},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, rgba(128,128,128,0.2))",margin:"4px 16px"},footer:{padding:"12px 16px",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",fontSize:"12px",color:"var(--seekora-text-secondary, inherit)"},emptyState:{padding:"32px 16px",textAlign:"center",color:"var(--seekora-text-secondary, inherit)"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fef9c3)",fontWeight:600,borderRadius:"2px",padding:"0 1px"}},we=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:Ee.itemIcon},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),Se=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:Ee.itemIcon},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),Ce=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:Ee.trendingIcon},t.createElement("path",{fillRule:"evenodd",d:"M12 7a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0V8.414l-4.293 4.293a1 1 0 01-1.414 0L8 10.414l-4.293 4.293a1 1 0 01-1.414-1.414l5-5a1 1 0 011.414 0L11 10.586 14.586 7H12z",clipRule:"evenodd"})),Re=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{width:14,height:14}},t.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})),Ie=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,sections:n=xe,maxSuggestionsPerSection:s=8,minQueryLength:i=0,debounceMs:l=200,includeDropdownRecommendations:c=!0,includeDropdownProductList:d=!0,includeFilteredTabs:u=!0,includeCategories:p=!0,maxCategories:m=3,showCounts:g=!0,showCategoryCounts:f=!0,showSectionHeaders:h=!0,classNames:y={},style:b,renderSuggestion:v,renderCategory:k,renderTrendingItem:x,renderRecentItem:E,header:S,footer:C,width:R="100%",maxHeight:N="480px",zIndex:z=1e3,ariaLabel:T="Search suggestions",analyticsTags:M,onSuggestionSelect:A,onCategoryClick:_,onRecentSearchClick:$,onRecentSearchRemove:L,onViewAllClick:P,onOpen:D,onClose:F}=e,{client:B}=w(),W=t.useRef(null),[q,H]=t.useState(-1),[O,j]=t.useState(null),{suggestions:V,loading:U,trendingSearches:K,topSearches:Q,recentSearches:G,addRecentSearch:X,removeRecentSearch:Y,hasContent:Z}=de({client:B,query:a,enabled:o,debounceMs:l,maxSuggestions:s,minQueryLength:i,includeDropdownRecommendations:c,includeDropdownProductList:d,includeFilteredTabs:u,includeCategories:p,maxCategories:m,analyticsTags:M,enableRecentSearches:!0}),J=t.useMemo(()=>n.filter(e=>!1!==e.enabled).sort((e,t)=>(e.order||0)-(t.order||0)),[n]),ee=e=>J.find(t=>t.id===e),te=t.useMemo(()=>{const e=[];return J.forEach((t,r)=>{switch(t.id){case"recent":0===a.length&&G.slice(0,t.maxItems||5).forEach(t=>{e.push({type:"recent",data:t,sectionIndex:r})});break;case"suggestions":V.slice(0,t.maxItems||s).forEach(t=>{e.push({type:"suggestion",data:t,sectionIndex:r})});break;case"trending":0===a.length&&(K.length>0?K:Q).slice(0,t.maxItems||5).forEach(t=>{e.push({type:"trending",data:t,sectionIndex:r})})}}),e},[J,a,G,V,K,Q,s]),re=t.useCallback(()=>{H(e=>e<te.length-1?e+1:0)},[te.length]),ae=t.useCallback(()=>{H(e=>e>0?e-1:te.length-1)},[te.length]),oe=t.useCallback(()=>{if(q<0||q>=te.length)return;const e=te[q];switch(e.type){case"recent":$?.(e.data);break;case"suggestion":A?.(e.data),X(e.data.query,e.data.count);break;case"trending":A?.({query:e.data.query,count:e.data.count}),X(e.data.query)}},[q,te,$,A,X]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>q,setActiveIndex:H,selectActive:oe,navigateNext:re,navigatePrevious:ae,getTotalItems:()=>te.length}),[q,oe,re,ae,te.length]);const ne=()=>{const e=ee("recent");return!e||a.length>0||0===G.length?null:t.createElement("div",{className:I("seekora-section","seekora-section-recent",y.section)},h&&t.createElement("div",{style:Ee.sectionHeader},t.createElement("h3",{style:Ee.sectionTitle},e.title||"Recent Searches"),G.length>(e.maxItems||5)&&t.createElement("button",{style:Ee.sectionAction,onClick:()=>P?.("recent")},"View all")),G.slice(0,e.maxItems||5).map((e,r)=>{const a=((e,t)=>{let r=0;for(const a of te){if(J[a.sectionIndex].id===e)return r+t;a.sectionIndex<J.findIndex(t=>t.id===e)&&r++}return r+t})("recent",r),o=q===a;return t.createElement("div",{key:`recent-${e.query}`,role:"option","aria-selected":o,style:{...Ee.item,...o?Ee.itemActive:{}},onClick:()=>{$?.(e)},onMouseEnter:()=>H(a),className:I(y.recentItem,o&&y.suggestionItemActive)},E?E(e):t.createElement(t.Fragment,null,t.createElement(Se,null),t.createElement("div",{style:Ee.itemContent},t.createElement("p",{style:Ee.itemQuery},e.query)),t.createElement("button",{style:Ee.removeButton,onClick:t=>{t.stopPropagation(),Y(e.query),L?.(e)},"aria-label":"Remove"},t.createElement(Re,null))))}))},se=()=>{const e=ee("suggestions");return e&&0!==V.length?t.createElement("div",{className:I("seekora-section","seekora-section-suggestions",y.section)},h&&a.length>0&&t.createElement("div",{style:Ee.sectionHeader},t.createElement("h3",{style:Ee.sectionTitle},e.title||"Suggestions")),V.slice(0,e.maxItems||s).map((e,r)=>{const o=te.findIndex((e,t)=>"suggestion"===e.type&&te.slice(0,t).filter(e=>"suggestion"===e.type).length===r),n=q===o;return t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,style:{...Ee.item,...n?Ee.itemActive:{}},onClick:()=>{A?.(e),X(e.query,e.count)},onMouseEnter:()=>H(o),className:I(y.suggestionItem,n&&y.suggestionItemActive)},v?v(e,n):t.createElement(t.Fragment,null,t.createElement(we,null),t.createElement("div",{style:Ee.itemContent},t.createElement("p",{style:Ee.itemQuery},(s=e.query,a?s.split(new RegExp(`(${a})`,"gi")).map((e,r)=>e.toLowerCase()===a.toLowerCase()?t.createElement("span",{key:r,style:Ee.highlight},e):e):s)),p&&e.categories&&e.categories.length>0&&t.createElement("div",{style:Ee.categoriesContainer},e.categories.slice(0,m).map((e,r)=>k?k(e):t.createElement("span",{key:`cat-${r}`,style:{...Ee.categoryPill,...O===e.value?Ee.categoryPillHover:{}},onClick:t=>{t.stopPropagation(),_?.(e)},onMouseEnter:()=>j(e.value),onMouseLeave:()=>j(null)},e.value,f&&void 0!==e.count&&t.createElement("span",{style:Ee.categoryCount},"(",e.count,")"))))),g&&void 0!==e.count&&t.createElement("span",{style:Ee.itemCount},e.count.toLocaleString())));var s})):null};if(!o)return null;return Z||U||0===a.length?t.createElement("div",{ref:W,role:"listbox","aria-label":T,className:I("seekora-rich-suggestions",y.root,y.container),style:{position:"absolute",width:R,zIndex:z,...Ee.container,...b}},S&&t.createElement("div",{style:Ee.header},S),t.createElement("div",{style:{...Ee.content,maxHeight:N}},J.map((e,r)=>{let o=null;switch(e.id){case"recent":o=ne();break;case"suggestions":o=se();break;case"trending":o=(()=>{const e=ee("trending"),r=K.length>0?K:Q;return!e||a.length>0||0===r.length?null:t.createElement("div",{className:I("seekora-section","seekora-section-trending",y.section)},h&&t.createElement("div",{style:Ee.sectionHeader},t.createElement("h3",{style:Ee.sectionTitle},e.title||"Trending")),t.createElement("div",{style:Ee.trendingList},r.slice(0,e.maxItems||5).map((e,r)=>{const a=te.findIndex((e,t)=>"trending"===e.type&&te.slice(0,t).filter(e=>"trending"===e.type).length===r),o=q===a;return x?x(e,r):t.createElement("button",{key:`trending-${e.query}`,style:{...Ee.trendingChip,...o?Ee.trendingChipHover:{}},onClick:()=>{A?.({query:e.query,count:e.count}),X(e.query)},onMouseEnter:()=>H(a),className:I(y.trendingItem,o&&y.suggestionItemActive)},t.createElement("span",{style:Ee.trendingRank},r+1),t.createElement("span",null,e.query),t.createElement(Ce,null))})))})()}return o?t.createElement(t.Fragment,{key:e.id},r>0&&t.createElement("div",{style:Ee.divider}),o):null}),!U&&a.length>0&&0===V.length&&t.createElement("div",{style:Ee.emptyState},t.createElement("p",null,'No suggestions found for "',a,'"'))),C&&t.createElement("div",{style:Ee.footer},C),t.createElement("style",null,'\n .seekora-rich-suggestions [role="option"]:hover button {\n opacity: 1;\n }\n .seekora-rich-suggestions mark {\n background-color: var(--seekora-highlight-bg, #fef9c3);\n font-weight: 600;\n border-radius: 2px;\n padding: 0 1px;\n }\n ')):null}),Ne="150ms ease-in-out",ze=4,Te=8,Me={container:{backgroundColor:"var(--seekora-bg-surface, transparent)",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`var(--seekora-border-radius-lg, ${1.5*Te}px)`,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden"},header:{padding:"12px 20px",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))"},content:{display:"flex",overflowY:"auto"},contentStacked:{flexDirection:"column"},suggestionsColumn:{borderRight:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",overflowY:"auto"},productsColumn:{flex:1,overflowY:"auto",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))"},section:{padding:"12px 0"},sectionHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 20px 8px"},sectionTitle:{fontSize:"11px",fontWeight:700,color:"var(--seekora-text-tertiary, #9ca3af)",textTransform:"uppercase",letterSpacing:"0.08em",margin:0},viewAllLink:{fontSize:"12px",color:"var(--seekora-primary, #3b82f6)",textDecoration:"none",fontWeight:600,cursor:"pointer"},suggestionItem:{display:"flex",alignItems:"center",padding:"10px 20px",cursor:"pointer",transition:`background-color ${Ne}`,gap:"12px"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, #f3f4f6)"},suggestionIcon:{width:"16px",height:"16px",color:"var(--seekora-text-secondary, #6b7280)",flexShrink:0},suggestionText:{flex:1,fontSize:"14px",color:"var(--seekora-text-primary, inherit)",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},suggestionArrow:{width:"16px",height:"16px",color:"var(--seekora-text-tertiary, #d1d5db)",opacity:0,transition:"opacity 100ms ease"},suggestionArrowVisible:{opacity:1},suggestionCount:{fontSize:"12px",color:"var(--seekora-text-tertiary, #9ca3af)"},tabsContainer:{display:"flex",gap:"4px",padding:"12px 20px",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",overflowX:"auto"},tab:{display:"flex",alignItems:"center",gap:"6px",padding:"8px 16px",fontSize:"13px",fontWeight:500,color:"var(--seekora-text-secondary, inherit)",backgroundColor:"transparent",border:"1px solid transparent",borderRadius:`${9999}px`,cursor:"pointer",whiteSpace:"nowrap",transition:`all ${Ne}`},tabActive:{color:"var(--seekora-primary, #3b82f6)",backgroundColor:"var(--seekora-primary-light, #eff6ff)",borderColor:"var(--seekora-primary, #3b82f6)"},tabCount:{fontSize:"11px",fontWeight:600,padding:"2px 6px",borderRadius:`${Te}px`,backgroundColor:"var(--seekora-bg-tertiary, rgba(255, 255, 255, 0.1))"},tabCountActive:{backgroundColor:"var(--seekora-primary, #3b82f6)",color:"white"},productsGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:"16px",padding:"16px 20px"},productCard:{display:"flex",flexDirection:"column",backgroundColor:"var(--seekora-bg-surface, transparent)",borderRadius:`${Te}px`,overflow:"hidden",cursor:"pointer",transition:`transform ${Ne}, box-shadow ${Ne}`,border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))"},productCardHover:{transform:"translateY(-2px)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)"},productImage:{width:"100%",aspectRatio:"1",objectFit:"cover",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"},productInfo:{padding:"10px"},productTitle:{fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.3},productPrice:{fontSize:"14px",fontWeight:700,color:"var(--seekora-primary, #3b82f6)",marginTop:"4px"},brandsGrid:{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 20px 16px"},brandChip:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"8px 14px",fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",backgroundColor:"var(--seekora-bg-surface, transparent)",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`${Te}px`,cursor:"pointer",transition:`all ${Ne}`},brandChipHover:{borderColor:"var(--seekora-primary, #3b82f6)",backgroundColor:"var(--seekora-primary-light, #eff6ff)"},brandLogo:{width:"20px",height:"20px",borderRadius:`${ze}px`,objectFit:"contain",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"},footer:{padding:"12px 20px",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",color:"var(--seekora-text-secondary, inherit)"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fef9c3)",fontWeight:600,padding:"0 2px",borderRadius:ze/2+"px"}},Ae=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Me.suggestionIcon,...e}},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),_e=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Me.suggestionIcon,...e}},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),$e=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Me.suggestionArrow,...e}},t.createElement("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})),Le=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",style:{width:"40%",height:"40%",color:"#d1d5db"}},t.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2",strokeWidth:"2"}),t.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5",strokeWidth:"2"}),t.createElement("polyline",{points:"21 15 16 10 5 21",strokeWidth:"2"})),Pe=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,maxSuggestions:n=8,maxProducts:s=8,maxBrands:i=8,minQueryLength:l=0,debounceMs:c=200,filteredTabs:d,showProducts:u=!0,showBrands:p=!0,showFilteredTabs:m=!0,showRecentSearches:g=!0,layout:f="side-by-side",productsColumnWidth:h="60%",suggestionsColumnWidth:y="40%",showPrices:b=!0,currencySymbol:v="$",classNames:k={},style:x,renderProduct:E,renderSuggestion:S,renderBrand:C,renderTab:R,header:N,footer:z,viewAllProductsLink:T,width:M="800px",maxHeight:A="600px",zIndex:_=1e3,analyticsTags:$,includeFacets:L=!0,includeCategories:P=!0,includeDropdownRecommendations:D=!0,onSuggestionSelect:F,onProductClick:B,onBrandClick:W,onTabSelect:q,onRecentSearchClick:H,onRecentSearchRemove:O,onViewAllClick:j,onOpen:V,onClose:U}=e,{client:K}=w(),Q=t.useRef(null),[G,X]=t.useState(-1),[Y,Z]=t.useState("all"),[J,ee]=t.useState(null),[te,re]=t.useState(null),{suggestions:ae,loading:oe,filteredTabs:ne,trendingProducts:se,popularBrands:ie,recentSearches:le,addRecentSearch:ce,removeRecentSearch:ue,hasContent:pe}=de({client:K,query:a,enabled:o,debounceMs:c,maxSuggestions:n,minQueryLength:l,includeDropdownRecommendations:D,includeCategories:P,includeFacets:L,filteredTabs:d,analyticsTags:$,enableRecentSearches:g}),me=t.useMemo(()=>{if("all"===Y){const e=[...se];return ne.forEach(t=>{t.products&&t.products.forEach(t=>{e.find(e=>e.id===t.id)||e.push(t)})}),e.slice(0,s)}const e=ne.find(e=>e.id===Y);return e?.products?.slice(0,s)||[]},[Y,ne,se,s]),ge=t.useMemo(()=>{const e=[];return 0===a.length&&g&&le.slice(0,5).forEach(t=>{e.push({type:"recent",data:t})}),ae.forEach(t=>{e.push({type:"suggestion",data:t})}),e},[a,g,le,ae]),fe=t.useCallback(()=>{X(e=>e<ge.length-1?e+1:0)},[ge.length]),he=t.useCallback(()=>{X(e=>e>0?e-1:ge.length-1)},[ge.length]),ye=t.useCallback(()=>{if(G<0||G>=ge.length)return;const e=ge[G];"recent"===e.type?H?.(e.data):"suggestion"===e.type&&(F?.(e.data),ce(e.data.query))},[G,ge,H,F,ce]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>G,setActiveIndex:X,selectActive:ye,navigateNext:fe,navigatePrevious:he,getActiveTab:()=>Y,setActiveTab:Z}),[G,ye,fe,he,Y]);const be=e=>{Z(e);const t=ne.find(t=>t.id===e);t&&q?.(t)};if(!o)return null;const ve=m&&(ne.length>0||se.length>0),ke=u&&me.length>0,xe=p&&ie.length>0,Ee=g&&0===a.length&&le.length>0,we=ae.length>0,Se="stacked"===f||"full-width"===f;return t.createElement("div",{ref:Q,role:"listbox","aria-label":"Search suggestions and products",className:I("seekora-federated-dropdown",k.root,k.container),style:{position:"absolute",width:M,zIndex:_,...Me.container,...x}},N&&t.createElement("div",{style:Me.header},N),ve&&t.createElement("div",{style:Me.tabsContainer,className:k.tabsList},t.createElement("button",{style:{...Me.tab,..."all"===Y?Me.tabActive:{}},onClick:()=>be("all"),className:I(k.tabItem,"all"===Y&&k.tabActive)},"All Results",se.length>0&&t.createElement("span",{style:{...Me.tabCount,..."all"===Y?Me.tabCountActive:{}}},se.length,"+")),ne.map(e=>R?R(e,Y===e.id):t.createElement("button",{key:e.id,style:{...Me.tab,...Y===e.id?Me.tabActive:{}},onClick:()=>be(e.id),className:I(k.tabItem,Y===e.id&&k.tabActive)},e.label,void 0!==e.nb_hits&&t.createElement("span",{style:{...Me.tabCount,...Y===e.id?Me.tabCountActive:{}}},e.nb_hits)))),t.createElement("div",{style:{...Me.content,...Se?Me.contentStacked:{},maxHeight:A}},t.createElement("div",{style:{...Me.suggestionsColumn,width:Se?"100%":y,minWidth:Se?void 0:"280px",borderRight:Se?"none":Me.suggestionsColumn.borderRight}},Ee&&t.createElement("div",{style:Me.section,className:k.recentSearches},t.createElement("div",{style:Me.sectionHeader},t.createElement("h3",{style:Me.sectionTitle},"Recent Searches")),le.slice(0,5).map((e,r)=>{const a=G===r;return t.createElement("div",{key:`recent-${e.query}`,role:"option","aria-selected":a,style:{...Me.suggestionItem,...a?Me.suggestionItemActive:{}},onClick:()=>H?.(e),onMouseEnter:()=>X(r),className:I(k.recentItem,a&&k.suggestionItemActive)},t.createElement(_e,null),t.createElement("span",{style:Me.suggestionText},e.query),t.createElement($e,{style:a?Me.suggestionArrowVisible:{}}))})),we&&t.createElement("div",{style:Me.section,className:k.suggestionsList},t.createElement("div",{style:Me.sectionHeader},t.createElement("h3",{style:Me.sectionTitle},a?"Suggestions":"Popular Searches")),ae.slice(0,n).map((e,r)=>{const o=Ee?le.length+r:r,n=G===o;return S?S(e,r,n):t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,style:{...Me.suggestionItem,...n?Me.suggestionItemActive:{}},onClick:()=>{F?.(e),ce(e.query)},onMouseEnter:()=>X(o),className:I(k.suggestionItem,n&&k.suggestionItemActive)},t.createElement(Ae,null),t.createElement("span",{style:Me.suggestionText},(s=e.query,a?s.split(new RegExp(`(${a})`,"gi")).map((e,r)=>e.toLowerCase()===a.toLowerCase()?t.createElement("span",{key:r,style:Me.highlight},e):e):s)),void 0!==e.count&&t.createElement("span",{style:Me.suggestionCount},e.count.toLocaleString()),t.createElement($e,{style:n?Me.suggestionArrowVisible:{}}));var s})),xe&&t.createElement("div",{style:Me.section,className:k.brandsList},t.createElement("div",{style:Me.sectionHeader},t.createElement("h3",{style:Me.sectionTitle},"Popular Brands")),t.createElement("div",{style:Me.brandsGrid},ie.slice(0,i).map((e,r)=>C?C(e,r):t.createElement("button",{key:`brand-${e.name}`,style:{...Me.brandChip,...te===e.name?Me.brandChipHover:{}},onClick:()=>W?.(e),onMouseEnter:()=>re(e.name),onMouseLeave:()=>re(null),className:k.brandItem},e.logo&&t.createElement("img",{src:e.logo,alt:e.name,style:Me.brandLogo,onError:e=>{e.target.style.display="none"}}),t.createElement("span",null,e.name)))))),ke&&!Se&&t.createElement("div",{style:{...Me.productsColumn,width:h}},t.createElement("div",{style:Me.section},t.createElement("div",{style:Me.sectionHeader},t.createElement("h3",{style:Me.sectionTitle},"all"===Y?"Trending Products":`Products in ${ne.find(e=>e.id===Y)?.label||Y}`),T&&t.createElement("a",{href:T,style:Me.viewAllLink,onClick:e=>{e.preventDefault(),j?.("products")}},"View all")),t.createElement("div",{style:Me.productsGrid,className:k.productsList},me.map((e,r)=>{return E?E(e,r):t.createElement("div",{key:e.id||e.objectID,style:{...Me.productCard,...J===e.id?Me.productCardHover:{}},onClick:()=>B?.(e),onMouseEnter:()=>ee(e.id),onMouseLeave:()=>ee(null),className:k.productItem},e.image?t.createElement("img",{src:e.image,alt:e.title||e.name||"",style:Me.productImage,onError:e=>{e.target.style.display="none"}}):t.createElement("div",{style:{...Me.productImage,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(Le,null)),t.createElement("div",{style:Me.productInfo},t.createElement("h4",{style:Me.productTitle},e.title||e.name),b&&void 0!==e.price&&t.createElement("p",{style:Me.productPrice},(a=e.price,o=e.currency,void 0===a?"":`${o||v}${a.toLocaleString()}`))));var a,o}))))),z?t.createElement("div",{style:Me.footer},z):t.createElement("div",{style:Me.footer},t.createElement("span",null,"Press ↵ to search, ↑↓ to navigate"),a&&t.createElement("button",{style:{...Me.viewAllLink,background:"none",border:"none"},onClick:()=>j?.("suggestions")},'See all results for "',a,'"')),t.createElement("style",null,'\n .seekora-federated-dropdown mark {\n background-color: var(--seekora-highlight-bg, #fef9c3);\n font-weight: 600;\n border-radius: 2px;\n padding: 0 2px;\n }\n .seekora-federated-dropdown [role="option"]:hover svg:last-child {\n opacity: 1;\n }\n '))}),De="suggestions.click",Fe="suggestions.impression",Be="suggestions.product_click",We="suggestions.category_click",qe="suggestions.brand_click",He="suggestions.tab_select",Oe="suggestions.recent_click",je="suggestions.trending_click",Ve="suggestions.search_submit",Ue="suggestions.dropdown_open",Ke="suggestions.dropdown_close";function Qe(e){const{client:r,enabled:a=!0,analyticsTags:o=[],impressionDebounce:n=500,trackImpressions:s=!0,trackClicks:i=!0,context:c}=e,u=t.useRef(null),p=t.useRef(null),m=t.useRef(null);t.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const g=t.useCallback(async(e,t,n)=>{if(!a||!r)return;const s=n??c;try{const{query:a,...n}=t,i=e.includes("search")||e===Ve;await(r.trackEvent?.({event_name:e,analytics_tags:o,...i&&a?{query:a}:{},metadata:{...n,timestamp:Date.now(),source:"suggestions_dropdown"}},s)),l(`Analytics: ${e}`,t)}catch(t){d(`Failed to track ${e}`,{error:t})}},[r,a,o,c]);return{trackSuggestionClick:t.useCallback(e=>{i&&g(De,{suggestion_query:e.suggestion.query,suggestion_id:e.suggestion.objectID,suggestion_popularity:e.suggestion.popularity,position:e.position,section:e.section||"suggestions",original_query:e.query,total_suggestions:e.totalSuggestions})},[g,i]),trackProductClick:t.useCallback(e=>{if(!i)return;g(Be,{product_id:e.product.id||e.product.objectID,product_title:e.product.title||e.product.name,product_price:e.product.price,position:e.position,section:e.section||"products",tab_id:e.tabId,original_query:e.query});const t=c;r?.trackClick&&Promise.resolve(r.trackClick(e.product.id||e.product.objectID||"",e.position+1,t)).catch(()=>{})},[r,c,g,i]),trackCategoryClick:t.useCallback((e,t)=>{i&&g(We,{category_value:e.value,category_count:e.count,category_path:e.path,original_query:t})},[g,i]),trackBrandClick:t.useCallback((e,t)=>{i&&g(qe,{brand_name:e.name,brand_count:e.count,original_query:t})},[g,i]),trackTabSelect:t.useCallback((e,t)=>{g(He,{tab_id:e.id,tab_label:e.label,tab_filter:e.filter,products_count:e.products?.length||0,nb_hits:e.nb_hits,original_query:t})},[g]),trackRecentSearchClick:t.useCallback(e=>{i&&g(Oe,{query:e.query,original_timestamp:e.timestamp,results_count:e.resultsCount})},[g,i]),trackTrendingClick:t.useCallback((e,t)=>{i&&g(je,{query:e.query,count:e.count,trend_score:e.trend_score,position:t})},[g,i]),trackImpression:t.useCallback(e=>{if(!s)return;const t=`${e.query}:${e.suggestions.length}:${e.products?.length||0}`;t!==p.current&&(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.current=t,g(Fe,{query:e.query,suggestions_count:e.suggestions.length,suggestions:e.suggestions.slice(0,10).map((e,t)=>({query:e.query,position:t,popularity:e.popularity})),products_count:e.products?.length||0,categories_count:e.categories?.length||0,brands_count:e.brands?.length||0,impression_timestamp:e.timestamp})},n))},[g,s,n]),trackSearchSubmit:t.useCallback((e,t,r)=>{g(Ve,{query:e,from_suggestion:t,suggestion_query:r?.query,suggestion_id:r?.objectID,suggestion_popularity:r?.popularity})},[g]),trackDropdownOpen:t.useCallback(e=>{m.current=Date.now(),g(Ue,{query:e,has_query:e.length>0})},[g]),trackDropdownClose:t.useCallback((e,t)=>{const r=m.current?Date.now()-m.current:null;g(Ke,{query:e,selected_suggestion:t,had_selection:!!t,duration_ms:r}),m.current=null},[g])}}const Ge={wrapper:{position:"relative",width:"100%"},inputWrapper:{display:"flex",alignItems:"center",backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius-lg, 8px)",overflow:"hidden",transition:"border-color 150ms ease, box-shadow 150ms ease"},inputWrapperFocused:{borderColor:"var(--seekora-border-focus, var(--seekora-primary, #3b82f6))",boxShadow:"0 0 0 3px var(--seekora-border-focus-alpha, var(--seekora-primary-light, rgba(59, 130, 246, 0.1)))"},input:{flex:1,padding:"12px 16px",fontSize:"16px",border:"none",outline:"none",backgroundColor:"transparent",color:"var(--seekora-text-primary, #111827)",fontFamily:"inherit"},searchIcon:{width:"20px",height:"20px",color:"var(--seekora-text-secondary, #9ca3af)",marginLeft:"12px",flexShrink:0},clearButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",marginRight:"4px",padding:0,border:"none",backgroundColor:"transparent",color:"var(--seekora-text-secondary, #9ca3af)",borderRadius:"50%",cursor:"pointer",transition:"background-color 150ms ease, color 150ms ease"},searchButton:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"12px 20px",margin:"4px",border:"none",backgroundColor:"var(--seekora-primary, #3b82f6)",color:"var(--seekora-primary-text, white)",borderRadius:"var(--seekora-border-radius, 6px)",fontSize:"14px",fontWeight:600,cursor:"pointer",transition:"background-color 150ms ease"}},Xe=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:Ge.searchIcon},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),Ye=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{width:16,height:16}},t.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})),Ze=t.forwardRef(function(e,r){const{variant:a="classic",placeholder:o="Powered by Seekora",initialQuery:n="",value:s,onQueryChange:i,onSearch:l,onSuggestionSelect:c,onProductClick:d,showSearchButton:u=!1,searchButtonText:p="Search",showClearButton:m=!0,autoFocus:g=!1,minQueryLength:f=1,maxSuggestions:h=8,maxProducts:y=8,debounceMs:b=200,showRecentSearches:v=!0,showTrendingOnEmpty:k=!0,includeDropdownRecommendations:x=!1,filteredTabs:E,enableAnalytics:S=!0,analyticsTags:C,includeFacets:R,includeCategories:N,dropdownWidth:z,dropdownMaxHeight:T,classNames:M={},style:A,inputStyle:_,ariaLabel:$="Search"}=e,{client:L}=w(),P=t.useRef(null),D=t.useRef(null),[F,B]=t.useState(s??n),[W,q]=t.useState(!1),[H,O]=t.useState(!1),j=Qe({client:L,enabled:S,analyticsTags:C});t.useEffect(()=>{void 0!==s&&s!==F&&B(s)},[s]);const V=t.useCallback(e=>{const t=e.target.value;B(t),i?.(t),(t.length>=f||k&&0===t.length)&&O(!0)},[i,f,k]),U=t.useCallback(e=>{e?.preventDefault(),F.trim()&&(l?.(F.trim()),j.trackSearchSubmit(F.trim(),!1),O(!1))},[F,l,j]),K=t.useCallback(e=>{B(e.query),i?.(e.query),c?.(e),j.trackSuggestionClick({suggestion:e,position:0,query:F}),O(!1),l?.(e.query)},[F,i,c,l,j]),Q=t.useCallback(e=>{d?.(e),j.trackProductClick({product:e,position:0,query:F}),O(!1)},[F,d,j]),G=t.useCallback(e=>{B(e.query),i?.(e.query),j.trackRecentSearchClick(e),O(!1),l?.(e.query)},[i,l,j]),X=t.useCallback(()=>{q(!0),O(!0),j.trackDropdownOpen(F)},[F,j]),Y=t.useCallback(()=>{q(!1),setTimeout(()=>{O(!1),j.trackDropdownClose(F)},200)},[F,j]),Z=t.useCallback(()=>{B(""),i?.(""),P.current?.focus()},[i]),J=t.useCallback(e=>{if(H)switch(e.key){case"ArrowDown":e.preventDefault(),D.current?.navigateNext?.();break;case"ArrowUp":e.preventDefault(),D.current?.navigatePrevious?.();break;case"Enter":e.preventDefault(),(D.current?.getActiveIndex?.()??-1)>=0?D.current?.selectActive?.():U();break;case"Escape":e.preventDefault(),O(!1),P.current?.blur()}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||O(!0)},[H,U]);t.useImperativeHandle(r,()=>({focus:()=>P.current?.focus(),blur:()=>P.current?.blur(),clear:Z,getQuery:()=>F,setQuery:e=>{B(e),i?.(e)},openDropdown:()=>O(!0),closeDropdown:()=>O(!1),navigateNext:()=>D.current?.navigateNext?.(),navigatePrevious:()=>D.current?.navigatePrevious?.(),selectCurrent:()=>D.current?.selectActive?.()}),[F,Z,i]);return t.createElement("div",{className:I("seekora-search-bar-with-suggestions",M.wrapper),style:{...Ge.wrapper,...A}},t.createElement("form",{onSubmit:U},t.createElement("div",{style:{...Ge.inputWrapper,...W?Ge.inputWrapperFocused:{}}},t.createElement(Xe,null),t.createElement("input",{ref:P,type:"text",value:F,onChange:V,onFocus:X,onBlur:Y,onKeyDown:J,placeholder:o,autoFocus:g,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":$,"aria-expanded":H,"aria-haspopup":"listbox","aria-autocomplete":"list",role:"combobox",className:M.input,style:{...Ge.input,..._}}),m&&F&&t.createElement("button",{type:"button",onClick:Z,className:M.clearButton,style:Ge.clearButton,"aria-label":"Clear search"},t.createElement(Ye,null)),u&&t.createElement("button",{type:"submit",className:M.button,style:Ge.searchButton},p))),t.createElement("div",{className:M.dropdown},(()=>{const e={query:F,isOpen:H,maxSuggestions:h,minQueryLength:f,debounceMs:b,showRecentSearches:v,classNames:M,onSuggestionSelect:K,onRecentSearchClick:G,onClose:()=>O(!1),analyticsTags:C};switch(a){case"rich":return t.createElement(Ie,{ref:D,...e,includeDropdownRecommendations:x,includeCategories:!0,width:z||"100%",maxHeight:T||"480px"});case"federated":return t.createElement(Pe,{ref:D,...e,maxProducts:y,filteredTabs:E,showProducts:!0,showBrands:!0,showFilteredTabs:!!E,onProductClick:Q,width:z||"800px",maxHeight:T||"600px",includeFacets:R,includeCategories:N,includeDropdownRecommendations:x});case"compact":return t.createElement(ye,{ref:D,...e,maxSuggestions:5,showCounts:!1,width:z||"100%"});default:return t.createElement(ye,{ref:D,...e,width:z||"100%"})}})()))}),Je=t.createContext(null);function et(){const e=t.useContext(Je);if(!e){const e=new Error("useSuggestionsContext must be used within a SuggestionsProvider");throw u("SuggestionsContext: not available",{error:e.message}),e}return e}function tt({children:e,minQueryLength:r=1,debounceMs:a=200,maxSuggestions:o=10,includeDropdownRecommendations:n=!0,filteredTabs:s,enableAnalytics:i=!0,analyticsTags:l,onSearch:c,onSuggestionSelect:d,onProductClick:u}){const{client:p}=w(),[m,g]=t.useState(""),[f,h]=t.useState(!1),[y,b]=t.useState(-1),[v,k]=t.useState(""),[x,E]=t.useState([]),S=t.useRef(!1);t.useEffect(()=>{!S.current&&p?.search&&(S.current=!0,p.search("*",{per_page:12,page:1}).then(e=>{const t=e?.data,r=t?.results||t?.data||e?.results||e?.hits||[];Array.isArray(r)&&r.length>0&&E(r)}).catch(()=>{}))},[p]);const C=de({client:p,query:m,enabled:f,prefetch:0===r,minQueryLength:r,debounceMs:a,maxSuggestions:o,includeDropdownRecommendations:n,filteredTabs:s,includeCategories:!0,enableRecentSearches:!0,maxRecentSearches:8,analyticsTags:l}),R=Qe({client:p,enabled:i,analyticsTags:l,trackClicks:!0,trackImpressions:!0}),{suggestions:I,recentSearches:N,trendingSearches:z,trendingProducts:T,filteredTabs:M,loading:A,error:_,hasContent:$,getAllNavigableItems:L,addRecentSearch:P,clearRecentSearches:D}=C,F=t.useCallback(()=>{const e=L();if(e.some(e=>"product"===e.type))return e;if(x.length>0){let t=e.length;x.forEach(r=>{e.push({type:"product",index:t++,data:r})})}return e},[L,x]),B=t.useRef(c),W=t.useRef(d),q=t.useRef(u);B.current=c,W.current=d,q.current=u;const H=t.useCallback(e=>{g(e),b(-1)},[]),O=t.useCallback(()=>{R.trackDropdownClose(m),h(!1),b(-1)},[R,m]),j=t.useCallback(e=>{e?(h(!0),R.trackDropdownOpen(m)):O()},[R,m,O]),V=t.useCallback((e,t)=>{R.trackSuggestionClick({suggestion:e,position:t,query:m,totalSuggestions:I.length}),H(e.query),W.current?.(e),R.trackSearchSubmit(e.query,!0,e),P(e.query),O(),B.current?.(e.query)},[R,m,I.length,P,O]),U=t.useCallback((e,t,r,a)=>{R.trackProductClick({product:e,position:t,section:r??"products",tabId:a,query:m}),O(),q.current?.(e)},[R,m,O]),K=t.useCallback(e=>{R.trackRecentSearchClick(e),H(e.query),O(),B.current?.(e.query),R.trackSearchSubmit(e.query,!1)},[R,O]),Q=t.useCallback((e,t)=>{R.trackTrendingClick(e,t),H(e.query),O(),B.current?.(e.query),R.trackSearchSubmit(e.query,!1)},[R,O]),G=t.useCallback(e=>{k(e.id),R.trackTabSelect(e,m)},[R,m]),X=t.useCallback((e,t,r)=>{const a=e.trim();a&&(R.trackSearchSubmit(a,!!t,r),P(a),O(),B.current?.(a))},[R,P,O]),Y=t.useCallback(()=>{const e=F();0!==e.length&&b(t=>t<e.length-1?t+1:0)},[F]),Z=t.useCallback(()=>{const e=F();0!==e.length&&b(t=>t<=0?e.length-1:t-1)},[F]),J=t.useCallback(()=>{const e=F();if(y<0||y>=e.length)return void X(m);const t=e[y];switch(t.type){case"suggestion":V(t.data,t.index);break;case"product":U(t.data,t.index,"products");break;case"recent":K(t.data);break;case"trending":Q(t.data,t.index);break;default:X(m)}},[y,F,m,X,V,U,K,Q]);t.useEffect(()=>{f&&$&&m&&R.trackImpression({suggestions:I,products:T,query:m,timestamp:Date.now()})},[f,$,m,I,T,R]);const ee=t.useMemo(()=>({query:m,setQuery:H,isOpen:f,setIsOpen:j,activeIndex:y,setActiveIndex:b,suggestions:I,recentSearches:N,trendingSearches:z,trendingProducts:T,prefetchedProducts:x,filteredTabs:M,activeTabId:v,setActiveTabId:k,loading:A,error:_,hasContent:$,getAllNavigableItems:F,selectSuggestion:V,selectProduct:U,selectRecentSearch:K,selectTrendingSearch:Q,setActiveTab:G,submitSearch:X,clearRecentSearches:D,close:O,navigateNext:Y,navigatePrev:Z,selectActive:J}),[m,H,f,j,y,b,I,N,z,T,x,M,v,k,A,_,$,F,V,U,K,Q,G,X,D,O,Y,Z,J]);return t.createElement(Je.Provider,{value:ee},e)}const rt=8,at="150ms ease-in-out",ot={position:"relative",width:"100%"},nt={display:"flex",alignItems:"center",gap:`${rt}px`,padding:`${rt}px ${12}px`,border:"1px solid var(--seekora-border-color, rgba(0,0,0,0.1))",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:"var(--seekora-bg-surface, transparent)",transition:`border-color ${at}, box-shadow ${at}`,boxSizing:"border-box"},st={flex:1,minWidth:0,padding:`${rt}px 0`,border:"none",outline:"none",backgroundColor:"transparent",fontSize:"inherit",color:"var(--seekora-text-primary, inherit)",fontFamily:"inherit"};function it({placeholder:e="Powered by Seekora",autoFocus:r=!1,showClearButton:a=!0,closeOnBlur:o=!0,leftIcon:n,className:s,style:i,inputClassName:l,inputStyle:c,ariaLabel:d="Search"}){const{query:u,setQuery:p,isOpen:m,setIsOpen:g,navigateNext:f,navigatePrev:h,selectActive:y,close:b}=et(),v=t.useRef(null),k=t.useCallback(()=>{g(!0)},[g]),x=t.useCallback(()=>{o&&setTimeout(()=>b(),200)},[b,o]),E=t.useCallback(e=>{p(e.target.value)},[p]),w=t.useCallback(e=>"ArrowDown"===e.key?(e.preventDefault(),void f()):"ArrowUp"===e.key?(e.preventDefault(),void h()):"Enter"===e.key?(e.preventDefault(),void y()):"Escape"===e.key?(e.preventDefault(),b(),void v.current?.blur()):void 0,[f,h,y,b]),S=t.useCallback(()=>{p(""),v.current?.focus()},[p]);return t.createElement("div",{className:I("seekora-suggestions-search-input-wrapper",s),style:{...ot,...i}},t.createElement("div",{className:"seekora-suggestions-input-wrapper",style:nt},n?t.createElement("span",{className:"seekora-suggestions-input-left-icon",style:{display:"flex",flexShrink:0,color:"inherit",opacity:.5}},n):null,t.createElement("input",{ref:v,type:"text",value:u,onChange:E,onFocus:k,onBlur:x,onKeyDown:w,placeholder:e,autoFocus:r,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":d,"aria-expanded":m,"aria-haspopup":"listbox","aria-autocomplete":"list",role:"combobox",className:I("seekora-suggestions-input",l),style:{...st,...c}}),a&&u?t.createElement("button",{type:"button",onClick:S,className:"seekora-suggestions-input-clear","aria-label":"Clear search",style:{padding:8,border:"none",background:"transparent",cursor:"pointer",color:"inherit",opacity:.5,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(lt,null)):null))}function lt(){return t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0},t.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))}const ct=6,dt=100;function ut({children:e,position:r="absolute",top:a="100%",left:o=0,right:n,width:s="100%",maxHeight:i="80vh",zIndex:l=dt,className:c,style:d,closeOnClickOutside:u=!0,closeOnEscape:p=!0}){const{isOpen:m,close:g}=et(),f=t.useRef(null);t.useEffect(()=>{if(!p||!m)return;const e=e=>{"Escape"===e.key&&g()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p,m,g]);const h=t.useCallback(e=>{if(!u||!f.current)return;const t=e.target;f.current.contains(t)||g()},[u,g]);if(t.useEffect(()=>{if(m)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[m,h]),!m)return null;const y={position:r,top:a,left:o,right:n,width:s,maxHeight:i,zIndex:l,overflow:"auto",backgroundColor:"var(--seekora-bg-surface, #fff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:`var(--seekora-border-radius, ${ct}px)`,boxShadow:"var(--seekora-shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05))",marginTop:4};return t.createElement("div",{ref:f,role:"listbox",className:I("seekora-suggestions-dropdown-panel",c),style:{...y,...d}},e)}const pt={backgroundColor:"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))",fontWeight:500,borderRadius:"2px",padding:"0 2px"};function mt(e,r={}){if(null==e||"string"!=typeof e)return e;const a=e.split(/(<mark>[\s\S]*?<\/mark>)/g);if(a.length<=1)return e;const{markClassName:o,markStyle:n,highlightTag:s}=r,i=s||"mark",l=r.highlightColor||r.highlightTextColor||r.highlightFontWeight||r.highlightStyle?function(e){const t={};switch(e.highlightStyle||"background"){case"background":t.backgroundColor=e.highlightColor||"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))",t.borderRadius="2px",t.padding="0 2px";break;case"underline":t.textDecoration="underline",t.textDecorationColor=e.highlightColor||"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.8))",t.textUnderlineOffset="2px"}return e.highlightTextColor?t.color=e.highlightTextColor:t.color="var(--seekora-highlight-color, inherit)",t.fontWeight=e.highlightFontWeight||"var(--seekora-highlight-weight, 500)",t}(r):pt;return t.createElement(t.Fragment,null,a.map((e,r)=>{const a=e.match(/^<mark>([\s\S]*)<\/mark>$/);return a?t.createElement(i,{key:r,className:o,style:{...l,...n}},a[1]):e}))}const gt={padding:"10px 12px",cursor:"pointer",listStyle:"none",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"inherit",transition:"background-color 120ms ease",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function ft({suggestion:e,index:r,isActive:a,onSelect:o,className:n,style:s,enableHighlightMarkup:i=!0,highlightMarkupOptions:l,renderHighlight:c}){const[d,u]=t.useState(!1),p=e.highlightedQuery??e.query,m=null!=c?c(p):i?mt(p??"",l):e.query??p??"",g=a||d;return t.createElement("li",{role:"option","aria-selected":a,id:`seekora-suggestion-${r}`,className:I("seekora-suggestions-item",a&&"seekora-suggestions-item--active",d&&"seekora-suggestions-item--hover",n),style:{...gt,...g?{backgroundColor:"var(--seekora-bg-hover, rgba(0,0,0,0.05))"}:{},...s},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onMouseDown:e=>{e.preventDefault(),o()}},m,null!=e.count?t.createElement("span",{className:"seekora-suggestions-item-count",style:{marginLeft:8,color:"inherit",opacity:.6,fontSize:"0.875em"}},e.count):null)}const ht={margin:0,padding:"4px 0"};function yt({maxItems:e=10,className:r,style:a,listClassName:o,enableHighlightMarkup:n=!0,highlightMarkupOptions:s,renderItem:i}){const{suggestions:l,activeIndex:c,loading:d,selectSuggestion:u,getAllNavigableItems:p}=et(),m=l.slice(0,e),g=p().findIndex(e=>"suggestion"===e.type),f=g>=0&&c>=g&&c<g+m.length;return 0===m.length?null:t.createElement("div",{className:I("seekora-suggestions-list",r),style:a},t.createElement("ul",{className:I("seekora-suggestions-list-ul",o),style:ht,role:"listbox"},m.map((e,r)=>{const a=g>=0?g+r:r,o=f&&c===a,l=()=>u(e,a);return i?t.createElement("li",{key:e.objectID??e.query??r,role:"option"},i(e,a,o,l)):t.createElement(ft,{key:e.objectID??e.query??r,suggestion:e,index:a,isActive:o,onSelect:l,enableHighlightMarkup:n,highlightMarkupOptions:s})})))}function bt({src:e,alt:a="",mode:o="both",zoomLevel:n=2.5,className:s,style:i,showZoomIndicator:l=!0,lensSize:c=150,zoomPanelSize:d={width:400,height:400},images:u,currentIndex:p=0}){const[m,g]=t.useState(!1),[f,h]=t.useState(!1),[y,b]=t.useState(p),[v,k]=t.useState({x:0,y:0}),[x,E]=t.useState(!1),[w,S]=t.useState(null),[C,R]=t.useState(null),N=t.useRef(null),z=t.useRef(null),T=u&&u.length>0?u:[e],M=T.length>1,A="hover"===o||"both"===o,_="click"===o||"both"===o,$="lens"===o,L=t.useCallback(e=>{if(!z.current)return;const t=z.current.getBoundingClientRect(),r=e.clientX-t.left,a=e.clientY-t.top;k({x:r,y:a})},[]),P=t.useCallback(()=>{g(!0)},[]),D=t.useCallback(()=>{g(!1)},[]),F=t.useCallback(e=>{_&&(e?.stopPropagation(),b(p),h(!0))},[_,p]),B=t.useCallback(e=>{e?.stopPropagation(),h(!1)},[]),W=t.useCallback(()=>{b(e=>(e+1)%T.length)},[T.length]),q=t.useCallback(()=>{b(e=>(e-1+T.length)%T.length)},[T.length]),H=t.useCallback(e=>{R(null),S(e.targetTouches[0].clientX)},[]),O=t.useCallback(e=>{R(e.targetTouches[0].clientX)},[]),j=t.useCallback(()=>{if(!w||!C)return;const e=w-C,t=e<-50;e>50?W():t&&q()},[w,C,50,W,q]);t.useEffect(()=>{if(!f)return;const e=e=>{"Escape"===e.key&&B(),M&&("ArrowRight"===e.key&&W(),"ArrowLeft"===e.key&&q())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[f,B,M,W,q]);const V={position:"relative",display:"inline-block",cursor:_?"zoom-in":A||$?"crosshair":"default",overflow:"hidden",...i},U={width:"100%",height:"100%",objectFit:i?.objectFit??"cover",display:"block"},K=t.useCallback(()=>{if(!z.current)return{indL:0,indT:0,indW:0,indH:0};const e=z.current.getBoundingClientRect(),t=e.width/n,r=d.height/d.width*e.width/n;return{indL:Math.max(0,Math.min(e.width-t,v.x-t/2)),indT:Math.max(0,Math.min(e.height-r,v.y-r/2)),indW:t,indH:r}},[v,n,d]);return t.createElement(t.Fragment,null,t.createElement("div",{ref:z,className:I("seekora-image-zoom",s),style:V,onMouseMove:L,onMouseEnter:P,onMouseLeave:D,onClick:F},t.createElement("img",{ref:N,src:e,alt:a,style:U,onLoad:()=>E(!0)}),l&&_&&t.createElement("div",{style:{position:"absolute",top:8,right:8,width:32,height:32,borderRadius:"50%",backgroundColor:"var(--seekora-zoom-indicator-bg, rgba(0,0,0,0.6))",color:"var(--seekora-zoom-indicator-text, #fff)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",pointerEvents:"none",opacity:m?1:.7,transition:"opacity 150ms"}},"🔍"),$&&m&&x&&t.createElement("div",{style:z.current?{position:"absolute",width:c,height:c,left:v.x-c/2,top:v.y-c/2,border:"var(--seekora-lens-border, 2px solid rgba(255,255,255,0.8))",borderRadius:"50%",boxShadow:"var(--seekora-lens-shadow, 0 0 0 1px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.3))",pointerEvents:"none",overflow:"hidden",zIndex:100}:{display:"none"}},t.createElement("img",{src:e,alt:"",style:(()=>{if(!z.current||!N.current)return{};const e=z.current.getBoundingClientRect();return{position:"absolute",width:e.width*n,height:e.height*n,left:-(v.x*n-c/2),top:-(v.y*n-c/2),objectFit:"cover"}})()})),A&&m&&x&&z.current&&(()=>{const{indL:e,indT:r,indW:a,indH:o}=K();return t.createElement("div",{style:{position:"absolute",left:e,top:r,width:a,height:o,border:"var(--seekora-hover-area-border, 2px solid rgba(0,0,0,0.3))",backgroundColor:"var(--seekora-hover-area-bg, rgba(255,255,255,0.1))",pointerEvents:"none",zIndex:50}})})()),A&&m&&x&&"undefined"!=typeof document&&r.createPortal(t.createElement("div",{style:(()=>{if(!z.current||!x)return{display:"none"};const t=z.current.getBoundingClientRect(),{indL:r,indT:a,indW:o,indH:s}=K(),i=t.width-o>0?r/(t.width-o)*100:0,l=t.height-s>0?a/(t.height-s)*100:0,c=window.innerWidth,u=window.innerHeight,p=16,m=t.left+v.x,g=t.top+v.y,f=c-t.right-p,h=t.left-p;let y,b=t.top;y=f>=d.width?t.right+p:h>=d.width?t.left-d.width-p:f>h?t.right+p:Math.max(p,t.left-d.width-p),t.top+d.height>u-p&&(b=Math.max(p,u-d.height-p));const k=y+d.width,E=b+d.height;return m>=y-50&&m<=k+50&&g>=b-50&&g<=E+50&&(y>t.right&&h>=d.width?y=t.left-d.width-p:y<t.left&&f>=d.width&&(y=t.right+p)),y=Math.max(p,Math.min(y,c-d.width-p)),b=Math.max(p,Math.min(b,u-d.height-p)),{position:"fixed",top:b,left:y,width:d.width,height:d.height,backgroundImage:`url(${e})`,backgroundSize:100*n+"%",backgroundPosition:`${i}% ${l}%`,backgroundRepeat:"no-repeat",border:"2px solid var(--seekora-border-color, #e5e7eb)",borderRadius:8,boxShadow:"var(--seekora-zoom-panel-shadow, 0 8px 24px rgba(0,0,0,0.2))",backgroundColor:"var(--seekora-zoom-panel-bg, #fff)",pointerEvents:"none",zIndex:9998}})()}),document.body),f&&"undefined"!=typeof document&&r.createPortal(t.createElement("div",{className:"seekora-image-zoom-lightbox",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"var(--seekora-lightbox-bg, rgba(0,0,0,0.95))",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out",padding:20},onClick:B,onTouchStart:M?H:void 0,onTouchMove:M?O:void 0,onTouchEnd:M?j:void 0},t.createElement("button",{type:"button","aria-label":"Close zoom",style:{position:"absolute",top:20,right:20,width:44,height:44,borderRadius:"50%",border:"none",backgroundColor:"var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))",color:"var(--seekora-lightbox-btn-text, #fff)",fontSize:"1.5rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),B()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))"}},"✕"),M&&t.createElement(t.Fragment,null,t.createElement("button",{type:"button","aria-label":"Previous image",style:{position:"absolute",left:20,top:"50%",transform:"translateY(-50%)",width:56,height:56,borderRadius:"50%",border:"none",backgroundColor:"var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))",color:"var(--seekora-lightbox-btn-text, #fff)",fontSize:"2rem",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),q()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))"}},"‹"),t.createElement("button",{type:"button","aria-label":"Next image",style:{position:"absolute",right:20,top:"50%",transform:"translateY(-50%)",width:56,height:56,borderRadius:"50%",border:"none",backgroundColor:"var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))",color:"var(--seekora-lightbox-btn-text, #fff)",fontSize:"2rem",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),W()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))"}},"›")),t.createElement("img",{src:T[y],alt:a,style:{maxWidth:"90%",maxHeight:"90%",objectFit:"contain",borderRadius:4,cursor:"default"},onClick:e=>e.stopPropagation()}),M&&t.createElement("div",{style:{position:"absolute",bottom:20,left:"50%",transform:"translateX(-50%)",display:"flex",flexDirection:"column",alignItems:"center",gap:12},onClick:e=>e.stopPropagation()},t.createElement("div",{style:{display:"flex",gap:8,overflowX:"auto",maxWidth:"80vw",padding:"8px 0"}},T.map((e,r)=>t.createElement("button",{key:r,type:"button",onClick:e=>{e.stopPropagation(),b(r)},style:{width:60,height:60,padding:0,border:r===y?"var(--seekora-lightbox-thumb-border-active, 3px solid #fff)":"var(--seekora-lightbox-thumb-border, 2px solid rgba(255,255,255,0.3))",borderRadius:4,overflow:"hidden",cursor:"pointer",opacity:r===y?1:.6,transition:"all 150ms ease",flexShrink:0,background:"none"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{r!==y&&(e.currentTarget.style.opacity="0.6")}},t.createElement("img",{src:e,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})))),t.createElement("div",{style:{color:"var(--seekora-lightbox-counter-text, rgba(255,255,255,0.9))",fontSize:"0.875rem",textAlign:"center",backgroundColor:"var(--seekora-lightbox-counter-bg, rgba(0,0,0,0.5))",padding:"4px 12px",borderRadius:12}},y+1," / ",T.length)),t.createElement("div",{style:{position:"absolute",top:20,left:"50%",transform:"translateX(-50%)",color:"var(--seekora-lightbox-instructions-text, rgba(255,255,255,0.7))",fontSize:"0.875rem",textAlign:"center",backgroundColor:"var(--seekora-lightbox-instructions-bg, rgba(0,0,0,0.5))",padding:"8px 16px",borderRadius:12}},M?"Use arrow keys or click thumbnails to navigate • ESC to close":"Click outside or press ESC to close")),document.body))}const vt={width:"100%",height:"auto",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)",display:"block",overflow:"hidden"};function kt({images:e,variant:r="single",alt:a="",className:o,style:n,carouselAutoplay:s=!1,carouselIntervalMs:i=4e3,enableZoom:l=!1,zoomMode:c="both",zoomLevel:d=2.5,showDots:u=!0}){const[p,m]=t.useState(0),[g,f]=t.useState(!1),h=Array.isArray(e)?e.filter(Boolean):[],y=h[p]??h[0],b=W(),v=H(32),k=b?56:48,x=O(8);if(0===h.length)return t.createElement("div",{className:I("seekora-img-display","seekora-img-placeholder",o),style:{...vt,...n},"aria-hidden":!0});if("single"===r)return l?t.createElement(bt,{src:h[0],alt:a,mode:c,zoomLevel:d,images:h,currentIndex:0,className:I("seekora-img-display","seekora-img-single",o),style:{...vt,...n}}):t.createElement("img",{src:h[0],alt:a,className:I("seekora-img-display","seekora-img-single",o),style:{...vt,...n},loading:"lazy"});if("hover"===r){const e=h.length>1&&g,r=e?h[1]:h[0],s=n?.aspectRatio||n?.objectFit?{...vt,...n.aspectRatio?{aspectRatio:n.aspectRatio}:{},...n.objectFit?{objectFit:n.objectFit}:{}}:vt;return l?t.createElement("div",{className:I("seekora-img-display","seekora-img-hover",o),style:{position:"relative",...n},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)},t.createElement(bt,{src:r,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:e?1:0,className:"seekora-img-hover-img",style:s})):t.createElement("div",{className:I("seekora-img-display","seekora-img-hover",o),style:{position:"relative",...n},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)},t.createElement("img",{src:r,alt:a,className:"seekora-img-hover-img",style:s,loading:"lazy"}))}if("carousel"===r){const e=e=>{m(t=>{const r=t+e;return r<0?h.length-1:r>=h.length?0:r})},r=n?.aspectRatio||n?.objectFit?{...vt,...n.aspectRatio?{aspectRatio:n.aspectRatio}:{},...n.objectFit?{objectFit:n.objectFit}:{}}:vt,s=l?t.createElement(bt,{src:y,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:p,className:"seekora-img-carousel-main",style:r}):t.createElement("img",{src:y,alt:a,className:"seekora-img-carousel-main",style:r,loading:"lazy"});return t.createElement("div",{className:I("seekora-img-display","seekora-img-carousel",o),style:{position:"relative",...n}},s,h.length>1&&t.createElement(t.Fragment,null,t.createElement("button",{type:"button","aria-label":"Previous",className:"seekora-img-carousel-prev",style:xt(!0,v),onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),e(-1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-carousel-btn-bg-hover, rgba(255,255,255,1))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-carousel-btn-bg, rgba(255,255,255,0.9))"}},"‹"),t.createElement("button",{type:"button","aria-label":"Next",className:"seekora-img-carousel-next",style:xt(!1,v),onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),e(1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-carousel-btn-bg-hover, rgba(255,255,255,1))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-carousel-btn-bg, rgba(255,255,255,0.9))"}},"›"),u&&t.createElement("div",{className:"seekora-img-carousel-dots",style:{position:"absolute",bottom:b?12:8,left:"50%",transform:"translateX(-50%)",display:"flex",gap:b?8:6,padding:b?"8px 16px":"6px 12px",backgroundColor:"var(--seekora-carousel-dots-bg, rgba(0,0,0,0.5))",borderRadius:12,zIndex:10}},h.map((e,r)=>t.createElement("button",{key:r,type:"button","aria-label":`Go to image ${r+1}`,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),m(r)},style:{width:b?10:8,height:b?10:8,minWidth:b?44:32,minHeight:b?44:32,borderRadius:"50%",border:"none",padding:0,backgroundColor:r===p?"var(--seekora-carousel-dot-active, #fff)":"var(--seekora-carousel-dot, rgba(255,255,255,0.5))",cursor:"pointer",transition:"all 150ms ease"}})))))}if("thumbStrip"===r||"thumbList"===r){const e=n?.aspectRatio||n?.objectFit?{...vt,...n.aspectRatio?{aspectRatio:n.aspectRatio}:{},...n.objectFit?{objectFit:n.objectFit}:{}}:vt,r=l?t.createElement(bt,{src:y,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:p,className:"seekora-img-thumb-main",style:e}):t.createElement("img",{src:y,alt:a,className:"seekora-img-thumb-main",style:e,loading:"lazy"});return t.createElement("div",{className:I("seekora-img-display","seekora-img-thumbstrip",o),style:{display:"flex",flexDirection:"column",gap:x,...n}},r,t.createElement("div",{className:"seekora-img-thumbs",style:{display:"flex",gap:b?6:4,overflowX:"auto",paddingBottom:b?6:4}},h.map((e,r)=>t.createElement("button",{type:"button",key:r,className:I("seekora-img-thumb",r===p&&"seekora-img-thumb--active"),style:{flexShrink:0,width:k,height:k,minWidth:k,minHeight:k,padding:0,border:r===p?"2px solid var(--seekora-primary)":"1px solid transparent",borderRadius:4,overflow:"hidden",cursor:"pointer",background:"none"},onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),m(r)},onClick:e=>{e.stopPropagation(),e.preventDefault()}},t.createElement("img",{src:e,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})))))}return t.createElement("img",{src:y,alt:a,className:I("seekora-img-display",o),style:{...vt,...n},loading:"lazy"})}function xt(e,t=32){return{position:"absolute",top:"50%",[e?"left":"right"]:t>=44?4:8,transform:"translateY(-50%)",width:t,height:t,minWidth:t,minHeight:t,borderRadius:"50%",border:"none",backgroundColor:"var(--seekora-carousel-btn-bg, rgba(255, 255, 255, 0.9))",color:"var(--seekora-carousel-btn-text, #111)",fontSize:t>=44?"1.5rem":"1.25rem",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",zIndex:10,transition:"all 150ms ease"}}const Et=8,wt="150ms ease-in-out",St=6,Ct="0 2px 4px rgba(0,0,0,0.1)",Rt={addToCart:"🛒",wishlist:"♡",buyNow:"⚡",quickView:"👁",compare:"⚖"},It={addToCart:"Add to Cart",wishlist:"Wishlist",buyNow:"Buy Now",quickView:"Quick View",compare:"Compare"},Nt={small:{width:44,height:44,fontSize:"0.75rem",iconSize:"1rem"},medium:{width:44,height:44,fontSize:"0.875rem",iconSize:"1.25rem"},large:{width:44,height:44,fontSize:"1rem",iconSize:"1.5rem"}};function zt({buttons:e,layout:r="horizontal",position:a="inline",showLabels:o=!1,size:n="medium",className:s,style:i}){const l=Nt[n],c={display:"flex",flexDirection:"vertical"===r?"column":"row",gap:Et,..."inline"!==a?{position:"absolute",..."top-right"===a?{top:Et,right:Et}:{},..."bottom-center"===a?{bottom:Et,left:"50%",transform:"translateX(-50%)"}:{}}:{},...i},d={display:"flex",alignItems:"center",justifyContent:"center",gap:4,padding:o?"0 12px":0,width:o?"auto":l.width,height:l.height,fontSize:l.fontSize,fontWeight:500,border:"none",borderRadius:St,backgroundColor:"var(--seekora-bg-surface, transparent)",color:"var(--seekora-text, inherit)",cursor:"pointer",transition:`all ${wt}`,boxShadow:Ct};return t.createElement("div",{className:I("seekora-action-buttons",`seekora-action-buttons--${r}`,s),style:c},e.map((e,r)=>{const a=e.icon??Rt[e.type],n=e.label??It[e.type];return t.createElement("button",{key:r,type:"button",className:I("seekora-action-button",`seekora-action-button--${e.type}`,e.disabled&&"seekora-action-button--disabled",e.loading&&"seekora-action-button--loading"),style:{...d,opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},onClick:t=>((e,t)=>{t.stopPropagation(),t.preventDefault(),!e.onClick||e.disabled||e.loading||e.onClick(t)})(e,t),disabled:e.disabled,"aria-label":n,title:n},e.loading?t.createElement("span",{style:{fontSize:l.iconSize}},"⏳"):t.createElement(t.Fragment,null,t.createElement("span",{style:{fontSize:l.iconSize}},a),o&&t.createElement("span",null,n)))}))}const Tt="150ms ease-in-out",Mt={display:"flex",flexDirection:"column",gap:8,padding:8,cursor:"pointer",border:"none",borderRadius:`var(--seekora-border-radius, ${6}px)`,backgroundColor:"transparent",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",transition:`background-color ${Tt}, box-shadow ${Tt}`},At={width:"100%",aspectRatio:"var(--seekora-card-aspect-ratio, 1)",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.04))",display:"block",overflow:"hidden"};function _t({item:e,position:r,onSelect:a,className:o,style:n,asLink:s=!0,imageVariant:i="single",layout:l="vertical",actionButtons:c,actionButtonsPosition:d="overlay-top-right",showActionLabels:u=!1}){const p=e.images?.length?e.images:e.image??e.imageUrl?[String(e.image??e.imageUrl)]:[],m=e.title??e.primaryText??"",g=e.description??e.secondaryText,f=e.url,h=W(),y=O(12),b="horizontal"===l,[v,k]=t.useState(!1),x=h?60:80,E=h?100:120,w=h?60:80,S=h?"0.9375rem":"0.875rem",C=h?"0.875rem":"0.8125rem",R=h?6:4,N=h?3:2,z=v?{backgroundColor:"var(--seekora-card-hover-bg, var(--seekora-bg-hover, rgba(0,0,0,0.03)))",boxShadow:"var(--seekora-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08))"}:{},T=p.length>0?t.createElement("div",{style:{position:"relative",overflow:"hidden",borderRadius:4,...b?{minWidth:x,flexBasis:"20%",maxWidth:E,flexShrink:0}:{}}},t.createElement(kt,{images:p,variant:i,alt:String(m),className:"seekora-item-card-image"}),c&&c.length>0&&d?.startsWith("overlay")&&t.createElement(zt,{buttons:c,position:"overlay-top-right"===d?"top-right":"bottom-center",showLabels:u,size:"small"})):t.createElement("div",{className:"seekora-item-card-placeholder",style:{...At,...b?{minWidth:x,flexBasis:"20%",maxWidth:E,height:w,flexShrink:0}:{}},"aria-hidden":!0}),M=t.createElement("div",{style:b?{display:"flex",flexDirection:"column",gap:R,flex:1,minWidth:0}:void 0},t.createElement("span",{className:"seekora-item-card-title",style:{fontSize:S,fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:b?2:3,WebkitBoxOrient:"vertical"}},String(m)),g?t.createElement("span",{className:"seekora-item-card-description",style:{fontSize:C,color:"inherit",opacity:.6,lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:N,WebkitBoxOrient:"vertical",overflow:"hidden"}},String(g)):null,c&&c.length>0&&"inline"===d&&t.createElement(zt,{buttons:c,position:"inline",showLabels:u,size:"small",layout:"horizontal"})),A=b?t.createElement("div",{style:{display:"flex",gap:y,alignItems:"flex-start"}},T,M):t.createElement(t.Fragment,null,T,M),_={className:I("seekora-item-card",b&&"seekora-item-card--horizontal",v&&"seekora-item-card--hover",o),style:{...Mt,...b?{flexDirection:"row"}:{},...z,...n},"data-position":r,onClick:a,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),onMouseDown:a?e=>{e.preventDefault(),a()}:void 0};return s&&f?t.createElement("a",{href:f,..._,"data-item-id":e.id},A):t.createElement("button",{type:"button",..._,"data-item-id":e.id},A)}const $t=12;function Lt({items:e,onItemClick:r,getItemId:a=e=>e.id,getItemTitle:o=e=>e.title,getItemImage:n=e=>e.image,getItemDescription:s=e=>e.description,getItemUrl:i=e=>e.url,renderItem:l,maxItems:c=24,columns:d=4,className:u,style:p,gridClassName:m}){const g=q(d),f=O($t),h=j($t),y=e.slice(0,c);if(0===y.length)return null;const b={display:"grid",gap:f,padding:h,gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`};return t.createElement("div",{className:I("seekora-item-grid",u),style:p},t.createElement("div",{className:I("seekora-item-grid-inner",m),style:b},y.map((e,c)=>{if(l)return t.createElement(t.Fragment,{key:a(e)},l(e,c));const d=function(e,t,r,a,o,n){return{id:t(e),title:r(e),image:a?.(e),description:o?.(e),url:n?.(e),..."object"==typeof e&&null!==e?e:{}}}(e,a,o,n,s,i);return t.createElement(_t,{key:d.id,item:d,position:c,onSelect:r?()=>r(e,c):void 0})})))}const Pt=(e,t)=>{if(e&&t)return t.split(".").reduce((e,t)=>{if(null!=e)return e[t]},e)},Dt=(e,t={query:"query"})=>({query:Pt(e,t.query)??"",count:t.count?Pt(e,t.count):void 0,id:t.id?Pt(e,t.id):e?.objectID||e?.id,categories:t.categories?Pt(e,t.categories):void 0,highlighted:t.highlighted?Pt(e,t.highlighted):void 0,_raw:e}),Ft=(e,t={id:"id",title:"title"})=>({id:Pt(e,t.id)??e?.objectID??e?.id,title:Pt(e,t.title)??"",image:t.image?Pt(e,t.image):void 0,price:t.price?Pt(e,t.price):void 0,comparePrice:t.comparePrice?Pt(e,t.comparePrice):void 0,url:t.url?Pt(e,t.url):void 0,brand:t.brand?Pt(e,t.brand):void 0,category:t.category?Pt(e,t.category):void 0,rating:t.rating?Pt(e,t.rating):void 0,reviewCount:t.reviewCount?Pt(e,t.reviewCount):void 0,discount:t.discount?Pt(e,t.discount):void 0,inStock:t.inStock?Pt(e,t.inStock):void 0,currency:t.currency?Pt(e,t.currency):void 0,images:t.images?Pt(e,t.images):e?.images,originalPrice:t.originalPrice?Pt(e,t.originalPrice):e?.original_price??e?.compare_at_price,available:t.available?Pt(e,t.available):e?.available,options:t.options?Pt(e,t.options):e?.options,variants:t.variants?Pt(e,t.variants):e?.variants,tags:t.tags?Pt(e,t.tags):e?.tags,_raw:e}),Bt=(e,t={id:"id",label:"label"})=>({id:Pt(e,t.id)??e?.id,label:Pt(e,t.label)??"",count:t.count?Pt(e,t.count):void 0,icon:t.icon?Pt(e,t.icon):void 0,image:t.image?Pt(e,t.image):void 0,_raw:e}),Wt=(e,t={})=>{if(null==e)return"";const{currency:r="$",currencyPosition:a="before",priceDecimals:o=2}=t,n="string"==typeof e?parseFloat(e):e;if(isNaN(n))return String(e);const s=n.toLocaleString(void 0,{minimumFractionDigits:o,maximumFractionDigits:o});return"before"===a?`${r}${s}`:`${s}${r}`},qt=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(/[&<>"']/g,e=>t[e])},Ht=(e,r,a={})=>{if(!r||!e)return e;const{tag:o="mark",className:n,style:s}=a,i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(`(${i})`,"gi"),c=e.split(l);if(c.length<=1)return e;const d={backgroundColor:"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))",fontWeight:500,borderRadius:"2px",padding:"0 2px",...s};return c.map((e,r)=>l.test(e)?(l.lastIndex=0,t.createElement(o,{key:r,className:n,style:d},e)):(l.lastIndex=0,e))},Ot=(e,t)=>{const r=[];if(e)for(const t of e){const e=t.toLowerCase().trim();if(e.startsWith("badge:")||e.startsWith("badge: ")){const e=t.slice(t.indexOf(":")+1).trim();e&&r.push({text:e,type:"custom"})}else"new"===e||"new arrival"===e?r.push({text:"New",type:"new"}):"limited"!==e&&"limited edition"!==e||r.push({text:"Limited",type:"limited"})}if(t){const e=t.original_price??t.compare_at_price;if(e&&t.price&&e>t.price){const a=Math.round((e-t.price)/e*100);r.push({text:`${a}% Off`,type:"sale"})}}return t&&!1===t.available&&r.push({text:"Sold Out",type:"soldOut"}),r},jt=e=>{if(!e||0===e.length)return null;const t=e.map(e=>e.price).filter(e=>null!=e&&!isNaN(e));if(0===t.length)return null;const r=Math.min(...t),a=Math.max(...t);return r===a?null:{min:r,max:a}},Vt=(e,t,r,a)=>{const o=t.find(t=>t.name===e);if(!o)return[];const n=`option${t.indexOf(o)+1}`;return o.values.map(o=>{const s=r.some(r=>{if(r[n]!==o)return!1;if(!1===r.available)return!1;for(const[o,n]of Object.entries(a)){if(o===e)continue;const a=t.find(e=>e.name===o);if(!a)continue;if(r[`option${t.indexOf(a)+1}`]!==n)return!1}return!0});return{value:o,available:s}})},Ut=(e,t,r)=>t.find(t=>e.every((e,a)=>{const o=`option${a+1}`,n=r[e.name];return!n||t[o]===n}))??null,Kt=(e,t="seekora")=>{const r={};return e.primaryColor&&(r[`--${t}-primary`]=e.primaryColor),e.backgroundColor&&(r[`--${t}-bg-surface`]=e.backgroundColor),e.surfaceColor&&(r[`--${t}-bg-secondary`]=e.surfaceColor),e.textColor&&(r[`--${t}-text-primary`]=e.textColor),e.textSecondaryColor&&(r[`--${t}-text-secondary`]=e.textSecondaryColor),e.borderColor&&(r[`--${t}-border-color`]=e.borderColor),e.hoverColor&&(r[`--${t}-bg-hover`]=e.hoverColor),e.highlightColor&&(r[`--${t}-highlight-bg`]=e.highlightColor),e.successColor&&(r[`--${t}-success`]=e.successColor),e.errorColor&&(r[`--${t}-error`]=e.errorColor),e.fontFamily&&(r[`--${t}-font-family`]=e.fontFamily),e.fontSize&&(r[`--${t}-font-size`]="number"==typeof e.fontSize?`${e.fontSize}px`:e.fontSize),e.borderRadius&&(r[`--${t}-border-radius`]="number"==typeof e.borderRadius?`${e.borderRadius}px`:e.borderRadius),e.boxShadow&&(r[`--${t}-box-shadow`]=e.boxShadow),e.cssVariables&&Object.entries(e.cssVariables).forEach(([e,t])=>{r[e.startsWith("--")?e:`--${e}`]=t}),r},Qt=(...e)=>e.filter(Boolean).join(" "),Gt=(...e)=>Object.assign({},...e.filter(Boolean)),Xt="seekora_recent_searches",Yt=e=>{try{const t=e?`${Xt}_${e}`:Xt,r=localStorage.getItem(t);return r?JSON.parse(r):[]}catch{return[]}},Zt=(e,t)=>{try{const r=t?`${Xt}_${t}`:Xt;let a=Yt(t);return a=a.filter(t=>t!==e),a.unshift(e),a=a.slice(0,10),localStorage.setItem(r,JSON.stringify(a)),a}catch{return[]}},Jt=(e,t)=>{try{const r=t?`${Xt}_${t}`:Xt;let a=Yt(t);return a=a.filter(t=>t!==e),localStorage.setItem(r,JSON.stringify(a)),a}catch{return[]}},er=(e,t)=>{const r=e.getBoundingClientRect(),a=t.getBoundingClientRect();r.top<a.top?e.scrollIntoView({block:"start",behavior:"smooth"}):r.bottom>a.bottom&&e.scrollIntoView({block:"end",behavior:"smooth"})};class tr{constructor(e={}){this.cache=new Map,this.maxSize=e.maxSize??100,this.defaultTtl=e.defaultTtlMs??3e4}generateKey(e,t){const r=e.toLowerCase().trim();if(!t)return r;const a=Object.keys(t).sort().filter(e=>void 0!==t[e]&&null!==t[e]).map(e=>`${e}:${JSON.stringify(t[e])}`).join("|");return a?`${r}::${a}`:r}get(e){const t=this.cache.get(e);if(!t)return null;return Date.now()-t.timestamp>t.ttl?(this.cache.delete(e),null):t.data}set(e,t,r){if(this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(e,{data:t,timestamp:Date.now(),ttl:r??this.defaultTtl})}has(e){return null!==this.get(e)}clear(){this.cache.clear()}cleanup(){const e=Date.now();for(const[t,r]of this.cache.entries())e-r.timestamp>r.ttl&&this.cache.delete(t)}getStats(){return{size:this.cache.size,maxSize:this.maxSize}}}let rr=null;const ar=e=>(rr||(rr=new tr(e)),rr);function or({price:e,comparePrice:r,priceRange:a,currency:o="$",currencyPosition:n="before",priceDecimals:s=2,showDiscount:i=!0,className:l,style:c}){const d=e=>((e,t,r,a)=>{const o=e.toLocaleString(void 0,{minimumFractionDigits:a,maximumFractionDigits:a});return"before"===r?`${t}${o}`:`${o}${t}`})(e,o,n,s);if(a)return t.createElement("span",{className:I("seekora-price-display","seekora-price-range",l),style:c},d(a.min)," – ",d(a.max));if(null==e)return null;const u=null!=r&&r>e,p=u?Math.round((r-e)/r*100):0;return t.createElement("span",{className:I("seekora-price-display",l),style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap",...c}},t.createElement("span",{className:"seekora-price-current",style:{fontWeight:600}},d(e)),u&&t.createElement("span",{className:"seekora-price-compare",style:{textDecoration:"line-through",color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875em"}},d(r)),u&&i&&p>0&&t.createElement("span",{className:"seekora-price-discount",style:{color:"var(--seekora-error, #ef4444)",fontSize:"0.8125em",fontWeight:600}},"-",p,"%"))}const nr=4,sr=8,ir=4,lr={"top-left":{position:"absolute",top:sr,left:sr},"top-right":{position:"absolute",top:sr,right:sr},"bottom-left":{position:"absolute",bottom:sr,left:sr},"bottom-right":{position:"absolute",bottom:sr,right:sr},inline:{}},cr={sale:{bg:"var(--seekora-badge-sale-bg, #ef4444)",text:"var(--seekora-badge-sale-text, #fff)"},new:{bg:"var(--seekora-badge-new-bg, #3b82f6)",text:"var(--seekora-badge-new-text, #fff)"},soldOut:{bg:"var(--seekora-badge-soldout-bg, #6b7280)",text:"var(--seekora-badge-soldout-text, #fff)"},limited:{bg:"var(--seekora-badge-limited-bg, #f59e0b)",text:"var(--seekora-badge-limited-text, #fff)"},custom:{bg:"var(--seekora-badge-custom-bg, #111827)",text:"var(--seekora-badge-custom-text, #fff)"}};function dr({badges:e,maxBadges:r,position:a="top-left",className:o,style:n}){if(!e||0===e.length)return null;const s=r?e.slice(0,r):e;return t.createElement("div",{className:I("seekora-badge-list",o),style:{display:"flex",flexWrap:"wrap",gap:nr,zIndex:2,...lr[a],...n}},s.map((e,r)=>{const a=cr[e.type??"custom"];return t.createElement("span",{key:`${e.text}-${r}`,className:I("seekora-badge",e.type&&`seekora-badge--${"soldOut"===e.type?"sold-out":e.type}`),style:{display:"inline-block",padding:"2px 8px",borderRadius:ir,fontSize:"0.6875rem",fontWeight:600,lineHeight:1.2,backgroundColor:e.color??a.bg,color:e.textColor??a.text,whiteSpace:"nowrap"}},e.text)}))}const ur={small:14,medium:18,large:24},pr={small:"0.75rem",medium:"0.875rem",large:"1rem"};function mr({filled:e,half:r,size:a,color:o,emptyColor:n,interactive:s,onHover:i,onClick:l}){return r?t.createElement("span",{className:I("seekora-rating-star","seekora-rating-star--half",s&&"seekora-rating-star--interactive"),style:{position:"relative",display:"inline-block",width:a,height:a,cursor:s?"pointer":"default"},onMouseEnter:i,onClick:l},t.createElement("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",top:0,left:0}},t.createElement("defs",null,t.createElement("linearGradient",{id:"half-fill"},t.createElement("stop",{offset:"50%",stopColor:o}),t.createElement("stop",{offset:"50%",stopColor:n}))),t.createElement("path",{d:"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z",fill:"url(#half-fill)",stroke:o,strokeWidth:"1"}))):t.createElement("span",{className:I("seekora-rating-star",e?"seekora-rating-star--filled":"seekora-rating-star--empty",s&&"seekora-rating-star--interactive"),style:{display:"inline-block",width:a,height:a,cursor:s?"pointer":"default"},onMouseEnter:i,onClick:l},t.createElement("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:e?o:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z",stroke:e?o:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))}function gr({rating:e,reviewCount:r,variant:a="compact",size:o="medium",maxRating:n=5,showNumeric:s=!1,showHalfStars:i=!0,interactive:l=!1,onRatingChange:c,starColor:d="#f59e0b",emptyStarColor:u="#d1d5db",textColor:p="var(--seekora-text-secondary, #6b7280)",showReviewCount:m=!0,reviewCountFormat:g,className:f,style:h}){const[y,b]=t.useState(null),v=Math.max(0,Math.min(n,e)),k=l&&null!==y?y:v,x=ur[o],E=pr[o],w=e=>g?g(e):e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString(),S=()=>{const e=[];for(let r=1;r<=n;r++){const a=r<=Math.floor(k),o=i&&r===Math.ceil(k)&&k%1>=.25&&k%1<.75;e.push(t.createElement(mr,{key:r,filled:a,half:o,size:x,color:d,emptyColor:u,interactive:l,onHover:l?()=>b(r):void 0,onClick:l?()=>{b(null),c?.(r)}:void 0}))}return e},C=()=>{l&&b(null)};return"stars-only"===a?t.createElement("div",{className:I("seekora-rating-display","seekora-rating-display--stars-only",f),style:{display:"inline-flex",alignItems:"center",gap:2,...h},onMouseLeave:C},S()):"compact"===a?t.createElement("div",{className:I("seekora-rating-display","seekora-rating-display--compact",f),style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:E,...h},onMouseLeave:C},t.createElement("div",{style:{display:"inline-flex",alignItems:"center",gap:2}},S()),s&&t.createElement("span",{className:"seekora-rating-numeric",style:{fontWeight:600,color:p}},v.toFixed(1)),m&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-count",style:{color:p}},"(",w(r),")")):"full"===a?t.createElement("div",{className:I("seekora-rating-display","seekora-rating-display--full",f),style:{display:"flex",flexDirection:"column",gap:4,fontSize:E,...h},onMouseLeave:C},t.createElement("div",{style:{display:"flex",alignItems:"center",gap:6}},t.createElement("div",{style:{display:"inline-flex",alignItems:"center",gap:2}},S()),t.createElement("span",{className:"seekora-rating-numeric",style:{fontWeight:600,color:"var(--seekora-text-primary, #111827)"}},v.toFixed(1)),t.createElement("span",{className:"seekora-rating-max",style:{color:p}},"/ ",n)),m&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-text",style:{fontSize:"0.875em",color:p}},"Based on ",w(r)," ",1===r?"review":"reviews")):"inline"===a?t.createElement("div",{className:I("seekora-rating-display","seekora-rating-display--inline",f),style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:E,...h},onMouseLeave:C},t.createElement("span",{className:"seekora-rating-numeric",style:{fontWeight:600,color:"var(--seekora-text-primary, #111827)"}},v.toFixed(1)),t.createElement("div",{style:{display:"inline-flex",alignItems:"center",gap:2}},S()),m&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-count",style:{color:p}},"(",w(r),")")):null}const fr={black:"#000",white:"#fff",red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",orange:"#f97316",purple:"#a855f7",pink:"#ec4899",brown:"#92400e",grey:"#6b7280",gray:"#6b7280",navy:"#1e3a5f",beige:"#d4c5a9",cream:"#fffdd0",ivory:"#fffff0",khaki:"#c3b091",olive:"#808000",teal:"#0d9488",coral:"#ff7f50",maroon:"#800000",tan:"#d2b48c",charcoal:"#36454f",burgundy:"#800020",sage:"#9caf88",lavender:"#e6e6fa",mint:"#98fb98",rust:"#b7410e",plum:"#8e4585",slate:"#708090",indigo:"#4b0082",gold:"#ffd700",silver:"#c0c0c0",rose:"#ff007f",mauve:"#e0b0ff",wine:"#722f37",raven:"#0a0a0a",natural:"#f5f0e1",bone:"#e3dac9",sand:"#c2b280"};function hr({options:e,visibleOptions:r,maxValues:a=5,colorMap:o,selectedValues:n,variants:s,showAvailability:i=!0,onSwatchHover:l,onSwatchClick:c,className:d,style:u}){const[p,m]=t.useState(new Set),g=W(),f=g?20:14,h=g?"4px 10px":"1px 6px",y=g?"0.75rem":"0.6875rem",b=g?6:4;if(!e||0===e.length)return null;const v=r?e.filter(e=>r.includes(e.name)):e;if(0===v.length)return null;return t.createElement("div",{className:I("seekora-variant-swatches",d),style:{display:"flex",flexDirection:"column",gap:b,...u}},v.map(r=>{const d=(e=>{const t=e.toLowerCase();return"color"===t||"colour"===t||"colors"===t||"colours"===t})(r.name),u=p.has(r.name),v=u?r.values:r.values.slice(0,a),k=r.values.length-a,x=k>0,E=n?.[r.name];return t.createElement("div",{key:r.name,className:"seekora-variant-swatch-group",style:{display:"flex",alignItems:"center",gap:b,flexWrap:"wrap"}},v.map(a=>{const u=d?((e,t)=>{if(t?.[e])return t[e];const r=e.toLowerCase();return t?.[r]?t[r]:fr[r]??null})(a,o):null,p=E===a,m=!i||((e,t,r,a,o)=>{if(!a||0===a.length)return!0;const n=r.findIndex(t=>t.name===e);if(-1===n)return!0;const s=`option${n+1}`;return a.some(a=>{if(a[s]!==t)return!1;if(!1===a.available)return!1;if(o)for(const[t,n]of Object.entries(o)){if(t===e)continue;const o=r.findIndex(e=>e.name===t);if(-1!==o&&a[`option${o+1}`]!==n)return!1}return!0})})(r.name,a,e,s,n);return u?t.createElement("span",{key:a,className:I("seekora-variant-swatch","seekora-variant-swatch--color",p&&"seekora-variant-swatch--selected",!m&&"seekora-variant-swatch--unavailable"),title:`${a}${m?"":" (Unavailable)"}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:f,height:f,minWidth:f,minHeight:f,borderRadius:"50%",backgroundColor:u,border:p?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",outline:p?"2px solid var(--seekora-primary, #111827)":"none",outlineOffset:2,cursor:c&&m?"pointer":"not-allowed",flexShrink:0,boxShadow:p?"var(--seekora-swatch-ring, 0 0 0 1px #fff)":"none",opacity:m?1:.3,position:"relative"},onMouseEnter:()=>m&&l?.(r.name,a),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),m&&c?.(r.name,a)}},!m&&t.createElement("span",{style:{position:"absolute",top:"50%",left:"-2px",right:"-2px",height:1,backgroundColor:"var(--seekora-unavailable-line, #ef4444)",transform:"translateY(-50%) rotate(-45deg)"}})):t.createElement("span",{key:a,className:I("seekora-variant-swatch","seekora-variant-swatch--text",p&&"seekora-variant-swatch--selected",!m&&"seekora-variant-swatch--unavailable"),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:h,minHeight:g?32:24,fontSize:y,borderRadius:3,border:p?"1px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:p?"var(--seekora-primary, #111827)":"transparent",color:p?"var(--seekora-primary-text, #fff)":"var(--seekora-text-secondary, #6b7280)",cursor:c&&m?"pointer":"not-allowed",whiteSpace:"nowrap",fontWeight:p?600:400,opacity:m?1:.4,textDecoration:m?"none":"line-through"},onMouseEnter:()=>m&&l?.(r.name,a),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),m&&c?.(r.name,a)}},a)}),x&&t.createElement("button",{type:"button",className:"seekora-variant-swatch--overflow",onClick:e=>((e,t)=>{t.stopPropagation(),m(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})})(r.name,e),style:{fontSize:y,color:"var(--seekora-primary, #2563eb)",background:"none",border:"none",padding:g?"4px 8px":0,minHeight:g?32:"auto",cursor:"pointer",textDecoration:"underline",fontWeight:500}},u?"Show less":`+${k} more`))}))}const yr=4,br={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:yr,backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.04))"};function vr({images:e,title:r,imageVariant:a,aspectRatio:o,objectFit:n,enableZoom:s,zoomMode:i,zoomLevel:l}){const c=o?o.includes(":")?o.replace(":","/"):o:"1";return e.length>0?t.createElement("div",{className:"seekora-product-card__image",style:{position:"relative",overflow:"hidden",borderRadius:yr}},t.createElement(kt,{images:e,variant:e.length>1?a:"single",alt:r,className:"seekora-suggestions-product-card-image",style:{aspectRatio:c,...n?{objectFit:n}:{}},enableZoom:s,zoomMode:i,zoomLevel:l})):t.createElement("div",{className:"seekora-product-card__image seekora-suggestions-product-card-placeholder",style:{...br,aspectRatio:c,...n?{objectFit:n}:{}},"aria-hidden":!0})}function kr({images:e,title:r,price:a,product:o,imageVariant:n,displayConfig:s,enableImageZoom:i,imageZoomMode:l,imageZoomLevel:c}){const d=W(),u=d?"0.9375rem":"0.875rem",p=d?"0.9375rem":"0.875rem";return t.createElement(t.Fragment,null,t.createElement(vr,{images:e,title:r,imageVariant:n,aspectRatio:s.imageAspectRatio,objectFit:s.imageObjectFit,enableZoom:i,zoomMode:l,zoomLevel:c}),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:u,fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},r),null!=a&&!Number.isNaN(a)&&t.createElement("span",{className:"seekora-product-card__price seekora-suggestions-product-card-price",style:{fontSize:p,color:"inherit",opacity:.6}},o.currency??"$",a.toFixed(2)))}function xr({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,options:i,variants:l,product:c,imageVariant:d,displayConfig:u,onVariantHover:p,onVariantClick:m,selectedVariants:g,actionButtons:f,actionButtonsPosition:h,showActionLabels:y,enableImageZoom:b,imageZoomMode:v,imageZoomLevel:k}){const x=u,E=W(),w=E?6:4,S=E?"0.9375rem":"0.875rem",C=E?"0.8125rem":"0.75rem",R=E?"0.9375rem":"0.875rem",I=h?.startsWith("overlay");return t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"}},t.createElement(vr,{images:e,title:r,imageVariant:d,aspectRatio:x.imageAspectRatio,objectFit:x.imageObjectFit,enableZoom:b,zoomMode:v,zoomLevel:k}),!1!==x.showBadges&&s.length>0&&t.createElement(dr,{badges:s,position:"top-left",maxBadges:2}),f&&f.length>0&&I&&t.createElement(zt,{buttons:f,position:"overlay-top-right"===h?"top-right":"bottom-center",showLabels:y,size:"small"})),t.createElement("div",{className:"seekora-product-card__body",style:{display:"flex",flexDirection:"column",gap:w}},!1!==x.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:C,color:"inherit",opacity:.6,textTransform:"uppercase",letterSpacing:"0.02em"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:S,fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},r),t.createElement("div",{className:"seekora-product-card__price"},t.createElement(or,{price:a??void 0,comparePrice:o??void 0,currency:x.currency??c.currency,currencyPosition:x.currencyPosition,priceDecimals:x.priceDecimals,showDiscount:x.showDiscount,style:{fontSize:R}})),!1!==x.showVariants&&i.length>0&&t.createElement(hr,{options:i,visibleOptions:x.variantOptionsToShow,maxValues:x.maxVariantValues,selectedValues:g,variants:l,onSwatchHover:p,onSwatchClick:m}),f&&f.length>0&&!I&&t.createElement(zt,{buttons:f,position:"inline",showLabels:y,size:"small",layout:"horizontal"})))}function Er({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,priceRange:i,options:l,variants:c,product:d,imageVariant:u,displayConfig:p,onVariantHover:m,onVariantClick:g,selectedVariants:f,actionButtons:h,actionButtonsPosition:y,showActionLabels:b,enableImageZoom:v,imageZoomMode:k,imageZoomLevel:x}){const E=p,w=d.available,S=y?.startsWith("overlay");return t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"}},t.createElement(vr,{images:e,title:r,imageVariant:u,aspectRatio:E.imageAspectRatio,objectFit:E.imageObjectFit,enableZoom:v,zoomMode:k,zoomLevel:x}),!1!==E.showBadges&&s.length>0&&t.createElement(dr,{badges:s,position:"top-left"}),h&&h.length>0&&S&&t.createElement(zt,{buttons:h,position:"overlay-top-right"===y?"top-right":"bottom-center",showLabels:b,size:"small"})),t.createElement("div",{className:"seekora-product-card__body",style:{display:"flex",flexDirection:"column",gap:4}},!1!==E.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:"0.75rem",color:"inherit",opacity:.6,textTransform:"uppercase",letterSpacing:"0.02em"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis"}},r),!1!==E.showRating&&null!=d.rating&&t.createElement(gr,{rating:d.rating,reviewCount:d.reviewCount,variant:"compact",size:"small",showNumeric:!1,showReviewCount:!0,className:"seekora-product-card__rating"}),t.createElement("div",{className:"seekora-product-card__price"},E.showPriceRange&&i?t.createElement(or,{priceRange:i,currency:E.currency??d.currency,currencyPosition:E.currencyPosition,priceDecimals:E.priceDecimals,style:{fontSize:"0.875rem"}}):t.createElement(or,{price:a??void 0,comparePrice:o??void 0,currency:E.currency??d.currency,currencyPosition:E.currencyPosition,priceDecimals:E.priceDecimals,showDiscount:E.showDiscount,style:{fontSize:"0.875rem"}})),!1!==E.showVariants&&l.length>0&&t.createElement(hr,{options:l,visibleOptions:E.variantOptionsToShow,maxValues:E.maxVariantValues,selectedValues:f,variants:c,onSwatchHover:m,onSwatchClick:g}),!1!==E.showStock&&null!=w&&t.createElement("span",{className:"seekora-product-card__stock",style:{fontSize:"0.75rem",color:w?"var(--seekora-success, #22c55e)":"var(--seekora-error, #ef4444)"}},w?"In Stock":"Out of Stock"),h&&h.length>0&&!S&&t.createElement(zt,{buttons:h,position:"inline",showLabels:b,size:"small",layout:"horizontal"})))}function wr({images:e,title:r,price:a,product:o,imageVariant:n,displayConfig:s,enableImageZoom:i,imageZoomMode:l,imageZoomLevel:c}){return t.createElement(t.Fragment,null,t.createElement(vr,{images:e,title:r,imageVariant:n,aspectRatio:s.imageAspectRatio??"1:1",enableZoom:i,zoomMode:l,zoomLevel:c}),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.8125rem",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},r),null!=a&&!Number.isNaN(a)&&t.createElement("span",{className:"seekora-product-card__price",style:{fontSize:"0.8125rem",color:"inherit",opacity:.6}},o.currency??"$",a.toFixed(2)))}function Sr({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,options:i,variants:l,product:c,imageVariant:d,displayConfig:u,onVariantHover:p,onVariantClick:m,selectedVariants:g,actionButtons:f,actionButtonsPosition:h,showActionLabels:y,enableImageZoom:b,imageZoomMode:v,imageZoomLevel:k}){const x=u,E=W(),w=O(12),S=E?6:4,C=E?60:80,R=E?100:120,I=E?"20%":"25%",N=E?"0.6875rem":"0.75rem";return t.createElement("div",{style:{display:"flex",gap:w,alignItems:"flex-start"}},t.createElement("div",{style:{position:"relative",minWidth:C,flexBasis:I,maxWidth:R,flexShrink:0}},t.createElement(vr,{images:e,title:r,imageVariant:d,aspectRatio:"1:1",enableZoom:b,zoomMode:v,zoomLevel:k}),!1!==x.showBadges&&s.length>0&&t.createElement(dr,{badges:s,position:"top-left",maxBadges:1}),f&&f.length>0&&h?.startsWith("overlay")&&t.createElement(zt,{buttons:f,position:"overlay-top-right"===h?"top-right":"bottom-center",showLabels:y,size:"small"})),t.createElement("div",{className:"seekora-product-card__body",style:{display:"flex",flexDirection:"column",gap:S,flex:1,minWidth:0}},!1!==x.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:N,color:"inherit",opacity:.6,textTransform:"uppercase"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:E?3:2,WebkitBoxOrient:"vertical"}},r),t.createElement("div",{className:"seekora-product-card__price"},t.createElement(or,{price:a??void 0,comparePrice:o??void 0,currency:x.currency??c.currency,currencyPosition:x.currencyPosition,priceDecimals:x.priceDecimals,showDiscount:x.showDiscount,style:{fontSize:"0.875rem"}})),!1!==x.showVariants&&i.length>0&&t.createElement(hr,{options:i,visibleOptions:x.variantOptionsToShow,maxValues:x.maxVariantValues??3,selectedValues:g,variants:l,onSwatchHover:p,onSwatchClick:m}),f&&f.length>0&&"inline"===h&&t.createElement(zt,{buttons:f,position:"inline",showLabels:y,size:"small",layout:"horizontal"})))}const Cr="150ms ease-in-out",Rr={display:"flex",flexDirection:"column",gap:8,padding:8,cursor:"pointer",border:"none",borderRadius:`var(--seekora-border-radius, ${6}px)`,backgroundColor:"transparent",textAlign:"left",transition:`background-color ${Cr}, box-shadow ${Cr}`},Ir={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.04))"};function Nr({product:e,position:r,section:a,tabId:o,onSelect:n,className:s,style:i,imageVariant:l="single",displayConfig:c,onVariantHover:d,onVariantClick:u,selectedVariants:p,asLink:m,actionButtons:g,actionButtonsPosition:f="inline",showActionLabels:h=!1,enableImageZoom:y=!1,imageZoomMode:b="both",imageZoomLevel:v=2.5}){const k=t.useMemo(()=>p&&e.options&&e.variants?Ut(e.options,e.variants,p):null,[p,e.options,e.variants]),x=t.useMemo(()=>k?.image?[k.image]:e.images?.length?e.images:e.image??e.imageUrl?[String(e.image??e.imageUrl)]:[],[k,e]),E=t.useMemo(()=>k?.title&&k.title!==e.title?`${e.title??e.name??""} - ${k.title}`:e.title??e.name??"",[k,e]),w=t.useMemo(()=>{const t=k?.price;if(null!=t)return"number"==typeof t?t:Number(t);const r=e.price;return null!=r?"number"==typeof r?r:Number(r):null},[k,e.price]),S=t.useMemo(()=>{const t=k?.comparePrice;if(null!=t)return"number"==typeof t?t:Number(t);const r=e.original_price??e.compare_at_price;return null!=r?"number"==typeof r?r:Number(r):null},[k,e]),C=x,R=E,N=w,[z,T]=t.useState(!1),M=z?{backgroundColor:"var(--seekora-card-hover-bg, var(--seekora-bg-hover, rgba(0,0,0,0.03)))",boxShadow:"var(--seekora-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08))"}:{};if(!c)return t.createElement("div",{role:"button",tabIndex:0,className:I("seekora-suggestions-product-card",z&&"seekora-suggestions-product-card--hover",s),style:{...Rr,...M,...i},onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onClick:()=>n(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n())},"data-position":r,"data-section":a,"data-tab-id":o},C.length>0?t.createElement(kt,{images:C,variant:l,alt:R,className:"seekora-suggestions-product-card-image",enableZoom:y,zoomMode:b,zoomLevel:v}):t.createElement("div",{className:"seekora-suggestions-product-card-placeholder",style:Ir,"aria-hidden":!0}),t.createElement("span",{className:"seekora-suggestions-product-card-title",style:{fontSize:"0.875rem",fontWeight:500}},R),null==N||Number.isNaN(N)?null:t.createElement("span",{className:"seekora-suggestions-product-card-price",style:{fontSize:"0.875rem",color:"inherit",opacity:.6}},e.currency??"$",N.toFixed(2)));const A=c.style??"minimal",_=S,$=e.brand??null,L=e.options??[],P=e.variants??[],D=t.useMemo(()=>!1===c.showBadges?[]:c.badgeExtractor?c.badgeExtractor(e.tags,e):Ot(e.tags,e),[c,e]),F=t.useMemo(()=>c.showPriceRange?jt(e.variants):null,[c.showPriceRange,e.variants]),B={product:e,images:C,title:R,price:N,comparePrice:_,brand:$,badges:D,priceRange:F,options:L,variants:P,displayConfig:c,imageVariant:l,onVariantHover:d,onVariantClick:u,selectedVariants:p,actionButtons:g,actionButtonsPosition:f,showActionLabels:h,enableImageZoom:y,imageZoomMode:b,imageZoomLevel:v},W={minimal:kr,standard:xr,detailed:Er,compact:wr,horizontal:Sr}[A]??kr,q=I("seekora-product-card",`seekora-product-card--${A}`,"seekora-suggestions-product-card",z&&"seekora-product-card--hover",s),H={...Rr,..."horizontal"===A?{flexDirection:"row"}:{},...M,...i};return m&&e.url?t.createElement("a",{href:e.url,className:q,style:{...H,textDecoration:"none",color:"inherit"},onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onClick:e=>{e.preventDefault(),n()},"data-position":r,"data-section":a,"data-tab-id":o},t.createElement(W,{...B})):t.createElement("div",{role:"button",tabIndex:0,className:q,style:H,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onClick:()=>n(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n())},"data-position":r,"data-section":a,"data-tab-id":o},t.createElement(W,{...B}))}function zr({maxItems:e=8,source:r="trending",columns:a=4,className:o,style:n,gridClassName:s,displayConfig:i,onVariantHover:l}){const{trendingProducts:c,filteredTabs:d,activeTabId:u,selectProduct:p,getAllNavigableItems:m}=et(),g=q(a),f=O(12),h=j(12),y=t.useMemo(()=>{if("trending"===r)return c;const e=d.find(e=>e.id===("tab"===r?u:r));return e?.products??[]},[r,u,c,d]).slice(0,e),b=m().findIndex(e=>"product"===e.type);if(0===y.length)return null;const v={display:"grid",gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`,gap:f,padding:h};return t.createElement("div",{className:I("seekora-suggestions-product-grid",o),style:n},t.createElement("div",{className:I("seekora-suggestions-product-grid-inner",s),style:v},y.map((e,a)=>{const o=b>=0?b+a:a,n="trending"===r?"products":"filtered_tab",s="trending"!==r?"tab"===r?u:r:void 0;return t.createElement(Nr,{key:e.id??e.objectID??a,product:e,position:o,section:n,tabId:s,onSelect:()=>p(e,o,n,s),displayConfig:i,onVariantHover:l})})))}function Tr({className:e,style:r,tabClassName:a}){const{filteredTabs:o,activeTabId:n,setActiveTab:s}=et();return 0===o.length?null:t.createElement("div",{className:I("seekora-suggestions-categories-tabs",e),style:{display:"flex",gap:4,padding:"8px 12px",borderBottom:"1px solid var(--seekora-border-color, #e5e7eb)",overflowX:"auto",...r},role:"tablist"},o.map(e=>{const r=n===e.id;return t.createElement("button",{key:e.id,type:"button",role:"tab","aria-selected":r,className:I("seekora-suggestions-tab",r&&"seekora-suggestions-tab--active",a),style:{padding:"8px 12px",border:"none",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:r?"var(--seekora-primary-light, rgba(59, 130, 246, 0.1))":"transparent",color:r?"var(--seekora-primary, #3b82f6)":"inherit",cursor:"pointer",fontSize:"0.875rem",fontWeight:r?600:400,whiteSpace:"nowrap",transition:"background-color 120ms ease"},onClick:()=>s(e)},e.label)}))}const Mr={padding:"10px 12px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"inherit",transition:"background-color 120ms ease"};function Ar({search:e,onSelect:r}){const[a,o]=t.useState(!1);return t.createElement("li",null,t.createElement("button",{type:"button",className:I("seekora-suggestions-recent-item",a&&"seekora-suggestions-recent-item--hover"),style:{...Mr,...a?{backgroundColor:"var(--seekora-bg-hover, rgba(0,0,0,0.05))"}:{}},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onMouseDown:e=>{e.preventDefault(),r()}},e.query))}function _r({title:e="Recent",maxItems:r=8,className:a,style:o,listClassName:n,renderItem:s}){const{recentSearches:i,query:l,selectRecentSearch:c}=et(),d=i.slice(0,r);return 0===d.length?null:t.createElement("div",{className:I("seekora-suggestions-recent-list",a),style:o},e?t.createElement("div",{className:"seekora-suggestions-recent-title",style:{padding:"8px 12px",fontSize:"0.75rem",fontWeight:600,color:"inherit",opacity:.6,textTransform:"uppercase"}},e):null,t.createElement("ul",{className:I("seekora-suggestions-recent-ul",n),style:{margin:0,padding:0,listStyle:"none"}},d.map((e,r)=>{const a=()=>c(e);return s?t.createElement("li",{key:`${e.query}-${e.timestamp}`},s(e,r,a)):t.createElement(Ar,{key:`${e.query}-${e.timestamp}`,search:e,onSelect:a})})))}const $r={padding:"10px 12px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"inherit",transition:"background-color 120ms ease"};function Lr({trending:e,onSelect:r}){const[a,o]=t.useState(!1);return t.createElement("li",null,t.createElement("button",{type:"button",className:I("seekora-suggestions-trending-item",a&&"seekora-suggestions-trending-item--hover"),style:{...$r,...a?{backgroundColor:"var(--seekora-bg-hover, rgba(0,0,0,0.05))"}:{}},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onMouseDown:e=>{e.preventDefault(),r()}},e.query,null!=e.count?t.createElement("span",{style:{marginLeft:8,color:"inherit",opacity:.6,fontSize:"0.875em"}},e.count):null))}function Pr({title:e="Trending",maxItems:r=8,className:a,style:o,listClassName:n,renderItem:s}){const{trendingSearches:i,selectTrendingSearch:l}=et(),c=i.slice(0,r);return 0===c.length?null:t.createElement("div",{className:I("seekora-suggestions-trending-list",a),style:o},e?t.createElement("div",{className:"seekora-suggestions-trending-title",style:{padding:"8px 12px",fontSize:"0.75rem",fontWeight:600,color:"inherit",opacity:.6,textTransform:"uppercase"}},e):null,t.createElement("ul",{className:I("seekora-suggestions-trending-ul",n),style:{margin:0,padding:0,listStyle:"none"}},c.map((e,r)=>{const a=()=>l(e,r);return s?t.createElement("li",{key:`${e.query}-${r}`},s(e,r,a)):t.createElement(Lr,{key:`${e.query}-${r}`,trending:e,onSelect:a})})))}function Dr({className:e,style:r,render:a}){const{error:o}=et();return o?a?t.createElement(t.Fragment,null,a(o)):t.createElement("div",{className:I("seekora-suggestions-error",e),style:{padding:16,color:"var(--seekora-error, #dc2626)",fontSize:"0.875rem",...r}},o.message):null}const Fr={black:"#000",white:"#fff",red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",orange:"#f97316",purple:"#a855f7",pink:"#ec4899",brown:"#92400e",grey:"#6b7280",gray:"#6b7280",navy:"#1e3a5f",beige:"#d4c5a9",cream:"#fffdd0",ivory:"#fffff0",teal:"#0d9488",coral:"#ff7f50",maroon:"#800000",charcoal:"#36454f",sage:"#9caf88",lavender:"#e6e6fa",mint:"#98fb98",rust:"#b7410e",plum:"#8e4585",slate:"#708090",indigo:"#4b0082",gold:"#ffd700",silver:"#c0c0c0",rose:"#ff007f",raven:"#0a0a0a",natural:"#f5f0e1",bone:"#e3dac9",sand:"#c2b280",olive:"#808000",khaki:"#c3b091",burgundy:"#800020",wine:"#722f37",mauve:"#e0b0ff",tan:"#d2b48c"},Br=(e,t,r,a,o)=>{const n=r.findIndex(t=>t.name===e);if(-1===n)return!0;const s=`option${n+1}`;return a.some(a=>{if(a[s]!==t)return!1;if(!1===a.available)return!1;for(const[t,n]of Object.entries(o)){if(t===e)continue;const o=r.findIndex(e=>e.name===t);if(-1===o)continue;if(a[`option${o+1}`]!==n)return!1}return!0})};function Wr({options:e,variants:r,selections:a,onSelectionChange:o,optionRenderModes:n,dropdownThreshold:s=8,colorMap:i,showAvailability:l=!0,selectedVariant:c,className:d,style:u}){if(!e||0===e.length)return null;return t.createElement("div",{className:I("seekora-variant-selector",d),style:{display:"flex",flexDirection:"column",gap:16,...u}},e.map(c=>{const d=(e=>n?.[e.name]?n[e.name]:(e=>{const t=e.toLowerCase();return"color"===t||"colour"===t||"colors"===t||"colours"===t})(e.name)?"swatch":e.values.length>s?"dropdown":"button")(c),u=a[c.name];return t.createElement("div",{key:c.name,className:"seekora-variant-option-group"},t.createElement("label",{className:"seekora-variant-option-label",style:{display:"block",fontSize:"0.875rem",fontWeight:600,marginBottom:8,color:"var(--seekora-text-primary, inherit)"}},c.name,u&&t.createElement("span",{style:{fontWeight:400,marginLeft:6,color:"var(--seekora-text-secondary, inherit)"}},u)),"dropdown"===d?t.createElement("div",{onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},t.createElement(V,{className:"seekora-variant-dropdown",value:u??"",onChange:e=>o(c.name,e),placeholder:`Select ${c.name}`,"aria-label":`Select ${c.name}`,options:c.values.map(t=>{const o=!l||Br(c.name,t,e,r,a);return{value:t,label:o?t:`${t} (Unavailable)`,disabled:!o}}),style:{minWidth:120,"--seekora-select-border":"var(--seekora-border-color, rgba(128,128,128,0.2))","--seekora-select-bg":"var(--seekora-bg-surface, transparent)","--seekora-select-color":"var(--seekora-text-primary, inherit)"}})):t.createElement("div",{className:"seekora-variant-buttons",style:{display:"flex",flexWrap:"wrap",gap:8}},c.values.map(n=>{const s=u===n,p=!l||Br(c.name,n,e,r,a),m="swatch"===d?((e,t)=>{if(t?.[e])return t[e];const r=e.toLowerCase();return t?.[r]?t[r]:Fr[r]??null})(n,i):null;return"swatch"===d&&m?t.createElement("button",{key:n,type:"button",className:I("seekora-variant-color-swatch",s&&"seekora-variant-button--active",!p&&"seekora-variant-button--unavailable"),title:n,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),o(c.name,n)},disabled:!p,style:{width:32,height:32,borderRadius:"50%",backgroundColor:m,border:s?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",outline:s?"2px solid var(--seekora-primary, #111827)":"none",outlineOffset:2,cursor:p?"pointer":"not-allowed",opacity:p?1:.4,position:"relative",padding:0},"aria-label":`${c.name}: ${n}`,"aria-pressed":s}):t.createElement("button",{key:n,type:"button",className:I("seekora-variant-button",s&&"seekora-variant-button--active",!p&&"seekora-variant-button--unavailable"),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),o(c.name,n)},disabled:!p,style:{padding:"6px 16px",fontSize:"0.875rem",borderRadius:6,border:s?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:s?"var(--seekora-primary, #111827)":"var(--seekora-bg-surface, transparent)",color:s?"transparent":"var(--seekora-text-primary, inherit)",cursor:p?"pointer":"not-allowed",opacity:p?1:.5,textDecoration:p?"none":"line-through",fontWeight:s?600:400,transition:"all 120ms ease"},"aria-label":`${c.name}: ${n}`,"aria-pressed":s},n)})))}))}const qr=t.createContext(null);const Hr=t.createContext(null);function Or(){const e=t.useContext(Hr);if(!e){const e=new Error("useSectionSearchContext must be used within a SectionSearchProvider");throw u("SectionSearchContext: not available",{error:e.message}),e}return e}function jr({className:e,style:r,render:a}){const{error:o}=Or();return o?a?t.createElement(t.Fragment,null,a(o)):t.createElement("div",{className:e,style:{padding:16,color:"var(--seekora-error,#dc2626)",fontSize:"0.875rem",...r}},o.message):null}const Vr={xs:0,sm:480,md:768,lg:1024,xl:1280},Ur={xs:`@media (max-width: ${Vr.sm-1}px)`,sm:`@media (min-width: ${Vr.sm}px) and (max-width: ${Vr.md-1}px)`,md:`@media (min-width: ${Vr.md}px) and (max-width: ${Vr.lg-1}px)`,lg:`@media (min-width: ${Vr.lg}px) and (max-width: ${Vr.xl-1}px)`,xl:`@media (min-width: ${Vr.xl}px)`,mobile:`@media (max-width: ${Vr.md-1}px)`,tablet:`@media (min-width: ${Vr.md}px) and (max-width: ${Vr.lg-1}px)`,desktop:`@media (min-width: ${Vr.lg}px)`,touch:"@media (hover: none) and (pointer: coarse)",mouse:"@media (hover: hover) and (pointer: fine)"},Kr={minimum:44,comfortable:48,large:56},Qr=()=>{const[e,r]=t.useState({isMobile:!1,isTablet:!1,isDesktop:!0,isTouch:!1,width:"undefined"!=typeof window?window.innerWidth:1024,height:"undefined"!=typeof window?window.innerHeight:768,breakpoint:"lg"});return t.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth,t=window.innerHeight,a=(e=>e<Vr.sm?"xs":e<Vr.md?"sm":e<Vr.lg?"md":e<Vr.xl?"lg":"xl")(e),o="ontouchstart"in window||navigator.maxTouchPoints>0;r({isMobile:e<Vr.md,isTablet:e>=Vr.md&&e<Vr.lg,isDesktop:e>=Vr.lg,isTouch:o,width:e,height:t,breakpoint:a})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e};let Gr=!1;const Xr=()=>{if(Gr)return;if("undefined"==typeof document)return;const e="seekora-dropdown-responsive-global";if(document.getElementById(e))return void(Gr=!0);const t=document.createElement("style");t.id=e,t.textContent='\n/* ============================================\n SEEKORA DROPDOWN - RESPONSIVE STYLES\n ============================================ */\n\n/* CSS Variables for responsiveness */\n:root {\n --seekora-touch-target-min: 44px;\n --seekora-touch-target-comfortable: 48px;\n --seekora-mobile-padding: 16px;\n --seekora-desktop-padding: 20px;\n}\n\n/* Base responsive rules for all dropdowns */\n[class*="seekora-"][class*="-dropdown"] {\n box-sizing: border-box;\n}\n\n[class*="seekora-"][class*="-dropdown"] * {\n box-sizing: border-box;\n}\n\n/* ============================================\n MOBILE STYLES (< 768px)\n ============================================ */\n@media (max-width: 767px) {\n /* Full-width dropdowns on mobile */\n [class*="seekora-"][class*="-dropdown"]:not(.seekora-mobile-sheet):not(.seekora-spotlight-dropdown) {\n width: 100% !important;\n max-width: 100vw !important;\n left: 0 !important;\n right: 0 !important;\n border-radius: 0 !important;\n margin: 0 !important;\n }\n\n /* Touch-friendly item sizes */\n [class*="seekora-"][class*="-dropdown"] [role="option"],\n [class*="seekora-"][class*="-dropdown"] [data-item],\n [class*="seekora-"][class*="-dropdown"] .suggestion-item,\n [class*="seekora-"][class*="-dropdown"] .product-card {\n min-height: var(--seekora-touch-target-min);\n }\n\n /* Larger padding on mobile */\n [class*="seekora-"][class*="-dropdown"] [role="option"],\n [class*="seekora-"][class*="-dropdown"] [data-item] {\n padding: 14px var(--seekora-mobile-padding) !important;\n }\n\n /* Larger fonts on mobile for readability */\n [class*="seekora-"][class*="-dropdown"] {\n font-size: 16px !important;\n }\n\n /* Stack columns on mobile */\n [class*="seekora-"][class*="-dropdown"] .dropdown-content,\n [class*="seekora-"][class*="-dropdown"] [style*="display: flex"][style*="flex-direction"] {\n flex-direction: column !important;\n }\n\n /* Full-width columns on mobile */\n [class*="seekora-"][class*="-dropdown"] [style*="width: 40%"],\n [class*="seekora-"][class*="-dropdown"] [style*="width: 45%"],\n [class*="seekora-"][class*="-dropdown"] [style*="width: 50%"],\n [class*="seekora-"][class*="-dropdown"] [style*="width: 55%"],\n [class*="seekora-"][class*="-dropdown"] [style*="width: 60%"] {\n width: 100% !important;\n flex: none !important;\n }\n\n /* Product grid adjustments */\n [class*="seekora-"][class*="-dropdown"] .products-grid,\n [class*="seekora-"][class*="-dropdown"] [style*="grid-template-columns"] {\n grid-template-columns: repeat(2, 1fr) !important;\n gap: 12px !important;\n }\n\n /* Horizontal scroll for products on mobile */\n [class*="seekora-"][class*="-dropdown"] .products-scroll {\n display: flex !important;\n overflow-x: auto !important;\n scroll-snap-type: x mandatory !important;\n -webkit-overflow-scrolling: touch !important;\n padding-bottom: 8px !important;\n }\n\n [class*="seekora-"][class*="-dropdown"] .products-scroll > * {\n scroll-snap-align: start !important;\n flex-shrink: 0 !important;\n }\n\n /* Hide keyboard hints on mobile */\n [class*="seekora-"][class*="-dropdown"] .keyboard-hint,\n [class*="seekora-"][class*="-dropdown"] [class*="keyboard"],\n [class*="seekora-"][class*="-dropdown"] kbd,\n [class*="seekora-"][class*="-dropdown"] .kbd {\n display: none !important;\n }\n\n /* Safe area padding for notched devices */\n [class*="seekora-"][class*="-dropdown"] [style*="padding-bottom"] {\n padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;\n }\n}\n\n/* ============================================\n TOUCH DEVICE STYLES\n ============================================ */\n@media (hover: none) and (pointer: coarse) {\n /* Active state instead of hover for touch */\n [class*="seekora-"][class*="-dropdown"] [role="option"]:active,\n [class*="seekora-"][class*="-dropdown"] [data-item]:active,\n [class*="seekora-"][class*="-dropdown"] button:active {\n background-color: var(--seekora-bg-hover, rgba(0,0,0,0.05)) !important;\n transform: scale(0.98);\n }\n\n /* Disable hover effects on touch */\n [class*="seekora-"][class*="-dropdown"] [role="option"]:hover,\n [class*="seekora-"][class*="-dropdown"] [data-item]:hover {\n background-color: transparent;\n }\n\n /* Larger touch targets */\n [class*="seekora-"][class*="-dropdown"] button,\n [class*="seekora-"][class*="-dropdown"] [role="button"] {\n min-height: var(--seekora-touch-target-min);\n min-width: var(--seekora-touch-target-min);\n }\n\n /* No text selection on touch */\n [class*="seekora-"][class*="-dropdown"] {\n -webkit-user-select: none;\n user-select: none;\n }\n}\n\n/* ============================================\n TABLET STYLES (768px - 1023px)\n ============================================ */\n@media (min-width: 768px) and (max-width: 1023px) {\n [class*="seekora-"][class*="-dropdown"]:not(.seekora-mobile-sheet) {\n max-width: 90vw !important;\n margin-left: auto !important;\n margin-right: auto !important;\n }\n\n /* 3-column product grid on tablet */\n [class*="seekora-"][class*="-dropdown"] .products-grid {\n grid-template-columns: repeat(3, 1fr) !important;\n }\n}\n\n/* ============================================\n DESKTOP STYLES (>= 1024px)\n ============================================ */\n@media (min-width: 1024px) {\n [class*="seekora-"][class*="-dropdown"] [role="option"],\n [class*="seekora-"][class*="-dropdown"] [data-item] {\n min-height: 40px;\n }\n\n /* Hover effects only on desktop */\n [class*="seekora-"][class*="-dropdown"] [role="option"]:hover,\n [class*="seekora-"][class*="-dropdown"] [data-item]:hover {\n background-color: var(--seekora-bg-hover, rgba(0,0,0,0.04));\n }\n}\n\n/* ============================================\n ANIMATION & TRANSITIONS\n ============================================ */\n@keyframes seekora-dropdown-enter {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes seekora-dropdown-enter-mobile {\n from {\n opacity: 0;\n transform: translateY(100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes seekora-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n[class*="seekora-"][class*="-dropdown"].entering {\n animation: seekora-dropdown-enter 200ms ease-out;\n}\n\n@media (max-width: 767px) {\n [class*="seekora-"][class*="-dropdown"].entering {\n animation: seekora-dropdown-enter-mobile 300ms ease-out;\n }\n}\n\n/* ============================================\n ACCESSIBILITY\n ============================================ */\n@media (prefers-reduced-motion: reduce) {\n [class*="seekora-"][class*="-dropdown"],\n [class*="seekora-"][class*="-dropdown"] * {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n\n/* Focus visible styles */\n[class*="seekora-"][class*="-dropdown"] [role="option"]:focus-visible,\n[class*="seekora-"][class*="-dropdown"] button:focus-visible {\n outline: 2px solid var(--seekora-primary, #007aff);\n outline-offset: -2px;\n}\n\n/* High contrast mode */\n@media (prefers-contrast: high) {\n [class*="seekora-"][class*="-dropdown"] {\n border: 2px solid currentColor !important;\n }\n\n [class*="seekora-"][class*="-dropdown"] [role="option"][aria-selected="true"] {\n outline: 2px solid currentColor;\n }\n}\n\n/* Dark mode adjustments */\n@media (prefers-color-scheme: dark) {\n [class*="seekora-"][class*="-dropdown"] {\n --seekora-bg-surface: #1c1c1e;\n --seekora-bg-secondary: #2c2c2e;\n --seekora-bg-hover: #3a3a3c;\n --seekora-text-primary: #ffffff;\n --seekora-text-secondary: #8e8e93;\n --seekora-border-color: #38383a;\n }\n}\n',document.head.appendChild(t),Gr=!0},Yr=()=>{t.useEffect(()=>{Xr()},[])},Zr=(e={},t=!1)=>({root:{position:"absolute",top:"100%",left:0,right:0,marginTop:"8px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #0f1111)",borderRadius:t?"12px":"16px",boxShadow:"0 4px 6px -1px rgba(0,0,0,0.1), 0 10px 40px -5px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",zIndex:1e3,...t&&{position:"fixed",top:"60px",bottom:0,left:"8px",right:"8px",margin:0,borderRadius:"16px 16px 0 0"}},content:{display:"flex",flexDirection:t?"column":"row",maxHeight:t?"calc(100vh - 140px)":"480px",overflowY:"auto"},leftColumn:{flex:t?"none":"0 0 55%",borderRight:t?"none":"1px solid var(--seekora-border-color, #e8e8e8)",borderBottom:t?"1px solid var(--seekora-border-color, #e8e8e8)":"none",overflowY:"auto",padding:"8px 0"},rightColumn:{flex:t?"none":"0 0 45%",backgroundColor:"var(--seekora-bg-secondary, #fafafa)",overflowY:"auto",padding:"8px 0"},section:{padding:"4px 0"},sectionHeader:{padding:"8px 16px 6px",fontSize:"11px",fontWeight:600,color:"var(--seekora-text-secondary, #6b6b6b)",textTransform:"uppercase",letterSpacing:"0.05em"},suggestionItem:{display:"flex",alignItems:"center",padding:t?"12px 16px":"10px 16px",cursor:"pointer",transition:"all 150ms ease",gap:t?"12px":"10px",minHeight:t?`${Kr.minimum}px`:"40px",borderRadius:"8px",margin:"2px 8px",color:"var(--seekora-text-primary, #0f1111)"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #0f1111)"},suggestionIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-tertiary, #6b6b6b)",flexShrink:0},suggestionContent:{flex:1,minWidth:0},suggestionQuery:{fontSize:"14px",color:"var(--seekora-text-primary, #0f1111)",fontWeight:400,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},suggestionContext:{fontSize:"12px",color:"var(--seekora-text-secondary, #565959)",marginTop:"2px"},suggestionDepartment:{color:"var(--seekora-primary-dark, #c45500)",fontStyle:"italic"},categoryScoped:{backgroundColor:"var(--seekora-primary-light, #fef8f0)",borderRadius:"3px",padding:"0 4px",marginLeft:"4px",fontSize:"11px",color:"var(--seekora-primary-dark, #c45500)"},productsHeader:{padding:"12px 16px 8px",display:"flex",alignItems:"center",justifyContent:"space-between"},productsTitle:{fontSize:"13px",fontWeight:700,color:"var(--seekora-text-primary, #0f1111)"},viewAll:{fontSize:"12px",color:"var(--seekora-link, #007185)",textDecoration:"none",cursor:"pointer","&:hover":{color:"var(--seekora-link-hover, #c45500)",textDecoration:"underline"}},productsGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"12px",padding:"12px 16px 16px"},productCard:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",borderRadius:"12px",padding:"10px",cursor:"pointer",transition:"all 200ms ease",boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},productCardHover:{boxShadow:"0 4px 12px rgba(0,0,0,0.12)",transform:"translateY(-2px)"},productImage:{width:"100%",aspectRatio:"1",objectFit:"contain",backgroundColor:"var(--seekora-bg-tertiary, #f8f8f8)",borderRadius:"8px",marginBottom:"10px"},productTitle:{fontSize:"12px",color:"var(--seekora-link, #007185)",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",marginBottom:"4px"},productPrice:{fontSize:"14px",fontWeight:500,color:"var(--seekora-text-primary, #0f1111)"},productPriceSymbol:{fontSize:"11px",verticalAlign:"top"},productRating:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px"},stars:{color:"var(--seekora-rating, #de7921)",fontSize:"12px"},reviewCount:{fontSize:"11px",color:"var(--seekora-link, #007185)"},prime:{height:"16px",marginTop:"4px"},recentHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px"},clearRecent:{fontSize:"12px",color:"var(--seekora-link, #007185)",cursor:"pointer",background:"none",border:"none",padding:0},highlight:{fontWeight:700,color:"var(--seekora-text-primary, #0f1111)"},empty:{padding:"40px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #565959)"},footer:{padding:"10px 16px",borderTop:"1px solid var(--seekora-border-color, #e7e7e7)",backgroundColor:"var(--seekora-bg-secondary, #f7f7f7)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",color:"var(--seekora-text-tertiary, #767676)"},keyboard:{display:"flex",alignItems:"center",gap:"8px"},key:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"18px",padding:"0 4px",backgroundColor:"var(--seekora-bg-surface, #fff)",border:"1px solid var(--seekora-border-color, #ccc)",borderRadius:"3px",fontSize:"10px",fontFamily:"monospace"}}),Jr=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("circle",{cx:"11",cy:"11",r:"8"}),t.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),ea=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("circle",{cx:"12",cy:"12",r:"10"}),t.createElement("polyline",{points:"12 6 12 12 16 14"})),ta=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18"}),t.createElement("polyline",{points:"17 6 23 6 23 12"})),ra=({rating:e,count:r})=>{const a=Math.floor(e),o=e%1>=.5;return t.createElement("div",{style:Zr().productRating},t.createElement("div",{style:Zr().stars},"★".repeat(a),o&&"½","☆".repeat(5-a-(o?1:0))),void 0!==r&&t.createElement("span",{style:Zr().reviewCount},"(",r.toLocaleString(),")"))},aa=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],categories:l=[],recentSearches:c=[],trendingSearches:d=[],filteredTabs:u=[],activeTab:p="all",suggestionFields:m={query:"query"},productFields:g={id:"id",title:"title"},categoryFields:f={id:"id",label:"label"},productDisplay:h={},theme:y={},showDepartments:b=!0,currentDepartment:v,departments:k=[],showPrime:x=!1,width:E="700px",maxHeight:w="500px",zIndex:S=1e3,className:C,style:R,classNames:I={},onSuggestionSelect:N,onProductClick:z,onCategoryClick:T,onTabChange:M,onRecentClick:A,onRecentRemove:_,onRecentClearAll:$,onViewAll:L,onClose:P,header:D,footer:F,renderEmpty:B}=e;Yr();const W=Qr(),{isMobile:q,isTablet:H}=W,O=t.useMemo(()=>Zr(y,q),[y,q]),j=t.useRef(null),[V,U]=t.useState(-1),[K,Q]=t.useState(null),G=t.useMemo(()=>s.map(e=>Dt(e,m)),[s,m]),X=t.useMemo(()=>{if("all"===p||0===u.length)return i;const e=u.find(e=>e.id===p);return e?.products||i},[p,u,i]),Y=t.useMemo(()=>X.map(e=>Ft(e,g)),[X,g]);t.useMemo(()=>l.map(e=>Bt(e,f)),[l,f]);const Z=t.useMemo(()=>c.map(e=>"string"==typeof e?e:e.query),[c]),J=t.useMemo(()=>{const e=[];let t=0;return 0===a.length&&Z.slice(0,5).forEach(r=>{e.push({type:"recent",data:r,index:t++})}),G.forEach(r=>{e.push({type:"suggestion",data:r,index:t++})}),e},[a,Z,G]),ee=t.useCallback(()=>{U(e=>Math.min(e+1,J.length-1))},[J.length]),te=t.useCallback(()=>{U(e=>Math.max(e-1,-1))},[]),re=t.useCallback(()=>{if(V<0||V>=J.length)return;const e=J[V];"recent"===e.type?A?.(e.data):"suggestion"===e.type&&N?.(e.data._raw,e.index)},[V,J,A,N]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>V,setActiveIndex:U,selectActive:re,navigateNext:ee,navigatePrevious:te,focus:()=>j.current?.focus(),close:()=>P?.()}),[V,re,ee,te,P]),t.useEffect(()=>{if(V>=0&&j.current){const e=j.current.querySelector(`[data-index="${V}"]`);e&&er(e,j.current)}},[V]),!o)return null;const ae=Kt(y),oe=0===a.length&&Z.length>0,ne=0===a.length&&d.length>0,se=Y.length>0;return t.createElement("div",{ref:j,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-amazon-dropdown",C,I.root),style:Gt(O.root,{width:q?"100%":E,maxHeight:q?"100vh":w,zIndex:S},ae,R),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n .seekora-amazon-dropdown mark {\n background: transparent;\n font-weight: 700;\n color: inherit;\n }\n "),D,t.createElement(t.Fragment,null,u.length>0&&t.createElement("div",{style:{display:"flex",gap:"8px",padding:q?"12px":"12px 16px",overflowX:"auto",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"var(--seekora-border-color, #e7e7e7)",background:"var(--seekora-bg-secondary, #f5f5f5)",WebkitOverflowScrolling:"touch"}},t.createElement("button",{onClick:()=>M?.("all"),style:{padding:"8px 16px",borderWidth:0,borderStyle:"none",background:"all"===p?"var(--seekora-text-primary, #232f3e)":"var(--seekora-bg-surface, #ffffff)",color:"all"===p?"var(--seekora-bg-surface, #ffffff)":"var(--seekora-text-primary, #0f1111)",borderRadius:"20px",fontSize:"13px",fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",minHeight:"36px",boxShadow:"all"===p?"none":"0 1px 3px rgba(0,0,0,0.1)",transition:"all 150ms ease"}},"All"),u.slice(0,6).map(e=>t.createElement("button",{key:e.id,onClick:()=>M?.(e.id),style:{padding:"8px 16px",borderWidth:0,borderStyle:"none",background:p===e.id?"var(--seekora-primary, #ff9900)":"var(--seekora-bg-surface, #ffffff)",color:p===e.id?"var(--seekora-text-on-primary, #0f1111)":"var(--seekora-text-primary, #0f1111)",borderRadius:"20px",fontSize:"13px",fontWeight:p===e.id?700:500,cursor:"pointer",whiteSpace:"nowrap",minHeight:"36px",boxShadow:p===e.id?"0 2px 4px rgba(255,153,0,0.3)":"0 1px 3px rgba(0,0,0,0.1)",transition:"all 150ms ease"}},e.label," ",e.nb_hits?`(${e.nb_hits})`:""))),t.createElement("div",{style:O.content},t.createElement("div",{style:O.leftColumn},oe&&t.createElement("div",{style:O.section},t.createElement("div",{style:O.recentHeader},t.createElement("span",{style:O.sectionHeader},"Recent Searches"),t.createElement("button",{style:O.clearRecent,onClick:$},"Clear all")),Z.slice(0,5).map((e,r)=>{const a=V===r;return t.createElement("div",{key:`recent-${e}`,"data-index":r,role:"option","aria-selected":a,style:Gt(O.suggestionItem,a?O.suggestionItemActive:void 0),onClick:()=>A?.(e),onMouseEnter:()=>U(r)},t.createElement(ea,null),t.createElement("div",{style:O.suggestionContent},t.createElement("div",{style:O.suggestionQuery},e)))})),ne&&t.createElement("div",{style:O.section},t.createElement("div",{style:O.sectionHeader},"Trending Searches"),d.slice(0,5).map((e,r)=>{const a="string"==typeof e?e:e.query,o=Z.length+r,n=V===o;return t.createElement("div",{key:`trending-${a}`,"data-index":o,role:"option","aria-selected":n,style:Gt(O.suggestionItem,n?O.suggestionItemActive:void 0),onClick:()=>N?.({query:a},r),onMouseEnter:()=>U(o)},t.createElement(ta,null),t.createElement("div",{style:O.suggestionContent},t.createElement("div",{style:O.suggestionQuery},a)))})),G.length>0&&t.createElement("div",{style:O.section},a&&t.createElement("div",{style:O.sectionHeader},"Suggestions"),G.map((e,r)=>{const o=oe?Z.length+r:r,n=V===o,s=(e.categories||[])[0];return t.createElement("div",{key:e.id||`suggestion-${r}`,"data-index":o,role:"option","aria-selected":n,style:Gt(O.suggestionItem,n?O.suggestionItemActive:void 0),onClick:()=>N?.(e._raw,r),onMouseEnter:()=>U(o)},t.createElement("div",{style:O.suggestionIcon},t.createElement(Jr,null)),t.createElement("div",{style:O.suggestionContent},t.createElement("div",{style:O.suggestionQuery},Ht(e.query,a,{className:"highlight"})),b&&s&&t.createElement("div",{style:O.suggestionContext},t.createElement("span",{style:O.suggestionDepartment},"in ","string"==typeof s?s:s.value||s.label))),e.count&&t.createElement("span",{style:O.categoryScoped},e.count.toLocaleString()))})),a&&0===G.length&&!n&&(B?B(a):t.createElement("div",{style:O.empty},'No suggestions found for "',a,'"'))),se&&t.createElement("div",{style:O.rightColumn},t.createElement("div",{style:O.productsHeader},t.createElement("span",{style:O.productsTitle},"Suggested Products"),t.createElement("a",{style:O.viewAll,onClick:()=>L?.("products")},"View all")),t.createElement("div",{style:O.productsGrid},Y.slice(0,4).map((e,r)=>t.createElement("div",{key:e.id,style:Gt(O.productCard,K===e.id?O.productCardHover:void 0),onClick:()=>z?.(e._raw,r),onMouseEnter:()=>Q(e.id),onMouseLeave:()=>Q(null)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:O.productImage,loading:"lazy"}):t.createElement("div",{style:{...O.productImage,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement("span",{style:{color:"var(--seekora-text-tertiary, #999)",fontSize:"32px"}},"📷")),t.createElement("div",{style:O.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:O.productPrice},t.createElement("span",{style:O.productPriceSymbol},h.currency||"$"),Wt(e.price,{currency:"",priceDecimals:h.priceDecimals})),e.rating&&t.createElement(ra,{rating:parseFloat(String(e.rating)),count:e.reviewCount?parseInt(String(e.reviewCount)):void 0}))))))),void 0!==F?F:t.createElement("div",{style:O.footer},t.createElement("div",{style:O.keyboard},t.createElement("span",{style:O.key},"↑"),t.createElement("span",{style:O.key},"↓"),t.createElement("span",null,"to navigate"),t.createElement("span",{style:O.key},"↵"),t.createElement("span",null,"to select"),t.createElement("span",{style:O.key},"esc"),t.createElement("span",null,"to close")),G.length>0&&t.createElement("span",null,G.length," suggestions")))}),oa=()=>t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none"},t.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z",fill:"currentColor"})),na=()=>t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none"},t.createElement("path",{d:"M13 3a9 9 0 00-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0013 21a9 9 0 000-18zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z",fill:"currentColor"})),sa=()=>t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none"},t.createElement("path",{d:"M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z",fill:"currentColor"})),ia=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",width:"20",height:"20"},t.createElement("path",{d:"M9 5l-4 4 4 4",stroke:"currentColor",strokeWidth:"2",fill:"none",transform:"rotate(-90 12 12)"})),la=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],recentSearches:i=[],trendingSearches:l=[],suggestionFields:c={query:"query"},theme:d={},showFeelingLucky:u=!0,feelingLuckyText:p="I'm Feeling Lucky",showRemoveRecent:m=!0,showVoiceSearch:g=!1,showTrendingIndicator:f=!0,width:h="100%",maxHeight:y="400px",zIndex:b=1e3,className:v,style:k,classNames:x={},onSuggestionSelect:E,onRecentClick:w,onRecentRemove:S,onVoiceSearch:C,onFeelingLucky:R,onClose:I,onSearchSubmit:N,header:z,footer:T,renderEmpty:M}=e;Yr();const A=Qr(),{isMobile:_}=A,$=t.useMemo(()=>((e=!1)=>({root:{position:e?"fixed":"absolute",top:e?0:"100%",left:0,right:0,bottom:e?0:"auto",marginTop:e?0:"4px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #202124)",borderRadius:e?"0":"24px",boxShadow:e?"none":"0 4px 20px rgba(0,0,0,0.12)",overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:e?"17px":"15px",display:"flex",flexDirection:"column"},list:{listStyle:"none",margin:0,padding:"8px",flex:1,overflowY:"auto"},item:{display:"flex",alignItems:"center",padding:e?"12px 14px":"10px 14px",cursor:"pointer",transition:"all 100ms ease",gap:"12px",minHeight:"44px",borderRadius:"12px",margin:"2px 0",color:"var(--seekora-text-primary, #202124)"},itemActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #202124)"},itemIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-tertiary, #9aa0a6)",flexShrink:0},itemContent:{flex:1,display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:0},itemText:{fontSize:"16px",color:"var(--seekora-text-primary, #202124)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemTextBold:{fontWeight:400},itemMatch:{fontWeight:700},itemAction:{fontSize:"14px",color:"var(--seekora-link, #1a73e8)",marginLeft:"16px",opacity:0,transition:"opacity 100ms",whiteSpace:"nowrap"},itemActionVisible:{opacity:1},removeBtn:{padding:"4px 8px",background:"none",border:"none",color:"var(--seekora-link, #1a73e8)",cursor:"pointer",fontSize:"13px",borderRadius:"4px",opacity:0,transition:"opacity 100ms, background 100ms"},removeBtnVisible:{opacity:1},removeBtnHover:{backgroundColor:"var(--seekora-bg-hover, #e8f0fe)",color:"var(--seekora-text-primary, #202124)"},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, #e8eaed)",margin:"8px 0"},sectionTitle:{padding:"12px 16px 8px",fontSize:"12px",fontWeight:500,color:"var(--seekora-text-secondary, #5f6368)",textTransform:"uppercase",letterSpacing:"0.8px"},trending:{display:"flex",alignItems:"center",gap:"8px",color:"var(--seekora-success, #1e8e3e)",fontSize:"12px",marginLeft:"auto"},trendingIcon:{width:"12px",height:"12px"},footer:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px 16px",borderTop:"1px solid var(--seekora-border-color, #e8eaed)",gap:"24px",backgroundColor:"var(--seekora-bg-secondary, #f8f9fa)"},footerButton:{padding:"8px 16px",backgroundColor:"var(--seekora-bg-tertiary, #f1f3f4)",border:"1px solid var(--seekora-border-color, #f1f3f4)",borderRadius:"4px",fontSize:"14px",color:"var(--seekora-text-secondary, #3c4043)",cursor:"pointer",transition:"border-color 100ms, box-shadow 100ms"},footerButtonHover:{borderColor:"var(--seekora-border-color-dark, #dadce0)",boxShadow:"0 1px 1px rgba(0,0,0,0.1)"},voiceBtn:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",borderRadius:"50%",background:"none",border:"none",cursor:"pointer",color:"var(--seekora-primary, #4285f4)",transition:"background 100ms"},voiceBtnHover:{backgroundColor:"var(--seekora-bg-hover, #f1f3f4)",color:"var(--seekora-text-primary, #202124)"},empty:{padding:"24px",textAlign:"center",color:"var(--seekora-text-secondary, #5f6368)",fontSize:"14px"}}))(_),[_]),L=t.useRef(null),[P,D]=t.useState(-1),[F,B]=t.useState(-1),[W,q]=t.useState(null),H=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),O=t.useMemo(()=>i.map(e=>"string"==typeof e?e:e.query).slice(0,5),[i]),j=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,5),[l]),V=t.useMemo(()=>{const e=[];return 0===a.length?(O.forEach(t=>e.push({type:"recent",query:t})),j.forEach(t=>e.push({type:"trending",query:t}))):H.forEach(t=>e.push({type:"suggestion",query:t.query,data:t})),e},[a,O,j,H]),U=t.useCallback(()=>{D(e=>Math.min(e+1,V.length-1))},[V.length]),K=t.useCallback(()=>{D(e=>Math.max(e-1,-1))},[]),Q=t.useCallback(()=>{if(P<0)return void(a&&N?.(a));const e=V[P];"recent"===e.type||"trending"===e.type?w?.(e.query):E?.(e.data?._raw||{query:e.query},P)},[P,V,a,N,w,E]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>P,setActiveIndex:D,selectActive:Q,navigateNext:U,navigatePrevious:K,focus:()=>L.current?.focus(),close:()=>I?.()}),[P,Q,U,K,I]),t.useEffect(()=>{D(-1)},[a]),t.useEffect(()=>{if(P>=0&&L.current){const e=L.current.querySelector(`[data-index="${P}"]`);e&&er(e,L.current)}},[P]),!o)return null;const G=Kt(d),X=0===a.length&&O.length>0,Y=0===a.length&&j.length>0,Z=(e,r,o)=>{const n=P===o,s=F===o,i=n||s;return t.createElement("li",{key:`${e.type}-${e.query}-${r}`,"data-index":o,role:"option","aria-selected":n,style:Gt($.item,n||s?$.itemActive:void 0),onClick:()=>{"recent"===e.type||"trending"===e.type?w?.(e.query):E?.(e.data?._raw||{query:e.query},r)},onMouseEnter:()=>{B(o),D(o)},onMouseLeave:()=>B(-1)},t.createElement("div",{style:$.itemIcon},"recent"===e.type?t.createElement(na,null):"trending"===e.type?t.createElement(sa,null):t.createElement(oa,null)),t.createElement("div",{style:$.itemContent},t.createElement("span",{style:$.itemText},a?Ht(e.query,a,{tag:"b"}):e.query),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},"trending"===e.type&&f&&t.createElement("span",{style:$.trending},t.createElement(sa,null),"Trending"),"recent"===e.type&&m&&t.createElement("button",{style:Gt($.removeBtn,i?$.removeBtnVisible:void 0),onClick:t=>{t.stopPropagation(),S?.(e.query)},"aria-label":`Remove ${e.query}`},"Remove"),t.createElement("span",{style:Gt($.itemAction,i?$.itemActionVisible:void 0)},t.createElement(ia,null)))))};let J=0;return t.createElement("div",{ref:L,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-google-dropdown",v,x.root),style:Gt($.root,{width:h,maxHeight:"none",zIndex:b},G,k),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),z,t.createElement(t.Fragment,null,t.createElement("ul",{style:$.list},X&&t.createElement(t.Fragment,null,O.map((e,t)=>{const r=Z({type:"recent",query:e},t,J);return J++,r}),Y&&t.createElement("div",{style:$.divider})),Y&&t.createElement(t.Fragment,null,!X&&t.createElement("div",{style:$.sectionTitle},"Trending searches"),j.map((e,t)=>{const r=Z({type:"trending",query:e},t,J);return J++,r})),a&&H.length>0&&H.map((e,t)=>{const r={type:"suggestion",query:e.query,data:e},a=Z(r,t,J);return J++,a}),a&&0===H.length&&!n&&(M?M(a):t.createElement("li",{style:$.empty},'No suggestions for "',a,'"'))),(u||g)&&t.createElement("div",{style:$.footer},u&&t.createElement(t.Fragment,null,t.createElement("button",{style:Gt($.footerButton,"search"===W?$.footerButtonHover:void 0),onMouseEnter:()=>q("search"),onMouseLeave:()=>q(null),onClick:()=>N?.(a||(P>=0?V[P]?.query:""))},"Search"),t.createElement("button",{style:Gt($.footerButton,"lucky"===W?$.footerButtonHover:void 0),onMouseEnter:()=>q("lucky"),onMouseLeave:()=>q(null),onClick:()=>R?.(a||(P>=0?V[P]?.query:""))},p)))),T)}),ca=()=>t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor"},t.createElement("path",{d:"M10 16c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6m13.12 2.88l-4.26-4.26A9.842 9.842 0 0020 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10c1.67 0 3.24-.41 4.62-1.14l4.26 4.26a3 3 0 004.24-4.24z"})),da=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18"},t.createElement("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"})),ua=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18"},t.createElement("path",{d:"M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"})),pa=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"48",height:"48"},t.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.createElement("polyline",{points:"21 15 16 10 5 21"})),ma=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],categories:l=[],suggestionFields:c={query:"query"},productFields:d={id:"id",title:"title"},categoryFields:u={id:"id",label:"label"},productDisplay:p={},theme:m={},showSaveButton:g=!0,activeCategory:f,activeTab:h,showPriceOverlay:y=!0,gridColumns:b=4,width:v="800px",maxHeight:k="600px",zIndex:x=1e3,className:E,style:w,classNames:S={},onSuggestionSelect:C,onProductClick:R,onCategoryClick:I,onTabChange:N,onSaveProduct:z,onViewAll:T,onClose:M,header:A,footer:_,renderEmpty:$}=e;Yr();const L=Qr(),{isMobile:P}=L,D=t.useMemo(()=>({root:{position:"absolute",top:"100%",left:0,right:0,marginTop:"8px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #111111)",borderRadius:"20px",boxShadow:"0 4px 30px rgba(0,0,0,0.12)",overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"15px"},header:{padding:"16px 20px 14px",borderBottom:"1px solid var(--seekora-border-color, #e8e8e8)"},searchInfo:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"14px"},searchQuery:{fontSize:"16px",fontWeight:600,color:"#111111"},searchCount:{fontSize:"13px",color:"#767676"},categoriesScroll:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"4px",scrollbarWidth:"none",msOverflowStyle:"none"},categoryChip:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",backgroundColor:"var(--seekora-bg-secondary, #f0f0f0)",borderRadius:"20px",fontSize:"13px",fontWeight:500,color:"#111111",cursor:"pointer",transition:"all 150ms ease",whiteSpace:"nowrap",borderWidth:0,borderStyle:"none"},categoryChipActive:{backgroundColor:"var(--seekora-primary, #e60023)",color:"var(--seekora-bg-surface, #ffffff)"},categoryChipHover:{backgroundColor:"var(--seekora-bg-hover, #e0e0e0)",color:"var(--seekora-text-primary, #111111)"},categoryIcon:{width:"16px",height:"16px",borderRadius:"4px",objectFit:"cover"},content:{padding:"16px",overflowY:"auto"},suggestionsRow:{display:"flex",gap:"8px",marginBottom:"16px",flexWrap:"wrap"},suggestionPill:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",borderRadius:"20px",fontSize:"13px",fontWeight:500,color:"#111111",cursor:"pointer",transition:"all 150ms ease",borderWidth:0,borderStyle:"none"},suggestionPillActive:{backgroundColor:"var(--seekora-text-primary, #111111)",color:"var(--seekora-bg-surface, #ffffff)"},suggestionPillHover:{backgroundColor:"var(--seekora-bg-hover, #e8e8e8)",color:"var(--seekora-text-primary, #111111)"},suggestionIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"#767676",flexShrink:0},productsGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))",gap:"16px"},productCard:{position:"relative",borderRadius:"16px",overflow:"hidden",cursor:"pointer",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",transition:"transform 150ms, box-shadow 150ms"},productCardHover:{transform:"scale(1.02)",boxShadow:"0 4px 20px rgba(0,0,0,0.15)"},productImageContainer:{position:"relative",paddingBottom:"133%",overflow:"hidden"},productImage:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},productImagePlaceholder:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--seekora-bg-tertiary, #e9e9e9)",color:"var(--seekora-text-tertiary, #aaa)"},productOverlay:{position:"absolute",bottom:0,left:0,right:0,padding:"40px 12px 12px",background:"linear-gradient(to top, rgba(0,0,0,0.7), transparent)",opacity:0,transition:"opacity 200ms"},productOverlayVisible:{opacity:1},productInfo:{padding:"12px"},productTitle:{fontSize:"14px",fontWeight:600,color:"var(--seekora-text-primary, #111)",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",marginBottom:"4px"},productTitleOverlay:{color:"var(--seekora-text-inverse, #ffffff)",marginBottom:"4px"},productPrice:{fontSize:"14px",fontWeight:600,color:"var(--seekora-text-primary, #111)"},productPriceOverlay:{color:"var(--seekora-text-inverse, #ffffff)"},productSaveBtn:{position:"absolute",top:"12px",right:"12px",width:"36px",height:"36px",borderRadius:"50%",backgroundColor:"var(--seekora-primary, #e60023)",color:"var(--seekora-text-inverse, #ffffff)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",opacity:0,transform:"scale(0.8)",transition:"all 150ms"},productSaveBtnVisible:{opacity:1,transform:"scale(1)"},sectionTitle:{fontSize:"18px",fontWeight:700,color:"var(--seekora-text-primary, #111)",marginBottom:"16px",display:"flex",alignItems:"center",gap:"8px"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, #767676)"},spinner:{width:"32px",height:"32px",border:"3px solid var(--seekora-border-color, #efefef)",borderTopColor:"var(--seekora-primary, #e60023)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"60px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #767676)"},emptyIcon:{width:"64px",height:"64px",margin:"0 auto 16px",color:"var(--seekora-text-tertiary, #8c8c8c)"},footer:{padding:"16px 20px",borderTop:"1px solid var(--seekora-border-color, #efefef)",display:"flex",alignItems:"center",justifyContent:"space-between"},viewAllBtn:{padding:"12px 20px",backgroundColor:"var(--seekora-primary, #e60023)",color:"var(--seekora-text-inverse, #ffffff)",border:"none",borderRadius:"24px",fontSize:"15px",fontWeight:600,cursor:"pointer",transition:"background 150ms"},viewAllBtnHover:{backgroundColor:"var(--seekora-primary-dark, #ad081b)"}}),[]),F=t.useRef(null),[B,W]=t.useState(-1),[q,H]=t.useState(null),[O,j]=t.useState(null),[V,U]=t.useState(-1),[K,Q]=t.useState(f||null),[G,X]=t.useState(!1);t.useEffect(()=>{const e=h??f;void 0!==e&&Q("all"===e?null:e)},[h,f]);const Y=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),Z=t.useMemo(()=>i.map(e=>Ft(e,d)),[i,d]),J=t.useMemo(()=>l.map(e=>Bt(e,u)),[l,u]),ee=t.useCallback(()=>{W(e=>Math.min(e+1,Y.length-1))},[Y.length]),te=t.useCallback(()=>{W(e=>Math.max(e-1,-1))},[]),re=t.useCallback(()=>{B>=0&&Y[B]&&C?.(Y[B]._raw,B)},[B,Y,C]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>B,setActiveIndex:W,selectActive:re,navigateNext:ee,navigatePrevious:te,focus:()=>F.current?.focus(),close:()=>M?.()}),[B,re,ee,te,M]),t.useEffect(()=>{if(B>=0&&F.current){const e=F.current.querySelector(`[data-index="${B}"]`);e&&er(e,F.current)}},[B]),!o)return null;const ae=Kt(m),oe=J.length>0,ne=Z;return t.createElement("div",{ref:F,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-pinterest-dropdown",E,S.root),style:Gt(D.root,{width:v,zIndex:x},ae,w),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n .seekora-pinterest-dropdown .categories-scroll::-webkit-scrollbar {\n display: none;\n }\n "),A||a&&t.createElement("div",{style:D.header},t.createElement("div",{style:D.searchInfo},t.createElement("span",{style:D.searchQuery},a?`"${a}"`:"Explore"),Z.length>0&&t.createElement("span",{style:D.searchCount},Z.length,"+ ideas")),oe&&t.createElement("div",{style:D.categoriesScroll,className:"categories-scroll"},t.createElement("button",{style:Gt(D.categoryChip,K?void 0:D.categoryChipActive,"all"===O&&K?D.categoryChipHover:void 0),onClick:()=>{Q(null),N?.("all")},onMouseEnter:()=>j("all"),onMouseLeave:()=>j(null)},"All"),J.map(e=>t.createElement("button",{key:e.id,style:Gt(D.categoryChip,K===e.id?D.categoryChipActive:void 0,O===e.id&&K!==e.id?D.categoryChipHover:void 0),onClick:()=>{Q(e.id),N?.(e.id)},onMouseEnter:()=>j(e.id),onMouseLeave:()=>j(null)},e.icon&&t.createElement("img",{src:e.icon,alt:"",style:D.categoryIcon}),e.label,e.count&&t.createElement("span",null,"(",e.count,")"))))),t.createElement("div",{style:{...D.content,maxHeight:k}},t.createElement(t.Fragment,null,Y.length>0&&t.createElement("div",{style:D.suggestionsRow},Y.slice(0,8).map((e,r)=>t.createElement("button",{key:e.id||r,"data-index":r,style:Gt(D.suggestionPill,B===r?D.suggestionPillActive:void 0,V===r&&B!==r?D.suggestionPillHover:void 0),onClick:()=>C?.(e._raw,r),onMouseEnter:()=>{U(r),W(r)},onMouseLeave:()=>U(-1)},t.createElement("span",{style:D.suggestionIcon},a?Ht(e.query,a,{tag:"strong"}):e.query)))),ne.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:D.sectionTitle},t.createElement(ua,null),"Ideas for you"),t.createElement("div",{style:{...D.productsGrid,gridTemplateColumns:`repeat(${b}, 1fr)`}},ne.slice(0,12).map((e,r)=>t.createElement("div",{key:e.id,style:Gt(D.productCard,q===e.id?D.productCardHover:void 0),onClick:()=>R?.(e._raw,r),onMouseEnter:()=>H(e.id),onMouseLeave:()=>H(null)},t.createElement("div",{style:D.productImageContainer},e.image?t.createElement("img",{src:e.image,alt:e.title,style:D.productImage,loading:"lazy"}):t.createElement("div",{style:D.productImagePlaceholder},t.createElement(pa,null)),g&&t.createElement("button",{style:Gt(D.productSaveBtn,q===e.id?D.productSaveBtnVisible:void 0),onClick:t=>{t.stopPropagation(),z?.(e._raw)},"aria-label":"Save"},t.createElement(da,null)),y&&void 0!==e.price&&t.createElement("div",{style:Gt(D.productOverlay,q===e.id?D.productOverlayVisible:void 0)},t.createElement("div",{style:D.productTitleOverlay},e.title),t.createElement("div",{style:D.productPriceOverlay},Wt(e.price,{currency:p.currency||e.currency||"$"})))),!y&&t.createElement("div",{style:D.productInfo},t.createElement("div",{style:D.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:D.productPrice},Wt(e.price,{currency:p.currency||e.currency||"$"}))))))),!n&&0===ne.length&&0===Y.length&&($?$(a):t.createElement("div",{style:D.empty},t.createElement("div",{style:D.emptyIcon},t.createElement(ca,null)),t.createElement("p",null,'No ideas found for "',a,'"'),t.createElement("p",{style:{fontSize:"14px",marginTop:"8px"}},"Try searching for something else"))))),void 0!==_?_:ne.length>0&&t.createElement("div",{style:D.footer},t.createElement("span",{style:{color:"var(--seekora-text-secondary, #767676)",fontSize:"14px"}},ne.length,"+ more ideas"),t.createElement("button",{style:Gt(D.viewAllBtn,G?D.viewAllBtnHover:void 0),onClick:()=>T?.("products"),onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1)},"Explore all")))}),ga=()=>t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor"},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),fa=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z",clipRule:"evenodd"})),ha=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{d:"M10 2a4 4 0 00-4 4v1H5a1 1 0 00-.994.89l-1 9A1 1 0 004 18h12a1 1 0 00.994-1.11l-1-9A1 1 0 0015 7h-1V6a4 4 0 00-4-4zm2 5V6a2 2 0 10-4 0v1h4zm-6 3a1 1 0 112 0 1 1 0 01-2 0zm7-1a1 1 0 100 2 1 1 0 000-2z"})),ya=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),ba=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],recentSearches:l=[],suggestionFields:c={query:"query"},productFields:d={id:"id",title:"title"},productDisplay:u={},theme:p={},showPreview:m=!0,asOverlay:g=!0,placeholder:f="Powered by Seekora",showShortcuts:h=!0,actions:y=[],width:b="680px",maxHeight:v="500px",zIndex:k=9999,className:x,style:E,classNames:w={},inputRef:S,onSuggestionSelect:C,onProductClick:R,onRecentClick:I,onClose:N,onSearchSubmit:z,header:T,footer:M,renderEmpty:A}=e;Yr();const _=Qr(),{isMobile:$}=_,L=t.useMemo(()=>({overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",zIndex:9999},root:{backgroundColor:"var(--seekora-bg-surface, rgba(255, 255, 255, 0.95))",borderRadius:"var(--seekora-border-radius, 12px)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.1)",overflow:"hidden",fontFamily:'var(--seekora-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif)',fontSize:"var(--seekora-font-size, 14px)",backdropFilter:"blur(20px)"},searchContainer:{display:"flex",alignItems:"center",padding:"12px 16px",gap:"12px",borderBottom:"1px solid var(--seekora-border-color, rgba(0,0,0,0.1))"},searchIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-tertiary, #86868b)",flexShrink:0},searchInput:{flex:1,border:"none",background:"transparent",fontSize:"17px",fontWeight:300,color:"var(--seekora-text-primary, #1d1d1f)",outline:"none",fontFamily:"inherit"},shortcut:{display:"flex",alignItems:"center",gap:"4px",fontSize:"12px",color:"var(--seekora-text-tertiary, #86868b)"},kbd:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 4px",backgroundColor:"var(--seekora-bg-tertiary, rgba(0,0,0,0.05))",borderRadius:"4px",fontSize:"11px",fontFamily:"SF Mono, Monaco, monospace"},content:{display:"flex",maxHeight:"400px"},resultsColumn:{flex:1,overflowY:"auto",minWidth:"300px"},previewColumn:{width:"280px",borderLeft:"1px solid var(--seekora-border-color, rgba(0,0,0,0.1))",backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.02))",display:"flex",flexDirection:"column"},section:{padding:"8px 0"},sectionTitle:{padding:"8px 16px 6px",fontSize:"11px",fontWeight:600,color:"var(--seekora-text-tertiary, #86868b)",textTransform:"uppercase",letterSpacing:"0.5px"},item:{display:"flex",alignItems:"center",padding:"8px 16px",gap:"12px",cursor:"pointer",transition:"background-color 50ms",margin:"0 8px",borderRadius:"6px"},itemActive:{backgroundColor:"var(--seekora-primary, #007aff)",color:"var(--seekora-text-inverse, #ffffff)"},itemIcon:{width:"32px",height:"32px",borderRadius:"6px",backgroundColor:"var(--seekora-bg-tertiary, #f5f5f7)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-secondary, #515154)",flexShrink:0},itemIconActive:{backgroundColor:"rgba(255,255,255,0.2)",color:"var(--seekora-text-inverse, #ffffff)"},itemIconImage:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"6px"},itemContent:{flex:1,minWidth:0},itemTitle:{fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, #1d1d1f)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemTitleActive:{color:"var(--seekora-text-inverse, #ffffff)"},itemSubtitle:{fontSize:"11px",color:"var(--seekora-text-secondary, #86868b)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"2px"},itemSubtitleActive:{color:"var(--seekora-text-inverse, #ffffff)",opacity:.9},itemAction:{fontSize:"11px",color:"var(--seekora-text-tertiary, #86868b)",opacity:0,transition:"opacity 100ms"},itemActionVisible:{opacity:1},itemActionActive:{color:"var(--seekora-text-inverse, #ffffff)",opacity:.8},previewContent:{flex:1,padding:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},previewImage:{width:"160px",height:"160px",objectFit:"contain",borderRadius:"8px",marginBottom:"16px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},previewTitle:{fontSize:"14px",fontWeight:600,color:"var(--seekora-text-primary, #1d1d1f)",textAlign:"center",marginBottom:"4px"},previewSubtitle:{fontSize:"12px",color:"var(--seekora-text-secondary, #86868b)",textAlign:"center",marginBottom:"8px"},previewPrice:{fontSize:"18px",fontWeight:700,color:"var(--seekora-primary, #007aff)"},previewActions:{display:"flex",gap:"8px",marginTop:"16px"},previewAction:{padding:"6px 12px",fontSize:"12px",fontWeight:500,borderRadius:"6px",border:"none",cursor:"pointer",transition:"all 100ms"},previewActionPrimary:{backgroundColor:"var(--seekora-primary, #007aff)",color:"var(--seekora-text-inverse, #ffffff)"},previewActionSecondary:{backgroundColor:"var(--seekora-bg-tertiary, #f5f5f7)",color:"var(--seekora-text-primary, #1d1d1f)"},footer:{padding:"8px 16px",borderTop:"1px solid var(--seekora-border-color, rgba(0,0,0,0.1))",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.02))",fontSize:"11px",color:"var(--seekora-text-tertiary, #86868b)"},footerActions:{display:"flex",alignItems:"center",gap:"16px"},footerAction:{display:"flex",alignItems:"center",gap:"4px"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"40px",color:"var(--seekora-text-secondary, #86868b)"},spinner:{width:"24px",height:"24px",border:"2px solid var(--seekora-border-color, #e5e5e5)",borderTopColor:"var(--seekora-primary, #007aff)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"40px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #86868b)"}}),[]),P=t.useRef(null),D=t.useRef(null),[F,B]=t.useState(-1),W=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),q=t.useMemo(()=>i.map(e=>Ft(e,d)),[i,d]),H=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,3),[l]),O=t.useMemo(()=>{const e=[];return y.forEach(t=>{e.push({type:"action",id:t.id,title:t.label,icon:t.icon,data:t})}),!a&&H.length>0&&H.forEach((r,a)=>{e.push({type:"recent",id:`recent-${a}`,title:r,icon:t.createElement(ya,null),data:r})}),W.forEach((r,a)=>{e.push({type:"suggestion",id:r.id||`suggestion-${a}`,title:r.query,icon:t.createElement(fa,null),data:r})}),q.forEach((r,a)=>{e.push({type:"product",id:r.id,title:r.title,subtitle:r.brand,icon:t.createElement(ha,null),image:r.image,price:r.price,data:r})}),e},[y,a,H,W,q]),j=t.useCallback(()=>{B(e=>Math.min(e+1,O.length-1))},[O.length]),V=t.useCallback(()=>{B(e=>Math.max(e-1,-1))},[]),U=t.useCallback(()=>{if(F<0)return void(a.trim()&&z?.(a.trim()));const e=O[F];if(e)switch(e.type){case"action":e.data.onAction?.();break;case"recent":I?.(e.data);break;case"suggestion":C?.(e.data._raw,F);break;case"product":R?.(e.data._raw,F)}},[F,O,a,z,I,C,R]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>F,setActiveIndex:B,selectActive:U,navigateNext:j,navigatePrevious:V,focus:()=>S?.current?.focus(),close:()=>N?.()}),[F,U,j,V,S,N]),t.useEffect(()=>{if(D.current&&F>=0){const e=D.current.querySelector(`[data-index="${F}"]`);e&&er(e,D.current)}},[F]),t.useEffect(()=>{B(-1)},[a]),!o)return null;const K=Kt(p),Q=O[F],G=t.createElement("div",{ref:P,className:Qt("seekora-spotlight-dropdown",x,w.root),style:Gt(L.root,{width:b,zIndex:g?void 0:k},K,E)},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),t.createElement("div",{style:L.searchContainer},t.createElement("div",{style:L.searchIcon},t.createElement(ga,null)),t.createElement("input",{ref:S,type:"text",placeholder:f,defaultValue:a,style:L.searchInput,onChange:e=>z?.(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),j()):"ArrowUp"===e.key?(e.preventDefault(),V()):"Enter"===e.key?(e.preventDefault(),U()):"Escape"===e.key&&N?.()},autoFocus:!0}),h&&t.createElement("div",{style:L.shortcut},t.createElement("span",{style:L.kbd},"⌘"),t.createElement("span",{style:L.kbd},"K"))),T,t.createElement("div",{style:L.content},t.createElement("div",{ref:D,style:{...L.resultsColumn,maxHeight:v}},0===O.length?A?A(a):t.createElement("div",{style:L.empty},'No results for "',a,'"'):t.createElement(t.Fragment,null,y.length>0&&t.createElement("div",{style:L.section},t.createElement("div",{style:L.sectionTitle},"Actions"),O.filter(e=>"action"===e.type).map(e=>{const r=O.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:Gt(L.item,a?L.itemActive:void 0),onClick:()=>{B(r),U()},onMouseEnter:()=>B(r)},t.createElement("div",{style:Gt(L.itemIcon,a?L.itemIconActive:void 0)},e.icon),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:Gt(L.itemTitle,a?L.itemTitleActive:void 0)},e.title)))})),H.length>0&&!a&&t.createElement("div",{style:L.section},t.createElement("div",{style:L.sectionTitle},"Recent"),O.filter(e=>"recent"===e.type).map(e=>{const r=O.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:Gt(L.item,a?L.itemActive:void 0),onClick:()=>{B(r),I?.(e.data)},onMouseEnter:()=>B(r)},t.createElement("div",{style:Gt(L.itemIcon,a?L.itemIconActive:void 0)},e.icon),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:Gt(L.itemTitle,a?L.itemTitleActive:void 0)},e.title)))})),W.length>0&&t.createElement("div",{style:L.section},t.createElement("div",{style:L.sectionTitle},"Suggestions"),O.filter(e=>"suggestion"===e.type).map(e=>{const r=O.indexOf(e),o=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:Gt(L.item,o?L.itemActive:void 0),onClick:()=>{B(r),C?.(e.data._raw,r)},onMouseEnter:()=>B(r)},t.createElement("div",{style:Gt(L.itemIcon,o?L.itemIconActive:void 0)},e.icon),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:Gt(L.itemTitle,o?L.itemTitleActive:void 0)},Ht(e.title,a,{tag:"strong"}))))})),q.length>0&&t.createElement("div",{style:L.section},t.createElement("div",{style:L.sectionTitle},"Products"),O.filter(e=>"product"===e.type).map(e=>{const r=O.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:Gt(L.item,a?L.itemActive:void 0),onClick:()=>{B(r),R?.(e.data._raw,r)},onMouseEnter:()=>B(r)},t.createElement("div",{style:Gt(L.itemIcon,a?L.itemIconActive:void 0)},e.image?t.createElement("img",{src:e.image,alt:"",style:L.itemIconImage}):e.icon),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:Gt(L.itemTitle,a?L.itemTitleActive:void 0)},e.title),e.subtitle&&t.createElement("div",{style:Gt(L.itemSubtitle,a?L.itemSubtitleActive:void 0)},e.subtitle)),void 0!==e.price&&t.createElement("span",{style:Gt(L.itemAction,L.itemActionVisible,a?L.itemActionActive:void 0)},Wt(e.price,{currency:u.currency})))})))),m&&Q&&"product"===Q.type&&t.createElement("div",{style:L.previewColumn},t.createElement("div",{style:L.previewContent},Q.image&&t.createElement("img",{src:Q.image,alt:"",style:L.previewImage}),t.createElement("div",{style:L.previewTitle},Q.title),Q.subtitle&&t.createElement("div",{style:L.previewSubtitle},Q.subtitle),void 0!==Q.price&&t.createElement("div",{style:L.previewPrice},Wt(Q.price,{currency:u.currency})),t.createElement("div",{style:L.previewActions},t.createElement("button",{style:{...L.previewAction,...L.previewActionPrimary},onClick:()=>R?.(Q.data._raw,F)},"View Product"))))),void 0!==M?M:t.createElement("div",{style:L.footer},t.createElement("div",{style:L.footerActions},t.createElement("span",{style:L.footerAction},t.createElement("span",{style:L.kbd},"↑"),t.createElement("span",{style:L.kbd},"↓"),"navigate"),t.createElement("span",{style:L.footerAction},t.createElement("span",{style:L.kbd},"↵"),"select"),t.createElement("span",{style:L.footerAction},t.createElement("span",{style:L.kbd},"esc"),"close")),t.createElement("span",null,O.length," results")));return g?t.createElement("div",{style:{...L.overlay,zIndex:k},onClick:e=>{e.target===e.currentTarget&&N?.()}},G):G}),va=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},t.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"})),ka=()=>t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor"},t.createElement("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})),xa=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],categories:l=[],suggestionFields:c={query:"query"},productFields:d={id:"id",title:"title"},categoryFields:u={id:"id",label:"label"},productDisplay:p={},theme:m={},showHeroProduct:g=!0,showCollections:f=!0,showAddToCart:h=!0,addToCartText:y="Quick Add",showComparePrice:b=!0,width:v="100%",maxHeight:k="500px",zIndex:x=1e3,className:E,style:w,classNames:S={},onSuggestionSelect:C,onProductClick:R,onCategoryClick:I,onTabChange:N,onAddToCart:z,onViewAll:T,onClose:M,header:A,footer:_,renderEmpty:$}=e;Yr();const L=Qr(),{isMobile:P}=L,D=t.useMemo(()=>((e=!1)=>({root:{position:e?"fixed":"absolute",top:e?0:"100%",left:0,right:0,bottom:e?0:"auto",marginTop:e?0:"8px",backgroundColor:"var(--seekora-bg-surface, transparent)",color:"var(--seekora-text-primary, inherit)",borderRadius:e?0:"16px",boxShadow:e?"none":"0 4px 30px rgba(0, 0, 0, 0.12)",overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:e?"16px":"14px",display:"flex",flexDirection:"column"},layout:{display:e?"flex":"grid",flexDirection:"column",gridTemplateColumns:e?"1fr":"1fr 1fr",minHeight:e?"auto":"400px",flex:1,overflowY:"auto"},leftPanel:{backgroundColor:"var(--seekora-bg-surface, transparent)",borderRight:e?"none":"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderBottom:e?"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))":"none",display:"flex",flexDirection:"column"},rightPanel:{backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",padding:e?"16px":"24px",display:"flex",flexDirection:"column",overflow:"hidden"},section:{flex:1,overflowY:"auto"},sectionHeader:{padding:"16px 20px 12px",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))"},sectionTitle:{fontSize:"11px",fontWeight:600,color:"var(--seekora-text-secondary, #666)",textTransform:"uppercase",letterSpacing:"0.1em"},viewAllLink:{fontSize:"12px",color:"var(--seekora-text-primary, inherit)",textDecoration:"underline",cursor:"pointer"},suggestionItem:{display:"flex",alignItems:"center",padding:e?"14px 16px":"12px 16px",gap:"12px",cursor:"pointer",transition:"all 150ms ease",minHeight:"48px",margin:"4px 8px",borderRadius:"10px",color:"var(--seekora-text-primary, inherit)"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))",color:"var(--seekora-text-primary, inherit)"},suggestionIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-tertiary, #999999)",flexShrink:0},suggestionContent:{flex:1,minWidth:0},suggestionQuery:{fontSize:"14px",color:"var(--seekora-text-primary, inherit)",fontWeight:400},suggestionMeta:{fontSize:"12px",color:"var(--seekora-text-secondary, inherit)",marginTop:"2px"},suggestionArrow:{width:"16px",height:"16px",color:"var(--seekora-text-tertiary, #ccc)",transform:"rotate(-45deg)",opacity:0,transition:"opacity 150ms"},suggestionArrowVisible:{opacity:1},collectionsGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"1px",backgroundColor:"var(--seekora-border-color, rgba(128,128,128,0.2))",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))"},collectionItem:{backgroundColor:"var(--seekora-bg-surface, transparent)",color:"var(--seekora-text-primary, inherit)",padding:"16px 20px",cursor:"pointer",transition:"background-color 150ms"},collectionItemHover:{backgroundColor:"var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))",color:"var(--seekora-text-primary, inherit)"},collectionName:{fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",marginBottom:"4px"},collectionCount:{fontSize:"11px",color:"var(--seekora-text-secondary, inherit)"},heroProduct:{marginBottom:"24px"},heroImage:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:"2px",marginBottom:"16px",backgroundColor:"var(--seekora-bg-tertiary, #f5f5f5)"},heroTitle:{fontSize:"16px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",marginBottom:"8px",lineHeight:1.3},heroBrand:{fontSize:"12px",color:"var(--seekora-text-secondary, inherit)",marginBottom:"12px",textTransform:"uppercase",letterSpacing:"0.05em"},heroPricing:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px"},heroPrice:{fontSize:"18px",fontWeight:500,color:"var(--seekora-text-primary, inherit)"},heroComparePrice:{fontSize:"14px",color:"var(--seekora-text-tertiary, #999)",textDecoration:"line-through"},heroDiscount:{fontSize:"12px",fontWeight:600,color:"var(--seekora-error, #d02e2e)",backgroundColor:"var(--seekora-error-light, #fdf2f2)",padding:"2px 8px",borderRadius:"2px"},heroButton:{width:"100%",padding:"14px 20px",backgroundColor:"var(--seekora-text-primary, inherit)",color:"var(--seekora-bg-surface, transparent)",border:"none",borderRadius:"2px",fontSize:"13px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.1em",cursor:"pointer",transition:"background-color 150ms"},heroButtonHover:{backgroundColor:"var(--seekora-text-secondary, inherit)",color:"var(--seekora-bg-surface, transparent)"},productsScroll:{flex:1,overflowX:"auto",overflowY:"hidden",display:"flex",gap:"16px",paddingBottom:"8px",scrollbarWidth:"thin"},productCard:{flex:"0 0 140px",cursor:"pointer",transition:"opacity 150ms"},productCardHover:{opacity:.7},productImage:{width:"140px",height:"175px",objectFit:"cover",backgroundColor:"var(--seekora-bg-tertiary, #f5f5f5)",marginBottom:"10px"},productTitle:{fontSize:"12px",color:"var(--seekora-text-primary, inherit)",marginBottom:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},productPrice:{fontSize:"12px",fontWeight:500,color:"var(--seekora-text-primary, inherit)"},footer:{padding:"12px 20px",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"11px",color:"var(--seekora-text-secondary, inherit)"},footerLink:{color:"var(--seekora-text-primary, inherit)",textDecoration:"underline",cursor:"pointer"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, inherit)"},spinner:{width:"24px",height:"24px",border:"2px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderTopColor:"var(--seekora-text-primary, inherit)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"60px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #666)"},highlight:{fontWeight:600,textDecoration:"underline",textDecorationColor:"var(--seekora-text-primary, #121212)"}}))(P),[P]),F=t.useRef(null),[B,W]=t.useState(-1),[q,H]=t.useState(null),[O,j]=t.useState(null),[V,U]=t.useState(!1),K=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),Q=t.useMemo(()=>i.map(e=>Ft(e,d)),[i,d]),G=t.useMemo(()=>l.map(e=>Bt(e,u)),[l,u]),X=Q[0],Y=Q.slice(1,7),Z=t.useCallback(()=>{W(e=>Math.min(e+1,K.length-1))},[K.length]),J=t.useCallback(()=>{W(e=>Math.max(e-1,-1))},[]),ee=t.useCallback(()=>{B>=0&&K[B]&&C?.(K[B]._raw,B)},[B,K,C]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>B,setActiveIndex:W,selectActive:ee,navigateNext:Z,navigatePrevious:J,focus:()=>F.current?.focus(),close:()=>M?.()}),[B,ee,Z,J,M]),t.useEffect(()=>{if(B>=0&&F.current){const e=F.current.querySelector(`[data-index="${B}"]`);e&&er(e,F.current)}},[B]),!o)return null;const te=Kt(m),re=X?((e,t)=>{if(e&&t&&!(t<=e))return Math.round((t-e)/t*100)})(X.price,X.comparePrice):void 0;return t.createElement("div",{ref:F,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-shopify-dropdown",E,S.root),style:Gt(D.root,{width:P?"100%":v,maxHeight:P?"100vh":k,zIndex:x},te,w),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n .seekora-shopify-dropdown mark {\n background: transparent;\n text-decoration: underline;\n font-weight: 600;\n }\n "),A,t.createElement("div",{style:D.layout},t.createElement("div",{style:D.leftPanel},t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Suggestions"),K.length>5&&t.createElement("span",{style:D.viewAllLink,onClick:()=>T?.("suggestions")},"View all")),K.slice(0,5).map((e,r)=>{const o=B===r;return t.createElement("div",{key:e.id||r,"data-index":r,role:"option","aria-selected":o,style:Gt(D.suggestionItem,o?D.suggestionItemActive:void 0),onClick:()=>C?.(e._raw,r),onMouseEnter:()=>W(r)},t.createElement("div",{style:D.suggestionIcon},t.createElement(va,null)),t.createElement("div",{style:D.suggestionContent},t.createElement("div",{style:D.suggestionQuery},Ht(e.query,a,{tag:"mark"})),e.count&&t.createElement("div",{style:D.suggestionMeta},e.count," results")),t.createElement("div",{style:Gt(D.suggestionArrow,o?D.suggestionArrowVisible:void 0)},t.createElement(ka,null)))}),0===K.length&&a&&($?$(a):t.createElement("div",{style:{padding:"20px",textAlign:"center",color:"#666"}},'No suggestions for "',a,'"'))),f&&G.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Collections")),t.createElement("div",{style:D.collectionsGrid},G.slice(0,4).map(e=>t.createElement("div",{key:e.id,style:Gt(D.collectionItem,O===e.id?D.collectionItemHover:void 0),onClick:()=>N?.(e.id),onMouseEnter:()=>j(e.id),onMouseLeave:()=>j(null)},t.createElement("div",{style:D.collectionName},e.label),e.count&&t.createElement("div",{style:D.collectionCount},e.count," products")))))),t.createElement("div",{style:D.rightPanel},g&&X&&t.createElement("div",{style:D.heroProduct},X.image&&t.createElement("img",{src:X.image,alt:X.title,style:D.heroImage,loading:"lazy"}),X.brand&&t.createElement("div",{style:D.heroBrand},X.brand),t.createElement("div",{style:D.heroTitle},X.title),t.createElement("div",{style:D.heroPricing},t.createElement("span",{style:D.heroPrice},Wt(X.price,{currency:p.currency||X.currency||"$"})),b&&X.comparePrice&&t.createElement("span",{style:D.heroComparePrice},Wt(X.comparePrice,{currency:p.currency||X.currency||"$"})),re&&t.createElement("span",{style:D.heroDiscount},"-",re,"%")),h&&t.createElement("button",{style:Gt(D.heroButton,V?D.heroButtonHover:void 0),onClick:()=>z?.(X._raw),onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1)},y)),Y.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{...D.sectionTitle,marginBottom:"12px"}},"More Products"),t.createElement("div",{style:D.productsScroll},Y.map((e,r)=>t.createElement("div",{key:e.id,style:Gt(D.productCard,q===e.id?D.productCardHover:void 0),onClick:()=>R?.(e._raw,r+1),onMouseEnter:()=>H(e.id),onMouseLeave:()=>H(null)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:D.productImage,loading:"lazy"}):t.createElement("div",{style:D.productImage}),t.createElement("div",{style:D.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:D.productPrice},Wt(e.price,{currency:p.currency||e.currency||"$"})))))))),void 0!==_?_:t.createElement("div",{style:D.footer},t.createElement("span",null,"Press ",t.createElement("strong",null,"Enter")," to search, ",t.createElement("strong",null,"↑↓")," to navigate"),t.createElement("span",{style:D.footerLink,onClick:()=>T?.("products")},"View all results")))}),Ea=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},t.createElement("circle",{cx:"11",cy:"11",r:"7"}),t.createElement("path",{d:"M21 21l-4.35-4.35"})),wa=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},t.createElement("circle",{cx:"12",cy:"12",r:"10"}),t.createElement("polyline",{points:"12 6 12 12 16 14"})),Sa=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},t.createElement("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18"}),t.createElement("polyline",{points:"17 6 23 6 23 12"})),Ca=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"20",height:"20"},t.createElement("polyline",{points:"9 18 15 12 9 6"})),Ra=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"20",height:"20"},t.createElement("path",{d:"M7 17l5-5-5-5M13 17l5-5-5-5"})),Ia=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],recentSearches:l=[],trendingSearches:c=[],suggestionFields:d={query:"query"},productFields:u={id:"id",title:"title"},productDisplay:p={},theme:m={},showSearchInput:g=!0,showCancel:f=!0,cancelText:h="Cancel",showDragHandle:y=!0,swipeToDismiss:b=!0,footerButtonText:v="Search",showFooterButton:k=!0,width:x="100%",maxHeight:E="85vh",zIndex:w=9999,className:S,style:C,classNames:R={},inputRef:I,onSuggestionSelect:N,onProductClick:z,onRecentClick:T,onRecentClearAll:M,onSearchSubmit:A,onClose:_,header:$,footer:L,renderEmpty:P}=e;Yr();const D=t.useMemo(()=>({overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:9998,transition:"opacity 200ms ease"},root:{position:"fixed",left:0,right:0,bottom:0,backgroundColor:"var(--seekora-bg-surface, transparent)",borderRadius:"16px 16px 0 0",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.15)",fontFamily:'var(--seekora-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif)',fontSize:"var(--seekora-font-size, 16px)",zIndex:9999,transform:"translateY(0)",transition:"transform 300ms cubic-bezier(0.32, 0.72, 0, 1)",maxHeight:"90vh",display:"flex",flexDirection:"column"},rootHidden:{transform:"translateY(100%)"},dragHandle:{display:"flex",justifyContent:"center",padding:"12px",cursor:"grab"},dragBar:{width:"36px",height:"5px",backgroundColor:"var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:"3px"},header:{padding:"0 16px 16px",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))"},searchContainer:{display:"flex",alignItems:"center",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",borderRadius:"12px",padding:"12px 16px",gap:"12px"},searchIcon:{width:"20px",height:"20px",color:"var(--seekora-text-tertiary, #8e8e93)",flexShrink:0},searchInput:{flex:1,border:"none",background:"transparent",fontSize:"17px",color:"var(--seekora-text-primary, inherit)",outline:"none"},cancelBtn:{padding:"8px",background:"none",border:"none",color:"var(--seekora-primary, #007aff)",fontSize:"17px",cursor:"pointer"},content:{flex:1,overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},section:{padding:"8px 0"},sectionHeader:{padding:"16px 16px 8px",display:"flex",alignItems:"center",justifyContent:"space-between"},sectionTitle:{fontSize:"13px",fontWeight:600,color:"var(--seekora-text-secondary, #8e8e93)",textTransform:"uppercase",letterSpacing:"0.5px"},clearBtn:{fontSize:"15px",color:"var(--seekora-primary, #007aff)",background:"none",border:"none",cursor:"pointer"},item:{display:"flex",alignItems:"center",padding:"14px 16px",gap:"14px",cursor:"pointer",transition:"background-color 100ms",minHeight:"56px",color:"var(--seekora-text-primary, inherit)"},itemActive:{backgroundColor:"var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))",color:"var(--seekora-text-primary, inherit)"},itemIcon:{width:"24px",height:"24px",color:"var(--seekora-text-tertiary, #8e8e93)",flexShrink:0},itemImage:{width:"48px",height:"48px",borderRadius:"8px",objectFit:"cover",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",flexShrink:0},itemContent:{flex:1,minWidth:0},itemTitle:{fontSize:"17px",color:"var(--seekora-text-primary, inherit)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemSubtitle:{fontSize:"15px",color:"var(--seekora-text-secondary, inherit)",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemAction:{color:"var(--seekora-text-tertiary, #c7c7cc)",flexShrink:0},productsScroll:{display:"flex",gap:"12px",padding:"0 16px 16px",overflowX:"auto",scrollSnapType:"x mandatory",WebkitOverflowScrolling:"touch"},productCard:{flex:"0 0 140px",scrollSnapAlign:"start",cursor:"pointer"},productImage:{width:"140px",height:"140px",borderRadius:"12px",objectFit:"cover",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",marginBottom:"8px"},productTitle:{fontSize:"15px",color:"var(--seekora-text-primary, inherit)",marginBottom:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},productPrice:{fontSize:"15px",fontWeight:600,color:"var(--seekora-text-primary, inherit)"},footer:{padding:"12px 16px",paddingBottom:"calc(12px + env(safe-area-inset-bottom, 0px))",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))"},footerBtn:{width:"100%",padding:"16px",backgroundColor:"var(--seekora-primary, #007aff)",color:"var(--seekora-text-inverse, transparent)",border:"none",borderRadius:"12px",fontSize:"17px",fontWeight:600,cursor:"pointer"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, inherit)"},spinner:{width:"28px",height:"28px",border:"3px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderTopColor:"var(--seekora-primary, #007aff)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"60px 20px",textAlign:"center",color:"var(--seekora-text-secondary, inherit)",fontSize:"17px"},emptyIcon:{width:"48px",height:"48px",margin:"0 auto 16px",color:"var(--seekora-text-tertiary, #c7c7cc)"}}),[]),F=t.useRef(null),[B,W]=t.useState(-1),[q,H]=t.useState(a),[O,j]=t.useState(0),[V,U]=t.useState(!1),K=t.useRef(0),Q=t.useMemo(()=>s.map(e=>Dt(e,d)),[s,d]),G=t.useMemo(()=>i.map(e=>Ft(e,u)),[i,u]),X=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,5),[l]),Y=t.useMemo(()=>c.map(e=>"string"==typeof e?e:e.query).slice(0,5),[c]),Z=t.useMemo(()=>{const e=[];return X.forEach(t=>e.push({type:"recent",data:t})),Y.forEach(t=>e.push({type:"trending",data:t})),Q.forEach(t=>e.push({type:"suggestion",data:t})),e},[X,Y,Q]),J=t.useCallback(()=>{W(e=>Math.min(e+1,Z.length-1))},[Z.length]),ee=t.useCallback(()=>{W(e=>Math.max(e-1,-1))},[]),te=t.useCallback(()=>{if(B<0||B>=Z.length)return void(q.trim()&&A?.(q.trim()));const e=Z[B];"recent"===e.type||"trending"===e.type?T?.(e.data):"suggestion"===e.type&&N?.(e.data._raw,B)},[B,Z,q,A,T,N]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>B,setActiveIndex:W,selectActive:te,navigateNext:J,navigatePrevious:ee,focus:()=>I?.current?.focus(),close:()=>_?.()}),[B,te,J,ee,I,_]),t.useEffect(()=>{if(B>=0&&F.current){const e=F.current.querySelector(`[data-index="${B}"]`);e&&er(e,F.current)}},[B]);if(t.useEffect(()=>{H(a)},[a]),!o)return null;const re=Kt(m),ae=!q&&X.length>0,oe=!q&&Y.length>0,ne=G.length>0;return t.createElement(t.Fragment,null,t.createElement("div",{style:{...D.overlay,opacity:V?1-O/300:1},onClick:_}),t.createElement("div",{ref:F,className:Qt("seekora-mobile-sheet",S,R.root),style:Gt(D.root,{maxHeight:E,zIndex:w,transform:V?`translateY(${O}px)`:"translateY(0)"},re,C),onTouchStart:e=>{b&&(U(!0),K.current=e.touches[0].clientY)},onTouchMove:e=>{if(!V)return;const t=e.touches[0].clientY-K.current;t>0&&j(t)},onTouchEnd:()=>{V&&(U(!1),O>150&&_?.(),j(0))}},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),y&&t.createElement("div",{style:D.dragHandle},t.createElement("div",{style:D.dragBar})),(g||$)&&t.createElement("div",{style:D.header},$||t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},t.createElement("div",{style:D.searchContainer},t.createElement("div",{style:D.searchIcon},t.createElement(Ea,null)),t.createElement("input",{ref:I,type:"text",placeholder:"Powered by Seekora",value:q,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),B>=0?te():q.trim()&&A?.(q.trim())):"ArrowDown"===e.key?(e.preventDefault(),J()):"ArrowUp"===e.key?(e.preventDefault(),ee()):"Escape"===e.key&&_?.()},style:D.searchInput,autoFocus:!0})),f&&t.createElement("button",{style:D.cancelBtn,onClick:_},h))),t.createElement("div",{style:D.content},t.createElement(t.Fragment,null,ae&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Recent"),t.createElement("button",{style:D.clearBtn,onClick:M},"Clear")),X.map((e,r)=>t.createElement("div",{key:`recent-${e}`,"data-index":r,style:Gt(D.item,B===r?D.itemActive:void 0),onClick:()=>{T?.(e),H(e)},onMouseEnter:()=>W(r)},t.createElement("div",{style:D.itemIcon},t.createElement(wa,null)),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:D.itemTitle},e)),t.createElement("div",{style:D.itemAction},t.createElement(Ra,null))))),oe&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Trending")),Y.map((e,r)=>{const a=X.length+r;return t.createElement("div",{key:`trending-${e}`,"data-index":a,style:Gt(D.item,B===a?D.itemActive:void 0),onClick:()=>{T?.(e),H(e)},onMouseEnter:()=>W(a)},t.createElement("div",{style:D.itemIcon},t.createElement(Sa,null)),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:D.itemTitle},e)),t.createElement("div",{style:D.itemAction},t.createElement(Ca,null)))})),q&&Q.length>0&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Suggestions")),Q.map((e,r)=>{const a=X.length+Y.length+r;return t.createElement("div",{key:e.id||r,"data-index":a,style:Gt(D.item,B===a?D.itemActive:void 0),onClick:()=>N?.(e._raw,r),onMouseEnter:()=>W(a)},t.createElement("div",{style:D.itemIcon},t.createElement(Ea,null)),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:D.itemTitle},Ht(e.query,q,{tag:"strong"})),e.count&&t.createElement("div",{style:D.itemSubtitle},e.count," results")),t.createElement("div",{style:D.itemAction},t.createElement(Ca,null)))})),ne&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Products")),t.createElement("div",{style:D.productsScroll},G.slice(0,8).map((e,r)=>t.createElement("div",{key:e.id,style:D.productCard,onClick:()=>z?.(e._raw,r)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:D.productImage,loading:"lazy"}):t.createElement("div",{style:D.productImage}),t.createElement("div",{style:D.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:D.productPrice},Wt(e.price,{currency:p.currency||e.currency||"$"})))))),q&&0===Q.length&&!n&&(P?P(q):t.createElement("div",{style:D.empty},t.createElement("div",{style:D.emptyIcon},t.createElement(Ea,null)),t.createElement("p",null,'No results for "',q,'"'))))),void 0!==L?L:k&&q&&t.createElement("div",{style:D.footer},t.createElement("button",{style:D.footerBtn,onClick:()=>A?.(q)},v,' "',q,'"'))))}),Na=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],recentSearches:l=[],suggestionFields:c={query:"query"},productFields:d={id:"id",title:"title"},productDisplay:u={},theme:p={},showIndices:m=!1,showTypeLabels:g=!1,showSectionDividers:f=!0,width:h="100%",maxHeight:y="400px",zIndex:b=1e3,className:v,style:k,classNames:x={},onSuggestionSelect:E,onProductClick:w,onRecentClick:S,onClose:C,onSearchSubmit:R,header:I,footer:N,renderEmpty:z}=e;Yr();const T=Qr(),{isMobile:M}=T,A=t.useMemo(()=>({root:{position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e5e5)",fontFamily:'var(--seekora-font-family, "Inter", -apple-system, sans-serif)',fontSize:"var(--seekora-font-size, 15px)",letterSpacing:"-0.01em"},item:{display:"flex",alignItems:"center",padding:"16px 20px",cursor:"pointer",transition:"background-color 150ms ease, padding-left 150ms ease",borderBottom:"1px solid var(--seekora-border-color, #e8e8e8)",gap:"16px",color:"var(--seekora-text-primary, #111)"},itemLast:{borderBottom:"none"},itemActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #111)",paddingLeft:"24px"},itemIndex:{fontSize:"11px",fontWeight:500,color:"var(--seekora-text-tertiary, #999)",fontFamily:"monospace",minWidth:"20px"},itemContent:{flex:1,minWidth:0},itemQuery:{fontSize:"15px",fontWeight:500,color:"var(--seekora-text-primary, #111)"},itemMeta:{fontSize:"13px",color:"var(--seekora-text-secondary, #666)",marginTop:"4px",fontWeight:400},itemType:{fontSize:"10px",fontWeight:600,color:"var(--seekora-text-tertiary, #999)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"4px 8px",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)"},productRow:{display:"flex",alignItems:"center",padding:"16px 20px",cursor:"pointer",transition:"background-color 150ms ease",borderBottom:"1px solid var(--seekora-border-color, #e8e8e8)",gap:"16px",color:"var(--seekora-text-primary, #111)"},productRowActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #111)"},productImage:{width:"56px",height:"56px",objectFit:"cover",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",flexShrink:0},productContent:{flex:1,minWidth:0},productTitle:{fontSize:"14px",fontWeight:500,color:"var(--seekora-text-primary, #111)",marginBottom:"4px"},productPrice:{fontSize:"14px",color:"var(--seekora-text-secondary, #666)"},divider:{padding:"12px 20px 8px",fontSize:"10px",fontWeight:600,color:"var(--seekora-text-tertiary, #999)",textTransform:"uppercase",letterSpacing:"0.15em",backgroundColor:"var(--seekora-bg-surface, #ffffff)",borderBottom:"1px solid var(--seekora-border-color, #f0f0f0)"},footer:{padding:"12px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"var(--seekora-bg-secondary, #fafafa)",fontSize:"12px",color:"var(--seekora-text-tertiary, #999)",borderTop:"1px solid var(--seekora-border-color, #e5e5e5)"},footerHint:{display:"flex",alignItems:"center",gap:"12px"},kbd:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"2px 6px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #ddd)",fontSize:"10px",fontFamily:"monospace"},loading:{padding:"40px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #666)",fontSize:"14px"},empty:{padding:"40px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #666)",fontSize:"14px"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fff3cd)",padding:"0 2px"}}),[]),_=t.useRef(null),$=t.useRef(null),[L,P]=t.useState(-1),D=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),F=t.useMemo(()=>i.map(e=>Ft(e,d)),[i,d]),B=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,3),[l]),W=t.useMemo(()=>{const e=[];return!a&&B.length>0&&B.forEach(t=>e.push({type:"recent",data:t})),D.forEach(t=>e.push({type:"suggestion",data:t})),F.forEach(t=>e.push({type:"product",data:t})),e},[a,B,D,F]),q=t.useCallback(()=>{P(e=>Math.min(e+1,W.length-1))},[W.length]),H=t.useCallback(()=>{P(e=>Math.max(e-1,-1))},[]),O=t.useCallback(()=>{const e=W[L];if(e)switch(e.type){case"recent":S?.(e.data);break;case"suggestion":E?.(e.data._raw,L);break;case"product":w?.(e.data._raw,L)}else a&&R?.(a)},[L,W,a,R,S,E,w]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>L,setActiveIndex:P,selectActive:O,navigateNext:q,navigatePrevious:H,focus:()=>_.current?.focus(),close:()=>C?.()}),[L,O,q,H,C]),t.useEffect(()=>{if($.current&&L>=0){const e=$.current.querySelector(`[data-index="${L}"]`);e&&er(e,$.current)}},[L]),t.useEffect(()=>{P(-1)},[a]),!o)return null;const j=Kt(p),V=!a&&B.length>0;let U=0;return t.createElement("div",{ref:_,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-minimal-dropdown",v,x.root),style:Gt(A.root,{width:h,zIndex:b},j,k),tabIndex:-1},t.createElement("style",null,"\n .seekora-minimal-dropdown mark {\n background-color: var(--seekora-highlight-bg, #fff3cd);\n padding: 0 2px;\n }\n "),I,t.createElement("div",{ref:$,style:{maxHeight:y,overflowY:"auto"}},0===W.length?z?z(a):t.createElement("div",{style:A.empty},a?`No results for "${a}"`:"Start typing to search"):t.createElement(t.Fragment,null,V&&t.createElement(t.Fragment,null,f&&t.createElement("div",{style:A.divider},"Recent"),B.map((e,r)=>{const a=U++,o=L===a,n=r===B.length-1&&!D.length&&!F.length;return t.createElement("div",{key:`recent-${e}`,"data-index":a,style:Gt(A.item,o?A.itemActive:void 0,n?A.itemLast:void 0),onClick:()=>S?.(e),onMouseEnter:()=>P(a)},m&&t.createElement("span",{style:A.itemIndex},a+1),t.createElement("div",{style:A.itemContent},t.createElement("div",{style:A.itemQuery},e)),g&&t.createElement("span",{style:A.itemType},"Recent"))})),D.length>0&&t.createElement(t.Fragment,null,f&&(V||!1)&&t.createElement("div",{style:A.divider},"Suggestions"),D.map((e,r)=>{const o=U++,n=L===o,s=r===D.length-1&&!F.length;return t.createElement("div",{key:e.id||`suggestion-${r}`,"data-index":o,style:Gt(A.item,n?A.itemActive:void 0,s?A.itemLast:void 0),onClick:()=>E?.(e._raw,r),onMouseEnter:()=>P(o)},m&&t.createElement("span",{style:A.itemIndex},o+1),t.createElement("div",{style:A.itemContent},t.createElement("div",{style:A.itemQuery},Ht(e.query,a,{tag:"mark"})),e.count&&t.createElement("div",{style:A.itemMeta},e.count.toLocaleString()," results")),g&&t.createElement("span",{style:A.itemType},"Search"))})),F.length>0&&t.createElement(t.Fragment,null,f&&t.createElement("div",{style:A.divider},"Products"),F.slice(0,4).map((e,r)=>{const a=U++,o=L===a;return t.createElement("div",{key:e.id,"data-index":a,style:Gt(A.productRow,o?A.productRowActive:void 0),onClick:()=>w?.(e._raw,r),onMouseEnter:()=>P(a)},e.image&&t.createElement("img",{src:e.image,alt:e.title,style:A.productImage,loading:"lazy"}),t.createElement("div",{style:A.productContent},t.createElement("div",{style:A.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:A.productPrice},Wt(e.price,{currency:u.currency||e.currency||"$"}))),g&&t.createElement("span",{style:A.itemType},"Product"))})))),void 0!==N?N:t.createElement("div",{style:A.footer},t.createElement("div",{style:A.footerHint},t.createElement("span",null,t.createElement("span",{style:A.kbd},"↑")," ",t.createElement("span",{style:A.kbd},"↓")," navigate"),t.createElement("span",null,t.createElement("span",{style:A.kbd},"↵")," select"),t.createElement("span",null,t.createElement("span",{style:A.kbd},"esc")," close")),t.createElement("span",null,W.length," results")))});function za(e){if(!e)return;const t=e,r=t.colors??{};return{backgroundColor:t.backgroundColor??r.background,textColor:t.textColor??r.text,surfaceColor:t.surfaceColor??r.hover,borderColor:t.borderColor??r.border,hoverColor:t.hoverColor??r.hover,primaryColor:t.primaryColor??r.primary,textSecondaryColor:t.textSecondaryColor??r.text,fontFamily:t.fontFamily}}const Ta={amazon:aa,google:la,pinterest:ma,spotlight:ba,shopify:xa,"mobile-sheet":Ia,minimal:Na},Ma=t.forwardRef(function(e,r){const{client:a,variant:o="amazon",autoMobileVariant:n=!0,placeholder:s="Powered by Seekora",defaultQuery:i="",value:l,minQueryLength:c=1,maxSuggestions:d=8,debounceMs:u=200,includeDropdownRecommendations:p=!0,includeDropdownProductList:m=!0,includeFilteredTabs:g=!0,includeCategories:f=!0,filteredTabs:h,analyticsTags:y,enableRecentSearches:b=!0,maxRecentSearches:v=10,showProducts:k=!0,showTrendingOnEmpty:x=!0,enableAnalytics:E=!0,analyticsConfig:S,suggestionFields:C,productFields:R,theme:I,onSearch:N,onQueryChange:z,onSuggestionSelect:T,onProductClick:M,onCategoryClick:A,onTabChange:_,className:$,style:L,inputClassName:P,dropdownWidth:D,dropdownMaxHeight:F="500px",zIndex:B=1e3,enableCache:W=!0,cacheTtlMs:q=3e4,cacheMaxSize:H=100}=e,O=w(),j=I??O.theme,V=Qe({client:a,enabled:E,analyticsTags:S?.tags??y,trackImpressions:S?.trackImpressions??!0,trackClicks:S?.trackSuggestionClicks??!0});Yr(),t.useEffect(()=>{const e=document.documentElement,t=function(e){if(!e)return{"--seekora-bg-surface":"#ffffff","--seekora-bg-secondary":"#f7f7f7","--seekora-bg-tertiary":"#f0f0f0","--seekora-bg-hover":"#f5f5f5","--seekora-text-primary":"#0f1111","--seekora-text-secondary":"#565959","--seekora-text-tertiary":"#767676","--seekora-border-color":"#e7e7e7","--seekora-primary":"#f90","--seekora-text-on-primary":"#0f1111","--seekora-text-inverse":"#ffffff","--seekora-link":"#007185","--seekora-font-family":'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};const t=e,r=t.colors??{};return{"--seekora-bg-surface":t.backgroundColor??r.background??"#ffffff","--seekora-bg-secondary":t.surfaceColor??r.hover??"#f7f7f7","--seekora-bg-tertiary":t.hoverColor??r.hover??"#f0f0f0","--seekora-bg-hover":t.hoverColor??r.hover??"#f5f5f5","--seekora-text-primary":t.textColor??r.text??"#0f1111","--seekora-text-secondary":t.textSecondaryColor??r.text??"#565959","--seekora-text-tertiary":t.textSecondaryColor??"#767676","--seekora-border-color":t.borderColor??r.border??"#e7e7e7","--seekora-primary":t.primaryColor??r.primary??"#f90","--seekora-text-on-primary":t.textOnPrimaryColor??"#0f1111","--seekora-text-inverse":t.textInverseColor??"#ffffff","--seekora-link":t.primaryColor??r.primary??"#007185","--seekora-font-family":t.fontFamily??'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'}}(j);Object.entries(t).forEach(([t,r])=>{e.style.setProperty(t,r)})},[j]);const U=Qr(),{isMobile:K}=U,Q=t.useMemo(()=>n&&K&&"mobile-sheet"!==o&&"spotlight"!==o?"mobile-sheet":o,[o,K,n]),[G,X]=t.useState(i),[Y,Z]=t.useState(!1),[J,ee]=t.useState(!1),[te,re]=t.useState(!1),[ae,oe]=t.useState([]),[ne,se]=t.useState([]),[ie,le]=t.useState([]),[ce,de]=t.useState([]),[ue,pe]=t.useState([]),[me,ge]=t.useState([]),[fe,he]=t.useState("all"),ye=t.useRef(null),be=t.useRef(null),ve=t.useRef(null),ke=t.useRef(null),xe=t.useMemo(()=>W?ar({maxSize:H,defaultTtlMs:q}):null,[W,H,q]),Ee=void 0!==l?l:G,we=t.useMemo(()=>(e=>({container:{position:"relative",width:"100%",fontFamily:'var(--seekora-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif)'},inputWrapper:{display:"flex",alignItems:"center",backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #111827)",borderWidth:"2px",borderStyle:"solid",borderColor:"var(--seekora-border-color, #d1d5db)",borderRadius:e?"8px":"24px",overflow:"hidden",transition:"border-color 150ms, box-shadow 150ms",boxShadow:"0 1px 3px rgba(0,0,0,0.05)"},inputWrapperFocused:{borderColor:"var(--seekora-primary, #f90)",boxShadow:"0 0 0 3px rgba(255, 153, 0, 0.15), 0 2px 8px rgba(0,0,0,0.1)"},searchIcon:{padding:e?"0 10px 0 14px":"0 12px 0 18px",color:"var(--seekora-text-secondary, #6b7280)",display:"flex",alignItems:"center",flexShrink:0},input:{flex:1,padding:e?"12px 8px 12px 0":"14px 12px 14px 0",fontSize:e?"16px":"15px",borderWidth:0,borderStyle:"none",outline:"none",backgroundColor:"transparent",color:"var(--seekora-text-primary, #0f1111)",fontFamily:"inherit",minWidth:0,WebkitAppearance:"none"},clearButton:{padding:"8px 14px",background:"none",borderWidth:0,borderStyle:"none",cursor:"pointer",color:"var(--seekora-text-tertiary, #9ca3af)",fontSize:"18px",lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"color 150ms"}}))(K),[K]);t.useEffect(()=>{if(b){const e=Yt();ge(e.slice(0,v))}},[b,v]);const Se=t.useCallback(async e=>{if(!a)return;if(e.length>0&&e.length<c)return oe([]),se([]),void de([]);const t={maxSuggestions:d,includeDropdownRecommendations:p,includeDropdownProductList:m,includeFilteredTabs:g,includeCategories:f,filteredTabs:h?.map(e=>e.filter).join(",")},r=xe?.generateKey(e,t);if(xe&&r){const t=xe.get(r);if(t)return console.log("Seekora: Cache hit for query:",e),void Ce(t)}re(!0);try{const t=await(a.getSuggestions?.(e,{hitsPerPage:d,include_dropdown_recommendations:p,include_dropdown_product_list:m,include_filtered_tabs:g,include_categories:f,include_facets:!0,filtered_tabs:h,analytics_tags:y,returnFullResponse:!0}));if(xe&&r&&t&&(xe.set(r,t),console.log("Seekora: Cached response for query:",e)),Ce(t),E&&t&&!Array.isArray(t)){const r=t;V.trackImpression({suggestions:(r.suggestions||[]).map(e=>({query:e.query||e.text||"",objectID:e.objectID||e.id,popularity:e.popularity})),products:r.extensions?.trending_products||r.extensions?.item_recommendations||[],categories:r.extensions?.popular_categories||[],brands:r.extensions?.popular_brands||[],query:e,timestamp:Date.now()})}}catch(e){console.error("Seekora: Failed to fetch suggestions",e),oe([]),se([]),de([])}finally{re(!1)}},[a,c,d,p,m,g,f,h,y,E,V,xe]),Ce=t.useCallback(e=>{let t=[],r={};if(console.log("Seekora: Raw response structure",{hasSuggestions:!!e?.suggestions,hasResults:!!e?.results,hasExtensions:!!e?.extensions,hasData:!!e?.data}),e?.suggestions&&e?.extensions)t=e.suggestions||[],r=e.extensions||{};else if(e?.results&&Array.isArray(e.results)){const a=e.results[0]||{},o=e.results[1]||{};t=a.hits||a.suggestions||[],r=a.extensions||o.extensions||{}}else e?.data?(t=e.data.hits||[],r=e.data.extensions||e.data.dropdown_recommendations||{}):e?.hits?(t=e.hits||[],r=e.extensions||e.dropdown_recommendations||{}):Array.isArray(e)&&(t=e);oe(t);const a=r.filtered_tabs||[];de(a),a.length>0&&a[0].products?se(a[0].products):se(r.trending_products||r.item_recommendations||[]),le(r.popular_categories||[]),pe(r.trending_searches||r.top_searches||[]),console.log("Seekora: Parsed response",{suggestions:t.length,tabs:a.length,products:a[0]?.products?.length||0,extensionKeys:Object.keys(r)})},[]),Re=t.useCallback(e=>{const t=e.target.value;void 0===l&&X(t),z?.(t),he("all"),ve.current&&clearTimeout(ve.current),t.length>=c?(Z(!0),ve.current=setTimeout(()=>{Se(t)},u)):0===t.length&&(b||x)?(Z(!0),oe([])):Z(!1)},[l,z,c,u,Se,b,x]),Ie=t.useCallback(()=>{ee(!0),Z(!0),E&&V.trackDropdownOpen(Ee),Ee.length>=c?0===ae.length&&Se(Ee):Se("")},[Ee,c,ae.length,Se,E,V]),Ne=t.useCallback(()=>{ee(!1),setTimeout(()=>{ke.current?.contains(document.activeElement)||Z(!1)},150)},[]),ze=t.useCallback(e=>{if("Escape"===e.key)Z(!1),ye.current?.blur();else if("Enter"===e.key){e.preventDefault();(be.current?.getActiveIndex?.()??-1)>=0&&Y?be.current?.selectActive?.():Ee.trim()&&(N?.(Ee.trim()),b&&(Zt(Ee.trim()),ge(Yt().slice(0,v))),E&&V.trackSearchSubmit(Ee.trim(),!1),Z(!1))}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),!Y&&(ae.length>0||me.length>0)&&Z(!0),"ArrowDown"===e.key?be.current?.navigateNext?.():be.current?.navigatePrevious?.())},[Ee,N,b,v,Y,ae.length,me.length,E,V]),Te=t.useCallback((e,t)=>{const r=e.query||e.text||e.objectID||"";void 0===l&&X(r),z?.(r),T?.(e,t),b&&r&&(Zt(r),ge(Yt().slice(0,v))),E&&(V.trackSuggestionClick({suggestion:{query:r,objectID:e.objectID||e.id,popularity:e.popularity},position:t,section:"suggestions",query:Ee,totalSuggestions:ae.length}),V.trackSearchSubmit(r,!0,e)),N?.(r),Z(!1)},[l,z,T,b,v,E,N,V,Ee,ae.length]),Me=t.useCallback((e,t)=>{M?.(e,t),E&&V.trackProductClick({product:{id:e.id||e.objectID,objectID:e.objectID||e.id,title:e.title||e.name,image:e.image,price:e.price},position:t,section:"all"!==fe?"filtered_tab":"products",tabId:"all"!==fe?fe:void 0,query:Ee})},[M,E,V,fe,Ee]),Ae=t.useCallback((e,t)=>{A?.(e,t),E&&V.trackCategoryClick({value:e.label||e.value||e.id,count:e.count,path:e.path},Ee)},[A,E,V,Ee]),_e=t.useCallback(e=>{if(console.log("Seekora: Tab changed to",e),he(e),_?.(e),E){const t=ce.find(t=>t.id===e);t&&V.trackTabSelect({id:t.id,label:t.label,filter:t.filter,products:t.products,nb_hits:t.nb_hits},Ee)}},[_,E,V,ce,Ee]),$e=t.useCallback(e=>{void 0===l&&X(e),z?.(e),Se(e),E&&V.trackRecentSearchClick({query:e,timestamp:Date.now()})},[l,z,Se,E,V]),Le=t.useCallback(e=>{Jt(e),ge(Yt().slice(0,v))},[v]),Pe=t.useCallback(()=>{void 0===l&&X(""),z?.(""),oe([]),se([]),de([]),ye.current?.focus()},[l,z]),De=t.useCallback(()=>{Z(!1),E&&V.trackDropdownClose(Ee)},[E,V,Ee]);t.useImperativeHandle(r,()=>({focus:()=>ye.current?.focus(),blur:()=>ye.current?.blur(),clear:Pe,getQuery:()=>Ee,setQuery:e=>{void 0===l&&X(e),z?.(e)},openDropdown:()=>Z(!0),closeDropdown:()=>Z(!1),refresh:()=>Se(Ee),clearCache:()=>xe?.clear(),getCacheStats:()=>xe?.getStats()??null}),[Ee,l,z,Pe,Se,xe]);const Fe=Ta[Q]||aa,Be=t.useMemo(()=>{if(console.log("Seekora: Computing products for tab",fe,"from",ce.length,"tabs"),0===ce.length)return ne;if("all"===fe){const e=ce[0]?.products||[];return e.length>0?e:ne}const e=ce.find(e=>e.id===fe);return e?.products&&e.products.length>0?(console.log("Seekora: Found",e.products.length,"products for tab",fe),e.products):ne},[fe,ce,ne]);return t.createElement("div",{ref:ke,className:Qt("seekora-suggestion-search",$),style:Gt(we.container,L)},t.createElement("div",{style:Gt(we.inputWrapper,J?we.inputWrapperFocused:void 0)},t.createElement("div",{style:we.searchIcon},t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"20",height:"20"},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"}))),t.createElement("input",{ref:ye,type:"text",value:Ee,onChange:Re,onFocus:Ie,onBlur:Ne,onKeyDown:ze,placeholder:s,className:P,style:we.input,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":"Search","aria-expanded":Y,"aria-haspopup":"listbox"}),Ee&&t.createElement("button",{type:"button",onClick:Pe,style:we.clearButton,"aria-label":"Clear search"},"×")),Y&&t.createElement(Fe,{query:Ee,isOpen:Y,loading:te,suggestions:ae,products:Be,categories:ce.map(e=>({id:e.id,label:e.label,count:e.nb_hits})),recentSearches:me.map(e=>"string"==typeof e?e:e.query),trendingSearches:ue,filteredTabs:ce,activeTab:fe,suggestionFields:C,productFields:R,theme:za(j)??j,width:D||"100%",maxHeight:F,zIndex:B,analytics:{enabled:E,trackSuggestionClicks:S?.trackSuggestionClicks??!0,trackProductClicks:S?.trackProductClicks??!0,trackImpressions:S?.trackImpressions??!0,trackCategoryClicks:S?.trackCategoryClicks??!0,trackBrandClicks:S?.trackBrandClicks??!0,trackSearchSubmit:S?.trackSearchSubmit??!0,tags:S?.tags??y},onSuggestionSelect:Te,onProductClick:Me,onCategoryClick:Ae,onTabChange:_e,onRecentClick:$e,onRecentRemove:Le,onClose:De}))}),Aa={amazon:aa,google:la,pinterest:ma,spotlight:ba,shopify:xa,"mobile-sheet":Ia,minimal:Na};function _a({isOpen:e,onClose:a,children:o}){const n=t.useRef(null),s=t.useRef(null);if(t.useEffect(()=>{const t=e=>{s.current&&!s.current.contains(e.target)&&a()};return e&&document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e,a]),t.useEffect(()=>{if(e){const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e]),t.useEffect(()=>{if(!e||!s.current)return;const t=s.current,r=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),a=r[0],o=r[r.length-1],n=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===a&&(e.preventDefault(),o?.focus()):document.activeElement===o&&(e.preventDefault(),a?.focus()))};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[e]),!e||"undefined"==typeof document)return null;const i=t.createElement("div",{ref:n,className:"seekora-docsearch-overlay",role:"dialog","aria-modal":"true","aria-label":"Search documentation"},t.createElement("div",{ref:s,className:"seekora-docsearch-container"},o));return r.createPortal(i,document.body)}function $a({value:e,onChange:r,onKeyDown:a,placeholder:o="Search documentation...",onClear:n}){const s=t.useRef(null);t.useEffect(()=>{s.current&&s.current.focus()},[]);return t.createElement("div",{className:"seekora-docsearch-searchbox"},t.createElement("label",{className:"seekora-docsearch-searchbox-icon",htmlFor:"seekora-docsearch-input"},t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},t.createElement("path",{d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",fill:"currentColor"}))),t.createElement("input",{ref:s,id:"seekora-docsearch-input",className:"seekora-docsearch-input",type:"text",value:e,onChange:e=>r(e.target.value),onKeyDown:a,placeholder:o,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"seekora-docsearch-results"}),e&&t.createElement("button",{type:"button",className:"seekora-docsearch-clear",onClick:()=>{r(""),n?.(),s.current?.focus()},"aria-label":"Clear search"},t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},t.createElement("path",{d:"M4.28 3.22a.75.75 0 00-1.06 1.06L6.94 8l-3.72 3.72a.75.75 0 101.06 1.06L8 9.06l3.72 3.72a.75.75 0 101.06-1.06L9.06 8l3.72-3.72a.75.75 0 00-1.06-1.06L8 6.94 4.28 3.22z",fill:"currentColor"}))))}function La({value:e,highlightedValue:r}){return r?t.createElement("span",{className:"seekora-docsearch-highlight",dangerouslySetInnerHTML:{__html:(a=r,a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/&lt;mark&gt;/g,"<mark>").replace(/&lt;\/mark&gt;/g,"</mark>").replace(/&lt;ais-highlight&gt;/g,"<mark>").replace(/&lt;\/ais-highlight&gt;/g,"</mark>").replace(/&lt;em&gt;/g,"<mark>").replace(/&lt;\/em&gt;/g,"</mark>"))}}):t.createElement("span",null,e);var a}function Pa({hit:e,isSelected:r,onClick:a,onMouseEnter:o,openInNewTab:n,isChild:s,isLastChild:i,hierarchyType:l}){const c="objectID"in e,d=e,u=l||d.type,p=d.parentTitle?`${d.category||""} › ${d.parentTitle}`.replace(/^› /,""):d.category||"",m=function(e,t){const r=e.hierarchy||{};if(!t)return e.title||r.lvl1||r.lvl0||"Untitled";const a=t.match(/^lvl(\d+)$/);if(a){const e=r[`lvl${parseInt(a[1],10)}`];if(e)return e}return e.title||r.lvl1||r.lvl0||"Untitled"}(e,u);let g=m,f=e.content||d.description||"";if(c){const t=e;t._highlightResult&&(g=t._highlightResult.title?.value||m,f=t._highlightResult.content?.value||e.content||"")}else d.highlight&&(g=d.highlight.title||m,f=d.highlight.content||e.content||d.description||"");const h=f?function(e,t=150){const r=e.indexOf("<mark>");if(-1===r||e.length<=t)return e.length<=t?e:e.slice(0,t)+"...";const a=Math.floor(t/2);let o=Math.max(0,r-a),n=Math.min(e.length,r+a);if(o>0){const t=e.indexOf(" ",o);-1!==t&&t<r&&(o=t+1)}if(n<e.length){const t=e.lastIndexOf(" ",n);-1!==t&&t>r&&(n=t)}let s=e.slice(o,n);return o>0&&(s="..."+s),n<e.length&&(s+="..."),s}(f,120):"",y=e.url||d.route||"#",b=["seekora-docsearch-hit"];return r&&b.push("seekora-docsearch-hit--selected"),s&&b.push("seekora-docsearch-hit--child"),i&&b.push("seekora-docsearch-hit--last-child"),t.createElement("a",{href:y,className:b.join(" "),onClick:e=>{e.preventDefault(),a()},onMouseEnter:o,role:"option","aria-selected":r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0},s&&t.createElement("div",{className:"seekora-docsearch-hit-tree"},t.createElement(Ba,{isLast:i})),t.createElement("div",{className:"seekora-docsearch-hit-icon"},t.createElement(Fa,{type:Da(u)})),t.createElement("div",{className:"seekora-docsearch-hit-content"},!s&&p&&t.createElement("span",{className:"seekora-docsearch-hit-breadcrumb"},p),t.createElement("span",{className:"seekora-docsearch-hit-title"},t.createElement(La,{value:m,highlightedValue:g})),h&&t.createElement("span",{className:"seekora-docsearch-hit-description"},t.createElement(La,{value:e.content||"",highlightedValue:h}))),t.createElement("div",{className:"seekora-docsearch-hit-action"},n?t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M6 3H3v10h10v-3M9 3h4v4M14 2L7 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})):t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M6.75 3.25L11.5 8L6.75 12.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))))}function Da(e){if(!e)return"page";const t=e.match(/^lvl(\d+)$/);if(t){const e=parseInt(t[1],10);return 1===e?"page":e<=3?"section":"content"}return"page"}function Fa({type:e}){switch(e){case"page":return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M4.5 3.5h11a1 1 0 011 1v11a1 1 0 01-1 1h-11a1 1 0 01-1-1v-11a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),t.createElement("path",{d:"M7 7h6M7 10h6M7 13h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}));case"section":return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M4 5.5h12M4 10h12M4 14.5h8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}));case"content":return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M4 6h12M4 10h8M4 14h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))}}function Ba({isLast:e}){return t.createElement("svg",{width:"16",height:"20",viewBox:"0 0 16 20",fill:"none","aria-hidden":"true",className:"seekora-docsearch-hit-tree-icon"},e?t.createElement("path",{d:"M8 0V10H14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):t.createElement(t.Fragment,null,t.createElement("path",{d:"M8 0V20",stroke:"currentColor",strokeWidth:"1.5"}),t.createElement("path",{d:"M8 10H14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})))}function Wa(e){if(!e)return 1;const t=e.match(/^lvl(\d+)$/);return t?parseInt(t[1],10):1}function qa(e){return Wa(e)>=2}function Ha(e){const t=e.hierarchy??{};return[t.lvl0??"",t.lvl1??"",t.lvl2??"",t.lvl3??"",t.lvl4??"",t.lvl5??""].join("\0")}function Oa(e){const t=e.hierarchy??{},r=[t.lvl0,t.lvl1,t.lvl2,t.lvl3,t.lvl4,t.lvl5].filter(e=>"string"==typeof e&&e.length>0),a=[];for(const e of r)a[a.length-1]!==e&&a.push(e);return a.join(" › ")}function ja(e,t){return"objectID"in e?e.objectID:`suggestion-${e.url}-${t}`}function Va({hits:e,groupedHits:r,selectedIndex:a,onSelect:o,onHover:n,scrollSelectionIntoViewRef:s,query:i,isLoading:l,error:c,translations:d={},sources:u=[]}){const p=t.useRef(null);if(t.useEffect(()=>{if(!p.current||0===e.length)return;if(s&&!s.current)return;const t=p.current.querySelectorAll(".seekora-docsearch-results-group");let r=0;for(const e of t){const t=e.querySelector(".seekora-docsearch-results-group-items");if(!t)continue;const o=t.children;for(let e=0;e<o.length;e++){if(r===a)return o[e].scrollIntoView({block:"nearest"}),void(s&&(s.current=!1));r++}}s&&(s.current=!1)},[a,e.length,s]),!i)return t.createElement("div",{className:"seekora-docsearch-empty"},t.createElement("p",{className:"seekora-docsearch-empty-text"},d.searchPlaceholder||"Type to start searching..."));if(l&&0===e.length)return t.createElement("div",{className:"seekora-docsearch-empty"});if(c)return t.createElement("div",{className:"seekora-docsearch-error"},t.createElement("p",{className:"seekora-docsearch-error-text"},d.errorText||c));if(0===e.length&&i)return t.createElement("div",{className:"seekora-docsearch-no-results"},t.createElement("p",{className:"seekora-docsearch-no-results-text"},d.noResultsText||`No results found for "${i}"`));const m=r&&r.length>0?r.map(e=>({category:e.source.name,sourceId:e.source.id,openInNewTab:e.source.openInNewTab,hits:e.items})):function(e){const t=new Map;e.forEach((e,r)=>t.set(e,r));const r=new Map;for(const t of e){const e=Ha(t);r.has(e)||r.set(e,[]),r.get(e).push(t)}const a=Array.from(r.entries());a.sort(([,e],[,r])=>Math.min(...e.map(e=>t.get(e)??0))-Math.min(...r.map(e=>t.get(e)??0)));const o=[];for(const[,e]of a){const t=[...e].sort((e,t)=>{const r=e.type,a=t.type;return Wa(r)-Wa(a)}),r=t.map((e,r)=>{const a=qa(e.type),o=t[r+1],n=a&&(!o||!qa(o.type));return{...e,isChild:a,isLastChild:n}}),a=Oa(e[0]);o.push({category:a||null,hits:r})}return o}(e).map(e=>({category:e.category,sourceId:"default",openInNewTab:!1,hits:e.hits}));return t.createElement("div",{className:"seekora-docsearch-results"},t.createElement("ul",{ref:p,id:"seekora-docsearch-results",className:"seekora-docsearch-results-list",role:"listbox"},m.map((e,r)=>t.createElement("li",{key:e.sourceId+"-"+r,className:"seekora-docsearch-results-group"},e.category&&t.createElement("div",{className:"seekora-docsearch-results-group-header"},e.category),t.createElement("ul",{className:"seekora-docsearch-results-group-items"},e.hits.map((s,i)=>{const l=function(e,t,r){let a=0;for(let r=0;r<t;r++)a+=e[r].hits.length;return a+r}(m,r,i),c=s;return t.createElement("li",{key:ja(s,i)},t.createElement(Pa,{hit:s,isSelected:l===a,onClick:()=>o(s),onMouseEnter:()=>n(l),openInNewTab:e.openInNewTab,isChild:c.isChild,isLastChild:c.isLastChild,hierarchyType:s.type}))}))))))}function Ua(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 844.6 192",height:"20","aria-hidden":"true",style:{width:"auto"}},t.createElement("path",{fill:"#03d1ff",d:"M73.06,85.38l-21.36,21.21-2.03,2.03c-3.19,3.19-8.3,2.84-11.07-.32-.52-.59-.95-1.27-1.27-2.04-.01-.03-.03-.07-.04-.1-.33-.79-.63-1.6-.92-2.41-1.59-4.57-2.44-9.48-2.42-14.6h.05c-.01-.13-.01-.27-.02-.4-.02-.46-.02-.92-.02-1.39,0-27.3,22.13-49.43,49.43-49.43,6.64,0,12.98,1.31,18.76,3.69-2.19,2.23-3.28,5.47-2.63,8.76.31,1.52.95,2.89,1.84,4.04.27.36.58.7.9,1.02-.12-.07-.25-.15-.38-.22-5.45-3.15-11.76-4.94-18.49-4.94-20.48,0-37.08,16.6-37.08,37.08,0,.42,0,.83.02,1.25h0c.08,2.58.43,5.09,1.02,7.5l.18-.18,4.98-4.99,10.15-10.15,4.32-4.32c2.43-2.43,5.96-3.35,9.26-2.41.01,0,.03,0,.04.01.05.01.1.02.15.04,2.04.62,3.76,1.88,4.94,3.55.78,1.08,1.32,2.33,1.59,3.67l1.28,6.5.32,1.63.02.14.42-.44,14.99-15.62,3.29-3.43,7.25-7.57,1.18-1.22,2.43-2.54,5.02-5.24.91-.95,1.71-1.78-1.31.25-2.68.53-.47.09-3.52.7h0s-4.01.8-4.01.8c-2.55.5-5.04-1.16-5.55-3.71-.45-2.26.8-4.47,2.87-5.3.27-.11.55-.19.85-.25l9.8-1.94,7.42-1.47,3.23-.63,4.96-.98c.12-.02.25-.05.37-.06.11-.01.22-.02.32-.03.22-.01.43,0,.65.01.96.08,1.89.47,2.65,1.12.81.69,1.35,1.62,1.56,2.64.03.15.05.29.07.44.02.23.03.45.02.68l-.23,6.05-.14,4.01-.05,1.44-.49,13.48v.24c-.09,2.55-2.19,4.55-4.72,4.55-.06,0-.11,0-.17,0-1.1-.04-2.1-.45-2.88-1.11-1.07-.9-1.73-2.27-1.67-3.78l.02-.59.09-2.55.12-3.52.12-3.51-50.81,54.4-5.17-27.42Z"}),t.createElement("path",{fill:"#4d66fe",d:"M23.04,158.85c-.27-1.39.15-2.83,1.12-3.85l22.71-23.81,3.29-3.43,7.25-7.57,1.18-1.22,7.46-7.77,1.77-1.85,2.56,12.48.14.31h0c2.32.86,4.75,1.49,7.27,1.88v12.46c-5.94-.67-11.56-2.39-16.67-4.98l-35.87,38.45-2.2-11.08Z"}),t.createElement("path",{fill:"#4d66fe",d:"M90.69,106.76v29.36c-2.22.31-4.49.47-6.79.47-.34,0-.67,0-1.01-.02v-21.93l7.8-7.88Z"}),t.createElement("polygon",{fill:"#4d66fe",points:"102.78 132.84 102.78 118.68 102.79 93.73 94.96 101.92 94.96 135.35 102.78 132.84"}),t.createElement("polygon",{fill:"#4d66fe",points:"114.86 125.64 114.87 104.87 114.88 81.6 107.05 89.78 107.05 130.82 114.86 125.64"}),t.createElement("path",{fill:"#4d66fe",d:"M126.98,69.42l-.02,23.28v18.6c-2.13,3.83-4.77,7.35-7.81,10.45v-44.13l7.83-8.19Z"}),t.createElement("path",{fill:"currentColor",d:"M455.59,136.31h-14.71l-.11-98.11h14.71l.11,98.11ZM520.86,136.65h-18.17l-27.34-32.14c-2.31-2.88-4.04-5.72-5.19-8.51-1.15-2.79-1.73-5.53-1.73-8.22s.55-5.57,1.66-8.36c1.1-2.79,2.86-5.63,5.26-8.51l27.73-32.54h16.87l-31.05,36.87c-1.92,2.4-3.39,4.57-4.4,6.49-1.01,1.92-1.51,3.8-1.51,5.62s.5,3.65,1.51,5.48c1.01,1.83,2.47,3.94,4.4,6.35l31.96,37.47Z"}),t.createElement("path",{fill:"currentColor",d:"M710.73,117.25c-2.6-5.48-5.14-10.12-7.64-13.92-2.5-3.8-5.48-6.68-8.94-8.65-.31-.18-.64-.33-.96-.49,2.69-.58,5.18-1.44,7.45-2.61,4.52-2.31,8.05-5.53,10.6-9.66,2.55-4.13,3.82-8.89,3.82-14.28,0-6.63-1.61-12.11-4.83-16.44-3.22-4.33-7.6-7.55-13.12-9.66-5.53-2.11-11.71-3.17-18.53-3.17h-33.61v98.14h14.42l.13-36.69h11.99c4.52,0,8.2.79,11.03,2.38,2.84,1.59,5.24,3.8,7.21,6.63,1.97,2.84,3.92,6.13,5.84,9.88l8.89,17.8h15.87l-9.61-19.24ZM659.55,86.67l.12-34.76h19.04c3.94,0,7.52.6,10.75,1.8,3.22,1.2,5.77,3.03,7.64,5.48,1.88,2.45,2.81,5.7,2.81,9.74s-.91,7.09-2.74,9.74c-1.83,2.65-4.38,4.64-7.64,5.99-3.27,1.35-6.97,2.02-11.11,2.02h-18.87Z"}),t.createElement("path",{fill:"currentColor",d:"M618.36,62.91c-2.26-4.27-5.09-8.11-8.5-11.53-4.5-4.49-9.72-8.01-15.65-10.55-5.94-2.54-12.39-3.8-19.38-3.8s-13.47,1.27-19.45,3.8c-5.98,2.54-11.22,6.06-15.72,10.55-4.5,4.5-8.02,9.74-10.55,15.72-2.54,5.98-3.81,12.47-3.81,19.45s1.27,13.66,3.81,19.74c2.53,6.08,6.05,11.37,10.55,15.86,4.49,4.5,9.74,8.02,15.72,10.55,5.98,2.54,12.46,3.81,19.45,3.81s13.44-1.27,19.38-3.81c5.94-2.53,11.15-6.05,15.65-10.55,4.23-4.23,7.58-9.18,10.03-14.82.15-.35.3-.69.44-1.04.57-1.4,1.08-2.83,1.52-4.28l12.51,4.15-2.67-20.65-2.66-20.65-7.32,6.03-9.78,8.06-3.24,2.67-13.86,11.43,12.73,4.23c-.32,1.16-.71,2.3-1.15,3.42-.26.65-.53,1.28-.82,1.9-1.64,3.58-3.81,6.74-6.5,9.52-3.16,3.25-6.82,5.81-10.98,7.68-4.16,1.87-8.59,2.8-13.28,2.8s-9.28-.93-13.5-2.8c-4.21-1.87-7.87-4.43-10.98-7.68-3.11-3.26-5.55-7.06-7.32-11.42-1.77-4.35-2.66-9.06-2.66-14.14s.89-9.62,2.66-13.93c1.77-4.31,4.21-8.09,7.32-11.34s6.77-5.79,10.98-7.61c4.21-1.82,8.71-2.73,13.5-2.73s9.24.91,13.35,2.73c4.11,1.82,7.75,4.36,10.91,7.61,3.16,3.25,5.6,7.03,7.32,11.34l11.95-9.72Z"}),t.createElement("circle",{fill:"currentColor",cx:"575.56",cy:"86.71",r:"9.38"}),t.createElement("path",{fill:"currentColor",d:"M206.51,137.4c-8.17,0-15.43-1.78-21.78-5.34-6.35-3.56-11.01-8.65-13.99-15.29l12.4-6.06c1.83,4.14,4.76,7.31,8.8,9.52,4.04,2.21,8.89,3.32,14.57,3.32,3.75,0,7.11-.55,10.1-1.66,2.98-1.1,5.36-2.79,7.14-5.05,1.78-2.26,2.67-4.98,2.67-8.15,0-3.56-.96-6.27-2.88-8.15-1.92-1.88-4.5-3.27-7.72-4.18-3.22-.91-6.76-1.71-10.6-2.38-3.66-.77-7.38-1.71-11.18-2.81-3.8-1.1-7.33-2.67-10.6-4.69-3.27-2.02-5.89-4.69-7.86-8-1.97-3.32-2.96-7.52-2.96-12.62,0-5.38,1.46-10.19,4.4-14.42,2.93-4.23,6.87-7.57,11.83-10.02,4.95-2.45,10.5-3.68,16.66-3.68,7.4,0,14.13,1.71,20.19,5.12,6.06,3.41,10.53,8.44,13.41,15.07l-12.26,6.35c-1.83-4.04-4.62-7.19-8.37-9.45-3.75-2.26-8.27-3.39-13.56-3.39-3.27,0-6.23.6-8.87,1.8-2.65,1.2-4.78,2.84-6.42,4.9-1.64,2.07-2.45,4.5-2.45,7.28,0,3.46,1.01,6.13,3.03,8.01,2.02,1.87,4.69,3.32,8,4.33,3.32,1.01,6.95,1.9,10.89,2.67,3.65.77,7.36,1.71,11.11,2.81,3.75,1.11,7.19,2.67,10.31,4.69,3.12,2.02,5.67,4.69,7.64,8,1.97,3.32,2.96,7.52,2.96,12.62,0,5.67-1.54,10.65-4.62,14.93-3.08,4.28-7.24,7.67-12.48,10.17-5.24,2.5-11.08,3.75-17.52,3.75Z"}),t.createElement("path",{fill:"currentColor",d:"M276.75,123.07v-28.94h49.04v-13.41h-49.04v-28.94h51.92v-13.41h-53.08c-5,0-8.51,1.18-10.53,3.53-2.02,2.36-3.03,5.6-3.03,9.74v71.58c0,4.04,1.01,7.26,3.03,9.66,2.02,2.41,5.53,3.61,10.53,3.61h54.09v-13.41h-52.93Z"}),t.createElement("path",{fill:"currentColor",d:"M365.12,123.24v-28.94h49.04v-13.41h-49.04v-28.94h51.92v-13.41h-53.08c-5,0-8.51,1.18-10.53,3.53-2.02,2.36-3.03,5.6-3.03,9.74v71.58c0,4.04,1.01,7.26,3.03,9.66,2.02,2.41,5.53,3.61,10.53,3.61h54.09v-13.41h-52.93Z"}),t.createElement("path",{fill:"currentColor",d:"M806.12,136.49h15l-26.59-85.62c-1.44-4.52-3.8-7.88-7.07-10.1-3.27-2.21-6.97-3.32-11.11-3.32s-7.57,1.11-10.89,3.32c-3.32,2.21-5.7,5.58-7.14,10.1l-26.6,85.46h14.86l8.95-29.72,41.68-.11,8.91,29.99ZM759.57,93.2l11.45-38.01c.87-2.98,2.69-4.47,5.48-4.47s4.52,1.49,5.48,4.47l11.29,38.01h-33.7Z"}))}function Ka({translations:e={}}){return t.createElement("footer",{className:"seekora-docsearch-footer"},t.createElement("div",{className:"seekora-docsearch-footer-commands"},t.createElement("ul",{className:"seekora-docsearch-footer-commands-list"},t.createElement("li",null,t.createElement("span",{className:"seekora-docsearch-footer-command"},t.createElement("kbd",{className:"seekora-docsearch-key"},"↵"),t.createElement("span",null,"to select"))),t.createElement("li",null,t.createElement("span",{className:"seekora-docsearch-footer-command"},t.createElement("kbd",{className:"seekora-docsearch-key"},"↑"),t.createElement("kbd",{className:"seekora-docsearch-key"},"↓"),t.createElement("span",null,"to navigate"))),t.createElement("li",null,t.createElement("span",{className:"seekora-docsearch-footer-command"},t.createElement("kbd",{className:"seekora-docsearch-key"},"esc"),t.createElement("span",null,e.closeText||"to close"))))),t.createElement("div",{className:"seekora-docsearch-footer-logo"},t.createElement("span",{className:"seekora-docsearch-footer-logo-text"},e.searchByText||"Search by"),t.createElement("a",{href:"https://seekora.ai",target:"_blank",rel:"noopener noreferrer",className:"seekora-docsearch-footer-logo-link"},t.createElement(Ua,null))))}function Qa(e){const{isOpen:r,onOpen:a,onClose:o,onSelectNext:n,onSelectPrev:s,onEnter:i,disableShortcut:l=!1,shortcutKey:c="k"}=e,d=t.useCallback(e=>{if(!l&&(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===c)return e.preventDefault(),void(r?o():a());if(!l&&"/"===e.key&&!r){const t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),a())}},[r,a,o,l,c]),u=t.useCallback(e=>{switch(e.key){case"Escape":e.preventDefault(),o();break;case"ArrowDown":e.preventDefault(),n();break;case"ArrowUp":e.preventDefault(),s();break;case"Enter":e.preventDefault(),i();break;case"Tab":e.shiftKey?s():n(),e.preventDefault()}},[o,n,s,i]);return t.useEffect(()=>(document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}),[d]),{handleModalKeyDown:u}}function Ga(e="K"){if("undefined"==typeof navigator)return`⌘${e}`;return navigator.platform.toLowerCase().includes("mac")?`⌘${e}`:`Ctrl+${e}`}function Xa({onClick:e,placeholder:r="Search documentation..."}){const a=Ga("K");return t.createElement("button",{type:"button",className:"seekora-docsearch-button",onClick:e,"aria-label":"Search documentation"},t.createElement("span",{className:"seekora-docsearch-button-icon"},t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},t.createElement("path",{d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",fill:"currentColor"}))),t.createElement("span",{className:"seekora-docsearch-button-placeholder"},r),t.createElement("span",{className:"seekora-docsearch-button-keys"},t.createElement("kbd",{className:"seekora-docsearch-button-key"},a)))}const Ya={query:"",results:[],suggestions:[],groupedSuggestions:[],isLoading:!1,error:null,selectedIndex:0,mode:"suggestions"};function Za(e,t){switch(t.type){case"SET_QUERY":return{...e,query:t.payload,selectedIndex:0};case"SET_RESULTS":return{...e,results:t.payload,mode:"results"};case"SET_SUGGESTIONS":return{...e,suggestions:t.payload,mode:"suggestions"};case"SET_GROUPED_SUGGESTIONS":{const r=t.payload.flatMap(e=>e.items.map(t=>({...t,_source:e.source.id})));return{...e,groupedSuggestions:t.payload,suggestions:r,mode:"suggestions"}}case"SET_LOADING":return{...e,isLoading:t.payload};case"SET_ERROR":return{...e,error:t.payload};case"SET_SELECTED_INDEX":return{...e,selectedIndex:t.payload};case"SELECT_NEXT":{const t=("results"===e.mode?e.results:e.suggestions).length-1;return{...e,selectedIndex:e.selectedIndex>=t?0:e.selectedIndex+1}}case"SELECT_PREV":{const t=("results"===e.mode?e.results:e.suggestions).length-1;return{...e,selectedIndex:e.selectedIndex<=0?t:e.selectedIndex-1}}case"SET_MODE":return{...e,mode:t.payload,selectedIndex:0};case"RESET":return Ya;default:return e}}function Ja(e){const{apiEndpoint:r,apiKey:a,sources:o,maxResults:n=10,debounceMs:s=200,processGroupedResults:i}=e,l=o||(r?[{id:"default",name:"Results",endpoint:r,apiKey:a,maxResults:n}]:[]),[c,d]=t.useReducer(Za,Ya),u=t.useRef(new Map),p=t.useRef(null),m=t.useCallback((e,t)=>(e?.data?.results||[]).map(e=>{const r=e.document||e;return{url:r.url||r.route||"",title:(r.title||r.name||"").replace?.(/<\/?mark>/g,"")||"",content:(r.content||r.description||"").replace?.(/<\/?mark>/g,"")?.substring?.(0,100)||"",description:r.description||r.content?.substring?.(0,100)||"",category:r.category||r.hierarchy?.lvl0||"",hierarchy:r.hierarchy,route:r.route,parentTitle:r.parent_title||r.parentTitle,_source:t}}),[]),g=t.useCallback(async(e,t,r)=>{const a=e.minQueryLength??1;if(t.length<a)return[];try{if(e.storeId){const a=`${e.endpoint.replace(/\/$/,"")}/api/v1/search`,o={"Content-Type":"application/json","x-storeid":e.storeId,...e.storeSecret&&{"x-storesecret":e.storeSecret}},n=await fetch(a,{method:"POST",headers:o,body:JSON.stringify({q:t.trim()||"*",per_page:e.maxResults||8}),signal:r});if(!n.ok)return[];const s=await n.json();return e.transformResults?e.transformResults(s).map(t=>({...t,_source:e.id})):m(s,e.id)}const a=new URL(e.endpoint);a.searchParams.set("query",t),a.searchParams.set("limit",String(e.maxResults||8));const o={"Content-Type":"application/json"};e.apiKey&&(o["X-Docs-API-Key"]=e.apiKey);const n=await fetch(a.toString(),{method:"GET",headers:o,signal:r});if(!n.ok)return[];const s=await n.json();return e.transformResults?e.transformResults(s).map(t=>({...t,_source:e.id})):((e,t)=>(e.data?.suggestions||e.data?.results||e.data?.hits||e.suggestions||e.results||e.hits||[]).map(e=>{const r=e.document||e,a=r.hierarchy||{lvl0:r["hierarchy.lvl0"],lvl1:r["hierarchy.lvl1"],lvl2:r["hierarchy.lvl2"],lvl3:r["hierarchy.lvl3"],lvl4:r["hierarchy.lvl4"],lvl5:r["hierarchy.lvl5"]};return{url:r.url||r.route||e.url||"",title:(r.title||"").replace?.(/<\/?mark>/g,"")||"",content:(r.content||r.description||"").replace?.(/<\/?mark>/g,"")?.substring?.(0,100)||"",description:r.description||r.content?.substring?.(0,100)||"",category:r.category||a?.lvl0||"",hierarchy:a,route:r.route,parentTitle:r.parent_title||r.parentTitle,anchor:r.anchor||e.anchor,_source:t}}))(s,e.id)}catch(e){if(e instanceof Error&&"AbortError"===e.name)throw e;return[]}},[m]),f=t.useCallback(async e=>{if(e.trim()){u.current.forEach(e=>e.abort()),u.current.clear(),d({type:"SET_LOADING",payload:!0}),d({type:"SET_ERROR",payload:null});try{const t=(await Promise.all(l.map(async t=>{const r=new AbortController;u.current.set(t.id,r);let a=await g(t,e,r.signal);return i&&(a=i(t.id,a)),{source:t,items:a}}))).filter(e=>e.items.length>0);d({type:"SET_GROUPED_SUGGESTIONS",payload:t})}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;d({type:"SET_ERROR",payload:e instanceof Error?e.message:"Search failed"})}finally{d({type:"SET_LOADING",payload:!1})}}else d({type:"SET_GROUPED_SUGGESTIONS",payload:[]})},[l,g,i]),h=t.useCallback(e=>f(e),[f]),y=t.useCallback(e=>{d({type:"SET_QUERY",payload:e}),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f(e),s)},[f,s]),b=t.useCallback(()=>d({type:"SELECT_NEXT"}),[]),v=t.useCallback(()=>d({type:"SELECT_PREV"}),[]),k=t.useCallback(e=>d({type:"SET_SELECTED_INDEX",payload:e}),[]),x=t.useCallback(()=>{u.current.forEach(e=>e.abort()),u.current.clear(),p.current&&clearTimeout(p.current),d({type:"RESET"})},[]),E=t.useCallback(()=>("results"===c.mode?c.results:c.suggestions)[c.selectedIndex]||null,[c.mode,c.results,c.suggestions,c.selectedIndex]);return t.useEffect(()=>()=>{u.current.forEach(e=>e.abort()),u.current.clear(),p.current&&clearTimeout(p.current)},[]),{...c,sources:l,setQuery:y,search:h,fetchSuggestions:f,selectNext:b,selectPrev:v,setSelectedIndex:k,reset:x,getSelectedItem:E}}function eo(e){const{storeId:r,storeSecret:o,apiEndpoint:n,maxResults:s=20,debounceMs:i=200,analyticsTags:l=["docsearch"],groupField:c="hierarchy.lvl3",groupSize:d=10}=e,[u,p]=t.useState(""),[m,g]=t.useState([]),[f,h]=t.useState(!1),[y,b]=t.useState(null),[v,k]=t.useState(0),x=t.useRef(null),E=t.useRef(null),w=t.useRef(null),S=t.useRef(null);t.useEffect(()=>{if(!r)return;const e={storeId:r,readSecret:o,logLevel:"warn",enableContextCollection:!0,enableEventQueue:!0,eventQueue:{batchSize:10,flushInterval:5e3,enablePersistence:!0}};if(n)if(["local","stage","production"].includes(n))e.environment=n;else{const t=n.replace(/\/$/,"");e.baseUrl=t.endsWith("/api")?t:`${t}/api`}try{x.current=new a.SeekoraClient(e)}catch(e){console.error("Failed to initialize SeekoraClient:",e),b("Failed to initialize search client")}return()=>{x.current=null}},[r,o,n]);const C=t.useCallback(async e=>{if(x.current)if(e.trim()){S.current&&S.current.abort(),S.current=new AbortController,h(!0),b(null);try{const t=await x.current.search(e,{per_page:s,analytics_tags:l,return_fields:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url","title","anchor"],snippet_fields:["hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content"],snippet_prefix:"<mark>",snippet_suffix:"</mark>",include_snippets:!0,group_field:c,group_size:d});if(S.current?.signal.aborted)return;t?.context&&(E.current=t.context),g(function(e){const t=e=>"string"==typeof e?e.replace(/<\/?mark>/g,""):e?String(e):"";return e.map(e=>{const r=e?.document??e,a=function(e){const t={};return e?.hierarchy&&"object"==typeof e.hierarchy?(t.lvl0=e.hierarchy.lvl0,t.lvl1=e.hierarchy.lvl1,t.lvl2=e.hierarchy.lvl2,t.lvl3=e.hierarchy.lvl3,t.lvl4=e.hierarchy.lvl4,t.lvl5=e.hierarchy.lvl5):e&&"object"==typeof e&&(t.lvl0=e["hierarchy.lvl0"],t.lvl1=e["hierarchy.lvl1"],t.lvl2=e["hierarchy.lvl2"],t.lvl3=e["hierarchy.lvl3"],t.lvl4=e["hierarchy.lvl4"],t.lvl5=e["hierarchy.lvl5"]),t}(r),o=r.url||e.url||r.route||e.route||r.link||e.link||"",n=r.title||e.title||r.name||e.name||a?.lvl3||a?.lvl2||a?.lvl1||a?.lvl0||"",s=r.content??e.content??r.description??e.description??r.snippet??e.snippet??"",i=r.description??e.description??("string"==typeof s?s.substring(0,150):""),l=t(n)||t(a?.lvl3)||t(a?.lvl2)||t(a?.lvl1)||t(a?.lvl0)||"Untitled",c=t(s)?.substring(0,200)||s,d=e?.highlight??r?.highlight,u="string"==typeof d?.title?d.title:void 0,p="string"==typeof d?.content?d.content:void 0;return{url:o,title:l,content:c,description:t(i)||i,category:r.category??e.category??a?.lvl0??"",hierarchy:a,route:r.route??e.route,parentTitle:r.parent_title??r.parentTitle??e.parent_title??e.parentTitle,type:r.type??e.type??"",anchor:r.anchor??e.anchor??"",_source:"seekora",highlight:u??p?{title:u,content:p}:void 0}})}(t.results||[])),k(0)}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;console.error("Search failed:",e),b(e instanceof Error?e.message:"Search failed"),g([])}finally{h(!1)}}else g([]);else b("Search client not initialized")},[s,l,c,d]),R=t.useCallback(e=>{p(e),k(0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>C(e),i)},[C,i]),I=t.useCallback(()=>{k(e=>e>=m.length-1?0:e+1)},[m.length]),N=t.useCallback(()=>{k(e=>e<=0?m.length-1:e-1)},[m.length]),z=t.useCallback(()=>{S.current&&S.current.abort(),w.current&&clearTimeout(w.current),p(""),g([]),h(!1),b(null),k(0)},[]),T=t.useCallback(()=>m[v]||null,[m,v]),M=t.useCallback((e,t)=>{const r=x.current;if(!r?.trackEvent)return;const a=E.current??void 0,o=e.url||e.id||e.title||String(t);r.trackEvent({event_name:"doc_click",clicked_item_id:o,metadata:{position:t,result:e,source:"docsearch"}},a)},[]);return t.useEffect(()=>()=>{S.current&&S.current.abort(),w.current&&clearTimeout(w.current)},[]),{query:u,suggestions:m,isLoading:f,error:y,selectedIndex:v,setQuery:R,selectNext:I,selectPrev:N,setSelectedIndex:k,reset:z,getSelectedItem:T,trackDocClick:M}}function to(e,t,r=2){const a=e.toLowerCase().split(/\s+/),o=[];return a.forEach(a=>{a.length<3||t.forEach(t=>{const n=function(e,t){const r=[];for(let e=0;e<=t.length;e++)r[e]=[e];for(let t=0;t<=e.length;t++)r[0][t]=t;for(let a=1;a<=t.length;a++)for(let o=1;o<=e.length;o++)t.charAt(a-1)===e.charAt(o-1)?r[a][o]=r[a-1][o-1]:r[a][o]=Math.min(r[a-1][o-1]+1,r[a][o-1]+1,r[a-1][o]+1);return r[t.length][e.length]}(a,t.toLowerCase());if(n>0&&n<=r&&n<a.length/2){const r=e.replace(new RegExp(a,"gi"),t);o.includes(r)||o.push(r)}})}),o.slice(0,3)}const ro={price:[{pattern:/under\s*\$?(\d+(?:\.\d{2})?)/i,operator:"<=",field:"price"},{pattern:/less than\s*\$?(\d+(?:\.\d{2})?)/i,operator:"<",field:"price"},{pattern:/over\s*\$?(\d+(?:\.\d{2})?)/i,operator:">=",field:"price"},{pattern:/more than\s*\$?(\d+(?:\.\d{2})?)/i,operator:">",field:"price"},{pattern:/\$(\d+(?:\.\d{2})?)\s*-\s*\$?(\d+(?:\.\d{2})?)/i,operator:"range",field:"price"},{pattern:/between\s*\$?(\d+(?:\.\d{2})?)\s*and\s*\$?(\d+(?:\.\d{2})?)/i,operator:"range",field:"price"},{pattern:/\$(\d+(?:\.\d{2})?)/i,operator:"<=",field:"price"}],colors:["red","blue","green","black","white","pink","purple","yellow","orange","brown","gray","grey","navy","beige","gold","silver"],sizes:{"extra small":"XS",xs:"XS",small:"S",s:"S",medium:"M",m:"M",large:"L",l:"L","extra large":"XL",xl:"XL",xxl:"XXL","2xl":"XXL",xxxl:"XXXL","3xl":"XXXL"},brandIndicators:["by","from","brand"],ratings:[{pattern:/(\d+)\s*\+?\s*stars?/i,field:"rating",operator:">="},{pattern:/rated\s*(\d+)/i,field:"rating",operator:">="},{pattern:/top\s*rated/i,field:"rating",value:"4",operator:">="}],availability:[{pattern:/in\s*stock/i,field:"inStock",value:"true"},{pattern:/available/i,field:"inStock",value:"true"},{pattern:/on\s*sale/i,field:"onSale",value:"true"}]};const ao={"--seekora-bg-surface":"#ffffff","--seekora-bg-secondary":"#f9fafb","--seekora-bg-tertiary":"#f3f4f6","--seekora-bg-hover":"#f3f4f6","--seekora-text-primary":"#111827","--seekora-text-secondary":"#6b7280","--seekora-text-tertiary":"#9ca3af","--seekora-border-color":"#e5e7eb","--seekora-primary":"#3b82f6","--seekora-primary-light":"#eff6ff","--seekora-primary-dark":"#1d4ed8","--seekora-highlight-bg":"#fef3c7","--seekora-success":"#10b981","--seekora-warning":"#f59e0b","--seekora-error":"#ef4444","--seekora-font-family":'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',"--seekora-font-size-xs":"11px","--seekora-font-size-sm":"12px","--seekora-font-size-base":"14px","--seekora-font-size-lg":"16px","--seekora-font-weight-normal":"400","--seekora-font-weight-medium":"500","--seekora-font-weight-semibold":"600","--seekora-font-weight-bold":"700","--seekora-line-height-tight":"1.25","--seekora-line-height-normal":"1.5","--seekora-line-height-relaxed":"1.75","--seekora-spacing-xs":"4px","--seekora-spacing-sm":"8px","--seekora-spacing-md":"12px","--seekora-spacing-lg":"16px","--seekora-spacing-xl":"24px","--seekora-border-radius-sm":"4px","--seekora-border-radius":"6px","--seekora-border-radius-lg":"8px","--seekora-border-radius-xl":"12px","--seekora-border-radius-full":"9999px","--seekora-shadow-sm":"0 1px 2px 0 rgba(0, 0, 0, 0.05)","--seekora-shadow":"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)","--seekora-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)","--seekora-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)","--seekora-shadow-xl":"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","--seekora-transition-fast":"100ms ease","--seekora-transition-normal":"150ms ease","--seekora-transition-slow":"300ms ease","--seekora-z-dropdown":"1000","--seekora-z-modal":"1100","--seekora-z-tooltip":"1200"},oo={...ao,"--seekora-bg-surface":"#1f2937","--seekora-bg-secondary":"#111827","--seekora-bg-tertiary":"#374151","--seekora-bg-hover":"#374151","--seekora-text-primary":"#f9fafb","--seekora-text-secondary":"#d1d5db","--seekora-text-tertiary":"#9ca3af","--seekora-border-color":"#4b5563","--seekora-primary":"#60a5fa","--seekora-primary-light":"#1e3a5f","--seekora-primary-dark":"#93c5fd","--seekora-highlight-bg":"#854d0e","--seekora-shadow-sm":"0 1px 2px 0 rgba(0, 0, 0, 0.3)","--seekora-shadow":"0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3)","--seekora-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3)","--seekora-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3)","--seekora-shadow-xl":"0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4)"},no={...ao,"--seekora-border-color":"#f3f4f6","--seekora-shadow-sm":"none","--seekora-shadow":"0 1px 2px 0 rgba(0, 0, 0, 0.03)","--seekora-shadow-md":"0 2px 4px 0 rgba(0, 0, 0, 0.05)","--seekora-shadow-lg":"0 4px 8px 0 rgba(0, 0, 0, 0.08)","--seekora-shadow-xl":"0 8px 16px 0 rgba(0, 0, 0, 0.1)","--seekora-border-radius-sm":"2px","--seekora-border-radius":"4px","--seekora-border-radius-lg":"6px","--seekora-border-radius-xl":"8px"},so={blue:{"--seekora-primary":"#3b82f6","--seekora-primary-light":"#eff6ff","--seekora-primary-dark":"#1d4ed8"},green:{"--seekora-primary":"#10b981","--seekora-primary-light":"#ecfdf5","--seekora-primary-dark":"#059669"},purple:{"--seekora-primary":"#8b5cf6","--seekora-primary-light":"#f5f3ff","--seekora-primary-dark":"#7c3aed"},red:{"--seekora-primary":"#ef4444","--seekora-primary-light":"#fef2f2","--seekora-primary-dark":"#dc2626"},orange:{"--seekora-primary":"#f97316","--seekora-primary-light":"#fff7ed","--seekora-primary-dark":"#ea580c"},teal:{"--seekora-primary":"#14b8a6","--seekora-primary-light":"#f0fdfa","--seekora-primary-dark":"#0d9488"},pink:{"--seekora-primary":"#ec4899","--seekora-primary-light":"#fdf2f8","--seekora-primary-dark":"#db2777"}};function io(e=ao){return`\n /* Seekora Query Suggestions Styles */\n .seekora-suggestions {\n ${t=e,Object.entries(t).map(([e,t])=>`${e}: ${t};`).join("\n")}\n }\n\n /* Container */\n .seekora-suggestions-container {\n background-color: var(--seekora-bg-surface);\n border: 1px solid var(--seekora-border-color);\n border-radius: var(--seekora-border-radius-lg);\n box-shadow: var(--seekora-shadow-xl);\n font-family: var(--seekora-font-family);\n font-size: var(--seekora-font-size-base);\n color: var(--seekora-text-primary);\n overflow: hidden;\n }\n\n /* Section */\n .seekora-suggestions-section {\n padding: var(--seekora-spacing-sm) 0;\n }\n\n .seekora-suggestions-section-title {\n font-size: var(--seekora-font-size-xs);\n font-weight: var(--seekora-font-weight-bold);\n color: var(--seekora-text-tertiary);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n padding: var(--seekora-spacing-sm) var(--seekora-spacing-lg) var(--seekora-spacing-xs);\n margin: 0;\n }\n\n /* Item */\n .seekora-suggestions-item {\n display: flex;\n align-items: center;\n gap: var(--seekora-spacing-md);\n padding: var(--seekora-spacing-md) var(--seekora-spacing-lg);\n cursor: pointer;\n transition: background-color var(--seekora-transition-fast);\n }\n\n .seekora-suggestions-item:hover,\n .seekora-suggestions-item--active {\n background-color: var(--seekora-bg-hover);\n }\n\n .seekora-suggestions-item-icon {\n width: 16px;\n height: 16px;\n color: var(--seekora-text-secondary);\n flex-shrink: 0;\n }\n\n .seekora-suggestions-item-text {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .seekora-suggestions-item-count {\n font-size: var(--seekora-font-size-sm);\n color: var(--seekora-text-tertiary);\n }\n\n /* Highlight */\n .seekora-suggestions mark,\n .seekora-suggestions-highlight {\n background-color: var(--seekora-highlight-bg);\n font-weight: var(--seekora-font-weight-semibold);\n padding: 0 2px;\n border-radius: 2px;\n }\n\n /* Product Card */\n .seekora-product-card {\n background-color: var(--seekora-bg-surface);\n border: 1px solid var(--seekora-border-color);\n border-radius: var(--seekora-border-radius-lg);\n overflow: hidden;\n cursor: pointer;\n transition: transform var(--seekora-transition-normal), box-shadow var(--seekora-transition-normal);\n }\n\n .seekora-product-card:hover {\n transform: translateY(-2px);\n box-shadow: var(--seekora-shadow-md);\n }\n\n .seekora-product-card-image {\n width: 100%;\n aspect-ratio: 1;\n object-fit: cover;\n background-color: var(--seekora-bg-secondary);\n }\n\n .seekora-product-card-info {\n padding: var(--seekora-spacing-md);\n }\n\n .seekora-product-card-title {\n font-size: var(--seekora-font-size-sm);\n font-weight: var(--seekora-font-weight-medium);\n color: var(--seekora-text-primary);\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n }\n\n .seekora-product-card-price {\n font-size: var(--seekora-font-size-base);\n font-weight: var(--seekora-font-weight-bold);\n color: var(--seekora-primary);\n margin-top: var(--seekora-spacing-xs);\n }\n\n /* Tabs */\n .seekora-suggestions-tabs {\n display: flex;\n gap: var(--seekora-spacing-xs);\n padding: var(--seekora-spacing-md) var(--seekora-spacing-lg);\n border-bottom: 1px solid var(--seekora-border-color);\n overflow-x: auto;\n }\n\n .seekora-suggestions-tab {\n display: inline-flex;\n align-items: center;\n gap: var(--seekora-spacing-sm);\n padding: var(--seekora-spacing-sm) var(--seekora-spacing-md);\n font-size: var(--seekora-font-size-sm);\n font-weight: var(--seekora-font-weight-medium);\n color: var(--seekora-text-secondary);\n background-color: transparent;\n border: 1px solid transparent;\n border-radius: var(--seekora-border-radius-full);\n cursor: pointer;\n white-space: nowrap;\n transition: all var(--seekora-transition-fast);\n }\n\n .seekora-suggestions-tab:hover {\n background-color: var(--seekora-bg-hover);\n }\n\n .seekora-suggestions-tab--active {\n color: var(--seekora-primary);\n background-color: var(--seekora-primary-light);\n border-color: var(--seekora-primary);\n }\n\n /* Brand chip */\n .seekora-brand-chip {\n display: inline-flex;\n align-items: center;\n gap: var(--seekora-spacing-sm);\n padding: var(--seekora-spacing-sm) var(--seekora-spacing-md);\n font-size: var(--seekora-font-size-sm);\n font-weight: var(--seekora-font-weight-medium);\n color: var(--seekora-text-primary);\n background-color: var(--seekora-bg-surface);\n border: 1px solid var(--seekora-border-color);\n border-radius: var(--seekora-border-radius-lg);\n cursor: pointer;\n transition: all var(--seekora-transition-fast);\n }\n\n .seekora-brand-chip:hover {\n border-color: var(--seekora-primary);\n background-color: var(--seekora-primary-light);\n }\n\n /* Category pill */\n .seekora-category-pill {\n display: inline-flex;\n align-items: center;\n gap: var(--seekora-spacing-xs);\n padding: 3px var(--seekora-spacing-sm);\n font-size: var(--seekora-font-size-xs);\n font-weight: var(--seekora-font-weight-medium);\n color: var(--seekora-text-secondary);\n background-color: var(--seekora-bg-tertiary);\n border-radius: var(--seekora-border-radius-full);\n cursor: pointer;\n transition: all var(--seekora-transition-fast);\n }\n\n .seekora-category-pill:hover {\n background-color: var(--seekora-primary-light);\n color: var(--seekora-primary);\n }\n\n /* Loading */\n .seekora-suggestions-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--seekora-spacing-xl);\n color: var(--seekora-text-secondary);\n }\n\n /* Empty state */\n .seekora-suggestions-empty {\n padding: var(--seekora-spacing-xl);\n text-align: center;\n color: var(--seekora-text-secondary);\n }\n\n /* Footer */\n .seekora-suggestions-footer {\n padding: var(--seekora-spacing-md) var(--seekora-spacing-lg);\n border-top: 1px solid var(--seekora-border-color);\n background-color: var(--seekora-bg-secondary);\n font-size: var(--seekora-font-size-sm);\n color: var(--seekora-text-secondary);\n }\n\n /* Keyboard hint */\n .seekora-keyboard-key {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 18px;\n padding: 0 4px;\n border-radius: 3px;\n background-color: var(--seekora-bg-secondary);\n border: 1px solid var(--seekora-border-color);\n font-size: 10px;\n font-weight: var(--seekora-font-weight-medium);\n }\n\n /* Animations */\n @keyframes seekora-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n @keyframes seekora-fade-in {\n from { opacity: 0; transform: translateY(-8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n @keyframes seekora-fade-out {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(-8px); }\n }\n\n .seekora-suggestions--entering {\n animation: seekora-fade-in var(--seekora-transition-normal) ease-out;\n }\n\n .seekora-suggestions--exiting {\n animation: seekora-fade-out var(--seekora-transition-normal) ease-in;\n }\n `;var t}let lo=!1;function co(e=ao,t=!1){if("undefined"==typeof document)return;if(lo&&!t)return;const r="seekora-suggestions-styles";let a=document.getElementById(r);a||(a=document.createElement("style"),a.id=r,a.type="text/css",document.head.appendChild(a)),a.textContent=io(e),lo=!0}e.ActionButtons=zt,e.AmazonDropdown=aa,e.AnalyticsProvider=function({client:e,context:r,children:a}){const o=t.useRef(null),n=t.useCallback(async(t,a)=>{try{await(e.trackEvent?.({event_name:t,metadata:{timestamp:Date.now(),source:"analytics_provider_delegation",...a}},r)),l(`AnalyticsProvider: ${t}`,a)}catch(e){d(`AnalyticsProvider: Failed to track ${t}`,{error:e})}},[e,r]);return t.useEffect(()=>{const t=o.current;if(!t)return;const a=t=>{const a=t.target.closest("[data-seekora-track]");if(!a)return;const o=a.getAttribute("data-seekora-track"),s=a.getAttribute("data-seekora-product-id"),i=a.getAttribute("data-seekora-position"),l=a.getAttribute("data-seekora-section"),c=a.getAttribute("data-seekora-variant-sku"),d=a.getAttribute("data-seekora-variant-option"),u=a.getAttribute("data-seekora-variant-value"),p={};switch(s&&(p.product_id=s),i&&(p.position=parseInt(i,10)),l&&(p.section=l),o){case"click":if(n("product.click",p),e?.trackClick&&s){const t=i?parseInt(i,10)+1:1;Promise.resolve(e.trackClick(s,t,r)).catch(()=>{})}break;case"add-to-cart":c&&(p.variant_sku=c),n("product.add_to_cart",p);break;case"variant-select":d&&(p.option_name=d),u&&(p.option_value=u),n("product.variant_select",p);break;default:o&&n(o,p)}};return t.addEventListener("click",a),()=>t.removeEventListener("click",a)},[e,r,n]),t.createElement(qr.Provider,{value:{client:e,context:r}},t.createElement("div",{ref:o,style:{display:"contents"}},a))},e.BadgeList=dr,e.Breadcrumb=({attributes:e,separator:r=" > ",rootLabel:a="Home",renderItem:o,renderSeparator:n,onNavigate:s,className:i,style:l,theme:c,items:d})=>{const{theme:u,stateManager:p}=w(),{refinements:m,removeRefinement:g,clearRefinements:f}=S(),h=c||{},y=t.useMemo(()=>{if(d)return d;const t=[];return e.forEach((e,a)=>{const o=m.find(t=>t.field===e);if(o){const e=o.value.split(r);e.forEach((a,o)=>{const n=e.slice(0,o+1).join(r);t.some(e=>e.value===n)||t.push({label:a,value:n})})}}),t},[e,m,r,d]),b=t.useCallback((t,r)=>{if(null===t)e.forEach(e=>{m.filter(t=>t.field===e).forEach(e=>g(e.field,e.value,!1))}),p.search();else{const r=y.findIndex(e=>e.value===t.value);e.forEach((e,a)=>{m.filter(t=>t.field===e).forEach(e=>{(a>r||a===r&&e.value!==t.value)&&g(e.field,e.value,!1)})}),p.search()}s&&s(t,r)},[e,m,g,p,y,s]);return 0===y.length?null:t.createElement("nav",{className:I(h.root,i),style:l,"aria-label":"Breadcrumb"},t.createElement("ol",{className:h.list,style:{display:"flex",flexWrap:"wrap",alignItems:"center",listStyle:"none",margin:0,padding:0,fontSize:u.typography.fontSize.small}},t.createElement("li",{className:h.item},t.createElement("button",{type:"button",onClick:()=>b(null,-1),className:h.link,style:{padding:0,background:"none",border:"none",cursor:"pointer",color:u.colors.primary,fontFamily:"inherit",fontSize:"inherit",textDecoration:"none"}},a)),y.map((e,r)=>{const a=r===y.length-1;return t.createElement(t.Fragment,{key:e.value},n?n():t.createElement("span",{className:h.separator,style:{margin:`0 ${u.spacing.small}`,color:u.colors.textSecondary},"aria-hidden":"true"},"›"),t.createElement("li",{className:I(h.item,a&&h.current)},o?o(e,r,a):a?t.createElement("span",{style:{color:u.colors.text,fontWeight:u.typography.fontWeight?.medium||500},"aria-current":"page"},e.label):t.createElement("button",{type:"button",onClick:()=>b(e,r),className:h.link,style:{padding:0,background:"none",border:"none",cursor:"pointer",color:u.colors.primary,fontFamily:"inherit",fontSize:"inherit",textDecoration:"none"}},e.label)))})))},e.CategoriesTabs=Tr,e.ClearRefinements=({clearsQuery:e=!1,resetLabel:r="Clear all filters",disabledLabel:a="No filters applied",includedFields:o,excludedFields:n=[],onClear:s,renderButton:i,className:l,style:c,theme:d,hideWhenEmpty:u=!1})=>{const{theme:p}=w(),{query:m,refinements:g,clearRefinements:f,setQuery:h,removeRefinement:y}=S(),b=d||{},v=t.useMemo(()=>g.filter(e=>!n.includes(e.field)&&!(o&&!o.includes(e.field))),[g,o,n]),k=v.length>0||e&&m.length>0,x=()=>{k&&(o||n.length>0?(v.forEach(e=>{y(e.field,e.value,!1)}),v.length>0&&f(!1)):f(!e),e&&m.length>0&&h("",!0),s&&s())};return u&&!k?null:i?t.createElement("div",{className:I(b.root,l),style:c},i({canClear:k,onClick:x,disabled:!k})):t.createElement("div",{className:I(b.root,l),style:c},t.createElement("button",{type:"button",onClick:x,disabled:!k,className:I(b.button,!k&&b.buttonDisabled),style:{padding:`${p.spacing.small} ${p.spacing.medium}`,fontSize:p.typography.fontSize.medium,fontWeight:p.typography.fontWeight?.medium||500,backgroundColor:p.colors.primary,color:"#ffffff",border:"none",borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,cursor:k?"pointer":"default",opacity:k?1:0,pointerEvents:k?"auto":"none",transition:"none"},"aria-label":r},r))},e.CurrentRefinements=({refinements:e,onRefinementClear:r,onClearAll:a,renderRefinement:o,showClearAll:n=!0,variant:s="chips",layout:i="horizontal",fieldColors:l,renderCloseIcon:c,className:d,style:u,theme:p})=>{const{theme:m}=w(),{refinements:g,removeRefinement:f,clearRefinements:h}=S(),y=p||{},b=(e,t)=>{const r=e.toLowerCase();return r.includes("price")||r.includes("cost")||r.includes("amount")?`$${t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:t.toLocaleString()},v=t.useMemo(()=>g.map(e=>`${e.field}:${e.value}`).sort().join("|"),[g.map(e=>`${e.field}:${e.value}`).sort().join("|")]),k=t.useMemo(()=>{if(void 0!==e)return e;const t=new Map,r=[];return g.forEach(e=>{const a=e.value.match(/^>=(\d+(?:\.\d+)?)$/),o=e.value.match(/^<=(\d+(?:\.\d+)?)$/);if(a||o){t.has(e.field)||t.set(e.field,{});const r=t.get(e.field);a&&(r.minVal=parseFloat(a[1])),o&&(r.maxVal=parseFloat(o[1]))}else r.push({field:e.field,value:e.value})}),t.forEach((e,t)=>{let a;if(void 0!==e.minVal&&void 0!==e.maxVal)a=`${b(t,e.minVal)} – ${b(t,e.maxVal)}`;else if(void 0!==e.minVal)a=`≥ ${b(t,e.minVal)}`;else{if(void 0===e.maxVal)return;a=`≤ ${b(t,e.maxVal)}`}r.push({field:t,value:"__range__",displayValue:a})}),r},[e,v]),[x,E]=t.useState(new Set),[C,R]=t.useState(new Set),N=t.useRef([]);t.useEffect(()=>{const e=new Set(k.map(e=>`${e.field}:${e.value}`)),t=new Set(N.current.map(e=>`${e.field}:${e.value}`)),r=new Set;t.forEach(t=>{e.has(t)||r.add(t)}),r.size>0&&(R(r),setTimeout(()=>R(new Set),200)),E(e),N.current=[...k]},[k]);const z=(a,o)=>{const n=`${a.field}:${a.value}`,d=l?.[a.field],u=x.has(n)&&!N.current.some(e=>`${e.field}:${e.value}`===n),p=((e,t,r,a,o)=>{const n=o||`var(--seekora-refinement-bg, ${t.hover})`,s=`var(--seekora-refinement-color, ${t.text})`,i=`var(--seekora-refinement-border, ${t.border})`;switch(e){case"tags":return{display:"inline-flex",alignItems:"center",padding:`2px ${r.medium}`,backgroundColor:n,border:`1px solid ${i}`,borderRadius:"var(--seekora-refinement-radius, 4px)",fontSize:"12px",color:s,fontWeight:500};case"pills":return{display:"inline-flex",alignItems:"center",padding:`${r.small} ${r.medium}`,backgroundColor:n,border:"none",borderRadius:"var(--seekora-refinement-radius, 9999px)",fontSize:"13px",color:s};case"badges":return{display:"inline-flex",alignItems:"center",padding:`3px ${r.small}`,backgroundColor:t.primary,border:"none",borderRadius:"var(--seekora-refinement-radius, 4px)",fontSize:"11px",color:"#fff",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px"};case"text-list":return{display:"flex",alignItems:"center",padding:`${r.small} 0`,backgroundColor:"transparent",border:"none",borderBottom:`1px solid ${i}`,borderRadius:"0",fontSize:"14px",color:s};default:return{display:"inline-flex",alignItems:"center",padding:`${r.small} ${r.medium}`,backgroundColor:n,border:`1px solid ${i}`,borderRadius:`var(--seekora-refinement-radius, ${"string"==typeof a?a:a.medium})`,fontSize:"13px",color:s}}})(s,m.colors,m.spacing,m.borderRadius,d),h=((e,t)=>{switch(e){case"tags":return t.tag;case"pills":return t.pill;case"badges":return t.badge;case"chips":return t.chip;default:return t.item}})(s,y);return t.createElement("div",{key:`${n}-${o}`,className:I(y.item,h),role:"listitem",style:{...p,margin:"vertical"===i?`0 0 ${m.spacing.small} 0`:`0 ${m.spacing.small} ${m.spacing.small} 0`,transition:`all ${ee}`,opacity:C.has(n)?0:1,transform:C.has(n)?"scale(0.8)":"scale(1)",animation:u?"seekoraChipIn 200ms ease-out":void 0}},"badges"!==s&&t.createElement("span",{className:y.label,style:{marginRight:m.spacing.small,fontWeight:"500",opacity:.7}},a.label||a.field,":"),t.createElement("span",{className:y.value},a.displayValue||a.value),t.createElement("button",{type:"button",onClick:()=>((t,a)=>{if(void 0===e)if("__range__"===a){const e=g.filter(e=>e.field===t&&(/^>=/.test(e.value)||/^<=/.test(e.value)));e.forEach((r,a)=>f(t,r.value,a===e.length-1))}else f(t,a);r&&r(t,a)})(a.field,a.value),className:y.clearButton,style:{border:"none",backgroundColor:"transparent",color:"inherit",cursor:"pointer",fontSize:"14px",padding:"0 0 0 6px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:`opacity ${J}`,opacity:.6},"aria-label":`Clear ${a.label||a.field}: ${a.value}`,onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.6"},c?c():t.createElement("span",{"aria-hidden":"true",style:{lineHeight:1}},"×")))},T="grouped"===i?k.reduce((e,t)=>(e[t.field]||(e[t.field]=[]),e[t.field].push(t),e),{}):null,M={...u,...y.list&&!u?.display?{display:"contents"}:{}},A={display:"flex",flexDirection:"vertical"===i?"column":"row",alignItems:"vertical"===i?"flex-start":"center",marginBottom:n&&k.length>0?m.spacing.medium:0,...y.list?{}:{flexWrap:"vertical"===i?"nowrap":"wrap"}};return t.createElement("div",{className:I(y.container,d),style:M},t.createElement("style",null,"\n @keyframes seekoraChipIn {\n from { opacity: 0; transform: scale(0.8); }\n to { opacity: 1; transform: scale(1); }\n }\n "),k.length>0&&t.createElement(t.Fragment,null,"grouped"===i&&T?Object.entries(T).map(([e,r])=>t.createElement("div",{key:e,className:y.group,style:{marginBottom:m.spacing.medium}},t.createElement("div",{className:y.groupLabel,style:{fontSize:m.typography.fontSize.small,fontWeight:600,color:m.colors.text,marginBottom:m.spacing.small,textTransform:"capitalize"}},r[0]?.label||e),t.createElement("div",{role:"list",style:A},r.map((e,t)=>o?o(e,t):z(e,t))))):t.createElement("div",{role:"list",className:y.list,style:A},k.map((e,t)=>o?o(e,t):z(e,t))),n&&k.length>1&&t.createElement("button",{type:"button",onClick:()=>{void 0===e&&h(),a&&a()},className:y.clearAllButton,style:{padding:`${m.spacing.small} ${m.spacing.medium}`,border:`1px solid ${m.colors.border}`,borderRadius:"string"==typeof m.borderRadius?m.borderRadius:m.borderRadius.medium,backgroundColor:m.colors.background,color:m.colors.text,cursor:"pointer",fontSize:m.typography.fontSize.small,textDecoration:"underline",transition:`background-color ${J}`}},"Clear all filters")))},e.CustomSelect=V,e.DocSearch=function({storeId:e,storeSecret:r,seekoraApiEndpoint:a,apiEndpoint:o,apiKey:n,sources:s,placeholder:i="Search documentation...",maxResults:l=10,debounceMs:c=200,onSelect:d,onClose:u,translations:p={},renderButton:m=!0,buttonComponent:g=Xa,initialOpen:f=!1,disableShortcut:h=!1,shortcutKey:y="k",processGroupedResults:b}){const[v,k]=t.useState(f),x=t.useRef(!1),E=!!e,w=eo({storeId:e||"",storeSecret:r,apiEndpoint:a,maxResults:l,debounceMs:c,analyticsTags:["docsearch"]}),S=Ja({apiEndpoint:o,apiKey:n,sources:s,maxResults:l,debounceMs:c,processGroupedResults:b}),{query:C,suggestions:R,isLoading:I,error:N,selectedIndex:z,setQuery:T,selectNext:M,selectPrev:A,setSelectedIndex:_,reset:$,getSelectedItem:L}=E?w:S,P=E?void 0:S.groupedSuggestions,D=E?R:S.results,F=E?"suggestions":S.mode,B=E?[{id:"seekora",name:"Results",endpoint:""}]:S.sources,W=t.useCallback(()=>k(!0),[]),q=t.useCallback(()=>{k(!1),$(),u?.()},[$,u]),H=t.useCallback(e=>{E&&w.trackDocClick&&w.trackDocClick(e,z+1),d?d(e):window.location.href=e.url,q()},[d,q,E,w,z]),O=t.useCallback(()=>{const e=L();e&&H(e)},[L,H]),j=t.useCallback(()=>{x.current=!0,M()},[M]),V=t.useCallback(()=>{x.current=!0,A()},[A]),{handleModalKeyDown:U}=Qa({isOpen:v,onOpen:W,onClose:q,onSelectNext:j,onSelectPrev:V,onEnter:O,disableShortcut:h,shortcutKey:y}),K=t.useCallback(e=>U(e),[U]),Q="results"===F?D:R;return t.createElement(t.Fragment,null,m&&t.createElement(g,{onClick:W,placeholder:p.buttonText||i}),t.createElement(_a,{isOpen:v,onClose:q},t.createElement("div",{className:"seekora-docsearch-modal",onKeyDown:K},t.createElement("header",{className:"seekora-docsearch-header"},t.createElement($a,{value:C,onChange:T,onKeyDown:K,placeholder:i,onClear:$}),t.createElement("button",{type:"button",className:"seekora-docsearch-close",onClick:q,"aria-label":"Close search"},t.createElement("span",{className:"seekora-docsearch-close-text"},"esc"))),t.createElement("div",{className:"seekora-docsearch-body"},t.createElement(Va,{hits:Q,groupedHits:P,selectedIndex:z,onSelect:H,onHover:_,scrollSelectionIntoViewRef:x,query:C,isLoading:I,error:N,translations:p,sources:B})),t.createElement(Ka,{translations:p}))))},e.DocSearchButton=Xa,e.DropdownPanel=ut,e.FacetDropdown=({field:e,placeholder:a="All Categories",className:o,theme:n={},onChange:s,value:i,maxOptions:c=10,showCounts:d=!0,options:p,client:m,applyFilter:g=!0,navigateOnSelect:f=!1,searchPageUrl:h="/search",useFiltersApi:y=!1})=>{const{client:b,theme:v,stateManager:k}=w(),{addRefinement:x,removeRefinement:E,refinements:C,search:R}=S(),I=m||b,[N,z]=t.useState(!1),[T,M]=t.useState(p||[]),[A,_]=t.useState(i||""),[$,L]=t.useState(null),P=t.useRef(null),D=t.useRef(null),F=void 0!==i?i:A,B=t.useCallback(async()=>{if(!p&&I)try{if(l("FacetDropdown: Fetching facet values",{field:e,useFiltersApi:y}),y){const t=await k.fetchFilters({facetBy:e,maxFacetValues:100}),r=(t?.filters||[]).find(t=>t.field===e);if(r&&r.values){const t=r.values.map(e=>({value:e.value||"",count:e.count||0,label:e.value||""}));M(t),l("FacetDropdown: Facet options loaded via Filters API",{field:e,count:t.length})}else l("FacetDropdown: No filter data found",{field:e}),M([])}else{const t=await I.search("*",{facet_by:e,max_facet_values:100,per_page:0});l("FacetDropdown: Search response",{response:t});const r=t?.data?.facets||t?.facets,a=Array.isArray(r)?r:[],o=a.find(t=>t.field_name===e||t.field===e);if(o&&o.counts){const t=o.counts.map(e=>({value:e.value,count:e.count,label:e.value}));M(t),l("FacetDropdown: Facet options loaded",{field:e,count:t.length})}else l("FacetDropdown: No facet data found",{field:e,facets:a}),M([])}}catch(t){const r=t instanceof Error?t:new Error(String(t));u("FacetDropdown: Error fetching facet values",{field:e,error:r.message}),M([])}},[e,I,p,y]);t.useEffect(()=>{!p&&I&&B()},[B,p,I]),t.useEffect(()=>{if(!N||!D.current)return;const e=()=>{if(!D.current)return;const e=D.current.getBoundingClientRect();L({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[N]),t.useEffect(()=>{if(!N)return;const e=e=>{P.current&&!P.current.contains(e.target)&&D.current&&!D.current.contains(e.target)&&z(!1)},t=e=>{"Escape"===e.key&&z(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[N]);const W=t.useCallback(t=>{if(l("FacetDropdown: Value selected",{field:e,value:t}),_(t),z(!1),s&&s(t),g&&x&&E){const r=C.find(t=>t.field===e);r&&E(e,r.value,!1),t?x(e,t,!0):R&&R()}if(f&&t&&"undefined"!=typeof window){const r=new URL(window.location.origin+h);r.searchParams.set(e,t),window.location.href=r.toString()}},[e,s,g,x,E,C,R,f,h]),q=F||a,H=T.length>0,O=["facet-dropdown-button",n.button,o,N&&n.buttonOpen].filter(Boolean).join(" ");return t.createElement("div",{className:"facet-dropdown-container",style:{position:"relative"}},t.createElement("style",{dangerouslySetInnerHTML:{__html:"\n .facet-dropdown-panel {\n --scrollbar-track: transparent;\n --scrollbar-thumb: var(--facet-dropdown-scrollbar-thumb, var(--border-color));\n --scrollbar-thumb-hover: var(--facet-dropdown-scrollbar-thumb-hover, var(--text-secondary));\n }\n .facet-dropdown-panel::-webkit-scrollbar {\n width: 6px;\n }\n .facet-dropdown-panel::-webkit-scrollbar-track {\n background: var(--scrollbar-track);\n }\n .facet-dropdown-panel::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb);\n border-radius: 3px;\n }\n .facet-dropdown-panel::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover);\n }\n .facet-dropdown-panel {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);\n }\n "}}),t.createElement("button",{ref:D,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),z(e=>!e)},className:O,"aria-label":`Filter by ${e}`,"aria-expanded":N,"aria-haspopup":"listbox",style:{display:"flex",alignItems:"center",gap:"0.375rem",padding:"0.625rem 0.75rem",fontSize:"var(--facet-dropdown-font-size, 0.875rem)",fontWeight:"var(--facet-dropdown-font-weight, 500)",color:"var(--facet-dropdown-text, var(--text-color, currentColor))",backgroundColor:"var(--facet-dropdown-button-bg, var(--background, transparent))",border:"1px solid var(--facet-dropdown-border, var(--border-color))",borderRadius:v?.borderRadius&&"string"!=typeof v.borderRadius?v.borderRadius.medium:"0.5rem",cursor:"pointer",transition:"all 0.2s ease",outline:"none",whiteSpace:"nowrap",minWidth:"8rem",...!H&&{opacity:.6,cursor:"not-allowed"}},disabled:!H},t.createElement("span",{style:{flex:1,textAlign:"left",overflow:"hidden",textOverflow:"ellipsis"}},q),t.createElement("svg",{className:n.caretIcon,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:N?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease",flexShrink:0},"aria-hidden":"true"},t.createElement("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))),(()=>{if(!N||!H||!$||"undefined"==typeof document)return null;const o=t.createElement("div",{ref:P,className:n.panel||"facet-dropdown-panel",role:"listbox","aria-label":`${e} options`,style:{position:"absolute",top:`${$.top}px`,left:`${$.left}px`,minWidth:`${$.width}px`,width:"max-content",maxWidth:"min(24rem, 90vw)",maxHeight:"calc(100vh - 100px)",overflowY:"auto",overflowX:"hidden",backgroundColor:"var(--facet-dropdown-bg, var(--background))",border:"1px solid var(--facet-dropdown-border, var(--border-color))",borderRadius:v?.borderRadius&&"string"!=typeof v.borderRadius?v.borderRadius.medium:"0.5rem",boxShadow:"var(--facet-dropdown-shadow, var(--shadow-lg))",zIndex:Z,padding:"0.25rem"}},t.createElement("button",{type:"button",role:"option","aria-selected":!F,onClick:e=>{e.preventDefault(),e.stopPropagation(),W("")},className:[n.option,!F&&n.optionActive].filter(Boolean).join(" "),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",fontSize:"var(--facet-dropdown-option-font-size, 0.875rem)",fontWeight:F?"normal":"var(--facet-dropdown-option-font-weight-active, 500)",color:"var(--facet-dropdown-option-text, var(--text-color, currentColor))",backgroundColor:F?"transparent":"var(--facet-dropdown-option-active-bg, var(--hover-color))",border:"none",borderRadius:v?.borderRadius&&"string"!=typeof v.borderRadius?v.borderRadius.small:"0.25rem",cursor:"pointer",transition:"background-color 0.15s ease",display:"flex",alignItems:"center",justifyContent:"space-between"}},t.createElement("span",null,a)),T.map(e=>{const r=F===e.value;return t.createElement("button",{key:e.value,type:"button",role:"option","aria-selected":r,onClick:t=>{t.preventDefault(),t.stopPropagation(),W(e.value)},className:[n.option,r&&n.optionActive].filter(Boolean).join(" "),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",fontSize:"var(--facet-dropdown-option-font-size, 0.875rem)",fontWeight:r?"var(--facet-dropdown-option-font-weight-active, 500)":"normal",color:"var(--facet-dropdown-option-text, var(--text-color, currentColor))",backgroundColor:r?"var(--facet-dropdown-option-active-bg, var(--hover-color))":"transparent",border:"none",borderRadius:v?.borderRadius&&"string"!=typeof v.borderRadius?v.borderRadius.small:"0.25rem",cursor:"pointer",transition:"background-color 0.15s ease",display:"flex",alignItems:"center",justifyContent:"space-between"}},t.createElement("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"}},e.label||e.value),d&&t.createElement("span",{style:{fontSize:"var(--facet-dropdown-count-font-size, 0.75rem)",color:"var(--facet-dropdown-count-text, var(--text-secondary, currentColor))",opacity:.7,marginLeft:"0.5rem",flexShrink:0}},"(",e.count,")"))}));return r.createPortal(o,document.body)})())},e.Facets=({results:e,facets:r,onFacetChange:a,renderFacet:o,renderFacetItem:n,maxItems:s=10,showMore:i=!0,className:c,style:d,theme:p,variant:m="checkbox",searchable:g=!1,showCounts:f=!0,colorMap:h,defaultCollapsed:y=!1,size:b="medium",facetRanges:v,useFiltersApi:k=!1,disjunctiveFacets:x,hideEmptyFacets:E=!0,defaultCollapsedFields:C,onFacetsAvailable:R})=>{const{theme:N}=w(),{results:z,refinements:T,addRefinement:M,removeRefinement:A}=S(),_=p||{},{filters:$,searchFacetValues:L}=U(k?{disjunctiveFacets:x}:{autoFetch:!1}),[P,D]=t.useState({}),[F,B]=t.useState({}),W=e||z,q=(()=>{if(r)return r;if(k&&$.length>0)return l("Facets: Using Filters API data",{filterCount:$.length}),$.map(e=>({field:e.field||"",label:e.field||"",items:(e.values||[]).map(t=>({value:t.value||"",count:t.count||0,selected:T.some(r=>r.field===e.field&&r.value===t.value)})),stats:null!=e.stats?.min&&null!=e.stats?.max?{min:e.stats.min,max:e.stats.max,avg:e.stats.avg,sum:e.stats.sum}:void 0}));const e=W?.data?.facets||W?.facets||W?.data?.data?.facets||null;if(l("Facets: Extracting facets",{hasResults:!!W,hasData:!!W?.data,rawFacets:e?Array.isArray(e)?e.length:"not array":null,resultsKeys:W?Object.keys(W):[],dataKeys:W?.data?Object.keys(W.data):[],sampleFacet:e&&Array.isArray(e)&&e.length>0?e[0]:null}),!e||!Array.isArray(e))return l("Facets: No facets found in response",{rawFacetsType:e?typeof e:"null",isArray:Array.isArray(e),resultsStructure:W?JSON.stringify(Object.keys(W)):"null",dataStructure:W?.data?JSON.stringify(Object.keys(W.data)):"null"}),[];const t=e.map(e=>{const t=e.field_name||e.field;return{field:t,label:e.label||t,items:Array.isArray(e.counts)?e.counts.map(e=>({value:e.value,count:e.count,selected:T.some(r=>r.field===t&&r.value===e.value)})):[],stats:e.stats||void 0}});return l("Facets: Extracted facets",{count:t.length,facets:t.map(e=>({field:e.field,itemsCount:e.items.length}))}),t})(),H=E?q.filter(e=>{return e.items.length>0||null!=(t=e.stats)&&(null!=t.min||null!=t.max);var t}):q,O=H.length,j=t.useRef(null);t.useEffect(()=>{if(!R)return;const e=O>0;j.current!==e&&(j.current=e,R(e))},[O,R]);const V=(e,t,r)=>{const o=!r;if(l("Facets: Facet toggled",{field:e,value:t,selected:o}),o?M(e,t):A(e,t),a)try{a(e,t,o)}catch(r){const a=r instanceof Error?r:new Error(String(r));u("Facets: Error in onFacetChange callback",{field:e,value:t,selected:o,error:a.message})}},K=e=>{D(t=>({...t,[e]:!t[e]}))},Z=e=>!!C?.includes(e)||y,J=e=>F[e]||"",ee=(e,t)=>{if(!g)return e;const r=J(t).toLowerCase();return r?e.filter(e=>e.value.toLowerCase().includes(r)):e},te=t.useMemo(()=>{switch(b){case"small":return{font:N.typography.fontSize.small,padding:"0.5rem",gap:"0.5rem"};case"large":return{font:N.typography.fontSize.large,padding:"0.75rem",gap:"0.75rem"};default:return{font:N.typography.fontSize.medium,padding:N.spacing.small,gap:N.spacing.small}}},[b,N]),re=e=>g?t.createElement("input",{type:"text",value:J(e.field),onChange:t=>{return r=e.field,a=t.target.value,void B(e=>({...e,[r]:a}));var r,a},placeholder:`Search ${e.label||e.field}...`,className:I(_.searchInput),"aria-label":`Search within ${e.label||e.field}`,style:{width:"100%",boxSizing:"border-box",padding:te.padding,marginBottom:te.gap,fontSize:N.typography.fontSize.small,border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.small,outline:"none",color:N.colors.text,backgroundColor:"var(--seekora-facet-bg, transparent)"}}):null,ae=(e,r,a)=>{if(!(P[r.field]||a<s)&&a>=s)return null;const o=T.some(t=>t.field===r.field&&t.value===e.value)||e.selected||!1;return t.createElement("div",{key:`${r.field}-${e.value}`,className:I(_.facetItem,o&&_.facetItemActive),role:"option","aria-selected":o,"aria-checked":o,tabIndex:-1,onClick:()=>V(r.field,e.value,e.selected||!1),style:{display:"flex",alignItems:"center",padding:te.padding,cursor:"pointer",borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium,marginBottom:te.gap,backgroundColor:o?"var(--seekora-facet-active-bg, "+N.colors.hover+")":"transparent",transition:"background-color 0.2s ease",boxSizing:"border-box"}},t.createElement("input",{type:"checkbox",checked:T.some(t=>t.field===r.field&&t.value===e.value)||e.selected||!1,onChange:()=>V(r.field,e.value,e.selected||!1),className:_.checkbox,style:{marginRight:te.gap,cursor:"pointer"},"aria-label":`Filter by ${e.value}`}),t.createElement("span",{className:_.facetItemLabel,style:{flex:1,fontSize:te.font,lineHeight:1.5,color:N.colors.text}},e.value),(n=e.count,f?t.createElement("span",{className:I(_.countBadge),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"1.5em",padding:"0.1em 0.5em",marginLeft:te.gap,fontSize:N.typography.fontSize.small,fontWeight:N.typography.fontWeight?.medium??500,lineHeight:1,color:"var(--seekora-facet-count-color, #495057)",backgroundColor:"var(--seekora-facet-count-bg, #e9ecef)",borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.full,flexShrink:0}},n):null));var n},oe=(e,r,a)=>{if(!(P[r.field]||a<s)&&a>=s)return null;const o=T.some(t=>t.field===r.field&&t.value===e.value)||e.selected||!1,n=h?.[e.value]??function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t),t|=0;return`hsl(${Math.abs(t)%360}, 65%, 55%)`}(e.value),i=function(e){switch(e){case"small":return 24;case"large":return 40;default:return 32}}(b);return t.createElement("div",{key:`${r.field}-${e.value}`,className:I(_.facetItem,o&&_.facetItemActive),role:"option","aria-selected":o,"aria-checked":o,tabIndex:-1,onClick:()=>V(r.field,e.value,e.selected||!1),title:`${e.value}${f?` (${e.count})`:""}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",cursor:"pointer",margin:te.gap}},t.createElement("div",{className:I(_.colorSwatch,o&&_.colorSwatchSelected),style:{width:`var(--seekora-facet-swatch-size, ${i}px)`,height:`var(--seekora-facet-swatch-size, ${i}px)`,borderRadius:"50%",backgroundColor:n,border:o?`3px solid var(--seekora-primary, ${N.colors.primary})`:`2px solid var(--seekora-facet-border, ${N.colors.border})`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border 0.2s ease, box-shadow 0.2s ease",boxShadow:o?`0 0 0 2px var(--seekora-primary-alpha, ${N.colors.primary}33)`:"none",position:"relative"}},o&&t.createElement("span",{className:I(_.colorSwatchInner),style:{display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(X,{size:Math.round(.5*i)}))),t.createElement("span",{className:_.facetItemLabel,style:{fontSize:N.typography.fontSize.small,color:N.colors.text,marginTop:"0.25rem",textAlign:"center",maxWidth:`${i+16}px`,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.value),f&&t.createElement("span",{className:I(_.countBadge),style:{fontSize:N.typography.fontSize.small,color:"var(--seekora-facet-count-color, "+(N.colors.textSecondary||N.colors.text)+")",lineHeight:1,marginTop:"0.125rem"}},e.count))},ne=(e,t,r)=>n?n(e,t,r):"color-swatch"===m?oe(e,t,r):ae(e,t,r),se=(e,t,r)=>{const a=e.currentTarget.querySelector('[aria-selected="true"]'),o=Array.from(e.currentTarget.querySelectorAll('[role="option"]')),n=a?o.indexOf(a):-1;if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(n+1,o.length-1);o[t]?.focus()}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(n-1,0);o[t]?.focus()}else"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n>=0&&n<t.length&&V(r.field,t[n].value,t[n].selected||!1))},ie=(e,r)=>{const a=P[e.field]||!1,o=r.length>s;return t.createElement(t.Fragment,null,i&&o&&!a&&t.createElement("button",{type:"button",onClick:()=>K(e.field),style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Show more (",r.length-s," more)"),a&&o&&t.createElement("button",{type:"button",onClick:()=>K(e.field),style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Show less"))},le=(e,r)=>{const a=(o=e.field)in P?P[o]:!Z(o);var o;const n=ee(e.items,e.field);P[e.field];const l=P[`_items_${e.field}`]||!1,c=l?n:n.slice(0,s),d=n.length>s;return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium,overflow:"hidden"}},t.createElement("button",{type:"button",className:I(_.collapsibleHeader),onClick:()=>(e=>{D(t=>({...t,[e]:!(t[e]??!Z(e))}))})(e.field),"aria-expanded":a,"aria-controls":`facet-group-${e.field}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:N.spacing.medium,border:"none",backgroundColor:"transparent",cursor:"pointer",textAlign:"left"}},t.createElement("span",{className:_.facetTitle,style:{color:N.colors.text,flex:1}},e.label||e.field),t.createElement("span",{className:I(_.collapsibleIcon)},t.createElement(G,{expanded:a,color:N.colors.textSecondary||N.colors.text}))),a&&t.createElement("div",{id:`facet-group-${e.field}`,style:{padding:`0 ${N.spacing.medium} ${N.spacing.medium}`}},re(e),t.createElement("div",{className:_.facetList,role:"listbox","aria-label":`${e.label||e.field} filters`,tabIndex:0,onKeyDown:t=>se(t,c,e)},c.map((t,r)=>ne(t,e,r))),i&&d&&!l&&t.createElement("button",{type:"button",onClick:()=>D(t=>({...t,[`_items_${e.field}`]:!0})),style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Show more (",n.length-s," more)"),l&&d&&t.createElement("button",{type:"button",onClick:()=>D(t=>({...t,[`_items_${e.field}`]:!1})),style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Show less")))},ce=(e,r)=>{const a=v?.find(t=>t.field===e.field);if(!a)return null;const o=new Map;e.items.forEach(e=>o.set(e.value,e.count));const n=T.find(t=>t.field===e.field&&t.value.startsWith(">=")),s=T.find(t=>t.field===e.field&&t.value.startsWith("<=")),i=n?parseFloat(n.value.slice(2)):void 0,l=s?parseFloat(s.value.slice(2)):void 0,c=e=>{const t=void 0===e.from?void 0===i:i===e.from,r=void 0===e.to?void 0===l:l===e.to;return t&&r},d=void 0!==n||void 0!==s;return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,padding:N.spacing.medium,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium}},t.createElement("h3",{className:_.facetTitle,style:{margin:0,marginBottom:N.spacing.medium,color:N.colors.text}},e.label||e.field),t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:te.gap}},a.ranges.map(r=>{const a=o.get(r.label)??0,n=c(r);return t.createElement("button",{key:r.label,type:"button",className:I(_.rangeButton,n&&_.rangeButtonActive),disabled:0===a&&!n,onClick:()=>(t=>{if(T.filter(t=>t.field===e.field).forEach(t=>A(e.field,t.value,!1)),c(t))return M(e.field,"__noop__",!1),void A(e.field,"__noop__",!0);void 0!==t.from&&M(e.field,`>=${t.from}`,!1),void 0!==t.to?M(e.field,`<=${t.to}`,!0):void 0!==t.from&&M(e.field,`>=${t.from}`,!0)})(r),style:{display:"inline-flex",alignItems:"center",gap:"0.35em",padding:`${te.padding} 0.75em`,fontSize:te.font,border:"1px solid "+(n?"var(--seekora-primary, "+N.colors.primary+")":"var(--seekora-facet-border, "+N.colors.border+")"),borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.full,backgroundColor:n?"var(--seekora-primary, "+N.colors.primary+")":"var(--seekora-facet-bg, "+N.colors.background+")",color:n?"var(--seekora-primary-text, #fff)":N.colors.text,cursor:0!==a||n?"pointer":"not-allowed",opacity:0!==a||n?1:.5,transition:"all 0.2s ease"}},r.label,f&&t.createElement("span",{className:I(_.rangeButtonCount),style:{fontSize:N.typography.fontSize.small,opacity:.8}},"(",a,")"))})),d&&t.createElement("button",{type:"button",className:I(_.rangeClear),onClick:()=>{T.filter(t=>t.field===e.field).forEach(t=>A(e.field,t.value,!1)),M(e.field,"__noop__",!1),A(e.field,"__noop__",!0)},style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Clear"))},de=(e,r)=>{const a=(o=e.field,n=e.stats,v?.some(e=>e.field===o)?"range-buttons":n&&"number"==typeof n.min&&"number"==typeof n.max&&n.min!==n.max?"range-slider":"list");var o,n;if("range-buttons"===a)return ce(e);if("range-slider"===a)return(e=>{if(!e.stats)return null;const{min:r,max:a}=e.stats,o=e.field.toLowerCase(),n=o.includes("price")||o.includes("cost")||o.includes("amount"),s=n?e=>`$${e.toFixed(2)}`:e=>e.toString(),i=n?.01:a-r>10?1:.1,l=T.some(t=>t.field===e.field&&(t.value.startsWith(">=")||t.value.startsWith("<=")));return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,padding:N.spacing.medium,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium}},t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:N.spacing.small}},t.createElement("h3",{className:_.facetTitle,style:{margin:0,color:N.colors.text}},e.label||e.field),l&&t.createElement("button",{type:"button",className:I(_.rangeClear),onClick:()=>{T.filter(t=>t.field===e.field&&(t.value.startsWith(">=")||t.value.startsWith("<="))).forEach(t=>A(e.field,t.value,!1)),M(e.field,"__noop__",!1),A(e.field,"__noop__",!0)},style:{padding:"0.15em 0.5em",border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Clear")),t.createElement(Q,{field:e.field,min:r,max:a,step:i,formatValue:s,syncWithState:!0}))})(e);switch(m){case"color-swatch":return(e=>{const r=ee(e.items,e.field),a=P[e.field]?r:r.slice(0,s);return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,padding:N.spacing.medium,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium}},t.createElement("h3",{className:_.facetTitle,style:{margin:0,marginBottom:N.spacing.medium,color:N.colors.text}},e.label||e.field),re(e),t.createElement("div",{className:_.facetList,role:"listbox","aria-label":`${e.label||e.field} filters`,tabIndex:0,onKeyDown:t=>se(t,a,e),style:{display:"flex",flexWrap:"wrap",gap:te.gap}},a.map((t,r)=>ne(t,e,r))),ie(e,r))})(e);case"collapsible":return le(e);default:return(e=>{const r=ee(e.items,e.field),a=P[e.field]?r:r.slice(0,s);return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,padding:N.spacing.medium,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium}},t.createElement("h3",{className:_.facetTitle,style:{margin:0,marginBottom:N.spacing.medium,color:N.colors.text}},e.label||e.field),re(e),t.createElement("div",{className:_.facetList,role:"listbox","aria-label":`${e.label||e.field} filters`,tabIndex:0,onKeyDown:t=>se(t,a,e)},a.map((t,r)=>ne(t,e,r))),ie(e,r))})(e)}};return 0===H.length?(l("Facets: No facets to display",{hasResults:!!W,resultsType:W?typeof W:"null"}),null):t.createElement("div",{className:I(_.container,c),style:{...Y,...d}},H.map((e,t)=>o?o(e,t):de(e)))},e.FederatedDropdown=Pe,e.Fingerprint=v,e.FrequentlyBoughtTogether=({productId:e,items:r,loading:a=!1,title:o="Frequently Bought Together",maxItems:n=4,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u="horizontal",currencySymbol:p="$",showAddAllButton:m=!0,onAddAll:g})=>{const{theme:f}=w(),h=d||{},y=r?.slice(0,n)||[],b=a,v=t.useMemo(()=>y.reduce((e,t)=>{const r=t.price;return e+("number"==typeof r?r:parseFloat(String(r))||0)},0),[y]);return b&&0===y.length||0===y.length?null:t.createElement("div",{className:I(h.root,l),style:c},o&&t.createElement("h3",{className:h.title,style:{margin:`0 0 ${f.spacing.medium} 0`,fontSize:f.typography.fontSize.large,fontWeight:f.typography.fontWeight?.semibold||600,color:f.colors.text}},o),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:f.spacing.medium,flexWrap:"wrap"}},y.map((e,r)=>t.createElement(t.Fragment,{key:e.id||r},r>0&&t.createElement("span",{style:{fontSize:"1.5rem",color:f.colors.textSecondary}},"+"),t.createElement("div",{onClick:()=>i?.(e,r),style:{cursor:i?"pointer":"default",textAlign:"center"}},s?s(e,r):t.createElement(t.Fragment,null,t.createElement("img",{src:e.image||e.imageUrl||"",alt:e.title||e.name||"",style:{width:"80px",height:"80px",objectFit:"cover",borderRadius:"string"==typeof f.borderRadius?f.borderRadius:f.borderRadius.small,border:`1px solid ${f.colors.border}`}}),t.createElement("div",{style:{marginTop:f.spacing.small,fontSize:f.typography.fontSize.small,color:f.colors.text}},p,"number"==typeof e.price?e.price.toFixed(2):e.price))))),m&&y.length>0&&t.createElement("div",{style:{marginLeft:"auto",textAlign:"center"}},t.createElement("div",{style:{fontSize:f.typography.fontSize.large,fontWeight:f.typography.fontWeight?.bold||700,color:f.colors.text,marginBottom:f.spacing.small}},"Total: ",p,v.toFixed(2)),t.createElement("button",{type:"button",onClick:()=>g?.(y),style:{padding:`${f.spacing.small} ${f.spacing.medium}`,fontSize:f.typography.fontSize.medium,fontWeight:f.typography.fontWeight?.medium||500,color:"#ffffff",backgroundColor:f.colors.primary,border:"none",borderRadius:"string"==typeof f.borderRadius?f.borderRadius:f.borderRadius.medium,cursor:"pointer"}},"Add all to cart"))))},e.GoogleDropdown=la,e.HierarchicalMenu=({attributes:e,separator:r=" > ",limit:a=10,showMore:o=!0,showMoreLimit:n=20,renderItem:s,onSelect:i,className:l,style:c,theme:d,rootPath:u=null,sortBy:p="name",items:m})=>{const{theme:g,stateManager:f}=w(),{results:h,refinements:y,addRefinement:b,removeRefinement:v}=S(),k=d||{},[x,E]=t.useState({}),C=t.useCallback(()=>{if(m)return m;if(!h)return[];const t=h.facets||h.facet_counts||{},r=e[0],a=t[r]||{},o=[];return Object.entries(a).forEach(([e,t])=>{const a=y.some(t=>t.field===r&&t.value===e);o.push({label:e,value:e,count:t,isRefined:a,data:R(e,1)})}),o},[h,e,y,m]),R=t.useCallback((t,a)=>{if(a>=e.length)return[];if(!h)return[];const o=h.facets||h.facet_counts||{},n=e[a],s=o[n]||{},i=[];return Object.entries(s).forEach(([e,o])=>{if(e.startsWith(t+r)){const s=e.replace(t+r,"").split(r)[0],l=y.some(t=>t.field===n&&t.value===e);e.replace(t+r,"").includes(r)||i.push({label:s,value:e,count:o,isRefined:l,data:R(e,a+1)})}}),i},[h,e,r,y]),N=t.useMemo(()=>{let e=C();return e=[...e].sort((e,t)=>{if("count"===p)return(t.count||0)-(e.count||0);if("isRefined"===p){if(e.isRefined&&!t.isRefined)return-1;if(!e.isRefined&&t.isRefined)return 1}return e.label.localeCompare(t.label)}),e},[C,p]),z=t.useCallback((t,r)=>{const a=e[r]||e[0];t.isRefined?(e.slice(r).forEach(e=>{y.filter(r=>r.field===e&&r.value.startsWith(t.value)).forEach(e=>v(e.field,e.value,!1))}),f.search()):(y.filter(e=>e.field===a&&e.value!==t.value).forEach(e=>v(e.field,e.value,!1)),b(a,t.value,!0)),i&&i(t.value,r)},[e,y,b,v,f,i]),T=t.useRef(null),M=t.useCallback(()=>T.current?Array.from(T.current.querySelectorAll('[role="treeitem"]')):[],[]),A=t.useCallback(e=>{const t=M();if(0===t.length)return;const r=document.activeElement,a=t.find(e=>e===r||e.contains(r)),o=a?t.indexOf(a):-1;switch(e.key){case"ArrowDown":{e.preventDefault();const r=o<t.length-1?o+1:0,a=t[r].querySelector("button");a?a.focus():t[r].focus();break}case"ArrowUp":{e.preventDefault();const r=o>0?o-1:t.length-1,a=t[r].querySelector("button");a?a.focus():t[r].focus();break}case"ArrowRight":{if(!a)break;const t=a.getAttribute("aria-expanded");if("false"===t){e.preventDefault();const t=a.querySelector("button");t&&t.click()}else if("true"===t){e.preventDefault();const t=a.querySelector('[role="group"]');if(t){const e=t.querySelector('[role="treeitem"]');if(e){const t=e.querySelector("button");t?t.focus():e.focus()}}}break}case"ArrowLeft":if(!a)break;if("true"===a.getAttribute("aria-expanded")){e.preventDefault();const t=a.querySelector("button");t&&t.click()}else{e.preventDefault();const t=a.closest('[role="group"]');if(t){const e=t.closest('[role="treeitem"]');if(e){const t=e.querySelector(":scope > button");t?t.focus():e.focus()}}}break;case"Enter":{if(!a)break;e.preventDefault();const t=a.querySelector("button");t&&t.click();break}}},[M]),_=(e,r)=>{if(!e||0===e.length)return null;const i=x[r]||!1,l=i?n:a,c=e.slice(0,l),d=e.length>l;return t.createElement("ul",{role:0===r?"tree":"group",className:k.list,style:{listStyle:"none",margin:0,padding:r>0?`0 0 0 ${g.spacing.medium}`:0}},c.map((e,a)=>t.createElement("li",{key:e.value,role:"treeitem",...e.data&&e.data.length>0?{"aria-expanded":!!e.isRefined}:{},className:I(k.item,e.isRefined&&k.itemSelected,e.data&&e.data.length>0&&k.itemParent),style:{padding:`${g.spacing.small} 0`}},s?s(e,r):t.createElement(t.Fragment,null,t.createElement("button",{type:"button",onClick:()=>z(e,r),className:k.link,style:{display:"flex",alignItems:"center",gap:g.spacing.small,width:"100%",padding:0,background:"none",border:"none",cursor:"pointer",textAlign:"left",fontFamily:"inherit",fontSize:g.typography.fontSize.small,color:e.isRefined?g.colors.primary:g.colors.text,fontWeight:e.isRefined?600:400}},t.createElement("span",{className:k.label,style:{flex:1}},e.label),void 0!==e.count&&t.createElement("span",{className:k.count,style:{color:g.colors.textSecondary,fontSize:g.typography.fontSize.small}},e.count)),e.isRefined&&e.data&&e.data.length>0&&_(e.data,r+1)))),o&&d&&t.createElement("li",null,t.createElement("button",{type:"button",onClick:()=>(e=>{E(t=>({...t,[e]:!t[e]}))})(r),className:k.showMore,style:{padding:`${g.spacing.small} 0`,background:"none",border:"none",cursor:"pointer",fontSize:g.typography.fontSize.small,color:g.colors.primary,textDecoration:"underline"}},i?"Show less":`Show ${e.length-l} more`)))};return 0===N.length?null:t.createElement("div",{ref:T,className:I(k.root,l),style:c,tabIndex:0,onKeyDown:A},_(N,0))},e.Highlight=({hit:e,attribute:r,className:a,style:o,theme:n,tagName:s="span",renderHighlighted:i,renderNonHighlighted:l,query:c})=>{const{theme:d}=w(),u=n||{},f=t.useMemo(()=>p({hit:e,attribute:r,preTag:"<mark>",postTag:"</mark>"}),[e,r]),h=t.useMemo(()=>{const t=m(f,"<mark>","</mark>");if(t.every(e=>!e.isHighlighted)&&c){const t=e[r]||f;return g(String(t),c)}return t},[f,c,e,r]),y={backgroundColor:d.colors.warning||"#fff59d",fontWeight:d.typography.fontWeight?.semibold||600,padding:"0 2px",borderRadius:"2px"},b=h.map((e,r)=>e.isHighlighted?i?t.createElement(t.Fragment,{key:r},i(e,r)):t.createElement("mark",{key:r,className:u.highlighted,style:y},e.value):l?t.createElement(t.Fragment,{key:r},l(e,r)):t.createElement("span",{key:r,className:u.nonHighlighted},e.value));return t.createElement(s,{className:a||u.root,style:o},b)},e.HitsPerPage=({items:e,onHitsPerPageChange:r,renderSelect:a,className:o,style:n,theme:s,label:i="Show",syncWithState:l=!0})=>{const{theme:c}=w(),{itemsPerPage:d,setPage:u}=S(),{stateManager:p}=w(),m=s||{},g=e.find(e=>e.default)||e[0],[f,h]=t.useState(g?.value||10);t.useEffect(()=>{l&&g&&d!==g.value&&p.setItemsPerPage(g.value,!1)},[]);const y=l?d:f,b=e=>{const t=parseInt(e.target.value,10);h(t),l&&(p.setItemsPerPage(t,!1),u(1,!0)),r&&r(t)};return a?t.createElement("div",{className:I(m.root,o),style:n},a({value:y,onChange:b,items:e})):t.createElement("div",{className:I(m.root,o),style:{display:"flex",alignItems:"center",gap:c.spacing.small,...n}},i&&t.createElement("label",{style:{fontSize:c.typography.fontSize.medium,color:c.colors.text}},i),t.createElement(V,{value:String(y),onChange:e=>{const t=parseInt(e,10);h(t),l&&(p.setItemsPerPage(t,!1),u(1,!0)),r&&r(t)},options:e.map(e=>({value:String(e.value),label:e.label})),"aria-label":"Results per page",className:m.select,style:{"--seekora-select-font-size":c.typography.fontSize.medium,"--seekora-select-border":c.colors.border,"--seekora-select-radius":"string"==typeof c.borderRadius?c.borderRadius:c.borderRadius.medium,"--seekora-select-bg":c.colors.background,"--seekora-select-color":c.colors.text}}))},e.ImageDisplay=kt,e.ImageZoom=bt,e.InfiniteHits=({renderHit:e,renderEmpty:r,renderShowMore:a,showMoreButton:o=!0,useInfiniteScroll:n=!1,scrollThreshold:s=.1,fieldMapping:i,showMoreLabel:l="Show more",onHitClick:c,className:d,style:u,theme:p,syncWithState:m=!0})=>{const{theme:g,stateManager:f}=w(),{results:h,loading:y,currentPage:b,setPage:v}=S(),k=p||{},[x,E]=t.useState([]),[C,R]=t.useState(!1),N=t.useRef(null),z=t.useRef(b),T=t.useCallback(e=>e?e.results?e.results:e.hits?e.hits:Array.isArray(e)?e:[]:[],[]),M=t.useMemo(()=>T(h),[h,T]),A=h?.totalResults||h?.found||0,_=f.getState().itemsPerPage||10,$=Math.ceil(A/_),L=b>=$;t.useEffect(()=>{M.length&&(1===b?E(M):b>z.current&&E(e=>[...e,...M]),z.current=b,R(!1))},[M,b]),t.useEffect(()=>{1===b&&(E(M),z.current=1)},[h]);const P=t.useCallback(()=>{L||y||C||(R(!0),m&&v(b+1))},[L,y,C,m,v,b]);t.useEffect(()=>{if(!n||!N.current)return;const e=new IntersectionObserver(e=>{!e[0].isIntersecting||L||y||C||P()},{threshold:s});return e.observe(N.current),()=>e.disconnect()},[n,s,L,y,C,P]);const D=(e,t)=>{if(!i||!i[t])return e[t]||"";return e[i[t]]||""};return y&&0===x.length?t.createElement("div",{className:I(k.root,d),style:u}):y||0!==x.length?t.createElement("div",{className:I(k.root,d),style:u},t.createElement("div",{className:k.list},x.map((r,a)=>e?e(r,a):((e,r)=>{const a=D(e,"title")||e.title||"",o=D(e,"description")||e.description||"",n=D(e,"image")||e.image||e.imageUrl||"",s=D(e,"price")||e.price;return t.createElement("div",{key:e.id||r,className:k.item,style:{display:"flex",gap:g.spacing.medium,padding:g.spacing.medium,borderBottom:`1px solid ${g.colors.border}`,cursor:c?"pointer":"default",transition:g.transitions?.fast||"150ms ease-in-out"},onClick:()=>c?.(e,r),role:c?"button":void 0,tabIndex:c?0:void 0},n&&t.createElement("img",{src:n,alt:a,style:{width:"80px",height:"80px",objectFit:"cover",borderRadius:"string"==typeof g.borderRadius?g.borderRadius:g.borderRadius.small}}),t.createElement("div",{style:{flex:1}},t.createElement("h3",{style:{margin:0,marginBottom:g.spacing.small,fontSize:g.typography.fontSize.medium,fontWeight:g.typography.fontWeight?.semibold||600,color:g.colors.text}},a),o&&t.createElement("p",{style:{margin:0,fontSize:g.typography.fontSize.small,color:g.colors.textSecondary,lineHeight:g.typography.lineHeight?.normal||1.5}},o),s&&t.createElement("span",{style:{display:"inline-block",marginTop:g.spacing.small,fontSize:g.typography.fontSize.medium,fontWeight:g.typography.fontWeight?.bold||700,color:g.colors.primary}},"$","number"==typeof s?s.toFixed(2):s)))})(r,a))),o&&!n&&!L&&(a?a({isLoading:C,isLastPage:L,onClick:P}):t.createElement("button",{type:"button",onClick:P,disabled:L||C,className:I(k.loadMore,(L||C)&&k.loadMoreDisabled),style:{display:"block",width:"100%",padding:g.spacing.medium,marginTop:g.spacing.medium,fontSize:g.typography.fontSize.medium,fontWeight:g.typography.fontWeight?.medium||500,backgroundColor:L||C?g.colors.hover:g.colors.primary,color:L||C?g.colors.textSecondary:"#ffffff",border:"none",borderRadius:"string"==typeof g.borderRadius?g.borderRadius:g.borderRadius.medium,cursor:L||C?"not-allowed":"pointer",transition:g.transitions?.fast||"150ms ease-in-out"}},L?"No more results":l)),n&&!L&&t.createElement("div",{ref:N,className:k.sentinel,style:{height:"1px",visibility:"hidden"},"aria-hidden":"true"})):t.createElement("div",{className:I(k.root,d),style:u},r?r():t.createElement("div",{className:k.empty,style:{padding:g.spacing.large,textAlign:"center",color:g.colors.textSecondary}},"No results found"))},e.ItemCard=_t,e.ItemGrid=Lt,e.MinimalDropdown=Na,e.MobileFilters=({isOpen:e,onClose:r,onApply:a,title:o="Filters",applyButtonText:n="Apply",clearButtonText:s="Clear all",position:i="right",children:l,className:c,theme:d,showHeader:u=!0,showFooter:p=!0,showFilterCount:m=!0,closeOnBackdropClick:g=!0,closeOnEscape:f=!0})=>{const{theme:h}=w(),{refinements:y,clearRefinements:b}=S(),v=d||{},k=t.useRef(null);t.useEffect(()=>(document.body.style.overflow=e?"hidden":"",()=>{document.body.style.overflow=""}),[e]),t.useEffect(()=>{if(!f)return;const t=t=>{"Escape"===t.key&&e&&r()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,r,f]),t.useEffect(()=>{if(e&&k.current){const e=k.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),t=e[0],r=e[e.length-1],a=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===t&&(e.preventDefault(),r?.focus()):document.activeElement===r&&(e.preventDefault(),t?.focus()))};return document.addEventListener("keydown",a),t?.focus(),()=>document.removeEventListener("keydown",a)}},[e]);const x=t.useCallback(()=>{g&&r()},[g,r]),E=t.useCallback(()=>{a&&a(),r()},[a,r]),C=t.useCallback(()=>{b(!0)},[b]),R=e=>{if(e)return"translate(0, 0)";switch(i){case"left":return"translateX(-100%)";case"right":default:return"translateX(100%)";case"bottom":return"translateY(100%)"}};return e?t.createElement(t.Fragment,null,t.createElement("div",{className:v.overlay,onClick:x,style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:h.zIndex?.modal||1050,opacity:e?1:0,transition:"opacity 300ms ease-in-out"},"aria-hidden":"true"}),t.createElement("div",{ref:k,className:I(v.drawer,c),style:(()=>{const t={position:"fixed",backgroundColor:h.colors.background,display:"flex",flexDirection:"column",transition:"transform 300ms ease-in-out",transform:R(e),zIndex:(h.zIndex?.modal||1050)+1};switch(i){case"left":return{...t,top:0,left:0,bottom:0,width:"80%",maxWidth:"320px"};case"right":return{...t,top:0,right:0,bottom:0,width:"80%",maxWidth:"320px"};case"bottom":return{...t,left:0,right:0,bottom:0,maxHeight:"80vh",borderTopLeftRadius:"16px",borderTopRightRadius:"16px"};default:return t}})(),role:"dialog","aria-modal":"true","aria-label":o},u&&t.createElement("div",{className:v.header,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:h.spacing.medium,borderBottom:`1px solid ${h.colors.border}`}},t.createElement("div",{style:{display:"flex",alignItems:"center",gap:h.spacing.small}},t.createElement("h2",{className:v.title,style:{margin:0,fontSize:h.typography.fontSize.large,fontWeight:h.typography.fontWeight?.semibold||600,color:h.colors.text}},o),m&&y.length>0&&t.createElement("span",{className:v.filterCount,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"24px",height:"24px",padding:"0 6px",fontSize:h.typography.fontSize.small,fontWeight:h.typography.fontWeight?.bold||700,color:"#ffffff",backgroundColor:h.colors.primary,borderRadius:"12px"}},y.length)),t.createElement("button",{type:"button",onClick:r,className:v.closeButton,style:{padding:h.spacing.small,background:"none",border:"none",cursor:"pointer",fontSize:"1.5rem",color:h.colors.text},"aria-label":"Close filters"},"×")),t.createElement("div",{className:v.content,style:{flex:1,overflow:"auto",padding:h.spacing.medium}},l),p&&t.createElement("div",{className:v.footer,style:{display:"flex",gap:h.spacing.small,padding:h.spacing.medium,borderTop:`1px solid ${h.colors.border}`}},t.createElement("button",{type:"button",onClick:C,className:v.clearButton,style:{flex:1,padding:h.spacing.medium,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.medium||500,color:h.colors.text,backgroundColor:"transparent",border:`1px solid ${h.colors.border}`,borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:"pointer"}},s),t.createElement("button",{type:"button",onClick:E,className:v.applyButton,style:{flex:2,padding:h.spacing.medium,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.medium||500,color:"#ffffff",backgroundColor:h.colors.primary,border:"none",borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:"pointer"}},n,m&&y.length>0&&` (${y.length})`)))):null},e.MobileFiltersButton=({onClick:e,text:r="Filters",showCount:a=!0,className:o,style:n})=>{const{theme:s}=w(),{refinements:i}=S();return t.createElement("button",{type:"button",onClick:e,className:o,style:{display:"inline-flex",alignItems:"center",gap:s.spacing.small,padding:`${s.spacing.small} ${s.spacing.medium}`,fontSize:s.typography.fontSize.medium,fontWeight:s.typography.fontWeight?.medium||500,color:s.colors.text,backgroundColor:s.colors.background,border:`1px solid ${s.colors.border}`,borderRadius:"string"==typeof s.borderRadius?s.borderRadius:s.borderRadius.medium,cursor:"pointer",...n}},t.createElement("span",null,"☰"),t.createElement("span",null,r),a&&i.length>0&&t.createElement("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 4px",fontSize:s.typography.fontSize.small,fontWeight:s.typography.fontWeight?.bold||700,color:"#ffffff",backgroundColor:s.colors.primary,borderRadius:"10px"}},i.length))},e.MobileSheetDropdown=Ia,e.Pagination=({results:e,currentPage:r,itemsPerPage:a,totalPages:o,onPageChange:n,maxPages:s=7,showFirstLast:i=!0,showPrevNext:l=!0,renderPageButton:c,className:d,style:u,theme:p,variant:m="numbered",loadMoreText:g="Load More",size:f="medium",showPageInfo:h,previousLabel:y="Previous",nextLabel:b="Next"})=>{const{theme:v}=w(),{results:k,currentPage:x,setPage:E}=S(),C=p||{},R=W(),N=R?Math.min(s,5):s,z=r||x,T=e||k,M=a||T?.perPage||T?.data?.per_page||T?.data?.data?.per_page||20,A=T?.totalResults||T?.data?.total_results||T?.data?.data?.total_results||0,_=o||T?.totalPages||T?.data?.total_pages||T?.data?.data?.total_pages||Math.ceil(A/M),$=void 0!==h?h:"simple"===m,L=((e,t)=>t?{small:{paddingKey:"small",fontSizeKey:"small",minWidth:"40px",minHeight:"40px"},medium:{paddingKey:"small",fontSizeKey:"medium",minWidth:"44px",minHeight:"44px"},large:{paddingKey:"medium",fontSizeKey:"large",minWidth:"48px",minHeight:"48px"}}[e]:{small:{paddingKey:"small",fontSizeKey:"small",minWidth:"32px",minHeight:"32px"},medium:{paddingKey:"small",fontSizeKey:"medium",minWidth:"40px",minHeight:"40px"},large:{paddingKey:"medium",fontSizeKey:"large",minWidth:"48px",minHeight:"48px"}}[e])(f,R),P="var(--seekora-pagination-bg, "+v.colors.background+")",D="var(--seekora-pagination-color, "+v.colors.text+")",F="var(--seekora-pagination-active-bg, "+v.colors.primary+")",B="var(--seekora-pagination-active-color, #fff)",q="var(--seekora-pagination-border, "+v.colors.border+")",H="var(--seekora-pagination-radius, "+("string"==typeof v.borderRadius?v.borderRadius:v.borderRadius.medium)+")",O=e=>{e<1||e>_||e===z||(E(e),n&&n(e))};if(_<=1&&"load-more"!==m)return null;if("load-more"===m&&z>=_)return null;const j=$?t.createElement("span",{className:I(C.pageInfo),style:{fontSize:v.typography.fontSize[L.fontSizeKey],color:D,padding:`0 ${v.spacing.small}`,whiteSpace:"nowrap"},"aria-live":"polite"},"Page ",z," of ",_):null;if("load-more"===m){const e=Math.max(0,A-z*M);return t.createElement("nav",{className:I(C.container,d),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:v.spacing.small,...u},"aria-label":"Pagination"},t.createElement("button",{type:"button",onClick:()=>O(z+1),className:I(C.loadMoreButton),style:{padding:`${v.spacing[L.paddingKey]} ${v.spacing.large}`,border:"none",borderRadius:H,backgroundColor:F,color:B,cursor:"pointer",fontSize:v.typography.fontSize[L.fontSizeKey],fontWeight:v.typography.fontWeight?.medium??500,transition:v.transitions?.fast??"150ms ease-in-out",minWidth:L.minWidth},"aria-label":e>0?`${g} (${e} remaining)`:g},g,e>0&&t.createElement("span",{className:I(C.loadMoreText),style:{marginLeft:v.spacing.small,opacity:.85,fontSize:v.typography.fontSize.small}},"(",e," remaining)")),j)}if("simple"===m)return t.createElement("nav",{className:I(C.container,C.simpleContainer,d),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:v.spacing.medium,...u},"aria-label":"Pagination"},t.createElement("button",{type:"button",disabled:1===z,onClick:()=>O(z-1),className:I(C.simpleButton,1===z&&C.itemDisabled),style:{padding:`${v.spacing[L.paddingKey]} ${v.spacing.medium}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:P,color:D,cursor:1===z?"not-allowed":"pointer",opacity:1===z?.5:1,fontSize:v.typography.fontSize[L.fontSizeKey],minWidth:L.minWidth,transition:v.transitions?.fast??"150ms ease-in-out"},"aria-label":"Previous page"},y),t.createElement("span",{className:I(C.simpleText,C.pageInfo),style:{fontSize:v.typography.fontSize[L.fontSizeKey],color:D,whiteSpace:"nowrap"},"aria-live":"polite"},"Page ",z," of ",_),t.createElement("button",{type:"button",disabled:z===_,onClick:()=>O(z+1),className:I(C.simpleButton,z===_&&C.itemDisabled),style:{padding:`${v.spacing[L.paddingKey]} ${v.spacing.medium}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:P,color:D,cursor:z===_?"not-allowed":"pointer",opacity:z===_?.5:1,fontSize:v.typography.fontSize[L.fontSizeKey],minWidth:L.minWidth,transition:v.transitions?.fast??"150ms ease-in-out"},"aria-label":"Next page"},b));const V=(()=>{const e=[],t=Math.floor(N/2);let r=Math.max(1,z-t),a=Math.min(_,z+t);z<=t&&(a=Math.min(N,_)),z>=_-t&&(r=Math.max(1,_-N+1)),i&&r>1&&(e.push(1),r>2&&e.push("ellipsis"));for(let t=r;t<=a;t++)e.push(t);return i&&a<_&&(a<_-1&&e.push("ellipsis"),e.push(_)),e})();return t.createElement("nav",{className:I(C.container,d),style:u,"aria-label":"Pagination"},t.createElement("ul",{className:C.list,style:{listStyle:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,flexWrap:"wrap"},tabIndex:0,onKeyDown:e=>{"ArrowLeft"===e.key?(e.preventDefault(),O(z-1)):"ArrowRight"===e.key?(e.preventDefault(),O(z+1)):"Home"===e.key?(e.preventDefault(),O(1)):"End"===e.key&&(e.preventDefault(),O(_))}},l&&t.createElement("li",null,t.createElement("button",{type:"button",disabled:1===z,onClick:()=>O(z-1),className:I(C.item,1===z&&C.itemDisabled),style:{padding:v.spacing[L.paddingKey],margin:`0 ${v.spacing.small}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:P,color:D,cursor:1===z?"not-allowed":"pointer",opacity:1===z?.5:1,fontSize:v.typography.fontSize[L.fontSizeKey]},"aria-label":"Previous page"},y)),V.map((e,r)=>{if("ellipsis"===e)return t.createElement("li",{key:`ellipsis-${r}`},t.createElement("span",{className:C.ellipsis,style:{padding:v.spacing[L.paddingKey],margin:`0 ${v.spacing.small}`,color:D,fontSize:v.typography.fontSize[L.fontSizeKey]}},"..."));const a=e===z,o=!1;return t.createElement("li",{key:e},c?c(e,a,o):((e,r,a)=>t.createElement("button",{type:"button",disabled:a,onClick:()=>O(e),"aria-current":r?"page":void 0,"aria-label":`Page ${e}`,className:I(C.item,r&&C.itemActive,a),style:{padding:v.spacing[L.paddingKey],margin:R?"0 4px":`0 ${v.spacing.small}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:r?F:P,color:r?B:D,cursor:"pointer",opacity:1,fontSize:v.typography.fontSize[L.fontSizeKey],minWidth:L.minWidth,minHeight:L.minHeight,display:"inline-flex",alignItems:"center",justifyContent:"center",...r&&{fontWeight:"bold"}}},e))(e,a,o))}),l&&t.createElement("li",null,t.createElement("button",{type:"button",disabled:z===_,onClick:()=>O(z+1),className:I(C.item,z===_&&C.itemDisabled),style:{padding:v.spacing[L.paddingKey],margin:`0 ${v.spacing.small}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:P,color:D,cursor:z===_?"not-allowed":"pointer",opacity:z===_?.5:1,fontSize:v.typography.fontSize[L.fontSizeKey]},"aria-label":"Next page"},b)),$&&t.createElement("li",{style:{marginLeft:v.spacing.small}},j)))},e.PinterestDropdown=ma,e.PriceDisplay=or,e.ProductCard=Nr,e.ProductGallery=function({images:e,variant:r="thumbStrip",alt:a="Product",className:o,style:n,carouselAutoplay:s,carouselIntervalMs:i,enableZoom:l,zoomMode:c,zoomLevel:d}){return t.createElement("div",{className:I("seekora-product-gallery",o),style:n},t.createElement(kt,{images:e,variant:r,alt:a,carouselAutoplay:s,carouselIntervalMs:i,enableZoom:l,zoomMode:c,zoomLevel:d}))},e.ProductGrid=zr,e.ProductInfo=function({title:e,description:r,price:a,currency:o="$",comparePrice:n,brand:s,available:i,badges:l,options:c,variants:d,selectedVariant:u,selections:p,onSelectionChange:m,renderVariantSelector:g,renderCTA:f,className:h,style:y}){const b=null!=a?"number"==typeof a?a:parseFloat(String(a)):null,v=null!=n?"number"==typeof n?n:parseFloat(String(n)):null,k=!g&&c&&c.length>0&&d&&p&&m;return t.createElement("div",{className:I("seekora-product-info",h),style:{display:"flex",flexDirection:"column",gap:12,...y}},l&&l.length>0&&t.createElement(dr,{badges:l,position:"inline"}),s&&t.createElement("span",{className:"seekora-product-info-brand",style:{fontSize:"0.8125rem",color:"var(--seekora-text-secondary)",textTransform:"uppercase",letterSpacing:"0.02em"}},s),t.createElement("h1",{className:"seekora-product-info-title",style:{fontSize:"1.25rem",fontWeight:600,margin:0}},e),null!=b&&!Number.isNaN(b)&&t.createElement("div",{className:"seekora-product-info-price"},t.createElement(or,{price:b,comparePrice:v??void 0,currency:o,style:{fontSize:"1.125rem"}})),null!=i&&t.createElement("span",{className:"seekora-product-info-availability",style:{fontSize:"0.875rem",color:i?"var(--seekora-success, #22c55e)":"var(--seekora-error, #ef4444)"}},i?"In Stock":"Out of Stock"),r?t.createElement("p",{className:"seekora-product-info-description",style:{fontSize:"0.875rem",color:"var(--seekora-text-secondary)",margin:0,lineHeight:1.5}},r):null,g?g():null,k&&t.createElement(Wr,{options:c,variants:d,selections:p,onSelectionChange:m,showAvailability:!0}),f?.())},e.ProductRecommendations=function({title:e="You may also like",items:r,onItemClick:a,maxItems:o=6,columns:n=3,className:s,style:i,renderItem:l}){return r?.length?t.createElement("div",{className:I("seekora-product-recommendations",s),style:i},t.createElement("h2",{className:"seekora-product-recommendations-title",style:{fontSize:"1rem",fontWeight:600,marginBottom:12}},e),t.createElement(Lt,{items:r,maxItems:o,columns:n,onItemClick:a,renderItem:l})):null},e.QuerySuggestions=({query:e="",maxSuggestions:r=10,debounceMs:a=300,minQueryLength:o=2,onSuggestionClick:n,renderSuggestion:s,renderEmpty:i,showTitle:l=!1,title:c="Suggestions",className:d,style:u,theme:p})=>{const{client:m,theme:g}=w(),[f,h]=t.useState(-1),{suggestions:y,loading:b,error:v}=C({client:m,query:e,enabled:e.length>=o,debounceMs:a,maxSuggestions:r}),k=y.slice(0,r),x=p||{};if(e.length<o)return null;if(v||!b&&0===k.length)return t.createElement("div",{className:I(x.container,d),style:u},l&&t.createElement("div",{className:x.title,style:{fontSize:g.typography.fontSize.large,fontWeight:"bold",marginBottom:g.spacing.medium,color:g.colors.text}},c),i?i():t.createElement("div",{style:{padding:g.spacing.medium,textAlign:"center",color:g.colors.text,opacity:.6}},"No suggestions available"));const E=s||((e,r)=>t.createElement("div",{key:r},t.createElement("span",null,e.query),void 0!==e.count&&t.createElement("span",{style:{opacity:.6,marginLeft:g.spacing.small}},"(",e.count,")")));return t.createElement("div",{className:I(x.container,d),style:u},l&&t.createElement("div",{className:x.title,style:{fontSize:g.typography.fontSize.large,fontWeight:"bold",marginBottom:g.spacing.medium,color:g.colors.text}},c),t.createElement("div",{className:x.suggestionsList},k.map((e,r)=>{const a=r===f;return t.createElement("div",{key:r,className:I(x.suggestionItem,a&&x.suggestionItemActive),onClick:()=>(e=>{n&&n(e.query)})(e),onMouseEnter:()=>h(r),onMouseLeave:()=>h(-1),style:{padding:g.spacing.medium,cursor:"pointer",borderRadius:"string"==typeof g.borderRadius?g.borderRadius:g.borderRadius.medium,transition:"background-color 0.2s ease",backgroundColor:a?g.colors.hover:"transparent",marginBottom:r<k.length-1?g.spacing.small:0}},E(e,r))})))},e.QuerySuggestionsDropdown=ye,e.RangeInput=({field:e,label:r,min:a,max:o,currentMin:n,currentMax:s,step:i=1,onRangeChange:l,renderRangeInput:c,className:d,style:u,theme:p,showApplyButton:m=!0,placeholder:g={min:"Min",max:"Max"},syncWithState:f=!0})=>{const{theme:h}=w(),{refinements:y,addRefinement:b,removeRefinement:v}=S(),k=p||{},x=f?((e,t)=>{let r,a;return e.forEach(e=>{if(e.field===t){const t=e.value.match(/^>=(\d+(?:\.\d+)?)$/);t&&(r=parseFloat(t[1]));const o=e.value.match(/^<=(\d+(?:\.\d+)?)$/);o&&(a=parseFloat(o[1]))}}),{min:r,max:a}})(y,e):{min:void 0,max:void 0},[E,C]=t.useState(n??x.min),[R,N]=t.useState(s??x.max),[z,T]=t.useState(n??x.min),[M,A]=t.useState(s??x.max);t.useEffect(()=>{f&&(x.min===z&&x.max===M||(C(x.min),N(x.max),T(x.min),A(x.max)))},[f,x.min,x.max]);const _=void 0!==n?n:E,$=void 0!==s?s:R,L=t.useCallback((t,r)=>{f&&(y.forEach(t=>{t.field===e&&v(e,t.value,!1)}),void 0!==t&&b(e,`>=${t}`,!1),void 0!==r?b(e,`<=${r}`,!0):void 0!==t&&b(e,`>=${t}`,!0))},[f,e,y,b,v]),P=t.useCallback(e=>{const t=""===e.target.value?void 0:parseFloat(e.target.value);C(t),m||(L(t,$),l&&l(t,$))},[$,m,l,L]),D=t.useCallback(e=>{const t=""===e.target.value?void 0:parseFloat(e.target.value);N(t),m||(L(_,t),l&&l(_,t))},[_,m,l,L]),F=t.useCallback(()=>{T(E),A(R),L(E,R),l&&l(E,R)},[E,R,l,L]),B=t.useCallback(()=>{C(void 0),N(void 0),T(void 0),A(void 0),f&&y.forEach(t=>{t.field===e&&v(e,t.value,!0)}),l&&l(void 0,void 0)},[f,e,y,v,l]);return c?t.createElement("div",{className:I(k.container,d),style:u},c({min:_,max:$,onMinChange:e=>{C(e),!m&&l&&l(e,$)},onMaxChange:e=>{N(e),!m&&l&&l(_,e)},onApply:F})):t.createElement("div",{className:I(k.container,d),style:u},r&&t.createElement("label",{className:k.label,style:{display:"block",fontSize:h.typography.fontSize.medium,fontWeight:"bold",marginBottom:h.spacing.small,color:h.colors.text}},r),t.createElement("div",{className:k.inputGroup,style:{display:"flex",alignItems:"center",gap:h.spacing.small}},t.createElement("input",{type:"number",min:a,max:o,step:i,value:void 0!==_?_:"",onChange:P,placeholder:g.min,className:I(k.input),style:{flex:1,padding:h.spacing.small,fontSize:h.typography.fontSize.medium,backgroundColor:h.colors.background,color:h.colors.text,border:`1px solid ${h.colors.border}`,borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,outline:"none"}}),t.createElement("span",{className:k.separator,style:{color:h.colors.text,opacity:.7}},"to"),t.createElement("input",{type:"number",min:a,max:o,step:i,value:void 0!==$?$:"",onChange:D,placeholder:g.max,className:I(k.input),style:{flex:1,padding:h.spacing.small,fontSize:h.typography.fontSize.medium,backgroundColor:h.colors.background,color:h.colors.text,border:`1px solid ${h.colors.border}`,borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,outline:"none"}}),m&&t.createElement("button",{type:"button",onClick:F,className:k.button,style:{padding:`${h.spacing.small} ${h.spacing.medium}`,backgroundColor:h.colors.primary,color:"#fff",border:"none",borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:"pointer",fontSize:h.typography.fontSize.small,fontWeight:"500"}},"Apply"),(void 0!==z||void 0!==M||void 0!==_||void 0!==$)&&t.createElement("button",{type:"button",onClick:B,style:{padding:`${h.spacing.small} ${h.spacing.medium}`,backgroundColor:"transparent",color:h.colors.text,border:`1px solid ${h.colors.border}`,borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:"pointer",fontSize:h.typography.fontSize.small}},"Reset")))},e.RangeSlider=Q,e.RatingDisplay=gr,e.RecentSearchesList=_r,e.RecentlyViewed=({storageKey:e="seekora_recently_viewed",items:r,title:a="Recently Viewed",maxItems:o=6,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d="horizontal",currencySymbol:u="$"})=>{const[p,m]=t.useState([]);t.useEffect(()=>{if(!r)try{const t=localStorage.getItem(e);t&&m(JSON.parse(t))}catch(e){}},[e,r]);const g=(r||p).slice(0,o);return 0===g.length?null:t.createElement(te,{title:a,items:g,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d,currencySymbol:u})},e.RelatedProducts=({productId:e,items:r,loading:a=!1,title:o="Related Products",maxItems:n=6,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u="horizontal",currencySymbol:p="$"})=>{const{theme:m}=w(),g=r?.slice(0,n)||[];return a&&0===g.length||0===g.length?null:t.createElement(te,{title:o,items:g,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u,currencySymbol:p})},e.RichQuerySuggestions=Ie,e.SearchBar=({placeholder:e="Powered by Seekora",showSuggestions:r=!0,debounceMs:a=300,minQueryLength:o=2,maxSuggestions:n=10,onSearch:s,onQueryChange:i,onSuggestionSelect:d,onSearchStateChange:u,searchOptions:p,className:m,style:g,theme:f,renderSuggestion:h,renderSearchIcon:y,showClearButton:b=!0,renderClearIcon:v,showSubmitButton:k=!1,renderSubmitButton:x,size:E="medium",searchAsYouType:R=!1})=>{const{client:A,theme:_,enableAnalytics:$,autoTrackSearch:L}=w(),{query:P,setQuery:D,search:F,results:B,loading:W,error:q}=S(),[H,O]=t.useState(!1),[j,V]=t.useState(-1),U=t.useRef(null),K=t.useRef(null),Q=t.useRef(!1),G=t.useRef(null);t.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]);const{suggestions:X,loading:Y}=C({client:A,query:P,enabled:r&&P.length>=o,debounceMs:a,maxSuggestions:n}),Z=X.slice(0,n);t.useEffect(()=>{u&&u({results:B,loading:W,error:q})},[B,W,q,u]),t.useEffect(()=>{B&&s&&s(P,B)},[B,P,s]),t.useEffect(()=>{i&&i(P)},[P,i]);const J=t.useCallback(async e=>{G.current&&(clearTimeout(G.current),G.current=null);const t=e.trim();c("SearchBar: Triggering search",{query:t,originalQuery:e,isEmpty:!t}),Q.current=!0,O(!1),V(-1),D(t,!1),c("SearchBar: Calling search() directly"),await F(),setTimeout(()=>{U.current?.blur(),setTimeout(()=>{Q.current=!1},50)},100)},[D,F]),ee=t.useCallback(e=>{l("SearchBar: Suggestion selected",{suggestion:e}),V(-1),O(!1),U.current?.blur(),d&&d(e),D(e)},[d,D]),te=t.useCallback(e=>{const t=e.target.value;D(t,!1),V(-1),R&&(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{G.current=null,F()},a))},[D,R,a,F]),re=t.useCallback(e=>{switch(e.key){case"ArrowDown":r&&Z.length>0&&(e.preventDefault(),V(e=>e<Z.length-1?e+1:e));break;case"ArrowUp":r&&Z.length>0&&(e.preventDefault(),V(e=>e>0?e-1:-1));break;case"Enter":if(e.preventDefault(),e.stopPropagation(),r&&Z.length>0&&j>=0&&j<Z.length)ee(Z[j].query);else{const e=U.current?.value||P;J(e)}break;case"Escape":O(!1),U.current?.blur()}},[Z,j,P,r,J,ee]),ae=t.useCallback(()=>{O(!0)},[]),oe=t.useCallback(e=>{Q.current||setTimeout(()=>{K.current?.contains(document.activeElement)||(O(!1),V(-1))},200)},[]),ne=(e,r)=>t.createElement("div",{key:r},e),se=f||{},ie=Y||W,le=Z.length>0,ce=H&&r&&P.length>=o&&le,de=B,ue=de?.processingTimeMS||de?.data?.processingTimeMS||de?.data?.data?.processingTimeMS,pe=z[E],me=b&&P.length>0,ge=pe.iconPaddingLeft,fe=me?pe.iconPaddingRight:pe.padding.split(" ")[1]||pe.padding,he="string"==typeof _.borderRadius?_.borderRadius:_.borderRadius.medium,ye=H?`var(--seekora-border-focus, ${_.colors.focus})`:`var(--seekora-border, ${_.colors.border})`,be=H?`0 0 0 3px var(--seekora-border-focus-alpha, ${_.colors.focus}33)`:void 0,ve=t.useCallback(()=>{G.current&&(clearTimeout(G.current),G.current=null),D("",!1),V(-1),U.current?.focus(),R&&F()},[D,R,F]),ke=t.useCallback(()=>{const e=U.current?.value||P;J(e)},[P,J]);return t.createElement("div",{ref:K,className:I(se.container,m),style:{position:"relative",display:"flex",alignItems:"center","--seekora-searchbar-bg":_.colors.background,"--seekora-searchbar-border":_.colors.border,"--seekora-searchbar-focus-border":_.colors.focus,"--seekora-searchbar-radius":he,"--seekora-searchbar-icon-color":_.colors.textSecondary,...g}},t.createElement("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center"}},t.createElement("span",{className:se.searchIcon,"aria-hidden":"true",style:{position:"absolute",left:pe.iconLeft,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"var(--seekora-searchbar-icon-color)",zIndex:2}},y?y():t.createElement(T,{size:pe.iconSize})),t.createElement("input",{ref:U,type:"text",value:P,onChange:te,onKeyDown:re,onFocus:ae,onBlur:oe,placeholder:e,className:I(se.input,H&&se.inputFocused),style:{width:"100%",paddingTop:pe.padding.split(" ")[0],paddingBottom:pe.padding.split(" ")[0],paddingLeft:ge,paddingRight:fe,fontSize:pe.fontSize,fontFamily:_.typography.fontFamily,backgroundColor:"var(--seekora-searchbar-bg)",color:_.colors.text,borderWidth:"1px",borderStyle:"solid",borderColor:ye,borderRadius:"var(--seekora-searchbar-radius)",outline:"none",boxShadow:be,transition:_.transitions?.fast||"150ms ease-in-out",boxSizing:"border-box"}}),me&&t.createElement("button",{type:"button",onClick:ve,className:se.clearButton,"aria-label":"Clear search",style:{position:"absolute",right:pe.iconRight,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:"2px",borderRadius:"50%",color:"var(--seekora-searchbar-icon-color)",transition:_.transitions?.fast||"150ms ease-in-out",zIndex:2},onMouseDown:e=>{e.preventDefault()}},v?v():t.createElement(M,{size:pe.iconSize-4}))),k&&(x?t.createElement("div",{onClick:ke,style:{marginLeft:_.spacing.small,cursor:"pointer"}},x()):t.createElement("button",{type:"button",onClick:ke,className:se.submitButton,style:{marginLeft:_.spacing.small,padding:pe.padding,fontSize:pe.fontSize,fontFamily:_.typography.fontFamily,fontWeight:_.typography.fontWeight?.medium??500,backgroundColor:`var(--seekora-primary, ${_.colors.primary})`,color:"var(--seekora-primary-text, #ffffff)",border:"none",borderRadius:"var(--seekora-searchbar-radius)",cursor:"pointer",whiteSpace:"nowrap",transition:_.transitions?.fast||"150ms ease-in-out"}},"Search")),void 0!==ue&&t.createElement("span",{style:{marginLeft:_.spacing.small,fontSize:_.typography.fontSize.small,color:_.colors.text,opacity:.7,whiteSpace:"nowrap"}},ue,"ms"),ce&&t.createElement("div",{className:se.suggestionsContainer,style:{position:"absolute",top:"100%",left:0,right:0,marginTop:_.spacing.small,backgroundColor:_.colors.background,border:`1px solid ${_.colors.border}`,borderRadius:"string"==typeof _.borderRadius?_.borderRadius:_.borderRadius.medium,boxShadow:_.shadows.medium,maxHeight:"400px",overflowY:"auto",zIndex:N,boxSizing:"border-box"}},Z.length>0&&t.createElement(t.Fragment,null,Z.map((e,r)=>{const a=r===j,o=h||ne;return t.createElement("div",{key:r,className:I(se.suggestionItem,a&&se.suggestionItemActive),onClick:()=>ee(e.query),onMouseEnter:()=>V(r),style:{padding:_.spacing.medium,cursor:"pointer",backgroundColor:a?_.colors.hover:"transparent",color:_.colors.text,transition:_.transitions?.fast||"150ms ease-in-out"}},o(e.query,r))})),!ie&&0===Z.length&&P.length>=o&&t.createElement("div",{style:{padding:_.spacing.medium,textAlign:"center",color:_.colors.textSecondary}},"No suggestions found")))},e.SearchBarWithSuggestions=Ze,e.SearchInput=it,e.SearchLayout=({sidebar:e,children:r,header:a,footer:o,sidebarWidth:n="300px",className:s,style:i,theme:l,showSidebarOnMobile:c=!1})=>{const{theme:d}=w(),u=l||{},p=W(),m=j(parseInt(d.spacing.medium)||16),g=O(parseInt(d.spacing.large)||24);return t.createElement("div",{className:I(u.container,s),style:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%",maxWidth:"100%",backgroundColor:d.colors.background,...i}},a&&t.createElement("header",{className:u.header,style:{padding:m,borderBottom:`1px solid ${d.colors.border}`,backgroundColor:d.colors.background}},a),t.createElement("div",{style:{display:"flex",flex:1,width:"100%",maxWidth:"100%",flexDirection:p?"column":"row",gap:g,padding:m,backgroundColor:d.colors.background,color:d.colors.text,overflow:"visible"}},e&&(!p||c)&&t.createElement("aside",{className:u.sidebar,style:{width:p?"100%":n,minWidth:p?"100%":n,flexShrink:0}},e),t.createElement("main",{className:u.main,style:{flex:1,minWidth:0,width:"100%",maxWidth:"100%",backgroundColor:d.colors.background,color:d.colors.text,overflow:"auto"}},r)),o&&t.createElement("footer",{className:u.footer,style:{padding:m,borderTop:`1px solid ${d.colors.border}`,backgroundColor:d.colors.background}},o))},e.SearchProvider=({client:e,theme:r,enableAnalytics:a=!0,autoTrackSearch:o=!0,stateManager:n,children:s,abTestId:i,abVariant:l,experiments:c})=>{const d=t.useMemo(()=>r?x(r):k,[r]),u=t.useMemo(()=>new f({client:e,autoSearch:!0,debounceMs:300,itemsPerPage:10,defaultSearchOptions:{widget_mode:!0},...n,abTestId:i,abVariant:l}),[e,n,i,l]);t.useEffect(()=>{void 0===i&&void 0===l||(u.setAbTest(i,l),e.setAbTest(i,l))},[u,e,i,l]);const p=t.useMemo(()=>({client:e,theme:d,enableAnalytics:a,autoTrackSearch:o,stateManager:u}),[e,d,a,o,u]);return t.createElement(E.Provider,{value:p},s)},e.SearchResults=({results:e,loading:r,error:a,onResultClick:o,renderResult:n,renderEmpty:s,renderError:i,className:c,style:p,theme:m,itemsPerPage:g=20,showPagination:f=!1,viewMode:h="list",fieldMapping:y,extractResults:b,enableKeyboardNavigation:v=!0,autoFocus:k=!1,minHeight:x="400px",minWidth:E="100%"})=>{const{theme:C,client:R,enableAnalytics:N}=w(),{results:z,loading:T,error:M,currentPage:A,itemsPerPage:_}=S(),$=m||{},[L,P]=t.useState(-1),D=t.useRef(null),F=void 0!==e?e:z,B=void 0!==r?r:T,W=void 0!==a?a:M;t.useEffect(()=>{P(-1)},[F]),t.useEffect(()=>{if(L>=0&&D.current&&v){const e=D.current.querySelector(`[data-result-index="${L}"]`);e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[L,v]),t.useEffect(()=>{if(!v)return;const e=e=>{if(!D.current)return;if(D.current.querySelectorAll("[data-result-index]").length-1<0)return;const t=document.activeElement,r="INPUT"===t?.tagName||"TEXTAREA"===t?.tagName;if("ArrowDown"===e.key)(r||-1===L)&&(e.preventDefault(),P(0),D.current?.focus());else if("ArrowUp"===e.key&&0===L){e.preventDefault(),P(-1);const t=document.querySelector('input[type="text"], input[type="search"]');t?.focus()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v,L]);const q=t.useCallback(e=>{if(!v)return;const t=D.current?.querySelectorAll("[data-result-index]"),r=t?t.length-1:-1;switch(e.key){case"ArrowDown":e.preventDefault(),P(e=>Math.min(e+1,r));break;case"ArrowUp":e.preventDefault(),P(e=>Math.max(e-1,-1));break;case"Enter":if(e.preventDefault(),L>=0){const e=D.current?.querySelector(`[data-result-index="${L}"]`);e&&e.click()}break;case"Escape":P(-1),D.current?.blur();break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),P(r)}},[v,L]),H="card"===h||"grid"===h?(r,a,n=!1)=>{const s=r.primaryText||r.title,i=r.secondaryText||r.description,l=r.tertiaryText||r.price,c=r.imageUrl||r.image;return t.createElement("div",{key:r.id||a,"data-result-index":a,className:I($.resultItem,n&&$.resultItemHover),onClick:async()=>{if(N&&r.id)try{const t=e||z,o={currentPage:A,itemsPerPage:_},n=(o.currentPage-1)*o.itemsPerPage+a+1,s=t?.context;R.trackClick?await R.trackClick(r.id,n,s):await(R.trackEvent?.({event_name:"product_click",clicked_item_id:r.id,metadata:{result:r,position:n}},s))}catch(e){const t=e instanceof Error?e:new Error(String(e));u("SearchResults: Error tracking click",{resultId:r.id,error:t.message})}o&&o(r,a)},onMouseEnter:()=>v&&P(a),style:{border:`1px solid ${n?C.colors.primary:C.colors.border}`,borderRadius:"string"==typeof C.borderRadius?C.borderRadius:C.borderRadius.medium,overflow:"hidden",cursor:o?"pointer":"default",transition:C.transitions?.normal||"250ms ease-in-out",backgroundColor:n?C.colors.hover:C.colors.background,display:"flex",flexDirection:"column",padding:C.spacing.medium,boxShadow:n?C.shadows.medium:C.shadows.small,outline:n?`2px solid ${C.colors.primary}`:"none",outlineOffset:"-2px"}},c&&t.createElement("div",{style:{width:"100%",aspectRatio:"16/9",overflow:"hidden",backgroundColor:C.colors.hover}},t.createElement("img",{src:c,alt:s,style:{width:"100%",height:"100%",objectFit:"cover"}})),t.createElement("div",{style:{padding:C.spacing.medium}},s&&t.createElement("h3",{className:$.resultTitle,style:{fontSize:C.typography.fontSize.large,fontWeight:"bold",margin:0,marginBottom:C.spacing.small,color:C.colors.text}},s),i&&t.createElement("p",{className:$.resultDescription,style:{fontSize:C.typography.fontSize.medium,color:C.colors.text,margin:0,marginBottom:C.spacing.small,opacity:.8,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"}},i),l&&t.createElement("div",{className:$.resultPrice,style:{fontSize:C.typography.fontSize.medium,fontWeight:"bold",color:C.colors.primary,marginTop:"auto"}},l)))}:(r,a,n=!1)=>t.createElement("div",{key:r.id||a,"data-result-index":a,className:I($.resultItem,n&&$.resultItemHover),onClick:async()=>{if(N&&r.id)try{const t=e||z,o={currentPage:A,itemsPerPage:_},n=(o.currentPage-1)*o.itemsPerPage+a+1,s=t?.context;R.trackClick?await R.trackClick(r.id,n,s):await(R.trackEvent?.({event_name:"product_click",clicked_item_id:r.id,metadata:{result:r,position:n}},s))}catch(e){const t=e instanceof Error?e:new Error(String(e));u("SearchResults: Error tracking click",{resultId:r.id,error:t.message})}o&&o(r,a)},onMouseEnter:()=>v&&P(a),style:{padding:C.spacing.medium,border:`1px solid ${C.colors.border}`,borderBottom:`1px solid ${C.colors.border}`,borderRadius:0,marginBottom:0,cursor:o?"pointer":"default",transition:C.transitions?.normal||"250ms ease-in-out",backgroundColor:n?C.colors.hover:C.colors.background,display:"flex",alignItems:"flex-start",gap:C.spacing.medium,outline:n?`2px solid ${C.colors.primary}`:"none",outlineOffset:"-2px"}},r.image&&t.createElement("img",{src:r.image,alt:r.title,className:$.resultImage,style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"string"==typeof C.borderRadius?C.borderRadius:C.borderRadius.medium,flexShrink:0}}),t.createElement("div",{style:{flex:1,minWidth:0}},t.createElement("h3",{className:$.resultTitle,style:{fontSize:C.typography.fontSize.large,fontWeight:"bold",margin:0,marginBottom:C.spacing.small,color:C.colors.text}},r.title),r.description&&t.createElement("p",{className:$.resultDescription,style:{fontSize:C.typography.fontSize.medium,color:C.colors.text,margin:0,marginBottom:C.spacing.small,opacity:.8}},r.description),r.price&&t.createElement("div",{className:$.resultPrice,style:{fontSize:C.typography.fontSize.medium,fontWeight:"bold",color:C.colors.primary}},r.price)));let O=[];if(b)O=b(F)||[];else if(F){const e=F;Array.isArray(e.results)&&e.results.length>0?O=e.results:e.data&&Array.isArray(e.data.results)&&e.data.results.length>0?O=e.data.results:e.data?.data&&Array.isArray(e.data.data.results)&&e.data.data.results.length>0?O=e.data.data.results:Array.isArray(F)?O=F:Array.isArray(e.results)&&(O=e.results)}const j={title:"document.productName",description:"document.brandDesc",image:"document.image",price:"document.mrp",url:"document.url",id:"id",...y},V=(e,t)=>{if(t)return((e,t)=>{if(t)return t.split(".").reduce((e,t)=>e?.[t],e)})(e,t)},U=O.map((e,t)=>{try{const r=V(e,j.primaryText),a=V(e,j.secondaryText),o=V(e,j.tertiaryText),n=V(e,j.imageUrl),s=V(e,j.title)||r||"Untitled",i=V(e,j.description)||a,l=V(e,j.image)||n,c=V(e,j.price)||o,d=V(e,j.url),u=V(e,j.id)||String(t),p=void 0!==c?((e,t="₹")=>{if(null!=e){if("number"==typeof e)return`${t}${e}`;if("string"==typeof e){const r=parseFloat(e);return isNaN(r)?e:`${t}${r}`}return String(e)}})(c):void 0,m={};j.custom&&Object.entries(j.custom).forEach(([t,r])=>{m[t]=V(e,r)});return{id:u,title:s,description:i,url:d,image:l,price:p,metadata:e,...m,...r&&{primaryText:r},...a&&{secondaryText:a},...o&&{tertiaryText:o},...n&&{imageUrl:n},_raw:e}}catch(r){const a=r instanceof Error?r:new Error(String(r));return d("SearchResults: Error extracting result item",{index:t,error:a.message,item:e?.id||"unknown"}),{id:String(t),title:"Error loading result",metadata:e}}}),K={minHeight:`var(--seekora-results-min-height, ${x})`,minWidth:`var(--seekora-results-min-width, ${E})`,...p},Q={..."grid"===h&&{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:C.spacing.medium},..."card"===h&&{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:C.spacing.medium}};if(l("SearchResults: Extracted results",{rawResultsCount:O.length,resultItemsCount:U.length,viewMode:h,hasError:!!W,isLoading:B}),W)return u("SearchResults: Rendering error state",{error:W.message,stack:W.stack}),t.createElement("div",{className:I($.container,c),style:K},i?i(W):(G=W,t.createElement("div",{className:$.errorState,style:{padding:C.spacing.large,textAlign:"center",color:C.colors.error}},"Error: ",G.message)));var G;if(!F||0===U.length)return l("SearchResults: No results to display"),t.createElement("div",{className:I($.container,c),style:K},s?s():t.createElement("div",{className:$.emptyState,style:{padding:C.spacing.large,textAlign:"center",color:C.colors.text}},"No results found"));const X=n||H;return t.createElement("div",{ref:D,className:I($.container,c),style:K,tabIndex:v?0:void 0,onKeyDown:q,role:"listbox","aria-label":"Search results","aria-activedescendant":L>=0?`result-${L}`:void 0},(void 0!==F?.totalResults||void 0!==F?.data?.total_results)&&U.length>0&&t.createElement("div",{className:$.header,style:{marginBottom:C.spacing.medium,fontSize:C.typography.fontSize.medium,color:C.colors.text}},"Found ",F?.totalResults||F?.data?.total_results||0," result",1!==(F?.totalResults||F?.data?.total_results||0)?"s":""),t.createElement("div",{className:$.resultsList,style:Q},U.map((e,t)=>X(e,t,t===L))))},e.SectionError=jr,e.SectionItemGrid=function({columns:e=4,maxItems:r=12,className:a,style:o,getItemId:n=e=>e.id??String(e?.objectID??""),getItemTitle:s=e=>e.title??e?.title??"",getItemImage:i=e=>e.image??e?.image,getItemDescription:l=e=>e.description??e?.description,getItemUrl:c=e=>e.url??e?.url,renderItem:d}){const{items:u,loading:p,error:m,trackClick:g}=Or();return m?t.createElement(jr,{className:a,style:o}):t.createElement(Lt,{items:u,maxItems:r,columns:e,className:a,style:o,getItemId:n,getItemTitle:s,getItemImage:i,getItemDescription:l,getItemUrl:c,renderItem:d,onItemClick:(e,t)=>g(e,t)})},e.SectionSearchProvider=function({children:e,query:r,refinements:a=[],maxItems:o=12,sortBy:n,enabled:s=!0,sectionId:i,searchOptions:l}){const{client:c}=w(),[d,u]=t.useState([]),[p,m]=t.useState(!0),[g,f]=t.useState(null),[h,y]=t.useState(0);t.useEffect(()=>{if(!s||!c?.search)return u([]),m(!1),f(null),void y(0);let e=!1;m(!0),f(null);const t={...l,per_page:o,page:1};return n&&(t.sort_by=n),a.length>0&&(t.filter_by=a.map(e=>`${e.field}:${e.value}`).join(",")),c.search(r,t).then(t=>{e||(u(function(e){if(!e)return[];if(Array.isArray(e.results))return e.results;if(Array.isArray(e.hits))return e.hits;const t=e.data;return t&&Array.isArray(t.results)?t.results:t&&Array.isArray(t.data)?t.data:[]}(t)),y(function(e){if(!e)return 0;const t=e.totalResults??e.total??e.total_results;if("number"==typeof t)return t;const r=e.data;return null!=r?.total_results?Number(r.total_results):null!=r?.data?.total_results?Number(r.data.total_results):0}(t)),m(!1))}).catch(t=>{e||(f(t instanceof Error?t:new Error(String(t))),u([]),m(!1))}),()=>{e=!0}},[c,s,r,o,n,a,l]);const b=t.useCallback((e,t)=>{if(!c?.trackEvent)return;const r=e?.id??e?.objectID;c.trackEvent({event_name:"section_result_click",clicked_item_id:r,position:t,section:i,metadata:{section_id:i}},void 0)},[c,i]),v=t.useMemo(()=>({items:d,loading:p,error:g,totalCount:h,sectionId:i,trackClick:b}),[d,p,g,h,i,b]);return t.createElement(Hr.Provider,{value:v},e)},e.ShopifyDropdown=xa,e.Snippet=({hit:e,attribute:r,maxLength:a=100,ellipsis:o="...",className:n,style:s,theme:i,tagName:l="span",renderHighlighted:c,renderNonHighlighted:d,query:u})=>{const{theme:f}=w(),h=i||{},y=t.useMemo(()=>{const t=e._snippetResult?.[r]?.value||e.snippet_result?.[r]?.value||e._snippet?.[r]||e.snippet?.[r];if(t)return t.replace(/<em>/g,"<mark>").replace(/<\/em>/g,"</mark>");let n=p({hit:e,attribute:r,preTag:"<mark>",postTag:"</mark>"});if(n.replace(/<\/?mark>/g,"").length>a){const e=function(e,t){let r=0,a="",o=!1;for(let n=0;n<e.length;n++){const s=e[n];if("<"===s)o=!0,a+=s;else if(">"===s)o=!1,a+=s;else if(o)a+=s;else{if(r>=t)break;a+=s,r++}}const n=a.match(/<mark>/g)?.length||0,s=a.match(/<\/mark>/g)?.length||0;for(let e=0;e<n-s;e++)a+="</mark>";return a}(n,a);return e+o}return n},[e,r,a,o]),b=t.useMemo(()=>{const t=m(y,"<mark>","</mark>");if(t.every(e=>!e.isHighlighted)&&u){const t=e[r]||y;let n=String(t);return n.length>a&&(n=n.substring(0,a)+o),g(n,u)}return t},[y,u,e,r,a,o]),v={backgroundColor:f.colors.warning||"#fff59d",fontWeight:f.typography.fontWeight?.semibold||600,padding:"0 2px",borderRadius:"2px"},k=b.map((e,r)=>e.isHighlighted?c?t.createElement(t.Fragment,{key:r},c(e,r)):t.createElement("mark",{key:r,className:h.highlighted,style:v},e.value):d?t.createElement(t.Fragment,{key:r},d(e,r)):t.createElement("span",{key:r,className:h.nonHighlighted},e.value));return t.createElement(l,{className:n||h.root,style:s},k)},e.SortBy=({options:e,value:r,defaultValue:a,onSortChange:o,renderSelect:n,className:s,style:i,theme:l,placeholder:c="Sort by...",syncWithState:d=!0,variant:u="dropdown",label:p,showLabel:m,size:g="medium"})=>{const{theme:f}=w(),{sortBy:h,setSortBy:y}=S(),b=l||{},v=t.useId(),k=void 0!==m?m:!!p,[x,E]=t.useState(a||e[0]?.value||"");t.useEffect(()=>{d&&a&&!h&&y(a,!1)},[]);const C=void 0!==r?r:d&&h?h:x,R=e=>{N(e.target.value)},N=t.useCallback(e=>{E(e),d&&y(e),o&&o(e)},[d,y,o]),{fontSize:z,padding:T}=function(e,t){switch(e){case"small":return{fontSize:t.typography.fontSize.small,padding:t.spacing.small};case"large":return{fontSize:t.typography.fontSize.large,padding:t.spacing.medium};default:return{fontSize:t.typography.fontSize.medium,padding:t.spacing.small}}}(g,f),M="string"==typeof(A=f.borderRadius)?A:A.medium;var A;const _={"--seekora-sort-bg":f.colors.background,"--seekora-sort-color":f.colors.text,"--seekora-sort-border":f.colors.border,"--seekora-sort-active-bg":f.colors.primary,"--seekora-sort-active-color":f.colors.background},$=k&&p?t.createElement("span",{className:I(b.label),style:{display:"block",marginBottom:f.spacing.small,fontSize:z,color:"var(--seekora-sort-color)",fontWeight:500}},p):null;if("dropdown"===u)return n?t.createElement("div",{className:I(b.container,s),style:{..._,...i}},$,n({value:C,onChange:R,options:e})):t.createElement("div",{className:I(b.container,s),style:{..._,...i}},$,t.createElement(V,{value:C,onChange:N,options:e,placeholder:c,"aria-label":p||"Sort results",className:I(b.select),style:{width:"100%","--seekora-select-font-size":z,"--seekora-select-border":"var(--seekora-sort-border)","--seekora-select-radius":M,"--seekora-select-bg":"var(--seekora-sort-bg)","--seekora-select-color":"var(--seekora-sort-color)"}}));if("button-group"===u)return t.createElement("div",{className:I(b.container,s),style:{..._,...i}},$,t.createElement("div",{role:"group","aria-label":p||"Sort results",className:I(b.buttonGroup),style:{display:"inline-flex",borderRadius:M,overflow:"hidden",border:"1px solid var(--seekora-sort-border)"}},e.map((r,a)=>{const o=r.value===C;return t.createElement("button",{key:r.value,type:"button",role:"button","aria-pressed":o,onClick:()=>N(r.value),className:I(b.buttonGroupItem,o&&b.buttonGroupItemActive),style:{padding:T,fontSize:z,border:"none",borderRight:a<e.length-1?"1px solid var(--seekora-sort-border)":"none",backgroundColor:o?"var(--seekora-sort-active-bg)":"var(--seekora-sort-bg)",color:o?"var(--seekora-sort-active-color)":"var(--seekora-sort-color)",cursor:"pointer",fontWeight:o?600:400,transition:"background-color 0.15s ease, color 0.15s ease",outline:"none"}},r.label)})));if("radio-group"===u){const r=`seekora-sort-${v}`;return t.createElement("div",{className:I(b.container,s),style:{..._,...i}},$,t.createElement("div",{role:"radiogroup","aria-label":p||"Sort results",className:I(b.radioGroup),style:{display:"flex",flexDirection:"column",gap:f.spacing.small}},e.map(e=>{const a=e.value===C,o=`${r}-${e.value}`;return t.createElement("label",{key:e.value,htmlFor:o,className:I(b.radioItem,a&&b.radioItemActive),style:{display:"flex",alignItems:"center",gap:f.spacing.small,padding:T,borderRadius:M,cursor:"pointer",backgroundColor:a?"var(--seekora-sort-active-bg)":"transparent",color:a?"var(--seekora-sort-active-color)":"var(--seekora-sort-color)",fontWeight:a?600:400,transition:"background-color 0.15s ease, color 0.15s ease"}},t.createElement("input",{type:"radio",id:o,name:r,value:e.value,checked:a,onChange:()=>N(e.value),style:{margin:0}}),t.createElement("span",{className:I(b.radioLabel),style:{fontSize:z}},e.label))})))}return null},e.SpotlightDropdown=ba,e.Stats=({results:e,renderStats:r,className:a,style:o,theme:n,showProcessingTime:s=!1,showQuery:i=!1,separator:l=" • ",variant:c="inline",showResultCount:d=!0,formatNumber:u})=>{const{theme:p}=w(),{results:m}=S(),g=n||{},f=e||m;t.useEffect(()=>{!function(){if("undefined"==typeof document)return;if(document.getElementById(_))return;const e=document.createElement("style");e.id=_,e.textContent=`\n .seekora-stats-root {\n --seekora-stats-color: inherit;\n --seekora-stats-bg: transparent;\n --seekora-stats-font-size: inherit;\n --seekora-stats-badge-bg: inherit;\n --seekora-stats-badge-color: inherit;\n }\n .${A} {\n opacity: 0;\n transition: opacity 250ms ease-in-out;\n }\n `,document.head.appendChild(e)}()},[]);const h=f,y=h?.totalResults||h?.data?.total_results||h?.data?.data?.total_results||0,b=h?.processingTimeMS||h?.data?.processingTimeMS||h?.data?.data?.processingTimeMS,v=h?.query??"",k=u||(e=>e.toLocaleString()),x=t.useRef(null),E=t.useRef(y),[C,R]=t.useState(!1);t.useEffect(()=>{if(E.current!==y){E.current=y,R(!0);const e=requestAnimationFrame(()=>{R(!1)});return()=>cancelAnimationFrame(e)}},[y]);const N="string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.small;if(r)return t.createElement("div",{className:I("seekora-stats-root",g.container,a),style:o},r({totalResults:y,processingTime:b,query:v}));if("inline"===c){const e=[];return d&&(y>0?e.push(t.createElement("span",{key:"count",className:g.text},t.createElement("span",{ref:x,className:I(C&&A),style:{transition:"opacity 250ms ease-in-out"}},k(y))," result"+(1!==y?"s":""))):e.push(t.createElement("span",{key:"count",className:g.text},"No results"))),s&&void 0!==b&&e.push(t.createElement("span",{key:"time",className:g.text},k(b),"ms")),i&&v&&e.push(t.createElement("span",{key:"query",className:g.text},'for "',v,'"')),t.createElement("div",{className:I("seekora-stats-root",g.container,a),style:{fontSize:"var(--seekora-stats-font-size,"+p.typography.fontSize.medium+")",color:"var(--seekora-stats-color,"+p.colors.text+")",backgroundColor:"var(--seekora-stats-bg, transparent)",...o}},e.map((e,r)=>t.createElement("span",{key:r},r>0&&t.createElement("span",{className:g.separator,style:{margin:`0 ${p.spacing.small}`}},l),e)))}if("badge"===c){const e=[],r={display:"inline-flex",alignItems:"center",gap:p.spacing.small,padding:`${p.spacing.small} ${p.spacing.medium}`,borderRadius:N,backgroundColor:`var(--seekora-stats-badge-bg, ${p.colors.primary}1A)`,color:`var(--seekora-stats-badge-color, ${p.colors.primary})`,fontSize:p.typography.fontSize.small,fontWeight:500};return d&&e.push(t.createElement("span",{key:"count",className:I(g.badge),style:r},t.createElement("span",{className:g.badgeLabel},"Results"),t.createElement("span",{className:I(g.badgeValue,C&&A),style:{fontWeight:600,transition:"opacity 250ms ease-in-out"}},y>0?k(y):"0"))),i&&v&&e.push(t.createElement("span",{key:"query",className:I(g.badge),style:r},t.createElement("span",{className:g.badgeLabel},"Query"),t.createElement("span",{className:g.badgeValue,style:{fontWeight:600}},v))),s&&void 0!==b&&e.push(t.createElement("span",{key:"time",className:I(g.badge),style:r},t.createElement("span",{className:g.badgeLabel},"Time"),t.createElement("span",{className:g.badgeValue,style:{fontWeight:600}},k(b),"ms"))),t.createElement("div",{className:I("seekora-stats-root",g.container,a),style:{display:"flex",flexWrap:"wrap",gap:p.spacing.small,fontSize:"var(--seekora-stats-font-size,"+p.typography.fontSize.small+")",color:"var(--seekora-stats-color,"+p.colors.text+")",backgroundColor:"var(--seekora-stats-bg, transparent)",...o}},e)}if("detailed"===c){const e=[];return d&&e.push({label:"Total Results",value:t.createElement("span",{className:I(C&&A),style:{transition:"opacity 250ms ease-in-out"}},k(y))}),i&&v&&e.push({label:"Query",value:v}),s&&void 0!==b&&e.push({label:"Time",value:`${k(b)}ms`}),t.createElement("div",{className:I("seekora-stats-root",g.detailed,g.container,a),style:{display:"flex",flexDirection:"column",gap:p.spacing.small,fontSize:"var(--seekora-stats-font-size,"+p.typography.fontSize.medium+")",color:"var(--seekora-stats-color,"+p.colors.text+")",backgroundColor:"var(--seekora-stats-bg, transparent)",...o}},e.map((e,r)=>t.createElement("div",{key:r,className:g.detailedRow,style:{display:"flex",alignItems:"center",gap:p.spacing.small}},t.createElement("span",{className:g.detailedLabel,style:{color:p.colors.textSecondary,fontWeight:500}},e.label,":"),t.createElement("span",{className:g.detailedValue,style:{color:p.colors.text,fontWeight:600}},e.value))))}return null},e.SuggestionDropdownVariants=Aa,e.SuggestionItem=ft,e.SuggestionList=yt,e.SuggestionSearchBar=Ma,e.SuggestionsDropdownComposition=function({showRecentSearches:e=!0,showTrending:r=!0,showTabs:a=!0,showProducts:o=!0,placeholder:n,...s}){return t.createElement(tt,{...s},t.createElement("div",{className:"seekora-suggestions-dropdown-composition",style:{position:"relative",width:"100%"}},t.createElement(it,{placeholder:n}),t.createElement(ut,null,t.createElement(Dr,null),e?t.createElement(_r,null):null,t.createElement(yt,null),a?t.createElement(Tr,null):null,o?t.createElement(zr,null):null,r?t.createElement(Pr,null):null)))},e.SuggestionsError=Dr,e.SuggestionsProvider=tt,e.TrendingItems=({items:e,loading:r=!1,title:a="Trending Now",maxItems:o=8,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d="horizontal",currencySymbol:u="$"})=>{const{theme:p}=w(),m=e?.slice(0,o)||[];return r&&0===m.length||0===m.length?null:t.createElement(te,{title:a,items:m,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d,currencySymbol:u})},e.TrendingList=Pr,e.VariantSelector=Wr,e.VariantSwatches=hr,e.addRecentSearch=Zt,e.addToRecentlyViewed=function(e,t="seekora_recently_viewed",r=20){if("undefined"!=typeof localStorage)try{const a=localStorage.getItem(t);let o=a?JSON.parse(a):[];o=o.filter(t=>t.id!==e.id),o.unshift(e),o=o.slice(0,r),localStorage.setItem(t,JSON.stringify(o))}catch(e){}},e.brandPresets=so,e.breakpoints=Vr,e.clearRecentSearches=e=>{try{const t=e?`${Xt}_${e}`:Xt;localStorage.removeItem(t)}catch{}},e.clearSuggestionsCache=()=>{rr?.clear()},e.createSuggestionsCache=e=>new tr(e),e.createSuggestionsTheme=function(e="light",t={},r){return{...{light:ao,dark:oo,minimal:no}[e],...r?so[r]:{},...t}},e.createTheme=x,e.darkTheme={colors:{primary:"#0d6efd",secondary:"#6c757d",background:"#1a1a1a",text:"#ffffff",border:"#333333",hover:"#2a2a2a",focus:"#0d6efd",error:"#dc3545"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:{small:"0.875rem",medium:"1rem",large:"1.25rem"}},spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},borderRadius:"0.25rem",shadows:{small:"0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.7)",medium:"0 3px 6px rgba(0, 0, 0, 0.6), 0 3px 6px rgba(0, 0, 0, 0.8)",large:"0 10px 20px rgba(0, 0, 0, 0.7), 0 6px 6px rgba(0, 0, 0, 0.9)"}},e.darkThemeVariables=oo,e.defaultTheme=k,e.extractBadges=Ot,e.extractBrand=(e,t={name:"name"})=>({id:t.id?Pt(e,t.id):e?.id,name:Pt(e,t.name)??"",logo:t.logo?Pt(e,t.logo):void 0,count:t.count?Pt(e,t.count):void 0,_raw:e}),e.extractCategory=Bt,e.extractProduct=Ft,e.extractSuggestion=Dt,e.findVariantBySelections=Ut,e.formatParsedFilters=function(e){return e.map(e=>`${e.field}: ${e.value}`).join(", ")},e.formatPriceRange=(e,t={})=>`${Wt(e.min,t)} - ${Wt(e.max,t)}`,e.formatSuggestionPrice=Wt,e.generateSuggestionsStylesheet=io,e.getAvailableValuesForOption=Vt,e.getFingerprint=async function(e){return new v(e).get()},e.getPriceRange=jt,e.getRecentSearches=Yt,e.getShortcutText=Ga,e.getSuggestionsCache=ar,e.highlightText=(e,t,r={})=>{if(!t||!e)return qt(e);const{tag:a="mark",className:o="",style:n}=r,s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=n?` style="${Object.entries(n).map(([e,t])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}:${t}`).join(";")}"`:"",l=o?` class="${o}"`:"";return qt(e).replace(new RegExp(`(${qt(s)})`,"gi"),`<${a}${l}${i}>$1</${a}>`)},e.injectGlobalResponsiveStyles=Xr,e.injectSuggestionsStyles=co,e.lightThemeVariables=ao,e.mediaQueries=Ur,e.mergeThemes=(e,...t)=>t.reduce((e,t)=>({colors:{...e.colors,...t.colors},typography:{...e.typography,...t.typography,fontSize:{...e.typography?.fontSize,...t.typography?.fontSize}},spacing:{...e.spacing,...t.spacing},borderRadius:t.borderRadius??e.borderRadius,shadows:{...e.shadows,...t.shadows},transitions:{...e.transitions,...t.transitions},breakpoints:{...e.breakpoints,...t.breakpoints},zIndex:{...e.zIndex,...t.zIndex}}),e),e.minimalTheme={colors:{primary:"#000000",secondary:"#666666",background:"#ffffff",text:"#000000",border:"#e0e0e0",hover:"#f5f5f5",focus:"#000000",error:"#cc0000"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:{small:"0.875rem",medium:"1rem",large:"1.125rem"}},spacing:{small:"0.5rem",medium:"0.75rem",large:"1rem"},borderRadius:"0",shadows:{small:"none",medium:"none",large:"none"}},e.minimalThemeVariables=no,e.parseHighlightMarkup=mt,e.removeRecentSearch=Jt,e.touchTargets=Kr,e.updateSuggestionsStyles=function(e){co(e,!0)},e.useAnalytics=({client:e,enabled:r=!0})=>{const a=t.useCallback(async(t,a,o)=>{if(r)try{const r={event_name:t,...a};await(e.trackEvent?.(r,o))}catch(e){u("Failed to track event:",e)}},[e,r]),o=t.useCallback(async(t,o,n,s)=>{if(!r)return;const i=s??0;e.trackClick?await e.trackClick(t,i,n):await a("product_click",{clicked_item_id:t,metadata:{result:o,...void 0!==s&&{position:i}}},n)},[e,a,r]),n=t.useCallback(async(e,t,o,n,s)=>{r&&await a("conversion",{clicked_item_id:e,value:o,currency:n,metadata:{result:t}},s)},[a,r]),s=t.useCallback(async(t,a)=>{if(r&&0!==t.length)try{await(e.trackEvents?.(t,a))}catch(e){u("Failed to track batch events:",e)}},[e,r]);return{trackEvent:a,trackClick:o,trackConversion:n,trackBatch:s}},e.useAnalyticsProvider=()=>t.useContext(qr),e.useDocSearch=Ja,e.useDocSearchSeekoraSearch=eo,e.useFilters=U,e.useInjectResponsiveStyles=Yr,e.useKeyboard=Qa,e.useNaturalLanguageFilters=function(e={}){const{fieldMappings:r={},valueMappings:a={},autoApply:o=!1,currencySymbol:n="$"}=e,{addRefinement:s,removeRefinement:i,clearRefinements:l,setQuery:c}=S(),d=t.useMemo(()=>({...ro,colors:[...ro.colors,...a.color?Object.keys(a.color):[]],sizes:{...ro.sizes,...a.size||{}}}),[a]),u=t.useCallback(e=>{const t=[];let o=e;for(const a of d.price){const n=e.match(a.pattern);if(n){"range"===a.operator&&n[2]?(t.push({field:r.price||"price",value:`>=${n[1]}`,operator:">=",confidence:.95,matchedText:n[0]}),t.push({field:r.price||"price",value:`<=${n[2]}`,operator:"<=",confidence:.95,matchedText:n[0]})):n[1]&&t.push({field:r.price||"price",value:`${a.operator}${n[1]}`,operator:a.operator,confidence:.95,matchedText:n[0]}),o=o.replace(n[0]," ");break}}const n=new RegExp(`\\b(${d.colors.join("|")})\\b`,"gi"),s=e.match(n);s&&s.forEach(e=>{const n=a.color?.[e.toLowerCase()]||e.toLowerCase();t.push({field:r.color||"color",value:n,operator:"=",confidence:.9,matchedText:e}),o=o.replace(new RegExp(`\\b${e}\\b`,"gi")," ")});const i=Object.entries(d.sizes);for(const[a,n]of i){const s=new RegExp(`\\b${a}\\b`,"gi");if(s.test(e)){t.push({field:r.size||"size",value:n,operator:"=",confidence:.85,matchedText:a}),o=o.replace(s," ");break}}for(const a of d.ratings)if("value"in a)a.pattern.test(e)&&(t.push({field:r.rating||a.field,value:`${a.operator}${a.value}`,operator:a.operator,confidence:.8,matchedText:e.match(a.pattern)?.[0]||""}),o=o.replace(a.pattern," "));else{const n=e.match(a.pattern);n&&n[1]&&(t.push({field:r.rating||a.field,value:`${a.operator}${n[1]}`,operator:a.operator,confidence:.85,matchedText:n[0]}),o=o.replace(n[0]," "))}for(const a of d.availability)a.pattern.test(e)&&(t.push({field:r[a.field]||a.field,value:a.value,operator:"=",confidence:.9,matchedText:e.match(a.pattern)?.[0]||""}),o=o.replace(a.pattern," "));return o=o.replace(/\s+/g," ").trim(),{cleanedQuery:o,filters:t,originalQuery:e,hasFilters:t.length>0}},[d,r,a]),p=t.useCallback(e=>{e.forEach(e=>{s(e.field,e.value,!1)}),e.length},[s]),m=t.useCallback(e=>{const t=u(e);return t.hasFilters&&(p(t.filters),t.cleanedQuery!==e&&c(t.cleanedQuery,!0)),t},[u,p,c]);return{parse:u,applyFilters:p,parseAndApply:m}},e.useProductAnalytics=function({client:e,product:r,position:a=0,section:o,tabId:n,query:s,context:i,enabled:c=!0}){const u=t.useRef(!1),p=t.useRef(null),m=t.useRef(null),g=r.id||r.objectID||"",f=t.useCallback(async(t,u)=>{if(c&&e)try{await(e.trackEvent?.({event_name:t,metadata:{product_id:g,product_title:r.title||r.name,product_price:r.price,position:a,section:o,tab_id:n,original_query:s,timestamp:Date.now(),source:"product_analytics",...u}},i)),l(`ProductAnalytics: ${t}`,u)}catch(e){d(`Failed to track ${t}`,{error:e})}},[e,c,g,r,a,o,n,s,i]),h=t.useCallback(()=>{f("product.click",{}),e?.trackClick&&Promise.resolve(e.trackClick(g,a+1,i)).catch(()=>{})},[f,e,g,a,i]),y=t.useCallback((e,t)=>{f("product.variant_select",{option_name:e,option_value:t})},[f]),b=t.useCallback(e=>{f("product.add_to_cart",{variant_id:e?.id,variant_sku:e?.sku,variant_title:e?.title,variant_price:e?.price})},[f]),v=t.useCallback((e,t)=>{f(e,t??{})},[f]),k=t.useCallback(e=>{p.current&&(p.current.disconnect(),p.current=null),m.current=e,e&&c&&!u.current&&"undefined"!=typeof IntersectionObserver&&(p.current=new IntersectionObserver(e=>{for(const t of e)t.isIntersecting&&!u.current&&(u.current=!0,f("product.impression",{}),p.current?.disconnect())},{threshold:.5}),p.current.observe(e))},[c,f]);return t.useEffect(()=>()=>{p.current?.disconnect()},[]),{clickProps:{onClick:()=>h(),"data-seekora-product-id":g,"data-seekora-position":a},variantSelectProps:(e,t)=>({onClick:()=>y(e,t),"data-seekora-variant-option":e,"data-seekora-variant-value":t}),addToCartProps:e=>({onClick:()=>b(e),"data-seekora-action":"add-to-cart"}),impressionRef:k,trackClick:h,trackVariantSelect:y,trackAddToCart:b,trackCustomEvent:v}},e.useQuerySuggestions=C,e.useQuerySuggestionsEnhanced=de,e.useResponsive=Qr,e.useSearchContext=w,e.useSearchState=S,e.useSectionSearchContext=Or,e.useSeekoraSearch=({client:e,autoTrack:r=!0})=>{const[a,o]=t.useState(null),[n,s]=t.useState(!1),[i,d]=t.useState(null),[p,m]=t.useState(null),g=t.useCallback(async t=>{s(!0),d(null);const r=t.q||"";l("useSeekoraSearch: Starting search",{query:r,options:t});try{const{q:r,...a}=t,n="string"==typeof r?r:"",s=await e.search(n,a);return c("useSeekoraSearch: Search completed",{query:n,resultsCount:Array.isArray(s?.results)?s.results.length:0,hasContext:!!s?.context}),o(s),null!=s.context&&m(s.context),s}catch(e){const t=e instanceof Error?e:new Error(String(e));return u("useSeekoraSearch: Search failed",{query:r,error:t.message,stack:t.stack}),d(t),o(null),m(null),null}finally{s(!1)}},[e]);return{search:g,results:a,loading:n,error:i,context:p,clearResults:t.useCallback(()=>{o(null),d(null),m(null)},[])}},e.useSmartSuggestions=function(e,r={}){const{minQueryLength:a=1,maxSuggestions:o=10,debounceMs:n=200,enableSpellCorrection:s=!0,enableQueryExpansion:i=!0,enableIntentDetection:l=!0,includeTrending:c=!0,userContext:d}=r,{stateManager:u}=w(),[p,m]=t.useState([]),[g,f]=t.useState(!1),[h,y]=t.useState(null),[b,v]=t.useState(null),[k,x]=t.useState([]),[E,S]=t.useState([]),C=t.useRef(null),R=t.useMemo(()=>["phone","laptop","computer","tablet","headphones","camera","television","speaker","watch","keyboard","mouse","monitor","shirt","pants","shoes","jacket","dress","skirt","sweater","electronics","clothing","accessories","furniture","appliances"],[]),I=t.useCallback(async e=>{const t=[];if(l){const t=function(e){const t=[{pattern:/^(buy|purchase|order|get)\s+/i,intent:"purchase"},{pattern:/^(find|search|looking for|where)\s+/i,intent:"search"},{pattern:/^(compare|vs|versus)\s+/i,intent:"compare"},{pattern:/^(how (to|do)|what is|why)\s+/i,intent:"informational"},{pattern:/under\s*\$?\d+|less than\s*\$?\d+|cheap|affordable/i,intent:"price_sensitive"},{pattern:/best|top|recommended|popular/i,intent:"recommendation"},{pattern:/\d+\s*(gb|tb|inch|cm|mm|kg|lb)/i,intent:"specification"},{pattern:/(red|blue|green|black|white|pink|purple|yellow)\s+/i,intent:"color_preference"},{pattern:/(size|small|medium|large|xl|xxl)\s+/i,intent:"size_preference"}];for(const{pattern:r,intent:a}of t)if(r.test(e))return{intent:a,confidence:.8};return null}(e);v(t?t.intent:null)}if(s&&e.length>=3){const r=to(e,R);x(r),r.forEach(r=>{t.push({text:r,type:"correction",confidence:.9,metadata:{correctedFrom:e}})})}if(i){const r=function(e){const t=e.toLowerCase(),r=[];return Object.entries({phone:["smartphone","mobile","cellphone"],laptop:["notebook","computer","pc"],tv:["television","smart tv","monitor"],headphones:["earbuds","earphones","headset"],shoes:["footwear","sneakers","boots"],shirt:["top","blouse","tee"],pants:["trousers","jeans","bottoms"],cheap:["affordable","budget","inexpensive"],best:["top-rated","popular","recommended"]}).forEach(([a,o])=>{t.includes(a)&&o.forEach(t=>{const o=e.replace(new RegExp(a,"gi"),t);r.includes(o)||r.push(o)})}),r.slice(0,3)}(e);S(r),r.forEach(e=>{t.push({text:e,type:"expansion",confidence:.7,metadata:{expandedTo:[e]}})})}return t.unshift({text:e,type:"query",confidence:1}),d?.recentSearches&&d.recentSearches.filter(t=>t.toLowerCase().includes(e.toLowerCase())&&t!==e).slice(0,2).forEach(e=>{t.push({text:e,type:"related",confidence:.6})}),t.slice(0,o)},[R,l,s,i,o,d]),N=t.useCallback(async e=>e.length<a?[]:I(e),[a,I]);return t.useEffect(()=>(C.current&&clearTimeout(C.current),e.length<a?(m([]),x([]),S([]),void v(null)):(f(!0),C.current=setTimeout(async()=>{try{const t=await I(e);m(t),y(null)}catch(e){y(e instanceof Error?e:new Error(String(e))),m([])}finally{f(!1)}},n),()=>{C.current&&clearTimeout(C.current)})),[e,a,n,I]),{suggestions:p,loading:g,error:h,detectedIntent:b,corrections:k,expansions:E,getSuggestions:N,clear:t.useCallback(()=>{m([]),x([]),S([]),v(null),y(null)},[])}},e.useSuggestionsAnalytics=Qe,e.useSuggestionsContext=et,e.useVariantSelection=function({options:e=[],variants:r=[],initialSelections:a={},onVariantChange:o}={}){const[n,s]=t.useState(a),i=t.useMemo(()=>Ut(e,r,n),[e,r,n]),l=t.useMemo(()=>e.length>0&&e.every(e=>!!n[e.name]),[e,n]),c=t.useMemo(()=>{const t={};for(const a of e)t[a.name]=Vt(a.name,e,r,n);return t},[e,r,n]),d=i?.price??null,u=i?.comparePrice??null,p=t.useCallback((t,a)=>{s(n=>{const s={...n,[t]:a},i=Ut(e,r,s);return o?.(i,s),s})},[e,r,o]),m=t.useCallback(()=>{s({}),o?.(null,{})},[o]);return{selections:n,setSelection:p,resetSelections:m,selectedVariant:i,availableValues:c,isComplete:l,effectivePrice:d,effectiveComparePrice:u}},e.withAnalytics=function(e,r={}){const{trackClick:a=!0,trackImpression:o=!1,clickEventName:n="product.click",getProductFromProps:s=()=>null,getPositionFromProps:i=()=>0}=r,l=e.displayName||e.name||"Component",c=t.forwardRef((r,l)=>{const{seekoraClient:c,seekoraContext:u,...p}=r,m=t.useRef(null),g=t.useRef(!1),f=s(p),h=i(p),y=t.useCallback(async(e,t)=>{if(c)try{await(c.trackEvent?.({event_name:e,metadata:{product_id:f?.id||f?.objectID,product_title:f?.title||f?.name,product_price:f?.price,position:h,timestamp:Date.now(),source:"with_analytics_hoc",...t}},u))}catch(t){d(`withAnalytics: Failed to track ${e}`,{error:t})}},[c,u,f,h]),b=t.useCallback(()=>{a&&f&&(y(n,{}),c?.trackClick&&f&&Promise.resolve(c.trackClick(f.id||f.objectID||"",h+1,u)).catch(()=>{}))},[a,f,y,c,u,h]);return t.useEffect(()=>{if(!o||!c||!m.current||g.current)return;if("undefined"==typeof IntersectionObserver)return;const e=new IntersectionObserver(t=>{for(const r of t)r.isIntersecting&&!g.current&&(g.current=!0,y("product.impression",{}),e.disconnect())},{threshold:.5});return e.observe(m.current),()=>e.disconnect()},[o,c,y]),t.createElement("div",{ref:e=>{m.current=e,"function"==typeof l?l(e):l&&(l.current=e)},onClick:b,style:{display:"contents"}},t.createElement(e,{...p}))});return c.displayName=`withAnalytics(${l})`,c}});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("@seekora-ai/search-sdk")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","@seekora-ai/search-sdk"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SeekoraUI={},e.React,e.ReactDOM,e.SeekoraSDK)}(this,function(e,t,r,a){"use strict";var o;!function(e){e[e.VERBOSE=0]="VERBOSE",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT"}(o||(o={}));class n{constructor(e={}){this.level=e.level??this.getDefaultLevel(),this.prefix=e.prefix??"[Seekora UI SDK]",this.enableTimestamp=e.enableTimestamp??!1}getDefaultLevel(){switch(void 0){case"VERBOSE":return o.VERBOSE;case"INFO":return o.INFO;case"WARN":return o.WARN;case"ERROR":return o.ERROR;case"SILENT":return o.SILENT}return"undefined"!=typeof window&&window.__SEEKORA_DEBUG__?o.VERBOSE:o.INFO}formatMessage(e,...t){const r=[];return this.enableTimestamp&&r.push(`[${(new Date).toISOString()}]`),r.push(this.prefix,`[${e}]`),[...r,...t]}verbose(...e){this.level<=o.VERBOSE&&console.log(...this.formatMessage("VERBOSE",...e))}info(...e){this.level<=o.INFO&&console.info(...this.formatMessage("INFO",...e))}warn(...e){this.level<=o.WARN&&console.warn(...this.formatMessage("WARN",...e))}error(...e){this.level<=o.ERROR&&console.error(...this.formatMessage("ERROR",...e))}setLevel(e){this.level=e}getLevel(){return this.level}setPrefix(e){this.prefix=e}setTimestamp(e){this.enableTimestamp=e}}let s=null;function i(){return s||(s=function(e={}){return new n(e)}()),s}const l=(...e)=>i().verbose(...e),c=(...e)=>i().info(...e),d=(...e)=>i().warn(...e),u=(...e)=>i().error(...e);function p(e){const{attribute:t,hit:r,preTag:a="<mark>",postTag:o="</mark>",fallback:n}=e,s=r._highlightResult?.[t]?.value||r.highlight_result?.[t]?.value||r._highlight?.[t]||r.highlight?.[t];if(s)return s.replace(/<em>/g,a).replace(/<\/em>/g,o).replace(/<mark>/g,a).replace(/<\/mark>/g,o);const i=(l=r,t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:void 0,l));var l;return void 0!==i?String(i):n||""}function m(e,t="<mark>",r="</mark>"){const a=[];let o=e;for(;o.length>0;){const e=o.indexOf(t);if(-1===e){o.length>0&&a.push({value:o,isHighlighted:!1});break}e>0&&a.push({value:o.substring(0,e),isHighlighted:!1});const n=o.substring(e+t.length),s=n.indexOf(r);if(-1===s){a.push({value:o.substring(e),isHighlighted:!1});break}a.push({value:n.substring(0,s),isHighlighted:!0}),o=n.substring(s+r.length)}return a}function g(e,t,r=!1){if(!t||!e)return[{value:e,isHighlighted:!1}];const a=[],o=r?"g":"gi",n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp(n,o);let i,l=0;for(;null!==(i=s.exec(e));)i.index>l&&a.push({value:e.substring(l,i.index),isHighlighted:!1}),a.push({value:i[0],isHighlighted:!0}),l=s.lastIndex;return l<e.length&&a.push({value:e.substring(l),isHighlighted:!1}),a.length>0?a:[{value:e,isHighlighted:!1}]}i();class f{constructor(e){this.listeners=[],this.debounceTimer=null,this.notifyScheduled=!1,this.searchCoalesceTimer=null,this.searchCoalesceResolvers=[],this.client=e.client,this.autoSearch=!1!==e.autoSearch,this.debounceMs=e.debounceMs||300,this.defaultSearchOptions=e.defaultSearchOptions||{widget_mode:!0},this.keepResultsOnClear=!1!==e.keepResultsOnClear,this.abTestId=e.abTestId,this.abVariant=e.abVariant,this.state={query:e.initialQuery||"",refinements:[],currentPage:1,itemsPerPage:e.itemsPerPage||10,sortBy:void 0,results:null,loading:!1,error:null},c("SearchStateManager: Initialized",{autoSearch:this.autoSearch,debounceMs:this.debounceMs})}getState(){return{...this.state}}getQuery(){return this.state.query}getRefinements(){return[...this.state.refinements]}getCurrentPage(){return this.state.currentPage}getResults(){return this.state.results}getLoading(){return this.state.loading}getError(){return this.state.error}setQuery(e,t=!0){return this.state.query===e?(l("SearchStateManager: Query unchanged, skipping update",{query:e}),void(t&&this.autoSearch&&(l("SearchStateManager: Query unchanged but triggerSearch=true, triggering search"),this.debouncedSearch()))):""===e&&this.keepResultsOnClear?(l("SearchStateManager: Query cleared, keeping previous results"),this.state.query="",this.state.currentPage=1,void this.notifyListeners()):(this.state.query=e,this.state.currentPage=1,l("SearchStateManager: Query updated",{query:e,triggerSearch:t,autoSearch:this.autoSearch}),this.notifyListeners(),void(this.autoSearch&&t?(l("SearchStateManager: Triggering debounced search"),this.debouncedSearch()):l("SearchStateManager: Search not triggered",{autoSearch:this.autoSearch,triggerSearch:t})))}addRefinement(e,t,r=!0){const a=this.state.refinements.some(r=>r.field===e&&r.value===t);a||(this.state.refinements.push({field:e,value:t}),this.state.currentPage=1,l("SearchStateManager: Refinement added",{field:e,value:t}),this.notifyListeners(),this.autoSearch&&r&&this.debouncedSearch())}removeRefinement(e,t,r=!0){const a=this.state.refinements.findIndex(r=>r.field===e&&r.value===t);-1!==a&&(this.state.refinements.splice(a,1),this.state.currentPage=1,l("SearchStateManager: Refinement removed",{field:e,value:t}),this.notifyListeners(),this.autoSearch&&r&&this.debouncedSearch())}clearRefinements(e=!0){0!==this.state.refinements.length&&(this.state.refinements=[],this.state.currentPage=1,l("SearchStateManager: Refinements cleared"),this.notifyListeners(),this.autoSearch&&e&&this.debouncedSearch())}setPage(e,t=!0){this.state.currentPage!==e&&(this.state.currentPage=e,l("SearchStateManager: Page updated",{page:e}),this.notifyListeners(),this.autoSearch&&t&&this.debouncedSearch())}setSortBy(e,t=!0){this.state.sortBy!==e&&(this.state.sortBy=e,this.state.currentPage=1,l("SearchStateManager: Sort updated",{sortBy:e}),this.notifyListeners(),this.autoSearch&&t&&this.debouncedSearch())}setItemsPerPage(e,t=!0){this.state.itemsPerPage!==e&&(this.state.itemsPerPage=e,this.state.currentPage=1,l("SearchStateManager: Items per page updated",{itemsPerPage:e}),this.notifyListeners(),this.autoSearch&&t&&this.debouncedSearch())}async search(e){return this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),new Promise((t,r)=>{this.searchCoalesceResolvers.push({resolve:t,reject:r}),this.searchCoalesceTimer&&clearTimeout(this.searchCoalesceTimer),this.searchCoalesceTimer=setTimeout(()=>{this.searchCoalesceTimer=null;const t=[...this.searchCoalesceResolvers];this.searchCoalesceResolvers=[],this._executeSearch(e).then(e=>t.forEach(t=>t.resolve(e)),e=>t.forEach(t=>t.reject(e)))},10)})}async _executeSearch(e){this.setState({loading:!0,error:null});try{const t=this.buildSearchOptions(e);l("SearchStateManager: Performing search",{query:this.state.query,refinementsCount:this.state.refinements.length,currentPage:this.state.currentPage,sortBy:this.state.sortBy,filter_by:t.filter_by});const r=await this.client.search(this.state.query,t);return this.setState({results:r,loading:!1,error:null}),c("SearchStateManager: Search completed",{query:this.state.query,resultsCount:r?.results?.length||0,totalResults:r?.totalResults||0}),r}catch(e){const t=e instanceof Error?e:new Error(String(e));return this.setState({results:null,loading:!1,error:t}),u("SearchStateManager: Search failed",{query:this.state.query,error:t.message}),null}}buildSearchOptions(e){const t={...this.defaultSearchOptions,page:this.state.currentPage,per_page:this.state.itemsPerPage,...e};if(this.state.sortBy&&"relevance"!==this.state.sortBy&&(t.sort_by=this.state.sortBy),this.state.refinements.length>0){const e={};this.state.refinements.forEach(t=>{e[t.field]||(e[t.field]=[]),e[t.field].push(t.value)});const r=[];Object.entries(e).forEach(([e,t])=>{t.forEach(t=>{r.push(`${e}:${t}`)})}),r.length>0&&(t.filter_by=r.join(" && "))}return t}debouncedSearch(){this.debounceTimer&&clearTimeout(this.debounceTimer),l("SearchStateManager: Scheduling debounced search",{debounceMs:this.debounceMs}),this.debounceTimer=setTimeout(()=>{l("SearchStateManager: Debounce timer fired, calling search()"),this.search()},this.debounceMs)}subscribe(e){return this.listeners.push(e),e(this.getState()),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}setState(e){this.state={...this.state,...e},this.notifyListeners()}notifyListeners(){this.notifyScheduled||(this.notifyScheduled=!0,queueMicrotask(()=>{this.notifyScheduled=!1;const e=this.getState();this.listeners.forEach(t=>{try{t(e)}catch(e){const t=e instanceof Error?e:new Error(String(e));u("SearchStateManager: Error in listener",{error:t.message})}})}))}clearResults(){this.setState({results:null,loading:!1,error:null}),l("SearchStateManager: Results explicitly cleared")}getAbTestId(){return this.abTestId}getAbVariant(){return this.abVariant}setAbTest(e,t){this.abTestId=e,this.abVariant=t,l("SearchStateManager: A/B test updated",{abTestId:e,abVariant:t})}buildFilterString(){if(0===this.state.refinements.length)return"";const e={};this.state.refinements.forEach(t=>{e[t.field]||(e[t.field]=[]),e[t.field].push(t.value)});const t=[];return Object.entries(e).forEach(([e,r])=>{r.forEach(r=>{t.push(`${e}:${r}`)})}),t.join(" && ")}async fetchFilters(e){l("SearchStateManager: Fetching filters",{options:e});try{const t=await this.client.getFilters({q:this.state.query||void 0,...e});return c("SearchStateManager: Filters fetched",{filterCount:t?.filters?.length}),t}catch(e){const t=e instanceof Error?e:new Error(String(e));throw u("SearchStateManager: Failed to fetch filters",{error:t.message}),t}}async searchFacetValues(e,t){l("SearchStateManager: Searching facet values",{facetName:e,query:t});try{const r=this.buildFilterString(),a=await this.client.searchFacetValues(e,{q:this.state.query||void 0,filter:r||void 0,facetQuery:t});return c("SearchStateManager: Facet values fetched",{facetName:e,valueCount:a?.values?.length}),a}catch(t){const r=t instanceof Error?t:new Error(String(t));throw u("SearchStateManager: Failed to search facet values",{facetName:e,error:r.message}),r}}async getFiltersSchema(){l("SearchStateManager: Getting filters schema");try{const e=await this.client.getFiltersSchema();return c("SearchStateManager: Filters schema fetched",{fieldCount:e?.fields?.length}),e}catch(e){const t=e instanceof Error?e:new Error(String(e));throw u("SearchStateManager: Failed to get filters schema",{error:t.message}),t}}clear(){this.state={query:"",refinements:[],currentPage:1,itemsPerPage:this.state.itemsPerPage,sortBy:void 0,results:null,loading:!1,error:null},this.notifyListeners()}}function h(e,t=0){return function(e,t=0){const r=3&e.length,a=e.length-r;let o=t;const n=3432918353,s=461845907;let i,l=0;for(;l<a;)i=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,i=Math.imul(i,n),i=i<<15|i>>>17,i=Math.imul(i,s),o^=i,o=o<<13|o>>>19,o=Math.imul(o,5)+3864292196;switch(i=0,r){case 3:i^=(255&e.charCodeAt(l+2))<<16;case 2:i^=(255&e.charCodeAt(l+1))<<8;case 1:i^=255&e.charCodeAt(l),i=Math.imul(i,n),i=i<<15|i>>>17,i=Math.imul(i,s),o^=i}return o^=e.length,o^=o>>>16,o=Math.imul(o,2246822507),o^=o>>>13,o=Math.imul(o,3266489909),o^=o>>>16,o>>>0}(e,t).toString(16).padStart(8,"0")}const y={enableCanvas:!0,enableWebGL:!0,enableAudio:!0,enableFonts:!0,enableHardware:!0,timeout:5e3},b=["Arial","Arial Black","Calibri","Cambria","Comic Sans MS","Consolas","Courier New","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Microsoft Sans Serif","Palatino Linotype","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Andale Mono","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arial Hebrew","Avenir","Baskerville","Big Caslon","Brush Script MT","Chalkboard","Cochin","Copperplate","Didot","Futura","Geneva","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Lucida Grande","Marker Felt","Menlo","Monaco","Noteworthy","Optima","Papyrus","Phosphate","Rockwell","San Francisco","Savoye LET","SignPainter","Skia","Snell Roundhand","Zapfino","Cantarell","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Droid Sans","Droid Sans Mono","Droid Serif","FreeMono","FreeSans","FreeSerif","Liberation Mono","Liberation Sans","Liberation Serif","Noto Sans","Noto Serif","Open Sans","Roboto","Ubuntu","Ubuntu Mono","Lato","Montserrat","Oswald","Raleway","Source Sans Pro","PT Sans","Merriweather","Nunito","Playfair Display","Poppins"];class v{constructor(e){this.cachedResult=null,this.config={...y,...e}}async get(){if(this.cachedResult)return this.cachedResult;const e=await this.collectComponents(),t=this.calculateConfidence(e),r=this.generateVisitorId(e);return this.cachedResult={visitorId:r,confidence:t,components:e},this.cachedResult}clearCache(){this.cachedResult=null}async collectComponents(){const[e,t,r,a,o]=await Promise.all([this.config.enableCanvas?this.getCanvasFingerprint():{hash:""},this.config.enableWebGL?this.getWebGLFingerprint():{renderer:"",vendor:"",hash:""},this.config.enableAudio?this.getAudioFingerprint():{hash:""},this.detectAdBlocker(),this.detectIncognito()]);return{canvas:e,webgl:t,audio:r,fonts:this.config.enableFonts?this.detectFonts():[],hardware:this.config.enableHardware?this.getHardwareInfo():{concurrency:0,deviceMemory:0,maxTouchPoints:0,platform:""},screen:this.getScreenInfo(),browser:this.getBrowserInfo(),adBlockerDetected:a,incognitoDetected:o}}async getCanvasFingerprint(){try{const e=document.createElement("canvas");e.width=256,e.height=128;const t=e.getContext("2d");if(!t)return{hash:""};t.fillStyle="#f8f8f8",t.fillRect(0,0,e.width,e.height);const r=t.createLinearGradient(0,0,e.width,0);r.addColorStop(0,"#ff6b6b"),r.addColorStop(.5,"#4ecdc4"),r.addColorStop(1,"#45b7d1"),t.fillStyle=r,t.fillRect(10,10,100,50),t.font="18px Arial",t.fillStyle="#333",t.textBaseline="alphabetic",t.fillText("Seekora Fingerprint 🔐",20,90),t.font="bold 14px Georgia",t.fillStyle="rgba(102, 204, 153, 0.7)",t.fillText("Test String @#$%",130,40),t.beginPath(),t.arc(200,70,30,0,2*Math.PI),t.fillStyle="rgba(255, 165, 0, 0.5)",t.fill(),t.strokeStyle="#333",t.lineWidth=2,t.stroke(),t.beginPath(),t.moveTo(10,120),t.bezierCurveTo(50,80,100,120,140,100),t.strokeStyle="#9b59b6",t.lineWidth=3,t.stroke(),t.save(),t.translate(180,100),t.rotate(.5),t.fillStyle="rgba(52, 152, 219, 0.6)",t.fillRect(-20,-10,40,20),t.restore();const a=e.toDataURL("image/png");return{hash:h(a),data:a}}catch{return{hash:""}}}async getWebGLFingerprint(){try{const e=document.createElement("canvas");e.width=256,e.height=256;const t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{renderer:"",vendor:"",hash:""};const r=t.getExtension("WEBGL_debug_renderer_info"),a=r&&t.getParameter(r.UNMASKED_RENDERER_WEBGL)||"",o=r&&t.getParameter(r.UNMASKED_VENDOR_WEBGL)||"",n=[],s=[t.ALIASED_LINE_WIDTH_RANGE,t.ALIASED_POINT_SIZE_RANGE,t.ALPHA_BITS,t.BLUE_BITS,t.DEPTH_BITS,t.GREEN_BITS,t.MAX_COMBINED_TEXTURE_IMAGE_UNITS,t.MAX_CUBE_MAP_TEXTURE_SIZE,t.MAX_FRAGMENT_UNIFORM_VECTORS,t.MAX_RENDERBUFFER_SIZE,t.MAX_TEXTURE_IMAGE_UNITS,t.MAX_TEXTURE_SIZE,t.MAX_VARYING_VECTORS,t.MAX_VERTEX_ATTRIBS,t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,t.MAX_VERTEX_UNIFORM_VECTORS,t.MAX_VIEWPORT_DIMS,t.RED_BITS,t.RENDERER,t.SHADING_LANGUAGE_VERSION,t.STENCIL_BITS,t.VENDOR,t.VERSION];for(const e of s)try{const r=t.getParameter(e);null!=r&&(r instanceof Float32Array||r instanceof Int32Array?n.push(Array.from(r).join(",")):n.push(String(r)))}catch{}const i=t.getSupportedExtensions()||[];n.push(i.sort().join(","));try{const e="\n attribute vec2 position;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n }\n ",r="\n precision mediump float;\n void main() {\n gl_FragColor = vec4(0.812, 0.373, 0.784, 1.0);\n }\n ",a=t.createShader(t.VERTEX_SHADER);t.shaderSource(a,e),t.compileShader(a);const o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,r),t.compileShader(o);const s=t.createProgram();t.attachShader(s,a),t.attachShader(s,o),t.linkProgram(s),t.useProgram(s);const i=new Float32Array([0,.5,-.5,-.5,.5,-.5]),l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW);const c=t.getAttribLocation(s,"position");t.enableVertexAttribArray(c),t.vertexAttribPointer(c,2,t.FLOAT,!1,0,0),t.clearColor(.1,.1,.1,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLES,0,3);const d=new Uint8Array(262144);t.readPixels(0,0,256,256,t.RGBA,t.UNSIGNED_BYTE,d);const u=[0,1e3,5e3,1e4,25e3,5e4,1e5,2e5];for(const e of u)e<d.length&&n.push(String(d[e]))}catch{}const l=`${a}|${o}|${n.join("|")}`;return{renderer:a,vendor:o,hash:h(l)}}catch{return{renderer:"",vendor:"",hash:""}}}async getAudioFingerprint(){try{const e=window.AudioContext||window.webkitAudioContext;if(!e)return{hash:""};const t=new e,r=t.createOscillator();r.type="triangle",r.frequency.setValueAtTime(1e4,t.currentTime);const a=t.createDynamicsCompressor();a.threshold.setValueAtTime(-50,t.currentTime),a.knee.setValueAtTime(40,t.currentTime),a.ratio.setValueAtTime(12,t.currentTime),a.attack.setValueAtTime(0,t.currentTime),a.release.setValueAtTime(.25,t.currentTime);const o=t.createAnalyser();return o.fftSize=2048,r.connect(a),a.connect(o),o.connect(t.destination),r.start(0),new Promise(e=>{const a=setTimeout(()=>{try{r.stop(),t.close()}catch{}e({hash:""})},this.config.timeout);setTimeout(()=>{try{const n=new Float32Array(o.frequencyBinCount);o.getFloatFrequencyData(n);let s=0,i=0;for(let e=0;e<n.length;e++)isFinite(n[e])&&0!==n[e]&&(s+=Math.abs(n[e]),i++);const l=i>0?s/i:0,c=Array.from(n.slice(0,100)).filter(e=>isFinite(e)).map(e=>e.toFixed(4)).join(",");clearTimeout(a),r.stop(),t.close();const d=h(c+String(l));e({hash:d,value:l})}catch{clearTimeout(a);try{r.stop(),t.close()}catch{}e({hash:""})}},200)})}catch{return{hash:""}}}detectFonts(){const e=[];try{const t=["monospace","sans-serif","serif"],r="mmmmmmmmmmlli",a="72px",o=document.createElement("canvas");o.width=500,o.height=100;const n=o.getContext("2d");if(!n)return e;const s={};for(const e of t)n.font=`${a} ${e}`,s[e]=n.measureText(r).width;for(const o of b){let i=!1;for(const e of t){n.font=`${a} "${o}", ${e}`;if(n.measureText(r).width!==s[e]){i=!0;break}}i&&e.push(o)}}catch{}return e}getHardwareInfo(){const e=navigator;return{concurrency:e.hardwareConcurrency||0,deviceMemory:e.deviceMemory||0,maxTouchPoints:e.maxTouchPoints||0,platform:e.platform||""}}getScreenInfo(){return{width:screen.width||0,height:screen.height||0,colorDepth:screen.colorDepth||0,pixelRatio:window.devicePixelRatio||1}}getBrowserInfo(){const e=navigator;return{language:e.language||"",languages:Array.from(e.languages||[]),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"",timezoneOffset:(new Date).getTimezoneOffset(),cookieEnabled:e.cookieEnabled??!1,doNotTrack:"1"===e.doNotTrack||"yes"===e.doNotTrack}}async detectAdBlocker(){try{const e=document.createElement("div");e.className="adsbox ad-banner ad_banner textAd text_ad text-ad",e.style.cssText="position: absolute; left: -9999px; width: 1px; height: 1px;",e.innerHTML="&nbsp;",document.body.appendChild(e),await new Promise(e=>setTimeout(e,100));const t=null===e.offsetParent||0===e.offsetHeight||0===e.offsetWidth||"none"===getComputedStyle(e).display||"hidden"===getComputedStyle(e).visibility;document.body.removeChild(e);try{await fetch("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",{method:"HEAD",mode:"no-cors"});return t}catch{return!0}}catch{return!1}}async detectIncognito(){if("storage"in navigator&&"estimate"in navigator.storage)try{const e=await navigator.storage.estimate();if(e.quota&&e.quota<136314880)return!0}catch{}try{const e=indexedDB.open("test-private-mode");return new Promise(t=>{e.onerror=()=>t(!0),e.onsuccess=()=>{e.result.close(),indexedDB.deleteDatabase("test-private-mode"),t(!1)},setTimeout(()=>t(!1),500)})}catch{return!0}}generateHash(e){return h(e)}generateVisitorId(e){const t=JSON.stringify({canvas:e.canvas.hash,webgl:e.webgl.hash,audio:e.audio.hash,fonts:e.fonts.sort().join(","),hardware:e.hardware,screen:e.screen,browser:{...e.browser,languages:e.browser.languages.sort().join(",")}});return`${h(t,0)}${h(t,1)}${h(t,2)}${h(t,3)}`}calculateConfidence(e){let t=0,r=0;return r+=.2,e.canvas.hash&&(t+=.2),r+=.2,e.webgl.hash&&e.webgl.renderer?t+=.2:e.webgl.hash&&(t+=.1),r+=.15,e.audio.hash&&(t+=.15),r+=.15,e.fonts.length>10?t+=.15:e.fonts.length>5?t+=.1:e.fonts.length>0&&(t+=.05),r+=.1,e.hardware.concurrency>0&&e.hardware.platform?t+=.1:e.hardware.platform&&(t+=.05),r+=.1,e.screen.width>0&&e.screen.height>0&&(t+=.1),r+=.1,e.browser.timezone&&e.browser.language?t+=.1:e.browser.language&&(t+=.05),Math.min(1,t/1)}}const k={colors:{primary:"#007bff",secondary:"#6c757d",background:"#ffffff",surface:"#f8f9fa",text:"#212529",textSecondary:"#6c757d",border:"#dee2e6",hover:"#f8f9fa",focus:"#007bff",error:"#dc3545",success:"#28a745",warning:"#ffc107"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:{small:"0.875rem",medium:"1rem",large:"1.25rem"},fontWeight:{normal:400,medium:500,semibold:600,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},borderRadius:{none:"0",small:"0.25rem",medium:"0.375rem",large:"0.5rem",full:"9999px"},shadows:{small:"0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)",medium:"0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)",large:"0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23)"},transitions:{fast:"150ms ease-in-out",normal:"250ms ease-in-out",slow:"350ms ease-in-out"},breakpoints:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},zIndex:{dropdown:1e3,modal:2e3,tooltip:3e3}},x=e=>((e,t)=>({colors:{...t.colors,...e.colors},typography:{...t.typography,...e.typography,fontSize:{...t.typography.fontSize,...e.typography?.fontSize}},spacing:{...t.spacing,...e.spacing},borderRadius:e.borderRadius??t.borderRadius,shadows:{...t.shadows,...e.shadows},transitions:{...t.transitions,...e.transitions},breakpoints:{...t.breakpoints,...e.breakpoints},zIndex:{...t.zIndex,...e.zIndex}}))(e,k),E=t.createContext(null),w=()=>{const e=t.useContext(E);if(!e){const e=new Error("useSearchContext must be used within a SearchProvider");throw u("SearchProvider: Context not available",{error:e.message}),e}return e},S=()=>{const{stateManager:e}=w(),[r,a]=t.useState(e.getState());t.useEffect(()=>e.subscribe(e=>{a(e)}),[e]);const o=t.useCallback((t,r=!0)=>{e.setQuery(t,r)},[e]),n=t.useCallback((t,r,a=!0)=>{e.addRefinement(t,r,a)},[e]),s=t.useCallback((t,r,a=!0)=>{e.removeRefinement(t,r,a)},[e]),i=t.useCallback((t=!0)=>{e.clearRefinements(t)},[e]),l=t.useCallback((t,r=!0)=>{e.setPage(t,r)},[e]),c=t.useCallback((t,r=!0)=>{e.setSortBy(t,r)},[e]),d=t.useCallback(t=>e.search(t),[e]),u=t.useCallback(()=>{e.clear()},[e]);return{query:r.query,refinements:r.refinements,currentPage:r.currentPage,itemsPerPage:r.itemsPerPage,sortBy:r.sortBy,results:r.results,loading:r.loading,error:r.error,setQuery:o,addRefinement:n,removeRefinement:s,clearRefinements:i,setPage:l,setSortBy:c,search:d,clear:u}},C=({client:e,query:r,enabled:a=!0,debounceMs:o=300,maxSuggestions:n=10})=>{const[s,i]=t.useState([]),[c,d]=t.useState(!1),[p,m]=t.useState(null),g=t.useRef(null);return t.useEffect(()=>(g.current&&clearTimeout(g.current),a&&r.trim()?(d(!0),m(null),g.current=setTimeout(async()=>{try{const t=await(e.getSuggestions?.(r,n)),a=(Array.isArray(t)?t:[]).map(e=>{const t=e.query||e.text||e,r=void 0!==e.popularity?e.popularity:void 0!==e.count?e.count:void 0;return{query:"string"==typeof t?t:String(t),count:"number"==typeof r?r:void 0,metadata:e}});i(a)}catch(e){const t=e instanceof Error?e:new Error(String(e)),r=t.message||"";404===e?.response?.status||404===e?.status||/\(404\)/.test(r)?(l("Query suggestions not enabled for this store (404)"),i([]),m(null)):(u("Error in useQuerySuggestions:",t),m(t),i([]))}finally{d(!1)}},o),()=>{g.current&&clearTimeout(g.current)}):(i([]),d(!1),void m(null))),[e,r,a,o,n]),{suggestions:s,loading:c,error:p}};function R(e){var t,r,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=R(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function I(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=R(e))&&(a&&(a+=" "),a+=t);return a}const N=100,z={small:{padding:"0.375rem 0.5rem",fontSize:"0.875rem",iconSize:14,iconPaddingLeft:"1.75rem",iconPaddingRight:"1.75rem",iconLeft:"0.5rem",iconRight:"0.5rem"},medium:{padding:"0.625rem 1rem",fontSize:"1rem",iconSize:18,iconPaddingLeft:"2.25rem",iconPaddingRight:"2.25rem",iconLeft:"0.625rem",iconRight:"0.625rem"},large:{padding:"0.875rem 1.25rem",fontSize:"1.25rem",iconSize:22,iconPaddingLeft:"2.75rem",iconPaddingRight:"2.75rem",iconLeft:"0.75rem",iconRight:"0.75rem"}},T=({size:e=18})=>t.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("circle",{cx:"11",cy:"11",r:"8"}),t.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),M=({size:e=14})=>t.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),A="seekora-stats-animate",_="seekora-stats-styles";const $=576,L=768,P=992,D=1200,F=1400;function B(){const[e,r]=t.useState("lg");return t.useEffect(()=>{const e=()=>{var e;r((e=window.innerWidth)>=F?"xxl":e>=D?"xl":e>=P?"lg":e>=L?"md":e>=$?"sm":"xs")};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}function W(){return function(e){const[r,a]=t.useState(!1);return t.useEffect(()=>{const t=window.matchMedia(e),r=()=>a(t.matches);return r(),t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e]),r}(`(max-width: ${L-1}px)`)}function q(e=4){return function(e,t=4){switch(e){case"xs":return Math.min(t,1);case"sm":return Math.min(t,2);case"md":return Math.min(t,3);case"lg":return Math.min(t,4);case"xl":return Math.min(t,5);default:return t}}(B(),e)}function H(e=32){return function(e,t=32){return e?Math.max(44,t):t}(W(),e)}function O(e=12){return function(e,t=12){switch(e){case"xs":return Math.max(4,.5*t);case"sm":return Math.max(6,.75*t);case"md":case"lg":default:return t;case"xl":case"xxl":return 1.25*t}}(B(),e)}function j(e=12){return function(e,t=12){switch(e){case"xs":return Math.max(8,.67*t);case"sm":return Math.max(10,.83*t);case"md":case"lg":default:return t;case"xl":case"xxl":return 1.33*t}}(B(),e)}const V=({value:e,onChange:r,options:a,placeholder:o="Select...",className:n,style:s,theme:i,"aria-label":l,disabled:c=!1})=>{const[d,u]=t.useState(!1),[p,m]=t.useState(-1),g=t.useRef(null),f=t.useRef(null),h=t.useId(),y=i||{},b=a.find(t=>t.value===e),v=b?.label??o;t.useEffect(()=>{if(!d)return;const e=e=>{g.current&&!g.current.contains(e.target)&&(u(!1),m(-1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[d]),t.useEffect(()=>{if(!d||p<0||!f.current)return;const e=f.current.children[p];e?.scrollIntoView?.({block:"nearest"})},[p,d]);const k=t.useCallback(()=>{c||u(t=>{if(!t){const t=a.findIndex(t=>t.value===e);m(t>=0?t:0)}return!t})},[c,a,e]),x=t.useCallback(e=>{e.disabled||(r(e.value),u(!1),m(-1))},[r]),E=(e,t)=>{let r=e;for(let e=0;e<a.length;e++)if(r+=t,r<0&&(r=a.length-1),r>=a.length&&(r=0),!a[r].disabled)return r;return e},w=t.useCallback(e=>{if(!c)if(d)switch(e.key){case"ArrowDown":e.preventDefault(),m(e=>E(e,1));break;case"ArrowUp":e.preventDefault(),m(e=>E(e,-1));break;case"Enter":case" ":e.preventDefault(),p>=0&&!a[p].disabled&&x(a[p]);break;case"Escape":e.preventDefault(),u(!1),m(-1);break;case"Home":e.preventDefault(),m(E(-1,1));break;case"End":e.preventDefault(),m(E(a.length,-1));break;case"Tab":u(!1),m(-1)}else["ArrowDown","ArrowUp","Enter"," "].includes(e.key)&&(e.preventDefault(),k())},[c,d,p,a,k,x]),S=`seekora-select-menu-${h}`;return t.createElement("div",{ref:g,className:I("seekora-select",n),style:{position:"relative",display:"inline-block",...s},onKeyDown:w},t.createElement("button",{type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":d,"aria-controls":S,"aria-label":l,"aria-activedescendant":d&&p>=0?`${S}-opt-${p}`:void 0,disabled:c,onClick:k,className:I("seekora-select__trigger",y.trigger),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,width:"100%",padding:"8px 12px",fontSize:"var(--seekora-select-font-size, 0.875rem)",lineHeight:1.4,border:"1px solid var(--seekora-select-border, rgba(128,128,128,0.3))",borderRadius:"var(--seekora-select-radius, 6px)",backgroundColor:"var(--seekora-select-bg, #fff)",color:"var(--seekora-select-color, inherit)",cursor:c?"not-allowed":"pointer",outline:"none",textAlign:"left",fontFamily:"inherit",opacity:c?.5:1}},t.createElement("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},v),t.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0,transition:"transform 0.15s ease",transform:d?"rotate(180deg)":"rotate(0deg)"}},t.createElement("path",{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))),d&&t.createElement("div",{ref:f,id:S,role:"listbox",className:I("seekora-select__menu",y.menu),style:{position:"absolute",top:"100%",left:0,right:0,zIndex:9999,marginTop:4,padding:"4px 0",border:"1px solid var(--seekora-select-border, rgba(128,128,128,0.3))",borderRadius:"var(--seekora-select-radius, 6px)",backgroundColor:"var(--seekora-select-bg, #fff)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",maxHeight:220,overflowY:"auto"}},a.map((r,a)=>{const o=r.value===e,n=a===p;return t.createElement("div",{key:r.value,id:`${S}-opt-${a}`,role:"option","aria-selected":o,"aria-disabled":r.disabled||void 0,className:I("seekora-select__option",y.option,o&&"seekora-select__option--selected",n&&(y.optionActive||"seekora-select__option--highlighted"),r.disabled&&(y.optionDisabled||"seekora-select__option--disabled")),onMouseEnter:()=>!r.disabled&&m(a),onMouseDown:e=>{e.preventDefault(),r.disabled||x(r)},style:{padding:"6px 12px",fontSize:"var(--seekora-select-font-size, 0.875rem)",cursor:r.disabled?"not-allowed":"pointer",backgroundColor:n?"var(--seekora-select-hover-bg, #f3f4f6)":o?"var(--seekora-select-active-bg, #eff6ff)":"transparent",color:r.disabled?"rgba(128,128,128,0.5)":o?"var(--seekora-select-active-color, inherit)":"var(--seekora-select-color, inherit)",fontWeight:o?500:400,opacity:r.disabled?.5:1,transition:"background-color 0.1s ease"}},r.label)})))};const U=e=>{const{stateManager:r}=w(),[a,o]=t.useState([]),[n,s]=t.useState(null),[i,l]=t.useState(!1),[c,d]=t.useState(null),u=t.useRef(!0),p=!1!==e?.autoFetch,m=t.useRef(!1),g=t.useCallback(async()=>{m.current||l(!0),d(null);try{const{autoFetch:t,...a}=e||{},n=await r.fetchFilters(a);u.current&&(o(n?.filters||[]),m.current=!0,l(!1))}catch(e){u.current&&(d(e instanceof Error?e:new Error(String(e))),l(!1))}},[r,e?.facetBy,e?.maxFacetValues,e?.disjunctiveFacets?.join(",")]),f=t.useRef(null);t.useEffect(()=>{if(!p)return;return r.subscribe(e=>{const t=e.query;t!==f.current&&(f.current=t,g())})},[r,p,g]),t.useEffect(()=>{r.getFiltersSchema().then(e=>{u.current&&s(e)}).catch(()=>{})},[r]),t.useEffect(()=>()=>{u.current=!1},[]);return{filters:a,schema:n,loading:i,error:c,searchFacetValues:t.useCallback((e,t)=>r.searchFacetValues(e,t),[r]),refetch:t.useCallback(async()=>{await g()},[g])}},K="0 2px 4px rgba(0,0,0,0.1)",Q=({field:e,label:r,min:a,max:o,step:n=1,currentMin:s,currentMax:i,onRangeChange:l,formatValue:c=e=>e.toString(),className:d,style:u,theme:p,showValues:m=!0,syncWithState:g=!0,debounceMs:f=300})=>{const{theme:h}=w(),{refinements:y,addRefinement:b,removeRefinement:v}=S(),k=p||{},x=k.thumb||"seekora-range-slider__thumb";let E;if(g){let t,r;y.forEach(a=>{if(a.field===e){const e=a.value.match(/^>=(\d+(?:\.\d+)?)$/);e&&(t=parseFloat(e[1]));const o=a.value.match(/^<=(\d+(?:\.\d+)?)$/);o&&(r=parseFloat(o[1]))}}),E={min:t,max:r}}else E={min:void 0,max:void 0};const[C,R]=t.useState(s??E.min??a),[N,z]=t.useState(i??E.max??o),T=t.useRef(!1),M=t.useRef(null),A=t.useRef(C),_=t.useRef(N);t.useEffect(()=>{g&&!T.current&&(void 0!==E.min?R(E.min):R(a),void 0!==E.max?z(E.max):z(o))},[g,E.min,E.max,a,o]);const $=t.useCallback((t,r)=>{if(!g)return;y.forEach(t=>{t.field===e&&v(e,t.value,!1)});const n=t>a,s=r<o;n&&s?(b(e,`>=${t}`,!1),b(e,`<=${r}`,!0)):n?b(e,`>=${t}`,!0):s&&b(e,`<=${r}`,!0)},[g,e,y,b,v,a,o]),L=t.useCallback((e,t)=>{A.current=e,_.current=t,M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{$(e,t),l&&l(e,t)},f)},[$,l,f]),P=()=>{T.current=!1,M.current&&(clearTimeout(M.current),M.current=null),$(A.current,_.current),l&&l(A.current,_.current)},D=(C-a)/(o-a)*100,F=(N-a)/(o-a)*100;return t.createElement("div",{className:I(k.root,d),style:{fontFamily:"inherit",...u}},r&&t.createElement("label",{className:k.label,style:{display:"block",marginBottom:h.spacing.small,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.medium||500,color:h.colors.text}},r),t.createElement("div",{className:k.slider,style:{position:"relative",minHeight:"40px",display:"flex",alignItems:"center"}},t.createElement("div",{className:k.track,style:{position:"absolute",width:"100%",height:"4px",backgroundColor:h.colors.border,borderRadius:"2px"}}),t.createElement("div",{className:k.trackFilled,style:{position:"absolute",left:`${D}%`,width:F-D+"%",height:"4px",backgroundColor:h.colors.primary,borderRadius:"2px"}}),t.createElement("input",{type:"range",min:a,max:o,step:n,value:C,onChange:e=>{const t=Math.min(Number(e.target.value),N-n);R(t),T.current=!0,L(t,N)},onMouseUp:P,onTouchEnd:P,onKeyDown:e=>{let t=null;"Home"===e.key?(e.preventDefault(),t=a):"End"===e.key?(e.preventDefault(),t=N-n):!e.shiftKey||"ArrowLeft"!==e.key&&"ArrowDown"!==e.key?!e.shiftKey||"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),t=Math.min(N-n,C+10*n)):(e.preventDefault(),t=Math.max(a,C-10*n)),null!==t&&(R(t),L(t,N))},tabIndex:0,"aria-valuenow":C,"aria-valuemin":a,"aria-valuemax":o,className:x,style:{position:"absolute",width:"100%",height:"4px",background:"transparent",WebkitAppearance:"none",appearance:"none",cursor:"pointer",pointerEvents:"none"},"aria-label":`Minimum ${r||e}`}),t.createElement("input",{type:"range",min:a,max:o,step:n,value:N,onChange:e=>{const t=Math.max(Number(e.target.value),C+n);z(t),T.current=!0,L(C,t)},onMouseUp:P,onTouchEnd:P,onKeyDown:e=>{let t=null;"Home"===e.key?(e.preventDefault(),t=C+n):"End"===e.key?(e.preventDefault(),t=o):!e.shiftKey||"ArrowLeft"!==e.key&&"ArrowDown"!==e.key?!e.shiftKey||"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),t=Math.min(o,N+10*n)):(e.preventDefault(),t=Math.max(C+n,N-10*n)),null!==t&&(z(t),L(C,t))},tabIndex:0,"aria-valuenow":N,"aria-valuemin":a,"aria-valuemax":o,className:x,style:{position:"absolute",width:"100%",height:"4px",background:"transparent",WebkitAppearance:"none",appearance:"none",cursor:"pointer",pointerEvents:"none"},"aria-label":`Maximum ${r||e}`})),m&&t.createElement("div",{className:k.values,style:{display:"flex",justifyContent:"space-between",marginTop:h.spacing.small,fontSize:h.typography.fontSize.small,color:h.colors.textSecondary}},t.createElement("span",{className:k.value},c(C)),t.createElement("span",{className:k.value},c(N))),t.createElement("style",null,`\n .${x}::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: ${h.colors.primary};\n border-radius: 50%;\n cursor: pointer;\n pointer-events: all;\n box-shadow: ${K};\n }\n .${x}::-moz-range-thumb {\n width: 20px;\n height: 20px;\n background: ${h.colors.primary};\n border-radius: 50%;\n cursor: pointer;\n pointer-events: all;\n border: none;\n box-shadow: ${K};\n }\n `))};const G=({expanded:e,color:r="currentColor",size:a=16})=>t.createElement("svg",{width:a,height:a,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:"transform 200ms ease",flexShrink:0},"aria-hidden":"true"},t.createElement("path",{d:"M4 6L8 10L12 6",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),X=({size:e=16})=>t.createElement("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},t.createElement("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),Y={"--seekora-facet-bg":"transparent","--seekora-facet-border":"#dee2e6","--seekora-facet-active-bg":"rgba(0, 0, 0, 0.05)","--seekora-facet-swatch-size":"32px","--seekora-facet-count-bg":"#e9ecef","--seekora-facet-count-color":"#495057","--seekora-primary":"#3b82f6","--seekora-primary-text":"#ffffff"},Z=150,J="150ms ease-in-out",ee="200ms ease-in-out";const te=({title:e,items:r,renderItem:a,onItemClick:o,className:n,style:s,theme:i,layout:l="horizontal",currencySymbol:c="$"})=>{const{theme:d}=w(),u=i||{},p=()=>{switch(l){case"horizontal":return{flexShrink:0,width:"150px",scrollSnapAlign:"start"};case"grid":default:return{};case"list":return{display:"flex",gap:d.spacing.medium,padding:d.spacing.small,borderBottom:`1px solid ${d.colors.border}`}}};return t.createElement("div",{className:I(u.root,n),style:s},e&&t.createElement("h3",{className:u.title,style:{margin:`0 0 ${d.spacing.medium} 0`,fontSize:d.typography.fontSize.large,fontWeight:d.typography.fontWeight?.semibold||600,color:d.colors.text}},e),t.createElement("div",{className:u.list,style:(()=>{switch(l){case"horizontal":return{display:"flex",gap:d.spacing.medium,overflowX:"auto",scrollSnapType:"x mandatory",paddingBottom:d.spacing.small};case"grid":return{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:d.spacing.medium};case"list":return{display:"flex",flexDirection:"column",gap:d.spacing.small};default:return{}}})()},r.map((e,r)=>t.createElement("div",{key:e.id||r,className:u.item,onClick:()=>o?.(e,r),style:{...p(),cursor:o?"pointer":"default"}},a?a(e,r):t.createElement(re,{item:e,theme:u,currencySymbol:c,layout:l})))))},re=({item:e,theme:r,currencySymbol:a,layout:o})=>{const{theme:n}=w(),s=e.image||e.imageUrl||"",i=e.title||e.name||"",l=e.price,c="list"===o?"60px":"100%";return t.createElement(t.Fragment,null,s&&t.createElement("img",{src:s,alt:i,className:r.image,style:{width:c,height:"list"===o?"60px":"120px",objectFit:"cover",borderRadius:"string"==typeof n.borderRadius?n.borderRadius:n.borderRadius.small}}),t.createElement("div",{className:r.content,style:{flex:"list"===o?1:void 0}},t.createElement("div",{className:r.name,style:{marginTop:"list"===o?0:n.spacing.small,fontSize:n.typography.fontSize.small,fontWeight:n.typography.fontWeight?.medium||500,color:n.colors.text,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},i),void 0!==l&&t.createElement("div",{className:r.price,style:{marginTop:n.spacing.small,fontSize:n.typography.fontSize.small,fontWeight:n.typography.fontWeight?.bold||700,color:n.colors.primary}},a,"number"==typeof l?l.toFixed(2):l)))},ae="seekora_recent_searches",oe=10;function ne(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,JSON.stringify(t))}catch(e){d("Failed to save recent searches to localStorage",{error:e})}}function se(e){const t=e.query||e.text||String(e),r=e._highlightResult?.query?.value;return{query:t,popularity:e.popularity,count:e.instant_search?.exact_nb_hits??e.popularity??e.count,objectID:e.objectID,highlightedQuery:r?ie(r):void 0,categories:e.categories?.map(e=>({value:e.value||e.name,count:e.count,path:e.path})),facets:e.instant_search?.facets||e.facets,metadata:e}}function ie(e){return e.replace(/__ais-highlight__/g,"<mark>").replace(/__\/ais-highlight__/g,"</mark>")}function le(e){const t=e.metadata||{};return{id:e.id||e.objectID,objectID:e.objectID||e.id,title:e.title||e.name||e.productName||t.name||t.productName||"",name:e.name||e.title||t.name||t.productName||"",image:e.image||e.imageUrl||t.image||t.image_url||t.images?.[0]||"",price:e.price??e.sellPrice??t.sellPrice??t.price,currency:e.currency||t.currency||"",url:e.url||e.productId||t.url||t.productId||"",clicks:e.clicks,conversions:e.conversions,revenue:e.revenue,trend_score:e.trend_score,metadata:e.metadata||e}}function ce(e){return{id:e.id,label:e.label,filter:e.filter,products:e.products?.map(le)||[],nb_hits:e.nb_hits,processing_time_ms:e.processing_time_ms}}function de(e){const{client:r,query:a,enabled:o=!0,prefetch:n=!1,debounceMs:s=200,maxSuggestions:i=10,minQueryLength:c=1,includeDropdownRecommendations:d=!1,includeDropdownProductList:p=!0,includeFilteredTabs:m=!0,includeCategories:g=!0,includeFacets:f=!0,maxCategories:h=3,maxFacets:y=5,filteredTabs:b,minPopularity:v,timeRange:k,disableTypoTolerance:x,analyticsTags:E,enableRecentSearches:w=!0,maxRecentSearches:S=oe,recentSearchesKey:C=ae,onSuggestionsLoaded:R,onError:I}=e,[N,z]=t.useState([]),[T,M]=t.useState(!1),[A,_]=t.useState(null),[$,L]=t.useState(null),[P,D]=t.useState([]),[F,B]=t.useState(null),[W,q]=t.useState(0),[H,O]=t.useState(0),[j,V]=t.useState(0),[U,K]=t.useState(""),Q=t.useRef(null),G=t.useRef(null),X=t.useRef(!0);t.useEffect(()=>{if(w){const e=function(e){if("undefined"==typeof window)return[];try{const t=localStorage.getItem(e);return t?JSON.parse(t):[]}catch{return[]}}(C);D(e.slice(0,S))}return()=>{X.current=!1}},[w,C,S]);const Y=t.useCallback(async e=>{if(r){if(!e.trim()&&c>0)return z([]),void L(null);G.current&&G.current.abort(),G.current=new AbortController,M(!0),_(null);try{const t=await(r.getSuggestions?.(e,{hitsPerPage:i,include_dropdown_recommendations:d||b&&b.length>0,include_dropdown_product_list:p,include_filtered_tabs:m,include_categories:g,include_facets:f,max_categories:h,max_facets:y,filtered_tabs:b,min_popularity:v,time_range:k,disable_typo_tolerance:x,analytics_tags:E,returnFullResponse:!0}));if(!X.current)return;const a=(t.suggestions||[]).map(se);z(a);const o=t.extensions||{},n=t.results,s=Array.isArray(n?.[1]?.hits)?n[1].hits:[],c=s.length>0?s.map(e=>le(e)):[],u={trending_searches:Array.isArray(o.trending_searches)?o.trending_searches:[],top_searches:Array.isArray(o.top_searches)?o.top_searches:[],related_searches:Array.isArray(o.related_searches)?o.related_searches:[],trending_products:Array.isArray(o.trending_products)?o.trending_products.map(le):[],item_recommendations:Array.isArray(o.item_recommendations)?o.item_recommendations.map(le):[],product_hits:c.length>0?c:void 0,popular_brands:Array.isArray(o.popular_brands)?o.popular_brands:[],filtered_tabs:Array.isArray(o.filtered_tabs)?o.filtered_tabs.map(ce):[],processing_time_ms:"number"==typeof o.processing_time_ms?o.processing_time_ms:void 0,cached_at:"string"==typeof o.cached_at?o.cached_at:void 0};L(u);const w=t.raw,S=w?.results,C=S?.[0]??w??{},I=e=>"number"!=typeof e||Number.isNaN(e)?0:e,N=e=>"string"==typeof e?e:"";B("number"==typeof C.processingTimeMS?C.processingTimeMS:null),q(I(C.nbHits)||a.length),O(I(C.page)||0),V(I(C.nbPages)||1),K(N(C.query)||e),R&&R({suggestions:a,nbHits:I(C.nbHits)||a.length,page:I(C.page)||0,nbPages:I(C.nbPages)||1,hitsPerPage:I(C.hitsPerPage)||i,processingTimeMS:"number"==typeof C.processingTimeMS?C.processingTimeMS:void 0,query:N(C.query)||e,dropdownRecommendations:u,results:Array.isArray(t.results)?t.results:void 0,extensions:o}),l("Query suggestions loaded",{query:e,suggestionsCount:a.length,hasRecommendations:Object.keys(u).some(e=>Array.isArray(u[e])&&u[e].length>0)})}catch(t){if(!X.current)return;const r=t instanceof Error?t:new Error(String(t));if("AbortError"===r.name)return;const a=r.message||"";404===t?.response?.status||404===t?.status||/\(404\)/.test(a)?(l("Query suggestions not enabled for this store (404)"),z([]),L(null),_(null)):(u("Failed to fetch query suggestions",{query:e,error:r.message}),_(r),z([]),L(null),I&&I(r))}finally{X.current&&M(!1)}}},[r,c,i,d,p,m,g,f,h,y,b,v,k,x,E,R,I]),Z=t.useRef(!1);t.useEffect(()=>{n&&!Z.current&&(c>0||r?.getSuggestions&&(Z.current=!0,Y("")))},[n,r,c,Y]),t.useEffect(()=>(Q.current&&clearTimeout(Q.current),!o||a.length<c?n&&Z.current&&""===a?(M(!1),void _(null)):(z([]),L(null),M(!1),void _(null)):n&&Z.current&&""===a?void 0:(M(!0),Q.current=setTimeout(()=>{Y(a)},s),()=>{Q.current&&clearTimeout(Q.current)})),[a,o,n,c,s,Y]);const J=t.useCallback((e,t)=>{w&&e.trim()&&D(r=>{const a=r.filter(t=>t.query.toLowerCase()!==e.toLowerCase()),o=[{query:e.trim(),timestamp:Date.now(),resultsCount:t},...a].slice(0,S);return ne(C,o),o})},[w,S,C]),ee=t.useCallback(e=>{D(t=>{const r=t.filter(t=>t.query!==e);return ne(C,r),r})},[C]),te=t.useCallback(()=>{D([]),ne(C,[])},[C]),re=t.useCallback(async()=>{a.length>=c&&await Y(a)},[a,c,Y]),ie=$?.trending_searches||[],de=$?.top_searches||[],ue=$?.related_searches||[],pe=$?.popular_brands||[],me=$?.filtered_tabs||[],ge=t.useMemo(()=>{const e=$?.trending_products;if(e&&e.length>0)return e;const t=$?.item_recommendations;if(t&&t.length>0)return t;const r=$?.filtered_tabs?.[0];return r?.products&&r.products.length>0?r.products:$?.product_hits??[]},[$?.trending_products,$?.item_recommendations,$?.filtered_tabs,$?.product_hits]),fe=t.useMemo(()=>N.length>0||P.length>0||ie.length>0||de.length>0||ue.length>0||pe.length>0||me.length>0||ge.length>0,[N,P,ie,de,ue,pe,me,ge]),he=t.useCallback(()=>{const e=[];let t=0;return 0===a.length&&P.length>0&&P.forEach(r=>{e.push({type:"recent",index:t++,data:r})}),N.forEach(r=>{e.push({type:"suggestion",index:t++,data:r})}),ie.forEach(r=>{e.push({type:"trending",index:t++,data:r})}),ge.forEach(r=>{e.push({type:"product",index:t++,data:r})}),pe.forEach(r=>{e.push({type:"brand",index:t++,data:r})}),e},[a,P,N,ie,ge,pe]);return{suggestions:N,loading:T,error:A,dropdownRecommendations:$,trendingSearches:ie,topSearches:de,relatedSearches:ue,popularBrands:pe,filteredTabs:me,trendingProducts:ge,recentSearches:P,processingTimeMs:F,totalHits:W,currentPage:H,totalPages:j,originalQuery:U,addRecentSearch:J,removeRecentSearch:ee,clearRecentSearches:te,refetch:re,hasContent:fe,getAllNavigableItems:he}}const ue="150ms ease-in-out",pe=4,me={container:{backgroundColor:"var(--seekora-bg-surface, transparent)",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`var(--seekora-border-radius, ${8}px)`,boxShadow:"var(--seekora-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05))",maxHeight:"400px",overflowY:"auto",overflowX:"hidden"},sectionTitle:{fontSize:"12px",fontWeight:600,color:"var(--seekora-text-secondary, inherit)",textTransform:"uppercase",letterSpacing:"0.05em",padding:"8px 16px 4px",margin:0},suggestionItem:{display:"flex",alignItems:"center",padding:"10px 16px",cursor:"pointer",transition:`background-color ${ue}`,fontSize:"14px",color:"var(--seekora-text-primary, inherit)",gap:"12px"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, #f3f4f6)"},suggestionQuery:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},suggestionCount:{fontSize:"12px",color:"var(--seekora-text-secondary, #9ca3af)",marginLeft:"auto",flexShrink:0},highlight:{fontWeight:600,color:"var(--seekora-text-primary, inherit)",backgroundColor:"var(--seekora-highlight-bg, #fef3c7)",padding:"0 2px",borderRadius:pe/2+"px"},recentIcon:{width:"16px",height:"16px",color:"var(--seekora-text-secondary, #9ca3af)",flexShrink:0},removeButton:{padding:"4px",borderRadius:`${pe}px`,border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-secondary, #9ca3af)",opacity:0,transition:`opacity ${ue}, color ${ue}`},removeButtonVisible:{opacity:1},emptyState:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px 16px",color:"var(--seekora-text-secondary, inherit)",fontSize:"14px",textAlign:"center"},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, rgba(128,128,128,0.2))",margin:"4px 0"},footer:{borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",padding:"8px 16px",fontSize:"12px",color:"var(--seekora-text-secondary, inherit)",display:"flex",alignItems:"center",justifyContent:"space-between"},keyboardHint:{display:"flex",alignItems:"center",gap:"8px",fontSize:"11px"},keyboardKey:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"18px",padding:"0 4px",borderRadius:pe-1+"px",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",fontSize:"10px",fontWeight:500}},ge=({className:e,style:r})=>t.createElement("svg",{className:e,style:r,viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),fe=({className:e,style:r})=>t.createElement("svg",{className:e,style:r,viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),he=({className:e,style:r})=>t.createElement("svg",{className:e,style:r,viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})),ye=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,maxSuggestions:n=8,minQueryLength:s=1,debounceMs:i=200,showRecentSearches:l=!0,maxRecentSearches:c=5,showCounts:d=!0,showEmptyState:u=!0,highlight:p={enabled:!0,preTag:"<mark>",postTag:"</mark>"},keyboardNav:m={enabled:!0},animation:g={enabled:!0,duration:150,entrance:"fade"},classNames:f={},style:h,renderSuggestion:y,renderRecentSearch:b,renderEmpty:v,footer:k,position:x="absolute",width:E="100%",zIndex:S=1e3,closeOnClickOutside:C=!0,closeOnEscape:R=!0,ariaLabel:N="Search suggestions",onSuggestionSelect:z,onRecentSearchClick:T,onRecentSearchRemove:M,onOpen:A,onClose:_,onNavigate:$}=e,{client:L,theme:P}=w(),D=t.useRef(null),[F,B]=t.useState(-1),[W,q]=t.useState(!1),{suggestions:H,loading:O,error:j,recentSearches:V,addRecentSearch:U,removeRecentSearch:K,hasContent:Q}=de({client:L,query:a,enabled:o&&a.length>=s,debounceMs:i,maxSuggestions:n,minQueryLength:s,enableRecentSearches:l,maxRecentSearches:c}),G=t.useMemo(()=>{const e=[];return l&&0===a.length&&V.length>0&&V.slice(0,c).forEach(t=>{e.push({type:"recent",data:t})}),H.forEach(t=>{e.push({type:"suggestion",data:t})}),e},[H,V,a,l,c]);t.useEffect(()=>{if(o&&(Q||O))q(!0),A?.();else{if(g.enabled){const e=setTimeout(()=>q(!1),g.duration);return()=>clearTimeout(e)}q(!1),_?.()}},[o,Q,O,g.enabled,g.duration,A,_]),t.useEffect(()=>{B(-1)},[G.length]);const X=t.useCallback(()=>{m.enabled&&B(e=>{const t=e<G.length-1?e+1:0;return $?.("down",t),t})},[m.enabled,G.length,$]),Y=t.useCallback(()=>{m.enabled&&B(e=>{const t=e>0?e-1:G.length-1;return $?.("up",t),t})},[m.enabled,G.length,$]),Z=t.useCallback(()=>{if(F<0||F>=G.length)return;const e=G[F];if("recent"===e.type){const t=e.data;T?.(t)}else{const t=e.data;z?.(t),U(t.query,t.count)}},[F,G,T,z,U]),J=t.useCallback(()=>{B(-1)},[]);t.useImperativeHandle(r,()=>({selectActive:Z,navigateNext:X,navigatePrevious:Y,resetSelection:J,getActiveIndex:()=>F,getTotalItems:()=>G.length}),[Z,X,Y,J,F,G.length]),t.useEffect(()=>{if(!C||!o)return;const e=e=>{D.current&&!D.current.contains(e.target)&&_?.()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[C,o,_]);const ee=t.useCallback((e,r)=>{if(!p.enabled||!r)return e;return e.split(new RegExp(`(${r})`,"gi")).map((e,a)=>e.toLowerCase()===r.toLowerCase()?t.createElement("mark",{key:a,className:f.suggestionItemHighlight,style:me.highlight},e):e)},[p.enabled,f.suggestionItemHighlight]),te=t.useCallback(e=>e.highlightedQuery&&p.enabled?t.createElement("span",{dangerouslySetInnerHTML:{__html:e.highlightedQuery},style:{display:"inline"}}):ee(e.query,a),[p.enabled,ee,a]);if(!W&&!o)return null;const re=l&&0===a.length&&V.length>0,ae=H.length>0,oe=u&&!O&&!re&&!ae&&a.length>=s,ne=g.enabled?{opacity:o?1:0,transform:o?"translateY(0)":"translateY(-8px)",transition:`opacity ${g.duration}ms ease, transform ${g.duration}ms ease`}:{};return t.createElement("div",{ref:D,role:"listbox","aria-label":N,"aria-expanded":o,className:I("seekora-suggestions-dropdown",f.root,f.container),style:{position:x,width:E,zIndex:S,...me.container,...ne,...h}},re&&t.createElement("div",{className:I("seekora-suggestions-section",f.section,f.recentSearches)},t.createElement("div",{className:f.sectionTitle,style:me.sectionTitle},"Recent Searches"),V.slice(0,c).map((e,r)=>{const a=F===r;return t.createElement("div",{key:`recent-${e.query}-${r}`,role:"option","aria-selected":a,className:I(f.recentItem,a&&f.suggestionItemActive),onClick:()=>{T?.(e)},onMouseEnter:()=>B(r)},((e,r,a)=>b?b(e,r,a):t.createElement("div",{style:{...me.suggestionItem,...a?me.suggestionItemActive:{}}},t.createElement(fe,{style:me.recentIcon}),t.createElement("span",{style:me.suggestionQuery},e.query),t.createElement("button",{type:"button",onClick:t=>{t.stopPropagation(),K(e.query),M?.(e)},style:{...me.removeButton,...a?me.removeButtonVisible:{}},"aria-label":`Remove ${e.query} from recent searches`},t.createElement(he,null))))(e,r,a))})),re&&ae&&t.createElement("div",{style:me.divider}),ae&&t.createElement("div",{className:I("seekora-suggestions-section",f.section,f.suggestionsList)},a.length>0&&t.createElement("div",{className:f.sectionTitle,style:me.sectionTitle},"Suggestions"),H.map((e,r)=>{const o=re?V.length+r:r,n=F===o;return t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,className:I(f.suggestionItem,n&&f.suggestionItemActive),onClick:()=>{z?.(e),U(e.query,e.count)},onMouseEnter:()=>B(o)},((e,r,o)=>y?y(e,r,o,e=>ee(e,a)):t.createElement("div",{style:{...me.suggestionItem,...o?me.suggestionItemActive:{}}},t.createElement(ge,{style:me.recentIcon}),t.createElement("span",{style:me.suggestionQuery},te(e)),d&&void 0!==e.count&&t.createElement("span",{style:me.suggestionCount},e.count.toLocaleString())))(e,r,n))})),oe&&t.createElement("div",{className:f.emptyState,style:me.emptyState},v?v():t.createElement(t.Fragment,null,t.createElement(ge,{style:{width:24,height:24,marginBottom:8,opacity:.5}}),t.createElement("span",null,'No suggestions found for "',a,'"'))),k||m.enabled&&G.length>0?t.createElement("div",{className:f.footer,style:me.footer},k||t.createElement("div",{style:me.keyboardHint},t.createElement("span",{style:me.keyboardKey},"↑"),t.createElement("span",{style:me.keyboardKey},"↓"),t.createElement("span",null,"to navigate"),t.createElement("span",{style:me.keyboardKey},"↵"),t.createElement("span",null,"to select"),t.createElement("span",{style:me.keyboardKey},"esc"),t.createElement("span",null,"to close"))):null,t.createElement("style",null,'\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n .seekora-suggestions-dropdown mark {\n background-color: var(--seekora-highlight-bg, #fef3c7);\n font-weight: 600;\n padding: 0 2px;\n border-radius: 2px;\n }\n .seekora-suggestions-dropdown [role="option"]:hover button {\n opacity: 1;\n }\n '))}),be="150ms ease-in-out",ve=8,ke=9999,xe=[{id:"recent",title:"Recent Searches",maxItems:5,enabled:!0,order:1},{id:"suggestions",title:"Suggestions",maxItems:8,enabled:!0,order:2},{id:"trending",title:"Trending",maxItems:5,enabled:!0,order:3},{id:"categories",title:"Categories",maxItems:6,enabled:!1,order:4}],Ee={container:{backgroundColor:"var(--seekora-bg-surface, transparent)",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`var(--seekora-border-radius-lg, ${1.5*ve}px)`,boxShadow:"var(--seekora-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04))",overflow:"hidden"},header:{padding:"12px 16px",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))"},content:{overflowY:"auto",overflowX:"hidden"},sectionHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px 4px"},sectionTitle:{fontSize:"11px",fontWeight:600,color:"var(--seekora-text-tertiary, #9ca3af)",textTransform:"uppercase",letterSpacing:"0.05em",margin:0},sectionAction:{fontSize:"12px",color:"var(--seekora-primary, #3b82f6)",cursor:"pointer",textDecoration:"none",fontWeight:500},item:{display:"flex",alignItems:"flex-start",padding:"10px 16px",cursor:"pointer",transition:`background-color ${be}`,gap:"12px"},itemActive:{backgroundColor:"var(--seekora-bg-hover, #f3f4f6)"},itemIcon:{width:"18px",height:"18px",color:"var(--seekora-text-secondary, #6b7280)",flexShrink:0,marginTop:"2px"},itemContent:{flex:1,minWidth:0},itemQuery:{fontSize:"14px",color:"var(--seekora-text-primary, inherit)",fontWeight:500,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},itemCount:{fontSize:"12px",color:"var(--seekora-text-tertiary, #9ca3af)",flexShrink:0},categoriesContainer:{display:"flex",flexWrap:"wrap",gap:"6px",marginTop:"6px"},categoryPill:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"3px 8px",fontSize:"11px",fontWeight:500,color:"var(--seekora-text-secondary, inherit)",backgroundColor:"var(--seekora-bg-tertiary, rgba(255, 255, 255, 0.1))",borderRadius:1.5*ve+"px",cursor:"pointer",transition:`all ${be}`},categoryPillHover:{backgroundColor:"var(--seekora-primary-light, #dbeafe)",color:"var(--seekora-primary, #3b82f6)"},categoryCount:{color:"var(--seekora-text-tertiary, #9ca3af)"},trendingList:{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 16px"},trendingChip:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`${ke}px`,cursor:"pointer",transition:`all ${be}`},trendingChipHover:{borderColor:"var(--seekora-primary, #3b82f6)",backgroundColor:"var(--seekora-primary-light, #eff6ff)"},trendingIcon:{width:"14px",height:"14px",color:"var(--seekora-success, #10b981)"},trendingRank:{width:"18px",height:"18px",borderRadius:`${ke}px`,backgroundColor:"var(--seekora-primary, #3b82f6)",color:"white",fontSize:"10px",fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center"},removeButton:{padding:"4px",marginLeft:"auto",borderRadius:`${4}px`,border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-tertiary, #9ca3af)",opacity:0,transition:`opacity ${be}`},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, rgba(128,128,128,0.2))",margin:"4px 16px"},footer:{padding:"12px 16px",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",fontSize:"12px",color:"var(--seekora-text-secondary, inherit)"},emptyState:{padding:"32px 16px",textAlign:"center",color:"var(--seekora-text-secondary, inherit)"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fef9c3)",fontWeight:600,borderRadius:"2px",padding:"0 1px"}},we=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:Ee.itemIcon},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),Se=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:Ee.itemIcon},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),Ce=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:Ee.trendingIcon},t.createElement("path",{fillRule:"evenodd",d:"M12 7a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0V8.414l-4.293 4.293a1 1 0 01-1.414 0L8 10.414l-4.293 4.293a1 1 0 01-1.414-1.414l5-5a1 1 0 011.414 0L11 10.586 14.586 7H12z",clipRule:"evenodd"})),Re=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{width:14,height:14}},t.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})),Ie=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,sections:n=xe,maxSuggestionsPerSection:s=8,minQueryLength:i=0,debounceMs:l=200,includeDropdownRecommendations:c=!0,includeDropdownProductList:d=!0,includeFilteredTabs:u=!0,includeCategories:p=!0,maxCategories:m=3,showCounts:g=!0,showCategoryCounts:f=!0,showSectionHeaders:h=!0,classNames:y={},style:b,renderSuggestion:v,renderCategory:k,renderTrendingItem:x,renderRecentItem:E,header:S,footer:C,width:R="100%",maxHeight:N="480px",zIndex:z=1e3,ariaLabel:T="Search suggestions",analyticsTags:M,onSuggestionSelect:A,onCategoryClick:_,onRecentSearchClick:$,onRecentSearchRemove:L,onViewAllClick:P,onOpen:D,onClose:F}=e,{client:B}=w(),W=t.useRef(null),[q,H]=t.useState(-1),[O,j]=t.useState(null),{suggestions:V,loading:U,trendingSearches:K,topSearches:Q,recentSearches:G,addRecentSearch:X,removeRecentSearch:Y,hasContent:Z}=de({client:B,query:a,enabled:o,debounceMs:l,maxSuggestions:s,minQueryLength:i,includeDropdownRecommendations:c,includeDropdownProductList:d,includeFilteredTabs:u,includeCategories:p,maxCategories:m,analyticsTags:M,enableRecentSearches:!0}),J=t.useMemo(()=>n.filter(e=>!1!==e.enabled).sort((e,t)=>(e.order||0)-(t.order||0)),[n]),ee=e=>J.find(t=>t.id===e),te=t.useMemo(()=>{const e=[];return J.forEach((t,r)=>{switch(t.id){case"recent":0===a.length&&G.slice(0,t.maxItems||5).forEach(t=>{e.push({type:"recent",data:t,sectionIndex:r})});break;case"suggestions":V.slice(0,t.maxItems||s).forEach(t=>{e.push({type:"suggestion",data:t,sectionIndex:r})});break;case"trending":0===a.length&&(K.length>0?K:Q).slice(0,t.maxItems||5).forEach(t=>{e.push({type:"trending",data:t,sectionIndex:r})})}}),e},[J,a,G,V,K,Q,s]),re=t.useCallback(()=>{H(e=>e<te.length-1?e+1:0)},[te.length]),ae=t.useCallback(()=>{H(e=>e>0?e-1:te.length-1)},[te.length]),oe=t.useCallback(()=>{if(q<0||q>=te.length)return;const e=te[q];switch(e.type){case"recent":$?.(e.data);break;case"suggestion":A?.(e.data),X(e.data.query,e.data.count);break;case"trending":A?.({query:e.data.query,count:e.data.count}),X(e.data.query)}},[q,te,$,A,X]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>q,setActiveIndex:H,selectActive:oe,navigateNext:re,navigatePrevious:ae,getTotalItems:()=>te.length}),[q,oe,re,ae,te.length]);const ne=()=>{const e=ee("recent");return!e||a.length>0||0===G.length?null:t.createElement("div",{className:I("seekora-section","seekora-section-recent",y.section)},h&&t.createElement("div",{style:Ee.sectionHeader},t.createElement("h3",{style:Ee.sectionTitle},e.title||"Recent Searches"),G.length>(e.maxItems||5)&&t.createElement("button",{style:Ee.sectionAction,onClick:()=>P?.("recent")},"View all")),G.slice(0,e.maxItems||5).map((e,r)=>{const a=((e,t)=>{let r=0;for(const a of te){if(J[a.sectionIndex].id===e)return r+t;a.sectionIndex<J.findIndex(t=>t.id===e)&&r++}return r+t})("recent",r),o=q===a;return t.createElement("div",{key:`recent-${e.query}`,role:"option","aria-selected":o,style:{...Ee.item,...o?Ee.itemActive:{}},onClick:()=>{$?.(e)},onMouseEnter:()=>H(a),className:I(y.recentItem,o&&y.suggestionItemActive)},E?E(e):t.createElement(t.Fragment,null,t.createElement(Se,null),t.createElement("div",{style:Ee.itemContent},t.createElement("p",{style:Ee.itemQuery},e.query)),t.createElement("button",{style:Ee.removeButton,onClick:t=>{t.stopPropagation(),Y(e.query),L?.(e)},"aria-label":"Remove"},t.createElement(Re,null))))}))},se=()=>{const e=ee("suggestions");return e&&0!==V.length?t.createElement("div",{className:I("seekora-section","seekora-section-suggestions",y.section)},h&&a.length>0&&t.createElement("div",{style:Ee.sectionHeader},t.createElement("h3",{style:Ee.sectionTitle},e.title||"Suggestions")),V.slice(0,e.maxItems||s).map((e,r)=>{const o=te.findIndex((e,t)=>"suggestion"===e.type&&te.slice(0,t).filter(e=>"suggestion"===e.type).length===r),n=q===o;return t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,style:{...Ee.item,...n?Ee.itemActive:{}},onClick:()=>{A?.(e),X(e.query,e.count)},onMouseEnter:()=>H(o),className:I(y.suggestionItem,n&&y.suggestionItemActive)},v?v(e,n):t.createElement(t.Fragment,null,t.createElement(we,null),t.createElement("div",{style:Ee.itemContent},t.createElement("p",{style:Ee.itemQuery},(s=e.query,a?s.split(new RegExp(`(${a})`,"gi")).map((e,r)=>e.toLowerCase()===a.toLowerCase()?t.createElement("span",{key:r,style:Ee.highlight},e):e):s)),p&&e.categories&&e.categories.length>0&&t.createElement("div",{style:Ee.categoriesContainer},e.categories.slice(0,m).map((e,r)=>k?k(e):t.createElement("span",{key:`cat-${r}`,style:{...Ee.categoryPill,...O===e.value?Ee.categoryPillHover:{}},onClick:t=>{t.stopPropagation(),_?.(e)},onMouseEnter:()=>j(e.value),onMouseLeave:()=>j(null)},e.value,f&&void 0!==e.count&&t.createElement("span",{style:Ee.categoryCount},"(",e.count,")"))))),g&&void 0!==e.count&&t.createElement("span",{style:Ee.itemCount},e.count.toLocaleString())));var s})):null};if(!o)return null;return Z||U||0===a.length?t.createElement("div",{ref:W,role:"listbox","aria-label":T,className:I("seekora-rich-suggestions",y.root,y.container),style:{position:"absolute",width:R,zIndex:z,...Ee.container,...b}},S&&t.createElement("div",{style:Ee.header},S),t.createElement("div",{style:{...Ee.content,maxHeight:N}},J.map((e,r)=>{let o=null;switch(e.id){case"recent":o=ne();break;case"suggestions":o=se();break;case"trending":o=(()=>{const e=ee("trending"),r=K.length>0?K:Q;return!e||a.length>0||0===r.length?null:t.createElement("div",{className:I("seekora-section","seekora-section-trending",y.section)},h&&t.createElement("div",{style:Ee.sectionHeader},t.createElement("h3",{style:Ee.sectionTitle},e.title||"Trending")),t.createElement("div",{style:Ee.trendingList},r.slice(0,e.maxItems||5).map((e,r)=>{const a=te.findIndex((e,t)=>"trending"===e.type&&te.slice(0,t).filter(e=>"trending"===e.type).length===r),o=q===a;return x?x(e,r):t.createElement("button",{key:`trending-${e.query}`,style:{...Ee.trendingChip,...o?Ee.trendingChipHover:{}},onClick:()=>{A?.({query:e.query,count:e.count}),X(e.query)},onMouseEnter:()=>H(a),className:I(y.trendingItem,o&&y.suggestionItemActive)},t.createElement("span",{style:Ee.trendingRank},r+1),t.createElement("span",null,e.query),t.createElement(Ce,null))})))})()}return o?t.createElement(t.Fragment,{key:e.id},r>0&&t.createElement("div",{style:Ee.divider}),o):null}),!U&&a.length>0&&0===V.length&&t.createElement("div",{style:Ee.emptyState},t.createElement("p",null,'No suggestions found for "',a,'"'))),C&&t.createElement("div",{style:Ee.footer},C),t.createElement("style",null,'\n .seekora-rich-suggestions [role="option"]:hover button {\n opacity: 1;\n }\n .seekora-rich-suggestions mark {\n background-color: var(--seekora-highlight-bg, #fef9c3);\n font-weight: 600;\n border-radius: 2px;\n padding: 0 1px;\n }\n ')):null}),Ne="150ms ease-in-out",ze=4,Te=8,Me={container:{backgroundColor:"var(--seekora-bg-surface, transparent)",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`var(--seekora-border-radius-lg, ${1.5*Te}px)`,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden"},header:{padding:"12px 20px",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))"},content:{display:"flex",overflowY:"auto"},contentStacked:{flexDirection:"column"},suggestionsColumn:{borderRight:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",overflowY:"auto"},productsColumn:{flex:1,overflowY:"auto",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))"},section:{padding:"12px 0"},sectionHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 20px 8px"},sectionTitle:{fontSize:"11px",fontWeight:700,color:"var(--seekora-text-tertiary, #9ca3af)",textTransform:"uppercase",letterSpacing:"0.08em",margin:0},viewAllLink:{fontSize:"12px",color:"var(--seekora-primary, #3b82f6)",textDecoration:"none",fontWeight:600,cursor:"pointer"},suggestionItem:{display:"flex",alignItems:"center",padding:"10px 20px",cursor:"pointer",transition:`background-color ${Ne}`,gap:"12px"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, #f3f4f6)"},suggestionIcon:{width:"16px",height:"16px",color:"var(--seekora-text-secondary, #6b7280)",flexShrink:0},suggestionText:{flex:1,fontSize:"14px",color:"var(--seekora-text-primary, inherit)",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},suggestionArrow:{width:"16px",height:"16px",color:"var(--seekora-text-tertiary, #d1d5db)",opacity:0,transition:"opacity 100ms ease"},suggestionArrowVisible:{opacity:1},suggestionCount:{fontSize:"12px",color:"var(--seekora-text-tertiary, #9ca3af)"},tabsContainer:{display:"flex",gap:"4px",padding:"12px 20px",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",overflowX:"auto"},tab:{display:"flex",alignItems:"center",gap:"6px",padding:"8px 16px",fontSize:"13px",fontWeight:500,color:"var(--seekora-text-secondary, inherit)",backgroundColor:"transparent",border:"1px solid transparent",borderRadius:`${9999}px`,cursor:"pointer",whiteSpace:"nowrap",transition:`all ${Ne}`},tabActive:{color:"var(--seekora-primary, #3b82f6)",backgroundColor:"var(--seekora-primary-light, #eff6ff)",borderColor:"var(--seekora-primary, #3b82f6)"},tabCount:{fontSize:"11px",fontWeight:600,padding:"2px 6px",borderRadius:`${Te}px`,backgroundColor:"var(--seekora-bg-tertiary, rgba(255, 255, 255, 0.1))"},tabCountActive:{backgroundColor:"var(--seekora-primary, #3b82f6)",color:"white"},productsGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:"16px",padding:"16px 20px"},productCard:{display:"flex",flexDirection:"column",backgroundColor:"var(--seekora-bg-surface, transparent)",borderRadius:`${Te}px`,overflow:"hidden",cursor:"pointer",transition:`transform ${Ne}, box-shadow ${Ne}`,border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))"},productCardHover:{transform:"translateY(-2px)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)"},productImage:{width:"100%",aspectRatio:"1",objectFit:"cover",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"},productInfo:{padding:"10px"},productTitle:{fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",margin:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.3},productPrice:{fontSize:"14px",fontWeight:700,color:"var(--seekora-primary, #3b82f6)",marginTop:"4px"},brandsGrid:{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 20px 16px"},brandChip:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"8px 14px",fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",backgroundColor:"var(--seekora-bg-surface, transparent)",border:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:`${Te}px`,cursor:"pointer",transition:`all ${Ne}`},brandChipHover:{borderColor:"var(--seekora-primary, #3b82f6)",backgroundColor:"var(--seekora-primary-light, #eff6ff)"},brandLogo:{width:"20px",height:"20px",borderRadius:`${ze}px`,objectFit:"contain",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"},footer:{padding:"12px 20px",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",color:"var(--seekora-text-secondary, inherit)"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fef9c3)",fontWeight:600,padding:"0 2px",borderRadius:ze/2+"px"}},Ae=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Me.suggestionIcon,...e}},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),_e=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Me.suggestionIcon,...e}},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),$e=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Me.suggestionArrow,...e}},t.createElement("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})),Le=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",style:{width:"40%",height:"40%",color:"#d1d5db"}},t.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2",strokeWidth:"2"}),t.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5",strokeWidth:"2"}),t.createElement("polyline",{points:"21 15 16 10 5 21",strokeWidth:"2"})),Pe=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,maxSuggestions:n=8,maxProducts:s=8,maxBrands:i=8,minQueryLength:l=0,debounceMs:c=200,filteredTabs:d,showProducts:u=!0,showBrands:p=!0,showFilteredTabs:m=!0,showRecentSearches:g=!0,layout:f="side-by-side",productsColumnWidth:h="60%",suggestionsColumnWidth:y="40%",showPrices:b=!0,currencySymbol:v="$",classNames:k={},style:x,renderProduct:E,renderSuggestion:S,renderBrand:C,renderTab:R,header:N,footer:z,viewAllProductsLink:T,width:M="800px",maxHeight:A="600px",zIndex:_=1e3,analyticsTags:$,includeFacets:L=!0,includeCategories:P=!0,includeDropdownRecommendations:D=!0,onSuggestionSelect:F,onProductClick:B,onBrandClick:W,onTabSelect:q,onRecentSearchClick:H,onRecentSearchRemove:O,onViewAllClick:j,onOpen:V,onClose:U}=e,{client:K}=w(),Q=t.useRef(null),[G,X]=t.useState(-1),[Y,Z]=t.useState("all"),[J,ee]=t.useState(null),[te,re]=t.useState(null),{suggestions:ae,loading:oe,filteredTabs:ne,trendingProducts:se,popularBrands:ie,recentSearches:le,addRecentSearch:ce,removeRecentSearch:ue,hasContent:pe}=de({client:K,query:a,enabled:o,debounceMs:c,maxSuggestions:n,minQueryLength:l,includeDropdownRecommendations:D,includeCategories:P,includeFacets:L,filteredTabs:d,analyticsTags:$,enableRecentSearches:g}),me=t.useMemo(()=>{if("all"===Y){const e=[...se];return ne.forEach(t=>{t.products&&t.products.forEach(t=>{e.find(e=>e.id===t.id)||e.push(t)})}),e.slice(0,s)}const e=ne.find(e=>e.id===Y);return e?.products?.slice(0,s)||[]},[Y,ne,se,s]),ge=t.useMemo(()=>{const e=[];return 0===a.length&&g&&le.slice(0,5).forEach(t=>{e.push({type:"recent",data:t})}),ae.forEach(t=>{e.push({type:"suggestion",data:t})}),e},[a,g,le,ae]),fe=t.useCallback(()=>{X(e=>e<ge.length-1?e+1:0)},[ge.length]),he=t.useCallback(()=>{X(e=>e>0?e-1:ge.length-1)},[ge.length]),ye=t.useCallback(()=>{if(G<0||G>=ge.length)return;const e=ge[G];"recent"===e.type?H?.(e.data):"suggestion"===e.type&&(F?.(e.data),ce(e.data.query))},[G,ge,H,F,ce]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>G,setActiveIndex:X,selectActive:ye,navigateNext:fe,navigatePrevious:he,getActiveTab:()=>Y,setActiveTab:Z}),[G,ye,fe,he,Y]);const be=e=>{Z(e);const t=ne.find(t=>t.id===e);t&&q?.(t)};if(!o)return null;const ve=m&&(ne.length>0||se.length>0),ke=u&&me.length>0,xe=p&&ie.length>0,Ee=g&&0===a.length&&le.length>0,we=ae.length>0,Se="stacked"===f||"full-width"===f;return t.createElement("div",{ref:Q,role:"listbox","aria-label":"Search suggestions and products",className:I("seekora-federated-dropdown",k.root,k.container),style:{position:"absolute",width:M,zIndex:_,...Me.container,...x}},N&&t.createElement("div",{style:Me.header},N),ve&&t.createElement("div",{style:Me.tabsContainer,className:k.tabsList},t.createElement("button",{style:{...Me.tab,..."all"===Y?Me.tabActive:{}},onClick:()=>be("all"),className:I(k.tabItem,"all"===Y&&k.tabActive)},"All Results",se.length>0&&t.createElement("span",{style:{...Me.tabCount,..."all"===Y?Me.tabCountActive:{}}},se.length,"+")),ne.map(e=>R?R(e,Y===e.id):t.createElement("button",{key:e.id,style:{...Me.tab,...Y===e.id?Me.tabActive:{}},onClick:()=>be(e.id),className:I(k.tabItem,Y===e.id&&k.tabActive)},e.label,void 0!==e.nb_hits&&t.createElement("span",{style:{...Me.tabCount,...Y===e.id?Me.tabCountActive:{}}},e.nb_hits)))),t.createElement("div",{style:{...Me.content,...Se?Me.contentStacked:{},maxHeight:A}},t.createElement("div",{style:{...Me.suggestionsColumn,width:Se?"100%":y,minWidth:Se?void 0:"280px",borderRight:Se?"none":Me.suggestionsColumn.borderRight}},Ee&&t.createElement("div",{style:Me.section,className:k.recentSearches},t.createElement("div",{style:Me.sectionHeader},t.createElement("h3",{style:Me.sectionTitle},"Recent Searches")),le.slice(0,5).map((e,r)=>{const a=G===r;return t.createElement("div",{key:`recent-${e.query}`,role:"option","aria-selected":a,style:{...Me.suggestionItem,...a?Me.suggestionItemActive:{}},onClick:()=>H?.(e),onMouseEnter:()=>X(r),className:I(k.recentItem,a&&k.suggestionItemActive)},t.createElement(_e,null),t.createElement("span",{style:Me.suggestionText},e.query),t.createElement($e,{style:a?Me.suggestionArrowVisible:{}}))})),we&&t.createElement("div",{style:Me.section,className:k.suggestionsList},t.createElement("div",{style:Me.sectionHeader},t.createElement("h3",{style:Me.sectionTitle},a?"Suggestions":"Popular Searches")),ae.slice(0,n).map((e,r)=>{const o=Ee?le.length+r:r,n=G===o;return S?S(e,r,n):t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,style:{...Me.suggestionItem,...n?Me.suggestionItemActive:{}},onClick:()=>{F?.(e),ce(e.query)},onMouseEnter:()=>X(o),className:I(k.suggestionItem,n&&k.suggestionItemActive)},t.createElement(Ae,null),t.createElement("span",{style:Me.suggestionText},(s=e.query,a?s.split(new RegExp(`(${a})`,"gi")).map((e,r)=>e.toLowerCase()===a.toLowerCase()?t.createElement("span",{key:r,style:Me.highlight},e):e):s)),void 0!==e.count&&t.createElement("span",{style:Me.suggestionCount},e.count.toLocaleString()),t.createElement($e,{style:n?Me.suggestionArrowVisible:{}}));var s})),xe&&t.createElement("div",{style:Me.section,className:k.brandsList},t.createElement("div",{style:Me.sectionHeader},t.createElement("h3",{style:Me.sectionTitle},"Popular Brands")),t.createElement("div",{style:Me.brandsGrid},ie.slice(0,i).map((e,r)=>C?C(e,r):t.createElement("button",{key:`brand-${e.name}`,style:{...Me.brandChip,...te===e.name?Me.brandChipHover:{}},onClick:()=>W?.(e),onMouseEnter:()=>re(e.name),onMouseLeave:()=>re(null),className:k.brandItem},e.logo&&t.createElement("img",{src:e.logo,alt:e.name,style:Me.brandLogo,onError:e=>{e.target.style.display="none"}}),t.createElement("span",null,e.name)))))),ke&&!Se&&t.createElement("div",{style:{...Me.productsColumn,width:h}},t.createElement("div",{style:Me.section},t.createElement("div",{style:Me.sectionHeader},t.createElement("h3",{style:Me.sectionTitle},"all"===Y?"Trending Products":`Products in ${ne.find(e=>e.id===Y)?.label||Y}`),T&&t.createElement("a",{href:T,style:Me.viewAllLink,onClick:e=>{e.preventDefault(),j?.("products")}},"View all")),t.createElement("div",{style:Me.productsGrid,className:k.productsList},me.map((e,r)=>{return E?E(e,r):t.createElement("div",{key:e.id||e.objectID,style:{...Me.productCard,...J===e.id?Me.productCardHover:{}},onClick:()=>B?.(e),onMouseEnter:()=>ee(e.id),onMouseLeave:()=>ee(null),className:k.productItem},e.image?t.createElement("img",{src:e.image,alt:e.title||e.name||"",style:Me.productImage,onError:e=>{e.target.style.display="none"}}):t.createElement("div",{style:{...Me.productImage,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(Le,null)),t.createElement("div",{style:Me.productInfo},t.createElement("h4",{style:Me.productTitle},e.title||e.name),b&&void 0!==e.price&&t.createElement("p",{style:Me.productPrice},(a=e.price,o=e.currency,void 0===a?"":`${o||v}${a.toLocaleString()}`))));var a,o}))))),z?t.createElement("div",{style:Me.footer},z):t.createElement("div",{style:Me.footer},t.createElement("span",null,"Press ↵ to search, ↑↓ to navigate"),a&&t.createElement("button",{style:{...Me.viewAllLink,background:"none",border:"none"},onClick:()=>j?.("suggestions")},'See all results for "',a,'"')),t.createElement("style",null,'\n .seekora-federated-dropdown mark {\n background-color: var(--seekora-highlight-bg, #fef9c3);\n font-weight: 600;\n border-radius: 2px;\n padding: 0 2px;\n }\n .seekora-federated-dropdown [role="option"]:hover svg:last-child {\n opacity: 1;\n }\n '))}),De="suggestions.click",Fe="suggestions.impression",Be="suggestions.product_click",We="suggestions.category_click",qe="suggestions.brand_click",He="suggestions.tab_select",Oe="suggestions.recent_click",je="suggestions.trending_click",Ve="suggestions.search_submit",Ue="suggestions.dropdown_open",Ke="suggestions.dropdown_close";function Qe(e){const{client:r,enabled:a=!0,analyticsTags:o=[],impressionDebounce:n=500,trackImpressions:s=!0,trackClicks:i=!0,context:c}=e,u=t.useRef(null),p=t.useRef(null),m=t.useRef(null);t.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const g=t.useCallback(async(e,t,n)=>{if(!a||!r)return;const s=n??c;try{const{query:a,...n}=t,i=e.includes("search")||e===Ve;await(r.trackEvent?.({event_name:e,analytics_tags:o,...i&&a?{query:a}:{},metadata:{...n,timestamp:Date.now(),source:"suggestions_dropdown"}},s)),l(`Analytics: ${e}`,t)}catch(t){d(`Failed to track ${e}`,{error:t})}},[r,a,o,c]);return{trackSuggestionClick:t.useCallback(e=>{i&&g(De,{suggestion_query:e.suggestion.query,suggestion_id:e.suggestion.objectID,suggestion_popularity:e.suggestion.popularity,position:e.position,section:e.section||"suggestions",original_query:e.query,total_suggestions:e.totalSuggestions})},[g,i]),trackProductClick:t.useCallback(e=>{if(!i)return;g(Be,{product_id:e.product.id||e.product.objectID,product_title:e.product.title||e.product.name,product_price:e.product.price,position:e.position,section:e.section||"products",tab_id:e.tabId,original_query:e.query});const t=c;r?.trackClick&&Promise.resolve(r.trackClick(e.product.id||e.product.objectID||"",e.position+1,t)).catch(()=>{})},[r,c,g,i]),trackCategoryClick:t.useCallback((e,t)=>{i&&g(We,{category_value:e.value,category_count:e.count,category_path:e.path,original_query:t})},[g,i]),trackBrandClick:t.useCallback((e,t)=>{i&&g(qe,{brand_name:e.name,brand_count:e.count,original_query:t})},[g,i]),trackTabSelect:t.useCallback((e,t)=>{g(He,{tab_id:e.id,tab_label:e.label,tab_filter:e.filter,products_count:e.products?.length||0,nb_hits:e.nb_hits,original_query:t})},[g]),trackRecentSearchClick:t.useCallback(e=>{i&&g(Oe,{query:e.query,original_timestamp:e.timestamp,results_count:e.resultsCount})},[g,i]),trackTrendingClick:t.useCallback((e,t)=>{i&&g(je,{query:e.query,count:e.count,trend_score:e.trend_score,position:t})},[g,i]),trackImpression:t.useCallback(e=>{if(!s)return;const t=`${e.query}:${e.suggestions.length}:${e.products?.length||0}`;t!==p.current&&(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.current=t,g(Fe,{query:e.query,suggestions_count:e.suggestions.length,suggestions:e.suggestions.slice(0,10).map((e,t)=>({query:e.query,position:t,popularity:e.popularity})),products_count:e.products?.length||0,categories_count:e.categories?.length||0,brands_count:e.brands?.length||0,impression_timestamp:e.timestamp})},n))},[g,s,n]),trackSearchSubmit:t.useCallback((e,t,r)=>{g(Ve,{query:e,from_suggestion:t,suggestion_query:r?.query,suggestion_id:r?.objectID,suggestion_popularity:r?.popularity})},[g]),trackDropdownOpen:t.useCallback(e=>{m.current=Date.now(),g(Ue,{query:e,has_query:e.length>0})},[g]),trackDropdownClose:t.useCallback((e,t)=>{const r=m.current?Date.now()-m.current:null;g(Ke,{query:e,selected_suggestion:t,had_selection:!!t,duration_ms:r}),m.current=null},[g])}}const Ge={wrapper:{position:"relative",width:"100%"},inputWrapper:{display:"flex",alignItems:"center",backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius-lg, 8px)",overflow:"hidden",transition:"border-color 150ms ease, box-shadow 150ms ease"},inputWrapperFocused:{borderColor:"var(--seekora-border-focus, var(--seekora-primary, #3b82f6))",boxShadow:"0 0 0 3px var(--seekora-border-focus-alpha, var(--seekora-primary-light, rgba(59, 130, 246, 0.1)))"},input:{flex:1,padding:"12px 16px",fontSize:"16px",border:"none",outline:"none",backgroundColor:"transparent",color:"var(--seekora-text-primary, #111827)",fontFamily:"inherit"},searchIcon:{width:"20px",height:"20px",color:"var(--seekora-text-secondary, #9ca3af)",marginLeft:"12px",flexShrink:0},clearButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",marginRight:"4px",padding:0,border:"none",backgroundColor:"transparent",color:"var(--seekora-text-secondary, #9ca3af)",borderRadius:"50%",cursor:"pointer",transition:"background-color 150ms ease, color 150ms ease"},searchButton:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"12px 20px",margin:"4px",border:"none",backgroundColor:"var(--seekora-primary, #3b82f6)",color:"var(--seekora-primary-text, white)",borderRadius:"var(--seekora-border-radius, 6px)",fontSize:"14px",fontWeight:600,cursor:"pointer",transition:"background-color 150ms ease"}},Xe=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:Ge.searchIcon},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),Ye=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{width:16,height:16}},t.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})),Ze=t.forwardRef(function(e,r){const{variant:a="classic",placeholder:o="Powered by Seekora",initialQuery:n="",value:s,onQueryChange:i,onSearch:l,onSuggestionSelect:c,onProductClick:d,showSearchButton:u=!1,searchButtonText:p="Search",showClearButton:m=!0,autoFocus:g=!1,minQueryLength:f=1,maxSuggestions:h=8,maxProducts:y=8,debounceMs:b=200,showRecentSearches:v=!0,showTrendingOnEmpty:k=!0,includeDropdownRecommendations:x=!1,filteredTabs:E,enableAnalytics:S=!0,analyticsTags:C,includeFacets:R,includeCategories:N,dropdownWidth:z,dropdownMaxHeight:T,classNames:M={},style:A,inputStyle:_,ariaLabel:$="Search"}=e,{client:L}=w(),P=t.useRef(null),D=t.useRef(null),[F,B]=t.useState(s??n),[W,q]=t.useState(!1),[H,O]=t.useState(!1),j=Qe({client:L,enabled:S,analyticsTags:C});t.useEffect(()=>{void 0!==s&&s!==F&&B(s)},[s]);const V=t.useCallback(e=>{const t=e.target.value;B(t),i?.(t),(t.length>=f||k&&0===t.length)&&O(!0)},[i,f,k]),U=t.useCallback(e=>{e?.preventDefault(),F.trim()&&(l?.(F.trim()),j.trackSearchSubmit(F.trim(),!1),O(!1))},[F,l,j]),K=t.useCallback(e=>{B(e.query),i?.(e.query),c?.(e),j.trackSuggestionClick({suggestion:e,position:0,query:F}),O(!1),l?.(e.query)},[F,i,c,l,j]),Q=t.useCallback(e=>{d?.(e),j.trackProductClick({product:e,position:0,query:F}),O(!1)},[F,d,j]),G=t.useCallback(e=>{B(e.query),i?.(e.query),j.trackRecentSearchClick(e),O(!1),l?.(e.query)},[i,l,j]),X=t.useCallback(()=>{q(!0),O(!0),j.trackDropdownOpen(F)},[F,j]),Y=t.useCallback(()=>{q(!1),setTimeout(()=>{O(!1),j.trackDropdownClose(F)},200)},[F,j]),Z=t.useCallback(()=>{B(""),i?.(""),P.current?.focus()},[i]),J=t.useCallback(e=>{if(H)switch(e.key){case"ArrowDown":e.preventDefault(),D.current?.navigateNext?.();break;case"ArrowUp":e.preventDefault(),D.current?.navigatePrevious?.();break;case"Enter":e.preventDefault(),(D.current?.getActiveIndex?.()??-1)>=0?D.current?.selectActive?.():U();break;case"Escape":e.preventDefault(),O(!1),P.current?.blur()}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||O(!0)},[H,U]);t.useImperativeHandle(r,()=>({focus:()=>P.current?.focus(),blur:()=>P.current?.blur(),clear:Z,getQuery:()=>F,setQuery:e=>{B(e),i?.(e)},openDropdown:()=>O(!0),closeDropdown:()=>O(!1),navigateNext:()=>D.current?.navigateNext?.(),navigatePrevious:()=>D.current?.navigatePrevious?.(),selectCurrent:()=>D.current?.selectActive?.()}),[F,Z,i]);return t.createElement("div",{className:I("seekora-search-bar-with-suggestions",M.wrapper),style:{...Ge.wrapper,...A}},t.createElement("form",{onSubmit:U},t.createElement("div",{style:{...Ge.inputWrapper,...W?Ge.inputWrapperFocused:{}}},t.createElement(Xe,null),t.createElement("input",{ref:P,type:"text",value:F,onChange:V,onFocus:X,onBlur:Y,onKeyDown:J,placeholder:o,autoFocus:g,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":$,"aria-expanded":H,"aria-haspopup":"listbox","aria-autocomplete":"list",role:"combobox",className:M.input,style:{...Ge.input,..._}}),m&&F&&t.createElement("button",{type:"button",onClick:Z,className:M.clearButton,style:Ge.clearButton,"aria-label":"Clear search"},t.createElement(Ye,null)),u&&t.createElement("button",{type:"submit",className:M.button,style:Ge.searchButton},p))),t.createElement("div",{className:M.dropdown},(()=>{const e={query:F,isOpen:H,maxSuggestions:h,minQueryLength:f,debounceMs:b,showRecentSearches:v,classNames:M,onSuggestionSelect:K,onRecentSearchClick:G,onClose:()=>O(!1),analyticsTags:C};switch(a){case"rich":return t.createElement(Ie,{ref:D,...e,includeDropdownRecommendations:x,includeCategories:!0,width:z||"100%",maxHeight:T||"480px"});case"federated":return t.createElement(Pe,{ref:D,...e,maxProducts:y,filteredTabs:E,showProducts:!0,showBrands:!0,showFilteredTabs:!!E,onProductClick:Q,width:z||"800px",maxHeight:T||"600px",includeFacets:R,includeCategories:N,includeDropdownRecommendations:x});case"compact":return t.createElement(ye,{ref:D,...e,maxSuggestions:5,showCounts:!1,width:z||"100%"});default:return t.createElement(ye,{ref:D,...e,width:z||"100%"})}})()))}),Je=t.createContext(null);function et(){const e=t.useContext(Je);if(!e){const e=new Error("useSuggestionsContext must be used within a SuggestionsProvider");throw u("SuggestionsContext: not available",{error:e.message}),e}return e}function tt({children:e,minQueryLength:r=1,debounceMs:a=200,maxSuggestions:o=10,includeDropdownRecommendations:n=!0,filteredTabs:s,enableAnalytics:i=!0,analyticsTags:l,onSearch:c,onSuggestionSelect:d,onProductClick:u}){const{client:p}=w(),[m,g]=t.useState(""),[f,h]=t.useState(!1),[y,b]=t.useState(-1),[v,k]=t.useState(""),[x,E]=t.useState([]),S=t.useRef(!1);t.useEffect(()=>{!S.current&&p?.search&&(S.current=!0,p.search("*",{per_page:12,page:1}).then(e=>{const t=e?.data,r=t?.results||t?.data||e?.results||e?.hits||[];Array.isArray(r)&&r.length>0&&E(r)}).catch(()=>{}))},[p]);const C=de({client:p,query:m,enabled:f,prefetch:0===r,minQueryLength:r,debounceMs:a,maxSuggestions:o,includeDropdownRecommendations:n,filteredTabs:s,includeCategories:!0,enableRecentSearches:!0,maxRecentSearches:8,analyticsTags:l}),R=Qe({client:p,enabled:i,analyticsTags:l,trackClicks:!0,trackImpressions:!0}),{suggestions:I,recentSearches:N,trendingSearches:z,trendingProducts:T,filteredTabs:M,loading:A,error:_,hasContent:$,getAllNavigableItems:L,addRecentSearch:P,clearRecentSearches:D}=C,F=t.useCallback(()=>{const e=L();if(e.some(e=>"product"===e.type))return e;if(x.length>0){let t=e.length;x.forEach(r=>{e.push({type:"product",index:t++,data:r})})}return e},[L,x]),B=t.useRef(c),W=t.useRef(d),q=t.useRef(u);B.current=c,W.current=d,q.current=u;const H=t.useCallback(e=>{g(e),b(-1)},[]),O=t.useCallback(()=>{R.trackDropdownClose(m),h(!1),b(-1)},[R,m]),j=t.useCallback(e=>{e?(h(!0),R.trackDropdownOpen(m)):O()},[R,m,O]),V=t.useCallback((e,t)=>{R.trackSuggestionClick({suggestion:e,position:t,query:m,totalSuggestions:I.length}),H(e.query),W.current?.(e),R.trackSearchSubmit(e.query,!0,e),P(e.query),O(),B.current?.(e.query)},[R,m,I.length,P,O]),U=t.useCallback((e,t,r,a)=>{R.trackProductClick({product:e,position:t,section:r??"products",tabId:a,query:m}),O(),q.current?.(e)},[R,m,O]),K=t.useCallback(e=>{R.trackRecentSearchClick(e),H(e.query),O(),B.current?.(e.query),R.trackSearchSubmit(e.query,!1)},[R,O]),Q=t.useCallback((e,t)=>{R.trackTrendingClick(e,t),H(e.query),O(),B.current?.(e.query),R.trackSearchSubmit(e.query,!1)},[R,O]),G=t.useCallback(e=>{k(e.id),R.trackTabSelect(e,m)},[R,m]),X=t.useCallback((e,t,r)=>{const a=e.trim();a&&(R.trackSearchSubmit(a,!!t,r),P(a),O(),B.current?.(a))},[R,P,O]),Y=t.useCallback(()=>{const e=F();0!==e.length&&b(t=>t<e.length-1?t+1:0)},[F]),Z=t.useCallback(()=>{const e=F();0!==e.length&&b(t=>t<=0?e.length-1:t-1)},[F]),J=t.useCallback(()=>{const e=F();if(y<0||y>=e.length)return void X(m);const t=e[y];switch(t.type){case"suggestion":V(t.data,t.index);break;case"product":U(t.data,t.index,"products");break;case"recent":K(t.data);break;case"trending":Q(t.data,t.index);break;default:X(m)}},[y,F,m,X,V,U,K,Q]);t.useEffect(()=>{f&&$&&m&&R.trackImpression({suggestions:I,products:T,query:m,timestamp:Date.now()})},[f,$,m,I,T,R]);const ee=t.useMemo(()=>({query:m,setQuery:H,isOpen:f,setIsOpen:j,activeIndex:y,setActiveIndex:b,suggestions:I,recentSearches:N,trendingSearches:z,trendingProducts:T,prefetchedProducts:x,filteredTabs:M,activeTabId:v,setActiveTabId:k,loading:A,error:_,hasContent:$,getAllNavigableItems:F,selectSuggestion:V,selectProduct:U,selectRecentSearch:K,selectTrendingSearch:Q,setActiveTab:G,submitSearch:X,clearRecentSearches:D,close:O,navigateNext:Y,navigatePrev:Z,selectActive:J}),[m,H,f,j,y,b,I,N,z,T,x,M,v,k,A,_,$,F,V,U,K,Q,G,X,D,O,Y,Z,J]);return t.createElement(Je.Provider,{value:ee},e)}const rt=8,at="150ms ease-in-out",ot={position:"relative",width:"100%"},nt={display:"flex",alignItems:"center",gap:`${rt}px`,padding:`${rt}px ${12}px`,border:"1px solid var(--seekora-border-color, rgba(0,0,0,0.1))",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:"var(--seekora-bg-surface, transparent)",transition:`border-color ${at}, box-shadow ${at}`,boxSizing:"border-box"},st={flex:1,minWidth:0,padding:`${rt}px 0`,border:"none",outline:"none",backgroundColor:"transparent",fontSize:"inherit",color:"var(--seekora-text-primary, inherit)",fontFamily:"inherit"};function it({placeholder:e="Powered by Seekora",autoFocus:r=!1,showClearButton:a=!0,closeOnBlur:o=!0,leftIcon:n,className:s,style:i,inputClassName:l,inputStyle:c,ariaLabel:d="Search"}){const{query:u,setQuery:p,isOpen:m,setIsOpen:g,navigateNext:f,navigatePrev:h,selectActive:y,close:b}=et(),v=t.useRef(null),k=t.useCallback(()=>{g(!0)},[g]),x=t.useCallback(()=>{o&&setTimeout(()=>b(),200)},[b,o]),E=t.useCallback(e=>{p(e.target.value)},[p]),w=t.useCallback(e=>"ArrowDown"===e.key?(e.preventDefault(),void f()):"ArrowUp"===e.key?(e.preventDefault(),void h()):"Enter"===e.key?(e.preventDefault(),void y()):"Escape"===e.key?(e.preventDefault(),b(),void v.current?.blur()):void 0,[f,h,y,b]),S=t.useCallback(()=>{p(""),v.current?.focus()},[p]);return t.createElement("div",{className:I("seekora-suggestions-search-input-wrapper",s),style:{...ot,...i}},t.createElement("div",{className:"seekora-suggestions-input-wrapper",style:nt},n?t.createElement("span",{className:"seekora-suggestions-input-left-icon",style:{display:"flex",flexShrink:0,color:"inherit",opacity:.5}},n):null,t.createElement("input",{ref:v,type:"text",value:u,onChange:E,onFocus:k,onBlur:x,onKeyDown:w,placeholder:e,autoFocus:r,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":d,"aria-expanded":m,"aria-haspopup":"listbox","aria-autocomplete":"list",role:"combobox",className:I("seekora-suggestions-input",l),style:{...st,...c}}),a&&u?t.createElement("button",{type:"button",onClick:S,className:"seekora-suggestions-input-clear","aria-label":"Clear search",style:{padding:8,border:"none",background:"transparent",cursor:"pointer",color:"inherit",opacity:.5,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(lt,null)):null))}function lt(){return t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0},t.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))}const ct=6,dt=100;function ut({children:e,position:r="absolute",top:a="100%",left:o=0,right:n,width:s="100%",maxHeight:i="80vh",zIndex:l=dt,className:c,style:d,closeOnClickOutside:u=!0,closeOnEscape:p=!0}){const{isOpen:m,close:g}=et(),f=t.useRef(null);t.useEffect(()=>{if(!p||!m)return;const e=e=>{"Escape"===e.key&&g()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p,m,g]);const h=t.useCallback(e=>{if(!u||!f.current)return;const t=e.target;f.current.contains(t)||g()},[u,g]);if(t.useEffect(()=>{if(m)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[m,h]),!m)return null;const y={position:r,top:a,left:o,right:n,width:s,maxHeight:i,zIndex:l,overflow:"auto",backgroundColor:"var(--seekora-bg-surface, #fff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:`var(--seekora-border-radius, ${ct}px)`,boxShadow:"var(--seekora-shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05))",marginTop:4};return t.createElement("div",{ref:f,role:"listbox",className:I("seekora-suggestions-dropdown-panel",c),style:{...y,...d}},e)}const pt={backgroundColor:"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))",fontWeight:500,borderRadius:"2px",padding:"0 2px"};function mt(e,r={}){if(null==e||"string"!=typeof e)return e;const a=e.split(/(<mark>[\s\S]*?<\/mark>)/g);if(a.length<=1)return e;const{markClassName:o,markStyle:n,highlightTag:s}=r,i=s||"mark",l=r.highlightColor||r.highlightTextColor||r.highlightFontWeight||r.highlightStyle?function(e){const t={};switch(e.highlightStyle||"background"){case"background":t.backgroundColor=e.highlightColor||"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))",t.borderRadius="2px",t.padding="0 2px";break;case"underline":t.textDecoration="underline",t.textDecorationColor=e.highlightColor||"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.8))",t.textUnderlineOffset="2px"}return e.highlightTextColor?t.color=e.highlightTextColor:t.color="var(--seekora-highlight-color, inherit)",t.fontWeight=e.highlightFontWeight||"var(--seekora-highlight-weight, 500)",t}(r):pt;return t.createElement(t.Fragment,null,a.map((e,r)=>{const a=e.match(/^<mark>([\s\S]*)<\/mark>$/);return a?t.createElement(i,{key:r,className:o,style:{...l,...n}},a[1]):e}))}const gt={padding:"10px 12px",cursor:"pointer",listStyle:"none",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"inherit",transition:"background-color 120ms ease",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function ft({suggestion:e,index:r,isActive:a,onSelect:o,className:n,style:s,enableHighlightMarkup:i=!0,highlightMarkupOptions:l,renderHighlight:c}){const[d,u]=t.useState(!1),p=e.highlightedQuery??e.query,m=null!=c?c(p):i?mt(p??"",l):e.query??p??"",g=a||d;return t.createElement("li",{role:"option","aria-selected":a,id:`seekora-suggestion-${r}`,className:I("seekora-suggestions-item",a&&"seekora-suggestions-item--active",d&&"seekora-suggestions-item--hover",n),style:{...gt,...g?{backgroundColor:"var(--seekora-bg-hover, rgba(0,0,0,0.05))"}:{},...s},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onMouseDown:e=>{e.preventDefault(),o()}},m,null!=e.count?t.createElement("span",{className:"seekora-suggestions-item-count",style:{marginLeft:8,color:"inherit",opacity:.6,fontSize:"0.875em"}},e.count):null)}const ht={margin:0,padding:"4px 0"};function yt({maxItems:e=10,className:r,style:a,listClassName:o,enableHighlightMarkup:n=!0,highlightMarkupOptions:s,renderItem:i}){const{suggestions:l,activeIndex:c,loading:d,selectSuggestion:u,getAllNavigableItems:p}=et(),m=l.slice(0,e),g=p().findIndex(e=>"suggestion"===e.type),f=g>=0&&c>=g&&c<g+m.length;return 0===m.length?null:t.createElement("div",{className:I("seekora-suggestions-list",r),style:a},t.createElement("ul",{className:I("seekora-suggestions-list-ul",o),style:ht,role:"listbox"},m.map((e,r)=>{const a=g>=0?g+r:r,o=f&&c===a,l=()=>u(e,a);return i?t.createElement("li",{key:e.objectID??e.query??r,role:"option"},i(e,a,o,l)):t.createElement(ft,{key:e.objectID??e.query??r,suggestion:e,index:a,isActive:o,onSelect:l,enableHighlightMarkup:n,highlightMarkupOptions:s})})))}function bt({src:e,alt:a="",mode:o="both",zoomLevel:n=2.5,className:s,style:i,showZoomIndicator:l=!0,lensSize:c=150,zoomPanelSize:d={width:400,height:400},images:u,currentIndex:p=0}){const[m,g]=t.useState(!1),[f,h]=t.useState(!1),[y,b]=t.useState(p),[v,k]=t.useState({x:0,y:0}),[x,E]=t.useState(!1),[w,S]=t.useState(null),[C,R]=t.useState(null),N=t.useRef(null),z=t.useRef(null),T=u&&u.length>0?u:[e],M=T.length>1,A="hover"===o||"both"===o,_="click"===o||"both"===o,$="lens"===o,L=t.useCallback(e=>{if(!z.current)return;const t=z.current.getBoundingClientRect(),r=e.clientX-t.left,a=e.clientY-t.top;k({x:r,y:a})},[]),P=t.useCallback(()=>{g(!0)},[]),D=t.useCallback(()=>{g(!1)},[]),F=t.useCallback(e=>{_&&(e?.stopPropagation(),b(p),h(!0))},[_,p]),B=t.useCallback(e=>{e?.stopPropagation(),h(!1)},[]),W=t.useCallback(()=>{b(e=>(e+1)%T.length)},[T.length]),q=t.useCallback(()=>{b(e=>(e-1+T.length)%T.length)},[T.length]),H=t.useCallback(e=>{R(null),S(e.targetTouches[0].clientX)},[]),O=t.useCallback(e=>{R(e.targetTouches[0].clientX)},[]),j=t.useCallback(()=>{if(!w||!C)return;const e=w-C,t=e<-50;e>50?W():t&&q()},[w,C,50,W,q]);t.useEffect(()=>{if(!f)return;const e=e=>{"Escape"===e.key&&B(),M&&("ArrowRight"===e.key&&W(),"ArrowLeft"===e.key&&q())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[f,B,M,W,q]);const V={position:"relative",display:"inline-block",cursor:_?"zoom-in":A||$?"crosshair":"default",overflow:"hidden",...i},U={width:"100%",height:"100%",objectFit:i?.objectFit??"cover",display:"block"},K=t.useCallback(()=>{if(!z.current)return{indL:0,indT:0,indW:0,indH:0};const e=z.current.getBoundingClientRect(),t=e.width/n,r=d.height/d.width*e.width/n;return{indL:Math.max(0,Math.min(e.width-t,v.x-t/2)),indT:Math.max(0,Math.min(e.height-r,v.y-r/2)),indW:t,indH:r}},[v,n,d]);return t.createElement(t.Fragment,null,t.createElement("div",{ref:z,className:I("seekora-image-zoom",s),style:V,onMouseMove:L,onMouseEnter:P,onMouseLeave:D,onClick:F},t.createElement("img",{ref:N,src:e,alt:a,style:U,onLoad:()=>E(!0)}),l&&_&&t.createElement("div",{style:{position:"absolute",top:8,right:8,width:32,height:32,borderRadius:"50%",backgroundColor:"var(--seekora-zoom-indicator-bg, rgba(0,0,0,0.6))",color:"var(--seekora-zoom-indicator-text, #fff)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",pointerEvents:"none",opacity:m?1:.7,transition:"opacity 150ms"}},"🔍"),$&&m&&x&&t.createElement("div",{style:z.current?{position:"absolute",width:c,height:c,left:v.x-c/2,top:v.y-c/2,border:"var(--seekora-lens-border, 2px solid rgba(255,255,255,0.8))",borderRadius:"50%",boxShadow:"var(--seekora-lens-shadow, 0 0 0 1px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.3))",pointerEvents:"none",overflow:"hidden",zIndex:100}:{display:"none"}},t.createElement("img",{src:e,alt:"",style:(()=>{if(!z.current||!N.current)return{};const e=z.current.getBoundingClientRect();return{position:"absolute",width:e.width*n,height:e.height*n,left:-(v.x*n-c/2),top:-(v.y*n-c/2),objectFit:"cover"}})()})),A&&m&&x&&z.current&&(()=>{const{indL:e,indT:r,indW:a,indH:o}=K();return t.createElement("div",{style:{position:"absolute",left:e,top:r,width:a,height:o,border:"var(--seekora-hover-area-border, 2px solid rgba(0,0,0,0.3))",backgroundColor:"var(--seekora-hover-area-bg, rgba(255,255,255,0.1))",pointerEvents:"none",zIndex:50}})})()),A&&m&&x&&"undefined"!=typeof document&&r.createPortal(t.createElement("div",{style:(()=>{if(!z.current||!x)return{display:"none"};const t=z.current.getBoundingClientRect(),{indL:r,indT:a,indW:o,indH:s}=K(),i=t.width-o>0?r/(t.width-o)*100:0,l=t.height-s>0?a/(t.height-s)*100:0,c=window.innerWidth,u=window.innerHeight,p=16,m=t.left+v.x,g=t.top+v.y,f=c-t.right-p,h=t.left-p;let y,b=t.top;y=f>=d.width?t.right+p:h>=d.width?t.left-d.width-p:f>h?t.right+p:Math.max(p,t.left-d.width-p),t.top+d.height>u-p&&(b=Math.max(p,u-d.height-p));const k=y+d.width,E=b+d.height;return m>=y-50&&m<=k+50&&g>=b-50&&g<=E+50&&(y>t.right&&h>=d.width?y=t.left-d.width-p:y<t.left&&f>=d.width&&(y=t.right+p)),y=Math.max(p,Math.min(y,c-d.width-p)),b=Math.max(p,Math.min(b,u-d.height-p)),{position:"fixed",top:b,left:y,width:d.width,height:d.height,backgroundImage:`url(${e})`,backgroundSize:100*n+"%",backgroundPosition:`${i}% ${l}%`,backgroundRepeat:"no-repeat",border:"2px solid var(--seekora-border-color, #e5e7eb)",borderRadius:8,boxShadow:"var(--seekora-zoom-panel-shadow, 0 8px 24px rgba(0,0,0,0.2))",backgroundColor:"var(--seekora-zoom-panel-bg, #fff)",pointerEvents:"none",zIndex:9998}})()}),document.body),f&&"undefined"!=typeof document&&r.createPortal(t.createElement("div",{className:"seekora-image-zoom-lightbox",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"var(--seekora-lightbox-bg, rgba(0,0,0,0.95))",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out",padding:20},onClick:B,onTouchStart:M?H:void 0,onTouchMove:M?O:void 0,onTouchEnd:M?j:void 0},t.createElement("button",{type:"button","aria-label":"Close zoom",style:{position:"absolute",top:20,right:20,width:44,height:44,borderRadius:"50%",border:"none",backgroundColor:"var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))",color:"var(--seekora-lightbox-btn-text, #fff)",fontSize:"1.5rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),B()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))"}},"✕"),M&&t.createElement(t.Fragment,null,t.createElement("button",{type:"button","aria-label":"Previous image",style:{position:"absolute",left:20,top:"50%",transform:"translateY(-50%)",width:56,height:56,borderRadius:"50%",border:"none",backgroundColor:"var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))",color:"var(--seekora-lightbox-btn-text, #fff)",fontSize:"2rem",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),q()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))"}},"‹"),t.createElement("button",{type:"button","aria-label":"Next image",style:{position:"absolute",right:20,top:"50%",transform:"translateY(-50%)",width:56,height:56,borderRadius:"50%",border:"none",backgroundColor:"var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))",color:"var(--seekora-lightbox-btn-text, #fff)",fontSize:"2rem",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),W()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg-hover, rgba(255,255,255,0.3))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-lightbox-btn-bg, rgba(255,255,255,0.2))"}},"›")),t.createElement("img",{src:T[y],alt:a,style:{maxWidth:"90%",maxHeight:"90%",objectFit:"contain",borderRadius:4,cursor:"default"},onClick:e=>e.stopPropagation()}),M&&t.createElement("div",{style:{position:"absolute",bottom:20,left:"50%",transform:"translateX(-50%)",display:"flex",flexDirection:"column",alignItems:"center",gap:12},onClick:e=>e.stopPropagation()},t.createElement("div",{style:{display:"flex",gap:8,overflowX:"auto",maxWidth:"80vw",padding:"8px 0"}},T.map((e,r)=>t.createElement("button",{key:r,type:"button",onClick:e=>{e.stopPropagation(),b(r)},style:{width:60,height:60,padding:0,border:r===y?"var(--seekora-lightbox-thumb-border-active, 3px solid #fff)":"var(--seekora-lightbox-thumb-border, 2px solid rgba(255,255,255,0.3))",borderRadius:4,overflow:"hidden",cursor:"pointer",opacity:r===y?1:.6,transition:"all 150ms ease",flexShrink:0,background:"none"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{r!==y&&(e.currentTarget.style.opacity="0.6")}},t.createElement("img",{src:e,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})))),t.createElement("div",{style:{color:"var(--seekora-lightbox-counter-text, rgba(255,255,255,0.9))",fontSize:"0.875rem",textAlign:"center",backgroundColor:"var(--seekora-lightbox-counter-bg, rgba(0,0,0,0.5))",padding:"4px 12px",borderRadius:12}},y+1," / ",T.length)),t.createElement("div",{style:{position:"absolute",top:20,left:"50%",transform:"translateX(-50%)",color:"var(--seekora-lightbox-instructions-text, rgba(255,255,255,0.7))",fontSize:"0.875rem",textAlign:"center",backgroundColor:"var(--seekora-lightbox-instructions-bg, rgba(0,0,0,0.5))",padding:"8px 16px",borderRadius:12}},M?"Use arrow keys or click thumbnails to navigate • ESC to close":"Click outside or press ESC to close")),document.body))}const vt={width:"100%",height:"auto",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)",display:"block",overflow:"hidden"};function kt({images:e,variant:r="single",alt:a="",className:o,style:n,carouselAutoplay:s=!1,carouselIntervalMs:i=4e3,enableZoom:l=!1,zoomMode:c="both",zoomLevel:d=2.5,showDots:u=!0}){const[p,m]=t.useState(0),[g,f]=t.useState(!1),h=Array.isArray(e)?e.filter(Boolean):[],y=h[p]??h[0],b=W(),v=H(32),k=b?56:48,x=O(8);if(0===h.length)return t.createElement("div",{className:I("seekora-img-display","seekora-img-placeholder",o),style:{...vt,...n},"aria-hidden":!0});if("single"===r)return l?t.createElement(bt,{src:h[0],alt:a,mode:c,zoomLevel:d,images:h,currentIndex:0,className:I("seekora-img-display","seekora-img-single",o),style:{...vt,...n}}):t.createElement("img",{src:h[0],alt:a,className:I("seekora-img-display","seekora-img-single",o),style:{...vt,...n},loading:"lazy"});if("hover"===r){const e=h.length>1&&g,r=e?h[1]:h[0],s=n?.aspectRatio||n?.objectFit?{...vt,...n.aspectRatio?{aspectRatio:n.aspectRatio}:{},...n.objectFit?{objectFit:n.objectFit}:{}}:vt;return l?t.createElement("div",{className:I("seekora-img-display","seekora-img-hover",o),style:{position:"relative",...n},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)},t.createElement(bt,{src:r,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:e?1:0,className:"seekora-img-hover-img",style:s})):t.createElement("div",{className:I("seekora-img-display","seekora-img-hover",o),style:{position:"relative",...n},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)},t.createElement("img",{src:r,alt:a,className:"seekora-img-hover-img",style:s,loading:"lazy"}))}if("carousel"===r){const e=e=>{m(t=>{const r=t+e;return r<0?h.length-1:r>=h.length?0:r})},r=n?.aspectRatio||n?.objectFit?{...vt,...n.aspectRatio?{aspectRatio:n.aspectRatio}:{},...n.objectFit?{objectFit:n.objectFit}:{}}:vt,s=l?t.createElement(bt,{src:y,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:p,className:"seekora-img-carousel-main",style:r}):t.createElement("img",{src:y,alt:a,className:"seekora-img-carousel-main",style:r,loading:"lazy"});return t.createElement("div",{className:I("seekora-img-display","seekora-img-carousel",o),style:{position:"relative",...n}},s,h.length>1&&t.createElement(t.Fragment,null,t.createElement("button",{type:"button","aria-label":"Previous",className:"seekora-img-carousel-prev",style:xt(!0,v),onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),e(-1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-carousel-btn-bg-hover, rgba(255,255,255,1))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-carousel-btn-bg, rgba(255,255,255,0.9))"}},"‹"),t.createElement("button",{type:"button","aria-label":"Next",className:"seekora-img-carousel-next",style:xt(!1,v),onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),e(1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--seekora-carousel-btn-bg-hover, rgba(255,255,255,1))"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--seekora-carousel-btn-bg, rgba(255,255,255,0.9))"}},"›"),u&&t.createElement("div",{className:"seekora-img-carousel-dots",style:{position:"absolute",bottom:b?12:8,left:"50%",transform:"translateX(-50%)",display:"flex",gap:b?8:6,padding:b?"8px 16px":"6px 12px",backgroundColor:"var(--seekora-carousel-dots-bg, rgba(0,0,0,0.5))",borderRadius:12,zIndex:10}},h.map((e,r)=>t.createElement("button",{key:r,type:"button","aria-label":`Go to image ${r+1}`,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),m(r)},style:{width:b?10:8,height:b?10:8,minWidth:b?44:32,minHeight:b?44:32,borderRadius:"50%",border:"none",padding:0,backgroundColor:r===p?"var(--seekora-carousel-dot-active, #fff)":"var(--seekora-carousel-dot, rgba(255,255,255,0.5))",cursor:"pointer",transition:"all 150ms ease"}})))))}if("thumbStrip"===r||"thumbList"===r){const e=n?.aspectRatio||n?.objectFit?{...vt,...n.aspectRatio?{aspectRatio:n.aspectRatio}:{},...n.objectFit?{objectFit:n.objectFit}:{}}:vt,r=l?t.createElement(bt,{src:y,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:p,className:"seekora-img-thumb-main",style:e}):t.createElement("img",{src:y,alt:a,className:"seekora-img-thumb-main",style:e,loading:"lazy"});return t.createElement("div",{className:I("seekora-img-display","seekora-img-thumbstrip",o),style:{display:"flex",flexDirection:"column",gap:x,...n}},r,t.createElement("div",{className:"seekora-img-thumbs",style:{display:"flex",gap:b?6:4,overflowX:"auto",paddingBottom:b?6:4}},h.map((e,r)=>t.createElement("button",{type:"button",key:r,className:I("seekora-img-thumb",r===p&&"seekora-img-thumb--active"),style:{flexShrink:0,width:k,height:k,minWidth:k,minHeight:k,padding:0,border:r===p?"2px solid var(--seekora-primary)":"1px solid transparent",borderRadius:4,overflow:"hidden",cursor:"pointer",background:"none"},onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),m(r)},onClick:e=>{e.stopPropagation(),e.preventDefault()}},t.createElement("img",{src:e,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})))))}return t.createElement("img",{src:y,alt:a,className:I("seekora-img-display",o),style:{...vt,...n},loading:"lazy"})}function xt(e,t=32){return{position:"absolute",top:"50%",[e?"left":"right"]:t>=44?4:8,transform:"translateY(-50%)",width:t,height:t,minWidth:t,minHeight:t,borderRadius:"50%",border:"none",backgroundColor:"var(--seekora-carousel-btn-bg, rgba(255, 255, 255, 0.9))",color:"var(--seekora-carousel-btn-text, #111)",fontSize:t>=44?"1.5rem":"1.25rem",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",zIndex:10,transition:"all 150ms ease"}}const Et=8,wt="150ms ease-in-out",St=6,Ct="0 2px 4px rgba(0,0,0,0.1)",Rt={addToCart:"🛒",wishlist:"♡",buyNow:"⚡",quickView:"👁",compare:"⚖"},It={addToCart:"Add to Cart",wishlist:"Wishlist",buyNow:"Buy Now",quickView:"Quick View",compare:"Compare"},Nt={small:{width:44,height:44,fontSize:"0.75rem",iconSize:"1rem"},medium:{width:44,height:44,fontSize:"0.875rem",iconSize:"1.25rem"},large:{width:44,height:44,fontSize:"1rem",iconSize:"1.5rem"}};function zt({buttons:e,layout:r="horizontal",position:a="inline",showLabels:o=!1,size:n="medium",className:s,style:i}){const l=Nt[n],c={display:"flex",flexDirection:"vertical"===r?"column":"row",gap:Et,..."inline"!==a?{position:"absolute",..."top-right"===a?{top:Et,right:Et}:{},..."bottom-center"===a?{bottom:Et,left:"50%",transform:"translateX(-50%)"}:{}}:{},...i},d={display:"flex",alignItems:"center",justifyContent:"center",gap:4,padding:o?"0 12px":0,width:o?"auto":l.width,height:l.height,fontSize:l.fontSize,fontWeight:500,border:"none",borderRadius:St,backgroundColor:"var(--seekora-bg-surface, transparent)",color:"var(--seekora-text, inherit)",cursor:"pointer",transition:`all ${wt}`,boxShadow:Ct};return t.createElement("div",{className:I("seekora-action-buttons",`seekora-action-buttons--${r}`,s),style:c},e.map((e,r)=>{const a=e.icon??Rt[e.type],n=e.label??It[e.type];return t.createElement("button",{key:r,type:"button",className:I("seekora-action-button",`seekora-action-button--${e.type}`,e.disabled&&"seekora-action-button--disabled",e.loading&&"seekora-action-button--loading"),style:{...d,opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},onClick:t=>((e,t)=>{t.stopPropagation(),t.preventDefault(),!e.onClick||e.disabled||e.loading||e.onClick(t)})(e,t),disabled:e.disabled,"aria-label":n,title:n},e.loading?t.createElement("span",{style:{fontSize:l.iconSize}},"⏳"):t.createElement(t.Fragment,null,t.createElement("span",{style:{fontSize:l.iconSize}},a),o&&t.createElement("span",null,n)))}))}const Tt="150ms ease-in-out",Mt={display:"flex",flexDirection:"column",gap:8,padding:8,cursor:"pointer",border:"none",borderRadius:`var(--seekora-border-radius, ${6}px)`,backgroundColor:"transparent",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",transition:`background-color ${Tt}, box-shadow ${Tt}`},At={width:"100%",aspectRatio:"var(--seekora-card-aspect-ratio, 1)",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.04))",display:"block",overflow:"hidden"};function _t({item:e,position:r,onSelect:a,className:o,style:n,asLink:s=!0,imageVariant:i="single",layout:l="vertical",actionButtons:c,actionButtonsPosition:d="overlay-top-right",showActionLabels:u=!1}){const p=e.images?.length?e.images:e.image??e.imageUrl?[String(e.image??e.imageUrl)]:[],m=e.title??e.primaryText??"",g=e.description??e.secondaryText,f=e.url,h=W(),y=O(12),b="horizontal"===l,[v,k]=t.useState(!1),x=h?60:80,E=h?100:120,w=h?60:80,S=h?"0.9375rem":"0.875rem",C=h?"0.875rem":"0.8125rem",R=h?6:4,N=h?3:2,z=v?{backgroundColor:"var(--seekora-card-hover-bg, var(--seekora-bg-hover, rgba(0,0,0,0.03)))",boxShadow:"var(--seekora-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08))"}:{},T=p.length>0?t.createElement("div",{style:{position:"relative",overflow:"hidden",borderRadius:4,...b?{minWidth:x,flexBasis:"20%",maxWidth:E,flexShrink:0}:{}}},t.createElement(kt,{images:p,variant:i,alt:String(m),className:"seekora-item-card-image"}),c&&c.length>0&&d?.startsWith("overlay")&&t.createElement(zt,{buttons:c,position:"overlay-top-right"===d?"top-right":"bottom-center",showLabels:u,size:"small"})):t.createElement("div",{className:"seekora-item-card-placeholder",style:{...At,...b?{minWidth:x,flexBasis:"20%",maxWidth:E,height:w,flexShrink:0}:{}},"aria-hidden":!0}),M=t.createElement("div",{style:b?{display:"flex",flexDirection:"column",gap:R,flex:1,minWidth:0}:void 0},t.createElement("span",{className:"seekora-item-card-title",style:{fontSize:S,fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:b?2:3,WebkitBoxOrient:"vertical"}},String(m)),g?t.createElement("span",{className:"seekora-item-card-description",style:{fontSize:C,color:"inherit",opacity:.6,lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:N,WebkitBoxOrient:"vertical",overflow:"hidden"}},String(g)):null,c&&c.length>0&&"inline"===d&&t.createElement(zt,{buttons:c,position:"inline",showLabels:u,size:"small",layout:"horizontal"})),A=b?t.createElement("div",{style:{display:"flex",gap:y,alignItems:"flex-start"}},T,M):t.createElement(t.Fragment,null,T,M),_={className:I("seekora-item-card",b&&"seekora-item-card--horizontal",v&&"seekora-item-card--hover",o),style:{...Mt,...b?{flexDirection:"row"}:{},...z,...n},"data-position":r,onClick:a,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),onMouseDown:a?e=>{e.preventDefault(),a()}:void 0};return s&&f?t.createElement("a",{href:f,..._,"data-item-id":e.id},A):t.createElement("button",{type:"button",..._,"data-item-id":e.id},A)}const $t=12;function Lt({items:e,onItemClick:r,getItemId:a=e=>e.id,getItemTitle:o=e=>e.title,getItemImage:n=e=>e.image,getItemDescription:s=e=>e.description,getItemUrl:i=e=>e.url,renderItem:l,maxItems:c=24,columns:d=4,className:u,style:p,gridClassName:m}){const g=q(d),f=O($t),h=j($t),y=e.slice(0,c);if(0===y.length)return null;const b={display:"grid",gap:f,padding:h,gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`};return t.createElement("div",{className:I("seekora-item-grid",u),style:p},t.createElement("div",{className:I("seekora-item-grid-inner",m),style:b},y.map((e,c)=>{if(l)return t.createElement(t.Fragment,{key:a(e)},l(e,c));const d=function(e,t,r,a,o,n){return{id:t(e),title:r(e),image:a?.(e),description:o?.(e),url:n?.(e),..."object"==typeof e&&null!==e?e:{}}}(e,a,o,n,s,i);return t.createElement(_t,{key:d.id,item:d,position:c,onSelect:r?()=>r(e,c):void 0})})))}const Pt=(e,t)=>{if(e&&t)return t.split(".").reduce((e,t)=>{if(null!=e)return e[t]},e)},Dt=(e,t={query:"query"})=>({query:Pt(e,t.query)??"",count:t.count?Pt(e,t.count):void 0,id:t.id?Pt(e,t.id):e?.objectID||e?.id,categories:t.categories?Pt(e,t.categories):void 0,highlighted:t.highlighted?Pt(e,t.highlighted):void 0,_raw:e}),Ft=(e,t={id:"id",title:"title"})=>({id:Pt(e,t.id)??e?.objectID??e?.id,title:Pt(e,t.title)??"",image:t.image?Pt(e,t.image):void 0,price:t.price?Pt(e,t.price):void 0,comparePrice:t.comparePrice?Pt(e,t.comparePrice):void 0,url:t.url?Pt(e,t.url):void 0,brand:t.brand?Pt(e,t.brand):void 0,category:t.category?Pt(e,t.category):void 0,rating:t.rating?Pt(e,t.rating):void 0,reviewCount:t.reviewCount?Pt(e,t.reviewCount):void 0,discount:t.discount?Pt(e,t.discount):void 0,inStock:t.inStock?Pt(e,t.inStock):void 0,currency:t.currency?Pt(e,t.currency):void 0,images:t.images?Pt(e,t.images):e?.images,originalPrice:t.originalPrice?Pt(e,t.originalPrice):e?.original_price??e?.compare_at_price,available:t.available?Pt(e,t.available):e?.available,options:t.options?Pt(e,t.options):e?.options,variants:t.variants?Pt(e,t.variants):e?.variants,tags:t.tags?Pt(e,t.tags):e?.tags,_raw:e}),Bt=(e,t={id:"id",label:"label"})=>({id:Pt(e,t.id)??e?.id,label:Pt(e,t.label)??"",count:t.count?Pt(e,t.count):void 0,icon:t.icon?Pt(e,t.icon):void 0,image:t.image?Pt(e,t.image):void 0,_raw:e}),Wt=(e,t={})=>{if(null==e)return"";const{currency:r="$",currencyPosition:a="before",priceDecimals:o=2}=t,n="string"==typeof e?parseFloat(e):e;if(isNaN(n))return String(e);const s=n.toLocaleString(void 0,{minimumFractionDigits:o,maximumFractionDigits:o});return"before"===a?`${r}${s}`:`${s}${r}`},qt=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(/[&<>"']/g,e=>t[e])},Ht=(e,r,a={})=>{if(!r||!e)return e;const{tag:o="mark",className:n,style:s}=a,i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(`(${i})`,"gi"),c=e.split(l);if(c.length<=1)return e;const d={backgroundColor:"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))",fontWeight:500,borderRadius:"2px",padding:"0 2px",...s};return c.map((e,r)=>l.test(e)?(l.lastIndex=0,t.createElement(o,{key:r,className:n,style:d},e)):(l.lastIndex=0,e))},Ot=(e,t)=>{const r=[];if(e)for(const t of e){const e=t.toLowerCase().trim();if(e.startsWith("badge:")||e.startsWith("badge: ")){const e=t.slice(t.indexOf(":")+1).trim();e&&r.push({text:e,type:"custom"})}else"new"===e||"new arrival"===e?r.push({text:"New",type:"new"}):"limited"!==e&&"limited edition"!==e||r.push({text:"Limited",type:"limited"})}if(t){const e=t.original_price??t.compare_at_price;if(e&&t.price&&e>t.price){const a=Math.round((e-t.price)/e*100);r.push({text:`${a}% Off`,type:"sale"})}}return t&&!1===t.available&&r.push({text:"Sold Out",type:"soldOut"}),r},jt=e=>{if(!e||0===e.length)return null;const t=e.map(e=>e.price).filter(e=>null!=e&&!isNaN(e));if(0===t.length)return null;const r=Math.min(...t),a=Math.max(...t);return r===a?null:{min:r,max:a}},Vt=(e,t,r,a)=>{const o=t.find(t=>t.name===e);if(!o)return[];const n=`option${t.indexOf(o)+1}`;return o.values.map(o=>{const s=r.some(r=>{if(r[n]!==o)return!1;if(!1===r.available)return!1;for(const[o,n]of Object.entries(a)){if(o===e)continue;const a=t.find(e=>e.name===o);if(!a)continue;if(r[`option${t.indexOf(a)+1}`]!==n)return!1}return!0});return{value:o,available:s}})},Ut=(e,t,r)=>t.find(t=>e.every((e,a)=>{const o=`option${a+1}`,n=r[e.name];return!n||t[o]===n}))??null,Kt=(e,t="seekora")=>{const r={};return e.primaryColor&&(r[`--${t}-primary`]=e.primaryColor),e.backgroundColor&&(r[`--${t}-bg-surface`]=e.backgroundColor),e.surfaceColor&&(r[`--${t}-bg-secondary`]=e.surfaceColor),e.textColor&&(r[`--${t}-text-primary`]=e.textColor),e.textSecondaryColor&&(r[`--${t}-text-secondary`]=e.textSecondaryColor),e.borderColor&&(r[`--${t}-border-color`]=e.borderColor),e.hoverColor&&(r[`--${t}-bg-hover`]=e.hoverColor),e.highlightColor&&(r[`--${t}-highlight-bg`]=e.highlightColor),e.successColor&&(r[`--${t}-success`]=e.successColor),e.errorColor&&(r[`--${t}-error`]=e.errorColor),e.fontFamily&&(r[`--${t}-font-family`]=e.fontFamily),e.fontSize&&(r[`--${t}-font-size`]="number"==typeof e.fontSize?`${e.fontSize}px`:e.fontSize),e.borderRadius&&(r[`--${t}-border-radius`]="number"==typeof e.borderRadius?`${e.borderRadius}px`:e.borderRadius),e.boxShadow&&(r[`--${t}-box-shadow`]=e.boxShadow),e.cssVariables&&Object.entries(e.cssVariables).forEach(([e,t])=>{r[e.startsWith("--")?e:`--${e}`]=t}),r},Qt=(...e)=>e.filter(Boolean).join(" "),Gt=(...e)=>Object.assign({},...e.filter(Boolean)),Xt="seekora_recent_searches",Yt=e=>{try{const t=e?`${Xt}_${e}`:Xt,r=localStorage.getItem(t);return r?JSON.parse(r):[]}catch{return[]}},Zt=(e,t)=>{try{const r=t?`${Xt}_${t}`:Xt;let a=Yt(t);return a=a.filter(t=>t!==e),a.unshift(e),a=a.slice(0,10),localStorage.setItem(r,JSON.stringify(a)),a}catch{return[]}},Jt=(e,t)=>{try{const r=t?`${Xt}_${t}`:Xt;let a=Yt(t);return a=a.filter(t=>t!==e),localStorage.setItem(r,JSON.stringify(a)),a}catch{return[]}},er=(e,t)=>{const r=e.getBoundingClientRect(),a=t.getBoundingClientRect();r.top<a.top?e.scrollIntoView({block:"start",behavior:"smooth"}):r.bottom>a.bottom&&e.scrollIntoView({block:"end",behavior:"smooth"})};class tr{constructor(e={}){this.cache=new Map,this.maxSize=e.maxSize??100,this.defaultTtl=e.defaultTtlMs??3e4}generateKey(e,t){const r=e.toLowerCase().trim();if(!t)return r;const a=Object.keys(t).sort().filter(e=>void 0!==t[e]&&null!==t[e]).map(e=>`${e}:${JSON.stringify(t[e])}`).join("|");return a?`${r}::${a}`:r}get(e){const t=this.cache.get(e);if(!t)return null;return Date.now()-t.timestamp>t.ttl?(this.cache.delete(e),null):t.data}set(e,t,r){if(this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(e,{data:t,timestamp:Date.now(),ttl:r??this.defaultTtl})}has(e){return null!==this.get(e)}clear(){this.cache.clear()}cleanup(){const e=Date.now();for(const[t,r]of this.cache.entries())e-r.timestamp>r.ttl&&this.cache.delete(t)}getStats(){return{size:this.cache.size,maxSize:this.maxSize}}}let rr=null;const ar=e=>(rr||(rr=new tr(e)),rr);function or({price:e,comparePrice:r,priceRange:a,currency:o="$",currencyPosition:n="before",priceDecimals:s=2,showDiscount:i=!0,className:l,style:c}){const d=e=>((e,t,r,a)=>{const o=e.toLocaleString(void 0,{minimumFractionDigits:a,maximumFractionDigits:a});return"before"===r?`${t}${o}`:`${o}${t}`})(e,o,n,s);if(a)return t.createElement("span",{className:I("seekora-price-display","seekora-price-range",l),style:c},d(a.min)," – ",d(a.max));if(null==e)return null;const u=null!=r&&r>e,p=u?Math.round((r-e)/r*100):0;return t.createElement("span",{className:I("seekora-price-display",l),style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap",...c}},t.createElement("span",{className:"seekora-price-current",style:{fontWeight:600}},d(e)),u&&t.createElement("span",{className:"seekora-price-compare",style:{textDecoration:"line-through",color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875em"}},d(r)),u&&i&&p>0&&t.createElement("span",{className:"seekora-price-discount",style:{color:"var(--seekora-error, #ef4444)",fontSize:"0.8125em",fontWeight:600}},"-",p,"%"))}const nr=4,sr=8,ir=4,lr={"top-left":{position:"absolute",top:sr,left:sr},"top-right":{position:"absolute",top:sr,right:sr},"bottom-left":{position:"absolute",bottom:sr,left:sr},"bottom-right":{position:"absolute",bottom:sr,right:sr},inline:{}},cr={sale:{bg:"var(--seekora-badge-sale-bg, #ef4444)",text:"var(--seekora-badge-sale-text, #fff)"},new:{bg:"var(--seekora-badge-new-bg, #3b82f6)",text:"var(--seekora-badge-new-text, #fff)"},soldOut:{bg:"var(--seekora-badge-soldout-bg, #6b7280)",text:"var(--seekora-badge-soldout-text, #fff)"},limited:{bg:"var(--seekora-badge-limited-bg, #f59e0b)",text:"var(--seekora-badge-limited-text, #fff)"},custom:{bg:"var(--seekora-badge-custom-bg, #111827)",text:"var(--seekora-badge-custom-text, #fff)"}};function dr({badges:e,maxBadges:r,position:a="top-left",className:o,style:n}){if(!e||0===e.length)return null;const s=r?e.slice(0,r):e;return t.createElement("div",{className:I("seekora-badge-list",o),style:{display:"flex",flexWrap:"wrap",gap:nr,zIndex:2,...lr[a],...n}},s.map((e,r)=>{const a=cr[e.type??"custom"];return t.createElement("span",{key:`${e.text}-${r}`,className:I("seekora-badge",e.type&&`seekora-badge--${"soldOut"===e.type?"sold-out":e.type}`),style:{display:"inline-block",padding:"2px 8px",borderRadius:ir,fontSize:"0.6875rem",fontWeight:600,lineHeight:1.2,backgroundColor:e.color??a.bg,color:e.textColor??a.text,whiteSpace:"nowrap"}},e.text)}))}const ur={small:14,medium:18,large:24},pr={small:"0.75rem",medium:"0.875rem",large:"1rem"};function mr({filled:e,half:r,size:a,color:o,emptyColor:n,interactive:s,onHover:i,onClick:l}){return r?t.createElement("span",{className:I("seekora-rating-star","seekora-rating-star--half",s&&"seekora-rating-star--interactive"),style:{position:"relative",display:"inline-block",width:a,height:a,cursor:s?"pointer":"default"},onMouseEnter:i,onClick:l},t.createElement("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",top:0,left:0}},t.createElement("defs",null,t.createElement("linearGradient",{id:"half-fill"},t.createElement("stop",{offset:"50%",stopColor:o}),t.createElement("stop",{offset:"50%",stopColor:n}))),t.createElement("path",{d:"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z",fill:"url(#half-fill)",stroke:o,strokeWidth:"1"}))):t.createElement("span",{className:I("seekora-rating-star",e?"seekora-rating-star--filled":"seekora-rating-star--empty",s&&"seekora-rating-star--interactive"),style:{display:"inline-block",width:a,height:a,cursor:s?"pointer":"default"},onMouseEnter:i,onClick:l},t.createElement("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:e?o:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z",stroke:e?o:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))}function gr({rating:e,reviewCount:r,variant:a="compact",size:o="medium",maxRating:n=5,showNumeric:s=!1,showHalfStars:i=!0,interactive:l=!1,onRatingChange:c,starColor:d="#f59e0b",emptyStarColor:u="#d1d5db",textColor:p="var(--seekora-text-secondary, #6b7280)",showReviewCount:m=!0,reviewCountFormat:g,className:f,style:h}){const[y,b]=t.useState(null),v=Math.max(0,Math.min(n,e)),k=l&&null!==y?y:v,x=ur[o],E=pr[o],w=e=>g?g(e):e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString(),S=()=>{const e=[];for(let r=1;r<=n;r++){const a=r<=Math.floor(k),o=i&&r===Math.ceil(k)&&k%1>=.25&&k%1<.75;e.push(t.createElement(mr,{key:r,filled:a,half:o,size:x,color:d,emptyColor:u,interactive:l,onHover:l?()=>b(r):void 0,onClick:l?()=>{b(null),c?.(r)}:void 0}))}return e},C=()=>{l&&b(null)};return"stars-only"===a?t.createElement("div",{className:I("seekora-rating-display","seekora-rating-display--stars-only",f),style:{display:"inline-flex",alignItems:"center",gap:2,...h},onMouseLeave:C},S()):"compact"===a?t.createElement("div",{className:I("seekora-rating-display","seekora-rating-display--compact",f),style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:E,...h},onMouseLeave:C},t.createElement("div",{style:{display:"inline-flex",alignItems:"center",gap:2}},S()),s&&t.createElement("span",{className:"seekora-rating-numeric",style:{fontWeight:600,color:p}},v.toFixed(1)),m&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-count",style:{color:p}},"(",w(r),")")):"full"===a?t.createElement("div",{className:I("seekora-rating-display","seekora-rating-display--full",f),style:{display:"flex",flexDirection:"column",gap:4,fontSize:E,...h},onMouseLeave:C},t.createElement("div",{style:{display:"flex",alignItems:"center",gap:6}},t.createElement("div",{style:{display:"inline-flex",alignItems:"center",gap:2}},S()),t.createElement("span",{className:"seekora-rating-numeric",style:{fontWeight:600,color:"var(--seekora-text-primary, #111827)"}},v.toFixed(1)),t.createElement("span",{className:"seekora-rating-max",style:{color:p}},"/ ",n)),m&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-text",style:{fontSize:"0.875em",color:p}},"Based on ",w(r)," ",1===r?"review":"reviews")):"inline"===a?t.createElement("div",{className:I("seekora-rating-display","seekora-rating-display--inline",f),style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:E,...h},onMouseLeave:C},t.createElement("span",{className:"seekora-rating-numeric",style:{fontWeight:600,color:"var(--seekora-text-primary, #111827)"}},v.toFixed(1)),t.createElement("div",{style:{display:"inline-flex",alignItems:"center",gap:2}},S()),m&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-count",style:{color:p}},"(",w(r),")")):null}const fr={black:"#000",white:"#fff",red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",orange:"#f97316",purple:"#a855f7",pink:"#ec4899",brown:"#92400e",grey:"#6b7280",gray:"#6b7280",navy:"#1e3a5f",beige:"#d4c5a9",cream:"#fffdd0",ivory:"#fffff0",khaki:"#c3b091",olive:"#808000",teal:"#0d9488",coral:"#ff7f50",maroon:"#800000",tan:"#d2b48c",charcoal:"#36454f",burgundy:"#800020",sage:"#9caf88",lavender:"#e6e6fa",mint:"#98fb98",rust:"#b7410e",plum:"#8e4585",slate:"#708090",indigo:"#4b0082",gold:"#ffd700",silver:"#c0c0c0",rose:"#ff007f",mauve:"#e0b0ff",wine:"#722f37",raven:"#0a0a0a",natural:"#f5f0e1",bone:"#e3dac9",sand:"#c2b280"};function hr({options:e,visibleOptions:r,maxValues:a=5,colorMap:o,selectedValues:n,variants:s,showAvailability:i=!0,onSwatchHover:l,onSwatchClick:c,className:d,style:u}){const[p,m]=t.useState(new Set),g=W(),f=g?20:14,h=g?"4px 10px":"1px 6px",y=g?"0.75rem":"0.6875rem",b=g?6:4;if(!e||0===e.length)return null;const v=r?e.filter(e=>r.includes(e.name)):e;if(0===v.length)return null;return t.createElement("div",{className:I("seekora-variant-swatches",d),style:{display:"flex",flexDirection:"column",gap:b,...u}},v.map(r=>{const d=(e=>{const t=e.toLowerCase();return"color"===t||"colour"===t||"colors"===t||"colours"===t})(r.name),u=p.has(r.name),v=u?r.values:r.values.slice(0,a),k=r.values.length-a,x=k>0,E=n?.[r.name];return t.createElement("div",{key:r.name,className:"seekora-variant-swatch-group",style:{display:"flex",alignItems:"center",gap:b,flexWrap:"wrap"}},v.map(a=>{const u=d?((e,t)=>{if(t?.[e])return t[e];const r=e.toLowerCase();return t?.[r]?t[r]:fr[r]??null})(a,o):null,p=E===a,m=!i||((e,t,r,a,o)=>{if(!a||0===a.length)return!0;const n=r.findIndex(t=>t.name===e);if(-1===n)return!0;const s=`option${n+1}`;return a.some(a=>{if(a[s]!==t)return!1;if(!1===a.available)return!1;if(o)for(const[t,n]of Object.entries(o)){if(t===e)continue;const o=r.findIndex(e=>e.name===t);if(-1!==o&&a[`option${o+1}`]!==n)return!1}return!0})})(r.name,a,e,s,n);return u?t.createElement("span",{key:a,className:I("seekora-variant-swatch","seekora-variant-swatch--color",p&&"seekora-variant-swatch--selected",!m&&"seekora-variant-swatch--unavailable"),title:`${a}${m?"":" (Unavailable)"}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:f,height:f,minWidth:f,minHeight:f,borderRadius:"50%",backgroundColor:u,border:p?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",outline:p?"2px solid var(--seekora-primary, #111827)":"none",outlineOffset:2,cursor:c&&m?"pointer":"not-allowed",flexShrink:0,boxShadow:p?"var(--seekora-swatch-ring, 0 0 0 1px #fff)":"none",opacity:m?1:.3,position:"relative"},onMouseEnter:()=>m&&l?.(r.name,a),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),m&&c?.(r.name,a)}},!m&&t.createElement("span",{style:{position:"absolute",top:"50%",left:"-2px",right:"-2px",height:1,backgroundColor:"var(--seekora-unavailable-line, #ef4444)",transform:"translateY(-50%) rotate(-45deg)"}})):t.createElement("span",{key:a,className:I("seekora-variant-swatch","seekora-variant-swatch--text",p&&"seekora-variant-swatch--selected",!m&&"seekora-variant-swatch--unavailable"),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:h,minHeight:g?32:24,fontSize:y,borderRadius:3,border:p?"1px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:p?"var(--seekora-primary, #111827)":"transparent",color:p?"var(--seekora-primary-text, #fff)":"var(--seekora-text-secondary, #6b7280)",cursor:c&&m?"pointer":"not-allowed",whiteSpace:"nowrap",fontWeight:p?600:400,opacity:m?1:.4,textDecoration:m?"none":"line-through"},onMouseEnter:()=>m&&l?.(r.name,a),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),m&&c?.(r.name,a)}},a)}),x&&t.createElement("button",{type:"button",className:"seekora-variant-swatch--overflow",onClick:e=>((e,t)=>{t.stopPropagation(),m(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})})(r.name,e),style:{fontSize:y,color:"var(--seekora-primary, #2563eb)",background:"none",border:"none",padding:g?"4px 8px":0,minHeight:g?32:"auto",cursor:"pointer",textDecoration:"underline",fontWeight:500}},u?"Show less":`+${k} more`))}))}const yr=4,br={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:yr,backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.04))"};function vr({images:e,title:r,imageVariant:a,aspectRatio:o,objectFit:n,enableZoom:s,zoomMode:i,zoomLevel:l}){const c=o?o.includes(":")?o.replace(":","/"):o:"1";return e.length>0?t.createElement("div",{className:"seekora-product-card__image",style:{position:"relative",overflow:"hidden",borderRadius:yr}},t.createElement(kt,{images:e,variant:e.length>1?a:"single",alt:r,className:"seekora-suggestions-product-card-image",style:{aspectRatio:c,...n?{objectFit:n}:{}},enableZoom:s,zoomMode:i,zoomLevel:l})):t.createElement("div",{className:"seekora-product-card__image seekora-suggestions-product-card-placeholder",style:{...br,aspectRatio:c,...n?{objectFit:n}:{}},"aria-hidden":!0})}function kr({images:e,title:r,price:a,product:o,imageVariant:n,displayConfig:s,enableImageZoom:i,imageZoomMode:l,imageZoomLevel:c}){const d=W(),u=d?"0.9375rem":"0.875rem",p=d?"0.9375rem":"0.875rem";return t.createElement(t.Fragment,null,t.createElement(vr,{images:e,title:r,imageVariant:n,aspectRatio:s.imageAspectRatio,objectFit:s.imageObjectFit,enableZoom:i,zoomMode:l,zoomLevel:c}),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:u,fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},r),null!=a&&!Number.isNaN(a)&&t.createElement("span",{className:"seekora-product-card__price seekora-suggestions-product-card-price",style:{fontSize:p,color:"inherit",opacity:.6}},o.currency??"$",a.toFixed(2)))}function xr({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,options:i,variants:l,product:c,imageVariant:d,displayConfig:u,onVariantHover:p,onVariantClick:m,selectedVariants:g,actionButtons:f,actionButtonsPosition:h,showActionLabels:y,enableImageZoom:b,imageZoomMode:v,imageZoomLevel:k}){const x=u,E=W(),w=E?6:4,S=E?"0.9375rem":"0.875rem",C=E?"0.8125rem":"0.75rem",R=E?"0.9375rem":"0.875rem",I=h?.startsWith("overlay");return t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"}},t.createElement(vr,{images:e,title:r,imageVariant:d,aspectRatio:x.imageAspectRatio,objectFit:x.imageObjectFit,enableZoom:b,zoomMode:v,zoomLevel:k}),!1!==x.showBadges&&s.length>0&&t.createElement(dr,{badges:s,position:"top-left",maxBadges:2}),f&&f.length>0&&I&&t.createElement(zt,{buttons:f,position:"overlay-top-right"===h?"top-right":"bottom-center",showLabels:y,size:"small"})),t.createElement("div",{className:"seekora-product-card__body",style:{display:"flex",flexDirection:"column",gap:w}},!1!==x.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:C,color:"inherit",opacity:.6,textTransform:"uppercase",letterSpacing:"0.02em"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:S,fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},r),t.createElement("div",{className:"seekora-product-card__price"},t.createElement(or,{price:a??void 0,comparePrice:o??void 0,currency:x.currency??c.currency,currencyPosition:x.currencyPosition,priceDecimals:x.priceDecimals,showDiscount:x.showDiscount,style:{fontSize:R}})),!1!==x.showVariants&&i.length>0&&t.createElement(hr,{options:i,visibleOptions:x.variantOptionsToShow,maxValues:x.maxVariantValues,selectedValues:g,variants:l,onSwatchHover:p,onSwatchClick:m}),f&&f.length>0&&!I&&t.createElement(zt,{buttons:f,position:"inline",showLabels:y,size:"small",layout:"horizontal"})))}function Er({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,priceRange:i,options:l,variants:c,product:d,imageVariant:u,displayConfig:p,onVariantHover:m,onVariantClick:g,selectedVariants:f,actionButtons:h,actionButtonsPosition:y,showActionLabels:b,enableImageZoom:v,imageZoomMode:k,imageZoomLevel:x}){const E=p,w=d.available,S=y?.startsWith("overlay");return t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"}},t.createElement(vr,{images:e,title:r,imageVariant:u,aspectRatio:E.imageAspectRatio,objectFit:E.imageObjectFit,enableZoom:v,zoomMode:k,zoomLevel:x}),!1!==E.showBadges&&s.length>0&&t.createElement(dr,{badges:s,position:"top-left"}),h&&h.length>0&&S&&t.createElement(zt,{buttons:h,position:"overlay-top-right"===y?"top-right":"bottom-center",showLabels:b,size:"small"})),t.createElement("div",{className:"seekora-product-card__body",style:{display:"flex",flexDirection:"column",gap:4}},!1!==E.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:"0.75rem",color:"inherit",opacity:.6,textTransform:"uppercase",letterSpacing:"0.02em"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis"}},r),!1!==E.showRating&&null!=d.rating&&t.createElement(gr,{rating:d.rating,reviewCount:d.reviewCount,variant:"compact",size:"small",showNumeric:!1,showReviewCount:!0,className:"seekora-product-card__rating"}),t.createElement("div",{className:"seekora-product-card__price"},E.showPriceRange&&i?t.createElement(or,{priceRange:i,currency:E.currency??d.currency,currencyPosition:E.currencyPosition,priceDecimals:E.priceDecimals,style:{fontSize:"0.875rem"}}):t.createElement(or,{price:a??void 0,comparePrice:o??void 0,currency:E.currency??d.currency,currencyPosition:E.currencyPosition,priceDecimals:E.priceDecimals,showDiscount:E.showDiscount,style:{fontSize:"0.875rem"}})),!1!==E.showVariants&&l.length>0&&t.createElement(hr,{options:l,visibleOptions:E.variantOptionsToShow,maxValues:E.maxVariantValues,selectedValues:f,variants:c,onSwatchHover:m,onSwatchClick:g}),!1!==E.showStock&&null!=w&&t.createElement("span",{className:"seekora-product-card__stock",style:{fontSize:"0.75rem",color:w?"var(--seekora-success, #22c55e)":"var(--seekora-error, #ef4444)"}},w?"In Stock":"Out of Stock"),h&&h.length>0&&!S&&t.createElement(zt,{buttons:h,position:"inline",showLabels:b,size:"small",layout:"horizontal"})))}function wr({images:e,title:r,price:a,product:o,imageVariant:n,displayConfig:s,enableImageZoom:i,imageZoomMode:l,imageZoomLevel:c}){return t.createElement(t.Fragment,null,t.createElement(vr,{images:e,title:r,imageVariant:n,aspectRatio:s.imageAspectRatio??"1:1",enableZoom:i,zoomMode:l,zoomLevel:c}),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.8125rem",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},r),null!=a&&!Number.isNaN(a)&&t.createElement("span",{className:"seekora-product-card__price",style:{fontSize:"0.8125rem",color:"inherit",opacity:.6}},o.currency??"$",a.toFixed(2)))}function Sr({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,options:i,variants:l,product:c,imageVariant:d,displayConfig:u,onVariantHover:p,onVariantClick:m,selectedVariants:g,actionButtons:f,actionButtonsPosition:h,showActionLabels:y,enableImageZoom:b,imageZoomMode:v,imageZoomLevel:k}){const x=u,E=W(),w=O(12),S=E?6:4,C=E?60:80,R=E?100:120,I=E?"20%":"25%",N=E?"0.6875rem":"0.75rem";return t.createElement("div",{style:{display:"flex",gap:w,alignItems:"flex-start"}},t.createElement("div",{style:{position:"relative",minWidth:C,flexBasis:I,maxWidth:R,flexShrink:0}},t.createElement(vr,{images:e,title:r,imageVariant:d,aspectRatio:"1:1",enableZoom:b,zoomMode:v,zoomLevel:k}),!1!==x.showBadges&&s.length>0&&t.createElement(dr,{badges:s,position:"top-left",maxBadges:1}),f&&f.length>0&&h?.startsWith("overlay")&&t.createElement(zt,{buttons:f,position:"overlay-top-right"===h?"top-right":"bottom-center",showLabels:y,size:"small"})),t.createElement("div",{className:"seekora-product-card__body",style:{display:"flex",flexDirection:"column",gap:S,flex:1,minWidth:0}},!1!==x.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:N,color:"inherit",opacity:.6,textTransform:"uppercase"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:E?3:2,WebkitBoxOrient:"vertical"}},r),t.createElement("div",{className:"seekora-product-card__price"},t.createElement(or,{price:a??void 0,comparePrice:o??void 0,currency:x.currency??c.currency,currencyPosition:x.currencyPosition,priceDecimals:x.priceDecimals,showDiscount:x.showDiscount,style:{fontSize:"0.875rem"}})),!1!==x.showVariants&&i.length>0&&t.createElement(hr,{options:i,visibleOptions:x.variantOptionsToShow,maxValues:x.maxVariantValues??3,selectedValues:g,variants:l,onSwatchHover:p,onSwatchClick:m}),f&&f.length>0&&"inline"===h&&t.createElement(zt,{buttons:f,position:"inline",showLabels:y,size:"small",layout:"horizontal"})))}const Cr="150ms ease-in-out",Rr={display:"flex",flexDirection:"column",gap:8,padding:8,cursor:"pointer",border:"none",borderRadius:`var(--seekora-border-radius, ${6}px)`,backgroundColor:"transparent",textAlign:"left",transition:`background-color ${Cr}, box-shadow ${Cr}`},Ir={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.04))"};function Nr({product:e,position:r,section:a,tabId:o,onSelect:n,className:s,style:i,imageVariant:l="single",displayConfig:c,onVariantHover:d,onVariantClick:u,selectedVariants:p,asLink:m,actionButtons:g,actionButtonsPosition:f="inline",showActionLabels:h=!1,enableImageZoom:y=!1,imageZoomMode:b="both",imageZoomLevel:v=2.5}){const k=t.useMemo(()=>p&&e.options&&e.variants?Ut(e.options,e.variants,p):null,[p,e.options,e.variants]),x=t.useMemo(()=>k?.image?[k.image]:e.images?.length?e.images:e.image??e.imageUrl?[String(e.image??e.imageUrl)]:[],[k,e]),E=t.useMemo(()=>k?.title&&k.title!==e.title?`${e.title??e.name??""} - ${k.title}`:e.title??e.name??"",[k,e]),w=t.useMemo(()=>{const t=k?.price;if(null!=t)return"number"==typeof t?t:Number(t);const r=e.price;return null!=r?"number"==typeof r?r:Number(r):null},[k,e.price]),S=t.useMemo(()=>{const t=k?.comparePrice;if(null!=t)return"number"==typeof t?t:Number(t);const r=e.original_price??e.compare_at_price;return null!=r?"number"==typeof r?r:Number(r):null},[k,e]),C=x,R=E,N=w,[z,T]=t.useState(!1),M=z?{backgroundColor:"var(--seekora-card-hover-bg, var(--seekora-bg-hover, rgba(0,0,0,0.03)))",boxShadow:"var(--seekora-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08))"}:{};if(!c)return t.createElement("div",{role:"button",tabIndex:0,className:I("seekora-suggestions-product-card",z&&"seekora-suggestions-product-card--hover",s),style:{...Rr,...M,...i},onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onClick:()=>n(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n())},"data-position":r,"data-section":a,"data-tab-id":o},C.length>0?t.createElement(kt,{images:C,variant:l,alt:R,className:"seekora-suggestions-product-card-image",enableZoom:y,zoomMode:b,zoomLevel:v}):t.createElement("div",{className:"seekora-suggestions-product-card-placeholder",style:Ir,"aria-hidden":!0}),t.createElement("span",{className:"seekora-suggestions-product-card-title",style:{fontSize:"0.875rem",fontWeight:500}},R),null==N||Number.isNaN(N)?null:t.createElement("span",{className:"seekora-suggestions-product-card-price",style:{fontSize:"0.875rem",color:"inherit",opacity:.6}},e.currency??"$",N.toFixed(2)));const A=c.style??"minimal",_=S,$=e.brand??null,L=e.options??[],P=e.variants??[],D=t.useMemo(()=>!1===c.showBadges?[]:c.badgeExtractor?c.badgeExtractor(e.tags,e):Ot(e.tags,e),[c,e]),F=t.useMemo(()=>c.showPriceRange?jt(e.variants):null,[c.showPriceRange,e.variants]),B={product:e,images:C,title:R,price:N,comparePrice:_,brand:$,badges:D,priceRange:F,options:L,variants:P,displayConfig:c,imageVariant:l,onVariantHover:d,onVariantClick:u,selectedVariants:p,actionButtons:g,actionButtonsPosition:f,showActionLabels:h,enableImageZoom:y,imageZoomMode:b,imageZoomLevel:v},W={minimal:kr,standard:xr,detailed:Er,compact:wr,horizontal:Sr}[A]??kr,q=I("seekora-product-card",`seekora-product-card--${A}`,"seekora-suggestions-product-card",z&&"seekora-product-card--hover",s),H={...Rr,..."horizontal"===A?{flexDirection:"row"}:{},...M,...i};return m&&e.url?t.createElement("a",{href:e.url,className:q,style:{...H,textDecoration:"none",color:"inherit"},onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onClick:e=>{e.preventDefault(),n()},"data-position":r,"data-section":a,"data-tab-id":o},t.createElement(W,{...B})):t.createElement("div",{role:"button",tabIndex:0,className:q,style:H,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onClick:()=>n(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n())},"data-position":r,"data-section":a,"data-tab-id":o},t.createElement(W,{...B}))}function zr({maxItems:e=8,source:r="trending",columns:a=4,className:o,style:n,gridClassName:s,displayConfig:i,onVariantHover:l}){const{trendingProducts:c,filteredTabs:d,activeTabId:u,selectProduct:p,getAllNavigableItems:m}=et(),g=q(a),f=O(12),h=j(12),y=t.useMemo(()=>{if("trending"===r)return c;const e=d.find(e=>e.id===("tab"===r?u:r));return e?.products??[]},[r,u,c,d]).slice(0,e),b=m().findIndex(e=>"product"===e.type);if(0===y.length)return null;const v={display:"grid",gridTemplateColumns:`repeat(${g}, minmax(0, 1fr))`,gap:f,padding:h};return t.createElement("div",{className:I("seekora-suggestions-product-grid",o),style:n},t.createElement("div",{className:I("seekora-suggestions-product-grid-inner",s),style:v},y.map((e,a)=>{const o=b>=0?b+a:a,n="trending"===r?"products":"filtered_tab",s="trending"!==r?"tab"===r?u:r:void 0;return t.createElement(Nr,{key:e.id??e.objectID??a,product:e,position:o,section:n,tabId:s,onSelect:()=>p(e,o,n,s),displayConfig:i,onVariantHover:l})})))}function Tr({className:e,style:r,tabClassName:a}){const{filteredTabs:o,activeTabId:n,setActiveTab:s}=et();return 0===o.length?null:t.createElement("div",{className:I("seekora-suggestions-categories-tabs",e),style:{display:"flex",gap:4,padding:"8px 12px",borderBottom:"1px solid var(--seekora-border-color, #e5e7eb)",overflowX:"auto",...r},role:"tablist"},o.map(e=>{const r=n===e.id;return t.createElement("button",{key:e.id,type:"button",role:"tab","aria-selected":r,className:I("seekora-suggestions-tab",r&&"seekora-suggestions-tab--active",a),style:{padding:"8px 12px",border:"none",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:r?"var(--seekora-primary-light, rgba(59, 130, 246, 0.1))":"transparent",color:r?"var(--seekora-primary, #3b82f6)":"inherit",cursor:"pointer",fontSize:"0.875rem",fontWeight:r?600:400,whiteSpace:"nowrap",transition:"background-color 120ms ease"},onClick:()=>s(e)},e.label)}))}const Mr={padding:"10px 12px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"inherit",transition:"background-color 120ms ease"};function Ar({search:e,onSelect:r}){const[a,o]=t.useState(!1);return t.createElement("li",null,t.createElement("button",{type:"button",className:I("seekora-suggestions-recent-item",a&&"seekora-suggestions-recent-item--hover"),style:{...Mr,...a?{backgroundColor:"var(--seekora-bg-hover, rgba(0,0,0,0.05))"}:{}},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onMouseDown:e=>{e.preventDefault(),r()}},e.query))}function _r({title:e="Recent",maxItems:r=8,className:a,style:o,listClassName:n,renderItem:s}){const{recentSearches:i,query:l,selectRecentSearch:c}=et(),d=i.slice(0,r);return 0===d.length?null:t.createElement("div",{className:I("seekora-suggestions-recent-list",a),style:o},e?t.createElement("div",{className:"seekora-suggestions-recent-title",style:{padding:"8px 12px",fontSize:"0.75rem",fontWeight:600,color:"inherit",opacity:.6,textTransform:"uppercase"}},e):null,t.createElement("ul",{className:I("seekora-suggestions-recent-ul",n),style:{margin:0,padding:0,listStyle:"none"}},d.map((e,r)=>{const a=()=>c(e);return s?t.createElement("li",{key:`${e.query}-${e.timestamp}`},s(e,r,a)):t.createElement(Ar,{key:`${e.query}-${e.timestamp}`,search:e,onSelect:a})})))}const $r={padding:"10px 12px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"inherit",transition:"background-color 120ms ease"};function Lr({trending:e,onSelect:r}){const[a,o]=t.useState(!1);return t.createElement("li",null,t.createElement("button",{type:"button",className:I("seekora-suggestions-trending-item",a&&"seekora-suggestions-trending-item--hover"),style:{...$r,...a?{backgroundColor:"var(--seekora-bg-hover, rgba(0,0,0,0.05))"}:{}},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onMouseDown:e=>{e.preventDefault(),r()}},e.query,null!=e.count?t.createElement("span",{style:{marginLeft:8,color:"inherit",opacity:.6,fontSize:"0.875em"}},e.count):null))}function Pr({title:e="Trending",maxItems:r=8,className:a,style:o,listClassName:n,renderItem:s}){const{trendingSearches:i,selectTrendingSearch:l}=et(),c=i.slice(0,r);return 0===c.length?null:t.createElement("div",{className:I("seekora-suggestions-trending-list",a),style:o},e?t.createElement("div",{className:"seekora-suggestions-trending-title",style:{padding:"8px 12px",fontSize:"0.75rem",fontWeight:600,color:"inherit",opacity:.6,textTransform:"uppercase"}},e):null,t.createElement("ul",{className:I("seekora-suggestions-trending-ul",n),style:{margin:0,padding:0,listStyle:"none"}},c.map((e,r)=>{const a=()=>l(e,r);return s?t.createElement("li",{key:`${e.query}-${r}`},s(e,r,a)):t.createElement(Lr,{key:`${e.query}-${r}`,trending:e,onSelect:a})})))}function Dr({className:e,style:r,render:a}){const{error:o}=et();return o?a?t.createElement(t.Fragment,null,a(o)):t.createElement("div",{className:I("seekora-suggestions-error",e),style:{padding:16,color:"var(--seekora-error, #dc2626)",fontSize:"0.875rem",...r}},o.message):null}const Fr={black:"#000",white:"#fff",red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",orange:"#f97316",purple:"#a855f7",pink:"#ec4899",brown:"#92400e",grey:"#6b7280",gray:"#6b7280",navy:"#1e3a5f",beige:"#d4c5a9",cream:"#fffdd0",ivory:"#fffff0",teal:"#0d9488",coral:"#ff7f50",maroon:"#800000",charcoal:"#36454f",sage:"#9caf88",lavender:"#e6e6fa",mint:"#98fb98",rust:"#b7410e",plum:"#8e4585",slate:"#708090",indigo:"#4b0082",gold:"#ffd700",silver:"#c0c0c0",rose:"#ff007f",raven:"#0a0a0a",natural:"#f5f0e1",bone:"#e3dac9",sand:"#c2b280",olive:"#808000",khaki:"#c3b091",burgundy:"#800020",wine:"#722f37",mauve:"#e0b0ff",tan:"#d2b48c"},Br=(e,t,r,a,o)=>{const n=r.findIndex(t=>t.name===e);if(-1===n)return!0;const s=`option${n+1}`;return a.some(a=>{if(a[s]!==t)return!1;if(!1===a.available)return!1;for(const[t,n]of Object.entries(o)){if(t===e)continue;const o=r.findIndex(e=>e.name===t);if(-1===o)continue;if(a[`option${o+1}`]!==n)return!1}return!0})};function Wr({options:e,variants:r,selections:a,onSelectionChange:o,optionRenderModes:n,dropdownThreshold:s=8,colorMap:i,showAvailability:l=!0,selectedVariant:c,className:d,style:u}){if(!e||0===e.length)return null;return t.createElement("div",{className:I("seekora-variant-selector",d),style:{display:"flex",flexDirection:"column",gap:16,...u}},e.map(c=>{const d=(e=>n?.[e.name]?n[e.name]:(e=>{const t=e.toLowerCase();return"color"===t||"colour"===t||"colors"===t||"colours"===t})(e.name)?"swatch":e.values.length>s?"dropdown":"button")(c),u=a[c.name];return t.createElement("div",{key:c.name,className:"seekora-variant-option-group"},t.createElement("label",{className:"seekora-variant-option-label",style:{display:"block",fontSize:"0.875rem",fontWeight:600,marginBottom:8,color:"var(--seekora-text-primary, inherit)"}},c.name,u&&t.createElement("span",{style:{fontWeight:400,marginLeft:6,color:"var(--seekora-text-secondary, inherit)"}},u)),"dropdown"===d?t.createElement("div",{onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},t.createElement(V,{className:"seekora-variant-dropdown",value:u??"",onChange:e=>o(c.name,e),placeholder:`Select ${c.name}`,"aria-label":`Select ${c.name}`,options:c.values.map(t=>{const o=!l||Br(c.name,t,e,r,a);return{value:t,label:o?t:`${t} (Unavailable)`,disabled:!o}}),style:{minWidth:120,"--seekora-select-border":"var(--seekora-border-color, rgba(128,128,128,0.2))","--seekora-select-bg":"var(--seekora-bg-surface, transparent)","--seekora-select-color":"var(--seekora-text-primary, inherit)"}})):t.createElement("div",{className:"seekora-variant-buttons",style:{display:"flex",flexWrap:"wrap",gap:8}},c.values.map(n=>{const s=u===n,p=!l||Br(c.name,n,e,r,a),m="swatch"===d?((e,t)=>{if(t?.[e])return t[e];const r=e.toLowerCase();return t?.[r]?t[r]:Fr[r]??null})(n,i):null;return"swatch"===d&&m?t.createElement("button",{key:n,type:"button",className:I("seekora-variant-color-swatch",s&&"seekora-variant-button--active",!p&&"seekora-variant-button--unavailable"),title:n,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),o(c.name,n)},disabled:!p,style:{width:32,height:32,borderRadius:"50%",backgroundColor:m,border:s?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",outline:s?"2px solid var(--seekora-primary, #111827)":"none",outlineOffset:2,cursor:p?"pointer":"not-allowed",opacity:p?1:.4,position:"relative",padding:0},"aria-label":`${c.name}: ${n}`,"aria-pressed":s}):t.createElement("button",{key:n,type:"button",className:I("seekora-variant-button",s&&"seekora-variant-button--active",!p&&"seekora-variant-button--unavailable"),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),o(c.name,n)},disabled:!p,style:{padding:"6px 16px",fontSize:"0.875rem",borderRadius:6,border:s?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:s?"var(--seekora-primary, #111827)":"var(--seekora-bg-surface, transparent)",color:s?"transparent":"var(--seekora-text-primary, inherit)",cursor:p?"pointer":"not-allowed",opacity:p?1:.5,textDecoration:p?"none":"line-through",fontWeight:s?600:400,transition:"all 120ms ease"},"aria-label":`${c.name}: ${n}`,"aria-pressed":s},n)})))}))}const qr=t.createContext(null);const Hr=t.createContext(null);function Or(){const e=t.useContext(Hr);if(!e){const e=new Error("useSectionSearchContext must be used within a SectionSearchProvider");throw u("SectionSearchContext: not available",{error:e.message}),e}return e}function jr({className:e,style:r,render:a}){const{error:o}=Or();return o?a?t.createElement(t.Fragment,null,a(o)):t.createElement("div",{className:e,style:{padding:16,color:"var(--seekora-error,#dc2626)",fontSize:"0.875rem",...r}},o.message):null}const Vr={xs:0,sm:480,md:768,lg:1024,xl:1280},Ur={xs:`@media (max-width: ${Vr.sm-1}px)`,sm:`@media (min-width: ${Vr.sm}px) and (max-width: ${Vr.md-1}px)`,md:`@media (min-width: ${Vr.md}px) and (max-width: ${Vr.lg-1}px)`,lg:`@media (min-width: ${Vr.lg}px) and (max-width: ${Vr.xl-1}px)`,xl:`@media (min-width: ${Vr.xl}px)`,mobile:`@media (max-width: ${Vr.md-1}px)`,tablet:`@media (min-width: ${Vr.md}px) and (max-width: ${Vr.lg-1}px)`,desktop:`@media (min-width: ${Vr.lg}px)`,touch:"@media (hover: none) and (pointer: coarse)",mouse:"@media (hover: hover) and (pointer: fine)"},Kr={minimum:44,comfortable:48,large:56},Qr=()=>{const[e,r]=t.useState({isMobile:!1,isTablet:!1,isDesktop:!0,isTouch:!1,width:"undefined"!=typeof window?window.innerWidth:1024,height:"undefined"!=typeof window?window.innerHeight:768,breakpoint:"lg"});return t.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth,t=window.innerHeight,a=(e=>e<Vr.sm?"xs":e<Vr.md?"sm":e<Vr.lg?"md":e<Vr.xl?"lg":"xl")(e),o="ontouchstart"in window||navigator.maxTouchPoints>0;r({isMobile:e<Vr.md,isTablet:e>=Vr.md&&e<Vr.lg,isDesktop:e>=Vr.lg,isTouch:o,width:e,height:t,breakpoint:a})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e};let Gr=!1;const Xr=()=>{if(Gr)return;if("undefined"==typeof document)return;const e="seekora-dropdown-responsive-global";if(document.getElementById(e))return void(Gr=!0);const t=document.createElement("style");t.id=e,t.textContent='\n/* ============================================\n SEEKORA DROPDOWN - RESPONSIVE STYLES\n ============================================ */\n\n/* CSS Variables for responsiveness */\n:root {\n --seekora-touch-target-min: 44px;\n --seekora-touch-target-comfortable: 48px;\n --seekora-mobile-padding: 16px;\n --seekora-desktop-padding: 20px;\n}\n\n/* Base responsive rules for all dropdowns */\n[class*="seekora-"][class*="-dropdown"] {\n box-sizing: border-box;\n}\n\n[class*="seekora-"][class*="-dropdown"] * {\n box-sizing: border-box;\n}\n\n/* ============================================\n MOBILE STYLES (< 768px)\n ============================================ */\n@media (max-width: 767px) {\n /* Full-width dropdowns on mobile */\n [class*="seekora-"][class*="-dropdown"]:not(.seekora-mobile-sheet):not(.seekora-spotlight-dropdown) {\n width: 100% !important;\n max-width: 100vw !important;\n left: 0 !important;\n right: 0 !important;\n border-radius: 0 !important;\n margin: 0 !important;\n }\n\n /* Touch-friendly item sizes */\n [class*="seekora-"][class*="-dropdown"] [role="option"],\n [class*="seekora-"][class*="-dropdown"] [data-item],\n [class*="seekora-"][class*="-dropdown"] .suggestion-item,\n [class*="seekora-"][class*="-dropdown"] .product-card {\n min-height: var(--seekora-touch-target-min);\n }\n\n /* Larger padding on mobile */\n [class*="seekora-"][class*="-dropdown"] [role="option"],\n [class*="seekora-"][class*="-dropdown"] [data-item] {\n padding: 14px var(--seekora-mobile-padding) !important;\n }\n\n /* Larger fonts on mobile for readability */\n [class*="seekora-"][class*="-dropdown"] {\n font-size: 16px !important;\n }\n\n /* Stack columns on mobile */\n [class*="seekora-"][class*="-dropdown"] .dropdown-content,\n [class*="seekora-"][class*="-dropdown"] [style*="display: flex"][style*="flex-direction"] {\n flex-direction: column !important;\n }\n\n /* Full-width columns on mobile */\n [class*="seekora-"][class*="-dropdown"] [style*="width: 40%"],\n [class*="seekora-"][class*="-dropdown"] [style*="width: 45%"],\n [class*="seekora-"][class*="-dropdown"] [style*="width: 50%"],\n [class*="seekora-"][class*="-dropdown"] [style*="width: 55%"],\n [class*="seekora-"][class*="-dropdown"] [style*="width: 60%"] {\n width: 100% !important;\n flex: none !important;\n }\n\n /* Product grid adjustments */\n [class*="seekora-"][class*="-dropdown"] .products-grid,\n [class*="seekora-"][class*="-dropdown"] [style*="grid-template-columns"] {\n grid-template-columns: repeat(2, 1fr) !important;\n gap: 12px !important;\n }\n\n /* Horizontal scroll for products on mobile */\n [class*="seekora-"][class*="-dropdown"] .products-scroll {\n display: flex !important;\n overflow-x: auto !important;\n scroll-snap-type: x mandatory !important;\n -webkit-overflow-scrolling: touch !important;\n padding-bottom: 8px !important;\n }\n\n [class*="seekora-"][class*="-dropdown"] .products-scroll > * {\n scroll-snap-align: start !important;\n flex-shrink: 0 !important;\n }\n\n /* Hide keyboard hints on mobile */\n [class*="seekora-"][class*="-dropdown"] .keyboard-hint,\n [class*="seekora-"][class*="-dropdown"] [class*="keyboard"],\n [class*="seekora-"][class*="-dropdown"] kbd,\n [class*="seekora-"][class*="-dropdown"] .kbd {\n display: none !important;\n }\n\n /* Safe area padding for notched devices */\n [class*="seekora-"][class*="-dropdown"] [style*="padding-bottom"] {\n padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;\n }\n}\n\n/* ============================================\n TOUCH DEVICE STYLES\n ============================================ */\n@media (hover: none) and (pointer: coarse) {\n /* Active state instead of hover for touch */\n [class*="seekora-"][class*="-dropdown"] [role="option"]:active,\n [class*="seekora-"][class*="-dropdown"] [data-item]:active,\n [class*="seekora-"][class*="-dropdown"] button:active {\n background-color: var(--seekora-bg-hover, rgba(0,0,0,0.05)) !important;\n transform: scale(0.98);\n }\n\n /* Disable hover effects on touch */\n [class*="seekora-"][class*="-dropdown"] [role="option"]:hover,\n [class*="seekora-"][class*="-dropdown"] [data-item]:hover {\n background-color: transparent;\n }\n\n /* Larger touch targets */\n [class*="seekora-"][class*="-dropdown"] button,\n [class*="seekora-"][class*="-dropdown"] [role="button"] {\n min-height: var(--seekora-touch-target-min);\n min-width: var(--seekora-touch-target-min);\n }\n\n /* No text selection on touch */\n [class*="seekora-"][class*="-dropdown"] {\n -webkit-user-select: none;\n user-select: none;\n }\n}\n\n/* ============================================\n TABLET STYLES (768px - 1023px)\n ============================================ */\n@media (min-width: 768px) and (max-width: 1023px) {\n [class*="seekora-"][class*="-dropdown"]:not(.seekora-mobile-sheet) {\n max-width: 90vw !important;\n margin-left: auto !important;\n margin-right: auto !important;\n }\n\n /* 3-column product grid on tablet */\n [class*="seekora-"][class*="-dropdown"] .products-grid {\n grid-template-columns: repeat(3, 1fr) !important;\n }\n}\n\n/* ============================================\n DESKTOP STYLES (>= 1024px)\n ============================================ */\n@media (min-width: 1024px) {\n [class*="seekora-"][class*="-dropdown"] [role="option"],\n [class*="seekora-"][class*="-dropdown"] [data-item] {\n min-height: 40px;\n }\n\n /* Hover effects only on desktop */\n [class*="seekora-"][class*="-dropdown"] [role="option"]:hover,\n [class*="seekora-"][class*="-dropdown"] [data-item]:hover {\n background-color: var(--seekora-bg-hover, rgba(0,0,0,0.04));\n }\n}\n\n/* ============================================\n ANIMATION & TRANSITIONS\n ============================================ */\n@keyframes seekora-dropdown-enter {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes seekora-dropdown-enter-mobile {\n from {\n opacity: 0;\n transform: translateY(100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes seekora-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n[class*="seekora-"][class*="-dropdown"].entering {\n animation: seekora-dropdown-enter 200ms ease-out;\n}\n\n@media (max-width: 767px) {\n [class*="seekora-"][class*="-dropdown"].entering {\n animation: seekora-dropdown-enter-mobile 300ms ease-out;\n }\n}\n\n/* ============================================\n ACCESSIBILITY\n ============================================ */\n@media (prefers-reduced-motion: reduce) {\n [class*="seekora-"][class*="-dropdown"],\n [class*="seekora-"][class*="-dropdown"] * {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n\n/* Focus visible styles */\n[class*="seekora-"][class*="-dropdown"] [role="option"]:focus-visible,\n[class*="seekora-"][class*="-dropdown"] button:focus-visible {\n outline: 2px solid var(--seekora-primary, #007aff);\n outline-offset: -2px;\n}\n\n/* High contrast mode */\n@media (prefers-contrast: high) {\n [class*="seekora-"][class*="-dropdown"] {\n border: 2px solid currentColor !important;\n }\n\n [class*="seekora-"][class*="-dropdown"] [role="option"][aria-selected="true"] {\n outline: 2px solid currentColor;\n }\n}\n\n/* Dark mode adjustments */\n@media (prefers-color-scheme: dark) {\n [class*="seekora-"][class*="-dropdown"] {\n --seekora-bg-surface: #1c1c1e;\n --seekora-bg-secondary: #2c2c2e;\n --seekora-bg-hover: #3a3a3c;\n --seekora-text-primary: #ffffff;\n --seekora-text-secondary: #8e8e93;\n --seekora-border-color: #38383a;\n }\n}\n',document.head.appendChild(t),Gr=!0},Yr=()=>{t.useEffect(()=>{Xr()},[])},Zr=(e={},t=!1)=>({root:{position:"absolute",top:"100%",left:0,right:0,marginTop:"8px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #0f1111)",borderRadius:t?"12px":"16px",boxShadow:"0 4px 6px -1px rgba(0,0,0,0.1), 0 10px 40px -5px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",zIndex:1e3,...t&&{position:"fixed",top:"60px",bottom:0,left:"8px",right:"8px",margin:0,borderRadius:"16px 16px 0 0"}},content:{display:"flex",flexDirection:t?"column":"row",maxHeight:t?"calc(100vh - 140px)":"480px",overflowY:"auto"},leftColumn:{flex:t?"none":"0 0 55%",borderRight:t?"none":"1px solid var(--seekora-border-color, #e8e8e8)",borderBottom:t?"1px solid var(--seekora-border-color, #e8e8e8)":"none",overflowY:"auto",padding:"8px 0"},rightColumn:{flex:t?"none":"0 0 45%",backgroundColor:"var(--seekora-bg-secondary, #fafafa)",overflowY:"auto",padding:"8px 0"},section:{padding:"4px 0"},sectionHeader:{padding:"8px 16px 6px",fontSize:"11px",fontWeight:600,color:"var(--seekora-text-secondary, #6b6b6b)",textTransform:"uppercase",letterSpacing:"0.05em"},suggestionItem:{display:"flex",alignItems:"center",padding:t?"12px 16px":"10px 16px",cursor:"pointer",transition:"all 150ms ease",gap:t?"12px":"10px",minHeight:t?`${Kr.minimum}px`:"40px",borderRadius:"8px",margin:"2px 8px",color:"var(--seekora-text-primary, #0f1111)"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #0f1111)"},suggestionIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-tertiary, #6b6b6b)",flexShrink:0},suggestionContent:{flex:1,minWidth:0},suggestionQuery:{fontSize:"14px",color:"var(--seekora-text-primary, #0f1111)",fontWeight:400,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},suggestionContext:{fontSize:"12px",color:"var(--seekora-text-secondary, #565959)",marginTop:"2px"},suggestionDepartment:{color:"var(--seekora-primary-dark, #c45500)",fontStyle:"italic"},categoryScoped:{backgroundColor:"var(--seekora-primary-light, #fef8f0)",borderRadius:"3px",padding:"0 4px",marginLeft:"4px",fontSize:"11px",color:"var(--seekora-primary-dark, #c45500)"},productsHeader:{padding:"12px 16px 8px",display:"flex",alignItems:"center",justifyContent:"space-between"},productsTitle:{fontSize:"13px",fontWeight:700,color:"var(--seekora-text-primary, #0f1111)"},viewAll:{fontSize:"12px",color:"var(--seekora-link, #007185)",textDecoration:"none",cursor:"pointer","&:hover":{color:"var(--seekora-link-hover, #c45500)",textDecoration:"underline"}},productsGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"12px",padding:"12px 16px 16px"},productCard:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",borderRadius:"12px",padding:"10px",cursor:"pointer",transition:"all 200ms ease",boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},productCardHover:{boxShadow:"0 4px 12px rgba(0,0,0,0.12)",transform:"translateY(-2px)"},productImage:{width:"100%",aspectRatio:"1",objectFit:"contain",backgroundColor:"var(--seekora-bg-tertiary, #f8f8f8)",borderRadius:"8px",marginBottom:"10px"},productTitle:{fontSize:"12px",color:"var(--seekora-link, #007185)",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",marginBottom:"4px"},productPrice:{fontSize:"14px",fontWeight:500,color:"var(--seekora-text-primary, #0f1111)"},productPriceSymbol:{fontSize:"11px",verticalAlign:"top"},productRating:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px"},stars:{color:"var(--seekora-rating, #de7921)",fontSize:"12px"},reviewCount:{fontSize:"11px",color:"var(--seekora-link, #007185)"},prime:{height:"16px",marginTop:"4px"},recentHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px"},clearRecent:{fontSize:"12px",color:"var(--seekora-link, #007185)",cursor:"pointer",background:"none",border:"none",padding:0},highlight:{fontWeight:700,color:"var(--seekora-text-primary, #0f1111)"},empty:{padding:"40px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #565959)"},footer:{padding:"10px 16px",borderTop:"1px solid var(--seekora-border-color, #e7e7e7)",backgroundColor:"var(--seekora-bg-secondary, #f7f7f7)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",color:"var(--seekora-text-tertiary, #767676)"},keyboard:{display:"flex",alignItems:"center",gap:"8px"},key:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"18px",padding:"0 4px",backgroundColor:"var(--seekora-bg-surface, #fff)",border:"1px solid var(--seekora-border-color, #ccc)",borderRadius:"3px",fontSize:"10px",fontFamily:"monospace"}}),Jr=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("circle",{cx:"11",cy:"11",r:"8"}),t.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),ea=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("circle",{cx:"12",cy:"12",r:"10"}),t.createElement("polyline",{points:"12 6 12 12 16 14"})),ta=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18"}),t.createElement("polyline",{points:"17 6 23 6 23 12"})),ra=({rating:e,count:r})=>{const a=Math.floor(e),o=e%1>=.5;return t.createElement("div",{style:Zr().productRating},t.createElement("div",{style:Zr().stars},"★".repeat(a),o&&"½","☆".repeat(5-a-(o?1:0))),void 0!==r&&t.createElement("span",{style:Zr().reviewCount},"(",r.toLocaleString(),")"))},aa=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],categories:l=[],recentSearches:c=[],trendingSearches:d=[],filteredTabs:u=[],activeTab:p="all",suggestionFields:m={query:"query"},productFields:g={id:"id",title:"title"},categoryFields:f={id:"id",label:"label"},productDisplay:h={},theme:y={},showDepartments:b=!0,currentDepartment:v,departments:k=[],showPrime:x=!1,width:E="700px",maxHeight:w="500px",zIndex:S=1e3,className:C,style:R,classNames:I={},onSuggestionSelect:N,onProductClick:z,onCategoryClick:T,onTabChange:M,onRecentClick:A,onRecentRemove:_,onRecentClearAll:$,onViewAll:L,onClose:P,header:D,footer:F,renderEmpty:B}=e;Yr();const W=Qr(),{isMobile:q,isTablet:H}=W,O=t.useMemo(()=>Zr(y,q),[y,q]),j=t.useRef(null),[V,U]=t.useState(-1),[K,Q]=t.useState(null),G=t.useMemo(()=>s.map(e=>Dt(e,m)),[s,m]),X=t.useMemo(()=>{if("all"===p||0===u.length)return i;const e=u.find(e=>e.id===p);return e?.products||i},[p,u,i]),Y=t.useMemo(()=>X.map(e=>Ft(e,g)),[X,g]);t.useMemo(()=>l.map(e=>Bt(e,f)),[l,f]);const Z=t.useMemo(()=>c.map(e=>"string"==typeof e?e:e.query),[c]),J=t.useMemo(()=>{const e=[];let t=0;return 0===a.length&&Z.slice(0,5).forEach(r=>{e.push({type:"recent",data:r,index:t++})}),G.forEach(r=>{e.push({type:"suggestion",data:r,index:t++})}),e},[a,Z,G]),ee=t.useCallback(()=>{U(e=>Math.min(e+1,J.length-1))},[J.length]),te=t.useCallback(()=>{U(e=>Math.max(e-1,-1))},[]),re=t.useCallback(()=>{if(V<0||V>=J.length)return;const e=J[V];"recent"===e.type?A?.(e.data):"suggestion"===e.type&&N?.(e.data._raw,e.index)},[V,J,A,N]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>V,setActiveIndex:U,selectActive:re,navigateNext:ee,navigatePrevious:te,focus:()=>j.current?.focus(),close:()=>P?.()}),[V,re,ee,te,P]),t.useEffect(()=>{if(V>=0&&j.current){const e=j.current.querySelector(`[data-index="${V}"]`);e&&er(e,j.current)}},[V]),!o)return null;const ae=Kt(y),oe=0===a.length&&Z.length>0,ne=0===a.length&&d.length>0,se=Y.length>0;return t.createElement("div",{ref:j,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-amazon-dropdown",C,I.root),style:Gt(O.root,{width:q?"100%":E,maxHeight:q?"100vh":w,zIndex:S},ae,R),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n .seekora-amazon-dropdown mark {\n background: transparent;\n font-weight: 700;\n color: inherit;\n }\n "),D,t.createElement(t.Fragment,null,u.length>0&&t.createElement("div",{style:{display:"flex",gap:"8px",padding:q?"12px":"12px 16px",overflowX:"auto",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"var(--seekora-border-color, #e7e7e7)",background:"var(--seekora-bg-secondary, #f5f5f5)",WebkitOverflowScrolling:"touch"}},t.createElement("button",{onClick:()=>M?.("all"),style:{padding:"8px 16px",borderWidth:0,borderStyle:"none",background:"all"===p?"var(--seekora-text-primary, #232f3e)":"var(--seekora-bg-surface, #ffffff)",color:"all"===p?"var(--seekora-bg-surface, #ffffff)":"var(--seekora-text-primary, #0f1111)",borderRadius:"20px",fontSize:"13px",fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",minHeight:"36px",boxShadow:"all"===p?"none":"0 1px 3px rgba(0,0,0,0.1)",transition:"all 150ms ease"}},"All"),u.slice(0,6).map(e=>t.createElement("button",{key:e.id,onClick:()=>M?.(e.id),style:{padding:"8px 16px",borderWidth:0,borderStyle:"none",background:p===e.id?"var(--seekora-primary, #ff9900)":"var(--seekora-bg-surface, #ffffff)",color:p===e.id?"var(--seekora-text-on-primary, #0f1111)":"var(--seekora-text-primary, #0f1111)",borderRadius:"20px",fontSize:"13px",fontWeight:p===e.id?700:500,cursor:"pointer",whiteSpace:"nowrap",minHeight:"36px",boxShadow:p===e.id?"0 2px 4px rgba(255,153,0,0.3)":"0 1px 3px rgba(0,0,0,0.1)",transition:"all 150ms ease"}},e.label," ",e.nb_hits?`(${e.nb_hits})`:""))),t.createElement("div",{style:O.content},t.createElement("div",{style:O.leftColumn},oe&&t.createElement("div",{style:O.section},t.createElement("div",{style:O.recentHeader},t.createElement("span",{style:O.sectionHeader},"Recent Searches"),t.createElement("button",{style:O.clearRecent,onClick:$},"Clear all")),Z.slice(0,5).map((e,r)=>{const a=V===r;return t.createElement("div",{key:`recent-${e}`,"data-index":r,role:"option","aria-selected":a,style:Gt(O.suggestionItem,a?O.suggestionItemActive:void 0),onClick:()=>A?.(e),onMouseEnter:()=>U(r)},t.createElement(ea,null),t.createElement("div",{style:O.suggestionContent},t.createElement("div",{style:O.suggestionQuery},e)))})),ne&&t.createElement("div",{style:O.section},t.createElement("div",{style:O.sectionHeader},"Trending Searches"),d.slice(0,5).map((e,r)=>{const a="string"==typeof e?e:e.query,o=Z.length+r,n=V===o;return t.createElement("div",{key:`trending-${a}`,"data-index":o,role:"option","aria-selected":n,style:Gt(O.suggestionItem,n?O.suggestionItemActive:void 0),onClick:()=>N?.({query:a},r),onMouseEnter:()=>U(o)},t.createElement(ta,null),t.createElement("div",{style:O.suggestionContent},t.createElement("div",{style:O.suggestionQuery},a)))})),G.length>0&&t.createElement("div",{style:O.section},a&&t.createElement("div",{style:O.sectionHeader},"Suggestions"),G.map((e,r)=>{const o=oe?Z.length+r:r,n=V===o,s=(e.categories||[])[0];return t.createElement("div",{key:e.id||`suggestion-${r}`,"data-index":o,role:"option","aria-selected":n,style:Gt(O.suggestionItem,n?O.suggestionItemActive:void 0),onClick:()=>N?.(e._raw,r),onMouseEnter:()=>U(o)},t.createElement("div",{style:O.suggestionIcon},t.createElement(Jr,null)),t.createElement("div",{style:O.suggestionContent},t.createElement("div",{style:O.suggestionQuery},Ht(e.query,a,{className:"highlight"})),b&&s&&t.createElement("div",{style:O.suggestionContext},t.createElement("span",{style:O.suggestionDepartment},"in ","string"==typeof s?s:s.value||s.label))),e.count&&t.createElement("span",{style:O.categoryScoped},e.count.toLocaleString()))})),a&&0===G.length&&!n&&(B?B(a):t.createElement("div",{style:O.empty},'No suggestions found for "',a,'"'))),se&&t.createElement("div",{style:O.rightColumn},t.createElement("div",{style:O.productsHeader},t.createElement("span",{style:O.productsTitle},"Suggested Products"),t.createElement("a",{style:O.viewAll,onClick:()=>L?.("products")},"View all")),t.createElement("div",{style:O.productsGrid},Y.slice(0,4).map((e,r)=>t.createElement("div",{key:e.id,style:Gt(O.productCard,K===e.id?O.productCardHover:void 0),onClick:()=>z?.(e._raw,r),onMouseEnter:()=>Q(e.id),onMouseLeave:()=>Q(null)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:O.productImage,loading:"lazy"}):t.createElement("div",{style:{...O.productImage,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement("span",{style:{color:"var(--seekora-text-tertiary, #999)",fontSize:"32px"}},"📷")),t.createElement("div",{style:O.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:O.productPrice},t.createElement("span",{style:O.productPriceSymbol},h.currency||"$"),Wt(e.price,{currency:"",priceDecimals:h.priceDecimals})),e.rating&&t.createElement(ra,{rating:parseFloat(String(e.rating)),count:e.reviewCount?parseInt(String(e.reviewCount)):void 0}))))))),void 0!==F?F:t.createElement("div",{style:O.footer},t.createElement("div",{style:O.keyboard},t.createElement("span",{style:O.key},"↑"),t.createElement("span",{style:O.key},"↓"),t.createElement("span",null,"to navigate"),t.createElement("span",{style:O.key},"↵"),t.createElement("span",null,"to select"),t.createElement("span",{style:O.key},"esc"),t.createElement("span",null,"to close")),G.length>0&&t.createElement("span",null,G.length," suggestions")))}),oa=()=>t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none"},t.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z",fill:"currentColor"})),na=()=>t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none"},t.createElement("path",{d:"M13 3a9 9 0 00-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0013 21a9 9 0 000-18zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z",fill:"currentColor"})),sa=()=>t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none"},t.createElement("path",{d:"M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z",fill:"currentColor"})),ia=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",width:"20",height:"20"},t.createElement("path",{d:"M9 5l-4 4 4 4",stroke:"currentColor",strokeWidth:"2",fill:"none",transform:"rotate(-90 12 12)"})),la=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],recentSearches:i=[],trendingSearches:l=[],suggestionFields:c={query:"query"},theme:d={},showFeelingLucky:u=!0,feelingLuckyText:p="I'm Feeling Lucky",showRemoveRecent:m=!0,showVoiceSearch:g=!1,showTrendingIndicator:f=!0,width:h="100%",maxHeight:y="400px",zIndex:b=1e3,className:v,style:k,classNames:x={},onSuggestionSelect:E,onRecentClick:w,onRecentRemove:S,onVoiceSearch:C,onFeelingLucky:R,onClose:I,onSearchSubmit:N,header:z,footer:T,renderEmpty:M}=e;Yr();const A=Qr(),{isMobile:_}=A,$=t.useMemo(()=>((e=!1)=>({root:{position:e?"fixed":"absolute",top:e?0:"100%",left:0,right:0,bottom:e?0:"auto",marginTop:e?0:"4px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #202124)",borderRadius:e?"0":"24px",boxShadow:e?"none":"0 4px 20px rgba(0,0,0,0.12)",overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:e?"17px":"15px",display:"flex",flexDirection:"column"},list:{listStyle:"none",margin:0,padding:"8px",flex:1,overflowY:"auto"},item:{display:"flex",alignItems:"center",padding:e?"12px 14px":"10px 14px",cursor:"pointer",transition:"all 100ms ease",gap:"12px",minHeight:"44px",borderRadius:"12px",margin:"2px 0",color:"var(--seekora-text-primary, #202124)"},itemActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #202124)"},itemIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-tertiary, #9aa0a6)",flexShrink:0},itemContent:{flex:1,display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:0},itemText:{fontSize:"16px",color:"var(--seekora-text-primary, #202124)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemTextBold:{fontWeight:400},itemMatch:{fontWeight:700},itemAction:{fontSize:"14px",color:"var(--seekora-link, #1a73e8)",marginLeft:"16px",opacity:0,transition:"opacity 100ms",whiteSpace:"nowrap"},itemActionVisible:{opacity:1},removeBtn:{padding:"4px 8px",background:"none",border:"none",color:"var(--seekora-link, #1a73e8)",cursor:"pointer",fontSize:"13px",borderRadius:"4px",opacity:0,transition:"opacity 100ms, background 100ms"},removeBtnVisible:{opacity:1},removeBtnHover:{backgroundColor:"var(--seekora-bg-hover, #e8f0fe)",color:"var(--seekora-text-primary, #202124)"},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, #e8eaed)",margin:"8px 0"},sectionTitle:{padding:"12px 16px 8px",fontSize:"12px",fontWeight:500,color:"var(--seekora-text-secondary, #5f6368)",textTransform:"uppercase",letterSpacing:"0.8px"},trending:{display:"flex",alignItems:"center",gap:"8px",color:"var(--seekora-success, #1e8e3e)",fontSize:"12px",marginLeft:"auto"},trendingIcon:{width:"12px",height:"12px"},footer:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px 16px",borderTop:"1px solid var(--seekora-border-color, #e8eaed)",gap:"24px",backgroundColor:"var(--seekora-bg-secondary, #f8f9fa)"},footerButton:{padding:"8px 16px",backgroundColor:"var(--seekora-bg-tertiary, #f1f3f4)",border:"1px solid var(--seekora-border-color, #f1f3f4)",borderRadius:"4px",fontSize:"14px",color:"var(--seekora-text-secondary, #3c4043)",cursor:"pointer",transition:"border-color 100ms, box-shadow 100ms"},footerButtonHover:{borderColor:"var(--seekora-border-color-dark, #dadce0)",boxShadow:"0 1px 1px rgba(0,0,0,0.1)"},voiceBtn:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",borderRadius:"50%",background:"none",border:"none",cursor:"pointer",color:"var(--seekora-primary, #4285f4)",transition:"background 100ms"},voiceBtnHover:{backgroundColor:"var(--seekora-bg-hover, #f1f3f4)",color:"var(--seekora-text-primary, #202124)"},empty:{padding:"24px",textAlign:"center",color:"var(--seekora-text-secondary, #5f6368)",fontSize:"14px"}}))(_),[_]),L=t.useRef(null),[P,D]=t.useState(-1),[F,B]=t.useState(-1),[W,q]=t.useState(null),H=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),O=t.useMemo(()=>i.map(e=>"string"==typeof e?e:e.query).slice(0,5),[i]),j=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,5),[l]),V=t.useMemo(()=>{const e=[];return 0===a.length?(O.forEach(t=>e.push({type:"recent",query:t})),j.forEach(t=>e.push({type:"trending",query:t}))):H.forEach(t=>e.push({type:"suggestion",query:t.query,data:t})),e},[a,O,j,H]),U=t.useCallback(()=>{D(e=>Math.min(e+1,V.length-1))},[V.length]),K=t.useCallback(()=>{D(e=>Math.max(e-1,-1))},[]),Q=t.useCallback(()=>{if(P<0)return void(a&&N?.(a));const e=V[P];"recent"===e.type||"trending"===e.type?w?.(e.query):E?.(e.data?._raw||{query:e.query},P)},[P,V,a,N,w,E]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>P,setActiveIndex:D,selectActive:Q,navigateNext:U,navigatePrevious:K,focus:()=>L.current?.focus(),close:()=>I?.()}),[P,Q,U,K,I]),t.useEffect(()=>{D(-1)},[a]),t.useEffect(()=>{if(P>=0&&L.current){const e=L.current.querySelector(`[data-index="${P}"]`);e&&er(e,L.current)}},[P]),!o)return null;const G=Kt(d),X=0===a.length&&O.length>0,Y=0===a.length&&j.length>0,Z=(e,r,o)=>{const n=P===o,s=F===o,i=n||s;return t.createElement("li",{key:`${e.type}-${e.query}-${r}`,"data-index":o,role:"option","aria-selected":n,style:Gt($.item,n||s?$.itemActive:void 0),onClick:()=>{"recent"===e.type||"trending"===e.type?w?.(e.query):E?.(e.data?._raw||{query:e.query},r)},onMouseEnter:()=>{B(o),D(o)},onMouseLeave:()=>B(-1)},t.createElement("div",{style:$.itemIcon},"recent"===e.type?t.createElement(na,null):"trending"===e.type?t.createElement(sa,null):t.createElement(oa,null)),t.createElement("div",{style:$.itemContent},t.createElement("span",{style:$.itemText},a?Ht(e.query,a,{tag:"b"}):e.query),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},"trending"===e.type&&f&&t.createElement("span",{style:$.trending},t.createElement(sa,null),"Trending"),"recent"===e.type&&m&&t.createElement("button",{style:Gt($.removeBtn,i?$.removeBtnVisible:void 0),onClick:t=>{t.stopPropagation(),S?.(e.query)},"aria-label":`Remove ${e.query}`},"Remove"),t.createElement("span",{style:Gt($.itemAction,i?$.itemActionVisible:void 0)},t.createElement(ia,null)))))};let J=0;return t.createElement("div",{ref:L,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-google-dropdown",v,x.root),style:Gt($.root,{width:h,maxHeight:"none",zIndex:b},G,k),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),z,t.createElement(t.Fragment,null,t.createElement("ul",{style:$.list},X&&t.createElement(t.Fragment,null,O.map((e,t)=>{const r=Z({type:"recent",query:e},t,J);return J++,r}),Y&&t.createElement("div",{style:$.divider})),Y&&t.createElement(t.Fragment,null,!X&&t.createElement("div",{style:$.sectionTitle},"Trending searches"),j.map((e,t)=>{const r=Z({type:"trending",query:e},t,J);return J++,r})),a&&H.length>0&&H.map((e,t)=>{const r={type:"suggestion",query:e.query,data:e},a=Z(r,t,J);return J++,a}),a&&0===H.length&&!n&&(M?M(a):t.createElement("li",{style:$.empty},'No suggestions for "',a,'"'))),(u||g)&&t.createElement("div",{style:$.footer},u&&t.createElement(t.Fragment,null,t.createElement("button",{style:Gt($.footerButton,"search"===W?$.footerButtonHover:void 0),onMouseEnter:()=>q("search"),onMouseLeave:()=>q(null),onClick:()=>N?.(a||(P>=0?V[P]?.query:""))},"Search"),t.createElement("button",{style:Gt($.footerButton,"lucky"===W?$.footerButtonHover:void 0),onMouseEnter:()=>q("lucky"),onMouseLeave:()=>q(null),onClick:()=>R?.(a||(P>=0?V[P]?.query:""))},p)))),T)}),ca=()=>t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor"},t.createElement("path",{d:"M10 16c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6m13.12 2.88l-4.26-4.26A9.842 9.842 0 0020 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10c1.67 0 3.24-.41 4.62-1.14l4.26 4.26a3 3 0 004.24-4.24z"})),da=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18"},t.createElement("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"})),ua=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18"},t.createElement("path",{d:"M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"})),pa=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"48",height:"48"},t.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.createElement("polyline",{points:"21 15 16 10 5 21"})),ma=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],categories:l=[],suggestionFields:c={query:"query"},productFields:d={id:"id",title:"title"},categoryFields:u={id:"id",label:"label"},productDisplay:p={},theme:m={},showSaveButton:g=!0,activeCategory:f,activeTab:h,showPriceOverlay:y=!0,gridColumns:b=4,width:v="800px",maxHeight:k="600px",zIndex:x=1e3,className:E,style:w,classNames:S={},onSuggestionSelect:C,onProductClick:R,onCategoryClick:I,onTabChange:N,onSaveProduct:z,onViewAll:T,onClose:M,header:A,footer:_,renderEmpty:$}=e;Yr();const L=Qr(),{isMobile:P}=L,D=t.useMemo(()=>({root:{position:"absolute",top:"100%",left:0,right:0,marginTop:"8px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #111111)",borderRadius:"20px",boxShadow:"0 4px 30px rgba(0,0,0,0.12)",overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"15px"},header:{padding:"16px 20px 14px",borderBottom:"1px solid var(--seekora-border-color, #e8e8e8)"},searchInfo:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"14px"},searchQuery:{fontSize:"16px",fontWeight:600,color:"#111111"},searchCount:{fontSize:"13px",color:"#767676"},categoriesScroll:{display:"flex",gap:"8px",overflowX:"auto",paddingBottom:"4px",scrollbarWidth:"none",msOverflowStyle:"none"},categoryChip:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",backgroundColor:"var(--seekora-bg-secondary, #f0f0f0)",borderRadius:"20px",fontSize:"13px",fontWeight:500,color:"#111111",cursor:"pointer",transition:"all 150ms ease",whiteSpace:"nowrap",borderWidth:0,borderStyle:"none"},categoryChipActive:{backgroundColor:"var(--seekora-primary, #e60023)",color:"var(--seekora-bg-surface, #ffffff)"},categoryChipHover:{backgroundColor:"var(--seekora-bg-hover, #e0e0e0)",color:"var(--seekora-text-primary, #111111)"},categoryIcon:{width:"16px",height:"16px",borderRadius:"4px",objectFit:"cover"},content:{padding:"16px",overflowY:"auto"},suggestionsRow:{display:"flex",gap:"8px",marginBottom:"16px",flexWrap:"wrap"},suggestionPill:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",borderRadius:"20px",fontSize:"13px",fontWeight:500,color:"#111111",cursor:"pointer",transition:"all 150ms ease",borderWidth:0,borderStyle:"none"},suggestionPillActive:{backgroundColor:"var(--seekora-text-primary, #111111)",color:"var(--seekora-bg-surface, #ffffff)"},suggestionPillHover:{backgroundColor:"var(--seekora-bg-hover, #e8e8e8)",color:"var(--seekora-text-primary, #111111)"},suggestionIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"#767676",flexShrink:0},productsGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))",gap:"16px"},productCard:{position:"relative",borderRadius:"16px",overflow:"hidden",cursor:"pointer",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",transition:"transform 150ms, box-shadow 150ms"},productCardHover:{transform:"scale(1.02)",boxShadow:"0 4px 20px rgba(0,0,0,0.15)"},productImageContainer:{position:"relative",paddingBottom:"133%",overflow:"hidden"},productImage:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},productImagePlaceholder:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--seekora-bg-tertiary, #e9e9e9)",color:"var(--seekora-text-tertiary, #aaa)"},productOverlay:{position:"absolute",bottom:0,left:0,right:0,padding:"40px 12px 12px",background:"linear-gradient(to top, rgba(0,0,0,0.7), transparent)",opacity:0,transition:"opacity 200ms"},productOverlayVisible:{opacity:1},productInfo:{padding:"12px"},productTitle:{fontSize:"14px",fontWeight:600,color:"var(--seekora-text-primary, #111)",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",marginBottom:"4px"},productTitleOverlay:{color:"var(--seekora-text-inverse, #ffffff)",marginBottom:"4px"},productPrice:{fontSize:"14px",fontWeight:600,color:"var(--seekora-text-primary, #111)"},productPriceOverlay:{color:"var(--seekora-text-inverse, #ffffff)"},productSaveBtn:{position:"absolute",top:"12px",right:"12px",width:"36px",height:"36px",borderRadius:"50%",backgroundColor:"var(--seekora-primary, #e60023)",color:"var(--seekora-text-inverse, #ffffff)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",opacity:0,transform:"scale(0.8)",transition:"all 150ms"},productSaveBtnVisible:{opacity:1,transform:"scale(1)"},sectionTitle:{fontSize:"18px",fontWeight:700,color:"var(--seekora-text-primary, #111)",marginBottom:"16px",display:"flex",alignItems:"center",gap:"8px"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, #767676)"},spinner:{width:"32px",height:"32px",border:"3px solid var(--seekora-border-color, #efefef)",borderTopColor:"var(--seekora-primary, #e60023)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"60px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #767676)"},emptyIcon:{width:"64px",height:"64px",margin:"0 auto 16px",color:"var(--seekora-text-tertiary, #8c8c8c)"},footer:{padding:"16px 20px",borderTop:"1px solid var(--seekora-border-color, #efefef)",display:"flex",alignItems:"center",justifyContent:"space-between"},viewAllBtn:{padding:"12px 20px",backgroundColor:"var(--seekora-primary, #e60023)",color:"var(--seekora-text-inverse, #ffffff)",border:"none",borderRadius:"24px",fontSize:"15px",fontWeight:600,cursor:"pointer",transition:"background 150ms"},viewAllBtnHover:{backgroundColor:"var(--seekora-primary-dark, #ad081b)"}}),[]),F=t.useRef(null),[B,W]=t.useState(-1),[q,H]=t.useState(null),[O,j]=t.useState(null),[V,U]=t.useState(-1),[K,Q]=t.useState(f||null),[G,X]=t.useState(!1);t.useEffect(()=>{const e=h??f;void 0!==e&&Q("all"===e?null:e)},[h,f]);const Y=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),Z=t.useMemo(()=>i.map(e=>Ft(e,d)),[i,d]),J=t.useMemo(()=>l.map(e=>Bt(e,u)),[l,u]),ee=t.useCallback(()=>{W(e=>Math.min(e+1,Y.length-1))},[Y.length]),te=t.useCallback(()=>{W(e=>Math.max(e-1,-1))},[]),re=t.useCallback(()=>{B>=0&&Y[B]&&C?.(Y[B]._raw,B)},[B,Y,C]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>B,setActiveIndex:W,selectActive:re,navigateNext:ee,navigatePrevious:te,focus:()=>F.current?.focus(),close:()=>M?.()}),[B,re,ee,te,M]),t.useEffect(()=>{if(B>=0&&F.current){const e=F.current.querySelector(`[data-index="${B}"]`);e&&er(e,F.current)}},[B]),!o)return null;const ae=Kt(m),oe=J.length>0,ne=Z;return t.createElement("div",{ref:F,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-pinterest-dropdown",E,S.root),style:Gt(D.root,{width:v,zIndex:x},ae,w),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n .seekora-pinterest-dropdown .categories-scroll::-webkit-scrollbar {\n display: none;\n }\n "),A||a&&t.createElement("div",{style:D.header},t.createElement("div",{style:D.searchInfo},t.createElement("span",{style:D.searchQuery},a?`"${a}"`:"Explore"),Z.length>0&&t.createElement("span",{style:D.searchCount},Z.length,"+ ideas")),oe&&t.createElement("div",{style:D.categoriesScroll,className:"categories-scroll"},t.createElement("button",{style:Gt(D.categoryChip,K?void 0:D.categoryChipActive,"all"===O&&K?D.categoryChipHover:void 0),onClick:()=>{Q(null),N?.("all")},onMouseEnter:()=>j("all"),onMouseLeave:()=>j(null)},"All"),J.map(e=>t.createElement("button",{key:e.id,style:Gt(D.categoryChip,K===e.id?D.categoryChipActive:void 0,O===e.id&&K!==e.id?D.categoryChipHover:void 0),onClick:()=>{Q(e.id),N?.(e.id)},onMouseEnter:()=>j(e.id),onMouseLeave:()=>j(null)},e.icon&&t.createElement("img",{src:e.icon,alt:"",style:D.categoryIcon}),e.label,e.count&&t.createElement("span",null,"(",e.count,")"))))),t.createElement("div",{style:{...D.content,maxHeight:k}},t.createElement(t.Fragment,null,Y.length>0&&t.createElement("div",{style:D.suggestionsRow},Y.slice(0,8).map((e,r)=>t.createElement("button",{key:e.id||r,"data-index":r,style:Gt(D.suggestionPill,B===r?D.suggestionPillActive:void 0,V===r&&B!==r?D.suggestionPillHover:void 0),onClick:()=>C?.(e._raw,r),onMouseEnter:()=>{U(r),W(r)},onMouseLeave:()=>U(-1)},t.createElement("span",{style:D.suggestionIcon},a?Ht(e.query,a,{tag:"strong"}):e.query)))),ne.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:D.sectionTitle},t.createElement(ua,null),"Ideas for you"),t.createElement("div",{style:{...D.productsGrid,gridTemplateColumns:`repeat(${b}, 1fr)`}},ne.slice(0,12).map((e,r)=>t.createElement("div",{key:e.id,style:Gt(D.productCard,q===e.id?D.productCardHover:void 0),onClick:()=>R?.(e._raw,r),onMouseEnter:()=>H(e.id),onMouseLeave:()=>H(null)},t.createElement("div",{style:D.productImageContainer},e.image?t.createElement("img",{src:e.image,alt:e.title,style:D.productImage,loading:"lazy"}):t.createElement("div",{style:D.productImagePlaceholder},t.createElement(pa,null)),g&&t.createElement("button",{style:Gt(D.productSaveBtn,q===e.id?D.productSaveBtnVisible:void 0),onClick:t=>{t.stopPropagation(),z?.(e._raw)},"aria-label":"Save"},t.createElement(da,null)),y&&void 0!==e.price&&t.createElement("div",{style:Gt(D.productOverlay,q===e.id?D.productOverlayVisible:void 0)},t.createElement("div",{style:D.productTitleOverlay},e.title),t.createElement("div",{style:D.productPriceOverlay},Wt(e.price,{currency:p.currency||e.currency||"$"})))),!y&&t.createElement("div",{style:D.productInfo},t.createElement("div",{style:D.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:D.productPrice},Wt(e.price,{currency:p.currency||e.currency||"$"}))))))),!n&&0===ne.length&&0===Y.length&&($?$(a):t.createElement("div",{style:D.empty},t.createElement("div",{style:D.emptyIcon},t.createElement(ca,null)),t.createElement("p",null,'No ideas found for "',a,'"'),t.createElement("p",{style:{fontSize:"14px",marginTop:"8px"}},"Try searching for something else"))))),void 0!==_?_:ne.length>0&&t.createElement("div",{style:D.footer},t.createElement("span",{style:{color:"var(--seekora-text-secondary, #767676)",fontSize:"14px"}},ne.length,"+ more ideas"),t.createElement("button",{style:Gt(D.viewAllBtn,G?D.viewAllBtnHover:void 0),onClick:()=>T?.("products"),onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1)},"Explore all")))}),ga=()=>t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor"},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})),fa=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z",clipRule:"evenodd"})),ha=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{d:"M10 2a4 4 0 00-4 4v1H5a1 1 0 00-.994.89l-1 9A1 1 0 004 18h12a1 1 0 00.994-1.11l-1-9A1 1 0 0015 7h-1V6a4 4 0 00-4-4zm2 5V6a2 2 0 10-4 0v1h4zm-6 3a1 1 0 112 0 1 1 0 01-2 0zm7-1a1 1 0 100 2 1 1 0 000-2z"})),ya=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"16",height:"16"},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),ba=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],recentSearches:l=[],suggestionFields:c={query:"query"},productFields:d={id:"id",title:"title"},productDisplay:u={},theme:p={},showPreview:m=!0,asOverlay:g=!0,placeholder:f="Powered by Seekora",showShortcuts:h=!0,actions:y=[],width:b="680px",maxHeight:v="500px",zIndex:k=9999,className:x,style:E,classNames:w={},inputRef:S,onSuggestionSelect:C,onProductClick:R,onRecentClick:I,onClose:N,onSearchSubmit:z,header:T,footer:M,renderEmpty:A}=e;Yr();const _=Qr(),{isMobile:$}=_,L=t.useMemo(()=>({overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",zIndex:9999},root:{backgroundColor:"var(--seekora-bg-surface, rgba(255, 255, 255, 0.95))",borderRadius:"var(--seekora-border-radius, 12px)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.1)",overflow:"hidden",fontFamily:'var(--seekora-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif)',fontSize:"var(--seekora-font-size, 14px)",backdropFilter:"blur(20px)"},searchContainer:{display:"flex",alignItems:"center",padding:"12px 16px",gap:"12px",borderBottom:"1px solid var(--seekora-border-color, rgba(0,0,0,0.1))"},searchIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-tertiary, #86868b)",flexShrink:0},searchInput:{flex:1,border:"none",background:"transparent",fontSize:"17px",fontWeight:300,color:"var(--seekora-text-primary, #1d1d1f)",outline:"none",fontFamily:"inherit"},shortcut:{display:"flex",alignItems:"center",gap:"4px",fontSize:"12px",color:"var(--seekora-text-tertiary, #86868b)"},kbd:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 4px",backgroundColor:"var(--seekora-bg-tertiary, rgba(0,0,0,0.05))",borderRadius:"4px",fontSize:"11px",fontFamily:"SF Mono, Monaco, monospace"},content:{display:"flex",maxHeight:"400px"},resultsColumn:{flex:1,overflowY:"auto",minWidth:"300px"},previewColumn:{width:"280px",borderLeft:"1px solid var(--seekora-border-color, rgba(0,0,0,0.1))",backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.02))",display:"flex",flexDirection:"column"},section:{padding:"8px 0"},sectionTitle:{padding:"8px 16px 6px",fontSize:"11px",fontWeight:600,color:"var(--seekora-text-tertiary, #86868b)",textTransform:"uppercase",letterSpacing:"0.5px"},item:{display:"flex",alignItems:"center",padding:"8px 16px",gap:"12px",cursor:"pointer",transition:"background-color 50ms",margin:"0 8px",borderRadius:"6px"},itemActive:{backgroundColor:"var(--seekora-primary, #007aff)",color:"var(--seekora-text-inverse, #ffffff)"},itemIcon:{width:"32px",height:"32px",borderRadius:"6px",backgroundColor:"var(--seekora-bg-tertiary, #f5f5f7)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-secondary, #515154)",flexShrink:0},itemIconActive:{backgroundColor:"rgba(255,255,255,0.2)",color:"var(--seekora-text-inverse, #ffffff)"},itemIconImage:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"6px"},itemContent:{flex:1,minWidth:0},itemTitle:{fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, #1d1d1f)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemTitleActive:{color:"var(--seekora-text-inverse, #ffffff)"},itemSubtitle:{fontSize:"11px",color:"var(--seekora-text-secondary, #86868b)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"2px"},itemSubtitleActive:{color:"var(--seekora-text-inverse, #ffffff)",opacity:.9},itemAction:{fontSize:"11px",color:"var(--seekora-text-tertiary, #86868b)",opacity:0,transition:"opacity 100ms"},itemActionVisible:{opacity:1},itemActionActive:{color:"var(--seekora-text-inverse, #ffffff)",opacity:.8},previewContent:{flex:1,padding:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},previewImage:{width:"160px",height:"160px",objectFit:"contain",borderRadius:"8px",marginBottom:"16px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},previewTitle:{fontSize:"14px",fontWeight:600,color:"var(--seekora-text-primary, #1d1d1f)",textAlign:"center",marginBottom:"4px"},previewSubtitle:{fontSize:"12px",color:"var(--seekora-text-secondary, #86868b)",textAlign:"center",marginBottom:"8px"},previewPrice:{fontSize:"18px",fontWeight:700,color:"var(--seekora-primary, #007aff)"},previewActions:{display:"flex",gap:"8px",marginTop:"16px"},previewAction:{padding:"6px 12px",fontSize:"12px",fontWeight:500,borderRadius:"6px",border:"none",cursor:"pointer",transition:"all 100ms"},previewActionPrimary:{backgroundColor:"var(--seekora-primary, #007aff)",color:"var(--seekora-text-inverse, #ffffff)"},previewActionSecondary:{backgroundColor:"var(--seekora-bg-tertiary, #f5f5f7)",color:"var(--seekora-text-primary, #1d1d1f)"},footer:{padding:"8px 16px",borderTop:"1px solid var(--seekora-border-color, rgba(0,0,0,0.1))",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"var(--seekora-bg-secondary, rgba(0,0,0,0.02))",fontSize:"11px",color:"var(--seekora-text-tertiary, #86868b)"},footerActions:{display:"flex",alignItems:"center",gap:"16px"},footerAction:{display:"flex",alignItems:"center",gap:"4px"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"40px",color:"var(--seekora-text-secondary, #86868b)"},spinner:{width:"24px",height:"24px",border:"2px solid var(--seekora-border-color, #e5e5e5)",borderTopColor:"var(--seekora-primary, #007aff)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"40px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #86868b)"}}),[]),P=t.useRef(null),D=t.useRef(null),[F,B]=t.useState(-1),W=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),q=t.useMemo(()=>i.map(e=>Ft(e,d)),[i,d]),H=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,3),[l]),O=t.useMemo(()=>{const e=[];return y.forEach(t=>{e.push({type:"action",id:t.id,title:t.label,icon:t.icon,data:t})}),!a&&H.length>0&&H.forEach((r,a)=>{e.push({type:"recent",id:`recent-${a}`,title:r,icon:t.createElement(ya,null),data:r})}),W.forEach((r,a)=>{e.push({type:"suggestion",id:r.id||`suggestion-${a}`,title:r.query,icon:t.createElement(fa,null),data:r})}),q.forEach((r,a)=>{e.push({type:"product",id:r.id,title:r.title,subtitle:r.brand,icon:t.createElement(ha,null),image:r.image,price:r.price,data:r})}),e},[y,a,H,W,q]),j=t.useCallback(()=>{B(e=>Math.min(e+1,O.length-1))},[O.length]),V=t.useCallback(()=>{B(e=>Math.max(e-1,-1))},[]),U=t.useCallback(()=>{if(F<0)return void(a.trim()&&z?.(a.trim()));const e=O[F];if(e)switch(e.type){case"action":e.data.onAction?.();break;case"recent":I?.(e.data);break;case"suggestion":C?.(e.data._raw,F);break;case"product":R?.(e.data._raw,F)}},[F,O,a,z,I,C,R]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>F,setActiveIndex:B,selectActive:U,navigateNext:j,navigatePrevious:V,focus:()=>S?.current?.focus(),close:()=>N?.()}),[F,U,j,V,S,N]),t.useEffect(()=>{if(D.current&&F>=0){const e=D.current.querySelector(`[data-index="${F}"]`);e&&er(e,D.current)}},[F]),t.useEffect(()=>{B(-1)},[a]),!o)return null;const K=Kt(p),Q=O[F],G=t.createElement("div",{ref:P,className:Qt("seekora-spotlight-dropdown",x,w.root),style:Gt(L.root,{width:b,zIndex:g?void 0:k},K,E)},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),t.createElement("div",{style:L.searchContainer},t.createElement("div",{style:L.searchIcon},t.createElement(ga,null)),t.createElement("input",{ref:S,type:"text",placeholder:f,defaultValue:a,style:L.searchInput,onChange:e=>z?.(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),j()):"ArrowUp"===e.key?(e.preventDefault(),V()):"Enter"===e.key?(e.preventDefault(),U()):"Escape"===e.key&&N?.()},autoFocus:!0}),h&&t.createElement("div",{style:L.shortcut},t.createElement("span",{style:L.kbd},"⌘"),t.createElement("span",{style:L.kbd},"K"))),T,t.createElement("div",{style:L.content},t.createElement("div",{ref:D,style:{...L.resultsColumn,maxHeight:v}},0===O.length?A?A(a):t.createElement("div",{style:L.empty},'No results for "',a,'"'):t.createElement(t.Fragment,null,y.length>0&&t.createElement("div",{style:L.section},t.createElement("div",{style:L.sectionTitle},"Actions"),O.filter(e=>"action"===e.type).map(e=>{const r=O.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:Gt(L.item,a?L.itemActive:void 0),onClick:()=>{B(r),U()},onMouseEnter:()=>B(r)},t.createElement("div",{style:Gt(L.itemIcon,a?L.itemIconActive:void 0)},e.icon),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:Gt(L.itemTitle,a?L.itemTitleActive:void 0)},e.title)))})),H.length>0&&!a&&t.createElement("div",{style:L.section},t.createElement("div",{style:L.sectionTitle},"Recent"),O.filter(e=>"recent"===e.type).map(e=>{const r=O.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:Gt(L.item,a?L.itemActive:void 0),onClick:()=>{B(r),I?.(e.data)},onMouseEnter:()=>B(r)},t.createElement("div",{style:Gt(L.itemIcon,a?L.itemIconActive:void 0)},e.icon),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:Gt(L.itemTitle,a?L.itemTitleActive:void 0)},e.title)))})),W.length>0&&t.createElement("div",{style:L.section},t.createElement("div",{style:L.sectionTitle},"Suggestions"),O.filter(e=>"suggestion"===e.type).map(e=>{const r=O.indexOf(e),o=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:Gt(L.item,o?L.itemActive:void 0),onClick:()=>{B(r),C?.(e.data._raw,r)},onMouseEnter:()=>B(r)},t.createElement("div",{style:Gt(L.itemIcon,o?L.itemIconActive:void 0)},e.icon),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:Gt(L.itemTitle,o?L.itemTitleActive:void 0)},Ht(e.title,a,{tag:"strong"}))))})),q.length>0&&t.createElement("div",{style:L.section},t.createElement("div",{style:L.sectionTitle},"Products"),O.filter(e=>"product"===e.type).map(e=>{const r=O.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:Gt(L.item,a?L.itemActive:void 0),onClick:()=>{B(r),R?.(e.data._raw,r)},onMouseEnter:()=>B(r)},t.createElement("div",{style:Gt(L.itemIcon,a?L.itemIconActive:void 0)},e.image?t.createElement("img",{src:e.image,alt:"",style:L.itemIconImage}):e.icon),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:Gt(L.itemTitle,a?L.itemTitleActive:void 0)},e.title),e.subtitle&&t.createElement("div",{style:Gt(L.itemSubtitle,a?L.itemSubtitleActive:void 0)},e.subtitle)),void 0!==e.price&&t.createElement("span",{style:Gt(L.itemAction,L.itemActionVisible,a?L.itemActionActive:void 0)},Wt(e.price,{currency:u.currency})))})))),m&&Q&&"product"===Q.type&&t.createElement("div",{style:L.previewColumn},t.createElement("div",{style:L.previewContent},Q.image&&t.createElement("img",{src:Q.image,alt:"",style:L.previewImage}),t.createElement("div",{style:L.previewTitle},Q.title),Q.subtitle&&t.createElement("div",{style:L.previewSubtitle},Q.subtitle),void 0!==Q.price&&t.createElement("div",{style:L.previewPrice},Wt(Q.price,{currency:u.currency})),t.createElement("div",{style:L.previewActions},t.createElement("button",{style:{...L.previewAction,...L.previewActionPrimary},onClick:()=>R?.(Q.data._raw,F)},"View Product"))))),void 0!==M?M:t.createElement("div",{style:L.footer},t.createElement("div",{style:L.footerActions},t.createElement("span",{style:L.footerAction},t.createElement("span",{style:L.kbd},"↑"),t.createElement("span",{style:L.kbd},"↓"),"navigate"),t.createElement("span",{style:L.footerAction},t.createElement("span",{style:L.kbd},"↵"),"select"),t.createElement("span",{style:L.footerAction},t.createElement("span",{style:L.kbd},"esc"),"close")),t.createElement("span",null,O.length," results")));return g?t.createElement("div",{style:{...L.overlay,zIndex:k},onClick:e=>{e.target===e.currentTarget&&N?.()}},G):G}),va=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},t.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"})),ka=()=>t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor"},t.createElement("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})),xa=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],categories:l=[],suggestionFields:c={query:"query"},productFields:d={id:"id",title:"title"},categoryFields:u={id:"id",label:"label"},productDisplay:p={},theme:m={},showHeroProduct:g=!0,showCollections:f=!0,showAddToCart:h=!0,addToCartText:y="Quick Add",showComparePrice:b=!0,width:v="100%",maxHeight:k="500px",zIndex:x=1e3,className:E,style:w,classNames:S={},onSuggestionSelect:C,onProductClick:R,onCategoryClick:I,onTabChange:N,onAddToCart:z,onViewAll:T,onClose:M,header:A,footer:_,renderEmpty:$}=e;Yr();const L=Qr(),{isMobile:P}=L,D=t.useMemo(()=>((e=!1)=>({root:{position:e?"fixed":"absolute",top:e?0:"100%",left:0,right:0,bottom:e?0:"auto",marginTop:e?0:"8px",backgroundColor:"var(--seekora-bg-surface, transparent)",color:"var(--seekora-text-primary, inherit)",borderRadius:e?0:"16px",boxShadow:e?"none":"0 4px 30px rgba(0, 0, 0, 0.12)",overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:e?"16px":"14px",display:"flex",flexDirection:"column"},layout:{display:e?"flex":"grid",flexDirection:"column",gridTemplateColumns:e?"1fr":"1fr 1fr",minHeight:e?"auto":"400px",flex:1,overflowY:"auto"},leftPanel:{backgroundColor:"var(--seekora-bg-surface, transparent)",borderRight:e?"none":"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderBottom:e?"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))":"none",display:"flex",flexDirection:"column"},rightPanel:{backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",padding:e?"16px":"24px",display:"flex",flexDirection:"column",overflow:"hidden"},section:{flex:1,overflowY:"auto"},sectionHeader:{padding:"16px 20px 12px",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))"},sectionTitle:{fontSize:"11px",fontWeight:600,color:"var(--seekora-text-secondary, #666)",textTransform:"uppercase",letterSpacing:"0.1em"},viewAllLink:{fontSize:"12px",color:"var(--seekora-text-primary, inherit)",textDecoration:"underline",cursor:"pointer"},suggestionItem:{display:"flex",alignItems:"center",padding:e?"14px 16px":"12px 16px",gap:"12px",cursor:"pointer",transition:"all 150ms ease",minHeight:"48px",margin:"4px 8px",borderRadius:"10px",color:"var(--seekora-text-primary, inherit)"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))",color:"var(--seekora-text-primary, inherit)"},suggestionIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--seekora-text-tertiary, #999999)",flexShrink:0},suggestionContent:{flex:1,minWidth:0},suggestionQuery:{fontSize:"14px",color:"var(--seekora-text-primary, inherit)",fontWeight:400},suggestionMeta:{fontSize:"12px",color:"var(--seekora-text-secondary, inherit)",marginTop:"2px"},suggestionArrow:{width:"16px",height:"16px",color:"var(--seekora-text-tertiary, #ccc)",transform:"rotate(-45deg)",opacity:0,transition:"opacity 150ms"},suggestionArrowVisible:{opacity:1},collectionsGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"1px",backgroundColor:"var(--seekora-border-color, rgba(128,128,128,0.2))",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))"},collectionItem:{backgroundColor:"var(--seekora-bg-surface, transparent)",color:"var(--seekora-text-primary, inherit)",padding:"16px 20px",cursor:"pointer",transition:"background-color 150ms"},collectionItemHover:{backgroundColor:"var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))",color:"var(--seekora-text-primary, inherit)"},collectionName:{fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",marginBottom:"4px"},collectionCount:{fontSize:"11px",color:"var(--seekora-text-secondary, inherit)"},heroProduct:{marginBottom:"24px"},heroImage:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:"2px",marginBottom:"16px",backgroundColor:"var(--seekora-bg-tertiary, #f5f5f5)"},heroTitle:{fontSize:"16px",fontWeight:500,color:"var(--seekora-text-primary, inherit)",marginBottom:"8px",lineHeight:1.3},heroBrand:{fontSize:"12px",color:"var(--seekora-text-secondary, inherit)",marginBottom:"12px",textTransform:"uppercase",letterSpacing:"0.05em"},heroPricing:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px"},heroPrice:{fontSize:"18px",fontWeight:500,color:"var(--seekora-text-primary, inherit)"},heroComparePrice:{fontSize:"14px",color:"var(--seekora-text-tertiary, #999)",textDecoration:"line-through"},heroDiscount:{fontSize:"12px",fontWeight:600,color:"var(--seekora-error, #d02e2e)",backgroundColor:"var(--seekora-error-light, #fdf2f2)",padding:"2px 8px",borderRadius:"2px"},heroButton:{width:"100%",padding:"14px 20px",backgroundColor:"var(--seekora-text-primary, inherit)",color:"var(--seekora-bg-surface, transparent)",border:"none",borderRadius:"2px",fontSize:"13px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.1em",cursor:"pointer",transition:"background-color 150ms"},heroButtonHover:{backgroundColor:"var(--seekora-text-secondary, inherit)",color:"var(--seekora-bg-surface, transparent)"},productsScroll:{flex:1,overflowX:"auto",overflowY:"hidden",display:"flex",gap:"16px",paddingBottom:"8px",scrollbarWidth:"thin"},productCard:{flex:"0 0 140px",cursor:"pointer",transition:"opacity 150ms"},productCardHover:{opacity:.7},productImage:{width:"140px",height:"175px",objectFit:"cover",backgroundColor:"var(--seekora-bg-tertiary, #f5f5f5)",marginBottom:"10px"},productTitle:{fontSize:"12px",color:"var(--seekora-text-primary, inherit)",marginBottom:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},productPrice:{fontSize:"12px",fontWeight:500,color:"var(--seekora-text-primary, inherit)"},footer:{padding:"12px 20px",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"11px",color:"var(--seekora-text-secondary, inherit)"},footerLink:{color:"var(--seekora-text-primary, inherit)",textDecoration:"underline",cursor:"pointer"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, inherit)"},spinner:{width:"24px",height:"24px",border:"2px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderTopColor:"var(--seekora-text-primary, inherit)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"60px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #666)"},highlight:{fontWeight:600,textDecoration:"underline",textDecorationColor:"var(--seekora-text-primary, #121212)"}}))(P),[P]),F=t.useRef(null),[B,W]=t.useState(-1),[q,H]=t.useState(null),[O,j]=t.useState(null),[V,U]=t.useState(!1),K=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),Q=t.useMemo(()=>i.map(e=>Ft(e,d)),[i,d]),G=t.useMemo(()=>l.map(e=>Bt(e,u)),[l,u]),X=Q[0],Y=Q.slice(1,7),Z=t.useCallback(()=>{W(e=>Math.min(e+1,K.length-1))},[K.length]),J=t.useCallback(()=>{W(e=>Math.max(e-1,-1))},[]),ee=t.useCallback(()=>{B>=0&&K[B]&&C?.(K[B]._raw,B)},[B,K,C]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>B,setActiveIndex:W,selectActive:ee,navigateNext:Z,navigatePrevious:J,focus:()=>F.current?.focus(),close:()=>M?.()}),[B,ee,Z,J,M]),t.useEffect(()=>{if(B>=0&&F.current){const e=F.current.querySelector(`[data-index="${B}"]`);e&&er(e,F.current)}},[B]),!o)return null;const te=Kt(m),re=X?((e,t)=>{if(e&&t&&!(t<=e))return Math.round((t-e)/t*100)})(X.price,X.comparePrice):void 0;return t.createElement("div",{ref:F,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-shopify-dropdown",E,S.root),style:Gt(D.root,{width:P?"100%":v,maxHeight:P?"100vh":k,zIndex:x},te,w),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n .seekora-shopify-dropdown mark {\n background: transparent;\n text-decoration: underline;\n font-weight: 600;\n }\n "),A,t.createElement("div",{style:D.layout},t.createElement("div",{style:D.leftPanel},t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Suggestions"),K.length>5&&t.createElement("span",{style:D.viewAllLink,onClick:()=>T?.("suggestions")},"View all")),K.slice(0,5).map((e,r)=>{const o=B===r;return t.createElement("div",{key:e.id||r,"data-index":r,role:"option","aria-selected":o,style:Gt(D.suggestionItem,o?D.suggestionItemActive:void 0),onClick:()=>C?.(e._raw,r),onMouseEnter:()=>W(r)},t.createElement("div",{style:D.suggestionIcon},t.createElement(va,null)),t.createElement("div",{style:D.suggestionContent},t.createElement("div",{style:D.suggestionQuery},Ht(e.query,a,{tag:"mark"})),e.count&&t.createElement("div",{style:D.suggestionMeta},e.count," results")),t.createElement("div",{style:Gt(D.suggestionArrow,o?D.suggestionArrowVisible:void 0)},t.createElement(ka,null)))}),0===K.length&&a&&($?$(a):t.createElement("div",{style:{padding:"20px",textAlign:"center",color:"#666"}},'No suggestions for "',a,'"'))),f&&G.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Collections")),t.createElement("div",{style:D.collectionsGrid},G.slice(0,4).map(e=>t.createElement("div",{key:e.id,style:Gt(D.collectionItem,O===e.id?D.collectionItemHover:void 0),onClick:()=>N?.(e.id),onMouseEnter:()=>j(e.id),onMouseLeave:()=>j(null)},t.createElement("div",{style:D.collectionName},e.label),e.count&&t.createElement("div",{style:D.collectionCount},e.count," products")))))),t.createElement("div",{style:D.rightPanel},g&&X&&t.createElement("div",{style:D.heroProduct},X.image&&t.createElement("img",{src:X.image,alt:X.title,style:D.heroImage,loading:"lazy"}),X.brand&&t.createElement("div",{style:D.heroBrand},X.brand),t.createElement("div",{style:D.heroTitle},X.title),t.createElement("div",{style:D.heroPricing},t.createElement("span",{style:D.heroPrice},Wt(X.price,{currency:p.currency||X.currency||"$"})),b&&X.comparePrice&&t.createElement("span",{style:D.heroComparePrice},Wt(X.comparePrice,{currency:p.currency||X.currency||"$"})),re&&t.createElement("span",{style:D.heroDiscount},"-",re,"%")),h&&t.createElement("button",{style:Gt(D.heroButton,V?D.heroButtonHover:void 0),onClick:()=>z?.(X._raw),onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1)},y)),Y.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{...D.sectionTitle,marginBottom:"12px"}},"More Products"),t.createElement("div",{style:D.productsScroll},Y.map((e,r)=>t.createElement("div",{key:e.id,style:Gt(D.productCard,q===e.id?D.productCardHover:void 0),onClick:()=>R?.(e._raw,r+1),onMouseEnter:()=>H(e.id),onMouseLeave:()=>H(null)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:D.productImage,loading:"lazy"}):t.createElement("div",{style:D.productImage}),t.createElement("div",{style:D.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:D.productPrice},Wt(e.price,{currency:p.currency||e.currency||"$"})))))))),void 0!==_?_:t.createElement("div",{style:D.footer},t.createElement("span",null,"Press ",t.createElement("strong",null,"Enter")," to search, ",t.createElement("strong",null,"↑↓")," to navigate"),t.createElement("span",{style:D.footerLink,onClick:()=>T?.("products")},"View all results")))}),Ea=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},t.createElement("circle",{cx:"11",cy:"11",r:"7"}),t.createElement("path",{d:"M21 21l-4.35-4.35"})),wa=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},t.createElement("circle",{cx:"12",cy:"12",r:"10"}),t.createElement("polyline",{points:"12 6 12 12 16 14"})),Sa=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},t.createElement("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18"}),t.createElement("polyline",{points:"17 6 23 6 23 12"})),Ca=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"20",height:"20"},t.createElement("polyline",{points:"9 18 15 12 9 6"})),Ra=()=>t.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"20",height:"20"},t.createElement("path",{d:"M7 17l5-5-5-5M13 17l5-5-5-5"})),Ia=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],recentSearches:l=[],trendingSearches:c=[],suggestionFields:d={query:"query"},productFields:u={id:"id",title:"title"},productDisplay:p={},theme:m={},showSearchInput:g=!0,showCancel:f=!0,cancelText:h="Cancel",showDragHandle:y=!0,swipeToDismiss:b=!0,footerButtonText:v="Search",showFooterButton:k=!0,width:x="100%",maxHeight:E="85vh",zIndex:w=9999,className:S,style:C,classNames:R={},inputRef:I,onSuggestionSelect:N,onProductClick:z,onRecentClick:T,onRecentClearAll:M,onSearchSubmit:A,onClose:_,header:$,footer:L,renderEmpty:P}=e;Yr();const D=t.useMemo(()=>({overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:9998,transition:"opacity 200ms ease"},root:{position:"fixed",left:0,right:0,bottom:0,backgroundColor:"var(--seekora-bg-surface, transparent)",borderRadius:"16px 16px 0 0",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.15)",fontFamily:'var(--seekora-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif)',fontSize:"var(--seekora-font-size, 16px)",zIndex:9999,transform:"translateY(0)",transition:"transform 300ms cubic-bezier(0.32, 0.72, 0, 1)",maxHeight:"90vh",display:"flex",flexDirection:"column"},rootHidden:{transform:"translateY(100%)"},dragHandle:{display:"flex",justifyContent:"center",padding:"12px",cursor:"grab"},dragBar:{width:"36px",height:"5px",backgroundColor:"var(--seekora-border-color, rgba(128,128,128,0.2))",borderRadius:"3px"},header:{padding:"0 16px 16px",borderBottom:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))"},searchContainer:{display:"flex",alignItems:"center",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))",borderRadius:"12px",padding:"12px 16px",gap:"12px"},searchIcon:{width:"20px",height:"20px",color:"var(--seekora-text-tertiary, #8e8e93)",flexShrink:0},searchInput:{flex:1,border:"none",background:"transparent",fontSize:"17px",color:"var(--seekora-text-primary, inherit)",outline:"none"},cancelBtn:{padding:"8px",background:"none",border:"none",color:"var(--seekora-primary, #007aff)",fontSize:"17px",cursor:"pointer"},content:{flex:1,overflowY:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch"},section:{padding:"8px 0"},sectionHeader:{padding:"16px 16px 8px",display:"flex",alignItems:"center",justifyContent:"space-between"},sectionTitle:{fontSize:"13px",fontWeight:600,color:"var(--seekora-text-secondary, #8e8e93)",textTransform:"uppercase",letterSpacing:"0.5px"},clearBtn:{fontSize:"15px",color:"var(--seekora-primary, #007aff)",background:"none",border:"none",cursor:"pointer"},item:{display:"flex",alignItems:"center",padding:"14px 16px",gap:"14px",cursor:"pointer",transition:"background-color 100ms",minHeight:"56px",color:"var(--seekora-text-primary, inherit)"},itemActive:{backgroundColor:"var(--seekora-bg-hover, rgba(255, 255, 255, 0.1))",color:"var(--seekora-text-primary, inherit)"},itemIcon:{width:"24px",height:"24px",color:"var(--seekora-text-tertiary, #8e8e93)",flexShrink:0},itemImage:{width:"48px",height:"48px",borderRadius:"8px",objectFit:"cover",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",flexShrink:0},itemContent:{flex:1,minWidth:0},itemTitle:{fontSize:"17px",color:"var(--seekora-text-primary, inherit)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemSubtitle:{fontSize:"15px",color:"var(--seekora-text-secondary, inherit)",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemAction:{color:"var(--seekora-text-tertiary, #c7c7cc)",flexShrink:0},productsScroll:{display:"flex",gap:"12px",padding:"0 16px 16px",overflowX:"auto",scrollSnapType:"x mandatory",WebkitOverflowScrolling:"touch"},productCard:{flex:"0 0 140px",scrollSnapAlign:"start",cursor:"pointer"},productImage:{width:"140px",height:"140px",borderRadius:"12px",objectFit:"cover",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",marginBottom:"8px"},productTitle:{fontSize:"15px",color:"var(--seekora-text-primary, inherit)",marginBottom:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},productPrice:{fontSize:"15px",fontWeight:600,color:"var(--seekora-text-primary, inherit)"},footer:{padding:"12px 16px",paddingBottom:"calc(12px + env(safe-area-inset-bottom, 0px))",borderTop:"1px solid var(--seekora-border-color, rgba(128,128,128,0.2))",backgroundColor:"var(--seekora-bg-secondary, rgba(255, 255, 255, 0.1))"},footerBtn:{width:"100%",padding:"16px",backgroundColor:"var(--seekora-primary, #007aff)",color:"var(--seekora-text-inverse, transparent)",border:"none",borderRadius:"12px",fontSize:"17px",fontWeight:600,cursor:"pointer"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, inherit)"},spinner:{width:"28px",height:"28px",border:"3px solid var(--seekora-border-color, rgba(128,128,128,0.2))",borderTopColor:"var(--seekora-primary, #007aff)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"60px 20px",textAlign:"center",color:"var(--seekora-text-secondary, inherit)",fontSize:"17px"},emptyIcon:{width:"48px",height:"48px",margin:"0 auto 16px",color:"var(--seekora-text-tertiary, #c7c7cc)"}}),[]),F=t.useRef(null),[B,W]=t.useState(-1),[q,H]=t.useState(a),[O,j]=t.useState(0),[V,U]=t.useState(!1),K=t.useRef(0),Q=t.useMemo(()=>s.map(e=>Dt(e,d)),[s,d]),G=t.useMemo(()=>i.map(e=>Ft(e,u)),[i,u]),X=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,5),[l]),Y=t.useMemo(()=>c.map(e=>"string"==typeof e?e:e.query).slice(0,5),[c]),Z=t.useMemo(()=>{const e=[];return X.forEach(t=>e.push({type:"recent",data:t})),Y.forEach(t=>e.push({type:"trending",data:t})),Q.forEach(t=>e.push({type:"suggestion",data:t})),e},[X,Y,Q]),J=t.useCallback(()=>{W(e=>Math.min(e+1,Z.length-1))},[Z.length]),ee=t.useCallback(()=>{W(e=>Math.max(e-1,-1))},[]),te=t.useCallback(()=>{if(B<0||B>=Z.length)return void(q.trim()&&A?.(q.trim()));const e=Z[B];"recent"===e.type||"trending"===e.type?T?.(e.data):"suggestion"===e.type&&N?.(e.data._raw,B)},[B,Z,q,A,T,N]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>B,setActiveIndex:W,selectActive:te,navigateNext:J,navigatePrevious:ee,focus:()=>I?.current?.focus(),close:()=>_?.()}),[B,te,J,ee,I,_]),t.useEffect(()=>{if(B>=0&&F.current){const e=F.current.querySelector(`[data-index="${B}"]`);e&&er(e,F.current)}},[B]);if(t.useEffect(()=>{H(a)},[a]),!o)return null;const re=Kt(m),ae=!q&&X.length>0,oe=!q&&Y.length>0,ne=G.length>0;return t.createElement(t.Fragment,null,t.createElement("div",{style:{...D.overlay,opacity:V?1-O/300:1},onClick:_}),t.createElement("div",{ref:F,className:Qt("seekora-mobile-sheet",S,R.root),style:Gt(D.root,{maxHeight:E,zIndex:w,transform:V?`translateY(${O}px)`:"translateY(0)"},re,C),onTouchStart:e=>{b&&(U(!0),K.current=e.touches[0].clientY)},onTouchMove:e=>{if(!V)return;const t=e.touches[0].clientY-K.current;t>0&&j(t)},onTouchEnd:()=>{V&&(U(!1),O>150&&_?.(),j(0))}},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),y&&t.createElement("div",{style:D.dragHandle},t.createElement("div",{style:D.dragBar})),(g||$)&&t.createElement("div",{style:D.header},$||t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},t.createElement("div",{style:D.searchContainer},t.createElement("div",{style:D.searchIcon},t.createElement(Ea,null)),t.createElement("input",{ref:I,type:"text",placeholder:"Powered by Seekora",value:q,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),B>=0?te():q.trim()&&A?.(q.trim())):"ArrowDown"===e.key?(e.preventDefault(),J()):"ArrowUp"===e.key?(e.preventDefault(),ee()):"Escape"===e.key&&_?.()},style:D.searchInput,autoFocus:!0})),f&&t.createElement("button",{style:D.cancelBtn,onClick:_},h))),t.createElement("div",{style:D.content},t.createElement(t.Fragment,null,ae&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Recent"),t.createElement("button",{style:D.clearBtn,onClick:M},"Clear")),X.map((e,r)=>t.createElement("div",{key:`recent-${e}`,"data-index":r,style:Gt(D.item,B===r?D.itemActive:void 0),onClick:()=>{T?.(e),H(e)},onMouseEnter:()=>W(r)},t.createElement("div",{style:D.itemIcon},t.createElement(wa,null)),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:D.itemTitle},e)),t.createElement("div",{style:D.itemAction},t.createElement(Ra,null))))),oe&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Trending")),Y.map((e,r)=>{const a=X.length+r;return t.createElement("div",{key:`trending-${e}`,"data-index":a,style:Gt(D.item,B===a?D.itemActive:void 0),onClick:()=>{T?.(e),H(e)},onMouseEnter:()=>W(a)},t.createElement("div",{style:D.itemIcon},t.createElement(Sa,null)),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:D.itemTitle},e)),t.createElement("div",{style:D.itemAction},t.createElement(Ca,null)))})),q&&Q.length>0&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Suggestions")),Q.map((e,r)=>{const a=X.length+Y.length+r;return t.createElement("div",{key:e.id||r,"data-index":a,style:Gt(D.item,B===a?D.itemActive:void 0),onClick:()=>N?.(e._raw,r),onMouseEnter:()=>W(a)},t.createElement("div",{style:D.itemIcon},t.createElement(Ea,null)),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:D.itemTitle},Ht(e.query,q,{tag:"strong"})),e.count&&t.createElement("div",{style:D.itemSubtitle},e.count," results")),t.createElement("div",{style:D.itemAction},t.createElement(Ca,null)))})),ne&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionHeader},t.createElement("span",{style:D.sectionTitle},"Products")),t.createElement("div",{style:D.productsScroll},G.slice(0,8).map((e,r)=>t.createElement("div",{key:e.id,style:D.productCard,onClick:()=>z?.(e._raw,r)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:D.productImage,loading:"lazy"}):t.createElement("div",{style:D.productImage}),t.createElement("div",{style:D.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:D.productPrice},Wt(e.price,{currency:p.currency||e.currency||"$"})))))),q&&0===Q.length&&!n&&(P?P(q):t.createElement("div",{style:D.empty},t.createElement("div",{style:D.emptyIcon},t.createElement(Ea,null)),t.createElement("p",null,'No results for "',q,'"'))))),void 0!==L?L:k&&q&&t.createElement("div",{style:D.footer},t.createElement("button",{style:D.footerBtn,onClick:()=>A?.(q)},v,' "',q,'"'))))}),Na=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,loading:n=!1,suggestions:s=[],products:i=[],recentSearches:l=[],suggestionFields:c={query:"query"},productFields:d={id:"id",title:"title"},productDisplay:u={},theme:p={},showIndices:m=!1,showTypeLabels:g=!1,showSectionDividers:f=!0,width:h="100%",maxHeight:y="400px",zIndex:b=1e3,className:v,style:k,classNames:x={},onSuggestionSelect:E,onProductClick:w,onRecentClick:S,onClose:C,onSearchSubmit:R,header:I,footer:N,renderEmpty:z}=e;Yr();const T=Qr(),{isMobile:M}=T,A=t.useMemo(()=>({root:{position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e5e5)",fontFamily:'var(--seekora-font-family, "Inter", -apple-system, sans-serif)',fontSize:"var(--seekora-font-size, 15px)",letterSpacing:"-0.01em"},item:{display:"flex",alignItems:"center",padding:"16px 20px",cursor:"pointer",transition:"background-color 150ms ease, padding-left 150ms ease",borderBottom:"1px solid var(--seekora-border-color, #e8e8e8)",gap:"16px",color:"var(--seekora-text-primary, #111)"},itemLast:{borderBottom:"none"},itemActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #111)",paddingLeft:"24px"},itemIndex:{fontSize:"11px",fontWeight:500,color:"var(--seekora-text-tertiary, #999)",fontFamily:"monospace",minWidth:"20px"},itemContent:{flex:1,minWidth:0},itemQuery:{fontSize:"15px",fontWeight:500,color:"var(--seekora-text-primary, #111)"},itemMeta:{fontSize:"13px",color:"var(--seekora-text-secondary, #666)",marginTop:"4px",fontWeight:400},itemType:{fontSize:"10px",fontWeight:600,color:"var(--seekora-text-tertiary, #999)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"4px 8px",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)"},productRow:{display:"flex",alignItems:"center",padding:"16px 20px",cursor:"pointer",transition:"background-color 150ms ease",borderBottom:"1px solid var(--seekora-border-color, #e8e8e8)",gap:"16px",color:"var(--seekora-text-primary, #111)"},productRowActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #111)"},productImage:{width:"56px",height:"56px",objectFit:"cover",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",flexShrink:0},productContent:{flex:1,minWidth:0},productTitle:{fontSize:"14px",fontWeight:500,color:"var(--seekora-text-primary, #111)",marginBottom:"4px"},productPrice:{fontSize:"14px",color:"var(--seekora-text-secondary, #666)"},divider:{padding:"12px 20px 8px",fontSize:"10px",fontWeight:600,color:"var(--seekora-text-tertiary, #999)",textTransform:"uppercase",letterSpacing:"0.15em",backgroundColor:"var(--seekora-bg-surface, #ffffff)",borderBottom:"1px solid var(--seekora-border-color, #f0f0f0)"},footer:{padding:"12px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"var(--seekora-bg-secondary, #fafafa)",fontSize:"12px",color:"var(--seekora-text-tertiary, #999)",borderTop:"1px solid var(--seekora-border-color, #e5e5e5)"},footerHint:{display:"flex",alignItems:"center",gap:"12px"},kbd:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"2px 6px",backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #ddd)",fontSize:"10px",fontFamily:"monospace"},loading:{padding:"40px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #666)",fontSize:"14px"},empty:{padding:"40px 20px",textAlign:"center",color:"var(--seekora-text-secondary, #666)",fontSize:"14px"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fff3cd)",padding:"0 2px"}}),[]),_=t.useRef(null),$=t.useRef(null),[L,P]=t.useState(-1),D=t.useMemo(()=>s.map(e=>Dt(e,c)),[s,c]),F=t.useMemo(()=>i.map(e=>Ft(e,d)),[i,d]),B=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,3),[l]),W=t.useMemo(()=>{const e=[];return!a&&B.length>0&&B.forEach(t=>e.push({type:"recent",data:t})),D.forEach(t=>e.push({type:"suggestion",data:t})),F.forEach(t=>e.push({type:"product",data:t})),e},[a,B,D,F]),q=t.useCallback(()=>{P(e=>Math.min(e+1,W.length-1))},[W.length]),H=t.useCallback(()=>{P(e=>Math.max(e-1,-1))},[]),O=t.useCallback(()=>{const e=W[L];if(e)switch(e.type){case"recent":S?.(e.data);break;case"suggestion":E?.(e.data._raw,L);break;case"product":w?.(e.data._raw,L)}else a&&R?.(a)},[L,W,a,R,S,E,w]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>L,setActiveIndex:P,selectActive:O,navigateNext:q,navigatePrevious:H,focus:()=>_.current?.focus(),close:()=>C?.()}),[L,O,q,H,C]),t.useEffect(()=>{if($.current&&L>=0){const e=$.current.querySelector(`[data-index="${L}"]`);e&&er(e,$.current)}},[L]),t.useEffect(()=>{P(-1)},[a]),!o)return null;const j=Kt(p),V=!a&&B.length>0;let U=0;return t.createElement("div",{ref:_,role:"listbox","aria-label":"Search suggestions",className:Qt("seekora-minimal-dropdown",v,x.root),style:Gt(A.root,{width:h,zIndex:b},j,k),tabIndex:-1},t.createElement("style",null,"\n .seekora-minimal-dropdown mark {\n background-color: var(--seekora-highlight-bg, #fff3cd);\n padding: 0 2px;\n }\n "),I,t.createElement("div",{ref:$,style:{maxHeight:y,overflowY:"auto"}},0===W.length?z?z(a):t.createElement("div",{style:A.empty},a?`No results for "${a}"`:"Start typing to search"):t.createElement(t.Fragment,null,V&&t.createElement(t.Fragment,null,f&&t.createElement("div",{style:A.divider},"Recent"),B.map((e,r)=>{const a=U++,o=L===a,n=r===B.length-1&&!D.length&&!F.length;return t.createElement("div",{key:`recent-${e}`,"data-index":a,style:Gt(A.item,o?A.itemActive:void 0,n?A.itemLast:void 0),onClick:()=>S?.(e),onMouseEnter:()=>P(a)},m&&t.createElement("span",{style:A.itemIndex},a+1),t.createElement("div",{style:A.itemContent},t.createElement("div",{style:A.itemQuery},e)),g&&t.createElement("span",{style:A.itemType},"Recent"))})),D.length>0&&t.createElement(t.Fragment,null,f&&(V||!1)&&t.createElement("div",{style:A.divider},"Suggestions"),D.map((e,r)=>{const o=U++,n=L===o,s=r===D.length-1&&!F.length;return t.createElement("div",{key:e.id||`suggestion-${r}`,"data-index":o,style:Gt(A.item,n?A.itemActive:void 0,s?A.itemLast:void 0),onClick:()=>E?.(e._raw,r),onMouseEnter:()=>P(o)},m&&t.createElement("span",{style:A.itemIndex},o+1),t.createElement("div",{style:A.itemContent},t.createElement("div",{style:A.itemQuery},Ht(e.query,a,{tag:"mark"})),e.count&&t.createElement("div",{style:A.itemMeta},e.count.toLocaleString()," results")),g&&t.createElement("span",{style:A.itemType},"Search"))})),F.length>0&&t.createElement(t.Fragment,null,f&&t.createElement("div",{style:A.divider},"Products"),F.slice(0,4).map((e,r)=>{const a=U++,o=L===a;return t.createElement("div",{key:e.id,"data-index":a,style:Gt(A.productRow,o?A.productRowActive:void 0),onClick:()=>w?.(e._raw,r),onMouseEnter:()=>P(a)},e.image&&t.createElement("img",{src:e.image,alt:e.title,style:A.productImage,loading:"lazy"}),t.createElement("div",{style:A.productContent},t.createElement("div",{style:A.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:A.productPrice},Wt(e.price,{currency:u.currency||e.currency||"$"}))),g&&t.createElement("span",{style:A.itemType},"Product"))})))),void 0!==N?N:t.createElement("div",{style:A.footer},t.createElement("div",{style:A.footerHint},t.createElement("span",null,t.createElement("span",{style:A.kbd},"↑")," ",t.createElement("span",{style:A.kbd},"↓")," navigate"),t.createElement("span",null,t.createElement("span",{style:A.kbd},"↵")," select"),t.createElement("span",null,t.createElement("span",{style:A.kbd},"esc")," close")),t.createElement("span",null,W.length," results")))});function za(e){if(!e)return;const t=e,r=t.colors??{};return{backgroundColor:t.backgroundColor??r.background,textColor:t.textColor??r.text,surfaceColor:t.surfaceColor??r.hover,borderColor:t.borderColor??r.border,hoverColor:t.hoverColor??r.hover,primaryColor:t.primaryColor??r.primary,textSecondaryColor:t.textSecondaryColor??r.text,fontFamily:t.fontFamily}}const Ta={amazon:aa,google:la,pinterest:ma,spotlight:ba,shopify:xa,"mobile-sheet":Ia,minimal:Na},Ma=t.forwardRef(function(e,r){const{client:a,variant:o="amazon",autoMobileVariant:n=!0,placeholder:s="Powered by Seekora",defaultQuery:i="",value:l,minQueryLength:c=1,maxSuggestions:d=8,debounceMs:u=200,includeDropdownRecommendations:p=!0,includeDropdownProductList:m=!0,includeFilteredTabs:g=!0,includeCategories:f=!0,filteredTabs:h,analyticsTags:y,enableRecentSearches:b=!0,maxRecentSearches:v=10,showProducts:k=!0,showTrendingOnEmpty:x=!0,enableAnalytics:E=!0,analyticsConfig:S,suggestionFields:C,productFields:R,theme:I,onSearch:N,onQueryChange:z,onSuggestionSelect:T,onProductClick:M,onCategoryClick:A,onTabChange:_,className:$,style:L,inputClassName:P,dropdownWidth:D,dropdownMaxHeight:F="500px",zIndex:B=1e3,enableCache:W=!0,cacheTtlMs:q=3e4,cacheMaxSize:H=100}=e,O=w(),j=I??O.theme,V=Qe({client:a,enabled:E,analyticsTags:S?.tags??y,trackImpressions:S?.trackImpressions??!0,trackClicks:S?.trackSuggestionClicks??!0});Yr(),t.useEffect(()=>{const e=document.documentElement,t=function(e){if(!e)return{"--seekora-bg-surface":"#ffffff","--seekora-bg-secondary":"#f7f7f7","--seekora-bg-tertiary":"#f0f0f0","--seekora-bg-hover":"#f5f5f5","--seekora-text-primary":"#0f1111","--seekora-text-secondary":"#565959","--seekora-text-tertiary":"#767676","--seekora-border-color":"#e7e7e7","--seekora-primary":"#f90","--seekora-text-on-primary":"#0f1111","--seekora-text-inverse":"#ffffff","--seekora-link":"#007185","--seekora-font-family":'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};const t=e,r=t.colors??{};return{"--seekora-bg-surface":t.backgroundColor??r.background??"#ffffff","--seekora-bg-secondary":t.surfaceColor??r.hover??"#f7f7f7","--seekora-bg-tertiary":t.hoverColor??r.hover??"#f0f0f0","--seekora-bg-hover":t.hoverColor??r.hover??"#f5f5f5","--seekora-text-primary":t.textColor??r.text??"#0f1111","--seekora-text-secondary":t.textSecondaryColor??r.text??"#565959","--seekora-text-tertiary":t.textSecondaryColor??"#767676","--seekora-border-color":t.borderColor??r.border??"#e7e7e7","--seekora-primary":t.primaryColor??r.primary??"#f90","--seekora-text-on-primary":t.textOnPrimaryColor??"#0f1111","--seekora-text-inverse":t.textInverseColor??"#ffffff","--seekora-link":t.primaryColor??r.primary??"#007185","--seekora-font-family":t.fontFamily??'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'}}(j);Object.entries(t).forEach(([t,r])=>{e.style.setProperty(t,r)})},[j]);const U=Qr(),{isMobile:K}=U,Q=t.useMemo(()=>n&&K&&"mobile-sheet"!==o&&"spotlight"!==o?"mobile-sheet":o,[o,K,n]),[G,X]=t.useState(i),[Y,Z]=t.useState(!1),[J,ee]=t.useState(!1),[te,re]=t.useState(!1),[ae,oe]=t.useState([]),[ne,se]=t.useState([]),[ie,le]=t.useState([]),[ce,de]=t.useState([]),[ue,pe]=t.useState([]),[me,ge]=t.useState([]),[fe,he]=t.useState("all"),ye=t.useRef(null),be=t.useRef(null),ve=t.useRef(null),ke=t.useRef(null),xe=t.useMemo(()=>W?ar({maxSize:H,defaultTtlMs:q}):null,[W,H,q]),Ee=void 0!==l?l:G,we=t.useMemo(()=>(e=>({container:{position:"relative",width:"100%",fontFamily:'var(--seekora-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif)'},inputWrapper:{display:"flex",alignItems:"center",backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #111827)",borderWidth:"2px",borderStyle:"solid",borderColor:"var(--seekora-border-color, #d1d5db)",borderRadius:e?"8px":"24px",overflow:"hidden",transition:"border-color 150ms, box-shadow 150ms",boxShadow:"0 1px 3px rgba(0,0,0,0.05)"},inputWrapperFocused:{borderColor:"var(--seekora-primary, #f90)",boxShadow:"0 0 0 3px rgba(255, 153, 0, 0.15), 0 2px 8px rgba(0,0,0,0.1)"},searchIcon:{padding:e?"0 10px 0 14px":"0 12px 0 18px",color:"var(--seekora-text-secondary, #6b7280)",display:"flex",alignItems:"center",flexShrink:0},input:{flex:1,padding:e?"12px 8px 12px 0":"14px 12px 14px 0",fontSize:e?"16px":"15px",borderWidth:0,borderStyle:"none",outline:"none",backgroundColor:"transparent",color:"var(--seekora-text-primary, #0f1111)",fontFamily:"inherit",minWidth:0,WebkitAppearance:"none"},clearButton:{padding:"8px 14px",background:"none",borderWidth:0,borderStyle:"none",cursor:"pointer",color:"var(--seekora-text-tertiary, #9ca3af)",fontSize:"18px",lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"color 150ms"}}))(K),[K]);t.useEffect(()=>{if(b){const e=Yt();ge(e.slice(0,v))}},[b,v]);const Se=t.useCallback(async e=>{if(!a)return;if(e.length>0&&e.length<c)return oe([]),se([]),void de([]);const t={maxSuggestions:d,includeDropdownRecommendations:p,includeDropdownProductList:m,includeFilteredTabs:g,includeCategories:f,filteredTabs:h?.map(e=>e.filter).join(",")},r=xe?.generateKey(e,t);if(xe&&r){const t=xe.get(r);if(t)return console.log("Seekora: Cache hit for query:",e),void Ce(t)}re(!0);try{const t=await(a.getSuggestions?.(e,{hitsPerPage:d,include_dropdown_recommendations:p,include_dropdown_product_list:m,include_filtered_tabs:g,include_categories:f,include_facets:!0,filtered_tabs:h,analytics_tags:y,returnFullResponse:!0}));if(xe&&r&&t&&(xe.set(r,t),console.log("Seekora: Cached response for query:",e)),Ce(t),E&&t&&!Array.isArray(t)){const r=t;V.trackImpression({suggestions:(r.suggestions||[]).map(e=>({query:e.query||e.text||"",objectID:e.objectID||e.id,popularity:e.popularity})),products:r.extensions?.trending_products||r.extensions?.item_recommendations||[],categories:r.extensions?.popular_categories||[],brands:r.extensions?.popular_brands||[],query:e,timestamp:Date.now()})}}catch(e){console.error("Seekora: Failed to fetch suggestions",e),oe([]),se([]),de([])}finally{re(!1)}},[a,c,d,p,m,g,f,h,y,E,V,xe]),Ce=t.useCallback(e=>{let t=[],r={};if(console.log("Seekora: Raw response structure",{hasSuggestions:!!e?.suggestions,hasResults:!!e?.results,hasExtensions:!!e?.extensions,hasData:!!e?.data}),e?.suggestions&&e?.extensions)t=e.suggestions||[],r=e.extensions||{};else if(e?.results&&Array.isArray(e.results)){const a=e.results[0]||{},o=e.results[1]||{};t=a.hits||a.suggestions||[],r=a.extensions||o.extensions||{}}else e?.data?(t=e.data.hits||[],r=e.data.extensions||e.data.dropdown_recommendations||{}):e?.hits?(t=e.hits||[],r=e.extensions||e.dropdown_recommendations||{}):Array.isArray(e)&&(t=e);oe(t);const a=r.filtered_tabs||[];de(a),a.length>0&&a[0].products?se(a[0].products):se(r.trending_products||r.item_recommendations||[]),le(r.popular_categories||[]),pe(r.trending_searches||r.top_searches||[]),console.log("Seekora: Parsed response",{suggestions:t.length,tabs:a.length,products:a[0]?.products?.length||0,extensionKeys:Object.keys(r)})},[]),Re=t.useCallback(e=>{const t=e.target.value;void 0===l&&X(t),z?.(t),he("all"),ve.current&&clearTimeout(ve.current),t.length>=c?(Z(!0),ve.current=setTimeout(()=>{Se(t)},u)):0===t.length&&(b||x)?(Z(!0),oe([])):Z(!1)},[l,z,c,u,Se,b,x]),Ie=t.useCallback(()=>{ee(!0),Z(!0),E&&V.trackDropdownOpen(Ee),Ee.length>=c?0===ae.length&&Se(Ee):Se("")},[Ee,c,ae.length,Se,E,V]),Ne=t.useCallback(()=>{ee(!1),setTimeout(()=>{ke.current?.contains(document.activeElement)||Z(!1)},150)},[]),ze=t.useCallback(e=>{if("Escape"===e.key)Z(!1),ye.current?.blur();else if("Enter"===e.key){e.preventDefault();(be.current?.getActiveIndex?.()??-1)>=0&&Y?be.current?.selectActive?.():Ee.trim()&&(N?.(Ee.trim()),b&&(Zt(Ee.trim()),ge(Yt().slice(0,v))),E&&V.trackSearchSubmit(Ee.trim(),!1),Z(!1))}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),!Y&&(ae.length>0||me.length>0)&&Z(!0),"ArrowDown"===e.key?be.current?.navigateNext?.():be.current?.navigatePrevious?.())},[Ee,N,b,v,Y,ae.length,me.length,E,V]),Te=t.useCallback((e,t)=>{const r=e.query||e.text||e.objectID||"";void 0===l&&X(r),z?.(r),T?.(e,t),b&&r&&(Zt(r),ge(Yt().slice(0,v))),E&&(V.trackSuggestionClick({suggestion:{query:r,objectID:e.objectID||e.id,popularity:e.popularity},position:t,section:"suggestions",query:Ee,totalSuggestions:ae.length}),V.trackSearchSubmit(r,!0,e)),N?.(r),Z(!1)},[l,z,T,b,v,E,N,V,Ee,ae.length]),Me=t.useCallback((e,t)=>{M?.(e,t),E&&V.trackProductClick({product:{id:e.id||e.objectID,objectID:e.objectID||e.id,title:e.title||e.name,image:e.image,price:e.price},position:t,section:"all"!==fe?"filtered_tab":"products",tabId:"all"!==fe?fe:void 0,query:Ee})},[M,E,V,fe,Ee]),Ae=t.useCallback((e,t)=>{A?.(e,t),E&&V.trackCategoryClick({value:e.label||e.value||e.id,count:e.count,path:e.path},Ee)},[A,E,V,Ee]),_e=t.useCallback(e=>{if(console.log("Seekora: Tab changed to",e),he(e),_?.(e),E){const t=ce.find(t=>t.id===e);t&&V.trackTabSelect({id:t.id,label:t.label,filter:t.filter,products:t.products,nb_hits:t.nb_hits},Ee)}},[_,E,V,ce,Ee]),$e=t.useCallback(e=>{void 0===l&&X(e),z?.(e),Se(e),E&&V.trackRecentSearchClick({query:e,timestamp:Date.now()})},[l,z,Se,E,V]),Le=t.useCallback(e=>{Jt(e),ge(Yt().slice(0,v))},[v]),Pe=t.useCallback(()=>{void 0===l&&X(""),z?.(""),oe([]),se([]),de([]),ye.current?.focus()},[l,z]),De=t.useCallback(()=>{Z(!1),E&&V.trackDropdownClose(Ee)},[E,V,Ee]);t.useImperativeHandle(r,()=>({focus:()=>ye.current?.focus(),blur:()=>ye.current?.blur(),clear:Pe,getQuery:()=>Ee,setQuery:e=>{void 0===l&&X(e),z?.(e)},openDropdown:()=>Z(!0),closeDropdown:()=>Z(!1),refresh:()=>Se(Ee),clearCache:()=>xe?.clear(),getCacheStats:()=>xe?.getStats()??null}),[Ee,l,z,Pe,Se,xe]);const Fe=Ta[Q]||aa,Be=t.useMemo(()=>{if(console.log("Seekora: Computing products for tab",fe,"from",ce.length,"tabs"),0===ce.length)return ne;if("all"===fe){const e=ce[0]?.products||[];return e.length>0?e:ne}const e=ce.find(e=>e.id===fe);return e?.products&&e.products.length>0?(console.log("Seekora: Found",e.products.length,"products for tab",fe),e.products):ne},[fe,ce,ne]);return t.createElement("div",{ref:ke,className:Qt("seekora-suggestion-search",$),style:Gt(we.container,L)},t.createElement("div",{style:Gt(we.inputWrapper,J?we.inputWrapperFocused:void 0)},t.createElement("div",{style:we.searchIcon},t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"20",height:"20"},t.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"}))),t.createElement("input",{ref:ye,type:"text",value:Ee,onChange:Re,onFocus:Ie,onBlur:Ne,onKeyDown:ze,placeholder:s,className:P,style:we.input,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":"Search","aria-expanded":Y,"aria-haspopup":"listbox"}),Ee&&t.createElement("button",{type:"button",onClick:Pe,style:we.clearButton,"aria-label":"Clear search"},"×")),Y&&t.createElement(Fe,{query:Ee,isOpen:Y,loading:te,suggestions:ae,products:Be,categories:ce.map(e=>({id:e.id,label:e.label,count:e.nb_hits})),recentSearches:me.map(e=>"string"==typeof e?e:e.query),trendingSearches:ue,filteredTabs:ce,activeTab:fe,suggestionFields:C,productFields:R,theme:za(j)??j,width:D||"100%",maxHeight:F,zIndex:B,analytics:{enabled:E,trackSuggestionClicks:S?.trackSuggestionClicks??!0,trackProductClicks:S?.trackProductClicks??!0,trackImpressions:S?.trackImpressions??!0,trackCategoryClicks:S?.trackCategoryClicks??!0,trackBrandClicks:S?.trackBrandClicks??!0,trackSearchSubmit:S?.trackSearchSubmit??!0,tags:S?.tags??y},onSuggestionSelect:Te,onProductClick:Me,onCategoryClick:Ae,onTabChange:_e,onRecentClick:$e,onRecentRemove:Le,onClose:De}))}),Aa={amazon:aa,google:la,pinterest:ma,spotlight:ba,shopify:xa,"mobile-sheet":Ia,minimal:Na};function _a({isOpen:e,onClose:a,children:o}){const n=t.useRef(null),s=t.useRef(null);if(t.useEffect(()=>{const t=e=>{s.current&&!s.current.contains(e.target)&&a()};return e&&document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e,a]),t.useEffect(()=>{if(e){const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e]),t.useEffect(()=>{if(!e||!s.current)return;const t=s.current,r=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),a=r[0],o=r[r.length-1],n=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===a&&(e.preventDefault(),o?.focus()):document.activeElement===o&&(e.preventDefault(),a?.focus()))};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[e]),!e||"undefined"==typeof document)return null;const i=t.createElement("div",{ref:n,className:"seekora-docsearch-overlay",role:"dialog","aria-modal":"true","aria-label":"Search documentation"},t.createElement("div",{ref:s,className:"seekora-docsearch-container"},o));return r.createPortal(i,document.body)}function $a({value:e,onChange:r,onKeyDown:a,placeholder:o="Search documentation...",onClear:n}){const s=t.useRef(null);t.useEffect(()=>{s.current&&s.current.focus()},[]);return t.createElement("div",{className:"seekora-docsearch-searchbox"},t.createElement("label",{className:"seekora-docsearch-searchbox-icon",htmlFor:"seekora-docsearch-input"},t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},t.createElement("path",{d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",fill:"currentColor"}))),t.createElement("input",{ref:s,id:"seekora-docsearch-input",className:"seekora-docsearch-input",type:"text",value:e,onChange:e=>r(e.target.value),onKeyDown:a,placeholder:o,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"seekora-docsearch-results"}),e&&t.createElement("button",{type:"button",className:"seekora-docsearch-clear",onClick:()=>{r(""),n?.(),s.current?.focus()},"aria-label":"Clear search"},t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},t.createElement("path",{d:"M4.28 3.22a.75.75 0 00-1.06 1.06L6.94 8l-3.72 3.72a.75.75 0 101.06 1.06L8 9.06l3.72 3.72a.75.75 0 101.06-1.06L9.06 8l3.72-3.72a.75.75 0 00-1.06-1.06L8 6.94 4.28 3.22z",fill:"currentColor"}))))}function La({value:e,highlightedValue:r}){return r?t.createElement("span",{className:"seekora-docsearch-highlight",dangerouslySetInnerHTML:{__html:(a=r,a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/&lt;mark&gt;/g,"<mark>").replace(/&lt;\/mark&gt;/g,"</mark>").replace(/&lt;ais-highlight&gt;/g,"<mark>").replace(/&lt;\/ais-highlight&gt;/g,"</mark>").replace(/&lt;em&gt;/g,"<mark>").replace(/&lt;\/em&gt;/g,"</mark>"))}}):t.createElement("span",null,e);var a}function Pa({hit:e,isSelected:r,onClick:a,onMouseEnter:o,openInNewTab:n,isChild:s,isLastChild:i,hierarchyType:l}){const c="objectID"in e,d=e,u=l||d.type,p=d.parentTitle?`${d.category||""} › ${d.parentTitle}`.replace(/^› /,""):d.category||"",m=function(e,t){const r=e.hierarchy||{};if(!t)return e.title||r.lvl1||r.lvl0||"Untitled";const a=t.match(/^lvl(\d+)$/);if(a){const e=r[`lvl${parseInt(a[1],10)}`];if(e)return e}return e.title||r.lvl1||r.lvl0||"Untitled"}(e,u);let g=m,f=e.content||d.description||"";if(c){const t=e;t._highlightResult&&(g=t._highlightResult.title?.value||m,f=t._highlightResult.content?.value||e.content||"")}else d.highlight&&(g=d.highlight.title||m,f=d.highlight.content||e.content||d.description||"");const h=f?function(e,t=150){const r=e.indexOf("<mark>");if(-1===r||e.length<=t)return e.length<=t?e:e.slice(0,t)+"...";const a=Math.floor(t/2);let o=Math.max(0,r-a),n=Math.min(e.length,r+a);if(o>0){const t=e.indexOf(" ",o);-1!==t&&t<r&&(o=t+1)}if(n<e.length){const t=e.lastIndexOf(" ",n);-1!==t&&t>r&&(n=t)}let s=e.slice(o,n);return o>0&&(s="..."+s),n<e.length&&(s+="..."),s}(f,120):"",y=e.url||d.route||"#",b=["seekora-docsearch-hit"];return r&&b.push("seekora-docsearch-hit--selected"),s&&b.push("seekora-docsearch-hit--child"),i&&b.push("seekora-docsearch-hit--last-child"),t.createElement("a",{href:y,className:b.join(" "),onClick:e=>{e.preventDefault(),a()},onMouseEnter:o,role:"option","aria-selected":r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0},s&&t.createElement("div",{className:"seekora-docsearch-hit-tree"},t.createElement(Ba,{isLast:i})),t.createElement("div",{className:"seekora-docsearch-hit-icon"},t.createElement(Fa,{type:Da(u)})),t.createElement("div",{className:"seekora-docsearch-hit-content"},!s&&p&&t.createElement("span",{className:"seekora-docsearch-hit-breadcrumb"},p),t.createElement("span",{className:"seekora-docsearch-hit-title"},t.createElement(La,{value:m,highlightedValue:g})),h&&t.createElement("span",{className:"seekora-docsearch-hit-description"},t.createElement(La,{value:e.content||"",highlightedValue:h}))),t.createElement("div",{className:"seekora-docsearch-hit-action"},n?t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M6 3H3v10h10v-3M9 3h4v4M14 2L7 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})):t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M6.75 3.25L11.5 8L6.75 12.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))))}function Da(e){if(!e)return"page";const t=e.match(/^lvl(\d+)$/);if(t){const e=parseInt(t[1],10);return 1===e?"page":e<=3?"section":"content"}return"page"}function Fa({type:e}){switch(e){case"page":return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M4.5 3.5h11a1 1 0 011 1v11a1 1 0 01-1 1h-11a1 1 0 01-1-1v-11a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),t.createElement("path",{d:"M7 7h6M7 10h6M7 13h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}));case"section":return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M4 5.5h12M4 10h12M4 14.5h8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}));case"content":return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},t.createElement("path",{d:"M4 6h12M4 10h8M4 14h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))}}function Ba({isLast:e}){return t.createElement("svg",{width:"16",height:"20",viewBox:"0 0 16 20",fill:"none","aria-hidden":"true",className:"seekora-docsearch-hit-tree-icon"},e?t.createElement("path",{d:"M8 0V10H14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):t.createElement(t.Fragment,null,t.createElement("path",{d:"M8 0V20",stroke:"currentColor",strokeWidth:"1.5"}),t.createElement("path",{d:"M8 10H14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})))}function Wa(e){if(!e)return 1;const t=e.match(/^lvl(\d+)$/);return t?parseInt(t[1],10):1}function qa(e){return Wa(e)>=2}function Ha(e){const t=e.hierarchy??{};return[t.lvl0??"",t.lvl1??"",t.lvl2??"",t.lvl3??"",t.lvl4??"",t.lvl5??""].join("\0")}function Oa(e){const t=e.hierarchy??{},r=[t.lvl0,t.lvl1,t.lvl2,t.lvl3,t.lvl4,t.lvl5].filter(e=>"string"==typeof e&&e.length>0),a=[];for(const e of r)a[a.length-1]!==e&&a.push(e);return a.join(" › ")}function ja(e,t){return"objectID"in e?e.objectID:`suggestion-${e.url}-${t}`}function Va({hits:e,groupedHits:r,selectedIndex:a,onSelect:o,onHover:n,scrollSelectionIntoViewRef:s,query:i,isLoading:l,error:c,translations:d={},sources:u=[]}){const p=t.useRef(null);if(t.useEffect(()=>{if(!p.current||0===e.length)return;if(s&&!s.current)return;const t=p.current.querySelectorAll(".seekora-docsearch-results-group");let r=0;for(const e of t){const t=e.querySelector(".seekora-docsearch-results-group-items");if(!t)continue;const o=t.children;for(let e=0;e<o.length;e++){if(r===a)return o[e].scrollIntoView({block:"nearest"}),void(s&&(s.current=!1));r++}}s&&(s.current=!1)},[a,e.length,s]),!i)return t.createElement("div",{className:"seekora-docsearch-empty"},t.createElement("p",{className:"seekora-docsearch-empty-text"},d.searchPlaceholder||"Type to start searching..."));if(l&&0===e.length)return t.createElement("div",{className:"seekora-docsearch-empty"});if(c)return t.createElement("div",{className:"seekora-docsearch-error"},t.createElement("p",{className:"seekora-docsearch-error-text"},d.errorText||c));if(0===e.length&&i)return t.createElement("div",{className:"seekora-docsearch-no-results"},t.createElement("p",{className:"seekora-docsearch-no-results-text"},d.noResultsText||`No results found for "${i}"`));const m=r&&r.length>0?r.map(e=>({category:e.source.name,sourceId:e.source.id,openInNewTab:e.source.openInNewTab,hits:e.items})):function(e){const t=new Map;e.forEach((e,r)=>t.set(e,r));const r=new Map;for(const t of e){const e=Ha(t);r.has(e)||r.set(e,[]),r.get(e).push(t)}const a=Array.from(r.entries());a.sort(([,e],[,r])=>Math.min(...e.map(e=>t.get(e)??0))-Math.min(...r.map(e=>t.get(e)??0)));const o=[];for(const[,e]of a){const t=[...e].sort((e,t)=>{const r=e.type,a=t.type;return Wa(r)-Wa(a)}),r=t.map((e,r)=>{const a=qa(e.type),o=t[r+1],n=a&&(!o||!qa(o.type));return{...e,isChild:a,isLastChild:n}}),a=Oa(e[0]);o.push({category:a||null,hits:r})}return o}(e).map(e=>({category:e.category,sourceId:"default",openInNewTab:!1,hits:e.hits}));return t.createElement("div",{className:"seekora-docsearch-results"},t.createElement("ul",{ref:p,id:"seekora-docsearch-results",className:"seekora-docsearch-results-list",role:"listbox"},m.map((e,r)=>t.createElement("li",{key:e.sourceId+"-"+r,className:"seekora-docsearch-results-group"},e.category&&t.createElement("div",{className:"seekora-docsearch-results-group-header"},e.category),t.createElement("ul",{className:"seekora-docsearch-results-group-items"},e.hits.map((s,i)=>{const l=function(e,t,r){let a=0;for(let r=0;r<t;r++)a+=e[r].hits.length;return a+r}(m,r,i),c=s;return t.createElement("li",{key:ja(s,i)},t.createElement(Pa,{hit:s,isSelected:l===a,onClick:()=>o(s),onMouseEnter:()=>n(l),openInNewTab:e.openInNewTab,isChild:c.isChild,isLastChild:c.isLastChild,hierarchyType:s.type}))}))))))}function Ua(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 844.6 192",height:"20","aria-hidden":"true",style:{width:"auto"}},t.createElement("path",{fill:"#03d1ff",d:"M73.06,85.38l-21.36,21.21-2.03,2.03c-3.19,3.19-8.3,2.84-11.07-.32-.52-.59-.95-1.27-1.27-2.04-.01-.03-.03-.07-.04-.1-.33-.79-.63-1.6-.92-2.41-1.59-4.57-2.44-9.48-2.42-14.6h.05c-.01-.13-.01-.27-.02-.4-.02-.46-.02-.92-.02-1.39,0-27.3,22.13-49.43,49.43-49.43,6.64,0,12.98,1.31,18.76,3.69-2.19,2.23-3.28,5.47-2.63,8.76.31,1.52.95,2.89,1.84,4.04.27.36.58.7.9,1.02-.12-.07-.25-.15-.38-.22-5.45-3.15-11.76-4.94-18.49-4.94-20.48,0-37.08,16.6-37.08,37.08,0,.42,0,.83.02,1.25h0c.08,2.58.43,5.09,1.02,7.5l.18-.18,4.98-4.99,10.15-10.15,4.32-4.32c2.43-2.43,5.96-3.35,9.26-2.41.01,0,.03,0,.04.01.05.01.1.02.15.04,2.04.62,3.76,1.88,4.94,3.55.78,1.08,1.32,2.33,1.59,3.67l1.28,6.5.32,1.63.02.14.42-.44,14.99-15.62,3.29-3.43,7.25-7.57,1.18-1.22,2.43-2.54,5.02-5.24.91-.95,1.71-1.78-1.31.25-2.68.53-.47.09-3.52.7h0s-4.01.8-4.01.8c-2.55.5-5.04-1.16-5.55-3.71-.45-2.26.8-4.47,2.87-5.3.27-.11.55-.19.85-.25l9.8-1.94,7.42-1.47,3.23-.63,4.96-.98c.12-.02.25-.05.37-.06.11-.01.22-.02.32-.03.22-.01.43,0,.65.01.96.08,1.89.47,2.65,1.12.81.69,1.35,1.62,1.56,2.64.03.15.05.29.07.44.02.23.03.45.02.68l-.23,6.05-.14,4.01-.05,1.44-.49,13.48v.24c-.09,2.55-2.19,4.55-4.72,4.55-.06,0-.11,0-.17,0-1.1-.04-2.1-.45-2.88-1.11-1.07-.9-1.73-2.27-1.67-3.78l.02-.59.09-2.55.12-3.52.12-3.51-50.81,54.4-5.17-27.42Z"}),t.createElement("path",{fill:"#4d66fe",d:"M23.04,158.85c-.27-1.39.15-2.83,1.12-3.85l22.71-23.81,3.29-3.43,7.25-7.57,1.18-1.22,7.46-7.77,1.77-1.85,2.56,12.48.14.31h0c2.32.86,4.75,1.49,7.27,1.88v12.46c-5.94-.67-11.56-2.39-16.67-4.98l-35.87,38.45-2.2-11.08Z"}),t.createElement("path",{fill:"#4d66fe",d:"M90.69,106.76v29.36c-2.22.31-4.49.47-6.79.47-.34,0-.67,0-1.01-.02v-21.93l7.8-7.88Z"}),t.createElement("polygon",{fill:"#4d66fe",points:"102.78 132.84 102.78 118.68 102.79 93.73 94.96 101.92 94.96 135.35 102.78 132.84"}),t.createElement("polygon",{fill:"#4d66fe",points:"114.86 125.64 114.87 104.87 114.88 81.6 107.05 89.78 107.05 130.82 114.86 125.64"}),t.createElement("path",{fill:"#4d66fe",d:"M126.98,69.42l-.02,23.28v18.6c-2.13,3.83-4.77,7.35-7.81,10.45v-44.13l7.83-8.19Z"}),t.createElement("path",{fill:"currentColor",d:"M455.59,136.31h-14.71l-.11-98.11h14.71l.11,98.11ZM520.86,136.65h-18.17l-27.34-32.14c-2.31-2.88-4.04-5.72-5.19-8.51-1.15-2.79-1.73-5.53-1.73-8.22s.55-5.57,1.66-8.36c1.1-2.79,2.86-5.63,5.26-8.51l27.73-32.54h16.87l-31.05,36.87c-1.92,2.4-3.39,4.57-4.4,6.49-1.01,1.92-1.51,3.8-1.51,5.62s.5,3.65,1.51,5.48c1.01,1.83,2.47,3.94,4.4,6.35l31.96,37.47Z"}),t.createElement("path",{fill:"currentColor",d:"M710.73,117.25c-2.6-5.48-5.14-10.12-7.64-13.92-2.5-3.8-5.48-6.68-8.94-8.65-.31-.18-.64-.33-.96-.49,2.69-.58,5.18-1.44,7.45-2.61,4.52-2.31,8.05-5.53,10.6-9.66,2.55-4.13,3.82-8.89,3.82-14.28,0-6.63-1.61-12.11-4.83-16.44-3.22-4.33-7.6-7.55-13.12-9.66-5.53-2.11-11.71-3.17-18.53-3.17h-33.61v98.14h14.42l.13-36.69h11.99c4.52,0,8.2.79,11.03,2.38,2.84,1.59,5.24,3.8,7.21,6.63,1.97,2.84,3.92,6.13,5.84,9.88l8.89,17.8h15.87l-9.61-19.24ZM659.55,86.67l.12-34.76h19.04c3.94,0,7.52.6,10.75,1.8,3.22,1.2,5.77,3.03,7.64,5.48,1.88,2.45,2.81,5.7,2.81,9.74s-.91,7.09-2.74,9.74c-1.83,2.65-4.38,4.64-7.64,5.99-3.27,1.35-6.97,2.02-11.11,2.02h-18.87Z"}),t.createElement("path",{fill:"currentColor",d:"M618.36,62.91c-2.26-4.27-5.09-8.11-8.5-11.53-4.5-4.49-9.72-8.01-15.65-10.55-5.94-2.54-12.39-3.8-19.38-3.8s-13.47,1.27-19.45,3.8c-5.98,2.54-11.22,6.06-15.72,10.55-4.5,4.5-8.02,9.74-10.55,15.72-2.54,5.98-3.81,12.47-3.81,19.45s1.27,13.66,3.81,19.74c2.53,6.08,6.05,11.37,10.55,15.86,4.49,4.5,9.74,8.02,15.72,10.55,5.98,2.54,12.46,3.81,19.45,3.81s13.44-1.27,19.38-3.81c5.94-2.53,11.15-6.05,15.65-10.55,4.23-4.23,7.58-9.18,10.03-14.82.15-.35.3-.69.44-1.04.57-1.4,1.08-2.83,1.52-4.28l12.51,4.15-2.67-20.65-2.66-20.65-7.32,6.03-9.78,8.06-3.24,2.67-13.86,11.43,12.73,4.23c-.32,1.16-.71,2.3-1.15,3.42-.26.65-.53,1.28-.82,1.9-1.64,3.58-3.81,6.74-6.5,9.52-3.16,3.25-6.82,5.81-10.98,7.68-4.16,1.87-8.59,2.8-13.28,2.8s-9.28-.93-13.5-2.8c-4.21-1.87-7.87-4.43-10.98-7.68-3.11-3.26-5.55-7.06-7.32-11.42-1.77-4.35-2.66-9.06-2.66-14.14s.89-9.62,2.66-13.93c1.77-4.31,4.21-8.09,7.32-11.34s6.77-5.79,10.98-7.61c4.21-1.82,8.71-2.73,13.5-2.73s9.24.91,13.35,2.73c4.11,1.82,7.75,4.36,10.91,7.61,3.16,3.25,5.6,7.03,7.32,11.34l11.95-9.72Z"}),t.createElement("circle",{fill:"currentColor",cx:"575.56",cy:"86.71",r:"9.38"}),t.createElement("path",{fill:"currentColor",d:"M206.51,137.4c-8.17,0-15.43-1.78-21.78-5.34-6.35-3.56-11.01-8.65-13.99-15.29l12.4-6.06c1.83,4.14,4.76,7.31,8.8,9.52,4.04,2.21,8.89,3.32,14.57,3.32,3.75,0,7.11-.55,10.1-1.66,2.98-1.1,5.36-2.79,7.14-5.05,1.78-2.26,2.67-4.98,2.67-8.15,0-3.56-.96-6.27-2.88-8.15-1.92-1.88-4.5-3.27-7.72-4.18-3.22-.91-6.76-1.71-10.6-2.38-3.66-.77-7.38-1.71-11.18-2.81-3.8-1.1-7.33-2.67-10.6-4.69-3.27-2.02-5.89-4.69-7.86-8-1.97-3.32-2.96-7.52-2.96-12.62,0-5.38,1.46-10.19,4.4-14.42,2.93-4.23,6.87-7.57,11.83-10.02,4.95-2.45,10.5-3.68,16.66-3.68,7.4,0,14.13,1.71,20.19,5.12,6.06,3.41,10.53,8.44,13.41,15.07l-12.26,6.35c-1.83-4.04-4.62-7.19-8.37-9.45-3.75-2.26-8.27-3.39-13.56-3.39-3.27,0-6.23.6-8.87,1.8-2.65,1.2-4.78,2.84-6.42,4.9-1.64,2.07-2.45,4.5-2.45,7.28,0,3.46,1.01,6.13,3.03,8.01,2.02,1.87,4.69,3.32,8,4.33,3.32,1.01,6.95,1.9,10.89,2.67,3.65.77,7.36,1.71,11.11,2.81,3.75,1.11,7.19,2.67,10.31,4.69,3.12,2.02,5.67,4.69,7.64,8,1.97,3.32,2.96,7.52,2.96,12.62,0,5.67-1.54,10.65-4.62,14.93-3.08,4.28-7.24,7.67-12.48,10.17-5.24,2.5-11.08,3.75-17.52,3.75Z"}),t.createElement("path",{fill:"currentColor",d:"M276.75,123.07v-28.94h49.04v-13.41h-49.04v-28.94h51.92v-13.41h-53.08c-5,0-8.51,1.18-10.53,3.53-2.02,2.36-3.03,5.6-3.03,9.74v71.58c0,4.04,1.01,7.26,3.03,9.66,2.02,2.41,5.53,3.61,10.53,3.61h54.09v-13.41h-52.93Z"}),t.createElement("path",{fill:"currentColor",d:"M365.12,123.24v-28.94h49.04v-13.41h-49.04v-28.94h51.92v-13.41h-53.08c-5,0-8.51,1.18-10.53,3.53-2.02,2.36-3.03,5.6-3.03,9.74v71.58c0,4.04,1.01,7.26,3.03,9.66,2.02,2.41,5.53,3.61,10.53,3.61h54.09v-13.41h-52.93Z"}),t.createElement("path",{fill:"currentColor",d:"M806.12,136.49h15l-26.59-85.62c-1.44-4.52-3.8-7.88-7.07-10.1-3.27-2.21-6.97-3.32-11.11-3.32s-7.57,1.11-10.89,3.32c-3.32,2.21-5.7,5.58-7.14,10.1l-26.6,85.46h14.86l8.95-29.72,41.68-.11,8.91,29.99ZM759.57,93.2l11.45-38.01c.87-2.98,2.69-4.47,5.48-4.47s4.52,1.49,5.48,4.47l11.29,38.01h-33.7Z"}))}function Ka({translations:e={}}){return t.createElement("footer",{className:"seekora-docsearch-footer"},t.createElement("div",{className:"seekora-docsearch-footer-commands"},t.createElement("ul",{className:"seekora-docsearch-footer-commands-list"},t.createElement("li",null,t.createElement("span",{className:"seekora-docsearch-footer-command"},t.createElement("kbd",{className:"seekora-docsearch-key"},"↵"),t.createElement("span",null,"to select"))),t.createElement("li",null,t.createElement("span",{className:"seekora-docsearch-footer-command"},t.createElement("kbd",{className:"seekora-docsearch-key"},"↑"),t.createElement("kbd",{className:"seekora-docsearch-key"},"↓"),t.createElement("span",null,"to navigate"))),t.createElement("li",null,t.createElement("span",{className:"seekora-docsearch-footer-command"},t.createElement("kbd",{className:"seekora-docsearch-key"},"esc"),t.createElement("span",null,e.closeText||"to close"))))),t.createElement("div",{className:"seekora-docsearch-footer-logo"},t.createElement("span",{className:"seekora-docsearch-footer-logo-text"},e.searchByText||"Search by"),t.createElement("a",{href:"https://seekora.ai",target:"_blank",rel:"noopener noreferrer",className:"seekora-docsearch-footer-logo-link"},t.createElement(Ua,null))))}function Qa(e){const{isOpen:r,onOpen:a,onClose:o,onSelectNext:n,onSelectPrev:s,onEnter:i,disableShortcut:l=!1,shortcutKey:c="k"}=e,d=t.useCallback(e=>{if(!l&&(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===c)return e.preventDefault(),void(r?o():a());if(!l&&"/"===e.key&&!r){const t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),a())}},[r,a,o,l,c]),u=t.useCallback(e=>{switch(e.key){case"Escape":e.preventDefault(),o();break;case"ArrowDown":e.preventDefault(),n();break;case"ArrowUp":e.preventDefault(),s();break;case"Enter":e.preventDefault(),i();break;case"Tab":e.shiftKey?s():n(),e.preventDefault()}},[o,n,s,i]);return t.useEffect(()=>(document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}),[d]),{handleModalKeyDown:u}}function Ga(e="K"){if("undefined"==typeof navigator)return`⌘${e}`;return navigator.platform.toLowerCase().includes("mac")?`⌘${e}`:`Ctrl+${e}`}function Xa({onClick:e,placeholder:r="Search documentation..."}){const a=Ga("K");return t.createElement("button",{type:"button",className:"seekora-docsearch-button",onClick:e,"aria-label":"Search documentation"},t.createElement("span",{className:"seekora-docsearch-button-icon"},t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},t.createElement("path",{d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",fill:"currentColor"}))),t.createElement("span",{className:"seekora-docsearch-button-placeholder"},r),t.createElement("span",{className:"seekora-docsearch-button-keys"},t.createElement("kbd",{className:"seekora-docsearch-button-key"},a)))}const Ya={query:"",results:[],suggestions:[],groupedSuggestions:[],isLoading:!1,error:null,selectedIndex:0,mode:"suggestions"};function Za(e,t){switch(t.type){case"SET_QUERY":return{...e,query:t.payload,selectedIndex:0};case"SET_RESULTS":return{...e,results:t.payload,mode:"results"};case"SET_SUGGESTIONS":return{...e,suggestions:t.payload,mode:"suggestions"};case"SET_GROUPED_SUGGESTIONS":{const r=t.payload.flatMap(e=>e.items.map(t=>({...t,_source:e.source.id})));return{...e,groupedSuggestions:t.payload,suggestions:r,mode:"suggestions"}}case"SET_LOADING":return{...e,isLoading:t.payload};case"SET_ERROR":return{...e,error:t.payload};case"SET_SELECTED_INDEX":return{...e,selectedIndex:t.payload};case"SELECT_NEXT":{const t=("results"===e.mode?e.results:e.suggestions).length-1;return{...e,selectedIndex:e.selectedIndex>=t?0:e.selectedIndex+1}}case"SELECT_PREV":{const t=("results"===e.mode?e.results:e.suggestions).length-1;return{...e,selectedIndex:e.selectedIndex<=0?t:e.selectedIndex-1}}case"SET_MODE":return{...e,mode:t.payload,selectedIndex:0};case"RESET":return Ya;default:return e}}function Ja(e){const{apiEndpoint:r,apiKey:a,sources:o,maxResults:n=10,debounceMs:s=200,processGroupedResults:i}=e,l=o||(r?[{id:"default",name:"Results",endpoint:r,apiKey:a,maxResults:n}]:[]),[c,d]=t.useReducer(Za,Ya),u=t.useRef(new Map),p=t.useRef(null),m=t.useCallback((e,t)=>(e?.data?.results||[]).map(e=>{const r=e.document||e;return{url:r.url||r.route||"",title:(r.title||r.name||"").replace?.(/<\/?mark>/g,"")||"",content:(r.content||r.description||"").replace?.(/<\/?mark>/g,"")?.substring?.(0,100)||"",description:r.description||r.content?.substring?.(0,100)||"",category:r.category||r.hierarchy?.lvl0||"",hierarchy:r.hierarchy,route:r.route,parentTitle:r.parent_title||r.parentTitle,_source:t}}),[]),g=t.useCallback(async(e,t,r)=>{const a=e.minQueryLength??1;if(t.length<a)return[];try{if(e.storeId){const a=`${e.endpoint.replace(/\/$/,"")}/api/v1/search`,o={"Content-Type":"application/json","x-storeid":e.storeId,...e.storeSecret&&{"x-storesecret":e.storeSecret}},n=await fetch(a,{method:"POST",headers:o,body:JSON.stringify({q:t.trim()||"*",per_page:e.maxResults||8}),signal:r});if(!n.ok)return[];const s=await n.json();return e.transformResults?e.transformResults(s).map(t=>({...t,_source:e.id})):m(s,e.id)}const a=new URL(e.endpoint);a.searchParams.set("query",t),a.searchParams.set("limit",String(e.maxResults||8));const o={"Content-Type":"application/json"};e.apiKey&&(o["X-Docs-API-Key"]=e.apiKey);const n=await fetch(a.toString(),{method:"GET",headers:o,signal:r});if(!n.ok)return[];const s=await n.json();return e.transformResults?e.transformResults(s).map(t=>({...t,_source:e.id})):((e,t)=>(e.data?.suggestions||e.data?.results||e.data?.hits||e.suggestions||e.results||e.hits||[]).map(e=>{const r=e.document||e,a=r.hierarchy||{lvl0:r["hierarchy.lvl0"],lvl1:r["hierarchy.lvl1"],lvl2:r["hierarchy.lvl2"],lvl3:r["hierarchy.lvl3"],lvl4:r["hierarchy.lvl4"],lvl5:r["hierarchy.lvl5"]};return{url:r.url||r.route||e.url||"",title:(r.title||"").replace?.(/<\/?mark>/g,"")||"",content:(r.content||r.description||"").replace?.(/<\/?mark>/g,"")?.substring?.(0,100)||"",description:r.description||r.content?.substring?.(0,100)||"",category:r.category||a?.lvl0||"",hierarchy:a,route:r.route,parentTitle:r.parent_title||r.parentTitle,anchor:r.anchor||e.anchor,_source:t}}))(s,e.id)}catch(e){if(e instanceof Error&&"AbortError"===e.name)throw e;return[]}},[m]),f=t.useCallback(async e=>{if(e.trim()){u.current.forEach(e=>e.abort()),u.current.clear(),d({type:"SET_LOADING",payload:!0}),d({type:"SET_ERROR",payload:null});try{const t=(await Promise.all(l.map(async t=>{const r=new AbortController;u.current.set(t.id,r);let a=await g(t,e,r.signal);return i&&(a=i(t.id,a)),{source:t,items:a}}))).filter(e=>e.items.length>0);d({type:"SET_GROUPED_SUGGESTIONS",payload:t})}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;d({type:"SET_ERROR",payload:e instanceof Error?e.message:"Search failed"})}finally{d({type:"SET_LOADING",payload:!1})}}else d({type:"SET_GROUPED_SUGGESTIONS",payload:[]})},[l,g,i]),h=t.useCallback(e=>f(e),[f]),y=t.useCallback(e=>{d({type:"SET_QUERY",payload:e}),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f(e),s)},[f,s]),b=t.useCallback(()=>d({type:"SELECT_NEXT"}),[]),v=t.useCallback(()=>d({type:"SELECT_PREV"}),[]),k=t.useCallback(e=>d({type:"SET_SELECTED_INDEX",payload:e}),[]),x=t.useCallback(()=>{u.current.forEach(e=>e.abort()),u.current.clear(),p.current&&clearTimeout(p.current),d({type:"RESET"})},[]),E=t.useCallback(()=>("results"===c.mode?c.results:c.suggestions)[c.selectedIndex]||null,[c.mode,c.results,c.suggestions,c.selectedIndex]);return t.useEffect(()=>()=>{u.current.forEach(e=>e.abort()),u.current.clear(),p.current&&clearTimeout(p.current)},[]),{...c,sources:l,setQuery:y,search:h,fetchSuggestions:f,selectNext:b,selectPrev:v,setSelectedIndex:k,reset:x,getSelectedItem:E}}function eo(e){const{storeId:r,storeSecret:o,apiEndpoint:n,maxResults:s=20,debounceMs:i=200,analyticsTags:l=["docsearch"],groupField:c="hierarchy.lvl3",groupSize:d=10}=e,[u,p]=t.useState(""),[m,g]=t.useState([]),[f,h]=t.useState(!1),[y,b]=t.useState(null),[v,k]=t.useState(0),x=t.useRef(null),E=t.useRef(null),w=t.useRef(null),S=t.useRef(null);t.useEffect(()=>{if(!r)return;const e={storeId:r,readSecret:o,logLevel:"warn",enableContextCollection:!0,enableEventQueue:!0,eventQueue:{batchSize:10,flushInterval:5e3,enablePersistence:!0}};if(n)if(["local","stage","production"].includes(n))e.environment=n;else{const t=n.replace(/\/$/,"");e.baseUrl=t.endsWith("/api")?t:`${t}/api`}try{x.current=new a.SeekoraClient(e)}catch(e){console.error("Failed to initialize SeekoraClient:",e),b("Failed to initialize search client")}return()=>{x.current=null}},[r,o,n]);const C=t.useCallback(async e=>{if(x.current)if(e.trim()){S.current&&S.current.abort(),S.current=new AbortController,h(!0),b(null);try{const t=await x.current.search(e,{per_page:s,analytics_tags:l,return_fields:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url","title","anchor"],snippet_fields:["hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content"],snippet_prefix:"<mark>",snippet_suffix:"</mark>",include_snippets:!0,group_field:c,group_size:d});if(S.current?.signal.aborted)return;t?.context&&(E.current=t.context),g(function(e){const t=e=>"string"==typeof e?e.replace(/<\/?mark>/g,""):e?String(e):"";return e.map(e=>{const r=e?.document??e,a=function(e){const t={};return e?.hierarchy&&"object"==typeof e.hierarchy?(t.lvl0=e.hierarchy.lvl0,t.lvl1=e.hierarchy.lvl1,t.lvl2=e.hierarchy.lvl2,t.lvl3=e.hierarchy.lvl3,t.lvl4=e.hierarchy.lvl4,t.lvl5=e.hierarchy.lvl5):e&&"object"==typeof e&&(t.lvl0=e["hierarchy.lvl0"],t.lvl1=e["hierarchy.lvl1"],t.lvl2=e["hierarchy.lvl2"],t.lvl3=e["hierarchy.lvl3"],t.lvl4=e["hierarchy.lvl4"],t.lvl5=e["hierarchy.lvl5"]),t}(r),o=r.url||e.url||r.route||e.route||r.link||e.link||"",n=r.title||e.title||r.name||e.name||a?.lvl3||a?.lvl2||a?.lvl1||a?.lvl0||"",s=r.content??e.content??r.description??e.description??r.snippet??e.snippet??"",i=r.description??e.description??("string"==typeof s?s.substring(0,150):""),l=t(n)||t(a?.lvl3)||t(a?.lvl2)||t(a?.lvl1)||t(a?.lvl0)||"Untitled",c=t(s)?.substring(0,200)||s,d=e?.highlight??r?.highlight,u="string"==typeof d?.title?d.title:void 0,p="string"==typeof d?.content?d.content:void 0;return{url:o,title:l,content:c,description:t(i)||i,category:r.category??e.category??a?.lvl0??"",hierarchy:a,route:r.route??e.route,parentTitle:r.parent_title??r.parentTitle??e.parent_title??e.parentTitle,type:r.type??e.type??"",anchor:r.anchor??e.anchor??"",_source:"seekora",highlight:u??p?{title:u,content:p}:void 0}})}(t.results||[])),k(0)}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;console.error("Search failed:",e),b(e instanceof Error?e.message:"Search failed"),g([])}finally{h(!1)}}else g([]);else b("Search client not initialized")},[s,l,c,d]),R=t.useCallback(e=>{p(e),k(0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>C(e),i)},[C,i]),I=t.useCallback(()=>{k(e=>e>=m.length-1?0:e+1)},[m.length]),N=t.useCallback(()=>{k(e=>e<=0?m.length-1:e-1)},[m.length]),z=t.useCallback(()=>{S.current&&S.current.abort(),w.current&&clearTimeout(w.current),p(""),g([]),h(!1),b(null),k(0)},[]),T=t.useCallback(()=>m[v]||null,[m,v]),M=t.useCallback((e,t)=>{const r=x.current;if(!r?.trackEvent)return;const a=E.current??void 0,o=e.url||e.id||e.title||String(t);r.trackEvent({event_name:"doc_click",clicked_item_id:o,metadata:{position:t,result:e,source:"docsearch"}},a)},[]);return t.useEffect(()=>()=>{S.current&&S.current.abort(),w.current&&clearTimeout(w.current)},[]),{query:u,suggestions:m,isLoading:f,error:y,selectedIndex:v,setQuery:R,selectNext:I,selectPrev:N,setSelectedIndex:k,reset:z,getSelectedItem:T,trackDocClick:M}}function to(e,t,r=2){const a=e.toLowerCase().split(/\s+/),o=[];return a.forEach(a=>{a.length<3||t.forEach(t=>{const n=function(e,t){const r=[];for(let e=0;e<=t.length;e++)r[e]=[e];for(let t=0;t<=e.length;t++)r[0][t]=t;for(let a=1;a<=t.length;a++)for(let o=1;o<=e.length;o++)t.charAt(a-1)===e.charAt(o-1)?r[a][o]=r[a-1][o-1]:r[a][o]=Math.min(r[a-1][o-1]+1,r[a][o-1]+1,r[a-1][o]+1);return r[t.length][e.length]}(a,t.toLowerCase());if(n>0&&n<=r&&n<a.length/2){const r=e.replace(new RegExp(a,"gi"),t);o.includes(r)||o.push(r)}})}),o.slice(0,3)}const ro={price:[{pattern:/under\s*\$?(\d+(?:\.\d{2})?)/i,operator:"<=",field:"price"},{pattern:/less than\s*\$?(\d+(?:\.\d{2})?)/i,operator:"<",field:"price"},{pattern:/over\s*\$?(\d+(?:\.\d{2})?)/i,operator:">=",field:"price"},{pattern:/more than\s*\$?(\d+(?:\.\d{2})?)/i,operator:">",field:"price"},{pattern:/\$(\d+(?:\.\d{2})?)\s*-\s*\$?(\d+(?:\.\d{2})?)/i,operator:"range",field:"price"},{pattern:/between\s*\$?(\d+(?:\.\d{2})?)\s*and\s*\$?(\d+(?:\.\d{2})?)/i,operator:"range",field:"price"},{pattern:/\$(\d+(?:\.\d{2})?)/i,operator:"<=",field:"price"}],colors:["red","blue","green","black","white","pink","purple","yellow","orange","brown","gray","grey","navy","beige","gold","silver"],sizes:{"extra small":"XS",xs:"XS",small:"S",s:"S",medium:"M",m:"M",large:"L",l:"L","extra large":"XL",xl:"XL",xxl:"XXL","2xl":"XXL",xxxl:"XXXL","3xl":"XXXL"},brandIndicators:["by","from","brand"],ratings:[{pattern:/(\d+)\s*\+?\s*stars?/i,field:"rating",operator:">="},{pattern:/rated\s*(\d+)/i,field:"rating",operator:">="},{pattern:/top\s*rated/i,field:"rating",value:"4",operator:">="}],availability:[{pattern:/in\s*stock/i,field:"inStock",value:"true"},{pattern:/available/i,field:"inStock",value:"true"},{pattern:/on\s*sale/i,field:"onSale",value:"true"}]};const ao={"--seekora-bg-surface":"#ffffff","--seekora-bg-secondary":"#f9fafb","--seekora-bg-tertiary":"#f3f4f6","--seekora-bg-hover":"#f3f4f6","--seekora-text-primary":"#111827","--seekora-text-secondary":"#6b7280","--seekora-text-tertiary":"#9ca3af","--seekora-border-color":"#e5e7eb","--seekora-primary":"#3b82f6","--seekora-primary-light":"#eff6ff","--seekora-primary-dark":"#1d4ed8","--seekora-highlight-bg":"#fef3c7","--seekora-success":"#10b981","--seekora-warning":"#f59e0b","--seekora-error":"#ef4444","--seekora-font-family":'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',"--seekora-font-size-xs":"11px","--seekora-font-size-sm":"12px","--seekora-font-size-base":"14px","--seekora-font-size-lg":"16px","--seekora-font-weight-normal":"400","--seekora-font-weight-medium":"500","--seekora-font-weight-semibold":"600","--seekora-font-weight-bold":"700","--seekora-line-height-tight":"1.25","--seekora-line-height-normal":"1.5","--seekora-line-height-relaxed":"1.75","--seekora-spacing-xs":"4px","--seekora-spacing-sm":"8px","--seekora-spacing-md":"12px","--seekora-spacing-lg":"16px","--seekora-spacing-xl":"24px","--seekora-border-radius-sm":"4px","--seekora-border-radius":"6px","--seekora-border-radius-lg":"8px","--seekora-border-radius-xl":"12px","--seekora-border-radius-full":"9999px","--seekora-shadow-sm":"0 1px 2px 0 rgba(0, 0, 0, 0.05)","--seekora-shadow":"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)","--seekora-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)","--seekora-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)","--seekora-shadow-xl":"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","--seekora-transition-fast":"100ms ease","--seekora-transition-normal":"150ms ease","--seekora-transition-slow":"300ms ease","--seekora-z-dropdown":"1000","--seekora-z-modal":"1100","--seekora-z-tooltip":"1200"},oo={...ao,"--seekora-bg-surface":"#1f2937","--seekora-bg-secondary":"#111827","--seekora-bg-tertiary":"#374151","--seekora-bg-hover":"#374151","--seekora-text-primary":"#f9fafb","--seekora-text-secondary":"#d1d5db","--seekora-text-tertiary":"#9ca3af","--seekora-border-color":"#4b5563","--seekora-primary":"#60a5fa","--seekora-primary-light":"#1e3a5f","--seekora-primary-dark":"#93c5fd","--seekora-highlight-bg":"#854d0e","--seekora-shadow-sm":"0 1px 2px 0 rgba(0, 0, 0, 0.3)","--seekora-shadow":"0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3)","--seekora-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3)","--seekora-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3)","--seekora-shadow-xl":"0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4)"},no={...ao,"--seekora-border-color":"#f3f4f6","--seekora-shadow-sm":"none","--seekora-shadow":"0 1px 2px 0 rgba(0, 0, 0, 0.03)","--seekora-shadow-md":"0 2px 4px 0 rgba(0, 0, 0, 0.05)","--seekora-shadow-lg":"0 4px 8px 0 rgba(0, 0, 0, 0.08)","--seekora-shadow-xl":"0 8px 16px 0 rgba(0, 0, 0, 0.1)","--seekora-border-radius-sm":"2px","--seekora-border-radius":"4px","--seekora-border-radius-lg":"6px","--seekora-border-radius-xl":"8px"},so={blue:{"--seekora-primary":"#3b82f6","--seekora-primary-light":"#eff6ff","--seekora-primary-dark":"#1d4ed8"},green:{"--seekora-primary":"#10b981","--seekora-primary-light":"#ecfdf5","--seekora-primary-dark":"#059669"},purple:{"--seekora-primary":"#8b5cf6","--seekora-primary-light":"#f5f3ff","--seekora-primary-dark":"#7c3aed"},red:{"--seekora-primary":"#ef4444","--seekora-primary-light":"#fef2f2","--seekora-primary-dark":"#dc2626"},orange:{"--seekora-primary":"#f97316","--seekora-primary-light":"#fff7ed","--seekora-primary-dark":"#ea580c"},teal:{"--seekora-primary":"#14b8a6","--seekora-primary-light":"#f0fdfa","--seekora-primary-dark":"#0d9488"},pink:{"--seekora-primary":"#ec4899","--seekora-primary-light":"#fdf2f8","--seekora-primary-dark":"#db2777"}};function io(e=ao){return`\n /* Seekora Query Suggestions Styles */\n .seekora-suggestions {\n ${t=e,Object.entries(t).map(([e,t])=>`${e}: ${t};`).join("\n")}\n }\n\n /* Container */\n .seekora-suggestions-container {\n background-color: var(--seekora-bg-surface);\n border: 1px solid var(--seekora-border-color);\n border-radius: var(--seekora-border-radius-lg);\n box-shadow: var(--seekora-shadow-xl);\n font-family: var(--seekora-font-family);\n font-size: var(--seekora-font-size-base);\n color: var(--seekora-text-primary);\n overflow: hidden;\n }\n\n /* Section */\n .seekora-suggestions-section {\n padding: var(--seekora-spacing-sm) 0;\n }\n\n .seekora-suggestions-section-title {\n font-size: var(--seekora-font-size-xs);\n font-weight: var(--seekora-font-weight-bold);\n color: var(--seekora-text-tertiary);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n padding: var(--seekora-spacing-sm) var(--seekora-spacing-lg) var(--seekora-spacing-xs);\n margin: 0;\n }\n\n /* Item */\n .seekora-suggestions-item {\n display: flex;\n align-items: center;\n gap: var(--seekora-spacing-md);\n padding: var(--seekora-spacing-md) var(--seekora-spacing-lg);\n cursor: pointer;\n transition: background-color var(--seekora-transition-fast);\n }\n\n .seekora-suggestions-item:hover,\n .seekora-suggestions-item--active {\n background-color: var(--seekora-bg-hover);\n }\n\n .seekora-suggestions-item-icon {\n width: 16px;\n height: 16px;\n color: var(--seekora-text-secondary);\n flex-shrink: 0;\n }\n\n .seekora-suggestions-item-text {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .seekora-suggestions-item-count {\n font-size: var(--seekora-font-size-sm);\n color: var(--seekora-text-tertiary);\n }\n\n /* Highlight */\n .seekora-suggestions mark,\n .seekora-suggestions-highlight {\n background-color: var(--seekora-highlight-bg);\n font-weight: var(--seekora-font-weight-semibold);\n padding: 0 2px;\n border-radius: 2px;\n }\n\n /* Product Card */\n .seekora-product-card {\n background-color: var(--seekora-bg-surface);\n border: 1px solid var(--seekora-border-color);\n border-radius: var(--seekora-border-radius-lg);\n overflow: hidden;\n cursor: pointer;\n transition: transform var(--seekora-transition-normal), box-shadow var(--seekora-transition-normal);\n }\n\n .seekora-product-card:hover {\n transform: translateY(-2px);\n box-shadow: var(--seekora-shadow-md);\n }\n\n .seekora-product-card-image {\n width: 100%;\n aspect-ratio: 1;\n object-fit: cover;\n background-color: var(--seekora-bg-secondary);\n }\n\n .seekora-product-card-info {\n padding: var(--seekora-spacing-md);\n }\n\n .seekora-product-card-title {\n font-size: var(--seekora-font-size-sm);\n font-weight: var(--seekora-font-weight-medium);\n color: var(--seekora-text-primary);\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n }\n\n .seekora-product-card-price {\n font-size: var(--seekora-font-size-base);\n font-weight: var(--seekora-font-weight-bold);\n color: var(--seekora-primary);\n margin-top: var(--seekora-spacing-xs);\n }\n\n /* Tabs */\n .seekora-suggestions-tabs {\n display: flex;\n gap: var(--seekora-spacing-xs);\n padding: var(--seekora-spacing-md) var(--seekora-spacing-lg);\n border-bottom: 1px solid var(--seekora-border-color);\n overflow-x: auto;\n }\n\n .seekora-suggestions-tab {\n display: inline-flex;\n align-items: center;\n gap: var(--seekora-spacing-sm);\n padding: var(--seekora-spacing-sm) var(--seekora-spacing-md);\n font-size: var(--seekora-font-size-sm);\n font-weight: var(--seekora-font-weight-medium);\n color: var(--seekora-text-secondary);\n background-color: transparent;\n border: 1px solid transparent;\n border-radius: var(--seekora-border-radius-full);\n cursor: pointer;\n white-space: nowrap;\n transition: all var(--seekora-transition-fast);\n }\n\n .seekora-suggestions-tab:hover {\n background-color: var(--seekora-bg-hover);\n }\n\n .seekora-suggestions-tab--active {\n color: var(--seekora-primary);\n background-color: var(--seekora-primary-light);\n border-color: var(--seekora-primary);\n }\n\n /* Brand chip */\n .seekora-brand-chip {\n display: inline-flex;\n align-items: center;\n gap: var(--seekora-spacing-sm);\n padding: var(--seekora-spacing-sm) var(--seekora-spacing-md);\n font-size: var(--seekora-font-size-sm);\n font-weight: var(--seekora-font-weight-medium);\n color: var(--seekora-text-primary);\n background-color: var(--seekora-bg-surface);\n border: 1px solid var(--seekora-border-color);\n border-radius: var(--seekora-border-radius-lg);\n cursor: pointer;\n transition: all var(--seekora-transition-fast);\n }\n\n .seekora-brand-chip:hover {\n border-color: var(--seekora-primary);\n background-color: var(--seekora-primary-light);\n }\n\n /* Category pill */\n .seekora-category-pill {\n display: inline-flex;\n align-items: center;\n gap: var(--seekora-spacing-xs);\n padding: 3px var(--seekora-spacing-sm);\n font-size: var(--seekora-font-size-xs);\n font-weight: var(--seekora-font-weight-medium);\n color: var(--seekora-text-secondary);\n background-color: var(--seekora-bg-tertiary);\n border-radius: var(--seekora-border-radius-full);\n cursor: pointer;\n transition: all var(--seekora-transition-fast);\n }\n\n .seekora-category-pill:hover {\n background-color: var(--seekora-primary-light);\n color: var(--seekora-primary);\n }\n\n /* Loading */\n .seekora-suggestions-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--seekora-spacing-xl);\n color: var(--seekora-text-secondary);\n }\n\n /* Empty state */\n .seekora-suggestions-empty {\n padding: var(--seekora-spacing-xl);\n text-align: center;\n color: var(--seekora-text-secondary);\n }\n\n /* Footer */\n .seekora-suggestions-footer {\n padding: var(--seekora-spacing-md) var(--seekora-spacing-lg);\n border-top: 1px solid var(--seekora-border-color);\n background-color: var(--seekora-bg-secondary);\n font-size: var(--seekora-font-size-sm);\n color: var(--seekora-text-secondary);\n }\n\n /* Keyboard hint */\n .seekora-keyboard-key {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 18px;\n padding: 0 4px;\n border-radius: 3px;\n background-color: var(--seekora-bg-secondary);\n border: 1px solid var(--seekora-border-color);\n font-size: 10px;\n font-weight: var(--seekora-font-weight-medium);\n }\n\n /* Animations */\n @keyframes seekora-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n @keyframes seekora-fade-in {\n from { opacity: 0; transform: translateY(-8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n @keyframes seekora-fade-out {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(-8px); }\n }\n\n .seekora-suggestions--entering {\n animation: seekora-fade-in var(--seekora-transition-normal) ease-out;\n }\n\n .seekora-suggestions--exiting {\n animation: seekora-fade-out var(--seekora-transition-normal) ease-in;\n }\n `;var t}let lo=!1;function co(e=ao,t=!1){if("undefined"==typeof document)return;if(lo&&!t)return;const r="seekora-suggestions-styles";let a=document.getElementById(r);a||(a=document.createElement("style"),a.id=r,a.type="text/css",document.head.appendChild(a)),a.textContent=io(e),lo=!0}e.ActionButtons=zt,e.AmazonDropdown=aa,e.AnalyticsProvider=function({client:e,context:r,children:a}){const o=t.useRef(null),n=t.useCallback(async(t,a)=>{try{await(e.trackEvent?.({event_name:t,metadata:{timestamp:Date.now(),source:"analytics_provider_delegation",...a}},r)),l(`AnalyticsProvider: ${t}`,a)}catch(e){d(`AnalyticsProvider: Failed to track ${t}`,{error:e})}},[e,r]);return t.useEffect(()=>{const t=o.current;if(!t)return;const a=t=>{const a=t.target.closest("[data-seekora-track]");if(!a)return;const o=a.getAttribute("data-seekora-track"),s=a.getAttribute("data-seekora-product-id"),i=a.getAttribute("data-seekora-position"),l=a.getAttribute("data-seekora-section"),c=a.getAttribute("data-seekora-variant-sku"),d=a.getAttribute("data-seekora-variant-option"),u=a.getAttribute("data-seekora-variant-value"),p={};switch(s&&(p.product_id=s),i&&(p.position=parseInt(i,10)),l&&(p.section=l),o){case"click":if(n("product.click",p),e?.trackClick&&s){const t=i?parseInt(i,10)+1:1;Promise.resolve(e.trackClick(s,t,r)).catch(()=>{})}break;case"add-to-cart":c&&(p.variant_sku=c),n("product.add_to_cart",p);break;case"variant-select":d&&(p.option_name=d),u&&(p.option_value=u),n("product.variant_select",p);break;default:o&&n(o,p)}};return t.addEventListener("click",a),()=>t.removeEventListener("click",a)},[e,r,n]),t.createElement(qr.Provider,{value:{client:e,context:r}},t.createElement("div",{ref:o,style:{display:"contents"}},a))},e.BadgeList=dr,e.Breadcrumb=({attributes:e,separator:r=" > ",rootLabel:a="Home",renderItem:o,renderSeparator:n,onNavigate:s,className:i,style:l,theme:c,items:d})=>{const{theme:u,stateManager:p}=w(),{refinements:m,removeRefinement:g,clearRefinements:f}=S(),h=c||{},y=t.useMemo(()=>{if(d)return d;const t=[];return e.forEach((e,a)=>{const o=m.find(t=>t.field===e);if(o){const e=o.value.split(r);e.forEach((a,o)=>{const n=e.slice(0,o+1).join(r);t.some(e=>e.value===n)||t.push({label:a,value:n})})}}),t},[e,m,r,d]),b=t.useCallback((t,r)=>{if(null===t)e.forEach(e=>{m.filter(t=>t.field===e).forEach(e=>g(e.field,e.value,!1))}),p.search();else{const r=y.findIndex(e=>e.value===t.value);e.forEach((e,a)=>{m.filter(t=>t.field===e).forEach(e=>{(a>r||a===r&&e.value!==t.value)&&g(e.field,e.value,!1)})}),p.search()}s&&s(t,r)},[e,m,g,p,y,s]);return 0===y.length?null:t.createElement("nav",{className:I(h.root,i),style:l,"aria-label":"Breadcrumb"},t.createElement("ol",{className:h.list,style:{display:"flex",flexWrap:"wrap",alignItems:"center",listStyle:"none",margin:0,padding:0,fontSize:u.typography.fontSize.small}},t.createElement("li",{className:h.item},t.createElement("button",{type:"button",onClick:()=>b(null,-1),className:h.link,style:{padding:0,background:"none",border:"none",cursor:"pointer",color:u.colors.primary,fontFamily:"inherit",fontSize:"inherit",textDecoration:"none"}},a)),y.map((e,r)=>{const a=r===y.length-1;return t.createElement(t.Fragment,{key:e.value},n?n():t.createElement("span",{className:h.separator,style:{margin:`0 ${u.spacing.small}`,color:u.colors.textSecondary},"aria-hidden":"true"},"›"),t.createElement("li",{className:I(h.item,a&&h.current)},o?o(e,r,a):a?t.createElement("span",{style:{color:u.colors.text,fontWeight:u.typography.fontWeight?.medium||500},"aria-current":"page"},e.label):t.createElement("button",{type:"button",onClick:()=>b(e,r),className:h.link,style:{padding:0,background:"none",border:"none",cursor:"pointer",color:u.colors.primary,fontFamily:"inherit",fontSize:"inherit",textDecoration:"none"}},e.label)))})))},e.CategoriesTabs=Tr,e.ClearRefinements=({clearsQuery:e=!1,resetLabel:r="Clear all filters",disabledLabel:a="No filters applied",includedFields:o,excludedFields:n=[],onClear:s,renderButton:i,className:l,style:c,theme:d,hideWhenEmpty:u=!1})=>{const{theme:p}=w(),{query:m,refinements:g,clearRefinements:f,setQuery:h,removeRefinement:y}=S(),b=d||{},v=t.useMemo(()=>g.filter(e=>!n.includes(e.field)&&!(o&&!o.includes(e.field))),[g,o,n]),k=v.length>0||e&&m.length>0,x=()=>{k&&(o||n.length>0?(v.forEach(e=>{y(e.field,e.value,!1)}),v.length>0&&f(!1)):f(!e),e&&m.length>0&&h("",!0),s&&s())};return u&&!k?null:i?t.createElement("div",{className:I(b.root,l),style:c},i({canClear:k,onClick:x,disabled:!k})):t.createElement("div",{className:I(b.root,l),style:c},t.createElement("button",{type:"button",onClick:x,disabled:!k,className:I(b.button,!k&&b.buttonDisabled),style:{padding:`${p.spacing.small} ${p.spacing.medium}`,fontSize:p.typography.fontSize.medium,fontWeight:p.typography.fontWeight?.medium||500,backgroundColor:p.colors.primary,color:"#ffffff",border:"none",borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,cursor:k?"pointer":"default",opacity:k?1:0,pointerEvents:k?"auto":"none",transition:"none"},"aria-label":r},r))},e.CurrentRefinements=({refinements:e,onRefinementClear:r,onClearAll:a,renderRefinement:o,showClearAll:n=!0,variant:s="chips",layout:i="horizontal",fieldColors:l,renderCloseIcon:c,className:d,style:u,theme:p,excludeFields:m})=>{const{theme:g}=w(),{refinements:f,removeRefinement:h,clearRefinements:y}=S(),b=p||{},v=(e,t)=>{const r=e.toLowerCase();return r.includes("price")||r.includes("cost")||r.includes("amount")?`$${t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:t.toLocaleString()},k=t.useMemo(()=>f.map(e=>`${e.field}:${e.value}`).sort().join("|"),[f.map(e=>`${e.field}:${e.value}`).sort().join("|")]),x=t.useMemo(()=>{if(void 0!==e)return e;const t=new Map,r=[];f.forEach(e=>{const a=e.value.match(/^>=(\d+(?:\.\d+)?)$/),o=e.value.match(/^<=(\d+(?:\.\d+)?)$/);if(a||o){t.has(e.field)||t.set(e.field,{});const r=t.get(e.field);a&&(r.minVal=parseFloat(a[1])),o&&(r.maxVal=parseFloat(o[1]))}else r.push({field:e.field,value:e.value})}),t.forEach((e,t)=>{let a;if(void 0!==e.minVal&&void 0!==e.maxVal)a=`${v(t,e.minVal)} – ${v(t,e.maxVal)}`;else if(void 0!==e.minVal)a=`≥ ${v(t,e.minVal)}`;else{if(void 0===e.maxVal)return;a=`≤ ${v(t,e.maxVal)}`}r.push({field:t,value:"__range__",displayValue:a})});const a=r;if(m&&m.length>0){const e=new Set(m);return a.filter(t=>!e.has(t.field))}return a},[e,k,m]),[E,C]=t.useState(new Set),[R,N]=t.useState(new Set),z=t.useRef([]);t.useEffect(()=>{const e=new Set(x.map(e=>`${e.field}:${e.value}`)),t=new Set(z.current.map(e=>`${e.field}:${e.value}`)),r=new Set;t.forEach(t=>{e.has(t)||r.add(t)}),r.size>0&&(N(r),setTimeout(()=>N(new Set),200)),C(e),z.current=[...x]},[x]);const T=(a,o)=>{const n=`${a.field}:${a.value}`,d=l?.[a.field],u=E.has(n)&&!z.current.some(e=>`${e.field}:${e.value}`===n),p=((e,t,r,a,o)=>{const n=o||`var(--seekora-refinement-bg, ${t.hover})`,s=`var(--seekora-refinement-color, ${t.text})`,i=`var(--seekora-refinement-border, ${t.border})`;switch(e){case"tags":return{display:"inline-flex",alignItems:"center",padding:`2px ${r.medium}`,backgroundColor:n,border:`1px solid ${i}`,borderRadius:"var(--seekora-refinement-radius, 4px)",fontSize:"12px",color:s,fontWeight:500};case"pills":return{display:"inline-flex",alignItems:"center",padding:`${r.small} ${r.medium}`,backgroundColor:n,border:"none",borderRadius:"var(--seekora-refinement-radius, 9999px)",fontSize:"13px",color:s};case"badges":return{display:"inline-flex",alignItems:"center",padding:`3px ${r.small}`,backgroundColor:t.primary,border:"none",borderRadius:"var(--seekora-refinement-radius, 4px)",fontSize:"11px",color:"#fff",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px"};case"text-list":return{display:"flex",alignItems:"center",padding:`${r.small} 0`,backgroundColor:"transparent",border:"none",borderBottom:`1px solid ${i}`,borderRadius:"0",fontSize:"14px",color:s};default:return{display:"inline-flex",alignItems:"center",padding:`${r.small} ${r.medium}`,backgroundColor:n,border:`1px solid ${i}`,borderRadius:`var(--seekora-refinement-radius, ${"string"==typeof a?a:a.medium})`,fontSize:"13px",color:s}}})(s,g.colors,g.spacing,g.borderRadius,d),m=((e,t)=>{switch(e){case"tags":return t.tag;case"pills":return t.pill;case"badges":return t.badge;case"chips":return t.chip;default:return t.item}})(s,b);return t.createElement("div",{key:`${n}-${o}`,className:I(b.item,m),role:"listitem",style:{...p,margin:"vertical"===i?`0 0 ${g.spacing.small} 0`:`0 ${g.spacing.small} ${g.spacing.small} 0`,transition:`all ${ee}`,opacity:R.has(n)?0:1,transform:R.has(n)?"scale(0.8)":"scale(1)",animation:u?"seekoraChipIn 200ms ease-out":void 0}},"badges"!==s&&t.createElement("span",{className:b.label,style:{marginRight:g.spacing.small,fontWeight:"500",opacity:.7}},a.label||a.field,":"),t.createElement("span",{className:b.value},a.displayValue||a.value),t.createElement("button",{type:"button",onClick:()=>((t,a)=>{if(void 0===e)if("__range__"===a){const e=f.filter(e=>e.field===t&&(/^>=/.test(e.value)||/^<=/.test(e.value)));e.forEach((r,a)=>h(t,r.value,a===e.length-1))}else h(t,a);r&&r(t,a)})(a.field,a.value),className:b.clearButton,style:{border:"none",backgroundColor:"transparent",color:"inherit",cursor:"pointer",fontSize:"14px",padding:"0 0 0 6px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:`opacity ${J}`,opacity:.6},"aria-label":`Clear ${a.label||a.field}: ${a.value}`,onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.6"},c?c():t.createElement("span",{"aria-hidden":"true",style:{lineHeight:1}},"×")))},M="grouped"===i?x.reduce((e,t)=>(e[t.field]||(e[t.field]=[]),e[t.field].push(t),e),{}):null,A={...u,...b.list&&!u?.display?{display:"contents"}:{}},_={display:"flex",flexDirection:"vertical"===i?"column":"row",alignItems:"vertical"===i?"flex-start":"center",marginBottom:n&&x.length>0?g.spacing.medium:0,...b.list?{}:{flexWrap:"vertical"===i?"nowrap":"wrap"}};return t.createElement("div",{className:I(b.container,d),style:A},t.createElement("style",null,"\n @keyframes seekoraChipIn {\n from { opacity: 0; transform: scale(0.8); }\n to { opacity: 1; transform: scale(1); }\n }\n "),x.length>0&&t.createElement(t.Fragment,null,"grouped"===i&&M?Object.entries(M).map(([e,r])=>t.createElement("div",{key:e,className:b.group,style:{marginBottom:g.spacing.medium}},t.createElement("div",{className:b.groupLabel,style:{fontSize:g.typography.fontSize.small,fontWeight:600,color:g.colors.text,marginBottom:g.spacing.small,textTransform:"capitalize"}},r[0]?.label||e),t.createElement("div",{role:"list",style:_},r.map((e,t)=>o?o(e,t):T(e,t))))):t.createElement("div",{role:"list",className:b.list,style:_},x.map((e,t)=>o?o(e,t):T(e,t))),n&&x.length>1&&t.createElement("button",{type:"button",onClick:()=>{void 0===e&&y(),a&&a()},className:b.clearAllButton,style:{padding:`${g.spacing.small} ${g.spacing.medium}`,border:`1px solid ${g.colors.border}`,borderRadius:"string"==typeof g.borderRadius?g.borderRadius:g.borderRadius.medium,backgroundColor:g.colors.background,color:g.colors.text,cursor:"pointer",fontSize:g.typography.fontSize.small,textDecoration:"underline",transition:`background-color ${J}`}},"Clear all filters")))},e.CustomSelect=V,e.DocSearch=function({storeId:e,storeSecret:r,seekoraApiEndpoint:a,apiEndpoint:o,apiKey:n,sources:s,placeholder:i="Search documentation...",maxResults:l=10,debounceMs:c=200,onSelect:d,onClose:u,translations:p={},renderButton:m=!0,buttonComponent:g=Xa,initialOpen:f=!1,disableShortcut:h=!1,shortcutKey:y="k",processGroupedResults:b}){const[v,k]=t.useState(f),x=t.useRef(!1),E=!!e,w=eo({storeId:e||"",storeSecret:r,apiEndpoint:a,maxResults:l,debounceMs:c,analyticsTags:["docsearch"]}),S=Ja({apiEndpoint:o,apiKey:n,sources:s,maxResults:l,debounceMs:c,processGroupedResults:b}),{query:C,suggestions:R,isLoading:I,error:N,selectedIndex:z,setQuery:T,selectNext:M,selectPrev:A,setSelectedIndex:_,reset:$,getSelectedItem:L}=E?w:S,P=E?void 0:S.groupedSuggestions,D=E?R:S.results,F=E?"suggestions":S.mode,B=E?[{id:"seekora",name:"Results",endpoint:""}]:S.sources,W=t.useCallback(()=>k(!0),[]),q=t.useCallback(()=>{k(!1),$(),u?.()},[$,u]),H=t.useCallback(e=>{E&&w.trackDocClick&&w.trackDocClick(e,z+1),d?d(e):window.location.href=e.url,q()},[d,q,E,w,z]),O=t.useCallback(()=>{const e=L();e&&H(e)},[L,H]),j=t.useCallback(()=>{x.current=!0,M()},[M]),V=t.useCallback(()=>{x.current=!0,A()},[A]),{handleModalKeyDown:U}=Qa({isOpen:v,onOpen:W,onClose:q,onSelectNext:j,onSelectPrev:V,onEnter:O,disableShortcut:h,shortcutKey:y}),K=t.useCallback(e=>U(e),[U]),Q="results"===F?D:R;return t.createElement(t.Fragment,null,m&&t.createElement(g,{onClick:W,placeholder:p.buttonText||i}),t.createElement(_a,{isOpen:v,onClose:q},t.createElement("div",{className:"seekora-docsearch-modal",onKeyDown:K},t.createElement("header",{className:"seekora-docsearch-header"},t.createElement($a,{value:C,onChange:T,onKeyDown:K,placeholder:i,onClear:$}),t.createElement("button",{type:"button",className:"seekora-docsearch-close",onClick:q,"aria-label":"Close search"},t.createElement("span",{className:"seekora-docsearch-close-text"},"esc"))),t.createElement("div",{className:"seekora-docsearch-body"},t.createElement(Va,{hits:Q,groupedHits:P,selectedIndex:z,onSelect:H,onHover:_,scrollSelectionIntoViewRef:x,query:C,isLoading:I,error:N,translations:p,sources:B})),t.createElement(Ka,{translations:p}))))},e.DocSearchButton=Xa,e.DropdownPanel=ut,e.FacetDropdown=({field:e,placeholder:a="All Categories",className:o,theme:n={},onChange:s,value:i,maxOptions:c=10,showCounts:d=!0,options:p,client:m,applyFilter:g=!0,navigateOnSelect:f=!1,searchPageUrl:h="/search",useFiltersApi:y=!1})=>{const{client:b,theme:v,stateManager:k}=w(),{addRefinement:x,removeRefinement:E,refinements:C,search:R}=S(),I=m||b,[N,z]=t.useState(!1),[T,M]=t.useState(p||[]),[A,_]=t.useState(i||""),[$,L]=t.useState(null),P=t.useRef(null),D=t.useRef(null),F=void 0!==i?i:A,B=t.useCallback(async()=>{if(!p&&I)try{if(l("FacetDropdown: Fetching facet values",{field:e,useFiltersApi:y}),y){const t=await k.fetchFilters({facetBy:e,maxFacetValues:100}),r=(t?.filters||[]).find(t=>t.field===e);if(r&&r.values){const t=r.values.map(e=>({value:e.value||"",count:e.count||0,label:e.value||""}));M(t),l("FacetDropdown: Facet options loaded via Filters API",{field:e,count:t.length})}else l("FacetDropdown: No filter data found",{field:e}),M([])}else{const t=await I.search("*",{facet_by:e,max_facet_values:100,per_page:0});l("FacetDropdown: Search response",{response:t});const r=t?.data?.facets||t?.facets,a=Array.isArray(r)?r:[],o=a.find(t=>t.field_name===e||t.field===e);if(o&&o.counts){const t=o.counts.map(e=>({value:e.value,count:e.count,label:e.value}));M(t),l("FacetDropdown: Facet options loaded",{field:e,count:t.length})}else l("FacetDropdown: No facet data found",{field:e,facets:a}),M([])}}catch(t){const r=t instanceof Error?t:new Error(String(t));u("FacetDropdown: Error fetching facet values",{field:e,error:r.message}),M([])}},[e,I,p,y]);t.useEffect(()=>{!p&&I&&B()},[B,p,I]),t.useEffect(()=>{if(!N||!D.current)return;const e=()=>{if(!D.current)return;const e=D.current.getBoundingClientRect();L({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[N]),t.useEffect(()=>{if(!N)return;const e=e=>{P.current&&!P.current.contains(e.target)&&D.current&&!D.current.contains(e.target)&&z(!1)},t=e=>{"Escape"===e.key&&z(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[N]);const W=t.useCallback(t=>{if(l("FacetDropdown: Value selected",{field:e,value:t}),_(t),z(!1),s&&s(t),g&&x&&E){const r=C.find(t=>t.field===e);r&&E(e,r.value,!1),t?x(e,t,!0):R&&R()}if(f&&t&&"undefined"!=typeof window){const r=new URL(window.location.origin+h);r.searchParams.set(e,t),window.location.href=r.toString()}},[e,s,g,x,E,C,R,f,h]),q=F||a,H=T.length>0,O=["facet-dropdown-button",n.button,o,N&&n.buttonOpen].filter(Boolean).join(" ");return t.createElement("div",{className:"facet-dropdown-container",style:{position:"relative"}},t.createElement("style",{dangerouslySetInnerHTML:{__html:"\n .facet-dropdown-panel {\n --scrollbar-track: transparent;\n --scrollbar-thumb: var(--facet-dropdown-scrollbar-thumb, var(--border-color));\n --scrollbar-thumb-hover: var(--facet-dropdown-scrollbar-thumb-hover, var(--text-secondary));\n }\n .facet-dropdown-panel::-webkit-scrollbar {\n width: 6px;\n }\n .facet-dropdown-panel::-webkit-scrollbar-track {\n background: var(--scrollbar-track);\n }\n .facet-dropdown-panel::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb);\n border-radius: 3px;\n }\n .facet-dropdown-panel::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover);\n }\n .facet-dropdown-panel {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);\n }\n "}}),t.createElement("button",{ref:D,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),z(e=>!e)},className:O,"aria-label":`Filter by ${e}`,"aria-expanded":N,"aria-haspopup":"listbox",style:{display:"flex",alignItems:"center",gap:"0.375rem",padding:"0.625rem 0.75rem",fontSize:"var(--facet-dropdown-font-size, 0.875rem)",fontWeight:"var(--facet-dropdown-font-weight, 500)",color:"var(--facet-dropdown-text, var(--text-color, currentColor))",backgroundColor:"var(--facet-dropdown-button-bg, var(--background, transparent))",border:"1px solid var(--facet-dropdown-border, var(--border-color))",borderRadius:v?.borderRadius&&"string"!=typeof v.borderRadius?v.borderRadius.medium:"0.5rem",cursor:"pointer",transition:"all 0.2s ease",outline:"none",whiteSpace:"nowrap",minWidth:"8rem",...!H&&{opacity:.6,cursor:"not-allowed"}},disabled:!H},t.createElement("span",{style:{flex:1,textAlign:"left",overflow:"hidden",textOverflow:"ellipsis"}},q),t.createElement("svg",{className:n.caretIcon,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:N?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease",flexShrink:0},"aria-hidden":"true"},t.createElement("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))),(()=>{if(!N||!H||!$||"undefined"==typeof document)return null;const o=t.createElement("div",{ref:P,className:n.panel||"facet-dropdown-panel",role:"listbox","aria-label":`${e} options`,style:{position:"absolute",top:`${$.top}px`,left:`${$.left}px`,minWidth:`${$.width}px`,width:"max-content",maxWidth:"min(24rem, 90vw)",maxHeight:"calc(100vh - 100px)",overflowY:"auto",overflowX:"hidden",backgroundColor:"var(--facet-dropdown-bg, var(--background))",border:"1px solid var(--facet-dropdown-border, var(--border-color))",borderRadius:v?.borderRadius&&"string"!=typeof v.borderRadius?v.borderRadius.medium:"0.5rem",boxShadow:"var(--facet-dropdown-shadow, var(--shadow-lg))",zIndex:Z,padding:"0.25rem"}},t.createElement("button",{type:"button",role:"option","aria-selected":!F,onClick:e=>{e.preventDefault(),e.stopPropagation(),W("")},className:[n.option,!F&&n.optionActive].filter(Boolean).join(" "),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",fontSize:"var(--facet-dropdown-option-font-size, 0.875rem)",fontWeight:F?"normal":"var(--facet-dropdown-option-font-weight-active, 500)",color:"var(--facet-dropdown-option-text, var(--text-color, currentColor))",backgroundColor:F?"transparent":"var(--facet-dropdown-option-active-bg, var(--hover-color))",border:"none",borderRadius:v?.borderRadius&&"string"!=typeof v.borderRadius?v.borderRadius.small:"0.25rem",cursor:"pointer",transition:"background-color 0.15s ease",display:"flex",alignItems:"center",justifyContent:"space-between"}},t.createElement("span",null,a)),T.map(e=>{const r=F===e.value;return t.createElement("button",{key:e.value,type:"button",role:"option","aria-selected":r,onClick:t=>{t.preventDefault(),t.stopPropagation(),W(e.value)},className:[n.option,r&&n.optionActive].filter(Boolean).join(" "),style:{width:"100%",textAlign:"left",padding:"0.5rem 0.75rem",fontSize:"var(--facet-dropdown-option-font-size, 0.875rem)",fontWeight:r?"var(--facet-dropdown-option-font-weight-active, 500)":"normal",color:"var(--facet-dropdown-option-text, var(--text-color, currentColor))",backgroundColor:r?"var(--facet-dropdown-option-active-bg, var(--hover-color))":"transparent",border:"none",borderRadius:v?.borderRadius&&"string"!=typeof v.borderRadius?v.borderRadius.small:"0.25rem",cursor:"pointer",transition:"background-color 0.15s ease",display:"flex",alignItems:"center",justifyContent:"space-between"}},t.createElement("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"}},e.label||e.value),d&&t.createElement("span",{style:{fontSize:"var(--facet-dropdown-count-font-size, 0.75rem)",color:"var(--facet-dropdown-count-text, var(--text-secondary, currentColor))",opacity:.7,marginLeft:"0.5rem",flexShrink:0}},"(",e.count,")"))}));return r.createPortal(o,document.body)})())},e.Facets=({results:e,facets:r,onFacetChange:a,renderFacet:o,renderFacetItem:n,maxItems:s=10,showMore:i=!0,className:c,style:d,theme:p,variant:m="checkbox",searchable:g=!1,showCounts:f=!0,colorMap:h,defaultCollapsed:y=!1,size:b="medium",facetRanges:v,useFiltersApi:k=!1,disjunctiveFacets:x,hideEmptyFacets:E=!0,defaultCollapsedFields:C,onFacetsAvailable:R})=>{const{theme:N}=w(),{results:z,refinements:T,addRefinement:M,removeRefinement:A}=S(),_=p||{},{filters:$,searchFacetValues:L}=U(k?{disjunctiveFacets:x}:{autoFetch:!1}),[P,D]=t.useState({}),[F,B]=t.useState({}),W=e||z,q=(()=>{if(r)return r;if(k&&$.length>0)return l("Facets: Using Filters API data",{filterCount:$.length}),$.map(e=>({field:e.field||"",label:e.field||"",items:(e.values||[]).map(t=>({value:t.value||"",count:t.count||0,selected:T.some(r=>r.field===e.field&&r.value===t.value)})),stats:null!=e.stats?.min&&null!=e.stats?.max?{min:e.stats.min,max:e.stats.max,avg:e.stats.avg,sum:e.stats.sum}:void 0}));const e=W?.data?.facets||W?.facets||W?.data?.data?.facets||null;if(l("Facets: Extracting facets",{hasResults:!!W,hasData:!!W?.data,rawFacets:e?Array.isArray(e)?e.length:"not array":null,resultsKeys:W?Object.keys(W):[],dataKeys:W?.data?Object.keys(W.data):[],sampleFacet:e&&Array.isArray(e)&&e.length>0?e[0]:null}),!e||!Array.isArray(e))return l("Facets: No facets found in response",{rawFacetsType:e?typeof e:"null",isArray:Array.isArray(e),resultsStructure:W?JSON.stringify(Object.keys(W)):"null",dataStructure:W?.data?JSON.stringify(Object.keys(W.data)):"null"}),[];const t=e.map(e=>{const t=e.field_name||e.field;return{field:t,label:e.label||t,items:Array.isArray(e.counts)?e.counts.map(e=>({value:e.value,count:e.count,selected:T.some(r=>r.field===t&&r.value===e.value)})):[],stats:e.stats||void 0}});return l("Facets: Extracted facets",{count:t.length,facets:t.map(e=>({field:e.field,itemsCount:e.items.length}))}),t})(),H=E?q.filter(e=>{return e.items.length>0||null!=(t=e.stats)&&(null!=t.min||null!=t.max);var t}):q,O=H.length,j=t.useRef(null);t.useEffect(()=>{if(!R)return;const e=O>0;j.current!==e&&(j.current=e,R(e))},[O,R]);const V=(e,t,r)=>{const o=!r;if(l("Facets: Facet toggled",{field:e,value:t,selected:o}),o?M(e,t):A(e,t),a)try{a(e,t,o)}catch(r){const a=r instanceof Error?r:new Error(String(r));u("Facets: Error in onFacetChange callback",{field:e,value:t,selected:o,error:a.message})}},K=e=>{D(t=>({...t,[e]:!t[e]}))},Z=e=>!!C?.includes(e)||y,J=e=>F[e]||"",ee=(e,t)=>{if(!g)return e;const r=J(t).toLowerCase();return r?e.filter(e=>e.value.toLowerCase().includes(r)):e},te=t.useMemo(()=>{switch(b){case"small":return{font:N.typography.fontSize.small,padding:"0.5rem",gap:"0.5rem"};case"large":return{font:N.typography.fontSize.large,padding:"0.75rem",gap:"0.75rem"};default:return{font:N.typography.fontSize.medium,padding:N.spacing.small,gap:N.spacing.small}}},[b,N]),re=e=>g?t.createElement("input",{type:"text",value:J(e.field),onChange:t=>{return r=e.field,a=t.target.value,void B(e=>({...e,[r]:a}));var r,a},placeholder:`Search ${e.label||e.field}...`,className:I(_.searchInput),"aria-label":`Search within ${e.label||e.field}`,style:{width:"100%",boxSizing:"border-box",padding:te.padding,marginBottom:te.gap,fontSize:N.typography.fontSize.small,border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.small,outline:"none",color:N.colors.text,backgroundColor:"var(--seekora-facet-bg, transparent)"}}):null,ae=(e,r,a)=>{if(!(P[r.field]||a<s)&&a>=s)return null;const o=T.some(t=>t.field===r.field&&t.value===e.value)||e.selected||!1;return t.createElement("div",{key:`${r.field}-${e.value}`,className:I(_.facetItem,o&&_.facetItemActive),role:"option","aria-selected":o,"aria-checked":o,tabIndex:-1,onClick:()=>V(r.field,e.value,e.selected||!1),style:{display:"flex",alignItems:"center",padding:te.padding,cursor:"pointer",borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium,marginBottom:te.gap,backgroundColor:o?"var(--seekora-facet-active-bg, "+N.colors.hover+")":"transparent",transition:"background-color 0.2s ease",boxSizing:"border-box"}},t.createElement("input",{type:"checkbox",checked:T.some(t=>t.field===r.field&&t.value===e.value)||e.selected||!1,onChange:()=>V(r.field,e.value,e.selected||!1),className:_.checkbox,style:{marginRight:te.gap,cursor:"pointer"},"aria-label":`Filter by ${e.value}`}),t.createElement("span",{className:_.facetItemLabel,style:{flex:1,fontSize:te.font,lineHeight:1.5,color:N.colors.text}},e.value),(n=e.count,f?t.createElement("span",{className:I(_.countBadge),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"1.5em",padding:"0.1em 0.5em",marginLeft:te.gap,fontSize:N.typography.fontSize.small,fontWeight:N.typography.fontWeight?.medium??500,lineHeight:1,color:"var(--seekora-facet-count-color, #495057)",backgroundColor:"var(--seekora-facet-count-bg, #e9ecef)",borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.full,flexShrink:0}},n):null));var n},oe=(e,r,a)=>{if(!(P[r.field]||a<s)&&a>=s)return null;const o=T.some(t=>t.field===r.field&&t.value===e.value)||e.selected||!1,n=h?.[e.value]??function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t),t|=0;return`hsl(${Math.abs(t)%360}, 65%, 55%)`}(e.value),i=function(e){switch(e){case"small":return 24;case"large":return 40;default:return 32}}(b);return t.createElement("div",{key:`${r.field}-${e.value}`,className:I(_.facetItem,o&&_.facetItemActive),role:"option","aria-selected":o,"aria-checked":o,tabIndex:-1,onClick:()=>V(r.field,e.value,e.selected||!1),title:`${e.value}${f?` (${e.count})`:""}`,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",cursor:"pointer",margin:te.gap}},t.createElement("div",{className:I(_.colorSwatch,o&&_.colorSwatchSelected),style:{width:`var(--seekora-facet-swatch-size, ${i}px)`,height:`var(--seekora-facet-swatch-size, ${i}px)`,borderRadius:"50%",backgroundColor:n,border:o?`3px solid var(--seekora-primary, ${N.colors.primary})`:`2px solid var(--seekora-facet-border, ${N.colors.border})`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border 0.2s ease, box-shadow 0.2s ease",boxShadow:o?`0 0 0 2px var(--seekora-primary-alpha, ${N.colors.primary}33)`:"none",position:"relative"}},o&&t.createElement("span",{className:I(_.colorSwatchInner),style:{display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(X,{size:Math.round(.5*i)}))),t.createElement("span",{className:_.facetItemLabel,style:{fontSize:N.typography.fontSize.small,color:N.colors.text,marginTop:"0.25rem",textAlign:"center",maxWidth:`${i+16}px`,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.value),f&&t.createElement("span",{className:I(_.countBadge),style:{fontSize:N.typography.fontSize.small,color:"var(--seekora-facet-count-color, "+(N.colors.textSecondary||N.colors.text)+")",lineHeight:1,marginTop:"0.125rem"}},e.count))},ne=(e,t,r)=>n?n(e,t,r):"color-swatch"===m?oe(e,t,r):ae(e,t,r),se=(e,t,r)=>{const a=e.currentTarget.querySelector('[aria-selected="true"]'),o=Array.from(e.currentTarget.querySelectorAll('[role="option"]')),n=a?o.indexOf(a):-1;if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(n+1,o.length-1);o[t]?.focus()}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(n-1,0);o[t]?.focus()}else"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n>=0&&n<t.length&&V(r.field,t[n].value,t[n].selected||!1))},ie=(e,r)=>{const a=P[e.field]||!1,o=r.length>s;return t.createElement(t.Fragment,null,i&&o&&!a&&t.createElement("button",{type:"button",onClick:()=>K(e.field),style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Show more (",r.length-s," more)"),a&&o&&t.createElement("button",{type:"button",onClick:()=>K(e.field),style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Show less"))},le=(e,r)=>{const a=(o=e.field)in P?P[o]:!Z(o);var o;const n=ee(e.items,e.field);P[e.field];const l=P[`_items_${e.field}`]||!1,c=l?n:n.slice(0,s),d=n.length>s;return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium,overflow:"hidden"}},t.createElement("button",{type:"button",className:I(_.collapsibleHeader),onClick:()=>(e=>{D(t=>({...t,[e]:!(t[e]??!Z(e))}))})(e.field),"aria-expanded":a,"aria-controls":`facet-group-${e.field}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:N.spacing.medium,border:"none",backgroundColor:"transparent",cursor:"pointer",textAlign:"left"}},t.createElement("span",{className:_.facetTitle,style:{color:N.colors.text,flex:1}},e.label||e.field),t.createElement("span",{className:I(_.collapsibleIcon)},t.createElement(G,{expanded:a,color:N.colors.textSecondary||N.colors.text}))),a&&t.createElement("div",{id:`facet-group-${e.field}`,style:{padding:`0 ${N.spacing.medium} ${N.spacing.medium}`}},re(e),t.createElement("div",{className:_.facetList,role:"listbox","aria-label":`${e.label||e.field} filters`,tabIndex:0,onKeyDown:t=>se(t,c,e)},c.map((t,r)=>ne(t,e,r))),i&&d&&!l&&t.createElement("button",{type:"button",onClick:()=>D(t=>({...t,[`_items_${e.field}`]:!0})),style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Show more (",n.length-s," more)"),l&&d&&t.createElement("button",{type:"button",onClick:()=>D(t=>({...t,[`_items_${e.field}`]:!1})),style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Show less")))},ce=(e,r)=>{const a=v?.find(t=>t.field===e.field);if(!a)return null;const o=new Map;e.items.forEach(e=>o.set(e.value,e.count));const n=T.find(t=>t.field===e.field&&t.value.startsWith(">=")),s=T.find(t=>t.field===e.field&&t.value.startsWith("<=")),i=n?parseFloat(n.value.slice(2)):void 0,l=s?parseFloat(s.value.slice(2)):void 0,c=e=>{const t=void 0===e.from?void 0===i:i===e.from,r=void 0===e.to?void 0===l:l===e.to;return t&&r},d=void 0!==n||void 0!==s;return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,padding:N.spacing.medium,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium}},t.createElement("h3",{className:_.facetTitle,style:{margin:0,marginBottom:N.spacing.medium,color:N.colors.text}},e.label||e.field),t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:te.gap}},a.ranges.map(r=>{const a=o.get(r.label)??0,n=c(r);return t.createElement("button",{key:r.label,type:"button",className:I(_.rangeButton,n&&_.rangeButtonActive),disabled:0===a&&!n,onClick:()=>(t=>{if(T.filter(t=>t.field===e.field).forEach(t=>A(e.field,t.value,!1)),c(t))return M(e.field,"__noop__",!1),void A(e.field,"__noop__",!0);void 0!==t.from&&M(e.field,`>=${t.from}`,!1),void 0!==t.to?M(e.field,`<=${t.to}`,!0):void 0!==t.from&&M(e.field,`>=${t.from}`,!0)})(r),style:{display:"inline-flex",alignItems:"center",gap:"0.35em",padding:`${te.padding} 0.75em`,fontSize:te.font,border:"1px solid "+(n?"var(--seekora-primary, "+N.colors.primary+")":"var(--seekora-facet-border, "+N.colors.border+")"),borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.full,backgroundColor:n?"var(--seekora-primary, "+N.colors.primary+")":"var(--seekora-facet-bg, "+N.colors.background+")",color:n?"var(--seekora-primary-text, #fff)":N.colors.text,cursor:0!==a||n?"pointer":"not-allowed",opacity:0!==a||n?1:.5,transition:"all 0.2s ease"}},r.label,f&&t.createElement("span",{className:I(_.rangeButtonCount),style:{fontSize:N.typography.fontSize.small,opacity:.8}},"(",a,")"))})),d&&t.createElement("button",{type:"button",className:I(_.rangeClear),onClick:()=>{T.filter(t=>t.field===e.field).forEach(t=>A(e.field,t.value,!1)),M(e.field,"__noop__",!1),A(e.field,"__noop__",!0)},style:{marginTop:te.gap,padding:te.padding,border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Clear"))},de=(e,r)=>{const a=(o=e.field,n=e.stats,v?.some(e=>e.field===o)?"range-buttons":n&&"number"==typeof n.min&&"number"==typeof n.max&&n.min!==n.max?"range-slider":"list");var o,n;if("range-buttons"===a)return ce(e);if("range-slider"===a)return(e=>{if(!e.stats)return null;const{min:r,max:a}=e.stats,o=e.field.toLowerCase(),n=o.includes("price")||o.includes("cost")||o.includes("amount"),s=n?e=>`$${e.toFixed(2)}`:e=>e.toString(),i=n?.01:a-r>10?1:.1,l=T.some(t=>t.field===e.field&&(t.value.startsWith(">=")||t.value.startsWith("<=")));return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,padding:N.spacing.medium,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium}},t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:N.spacing.small}},t.createElement("h3",{className:_.facetTitle,style:{margin:0,color:N.colors.text}},e.label||e.field),l&&t.createElement("button",{type:"button",className:I(_.rangeClear),onClick:()=>{T.filter(t=>t.field===e.field&&(t.value.startsWith(">=")||t.value.startsWith("<="))).forEach(t=>A(e.field,t.value,!1)),M(e.field,"__noop__",!1),A(e.field,"__noop__",!0)},style:{padding:"0.15em 0.5em",border:"none",backgroundColor:"transparent",color:N.colors.primary,cursor:"pointer",fontSize:N.typography.fontSize.small,textDecoration:"underline"}},"Clear")),t.createElement(Q,{field:e.field,min:r,max:a,step:i,formatValue:s,syncWithState:!0}))})(e);switch(m){case"color-swatch":return(e=>{const r=ee(e.items,e.field),a=P[e.field]?r:r.slice(0,s);return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,padding:N.spacing.medium,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium}},t.createElement("h3",{className:_.facetTitle,style:{margin:0,marginBottom:N.spacing.medium,color:N.colors.text}},e.label||e.field),re(e),t.createElement("div",{className:_.facetList,role:"listbox","aria-label":`${e.label||e.field} filters`,tabIndex:0,onKeyDown:t=>se(t,a,e),style:{display:"flex",flexWrap:"wrap",gap:te.gap}},a.map((t,r)=>ne(t,e,r))),ie(e,r))})(e);case"collapsible":return le(e);default:return(e=>{const r=ee(e.items,e.field),a=P[e.field]?r:r.slice(0,s);return t.createElement("div",{key:e.field,className:_.facet,style:{marginBottom:N.spacing.large,padding:N.spacing.medium,backgroundColor:"var(--seekora-facet-bg, "+N.colors.background+")",border:`1px solid var(--seekora-facet-border, ${N.colors.border})`,borderRadius:"string"==typeof N.borderRadius?N.borderRadius:N.borderRadius.medium}},t.createElement("h3",{className:_.facetTitle,style:{margin:0,marginBottom:N.spacing.medium,color:N.colors.text}},e.label||e.field),re(e),t.createElement("div",{className:_.facetList,role:"listbox","aria-label":`${e.label||e.field} filters`,tabIndex:0,onKeyDown:t=>se(t,a,e)},a.map((t,r)=>ne(t,e,r))),ie(e,r))})(e)}};return 0===H.length?(l("Facets: No facets to display",{hasResults:!!W,resultsType:W?typeof W:"null"}),null):t.createElement("div",{className:I(_.container,c),style:{...Y,...d}},H.map((e,t)=>o?o(e,t):de(e)))},e.FederatedDropdown=Pe,e.Fingerprint=v,e.FrequentlyBoughtTogether=({productId:e,items:r,loading:a=!1,title:o="Frequently Bought Together",maxItems:n=4,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u="horizontal",currencySymbol:p="$",showAddAllButton:m=!0,onAddAll:g})=>{const{theme:f}=w(),h=d||{},y=r?.slice(0,n)||[],b=a,v=t.useMemo(()=>y.reduce((e,t)=>{const r=t.price;return e+("number"==typeof r?r:parseFloat(String(r))||0)},0),[y]);return b&&0===y.length||0===y.length?null:t.createElement("div",{className:I(h.root,l),style:c},o&&t.createElement("h3",{className:h.title,style:{margin:`0 0 ${f.spacing.medium} 0`,fontSize:f.typography.fontSize.large,fontWeight:f.typography.fontWeight?.semibold||600,color:f.colors.text}},o),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:f.spacing.medium,flexWrap:"wrap"}},y.map((e,r)=>t.createElement(t.Fragment,{key:e.id||r},r>0&&t.createElement("span",{style:{fontSize:"1.5rem",color:f.colors.textSecondary}},"+"),t.createElement("div",{onClick:()=>i?.(e,r),style:{cursor:i?"pointer":"default",textAlign:"center"}},s?s(e,r):t.createElement(t.Fragment,null,t.createElement("img",{src:e.image||e.imageUrl||"",alt:e.title||e.name||"",style:{width:"80px",height:"80px",objectFit:"cover",borderRadius:"string"==typeof f.borderRadius?f.borderRadius:f.borderRadius.small,border:`1px solid ${f.colors.border}`}}),t.createElement("div",{style:{marginTop:f.spacing.small,fontSize:f.typography.fontSize.small,color:f.colors.text}},p,"number"==typeof e.price?e.price.toFixed(2):e.price))))),m&&y.length>0&&t.createElement("div",{style:{marginLeft:"auto",textAlign:"center"}},t.createElement("div",{style:{fontSize:f.typography.fontSize.large,fontWeight:f.typography.fontWeight?.bold||700,color:f.colors.text,marginBottom:f.spacing.small}},"Total: ",p,v.toFixed(2)),t.createElement("button",{type:"button",onClick:()=>g?.(y),style:{padding:`${f.spacing.small} ${f.spacing.medium}`,fontSize:f.typography.fontSize.medium,fontWeight:f.typography.fontWeight?.medium||500,color:"#ffffff",backgroundColor:f.colors.primary,border:"none",borderRadius:"string"==typeof f.borderRadius?f.borderRadius:f.borderRadius.medium,cursor:"pointer"}},"Add all to cart"))))},e.GoogleDropdown=la,e.HierarchicalMenu=({attributes:e,separator:r=" > ",limit:a=10,showMore:o=!0,showMoreLimit:n=20,renderItem:s,onSelect:i,className:l,style:c,theme:d,rootPath:u=null,sortBy:p="name",items:m})=>{const{theme:g,stateManager:f}=w(),{results:h,refinements:y,addRefinement:b,removeRefinement:v}=S(),k=d||{},[x,E]=t.useState({}),C=t.useCallback(()=>{if(m)return m;if(!h)return[];const t=h.facets||h.facet_counts||{},r=e[0],a=t[r]||{},o=[];return Object.entries(a).forEach(([e,t])=>{const a=y.some(t=>t.field===r&&t.value===e);o.push({label:e,value:e,count:t,isRefined:a,data:R(e,1)})}),o},[h,e,y,m]),R=t.useCallback((t,a)=>{if(a>=e.length)return[];if(!h)return[];const o=h.facets||h.facet_counts||{},n=e[a],s=o[n]||{},i=[];return Object.entries(s).forEach(([e,o])=>{if(e.startsWith(t+r)){const s=e.replace(t+r,"").split(r)[0],l=y.some(t=>t.field===n&&t.value===e);e.replace(t+r,"").includes(r)||i.push({label:s,value:e,count:o,isRefined:l,data:R(e,a+1)})}}),i},[h,e,r,y]),N=t.useMemo(()=>{let e=C();return e=[...e].sort((e,t)=>{if("count"===p)return(t.count||0)-(e.count||0);if("isRefined"===p){if(e.isRefined&&!t.isRefined)return-1;if(!e.isRefined&&t.isRefined)return 1}return e.label.localeCompare(t.label)}),e},[C,p]),z=t.useCallback((t,r)=>{const a=e[r]||e[0];t.isRefined?(e.slice(r).forEach(e=>{y.filter(r=>r.field===e&&r.value.startsWith(t.value)).forEach(e=>v(e.field,e.value,!1))}),f.search()):(y.filter(e=>e.field===a&&e.value!==t.value).forEach(e=>v(e.field,e.value,!1)),b(a,t.value,!0)),i&&i(t.value,r)},[e,y,b,v,f,i]),T=t.useRef(null),M=t.useCallback(()=>T.current?Array.from(T.current.querySelectorAll('[role="treeitem"]')):[],[]),A=t.useCallback(e=>{const t=M();if(0===t.length)return;const r=document.activeElement,a=t.find(e=>e===r||e.contains(r)),o=a?t.indexOf(a):-1;switch(e.key){case"ArrowDown":{e.preventDefault();const r=o<t.length-1?o+1:0,a=t[r].querySelector("button");a?a.focus():t[r].focus();break}case"ArrowUp":{e.preventDefault();const r=o>0?o-1:t.length-1,a=t[r].querySelector("button");a?a.focus():t[r].focus();break}case"ArrowRight":{if(!a)break;const t=a.getAttribute("aria-expanded");if("false"===t){e.preventDefault();const t=a.querySelector("button");t&&t.click()}else if("true"===t){e.preventDefault();const t=a.querySelector('[role="group"]');if(t){const e=t.querySelector('[role="treeitem"]');if(e){const t=e.querySelector("button");t?t.focus():e.focus()}}}break}case"ArrowLeft":if(!a)break;if("true"===a.getAttribute("aria-expanded")){e.preventDefault();const t=a.querySelector("button");t&&t.click()}else{e.preventDefault();const t=a.closest('[role="group"]');if(t){const e=t.closest('[role="treeitem"]');if(e){const t=e.querySelector(":scope > button");t?t.focus():e.focus()}}}break;case"Enter":{if(!a)break;e.preventDefault();const t=a.querySelector("button");t&&t.click();break}}},[M]),_=(e,r)=>{if(!e||0===e.length)return null;const i=x[r]||!1,l=i?n:a,c=e.slice(0,l),d=e.length>l;return t.createElement("ul",{role:0===r?"tree":"group",className:k.list,style:{listStyle:"none",margin:0,padding:r>0?`0 0 0 ${g.spacing.medium}`:0}},c.map((e,a)=>t.createElement("li",{key:e.value,role:"treeitem",...e.data&&e.data.length>0?{"aria-expanded":!!e.isRefined}:{},className:I(k.item,e.isRefined&&k.itemSelected,e.data&&e.data.length>0&&k.itemParent),style:{padding:`${g.spacing.small} 0`}},s?s(e,r):t.createElement(t.Fragment,null,t.createElement("button",{type:"button",onClick:()=>z(e,r),className:k.link,style:{display:"flex",alignItems:"center",gap:g.spacing.small,width:"100%",padding:0,background:"none",border:"none",cursor:"pointer",textAlign:"left",fontFamily:"inherit",fontSize:g.typography.fontSize.small,color:e.isRefined?g.colors.primary:g.colors.text,fontWeight:e.isRefined?600:400}},t.createElement("span",{className:k.label,style:{flex:1}},e.label),void 0!==e.count&&t.createElement("span",{className:k.count,style:{color:g.colors.textSecondary,fontSize:g.typography.fontSize.small}},e.count)),e.isRefined&&e.data&&e.data.length>0&&_(e.data,r+1)))),o&&d&&t.createElement("li",null,t.createElement("button",{type:"button",onClick:()=>(e=>{E(t=>({...t,[e]:!t[e]}))})(r),className:k.showMore,style:{padding:`${g.spacing.small} 0`,background:"none",border:"none",cursor:"pointer",fontSize:g.typography.fontSize.small,color:g.colors.primary,textDecoration:"underline"}},i?"Show less":`Show ${e.length-l} more`)))};return 0===N.length?null:t.createElement("div",{ref:T,className:I(k.root,l),style:c,tabIndex:0,onKeyDown:A},_(N,0))},e.Highlight=({hit:e,attribute:r,className:a,style:o,theme:n,tagName:s="span",renderHighlighted:i,renderNonHighlighted:l,query:c})=>{const{theme:d}=w(),u=n||{},f=t.useMemo(()=>p({hit:e,attribute:r,preTag:"<mark>",postTag:"</mark>"}),[e,r]),h=t.useMemo(()=>{const t=m(f,"<mark>","</mark>");if(t.every(e=>!e.isHighlighted)&&c){const t=e[r]||f;return g(String(t),c)}return t},[f,c,e,r]),y={backgroundColor:d.colors.warning||"#fff59d",fontWeight:d.typography.fontWeight?.semibold||600,padding:"0 2px",borderRadius:"2px"},b=h.map((e,r)=>e.isHighlighted?i?t.createElement(t.Fragment,{key:r},i(e,r)):t.createElement("mark",{key:r,className:u.highlighted,style:y},e.value):l?t.createElement(t.Fragment,{key:r},l(e,r)):t.createElement("span",{key:r,className:u.nonHighlighted},e.value));return t.createElement(s,{className:a||u.root,style:o},b)},e.HitsPerPage=({items:e,onHitsPerPageChange:r,renderSelect:a,className:o,style:n,theme:s,label:i="Show",syncWithState:l=!0})=>{const{theme:c}=w(),{itemsPerPage:d,setPage:u}=S(),{stateManager:p}=w(),m=s||{},g=e.find(e=>e.default)||e[0],[f,h]=t.useState(g?.value||10);t.useEffect(()=>{l&&g&&d!==g.value&&p.setItemsPerPage(g.value,!1)},[]);const y=l?d:f,b=e=>{const t=parseInt(e.target.value,10);h(t),l&&(p.setItemsPerPage(t,!1),u(1,!0)),r&&r(t)};return a?t.createElement("div",{className:I(m.root,o),style:n},a({value:y,onChange:b,items:e})):t.createElement("div",{className:I(m.root,o),style:{display:"flex",alignItems:"center",gap:c.spacing.small,...n}},i&&t.createElement("label",{style:{fontSize:c.typography.fontSize.medium,color:c.colors.text}},i),t.createElement(V,{value:String(y),onChange:e=>{const t=parseInt(e,10);h(t),l&&(p.setItemsPerPage(t,!1),u(1,!0)),r&&r(t)},options:e.map(e=>({value:String(e.value),label:e.label})),"aria-label":"Results per page",className:m.select,style:{"--seekora-select-font-size":c.typography.fontSize.medium,"--seekora-select-border":c.colors.border,"--seekora-select-radius":"string"==typeof c.borderRadius?c.borderRadius:c.borderRadius.medium,"--seekora-select-bg":c.colors.background,"--seekora-select-color":c.colors.text}}))},e.ImageDisplay=kt,e.ImageZoom=bt,e.InfiniteHits=({renderHit:e,renderEmpty:r,renderShowMore:a,showMoreButton:o=!0,useInfiniteScroll:n=!1,scrollThreshold:s=.1,fieldMapping:i,showMoreLabel:l="Show more",onHitClick:c,className:d,style:u,theme:p,syncWithState:m=!0})=>{const{theme:g,stateManager:f}=w(),{results:h,loading:y,currentPage:b,setPage:v}=S(),k=p||{},[x,E]=t.useState([]),[C,R]=t.useState(!1),N=t.useRef(null),z=t.useRef(b),T=t.useCallback(e=>e?e.results?e.results:e.hits?e.hits:Array.isArray(e)?e:[]:[],[]),M=t.useMemo(()=>T(h),[h,T]),A=h?.totalResults||h?.found||0,_=f.getState().itemsPerPage||10,$=Math.ceil(A/_),L=b>=$;t.useEffect(()=>{M.length&&(1===b?E(M):b>z.current&&E(e=>[...e,...M]),z.current=b,R(!1))},[M,b]),t.useEffect(()=>{1===b&&(E(M),z.current=1)},[h]);const P=t.useCallback(()=>{L||y||C||(R(!0),m&&v(b+1))},[L,y,C,m,v,b]);t.useEffect(()=>{if(!n||!N.current)return;const e=new IntersectionObserver(e=>{!e[0].isIntersecting||L||y||C||P()},{threshold:s});return e.observe(N.current),()=>e.disconnect()},[n,s,L,y,C,P]);const D=(e,t)=>{if(!i||!i[t])return e[t]||"";return e[i[t]]||""};return y&&0===x.length?t.createElement("div",{className:I(k.root,d),style:u}):y||0!==x.length?t.createElement("div",{className:I(k.root,d),style:u},t.createElement("div",{className:k.list},x.map((r,a)=>e?e(r,a):((e,r)=>{const a=D(e,"title")||e.title||"",o=D(e,"description")||e.description||"",n=D(e,"image")||e.image||e.imageUrl||"",s=D(e,"price")||e.price;return t.createElement("div",{key:e.id||r,className:k.item,style:{display:"flex",gap:g.spacing.medium,padding:g.spacing.medium,borderBottom:`1px solid ${g.colors.border}`,cursor:c?"pointer":"default",transition:g.transitions?.fast||"150ms ease-in-out"},onClick:()=>c?.(e,r),role:c?"button":void 0,tabIndex:c?0:void 0},n&&t.createElement("img",{src:n,alt:a,style:{width:"80px",height:"80px",objectFit:"cover",borderRadius:"string"==typeof g.borderRadius?g.borderRadius:g.borderRadius.small}}),t.createElement("div",{style:{flex:1}},t.createElement("h3",{style:{margin:0,marginBottom:g.spacing.small,fontSize:g.typography.fontSize.medium,fontWeight:g.typography.fontWeight?.semibold||600,color:g.colors.text}},a),o&&t.createElement("p",{style:{margin:0,fontSize:g.typography.fontSize.small,color:g.colors.textSecondary,lineHeight:g.typography.lineHeight?.normal||1.5}},o),s&&t.createElement("span",{style:{display:"inline-block",marginTop:g.spacing.small,fontSize:g.typography.fontSize.medium,fontWeight:g.typography.fontWeight?.bold||700,color:g.colors.primary}},"$","number"==typeof s?s.toFixed(2):s)))})(r,a))),o&&!n&&!L&&(a?a({isLoading:C,isLastPage:L,onClick:P}):t.createElement("button",{type:"button",onClick:P,disabled:L||C,className:I(k.loadMore,(L||C)&&k.loadMoreDisabled),style:{display:"block",width:"100%",padding:g.spacing.medium,marginTop:g.spacing.medium,fontSize:g.typography.fontSize.medium,fontWeight:g.typography.fontWeight?.medium||500,backgroundColor:L||C?g.colors.hover:g.colors.primary,color:L||C?g.colors.textSecondary:"#ffffff",border:"none",borderRadius:"string"==typeof g.borderRadius?g.borderRadius:g.borderRadius.medium,cursor:L||C?"not-allowed":"pointer",transition:g.transitions?.fast||"150ms ease-in-out"}},L?"No more results":l)),n&&!L&&t.createElement("div",{ref:N,className:k.sentinel,style:{height:"1px",visibility:"hidden"},"aria-hidden":"true"})):t.createElement("div",{className:I(k.root,d),style:u},r?r():t.createElement("div",{className:k.empty,style:{padding:g.spacing.large,textAlign:"center",color:g.colors.textSecondary}},"No results found"))},e.ItemCard=_t,e.ItemGrid=Lt,e.MinimalDropdown=Na,e.MobileFilters=({isOpen:e,onClose:r,onApply:a,title:o="Filters",applyButtonText:n="Apply",clearButtonText:s="Clear all",position:i="right",children:l,className:c,theme:d,showHeader:u=!0,showFooter:p=!0,showFilterCount:m=!0,closeOnBackdropClick:g=!0,closeOnEscape:f=!0})=>{const{theme:h}=w(),{refinements:y,clearRefinements:b}=S(),v=d||{},k=t.useRef(null);t.useEffect(()=>(document.body.style.overflow=e?"hidden":"",()=>{document.body.style.overflow=""}),[e]),t.useEffect(()=>{if(!f)return;const t=t=>{"Escape"===t.key&&e&&r()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,r,f]),t.useEffect(()=>{if(e&&k.current){const e=k.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),t=e[0],r=e[e.length-1],a=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===t&&(e.preventDefault(),r?.focus()):document.activeElement===r&&(e.preventDefault(),t?.focus()))};return document.addEventListener("keydown",a),t?.focus(),()=>document.removeEventListener("keydown",a)}},[e]);const x=t.useCallback(()=>{g&&r()},[g,r]),E=t.useCallback(()=>{a&&a(),r()},[a,r]),C=t.useCallback(()=>{b(!0)},[b]),R=e=>{if(e)return"translate(0, 0)";switch(i){case"left":return"translateX(-100%)";case"right":default:return"translateX(100%)";case"bottom":return"translateY(100%)"}};return e?t.createElement(t.Fragment,null,t.createElement("div",{className:v.overlay,onClick:x,style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:h.zIndex?.modal||1050,opacity:e?1:0,transition:"opacity 300ms ease-in-out"},"aria-hidden":"true"}),t.createElement("div",{ref:k,className:I(v.drawer,c),style:(()=>{const t={position:"fixed",backgroundColor:h.colors.background,display:"flex",flexDirection:"column",transition:"transform 300ms ease-in-out",transform:R(e),zIndex:(h.zIndex?.modal||1050)+1};switch(i){case"left":return{...t,top:0,left:0,bottom:0,width:"80%",maxWidth:"320px"};case"right":return{...t,top:0,right:0,bottom:0,width:"80%",maxWidth:"320px"};case"bottom":return{...t,left:0,right:0,bottom:0,maxHeight:"80vh",borderTopLeftRadius:"16px",borderTopRightRadius:"16px"};default:return t}})(),role:"dialog","aria-modal":"true","aria-label":o},u&&t.createElement("div",{className:v.header,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:h.spacing.medium,borderBottom:`1px solid ${h.colors.border}`}},t.createElement("div",{style:{display:"flex",alignItems:"center",gap:h.spacing.small}},t.createElement("h2",{className:v.title,style:{margin:0,fontSize:h.typography.fontSize.large,fontWeight:h.typography.fontWeight?.semibold||600,color:h.colors.text}},o),m&&y.length>0&&t.createElement("span",{className:v.filterCount,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"24px",height:"24px",padding:"0 6px",fontSize:h.typography.fontSize.small,fontWeight:h.typography.fontWeight?.bold||700,color:"#ffffff",backgroundColor:h.colors.primary,borderRadius:"12px"}},y.length)),t.createElement("button",{type:"button",onClick:r,className:v.closeButton,style:{padding:h.spacing.small,background:"none",border:"none",cursor:"pointer",fontSize:"1.5rem",color:h.colors.text},"aria-label":"Close filters"},"×")),t.createElement("div",{className:v.content,style:{flex:1,overflow:"auto",padding:h.spacing.medium}},l),p&&t.createElement("div",{className:v.footer,style:{display:"flex",gap:h.spacing.small,padding:h.spacing.medium,borderTop:`1px solid ${h.colors.border}`}},t.createElement("button",{type:"button",onClick:C,className:v.clearButton,style:{flex:1,padding:h.spacing.medium,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.medium||500,color:h.colors.text,backgroundColor:"transparent",border:`1px solid ${h.colors.border}`,borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:"pointer"}},s),t.createElement("button",{type:"button",onClick:E,className:v.applyButton,style:{flex:2,padding:h.spacing.medium,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.medium||500,color:"#ffffff",backgroundColor:h.colors.primary,border:"none",borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:"pointer"}},n,m&&y.length>0&&` (${y.length})`)))):null},e.MobileFiltersButton=({onClick:e,text:r="Filters",showCount:a=!0,className:o,style:n})=>{const{theme:s}=w(),{refinements:i}=S();return t.createElement("button",{type:"button",onClick:e,className:o,style:{display:"inline-flex",alignItems:"center",gap:s.spacing.small,padding:`${s.spacing.small} ${s.spacing.medium}`,fontSize:s.typography.fontSize.medium,fontWeight:s.typography.fontWeight?.medium||500,color:s.colors.text,backgroundColor:s.colors.background,border:`1px solid ${s.colors.border}`,borderRadius:"string"==typeof s.borderRadius?s.borderRadius:s.borderRadius.medium,cursor:"pointer",...n}},t.createElement("span",null,"☰"),t.createElement("span",null,r),a&&i.length>0&&t.createElement("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 4px",fontSize:s.typography.fontSize.small,fontWeight:s.typography.fontWeight?.bold||700,color:"#ffffff",backgroundColor:s.colors.primary,borderRadius:"10px"}},i.length))},e.MobileSheetDropdown=Ia,e.Pagination=({results:e,currentPage:r,itemsPerPage:a,totalPages:o,onPageChange:n,maxPages:s=7,showFirstLast:i=!0,showPrevNext:l=!0,renderPageButton:c,className:d,style:u,theme:p,variant:m="numbered",loadMoreText:g="Load More",size:f="medium",showPageInfo:h,previousLabel:y="Previous",nextLabel:b="Next"})=>{const{theme:v}=w(),{results:k,currentPage:x,setPage:E}=S(),C=p||{},R=W(),N=R?Math.min(s,5):s,z=r||x,T=e||k,M=a||T?.perPage||T?.data?.per_page||T?.data?.data?.per_page||20,A=T?.totalResults||T?.data?.total_results||T?.data?.data?.total_results||0,_=o||T?.totalPages||T?.data?.total_pages||T?.data?.data?.total_pages||Math.ceil(A/M),$=void 0!==h?h:"simple"===m,L=((e,t)=>t?{small:{paddingKey:"small",fontSizeKey:"small",minWidth:"40px",minHeight:"40px"},medium:{paddingKey:"small",fontSizeKey:"medium",minWidth:"44px",minHeight:"44px"},large:{paddingKey:"medium",fontSizeKey:"large",minWidth:"48px",minHeight:"48px"}}[e]:{small:{paddingKey:"small",fontSizeKey:"small",minWidth:"32px",minHeight:"32px"},medium:{paddingKey:"small",fontSizeKey:"medium",minWidth:"40px",minHeight:"40px"},large:{paddingKey:"medium",fontSizeKey:"large",minWidth:"48px",minHeight:"48px"}}[e])(f,R),P="var(--seekora-pagination-bg, "+v.colors.background+")",D="var(--seekora-pagination-color, "+v.colors.text+")",F="var(--seekora-pagination-active-bg, "+v.colors.primary+")",B="var(--seekora-pagination-active-color, #fff)",q="var(--seekora-pagination-border, "+v.colors.border+")",H="var(--seekora-pagination-radius, "+("string"==typeof v.borderRadius?v.borderRadius:v.borderRadius.medium)+")",O=e=>{e<1||e>_||e===z||(E(e),n&&n(e))};if(_<=1&&"load-more"!==m)return null;if("load-more"===m&&z>=_)return null;const j=$?t.createElement("span",{className:I(C.pageInfo),style:{fontSize:v.typography.fontSize[L.fontSizeKey],color:D,padding:`0 ${v.spacing.small}`,whiteSpace:"nowrap"},"aria-live":"polite"},"Page ",z," of ",_):null;if("load-more"===m){const e=Math.max(0,A-z*M);return t.createElement("nav",{className:I(C.container,d),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:v.spacing.small,...u},"aria-label":"Pagination"},t.createElement("button",{type:"button",onClick:()=>O(z+1),className:I(C.loadMoreButton),style:{padding:`${v.spacing[L.paddingKey]} ${v.spacing.large}`,border:"none",borderRadius:H,backgroundColor:F,color:B,cursor:"pointer",fontSize:v.typography.fontSize[L.fontSizeKey],fontWeight:v.typography.fontWeight?.medium??500,transition:v.transitions?.fast??"150ms ease-in-out",minWidth:L.minWidth},"aria-label":e>0?`${g} (${e} remaining)`:g},g,e>0&&t.createElement("span",{className:I(C.loadMoreText),style:{marginLeft:v.spacing.small,opacity:.85,fontSize:v.typography.fontSize.small}},"(",e," remaining)")),j)}if("simple"===m)return t.createElement("nav",{className:I(C.container,C.simpleContainer,d),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:v.spacing.medium,...u},"aria-label":"Pagination"},t.createElement("button",{type:"button",disabled:1===z,onClick:()=>O(z-1),className:I(C.simpleButton,1===z&&C.itemDisabled),style:{padding:`${v.spacing[L.paddingKey]} ${v.spacing.medium}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:P,color:D,cursor:1===z?"not-allowed":"pointer",opacity:1===z?.5:1,fontSize:v.typography.fontSize[L.fontSizeKey],minWidth:L.minWidth,transition:v.transitions?.fast??"150ms ease-in-out"},"aria-label":"Previous page"},y),t.createElement("span",{className:I(C.simpleText,C.pageInfo),style:{fontSize:v.typography.fontSize[L.fontSizeKey],color:D,whiteSpace:"nowrap"},"aria-live":"polite"},"Page ",z," of ",_),t.createElement("button",{type:"button",disabled:z===_,onClick:()=>O(z+1),className:I(C.simpleButton,z===_&&C.itemDisabled),style:{padding:`${v.spacing[L.paddingKey]} ${v.spacing.medium}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:P,color:D,cursor:z===_?"not-allowed":"pointer",opacity:z===_?.5:1,fontSize:v.typography.fontSize[L.fontSizeKey],minWidth:L.minWidth,transition:v.transitions?.fast??"150ms ease-in-out"},"aria-label":"Next page"},b));const V=(()=>{const e=[],t=Math.floor(N/2);let r=Math.max(1,z-t),a=Math.min(_,z+t);z<=t&&(a=Math.min(N,_)),z>=_-t&&(r=Math.max(1,_-N+1)),i&&r>1&&(e.push(1),r>2&&e.push("ellipsis"));for(let t=r;t<=a;t++)e.push(t);return i&&a<_&&(a<_-1&&e.push("ellipsis"),e.push(_)),e})();return t.createElement("nav",{className:I(C.container,d),style:u,"aria-label":"Pagination"},t.createElement("ul",{className:C.list,style:{listStyle:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,flexWrap:"wrap"},tabIndex:0,onKeyDown:e=>{"ArrowLeft"===e.key?(e.preventDefault(),O(z-1)):"ArrowRight"===e.key?(e.preventDefault(),O(z+1)):"Home"===e.key?(e.preventDefault(),O(1)):"End"===e.key&&(e.preventDefault(),O(_))}},l&&t.createElement("li",null,t.createElement("button",{type:"button",disabled:1===z,onClick:()=>O(z-1),className:I(C.item,1===z&&C.itemDisabled),style:{padding:v.spacing[L.paddingKey],margin:`0 ${v.spacing.small}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:P,color:D,cursor:1===z?"not-allowed":"pointer",opacity:1===z?.5:1,fontSize:v.typography.fontSize[L.fontSizeKey]},"aria-label":"Previous page"},y)),V.map((e,r)=>{if("ellipsis"===e)return t.createElement("li",{key:`ellipsis-${r}`},t.createElement("span",{className:C.ellipsis,style:{padding:v.spacing[L.paddingKey],margin:`0 ${v.spacing.small}`,color:D,fontSize:v.typography.fontSize[L.fontSizeKey]}},"..."));const a=e===z,o=!1;return t.createElement("li",{key:e},c?c(e,a,o):((e,r,a)=>t.createElement("button",{type:"button",disabled:a,onClick:()=>O(e),"aria-current":r?"page":void 0,"aria-label":`Page ${e}`,className:I(C.item,r&&C.itemActive,a),style:{padding:v.spacing[L.paddingKey],margin:R?"0 4px":`0 ${v.spacing.small}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:r?F:P,color:r?B:D,cursor:"pointer",opacity:1,fontSize:v.typography.fontSize[L.fontSizeKey],minWidth:L.minWidth,minHeight:L.minHeight,display:"inline-flex",alignItems:"center",justifyContent:"center",...r&&{fontWeight:"bold"}}},e))(e,a,o))}),l&&t.createElement("li",null,t.createElement("button",{type:"button",disabled:z===_,onClick:()=>O(z+1),className:I(C.item,z===_&&C.itemDisabled),style:{padding:v.spacing[L.paddingKey],margin:`0 ${v.spacing.small}`,border:`1px solid ${q}`,borderRadius:H,backgroundColor:P,color:D,cursor:z===_?"not-allowed":"pointer",opacity:z===_?.5:1,fontSize:v.typography.fontSize[L.fontSizeKey]},"aria-label":"Next page"},b)),$&&t.createElement("li",{style:{marginLeft:v.spacing.small}},j)))},e.PinterestDropdown=ma,e.PriceDisplay=or,e.ProductCard=Nr,e.ProductGallery=function({images:e,variant:r="thumbStrip",alt:a="Product",className:o,style:n,carouselAutoplay:s,carouselIntervalMs:i,enableZoom:l,zoomMode:c,zoomLevel:d}){return t.createElement("div",{className:I("seekora-product-gallery",o),style:n},t.createElement(kt,{images:e,variant:r,alt:a,carouselAutoplay:s,carouselIntervalMs:i,enableZoom:l,zoomMode:c,zoomLevel:d}))},e.ProductGrid=zr,e.ProductInfo=function({title:e,description:r,price:a,currency:o="$",comparePrice:n,brand:s,available:i,badges:l,options:c,variants:d,selectedVariant:u,selections:p,onSelectionChange:m,renderVariantSelector:g,renderCTA:f,className:h,style:y}){const b=null!=a?"number"==typeof a?a:parseFloat(String(a)):null,v=null!=n?"number"==typeof n?n:parseFloat(String(n)):null,k=!g&&c&&c.length>0&&d&&p&&m;return t.createElement("div",{className:I("seekora-product-info",h),style:{display:"flex",flexDirection:"column",gap:12,...y}},l&&l.length>0&&t.createElement(dr,{badges:l,position:"inline"}),s&&t.createElement("span",{className:"seekora-product-info-brand",style:{fontSize:"0.8125rem",color:"var(--seekora-text-secondary)",textTransform:"uppercase",letterSpacing:"0.02em"}},s),t.createElement("h1",{className:"seekora-product-info-title",style:{fontSize:"1.25rem",fontWeight:600,margin:0}},e),null!=b&&!Number.isNaN(b)&&t.createElement("div",{className:"seekora-product-info-price"},t.createElement(or,{price:b,comparePrice:v??void 0,currency:o,style:{fontSize:"1.125rem"}})),null!=i&&t.createElement("span",{className:"seekora-product-info-availability",style:{fontSize:"0.875rem",color:i?"var(--seekora-success, #22c55e)":"var(--seekora-error, #ef4444)"}},i?"In Stock":"Out of Stock"),r?t.createElement("p",{className:"seekora-product-info-description",style:{fontSize:"0.875rem",color:"var(--seekora-text-secondary)",margin:0,lineHeight:1.5}},r):null,g?g():null,k&&t.createElement(Wr,{options:c,variants:d,selections:p,onSelectionChange:m,showAvailability:!0}),f?.())},e.ProductRecommendations=function({title:e="You may also like",items:r,onItemClick:a,maxItems:o=6,columns:n=3,className:s,style:i,renderItem:l}){return r?.length?t.createElement("div",{className:I("seekora-product-recommendations",s),style:i},t.createElement("h2",{className:"seekora-product-recommendations-title",style:{fontSize:"1rem",fontWeight:600,marginBottom:12}},e),t.createElement(Lt,{items:r,maxItems:o,columns:n,onItemClick:a,renderItem:l})):null},e.QuerySuggestions=({query:e="",maxSuggestions:r=10,debounceMs:a=300,minQueryLength:o=2,onSuggestionClick:n,renderSuggestion:s,renderEmpty:i,showTitle:l=!1,title:c="Suggestions",className:d,style:u,theme:p})=>{const{client:m,theme:g}=w(),[f,h]=t.useState(-1),{suggestions:y,loading:b,error:v}=C({client:m,query:e,enabled:e.length>=o,debounceMs:a,maxSuggestions:r}),k=y.slice(0,r),x=p||{};if(e.length<o)return null;if(v||!b&&0===k.length)return t.createElement("div",{className:I(x.container,d),style:u},l&&t.createElement("div",{className:x.title,style:{fontSize:g.typography.fontSize.large,fontWeight:"bold",marginBottom:g.spacing.medium,color:g.colors.text}},c),i?i():t.createElement("div",{style:{padding:g.spacing.medium,textAlign:"center",color:g.colors.text,opacity:.6}},"No suggestions available"));const E=s||((e,r)=>t.createElement("div",{key:r},t.createElement("span",null,e.query),void 0!==e.count&&t.createElement("span",{style:{opacity:.6,marginLeft:g.spacing.small}},"(",e.count,")")));return t.createElement("div",{className:I(x.container,d),style:u},l&&t.createElement("div",{className:x.title,style:{fontSize:g.typography.fontSize.large,fontWeight:"bold",marginBottom:g.spacing.medium,color:g.colors.text}},c),t.createElement("div",{className:x.suggestionsList},k.map((e,r)=>{const a=r===f;return t.createElement("div",{key:r,className:I(x.suggestionItem,a&&x.suggestionItemActive),onClick:()=>(e=>{n&&n(e.query)})(e),onMouseEnter:()=>h(r),onMouseLeave:()=>h(-1),style:{padding:g.spacing.medium,cursor:"pointer",borderRadius:"string"==typeof g.borderRadius?g.borderRadius:g.borderRadius.medium,transition:"background-color 0.2s ease",backgroundColor:a?g.colors.hover:"transparent",marginBottom:r<k.length-1?g.spacing.small:0}},E(e,r))})))},e.QuerySuggestionsDropdown=ye,e.RangeInput=({field:e,label:r,min:a,max:o,currentMin:n,currentMax:s,step:i=1,onRangeChange:l,renderRangeInput:c,className:d,style:u,theme:p,showApplyButton:m=!0,placeholder:g={min:"Min",max:"Max"},syncWithState:f=!0})=>{const{theme:h}=w(),{refinements:y,addRefinement:b,removeRefinement:v}=S(),k=p||{},x=f?((e,t)=>{let r,a;return e.forEach(e=>{if(e.field===t){const t=e.value.match(/^>=(\d+(?:\.\d+)?)$/);t&&(r=parseFloat(t[1]));const o=e.value.match(/^<=(\d+(?:\.\d+)?)$/);o&&(a=parseFloat(o[1]))}}),{min:r,max:a}})(y,e):{min:void 0,max:void 0},[E,C]=t.useState(n??x.min),[R,N]=t.useState(s??x.max),[z,T]=t.useState(n??x.min),[M,A]=t.useState(s??x.max);t.useEffect(()=>{f&&(x.min===z&&x.max===M||(C(x.min),N(x.max),T(x.min),A(x.max)))},[f,x.min,x.max]);const _=void 0!==n?n:E,$=void 0!==s?s:R,L=t.useCallback((t,r)=>{f&&(y.forEach(t=>{t.field===e&&v(e,t.value,!1)}),void 0!==t&&b(e,`>=${t}`,!1),void 0!==r?b(e,`<=${r}`,!0):void 0!==t&&b(e,`>=${t}`,!0))},[f,e,y,b,v]),P=t.useCallback(e=>{const t=""===e.target.value?void 0:parseFloat(e.target.value);C(t),m||(L(t,$),l&&l(t,$))},[$,m,l,L]),D=t.useCallback(e=>{const t=""===e.target.value?void 0:parseFloat(e.target.value);N(t),m||(L(_,t),l&&l(_,t))},[_,m,l,L]),F=t.useCallback(()=>{T(E),A(R),L(E,R),l&&l(E,R)},[E,R,l,L]),B=t.useCallback(()=>{C(void 0),N(void 0),T(void 0),A(void 0),f&&y.forEach(t=>{t.field===e&&v(e,t.value,!0)}),l&&l(void 0,void 0)},[f,e,y,v,l]);return c?t.createElement("div",{className:I(k.container,d),style:u},c({min:_,max:$,onMinChange:e=>{C(e),!m&&l&&l(e,$)},onMaxChange:e=>{N(e),!m&&l&&l(_,e)},onApply:F})):t.createElement("div",{className:I(k.container,d),style:u},r&&t.createElement("label",{className:k.label,style:{display:"block",fontSize:h.typography.fontSize.medium,fontWeight:"bold",marginBottom:h.spacing.small,color:h.colors.text}},r),t.createElement("div",{className:k.inputGroup,style:{display:"flex",alignItems:"center",gap:h.spacing.small}},t.createElement("input",{type:"number",min:a,max:o,step:i,value:void 0!==_?_:"",onChange:P,placeholder:g.min,className:I(k.input),style:{flex:1,padding:h.spacing.small,fontSize:h.typography.fontSize.medium,backgroundColor:h.colors.background,color:h.colors.text,border:`1px solid ${h.colors.border}`,borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,outline:"none"}}),t.createElement("span",{className:k.separator,style:{color:h.colors.text,opacity:.7}},"to"),t.createElement("input",{type:"number",min:a,max:o,step:i,value:void 0!==$?$:"",onChange:D,placeholder:g.max,className:I(k.input),style:{flex:1,padding:h.spacing.small,fontSize:h.typography.fontSize.medium,backgroundColor:h.colors.background,color:h.colors.text,border:`1px solid ${h.colors.border}`,borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,outline:"none"}}),m&&t.createElement("button",{type:"button",onClick:F,className:k.button,style:{padding:`${h.spacing.small} ${h.spacing.medium}`,backgroundColor:h.colors.primary,color:"#fff",border:"none",borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:"pointer",fontSize:h.typography.fontSize.small,fontWeight:"500"}},"Apply"),(void 0!==z||void 0!==M||void 0!==_||void 0!==$)&&t.createElement("button",{type:"button",onClick:B,style:{padding:`${h.spacing.small} ${h.spacing.medium}`,backgroundColor:"transparent",color:h.colors.text,border:`1px solid ${h.colors.border}`,borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:"pointer",fontSize:h.typography.fontSize.small}},"Reset")))},e.RangeSlider=Q,e.RatingDisplay=gr,e.RecentSearchesList=_r,e.RecentlyViewed=({storageKey:e="seekora_recently_viewed",items:r,title:a="Recently Viewed",maxItems:o=6,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d="horizontal",currencySymbol:u="$"})=>{const[p,m]=t.useState([]);t.useEffect(()=>{if(!r)try{const t=localStorage.getItem(e);t&&m(JSON.parse(t))}catch(e){}},[e,r]);const g=(r||p).slice(0,o);return 0===g.length?null:t.createElement(te,{title:a,items:g,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d,currencySymbol:u})},e.RelatedProducts=({productId:e,items:r,loading:a=!1,title:o="Related Products",maxItems:n=6,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u="horizontal",currencySymbol:p="$"})=>{const{theme:m}=w(),g=r?.slice(0,n)||[];return a&&0===g.length||0===g.length?null:t.createElement(te,{title:o,items:g,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u,currencySymbol:p})},e.RichQuerySuggestions=Ie,e.SearchBar=({placeholder:e="Powered by Seekora",showSuggestions:r=!0,debounceMs:a=300,minQueryLength:o=2,maxSuggestions:n=10,onSearch:s,onQueryChange:i,onSuggestionSelect:d,onSearchStateChange:u,searchOptions:p,className:m,style:g,theme:f,renderSuggestion:h,renderSearchIcon:y,showClearButton:b=!0,renderClearIcon:v,showSubmitButton:k=!1,renderSubmitButton:x,size:E="medium",searchAsYouType:R=!1})=>{const{client:A,theme:_,enableAnalytics:$,autoTrackSearch:L}=w(),{query:P,setQuery:D,search:F,results:B,loading:W,error:q}=S(),[H,O]=t.useState(!1),[j,V]=t.useState(-1),U=t.useRef(null),K=t.useRef(null),Q=t.useRef(!1),G=t.useRef(null);t.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]);const{suggestions:X,loading:Y}=C({client:A,query:P,enabled:r&&P.length>=o,debounceMs:a,maxSuggestions:n}),Z=X.slice(0,n);t.useEffect(()=>{u&&u({results:B,loading:W,error:q})},[B,W,q,u]),t.useEffect(()=>{B&&s&&s(P,B)},[B,P,s]),t.useEffect(()=>{i&&i(P)},[P,i]);const J=t.useCallback(async e=>{G.current&&(clearTimeout(G.current),G.current=null);const t=e.trim();c("SearchBar: Triggering search",{query:t,originalQuery:e,isEmpty:!t}),Q.current=!0,O(!1),V(-1),D(t,!1),c("SearchBar: Calling search() directly"),await F(),setTimeout(()=>{U.current?.blur(),setTimeout(()=>{Q.current=!1},50)},100)},[D,F]),ee=t.useCallback(e=>{l("SearchBar: Suggestion selected",{suggestion:e}),V(-1),O(!1),U.current?.blur(),d&&d(e),D(e)},[d,D]),te=t.useCallback(e=>{const t=e.target.value;D(t,!1),V(-1),R&&(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{G.current=null,F()},a))},[D,R,a,F]),re=t.useCallback(e=>{switch(e.key){case"ArrowDown":r&&Z.length>0&&(e.preventDefault(),V(e=>e<Z.length-1?e+1:e));break;case"ArrowUp":r&&Z.length>0&&(e.preventDefault(),V(e=>e>0?e-1:-1));break;case"Enter":if(e.preventDefault(),e.stopPropagation(),r&&Z.length>0&&j>=0&&j<Z.length)ee(Z[j].query);else{const e=U.current?.value||P;J(e)}break;case"Escape":O(!1),U.current?.blur()}},[Z,j,P,r,J,ee]),ae=t.useCallback(()=>{O(!0)},[]),oe=t.useCallback(e=>{Q.current||setTimeout(()=>{K.current?.contains(document.activeElement)||(O(!1),V(-1))},200)},[]),ne=(e,r)=>t.createElement("div",{key:r},e),se=f||{},ie=Y||W,le=Z.length>0,ce=H&&r&&P.length>=o&&le,de=B,ue=de?.processingTimeMS||de?.data?.processingTimeMS||de?.data?.data?.processingTimeMS,pe=z[E],me=b&&P.length>0,ge=pe.iconPaddingLeft,fe=me?pe.iconPaddingRight:pe.padding.split(" ")[1]||pe.padding,he="string"==typeof _.borderRadius?_.borderRadius:_.borderRadius.medium,ye=H?`var(--seekora-border-focus, ${_.colors.focus})`:`var(--seekora-border, ${_.colors.border})`,be=H?`0 0 0 3px var(--seekora-border-focus-alpha, ${_.colors.focus}33)`:void 0,ve=t.useCallback(()=>{G.current&&(clearTimeout(G.current),G.current=null),D("",!1),V(-1),U.current?.focus(),R&&F()},[D,R,F]),ke=t.useCallback(()=>{const e=U.current?.value||P;J(e)},[P,J]);return t.createElement("div",{ref:K,className:I(se.container,m),style:{position:"relative",display:"flex",alignItems:"center","--seekora-searchbar-bg":_.colors.background,"--seekora-searchbar-border":_.colors.border,"--seekora-searchbar-focus-border":_.colors.focus,"--seekora-searchbar-radius":he,"--seekora-searchbar-icon-color":_.colors.textSecondary,...g}},t.createElement("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center"}},t.createElement("span",{className:se.searchIcon,"aria-hidden":"true",style:{position:"absolute",left:pe.iconLeft,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"var(--seekora-searchbar-icon-color)",zIndex:2}},y?y():t.createElement(T,{size:pe.iconSize})),t.createElement("input",{ref:U,type:"text",value:P,onChange:te,onKeyDown:re,onFocus:ae,onBlur:oe,placeholder:e,className:I(se.input,H&&se.inputFocused),style:{width:"100%",paddingTop:pe.padding.split(" ")[0],paddingBottom:pe.padding.split(" ")[0],paddingLeft:ge,paddingRight:fe,fontSize:pe.fontSize,fontFamily:_.typography.fontFamily,backgroundColor:"var(--seekora-searchbar-bg)",color:_.colors.text,borderWidth:"1px",borderStyle:"solid",borderColor:ye,borderRadius:"var(--seekora-searchbar-radius)",outline:"none",boxShadow:be,transition:_.transitions?.fast||"150ms ease-in-out",boxSizing:"border-box"}}),me&&t.createElement("button",{type:"button",onClick:ve,className:se.clearButton,"aria-label":"Clear search",style:{position:"absolute",right:pe.iconRight,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:"2px",borderRadius:"50%",color:"var(--seekora-searchbar-icon-color)",transition:_.transitions?.fast||"150ms ease-in-out",zIndex:2},onMouseDown:e=>{e.preventDefault()}},v?v():t.createElement(M,{size:pe.iconSize-4}))),k&&(x?t.createElement("div",{onClick:ke,style:{marginLeft:_.spacing.small,cursor:"pointer"}},x()):t.createElement("button",{type:"button",onClick:ke,className:se.submitButton,style:{marginLeft:_.spacing.small,padding:pe.padding,fontSize:pe.fontSize,fontFamily:_.typography.fontFamily,fontWeight:_.typography.fontWeight?.medium??500,backgroundColor:`var(--seekora-primary, ${_.colors.primary})`,color:"var(--seekora-primary-text, #ffffff)",border:"none",borderRadius:"var(--seekora-searchbar-radius)",cursor:"pointer",whiteSpace:"nowrap",transition:_.transitions?.fast||"150ms ease-in-out"}},"Search")),void 0!==ue&&t.createElement("span",{style:{marginLeft:_.spacing.small,fontSize:_.typography.fontSize.small,color:_.colors.text,opacity:.7,whiteSpace:"nowrap"}},ue,"ms"),ce&&t.createElement("div",{className:se.suggestionsContainer,style:{position:"absolute",top:"100%",left:0,right:0,marginTop:_.spacing.small,backgroundColor:_.colors.background,border:`1px solid ${_.colors.border}`,borderRadius:"string"==typeof _.borderRadius?_.borderRadius:_.borderRadius.medium,boxShadow:_.shadows.medium,maxHeight:"400px",overflowY:"auto",zIndex:N,boxSizing:"border-box"}},Z.length>0&&t.createElement(t.Fragment,null,Z.map((e,r)=>{const a=r===j,o=h||ne;return t.createElement("div",{key:r,className:I(se.suggestionItem,a&&se.suggestionItemActive),onClick:()=>ee(e.query),onMouseEnter:()=>V(r),style:{padding:_.spacing.medium,cursor:"pointer",backgroundColor:a?_.colors.hover:"transparent",color:_.colors.text,transition:_.transitions?.fast||"150ms ease-in-out"}},o(e.query,r))})),!ie&&0===Z.length&&P.length>=o&&t.createElement("div",{style:{padding:_.spacing.medium,textAlign:"center",color:_.colors.textSecondary}},"No suggestions found")))},e.SearchBarWithSuggestions=Ze,e.SearchInput=it,e.SearchLayout=({sidebar:e,children:r,header:a,footer:o,sidebarWidth:n="300px",className:s,style:i,theme:l,showSidebarOnMobile:c=!1})=>{const{theme:d}=w(),u=l||{},p=W(),m=j(parseInt(d.spacing.medium)||16),g=O(parseInt(d.spacing.large)||24);return t.createElement("div",{className:I(u.container,s),style:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%",maxWidth:"100%",backgroundColor:d.colors.background,...i}},a&&t.createElement("header",{className:u.header,style:{padding:m,borderBottom:`1px solid ${d.colors.border}`,backgroundColor:d.colors.background}},a),t.createElement("div",{style:{display:"flex",flex:1,width:"100%",maxWidth:"100%",flexDirection:p?"column":"row",gap:g,padding:m,backgroundColor:d.colors.background,color:d.colors.text,overflow:"visible"}},e&&(!p||c)&&t.createElement("aside",{className:u.sidebar,style:{width:p?"100%":n,minWidth:p?"100%":n,flexShrink:0}},e),t.createElement("main",{className:u.main,style:{flex:1,minWidth:0,width:"100%",maxWidth:"100%",backgroundColor:d.colors.background,color:d.colors.text,overflow:"auto"}},r)),o&&t.createElement("footer",{className:u.footer,style:{padding:m,borderTop:`1px solid ${d.colors.border}`,backgroundColor:d.colors.background}},o))},e.SearchProvider=({client:e,theme:r,enableAnalytics:a=!0,autoTrackSearch:o=!0,stateManager:n,children:s,abTestId:i,abVariant:l,experiments:c})=>{const d=t.useMemo(()=>r?x(r):k,[r]),u=t.useMemo(()=>new f({client:e,autoSearch:!0,debounceMs:300,itemsPerPage:10,defaultSearchOptions:{widget_mode:!0},...n,abTestId:i,abVariant:l}),[e,n,i,l]);t.useEffect(()=>{void 0===i&&void 0===l||(u.setAbTest(i,l),e.setAbTest(i,l))},[u,e,i,l]);const p=t.useMemo(()=>({client:e,theme:d,enableAnalytics:a,autoTrackSearch:o,stateManager:u}),[e,d,a,o,u]);return t.createElement(E.Provider,{value:p},s)},e.SearchResults=({results:e,loading:r,error:a,onResultClick:o,renderResult:n,renderEmpty:s,renderError:i,className:c,style:p,theme:m,itemsPerPage:g=20,showPagination:f=!1,viewMode:h="list",fieldMapping:y,extractResults:b,enableKeyboardNavigation:v=!0,autoFocus:k=!1,minHeight:x="400px",minWidth:E="100%"})=>{const{theme:C,client:R,enableAnalytics:N}=w(),{results:z,loading:T,error:M,currentPage:A,itemsPerPage:_}=S(),$=m||{},[L,P]=t.useState(-1),D=t.useRef(null),F=void 0!==e?e:z,B=void 0!==r?r:T,W=void 0!==a?a:M;t.useEffect(()=>{P(-1)},[F]),t.useEffect(()=>{if(L>=0&&D.current&&v){const e=D.current.querySelector(`[data-result-index="${L}"]`);e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[L,v]),t.useEffect(()=>{if(!v)return;const e=e=>{if(!D.current)return;if(D.current.querySelectorAll("[data-result-index]").length-1<0)return;const t=document.activeElement,r="INPUT"===t?.tagName||"TEXTAREA"===t?.tagName;if("ArrowDown"===e.key)(r||-1===L)&&(e.preventDefault(),P(0),D.current?.focus());else if("ArrowUp"===e.key&&0===L){e.preventDefault(),P(-1);const t=document.querySelector('input[type="text"], input[type="search"]');t?.focus()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v,L]);const q=t.useCallback(e=>{if(!v)return;const t=D.current?.querySelectorAll("[data-result-index]"),r=t?t.length-1:-1;switch(e.key){case"ArrowDown":e.preventDefault(),P(e=>Math.min(e+1,r));break;case"ArrowUp":e.preventDefault(),P(e=>Math.max(e-1,-1));break;case"Enter":if(e.preventDefault(),L>=0){const e=D.current?.querySelector(`[data-result-index="${L}"]`);e&&e.click()}break;case"Escape":P(-1),D.current?.blur();break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),P(r)}},[v,L]),H="card"===h||"grid"===h?(r,a,n=!1)=>{const s=r.primaryText||r.title,i=r.secondaryText||r.description,l=r.tertiaryText||r.price,c=r.imageUrl||r.image;return t.createElement("div",{key:r.id||a,"data-result-index":a,className:I($.resultItem,n&&$.resultItemHover),onClick:async()=>{if(N&&r.id)try{const t=e||z,o={currentPage:A,itemsPerPage:_},n=(o.currentPage-1)*o.itemsPerPage+a+1,s=t?.context;R.trackClick?await R.trackClick(r.id,n,s):await(R.trackEvent?.({event_name:"product_click",clicked_item_id:r.id,metadata:{result:r,position:n}},s))}catch(e){const t=e instanceof Error?e:new Error(String(e));u("SearchResults: Error tracking click",{resultId:r.id,error:t.message})}o&&o(r,a)},onMouseEnter:()=>v&&P(a),style:{border:`1px solid ${n?C.colors.primary:C.colors.border}`,borderRadius:"string"==typeof C.borderRadius?C.borderRadius:C.borderRadius.medium,overflow:"hidden",cursor:o?"pointer":"default",transition:C.transitions?.normal||"250ms ease-in-out",backgroundColor:n?C.colors.hover:C.colors.background,display:"flex",flexDirection:"column",padding:C.spacing.medium,boxShadow:n?C.shadows.medium:C.shadows.small,outline:n?`2px solid ${C.colors.primary}`:"none",outlineOffset:"-2px"}},c&&t.createElement("div",{style:{width:"100%",aspectRatio:"16/9",overflow:"hidden",backgroundColor:C.colors.hover}},t.createElement("img",{src:c,alt:s,style:{width:"100%",height:"100%",objectFit:"cover"}})),t.createElement("div",{style:{padding:C.spacing.medium}},s&&t.createElement("h3",{className:$.resultTitle,style:{fontSize:C.typography.fontSize.large,fontWeight:"bold",margin:0,marginBottom:C.spacing.small,color:C.colors.text}},s),i&&t.createElement("p",{className:$.resultDescription,style:{fontSize:C.typography.fontSize.medium,color:C.colors.text,margin:0,marginBottom:C.spacing.small,opacity:.8,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"}},i),l&&t.createElement("div",{className:$.resultPrice,style:{fontSize:C.typography.fontSize.medium,fontWeight:"bold",color:C.colors.primary,marginTop:"auto"}},l)))}:(r,a,n=!1)=>t.createElement("div",{key:r.id||a,"data-result-index":a,className:I($.resultItem,n&&$.resultItemHover),onClick:async()=>{if(N&&r.id)try{const t=e||z,o={currentPage:A,itemsPerPage:_},n=(o.currentPage-1)*o.itemsPerPage+a+1,s=t?.context;R.trackClick?await R.trackClick(r.id,n,s):await(R.trackEvent?.({event_name:"product_click",clicked_item_id:r.id,metadata:{result:r,position:n}},s))}catch(e){const t=e instanceof Error?e:new Error(String(e));u("SearchResults: Error tracking click",{resultId:r.id,error:t.message})}o&&o(r,a)},onMouseEnter:()=>v&&P(a),style:{padding:C.spacing.medium,border:`1px solid ${C.colors.border}`,borderBottom:`1px solid ${C.colors.border}`,borderRadius:0,marginBottom:0,cursor:o?"pointer":"default",transition:C.transitions?.normal||"250ms ease-in-out",backgroundColor:n?C.colors.hover:C.colors.background,display:"flex",alignItems:"flex-start",gap:C.spacing.medium,outline:n?`2px solid ${C.colors.primary}`:"none",outlineOffset:"-2px"}},r.image&&t.createElement("img",{src:r.image,alt:r.title,className:$.resultImage,style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"string"==typeof C.borderRadius?C.borderRadius:C.borderRadius.medium,flexShrink:0}}),t.createElement("div",{style:{flex:1,minWidth:0}},t.createElement("h3",{className:$.resultTitle,style:{fontSize:C.typography.fontSize.large,fontWeight:"bold",margin:0,marginBottom:C.spacing.small,color:C.colors.text}},r.title),r.description&&t.createElement("p",{className:$.resultDescription,style:{fontSize:C.typography.fontSize.medium,color:C.colors.text,margin:0,marginBottom:C.spacing.small,opacity:.8}},r.description),r.price&&t.createElement("div",{className:$.resultPrice,style:{fontSize:C.typography.fontSize.medium,fontWeight:"bold",color:C.colors.primary}},r.price)));let O=[];if(b)O=b(F)||[];else if(F){const e=F;Array.isArray(e.results)&&e.results.length>0?O=e.results:e.data&&Array.isArray(e.data.results)&&e.data.results.length>0?O=e.data.results:e.data?.data&&Array.isArray(e.data.data.results)&&e.data.data.results.length>0?O=e.data.data.results:Array.isArray(F)?O=F:Array.isArray(e.results)&&(O=e.results)}const j={title:"document.productName",description:"document.brandDesc",image:"document.image",price:"document.mrp",url:"document.url",id:"id",...y},V=(e,t)=>{if(t)return((e,t)=>{if(t)return t.split(".").reduce((e,t)=>e?.[t],e)})(e,t)},U=O.map((e,t)=>{try{const r=V(e,j.primaryText),a=V(e,j.secondaryText),o=V(e,j.tertiaryText),n=V(e,j.imageUrl),s=V(e,j.title)||r||"Untitled",i=V(e,j.description)||a,l=V(e,j.image)||n,c=V(e,j.price)||o,d=V(e,j.url),u=V(e,j.id)||String(t),p=void 0!==c?((e,t="₹")=>{if(null!=e){if("number"==typeof e)return`${t}${e}`;if("string"==typeof e){const r=parseFloat(e);return isNaN(r)?e:`${t}${r}`}return String(e)}})(c):void 0,m={};j.custom&&Object.entries(j.custom).forEach(([t,r])=>{m[t]=V(e,r)});return{id:u,title:s,description:i,url:d,image:l,price:p,metadata:e,...m,...r&&{primaryText:r},...a&&{secondaryText:a},...o&&{tertiaryText:o},...n&&{imageUrl:n},_raw:e}}catch(r){const a=r instanceof Error?r:new Error(String(r));return d("SearchResults: Error extracting result item",{index:t,error:a.message,item:e?.id||"unknown"}),{id:String(t),title:"Error loading result",metadata:e}}}),K={minHeight:`var(--seekora-results-min-height, ${x})`,minWidth:`var(--seekora-results-min-width, ${E})`,...p},Q={..."grid"===h&&{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:C.spacing.medium},..."card"===h&&{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:C.spacing.medium}};if(l("SearchResults: Extracted results",{rawResultsCount:O.length,resultItemsCount:U.length,viewMode:h,hasError:!!W,isLoading:B}),W)return u("SearchResults: Rendering error state",{error:W.message,stack:W.stack}),t.createElement("div",{className:I($.container,c),style:K},i?i(W):(G=W,t.createElement("div",{className:$.errorState,style:{padding:C.spacing.large,textAlign:"center",color:C.colors.error}},"Error: ",G.message)));var G;if(!F||0===U.length)return l("SearchResults: No results to display"),t.createElement("div",{className:I($.container,c),style:K},s?s():t.createElement("div",{className:$.emptyState,style:{padding:C.spacing.large,textAlign:"center",color:C.colors.text}},"No results found"));const X=n||H;return t.createElement("div",{ref:D,className:I($.container,c),style:K,tabIndex:v?0:void 0,onKeyDown:q,role:"listbox","aria-label":"Search results","aria-activedescendant":L>=0?`result-${L}`:void 0},(void 0!==F?.totalResults||void 0!==F?.data?.total_results)&&U.length>0&&t.createElement("div",{className:$.header,style:{marginBottom:C.spacing.medium,fontSize:C.typography.fontSize.medium,color:C.colors.text}},"Found ",F?.totalResults||F?.data?.total_results||0," result",1!==(F?.totalResults||F?.data?.total_results||0)?"s":""),t.createElement("div",{className:$.resultsList,style:Q},U.map((e,t)=>X(e,t,t===L))))},e.SectionError=jr,e.SectionItemGrid=function({columns:e=4,maxItems:r=12,className:a,style:o,getItemId:n=e=>e.id??String(e?.objectID??""),getItemTitle:s=e=>e.title??e?.title??"",getItemImage:i=e=>e.image??e?.image,getItemDescription:l=e=>e.description??e?.description,getItemUrl:c=e=>e.url??e?.url,renderItem:d}){const{items:u,loading:p,error:m,trackClick:g}=Or();return m?t.createElement(jr,{className:a,style:o}):t.createElement(Lt,{items:u,maxItems:r,columns:e,className:a,style:o,getItemId:n,getItemTitle:s,getItemImage:i,getItemDescription:l,getItemUrl:c,renderItem:d,onItemClick:(e,t)=>g(e,t)})},e.SectionSearchProvider=function({children:e,query:r,refinements:a=[],maxItems:o=12,sortBy:n,enabled:s=!0,sectionId:i,searchOptions:l}){const{client:c}=w(),[d,u]=t.useState([]),[p,m]=t.useState(!0),[g,f]=t.useState(null),[h,y]=t.useState(0);t.useEffect(()=>{if(!s||!c?.search)return u([]),m(!1),f(null),void y(0);let e=!1;m(!0),f(null);const t={...l,per_page:o,page:1};return n&&(t.sort_by=n),a.length>0&&(t.filter_by=a.map(e=>`${e.field}:${e.value}`).join(",")),c.search(r,t).then(t=>{e||(u(function(e){if(!e)return[];if(Array.isArray(e.results))return e.results;if(Array.isArray(e.hits))return e.hits;const t=e.data;return t&&Array.isArray(t.results)?t.results:t&&Array.isArray(t.data)?t.data:[]}(t)),y(function(e){if(!e)return 0;const t=e.totalResults??e.total??e.total_results;if("number"==typeof t)return t;const r=e.data;return null!=r?.total_results?Number(r.total_results):null!=r?.data?.total_results?Number(r.data.total_results):0}(t)),m(!1))}).catch(t=>{e||(f(t instanceof Error?t:new Error(String(t))),u([]),m(!1))}),()=>{e=!0}},[c,s,r,o,n,a,l]);const b=t.useCallback((e,t)=>{if(!c?.trackEvent)return;const r=e?.id??e?.objectID;c.trackEvent({event_name:"section_result_click",clicked_item_id:r,position:t,section:i,metadata:{section_id:i}},void 0)},[c,i]),v=t.useMemo(()=>({items:d,loading:p,error:g,totalCount:h,sectionId:i,trackClick:b}),[d,p,g,h,i,b]);return t.createElement(Hr.Provider,{value:v},e)},e.ShopifyDropdown=xa,e.Snippet=({hit:e,attribute:r,maxLength:a=100,ellipsis:o="...",className:n,style:s,theme:i,tagName:l="span",renderHighlighted:c,renderNonHighlighted:d,query:u})=>{const{theme:f}=w(),h=i||{},y=t.useMemo(()=>{const t=e._snippetResult?.[r]?.value||e.snippet_result?.[r]?.value||e._snippet?.[r]||e.snippet?.[r];if(t)return t.replace(/<em>/g,"<mark>").replace(/<\/em>/g,"</mark>");let n=p({hit:e,attribute:r,preTag:"<mark>",postTag:"</mark>"});if(n.replace(/<\/?mark>/g,"").length>a){const e=function(e,t){let r=0,a="",o=!1;for(let n=0;n<e.length;n++){const s=e[n];if("<"===s)o=!0,a+=s;else if(">"===s)o=!1,a+=s;else if(o)a+=s;else{if(r>=t)break;a+=s,r++}}const n=a.match(/<mark>/g)?.length||0,s=a.match(/<\/mark>/g)?.length||0;for(let e=0;e<n-s;e++)a+="</mark>";return a}(n,a);return e+o}return n},[e,r,a,o]),b=t.useMemo(()=>{const t=m(y,"<mark>","</mark>");if(t.every(e=>!e.isHighlighted)&&u){const t=e[r]||y;let n=String(t);return n.length>a&&(n=n.substring(0,a)+o),g(n,u)}return t},[y,u,e,r,a,o]),v={backgroundColor:f.colors.warning||"#fff59d",fontWeight:f.typography.fontWeight?.semibold||600,padding:"0 2px",borderRadius:"2px"},k=b.map((e,r)=>e.isHighlighted?c?t.createElement(t.Fragment,{key:r},c(e,r)):t.createElement("mark",{key:r,className:h.highlighted,style:v},e.value):d?t.createElement(t.Fragment,{key:r},d(e,r)):t.createElement("span",{key:r,className:h.nonHighlighted},e.value));return t.createElement(l,{className:n||h.root,style:s},k)},e.SortBy=({options:e,value:r,defaultValue:a,onSortChange:o,renderSelect:n,className:s,style:i,theme:l,placeholder:c="Sort by...",syncWithState:d=!0,variant:u="dropdown",label:p,showLabel:m,size:g="medium"})=>{const{theme:f}=w(),{sortBy:h,setSortBy:y}=S(),b=l||{},v=t.useId(),k=void 0!==m?m:!!p,[x,E]=t.useState(a||e[0]?.value||"");t.useEffect(()=>{d&&a&&!h&&y(a,!1)},[]);const C=void 0!==r?r:d&&h?h:x,R=e=>{N(e.target.value)},N=t.useCallback(e=>{E(e),d&&y(e),o&&o(e)},[d,y,o]),{fontSize:z,padding:T}=function(e,t){switch(e){case"small":return{fontSize:t.typography.fontSize.small,padding:t.spacing.small};case"large":return{fontSize:t.typography.fontSize.large,padding:t.spacing.medium};default:return{fontSize:t.typography.fontSize.medium,padding:t.spacing.small}}}(g,f),M="string"==typeof(A=f.borderRadius)?A:A.medium;var A;const _={"--seekora-sort-bg":f.colors.background,"--seekora-sort-color":f.colors.text,"--seekora-sort-border":f.colors.border,"--seekora-sort-active-bg":f.colors.primary,"--seekora-sort-active-color":f.colors.background},$=k&&p?t.createElement("span",{className:I(b.label),style:{display:"block",marginBottom:f.spacing.small,fontSize:z,color:"var(--seekora-sort-color)",fontWeight:500}},p):null;if("dropdown"===u)return n?t.createElement("div",{className:I(b.container,s),style:{..._,...i}},$,n({value:C,onChange:R,options:e})):t.createElement("div",{className:I(b.container,s),style:{..._,...i}},$,t.createElement(V,{value:C,onChange:N,options:e,placeholder:c,"aria-label":p||"Sort results",className:I(b.select),style:{width:"100%","--seekora-select-font-size":z,"--seekora-select-border":"var(--seekora-sort-border)","--seekora-select-radius":M,"--seekora-select-bg":"var(--seekora-sort-bg)","--seekora-select-color":"var(--seekora-sort-color)"}}));if("button-group"===u)return t.createElement("div",{className:I(b.container,s),style:{..._,...i}},$,t.createElement("div",{role:"group","aria-label":p||"Sort results",className:I(b.buttonGroup),style:{display:"inline-flex",borderRadius:M,overflow:"hidden",border:"1px solid var(--seekora-sort-border)"}},e.map((r,a)=>{const o=r.value===C;return t.createElement("button",{key:r.value,type:"button",role:"button","aria-pressed":o,onClick:()=>N(r.value),className:I(b.buttonGroupItem,o&&b.buttonGroupItemActive),style:{padding:T,fontSize:z,border:"none",borderRight:a<e.length-1?"1px solid var(--seekora-sort-border)":"none",backgroundColor:o?"var(--seekora-sort-active-bg)":"var(--seekora-sort-bg)",color:o?"var(--seekora-sort-active-color)":"var(--seekora-sort-color)",cursor:"pointer",fontWeight:o?600:400,transition:"background-color 0.15s ease, color 0.15s ease",outline:"none"}},r.label)})));if("radio-group"===u){const r=`seekora-sort-${v}`;return t.createElement("div",{className:I(b.container,s),style:{..._,...i}},$,t.createElement("div",{role:"radiogroup","aria-label":p||"Sort results",className:I(b.radioGroup),style:{display:"flex",flexDirection:"column",gap:f.spacing.small}},e.map(e=>{const a=e.value===C,o=`${r}-${e.value}`;return t.createElement("label",{key:e.value,htmlFor:o,className:I(b.radioItem,a&&b.radioItemActive),style:{display:"flex",alignItems:"center",gap:f.spacing.small,padding:T,borderRadius:M,cursor:"pointer",backgroundColor:a?"var(--seekora-sort-active-bg)":"transparent",color:a?"var(--seekora-sort-active-color)":"var(--seekora-sort-color)",fontWeight:a?600:400,transition:"background-color 0.15s ease, color 0.15s ease"}},t.createElement("input",{type:"radio",id:o,name:r,value:e.value,checked:a,onChange:()=>N(e.value),style:{margin:0}}),t.createElement("span",{className:I(b.radioLabel),style:{fontSize:z}},e.label))})))}return null},e.SpotlightDropdown=ba,e.Stats=({results:e,renderStats:r,className:a,style:o,theme:n,showProcessingTime:s=!1,showQuery:i=!1,separator:l=" • ",variant:c="inline",showResultCount:d=!0,formatNumber:u})=>{const{theme:p}=w(),{results:m}=S(),g=n||{},f=e||m;t.useEffect(()=>{!function(){if("undefined"==typeof document)return;if(document.getElementById(_))return;const e=document.createElement("style");e.id=_,e.textContent=`\n .seekora-stats-root {\n --seekora-stats-color: inherit;\n --seekora-stats-bg: transparent;\n --seekora-stats-font-size: inherit;\n --seekora-stats-badge-bg: inherit;\n --seekora-stats-badge-color: inherit;\n }\n .${A} {\n opacity: 0;\n transition: opacity 250ms ease-in-out;\n }\n `,document.head.appendChild(e)}()},[]);const h=f,y=h?.totalResults||h?.data?.total_results||h?.data?.data?.total_results||0,b=h?.processingTimeMS||h?.data?.processingTimeMS||h?.data?.data?.processingTimeMS,v=h?.query??"",k=u||(e=>e.toLocaleString()),x=t.useRef(null),E=t.useRef(y),[C,R]=t.useState(!1);t.useEffect(()=>{if(E.current!==y){E.current=y,R(!0);const e=requestAnimationFrame(()=>{R(!1)});return()=>cancelAnimationFrame(e)}},[y]);const N="string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.small;if(r)return t.createElement("div",{className:I("seekora-stats-root",g.container,a),style:o},r({totalResults:y,processingTime:b,query:v}));if("inline"===c){const e=[];return d&&(y>0?e.push(t.createElement("span",{key:"count",className:g.text},t.createElement("span",{ref:x,className:I(C&&A),style:{transition:"opacity 250ms ease-in-out"}},k(y))," result"+(1!==y?"s":""))):e.push(t.createElement("span",{key:"count",className:g.text},"No results"))),s&&void 0!==b&&e.push(t.createElement("span",{key:"time",className:g.text},k(b),"ms")),i&&v&&e.push(t.createElement("span",{key:"query",className:g.text},'for "',v,'"')),t.createElement("div",{className:I("seekora-stats-root",g.container,a),style:{fontSize:"var(--seekora-stats-font-size,"+p.typography.fontSize.medium+")",color:"var(--seekora-stats-color,"+p.colors.text+")",backgroundColor:"var(--seekora-stats-bg, transparent)",...o}},e.map((e,r)=>t.createElement("span",{key:r},r>0&&t.createElement("span",{className:g.separator,style:{margin:`0 ${p.spacing.small}`}},l),e)))}if("badge"===c){const e=[],r={display:"inline-flex",alignItems:"center",gap:p.spacing.small,padding:`${p.spacing.small} ${p.spacing.medium}`,borderRadius:N,backgroundColor:`var(--seekora-stats-badge-bg, ${p.colors.primary}1A)`,color:`var(--seekora-stats-badge-color, ${p.colors.primary})`,fontSize:p.typography.fontSize.small,fontWeight:500};return d&&e.push(t.createElement("span",{key:"count",className:I(g.badge),style:r},t.createElement("span",{className:g.badgeLabel},"Results"),t.createElement("span",{className:I(g.badgeValue,C&&A),style:{fontWeight:600,transition:"opacity 250ms ease-in-out"}},y>0?k(y):"0"))),i&&v&&e.push(t.createElement("span",{key:"query",className:I(g.badge),style:r},t.createElement("span",{className:g.badgeLabel},"Query"),t.createElement("span",{className:g.badgeValue,style:{fontWeight:600}},v))),s&&void 0!==b&&e.push(t.createElement("span",{key:"time",className:I(g.badge),style:r},t.createElement("span",{className:g.badgeLabel},"Time"),t.createElement("span",{className:g.badgeValue,style:{fontWeight:600}},k(b),"ms"))),t.createElement("div",{className:I("seekora-stats-root",g.container,a),style:{display:"flex",flexWrap:"wrap",gap:p.spacing.small,fontSize:"var(--seekora-stats-font-size,"+p.typography.fontSize.small+")",color:"var(--seekora-stats-color,"+p.colors.text+")",backgroundColor:"var(--seekora-stats-bg, transparent)",...o}},e)}if("detailed"===c){const e=[];return d&&e.push({label:"Total Results",value:t.createElement("span",{className:I(C&&A),style:{transition:"opacity 250ms ease-in-out"}},k(y))}),i&&v&&e.push({label:"Query",value:v}),s&&void 0!==b&&e.push({label:"Time",value:`${k(b)}ms`}),t.createElement("div",{className:I("seekora-stats-root",g.detailed,g.container,a),style:{display:"flex",flexDirection:"column",gap:p.spacing.small,fontSize:"var(--seekora-stats-font-size,"+p.typography.fontSize.medium+")",color:"var(--seekora-stats-color,"+p.colors.text+")",backgroundColor:"var(--seekora-stats-bg, transparent)",...o}},e.map((e,r)=>t.createElement("div",{key:r,className:g.detailedRow,style:{display:"flex",alignItems:"center",gap:p.spacing.small}},t.createElement("span",{className:g.detailedLabel,style:{color:p.colors.textSecondary,fontWeight:500}},e.label,":"),t.createElement("span",{className:g.detailedValue,style:{color:p.colors.text,fontWeight:600}},e.value))))}return null},e.SuggestionDropdownVariants=Aa,e.SuggestionItem=ft,e.SuggestionList=yt,e.SuggestionSearchBar=Ma,e.SuggestionsDropdownComposition=function({showRecentSearches:e=!0,showTrending:r=!0,showTabs:a=!0,showProducts:o=!0,placeholder:n,...s}){return t.createElement(tt,{...s},t.createElement("div",{className:"seekora-suggestions-dropdown-composition",style:{position:"relative",width:"100%"}},t.createElement(it,{placeholder:n}),t.createElement(ut,null,t.createElement(Dr,null),e?t.createElement(_r,null):null,t.createElement(yt,null),a?t.createElement(Tr,null):null,o?t.createElement(zr,null):null,r?t.createElement(Pr,null):null)))},e.SuggestionsError=Dr,e.SuggestionsProvider=tt,e.TrendingItems=({items:e,loading:r=!1,title:a="Trending Now",maxItems:o=8,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d="horizontal",currencySymbol:u="$"})=>{const{theme:p}=w(),m=e?.slice(0,o)||[];return r&&0===m.length||0===m.length?null:t.createElement(te,{title:a,items:m,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d,currencySymbol:u})},e.TrendingList=Pr,e.VariantSelector=Wr,e.VariantSwatches=hr,e.addRecentSearch=Zt,e.addToRecentlyViewed=function(e,t="seekora_recently_viewed",r=20){if("undefined"!=typeof localStorage)try{const a=localStorage.getItem(t);let o=a?JSON.parse(a):[];o=o.filter(t=>t.id!==e.id),o.unshift(e),o=o.slice(0,r),localStorage.setItem(t,JSON.stringify(o))}catch(e){}},e.brandPresets=so,e.breakpoints=Vr,e.clearRecentSearches=e=>{try{const t=e?`${Xt}_${e}`:Xt;localStorage.removeItem(t)}catch{}},e.clearSuggestionsCache=()=>{rr?.clear()},e.createSuggestionsCache=e=>new tr(e),e.createSuggestionsTheme=function(e="light",t={},r){return{...{light:ao,dark:oo,minimal:no}[e],...r?so[r]:{},...t}},e.createTheme=x,e.darkTheme={colors:{primary:"#0d6efd",secondary:"#6c757d",background:"#1a1a1a",text:"#ffffff",border:"#333333",hover:"#2a2a2a",focus:"#0d6efd",error:"#dc3545"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:{small:"0.875rem",medium:"1rem",large:"1.25rem"}},spacing:{small:"0.5rem",medium:"1rem",large:"1.5rem"},borderRadius:"0.25rem",shadows:{small:"0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.7)",medium:"0 3px 6px rgba(0, 0, 0, 0.6), 0 3px 6px rgba(0, 0, 0, 0.8)",large:"0 10px 20px rgba(0, 0, 0, 0.7), 0 6px 6px rgba(0, 0, 0, 0.9)"}},e.darkThemeVariables=oo,e.defaultTheme=k,e.extractBadges=Ot,e.extractBrand=(e,t={name:"name"})=>({id:t.id?Pt(e,t.id):e?.id,name:Pt(e,t.name)??"",logo:t.logo?Pt(e,t.logo):void 0,count:t.count?Pt(e,t.count):void 0,_raw:e}),e.extractCategory=Bt,e.extractProduct=Ft,e.extractSuggestion=Dt,e.findVariantBySelections=Ut,e.formatParsedFilters=function(e){return e.map(e=>`${e.field}: ${e.value}`).join(", ")},e.formatPriceRange=(e,t={})=>`${Wt(e.min,t)} - ${Wt(e.max,t)}`,e.formatSuggestionPrice=Wt,e.generateSuggestionsStylesheet=io,e.getAvailableValuesForOption=Vt,e.getFingerprint=async function(e){return new v(e).get()},e.getPriceRange=jt,e.getRecentSearches=Yt,e.getShortcutText=Ga,e.getSuggestionsCache=ar,e.highlightText=(e,t,r={})=>{if(!t||!e)return qt(e);const{tag:a="mark",className:o="",style:n}=r,s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=n?` style="${Object.entries(n).map(([e,t])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}:${t}`).join(";")}"`:"",l=o?` class="${o}"`:"";return qt(e).replace(new RegExp(`(${qt(s)})`,"gi"),`<${a}${l}${i}>$1</${a}>`)},e.injectGlobalResponsiveStyles=Xr,e.injectSuggestionsStyles=co,e.lightThemeVariables=ao,e.mediaQueries=Ur,e.mergeThemes=(e,...t)=>t.reduce((e,t)=>({colors:{...e.colors,...t.colors},typography:{...e.typography,...t.typography,fontSize:{...e.typography?.fontSize,...t.typography?.fontSize}},spacing:{...e.spacing,...t.spacing},borderRadius:t.borderRadius??e.borderRadius,shadows:{...e.shadows,...t.shadows},transitions:{...e.transitions,...t.transitions},breakpoints:{...e.breakpoints,...t.breakpoints},zIndex:{...e.zIndex,...t.zIndex}}),e),e.minimalTheme={colors:{primary:"#000000",secondary:"#666666",background:"#ffffff",text:"#000000",border:"#e0e0e0",hover:"#f5f5f5",focus:"#000000",error:"#cc0000"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:{small:"0.875rem",medium:"1rem",large:"1.125rem"}},spacing:{small:"0.5rem",medium:"0.75rem",large:"1rem"},borderRadius:"0",shadows:{small:"none",medium:"none",large:"none"}},e.minimalThemeVariables=no,e.parseHighlightMarkup=mt,e.removeRecentSearch=Jt,e.touchTargets=Kr,e.updateSuggestionsStyles=function(e){co(e,!0)},e.useAnalytics=({client:e,enabled:r=!0})=>{const a=t.useCallback(async(t,a,o)=>{if(r)try{const r={event_name:t,...a};await(e.trackEvent?.(r,o))}catch(e){u("Failed to track event:",e)}},[e,r]),o=t.useCallback(async(t,o,n,s)=>{if(!r)return;const i=s??0;e.trackClick?await e.trackClick(t,i,n):await a("product_click",{clicked_item_id:t,metadata:{result:o,...void 0!==s&&{position:i}}},n)},[e,a,r]),n=t.useCallback(async(e,t,o,n,s)=>{r&&await a("conversion",{clicked_item_id:e,value:o,currency:n,metadata:{result:t}},s)},[a,r]),s=t.useCallback(async(t,a)=>{if(r&&0!==t.length)try{await(e.trackEvents?.(t,a))}catch(e){u("Failed to track batch events:",e)}},[e,r]);return{trackEvent:a,trackClick:o,trackConversion:n,trackBatch:s}},e.useAnalyticsProvider=()=>t.useContext(qr),e.useDocSearch=Ja,e.useDocSearchSeekoraSearch=eo,e.useFilters=U,e.useInjectResponsiveStyles=Yr,e.useKeyboard=Qa,e.useNaturalLanguageFilters=function(e={}){const{fieldMappings:r={},valueMappings:a={},autoApply:o=!1,currencySymbol:n="$"}=e,{addRefinement:s,removeRefinement:i,clearRefinements:l,setQuery:c}=S(),d=t.useMemo(()=>({...ro,colors:[...ro.colors,...a.color?Object.keys(a.color):[]],sizes:{...ro.sizes,...a.size||{}}}),[a]),u=t.useCallback(e=>{const t=[];let o=e;for(const a of d.price){const n=e.match(a.pattern);if(n){"range"===a.operator&&n[2]?(t.push({field:r.price||"price",value:`>=${n[1]}`,operator:">=",confidence:.95,matchedText:n[0]}),t.push({field:r.price||"price",value:`<=${n[2]}`,operator:"<=",confidence:.95,matchedText:n[0]})):n[1]&&t.push({field:r.price||"price",value:`${a.operator}${n[1]}`,operator:a.operator,confidence:.95,matchedText:n[0]}),o=o.replace(n[0]," ");break}}const n=new RegExp(`\\b(${d.colors.join("|")})\\b`,"gi"),s=e.match(n);s&&s.forEach(e=>{const n=a.color?.[e.toLowerCase()]||e.toLowerCase();t.push({field:r.color||"color",value:n,operator:"=",confidence:.9,matchedText:e}),o=o.replace(new RegExp(`\\b${e}\\b`,"gi")," ")});const i=Object.entries(d.sizes);for(const[a,n]of i){const s=new RegExp(`\\b${a}\\b`,"gi");if(s.test(e)){t.push({field:r.size||"size",value:n,operator:"=",confidence:.85,matchedText:a}),o=o.replace(s," ");break}}for(const a of d.ratings)if("value"in a)a.pattern.test(e)&&(t.push({field:r.rating||a.field,value:`${a.operator}${a.value}`,operator:a.operator,confidence:.8,matchedText:e.match(a.pattern)?.[0]||""}),o=o.replace(a.pattern," "));else{const n=e.match(a.pattern);n&&n[1]&&(t.push({field:r.rating||a.field,value:`${a.operator}${n[1]}`,operator:a.operator,confidence:.85,matchedText:n[0]}),o=o.replace(n[0]," "))}for(const a of d.availability)a.pattern.test(e)&&(t.push({field:r[a.field]||a.field,value:a.value,operator:"=",confidence:.9,matchedText:e.match(a.pattern)?.[0]||""}),o=o.replace(a.pattern," "));return o=o.replace(/\s+/g," ").trim(),{cleanedQuery:o,filters:t,originalQuery:e,hasFilters:t.length>0}},[d,r,a]),p=t.useCallback(e=>{e.forEach(e=>{s(e.field,e.value,!1)}),e.length},[s]),m=t.useCallback(e=>{const t=u(e);return t.hasFilters&&(p(t.filters),t.cleanedQuery!==e&&c(t.cleanedQuery,!0)),t},[u,p,c]);return{parse:u,applyFilters:p,parseAndApply:m}},e.useProductAnalytics=function({client:e,product:r,position:a=0,section:o,tabId:n,query:s,context:i,enabled:c=!0}){const u=t.useRef(!1),p=t.useRef(null),m=t.useRef(null),g=r.id||r.objectID||"",f=t.useCallback(async(t,u)=>{if(c&&e)try{await(e.trackEvent?.({event_name:t,metadata:{product_id:g,product_title:r.title||r.name,product_price:r.price,position:a,section:o,tab_id:n,original_query:s,timestamp:Date.now(),source:"product_analytics",...u}},i)),l(`ProductAnalytics: ${t}`,u)}catch(e){d(`Failed to track ${t}`,{error:e})}},[e,c,g,r,a,o,n,s,i]),h=t.useCallback(()=>{f("product.click",{}),e?.trackClick&&Promise.resolve(e.trackClick(g,a+1,i)).catch(()=>{})},[f,e,g,a,i]),y=t.useCallback((e,t)=>{f("product.variant_select",{option_name:e,option_value:t})},[f]),b=t.useCallback(e=>{f("product.add_to_cart",{variant_id:e?.id,variant_sku:e?.sku,variant_title:e?.title,variant_price:e?.price})},[f]),v=t.useCallback((e,t)=>{f(e,t??{})},[f]),k=t.useCallback(e=>{p.current&&(p.current.disconnect(),p.current=null),m.current=e,e&&c&&!u.current&&"undefined"!=typeof IntersectionObserver&&(p.current=new IntersectionObserver(e=>{for(const t of e)t.isIntersecting&&!u.current&&(u.current=!0,f("product.impression",{}),p.current?.disconnect())},{threshold:.5}),p.current.observe(e))},[c,f]);return t.useEffect(()=>()=>{p.current?.disconnect()},[]),{clickProps:{onClick:()=>h(),"data-seekora-product-id":g,"data-seekora-position":a},variantSelectProps:(e,t)=>({onClick:()=>y(e,t),"data-seekora-variant-option":e,"data-seekora-variant-value":t}),addToCartProps:e=>({onClick:()=>b(e),"data-seekora-action":"add-to-cart"}),impressionRef:k,trackClick:h,trackVariantSelect:y,trackAddToCart:b,trackCustomEvent:v}},e.useQuerySuggestions=C,e.useQuerySuggestionsEnhanced=de,e.useResponsive=Qr,e.useSearchContext=w,e.useSearchState=S,e.useSectionSearchContext=Or,e.useSeekoraSearch=({client:e,autoTrack:r=!0})=>{const[a,o]=t.useState(null),[n,s]=t.useState(!1),[i,d]=t.useState(null),[p,m]=t.useState(null),g=t.useCallback(async t=>{s(!0),d(null);const r=t.q||"";l("useSeekoraSearch: Starting search",{query:r,options:t});try{const{q:r,...a}=t,n="string"==typeof r?r:"",s=await e.search(n,a);return c("useSeekoraSearch: Search completed",{query:n,resultsCount:Array.isArray(s?.results)?s.results.length:0,hasContext:!!s?.context}),o(s),null!=s.context&&m(s.context),s}catch(e){const t=e instanceof Error?e:new Error(String(e));return u("useSeekoraSearch: Search failed",{query:r,error:t.message,stack:t.stack}),d(t),o(null),m(null),null}finally{s(!1)}},[e]);return{search:g,results:a,loading:n,error:i,context:p,clearResults:t.useCallback(()=>{o(null),d(null),m(null)},[])}},e.useSmartSuggestions=function(e,r={}){const{minQueryLength:a=1,maxSuggestions:o=10,debounceMs:n=200,enableSpellCorrection:s=!0,enableQueryExpansion:i=!0,enableIntentDetection:l=!0,includeTrending:c=!0,userContext:d}=r,{stateManager:u}=w(),[p,m]=t.useState([]),[g,f]=t.useState(!1),[h,y]=t.useState(null),[b,v]=t.useState(null),[k,x]=t.useState([]),[E,S]=t.useState([]),C=t.useRef(null),R=t.useMemo(()=>["phone","laptop","computer","tablet","headphones","camera","television","speaker","watch","keyboard","mouse","monitor","shirt","pants","shoes","jacket","dress","skirt","sweater","electronics","clothing","accessories","furniture","appliances"],[]),I=t.useCallback(async e=>{const t=[];if(l){const t=function(e){const t=[{pattern:/^(buy|purchase|order|get)\s+/i,intent:"purchase"},{pattern:/^(find|search|looking for|where)\s+/i,intent:"search"},{pattern:/^(compare|vs|versus)\s+/i,intent:"compare"},{pattern:/^(how (to|do)|what is|why)\s+/i,intent:"informational"},{pattern:/under\s*\$?\d+|less than\s*\$?\d+|cheap|affordable/i,intent:"price_sensitive"},{pattern:/best|top|recommended|popular/i,intent:"recommendation"},{pattern:/\d+\s*(gb|tb|inch|cm|mm|kg|lb)/i,intent:"specification"},{pattern:/(red|blue|green|black|white|pink|purple|yellow)\s+/i,intent:"color_preference"},{pattern:/(size|small|medium|large|xl|xxl)\s+/i,intent:"size_preference"}];for(const{pattern:r,intent:a}of t)if(r.test(e))return{intent:a,confidence:.8};return null}(e);v(t?t.intent:null)}if(s&&e.length>=3){const r=to(e,R);x(r),r.forEach(r=>{t.push({text:r,type:"correction",confidence:.9,metadata:{correctedFrom:e}})})}if(i){const r=function(e){const t=e.toLowerCase(),r=[];return Object.entries({phone:["smartphone","mobile","cellphone"],laptop:["notebook","computer","pc"],tv:["television","smart tv","monitor"],headphones:["earbuds","earphones","headset"],shoes:["footwear","sneakers","boots"],shirt:["top","blouse","tee"],pants:["trousers","jeans","bottoms"],cheap:["affordable","budget","inexpensive"],best:["top-rated","popular","recommended"]}).forEach(([a,o])=>{t.includes(a)&&o.forEach(t=>{const o=e.replace(new RegExp(a,"gi"),t);r.includes(o)||r.push(o)})}),r.slice(0,3)}(e);S(r),r.forEach(e=>{t.push({text:e,type:"expansion",confidence:.7,metadata:{expandedTo:[e]}})})}return t.unshift({text:e,type:"query",confidence:1}),d?.recentSearches&&d.recentSearches.filter(t=>t.toLowerCase().includes(e.toLowerCase())&&t!==e).slice(0,2).forEach(e=>{t.push({text:e,type:"related",confidence:.6})}),t.slice(0,o)},[R,l,s,i,o,d]),N=t.useCallback(async e=>e.length<a?[]:I(e),[a,I]);return t.useEffect(()=>(C.current&&clearTimeout(C.current),e.length<a?(m([]),x([]),S([]),void v(null)):(f(!0),C.current=setTimeout(async()=>{try{const t=await I(e);m(t),y(null)}catch(e){y(e instanceof Error?e:new Error(String(e))),m([])}finally{f(!1)}},n),()=>{C.current&&clearTimeout(C.current)})),[e,a,n,I]),{suggestions:p,loading:g,error:h,detectedIntent:b,corrections:k,expansions:E,getSuggestions:N,clear:t.useCallback(()=>{m([]),x([]),S([]),v(null),y(null)},[])}},e.useSuggestionsAnalytics=Qe,e.useSuggestionsContext=et,e.useVariantSelection=function({options:e=[],variants:r=[],initialSelections:a={},onVariantChange:o}={}){const[n,s]=t.useState(a),i=t.useMemo(()=>Ut(e,r,n),[e,r,n]),l=t.useMemo(()=>e.length>0&&e.every(e=>!!n[e.name]),[e,n]),c=t.useMemo(()=>{const t={};for(const a of e)t[a.name]=Vt(a.name,e,r,n);return t},[e,r,n]),d=i?.price??null,u=i?.comparePrice??null,p=t.useCallback((t,a)=>{s(n=>{const s={...n,[t]:a},i=Ut(e,r,s);return o?.(i,s),s})},[e,r,o]),m=t.useCallback(()=>{s({}),o?.(null,{})},[o]);return{selections:n,setSelection:p,resetSelections:m,selectedVariant:i,availableValues:c,isComplete:l,effectivePrice:d,effectiveComparePrice:u}},e.withAnalytics=function(e,r={}){const{trackClick:a=!0,trackImpression:o=!1,clickEventName:n="product.click",getProductFromProps:s=()=>null,getPositionFromProps:i=()=>0}=r,l=e.displayName||e.name||"Component",c=t.forwardRef((r,l)=>{const{seekoraClient:c,seekoraContext:u,...p}=r,m=t.useRef(null),g=t.useRef(!1),f=s(p),h=i(p),y=t.useCallback(async(e,t)=>{if(c)try{await(c.trackEvent?.({event_name:e,metadata:{product_id:f?.id||f?.objectID,product_title:f?.title||f?.name,product_price:f?.price,position:h,timestamp:Date.now(),source:"with_analytics_hoc",...t}},u))}catch(t){d(`withAnalytics: Failed to track ${e}`,{error:t})}},[c,u,f,h]),b=t.useCallback(()=>{a&&f&&(y(n,{}),c?.trackClick&&f&&Promise.resolve(c.trackClick(f.id||f.objectID||"",h+1,u)).catch(()=>{}))},[a,f,y,c,u,h]);return t.useEffect(()=>{if(!o||!c||!m.current||g.current)return;if("undefined"==typeof IntersectionObserver)return;const e=new IntersectionObserver(t=>{for(const r of t)r.isIntersecting&&!g.current&&(g.current=!0,y("product.impression",{}),e.disconnect())},{threshold:.5});return e.observe(m.current),()=>e.disconnect()},[o,c,y]),t.createElement("div",{ref:e=>{m.current=e,"function"==typeof l?l(e):l&&(l.current=e)},onClick:b,style:{display:"contents"}},t.createElement(e,{...p}))});return c.displayName=`withAnalytics(${l})`,c}});