/*! For license information please see 897.991324256fa39a28a42d.js.LICENSE.txt */ (globalThis.blocksyJsonP=globalThis.blocksyJsonP||[]).push([[897],{123:function(e){"use strict";function t(e,n){for(var r,o=0,i=e.length;o1)}},897:function(e,t,n){"use strict";n.r(t),n.d(t,{mount:function(){return m}});var r=n(439),o=n(184),i=n.n(o),a=n(248),c=n(257);function s(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 l(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};const n=function(n){"modal"!==l({mode:"inline"},t).mode&&(e.contains(n.target)||g(e.querySelector(".ct-search-results")))},o=e.querySelector('input[type="search"]'),i=l({postType:"ct_forced_any",mode:"inline",perPage:5},t);if(!o)return;if(i.postType=e.querySelector('[name="post_type"]')?`ct_forced_${e.querySelector('[name="post_type"]').value}`:e.querySelector('[name="ct_post_type"]')?`ct_forced_${e.querySelector('[name="ct_post_type"]').value}`:"ct_forced_any",i.productPrice=!!e.querySelector('[name="ct_product_price"]')&&!!e.querySelector('[name="ct_product_price"]').value,!window.fetch)return;let s=_((function(t){if(document.removeEventListener("click",n),document.addEventListener("click",n),0!==t.target.value.trim().length)e.classList.add("ct-searching"),p(`${ct_localizations.rest_url}wp/v2/posts${ct_localizations.rest_url.indexOf("?")>-1?"&":"?"}_embed=1&post_type=${i.postType}&per_page=${i.perPage}&${"true"===i.productPrice||!0===i.productPrice?`product_price=${i.productPrice}&`:""}search=${t.target.value}${ct_localizations.lang?`&lang=${ct_localizations.lang}`:""}`).then((function(n){let o=parseInt(n.headers.get("X-WP-Total"),10);(0,a.Xr)(ct_localizations.dynamic_styles.search_lazy).then((function(){n.json().then((function(n){if(f)return;e.classList.remove("ct-searching");let a=!!e.querySelector(".ct-search-results");f=!0;let s=e.querySelector(".ct-search-results"),{height:l}=s?s.getBoundingClientRect():0;s&&0!==t.target.value.trim().length&&0!==n.length?s&&e.removeChild(s):0!==t.target.value.trim().length&&0!==n.length||g(s);let u=ct_localizations.search_live_no_result;n.length>0&&t.target.value.trim().length>0&&(u=(n.length>1?ct_localizations.search_live_many_results:ct_localizations.search_live_one_result).replace("%s",n.length));let d=e.querySelector("[aria-live]");if(d&&(d.innerHTML=u),n.length>0&&t.target.value.trim().length>0){let s=(0,r.h)("div",{class:"ct-search-results",role:"listbox","aria-label":ct_localizations.search_live_results},n.map((function(t){return h({post:t,hasThumbs:(e.dataset.liveResults||"").indexOf("thumbs")>-1})})),o>i.perPage?(0,r.h)("a",{className:"ct-search-more",href:ct_localizations.search_url.replace(/QUERY_STRING/,t.target.value)},ct_localizations.show_more_text):[]);if(e.appendChild(s),a){let t=e.querySelector(".ct-search-results"),{height:n}=t.getBoundingClientRect();l!==n&&(t.style.height=`${l}px`,t.classList.add("ct-slide"),requestAnimationFrame((function(){t.style.height=`${n}px`,y(t,(function(){t.removeAttribute("style"),t.classList.remove("ct-slide")}))})))}else v(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.O)()&&window.scrollTo(0,0)}f=!1}))}))}));else{g(e.querySelector(".ct-search-results"));let t=e.querySelector("[aria-live]");t&&(t.innerHTML=ct_localizations.search_live_no_result)}}),200);o.addEventListener("input",s),"modal"===l({mode:"inline"},t).mode&&o.addEventListener("blur",(function(e){return setTimeout((function(){return s(e)}))})),o.addEventListener("focus",(function(e){s(e)})),o.value.length>0&&s({target:o})};function g(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,y(e,(function(){return e.parentNode&&e.parentNode.removeChild(e)}))}))}function y(e,t){const n=function(r){r.target===e&&(e.removeEventListener("transitionend",n),t())};e.addEventListener("transitionend",n)}function v(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"),y(e,(function(){return e.removeAttribute("style")}))}))}function _(e,t){var n;return function(){if(!t)return e.apply(this,arguments);var r=this,o=arguments;clearTimeout(n),n=setTimeout((function(){return n=null,e.apply(r,o)}),t)}}function w(e){var t=[];if("object"==typeof e||"function"==typeof e){for(var n=Object.keys(e),r=n.length,o=0;o!a.includes(e))),s=(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))},l=(e,t,n)=>{const r=(e=>(e=>c.includes(e))(e)?document.createElementNS("http://www.w3.org/2000/svg",e):e===DocumentFragment?document.createDocumentFragment():document.createElement(e))(e);return Object.keys(t).forEach((e=>{const n=t[e];if("class"===e||"className"===e)s(r,"class",n);else if("style"===e)((e,t)=>{Object.keys(t).forEach((n=>{let r=t[n];"number"!=typeof r||i.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&&s(r,e,!0===n?"":n)})),t.dangerouslySetInnerHTML||r.appendChild(n),r};function u(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))})),l(e,t||{},r)}const f={createElement:u,Fragment:"function"==typeof DocumentFragment?DocumentFragment:()=>{}};e.exports=f,e.exports.h=u,e.exports.default=f},979: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"]')}}]); //# sourceMappingURL=897.991324256fa39a28a42d.js.map