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6L,cAAgBT,G","sources":["webpack:///../node_modules/@greenova/jschannel/src/jschannel.js","webpack:///../node_modules/@greenova/smartoverlay/dist/overlayContentScript.js","webpack:///webpack/bootstrap","webpack:///./SmartLightbox/overlayContentScript.ts"],"sourcesContent":["/*\r\n * js_channel is a very lightweight abstraction on top of\r\n * postMessage which defines message formats and semantics\r\n * to support interactions more rich than just message passing\r\n * js_channel supports:\r\n * + query/response - traditional rpc\r\n * + query/update/response - incremental async return of results\r\n * to a query\r\n * + notifications - fire and forget\r\n * + error handling\r\n *\r\n * js_channel is based heavily on json-rpc, but is focused at the\r\n * problem of inter-iframe RPC.\r\n *\r\n * Message types:\r\n * There are 5 types of messages that can flow over this channel,\r\n * and you may determine what type of message an object is by\r\n * examining its parameters:\r\n * 1. Requests\r\n * + integer id\r\n * + string method\r\n * + (optional) any params\r\n * 2. Callback Invocations (or just \"Callbacks\")\r\n * + integer id\r\n * + string callback\r\n * + (optional) params\r\n * 3. Error Responses (or just \"Errors)\r\n * + integer id\r\n * + string error\r\n * + (optional) string message\r\n * 4. Responses\r\n * + integer id\r\n * + (optional) any result\r\n * 5. Notifications\r\n * + string method\r\n * + (optional) any params\r\n */\r\n\r\n// Universal module definition //\r\n(function (root, factory) {\r\n if (typeof exports === 'object') {\r\n // CommonJS\r\n module.exports = factory();\r\n } else if (typeof define === 'function' && define.amd) {\r\n // AMD\r\n define([], function () {\r\n return (root.Channel = factory());\r\n });\r\n } else {\r\n // Global Variables\r\n root.Channel = factory();\r\n }\r\n}(this, function () {\r\n \"use strict\";\r\n var Channel = (function () {\r\n\r\n // current transaction id, start out at a random *odd* number between 1 and a million\r\n // There is one current transaction counter id per page, and it's shared between\r\n // channel instances. That means of all messages posted from a single javascript\r\n // evaluation context, we'll never have two with the same id.\r\n var s_curTranId = Math.floor(Math.random() * 1000001);\r\n\r\n // no two bound channels in the same javascript evaluation context may have the same origin, scope, and window.\r\n // further if two bound channels have the same window and scope, they may not have *overlapping* origins\r\n // (either one or both support '*'). This restriction allows a single onMessage handler to efficiently\r\n // route messages based on origin and scope. The s_boundChans maps origins to scopes, to message\r\n // handlers. Request and Notification messages are routed using this table.\r\n // Finally, channels are inserted into this table when built, and removed when destroyed.\r\n var s_boundChans = {};\r\n\r\n // add a channel to s_boundChans, throwing if a dup exists\r\n function s_addBoundChan(win, origin, scope, handler) {\r\n function hasWin(arr) {\r\n for (var i = 0; i < arr.length; i++) if (arr[i].win === win) return true;\r\n return false;\r\n }\r\n\r\n // does she exist?\r\n var exists = false;\r\n\r\n if (origin === '*') {\r\n // we must check all other origins, sadly.\r\n for (var k in s_boundChans) {\r\n if (!s_boundChans.hasOwnProperty(k)) continue;\r\n if (k === '*') continue;\r\n if (typeof s_boundChans[k][scope] === 'object') {\r\n exists = hasWin(s_boundChans[k][scope]);\r\n if (exists) break;\r\n }\r\n }\r\n } else {\r\n // we must check only '*'\r\n if ((s_boundChans['*'] && s_boundChans['*'][scope])) {\r\n exists = hasWin(s_boundChans['*'][scope]);\r\n }\r\n if (!exists && s_boundChans[origin] && s_boundChans[origin][scope]) {\r\n exists = hasWin(s_boundChans[origin][scope]);\r\n }\r\n }\r\n if (exists) throw \"A channel is already bound to the same window which overlaps with origin '\" + origin + \"' and has scope '\" + scope + \"'\";\r\n\r\n if (typeof s_boundChans[origin] != 'object') s_boundChans[origin] = {};\r\n if (typeof s_boundChans[origin][scope] != 'object') s_boundChans[origin][scope] = [];\r\n s_boundChans[origin][scope].push({ win: win, handler: handler });\r\n }\r\n\r\n function s_removeBoundChan(win, origin, scope) {\r\n var arr = s_boundChans[origin][scope];\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i].win === win) {\r\n arr.splice(i, 1);\r\n }\r\n }\r\n if (s_boundChans[origin][scope].length === 0) {\r\n delete s_boundChans[origin][scope];\r\n }\r\n }\r\n\r\n function s_isArray(obj) {\r\n if (Array.isArray) return Array.isArray(obj);\r\n else {\r\n return (obj.constructor.toString().indexOf(\"Array\") != -1);\r\n }\r\n }\r\n\r\n // No two outstanding outbound messages may have the same id, period. Given that, a single table\r\n // mapping \"transaction ids\" to message handlers, allows efficient routing of Callback, Error, and\r\n // Response messages. Entries are added to this table when requests are sent, and removed when\r\n // responses are received.\r\n var s_transIds = {};\r\n\r\n // class singleton onMessage handler\r\n // this function is registered once and all incoming messages route through here. This\r\n // arrangement allows certain efficiencies, message data is only parsed once and dispatch\r\n // is more efficient, especially for large numbers of simultaneous channels.\r\n var s_onMessage = function (e) {\r\n try {\r\n var m = JSON.parse(e.data);\r\n if (typeof m !== 'object' || m === null) throw \"malformed\";\r\n } catch (e) {\r\n // just ignore any posted messages that do not consist of valid JSON\r\n return;\r\n }\r\n\r\n var w = e.source;\r\n var o = e.origin;\r\n var s, i, meth;\r\n\r\n if (typeof m.method === 'string') {\r\n var ar = m.method.split('::');\r\n if (ar.length == 2) {\r\n s = ar[0];\r\n meth = ar[1];\r\n } else {\r\n meth = m.method;\r\n }\r\n }\r\n\r\n if (typeof m.id !== 'undefined') i = m.id;\r\n\r\n // w is message source window\r\n // o is message origin\r\n // m is parsed message\r\n // s is message scope\r\n // i is message id (or undefined)\r\n // meth is unscoped method name\r\n // ^^ based on these factors we can route the message\r\n\r\n // if it has a method it's either a notification or a request,\r\n // route using s_boundChans\r\n if (typeof meth === 'string') {\r\n var delivered = false;\r\n if (s_boundChans[o] && s_boundChans[o][s]) {\r\n for (var j = 0; j < s_boundChans[o][s].length; j++) {\r\n try{\r\n if (s_boundChans[o][s][j].win === w) {\r\n s_boundChans[o][s][j].handler(o, meth, m);\r\n delivered = true;\r\n break;\r\n }\r\n }\r\n catch (e) { debugger;}\r\n }\r\n }\r\n\r\n if (!delivered && s_boundChans['*'] && s_boundChans['*'][s]) {\r\n for (var j = 0; j < s_boundChans['*'][s].length; j++) {\r\n try {\r\n if (s_boundChans['*'][s][j].win === w) {\r\n s_boundChans['*'][s][j].handler(o, meth, m);\r\n break;\r\n }\r\n }\r\n catch (e) { debugger; }\r\n }\r\n }\r\n }\r\n // otherwise it must have an id (or be poorly formed\r\n else if (typeof i != 'undefined') {\r\n if (s_transIds[i]) s_transIds[i](o, meth, m);\r\n }\r\n };\r\n\r\n // Setup postMessage event listeners\r\n if (window.addEventListener) window.addEventListener('message', s_onMessage, false);\r\n else if (window.attachEvent) window.attachEvent('onmessage', s_onMessage);\r\n\r\n /* a messaging channel is constructed from a window and an origin.\r\n * the channel will assert that all messages received over the\r\n * channel match the origin\r\n *\r\n * Arguments to Channel.build(cfg):\r\n *\r\n * cfg.window - the remote window with which we'll communicate\r\n * cfg.origin - the expected origin of the remote window, may be '*'\r\n * which matches any origin\r\n * cfg.scope - the 'scope' of messages. a scope string that is\r\n * prepended to message names. local and remote endpoints\r\n * of a single channel must agree upon scope. Scope may\r\n * not contain double colons ('::').\r\n * cfg.debugOutput - A boolean value. If true and window.console.log is\r\n * a function, then debug strings will be emitted to that\r\n * function.\r\n * cfg.postMessageObserver - A function that will be passed two arguments,\r\n * an origin and a message. It will be passed these immediately\r\n * before messages are posted.\r\n * cfg.gotMessageObserver - A function that will be passed two arguments,\r\n * an origin and a message. It will be passed these arguments\r\n * immediately after they pass scope and origin checks, but before\r\n * they are processed.\r\n * cfg.onReady - A function that will be invoked when a channel becomes \"ready\",\r\n * this occurs once both sides of the channel have been\r\n * instantiated and an application level handshake is exchanged.\r\n * the onReady function will be passed a single argument which is\r\n * the channel object that was returned from build().\r\n * cfg.reconnect - A boolean value - if true, the channel allows reconnection\r\n * useful when the page in a child frame is reloaded and wants\r\n * to re-establish connection with parent window using the same\r\n * origin, scope and bindings.\r\n * cfg.publish - A boolean value. If true, bind will automatically publish\r\n * the method on the remote side. The method will be published under\r\n * channelObject.remote, but it will not be available before the onReady\r\n * callback is called on the other side.\r\n * cfg.remote - An array of method names for which stubs should be generated without\r\n * waiting for remote end to publish them. A string (for a single method name)\r\n * is also accepted. This allows methods under channelObject.remote to be called\r\n * also before onReady callback is called; the invocations will be queued until\r\n * the channel is ready. If the methods do not exist on remote side, the\r\n * error callback will be called.\r\n */\r\n return {\r\n build: function (cfg) {\r\n var debug = function (m) {\r\n if (cfg.debugOutput && window.console && window.console.log) {\r\n // try to stringify, if it doesn't work we'll let javascript's built in toString do its magic\r\n try {\r\n if (typeof m !== 'string') {\r\n m = JSON.stringify(m);\r\n }\r\n }\r\n catch (e) {\r\n }\r\n window.console.log(\"[\" + chanId + \"] \" + m);\r\n }\r\n };\r\n\r\n /* browser capabilities check */\r\n if (!window.postMessage) throw (\"jschannel cannot run this browser, no postMessage\");\r\n if (!window.JSON || !window.JSON.stringify || !window.JSON.parse) {\r\n throw (\"jschannel cannot run this browser, no JSON parsing/serialization\");\r\n }\r\n\r\n /* basic argument validation */\r\n if (typeof cfg != 'object') throw (\"Channel build invoked without a proper object argument\");\r\n\r\n if (!cfg.window || !cfg.window.postMessage) throw (\"Channel.build() called without a valid window argument\");\r\n\r\n /* we'd have to do a little more work to be able to run multiple channels that intercommunicate the same\r\n * window... Not sure if we care to support that */\r\n if (window === cfg.window) throw (\"target window is same as present window -- not allowed\");\r\n\r\n // let's require that the client specify an origin. if we just assume '*' we'll be\r\n // propagating unsafe practices. that would be lame.\r\n var validOrigin = false;\r\n if (typeof cfg.origin === 'string') {\r\n var oMatch;\r\n if (cfg.origin === \"*\") validOrigin = true;\r\n // allow valid domains under http and https. Also, trim paths off otherwise valid origins.\r\n else if (null !== (oMatch = cfg.origin.match(/^https?:\\/\\/(?:[-a-zA-Z0-9_\\.])+(?::\\d+)?/))) {\r\n cfg.origin = oMatch[0].toLowerCase();\r\n validOrigin = true;\r\n }\r\n }\r\n\r\n if (!validOrigin) throw (\"Channel.build() called with an invalid origin\");\r\n\r\n if (typeof cfg.scope !== 'undefined') {\r\n if (typeof cfg.scope !== 'string') throw 'scope, when specified, must be a string';\r\n if (cfg.scope.split('::').length > 1) throw \"scope may not contain double colons: '::'\";\r\n } else {\r\n cfg.scope = \"__default\";\r\n }\r\n\r\n /* private variables */\r\n // generate a random and psuedo unique id for this channel\r\n var chanId = (function () {\r\n var text = \"\";\r\n var alpha = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\r\n for (var i = 0; i < 5; i++) text += alpha.charAt(Math.floor(Math.random() * alpha.length));\r\n return text;\r\n })();\r\n\r\n // registrations: mapping method names to call objects\r\n var regTbl = {};\r\n // current oustanding sent requests\r\n var outTbl = {};\r\n // current oustanding received requests\r\n var inTbl = {};\r\n // are we ready yet? when false we will block outbound messages.\r\n var ready = false;\r\n var pendingQueue = [];\r\n var publishQueue = [];\r\n\r\n var createTransaction = function (id, origin, callbacks) {\r\n var shouldDelayReturn = false;\r\n var completed = false;\r\n\r\n return {\r\n origin: origin,\r\n invoke: function (cbName, v) {\r\n // verify in table\r\n if (!inTbl[id]) throw \"attempting to invoke a callback of a nonexistent transaction: \" + id;\r\n // verify that the callback name is valid\r\n var valid = false;\r\n for (var i = 0; i < callbacks.length; i++) if (cbName === callbacks[i]) { valid = true; break; }\r\n if (!valid) throw \"request supports no such callback '\" + cbName + \"'\";\r\n\r\n // send callback invocation\r\n postMessage({ id: id, callback: cbName, params: v });\r\n },\r\n error: function (error, message) {\r\n completed = true;\r\n // verify in table\r\n if (!inTbl[id]) throw \"error called for nonexistent message: \" + id;\r\n\r\n // remove transaction from table\r\n delete inTbl[id];\r\n\r\n // send error\r\n postMessage({ id: id, error: error, message: message });\r\n },\r\n complete: function (v) {\r\n completed = true;\r\n // verify in table\r\n if (!inTbl[id]) throw \"complete called for nonexistent message: \" + id;\r\n // remove transaction from table\r\n delete inTbl[id];\r\n // send complete\r\n postMessage({ id: id, result: v });\r\n },\r\n delayReturn: function (delay) {\r\n if (typeof delay === 'boolean') {\r\n shouldDelayReturn = (delay === true);\r\n }\r\n return shouldDelayReturn;\r\n },\r\n completed: function () {\r\n return completed;\r\n }\r\n };\r\n };\r\n\r\n var setTransactionTimeout = function (transId, timeout, method) {\r\n return window.setTimeout(function () {\r\n if (outTbl[transId]) {\r\n // XXX: what if client code raises an exception here?\r\n var msg = \"timeout (\" + timeout + \"ms) exceeded on method '\" + method + \"'\";\r\n if (outTbl[transId].error) {\r\n outTbl[transId].error(\"timeout_error\", msg);\r\n }\r\n delete outTbl[transId];\r\n delete s_transIds[transId];\r\n }\r\n }, timeout);\r\n };\r\n\r\n var onMessage = function (origin, method, m) {\r\n // if an observer was specified at allocation time, invoke it\r\n if (typeof cfg.gotMessageObserver === 'function') {\r\n // pass observer a clone of the object so that our\r\n // manipulations are not visible (i.e. method unscoping).\r\n // This is not particularly efficient, but then we expect\r\n // that message observers are primarily for debugging anyway.\r\n try {\r\n cfg.gotMessageObserver(origin, m);\r\n } catch (e) {\r\n debug(\"gotMessageObserver() raised an exception: \" + e.toString());\r\n }\r\n }\r\n\r\n // now, what type of message is this?\r\n if (m.id && method) {\r\n inTbl[m.id] = {};\r\n var trans = createTransaction(m.id, origin, m.callbacks ? m.callbacks : []);\r\n // a request! do we have a registered handler for this request?\r\n if (regTbl[method]) {\r\n try {\r\n // callback handling. we'll magically create functions inside the parameter list for each\r\n // callback\r\n if (m.callbacks && s_isArray(m.callbacks) && m.callbacks.length > 0) {\r\n for (var i = 0; i < m.callbacks.length; i++) {\r\n var path = m.callbacks[i];\r\n var obj = m.params;\r\n var pathItems = path.split('/');\r\n for (var j = 0; j < pathItems.length - 1; j++) {\r\n var cp = pathItems[j];\r\n if (typeof obj[cp] !== 'object') obj[cp] = {};\r\n obj = obj[cp];\r\n }\r\n obj[pathItems[pathItems.length - 1]] = (function () {\r\n var cbName = path;\r\n return function (params) {\r\n return trans.invoke(cbName, params);\r\n };\r\n })();\r\n }\r\n }\r\n var resp = regTbl[method](trans, m.params);\r\n if (!trans.delayReturn() && !trans.completed()) trans.complete(resp);\r\n } catch (e) {\r\n // automagic handling of exceptions:\r\n var error = \"runtime_error\";\r\n var message = null;\r\n // * if it's a string then it gets an error code of 'runtime_error' and string is the message\r\n if (typeof e === 'string') {\r\n message = e;\r\n } else if (typeof e === 'object') {\r\n // if it's an Error instance we use the constructor name to set the error property\r\n // and we just copy the error message\r\n if (e instanceof Error) {\r\n error = e.constructor.name;\r\n message = e.message;\r\n }\r\n // Otherwise, it's either an array or an object\r\n // * if it's an array of length two, then array[0] is the code, array[1] is the error message\r\n else if (e && s_isArray(e) && e.length == 2) {\r\n error = e[0];\r\n message = e[1];\r\n }\r\n // * if it's an object then we'll look form error and message parameters\r\n else if (typeof e.error === 'string') {\r\n error = e.error;\r\n if (!e.message) message = \"\";\r\n else if (typeof e.message === 'string') message = e.message;\r\n else e = e.message; // let the stringify/toString message give us a reasonable verbose error string\r\n }\r\n }\r\n\r\n // message is *still* null, let's try harder\r\n if (message === null) {\r\n try {\r\n message = JSON.stringify(e);\r\n /* On MSIE8, this can result in 'out of memory', which\r\n * leaves message undefined. */\r\n if (typeof (message) == 'undefined')\r\n message = e.toString();\r\n } catch (e2) {\r\n message = e.toString();\r\n }\r\n }\r\n\r\n trans.error(error, message);\r\n }\r\n } else { // if no method found, send error\r\n trans.error(\"method_not_found\", \"No method '\" + method + \"' was (yet) bound by the provider\");\r\n }\r\n } else if (m.id && m.callback) {\r\n if (!outTbl[m.id] || !outTbl[m.id].callbacks || !outTbl[m.id].callbacks[m.callback]) {\r\n debug(\"ignoring invalid callback, id:\" + m.id + \" (\" + m.callback + \")\");\r\n } else {\r\n // XXX: what if client code raises an exception here?\r\n outTbl[m.id].callbacks[m.callback](m.params);\r\n }\r\n } else if (m.id) {\r\n if (!outTbl[m.id]) {\r\n debug(\"ignoring invalid response: \" + m.id);\r\n } else {\r\n // XXX: what if client code raises an exception here?\r\n if (m.error) {\r\n // We might not have an error callback\r\n if (outTbl[m.id].error) {\r\n outTbl[m.id].error(m.error, m.message);\r\n }\r\n } else {\r\n // But we always have a success callback\r\n if (m.result !== undefined) {\r\n outTbl[m.id].success(m.result);\r\n } else {\r\n outTbl[m.id].success();\r\n }\r\n }\r\n delete outTbl[m.id];\r\n delete s_transIds[m.id];\r\n }\r\n } else if (method) {\r\n // tis a notification.\r\n if (regTbl[method]) {\r\n // yep, there's a handler for that.\r\n // transaction has only origin for notifications.\r\n regTbl[method]({ origin: origin }, m.params);\r\n // if the client throws, we'll just let it bubble out\r\n // what can we do? Also, here we'll ignore return values\r\n }\r\n }\r\n };\r\n\r\n // now register our bound channel for msg routing\r\n s_addBoundChan(cfg.window, cfg.origin, cfg.scope, onMessage);\r\n\r\n // scope method names based on cfg.scope specified when the Channel was instantiated\r\n var scopeMethod = function (m) {\r\n return [cfg.scope, m].join(\"::\");\r\n };\r\n\r\n // a small wrapper around postmessage whose primary function is to handle the\r\n // case that clients start sending messages before the other end is \"ready\"\r\n var postMessage = function (msg, force) {\r\n if (!msg) throw \"postMessage called with null message\";\r\n\r\n // delay posting if we're not ready yet.\r\n if (!force && !ready) {\r\n debug(\"queue message: \" + JSON.stringify(msg));\r\n pendingQueue.push(msg);\r\n } else {\r\n if (typeof cfg.postMessageObserver === 'function') {\r\n try {\r\n cfg.postMessageObserver(cfg.origin, msg);\r\n } catch (e) {\r\n debug(\"postMessageObserver() raised an exception: \" + e.toString());\r\n }\r\n }\r\n debug(\"post message: \" + JSON.stringify(msg) + \" with origin \" + cfg.origin);\r\n cfg.window.postMessage(JSON.stringify(msg), cfg.origin);\r\n }\r\n };\r\n\r\n var onReady = function (trans, params) {\r\n debug('ready msg received');\r\n if (ready && !cfg.reconnect) {\r\n throw \"received ready message while in ready state.\";\r\n }\r\n ready = true;\r\n\r\n // only append suffix to chanId once:\r\n if (chanId.length < 6) {\r\n if (params.type === 'publish-request') {\r\n chanId += '-R';\r\n } else {\r\n chanId += '-L';\r\n }\r\n }\r\n debug('ready msg accepted.');\r\n\r\n if (params.type === 'publish-request') {\r\n obj.notify({\r\n method: '__ready', params: {\r\n type: 'publish-reply',\r\n publish: publishQueue\r\n }\r\n });\r\n }\r\n\r\n for (var i = 0; i < params.publish.length; i++) {\r\n if (params.publish[i].action === \"bind\") {\r\n createStubs([params.publish[i].method], obj.remote);\r\n } else { // unbind\r\n delete obj.remote[params.publish[i].method];\r\n }\r\n }\r\n\r\n //unbind ready handler unless we allow reconnecting:\r\n if (!cfg.reconnect) {\r\n obj.unbind('__ready', true); // now this handler isn't needed any more.\r\n }\r\n\r\n // flush queue\r\n while (pendingQueue.length) {\r\n postMessage(pendingQueue.splice(0, 1)[0]);\r\n }\r\n publishQueue = [];\r\n // invoke onReady observer if provided\r\n if (typeof cfg.onReady === 'function') cfg.onReady(obj);\r\n\r\n };\r\n\r\n var createStubs = function (stubList, targetObj) {\r\n stubList = [].concat(stubList); // Coerce into array, allows string to be used for single-item array\r\n var method;\r\n for (var i = 0; i < stubList.length; i++) {\r\n method = stubList[i].toString();\r\n targetObj[method] = function (m) {\r\n return function (params, success, error) {\r\n if (success) {\r\n obj.call({\r\n method: m,\r\n params: params,\r\n success: success,\r\n error: error\r\n });\r\n } else {\r\n obj.notify({\r\n method: m,\r\n params: params\r\n });\r\n }\r\n };\r\n }(method);\r\n }\r\n }\r\n\r\n // Dynamic publish from remote\r\n var onBind = function (trans, method) {\r\n createStubs([method], obj.remote);\r\n };\r\n\r\n // Dynamic unpublish from remote\r\n var onUnbind = function (trans, method) {\r\n if (obj.remote[method]) {\r\n delete obj.remote[method];\r\n }\r\n };\r\n\r\n var obj = {\r\n\r\n remote: {},\r\n\r\n // tries to unbind a bound message handler. returns false if not possible\r\n unbind: function (method, doNotPublish) {\r\n if (regTbl[method]) {\r\n if (!(delete regTbl[method])) throw (\"can't delete method: \" + method);\r\n if (cfg.publish && !doNotPublish) {\r\n if (ready) {\r\n obj.notify({ method: '__unbind', params: method });\r\n } else {\r\n publishQueue.push({ action: 'unbind', method: method });\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n },\r\n bind: function (method, cb, doNotPublish) {\r\n if (!method || typeof method !== 'string') throw \"'method' argument to bind must be string\";\r\n if (!cb || typeof cb !== 'function') throw \"callback missing from bind params\";\r\n\r\n if (regTbl[method]) throw \"method '\" + method + \"' is already bound!\";\r\n regTbl[method] = cb;\r\n if (cfg.publish && !doNotPublish) {\r\n if (ready) {\r\n obj.notify({ method: '__bind', params: method });\r\n } else {\r\n publishQueue.push({ action: 'bind', method: method });\r\n }\r\n }\r\n return this;\r\n },\r\n call: function (m) {\r\n if (!m) throw 'missing arguments to call function';\r\n if (!m.method || typeof m.method !== 'string') throw \"'method' argument to call must be string\";\r\n if (!m.success || typeof m.success !== 'function') throw \"'success' callback missing from call\";\r\n\r\n // now it's time to support the 'callback' feature of jschannel. We'll traverse the argument\r\n // object and pick out all of the functions that were passed as arguments.\r\n var callbacks = {};\r\n var callbackNames = [];\r\n var seen = [];\r\n\r\n var pruneFunctions = function (path, obj) {\r\n var indexOf = function (array, el) {\r\n var length = array.length, index = 0;\r\n for (; length > index; index++) \r\n if (array[index] === el)\r\n return index;\r\n return -1;\r\n };\r\n //if (seen.indexOf(obj) >= 0) {\r\n if (indexOf(seen, obj) >= 0) {\r\n throw \"params cannot be a recursive data structure\"\r\n }\r\n\r\n\r\n //// false -> Array#indexOf\r\n //// true -> Array#includes\r\n //var $ = require('./$');\r\n //module.exports = function (IS_INCLUDES) {\r\n // return function ($this, el, fromIndex) {\r\n // var O = $.toObject($this)\r\n // , length = $.toLength(O.length)\r\n // , index = $.toIndex(fromIndex, length)\r\n // , value;\r\n // if (IS_INCLUDES && el != el) while (length > index) {\r\n // value = O[index++];\r\n // if (value != value) return true;\r\n // } else for (; length > index; index++) if (IS_INCLUDES || index in O) {\r\n // if (O[index] === el) return IS_INCLUDES || index;\r\n // } return !IS_INCLUDES && -1;\r\n // };\r\n //};\r\n\r\n\r\n seen.push(obj);\r\n\r\n if (typeof obj === 'object') {\r\n for (var k in obj) {\r\n if (!obj.hasOwnProperty(k)) continue;\r\n var np = path + (path.length ? '/' : '') + k;\r\n if (typeof obj[k] === 'function') {\r\n callbacks[np] = obj[k];\r\n callbackNames.push(np);\r\n delete obj[k];\r\n } else if (typeof obj[k] === 'object') {\r\n pruneFunctions(np, obj[k]);\r\n }\r\n }\r\n }\r\n };\r\n pruneFunctions(\"\", m.params);\r\n\r\n // build a 'request' message and send it\r\n var msg = { id: s_curTranId, method: scopeMethod(m.method), params: m.params };\r\n if (callbackNames.length) msg.callbacks = callbackNames;\r\n\r\n if (m.timeout)\r\n // XXX: This function returns a timeout ID, but we don't do anything with it.\r\n // We might want to keep track of it so we can cancel it using clearTimeout()\r\n // when the transaction completes.\r\n setTransactionTimeout(s_curTranId, m.timeout, scopeMethod(m.method));\r\n\r\n // insert into the transaction table\r\n outTbl[s_curTranId] = { callbacks: callbacks, error: m.error, success: m.success };\r\n s_transIds[s_curTranId] = onMessage;\r\n\r\n // increment current id\r\n s_curTranId++;\r\n\r\n postMessage(msg);\r\n },\r\n notify: function (m) {\r\n if (!m) throw 'missing arguments to notify function';\r\n if (!m.method || typeof m.method !== 'string') throw \"'method' argument to notify must be string\";\r\n\r\n // no need to go into any transaction table\r\n postMessage({ method: scopeMethod(m.method), params: m.params });\r\n },\r\n destroy: function () {\r\n s_removeBoundChan(cfg.window, cfg.origin, cfg.scope);\r\n if (window.removeEventListener) window.removeEventListener('message', onMessage, false);\r\n else if (window.detachEvent) window.detachEvent('onmessage', onMessage);\r\n ready = false;\r\n regTbl = {};\r\n inTbl = {};\r\n outTbl = {};\r\n cfg.origin = null;\r\n pendingQueue = [];\r\n debug(\"channel destroyed\");\r\n chanId = \"\";\r\n }\r\n };\r\n\r\n obj.bind('__ready', onReady, true);\r\n obj.bind('__bind', onBind, true);\r\n obj.bind('__unbind', onUnbind, true);\r\n if (cfg.remote) {\r\n createStubs(cfg.remote, obj.remote);\r\n }\r\n setTimeout(function () {\r\n if (chanId.length > 0) { // The channel might already have been destroyed\r\n postMessage({\r\n method: scopeMethod('__ready'), params: {\r\n type: \"publish-request\",\r\n publish: publishQueue\r\n }\r\n }, true);\r\n }\r\n\r\n }, 0);\r\n\r\n return obj;\r\n }\r\n };\r\n })();\r\n\r\n\r\n return Channel;\r\n}));\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.LightboxContentScript = void 0;\r\nvar jschannel = require(\"@greenova/jschannel\");\r\nvar LightboxContentScript = /** @class */ (function () {\r\n function LightboxContentScript() {\r\n var _this = this;\r\n this._MAX_SAFE_INTEGER = 9007199254740991;\r\n this._getDimensions = function (trans, params) {\r\n document.documentElement.style.overflow = \"hidden\";\r\n document.documentElement.style.overflowX = \"hidden\";\r\n document.documentElement.style.overflowY = \"hidden\";\r\n if (!params.useMaxDynamicDimensions) {\r\n // document.documentElement.style.cssFloat = \"left\";\r\n document.body.style.cssFloat = \"left\";\r\n }\r\n //document.documentElement.style.height = \"100%\";\r\n //document.documentElement.style.width = \"100%\";\r\n document.body.style.overflow = \"hidden\";\r\n document.body.style.overflowX = \"hidden\";\r\n document.body.style.overflowY = \"hidden\";\r\n _this._overlayMSize();\r\n var w, h;\r\n if (window[\"getComputedStyle\"]) {\r\n var bs = window.getComputedStyle(document.body);\r\n bs.getPropertyValue('width'); //fix for IE, first read can returns 'auto'\r\n w = parseFloat(bs.width) + parseFloat(bs.marginLeft) + parseFloat(bs.marginRight) + parseFloat(bs.borderLeftWidth) - parseFloat(bs.borderRightWidth);\r\n h = parseFloat(bs.height) + parseFloat(bs.marginTop) + parseFloat(bs.marginBottom) + parseFloat(bs.borderTopWidth) - parseFloat(bs.borderBottomWidth);\r\n if (_this._isIE()) {\r\n w += parseFloat(bs.paddingLeft) + parseFloat(bs.paddingRight);\r\n h += parseFloat(bs.paddingTop) + parseFloat(bs.paddingBottom);\r\n }\r\n }\r\n else {\r\n w = document.body.scrollWidth;\r\n h = document.body.scrollHeight;\r\n }\r\n w = Math.ceil(w);\r\n h = Math.ceil(h);\r\n if (w > params.width || w > _this._mw) {\r\n document.documentElement.style.overflowX = \"visible\";\r\n document.body.style.overflowX = \"visible\";\r\n }\r\n if (h > params.height || h > _this._mh) {\r\n document.documentElement.style.overflowY = \"visible\";\r\n document.body.style.overflowY = \"visible\";\r\n }\r\n return {\r\n width: w,\r\n height: h,\r\n };\r\n };\r\n this._getDimensionsV2 = function (trans, params) {\r\n document.documentElement.style.overflow = \"hidden\";\r\n document.documentElement.style.overflowX = \"hidden\";\r\n document.documentElement.style.overflowY = \"hidden\";\r\n if (params.useMaxDynamicDimensions) {\r\n document.documentElement.style.width = params.width + \"px\";\r\n }\r\n else {\r\n // document.documentElement.style.cssFloat = \"left\";\r\n document.body.style.cssFloat = \"left\";\r\n }\r\n //document.documentElement.style.height = \"100%\";\r\n //document.documentElement.style.width = \"100%\";\r\n document.body.style.overflow = \"hidden\";\r\n document.body.style.overflowX = \"hidden\";\r\n document.body.style.overflowY = \"hidden\";\r\n _this._overlayMSize();\r\n var w, h;\r\n if (window[\"getComputedStyle\"]) {\r\n var bs = window.getComputedStyle(document.body);\r\n bs.getPropertyValue('width'); //fix for IE, first read can returns 'auto'\r\n w = parseFloat(bs.width) + parseFloat(bs.marginLeft) + parseFloat(bs.marginRight) + parseFloat(bs.borderLeftWidth) - parseFloat(bs.borderRightWidth);\r\n h = parseFloat(bs.height) + parseFloat(bs.marginTop) + parseFloat(bs.marginBottom) + parseFloat(bs.borderTopWidth) - parseFloat(bs.borderBottomWidth);\r\n if (_this._isIE()) {\r\n w += parseFloat(bs.paddingLeft) + parseFloat(bs.paddingRight);\r\n h += parseFloat(bs.paddingTop) + parseFloat(bs.paddingBottom);\r\n }\r\n }\r\n else {\r\n w = document.body.scrollWidth;\r\n h = document.body.scrollHeight;\r\n }\r\n w = Math.ceil(w);\r\n h = Math.ceil(h);\r\n if (w > params.width || w > _this._mw) {\r\n document.documentElement.style.overflowX = \"visible\";\r\n document.body.style.overflowX = \"visible\";\r\n }\r\n if (h > params.height || h > _this._mh) {\r\n document.documentElement.style.overflowY = \"visible\";\r\n document.body.style.overflowY = \"visible\";\r\n }\r\n return {\r\n width: w,\r\n height: h,\r\n };\r\n };\r\n this._overlayMSize = function () {\r\n if (!_this._mset) {\r\n if (window[\"getComputedStyle\"]) {\r\n var bs = window.getComputedStyle(document.body);\r\n _this._mw = _this._parseMaxSize(bs.maxWidth);\r\n _this._mh = _this._parseMaxSize(bs.maxHeight);\r\n }\r\n else {\r\n var cs = document.body.currentStyle;\r\n if (cs) {\r\n _this._mw = _this._parseMaxSize(cs.maxWidth);\r\n _this._mh = _this._parseMaxSize(cs.maxHeight);\r\n }\r\n else {\r\n _this._mw = _this._parseMaxSize(document.body.style.maxWidth);\r\n _this._mh = _this._parseMaxSize(document.body.style.maxHeight);\r\n }\r\n }\r\n document.documentElement.style.maxWidth = \"none\";\r\n document.documentElement.style.maxHeight = \"none\";\r\n document.body.style.maxWidth = \"none\";\r\n document.body.style.maxHeight = \"none\";\r\n _this._mset = true;\r\n }\r\n return {\r\n width: _this._mw,\r\n height: _this._mh\r\n };\r\n };\r\n // // Backward compatibility\r\n // //\r\n // // Can be called by content as a notify when a button is clicked. \r\n // // This is for external templates where the ClickedAt timestamp can't be written to [dbo].[TrackingActionVoucher] automatically.\r\n // public clicked(): void {\r\n // this.trigger({\r\n // method: \"clicked\"\r\n // });\r\n // }\r\n this._setup = function (trans, params) {\r\n _this._config = params;\r\n if (_this._config.closeOnEscKey) {\r\n if (document.addEventListener)\r\n document.addEventListener(\"keydown\", _this._onKeyDown);\r\n else if (document.attachEvent)\r\n document.attachEvent('onkeydown', _this._onKeyDown);\r\n }\r\n };\r\n this._onKeyDown = function (evt) {\r\n if (_this._config.closeOnEscKey) {\r\n evt = evt || window.event;\r\n var isEscape = false;\r\n if (\"key\" in evt) {\r\n isEscape = (evt.key === \"Escape\" || evt.key === \"Esc\");\r\n }\r\n else {\r\n isEscape = (evt.keyCode === 27);\r\n }\r\n if (isEscape) {\r\n _this.close();\r\n }\r\n }\r\n };\r\n this._chan = jschannel.build({ window: window.parent, origin: \"*\", scope: \"smasi-lightbox\", reconnect: true });\r\n this._chan.bind(\"getDimensions\", this._getDimensions);\r\n this._chan.bind(\"getDimensionsV2\", this._getDimensionsV2);\r\n this._chan.bind(\"overlayMSize\", this._overlayMSize);\r\n this._chan.bind(\"setup\", this._setup);\r\n //\r\n var asyncContent = document.querySelector('meta[name=\"smasi:config\"]');\r\n if (asyncContent && asyncContent.getAttribute('data-async-content') === \"true\") {\r\n this._chan.notify({\r\n method: \"contentHandshake\",\r\n params: {\r\n asyncContent: true\r\n }\r\n });\r\n }\r\n else {\r\n this._chan.notify({\r\n method: \"contentCommunicationReady\"\r\n });\r\n }\r\n //document.addEventListener(\"touchstart\", this.ontouchstart);\r\n //document.addEventListener(\"touchmove\", this.ontouchmove);\r\n }\r\n //ontouchstart = (event: Event) => {\r\n // this.cy = event.touches[0].clientY;\r\n // console.warn(\"content-ontouchstart-\" + event.target.nodeName + \"-\" + event.target.id);\r\n // let p = event.target;\r\n // while (p != null) {\r\n // if (p == this.rootElement) {\r\n // console.warn(\"content-ontouchstart-root\");\r\n // return;\r\n // }\r\n // p = p.parentNode;\r\n // }\r\n // //event.preventDefault();\r\n //}\r\n //ontouchmove = (event: Event) => {\r\n // console.warn(\"content-ontouchmove-\" + event.target.nodeName + \"-\" + event.target.id);\r\n // //event.preventDefault();\r\n //}\r\n LightboxContentScript.prototype._isIE = function () {\r\n if (window.navigator && window.navigator.userAgent) {\r\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\r\n var msie = ua.indexOf('MSIE '); // IE 10 or older\r\n var trident = ua.indexOf('Trident/'); //IE 11\r\n return (msie > 0 || trident > 0);\r\n }\r\n return false;\r\n };\r\n LightboxContentScript.prototype._parseMaxSize = function (size) {\r\n return Math.floor(parseFloat(size) || this._MAX_SAFE_INTEGER);\r\n };\r\n LightboxContentScript.prototype.close = function () {\r\n this._chan.notify({\r\n method: \"closeByUser\"\r\n });\r\n if (this._config && this._config.closeOnEscKey) {\r\n if (document.removeEventListener)\r\n document.removeEventListener(\"keydown\", this._onKeyDown);\r\n else if (document.dettachEvent)\r\n document.dettachEvent('onkeydown', this._onKeyDown);\r\n }\r\n };\r\n // // Backward compatibility\r\n // public closeByUser(): void {\r\n // this.close();\r\n // }\r\n LightboxContentScript.prototype.trigger = function (innerAction, success, error) {\r\n this._chan.call({\r\n method: \"panelAction\",\r\n params: innerAction,\r\n success: success ? success : function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n },\r\n error: error ? error : function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n },\r\n });\r\n };\r\n // // Backward compatibility\r\n // public panelAction(actionToken: string, closePanel: boolean): void {\r\n // this.trigger({\r\n // action: actionToken, closeAfter: closePanel\r\n // });\r\n // }\r\n LightboxContentScript.prototype.sizeChanged = function () {\r\n this._chan.notify({\r\n method: \"sizeChanged\"\r\n });\r\n };\r\n // Can be called by content as a notify when the content is\r\n // completely loaded and ready to displayed. \r\n // The content must enable this behaviour by setting\r\n // window.lightboxConfig.asyncContent = true\r\n // before this script is loaded.\r\n // When this feature is enabled, the lightbox won't open until\r\n // this notify is called.\r\n LightboxContentScript.prototype.asyncContentReady = function () {\r\n this._chan.notify({\r\n method: \"asyncContentReady\"\r\n });\r\n };\r\n return LightboxContentScript;\r\n}());\r\nexports.LightboxContentScript = LightboxContentScript;\r\n// let lightboxContentScript = new LightboxContentScript();\r\n// (window).smartOverlay = lightboxContentScript;\r\n// export default lightboxContentScript;\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","import { LightboxContentScript } from '@greenova/smartoverlay/dist/overlayContentScript';\r\nimport { IOverlayClient } from './IOverlayClient.public';\r\n\r\n// LightboxContentScript extended for Smasi1 backward compatibility\r\nclass OverlayClient extends LightboxContentScript implements IOverlayClient {\r\n\r\n constructor() {\r\n super();\r\n }\r\n\r\n public closeByUser(): void {\r\n this.close();\r\n }\r\n\r\n public panelAction(actionToken: string, closePanel: boolean, userForm: any): void {\r\n this.trigger({\r\n action: actionToken, closeAfter: closePanel, userForm: userForm\r\n });\r\n }\r\n\r\n //// Can be called by content as a notify when the content is\r\n //// completely loaded and ready to displayed. \r\n //// The content must enable this behaviour by setting\r\n //// window.lightboxConfig.asyncContent = true\r\n //// before this script is loaded.\r\n //// When this feature is enabled, the lightbox won't open until\r\n //// this notify is called.\r\n //public asyncContentReady(): void {\r\n // this._chan.notify({\r\n // method: \"asyncContentReady\"\r\n // });\r\n //}\r\n // Can be called by content as a notify when a button is clicked. \r\n // This is for external templates where the ClickedAt timestamp can't be written to [dbo].[TrackingActionVoucher] automatically.\r\n public clicked(): void {\r\n this.trigger({\r\n method: \"clicked\"\r\n });\r\n }\r\n\r\n}\r\n\r\nconst client = new OverlayClient();\r\n\r\n(window).smartOverlay = client;\r\n\r\n// used for smasi1 compatibility\r\n(window).smartLightbox = client;\r\n\r\n\r\n"],"names":["module","exports","s_curTranId","Math","floor","random","s_boundChans","s_isArray","obj","Array","isArray","constructor","toString","indexOf","s_transIds","s_onMessage","e","m","JSON","parse","data","s","i","meth","w","source","o","origin","method","ar","split","length","id","delivered","j","win","handler","window","addEventListener","attachEvent","build","cfg","debug","debugOutput","console","log","stringify","chanId","postMessage","oMatch","validOrigin","match","toLowerCase","scope","text","alpha","charAt","regTbl","outTbl","inTbl","ready","pendingQueue","publishQueue","onMessage","gotMessageObserver","trans","callbacks","shouldDelayReturn","completed","invoke","cbName","v","valid","callback","params","error","message","complete","result","delayReturn","delay","createTransaction","path","pathItems","cp","resp","Error","name","e2","undefined","success","hasWin","arr","exists","k","hasOwnProperty","push","s_addBoundChan","scopeMethod","join","msg","force","postMessageObserver","createStubs","stubList","targetObj","concat","call","notify","remote","unbind","doNotPublish","publish","action","bind","cb","this","callbackNames","seen","pruneFunctions","array","el","index","np","transId","timeout","setTimeout","destroy","splice","s_removeBoundChan","removeEventListener","detachEvent","reconnect","type","onReady","factory","jschannel","LightboxContentScript","_this","_MAX_SAFE_INTEGER","_getDimensions","h","document","documentElement","style","overflow","overflowX","overflowY","useMaxDynamicDimensions","body","cssFloat","_overlayMSize","bs","getComputedStyle","getPropertyValue","parseFloat","width","marginLeft","marginRight","borderLeftWidth","borderRightWidth","height","marginTop","marginBottom","borderTopWidth","borderBottomWidth","_isIE","paddingLeft","paddingRight","paddingTop","paddingBottom","scrollWidth","scrollHeight","ceil","_mw","_mh","_getDimensionsV2","_mset","_parseMaxSize","maxWidth","maxHeight","cs","currentStyle","_setup","_config","closeOnEscKey","_onKeyDown","evt","event","key","keyCode","close","_chan","parent","asyncContent","querySelector","getAttribute","prototype","navigator","userAgent","ua","msie","trident","size","dettachEvent","trigger","innerAction","args","_i","arguments","sizeChanged","asyncContentReady","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","client","closeByUser","panelAction","actionToken","closePanel","userForm","closeAfter","clicked","smartOverlay","smartLightbox"],"sourceRoot":""}