1 line
No EOL
5.7 KiB
JavaScript
1 line
No EOL
5.7 KiB
JavaScript
(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[6925],{3719:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(721),o=n(9196),l=n(4184),s=n.n(l),c=n(2864),a=n(5271),i=n(2629);n(5641);const u=({className:e="",disabled:t=!1,name:n,permalink:r="",target:l,rel:c,style:a,onClick:u,...d})=>{const p=s()("wc-block-components-product-name",e);if(t){const e=d;return(0,o.createElement)("span",{className:p,...e,dangerouslySetInnerHTML:{__html:(0,i.decodeEntities)(n)}})}return(0,o.createElement)("a",{className:p,href:r,target:l,...d,dangerouslySetInnerHTML:{__html:(0,i.decodeEntities)(n)},style:a})};var d=n(5918),p=n(3611);n(5160);const v=({children:e,headingLevel:t,elementType:n=`h${t}`,...r})=>(0,o.createElement)(n,{...r},e),f=(0,r.withProductDataContext)((e=>{const{className:t,headingLevel:n=2,showProductLink:r=!0,linkTarget:l,align:i}=e,f=(0,p.F)(e),{parentClassName:m}=(0,c.useInnerBlockLayoutContext)(),{product:y}=(0,c.useProductDataContext)(),{dispatchStoreEvent:g}=(0,d.n)();return y.id?(0,o.createElement)(v,{headingLevel:n,className:s()(t,f.className,"wc-block-components-product-title",{[`${m}__product-title`]:m,[`wc-block-components-product-title--align-${i}`]:i&&(0,a.uq)()}),style:(0,a.uq)()?f.style:{}},(0,o.createElement)(u,{disabled:!r,name:y.name,permalink:y.permalink,target:l,onClick:()=>{g("product-view-link",{product:y})}})):(0,o.createElement)(v,{headingLevel:n,className:s()(t,f.className,"wc-block-components-product-title",{[`${m}__product-title`]:m,[`wc-block-components-product-title--align-${i}`]:i&&(0,a.uq)()}),style:(0,a.uq)()?f.style:{}})}));let m={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};(0,a.uq)()&&(m={...m,align:{type:"string"}});const y=m,g=(0,r.withFilteredAttributes)(y)(f)},3611:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var r=n(4184),o=n.n(r),l=n(7884),s=n(2646),c=n(1473),a=n(2661);const i=e=>{const t=(e=>{const t=(0,l.Kn)(e)?e:{style:{}};let n=t.style;return(0,s.H)(n)&&(n=JSON.parse(n)||{}),(0,l.Kn)(n)||(n={}),{...t,style:n}})(e),n=(0,a.vc)(t),r=(0,a.l8)(t),i=(0,a.su)(t),u=(0,c.f)(t);return{className:o()(u.className,n.className,r.className,i.className),style:{...u.style,...n.style,...r.style,...i.style}}}},1473:(e,t,n)=>{"use strict";n.d(t,{f:()=>l});var r=n(7884),o=n(2646);const l=e=>{const t=(0,r.Kn)(e.style.typography)?e.style.typography:{},n=(0,o.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:()=>p,vc:()=>u});var r=n(4184),o=n.n(r),l=n(9784),s=n(2289),c=n(7884);function a(e={}){const t={};return(0,s.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function i(e,t){return e&&t?`has-${(0,l.o)(t)}-${e}`:""}function u(e){var t,n,r,l,s,u,d;const{backgroundColor:p,textColor:v,gradient:f,style:m}=e,y=i("background-color",p),g=i("color",v),h=function(e){if(e)return`has-${e}-gradient-background`}(f),k=h||(null==m||null===(t=m.color)||void 0===t?void 0:t.gradient);return{className:o()(g,h,{[y]:!k&&!!y,"has-text-color":v||(null==m||null===(n=m.color)||void 0===n?void 0:n.text),"has-background":p||(null==m||null===(r=m.color)||void 0===r?void 0:r.background)||f||(null==m||null===(l=m.color)||void 0===l?void 0:l.gradient),"has-link-color":(0,c.Kn)(null==m||null===(s=m.elements)||void 0===s?void 0:s.link)?null==m||null===(u=m.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:a({color:(null==m?void 0:m.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:r}=e,l=n?i("border-color",n):"";return o()({"has-border-color":!!n||!(null==r||null===(t=r.border)||void 0===t||!t.color),[l]:!!l})}(e),style:a({border:n})}}function p(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:()=>r});const r=e=>null===e},7884:(e,t,n)=>{"use strict";n.d(t,{$n:()=>l,Kn:()=>o});var r=n(8519);const o=e=>!(0,r.F)(e)&&e instanceof Object&&e.constructor===Object;function l(e,t){return o(e)&&t in e}},2646:(e,t,n)=>{"use strict";n.d(t,{H:()=>r});const r=e=>"string"==typeof e},1290:(e,t,n)=>{"use strict";n.d(t,{$:()=>l});var r=n(7582),o=n(307);function l(e,t){return void 0===t&&(t={}),(0,o.B)(e,(0,r.pi)({delimiter:"."},t))}},5160:()=>{},5641:()=>{},9562:(e,t,n)=>{"use strict";function r(e){return e.toLowerCase()}n.d(t,{U:()=>r})},307:(e,t,n)=>{"use strict";n.d(t,{B:()=>s});var r=n(9562),o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],l=/[^A-Z0-9]+/gi;function s(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,s=void 0===n?o:n,a=t.stripRegexp,i=void 0===a?l:a,u=t.transform,d=void 0===u?r.U:u,p=t.delimiter,v=void 0===p?" ":p,f=c(c(e,s,"$1\0$2"),i,"\0"),m=0,y=f.length;"\0"===f.charAt(m);)m++;for(;"\0"===f.charAt(y-1);)y--;return f.slice(m,y).split("\0").map(d).join(v)}function c(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}},9784:(e,t,n)=>{"use strict";n.d(t,{o:()=>l});var r=n(7582),o=n(1290);function l(e,t){return void 0===t&&(t={}),(0,o.$)(e,(0,r.pi)({delimiter:"-"},t))}},7582:(e,t,n)=>{"use strict";n.d(t,{pi:()=>r});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError}}]); |