{"version":3,"file":"public-DxO5zz4L.js","sources":["../../../node_modules/react/cjs/react.production.min.js","../../../node_modules/react/index.js","../../../node_modules/classnames/index.js","../../../node_modules/react-social-media-embed/dist/components/hooks/useFrame.js","../../../node_modules/react-social-media-embed/dist/components/embeds/EmbedStyle.js","../../../node_modules/react-social-media-embed/dist/components/placeholder/parts/BorderSpinner.js","../../../node_modules/react-social-media-embed/dist/components/placeholder/parts/EngagementIconsPlaceholder.js","../../../node_modules/react-social-media-embed/dist/components/placeholder/parts/ProfilePlaceholder.js","../../../node_modules/react-social-media-embed/dist/components/placeholder/PlaceholderEmbed.js","../../../node_modules/react-social-media-embed/dist/components/uuid.js","../../../node_modules/react-sub-unsub/dist/index.js","../../../node_modules/react-social-media-embed/dist/components/embeds/FacebookEmbed.js","../../../node_modules/react-social-media-embed/dist/components/embeds/InstagramEmbed.js","../../../node_modules/react-social-media-embed/dist/components/embeds/LinkedInEmbed.js","../../../node_modules/react-social-media-embed/dist/components/embeds/PinterestEmbed.js","../../../node_modules/react-social-media-embed/dist/components/embeds/TikTokEmbed.js","../../../node_modules/scriptjs/dist/script.js","../../../node_modules/react-twitter-embed/dist/index.modern.js","../../../node_modules/react-social-media-embed/dist/components/embeds/XEmbed.js","../../../node_modules/react-social-media-embed/dist/components/embeds/TwitterEmbed.js","../../../node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/prop-types/index.js","../../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/fast-deep-equal/index.js","../../../node_modules/sister/src/sister.js","../../../node_modules/load-script/index.js","../../../node_modules/youtube-player/dist/loadYouTubeIframeApi.js","../../../node_modules/youtube-player/node_modules/ms/index.js","../../../node_modules/youtube-player/node_modules/debug/src/debug.js","../../../node_modules/youtube-player/node_modules/debug/src/browser.js","../../../node_modules/youtube-player/dist/functionNames.js","../../../node_modules/youtube-player/dist/eventNames.js","../../../node_modules/youtube-player/dist/constants/PlayerStates.js","../../../node_modules/youtube-player/dist/FunctionStateMap.js","../../../node_modules/youtube-player/dist/YouTubePlayer.js","../../../node_modules/youtube-player/dist/index.js","../../../node_modules/react-youtube/dist/YouTube.esm.js","../../../node_modules/react-social-media-embed/dist/components/embeds/YouTubeEmbed.js","../../../node_modules/react-social-media-embed/dist/index.js"],"sourcesContent":["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1 {\n return react_1.default.useMemo(() => {\n if (frame) {\n return frame;\n }\n return {\n document: typeof document !== 'undefined' ? document : undefined,\n window: typeof window !== 'undefined' ? window : undefined,\n };\n }, [frame]);\n};\nexports.useFrame = useFrame;\n","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EmbedStyle = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst react_1 = __importDefault(require(\"react\"));\nconst EmbedStyle = (_a) => {\n var styleProps = __rest(_a, []);\n return (react_1.default.createElement(\"style\", Object.assign({}, styleProps, { className: (0, classnames_1.default)(styleProps.className), style: Object.assign({}, styleProps.style) }), `\n .rsme-embed .rsme-d-none {\n display: none;\n }\n \n .rsme-embed .twitter-tweet {\n margin: 0 !important;\n }\n \n .rsme-embed blockquote {\n margin: 0 !important;\n padding: 0 !important;\n }\n\n .rsme-embed.rsme-facebook-embed .fb-post iframe {\n width: 100% !important;\n }\n\n .rsme-embed.rsme-facebook-embed .fb-post span {\n width: 100% !important;\n }\n `));\n};\nexports.EmbedStyle = EmbedStyle;\n","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BorderSpinner = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst react_1 = __importDefault(require(\"react\"));\nconst BorderSpinner = (_a) => {\n var divProps = __rest(_a, []);\n return (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(\"style\", null, `\n .rsme-spinner {\n border: 3px solid rgba(0,0,0,0.75);\n border-right-color: transparent;\n border-radius: 50%;\n animation: rsme-spin 1s linear infinite;\n }\n @keyframes rsme-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n } \n `),\n react_1.default.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)('rsme-spinner', divProps.className), style: Object.assign({ width: 10, height: 10 }, divProps.style) }))));\n};\nexports.BorderSpinner = BorderSpinner;\n","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShareArrowIcon = exports.ChatBubbleIcon = exports.HeartIcon = exports.EngagementIconsPlaceholder = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst react_1 = __importDefault(require(\"react\"));\nconst EngagementIconsPlaceholder = (_a) => {\n var divProps = __rest(_a, []);\n return (react_1.default.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)(divProps.className), style: Object.assign({ display: 'flex', alignItems: 'center', columnGap: 14 }, divProps.style) }),\n react_1.default.createElement(exports.HeartIcon, null),\n react_1.default.createElement(exports.ChatBubbleIcon, null),\n react_1.default.createElement(exports.ShareArrowIcon, null)));\n};\nexports.EngagementIconsPlaceholder = EngagementIconsPlaceholder;\nconst HeartIcon = (props) => {\n return (react_1.default.createElement(\"div\", Object.assign({}, props),\n react_1.default.createElement(\"div\", { style: {\n backgroundColor: '#F4F4F4',\n borderRadius: '50%',\n height: '12.5px',\n width: '12.5px',\n transform: 'translateX(0px) translateY(7px)',\n } }),\n react_1.default.createElement(\"div\", { style: {\n backgroundColor: '#F4F4F4',\n height: '12.5px',\n transform: 'rotate(-45deg) translateX(3px) translateY(1px)',\n width: '12.5px',\n flexGrow: 0,\n marginRight: '6px',\n marginLeft: '2px',\n } }),\n react_1.default.createElement(\"div\", { style: {\n backgroundColor: '#F4F4F4',\n borderRadius: '50%',\n height: '12.5px',\n width: '12.5px',\n transform: 'translateX(9px) translateY(-18px)',\n } })));\n};\nexports.HeartIcon = HeartIcon;\nconst ChatBubbleIcon = (props) => {\n return (react_1.default.createElement(\"div\", Object.assign({}, props),\n react_1.default.createElement(\"div\", { style: {\n backgroundColor: '#F4F4F4',\n borderRadius: '50%',\n height: '20px',\n width: '20px',\n } }),\n react_1.default.createElement(\"div\", { style: {\n width: 0,\n height: 0,\n borderTop: '2px solid transparent',\n borderLeft: '6px solid #f4f4f4',\n borderBottom: '2px solid transparent',\n transform: 'translateX(16px) translateY(-4px) rotate(30deg)',\n } })));\n};\nexports.ChatBubbleIcon = ChatBubbleIcon;\nconst ShareArrowIcon = (props) => {\n return (react_1.default.createElement(\"div\", Object.assign({}, props, { style: {\n height: 25,\n width: 25,\n transform: 'translateX(0px) translateY(-2px)',\n } }),\n react_1.default.createElement(\"svg\", { version: \"1.1\", id: \"Layer_1\", xmlns: \"http://www.w3.org/2000/svg\", xmlnsXlink: \"http://www.w3.org/1999/xlink\", x: \"0px\", y: \"0px\", viewBox: \"0 0 512 512\", xmlSpace: \"preserve\" },\n react_1.default.createElement(\"path\", { style: { fill: '#F4F4F4' }, d: \"M295.204,180.593C132.168,180.593,0,312.759,0,475.796\\nc51.398-130.047,184.869-203.22,317.483-183.603L295.204,180.593z\" }),\n react_1.default.createElement(\"path\", { style: { fill: '#F4F4F4' }, d: \"M512,253L295.204,36.204v217.818C159.946,249.655,34.992,339.262,0,475.794\\nc59.905-109.171,178.724-165.463,295.204-151.033v145.035L512,253z\" }))));\n};\nexports.ShareArrowIcon = ShareArrowIcon;\n","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProfilePlaceholder = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst react_1 = __importDefault(require(\"react\"));\nconst ProfilePlaceholder = (_a) => {\n var divProps = __rest(_a, []);\n return (react_1.default.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)(divProps.className), style: Object.assign({}, divProps.style) }),\n react_1.default.createElement(\"div\", { style: { display: 'flex', columnGap: 14 } },\n react_1.default.createElement(\"div\", { style: {\n backgroundColor: '#F4F4F4',\n borderRadius: '50%',\n width: 40,\n height: 40,\n } }),\n react_1.default.createElement(\"div\", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'center', rowGap: 6 } },\n react_1.default.createElement(\"div\", { style: {\n backgroundColor: '#F4F4F4',\n borderRadius: 4,\n width: 100,\n height: 14,\n } }),\n react_1.default.createElement(\"div\", { style: {\n backgroundColor: '#F4F4F4',\n borderRadius: 4,\n width: 60,\n height: 14,\n } })))));\n};\nexports.ProfilePlaceholder = ProfilePlaceholder;\n","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PlaceholderEmbed = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst react_1 = __importDefault(require(\"react\"));\nconst EmbedStyle_1 = require(\"../embeds/EmbedStyle\");\nconst BorderSpinner_1 = require(\"./parts/BorderSpinner\");\nconst EngagementIconsPlaceholder_1 = require(\"./parts/EngagementIconsPlaceholder\");\nconst ProfilePlaceholder_1 = require(\"./parts/ProfilePlaceholder\");\n// See: https://pragmaticwebsecurity.com/articles/spasecurity/react-xss-part1\nconst isJavaScriptProtocol = /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i;\nconst PlaceholderEmbed = (_a) => {\n var _b;\n var { url, linkText = 'View post', imageUrl, spinner = react_1.default.createElement(BorderSpinner_1.BorderSpinner, null), allowJavaScriptUrls = true, spinnerDisabled } = _a, divProps = __rest(_a, [\"url\", \"linkText\", \"imageUrl\", \"spinner\", \"allowJavaScriptUrls\", \"spinnerDisabled\"]);\n if (isJavaScriptProtocol.test(url) && !allowJavaScriptUrls) {\n console.warn(`PlaceholderEmbed has blocked a javascript: URL as a security precaution`);\n return null;\n }\n return (react_1.default.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)(divProps.className), style: Object.assign({ overflow: 'hidden', border: '1px solid #dee2e6', backgroundColor: '#ffffff', borderRadius: 0, boxSizing: 'border-box', position: 'relative' }, divProps.style) }),\n react_1.default.createElement(EmbedStyle_1.EmbedStyle, null),\n react_1.default.createElement(\"a\", { href: url, style: { textDecoration: 'none' }, target: \"_blank\", rel: \"noopener noreferrer\" },\n !imageUrl && (react_1.default.createElement(\"div\", { style: {\n position: 'absolute',\n top: 0,\n left: 0,\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'start',\n paddingLeft: 16,\n paddingRight: 16,\n paddingTop: 16,\n paddingBottom: 16,\n zIndex: 2,\n backgroundColor: '#ffffff',\n } },\n react_1.default.createElement(ProfilePlaceholder_1.ProfilePlaceholder, null))),\n react_1.default.createElement(\"div\", { style: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: imageUrl ? 'start' : 'center',\n height: '100%',\n width: '100%',\n } },\n !imageUrl && (react_1.default.createElement(\"div\", { style: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n width: '100%',\n rowGap: 16,\n zIndex: 3,\n padding: 8,\n backgroundColor: '#ffffff',\n } },\n !spinnerDisabled && spinner,\n !!linkText && (react_1.default.createElement(\"div\", { style: {\n color: '#000000',\n fontFamily: 'Arial,sans-serif',\n fontSize: '14px',\n fontStyle: 'normal',\n fontWeight: 550,\n lineHeight: '18px',\n textAlign: 'center',\n } }, linkText)))),\n imageUrl &&\n (typeof ((_b = divProps.style) === null || _b === void 0 ? void 0 : _b.height) !== 'undefined' ? (react_1.default.createElement(\"div\", { style: {\n width: '100%',\n height: '100%',\n background: `url(\"${imageUrl}\")`,\n backgroundRepeat: 'no-repeat',\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n marginBottom: '40',\n } })) : (react_1.default.createElement(\"div\", { style: { width: '100%', marginBottom: 40 } },\n react_1.default.createElement(\"img\", { src: imageUrl, style: { width: '100%' } }))))),\n react_1.default.createElement(\"div\", { style: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n height: 40,\n width: '100%',\n backgroundColor: '#ffffff',\n zIndex: 1,\n } },\n !imageUrl && (react_1.default.createElement(EngagementIconsPlaceholder_1.EngagementIconsPlaceholder, { style: {\n marginLeft: 16,\n } })),\n imageUrl && (react_1.default.createElement(\"div\", { style: {\n display: 'flex',\n height: '100%',\n alignItems: 'center',\n justifyContent: 'space-between',\n columnGap: 16,\n } },\n react_1.default.createElement(\"div\", { style: {\n color: '#0095f6',\n fontWeight: 600,\n fontFamily: 'Arial,sans-serif',\n fontSize: '14px',\n fontStyle: 'normal',\n whiteSpace: 'nowrap',\n marginLeft: 16,\n } }, linkText),\n !spinnerDisabled && react_1.default.createElement(\"div\", { style: { marginRight: 16 } }, spinner)))))));\n};\nexports.PlaceholderEmbed = PlaceholderEmbed;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateUUID = void 0;\n// https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid\nconst generateUUID = () => {\n // Public Domain/MIT\n let d = new Date().getTime(); //Timestamp\n let d2 = (typeof performance !== 'undefined' && performance.now && performance.now() * 1000) || 0; //Time in microseconds since page-load or 0 if unsupported\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n let r = Math.random() * 16; //random number between 0 and 16\n if (d > 0) {\n //Use timestamp until depleted\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n }\n else {\n //Use microseconds since page-load if supported\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\nexports.generateUUID = generateUUID;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subs = exports.Subscribe = void 0;\n/**\n * Static functions for subscribing and unsubscribing to and from events.\n */\nclass Subscribe {\n /**\n * Call a function that adds a listener and returns a function that will unsubscribe the listener.\n *\n * The function passed in will be called immediately to add the listener,\n * and its Unsubscribe function will be returned.\n *\n * @param subscribe The subscribe function, which returns an Unsubscribe. Will be called immediately.\n * @returns The Unsubscribe function for this subscription.\n */\n static subscribe(subscribe) {\n try {\n return subscribe();\n }\n catch (e) {\n console.error(e);\n }\n return () => {\n // No-op when catching an error\n };\n }\n /**\n * Subscribe to an emitter event. Returns a function that will unsubscribe the listener.\n *\n * @param eventEmitter The [EventEmitter](https://nodejs.org/api/events.html#class-eventemitter) to subscribe to.\n * @param eventName The name of the event to listen for.\n * @param listener The listener callback that is called when the event occurs.\n * @returns The Unsubscribe function for this subscription.\n */\n static subscribeEvent(eventEmitter, eventName, listener) {\n eventEmitter.addListener(eventName, listener);\n return () => {\n eventEmitter.removeListener(eventName, listener);\n };\n }\n /**\n * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback\n * that will be invoked when the event is dispatched.\n *\n * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the\n * method behaves exactly as if the value was specified as options's capture.\n *\n * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute\n * value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute\n * value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.\n *\n * Returns a function that will unsubscribe the listener.\n *\n * @param domObj The DOM object to subscribe to for events.\n * @param eventName The name of the event to listen for.\n * @param listener The listener callback that is called when the event occurs.\n * @param options Listener-specific options. See function description.\n * @returns The Unsubscribe function for this subscription.\n */\n static subscribeDOMEvent(domObj, eventName, listener, options) {\n domObj.addEventListener(eventName, listener, options);\n return () => {\n domObj.removeEventListener(eventName, listener, options);\n };\n }\n /**\n * Sets a timer which executes a function once the timer expires using `setTimeout`.\n * Returns an unsubscribe function that clears the timeout using `clearTimeout`.\n *\n * @param handler A function to be executed after the timer expires.\n * @param delay The time, in milliseconds that the timer should wait before the specified function or code is executed. If this parameter is omitted, a value of 0 is used, meaning execute \"immediately\", or more accurately, the next event cycle.\n * @param args Additional arguments which are passed through to the handler specified.\n * @returns The Unsubscribe function for this subscription.\n */\n static setTimeout(handler, delay, ...args) {\n const timeout = setTimeout(handler, delay, args);\n return () => clearTimeout(timeout);\n }\n /**\n * Repeatedly calls a function with a fixed time delay between each call using `setInterval`.\n * Returns an unsubscribe function that clears the interval using `clearInterval`.\n *\n * @param handler A function to be executed after the timer expires.\n * @param delay The time, in milliseconds (thousandths of a second), the timer should delay in between executions of the specified function or code. Defaults to 0 if not specified.\n * @param args Additional arguments which are passed through to the handler once the timer expires.\n * @returns The Unsubscribe function for this subscription.\n */\n static setInterval(handler, delay, ...args) {\n const interval = setInterval(handler, delay, args);\n return () => clearInterval(interval);\n }\n /**\n * Call all unsubscribe functions passed in. Can pass either an array of unsubscribe functions,\n * or a single unsubscribe function.\n *\n * @param unsubs An array of unsubscribe functions, or a single unsubscribe function.\n */\n static unsubAll(unsubs) {\n if (Array.isArray(unsubs)) {\n unsubs.forEach((unsub) => {\n try {\n unsub();\n }\n catch (e) {\n console.error(e);\n }\n });\n }\n else {\n try {\n unsubs();\n }\n catch (e) {\n console.error(e);\n }\n }\n }\n /**\n * Creates and returns a cleanup function that, when called, calls all unsubscribe functions provided.\n *\n * @param unsubs All subscriptions to be unsubscribed when the returned cleanup function is called.\n * @returns A cleanup function that unsubscribes all subscriptions provided.\n */\n static createCleanup(unsubs) {\n return () => Subscribe.unsubAll(unsubs);\n }\n}\nexports.Subscribe = Subscribe;\n/**\n * A Subs object can be used to subscribe and unsubscribe to events,\n * and to collect subscriptions in an array to be unsubscribed all at once.\n *\n * Calling any of the subscribe functions will add the unsubscribe function to\n * an internal array. You can then call `unsubAll()` to unsubscribe all\n * at once and clear the list.\n */\nclass Subs {\n /**\n * Construct a new Subs object.\n *\n * A Subs object can be used to subscribe and unsubscribe to events,\n * and to collect subscriptions in an array to be unsubscribed all at once.\n *\n * Calling any of the subscribe functions will add the unsubscribe function to\n * an internal array. You can then call `unsubAll()` to unsubscribe all\n * at once and clear the list.\n *\n * You can optionally pass in an array of unsubscribe functions to start with.\n *\n * @param list Optional array of unsubscribe functions. Defaults to an empty list.\n */\n constructor(\n /** A list of unsubscribe functions for all subscribe calls that have been made. */\n list = []) {\n this.list = list;\n }\n /**\n * Call a function that adds a listener and returns a function that will unsubscribe the listener.\n *\n * The function passed in will be called immediately to add the listener,\n * and its Unsubscribe function will be returned.\n *\n * The Unsubscribe function will be added to the internal list of unsubs. You can unsubscribe all by calling `unsubAll()`.\n *\n * @param subscribe The subscribe function, which returns an Unsubscribe. Will be called immediately.\n * @returns The Unsubscribe function for this subscription.\n */\n subscribe(subscribe) {\n const unsub = Subscribe.subscribe(subscribe);\n this.push(unsub);\n return unsub;\n }\n /**\n * Subscribe to an emitter event. Returns a function that will unsubscribe the listener.\n *\n * The Unsubscribe function will be added to the internal list of unsubs. You can unsubscribe all by calling `unsubAll()`.\n *\n * @param eventEmitter The [EventEmitter](https://nodejs.org/api/events.html#class-eventemitter) to subscribe to.\n * @param eventName The name of the event to listen for.\n * @param listener The listener callback that is called when the event occurs.\n * @returns The Unsubscribe function for this subscription.\n */\n subscribeEvent(eventEmitter, eventName, listener) {\n const unsub = Subscribe.subscribeEvent(eventEmitter, eventName, listener);\n this.push(unsub);\n return unsub;\n }\n /**\n * Subscribe to an event on a DOM object (Window or Node). Returns a function that will unsubscribe the listener.\n *\n * The Unsubscribe function will be added to the internal list of unsubs. You can unsubscribe all by calling `unsubAll()`.\n *\n * @param domObj The DOM object to subscribe to for events.\n * @param eventName The name of the event to listen for.\n * @param listener The listener callback that is called when the event occurs.\n * @returns The Unsubscribe function for this subscription.\n */\n subscribeDOMEvent(domObj, eventName, listener) {\n const unsub = Subscribe.subscribeDOMEvent(domObj, eventName, listener);\n this.push(unsub);\n return unsub;\n }\n /**\n * Sets a timer which executes a function once the timer expires using `setTimeout`.\n * Returns an unsubscribe function that clears the timeout using `clearTimeout`.\n *\n * The Unsubscribe function will be added to the internal list of unsubs. You can unsubscribe all by calling `unsubAll()`.\n *\n * @param handler A function to be executed after the timer expires.\n * @param delay The time, in milliseconds that the timer should wait before the specified function or code is executed. If this parameter is omitted, a value of 0 is used, meaning execute \"immediately\", or more accurately, the next event cycle.\n * @param args Additional arguments which are passed through to the handler specified.\n * @returns The Unsubscribe function for this subscription.\n */\n setTimeout(handler, delay, ...args) {\n const timeout = setTimeout(handler, delay, args);\n const unsub = () => clearTimeout(timeout);\n this.push(unsub);\n return unsub;\n }\n /**\n * Repeatedly calls a function with a fixed time delay between each call using `setInterval`.\n * Returns an unsubscribe function that clears the interval using `clearInterval`.\n *\n * The Unsubscribe function will be added to the internal list of unsubs. You can unsubscribe all by calling `unsubAll()`.\n *\n * @param handler A function to be executed after the timer expires.\n * @param delay The time, in milliseconds (thousandths of a second), the timer should delay in between executions of the specified function or code. Defaults to 0 if not specified.\n * @param args Additional arguments which are passed through to the handler once the timer expires.\n * @returns The Unsubscribe function for this subscription.\n */\n setInterval(handler, delay, ...args) {\n const interval = setInterval(handler, delay, args);\n const unsub = () => clearInterval(interval);\n this.push(unsub);\n return unsub;\n }\n /**\n * Pushes an unsubscribe function onto the subscription list.\n *\n * You can unsubscribe all by calling `unsubAll()`.\n *\n * @param unsub The unsubscribe function to push to the subscription list.\n */\n push(unsub) {\n this.list.push(unsub);\n }\n /**\n * Call all unsubscribe functions and clear the unsubscribe list.\n */\n unsubAll() {\n Subscribe.unsubAll(this.list);\n // Empty the array, maintain the reference\n this.list.splice(0, this.list.length);\n }\n /**\n * Creates and returns a cleanup function that, when called, calls all unsubscribe functions and clears the unsubscribe list.\n *\n * @returns A cleanup function that unsubscribes all subscriptions and clears the unsubscribe list.\n */\n createCleanup() {\n return () => {\n this.unsubAll();\n };\n }\n}\nexports.Subs = Subs;\n","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FacebookEmbed = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst react_1 = __importDefault(require(\"react\"));\nconst useFrame_1 = require(\"../hooks/useFrame\");\nconst PlaceholderEmbed_1 = require(\"../placeholder/PlaceholderEmbed\");\nconst uuid_1 = require(\"../uuid\");\nconst EmbedStyle_1 = require(\"./EmbedStyle\");\nconst react_sub_unsub_1 = require(\"react-sub-unsub\");\nconst embedJsScriptSrc = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v16.0';\nconst defaultEmbedWidth = 550;\nconst maxPlaceholderWidth = defaultEmbedWidth;\nconst defaultPlaceholderHeight = 372;\nconst borderRadius = 3;\n// Embed Stages\nconst CHECK_SCRIPT_STAGE = 'check-script';\nconst LOAD_SCRIPT_STAGE = 'load-script';\nconst CONFIRM_SCRIPT_LOADED_STAGE = 'confirm-script-loaded';\nconst PROCESS_EMBED_STAGE = 'process-embed';\nconst CONFIRM_EMBED_SUCCESS_STAGE = 'confirm-embed-success';\nconst RETRYING_STAGE = 'retrying';\nconst EMBED_SUCCESS_STAGE = 'embed-success';\nconst FacebookEmbed = (_a) => {\n var _b, _c;\n var { url, width, height, linkText = 'View post on Facebook', placeholderImageUrl, placeholderSpinner, placeholderSpinnerDisabled = false, placeholderProps, embedPlaceholder, placeholderDisabled = false, scriptLoadDisabled = false, retryDelay = 5000, retryDisabled = false, frame = undefined, debug = false } = _a, divProps = __rest(_a, [\"url\", \"width\", \"height\", \"linkText\", \"placeholderImageUrl\", \"placeholderSpinner\", \"placeholderSpinnerDisabled\", \"placeholderProps\", \"embedPlaceholder\", \"placeholderDisabled\", \"scriptLoadDisabled\", \"retryDelay\", \"retryDisabled\", \"frame\", \"debug\"]);\n const [stage, setStage] = react_1.default.useState(CHECK_SCRIPT_STAGE);\n const embedSuccess = react_1.default.useMemo(() => stage === EMBED_SUCCESS_STAGE, [stage]);\n const uuidRef = react_1.default.useRef((0, uuid_1.generateUUID)());\n const [processTime, setProcessTime] = react_1.default.useState(Date.now());\n const embedContainerKey = react_1.default.useMemo(() => `${uuidRef.current}-${processTime}`, [processTime]);\n const frm = (0, useFrame_1.useFrame)(frame);\n // Debug Output\n react_1.default.useEffect(() => {\n debug && console.log(`[${new Date().toISOString()}]: ${stage}`);\n }, [debug, stage]);\n // === === === === === === === === === === === === === === === === === === ===\n // Embed Stages\n // === === === === === === === === === === === === === === === === === === ===\n // Check Script Stage\n react_1.default.useEffect(() => {\n var _a, _b, _c;\n if (stage === CHECK_SCRIPT_STAGE) {\n if ((_c = (_b = (_a = frm.window) === null || _a === void 0 ? void 0 : _a.FB) === null || _b === void 0 ? void 0 : _b.XFBML) === null || _c === void 0 ? void 0 : _c.parse) {\n setStage(PROCESS_EMBED_STAGE);\n }\n else if (!scriptLoadDisabled) {\n setStage(LOAD_SCRIPT_STAGE);\n }\n else {\n console.error('Facebook embed script not found. Unable to process Facebook embed:', url);\n }\n }\n }, [scriptLoadDisabled, stage, url, frm.window]);\n // Load Script Stage\n react_1.default.useEffect(() => {\n if (stage === LOAD_SCRIPT_STAGE) {\n if (frm.document) {\n const scriptElement = frm.document.createElement('script');\n scriptElement.setAttribute('src', embedJsScriptSrc);\n frm.document.head.appendChild(scriptElement);\n setStage(CONFIRM_SCRIPT_LOADED_STAGE);\n }\n }\n }, [stage, frm.document]);\n // Confirm Script Loaded Stage\n react_1.default.useEffect(() => {\n const subs = new react_sub_unsub_1.Subs();\n if (stage === CONFIRM_SCRIPT_LOADED_STAGE) {\n subs.setInterval(() => {\n var _a, _b, _c;\n if ((_c = (_b = (_a = frm.window) === null || _a === void 0 ? void 0 : _a.FB) === null || _b === void 0 ? void 0 : _b.XFBML) === null || _c === void 0 ? void 0 : _c.parse) {\n setStage(PROCESS_EMBED_STAGE);\n }\n }, 1);\n }\n return subs.createCleanup();\n }, [stage, frm.window]);\n // Process Embed Stage\n react_1.default.useEffect(() => {\n var _a, _b, _c;\n if (stage === PROCESS_EMBED_STAGE) {\n const parse = (_c = (_b = (_a = frm.window) === null || _a === void 0 ? void 0 : _a.FB) === null || _b === void 0 ? void 0 : _b.XFBML) === null || _c === void 0 ? void 0 : _c.parse;\n if (parse) {\n parse();\n setStage(CONFIRM_EMBED_SUCCESS_STAGE);\n }\n else {\n console.error('Facebook embed script not found. Unable to process Facebook embed:', url);\n }\n }\n }, [stage, url, frm.window]);\n // Confirm Embed Success Stage\n react_1.default.useEffect(() => {\n const subs = new react_sub_unsub_1.Subs();\n if (stage === CONFIRM_EMBED_SUCCESS_STAGE) {\n subs.setInterval(() => {\n if (frm.document) {\n const fbPostContainerElement = frm.document.getElementById(uuidRef.current);\n if (fbPostContainerElement) {\n const fbPostElem = fbPostContainerElement.getElementsByClassName('fb-post')[0];\n if (fbPostElem) {\n if (fbPostElem.children.length > 0) {\n setStage(EMBED_SUCCESS_STAGE);\n }\n }\n }\n }\n }, 1);\n if (!retryDisabled) {\n subs.setTimeout(() => {\n setStage(RETRYING_STAGE);\n }, retryDelay);\n }\n }\n return subs.createCleanup();\n }, [retryDisabled, retryDelay, stage, frm.document]);\n // Retrying Stage\n react_1.default.useEffect(() => {\n if (stage === RETRYING_STAGE) {\n // This forces the embed container to remount\n setProcessTime(Date.now());\n setStage(PROCESS_EMBED_STAGE);\n }\n }, [stage]);\n // END Embed Stages\n // === === === === === === === === === === === === === === === === === === ===\n const isPercentageWidth = !!(width === null || width === void 0 ? void 0 : width.toString().includes('%'));\n const isPercentageHeight = !!(height === null || height === void 0 ? void 0 : height.toString().includes('%'));\n // === Placeholder ===\n const placeholderStyle = {\n maxWidth: isPercentageWidth ? undefined : maxPlaceholderWidth,\n width: typeof width !== 'undefined' ? (isPercentageWidth ? '100%' : width) : '100%',\n height: isPercentageHeight\n ? '100%'\n : typeof height !== 'undefined'\n ? height\n : typeof ((_b = divProps.style) === null || _b === void 0 ? void 0 : _b.height) !== 'undefined' || typeof ((_c = divProps.style) === null || _c === void 0 ? void 0 : _c.maxHeight) !== 'undefined'\n ? '100%'\n : defaultPlaceholderHeight,\n border: '1px solid #dee2e6',\n borderRadius,\n };\n const placeholder = embedPlaceholder !== null && embedPlaceholder !== void 0 ? embedPlaceholder : (react_1.default.createElement(PlaceholderEmbed_1.PlaceholderEmbed, Object.assign({ url: url, imageUrl: placeholderImageUrl, linkText: linkText, spinner: placeholderSpinner, spinnerDisabled: placeholderSpinnerDisabled }, placeholderProps, { style: Object.assign(Object.assign({}, placeholderStyle), placeholderProps === null || placeholderProps === void 0 ? void 0 : placeholderProps.style) })));\n // === END Placeholder ===\n return (react_1.default.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)('rsme-embed rsme-facebook-embed', divProps.className), style: Object.assign({ overflow: 'hidden', width: width !== null && width !== void 0 ? width : undefined, height: height !== null && height !== void 0 ? height : undefined, borderRadius }, divProps.style) }),\n react_1.default.createElement(EmbedStyle_1.EmbedStyle, null),\n react_1.default.createElement(\"div\", { id: uuidRef.current, className: (0, classnames_1.default)(!embedSuccess && 'rsme-d-none') },\n react_1.default.createElement(\"div\", { key: embedContainerKey, className: \"fb-post\", \"data-href\": url, \"data-width\": isPercentageWidth ? '100%' : width !== null && width !== void 0 ? width : defaultEmbedWidth, style: {\n width: isPercentageWidth ? '100%' : width !== null && width !== void 0 ? width : defaultEmbedWidth,\n height: isPercentageHeight ? '100%' : height !== null && height !== void 0 ? height : undefined,\n } })),\n !embedSuccess && !placeholderDisabled && placeholder));\n};\nexports.FacebookEmbed = FacebookEmbed;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InstagramEmbed = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst React = __importStar(require(\"react\"));\nconst react_sub_unsub_1 = require(\"react-sub-unsub\");\nconst useFrame_1 = require(\"../hooks/useFrame\");\nconst PlaceholderEmbed_1 = require(\"../placeholder/PlaceholderEmbed\");\nconst uuid_1 = require(\"../uuid\");\nconst EmbedStyle_1 = require(\"./EmbedStyle\");\nconst embedJsScriptSrc = 'https://www.instagram.com/embed.js';\nconst minPlaceholderWidth = 328;\nconst defaultPlaceholderHeight = 372;\nconst borderRadius = 3;\n// Embed Stages\nconst CHECK_SCRIPT_STAGE = 'check-script';\nconst LOAD_SCRIPT_STAGE = 'load-script';\nconst CONFIRM_SCRIPT_LOADED_STAGE = 'confirm-script-loaded';\nconst PROCESS_EMBED_STAGE = 'process-embed';\nconst CONFIRM_EMBED_SUCCESS_STAGE = 'confirm-embed-success';\nconst RETRYING_STAGE = 'retrying';\nconst EMBED_SUCCESS_STAGE = 'embed-success';\nconst InstagramEmbed = (_a) => {\n var _b, _c;\n var { url, width, height, linkText = 'View post on Instagram', captioned = false, placeholderImageUrl, placeholderSpinner, placeholderSpinnerDisabled = false, placeholderProps, embedPlaceholder, placeholderDisabled = false, scriptLoadDisabled = false, retryDelay = 5000, retryDisabled = false, igVersion = '14', frame = undefined, debug = false } = _a, divProps = __rest(_a, [\"url\", \"width\", \"height\", \"linkText\", \"captioned\", \"placeholderImageUrl\", \"placeholderSpinner\", \"placeholderSpinnerDisabled\", \"placeholderProps\", \"embedPlaceholder\", \"placeholderDisabled\", \"scriptLoadDisabled\", \"retryDelay\", \"retryDisabled\", \"igVersion\", \"frame\", \"debug\"]);\n const [stage, setStage] = React.useState(CHECK_SCRIPT_STAGE);\n const uuidRef = React.useRef((0, uuid_1.generateUUID)());\n const [processTime, setProcessTime] = React.useState(Date.now());\n const embedContainerKey = React.useMemo(() => `${uuidRef.current}-${processTime}`, [processTime]);\n const frm = (0, useFrame_1.useFrame)(frame);\n // Debug Output\n React.useEffect(() => {\n debug && console.log(`[${new Date().toISOString()}]: ${stage}`);\n }, [debug, stage]);\n // === === === === === === === === === === === === === === === === === === ===\n // Embed Stages\n // === === === === === === === === === === === === === === === === === === ===\n // Check Script Stage\n React.useEffect(() => {\n var _a, _b, _c;\n if (stage === CHECK_SCRIPT_STAGE) {\n if ((_c = (_b = (_a = frm.window) === null || _a === void 0 ? void 0 : _a.instgrm) === null || _b === void 0 ? void 0 : _b.Embeds) === null || _c === void 0 ? void 0 : _c.process) {\n setStage(PROCESS_EMBED_STAGE);\n }\n else if (!scriptLoadDisabled) {\n setStage(LOAD_SCRIPT_STAGE);\n }\n else {\n console.error('Instagram embed script not found. Unable to process Instagram embed:', url);\n }\n }\n }, [scriptLoadDisabled, stage, url, frm.window]);\n // Load Script Stage\n React.useEffect(() => {\n if (stage === LOAD_SCRIPT_STAGE) {\n if (frm.document) {\n const scriptElement = frm.document.createElement('script');\n scriptElement.setAttribute('src', embedJsScriptSrc);\n frm.document.head.appendChild(scriptElement);\n setStage(CONFIRM_SCRIPT_LOADED_STAGE);\n }\n }\n }, [stage, frm.document]);\n // Confirm Script Loaded Stage\n React.useEffect(() => {\n const subs = new react_sub_unsub_1.Subs();\n if (stage === CONFIRM_SCRIPT_LOADED_STAGE) {\n subs.setInterval(() => {\n var _a, _b, _c;\n if ((_c = (_b = (_a = frm.window) === null || _a === void 0 ? void 0 : _a.instgrm) === null || _b === void 0 ? void 0 : _b.Embeds) === null || _c === void 0 ? void 0 : _c.process) {\n setStage(PROCESS_EMBED_STAGE);\n }\n }, 1);\n }\n return subs.createCleanup();\n }, [stage, frm.window]);\n // Process Embed Stage\n React.useEffect(() => {\n var _a, _b, _c;\n if (stage === PROCESS_EMBED_STAGE) {\n const process = (_c = (_b = (_a = frm.window) === null || _a === void 0 ? void 0 : _a.instgrm) === null || _b === void 0 ? void 0 : _b.Embeds) === null || _c === void 0 ? void 0 : _c.process;\n if (process) {\n process();\n setStage(CONFIRM_EMBED_SUCCESS_STAGE);\n }\n else {\n console.error('Instagram embed script not found. Unable to process Instagram embed:', url);\n }\n }\n }, [stage, frm.window, url]);\n // Confirm Embed Success Stage\n React.useEffect(() => {\n const subs = new react_sub_unsub_1.Subs();\n if (stage === CONFIRM_EMBED_SUCCESS_STAGE) {\n subs.setInterval(() => {\n if (frm.document) {\n const preEmbedElement = frm.document.getElementById(uuidRef.current);\n if (!preEmbedElement) {\n setStage(EMBED_SUCCESS_STAGE);\n }\n }\n }, 1);\n if (!retryDisabled) {\n subs.setTimeout(() => {\n setStage(RETRYING_STAGE);\n }, retryDelay);\n }\n }\n return subs.createCleanup();\n }, [retryDelay, retryDisabled, stage, frm.document]);\n // Retrying Stage\n React.useEffect(() => {\n if (stage === RETRYING_STAGE) {\n // This forces the embed container to remount\n setProcessTime(Date.now());\n setStage(PROCESS_EMBED_STAGE);\n }\n }, [stage]);\n // END Embed Stages\n // === === === === === === === === === === === === === === === === === === ===\n const urlWithNoQueryOrUsername = url.split(/[?#]/)[0].replace(/\\.com\\/.*?\\/p/, '.com/p').replace(/\\.com\\/.*?\\/reel/, '.com/reel');\n const cleanUrlWithEndingSlash = `${urlWithNoQueryOrUsername}${urlWithNoQueryOrUsername.endsWith('/') ? '' : '/'}`;\n const isPercentageWidth = !!(width === null || width === void 0 ? void 0 : width.toString().includes('%'));\n const isPercentageHeight = !!(height === null || height === void 0 ? void 0 : height.toString().includes('%'));\n // === Placeholder ===\n const placeholderStyle = {\n minWidth: isPercentageWidth ? undefined : minPlaceholderWidth,\n width: typeof width !== 'undefined' ? (isPercentageWidth ? '100%' : width) : '100%',\n height: isPercentageHeight\n ? '100%'\n : typeof height !== 'undefined'\n ? height\n : typeof ((_b = divProps.style) === null || _b === void 0 ? void 0 : _b.height) !== 'undefined' || typeof ((_c = divProps.style) === null || _c === void 0 ? void 0 : _c.maxHeight) !== 'undefined'\n ? '100%'\n : defaultPlaceholderHeight,\n border: '1px solid #dee2e6',\n borderRadius,\n };\n const placeholder = embedPlaceholder !== null && embedPlaceholder !== void 0 ? embedPlaceholder : (React.createElement(PlaceholderEmbed_1.PlaceholderEmbed, Object.assign({ url: cleanUrlWithEndingSlash, imageUrl: placeholderImageUrl, linkText: linkText, spinner: placeholderSpinner, spinnerDisabled: placeholderSpinnerDisabled }, placeholderProps, { style: Object.assign(Object.assign({}, placeholderStyle), placeholderProps === null || placeholderProps === void 0 ? void 0 : placeholderProps.style) })));\n // === END Placeholder ===\n return (React.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)('rsme-embed rsme-instagram-embed', uuidRef.current, divProps.className), style: Object.assign(Object.assign({ overflow: 'hidden', width: width !== null && width !== void 0 ? width : undefined, height: height !== null && height !== void 0 ? height : undefined, borderRadius }, divProps.style), { position: 'relative' }) }),\n React.createElement(EmbedStyle_1.EmbedStyle, null),\n React.createElement(\"blockquote\", { key: embedContainerKey, className: \"instagram-media\", \"data-instgrm-permalink\": `${cleanUrlWithEndingSlash}?utm_source=ig_embed&utm_campaign=loading`, \"data-instgrm-version\": igVersion, \"data-instgrm-captioned\": captioned ? captioned : undefined, \"data-width\": isPercentageWidth ? '100%' : width !== null && width !== void 0 ? width : undefined, style: {\n width: 'calc(100% - 2px)',\n } },\n !placeholderDisabled && placeholder,\n React.createElement(\"div\", { id: uuidRef.current, className: \"instagram-media-pre-embed rsme-d-none\" }, \"\\u00A0\"))));\n};\nexports.InstagramEmbed = InstagramEmbed;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedInEmbed = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst React = __importStar(require(\"react\"));\nconst PlaceholderEmbed_1 = require(\"../placeholder/PlaceholderEmbed\");\nconst EmbedStyle_1 = require(\"./EmbedStyle\");\nconst minPlaceholderWidth = 250;\nconst maxPlaceholderWidth = 550;\nconst defaultPlaceholderHeight = 550;\nconst borderRadius = 8;\nconst LinkedInEmbed = (_a) => {\n var _b, _c;\n var { url, postUrl, width, height = 500, linkText = 'View post on LinkedIn', placeholderImageUrl, placeholderSpinner, placeholderSpinnerDisabled = false, placeholderProps, embedPlaceholder, placeholderDisabled = false } = _a, divProps = __rest(_a, [\"url\", \"postUrl\", \"width\", \"height\", \"linkText\", \"placeholderImageUrl\", \"placeholderSpinner\", \"placeholderSpinnerDisabled\", \"placeholderProps\", \"embedPlaceholder\", \"placeholderDisabled\"]);\n const [ready, setReady] = React.useState(false);\n // === Placeholder ===\n const placeholderStyle = {\n minWidth: minPlaceholderWidth,\n maxWidth: maxPlaceholderWidth,\n width: typeof width !== 'undefined' ? width : '100%',\n height: typeof height !== 'undefined'\n ? height\n : typeof ((_b = divProps.style) === null || _b === void 0 ? void 0 : _b.height) !== 'undefined' || typeof ((_c = divProps.style) === null || _c === void 0 ? void 0 : _c.maxHeight) !== 'undefined'\n ? '100%'\n : defaultPlaceholderHeight,\n border: 'solid 1px rgba(0, 0, 0, 0.15)',\n borderRadius,\n };\n const placeholder = embedPlaceholder !== null && embedPlaceholder !== void 0 ? embedPlaceholder : (React.createElement(PlaceholderEmbed_1.PlaceholderEmbed, Object.assign({ url: postUrl !== null && postUrl !== void 0 ? postUrl : url, imageUrl: placeholderImageUrl, linkText: linkText, spinner: placeholderSpinner, spinnerDisabled: placeholderSpinnerDisabled }, placeholderProps, { style: Object.assign(Object.assign({}, placeholderStyle), placeholderProps === null || placeholderProps === void 0 ? void 0 : placeholderProps.style) })));\n // === END Placeholder ===\n return (React.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)('rsme-embed rsme-linkedin-embed', divProps.className), style: Object.assign({ overflow: 'hidden', width: width !== null && width !== void 0 ? width : undefined, height: height !== null && height !== void 0 ? height : undefined, borderRadius }, divProps.style) }),\n React.createElement(EmbedStyle_1.EmbedStyle, null),\n React.createElement(\"iframe\", { className: (0, classnames_1.default)('linkedin-post', !ready && 'rsme-d-none'), src: url, width: \"100%\", height: !ready ? 0 : height, frameBorder: \"0\", onLoad: () => setReady(true) }),\n !ready && !placeholderDisabled && placeholder));\n};\nexports.LinkedInEmbed = LinkedInEmbed;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PinterestEmbed = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst React = __importStar(require(\"react\"));\nconst PlaceholderEmbed_1 = require(\"../placeholder/PlaceholderEmbed\");\nconst EmbedStyle_1 = require(\"./EmbedStyle\");\nconst minPlaceholderWidth = 250;\nconst maxPlaceholderWidth = 550;\nconst defaultPlaceholderHeight = 550;\nconst borderRadius = 8;\nconst PinterestEmbed = (_a) => {\n var _b, _c, _d;\n var { url, postUrl, width, height = 500, linkText = 'View post on Pinterest', placeholderImageUrl, placeholderSpinner, placeholderSpinnerDisabled = false, placeholderProps, embedPlaceholder, placeholderDisabled = false } = _a, divProps = __rest(_a, [\"url\", \"postUrl\", \"width\", \"height\", \"linkText\", \"placeholderImageUrl\", \"placeholderSpinner\", \"placeholderSpinnerDisabled\", \"placeholderProps\", \"embedPlaceholder\", \"placeholderDisabled\"]);\n const [ready, setReady] = React.useState(false);\n // === Placeholder ===\n const placeholderStyle = {\n minWidth: minPlaceholderWidth,\n maxWidth: maxPlaceholderWidth,\n width: typeof width !== 'undefined' ? width : '100%',\n height: typeof height !== 'undefined'\n ? height\n : typeof ((_b = divProps.style) === null || _b === void 0 ? void 0 : _b.height) !== 'undefined' || typeof ((_c = divProps.style) === null || _c === void 0 ? void 0 : _c.maxHeight) !== 'undefined'\n ? '100%'\n : defaultPlaceholderHeight,\n border: 'solid 1px rgba(0, 0, 0, 0.15)',\n borderRadius,\n };\n const placeholder = embedPlaceholder !== null && embedPlaceholder !== void 0 ? embedPlaceholder : (React.createElement(PlaceholderEmbed_1.PlaceholderEmbed, Object.assign({ url: postUrl !== null && postUrl !== void 0 ? postUrl : url, imageUrl: placeholderImageUrl, linkText: linkText, spinner: placeholderSpinner, spinnerDisabled: placeholderSpinnerDisabled }, placeholderProps, { style: Object.assign(Object.assign({}, placeholderStyle), placeholderProps === null || placeholderProps === void 0 ? void 0 : placeholderProps.style) })));\n // Example URL: https://www.pinterest.com/pin/875105771321194304/sent/?invite_code=e86262c989ee4f559a08a4494c300ba3&sfo=1\n const postIdMatch = (_d = url.match(/pin\\/([\\w\\d_-]+)/)) === null || _d === void 0 ? void 0 : _d[1];\n const postId = postIdMatch !== null && postIdMatch !== void 0 ? postIdMatch : '000000000000000000';\n return (React.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)('rsme-embed rsme-pinterest-embed', divProps.className), style: Object.assign({ overflow: 'hidden', width: width !== null && width !== void 0 ? width : undefined, height: height !== null && height !== void 0 ? height : undefined, borderRadius }, divProps.style) }),\n React.createElement(EmbedStyle_1.EmbedStyle, null),\n React.createElement(\"iframe\", { className: (0, classnames_1.default)('pinterest-post', !ready && 'rsme-d-none'), src: `https://assets.pinterest.com/ext/embed.html?id=${postId}`, width: \"100%\", height: !ready ? 0 : height, frameBorder: \"0\", scrolling: \"no\", onLoad: () => setReady(true) }),\n !ready && !placeholderDisabled && placeholder));\n};\nexports.PinterestEmbed = PinterestEmbed;\n","\"use strict\";\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TikTokEmbed = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst react_1 = __importDefault(require(\"react\"));\nconst react_sub_unsub_1 = require(\"react-sub-unsub\");\nconst useFrame_1 = require(\"../hooks/useFrame\");\nconst PlaceholderEmbed_1 = require(\"../placeholder/PlaceholderEmbed\");\nconst uuid_1 = require(\"../uuid\");\nconst EmbedStyle_1 = require(\"./EmbedStyle\");\nconst embedJsScriptSrc = 'https://www.tiktok.com/embed.js';\nconst minPlaceholderWidth = 325;\nconst maxPlaceholderWidth = 480;\nconst defaultPlaceholderHeight = 550;\nconst borderRadius = 8;\n// Embed Stages\nconst PROCESS_EMBED_STAGE = 'process-embed';\nconst CONFIRM_EMBED_SUCCESS_STAGE = 'confirm-embed-success';\nconst RETRYING_STAGE = 'retrying';\nconst EMBED_SUCCESS_STAGE = 'embed-success';\nconst TikTokEmbed = (_a) => {\n var _b, _c;\n var { url, width, height, linkText = 'View post on TikTok', placeholderImageUrl, placeholderSpinner, placeholderSpinnerDisabled = false, placeholderProps, embedPlaceholder, placeholderDisabled = false, scriptLoadDisabled = false, retryDelay = 5000, retryDisabled = false, frame = undefined, debug = false } = _a, divProps = __rest(_a, [\"url\", \"width\", \"height\", \"linkText\", \"placeholderImageUrl\", \"placeholderSpinner\", \"placeholderSpinnerDisabled\", \"placeholderProps\", \"embedPlaceholder\", \"placeholderDisabled\", \"scriptLoadDisabled\", \"retryDelay\", \"retryDisabled\", \"frame\", \"debug\"]);\n const [stage, setStage] = react_1.default.useState(PROCESS_EMBED_STAGE);\n const uuidRef = react_1.default.useRef((0, uuid_1.generateUUID)());\n const [processTime, setProcessTime] = react_1.default.useState(Date.now());\n const embedContainerKey = react_1.default.useMemo(() => `${uuidRef.current}-${processTime}`, [processTime]);\n const frm = (0, useFrame_1.useFrame)(frame);\n // Debug Output\n react_1.default.useEffect(() => {\n debug && console.log(`[${new Date().toISOString()}]: ${stage}`);\n }, [debug, stage]);\n // === === === === === === === === === === === === === === === === === === ===\n // Embed Stages\n // === === === === === === === === === === === === === === === === === === ===\n // Process Embed Stage\n react_1.default.useEffect(() => {\n if (stage === PROCESS_EMBED_STAGE) {\n if (frm.document && !scriptLoadDisabled) {\n const scriptId = `tiktok-embed-script`;\n const prevScript = frm.document.getElementById(scriptId);\n if (prevScript) {\n prevScript.remove();\n }\n const scriptElement = frm.document.createElement('script');\n scriptElement.setAttribute('src', `${embedJsScriptSrc}?t=${Date.now()}`);\n scriptElement.setAttribute('id', scriptId);\n frm.document.head.appendChild(scriptElement);\n setStage(CONFIRM_EMBED_SUCCESS_STAGE);\n }\n }\n }, [scriptLoadDisabled, stage, frm.document]);\n // Confirm Embed Success Stage\n react_1.default.useEffect(() => {\n const subs = new react_sub_unsub_1.Subs();\n if (stage === CONFIRM_EMBED_SUCCESS_STAGE) {\n subs.setInterval(() => {\n if (frm.document) {\n const preEmbedElement = frm.document.getElementById(uuidRef.current);\n if (!preEmbedElement) {\n setStage(EMBED_SUCCESS_STAGE);\n }\n }\n }, 1);\n if (!retryDisabled) {\n subs.setTimeout(() => {\n setStage(RETRYING_STAGE);\n }, retryDelay);\n }\n }\n return subs.createCleanup();\n }, [retryDelay, retryDisabled, stage, frm.document]);\n // Retrying Stage\n react_1.default.useEffect(() => {\n if (stage === RETRYING_STAGE) {\n // This forces the embed container to remount\n setProcessTime(Date.now());\n setStage(PROCESS_EMBED_STAGE);\n }\n }, [stage]);\n // END Embed Stages\n // === === === === === === === === === === === === === === === === === === ===\n // Format: https://www.tiktok.com/@epicgardening/video/7055411162212633903?is_copy_url=1&is_from_webapp=v1\n const embedId = url.replace(/[?].*$/, '').replace(/^.+\\//, '');\n // === Placeholder ===\n const placeholderStyle = {\n minWidth: minPlaceholderWidth,\n maxWidth: maxPlaceholderWidth,\n width: typeof width !== 'undefined' ? width : '100%',\n height: typeof height !== 'undefined'\n ? height\n : typeof ((_b = divProps.style) === null || _b === void 0 ? void 0 : _b.height) !== 'undefined' || typeof ((_c = divProps.style) === null || _c === void 0 ? void 0 : _c.maxHeight) !== 'undefined'\n ? '100%'\n : defaultPlaceholderHeight,\n border: 'solid 1px rgba(22,24,35,0.12)',\n borderRadius,\n };\n const placeholder = embedPlaceholder !== null && embedPlaceholder !== void 0 ? embedPlaceholder : (react_1.default.createElement(PlaceholderEmbed_1.PlaceholderEmbed, Object.assign({ url: url, imageUrl: placeholderImageUrl, linkText: linkText, spinner: placeholderSpinner, spinnerDisabled: placeholderSpinnerDisabled }, placeholderProps, { style: Object.assign(Object.assign({}, placeholderStyle), placeholderProps === null || placeholderProps === void 0 ? void 0 : placeholderProps.style) })));\n // === END Placeholder ===\n return (react_1.default.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)('rsme-embed rsme-tiktok-embed', divProps.className), style: Object.assign({ overflow: 'hidden', width: width !== null && width !== void 0 ? width : undefined, height: height !== null && height !== void 0 ? height : undefined, borderRadius }, divProps.style) }),\n react_1.default.createElement(EmbedStyle_1.EmbedStyle, null),\n react_1.default.createElement(\"div\", { className: \"tiktok-embed-container\" },\n react_1.default.createElement(\"blockquote\", { key: embedContainerKey, className: \"tiktok-embed\", cite: url, \"data-video-id\": embedId }, !placeholderDisabled ? (react_1.default.createElement(\"div\", { id: uuidRef.current, style: { display: 'flex', justifyContent: 'center' } }, placeholder)) : (react_1.default.createElement(\"div\", { id: uuidRef.current, style: { display: 'none' } }, \"\\u00A0\"))))));\n};\nexports.TikTokEmbed = TikTokEmbed;\n","/*!\n * $script.js JS loader & dependency manager\n * https://github.com/ded/script.js\n * (c) Dustin Diaz 2014 | License MIT\n */\n\n(function (name, definition) {\n if (typeof module != 'undefined' && module.exports) module.exports = definition()\n else if (typeof define == 'function' && define.amd) define(definition)\n else this[name] = definition()\n})('$script', function () {\n var doc = document\n , head = doc.getElementsByTagName('head')[0]\n , s = 'string'\n , f = false\n , push = 'push'\n , readyState = 'readyState'\n , onreadystatechange = 'onreadystatechange'\n , list = {}\n , ids = {}\n , delay = {}\n , scripts = {}\n , scriptpath\n , urlArgs\n\n function every(ar, fn) {\n for (var i = 0, j = ar.length; i < j; ++i) if (!fn(ar[i])) return f\n return 1\n }\n function each(ar, fn) {\n every(ar, function (el) {\n fn(el)\n return 1\n })\n }\n\n function $script(paths, idOrDone, optDone) {\n paths = paths[push] ? paths : [paths]\n var idOrDoneIsDone = idOrDone && idOrDone.call\n , done = idOrDoneIsDone ? idOrDone : optDone\n , id = idOrDoneIsDone ? paths.join('') : idOrDone\n , queue = paths.length\n function loopFn(item) {\n return item.call ? item() : list[item]\n }\n function callback() {\n if (!--queue) {\n list[id] = 1\n done && done()\n for (var dset in delay) {\n every(dset.split('|'), loopFn) && !each(delay[dset], loopFn) && (delay[dset] = [])\n }\n }\n }\n setTimeout(function () {\n each(paths, function loading(path, force) {\n if (path === null) return callback()\n \n if (!force && !/^https?:\\/\\//.test(path) && scriptpath) {\n path = (path.indexOf('.js') === -1) ? scriptpath + path + '.js' : scriptpath + path;\n }\n \n if (scripts[path]) {\n if (id) ids[id] = 1\n return (scripts[path] == 2) ? callback() : setTimeout(function () { loading(path, true) }, 0)\n }\n\n scripts[path] = 1\n if (id) ids[id] = 1\n create(path, callback)\n })\n }, 0)\n return $script\n }\n\n function create(path, fn) {\n var el = doc.createElement('script'), loaded\n el.onload = el.onerror = el[onreadystatechange] = function () {\n if ((el[readyState] && !(/^c|loade/.test(el[readyState]))) || loaded) return;\n el.onload = el[onreadystatechange] = null\n loaded = 1\n scripts[path] = 2\n fn()\n }\n el.async = 1\n el.src = urlArgs ? path + (path.indexOf('?') === -1 ? '?' : '&') + urlArgs : path;\n head.insertBefore(el, head.lastChild)\n }\n\n $script.get = create\n\n $script.order = function (scripts, id, done) {\n (function callback(s) {\n s = scripts.shift()\n !scripts.length ? $script(s, id, done) : $script(s, callback)\n }())\n }\n\n $script.path = function (p) {\n scriptpath = p\n }\n $script.urlArgs = function (str) {\n urlArgs = str;\n }\n $script.ready = function (deps, ready, req) {\n deps = deps[push] ? deps : [deps]\n var missing = [];\n !each(deps, function (dep) {\n list[dep] || missing[push](dep);\n }) && every(deps, function (dep) {return list[dep]}) ?\n ready() : !function (key) {\n delay[key] = delay[key] || []\n delay[key][push](ready)\n req && req(missing)\n }(deps.join('|'))\n return $script\n }\n\n $script.done = function (idOrDone) {\n $script([null], idOrDone)\n }\n\n return $script\n});\n","import React from 'react';\n\nvar twitterWidgetJs = 'https://platform.twitter.com/widgets.js';\n\nvar methodName = 'createTimeline';\n\nvar TwitterTimelineEmbed = function TwitterTimelineEmbed(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n var buildOptions = function buildOptions() {\n var options = Object.assign({}, props.options);\n\n if (props !== null && props !== void 0 && props.autoHeight) {\n var _ref$current, _ref$current$parentNo;\n\n options.height = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$parentNo = _ref$current.parentNode) === null || _ref$current$parentNo === void 0 ? void 0 : _ref$current$parentNo.offsetHeight;\n }\n\n options = Object.assign({}, options, {\n theme: props === null || props === void 0 ? void 0 : props.theme,\n linkColor: props === null || props === void 0 ? void 0 : props.linkColor,\n borderColor: props === null || props === void 0 ? void 0 : props.borderColor,\n lang: props === null || props === void 0 ? void 0 : props.lang,\n tweetLimit: props === null || props === void 0 ? void 0 : props.tweetLimit,\n ariaPolite: props === null || props === void 0 ? void 0 : props.ariaPolite\n });\n return options;\n };\n\n var buildChromeOptions = function buildChromeOptions(options) {\n options.chrome = '';\n\n if (props.noHeader) {\n options.chrome = options.chrome + ' noheader';\n }\n\n if (props.noFooter) {\n options.chrome = options.chrome + ' nofooter';\n }\n\n if (props.noBorders) {\n options.chrome = options.chrome + ' noborders';\n }\n\n if (props.noScrollbar) {\n options.chrome = options.chrome + ' noscrollbar';\n }\n\n if (props.transparent) {\n options.chrome = options.chrome + ' transparent';\n }\n\n return options;\n };\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName]) {\n console.error(\"Method \" + methodName + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n var options = buildOptions();\n options = buildChromeOptions(options);\n window.twttr.widgets[methodName]({\n sourceType: props.sourceType,\n screenName: props.screenName,\n userId: props.userId,\n ownerScreenName: props.ownerScreenName,\n slug: props.slug,\n id: props.id || props.widgetId,\n url: props.url\n }, ref === null || ref === void 0 ? void 0 : ref.current, options).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$1 = 'createShareButton';\n\nvar TwitterShareButton = function TwitterShareButton(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$1]) {\n console.error(\"Method \" + methodName$1 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$1](props.url, ref === null || ref === void 0 ? void 0 : ref.current, props.options).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$2 = 'createFollowButton';\n\nvar TwitterFollowButton = function TwitterFollowButton(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$2]) {\n console.error(\"Method \" + methodName$2 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$2](props.screenName, ref === null || ref === void 0 ? void 0 : ref.current, props.options).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$3 = 'createHashtagButton';\n\nvar TwitterHashtagButton = function TwitterHashtagButton(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$3]) {\n console.error(\"Method \" + methodName$3 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$3](props.tag, ref === null || ref === void 0 ? void 0 : ref.current, props.options).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$4 = 'createMentionButton';\n\nvar TwitterMentionButton = function TwitterMentionButton(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$4]) {\n console.error(\"Method \" + methodName$4 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$4](props.screenName, ref === null || ref === void 0 ? void 0 : ref.current, props.options).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$5 = 'createTweet';\n\nvar TwitterTweetEmbed = function TwitterTweetEmbed(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$5]) {\n console.error(\"Method \" + methodName$5 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$5](props.tweetId, ref === null || ref === void 0 ? void 0 : ref.current, props.options).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$6 = 'createMoment';\n\nvar TwitterMomentShare = function TwitterMomentShare(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$6]) {\n console.error(\"Method \" + methodName$6 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$6](props.momentId, ref === null || ref === void 0 ? void 0 : ref.current, props.options).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$7 = 'createDMButton';\n\nvar TwitterDMButton = function TwitterDMButton(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$7]) {\n console.error(\"Method \" + methodName$7 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$7](props.id, ref === null || ref === void 0 ? void 0 : ref.current, props.options).then(function (element) {\n if (isComponentMounted) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$8 = 'createVideo';\n\nvar TwitterVideoEmbed = function TwitterVideoEmbed(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$8]) {\n console.error(\"Method \" + methodName$8 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$8](props.id, ref === null || ref === void 0 ? void 0 : ref.current).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nvar methodName$9 = 'createPeriscopeOnAirButton';\n\nvar TwitterOnAirButton = function TwitterOnAirButton(props) {\n var ref = React.useRef(null);\n\n var _React$useState = React.useState(true),\n loading = _React$useState[0],\n setLoading = _React$useState[1];\n\n React.useEffect(function () {\n var isComponentMounted = true;\n\n var script = require('scriptjs');\n\n script(twitterWidgetJs, 'twitter-embed', function () {\n if (!window.twttr) {\n console.error('Failure to load window.twttr, aborting load');\n return;\n }\n\n if (isComponentMounted) {\n if (!window.twttr.widgets[methodName$9]) {\n console.error(\"Method \" + methodName$9 + \" is not present anymore in twttr.widget api\");\n return;\n }\n\n window.twttr.widgets[methodName$9](props.username, ref === null || ref === void 0 ? void 0 : ref.current, props.options).then(function (element) {\n setLoading(false);\n\n if (props.onLoad) {\n props.onLoad(element);\n }\n });\n }\n });\n return function () {\n isComponentMounted = false;\n };\n }, []);\n return React.createElement(React.Fragment, null, loading && React.createElement(React.Fragment, null, props.placeholder), React.createElement(\"div\", {\n ref: ref\n }));\n};\n\nexport { TwitterDMButton, TwitterFollowButton, TwitterHashtagButton, TwitterMentionButton, TwitterMomentShare, TwitterOnAirButton, TwitterShareButton, TwitterTimelineEmbed, TwitterTweetEmbed, TwitterVideoEmbed };\n//# sourceMappingURL=index.modern.js.map\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.XEmbed = void 0;\nconst classnames_1 = __importDefault(require(\"classnames\"));\nconst React = __importStar(require(\"react\"));\nconst react_twitter_embed_1 = require(\"react-twitter-embed\");\nconst PlaceholderEmbed_1 = require(\"../placeholder/PlaceholderEmbed\");\nconst EmbedStyle_1 = require(\"./EmbedStyle\");\nconst minPlaceholderWidth = 250;\nconst maxPlaceholderWidth = 550;\nconst defaultPlaceholderHeight = 350;\nconst borderRadius = 12;\nconst XEmbed = (_a) => {\n var _b, _c;\n var { url, width, height, linkText = 'View post on X', placeholderImageUrl, placeholderSpinner, placeholderSpinnerDisabled = false, placeholderProps, embedPlaceholder, placeholderDisabled, twitterTweetEmbedProps } = _a, divProps = __rest(_a, [\"url\", \"width\", \"height\", \"linkText\", \"placeholderImageUrl\", \"placeholderSpinner\", \"placeholderSpinnerDisabled\", \"placeholderProps\", \"embedPlaceholder\", \"placeholderDisabled\", \"twitterTweetEmbedProps\"]);\n const postId = url.substring(url.lastIndexOf('/') + 1).replace(/[?].*$/, '');\n const isPercentageWidth = !!(width === null || width === void 0 ? void 0 : width.toString().includes('%'));\n const isPercentageHeight = !!(height === null || height === void 0 ? void 0 : height.toString().includes('%'));\n // === Placeholder ===\n const placeholderStyle = {\n minWidth: minPlaceholderWidth,\n maxWidth: maxPlaceholderWidth,\n width: typeof width !== 'undefined' ? (isPercentageWidth ? '100%' : width) : '100%',\n height: isPercentageHeight\n ? '100%'\n : typeof height !== 'undefined'\n ? height\n : typeof ((_b = divProps.style) === null || _b === void 0 ? void 0 : _b.height) !== 'undefined' || typeof ((_c = divProps.style) === null || _c === void 0 ? void 0 : _c.maxHeight) !== 'undefined'\n ? '100%'\n : defaultPlaceholderHeight,\n border: 'solid 1px #c9d4d9',\n borderRadius,\n };\n const placeholder = embedPlaceholder !== null && embedPlaceholder !== void 0 ? embedPlaceholder : (React.createElement(PlaceholderEmbed_1.PlaceholderEmbed, Object.assign({ url: url, imageUrl: placeholderImageUrl, linkText: linkText, spinner: placeholderSpinner, spinnerDisabled: placeholderSpinnerDisabled }, placeholderProps, { style: Object.assign(Object.assign({}, placeholderStyle), placeholderProps === null || placeholderProps === void 0 ? void 0 : placeholderProps.style) })));\n // === END Placeholder ===\n return (React.createElement(\"div\", Object.assign({}, divProps, { className: (0, classnames_1.default)('rsme-embed rsme-twitter-embed', divProps.className), style: Object.assign({ overflow: 'hidden', width: width !== null && width !== void 0 ? width : undefined, height: height !== null && height !== void 0 ? height : undefined, borderRadius }, divProps.style) }),\n React.createElement(EmbedStyle_1.EmbedStyle, null),\n React.createElement(react_twitter_embed_1.TwitterTweetEmbed, Object.assign({ tweetId: postId, placeholder: placeholderDisabled ? undefined : placeholder }, twitterTweetEmbedProps))));\n};\nexports.XEmbed = XEmbed;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TwitterEmbed = void 0;\nconst XEmbed_1 = require(\"./XEmbed\");\n/**\n * @deprecated Twitter was rebranded to the name X in July 2023. Use `XEmbed` instead.\n */\nexports.TwitterEmbed = XEmbed_1.XEmbed;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nvar Sister;\n\n/**\n* @link https://github.com/gajus/sister for the canonical source repository\n* @license https://github.com/gajus/sister/blob/master/LICENSE BSD 3-Clause\n*/\nSister = function () {\n var sister = {},\n events = {};\n\n /**\n * @name handler\n * @function\n * @param {Object} data Event data.\n */\n\n /**\n * @param {String} name Event name.\n * @param {handler} handler\n * @return {listener}\n */\n sister.on = function (name, handler) {\n var listener = {name: name, handler: handler};\n events[name] = events[name] || [];\n events[name].unshift(listener);\n return listener;\n };\n\n /**\n * @param {listener}\n */\n sister.off = function (listener) {\n var index = events[listener.name].indexOf(listener);\n\n if (index !== -1) {\n events[listener.name].splice(index, 1);\n }\n };\n\n /**\n * @param {String} name Event name.\n * @param {Object} data Event data.\n */\n sister.trigger = function (name, data) {\n var listeners = events[name],\n i;\n\n if (listeners) {\n i = listeners.length;\n while (i--) {\n listeners[i].handler(data);\n }\n }\n };\n\n return sister;\n};\n\nmodule.exports = Sister;\n","\nmodule.exports = function load (src, opts, cb) {\n var head = document.head || document.getElementsByTagName('head')[0]\n var script = document.createElement('script')\n\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n\n opts = opts || {}\n cb = cb || function() {}\n\n script.type = opts.type || 'text/javascript'\n script.charset = opts.charset || 'utf8';\n script.async = 'async' in opts ? !!opts.async : true\n script.src = src\n\n if (opts.attrs) {\n setAttributes(script, opts.attrs)\n }\n\n if (opts.text) {\n script.text = '' + opts.text\n }\n\n var onend = 'onload' in script ? stdOnEnd : ieOnEnd\n onend(script, cb)\n\n // some good legacy browsers (firefox) fail the 'in' detection above\n // so as a fallback we always set onload\n // old IE will ignore this and new IE will set onload\n if (!script.onload) {\n stdOnEnd(script, cb);\n }\n\n head.appendChild(script)\n}\n\nfunction setAttributes(script, attrs) {\n for (var attr in attrs) {\n script.setAttribute(attr, attrs[attr]);\n }\n}\n\nfunction stdOnEnd (script, cb) {\n script.onload = function () {\n this.onerror = this.onload = null\n cb(null, script)\n }\n script.onerror = function () {\n // this.onload = null here is necessary\n // because even IE9 works not like others\n this.onerror = this.onload = null\n cb(new Error('Failed to load ' + this.src), script)\n }\n}\n\nfunction ieOnEnd (script, cb) {\n script.onreadystatechange = function () {\n if (this.readyState != 'complete' && this.readyState != 'loaded') return\n this.onreadystatechange = null\n cb(null, script) // there is no way to catch loading errors in IE8\n }\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _loadScript = require('load-script');\n\nvar _loadScript2 = _interopRequireDefault(_loadScript);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (emitter) {\n /**\n * A promise that is resolved when window.onYouTubeIframeAPIReady is called.\n * The promise is resolved with a reference to window.YT object.\n */\n var iframeAPIReady = new Promise(function (resolve) {\n if (window.YT && window.YT.Player && window.YT.Player instanceof Function) {\n resolve(window.YT);\n\n return;\n } else {\n var protocol = window.location.protocol === 'http:' ? 'http:' : 'https:';\n\n (0, _loadScript2.default)(protocol + '//www.youtube.com/iframe_api', function (error) {\n if (error) {\n emitter.trigger('error', error);\n }\n });\n }\n\n var previous = window.onYouTubeIframeAPIReady;\n\n // The API will call this function when page has finished downloading\n // the JavaScript for the player API.\n window.onYouTubeIframeAPIReady = function () {\n if (previous) {\n previous();\n }\n\n resolve(window.YT);\n };\n });\n\n return iframeAPIReady;\n};\n\nmodule.exports = exports['default'];","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n\n/**\n * @see https://developers.google.com/youtube/iframe_api_reference#Functions\n */\nexports.default = ['cueVideoById', 'loadVideoById', 'cueVideoByUrl', 'loadVideoByUrl', 'playVideo', 'pauseVideo', 'stopVideo', 'getVideoLoadedFraction', 'cuePlaylist', 'loadPlaylist', 'nextVideo', 'previousVideo', 'playVideoAt', 'setShuffle', 'setLoop', 'getPlaylist', 'getPlaylistIndex', 'setOption', 'mute', 'unMute', 'isMuted', 'setVolume', 'getVolume', 'seekTo', 'getPlayerState', 'getPlaybackRate', 'setPlaybackRate', 'getAvailablePlaybackRates', 'getPlaybackQuality', 'setPlaybackQuality', 'getAvailableQualityLevels', 'getCurrentTime', 'getDuration', 'removeEventListener', 'getVideoUrl', 'getVideoEmbedCode', 'getOptions', 'getOption', 'addEventListener', 'destroy', 'setSize', 'getIframe'];\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n\n/**\n * @see https://developers.google.com/youtube/iframe_api_reference#Events\n * `volumeChange` is not officially supported but seems to work\n * it emits an object: `{volume: 82.6923076923077, muted: false}`\n */\nexports.default = ['ready', 'stateChange', 'playbackQualityChange', 'playbackRateChange', 'error', 'apiChange', 'volumeChange'];\nmodule.exports = exports['default'];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = {\n BUFFERING: 3,\n ENDED: 0,\n PAUSED: 2,\n PLAYING: 1,\n UNSTARTED: -1,\n VIDEO_CUED: 5\n};\nmodule.exports = exports[\"default\"];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _PlayerStates = require('./constants/PlayerStates');\n\nvar _PlayerStates2 = _interopRequireDefault(_PlayerStates);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = {\n pauseVideo: {\n acceptableStates: [_PlayerStates2.default.ENDED, _PlayerStates2.default.PAUSED],\n stateChangeRequired: false\n },\n playVideo: {\n acceptableStates: [_PlayerStates2.default.ENDED, _PlayerStates2.default.PLAYING],\n stateChangeRequired: false\n },\n seekTo: {\n acceptableStates: [_PlayerStates2.default.ENDED, _PlayerStates2.default.PLAYING, _PlayerStates2.default.PAUSED],\n stateChangeRequired: true,\n\n // TRICKY: `seekTo` may not cause a state change if no buffering is\n // required.\n timeout: 3000\n }\n};\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _debug = require('debug');\n\nvar _debug2 = _interopRequireDefault(_debug);\n\nvar _functionNames = require('./functionNames');\n\nvar _functionNames2 = _interopRequireDefault(_functionNames);\n\nvar _eventNames = require('./eventNames');\n\nvar _eventNames2 = _interopRequireDefault(_eventNames);\n\nvar _FunctionStateMap = require('./FunctionStateMap');\n\nvar _FunctionStateMap2 = _interopRequireDefault(_FunctionStateMap);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* eslint-disable promise/prefer-await-to-then */\n\nvar debug = (0, _debug2.default)('youtube-player');\n\nvar YouTubePlayer = {};\n\n/**\n * Construct an object that defines an event handler for all of the YouTube\n * player events. Proxy captured events through an event emitter.\n *\n * @todo Capture event parameters.\n * @see https://developers.google.com/youtube/iframe_api_reference#Events\n */\nYouTubePlayer.proxyEvents = function (emitter) {\n var events = {};\n\n var _loop = function _loop(eventName) {\n var onEventName = 'on' + eventName.slice(0, 1).toUpperCase() + eventName.slice(1);\n\n events[onEventName] = function (event) {\n debug('event \"%s\"', onEventName, event);\n\n emitter.trigger(eventName, event);\n };\n };\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = _eventNames2.default[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var eventName = _step.value;\n\n _loop(eventName);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return events;\n};\n\n/**\n * Delays player API method execution until player state is ready.\n *\n * @todo Proxy all of the methods using Object.keys.\n * @todo See TRICKY below.\n * @param playerAPIReady Promise that resolves when player is ready.\n * @param strictState A flag designating whether or not to wait for\n * an acceptable state when calling supported functions.\n * @returns {Object}\n */\nYouTubePlayer.promisifyPlayer = function (playerAPIReady) {\n var strictState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var functions = {};\n\n var _loop2 = function _loop2(functionName) {\n if (strictState && _FunctionStateMap2.default[functionName]) {\n functions[functionName] = function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return playerAPIReady.then(function (player) {\n var stateInfo = _FunctionStateMap2.default[functionName];\n var playerState = player.getPlayerState();\n\n // eslint-disable-next-line no-warning-comments\n // TODO: Just spread the args into the function once Babel is fixed:\n // https://github.com/babel/babel/issues/4270\n //\n // eslint-disable-next-line prefer-spread\n var value = player[functionName].apply(player, args);\n\n // TRICKY: For functions like `seekTo`, a change in state must be\n // triggered given that the resulting state could match the initial\n // state.\n if (stateInfo.stateChangeRequired ||\n\n // eslint-disable-next-line no-extra-parens\n Array.isArray(stateInfo.acceptableStates) && stateInfo.acceptableStates.indexOf(playerState) === -1) {\n return new Promise(function (resolve) {\n var onPlayerStateChange = function onPlayerStateChange() {\n var playerStateAfterChange = player.getPlayerState();\n\n var timeout = void 0;\n\n if (typeof stateInfo.timeout === 'number') {\n timeout = setTimeout(function () {\n player.removeEventListener('onStateChange', onPlayerStateChange);\n\n resolve();\n }, stateInfo.timeout);\n }\n\n if (Array.isArray(stateInfo.acceptableStates) && stateInfo.acceptableStates.indexOf(playerStateAfterChange) !== -1) {\n player.removeEventListener('onStateChange', onPlayerStateChange);\n\n clearTimeout(timeout);\n\n resolve();\n }\n };\n\n player.addEventListener('onStateChange', onPlayerStateChange);\n }).then(function () {\n return value;\n });\n }\n\n return value;\n });\n };\n } else {\n functions[functionName] = function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return playerAPIReady.then(function (player) {\n // eslint-disable-next-line no-warning-comments\n // TODO: Just spread the args into the function once Babel is fixed:\n // https://github.com/babel/babel/issues/4270\n //\n // eslint-disable-next-line prefer-spread\n return player[functionName].apply(player, args);\n });\n };\n }\n };\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = _functionNames2.default[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var functionName = _step2.value;\n\n _loop2(functionName);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return functions;\n};\n\nexports.default = YouTubePlayer;\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _sister = require('sister');\n\nvar _sister2 = _interopRequireDefault(_sister);\n\nvar _loadYouTubeIframeApi = require('./loadYouTubeIframeApi');\n\nvar _loadYouTubeIframeApi2 = _interopRequireDefault(_loadYouTubeIframeApi);\n\nvar _YouTubePlayer = require('./YouTubePlayer');\n\nvar _YouTubePlayer2 = _interopRequireDefault(_YouTubePlayer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @typedef YT.Player\n * @see https://developers.google.com/youtube/iframe_api_reference\n * */\n\n/**\n * @see https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player\n */\nvar youtubeIframeAPI = void 0;\n\n/**\n * A factory function used to produce an instance of YT.Player and queue function calls and proxy events of the resulting object.\n *\n * @param maybeElementId Either An existing YT.Player instance,\n * the DOM element or the id of the HTML element where the API will insert an