PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.4.0
StreamCast – bring live radio to your site with a sleek player v2.4.0
2.4.5 2.4.4 trunk 1.0 1.1 2.0.0 2.1.10 2.1.2 2.1.4 2.1.5 2.1.8 2.2.1 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 All 29 releases
← All changes | build/view.js +1 -1 2.3.42.4.0 View file →
@@ -1 +1 @@
1 -(()=>{"use strict";var e={338:(e,t,n)=>{var r=n(795);t.H=r.createRoot,r.hydrateRoot},795:e=>{e.exports=window.ReactDOM}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var a=r.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=r[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();const r=window.React;var a=n(338);const l=(e,t)=>{return null==(n=t)||""===n||Array.isArray(n)&&0===n.length||"object"==typeof n&&0===Object.keys(n).length||"string"==typeof n&&""===n.trim()||"number"==typeof n&&0===n?"":`${e}: ${t};`;var n},c=(e,t,n=!0)=>{const{fontFamily:r="Default",fontCategory:a="sans-serif",fontVariant:c=400,fontWeight:o,isUploadFont:i=!0,fontSize:s={desktop:null,tablet:null,mobile:null},fontStyle:m,textTransform:u,textDecoration:d,lineHeight:h,letterSpace:p}=t||{},v=!n||!r||"Default"===r,g=s?.desktop||s,y=s?.tablet||g,f=s?.mobile||y,E=e=>{const t=String(e);return["px","em","rem","%","vh","vw"].some((e=>t.endsWith(e)))?t:"number"==typeof e?`${t}px`:""},w=`\n\t\t${v?"":`font-family: '${r}', ${a};`}\n\t\t${l("font-weight",o)}\n\t\t${l("font-size",E(g))}\n\t\t${l("font-style",m)}\n\t\t${l("text-transform",u)}\n\t\t${l("text-decoration",d)}\n\t\t${l("line-height",h)}\n\t\t${l("letter-spacing",p)}\n\t`,$=c&&400!==c?"400i"===c?":ital@1":c?.includes("00i")?`: ital, wght@1, ${c?.replace("00i","00")} `:`: wght@${c} `:"",b=v?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${$.replace(/ /g,"")}&display=swap`;return{googleFontLink:!i||v?"":`@import url(${b});`,styles:`${e}{\n\t\t\t${w}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${e}{\n\t\t\t\t${l("font-size",E(y))}\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${e}{\n\t\t\t\t${l("font-size",E(f))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},o=({attributes:e,id:t})=>{const{radioPlayer:n,radioStyles:a}=e,{playerType:o,playerPosition:i}=n,{playerWidth:s,ultimate:m,backgroundColor:u,echoStream:d,stationName:h,artistFmName:p,playBtnColor:v,timeStamp:g}=a,{playerColors:y,playerOverlayColor:f,thumbnailBorderColor:E,contentColor:w,progressActiveColor:$,buttonHoverColor:b,visualizerColor:C,playerBackgroundImg:N}=m;if(!["ultimate","advanced","minimal","standard","echoStream","auroraPlay","wooden"].includes(o))return null;const S=`#${t}`,k=`${S} .minimal`,x=`${S} .advanced-container`,_=`${S} .ultimate-container`,P=`${S} .stp_custom_circle`,R=`${S} .echoStream`,M=`${S} .woodenPlayer`,L=`${S} .woodenContainer .contentBox`,z=`${R} .echoStream__container`,B=`${z} .echoStream__content .echoStream__controls`,T=`${S} .auroraPlay`,A=`${S} .details-play-pause`,H=`${T} .audio-stuff`,F=`\n ${c("",h?.typo)?.googleFontLink}\n ${c("",p?.typo)?.googleFontLink}\n ${c("",g?.typo)?.googleFontLink}\n\t\t${c(`${A} .details h3`,h?.typo).styles}\n\t\t${c(`${A} .details p`,p?.typo).styles}\n\t\t${c(`${z} .echoStream__content .echoStream__info h1`,h?.typo).styles}\n\t\t${c(`${z} .echoStream__content .echoStream__info p`,p?.typo).styles}\n\t\t${c(`${L} .title`,h?.typo).styles}\n\t\t${c(`${L} .info .time`,g?.typo).styles}\n\n `,U=`\n ${_} #bRadioPlayer {\n width: ${s};\n background-color: ${f};\n }\n ${_} #bRadioPlayer .imageHolder img {\n border-color: ${E};\n }\n ${_} #bRadioPlayer button svg,\n ${_} #bRadioPlayer svg:active,\n ${_} #bRadioPlayer svg:focus {\n fill: ${w};\n }\n ${_} #bRadioPlayer .text p,\n ${_} #bRadioPlayer .rangeControls span {\n color: ${w};\n }\n ${_} #bRadioPlayer button svg:hover {\n fill: ${b};\n }\n ${_} #bRadioPlayer .audioControl button.live svg {\n -webkit-animation: cngBlinking 2s infinite; animation: cngBlinking 2s infinite;\n }\n \n ${_} #bRadioPlayer input[type='range'] {\n background: linear-gradient(90deg, ${$} 50%, white 50%);\n }\n\n ${_} .bRadioPlayer input[type='range']::-webkit-slider-thumb {\n background: ${$};\n }\n ${_} .bRadioPlayer input[type='range']::-moz-range-thumb {\n background: ${$};\n }\n ${_} .bRadioPlayer .visualizerCircle .visualizerCircleEl {\n background-image: linear-gradient(to bottom, ${C}, transparent);\n }\n\n @-webkit-keyframes cngBlinking {\n 0% {\n fill: ${w};\n }\n 50% {\n fill: ${b};\n }\n 100% {\n fill: ${w};\n } }\n }\n @keyframes cngBlinking {\n 0% {\n fill: ${w};\n }\n 50% {\n fill: ${b};\n }\n 100% {\n fill: ${w};\n } }\n }\n `,q={minimal:`\n ${k} {\n ${l("justify-content",i)}\n }\n `,standard:`\n ${P} {\n ${l("justify-content",i)}\n }\n ${P} .plyr__control {\n ${l("width",s)}\n }\n `,ultimate:` \n ${_} {\n ${l("justify-content",i)}\n }\n ${_} #bRadioPlayer{\n background-image: url(${N?.url});\n ${l("width",s)}\n }\n `,advanced:`\n ${x} {\n justify-content: ${i};\n }\n ${x} .advanced-streamcast .player {\n background: ${u};\n }\n `,echoStream:`\n ${R} {\n ${l("justify-content",i)}\n }\n ${z} {\n ${l("width",s)}\n background-image: url('${d?.bgImg?.url}');\n backdrop-filter: blur(${d?.blur}px);\n }\n ${z} .echoStream__content .echoStream__info h1 {\n ${l("color",h?.color)}\n }\n ${z} .echoStream__content .echoStream__info p {\n ${l("color",p?.color)}\n }\n ${R} .echoStream__volume-control button svg, ${z} button svg, ${B} .echoStream__live-indicator span:last-child {\n ${l("color",a?.contentColor)}\n }\n ${R} .echoStream__bg-blur {\n filter: blur(${d?.blur}px);\n }\n\n ${z} .echoStream__content .echoStream__play-button svg {\n ${l("color",v)}\n }\n `,auroraPlay:` \n ${T} {\n ${l("justify-content",i)}\n }\n ${T} .auroraContainer {\n ${l("width",s)}\n ${l("background-color",u)}\n }\n ${A} .play-pause-btn {\n ${l("border-color",a.contentColor)}\n }\n ${A} .details h3 {\n ${l("color",h?.color)}\n }\n ${A} .details p {\n ${l("color",p?.color)}\n }\n ${H} .details-play-pause .play-pause-btn svg, ${H} .volume-audioTime .vol-and-share-btn svg, ${H} .volume-audioTime .currentTime .time {\n ${l("color",a?.contentColor)}\n }\n\n `,wooden:`\n ${M} {\n ${l("justify-content",i)}\n }\n ${M} .woodenContainer {\n ${l("width",s)}\n ${l("background-color",u)}\n }\n ${L} .title{\n ${l("color",h?.color)}\n ${l("background-color",h?.bgColor)}\n transition: all 0.3s ease-in-out;\n }\n ${L} .title:hover {\n ${l("color",h?.hoverColor)}\n ${l("background-color",h?.hoverBgColor)}\n }\n ${L} .woodenControls .play-pause-btn svg, ${L} .woodenControls .toggleVol svg, ${L} .info .wooden-live-indicator {\n ${l("color",a?.contentColor)}\n }\n ${L} .woodenControls input::-webkit-slider-runnable-track {\n ${l("background-color",a?.contentColor)}\n }\n ${L} .woodenControls input::-webkit-slider-thumb {\n ${l("background-color",a?.contentColor)}\n }\n ${L} .info .time {\n ${l("color",g?.color)}\n ${l("background-color",g?.bgColor)}\n transition: all 0.3s ease-in-out;\n }\n ${L} .info .time:hover {\n ${l("color",g?.hoverColor)}\n ${l("background-color",g?.hoverBgColor)}\n }\n `}[o]||"",I="custom"===y?U:"";return(0,r.createElement)("style",{dangerouslySetInnerHTML:{__html:F+q+I}})},i=window.jQuery;var s=n.n(i);const m=n.p+"images/default.c4f31dbb.png",u=({attributes:e,fetchedStationName:t})=>{const{radioPlayer:n}=e,{streamURL:a,stationName:l,welcomeMessage:c,artWork:o,autoPlay:i,initialVolume:u,showTime:d,fetchNameFromUrl:h}=n,[p,v]=(0,r.useState)(t),g=(0,r.useRef)(null);return(0,r.useEffect)((()=>{s()(g?.current).musicPlayer({autoPlay:i,volume:u,loop:!1,timeSeparator:" / ",playerAbovePlaylist:!0,infoElements:["title","artist"],elements:["artwork","information","controls",...d?["time"]:[],"volume"],timeElements:["current"],controlElements:["play","stop"]}),v(t)}),[g.current,t,i,u,d,c,o]),(0,r.useEffect)((()=>{if(g.current){const e=g.current.querySelector(".artist"),t=g.current.querySelector(".title");h?p&&(t.textContent="",e.style.top="23px",e.textContent=h?p:l):(t.textContent=c,e.style.top="42px")}}),[g.current,p,t,c,h]),(0,r.useEffect)((()=>{!h&&g.current&&(g.current.querySelector(".artist").textContent=l)}),[h,l]),(0,r.useEffect)((()=>{const e=s()(g.current).musicPlayer("player");if(d){e[0].firstChild.style.height="200px";const t=e[0].firstChild;if(!t.querySelector(".timeHolder")){const e=document.createElement("div");e.className="timeHolder";const n=document.createElement("div");n.className="time-current",n.textContent="0:00",e.appendChild(n),t.children.length>0?t.insertBefore(e,t.lastChild):t.appendChild(e)}}else e[0].firstChild.style.height="180px",e[0].firstChild&&e[0].firstChild.querySelectorAll(".timeHolder").forEach((e=>{e.remove()}));e[0].firstChild.firstChild.style.backgroundImage=`url("${o?.url?o.url:m}")`}),[d,o]),(0,r.createElement)("div",{style:{width:"100%",overflow:"hidden"},className:"sc_radio advanced-container"},(0,r.createElement)("div",{className:"advanced-streamcast",style:{width:"390px"},ref:g},(0,r.createElement)("ul",{className:"playlist"},(0,r.createElement)("li",{"data-cover":o?.url?o.url:m},(0,r.createElement)("a",{href:a},c)))))},d="#4527a4",h=((0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 20 20",fill:d},(0,r.createElement)("path",{fill:d,fillRule:"evenodd",d:"M9.938 4.016a.146.146 0 00-.054.057L3.027 15.74a.176.176 0 00-.002.183c.016.03.037.05.054.06.015.01.034.017.066.017h13.713a.12.12 0 00.066-.017.163.163 0 00.055-.06.176.176 0 00-.003-.183L10.12 4.073a.146.146 0 00-.054-.057.13.13 0 00-.063-.016.13.13 0 00-.064.016zm1.043-.45a1.13 1.13 0 00-1.96 0L2.166 15.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L10.982 3.566z"}),(0,r.createElement)("rect",{fill:d,width:"2",height:"2",x:"9.002",y:"13",rx:"1"}),(0,r.createElement)("path",{fill:d,d:"M9.1 7.995a.905.905 0 111.8 0l-.35 3.507a.553.553 0 01-1.1 0L9.1 7.995z"})),(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 14.707 14.707"},(0,r.createElement)("rect",{x:"6.275",y:"0",width:"2.158",height:"14.707"})),(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 357 357"},(0,r.createElement)("path",{d:"M357,204H0v-51h357V204z"})),e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}))),p=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"})),v=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"})),g=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M383.822 344.427c-16.045 0-31.024 5.326-41.721 15.979l-152.957-88.42c1.071-5.328 2.142-9.593 2.142-14.919 0-5.328-1.071-9.593-2.142-14.919l150.826-87.35c11.762 10.653 26.741 17.041 43.852 17.041 35.295 0 64.178-28.766 64.178-63.92C448 72.767 419.117 44 383.822 44c-35.297 0-64.179 28.767-64.179 63.92 0 5.327 1.065 9.593 2.142 14.919l-150.821 87.35c-11.767-10.654-26.741-17.041-43.856-17.041-35.296 0-63.108 28.766-63.108 63.92 0 35.153 28.877 63.92 64.178 63.92 17.115 0 32.089-6.389 43.856-17.042l151.891 88.421c-1.076 4.255-2.141 8.521-2.141 13.847 0 34.094 27.806 61.787 62.037 61.787 34.229 0 62.036-27.693 62.036-61.787.001-34.094-27.805-61.787-62.035-61.787z"})),y=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M400 32H48A48 48 0 0 0 0 80v352a48 48 0 0 0 48 48h137.25V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.27c-30.81 0-40.42 19.12-40.42 38.73V256h68.78l-11 71.69h-57.78V480H400a48 48 0 0 0 48-48V80a48 48 0 0 0-48-48z"})),f=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})),E=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,r.createElement)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"})),w=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 576 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"})),$=({attributes:e})=>{const[t,n]=(0,r.useState)(!1),[a,l]=(0,r.useState)(!1),[c,o]=(0,r.useState)(1),{radioPlayer:i}=e,{streamURL:s}=i,[m,u]=(0,r.useState)(0),d=(0,r.useRef)(),g=(0,r.useRef)();(0,r.useEffect)((()=>{d.current=new Audio(s),d.current.preload="none";const e=()=>{u(d.current.currentTime)};return d.current.addEventListener("timeupdate",e),()=>{d.current&&(d.current.pause(),d.current.removeEventListener("timeupdate",e),d.current=null)}}),[s]);const y=e=>{d.current&&(o(e),d.current.volume=e)};return(0,r.useEffect)((()=>{if(g.current){const e=100*c;g.current.style.background=`linear-gradient(90deg, #19afff ${e}%, #d1d9de ${e}%)`}}),[c]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"minimal"},(0,r.createElement)("div",{className:"minimalContainer"},(0,r.createElement)("div",{className:"minimal-controls"},(0,r.createElement)("button",{className:"play-icon",onClick:async()=>{if(d.current)try{t?(d.current.pause(),n(!1)):(l(!0),await d.current.play(),n(!0))}catch(e){console.error("Error playing audio:",e)}finally{l(!1)}}},a?(0,r.createElement)("div",{className:"loading-spinner"}):t?(0,r.createElement)(h,null):(0,r.createElement)(p,null)),(0,r.createElement)("div",{className:"running-time"},(e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n<10?"0":""}${n}`})(m)),(0,r.createElement)("div",{className:"vol-control"},(0,r.createElement)("button",{className:"vol-btn",onClick:()=>{d.current&&y(0===c?1:0)}},0===c?(0,r.createElement)(v,null):(0,r.createElement)(w,null)),(0,r.createElement)("input",{ref:g,className:"vol-range",type:"range",min:"0",max:"1",step:"0.05",value:c,onChange:e=>{y(parseFloat(e.target.value))}}))))))},b=n.p+"images/Pause_circle_icon.13d24cee.png",C=n.p+"images/Play_circle_icon.13369b79.png",N=({attributes:e,id:t,fetchedStationName:n})=>{const{radioPlayer:a}=e,{skin:l,initialVolume:c,streamURL:o,autoPlay:i,stationName:s,welcomeMessage:m,playerPosition:u,fetchNameFromUrl:d}=a,h=(0,r.useRef)(null),p=(0,r.useRef)(null),[v,g]=(0,r.useState)("");(0,r.useEffect)((()=>{window[t]={url:o,lang:"en",codec:"mp3",volume:c,autoplay:i,forceHTML5:!0,jsevents:!0,buffering:0,title:d?n:s,welcome:m,wmode:"transparent",skin:l.name,width:l.width,height:l.height,metadataMode:"shoutcast",metadataInterval:15}}),[l,o,c,i,s,m,u,d,n]);const y=()=>{if(h.current){const e=h.current.contentDocument||h.current.contentWindow.document;if(e){const t=e.querySelector("#MusesRadioPlayer-HTML5-player-0");t&&("center"===u?(t.style.margin="auto",t.style.display="block"):"left"===u?(t.style.marginLeft="0",t.style.marginRight="auto"):"right"===u&&(t.style.marginLeft="auto",t.style.marginRight="0"))}}};return(0,r.useEffect)((()=>{y();const e=h.current;e&&(e.onload=()=>{y()})}),[u]),(0,r.useEffect)((()=>{(async()=>{if("pls"===o.split(".").pop())try{const e=await fetch(o),t=(await e.text()).split("\n");for(const e of t)if(e.toLowerCase().includes("file1=")){const t=e.replace(/file1=/i,"").trim();return void g(t)}}catch(e){console.error("Error fetching the stream URL:",e)}else g(o.trim())})()}),[o]),(0,r.useEffect)((()=>{if("b_circle"===l.name&&v&&p.current){const e=document.querySelector(".stp_custom_circle audio"),t=new window.Plyr(e,{controls:`\n <div class="plyr__controls">\n <button class="plyr__control" aria-label="Play, {title}" data-plyr="play">\n <img src=${b} class="icon--pressed"></img>\n <img src=${C} class="icon--not-pressed"></img>\n <span class="label--pressed plyr__tooltip" role="tooltip">Pause</span>\n <span class="label--not-pressed plyr__tooltip" role="tooltip">Play</span>\n </button>\n </div>\n `});t.on("ready",(function(){const e=document.querySelector(".icon--pressed"),n=document.querySelector(".icon--not-pressed");let r=!0;t.on("pause",(function(a){t.play(),r?(t.muted=!0,r=!1,n.style.display="block",e.style.display="none"):(n.style.display="none",e.style.display="block",r=!0,t.muted=!1)})),t.on("play",(function(){0==t.volume&&(t.volume=.5),r&&(t.muted=!1)}))}))}}),[l,v,c]),(0,r.createElement)("div",{className:"standard-container"},"b_circle"===l.name?(0,r.createElement)("div",{className:"stp_custom_circle"},(0,r.createElement)("audio",{ref:p,className:"b_free",src:v})):(0,r.createElement)("iframe",{ref:h,src:`${window?.myScriptData?.iframePath}?id=${t}&${l.name}`,width:"100%",height:l.height}))},S=n.p+"images/on-air.a85b9d81.png",k=({attributes:e,fetchedStationName:t})=>{const{radioStyles:n,radioPlayer:a}=e,{streamProvider:l,streamMountPoint:c,streamPort:o,streamURL:i,fetchNameFromUrl:s,stationName:m}=a,{ultimate:u}=n,{playerTheme:d,posterImg:h,progressActiveColor:p}=u,v=(0,r.useRef)(null),g=(0,r.useRef)(null),y=(0,r.useRef)(null),f=(0,r.useRef)(null),E=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),w="<svg xmlns='http://www.w3.org/2000/svg' width='130' height='130' viewBox='0 0 800 800'><path d='M86.3,400.7C84.8,229.1,226.5,86.7,400.6,87c172.9,0.3,313.7,142.5,313.1,314.8c-0.6,170.5-138.2,313.3-314.4,313.1\tC224.3,714.7,84.9,572.1,86.3,400.7z M378.8,400.8C378.8,400.8,378.7,400.8,378.8,400.8c-0.1-32.6-0.5-65.3,0.2-97.9\tc0.3-13.7-10.3-23.4-22.7-22.8c-18.3,0.8-36.6,0.2-54.8,0.2c-13.9,0-22.1,8.1-22.1,21.9c0,65.7,0.2,131.4-0.2,197.1\tc-0.1,12.6,9.2,22.6,22.4,22.2c18.4-0.6,36.9-0.5,55.3,0c12.1,0.3,22.2-7.4,22-21.9C378.6,466.7,378.8,433.8,378.8,400.8z\t M420.9,400.8C420.9,400.8,420.9,400.8,420.9,400.8c0.1,33.1,0,66.1,0.1,99.2c0,13.8,7.7,21.4,21.5,21.4c18.8,0,37.7-0.3,56.5,0.1\tc12.3,0.3,21.6-9.6,21.5-21.4c-0.2-66.1-0.1-132.2-0.1-198.3c0-13.3-8.2-21.4-21.7-21.5c-18.6,0-37.2,0.5-55.7-0.2\tc-12-0.5-22.5,9.2-22.3,22C421.2,335,420.9,367.9,420.9,400.8z'></path></svg>";return(0,r.useEffect)((()=>{g.current||v.current&&(g.current=new(window.AudioContext||window.webkitAudioContext),y.current=g.current.createMediaElementSource(v.current),f.current=g.current.createAnalyser(),y.current.connect(f.current),y.current.connect(g.current.destination));const e=document.querySelectorAll(".bRadioPlayer");Object.values(e).map((e=>{const t=e.querySelector("#bRadioAudio"),n=document.querySelector(".playPauseAudio"),r=document.querySelector(".volumeBar"),a=document.querySelector(".rangeControls .mute"),l=document.querySelector(".rangeControls .volumePlace"),c=document.querySelector(".rangeControls .unMute"),o=544>window.innerWidth,i={isReplay:!1,isPaused:!0},s=()=>{if(i.isPaused)n.innerHTML=w,v.current.play();else{if(i.isReplay)return n.innerHTML=w,v.current.play(),void(i.isReplay=!1);n.innerHTML="<svg xmlns='http://www.w3.org/2000/svg' width='130' height='130' viewBox='0 0 800 800'><path d='M713.9,400.5c1.4,171.2-137.8,314.4-313.9,314.3c-175.6,0-314.2-143-314-315c0.2-171.3,140.6-313.9,315-313.4\tC574,87,715.4,228.9,713.9,400.5z M279.5,400.3c0,23.1,0,46.2,0,69.3c0,20.8-0.2,41.7,0.1,62.5c0.1,12.2,6,21.1,17,26.6\tc11,5.5,21.2,3,31.2-2.9c23.3-13.6,46.8-27,70.2-40.5c49.8-28.6,99.6-57.1,149.3-85.8c18.1-10.4,18.7-38.7,1.1-49.4\tc-74.5-45.4-149-90.8-223.5-136.1c-6-3.7-12.6-5.5-19.8-4.2c-15.7,2.9-25.5,14.4-25.5,30.5C279.4,313.6,279.5,357,279.5,400.3z' /></svg>",v.current.pause()}i.isPaused=!i.isPaused};n.addEventListener("click",(()=>{E?g.current?.resume().then((e=>{s()})):s()})),r.value=50;const m=e=>{r.style.background=`-webkit-gradient(linear, left top, right top, color-stop(${e}%,${p}), color-stop(${e}%, #fff))`,r.style.background=`linear-gradient(90deg,${p} ${e}%, #fff ${e}%)`,l.innerHTML=`${parseInt(e)}%`};r.addEventListener("input",(e=>{r.value=e.target.value,t.volume=e.target.value/100,m(e.target.value)})),a.addEventListener("click",(()=>{const e=setInterval((()=>{r.value>0?(r.value--,t.volume=r.value/100,m(r.value)):clearInterval(e)}))})),c.addEventListener("click",(()=>{const e=setInterval((()=>{r.value<100?(r.value++,t.volume=r.value/100,m(r.value)):clearInterval(e)}))}));const u=new Uint8Array(f.current.frequencyBinCount);f.current.getByteFrequencyData(u);const d=document.querySelector(`#${e.id} .visualizerCircle`),h=document.querySelector(`#${e.id} .visualizerBar`),y=document.querySelector(`#${e.id} .audioControl .visualizerToggle`);let $=0;y.addEventListener("click",(()=>{switch(2===$?$=0:$++,$){case 0:h.innerHTML="",d.innerHTML="";break;case 1:(()=>{for(let e=0;e<360;e++){const t=document.createElement("SPAN");t.setAttribute("id",`circleEl${e}`),t.setAttribute("class","visualizerCircleEl"),d.appendChild(t)}const t=()=>{f.current.getByteFrequencyData(u);for(let t=0;t<360;t++){const n=u[t+40],r=document.querySelector(`#${e.id} .visualizerCircle #circleEl${t}`);if(!r)continue;const a=o?206:280,l=Math.max(a,n/2+a||0);r.style.height=`${l}px`,r.style.transform=`translate(-50%, -50%) rotate(${t-90}deg)`}requestAnimationFrame(t)};t()})(),h.innerHTML="";break;case 2:(()=>{for(let e=0;e<50;e++){const t=document.createElement("SPAN");t.setAttribute("id",`barEl${e}`),t.setAttribute("class","visualizerBarEl"),h.appendChild(t)}const t=()=>{f.current.getByteFrequencyData(u);for(let t=0;t<50;t++){const n=u[10*(t+10)],r=document.querySelector(`#${e.id} .visualizerBar #barEl${t}`);if(!r)continue;const a=Math.max(2,n||0);r.style.height=`${a}px`}requestAnimationFrame(t)};t()})(),d.innerHTML=""}}))}))}),[]),(0,r.createElement)("div",{className:"ultimate-container"},(0,r.createElement)("div",{id:"bRadioPlayer",className:`bRadioPlayer ${d}`},(0,r.createElement)("div",{className:"imageHolder"},(0,r.createElement)("img",{src:`${""!==h?.url?""===h?S:h?.url:S}`,alt:"300"}),(0,r.createElement)("div",{className:"visualizerCircle"})),(0,r.createElement)("div",{className:"text"},(0,r.createElement)("p",null,s?t:m)),(0,r.createElement)("input",{className:"volumeBar",type:"range",min:"0",max:"100",step:"0.001",value:"50"}),(0,r.createElement)("div",{className:"rangeControls"},(0,r.createElement)("button",{className:"mute"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"0 0 124.625 124.625"},(0,r.createElement)("path",{d:"M6,92.404h23.1l25.6,19.3c4,3,9.601,0.2,9.601-4.8v-89.2c0-4.9-5.701-7.8-9.601-4.8l-25.6,19.3H6c-3.3,0-6,2.7-6,6v48.301 C0,89.704,2.7,92.404,6,92.404z"}),(0,r.createElement)("path",{d:"M122.4,40.604c-2.7-2.7-7.2-2.7-9.9,0l-11.8,11.8l-11.8-11.8c-2.7-2.7-7.2-2.7-9.9,0c-2.699,2.7-2.699,7.2,0,9.9 l11.801,11.8L79,74.104c-2.699,2.7-2.699,7.2,0,9.9c1.4,1.399,3.2,2.1,5,2.1c1.801,0,3.6-0.7,5-2.1l11.801-11.801L112.6,84.004 c1.4,1.399,3.201,2.1,5,2.1c1.801,0,3.601-0.7,5-2.1c2.701-2.7,2.701-7.2,0-9.9l-12-11.8l11.801-11.8 C125.1,47.804,125.1,43.304,122.4,40.604z"}))),(0,r.createElement)("span",{className:"volumePlace"},"50%"),(0,r.createElement)("button",{className:"unMute"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"0 0 93.038 93.038"},(0,r.createElement)("path",{d:"M46.547,75.521c0,1.639-0.947,3.128-2.429,3.823c-0.573,0.271-1.187,0.402-1.797,0.402c-0.966,0-1.923-0.332-2.696-0.973 l-23.098-19.14H4.225C1.892,59.635,0,57.742,0,55.409V38.576c0-2.334,1.892-4.226,4.225-4.226h12.303l23.098-19.14 c1.262-1.046,3.012-1.269,4.493-0.569c1.481,0.695,2.429,2.185,2.429,3.823L46.547,75.521L46.547,75.521z M62.784,68.919 c-0.103,0.007-0.202,0.011-0.304,0.011c-1.116,0-2.192-0.441-2.987-1.237l-0.565-0.567c-1.482-1.479-1.656-3.822-0.408-5.504 c3.164-4.266,4.834-9.323,4.834-14.628c0-5.706-1.896-11.058-5.484-15.478c-1.366-1.68-1.24-4.12,0.291-5.65l0.564-0.565 c0.844-0.844,1.975-1.304,3.199-1.231c1.192,0.06,2.305,0.621,3.061,1.545c4.977,6.09,7.606,13.484,7.606,21.38 c0,7.354-2.325,14.354-6.725,20.24C65.131,68.216,64.007,68.832,62.784,68.919z M80.252,81.976 c-0.764,0.903-1.869,1.445-3.052,1.495c-0.058,0.002-0.117,0.004-0.177,0.004c-1.119,0-2.193-0.442-2.988-1.237l-0.555-0.555 c-1.551-1.55-1.656-4.029-0.246-5.707c6.814-8.104,10.568-18.396,10.568-28.982c0-11.011-4.019-21.611-11.314-29.847 c-1.479-1.672-1.404-4.203,0.17-5.783l0.554-0.555c0.822-0.826,1.89-1.281,3.115-1.242c1.163,0.033,2.263,0.547,3.036,1.417 c8.818,9.928,13.675,22.718,13.675,36.01C93.04,59.783,88.499,72.207,80.252,81.976z"})))),(0,r.createElement)("div",{className:"audioControl"},(0,r.createElement)("button",{className:"visualizerToggle"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"0 0 800 800"},(0,r.createElement)("path",{d:"M180.3,729.4h-72.4c-13.5,0-24.5-11-24.5-24.5V235.8c0-13.5,11-24.5,24.5-24.5h72.4c13.5,0,24.5,11,24.5,24.5v469.1\tC204.7,718.4,193.7,729.4,180.3,729.4"}),(0,r.createElement)("path",{d:"M351,729.4h-72.4c-13.5,0-24.5-11-24.5-24.5V331.7c0-13.5,11-24.5,24.5-24.5H351c13.5,0,24.5,11,24.5,24.5v373.2\tC375.4,718.4,364.4,729.4,351,729.4"}),(0,r.createElement)("path",{d:"M521.9,729.4h-72.4c-13.5,0-24.5-11-24.5-24.5V95.1c0-13.5,11-24.5,24.5-24.5h72.4c13.5,0,24.5,11,24.5,24.5v609.8\tC546.3,718.4,535.3,729.4,521.9,729.4"}),(0,r.createElement)("path",{d:"M692.1,729.4h-72.4c-13.5,0-24.5-11-24.5-24.5V331.7c0-13.5,11-24.5,24.5-24.5h72.4c13.5,0,24.5,11,24.5,24.5v373.2\tC716.6,718.4,705.6,729.4,692.1,729.4"}))),(0,r.createElement)("button",{className:"playPauseAudio"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"130",height:"130",viewBox:"0 0 800 800"},(0,r.createElement)("path",{d:"M713.9,400.5c1.4,171.2-137.8,314.4-313.9,314.3c-175.6,0-314.2-143-314-315c0.2-171.3,140.6-313.9,315-313.4\tC574,87,715.4,228.9,713.9,400.5z M279.5,400.3c0,23.1,0,46.2,0,69.3c0,20.8-0.2,41.7,0.1,62.5c0.1,12.2,6,21.1,17,26.6\tc11,5.5,21.2,3,31.2-2.9c23.3-13.6,46.8-27,70.2-40.5c49.8-28.6,99.6-57.1,149.3-85.8c18.1-10.4,18.7-38.7,1.1-49.4\tc-74.5-45.4-149-90.8-223.5-136.1c-6-3.7-12.6-5.5-19.8-4.2c-15.7,2.9-25.5,14.4-25.5,30.5C279.4,313.6,279.5,357,279.5,400.3z"}))),(0,r.createElement)("button",{className:"live"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"-16 0 512 512.00113"},(0,r.createElement)("path",{d:"m262.84375 140.558594c-12.699219 12.671875-33.28125 12.671875-45.980469 0-12.695312-12.671875-12.695312-33.21875 0-45.890625 12.699219-12.671875 33.28125-12.671875 45.980469 0 12.695312 12.671875 12.695312 33.21875 0 45.890625zm0 0"}),(0,r.createElement)("path",{d:"m307.257812 189.726562c-3.960937 0-7.921874-1.511718-10.9375-4.539062-6.03125-6.039062-6.019531-15.824219.019532-21.851562 12.238281-12.214844 18.976562-28.453126 18.976562-45.722657s-6.738281-33.507812-18.976562-45.722656c-6.039063-6.03125-6.050782-15.8125-.019532-21.855469 6.027344-6.039062 15.8125-6.050781 21.851563-.019531 18.089844 18.054687 28.050781 42.058594 28.050781 67.597656 0 25.535157-9.960937 49.542969-28.050781 67.597657-3.015625 3.011718-6.964844 4.515624-10.914063 4.515624zm0 0"}),(0,r.createElement)("path",{d:"m342.210938 235.222656c-3.960938 0-7.921876-1.511718-10.9375-4.535156-6.03125-6.042969-6.019532-15.824219.019531-21.855469 24.414062-24.367187 37.863281-56.761719 37.863281-91.21875s-13.449219-66.851562-37.863281-91.21875c-6.039063-6.03125-6.050781-15.8125-.019531-21.855469 6.03125-6.039062 15.8125-6.050781 21.851562-.019531 30.265625 30.207031 46.9375 70.371094 46.933594 113.09375 0 42.722657-16.667969 82.890625-46.933594 113.097657-3.015625 3.007812-6.964844 4.511718-10.914062 4.511718zm0 0"}),(0,r.createElement)("path",{d:"m172.371094 189.726562c-3.949219 0-7.898438-1.503906-10.917969-4.515624-18.089844-18.054688-28.050781-42.0625-28.050781-67.597657 0-25.539062 9.960937-49.542969 28.050781-67.597656 6.039063-6.03125 15.824219-6.023437 21.851563.019531 6.03125 6.039063 6.019531 15.824219-.019532 21.855469-12.238281 12.214844-18.976562 28.453125-18.976562 45.722656s6.738281 33.507813 18.976562 45.722657c6.039063 6.027343 6.050782 15.8125.019532 21.851562-3.015626 3.023438-6.976563 4.539062-10.933594 4.539062zm0 0"}),(0,r.createElement)("path",{d:"m137.417969 235.222656c-3.953125 0-7.902344-1.503906-10.917969-4.515625-30.265625-30.207031-46.933594-70.371093-46.933594-113.09375 0-42.726562 16.667969-82.890625 46.933594-113.097656 6.039062-6.027344 15.824219-6.019531 21.851562.023437 6.03125 6.039063 6.019532 15.820313-.019531 21.851563-24.414062 24.367187-37.863281 56.761719-37.863281 91.21875s13.449219 66.855469 37.863281 91.222656c6.039063 6.03125 6.050781 15.8125.019531 21.855469-3.015624 3.023438-6.976562 4.535156-10.933593 4.535156zm0 0"}),(0,r.createElement)("path",{d:"m443.480469 261.9375h-407.332031c-19.964844 0-36.148438 16.183594-36.148438 36.144531v177.769531c0 19.964844 16.183594 36.148438 36.148438 36.148438h407.328124c19.964844 0 36.148438-16.183594 36.148438-36.148438v-177.769531c0-19.960937-16.183594-36.144531-36.144531-36.144531zm-324.609375 203.683594h-56.933594c-8.53125 0-15.449219-6.917969-15.449219-15.453125v-126.398438c0-8.53125 6.917969-15.453125 15.449219-15.453125 8.535156 0 15.453125 6.917969 15.453125 15.453125v110.945313h41.480469c8.535156 0 15.453125 6.917968 15.453125 15.453125 0 8.535156-6.917969 15.453125-15.453125 15.453125zm63.328125-15.453125c0 8.535156-6.917969 15.453125-15.453125 15.453125s-15.453125-6.917969-15.453125-15.453125v-126.398438c0-8.53125 6.917969-15.453125 15.453125-15.453125s15.453125 6.917969 15.453125 15.453125zm130.015625-121.929688-38.160156 126.394531c-.003907.011719-.007813.023438-.011719.035157-4.144531 14.144531-25.273438 13.796875-29.5625 0-.003907-.011719-.007813-.023438-.011719-.035157l-38.160156-126.394531c-2.464844-8.171875 2.15625-16.792969 10.328125-19.261719 8.164062-2.464843 16.792969 2.15625 19.257812 10.328126l23.367188 77.394531 23.367187-77.394531c2.46875-8.171876 11.089844-12.796876 19.261719-10.328126 8.167969 2.46875 12.792969 11.089844 10.324219 19.261719zm95.066406 35.320313c8.535156 0 15.453125 6.917968 15.453125 15.453125 0 8.53125-6.917969 15.453125-15.453125 15.453125h-43.851562v40.25h52.175781c8.535156 0 15.453125 6.917968 15.453125 15.453125 0 8.535156-6.917969 15.453125-15.453125 15.453125h-67.628907c-8.535156 0-15.453124-6.917969-15.453124-15.453125v-126.398438c0-8.53125 6.917968-15.453125 15.453124-15.453125h69.710938c8.53125 0 15.453125 6.917969 15.453125 15.453125 0 8.535157-6.921875 15.453125-15.453125 15.453125h-54.261719v24.335938zm0 0"})))),(0,r.createElement)("div",{className:"visualizerBar"}),(0,r.createElement)("audio",{id:"bRadioAudio",className:"bRadioAudio",crossOrigin:"anonymous",ref:v,style:{height:0,width:0,opacity:0}},(0,r.createElement)("source",{src:((e,t,n,r)=>{let a="";return a="shout-cast"===e?`${t}:${n}/;`:"ice-cast"===e?`${t}:${n}/${r}`:t,a+"?download=false"})(l,i,o,c)}))))},x=({attributes:e,fetchedStationName:t})=>{const[n,a]=(0,r.useState)(!1),[l,c]=(0,r.useState)(!1),[o,i]=(0,r.useState)(1),[s,m]=(0,r.useState)(!1),[u,d]=(0,r.useState)(!1),$=(0,r.useRef)(),b=(0,r.useRef)(),{radioPlayer:C}=e,{stationName:N,welcomeMessage:S,fetchNameFromUrl:k,streamURL:x}=C,_={facebook:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(x)}`,twitter:`https://twitter.com/intent/tweet?url=${encodeURIComponent(x)}&text=${encodeURIComponent("Listening to this awesome radio!")}`,email:`mailto:?subject=${encodeURIComponent("Check out this Radio")}&body=${encodeURIComponent("Listen here: "+x)}`};(0,r.useEffect)((()=>($.current=new Audio(x),$.current.preload="none",()=>{$.current&&($.current.pause(),$.current=null)})),[]);const P=e=>{$.current&&(i(e),$.current.volume=e,b.current&&clearTimeout(b.current),b.current=setTimeout((()=>{m(!1)}),2e3))};return(0,r.createElement)("div",{className:"echoStream"},(0,r.createElement)("div",{className:"echoStream__container"},(0,r.createElement)("div",{className:"echoStream__bg-blur"})," ",(0,r.createElement)("div",{className:"echoStream__content"},(0,r.createElement)("div",{className:"echoStream__info"},(0,r.createElement)("h1",null,k?t:N),(0,r.createElement)("p",null,S)),(0,r.createElement)("button",{onClick:async()=>{if($.current)try{n?($.current.pause(),a(!1)):(d(!0),await $.current.play(),a(!0))}catch(e){console.error("Error playing audio:",e)}finally{d(!1)}},className:"echoStream__play-button "+(u?"loading":""),"aria-label":n?"Pause":"Play",disabled:u},u?(0,r.createElement)("div",{className:"loading-spinner"}):n?(0,r.createElement)(h,null):(0,r.createElement)(p,{className:"playIcon"})),(0,r.createElement)("div",{className:"echoStream__controls"},(0,r.createElement)("div",{className:"echoStream__volume-control"},(0,r.createElement)("button",{onClick:()=>{$.current&&P(0===o?1:0)},onMouseEnter:()=>m(!0)},0===o?(0,r.createElement)(v,null):(0,r.createElement)(w,null)),s&&(0,r.createElement)("div",{className:"volume-slider",onMouseEnter:()=>{b.current&&clearTimeout(b.current)},onMouseLeave:()=>{b.current=setTimeout((()=>{m(!1)}),1e3)}},(0,r.createElement)("input",{type:"range",min:"0",max:"1",step:"0.1",value:o,onChange:e=>P(parseFloat(e.target.value))}))),(0,r.createElement)("div",{className:"echoStream__live-indicator"},(0,r.createElement)("span",null),(0,r.createElement)("span",null,"Live")),(0,r.createElement)("button",{onClick:()=>c(!l)},(0,r.createElement)(g,null)))),l&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"overlay",onClick:()=>c(!1)}),(0,r.createElement)("div",{className:"echoStream__share"},(0,r.createElement)("div",{className:"echoStream__share-links"},(0,r.createElement)("a",{href:_.twitter,target:"_blank",rel:"noopener noreferrer"},(0,r.createElement)(f,null)),(0,r.createElement)("a",{href:_.facebook,target:"_blank",rel:"noopener noreferrer"},(0,r.createElement)(y,null)),(0,r.createElement)("a",{href:_.email},(0,r.createElement)(E,null)))))))},_=({attributes:e,fetchedStationName:t})=>{const[n,a]=(0,r.useState)(!1),[l,c]=(0,r.useState)(!1),[o,i]=(0,r.useState)(1),[s,m]=(0,r.useState)(!1),[u,d]=(0,r.useState)(0),$=(0,r.useRef)(),b=(0,r.useRef)(),{radioPlayer:C,radioStyles:N}=e,{artWork:S,fetchNameFromUrl:k,stationName:x,welcomeMessage:_,streamURL:P}=C,R={facebook:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(P)}`,twitter:`https://twitter.com/intent/tweet?url=${encodeURIComponent(P)}&text=${encodeURIComponent("Listening to this awesome radio!")}`,email:`mailto:?subject=${encodeURIComponent("Check out this Radio")}&body=${encodeURIComponent("Listen to this awesome radio here: "+P)}`};(0,r.useEffect)((()=>{$.current=new Audio(P),$.current.preload="none";const e=()=>{d($.current.currentTime)};return $.current.addEventListener("timeupdate",e),()=>{$.current&&($.current.pause(),$.current.removeEventListener("timeupdate",e),$.current=null)}}),[P]);return(0,r.createElement)("div",{className:"auroraPlay"},(0,r.createElement)("div",{className:"auroraContainer"},(0,r.createElement)("div",{className:"posterImg"},(0,r.createElement)("img",{src:S.url,alt:""})),(0,r.createElement)("div",{className:"audio-stuff"},(0,r.createElement)("div",{className:"details-play-pause"},(0,r.createElement)("div",{className:"play-pause-btn "+(s?"loading":""),onClick:async()=>{if($.current)try{n?($.current.pause(),a(!1)):(m(!0),await $.current.play(),a(!0))}catch(e){console.error("Error playing audio:",e)}finally{m(!1)}},"aria-label":n?"Pause":"Play",disabled:s},s?(0,r.createElement)("div",{className:"loading-spinner"}):n?(0,r.createElement)(h,null):(0,r.createElement)(p,{className:"playIcon"})),(0,r.createElement)("div",{className:"details"},(0,r.createElement)("h3",null,(k?t:x)?.length>50?(k?t:x)?.slice(0,50)+"...":k?t:x),(0,r.createElement)("p",null,_))),(0,r.createElement)("div",{className:"volume-audioTime"},(0,r.createElement)("div",{className:"vol-and-share-btn"},(0,r.createElement)("div",{className:"vol",onClick:()=>{var e;$.current&&(e=0===o?1:0,$.current&&(i(e),$.current.volume=e,b.current&&clearTimeout(b.current)))}},0===o?(0,r.createElement)(v,null):(0,r.createElement)(w,null)),(0,r.createElement)("div",{className:"share2",onClick:()=>c(!l)},(0,r.createElement)(g,null))),(0,r.createElement)("div",{className:"currentTime"},(0,r.createElement)("span",null),(0,r.createElement)("div",{className:"time"},(e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n<10?"0":""}${n}`})(u))))),l&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"overlay",onClick:()=>c(!1)}),(0,r.createElement)("div",{className:"auroraPlay-share"},(0,r.createElement)("div",{className:"auroraPlay-share-links"},(0,r.createElement)("a",{href:R.twitter,target:"_blank",rel:"noopener noreferrer"},(0,r.createElement)(f,null)),(0,r.createElement)("a",{href:R.facebook,target:"_blank",rel:"noopener noreferrer"},(0,r.createElement)(y,null)),(0,r.createElement)("a",{href:R.email},(0,r.createElement)(E,null)))))))},P=({attributes:e,fetchedStationName:t})=>{const[n,a]=(0,r.useState)(!1),[l,c]=(0,r.useState)(1),[o,i]=(0,r.useState)(!1),[s,m]=(0,r.useState)(!1),[u,d]=(0,r.useState)(0),g=(0,r.useRef)(),y=(0,r.useRef)(),f=(0,r.useRef)(),{radioPlayer:E}=e,{stationName:$,welcomeMessage:b,fetchNameFromUrl:C,streamURL:N}=E;(0,r.useEffect)((()=>{g.current=new Audio(N),g.current.preload="none";const e=()=>{d(g.current.currentTime)};return g.current.addEventListener("timeupdate",e),()=>{g.current&&(g.current.pause(),g.current.removeEventListener("timeupdate",e),g.current=null)}}),[N]);const S=e=>{g.current&&(c(e),g.current.volume=e,f.current&&clearTimeout(f.current),f.current=setTimeout((()=>{i(!1)}),2e3))};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"woodenPlayer",ref:y},(0,r.createElement)("div",{className:"woodenContainer"},(0,r.createElement)("div",{className:"discarea"},(0,r.createElement)("div",{className:"disc"}),(0,r.createElement)("div",{className:"stylus"},(0,r.createElement)("div",{className:"pivot"}),(0,r.createElement)("div",{className:"arm"}),(0,r.createElement)("div",{className:"head"}))),(0,r.createElement)("div",{className:"contentBox"},(0,r.createElement)("span",{className:"title wooodenTiitle"},C?t:$),(0,r.createElement)("div",{className:"woodenControls"},(0,r.createElement)("div",{className:"play-pause-btn "+(s?"loading":""),onClick:async()=>{if(g.current)try{n?(y.current.classList.remove("playing"),g.current.pause(),a(!1)):(m(!0),await g.current.play(),a(!0),y.current.classList.add("playing"))}catch(e){console.error("Error playing audio:",e)}finally{m(!1)}},"aria-label":n?"Pause":"Play",disabled:s},s?(0,r.createElement)("div",{className:"loading-spinner"}):n?(0,r.createElement)(h,null):(0,r.createElement)(p,{className:"playIcon"})),(0,r.createElement)("div",{className:"toggleVol",onClick:()=>{g.current&&S(0===l?1:0)},onMouseEnter:()=>i(!0)},0===l?(0,r.createElement)(v,null):(0,r.createElement)(w,null)),(0,r.createElement)("input",{className:"woodenVolume",type:"range",min:"0",max:"1",step:"0.01",value:l,onChange:e=>S(parseFloat(e.target.value))})),(0,r.createElement)("div",{className:"info"},(0,r.createElement)("div",{className:"wooden-live-indicator"},(0,r.createElement)("span",null),(0,r.createElement)("span",null,"Live")),(0,r.createElement)("div",{className:"time"},(e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n<10?"0":""}${n}`})(u)))))))},R=({attributes:e,id:t})=>{const{radioPlayer:n}=e,{playerType:a,skin:l,streamURL:c,streamPort:i,stationName:s,fetchNameFromUrl:m,streamProvider:d}=n,[h,p]=(0,r.useState)(null);let v="",g="";"ultimate"===a?(v=`${c}:${i}/currentsong?sid=1`,g=`${c}:${i}/status-json.xsl`,"other"===d&&(v=`${c}/currentsong?sid=1`,g=`${c}/status-json.xsl`)):(v=`${c}/currentsong?sid=1`,g=`${c}/status-json.xsl`);const y=async()=>{try{const e=new FormData;e.append("action","my_user_vote"),e.append("url",v);const t=await fetch(`${window.myScriptData.ajaxUrl}`,{method:"POST",body:e});if(!t.ok)throw new Error("Network response was not ok");const n=await t.json();return n?.data?n.data:null}catch(e){return console.error("There was a problem with the fetch operation:",e),null}},f=async()=>{try{const e=await fetch(g),t=await e.json(),n=t.icestats?.source||null;return n?n?.title||n?.song||n?.server_name||"No Title Available":null}catch(e){return null}};return(0,r.useEffect)((()=>{m&&(async(e,t)=>{let n=null;"standard"===e||"advanced"===e||"echoStream"===e||"auroraPlay"===e||"wooden"===e?(n=await y(),n||(n=await f()),n||(n=s)):"ultimate"===e&&("shout-cast"===t?n=await y():"ice-cast"===t?n=await f():"other"===t&&(n=await y(),n||(n=await f()),n||(n=s)),n||(n=s))})(a,d)}),[a,d,i,m]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o,{attributes:e,id:t}),(0,r.createElement)("style",null,e.css),(0,r.createElement)("div",{className:"streamcast-container",id:t},"standard"===a&&"b_circle"===l.name&&(0,r.createElement)(N,{attributes:e,id:t,fetchedStationName:h}),"ultimate"===a&&(0,r.createElement)(k,{attributes:e,id:t,fetchedStationName:h}),"advanced"===a&&(0,r.createElement)(u,{attributes:e,id:t,fetchedStationName:h}),"minimal"===a&&(0,r.createElement)($,{attributes:e,id:t,fetchedStationName:h}),"echoStream"===a&&(0,r.createElement)(x,{attributes:e,fetchedStationName:h}),"auroraPlay"===a&&(0,r.createElement)(_,{attributes:e,fetchedStationName:h}),"wooden"===a&&(0,r.createElement)(P,{attributes:e,fetchedStationName:h})))};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-scb-streamcast-block").forEach((e=>{if(!e.dataset.attributes)return;const t=JSON.parse(e.dataset.attributes);(0,a.H)(e).render((0,r.createElement)(r.Fragment,null,(0,r.createElement)(o,{attributes:t,id:e.id}),(0,r.createElement)(R,{attributes:t,id:e.id}))),e?.removeAttribute("data-attributes")}))}))})();
1 +(()=>{"use strict";var e={338:(e,t,a)=>{var r=a(795);t.H=r.createRoot,r.hydrateRoot},795:e=>{e.exports=window.ReactDOM}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,a),l.exports}a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})();const r=window.React;var n=a(338);const l=(e,t)=>{return null==(a=t)||""===a||Array.isArray(a)&&0===a.length||"object"==typeof a&&0===Object.keys(a).length||"string"==typeof a&&""===a.trim()||"number"==typeof a&&0===a?"":`${e}: ${t};`;var a},o=(e,t,a=!0)=>{const{fontFamily:r="Default",fontCategory:n="sans-serif",fontVariant:o=400,fontWeight:c,isUploadFont:i=!0,fontSize:s={desktop:null,tablet:null,mobile:null},fontStyle:u,textTransform:m,textDecoration:d,lineHeight:h,letterSpace:p}=t||{},v=!a||!r||"Default"===r,g=s?.desktop||s,y=s?.tablet||g,w=s?.mobile||y,E=e=>{const t=String(e);return["px","em","rem","%","vh","vw"].some((e=>t.endsWith(e)))?t:"number"==typeof e?`${t}px`:""},b=`\n\t\t${v?"":`font-family: '${r}', ${n};`}\n\t\t${l("font-weight",c)}\n\t\t${l("font-size",E(g))}\n\t\t${l("font-style",u)}\n\t\t${l("text-transform",m)}\n\t\t${l("text-decoration",d)}\n\t\t${l("line-height",h)}\n\t\t${l("letter-spacing",p)}\n\t`,f=o&&400!==o?"400i"===o?":ital@1":o?.includes("00i")?`: ital, wght@1, ${o?.replace("00i","00")} `:`: wght@${o} `:"",$=v?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${f.replace(/ /g,"")}&display=swap`;return{googleFontLink:!i||v?"":`@import url(${$});`,styles:`${e}{\n\t\t\t${b}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${e}{\n\t\t\t\t${l("font-size",E(y))}\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${e}{\n\t\t\t\t${l("font-size",E(w))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},c=({attributes:e,id:t})=>{const{radioPlayer:a,radioStyles:n}=e,{playerType:c,playerPosition:i}=a,{playerWidth:s,ultimate:u,backgroundColor:m,echoStream:d,stationName:h,artistFmName:p,playBtnColor:v,timeStamp:g}=n,{playerColors:y,playerOverlayColor:w,thumbnailBorderColor:E,contentColor:b,progressActiveColor:f,buttonHoverColor:$,visualizerColor:C,playerBackgroundImg:N}=u;if(!["ultimate","advanced","minimal","standard","echoStream","auroraPlay","wooden"].includes(c))return null;const S=`#${t}`,k=`${S} .minimal`,x=`${S} .advanced-player`,_=`${S} .ultimate-container`,P=`${S} .stp_custom_circle`,L=`${S} .echoStream`,M=`${S} .woodenPlayer`,R=`${S} .woodenContainer .contentBox`,z=`${L} .echoStream__container`,T=`${z} .echoStream__content .echoStream__controls`,B=`${S} .auroraPlay`,U=`${S} .details-play-pause`,A=`${B} .audio-stuff`,F=`\n ${o("",h?.typo)?.googleFontLink}\n ${o("",p?.typo)?.googleFontLink}\n ${o("",g?.typo)?.googleFontLink}\n\t\t${o(`${U} .details h3`,h?.typo).styles}\n\t\t${o(`${U} .details p`,p?.typo).styles}\n\t\t${o(`${z} .echoStream__content .echoStream__info h1`,h?.typo).styles}\n\t\t${o(`${z} .echoStream__content .echoStream__info p`,p?.typo).styles}\n\t\t${o(`${R} .title`,h?.typo).styles}\n\t\t${o(`${R} .info .time`,g?.typo).styles}\n\n `,V=`\n ${_} #bRadioPlayer {\n width: ${s};\n background-color: ${w};\n }\n ${_} #bRadioPlayer .imageHolder img {\n border-color: ${E};\n }\n ${_} #bRadioPlayer button svg,\n ${_} #bRadioPlayer svg:active,\n ${_} #bRadioPlayer svg:focus {\n fill: ${b};\n }\n ${_} #bRadioPlayer .text p,\n ${_} #bRadioPlayer .rangeControls span {\n color: ${b};\n }\n ${_} #bRadioPlayer button svg:hover {\n fill: ${$};\n }\n ${_} #bRadioPlayer .audioControl button.live svg {\n -webkit-animation: cngBlinking 2s infinite; animation: cngBlinking 2s infinite;\n }\n \n ${_} #bRadioPlayer input[type='range'] {\n background: linear-gradient(90deg, ${f} 50%, white 50%);\n }\n\n ${_} .bRadioPlayer input[type='range']::-webkit-slider-thumb {\n background: ${f};\n }\n ${_} .bRadioPlayer input[type='range']::-moz-range-thumb {\n background: ${f};\n }\n ${_} .bRadioPlayer .visualizerCircle .visualizerCircleEl {\n background-image: linear-gradient(to bottom, ${C}, transparent);\n }\n\n @-webkit-keyframes cngBlinking {\n 0% {\n fill: ${b};\n }\n 50% {\n fill: ${$};\n }\n 100% {\n fill: ${b};\n } }\n }\n @keyframes cngBlinking {\n 0% {\n fill: ${b};\n }\n 50% {\n fill: ${$};\n }\n 100% {\n fill: ${b};\n } }\n }\n `,I={minimal:`\n ${k} {\n ${l("justify-content",i)}\n }\n `,standard:`\n ${P} {\n ${l("justify-content",i)}\n }\n ${P} .plyr__control {\n ${l("width",s)}\n }\n `,ultimate:` \n ${_} {\n ${l("justify-content",i)}\n }\n ${_} #bRadioPlayer{\n background-image: url(${N?.url});\n ${l("width",s)}\n }\n `,advanced:`\n ${x} {\n background: ${m};\n }\n `,echoStream:`\n ${L} {\n ${l("justify-content",i)}\n }\n ${z} {\n ${l("width",s)}\n background-image: url('${d?.bgImg?.url}');\n backdrop-filter: blur(${d?.blur}px);\n }\n ${z} .echoStream__content .echoStream__info h1 {\n ${l("color",h?.color)}\n }\n ${z} .echoStream__content .echoStream__info p {\n ${l("color",p?.color)}\n }\n ${L} .echoStream__volume-control button svg, ${z} button svg, ${T} .echoStream__live-indicator span:last-child {\n ${l("color",n?.contentColor)}\n }\n ${L} .echoStream__bg-blur {\n filter: blur(${d?.blur}px);\n }\n\n ${z} .echoStream__content .echoStream__play-button svg {\n ${l("color",v)}\n }\n `,auroraPlay:` \n ${B} {\n ${l("justify-content",i)}\n }\n ${B} .auroraContainer {\n ${l("width",s)}\n ${l("background-color",m)}\n }\n ${U} .play-pause-btn {\n ${l("border-color",n.contentColor)}\n }\n ${U} .details h3 {\n ${l("color",h?.color)}\n }\n ${U} .details p {\n ${l("color",p?.color)}\n }\n ${A} .details-play-pause .play-pause-btn svg, ${A} .volume-audioTime .vol-and-share-btn svg, ${A} .volume-audioTime .currentTime .time {\n ${l("color",n?.contentColor)}\n }\n\n `,wooden:`\n ${M} {\n ${l("justify-content",i)}\n }\n ${M} .woodenContainer {\n ${l("width",s)}\n ${l("background-color",m)}\n }\n ${R} .title{\n ${l("color",h?.color)}\n ${l("background-color",h?.bgColor)}\n transition: all 0.3s ease-in-out;\n }\n ${R} .title:hover {\n ${l("color",h?.hoverColor)}\n ${l("background-color",h?.hoverBgColor)}\n }\n ${R} .woodenControls .play-pause-btn svg, ${R} .woodenControls .toggleVol svg, ${R} .info .wooden-live-indicator {\n ${l("color",n?.contentColor)}\n }\n ${R} .woodenControls input::-webkit-slider-runnable-track {\n ${l("background-color",n?.contentColor)}\n }\n ${R} .woodenControls input::-webkit-slider-thumb {\n ${l("background-color",n?.contentColor)}\n }\n ${R} .info .time {\n ${l("color",g?.color)}\n ${l("background-color",g?.bgColor)}\n transition: all 0.3s ease-in-out;\n }\n ${R} .info .time:hover {\n ${l("color",g?.hoverColor)}\n ${l("background-color",g?.hoverBgColor)}\n }\n `}[c]||"",H="custom"===y?V:"";return(0,r.createElement)("style",{dangerouslySetInnerHTML:{__html:F+I+H}})},i=(window.jQuery,a.p+"images/default.c4f31dbb.png"),s="#4527a4",u=((0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 20 20",fill:s},(0,r.createElement)("path",{fill:s,fillRule:"evenodd",d:"M9.938 4.016a.146.146 0 00-.054.057L3.027 15.74a.176.176 0 00-.002.183c.016.03.037.05.054.06.015.01.034.017.066.017h13.713a.12.12 0 00.066-.017.163.163 0 00.055-.06.176.176 0 00-.003-.183L10.12 4.073a.146.146 0 00-.054-.057.13.13 0 00-.063-.016.13.13 0 00-.064.016zm1.043-.45a1.13 1.13 0 00-1.96 0L2.166 15.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L10.982 3.566z"}),(0,r.createElement)("rect",{fill:s,width:"2",height:"2",x:"9.002",y:"13",rx:"1"}),(0,r.createElement)("path",{fill:s,d:"M9.1 7.995a.905.905 0 111.8 0l-.35 3.507a.553.553 0 01-1.1 0L9.1 7.995z"})),(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 14.707 14.707"},(0,r.createElement)("rect",{x:"6.275",y:"0",width:"2.158",height:"14.707"})),(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 357 357"},(0,r.createElement)("path",{d:"M357,204H0v-51h357V204z"})),e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}))),m=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"})),d=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"})),h=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M383.822 344.427c-16.045 0-31.024 5.326-41.721 15.979l-152.957-88.42c1.071-5.328 2.142-9.593 2.142-14.919 0-5.328-1.071-9.593-2.142-14.919l150.826-87.35c11.762 10.653 26.741 17.041 43.852 17.041 35.295 0 64.178-28.766 64.178-63.92C448 72.767 419.117 44 383.822 44c-35.297 0-64.179 28.767-64.179 63.92 0 5.327 1.065 9.593 2.142 14.919l-150.821 87.35c-11.767-10.654-26.741-17.041-43.856-17.041-35.296 0-63.108 28.766-63.108 63.92 0 35.153 28.877 63.92 64.178 63.92 17.115 0 32.089-6.389 43.856-17.042l151.891 88.421c-1.076 4.255-2.141 8.521-2.141 13.847 0 34.094 27.806 61.787 62.037 61.787 34.229 0 62.036-27.693 62.036-61.787.001-34.094-27.805-61.787-62.035-61.787z"})),p=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M400 32H48A48 48 0 0 0 0 80v352a48 48 0 0 0 48 48h137.25V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.27c-30.81 0-40.42 19.12-40.42 38.73V256h68.78l-11 71.69h-57.78V480H400a48 48 0 0 0 48-48V80a48 48 0 0 0-48-48z"})),v=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})),g=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,r.createElement)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"})),y=e=>(0,r.createElement)("svg",{...e,stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 576 512",height:"200px",width:"200px",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"})),w=e=>(0,r.createElement)("svg",{stroke:"currentColor",...e,fill:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})),E=({attributes:e})=>{const[t,a]=(0,r.useState)(!1),[n,l]=(0,r.useState)(!1),[o,c]=(0,r.useState)(1),{radioPlayer:i}=e,{streamURL:s}=i,[h,p]=(0,r.useState)(0),v=(0,r.useRef)(),g=(0,r.useRef)();(0,r.useEffect)((()=>{v.current=new Audio(s),v.current.preload="none";const e=()=>{p(v.current.currentTime)};return v.current.addEventListener("timeupdate",e),()=>{v.current&&(v.current.pause(),v.current.removeEventListener("timeupdate",e),v.current=null)}}),[s]);const w=e=>{v.current&&(c(e),v.current.volume=e)},E=e=>{const t=Math.floor(e/60),a=Math.floor(e%60);return`${t}:${a<10?"0":""}${a}`};return(0,r.useEffect)((()=>{if(g.current){const e=100*o;g.current.style.background=`linear-gradient(90deg, #19afff ${e}%, #d1d9de ${e}%)`}}),[o]),(0,r.createElement)("section",{className:"minimal",role:"region","aria-label":"Minimal audio player"},(0,r.createElement)("div",{className:"minimalContainer"},(0,r.createElement)("div",{className:"minimal-controls"},(0,r.createElement)("button",{className:"play-icon",onClick:async()=>{if(v.current)try{t?(v.current.pause(),a(!1)):(l(!0),await v.current.play(),a(!0))}catch(e){console.error("Error playing audio:",e)}finally{l(!1)}},"aria-label":t?"Pause":"Play","aria-pressed":t,disabled:n},n?(0,r.createElement)("div",{className:"loading-spinner",role:"status","aria-label":"Loading audio"}):t?(0,r.createElement)(u,{"aria-hidden":"true"}):(0,r.createElement)(m,{"aria-hidden":"true"})),(0,r.createElement)("time",{className:"running-time","aria-label":`Current playback time ${E(h)}`},E(h)),(0,r.createElement)("div",{className:"vol-control"},(0,r.createElement)("button",{className:"vol-btn",onClick:()=>{v.current&&w(0===o?1:0)},"aria-label":0===o?"Unmute":"Mute","aria-pressed":0===o},0===o?(0,r.createElement)(d,{"aria-hidden":"true"}):(0,r.createElement)(y,{"aria-hidden":"true"})),(0,r.createElement)("input",{id:"minimal-volume",ref:g,className:"vol-range",type:"range",min:"0",max:"1",step:"0.05",value:o,onChange:e=>{w(parseFloat(e.target.value))},"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":o})))))},b=a.p+"images/Pause_circle_icon.13d24cee.png",f=a.p+"images/Play_circle_icon.13369b79.png",$=({attributes:e,id:t,fetchedStationName:a})=>{const{radioPlayer:n}=e,{skin:l,initialVolume:o,streamURL:c,autoPlay:i,stationName:s,welcomeMessage:u,playerPosition:m,fetchNameFromUrl:d}=n,h=(0,r.useRef)(null),p=(0,r.useRef)(null),[v,g]=(0,r.useState)("");(0,r.useEffect)((()=>{window[t]={url:c,lang:"en",codec:"mp3",volume:o,autoplay:i,forceHTML5:!0,jsevents:!0,buffering:0,title:d?a:s,welcome:u,wmode:"transparent",skin:l.name,width:l.width,height:l.height,metadataMode:"shoutcast",metadataInterval:15}}),[l,c,o,i,s,u,m,d,a]);const y=()=>{if(h.current){const e=h.current.contentDocument||h.current.contentWindow.document;if(e){const t=e.querySelector("#MusesRadioPlayer-HTML5-player-0");t&&("center"===m?(t.style.margin="auto",t.style.display="block"):"left"===m?(t.style.marginLeft="0",t.style.marginRight="auto"):"right"===m&&(t.style.marginLeft="auto",t.style.marginRight="0"))}}};return(0,r.useEffect)((()=>{y();const e=h.current;e&&(e.onload=()=>{y()})}),[m]),(0,r.useEffect)((()=>{(async()=>{if("pls"===c.split(".").pop())try{const e=await fetch(c),t=(await e.text()).split("\n");for(const e of t)if(e.toLowerCase().includes("file1=")){const t=e.replace(/file1=/i,"").trim();return void g(t)}}catch(e){console.error("Error fetching the stream URL:",e)}else g(c.trim())})()}),[c]),(0,r.useEffect)((()=>{if("b_circle"===l.name&&v&&p.current){const e=document.querySelector(".stp_custom_circle audio"),t=new window.Plyr(e,{controls:`\n <div class="plyr__controls">\n <button \n class="plyr__control" \n aria-label="Play or pause"\n data-plyr="play"\n aria-pressed="false"\n >\n <img src=${b} alt="" class="icon--pressed" aria-hidden="true" />\n <img src=${f} alt="" class="icon--not-pressed" aria-hidden="true" />\n <span class="label--pressed plyr__tooltip" role="tooltip">Pause</span>\n <span class="label--not-pressed plyr__tooltip" role="tooltip">Play</span>\n </button>\n </div>\n `});t.on("ready",(function(){const e=document.querySelector(".icon--pressed"),a=document.querySelector(".icon--not-pressed");let r=!0;t.on("pause",(function(){t.play(),r?(t.muted=!0,r=!1,a.style.display="block",e.style.display="none"):(a.style.display="none",e.style.display="block",r=!0,t.muted=!1)})),t.on("play",(function(){0===t.volume&&(t.volume=.5),r&&(t.muted=!1)}))}))}}),[l,v,o]),(0,r.createElement)("section",{className:"standard-container",role:"region","aria-label":"Standard audio player"},"b_circle"===l.name?(0,r.createElement)("div",{className:"stp_custom_circle"},(0,r.createElement)("audio",{ref:p,className:"b_free",src:v,"aria-label":`Audio stream for ${d?a:s}`})):(0,r.createElement)("iframe",{ref:h,src:`${window?.myScriptData?.iframePath}?id=${t}&${l.name}`,width:"100%",height:l.height,title:`Radio player for ${d?a:s}`}))},C=a.p+"images/on-air.a85b9d81.png",N=({attributes:e,fetchedStationName:t})=>{const{radioStyles:a,radioPlayer:n}=e,{streamProvider:l,streamMountPoint:o,streamPort:c,streamURL:i,fetchNameFromUrl:s,stationName:u}=n,{ultimate:m}=a,{playerTheme:d,posterImg:h,progressActiveColor:p}=m,v=(0,r.useRef)(null),g=(0,r.useRef)(null),y=(0,r.useRef)(null),w=(0,r.useRef)(null),E=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),b="<svg xmlns='http://www.w3.org/2000/svg' width='130' height='130' viewBox='0 0 800 800'><path d='M86.3,400.7C84.8,229.1,226.5,86.7,400.6,87c172.9,0.3,313.7,142.5,313.1,314.8c-0.6,170.5-138.2,313.3-314.4,313.1\tC224.3,714.7,84.9,572.1,86.3,400.7z M378.8,400.8C378.8,400.8,378.7,400.8,378.8,400.8c-0.1-32.6-0.5-65.3,0.2-97.9\tc0.3-13.7-10.3-23.4-22.7-22.8c-18.3,0.8-36.6,0.2-54.8,0.2c-13.9,0-22.1,8.1-22.1,21.9c0,65.7,0.2,131.4-0.2,197.1\tc-0.1,12.6,9.2,22.6,22.4,22.2c18.4-0.6,36.9-0.5,55.3,0c12.1,0.3,22.2-7.4,22-21.9C378.6,466.7,378.8,433.8,378.8,400.8z\t M420.9,400.8C420.9,400.8,420.9,400.8,420.9,400.8c0.1,33.1,0,66.1,0.1,99.2c0,13.8,7.7,21.4,21.5,21.4c18.8,0,37.7-0.3,56.5,0.1\tc12.3,0.3,21.6-9.6,21.5-21.4c-0.2-66.1-0.1-132.2-0.1-198.3c0-13.3-8.2-21.4-21.7-21.5c-18.6,0-37.2,0.5-55.7-0.2\tc-12-0.5-22.5,9.2-22.3,22C421.2,335,420.9,367.9,420.9,400.8z'></path></svg>";return(0,r.useEffect)((()=>{g.current||v.current&&(g.current=new(window.AudioContext||window.webkitAudioContext),y.current=g.current.createMediaElementSource(v.current),w.current=g.current.createAnalyser(),y.current.connect(w.current),y.current.connect(g.current.destination));const e=document.querySelectorAll(".bRadioPlayer");Object.values(e).map((e=>{const t=e.querySelector("#bRadioAudio"),a=document.querySelector(".playPauseAudio"),r=document.querySelector(".volumeBar"),n=document.querySelector(".rangeControls .mute"),l=document.querySelector(".rangeControls .volumePlace"),o=document.querySelector(".rangeControls .unMute"),c=544>window.innerWidth,i={isReplay:!1,isPaused:!0},s=()=>{if(i.isPaused)a.innerHTML=b,v.current.play();else{if(i.isReplay)return a.innerHTML=b,v.current.play(),void(i.isReplay=!1);a.innerHTML="<svg xmlns='http://www.w3.org/2000/svg' width='130' height='130' viewBox='0 0 800 800'><path d='M713.9,400.5c1.4,171.2-137.8,314.4-313.9,314.3c-175.6,0-314.2-143-314-315c0.2-171.3,140.6-313.9,315-313.4\tC574,87,715.4,228.9,713.9,400.5z M279.5,400.3c0,23.1,0,46.2,0,69.3c0,20.8-0.2,41.7,0.1,62.5c0.1,12.2,6,21.1,17,26.6\tc11,5.5,21.2,3,31.2-2.9c23.3-13.6,46.8-27,70.2-40.5c49.8-28.6,99.6-57.1,149.3-85.8c18.1-10.4,18.7-38.7,1.1-49.4\tc-74.5-45.4-149-90.8-223.5-136.1c-6-3.7-12.6-5.5-19.8-4.2c-15.7,2.9-25.5,14.4-25.5,30.5C279.4,313.6,279.5,357,279.5,400.3z' /></svg>",v.current.pause()}i.isPaused=!i.isPaused};a.addEventListener("click",(()=>{E?g.current?.resume().then((e=>{s()})):s()})),r.value=50;const u=e=>{r.style.background=`-webkit-gradient(linear, left top, right top, color-stop(${e}%,${p}), color-stop(${e}%, #fff))`,r.style.background=`linear-gradient(90deg,${p} ${e}%, #fff ${e}%)`,l.innerHTML=`${parseInt(e)}%`};r.addEventListener("input",(e=>{r.value=e.target.value,t.volume=e.target.value/100,u(e.target.value)})),n.addEventListener("click",(()=>{const e=setInterval((()=>{r.value>0?(r.value--,t.volume=r.value/100,u(r.value)):clearInterval(e)}))})),o.addEventListener("click",(()=>{const e=setInterval((()=>{r.value<100?(r.value++,t.volume=r.value/100,u(r.value)):clearInterval(e)}))}));const m=new Uint8Array(w.current.frequencyBinCount);w.current.getByteFrequencyData(m);const d=document.querySelector(`#${e.id} .visualizerCircle`),h=document.querySelector(`#${e.id} .visualizerBar`),y=document.querySelector(`#${e.id} .audioControl .visualizerToggle`);let f=0;y.addEventListener("click",(()=>{switch(2===f?f=0:f++,f){case 0:h.innerHTML="",d.innerHTML="";break;case 1:(()=>{for(let e=0;e<360;e++){const t=document.createElement("SPAN");t.setAttribute("id",`circleEl${e}`),t.setAttribute("class","visualizerCircleEl"),d.appendChild(t)}const t=()=>{w.current.getByteFrequencyData(m);for(let t=0;t<360;t++){const a=m[t+40],r=document.querySelector(`#${e.id} .visualizerCircle #circleEl${t}`);if(!r)continue;const n=c?206:280,l=Math.max(n,a/2+n||0);r.style.height=`${l}px`,r.style.transform=`translate(-50%, -50%) rotate(${t-90}deg)`}requestAnimationFrame(t)};t()})(),h.innerHTML="";break;case 2:(()=>{for(let e=0;e<50;e++){const t=document.createElement("SPAN");t.setAttribute("id",`barEl${e}`),t.setAttribute("class","visualizerBarEl"),h.appendChild(t)}const t=()=>{w.current.getByteFrequencyData(m);for(let t=0;t<50;t++){const a=m[10*(t+10)],r=document.querySelector(`#${e.id} .visualizerBar #barEl${t}`);if(!r)continue;const n=Math.max(2,a||0);r.style.height=`${n}px`}requestAnimationFrame(t)};t()})(),d.innerHTML=""}}))}))}),[]),(0,r.createElement)("section",{className:"ultimate-container",role:"region","aria-label":"Ultimate audio player"},(0,r.createElement)("div",{id:"bRadioPlayer",className:`bRadioPlayer ${d}`},(0,r.createElement)("div",{className:"imageHolder"},(0,r.createElement)("img",{src:""!==h?.url?""===h?C:h?.url:C,alt:`${s?t:u} station poster`}),(0,r.createElement)("div",{className:"visualizerCircle","aria-hidden":"true"})),(0,r.createElement)("div",{className:"text"},(0,r.createElement)("h2",null,s?t:u)),(0,r.createElement)("label",{htmlFor:"volumeBar",className:"sr-only",style:{display:"none"}},"Volume"),(0,r.createElement)("input",{id:"volumeBar",className:"volumeBar",type:"range",min:"0",max:"100",step:"0.001",defaultValue:"50","aria-label":"Volume control"}),(0,r.createElement)("div",{className:"rangeControls"},(0,r.createElement)("button",{className:"mute","aria-label":"Mute audio"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"0 0 124.625 124.625"},(0,r.createElement)("path",{d:"M6,92.404h23.1l25.6,19.3c4,3,9.601,0.2,9.601-4.8v-89.2c0-4.9-5.701-7.8-9.601-4.8l-25.6,19.3H6c-3.3,0-6,2.7-6,6v48.301 C0,89.704,2.7,92.404,6,92.404z"}),(0,r.createElement)("path",{d:"M122.4,40.604c-2.7-2.7-7.2-2.7-9.9,0l-11.8,11.8l-11.8-11.8c-2.7-2.7-7.2-2.7-9.9,0c-2.699,2.7-2.699,7.2,0,9.9 l11.801,11.8L79,74.104c-2.699,2.7-2.699,7.2,0,9.9c1.4,1.399,3.2,2.1,5,2.1c1.801,0,3.6-0.7,5-2.1l11.801-11.801L112.6,84.004 c1.4,1.399,3.201,2.1,5,2.1c1.801,0,3.601-0.7,5-2.1c2.701-2.7,2.701-7.2,0-9.9l-12-11.8l11.801-11.8 C125.1,47.804,125.1,43.304,122.4,40.604z"}))),(0,r.createElement)("span",{className:"volumePlace","aria-live":"polite"},"50%"),(0,r.createElement)("button",{className:"unMute","aria-label":"Unmute audio"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"0 0 93.038 93.038"},(0,r.createElement)("path",{d:"M46.547,75.521c0,1.639-0.947,3.128-2.429,3.823c-0.573,0.271-1.187,0.402-1.797,0.402c-0.966,0-1.923-0.332-2.696-0.973 l-23.098-19.14H4.225C1.892,59.635,0,57.742,0,55.409V38.576c0-2.334,1.892-4.226,4.225-4.226h12.303l23.098-19.14 c1.262-1.046,3.012-1.269,4.493-0.569c1.481,0.695,2.429,2.185,2.429,3.823L46.547,75.521L46.547,75.521z M62.784,68.919 c-0.103,0.007-0.202,0.011-0.304,0.011c-1.116,0-2.192-0.441-2.987-1.237l-0.565-0.567c-1.482-1.479-1.656-3.822-0.408-5.504 c3.164-4.266,4.834-9.323,4.834-14.628c0-5.706-1.896-11.058-5.484-15.478c-1.366-1.68-1.24-4.12,0.291-5.65l0.564-0.565 c0.844-0.844,1.975-1.304,3.199-1.231c1.192,0.06,2.305,0.621,3.061,1.545c4.977,6.09,7.606,13.484,7.606,21.38 c0,7.354-2.325,14.354-6.725,20.24C65.131,68.216,64.007,68.832,62.784,68.919z M80.252,81.976 c-0.764,0.903-1.869,1.445-3.052,1.495c-0.058,0.002-0.117,0.004-0.177,0.004c-1.119,0-2.193-0.442-2.988-1.237l-0.555-0.555 c-1.551-1.55-1.656-4.029-0.246-5.707c6.814-8.104,10.568-18.396,10.568-28.982c0-11.011-4.019-21.611-11.314-29.847 c-1.479-1.672-1.404-4.203,0.17-5.783l0.554-0.555c0.822-0.826,1.89-1.281,3.115-1.242c1.163,0.033,2.263,0.547,3.036,1.417 c8.818,9.928,13.675,22.718,13.675,36.01C93.04,59.783,88.499,72.207,80.252,81.976z"})))),(0,r.createElement)("div",{className:"audioControl"},(0,r.createElement)("button",{className:"visualizerToggle","aria-label":"Toggle audio visualizer","aria-pressed":"false"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"0 0 800 800"},(0,r.createElement)("path",{d:"M180.3,729.4h-72.4c-13.5,0-24.5-11-24.5-24.5V235.8c0-13.5,11-24.5,24.5-24.5h72.4c13.5,0,24.5,11,24.5,24.5v469.1\tC204.7,718.4,193.7,729.4,180.3,729.4"}),(0,r.createElement)("path",{d:"M351,729.4h-72.4c-13.5,0-24.5-11-24.5-24.5V331.7c0-13.5,11-24.5,24.5-24.5H351c13.5,0,24.5,11,24.5,24.5v373.2\tC375.4,718.4,364.4,729.4,351,729.4"}),(0,r.createElement)("path",{d:"M521.9,729.4h-72.4c-13.5,0-24.5-11-24.5-24.5V95.1c0-13.5,11-24.5,24.5-24.5h72.4c13.5,0,24.5,11,24.5,24.5v609.8\tC546.3,718.4,535.3,729.4,521.9,729.4"}),(0,r.createElement)("path",{d:"M692.1,729.4h-72.4c-13.5,0-24.5-11-24.5-24.5V331.7c0-13.5,11-24.5,24.5-24.5h72.4c13.5,0,24.5,11,24.5,24.5v373.2\tC716.6,718.4,705.6,729.4,692.1,729.4"}))),(0,r.createElement)("button",{className:"playPauseAudio","aria-label":"Play audio","aria-pressed":"false"},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"130",height:"130",viewBox:"0 0 800 800"},(0,r.createElement)("path",{d:"M713.9,400.5c1.4,171.2-137.8,314.4-313.9,314.3c-175.6,0-314.2-143-314-315c0.2-171.3,140.6-313.9,315-313.4\tC574,87,715.4,228.9,713.9,400.5z M279.5,400.3c0,23.1,0,46.2,0,69.3c0,20.8-0.2,41.7,0.1,62.5c0.1,12.2,6,21.1,17,26.6\tc11,5.5,21.2,3,31.2-2.9c23.3-13.6,46.8-27,70.2-40.5c49.8-28.6,99.6-57.1,149.3-85.8c18.1-10.4,18.7-38.7,1.1-49.4\tc-74.5-45.4-149-90.8-223.5-136.1c-6-3.7-12.6-5.5-19.8-4.2c-15.7,2.9-25.5,14.4-25.5,30.5C279.4,313.6,279.5,357,279.5,400.3z"}))),(0,r.createElement)("button",{className:"live","aria-label":"Live indicator",disabled:!0},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"-16 0 512 512.00113"},(0,r.createElement)("path",{d:"m262.84375 140.558594c-12.699219 12.671875-33.28125 12.671875-45.980469 0-12.695312-12.671875-12.695312-33.21875 0-45.890625 12.699219-12.671875 33.28125-12.671875 45.980469 0 12.695312 12.671875 12.695312 33.21875 0 45.890625zm0 0"}),(0,r.createElement)("path",{d:"m307.257812 189.726562c-3.960937 0-7.921874-1.511718-10.9375-4.539062-6.03125-6.039062-6.019531-15.824219.019532-21.851562 12.238281-12.214844 18.976562-28.453126 18.976562-45.722657s-6.738281-33.507812-18.976562-45.722656c-6.039063-6.03125-6.050782-15.8125-.019532-21.855469 6.027344-6.039062 15.8125-6.050781 21.851563-.019531 18.089844 18.054687 28.050781 42.058594 28.050781 67.597656 0 25.535157-9.960937 49.542969-28.050781 67.597657-3.015625 3.011718-6.964844 4.515624-10.914063 4.515624zm0 0"}),(0,r.createElement)("path",{d:"m342.210938 235.222656c-3.960938 0-7.921876-1.511718-10.9375-4.535156-6.03125-6.042969-6.019532-15.824219.019531-21.855469 24.414062-24.367187 37.863281-56.761719 37.863281-91.21875s-13.449219-66.851562-37.863281-91.21875c-6.039063-6.03125-6.050781-15.8125-.019531-21.855469 6.03125-6.039062 15.8125-6.050781 21.851562-.019531 30.265625 30.207031 46.9375 70.371094 46.933594 113.09375 0 42.722657-16.667969 82.890625-46.933594 113.097657-3.015625 3.007812-6.964844 4.511718-10.914062 4.511718zm0 0"}),(0,r.createElement)("path",{d:"m172.371094 189.726562c-3.949219 0-7.898438-1.503906-10.917969-4.515624-18.089844-18.054688-28.050781-42.0625-28.050781-67.597657 0-25.539062 9.960937-49.542969 28.050781-67.597656 6.039063-6.03125 15.824219-6.023437 21.851563.019531 6.03125 6.039063 6.019531 15.824219-.019532 21.855469-12.238281 12.214844-18.976562 28.453125-18.976562 45.722656s6.738281 33.507813 18.976562 45.722657c6.039063 6.027343 6.050782 15.8125.019532 21.851562-3.015626 3.023438-6.976563 4.539062-10.933594 4.539062zm0 0"}),(0,r.createElement)("path",{d:"m137.417969 235.222656c-3.953125 0-7.902344-1.503906-10.917969-4.515625-30.265625-30.207031-46.933594-70.371093-46.933594-113.09375 0-42.726562 16.667969-82.890625 46.933594-113.097656 6.039062-6.027344 15.824219-6.019531 21.851562.023437 6.03125 6.039063 6.019532 15.820313-.019531 21.851563-24.414062 24.367187-37.863281 56.761719-37.863281 91.21875s13.449219 66.855469 37.863281 91.222656c6.039063 6.03125 6.050781 15.8125.019531 21.855469-3.015624 3.023438-6.976562 4.535156-10.933593 4.535156zm0 0"}),(0,r.createElement)("path",{d:"m443.480469 261.9375h-407.332031c-19.964844 0-36.148438 16.183594-36.148438 36.144531v177.769531c0 19.964844 16.183594 36.148438 36.148438 36.148438h407.328124c19.964844 0 36.148438-16.183594 36.148438-36.148438v-177.769531c0-19.960937-16.183594-36.144531-36.144531-36.144531zm-324.609375 203.683594h-56.933594c-8.53125 0-15.449219-6.917969-15.449219-15.453125v-126.398438c0-8.53125 6.917969-15.453125 15.449219-15.453125 8.535156 0 15.453125 6.917969 15.453125 15.453125v110.945313h41.480469c8.535156 0 15.453125 6.917968 15.453125 15.453125 0 8.535156-6.917969 15.453125-15.453125 15.453125zm63.328125-15.453125c0 8.535156-6.917969 15.453125-15.453125 15.453125s-15.453125-6.917969-15.453125-15.453125v-126.398438c0-8.53125 6.917969-15.453125 15.453125-15.453125s15.453125 6.917969 15.453125 15.453125zm130.015625-121.929688-38.160156 126.394531c-.003907.011719-.007813.023438-.011719.035157-4.144531 14.144531-25.273438 13.796875-29.5625 0-.003907-.011719-.007813-.023438-.011719-.035157l-38.160156-126.394531c-2.464844-8.171875 2.15625-16.792969 10.328125-19.261719 8.164062-2.464843 16.792969 2.15625 19.257812 10.328126l23.367188 77.394531 23.367187-77.394531c2.46875-8.171876 11.089844-12.796876 19.261719-10.328126 8.167969 2.46875 12.792969 11.089844 10.324219 19.261719zm95.066406 35.320313c8.535156 0 15.453125 6.917968 15.453125 15.453125 0 8.53125-6.917969 15.453125-15.453125 15.453125h-43.851562v40.25h52.175781c8.535156 0 15.453125 6.917968 15.453125 15.453125 0 8.535156-6.917969 15.453125-15.453125 15.453125h-67.628907c-8.535156 0-15.453124-6.917969-15.453124-15.453125v-126.398438c0-8.53125 6.917968-15.453125 15.453124-15.453125h69.710938c8.53125 0 15.453125 6.917969 15.453125 15.453125 0 8.535157-6.921875 15.453125-15.453125 15.453125h-54.261719v24.335938zm0 0"})))),(0,r.createElement)("div",{className:"visualizerBar","aria-hidden":"true"}),(0,r.createElement)("audio",{id:"bRadioAudio",className:"bRadioAudio",crossOrigin:"anonymous",ref:v,style:{height:0,width:0,opacity:0},"aria-label":`Audio stream for ${s?t:u}`},(0,r.createElement)("source",{src:((e,t,a,r)=>{let n="";return n="shout-cast"===e?`${t}:${a}/;`:"ice-cast"===e?`${t}:${a}/${r}`:t,n+"?download=false"})(l,i,c,o)}))))},S=({attributes:e,fetchedStationName:t})=>{const[a,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(!1),[c,i]=(0,r.useState)(1),[s,w]=(0,r.useState)(!1),[E,b]=(0,r.useState)(!1),f=(0,r.useRef)(),$=(0,r.useRef)(),{radioPlayer:C}=e,{stationName:N,welcomeMessage:S,fetchNameFromUrl:k,streamURL:x}=C,_={facebook:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(x)}`,twitter:`https://twitter.com/intent/tweet?url=${encodeURIComponent(x)}&text=${encodeURIComponent("Listening to this awesome radio!")}`,email:`mailto:?subject=${encodeURIComponent("Check out this Radio")}&body=${encodeURIComponent("Listen here: "+x)}`};(0,r.useEffect)((()=>(f.current=new Audio(x),f.current.preload="none",()=>{f.current&&(f.current.pause(),f.current=null)})),[x]);const P=e=>{f.current&&(i(e),f.current.volume=e,$.current&&clearTimeout($.current),$.current=setTimeout((()=>{w(!1)}),2e3))};return(0,r.createElement)("section",{className:"echoStream",role:"region","aria-label":"EchoStream audio player"},(0,r.createElement)("div",{className:"echoStream__container"},(0,r.createElement)("div",{className:"echoStream__bg-blur","aria-hidden":"true"}),(0,r.createElement)("div",{className:"echoStream__content"},(0,r.createElement)("div",{className:"echoStream__info"},(0,r.createElement)("h1",null,k?t:N),S&&(0,r.createElement)("p",null,S)),(0,r.createElement)("button",{onClick:async()=>{if(f.current)try{a?(f.current.pause(),n(!1)):(b(!0),await f.current.play(),n(!0))}catch(e){console.error("Error playing audio:",e)}finally{b(!1)}},className:"echoStream__play-button "+(E?"loading":""),"aria-label":a?"Pause":"Play","aria-pressed":a,disabled:E},E?(0,r.createElement)("div",{className:"loading-spinner",role:"status","aria-label":"Loading audio"}):a?(0,r.createElement)(u,{"aria-hidden":"true"}):(0,r.createElement)(m,{className:"playIcon","aria-hidden":"true"})),(0,r.createElement)("div",{className:"echoStream__controls"},(0,r.createElement)("div",{className:"echoStream__volume-control"},(0,r.createElement)("button",{onClick:()=>{f.current&&P(0===c?1:0)},onMouseEnter:()=>w(!0),"aria-label":0===c?"Unmute":"Mute","aria-pressed":0===c},0===c?(0,r.createElement)(d,{"aria-hidden":"true"}):(0,r.createElement)(y,{"aria-hidden":"true"})),s&&(0,r.createElement)("div",{className:"volume-slider",onMouseEnter:()=>{$.current&&clearTimeout($.current)},onMouseLeave:()=>{$.current=setTimeout((()=>{w(!1)}),1e3)}},(0,r.createElement)("input",{id:"echo-volume",type:"range",min:"0",max:"1",step:"0.1",value:c,onChange:e=>P(parseFloat(e.target.value)),"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":c,"aria-label":"Volume"}))),(0,r.createElement)("div",{className:"echoStream__live-indicator",role:"status","aria-label":"Live broadcast"},(0,r.createElement)("span",{"aria-hidden":"true"}),(0,r.createElement)("span",null,"Live")),(0,r.createElement)("button",{onClick:()=>o(!l),"aria-expanded":l,"aria-label":"Share this station"},(0,r.createElement)(h,{"aria-hidden":"true"})))),l&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"overlay",role:"button",tabIndex:0,"aria-label":"Close share options",onClick:()=>o(!1),onKeyDown:e=>"Enter"===e.key&&o(!1)}),(0,r.createElement)("div",{className:"echoStream__share",role:"dialog","aria-label":"Share"},(0,r.createElement)("div",{className:"echoStream__share-links"},(0,r.createElement)("a",{href:_.twitter,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on Twitter"},(0,r.createElement)(v,{"aria-hidden":"true"})),(0,r.createElement)("a",{href:_.facebook,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on Facebook"},(0,r.createElement)(p,{"aria-hidden":"true"})),(0,r.createElement)("a",{href:_.email,"aria-label":"Share via Email"},(0,r.createElement)(g,{"aria-hidden":"true"})))))))},k=({attributes:e,fetchedStationName:t})=>{const[a,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(!1),[c,i]=(0,r.useState)(1),[s,w]=(0,r.useState)(!1),[E,b]=(0,r.useState)(0),f=(0,r.useRef)(),$=(0,r.useRef)(),{radioPlayer:C}=e,{artWork:N,fetchNameFromUrl:S,stationName:k,welcomeMessage:x,streamURL:_}=C,P={facebook:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(_)}`,twitter:`https://twitter.com/intent/tweet?url=${encodeURIComponent(_)}&text=${encodeURIComponent("Listening to this awesome radio!")}`,email:`mailto:?subject=${encodeURIComponent("Check out this Radio")}&body=${encodeURIComponent("Listen to this awesome radio here: "+_)}`};(0,r.useEffect)((()=>{f.current=new Audio(_),f.current.preload="none";const e=()=>{b(f.current.currentTime)};return f.current.addEventListener("timeupdate",e),()=>{f.current&&(f.current.pause(),f.current.removeEventListener("timeupdate",e),f.current=null)}}),[_]);const L=e=>{const t=Math.floor(e/60),a=Math.floor(e%60);return`${t}:${a<10?"0":""}${a}`};return(0,r.createElement)("section",{className:"auroraPlay",role:"region","aria-label":"Aurora audio player"},(0,r.createElement)("div",{className:"auroraContainer"},(0,r.createElement)("div",{className:"posterImg"},(0,r.createElement)("img",{src:N.url,alt:`Artwork for ${S?t:k}`})),(0,r.createElement)("div",{className:"audio-stuff"},(0,r.createElement)("div",{className:"details-play-pause"},(0,r.createElement)("button",{className:"play-pause-btn "+(s?"loading":""),onClick:async()=>{if(f.current)try{a?(f.current.pause(),n(!1)):(w(!0),await f.current.play(),n(!0))}catch(e){console.error("Error playing audio:",e)}finally{w(!1)}},"aria-label":a?"Pause":"Play","aria-pressed":a,disabled:s},s?(0,r.createElement)("div",{className:"loading-spinner",role:"status","aria-label":"Loading audio"}):a?(0,r.createElement)(u,{"aria-hidden":"true"}):(0,r.createElement)(m,{className:"playIcon","aria-hidden":"true"})),(0,r.createElement)("div",{className:"details"},(0,r.createElement)("h3",null,(S?t:k)?.length>50?(S?t:k)?.slice(0,50)+"...":S?t:k),x&&(0,r.createElement)("p",null,x))),(0,r.createElement)("div",{className:"volume-audioTime"},(0,r.createElement)("div",{className:"vol-and-share-btn"},(0,r.createElement)("button",{className:"vol",onClick:()=>{var e;f.current&&(e=0===c?1:0,f.current&&(i(e),f.current.volume=e,$.current&&clearTimeout($.current)))},"aria-label":0===c?"Unmute":"Mute","aria-pressed":0===c},0===c?(0,r.createElement)(d,{"aria-hidden":"true"}):(0,r.createElement)(y,{"aria-hidden":"true"})),(0,r.createElement)("button",{className:"share2",onClick:()=>o(!l),"aria-label":"Share this station","aria-expanded":l},(0,r.createElement)(h,{"aria-hidden":"true"}))),(0,r.createElement)("div",{className:"currentTime"},(0,r.createElement)("span",{"aria-hidden":"true"}),(0,r.createElement)("time",{className:"time","aria-label":`Current playback time ${L(E)}`},L(E))))),l&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"overlay",role:"button",tabIndex:0,"aria-label":"Close share options",onClick:()=>o(!1),onKeyDown:e=>"Enter"===e.key&&o(!1)}),(0,r.createElement)("div",{className:"auroraPlay-share",role:"dialog","aria-label":"Share station"},(0,r.createElement)("div",{className:"auroraPlay-share-links"},(0,r.createElement)("a",{href:P.twitter,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on Twitter"},(0,r.createElement)(v,{"aria-hidden":"true"})),(0,r.createElement)("a",{href:P.facebook,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on Facebook"},(0,r.createElement)(p,{"aria-hidden":"true"})),(0,r.createElement)("a",{href:P.email,"aria-label":"Share via Email"},(0,r.createElement)(g,{"aria-hidden":"true"})))))))},x=({attributes:e,fetchedStationName:t})=>{const[a,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(1),[c,i]=(0,r.useState)(!1),[s,h]=(0,r.useState)(!1),[p,v]=(0,r.useState)(0),g=(0,r.useRef)(),w=(0,r.useRef)(),E=(0,r.useRef)(),{radioPlayer:b}=e,{stationName:f,fetchNameFromUrl:$,streamURL:C}=b;(0,r.useEffect)((()=>{g.current=new Audio(C),g.current.preload="none";const e=()=>v(g.current.currentTime);return g.current.addEventListener("timeupdate",e),()=>{g.current&&(g.current.pause(),g.current.removeEventListener("timeupdate",e),g.current=null)}}),[C]);const N=e=>{g.current&&(o(e),g.current.volume=e,E.current&&clearTimeout(E.current),E.current=setTimeout((()=>i(!1)),2e3))},S=e=>{const t=Math.floor(e/60),a=Math.floor(e%60);return`${t}:${a<10?"0":""}${a}`};return(0,r.createElement)("section",{className:"woodenPlayer",ref:w,role:"region","aria-label":"Audio player"},(0,r.createElement)("div",{className:"woodenContainer"},(0,r.createElement)("div",{className:"discarea","aria-hidden":"true"},(0,r.createElement)("div",{className:"disc"}),(0,r.createElement)("div",{className:"stylus"},(0,r.createElement)("div",{className:"pivot"}),(0,r.createElement)("div",{className:"arm"}),(0,r.createElement)("div",{className:"head"}))),(0,r.createElement)("div",{className:"contentBox"},(0,r.createElement)("h2",{className:"title wooodenTiitle"},$?t:f),(0,r.createElement)("div",{className:"woodenControls"},(0,r.createElement)("button",{className:"play-pause-btn "+(s?"loading":""),onClick:async()=>{if(g.current)try{a?(w.current.classList.remove("playing"),g.current.pause(),n(!1)):(h(!0),await g.current.play(),n(!0),w.current.classList.add("playing"))}catch(e){console.error("Error playing audio:",e)}finally{h(!1)}},"aria-label":a?"Pause":"Play","aria-pressed":a,disabled:s},s?(0,r.createElement)("span",{className:"loading-spinner","aria-label":"Loading audio"}):a?(0,r.createElement)(u,{"aria-hidden":"true"}):(0,r.createElement)(m,{className:"playIcon","aria-hidden":"true"})),(0,r.createElement)("button",{className:"toggleVol",onClick:()=>{g.current&&N(0===l?1:0)},"aria-label":0===l?"Unmute":"Mute","aria-pressed":0===l,onMouseEnter:()=>i(!0)},0===l?(0,r.createElement)(d,{"aria-hidden":"true"}):(0,r.createElement)(y,{"aria-hidden":"true"})),(0,r.createElement)("input",{id:"volumeControl",className:"woodenVolume",type:"range",min:"0",max:"1",step:"0.01",value:l,onChange:e=>N(parseFloat(e.target.value)),"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":l,"aria-label":"Volume control"})),(0,r.createElement)("div",{className:"info"},(0,r.createElement)("div",{className:"wooden-live-indicator",role:"status","aria-label":"Live broadcast"},(0,r.createElement)("span",{"aria-hidden":"true"}),(0,r.createElement)("span",null,"Live")),(0,r.createElement)("time",{className:"time","aria-label":`Current playback time ${S(p)}`},S(p))))))},_=({attributes:e,fetchedStationName:t})=>{const[a,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(1),[c,s]=(0,r.useState)(0),h=(0,r.useRef)(null),p=(0,r.useRef)(),{radioPlayer:v}=e,{streamURL:g,stationName:E,welcomeMessage:b,artWork:f,autoPlay:$,initialVolume:C,showTime:N,fetchNameFromUrl:S,playerPosition:k}=v;(0,r.useEffect)((()=>{const e=h.current;if(!e)return;const t=void 0!==C?C/100:1;o(t),$?(e.muted=!0,e.play().then((()=>{e.muted=!1,e.volume=t,n(!0)})).catch((()=>{n(!1)}))):e.volume=t}),[$,C]),(0,r.useEffect)((()=>{const e=h.current,t=()=>s(e.currentTime);return e.addEventListener("timeupdate",t),()=>e.removeEventListener("timeupdate",t)}),[]);const x=e=>{o(e),h.current&&(h.current.volume=e)};return(0,r.useEffect)((()=>{if(p.current){const e=100*l;p.current.style.background=`linear-gradient(90deg, #151b48 ${e}%, white ${e}%)`}}),[l]),(0,r.createElement)("div",{className:`advanced-player align-${k}`},(0,r.createElement)("div",{className:"advanced-details"},(0,r.createElement)("div",null,(0,r.createElement)("img",{src:f?.url?f.url:i,alt:""})),(0,r.createElement)("div",{className:"details"},(0,r.createElement)("div",{className:"info"},(0,r.createElement)("h3",null,S?t:E),(0,r.createElement)("p",null,b||"Listen to the radio stream")),(0,r.createElement)("div",{className:"controls"},(0,r.createElement)("div",{className:"playPauseIcon control-btn-wrapper"},(0,r.createElement)("button",{onClick:()=>{const e=h.current;e&&(a?e.pause():e.play(),n(!a))},className:"btn play"},a?(0,r.createElement)(u,null):(0,r.createElement)(m,null))),(0,r.createElement)("div",{className:"stopIcon control-btn-wrapper"},(0,r.createElement)("button",{onClick:()=>{const e=h.current;e&&(e.pause(),e.currentTime=0,n(!1),s(0))},className:"btn stop"},(0,r.createElement)(w,null)))))),(0,r.createElement)("div",{className:"volume-progress"},(0,r.createElement)("button",{className:"vol-btn",onClick:()=>x(0===l?1:0),"aria-label":0===l?"Unmute":"Mute","aria-pressed":0===l},0===l?(0,r.createElement)(d,{"aria-hidden":"true"}):(0,r.createElement)(y,{"aria-hidden":"true"})),(0,r.createElement)("input",{ref:p,className:"vol-range",type:"range",min:"0",max:"1",step:"0.05",value:l,onChange:e=>x(parseFloat(e.target.value)),"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":l})),N&&(0,r.createElement)("div",{className:"time-display"},(e=>{const t=Math.floor(e/60),a=Math.floor(e%60);return`${t.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`})(c)),(0,r.createElement)("audio",{ref:h,src:g}))},P=({attributes:e,id:t})=>{const{radioPlayer:a}=e,{playerType:n,skin:l,streamURL:o,streamPort:i,stationName:s,fetchNameFromUrl:u,streamProvider:m}=a,[d,h]=(0,r.useState)(null);let p="",v="";"ultimate"===n?(p=`${o}:${i}/currentsong?sid=1`,v=`${o}:${i}/status-json.xsl`,"other"===m&&(p=`${o}/currentsong?sid=1`,v=`${o}/status-json.xsl`)):(p=`${o}/currentsong?sid=1`,v=`${o}/status-json.xsl`);const g=async()=>{try{const e=new FormData;e.append("action","stp_fetch_stream"),e.append("url",p),e.append("nonce",window.myScriptData.nonce);const t=await fetch(`${window.myScriptData.ajaxUrl}`,{method:"POST",body:e});if(!t.ok)throw new Error("Network response was not ok");const a=await t.json();return a?.data?a.data:null}catch(e){return console.error("There was a problem with the fetch operation:",e),null}},y=async()=>{try{const e=new FormData;e.append("action","stp_fetch_stream"),e.append("url",v),e.append("nonce",window.myScriptData.nonce);const t=await fetch(`${window.myScriptData.ajaxUrl}`,{method:"POST",body:e});if(!t.ok)throw new Error("Network response was not ok");const a=await t.json();if(a?.success&&a?.data){const e=JSON.parse(a.data),t=e.icestats?.source||null;if(t)return t?.title||t?.song||t?.server_name||"No Title Available"}return null}catch(e){return null}};return(0,r.useEffect)((()=>{u&&(async(e,t)=>{let a=null;"standard"===e||"advanced"===e||"echoStream"===e||"auroraPlay"===e||"wooden"===e?(a=await g(),a||(a=await y()),a||(a=s)):"ultimate"===e&&("shout-cast"===t?a=await g():"ice-cast"===t?a=await y():"other"===t&&(a=await g(),a||(a=await y()),a||(a=s)),a||(a=s))})(n,m)}),[n,m,i,u]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(c,{attributes:e,id:t}),(0,r.createElement)("div",{className:"streamcast-container",id:t},"standard"===n&&"b_circle"===l.name&&(0,r.createElement)($,{attributes:e,id:t,fetchedStationName:d}),"ultimate"===n&&(0,r.createElement)(N,{attributes:e,id:t,fetchedStationName:d}),"advanced"===n&&(0,r.createElement)(_,{attributes:e,id:t,fetchedStationName:d}),"minimal"===n&&(0,r.createElement)(E,{attributes:e,id:t,fetchedStationName:d}),"echoStream"===n&&(0,r.createElement)(S,{attributes:e,fetchedStationName:d}),"auroraPlay"===n&&(0,r.createElement)(k,{attributes:e,fetchedStationName:d}),"wooden"===n&&(0,r.createElement)(x,{attributes:e,fetchedStationName:d})))};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-scb-streamcast-block").forEach((e=>{if(!e.dataset.attributes)return;const t=JSON.parse(e.dataset.attributes);(0,n.H)(e).render((0,r.createElement)(r.Fragment,null,(0,r.createElement)(c,{attributes:t,id:e.id}),(0,r.createElement)(P,{attributes:t,id:e.id}))),e?.removeAttribute("data-attributes")}))}))})();