|
1
|
|
-(()=>{"use strict";const t=window.ReactDOM;window.React;const n=(t,n)=>{return null==(e=n)||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&""===e.trim()||"number"==typeof e&&0===e?"":`${t}: ${n};`;var e},e=(t,n="box")=>{let e="";return t?.map(((r,s)=>{const{hOffset:i="0px",vOffset:a="0px",blur:l="0px",spreed:o="0px",color:c="#e7f0fe",isInset:$=!1}=r||{},d=$?"inset":"",p=`${i} ${a} ${l}`,g=s+1>=t.length?"":", ";e+="text"===n?`${p} ${c}${g}`:`${p} ${o} ${c} ${d}${g}`})),e||""},r=(t,e,r=!0)=>{const{fontFamily:s="Default",fontCategory:i="sans-serif",fontVariant:a=400,fontWeight:l,isUploadFont:o=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:$,textTransform:d,textDecoration:p,lineHeight:g,letterSpace:h}=e||{},f=!r||!s||"Default"===s,u=c?.desktop||c,m=c?.tablet||u,x=c?.mobile||m,w=t=>{const n=String(t);return["px","em","rem","%","vh","vw"].some((t=>n.endsWith(t)))?n:"number"==typeof t?`${n}px`:""},y=`\n\t\t${f?"":`font-family: '${s}', ${i};`}\n\t\t${n("font-weight",l)}\n\t\t${n("font-size",w(u))}\n\t\t${n("font-style",$)}\n\t\t${n("text-transform",d)}\n\t\t${n("text-decoration",p)}\n\t\t${n("line-height",g)}\n\t\t${n("letter-spacing",h)}\n\t`,b=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",j=f?"":`https://fonts.googleapis.com/css2?family=${s?.split(" ").join("+")}${b.replace(/ /g,"")}&display=swap`;return{googleFontLink:!o||f?"":`@import url(${j});`,styles:`${t}{\n\t\t\t${y}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${t}{\n\t\t\t\t${n("font-size",w(m))}\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${t}{\n\t\t\t\t${n("font-size",w(x))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},s=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const n=["top","right","bottom","left"];return n.map((n=>t[n]||"")).every((t=>!t))?"":n.map((n=>t[n]||"0")).join(" ")}return""},i=t=>Array.from({length:t},((t,n)=>n+1)),a="bBlocksRating",l=window.ReactJSXRuntime,o=({attributes:t,id:o})=>{const{rating:c,gap:$,alignment:d,margin:p,textTypo:g,textColor:h,textShadow:f,iconColor:u="#f0ad4e",iconSize:m="20px",unmarkedColor:x="#ccd6df"}=t,w=`#${o} .${a}`,y=`${w} .stars .star`,b=(c+"").split("."),j=parseInt(b[0]),L=parseInt(b[1]||0);return(0,l.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${r("",g)?.googleFontLink}\n\t\t${r(`${w} .ratingPrefix`,g)?.styles}\n\n\t\t${w} {\n\t\t\tjustify-content: ${d};\n\t\t\tgap: ${$};\n\t\t\tcolor: ${h};\n\t\t\t${n("margin",s(p))}\n\t\t}\n\n\t\t${w} .ratingPrefix{\n\t\t\ttext-shadow: ${e(f,"text")}\n\t\t}\n\n\t\t${w} .stars{\n\t\t\t${n("gap",$)}\n\t\t}\n\n\t\t${y}>.starFill>svg{\n\t\t\t${n("fill",u)}\n\t\t\t${n("width",m)}\n\t\t\t${n("height",m)}\n\t\t}\n\n\t\t${y}>svg{\n\t\t\t${n("fill",x)}\n\t\t\t${n("width",m)}\n\t\t\t${n("height",m)}\n\t\t}\n\n\t\t${y}{\n\t\t\t${n("width",m)}\n\t\t\t${n("height",m)}\n\t\t}\n\n\t\t${i(j).map((t=>`${y}:nth-child(${t}) .starFill`)).join(", ")}{\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t${y}:nth-child(${j+1}) .starFill{\n\t\t\twidth: ${(()=>{switch(L){case 1:return 25;case 2:return 30;case 3:return 35;case 4:return 42.5;case 5:return 50;case 6:return 57.5;case 7:return 65;case 8:return 70;case 9:return 75;default:return 0}})()}%;\n\t\t}\n\t`}})},c=(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:(0,l.jsx)("path",{d:"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"})}),$=(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:(0,l.jsx)("path",{d:"M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.6 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z"})}),d=({attributes:t})=>{const{ratingScale:n,iconStyle:e,prefix:r}=t;return(0,l.jsxs)("div",{className:a,children:[(0,l.jsx)("span",{className:"ratingPrefix",children:r}),(0,l.jsx)("div",{className:"stars",children:i(n).map((t=>(0,l.jsxs)("span",{className:"star",children:["solid"===e?c:$,(0,l.jsx)("span",{className:"starFill",children:c})]},t)))})]})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-star-rating").forEach((n=>{const e=JSON.parse(n.dataset.attributes);(0,t.createRoot)(n).render((0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o,{attributes:e,id:n.id}),(0,l.jsx)(d,{attributes:e})]})),n?.removeAttribute("data-attributes")}))}))})(); |
|
1
|
+(()=>{"use strict";const t=window.ReactDOM;window.React,new class{constructor(t={}){this.defaultOptions={allowedTags:["svg","g","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","defs","clipPath","mask","linearGradient","radialGradient","stop","style","title","desc"],allowedAttributes:["id","class","style","transform","xmlns","xmlns:xlink","version","baseProfile","xml:space","d","x","y","width","height","cx","cy","r","rx","ry","points","x1","y1","x2","y2","viewBox","preserveAspectRatio","overflow","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","opacity","color","paint-order","vector-effect","shape-rendering","display","visibility","clip-path","clip-rule","clipPathUnits","mask","maskUnits","maskContentUnits","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","fx","fy","fr","dx","dy","text-anchor","dominant-baseline","alignment-baseline","font-family","font-size","font-style","font-weight","letter-spacing","word-spacing","textLength","lengthAdjust","role","focusable","aria-hidden","aria-label","aria-labelledby","aria-describedby"],allowedProtocols:["http","https","data"],removeScripts:!0,removeEvents:!0,removeExternalResources:!0,sanitizeStyle:!0},this.options={...this.defaultOptions,...t},this.allowedTagSet=new Set(this.options.allowedTags.map((t=>t.toLowerCase()))),this.allowedAttributeSet=new Set(this.options.allowedAttributes.map((t=>t.toLowerCase())))}sanitize(t){if("string"!=typeof t||""===t.trim())return"";const e=(new DOMParser).parseFromString(t,"image/svg+xml"),s=e.documentElement;return!s||"svg"!==s.localName.toLowerCase()||e.getElementsByTagName("parsererror").length?"":(this.removeScripts(e),this.sanitizeElements(e),(new XMLSerializer).serializeToString(e.documentElement))}async sanitizeFile(t){const e=await fetch(t),s=await e.text();return this.sanitize(`${s}`)}removeScripts(t){this.options.removeScripts&&Array.from(t.querySelectorAll("*")).forEach((t=>{t.localName.toLowerCase().includes("script")&&t.remove()}))}sanitizeElements(t){Array.from(t.querySelectorAll("*")).forEach((t=>{const e=t.localName.toLowerCase();this.allowedTagSet.has(e)?("style"===e&&this.options.sanitizeStyle&&(t.textContent=this.sanitizeCss(t.textContent)),this.sanitizeAttributes(t)):t.remove()}))}sanitizeAttributes(t){Array.from(t.attributes).forEach((e=>{const s=e.name,r=s.toLowerCase(),n=e.value;if(this.options.removeEvents&&r.startsWith("on"))return void t.removeAttribute(s);if(this.options.removeExternalResources&&("href"===r||r.endsWith(":href"))&&!this.isAllowedUrl(n))return void t.removeAttribute(s);const i=r.replace("xlink:","");this.allowedAttributeSet.has(r)||this.allowedAttributeSet.has(i)?this.options.removeExternalResources&&this.hasExternalUrl(n)?t.removeAttribute(s):"style"===r&&this.options.sanitizeStyle&&t.setAttribute(s,this.sanitizeCss(n)):t.removeAttribute(s)}))}hasExternalUrl(t){return!("string"!=typeof t||!/url\s*\(/i.test(t))&&Array.from(t.matchAll(/url\s*\(\s*['"]?([^'")]*)/gi)).some((([,t])=>!t.trim().startsWith("#")))}isAllowedUrl(t){const e=String(t||"").trim();if(e.startsWith("#"))return!0;if(/^data:/i.test(e))return this.options.allowedProtocols.includes("data")&&/^data:image\/(png|jpe?g|gif|webp);base64,/i.test(e);try{return this.options.allowedProtocols.includes(new URL(e).protocol.replace(":",""))}catch{return!1}}sanitizeCss(t){return String(t||"").replace(/expression\s*\(/gi,"").replace(/javascript:/gi,"").replace(/behavior\s*:/gi,"").replace(/binding\s*:/gi,"").replace(/@import[^;]*;?/gi,"").replace(/url\s*\(\s*(['"]?)(?!#)[^)]*\)/gi,"none")}};const e=(t,e)=>{return null==(s=e)||""===s||Array.isArray(s)&&0===s.length||"object"==typeof s&&0===Object.keys(s).length||"string"==typeof s&&""===s.trim()||"number"==typeof s&&0===s?"":`${t}: ${e};`;var s},s=(t,e="box")=>{let s="";return t?.map(((r,n)=>{const{hOffset:i="0px",vOffset:a="0px",blur:o="0px",spreed:l="0px",color:c="#e7f0fe",isInset:p=!1}=r||{},d=p?"inset":"",h=`${i} ${a} ${o}`,m=n+1>=t.length?"":", ";s+="text"===e?`${h} ${c}${m}`:`${h} ${l} ${c} ${d}${m}`})),s||""},r=(t,s,r=!0)=>{const{fontFamily:n="Default",fontCategory:i="sans-serif",fontVariant:a=400,fontWeight:o,isUploadFont:l=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:p,textTransform:d,textDecoration:h,lineHeight:m,letterSpace:u}=s||{},f=!r||!n||"Default"===n,g=c?.desktop||c,x=c?.tablet||g,y=c?.mobile||x,$=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},w=`\n\t\t${f?"":`font-family: '${n}', ${i};`}\n\t\t${e("font-weight",o)}\n\t\t${e("font-size",$(g))}\n\t\t${e("font-style",p)}\n\t\t${e("text-transform",d)}\n\t\t${e("text-decoration",h)}\n\t\t${e("line-height",m)}\n\t\t${e("letter-spacing",u)}\n\t`,b=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",v=f?"":`https://fonts.googleapis.com/css2?family=${n?.split(" ").join("+")}${b.replace(/ /g,"")}&display=swap`;return{googleFontLink:!l||f?"":`@import url(${v});`,styles:`${t}{\n\t\t\t${w}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${t}{\n\t\t\t\t${e("font-size",$(x))}\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${t}{\n\t\t\t\t${e("font-size",$(y))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},n=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const e=["top","right","bottom","left"];return e.map((e=>t[e]||"")).every((t=>!t))?"":e.map((e=>t[e]||"0")).join(" ")}return""},i=t=>Array.from({length:t},((t,e)=>e+1)),a="bBlocksRating",o=window.ReactJSXRuntime,l=({attributes:t,id:l})=>{const{rating:c,gap:p,alignment:d,margin:h,textTypo:m,textColor:u,textShadow:f,iconColor:g="#f0ad4e",iconSize:x="20px",unmarkedColor:y="#ccd6df"}=t,$=`#${l} .${a}`,w=`${$} .stars .star`,b=(c+"").split("."),v=parseInt(b[0]),S=parseInt(b[1]||0);return(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${r("",m)?.googleFontLink}\n\t\t${r(`${$} .ratingPrefix`,m)?.styles}\n\n\t\t${$} {\n\t\t\tjustify-content: ${d};\n\t\t\tgap: ${p};\n\t\t\tcolor: ${u};\n\t\t\t${e("margin",n(h))}\n\t\t}\n\n\t\t${$} .ratingPrefix{\n\t\t\ttext-shadow: ${s(f,"text")}\n\t\t}\n\n\t\t${$} .stars{\n\t\t\t${e("gap",p)}\n\t\t}\n\n\t\t${w}>.starFill>svg{\n\t\t\t${e("fill",g)}\n\t\t\t${e("width",x)}\n\t\t\t${e("height",x)}\n\t\t}\n\n\t\t${w}>svg{\n\t\t\t${e("fill",y)}\n\t\t\t${e("width",x)}\n\t\t\t${e("height",x)}\n\t\t}\n\n\t\t${w}{\n\t\t\t${e("width",x)}\n\t\t\t${e("height",x)}\n\t\t}\n\n\t\t${i(v).map((t=>`${w}:nth-child(${t}) .starFill`)).join(", ")}{\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t${w}:nth-child(${v+1}) .starFill{\n\t\t\twidth: ${(()=>{switch(S){case 1:return 25;case 2:return 30;case 3:return 35;case 4:return 42.5;case 5:return 50;case 6:return 57.5;case 7:return 65;case 8:return 70;case 9:return 75;default:return 0}})()}%;\n\t\t}\n\t`}})},c=(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:(0,o.jsx)("path",{d:"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"})}),p=(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:(0,o.jsx)("path",{ |