for UAs without console object\n // allow force of debug mode via URL\n //
\n if (sm2.debugURLParam.test(wl)) {\n sm2.setupOptions.debugMode = sm2.debugMode = true;\n }\n\n if (id(sm2.debugID)) {\n return;\n }\n\n var oD, oDebug, oTarget, oToggle, tmp;\n\n if (sm2.debugMode && !id(sm2.debugID) && (!hasConsole || !sm2.useConsole || !sm2.consoleOnly)) {\n oD = doc.createElement('div');\n oD.id = sm2.debugID + '-toggle';\n oToggle = {\n position: 'fixed',\n bottom: '0px',\n right: '0px',\n width: '1.2em',\n height: '1.2em',\n lineHeight: '1.2em',\n margin: '2px',\n textAlign: 'center',\n border: '1px solid #999',\n cursor: 'pointer',\n background: '#fff',\n color: '#333',\n zIndex: 10001\n };\n oD.appendChild(doc.createTextNode('-'));\n oD.onclick = toggleDebug;\n oD.title = 'Toggle SM2 debug console';\n\n if (ua.match(/msie 6/i)) {\n oD.style.position = 'absolute';\n oD.style.cursor = 'hand';\n }\n\n for (tmp in oToggle) {\n if (oToggle.hasOwnProperty(tmp)) {\n oD.style[tmp] = oToggle[tmp];\n }\n }\n\n oDebug = doc.createElement('div');\n oDebug.id = sm2.debugID;\n oDebug.style.display = sm2.debugMode ? 'block' : 'none';\n\n if (sm2.debugMode && !id(oD.id)) {\n try {\n oTarget = getDocument();\n oTarget.appendChild(oD);\n } catch (e2) {\n throw new Error(str('domError') + ' \\n' + e2.toString());\n }\n\n oTarget.appendChild(oDebug);\n }\n }\n\n oTarget = null; // \n };\n\n idCheck = this.getSoundById; //
\n\n _wDS = function _wDS(o, errorLevel) {\n return !o ? '' : sm2._wD(str(o), errorLevel);\n };\n\n toggleDebug = function toggleDebug() {\n var o = id(sm2.debugID),\n oT = id(sm2.debugID + '-toggle');\n\n if (!o) {\n return;\n }\n\n if (debugOpen) {\n // minimize\n oT.innerHTML = '+';\n o.style.display = 'none';\n } else {\n oT.innerHTML = '-';\n o.style.display = 'block';\n }\n\n debugOpen = !debugOpen;\n };\n\n debugTS = function debugTS(sEventType, bSuccess, sMessage) {\n // troubleshooter debug hooks\n if (window.sm2Debugger !== _undefined) {\n try {\n sm2Debugger.handleEvent(sEventType, bSuccess, sMessage);\n } catch (e) {\n // oh well\n return false;\n }\n }\n\n return true;\n }; // \n\n\n getSWFCSS = function getSWFCSS() {\n var css = [];\n\n if (sm2.debugMode) {\n css.push(swfCSS.sm2Debug);\n }\n\n if (sm2.debugFlash) {\n css.push(swfCSS.flashDebug);\n }\n\n if (sm2.useHighPerformance) {\n css.push(swfCSS.highPerf);\n }\n\n return css.join(' ');\n };\n\n flashBlockHandler = function flashBlockHandler() {\n // *possible* flash block situation.\n var name = str('fbHandler'),\n p = sm2.getMoviePercent(),\n css = swfCSS,\n error = {\n type: 'FLASHBLOCK'\n };\n\n if (sm2.html5Only) {\n // no flash, or unused\n return;\n }\n\n if (!sm2.ok()) {\n if (needsFlash) {\n // make the movie more visible, so user can fix\n sm2.oMC.className = getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null ? css.swfTimedout : css.swfError);\n\n sm2._wD(name + ': ' + str('fbTimeout') + (p ? ' (' + str('fbLoaded') + ')' : ''));\n }\n\n sm2.didFlashBlock = true; // fire onready(), complain lightly\n\n processOnEvents({\n type: 'ontimeout',\n ignoreInit: true,\n error: error\n });\n catchError(error);\n } else {\n // SM2 loaded OK (or recovered)\n //
\n if (sm2.didFlashBlock) {\n sm2._wD(name + ': Unblocked');\n } // \n\n\n if (sm2.oMC) {\n sm2.oMC.className = [getSWFCSS(), css.swfDefault, css.swfLoaded + (sm2.didFlashBlock ? ' ' + css.swfUnblocked : '')].join(' ');\n }\n }\n };\n\n addOnEvent = function addOnEvent(sType, oMethod, oScope) {\n if (on_queue[sType] === _undefined) {\n on_queue[sType] = [];\n }\n\n on_queue[sType].push({\n method: oMethod,\n scope: oScope || null,\n fired: false\n });\n };\n\n processOnEvents = function processOnEvents(oOptions) {\n // if unspecified, assume OK/error\n if (!oOptions) {\n oOptions = {\n type: sm2.ok() ? 'onready' : 'ontimeout'\n };\n } // not ready yet.\n\n\n if (!didInit && oOptions && !oOptions.ignoreInit) return false; // invalid case\n\n if (oOptions.type === 'ontimeout' && (sm2.ok() || disabled && !oOptions.ignoreInit)) return false;\n var status = {\n success: oOptions && oOptions.ignoreInit ? sm2.ok() : !disabled\n },\n // queue specified by type, or none\n srcQueue = oOptions && oOptions.type ? on_queue[oOptions.type] || [] : [],\n queue = [],\n i,\n j,\n args = [status],\n canRetry = needsFlash && !sm2.ok();\n\n if (oOptions.error) {\n args[0].error = oOptions.error;\n }\n\n for (i = 0, j = srcQueue.length; i < j; i++) {\n if (srcQueue[i].fired !== true) {\n queue.push(srcQueue[i]);\n }\n }\n\n if (queue.length) {\n // sm2._wD(sm + ': Firing ' + queue.length + ' ' + oOptions.type + '() item' + (queue.length === 1 ? '' : 's'));\n for (i = 0, j = queue.length; i < j; i++) {\n if (queue[i].scope) {\n queue[i].method.apply(queue[i].scope, args);\n } else {\n queue[i].method.apply(this, args);\n }\n\n if (!canRetry) {\n // useFlashBlock and SWF timeout case doesn't count here.\n queue[i].fired = true;\n }\n }\n }\n\n return true;\n };\n\n _initUserOnload = function initUserOnload() {\n window.setTimeout(function () {\n if (sm2.useFlashBlock) {\n flashBlockHandler();\n }\n\n processOnEvents(); // call user-defined \"onload\", scoped to window\n\n if (typeof sm2.onload === 'function') {\n _wDS('onload', 1);\n\n sm2.onload.apply(window);\n\n _wDS('onloadOK', 1);\n }\n\n if (sm2.waitForWindowLoad) {\n event.add(window, 'load', _initUserOnload);\n }\n }, 1);\n };\n\n detectFlash = function detectFlash() {\n /**\r\n * Hat tip: Flash Detect library (BSD, (C) 2007) by Carl \"DocYes\" S. Yestrau\r\n * http://featureblend.com/javascript-flash-detection-library.html / http://featureblend.com/license.txt\r\n */\n // this work has already been done.\n if (hasFlash !== _undefined) return hasFlash;\n var hasPlugin = false,\n n = navigator,\n obj,\n type,\n types,\n AX = window.ActiveXObject; // MS Edge 14 throws an \"Unspecified Error\" because n.plugins is inaccessible due to permissions\n\n var nP;\n\n try {\n nP = n.plugins;\n } catch (e) {\n nP = undefined;\n }\n\n if (nP && nP.length) {\n type = 'application/x-shockwave-flash';\n types = n.mimeTypes;\n\n if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) {\n hasPlugin = true;\n }\n } else if (AX !== _undefined && !ua.match(/MSAppHost/i)) {\n // Windows 8 Store Apps (MSAppHost) are weird (compatibility?) and won't complain here, but will barf if Flash/ActiveX object is appended to the DOM.\n try {\n obj = new AX('ShockwaveFlash.ShockwaveFlash');\n } catch (e) {\n // oh well\n obj = null;\n }\n\n hasPlugin = !!obj; // cleanup, because it is ActiveX after all\n\n obj = null;\n }\n\n hasFlash = hasPlugin;\n return hasPlugin;\n };\n\n featureCheck = function featureCheck() {\n var flashNeeded,\n item,\n formats = sm2.audioFormats,\n // iPhone <= 3.1 has broken HTML5 audio(), but firmware 3.2 (original iPad) + iOS4 works.\n isSpecial = is_iDevice && !!ua.match(/os (1|2|3_0|3_1)\\s/i);\n\n if (isSpecial) {\n // has Audio(), but is broken; let it load links directly.\n sm2.hasHTML5 = false; // ignore flash case, however\n\n sm2.html5Only = true; // hide the SWF, if present\n\n if (sm2.oMC) {\n sm2.oMC.style.display = 'none';\n }\n } else if (sm2.useHTML5Audio) {\n if (!sm2.html5 || !sm2.html5.canPlayType) {\n sm2._wD('SoundManager: No HTML5 Audio() support detected.');\n\n sm2.hasHTML5 = false;\n } //
\n\n\n if (isBadSafari) {\n sm2._wD(smc + 'Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - ' + (!hasFlash ? ' would use flash fallback for MP3/MP4, but none detected.' : 'will use flash fallback for MP3/MP4, if available'), 1);\n } // \n\n }\n\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\n // sort out whether flash is optional, required or can be ignored.\n // innocent until proven guilty.\n canIgnoreFlash = true;\n\n for (item in formats) {\n if (formats.hasOwnProperty(item)) {\n if (formats[item].required) {\n if (!sm2.html5.canPlayType(formats[item].type)) {\n // 100% HTML5 mode is not possible.\n canIgnoreFlash = false;\n flashNeeded = true;\n } else if (sm2.preferFlash && (sm2.flash[item] || sm2.flash[formats[item].type])) {\n // flash may be required, or preferred for this format.\n flashNeeded = true;\n }\n }\n }\n }\n } // sanity check...\n\n\n if (sm2.ignoreFlash) {\n flashNeeded = false;\n canIgnoreFlash = true;\n }\n\n sm2.html5Only = sm2.hasHTML5 && sm2.useHTML5Audio && !flashNeeded;\n return !sm2.html5Only;\n };\n\n parseURL = function parseURL(url) {\n /**\r\n * Internal: Finds and returns the first playable URL (or failing that, the first URL.)\r\n * @param {string or array} url A single URL string, OR, an array of URL strings or {url:'/path/to/resource', type:'audio/mp3'} objects.\r\n */\n var i,\n j,\n urlResult = 0,\n result;\n\n if (url instanceof Array) {\n // find the first good one\n for (i = 0, j = url.length; i < j; i++) {\n if (url[i] instanceof Object) {\n // MIME check\n if (sm2.canPlayMIME(url[i].type)) {\n urlResult = i;\n break;\n }\n } else if (sm2.canPlayURL(url[i])) {\n // URL string check\n urlResult = i;\n break;\n }\n } // normalize to string\n\n\n if (url[urlResult].url) {\n url[urlResult] = url[urlResult].url;\n }\n\n result = url[urlResult];\n } else {\n // single URL case\n result = url;\n }\n\n return result;\n };\n\n startTimer = function startTimer(oSound) {\n /**\r\n * attach a timer to this sound, and start an interval if needed\r\n */\n if (!oSound._hasTimer) {\n oSound._hasTimer = true;\n\n if (!mobileHTML5 && sm2.html5PollingInterval) {\n if (h5IntervalTimer === null && h5TimerCount === 0) {\n h5IntervalTimer = setInterval(timerExecute, sm2.html5PollingInterval);\n }\n\n h5TimerCount++;\n }\n }\n };\n\n stopTimer = function stopTimer(oSound) {\n /**\r\n * detach a timer\r\n */\n if (oSound._hasTimer) {\n oSound._hasTimer = false;\n\n if (!mobileHTML5 && sm2.html5PollingInterval) {\n // interval will stop itself at next execution.\n h5TimerCount--;\n }\n }\n };\n\n timerExecute = function timerExecute() {\n /**\r\n * manual polling for HTML5 progress events, ie., whileplaying()\r\n * (can achieve greater precision than conservative default HTML5 interval)\r\n */\n var i;\n\n if (h5IntervalTimer !== null && !h5TimerCount) {\n // no active timers, stop polling interval.\n clearInterval(h5IntervalTimer);\n h5IntervalTimer = null;\n return;\n } // check all HTML5 sounds with timers\n\n\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\n if (sm2.sounds[sm2.soundIDs[i]].isHTML5 && sm2.sounds[sm2.soundIDs[i]]._hasTimer) {\n sm2.sounds[sm2.soundIDs[i]]._onTimer();\n }\n }\n };\n\n catchError = function catchError(options) {\n options = options !== _undefined ? options : {};\n\n if (typeof sm2.onerror === 'function') {\n sm2.onerror.apply(window, [{\n type: options.type !== _undefined ? options.type : null\n }]);\n }\n\n if (options.fatal !== _undefined && options.fatal) {\n sm2.disable();\n }\n };\n\n badSafariFix = function badSafariFix() {\n // special case: \"bad\" Safari (OS X 10.3 - 10.7) must fall back to flash for MP3/MP4\n if (!isBadSafari || !detectFlash()) {\n // doesn't apply\n return;\n }\n\n var aF = sm2.audioFormats,\n i,\n item;\n\n for (item in aF) {\n if (aF.hasOwnProperty(item)) {\n if (item === 'mp3' || item === 'mp4') {\n sm2._wD(sm + ': Using flash fallback for ' + item + ' format');\n\n sm2.html5[item] = false; // assign result to related formats, too\n\n if (aF[item] && aF[item].related) {\n for (i = aF[item].related.length - 1; i >= 0; i--) {\n sm2.html5[aF[item].related[i]] = false;\n }\n }\n }\n }\n }\n };\n /**\r\n * Pseudo-private flash/ExternalInterface methods\r\n * ----------------------------------------------\r\n */\n\n\n this._setSandboxType = function (sandboxType) {\n //
\n // Security sandbox according to Flash plugin\n var sb = sm2.sandbox;\n sb.type = sandboxType;\n sb.description = sb.types[sb.types[sandboxType] !== _undefined ? sandboxType : 'unknown'];\n\n if (sb.type === 'localWithFile') {\n sb.noRemote = true;\n sb.noLocal = false;\n\n _wDS('secNote', 2);\n } else if (sb.type === 'localWithNetwork') {\n sb.noRemote = false;\n sb.noLocal = true;\n } else if (sb.type === 'localTrusted') {\n sb.noRemote = false;\n sb.noLocal = false;\n } // \n\n };\n\n this._externalInterfaceOK = function (swfVersion) {\n // flash callback confirming flash loaded, EI working etc.\n // swfVersion: SWF build string\n if (sm2.swfLoaded) {\n return;\n }\n\n var e;\n debugTS('swf', true);\n debugTS('flashtojs', true);\n sm2.swfLoaded = true;\n tryInitOnFocus = false;\n\n if (isBadSafari) {\n badSafariFix();\n } // complain if JS + SWF build/version strings don't match, excluding +DEV builds\n //
\n\n\n if (!swfVersion || swfVersion.replace(/\\+dev/i, '') !== sm2.versionNumber.replace(/\\+dev/i, '')) {\n e = sm + ': Fatal: JavaScript file build \"' + sm2.versionNumber + '\" does not match Flash SWF build \"' + swfVersion + '\" at ' + sm2.url + '. Ensure both are up-to-date.'; // escape flash -> JS stack so this error fires in window.\n\n setTimeout(function () {\n throw new Error(e);\n }, 0); // exit, init will fail with timeout\n\n return;\n } // \n // IE needs a larger timeout\n\n\n setTimeout(init, isIE ? 100 : 1);\n };\n /**\r\n * Private initialization helpers\r\n * ------------------------------\r\n */\n\n\n createMovie = function createMovie(movieID, movieURL) {\n // ignore if already connected\n if (didAppend && appendSuccess) return false;\n\n function initMsg() {\n //
\n var options = [],\n title,\n msg = [],\n delimiter = ' + ';\n title = 'SoundManager ' + sm2.version + (!sm2.html5Only && sm2.useHTML5Audio ? sm2.hasHTML5 ? ' + HTML5 audio' : ', no HTML5 audio support' : '');\n\n if (!sm2.html5Only) {\n if (sm2.preferFlash) {\n options.push('preferFlash');\n }\n\n if (sm2.useHighPerformance) {\n options.push('useHighPerformance');\n }\n\n if (sm2.flashPollingInterval) {\n options.push('flashPollingInterval (' + sm2.flashPollingInterval + 'ms)');\n }\n\n if (sm2.html5PollingInterval) {\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\n }\n\n if (sm2.wmode) {\n options.push('wmode (' + sm2.wmode + ')');\n }\n\n if (sm2.debugFlash) {\n options.push('debugFlash');\n }\n\n if (sm2.useFlashBlock) {\n options.push('flashBlock');\n }\n } else if (sm2.html5PollingInterval) {\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\n }\n\n if (options.length) {\n msg = msg.concat([options.join(delimiter)]);\n }\n\n sm2._wD(title + (msg.length ? delimiter + msg.join(', ') : ''), 1);\n\n showSupport(); // \n }\n\n if (sm2.html5Only) {\n // 100% HTML5 mode\n setVersionInfo();\n initMsg();\n sm2.oMC = id(sm2.movieID);\n init(); // prevent multiple init attempts\n\n didAppend = true;\n appendSuccess = true;\n return false;\n } // flash path\n\n\n var remoteURL = movieURL || sm2.url,\n localURL = sm2.altURL || remoteURL,\n swfTitle = 'JS/Flash audio component (SoundManager 2)',\n oTarget = getDocument(),\n extraClass = getSWFCSS(),\n isRTL = null,\n html = doc.getElementsByTagName('html')[0],\n oEmbed,\n oMovie,\n tmp,\n movieHTML,\n oEl,\n s,\n x,\n sClass;\n isRTL = html && html.dir && html.dir.match(/rtl/i);\n movieID = movieID === _undefined ? sm2.id : movieID;\n\n function param(name, value) {\n return '
';\n } // safety check for legacy (change to Flash 9 URL)\n\n\n setVersionInfo();\n sm2.url = normalizeMovieURL(overHTTP ? remoteURL : localURL);\n movieURL = sm2.url;\n sm2.wmode = !sm2.wmode && sm2.useHighPerformance ? 'transparent' : sm2.wmode;\n\n if (sm2.wmode !== null && (ua.match(/msie 8/i) || !isIE && !sm2.useHighPerformance) && navigator.platform.match(/win32|win64/i)) {\n /**\r\n * extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here\r\n * does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout\r\n * wmode breaks IE 8 on Vista + Win7 too in some cases, as of January 2011 (?)\r\n */\n messages.push(strings.spcWmode);\n sm2.wmode = null;\n }\n\n oEmbed = {\n name: movieID,\n id: movieID,\n src: movieURL,\n quality: 'high',\n allowScriptAccess: sm2.allowScriptAccess,\n bgcolor: sm2.bgColor,\n pluginspage: http + 'www.macromedia.com/go/getflashplayer',\n title: swfTitle,\n type: 'application/x-shockwave-flash',\n wmode: sm2.wmode,\n // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html\n hasPriority: 'true'\n };\n\n if (sm2.debugFlash) {\n oEmbed.FlashVars = 'debug=1';\n }\n\n if (!sm2.wmode) {\n // don't write empty attribute\n delete oEmbed.wmode;\n }\n\n if (isIE) {\n // IE is \"special\".\n oMovie = doc.createElement('div');\n movieHTML = ['
'].join('');\n } else {\n oMovie = doc.createElement('embed');\n\n for (tmp in oEmbed) {\n if (oEmbed.hasOwnProperty(tmp)) {\n oMovie.setAttribute(tmp, oEmbed[tmp]);\n }\n }\n }\n\n initDebug();\n extraClass = getSWFCSS();\n oTarget = getDocument();\n\n if (oTarget) {\n sm2.oMC = id(sm2.movieID) || doc.createElement('div');\n\n if (!sm2.oMC.id) {\n sm2.oMC.id = sm2.movieID;\n sm2.oMC.className = swfCSS.swfDefault + ' ' + extraClass;\n s = null;\n oEl = null;\n\n if (!sm2.useFlashBlock) {\n if (sm2.useHighPerformance) {\n // on-screen at all times\n s = {\n position: 'fixed',\n width: '8px',\n height: '8px',\n // >= 6px for flash to run fast, >= 8px to start up under Firefox/win32 in some cases. odd? yes.\n bottom: '0px',\n left: '0px',\n overflow: 'hidden'\n };\n } else {\n // hide off-screen, lower priority\n s = {\n position: 'absolute',\n width: '6px',\n height: '6px',\n top: '-9999px',\n left: '-9999px'\n };\n\n if (isRTL) {\n s.left = Math.abs(parseInt(s.left, 10)) + 'px';\n }\n }\n }\n\n if (isWebkit) {\n // soundcloud-reported render/crash fix, safari 5\n sm2.oMC.style.zIndex = 10000;\n }\n\n if (!sm2.debugFlash) {\n for (x in s) {\n if (s.hasOwnProperty(x)) {\n sm2.oMC.style[x] = s[x];\n }\n }\n }\n\n try {\n if (!isIE) {\n sm2.oMC.appendChild(oMovie);\n }\n\n oTarget.appendChild(sm2.oMC);\n\n if (isIE) {\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\n oEl.className = swfCSS.swfBox;\n oEl.innerHTML = movieHTML;\n }\n\n appendSuccess = true;\n } catch (e) {\n throw new Error(str('domError') + ' \\n' + e.toString());\n }\n } else {\n // SM2 container is already in the document (eg. flashblock use case)\n sClass = sm2.oMC.className;\n sm2.oMC.className = (sClass ? sClass + ' ' : swfCSS.swfDefault) + (extraClass ? ' ' + extraClass : '');\n sm2.oMC.appendChild(oMovie);\n\n if (isIE) {\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\n oEl.className = swfCSS.swfBox;\n oEl.innerHTML = movieHTML;\n }\n\n appendSuccess = true;\n }\n }\n\n didAppend = true;\n initMsg(); // sm2._wD(sm + ': Trying to load ' + movieURL + (!overHTTP && sm2.altURL ? ' (alternate URL)' : ''), 1);\n\n return true;\n };\n\n initMovie = function initMovie() {\n if (sm2.html5Only) {\n createMovie();\n return false;\n } // attempt to get, or create, movie (may already exist)\n\n\n if (flash) return false;\n\n if (!sm2.url) {\n /**\r\n * Something isn't right - we've reached init, but the soundManager url property has not been set.\r\n * User has not called setup({url: ...}), or has not set soundManager.url (legacy use case) directly before init time.\r\n * Notify and exit. If user calls setup() with a url: property, init will be restarted as in the deferred loading case.\r\n */\n _wDS('noURL');\n\n return false;\n } // inline markup case\n\n\n flash = sm2.getMovie(sm2.id);\n\n if (!flash) {\n if (!oRemoved) {\n // try to create\n createMovie(sm2.id, sm2.url);\n } else {\n // try to re-append removed movie after reboot()\n if (!isIE) {\n sm2.oMC.appendChild(oRemoved);\n } else {\n sm2.oMC.innerHTML = oRemovedHTML;\n }\n\n oRemoved = null;\n didAppend = true;\n }\n\n flash = sm2.getMovie(sm2.id);\n }\n\n if (typeof sm2.oninitmovie === 'function') {\n setTimeout(sm2.oninitmovie, 1);\n } //
\n\n\n flushMessages(); // \n\n return true;\n };\n\n delayWaitForEI = function delayWaitForEI() {\n setTimeout(waitForEI, 1000);\n };\n\n rebootIntoHTML5 = function rebootIntoHTML5() {\n // special case: try for a reboot with preferFlash: false, if 100% HTML5 mode is possible and useFlashBlock is not enabled.\n window.setTimeout(function () {\n complain(smc + 'useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false...');\n sm2.setup({\n preferFlash: false\n }).reboot(); // if for some reason you want to detect this case, use an ontimeout() callback and look for html5Only and didFlashBlock == true.\n\n sm2.didFlashBlock = true;\n sm2.beginDelayedInit();\n }, 1);\n };\n\n waitForEI = function waitForEI() {\n var p,\n loadIncomplete = false;\n\n if (!sm2.url) {\n // No SWF url to load (noURL case) - exit for now. Will be retried when url is set.\n return;\n }\n\n if (waitingForEI) {\n return;\n }\n\n waitingForEI = true;\n event.remove(window, 'load', delayWaitForEI);\n\n if (hasFlash && tryInitOnFocus && !isFocused) {\n // Safari won't load flash in background tabs, only when focused.\n _wDS('waitFocus');\n\n return;\n }\n\n if (!didInit) {\n p = sm2.getMoviePercent();\n\n if (p > 0 && p < 100) {\n loadIncomplete = true;\n }\n }\n\n setTimeout(function () {\n p = sm2.getMoviePercent();\n\n if (loadIncomplete) {\n // special case: if movie *partially* loaded, retry until it's 100% before assuming failure.\n waitingForEI = false;\n\n sm2._wD(str('waitSWF'));\n\n window.setTimeout(delayWaitForEI, 1);\n return;\n } //
\n\n\n if (!didInit) {\n sm2._wD(sm + ': No Flash response within expected time. Likely causes: ' + (p === 0 ? 'SWF load failed, ' : '') + 'Flash blocked or JS-Flash security error.' + (sm2.debugFlash ? ' ' + str('checkSWF') : ''), 2);\n\n if (!overHTTP && p) {\n _wDS('localFail', 2);\n\n if (!sm2.debugFlash) {\n _wDS('tryDebug', 2);\n }\n }\n\n if (p === 0) {\n // if 0 (not null), probably a 404.\n sm2._wD(str('swf404', sm2.url), 1);\n }\n\n debugTS('flashtojs', false, ': Timed out' + (overHTTP ? ' (Check flash security or flash blockers)' : ' (No plugin/missing SWF?)'));\n } // \n // give up / time-out, depending\n\n\n if (!didInit && okToDisable) {\n if (p === null) {\n // SWF failed to report load progress. Possibly blocked.\n if (sm2.useFlashBlock || sm2.flashLoadTimeout === 0) {\n if (sm2.useFlashBlock) {\n flashBlockHandler();\n }\n\n _wDS('waitForever');\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\n // no custom flash block handling, but SWF has timed out. Will recover if user unblocks / allows SWF load.\n rebootIntoHTML5();\n } else {\n _wDS('waitForever'); // fire any regular registered ontimeout() listeners.\n\n\n processOnEvents({\n type: 'ontimeout',\n ignoreInit: true,\n error: {\n type: 'INIT_FLASHBLOCK'\n }\n });\n }\n } else if (sm2.flashLoadTimeout === 0) {\n // SWF loaded? Shouldn't be a blocking issue, then.\n _wDS('waitForever');\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\n rebootIntoHTML5();\n } else {\n failSafely(true);\n }\n }\n }, sm2.flashLoadTimeout);\n };\n\n _handleFocus = function handleFocus() {\n function cleanup() {\n event.remove(window, 'focus', _handleFocus);\n }\n\n if (isFocused || !tryInitOnFocus) {\n // already focused, or not special Safari background tab case\n cleanup();\n return true;\n }\n\n okToDisable = true;\n isFocused = true;\n\n _wDS('gotFocus'); // allow init to restart\n\n\n waitingForEI = false; // kick off ExternalInterface timeout, now that the SWF has started\n\n delayWaitForEI();\n cleanup();\n return true;\n };\n\n flushMessages = function flushMessages() {\n //
\n // SM2 pre-init debug messages\n if (messages.length) {\n sm2._wD('SoundManager 2: ' + messages.join(' '), 1);\n\n messages = [];\n } // \n\n };\n\n showSupport = function showSupport() {\n //
\n flushMessages();\n var item,\n tests = [];\n\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\n for (item in sm2.audioFormats) {\n if (sm2.audioFormats.hasOwnProperty(item)) {\n tests.push(item + ' = ' + sm2.html5[item] + (!sm2.html5[item] && needsFlash && sm2.flash[item] ? ' (using flash)' : sm2.preferFlash && sm2.flash[item] && needsFlash ? ' (preferring flash)' : !sm2.html5[item] ? ' (' + (sm2.audioFormats[item].required ? 'required, ' : '') + 'and no flash support)' : ''));\n }\n }\n\n sm2._wD('SoundManager 2 HTML5 support: ' + tests.join(', '), 1);\n } // \n\n };\n\n initComplete = function initComplete(bNoDisable) {\n if (didInit) return false;\n\n if (sm2.html5Only) {\n // all good.\n _wDS('sm2Loaded', 1);\n\n didInit = true;\n\n _initUserOnload();\n\n debugTS('onload', true);\n return true;\n }\n\n var wasTimeout = sm2.useFlashBlock && sm2.flashLoadTimeout && !sm2.getMoviePercent(),\n result = true,\n error;\n\n if (!wasTimeout) {\n didInit = true;\n }\n\n error = {\n type: !hasFlash && needsFlash ? 'NO_FLASH' : 'INIT_TIMEOUT'\n };\n\n sm2._wD('SoundManager 2 ' + (disabled ? 'failed to load' : 'loaded') + ' (' + (disabled ? 'Flash security/load error' : 'OK') + ') ' + String.fromCharCode(disabled ? 10006 : 10003), disabled ? 2 : 1);\n\n if (disabled || bNoDisable) {\n if (sm2.useFlashBlock && sm2.oMC) {\n sm2.oMC.className = getSWFCSS() + ' ' + (sm2.getMoviePercent() === null ? swfCSS.swfTimedout : swfCSS.swfError);\n }\n\n processOnEvents({\n type: 'ontimeout',\n error: error,\n ignoreInit: true\n });\n debugTS('onload', false);\n catchError(error);\n result = false;\n } else {\n debugTS('onload', true);\n }\n\n if (!disabled) {\n if (sm2.waitForWindowLoad && !windowLoaded) {\n _wDS('waitOnload');\n\n event.add(window, 'load', _initUserOnload);\n } else {\n //
\n if (sm2.waitForWindowLoad && windowLoaded) {\n _wDS('docLoaded');\n } // \n\n\n _initUserOnload();\n }\n }\n\n return result;\n };\n /**\r\n * apply top-level setupOptions object as local properties, eg., this.setupOptions.flashVersion -> this.flashVersion (soundManager.flashVersion)\r\n * this maintains backward compatibility, and allows properties to be defined separately for use by soundManager.setup().\r\n */\n\n\n setProperties = function setProperties() {\n var i,\n o = sm2.setupOptions;\n\n for (i in o) {\n if (o.hasOwnProperty(i)) {\n // assign local property if not already defined\n if (sm2[i] === _undefined) {\n sm2[i] = o[i];\n } else if (sm2[i] !== o[i]) {\n // legacy support: write manually-assigned property (eg., soundManager.url) back to setupOptions to keep things in sync\n sm2.setupOptions[i] = sm2[i];\n }\n }\n }\n };\n\n init = function init() {\n // called after onload()\n if (didInit) {\n _wDS('didInit');\n\n return false;\n }\n\n function cleanup() {\n event.remove(window, 'load', sm2.beginDelayedInit);\n }\n\n if (sm2.html5Only) {\n if (!didInit) {\n // we don't need no steenking flash!\n cleanup();\n sm2.enabled = true;\n initComplete();\n }\n\n return true;\n } // flash path\n\n\n initMovie();\n\n try {\n // attempt to talk to Flash\n flash._externalInterfaceTest(false);\n /**\r\n * Apply user-specified polling interval, OR, if \"high performance\" set, faster vs. default polling\r\n * (determines frequency of whileloading/whileplaying callbacks, effectively driving UI framerates)\r\n */\n\n\n setPolling(true, sm2.flashPollingInterval || (sm2.useHighPerformance ? 10 : 50));\n\n if (!sm2.debugMode) {\n // stop the SWF from making debug output calls to JS\n flash._disableDebug();\n }\n\n sm2.enabled = true;\n debugTS('jstoflash', true);\n\n if (!sm2.html5Only) {\n // prevent browser from showing cached page state (or rather, restoring \"suspended\" page state) via back button, because flash may be dead\n // http://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/\n event.add(window, 'unload', doNothing);\n }\n } catch (e) {\n sm2._wD('js/flash exception: ' + e.toString());\n\n debugTS('jstoflash', false);\n catchError({\n type: 'JS_TO_FLASH_EXCEPTION',\n fatal: true\n }); // don't disable, for reboot()\n\n failSafely(true);\n initComplete();\n return false;\n }\n\n initComplete(); // disconnect events\n\n cleanup();\n return true;\n };\n\n _domContentLoaded = function domContentLoaded() {\n if (didDCLoaded) return false;\n didDCLoaded = true; // assign top-level soundManager properties eg. soundManager.url\n\n setProperties();\n initDebug();\n\n if (!hasFlash && sm2.hasHTML5) {\n sm2._wD('SoundManager 2: No Flash detected' + (!sm2.useHTML5Audio ? ', enabling HTML5.' : '. Trying HTML5-only mode.'), 1);\n\n sm2.setup({\n useHTML5Audio: true,\n // make sure we aren't preferring flash, either\n // TODO: preferFlash should not matter if flash is not installed. Currently, stuff breaks without the below tweak.\n preferFlash: false\n });\n }\n\n testHTML5();\n\n if (!hasFlash && needsFlash) {\n messages.push(strings.needFlash); // TODO: Fatal here vs. timeout approach, etc.\n // hack: fail sooner.\n\n sm2.setup({\n flashLoadTimeout: 1\n });\n }\n\n if (doc.removeEventListener) {\n doc.removeEventListener('DOMContentLoaded', _domContentLoaded, false);\n }\n\n initMovie();\n return true;\n };\n\n _domContentLoadedIE = function domContentLoadedIE() {\n if (doc.readyState === 'complete') {\n _domContentLoaded();\n\n doc.detachEvent('onreadystatechange', _domContentLoadedIE);\n }\n\n return true;\n };\n\n _winOnLoad = function winOnLoad() {\n // catch edge case of initComplete() firing after window.load()\n windowLoaded = true; // catch case where DOMContentLoaded has been sent, but we're still in doc.readyState = 'interactive'\n\n _domContentLoaded();\n\n event.remove(window, 'load', _winOnLoad);\n }; // sniff up-front\n\n\n detectFlash(); // focus and window load, init (primarily flash-driven)\n\n event.add(window, 'focus', _handleFocus);\n event.add(window, 'load', delayWaitForEI);\n event.add(window, 'load', _winOnLoad);\n\n if (doc.addEventListener) {\n doc.addEventListener('DOMContentLoaded', _domContentLoaded, false);\n } else if (doc.attachEvent) {\n doc.attachEvent('onreadystatechange', _domContentLoadedIE);\n } else {\n // no add/attachevent support - safe to assume no JS -> Flash either\n debugTS('onload', false);\n catchError({\n type: 'NO_DOM2_EVENTS',\n fatal: true\n });\n }\n } // SoundManager()\n // SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading\n\n\n if (window.SM2_DEFER === _undefined || !SM2_DEFER) {\n soundManager = new SoundManager();\n }\n /**\r\n * SoundManager public interfaces\r\n * ------------------------------\r\n */\n\n\n if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module && _typeof(module.exports) === 'object') {\n /**\r\n * commonJS module\r\n */\n module.exports.SoundManager = SoundManager;\n module.exports.soundManager = soundManager;\n } else if (typeof define === 'function' && define.amd) {\n /**\r\n * AMD - requireJS\r\n * basic usage:\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance().setup({\r\n * url: '/swf/',\r\n * onready: function() { ... }\r\n * })\r\n * });\r\n *\r\n * SM2_DEFER usage:\r\n * window.SM2_DEFER = true;\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance(function() {\r\n * var soundManager = new SoundManager.constructor();\r\n * soundManager.setup({\r\n * url: '/swf/',\r\n * ...\r\n * });\r\n * ...\r\n * soundManager.beginDelayedInit();\r\n * return soundManager;\r\n * })\r\n * });\r\n */\n define(function () {\n /**\r\n * Retrieve the global instance of SoundManager.\r\n * If a global instance does not exist it can be created using a callback.\r\n *\r\n * @param {Function} smBuilder Optional: Callback used to create a new SoundManager instance\r\n * @return {SoundManager} The global SoundManager instance\r\n */\n function getInstance(smBuilder) {\n if (!window.soundManager && smBuilder instanceof Function) {\n var instance = smBuilder(SoundManager);\n\n if (instance instanceof SoundManager) {\n window.soundManager = instance;\n }\n }\n\n return window.soundManager;\n }\n\n return {\n constructor: SoundManager,\n getInstance: getInstance\n };\n });\n } // standard browser case\n // constructor\n\n\n window.SoundManager = SoundManager;\n /**\r\n * note: SM2 requires a window global due to Flash, which makes calls to window.soundManager.\r\n * Flash may not always be needed, but this is not known until async init and SM2 may even \"reboot\" into Flash mode.\r\n */\n // public API, flash callbacks etc.\n\n window.soundManager = soundManager;\n})(window);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _objectWithoutProperties2 = require(\"babel-runtime/helpers/objectWithoutProperties\");\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _defineProperty2 = require(\"babel-runtime/helpers/defineProperty\");\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _getPrototypeOf = require(\"babel-runtime/core-js/object/get-prototype-of\");\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require(\"babel-runtime/helpers/classCallCheck\");\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require(\"babel-runtime/helpers/createClass\");\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require(\"babel-runtime/helpers/possibleConstructorReturn\");\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require(\"babel-runtime/helpers/inherits\");\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nexports.default = withGoogleMap;\n\nvar _warning = require(\"warning\");\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _invariant = require(\"invariant\");\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _reactDisplayName = require(\"react-display-name\");\n\nvar _reactDisplayName2 = _interopRequireDefault(_reactDisplayName);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _constants = require(\"./constants\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n/* global google */\n\n\nfunction withGoogleMap(WrappedComponent) {\n var _class, _temp2;\n\n return _temp2 = _class = function (_Component) {\n (0, _inherits3.default)(Container, _Component);\n\n function Container() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Container);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Container.__proto__ || (0, _getPrototypeOf2.default)(Container)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n map: null\n }, _this.handleComponentMount = _this.handleComponentMount.bind(_this), _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Container, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n return (0, _defineProperty3.default)({}, _constants.MAP, this.state.map);\n }\n }, {\n key: \"componentWillMount\",\n value: function componentWillMount() {\n var _props = this.props,\n containerElement = _props.containerElement,\n mapElement = _props.mapElement;\n (0, _invariant2.default)(!!containerElement && !!mapElement, \"Required props containerElement or mapElement is missing. You need to provide both of them.\\n The `google.maps.Map` instance will be initialized on mapElement and it's wrapped by containerElement.\\nYou need to provide both of them since Google Map requires the DOM to have height when initialized.\");\n }\n }, {\n key: \"handleComponentMount\",\n value: function handleComponentMount(node) {\n if (this.state.map || node === null) {\n return;\n }\n\n (0, _warning2.default)(\"undefined\" !== typeof google, \"Make sure you've put a