PageSourceSearch

https://www.marongiulibri.it/wp-content/plugins/yith-woocommerce-a…?ver=8dc74b271416a8e0814e

js marongiulibri.it collected 2026-10-04 14:18:29 UTC 15,226 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebpackYWCASBlocksJsonp=self.webpackChunkwebpackYWCASBlocksJsonp||[]).push([[153],{223(e,t,r){r.d(t,{z6:()=>m,cM:()=>_,Lw:()=>i});var o=r(609),a=r(427),s=r(828),n=r(939);const c=({submitStyle:e,buttonLabel:t,iconType:r,onClick:c,wrapperStyle:l})=>{switch(e){case"text":return(0,o.createElement)(n.Button,{className:"ywcas-submit-button",color:"secondary",size:"sm",onClick:c},t);case"icon":return"icon-right"===r&&(0,o.createElement)(n.Box,{className:"ywcas-submit-wrapper",sx:l},(0,o.createElement)(a.Icon,{className:"ywcas-submit-icon",onClick:c,icon:(0,s.$p)()}));case"iconText":return(0,o.createElement)(n.Button,{className:"ywcas-submit-button",color:"secondary",size:"sm",onClick:c},(0,o.createElement)(a.Icon,{className:"ywcas-submit-icon",icon:(0,s.$p)()})," ",t)}};var l=r(315);const i=({queryString:e,placeholder:t,placeholderTextColor:r,inputTextColor:i,inputBgColor:u,inputBgFocusColor:m,inputBorderColor:p,inputBorderFocusColor:d,inputBorderSize:f,inputBorderRadius:g,submitContentColor:y,submitContentHoverColor:h,submitBgColor:b,submitBgHoverColor:_,submitBorderColor:w,submitBorderHoverColor:E,submitStyle:S,size:C,setSearchQuery:k,iconType:x,buttonLabel:B,buttonBorderRadius:L,onFocus:N=null,onBlur:A=null,onCloseMobile:v=null,isSmallDevice:R=!1})=>{const $=()=>({borderRadius:"50%",backgroundColor:`${b}!important`,border:"1px solid",borderColor:`${w||"#FFF"} !important`,svg:{height:""!==b&&"#fff"!==b.toLowerCase()&&"#ffffff"!==b.toLowerCase()?"20px":"24px"},"&:hover, & > sgv:hover":{backgroundColor:`${_}!important`,borderColor:`${E||"#FFF"} !important`}}),T=()=>{if(""!==e){const t=l.YWCAS_SITE_URL+"?ywcas=1&post_type=product&lang="+l.YWCAS_LANG+"&s="+e;window.location.href=t}};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(n.Box,{className:"ywcas-block-components-search-field",sx:{"& .ywcas-input-field-wrapper":{flex:1,borderRadius:`${g.topLeft} ${g.topRight} ${g.bottomRight} ${g.bottomLeft}`,borderColor:`${p||"#7C7C7C"}!important`,borderWidth:`${f.topLeft} ${f.topRight}  ${f.bottomLeft} ${f.bottomRight}`,backgroundColor:`${u||"#FFF"}!important`,borderStyle:"solid",overflow:"hidden","&:focus-within":{backgroundColor:`${m||"#FFF"}!important`,borderColor:`${d||"#5B5B5B"}!important`},"& >div":{width:"100%",padding:0,input:{flex:1}}},"& .ywcas-input-field input":{color:`${i||"#000"} !important`,fontSize:"1rem!important"},"& .ywcas-input-field input::placeholder":{color:`${r||"#000"}`,opacity:1},"& .ywcas-submit-button":{color:`${y||"#fff"} !important`,backgroundColor:`${b||"#a7ab06"} !important`,borderColor:`${w||"#FFF"} !important`,borderRadius:`${L.topLeft} ${L.topRight} ${L.bottomRight} ${L.bottomLeft}`},"& .ywcas-submit-button:hover":{color:`${h||"#fff"} !important`,backgroundColor:`${_||"#a7ab06"} !important`,borderColor:`${E||"#FFF"} !important`},"& .ywcas-submit-icon":{color:`${y||"#000"} !important`},"&:hover .ywcas-submit-icon, & .ywcas-submit-icon:hover":{color:`${h||"#000"} !important`},"& .lapilliUI-Input__backdrop":{display:"none"}}},R&&(0,o.createElement)("div",{className:"mobile-search-close",onClick:v},(0,o.createElement)(a.Icon,{icon:(0,s.US)()})),(0,o.createElement)(n.Stack,{direction:"row",spacing:0},(0,o.createElement)(n.Stack,{className:"ywcas-input-field-wrapper"},(0,o.createElement)(n.Input,{className:"ywcas-input-field",placeholder:t,autoComplete:"off",size:C,value:e,onChange:k,onFocus:N,onBlur:A,onKeyDown:e=>{"Enter"===e.key&&T()},startAdornment:"icon"===S&&"icon-left"===x?(0,o.createElement)(n.Box,{className:"ywcas-submit-wrapper",sx:$()},(0,o.createElement)(a.Icon,{className:"ywcas-submit-icon",icon:(0,s.$p)()})):null,endAdornment:(0,o.createElement)(c,{submitStyle:S,buttonLabel:B,submitBgColor:b,iconType:x,onClick:T,wrapperStyle:$()})})))))};var u=r(572);const m=({children:e,...t})=>{const r=(0,u.Ub)(`(max-width: ${l.YWCAS_MOBILE_BREAKPOINT})`);return(0,o.createElement)(o.Fragment,null,!r&&(0,o.createElement)(n.Popover,{...t},(0,o.createElement)(n.Box,{className:"popover-content"},e)),r&&(0,o.createElement)(n.Box,{className:"mobile-search-content"},e))};
1var p=r(232),d=r(87);const f=({className:e,label:t,backgroundColor:r,color:a,top:s})=>(0,o.createElement)(n.Box,{className:`ywcas-badge ${e}`,sx:{top:`${s}px`,backgroundColor:r,color:a}},t),g=({imageSize:e,marginLeft:t,item:r,showSaleBadge:a,showOutOfStockBadge:s,showFeaturedBadge:c,hideFeaturedIfOnSale:i})=>{const u=Boolean(parseInt(r.instock)),m=a&&Boolean(parseInt(r.onsale)),d=(!i||!m)&&c&&Boolean(parseInt(r.featured)),g=s&&!u,{saleBadgeLabel:y,saleFeaturedLabel:h,saleOutOfStockLabel:b,saleBadgeColors:_,featuredBadgeColors:w,outOfStockBadgeColors:E}=l.ywcasDefaultSettings,S=m?30:5,C=d?S+25:m?30:5;return(0,o.createElement)(n.Stack,{className:"search-result-item__thumbnail",sx:{width:e,marginLeft:t}},m&&(0,o.createElement)(f,{className:"ywcas-onsale-badge",top:5,label:(0,p.Ay)(y),backgroundColor:_.bgcolor,color:_.color}),d&&(0,o.createElement)(f,{className:"ywcas-featured-badge",top:S,label:h,backgroundColor:w.bgcolor,color:w.color}),g&&(0,o.createElement)(f,{className:"ywcas-outofstock-badge",top:C,label:b,backgroundColor:E.bgcolor,color:E.color}),(0,o.createElement)("img",{src:"string"==typeof r.thumbnail.small?r.thumbnail.small:l.ywcas_wc_data.placeholderImageSrc,alt:r.name,width:e}))},y=function(e){const{item:t,searchQuery:r,onClick:s,showName:c,showImage:i,showPrice:m,showCategories:f,showStock:y,showSKU:h,showSummary:b,showAddToCart:_,layout:w,imageSize:E,imagePosition:S,summaryMaxWord:C,productNameColor:k,priceLabel:x,categoryResults:B,results:L}=e,N=(0,u.Ub)("(max-width: 600px)"),A="grid"===w?"column":"row",v="list"===w&&"right"===S?"auto":0,[R,$]=(0,d.useState)(!1),T=e=>{let t=B.find(t=>parseInt(t.term_id)===e.parent);return t&&0!==t.parent&&(t=T(t)),t},z=e=>{const t=e.name;return(0,o.createElement)("a",{href:e.url},(0,p.Ay)(t))},F=e=>{e.stopPropagation(),e.target.classList.contains("search-result-add-to-cart")&&(s(e,t,!1),$(!0),jQuery.ajax({url:l.YWCAS_AJAX_URL.toString().replace("%%endpoint%%","add_to_cart"),data:{quantity:1,product_id:t.post_id,product_sku:t.sku},type:"POST",success:function(e){$(!1)}}))};return(0,o.createElement)(n.Box,{className:`search-result-item ${w}`},(0,o.createElement)(n.Stack,{align:"center",direction:A,spacing:2,className:"search-result-item__content","data-id":t.post_id,"data-name":t.name,onClick:e=>s(e,t)},i&&("grid"===w||"list"===w&&"right"!==S)&&(0,o.createElement)(g,{marginLeft:v,item:t,...e}),(0,o.createElement)(()=>{if(!i&&(0,u.Im)(t.thumbnail))return"";const e=parseInt(t.instock)>0?"in-stock":"out-of-stock";return(0,o.createElement)(n.Stack,{className:"search-result-item_name",sx:{flex:1,alignItems:"left"},onClick:e=>s(e,t,L.totalResults)},c&&(0,o.createElement)(n.Typography,{sx:{color:k,fontSize:"0.9em"},className:"search-result-item__name"},(0,p.Ay)(t.name)),m&&(0,o.createElement)(n.Typography,{className:"search-result-item__price",sx:{fontSize:"0.9em",fontWeight:"600"}},x," ",(0,u.y8)(t)),(0,o.createElement)(n.Box,{className:"search-result-item__inline_group",direction:"row",sx:{display:"block"}},h&&(0,o.createElement)(n.Typography,{className:"search-result-item__sku"},(0,o.createElement)("strong",null,l.YWCAS_SKU_LABEL)," ",t.sku),h&&y&&(0,o.createElement)("span",null,"-"),y&&(0,o.createElement)(n.Typography,{className:`search-result-item__stock stock ${e}`},parseInt(t.instock)?l.YWCAS_IN_STOCK_LABEL:l.YWCAS_OUT_OF_STOCK_LABEL)),f&&(0,o.createElement)(n.Box,{className:"search-result-item__category",sx:{fontSize:"0.7em"}},(e=>{if(B){const t=B.find(t=>parseInt(t.term_id)===e[0]);if(!t)return"";const r=0!==t.parent&&T(t);return r?(0,o.createElement)(n.Box,null,z(r)," ",(0,o.createElement)("span",null," > "),"  ",z(t)):z(t)}return""})(t.parent_category)),b&&"grid"===w&&(0,o.createElement)(n.Typography,{className:"search-result-item__summary",sx:{fontSize:"0.8em"}},(0,u.GH)(t.summary,C)))},null),N&&b&&"grid"!==w&&(0,o.createElement)(n.Typography,{className:"search-result-item__summary",sx:{fontSize:"0.8em"}},(0,p.Ay)((0,u.GH)(t.summary,C))),_&&(R?(0,o.createElement)(n.Spinner,{color:"default",size:"sm",thickness:3.6}):(0,o.createElement)("div",{className:"wp-block-button"},(0,o.createElement)(()=>{const e=parseInt(t.instock),r="wp-element-button wp-block-button__link wp-block-woocommerce-product-button search-result-a
1dd-to-cart";return parseInt(t.is_purchasable)&&e&&("simple"===t.product_type||"variation"===t.product_type)&&0<parseFloat(null==t?void 0:t.max_price)?(0,o.createElement)(a.Button,{className:r,onClick:F},l.YWCAS_ADD_TO_CART_LABEL):e&&"variable"===t.product_type&&0<parseFloat(null==t?void 0:t.max_price)?(0,o.createElement)(a.Button,{size:"sm",className:r,onClick:e=>s(e,t)},l.YWCAS_SELECT_OPTIONS):(0,o.createElement)(a.Button,{size:"sm",className:r,onClick:e=>s(e,t)},l.YWCAS_READ_MORE)},null))),i&&"list"===w&&"right"===S&&(0,o.createElement)(g,{marginLeft:v,item:t,...e})),!N&&b&&"grid"!==w&&(0,o.createElement)(n.Typography,{className:"search-result-item__summary",sx:{fontSize:"0.8em"}},(0,p.Ay)((0,u.GH)(t.summary,C))))};var h=r(455),b=r.n(h);const _=e=>{const{searchQuery:t,layout:r,results:a,categoryList:s,noResults:c,showViewAll:i,showViewAllText:u,maxResultsToShow:m}=e,p=(e,r,o=!0)=>{e.stopPropagation();const s="/ywcas/v1/register?itemID="+r.post_id+"&queryString="+t+"&totalResults="+a.totalResults+"&lang="+l.YWCAS_LANG;b()({path:s}).then(()=>{o&&d(r)}).catch(e=>{console.log(e)})},d=e=>{e.url&&(window.location.href=e.url)},f=u.replace("{total}",a.totalResults),g=a.results;return(0,o.createElement)(o.Fragment,null,g&&g.length&&(0,o.createElement)(n.Grid,{className:`ywcas-search-results-grid ${r}`,columns:1},g.map((t,r)=>(0,o.createElement)(y,{key:r,item:t,onClick:p,results:a,categoryResults:s,...e}))),!g&&(0,o.createElement)(n.Typography,null,c),g&&i&&m<a.totalResults&&(0,o.createElement)("div",{className:"ywcas-total-results"}," > ",(0,o.createElement)("a",{className:"total-results-link",href:"#",onClick:()=>{const e=!1!==a.fuzzyToken&&""!==a.fuzzyToken?a.fuzzyToken:t,r=l.YWCAS_SITE_URL+"?ywcas=1&post_type=product&lang="+l.YWCAS_LANG+"&s="+e;window.location.href=r}},f)))};r(89)},283(e,t,r){r.d(t,{$:()=>u}),r(609);var o=r(87),a=r(143);const s=(0,o.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>({})});var n=r(118),c=r(252),l=r.n(c);const i={},u=(e={query:"",showCategories:!1,maxResults:5,page:0})=>{const t=(0,o.useRef)({}),{isEditor:r}=(0,o.useContext)(s),{query:c,showCategories:u,maxResults:m,page:p}=e,d=r?"":c,f=(0,a.useSelect)(e=>{const t=`${d}-${p}`;if(!r&&i[t])return{results:i[t],isSearching:!1};{const o=e(n.YWCAS_RESULTS_VIEW_STORE_KEY),a=o.getSearchedResults(d,0,u,m,p,r),s=!o.hasFinishedResolution("getSearchedResults",[d,0,u,m,p,r]),c={results:a,isSearching:s};return s||(i[t]=a),c}});return t.current&&l()(t.current,f)||(t.current=f),{results:t.current.results,isSearching:t.current.isSearching,getCategories:e=>(0,a.useSelect)(t=>{const r=t(n.YWCAS_RESULTS_VIEW_STORE_KEY);return{categories:r.getCategories(e),isLoading:!r.hasFinishedResolution("getCategories",[e])}},[e]),getResults:(e=!1,t=0)=>(0,a.useSelect)(r=>{const o=r(n.YWCAS_RESULTS_VIEW_STORE_KEY),a=o.getResults(),s=`${e}-${t}`;return{results:i[s]?i[s]:a,isLoading:""===o.getLastQuery()}},[e,t])}}},572(e,t,r){r.d(t,{GH:()=>i,Im:()=>s,Ub:()=>u,y8:()=>l}),r(232);var o=r(315),a=r(609);const s=e=>void 0===e||("object"==typeof e?0===Object.keys(e).length:e.hasOwnProperty(length)?0===e.length:"undefined"),n=e=>accounting.formatMoney(e,{symbol:o.ywcas_wc_data.currency.symbol,decimal:o.ywcas_wc_data.currency.decimal_sep,thousand:o.ywcas_wc_data.currency.thousand_sep,precision:o.ywcas_wc_data.currency.decimals,format:o.ywcas_wc_data.currency.format}),c=(e,t=0)=>{const r=n(e);return parseFloat(t)&&t!==e?`${n(t)} - ${r}`:r},l=e=>"variable"===e.product_type?c(e.max_price,e.min_price):parseInt(e.onsale)?c(e.min_price):c(e.max_price),i=(e,t)=>e.split(" ").slice(0,t).join(" "),u=e=>{const t=(0,a.useMemo)(()=>window.matchMedia(e),[e]),[r,o]=(0,a.useState)(t.matches);return(0,a.useEffect)(()=>{const e=()=>o(t.matches);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[t]),r}},817(e,t,r){r.r(t),r.d(t,{default:()=>f});var o=r(609),a=r(942),s=r.n(a),n=r(87),c=r(939),l=r(723);const i=window.CustomEvent||null;var u=r(283),m=r(223),p=r(106),d=r(315);const f=({children:e,className:t})=>{if(!d.YWCAS_HAS_AUTOCOMPLETE)return null;const{query:r,inputFocused:a,setInputFocused:f}=(0,p.$A)(),{getResults:g}=(0,u.$)(),y=g(r);(0,n.useEffect)(()=>{const e=e=>{const t=document.getElementsByClassName("wp-block-yith-filled-block");e.target.parentNode.parentNode&&e.target.parentNode.parentNode.classList.contains("ywcas-input-field-wrapper")||t[0]&&!t[0].contains(e.target)&&f(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[f]),(0,n.useEffect)(()=>
1{((e,{bubbles:t=!1,cancelable:r=!1,element:o,detail:a={}})=>{if(!i)return;o||(o=document.body);const s=new i(e,{bubbles:t,cancelable:r,detail:a});o.dispatchEvent(s)})("ywcas-blocks_render_blocks_frontend",{element:document.body.querySelector(".wp-block-yith-search-block")})},[]);const h=s()("ywcas-popover-results",0===y.results.totalResults?"no-results":"");return""===r||r.length<d.YWCAS_MIN_CHARS?null:a?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(m.z6,{className:h,anchorRef:a,verticalMargin:5,forceMinWidth:!0,forceInView:!1,fixed:!0,sx:{"&.no-results hr.wp-block-separator":{display:"none"},"& hr.wp-block-separator":{marginLeft:"0",marginRight:"0"}}},(0,o.createElement)(c.Stack,{direction:"column",spacing:4,className:"wp-block-yith-filled-block"},y.results.fuzzyToken&&y.results.fuzzyToken.length>0&&(0,o.createElement)(c.Box,{sx:{lineHeight:"2.5em"}},(0,l.sprintf)(d.YWCAS_PLURAL_RESULTS_LABEL,0,r)),(0,o.createElement)(c.Box,{className:t},y.results.fuzzyToken&&y.results.fuzzyToken.length>0&&(0,o.createElement)(c.Box,{sx:{marginBottom:"15px"}},(0,o.createElement)("strong",null,(0,l.sprintf)(d.YWCAS_FUZZY_RESULTS,y.results.fuzzyToken))),e)))):null}},252(e){e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var o,a,s;if(Array.isArray(t)){if((o=t.length)!=r.length)return!1;for(a=o;0!==a--;)if(!e(t[a],r[a]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(a of t.entries())if(!r.has(a[0]))return!1;for(a of t.entries())if(!e(a[1],r.get(a[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(a of t.entries())if(!r.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((o=t.length)!=r.length)return!1;for(a=o;0!==a--;)if(t[a]!==r[a])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((o=(s=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=o;0!==a--;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=o;0!==a--;){var n=s[a];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.