@seekora-ai/ui-sdk-react 0.2.12 → 0.2.13

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.
Files changed (58) hide show
  1. package/dist/components/InfiniteHits.d.ts +2 -0
  2. package/dist/components/InfiniteHits.d.ts.map +1 -1
  3. package/dist/components/InfiniteHits.js +6 -3
  4. package/dist/components/QuerySuggestions.d.ts +2 -0
  5. package/dist/components/QuerySuggestions.d.ts.map +1 -1
  6. package/dist/components/QuerySuggestions.js +4 -3
  7. package/dist/components/QuerySuggestionsDropdown.d.ts +1 -1
  8. package/dist/components/QuerySuggestionsDropdown.d.ts.map +1 -1
  9. package/dist/components/QuerySuggestionsDropdown.js +4 -4
  10. package/dist/components/Recommendations.d.ts +6 -0
  11. package/dist/components/Recommendations.d.ts.map +1 -1
  12. package/dist/components/Recommendations.js +12 -6
  13. package/dist/components/RichQuerySuggestions.d.ts +4 -0
  14. package/dist/components/RichQuerySuggestions.d.ts.map +1 -1
  15. package/dist/components/RichQuerySuggestions.js +2 -3
  16. package/dist/components/SearchBar.d.ts +2 -0
  17. package/dist/components/SearchBar.d.ts.map +1 -1
  18. package/dist/components/SearchBar.js +5 -9
  19. package/dist/components/SearchResults.d.ts +2 -0
  20. package/dist/components/SearchResults.d.ts.map +1 -1
  21. package/dist/components/SearchResults.js +4 -2
  22. package/dist/components/section-primitives/SectionItemGrid.d.ts +3 -1
  23. package/dist/components/section-primitives/SectionItemGrid.d.ts.map +1 -1
  24. package/dist/components/section-primitives/SectionItemGrid.js +3 -2
  25. package/dist/components/suggestions/AmazonDropdown.d.ts.map +1 -1
  26. package/dist/components/suggestions/AmazonDropdown.js +2 -2
  27. package/dist/components/suggestions/GoogleDropdown.d.ts.map +1 -1
  28. package/dist/components/suggestions/GoogleDropdown.js +2 -2
  29. package/dist/components/suggestions/MinimalDropdown.d.ts.map +1 -1
  30. package/dist/components/suggestions/MinimalDropdown.js +2 -2
  31. package/dist/components/suggestions/MobileSheetDropdown.d.ts.map +1 -1
  32. package/dist/components/suggestions/MobileSheetDropdown.js +2 -2
  33. package/dist/components/suggestions/PinterestDropdown.d.ts.map +1 -1
  34. package/dist/components/suggestions/PinterestDropdown.js +2 -2
  35. package/dist/components/suggestions/ShopifyDropdown.d.ts.map +1 -1
  36. package/dist/components/suggestions/ShopifyDropdown.js +2 -2
  37. package/dist/components/suggestions/SpotlightDropdown.d.ts.map +1 -1
  38. package/dist/components/suggestions/SpotlightDropdown.js +2 -2
  39. package/dist/components/suggestions/SuggestionSearchBar.d.ts.map +1 -1
  40. package/dist/components/suggestions/SuggestionSearchBar.js +1 -0
  41. package/dist/components/suggestions/types.d.ts +2 -0
  42. package/dist/components/suggestions/types.d.ts.map +1 -1
  43. package/dist/components/suggestions-primitives/SuggestionList.d.ts +8 -1
  44. package/dist/components/suggestions-primitives/SuggestionList.d.ts.map +1 -1
  45. package/dist/components/suggestions-primitives/SuggestionList.js +7 -4
  46. package/dist/components/suggestions-primitives/SuggestionsDropdownComposition.d.ts.map +1 -1
  47. package/dist/components/suggestions-primitives/SuggestionsDropdownComposition.js +0 -2
  48. package/dist/docsearch/components/Results.d.ts +3 -1
  49. package/dist/docsearch/components/Results.d.ts.map +1 -1
  50. package/dist/docsearch/components/Results.js +6 -2
  51. package/dist/hooks/useQuerySuggestionsEnhanced.js +2 -1
  52. package/dist/index.umd.js +1 -1
  53. package/dist/src/index.d.ts +32 -3
  54. package/dist/src/index.esm.js +85 -68
  55. package/dist/src/index.esm.js.map +1 -1
  56. package/dist/src/index.js +85 -68
  57. package/dist/src/index.js.map +1 -1
  58. package/package.json +3 -3
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 m(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 p(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.client=e.client,this.autoSearch=!1!==e.autoSearch,this.debounceMs=e.debounceMs||300,this.defaultSearchOptions=e.defaultSearchOptions||{widget_mode:!0},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){if(this.state.query===e)return l("SearchStateManager: Query unchanged, skipping update",{query:e}),void(t&&this.autoSearch&&(l("SearchStateManager: Query unchanged but triggerSearch=true, triggering search"),this.debouncedSearch()));this.state.query=e,this.state.currentPage=1,l("SearchStateManager: Query updated",{query:e,triggerSearch:t,autoSearch:this.autoSearch}),this.notifyListeners(),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){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),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(){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})}})}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 x={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}},k=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,x),E=t.createContext(null),S=()=>{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},w=()=>{const{stateManager:e}=S(),[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([]),[l,c]=t.useState(!1),[d,m]=t.useState(null),p=t.useRef(null);return t.useEffect(()=>(p.current&&clearTimeout(p.current),a&&r.trim()?(c(!0),m(null),p.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));u("Error in useQuerySuggestions:",t),m(t),i([])}finally{c(!1)}},o),()=>{p.current&&clearTimeout(p.current)}):(i([]),c(!1),void m(null))),[e,r,a,o,n]),{suggestions:s,loading:l,error:d}};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=({title:e,items:r,renderItem:a,onItemClick:o,className:n,style:s,theme:i,layout:l="horizontal",currencySymbol:c="$"})=>{const{theme:d}=S(),u=i||{},m=()=>{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:{...m(),cursor:o?"pointer":"default"}},a?a(e,r):t.createElement(T,{item:e,theme:u,currencySymbol:c,layout:l})))))},T=({item:e,theme:r,currencySymbol:a,layout:o})=>{const{theme:n}=S(),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)))};function z(e){return{padding:e.spacing.large,textAlign:"center",color:e.colors.textSecondary}}const M="seekora_recent_searches",A=10;function _(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 L(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?P(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 P(e){return e.replace(/__ais-highlight__/g,"<mark>").replace(/__\/ais-highlight__/g,"</mark>")}function D(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 B(e){return{id:e.id,label:e.label,filter:e.filter,products:e.products?.map(D)||[],nb_hits:e.nb_hits,processing_time_ms:e.processing_time_ms}}function $(e){const{client:r,query:a,enabled:o=!0,debounceMs:n=200,maxSuggestions:s=10,minQueryLength:i=1,includeDropdownRecommendations:c=!1,includeDropdownProductList:d=!0,includeFilteredTabs:m=!0,includeCategories:p=!0,includeFacets:g=!1,maxCategories:f=3,maxFacets:h=5,filteredTabs:y,minPopularity:b,timeRange:v,disableTypoTolerance:x,analyticsTags:k,enableRecentSearches:E=!0,maxRecentSearches:S=A,recentSearchesKey:w=M,onSuggestionsLoaded:C,onError:R}=e,[I,N]=t.useState([]),[T,z]=t.useState(!1),[P,$]=t.useState(null),[F,W]=t.useState(null),[q,H]=t.useState([]),[O,j]=t.useState(null),[V,U]=t.useState(0),[Q,G]=t.useState(0),[X,Y]=t.useState(0),[K,Z]=t.useState(""),J=t.useRef(null),ee=t.useRef(null),te=t.useRef(!0);t.useEffect(()=>{if(E){const e=function(e){if("undefined"==typeof window)return[];try{const t=localStorage.getItem(e);return t?JSON.parse(t):[]}catch{return[]}}(w);H(e.slice(0,S))}return()=>{te.current=!1}},[E,w,S]);const re=t.useCallback(async e=>{if(r){if(!e.trim()&&i>0)return N([]),void W(null);ee.current&&ee.current.abort(),ee.current=new AbortController,z(!0),$(null);try{const t=await(r.getSuggestions?.(e,{hitsPerPage:s,include_dropdown_recommendations:c||y&&y.length>0,include_dropdown_product_list:d,include_filtered_tabs:m,include_categories:p,include_facets:g,max_categories:f,max_facets:h,filtered_tabs:y,min_popularity:b,time_range:v,disable_typo_tolerance:x,analytics_tags:k,returnFullResponse:!0}));if(!te.current)return;const a=(t.suggestions||[]).map(L);N(a);const o=t.extensions||{},n=t.results,i=Array.isArray(n?.[1]?.hits)?n[1].hits:[],u=i.length>0?i.map(e=>D(e)):[],E={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(D):[],item_recommendations:Array.isArray(o.item_recommendations)?o.item_recommendations.map(D):[],product_hits:u.length>0?u:void 0,popular_brands:Array.isArray(o.popular_brands)?o.popular_brands:[],filtered_tabs:Array.isArray(o.filtered_tabs)?o.filtered_tabs.map(B):[],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};W(E);const S=t.raw,w=S?.results,R=w?.[0]??S??{},I=e=>"number"!=typeof e||Number.isNaN(e)?0:e,T=e=>"string"==typeof e?e:"";j("number"==typeof R.processingTimeMS?R.processingTimeMS:null),U(I(R.nbHits)||a.length),G(I(R.page)||0),Y(I(R.nbPages)||1),Z(T(R.query)||e),C&&C({suggestions:a,nbHits:I(R.nbHits)||a.length,page:I(R.page)||0,nbPages:I(R.nbPages)||1,hitsPerPage:I(R.hitsPerPage)||s,processingTimeMS:"number"==typeof R.processingTimeMS?R.processingTimeMS:void 0,query:T(R.query)||e,dropdownRecommendations:E,results:Array.isArray(t.results)?t.results:void 0,extensions:o}),l("Query suggestions loaded",{query:e,suggestionsCount:a.length,hasRecommendations:Object.keys(E).some(e=>Array.isArray(E[e])&&E[e].length>0)})}catch(t){if(!te.current)return;const r=t instanceof Error?t:new Error(String(t));if("AbortError"===r.name)return;u("Failed to fetch query suggestions",{query:e,error:r.message}),$(r),N([]),W(null),R&&R(r)}finally{te.current&&z(!1)}}},[r,i,s,c,d,m,p,g,f,h,y,b,v,x,k,C,R]);t.useEffect(()=>(J.current&&clearTimeout(J.current),!o||a.length<i?(N([]),z(!1),void $(null)):(z(!0),J.current=setTimeout(()=>{re(a)},n),()=>{J.current&&clearTimeout(J.current)})),[a,o,i,n,re]);const ae=t.useCallback((e,t)=>{E&&e.trim()&&H(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 _(w,o),o})},[E,S,w]),oe=t.useCallback(e=>{H(t=>{const r=t.filter(t=>t.query!==e);return _(w,r),r})},[w]),ne=t.useCallback(()=>{H([]),_(w,[])},[w]),se=t.useCallback(async()=>{a.length>=i&&await re(a)},[a,i,re]),ie=F?.trending_searches||[],le=F?.top_searches||[],ce=F?.related_searches||[],de=F?.popular_brands||[],ue=F?.filtered_tabs||[],me=t.useMemo(()=>{const e=F?.trending_products;if(e&&e.length>0)return e;const t=F?.item_recommendations;if(t&&t.length>0)return t;const r=F?.filtered_tabs?.[0];return r?.products&&r.products.length>0?r.products:F?.product_hits??[]},[F?.trending_products,F?.item_recommendations,F?.filtered_tabs,F?.product_hits]),pe=t.useMemo(()=>I.length>0||q.length>0||ie.length>0||le.length>0||ce.length>0||de.length>0||ue.length>0||me.length>0,[I,q,ie,le,ce,de,ue,me]),ge=t.useCallback(()=>{const e=[];let t=0;return 0===a.length&&q.length>0&&q.forEach(r=>{e.push({type:"recent",index:t++,data:r})}),I.forEach(r=>{e.push({type:"suggestion",index:t++,data:r})}),ie.forEach(r=>{e.push({type:"trending",index:t++,data:r})}),me.forEach(r=>{e.push({type:"product",index:t++,data:r})}),de.forEach(r=>{e.push({type:"brand",index:t++,data:r})}),e},[a,q,I,ie,me,de]);return{suggestions:I,loading:T,error:P,dropdownRecommendations:F,trendingSearches:ie,topSearches:le,relatedSearches:ce,popularBrands:de,filteredTabs:ue,trendingProducts:me,recentSearches:q,processingTimeMs:O,totalHits:V,currentPage:Q,totalPages:X,originalQuery:K,addRecentSearch:ae,removeRecentSearch:oe,clearRecentSearches:ne,refetch:se,hasContent:pe,getAllNavigableItems:ge}}const F={container:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius, 8px)",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, #6b7280)",textTransform:"uppercase",letterSpacing:"0.05em",padding:"8px 16px 4px",margin:0},suggestionItem:{display:"flex",alignItems:"center",padding:"10px 16px",cursor:"pointer",transition:"background-color 150ms ease",fontSize:"14px",color:"var(--seekora-text-primary, #111827)",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, #111827)",backgroundColor:"var(--seekora-highlight-bg, #fef3c7)",padding:"0 2px",borderRadius:"2px"},recentIcon:{width:"16px",height:"16px",color:"var(--seekora-text-secondary, #9ca3af)",flexShrink:0},removeButton:{padding:"4px",borderRadius:"4px",border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-secondary, #9ca3af)",opacity:0,transition:"opacity 150ms ease, color 150ms ease"},removeButtonVisible:{opacity:1},loadingState:{display:"flex",alignItems:"center",justifyContent:"center",padding:"24px 16px",color:"var(--seekora-text-secondary, #6b7280)",fontSize:"14px",gap:"8px"},emptyState:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px 16px",color:"var(--seekora-text-secondary, #6b7280)",fontSize:"14px",textAlign:"center"},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, #e5e7eb)",margin:"4px 0"},footer:{borderTop:"1px solid var(--seekora-border-color, #e5e7eb)",padding:"8px 16px",fontSize:"12px",color:"var(--seekora-text-secondary, #6b7280)",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:"3px",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)",border:"1px solid var(--seekora-border-color, #e5e7eb)",fontSize:"10px",fontWeight:500}},W=({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"})),q=({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"})),H=({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"})),O=({style:e})=>t.createElement("svg",{style:{animation:"spin 1s linear infinite",...e},viewBox:"0 0 24 24",width:"20",height:"20"},t.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",fill:"none",opacity:"0.25"}),t.createElement("path",{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})),j=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,showLoading:u=!0,showEmptyState:m=!0,highlight:p={enabled:!0,preTag:"<mark>",postTag:"</mark>"},keyboardNav:g={enabled:!0},animation:f={enabled:!0,duration:150,entrance:"fade"},classNames:h={},style:y,renderSuggestion:b,renderRecentSearch:v,renderLoading:x,renderEmpty:k,footer:E,position:w="absolute",width:C="100%",zIndex:R=1e3,closeOnClickOutside:N=!0,closeOnEscape:T=!0,ariaLabel:z="Search suggestions",onSuggestionSelect:M,onRecentSearchClick:A,onRecentSearchRemove:_,onOpen:L,onClose:P,onNavigate:D}=e,{client:B,theme:j}=S(),V=t.useRef(null),[U,Q]=t.useState(-1),[G,X]=t.useState(!1),{suggestions:Y,loading:K,error:Z,recentSearches:J,addRecentSearch:ee,removeRecentSearch:te,hasContent:re}=$({client:B,query:a,enabled:o&&a.length>=s,debounceMs:i,maxSuggestions:n,minQueryLength:s,enableRecentSearches:l,maxRecentSearches:c}),ae=t.useMemo(()=>{const e=[];return l&&0===a.length&&J.length>0&&J.slice(0,c).forEach(t=>{e.push({type:"recent",data:t})}),Y.forEach(t=>{e.push({type:"suggestion",data:t})}),e},[Y,J,a,l,c]);t.useEffect(()=>{if(o&&(re||K))X(!0),L?.();else{if(f.enabled){const e=setTimeout(()=>X(!1),f.duration);return()=>clearTimeout(e)}X(!1),P?.()}},[o,re,K,f.enabled,f.duration,L,P]),t.useEffect(()=>{Q(-1)},[ae.length]);const oe=t.useCallback(()=>{g.enabled&&Q(e=>{const t=e<ae.length-1?e+1:0;return D?.("down",t),t})},[g.enabled,ae.length,D]),ne=t.useCallback(()=>{g.enabled&&Q(e=>{const t=e>0?e-1:ae.length-1;return D?.("up",t),t})},[g.enabled,ae.length,D]),se=t.useCallback(()=>{if(U<0||U>=ae.length)return;const e=ae[U];if("recent"===e.type){const t=e.data;A?.(t)}else{const t=e.data;M?.(t),ee(t.query,t.count)}},[U,ae,A,M,ee]),ie=t.useCallback(()=>{Q(-1)},[]);t.useImperativeHandle(r,()=>({selectActive:se,navigateNext:oe,navigatePrevious:ne,resetSelection:ie,getActiveIndex:()=>U,getTotalItems:()=>ae.length}),[se,oe,ne,ie,U,ae.length]),t.useEffect(()=>{if(!N||!o)return;const e=e=>{V.current&&!V.current.contains(e.target)&&P?.()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N,o,P]);const le=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:h.suggestionItemHighlight,style:F.highlight},e):e)},[p.enabled,h.suggestionItemHighlight]),ce=t.useCallback(e=>e.highlightedQuery&&p.enabled?t.createElement("span",{dangerouslySetInnerHTML:{__html:e.highlightedQuery},style:{display:"inline"}}):le(e.query,a),[p.enabled,le,a]);if(!G&&!o)return null;const de=l&&0===a.length&&J.length>0,ue=Y.length>0,me=m&&!K&&!de&&!ue&&a.length>=s,pe=f.enabled?{opacity:o?1:0,transform:o?"translateY(0)":"translateY(-8px)",transition:`opacity ${f.duration}ms ease, transform ${f.duration}ms ease`}:{};return t.createElement("div",{ref:V,role:"listbox","aria-label":z,"aria-expanded":o,className:I("seekora-suggestions-dropdown",h.root,h.container),style:{position:w,width:C,zIndex:R,...F.container,...pe,...y}},K&&u&&t.createElement("div",{className:h.loadingState,style:F.loadingState},x?x():t.createElement(t.Fragment,null,t.createElement(O,null),t.createElement("span",null,"Searching..."))),!K&&de&&t.createElement("div",{className:I("seekora-suggestions-section",h.section,h.recentSearches)},t.createElement("div",{className:h.sectionTitle,style:F.sectionTitle},"Recent Searches"),J.slice(0,c).map((e,r)=>{const a=U===r;return t.createElement("div",{key:`recent-${e.query}-${r}`,role:"option","aria-selected":a,className:I(h.recentItem,a&&h.suggestionItemActive),onClick:()=>{A?.(e)},onMouseEnter:()=>Q(r)},((e,r,a)=>v?v(e,r,a):t.createElement("div",{style:{...F.suggestionItem,...a?F.suggestionItemActive:{}}},t.createElement(q,{style:F.recentIcon}),t.createElement("span",{style:F.suggestionQuery},e.query),t.createElement("button",{type:"button",onClick:t=>{t.stopPropagation(),te(e.query),_?.(e)},style:{...F.removeButton,...a?F.removeButtonVisible:{}},"aria-label":`Remove ${e.query} from recent searches`},t.createElement(H,null))))(e,r,a))})),!K&&de&&ue&&t.createElement("div",{style:F.divider}),!K&&ue&&t.createElement("div",{className:I("seekora-suggestions-section",h.section,h.suggestionsList)},a.length>0&&t.createElement("div",{className:h.sectionTitle,style:F.sectionTitle},"Suggestions"),Y.map((e,r)=>{const o=de?J.length+r:r,n=U===o;return t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,className:I(h.suggestionItem,n&&h.suggestionItemActive),onClick:()=>{M?.(e),ee(e.query,e.count)},onMouseEnter:()=>Q(o)},((e,r,o)=>b?b(e,r,o,e=>le(e,a)):t.createElement("div",{style:{...F.suggestionItem,...o?F.suggestionItemActive:{}}},t.createElement(W,{style:F.recentIcon}),t.createElement("span",{style:F.suggestionQuery},ce(e)),d&&void 0!==e.count&&t.createElement("span",{style:F.suggestionCount},e.count.toLocaleString())))(e,r,n))})),me&&t.createElement("div",{className:h.emptyState,style:F.emptyState},k?k():t.createElement(t.Fragment,null,t.createElement(W,{style:{width:24,height:24,marginBottom:8,opacity:.5}}),t.createElement("span",null,'No suggestions found for "',a,'"'))),E||g.enabled&&ae.length>0?t.createElement("div",{className:h.footer,style:F.footer},E||t.createElement("div",{style:F.keyboardHint},t.createElement("span",{style:F.keyboardKey},"↑"),t.createElement("span",{style:F.keyboardKey},"↓"),t.createElement("span",null,"to navigate"),t.createElement("span",{style:F.keyboardKey},"↵"),t.createElement("span",null,"to select"),t.createElement("span",{style:F.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 '))}),V=[{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}],U={container:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius-lg, 12px)",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, #e5e7eb)",backgroundColor:"var(--seekora-bg-secondary, #f9fafb)"},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 100ms ease",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, #111827)",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, #6b7280)",backgroundColor:"var(--seekora-bg-tertiary, #f3f4f6)",borderRadius:"12px",cursor:"pointer",transition:"all 100ms ease"},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, #374151)",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"20px",cursor:"pointer",transition:"all 150ms ease"},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:"50%",backgroundColor:"var(--seekora-primary, #3b82f6)",color:"white",fontSize:"10px",fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center"},removeButton:{padding:"4px",marginLeft:"auto",borderRadius:"4px",border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-tertiary, #9ca3af)",opacity:0,transition:"opacity 100ms ease"},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, #e5e7eb)",margin:"4px 16px"},footer:{padding:"12px 16px",borderTop:"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:"var(--seekora-bg-secondary, #f9fafb)",fontSize:"12px",color:"var(--seekora-text-secondary, #6b7280)"},loadingOverlay:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)"},emptyState:{padding:"32px 16px",textAlign:"center",color:"var(--seekora-text-secondary, #6b7280)"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fef9c3)",fontWeight:600,borderRadius:"2px",padding:"0 1px"}},Q=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:U.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"})),G=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:U.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"})),X=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:U.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"})),Y=()=>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"})),K=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,sections:n=V,maxSuggestionsPerSection:s=8,minQueryLength:i=0,debounceMs:l=200,includeDropdownRecommendations:c=!0,includeDropdownProductList:d=!0,includeFilteredTabs:u=!0,includeCategories:m=!0,maxCategories:p=3,showCounts:g=!0,showCategoryCounts:f=!0,showSectionHeaders:h=!0,classNames:y={},style:b,renderSuggestion:v,renderCategory:x,renderTrendingItem:k,renderRecentItem:E,header:w,footer:C,width:R="100%",maxHeight:N="480px",zIndex:T=1e3,ariaLabel:z="Search suggestions",analyticsTags:M,onSuggestionSelect:A,onCategoryClick:_,onRecentSearchClick:L,onRecentSearchRemove:P,onViewAllClick:D,onOpen:B,onClose:F}=e,{client:W}=S(),q=t.useRef(null),[H,O]=t.useState(-1),[j,K]=t.useState(null),{suggestions:Z,loading:J,trendingSearches:ee,topSearches:te,recentSearches:re,addRecentSearch:ae,removeRecentSearch:oe,hasContent:ne}=$({client:W,query:a,enabled:o,debounceMs:l,maxSuggestions:s,minQueryLength:i,includeDropdownRecommendations:c,includeDropdownProductList:d,includeFilteredTabs:u,includeCategories:m,maxCategories:p,analyticsTags:M,enableRecentSearches:!0}),se=t.useMemo(()=>n.filter(e=>!1!==e.enabled).sort((e,t)=>(e.order||0)-(t.order||0)),[n]),ie=e=>se.find(t=>t.id===e),le=t.useMemo(()=>{const e=[];return se.forEach((t,r)=>{switch(t.id){case"recent":0===a.length&&re.slice(0,t.maxItems||5).forEach(t=>{e.push({type:"recent",data:t,sectionIndex:r})});break;case"suggestions":Z.slice(0,t.maxItems||s).forEach(t=>{e.push({type:"suggestion",data:t,sectionIndex:r})});break;case"trending":0===a.length&&(ee.length>0?ee:te).slice(0,t.maxItems||5).forEach(t=>{e.push({type:"trending",data:t,sectionIndex:r})})}}),e},[se,a,re,Z,ee,te,s]),ce=t.useCallback(()=>{O(e=>e<le.length-1?e+1:0)},[le.length]),de=t.useCallback(()=>{O(e=>e>0?e-1:le.length-1)},[le.length]),ue=t.useCallback(()=>{if(H<0||H>=le.length)return;const e=le[H];switch(e.type){case"recent":L?.(e.data);break;case"suggestion":A?.(e.data),ae(e.data.query,e.data.count);break;case"trending":A?.({query:e.data.query,count:e.data.count}),ae(e.data.query)}},[H,le,L,A,ae]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>H,setActiveIndex:O,selectActive:ue,navigateNext:ce,navigatePrevious:de,getTotalItems:()=>le.length}),[H,ue,ce,de,le.length]);const me=()=>{const e=ie("recent");return!e||a.length>0||0===re.length?null:t.createElement("div",{className:I("seekora-section","seekora-section-recent",y.section)},h&&t.createElement("div",{style:U.sectionHeader},t.createElement("h3",{style:U.sectionTitle},e.title||"Recent Searches"),re.length>(e.maxItems||5)&&t.createElement("button",{style:U.sectionAction,onClick:()=>D?.("recent")},"View all")),re.slice(0,e.maxItems||5).map((e,r)=>{const a=((e,t)=>{let r=0;for(const a of le){if(se[a.sectionIndex].id===e)return r+t;a.sectionIndex<se.findIndex(t=>t.id===e)&&r++}return r+t})("recent",r),o=H===a;return t.createElement("div",{key:`recent-${e.query}`,role:"option","aria-selected":o,style:{...U.item,...o?U.itemActive:{}},onClick:()=>{L?.(e)},onMouseEnter:()=>O(a),className:I(y.recentItem,o&&y.suggestionItemActive)},E?E(e):t.createElement(t.Fragment,null,t.createElement(G,null),t.createElement("div",{style:U.itemContent},t.createElement("p",{style:U.itemQuery},e.query)),t.createElement("button",{style:U.removeButton,onClick:t=>{t.stopPropagation(),oe(e.query),P?.(e)},"aria-label":"Remove"},t.createElement(Y,null))))}))},pe=()=>{const e=ie("suggestions");return e&&0!==Z.length?t.createElement("div",{className:I("seekora-section","seekora-section-suggestions",y.section)},h&&a.length>0&&t.createElement("div",{style:U.sectionHeader},t.createElement("h3",{style:U.sectionTitle},e.title||"Suggestions")),Z.slice(0,e.maxItems||s).map((e,r)=>{const o=le.findIndex((e,t)=>"suggestion"===e.type&&le.slice(0,t).filter(e=>"suggestion"===e.type).length===r),n=H===o;return t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,style:{...U.item,...n?U.itemActive:{}},onClick:()=>{A?.(e),ae(e.query,e.count)},onMouseEnter:()=>O(o),className:I(y.suggestionItem,n&&y.suggestionItemActive)},v?v(e,n):t.createElement(t.Fragment,null,t.createElement(Q,null),t.createElement("div",{style:U.itemContent},t.createElement("p",{style:U.itemQuery},(s=e.query,a?s.split(new RegExp(`(${a})`,"gi")).map((e,r)=>e.toLowerCase()===a.toLowerCase()?t.createElement("span",{key:r,style:U.highlight},e):e):s)),m&&e.categories&&e.categories.length>0&&t.createElement("div",{style:U.categoriesContainer},e.categories.slice(0,p).map((e,r)=>x?x(e):t.createElement("span",{key:`cat-${r}`,style:{...U.categoryPill,...j===e.value?U.categoryPillHover:{}},onClick:t=>{t.stopPropagation(),_?.(e)},onMouseEnter:()=>K(e.value),onMouseLeave:()=>K(null)},e.value,f&&void 0!==e.count&&t.createElement("span",{style:U.categoryCount},"(",e.count,")"))))),g&&void 0!==e.count&&t.createElement("span",{style:U.itemCount},e.count.toLocaleString())));var s})):null};if(!o)return null;return ne||J||0===a.length?t.createElement("div",{ref:q,role:"listbox","aria-label":z,className:I("seekora-rich-suggestions",y.root,y.container),style:{position:"absolute",width:R,zIndex:T,...U.container,...b}},w&&t.createElement("div",{style:U.header},w),t.createElement("div",{style:{...U.content,maxHeight:N}},J&&t.createElement("div",{style:U.loadingOverlay},t.createElement("span",null,"Loading...")),se.map((e,r)=>{let o=null;switch(e.id){case"recent":o=me();break;case"suggestions":o=pe();break;case"trending":o=(()=>{const e=ie("trending"),r=ee.length>0?ee:te;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:U.sectionHeader},t.createElement("h3",{style:U.sectionTitle},e.title||"Trending")),t.createElement("div",{style:U.trendingList},r.slice(0,e.maxItems||5).map((e,r)=>{const a=le.findIndex((e,t)=>"trending"===e.type&&le.slice(0,t).filter(e=>"trending"===e.type).length===r),o=H===a;return k?k(e,r):t.createElement("button",{key:`trending-${e.query}`,style:{...U.trendingChip,...o?U.trendingChipHover:{}},onClick:()=>{A?.({query:e.query,count:e.count}),ae(e.query)},onMouseEnter:()=>O(a),className:I(y.trendingItem,o&&y.suggestionItemActive)},t.createElement("span",{style:U.trendingRank},r+1),t.createElement("span",null,e.query),t.createElement(X,null))})))})()}return o?t.createElement(t.Fragment,{key:e.id},r>0&&t.createElement("div",{style:U.divider}),o):null}),!J&&a.length>0&&0===Z.length&&t.createElement("div",{style:U.emptyState},t.createElement("p",null,'No suggestions found for "',a,'"'))),C&&t.createElement("div",{style:U.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}),Z={container:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius-lg, 12px)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden"},header:{padding:"12px 20px",borderBottom:"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:"var(--seekora-bg-secondary, #f9fafb)"},content:{display:"flex",overflowY:"auto"},contentStacked:{flexDirection:"column"},suggestionsColumn:{borderRight:"1px solid var(--seekora-border-color, #e5e7eb)",overflowY:"auto"},productsColumn:{flex:1,overflowY:"auto",backgroundColor:"var(--seekora-bg-secondary, #fafafa)"},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 100ms ease",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, #111827)",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, #e5e7eb)",overflowX:"auto"},tab:{display:"flex",alignItems:"center",gap:"6px",padding:"8px 16px",fontSize:"13px",fontWeight:500,color:"var(--seekora-text-secondary, #6b7280)",backgroundColor:"transparent",border:"1px solid transparent",borderRadius:"20px",cursor:"pointer",whiteSpace:"nowrap",transition:"all 150ms ease"},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:"10px",backgroundColor:"var(--seekora-bg-tertiary, #e5e7eb)"},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, #ffffff)",borderRadius:"8px",overflow:"hidden",cursor:"pointer",transition:"transform 150ms ease, box-shadow 150ms ease",border:"1px solid var(--seekora-border-color, #e5e7eb)"},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, #111827)",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, #374151)",backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"8px",cursor:"pointer",transition:"all 150ms ease"},brandChipHover:{borderColor:"var(--seekora-primary, #3b82f6)",backgroundColor:"var(--seekora-primary-light, #eff6ff)"},brandLogo:{width:"20px",height:"20px",borderRadius:"4px",objectFit:"contain",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"},footer:{padding:"12px 20px",borderTop:"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:"var(--seekora-bg-secondary, #f9fafb)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",color:"var(--seekora-text-secondary, #6b7280)"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fef9c3)",fontWeight:600,padding:"0 2px",borderRadius:"2px"}},J=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Z.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"})),ee=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Z.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"})),te=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Z.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"})),re=()=>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"})),ae=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:m=!0,showFilteredTabs:p=!0,showRecentSearches:g=!0,layout:f="side-by-side",productsColumnWidth:h="60%",suggestionsColumnWidth:y="40%",showPrices:b=!0,currencySymbol:v="$",classNames:x={},style:k,renderProduct:E,renderSuggestion:w,renderBrand:C,renderTab:R,header:N,footer:T,viewAllProductsLink:z,width:M="800px",maxHeight:A="600px",zIndex:_=1e3,analyticsTags:L,includeFacets:P=!0,includeCategories:D=!0,includeDropdownRecommendations:B=!0,onSuggestionSelect:F,onProductClick:W,onBrandClick:q,onTabSelect:H,onRecentSearchClick:O,onRecentSearchRemove:j,onViewAllClick:V,onOpen:U,onClose:Q}=e,{client:G}=S(),X=t.useRef(null),[Y,K]=t.useState(-1),[ae,oe]=t.useState("all"),[ne,se]=t.useState(null),[ie,le]=t.useState(null),{suggestions:ce,loading:de,filteredTabs:ue,trendingProducts:me,popularBrands:pe,recentSearches:ge,addRecentSearch:fe,removeRecentSearch:he,hasContent:ye}=$({client:G,query:a,enabled:o,debounceMs:c,maxSuggestions:n,minQueryLength:l,includeDropdownRecommendations:B,includeCategories:D,includeFacets:P,filteredTabs:d,analyticsTags:L,enableRecentSearches:g}),be=t.useMemo(()=>{if("all"===ae){const e=[...me];return ue.forEach(t=>{t.products&&t.products.forEach(t=>{e.find(e=>e.id===t.id)||e.push(t)})}),e.slice(0,s)}const e=ue.find(e=>e.id===ae);return e?.products?.slice(0,s)||[]},[ae,ue,me,s]),ve=t.useMemo(()=>{const e=[];return 0===a.length&&g&&ge.slice(0,5).forEach(t=>{e.push({type:"recent",data:t})}),ce.forEach(t=>{e.push({type:"suggestion",data:t})}),e},[a,g,ge,ce]),xe=t.useCallback(()=>{K(e=>e<ve.length-1?e+1:0)},[ve.length]),ke=t.useCallback(()=>{K(e=>e>0?e-1:ve.length-1)},[ve.length]),Ee=t.useCallback(()=>{if(Y<0||Y>=ve.length)return;const e=ve[Y];"recent"===e.type?O?.(e.data):"suggestion"===e.type&&(F?.(e.data),fe(e.data.query))},[Y,ve,O,F,fe]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>Y,setActiveIndex:K,selectActive:Ee,navigateNext:xe,navigatePrevious:ke,getActiveTab:()=>ae,setActiveTab:oe}),[Y,Ee,xe,ke,ae]);const Se=e=>{oe(e);const t=ue.find(t=>t.id===e);t&&H?.(t)};if(!o)return null;const we=p&&(ue.length>0||me.length>0),Ce=u&&be.length>0,Re=m&&pe.length>0,Ie=g&&0===a.length&&ge.length>0,Ne=ce.length>0,Te="stacked"===f||"full-width"===f;return t.createElement("div",{ref:X,role:"listbox","aria-label":"Search suggestions and products",className:I("seekora-federated-dropdown",x.root,x.container),style:{position:"absolute",width:M,zIndex:_,...Z.container,...k}},N&&t.createElement("div",{style:Z.header},N),we&&t.createElement("div",{style:Z.tabsContainer,className:x.tabsList},t.createElement("button",{style:{...Z.tab,..."all"===ae?Z.tabActive:{}},onClick:()=>Se("all"),className:I(x.tabItem,"all"===ae&&x.tabActive)},"All Results",me.length>0&&t.createElement("span",{style:{...Z.tabCount,..."all"===ae?Z.tabCountActive:{}}},me.length,"+")),ue.map(e=>R?R(e,ae===e.id):t.createElement("button",{key:e.id,style:{...Z.tab,...ae===e.id?Z.tabActive:{}},onClick:()=>Se(e.id),className:I(x.tabItem,ae===e.id&&x.tabActive)},e.label,void 0!==e.nb_hits&&t.createElement("span",{style:{...Z.tabCount,...ae===e.id?Z.tabCountActive:{}}},e.nb_hits)))),t.createElement("div",{style:{...Z.content,...Te?Z.contentStacked:{},maxHeight:A}},t.createElement("div",{style:{...Z.suggestionsColumn,width:Te?"100%":y,minWidth:Te?void 0:"280px",borderRight:Te?"none":Z.suggestionsColumn.borderRight}},Ie&&t.createElement("div",{style:Z.section,className:x.recentSearches},t.createElement("div",{style:Z.sectionHeader},t.createElement("h3",{style:Z.sectionTitle},"Recent Searches")),ge.slice(0,5).map((e,r)=>{const a=Y===r;return t.createElement("div",{key:`recent-${e.query}`,role:"option","aria-selected":a,style:{...Z.suggestionItem,...a?Z.suggestionItemActive:{}},onClick:()=>O?.(e),onMouseEnter:()=>K(r),className:I(x.recentItem,a&&x.suggestionItemActive)},t.createElement(ee,null),t.createElement("span",{style:Z.suggestionText},e.query),t.createElement(te,{style:a?Z.suggestionArrowVisible:{}}))})),Ne&&t.createElement("div",{style:Z.section,className:x.suggestionsList},t.createElement("div",{style:Z.sectionHeader},t.createElement("h3",{style:Z.sectionTitle},a?"Suggestions":"Popular Searches")),ce.slice(0,n).map((e,r)=>{const o=Ie?ge.length+r:r,n=Y===o;return w?w(e,r,n):t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,style:{...Z.suggestionItem,...n?Z.suggestionItemActive:{}},onClick:()=>{F?.(e),fe(e.query)},onMouseEnter:()=>K(o),className:I(x.suggestionItem,n&&x.suggestionItemActive)},t.createElement(J,null),t.createElement("span",{style:Z.suggestionText},(s=e.query,a?s.split(new RegExp(`(${a})`,"gi")).map((e,r)=>e.toLowerCase()===a.toLowerCase()?t.createElement("span",{key:r,style:Z.highlight},e):e):s)),void 0!==e.count&&t.createElement("span",{style:Z.suggestionCount},e.count.toLocaleString()),t.createElement(te,{style:n?Z.suggestionArrowVisible:{}}));var s})),Re&&t.createElement("div",{style:Z.section,className:x.brandsList},t.createElement("div",{style:Z.sectionHeader},t.createElement("h3",{style:Z.sectionTitle},"Popular Brands")),t.createElement("div",{style:Z.brandsGrid},pe.slice(0,i).map((e,r)=>C?C(e,r):t.createElement("button",{key:`brand-${e.name}`,style:{...Z.brandChip,...ie===e.name?Z.brandChipHover:{}},onClick:()=>q?.(e),onMouseEnter:()=>le(e.name),onMouseLeave:()=>le(null),className:x.brandItem},e.logo&&t.createElement("img",{src:e.logo,alt:e.name,style:Z.brandLogo,onError:e=>{e.target.style.display="none"}}),t.createElement("span",null,e.name)))))),Ce&&!Te&&t.createElement("div",{style:{...Z.productsColumn,width:h}},t.createElement("div",{style:Z.section},t.createElement("div",{style:Z.sectionHeader},t.createElement("h3",{style:Z.sectionTitle},"all"===ae?"Trending Products":`Products in ${ue.find(e=>e.id===ae)?.label||ae}`),z&&t.createElement("a",{href:z,style:Z.viewAllLink,onClick:e=>{e.preventDefault(),V?.("products")}},"View all")),t.createElement("div",{style:Z.productsGrid,className:x.productsList},be.map((e,r)=>{return E?E(e,r):t.createElement("div",{key:e.id||e.objectID,style:{...Z.productCard,...ne===e.id?Z.productCardHover:{}},onClick:()=>W?.(e),onMouseEnter:()=>se(e.id),onMouseLeave:()=>se(null),className:x.productItem},e.image?t.createElement("img",{src:e.image,alt:e.title||e.name||"",style:Z.productImage,onError:e=>{e.target.style.display="none"}}):t.createElement("div",{style:{...Z.productImage,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(re,null)),t.createElement("div",{style:Z.productInfo},t.createElement("h4",{style:Z.productTitle},e.title||e.name),b&&void 0!==e.price&&t.createElement("p",{style:Z.productPrice},(a=e.price,o=e.currency,void 0===a?"":`${o||v}${a.toLocaleString()}`))));var a,o}))))),T?t.createElement("div",{style:Z.footer},T):t.createElement("div",{style:Z.footer},t.createElement("span",null,"Press ↵ to search, ↑↓ to navigate"),a&&t.createElement("button",{style:{...Z.viewAllLink,background:"none",border:"none"},onClick:()=>V?.("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 '))}),oe="suggestions.click",ne="suggestions.impression",se="suggestions.product_click",ie="suggestions.category_click",le="suggestions.brand_click",ce="suggestions.tab_select",de="suggestions.recent_click",ue="suggestions.trending_click",me="suggestions.search_submit",pe="suggestions.dropdown_open",ge="suggestions.dropdown_close";function fe(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),m=t.useRef(null),p=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{await(r.trackEvent?.({event_name:e,analytics_tags:o,metadata:{...t,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(oe,{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(se,{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(ie,{category_value:e.value,category_count:e.count,category_path:e.path,original_query:t})},[g,i]),trackBrandClick:t.useCallback((e,t)=>{i&&g(le,{brand_name:e.name,brand_count:e.count,original_query:t})},[g,i]),trackTabSelect:t.useCallback((e,t)=>{g(ce,{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(de,{query:e.query,original_timestamp:e.timestamp,results_count:e.resultsCount})},[g,i]),trackTrendingClick:t.useCallback((e,t)=>{i&&g(ue,{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!==m.current&&(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{m.current=t,g(ne,{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(me,{query:e,from_suggestion:t,suggestion_query:r?.query,suggestion_id:r?.objectID,suggestion_popularity:r?.popularity})},[g]),trackDropdownOpen:t.useCallback(e=>{p.current=Date.now(),g(pe,{query:e,has_query:e.length>0})},[g]),trackDropdownClose:t.useCallback((e,t)=>{const r=p.current?Date.now()-p.current:null;g(ge,{query:e,selected_suggestion:t,had_selection:!!t,duration_ms:r}),p.current=null},[g])}}const he={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-primary, #3b82f6)",boxShadow:"0 0 0 3px 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:"white",borderRadius:"var(--seekora-border-radius, 6px)",fontSize:"14px",fontWeight:600,cursor:"pointer",transition:"background-color 150ms ease"}},ye=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:he.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"})),be=()=>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"})),ve=t.forwardRef(function(e,r){const{variant:a="classic",placeholder:o="Search...",initialQuery:n="",value:s,onQueryChange:i,onSearch:l,onSuggestionSelect:c,onProductClick:d,showSearchButton:u=!1,searchButtonText:m="Search",showClearButton:p=!0,autoFocus:g=!1,minQueryLength:f=1,maxSuggestions:h=8,maxProducts:y=8,debounceMs:b=200,showRecentSearches:v=!0,showTrendingOnEmpty:x=!0,includeDropdownRecommendations:k=!1,filteredTabs:E,enableAnalytics:w=!0,analyticsTags:C,includeFacets:R,includeCategories:N,dropdownWidth:T,dropdownMaxHeight:z,classNames:M={},style:A,inputStyle:_,ariaLabel:L="Search"}=e,{client:P}=S(),D=t.useRef(null),B=t.useRef(null),[$,F]=t.useState(s??n),[W,q]=t.useState(!1),[H,O]=t.useState(!1),V=fe({client:P,enabled:w,analyticsTags:C});t.useEffect(()=>{void 0!==s&&s!==$&&F(s)},[s]);const U=t.useCallback(e=>{const t=e.target.value;F(t),i?.(t),(t.length>=f||x&&0===t.length)&&O(!0)},[i,f,x]),Q=t.useCallback(e=>{e?.preventDefault(),$.trim()&&(l?.($.trim()),V.trackSearchSubmit($.trim(),!1),O(!1))},[$,l,V]),G=t.useCallback(e=>{F(e.query),i?.(e.query),c?.(e),V.trackSuggestionClick({suggestion:e,position:0,query:$}),O(!1),l?.(e.query)},[$,i,c,l,V]),X=t.useCallback(e=>{d?.(e),V.trackProductClick({product:e,position:0,query:$}),O(!1)},[$,d,V]),Y=t.useCallback(e=>{F(e.query),i?.(e.query),V.trackRecentSearchClick(e),O(!1),l?.(e.query)},[i,l,V]),Z=t.useCallback(()=>{q(!0),O(!0),V.trackDropdownOpen($)},[$,V]),J=t.useCallback(()=>{q(!1),setTimeout(()=>{O(!1),V.trackDropdownClose($)},200)},[$,V]),ee=t.useCallback(()=>{F(""),i?.(""),D.current?.focus()},[i]),te=t.useCallback(e=>{if(H)switch(e.key){case"ArrowDown":e.preventDefault(),B.current?.navigateNext?.();break;case"ArrowUp":e.preventDefault(),B.current?.navigatePrevious?.();break;case"Enter":e.preventDefault(),(B.current?.getActiveIndex?.()??-1)>=0?B.current?.selectActive?.():Q();break;case"Escape":e.preventDefault(),O(!1),D.current?.blur()}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||O(!0)},[H,Q]);t.useImperativeHandle(r,()=>({focus:()=>D.current?.focus(),blur:()=>D.current?.blur(),clear:ee,getQuery:()=>$,setQuery:e=>{F(e),i?.(e)},openDropdown:()=>O(!0),closeDropdown:()=>O(!1),navigateNext:()=>B.current?.navigateNext?.(),navigatePrevious:()=>B.current?.navigatePrevious?.(),selectCurrent:()=>B.current?.selectActive?.()}),[$,ee,i]);return t.createElement("div",{className:I("seekora-search-bar-with-suggestions",M.wrapper),style:{...he.wrapper,...A}},t.createElement("form",{onSubmit:Q},t.createElement("div",{style:{...he.inputWrapper,...W?he.inputWrapperFocused:{}}},t.createElement(ye,null),t.createElement("input",{ref:D,type:"text",value:$,onChange:U,onFocus:Z,onBlur:J,onKeyDown:te,placeholder:o,autoFocus:g,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":L,"aria-expanded":H,"aria-haspopup":"listbox","aria-autocomplete":"list",role:"combobox",className:M.input,style:{...he.input,..._}}),p&&$&&t.createElement("button",{type:"button",onClick:ee,className:M.clearButton,style:he.clearButton,"aria-label":"Clear search"},t.createElement(be,null)),u&&t.createElement("button",{type:"submit",className:M.button,style:he.searchButton},m))),t.createElement("div",{className:M.dropdown},(()=>{const e={query:$,isOpen:H,maxSuggestions:h,minQueryLength:f,debounceMs:b,showRecentSearches:v,classNames:M,onSuggestionSelect:G,onRecentSearchClick:Y,onClose:()=>O(!1),analyticsTags:C};switch(a){case"rich":return t.createElement(K,{ref:B,...e,includeDropdownRecommendations:k,includeCategories:!0,width:T||"100%",maxHeight:z||"480px"});case"federated":return t.createElement(ae,{ref:B,...e,maxProducts:y,filteredTabs:E,showProducts:!0,showBrands:!0,showFilteredTabs:!!E,onProductClick:X,width:T||"800px",maxHeight:z||"600px",includeFacets:R,includeCategories:N,includeDropdownRecommendations:k});case"compact":return t.createElement(j,{ref:B,...e,maxSuggestions:5,showCounts:!1,width:T||"100%"});default:return t.createElement(j,{ref:B,...e,width:T||"100%"})}})()))}),xe=t.createContext(null);function ke(){const e=t.useContext(xe);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 Ee({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:m}=S(),[p,g]=t.useState(""),[f,h]=t.useState(!1),[y,b]=t.useState(-1),[v,x]=t.useState(""),k=$({client:m,query:p,enabled:f,minQueryLength:r,debounceMs:a,maxSuggestions:o,includeDropdownRecommendations:n,filteredTabs:s,includeCategories:!0,enableRecentSearches:!0,maxRecentSearches:8,analyticsTags:l}),E=fe({client:m,enabled:i,analyticsTags:l,trackClicks:!0,trackImpressions:!0}),{suggestions:w,recentSearches:C,trendingSearches:R,trendingProducts:I,filteredTabs:N,loading:T,error:z,hasContent:M,getAllNavigableItems:A,addRecentSearch:_}=k,L=t.useRef(c),P=t.useRef(d),D=t.useRef(u);L.current=c,P.current=d,D.current=u;const B=t.useCallback(e=>{g(e),b(-1)},[]),F=t.useCallback(()=>{E.trackDropdownClose(p),h(!1),b(-1)},[E,p]),W=t.useCallback(e=>{e?(h(!0),E.trackDropdownOpen(p)):F()},[E,p,F]),q=t.useCallback((e,t)=>{E.trackSuggestionClick({suggestion:e,position:t,query:p,totalSuggestions:w.length}),B(e.query),P.current?.(e),E.trackSearchSubmit(e.query,!0,e),_(e.query),F(),L.current?.(e.query)},[E,p,w.length,_,F]),H=t.useCallback((e,t,r,a)=>{E.trackProductClick({product:e,position:t,section:r??"products",tabId:a,query:p}),F(),D.current?.(e)},[E,p,F]),O=t.useCallback(e=>{E.trackRecentSearchClick(e),B(e.query),F(),L.current?.(e.query),E.trackSearchSubmit(e.query,!1)},[E,F]),j=t.useCallback((e,t)=>{E.trackTrendingClick(e,t),B(e.query),F(),L.current?.(e.query),E.trackSearchSubmit(e.query,!1)},[E,F]),V=t.useCallback(e=>{x(e.id),E.trackTabSelect(e,p)},[E,p]),U=t.useCallback((e,t,r)=>{const a=e.trim();a&&(E.trackSearchSubmit(a,!!t,r),_(a),F(),L.current?.(a))},[E,_,F]),Q=t.useCallback(()=>{const e=A();0!==e.length&&b(t=>t<e.length-1?t+1:0)},[A]),G=t.useCallback(()=>{const e=A();0!==e.length&&b(t=>t<=0?e.length-1:t-1)},[A]),X=t.useCallback(()=>{const e=A();if(y<0||y>=e.length)return void U(p);const t=e[y];switch(t.type){case"suggestion":q(t.data,t.index);break;case"product":H(t.data,t.index,"products");break;case"recent":O(t.data);break;case"trending":j(t.data,t.index);break;default:U(p)}},[y,A,p,U,q,H,O,j]);t.useEffect(()=>{f&&M&&p&&E.trackImpression({suggestions:w,products:I,query:p,timestamp:Date.now()})},[f,M,p,w,I,E]);const Y=t.useMemo(()=>({query:p,setQuery:B,isOpen:f,setIsOpen:W,activeIndex:y,setActiveIndex:b,suggestions:w,recentSearches:C,trendingSearches:R,trendingProducts:I,filteredTabs:N,activeTabId:v,setActiveTabId:x,loading:T,error:z,hasContent:M,getAllNavigableItems:A,selectSuggestion:q,selectProduct:H,selectRecentSearch:O,selectTrendingSearch:j,setActiveTab:V,submitSearch:U,close:F,navigateNext:Q,navigatePrev:G,selectActive:X}),[p,B,f,W,y,b,w,C,R,I,N,v,x,T,z,M,A,q,H,O,j,V,U,F,Q,G,X]);return t.createElement(xe.Provider,{value:Y},e)}const Se={position:"relative",width:"100%"},we={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:"var(--seekora-bg-surface, #fff)",transition:"border-color 150ms ease, box-shadow 150ms ease"},Ce={flex:1,minWidth:0,padding:"8px 0",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"inherit",color:"var(--seekora-text-primary, #111827)",fontFamily:"inherit"};function Re({placeholder:e="Search...",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:m,isOpen:p,setIsOpen:g,navigateNext:f,navigatePrev:h,selectActive:y,close:b}=ke(),v=t.useRef(null),x=t.useCallback(()=>{g(!0)},[g]),k=t.useCallback(()=>{o&&setTimeout(()=>b(),200)},[b,o]),E=t.useCallback(e=>{m(e.target.value)},[m]),S=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]),w=t.useCallback(()=>{m(""),v.current?.focus()},[m]);return t.createElement("div",{className:I("seekora-suggestions-search-input-wrapper",s),style:{...Se,...i}},t.createElement("div",{className:"seekora-suggestions-input-wrapper",style:we},n?t.createElement("span",{className:"seekora-suggestions-input-left-icon",style:{display:"flex",flexShrink:0,color:"var(--seekora-text-secondary, #6b7280)"}},n):null,t.createElement("input",{ref:v,type:"text",value:u,onChange:E,onFocus:x,onBlur:k,onKeyDown:S,placeholder:e,autoFocus:r,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":d,"aria-expanded":p,"aria-haspopup":"listbox","aria-autocomplete":"list",role:"combobox",className:I("seekora-suggestions-input",l),style:{...Ce,...c}}),a&&u?t.createElement("button",{type:"button",onClick:w,className:"seekora-suggestions-input-clear","aria-label":"Clear search",style:{padding:4,border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-secondary, #6b7280)",display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(Ie,null)):null))}function Ie(){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"}))}function Ne({children:e,position:r="absolute",top:a="100%",left:o=0,right:n,width:s="100%",maxHeight:i="80vh",zIndex:l=1e3,className:c,style:d,closeOnClickOutside:u=!0,closeOnEscape:m=!0}){const{isOpen:p,close:g}=ke(),f=t.useRef(null);t.useEffect(()=>{if(!m||!p)return;const e=e=>{"Escape"===e.key&&g()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[m,p,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(p)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[p,h]),!p)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, 6px)",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 Te={backgroundColor:"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))",fontWeight:500,borderRadius:"2px",padding:"0 2px"};function ze(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}=r;return t.createElement(t.Fragment,null,a.map((e,r)=>{const a=e.match(/^<mark>([\s\S]*)<\/mark>$/);return a?t.createElement("mark",{key:r,className:o,style:{...Te,...n}},a[1]):e}))}const Me={padding:"10px 12px",cursor:"pointer",listStyle:"none",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"var(--seekora-text-primary, #111827)",transition:"background-color 120ms ease"};function Ae({suggestion:e,index:r,isActive:a,onSelect:o,className:n,style:s,enableHighlightMarkup:i=!0,highlightMarkupOptions:l,renderHighlight:c}){const d=e.highlightedQuery??e.query,u=null!=c?c(d):i?ze(d??"",l):e.query??d??"";return t.createElement("li",{role:"option","aria-selected":a,id:`seekora-suggestion-${r}`,className:I("seekora-suggestions-item",a&&"seekora-suggestions-item--active",n),style:{...Me,...a?{backgroundColor:"var(--seekora-bg-hover, #f3f4f6)"}:{},...s},onMouseDown:e=>{e.preventDefault(),o()}},u,null!=e.count?t.createElement("span",{className:"seekora-suggestions-item-count",style:{marginLeft:8,color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875em"}},e.count):null)}function _e({className:e,style:r,text:a="Loading..."}){const{loading:o}=ke();return o?t.createElement("div",{className:I("seekora-suggestions-loading",e),style:{padding:16,color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875rem",...r}},a):null}const Le={margin:0,padding:"4px 0"};function Pe({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:m}=ke(),p=l.slice(0,e),g=m().findIndex(e=>"suggestion"===e.type),f=g>=0&&c>=g&&c<g+p.length;return d?t.createElement(_e,{className:r,style:a}):0===p.length?null:t.createElement("div",{className:I("seekora-suggestions-list",r),style:a},t.createElement("ul",{className:I("seekora-suggestions-list-ul",o),style:Le,role:"listbox"},p.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(Ae,{key:e.objectID??e.query??r,suggestion:e,index:a,isActive:o,onSelect:l,enableHighlightMarkup:n,highlightMarkupOptions:s})})))}function De({src:e,alt:r="",mode:a="both",zoomLevel:o=2.5,className:n,style:s,showZoomIndicator:i=!0,lensSize:l=150,zoomPanelSize:c={width:400,height:400},images:d,currentIndex:u=0}){const[m,p]=t.useState(!1),[g,f]=t.useState(!1),[h,y]=t.useState(u),[b,v]=t.useState({x:0,y:0}),[x,k]=t.useState(!1),[E,S]=t.useState(null),[w,C]=t.useState(null),R=t.useRef(null),N=t.useRef(null),T=d&&d.length>0?d:[e],z=T.length>1,M="hover"===a||"both"===a,A="click"===a||"both"===a,_="lens"===a,L=t.useCallback(e=>{if(!N.current)return;const t=N.current.getBoundingClientRect(),r=e.clientX-t.left,a=e.clientY-t.top;v({x:r,y:a})},[]),P=t.useCallback(()=>{p(!0)},[]),D=t.useCallback(()=>{p(!1)},[]),B=t.useCallback(e=>{A&&(e?.stopPropagation(),y(u),f(!0))},[A,u]),$=t.useCallback(e=>{e?.stopPropagation(),f(!1)},[]),F=t.useCallback(()=>{y(e=>(e+1)%T.length)},[T.length]),W=t.useCallback(()=>{y(e=>(e-1+T.length)%T.length)},[T.length]),q=t.useCallback(e=>{C(null),S(e.targetTouches[0].clientX)},[]),H=t.useCallback(e=>{C(e.targetTouches[0].clientX)},[]),O=t.useCallback(()=>{if(!E||!w)return;const e=E-w,t=e<-50;e>50?F():t&&W()},[E,w,50,F,W]);t.useEffect(()=>{if(!g)return;const e=e=>{"Escape"===e.key&&$(),z&&("ArrowRight"===e.key&&F(),"ArrowLeft"===e.key&&W())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,$,z,F,W]);const j={position:"relative",display:"inline-block",cursor:A?"zoom-in":M||_?"crosshair":"default",overflow:"hidden",...s};return t.createElement(t.Fragment,null,t.createElement("div",{ref:N,className:I("seekora-image-zoom",n),style:j,onMouseMove:L,onMouseEnter:P,onMouseLeave:D,onClick:B},t.createElement("img",{ref:R,src:e,alt:r,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onLoad:()=>k(!0)}),i&&A&&t.createElement("div",{style:{position:"absolute",top:8,right:8,width:32,height:32,borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.6)",color:"#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:N.current?{position:"absolute",width:l,height:l,left:b.x-l/2,top:b.y-l/2,border:"2px solid rgba(255,255,255,0.8)",borderRadius:"50%",boxShadow:"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(!N.current||!R.current)return{};const e=N.current.getBoundingClientRect();return R.current.getBoundingClientRect(),{position:"absolute",width:e.width*o,height:e.height*o,left:-(b.x*o-l/2),top:-(b.y*o-l/2),objectFit:"cover"}})()})),M&&m&&x&&N.current&&t.createElement("div",{style:{position:"absolute",left:b.x-75,top:b.y-75,width:150,height:150,border:"2px solid rgba(0,0,0,0.3)",backgroundColor:"rgba(255,255,255,0.1)",pointerEvents:"none",zIndex:50}}),M&&m&&x&&t.createElement("div",{style:(()=>{if(!N.current||!x)return{display:"none"};const t=N.current.getBoundingClientRect(),r=b.x/t.width*100,a=b.y/t.height*100;return{position:"fixed",top:t.top,left:t.right+16,width:c.width,height:c.height,backgroundImage:`url(${e})`,backgroundSize:100*o+"%",backgroundPosition:`${r}% ${a}%`,backgroundRepeat:"no-repeat",border:"2px solid var(--seekora-border-color, #e5e7eb)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.2)",backgroundColor:"#fff",pointerEvents:"none",zIndex:9998}})()})),g&&t.createElement("div",{className:"seekora-image-zoom-lightbox",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.95)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out",padding:20},onClick:$,onTouchStart:z?q:void 0,onTouchMove:z?H:void 0,onTouchEnd:z?O: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:"rgba(255,255,255,0.2)",color:"#fff",fontSize:"1.5rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),$()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.3)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.2)"}},"✕"),z&&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:"rgba(255,255,255,0.2)",color:"#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="rgba(255,255,255,0.3)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="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:"rgba(255,255,255,0.2)",color:"#fff",fontSize:"2rem",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),F()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.3)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.2)"}},"›")),t.createElement("img",{src:T[h],alt:r,style:{maxWidth:"90%",maxHeight:"90%",objectFit:"contain",borderRadius:4,cursor:"default"},onClick:e=>e.stopPropagation()}),z&&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(),y(r)},style:{width:60,height:60,padding:0,border:r===h?"3px solid #fff":"2px solid rgba(255,255,255,0.3)",borderRadius:4,overflow:"hidden",cursor:"pointer",opacity:r===h?1:.6,transition:"all 150ms ease",flexShrink:0,background:"none"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{r!==h&&(e.currentTarget.style.opacity="0.6")}},t.createElement("img",{src:e,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})))),t.createElement("div",{style:{color:"rgba(255,255,255,0.9)",fontSize:"0.875rem",textAlign:"center",backgroundColor:"rgba(0,0,0,0.5)",padding:"4px 12px",borderRadius:12}},h+1," / ",T.length)),t.createElement("div",{style:{position:"absolute",top:20,left:"50%",transform:"translateX(-50%)",color:"rgba(255,255,255,0.7)",fontSize:"0.875rem",textAlign:"center",backgroundColor:"rgba(0,0,0,0.5)",padding:"8px 16px",borderRadius:12}},z?"Use arrow keys or click thumbnails to navigate • ESC to close":"Click outside or press ESC to close")))}const Be={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"};function $e({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[m,p]=t.useState(0),[g,f]=t.useState(!1),h=Array.isArray(e)?e.filter(Boolean):[],y=h[m]??h[0];if(0===h.length)return t.createElement("div",{className:I("seekora-img-display","seekora-img-placeholder",o),style:{...Be,...n},"aria-hidden":!0});if("single"===r)return l?t.createElement(De,{src:h[0],alt:a,mode:c,zoomLevel:d,images:h,currentIndex:0,className:I("seekora-img-display","seekora-img-single",o),style:{...Be,...n}}):t.createElement("img",{src:h[0],alt:a,className:I("seekora-img-display","seekora-img-single",o),style:{...Be,...n},loading:"lazy"});if("hover"===r){const e=h.length>1&&g,r=e?h[1]:h[0],s=n?.aspectRatio?{...Be,aspectRatio:n.aspectRatio}:Be;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(De,{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=>{p(t=>{const r=t+e;return r<0?h.length-1:r>=h.length?0:r})},r=n?.aspectRatio?{...Be,aspectRatio:n.aspectRatio}:Be,s=l?t.createElement(De,{src:y,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:m,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:Fe(!0),onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),e(-1)},onClick:e=>e.stopPropagation(),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.9)"}},"‹"),t.createElement("button",{type:"button","aria-label":"Next",className:"seekora-img-carousel-next",style:Fe(!1),onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),e(1)},onClick:e=>e.stopPropagation(),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.9)"}},"›"),u&&t.createElement("div",{className:"seekora-img-carousel-dots",style:{position:"absolute",bottom:8,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,padding:"6px 12px",backgroundColor:"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(),p(r)},style:{width:8,height:8,borderRadius:"50%",border:"none",padding:0,backgroundColor:r===m?"#fff":"rgba(255,255,255,0.5)",cursor:"pointer",transition:"all 150ms ease"}})))))}if("thumbStrip"===r||"thumbList"===r){const e=n?.aspectRatio?{...Be,aspectRatio:n.aspectRatio}:Be,r=l?t.createElement(De,{src:y,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:m,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:8,...n}},r,t.createElement("div",{className:"seekora-img-thumbs",style:{display:"flex",gap:4,overflowX:"auto",paddingBottom:4}},h.map((e,r)=>t.createElement("button",{type:"button",key:r,className:I("seekora-img-thumb",r===m&&"seekora-img-thumb--active"),style:{flexShrink:0,width:48,height:48,padding:0,border:r===m?"2px solid var(--seekora-primary)":"1px solid transparent",borderRadius:4,overflow:"hidden",cursor:"pointer",background:"none"},onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),p(r)},onClick:e=>e.stopPropagation()},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:{...Be,...n},loading:"lazy"})}function Fe(e){return{position:"absolute",top:"50%",[e?"left":"right"]:8,transform:"translateY(-50%)",width:32,height:32,borderRadius:"50%",border:"none",backgroundColor:"rgba(255, 255, 255, 0.9)",color:"#111",fontSize:"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 We={addToCart:"🛒",wishlist:"♡",buyNow:"⚡",quickView:"👁",compare:"⚖"},qe={addToCart:"Add to Cart",wishlist:"Wishlist",buyNow:"Buy Now",quickView:"Quick View",compare:"Compare"},He={small:{width:28,height:28,fontSize:"0.75rem",iconSize:"1rem"},medium:{width:36,height:36,fontSize:"0.875rem",iconSize:"1.25rem"},large:{width:44,height:44,fontSize:"1rem",iconSize:"1.5rem"}};function Oe({buttons:e,layout:r="horizontal",position:a="inline",showLabels:o=!1,size:n="medium",className:s,style:i}){const l=He[n],c={display:"flex",flexDirection:"vertical"===r?"column":"row",gap:6,..."inline"!==a?{position:"absolute",..."top-right"===a?{top:8,right:8}:{},..."bottom-center"===a?{bottom:8,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:6,backgroundColor:"var(--seekora-bg-surface, #fff)",color:"var(--seekora-text, #111827)",cursor:"pointer",transition:"all 150ms ease",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"};return t.createElement("div",{className:I("seekora-action-buttons",`seekora-action-buttons--${r}`,s),style:c},e.map((e,r)=>{const a=e.icon??We[e.type],n=e.label??qe[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 je={display:"flex",flexDirection:"column",gap:8,padding:8,cursor:"pointer",border:"none",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:"transparent",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",transition:"background-color 120ms ease"},Ve={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"};function Ue({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 m=e.images?.length?e.images:e.image??e.imageUrl?[String(e.image??e.imageUrl)]:[],p=e.title??e.primaryText??"",g=e.description??e.secondaryText,f=e.url,h="horizontal"===l,y=m.length>0?t.createElement("div",{style:{position:"relative",...h?{width:80,flexShrink:0}:{}}},t.createElement($e,{images:m,variant:i,alt:String(p),className:"seekora-item-card-image"}),c&&c.length>0&&d?.startsWith("overlay")&&t.createElement(Oe,{buttons:c,position:"overlay-top-right"===d?"top-right":"bottom-center",showLabels:u,size:"small"})):t.createElement("div",{className:"seekora-item-card-placeholder",style:{...Ve,...h?{width:80,height:80,flexShrink:0}:{}},"aria-hidden":!0}),b=t.createElement("div",{style:h?{display:"flex",flexDirection:"column",gap:4,flex:1,minWidth:0}:void 0},t.createElement("span",{className:"seekora-item-card-title",style:{fontSize:"0.875rem",fontWeight:500}},String(p)),g?t.createElement("span",{className:"seekora-item-card-description",style:{fontSize:"0.8125rem",color:"var(--seekora-text-secondary, #6b7280)",lineHeight:1.3}},String(g)):null,c&&c.length>0&&"inline"===d&&t.createElement(Oe,{buttons:c,position:"inline",showLabels:u,size:"small",layout:"horizontal"})),v=h?t.createElement("div",{style:{display:"flex",gap:12,alignItems:"flex-start"}},y,b):t.createElement(t.Fragment,null,y,b),x={className:I("seekora-item-card",h&&"seekora-item-card--horizontal",o),style:{...je,...h?{flexDirection:"row"}:{},...n},"data-position":r,onClick:a,onMouseDown:a?e=>{e.preventDefault(),a()}:void 0};return s&&f?t.createElement("a",{href:f,...x,"data-item-id":e.id},v):t.createElement("button",{type:"button",...x,"data-item-id":e.id},v)}const Qe={display:"grid",gridTemplateColumns:"repeat(var(--seekora-grid-cols, 4), minmax(0, 1fr))",gap:12,padding:12};function Ge({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:m,gridClassName:p}){const g=e.slice(0,c);if(0===g.length)return null;const f={...Qe,gridTemplateColumns:`repeat(${d}, minmax(0, 1fr))`};return t.createElement("div",{className:I("seekora-item-grid",u),style:m},t.createElement("div",{className:I("seekora-item-grid-inner",p),style:f},g.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(Ue,{key:d.id,item:d,position:c,onSelect:r?()=>r(e,c):void 0})})))}const Xe=(e,t)=>{if(e&&t)return t.split(".").reduce((e,t)=>{if(null!=e)return e[t]},e)},Ye=(e,t={query:"query"})=>({query:Xe(e,t.query)??"",count:t.count?Xe(e,t.count):void 0,id:t.id?Xe(e,t.id):e?.objectID||e?.id,categories:t.categories?Xe(e,t.categories):void 0,highlighted:t.highlighted?Xe(e,t.highlighted):void 0,_raw:e}),Ke=(e,t={id:"id",title:"title"})=>({id:Xe(e,t.id)??e?.objectID??e?.id,title:Xe(e,t.title)??"",image:t.image?Xe(e,t.image):void 0,price:t.price?Xe(e,t.price):void 0,comparePrice:t.comparePrice?Xe(e,t.comparePrice):void 0,url:t.url?Xe(e,t.url):void 0,brand:t.brand?Xe(e,t.brand):void 0,category:t.category?Xe(e,t.category):void 0,rating:t.rating?Xe(e,t.rating):void 0,reviewCount:t.reviewCount?Xe(e,t.reviewCount):void 0,discount:t.discount?Xe(e,t.discount):void 0,inStock:t.inStock?Xe(e,t.inStock):void 0,currency:t.currency?Xe(e,t.currency):void 0,images:t.images?Xe(e,t.images):e?.images,originalPrice:t.originalPrice?Xe(e,t.originalPrice):e?.original_price??e?.compare_at_price,available:t.available?Xe(e,t.available):e?.available,options:t.options?Xe(e,t.options):e?.options,variants:t.variants?Xe(e,t.variants):e?.variants,tags:t.tags?Xe(e,t.tags):e?.tags,_raw:e}),Ze=(e,t={id:"id",label:"label"})=>({id:Xe(e,t.id)??e?.id,label:Xe(e,t.label)??"",count:t.count?Xe(e,t.count):void 0,icon:t.icon?Xe(e,t.icon):void 0,image:t.image?Xe(e,t.image):void 0,_raw:e}),Je=(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}`},et=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(/[&<>"']/g,e=>t[e])},tt=(e,t,r={})=>{if(!t||!e)return et(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 et(e).replace(new RegExp(`(${et(s)})`,"gi"),`<${a}${l}${i}>$1</${a}>`)},rt=(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},at=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}},ot=(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}})},nt=(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,st=(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},it=(...e)=>e.filter(Boolean).join(" "),lt=(...e)=>Object.assign({},...e.filter(Boolean)),ct="seekora_recent_searches",dt=e=>{try{const t=e?`${ct}_${e}`:ct,r=localStorage.getItem(t);return r?JSON.parse(r):[]}catch{return[]}},ut=(e,t)=>{try{const r=t?`${ct}_${t}`:ct;let a=dt(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[]}},mt=(e,t)=>{try{const r=t?`${ct}_${t}`:ct;let a=dt(t);return a=a.filter(t=>t!==e),localStorage.setItem(r,JSON.stringify(a)),a}catch{return[]}},pt=(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 gt{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 ft=null;const ht=e=>(ft||(ft=new gt(e)),ft);function yt({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,m=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&&m>0&&t.createElement("span",{className:"seekora-price-discount",style:{color:"var(--seekora-error, #ef4444)",fontSize:"0.8125em",fontWeight:600}},"-",m,"%"))}const bt={"top-left":{position:"absolute",top:6,left:6},"top-right":{position:"absolute",top:6,right:6},"bottom-left":{position:"absolute",bottom:6,left:6},"bottom-right":{position:"absolute",bottom:6,right:6},inline:{}},vt={sale:{bg:"#ef4444",text:"#fff"},new:{bg:"#3b82f6",text:"#fff"},soldOut:{bg:"#6b7280",text:"#fff"},limited:{bg:"#f59e0b",text:"#fff"},custom:{bg:"#111827",text:"#fff"}};function xt({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:4,zIndex:1,...bt[a],...n}},s.map((e,r)=>{const a=vt[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:4,fontSize:"0.6875rem",fontWeight:600,lineHeight:1.4,backgroundColor:e.color??a.bg,color:e.textColor??a.text,whiteSpace:"nowrap"}},e.text)}))}const kt={small:14,medium:18,large:24},Et={small:"0.75rem",medium:"0.875rem",large:"1rem"};function St({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 wt({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:m="var(--seekora-text-secondary, #6b7280)",showReviewCount:p=!0,reviewCountFormat:g,className:f,style:h}){const[y,b]=t.useState(null),v=Math.max(0,Math.min(n,e)),x=l&&null!==y?y:v,k=kt[o],E=Et[o],S=e=>g?g(e):e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString(),w=()=>{const e=[];for(let r=1;r<=n;r++){const a=r<=Math.floor(x),o=i&&r===Math.ceil(x)&&x%1>=.25&&x%1<.75;e.push(t.createElement(St,{key:r,filled:a,half:o,size:k,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},w()):"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}},w()),s&&t.createElement("span",{className:"seekora-rating-numeric",style:{fontWeight:600,color:m}},v.toFixed(1)),p&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-count",style:{color:m}},"(",S(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}},w()),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:m}},"/ ",n)),p&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-text",style:{fontSize:"0.875em",color:m}},"Based on ",S(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}},w()),p&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-count",style:{color:m}},"(",S(r),")")):null}const Ct={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 Rt({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[m,p]=t.useState(new Set);if(!e||0===e.length)return null;const g=r?e.filter(e=>r.includes(e.name)):e;if(0===g.length)return null;return t.createElement("div",{className:I("seekora-variant-swatches",d),style:{display:"flex",flexDirection:"column",gap:4,...u}},g.map(r=>{const d=(e=>{const t=e.toLowerCase();return"color"===t||"colour"===t||"colors"===t||"colours"===t})(r.name),u=m.has(r.name),g=u?r.values:r.values.slice(0,a),f=r.values.length-a,h=f>0,y=n?.[r.name];return t.createElement("div",{key:r.name,className:"seekora-variant-swatch-group",style:{display:"flex",alignItems:"center",gap:4,flexWrap:"wrap"}},g.map(a=>{const u=d?((e,t)=>{if(t?.[e])return t[e];const r=e.toLowerCase();return t?.[r]?t[r]:Ct[r]??null})(a,o):null,m=y===a,p=!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",m&&"seekora-variant-swatch--selected",!p&&"seekora-variant-swatch--unavailable"),title:`${a}${p?"":" (Unavailable)"}`,style:{display:"inline-block",width:14,height:14,borderRadius:"50%",backgroundColor:u,border:m?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",outline:m?"2px solid var(--seekora-primary, #111827)":"none",outlineOffset:2,cursor:c&&p?"pointer":"not-allowed",flexShrink:0,boxShadow:m?"0 0 0 1px #fff":"none",opacity:p?1:.3,position:"relative"},onMouseEnter:()=>p&&l?.(r.name,a),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),p&&c?.(r.name,a)}},!p&&t.createElement("span",{style:{position:"absolute",top:"50%",left:"-2px",right:"-2px",height:1,backgroundColor:"#ef4444",transform:"translateY(-50%) rotate(-45deg)"}})):t.createElement("span",{key:a,className:I("seekora-variant-swatch","seekora-variant-swatch--text",m&&"seekora-variant-swatch--selected",!p&&"seekora-variant-swatch--unavailable"),style:{display:"inline-block",padding:"1px 6px",fontSize:"0.6875rem",borderRadius:3,border:m?"1px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:m?"var(--seekora-primary, #111827)":"transparent",color:m?"#fff":"var(--seekora-text-secondary, #6b7280)",cursor:c&&p?"pointer":"not-allowed",whiteSpace:"nowrap",fontWeight:m?600:400,opacity:p?1:.4,textDecoration:p?"none":"line-through"},onMouseEnter:()=>p&&l?.(r.name,a),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),p&&c?.(r.name,a)}},a)}),h&&t.createElement("button",{type:"button",className:"seekora-variant-swatch--overflow",onClick:e=>((e,t)=>{t.stopPropagation(),p(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})})(r.name,e),style:{fontSize:"0.6875rem",color:"var(--seekora-primary, #2563eb)",background:"none",border:"none",padding:0,cursor:"pointer",textDecoration:"underline",fontWeight:500}},u?"Show less":`+${f} more`))}))}const It={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"};function Nt({images:e,title:r,imageVariant:a,aspectRatio:o,enableZoom:n,zoomMode:s,zoomLevel:i}){const l=o?o.replace(":","/"):"1";return e.length>0?t.createElement("div",{className:"seekora-product-card__image",style:{position:"relative",overflow:"hidden",borderRadius:4}},t.createElement($e,{images:e,variant:e.length>1?a:"single",alt:r,className:"seekora-suggestions-product-card-image",style:{aspectRatio:l},enableZoom:n,zoomMode:s,zoomLevel:i})):t.createElement("div",{className:"seekora-product-card__image seekora-suggestions-product-card-placeholder",style:{...It,aspectRatio:l},"aria-hidden":!0})}function Tt({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(Nt,{images:e,title:r,imageVariant:n,aspectRatio:s.imageAspectRatio,enableZoom:i,zoomMode:l,zoomLevel:c}),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500}},r),null!=a&&!Number.isNaN(a)&&t.createElement("span",{className:"seekora-product-card__price seekora-suggestions-product-card-price",style:{fontSize:"0.875rem",color:"var(--seekora-text-secondary, #6b7280)"}},o.currency??"$",a.toFixed(2)))}function zt({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,options:i,variants:l,product:c,imageVariant:d,displayConfig:u,onVariantHover:m,onVariantClick:p,selectedVariants:g,actionButtons:f,actionButtonsPosition:h,showActionLabels:y,enableImageZoom:b,imageZoomMode:v,imageZoomLevel:x}){const k=u;return t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"}},t.createElement(Nt,{images:e,title:r,imageVariant:d,aspectRatio:k.imageAspectRatio,enableZoom:b,zoomMode:v,zoomLevel:x}),!1!==k.showBadges&&s.length>0&&t.createElement(xt,{badges:s,position:"top-left",maxBadges:2}),f&&f.length>0&&h?.startsWith("overlay")&&t.createElement(Oe,{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:4}},!1!==k.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:"0.75rem",color:"var(--seekora-text-secondary, #6b7280)",textTransform:"uppercase",letterSpacing:"0.02em"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500}},r),t.createElement("div",{className:"seekora-product-card__price"},t.createElement(yt,{price:a??void 0,comparePrice:o??void 0,currency:k.currency??c.currency,currencyPosition:k.currencyPosition,priceDecimals:k.priceDecimals,showDiscount:k.showDiscount,style:{fontSize:"0.875rem"}})),!1!==k.showVariants&&i.length>0&&t.createElement(Rt,{options:i,visibleOptions:k.variantOptionsToShow,maxValues:k.maxVariantValues,selectedValues:g,variants:l,onSwatchHover:m,onSwatchClick:p}),f&&f.length>0&&"inline"===h&&t.createElement(Oe,{buttons:f,position:"inline",showLabels:y,size:"small",layout:"horizontal"})))}function Mt({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,priceRange:i,options:l,variants:c,product:d,imageVariant:u,displayConfig:m,onVariantHover:p,onVariantClick:g,selectedVariants:f,actionButtons:h,actionButtonsPosition:y,showActionLabels:b,enableImageZoom:v,imageZoomMode:x,imageZoomLevel:k}){const E=m,S=d.available;return t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"}},t.createElement(Nt,{images:e,title:r,imageVariant:u,aspectRatio:E.imageAspectRatio,enableZoom:v,zoomMode:x,zoomLevel:k}),!1!==E.showBadges&&s.length>0&&t.createElement(xt,{badges:s,position:"top-left"}),h&&h.length>0&&y?.startsWith("overlay")&&t.createElement(Oe,{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:"var(--seekora-text-secondary, #6b7280)",textTransform:"uppercase",letterSpacing:"0.02em"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500}},r),!1!==E.showRating&&null!=d.rating&&t.createElement(wt,{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(yt,{priceRange:i,currency:E.currency??d.currency,currencyPosition:E.currencyPosition,priceDecimals:E.priceDecimals,style:{fontSize:"0.875rem"}}):t.createElement(yt,{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(Rt,{options:l,visibleOptions:E.variantOptionsToShow,maxValues:E.maxVariantValues,selectedValues:f,variants:c,onSwatchHover:p,onSwatchClick:g}),!1!==E.showStock&&null!=S&&t.createElement("span",{className:"seekora-product-card__stock",style:{fontSize:"0.75rem",color:S?"var(--seekora-success, #22c55e)":"var(--seekora-error, #ef4444)"}},S?"In Stock":"Out of Stock"),h&&h.length>0&&"inline"===y&&t.createElement(Oe,{buttons:h,position:"inline",showLabels:b,size:"small",layout:"horizontal"})))}function At({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(Nt,{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:"var(--seekora-text-secondary, #6b7280)"}},o.currency??"$",a.toFixed(2)))}function _t({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,options:i,variants:l,product:c,imageVariant:d,displayConfig:u,onVariantHover:m,onVariantClick:p,selectedVariants:g,actionButtons:f,actionButtonsPosition:h,showActionLabels:y,enableImageZoom:b,imageZoomMode:v,imageZoomLevel:x}){const k=u;return t.createElement("div",{style:{display:"flex",gap:12,alignItems:"flex-start"}},t.createElement("div",{style:{position:"relative",width:80,flexShrink:0}},t.createElement(Nt,{images:e,title:r,imageVariant:d,aspectRatio:"1:1",enableZoom:b,zoomMode:v,zoomLevel:x}),!1!==k.showBadges&&s.length>0&&t.createElement(xt,{badges:s,position:"top-left",maxBadges:1}),f&&f.length>0&&h?.startsWith("overlay")&&t.createElement(Oe,{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:4,flex:1,minWidth:0}},!1!==k.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:"0.75rem",color:"var(--seekora-text-secondary, #6b7280)",textTransform:"uppercase"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500}},r),t.createElement("div",{className:"seekora-product-card__price"},t.createElement(yt,{price:a??void 0,comparePrice:o??void 0,currency:k.currency??c.currency,currencyPosition:k.currencyPosition,priceDecimals:k.priceDecimals,showDiscount:k.showDiscount,style:{fontSize:"0.875rem"}})),!1!==k.showVariants&&i.length>0&&t.createElement(Rt,{options:i,visibleOptions:k.variantOptionsToShow,maxValues:k.maxVariantValues??3,selectedValues:g,variants:l,onSwatchHover:m,onSwatchClick:p}),f&&f.length>0&&"inline"===h&&t.createElement(Oe,{buttons:f,position:"inline",showLabels:y,size:"small",layout:"horizontal"})))}const Lt={display:"flex",flexDirection:"column",gap:8,padding:8,cursor:"pointer",border:"none",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:"transparent",textAlign:"left",transition:"background-color 120ms ease"},Pt={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"};function Dt({product:e,position:r,section:a,tabId:o,onSelect:n,className:s,style:i,imageVariant:l="single",displayConfig:c,onVariantHover:d,onVariantClick:u,selectedVariants:m,asLink:p,actionButtons:g,actionButtonsPosition:f="overlay-top-right",showActionLabels:h=!1,enableImageZoom:y=!1,imageZoomMode:b="both",imageZoomLevel:v=2.5}){const x=t.useMemo(()=>m&&e.options&&e.variants?nt(e.options,e.variants,m):null,[m,e.options,e.variants]),k=t.useMemo(()=>x?.image?[x.image]:e.images?.length?e.images:e.image??e.imageUrl?[String(e.image??e.imageUrl)]:[],[x,e]),E=t.useMemo(()=>x?.title&&x.title!==e.title?`${e.title??e.name??""} - ${x.title}`:e.title??e.name??"",[x,e]),S=t.useMemo(()=>{const t=x?.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},[x,e.price]),w=t.useMemo(()=>{const t=x?.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},[x,e]),C=k,R=E,N=S;if(!c)return t.createElement("button",{type:"button",className:I("seekora-suggestions-product-card",s),style:{...Lt,...i},onMouseDown:e=>{e.preventDefault(),n()},"data-position":r,"data-section":a,"data-tab-id":o},C.length>0?t.createElement($e,{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:Pt,"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:"var(--seekora-text-secondary, #6b7280)"}},e.currency??"$",N.toFixed(2)));const T=c.style??"minimal",z=w,M=e.brand??null,A=e.options??[],_=e.variants??[],L=t.useMemo(()=>!1===c.showBadges?[]:c.badgeExtractor?c.badgeExtractor(e.tags,e):rt(e.tags,e),[c,e]),P=t.useMemo(()=>c.showPriceRange?at(e.variants):null,[c.showPriceRange,e.variants]),D={product:e,images:C,title:R,price:N,comparePrice:z,brand:M,badges:L,priceRange:P,options:A,variants:_,displayConfig:c,imageVariant:l,onVariantHover:d,onVariantClick:u,selectedVariants:m,actionButtons:g,actionButtonsPosition:f,showActionLabels:h,enableImageZoom:y,imageZoomMode:b,imageZoomLevel:v},B={minimal:Tt,standard:zt,detailed:Mt,compact:At,horizontal:_t}[T]??Tt,$=I("seekora-product-card",`seekora-product-card--${T}`,"seekora-suggestions-product-card",s),F={...Lt,..."horizontal"===T?{flexDirection:"row"}:{},...i};return p&&e.url?t.createElement("a",{href:e.url,className:$,style:{...F,textDecoration:"none",color:"inherit"},onClick:e=>{e.preventDefault(),n()},"data-position":r,"data-section":a,"data-tab-id":o},t.createElement(B,{...D})):t.createElement("button",{type:"button",className:$,style:F,onMouseDown:e=>{e.preventDefault(),n()},"data-position":r,"data-section":a,"data-tab-id":o},t.createElement(B,{...D}))}function Bt({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:m,getAllNavigableItems:p}=ke(),g=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),f=p().findIndex(e=>"product"===e.type);if(0===g.length)return null;const h={display:"grid",gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`,gap:12,padding:12};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:h},g.map((e,a)=>{const o=f>=0?f+a:a,n="trending"===r?"products":"filtered_tab",s="trending"!==r?"tab"===r?u:r:void 0;return t.createElement(Dt,{key:e.id??e.objectID??a,product:e,position:o,section:n,tabId:s,onSelect:()=>m(e,o,n,s),displayConfig:i,onVariantHover:l})})))}function $t({className:e,style:r,tabClassName:a}){const{filteredTabs:o,activeTabId:n,setActiveTab:s}=ke();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)":"var(--seekora-text-primary, #111827)",cursor:"pointer",fontSize:"0.875rem",fontWeight:r?600:400,whiteSpace:"nowrap",transition:"background-color 120ms ease"},onClick:()=>s(e)},e.label)}))}const Ft={padding:"10px 12px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"var(--seekora-text-primary, #111827)",transition:"background-color 120ms ease"};function Wt({title:e="Recent",maxItems:r=8,className:a,style:o,listClassName:n,renderItem:s}){const{recentSearches:i,query:l,selectRecentSearch:c}=ke(),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:"var(--seekora-text-secondary, #6b7280)",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("li",{key:`${e.query}-${e.timestamp}`},t.createElement("button",{type:"button",className:"seekora-suggestions-recent-item",style:Ft,onMouseDown:e=>{e.preventDefault(),a()}},e.query))})))}const qt={padding:"10px 12px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"var(--seekora-text-primary, #111827)",transition:"background-color 120ms ease"};function Ht({title:e="Trending",maxItems:r=8,className:a,style:o,listClassName:n,renderItem:s}){const{trendingSearches:i,selectTrendingSearch:l}=ke(),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:"var(--seekora-text-secondary, #6b7280)",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("li",{key:`${e.query}-${r}`},t.createElement("button",{type:"button",className:"seekora-suggestions-trending-item",style:qt,onMouseDown:e=>{e.preventDefault(),a()}},e.query,null!=e.count?t.createElement("span",{style:{marginLeft:8,color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875em"}},e.count):null))})))}function Ot({className:e,style:r,render:a}){const{error:o}=ke();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 jt={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"},Vt=(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 Ut({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, #111827)"}},c.name,u&&t.createElement("span",{style:{fontWeight:400,marginLeft:6,color:"var(--seekora-text-secondary, #6b7280)"}},u)),"dropdown"===d?t.createElement("select",{className:"seekora-variant-dropdown",value:u??"",onChange:e=>{e.stopPropagation(),o(c.name,e.target.value)},onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),style:{padding:"8px 12px",fontSize:"0.875rem",borderRadius:6,border:"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:"var(--seekora-bg-surface, #fff)",color:"var(--seekora-text-primary, #111827)",cursor:"pointer",minWidth:120}},t.createElement("option",{value:""},"Select ",c.name),c.values.map(o=>{const n=!l||Vt(c.name,o,e,r,a);return t.createElement("option",{key:o,value:o,disabled:!n},o,n?"":" (Unavailable)")})):t.createElement("div",{className:"seekora-variant-buttons",style:{display:"flex",flexWrap:"wrap",gap:8}},c.values.map(n=>{const s=u===n,m=!l||Vt(c.name,n,e,r,a),p="swatch"===d?((e,t)=>{if(t?.[e])return t[e];const r=e.toLowerCase();return t?.[r]?t[r]:jt[r]??null})(n,i):null;return"swatch"===d&&p?t.createElement("button",{key:n,type:"button",className:I("seekora-variant-color-swatch",s&&"seekora-variant-button--active",!m&&"seekora-variant-button--unavailable"),title:n,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),o(c.name,n)},disabled:!m,style:{width:32,height:32,borderRadius:"50%",backgroundColor:p,border:s?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",outline:s?"2px solid var(--seekora-primary, #111827)":"none",outlineOffset:2,cursor:m?"pointer":"not-allowed",opacity:m?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",!m&&"seekora-variant-button--unavailable"),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),o(c.name,n)},disabled:!m,style:{padding:"6px 16px",fontSize:"0.875rem",borderRadius:6,border:s?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:s?"var(--seekora-primary, #111827)":"var(--seekora-bg-surface, #fff)",color:s?"#fff":"var(--seekora-text-primary, #111827)",cursor:m?"pointer":"not-allowed",opacity:m?1:.5,textDecoration:m?"none":"line-through",fontWeight:s?600:400,transition:"all 120ms ease"},"aria-label":`${c.name}: ${n}`,"aria-pressed":s},n)})))}))}const Qt=t.createContext(null);const Gt=t.createContext(null);function Xt(){const e=t.useContext(Gt);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 Yt({className:e,style:r,text:a="Loading..."}){const{loading:o}=Xt();return o?t.createElement("div",{className:e,style:{padding:16,color:"var(--seekora-text-secondary)",fontSize:"0.875rem",...r}},a):null}function Kt({className:e,style:r,render:a}){const{error:o}=Xt();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 Zt={xs:0,sm:480,md:768,lg:1024,xl:1280},Jt={xs:`@media (max-width: ${Zt.sm-1}px)`,sm:`@media (min-width: ${Zt.sm}px) and (max-width: ${Zt.md-1}px)`,md:`@media (min-width: ${Zt.md}px) and (max-width: ${Zt.lg-1}px)`,lg:`@media (min-width: ${Zt.lg}px) and (max-width: ${Zt.xl-1}px)`,xl:`@media (min-width: ${Zt.xl}px)`,mobile:`@media (max-width: ${Zt.md-1}px)`,tablet:`@media (min-width: ${Zt.md}px) and (max-width: ${Zt.lg-1}px)`,desktop:`@media (min-width: ${Zt.lg}px)`,touch:"@media (hover: none) and (pointer: coarse)",mouse:"@media (hover: hover) and (pointer: fine)"},er={minimum:44,comfortable:48,large:56},tr=()=>{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<Zt.sm?"xs":e<Zt.md?"sm":e<Zt.lg?"md":e<Zt.xl?"lg":"xl")(e),o="ontouchstart"in window||navigator.maxTouchPoints>0;r({isMobile:e<Zt.md,isTablet:e>=Zt.md&&e<Zt.lg,isDesktop:e>=Zt.lg,isTouch:o,width:e,height:t,breakpoint:a})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e};let rr=!1;const ar=()=>{if(rr)return;if("undefined"==typeof document)return;const e="seekora-dropdown-responsive-global";if(document.getElementById(e))return void(rr=!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),rr=!0},or=()=>{t.useEffect(()=>{ar()},[])},nr=(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?`${er.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)"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"40px",color:"var(--seekora-text-secondary, #565959)",gap:"10px"},spinner:{width:"20px",height:"20px",border:"2px solid var(--seekora-border-color, #ddd)",borderTopColor:"var(--seekora-primary, #f90)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},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"}}),sr=()=>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"})),ir=()=>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"})),lr=()=>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"})),cr=({rating:e,count:r})=>{const a=Math.floor(e),o=e%1>=.5;return t.createElement("div",{style:nr().productRating},t.createElement("div",{style:nr().stars},"★".repeat(a),o&&"½","☆".repeat(5-a-(o?1:0))),void 0!==r&&t.createElement("span",{style:nr().reviewCount},"(",r.toLocaleString(),")"))},dr=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:m="all",suggestionFields:p={query:"query"},productFields:g={id:"id",title:"title"},categoryFields:f={id:"id",label:"label"},productDisplay:h={},theme:y={},showDepartments:b=!0,currentDepartment:v,departments:x=[],showPrime:k=!1,width:E="700px",maxHeight:S="500px",zIndex:w=1e3,className:C,style:R,classNames:I={},onSuggestionSelect:N,onProductClick:T,onCategoryClick:z,onTabChange:M,onRecentClick:A,onRecentRemove:_,onRecentClearAll:L,onViewAll:P,onClose:D,header:B,footer:$,renderLoading:F,renderEmpty:W}=e;or();const q=tr(),{isMobile:H,isTablet:O}=q,j=t.useMemo(()=>nr(y,H),[y,H]),V=t.useRef(null),[U,Q]=t.useState(-1),[G,X]=t.useState(null),Y=t.useMemo(()=>s.map(e=>Ye(e,p)),[s,p]),K=t.useMemo(()=>{if("all"===m||0===u.length)return i;const e=u.find(e=>e.id===m);return e?.products||i},[m,u,i]),Z=t.useMemo(()=>K.map(e=>Ke(e,g)),[K,g]);t.useMemo(()=>l.map(e=>Ze(e,f)),[l,f]);const J=t.useMemo(()=>c.map(e=>"string"==typeof e?e:e.query),[c]),ee=t.useMemo(()=>{const e=[];let t=0;return 0===a.length&&J.slice(0,5).forEach(r=>{e.push({type:"recent",data:r,index:t++})}),Y.forEach(r=>{e.push({type:"suggestion",data:r,index:t++})}),e},[a,J,Y]),te=t.useCallback(()=>{Q(e=>Math.min(e+1,ee.length-1))},[ee.length]),re=t.useCallback(()=>{Q(e=>Math.max(e-1,-1))},[]),ae=t.useCallback(()=>{if(U<0||U>=ee.length)return;const e=ee[U];"recent"===e.type?A?.(e.data):"suggestion"===e.type&&N?.(e.data._raw,e.index)},[U,ee,A,N]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>U,setActiveIndex:Q,selectActive:ae,navigateNext:te,navigatePrevious:re,focus:()=>V.current?.focus(),close:()=>D?.()}),[U,ae,te,re,D]),t.useEffect(()=>{if(U>=0&&V.current){const e=V.current.querySelector(`[data-index="${U}"]`);e&&pt(e,V.current)}},[U]),!o)return null;const oe=st(y),ne=0===a.length&&J.length>0,se=0===a.length&&d.length>0,ie=Z.length>0;return t.createElement("div",{ref:V,role:"listbox","aria-label":"Search suggestions",className:it("seekora-amazon-dropdown",C,I.root),style:lt(j.root,{width:H?"100%":E,maxHeight:H?"100vh":S,zIndex:w},oe,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 "),B,n?F?F():t.createElement("div",{style:j.loading},t.createElement("div",{style:j.spinner}),t.createElement("span",null,"Searching...")):t.createElement(t.Fragment,null,u.length>0&&t.createElement("div",{style:{display:"flex",gap:"8px",padding:H?"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"===m?"var(--seekora-text-primary, #232f3e)":"var(--seekora-bg-surface, #ffffff)",color:"all"===m?"var(--seekora-bg-surface, #ffffff)":"var(--seekora-text-primary, #0f1111)",borderRadius:"20px",fontSize:"13px",fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",minHeight:"36px",boxShadow:"all"===m?"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:m===e.id?"var(--seekora-primary, #ff9900)":"var(--seekora-bg-surface, #ffffff)",color:m===e.id?"var(--seekora-text-on-primary, #0f1111)":"var(--seekora-text-primary, #0f1111)",borderRadius:"20px",fontSize:"13px",fontWeight:m===e.id?700:500,cursor:"pointer",whiteSpace:"nowrap",minHeight:"36px",boxShadow:m===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:j.content},t.createElement("div",{style:j.leftColumn},ne&&t.createElement("div",{style:j.section},t.createElement("div",{style:j.recentHeader},t.createElement("span",{style:j.sectionHeader},"Recent Searches"),t.createElement("button",{style:j.clearRecent,onClick:L},"Clear all")),J.slice(0,5).map((e,r)=>{const a=U===r;return t.createElement("div",{key:`recent-${e}`,"data-index":r,role:"option","aria-selected":a,style:lt(j.suggestionItem,a?j.suggestionItemActive:void 0),onClick:()=>A?.(e),onMouseEnter:()=>Q(r)},t.createElement(ir,null),t.createElement("div",{style:j.suggestionContent},t.createElement("div",{style:j.suggestionQuery},e)))})),se&&t.createElement("div",{style:j.section},t.createElement("div",{style:j.sectionHeader},"Trending Searches"),d.slice(0,5).map((e,r)=>{const a="string"==typeof e?e:e.query,o=J.length+r,n=U===o;return t.createElement("div",{key:`trending-${a}`,"data-index":o,role:"option","aria-selected":n,style:lt(j.suggestionItem,n?j.suggestionItemActive:void 0),onClick:()=>N?.({query:a},r),onMouseEnter:()=>Q(o)},t.createElement(lr,null),t.createElement("div",{style:j.suggestionContent},t.createElement("div",{style:j.suggestionQuery},a)))})),Y.length>0&&t.createElement("div",{style:j.section},a&&t.createElement("div",{style:j.sectionHeader},"Suggestions"),Y.map((e,r)=>{const o=ne?J.length+r:r,n=U===o,s=(e.categories||[])[0];return t.createElement("div",{key:e.id||`suggestion-${r}`,"data-index":o,role:"option","aria-selected":n,style:lt(j.suggestionItem,n?j.suggestionItemActive:void 0),onClick:()=>N?.(e._raw,r),onMouseEnter:()=>Q(o)},t.createElement("div",{style:j.suggestionIcon},t.createElement(sr,null)),t.createElement("div",{style:j.suggestionContent},t.createElement("div",{style:j.suggestionQuery,dangerouslySetInnerHTML:{__html:tt(e.query,a,{className:"highlight"})}}),b&&s&&t.createElement("div",{style:j.suggestionContext},t.createElement("span",{style:j.suggestionDepartment},"in ","string"==typeof s?s:s.value||s.label))),e.count&&t.createElement("span",{style:j.categoryScoped},e.count.toLocaleString()))})),a&&0===Y.length&&!n&&(W?W(a):t.createElement("div",{style:j.empty},'No suggestions found for "',a,'"'))),ie&&t.createElement("div",{style:j.rightColumn},t.createElement("div",{style:j.productsHeader},t.createElement("span",{style:j.productsTitle},"Suggested Products"),t.createElement("a",{style:j.viewAll,onClick:()=>P?.("products")},"View all")),t.createElement("div",{style:j.productsGrid},Z.slice(0,4).map((e,r)=>t.createElement("div",{key:e.id,style:lt(j.productCard,G===e.id?j.productCardHover:void 0),onClick:()=>T?.(e._raw,r),onMouseEnter:()=>X(e.id),onMouseLeave:()=>X(null)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:j.productImage,loading:"lazy"}):t.createElement("div",{style:{...j.productImage,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement("span",{style:{color:"var(--seekora-text-tertiary, #999)",fontSize:"32px"}},"📷")),t.createElement("div",{style:j.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:j.productPrice},t.createElement("span",{style:j.productPriceSymbol},h.currency||"$"),Je(e.price,{currency:"",priceDecimals:h.priceDecimals})),e.rating&&t.createElement(cr,{rating:parseFloat(String(e.rating)),count:e.reviewCount?parseInt(String(e.reviewCount)):void 0}))))))),void 0!==$?$:t.createElement("div",{style:j.footer},t.createElement("div",{style:j.keyboard},t.createElement("span",{style:j.key},"↑"),t.createElement("span",{style:j.key},"↓"),t.createElement("span",null,"to navigate"),t.createElement("span",{style:j.key},"↵"),t.createElement("span",null,"to select"),t.createElement("span",{style:j.key},"esc"),t.createElement("span",null,"to close")),Y.length>0&&t.createElement("span",null,Y.length," suggestions")))}),ur=()=>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"})),mr=()=>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"})),pr=()=>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"})),gr=()=>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)"})),fr=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:m="I'm Feeling Lucky",showRemoveRecent:p=!0,showVoiceSearch:g=!1,showTrendingIndicator:f=!0,width:h="100%",maxHeight:y="400px",zIndex:b=1e3,className:v,style:x,classNames:k={},onSuggestionSelect:E,onRecentClick:S,onRecentRemove:w,onVoiceSearch:C,onFeelingLucky:R,onClose:I,onSearchSubmit:N,header:T,footer:z,renderLoading:M,renderEmpty:A}=e;or();const _=tr(),{isMobile:L}=_,P=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)"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",color:"var(--seekora-text-secondary, #5f6368)",gap:"12px"},spinner:{width:"24px",height:"24px",border:"3px solid var(--seekora-border-color, #e8eaed)",borderTopColor:"var(--seekora-primary, #4285f4)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"24px",textAlign:"center",color:"var(--seekora-text-secondary, #5f6368)",fontSize:"14px"}}))(L),[L]),D=t.useRef(null),[B,$]=t.useState(-1),[F,W]=t.useState(-1),[q,H]=t.useState(null),O=t.useMemo(()=>s.map(e=>Ye(e,c)),[s,c]),j=t.useMemo(()=>i.map(e=>"string"==typeof e?e:e.query).slice(0,5),[i]),V=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,5),[l]),U=t.useMemo(()=>{const e=[];return 0===a.length?(j.forEach(t=>e.push({type:"recent",query:t})),V.forEach(t=>e.push({type:"trending",query:t}))):O.forEach(t=>e.push({type:"suggestion",query:t.query,data:t})),e},[a,j,V,O]),Q=t.useCallback(()=>{$(e=>Math.min(e+1,U.length-1))},[U.length]),G=t.useCallback(()=>{$(e=>Math.max(e-1,-1))},[]),X=t.useCallback(()=>{if(B<0)return void(a&&N?.(a));const e=U[B];"recent"===e.type||"trending"===e.type?S?.(e.query):E?.(e.data?._raw||{query:e.query},B)},[B,U,a,N,S,E]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>B,setActiveIndex:$,selectActive:X,navigateNext:Q,navigatePrevious:G,focus:()=>D.current?.focus(),close:()=>I?.()}),[B,X,Q,G,I]),t.useEffect(()=>{$(-1)},[a]),t.useEffect(()=>{if(B>=0&&D.current){const e=D.current.querySelector(`[data-index="${B}"]`);e&&pt(e,D.current)}},[B]),!o)return null;const Y=st(d),K=0===a.length&&j.length>0,Z=0===a.length&&V.length>0,J=(e,r,o)=>{const n=B===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:lt(P.item,n||s?P.itemActive:void 0),onClick:()=>{"recent"===e.type||"trending"===e.type?S?.(e.query):E?.(e.data?._raw||{query:e.query},r)},onMouseEnter:()=>{W(o),$(o)},onMouseLeave:()=>W(-1)},t.createElement("div",{style:P.itemIcon},"recent"===e.type?t.createElement(mr,null):"trending"===e.type?t.createElement(pr,null):t.createElement(ur,null)),t.createElement("div",{style:P.itemContent},t.createElement("span",{style:P.itemText,dangerouslySetInnerHTML:{__html:a?tt(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:P.trending},t.createElement(pr,null),"Trending"),"recent"===e.type&&p&&t.createElement("button",{style:lt(P.removeBtn,i?P.removeBtnVisible:void 0),onClick:t=>{t.stopPropagation(),w?.(e.query)},"aria-label":`Remove ${e.query}`},"Remove"),t.createElement("span",{style:lt(P.itemAction,i?P.itemActionVisible:void 0)},t.createElement(gr,null)))))};let ee=0;return t.createElement("div",{ref:D,role:"listbox","aria-label":"Search suggestions",className:it("seekora-google-dropdown",v,k.root),style:lt(P.root,{width:h,maxHeight:"none",zIndex:b},Y,x),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),T,n?M?M():t.createElement("div",{style:P.loading},t.createElement("div",{style:P.spinner})):t.createElement(t.Fragment,null,t.createElement("ul",{style:P.list},K&&t.createElement(t.Fragment,null,j.map((e,t)=>{const r=J({type:"recent",query:e},t,ee);return ee++,r}),Z&&t.createElement("div",{style:P.divider})),Z&&t.createElement(t.Fragment,null,!K&&t.createElement("div",{style:P.sectionTitle},"Trending searches"),V.map((e,t)=>{const r=J({type:"trending",query:e},t,ee);return ee++,r})),a&&O.length>0&&O.map((e,t)=>{const r={type:"suggestion",query:e.query,data:e},a=J(r,t,ee);return ee++,a}),a&&0===O.length&&!n&&(A?A(a):t.createElement("li",{style:P.empty},'No suggestions for "',a,'"'))),(u||g)&&t.createElement("div",{style:P.footer},u&&t.createElement(t.Fragment,null,t.createElement("button",{style:lt(P.footerButton,"search"===q?P.footerButtonHover:void 0),onMouseEnter:()=>H("search"),onMouseLeave:()=>H(null),onClick:()=>N?.(a||(B>=0?U[B]?.query:""))},"Search"),t.createElement("button",{style:lt(P.footerButton,"lucky"===q?P.footerButtonHover:void 0),onMouseEnter:()=>H("lucky"),onMouseLeave:()=>H(null),onClick:()=>R?.(a||(B>=0?U[B]?.query:""))},m)))),z)}),hr=()=>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"})),yr=()=>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"})),br=()=>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"})),vr=()=>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"})),xr=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:m={},theme:p={},showSaveButton:g=!0,activeCategory:f,activeTab:h,showPriceOverlay:y=!0,gridColumns:b=4,width:v="800px",maxHeight:x="600px",zIndex:k=1e3,className:E,style:S,classNames:w={},onSuggestionSelect:C,onProductClick:R,onCategoryClick:I,onTabChange:N,onSaveProduct:T,onViewAll:z,onClose:M,header:A,footer:_,renderLoading:L,renderEmpty:P}=e;or();const D=tr(),{isMobile:B}=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),[W,q]=t.useState(-1),[H,O]=t.useState(null),[j,V]=t.useState(null),[U,Q]=t.useState(-1),[G,X]=t.useState(f||null),[Y,K]=t.useState(!1);t.useEffect(()=>{const e=h??f;void 0!==e&&X("all"===e?null:e)},[h,f]);const Z=t.useMemo(()=>s.map(e=>Ye(e,c)),[s,c]),J=t.useMemo(()=>i.map(e=>Ke(e,d)),[i,d]),ee=t.useMemo(()=>l.map(e=>Ze(e,u)),[l,u]),te=t.useCallback(()=>{q(e=>Math.min(e+1,Z.length-1))},[Z.length]),re=t.useCallback(()=>{q(e=>Math.max(e-1,-1))},[]),ae=t.useCallback(()=>{W>=0&&Z[W]&&C?.(Z[W]._raw,W)},[W,Z,C]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>W,setActiveIndex:q,selectActive:ae,navigateNext:te,navigatePrevious:re,focus:()=>F.current?.focus(),close:()=>M?.()}),[W,ae,te,re,M]),t.useEffect(()=>{if(W>=0&&F.current){const e=F.current.querySelector(`[data-index="${W}"]`);e&&pt(e,F.current)}},[W]),!o)return null;const oe=st(p),ne=ee.length>0,se=J;return t.createElement("div",{ref:F,role:"listbox","aria-label":"Search suggestions",className:it("seekora-pinterest-dropdown",E,w.root),style:lt($.root,{width:v,zIndex:k},oe,S),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:$.header},t.createElement("div",{style:$.searchInfo},t.createElement("span",{style:$.searchQuery},a?`"${a}"`:"Explore"),J.length>0&&t.createElement("span",{style:$.searchCount},J.length,"+ ideas")),ne&&t.createElement("div",{style:$.categoriesScroll,className:"categories-scroll"},t.createElement("button",{style:lt($.categoryChip,G?void 0:$.categoryChipActive,"all"===j&&G?$.categoryChipHover:void 0),onClick:()=>{X(null),N?.("all")},onMouseEnter:()=>V("all"),onMouseLeave:()=>V(null)},"All"),ee.map(e=>t.createElement("button",{key:e.id,style:lt($.categoryChip,G===e.id?$.categoryChipActive:void 0,j===e.id&&G!==e.id?$.categoryChipHover:void 0),onClick:()=>{X(e.id),N?.(e.id)},onMouseEnter:()=>V(e.id),onMouseLeave:()=>V(null)},e.icon&&t.createElement("img",{src:e.icon,alt:"",style:$.categoryIcon}),e.label,e.count&&t.createElement("span",null,"(",e.count,")"))))),t.createElement("div",{style:{...$.content,maxHeight:x}},n?L?L():t.createElement("div",{style:$.loading},t.createElement("div",{style:$.spinner})):t.createElement(t.Fragment,null,Z.length>0&&t.createElement("div",{style:$.suggestionsRow},Z.slice(0,8).map((e,r)=>t.createElement("button",{key:e.id||r,"data-index":r,style:lt($.suggestionPill,W===r?$.suggestionPillActive:void 0,U===r&&W!==r?$.suggestionPillHover:void 0),onClick:()=>C?.(e._raw,r),onMouseEnter:()=>{Q(r),q(r)},onMouseLeave:()=>Q(-1)},t.createElement("span",{style:$.suggestionIcon,dangerouslySetInnerHTML:{__html:a?tt(e.query,a,{tag:"strong"}):e.query}})))),se.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:$.sectionTitle},t.createElement(br,null),"Ideas for you"),t.createElement("div",{style:{...$.productsGrid,gridTemplateColumns:`repeat(${b}, 1fr)`}},se.slice(0,12).map((e,r)=>t.createElement("div",{key:e.id,style:lt($.productCard,H===e.id?$.productCardHover:void 0),onClick:()=>R?.(e._raw,r),onMouseEnter:()=>O(e.id),onMouseLeave:()=>O(null)},t.createElement("div",{style:$.productImageContainer},e.image?t.createElement("img",{src:e.image,alt:e.title,style:$.productImage,loading:"lazy"}):t.createElement("div",{style:$.productImagePlaceholder},t.createElement(vr,null)),g&&t.createElement("button",{style:lt($.productSaveBtn,H===e.id?$.productSaveBtnVisible:void 0),onClick:t=>{t.stopPropagation(),T?.(e._raw)},"aria-label":"Save"},t.createElement(yr,null)),y&&void 0!==e.price&&t.createElement("div",{style:lt($.productOverlay,H===e.id?$.productOverlayVisible:void 0)},t.createElement("div",{style:$.productTitleOverlay},e.title),t.createElement("div",{style:$.productPriceOverlay},Je(e.price,{currency:m.currency||e.currency||"$"})))),!y&&t.createElement("div",{style:$.productInfo},t.createElement("div",{style:$.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:$.productPrice},Je(e.price,{currency:m.currency||e.currency||"$"}))))))),!n&&0===se.length&&0===Z.length&&(P?P(a):t.createElement("div",{style:$.empty},t.createElement("div",{style:$.emptyIcon},t.createElement(hr,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!==_?_:se.length>0&&t.createElement("div",{style:$.footer},t.createElement("span",{style:{color:"var(--seekora-text-secondary, #767676)",fontSize:"14px"}},se.length,"+ more ideas"),t.createElement("button",{style:lt($.viewAllBtn,Y?$.viewAllBtnHover:void 0),onClick:()=>z?.("products"),onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1)},"Explore all")))}),kr=()=>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"})),Er=()=>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"})),Sr=()=>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"})),wr=()=>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"})),Cr=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:m={},showPreview:p=!0,asOverlay:g=!0,placeholder:f="Search...",showShortcuts:h=!0,actions:y=[],width:b="680px",maxHeight:v="500px",zIndex:x=9999,className:k,style:E,classNames:S={},inputRef:w,onSuggestionSelect:C,onProductClick:R,onRecentClick:I,onClose:N,onSearchSubmit:T,header:z,footer:M,renderLoading:A,renderEmpty:_}=e;or();const L=tr(),{isMobile:P}=L,D=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)"}}),[]),B=t.useRef(null),$=t.useRef(null),[F,W]=t.useState(-1),q=t.useMemo(()=>s.map(e=>Ye(e,c)),[s,c]),H=t.useMemo(()=>i.map(e=>Ke(e,d)),[i,d]),O=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,3),[l]),j=t.useMemo(()=>{const e=[];return y.forEach(t=>{e.push({type:"action",id:t.id,title:t.label,icon:t.icon,data:t})}),!a&&O.length>0&&O.forEach((r,a)=>{e.push({type:"recent",id:`recent-${a}`,title:r,icon:t.createElement(wr,null),data:r})}),q.forEach((r,a)=>{e.push({type:"suggestion",id:r.id||`suggestion-${a}`,title:r.query,icon:t.createElement(Er,null),data:r})}),H.forEach((r,a)=>{e.push({type:"product",id:r.id,title:r.title,subtitle:r.brand,icon:t.createElement(Sr,null),image:r.image,price:r.price,data:r})}),e},[y,a,O,q,H]),V=t.useCallback(()=>{W(e=>Math.min(e+1,j.length-1))},[j.length]),U=t.useCallback(()=>{W(e=>Math.max(e-1,-1))},[]),Q=t.useCallback(()=>{if(F<0)return void(a.trim()&&T?.(a.trim()));const e=j[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,j,a,T,I,C,R]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>F,setActiveIndex:W,selectActive:Q,navigateNext:V,navigatePrevious:U,focus:()=>w?.current?.focus(),close:()=>N?.()}),[F,Q,V,U,w,N]),t.useEffect(()=>{if($.current&&F>=0){const e=$.current.querySelector(`[data-index="${F}"]`);e&&pt(e,$.current)}},[F]),t.useEffect(()=>{W(-1)},[a]),!o)return null;const G=st(m),X=j[F],Y=t.createElement("div",{ref:B,className:it("seekora-spotlight-dropdown",k,S.root),style:lt(D.root,{width:b,zIndex:g?void 0:x},G,E)},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),t.createElement("div",{style:D.searchContainer},t.createElement("div",{style:D.searchIcon},t.createElement(kr,null)),t.createElement("input",{ref:w,type:"text",placeholder:f,defaultValue:a,style:D.searchInput,onChange:e=>T?.(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),V()):"ArrowUp"===e.key?(e.preventDefault(),U()):"Enter"===e.key?(e.preventDefault(),Q()):"Escape"===e.key&&N?.()},autoFocus:!0}),h&&t.createElement("div",{style:D.shortcut},t.createElement("span",{style:D.kbd},"⌘"),t.createElement("span",{style:D.kbd},"K"))),z,t.createElement("div",{style:D.content},t.createElement("div",{ref:$,style:{...D.resultsColumn,maxHeight:v}},n?A?A():t.createElement("div",{style:D.loading},t.createElement("div",{style:D.spinner})):0===j.length?_?_(a):t.createElement("div",{style:D.empty},'No results for "',a,'"'):t.createElement(t.Fragment,null,y.length>0&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionTitle},"Actions"),j.filter(e=>"action"===e.type).map(e=>{const r=j.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:lt(D.item,a?D.itemActive:void 0),onClick:()=>{W(r),Q()},onMouseEnter:()=>W(r)},t.createElement("div",{style:lt(D.itemIcon,a?D.itemIconActive:void 0)},e.icon),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:lt(D.itemTitle,a?D.itemTitleActive:void 0)},e.title)))})),O.length>0&&!a&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionTitle},"Recent"),j.filter(e=>"recent"===e.type).map(e=>{const r=j.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:lt(D.item,a?D.itemActive:void 0),onClick:()=>{W(r),I?.(e.data)},onMouseEnter:()=>W(r)},t.createElement("div",{style:lt(D.itemIcon,a?D.itemIconActive:void 0)},e.icon),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:lt(D.itemTitle,a?D.itemTitleActive:void 0)},e.title)))})),q.length>0&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionTitle},"Suggestions"),j.filter(e=>"suggestion"===e.type).map(e=>{const r=j.indexOf(e),o=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:lt(D.item,o?D.itemActive:void 0),onClick:()=>{W(r),C?.(e.data._raw,r)},onMouseEnter:()=>W(r)},t.createElement("div",{style:lt(D.itemIcon,o?D.itemIconActive:void 0)},e.icon),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:lt(D.itemTitle,o?D.itemTitleActive:void 0),dangerouslySetInnerHTML:{__html:tt(e.title,a,{tag:"strong"})}})))})),H.length>0&&t.createElement("div",{style:D.section},t.createElement("div",{style:D.sectionTitle},"Products"),j.filter(e=>"product"===e.type).map(e=>{const r=j.indexOf(e),a=F===r;return t.createElement("div",{key:e.id,"data-index":r,style:lt(D.item,a?D.itemActive:void 0),onClick:()=>{W(r),R?.(e.data._raw,r)},onMouseEnter:()=>W(r)},t.createElement("div",{style:lt(D.itemIcon,a?D.itemIconActive:void 0)},e.image?t.createElement("img",{src:e.image,alt:"",style:D.itemIconImage}):e.icon),t.createElement("div",{style:D.itemContent},t.createElement("div",{style:lt(D.itemTitle,a?D.itemTitleActive:void 0)},e.title),e.subtitle&&t.createElement("div",{style:lt(D.itemSubtitle,a?D.itemSubtitleActive:void 0)},e.subtitle)),void 0!==e.price&&t.createElement("span",{style:lt(D.itemAction,D.itemActionVisible,a?D.itemActionActive:void 0)},Je(e.price,{currency:u.currency})))})))),p&&X&&"product"===X.type&&t.createElement("div",{style:D.previewColumn},t.createElement("div",{style:D.previewContent},X.image&&t.createElement("img",{src:X.image,alt:"",style:D.previewImage}),t.createElement("div",{style:D.previewTitle},X.title),X.subtitle&&t.createElement("div",{style:D.previewSubtitle},X.subtitle),void 0!==X.price&&t.createElement("div",{style:D.previewPrice},Je(X.price,{currency:u.currency})),t.createElement("div",{style:D.previewActions},t.createElement("button",{style:{...D.previewAction,...D.previewActionPrimary},onClick:()=>R?.(X.data._raw,F)},"View Product"))))),void 0!==M?M:t.createElement("div",{style:D.footer},t.createElement("div",{style:D.footerActions},t.createElement("span",{style:D.footerAction},t.createElement("span",{style:D.kbd},"↑"),t.createElement("span",{style:D.kbd},"↓"),"navigate"),t.createElement("span",{style:D.footerAction},t.createElement("span",{style:D.kbd},"↵"),"select"),t.createElement("span",{style:D.footerAction},t.createElement("span",{style:D.kbd},"esc"),"close")),t.createElement("span",null,j.length," results")));return g?t.createElement("div",{style:{...D.overlay,zIndex:x},onClick:e=>{e.target===e.currentTarget&&N?.()}},Y):Y}),Rr=()=>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"})),Ir=()=>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"})),Nr=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:m={},theme:p={},showHeroProduct:g=!0,showCollections:f=!0,showAddToCart:h=!0,addToCartText:y="Quick Add",showComparePrice:b=!0,width:v="100%",maxHeight:x="500px",zIndex:k=1e3,className:E,style:S,classNames:w={},onSuggestionSelect:C,onProductClick:R,onCategoryClick:I,onTabChange:N,onAddToCart:T,onViewAll:z,onClose:M,header:A,footer:_,renderLoading:L,renderEmpty:P}=e;or();const D=tr(),{isMobile:B}=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, #ffffff)",color:"var(--seekora-text-primary, #121212)",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, #ffffff)",borderRight:e?"none":"1px solid var(--seekora-border-color, #e8e8e1)",borderBottom:e?"1px solid var(--seekora-border-color, #e8e8e1)":"none",display:"flex",flexDirection:"column"},rightPanel:{backgroundColor:"var(--seekora-bg-secondary, #fafafa)",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, #e8e8e1)"},sectionTitle:{fontSize:"11px",fontWeight:600,color:"var(--seekora-text-secondary, #666)",textTransform:"uppercase",letterSpacing:"0.1em"},viewAllLink:{fontSize:"12px",color:"var(--seekora-text-primary, #121212)",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, #121212)"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #121212)"},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, #121212)",fontWeight:400},suggestionMeta:{fontSize:"12px",color:"var(--seekora-text-secondary, #666)",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, #e8e8e1)",borderTop:"1px solid var(--seekora-border-color, #e8e8e1)"},collectionItem:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #121212)",padding:"16px 20px",cursor:"pointer",transition:"background-color 150ms"},collectionItemHover:{backgroundColor:"var(--seekora-bg-hover, #f0f0f0)",color:"var(--seekora-text-primary, #121212)"},collectionName:{fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, #121212)",marginBottom:"4px"},collectionCount:{fontSize:"11px",color:"var(--seekora-text-secondary, #666)"},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, #121212)",marginBottom:"8px",lineHeight:1.3},heroBrand:{fontSize:"12px",color:"var(--seekora-text-secondary, #666)",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, #121212)"},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, #121212)",color:"var(--seekora-bg-surface, #ffffff)",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, #666666)",color:"var(--seekora-bg-surface, #ffffff)"},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, #121212)",marginBottom:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},productPrice:{fontSize:"12px",fontWeight:500,color:"var(--seekora-text-primary, #121212)"},footer:{padding:"12px 20px",borderTop:"1px solid var(--seekora-border-color, #e8e8e1)",backgroundColor:"var(--seekora-bg-secondary, #fafafa)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"11px",color:"var(--seekora-text-secondary, #666)"},footerLink:{color:"var(--seekora-text-primary, #121212)",textDecoration:"underline",cursor:"pointer"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, #666)"},spinner:{width:"24px",height:"24px",border:"2px solid var(--seekora-border-color, #e8e8e1)",borderTopColor:"var(--seekora-text-primary, #121212)",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)"}}))(B),[B]),F=t.useRef(null),[W,q]=t.useState(-1),[H,O]=t.useState(null),[j,V]=t.useState(null),[U,Q]=t.useState(!1),G=t.useMemo(()=>s.map(e=>Ye(e,c)),[s,c]),X=t.useMemo(()=>i.map(e=>Ke(e,d)),[i,d]),Y=t.useMemo(()=>l.map(e=>Ze(e,u)),[l,u]),K=X[0],Z=X.slice(1,7),J=t.useCallback(()=>{q(e=>Math.min(e+1,G.length-1))},[G.length]),ee=t.useCallback(()=>{q(e=>Math.max(e-1,-1))},[]),te=t.useCallback(()=>{W>=0&&G[W]&&C?.(G[W]._raw,W)},[W,G,C]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>W,setActiveIndex:q,selectActive:te,navigateNext:J,navigatePrevious:ee,focus:()=>F.current?.focus(),close:()=>M?.()}),[W,te,J,ee,M]),t.useEffect(()=>{if(W>=0&&F.current){const e=F.current.querySelector(`[data-index="${W}"]`);e&&pt(e,F.current)}},[W]),!o)return null;const re=st(p),ae=K?((e,t)=>{if(e&&t&&!(t<=e))return Math.round((t-e)/t*100)})(K.price,K.comparePrice):void 0;return t.createElement("div",{ref:F,role:"listbox","aria-label":"Search suggestions",className:it("seekora-shopify-dropdown",E,w.root),style:lt($.root,{width:B?"100%":v,maxHeight:B?"100vh":x,zIndex:k},re,S),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,n?L?L():t.createElement("div",{style:$.loading},t.createElement("div",{style:$.spinner})):t.createElement("div",{style:$.layout},t.createElement("div",{style:$.leftPanel},t.createElement("div",{style:$.section},t.createElement("div",{style:$.sectionHeader},t.createElement("span",{style:$.sectionTitle},"Suggestions"),G.length>5&&t.createElement("span",{style:$.viewAllLink,onClick:()=>z?.("suggestions")},"View all")),G.slice(0,5).map((e,r)=>{const o=W===r;return t.createElement("div",{key:e.id||r,"data-index":r,role:"option","aria-selected":o,style:lt($.suggestionItem,o?$.suggestionItemActive:void 0),onClick:()=>C?.(e._raw,r),onMouseEnter:()=>q(r)},t.createElement("div",{style:$.suggestionIcon},t.createElement(Rr,null)),t.createElement("div",{style:$.suggestionContent},t.createElement("div",{style:$.suggestionQuery,dangerouslySetInnerHTML:{__html:tt(e.query,a,{tag:"mark"})}}),e.count&&t.createElement("div",{style:$.suggestionMeta},e.count," results")),t.createElement("div",{style:lt($.suggestionArrow,o?$.suggestionArrowVisible:void 0)},t.createElement(Ir,null)))}),0===G.length&&a&&(P?P(a):t.createElement("div",{style:{padding:"20px",textAlign:"center",color:"#666"}},'No suggestions for "',a,'"'))),f&&Y.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:$.sectionHeader},t.createElement("span",{style:$.sectionTitle},"Collections")),t.createElement("div",{style:$.collectionsGrid},Y.slice(0,4).map(e=>t.createElement("div",{key:e.id,style:lt($.collectionItem,j===e.id?$.collectionItemHover:void 0),onClick:()=>N?.(e.id),onMouseEnter:()=>V(e.id),onMouseLeave:()=>V(null)},t.createElement("div",{style:$.collectionName},e.label),e.count&&t.createElement("div",{style:$.collectionCount},e.count," products")))))),t.createElement("div",{style:$.rightPanel},g&&K&&t.createElement("div",{style:$.heroProduct},K.image&&t.createElement("img",{src:K.image,alt:K.title,style:$.heroImage,loading:"lazy"}),K.brand&&t.createElement("div",{style:$.heroBrand},K.brand),t.createElement("div",{style:$.heroTitle},K.title),t.createElement("div",{style:$.heroPricing},t.createElement("span",{style:$.heroPrice},Je(K.price,{currency:m.currency||K.currency||"$"})),b&&K.comparePrice&&t.createElement("span",{style:$.heroComparePrice},Je(K.comparePrice,{currency:m.currency||K.currency||"$"})),ae&&t.createElement("span",{style:$.heroDiscount},"-",ae,"%")),h&&t.createElement("button",{style:lt($.heroButton,U?$.heroButtonHover:void 0),onClick:()=>T?.(K._raw),onMouseEnter:()=>Q(!0),onMouseLeave:()=>Q(!1)},y)),Z.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{...$.sectionTitle,marginBottom:"12px"}},"More Products"),t.createElement("div",{style:$.productsScroll},Z.map((e,r)=>t.createElement("div",{key:e.id,style:lt($.productCard,H===e.id?$.productCardHover:void 0),onClick:()=>R?.(e._raw,r+1),onMouseEnter:()=>O(e.id),onMouseLeave:()=>O(null)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:$.productImage,loading:"lazy"}):t.createElement("div",{style:$.productImage}),t.createElement("div",{style:$.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:$.productPrice},Je(e.price,{currency:m.currency||e.currency||"$"})))))))),void 0!==_?_:t.createElement("div",{style:$.footer},t.createElement("span",null,"Press ",t.createElement("strong",null,"Enter")," to search, ",t.createElement("strong",null,"↑↓")," to navigate"),t.createElement("span",{style:$.footerLink,onClick:()=>z?.("products")},"View all results")))}),Tr=()=>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"})),zr=()=>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"})),Mr=()=>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"})),Ar=()=>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"})),_r=()=>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"})),Lr=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:m={},theme:p={},showSearchInput:g=!0,showCancel:f=!0,cancelText:h="Cancel",showDragHandle:y=!0,swipeToDismiss:b=!0,footerButtonText:v="Search",showFooterButton:x=!0,width:k="100%",maxHeight:E="85vh",zIndex:S=9999,className:w,style:C,classNames:R={},inputRef:I,onSuggestionSelect:N,onProductClick:T,onRecentClick:z,onRecentClearAll:M,onSearchSubmit:A,onClose:_,header:L,footer:P,renderLoading:D,renderEmpty:B}=e;or();const $=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, #fff)",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, #e0e0e0)",borderRadius:"3px"},header:{padding:"0 16px 16px",borderBottom:"1px solid var(--seekora-border-color, #f0f0f0)"},searchContainer:{display:"flex",alignItems:"center",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",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, #000)",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, #000)"},itemActive:{backgroundColor:"var(--seekora-bg-hover, #f2f2f7)",color:"var(--seekora-text-primary, #000)"},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, #000)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemSubtitle:{fontSize:"15px",color:"var(--seekora-text-secondary, #8e8e93)",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, #000)",marginBottom:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},productPrice:{fontSize:"15px",fontWeight:600,color:"var(--seekora-text-primary, #000)"},footer:{padding:"12px 16px",paddingBottom:"calc(12px + env(safe-area-inset-bottom, 0px))",borderTop:"1px solid var(--seekora-border-color, #f0f0f0)",backgroundColor:"var(--seekora-bg-secondary, #f8f8f8)"},footerBtn:{width:"100%",padding:"16px",backgroundColor:"var(--seekora-primary, #007aff)",color:"var(--seekora-text-inverse, #ffffff)",border:"none",borderRadius:"12px",fontSize:"17px",fontWeight:600,cursor:"pointer"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, #8e8e93)"},spinner:{width:"28px",height:"28px",border:"3px solid var(--seekora-border-color, #e5e5ea)",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, #8e8e93)",fontSize:"17px"},emptyIcon:{width:"48px",height:"48px",margin:"0 auto 16px",color:"var(--seekora-text-tertiary, #c7c7cc)"}}),[]),F=t.useRef(null),[W,q]=t.useState(-1),[H,O]=t.useState(a),[j,V]=t.useState(0),[U,Q]=t.useState(!1),G=t.useRef(0),X=t.useMemo(()=>s.map(e=>Ye(e,d)),[s,d]),Y=t.useMemo(()=>i.map(e=>Ke(e,u)),[i,u]),K=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,5),[l]),Z=t.useMemo(()=>c.map(e=>"string"==typeof e?e:e.query).slice(0,5),[c]),J=t.useMemo(()=>{const e=[];return K.forEach(t=>e.push({type:"recent",data:t})),Z.forEach(t=>e.push({type:"trending",data:t})),X.forEach(t=>e.push({type:"suggestion",data:t})),e},[K,Z,X]),ee=t.useCallback(()=>{q(e=>Math.min(e+1,J.length-1))},[J.length]),te=t.useCallback(()=>{q(e=>Math.max(e-1,-1))},[]),re=t.useCallback(()=>{if(W<0||W>=J.length)return void(H.trim()&&A?.(H.trim()));const e=J[W];"recent"===e.type||"trending"===e.type?z?.(e.data):"suggestion"===e.type&&N?.(e.data._raw,W)},[W,J,H,A,z,N]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>W,setActiveIndex:q,selectActive:re,navigateNext:ee,navigatePrevious:te,focus:()=>I?.current?.focus(),close:()=>_?.()}),[W,re,ee,te,I,_]),t.useEffect(()=>{if(W>=0&&F.current){const e=F.current.querySelector(`[data-index="${W}"]`);e&&pt(e,F.current)}},[W]);if(t.useEffect(()=>{O(a)},[a]),!o)return null;const ae=st(p),oe=!H&&K.length>0,ne=!H&&Z.length>0,se=Y.length>0;return t.createElement(t.Fragment,null,t.createElement("div",{style:{...$.overlay,opacity:U?1-j/300:1},onClick:_}),t.createElement("div",{ref:F,className:it("seekora-mobile-sheet",w,R.root),style:lt($.root,{maxHeight:E,zIndex:S,transform:U?`translateY(${j}px)`:"translateY(0)"},ae,C),onTouchStart:e=>{b&&(Q(!0),G.current=e.touches[0].clientY)},onTouchMove:e=>{if(!U)return;const t=e.touches[0].clientY-G.current;t>0&&V(t)},onTouchEnd:()=>{U&&(Q(!1),j>150&&_?.(),V(0))}},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),y&&t.createElement("div",{style:$.dragHandle},t.createElement("div",{style:$.dragBar})),(g||L)&&t.createElement("div",{style:$.header},L||t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},t.createElement("div",{style:$.searchContainer},t.createElement("div",{style:$.searchIcon},t.createElement(Tr,null)),t.createElement("input",{ref:I,type:"text",placeholder:"Search...",value:H,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),W>=0?re():H.trim()&&A?.(H.trim())):"ArrowDown"===e.key?(e.preventDefault(),ee()):"ArrowUp"===e.key?(e.preventDefault(),te()):"Escape"===e.key&&_?.()},style:$.searchInput,autoFocus:!0})),f&&t.createElement("button",{style:$.cancelBtn,onClick:_},h))),t.createElement("div",{style:$.content},n?D?D():t.createElement("div",{style:$.loading},t.createElement("div",{style:$.spinner})):t.createElement(t.Fragment,null,oe&&t.createElement("div",{style:$.section},t.createElement("div",{style:$.sectionHeader},t.createElement("span",{style:$.sectionTitle},"Recent"),t.createElement("button",{style:$.clearBtn,onClick:M},"Clear")),K.map((e,r)=>t.createElement("div",{key:`recent-${e}`,"data-index":r,style:lt($.item,W===r?$.itemActive:void 0),onClick:()=>{z?.(e),O(e)},onMouseEnter:()=>q(r)},t.createElement("div",{style:$.itemIcon},t.createElement(zr,null)),t.createElement("div",{style:$.itemContent},t.createElement("div",{style:$.itemTitle},e)),t.createElement("div",{style:$.itemAction},t.createElement(_r,null))))),ne&&t.createElement("div",{style:$.section},t.createElement("div",{style:$.sectionHeader},t.createElement("span",{style:$.sectionTitle},"Trending")),Z.map((e,r)=>{const a=K.length+r;return t.createElement("div",{key:`trending-${e}`,"data-index":a,style:lt($.item,W===a?$.itemActive:void 0),onClick:()=>{z?.(e),O(e)},onMouseEnter:()=>q(a)},t.createElement("div",{style:$.itemIcon},t.createElement(Mr,null)),t.createElement("div",{style:$.itemContent},t.createElement("div",{style:$.itemTitle},e)),t.createElement("div",{style:$.itemAction},t.createElement(Ar,null)))})),H&&X.length>0&&t.createElement("div",{style:$.section},t.createElement("div",{style:$.sectionHeader},t.createElement("span",{style:$.sectionTitle},"Suggestions")),X.map((e,r)=>{const a=K.length+Z.length+r;return t.createElement("div",{key:e.id||r,"data-index":a,style:lt($.item,W===a?$.itemActive:void 0),onClick:()=>N?.(e._raw,r),onMouseEnter:()=>q(a)},t.createElement("div",{style:$.itemIcon},t.createElement(Tr,null)),t.createElement("div",{style:$.itemContent},t.createElement("div",{style:$.itemTitle,dangerouslySetInnerHTML:{__html:tt(e.query,H,{tag:"strong"})}}),e.count&&t.createElement("div",{style:$.itemSubtitle},e.count," results")),t.createElement("div",{style:$.itemAction},t.createElement(Ar,null)))})),se&&t.createElement("div",{style:$.section},t.createElement("div",{style:$.sectionHeader},t.createElement("span",{style:$.sectionTitle},"Products")),t.createElement("div",{style:$.productsScroll},Y.slice(0,8).map((e,r)=>t.createElement("div",{key:e.id,style:$.productCard,onClick:()=>T?.(e._raw,r)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:$.productImage,loading:"lazy"}):t.createElement("div",{style:$.productImage}),t.createElement("div",{style:$.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:$.productPrice},Je(e.price,{currency:m.currency||e.currency||"$"})))))),H&&0===X.length&&!n&&(B?B(H):t.createElement("div",{style:$.empty},t.createElement("div",{style:$.emptyIcon},t.createElement(Tr,null)),t.createElement("p",null,'No results for "',H,'"'))))),void 0!==P?P:x&&H&&t.createElement("div",{style:$.footer},t.createElement("button",{style:$.footerBtn,onClick:()=>A?.(H)},v,' "',H,'"'))))}),Pr=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:m={},showIndices:p=!1,showTypeLabels:g=!1,showSectionDividers:f=!0,width:h="100%",maxHeight:y="400px",zIndex:b=1e3,className:v,style:x,classNames:k={},onSuggestionSelect:E,onProductClick:S,onRecentClick:w,onClose:C,onSearchSubmit:R,header:I,footer:N,renderLoading:T,renderEmpty:z}=e;or();const M=tr(),{isMobile:A}=M,_=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"}}),[]),L=t.useRef(null),P=t.useRef(null),[D,B]=t.useState(-1),$=t.useMemo(()=>s.map(e=>Ye(e,c)),[s,c]),F=t.useMemo(()=>i.map(e=>Ke(e,d)),[i,d]),W=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,3),[l]),q=t.useMemo(()=>{const e=[];return!a&&W.length>0&&W.forEach(t=>e.push({type:"recent",data:t})),$.forEach(t=>e.push({type:"suggestion",data:t})),F.forEach(t=>e.push({type:"product",data:t})),e},[a,W,$,F]),H=t.useCallback(()=>{B(e=>Math.min(e+1,q.length-1))},[q.length]),O=t.useCallback(()=>{B(e=>Math.max(e-1,-1))},[]),j=t.useCallback(()=>{const e=q[D];if(e)switch(e.type){case"recent":w?.(e.data);break;case"suggestion":E?.(e.data._raw,D);break;case"product":S?.(e.data._raw,D)}else a&&R?.(a)},[D,q,a,R,w,E,S]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>D,setActiveIndex:B,selectActive:j,navigateNext:H,navigatePrevious:O,focus:()=>L.current?.focus(),close:()=>C?.()}),[D,j,H,O,C]),t.useEffect(()=>{if(P.current&&D>=0){const e=P.current.querySelector(`[data-index="${D}"]`);e&&pt(e,P.current)}},[D]),t.useEffect(()=>{B(-1)},[a]),!o)return null;const V=st(m),U=!a&&W.length>0;let Q=0;return t.createElement("div",{ref:L,role:"listbox","aria-label":"Search suggestions",className:it("seekora-minimal-dropdown",v,k.root),style:lt(_.root,{width:h,zIndex:b},V,x),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:P,style:{maxHeight:y,overflowY:"auto"}},n?T?T():t.createElement("div",{style:_.loading},"Loading..."):0===q.length?z?z(a):t.createElement("div",{style:_.empty},a?`No results for "${a}"`:"Start typing to search"):t.createElement(t.Fragment,null,U&&t.createElement(t.Fragment,null,f&&t.createElement("div",{style:_.divider},"Recent"),W.map((e,r)=>{const a=Q++,o=D===a,n=r===W.length-1&&!$.length&&!F.length;return t.createElement("div",{key:`recent-${e}`,"data-index":a,style:lt(_.item,o?_.itemActive:void 0,n?_.itemLast:void 0),onClick:()=>w?.(e),onMouseEnter:()=>B(a)},p&&t.createElement("span",{style:_.itemIndex},a+1),t.createElement("div",{style:_.itemContent},t.createElement("div",{style:_.itemQuery},e)),g&&t.createElement("span",{style:_.itemType},"Recent"))})),$.length>0&&t.createElement(t.Fragment,null,f&&(U||!1)&&t.createElement("div",{style:_.divider},"Suggestions"),$.map((e,r)=>{const o=Q++,n=D===o,s=r===$.length-1&&!F.length;return t.createElement("div",{key:e.id||`suggestion-${r}`,"data-index":o,style:lt(_.item,n?_.itemActive:void 0,s?_.itemLast:void 0),onClick:()=>E?.(e._raw,r),onMouseEnter:()=>B(o)},p&&t.createElement("span",{style:_.itemIndex},o+1),t.createElement("div",{style:_.itemContent},t.createElement("div",{style:_.itemQuery,dangerouslySetInnerHTML:{__html:tt(e.query,a,{tag:"mark"})}}),e.count&&t.createElement("div",{style:_.itemMeta},e.count.toLocaleString()," results")),g&&t.createElement("span",{style:_.itemType},"Search"))})),F.length>0&&t.createElement(t.Fragment,null,f&&t.createElement("div",{style:_.divider},"Products"),F.slice(0,4).map((e,r)=>{const a=Q++,o=D===a;return t.createElement("div",{key:e.id,"data-index":a,style:lt(_.productRow,o?_.productRowActive:void 0),onClick:()=>S?.(e._raw,r),onMouseEnter:()=>B(a)},e.image&&t.createElement("img",{src:e.image,alt:e.title,style:_.productImage,loading:"lazy"}),t.createElement("div",{style:_.productContent},t.createElement("div",{style:_.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:_.productPrice},Je(e.price,{currency:u.currency||e.currency||"$"}))),g&&t.createElement("span",{style:_.itemType},"Product"))})))),void 0!==N?N:t.createElement("div",{style:_.footer},t.createElement("div",{style:_.footerHint},t.createElement("span",null,t.createElement("span",{style:_.kbd},"↑")," ",t.createElement("span",{style:_.kbd},"↓")," navigate"),t.createElement("span",null,t.createElement("span",{style:_.kbd},"↵")," select"),t.createElement("span",null,t.createElement("span",{style:_.kbd},"esc")," close")),t.createElement("span",null,q.length," results")))});function Dr(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 Br={amazon:dr,google:fr,pinterest:xr,spotlight:Cr,shopify:Nr,"mobile-sheet":Lr,minimal:Pr},$r=t.forwardRef(function(e,r){const{client:a,variant:o="amazon",autoMobileVariant:n=!0,placeholder:s="Search...",defaultQuery:i="",value:l,minQueryLength:c=1,maxSuggestions:d=8,debounceMs:u=200,includeDropdownRecommendations:m=!0,includeDropdownProductList:p=!0,includeFilteredTabs:g=!0,includeCategories:f=!0,filteredTabs:h,analyticsTags:y,enableRecentSearches:b=!0,maxRecentSearches:v=10,showProducts:x=!0,showTrendingOnEmpty:k=!0,enableAnalytics:E=!0,analyticsConfig:w,suggestionFields:C,productFields:R,theme:I,onSearch:N,onQueryChange:T,onSuggestionSelect:z,onProductClick:M,onCategoryClick:A,onTabChange:_,className:L,style:P,inputClassName:D,dropdownWidth:B,dropdownMaxHeight:$="500px",zIndex:F=1e3,enableCache:W=!0,cacheTtlMs:q=3e4,cacheMaxSize:H=100}=e,O=S(),j=I??O.theme,V=fe({client:a,enabled:E,analyticsTags:w?.tags??y,trackImpressions:w?.trackImpressions??!0,trackClicks:w?.trackSuggestionClicks??!0});or(),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=tr(),{isMobile:Q}=U,G=t.useMemo(()=>n&&Q&&"mobile-sheet"!==o&&"spotlight"!==o?"mobile-sheet":o,[o,Q,n]),[X,Y]=t.useState(i),[K,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,me]=t.useState([]),[pe,ge]=t.useState([]),[he,ye]=t.useState("all"),be=t.useRef(null),ve=t.useRef(null),xe=t.useRef(null),ke=t.useRef(null),Ee=t.useMemo(()=>W?ht({maxSize:H,defaultTtlMs:q}):null,[W,H,q]),Se=void 0!==l?l:X,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"},loadingSpinner:{width:"18px",height:"18px",borderWidth:"2px",borderStyle:"solid",borderColor:"#e5e7eb",borderTopColor:"#f90",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite",marginRight:"12px",flexShrink:0}}))(Q),[Q]);t.useEffect(()=>{if(b){const e=dt();ge(e.slice(0,v))}},[b,v]);const Ce=t.useCallback(async e=>{if(!a)return;if(e.length>0&&e.length<c)return oe([]),se([]),void de([]);const t={maxSuggestions:d,includeDropdownRecommendations:m,includeDropdownProductList:p,includeFilteredTabs:g,includeCategories:f,filteredTabs:h?.map(e=>e.filter).join(",")},r=Ee?.generateKey(e,t);if(Ee&&r){const t=Ee.get(r);if(t)return console.log("Seekora: Cache hit for query:",e),void Re(t)}re(!0);try{const t=await(a.getSuggestions?.(e,{hitsPerPage:d,include_dropdown_recommendations:m,include_dropdown_product_list:p,include_filtered_tabs:g,include_categories:f,filtered_tabs:h,analytics_tags:y,returnFullResponse:!0}));if(Ee&&r&&t&&(Ee.set(r,t),console.log("Seekora: Cached response for query:",e)),Re(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,m,p,g,f,h,y,E,V,Ee]),Re=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||[]),me(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)})},[]),Ie=t.useCallback(e=>{const t=e.target.value;void 0===l&&Y(t),T?.(t),ye("all"),xe.current&&clearTimeout(xe.current),t.length>=c?(Z(!0),xe.current=setTimeout(()=>{Ce(t)},u)):0===t.length&&(b||k)?(Z(!0),oe([])):Z(!1)},[l,T,c,u,Ce,b,k]),Ne=t.useCallback(()=>{ee(!0),Z(!0),E&&V.trackDropdownOpen(Se),Se.length>=c?0===ae.length&&Ce(Se):Ce("")},[Se,c,ae.length,Ce,E,V]),Te=t.useCallback(()=>{ee(!1),setTimeout(()=>{ke.current?.contains(document.activeElement)||Z(!1)},150)},[]),ze=t.useCallback(e=>{if("Escape"===e.key)Z(!1),be.current?.blur();else if("Enter"===e.key){e.preventDefault();(ve.current?.getActiveIndex?.()??-1)>=0&&K?ve.current?.selectActive?.():Se.trim()&&(N?.(Se.trim()),b&&(ut(Se.trim()),ge(dt().slice(0,v))),E&&V.trackSearchSubmit(Se.trim(),!1),Z(!1))}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),!K&&(ae.length>0||pe.length>0)&&Z(!0),"ArrowDown"===e.key?ve.current?.navigateNext?.():ve.current?.navigatePrevious?.())},[Se,N,b,v,K,ae.length,pe.length,E,V]),Me=t.useCallback((e,t)=>{const r=e.query||e.text||e.objectID||"";void 0===l&&Y(r),T?.(r),z?.(e,t),b&&r&&(ut(r),ge(dt().slice(0,v))),E&&(V.trackSuggestionClick({suggestion:{query:r,objectID:e.objectID||e.id,popularity:e.popularity},position:t,section:"suggestions",query:Se,totalSuggestions:ae.length}),V.trackSearchSubmit(r,!0,e)),N?.(r),Z(!1)},[l,T,z,b,v,E,N,V,Se,ae.length]),Ae=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"!==he?"filtered_tab":"products",tabId:"all"!==he?he:void 0,query:Se})},[M,E,V,he,Se]),_e=t.useCallback((e,t)=>{A?.(e,t),E&&V.trackCategoryClick({value:e.label||e.value||e.id,count:e.count,path:e.path},Se)},[A,E,V,Se]),Le=t.useCallback(e=>{if(console.log("Seekora: Tab changed to",e),ye(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},Se)}},[_,E,V,ce,Se]),Pe=t.useCallback(e=>{void 0===l&&Y(e),T?.(e),Ce(e),E&&V.trackRecentSearchClick({query:e,timestamp:Date.now()})},[l,T,Ce,E,V]),De=t.useCallback(e=>{mt(e),ge(dt().slice(0,v))},[v]),Be=t.useCallback(()=>{void 0===l&&Y(""),T?.(""),oe([]),se([]),de([]),be.current?.focus()},[l,T]),$e=t.useCallback(()=>{Z(!1),E&&V.trackDropdownClose(Se)},[E,V,Se]);t.useImperativeHandle(r,()=>({focus:()=>be.current?.focus(),blur:()=>be.current?.blur(),clear:Be,getQuery:()=>Se,setQuery:e=>{void 0===l&&Y(e),T?.(e)},openDropdown:()=>Z(!0),closeDropdown:()=>Z(!1),refresh:()=>Ce(Se),clearCache:()=>Ee?.clear(),getCacheStats:()=>Ee?.getStats()??null}),[Se,l,T,Be,Ce,Ee]);const Fe=Br[G]||dr,We=t.useMemo(()=>{if(console.log("Seekora: Computing products for tab",he,"from",ce.length,"tabs"),0===ce.length)return ne;if("all"===he){const e=ce[0]?.products||[];return e.length>0?e:ne}const e=ce.find(e=>e.id===he);return e?.products&&e.products.length>0?(console.log("Seekora: Found",e.products.length,"products for tab",he),e.products):ne},[he,ce,ne]);return t.createElement("div",{ref:ke,className:it("seekora-suggestion-search",L),style:lt(we.container,P)},t.createElement("div",{style:lt(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:be,type:"text",value:Se,onChange:Ie,onFocus:Ne,onBlur:Te,onKeyDown:ze,placeholder:s,className:D,style:we.input,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":"Search","aria-expanded":K,"aria-haspopup":"listbox"}),te&&t.createElement("div",{style:we.loadingSpinner}),Se&&!te&&t.createElement("button",{type:"button",onClick:Be,style:we.clearButton,"aria-label":"Clear search"},"×")),K&&t.createElement(Fe,{query:Se,isOpen:K,loading:te,suggestions:ae,products:We,categories:ce.map(e=>({id:e.id,label:e.label,count:e.nb_hits})),recentSearches:pe.map(e=>"string"==typeof e?e:e.query),trendingSearches:ue,filteredTabs:ce,activeTab:he,suggestionFields:C,productFields:R,theme:Dr(j)??j,width:B||"100%",maxHeight:$,zIndex:F,analytics:{enabled:E,trackSuggestionClicks:w?.trackSuggestionClicks??!0,trackProductClicks:w?.trackProductClicks??!0,trackImpressions:w?.trackImpressions??!0,trackCategoryClicks:w?.trackCategoryClicks??!0,trackBrandClicks:w?.trackBrandClicks??!0,trackSearchSubmit:w?.trackSearchSubmit??!0,tags:w?.tags??y},onSuggestionSelect:Me,onProductClick:Ae,onCategoryClick:_e,onTabChange:Le,onRecentClick:Pe,onRecentRemove:De,onClose:$e}))}),Fr={amazon:dr,google:fr,pinterest:xr,spotlight:Cr,shopify:Nr,"mobile-sheet":Lr,minimal:Pr};function Wr({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 qr({value:e,onChange:r,onKeyDown:a,placeholder:o="Search documentation...",isLoading:n=!1,onClear:s}){const i=t.useRef(null);t.useEffect(()=>{i.current&&i.current.focus()},[]);return t.createElement("div",{className:"seekora-docsearch-searchbox"},t.createElement("label",{className:"seekora-docsearch-searchbox-icon",htmlFor:"seekora-docsearch-input"},n?t.createElement("span",{className:"seekora-docsearch-spinner","aria-hidden":"true"},t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},t.createElement("circle",{cx:"10",cy:"10",r:"8",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeDasharray:"40",strokeDashoffset:"10"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 10 10",to:"360 10 10",dur:"0.8s",repeatCount:"indefinite"})))):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:i,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(""),s?.(),i.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 Hr({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 Or({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,m=d.parentTitle?`${d.category||""} › ${d.parentTitle}`.replace(/^› /,""):d.category||"",p=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=p,f=e.content||d.description||"";if(c){const t=e;t._highlightResult&&(g=t._highlightResult.title?.value||p,f=t._highlightResult.content?.value||e.content||"")}else d.highlight&&(g=d.highlight.title||p,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(Ur,{isLast:i})),t.createElement("div",{className:"seekora-docsearch-hit-icon"},t.createElement(Vr,{type:jr(u)})),t.createElement("div",{className:"seekora-docsearch-hit-content"},!s&&m&&t.createElement("span",{className:"seekora-docsearch-hit-breadcrumb"},m),t.createElement("span",{className:"seekora-docsearch-hit-title"},t.createElement(Hr,{value:p,highlightedValue:g})),h&&t.createElement("span",{className:"seekora-docsearch-hit-description"},t.createElement(Hr,{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 jr(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 Vr({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 Ur({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 Qr(e){if(!e)return 1;const t=e.match(/^lvl(\d+)$/);return t?parseInt(t[1],10):1}function Gr(e){return Qr(e)>=2}function Xr(e){const t=e.hierarchy??{};return[t.lvl0??"",t.lvl1??"",t.lvl2??"",t.lvl3??"",t.lvl4??"",t.lvl5??""].join("\0")}function Yr(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 Kr(e,t){return"objectID"in e?e.objectID:`suggestion-${e.url}-${t}`}function Zr({hits:e,groupedHits:r,selectedIndex:a,onSelect:o,onHover:n,scrollSelectionIntoViewRef:s,query:i,isLoading:l,error:c,translations:d={},sources:u=[]}){const m=t.useRef(null);if(t.useEffect(()=>{if(!m.current||0===e.length)return;if(s&&!s.current)return;const t=m.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-loading"},t.createElement("div",{className:"seekora-docsearch-loading-spinner"},t.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true"},t.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeDasharray:"50",strokeDashoffset:"15"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"0.8s",repeatCount:"indefinite"})))),t.createElement("p",{className:"seekora-docsearch-loading-text"},d.loadingText||"Searching..."));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 p=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=Xr(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 Qr(r)-Qr(a)}),r=t.map((e,r)=>{const a=Gr(e.type),o=t[r+1],n=a&&(!o||!Gr(o.type));return{...e,isChild:a,isLastChild:n}}),a=Yr(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:m,id:"seekora-docsearch-results",className:"seekora-docsearch-results-list",role:"listbox"},p.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}(p,r,i),c=s;return t.createElement("li",{key:Kr(s,i)},t.createElement(Or,{hit:s,isSelected:l===a,onClick:()=>o(s),onMouseEnter:()=>n(l),openInNewTab:e.openInNewTab,isChild:c.isChild,isLastChild:c.isLastChild,hierarchyType:s.type}))}))))))}function Jr({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("span",{className:"seekora-docsearch-logo",style:{fontFamily:"system-ui",fontSize:14,fontWeight:600}},"Seekora"))))}function ea(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 ta(e="K"){if("undefined"==typeof navigator)return`⌘${e}`;return navigator.platform.toLowerCase().includes("mac")?`⌘${e}`:`Ctrl+${e}`}function ra({onClick:e,placeholder:r="Search documentation..."}){const a=ta("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 aa={query:"",results:[],suggestions:[],groupedSuggestions:[],isLoading:!1,error:null,selectedIndex:0,mode:"suggestions"};function oa(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 aa;default:return e}}function na(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(oa,aa),u=t.useRef(new Map),m=t.useRef(null),p=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})):p(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.suggestions||e.results||e.hits||[]).map(e=>({url:e.url||e.route||"",title:e.title?.replace?.(/<\/?mark>/g,"")||e.title||"",content:e.content?.replace?.(/<\/?mark>/g,"")?.substring?.(0,100)||e.description||"",description:e.description||e.content?.substring?.(0,100)||"",category:e.category||e.hierarchy?.lvl0||"",hierarchy:e.hierarchy,route:e.route,parentTitle:e.parent_title||e.parentTitle,_source:t})))(s,e.id)}catch(e){if(e instanceof Error&&"AbortError"===e.name)throw e;return[]}},[p]),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}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>f(e),s)},[f,s]),b=t.useCallback(()=>d({type:"SELECT_NEXT"}),[]),v=t.useCallback(()=>d({type:"SELECT_PREV"}),[]),x=t.useCallback(e=>d({type:"SET_SELECTED_INDEX",payload:e}),[]),k=t.useCallback(()=>{u.current.forEach(e=>e.abort()),u.current.clear(),m.current&&clearTimeout(m.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(),m.current&&clearTimeout(m.current)},[]),{...c,sources:l,setQuery:y,search:h,fetchSuggestions:f,selectNext:b,selectPrev:v,setSelectedIndex:x,reset:k,getSelectedItem:E}}function sa(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,m]=t.useState(""),[p,g]=t.useState([]),[f,h]=t.useState(!1),[y,b]=t.useState(null),[v,x]=t.useState(0),k=t.useRef(null),E=t.useRef(null),S=t.useRef(null),w=t.useRef(null);t.useEffect(()=>{if(!r)return;const e={storeId:r,readSecret:o,logLevel:"warn",enableContextCollection:!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{k.current=new a.SeekoraClient(e)}catch(e){console.error("Failed to initialize SeekoraClient:",e),b("Failed to initialize search client")}return()=>{k.current=null}},[r,o,n]);const C=t.useCallback(async e=>{if(k.current)if(e.trim()){w.current&&w.current.abort(),w.current=new AbortController,h(!0),b(null);try{const t=await k.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(w.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,m="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??m?{title:u,content:m}:void 0}})}(t.results||[])),x(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=>{m(e),x(0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>C(e),i)},[C,i]),I=t.useCallback(()=>{x(e=>e>=p.length-1?0:e+1)},[p.length]),N=t.useCallback(()=>{x(e=>e<=0?p.length-1:e-1)},[p.length]),T=t.useCallback(()=>{w.current&&w.current.abort(),S.current&&clearTimeout(S.current),m(""),g([]),h(!1),b(null),x(0)},[]),z=t.useCallback(()=>p[v]||null,[p,v]),M=t.useCallback((e,t)=>{const r=k.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(()=>()=>{w.current&&w.current.abort(),S.current&&clearTimeout(S.current)},[]),{query:u,suggestions:p,isLoading:f,error:y,selectedIndex:v,setQuery:R,selectNext:I,selectPrev:N,setSelectedIndex:x,reset:T,getSelectedItem:z,trackDocClick:M}}function ia(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 la={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 ca={"--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"},da={...ca,"--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)"},ua={...ca,"--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"},ma={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 pa(e=ca){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 ga=!1;function fa(e=ca,t=!1){if("undefined"==typeof document)return;if(ga&&!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=pa(e),ga=!0}e.ActionButtons=Oe,e.AmazonDropdown=dr,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"),m={};switch(s&&(m.product_id=s),i&&(m.position=parseInt(i,10)),l&&(m.section=l),o){case"click":if(n("product.click",m),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&&(m.variant_sku=c),n("product.add_to_cart",m);break;case"variant-select":d&&(m.option_name=d),u&&(m.option_value=u),n("product.variant_select",m);break;default:o&&n(o,m)}};return t.addEventListener("click",a),()=>t.removeEventListener("click",a)},[e,r,n]),t.createElement(Qt.Provider,{value:{client:e,context:r}},t.createElement("div",{ref:o,style:{display:"contents"}},a))},e.BadgeList=xt,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:m}=S(),{refinements:p,removeRefinement:g,clearRefinements:f}=w(),h=c||{},y=t.useMemo(()=>{if(d)return d;const t=[];return e.forEach((e,a)=>{const o=p.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,p,r,d]),b=t.useCallback((t,r)=>{if(null===t)e.forEach(e=>{p.filter(t=>t.field===e).forEach(e=>g(e.field,e.value,!1))}),m.search();else{const r=y.findIndex(e=>e.value===t.value);e.forEach((e,a)=>{p.filter(t=>t.field===e).forEach(e=>{(a>r||a===r&&e.value!==t.value)&&g(e.field,e.value,!1)})}),m.search()}s&&s(t,r)},[e,p,g,m,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=$t,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:m}=S(),{query:p,refinements:g,clearRefinements:f,setQuery:h,removeRefinement:y}=w(),b=d||{},v=t.useMemo(()=>g.filter(e=>!n.includes(e.field)&&!(o&&!o.includes(e.field))),[g,o,n]),x=v.length>0||e&&p.length>0,k=()=>{x&&(o||n.length>0?(v.forEach(e=>{y(e.field,e.value,!1)}),v.length>0&&f(!1)):f(!e),e&&p.length>0&&h("",!0),s&&s())};return u&&!x?null:i?t.createElement("div",{className:I(b.root,l),style:c},i({canClear:x,onClick:k,disabled:!x})):t.createElement("div",{className:I(b.root,l),style:c},t.createElement("button",{type:"button",onClick:k,disabled:!x,className:I(b.button,!x&&b.buttonDisabled),style:{padding:`${m.spacing.small} ${m.spacing.medium}`,fontSize:m.typography.fontSize.medium,fontWeight:m.typography.fontWeight?.medium||500,backgroundColor:x?m.colors.primary:m.colors.hover,color:x?"#ffffff":m.colors.textSecondary,border:"none",borderRadius:"string"==typeof m.borderRadius?m.borderRadius:m.borderRadius.medium,cursor:x?"pointer":"not-allowed",opacity:x?1:.6,transition:m.transitions?.fast||"150ms ease-in-out"},"aria-label":x?r:a},x?r:a))},e.CurrentRefinements=({refinements:e=[],onRefinementClear:r,onClearAll:a,renderRefinement:o,showClearAll:n=!0,className:s,style:i,theme:l})=>{const{theme:c}=S(),d=l||{},u=(e,a)=>t.createElement("div",{key:`${e.field}-${e.value}-${a}`,className:d.item,style:{display:"inline-flex",alignItems:"center",padding:`${c.spacing.small} ${c.spacing.medium}`,margin:`0 ${c.spacing.small} ${c.spacing.small} 0`,backgroundColor:c.colors.hover,border:`1px solid ${c.colors.border}`,borderRadius:"string"==typeof c.borderRadius?c.borderRadius:c.borderRadius.medium,fontSize:c.typography.fontSize.small}},t.createElement("span",{className:d.label,style:{marginRight:c.spacing.small,color:c.colors.text,fontWeight:"500"}},e.label||e.field,":"),t.createElement("span",{className:d.value,style:{marginRight:c.spacing.small,color:c.colors.text}},e.displayValue||e.value),t.createElement("button",{type:"button",onClick:()=>{return t=e.field,a=e.value,void(r&&r(t,a));var t,a},className:d.clearButton,style:{border:"none",backgroundColor:"transparent",color:c.colors.text,cursor:"pointer",fontSize:c.typography.fontSize.medium,padding:0,marginLeft:c.spacing.small,width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:c.transitions?.fast||"150ms ease-in-out"},"aria-label":`Clear ${e.label||e.field}: ${e.value}`},"×"));return 0===e.length?null:t.createElement("div",{className:I(d.container,s),style:i},t.createElement("div",{className:d.list,style:{display:"flex",flexWrap:"wrap",alignItems:"center",marginBottom:n?c.spacing.medium:0}},e.map((e,t)=>o?o(e,t):u(e,t))),n&&e.length>1&&t.createElement("button",{type:"button",onClick:()=>{a&&a()},className:d.clearAllButton,style:{padding:`${c.spacing.small} ${c.spacing.medium}`,border:`1px solid ${c.colors.border}`,borderRadius:"string"==typeof c.borderRadius?c.borderRadius:c.borderRadius.medium,backgroundColor:c.colors.background,color:c.colors.text,cursor:"pointer",fontSize:c.typography.fontSize.small,textDecoration:"underline"}},"Clear all filters"))},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:m={},renderButton:p=!0,buttonComponent:g=ra,initialOpen:f=!1,disableShortcut:h=!1,shortcutKey:y="k",processGroupedResults:b}){const[v,x]=t.useState(f),k=t.useRef(!1),E=!!e,S=sa({storeId:e||"",storeSecret:r,apiEndpoint:a,maxResults:l,debounceMs:c,analyticsTags:["docsearch"]}),w=na({apiEndpoint:o,apiKey:n,sources:s,maxResults:l,debounceMs:c,processGroupedResults:b}),{query:C,suggestions:R,isLoading:I,error:N,selectedIndex:T,setQuery:z,selectNext:M,selectPrev:A,setSelectedIndex:_,reset:L,getSelectedItem:P}=E?S:w,D=E?void 0:w.groupedSuggestions,B=E?R:w.results,$=E?"suggestions":w.mode,F=E?[{id:"seekora",name:"Results",endpoint:""}]:w.sources,W=t.useCallback(()=>x(!0),[]),q=t.useCallback(()=>{x(!1),L(),u?.()},[L,u]),H=t.useCallback(e=>{E&&S.trackDocClick&&S.trackDocClick(e,T+1),d?d(e):window.location.href=e.url,q()},[d,q,E,S,T]),O=t.useCallback(()=>{const e=P();e&&H(e)},[P,H]),j=t.useCallback(()=>{k.current=!0,M()},[M]),V=t.useCallback(()=>{k.current=!0,A()},[A]),{handleModalKeyDown:U}=ea({isOpen:v,onOpen:W,onClose:q,onSelectNext:j,onSelectPrev:V,onEnter:O,disableShortcut:h,shortcutKey:y}),Q=t.useCallback(e=>U(e),[U]),G="results"===$?B:R;return t.createElement(t.Fragment,null,p&&t.createElement(g,{onClick:W,placeholder:m.buttonText||i}),t.createElement(Wr,{isOpen:v,onClose:q},t.createElement("div",{className:"seekora-docsearch-modal",onKeyDown:Q},t.createElement("header",{className:"seekora-docsearch-header"},t.createElement(qr,{value:C,onChange:z,onKeyDown:Q,placeholder:i,isLoading:I,onClear:L}),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(Zr,{hits:G,groupedHits:D,selectedIndex:T,onSelect:H,onHover:_,scrollSelectionIntoViewRef:k,query:C,isLoading:I,error:N,translations:m,sources:F})),t.createElement(Jr,{translations:m}))))},e.DocSearchButton=ra,e.DropdownPanel=Ne,e.Facets=({results:e,facets:r,onFacetChange:a,renderFacet:o,renderFacetItem:n,maxItems:s=10,showMore:i=!0,className:c,style:d,theme:m})=>{const{theme:p}=S(),{results:g,refinements:f,addRefinement:h,removeRefinement:y}=w(),b=m||{},[v,x]=t.useState({}),k=e||g,E=(()=>{if(r)return r;const e=k?.data?.facets||k?.facets||k?.data?.data?.facets||null;if(l("Facets: Extracting facets",{hasResults:!!k,hasData:!!k?.data,rawFacets:e?Array.isArray(e)?e.length:"not array":null,resultsKeys:k?Object.keys(k):[],dataKeys:k?.data?Object.keys(k.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:k?JSON.stringify(Object.keys(k)):"null",dataStructure:k?.data?JSON.stringify(Object.keys(k.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:f.some(r=>r.field===t&&r.value===e.value)})):[]}});return l("Facets: Extracted facets",{count:t.length,facets:t.map(e=>({field:e.field,itemsCount:e.items.length}))}),t})(),C=(e,t,r)=>{const o=!r;if(l("Facets: Facet toggled",{field:e,value:t,selected:o}),o?h(e,t):y(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})}},R=e=>{x(t=>({...t,[e]:!t[e]}))},N=(e,r)=>{const a=v[e.field]||!1,o=a?e.items:e.items.slice(0,s),l=e.items.length>s;return t.createElement("div",{key:e.field,className:b.facet,style:{marginBottom:p.spacing.large,padding:p.spacing.medium,backgroundColor:p.colors.background,border:`1px solid ${p.colors.border}`,borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium}},t.createElement("h3",{className:b.facetTitle,style:{fontSize:p.typography.fontSize.large,fontWeight:"bold",margin:0,marginBottom:p.spacing.medium,color:p.colors.text}},e.label||e.field),t.createElement("div",{className:b.facetList},o.map((r,a)=>{const o=a;return n?n(r,e,o):((e,r,a)=>!(v[r.field]||a<s)&&a>=s?null:t.createElement("div",{key:`${r.field}-${e.value}`,className:I(b.facetItem,(f.some(t=>t.field===r.field&&t.value===e.value)||e.selected)&&b.facetItemActive),onClick:()=>C(r.field,e.value,e.selected||!1),style:{display:"flex",alignItems:"center",padding:p.spacing.small,cursor:"pointer",borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,marginBottom:p.spacing.small,backgroundColor:f.some(t=>t.field===r.field&&t.value===e.value)||e.selected?p.colors.hover:"transparent",transition:"background-color 0.2s ease"}},t.createElement("input",{type:"checkbox",checked:f.some(t=>t.field===r.field&&t.value===e.value)||e.selected||!1,onChange:()=>C(r.field,e.value,e.selected||!1),className:b.checkbox,style:{marginRight:p.spacing.small,cursor:"pointer"},"aria-label":`Filter by ${e.value}`}),t.createElement("span",{className:b.facetItemLabel,style:{flex:1,fontSize:p.typography.fontSize.medium,color:p.colors.text}},e.value),t.createElement("span",{className:b.facetItemCount,style:{fontSize:p.typography.fontSize.small,color:p.colors.textSecondary||p.colors.text,opacity:.7,marginLeft:p.spacing.small}},"(",e.count,")")))(r,e,o)})),i&&l&&!a&&t.createElement("button",{type:"button",onClick:()=>R(e.field),style:{marginTop:p.spacing.small,padding:p.spacing.small,border:"none",backgroundColor:"transparent",color:p.colors.primary,cursor:"pointer",fontSize:p.typography.fontSize.small,textDecoration:"underline"}},"Show more (",e.items.length-s," more)"),a&&l&&t.createElement("button",{type:"button",onClick:()=>R(e.field),style:{marginTop:p.spacing.small,padding:p.spacing.small,border:"none",backgroundColor:"transparent",color:p.colors.primary,cursor:"pointer",fontSize:p.typography.fontSize.small,textDecoration:"underline"}},"Show less"))};return 0===E.length?(l("Facets: No facets to display",{hasResults:!!k,resultsType:k?typeof k:"null"}),null):t.createElement("div",{className:I(b.container,c),style:d},E.map((e,t)=>o?o(e,t):N(e)))},e.FederatedDropdown=ae,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:m="$",showAddAllButton:p=!0,onAddAll:g})=>{const{theme:f}=S(),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?t.createElement("div",{className:I(h.root,l),style:c},t.createElement("div",{className:h.loading,style:z(f)},"Loading recommendations...")):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}},m,"number"==typeof e.price?e.price.toFixed(2):e.price))))),p&&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: ",m,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=fr,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:m="name",items:p})=>{const{theme:g,stateManager:f}=S(),{results:h,refinements:y,addRefinement:b,removeRefinement:v}=w(),x=d||{},[k,E]=t.useState({}),C=t.useCallback(()=>{if(p)return p;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,p]),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"===m)return(t.count||0)-(e.count||0);if("isRefined"===m){if(e.isRefined&&!t.isRefined)return-1;if(!e.isRefined&&t.isRefined)return 1}return e.label.localeCompare(t.label)}),e},[C,m]),T=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]),z=(e,r)=>{if(!e||0===e.length)return null;const i=k[r]||!1,l=i?n:a,c=e.slice(0,l),d=e.length>l;return t.createElement("ul",{className:x.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,className:I(x.item,e.isRefined&&x.itemSelected,e.data&&e.data.length>0&&x.itemParent),style:{padding:`${g.spacing.small} 0`}},s?s(e,r):t.createElement(t.Fragment,null,t.createElement("button",{type:"button",onClick:()=>T(e,r),className:x.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:x.label,style:{flex:1}},e.label),void 0!==e.count&&t.createElement("span",{className:x.count,style:{color:g.colors.textSecondary,fontSize:g.typography.fontSize.small}},e.count)),e.isRefined&&e.data&&e.data.length>0&&z(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:x.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",{className:I(x.root,l),style:c},z(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}=S(),u=n||{},f=t.useMemo(()=>m({hit:e,attribute:r,preTag:"<mark>",postTag:"</mark>"}),[e,r]),h=t.useMemo(()=>{const t=p(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}=S(),{itemsPerPage:d,setPage:u}=w(),{stateManager:m}=S(),p=s||{},g=e.find(e=>e.default)||e[0],[f,h]=t.useState(g?.value||10);t.useEffect(()=>{l&&g&&d!==g.value&&m.setItemsPerPage(g.value,!1)},[]);const y=l?d:f,b=e=>{const t=parseInt(e.target.value,10);h(t),l&&(m.setItemsPerPage(t,!1),u(1,!0)),r&&r(t)};return a?t.createElement("div",{className:I(p.root,o),style:n},a({value:y,onChange:b,items:e})):t.createElement("div",{className:I(p.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("select",{value:y,onChange:b,className:p.select,style:{padding:c.spacing.small,paddingRight:c.spacing.medium,fontSize:c.typography.fontSize.medium,border:`1px solid ${c.colors.border}`,borderRadius:"string"==typeof c.borderRadius?c.borderRadius:c.borderRadius.medium,backgroundColor:c.colors.background,color:c.colors.text,cursor:"pointer",outline:"none"},"aria-label":"Results per page"},e.map(e=>t.createElement("option",{key:e.value,value:e.value,className:p.option},e.label))))},e.ImageDisplay=$e,e.ImageZoom=De,e.InfiniteHits=({renderHit:e,renderEmpty:r,renderLoading:a,renderShowMore:o,showMoreButton:n=!0,useInfiniteScroll:s=!1,scrollThreshold:i=.1,fieldMapping:l,showMoreLabel:c="Show more",loadingLabel:d="Loading...",onHitClick:u,className:m,style:p,theme:g,syncWithState:f=!0})=>{const{theme:h,stateManager:y}=S(),{results:b,loading:v,currentPage:x,setPage:k}=w(),E=g||{},[C,R]=t.useState([]),[N,T]=t.useState(!1),z=t.useRef(null),M=t.useRef(x),A=t.useCallback(e=>e?e.results?e.results:e.hits?e.hits:Array.isArray(e)?e:[]:[],[]),_=t.useMemo(()=>A(b),[b,A]),L=b?.totalResults||b?.found||0,P=y.getState().itemsPerPage||10,D=Math.ceil(L/P),B=x>=D;t.useEffect(()=>{_.length&&(1===x?R(_):x>M.current&&R(e=>[...e,..._]),M.current=x,T(!1))},[_,x]),t.useEffect(()=>{1===x&&(R(_),M.current=1)},[b]);const $=t.useCallback(()=>{B||v||N||(T(!0),f&&k(x+1))},[B,v,N,f,k,x]);t.useEffect(()=>{if(!s||!z.current)return;const e=new IntersectionObserver(e=>{!e[0].isIntersecting||B||v||N||$()},{threshold:i});return e.observe(z.current),()=>e.disconnect()},[s,i,B,v,N,$]);const F=(e,t)=>{if(!l||!l[t])return e[t]||"";return e[l[t]]||""},W=()=>t.createElement("div",{className:E.loading,style:{padding:h.spacing.medium,textAlign:"center",color:h.colors.textSecondary}},d);return v&&0===C.length?t.createElement("div",{className:I(E.root,m),style:p},a?a():W()):v||0!==C.length?t.createElement("div",{className:I(E.root,m),style:p},t.createElement("div",{className:E.list},C.map((r,a)=>e?e(r,a):((e,r)=>{const a=F(e,"title")||e.title||"",o=F(e,"description")||e.description||"",n=F(e,"image")||e.image||e.imageUrl||"",s=F(e,"price")||e.price;return t.createElement("div",{key:e.id||r,className:E.item,style:{display:"flex",gap:h.spacing.medium,padding:h.spacing.medium,borderBottom:`1px solid ${h.colors.border}`,cursor:u?"pointer":"default",transition:h.transitions?.fast||"150ms ease-in-out"},onClick:()=>u?.(e,r),role:u?"button":void 0,tabIndex:u?0:void 0},n&&t.createElement("img",{src:n,alt:a,style:{width:"80px",height:"80px",objectFit:"cover",borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.small}}),t.createElement("div",{style:{flex:1}},t.createElement("h3",{style:{margin:0,marginBottom:h.spacing.small,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.semibold||600,color:h.colors.text}},a),o&&t.createElement("p",{style:{margin:0,fontSize:h.typography.fontSize.small,color:h.colors.textSecondary,lineHeight:h.typography.lineHeight?.normal||1.5}},o),s&&t.createElement("span",{style:{display:"inline-block",marginTop:h.spacing.small,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.bold||700,color:h.colors.primary}},"$","number"==typeof s?s.toFixed(2):s)))})(r,a))),n&&!s&&!B&&(o?o({isLoading:N,isLastPage:B,onClick:$}):t.createElement("button",{type:"button",onClick:$,disabled:B||N,className:I(E.loadMore,(B||N)&&E.loadMoreDisabled),style:{display:"block",width:"100%",padding:h.spacing.medium,marginTop:h.spacing.medium,fontSize:h.typography.fontSize.medium,fontWeight:h.typography.fontWeight?.medium||500,backgroundColor:B||N?h.colors.hover:h.colors.primary,color:B||N?h.colors.textSecondary:"#ffffff",border:"none",borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,cursor:B||N?"not-allowed":"pointer",transition:h.transitions?.fast||"150ms ease-in-out"}},N?d:B?"No more results":c)),N&&(a?a():W()),s&&!B&&t.createElement("div",{ref:z,className:E.sentinel,style:{height:"1px",visibility:"hidden"},"aria-hidden":"true"})):t.createElement("div",{className:I(E.root,m),style:p},r?r():t.createElement("div",{className:E.empty,style:{padding:h.spacing.large,textAlign:"center",color:h.colors.textSecondary}},"No results found"))},e.ItemCard=Ue,e.ItemGrid=Ge,e.MinimalDropdown=Pr,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:m=!0,showFilterCount:p=!0,closeOnBackdropClick:g=!0,closeOnEscape:f=!0})=>{const{theme:h}=S(),{refinements:y,clearRefinements:b}=w(),v=d||{},x=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&&x.current){const e=x.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 k=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:k,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:x,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),p&&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),m&&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,p&&y.length>0&&` (${y.length})`)))):null},e.MobileFiltersButton=({onClick:e,text:r="Filters",showCount:a=!0,className:o,style:n})=>{const{theme:s}=S(),{refinements:i}=w();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=Lr,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:m})=>{const{theme:p}=S(),{results:g,currentPage:f,setPage:h}=w(),y=m||{},b=r||f,v=e||g,x=a||v?.perPage||v?.data?.per_page||v?.data?.data?.per_page||20,k=v?.totalResults||v?.data?.total_results||v?.data?.data?.total_results||0,E=o||v?.totalPages||v?.data?.total_pages||v?.data?.data?.total_pages||Math.ceil(k/x),C=e=>{e<1||e>E||e===b||(h(e),n&&n(e))};if(E<=1)return null;const R=(()=>{const e=[],t=Math.floor(s/2);let r=Math.max(1,b-t),a=Math.min(E,b+t);b<=t&&(a=Math.min(s,E)),b>=E-t&&(r=Math.max(1,E-s+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<E&&(a<E-1&&e.push("ellipsis"),e.push(E)),e})();return t.createElement("nav",{className:I(y.container,d),style:u,"aria-label":"Pagination"},t.createElement("ul",{className:y.list,style:{listStyle:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,flexWrap:"wrap"}},l&&t.createElement("li",null,t.createElement("button",{type:"button",disabled:1===b,onClick:()=>C(b-1),className:I(y.item,1===b&&y.itemDisabled),style:{padding:p.spacing.small,margin:`0 ${p.spacing.small}`,border:`1px solid ${p.colors.border}`,borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,backgroundColor:p.colors.background,color:p.colors.text,cursor:1===b?"not-allowed":"pointer",opacity:1===b?.5:1,fontSize:p.typography.fontSize.medium},"aria-label":"Previous page"},"Previous")),R.map((e,r)=>{if("ellipsis"===e)return t.createElement("li",{key:`ellipsis-${r}`},t.createElement("span",{className:y.ellipsis,style:{padding:p.spacing.small,margin:`0 ${p.spacing.small}`,color:p.colors.text,fontSize:p.typography.fontSize.medium}},"..."));const a=e===b,o=!1;return t.createElement("li",{key:e},c?c(e,a,o):((e,r,a)=>t.createElement("button",{type:"button",disabled:a,onClick:()=>C(e),className:I(y.item,r&&y.itemActive,a),style:{padding:p.spacing.small,margin:`0 ${p.spacing.small}`,border:`1px solid ${p.colors.border}`,borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,backgroundColor:r?p.colors.primary:p.colors.background,color:r?"#fff":p.colors.text,cursor:"pointer",opacity:1,fontSize:p.typography.fontSize.medium,minWidth:"40px",...r&&{fontWeight:"bold"}}},e))(e,a,o))}),l&&t.createElement("li",null,t.createElement("button",{type:"button",disabled:b===E,onClick:()=>C(b+1),className:I(y.item,b===E&&y.itemDisabled),style:{padding:p.spacing.small,margin:`0 ${p.spacing.small}`,border:`1px solid ${p.colors.border}`,borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,backgroundColor:p.colors.background,color:p.colors.text,cursor:b===E?"not-allowed":"pointer",opacity:b===E?.5:1,fontSize:p.typography.fontSize.medium},"aria-label":"Next page"},"Next"))))},e.PinterestDropdown=xr,e.PriceDisplay=yt,e.ProductCard=Dt,e.ProductGallery=function({images:e,variant:r="thumbStrip",alt:a="Product",className:o,style:n,carouselAutoplay:s,carouselIntervalMs:i}){return t.createElement("div",{className:I("seekora-product-gallery",o),style:n},t.createElement($e,{images:e,variant:r,alt:a,carouselAutoplay:s,carouselIntervalMs:i}))},e.ProductGrid=Bt,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:m,onSelectionChange:p,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,x=!g&&c&&c.length>0&&d&&m&&p;return t.createElement("div",{className:I("seekora-product-info",h),style:{display:"flex",flexDirection:"column",gap:12,...y}},l&&l.length>0&&t.createElement(xt,{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(yt,{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,x&&t.createElement(Ut,{options:c,variants:d,selections:m,onSelectionChange:p,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(Ge,{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,renderLoading:i,renderEmpty:l,showTitle:c=!1,title:d="Suggestions",className:u,style:m,theme:p})=>{const{client:g,theme:f}=S(),[h,y]=t.useState(-1),{suggestions:b,loading:v,error:x}=C({client:g,query:e,enabled:e.length>=o,debounceMs:a,maxSuggestions:r}),k=b.slice(0,r),E=p||{};if(e.length<o)return null;if(v)return t.createElement("div",{className:I(E.container,u),style:m},c&&t.createElement("div",{className:E.title,style:{fontSize:f.typography.fontSize.large,fontWeight:"bold",marginBottom:f.spacing.medium,color:f.colors.text}},d),i?i():t.createElement("div",{style:{padding:f.spacing.medium,textAlign:"center",color:f.colors.text}},"Loading suggestions..."));if(x||0===k.length)return t.createElement("div",{className:I(E.container,u),style:m},c&&t.createElement("div",{className:E.title,style:{fontSize:f.typography.fontSize.large,fontWeight:"bold",marginBottom:f.spacing.medium,color:f.colors.text}},d),l?l():t.createElement("div",{style:{padding:f.spacing.medium,textAlign:"center",color:f.colors.text,opacity:.6}},"No suggestions available"));const w=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:f.spacing.small}},"(",e.count,")")));return t.createElement("div",{className:I(E.container,u),style:m},c&&t.createElement("div",{className:E.title,style:{fontSize:f.typography.fontSize.large,fontWeight:"bold",marginBottom:f.spacing.medium,color:f.colors.text}},d),t.createElement("div",{className:E.suggestionsList},k.map((e,r)=>{const a=r===h;return t.createElement("div",{key:r,className:I(E.suggestionItem,a&&E.suggestionItemActive),onClick:()=>(e=>{n&&n(e.query)})(e),onMouseEnter:()=>y(r),onMouseLeave:()=>y(-1),style:{padding:f.spacing.medium,cursor:"pointer",borderRadius:"string"==typeof f.borderRadius?f.borderRadius:f.borderRadius.medium,transition:"background-color 0.2s ease",backgroundColor:a?f.colors.hover:"transparent",marginBottom:r<k.length-1?f.spacing.small:0}},w(e,r))})))},e.QuerySuggestionsDropdown=j,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:m,showApplyButton:p=!0,placeholder:g={min:"Min",max:"Max"},syncWithState:f=!0})=>{const{theme:h}=S(),{refinements:y,addRefinement:b,removeRefinement:v}=w(),x=m||{},k=t.useMemo(()=>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},[f,y,e]),[E,C]=t.useState(n??k.min),[R,N]=t.useState(s??k.max),[T,z]=t.useState(n??k.min),[M,A]=t.useState(s??k.max);t.useEffect(()=>{f&&(k.min===T&&k.max===M||(C(k.min),N(k.max),z(k.min),A(k.max)))},[f,k.min,k.max]);const _=void 0!==n?n:E,L=void 0!==s?s:R,P=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]),D=t.useCallback(e=>{const t=""===e.target.value?void 0:parseFloat(e.target.value);C(t),p||(P(t,L),l&&l(t,L))},[L,p,l,P]),B=t.useCallback(e=>{const t=""===e.target.value?void 0:parseFloat(e.target.value);N(t),p||(P(_,t),l&&l(_,t))},[_,p,l,P]),$=t.useCallback(()=>{z(E),A(R),P(E,R),l&&l(E,R)},[E,R,l,P]),F=t.useCallback(()=>{C(void 0),N(void 0),z(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(x.container,d),style:u},c({min:_,max:L,onMinChange:e=>{C(e),!p&&l&&l(e,L)},onMaxChange:e=>{N(e),!p&&l&&l(_,e)},onApply:$})):t.createElement("div",{className:I(x.container,d),style:u},r&&t.createElement("label",{className:x.label,style:{display:"block",fontSize:h.typography.fontSize.medium,fontWeight:"bold",marginBottom:h.spacing.small,color:h.colors.text}},r),t.createElement("div",{className:x.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:D,placeholder:g.min,className:I(x.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:x.separator,style:{color:h.colors.text,opacity:.7}},"to"),t.createElement("input",{type:"number",min:a,max:o,step:i,value:void 0!==L?L:"",onChange:B,placeholder:g.max,className:I(x.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"}}),p&&t.createElement("button",{type:"button",onClick:$,className:x.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!==T||void 0!==M||void 0!==_||void 0!==L)&&t.createElement("button",{type:"button",onClick:F,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=({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:m,showValues:p=!0,syncWithState:g=!0,debounceMs:f=300})=>{const{theme:h}=S(),{refinements:y,addRefinement:b,removeRefinement:v}=w(),x=m||{},k=t.useMemo(()=>{if(!g)return{min:void 0,max:void 0};let t,r;return 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]))}}),{min:t,max:r}},[g,y,e]),[E,C]=t.useState(s??k.min??a),[R,N]=t.useState(i??k.max??o),[T,z]=t.useState(!1),M=t.useRef(null);t.useEffect(()=>{g&&!T&&(void 0!==k.min?C(k.min):C(a),void 0!==k.max?N(k.max):N(o))},[g,k.min,k.max,T,a,o]);const A=t.useCallback((t,r)=>{g&&(y.forEach(t=>{t.field===e&&v(e,t.value,!1)}),t>a&&b(e,`>=${t}`,!1),r<o&&b(e,`<=${r}`,t<=a),t>a&&r>=o&&b(e,`>=${t}`,!0))},[g,e,y,b,v,a,o]),_=t.useCallback((e,t)=>{M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{A(e,t),l&&l(e,t)},f)},[A,l,f]),L=()=>{z(!1)},P=(E-a)/(o-a)*100,D=(R-a)/(o-a)*100;return t.createElement("div",{className:I(x.root,d),style:{fontFamily:"inherit",...u}},r&&t.createElement("label",{className:x.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:x.slider,style:{position:"relative",height:"40px",display:"flex",alignItems:"center"}},t.createElement("div",{className:x.track,style:{position:"absolute",width:"100%",height:"4px",backgroundColor:h.colors.border,borderRadius:"2px"}}),t.createElement("div",{className:x.trackFilled,style:{position:"absolute",left:`${P}%`,width:D-P+"%",height:"4px",backgroundColor:h.colors.primary,borderRadius:"2px"}}),t.createElement("input",{type:"range",min:a,max:o,step:n,value:E,onChange:e=>{const t=Math.min(Number(e.target.value),R-n);C(t),z(!0),_(t,R)},onMouseUp:L,onTouchEnd:L,className:x.thumb,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:R,onChange:e=>{const t=Math.max(Number(e.target.value),E+n);N(t),z(!0),_(E,t)},onMouseUp:L,onTouchEnd:L,className:x.thumb,style:{position:"absolute",width:"100%",height:"4px",background:"transparent",WebkitAppearance:"none",appearance:"none",cursor:"pointer",pointerEvents:"none"},"aria-label":`Maximum ${r||e}`})),p&&t.createElement("div",{className:x.values,style:{display:"flex",justifyContent:"space-between",marginTop:h.spacing.small,fontSize:h.typography.fontSize.small,color:h.colors.textSecondary}},t.createElement("span",{className:x.value},c(E)),t.createElement("span",{className:x.value},c(R))),t.createElement("style",null,`\n .${x.thumb||"seekora-range-slider__thumb"}::-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: 0 2px 4px rgba(0,0,0,0.2);\n }\n .${x.thumb||"seekora-range-slider__thumb"}::-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: 0 2px 4px rgba(0,0,0,0.2);\n }\n `))},e.RatingDisplay=wt,e.RecentSearchesList=Wt,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[m,p]=t.useState([]);t.useEffect(()=>{if(!r)try{const t=localStorage.getItem(e);t&&p(JSON.parse(t))}catch(e){}},[e,r]);const g=(r||m).slice(0,o);return 0===g.length?null:t.createElement(N,{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:m="$"})=>{const{theme:p}=S(),g=d||{},f=r?.slice(0,n)||[];return a?t.createElement("div",{className:I(g.root,l),style:c},t.createElement("div",{className:g.loading,style:z(p)},"Loading related products...")):0===f.length?null:t.createElement(N,{title:o,items:f,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u,currencySymbol:m})},e.RichQuerySuggestions=K,e.SearchBar=({placeholder:e="Search...",showSuggestions:r=!0,debounceMs:a=300,minQueryLength:o=2,maxSuggestions:n=10,onSearch:s,onQueryChange:i,onSuggestionSelect:d,onSearchStateChange:u,searchOptions:m,className:p,style:g,theme:f,renderSuggestion:h,renderLoading:y})=>{const{client:b,theme:v,enableAnalytics:x,autoTrackSearch:k}=S(),{query:E,setQuery:R,search:N,results:T,loading:z,error:M}=w(),[A,_]=t.useState(!1),[L,P]=t.useState(-1),D=t.useRef(null),B=t.useRef(null),$=t.useRef(!1),{suggestions:F,loading:W}=C({client:b,query:E,enabled:r&&E.length>=o,debounceMs:a,maxSuggestions:n}),q=F.slice(0,n);t.useEffect(()=>{u&&u({results:T,loading:z,error:M})},[T,z,M,u]),t.useEffect(()=>{T&&s&&s(E,T)},[T,E,s]),t.useEffect(()=>{i&&i(E)},[E,i]);const H=t.useCallback(async e=>{const t=e.trim();c("SearchBar: Triggering search",{query:t,originalQuery:e,isEmpty:!t}),$.current=!0,_(!1),P(-1),R(t,!1),c("SearchBar: Calling search() directly"),await N(),setTimeout(()=>{D.current?.blur(),setTimeout(()=>{$.current=!1},50)},100)},[R,N]),O=t.useCallback(e=>{l("SearchBar: Suggestion selected",{suggestion:e}),P(-1),_(!1),D.current?.blur(),d&&d(e),R(e)},[d,R]),j=t.useCallback(e=>{const t=e.target.value;R(t,!1),P(-1)},[R]),V=t.useCallback(e=>{switch(e.key){case"ArrowDown":r&&q.length>0&&(e.preventDefault(),P(e=>e<q.length-1?e+1:e));break;case"ArrowUp":r&&q.length>0&&(e.preventDefault(),P(e=>e>0?e-1:-1));break;case"Enter":if(e.preventDefault(),e.stopPropagation(),r&&q.length>0&&L>=0&&L<q.length)O(q[L].query);else{const e=D.current?.value||E;H(e)}break;case"Escape":_(!1),D.current?.blur()}},[q,L,E,r,H,O]),U=t.useCallback(()=>{_(!0)},[]),Q=t.useCallback(e=>{$.current||setTimeout(()=>{B.current?.contains(document.activeElement)||(_(!1),P(-1))},200)},[]),G=(e,r)=>t.createElement("div",{key:r},e),X=f||{},Y=W||z,K=q.length>0,Z=A&&r&&E.length>=o&&(K||Y),J=T,ee=J?.processingTimeMS||J?.data?.processingTimeMS||J?.data?.data?.processingTimeMS;return t.createElement("div",{ref:B,className:I(X.container,p),style:{position:"relative",display:"flex",alignItems:"center",...g}},t.createElement("input",{ref:D,type:"text",value:E,onChange:j,onKeyDown:V,onFocus:U,onBlur:Q,placeholder:e,className:I(X.input,A&&X.inputFocused),style:{flex:1,padding:v.spacing.medium,fontSize:v.typography.fontSize.medium,fontFamily:v.typography.fontFamily,backgroundColor:v.colors.background,color:v.colors.text,borderWidth:"1px",borderStyle:"solid",borderColor:A?v.colors.focus:v.colors.border,borderRadius:"string"==typeof v.borderRadius?v.borderRadius:v.borderRadius.medium,outline:"none",...A&&{boxShadow:v.shadows.small}}}),void 0!==ee&&t.createElement("span",{style:{marginLeft:v.spacing.small,fontSize:v.typography.fontSize.small,color:v.colors.text,opacity:.7,whiteSpace:"nowrap"}},ee,"ms"),Z&&t.createElement("div",{className:X.suggestionsContainer,style:{position:"absolute",top:"100%",left:0,right:0,marginTop:v.spacing.small,backgroundColor:v.colors.background,border:`1px solid ${v.colors.border}`,borderRadius:"string"==typeof v.borderRadius?v.borderRadius:v.borderRadius.medium,boxShadow:v.shadows.medium,maxHeight:"400px",overflowY:"auto",zIndex:1e3}},Y&&(y?y():t.createElement("div",{style:{padding:v.spacing.medium,textAlign:"center"}},"Loading suggestions...")),!Y&&q.length>0&&t.createElement(t.Fragment,null,q.map((e,r)=>{const a=r===L,o=h||G;return t.createElement("div",{key:r,className:I(X.suggestionItem,a&&X.suggestionItemActive),onClick:()=>O(e.query),onMouseEnter:()=>P(r),style:{padding:v.spacing.medium,cursor:"pointer",backgroundColor:a?v.colors.hover:"transparent",color:v.colors.text,transition:v.transitions?.fast||"150ms ease-in-out"}},o(e.query,r))})),!Y&&0===q.length&&E.length>=o&&t.createElement("div",{style:{padding:v.spacing.medium,textAlign:"center",color:v.colors.textSecondary}},"No suggestions found")))},e.SearchBarWithSuggestions=ve,e.SearchInput=Re,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}=S(),u=l||{},[m,p]=t.useState(!1);return t.useEffect(()=>{const e=()=>{p(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement("div",{className:I(u.container,s),style:{display:"flex",flexDirection:"column",minHeight:"100vh",backgroundColor:d.colors.background,...i}},a&&t.createElement("header",{className:u.header,style:{padding:d.spacing.medium,borderBottom:`1px solid ${d.colors.border}`,backgroundColor:d.colors.background}},a),t.createElement("div",{style:{display:"flex",flex:1,gap:d.spacing.large,padding:d.spacing.medium,backgroundColor:d.colors.background,color:d.colors.text}},e&&(!m||c)&&t.createElement("aside",{className:u.sidebar,style:{width:n,minWidth:n}},e),t.createElement("main",{className:u.main,style:{flex:1,minWidth:0,backgroundColor:d.colors.background,color:d.colors.text}},r)),o&&t.createElement("footer",{className:u.footer,style:{padding:d.spacing.medium,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})=>{const i=t.useMemo(()=>r?k(r):x,[r]),l=t.useMemo(()=>new f({client:e,autoSearch:!0,debounceMs:300,itemsPerPage:10,defaultSearchOptions:{widget_mode:!0},...n}),[e,n]),c=t.useMemo(()=>({client:e,theme:i,enableAnalytics:a,autoTrackSearch:o,stateManager:l}),[e,i,a,o,l]);return t.createElement(E.Provider,{value:c},s)},e.SearchResults=({results:e,loading:r,error:a,onResultClick:o,renderResult:n,renderEmpty:s,renderLoading:i,renderError:c,className:m,style:p,theme:g,itemsPerPage:f=20,showPagination:h=!1,viewMode:y="list",fieldMapping:b,extractResults:v,enableKeyboardNavigation:x=!0,autoFocus:k=!1})=>{const{theme:E,client:C,enableAnalytics:R}=S(),{results:N,loading:T,error:z,currentPage:M,itemsPerPage:A}=w(),_=g||{},[L,P]=t.useState(-1),D=t.useRef(null),B=void 0!==e?e:N,$=void 0!==r?r:T,F=void 0!==a?a:z;t.useEffect(()=>{P(-1)},[B]),t.useEffect(()=>{if(L>=0&&D.current&&x){const e=D.current.querySelector(`[data-result-index="${L}"]`);e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[L,x]);const W=t.useCallback(e=>{if(!x)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)}},[x,L]),q="card"===y||"grid"===y?(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(R&&r.id)try{const t=e||N,o={currentPage:M,itemsPerPage:A},n=(o.currentPage-1)*o.itemsPerPage+a+1,s=t?.context;C.trackClick?await C.trackClick(r.id,n,s):await(C.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:()=>x&&P(a),style:{border:`1px solid ${n?E.colors.primary:E.colors.border}`,borderRadius:"string"==typeof E.borderRadius?E.borderRadius:E.borderRadius.medium,overflow:"hidden",cursor:o?"pointer":"default",transition:E.transitions?.normal||"250ms ease-in-out",backgroundColor:n?E.colors.hover:E.colors.background,display:"flex",flexDirection:"column",padding:E.spacing.medium,boxShadow:n?E.shadows.medium:E.shadows.small,outline:n?`2px solid ${E.colors.primary}`:"none",outlineOffset:"-2px"}},c&&t.createElement("div",{style:{width:"100%",aspectRatio:"16/9",overflow:"hidden",backgroundColor:E.colors.hover}},t.createElement("img",{src:c,alt:s,style:{width:"100%",height:"100%",objectFit:"cover"}})),t.createElement("div",{style:{padding:E.spacing.medium}},s&&t.createElement("h3",{className:_.resultTitle,style:{fontSize:E.typography.fontSize.large,fontWeight:"bold",margin:0,marginBottom:E.spacing.small,color:E.colors.text}},s),i&&t.createElement("p",{className:_.resultDescription,style:{fontSize:E.typography.fontSize.medium,color:E.colors.text,margin:0,marginBottom:E.spacing.small,opacity:.8,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"}},i),l&&t.createElement("div",{className:_.resultPrice,style:{fontSize:E.typography.fontSize.medium,fontWeight:"bold",color:E.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(R&&r.id)try{const t=e||N,o={currentPage:M,itemsPerPage:A},n=(o.currentPage-1)*o.itemsPerPage+a+1,s=t?.context;C.trackClick?await C.trackClick(r.id,n,s):await(C.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:()=>x&&P(a),style:{padding:E.spacing.medium,border:`1px solid ${E.colors.border}`,borderBottom:`1px solid ${E.colors.border}`,borderRadius:0,marginBottom:0,cursor:o?"pointer":"default",transition:E.transitions?.normal||"250ms ease-in-out",backgroundColor:n?E.colors.hover:E.colors.background,display:"flex",alignItems:"flex-start",gap:E.spacing.medium,outline:n?`2px solid ${E.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 E.borderRadius?E.borderRadius:E.borderRadius.medium,flexShrink:0}}),t.createElement("div",{style:{flex:1,minWidth:0}},t.createElement("h3",{className:_.resultTitle,style:{fontSize:E.typography.fontSize.large,fontWeight:"bold",margin:0,marginBottom:E.spacing.small,color:E.colors.text}},r.title),r.description&&t.createElement("p",{className:_.resultDescription,style:{fontSize:E.typography.fontSize.medium,color:E.colors.text,margin:0,marginBottom:E.spacing.small,opacity:.8}},r.description),r.price&&t.createElement("div",{className:_.resultPrice,style:{fontSize:E.typography.fontSize.medium,fontWeight:"bold",color:E.colors.primary}},r.price)));let H=[];if(v)H=v(B)||[];else if(B){const e=B;Array.isArray(e.results)&&e.results.length>0?H=e.results:e.data&&Array.isArray(e.data.results)&&e.data.results.length>0?H=e.data.results:e.data?.data&&Array.isArray(e.data.data.results)&&e.data.data.results.length>0?H=e.data.data.results:Array.isArray(B)?H=B:Array.isArray(e.results)&&(H=e.results)}const O={title:"document.productName",description:"document.brandDesc",image:"document.image",price:"document.mrp",url:"document.url",id:"id",...b},j=(e,t)=>{if(t)return((e,t)=>{if(t)return t.split(".").reduce((e,t)=>e?.[t],e)})(e,t)},V=H.map((e,t)=>{try{const r=j(e,O.primaryText),a=j(e,O.secondaryText),o=j(e,O.tertiaryText),n=j(e,O.imageUrl),s=j(e,O.title)||r||"Untitled",i=j(e,O.description)||a,l=j(e,O.image)||n,c=j(e,O.price)||o,d=j(e,O.url),u=j(e,O.id)||String(t),m=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,p={};O.custom&&Object.entries(O.custom).forEach(([t,r])=>{p[t]=j(e,r)});return{id:u,title:s,description:i,url:d,image:l,price:m,metadata:e,...p,...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}}}),U={...p},Q={..."grid"===y&&{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:E.spacing.medium},..."card"===y&&{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:E.spacing.medium}};if(l("SearchResults: Extracted results",{rawResultsCount:H.length,resultItemsCount:V.length,viewMode:y,hasError:!!F,isLoading:$}),$)return l("SearchResults: Rendering loading state"),t.createElement("div",{className:I(_.container,m),style:p},i?i():t.createElement("div",{className:_.loadingState,style:{padding:E.spacing.large,textAlign:"center",color:E.colors.text}},"Loading results..."));if(F)return u("SearchResults: Rendering error state",{error:F.message,stack:F.stack}),t.createElement("div",{className:I(_.container,m),style:p},c?c(F):(G=F,t.createElement("div",{className:_.errorState,style:{padding:E.spacing.large,textAlign:"center",color:E.colors.error}},"Error: ",G.message)));var G;if(!B||0===V.length)return l("SearchResults: No results to display"),t.createElement("div",{className:I(_.container,m),style:p},s?s():t.createElement("div",{className:_.emptyState,style:{padding:E.spacing.large,textAlign:"center",color:E.colors.text}},"No results found"));const X=n||q;return t.createElement("div",{ref:D,className:I(_.container,m),style:U,tabIndex:x?0:void 0,onKeyDown:W,role:"listbox","aria-label":"Search results","aria-activedescendant":L>=0?`result-${L}`:void 0},(void 0!==B?.totalResults||void 0!==B?.data?.total_results)&&V.length>0&&t.createElement("div",{className:_.header,style:{marginBottom:E.spacing.medium,fontSize:E.typography.fontSize.medium,color:E.colors.text}},"Found ",B?.totalResults||B?.data?.total_results||0," result",1!==(B?.totalResults||B?.data?.total_results||0)?"s":""),x&&V.length>0&&t.createElement("div",{style:{fontSize:"12px",color:E.colors.text,opacity:.6,marginBottom:E.spacing.small,display:"flex",gap:"8px",alignItems:"center"}},t.createElement("span",{style:{display:"inline-flex",gap:"4px",padding:"2px 6px",backgroundColor:E.colors.hover,borderRadius:"4px",fontSize:"11px"}},"↑↓ navigate"),t.createElement("span",{style:{display:"inline-flex",gap:"4px",padding:"2px 6px",backgroundColor:E.colors.hover,borderRadius:"4px",fontSize:"11px"}},"↵ select")),t.createElement("div",{className:_.resultsList,style:Q},V.map((e,t)=>X(e,t,t===L))))},e.SectionError=Kt,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:m,error:p,trackClick:g}=Xt();return m?t.createElement(Yt,{className:a,style:o}):p?t.createElement(Kt,{className:a,style:o}):t.createElement(Ge,{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.SectionLoading=Yt,e.SectionSearchProvider=function({children:e,query:r,refinements:a=[],maxItems:o=12,sortBy:n,enabled:s=!0,sectionId:i}){const{client:l}=S(),[c,d]=t.useState([]),[u,m]=t.useState(!0),[p,g]=t.useState(null),[f,h]=t.useState(0);t.useEffect(()=>{if(!s||!l?.search)return d([]),m(!1),g(null),void h(0);let e=!1;m(!0),g(null);const t={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(",")),l.search(r,t).then(t=>{e||(d(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)),h(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||(g(t instanceof Error?t:new Error(String(t))),d([]),m(!1))}),()=>{e=!0}},[l,s,r,o,n,a]);const y=t.useCallback((e,t)=>{if(!l?.trackEvent)return;const r=e?.id??e?.objectID;l.trackEvent({event_name:"section_result_click",clicked_item_id:r,position:t,section:i,metadata:{section_id:i}},void 0)},[l,i]),b=t.useMemo(()=>({items:c,loading:u,error:p,totalCount:f,sectionId:i,trackClick:y}),[c,u,p,f,i,y]);return t.createElement(Gt.Provider,{value:b},e)},e.ShopifyDropdown=Nr,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}=S(),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=m({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=p(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"},x=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},x)},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})=>{const{theme:u}=S(),{sortBy:m,setSortBy:p}=w(),g=l||{},[f,h]=t.useState(a||e[0]?.value||"");t.useEffect(()=>{d&&a&&!m&&p(a,!1)},[]);const y=void 0!==r?r:d&&m?m:f,b=e=>{const t=e.target.value;h(t),d&&p(t),o&&o(t)};return n?t.createElement("div",{className:I(g.container,s),style:i},n({value:y,onChange:b,options:e})):t.createElement("select",{value:y,onChange:b,className:I(g.select,s),style:{padding:u.spacing.small,paddingRight:u.spacing.medium,fontSize:u.typography.fontSize.medium,border:`1px solid ${u.colors.border}`,borderRadius:"string"==typeof u.borderRadius?u.borderRadius:u.borderRadius.medium,backgroundColor:u.colors.background,color:u.colors.text,cursor:"pointer",outline:"none",...i},"aria-label":"Sort results"},e.map(e=>t.createElement("option",{key:e.value,value:e.value,className:g.option},e.label)))},e.SpotlightDropdown=Cr,e.Stats=({results:e,renderStats:r,className:a,style:o,theme:n,showProcessingTime:s=!1,showQuery:i=!1,separator:l=" • "})=>{const{theme:c}=S(),d=n||{},u=e,m=u?.totalResults||u?.data?.total_results||u?.data?.data?.total_results||0,p=u?.processingTimeMS||u?.data?.processingTimeMS||u?.data?.data?.processingTimeMS,g=u?.query??"";return r?t.createElement("div",{className:I(d.container,a),style:o},r({totalResults:m,processingTime:p,query:g})):(()=>{const e=[];return m>0?e.push(`${m.toLocaleString()} result${1!==m?"s":""}`):e.push("No results"),s&&void 0!==p&&e.push(`${p}ms`),i&&g&&e.push(`for "${g}"`),t.createElement("div",{className:I(d.container,a),style:{fontSize:c.typography.fontSize.medium,color:c.colors.text,...o}},e.map((e,r)=>t.createElement("span",{key:r},r>0&&t.createElement("span",{className:d.separator,style:{margin:`0 ${c.spacing.small}`}},l),t.createElement("span",{className:d.text},e))))})()},e.SuggestionDropdownVariants=Fr,e.SuggestionItem=Ae,e.SuggestionList=Pe,e.SuggestionSearchBar=$r,e.SuggestionsDropdownComposition=function({showRecentSearches:e=!0,showTrending:r=!0,showTabs:a=!0,showProducts:o=!0,placeholder:n,...s}){return t.createElement(Ee,{...s},t.createElement("div",{className:"seekora-suggestions-dropdown-composition",style:{position:"relative",width:"100%"}},t.createElement(Re,{placeholder:n}),t.createElement(Ne,null,t.createElement(Ot,null),t.createElement(_e,null),e?t.createElement(Wt,null):null,t.createElement(Pe,null),a?t.createElement($t,null):null,o?t.createElement(Bt,null):null,r?t.createElement(Ht,null):null)))},e.SuggestionsError=Ot,e.SuggestionsLoading=_e,e.SuggestionsProvider=Ee,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:m}=S(),p=c||{},g=e?.slice(0,o)||[];return r?t.createElement("div",{className:I(p.root,i),style:l},t.createElement("div",{className:p.loading,style:z(m)},"Loading trending items...")):0===g.length?null:t.createElement(N,{title:a,items:g,renderItem:n,onItemClick:s,className:i,style:l,theme:c,layout:d,currencySymbol:u})},e.TrendingList=Ht,e.VariantSelector=Ut,e.VariantSwatches=Rt,e.addRecentSearch=ut,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=ma,e.breakpoints=Zt,e.clearRecentSearches=e=>{try{const t=e?`${ct}_${e}`:ct;localStorage.removeItem(t)}catch{}},e.clearSuggestionsCache=()=>{ft?.clear()},e.createSuggestionsCache=e=>new gt(e),e.createSuggestionsTheme=function(e="light",t={},r){return{...{light:ca,dark:da,minimal:ua}[e],...r?ma[r]:{},...t}},e.createTheme=k,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=da,e.defaultTheme=x,e.extractBadges=rt,e.extractBrand=(e,t={name:"name"})=>({id:t.id?Xe(e,t.id):e?.id,name:Xe(e,t.name)??"",logo:t.logo?Xe(e,t.logo):void 0,count:t.count?Xe(e,t.count):void 0,_raw:e}),e.extractCategory=Ze,e.extractProduct=Ke,e.extractSuggestion=Ye,e.findVariantBySelections=nt,e.formatParsedFilters=function(e){return e.map(e=>`${e.field}: ${e.value}`).join(", ")},e.formatPriceRange=(e,t={})=>`${Je(e.min,t)} - ${Je(e.max,t)}`,e.formatSuggestionPrice=Je,e.generateSuggestionsStylesheet=pa,e.getAvailableValuesForOption=ot,e.getFingerprint=async function(e){return new v(e).get()},e.getPriceRange=at,e.getRecentSearches=dt,e.getShortcutText=ta,e.getSuggestionsCache=ht,e.highlightText=tt,e.injectGlobalResponsiveStyles=ar,e.injectSuggestionsStyles=fa,e.lightThemeVariables=ca,e.mediaQueries=Jt,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=ua,e.parseHighlightMarkup=ze,e.removeRecentSearch=mt,e.touchTargets=er,e.updateSuggestionsStyles=function(e){fa(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(Qt),e.useDocSearch=na,e.useDocSearchSeekoraSearch=sa,e.useInjectResponsiveStyles=or,e.useKeyboard=ea,e.useNaturalLanguageFilters=function(e={}){const{fieldMappings:r={},valueMappings:a={},autoApply:o=!1,currencySymbol:n="$"}=e,{addRefinement:s,removeRefinement:i,clearRefinements:l,setQuery:c}=w(),d=t.useMemo(()=>({...la,colors:[...la.colors,...a.color?Object.keys(a.color):[]],sizes:{...la.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]),m=t.useCallback(e=>{e.forEach(e=>{s(e.field,e.value,!1)}),e.length},[s]),p=t.useCallback(e=>{const t=u(e);return t.hasFilters&&(m(t.filters),t.cleanedQuery!==e&&c(t.cleanedQuery,!0)),t},[u,m,c]);return{parse:u,applyFilters:m,parseAndApply:p}},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),m=t.useRef(null),p=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]),x=t.useCallback(e=>{m.current&&(m.current.disconnect(),m.current=null),p.current=e,e&&c&&!u.current&&"undefined"!=typeof IntersectionObserver&&(m.current=new IntersectionObserver(e=>{for(const t of e)t.isIntersecting&&!u.current&&(u.current=!0,f("product.impression",{}),m.current?.disconnect())},{threshold:.5}),m.current.observe(e))},[c,f]);return t.useEffect(()=>()=>{m.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:x,trackClick:h,trackVariantSelect:y,trackAddToCart:b,trackCustomEvent:v}},e.useQuerySuggestions=C,e.useQuerySuggestionsEnhanced=$,e.useResponsive=tr,e.useSearchContext=S,e.useSearchState=w,e.useSectionSearchContext=Xt,e.useSeekoraSearch=({client:e,autoTrack:r=!0})=>{const[a,o]=t.useState(null),[n,s]=t.useState(!1),[i,d]=t.useState(null),[m,p]=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&&p(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),p(null),null}finally{s(!1)}},[e]);return{search:g,results:a,loading:n,error:i,context:m,clearResults:t.useCallback(()=>{o(null),d(null),p(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}=S(),[m,p]=t.useState([]),[g,f]=t.useState(!1),[h,y]=t.useState(null),[b,v]=t.useState(null),[x,k]=t.useState([]),[E,w]=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=ia(e,R);k(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);w(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?(p([]),k([]),w([]),void v(null)):(f(!0),C.current=setTimeout(async()=>{try{const t=await I(e);p(t),y(null)}catch(e){y(e instanceof Error?e:new Error(String(e))),p([])}finally{f(!1)}},n),()=>{C.current&&clearTimeout(C.current)})),[e,a,n,I]),{suggestions:m,loading:g,error:h,detectedIntent:b,corrections:x,expansions:E,getSuggestions:N,clear:t.useCallback(()=>{p([]),k([]),w([]),v(null),y(null)},[])}},e.useSuggestionsAnalytics=fe,e.useSuggestionsContext=ke,e.useVariantSelection=function({options:e=[],variants:r=[],initialSelections:a={},onVariantChange:o}={}){const[n,s]=t.useState(a),i=t.useMemo(()=>nt(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]=ot(a.name,e,r,n);return t},[e,r,n]),d=i?.price??null,u=i?.comparePrice??null,m=t.useCallback((t,a)=>{s(n=>{const s={...n,[t]:a},i=nt(e,r,s);return o?.(i,s),s})},[e,r,o]),p=t.useCallback(()=>{s({}),o?.(null,{})},[o]);return{selections:n,setSelection:m,resetSelections:p,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,...m}=r,p=t.useRef(null),g=t.useRef(!1),f=s(m),h=i(m),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||!p.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(p.current),()=>e.disconnect()},[o,c,y]),t.createElement("div",{ref:e=>{p.current=e,"function"==typeof l?l(e):l&&(l.current=e)},onClick:b,style:{display:"contents"}},t.createElement(e,{...m}))});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 m(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 p(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.client=e.client,this.autoSearch=!1!==e.autoSearch,this.debounceMs=e.debounceMs||300,this.defaultSearchOptions=e.defaultSearchOptions||{widget_mode:!0},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){if(this.state.query===e)return l("SearchStateManager: Query unchanged, skipping update",{query:e}),void(t&&this.autoSearch&&(l("SearchStateManager: Query unchanged but triggerSearch=true, triggering search"),this.debouncedSearch()));this.state.query=e,this.state.currentPage=1,l("SearchStateManager: Query updated",{query:e,triggerSearch:t,autoSearch:this.autoSearch}),this.notifyListeners(),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){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),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(){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})}})}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 x={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}},k=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,x),E=t.createContext(null),S=()=>{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},w=()=>{const{stateManager:e}=S(),[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([]),[l,c]=t.useState(!1),[d,m]=t.useState(null),p=t.useRef(null);return t.useEffect(()=>(p.current&&clearTimeout(p.current),a&&r.trim()?(c(!0),m(null),p.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));u("Error in useQuerySuggestions:",t),m(t),i([])}finally{c(!1)}},o),()=>{p.current&&clearTimeout(p.current)}):(i([]),c(!1),void m(null))),[e,r,a,o,n]),{suggestions:s,loading:l,error:d}};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=({title:e,items:r,renderItem:a,onItemClick:o,className:n,style:s,theme:i,layout:l="horizontal",currencySymbol:c="$"})=>{const{theme:d}=S(),u=i||{},m=()=>{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:{...m(),cursor:o?"pointer":"default"}},a?a(e,r):t.createElement(T,{item:e,theme:u,currencySymbol:c,layout:l})))))},T=({item:e,theme:r,currencySymbol:a,layout:o})=>{const{theme:n}=S(),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)))};function z(e){return{padding:e.spacing.large,textAlign:"center",color:e.colors.textSecondary}}const M="seekora_recent_searches",A=10;function _(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 L(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?P(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 P(e){return e.replace(/__ais-highlight__/g,"<mark>").replace(/__\/ais-highlight__/g,"</mark>")}function D(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 B(e){return{id:e.id,label:e.label,filter:e.filter,products:e.products?.map(D)||[],nb_hits:e.nb_hits,processing_time_ms:e.processing_time_ms}}function $(e){const{client:r,query:a,enabled:o=!0,debounceMs:n=200,maxSuggestions:s=10,minQueryLength:i=1,includeDropdownRecommendations:c=!1,includeDropdownProductList:d=!0,includeFilteredTabs:m=!0,includeCategories:p=!0,includeFacets:g=!0,maxCategories:f=3,maxFacets:h=5,filteredTabs:y,minPopularity:b,timeRange:v,disableTypoTolerance:x,analyticsTags:k,enableRecentSearches:E=!0,maxRecentSearches:S=A,recentSearchesKey:w=M,onSuggestionsLoaded:C,onError:R}=e,[I,N]=t.useState([]),[T,z]=t.useState(!1),[P,$]=t.useState(null),[F,W]=t.useState(null),[q,H]=t.useState([]),[O,j]=t.useState(null),[V,U]=t.useState(0),[Q,G]=t.useState(0),[X,Y]=t.useState(0),[K,Z]=t.useState(""),J=t.useRef(null),ee=t.useRef(null),te=t.useRef(!0);t.useEffect(()=>{if(E){const e=function(e){if("undefined"==typeof window)return[];try{const t=localStorage.getItem(e);return t?JSON.parse(t):[]}catch{return[]}}(w);H(e.slice(0,S))}return()=>{te.current=!1}},[E,w,S]);const re=t.useCallback(async e=>{if(r){if(!e.trim()&&i>0)return N([]),void W(null);ee.current&&ee.current.abort(),ee.current=new AbortController,z(!0),$(null);try{const t=await(r.getSuggestions?.(e,{hitsPerPage:s,include_dropdown_recommendations:c||y&&y.length>0,include_dropdown_product_list:d,include_filtered_tabs:m,include_categories:p,include_facets:g,max_categories:f,max_facets:h,filtered_tabs:y,min_popularity:b,time_range:v,disable_typo_tolerance:x,analytics_tags:k,returnFullResponse:!0}));if(!te.current)return;const a=(t.suggestions||[]).map(L);N(a);const o=t.extensions||{},n=t.results,i=Array.isArray(n?.[1]?.hits)?n[1].hits:[],u=i.length>0?i.map(e=>D(e)):[],E={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(D):[],item_recommendations:Array.isArray(o.item_recommendations)?o.item_recommendations.map(D):[],product_hits:u.length>0?u:void 0,popular_brands:Array.isArray(o.popular_brands)?o.popular_brands:[],filtered_tabs:Array.isArray(o.filtered_tabs)?o.filtered_tabs.map(B):[],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};W(E);const S=t.raw,w=S?.results,R=w?.[0]??S??{},I=e=>"number"!=typeof e||Number.isNaN(e)?0:e,T=e=>"string"==typeof e?e:"";j("number"==typeof R.processingTimeMS?R.processingTimeMS:null),U(I(R.nbHits)||a.length),G(I(R.page)||0),Y(I(R.nbPages)||1),Z(T(R.query)||e),C&&C({suggestions:a,nbHits:I(R.nbHits)||a.length,page:I(R.page)||0,nbPages:I(R.nbPages)||1,hitsPerPage:I(R.hitsPerPage)||s,processingTimeMS:"number"==typeof R.processingTimeMS?R.processingTimeMS:void 0,query:T(R.query)||e,dropdownRecommendations:E,results:Array.isArray(t.results)?t.results:void 0,extensions:o}),l("Query suggestions loaded",{query:e,suggestionsCount:a.length,hasRecommendations:Object.keys(E).some(e=>Array.isArray(E[e])&&E[e].length>0)})}catch(t){if(!te.current)return;const r=t instanceof Error?t:new Error(String(t));if("AbortError"===r.name)return;u("Failed to fetch query suggestions",{query:e,error:r.message}),$(r),N([]),W(null),R&&R(r)}finally{te.current&&z(!1)}}},[r,i,s,c,d,m,p,g,f,h,y,b,v,x,k,C,R]);t.useEffect(()=>(J.current&&clearTimeout(J.current),!o||a.length<i?(N([]),z(!1),void $(null)):(z(!0),J.current=setTimeout(()=>{re(a)},n),()=>{J.current&&clearTimeout(J.current)})),[a,o,i,n,re]);const ae=t.useCallback((e,t)=>{E&&e.trim()&&H(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 _(w,o),o})},[E,S,w]),oe=t.useCallback(e=>{H(t=>{const r=t.filter(t=>t.query!==e);return _(w,r),r})},[w]),ne=t.useCallback(()=>{H([]),_(w,[])},[w]),se=t.useCallback(async()=>{a.length>=i&&await re(a)},[a,i,re]),ie=F?.trending_searches||[],le=F?.top_searches||[],ce=F?.related_searches||[],de=F?.popular_brands||[],ue=F?.filtered_tabs||[],me=t.useMemo(()=>{const e=F?.trending_products;if(e&&e.length>0)return e;const t=F?.item_recommendations;if(t&&t.length>0)return t;const r=F?.filtered_tabs?.[0];return r?.products&&r.products.length>0?r.products:F?.product_hits??[]},[F?.trending_products,F?.item_recommendations,F?.filtered_tabs,F?.product_hits]),pe=t.useMemo(()=>I.length>0||q.length>0||ie.length>0||le.length>0||ce.length>0||de.length>0||ue.length>0||me.length>0,[I,q,ie,le,ce,de,ue,me]),ge=t.useCallback(()=>{const e=[];let t=0;return 0===a.length&&q.length>0&&q.forEach(r=>{e.push({type:"recent",index:t++,data:r})}),I.forEach(r=>{e.push({type:"suggestion",index:t++,data:r})}),ie.forEach(r=>{e.push({type:"trending",index:t++,data:r})}),me.forEach(r=>{e.push({type:"product",index:t++,data:r})}),de.forEach(r=>{e.push({type:"brand",index:t++,data:r})}),e},[a,q,I,ie,me,de]);return{suggestions:I,loading:T,error:P,dropdownRecommendations:F,trendingSearches:ie,topSearches:le,relatedSearches:ce,popularBrands:de,filteredTabs:ue,trendingProducts:me,recentSearches:q,processingTimeMs:O,totalHits:V,currentPage:Q,totalPages:X,originalQuery:K,addRecentSearch:ae,removeRecentSearch:oe,clearRecentSearches:ne,refetch:se,hasContent:pe,getAllNavigableItems:ge}}const F={container:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius, 8px)",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, #6b7280)",textTransform:"uppercase",letterSpacing:"0.05em",padding:"8px 16px 4px",margin:0},suggestionItem:{display:"flex",alignItems:"center",padding:"10px 16px",cursor:"pointer",transition:"background-color 150ms ease",fontSize:"14px",color:"var(--seekora-text-primary, #111827)",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, #111827)",backgroundColor:"var(--seekora-highlight-bg, #fef3c7)",padding:"0 2px",borderRadius:"2px"},recentIcon:{width:"16px",height:"16px",color:"var(--seekora-text-secondary, #9ca3af)",flexShrink:0},removeButton:{padding:"4px",borderRadius:"4px",border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-secondary, #9ca3af)",opacity:0,transition:"opacity 150ms ease, color 150ms ease"},removeButtonVisible:{opacity:1},loadingState:{display:"flex",alignItems:"center",justifyContent:"center",padding:"24px 16px",color:"var(--seekora-text-secondary, #6b7280)",fontSize:"14px",gap:"8px"},emptyState:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px 16px",color:"var(--seekora-text-secondary, #6b7280)",fontSize:"14px",textAlign:"center"},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, #e5e7eb)",margin:"4px 0"},footer:{borderTop:"1px solid var(--seekora-border-color, #e5e7eb)",padding:"8px 16px",fontSize:"12px",color:"var(--seekora-text-secondary, #6b7280)",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:"3px",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)",border:"1px solid var(--seekora-border-color, #e5e7eb)",fontSize:"10px",fontWeight:500}},W=({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"})),q=({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"})),H=({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"})),O=({style:e})=>t.createElement("svg",{style:{animation:"spin 1s linear infinite",...e},viewBox:"0 0 24 24",width:"20",height:"20"},t.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",fill:"none",opacity:"0.25"}),t.createElement("path",{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})),j=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,showLoading:u=!1,showEmptyState:m=!0,highlight:p={enabled:!0,preTag:"<mark>",postTag:"</mark>"},keyboardNav:g={enabled:!0},animation:f={enabled:!0,duration:150,entrance:"fade"},classNames:h={},style:y,renderSuggestion:b,renderRecentSearch:v,renderLoading:x,renderEmpty:k,footer:E,position:w="absolute",width:C="100%",zIndex:R=1e3,closeOnClickOutside:N=!0,closeOnEscape:T=!0,ariaLabel:z="Search suggestions",onSuggestionSelect:M,onRecentSearchClick:A,onRecentSearchRemove:_,onOpen:L,onClose:P,onNavigate:D}=e,{client:B,theme:j}=S(),V=t.useRef(null),[U,Q]=t.useState(-1),[G,X]=t.useState(!1),{suggestions:Y,loading:K,error:Z,recentSearches:J,addRecentSearch:ee,removeRecentSearch:te,hasContent:re}=$({client:B,query:a,enabled:o&&a.length>=s,debounceMs:i,maxSuggestions:n,minQueryLength:s,enableRecentSearches:l,maxRecentSearches:c}),ae=t.useMemo(()=>{const e=[];return l&&0===a.length&&J.length>0&&J.slice(0,c).forEach(t=>{e.push({type:"recent",data:t})}),Y.forEach(t=>{e.push({type:"suggestion",data:t})}),e},[Y,J,a,l,c]);t.useEffect(()=>{if(o&&(re||K))X(!0),L?.();else{if(f.enabled){const e=setTimeout(()=>X(!1),f.duration);return()=>clearTimeout(e)}X(!1),P?.()}},[o,re,K,f.enabled,f.duration,L,P]),t.useEffect(()=>{Q(-1)},[ae.length]);const oe=t.useCallback(()=>{g.enabled&&Q(e=>{const t=e<ae.length-1?e+1:0;return D?.("down",t),t})},[g.enabled,ae.length,D]),ne=t.useCallback(()=>{g.enabled&&Q(e=>{const t=e>0?e-1:ae.length-1;return D?.("up",t),t})},[g.enabled,ae.length,D]),se=t.useCallback(()=>{if(U<0||U>=ae.length)return;const e=ae[U];if("recent"===e.type){const t=e.data;A?.(t)}else{const t=e.data;M?.(t),ee(t.query,t.count)}},[U,ae,A,M,ee]),ie=t.useCallback(()=>{Q(-1)},[]);t.useImperativeHandle(r,()=>({selectActive:se,navigateNext:oe,navigatePrevious:ne,resetSelection:ie,getActiveIndex:()=>U,getTotalItems:()=>ae.length}),[se,oe,ne,ie,U,ae.length]),t.useEffect(()=>{if(!N||!o)return;const e=e=>{V.current&&!V.current.contains(e.target)&&P?.()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N,o,P]);const le=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:h.suggestionItemHighlight,style:F.highlight},e):e)},[p.enabled,h.suggestionItemHighlight]),ce=t.useCallback(e=>e.highlightedQuery&&p.enabled?t.createElement("span",{dangerouslySetInnerHTML:{__html:e.highlightedQuery},style:{display:"inline"}}):le(e.query,a),[p.enabled,le,a]);if(!G&&!o)return null;const de=l&&0===a.length&&J.length>0,ue=Y.length>0,me=m&&!K&&!de&&!ue&&a.length>=s,pe=f.enabled?{opacity:o?1:0,transform:o?"translateY(0)":"translateY(-8px)",transition:`opacity ${f.duration}ms ease, transform ${f.duration}ms ease`}:{};return t.createElement("div",{ref:V,role:"listbox","aria-label":z,"aria-expanded":o,className:I("seekora-suggestions-dropdown",h.root,h.container),style:{position:w,width:C,zIndex:R,...F.container,...pe,...y}},K&&u&&t.createElement("div",{className:h.loadingState,style:F.loadingState},x?x():t.createElement(t.Fragment,null,t.createElement(O,null),t.createElement("span",null,"Searching..."))),de&&t.createElement("div",{className:I("seekora-suggestions-section",h.section,h.recentSearches)},t.createElement("div",{className:h.sectionTitle,style:F.sectionTitle},"Recent Searches"),J.slice(0,c).map((e,r)=>{const a=U===r;return t.createElement("div",{key:`recent-${e.query}-${r}`,role:"option","aria-selected":a,className:I(h.recentItem,a&&h.suggestionItemActive),onClick:()=>{A?.(e)},onMouseEnter:()=>Q(r)},((e,r,a)=>v?v(e,r,a):t.createElement("div",{style:{...F.suggestionItem,...a?F.suggestionItemActive:{}}},t.createElement(q,{style:F.recentIcon}),t.createElement("span",{style:F.suggestionQuery},e.query),t.createElement("button",{type:"button",onClick:t=>{t.stopPropagation(),te(e.query),_?.(e)},style:{...F.removeButton,...a?F.removeButtonVisible:{}},"aria-label":`Remove ${e.query} from recent searches`},t.createElement(H,null))))(e,r,a))})),de&&ue&&t.createElement("div",{style:F.divider}),ue&&t.createElement("div",{className:I("seekora-suggestions-section",h.section,h.suggestionsList)},a.length>0&&t.createElement("div",{className:h.sectionTitle,style:F.sectionTitle},"Suggestions"),Y.map((e,r)=>{const o=de?J.length+r:r,n=U===o;return t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,className:I(h.suggestionItem,n&&h.suggestionItemActive),onClick:()=>{M?.(e),ee(e.query,e.count)},onMouseEnter:()=>Q(o)},((e,r,o)=>b?b(e,r,o,e=>le(e,a)):t.createElement("div",{style:{...F.suggestionItem,...o?F.suggestionItemActive:{}}},t.createElement(W,{style:F.recentIcon}),t.createElement("span",{style:F.suggestionQuery},ce(e)),d&&void 0!==e.count&&t.createElement("span",{style:F.suggestionCount},e.count.toLocaleString())))(e,r,n))})),me&&t.createElement("div",{className:h.emptyState,style:F.emptyState},k?k():t.createElement(t.Fragment,null,t.createElement(W,{style:{width:24,height:24,marginBottom:8,opacity:.5}}),t.createElement("span",null,'No suggestions found for "',a,'"'))),E||g.enabled&&ae.length>0?t.createElement("div",{className:h.footer,style:F.footer},E||t.createElement("div",{style:F.keyboardHint},t.createElement("span",{style:F.keyboardKey},"↑"),t.createElement("span",{style:F.keyboardKey},"↓"),t.createElement("span",null,"to navigate"),t.createElement("span",{style:F.keyboardKey},"↵"),t.createElement("span",null,"to select"),t.createElement("span",{style:F.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 '))}),V=[{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}],U={container:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius-lg, 12px)",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, #e5e7eb)",backgroundColor:"var(--seekora-bg-secondary, #f9fafb)"},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 100ms ease",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, #111827)",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, #6b7280)",backgroundColor:"var(--seekora-bg-tertiary, #f3f4f6)",borderRadius:"12px",cursor:"pointer",transition:"all 100ms ease"},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, #374151)",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"20px",cursor:"pointer",transition:"all 150ms ease"},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:"50%",backgroundColor:"var(--seekora-primary, #3b82f6)",color:"white",fontSize:"10px",fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center"},removeButton:{padding:"4px",marginLeft:"auto",borderRadius:"4px",border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-tertiary, #9ca3af)",opacity:0,transition:"opacity 100ms ease"},divider:{height:"1px",backgroundColor:"var(--seekora-border-color, #e5e7eb)",margin:"4px 16px"},footer:{padding:"12px 16px",borderTop:"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:"var(--seekora-bg-secondary, #f9fafb)",fontSize:"12px",color:"var(--seekora-text-secondary, #6b7280)"},loadingOverlay:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)"},emptyState:{padding:"32px 16px",textAlign:"center",color:"var(--seekora-text-secondary, #6b7280)"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fef9c3)",fontWeight:600,borderRadius:"2px",padding:"0 1px"}},Q=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:U.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"})),G=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:U.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"})),X=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:U.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"})),Y=()=>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"})),K=t.forwardRef(function(e,r){const{query:a,isOpen:o=!0,sections:n=V,maxSuggestionsPerSection:s=8,minQueryLength:i=0,debounceMs:l=200,includeDropdownRecommendations:c=!0,includeDropdownProductList:d=!0,includeFilteredTabs:u=!0,includeCategories:m=!0,maxCategories:p=3,showCounts:g=!0,showCategoryCounts:f=!0,showSectionHeaders:h=!0,classNames:y={},style:b,renderSuggestion:v,renderCategory:x,renderTrendingItem:k,renderRecentItem:E,header:w,footer:C,width:R="100%",maxHeight:N="480px",zIndex:T=1e3,ariaLabel:z="Search suggestions",analyticsTags:M,onSuggestionSelect:A,onCategoryClick:_,onRecentSearchClick:L,onRecentSearchRemove:P,onViewAllClick:D,onOpen:B,onClose:F,showLoadingOverlay:W=!1,renderLoading:q}=e,{client:H}=S(),O=t.useRef(null),[j,K]=t.useState(-1),[Z,J]=t.useState(null),{suggestions:ee,loading:te,trendingSearches:re,topSearches:ae,recentSearches:oe,addRecentSearch:ne,removeRecentSearch:se,hasContent:ie}=$({client:H,query:a,enabled:o,debounceMs:l,maxSuggestions:s,minQueryLength:i,includeDropdownRecommendations:c,includeDropdownProductList:d,includeFilteredTabs:u,includeCategories:m,maxCategories:p,analyticsTags:M,enableRecentSearches:!0}),le=t.useMemo(()=>n.filter(e=>!1!==e.enabled).sort((e,t)=>(e.order||0)-(t.order||0)),[n]),ce=e=>le.find(t=>t.id===e),de=t.useMemo(()=>{const e=[];return le.forEach((t,r)=>{switch(t.id){case"recent":0===a.length&&oe.slice(0,t.maxItems||5).forEach(t=>{e.push({type:"recent",data:t,sectionIndex:r})});break;case"suggestions":ee.slice(0,t.maxItems||s).forEach(t=>{e.push({type:"suggestion",data:t,sectionIndex:r})});break;case"trending":0===a.length&&(re.length>0?re:ae).slice(0,t.maxItems||5).forEach(t=>{e.push({type:"trending",data:t,sectionIndex:r})})}}),e},[le,a,oe,ee,re,ae,s]),ue=t.useCallback(()=>{K(e=>e<de.length-1?e+1:0)},[de.length]),me=t.useCallback(()=>{K(e=>e>0?e-1:de.length-1)},[de.length]),pe=t.useCallback(()=>{if(j<0||j>=de.length)return;const e=de[j];switch(e.type){case"recent":L?.(e.data);break;case"suggestion":A?.(e.data),ne(e.data.query,e.data.count);break;case"trending":A?.({query:e.data.query,count:e.data.count}),ne(e.data.query)}},[j,de,L,A,ne]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>j,setActiveIndex:K,selectActive:pe,navigateNext:ue,navigatePrevious:me,getTotalItems:()=>de.length}),[j,pe,ue,me,de.length]);const ge=()=>{const e=ce("recent");return!e||a.length>0||0===oe.length?null:t.createElement("div",{className:I("seekora-section","seekora-section-recent",y.section)},h&&t.createElement("div",{style:U.sectionHeader},t.createElement("h3",{style:U.sectionTitle},e.title||"Recent Searches"),oe.length>(e.maxItems||5)&&t.createElement("button",{style:U.sectionAction,onClick:()=>D?.("recent")},"View all")),oe.slice(0,e.maxItems||5).map((e,r)=>{const a=((e,t)=>{let r=0;for(const a of de){if(le[a.sectionIndex].id===e)return r+t;a.sectionIndex<le.findIndex(t=>t.id===e)&&r++}return r+t})("recent",r),o=j===a;return t.createElement("div",{key:`recent-${e.query}`,role:"option","aria-selected":o,style:{...U.item,...o?U.itemActive:{}},onClick:()=>{L?.(e)},onMouseEnter:()=>K(a),className:I(y.recentItem,o&&y.suggestionItemActive)},E?E(e):t.createElement(t.Fragment,null,t.createElement(G,null),t.createElement("div",{style:U.itemContent},t.createElement("p",{style:U.itemQuery},e.query)),t.createElement("button",{style:U.removeButton,onClick:t=>{t.stopPropagation(),se(e.query),P?.(e)},"aria-label":"Remove"},t.createElement(Y,null))))}))},fe=()=>{const e=ce("suggestions");return e&&0!==ee.length?t.createElement("div",{className:I("seekora-section","seekora-section-suggestions",y.section)},h&&a.length>0&&t.createElement("div",{style:U.sectionHeader},t.createElement("h3",{style:U.sectionTitle},e.title||"Suggestions")),ee.slice(0,e.maxItems||s).map((e,r)=>{const o=de.findIndex((e,t)=>"suggestion"===e.type&&de.slice(0,t).filter(e=>"suggestion"===e.type).length===r),n=j===o;return t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,style:{...U.item,...n?U.itemActive:{}},onClick:()=>{A?.(e),ne(e.query,e.count)},onMouseEnter:()=>K(o),className:I(y.suggestionItem,n&&y.suggestionItemActive)},v?v(e,n):t.createElement(t.Fragment,null,t.createElement(Q,null),t.createElement("div",{style:U.itemContent},t.createElement("p",{style:U.itemQuery},(s=e.query,a?s.split(new RegExp(`(${a})`,"gi")).map((e,r)=>e.toLowerCase()===a.toLowerCase()?t.createElement("span",{key:r,style:U.highlight},e):e):s)),m&&e.categories&&e.categories.length>0&&t.createElement("div",{style:U.categoriesContainer},e.categories.slice(0,p).map((e,r)=>x?x(e):t.createElement("span",{key:`cat-${r}`,style:{...U.categoryPill,...Z===e.value?U.categoryPillHover:{}},onClick:t=>{t.stopPropagation(),_?.(e)},onMouseEnter:()=>J(e.value),onMouseLeave:()=>J(null)},e.value,f&&void 0!==e.count&&t.createElement("span",{style:U.categoryCount},"(",e.count,")"))))),g&&void 0!==e.count&&t.createElement("span",{style:U.itemCount},e.count.toLocaleString())));var s})):null};if(!o)return null;return ie||te||0===a.length?t.createElement("div",{ref:O,role:"listbox","aria-label":z,className:I("seekora-rich-suggestions",y.root,y.container),style:{position:"absolute",width:R,zIndex:T,...U.container,...b}},w&&t.createElement("div",{style:U.header},w),t.createElement("div",{style:{...U.content,maxHeight:N}},te&&W&&t.createElement("div",{style:U.loadingOverlay},q?q():t.createElement("span",null,"Loading...")),le.map((e,r)=>{let o=null;switch(e.id){case"recent":o=ge();break;case"suggestions":o=fe();break;case"trending":o=(()=>{const e=ce("trending"),r=re.length>0?re:ae;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:U.sectionHeader},t.createElement("h3",{style:U.sectionTitle},e.title||"Trending")),t.createElement("div",{style:U.trendingList},r.slice(0,e.maxItems||5).map((e,r)=>{const a=de.findIndex((e,t)=>"trending"===e.type&&de.slice(0,t).filter(e=>"trending"===e.type).length===r),o=j===a;return k?k(e,r):t.createElement("button",{key:`trending-${e.query}`,style:{...U.trendingChip,...o?U.trendingChipHover:{}},onClick:()=>{A?.({query:e.query,count:e.count}),ne(e.query)},onMouseEnter:()=>K(a),className:I(y.trendingItem,o&&y.suggestionItemActive)},t.createElement("span",{style:U.trendingRank},r+1),t.createElement("span",null,e.query),t.createElement(X,null))})))})()}return o?t.createElement(t.Fragment,{key:e.id},r>0&&t.createElement("div",{style:U.divider}),o):null}),!te&&a.length>0&&0===ee.length&&t.createElement("div",{style:U.emptyState},t.createElement("p",null,'No suggestions found for "',a,'"'))),C&&t.createElement("div",{style:U.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}),Z={container:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius-lg, 12px)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden"},header:{padding:"12px 20px",borderBottom:"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:"var(--seekora-bg-secondary, #f9fafb)"},content:{display:"flex",overflowY:"auto"},contentStacked:{flexDirection:"column"},suggestionsColumn:{borderRight:"1px solid var(--seekora-border-color, #e5e7eb)",overflowY:"auto"},productsColumn:{flex:1,overflowY:"auto",backgroundColor:"var(--seekora-bg-secondary, #fafafa)"},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 100ms ease",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, #111827)",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, #e5e7eb)",overflowX:"auto"},tab:{display:"flex",alignItems:"center",gap:"6px",padding:"8px 16px",fontSize:"13px",fontWeight:500,color:"var(--seekora-text-secondary, #6b7280)",backgroundColor:"transparent",border:"1px solid transparent",borderRadius:"20px",cursor:"pointer",whiteSpace:"nowrap",transition:"all 150ms ease"},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:"10px",backgroundColor:"var(--seekora-bg-tertiary, #e5e7eb)"},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, #ffffff)",borderRadius:"8px",overflow:"hidden",cursor:"pointer",transition:"transform 150ms ease, box-shadow 150ms ease",border:"1px solid var(--seekora-border-color, #e5e7eb)"},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, #111827)",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, #374151)",backgroundColor:"var(--seekora-bg-surface, #ffffff)",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"8px",cursor:"pointer",transition:"all 150ms ease"},brandChipHover:{borderColor:"var(--seekora-primary, #3b82f6)",backgroundColor:"var(--seekora-primary-light, #eff6ff)"},brandLogo:{width:"20px",height:"20px",borderRadius:"4px",objectFit:"contain",backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"},footer:{padding:"12px 20px",borderTop:"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:"var(--seekora-bg-secondary, #f9fafb)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",color:"var(--seekora-text-secondary, #6b7280)"},highlight:{backgroundColor:"var(--seekora-highlight-bg, #fef9c3)",fontWeight:600,padding:"0 2px",borderRadius:"2px"}},J=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Z.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"})),ee=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Z.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"})),te=({style:e})=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:{...Z.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"})),re=()=>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"})),ae=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:m=!0,showFilteredTabs:p=!0,showRecentSearches:g=!0,layout:f="side-by-side",productsColumnWidth:h="60%",suggestionsColumnWidth:y="40%",showPrices:b=!0,currencySymbol:v="$",classNames:x={},style:k,renderProduct:E,renderSuggestion:w,renderBrand:C,renderTab:R,header:N,footer:T,viewAllProductsLink:z,width:M="800px",maxHeight:A="600px",zIndex:_=1e3,analyticsTags:L,includeFacets:P=!0,includeCategories:D=!0,includeDropdownRecommendations:B=!0,onSuggestionSelect:F,onProductClick:W,onBrandClick:q,onTabSelect:H,onRecentSearchClick:O,onRecentSearchRemove:j,onViewAllClick:V,onOpen:U,onClose:Q}=e,{client:G}=S(),X=t.useRef(null),[Y,K]=t.useState(-1),[ae,oe]=t.useState("all"),[ne,se]=t.useState(null),[ie,le]=t.useState(null),{suggestions:ce,loading:de,filteredTabs:ue,trendingProducts:me,popularBrands:pe,recentSearches:ge,addRecentSearch:fe,removeRecentSearch:he,hasContent:ye}=$({client:G,query:a,enabled:o,debounceMs:c,maxSuggestions:n,minQueryLength:l,includeDropdownRecommendations:B,includeCategories:D,includeFacets:P,filteredTabs:d,analyticsTags:L,enableRecentSearches:g}),be=t.useMemo(()=>{if("all"===ae){const e=[...me];return ue.forEach(t=>{t.products&&t.products.forEach(t=>{e.find(e=>e.id===t.id)||e.push(t)})}),e.slice(0,s)}const e=ue.find(e=>e.id===ae);return e?.products?.slice(0,s)||[]},[ae,ue,me,s]),ve=t.useMemo(()=>{const e=[];return 0===a.length&&g&&ge.slice(0,5).forEach(t=>{e.push({type:"recent",data:t})}),ce.forEach(t=>{e.push({type:"suggestion",data:t})}),e},[a,g,ge,ce]),xe=t.useCallback(()=>{K(e=>e<ve.length-1?e+1:0)},[ve.length]),ke=t.useCallback(()=>{K(e=>e>0?e-1:ve.length-1)},[ve.length]),Ee=t.useCallback(()=>{if(Y<0||Y>=ve.length)return;const e=ve[Y];"recent"===e.type?O?.(e.data):"suggestion"===e.type&&(F?.(e.data),fe(e.data.query))},[Y,ve,O,F,fe]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>Y,setActiveIndex:K,selectActive:Ee,navigateNext:xe,navigatePrevious:ke,getActiveTab:()=>ae,setActiveTab:oe}),[Y,Ee,xe,ke,ae]);const Se=e=>{oe(e);const t=ue.find(t=>t.id===e);t&&H?.(t)};if(!o)return null;const we=p&&(ue.length>0||me.length>0),Ce=u&&be.length>0,Re=m&&pe.length>0,Ie=g&&0===a.length&&ge.length>0,Ne=ce.length>0,Te="stacked"===f||"full-width"===f;return t.createElement("div",{ref:X,role:"listbox","aria-label":"Search suggestions and products",className:I("seekora-federated-dropdown",x.root,x.container),style:{position:"absolute",width:M,zIndex:_,...Z.container,...k}},N&&t.createElement("div",{style:Z.header},N),we&&t.createElement("div",{style:Z.tabsContainer,className:x.tabsList},t.createElement("button",{style:{...Z.tab,..."all"===ae?Z.tabActive:{}},onClick:()=>Se("all"),className:I(x.tabItem,"all"===ae&&x.tabActive)},"All Results",me.length>0&&t.createElement("span",{style:{...Z.tabCount,..."all"===ae?Z.tabCountActive:{}}},me.length,"+")),ue.map(e=>R?R(e,ae===e.id):t.createElement("button",{key:e.id,style:{...Z.tab,...ae===e.id?Z.tabActive:{}},onClick:()=>Se(e.id),className:I(x.tabItem,ae===e.id&&x.tabActive)},e.label,void 0!==e.nb_hits&&t.createElement("span",{style:{...Z.tabCount,...ae===e.id?Z.tabCountActive:{}}},e.nb_hits)))),t.createElement("div",{style:{...Z.content,...Te?Z.contentStacked:{},maxHeight:A}},t.createElement("div",{style:{...Z.suggestionsColumn,width:Te?"100%":y,minWidth:Te?void 0:"280px",borderRight:Te?"none":Z.suggestionsColumn.borderRight}},Ie&&t.createElement("div",{style:Z.section,className:x.recentSearches},t.createElement("div",{style:Z.sectionHeader},t.createElement("h3",{style:Z.sectionTitle},"Recent Searches")),ge.slice(0,5).map((e,r)=>{const a=Y===r;return t.createElement("div",{key:`recent-${e.query}`,role:"option","aria-selected":a,style:{...Z.suggestionItem,...a?Z.suggestionItemActive:{}},onClick:()=>O?.(e),onMouseEnter:()=>K(r),className:I(x.recentItem,a&&x.suggestionItemActive)},t.createElement(ee,null),t.createElement("span",{style:Z.suggestionText},e.query),t.createElement(te,{style:a?Z.suggestionArrowVisible:{}}))})),Ne&&t.createElement("div",{style:Z.section,className:x.suggestionsList},t.createElement("div",{style:Z.sectionHeader},t.createElement("h3",{style:Z.sectionTitle},a?"Suggestions":"Popular Searches")),ce.slice(0,n).map((e,r)=>{const o=Ie?ge.length+r:r,n=Y===o;return w?w(e,r,n):t.createElement("div",{key:e.objectID||`suggestion-${r}`,role:"option","aria-selected":n,style:{...Z.suggestionItem,...n?Z.suggestionItemActive:{}},onClick:()=>{F?.(e),fe(e.query)},onMouseEnter:()=>K(o),className:I(x.suggestionItem,n&&x.suggestionItemActive)},t.createElement(J,null),t.createElement("span",{style:Z.suggestionText},(s=e.query,a?s.split(new RegExp(`(${a})`,"gi")).map((e,r)=>e.toLowerCase()===a.toLowerCase()?t.createElement("span",{key:r,style:Z.highlight},e):e):s)),void 0!==e.count&&t.createElement("span",{style:Z.suggestionCount},e.count.toLocaleString()),t.createElement(te,{style:n?Z.suggestionArrowVisible:{}}));var s})),Re&&t.createElement("div",{style:Z.section,className:x.brandsList},t.createElement("div",{style:Z.sectionHeader},t.createElement("h3",{style:Z.sectionTitle},"Popular Brands")),t.createElement("div",{style:Z.brandsGrid},pe.slice(0,i).map((e,r)=>C?C(e,r):t.createElement("button",{key:`brand-${e.name}`,style:{...Z.brandChip,...ie===e.name?Z.brandChipHover:{}},onClick:()=>q?.(e),onMouseEnter:()=>le(e.name),onMouseLeave:()=>le(null),className:x.brandItem},e.logo&&t.createElement("img",{src:e.logo,alt:e.name,style:Z.brandLogo,onError:e=>{e.target.style.display="none"}}),t.createElement("span",null,e.name)))))),Ce&&!Te&&t.createElement("div",{style:{...Z.productsColumn,width:h}},t.createElement("div",{style:Z.section},t.createElement("div",{style:Z.sectionHeader},t.createElement("h3",{style:Z.sectionTitle},"all"===ae?"Trending Products":`Products in ${ue.find(e=>e.id===ae)?.label||ae}`),z&&t.createElement("a",{href:z,style:Z.viewAllLink,onClick:e=>{e.preventDefault(),V?.("products")}},"View all")),t.createElement("div",{style:Z.productsGrid,className:x.productsList},be.map((e,r)=>{return E?E(e,r):t.createElement("div",{key:e.id||e.objectID,style:{...Z.productCard,...ne===e.id?Z.productCardHover:{}},onClick:()=>W?.(e),onMouseEnter:()=>se(e.id),onMouseLeave:()=>se(null),className:x.productItem},e.image?t.createElement("img",{src:e.image,alt:e.title||e.name||"",style:Z.productImage,onError:e=>{e.target.style.display="none"}}):t.createElement("div",{style:{...Z.productImage,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(re,null)),t.createElement("div",{style:Z.productInfo},t.createElement("h4",{style:Z.productTitle},e.title||e.name),b&&void 0!==e.price&&t.createElement("p",{style:Z.productPrice},(a=e.price,o=e.currency,void 0===a?"":`${o||v}${a.toLocaleString()}`))));var a,o}))))),T?t.createElement("div",{style:Z.footer},T):t.createElement("div",{style:Z.footer},t.createElement("span",null,"Press ↵ to search, ↑↓ to navigate"),a&&t.createElement("button",{style:{...Z.viewAllLink,background:"none",border:"none"},onClick:()=>V?.("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 '))}),oe="suggestions.click",ne="suggestions.impression",se="suggestions.product_click",ie="suggestions.category_click",le="suggestions.brand_click",ce="suggestions.tab_select",de="suggestions.recent_click",ue="suggestions.trending_click",me="suggestions.search_submit",pe="suggestions.dropdown_open",ge="suggestions.dropdown_close";function fe(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),m=t.useRef(null),p=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{await(r.trackEvent?.({event_name:e,analytics_tags:o,metadata:{...t,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(oe,{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(se,{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(ie,{category_value:e.value,category_count:e.count,category_path:e.path,original_query:t})},[g,i]),trackBrandClick:t.useCallback((e,t)=>{i&&g(le,{brand_name:e.name,brand_count:e.count,original_query:t})},[g,i]),trackTabSelect:t.useCallback((e,t)=>{g(ce,{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(de,{query:e.query,original_timestamp:e.timestamp,results_count:e.resultsCount})},[g,i]),trackTrendingClick:t.useCallback((e,t)=>{i&&g(ue,{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!==m.current&&(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{m.current=t,g(ne,{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(me,{query:e,from_suggestion:t,suggestion_query:r?.query,suggestion_id:r?.objectID,suggestion_popularity:r?.popularity})},[g]),trackDropdownOpen:t.useCallback(e=>{p.current=Date.now(),g(pe,{query:e,has_query:e.length>0})},[g]),trackDropdownClose:t.useCallback((e,t)=>{const r=p.current?Date.now()-p.current:null;g(ge,{query:e,selected_suggestion:t,had_selection:!!t,duration_ms:r}),p.current=null},[g])}}const he={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-primary, #3b82f6)",boxShadow:"0 0 0 3px 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:"white",borderRadius:"var(--seekora-border-radius, 6px)",fontSize:"14px",fontWeight:600,cursor:"pointer",transition:"background-color 150ms ease"}},ye=()=>t.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",style:he.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"})),be=()=>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"})),ve=t.forwardRef(function(e,r){const{variant:a="classic",placeholder:o="Search...",initialQuery:n="",value:s,onQueryChange:i,onSearch:l,onSuggestionSelect:c,onProductClick:d,showSearchButton:u=!1,searchButtonText:m="Search",showClearButton:p=!0,autoFocus:g=!1,minQueryLength:f=1,maxSuggestions:h=8,maxProducts:y=8,debounceMs:b=200,showRecentSearches:v=!0,showTrendingOnEmpty:x=!0,includeDropdownRecommendations:k=!1,filteredTabs:E,enableAnalytics:w=!0,analyticsTags:C,includeFacets:R,includeCategories:N,dropdownWidth:T,dropdownMaxHeight:z,classNames:M={},style:A,inputStyle:_,ariaLabel:L="Search"}=e,{client:P}=S(),D=t.useRef(null),B=t.useRef(null),[$,F]=t.useState(s??n),[W,q]=t.useState(!1),[H,O]=t.useState(!1),V=fe({client:P,enabled:w,analyticsTags:C});t.useEffect(()=>{void 0!==s&&s!==$&&F(s)},[s]);const U=t.useCallback(e=>{const t=e.target.value;F(t),i?.(t),(t.length>=f||x&&0===t.length)&&O(!0)},[i,f,x]),Q=t.useCallback(e=>{e?.preventDefault(),$.trim()&&(l?.($.trim()),V.trackSearchSubmit($.trim(),!1),O(!1))},[$,l,V]),G=t.useCallback(e=>{F(e.query),i?.(e.query),c?.(e),V.trackSuggestionClick({suggestion:e,position:0,query:$}),O(!1),l?.(e.query)},[$,i,c,l,V]),X=t.useCallback(e=>{d?.(e),V.trackProductClick({product:e,position:0,query:$}),O(!1)},[$,d,V]),Y=t.useCallback(e=>{F(e.query),i?.(e.query),V.trackRecentSearchClick(e),O(!1),l?.(e.query)},[i,l,V]),Z=t.useCallback(()=>{q(!0),O(!0),V.trackDropdownOpen($)},[$,V]),J=t.useCallback(()=>{q(!1),setTimeout(()=>{O(!1),V.trackDropdownClose($)},200)},[$,V]),ee=t.useCallback(()=>{F(""),i?.(""),D.current?.focus()},[i]),te=t.useCallback(e=>{if(H)switch(e.key){case"ArrowDown":e.preventDefault(),B.current?.navigateNext?.();break;case"ArrowUp":e.preventDefault(),B.current?.navigatePrevious?.();break;case"Enter":e.preventDefault(),(B.current?.getActiveIndex?.()??-1)>=0?B.current?.selectActive?.():Q();break;case"Escape":e.preventDefault(),O(!1),D.current?.blur()}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||O(!0)},[H,Q]);t.useImperativeHandle(r,()=>({focus:()=>D.current?.focus(),blur:()=>D.current?.blur(),clear:ee,getQuery:()=>$,setQuery:e=>{F(e),i?.(e)},openDropdown:()=>O(!0),closeDropdown:()=>O(!1),navigateNext:()=>B.current?.navigateNext?.(),navigatePrevious:()=>B.current?.navigatePrevious?.(),selectCurrent:()=>B.current?.selectActive?.()}),[$,ee,i]);return t.createElement("div",{className:I("seekora-search-bar-with-suggestions",M.wrapper),style:{...he.wrapper,...A}},t.createElement("form",{onSubmit:Q},t.createElement("div",{style:{...he.inputWrapper,...W?he.inputWrapperFocused:{}}},t.createElement(ye,null),t.createElement("input",{ref:D,type:"text",value:$,onChange:U,onFocus:Z,onBlur:J,onKeyDown:te,placeholder:o,autoFocus:g,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":L,"aria-expanded":H,"aria-haspopup":"listbox","aria-autocomplete":"list",role:"combobox",className:M.input,style:{...he.input,..._}}),p&&$&&t.createElement("button",{type:"button",onClick:ee,className:M.clearButton,style:he.clearButton,"aria-label":"Clear search"},t.createElement(be,null)),u&&t.createElement("button",{type:"submit",className:M.button,style:he.searchButton},m))),t.createElement("div",{className:M.dropdown},(()=>{const e={query:$,isOpen:H,maxSuggestions:h,minQueryLength:f,debounceMs:b,showRecentSearches:v,classNames:M,onSuggestionSelect:G,onRecentSearchClick:Y,onClose:()=>O(!1),analyticsTags:C};switch(a){case"rich":return t.createElement(K,{ref:B,...e,includeDropdownRecommendations:k,includeCategories:!0,width:T||"100%",maxHeight:z||"480px"});case"federated":return t.createElement(ae,{ref:B,...e,maxProducts:y,filteredTabs:E,showProducts:!0,showBrands:!0,showFilteredTabs:!!E,onProductClick:X,width:T||"800px",maxHeight:z||"600px",includeFacets:R,includeCategories:N,includeDropdownRecommendations:k});case"compact":return t.createElement(j,{ref:B,...e,maxSuggestions:5,showCounts:!1,width:T||"100%"});default:return t.createElement(j,{ref:B,...e,width:T||"100%"})}})()))}),xe=t.createContext(null);function ke(){const e=t.useContext(xe);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 Ee({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:m}=S(),[p,g]=t.useState(""),[f,h]=t.useState(!1),[y,b]=t.useState(-1),[v,x]=t.useState(""),k=$({client:m,query:p,enabled:f,minQueryLength:r,debounceMs:a,maxSuggestions:o,includeDropdownRecommendations:n,filteredTabs:s,includeCategories:!0,enableRecentSearches:!0,maxRecentSearches:8,analyticsTags:l}),E=fe({client:m,enabled:i,analyticsTags:l,trackClicks:!0,trackImpressions:!0}),{suggestions:w,recentSearches:C,trendingSearches:R,trendingProducts:I,filteredTabs:N,loading:T,error:z,hasContent:M,getAllNavigableItems:A,addRecentSearch:_}=k,L=t.useRef(c),P=t.useRef(d),D=t.useRef(u);L.current=c,P.current=d,D.current=u;const B=t.useCallback(e=>{g(e),b(-1)},[]),F=t.useCallback(()=>{E.trackDropdownClose(p),h(!1),b(-1)},[E,p]),W=t.useCallback(e=>{e?(h(!0),E.trackDropdownOpen(p)):F()},[E,p,F]),q=t.useCallback((e,t)=>{E.trackSuggestionClick({suggestion:e,position:t,query:p,totalSuggestions:w.length}),B(e.query),P.current?.(e),E.trackSearchSubmit(e.query,!0,e),_(e.query),F(),L.current?.(e.query)},[E,p,w.length,_,F]),H=t.useCallback((e,t,r,a)=>{E.trackProductClick({product:e,position:t,section:r??"products",tabId:a,query:p}),F(),D.current?.(e)},[E,p,F]),O=t.useCallback(e=>{E.trackRecentSearchClick(e),B(e.query),F(),L.current?.(e.query),E.trackSearchSubmit(e.query,!1)},[E,F]),j=t.useCallback((e,t)=>{E.trackTrendingClick(e,t),B(e.query),F(),L.current?.(e.query),E.trackSearchSubmit(e.query,!1)},[E,F]),V=t.useCallback(e=>{x(e.id),E.trackTabSelect(e,p)},[E,p]),U=t.useCallback((e,t,r)=>{const a=e.trim();a&&(E.trackSearchSubmit(a,!!t,r),_(a),F(),L.current?.(a))},[E,_,F]),Q=t.useCallback(()=>{const e=A();0!==e.length&&b(t=>t<e.length-1?t+1:0)},[A]),G=t.useCallback(()=>{const e=A();0!==e.length&&b(t=>t<=0?e.length-1:t-1)},[A]),X=t.useCallback(()=>{const e=A();if(y<0||y>=e.length)return void U(p);const t=e[y];switch(t.type){case"suggestion":q(t.data,t.index);break;case"product":H(t.data,t.index,"products");break;case"recent":O(t.data);break;case"trending":j(t.data,t.index);break;default:U(p)}},[y,A,p,U,q,H,O,j]);t.useEffect(()=>{f&&M&&p&&E.trackImpression({suggestions:w,products:I,query:p,timestamp:Date.now()})},[f,M,p,w,I,E]);const Y=t.useMemo(()=>({query:p,setQuery:B,isOpen:f,setIsOpen:W,activeIndex:y,setActiveIndex:b,suggestions:w,recentSearches:C,trendingSearches:R,trendingProducts:I,filteredTabs:N,activeTabId:v,setActiveTabId:x,loading:T,error:z,hasContent:M,getAllNavigableItems:A,selectSuggestion:q,selectProduct:H,selectRecentSearch:O,selectTrendingSearch:j,setActiveTab:V,submitSearch:U,close:F,navigateNext:Q,navigatePrev:G,selectActive:X}),[p,B,f,W,y,b,w,C,R,I,N,v,x,T,z,M,A,q,H,O,j,V,U,F,Q,G,X]);return t.createElement(xe.Provider,{value:Y},e)}const Se={position:"relative",width:"100%"},we={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",border:"1px solid var(--seekora-border-color, #e5e7eb)",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:"var(--seekora-bg-surface, #fff)",transition:"border-color 150ms ease, box-shadow 150ms ease"},Ce={flex:1,minWidth:0,padding:"8px 0",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"inherit",color:"var(--seekora-text-primary, #111827)",fontFamily:"inherit"};function Re({placeholder:e="Search...",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:m,isOpen:p,setIsOpen:g,navigateNext:f,navigatePrev:h,selectActive:y,close:b}=ke(),v=t.useRef(null),x=t.useCallback(()=>{g(!0)},[g]),k=t.useCallback(()=>{o&&setTimeout(()=>b(),200)},[b,o]),E=t.useCallback(e=>{m(e.target.value)},[m]),S=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]),w=t.useCallback(()=>{m(""),v.current?.focus()},[m]);return t.createElement("div",{className:I("seekora-suggestions-search-input-wrapper",s),style:{...Se,...i}},t.createElement("div",{className:"seekora-suggestions-input-wrapper",style:we},n?t.createElement("span",{className:"seekora-suggestions-input-left-icon",style:{display:"flex",flexShrink:0,color:"var(--seekora-text-secondary, #6b7280)"}},n):null,t.createElement("input",{ref:v,type:"text",value:u,onChange:E,onFocus:x,onBlur:k,onKeyDown:S,placeholder:e,autoFocus:r,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":d,"aria-expanded":p,"aria-haspopup":"listbox","aria-autocomplete":"list",role:"combobox",className:I("seekora-suggestions-input",l),style:{...Ce,...c}}),a&&u?t.createElement("button",{type:"button",onClick:w,className:"seekora-suggestions-input-clear","aria-label":"Clear search",style:{padding:4,border:"none",background:"transparent",cursor:"pointer",color:"var(--seekora-text-secondary, #6b7280)",display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(Ie,null)):null))}function Ie(){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"}))}function Ne({children:e,position:r="absolute",top:a="100%",left:o=0,right:n,width:s="100%",maxHeight:i="80vh",zIndex:l=1e3,className:c,style:d,closeOnClickOutside:u=!0,closeOnEscape:m=!0}){const{isOpen:p,close:g}=ke(),f=t.useRef(null);t.useEffect(()=>{if(!m||!p)return;const e=e=>{"Escape"===e.key&&g()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[m,p,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(p)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[p,h]),!p)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, 6px)",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 Te={backgroundColor:"var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))",fontWeight:500,borderRadius:"2px",padding:"0 2px"};function ze(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}=r;return t.createElement(t.Fragment,null,a.map((e,r)=>{const a=e.match(/^<mark>([\s\S]*)<\/mark>$/);return a?t.createElement("mark",{key:r,className:o,style:{...Te,...n}},a[1]):e}))}const Me={padding:"10px 12px",cursor:"pointer",listStyle:"none",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"var(--seekora-text-primary, #111827)",transition:"background-color 120ms ease"};function Ae({suggestion:e,index:r,isActive:a,onSelect:o,className:n,style:s,enableHighlightMarkup:i=!0,highlightMarkupOptions:l,renderHighlight:c}){const d=e.highlightedQuery??e.query,u=null!=c?c(d):i?ze(d??"",l):e.query??d??"";return t.createElement("li",{role:"option","aria-selected":a,id:`seekora-suggestion-${r}`,className:I("seekora-suggestions-item",a&&"seekora-suggestions-item--active",n),style:{...Me,...a?{backgroundColor:"var(--seekora-bg-hover, #f3f4f6)"}:{},...s},onMouseDown:e=>{e.preventDefault(),o()}},u,null!=e.count?t.createElement("span",{className:"seekora-suggestions-item-count",style:{marginLeft:8,color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875em"}},e.count):null)}const _e={margin:0,padding:"4px 0"};function Le({maxItems:e=10,className:r,style:a,listClassName:o,showLoadingState:n=!1,renderLoading:s,enableHighlightMarkup:i=!0,highlightMarkupOptions:l,renderItem:c}){const{suggestions:d,activeIndex:u,loading:m,selectSuggestion:p,getAllNavigableItems:g}=ke(),f=d.slice(0,e),h=g().findIndex(e=>"suggestion"===e.type),y=h>=0&&u>=h&&u<h+f.length;return m&&0===f.length&&n?s?t.createElement(t.Fragment,null,s()):t.createElement("div",{className:I("seekora-suggestions-loading",r),style:{padding:16,color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875rem",...a}},"Loading..."):0===f.length?null:t.createElement("div",{className:I("seekora-suggestions-list",r),style:a},t.createElement("ul",{className:I("seekora-suggestions-list-ul",o),style:_e,role:"listbox"},f.map((e,r)=>{const a=h>=0?h+r:r,o=y&&u===a,n=()=>p(e,a);return c?t.createElement("li",{key:e.objectID??e.query??r,role:"option"},c(e,a,o,n)):t.createElement(Ae,{key:e.objectID??e.query??r,suggestion:e,index:a,isActive:o,onSelect:n,enableHighlightMarkup:i,highlightMarkupOptions:l})})))}function Pe({src:e,alt:r="",mode:a="both",zoomLevel:o=2.5,className:n,style:s,showZoomIndicator:i=!0,lensSize:l=150,zoomPanelSize:c={width:400,height:400},images:d,currentIndex:u=0}){const[m,p]=t.useState(!1),[g,f]=t.useState(!1),[h,y]=t.useState(u),[b,v]=t.useState({x:0,y:0}),[x,k]=t.useState(!1),[E,S]=t.useState(null),[w,C]=t.useState(null),R=t.useRef(null),N=t.useRef(null),T=d&&d.length>0?d:[e],z=T.length>1,M="hover"===a||"both"===a,A="click"===a||"both"===a,_="lens"===a,L=t.useCallback(e=>{if(!N.current)return;const t=N.current.getBoundingClientRect(),r=e.clientX-t.left,a=e.clientY-t.top;v({x:r,y:a})},[]),P=t.useCallback(()=>{p(!0)},[]),D=t.useCallback(()=>{p(!1)},[]),B=t.useCallback(e=>{A&&(e?.stopPropagation(),y(u),f(!0))},[A,u]),$=t.useCallback(e=>{e?.stopPropagation(),f(!1)},[]),F=t.useCallback(()=>{y(e=>(e+1)%T.length)},[T.length]),W=t.useCallback(()=>{y(e=>(e-1+T.length)%T.length)},[T.length]),q=t.useCallback(e=>{C(null),S(e.targetTouches[0].clientX)},[]),H=t.useCallback(e=>{C(e.targetTouches[0].clientX)},[]),O=t.useCallback(()=>{if(!E||!w)return;const e=E-w,t=e<-50;e>50?F():t&&W()},[E,w,50,F,W]);t.useEffect(()=>{if(!g)return;const e=e=>{"Escape"===e.key&&$(),z&&("ArrowRight"===e.key&&F(),"ArrowLeft"===e.key&&W())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,$,z,F,W]);const j={position:"relative",display:"inline-block",cursor:A?"zoom-in":M||_?"crosshair":"default",overflow:"hidden",...s};return t.createElement(t.Fragment,null,t.createElement("div",{ref:N,className:I("seekora-image-zoom",n),style:j,onMouseMove:L,onMouseEnter:P,onMouseLeave:D,onClick:B},t.createElement("img",{ref:R,src:e,alt:r,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onLoad:()=>k(!0)}),i&&A&&t.createElement("div",{style:{position:"absolute",top:8,right:8,width:32,height:32,borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.6)",color:"#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:N.current?{position:"absolute",width:l,height:l,left:b.x-l/2,top:b.y-l/2,border:"2px solid rgba(255,255,255,0.8)",borderRadius:"50%",boxShadow:"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(!N.current||!R.current)return{};const e=N.current.getBoundingClientRect();return R.current.getBoundingClientRect(),{position:"absolute",width:e.width*o,height:e.height*o,left:-(b.x*o-l/2),top:-(b.y*o-l/2),objectFit:"cover"}})()})),M&&m&&x&&N.current&&t.createElement("div",{style:{position:"absolute",left:b.x-75,top:b.y-75,width:150,height:150,border:"2px solid rgba(0,0,0,0.3)",backgroundColor:"rgba(255,255,255,0.1)",pointerEvents:"none",zIndex:50}}),M&&m&&x&&t.createElement("div",{style:(()=>{if(!N.current||!x)return{display:"none"};const t=N.current.getBoundingClientRect(),r=b.x/t.width*100,a=b.y/t.height*100;return{position:"fixed",top:t.top,left:t.right+16,width:c.width,height:c.height,backgroundImage:`url(${e})`,backgroundSize:100*o+"%",backgroundPosition:`${r}% ${a}%`,backgroundRepeat:"no-repeat",border:"2px solid var(--seekora-border-color, #e5e7eb)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.2)",backgroundColor:"#fff",pointerEvents:"none",zIndex:9998}})()})),g&&t.createElement("div",{className:"seekora-image-zoom-lightbox",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.95)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out",padding:20},onClick:$,onTouchStart:z?q:void 0,onTouchMove:z?H:void 0,onTouchEnd:z?O: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:"rgba(255,255,255,0.2)",color:"#fff",fontSize:"1.5rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),$()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.3)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.2)"}},"✕"),z&&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:"rgba(255,255,255,0.2)",color:"#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="rgba(255,255,255,0.3)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="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:"rgba(255,255,255,0.2)",color:"#fff",fontSize:"2rem",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 150ms",zIndex:10001},onClick:e=>{e.stopPropagation(),F()},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.3)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.2)"}},"›")),t.createElement("img",{src:T[h],alt:r,style:{maxWidth:"90%",maxHeight:"90%",objectFit:"contain",borderRadius:4,cursor:"default"},onClick:e=>e.stopPropagation()}),z&&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(),y(r)},style:{width:60,height:60,padding:0,border:r===h?"3px solid #fff":"2px solid rgba(255,255,255,0.3)",borderRadius:4,overflow:"hidden",cursor:"pointer",opacity:r===h?1:.6,transition:"all 150ms ease",flexShrink:0,background:"none"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{r!==h&&(e.currentTarget.style.opacity="0.6")}},t.createElement("img",{src:e,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})))),t.createElement("div",{style:{color:"rgba(255,255,255,0.9)",fontSize:"0.875rem",textAlign:"center",backgroundColor:"rgba(0,0,0,0.5)",padding:"4px 12px",borderRadius:12}},h+1," / ",T.length)),t.createElement("div",{style:{position:"absolute",top:20,left:"50%",transform:"translateX(-50%)",color:"rgba(255,255,255,0.7)",fontSize:"0.875rem",textAlign:"center",backgroundColor:"rgba(0,0,0,0.5)",padding:"8px 16px",borderRadius:12}},z?"Use arrow keys or click thumbnails to navigate • ESC to close":"Click outside or press ESC to close")))}const De={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"};function Be({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[m,p]=t.useState(0),[g,f]=t.useState(!1),h=Array.isArray(e)?e.filter(Boolean):[],y=h[m]??h[0];if(0===h.length)return t.createElement("div",{className:I("seekora-img-display","seekora-img-placeholder",o),style:{...De,...n},"aria-hidden":!0});if("single"===r)return l?t.createElement(Pe,{src:h[0],alt:a,mode:c,zoomLevel:d,images:h,currentIndex:0,className:I("seekora-img-display","seekora-img-single",o),style:{...De,...n}}):t.createElement("img",{src:h[0],alt:a,className:I("seekora-img-display","seekora-img-single",o),style:{...De,...n},loading:"lazy"});if("hover"===r){const e=h.length>1&&g,r=e?h[1]:h[0],s=n?.aspectRatio?{...De,aspectRatio:n.aspectRatio}:De;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(Pe,{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=>{p(t=>{const r=t+e;return r<0?h.length-1:r>=h.length?0:r})},r=n?.aspectRatio?{...De,aspectRatio:n.aspectRatio}:De,s=l?t.createElement(Pe,{src:y,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:m,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:$e(!0),onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),e(-1)},onClick:e=>e.stopPropagation(),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.9)"}},"‹"),t.createElement("button",{type:"button","aria-label":"Next",className:"seekora-img-carousel-next",style:$e(!1),onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),e(1)},onClick:e=>e.stopPropagation(),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(255,255,255,0.9)"}},"›"),u&&t.createElement("div",{className:"seekora-img-carousel-dots",style:{position:"absolute",bottom:8,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,padding:"6px 12px",backgroundColor:"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(),p(r)},style:{width:8,height:8,borderRadius:"50%",border:"none",padding:0,backgroundColor:r===m?"#fff":"rgba(255,255,255,0.5)",cursor:"pointer",transition:"all 150ms ease"}})))))}if("thumbStrip"===r||"thumbList"===r){const e=n?.aspectRatio?{...De,aspectRatio:n.aspectRatio}:De,r=l?t.createElement(Pe,{src:y,alt:a,mode:c,zoomLevel:d,images:h,currentIndex:m,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:8,...n}},r,t.createElement("div",{className:"seekora-img-thumbs",style:{display:"flex",gap:4,overflowX:"auto",paddingBottom:4}},h.map((e,r)=>t.createElement("button",{type:"button",key:r,className:I("seekora-img-thumb",r===m&&"seekora-img-thumb--active"),style:{flexShrink:0,width:48,height:48,padding:0,border:r===m?"2px solid var(--seekora-primary)":"1px solid transparent",borderRadius:4,overflow:"hidden",cursor:"pointer",background:"none"},onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),p(r)},onClick:e=>e.stopPropagation()},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:{...De,...n},loading:"lazy"})}function $e(e){return{position:"absolute",top:"50%",[e?"left":"right"]:8,transform:"translateY(-50%)",width:32,height:32,borderRadius:"50%",border:"none",backgroundColor:"rgba(255, 255, 255, 0.9)",color:"#111",fontSize:"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 Fe={addToCart:"🛒",wishlist:"♡",buyNow:"⚡",quickView:"👁",compare:"⚖"},We={addToCart:"Add to Cart",wishlist:"Wishlist",buyNow:"Buy Now",quickView:"Quick View",compare:"Compare"},qe={small:{width:28,height:28,fontSize:"0.75rem",iconSize:"1rem"},medium:{width:36,height:36,fontSize:"0.875rem",iconSize:"1.25rem"},large:{width:44,height:44,fontSize:"1rem",iconSize:"1.5rem"}};function He({buttons:e,layout:r="horizontal",position:a="inline",showLabels:o=!1,size:n="medium",className:s,style:i}){const l=qe[n],c={display:"flex",flexDirection:"vertical"===r?"column":"row",gap:6,..."inline"!==a?{position:"absolute",..."top-right"===a?{top:8,right:8}:{},..."bottom-center"===a?{bottom:8,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:6,backgroundColor:"var(--seekora-bg-surface, #fff)",color:"var(--seekora-text, #111827)",cursor:"pointer",transition:"all 150ms ease",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"};return t.createElement("div",{className:I("seekora-action-buttons",`seekora-action-buttons--${r}`,s),style:c},e.map((e,r)=>{const a=e.icon??Fe[e.type],n=e.label??We[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 Oe={display:"flex",flexDirection:"column",gap:8,padding:8,cursor:"pointer",border:"none",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:"transparent",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",transition:"background-color 120ms ease"},je={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"};function Ve({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 m=e.images?.length?e.images:e.image??e.imageUrl?[String(e.image??e.imageUrl)]:[],p=e.title??e.primaryText??"",g=e.description??e.secondaryText,f=e.url,h="horizontal"===l,y=m.length>0?t.createElement("div",{style:{position:"relative",...h?{width:80,flexShrink:0}:{}}},t.createElement(Be,{images:m,variant:i,alt:String(p),className:"seekora-item-card-image"}),c&&c.length>0&&d?.startsWith("overlay")&&t.createElement(He,{buttons:c,position:"overlay-top-right"===d?"top-right":"bottom-center",showLabels:u,size:"small"})):t.createElement("div",{className:"seekora-item-card-placeholder",style:{...je,...h?{width:80,height:80,flexShrink:0}:{}},"aria-hidden":!0}),b=t.createElement("div",{style:h?{display:"flex",flexDirection:"column",gap:4,flex:1,minWidth:0}:void 0},t.createElement("span",{className:"seekora-item-card-title",style:{fontSize:"0.875rem",fontWeight:500}},String(p)),g?t.createElement("span",{className:"seekora-item-card-description",style:{fontSize:"0.8125rem",color:"var(--seekora-text-secondary, #6b7280)",lineHeight:1.3}},String(g)):null,c&&c.length>0&&"inline"===d&&t.createElement(He,{buttons:c,position:"inline",showLabels:u,size:"small",layout:"horizontal"})),v=h?t.createElement("div",{style:{display:"flex",gap:12,alignItems:"flex-start"}},y,b):t.createElement(t.Fragment,null,y,b),x={className:I("seekora-item-card",h&&"seekora-item-card--horizontal",o),style:{...Oe,...h?{flexDirection:"row"}:{},...n},"data-position":r,onClick:a,onMouseDown:a?e=>{e.preventDefault(),a()}:void 0};return s&&f?t.createElement("a",{href:f,...x,"data-item-id":e.id},v):t.createElement("button",{type:"button",...x,"data-item-id":e.id},v)}const Ue={display:"grid",gridTemplateColumns:"repeat(var(--seekora-grid-cols, 4), minmax(0, 1fr))",gap:12,padding:12};function Qe({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:m,gridClassName:p}){const g=e.slice(0,c);if(0===g.length)return null;const f={...Ue,gridTemplateColumns:`repeat(${d}, minmax(0, 1fr))`};return t.createElement("div",{className:I("seekora-item-grid",u),style:m},t.createElement("div",{className:I("seekora-item-grid-inner",p),style:f},g.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(Ve,{key:d.id,item:d,position:c,onSelect:r?()=>r(e,c):void 0})})))}const Ge=(e,t)=>{if(e&&t)return t.split(".").reduce((e,t)=>{if(null!=e)return e[t]},e)},Xe=(e,t={query:"query"})=>({query:Ge(e,t.query)??"",count:t.count?Ge(e,t.count):void 0,id:t.id?Ge(e,t.id):e?.objectID||e?.id,categories:t.categories?Ge(e,t.categories):void 0,highlighted:t.highlighted?Ge(e,t.highlighted):void 0,_raw:e}),Ye=(e,t={id:"id",title:"title"})=>({id:Ge(e,t.id)??e?.objectID??e?.id,title:Ge(e,t.title)??"",image:t.image?Ge(e,t.image):void 0,price:t.price?Ge(e,t.price):void 0,comparePrice:t.comparePrice?Ge(e,t.comparePrice):void 0,url:t.url?Ge(e,t.url):void 0,brand:t.brand?Ge(e,t.brand):void 0,category:t.category?Ge(e,t.category):void 0,rating:t.rating?Ge(e,t.rating):void 0,reviewCount:t.reviewCount?Ge(e,t.reviewCount):void 0,discount:t.discount?Ge(e,t.discount):void 0,inStock:t.inStock?Ge(e,t.inStock):void 0,currency:t.currency?Ge(e,t.currency):void 0,images:t.images?Ge(e,t.images):e?.images,originalPrice:t.originalPrice?Ge(e,t.originalPrice):e?.original_price??e?.compare_at_price,available:t.available?Ge(e,t.available):e?.available,options:t.options?Ge(e,t.options):e?.options,variants:t.variants?Ge(e,t.variants):e?.variants,tags:t.tags?Ge(e,t.tags):e?.tags,_raw:e}),Ke=(e,t={id:"id",label:"label"})=>({id:Ge(e,t.id)??e?.id,label:Ge(e,t.label)??"",count:t.count?Ge(e,t.count):void 0,icon:t.icon?Ge(e,t.icon):void 0,image:t.image?Ge(e,t.image):void 0,_raw:e}),Ze=(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}`},Je=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(/[&<>"']/g,e=>t[e])},et=(e,t,r={})=>{if(!t||!e)return Je(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 Je(e).replace(new RegExp(`(${Je(s)})`,"gi"),`<${a}${l}${i}>$1</${a}>`)},tt=(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},rt=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}},at=(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}})},ot=(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,nt=(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},st=(...e)=>e.filter(Boolean).join(" "),it=(...e)=>Object.assign({},...e.filter(Boolean)),lt="seekora_recent_searches",ct=e=>{try{const t=e?`${lt}_${e}`:lt,r=localStorage.getItem(t);return r?JSON.parse(r):[]}catch{return[]}},dt=(e,t)=>{try{const r=t?`${lt}_${t}`:lt;let a=ct(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[]}},ut=(e,t)=>{try{const r=t?`${lt}_${t}`:lt;let a=ct(t);return a=a.filter(t=>t!==e),localStorage.setItem(r,JSON.stringify(a)),a}catch{return[]}},mt=(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 pt{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 gt=null;const ft=e=>(gt||(gt=new pt(e)),gt);function ht({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,m=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&&m>0&&t.createElement("span",{className:"seekora-price-discount",style:{color:"var(--seekora-error, #ef4444)",fontSize:"0.8125em",fontWeight:600}},"-",m,"%"))}const yt={"top-left":{position:"absolute",top:6,left:6},"top-right":{position:"absolute",top:6,right:6},"bottom-left":{position:"absolute",bottom:6,left:6},"bottom-right":{position:"absolute",bottom:6,right:6},inline:{}},bt={sale:{bg:"#ef4444",text:"#fff"},new:{bg:"#3b82f6",text:"#fff"},soldOut:{bg:"#6b7280",text:"#fff"},limited:{bg:"#f59e0b",text:"#fff"},custom:{bg:"#111827",text:"#fff"}};function vt({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:4,zIndex:1,...yt[a],...n}},s.map((e,r)=>{const a=bt[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:4,fontSize:"0.6875rem",fontWeight:600,lineHeight:1.4,backgroundColor:e.color??a.bg,color:e.textColor??a.text,whiteSpace:"nowrap"}},e.text)}))}const xt={small:14,medium:18,large:24},kt={small:"0.75rem",medium:"0.875rem",large:"1rem"};function Et({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 St({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:m="var(--seekora-text-secondary, #6b7280)",showReviewCount:p=!0,reviewCountFormat:g,className:f,style:h}){const[y,b]=t.useState(null),v=Math.max(0,Math.min(n,e)),x=l&&null!==y?y:v,k=xt[o],E=kt[o],S=e=>g?g(e):e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString(),w=()=>{const e=[];for(let r=1;r<=n;r++){const a=r<=Math.floor(x),o=i&&r===Math.ceil(x)&&x%1>=.25&&x%1<.75;e.push(t.createElement(Et,{key:r,filled:a,half:o,size:k,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},w()):"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}},w()),s&&t.createElement("span",{className:"seekora-rating-numeric",style:{fontWeight:600,color:m}},v.toFixed(1)),p&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-count",style:{color:m}},"(",S(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}},w()),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:m}},"/ ",n)),p&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-text",style:{fontSize:"0.875em",color:m}},"Based on ",S(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}},w()),p&&null!=r&&r>0&&t.createElement("span",{className:"seekora-rating-review-count",style:{color:m}},"(",S(r),")")):null}const wt={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 Ct({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[m,p]=t.useState(new Set);if(!e||0===e.length)return null;const g=r?e.filter(e=>r.includes(e.name)):e;if(0===g.length)return null;return t.createElement("div",{className:I("seekora-variant-swatches",d),style:{display:"flex",flexDirection:"column",gap:4,...u}},g.map(r=>{const d=(e=>{const t=e.toLowerCase();return"color"===t||"colour"===t||"colors"===t||"colours"===t})(r.name),u=m.has(r.name),g=u?r.values:r.values.slice(0,a),f=r.values.length-a,h=f>0,y=n?.[r.name];return t.createElement("div",{key:r.name,className:"seekora-variant-swatch-group",style:{display:"flex",alignItems:"center",gap:4,flexWrap:"wrap"}},g.map(a=>{const u=d?((e,t)=>{if(t?.[e])return t[e];const r=e.toLowerCase();return t?.[r]?t[r]:wt[r]??null})(a,o):null,m=y===a,p=!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",m&&"seekora-variant-swatch--selected",!p&&"seekora-variant-swatch--unavailable"),title:`${a}${p?"":" (Unavailable)"}`,style:{display:"inline-block",width:14,height:14,borderRadius:"50%",backgroundColor:u,border:m?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",outline:m?"2px solid var(--seekora-primary, #111827)":"none",outlineOffset:2,cursor:c&&p?"pointer":"not-allowed",flexShrink:0,boxShadow:m?"0 0 0 1px #fff":"none",opacity:p?1:.3,position:"relative"},onMouseEnter:()=>p&&l?.(r.name,a),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),p&&c?.(r.name,a)}},!p&&t.createElement("span",{style:{position:"absolute",top:"50%",left:"-2px",right:"-2px",height:1,backgroundColor:"#ef4444",transform:"translateY(-50%) rotate(-45deg)"}})):t.createElement("span",{key:a,className:I("seekora-variant-swatch","seekora-variant-swatch--text",m&&"seekora-variant-swatch--selected",!p&&"seekora-variant-swatch--unavailable"),style:{display:"inline-block",padding:"1px 6px",fontSize:"0.6875rem",borderRadius:3,border:m?"1px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:m?"var(--seekora-primary, #111827)":"transparent",color:m?"#fff":"var(--seekora-text-secondary, #6b7280)",cursor:c&&p?"pointer":"not-allowed",whiteSpace:"nowrap",fontWeight:m?600:400,opacity:p?1:.4,textDecoration:p?"none":"line-through"},onMouseEnter:()=>p&&l?.(r.name,a),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),p&&c?.(r.name,a)}},a)}),h&&t.createElement("button",{type:"button",className:"seekora-variant-swatch--overflow",onClick:e=>((e,t)=>{t.stopPropagation(),p(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})})(r.name,e),style:{fontSize:"0.6875rem",color:"var(--seekora-primary, #2563eb)",background:"none",border:"none",padding:0,cursor:"pointer",textDecoration:"underline",fontWeight:500}},u?"Show less":`+${f} more`))}))}const Rt={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"};function It({images:e,title:r,imageVariant:a,aspectRatio:o,enableZoom:n,zoomMode:s,zoomLevel:i}){const l=o?o.replace(":","/"):"1";return e.length>0?t.createElement("div",{className:"seekora-product-card__image",style:{position:"relative",overflow:"hidden",borderRadius:4}},t.createElement(Be,{images:e,variant:e.length>1?a:"single",alt:r,className:"seekora-suggestions-product-card-image",style:{aspectRatio:l},enableZoom:n,zoomMode:s,zoomLevel:i})):t.createElement("div",{className:"seekora-product-card__image seekora-suggestions-product-card-placeholder",style:{...Rt,aspectRatio:l},"aria-hidden":!0})}function Nt({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(It,{images:e,title:r,imageVariant:n,aspectRatio:s.imageAspectRatio,enableZoom:i,zoomMode:l,zoomLevel:c}),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500}},r),null!=a&&!Number.isNaN(a)&&t.createElement("span",{className:"seekora-product-card__price seekora-suggestions-product-card-price",style:{fontSize:"0.875rem",color:"var(--seekora-text-secondary, #6b7280)"}},o.currency??"$",a.toFixed(2)))}function Tt({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,options:i,variants:l,product:c,imageVariant:d,displayConfig:u,onVariantHover:m,onVariantClick:p,selectedVariants:g,actionButtons:f,actionButtonsPosition:h,showActionLabels:y,enableImageZoom:b,imageZoomMode:v,imageZoomLevel:x}){const k=u;return t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"}},t.createElement(It,{images:e,title:r,imageVariant:d,aspectRatio:k.imageAspectRatio,enableZoom:b,zoomMode:v,zoomLevel:x}),!1!==k.showBadges&&s.length>0&&t.createElement(vt,{badges:s,position:"top-left",maxBadges:2}),f&&f.length>0&&h?.startsWith("overlay")&&t.createElement(He,{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:4}},!1!==k.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:"0.75rem",color:"var(--seekora-text-secondary, #6b7280)",textTransform:"uppercase",letterSpacing:"0.02em"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500}},r),t.createElement("div",{className:"seekora-product-card__price"},t.createElement(ht,{price:a??void 0,comparePrice:o??void 0,currency:k.currency??c.currency,currencyPosition:k.currencyPosition,priceDecimals:k.priceDecimals,showDiscount:k.showDiscount,style:{fontSize:"0.875rem"}})),!1!==k.showVariants&&i.length>0&&t.createElement(Ct,{options:i,visibleOptions:k.variantOptionsToShow,maxValues:k.maxVariantValues,selectedValues:g,variants:l,onSwatchHover:m,onSwatchClick:p}),f&&f.length>0&&"inline"===h&&t.createElement(He,{buttons:f,position:"inline",showLabels:y,size:"small",layout:"horizontal"})))}function zt({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,priceRange:i,options:l,variants:c,product:d,imageVariant:u,displayConfig:m,onVariantHover:p,onVariantClick:g,selectedVariants:f,actionButtons:h,actionButtonsPosition:y,showActionLabels:b,enableImageZoom:v,imageZoomMode:x,imageZoomLevel:k}){const E=m,S=d.available;return t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"}},t.createElement(It,{images:e,title:r,imageVariant:u,aspectRatio:E.imageAspectRatio,enableZoom:v,zoomMode:x,zoomLevel:k}),!1!==E.showBadges&&s.length>0&&t.createElement(vt,{badges:s,position:"top-left"}),h&&h.length>0&&y?.startsWith("overlay")&&t.createElement(He,{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:"var(--seekora-text-secondary, #6b7280)",textTransform:"uppercase",letterSpacing:"0.02em"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500}},r),!1!==E.showRating&&null!=d.rating&&t.createElement(St,{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(ht,{priceRange:i,currency:E.currency??d.currency,currencyPosition:E.currencyPosition,priceDecimals:E.priceDecimals,style:{fontSize:"0.875rem"}}):t.createElement(ht,{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(Ct,{options:l,visibleOptions:E.variantOptionsToShow,maxValues:E.maxVariantValues,selectedValues:f,variants:c,onSwatchHover:p,onSwatchClick:g}),!1!==E.showStock&&null!=S&&t.createElement("span",{className:"seekora-product-card__stock",style:{fontSize:"0.75rem",color:S?"var(--seekora-success, #22c55e)":"var(--seekora-error, #ef4444)"}},S?"In Stock":"Out of Stock"),h&&h.length>0&&"inline"===y&&t.createElement(He,{buttons:h,position:"inline",showLabels:b,size:"small",layout:"horizontal"})))}function Mt({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(It,{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:"var(--seekora-text-secondary, #6b7280)"}},o.currency??"$",a.toFixed(2)))}function At({images:e,title:r,price:a,comparePrice:o,brand:n,badges:s,options:i,variants:l,product:c,imageVariant:d,displayConfig:u,onVariantHover:m,onVariantClick:p,selectedVariants:g,actionButtons:f,actionButtonsPosition:h,showActionLabels:y,enableImageZoom:b,imageZoomMode:v,imageZoomLevel:x}){const k=u;return t.createElement("div",{style:{display:"flex",gap:12,alignItems:"flex-start"}},t.createElement("div",{style:{position:"relative",width:80,flexShrink:0}},t.createElement(It,{images:e,title:r,imageVariant:d,aspectRatio:"1:1",enableZoom:b,zoomMode:v,zoomLevel:x}),!1!==k.showBadges&&s.length>0&&t.createElement(vt,{badges:s,position:"top-left",maxBadges:1}),f&&f.length>0&&h?.startsWith("overlay")&&t.createElement(He,{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:4,flex:1,minWidth:0}},!1!==k.showBrand&&n&&t.createElement("span",{className:"seekora-product-card__brand",style:{fontSize:"0.75rem",color:"var(--seekora-text-secondary, #6b7280)",textTransform:"uppercase"}},n),t.createElement("span",{className:"seekora-product-card__title",style:{fontSize:"0.875rem",fontWeight:500}},r),t.createElement("div",{className:"seekora-product-card__price"},t.createElement(ht,{price:a??void 0,comparePrice:o??void 0,currency:k.currency??c.currency,currencyPosition:k.currencyPosition,priceDecimals:k.priceDecimals,showDiscount:k.showDiscount,style:{fontSize:"0.875rem"}})),!1!==k.showVariants&&i.length>0&&t.createElement(Ct,{options:i,visibleOptions:k.variantOptionsToShow,maxValues:k.maxVariantValues??3,selectedValues:g,variants:l,onSwatchHover:m,onSwatchClick:p}),f&&f.length>0&&"inline"===h&&t.createElement(He,{buttons:f,position:"inline",showLabels:y,size:"small",layout:"horizontal"})))}const _t={display:"flex",flexDirection:"column",gap:8,padding:8,cursor:"pointer",border:"none",borderRadius:"var(--seekora-border-radius, 6px)",backgroundColor:"transparent",textAlign:"left",transition:"background-color 120ms ease"},Lt={width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:4,backgroundColor:"var(--seekora-bg-secondary, #f3f4f6)"};function Pt({product:e,position:r,section:a,tabId:o,onSelect:n,className:s,style:i,imageVariant:l="single",displayConfig:c,onVariantHover:d,onVariantClick:u,selectedVariants:m,asLink:p,actionButtons:g,actionButtonsPosition:f="overlay-top-right",showActionLabels:h=!1,enableImageZoom:y=!1,imageZoomMode:b="both",imageZoomLevel:v=2.5}){const x=t.useMemo(()=>m&&e.options&&e.variants?ot(e.options,e.variants,m):null,[m,e.options,e.variants]),k=t.useMemo(()=>x?.image?[x.image]:e.images?.length?e.images:e.image??e.imageUrl?[String(e.image??e.imageUrl)]:[],[x,e]),E=t.useMemo(()=>x?.title&&x.title!==e.title?`${e.title??e.name??""} - ${x.title}`:e.title??e.name??"",[x,e]),S=t.useMemo(()=>{const t=x?.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},[x,e.price]),w=t.useMemo(()=>{const t=x?.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},[x,e]),C=k,R=E,N=S;if(!c)return t.createElement("button",{type:"button",className:I("seekora-suggestions-product-card",s),style:{..._t,...i},onMouseDown:e=>{e.preventDefault(),n()},"data-position":r,"data-section":a,"data-tab-id":o},C.length>0?t.createElement(Be,{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:Lt,"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:"var(--seekora-text-secondary, #6b7280)"}},e.currency??"$",N.toFixed(2)));const T=c.style??"minimal",z=w,M=e.brand??null,A=e.options??[],_=e.variants??[],L=t.useMemo(()=>!1===c.showBadges?[]:c.badgeExtractor?c.badgeExtractor(e.tags,e):tt(e.tags,e),[c,e]),P=t.useMemo(()=>c.showPriceRange?rt(e.variants):null,[c.showPriceRange,e.variants]),D={product:e,images:C,title:R,price:N,comparePrice:z,brand:M,badges:L,priceRange:P,options:A,variants:_,displayConfig:c,imageVariant:l,onVariantHover:d,onVariantClick:u,selectedVariants:m,actionButtons:g,actionButtonsPosition:f,showActionLabels:h,enableImageZoom:y,imageZoomMode:b,imageZoomLevel:v},B={minimal:Nt,standard:Tt,detailed:zt,compact:Mt,horizontal:At}[T]??Nt,$=I("seekora-product-card",`seekora-product-card--${T}`,"seekora-suggestions-product-card",s),F={..._t,..."horizontal"===T?{flexDirection:"row"}:{},...i};return p&&e.url?t.createElement("a",{href:e.url,className:$,style:{...F,textDecoration:"none",color:"inherit"},onClick:e=>{e.preventDefault(),n()},"data-position":r,"data-section":a,"data-tab-id":o},t.createElement(B,{...D})):t.createElement("button",{type:"button",className:$,style:F,onMouseDown:e=>{e.preventDefault(),n()},"data-position":r,"data-section":a,"data-tab-id":o},t.createElement(B,{...D}))}function Dt({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:m,getAllNavigableItems:p}=ke(),g=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),f=p().findIndex(e=>"product"===e.type);if(0===g.length)return null;const h={display:"grid",gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`,gap:12,padding:12};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:h},g.map((e,a)=>{const o=f>=0?f+a:a,n="trending"===r?"products":"filtered_tab",s="trending"!==r?"tab"===r?u:r:void 0;return t.createElement(Pt,{key:e.id??e.objectID??a,product:e,position:o,section:n,tabId:s,onSelect:()=>m(e,o,n,s),displayConfig:i,onVariantHover:l})})))}function Bt({className:e,style:r,tabClassName:a}){const{filteredTabs:o,activeTabId:n,setActiveTab:s}=ke();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)":"var(--seekora-text-primary, #111827)",cursor:"pointer",fontSize:"0.875rem",fontWeight:r?600:400,whiteSpace:"nowrap",transition:"background-color 120ms ease"},onClick:()=>s(e)},e.label)}))}const $t={padding:"10px 12px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"var(--seekora-text-primary, #111827)",transition:"background-color 120ms ease"};function Ft({title:e="Recent",maxItems:r=8,className:a,style:o,listClassName:n,renderItem:s}){const{recentSearches:i,query:l,selectRecentSearch:c}=ke(),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:"var(--seekora-text-secondary, #6b7280)",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("li",{key:`${e.query}-${e.timestamp}`},t.createElement("button",{type:"button",className:"seekora-suggestions-recent-item",style:$t,onMouseDown:e=>{e.preventDefault(),a()}},e.query))})))}const Wt={padding:"10px 12px",cursor:"pointer",border:"none",width:"100%",textAlign:"left",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",color:"var(--seekora-text-primary, #111827)",transition:"background-color 120ms ease"};function qt({title:e="Trending",maxItems:r=8,className:a,style:o,listClassName:n,renderItem:s}){const{trendingSearches:i,selectTrendingSearch:l}=ke(),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:"var(--seekora-text-secondary, #6b7280)",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("li",{key:`${e.query}-${r}`},t.createElement("button",{type:"button",className:"seekora-suggestions-trending-item",style:Wt,onMouseDown:e=>{e.preventDefault(),a()}},e.query,null!=e.count?t.createElement("span",{style:{marginLeft:8,color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875em"}},e.count):null))})))}function Ht({className:e,style:r,render:a}){const{error:o}=ke();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 Ot={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"},jt=(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 Vt({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, #111827)"}},c.name,u&&t.createElement("span",{style:{fontWeight:400,marginLeft:6,color:"var(--seekora-text-secondary, #6b7280)"}},u)),"dropdown"===d?t.createElement("select",{className:"seekora-variant-dropdown",value:u??"",onChange:e=>{e.stopPropagation(),o(c.name,e.target.value)},onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),style:{padding:"8px 12px",fontSize:"0.875rem",borderRadius:6,border:"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:"var(--seekora-bg-surface, #fff)",color:"var(--seekora-text-primary, #111827)",cursor:"pointer",minWidth:120}},t.createElement("option",{value:""},"Select ",c.name),c.values.map(o=>{const n=!l||jt(c.name,o,e,r,a);return t.createElement("option",{key:o,value:o,disabled:!n},o,n?"":" (Unavailable)")})):t.createElement("div",{className:"seekora-variant-buttons",style:{display:"flex",flexWrap:"wrap",gap:8}},c.values.map(n=>{const s=u===n,m=!l||jt(c.name,n,e,r,a),p="swatch"===d?((e,t)=>{if(t?.[e])return t[e];const r=e.toLowerCase();return t?.[r]?t[r]:Ot[r]??null})(n,i):null;return"swatch"===d&&p?t.createElement("button",{key:n,type:"button",className:I("seekora-variant-color-swatch",s&&"seekora-variant-button--active",!m&&"seekora-variant-button--unavailable"),title:n,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),o(c.name,n)},disabled:!m,style:{width:32,height:32,borderRadius:"50%",backgroundColor:p,border:s?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",outline:s?"2px solid var(--seekora-primary, #111827)":"none",outlineOffset:2,cursor:m?"pointer":"not-allowed",opacity:m?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",!m&&"seekora-variant-button--unavailable"),onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),o(c.name,n)},disabled:!m,style:{padding:"6px 16px",fontSize:"0.875rem",borderRadius:6,border:s?"2px solid var(--seekora-primary, #111827)":"1px solid var(--seekora-border-color, #e5e7eb)",backgroundColor:s?"var(--seekora-primary, #111827)":"var(--seekora-bg-surface, #fff)",color:s?"#fff":"var(--seekora-text-primary, #111827)",cursor:m?"pointer":"not-allowed",opacity:m?1:.5,textDecoration:m?"none":"line-through",fontWeight:s?600:400,transition:"all 120ms ease"},"aria-label":`${c.name}: ${n}`,"aria-pressed":s},n)})))}))}const Ut=t.createContext(null);const Qt=t.createContext(null);function Gt(){const e=t.useContext(Qt);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 Xt({className:e,style:r,text:a="Loading..."}){const{loading:o}=Gt();return o?t.createElement("div",{className:e,style:{padding:16,color:"var(--seekora-text-secondary)",fontSize:"0.875rem",...r}},a):null}function Yt({className:e,style:r,render:a}){const{error:o}=Gt();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 Kt={xs:0,sm:480,md:768,lg:1024,xl:1280},Zt={xs:`@media (max-width: ${Kt.sm-1}px)`,sm:`@media (min-width: ${Kt.sm}px) and (max-width: ${Kt.md-1}px)`,md:`@media (min-width: ${Kt.md}px) and (max-width: ${Kt.lg-1}px)`,lg:`@media (min-width: ${Kt.lg}px) and (max-width: ${Kt.xl-1}px)`,xl:`@media (min-width: ${Kt.xl}px)`,mobile:`@media (max-width: ${Kt.md-1}px)`,tablet:`@media (min-width: ${Kt.md}px) and (max-width: ${Kt.lg-1}px)`,desktop:`@media (min-width: ${Kt.lg}px)`,touch:"@media (hover: none) and (pointer: coarse)",mouse:"@media (hover: hover) and (pointer: fine)"},Jt={minimum:44,comfortable:48,large:56},er=()=>{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<Kt.sm?"xs":e<Kt.md?"sm":e<Kt.lg?"md":e<Kt.xl?"lg":"xl")(e),o="ontouchstart"in window||navigator.maxTouchPoints>0;r({isMobile:e<Kt.md,isTablet:e>=Kt.md&&e<Kt.lg,isDesktop:e>=Kt.lg,isTouch:o,width:e,height:t,breakpoint:a})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e};let tr=!1;const rr=()=>{if(tr)return;if("undefined"==typeof document)return;const e="seekora-dropdown-responsive-global";if(document.getElementById(e))return void(tr=!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),tr=!0},ar=()=>{t.useEffect(()=>{rr()},[])},or=(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?`${Jt.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)"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"40px",color:"var(--seekora-text-secondary, #565959)",gap:"10px"},spinner:{width:"20px",height:"20px",border:"2px solid var(--seekora-border-color, #ddd)",borderTopColor:"var(--seekora-primary, #f90)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},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"}}),nr=()=>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"})),sr=()=>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"})),ir=()=>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"})),lr=({rating:e,count:r})=>{const a=Math.floor(e),o=e%1>=.5;return t.createElement("div",{style:or().productRating},t.createElement("div",{style:or().stars},"★".repeat(a),o&&"½","☆".repeat(5-a-(o?1:0))),void 0!==r&&t.createElement("span",{style:or().reviewCount},"(",r.toLocaleString(),")"))},cr=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:m="all",suggestionFields:p={query:"query"},productFields:g={id:"id",title:"title"},categoryFields:f={id:"id",label:"label"},productDisplay:h={},theme:y={},showDepartments:b=!0,currentDepartment:v,departments:x=[],showPrime:k=!1,width:E="700px",maxHeight:S="500px",zIndex:w=1e3,className:C,style:R,classNames:I={},onSuggestionSelect:N,onProductClick:T,onCategoryClick:z,onTabChange:M,onRecentClick:A,onRecentRemove:_,onRecentClearAll:L,onViewAll:P,onClose:D,header:B,footer:$,showLoadingState:F=!1,renderLoading:W,renderEmpty:q}=e;ar();const H=er(),{isMobile:O,isTablet:j}=H,V=t.useMemo(()=>or(y,O),[y,O]),U=t.useRef(null),[Q,G]=t.useState(-1),[X,Y]=t.useState(null),K=t.useMemo(()=>s.map(e=>Xe(e,p)),[s,p]),Z=t.useMemo(()=>{if("all"===m||0===u.length)return i;const e=u.find(e=>e.id===m);return e?.products||i},[m,u,i]),J=t.useMemo(()=>Z.map(e=>Ye(e,g)),[Z,g]);t.useMemo(()=>l.map(e=>Ke(e,f)),[l,f]);const ee=t.useMemo(()=>c.map(e=>"string"==typeof e?e:e.query),[c]),te=t.useMemo(()=>{const e=[];let t=0;return 0===a.length&&ee.slice(0,5).forEach(r=>{e.push({type:"recent",data:r,index:t++})}),K.forEach(r=>{e.push({type:"suggestion",data:r,index:t++})}),e},[a,ee,K]),re=t.useCallback(()=>{G(e=>Math.min(e+1,te.length-1))},[te.length]),ae=t.useCallback(()=>{G(e=>Math.max(e-1,-1))},[]),oe=t.useCallback(()=>{if(Q<0||Q>=te.length)return;const e=te[Q];"recent"===e.type?A?.(e.data):"suggestion"===e.type&&N?.(e.data._raw,e.index)},[Q,te,A,N]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>Q,setActiveIndex:G,selectActive:oe,navigateNext:re,navigatePrevious:ae,focus:()=>U.current?.focus(),close:()=>D?.()}),[Q,oe,re,ae,D]),t.useEffect(()=>{if(Q>=0&&U.current){const e=U.current.querySelector(`[data-index="${Q}"]`);e&&mt(e,U.current)}},[Q]),!o)return null;const ne=nt(y),se=0===a.length&&ee.length>0,ie=0===a.length&&d.length>0,le=J.length>0;return t.createElement("div",{ref:U,role:"listbox","aria-label":"Search suggestions",className:st("seekora-amazon-dropdown",C,I.root),style:it(V.root,{width:O?"100%":E,maxHeight:O?"100vh":S,zIndex:w},ne,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 "),B,n&&F?W?W():t.createElement("div",{style:V.loading},t.createElement("div",{style:V.spinner}),t.createElement("span",null,"Searching...")):t.createElement(t.Fragment,null,u.length>0&&t.createElement("div",{style:{display:"flex",gap:"8px",padding:O?"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"===m?"var(--seekora-text-primary, #232f3e)":"var(--seekora-bg-surface, #ffffff)",color:"all"===m?"var(--seekora-bg-surface, #ffffff)":"var(--seekora-text-primary, #0f1111)",borderRadius:"20px",fontSize:"13px",fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",minHeight:"36px",boxShadow:"all"===m?"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:m===e.id?"var(--seekora-primary, #ff9900)":"var(--seekora-bg-surface, #ffffff)",color:m===e.id?"var(--seekora-text-on-primary, #0f1111)":"var(--seekora-text-primary, #0f1111)",borderRadius:"20px",fontSize:"13px",fontWeight:m===e.id?700:500,cursor:"pointer",whiteSpace:"nowrap",minHeight:"36px",boxShadow:m===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:V.content},t.createElement("div",{style:V.leftColumn},se&&t.createElement("div",{style:V.section},t.createElement("div",{style:V.recentHeader},t.createElement("span",{style:V.sectionHeader},"Recent Searches"),t.createElement("button",{style:V.clearRecent,onClick:L},"Clear all")),ee.slice(0,5).map((e,r)=>{const a=Q===r;return t.createElement("div",{key:`recent-${e}`,"data-index":r,role:"option","aria-selected":a,style:it(V.suggestionItem,a?V.suggestionItemActive:void 0),onClick:()=>A?.(e),onMouseEnter:()=>G(r)},t.createElement(sr,null),t.createElement("div",{style:V.suggestionContent},t.createElement("div",{style:V.suggestionQuery},e)))})),ie&&t.createElement("div",{style:V.section},t.createElement("div",{style:V.sectionHeader},"Trending Searches"),d.slice(0,5).map((e,r)=>{const a="string"==typeof e?e:e.query,o=ee.length+r,n=Q===o;return t.createElement("div",{key:`trending-${a}`,"data-index":o,role:"option","aria-selected":n,style:it(V.suggestionItem,n?V.suggestionItemActive:void 0),onClick:()=>N?.({query:a},r),onMouseEnter:()=>G(o)},t.createElement(ir,null),t.createElement("div",{style:V.suggestionContent},t.createElement("div",{style:V.suggestionQuery},a)))})),K.length>0&&t.createElement("div",{style:V.section},a&&t.createElement("div",{style:V.sectionHeader},"Suggestions"),K.map((e,r)=>{const o=se?ee.length+r:r,n=Q===o,s=(e.categories||[])[0];return t.createElement("div",{key:e.id||`suggestion-${r}`,"data-index":o,role:"option","aria-selected":n,style:it(V.suggestionItem,n?V.suggestionItemActive:void 0),onClick:()=>N?.(e._raw,r),onMouseEnter:()=>G(o)},t.createElement("div",{style:V.suggestionIcon},t.createElement(nr,null)),t.createElement("div",{style:V.suggestionContent},t.createElement("div",{style:V.suggestionQuery,dangerouslySetInnerHTML:{__html:et(e.query,a,{className:"highlight"})}}),b&&s&&t.createElement("div",{style:V.suggestionContext},t.createElement("span",{style:V.suggestionDepartment},"in ","string"==typeof s?s:s.value||s.label))),e.count&&t.createElement("span",{style:V.categoryScoped},e.count.toLocaleString()))})),a&&0===K.length&&!n&&(q?q(a):t.createElement("div",{style:V.empty},'No suggestions found for "',a,'"'))),le&&t.createElement("div",{style:V.rightColumn},t.createElement("div",{style:V.productsHeader},t.createElement("span",{style:V.productsTitle},"Suggested Products"),t.createElement("a",{style:V.viewAll,onClick:()=>P?.("products")},"View all")),t.createElement("div",{style:V.productsGrid},J.slice(0,4).map((e,r)=>t.createElement("div",{key:e.id,style:it(V.productCard,X===e.id?V.productCardHover:void 0),onClick:()=>T?.(e._raw,r),onMouseEnter:()=>Y(e.id),onMouseLeave:()=>Y(null)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:V.productImage,loading:"lazy"}):t.createElement("div",{style:{...V.productImage,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement("span",{style:{color:"var(--seekora-text-tertiary, #999)",fontSize:"32px"}},"📷")),t.createElement("div",{style:V.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:V.productPrice},t.createElement("span",{style:V.productPriceSymbol},h.currency||"$"),Ze(e.price,{currency:"",priceDecimals:h.priceDecimals})),e.rating&&t.createElement(lr,{rating:parseFloat(String(e.rating)),count:e.reviewCount?parseInt(String(e.reviewCount)):void 0}))))))),void 0!==$?$:t.createElement("div",{style:V.footer},t.createElement("div",{style:V.keyboard},t.createElement("span",{style:V.key},"↑"),t.createElement("span",{style:V.key},"↓"),t.createElement("span",null,"to navigate"),t.createElement("span",{style:V.key},"↵"),t.createElement("span",null,"to select"),t.createElement("span",{style:V.key},"esc"),t.createElement("span",null,"to close")),K.length>0&&t.createElement("span",null,K.length," suggestions")))}),dr=()=>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"})),ur=()=>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"})),mr=()=>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"})),pr=()=>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)"})),gr=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:m="I'm Feeling Lucky",showRemoveRecent:p=!0,showVoiceSearch:g=!1,showTrendingIndicator:f=!0,width:h="100%",maxHeight:y="400px",zIndex:b=1e3,className:v,style:x,classNames:k={},onSuggestionSelect:E,onRecentClick:S,onRecentRemove:w,onVoiceSearch:C,onFeelingLucky:R,onClose:I,onSearchSubmit:N,header:T,footer:z,showLoadingState:M=!1,renderLoading:A,renderEmpty:_}=e;ar();const L=er(),{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:"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)"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",color:"var(--seekora-text-secondary, #5f6368)",gap:"12px"},spinner:{width:"24px",height:"24px",border:"3px solid var(--seekora-border-color, #e8eaed)",borderTopColor:"var(--seekora-primary, #4285f4)",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite"},empty:{padding:"24px",textAlign:"center",color:"var(--seekora-text-secondary, #5f6368)",fontSize:"14px"}}))(P),[P]),B=t.useRef(null),[$,F]=t.useState(-1),[W,q]=t.useState(-1),[H,O]=t.useState(null),j=t.useMemo(()=>s.map(e=>Xe(e,c)),[s,c]),V=t.useMemo(()=>i.map(e=>"string"==typeof e?e:e.query).slice(0,5),[i]),U=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,5),[l]),Q=t.useMemo(()=>{const e=[];return 0===a.length?(V.forEach(t=>e.push({type:"recent",query:t})),U.forEach(t=>e.push({type:"trending",query:t}))):j.forEach(t=>e.push({type:"suggestion",query:t.query,data:t})),e},[a,V,U,j]),G=t.useCallback(()=>{F(e=>Math.min(e+1,Q.length-1))},[Q.length]),X=t.useCallback(()=>{F(e=>Math.max(e-1,-1))},[]),Y=t.useCallback(()=>{if($<0)return void(a&&N?.(a));const e=Q[$];"recent"===e.type||"trending"===e.type?S?.(e.query):E?.(e.data?._raw||{query:e.query},$)},[$,Q,a,N,S,E]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>$,setActiveIndex:F,selectActive:Y,navigateNext:G,navigatePrevious:X,focus:()=>B.current?.focus(),close:()=>I?.()}),[$,Y,G,X,I]),t.useEffect(()=>{F(-1)},[a]),t.useEffect(()=>{if($>=0&&B.current){const e=B.current.querySelector(`[data-index="${$}"]`);e&&mt(e,B.current)}},[$]),!o)return null;const K=nt(d),Z=0===a.length&&V.length>0,J=0===a.length&&U.length>0,ee=(e,r,o)=>{const n=$===o,s=W===o,i=n||s;return t.createElement("li",{key:`${e.type}-${e.query}-${r}`,"data-index":o,role:"option","aria-selected":n,style:it(D.item,n||s?D.itemActive:void 0),onClick:()=>{"recent"===e.type||"trending"===e.type?S?.(e.query):E?.(e.data?._raw||{query:e.query},r)},onMouseEnter:()=>{q(o),F(o)},onMouseLeave:()=>q(-1)},t.createElement("div",{style:D.itemIcon},"recent"===e.type?t.createElement(ur,null):"trending"===e.type?t.createElement(mr,null):t.createElement(dr,null)),t.createElement("div",{style:D.itemContent},t.createElement("span",{style:D.itemText,dangerouslySetInnerHTML:{__html:a?et(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:D.trending},t.createElement(mr,null),"Trending"),"recent"===e.type&&p&&t.createElement("button",{style:it(D.removeBtn,i?D.removeBtnVisible:void 0),onClick:t=>{t.stopPropagation(),w?.(e.query)},"aria-label":`Remove ${e.query}`},"Remove"),t.createElement("span",{style:it(D.itemAction,i?D.itemActionVisible:void 0)},t.createElement(pr,null)))))};let te=0;return t.createElement("div",{ref:B,role:"listbox","aria-label":"Search suggestions",className:st("seekora-google-dropdown",v,k.root),style:it(D.root,{width:h,maxHeight:"none",zIndex:b},K,x),tabIndex:-1},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),T,n&&M?A?A():t.createElement("div",{style:D.loading},t.createElement("div",{style:D.spinner})):t.createElement(t.Fragment,null,t.createElement("ul",{style:D.list},Z&&t.createElement(t.Fragment,null,V.map((e,t)=>{const r=ee({type:"recent",query:e},t,te);return te++,r}),J&&t.createElement("div",{style:D.divider})),J&&t.createElement(t.Fragment,null,!Z&&t.createElement("div",{style:D.sectionTitle},"Trending searches"),U.map((e,t)=>{const r=ee({type:"trending",query:e},t,te);return te++,r})),a&&j.length>0&&j.map((e,t)=>{const r={type:"suggestion",query:e.query,data:e},a=ee(r,t,te);return te++,a}),a&&0===j.length&&!n&&(_?_(a):t.createElement("li",{style:D.empty},'No suggestions for "',a,'"'))),(u||g)&&t.createElement("div",{style:D.footer},u&&t.createElement(t.Fragment,null,t.createElement("button",{style:it(D.footerButton,"search"===H?D.footerButtonHover:void 0),onMouseEnter:()=>O("search"),onMouseLeave:()=>O(null),onClick:()=>N?.(a||($>=0?Q[$]?.query:""))},"Search"),t.createElement("button",{style:it(D.footerButton,"lucky"===H?D.footerButtonHover:void 0),onMouseEnter:()=>O("lucky"),onMouseLeave:()=>O(null),onClick:()=>R?.(a||($>=0?Q[$]?.query:""))},m)))),z)}),fr=()=>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"})),hr=()=>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"})),yr=()=>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"})),br=()=>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"})),vr=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:m={},theme:p={},showSaveButton:g=!0,activeCategory:f,activeTab:h,showPriceOverlay:y=!0,gridColumns:b=4,width:v="800px",maxHeight:x="600px",zIndex:k=1e3,className:E,style:S,classNames:w={},onSuggestionSelect:C,onProductClick:R,onCategoryClick:I,onTabChange:N,onSaveProduct:T,onViewAll:z,onClose:M,header:A,footer:_,showLoadingState:L=!1,renderLoading:P,renderEmpty:D}=e;ar();const B=er(),{isMobile:$}=B,F=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)"}}),[]),W=t.useRef(null),[q,H]=t.useState(-1),[O,j]=t.useState(null),[V,U]=t.useState(null),[Q,G]=t.useState(-1),[X,Y]=t.useState(f||null),[K,Z]=t.useState(!1);t.useEffect(()=>{const e=h??f;void 0!==e&&Y("all"===e?null:e)},[h,f]);const J=t.useMemo(()=>s.map(e=>Xe(e,c)),[s,c]),ee=t.useMemo(()=>i.map(e=>Ye(e,d)),[i,d]),te=t.useMemo(()=>l.map(e=>Ke(e,u)),[l,u]),re=t.useCallback(()=>{H(e=>Math.min(e+1,J.length-1))},[J.length]),ae=t.useCallback(()=>{H(e=>Math.max(e-1,-1))},[]),oe=t.useCallback(()=>{q>=0&&J[q]&&C?.(J[q]._raw,q)},[q,J,C]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>q,setActiveIndex:H,selectActive:oe,navigateNext:re,navigatePrevious:ae,focus:()=>W.current?.focus(),close:()=>M?.()}),[q,oe,re,ae,M]),t.useEffect(()=>{if(q>=0&&W.current){const e=W.current.querySelector(`[data-index="${q}"]`);e&&mt(e,W.current)}},[q]),!o)return null;const ne=nt(p),se=te.length>0,ie=ee;return t.createElement("div",{ref:W,role:"listbox","aria-label":"Search suggestions",className:st("seekora-pinterest-dropdown",E,w.root),style:it(F.root,{width:v,zIndex:k},ne,S),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:F.header},t.createElement("div",{style:F.searchInfo},t.createElement("span",{style:F.searchQuery},a?`"${a}"`:"Explore"),ee.length>0&&t.createElement("span",{style:F.searchCount},ee.length,"+ ideas")),se&&t.createElement("div",{style:F.categoriesScroll,className:"categories-scroll"},t.createElement("button",{style:it(F.categoryChip,X?void 0:F.categoryChipActive,"all"===V&&X?F.categoryChipHover:void 0),onClick:()=>{Y(null),N?.("all")},onMouseEnter:()=>U("all"),onMouseLeave:()=>U(null)},"All"),te.map(e=>t.createElement("button",{key:e.id,style:it(F.categoryChip,X===e.id?F.categoryChipActive:void 0,V===e.id&&X!==e.id?F.categoryChipHover:void 0),onClick:()=>{Y(e.id),N?.(e.id)},onMouseEnter:()=>U(e.id),onMouseLeave:()=>U(null)},e.icon&&t.createElement("img",{src:e.icon,alt:"",style:F.categoryIcon}),e.label,e.count&&t.createElement("span",null,"(",e.count,")"))))),t.createElement("div",{style:{...F.content,maxHeight:x}},n&&L?P?P():t.createElement("div",{style:F.loading},t.createElement("div",{style:F.spinner})):t.createElement(t.Fragment,null,J.length>0&&t.createElement("div",{style:F.suggestionsRow},J.slice(0,8).map((e,r)=>t.createElement("button",{key:e.id||r,"data-index":r,style:it(F.suggestionPill,q===r?F.suggestionPillActive:void 0,Q===r&&q!==r?F.suggestionPillHover:void 0),onClick:()=>C?.(e._raw,r),onMouseEnter:()=>{G(r),H(r)},onMouseLeave:()=>G(-1)},t.createElement("span",{style:F.suggestionIcon,dangerouslySetInnerHTML:{__html:a?et(e.query,a,{tag:"strong"}):e.query}})))),ie.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:F.sectionTitle},t.createElement(yr,null),"Ideas for you"),t.createElement("div",{style:{...F.productsGrid,gridTemplateColumns:`repeat(${b}, 1fr)`}},ie.slice(0,12).map((e,r)=>t.createElement("div",{key:e.id,style:it(F.productCard,O===e.id?F.productCardHover:void 0),onClick:()=>R?.(e._raw,r),onMouseEnter:()=>j(e.id),onMouseLeave:()=>j(null)},t.createElement("div",{style:F.productImageContainer},e.image?t.createElement("img",{src:e.image,alt:e.title,style:F.productImage,loading:"lazy"}):t.createElement("div",{style:F.productImagePlaceholder},t.createElement(br,null)),g&&t.createElement("button",{style:it(F.productSaveBtn,O===e.id?F.productSaveBtnVisible:void 0),onClick:t=>{t.stopPropagation(),T?.(e._raw)},"aria-label":"Save"},t.createElement(hr,null)),y&&void 0!==e.price&&t.createElement("div",{style:it(F.productOverlay,O===e.id?F.productOverlayVisible:void 0)},t.createElement("div",{style:F.productTitleOverlay},e.title),t.createElement("div",{style:F.productPriceOverlay},Ze(e.price,{currency:m.currency||e.currency||"$"})))),!y&&t.createElement("div",{style:F.productInfo},t.createElement("div",{style:F.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:F.productPrice},Ze(e.price,{currency:m.currency||e.currency||"$"}))))))),!n&&0===ie.length&&0===J.length&&(D?D(a):t.createElement("div",{style:F.empty},t.createElement("div",{style:F.emptyIcon},t.createElement(fr,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!==_?_:ie.length>0&&t.createElement("div",{style:F.footer},t.createElement("span",{style:{color:"var(--seekora-text-secondary, #767676)",fontSize:"14px"}},ie.length,"+ more ideas"),t.createElement("button",{style:it(F.viewAllBtn,K?F.viewAllBtnHover:void 0),onClick:()=>z?.("products"),onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1)},"Explore all")))}),xr=()=>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"})),kr=()=>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"})),Er=()=>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"})),Sr=()=>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"})),wr=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:m={},showPreview:p=!0,asOverlay:g=!0,placeholder:f="Search...",showShortcuts:h=!0,actions:y=[],width:b="680px",maxHeight:v="500px",zIndex:x=9999,className:k,style:E,classNames:S={},inputRef:w,onSuggestionSelect:C,onProductClick:R,onRecentClick:I,onClose:N,onSearchSubmit:T,header:z,footer:M,showLoadingState:A=!1,renderLoading:_,renderEmpty:L}=e;ar();const P=er(),{isMobile:D}=P,B=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)"}}),[]),$=t.useRef(null),F=t.useRef(null),[W,q]=t.useState(-1),H=t.useMemo(()=>s.map(e=>Xe(e,c)),[s,c]),O=t.useMemo(()=>i.map(e=>Ye(e,d)),[i,d]),j=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,3),[l]),V=t.useMemo(()=>{const e=[];return y.forEach(t=>{e.push({type:"action",id:t.id,title:t.label,icon:t.icon,data:t})}),!a&&j.length>0&&j.forEach((r,a)=>{e.push({type:"recent",id:`recent-${a}`,title:r,icon:t.createElement(Sr,null),data:r})}),H.forEach((r,a)=>{e.push({type:"suggestion",id:r.id||`suggestion-${a}`,title:r.query,icon:t.createElement(kr,null),data:r})}),O.forEach((r,a)=>{e.push({type:"product",id:r.id,title:r.title,subtitle:r.brand,icon:t.createElement(Er,null),image:r.image,price:r.price,data:r})}),e},[y,a,j,H,O]),U=t.useCallback(()=>{q(e=>Math.min(e+1,V.length-1))},[V.length]),Q=t.useCallback(()=>{q(e=>Math.max(e-1,-1))},[]),G=t.useCallback(()=>{if(W<0)return void(a.trim()&&T?.(a.trim()));const e=V[W];if(e)switch(e.type){case"action":e.data.onAction?.();break;case"recent":I?.(e.data);break;case"suggestion":C?.(e.data._raw,W);break;case"product":R?.(e.data._raw,W)}},[W,V,a,T,I,C,R]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>W,setActiveIndex:q,selectActive:G,navigateNext:U,navigatePrevious:Q,focus:()=>w?.current?.focus(),close:()=>N?.()}),[W,G,U,Q,w,N]),t.useEffect(()=>{if(F.current&&W>=0){const e=F.current.querySelector(`[data-index="${W}"]`);e&&mt(e,F.current)}},[W]),t.useEffect(()=>{q(-1)},[a]),!o)return null;const X=nt(m),Y=V[W],K=t.createElement("div",{ref:$,className:st("seekora-spotlight-dropdown",k,S.root),style:it(B.root,{width:b,zIndex:g?void 0:x},X,E)},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),t.createElement("div",{style:B.searchContainer},t.createElement("div",{style:B.searchIcon},t.createElement(xr,null)),t.createElement("input",{ref:w,type:"text",placeholder:f,defaultValue:a,style:B.searchInput,onChange:e=>T?.(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),U()):"ArrowUp"===e.key?(e.preventDefault(),Q()):"Enter"===e.key?(e.preventDefault(),G()):"Escape"===e.key&&N?.()},autoFocus:!0}),h&&t.createElement("div",{style:B.shortcut},t.createElement("span",{style:B.kbd},"⌘"),t.createElement("span",{style:B.kbd},"K"))),z,t.createElement("div",{style:B.content},t.createElement("div",{ref:F,style:{...B.resultsColumn,maxHeight:v}},n&&0===V.length&&A?_?_():t.createElement("div",{style:B.loading},t.createElement("div",{style:B.spinner})):0===V.length?L?L(a):t.createElement("div",{style:B.empty},'No results for "',a,'"'):t.createElement(t.Fragment,null,y.length>0&&t.createElement("div",{style:B.section},t.createElement("div",{style:B.sectionTitle},"Actions"),V.filter(e=>"action"===e.type).map(e=>{const r=V.indexOf(e),a=W===r;return t.createElement("div",{key:e.id,"data-index":r,style:it(B.item,a?B.itemActive:void 0),onClick:()=>{q(r),G()},onMouseEnter:()=>q(r)},t.createElement("div",{style:it(B.itemIcon,a?B.itemIconActive:void 0)},e.icon),t.createElement("div",{style:B.itemContent},t.createElement("div",{style:it(B.itemTitle,a?B.itemTitleActive:void 0)},e.title)))})),j.length>0&&!a&&t.createElement("div",{style:B.section},t.createElement("div",{style:B.sectionTitle},"Recent"),V.filter(e=>"recent"===e.type).map(e=>{const r=V.indexOf(e),a=W===r;return t.createElement("div",{key:e.id,"data-index":r,style:it(B.item,a?B.itemActive:void 0),onClick:()=>{q(r),I?.(e.data)},onMouseEnter:()=>q(r)},t.createElement("div",{style:it(B.itemIcon,a?B.itemIconActive:void 0)},e.icon),t.createElement("div",{style:B.itemContent},t.createElement("div",{style:it(B.itemTitle,a?B.itemTitleActive:void 0)},e.title)))})),H.length>0&&t.createElement("div",{style:B.section},t.createElement("div",{style:B.sectionTitle},"Suggestions"),V.filter(e=>"suggestion"===e.type).map(e=>{const r=V.indexOf(e),o=W===r;return t.createElement("div",{key:e.id,"data-index":r,style:it(B.item,o?B.itemActive:void 0),onClick:()=>{q(r),C?.(e.data._raw,r)},onMouseEnter:()=>q(r)},t.createElement("div",{style:it(B.itemIcon,o?B.itemIconActive:void 0)},e.icon),t.createElement("div",{style:B.itemContent},t.createElement("div",{style:it(B.itemTitle,o?B.itemTitleActive:void 0),dangerouslySetInnerHTML:{__html:et(e.title,a,{tag:"strong"})}})))})),O.length>0&&t.createElement("div",{style:B.section},t.createElement("div",{style:B.sectionTitle},"Products"),V.filter(e=>"product"===e.type).map(e=>{const r=V.indexOf(e),a=W===r;return t.createElement("div",{key:e.id,"data-index":r,style:it(B.item,a?B.itemActive:void 0),onClick:()=>{q(r),R?.(e.data._raw,r)},onMouseEnter:()=>q(r)},t.createElement("div",{style:it(B.itemIcon,a?B.itemIconActive:void 0)},e.image?t.createElement("img",{src:e.image,alt:"",style:B.itemIconImage}):e.icon),t.createElement("div",{style:B.itemContent},t.createElement("div",{style:it(B.itemTitle,a?B.itemTitleActive:void 0)},e.title),e.subtitle&&t.createElement("div",{style:it(B.itemSubtitle,a?B.itemSubtitleActive:void 0)},e.subtitle)),void 0!==e.price&&t.createElement("span",{style:it(B.itemAction,B.itemActionVisible,a?B.itemActionActive:void 0)},Ze(e.price,{currency:u.currency})))})))),p&&Y&&"product"===Y.type&&t.createElement("div",{style:B.previewColumn},t.createElement("div",{style:B.previewContent},Y.image&&t.createElement("img",{src:Y.image,alt:"",style:B.previewImage}),t.createElement("div",{style:B.previewTitle},Y.title),Y.subtitle&&t.createElement("div",{style:B.previewSubtitle},Y.subtitle),void 0!==Y.price&&t.createElement("div",{style:B.previewPrice},Ze(Y.price,{currency:u.currency})),t.createElement("div",{style:B.previewActions},t.createElement("button",{style:{...B.previewAction,...B.previewActionPrimary},onClick:()=>R?.(Y.data._raw,W)},"View Product"))))),void 0!==M?M:t.createElement("div",{style:B.footer},t.createElement("div",{style:B.footerActions},t.createElement("span",{style:B.footerAction},t.createElement("span",{style:B.kbd},"↑"),t.createElement("span",{style:B.kbd},"↓"),"navigate"),t.createElement("span",{style:B.footerAction},t.createElement("span",{style:B.kbd},"↵"),"select"),t.createElement("span",{style:B.footerAction},t.createElement("span",{style:B.kbd},"esc"),"close")),t.createElement("span",null,V.length," results")));return g?t.createElement("div",{style:{...B.overlay,zIndex:x},onClick:e=>{e.target===e.currentTarget&&N?.()}},K):K}),Cr=()=>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"})),Rr=()=>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"})),Ir=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:m={},theme:p={},showHeroProduct:g=!0,showCollections:f=!0,showAddToCart:h=!0,addToCartText:y="Quick Add",showComparePrice:b=!0,width:v="100%",maxHeight:x="500px",zIndex:k=1e3,className:E,style:S,classNames:w={},onSuggestionSelect:C,onProductClick:R,onCategoryClick:I,onTabChange:N,onAddToCart:T,onViewAll:z,onClose:M,header:A,footer:_,showLoadingState:L=!1,renderLoading:P,renderEmpty:D}=e;ar();const B=er(),{isMobile:$}=B,F=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, #ffffff)",color:"var(--seekora-text-primary, #121212)",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, #ffffff)",borderRight:e?"none":"1px solid var(--seekora-border-color, #e8e8e1)",borderBottom:e?"1px solid var(--seekora-border-color, #e8e8e1)":"none",display:"flex",flexDirection:"column"},rightPanel:{backgroundColor:"var(--seekora-bg-secondary, #fafafa)",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, #e8e8e1)"},sectionTitle:{fontSize:"11px",fontWeight:600,color:"var(--seekora-text-secondary, #666)",textTransform:"uppercase",letterSpacing:"0.1em"},viewAllLink:{fontSize:"12px",color:"var(--seekora-text-primary, #121212)",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, #121212)"},suggestionItemActive:{backgroundColor:"var(--seekora-bg-hover, #f5f5f5)",color:"var(--seekora-text-primary, #121212)"},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, #121212)",fontWeight:400},suggestionMeta:{fontSize:"12px",color:"var(--seekora-text-secondary, #666)",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, #e8e8e1)",borderTop:"1px solid var(--seekora-border-color, #e8e8e1)"},collectionItem:{backgroundColor:"var(--seekora-bg-surface, #ffffff)",color:"var(--seekora-text-primary, #121212)",padding:"16px 20px",cursor:"pointer",transition:"background-color 150ms"},collectionItemHover:{backgroundColor:"var(--seekora-bg-hover, #f0f0f0)",color:"var(--seekora-text-primary, #121212)"},collectionName:{fontSize:"13px",fontWeight:500,color:"var(--seekora-text-primary, #121212)",marginBottom:"4px"},collectionCount:{fontSize:"11px",color:"var(--seekora-text-secondary, #666)"},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, #121212)",marginBottom:"8px",lineHeight:1.3},heroBrand:{fontSize:"12px",color:"var(--seekora-text-secondary, #666)",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, #121212)"},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, #121212)",color:"var(--seekora-bg-surface, #ffffff)",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, #666666)",color:"var(--seekora-bg-surface, #ffffff)"},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, #121212)",marginBottom:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},productPrice:{fontSize:"12px",fontWeight:500,color:"var(--seekora-text-primary, #121212)"},footer:{padding:"12px 20px",borderTop:"1px solid var(--seekora-border-color, #e8e8e1)",backgroundColor:"var(--seekora-bg-secondary, #fafafa)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"11px",color:"var(--seekora-text-secondary, #666)"},footerLink:{color:"var(--seekora-text-primary, #121212)",textDecoration:"underline",cursor:"pointer"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, #666)"},spinner:{width:"24px",height:"24px",border:"2px solid var(--seekora-border-color, #e8e8e1)",borderTopColor:"var(--seekora-text-primary, #121212)",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)"}}))($),[$]),W=t.useRef(null),[q,H]=t.useState(-1),[O,j]=t.useState(null),[V,U]=t.useState(null),[Q,G]=t.useState(!1),X=t.useMemo(()=>s.map(e=>Xe(e,c)),[s,c]),Y=t.useMemo(()=>i.map(e=>Ye(e,d)),[i,d]),K=t.useMemo(()=>l.map(e=>Ke(e,u)),[l,u]),Z=Y[0],J=Y.slice(1,7),ee=t.useCallback(()=>{H(e=>Math.min(e+1,X.length-1))},[X.length]),te=t.useCallback(()=>{H(e=>Math.max(e-1,-1))},[]),re=t.useCallback(()=>{q>=0&&X[q]&&C?.(X[q]._raw,q)},[q,X,C]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>q,setActiveIndex:H,selectActive:re,navigateNext:ee,navigatePrevious:te,focus:()=>W.current?.focus(),close:()=>M?.()}),[q,re,ee,te,M]),t.useEffect(()=>{if(q>=0&&W.current){const e=W.current.querySelector(`[data-index="${q}"]`);e&&mt(e,W.current)}},[q]),!o)return null;const ae=nt(p),oe=Z?((e,t)=>{if(e&&t&&!(t<=e))return Math.round((t-e)/t*100)})(Z.price,Z.comparePrice):void 0;return t.createElement("div",{ref:W,role:"listbox","aria-label":"Search suggestions",className:st("seekora-shopify-dropdown",E,w.root),style:it(F.root,{width:$?"100%":v,maxHeight:$?"100vh":x,zIndex:k},ae,S),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,n&&L?P?P():t.createElement("div",{style:F.loading},t.createElement("div",{style:F.spinner})):t.createElement("div",{style:F.layout},t.createElement("div",{style:F.leftPanel},t.createElement("div",{style:F.section},t.createElement("div",{style:F.sectionHeader},t.createElement("span",{style:F.sectionTitle},"Suggestions"),X.length>5&&t.createElement("span",{style:F.viewAllLink,onClick:()=>z?.("suggestions")},"View all")),X.slice(0,5).map((e,r)=>{const o=q===r;return t.createElement("div",{key:e.id||r,"data-index":r,role:"option","aria-selected":o,style:it(F.suggestionItem,o?F.suggestionItemActive:void 0),onClick:()=>C?.(e._raw,r),onMouseEnter:()=>H(r)},t.createElement("div",{style:F.suggestionIcon},t.createElement(Cr,null)),t.createElement("div",{style:F.suggestionContent},t.createElement("div",{style:F.suggestionQuery,dangerouslySetInnerHTML:{__html:et(e.query,a,{tag:"mark"})}}),e.count&&t.createElement("div",{style:F.suggestionMeta},e.count," results")),t.createElement("div",{style:it(F.suggestionArrow,o?F.suggestionArrowVisible:void 0)},t.createElement(Rr,null)))}),0===X.length&&a&&(D?D(a):t.createElement("div",{style:{padding:"20px",textAlign:"center",color:"#666"}},'No suggestions for "',a,'"'))),f&&K.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:F.sectionHeader},t.createElement("span",{style:F.sectionTitle},"Collections")),t.createElement("div",{style:F.collectionsGrid},K.slice(0,4).map(e=>t.createElement("div",{key:e.id,style:it(F.collectionItem,V===e.id?F.collectionItemHover:void 0),onClick:()=>N?.(e.id),onMouseEnter:()=>U(e.id),onMouseLeave:()=>U(null)},t.createElement("div",{style:F.collectionName},e.label),e.count&&t.createElement("div",{style:F.collectionCount},e.count," products")))))),t.createElement("div",{style:F.rightPanel},g&&Z&&t.createElement("div",{style:F.heroProduct},Z.image&&t.createElement("img",{src:Z.image,alt:Z.title,style:F.heroImage,loading:"lazy"}),Z.brand&&t.createElement("div",{style:F.heroBrand},Z.brand),t.createElement("div",{style:F.heroTitle},Z.title),t.createElement("div",{style:F.heroPricing},t.createElement("span",{style:F.heroPrice},Ze(Z.price,{currency:m.currency||Z.currency||"$"})),b&&Z.comparePrice&&t.createElement("span",{style:F.heroComparePrice},Ze(Z.comparePrice,{currency:m.currency||Z.currency||"$"})),oe&&t.createElement("span",{style:F.heroDiscount},"-",oe,"%")),h&&t.createElement("button",{style:it(F.heroButton,Q?F.heroButtonHover:void 0),onClick:()=>T?.(Z._raw),onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1)},y)),J.length>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{...F.sectionTitle,marginBottom:"12px"}},"More Products"),t.createElement("div",{style:F.productsScroll},J.map((e,r)=>t.createElement("div",{key:e.id,style:it(F.productCard,O===e.id?F.productCardHover:void 0),onClick:()=>R?.(e._raw,r+1),onMouseEnter:()=>j(e.id),onMouseLeave:()=>j(null)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:F.productImage,loading:"lazy"}):t.createElement("div",{style:F.productImage}),t.createElement("div",{style:F.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:F.productPrice},Ze(e.price,{currency:m.currency||e.currency||"$"})))))))),void 0!==_?_:t.createElement("div",{style:F.footer},t.createElement("span",null,"Press ",t.createElement("strong",null,"Enter")," to search, ",t.createElement("strong",null,"↑↓")," to navigate"),t.createElement("span",{style:F.footerLink,onClick:()=>z?.("products")},"View all results")))}),Nr=()=>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"})),Tr=()=>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"})),zr=()=>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"})),Mr=()=>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"})),Ar=()=>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"})),_r=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:m={},theme:p={},showSearchInput:g=!0,showCancel:f=!0,cancelText:h="Cancel",showDragHandle:y=!0,swipeToDismiss:b=!0,footerButtonText:v="Search",showFooterButton:x=!0,width:k="100%",maxHeight:E="85vh",zIndex:S=9999,className:w,style:C,classNames:R={},inputRef:I,onSuggestionSelect:N,onProductClick:T,onRecentClick:z,onRecentClearAll:M,onSearchSubmit:A,onClose:_,header:L,footer:P,showLoadingState:D=!1,renderLoading:B,renderEmpty:$}=e;ar();const F=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, #fff)",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, #e0e0e0)",borderRadius:"3px"},header:{padding:"0 16px 16px",borderBottom:"1px solid var(--seekora-border-color, #f0f0f0)"},searchContainer:{display:"flex",alignItems:"center",backgroundColor:"var(--seekora-bg-secondary, #f5f5f5)",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, #000)",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, #000)"},itemActive:{backgroundColor:"var(--seekora-bg-hover, #f2f2f7)",color:"var(--seekora-text-primary, #000)"},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, #000)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemSubtitle:{fontSize:"15px",color:"var(--seekora-text-secondary, #8e8e93)",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, #000)",marginBottom:"4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},productPrice:{fontSize:"15px",fontWeight:600,color:"var(--seekora-text-primary, #000)"},footer:{padding:"12px 16px",paddingBottom:"calc(12px + env(safe-area-inset-bottom, 0px))",borderTop:"1px solid var(--seekora-border-color, #f0f0f0)",backgroundColor:"var(--seekora-bg-secondary, #f8f8f8)"},footerBtn:{width:"100%",padding:"16px",backgroundColor:"var(--seekora-primary, #007aff)",color:"var(--seekora-text-inverse, #ffffff)",border:"none",borderRadius:"12px",fontSize:"17px",fontWeight:600,cursor:"pointer"},loading:{display:"flex",alignItems:"center",justifyContent:"center",padding:"60px",color:"var(--seekora-text-secondary, #8e8e93)"},spinner:{width:"28px",height:"28px",border:"3px solid var(--seekora-border-color, #e5e5ea)",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, #8e8e93)",fontSize:"17px"},emptyIcon:{width:"48px",height:"48px",margin:"0 auto 16px",color:"var(--seekora-text-tertiary, #c7c7cc)"}}),[]),W=t.useRef(null),[q,H]=t.useState(-1),[O,j]=t.useState(a),[V,U]=t.useState(0),[Q,G]=t.useState(!1),X=t.useRef(0),Y=t.useMemo(()=>s.map(e=>Xe(e,d)),[s,d]),K=t.useMemo(()=>i.map(e=>Ye(e,u)),[i,u]),Z=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,5),[l]),J=t.useMemo(()=>c.map(e=>"string"==typeof e?e:e.query).slice(0,5),[c]),ee=t.useMemo(()=>{const e=[];return Z.forEach(t=>e.push({type:"recent",data:t})),J.forEach(t=>e.push({type:"trending",data:t})),Y.forEach(t=>e.push({type:"suggestion",data:t})),e},[Z,J,Y]),te=t.useCallback(()=>{H(e=>Math.min(e+1,ee.length-1))},[ee.length]),re=t.useCallback(()=>{H(e=>Math.max(e-1,-1))},[]),ae=t.useCallback(()=>{if(q<0||q>=ee.length)return void(O.trim()&&A?.(O.trim()));const e=ee[q];"recent"===e.type||"trending"===e.type?z?.(e.data):"suggestion"===e.type&&N?.(e.data._raw,q)},[q,ee,O,A,z,N]);t.useImperativeHandle(r,()=>({getActiveIndex:()=>q,setActiveIndex:H,selectActive:ae,navigateNext:te,navigatePrevious:re,focus:()=>I?.current?.focus(),close:()=>_?.()}),[q,ae,te,re,I,_]),t.useEffect(()=>{if(q>=0&&W.current){const e=W.current.querySelector(`[data-index="${q}"]`);e&&mt(e,W.current)}},[q]);if(t.useEffect(()=>{j(a)},[a]),!o)return null;const oe=nt(p),ne=!O&&Z.length>0,se=!O&&J.length>0,ie=K.length>0;return t.createElement(t.Fragment,null,t.createElement("div",{style:{...F.overlay,opacity:Q?1-V/300:1},onClick:_}),t.createElement("div",{ref:W,className:st("seekora-mobile-sheet",w,R.root),style:it(F.root,{maxHeight:E,zIndex:S,transform:Q?`translateY(${V}px)`:"translateY(0)"},oe,C),onTouchStart:e=>{b&&(G(!0),X.current=e.touches[0].clientY)},onTouchMove:e=>{if(!Q)return;const t=e.touches[0].clientY-X.current;t>0&&U(t)},onTouchEnd:()=>{Q&&(G(!1),V>150&&_?.(),U(0))}},t.createElement("style",null,"\n @keyframes seekora-spin {\n to { transform: rotate(360deg); }\n }\n "),y&&t.createElement("div",{style:F.dragHandle},t.createElement("div",{style:F.dragBar})),(g||L)&&t.createElement("div",{style:F.header},L||t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},t.createElement("div",{style:F.searchContainer},t.createElement("div",{style:F.searchIcon},t.createElement(Nr,null)),t.createElement("input",{ref:I,type:"text",placeholder:"Search...",value:O,onChange:e=>j(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),q>=0?ae():O.trim()&&A?.(O.trim())):"ArrowDown"===e.key?(e.preventDefault(),te()):"ArrowUp"===e.key?(e.preventDefault(),re()):"Escape"===e.key&&_?.()},style:F.searchInput,autoFocus:!0})),f&&t.createElement("button",{style:F.cancelBtn,onClick:_},h))),t.createElement("div",{style:F.content},n&&D?B?B():t.createElement("div",{style:F.loading},t.createElement("div",{style:F.spinner})):t.createElement(t.Fragment,null,ne&&t.createElement("div",{style:F.section},t.createElement("div",{style:F.sectionHeader},t.createElement("span",{style:F.sectionTitle},"Recent"),t.createElement("button",{style:F.clearBtn,onClick:M},"Clear")),Z.map((e,r)=>t.createElement("div",{key:`recent-${e}`,"data-index":r,style:it(F.item,q===r?F.itemActive:void 0),onClick:()=>{z?.(e),j(e)},onMouseEnter:()=>H(r)},t.createElement("div",{style:F.itemIcon},t.createElement(Tr,null)),t.createElement("div",{style:F.itemContent},t.createElement("div",{style:F.itemTitle},e)),t.createElement("div",{style:F.itemAction},t.createElement(Ar,null))))),se&&t.createElement("div",{style:F.section},t.createElement("div",{style:F.sectionHeader},t.createElement("span",{style:F.sectionTitle},"Trending")),J.map((e,r)=>{const a=Z.length+r;return t.createElement("div",{key:`trending-${e}`,"data-index":a,style:it(F.item,q===a?F.itemActive:void 0),onClick:()=>{z?.(e),j(e)},onMouseEnter:()=>H(a)},t.createElement("div",{style:F.itemIcon},t.createElement(zr,null)),t.createElement("div",{style:F.itemContent},t.createElement("div",{style:F.itemTitle},e)),t.createElement("div",{style:F.itemAction},t.createElement(Mr,null)))})),O&&Y.length>0&&t.createElement("div",{style:F.section},t.createElement("div",{style:F.sectionHeader},t.createElement("span",{style:F.sectionTitle},"Suggestions")),Y.map((e,r)=>{const a=Z.length+J.length+r;return t.createElement("div",{key:e.id||r,"data-index":a,style:it(F.item,q===a?F.itemActive:void 0),onClick:()=>N?.(e._raw,r),onMouseEnter:()=>H(a)},t.createElement("div",{style:F.itemIcon},t.createElement(Nr,null)),t.createElement("div",{style:F.itemContent},t.createElement("div",{style:F.itemTitle,dangerouslySetInnerHTML:{__html:et(e.query,O,{tag:"strong"})}}),e.count&&t.createElement("div",{style:F.itemSubtitle},e.count," results")),t.createElement("div",{style:F.itemAction},t.createElement(Mr,null)))})),ie&&t.createElement("div",{style:F.section},t.createElement("div",{style:F.sectionHeader},t.createElement("span",{style:F.sectionTitle},"Products")),t.createElement("div",{style:F.productsScroll},K.slice(0,8).map((e,r)=>t.createElement("div",{key:e.id,style:F.productCard,onClick:()=>T?.(e._raw,r)},e.image?t.createElement("img",{src:e.image,alt:e.title,style:F.productImage,loading:"lazy"}):t.createElement("div",{style:F.productImage}),t.createElement("div",{style:F.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:F.productPrice},Ze(e.price,{currency:m.currency||e.currency||"$"})))))),O&&0===Y.length&&!n&&($?$(O):t.createElement("div",{style:F.empty},t.createElement("div",{style:F.emptyIcon},t.createElement(Nr,null)),t.createElement("p",null,'No results for "',O,'"'))))),void 0!==P?P:x&&O&&t.createElement("div",{style:F.footer},t.createElement("button",{style:F.footerBtn,onClick:()=>A?.(O)},v,' "',O,'"'))))}),Lr=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:m={},showIndices:p=!1,showTypeLabels:g=!1,showSectionDividers:f=!0,width:h="100%",maxHeight:y="400px",zIndex:b=1e3,className:v,style:x,classNames:k={},onSuggestionSelect:E,onProductClick:S,onRecentClick:w,onClose:C,onSearchSubmit:R,header:I,footer:N,showLoadingState:T=!1,renderLoading:z,renderEmpty:M}=e;ar();const A=er(),{isMobile:_}=A,L=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"}}),[]),P=t.useRef(null),D=t.useRef(null),[B,$]=t.useState(-1),F=t.useMemo(()=>s.map(e=>Xe(e,c)),[s,c]),W=t.useMemo(()=>i.map(e=>Ye(e,d)),[i,d]),q=t.useMemo(()=>l.map(e=>"string"==typeof e?e:e.query).slice(0,3),[l]),H=t.useMemo(()=>{const e=[];return!a&&q.length>0&&q.forEach(t=>e.push({type:"recent",data:t})),F.forEach(t=>e.push({type:"suggestion",data:t})),W.forEach(t=>e.push({type:"product",data:t})),e},[a,q,F,W]),O=t.useCallback(()=>{$(e=>Math.min(e+1,H.length-1))},[H.length]),j=t.useCallback(()=>{$(e=>Math.max(e-1,-1))},[]),V=t.useCallback(()=>{const e=H[B];if(e)switch(e.type){case"recent":w?.(e.data);break;case"suggestion":E?.(e.data._raw,B);break;case"product":S?.(e.data._raw,B)}else a&&R?.(a)},[B,H,a,R,w,E,S]);if(t.useImperativeHandle(r,()=>({getActiveIndex:()=>B,setActiveIndex:$,selectActive:V,navigateNext:O,navigatePrevious:j,focus:()=>P.current?.focus(),close:()=>C?.()}),[B,V,O,j,C]),t.useEffect(()=>{if(D.current&&B>=0){const e=D.current.querySelector(`[data-index="${B}"]`);e&&mt(e,D.current)}},[B]),t.useEffect(()=>{$(-1)},[a]),!o)return null;const U=nt(m),Q=!a&&q.length>0;let G=0;return t.createElement("div",{ref:P,role:"listbox","aria-label":"Search suggestions",className:st("seekora-minimal-dropdown",v,k.root),style:it(L.root,{width:h,zIndex:b},U,x),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:D,style:{maxHeight:y,overflowY:"auto"}},n&&0===H.length&&T?z?z():t.createElement("div",{style:L.loading},"Loading..."):0===H.length?M?M(a):t.createElement("div",{style:L.empty},a?`No results for "${a}"`:"Start typing to search"):t.createElement(t.Fragment,null,Q&&t.createElement(t.Fragment,null,f&&t.createElement("div",{style:L.divider},"Recent"),q.map((e,r)=>{const a=G++,o=B===a,n=r===q.length-1&&!F.length&&!W.length;return t.createElement("div",{key:`recent-${e}`,"data-index":a,style:it(L.item,o?L.itemActive:void 0,n?L.itemLast:void 0),onClick:()=>w?.(e),onMouseEnter:()=>$(a)},p&&t.createElement("span",{style:L.itemIndex},a+1),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:L.itemQuery},e)),g&&t.createElement("span",{style:L.itemType},"Recent"))})),F.length>0&&t.createElement(t.Fragment,null,f&&(Q||!1)&&t.createElement("div",{style:L.divider},"Suggestions"),F.map((e,r)=>{const o=G++,n=B===o,s=r===F.length-1&&!W.length;return t.createElement("div",{key:e.id||`suggestion-${r}`,"data-index":o,style:it(L.item,n?L.itemActive:void 0,s?L.itemLast:void 0),onClick:()=>E?.(e._raw,r),onMouseEnter:()=>$(o)},p&&t.createElement("span",{style:L.itemIndex},o+1),t.createElement("div",{style:L.itemContent},t.createElement("div",{style:L.itemQuery,dangerouslySetInnerHTML:{__html:et(e.query,a,{tag:"mark"})}}),e.count&&t.createElement("div",{style:L.itemMeta},e.count.toLocaleString()," results")),g&&t.createElement("span",{style:L.itemType},"Search"))})),W.length>0&&t.createElement(t.Fragment,null,f&&t.createElement("div",{style:L.divider},"Products"),W.slice(0,4).map((e,r)=>{const a=G++,o=B===a;return t.createElement("div",{key:e.id,"data-index":a,style:it(L.productRow,o?L.productRowActive:void 0),onClick:()=>S?.(e._raw,r),onMouseEnter:()=>$(a)},e.image&&t.createElement("img",{src:e.image,alt:e.title,style:L.productImage,loading:"lazy"}),t.createElement("div",{style:L.productContent},t.createElement("div",{style:L.productTitle},e.title),void 0!==e.price&&t.createElement("div",{style:L.productPrice},Ze(e.price,{currency:u.currency||e.currency||"$"}))),g&&t.createElement("span",{style:L.itemType},"Product"))})))),void 0!==N?N:t.createElement("div",{style:L.footer},t.createElement("div",{style:L.footerHint},t.createElement("span",null,t.createElement("span",{style:L.kbd},"↑")," ",t.createElement("span",{style:L.kbd},"↓")," navigate"),t.createElement("span",null,t.createElement("span",{style:L.kbd},"↵")," select"),t.createElement("span",null,t.createElement("span",{style:L.kbd},"esc")," close")),t.createElement("span",null,H.length," results")))});function Pr(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 Dr={amazon:cr,google:gr,pinterest:vr,spotlight:wr,shopify:Ir,"mobile-sheet":_r,minimal:Lr},Br=t.forwardRef(function(e,r){const{client:a,variant:o="amazon",autoMobileVariant:n=!0,placeholder:s="Search...",defaultQuery:i="",value:l,minQueryLength:c=1,maxSuggestions:d=8,debounceMs:u=200,includeDropdownRecommendations:m=!0,includeDropdownProductList:p=!0,includeFilteredTabs:g=!0,includeCategories:f=!0,filteredTabs:h,analyticsTags:y,enableRecentSearches:b=!0,maxRecentSearches:v=10,showProducts:x=!0,showTrendingOnEmpty:k=!0,enableAnalytics:E=!0,analyticsConfig:w,suggestionFields:C,productFields:R,theme:I,onSearch:N,onQueryChange:T,onSuggestionSelect:z,onProductClick:M,onCategoryClick:A,onTabChange:_,className:L,style:P,inputClassName:D,dropdownWidth:B,dropdownMaxHeight:$="500px",zIndex:F=1e3,enableCache:W=!0,cacheTtlMs:q=3e4,cacheMaxSize:H=100}=e,O=S(),j=I??O.theme,V=fe({client:a,enabled:E,analyticsTags:w?.tags??y,trackImpressions:w?.trackImpressions??!0,trackClicks:w?.trackSuggestionClicks??!0});ar(),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=er(),{isMobile:Q}=U,G=t.useMemo(()=>n&&Q&&"mobile-sheet"!==o&&"spotlight"!==o?"mobile-sheet":o,[o,Q,n]),[X,Y]=t.useState(i),[K,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,me]=t.useState([]),[pe,ge]=t.useState([]),[he,ye]=t.useState("all"),be=t.useRef(null),ve=t.useRef(null),xe=t.useRef(null),ke=t.useRef(null),Ee=t.useMemo(()=>W?ft({maxSize:H,defaultTtlMs:q}):null,[W,H,q]),Se=void 0!==l?l:X,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"},loadingSpinner:{width:"18px",height:"18px",borderWidth:"2px",borderStyle:"solid",borderColor:"#e5e7eb",borderTopColor:"#f90",borderRadius:"50%",animation:"seekora-spin 0.8s linear infinite",marginRight:"12px",flexShrink:0}}))(Q),[Q]);t.useEffect(()=>{if(b){const e=ct();ge(e.slice(0,v))}},[b,v]);const Ce=t.useCallback(async e=>{if(!a)return;if(e.length>0&&e.length<c)return oe([]),se([]),void de([]);const t={maxSuggestions:d,includeDropdownRecommendations:m,includeDropdownProductList:p,includeFilteredTabs:g,includeCategories:f,filteredTabs:h?.map(e=>e.filter).join(",")},r=Ee?.generateKey(e,t);if(Ee&&r){const t=Ee.get(r);if(t)return console.log("Seekora: Cache hit for query:",e),void Re(t)}re(!0);try{const t=await(a.getSuggestions?.(e,{hitsPerPage:d,include_dropdown_recommendations:m,include_dropdown_product_list:p,include_filtered_tabs:g,include_categories:f,include_facets:!0,filtered_tabs:h,analytics_tags:y,returnFullResponse:!0}));if(Ee&&r&&t&&(Ee.set(r,t),console.log("Seekora: Cached response for query:",e)),Re(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,m,p,g,f,h,y,E,V,Ee]),Re=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||[]),me(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)})},[]),Ie=t.useCallback(e=>{const t=e.target.value;void 0===l&&Y(t),T?.(t),ye("all"),xe.current&&clearTimeout(xe.current),t.length>=c?(Z(!0),xe.current=setTimeout(()=>{Ce(t)},u)):0===t.length&&(b||k)?(Z(!0),oe([])):Z(!1)},[l,T,c,u,Ce,b,k]),Ne=t.useCallback(()=>{ee(!0),Z(!0),E&&V.trackDropdownOpen(Se),Se.length>=c?0===ae.length&&Ce(Se):Ce("")},[Se,c,ae.length,Ce,E,V]),Te=t.useCallback(()=>{ee(!1),setTimeout(()=>{ke.current?.contains(document.activeElement)||Z(!1)},150)},[]),ze=t.useCallback(e=>{if("Escape"===e.key)Z(!1),be.current?.blur();else if("Enter"===e.key){e.preventDefault();(ve.current?.getActiveIndex?.()??-1)>=0&&K?ve.current?.selectActive?.():Se.trim()&&(N?.(Se.trim()),b&&(dt(Se.trim()),ge(ct().slice(0,v))),E&&V.trackSearchSubmit(Se.trim(),!1),Z(!1))}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),!K&&(ae.length>0||pe.length>0)&&Z(!0),"ArrowDown"===e.key?ve.current?.navigateNext?.():ve.current?.navigatePrevious?.())},[Se,N,b,v,K,ae.length,pe.length,E,V]),Me=t.useCallback((e,t)=>{const r=e.query||e.text||e.objectID||"";void 0===l&&Y(r),T?.(r),z?.(e,t),b&&r&&(dt(r),ge(ct().slice(0,v))),E&&(V.trackSuggestionClick({suggestion:{query:r,objectID:e.objectID||e.id,popularity:e.popularity},position:t,section:"suggestions",query:Se,totalSuggestions:ae.length}),V.trackSearchSubmit(r,!0,e)),N?.(r),Z(!1)},[l,T,z,b,v,E,N,V,Se,ae.length]),Ae=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"!==he?"filtered_tab":"products",tabId:"all"!==he?he:void 0,query:Se})},[M,E,V,he,Se]),_e=t.useCallback((e,t)=>{A?.(e,t),E&&V.trackCategoryClick({value:e.label||e.value||e.id,count:e.count,path:e.path},Se)},[A,E,V,Se]),Le=t.useCallback(e=>{if(console.log("Seekora: Tab changed to",e),ye(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},Se)}},[_,E,V,ce,Se]),Pe=t.useCallback(e=>{void 0===l&&Y(e),T?.(e),Ce(e),E&&V.trackRecentSearchClick({query:e,timestamp:Date.now()})},[l,T,Ce,E,V]),De=t.useCallback(e=>{ut(e),ge(ct().slice(0,v))},[v]),Be=t.useCallback(()=>{void 0===l&&Y(""),T?.(""),oe([]),se([]),de([]),be.current?.focus()},[l,T]),$e=t.useCallback(()=>{Z(!1),E&&V.trackDropdownClose(Se)},[E,V,Se]);t.useImperativeHandle(r,()=>({focus:()=>be.current?.focus(),blur:()=>be.current?.blur(),clear:Be,getQuery:()=>Se,setQuery:e=>{void 0===l&&Y(e),T?.(e)},openDropdown:()=>Z(!0),closeDropdown:()=>Z(!1),refresh:()=>Ce(Se),clearCache:()=>Ee?.clear(),getCacheStats:()=>Ee?.getStats()??null}),[Se,l,T,Be,Ce,Ee]);const Fe=Dr[G]||cr,We=t.useMemo(()=>{if(console.log("Seekora: Computing products for tab",he,"from",ce.length,"tabs"),0===ce.length)return ne;if("all"===he){const e=ce[0]?.products||[];return e.length>0?e:ne}const e=ce.find(e=>e.id===he);return e?.products&&e.products.length>0?(console.log("Seekora: Found",e.products.length,"products for tab",he),e.products):ne},[he,ce,ne]);return t.createElement("div",{ref:ke,className:st("seekora-suggestion-search",L),style:it(we.container,P)},t.createElement("div",{style:it(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:be,type:"text",value:Se,onChange:Ie,onFocus:Ne,onBlur:Te,onKeyDown:ze,placeholder:s,className:D,style:we.input,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":"Search","aria-expanded":K,"aria-haspopup":"listbox"}),te&&t.createElement("div",{style:we.loadingSpinner}),Se&&!te&&t.createElement("button",{type:"button",onClick:Be,style:we.clearButton,"aria-label":"Clear search"},"×")),K&&t.createElement(Fe,{query:Se,isOpen:K,loading:te,suggestions:ae,products:We,categories:ce.map(e=>({id:e.id,label:e.label,count:e.nb_hits})),recentSearches:pe.map(e=>"string"==typeof e?e:e.query),trendingSearches:ue,filteredTabs:ce,activeTab:he,suggestionFields:C,productFields:R,theme:Pr(j)??j,width:B||"100%",maxHeight:$,zIndex:F,analytics:{enabled:E,trackSuggestionClicks:w?.trackSuggestionClicks??!0,trackProductClicks:w?.trackProductClicks??!0,trackImpressions:w?.trackImpressions??!0,trackCategoryClicks:w?.trackCategoryClicks??!0,trackBrandClicks:w?.trackBrandClicks??!0,trackSearchSubmit:w?.trackSearchSubmit??!0,tags:w?.tags??y},onSuggestionSelect:Me,onProductClick:Ae,onCategoryClick:_e,onTabChange:Le,onRecentClick:Pe,onRecentRemove:De,onClose:$e}))}),$r={amazon:cr,google:gr,pinterest:vr,spotlight:wr,shopify:Ir,"mobile-sheet":_r,minimal:Lr};function Fr({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 Wr({value:e,onChange:r,onKeyDown:a,placeholder:o="Search documentation...",isLoading:n=!1,onClear:s}){const i=t.useRef(null);t.useEffect(()=>{i.current&&i.current.focus()},[]);return t.createElement("div",{className:"seekora-docsearch-searchbox"},t.createElement("label",{className:"seekora-docsearch-searchbox-icon",htmlFor:"seekora-docsearch-input"},n?t.createElement("span",{className:"seekora-docsearch-spinner","aria-hidden":"true"},t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},t.createElement("circle",{cx:"10",cy:"10",r:"8",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeDasharray:"40",strokeDashoffset:"10"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 10 10",to:"360 10 10",dur:"0.8s",repeatCount:"indefinite"})))):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:i,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(""),s?.(),i.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 qr({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 Hr({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,m=d.parentTitle?`${d.category||""} › ${d.parentTitle}`.replace(/^› /,""):d.category||"",p=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=p,f=e.content||d.description||"";if(c){const t=e;t._highlightResult&&(g=t._highlightResult.title?.value||p,f=t._highlightResult.content?.value||e.content||"")}else d.highlight&&(g=d.highlight.title||p,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(Vr,{isLast:i})),t.createElement("div",{className:"seekora-docsearch-hit-icon"},t.createElement(jr,{type:Or(u)})),t.createElement("div",{className:"seekora-docsearch-hit-content"},!s&&m&&t.createElement("span",{className:"seekora-docsearch-hit-breadcrumb"},m),t.createElement("span",{className:"seekora-docsearch-hit-title"},t.createElement(qr,{value:p,highlightedValue:g})),h&&t.createElement("span",{className:"seekora-docsearch-hit-description"},t.createElement(qr,{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 Or(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 jr({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 Vr({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 Ur(e){if(!e)return 1;const t=e.match(/^lvl(\d+)$/);return t?parseInt(t[1],10):1}function Qr(e){return Ur(e)>=2}function Gr(e){const t=e.hierarchy??{};return[t.lvl0??"",t.lvl1??"",t.lvl2??"",t.lvl3??"",t.lvl4??"",t.lvl5??""].join("\0")}function Xr(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 Yr(e,t){return"objectID"in e?e.objectID:`suggestion-${e.url}-${t}`}function Kr({hits:e,groupedHits:r,selectedIndex:a,onSelect:o,onHover:n,scrollSelectionIntoViewRef:s,query:i,isLoading:l,showLoadingState:c=!1,error:d,translations:u={},sources:m=[]}){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"},u.searchPlaceholder||"Type to start searching..."));if(l&&0===e.length&&c)return t.createElement("div",{className:"seekora-docsearch-loading"},t.createElement("div",{className:"seekora-docsearch-loading-spinner"},t.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true"},t.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeDasharray:"50",strokeDashoffset:"15"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"0.8s",repeatCount:"indefinite"})))),t.createElement("p",{className:"seekora-docsearch-loading-text"},u.loadingText||"Searching..."));if(l&&0===e.length)return t.createElement("div",{className:"seekora-docsearch-empty"});if(d)return t.createElement("div",{className:"seekora-docsearch-error"},t.createElement("p",{className:"seekora-docsearch-error-text"},u.errorText||d));if(0===e.length&&i)return t.createElement("div",{className:"seekora-docsearch-no-results"},t.createElement("p",{className:"seekora-docsearch-no-results-text"},u.noResultsText||`No results found for "${i}"`));const g=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=Gr(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 Ur(r)-Ur(a)}),r=t.map((e,r)=>{const a=Qr(e.type),o=t[r+1],n=a&&(!o||!Qr(o.type));return{...e,isChild:a,isLastChild:n}}),a=Xr(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"},g.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}(g,r,i),c=s;return t.createElement("li",{key:Yr(s,i)},t.createElement(Hr,{hit:s,isSelected:l===a,onClick:()=>o(s),onMouseEnter:()=>n(l),openInNewTab:e.openInNewTab,isChild:c.isChild,isLastChild:c.isLastChild,hierarchyType:s.type}))}))))))}function Zr({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("span",{className:"seekora-docsearch-logo",style:{fontFamily:"system-ui",fontSize:14,fontWeight:600}},"Seekora"))))}function Jr(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 ea(e="K"){if("undefined"==typeof navigator)return`⌘${e}`;return navigator.platform.toLowerCase().includes("mac")?`⌘${e}`:`Ctrl+${e}`}function ta({onClick:e,placeholder:r="Search documentation..."}){const a=ea("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 ra={query:"",results:[],suggestions:[],groupedSuggestions:[],isLoading:!1,error:null,selectedIndex:0,mode:"suggestions"};function aa(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 ra;default:return e}}function oa(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(aa,ra),u=t.useRef(new Map),m=t.useRef(null),p=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})):p(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.suggestions||e.results||e.hits||[]).map(e=>({url:e.url||e.route||"",title:e.title?.replace?.(/<\/?mark>/g,"")||e.title||"",content:e.content?.replace?.(/<\/?mark>/g,"")?.substring?.(0,100)||e.description||"",description:e.description||e.content?.substring?.(0,100)||"",category:e.category||e.hierarchy?.lvl0||"",hierarchy:e.hierarchy,route:e.route,parentTitle:e.parent_title||e.parentTitle,_source:t})))(s,e.id)}catch(e){if(e instanceof Error&&"AbortError"===e.name)throw e;return[]}},[p]),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}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>f(e),s)},[f,s]),b=t.useCallback(()=>d({type:"SELECT_NEXT"}),[]),v=t.useCallback(()=>d({type:"SELECT_PREV"}),[]),x=t.useCallback(e=>d({type:"SET_SELECTED_INDEX",payload:e}),[]),k=t.useCallback(()=>{u.current.forEach(e=>e.abort()),u.current.clear(),m.current&&clearTimeout(m.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(),m.current&&clearTimeout(m.current)},[]),{...c,sources:l,setQuery:y,search:h,fetchSuggestions:f,selectNext:b,selectPrev:v,setSelectedIndex:x,reset:k,getSelectedItem:E}}function na(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,m]=t.useState(""),[p,g]=t.useState([]),[f,h]=t.useState(!1),[y,b]=t.useState(null),[v,x]=t.useState(0),k=t.useRef(null),E=t.useRef(null),S=t.useRef(null),w=t.useRef(null);t.useEffect(()=>{if(!r)return;const e={storeId:r,readSecret:o,logLevel:"warn",enableContextCollection:!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{k.current=new a.SeekoraClient(e)}catch(e){console.error("Failed to initialize SeekoraClient:",e),b("Failed to initialize search client")}return()=>{k.current=null}},[r,o,n]);const C=t.useCallback(async e=>{if(k.current)if(e.trim()){w.current&&w.current.abort(),w.current=new AbortController,h(!0),b(null);try{const t=await k.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(w.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,m="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??m?{title:u,content:m}:void 0}})}(t.results||[])),x(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=>{m(e),x(0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>C(e),i)},[C,i]),I=t.useCallback(()=>{x(e=>e>=p.length-1?0:e+1)},[p.length]),N=t.useCallback(()=>{x(e=>e<=0?p.length-1:e-1)},[p.length]),T=t.useCallback(()=>{w.current&&w.current.abort(),S.current&&clearTimeout(S.current),m(""),g([]),h(!1),b(null),x(0)},[]),z=t.useCallback(()=>p[v]||null,[p,v]),M=t.useCallback((e,t)=>{const r=k.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(()=>()=>{w.current&&w.current.abort(),S.current&&clearTimeout(S.current)},[]),{query:u,suggestions:p,isLoading:f,error:y,selectedIndex:v,setQuery:R,selectNext:I,selectPrev:N,setSelectedIndex:x,reset:T,getSelectedItem:z,trackDocClick:M}}function sa(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 ia={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 la={"--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"},ca={...la,"--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)"},da={...la,"--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"},ua={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 ma(e=la){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 pa=!1;function ga(e=la,t=!1){if("undefined"==typeof document)return;if(pa&&!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=ma(e),pa=!0}e.ActionButtons=He,e.AmazonDropdown=cr,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"),m={};switch(s&&(m.product_id=s),i&&(m.position=parseInt(i,10)),l&&(m.section=l),o){case"click":if(n("product.click",m),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&&(m.variant_sku=c),n("product.add_to_cart",m);break;case"variant-select":d&&(m.option_name=d),u&&(m.option_value=u),n("product.variant_select",m);break;default:o&&n(o,m)}};return t.addEventListener("click",a),()=>t.removeEventListener("click",a)},[e,r,n]),t.createElement(Ut.Provider,{value:{client:e,context:r}},t.createElement("div",{ref:o,style:{display:"contents"}},a))},e.BadgeList=vt,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:m}=S(),{refinements:p,removeRefinement:g,clearRefinements:f}=w(),h=c||{},y=t.useMemo(()=>{if(d)return d;const t=[];return e.forEach((e,a)=>{const o=p.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,p,r,d]),b=t.useCallback((t,r)=>{if(null===t)e.forEach(e=>{p.filter(t=>t.field===e).forEach(e=>g(e.field,e.value,!1))}),m.search();else{const r=y.findIndex(e=>e.value===t.value);e.forEach((e,a)=>{p.filter(t=>t.field===e).forEach(e=>{(a>r||a===r&&e.value!==t.value)&&g(e.field,e.value,!1)})}),m.search()}s&&s(t,r)},[e,p,g,m,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=Bt,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:m}=S(),{query:p,refinements:g,clearRefinements:f,setQuery:h,removeRefinement:y}=w(),b=d||{},v=t.useMemo(()=>g.filter(e=>!n.includes(e.field)&&!(o&&!o.includes(e.field))),[g,o,n]),x=v.length>0||e&&p.length>0,k=()=>{x&&(o||n.length>0?(v.forEach(e=>{y(e.field,e.value,!1)}),v.length>0&&f(!1)):f(!e),e&&p.length>0&&h("",!0),s&&s())};return u&&!x?null:i?t.createElement("div",{className:I(b.root,l),style:c},i({canClear:x,onClick:k,disabled:!x})):t.createElement("div",{className:I(b.root,l),style:c},t.createElement("button",{type:"button",onClick:k,disabled:!x,className:I(b.button,!x&&b.buttonDisabled),style:{padding:`${m.spacing.small} ${m.spacing.medium}`,fontSize:m.typography.fontSize.medium,fontWeight:m.typography.fontWeight?.medium||500,backgroundColor:x?m.colors.primary:m.colors.hover,color:x?"#ffffff":m.colors.textSecondary,border:"none",borderRadius:"string"==typeof m.borderRadius?m.borderRadius:m.borderRadius.medium,cursor:x?"pointer":"not-allowed",opacity:x?1:.6,transition:m.transitions?.fast||"150ms ease-in-out"},"aria-label":x?r:a},x?r:a))},e.CurrentRefinements=({refinements:e=[],onRefinementClear:r,onClearAll:a,renderRefinement:o,showClearAll:n=!0,className:s,style:i,theme:l})=>{const{theme:c}=S(),d=l||{},u=(e,a)=>t.createElement("div",{key:`${e.field}-${e.value}-${a}`,className:d.item,style:{display:"inline-flex",alignItems:"center",padding:`${c.spacing.small} ${c.spacing.medium}`,margin:`0 ${c.spacing.small} ${c.spacing.small} 0`,backgroundColor:c.colors.hover,border:`1px solid ${c.colors.border}`,borderRadius:"string"==typeof c.borderRadius?c.borderRadius:c.borderRadius.medium,fontSize:c.typography.fontSize.small}},t.createElement("span",{className:d.label,style:{marginRight:c.spacing.small,color:c.colors.text,fontWeight:"500"}},e.label||e.field,":"),t.createElement("span",{className:d.value,style:{marginRight:c.spacing.small,color:c.colors.text}},e.displayValue||e.value),t.createElement("button",{type:"button",onClick:()=>{return t=e.field,a=e.value,void(r&&r(t,a));var t,a},className:d.clearButton,style:{border:"none",backgroundColor:"transparent",color:c.colors.text,cursor:"pointer",fontSize:c.typography.fontSize.medium,padding:0,marginLeft:c.spacing.small,width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:c.transitions?.fast||"150ms ease-in-out"},"aria-label":`Clear ${e.label||e.field}: ${e.value}`},"×"));return 0===e.length?null:t.createElement("div",{className:I(d.container,s),style:i},t.createElement("div",{className:d.list,style:{display:"flex",flexWrap:"wrap",alignItems:"center",marginBottom:n?c.spacing.medium:0}},e.map((e,t)=>o?o(e,t):u(e,t))),n&&e.length>1&&t.createElement("button",{type:"button",onClick:()=>{a&&a()},className:d.clearAllButton,style:{padding:`${c.spacing.small} ${c.spacing.medium}`,border:`1px solid ${c.colors.border}`,borderRadius:"string"==typeof c.borderRadius?c.borderRadius:c.borderRadius.medium,backgroundColor:c.colors.background,color:c.colors.text,cursor:"pointer",fontSize:c.typography.fontSize.small,textDecoration:"underline"}},"Clear all filters"))},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:m={},renderButton:p=!0,buttonComponent:g=ta,initialOpen:f=!1,disableShortcut:h=!1,shortcutKey:y="k",processGroupedResults:b}){const[v,x]=t.useState(f),k=t.useRef(!1),E=!!e,S=na({storeId:e||"",storeSecret:r,apiEndpoint:a,maxResults:l,debounceMs:c,analyticsTags:["docsearch"]}),w=oa({apiEndpoint:o,apiKey:n,sources:s,maxResults:l,debounceMs:c,processGroupedResults:b}),{query:C,suggestions:R,isLoading:I,error:N,selectedIndex:T,setQuery:z,selectNext:M,selectPrev:A,setSelectedIndex:_,reset:L,getSelectedItem:P}=E?S:w,D=E?void 0:w.groupedSuggestions,B=E?R:w.results,$=E?"suggestions":w.mode,F=E?[{id:"seekora",name:"Results",endpoint:""}]:w.sources,W=t.useCallback(()=>x(!0),[]),q=t.useCallback(()=>{x(!1),L(),u?.()},[L,u]),H=t.useCallback(e=>{E&&S.trackDocClick&&S.trackDocClick(e,T+1),d?d(e):window.location.href=e.url,q()},[d,q,E,S,T]),O=t.useCallback(()=>{const e=P();e&&H(e)},[P,H]),j=t.useCallback(()=>{k.current=!0,M()},[M]),V=t.useCallback(()=>{k.current=!0,A()},[A]),{handleModalKeyDown:U}=Jr({isOpen:v,onOpen:W,onClose:q,onSelectNext:j,onSelectPrev:V,onEnter:O,disableShortcut:h,shortcutKey:y}),Q=t.useCallback(e=>U(e),[U]),G="results"===$?B:R;return t.createElement(t.Fragment,null,p&&t.createElement(g,{onClick:W,placeholder:m.buttonText||i}),t.createElement(Fr,{isOpen:v,onClose:q},t.createElement("div",{className:"seekora-docsearch-modal",onKeyDown:Q},t.createElement("header",{className:"seekora-docsearch-header"},t.createElement(Wr,{value:C,onChange:z,onKeyDown:Q,placeholder:i,isLoading:I,onClear:L}),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(Kr,{hits:G,groupedHits:D,selectedIndex:T,onSelect:H,onHover:_,scrollSelectionIntoViewRef:k,query:C,isLoading:I,error:N,translations:m,sources:F})),t.createElement(Zr,{translations:m}))))},e.DocSearchButton=ta,e.DropdownPanel=Ne,e.Facets=({results:e,facets:r,onFacetChange:a,renderFacet:o,renderFacetItem:n,maxItems:s=10,showMore:i=!0,className:c,style:d,theme:m})=>{const{theme:p}=S(),{results:g,refinements:f,addRefinement:h,removeRefinement:y}=w(),b=m||{},[v,x]=t.useState({}),k=e||g,E=(()=>{if(r)return r;const e=k?.data?.facets||k?.facets||k?.data?.data?.facets||null;if(l("Facets: Extracting facets",{hasResults:!!k,hasData:!!k?.data,rawFacets:e?Array.isArray(e)?e.length:"not array":null,resultsKeys:k?Object.keys(k):[],dataKeys:k?.data?Object.keys(k.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:k?JSON.stringify(Object.keys(k)):"null",dataStructure:k?.data?JSON.stringify(Object.keys(k.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:f.some(r=>r.field===t&&r.value===e.value)})):[]}});return l("Facets: Extracted facets",{count:t.length,facets:t.map(e=>({field:e.field,itemsCount:e.items.length}))}),t})(),C=(e,t,r)=>{const o=!r;if(l("Facets: Facet toggled",{field:e,value:t,selected:o}),o?h(e,t):y(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})}},R=e=>{x(t=>({...t,[e]:!t[e]}))},N=(e,r)=>{const a=v[e.field]||!1,o=a?e.items:e.items.slice(0,s),l=e.items.length>s;return t.createElement("div",{key:e.field,className:b.facet,style:{marginBottom:p.spacing.large,padding:p.spacing.medium,backgroundColor:p.colors.background,border:`1px solid ${p.colors.border}`,borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium}},t.createElement("h3",{className:b.facetTitle,style:{fontSize:p.typography.fontSize.large,fontWeight:"bold",margin:0,marginBottom:p.spacing.medium,color:p.colors.text}},e.label||e.field),t.createElement("div",{className:b.facetList},o.map((r,a)=>{const o=a;return n?n(r,e,o):((e,r,a)=>!(v[r.field]||a<s)&&a>=s?null:t.createElement("div",{key:`${r.field}-${e.value}`,className:I(b.facetItem,(f.some(t=>t.field===r.field&&t.value===e.value)||e.selected)&&b.facetItemActive),onClick:()=>C(r.field,e.value,e.selected||!1),style:{display:"flex",alignItems:"center",padding:p.spacing.small,cursor:"pointer",borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,marginBottom:p.spacing.small,backgroundColor:f.some(t=>t.field===r.field&&t.value===e.value)||e.selected?p.colors.hover:"transparent",transition:"background-color 0.2s ease"}},t.createElement("input",{type:"checkbox",checked:f.some(t=>t.field===r.field&&t.value===e.value)||e.selected||!1,onChange:()=>C(r.field,e.value,e.selected||!1),className:b.checkbox,style:{marginRight:p.spacing.small,cursor:"pointer"},"aria-label":`Filter by ${e.value}`}),t.createElement("span",{className:b.facetItemLabel,style:{flex:1,fontSize:p.typography.fontSize.medium,color:p.colors.text}},e.value),t.createElement("span",{className:b.facetItemCount,style:{fontSize:p.typography.fontSize.small,color:p.colors.textSecondary||p.colors.text,opacity:.7,marginLeft:p.spacing.small}},"(",e.count,")")))(r,e,o)})),i&&l&&!a&&t.createElement("button",{type:"button",onClick:()=>R(e.field),style:{marginTop:p.spacing.small,padding:p.spacing.small,border:"none",backgroundColor:"transparent",color:p.colors.primary,cursor:"pointer",fontSize:p.typography.fontSize.small,textDecoration:"underline"}},"Show more (",e.items.length-s," more)"),a&&l&&t.createElement("button",{type:"button",onClick:()=>R(e.field),style:{marginTop:p.spacing.small,padding:p.spacing.small,border:"none",backgroundColor:"transparent",color:p.colors.primary,cursor:"pointer",fontSize:p.typography.fontSize.small,textDecoration:"underline"}},"Show less"))};return 0===E.length?(l("Facets: No facets to display",{hasResults:!!k,resultsType:k?typeof k:"null"}),null):t.createElement("div",{className:I(b.container,c),style:d},E.map((e,t)=>o?o(e,t):N(e)))},e.FederatedDropdown=ae,e.Fingerprint=v,e.FrequentlyBoughtTogether=({productId:e,items:r,loading:a=!1,showLoadingState:o=!1,title:n="Frequently Bought Together",maxItems:s=4,renderItem:i,onItemClick:l,className:c,style:d,theme:u,layout:m="horizontal",currencySymbol:p="$",showAddAllButton:g=!0,onAddAll:f})=>{const{theme:h}=S(),y=u||{},b=r?.slice(0,s)||[],v=a,x=t.useMemo(()=>b.reduce((e,t)=>{const r=t.price;return e+("number"==typeof r?r:parseFloat(String(r))||0)},0),[b]);return v&&0===b.length&&o?t.createElement("div",{className:I(y.root,c),style:d},t.createElement("div",{className:y.loading,style:z(h)},"Loading recommendations...")):v&&0===b.length||0===b.length?null:t.createElement("div",{className:I(y.root,c),style:d},n&&t.createElement("h3",{className:y.title,style:{margin:`0 0 ${h.spacing.medium} 0`,fontSize:h.typography.fontSize.large,fontWeight:h.typography.fontWeight?.semibold||600,color:h.colors.text}},n),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:h.spacing.medium,flexWrap:"wrap"}},b.map((e,r)=>t.createElement(t.Fragment,{key:e.id||r},r>0&&t.createElement("span",{style:{fontSize:"1.5rem",color:h.colors.textSecondary}},"+"),t.createElement("div",{onClick:()=>l?.(e,r),style:{cursor:l?"pointer":"default",textAlign:"center"}},i?i(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 h.borderRadius?h.borderRadius:h.borderRadius.small,border:`1px solid ${h.colors.border}`}}),t.createElement("div",{style:{marginTop:h.spacing.small,fontSize:h.typography.fontSize.small,color:h.colors.text}},p,"number"==typeof e.price?e.price.toFixed(2):e.price))))),g&&b.length>0&&t.createElement("div",{style:{marginLeft:"auto",textAlign:"center"}},t.createElement("div",{style:{fontSize:h.typography.fontSize.large,fontWeight:h.typography.fontWeight?.bold||700,color:h.colors.text,marginBottom:h.spacing.small}},"Total: ",p,x.toFixed(2)),t.createElement("button",{type:"button",onClick:()=>f?.(b),style:{padding:`${h.spacing.small} ${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"}},"Add all to cart"))))},e.GoogleDropdown=gr,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:m="name",items:p})=>{const{theme:g,stateManager:f}=S(),{results:h,refinements:y,addRefinement:b,removeRefinement:v}=w(),x=d||{},[k,E]=t.useState({}),C=t.useCallback(()=>{if(p)return p;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,p]),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"===m)return(t.count||0)-(e.count||0);if("isRefined"===m){if(e.isRefined&&!t.isRefined)return-1;if(!e.isRefined&&t.isRefined)return 1}return e.label.localeCompare(t.label)}),e},[C,m]),T=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]),z=(e,r)=>{if(!e||0===e.length)return null;const i=k[r]||!1,l=i?n:a,c=e.slice(0,l),d=e.length>l;return t.createElement("ul",{className:x.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,className:I(x.item,e.isRefined&&x.itemSelected,e.data&&e.data.length>0&&x.itemParent),style:{padding:`${g.spacing.small} 0`}},s?s(e,r):t.createElement(t.Fragment,null,t.createElement("button",{type:"button",onClick:()=>T(e,r),className:x.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:x.label,style:{flex:1}},e.label),void 0!==e.count&&t.createElement("span",{className:x.count,style:{color:g.colors.textSecondary,fontSize:g.typography.fontSize.small}},e.count)),e.isRefined&&e.data&&e.data.length>0&&z(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:x.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",{className:I(x.root,l),style:c},z(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}=S(),u=n||{},f=t.useMemo(()=>m({hit:e,attribute:r,preTag:"<mark>",postTag:"</mark>"}),[e,r]),h=t.useMemo(()=>{const t=p(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}=S(),{itemsPerPage:d,setPage:u}=w(),{stateManager:m}=S(),p=s||{},g=e.find(e=>e.default)||e[0],[f,h]=t.useState(g?.value||10);t.useEffect(()=>{l&&g&&d!==g.value&&m.setItemsPerPage(g.value,!1)},[]);const y=l?d:f,b=e=>{const t=parseInt(e.target.value,10);h(t),l&&(m.setItemsPerPage(t,!1),u(1,!0)),r&&r(t)};return a?t.createElement("div",{className:I(p.root,o),style:n},a({value:y,onChange:b,items:e})):t.createElement("div",{className:I(p.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("select",{value:y,onChange:b,className:p.select,style:{padding:c.spacing.small,paddingRight:c.spacing.medium,fontSize:c.typography.fontSize.medium,border:`1px solid ${c.colors.border}`,borderRadius:"string"==typeof c.borderRadius?c.borderRadius:c.borderRadius.medium,backgroundColor:c.colors.background,color:c.colors.text,cursor:"pointer",outline:"none"},"aria-label":"Results per page"},e.map(e=>t.createElement("option",{key:e.value,value:e.value,className:p.option},e.label))))},e.ImageDisplay=Be,e.ImageZoom=Pe,e.InfiniteHits=({renderHit:e,renderEmpty:r,showInitialLoading:a=!1,renderLoading:o,renderShowMore:n,showMoreButton:s=!0,useInfiniteScroll:i=!1,scrollThreshold:l=.1,fieldMapping:c,showMoreLabel:d="Show more",loadingLabel:u="Loading...",onHitClick:m,className:p,style:g,theme:f,syncWithState:h=!0})=>{const{theme:y,stateManager:b}=S(),{results:v,loading:x,currentPage:k,setPage:E}=w(),C=f||{},[R,N]=t.useState([]),[T,z]=t.useState(!1),M=t.useRef(null),A=t.useRef(k),_=t.useCallback(e=>e?e.results?e.results:e.hits?e.hits:Array.isArray(e)?e:[]:[],[]),L=t.useMemo(()=>_(v),[v,_]),P=v?.totalResults||v?.found||0,D=b.getState().itemsPerPage||10,B=Math.ceil(P/D),$=k>=B;t.useEffect(()=>{L.length&&(1===k?N(L):k>A.current&&N(e=>[...e,...L]),A.current=k,z(!1))},[L,k]),t.useEffect(()=>{1===k&&(N(L),A.current=1)},[v]);const F=t.useCallback(()=>{$||x||T||(z(!0),h&&E(k+1))},[$,x,T,h,E,k]);t.useEffect(()=>{if(!i||!M.current)return;const e=new IntersectionObserver(e=>{!e[0].isIntersecting||$||x||T||F()},{threshold:l});return e.observe(M.current),()=>e.disconnect()},[i,l,$,x,T,F]);const W=(e,t)=>{if(!c||!c[t])return e[t]||"";return e[c[t]]||""},q=()=>t.createElement("div",{className:C.loading,style:{padding:y.spacing.medium,textAlign:"center",color:y.colors.textSecondary}},u);return x&&0===R.length&&a?t.createElement("div",{className:I(C.root,p),style:g},o?o():q()):x&&0===R.length?t.createElement("div",{className:I(C.root,p),style:g}):x||0!==R.length?t.createElement("div",{className:I(C.root,p),style:g},t.createElement("div",{className:C.list},R.map((r,a)=>e?e(r,a):((e,r)=>{const a=W(e,"title")||e.title||"",o=W(e,"description")||e.description||"",n=W(e,"image")||e.image||e.imageUrl||"",s=W(e,"price")||e.price;return t.createElement("div",{key:e.id||r,className:C.item,style:{display:"flex",gap:y.spacing.medium,padding:y.spacing.medium,borderBottom:`1px solid ${y.colors.border}`,cursor:m?"pointer":"default",transition:y.transitions?.fast||"150ms ease-in-out"},onClick:()=>m?.(e,r),role:m?"button":void 0,tabIndex:m?0:void 0},n&&t.createElement("img",{src:n,alt:a,style:{width:"80px",height:"80px",objectFit:"cover",borderRadius:"string"==typeof y.borderRadius?y.borderRadius:y.borderRadius.small}}),t.createElement("div",{style:{flex:1}},t.createElement("h3",{style:{margin:0,marginBottom:y.spacing.small,fontSize:y.typography.fontSize.medium,fontWeight:y.typography.fontWeight?.semibold||600,color:y.colors.text}},a),o&&t.createElement("p",{style:{margin:0,fontSize:y.typography.fontSize.small,color:y.colors.textSecondary,lineHeight:y.typography.lineHeight?.normal||1.5}},o),s&&t.createElement("span",{style:{display:"inline-block",marginTop:y.spacing.small,fontSize:y.typography.fontSize.medium,fontWeight:y.typography.fontWeight?.bold||700,color:y.colors.primary}},"$","number"==typeof s?s.toFixed(2):s)))})(r,a))),s&&!i&&!$&&(n?n({isLoading:T,isLastPage:$,onClick:F}):t.createElement("button",{type:"button",onClick:F,disabled:$||T,className:I(C.loadMore,($||T)&&C.loadMoreDisabled),style:{display:"block",width:"100%",padding:y.spacing.medium,marginTop:y.spacing.medium,fontSize:y.typography.fontSize.medium,fontWeight:y.typography.fontWeight?.medium||500,backgroundColor:$||T?y.colors.hover:y.colors.primary,color:$||T?y.colors.textSecondary:"#ffffff",border:"none",borderRadius:"string"==typeof y.borderRadius?y.borderRadius:y.borderRadius.medium,cursor:$||T?"not-allowed":"pointer",transition:y.transitions?.fast||"150ms ease-in-out"}},T?u:$?"No more results":d)),T&&(o?o():q()),i&&!$&&t.createElement("div",{ref:M,className:C.sentinel,style:{height:"1px",visibility:"hidden"},"aria-hidden":"true"})):t.createElement("div",{className:I(C.root,p),style:g},r?r():t.createElement("div",{className:C.empty,style:{padding:y.spacing.large,textAlign:"center",color:y.colors.textSecondary}},"No results found"))},e.ItemCard=Ve,e.ItemGrid=Qe,e.MinimalDropdown=Lr,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:m=!0,showFilterCount:p=!0,closeOnBackdropClick:g=!0,closeOnEscape:f=!0})=>{const{theme:h}=S(),{refinements:y,clearRefinements:b}=w(),v=d||{},x=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&&x.current){const e=x.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 k=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:k,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:x,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),p&&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),m&&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,p&&y.length>0&&` (${y.length})`)))):null},e.MobileFiltersButton=({onClick:e,text:r="Filters",showCount:a=!0,className:o,style:n})=>{const{theme:s}=S(),{refinements:i}=w();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=_r,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:m})=>{const{theme:p}=S(),{results:g,currentPage:f,setPage:h}=w(),y=m||{},b=r||f,v=e||g,x=a||v?.perPage||v?.data?.per_page||v?.data?.data?.per_page||20,k=v?.totalResults||v?.data?.total_results||v?.data?.data?.total_results||0,E=o||v?.totalPages||v?.data?.total_pages||v?.data?.data?.total_pages||Math.ceil(k/x),C=e=>{e<1||e>E||e===b||(h(e),n&&n(e))};if(E<=1)return null;const R=(()=>{const e=[],t=Math.floor(s/2);let r=Math.max(1,b-t),a=Math.min(E,b+t);b<=t&&(a=Math.min(s,E)),b>=E-t&&(r=Math.max(1,E-s+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<E&&(a<E-1&&e.push("ellipsis"),e.push(E)),e})();return t.createElement("nav",{className:I(y.container,d),style:u,"aria-label":"Pagination"},t.createElement("ul",{className:y.list,style:{listStyle:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,flexWrap:"wrap"}},l&&t.createElement("li",null,t.createElement("button",{type:"button",disabled:1===b,onClick:()=>C(b-1),className:I(y.item,1===b&&y.itemDisabled),style:{padding:p.spacing.small,margin:`0 ${p.spacing.small}`,border:`1px solid ${p.colors.border}`,borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,backgroundColor:p.colors.background,color:p.colors.text,cursor:1===b?"not-allowed":"pointer",opacity:1===b?.5:1,fontSize:p.typography.fontSize.medium},"aria-label":"Previous page"},"Previous")),R.map((e,r)=>{if("ellipsis"===e)return t.createElement("li",{key:`ellipsis-${r}`},t.createElement("span",{className:y.ellipsis,style:{padding:p.spacing.small,margin:`0 ${p.spacing.small}`,color:p.colors.text,fontSize:p.typography.fontSize.medium}},"..."));const a=e===b,o=!1;return t.createElement("li",{key:e},c?c(e,a,o):((e,r,a)=>t.createElement("button",{type:"button",disabled:a,onClick:()=>C(e),className:I(y.item,r&&y.itemActive,a),style:{padding:p.spacing.small,margin:`0 ${p.spacing.small}`,border:`1px solid ${p.colors.border}`,borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,backgroundColor:r?p.colors.primary:p.colors.background,color:r?"#fff":p.colors.text,cursor:"pointer",opacity:1,fontSize:p.typography.fontSize.medium,minWidth:"40px",...r&&{fontWeight:"bold"}}},e))(e,a,o))}),l&&t.createElement("li",null,t.createElement("button",{type:"button",disabled:b===E,onClick:()=>C(b+1),className:I(y.item,b===E&&y.itemDisabled),style:{padding:p.spacing.small,margin:`0 ${p.spacing.small}`,border:`1px solid ${p.colors.border}`,borderRadius:"string"==typeof p.borderRadius?p.borderRadius:p.borderRadius.medium,backgroundColor:p.colors.background,color:p.colors.text,cursor:b===E?"not-allowed":"pointer",opacity:b===E?.5:1,fontSize:p.typography.fontSize.medium},"aria-label":"Next page"},"Next"))))},e.PinterestDropdown=vr,e.PriceDisplay=ht,e.ProductCard=Pt,e.ProductGallery=function({images:e,variant:r="thumbStrip",alt:a="Product",className:o,style:n,carouselAutoplay:s,carouselIntervalMs:i}){return t.createElement("div",{className:I("seekora-product-gallery",o),style:n},t.createElement(Be,{images:e,variant:r,alt:a,carouselAutoplay:s,carouselIntervalMs:i}))},e.ProductGrid=Dt,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:m,onSelectionChange:p,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,x=!g&&c&&c.length>0&&d&&m&&p;return t.createElement("div",{className:I("seekora-product-info",h),style:{display:"flex",flexDirection:"column",gap:12,...y}},l&&l.length>0&&t.createElement(vt,{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(ht,{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,x&&t.createElement(Vt,{options:c,variants:d,selections:m,onSelectionChange:p,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(Qe,{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,showLoadingState:i=!1,renderLoading:l,renderEmpty:c,showTitle:d=!1,title:u="Suggestions",className:m,style:p,theme:g})=>{const{client:f,theme:h}=S(),[y,b]=t.useState(-1),{suggestions:v,loading:x,error:k}=C({client:f,query:e,enabled:e.length>=o,debounceMs:a,maxSuggestions:r}),E=v.slice(0,r),w=g||{};if(e.length<o)return null;if(x&&0===E.length&&i)return t.createElement("div",{className:I(w.container,m),style:p},d&&t.createElement("div",{className:w.title,style:{fontSize:h.typography.fontSize.large,fontWeight:"bold",marginBottom:h.spacing.medium,color:h.colors.text}},u),l?l():t.createElement("div",{style:{padding:h.spacing.medium,textAlign:"center",color:h.colors.text}},"Loading suggestions..."));if(k||!x&&0===E.length)return t.createElement("div",{className:I(w.container,m),style:p},d&&t.createElement("div",{className:w.title,style:{fontSize:h.typography.fontSize.large,fontWeight:"bold",marginBottom:h.spacing.medium,color:h.colors.text}},u),c?c():t.createElement("div",{style:{padding:h.spacing.medium,textAlign:"center",color:h.colors.text,opacity:.6}},"No suggestions available"));const R=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:h.spacing.small}},"(",e.count,")")));return t.createElement("div",{className:I(w.container,m),style:p},d&&t.createElement("div",{className:w.title,style:{fontSize:h.typography.fontSize.large,fontWeight:"bold",marginBottom:h.spacing.medium,color:h.colors.text}},u),t.createElement("div",{className:w.suggestionsList},E.map((e,r)=>{const a=r===y;return t.createElement("div",{key:r,className:I(w.suggestionItem,a&&w.suggestionItemActive),onClick:()=>(e=>{n&&n(e.query)})(e),onMouseEnter:()=>b(r),onMouseLeave:()=>b(-1),style:{padding:h.spacing.medium,cursor:"pointer",borderRadius:"string"==typeof h.borderRadius?h.borderRadius:h.borderRadius.medium,transition:"background-color 0.2s ease",backgroundColor:a?h.colors.hover:"transparent",marginBottom:r<E.length-1?h.spacing.small:0}},R(e,r))})))},e.QuerySuggestionsDropdown=j,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:m,showApplyButton:p=!0,placeholder:g={min:"Min",max:"Max"},syncWithState:f=!0})=>{const{theme:h}=S(),{refinements:y,addRefinement:b,removeRefinement:v}=w(),x=m||{},k=t.useMemo(()=>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},[f,y,e]),[E,C]=t.useState(n??k.min),[R,N]=t.useState(s??k.max),[T,z]=t.useState(n??k.min),[M,A]=t.useState(s??k.max);t.useEffect(()=>{f&&(k.min===T&&k.max===M||(C(k.min),N(k.max),z(k.min),A(k.max)))},[f,k.min,k.max]);const _=void 0!==n?n:E,L=void 0!==s?s:R,P=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]),D=t.useCallback(e=>{const t=""===e.target.value?void 0:parseFloat(e.target.value);C(t),p||(P(t,L),l&&l(t,L))},[L,p,l,P]),B=t.useCallback(e=>{const t=""===e.target.value?void 0:parseFloat(e.target.value);N(t),p||(P(_,t),l&&l(_,t))},[_,p,l,P]),$=t.useCallback(()=>{z(E),A(R),P(E,R),l&&l(E,R)},[E,R,l,P]),F=t.useCallback(()=>{C(void 0),N(void 0),z(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(x.container,d),style:u},c({min:_,max:L,onMinChange:e=>{C(e),!p&&l&&l(e,L)},onMaxChange:e=>{N(e),!p&&l&&l(_,e)},onApply:$})):t.createElement("div",{className:I(x.container,d),style:u},r&&t.createElement("label",{className:x.label,style:{display:"block",fontSize:h.typography.fontSize.medium,fontWeight:"bold",marginBottom:h.spacing.small,color:h.colors.text}},r),t.createElement("div",{className:x.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:D,placeholder:g.min,className:I(x.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:x.separator,style:{color:h.colors.text,opacity:.7}},"to"),t.createElement("input",{type:"number",min:a,max:o,step:i,value:void 0!==L?L:"",onChange:B,placeholder:g.max,className:I(x.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"}}),p&&t.createElement("button",{type:"button",onClick:$,className:x.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!==T||void 0!==M||void 0!==_||void 0!==L)&&t.createElement("button",{type:"button",onClick:F,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=({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:m,showValues:p=!0,syncWithState:g=!0,debounceMs:f=300})=>{const{theme:h}=S(),{refinements:y,addRefinement:b,removeRefinement:v}=w(),x=m||{},k=t.useMemo(()=>{if(!g)return{min:void 0,max:void 0};let t,r;return 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]))}}),{min:t,max:r}},[g,y,e]),[E,C]=t.useState(s??k.min??a),[R,N]=t.useState(i??k.max??o),[T,z]=t.useState(!1),M=t.useRef(null);t.useEffect(()=>{g&&!T&&(void 0!==k.min?C(k.min):C(a),void 0!==k.max?N(k.max):N(o))},[g,k.min,k.max,T,a,o]);const A=t.useCallback((t,r)=>{g&&(y.forEach(t=>{t.field===e&&v(e,t.value,!1)}),t>a&&b(e,`>=${t}`,!1),r<o&&b(e,`<=${r}`,t<=a),t>a&&r>=o&&b(e,`>=${t}`,!0))},[g,e,y,b,v,a,o]),_=t.useCallback((e,t)=>{M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{A(e,t),l&&l(e,t)},f)},[A,l,f]),L=()=>{z(!1)},P=(E-a)/(o-a)*100,D=(R-a)/(o-a)*100;return t.createElement("div",{className:I(x.root,d),style:{fontFamily:"inherit",...u}},r&&t.createElement("label",{className:x.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:x.slider,style:{position:"relative",height:"40px",display:"flex",alignItems:"center"}},t.createElement("div",{className:x.track,style:{position:"absolute",width:"100%",height:"4px",backgroundColor:h.colors.border,borderRadius:"2px"}}),t.createElement("div",{className:x.trackFilled,style:{position:"absolute",left:`${P}%`,width:D-P+"%",height:"4px",backgroundColor:h.colors.primary,borderRadius:"2px"}}),t.createElement("input",{type:"range",min:a,max:o,step:n,value:E,onChange:e=>{const t=Math.min(Number(e.target.value),R-n);C(t),z(!0),_(t,R)},onMouseUp:L,onTouchEnd:L,className:x.thumb,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:R,onChange:e=>{const t=Math.max(Number(e.target.value),E+n);N(t),z(!0),_(E,t)},onMouseUp:L,onTouchEnd:L,className:x.thumb,style:{position:"absolute",width:"100%",height:"4px",background:"transparent",WebkitAppearance:"none",appearance:"none",cursor:"pointer",pointerEvents:"none"},"aria-label":`Maximum ${r||e}`})),p&&t.createElement("div",{className:x.values,style:{display:"flex",justifyContent:"space-between",marginTop:h.spacing.small,fontSize:h.typography.fontSize.small,color:h.colors.textSecondary}},t.createElement("span",{className:x.value},c(E)),t.createElement("span",{className:x.value},c(R))),t.createElement("style",null,`\n .${x.thumb||"seekora-range-slider__thumb"}::-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: 0 2px 4px rgba(0,0,0,0.2);\n }\n .${x.thumb||"seekora-range-slider__thumb"}::-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: 0 2px 4px rgba(0,0,0,0.2);\n }\n `))},e.RatingDisplay=St,e.RecentSearchesList=Ft,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[m,p]=t.useState([]);t.useEffect(()=>{if(!r)try{const t=localStorage.getItem(e);t&&p(JSON.parse(t))}catch(e){}},[e,r]);const g=(r||m).slice(0,o);return 0===g.length?null:t.createElement(N,{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,showLoadingState:o=!1,title:n="Related Products",maxItems:s=6,renderItem:i,onItemClick:l,className:c,style:d,theme:u,layout:m="horizontal",currencySymbol:p="$"})=>{const{theme:g}=S(),f=u||{},h=r?.slice(0,s)||[],y=a;return y&&0===h.length&&o?t.createElement("div",{className:I(f.root,c),style:d},t.createElement("div",{className:f.loading,style:z(g)},"Loading related products...")):y&&0===h.length||0===h.length?null:t.createElement(N,{title:n,items:h,renderItem:i,onItemClick:l,className:c,style:d,theme:u,layout:m,currencySymbol:p})},e.RichQuerySuggestions=K,e.SearchBar=({placeholder:e="Search...",showSuggestions:r=!0,debounceMs:a=300,minQueryLength:o=2,maxSuggestions:n=10,onSearch:s,onQueryChange:i,onSuggestionSelect:d,onSearchStateChange:u,searchOptions:m,className:p,style:g,theme:f,showLoadingState:h=!1,renderSuggestion:y,renderLoading:b})=>{const{client:v,theme:x,enableAnalytics:k,autoTrackSearch:E}=S(),{query:R,setQuery:N,search:T,results:z,loading:M,error:A}=w(),[_,L]=t.useState(!1),[P,D]=t.useState(-1),B=t.useRef(null),$=t.useRef(null),F=t.useRef(!1),{suggestions:W,loading:q}=C({client:v,query:R,enabled:r&&R.length>=o,debounceMs:a,maxSuggestions:n}),H=W.slice(0,n);t.useEffect(()=>{u&&u({results:z,loading:M,error:A})},[z,M,A,u]),t.useEffect(()=>{z&&s&&s(R,z)},[z,R,s]),t.useEffect(()=>{i&&i(R)},[R,i]);const O=t.useCallback(async e=>{const t=e.trim();c("SearchBar: Triggering search",{query:t,originalQuery:e,isEmpty:!t}),F.current=!0,L(!1),D(-1),N(t,!1),c("SearchBar: Calling search() directly"),await T(),setTimeout(()=>{B.current?.blur(),setTimeout(()=>{F.current=!1},50)},100)},[N,T]),j=t.useCallback(e=>{l("SearchBar: Suggestion selected",{suggestion:e}),D(-1),L(!1),B.current?.blur(),d&&d(e),N(e)},[d,N]),V=t.useCallback(e=>{const t=e.target.value;N(t,!1),D(-1)},[N]),U=t.useCallback(e=>{switch(e.key){case"ArrowDown":r&&H.length>0&&(e.preventDefault(),D(e=>e<H.length-1?e+1:e));break;case"ArrowUp":r&&H.length>0&&(e.preventDefault(),D(e=>e>0?e-1:-1));break;case"Enter":if(e.preventDefault(),e.stopPropagation(),r&&H.length>0&&P>=0&&P<H.length)j(H[P].query);else{const e=B.current?.value||R;O(e)}break;case"Escape":L(!1),B.current?.blur()}},[H,P,R,r,O,j]),Q=t.useCallback(()=>{L(!0)},[]),G=t.useCallback(e=>{F.current||setTimeout(()=>{$.current?.contains(document.activeElement)||(L(!1),D(-1))},200)},[]),X=(e,r)=>t.createElement("div",{key:r},e),Y=f||{},K=q||M,Z=H.length>0,J=_&&r&&R.length>=o&&(Z||K&&h),ee=z,te=ee?.processingTimeMS||ee?.data?.processingTimeMS||ee?.data?.data?.processingTimeMS;return t.createElement("div",{ref:$,className:I(Y.container,p),style:{position:"relative",display:"flex",alignItems:"center",...g}},t.createElement("input",{ref:B,type:"text",value:R,onChange:V,onKeyDown:U,onFocus:Q,onBlur:G,placeholder:e,className:I(Y.input,_&&Y.inputFocused),style:{flex:1,padding:x.spacing.medium,fontSize:x.typography.fontSize.medium,fontFamily:x.typography.fontFamily,backgroundColor:x.colors.background,color:x.colors.text,borderWidth:"1px",borderStyle:"solid",borderColor:_?x.colors.focus:x.colors.border,borderRadius:"string"==typeof x.borderRadius?x.borderRadius:x.borderRadius.medium,outline:"none",..._&&{boxShadow:x.shadows.small}}}),void 0!==te&&t.createElement("span",{style:{marginLeft:x.spacing.small,fontSize:x.typography.fontSize.small,color:x.colors.text,opacity:.7,whiteSpace:"nowrap"}},te,"ms"),J&&t.createElement("div",{className:Y.suggestionsContainer,style:{position:"absolute",top:"100%",left:0,right:0,marginTop:x.spacing.small,backgroundColor:x.colors.background,border:`1px solid ${x.colors.border}`,borderRadius:"string"==typeof x.borderRadius?x.borderRadius:x.borderRadius.medium,boxShadow:x.shadows.medium,maxHeight:"400px",overflowY:"auto",zIndex:1e3}},K&&0===H.length&&h&&(b?b():t.createElement("div",{style:{padding:x.spacing.medium,textAlign:"center"}},"Loading suggestions...")),H.length>0&&t.createElement(t.Fragment,null,H.map((e,r)=>{const a=r===P,o=y||X;return t.createElement("div",{key:r,className:I(Y.suggestionItem,a&&Y.suggestionItemActive),onClick:()=>j(e.query),onMouseEnter:()=>D(r),style:{padding:x.spacing.medium,cursor:"pointer",backgroundColor:a?x.colors.hover:"transparent",color:x.colors.text,transition:x.transitions?.fast||"150ms ease-in-out"}},o(e.query,r))})),!K&&0===H.length&&R.length>=o&&t.createElement("div",{style:{padding:x.spacing.medium,textAlign:"center",color:x.colors.textSecondary}},"No suggestions found")))},e.SearchBarWithSuggestions=ve,e.SearchInput=Re,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}=S(),u=l||{},[m,p]=t.useState(!1);return t.useEffect(()=>{const e=()=>{p(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement("div",{className:I(u.container,s),style:{display:"flex",flexDirection:"column",minHeight:"100vh",backgroundColor:d.colors.background,...i}},a&&t.createElement("header",{className:u.header,style:{padding:d.spacing.medium,borderBottom:`1px solid ${d.colors.border}`,backgroundColor:d.colors.background}},a),t.createElement("div",{style:{display:"flex",flex:1,gap:d.spacing.large,padding:d.spacing.medium,backgroundColor:d.colors.background,color:d.colors.text}},e&&(!m||c)&&t.createElement("aside",{className:u.sidebar,style:{width:n,minWidth:n}},e),t.createElement("main",{className:u.main,style:{flex:1,minWidth:0,backgroundColor:d.colors.background,color:d.colors.text}},r)),o&&t.createElement("footer",{className:u.footer,style:{padding:d.spacing.medium,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})=>{const i=t.useMemo(()=>r?k(r):x,[r]),l=t.useMemo(()=>new f({client:e,autoSearch:!0,debounceMs:300,itemsPerPage:10,defaultSearchOptions:{widget_mode:!0},...n}),[e,n]),c=t.useMemo(()=>({client:e,theme:i,enableAnalytics:a,autoTrackSearch:o,stateManager:l}),[e,i,a,o,l]);return t.createElement(E.Provider,{value:c},s)},e.SearchResults=({results:e,loading:r,error:a,onResultClick:o,renderResult:n,renderEmpty:s,showLoadingState:i=!1,renderLoading:c,renderError:m,className:p,style:g,theme:f,itemsPerPage:h=20,showPagination:y=!1,viewMode:b="list",fieldMapping:v,extractResults:x,enableKeyboardNavigation:k=!0,autoFocus:E=!1})=>{const{theme:C,client:R,enableAnalytics:N}=S(),{results:T,loading:z,error:M,currentPage:A,itemsPerPage:_}=w(),L=f||{},[P,D]=t.useState(-1),B=t.useRef(null),$=void 0!==e?e:T,F=void 0!==r?r:z,W=void 0!==a?a:M;t.useEffect(()=>{D(-1)},[$]),t.useEffect(()=>{if(P>=0&&B.current&&k){const e=B.current.querySelector(`[data-result-index="${P}"]`);e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[P,k]);const q=t.useCallback(e=>{if(!k)return;const t=B.current?.querySelectorAll("[data-result-index]"),r=t?t.length-1:-1;switch(e.key){case"ArrowDown":e.preventDefault(),D(e=>Math.min(e+1,r));break;case"ArrowUp":e.preventDefault(),D(e=>Math.max(e-1,-1));break;case"Enter":if(e.preventDefault(),P>=0){const e=B.current?.querySelector(`[data-result-index="${P}"]`);e&&e.click()}break;case"Escape":D(-1),B.current?.blur();break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),D(r)}},[k,P]),H="card"===b||"grid"===b?(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(L.resultItem,n&&L.resultItemHover),onClick:async()=>{if(N&&r.id)try{const t=e||T,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:()=>k&&D(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:L.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:L.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:L.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(L.resultItem,n&&L.resultItemHover),onClick:async()=>{if(N&&r.id)try{const t=e||T,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:()=>k&&D(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:L.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:L.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:L.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:L.resultPrice,style:{fontSize:C.typography.fontSize.medium,fontWeight:"bold",color:C.colors.primary}},r.price)));let O=[];if(x)O=x($)||[];else if($){const e=$;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($)?O=$: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",...v},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),m=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,p={};j.custom&&Object.entries(j.custom).forEach(([t,r])=>{p[t]=V(e,r)});return{id:u,title:s,description:i,url:d,image:l,price:m,metadata:e,...p,...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}}}),Q={...g},G={..."grid"===b&&{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:C.spacing.medium},..."card"===b&&{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:b,hasError:!!W,isLoading:F}),F&&0===U.length&&i)return l("SearchResults: Rendering loading state"),t.createElement("div",{className:I(L.container,p),style:g},c?c():t.createElement("div",{className:L.loadingState,style:{padding:C.spacing.large,textAlign:"center",color:C.colors.text}},"Loading results..."));if(W)return u("SearchResults: Rendering error state",{error:W.message,stack:W.stack}),t.createElement("div",{className:I(L.container,p),style:g},m?m(W):(X=W,t.createElement("div",{className:L.errorState,style:{padding:C.spacing.large,textAlign:"center",color:C.colors.error}},"Error: ",X.message)));var X;if(!$||0===U.length)return l("SearchResults: No results to display"),t.createElement("div",{className:I(L.container,p),style:g},s?s():t.createElement("div",{className:L.emptyState,style:{padding:C.spacing.large,textAlign:"center",color:C.colors.text}},"No results found"));const Y=n||H;return t.createElement("div",{ref:B,className:I(L.container,p),style:Q,tabIndex:k?0:void 0,onKeyDown:q,role:"listbox","aria-label":"Search results","aria-activedescendant":P>=0?`result-${P}`:void 0},(void 0!==$?.totalResults||void 0!==$?.data?.total_results)&&U.length>0&&t.createElement("div",{className:L.header,style:{marginBottom:C.spacing.medium,fontSize:C.typography.fontSize.medium,color:C.colors.text}},"Found ",$?.totalResults||$?.data?.total_results||0," result",1!==($?.totalResults||$?.data?.total_results||0)?"s":""),k&&U.length>0&&t.createElement("div",{style:{fontSize:"12px",color:C.colors.text,opacity:.6,marginBottom:C.spacing.small,display:"flex",gap:"8px",alignItems:"center"}},t.createElement("span",{style:{display:"inline-flex",gap:"4px",padding:"2px 6px",backgroundColor:C.colors.hover,borderRadius:"4px",fontSize:"11px"}},"↑↓ navigate"),t.createElement("span",{style:{display:"inline-flex",gap:"4px",padding:"2px 6px",backgroundColor:C.colors.hover,borderRadius:"4px",fontSize:"11px"}},"↵ select")),t.createElement("div",{className:L.resultsList,style:G},U.map((e,t)=>Y(e,t,t===P))))},e.SectionError=Yt,e.SectionItemGrid=function({columns:e=4,maxItems:r=12,className:a,style:o,showLoadingState:n=!1,getItemId:s=e=>e.id??String(e?.objectID??""),getItemTitle:i=e=>e.title??e?.title??"",getItemImage:l=e=>e.image??e?.image,getItemDescription:c=e=>e.description??e?.description,getItemUrl:d=e=>e.url??e?.url,renderItem:u}){const{items:m,loading:p,error:g,trackClick:f}=Gt();return p&&0===m.length&&n?t.createElement(Xt,{className:a,style:o}):g?t.createElement(Yt,{className:a,style:o}):t.createElement(Qe,{items:m,maxItems:r,columns:e,className:a,style:o,getItemId:s,getItemTitle:i,getItemImage:l,getItemDescription:c,getItemUrl:d,renderItem:u,onItemClick:(e,t)=>f(e,t)})},e.SectionLoading=Xt,e.SectionSearchProvider=function({children:e,query:r,refinements:a=[],maxItems:o=12,sortBy:n,enabled:s=!0,sectionId:i}){const{client:l}=S(),[c,d]=t.useState([]),[u,m]=t.useState(!0),[p,g]=t.useState(null),[f,h]=t.useState(0);t.useEffect(()=>{if(!s||!l?.search)return d([]),m(!1),g(null),void h(0);let e=!1;m(!0),g(null);const t={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(",")),l.search(r,t).then(t=>{e||(d(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)),h(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||(g(t instanceof Error?t:new Error(String(t))),d([]),m(!1))}),()=>{e=!0}},[l,s,r,o,n,a]);const y=t.useCallback((e,t)=>{if(!l?.trackEvent)return;const r=e?.id??e?.objectID;l.trackEvent({event_name:"section_result_click",clicked_item_id:r,position:t,section:i,metadata:{section_id:i}},void 0)},[l,i]),b=t.useMemo(()=>({items:c,loading:u,error:p,totalCount:f,sectionId:i,trackClick:y}),[c,u,p,f,i,y]);return t.createElement(Qt.Provider,{value:b},e)},e.ShopifyDropdown=Ir,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}=S(),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=m({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=p(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"},x=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},x)},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})=>{const{theme:u}=S(),{sortBy:m,setSortBy:p}=w(),g=l||{},[f,h]=t.useState(a||e[0]?.value||"");t.useEffect(()=>{d&&a&&!m&&p(a,!1)},[]);const y=void 0!==r?r:d&&m?m:f,b=e=>{const t=e.target.value;h(t),d&&p(t),o&&o(t)};return n?t.createElement("div",{className:I(g.container,s),style:i},n({value:y,onChange:b,options:e})):t.createElement("select",{value:y,onChange:b,className:I(g.select,s),style:{padding:u.spacing.small,paddingRight:u.spacing.medium,fontSize:u.typography.fontSize.medium,border:`1px solid ${u.colors.border}`,borderRadius:"string"==typeof u.borderRadius?u.borderRadius:u.borderRadius.medium,backgroundColor:u.colors.background,color:u.colors.text,cursor:"pointer",outline:"none",...i},"aria-label":"Sort results"},e.map(e=>t.createElement("option",{key:e.value,value:e.value,className:g.option},e.label)))},e.SpotlightDropdown=wr,e.Stats=({results:e,renderStats:r,className:a,style:o,theme:n,showProcessingTime:s=!1,showQuery:i=!1,separator:l=" • "})=>{const{theme:c}=S(),d=n||{},u=e,m=u?.totalResults||u?.data?.total_results||u?.data?.data?.total_results||0,p=u?.processingTimeMS||u?.data?.processingTimeMS||u?.data?.data?.processingTimeMS,g=u?.query??"";return r?t.createElement("div",{className:I(d.container,a),style:o},r({totalResults:m,processingTime:p,query:g})):(()=>{const e=[];return m>0?e.push(`${m.toLocaleString()} result${1!==m?"s":""}`):e.push("No results"),s&&void 0!==p&&e.push(`${p}ms`),i&&g&&e.push(`for "${g}"`),t.createElement("div",{className:I(d.container,a),style:{fontSize:c.typography.fontSize.medium,color:c.colors.text,...o}},e.map((e,r)=>t.createElement("span",{key:r},r>0&&t.createElement("span",{className:d.separator,style:{margin:`0 ${c.spacing.small}`}},l),t.createElement("span",{className:d.text},e))))})()},e.SuggestionDropdownVariants=$r,e.SuggestionItem=Ae,e.SuggestionList=Le,e.SuggestionSearchBar=Br,e.SuggestionsDropdownComposition=function({showRecentSearches:e=!0,showTrending:r=!0,showTabs:a=!0,showProducts:o=!0,placeholder:n,...s}){return t.createElement(Ee,{...s},t.createElement("div",{className:"seekora-suggestions-dropdown-composition",style:{position:"relative",width:"100%"}},t.createElement(Re,{placeholder:n}),t.createElement(Ne,null,t.createElement(Ht,null),e?t.createElement(Ft,null):null,t.createElement(Le,null),a?t.createElement(Bt,null):null,o?t.createElement(Dt,null):null,r?t.createElement(qt,null):null)))},e.SuggestionsError=Ht,e.SuggestionsLoading=function({className:e,style:r,text:a="Loading..."}){const{loading:o}=ke();return o?t.createElement("div",{className:I("seekora-suggestions-loading",e),style:{padding:16,color:"var(--seekora-text-secondary, #6b7280)",fontSize:"0.875rem",...r}},a):null},e.SuggestionsProvider=Ee,e.TrendingItems=({items:e,loading:r=!1,showLoadingState:a=!1,title:o="Trending Now",maxItems:n=8,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u="horizontal",currencySymbol:m="$"})=>{const{theme:p}=S(),g=d||{},f=e?.slice(0,n)||[],h=r;return h&&0===f.length&&a?t.createElement("div",{className:I(g.root,l),style:c},t.createElement("div",{className:g.loading,style:z(p)},"Loading trending items...")):h&&0===f.length||0===f.length?null:t.createElement(N,{title:o,items:f,renderItem:s,onItemClick:i,className:l,style:c,theme:d,layout:u,currencySymbol:m})},e.TrendingList=qt,e.VariantSelector=Vt,e.VariantSwatches=Ct,e.addRecentSearch=dt,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=ua,e.breakpoints=Kt,e.clearRecentSearches=e=>{try{const t=e?`${lt}_${e}`:lt;localStorage.removeItem(t)}catch{}},e.clearSuggestionsCache=()=>{gt?.clear()},e.createSuggestionsCache=e=>new pt(e),e.createSuggestionsTheme=function(e="light",t={},r){return{...{light:la,dark:ca,minimal:da}[e],...r?ua[r]:{},...t}},e.createTheme=k,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=ca,e.defaultTheme=x,e.extractBadges=tt,e.extractBrand=(e,t={name:"name"})=>({id:t.id?Ge(e,t.id):e?.id,name:Ge(e,t.name)??"",logo:t.logo?Ge(e,t.logo):void 0,count:t.count?Ge(e,t.count):void 0,_raw:e}),e.extractCategory=Ke,e.extractProduct=Ye,e.extractSuggestion=Xe,e.findVariantBySelections=ot,e.formatParsedFilters=function(e){return e.map(e=>`${e.field}: ${e.value}`).join(", ")},e.formatPriceRange=(e,t={})=>`${Ze(e.min,t)} - ${Ze(e.max,t)}`,e.formatSuggestionPrice=Ze,e.generateSuggestionsStylesheet=ma,e.getAvailableValuesForOption=at,e.getFingerprint=async function(e){return new v(e).get()},e.getPriceRange=rt,e.getRecentSearches=ct,e.getShortcutText=ea,e.getSuggestionsCache=ft,e.highlightText=et,e.injectGlobalResponsiveStyles=rr,e.injectSuggestionsStyles=ga,e.lightThemeVariables=la,e.mediaQueries=Zt,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=da,e.parseHighlightMarkup=ze,e.removeRecentSearch=ut,e.touchTargets=Jt,e.updateSuggestionsStyles=function(e){ga(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(Ut),e.useDocSearch=oa,e.useDocSearchSeekoraSearch=na,e.useInjectResponsiveStyles=ar,e.useKeyboard=Jr,e.useNaturalLanguageFilters=function(e={}){const{fieldMappings:r={},valueMappings:a={},autoApply:o=!1,currencySymbol:n="$"}=e,{addRefinement:s,removeRefinement:i,clearRefinements:l,setQuery:c}=w(),d=t.useMemo(()=>({...ia,colors:[...ia.colors,...a.color?Object.keys(a.color):[]],sizes:{...ia.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]),m=t.useCallback(e=>{e.forEach(e=>{s(e.field,e.value,!1)}),e.length},[s]),p=t.useCallback(e=>{const t=u(e);return t.hasFilters&&(m(t.filters),t.cleanedQuery!==e&&c(t.cleanedQuery,!0)),t},[u,m,c]);return{parse:u,applyFilters:m,parseAndApply:p}},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),m=t.useRef(null),p=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]),x=t.useCallback(e=>{m.current&&(m.current.disconnect(),m.current=null),p.current=e,e&&c&&!u.current&&"undefined"!=typeof IntersectionObserver&&(m.current=new IntersectionObserver(e=>{for(const t of e)t.isIntersecting&&!u.current&&(u.current=!0,f("product.impression",{}),m.current?.disconnect())},{threshold:.5}),m.current.observe(e))},[c,f]);return t.useEffect(()=>()=>{m.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:x,trackClick:h,trackVariantSelect:y,trackAddToCart:b,trackCustomEvent:v}},e.useQuerySuggestions=C,e.useQuerySuggestionsEnhanced=$,e.useResponsive=er,e.useSearchContext=S,e.useSearchState=w,e.useSectionSearchContext=Gt,e.useSeekoraSearch=({client:e,autoTrack:r=!0})=>{const[a,o]=t.useState(null),[n,s]=t.useState(!1),[i,d]=t.useState(null),[m,p]=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&&p(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),p(null),null}finally{s(!1)}},[e]);return{search:g,results:a,loading:n,error:i,context:m,clearResults:t.useCallback(()=>{o(null),d(null),p(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}=S(),[m,p]=t.useState([]),[g,f]=t.useState(!1),[h,y]=t.useState(null),[b,v]=t.useState(null),[x,k]=t.useState([]),[E,w]=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=sa(e,R);k(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);w(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?(p([]),k([]),w([]),void v(null)):(f(!0),C.current=setTimeout(async()=>{try{const t=await I(e);p(t),y(null)}catch(e){y(e instanceof Error?e:new Error(String(e))),p([])}finally{f(!1)}},n),()=>{C.current&&clearTimeout(C.current)})),[e,a,n,I]),{suggestions:m,loading:g,error:h,detectedIntent:b,corrections:x,expansions:E,getSuggestions:N,clear:t.useCallback(()=>{p([]),k([]),w([]),v(null),y(null)},[])}},e.useSuggestionsAnalytics=fe,e.useSuggestionsContext=ke,e.useVariantSelection=function({options:e=[],variants:r=[],initialSelections:a={},onVariantChange:o}={}){const[n,s]=t.useState(a),i=t.useMemo(()=>ot(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]=at(a.name,e,r,n);return t},[e,r,n]),d=i?.price??null,u=i?.comparePrice??null,m=t.useCallback((t,a)=>{s(n=>{const s={...n,[t]:a},i=ot(e,r,s);return o?.(i,s),s})},[e,r,o]),p=t.useCallback(()=>{s({}),o?.(null,{})},[o]);return{selections:n,setSelection:m,resetSelections:p,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,...m}=r,p=t.useRef(null),g=t.useRef(!1),f=s(m),h=i(m),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||!p.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(p.current),()=>e.disconnect()},[o,c,y]),t.createElement("div",{ref:e=>{p.current=e,"function"==typeof l?l(e):l&&(l.current=e)},onClick:b,style:{display:"contents"}},t.createElement(e,{...m}))});return c.displayName=`withAnalytics(${l})`,c}});