1 line
No EOL
5.2 KiB
JavaScript
1 line
No EOL
5.2 KiB
JavaScript
(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[6925],{9310:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});let o={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};(0,n(5271).uq)()&&(o={...o,align:{type:"string"}});const l=o},9805:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var o=n(9196),l=n(4184),r=n.n(l),c=n(2864),s=n(5271),a=n(721),i=n(5135),u=n(5918),d=n(3611);n(5160);const m=({children:e,headingLevel:t,elementType:n=`h${t}`,...l})=>(0,o.createElement)(n,{...l},e),p=(0,a.withProductDataContext)((e=>{const{className:t,headingLevel:n=2,showProductLink:l=!0,linkTarget:a,align:p}=e,y=(0,d.F)(e),{parentClassName:v}=(0,c.useInnerBlockLayoutContext)(),{product:g}=(0,c.useProductDataContext)(),{dispatchStoreEvent:k}=(0,u.n)();return g.id?(0,o.createElement)(m,{headingLevel:n,className:r()(t,y.className,"wc-block-components-product-title",{[`${v}__product-title`]:v,[`wc-block-components-product-title--align-${p}`]:p&&(0,s.uq)()}),style:(0,s.uq)()?y.style:{}},(0,o.createElement)(i.Z,{disabled:!l,name:g.name,permalink:g.permalink,target:a,onClick:()=>{k("product-view-link",{product:g})}})):(0,o.createElement)(m,{headingLevel:n,className:r()(t,y.className,"wc-block-components-product-title",{[`${v}__product-title`]:v,[`wc-block-components-product-title--align-${p}`]:p&&(0,s.uq)()}),style:(0,s.uq)()?y.style:{}})}))},9136:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var o=n(721),l=n(9805),r=n(9310);const c=(0,o.withFilteredAttributes)(r.Z)(l.Z)},5135:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var o=n(9196),l=n(2629),r=n(4184),c=n.n(r);n(5641);const s=({className:e="",disabled:t=!1,name:n,permalink:r="",target:s,rel:a,style:i,onClick:u,...d})=>{const m=c()("wc-block-components-product-name",e);if(t){const e=d;return(0,o.createElement)("span",{className:m,...e,dangerouslySetInnerHTML:{__html:(0,l.decodeEntities)(n)}})}return(0,o.createElement)("a",{className:m,href:r,target:s,...d,dangerouslySetInnerHTML:{__html:(0,l.decodeEntities)(n)},style:i})}},5918:(e,t,n)=>{"use strict";n.d(t,{n:()=>c});var o=n(2694),l=n(9818),r=n(9307);const c=()=>({dispatchStoreEvent:(0,r.useCallback)(((e,t={})=>{try{(0,o.doAction)(`experimental__woocommerce_blocks-${e}`,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:(0,r.useCallback)(((e,t={})=>{try{(0,o.doAction)(`experimental__woocommerce_blocks-checkout-${e}`,{...t,storeCart:(0,l.select)("wc/store/cart").getCartData()})}catch(e){console.error(e)}}),[])})},3611:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var o=n(4184),l=n.n(o),r=n(7884),c=n(2646),s=n(1473),a=n(2661);const i=e=>{const t=(e=>{const t=(0,r.Kn)(e)?e:{style:{}};let n=t.style;return(0,c.H)(n)&&(n=JSON.parse(n)||{}),(0,r.Kn)(n)||(n={}),{...t,style:n}})(e),n=(0,a.vc)(t),o=(0,a.l8)(t),i=(0,a.su)(t),u=(0,s.f)(t);return{className:l()(u.className,n.className,o.className,i.className),style:{...u.style,...n.style,...o.style,...i.style}}}},1473:(e,t,n)=>{"use strict";n.d(t,{f:()=>r});var o=n(7884),l=n(2646);const r=e=>{const t=(0,o.Kn)(e.style.typography)?e.style.typography:{},n=(0,l.H)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:n,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}}},2661:(e,t,n)=>{"use strict";n.d(t,{l8:()=>d,su:()=>m,vc:()=>u});var o=n(4184),l=n.n(o),r=n(9784),c=n(2289),s=n(7884);function a(e={}){const t={};return(0,c.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function i(e,t){return e&&t?`has-${(0,r.o)(t)}-${e}`:""}function u(e){var t,n,o,r,c,u,d;const{backgroundColor:m,textColor:p,gradient:y,style:v}=e,g=i("background-color",m),k=i("color",p),f=function(e){if(e)return`has-${e}-gradient-background`}(y),h=f||(null==v||null===(t=v.color)||void 0===t?void 0:t.gradient);return{className:l()(k,f,{[g]:!h&&!!g,"has-text-color":p||(null==v||null===(n=v.color)||void 0===n?void 0:n.text),"has-background":m||(null==v||null===(o=v.color)||void 0===o?void 0:o.background)||y||(null==v||null===(r=v.color)||void 0===r?void 0:r.gradient),"has-link-color":(0,s.Kn)(null==v||null===(c=v.elements)||void 0===c?void 0:c.link)?null==v||null===(u=v.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:a({color:(null==v?void 0:v.color)||{}})}}function d(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:function(e){var t;const{borderColor:n,style:o}=e,r=n?i("border-color",n):"";return l()({"has-border-color":!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color),[r]:!!r})}(e),style:a({border:n})}}function m(e){var t;return{className:void 0,style:a({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}},8519:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});const o=e=>null===e},7884:(e,t,n)=>{"use strict";n.d(t,{$n:()=>r,Kn:()=>l,Qr:()=>c});var o=n(8519);const l=e=>!(0,o.F)(e)&&e instanceof Object&&e.constructor===Object;function r(e,t){return l(e)&&t in e}const c=e=>0===Object.keys(e).length},2646:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});const o=e=>"string"==typeof e},5160:()=>{},5641:()=>{}}]); |