uawdijnntqw1x1x1
IP : 216.73.216.109
Hostname : premium160.web-hosting.com
Kernel : Linux premium160.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
batcwwjx
/
www
/
wp-content
/
plugins
/
woocommerce
/
assets
/
.
/
client
/
blocks
/
product-filter-rating.js
/
/
(()=>{var e,t,o,r={9385:(e,t,o)=>{"use strict";const r=window.wp.blocks;var s=o(5573),n=o(790);var a=o(7723),c=o(4921);const i=window.wp.blockEditor,l=window.wc.wcBlocksData,u=window.wp.data;var d=o(6087),p=o(923),m=o.n(p);const w=(0,d.createContext)("page"),f=()=>(0,d.useContext)(w),g=(w.Provider,e=>{const t=f();e=e||t;const o=(0,u.useSelect)((t=>t(l.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)),[e]),{setValueForQueryContext:r}=(0,u.useDispatch)(l.QUERY_STATE_STORE_KEY);return[o,(0,d.useCallback)((t=>{r(e,t)}),[e,r])]}),_=(e,t,o)=>{const r=f();o=o||r;const s=(0,u.useSelect)((r=>r(l.QUERY_STATE_STORE_KEY).getValueForQueryKey(o,e,t)),[o,e]),{setQueryValue:n}=(0,u.useDispatch)(l.QUERY_STATE_STORE_KEY);return[s,(0,d.useCallback)((t=>{n(o,e,t)}),[o,e,n])]};var h=o(4347);const b=window.wc.wcTypes;var y=o(9456);function x(e){const t=(0,d.useRef)(e);return m()(e,t.current)||(t.current=e),t.current}const v=({queryAttribute:e,queryTaxonomy:t,queryPrices:o,queryStock:r,queryRating:s,queryState:n,isEditor:a=!1})=>{let c=f();c=`${c}-collection-data`;const[i]=g(c),[p,m]=_("calculate_attribute_counts",[],c),[w,v]=_("calculate_taxonomy_counts",[],c),[j,k]=_("calculate_price_range",null,c),[C,E]=_("calculate_stock_status_counts",null,c),[S,L]=_("calculate_rating_counts",null,c),R=x(e||{}),O=x(t),T=x(o),P=x(r),B=x(s);(0,d.useEffect)((()=>{"object"==typeof R&&Object.keys(R).length&&(p.find((e=>(0,b.objectHasProp)(R,"taxonomy")&&e.taxonomy===R.taxonomy))||m([...p,R]))}),[R,p,m]),(0,d.useEffect)((()=>{O&&!w.includes(O)&&v([...w,O])}),[O,w,v]),(0,d.useEffect)((()=>{j!==T&&void 0!==T&&k(T)}),[T,k,j]),(0,d.useEffect)((()=>{C!==P&&void 0!==P&&E(P)}),[P,E,C]),(0,d.useEffect)((()=>{S!==B&&void 0!==B&&L(B)}),[B,L,S]);const[q,A]=(0,d.useState)(a),[N]=(0,h.d7)(q,200);q||A(!0);const M=(0,d.useMemo)((()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=(0,y.di)(e.calculate_attribute_counts.map((({taxonomy:e,queryType:t})=>({taxonomy:e,query_type:t})))).asc(["taxonomy","query_type"])),Array.isArray(e.calculate_taxonomy_counts)&&(t.calculate_taxonomy_counts=e.calculate_taxonomy_counts),t})(i)),[i]),{results:F,isLoading:Y}=(e=>{const{namespace:t,resourceName:o,resourceValues:r=[],query:s={},shouldSelect:n=!0}=e;if(!t||!o)throw new Error("The options object must have valid values for the namespace and the resource properties.");const a=(0,d.useRef)({results:[],isLoading:!0}),c=x(s),i=x(r),p=(()=>{const[,e]=(0,d.useState)();return(0,d.useCallback)((t=>{e((()=>{throw t}))}),[])})(),m=(0,u.useSelect)((e=>{if(!n)return null;const r=e(l.COLLECTIONS_STORE_KEY),s=[t,o,c,i],a=r.getCollectionError(...s);if(a){if(!(0,b.isError)(a))throw new Error("TypeError: `error` object is not an instance of Error constructor");p(a)}return{results:r.getCollection(...s),isLoading:!r.hasFinishedResolution("getCollection",s)}}),[t,o,i,c,n,p]);return null!==m&&(a.current=m),a.current})({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...n,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...M},shouldSelect:N});return{data:F,isLoading:Y}},j=window.wc.wcSettings,k=window.wp.components;function C({stars:e=5,size:t=24,color:o="currentColor",gap:r=0}){const s=e*t+(e-1)*r;return(0,n.jsx)(k.SVG,{width:s,height:t,viewBox:`0 0 ${s} 24`,fill:o,"aria-hidden":"true",focusable:"false",children:Array.from({length:e},((e,o)=>(0,n.jsx)(k.Path,{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",transform:`translate(${o*(t+r)}, 0)`},o)))})}const E=[{label:(0,n.jsx)(C,{stars:5}),ariaLabel:(0,a.__)("Rated 5 out of 5","woocommerce"),value:"5",count:35},{label:(0,n.jsx)(C,{stars:4}),ariaLabel:(0,a.__)("Rated 4 out of 5","woocommerce"),value:"4",count:20},{label:(0,n.jsx)(C,{stars:3}),ariaLabel:(0,a.__)("Rated 3 out of 5","woocommerce"),value:"3",count:3},{label:(0,n.jsx)(C,{stars:2}),ariaLabel:(0,a.__)("Rated 2 out of 5","woocommerce"),value:"2",count:6},{label:(0,n.jsx)(C,{stars:1}),ariaLabel:(0,a.__)("Rated 1 out of 5","woocommerce"),value:"1",count:1}],S=window.wp.url;(0,j.getSettingWithCoercion)("isRenderingPhpTemplate",!1,b.isBoolean);function L({stars:e,ariaLabel:t}){return(0,n.jsxs)(k.Flex,{title:t,"aria-label":t,justify:"flex-start",gap:1,children:[(0,n.jsx)(k.FlexItem,{children:(0,n.jsx)(C,{stars:e})}),(0,n.jsx)(k.FlexItem,{children:(0,a.__)("& up","woocommerce")})]})}const R=({attributes:e,setAttributes:t})=>{const{showCounts:o,minRating:r}=e;return(0,n.jsx)(i.InspectorControls,{children:(0,n.jsxs)(k.PanelBody,{title:(0,a.__)("Display","woocommerce"),children:[(0,n.jsx)(k.RadioControl,{label:(0,a.__)("Minimum rating","woocommerce"),selected:r,className:"wc-block-rating-filter__rating-control",options:[{label:(0,n.jsx)(L,{stars:4,ariaLabel:(0,a.__)("Four stars and up","woocommerce")}),value:"4"},{label:(0,n.jsx)(L,{stars:3,ariaLabel:(0,a.__)("Three stars and up","woocommerce")}),value:"3"},{label:(0,n.jsx)(L,{stars:2,ariaLabel:(0,a.__)("Two stars and up","woocommerce")}),value:"2"},{label:(0,a.__)("No limit","woocommerce"),value:"0"}],onChange:function(e){t({minRating:e})}}),(0,n.jsx)(k.ToggleControl,{label:(0,a.__)("Product counts","woocommerce"),checked:o,onChange:function(e){t({showCounts:e})},__nextHasNoMarginBottom:!0})]})},"inspector")},O=(e=[])=>(0,r.getBlockTypes)().map((e=>e.name)).filter((t=>!e.includes(t))),T=["woocommerce/product-filters","woocommerce/product-filter-attribute","woocommerce/product-filter-active","woocommerce/product-filter-price","woocommerce/product-filter-status","woocommerce/product-collection","core/query"];var P=o(2624);o(1007);const B=({children:e})=>(0,n.jsxs)("div",{className:"wc-block-product-filter-components-notice",children:[(0,n.jsx)(k.Icon,{className:"wc-block-product-filter-components-notice__icon",icon:P.A}),(0,n.jsx)("div",{className:"wc-block-product-filter-components-notice__content",children:e})]});o(1652);const q=({children:e})=>(0,n.jsxs)("div",{className:"wc-block-product-filter-components-initial-disabled",children:[(0,n.jsx)("div",{className:"wc-block-product-filter-components-initial-disabled-overlay"}),e]}),A=(0,k.withSpokenMessages)((e=>{const{attributes:t,setAttributes:o,clientId:r}=e,{isPreview:s,showCounts:l,minRating:u}=t,{children:p,...m}=(0,i.useInnerBlocksProps)((0,i.useBlockProps)(),{allowedBlocks:O(T),template:[["core/heading",{level:3,content:(0,a.__)("Rating","woocommerce"),style:{spacing:{margin:{bottom:"0.625rem",top:"0"}}}}],["woocommerce/product-filter-checkbox-list"]]}),[w]=g(),{data:f,isLoading:h}=v({queryRating:!0,queryState:w,isEditor:!0}),[y,x]=(0,d.useState)(s?E:[]),k=!s&&h&&0===y.length,L=(0,d.useMemo)((()=>((e="filter_rating")=>{const t=(o=e,window?(0,S.getQueryArg)(window.location.href,o):null);var o;return t?(0,b.isString)(t)?t.split(","):t:[]})("rating_filter")),[]),[P]=_("rating",L);if((0,d.useEffect)((()=>{if(h||s)return;if(!f?.rating_counts||0===f?.rating_counts?.length)return void x(E);const e="string"==typeof u?parseFloat(u):0,t=f?.rating_counts?.length?f.rating_counts.sort(((e,t)=>t.rating-e.rating)).filter((({rating:t})=>t>=e)).map((({rating:e,count:t},o)=>({label:(0,n.jsx)(C,{stars:e},e),ariaLabel:(0,a.sprintf)(/* translators: %d: rating value. Example: Rated 4 out of 5. */ /* translators: %d: rating value. Example: Rated 4 out of 5. */ (0,a.__)("Rated %d out of 5","woocommerce"),e),value:e?.toString(),selected:0===o,count:t}))):[];x(t)}),[l,s,f,h,P,u]),!h&&0===y.length)return null;if(!(0,j.getSettingWithCoercion)("hasFilterableProducts",!1,b.isBoolean))return null;const A=!h&&!f.rating_counts?.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(R,{clientId:r,attributes:t,setAttributes:o}),(0,n.jsx)("div",{...m,children:(0,n.jsxs)(q,{children:[A&&(0,n.jsx)(B,{children:(0,a.__)("Your store doesn't have any products with ratings yet. This filter option will display when a product receives a review.","woocommerce")}),(0,n.jsx)("div",{className:(0,c.A)({"is-loading":k}),children:(0,n.jsx)(i.BlockContextProvider,{value:{filterData:{items:y,isLoading:k,showCounts:l}},children:p})})]})})]})})),N=JSON.parse('{"name":"woocommerce/product-filter-rating","title":"Rating Filter","description":"Enable customers to filter the product collection by rating.","category":"woocommerce","keywords":[],"supports":{"interactivity":true,"color":{"background":false,"text":true}},"ancestor":["woocommerce/product-filters"],"usesContext":["query","filterParams"],"attributes":{"className":{"type":"string","default":""},"showCounts":{"type":"boolean","default":false},"minRating":{"type":"string","default":"0"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');(0,r.registerBlockType)(N,{icon:()=>(0,n.jsxs)(s.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("line",{x1:"4",y1:"15.25",x2:"20",y2:"15.25",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("line",{x1:"4",y1:"19.25",x2:"13",y2:"19.25",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)(s.Path,{d:"M8.92572 3.95425C9.01742 3.76843 9.28238 3.76844 9.37409 3.95425L10.4877 6.21072C10.5241 6.28451 10.5945 6.33565 10.676 6.34748L13.1661 6.70933C13.3712 6.73912 13.4531 6.99112 13.3047 7.13575L11.5028 8.89217C11.4439 8.94961 11.417 9.03236 11.4309 9.11346L11.8563 11.5936C11.8913 11.7978 11.6769 11.9535 11.4935 11.8571L9.26624 10.6862C9.19341 10.6479 9.1064 10.6479 9.03357 10.6862L6.80629 11.8571C6.62288 11.9535 6.40853 11.7978 6.44355 11.5936L6.86893 9.11346C6.88283 9.03236 6.85595 8.94961 6.79703 8.89217L4.99512 7.13575C4.84674 6.99112 4.92862 6.73912 5.13367 6.70933L7.62385 6.34748C7.70527 6.33565 7.77566 6.28451 7.81208 6.21072L8.92572 3.95425Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",fill:"none"})]}),attributes:{...N.attributes},edit:A,save:()=>{const e=i.useBlockProps.save(),t=i.useInnerBlocksProps.save(e);return(0,n.jsx)("div",{...t})}})},1652:()=>{},1007:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},923:e=>{"use strict";e.exports=window.wp.isShallowEqual},5573:e=>{"use strict";e.exports=window.wp.primitives}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e].call(o.exports,o,o.exports,n),o.exports}n.m=r,e=[],n.O=(t,o,r,s)=>{if(!o){var a=1/0;for(u=0;u<e.length;u++){for(var[o,r,s]=e[u],c=!0,i=0;i<o.length;i++)(!1&s||a>=s)&&Object.keys(n.O).every((e=>n.O[e](o[i])))?o.splice(i--,1):(c=!1,s<a&&(a=s));if(c){e.splice(u--,1);var l=r();void 0!==l&&(t=l)}}return t}s=s||0;for(var u=e.length;u>0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[o,r,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var s=Object.create(null);n.r(s);var a={};t=t||[null,o({}),o([]),o(o)];for(var c=2&r&&e;"object"==typeof c&&!~t.indexOf(c);c=o(c))Object.getOwnPropertyNames(c).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,n.d(s,a),s},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=1631,(()=>{var e={1631:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[a,c,i]=o,l=0;if(a.some((t=>0!==e[t]))){for(r in c)n.o(c,r)&&(n.m[r]=c[r]);if(i)var u=i(n)}for(t&&t(o);l<a.length;l++)s=a[l],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(u)},o=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var a=n.O(void 0,[94],(()=>n(9385)));a=n.O(a),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-filter-rating"]=a})();
/home/batcwwjx/www/wp-content/plugins/woocommerce/assets/./client/blocks/product-filter-rating.js