(globalThis.blocksyJsonP=globalThis.blocksyJsonP||[]).push([[662],{2485:function(e,t){var n; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t!i.includes(e)),c=e=>(e=>s.includes(e))(e)?document.createElementNS("http://www.w3.org/2000/svg",e):e===DocumentFragment?document.createDocumentFragment():document.createElement(e),l=(e,t,n)=>{null!=n&&(/^xlink[AHRST]/.test(t)?e.setAttributeNS("http://www.w3.org/1999/xlink",t.replace("xlink","xlink:").toLowerCase(),n):e.setAttribute(t,n))},u=(e,t,n)=>{const r=c(e);return Object.keys(t).forEach(e=>{const n=t[e];if("class"===e||"className"===e)l(r,"class",n);else if("style"===e)((e,t)=>{Object.keys(t).forEach(n=>{let r=t[n];"number"!=typeof r||a.test(n)||(r+="px"),e.style[n]=r})})(r,n);else if(0===e.indexOf("on")){const t=e.slice(2).toLowerCase();r.addEventListener(t,n)}else"dangerouslySetInnerHTML"===e?r.innerHTML=n.__html:"key"!==e&&!1!==n&&l(r,e,!0===n?"":n)}),t.dangerouslySetInnerHTML||r.appendChild(n),r};function f(e,t){const n=[].slice.apply(arguments,[2]),r=document.createDocumentFragment();return o(n).forEach(e=>{e instanceof Node?r.appendChild(e):"boolean"!=typeof e&&null!=e&&r.appendChild(document.createTextNode(e))}),u(e,t||{},r)}const p={createElement:f,Fragment:"function"==typeof DocumentFragment?DocumentFragment:()=>{}};e.exports=p,e.exports.h=f,e.exports.default=p},4218:function(e){"use strict";e.exports=JSON.parse('["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","animation","audio","canvas","circle","clipPath","color-profile","cursor","defs","desc","discard","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","handler","hatch","hatchpath","hkern","iframe","image","line","linearGradient","listener","marker","mask","mesh","meshgradient","meshpatch","meshrow","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","script","set","solidColor","solidcolor","stop","style","svg","switch","symbol","tbreak","text","textArea","textPath","title","tref","tspan","unknown","use","video","view","vkern"]')},6531:function(e){"use strict"; /*! * arr-flatten * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */function t(e,n){for(var r,o=0,a=e.length;o0&&void 0!==arguments[0]?arguments[0]:{};if(t=function(e){for(var t=1;t-1?"&":"?"}${f.toString()}`};function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"";return y&&(y.abort("New request"),y=null),g[e]?new Promise(function(t){t(g[e]),g[e]=g[e].clone()}):("AbortController"in window&&(y=new AbortController),fetch(e,{signal:y.signal,headers:t?{"X-WP-Nonce":t}:{}}).then(function(t){return g[e]=t.clone(),y=null,t}))},_=function(e){let{hasThumbs:t,post:{title:n,url:r,_embedded:a={},ct_featured_media:s,product_price:c=0,product_status:l="",placeholder_image:u=null}}=e;const f=(p=n,(new DOMParser).parseFromString(p,"text/html").documentElement.textContent);var p;const d={sizes:{thumbnail:{source_url:u}}},h=((null==s?void 0:s.media_details)||d).sizes||{};return(0,o.h)("a",{className:"ct-search-item",role:"option",key:r,href:r},(s||u)&&t&&(0,o.h)("span",{class:i()({"ct-media-container":!0})},(0,o.h)("img",{src:h.thumbnail?null==h?void 0:h.thumbnail.source_url:O(h).reduce(function(e,t){return t.width1&&void 0!==arguments[1]?arguments[1]:{};const n=function(n){"modal"!==d({mode:"inline"},t).mode&&(e.contains(n.target)||b(e.querySelector(".ct-search-results")))},r=e.querySelector('input[type="search"]'),a=d({postType:"any",mode:"inline",perPage:5},t);if(!r||!window.fetch)return;let i=(u=async function(t){var r;if(document.removeEventListener("click",n),document.addEventListener("click",n),0===t.target.value.trim().length){b(e.querySelector(".ct-search-results"));let t=e.querySelector("[aria-live]");return void(t&&(t.innerHTML=ct_localizations.search_live_no_result))}if(null!==(r=t.target.dataset)&&void 0!==r&&r.minLength){const e=parseInt(t.target.dataset.minLength,10);if(t.target.value.trim().length-1){const e=f.filter(function(e){return"product"===e.subtype});if(!e.every(function(e){return m[e.id]})){const t=`${ct_localizations.rest_url}wc/store/products`,n=new URLSearchParams;n.append("include",e.filter(function(e){return!m[e.id]}).map(function(e){return e.id}).sort().join(","));const r=await v(`${t}?${n.toString()}`,u?u.value:"");(await r.json()).forEach(function(e){m[e.id]={price_html:e.price_html,is_in_stock:e.is_in_stock}})}f.forEach(function(e){if("product"!==e.subtype)return;const t=m[e.id];t&&(e.product_price=t.price_html||"",e.product_status=null!=t&&t.is_in_stock?ct_localizations.search_live_stock_status_texts.instock:ct_localizations.search_live_stock_status_texts.outofstock)})}if(h)return;h=!0,e.classList.remove("ct-searching");let p=!!e.querySelector(".ct-search-results"),d=e.querySelector(".ct-search-results"),{height:g}=d?d.getBoundingClientRect():0;d&&0!==t.target.value.trim().length&&0!==f.length?d&&e.removeChild(d):0!==t.target.value.trim().length&&0!==f.length||b(d);let y=ct_localizations.search_live_no_result;f.length>0&&t.target.value.trim().length>0&&(y=(f.length>1?ct_localizations.search_live_many_results:ct_localizations.search_live_one_result).replace("%s",f.length));let w=e.querySelector("[aria-live]");if(w&&(w.innerHTML=y),f.length>0&&t.target.value.trim().length>0){let n=(0,o.h)("div",{class:"ct-search-results",role:"listbox","aria-label":ct_localizations.search_live_results},f.filter(function(e){return null==e?void 0:e.id}).map(function(t){return _({post:t,hasThumbs:(e.dataset.liveResults||"").indexOf("thumbs")>-1})}),r>a.perPage?(0,o.h)("a",{className:"ct-search-more",role:"option",href:ct_localizations.search_url.replace(/QUERY_STRING/,t.target.value)},ct_localizations.show_more_text):[]);if(e.appendChild(n),p){let t=e.querySelector(".ct-search-results"),{height:n}=t.getBoundingClientRect();g!==n&&(t.style.height=`${g}px`,t.classList.add("ct-slide"),requestAnimationFrame(function(){t.style.height=`${n}px`,(0,l.u)(t,function(){t.removeAttribute("style"),t.classList.remove("ct-slide")})}))}else!function(e){e.classList.add("ct-fade-enter");let{height:t}=e.getBoundingClientRect();e.classList.add("ct-fade-leave"),e.style.height=0,e.closest("form").classList.add("ct-has-dropdown"),requestAnimationFrame(function(){e.style.height=`${t}px`,e.classList.remove("ct-fade-enter"),e.classList.add("ct-fade-enter-active"),(0,l.u)(e,function(){return e.removeAttribute("style")})})}(e.querySelector(".ct-search-results"));e.querySelector(".ct-search-more")&&e.querySelector(".ct-search-more").addEventListener("click",function(t){t.preventDefault(),e.submit()}),(0,c.e)()&&"modal"===a.mode&&window.scrollTo(0,0)}h=!1}catch(e){if("New request"===e.message)return;console.error("Error fetching search results",e)}},p=300,function(){if(!p)return u.apply(this,arguments);var e=this,t=arguments;clearTimeout(g),g=setTimeout(function(){return g=null,u.apply(e,t)},p)});var u,p,g;r.addEventListener("input",i),r.addEventListener("keydown",function(e){"Escape"===e.key&&e.preventDefault()}),r.addEventListener("focus",function(e){i(e)}),r.value.length>0&&i({target:r})};function b(e){if(!e)return;let{height:t}=e.getBoundingClientRect();e.classList.add("ct-fade-leave"),e.style.height=`${t}px`,e.closest("form").classList.remove("ct-has-dropdown"),requestAnimationFrame(function(){e.classList.remove("ct-fade-leave"),e.classList.add("ct-fade-leave-active"),e.style.height=0,(0,l.u)(e,function(){return e.parentNode&&e.parentNode.removeChild(e)})})}function O(e){var t=[];if("object"==typeof e||"function"==typeof e){for(var n=Object.keys(e),r=n.length,o=0;o1)}}}]);