Created
August 26, 2019 16:48
-
-
Save vladimyr/83187fd118b1a0f066e83ee3fdf1c470 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @license | |
Copyright (c) 2016-2018 by CyberSource */ | |
'use strict'; | |
!function(root, factory) { | |
if ("object" == typeof exports && "object" == typeof module) { | |
module.exports = factory(); | |
} else { | |
if ("function" == typeof define && define.amd) { | |
define([], factory); | |
} else { | |
var merge = factory(); | |
var i; | |
for (i in merge) { | |
("object" == typeof exports ? exports : root)[i] = merge[i]; | |
} | |
} | |
} | |
}("undefined" != typeof self ? self : this, function() { | |
return function(e) { | |
/** | |
* @param {number} i | |
* @return {?} | |
*/ | |
function t(i) { | |
if (n[i]) { | |
return n[i].exports; | |
} | |
var module = n[i] = { | |
i : i, | |
l : false, | |
exports : {} | |
}; | |
return e[i].call(module.exports, module, module.exports, t), module.l = true, module.exports; | |
} | |
var n = {}; | |
return t.m = e, t.c = n, t.d = function(d, name, n) { | |
if (!t.o(d, name)) { | |
Object.defineProperty(d, name, { | |
configurable : false, | |
enumerable : true, | |
get : n | |
}); | |
} | |
}, t.n = function(module) { | |
/** @type {function(): ?} */ | |
var n = module && module.__esModule ? function() { | |
return module.default; | |
} : function() { | |
return module; | |
}; | |
return t.d(n, "a", n), n; | |
}, t.o = function(t, object) { | |
return Object.prototype.hasOwnProperty.call(t, object); | |
}, t.p = "", t(t.s = 191); | |
}({ | |
0 : function(module, exports, __weex_require__) { | |
/** | |
* @param {?} value | |
* @return {?} | |
*/ | |
function isObjectLike(value) { | |
return null != value && "object" === (void 0 === value ? "undefined" : _typeof(value)); | |
} | |
/** | |
* @param {?} value | |
* @return {?} | |
*/ | |
function isObject(value) { | |
var argType = void 0 === value ? "undefined" : _typeof(value); | |
return null != value && ("object" === argType || "function" === argType); | |
} | |
/** | |
* @param {?} value | |
* @return {?} | |
*/ | |
function isFunction(value) { | |
/** @type {string} */ | |
var t = isObject(value) ? Object.prototype.toString.call(value) : ""; | |
return "[object Function]" === t || "[object GeneratorFunction]" === t; | |
} | |
/** | |
* @param {string} value | |
* @return {?} | |
*/ | |
function isString(value) { | |
return "string" == typeof value || !Array.isArray(value) && isObjectLike(value) && "[object String]" === Object.prototype.toString.call(value); | |
} | |
/** | |
* @param {?} value | |
* @return {?} | |
*/ | |
function isEmpty(value) { | |
return "object" === ("undefined" == typeof HTMLElement ? "undefined" : _typeof(HTMLElement)) ? value instanceof HTMLElement : isObjectLike(value) && 1 === value.nodeType && "string" == typeof value.nodeName; | |
} | |
/** | |
* @param {?} data | |
* @return {?} | |
*/ | |
function dataToAscii(data) { | |
return String.fromCharCode.apply(null, new Uint8Array(data)); | |
} | |
/** | |
* @param {string} message | |
* @return {?} | |
*/ | |
function parse(message) { | |
/** @type {!ArrayBuffer} */ | |
var data = new ArrayBuffer(message.length); | |
/** @type {!Uint8Array} */ | |
var ui8a = new Uint8Array(data); | |
/** @type {number} */ | |
var i = 0; | |
var headerCount = message.length; | |
for (; i < headerCount; i = i + 1) { | |
ui8a[i] = message.charCodeAt(i); | |
} | |
return data; | |
} | |
/** | |
* @return {undefined} | |
*/ | |
function removeSelection() { | |
if (window.getSelection && window.getSelection().empty) { | |
window.getSelection().empty(); | |
} else { | |
if (window.getSelection && window.getSelection().removeAllRanges) { | |
window.getSelection().removeAllRanges(); | |
} else { | |
if (document.selection) { | |
document.selection.empty(); | |
} | |
} | |
} | |
} | |
/** | |
* @return {?} | |
*/ | |
function guid() { | |
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(l) { | |
/** @type {number} */ | |
var r = 16 * Math.random() | 0; | |
return ("x" === l ? r : 3 & r | 8).toString(16); | |
}); | |
} | |
/** | |
* @param {?} key | |
* @return {?} | |
*/ | |
function d(key) { | |
return JSON.parse(JSON.stringify(key)); | |
} | |
/** | |
* @param {string} el | |
* @return {?} | |
*/ | |
function GetFlashVars(el) { | |
return "string" == typeof el ? el.replace(/\D/g, "") : ""; | |
} | |
Object.defineProperty(exports, "__esModule", { | |
value : true | |
}); | |
/** @type {function((!Function|string)): ?} */ | |
var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(ctor) { | |
return typeof ctor; | |
} : function(obj) { | |
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | |
}; | |
/** @type {function(?): ?} */ | |
exports.isObjectLike = isObjectLike; | |
/** @type {function(?): ?} */ | |
exports.isObject = isObject; | |
/** @type {function(?): ?} */ | |
exports.isFunction = isFunction; | |
/** @type {function(string): ?} */ | |
exports.isString = isString; | |
/** @type {function(?): ?} */ | |
exports.isElement = isEmpty; | |
/** @type {function(?): ?} */ | |
exports.arrayBufferToString = dataToAscii; | |
/** @type {function(string): ?} */ | |
exports.stringToArrayBuffer = parse; | |
/** @type {function(): undefined} */ | |
exports.clearCurrentSelection = removeSelection; | |
/** @type {function(): ?} */ | |
exports.uuid = guid; | |
/** @type {function(?): ?} */ | |
exports.simpleClone = d; | |
/** @type {function(string): ?} */ | |
exports.stripNonDigits = GetFlashVars; | |
exports.Base64 = { | |
encode : function(str) { | |
var res = isString(str) ? parse(str) : str; | |
if ("ArrayBuffer" == typeof res || res instanceof ArrayBuffer) { | |
/** @type {!Uint8Array} */ | |
var bytes = new Uint8Array(res); | |
return window.btoa(String.fromCharCode.apply(null, bytes)); | |
} | |
throw new TypeError("Input should be of type String or ArrayBuffer"); | |
} | |
}; | |
}, | |
1 : function(_wid_attr, data, linkedEntities) { | |
Object.defineProperty(data, "__esModule", { | |
value : true | |
}); | |
var fields = (data.encryptionTypes = ["rsaoaep256", "rsaoaep", "none"], data.cssClasses = { | |
FOCUSED : "flex-microform-focused", | |
VALID : "flex-microform-valid", | |
INVALID : "flex-microform-invalid", | |
DISABLED : "flex-microform-disabled", | |
AUTOCOMPLETE : "flex-microform-autocomplete" | |
}, data.jsEvents = { | |
ENABLE : "enabled", | |
DISABLE : "disabled", | |
FOCUS : "focus", | |
BLUR : "blur", | |
EMPTY : "empty", | |
NOT_EMPTY : "notEmpty", | |
CARD_TYPE_CHANGE : "cardTypeChange", | |
VALIDATION_CHANGE : "validationChange", | |
INPUT_SUBMIT_REQUEST : "inputSubmitRequest", | |
TOKENIZE_LOAD_START : "tokenizeLoadStart", | |
AUTOCOMPLETE : "autocomplete", | |
AUTOCOMPLETE_CHANGE : "autocompleteChange" | |
}); | |
/** @type {!Array<?>} */ | |
data.jsEventsList = Object.keys(fields).map(function(utteranceIndex) { | |
return fields[utteranceIndex]; | |
}); | |
data.postMessagesFromParent = { | |
FOCUS : "focus", | |
TOKENIZE : "tokenize", | |
CLEAR : "clear", | |
ENABLE : "enable", | |
DISABLE : "disable", | |
SET_PLACEHOLDER : "setPlaceholder" | |
}; | |
data.postMessagesFromChild = { | |
FOCUS : "focus", | |
BLUR : "blur", | |
EMPTY : "empty", | |
NOT_EMPTY : "notEmpty", | |
CARD_CHANGE_TYPE : "cardTypeChange", | |
VALIDATION_CHANGE : "cardValidationChange", | |
ENABLE : "enable", | |
DISABLE : "disable", | |
INPUT_SUBMIT_REQUEST : "inputSubmitRequest", | |
TOKENIZE_LOAD_START : "tokenizeLoadStart", | |
HANDSHAKE_INIT : "handshakeInit", | |
HANDSHAKE_COMPLETE : "handshakeComplete", | |
AUTOCOMPLETE : "autocomplete", | |
AUTOCOMPLETE_CHANGE : "autocompleteChange" | |
}; | |
}, | |
191 : function(blob, name, project) { | |
var def = project(3).default; | |
var UndoCommand = project(192).default; | |
blob.exports = { | |
FLEX : { | |
microform : UndoCommand, | |
version : def | |
} | |
}; | |
}, | |
192 : function(module, exports, __webpack_require__) { | |
/** | |
* @param {!Object} obj | |
* @return {?} | |
*/ | |
function _interopRequireDefault(obj) { | |
return obj && obj.__esModule ? obj : { | |
default : obj | |
}; | |
} | |
/** | |
* @param {string} column | |
* @param {string} value | |
* @return {?} | |
*/ | |
function init(column, value) { | |
/** @type {!Element} */ | |
var element = document.createElement("iframe"); | |
return element.setAttribute("hspace", "0"), element.setAttribute("vspace", "0"), element.setAttribute("frameborder", "0"), element.setAttribute("scrolling", "no"), element.setAttribute("allowtransparency", "true"), element.setAttribute("marginwidth", "0"), element.setAttribute("marginheight", "0"), element.style.overflow = "hidden", element.style.position = "relative", element.style.border = "none", element.style.width = "100%", element.style.height = "100%", element.id = "flex-microform-" + | |
value, element.setAttribute("src", column + "?keyId=" + value), element.innerHTML = "<p>Your browser does not support frames.</p>", element; | |
} | |
/** | |
* @param {!Element} host | |
* @param {!Object} test | |
* @param {number} x | |
* @param {?} local | |
* @return {undefined} | |
*/ | |
function run(host, test, x, local) { | |
/** @type {string} */ | |
host.innerHTML = ""; | |
test.teardown(); | |
/** @type {null} */ | |
test = null; | |
if (x) { | |
clearTimeout(x); | |
} | |
local(new _normalizeDataUri2.default({ | |
message : "Timeout has occurred" | |
})); | |
} | |
/** | |
* @param {string} description | |
* @return {?} | |
*/ | |
function assert(description) { | |
return new Error('Required parameter "' + description + '" was not supplied'); | |
} | |
/** | |
* @param {string} index | |
* @param {string} name | |
* @param {!Array} value | |
* @return {?} | |
*/ | |
function ok(index, name, value) { | |
/** @type {string} */ | |
var access = 'Invalid value of "' + name + '" for "' + index + '" parameter.'; | |
/** @type {string} */ | |
var id = " Supported values are [" + value.join(", ") + "]"; | |
return new Error(access + id); | |
} | |
/** | |
* @param {string} item | |
* @param {string} doc | |
* @param {string} label | |
* @return {?} | |
*/ | |
function cb(item, doc, label) { | |
return new Error('Invalid value typeof "' + doc + '" supplied for parameter "' + item + '". Expected typeof "' + label + '"'); | |
} | |
/** | |
* @param {?} path | |
* @return {?} | |
*/ | |
function create(path) { | |
var o = (0, _UiIcon2.default)({}, defaults, path); | |
if (Object.keys(options).forEach(function(key) { | |
var opts = options[key]; | |
var string = o[key]; | |
if (opts.required || void 0 !== string) { | |
if (opts.required && void 0 === string) { | |
throw assert(key); | |
} | |
if ((void 0 === string ? "undefined" : check(string)) !== opts.type) { | |
throw cb(key, void 0 === string ? "undefined" : check(string), opts.type); | |
} | |
if (opts.supportedValues && opts.supportedValues.indexOf(string) < 0) { | |
throw ok(key, string, opts.supportedValues); | |
} | |
} | |
}), "none" !== o.encryptionType) { | |
if (!o.keystore) { | |
throw assert("keystore"); | |
} | |
o.keystore = (0, _noframeworkWaypoints2.default)(o.keystore); | |
} | |
return o; | |
} | |
/** | |
* @param {?} index | |
* @param {?} callback | |
* @return {undefined} | |
*/ | |
function render(index, callback) { | |
if (!(0, global.isObject)(index)) { | |
throw new Error("An options object was not supplied"); | |
} | |
if (!(0, global.isFunction)(callback)) { | |
throw new Error("A setup callback was not supplied"); | |
} | |
var self = create(index); | |
/** @type {(Element|null)} */ | |
var body = document.querySelector(self.container); | |
if (!body) { | |
throw new Error("Container cannot be located."); | |
} | |
/** @type {string} */ | |
body.style.overflow = "hidden"; | |
var info = (0, _classlist2.default)(self.keyId) ? _prepareStyleProperties2.default.prod : _prepareStyleProperties2.default.cas; | |
var data = init(info.iframe, self.keyId); | |
body.appendChild(data); | |
var options = new _Complex2.default(data.contentWindow, info.origin, info.origin); | |
/** @type {(null|number)} */ | |
var i = self.timeout > 0 ? setTimeout(function() { | |
run(body, options, i, callback); | |
}, self.timeout) : null; | |
/** | |
* @param {?} allowEmail | |
* @param {?} callback | |
* @return {undefined} | |
*/ | |
var update = function(allowEmail, callback) { | |
options.unsubscribeAll(); | |
options.subscribe(_UiRippleInk.postMessagesFromChild.HANDSHAKE_COMPLETE, function() { | |
if (i) { | |
clearTimeout(i); | |
} | |
options.unsubscribeAll(); | |
callback(null, new _deepAssign2.default(body, data, self.label, options)); | |
}); | |
callback(self); | |
}; | |
options.subscribe(_UiRippleInk.postMessagesFromChild.HANDSHAKE_INIT, update); | |
} | |
Object.defineProperty(exports, "__esModule", { | |
value : true | |
}); | |
/** @type {function(?): ?} */ | |
var check = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(type) { | |
return typeof type; | |
} : function(obj) { | |
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | |
}; | |
/** @type {function(?, ?): undefined} */ | |
exports.default = render; | |
var _UiIcon = __webpack_require__(2); | |
var _UiIcon2 = _interopRequireDefault(_UiIcon); | |
var _Complex = __webpack_require__(6); | |
var _Complex2 = _interopRequireDefault(_Complex); | |
var _normalizeDataUri = __webpack_require__(4); | |
var _normalizeDataUri2 = _interopRequireDefault(_normalizeDataUri); | |
var global = __webpack_require__(0); | |
var _classlist = __webpack_require__(7); | |
var _classlist2 = _interopRequireDefault(_classlist); | |
var _UiRippleInk = __webpack_require__(1); | |
var _noframeworkWaypoints = __webpack_require__(193); | |
var _noframeworkWaypoints2 = _interopRequireDefault(_noframeworkWaypoints); | |
var _prepareStyleProperties = __webpack_require__(194); | |
var _prepareStyleProperties2 = _interopRequireDefault(_prepareStyleProperties); | |
var _deepAssign = __webpack_require__(195); | |
var _deepAssign2 = _interopRequireDefault(_deepAssign); | |
var defaults = { | |
encryptionType : "rsaoaep256", | |
autocomplete : true, | |
cardDetection : true, | |
timeout : 12E4 | |
}; | |
var types = { | |
string : "string", | |
object : "object", | |
boolean : "boolean", | |
number : "number" | |
}; | |
var options = { | |
container : { | |
type : types.string, | |
required : true | |
}, | |
keyId : { | |
type : types.string, | |
required : true | |
}, | |
keystore : { | |
type : types.object, | |
required : false | |
}, | |
label : { | |
type : types.string, | |
required : false | |
}, | |
placeholder : { | |
type : types.string, | |
required : false | |
}, | |
styles : { | |
type : types.object, | |
required : false | |
}, | |
cardDetection : { | |
type : types.boolean, | |
required : false | |
}, | |
autocomplete : { | |
type : types.boolean, | |
required : false | |
}, | |
timeout : { | |
type : types.number, | |
required : false | |
}, | |
encryptionType : { | |
type : types.string, | |
required : false, | |
supportedValues : _UiRippleInk.encryptionTypes | |
} | |
}; | |
}, | |
193 : function(letter, e, n) { | |
Object.defineProperty(e, "__esModule", { | |
value : true | |
}); | |
var i = n(0); | |
/** | |
* @param {!Object} value | |
* @return {?} | |
*/ | |
e.default = function(value) { | |
var key = void 0; | |
if ((0, i.isString)(value)) { | |
try { | |
/** @type {*} */ | |
key = JSON.parse(value); | |
} catch (e) { | |
throw new Error("Could not parse supplied keystore string"); | |
} | |
} else { | |
if (!(0, i.isObject)(value)) { | |
throw new Error('Invalid "keystore" supplied'); | |
} | |
/** @type {!Object} */ | |
key = value; | |
} | |
if (null == key.kid) { | |
throw new Error("No kid supplied"); | |
} | |
return key; | |
}; | |
}, | |
194 : function(value, global, delayedFunctionSchedulerFactory) { | |
Object.defineProperty(global, "__esModule", { | |
value : true | |
}); | |
var selector = delayedFunctionSchedulerFactory(3); | |
var attrs = function(obj) { | |
return obj && obj.__esModule ? obj : { | |
default : obj | |
}; | |
}(selector); | |
/** @type {string} */ | |
var managementcommandsdns = "https://testflex.cybersource.com"; | |
/** @type {string} */ | |
var siteName = "/cybersource/assets/microform/" + attrs.default + "/iframe.html"; | |
global.default = { | |
cas : { | |
origin : managementcommandsdns, | |
iframe : managementcommandsdns + siteName | |
}, | |
prod : { | |
origin : "https://flex.cybersource.com", | |
iframe : "https://flex.cybersource.com" + siteName | |
} | |
}; | |
}, | |
195 : function(cond, t, __webpack_require__) { | |
/** | |
* @param {!Object} obj | |
* @return {?} | |
*/ | |
function _interopRequireDefault(obj) { | |
return obj && obj.__esModule ? obj : { | |
default : obj | |
}; | |
} | |
/** | |
* @param {!Object} obj | |
* @param {string} key | |
* @param {!Object} value | |
* @return {?} | |
*/ | |
function send(obj, key, value) { | |
return key in obj ? Object.defineProperty(obj, key, { | |
value : value, | |
enumerable : true, | |
configurable : true, | |
writable : true | |
}) : obj[key] = value, obj; | |
} | |
/** | |
* @param {!AudioNode} cb | |
* @param {!Function} options | |
* @return {undefined} | |
*/ | |
function _get(cb, options) { | |
if (!(cb instanceof options)) { | |
throw new TypeError("Cannot call a class as a function"); | |
} | |
} | |
/** | |
* @param {!Object} event | |
* @param {!Element} data | |
* @param {?} rowId | |
* @return {undefined} | |
*/ | |
function apply(event, data, rowId) { | |
event.subscribe(scope.jsEvents.FOCUS, function() { | |
(0, isFunction_1.clearCurrentSelection)(); | |
data.classList.add(scope.cssClasses.FOCUSED); | |
}); | |
event.subscribe(scope.jsEvents.BLUR, function(e) { | |
data.classList.remove(scope.cssClasses.FOCUSED); | |
(0, _UiIcon2.default)(rowId, e); | |
}); | |
event.subscribe(scope.jsEvents.ENABLE, function() { | |
data.classList.remove(scope.cssClasses.DISABLED); | |
}); | |
event.subscribe(scope.jsEvents.DISABLE, function() { | |
data.classList.add(scope.cssClasses.DISABLED); | |
}); | |
event.subscribe(scope.jsEvents.VALIDATION_CHANGE, function(cidr) { | |
if (cidr.valid) { | |
data.classList.remove(scope.cssClasses.INVALID); | |
data.classList.add(scope.cssClasses.VALID); | |
} else { | |
if (cidr.couldBeValid) { | |
data.classList.remove(scope.cssClasses.INVALID); | |
data.classList.remove(scope.cssClasses.VALID); | |
} else { | |
data.classList.remove(scope.cssClasses.VALID); | |
data.classList.add(scope.cssClasses.INVALID); | |
} | |
} | |
}); | |
event.subscribe(scope.jsEvents.AUTOCOMPLETE, function() { | |
data.classList.add(scope.cssClasses.AUTOCOMPLETE); | |
}); | |
event.subscribe(scope.jsEvents.AUTOCOMPLETE_CHANGE, function() { | |
data.classList.remove(scope.cssClasses.AUTOCOMPLETE); | |
}); | |
} | |
/** | |
* @param {!Object} event | |
* @param {!Object} $el | |
* @return {undefined} | |
*/ | |
function subscribeToSystemEvents(event, $el) { | |
event.subscribe(scope.postMessagesFromChild.FOCUS, function() { | |
$el.publish(scope.jsEvents.FOCUS); | |
}); | |
event.subscribe(scope.postMessagesFromChild.BLUR, function(range) { | |
$el.publish(scope.jsEvents.BLUR, range); | |
}); | |
event.subscribe(scope.postMessagesFromChild.ENABLE, function() { | |
$el.publish(scope.jsEvents.ENABLE); | |
}); | |
event.subscribe(scope.postMessagesFromChild.DISABLE, function() { | |
$el.publish(scope.jsEvents.DISABLE); | |
}); | |
event.subscribe(scope.postMessagesFromChild.EMPTY, function() { | |
$el.publish(scope.jsEvents.EMPTY); | |
}); | |
event.subscribe(scope.postMessagesFromChild.NOT_EMPTY, function() { | |
$el.publish(scope.jsEvents.NOT_EMPTY); | |
}); | |
event.subscribe(scope.postMessagesFromChild.CARD_CHANGE_TYPE, function(range) { | |
$el.publish(scope.jsEvents.CARD_TYPE_CHANGE, range); | |
}); | |
event.subscribe(scope.postMessagesFromChild.VALIDATION_CHANGE, function(range) { | |
$el.publish(scope.jsEvents.VALIDATION_CHANGE, range); | |
}); | |
event.subscribe(scope.postMessagesFromChild.INPUT_SUBMIT_REQUEST, function() { | |
$el.publish(scope.jsEvents.INPUT_SUBMIT_REQUEST); | |
}); | |
event.subscribe(scope.postMessagesFromChild.TOKENIZE_LOAD_START, function() { | |
$el.publish(scope.jsEvents.TOKENIZE_LOAD_START); | |
}); | |
event.subscribe(scope.postMessagesFromChild.AUTOCOMPLETE, function(range) { | |
$el.publish(scope.jsEvents.AUTOCOMPLETE, range); | |
}); | |
event.subscribe(scope.postMessagesFromChild.AUTOCOMPLETE_CHANGE, function() { | |
$el.publish(scope.jsEvents.AUTOCOMPLETE_CHANGE); | |
}); | |
} | |
Object.defineProperty(t, "__esModule", { | |
value : true | |
}); | |
t.default = void 0; | |
var eqPartial = function() { | |
/** | |
* @param {!Function} d | |
* @param {string} props | |
* @return {undefined} | |
*/ | |
function t(d, props) { | |
/** @type {number} */ | |
var i = 0; | |
for (; i < props.length; i++) { | |
var descriptor = props[i]; | |
descriptor.enumerable = descriptor.enumerable || false; | |
/** @type {boolean} */ | |
descriptor.configurable = true; | |
if ("value" in descriptor) { | |
/** @type {boolean} */ | |
descriptor.writable = true; | |
} | |
Object.defineProperty(d, descriptor.key, descriptor); | |
} | |
} | |
return function(p, n, a) { | |
return n && t(p.prototype, n), a && t(p, a), p; | |
}; | |
}(); | |
var _prepareStyleProperties = __webpack_require__(2); | |
var _prepareStyleProperties2 = _interopRequireDefault(_prepareStyleProperties); | |
var _deepAssign = __webpack_require__(4); | |
var _deepAssign2 = _interopRequireDefault(_deepAssign); | |
var isFunction_1 = __webpack_require__(0); | |
var scope = __webpack_require__(1); | |
var _normalizeDataUri = __webpack_require__(196); | |
var _normalizeDataUri2 = _interopRequireDefault(_normalizeDataUri); | |
var _UiIcon = __webpack_require__(197); | |
var _UiIcon2 = _interopRequireDefault(_UiIcon); | |
/** | |
* @param {?} expr | |
* @return {?} | |
*/ | |
var $ = function(expr) { | |
return document.querySelectorAll(expr); | |
}; | |
/** | |
* @param {?} e | |
* @param {!Function} d | |
* @return {undefined} | |
*/ | |
var g = function(e, d) { | |
var hideElements = $(e); | |
/** @type {number} */ | |
var i = 0; | |
for (; i < hideElements.length; i = i + 1) { | |
hideElements[i].addEventListener("click", d); | |
} | |
}; | |
/** | |
* @param {?} data | |
* @param {?} fn | |
* @return {undefined} | |
*/ | |
var A = function(data, fn) { | |
var divs = $(data); | |
/** @type {number} */ | |
var i = 0; | |
for (; i < divs.length; i = i + 1) { | |
divs[i].removeEventListener("click", fn); | |
} | |
}; | |
var offsetFromCenter = function() { | |
/** | |
* @param {!Node} container | |
* @param {!HTMLElement} canvas | |
* @param {?} lagOffset | |
* @param {!Object} customAudiences | |
* @return {undefined} | |
*/ | |
function render(container, canvas, lagOffset, customAudiences) { | |
var inlineEditor2 = this; | |
_get(this, render); | |
/** @type {!Node} */ | |
this.container = container; | |
/** @type {!HTMLElement} */ | |
this.iframe = canvas; | |
/** @type {!Object} */ | |
this.telegram = customAudiences; | |
this.pubSub = new _normalizeDataUri2.default; | |
apply(this.pubSub, this.container, this.iframe); | |
subscribeToSystemEvents(this.telegram, this.pubSub); | |
if (lagOffset) { | |
this.labelSelector = lagOffset; | |
/** | |
* @param {!Event} event | |
* @return {undefined} | |
*/ | |
this.labelClickHandler = function(event) { | |
event.preventDefault(); | |
inlineEditor2.focus(); | |
}; | |
g(this.labelSelector, this.labelClickHandler); | |
} | |
} | |
return eqPartial(render, [{ | |
key : "focus", | |
value : function() { | |
this.telegram.publish(scope.postMessagesFromParent.FOCUS); | |
} | |
}, { | |
key : "clear", | |
value : function() { | |
this.telegram.publish(scope.postMessagesFromParent.CLEAR); | |
} | |
}, { | |
key : "enable", | |
value : function() { | |
var canvas = this; | |
this.telegram.publish(scope.postMessagesFromParent.ENABLE, null, function() { | |
canvas.iframe.removeAttribute("tabindex"); | |
}); | |
} | |
}, { | |
key : "disable", | |
value : function() { | |
/** @type {number} */ | |
this.iframe.tabIndex = -1; | |
this.telegram.publish(scope.postMessagesFromParent.DISABLE); | |
} | |
}, { | |
key : "setPlaceholder", | |
value : function(text) { | |
this.telegram.publish(scope.postMessagesFromParent.SET_PLACEHOLDER, { | |
text : text || "" | |
}); | |
} | |
}, { | |
key : "on", | |
value : function(message, fn) { | |
if (!(scope.jsEventsList.indexOf(message) >= 0)) { | |
throw new _deepAssign2.default({ | |
message : "Unsupported event type", | |
details : { | |
event : message | |
} | |
}); | |
} | |
this.pubSub.subscribe(message, fn); | |
} | |
}, { | |
key : "off", | |
value : function(token, fn) { | |
this.pubSub.unsubscribe(token, fn); | |
} | |
}, { | |
key : "createToken", | |
value : function(fields, defaults) { | |
if (!(0, isFunction_1.isFunction)(defaults)) { | |
throw new _deepAssign2.default({ | |
message : "A response handler has not been supplied" | |
}); | |
} | |
/** @type {!Array} */ | |
var OPEN_BODY = ["cardType", "cardExpirationMonth", "cardExpirationYear"]; | |
var limit = Object.keys(fields).reduce(function(mmCoreSplitViewBlock, c) { | |
return OPEN_BODY.indexOf(c) > -1 && (0, _prepareStyleProperties2.default)(mmCoreSplitViewBlock, send({}, c, fields[c])), mmCoreSplitViewBlock; | |
}, {}); | |
/** | |
* @param {!Object} data | |
* @return {undefined} | |
*/ | |
var check = function(data) { | |
if (data.error) { | |
defaults(new _deepAssign2.default({ | |
message : "Tokens response error", | |
details : data.error | |
})); | |
} else { | |
defaults(null, data); | |
} | |
}; | |
this.telegram.publish(scope.postMessagesFromParent.TOKENIZE, limit, check); | |
} | |
}, { | |
key : "teardown", | |
value : function(onstep) { | |
/** @type {string} */ | |
this.container.innerHTML = ""; | |
this.telegram.teardown(); | |
this.pubSub.unsubscribeAll(); | |
if (this.labelSelector) { | |
A(this.labelSelector, this.labelClickHandler); | |
} | |
/** @type {null} */ | |
this.telegram = null; | |
/** @type {null} */ | |
this.pubSub = null; | |
if (onstep) { | |
onstep(); | |
} | |
} | |
}]), render; | |
}(); | |
t.default = offsetFromCenter; | |
}, | |
196 : function(module, exports, __weex_require__) { | |
/** | |
* @return {?} | |
*/ | |
function EventHandler() { | |
var e = {}; | |
return clipboard.jsEventsList.forEach(function(childProp) { | |
/** @type {!Array} */ | |
e[childProp] = []; | |
}), { | |
subscribe : function(val, callback) { | |
if (!(0, modal.isFunction)(callback)) { | |
throw new Error("handler not a function."); | |
} | |
return clipboard.jsEventsList.indexOf(val) < 0 ? (console.warn("Unsupported event < " + val + " >"), this) : (e[val].push(callback), this); | |
}, | |
unsubscribe : function(name, obj) { | |
if (!(0, modal.isFunction)(obj)) { | |
throw new Error("handler not a function."); | |
} | |
var indexSticky = e[name].indexOf(obj); | |
return ~indexSticky && e[name].splice(indexSticky, 1), this; | |
}, | |
unsubscribeAll : function() { | |
return e = {}, this; | |
}, | |
publish : function(event) { | |
var fileInfo = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; | |
return clipboard.jsEventsList.indexOf(event) < 0 ? (console.warn("Unsupported event < " + event + " >"), this) : (e.hasOwnProperty.call(e, event) && e[event].forEach(function($) { | |
$(fileInfo); | |
}), this); | |
} | |
}; | |
} | |
Object.defineProperty(exports, "__esModule", { | |
value : true | |
}); | |
/** @type {function(): ?} */ | |
exports.default = EventHandler; | |
var modal = __weex_require__(0); | |
var clipboard = __weex_require__(1); | |
}, | |
197 : function(cond, t, xgh2) { | |
Object.defineProperty(t, "__esModule", { | |
value : true | |
}); | |
/** | |
* @param {?} y | |
* @param {?} keys | |
* @return {undefined} | |
*/ | |
t.default = function(y, keys) { | |
if (keys.focusShift && ("next" === keys.focusShift || "previous" === keys.focusShift)) { | |
/** @type {!Array<?>} */ | |
var ds = Array.prototype.slice.call(document.querySelectorAll(sel)).filter(function(selectEl) { | |
var tabIndex = selectEl.getAttribute("tabindex"); | |
var cssChanges = selectEl.getBoundingClientRect(); | |
return (!tabIndex || parseInt(tabIndex, 10) >= 0) && (cssChanges.width > 0 && cssChanges.height > 0 || "AREA" === selectEl.tagName); | |
}); | |
/** @type {number} */ | |
var j = ds.indexOf(y) + ("previous" === keys.focusShift ? -1 : 1); | |
if (j >= 0) { | |
ds[j].focus(); | |
} | |
} | |
}; | |
/** @type {!Array} */ | |
var ignoreTags = ["a[href]", "area[href]", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", "button:not([disabled])", "object", "embed", "iframe", "*[tabindex]", "*[contenteditable]"]; | |
/** @type {string} */ | |
var sel = ignoreTags.join(", "); | |
}, | |
2 : function(mixin, args, parseAsUTC) { | |
/** | |
* @param {!Array} obj | |
* @return {?} | |
*/ | |
function toObject(obj) { | |
if (null === obj || void 0 === obj) { | |
throw new TypeError("Object.assign cannot be called with null or undefined"); | |
} | |
return Object(obj); | |
} | |
/** @type {function(!Object): !Array<?>} */ | |
var ownSymbols = Object.getOwnPropertySymbols; | |
/** @type {function(this:Object, *): boolean} */ | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
/** @type {function(this:Object, string): boolean} */ | |
var fn = Object.prototype.propertyIsEnumerable; | |
/** @type {!Function} */ | |
mixin.exports = function() { | |
try { | |
if (!Object.assign) { | |
return false; | |
} | |
/** @type {!String} */ | |
var test1 = new String("abc"); | |
if (test1[5] = "de", "5" === Object.getOwnPropertyNames(test1)[0]) { | |
return false; | |
} | |
var map = {}; | |
/** @type {number} */ | |
var i = 0; | |
for (; i < 10; i++) { | |
/** @type {number} */ | |
map["_" + String.fromCharCode(i)] = i; | |
} | |
if ("0123456789" !== Object.getOwnPropertyNames(map).map(function(oldOrient) { | |
return map[oldOrient]; | |
}).join("")) { | |
return false; | |
} | |
var b = {}; | |
return "abcdefghijklmnopqrst".split("").forEach(function(gid) { | |
/** @type {string} */ | |
b[gid] = gid; | |
}), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, b)).join(""); | |
} catch (e) { | |
return false; | |
} | |
}() ? Object.assign : function(target, end_time) { | |
var obj; | |
var keys; | |
var to = toObject(target); | |
/** @type {number} */ | |
var i = 1; | |
for (; i < arguments.length; i++) { | |
/** @type {!Object} */ | |
obj = Object(arguments[i]); | |
var key; | |
for (key in obj) { | |
if (hasOwnProperty.call(obj, key)) { | |
to[key] = obj[key]; | |
} | |
} | |
if (ownSymbols) { | |
/** @type {!Array<?>} */ | |
keys = ownSymbols(obj); | |
/** @type {number} */ | |
var i = 0; | |
for (; i < keys.length; i++) { | |
if (fn.call(obj, keys[i])) { | |
to[keys[i]] = obj[keys[i]]; | |
} | |
} | |
} | |
} | |
return to; | |
}; | |
}, | |
3 : function(cond, t, xgh2) { | |
Object.defineProperty(t, "__esModule", { | |
value : true | |
}); | |
/** @type {string} */ | |
t.default = "0.4.0"; | |
}, | |
4 : function(cond, t, xgh2) { | |
/** | |
* @return {undefined} | |
*/ | |
function UnsupportedError() { | |
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; | |
if (!e.message) { | |
throw new Error("Error message required"); | |
} | |
/** @type {string} */ | |
this.name = "MicroformError"; | |
this.message = e.message; | |
this.details = e.details; | |
} | |
Object.defineProperty(t, "__esModule", { | |
value : true | |
}); | |
/** @type {!Object} */ | |
UnsupportedError.prototype = Object.create(Error.prototype); | |
/** @type {function(): undefined} */ | |
UnsupportedError.prototype.constructor = UnsupportedError; | |
/** @type {function(): undefined} */ | |
t.default = UnsupportedError; | |
}, | |
6 : function(Database, Config, callback) { | |
/** | |
* @param {!Worker} options | |
* @return {?} | |
*/ | |
function initialize(options) { | |
/** | |
* @param {string} event | |
* @param {!Function} message | |
* @return {?} | |
*/ | |
function open(event, message) { | |
var index = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : store; | |
return !!(0, value.isString)(event) && (!!(0, value.isFunction)(message) && (data[index] || (data[index] = {}), data[index][event] || (data[index][event] = []), data[index][event].push(message), true)); | |
} | |
/** | |
* @param {?} id | |
* @param {!Function} object | |
* @return {?} | |
*/ | |
function unsubscribe(id, object) { | |
var index = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : store; | |
if (data[index] && data[index][id]) { | |
return false; | |
} | |
var items = data[index][id]; | |
if (!items) { | |
return false; | |
} | |
/** @type {number} */ | |
var i = 0; | |
for (; i < items.length; i = i + 1) { | |
if (items[i] === object) { | |
return items.splice(i, 1), true; | |
} | |
} | |
return false; | |
} | |
/** | |
* @param {!Function} func | |
* @return {?} | |
*/ | |
function create(func) { | |
var name = (0, value.uuid)(); | |
return open(name, function channel(key) { | |
unsubscribe(name, channel); | |
func(key); | |
}), name; | |
} | |
/** | |
* @param {string} event | |
* @param {!Object} data | |
* @param {!Function} callback | |
* @return {?} | |
*/ | |
function end(event, data, callback) { | |
var message = { | |
event : event, | |
contentType : contentType, | |
sender : socketWrapper1, | |
data : data || {} | |
}; | |
return "function" == typeof callback && (message.reply = create(callback)), message; | |
} | |
/** | |
* @param {!Object} message | |
* @return {?} | |
*/ | |
function _getHandleMessage(message) { | |
return function(args, callback) { | |
var result = end(message.data.reply, args, callback); | |
message.source.postMessage(result, message.origin); | |
}; | |
} | |
/** | |
* @param {string} n | |
* @param {?} p | |
* @param {!Array} r | |
* @param {!Object} v | |
* @return {undefined} | |
*/ | |
function cb(n, p, r, v) { | |
if (data[n] && data[n][p]) { | |
var solidsLength = data[n][p].length; | |
/** @type {number} */ | |
var s = 0; | |
for (; s < solidsLength; s = s + 1) { | |
data[n][p][s].apply(v, r); | |
} | |
} | |
} | |
/** | |
* @param {!Object} e | |
* @return {undefined} | |
*/ | |
function initialize(e) { | |
var mayaK2Icon = e.origin || e.originalEvent.origin; | |
if ((0, value.isObject)(e.data) && e.data.contentType === contentType && "event" in e.data && !(!contentType.indexOf(e.data.event) < 0)) { | |
/** @type {!Array} */ | |
var result = [e.data.data || {}]; | |
if (e.data.reply) { | |
result.push(_getHandleMessage(e)); | |
} | |
cb("*", e.data.event, result, e); | |
cb(mayaK2Icon, e.data.event, result, e); | |
} | |
} | |
/** | |
* @return {undefined} | |
*/ | |
function callback() { | |
window.removeEventListener("message", initialize, false); | |
} | |
/** | |
* @param {string} event | |
* @param {!Object} c | |
* @param {!Function} callback | |
* @return {undefined} | |
*/ | |
function publish(event, c, callback) { | |
var host = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : cur; | |
var result = end(event, c, callback); | |
try { | |
client.postMessage(result, host); | |
} catch (deprecationWarning) { | |
console.warn("Could not post payload\n\n" + result + "\n\nto origin: " + host); | |
console.warn(deprecationWarning); | |
} | |
} | |
/** | |
* @return {?} | |
*/ | |
function now() { | |
return data = {}, true; | |
} | |
/** | |
* @return {undefined} | |
*/ | |
function clean() { | |
callback(); | |
now(); | |
} | |
var context = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "*"; | |
var __transitionAttrs__ = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "*"; | |
var data = {}; | |
var socketWrapper1 = (0, value.uuid)(); | |
/** @type {!Worker} */ | |
var client = options; | |
var cur = context; | |
var store = __transitionAttrs__; | |
return window.addEventListener("message", initialize, false), { | |
publish : publish, | |
subscribe : open, | |
unsubscribe : unsubscribe, | |
unsubscribeAll : now, | |
teardown : clean | |
}; | |
} | |
Object.defineProperty(Config, "__esModule", { | |
value : true | |
}); | |
/** @type {function(!Worker): ?} */ | |
Config.default = initialize; | |
var value = callback(0); | |
/** @type {string} */ | |
var contentType = "application/x-telegram+json"; | |
}, | |
7 : function(cond, t, xgh2) { | |
/** | |
* @param {?} selector | |
* @return {?} | |
*/ | |
function clickWithWebdriver(selector) { | |
return /^(01|02|03|04).{30}$/.test(selector); | |
} | |
Object.defineProperty(t, "__esModule", { | |
value : true | |
}); | |
/** @type {function(?): ?} */ | |
t.default = clickWithWebdriver; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment