Socket
Socket
Sign inDemoInstall

@bcaster/bcaster-lite-widget

Package Overview
Dependencies
0
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.15 to 0.0.16

2

dist/bcaster-lite-widget.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("BCasterLiteWidget",[],t):"object"==typeof exports?exports.BCasterLiteWidget=t():e.BCasterLiteWidget=t()}(window,(function(){return n={},e.m=t=[function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(1);var r=n(5),i=(o.prototype.generateRandomCharacters=function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length,i=0;i<e;i++)t+=n.charAt(Math.floor(Math.random()*r));return t},o.prototype.setRedirectUrl=function(){var e=this.appUrl+"-"+this.userUniqueID+"-"+this.lang;this.redirectUrl=this.tag?e+"-"+this.tag:e},o.prototype.mountFloatingBtn=function(){var e=this.elementToMount,t='\n <a href="#" class="bcaster-widget" onClick="(function(){ window.open(\''+this.redirectUrl+"');})();return false;\">\n "+this.widgetSvg+"\n </a>\n ";e.id="bcaster-floating-widget",this.mobileView?/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)&&(e.innerHTML=t):e.innerHTML=t},o.prototype.mountUserDefinedWidget=function(){var e=this.elementToMount,t=this.redirectUrl;if(!Array.from(e.attributes).map((function(e){return e.name})).includes("href"))throw new Error("The element with the bcaster-widget is not a HTML <a> Tag with a href attribute. Please use an <a> tag with href attribute. See the documentation for examples.");e.href=t,e.target="_blank"},o.prototype.getUserUniqueID=function(){var e=void 0;try{e=localStorage.getItem("bcasterBrowserID")}catch(e){console.log("Generating unique ID for bcaster camera")}if(null!=e&&""!==e)return e;var t=this.generateRandomCharacters(20);return localStorage.setItem("bcasterBrowserID",t),t},o.prototype.mount=function(){var e=document.getElementById("bcaster-widget");if(!e){var t="Missing bcaster mounting element. Ensure you have an element with the id 'bcaster-widget' in your page";throw alert(t),new Error(t)}this.elementToMount=e,this.userUniqueID=this.getUserUniqueID(),this.setRedirectUrl(),this.userDefinedWidget?this.mountUserDefinedWidget():this.mountFloatingBtn()},o);function o(e){var t=e.appId,n=e.mobileView,i=e.mode,o=e.lang,a=e.tag,s=e.userDefinedWidget;if(null==t)throw new Error("Missing appId in configurations options");if(void 0!==i&&"development"!==i&&"production"!==i)throw new Error("Mode option must be a string of either development or production");if(void 0!==o&&!r.SUPPORTED_LANGUAGES.includes(o))throw new Error("Lang option must be one of "+r.SUPPORTED_LANGUAGES);if(void 0!==n&&!0!==n&&!1!==n)throw new Error("mobileView option must be a boolean value");if(void 0!==s&&!0!==s&&!1!==s)throw new Error("userDefinedWidget option must be a boolean value");this.appId=t.toString(),this.mobileView=n||!0,this.userDefinedWidget=s||!1,this.mode=i||"production",this.lang=o||"en",this.tag=a||!1,this.elementToMount=null,this.appUrl="production"===this.mode?"https://lite.bcaster.com/"+this.appId:"https://dev-lite.bcaster.com/"+this.appId,this.redirectUrl="",this.widgetSvg='\n <svg width="78" height="78" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <defs>\n <circle id="b" cx="30" cy="30" r="30"/>\n <filter x="-29.2%" y="-17.5%" width="155%" height="155%" filterUnits="objectBoundingBox" id="a">\n <feMorphology radius="1.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"/>\n <feOffset dx="-1" dy="6" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>\n <feGaussianBlur stdDeviation="3" in="shadowOffsetOuter1" result="shadowBlurOuter1"/>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" in="shadowBlurOuter1"/>\n </filter>\n </defs>\n <g fill="none" fill-rule="evenodd">\n <g fill-rule="nonzero" transform="translate(10 3)">\n <use fill="#000" filter="url(#a)" xlink:href="#b"/>\n <use fill="#FFF" xlink:href="#b"/>\n </g>\n <g fill="#F7941D" fill-rule="nonzero">\n <path d="M53.907 25.575c-.73-.69-1.61-1.036-2.64-1.036H48l-.743-1.88c-.185-.452-.523-.84-1.014-1.168-.49-.327-.994-.491-1.51-.491h-7.466c-.516 0-1.019.164-1.51.49-.49.328-.828.717-1.013 1.169L34 24.539h-3.267c-1.03 0-1.91.345-2.64 1.036C27.366 26.266 27 27.1 27 28.077v12.384c0 .977.365 1.811 1.094 2.502.729.691 1.609 1.037 2.64 1.037h20.533c1.03 0 1.91-.346 2.64-1.037.728-.69 1.093-1.525 1.093-2.502V28.077c0-.977-.364-1.81-1.093-2.502zm-8.291 13.069c-1.279 1.212-2.817 1.818-4.616 1.818-1.799 0-3.337-.606-4.616-1.818-1.278-1.212-1.917-2.67-1.917-4.374 0-1.705.64-3.163 1.917-4.375 1.279-1.212 2.817-1.818 4.616-1.818 1.799 0 3.337.606 4.616 1.818 1.278 1.212 1.918 2.67 1.918 4.375 0 1.704-.64 3.162-1.918 4.374z"/>\n <path d="M41.06 30.177c-1.15 0-2.131.388-2.947 1.164-.816.776-1.224 1.71-1.224 2.802s.408 2.026 1.224 2.802c.816.776 1.798 1.163 2.947 1.163 1.148 0 2.13-.387 2.946-1.163.816-.776 1.224-1.71 1.224-2.802s-.408-2.026-1.224-2.802c-.815-.776-1.798-1.164-2.946-1.164z"/>\n </g>\n <path d="M41 12.66A2.83 2.83 0 1 1 41 7a2.83 2.83 0 0 1 0 5.66zM41 57a2.83 2.83 0 1 1 0-5.66A2.83 2.83 0 0 1 41 57zM18.83 34.358a2.83 2.83 0 1 1 0-5.66 2.83 2.83 0 0 1 0 5.66zm44.34 0a2.83 2.83 0 1 1 0-5.66 2.83 2.83 0 0 1 0 5.66zM57.749 22.33a2.83 2.83 0 1 1 4.902-2.83 2.83 2.83 0 0 1-4.902 2.83zm-38.4 22.17a2.83 2.83 0 1 1 4.902-2.83 2.83 2.83 0 0 1-4.902 2.83zm8.524-30.52a2.83 2.83 0 1 1 4.902-2.83 2.83 2.83 0 0 1-4.902 2.83zm22.17 38.399a2.83 2.83 0 1 1 4.901-2.83 2.83 2.83 0 0 1-4.902 2.83zm.627-37.128a2.83 2.83 0 1 1 2.83-4.902 2.83 2.83 0 0 1-2.83 4.902zm-22.17 38.4a2.83 2.83 0 1 1 2.83-4.902 2.83 2.83 0 0 1-2.83 4.902zm-7.879-30.693a2.83 2.83 0 1 1 2.83-4.902 2.83 2.83 0 0 1-2.83 4.902zm38.4 22.17a2.83 2.83 0 1 1 2.83-4.903 2.83 2.83 0 0 1-2.83 4.902z" fill="#F7941D" fill-rule="nonzero"/>\n </g>\n </svg>\n '}e.exports=i},function(e,t,n){var r=n(2);"string"==typeof r&&(r=[[e.i,r,""]]);n(4)(r,{insert:"head",singleton:!1}),r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(3)(!1)).push([e.i,"#bcaster-floating-widget {\n position: fixed;\n bottom: 10%;\n right: 1%;\n}\n.bcaster-widget img {\n width: 80px;\n height: 80px;\n}\n@media only screen and (min-width: 600px) {\n .bcaster-widget img {\n width: 120px;\n height: 120px;\n }\n}",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}(r),o=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot).concat(e," */")}));return[n].concat(o).concat([i]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2],"{").concat(n,"}"):n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];null!=o&&(r[o]=!0)}for(var a=0;a<e.length;a++){var s=e[a];null!=s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="(".concat(s[2],") and (").concat(n,")")),t.push(s))}},t}},function(e,t,n){"use strict";var r,i,o={},a=(i={},function(e){if(void 0===i[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}i[e]=t}return i[e]});function s(e,t){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}function u(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=o[r.id],a=0;if(i){for(i.refs++;a<i.parts.length;a++)i.parts[a](r.parts[a]);for(;a<r.parts.length;a++)i.parts.push(g(r.parts[a],t))}else{for(var s=[];a<r.parts.length;a++)s.push(g(r.parts[a],t));o[r.id]={id:r.id,refs:1,parts:s}}}}function l(e){var t=document.createElement("style");if(void 0===e.attributes.nonce){var r=n.nc;r&&(e.attributes.nonce=r)}if(Object.keys(e.attributes).forEach((function(n){t.setAttribute(n,e.attributes[n])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function f(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}var p=null,h=0;function g(e,t){var n,r,i;if(t.singleton){var o=h++;n=p=p||l(t),r=f.bind(null,n,o,!1),i=f.bind(null,n,o,!0)}else n=l(t),r=function(e,t,n){var r=n.css,i=n.media,o=n.sourceMap;if(i&&e.setAttribute("media",i),o&&btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}.bind(null,n,t),i=function(){!function(e){null!==e.parentNode&&e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).attributes="object"==typeof t.attributes?t.attributes:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=s(e,t);return u(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var a=n[i],l=o[a.id];l&&(l.refs--,r.push(l))}e&&u(s(e,t),t);for(var c=0;c<r.length;c++){var d=r[c];if(0===d.refs){for(var f=0;f<d.parts.length;f++)d.parts[f]();delete o[d.id]}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SUPPORTED_LANGUAGES=["en","fi"]}],e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(e){return t[e]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="",e(e.s=0);function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var t,n}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("BCasterLiteWidget",[],t):"object"==typeof exports?exports.BCasterLiteWidget=t():e.BCasterLiteWidget=t()}(window,(function(){return n={},e.m=t=[function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(1);var r=n(5),i=(o.prototype.uuidv4=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})).toString().replace(/-/g,"")},o.prototype.setRedirectUrl=function(){var e=this.appUrl+"-"+this.userUniqueID+"-"+this.lang;this.redirectUrl=this.tag?e+"-"+this.tag:e},o.prototype.mountFloatingBtn=function(){var e=this.elementToMount,t='\n <a href="#" class="bcaster-widget" onClick="(function(){ window.open(\''+this.redirectUrl+"');})();return false;\">\n "+this.widgetSvg+"\n </a>\n ";e.id="bcaster-floating-widget",this.mobileView?/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)&&(e.innerHTML=t):e.innerHTML=t},o.prototype.mountUserDefinedWidget=function(){var e=this.elementToMount,t=this.redirectUrl;if(!Array.from(e.attributes).map((function(e){return e.name})).includes("href"))throw new Error("The element with the bcaster-widget is not a HTML <a> Tag with a href attribute. Please use an <a> tag with href attribute. See the documentation for examples.");e.href=t,e.target="_blank"},o.prototype.getUserUniqueID=function(){var e=void 0;try{e=localStorage.getItem("bcasterBrowserID")}catch(e){console.log("Generating unique ID for bcaster camera")}if(null!=e&&""!==e)return e;var t=this.uuidv4();return localStorage.setItem("bcasterBrowserID",t),t},o.prototype.mount=function(){var e=document.getElementById("bcaster-widget");if(!e){var t="Missing bcaster mounting element. Ensure you have an element with the id 'bcaster-widget' in your page";throw alert(t),new Error(t)}this.elementToMount=e,this.userUniqueID=this.getUserUniqueID(),this.setRedirectUrl(),this.userDefinedWidget?this.mountUserDefinedWidget():this.mountFloatingBtn()},o);function o(e){var t=e.appId,n=e.mobileView,i=e.mode,o=e.lang,a=e.tag,s=e.userDefinedWidget;if(null==t)throw new Error("Missing appId in configurations options");if(void 0!==i&&"development"!==i&&"production"!==i)throw new Error("Mode option must be a string of either development or production");if(void 0!==o&&!r.SUPPORTED_LANGUAGES.includes(o))throw new Error("Lang option must be one of "+r.SUPPORTED_LANGUAGES);if(void 0!==n&&!0!==n&&!1!==n)throw new Error("mobileView option must be a boolean value");if(void 0!==s&&!0!==s&&!1!==s)throw new Error("userDefinedWidget option must be a boolean value");this.appId=t.toString(),this.mobileView=n||!0,this.userDefinedWidget=s||!1,this.mode=i||"production",this.lang=o||"en",this.tag=a||!1,this.elementToMount=null,this.appUrl="production"===this.mode?"https://lite.bcaster.com/"+this.appId:"https://dev-lite.bcaster.com/"+this.appId,this.redirectUrl="",this.widgetSvg='\n <svg width="78" height="78" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <defs>\n <circle id="b" cx="30" cy="30" r="30"/>\n <filter x="-29.2%" y="-17.5%" width="155%" height="155%" filterUnits="objectBoundingBox" id="a">\n <feMorphology radius="1.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"/>\n <feOffset dx="-1" dy="6" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>\n <feGaussianBlur stdDeviation="3" in="shadowOffsetOuter1" result="shadowBlurOuter1"/>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" in="shadowBlurOuter1"/>\n </filter>\n </defs>\n <g fill="none" fill-rule="evenodd">\n <g fill-rule="nonzero" transform="translate(10 3)">\n <use fill="#000" filter="url(#a)" xlink:href="#b"/>\n <use fill="#FFF" xlink:href="#b"/>\n </g>\n <g fill="#F7941D" fill-rule="nonzero">\n <path d="M53.907 25.575c-.73-.69-1.61-1.036-2.64-1.036H48l-.743-1.88c-.185-.452-.523-.84-1.014-1.168-.49-.327-.994-.491-1.51-.491h-7.466c-.516 0-1.019.164-1.51.49-.49.328-.828.717-1.013 1.169L34 24.539h-3.267c-1.03 0-1.91.345-2.64 1.036C27.366 26.266 27 27.1 27 28.077v12.384c0 .977.365 1.811 1.094 2.502.729.691 1.609 1.037 2.64 1.037h20.533c1.03 0 1.91-.346 2.64-1.037.728-.69 1.093-1.525 1.093-2.502V28.077c0-.977-.364-1.81-1.093-2.502zm-8.291 13.069c-1.279 1.212-2.817 1.818-4.616 1.818-1.799 0-3.337-.606-4.616-1.818-1.278-1.212-1.917-2.67-1.917-4.374 0-1.705.64-3.163 1.917-4.375 1.279-1.212 2.817-1.818 4.616-1.818 1.799 0 3.337.606 4.616 1.818 1.278 1.212 1.918 2.67 1.918 4.375 0 1.704-.64 3.162-1.918 4.374z"/>\n <path d="M41.06 30.177c-1.15 0-2.131.388-2.947 1.164-.816.776-1.224 1.71-1.224 2.802s.408 2.026 1.224 2.802c.816.776 1.798 1.163 2.947 1.163 1.148 0 2.13-.387 2.946-1.163.816-.776 1.224-1.71 1.224-2.802s-.408-2.026-1.224-2.802c-.815-.776-1.798-1.164-2.946-1.164z"/>\n </g>\n <path d="M41 12.66A2.83 2.83 0 1 1 41 7a2.83 2.83 0 0 1 0 5.66zM41 57a2.83 2.83 0 1 1 0-5.66A2.83 2.83 0 0 1 41 57zM18.83 34.358a2.83 2.83 0 1 1 0-5.66 2.83 2.83 0 0 1 0 5.66zm44.34 0a2.83 2.83 0 1 1 0-5.66 2.83 2.83 0 0 1 0 5.66zM57.749 22.33a2.83 2.83 0 1 1 4.902-2.83 2.83 2.83 0 0 1-4.902 2.83zm-38.4 22.17a2.83 2.83 0 1 1 4.902-2.83 2.83 2.83 0 0 1-4.902 2.83zm8.524-30.52a2.83 2.83 0 1 1 4.902-2.83 2.83 2.83 0 0 1-4.902 2.83zm22.17 38.399a2.83 2.83 0 1 1 4.901-2.83 2.83 2.83 0 0 1-4.902 2.83zm.627-37.128a2.83 2.83 0 1 1 2.83-4.902 2.83 2.83 0 0 1-2.83 4.902zm-22.17 38.4a2.83 2.83 0 1 1 2.83-4.902 2.83 2.83 0 0 1-2.83 4.902zm-7.879-30.693a2.83 2.83 0 1 1 2.83-4.902 2.83 2.83 0 0 1-2.83 4.902zm38.4 22.17a2.83 2.83 0 1 1 2.83-4.903 2.83 2.83 0 0 1-2.83 4.902z" fill="#F7941D" fill-rule="nonzero"/>\n </g>\n </svg>\n '}e.exports=i},function(e,t,n){var r=n(2);"string"==typeof r&&(r=[[e.i,r,""]]);n(4)(r,{insert:"head",singleton:!1}),r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(3)(!1)).push([e.i,"#bcaster-floating-widget {\n position: fixed;\n bottom: 10%;\n right: 1%;\n}\n.bcaster-widget img {\n width: 80px;\n height: 80px;\n}\n@media only screen and (min-width: 600px) {\n .bcaster-widget img {\n width: 120px;\n height: 120px;\n }\n}",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}(r),o=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot).concat(e," */")}));return[n].concat(o).concat([i]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2],"{").concat(n,"}"):n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];null!=o&&(r[o]=!0)}for(var a=0;a<e.length;a++){var s=e[a];null!=s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="(".concat(s[2],") and (").concat(n,")")),t.push(s))}},t}},function(e,t,n){"use strict";var r,i,o={},a=(i={},function(e){if(void 0===i[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}i[e]=t}return i[e]});function s(e,t){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}function u(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=o[r.id],a=0;if(i){for(i.refs++;a<i.parts.length;a++)i.parts[a](r.parts[a]);for(;a<r.parts.length;a++)i.parts.push(g(r.parts[a],t))}else{for(var s=[];a<r.parts.length;a++)s.push(g(r.parts[a],t));o[r.id]={id:r.id,refs:1,parts:s}}}}function l(e){var t=document.createElement("style");if(void 0===e.attributes.nonce){var r=n.nc;r&&(e.attributes.nonce=r)}if(Object.keys(e.attributes).forEach((function(n){t.setAttribute(n,e.attributes[n])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function f(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}var p=null,h=0;function g(e,t){var n,r,i;if(t.singleton){var o=h++;n=p=p||l(t),r=f.bind(null,n,o,!1),i=f.bind(null,n,o,!0)}else n=l(t),r=function(e,t,n){var r=n.css,i=n.media,o=n.sourceMap;if(i&&e.setAttribute("media",i),o&&btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}.bind(null,n,t),i=function(){!function(e){null!==e.parentNode&&e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).attributes="object"==typeof t.attributes?t.attributes:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=s(e,t);return u(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var a=n[i],l=o[a.id];l&&(l.refs--,r.push(l))}e&&u(s(e,t),t);for(var c=0;c<r.length;c++){var d=r[c];if(0===d.refs){for(var f=0;f<d.parts.length;f++)d.parts[f]();delete o[d.id]}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SUPPORTED_LANGUAGES=["en","fi"]}],e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(e){return t[e]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="",e(e.s=0);function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var t,n}));
{
"name": "@bcaster/bcaster-lite-widget",
"version": "0.0.15",
"version": "0.0.16",
"description": "> An Embeddable web widget for the Bcaster Lite App",

@@ -5,0 +5,0 @@ "main": "dist/bcaster-lite-widget.js",

@@ -8,4 +8,4 @@ # bcaster-lite-widget

The BCaster Lite Widget can be installed/imported via
* [CDN UNPKG](https://unpkg.com/@bcaster/bcaster-lite-widget@0.0.15/dist/bcaster-lite-widget.js)
* [CDN JSDELIVR](https://cdn.jsdelivr.net/npm/@bcaster/bcaster-lite-widget@0.0.15/dist/bcaster-lite-widget.min.js)
* [CDN UNPKG](https://unpkg.com/@bcaster/bcaster-lite-widget@0.0.16/dist/bcaster-lite-widget.js)
* [CDN JSDELIVR](https://cdn.jsdelivr.net/npm/@bcaster/bcaster-lite-widget@0.0.16/dist/bcaster-lite-widget.min.js)
* [NPM](https://www.npmjs.com/package/@bcaster/bcaster-lite-widget)

@@ -37,3 +37,3 @@

/* Using the default widget */
<script src="https://unpkg.com/@bcaster/bcaster-lite-widget@0.0.15/dist/bcaster-lite-widget.js"></script>
<script src="https://unpkg.com/@bcaster/bcaster-lite-widget@0.0.16/dist/bcaster-lite-widget.js"></script>
<script>

@@ -49,3 +49,3 @@ const widget = new BCasterLiteWidget({

/* Using a custom defined widget */
<script src="https://unpkg.com/@bcaster/bcaster-lite-widget@0.0.15/dist/bcaster-lite-widget.js"></script>
<script src="https://unpkg.com/@bcaster/bcaster-lite-widget@0.0.16/dist/bcaster-lite-widget.js"></script>
<script>

@@ -211,3 +211,3 @@ const widget = new BCasterLiteWidget({

## Version 0.0.15
### Version 0.0.15

@@ -217,1 +217,6 @@ 1. Introduce optional `userDefinedWidget` option to enable users define custom widgets.

3. Update documentation examples to show how to use user defined widgets.
### Version 0.0.16
1. Improve build bundle size.
2. Update documentation.

@@ -101,11 +101,7 @@ require('./styles/style.css');

private generateRandomCharacters(length: number) {
let result = ''
const characters =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
const charactersLength = characters.length
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength))
}
return result
private uuidv4() {
// @ts-ignore
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, (c: any) =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
).toString().replace(/-/g, '')
}

@@ -159,3 +155,3 @@

if ((userUniqueId === undefined) || (userUniqueId === null) || (userUniqueId === '')) {
const uniqueID = this.generateRandomCharacters(20)
const uniqueID = this.uuidv4()
localStorage.setItem('bcasterBrowserID', uniqueID)

@@ -162,0 +158,0 @@ return uniqueID

@@ -120,2 +120,29 @@ const BCasterLiteWidget = require('../../dist/bcaster-lite-widget')

expect(testInstantiation).toThrow('mobileView option must be a boolean value');
});
test(`widget instantiation works when userDefinedWidget is provided with boolean true`, () => {
function testInstantiation() {
new BCasterLiteWidget({ appId: '724363533536353636', userDefinedWidget: true })
}
expect(testInstantiation).not.toThrow();
expect(testInstantiation).not.toThrow(Error);
expect(testInstantiation).not.toThrow('userDefinedWidget option must be a boolean value');
});
test(`widget instantiation works when userDefinedWidget is provided with boolean false`, () => {
function testInstantiation() {
new BCasterLiteWidget({ appId: '724363533536353636', userDefinedWidget: false })
}
expect(testInstantiation).not.toThrow();
expect(testInstantiation).not.toThrow(Error);
expect(testInstantiation).not.toThrow('userDefinedWidget option must be a boolean value');
});
test(`widget instantiation throws error if userDefinedWidget isn't a boolean`, () => {
function testInstantiation() {
new BCasterLiteWidget({ appId: '724363533536353636', userDefinedWidget: 'notBoolean' })
}
expect(testInstantiation).toThrow();
expect(testInstantiation).toThrow(Error);
expect(testInstantiation).toThrow('userDefinedWidget option must be a boolean value');
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc