UNPKG

create-expo-cljs-app

Version:

Create a react native application with Expo and Shadow-CLJS!

1 lines 32.9 kB
["^ ","~:resource-id",["~:shadow.build.classpath/resource","goog/async/nexttick.js"],"~:js","goog.provide(\"goog.async.nextTick\");\ngoog.provide(\"goog.async.throwException\");\ngoog.require(\"goog.debug.entryPointRegistry\");\ngoog.require(\"goog.dom\");\ngoog.require(\"goog.dom.TagName\");\ngoog.require(\"goog.dom.safe\");\ngoog.require(\"goog.functions\");\ngoog.require(\"goog.html.SafeHtml\");\ngoog.require(\"goog.html.TrustedResourceUrl\");\ngoog.require(\"goog.labs.userAgent.browser\");\ngoog.require(\"goog.labs.userAgent.engine\");\ngoog.require(\"goog.string.Const\");\ngoog.async.throwException = function(exception) {\n goog.global.setTimeout(function() {\n throw exception;\n }, 0);\n};\ngoog.async.nextTick = function(callback, opt_context, opt_useSetImmediate) {\n var cb = callback;\n if (opt_context) {\n cb = goog.bind(callback, opt_context);\n }\n cb = goog.async.nextTick.wrapCallback_(cb);\n if (goog.isFunction(goog.global.setImmediate) && (opt_useSetImmediate || goog.async.nextTick.useSetImmediate_())) {\n goog.global.setImmediate(cb);\n return;\n }\n if (!goog.async.nextTick.setImmediate_) {\n goog.async.nextTick.setImmediate_ = goog.async.nextTick.getSetImmediateEmulator_();\n }\n goog.async.nextTick.setImmediate_(cb);\n};\ngoog.async.nextTick.useSetImmediate_ = function() {\n if (!goog.global.Window || !goog.global.Window.prototype) {\n return true;\n }\n if (goog.labs.userAgent.browser.isEdge() || goog.global.Window.prototype.setImmediate != goog.global.setImmediate) {\n return true;\n }\n return false;\n};\ngoog.async.nextTick.setImmediate_;\ngoog.async.nextTick.getSetImmediateEmulator_ = function() {\n var Channel = goog.global[\"MessageChannel\"];\n if (typeof Channel === \"undefined\" && typeof window !== \"undefined\" && window.postMessage && window.addEventListener && !goog.labs.userAgent.engine.isPresto()) {\n Channel = function() {\n var iframe = goog.dom.createElement(goog.dom.TagName.IFRAME);\n iframe.style.display = \"none\";\n goog.dom.safe.setIframeSrc(iframe, goog.html.TrustedResourceUrl.fromConstant(goog.string.Const.EMPTY));\n document.documentElement.appendChild(iframe);\n var win = iframe.contentWindow;\n var doc = win.document;\n doc.open();\n goog.dom.safe.documentWrite(doc, goog.html.SafeHtml.EMPTY);\n doc.close();\n var message = \"callImmediate\" + Math.random();\n var origin = win.location.protocol == \"file:\" ? \"*\" : win.location.protocol + \"//\" + win.location.host;\n var onmessage = goog.bind(function(e) {\n if (origin != \"*\" && e.origin != origin || e.data != message) {\n return;\n }\n this[\"port1\"].onmessage();\n }, this);\n win.addEventListener(\"message\", onmessage, false);\n this[\"port1\"] = {};\n this[\"port2\"] = {postMessage:function() {\n win.postMessage(message, origin);\n }};\n };\n }\n if (typeof Channel !== \"undefined\" && !goog.labs.userAgent.browser.isIE()) {\n var channel = new Channel;\n var head = {};\n var tail = head;\n channel[\"port1\"].onmessage = function() {\n if (head.next !== undefined) {\n head = head.next;\n var cb = head.cb;\n head.cb = null;\n cb();\n }\n };\n return function(cb) {\n tail.next = {cb:cb};\n tail = tail.next;\n channel[\"port2\"].postMessage(0);\n };\n }\n if (typeof document !== \"undefined\" && \"onreadystatechange\" in goog.dom.createElement(goog.dom.TagName.SCRIPT)) {\n return function(cb) {\n var script = goog.dom.createElement(goog.dom.TagName.SCRIPT);\n script.onreadystatechange = function() {\n script.onreadystatechange = null;\n script.parentNode.removeChild(script);\n script = null;\n cb();\n cb = null;\n };\n document.documentElement.appendChild(script);\n };\n }\n return function(cb) {\n goog.global.setTimeout(cb, 0);\n };\n};\ngoog.async.nextTick.wrapCallback_ = goog.functions.identity;\ngoog.debug.entryPointRegistry.register(function(transformer) {\n goog.async.nextTick.wrapCallback_ = transformer;\n});\n","~:source","// Copyright 2013 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Provides a function to schedule running a function as soon\n * as possible after the current JS execution stops and yields to the event\n * loop.\n *\n */\n\ngoog.provide('goog.async.nextTick');\ngoog.provide('goog.async.throwException');\n\ngoog.require('goog.debug.entryPointRegistry');\ngoog.require('goog.dom');\ngoog.require('goog.dom.TagName');\ngoog.require('goog.dom.safe');\ngoog.require('goog.functions');\ngoog.require('goog.html.SafeHtml');\ngoog.require('goog.html.TrustedResourceUrl');\ngoog.require('goog.labs.userAgent.browser');\ngoog.require('goog.labs.userAgent.engine');\ngoog.require('goog.string.Const');\n\n\n/**\n * Throw an item without interrupting the current execution context. For\n * example, if processing a group of items in a loop, sometimes it is useful\n * to report an error while still allowing the rest of the batch to be\n * processed.\n * @param {*} exception\n */\ngoog.async.throwException = function(exception) {\n // Each throw needs to be in its own context.\n goog.global.setTimeout(function() { throw exception; }, 0);\n};\n\n\n/**\n * Fires the provided callbacks as soon as possible after the current JS\n * execution context. setTimeout(…, 0) takes at least 4ms when called from\n * within another setTimeout(…, 0) for legacy reasons.\n *\n * This will not schedule the callback as a microtask (i.e. a task that can\n * preempt user input or networking callbacks). It is meant to emulate what\n * setTimeout(_, 0) would do if it were not throttled. If you desire microtask\n * behavior, use {@see goog.Promise} instead.\n *\n * @param {function(this:SCOPE)} callback Callback function to fire as soon as\n * possible.\n * @param {SCOPE=} opt_context Object in whose scope to call the listener.\n * @param {boolean=} opt_useSetImmediate Avoid the IE workaround that\n * ensures correctness at the cost of speed. See comments for details.\n * @template SCOPE\n */\ngoog.async.nextTick = function(callback, opt_context, opt_useSetImmediate) {\n var cb = callback;\n if (opt_context) {\n cb = goog.bind(callback, opt_context);\n }\n cb = goog.async.nextTick.wrapCallback_(cb);\n // Note we do allow callers to also request setImmediate if they are willing\n // to accept the possible tradeoffs of incorrectness in exchange for speed.\n // The IE fallback of readystate change is much slower. See useSetImmediate_\n // for details.\n if (goog.isFunction(goog.global.setImmediate) &&\n (opt_useSetImmediate || goog.async.nextTick.useSetImmediate_())) {\n goog.global.setImmediate(cb);\n return;\n }\n\n // Look for and cache the custom fallback version of setImmediate.\n if (!goog.async.nextTick.setImmediate_) {\n goog.async.nextTick.setImmediate_ =\n goog.async.nextTick.getSetImmediateEmulator_();\n }\n goog.async.nextTick.setImmediate_(cb);\n};\n\n\n/**\n * Returns whether should use setImmediate implementation currently on window.\n *\n * window.setImmediate was introduced and currently only supported by IE10+,\n * but due to a bug in the implementation it is not guaranteed that\n * setImmediate is faster than setTimeout nor that setImmediate N is before\n * setImmediate N+1. That is why we do not use the native version if\n * available. We do, however, call setImmediate if it is a non-native function\n * because that indicates that it has been replaced by goog.testing.MockClock\n * which we do want to support.\n * See\n * http://connect.microsoft.com/IE/feedback/details/801823/setimmediate-and-messagechannel-are-broken-in-ie10\n *\n * @return {boolean} Whether to use the implementation of setImmediate defined\n * on Window.\n * @private\n * @suppress {missingProperties} For \"Window.prototype.setImmediate\"\n */\ngoog.async.nextTick.useSetImmediate_ = function() {\n // Not a browser environment.\n if (!goog.global.Window || !goog.global.Window.prototype) {\n return true;\n }\n\n // MS Edge has window.setImmediate natively, but it's not on Window.prototype.\n // Also, there's no clean way to detect if the goog.global.setImmediate has\n // been replaced by mockClock as its replacement also shows up as \"[native\n // code]\" when using toString. Therefore, just always use\n // goog.global.setImmediate for Edge. It's unclear if it suffers the same\n // issues as IE10/11, but based on\n // https://dev.modern.ie/testdrive/demos/setimmediatesorting/\n // it seems they've been working to ensure it's WAI.\n if (goog.labs.userAgent.browser.isEdge() ||\n goog.global.Window.prototype.setImmediate != goog.global.setImmediate) {\n // Something redefined setImmediate in which case we decide to use it (This\n // is so that we use the mockClock setImmediate).\n return true;\n }\n\n return false;\n};\n\n\n/**\n * Cache for the setImmediate implementation.\n * @type {function(function())}\n * @private\n */\ngoog.async.nextTick.setImmediate_;\n\n\n/**\n * Determines the best possible implementation to run a function as soon as\n * the JS event loop is idle.\n * @return {function(function())} The \"setImmediate\" implementation.\n * @private\n */\ngoog.async.nextTick.getSetImmediateEmulator_ = function() {\n // Create a private message channel and use it to postMessage empty messages\n // to ourselves.\n /** @type {!Function|undefined} */\n var Channel = goog.global['MessageChannel'];\n // If MessageChannel is not available and we are in a browser, implement\n // an iframe based polyfill in browsers that have postMessage and\n // document.addEventListener. The latter excludes IE8 because it has a\n // synchronous postMessage implementation.\n if (typeof Channel === 'undefined' && typeof window !== 'undefined' &&\n window.postMessage && window.addEventListener &&\n // Presto (The old pre-blink Opera engine) has problems with iframes\n // and contentWindow.\n !goog.labs.userAgent.engine.isPresto()) {\n /** @constructor */\n Channel = function() {\n // Make an empty, invisible iframe.\n var iframe = goog.dom.createElement(goog.dom.TagName.IFRAME);\n iframe.style.display = 'none';\n goog.dom.safe.setIframeSrc(\n iframe,\n goog.html.TrustedResourceUrl.fromConstant(goog.string.Const.EMPTY));\n document.documentElement.appendChild(iframe);\n var win = iframe.contentWindow;\n var doc = win.document;\n doc.open();\n goog.dom.safe.documentWrite(doc, goog.html.SafeHtml.EMPTY);\n doc.close();\n // Do not post anything sensitive over this channel, as the workaround for\n // pages with file: origin could allow that information to be modified or\n // intercepted.\n var message = 'callImmediate' + Math.random();\n // The same origin policy rejects attempts to postMessage from file: urls\n // unless the origin is '*'.\n var origin = win.location.protocol == 'file:' ?\n '*' :\n win.location.protocol + '//' + win.location.host;\n var onmessage = goog.bind(function(e) {\n // Validate origin and message to make sure that this message was\n // intended for us. If the origin is set to '*' (see above) only the\n // message needs to match since, for example, '*' != 'file://'. Allowing\n // the wildcard is ok, as we are not concerned with security here.\n if ((origin != '*' && e.origin != origin) || e.data != message) {\n return;\n }\n this['port1'].onmessage();\n }, this);\n win.addEventListener('message', onmessage, false);\n this['port1'] = {};\n this['port2'] = {\n postMessage: function() { win.postMessage(message, origin); }\n };\n };\n }\n if (typeof Channel !== 'undefined' && !goog.labs.userAgent.browser.isIE()) {\n // Exclude all of IE due to\n // http://codeforhire.com/2013/09/21/setimmediate-and-messagechannel-broken-on-internet-explorer-10/\n // which allows starving postMessage with a busy setTimeout loop.\n // This currently affects IE10 and IE11 which would otherwise be able\n // to use the postMessage based fallbacks.\n var channel = new Channel();\n // Use a fifo linked list to call callbacks in the right order.\n var head = {};\n var tail = head;\n channel['port1'].onmessage = function() {\n if (head.next !== undefined) {\n head = head.next;\n var cb = head.cb;\n head.cb = null;\n cb();\n }\n };\n return function(cb) {\n tail.next = {cb: cb};\n tail = tail.next;\n channel['port2'].postMessage(0);\n };\n }\n // Implementation for IE6 to IE10: Script elements fire an asynchronous\n // onreadystatechange event when inserted into the DOM.\n if (typeof document !== 'undefined' &&\n 'onreadystatechange' in goog.dom.createElement(goog.dom.TagName.SCRIPT)) {\n return function(cb) {\n var script = goog.dom.createElement(goog.dom.TagName.SCRIPT);\n script.onreadystatechange = function() {\n // Clean up and call the callback.\n script.onreadystatechange = null;\n script.parentNode.removeChild(script);\n script = null;\n cb();\n cb = null;\n };\n document.documentElement.appendChild(script);\n };\n }\n // Fall back to setTimeout with 0. In browsers this creates a delay of 5ms\n // or more.\n // NOTE(user): This fallback is used for IE11.\n return function(cb) {\n goog.global.setTimeout(/** @type {function()} */ (cb), 0);\n };\n};\n\n\n/**\n * Helper function that is overrided to protect callbacks with entry point\n * monitor if the application monitors entry points.\n * @param {function()} callback Callback function to fire as soon as possible.\n * @return {function()} The wrapped callback.\n * @private\n */\ngoog.async.nextTick.wrapCallback_ = goog.functions.identity;\n\n\n// Register the callback function as an entry point, so that it can be\n// monitored for exception handling, etc. This has to be done in this file\n// since it requires special code to handle all browsers.\ngoog.debug.entryPointRegistry.register(\n /**\n * @param {function(!Function): !Function} transformer The transforming\n * function.\n */\n function(transformer) { goog.async.nextTick.wrapCallback_ = transformer; });\n","~:compiled-at",1613924115855,"~:source-map-json","{\n\"version\":3,\n\"file\":\"goog.async.nexttick.js\",\n\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,GAA5B,CAAgCE,OAAhC,CAAwCsC,MAAxC,CAD5B;AAEE,WAAO,QAAQ,CAAC/D,EAAD,CAAK;AAClB,UAAIgE,SAAS9E,IAAA,CAAKqC,GAAL,CAASC,aAAT,CAAuBtC,IAAvB,CAA4BqC,GAA5B,CAAgCE,OAAhC,CAAwCsC,MAAxC,CAAb;AACAC,YAAA,CAAOC,kBAAP,GAA4BC,QAAQ,EAAG;AAErCF,cAAA,CAAOC,kBAAP,GAA4B,IAA5B;AACAD,cAAA,CAAOG,UAAP,CAAkBC,WAAlB,CAA8BJ,MAA9B,CAAA;AACAA,cAAA,GAAS,IAAT;AACAhE,UAAA,EAAA;AACAA,UAAA,GAAK,IAAL;AANqC,OAAvC;AAQAqC,cAAA,CAASC,eAAT,CAAyBC,WAAzB,CAAqCyB,MAArC,CAAA;AAVkB,KAApB;AAFF;AAkBA,SAAO,QAAQ,CAAChE,EAAD,CAAK;AAClBd,QAAA,CAAKO,MAAL,CAAYC,UAAZ,CAAkDM,EAAlD,EAAuD,CAAvD,CAAA;AADkB,GAApB;AAlGwD,CAA1D;AA+GAd,IAAA,CAAKG,KAAL,CAAWM,QAAX,CAAoBO,aAApB,GAAoChB,IAApC,CAAyCmF,SAAzC,CAAmDC,QAAnD;AAMApF,IAAA,CAAKqF,KAAL,CAAWC,kBAAX,CAA8BC,QAA9B,CAKI,QAAQ,CAACC,WAAD,CAAc;AAAExF,MAAA,CAAKG,KAAL,CAAWM,QAAX,CAAoBO,aAApB,GAAoCwE,WAApC;AAAF,CAL1B,CAAA;;\",\n\"sources\":[\"goog/async/nexttick.js\"],\n\"sourcesContent\":[\"// Copyright 2013 The Closure Library Authors. All Rights Reserved.\\n//\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n// you may not use this file except in compliance with the License.\\n// You may obtain a copy of the License at\\n//\\n// http://www.apache.org/licenses/LICENSE-2.0\\n//\\n// Unless required by applicable law or agreed to in writing, software\\n// distributed under the License is distributed on an \\\"AS-IS\\\" BASIS,\\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n// See the License for the specific language governing permissions and\\n// limitations under the License.\\n\\n/**\\n * @fileoverview Provides a function to schedule running a function as soon\\n * as possible after the current JS execution stops and yields to the event\\n * loop.\\n *\\n */\\n\\ngoog.provide('goog.async.nextTick');\\ngoog.provide('goog.async.throwException');\\n\\ngoog.require('goog.debug.entryPointRegistry');\\ngoog.require('goog.dom');\\ngoog.require('goog.dom.TagName');\\ngoog.require('goog.dom.safe');\\ngoog.require('goog.functions');\\ngoog.require('goog.html.SafeHtml');\\ngoog.require('goog.html.TrustedResourceUrl');\\ngoog.require('goog.labs.userAgent.browser');\\ngoog.require('goog.labs.userAgent.engine');\\ngoog.require('goog.string.Const');\\n\\n\\n/**\\n * Throw an item without interrupting the current execution context. For\\n * example, if processing a group of items in a loop, sometimes it is useful\\n * to report an error while still allowing the rest of the batch to be\\n * processed.\\n * @param {*} exception\\n */\\ngoog.async.throwException = function(exception) {\\n // Each throw needs to be in its own context.\\n goog.global.setTimeout(function() { throw exception; }, 0);\\n};\\n\\n\\n/**\\n * Fires the provided callbacks as soon as possible after the current JS\\n * execution context. setTimeout(\\u2026, 0) takes at least 4ms when called from\\n * within another setTimeout(\\u2026, 0) for legacy reasons.\\n *\\n * This will not schedule the callback as a microtask (i.e. a task that can\\n * preempt user input or networking callbacks). It is meant to emulate what\\n * setTimeout(_, 0) would do if it were not throttled. If you desire microtask\\n * behavior, use {@see goog.Promise} instead.\\n *\\n * @param {function(this:SCOPE)} callback Callback function to fire as soon as\\n * possible.\\n * @param {SCOPE=} opt_context Object in whose scope to call the listener.\\n * @param {boolean=} opt_useSetImmediate Avoid the IE workaround that\\n * ensures correctness at the cost of speed. See comments for details.\\n * @template SCOPE\\n */\\ngoog.async.nextTick = function(callback, opt_context, opt_useSetImmediate) {\\n var cb = callback;\\n if (opt_context) {\\n cb = goog.bind(callback, opt_context);\\n }\\n cb = goog.async.nextTick.wrapCallback_(cb);\\n // Note we do allow callers to also request setImmediate if they are willing\\n // to accept the possible tradeoffs of incorrectness in exchange for speed.\\n // The IE fallback of readystate change is much slower. See useSetImmediate_\\n // for details.\\n if (goog.isFunction(goog.global.setImmediate) &&\\n (opt_useSetImmediate || goog.async.nextTick.useSetImmediate_())) {\\n goog.global.setImmediate(cb);\\n return;\\n }\\n\\n // Look for and cache the custom fallback version of setImmediate.\\n if (!goog.async.nextTick.setImmediate_) {\\n goog.async.nextTick.setImmediate_ =\\n goog.async.nextTick.getSetImmediateEmulator_();\\n }\\n goog.async.nextTick.setImmediate_(cb);\\n};\\n\\n\\n/**\\n * Returns whether should use setImmediate implementation currently on window.\\n *\\n * window.setImmediate was introduced and currently only supported by IE10+,\\n * but due to a bug in the implementation it is not guaranteed that\\n * setImmediate is faster than setTimeout nor that setImmediate N is before\\n * setImmediate N+1. That is why we do not use the native version if\\n * available. We do, however, call setImmediate if it is a non-native function\\n * because that indicates that it has been replaced by goog.testing.MockClock\\n * which we do want to support.\\n * See\\n * http://connect.microsoft.com/IE/feedback/details/801823/setimmediate-and-messagechannel-are-broken-in-ie10\\n *\\n * @return {boolean} Whether to use the implementation of setImmediate defined\\n * on Window.\\n * @private\\n * @suppress {missingProperties} For \\\"Window.prototype.setImmediate\\\"\\n */\\ngoog.async.nextTick.useSetImmediate_ = function() {\\n // Not a browser environment.\\n if (!goog.global.Window || !goog.global.Window.prototype) {\\n return true;\\n }\\n\\n // MS Edge has window.setImmediate natively, but it's not on Window.prototype.\\n // Also, there's no clean way to detect if the goog.global.setImmediate has\\n // been replaced by mockClock as its replacement also shows up as \\\"[native\\n // code]\\\" when using toString. Therefore, just always use\\n // goog.global.setImmediate for Edge. It's unclear if it suffers the same\\n // issues as IE10/11, but based on\\n // https://dev.modern.ie/testdrive/demos/setimmediatesorting/\\n // it seems they've been working to ensure it's WAI.\\n if (goog.labs.userAgent.browser.isEdge() ||\\n goog.global.Window.prototype.setImmediate != goog.global.setImmediate) {\\n // Something redefined setImmediate in which case we decide to use it (This\\n // is so that we use the mockClock setImmediate).\\n return true;\\n }\\n\\n return false;\\n};\\n\\n\\n/**\\n * Cache for the setImmediate implementation.\\n * @type {function(function())}\\n * @private\\n */\\ngoog.async.nextTick.setImmediate_;\\n\\n\\n/**\\n * Determines the best possible implementation to run a function as soon as\\n * the JS event loop is idle.\\n * @return {function(function())} The \\\"setImmediate\\\" implementation.\\n * @private\\n */\\ngoog.async.nextTick.getSetImmediateEmulator_ = function() {\\n // Create a private message channel and use it to postMessage empty messages\\n // to ourselves.\\n /** @type {!Function|undefined} */\\n var Channel = goog.global['MessageChannel'];\\n // If MessageChannel is not available and we are in a browser, implement\\n // an iframe based polyfill in browsers that have postMessage and\\n // document.addEventListener. The latter excludes IE8 because it has a\\n // synchronous postMessage implementation.\\n if (typeof Channel === 'undefined' && typeof window !== 'undefined' &&\\n window.postMessage && window.addEventListener &&\\n // Presto (The old pre-blink Opera engine) has problems with iframes\\n // and contentWindow.\\n !goog.labs.userAgent.engine.isPresto()) {\\n /** @constructor */\\n Channel = function() {\\n // Make an empty, invisible iframe.\\n var iframe = goog.dom.createElement(goog.dom.TagName.IFRAME);\\n iframe.style.display = 'none';\\n goog.dom.safe.setIframeSrc(\\n iframe,\\n goog.html.TrustedResourceUrl.fromConstant(goog.string.Const.EMPTY));\\n document.documentElement.appendChild(iframe);\\n var win = iframe.contentWindow;\\n var doc = win.document;\\n doc.open();\\n goog.dom.safe.documentWrite(doc, goog.html.SafeHtml.EMPTY);\\n doc.close();\\n // Do not post anything sensitive over this channel, as the workaround for\\n // pages with file: origin could allow that information to be modified or\\n // intercepted.\\n var message = 'callImmediate' + Math.random();\\n // The same origin policy rejects attempts to postMessage from file: urls\\n // unless the origin is '*'.\\n var origin = win.location.protocol == 'file:' ?\\n '*' :\\n win.location.protocol + '//' + win.location.host;\\n var onmessage = goog.bind(function(e) {\\n // Validate origin and message to make sure that this message was\\n // intended for us. If the origin is set to '*' (see above) only the\\n // message needs to match since, for example, '*' != 'file://'. Allowing\\n // the wildcard is ok, as we are not concerned with security here.\\n if ((origin != '*' && e.origin != origin) || e.data != message) {\\n return;\\n }\\n this['port1'].onmessage();\\n }, this);\\n win.addEventListener('message', onmessage, false);\\n this['port1'] = {};\\n this['port2'] = {\\n postMessage: function() { win.postMessage(message, origin); }\\n };\\n };\\n }\\n if (typeof Channel !== 'undefined' && !goog.labs.userAgent.browser.isIE()) {\\n // Exclude all of IE due to\\n // http://codeforhire.com/2013/09/21/setimmediate-and-messagechannel-broken-on-internet-explorer-10/\\n // which allows starving postMessage with a busy setTimeout loop.\\n // This currently affects IE10 and IE11 which would otherwise be able\\n // to use the postMessage based fallbacks.\\n var channel = new Channel();\\n // Use a fifo linked list to call callbacks in the right order.\\n var head = {};\\n var tail = head;\\n channel['port1'].onmessage = function() {\\n if (head.next !== undefined) {\\n head = head.next;\\n var cb = head.cb;\\n head.cb = null;\\n cb();\\n }\\n };\\n return function(cb) {\\n tail.next = {cb: cb};\\n tail = tail.next;\\n channel['port2'].postMessage(0);\\n };\\n }\\n // Implementation for IE6 to IE10: Script elements fire an asynchronous\\n // onreadystatechange event when inserted into the DOM.\\n if (typeof document !== 'undefined' &&\\n 'onreadystatechange' in goog.dom.createElement(goog.dom.TagName.SCRIPT)) {\\n return function(cb) {\\n var script = goog.dom.createElement(goog.dom.TagName.SCRIPT);\\n script.onreadystatechange = function() {\\n // Clean up and call the callback.\\n script.onreadystatechange = null;\\n script.parentNode.removeChild(script);\\n script = null;\\n cb();\\n cb = null;\\n };\\n document.documentElement.appendChild(script);\\n };\\n }\\n // Fall back to setTimeout with 0. In browsers this creates a delay of 5ms\\n // or more.\\n // NOTE(user): This fallback is used for IE11.\\n return function(cb) {\\n goog.global.setTimeout(/** @type {function()} */ (cb), 0);\\n };\\n};\\n\\n\\n/**\\n * Helper function that is overrided to protect callbacks with entry point\\n * monitor if the application monitors entry points.\\n * @param {function()} callback Callback function to fire as soon as possible.\\n * @return {function()} The wrapped callback.\\n * @private\\n */\\ngoog.async.nextTick.wrapCallback_ = goog.functions.identity;\\n\\n\\n// Register the callback function as an entry point, so that it can be\\n// monitored for exception handling, etc. This has to be done in this file\\n// since it requires special code to handle all browsers.\\ngoog.debug.entryPointRegistry.register(\\n /**\\n * @param {function(!Function): !Function} transformer The transforming\\n * function.\\n */\\n function(transformer) { goog.async.nextTick.wrapCallback_ = transformer; });\\n\"],\n\"names\":[\"goog\",\"provide\",\"require\",\"async\",\"throwException\",\"goog.async.throwException\",\"exception\",\"global\",\"setTimeout\",\"nextTick\",\"goog.async.nextTick\",\"callback\",\"opt_context\",\"opt_useSetImmediate\",\"cb\",\"bind\",\"wrapCallback_\",\"isFunction\",\"setImmediate\",\"useSetImmediate_\",\"setImmediate_\",\"getSetImmediateEmulator_\",\"goog.async.nextTick.useSetImmediate_\",\"Window\",\"prototype\",\"labs\",\"userAgent\",\"browser\",\"isEdge\",\"goog.async.nextTick.getSetImmediateEmulator_\",\"Channel\",\"window\",\"postMessage\",\"addEventListener\",\"engine\",\"isPresto\",\"iframe\",\"dom\",\"createElement\",\"TagName\",\"IFRAME\",\"style\",\"display\",\"safe\",\"setIframeSrc\",\"html\",\"TrustedResourceUrl\",\"fromConstant\",\"string\",\"Const\",\"EMPTY\",\"document\",\"documentElement\",\"appendChild\",\"win\",\"contentWindow\",\"doc\",\"open\",\"documentWrite\",\"SafeHtml\",\"close\",\"message\",\"Math\",\"random\",\"origin\",\"location\",\"protocol\",\"host\",\"onmessage\",\"e\",\"data\",\"isIE\",\"channel\",\"head\",\"tail\",\"next\",\"undefined\",\"SCRIPT\",\"script\",\"onreadystatechange\",\"script.onreadystatechange\",\"parentNode\",\"removeChild\",\"functions\",\"identity\",\"debug\",\"entryPointRegistry\",\"register\",\"transformer\"]\n}\n"]