/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./src/index.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/babel-runtime/regenerator/index.js": /*!*********************************************************!*\ !*** ./node_modules/babel-runtime/regenerator/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime-module.js"); /***/ }), /***/ "./node_modules/base64-js/index.js": /*!*****************************************!*\ !*** ./node_modules/base64-js/index.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.byteLength = byteLength exports.toByteArray = toByteArray exports.fromByteArray = fromByteArray var lookup = [] var revLookup = [] var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' for (var i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i] revLookup[code.charCodeAt(i)] = i } // Support decoding URL-safe base64 strings, as Node.js does. // See: https://en.wikipedia.org/wiki/Base64#URL_applications revLookup['-'.charCodeAt(0)] = 62 revLookup['_'.charCodeAt(0)] = 63 function getLens (b64) { var len = b64.length if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 var validLen = b64.indexOf('=') if (validLen === -1) validLen = len var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4) return [validLen, placeHoldersLen] } // base64 is 4/3 + up to two characters of the original data function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function _byteLength (b64, validLen, placeHoldersLen) { return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function toByteArray (b64) { var tmp var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) var curByte = 0 // if there are placeholders, only get up to the last complete 4 chars var len = placeHoldersLen > 0 ? validLen - 4 : validLen var i for (i = 0; i < len; i += 4) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[curByte++] = (tmp >> 16) & 0xFF arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 2) { tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 1) { tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) output.push(tripletToBase64(tmp)) } return output.join('') } function fromByteArray (uint8) { var tmp var len = uint8.length var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes var parts = [] var maxChunkLength = 16383 // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk( uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) )) } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] parts.push( lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3F] + '==' ) } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1] parts.push( lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3F] + lookup[(tmp << 2) & 0x3F] + '=' ) } return parts.join('') } /***/ }), /***/ "./node_modules/buffer/index.js": /*!**************************************!*\ !*** ./node_modules/buffer/index.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js") var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js") var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js") exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Use Object implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * Due to various browser bugs, sometimes the Object implementation will be used even * when the browser supports typed arrays. * * Note: * * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. * * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. * * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of * incorrect length in some situations. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they * get the Object implementation, which is slower but behaves correctly. */ Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport() /* * Export kMaxLength after typed array support is determined. */ exports.kMaxLength = kMaxLength() function typedArraySupport () { try { var arr = new Uint8Array(1) arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} return arr.foo() === 42 && // typed array instances can be augmented typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` } catch (e) { return false } } function kMaxLength () { return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff } function createBuffer (that, length) { if (kMaxLength() < length) { throw new RangeError('Invalid typed array length') } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = new Uint8Array(length) that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class if (that === null) { that = new Buffer(length) } that.length = length } return that } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer (arg, encodingOrOffset, length) { if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { return new Buffer(arg, encodingOrOffset, length) } // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new Error( 'If encoding is specified then the first argument must be a string' ) } return allocUnsafe(this, arg) } return from(this, arg, encodingOrOffset, length) } Buffer.poolSize = 8192 // not used by this implementation // TODO: Legacy, not needed anymore. Remove in next major version. Buffer._augment = function (arr) { arr.__proto__ = Buffer.prototype return arr } function from (that, value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('"value" argument must not be a number') } if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { return fromArrayBuffer(that, value, encodingOrOffset, length) } if (typeof value === 'string') { return fromString(that, value, encodingOrOffset) } return fromObject(that, value) } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(null, value, encodingOrOffset, length) } if (Buffer.TYPED_ARRAY_SUPPORT) { Buffer.prototype.__proto__ = Uint8Array.prototype Buffer.__proto__ = Uint8Array if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) { // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 Object.defineProperty(Buffer, Symbol.species, { value: null, configurable: true }) } } function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number') } else if (size < 0) { throw new RangeError('"size" argument must not be negative') } } function alloc (that, size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(that, size) } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpretted as a start offset. return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill) } return createBuffer(that, size) } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(null, size, fill, encoding) } function allocUnsafe (that, size) { assertSize(size) that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) if (!Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < size; ++i) { that[i] = 0 } } return that } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(null, size) } /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(null, size) } function fromString (that, string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('"encoding" must be a valid string encoding') } var length = byteLength(string, encoding) | 0 that = createBuffer(that, length) var actual = that.write(string, encoding) if (actual !== length) { // Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') that = that.slice(0, actual) } return that } function fromArrayLike (that, array) { var length = array.length < 0 ? 0 : checked(array.length) | 0 that = createBuffer(that, length) for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 } return that } function fromArrayBuffer (that, array, byteOffset, length) { array.byteLength // this throws if `array` is not a valid ArrayBuffer if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('\'offset\' is out of bounds') } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('\'length\' is out of bounds') } if (byteOffset === undefined && length === undefined) { array = new Uint8Array(array) } else if (length === undefined) { array = new Uint8Array(array, byteOffset) } else { array = new Uint8Array(array, byteOffset, length) } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = array that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class that = fromArrayLike(that, array) } return that } function fromObject (that, obj) { if (Buffer.isBuffer(obj)) { var len = checked(obj.length) | 0 that = createBuffer(that, len) if (that.length === 0) { return that } obj.copy(that, 0, 0, len) return that } if (obj) { if ((typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer) || 'length' in obj) { if (typeof obj.length !== 'number' || isnan(obj.length)) { return createBuffer(that, 0) } return fromArrayLike(that, obj) } if (obj.type === 'Buffer' && isArray(obj.data)) { return fromArrayLike(that, obj.data) } } throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') } function checked (length) { // Note: cannot use `length < kMaxLength()` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= kMaxLength()) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes') } return length | 0 } function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { return !!(b != null && b._isBuffer) } Buffer.compare = function compare (a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError('Arguments must be Buffers') } if (a === b) return 0 var x = a.length var y = b.length for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function isEncoding (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function concat (list, length) { if (!isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers') } if (list.length === 0) { return Buffer.alloc(0) } var i if (length === undefined) { length = 0 for (i = 0; i < list.length; ++i) { length += list[i].length } } var buffer = Buffer.allocUnsafe(length) var pos = 0 for (i = 0; i < list.length; ++i) { var buf = list[i] if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers') } buf.copy(buffer, pos) pos += buf.length } return buffer } function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { string = '' + string } var len = string.length if (len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false for (;;) { switch (encoding) { case 'ascii': case 'latin1': case 'binary': return len case 'utf8': case 'utf-8': case undefined: return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2 case 'hex': return len >>> 1 case 'base64': return base64ToBytes(string).length default: if (loweredCase) return utf8ToBytes(string).length // assume utf8 encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.byteLength = byteLength function slowToString (encoding, start, end) { var loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0 } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return '' } if (end === undefined || end > this.length) { end = this.length } if (end <= 0) { return '' } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0 start >>>= 0 if (end <= start) { return '' } if (!encoding) encoding = 'utf8' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'latin1': case 'binary': return latin1Slice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect // Buffer instances. Buffer.prototype._isBuffer = true function swap (b, n, m) { var i = b[n] b[n] = b[m] b[m] = i } Buffer.prototype.swap16 = function swap16 () { var len = this.length if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits') } for (var i = 0; i < len; i += 2) { swap(this, i, i + 1) } return this } Buffer.prototype.swap32 = function swap32 () { var len = this.length if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits') } for (var i = 0; i < len; i += 4) { swap(this, i, i + 3) swap(this, i + 1, i + 2) } return this } Buffer.prototype.swap64 = function swap64 () { var len = this.length if (len % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits') } for (var i = 0; i < len; i += 8) { swap(this, i, i + 7) swap(this, i + 1, i + 6) swap(this, i + 2, i + 5) swap(this, i + 3, i + 4) } return this } Buffer.prototype.toString = function toString () { var length = this.length | 0 if (length === 0) return '' if (arguments.length === 0) return utf8Slice(this, 0, length) return slowToString.apply(this, arguments) } Buffer.prototype.equals = function equals (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (this === b) return true return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.INSPECT_MAX_BYTES if (this.length > 0) { str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') if (this.length > max) str += ' ... ' } return '' } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (!Buffer.isBuffer(target)) { throw new TypeError('Argument must be a Buffer') } if (start === undefined) { start = 0 } if (end === undefined) { end = target ? target.length : 0 } if (thisStart === undefined) { thisStart = 0 } if (thisEnd === undefined) { thisEnd = this.length } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index') } if (thisStart >= thisEnd && start >= end) { return 0 } if (thisStart >= thisEnd) { return -1 } if (start >= end) { return 1 } start >>>= 0 end >>>= 0 thisStart >>>= 0 thisEnd >>>= 0 if (this === target) return 0 var x = thisEnd - thisStart var y = end - start var len = Math.min(x, y) var thisCopy = this.slice(thisStart, thisEnd) var targetCopy = target.slice(start, end) for (var i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i] y = targetCopy[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset = +byteOffset // Coerce to Number. if (isNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset if (byteOffset >= buffer.length) { if (dir) return -1 else byteOffset = buffer.length - 1 } else if (byteOffset < 0) { if (dir) byteOffset = 0 else return -1 } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding) } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(buffer, val, byteOffset, encoding, dir) } else if (typeof val === 'number') { val = val & 0xFF // Search for a byte value [0-255] if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) } throw new TypeError('val must be string, number or Buffer') } function arrayIndexOf (arr, val, byteOffset, encoding, dir) { var indexSize = 1 var arrLength = arr.length var valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toLowerCase() if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1 } indexSize = 2 arrLength /= 2 valLength /= 2 byteOffset /= 2 } } function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } } var i if (dir) { var foundIndex = -1 for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i if (i - foundIndex + 1 === valLength) return foundIndex * indexSize } else { if (foundIndex !== -1) i -= i - foundIndex foundIndex = -1 } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength for (i = byteOffset; i >= 0; i--) { var found = true for (var j = 0; j < valLength; j++) { if (read(arr, i + j) !== read(val, j)) { found = false break } } if (found) return i } } return -1 } Buffer.prototype.includes = function includes (val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1 } Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } // must be an even number of digits var strLen = string.length if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') if (length > strLen / 2) { length = strLen / 2 } for (var i = 0; i < length; ++i) { var parsed = parseInt(string.substr(i * 2, 2), 16) if (isNaN(parsed)) return i buf[offset + i] = parsed } return i } function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } function latin1Write (buf, string, offset, length) { return asciiWrite(buf, string, offset, length) } function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } Buffer.prototype.write = function write (string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8' length = this.length offset = 0 // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset length = this.length offset = 0 // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset | 0 if (isFinite(length)) { length = length | 0 if (encoding === undefined) encoding = 'utf8' } else { encoding = length length = undefined } // legacy write(string, encoding, offset, length) - remove in v0.13 } else { throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) } var remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' var loweredCase = false for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length) case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length) case 'ascii': return asciiWrite(this, string, offset, length) case 'latin1': case 'binary': return latin1Write(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.prototype.toJSON = function toJSON () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) var res = [] var i = start while (i < end) { var firstByte = buf[i] var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 : (firstByte > 0xBF) ? 2 : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte } break case 2: secondByte = buf[i + 1] if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) if (tempCodePoint > 0x7F) { codePoint = tempCodePoint } } break case 3: secondByte = buf[i + 1] thirdByte = buf[i + 2] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint } } break case 4: secondByte = buf[i + 1] thirdByte = buf[i + 2] fourthByte = buf[i + 3] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD bytesPerSequence = 1 } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000 res.push(codePoint >>> 10 & 0x3FF | 0xD800) codePoint = 0xDC00 | codePoint & 0x3FF } res.push(codePoint) i += bytesPerSequence } return decodeCodePointsArray(res) } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety var MAX_ARGUMENTS_LENGTH = 0x1000 function decodeCodePointsArray (codePoints) { var len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". var res = '' var i = 0 while (i < len) { res += String.fromCharCode.apply( String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) ) } return res } function asciiSlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F) } return ret } function latin1Slice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]) } return ret } function hexSlice (buf, start, end) { var len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len var out = '' for (var i = start; i < end; ++i) { out += toHex(buf[i]) } return out } function utf16leSlice (buf, start, end) { var bytes = buf.slice(start, end) var res = '' for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } return res } Buffer.prototype.slice = function slice (start, end) { var len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start var newBuf if (Buffer.TYPED_ARRAY_SUPPORT) { newBuf = this.subarray(start, end) newBuf.__proto__ = Buffer.prototype } else { var sliceLen = end - start newBuf = new Buffer(sliceLen, undefined) for (var i = 0; i < sliceLen; ++i) { newBuf[i] = this[i + start] } } return newBuf } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } return val } Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { checkOffset(offset, byteLength, this.length) } var val = this[offset + --byteLength] var mul = 1 while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul } return val } Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000) } Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]) } Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var i = byteLength var mul = 1 var val = this[offset + --i] while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return (this[offset]) return ((0xff - this[offset] + 1) * -1) } Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset] | (this[offset + 1] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset + 1] | (this[offset] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24) } Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]) } Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var mul = 1 var i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var i = byteLength - 1 var mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) this[offset] = (value & 0xff) return offset + 1 } function objectWriteUInt16 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> (littleEndian ? i : 1 - i) * 8 } } Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) } return offset + 2 } Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } return offset + 2 } function objectWriteUInt32 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffffffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff } } Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) this[offset] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, true) } return offset + 4 } Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } return offset + 4 } Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = 0 var mul = 1 var sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = byteLength - 1 var mul = 1 var sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) if (value < 0) value = 0xff + value + 1 this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) } return offset + 2 } Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } return offset + 2 } Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) } else { objectWriteUInt32(this, value, offset, true) } return offset + 4 } Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } return offset + 4 } function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (!start) start = 0 if (!end && end !== 0) end = this.length if (targetStart >= target.length) targetStart = target.length if (!targetStart) targetStart = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || this.length === 0) return 0 // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds') } if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') if (end < 0) throw new RangeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - targetStart < end - start) { end = target.length - targetStart + start } var len = end - start var i if (this === target && start < targetStart && targetStart < end) { // descending copy from end for (i = len - 1; i >= 0; --i) { target[i + targetStart] = this[i + start] } } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { // ascending copy from start for (i = 0; i < len; ++i) { target[i + targetStart] = this[i + start] } } else { Uint8Array.prototype.set.call( target, this.subarray(start, start + len), targetStart ) } return len } // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill (val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = this.length } else if (typeof end === 'string') { encoding = end end = this.length } if (val.length === 1) { var code = val.charCodeAt(0) if (code < 256) { val = code } } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } } else if (typeof val === 'number') { val = val & 255 } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index') } if (end <= start) { return this } start = start >>> 0 end = end === undefined ? this.length : end >>> 0 if (!val) val = 0 var i if (typeof val === 'number') { for (i = start; i < end; ++i) { this[i] = val } } else { var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString()) var len = bytes.length for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len] } } return this } // HELPER FUNCTIONS // ================ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g function base64clean (str) { // Node strips out invalid characters like \n and \t from the string, base64-js does not str = stringtrim(str).replace(INVALID_BASE64_RE, '') // Node converts strings with length < 2 to '' if (str.length < 2) return '' // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function stringtrim (str) { if (str.trim) return str.trim() return str.replace(/^\s+|\s+$/g, '') } function toHex (n) { if (n < 16) return '0' + n.toString(16) return n.toString(16) } function utf8ToBytes (string, units) { units = units || Infinity var codePoint var length = string.length var leadSurrogate = null var bytes = [] for (var i = 0; i < length; ++i) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead leadSurrogate = codePoint continue } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } leadSurrogate = null // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break bytes.push(codePoint) } else if (codePoint < 0x800) { if ((units -= 2) < 0) break bytes.push( codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break bytes.push( codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break bytes.push( codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else { throw new Error('Invalid code point') } } return bytes } function asciiToBytes (str) { var byteArray = [] for (var i = 0; i < str.length; ++i) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str, units) { var c, hi, lo var byteArray = [] for (var i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } function blitBuffer (src, dst, offset, length) { for (var i = 0; i < length; ++i) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } function isnan (val) { return val !== val // eslint-disable-line no-self-compare } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) /***/ }), /***/ "./node_modules/ieee754/index.js": /*!***************************************!*\ !*** ./node_modules/ieee754/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var nBits = -7 var i = isLE ? (nBytes - 1) : 0 var d = isLE ? -1 : 1 var s = buffer[offset + i] i += d e = s & ((1 << (-nBits)) - 1) s >>= (-nBits) nBits += eLen for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1) e >>= (-nBits) nBits += mLen for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity) } else { m = m + Math.pow(2, mLen) e = e - eBias } return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { var e, m, c var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) var i = isLE ? 0 : (nBytes - 1) var d = isLE ? 1 : -1 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 value = Math.abs(value) if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0 e = eMax } else { e = Math.floor(Math.log(value) / Math.LN2) if (value * (c = Math.pow(2, -e)) < 1) { e-- c *= 2 } if (e + eBias >= 1) { value += rt / c } else { value += rt * Math.pow(2, 1 - eBias) } if (value * c >= 2) { e++ c /= 2 } if (e + eBias >= eMax) { m = 0 e = eMax } else if (e + eBias >= 1) { m = ((value * c) - 1) * Math.pow(2, mLen) e = e + eBias } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) e = 0 } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m eLen += mLen for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128 } /***/ }), /***/ "./node_modules/isarray/index.js": /*!***************************************!*\ !*** ./node_modules/isarray/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }), /***/ "./node_modules/less/dist/less.js": /*!****************************************!*\ !*** ./node_modules/less/dist/less.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(Buffer) {/** * Less - Leaner CSS v3.11.1 * http://lesscss.org * * Copyright (c) 2009-2020, Alexis Sellier * Licensed under the Apache-2.0 License. * * @license Apache-2.0 */ (function (global, factory) { true ? module.exports = factory() : undefined; }(this, (function () { 'use strict'; // Export a new default each time var defaultOptions = (function () { return ({ /* Inline Javascript - @plugin still allowed */ javascriptEnabled: false, /* Outputs a makefile import dependency list to stdout. */ depends: false, /* (DEPRECATED) Compress using less built-in compression. * This does an okay job but does not utilise all the tricks of * dedicated css compression. */ compress: false, /* Runs the less parser and just reports errors without any output. */ lint: false, /* Sets available include paths. * If the file in an @import rule does not exist at that exact location, * less will look for it at the location(s) passed to this option. * You might use this for instance to specify a path to a library which * you want to be referenced simply and relatively in the less files. */ paths: [], /* color output in the terminal */ color: true, /* The strictImports controls whether the compiler will allow an @import inside of either * @media blocks or (a later addition) other selector blocks. * See: https://github.com/less/less.js/issues/656 */ strictImports: false, /* Allow Imports from Insecure HTTPS Hosts */ insecure: false, /* Allows you to add a path to every generated import and url in your css. * This does not affect less import statements that are processed, just ones * that are left in the output css. */ rootpath: '', /* By default URLs are kept as-is, so if you import a file in a sub-directory * that references an image, exactly the same URL will be output in the css. * This option allows you to re-write URL's in imported files so that the * URL is always relative to the base imported file */ rewriteUrls: false, /* How to process math * 0 always - eagerly try to solve all operations * 1 parens-division - require parens for division "/" * 2 parens | strict - require parens for all operations * 3 strict-legacy - legacy strict behavior (super-strict) */ math: 0, /* Without this option, less attempts to guess at the output unit when it does maths. */ strictUnits: false, /* Effectively the declaration is put at the top of your base Less file, * meaning it can be used but it also can be overridden if this variable * is defined in the file. */ globalVars: null, /* As opposed to the global variable option, this puts the declaration at the * end of your base file, meaning it will override anything defined in your Less file. */ modifyVars: null, /* This option allows you to specify a argument to go on to every URL. */ urlArgs: '' }); }); function extractId(href) { return href.replace(/^[a-z-]+:\/+?[^\/]+/, '') // Remove protocol & domain .replace(/[\?\&]livereload=\w+/, '') // Remove LiveReload cachebuster .replace(/^\//, '') // Remove root / .replace(/\.[a-zA-Z]+$/, '') // Remove simple extension .replace(/[^\.\w-]+/g, '-') // Replace illegal characters .replace(/\./g, ':'); // Replace dots with colons(for valid id) } function addDataAttr(options, tag) { for (var opt in tag.dataset) { if (tag.dataset.hasOwnProperty(opt)) { if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') { options[opt] = tag.dataset[opt]; } else { try { options[opt] = JSON.parse(tag.dataset[opt]); } catch (_) { } } } } } var browser = { createCSS: function (document, styles, sheet) { // Strip the query-string var href = sheet.href || ''; // If there is no title set, use the filename, minus the extension var id = "less:" + (sheet.title || extractId(href)); // If this has already been inserted into the DOM, we may need to replace it var oldStyleNode = document.getElementById(id); var keepOldStyleNode = false; // Create a new stylesheet node for insertion or (if necessary) replacement var styleNode = document.createElement('style'); styleNode.setAttribute('type', 'text/css'); if (sheet.media) { styleNode.setAttribute('media', sheet.media); } styleNode.id = id; if (!styleNode.styleSheet) { styleNode.appendChild(document.createTextNode(styles)); // If new contents match contents of oldStyleNode, don't replace oldStyleNode keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 && oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue); } var head = document.getElementsByTagName('head')[0]; // If there is no oldStyleNode, just append; otherwise, only append if we need // to replace oldStyleNode with an updated stylesheet if (oldStyleNode === null || keepOldStyleNode === false) { var nextEl = sheet && sheet.nextSibling || null; if (nextEl) { nextEl.parentNode.insertBefore(styleNode, nextEl); } else { head.appendChild(styleNode); } } if (oldStyleNode && keepOldStyleNode === false) { oldStyleNode.parentNode.removeChild(oldStyleNode); } // For IE. // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash. // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head if (styleNode.styleSheet) { try { styleNode.styleSheet.cssText = styles; } catch (e) { throw new Error('Couldn\'t reassign styleSheet.cssText.'); } } }, currentScript: function (window) { var document = window.document; return document.currentScript || (function () { var scripts = document.getElementsByTagName('script'); return scripts[scripts.length - 1]; })(); } }; var addDefaultOptions = (function (window, options) { // use options from the current script tag data attribues addDataAttr(options, browser.currentScript(window)); if (options.isFileProtocol === undefined) { options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol); } // Load styles asynchronously (default: false) // // This is set to `false` by default, so that the body // doesn't start loading before the stylesheets are parsed. // Setting this to `true` can result in flickering. // options.async = options.async || false; options.fileAsync = options.fileAsync || false; // Interval between watch polls options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500); options.env = options.env || (window.location.hostname == '127.0.0.1' || window.location.hostname == '0.0.0.0' || window.location.hostname == 'localhost' || (window.location.port && window.location.port.length > 0) || options.isFileProtocol ? 'development' : 'production'); var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash); if (dumpLineNumbers) { options.dumpLineNumbers = dumpLineNumbers[1]; } if (options.useFileCache === undefined) { options.useFileCache = true; } if (options.onReady === undefined) { options.onReady = true; } if (options.relativeUrls) { options.rewriteUrls = 'all'; } }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } var colors = { 'aliceblue': '#f0f8ff', 'antiquewhite': '#faebd7', 'aqua': '#00ffff', 'aquamarine': '#7fffd4', 'azure': '#f0ffff', 'beige': '#f5f5dc', 'bisque': '#ffe4c4', 'black': '#000000', 'blanchedalmond': '#ffebcd', 'blue': '#0000ff', 'blueviolet': '#8a2be2', 'brown': '#a52a2a', 'burlywood': '#deb887', 'cadetblue': '#5f9ea0', 'chartreuse': '#7fff00', 'chocolate': '#d2691e', 'coral': '#ff7f50', 'cornflowerblue': '#6495ed', 'cornsilk': '#fff8dc', 'crimson': '#dc143c', 'cyan': '#00ffff', 'darkblue': '#00008b', 'darkcyan': '#008b8b', 'darkgoldenrod': '#b8860b', 'darkgray': '#a9a9a9', 'darkgrey': '#a9a9a9', 'darkgreen': '#006400', 'darkkhaki': '#bdb76b', 'darkmagenta': '#8b008b', 'darkolivegreen': '#556b2f', 'darkorange': '#ff8c00', 'darkorchid': '#9932cc', 'darkred': '#8b0000', 'darksalmon': '#e9967a', 'darkseagreen': '#8fbc8f', 'darkslateblue': '#483d8b', 'darkslategray': '#2f4f4f', 'darkslategrey': '#2f4f4f', 'darkturquoise': '#00ced1', 'darkviolet': '#9400d3', 'deeppink': '#ff1493', 'deepskyblue': '#00bfff', 'dimgray': '#696969', 'dimgrey': '#696969', 'dodgerblue': '#1e90ff', 'firebrick': '#b22222', 'floralwhite': '#fffaf0', 'forestgreen': '#228b22', 'fuchsia': '#ff00ff', 'gainsboro': '#dcdcdc', 'ghostwhite': '#f8f8ff', 'gold': '#ffd700', 'goldenrod': '#daa520', 'gray': '#808080', 'grey': '#808080', 'green': '#008000', 'greenyellow': '#adff2f', 'honeydew': '#f0fff0', 'hotpink': '#ff69b4', 'indianred': '#cd5c5c', 'indigo': '#4b0082', 'ivory': '#fffff0', 'khaki': '#f0e68c', 'lavender': '#e6e6fa', 'lavenderblush': '#fff0f5', 'lawngreen': '#7cfc00', 'lemonchiffon': '#fffacd', 'lightblue': '#add8e6', 'lightcoral': '#f08080', 'lightcyan': '#e0ffff', 'lightgoldenrodyellow': '#fafad2', 'lightgray': '#d3d3d3', 'lightgrey': '#d3d3d3', 'lightgreen': '#90ee90', 'lightpink': '#ffb6c1', 'lightsalmon': '#ffa07a', 'lightseagreen': '#20b2aa', 'lightskyblue': '#87cefa', 'lightslategray': '#778899', 'lightslategrey': '#778899', 'lightsteelblue': '#b0c4de', 'lightyellow': '#ffffe0', 'lime': '#00ff00', 'limegreen': '#32cd32', 'linen': '#faf0e6', 'magenta': '#ff00ff', 'maroon': '#800000', 'mediumaquamarine': '#66cdaa', 'mediumblue': '#0000cd', 'mediumorchid': '#ba55d3', 'mediumpurple': '#9370d8', 'mediumseagreen': '#3cb371', 'mediumslateblue': '#7b68ee', 'mediumspringgreen': '#00fa9a', 'mediumturquoise': '#48d1cc', 'mediumvioletred': '#c71585', 'midnightblue': '#191970', 'mintcream': '#f5fffa', 'mistyrose': '#ffe4e1', 'moccasin': '#ffe4b5', 'navajowhite': '#ffdead', 'navy': '#000080', 'oldlace': '#fdf5e6', 'olive': '#808000', 'olivedrab': '#6b8e23', 'orange': '#ffa500', 'orangered': '#ff4500', 'orchid': '#da70d6', 'palegoldenrod': '#eee8aa', 'palegreen': '#98fb98', 'paleturquoise': '#afeeee', 'palevioletred': '#d87093', 'papayawhip': '#ffefd5', 'peachpuff': '#ffdab9', 'peru': '#cd853f', 'pink': '#ffc0cb', 'plum': '#dda0dd', 'powderblue': '#b0e0e6', 'purple': '#800080', 'rebeccapurple': '#663399', 'red': '#ff0000', 'rosybrown': '#bc8f8f', 'royalblue': '#4169e1', 'saddlebrown': '#8b4513', 'salmon': '#fa8072', 'sandybrown': '#f4a460', 'seagreen': '#2e8b57', 'seashell': '#fff5ee', 'sienna': '#a0522d', 'silver': '#c0c0c0', 'skyblue': '#87ceeb', 'slateblue': '#6a5acd', 'slategray': '#708090', 'slategrey': '#708090', 'snow': '#fffafa', 'springgreen': '#00ff7f', 'steelblue': '#4682b4', 'tan': '#d2b48c', 'teal': '#008080', 'thistle': '#d8bfd8', 'tomato': '#ff6347', 'turquoise': '#40e0d0', 'violet': '#ee82ee', 'wheat': '#f5deb3', 'white': '#ffffff', 'whitesmoke': '#f5f5f5', 'yellow': '#ffff00', 'yellowgreen': '#9acd32' }; var unitConversions = { length: { 'm': 1, 'cm': 0.01, 'mm': 0.001, 'in': 0.0254, 'px': 0.0254 / 96, 'pt': 0.0254 / 72, 'pc': 0.0254 / 72 * 12 }, duration: { 's': 1, 'ms': 0.001 }, angle: { 'rad': 1 / (2 * Math.PI), 'deg': 1 / 360, 'grad': 1 / 400, 'turn': 1 } }; var data = { colors: colors, unitConversions: unitConversions }; var Node = /** @class */ (function () { function Node() { this.parent = null; this.visibilityBlocks = undefined; this.nodeVisible = undefined; this.rootNode = null; this.parsed = null; var self = this; Object.defineProperty(this, 'currentFileInfo', { get: function () { return self.fileInfo(); } }); Object.defineProperty(this, 'index', { get: function () { return self.getIndex(); } }); } Node.prototype.setParent = function (nodes, parent) { function set(node) { if (node && node instanceof Node) { node.parent = parent; } } if (Array.isArray(nodes)) { nodes.forEach(set); } else { set(nodes); } }; Node.prototype.getIndex = function () { return this._index || (this.parent && this.parent.getIndex()) || 0; }; Node.prototype.fileInfo = function () { return this._fileInfo || (this.parent && this.parent.fileInfo()) || {}; }; Node.prototype.isRulesetLike = function () { return false; }; Node.prototype.toCSS = function (context) { var strs = []; this.genCSS(context, { add: function (chunk, fileInfo, index) { strs.push(chunk); }, isEmpty: function () { return strs.length === 0; } }); return strs.join(''); }; Node.prototype.genCSS = function (context, output) { output.add(this.value); }; Node.prototype.accept = function (visitor) { this.value = visitor.visit(this.value); }; Node.prototype.eval = function () { return this; }; Node.prototype._operate = function (context, op, a, b) { switch (op) { case '+': return a + b; case '-': return a - b; case '*': return a * b; case '/': return a / b; } }; Node.prototype.fround = function (context, value) { var precision = context && context.numPrecision; // add "epsilon" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded: return (precision) ? Number((value + 2e-16).toFixed(precision)) : value; }; // Returns true if this node represents root of ast imported by reference Node.prototype.blocksVisibility = function () { if (this.visibilityBlocks == null) { this.visibilityBlocks = 0; } return this.visibilityBlocks !== 0; }; Node.prototype.addVisibilityBlock = function () { if (this.visibilityBlocks == null) { this.visibilityBlocks = 0; } this.visibilityBlocks = this.visibilityBlocks + 1; }; Node.prototype.removeVisibilityBlock = function () { if (this.visibilityBlocks == null) { this.visibilityBlocks = 0; } this.visibilityBlocks = this.visibilityBlocks - 1; }; // Turns on node visibility - if called node will be shown in output regardless // of whether it comes from import by reference or not Node.prototype.ensureVisibility = function () { this.nodeVisible = true; }; // Turns off node visibility - if called node will NOT be shown in output regardless // of whether it comes from import by reference or not Node.prototype.ensureInvisibility = function () { this.nodeVisible = false; }; // return values: // false - the node must not be visible // true - the node must be visible // undefined or null - the node has the same visibility as its parent Node.prototype.isVisible = function () { return this.nodeVisible; }; Node.prototype.visibilityInfo = function () { return { visibilityBlocks: this.visibilityBlocks, nodeVisible: this.nodeVisible }; }; Node.prototype.copyVisibilityInfo = function (info) { if (!info) { return; } this.visibilityBlocks = info.visibilityBlocks; this.nodeVisible = info.nodeVisible; }; return Node; }()); Node.compare = function (a, b) { /* returns: -1: a < b 0: a = b 1: a > b and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */ if ((a.compare) && // for "symmetric results" force toCSS-based comparison // of Quoted or Anonymous if either value is one of those !(b.type === 'Quoted' || b.type === 'Anonymous')) { return a.compare(b); } else if (b.compare) { return -b.compare(a); } else if (a.type !== b.type) { return undefined; } a = a.value; b = b.value; if (!Array.isArray(a)) { return a === b ? 0 : undefined; } if (a.length !== b.length) { return undefined; } for (var i_1 = 0; i_1 < a.length; i_1++) { if (Node.compare(a[i_1], b[i_1]) !== 0) { return undefined; } } return 0; }; Node.numericCompare = function (a, b) { return a < b ? -1 : a === b ? 0 : a > b ? 1 : undefined; }; // // RGB Colors - #ff0014, #eee // var Color = /** @class */ (function (_super) { __extends(Color, _super); function Color(rgb, a, originalForm) { var _this = _super.call(this) || this; var self = _this; // // The end goal here, is to parse the arguments // into an integer triplet, such as `128, 255, 0` // // This facilitates operations and conversions. // if (Array.isArray(rgb)) { _this.rgb = rgb; } else if (rgb.length >= 6) { _this.rgb = []; rgb.match(/.{2}/g).map(function (c, i) { if (i < 3) { self.rgb.push(parseInt(c, 16)); } else { self.alpha = (parseInt(c, 16)) / 255; } }); } else { _this.rgb = []; rgb.split('').map(function (c, i) { if (i < 3) { self.rgb.push(parseInt(c + c, 16)); } else { self.alpha = (parseInt(c + c, 16)) / 255; } }); } _this.alpha = _this.alpha || (typeof a === 'number' ? a : 1); if (typeof originalForm !== 'undefined') { _this.value = originalForm; } return _this; } Color.prototype.luma = function () { var r = this.rgb[0] / 255; var g = this.rgb[1] / 255; var b = this.rgb[2] / 255; r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4); g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4); b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4); return 0.2126 * r + 0.7152 * g + 0.0722 * b; }; Color.prototype.genCSS = function (context, output) { output.add(this.toCSS(context)); }; Color.prototype.toCSS = function (context, doNotCompress) { var compress = context && context.compress && !doNotCompress; var color; var alpha; var colorFunction; var args = []; // `value` is set if this color was originally // converted from a named color string so we need // to respect this and try to output named color too. alpha = this.fround(context, this.alpha); if (this.value) { if (this.value.indexOf('rgb') === 0) { if (alpha < 1) { colorFunction = 'rgba'; } } else if (this.value.indexOf('hsl') === 0) { if (alpha < 1) { colorFunction = 'hsla'; } else { colorFunction = 'hsl'; } } else { return this.value; } } else { if (alpha < 1) { colorFunction = 'rgba'; } } switch (colorFunction) { case 'rgba': args = this.rgb.map(function (c) { return clamp(Math.round(c), 255); }).concat(clamp(alpha, 1)); break; case 'hsla': args.push(clamp(alpha, 1)); case 'hsl': color = this.toHSL(); args = [ this.fround(context, color.h), this.fround(context, color.s * 100) + "%", this.fround(context, color.l * 100) + "%" ].concat(args); } if (colorFunction) { // Values are capped between `0` and `255`, rounded and zero-padded. return colorFunction + "(" + args.join("," + (compress ? '' : ' ')) + ")"; } color = this.toRGB(); if (compress) { var splitcolor = color.split(''); // Convert color to short format if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) { color = "#" + splitcolor[1] + splitcolor[3] + splitcolor[5]; } } return color; }; // // Operations have to be done per-channel, if not, // channels will spill onto each other. Once we have // our result, in the form of an integer triplet, // we create a new Color node to hold the result. // Color.prototype.operate = function (context, op, other) { var rgb = new Array(3); var alpha = this.alpha * (1 - other.alpha) + other.alpha; for (var c = 0; c < 3; c++) { rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]); } return new Color(rgb, alpha); }; Color.prototype.toRGB = function () { return toHex(this.rgb); }; Color.prototype.toHSL = function () { var r = this.rgb[0] / 255; var g = this.rgb[1] / 255; var b = this.rgb[2] / 255; var a = this.alpha; var max = Math.max(r, g, b); var min = Math.min(r, g, b); var h; var s; var l = (max + min) / 2; var d = max - min; if (max === min) { h = s = 0; } else { s = l > 0.5 ? d / (2 - max - min) : d / (max + min); switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } return { h: h * 360, s: s, l: l, a: a }; }; // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript Color.prototype.toHSV = function () { var r = this.rgb[0] / 255; var g = this.rgb[1] / 255; var b = this.rgb[2] / 255; var a = this.alpha; var max = Math.max(r, g, b); var min = Math.min(r, g, b); var h; var s; var v = max; var d = max - min; if (max === 0) { s = 0; } else { s = d / max; } if (max === min) { h = 0; } else { switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } return { h: h * 360, s: s, v: v, a: a }; }; Color.prototype.toARGB = function () { return toHex([this.alpha * 255].concat(this.rgb)); }; Color.prototype.compare = function (x) { return (x.rgb && x.rgb[0] === this.rgb[0] && x.rgb[1] === this.rgb[1] && x.rgb[2] === this.rgb[2] && x.alpha === this.alpha) ? 0 : undefined; }; return Color; }(Node)); Color.prototype.type = 'Color'; function clamp(v, max) { return Math.min(Math.max(v, 0), max); } function toHex(v) { return "#" + v.map(function (c) { c = clamp(Math.round(c), 255); return (c < 16 ? '0' : '') + c.toString(16); }).join(''); } Color.fromKeyword = function (keyword) { var c; var key = keyword.toLowerCase(); if (colors.hasOwnProperty(key)) { c = new Color(colors[key].slice(1)); } else if (key === 'transparent') { c = new Color([0, 0, 0], 0); } if (c) { c.value = keyword; return c; } }; var Paren = /** @class */ (function (_super) { __extends(Paren, _super); function Paren(node) { var _this = _super.call(this) || this; _this.value = node; return _this; } Paren.prototype.genCSS = function (context, output) { output.add('('); this.value.genCSS(context, output); output.add(')'); }; Paren.prototype.eval = function (context) { return new Paren(this.value.eval(context)); }; return Paren; }(Node)); Paren.prototype.type = 'Paren'; var _noSpaceCombinators = { '': true, ' ': true, '|': true }; var Combinator = /** @class */ (function (_super) { __extends(Combinator, _super); function Combinator(value) { var _this = _super.call(this) || this; if (value === ' ') { _this.value = ' '; _this.emptyOrWhitespace = true; } else { _this.value = value ? value.trim() : ''; _this.emptyOrWhitespace = _this.value === ''; } return _this; } Combinator.prototype.genCSS = function (context, output) { var spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' '; output.add(spaceOrEmpty + this.value + spaceOrEmpty); }; return Combinator; }(Node)); Combinator.prototype.type = 'Combinator'; var Element = /** @class */ (function (_super) { __extends(Element, _super); function Element(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) { var _this = _super.call(this) || this; _this.combinator = combinator instanceof Combinator ? combinator : new Combinator(combinator); if (typeof value === 'string') { _this.value = value.trim(); } else if (value) { _this.value = value; } else { _this.value = ''; } _this.isVariable = isVariable; _this._index = index; _this._fileInfo = currentFileInfo; _this.copyVisibilityInfo(visibilityInfo); _this.setParent(_this.combinator, _this); return _this; } Element.prototype.accept = function (visitor) { var value = this.value; this.combinator = visitor.visit(this.combinator); if (typeof value === 'object') { this.value = visitor.visit(value); } }; Element.prototype.eval = function (context) { return new Element(this.combinator, this.value.eval ? this.value.eval(context) : this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }; Element.prototype.clone = function () { return new Element(this.combinator, this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }; Element.prototype.genCSS = function (context, output) { output.add(this.toCSS(context), this.fileInfo(), this.getIndex()); }; Element.prototype.toCSS = function (context) { if (context === void 0) { context = {}; } var value = this.value; var firstSelector = context.firstSelector; if (value instanceof Paren) { // selector in parens should not be affected by outer selector // flags (breaks only interpolated selectors - see #1973) context.firstSelector = true; } value = value.toCSS ? value.toCSS(context) : value; context.firstSelector = firstSelector; if (value === '' && this.combinator.value.charAt(0) === '&') { return ''; } else { return this.combinator.toCSS(context) + value; } }; return Element; }(Node)); Element.prototype.type = 'Element'; var Math$1 = { ALWAYS: 0, PARENS_DIVISION: 1, PARENS: 2, STRICT_LEGACY: 3 }; var RewriteUrls = { OFF: 0, LOCAL: 1, ALL: 2 }; function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var clone_1 = createCommonjsModule(function (module) { var clone = (function () { function _instanceof(obj, type) { return type != null && obj instanceof type; } var nativeMap; try { nativeMap = Map; } catch (_) { // maybe a reference error because no `Map`. Give it a dummy value that no // value will ever be an instanceof. nativeMap = function () { }; } var nativeSet; try { nativeSet = Set; } catch (_) { nativeSet = function () { }; } var nativePromise; try { nativePromise = Promise; } catch (_) { nativePromise = function () { }; } /** * Clones (copies) an Object using deep copying. * * This function supports circular references by default, but if you are certain * there are no circular references in your object, you can save some CPU time * by calling clone(obj, false). * * Caution: if `circular` is false and `parent` contains circular references, * your program may enter an infinite loop and crash. * * @param `parent` - the object to be cloned * @param `circular` - set to true if the object to be cloned may contain * circular references. (optional - true by default) * @param `depth` - set to a number if the object is only to be cloned to * a particular depth. (optional - defaults to Infinity) * @param `prototype` - sets the prototype to be used when cloning an object. * (optional - defaults to parent prototype). * @param `includeNonEnumerable` - set to true if the non-enumerable properties * should be cloned as well. Non-enumerable properties on the prototype * chain will be ignored. (optional - false by default) */ function clone(parent, circular, depth, prototype, includeNonEnumerable) { if (typeof circular === 'object') { depth = circular.depth; prototype = circular.prototype; includeNonEnumerable = circular.includeNonEnumerable; circular = circular.circular; } // maintain two arrays for circular references, where corresponding parents // and children have the same index var allParents = []; var allChildren = []; var useBuffer = typeof Buffer != 'undefined'; if (typeof circular == 'undefined') circular = true; if (typeof depth == 'undefined') depth = Infinity; // recurse this function so we don't reset allParents and allChildren function _clone(parent, depth) { // cloning null always returns null if (parent === null) return null; if (depth === 0) return parent; var child; var proto; if (typeof parent != 'object') { return parent; } if (_instanceof(parent, nativeMap)) { child = new nativeMap(); } else if (_instanceof(parent, nativeSet)) { child = new nativeSet(); } else if (_instanceof(parent, nativePromise)) { child = new nativePromise(function (resolve, reject) { parent.then(function (value) { resolve(_clone(value, depth - 1)); }, function (err) { reject(_clone(err, depth - 1)); }); }); } else if (clone.__isArray(parent)) { child = []; } else if (clone.__isRegExp(parent)) { child = new RegExp(parent.source, __getRegExpFlags(parent)); if (parent.lastIndex) child.lastIndex = parent.lastIndex; } else if (clone.__isDate(parent)) { child = new Date(parent.getTime()); } else if (useBuffer && Buffer.isBuffer(parent)) { if (Buffer.allocUnsafe) { // Node.js >= 4.5.0 child = Buffer.allocUnsafe(parent.length); } else { // Older Node.js versions child = new Buffer(parent.length); } parent.copy(child); return child; } else if (_instanceof(parent, Error)) { child = Object.create(parent); } else { if (typeof prototype == 'undefined') { proto = Object.getPrototypeOf(parent); child = Object.create(proto); } else { child = Object.create(prototype); proto = prototype; } } if (circular) { var index = allParents.indexOf(parent); if (index != -1) { return allChildren[index]; } allParents.push(parent); allChildren.push(child); } if (_instanceof(parent, nativeMap)) { parent.forEach(function (value, key) { var keyChild = _clone(key, depth - 1); var valueChild = _clone(value, depth - 1); child.set(keyChild, valueChild); }); } if (_instanceof(parent, nativeSet)) { parent.forEach(function (value) { var entryChild = _clone(value, depth - 1); child.add(entryChild); }); } for (var i in parent) { var attrs; if (proto) { attrs = Object.getOwnPropertyDescriptor(proto, i); } if (attrs && attrs.set == null) { continue; } child[i] = _clone(parent[i], depth - 1); } if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(parent); for (var i = 0; i < symbols.length; i++) { // Don't need to worry about cloning a symbol because it is a primitive, // like a number or string. var symbol = symbols[i]; var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { continue; } child[symbol] = _clone(parent[symbol], depth - 1); if (!descriptor.enumerable) { Object.defineProperty(child, symbol, { enumerable: false }); } } } if (includeNonEnumerable) { var allPropertyNames = Object.getOwnPropertyNames(parent); for (var i = 0; i < allPropertyNames.length; i++) { var propertyName = allPropertyNames[i]; var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); if (descriptor && descriptor.enumerable) { continue; } child[propertyName] = _clone(parent[propertyName], depth - 1); Object.defineProperty(child, propertyName, { enumerable: false }); } } return child; } return _clone(parent, depth); } /** * Simple flat clone using prototype, accepts only objects, usefull for property * override on FLAT configuration object (no nested props). * * USE WITH CAUTION! This may not behave as you wish if you do not know how this * works. */ clone.clonePrototype = function clonePrototype(parent) { if (parent === null) return null; var c = function () { }; c.prototype = parent; return new c(); }; // private utility functions function __objToStr(o) { return Object.prototype.toString.call(o); } clone.__objToStr = __objToStr; function __isDate(o) { return typeof o === 'object' && __objToStr(o) === '[object Date]'; } clone.__isDate = __isDate; function __isArray(o) { return typeof o === 'object' && __objToStr(o) === '[object Array]'; } clone.__isArray = __isArray; function __isRegExp(o) { return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; } clone.__isRegExp = __isRegExp; function __getRegExpFlags(re) { var flags = ''; if (re.global) flags += 'g'; if (re.ignoreCase) flags += 'i'; if (re.multiline) flags += 'm'; return flags; } clone.__getRegExpFlags = __getRegExpFlags; return clone; })(); if ( module.exports) { module.exports = clone; } }); /* jshint proto: true */ function getLocation(index, inputStream) { var n = index + 1; var line = null; var column = -1; while (--n >= 0 && inputStream.charAt(n) !== '\n') { column++; } if (typeof index === 'number') { line = (inputStream.slice(0, index).match(/\n/g) || '').length; } return { line: line, column: column }; } function copyArray(arr) { var i; var length = arr.length; var copy = new Array(length); for (i = 0; i < length; i++) { copy[i] = arr[i]; } return copy; } function clone(obj) { var cloned = {}; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { cloned[prop] = obj[prop]; } } return cloned; } function defaults(obj1, obj2) { var newObj = obj2 || {}; if (!obj2._defaults) { newObj = {}; var defaults_1 = clone_1(obj1); newObj._defaults = defaults_1; var cloned = obj2 ? clone_1(obj2) : {}; Object.assign(newObj, defaults_1, cloned); } return newObj; } function copyOptions(obj1, obj2) { if (obj2 && obj2._defaults) { return obj2; } var opts = defaults(obj1, obj2); if (opts.strictMath) { opts.math = Math$1.STRICT_LEGACY; } // Back compat with changed relativeUrls option if (opts.relativeUrls) { opts.rewriteUrls = RewriteUrls.ALL; } if (typeof opts.math === 'string') { switch (opts.math.toLowerCase()) { case 'always': opts.math = Math$1.ALWAYS; break; case 'parens-division': opts.math = Math$1.PARENS_DIVISION; break; case 'strict': case 'parens': opts.math = Math$1.PARENS; break; case 'strict-legacy': opts.math = Math$1.STRICT_LEGACY; } } if (typeof opts.rewriteUrls === 'string') { switch (opts.rewriteUrls.toLowerCase()) { case 'off': opts.rewriteUrls = RewriteUrls.OFF; break; case 'local': opts.rewriteUrls = RewriteUrls.LOCAL; break; case 'all': opts.rewriteUrls = RewriteUrls.ALL; break; } } return opts; } function merge(obj1, obj2) { for (var prop in obj2) { if (obj2.hasOwnProperty(prop)) { obj1[prop] = obj2[prop]; } } return obj1; } function flattenArray(arr, result) { if (result === void 0) { result = []; } for (var i_1 = 0, length_1 = arr.length; i_1 < length_1; i_1++) { var value = arr[i_1]; if (Array.isArray(value)) { flattenArray(value, result); } else { if (value !== undefined) { result.push(value); } } } return result; } var utils = /*#__PURE__*/Object.freeze({ __proto__: null, getLocation: getLocation, copyArray: copyArray, clone: clone, defaults: defaults, copyOptions: copyOptions, merge: merge, flattenArray: flattenArray }); var anonymousFunc = /(|Function):(\d+):(\d+)/; /** * This is a centralized class of any error that could be thrown internally (mostly by the parser). * Besides standard .message it keeps some additional data like a path to the file where the error * occurred along with line and column numbers. * * @class * @extends Error * @type {module.LessError} * * @prop {string} type * @prop {string} filename * @prop {number} index * @prop {number} line * @prop {number} column * @prop {number} callLine * @prop {number} callExtract * @prop {string[]} extract * * @param {Object} e - An error object to wrap around or just a descriptive object * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager? * @param {string} [currentFilename] */ var LessError = function LessError(e, fileContentMap, currentFilename) { Error.call(this); var filename = e.filename || currentFilename; this.message = e.message; this.stack = e.stack; if (fileContentMap && filename) { var input = fileContentMap.contents[filename]; var loc = getLocation(e.index, input); var line = loc.line; var col = loc.column; var callLine = e.call && getLocation(e.call, input).line; var lines = input ? input.split('\n') : ''; this.type = e.type || 'Syntax'; this.filename = filename; this.index = e.index; this.line = typeof line === 'number' ? line + 1 : null; this.column = col; if (!this.line && this.stack) { var found = this.stack.match(anonymousFunc); /** * We have to figure out how this environment stringifies anonymous functions * so we can correctly map plugin errors. * * Note, in Node 8, the output of anonymous funcs varied based on parameters * being present or not, so we inject dummy params. */ var func = new Function('a', 'throw new Error()'); var lineAdjust = 0; try { func(); } catch (e) { var match = e.stack.match(anonymousFunc); var line_1 = parseInt(match[2]); lineAdjust = 1 - line_1; } if (found) { if (found[2]) { this.line = parseInt(found[2]) + lineAdjust; } if (found[3]) { this.column = parseInt(found[3]); } } } this.callLine = callLine + 1; this.callExtract = lines[callLine]; this.extract = [ lines[this.line - 2], lines[this.line - 1], lines[this.line] ]; } }; if (typeof Object.create === 'undefined') { var F = function () { }; F.prototype = Error.prototype; LessError.prototype = new F(); } else { LessError.prototype = Object.create(Error.prototype); } LessError.prototype.constructor = LessError; /** * An overridden version of the default Object.prototype.toString * which uses additional information to create a helpful message. * * @param {Object} options * @returns {string} */ LessError.prototype.toString = function (options) { if (options === void 0) { options = {}; } var message = ''; var extract = this.extract || []; var error = []; var stylize = function (str) { return str; }; if (options.stylize) { var type = typeof options.stylize; if (type !== 'function') { throw Error("options.stylize should be a function, got a " + type + "!"); } stylize = options.stylize; } if (this.line !== null) { if (typeof extract[0] === 'string') { error.push(stylize(this.line - 1 + " " + extract[0], 'grey')); } if (typeof extract[1] === 'string') { var errorTxt = this.line + " "; if (extract[1]) { errorTxt += extract[1].slice(0, this.column) + stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') + extract[1].slice(this.column + 1), 'red'), 'inverse'); } error.push(errorTxt); } if (typeof extract[2] === 'string') { error.push(stylize(this.line + 1 + " " + extract[2], 'grey')); } error = error.join('\n') + stylize('', 'reset') + "\n"; } message += stylize(this.type + "Error: " + this.message, 'red'); if (this.filename) { message += stylize(' in ', 'red') + this.filename; } if (this.line) { message += stylize(" on line " + this.line + ", column " + (this.column + 1) + ":", 'grey'); } message += "\n" + error; if (this.callLine) { message += stylize('from ', 'red') + (this.filename || '') + "/n"; message += stylize(this.callLine, 'grey') + " " + this.callExtract + "/n"; } return message; }; var Selector = /** @class */ (function (_super) { __extends(Selector, _super); function Selector(elements, extendList, condition, index, currentFileInfo, visibilityInfo) { var _this = _super.call(this) || this; _this.extendList = extendList; _this.condition = condition; _this.evaldCondition = !condition; _this._index = index; _this._fileInfo = currentFileInfo; _this.elements = _this.getElements(elements); _this.mixinElements_ = undefined; _this.copyVisibilityInfo(visibilityInfo); _this.setParent(_this.elements, _this); return _this; } Selector.prototype.accept = function (visitor) { if (this.elements) { this.elements = visitor.visitArray(this.elements); } if (this.extendList) { this.extendList = visitor.visitArray(this.extendList); } if (this.condition) { this.condition = visitor.visit(this.condition); } }; Selector.prototype.createDerived = function (elements, extendList, evaldCondition) { elements = this.getElements(elements); var newSelector = new Selector(elements, extendList || this.extendList, null, this.getIndex(), this.fileInfo(), this.visibilityInfo()); newSelector.evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition; newSelector.mediaEmpty = this.mediaEmpty; return newSelector; }; Selector.prototype.getElements = function (els) { if (!els) { return [new Element('', '&', false, this._index, this._fileInfo)]; } if (typeof els === 'string') { this.parse.parseNode(els, ['selector'], this._index, this._fileInfo, function (err, result) { if (err) { throw new LessError({ index: err.index, message: err.message }, this.parse.imports, this._fileInfo.filename); } els = result[0].elements; }); } return els; }; Selector.prototype.createEmptySelectors = function () { var el = new Element('', '&', false, this._index, this._fileInfo); var sels = [new Selector([el], null, null, this._index, this._fileInfo)]; sels[0].mediaEmpty = true; return sels; }; Selector.prototype.match = function (other) { var elements = this.elements; var len = elements.length; var olen; var i; other = other.mixinElements(); olen = other.length; if (olen === 0 || len < olen) { return 0; } else { for (i = 0; i < olen; i++) { if (elements[i].value !== other[i]) { return 0; } } } return olen; // return number of matched elements }; Selector.prototype.mixinElements = function () { if (this.mixinElements_) { return this.mixinElements_; } var elements = this.elements.map(function (v) { return v.combinator.value + (v.value.value || v.value); }).join('').match(/[,&#\*\.\w-]([\w-]|(\\.))*/g); if (elements) { if (elements[0] === '&') { elements.shift(); } } else { elements = []; } return (this.mixinElements_ = elements); }; Selector.prototype.isJustParentSelector = function () { return !this.mediaEmpty && this.elements.length === 1 && this.elements[0].value === '&' && (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === ''); }; Selector.prototype.eval = function (context) { var evaldCondition = this.condition && this.condition.eval(context); var elements = this.elements; var extendList = this.extendList; elements = elements && elements.map(function (e) { return e.eval(context); }); extendList = extendList && extendList.map(function (extend) { return extend.eval(context); }); return this.createDerived(elements, extendList, evaldCondition); }; Selector.prototype.genCSS = function (context, output) { var i; var element; if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') { output.add(' ', this.fileInfo(), this.getIndex()); } for (i = 0; i < this.elements.length; i++) { element = this.elements[i]; element.genCSS(context, output); } }; Selector.prototype.getIsOutput = function () { return this.evaldCondition; }; return Selector; }(Node)); Selector.prototype.type = 'Selector'; var Value = /** @class */ (function (_super) { __extends(Value, _super); function Value(value) { var _this = _super.call(this) || this; if (!value) { throw new Error('Value requires an array argument'); } if (!Array.isArray(value)) { _this.value = [value]; } else { _this.value = value; } return _this; } Value.prototype.accept = function (visitor) { if (this.value) { this.value = visitor.visitArray(this.value); } }; Value.prototype.eval = function (context) { if (this.value.length === 1) { return this.value[0].eval(context); } else { return new Value(this.value.map(function (v) { return v.eval(context); })); } }; Value.prototype.genCSS = function (context, output) { var i; for (i = 0; i < this.value.length; i++) { this.value[i].genCSS(context, output); if (i + 1 < this.value.length) { output.add((context && context.compress) ? ',' : ', '); } } }; return Value; }(Node)); Value.prototype.type = 'Value'; var Keyword = /** @class */ (function (_super) { __extends(Keyword, _super); function Keyword(value) { var _this = _super.call(this) || this; _this.value = value; return _this; } Keyword.prototype.genCSS = function (context, output) { if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; } output.add(this.value); }; return Keyword; }(Node)); Keyword.prototype.type = 'Keyword'; Keyword.True = new Keyword('true'); Keyword.False = new Keyword('false'); var Anonymous = /** @class */ (function (_super) { __extends(Anonymous, _super); function Anonymous(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { var _this = _super.call(this) || this; _this.value = value; _this._index = index; _this._fileInfo = currentFileInfo; _this.mapLines = mapLines; _this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike; _this.allowRoot = true; _this.copyVisibilityInfo(visibilityInfo); return _this; } Anonymous.prototype.eval = function () { return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); }; Anonymous.prototype.compare = function (other) { return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; }; Anonymous.prototype.isRulesetLike = function () { return this.rulesetLike; }; Anonymous.prototype.genCSS = function (context, output) { this.nodeVisible = Boolean(this.value); if (this.nodeVisible) { output.add(this.value, this._fileInfo, this._index, this.mapLines); } }; return Anonymous; }(Node)); Anonymous.prototype.type = 'Anonymous'; var MATH = Math$1; var Declaration = /** @class */ (function (_super) { __extends(Declaration, _super); function Declaration(name, value, important, merge, index, currentFileInfo, inline, variable) { var _this = _super.call(this) || this; _this.name = name; _this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]); _this.important = important ? " " + important.trim() : ''; _this.merge = merge; _this._index = index; _this._fileInfo = currentFileInfo; _this.inline = inline || false; _this.variable = (variable !== undefined) ? variable : (name.charAt && (name.charAt(0) === '@')); _this.allowRoot = true; _this.setParent(_this.value, _this); return _this; } Declaration.prototype.genCSS = function (context, output) { output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex()); try { this.value.genCSS(context, output); } catch (e) { e.index = this._index; e.filename = this._fileInfo.filename; throw e; } output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index); }; Declaration.prototype.eval = function (context) { var mathBypass = false; var prevMath; var name = this.name; var evaldValue; var variable = this.variable; if (typeof name !== 'string') { // expand 'primitive' name directly to get // things faster (~10% for benchmark.less): name = (name.length === 1) && (name[0] instanceof Keyword) ? name[0].value : evalName(context, name); variable = false; // never treat expanded interpolation as new variable name } // @todo remove when parens-division is default if (name === 'font' && context.math === MATH.ALWAYS) { mathBypass = true; prevMath = context.math; context.math = MATH.PARENS_DIVISION; } try { context.importantScope.push({}); evaldValue = this.value.eval(context); if (!this.variable && evaldValue.type === 'DetachedRuleset') { throw { message: 'Rulesets cannot be evaluated on a property.', index: this.getIndex(), filename: this.fileInfo().filename }; } var important = this.important; var importantResult = context.importantScope.pop(); if (!important && importantResult.important) { important = importantResult.important; } return new Declaration(name, evaldValue, important, this.merge, this.getIndex(), this.fileInfo(), this.inline, variable); } catch (e) { if (typeof e.index !== 'number') { e.index = this.getIndex(); e.filename = this.fileInfo().filename; } throw e; } finally { if (mathBypass) { context.math = prevMath; } } }; Declaration.prototype.makeImportant = function () { return new Declaration(this.name, this.value, '!important', this.merge, this.getIndex(), this.fileInfo(), this.inline); }; return Declaration; }(Node)); function evalName(context, name) { var value = ''; var i; var n = name.length; var output = { add: function (s) { value += s; } }; for (i = 0; i < n; i++) { name[i].eval(context).genCSS(context, output); } return value; } Declaration.prototype.type = 'Declaration'; var debugInfo = function (context, ctx, lineSeparator) { var result = ''; if (context.dumpLineNumbers && !context.compress) { switch (context.dumpLineNumbers) { case 'comments': result = debugInfo.asComment(ctx); break; case 'mediaquery': result = debugInfo.asMediaQuery(ctx); break; case 'all': result = debugInfo.asComment(ctx) + (lineSeparator || '') + debugInfo.asMediaQuery(ctx); break; } } return result; }; debugInfo.asComment = function (ctx) { return "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n"; }; debugInfo.asMediaQuery = function (ctx) { var filenameWithProtocol = ctx.debugInfo.fileName; if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { filenameWithProtocol = "file://" + filenameWithProtocol; } return "@media -sass-debug-info{filename{font-family:" + filenameWithProtocol.replace(/([.:\/\\])/g, function (a) { if (a == '\\') { a = '\/'; } return "\\" + a; }) + "}line{font-family:\\00003" + ctx.debugInfo.lineNumber + "}}\n"; }; var Comment = /** @class */ (function (_super) { __extends(Comment, _super); function Comment(value, isLineComment, index, currentFileInfo) { var _this = _super.call(this) || this; _this.value = value; _this.isLineComment = isLineComment; _this._index = index; _this._fileInfo = currentFileInfo; _this.allowRoot = true; return _this; } Comment.prototype.genCSS = function (context, output) { if (this.debugInfo) { output.add(debugInfo(context, this), this.fileInfo(), this.getIndex()); } output.add(this.value); }; Comment.prototype.isSilent = function (context) { var isCompressed = context.compress && this.value[2] !== '!'; return this.isLineComment || isCompressed; }; return Comment; }(Node)); Comment.prototype.type = 'Comment'; var contexts = {}; var copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) { if (!original) { return; } for (var i_1 = 0; i_1 < propertiesToCopy.length; i_1++) { if (original.hasOwnProperty(propertiesToCopy[i_1])) { destination[propertiesToCopy[i_1]] = original[propertiesToCopy[i_1]]; } } }; /* parse is used whilst parsing */ var parseCopyProperties = [ // options 'paths', 'rewriteUrls', 'rootpath', 'strictImports', 'insecure', 'dumpLineNumbers', 'compress', 'syncImport', 'chunkInput', 'mime', 'useFileCache', // context 'processImports', // Used by the import manager to stop multiple import visitors being created. 'pluginManager' // Used as the plugin manager for the session ]; contexts.Parse = function (options) { copyFromOriginal(options, this, parseCopyProperties); if (typeof this.paths === 'string') { this.paths = [this.paths]; } }; var evalCopyProperties = [ 'paths', 'compress', 'math', 'strictUnits', 'sourceMap', 'importMultiple', 'urlArgs', 'javascriptEnabled', 'pluginManager', 'importantScope', 'rewriteUrls' // option - whether to adjust URL's to be relative ]; function isPathRelative(path) { return !/^(?:[a-z-]+:|\/|#)/i.test(path); } function isPathLocalRelative(path) { return path.charAt(0) === '.'; } contexts.Eval = /** @class */ (function () { function Eval(options, frames) { copyFromOriginal(options, this, evalCopyProperties); if (typeof this.paths === 'string') { this.paths = [this.paths]; } this.frames = frames || []; this.importantScope = this.importantScope || []; this.inCalc = false; this.mathOn = true; } Eval.prototype.enterCalc = function () { if (!this.calcStack) { this.calcStack = []; } this.calcStack.push(true); this.inCalc = true; }; Eval.prototype.exitCalc = function () { this.calcStack.pop(); if (!this.calcStack) { this.inCalc = false; } }; Eval.prototype.inParenthesis = function () { if (!this.parensStack) { this.parensStack = []; } this.parensStack.push(true); }; Eval.prototype.outOfParenthesis = function () { this.parensStack.pop(); }; Eval.prototype.isMathOn = function (op) { if (!this.mathOn) { return false; } if (op === '/' && this.math !== Math$1.ALWAYS && (!this.parensStack || !this.parensStack.length)) { return false; } if (this.math > Math$1.PARENS_DIVISION) { return this.parensStack && this.parensStack.length; } return true; }; Eval.prototype.pathRequiresRewrite = function (path) { var isRelative = this.rewriteUrls === RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative; return isRelative(path); }; Eval.prototype.rewritePath = function (path, rootpath) { var newPath; rootpath = rootpath || ''; newPath = this.normalizePath(rootpath + path); // If a path was explicit relative and the rootpath was not an absolute path // we must ensure that the new path is also explicit relative. if (isPathLocalRelative(path) && isPathRelative(rootpath) && isPathLocalRelative(newPath) === false) { newPath = "./" + newPath; } return newPath; }; Eval.prototype.normalizePath = function (path) { var segments = path.split('/').reverse(); var segment; path = []; while (segments.length !== 0) { segment = segments.pop(); switch (segment) { case '.': break; case '..': if ((path.length === 0) || (path[path.length - 1] === '..')) { path.push(segment); } else { path.pop(); } break; default: path.push(segment); break; } } return path.join('/'); }; return Eval; }()); function makeRegistry(base) { return { _data: {}, add: function (name, func) { // precautionary case conversion, as later querying of // the registry by function-caller uses lower case as well. name = name.toLowerCase(); if (this._data.hasOwnProperty(name)) ; this._data[name] = func; }, addMultiple: function (functions) { var _this = this; Object.keys(functions).forEach(function (name) { _this.add(name, functions[name]); }); }, get: function (name) { return this._data[name] || (base && base.get(name)); }, getLocalFunctions: function () { return this._data; }, inherit: function () { return makeRegistry(this); }, create: function (base) { return makeRegistry(base); } }; } var functionRegistry = makeRegistry(null); var defaultFunc = { eval: function () { var v = this.value_; var e = this.error_; if (e) { throw e; } if (v != null) { return v ? Keyword.True : Keyword.False; } }, value: function (v) { this.value_ = v; }, error: function (e) { this.error_ = e; }, reset: function () { this.value_ = this.error_ = null; } }; var Ruleset = /** @class */ (function (_super) { __extends(Ruleset, _super); function Ruleset(selectors, rules, strictImports, visibilityInfo) { var _this = _super.call(this) || this; _this.selectors = selectors; _this.rules = rules; _this._lookups = {}; _this._variables = null; _this._properties = null; _this.strictImports = strictImports; _this.copyVisibilityInfo(visibilityInfo); _this.allowRoot = true; _this.setParent(_this.selectors, _this); _this.setParent(_this.rules, _this); return _this; } Ruleset.prototype.isRulesetLike = function () { return true; }; Ruleset.prototype.accept = function (visitor) { if (this.paths) { this.paths = visitor.visitArray(this.paths, true); } else if (this.selectors) { this.selectors = visitor.visitArray(this.selectors); } if (this.rules && this.rules.length) { this.rules = visitor.visitArray(this.rules); } }; Ruleset.prototype.eval = function (context) { var selectors; var selCnt; var selector; var i; var hasVariable; var hasOnePassingSelector = false; if (this.selectors && (selCnt = this.selectors.length)) { selectors = new Array(selCnt); defaultFunc.error({ type: 'Syntax', message: 'it is currently only allowed in parametric mixin guards,' }); for (i = 0; i < selCnt; i++) { selector = this.selectors[i].eval(context); for (var j = 0; j < selector.elements.length; j++) { if (selector.elements[j].isVariable) { hasVariable = true; break; } } selectors[i] = selector; if (selector.evaldCondition) { hasOnePassingSelector = true; } } if (hasVariable) { var toParseSelectors = new Array(selCnt); for (i = 0; i < selCnt; i++) { selector = selectors[i]; toParseSelectors[i] = selector.toCSS(context); } this.parse.parseNode(toParseSelectors.join(','), ["selectors"], selectors[0].getIndex(), selectors[0].fileInfo(), function (err, result) { if (result) { selectors = flattenArray(result); } }); } defaultFunc.reset(); } else { hasOnePassingSelector = true; } var rules = this.rules ? copyArray(this.rules) : null; var ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo()); var rule; var subRule; ruleset.originalRuleset = this; ruleset.root = this.root; ruleset.firstRoot = this.firstRoot; ruleset.allowImports = this.allowImports; if (this.debugInfo) { ruleset.debugInfo = this.debugInfo; } if (!hasOnePassingSelector) { rules.length = 0; } // inherit a function registry from the frames stack when possible; // otherwise from the global registry ruleset.functionRegistry = (function (frames) { var i = 0; var n = frames.length; var found; for (; i !== n; ++i) { found = frames[i].functionRegistry; if (found) { return found; } } return functionRegistry; })(context.frames).inherit(); // push the current ruleset to the frames stack var ctxFrames = context.frames; ctxFrames.unshift(ruleset); // currrent selectors var ctxSelectors = context.selectors; if (!ctxSelectors) { context.selectors = ctxSelectors = []; } ctxSelectors.unshift(this.selectors); // Evaluate imports if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) { ruleset.evalImports(context); } // Store the frames around mixin definitions, // so they can be evaluated like closures when the time comes. var rsRules = ruleset.rules; for (i = 0; (rule = rsRules[i]); i++) { if (rule.evalFirst) { rsRules[i] = rule.eval(context); } } var mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0; // Evaluate mixin calls. for (i = 0; (rule = rsRules[i]); i++) { if (rule.type === 'MixinCall') { /* jshint loopfunc:true */ rules = rule.eval(context).filter(function (r) { if ((r instanceof Declaration) && r.variable) { // do not pollute the scope if the variable is // already there. consider returning false here // but we need a way to "return" variable from mixins return !(ruleset.variable(r.name)); } return true; }); rsRules.splice.apply(rsRules, [i, 1].concat(rules)); i += rules.length - 1; ruleset.resetCache(); } else if (rule.type === 'VariableCall') { /* jshint loopfunc:true */ rules = rule.eval(context).rules.filter(function (r) { if ((r instanceof Declaration) && r.variable) { // do not pollute the scope at all return false; } return true; }); rsRules.splice.apply(rsRules, [i, 1].concat(rules)); i += rules.length - 1; ruleset.resetCache(); } } // Evaluate everything else for (i = 0; (rule = rsRules[i]); i++) { if (!rule.evalFirst) { rsRules[i] = rule = rule.eval ? rule.eval(context) : rule; } } // Evaluate everything else for (i = 0; (rule = rsRules[i]); i++) { // for rulesets, check if it is a css guard and can be removed if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) { // check if it can be folded in (e.g. & where) if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) { rsRules.splice(i--, 1); for (var j = 0; (subRule = rule.rules[j]); j++) { if (subRule instanceof Node) { subRule.copyVisibilityInfo(rule.visibilityInfo()); if (!(subRule instanceof Declaration) || !subRule.variable) { rsRules.splice(++i, 0, subRule); } } } } } } // Pop the stack ctxFrames.shift(); ctxSelectors.shift(); if (context.mediaBlocks) { for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) { context.mediaBlocks[i].bubbleSelectors(selectors); } } return ruleset; }; Ruleset.prototype.evalImports = function (context) { var rules = this.rules; var i; var importRules; if (!rules) { return; } for (i = 0; i < rules.length; i++) { if (rules[i].type === 'Import') { importRules = rules[i].eval(context); if (importRules && (importRules.length || importRules.length === 0)) { rules.splice.apply(rules, [i, 1].concat(importRules)); i += importRules.length - 1; } else { rules.splice(i, 1, importRules); } this.resetCache(); } } }; Ruleset.prototype.makeImportant = function () { var result = new Ruleset(this.selectors, this.rules.map(function (r) { if (r.makeImportant) { return r.makeImportant(); } else { return r; } }), this.strictImports, this.visibilityInfo()); return result; }; Ruleset.prototype.matchArgs = function (args) { return !args || args.length === 0; }; // lets you call a css selector with a guard Ruleset.prototype.matchCondition = function (args, context) { var lastSelector = this.selectors[this.selectors.length - 1]; if (!lastSelector.evaldCondition) { return false; } if (lastSelector.condition && !lastSelector.condition.eval(new contexts.Eval(context, context.frames))) { return false; } return true; }; Ruleset.prototype.resetCache = function () { this._rulesets = null; this._variables = null; this._properties = null; this._lookups = {}; }; Ruleset.prototype.variables = function () { if (!this._variables) { this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) { if (r instanceof Declaration && r.variable === true) { hash[r.name] = r; } // when evaluating variables in an import statement, imports have not been eval'd // so we need to go inside import statements. // guard against root being a string (in the case of inlined less) if (r.type === 'Import' && r.root && r.root.variables) { var vars = r.root.variables(); for (var name_1 in vars) { if (vars.hasOwnProperty(name_1)) { hash[name_1] = r.root.variable(name_1); } } } return hash; }, {}); } return this._variables; }; Ruleset.prototype.properties = function () { if (!this._properties) { this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) { if (r instanceof Declaration && r.variable !== true) { var name_2 = (r.name.length === 1) && (r.name[0] instanceof Keyword) ? r.name[0].value : r.name; // Properties don't overwrite as they can merge if (!hash["$" + name_2]) { hash["$" + name_2] = [r]; } else { hash["$" + name_2].push(r); } } return hash; }, {}); } return this._properties; }; Ruleset.prototype.variable = function (name) { var decl = this.variables()[name]; if (decl) { return this.parseValue(decl); } }; Ruleset.prototype.property = function (name) { var decl = this.properties()[name]; if (decl) { return this.parseValue(decl); } }; Ruleset.prototype.lastDeclaration = function () { for (var i_1 = this.rules.length; i_1 > 0; i_1--) { var decl = this.rules[i_1 - 1]; if (decl instanceof Declaration) { return this.parseValue(decl); } } }; Ruleset.prototype.parseValue = function (toParse) { var self = this; function transformDeclaration(decl) { if (decl.value instanceof Anonymous && !decl.parsed) { if (typeof decl.value.value === 'string') { this.parse.parseNode(decl.value.value, ['value', 'important'], decl.value.getIndex(), decl.fileInfo(), function (err, result) { if (err) { decl.parsed = true; } if (result) { decl.value = result[0]; decl.important = result[1] || ''; decl.parsed = true; } }); } else { decl.parsed = true; } return decl; } else { return decl; } } if (!Array.isArray(toParse)) { return transformDeclaration.call(self, toParse); } else { var nodes_1 = []; toParse.forEach(function (n) { nodes_1.push(transformDeclaration.call(self, n)); }); return nodes_1; } }; Ruleset.prototype.rulesets = function () { if (!this.rules) { return []; } var filtRules = []; var rules = this.rules; var i; var rule; for (i = 0; (rule = rules[i]); i++) { if (rule.isRuleset) { filtRules.push(rule); } } return filtRules; }; Ruleset.prototype.prependRule = function (rule) { var rules = this.rules; if (rules) { rules.unshift(rule); } else { this.rules = [rule]; } this.setParent(rule, this); }; Ruleset.prototype.find = function (selector, self, filter) { if (self === void 0) { self = this; } var rules = []; var match; var foundMixins; var key = selector.toCSS(); if (key in this._lookups) { return this._lookups[key]; } this.rulesets().forEach(function (rule) { if (rule !== self) { for (var j = 0; j < rule.selectors.length; j++) { match = selector.match(rule.selectors[j]); if (match) { if (selector.elements.length > match) { if (!filter || filter(rule)) { foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter); for (var i_2 = 0; i_2 < foundMixins.length; ++i_2) { foundMixins[i_2].path.push(rule); } Array.prototype.push.apply(rules, foundMixins); } } else { rules.push({ rule: rule, path: [] }); } break; } } } }); this._lookups[key] = rules; return rules; }; Ruleset.prototype.genCSS = function (context, output) { var i; var j; var charsetRuleNodes = []; var ruleNodes = []; var // Line number debugging debugInfo$1; var rule; var path; context.tabLevel = (context.tabLevel || 0); if (!this.root) { context.tabLevel++; } var tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' '); var tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' '); var sep; var charsetNodeIndex = 0; var importNodeIndex = 0; for (i = 0; (rule = this.rules[i]); i++) { if (rule instanceof Comment) { if (importNodeIndex === i) { importNodeIndex++; } ruleNodes.push(rule); } else if (rule.isCharset && rule.isCharset()) { ruleNodes.splice(charsetNodeIndex, 0, rule); charsetNodeIndex++; importNodeIndex++; } else if (rule.type === 'Import') { ruleNodes.splice(importNodeIndex, 0, rule); importNodeIndex++; } else { ruleNodes.push(rule); } } ruleNodes = charsetRuleNodes.concat(ruleNodes); // If this is the root node, we don't render // a selector, or {}. if (!this.root) { debugInfo$1 = debugInfo(context, this, tabSetStr); if (debugInfo$1) { output.add(debugInfo$1); output.add(tabSetStr); } var paths = this.paths; var pathCnt = paths.length; var pathSubCnt = void 0; sep = context.compress ? ',' : (",\n" + tabSetStr); for (i = 0; i < pathCnt; i++) { path = paths[i]; if (!(pathSubCnt = path.length)) { continue; } if (i > 0) { output.add(sep); } context.firstSelector = true; path[0].genCSS(context, output); context.firstSelector = false; for (j = 1; j < pathSubCnt; j++) { path[j].genCSS(context, output); } } output.add((context.compress ? '{' : ' {\n') + tabRuleStr); } // Compile rules and rulesets for (i = 0; (rule = ruleNodes[i]); i++) { if (i + 1 === ruleNodes.length) { context.lastRule = true; } var currentLastRule = context.lastRule; if (rule.isRulesetLike(rule)) { context.lastRule = false; } if (rule.genCSS) { rule.genCSS(context, output); } else if (rule.value) { output.add(rule.value.toString()); } context.lastRule = currentLastRule; if (!context.lastRule && rule.isVisible()) { output.add(context.compress ? '' : ("\n" + tabRuleStr)); } else { context.lastRule = false; } } if (!this.root) { output.add((context.compress ? '}' : "\n" + tabSetStr + "}")); context.tabLevel--; } if (!output.isEmpty() && !context.compress && this.firstRoot) { output.add('\n'); } }; Ruleset.prototype.joinSelectors = function (paths, context, selectors) { for (var s = 0; s < selectors.length; s++) { this.joinSelector(paths, context, selectors[s]); } }; Ruleset.prototype.joinSelector = function (paths, context, selector) { function createParenthesis(elementsToPak, originalElement) { var replacementParen; var j; if (elementsToPak.length === 0) { replacementParen = new Paren(elementsToPak[0]); } else { var insideParent = new Array(elementsToPak.length); for (j = 0; j < elementsToPak.length; j++) { insideParent[j] = new Element(null, elementsToPak[j], originalElement.isVariable, originalElement._index, originalElement._fileInfo); } replacementParen = new Paren(new Selector(insideParent)); } return replacementParen; } function createSelector(containedElement, originalElement) { var element; var selector; element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo); selector = new Selector([element]); return selector; } // joins selector path from `beginningPath` with selector path in `addPath` // `replacedElement` contains element that is being replaced by `addPath` // returns concatenated path function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) { var newSelectorPath; var lastSelector; var newJoinedSelector; // our new selector path newSelectorPath = []; // construct the joined selector - if & is the first thing this will be empty, // if not newJoinedSelector will be the last set of elements in the selector if (beginningPath.length > 0) { newSelectorPath = copyArray(beginningPath); lastSelector = newSelectorPath.pop(); newJoinedSelector = originalSelector.createDerived(copyArray(lastSelector.elements)); } else { newJoinedSelector = originalSelector.createDerived([]); } if (addPath.length > 0) { // /deep/ is a CSS4 selector - (removed, so should deprecate) // that is valid without anything in front of it // so if the & does not have a combinator that is "" or " " then // and there is a combinator on the parent, then grab that. // this also allows + a { & .b { .a & { ... though not sure why you would want to do that var combinator = replacedElement.combinator; var parentEl = addPath[0].elements[0]; if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) { combinator = parentEl.combinator; } // join the elements so far with the first part of the parent newJoinedSelector.elements.push(new Element(combinator, parentEl.value, replacedElement.isVariable, replacedElement._index, replacedElement._fileInfo)); newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1)); } // now add the joined selector - but only if it is not empty if (newJoinedSelector.elements.length !== 0) { newSelectorPath.push(newJoinedSelector); } // put together the parent selectors after the join (e.g. the rest of the parent) if (addPath.length > 1) { var restOfPath = addPath.slice(1); restOfPath = restOfPath.map(function (selector) { return selector.createDerived(selector.elements, []); }); newSelectorPath = newSelectorPath.concat(restOfPath); } return newSelectorPath; } // joins selector path from `beginningPath` with every selector path in `addPaths` array // `replacedElement` contains element that is being replaced by `addPath` // returns array with all concatenated paths function addAllReplacementsIntoPath(beginningPath, addPaths, replacedElement, originalSelector, result) { var j; for (j = 0; j < beginningPath.length; j++) { var newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector); result.push(newSelectorPath); } return result; } function mergeElementsOnToSelectors(elements, selectors) { var i; var sel; if (elements.length === 0) { return; } if (selectors.length === 0) { selectors.push([new Selector(elements)]); return; } for (i = 0; (sel = selectors[i]); i++) { // if the previous thing in sel is a parent this needs to join on to it if (sel.length > 0) { sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements)); } else { sel.push(new Selector(elements)); } } } // replace all parent selectors inside `inSelector` by content of `context` array // resulting selectors are returned inside `paths` array // returns true if `inSelector` contained at least one parent selector function replaceParentSelector(paths, context, inSelector) { // The paths are [[Selector]] // The first list is a list of comma separated selectors // The inner list is a list of inheritance separated selectors // e.g. // .a, .b { // .c { // } // } // == [[.a] [.c]] [[.b] [.c]] // var i; var j; var k; var currentElements; var newSelectors; var selectorsMultiplied; var sel; var el; var hadParentSelector = false; var length; var lastSelector; function findNestedSelector(element) { var maybeSelector; if (!(element.value instanceof Paren)) { return null; } maybeSelector = element.value.value; if (!(maybeSelector instanceof Selector)) { return null; } return maybeSelector; } // the elements from the current selector so far currentElements = []; // the current list of new selectors to add to the path. // We will build it up. We initiate it with one empty selector as we "multiply" the new selectors // by the parents newSelectors = [ [] ]; for (i = 0; (el = inSelector.elements[i]); i++) { // non parent reference elements just get added if (el.value !== '&') { var nestedSelector = findNestedSelector(el); if (nestedSelector != null) { // merge the current list of non parent selector elements // on to the current list of selectors to add mergeElementsOnToSelectors(currentElements, newSelectors); var nestedPaths = []; var replaced = void 0; var replacedNewSelectors = []; replaced = replaceParentSelector(nestedPaths, context, nestedSelector); hadParentSelector = hadParentSelector || replaced; // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors for (k = 0; k < nestedPaths.length; k++) { var replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el); addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); } newSelectors = replacedNewSelectors; currentElements = []; } else { currentElements.push(el); } } else { hadParentSelector = true; // the new list of selectors to add selectorsMultiplied = []; // merge the current list of non parent selector elements // on to the current list of selectors to add mergeElementsOnToSelectors(currentElements, newSelectors); // loop through our current selectors for (j = 0; j < newSelectors.length; j++) { sel = newSelectors[j]; // if we don't have any parent paths, the & might be in a mixin so that it can be used // whether there are parents or not if (context.length === 0) { // the combinator used on el should now be applied to the next element instead so that // it is not lost if (sel.length > 0) { sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo)); } selectorsMultiplied.push(sel); } else { // and the parent selectors for (k = 0; k < context.length; k++) { // We need to put the current selectors // then join the last selector's elements on to the parents selectors var newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector); // add that to our new set of selectors selectorsMultiplied.push(newSelectorPath); } } } // our new selectors has been multiplied, so reset the state newSelectors = selectorsMultiplied; currentElements = []; } } // if we have any elements left over (e.g. .a& .b == .b) // add them on to all the current selectors mergeElementsOnToSelectors(currentElements, newSelectors); for (i = 0; i < newSelectors.length; i++) { length = newSelectors[i].length; if (length > 0) { paths.push(newSelectors[i]); lastSelector = newSelectors[i][length - 1]; newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList); } } return hadParentSelector; } function deriveSelector(visibilityInfo, deriveFrom) { var newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition); newSelector.copyVisibilityInfo(visibilityInfo); return newSelector; } // joinSelector code follows var i; var newPaths; var hadParentSelector; newPaths = []; hadParentSelector = replaceParentSelector(newPaths, context, selector); if (!hadParentSelector) { if (context.length > 0) { newPaths = []; for (i = 0; i < context.length; i++) { var concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo())); concatenated.push(selector); newPaths.push(concatenated); } } else { newPaths = [[selector]]; } } for (i = 0; i < newPaths.length; i++) { paths.push(newPaths[i]); } }; return Ruleset; }(Node)); Ruleset.prototype.type = 'Ruleset'; Ruleset.prototype.isRuleset = true; var AtRule = /** @class */ (function (_super) { __extends(AtRule, _super); function AtRule(name, value, rules, index, currentFileInfo, debugInfo, isRooted, visibilityInfo) { var _this = _super.call(this) || this; var i; _this.name = name; _this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value); if (rules) { if (Array.isArray(rules)) { _this.rules = rules; } else { _this.rules = [rules]; _this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors(); } for (i = 0; i < _this.rules.length; i++) { _this.rules[i].allowImports = true; } _this.setParent(_this.rules, _this); } _this._index = index; _this._fileInfo = currentFileInfo; _this.debugInfo = debugInfo; _this.isRooted = isRooted || false; _this.copyVisibilityInfo(visibilityInfo); _this.allowRoot = true; return _this; } AtRule.prototype.accept = function (visitor) { var value = this.value; var rules = this.rules; if (rules) { this.rules = visitor.visitArray(rules); } if (value) { this.value = visitor.visit(value); } }; AtRule.prototype.isRulesetLike = function () { return this.rules || !this.isCharset(); }; AtRule.prototype.isCharset = function () { return '@charset' === this.name; }; AtRule.prototype.genCSS = function (context, output) { var value = this.value; var rules = this.rules; output.add(this.name, this.fileInfo(), this.getIndex()); if (value) { output.add(' '); value.genCSS(context, output); } if (rules) { this.outputRuleset(context, output, rules); } else { output.add(';'); } }; AtRule.prototype.eval = function (context) { var mediaPathBackup; var mediaBlocksBackup; var value = this.value; var rules = this.rules; // media stored inside other atrule should not bubble over it // backpup media bubbling information mediaPathBackup = context.mediaPath; mediaBlocksBackup = context.mediaBlocks; // deleted media bubbling information context.mediaPath = []; context.mediaBlocks = []; if (value) { value = value.eval(context); } if (rules) { // assuming that there is only one rule at this point - that is how parser constructs the rule rules = [rules[0].eval(context)]; rules[0].root = true; } // restore media bubbling information context.mediaPath = mediaPathBackup; context.mediaBlocks = mediaBlocksBackup; return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo()); }; AtRule.prototype.variable = function (name) { if (this.rules) { // assuming that there is only one rule at this point - that is how parser constructs the rule return Ruleset.prototype.variable.call(this.rules[0], name); } }; AtRule.prototype.find = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (this.rules) { // assuming that there is only one rule at this point - that is how parser constructs the rule return Ruleset.prototype.find.apply(this.rules[0], args); } }; AtRule.prototype.rulesets = function () { if (this.rules) { // assuming that there is only one rule at this point - that is how parser constructs the rule return Ruleset.prototype.rulesets.apply(this.rules[0]); } }; AtRule.prototype.outputRuleset = function (context, output, rules) { var ruleCnt = rules.length; var i; context.tabLevel = (context.tabLevel | 0) + 1; // Compressed if (context.compress) { output.add('{'); for (i = 0; i < ruleCnt; i++) { rules[i].genCSS(context, output); } output.add('}'); context.tabLevel--; return; } // Non-compressed var tabSetStr = "\n" + Array(context.tabLevel).join(' '); var tabRuleStr = tabSetStr + " "; if (!ruleCnt) { output.add(" {" + tabSetStr + "}"); } else { output.add(" {" + tabRuleStr); rules[0].genCSS(context, output); for (i = 1; i < ruleCnt; i++) { output.add(tabRuleStr); rules[i].genCSS(context, output); } output.add(tabSetStr + "}"); } context.tabLevel--; }; return AtRule; }(Node)); AtRule.prototype.type = 'AtRule'; var DetachedRuleset = /** @class */ (function (_super) { __extends(DetachedRuleset, _super); function DetachedRuleset(ruleset, frames) { var _this = _super.call(this) || this; _this.ruleset = ruleset; _this.frames = frames; _this.setParent(_this.ruleset, _this); return _this; } DetachedRuleset.prototype.accept = function (visitor) { this.ruleset = visitor.visit(this.ruleset); }; DetachedRuleset.prototype.eval = function (context) { var frames = this.frames || copyArray(context.frames); return new DetachedRuleset(this.ruleset, frames); }; DetachedRuleset.prototype.callEval = function (context) { return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context); }; return DetachedRuleset; }(Node)); DetachedRuleset.prototype.type = 'DetachedRuleset'; DetachedRuleset.prototype.evalFirst = true; var Unit = /** @class */ (function (_super) { __extends(Unit, _super); function Unit(numerator, denominator, backupUnit) { var _this = _super.call(this) || this; _this.numerator = numerator ? copyArray(numerator).sort() : []; _this.denominator = denominator ? copyArray(denominator).sort() : []; if (backupUnit) { _this.backupUnit = backupUnit; } else if (numerator && numerator.length) { _this.backupUnit = numerator[0]; } return _this; } Unit.prototype.clone = function () { return new Unit(copyArray(this.numerator), copyArray(this.denominator), this.backupUnit); }; Unit.prototype.genCSS = function (context, output) { // Dimension checks the unit is singular and throws an error if in strict math mode. var strictUnits = context && context.strictUnits; if (this.numerator.length === 1) { output.add(this.numerator[0]); // the ideal situation } else if (!strictUnits && this.backupUnit) { output.add(this.backupUnit); } else if (!strictUnits && this.denominator.length) { output.add(this.denominator[0]); } }; Unit.prototype.toString = function () { var i; var returnStr = this.numerator.join('*'); for (i = 0; i < this.denominator.length; i++) { returnStr += "/" + this.denominator[i]; } return returnStr; }; Unit.prototype.compare = function (other) { return this.is(other.toString()) ? 0 : undefined; }; Unit.prototype.is = function (unitString) { return this.toString().toUpperCase() === unitString.toUpperCase(); }; Unit.prototype.isLength = function () { return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS()); }; Unit.prototype.isEmpty = function () { return this.numerator.length === 0 && this.denominator.length === 0; }; Unit.prototype.isSingular = function () { return this.numerator.length <= 1 && this.denominator.length === 0; }; Unit.prototype.map = function (callback) { var i; for (i = 0; i < this.numerator.length; i++) { this.numerator[i] = callback(this.numerator[i], false); } for (i = 0; i < this.denominator.length; i++) { this.denominator[i] = callback(this.denominator[i], true); } }; Unit.prototype.usedUnits = function () { var group; var result = {}; var mapUnit; var groupName; mapUnit = function (atomicUnit) { /* jshint loopfunc:true */ if (group.hasOwnProperty(atomicUnit) && !result[groupName]) { result[groupName] = atomicUnit; } return atomicUnit; }; for (groupName in unitConversions) { if (unitConversions.hasOwnProperty(groupName)) { group = unitConversions[groupName]; this.map(mapUnit); } } return result; }; Unit.prototype.cancel = function () { var counter = {}; var atomicUnit; var i; for (i = 0; i < this.numerator.length; i++) { atomicUnit = this.numerator[i]; counter[atomicUnit] = (counter[atomicUnit] || 0) + 1; } for (i = 0; i < this.denominator.length; i++) { atomicUnit = this.denominator[i]; counter[atomicUnit] = (counter[atomicUnit] || 0) - 1; } this.numerator = []; this.denominator = []; for (atomicUnit in counter) { if (counter.hasOwnProperty(atomicUnit)) { var count = counter[atomicUnit]; if (count > 0) { for (i = 0; i < count; i++) { this.numerator.push(atomicUnit); } } else if (count < 0) { for (i = 0; i < -count; i++) { this.denominator.push(atomicUnit); } } } } this.numerator.sort(); this.denominator.sort(); }; return Unit; }(Node)); Unit.prototype.type = 'Unit'; // // A number with a unit // var Dimension = /** @class */ (function (_super) { __extends(Dimension, _super); function Dimension(value, unit) { var _this = _super.call(this) || this; _this.value = parseFloat(value); if (isNaN(_this.value)) { throw new Error('Dimension is not a number.'); } _this.unit = (unit && unit instanceof Unit) ? unit : new Unit(unit ? [unit] : undefined); _this.setParent(_this.unit, _this); return _this; } Dimension.prototype.accept = function (visitor) { this.unit = visitor.visit(this.unit); }; Dimension.prototype.eval = function (context) { return this; }; Dimension.prototype.toColor = function () { return new Color([this.value, this.value, this.value]); }; Dimension.prototype.genCSS = function (context, output) { if ((context && context.strictUnits) && !this.unit.isSingular()) { throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: " + this.unit.toString()); } var value = this.fround(context, this.value); var strValue = String(value); if (value !== 0 && value < 0.000001 && value > -0.000001) { // would be output 1e-6 etc. strValue = value.toFixed(20).replace(/0+$/, ''); } if (context && context.compress) { // Zero values doesn't need a unit if (value === 0 && this.unit.isLength()) { output.add(strValue); return; } // Float values doesn't need a leading zero if (value > 0 && value < 1) { strValue = (strValue).substr(1); } } output.add(strValue); this.unit.genCSS(context, output); }; // In an operation between two Dimensions, // we default to the first Dimension's unit, // so `1px + 2` will yield `3px`. Dimension.prototype.operate = function (context, op, other) { /* jshint noempty:false */ var value = this._operate(context, op, this.value, other.value); var unit = this.unit.clone(); if (op === '+' || op === '-') { if (unit.numerator.length === 0 && unit.denominator.length === 0) { unit = other.unit.clone(); if (this.unit.backupUnit) { unit.backupUnit = this.unit.backupUnit; } } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) ; else { other = other.convertTo(this.unit.usedUnits()); if (context.strictUnits && other.unit.toString() !== unit.toString()) { throw new Error("Incompatible units. Change the units or use the unit function. " + ("Bad units: '" + unit.toString() + "' and '" + other.unit.toString() + "'.")); } value = this._operate(context, op, this.value, other.value); } } else if (op === '*') { unit.numerator = unit.numerator.concat(other.unit.numerator).sort(); unit.denominator = unit.denominator.concat(other.unit.denominator).sort(); unit.cancel(); } else if (op === '/') { unit.numerator = unit.numerator.concat(other.unit.denominator).sort(); unit.denominator = unit.denominator.concat(other.unit.numerator).sort(); unit.cancel(); } return new Dimension(value, unit); }; Dimension.prototype.compare = function (other) { var a; var b; if (!(other instanceof Dimension)) { return undefined; } if (this.unit.isEmpty() || other.unit.isEmpty()) { a = this; b = other; } else { a = this.unify(); b = other.unify(); if (a.unit.compare(b.unit) !== 0) { return undefined; } } return Node.numericCompare(a.value, b.value); }; Dimension.prototype.unify = function () { return this.convertTo({ length: 'px', duration: 's', angle: 'rad' }); }; Dimension.prototype.convertTo = function (conversions) { var value = this.value; var unit = this.unit.clone(); var i; var groupName; var group; var targetUnit; var derivedConversions = {}; var applyUnit; if (typeof conversions === 'string') { for (i in unitConversions) { if (unitConversions[i].hasOwnProperty(conversions)) { derivedConversions = {}; derivedConversions[i] = conversions; } } conversions = derivedConversions; } applyUnit = function (atomicUnit, denominator) { /* jshint loopfunc:true */ if (group.hasOwnProperty(atomicUnit)) { if (denominator) { value = value / (group[atomicUnit] / group[targetUnit]); } else { value = value * (group[atomicUnit] / group[targetUnit]); } return targetUnit; } return atomicUnit; }; for (groupName in conversions) { if (conversions.hasOwnProperty(groupName)) { targetUnit = conversions[groupName]; group = unitConversions[groupName]; unit.map(applyUnit); } } unit.cancel(); return new Dimension(value, unit); }; return Dimension; }(Node)); Dimension.prototype.type = 'Dimension'; var MATH$1 = Math$1; var Operation = /** @class */ (function (_super) { __extends(Operation, _super); function Operation(op, operands, isSpaced) { var _this = _super.call(this) || this; _this.op = op.trim(); _this.operands = operands; _this.isSpaced = isSpaced; return _this; } Operation.prototype.accept = function (visitor) { this.operands = visitor.visitArray(this.operands); }; Operation.prototype.eval = function (context) { var a = this.operands[0].eval(context); var b = this.operands[1].eval(context); var op; if (context.isMathOn(this.op)) { op = this.op === './' ? '/' : this.op; if (a instanceof Dimension && b instanceof Color) { a = a.toColor(); } if (b instanceof Dimension && a instanceof Color) { b = b.toColor(); } if (!a.operate) { if (a instanceof Operation && a.op === '/' && context.math === MATH$1.PARENS_DIVISION) { return new Operation(this.op, [a, b], this.isSpaced); } throw { type: 'Operation', message: 'Operation on an invalid type' }; } return a.operate(context, op, b); } else { return new Operation(this.op, [a, b], this.isSpaced); } }; Operation.prototype.genCSS = function (context, output) { this.operands[0].genCSS(context, output); if (this.isSpaced) { output.add(' '); } output.add(this.op); if (this.isSpaced) { output.add(' '); } this.operands[1].genCSS(context, output); }; return Operation; }(Node)); Operation.prototype.type = 'Operation'; var MATH$2 = Math$1; var Expression = /** @class */ (function (_super) { __extends(Expression, _super); function Expression(value, noSpacing) { var _this = _super.call(this) || this; _this.value = value; _this.noSpacing = noSpacing; if (!value) { throw new Error('Expression requires an array parameter'); } return _this; } Expression.prototype.accept = function (visitor) { this.value = visitor.visitArray(this.value); }; Expression.prototype.eval = function (context) { var returnValue; var mathOn = context.isMathOn(); var inParenthesis = this.parens && (context.math !== MATH$2.STRICT_LEGACY || !this.parensInOp); var doubleParen = false; if (inParenthesis) { context.inParenthesis(); } if (this.value.length > 1) { returnValue = new Expression(this.value.map(function (e) { if (!e.eval) { return e; } return e.eval(context); }), this.noSpacing); } else if (this.value.length === 1) { if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) { doubleParen = true; } returnValue = this.value[0].eval(context); } else { returnValue = this; } if (inParenthesis) { context.outOfParenthesis(); } if (this.parens && this.parensInOp && !mathOn && !doubleParen && (!(returnValue instanceof Dimension))) { returnValue = new Paren(returnValue); } return returnValue; }; Expression.prototype.genCSS = function (context, output) { for (var i_1 = 0; i_1 < this.value.length; i_1++) { this.value[i_1].genCSS(context, output); if (!this.noSpacing && i_1 + 1 < this.value.length) { output.add(' '); } } }; Expression.prototype.throwAwayComments = function () { this.value = this.value.filter(function (v) { return !(v instanceof Comment); }); }; return Expression; }(Node)); Expression.prototype.type = 'Expression'; var functionCaller = /** @class */ (function () { function functionCaller(name, context, index, currentFileInfo) { this.name = name.toLowerCase(); this.index = index; this.context = context; this.currentFileInfo = currentFileInfo; this.func = context.frames[0].functionRegistry.get(this.name); } functionCaller.prototype.isValid = function () { return Boolean(this.func); }; functionCaller.prototype.call = function (args) { // This code is terrible and should be replaced as per this issue... // https://github.com/less/less.js/issues/2477 if (Array.isArray(args)) { args = args.filter(function (item) { if (item.type === 'Comment') { return false; } return true; }) .map(function (item) { if (item.type === 'Expression') { var subNodes = item.value.filter(function (item) { if (item.type === 'Comment') { return false; } return true; }); if (subNodes.length === 1) { return subNodes[0]; } else { return new Expression(subNodes); } } return item; }); } return this.func.apply(this, args); }; return functionCaller; }()); // // A function call node. // var Call = /** @class */ (function (_super) { __extends(Call, _super); function Call(name, args, index, currentFileInfo) { var _this = _super.call(this) || this; _this.name = name; _this.args = args; _this.calc = name === 'calc'; _this._index = index; _this._fileInfo = currentFileInfo; return _this; } Call.prototype.accept = function (visitor) { if (this.args) { this.args = visitor.visitArray(this.args); } }; // // When evaluating a function call, // we either find the function in the functionRegistry, // in which case we call it, passing the evaluated arguments, // if this returns null or we cannot find the function, we // simply print it out as it appeared originally [2]. // // The reason why we evaluate the arguments, is in the case where // we try to pass a variable to a function, like: `saturate(@color)`. // The function should receive the value, not the variable. // Call.prototype.eval = function (context) { /** * Turn off math for calc(), and switch back on for evaluating nested functions */ var currentMathContext = context.mathOn; context.mathOn = !this.calc; if (this.calc || context.inCalc) { context.enterCalc(); } var args = this.args.map(function (a) { return a.eval(context); }); if (this.calc || context.inCalc) { context.exitCalc(); } context.mathOn = currentMathContext; var result; var funcCaller = new functionCaller(this.name, context, this.getIndex(), this.fileInfo()); if (funcCaller.isValid()) { try { result = funcCaller.call(args); } catch (e) { throw { type: e.type || 'Runtime', message: "error evaluating function `" + this.name + "`" + (e.message ? ": " + e.message : ''), index: this.getIndex(), filename: this.fileInfo().filename, line: e.lineNumber, column: e.columnNumber }; } if (result !== null && result !== undefined) { // Results that that are not nodes are cast as Anonymous nodes // Falsy values or booleans are returned as empty nodes if (!(result instanceof Node)) { if (!result || result === true) { result = new Anonymous(null); } else { result = new Anonymous(result.toString()); } } result._index = this._index; result._fileInfo = this._fileInfo; return result; } } return new Call(this.name, args, this.getIndex(), this.fileInfo()); }; Call.prototype.genCSS = function (context, output) { output.add(this.name + "(", this.fileInfo(), this.getIndex()); for (var i_1 = 0; i_1 < this.args.length; i_1++) { this.args[i_1].genCSS(context, output); if (i_1 + 1 < this.args.length) { output.add(', '); } } output.add(')'); }; return Call; }(Node)); Call.prototype.type = 'Call'; var Variable = /** @class */ (function (_super) { __extends(Variable, _super); function Variable(name, index, currentFileInfo) { var _this = _super.call(this) || this; _this.name = name; _this._index = index; _this._fileInfo = currentFileInfo; return _this; } Variable.prototype.eval = function (context) { var variable; var name = this.name; if (name.indexOf('@@') === 0) { name = "@" + new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value; } if (this.evaluating) { throw { type: 'Name', message: "Recursive variable definition for " + name, filename: this.fileInfo().filename, index: this.getIndex() }; } this.evaluating = true; variable = this.find(context.frames, function (frame) { var v = frame.variable(name); if (v) { if (v.important) { var importantScope = context.importantScope[context.importantScope.length - 1]; importantScope.important = v.important; } // If in calc, wrap vars in a function call to cascade evaluate args first if (context.inCalc) { return (new Call('_SELF', [v.value])).eval(context); } else { return v.value.eval(context); } } }); if (variable) { this.evaluating = false; return variable; } else { throw { type: 'Name', message: "variable " + name + " is undefined", filename: this.fileInfo().filename, index: this.getIndex() }; } }; Variable.prototype.find = function (obj, fun) { for (var i_1 = 0, r = void 0; i_1 < obj.length; i_1++) { r = fun.call(obj, obj[i_1]); if (r) { return r; } } return null; }; return Variable; }(Node)); Variable.prototype.type = 'Variable'; var Property = /** @class */ (function (_super) { __extends(Property, _super); function Property(name, index, currentFileInfo) { var _this = _super.call(this) || this; _this.name = name; _this._index = index; _this._fileInfo = currentFileInfo; return _this; } Property.prototype.eval = function (context) { var property; var name = this.name; // TODO: shorten this reference var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; if (this.evaluating) { throw { type: 'Name', message: "Recursive property reference for " + name, filename: this.fileInfo().filename, index: this.getIndex() }; } this.evaluating = true; property = this.find(context.frames, function (frame) { var v; var vArr = frame.property(name); if (vArr) { for (var i_1 = 0; i_1 < vArr.length; i_1++) { v = vArr[i_1]; vArr[i_1] = new Declaration(v.name, v.value, v.important, v.merge, v.index, v.currentFileInfo, v.inline, v.variable); } mergeRules(vArr); v = vArr[vArr.length - 1]; if (v.important) { var importantScope = context.importantScope[context.importantScope.length - 1]; importantScope.important = v.important; } v = v.value.eval(context); return v; } }); if (property) { this.evaluating = false; return property; } else { throw { type: 'Name', message: "Property '" + name + "' is undefined", filename: this.currentFileInfo.filename, index: this.index }; } }; Property.prototype.find = function (obj, fun) { for (var i_2 = 0, r = void 0; i_2 < obj.length; i_2++) { r = fun.call(obj, obj[i_2]); if (r) { return r; } } return null; }; return Property; }(Node)); Property.prototype.type = 'Property'; var Attribute = /** @class */ (function (_super) { __extends(Attribute, _super); function Attribute(key, op, value) { var _this = _super.call(this) || this; _this.key = key; _this.op = op; _this.value = value; return _this; } Attribute.prototype.eval = function (context) { return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value); }; Attribute.prototype.genCSS = function (context, output) { output.add(this.toCSS(context)); }; Attribute.prototype.toCSS = function (context) { var value = this.key.toCSS ? this.key.toCSS(context) : this.key; if (this.op) { value += this.op; value += (this.value.toCSS ? this.value.toCSS(context) : this.value); } return "[" + value + "]"; }; return Attribute; }(Node)); Attribute.prototype.type = 'Attribute'; var Quoted = /** @class */ (function (_super) { __extends(Quoted, _super); function Quoted(str, content, escaped, index, currentFileInfo) { var _this = _super.call(this) || this; _this.escaped = (escaped == null) ? true : escaped; _this.value = content || ''; _this.quote = str.charAt(0); _this._index = index; _this._fileInfo = currentFileInfo; _this.variableRegex = /@\{([\w-]+)\}/g; _this.propRegex = /\$\{([\w-]+)\}/g; _this.allowRoot = escaped; return _this; } Quoted.prototype.genCSS = function (context, output) { if (!this.escaped) { output.add(this.quote, this.fileInfo(), this.getIndex()); } output.add(this.value); if (!this.escaped) { output.add(this.quote); } }; Quoted.prototype.containsVariables = function () { return this.value.match(this.variableRegex); }; Quoted.prototype.eval = function (context) { var that = this; var value = this.value; var variableReplacement = function (_, name) { var v = new Variable("@" + name, that.getIndex(), that.fileInfo()).eval(context, true); return (v instanceof Quoted) ? v.value : v.toCSS(); }; var propertyReplacement = function (_, name) { var v = new Property("$" + name, that.getIndex(), that.fileInfo()).eval(context, true); return (v instanceof Quoted) ? v.value : v.toCSS(); }; function iterativeReplace(value, regexp, replacementFnc) { var evaluatedValue = value; do { value = evaluatedValue.toString(); evaluatedValue = value.replace(regexp, replacementFnc); } while (value !== evaluatedValue); return evaluatedValue; } value = iterativeReplace(value, this.variableRegex, variableReplacement); value = iterativeReplace(value, this.propRegex, propertyReplacement); return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); }; Quoted.prototype.compare = function (other) { // when comparing quoted strings allow the quote to differ if (other.type === 'Quoted' && !this.escaped && !other.escaped) { return Node.numericCompare(this.value, other.value); } else { return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined; } }; return Quoted; }(Node)); Quoted.prototype.type = 'Quoted'; var URL = /** @class */ (function (_super) { __extends(URL, _super); function URL(val, index, currentFileInfo, isEvald) { var _this = _super.call(this) || this; _this.value = val; _this._index = index; _this._fileInfo = currentFileInfo; _this.isEvald = isEvald; return _this; } URL.prototype.accept = function (visitor) { this.value = visitor.visit(this.value); }; URL.prototype.genCSS = function (context, output) { output.add('url('); this.value.genCSS(context, output); output.add(')'); }; URL.prototype.eval = function (context) { var val = this.value.eval(context); var rootpath; if (!this.isEvald) { // Add the rootpath if the URL requires a rewrite rootpath = this.fileInfo() && this.fileInfo().rootpath; if (typeof rootpath === 'string' && typeof val.value === 'string' && context.pathRequiresRewrite(val.value)) { if (!val.quote) { rootpath = escapePath(rootpath); } val.value = context.rewritePath(val.value, rootpath); } else { val.value = context.normalizePath(val.value); } // Add url args if enabled if (context.urlArgs) { if (!val.value.match(/^\s*data:/)) { var delimiter = val.value.indexOf('?') === -1 ? '?' : '&'; var urlArgs = delimiter + context.urlArgs; if (val.value.indexOf('#') !== -1) { val.value = val.value.replace('#', urlArgs + "#"); } else { val.value += urlArgs; } } } } return new URL(val, this.getIndex(), this.fileInfo(), true); }; return URL; }(Node)); URL.prototype.type = 'Url'; function escapePath(path) { return path.replace(/[\(\)'"\s]/g, function (match) { return "\\" + match; }); } var Media = /** @class */ (function (_super) { __extends(Media, _super); function Media(value, features, index, currentFileInfo, visibilityInfo) { var _this = _super.call(this) || this; _this._index = index; _this._fileInfo = currentFileInfo; var selectors = (new Selector([], null, null, _this._index, _this._fileInfo)).createEmptySelectors(); _this.features = new Value(features); _this.rules = [new Ruleset(selectors, value)]; _this.rules[0].allowImports = true; _this.copyVisibilityInfo(visibilityInfo); _this.allowRoot = true; _this.setParent(selectors, _this); _this.setParent(_this.features, _this); _this.setParent(_this.rules, _this); return _this; } Media.prototype.isRulesetLike = function () { return true; }; Media.prototype.accept = function (visitor) { if (this.features) { this.features = visitor.visit(this.features); } if (this.rules) { this.rules = visitor.visitArray(this.rules); } }; Media.prototype.genCSS = function (context, output) { output.add('@media ', this._fileInfo, this._index); this.features.genCSS(context, output); this.outputRuleset(context, output, this.rules); }; Media.prototype.eval = function (context) { if (!context.mediaBlocks) { context.mediaBlocks = []; context.mediaPath = []; } var media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo()); if (this.debugInfo) { this.rules[0].debugInfo = this.debugInfo; media.debugInfo = this.debugInfo; } media.features = this.features.eval(context); context.mediaPath.push(media); context.mediaBlocks.push(media); this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); context.frames.unshift(this.rules[0]); media.rules = [this.rules[0].eval(context)]; context.frames.shift(); context.mediaPath.pop(); return context.mediaPath.length === 0 ? media.evalTop(context) : media.evalNested(context); }; Media.prototype.evalTop = function (context) { var result = this; // Render all dependent Media blocks. if (context.mediaBlocks.length > 1) { var selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors(); result = new Ruleset(selectors, context.mediaBlocks); result.multiMedia = true; result.copyVisibilityInfo(this.visibilityInfo()); this.setParent(result, this); } delete context.mediaBlocks; delete context.mediaPath; return result; }; Media.prototype.evalNested = function (context) { var i; var value; var path = context.mediaPath.concat([this]); // Extract the media-query conditions separated with `,` (OR). for (i = 0; i < path.length; i++) { value = path[i].features instanceof Value ? path[i].features.value : path[i].features; path[i] = Array.isArray(value) ? value : [value]; } // Trace all permutations to generate the resulting media-query. // // (a, b and c) with nested (d, e) -> // a and d // a and e // b and c and d // b and c and e this.features = new Value(this.permute(path).map(function (path) { path = path.map(function (fragment) { return fragment.toCSS ? fragment : new Anonymous(fragment); }); for (i = path.length - 1; i > 0; i--) { path.splice(i, 0, new Anonymous('and')); } return new Expression(path); })); this.setParent(this.features, this); // Fake a tree-node that doesn't output anything. return new Ruleset([], []); }; Media.prototype.permute = function (arr) { if (arr.length === 0) { return []; } else if (arr.length === 1) { return arr[0]; } else { var result = []; var rest = this.permute(arr.slice(1)); for (var i_1 = 0; i_1 < rest.length; i_1++) { for (var j = 0; j < arr[0].length; j++) { result.push([arr[0][j]].concat(rest[i_1])); } } return result; } }; Media.prototype.bubbleSelectors = function (selectors) { if (!selectors) { return; } this.rules = [new Ruleset(copyArray(selectors), [this.rules[0]])]; this.setParent(this.rules, this); }; return Media; }(AtRule)); Media.prototype.type = 'Media'; // // CSS @import node // // The general strategy here is that we don't want to wait // for the parsing to be completed, before we start importing // the file. That's because in the context of a browser, // most of the time will be spent waiting for the server to respond. // // On creation, we push the import path to our import queue, though // `import,push`, we also pass it a callback, which it'll call once // the file has been fetched, and parsed. // var Import = /** @class */ (function (_super) { __extends(Import, _super); function Import(path, features, options, index, currentFileInfo, visibilityInfo) { var _this = _super.call(this) || this; _this.options = options; _this._index = index; _this._fileInfo = currentFileInfo; _this.path = path; _this.features = features; _this.allowRoot = true; if (_this.options.less !== undefined || _this.options.inline) { _this.css = !_this.options.less || _this.options.inline; } else { var pathValue = _this.getPath(); if (pathValue && /[#\.\&\?]css([\?;].*)?$/.test(pathValue)) { _this.css = true; } } _this.copyVisibilityInfo(visibilityInfo); _this.setParent(_this.features, _this); _this.setParent(_this.path, _this); return _this; } Import.prototype.accept = function (visitor) { if (this.features) { this.features = visitor.visit(this.features); } this.path = visitor.visit(this.path); if (!this.options.isPlugin && !this.options.inline && this.root) { this.root = visitor.visit(this.root); } }; Import.prototype.genCSS = function (context, output) { if (this.css && this.path._fileInfo.reference === undefined) { output.add('@import ', this._fileInfo, this._index); this.path.genCSS(context, output); if (this.features) { output.add(' '); this.features.genCSS(context, output); } output.add(';'); } }; Import.prototype.getPath = function () { return (this.path instanceof URL) ? this.path.value.value : this.path.value; }; Import.prototype.isVariableImport = function () { var path = this.path; if (path instanceof URL) { path = path.value; } if (path instanceof Quoted) { return path.containsVariables(); } return true; }; Import.prototype.evalForImport = function (context) { var path = this.path; if (path instanceof URL) { path = path.value; } return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo()); }; Import.prototype.evalPath = function (context) { var path = this.path.eval(context); var fileInfo = this._fileInfo; if (!(path instanceof URL)) { // Add the rootpath if the URL requires a rewrite var pathValue = path.value; if (fileInfo && pathValue && context.pathRequiresRewrite(pathValue)) { path.value = context.rewritePath(pathValue, fileInfo.rootpath); } else { path.value = context.normalizePath(path.value); } } return path; }; Import.prototype.eval = function (context) { var result = this.doEval(context); if (this.options.reference || this.blocksVisibility()) { if (result.length || result.length === 0) { result.forEach(function (node) { node.addVisibilityBlock(); }); } else { result.addVisibilityBlock(); } } return result; }; Import.prototype.doEval = function (context) { var ruleset; var registry; var features = this.features && this.features.eval(context); if (this.options.isPlugin) { if (this.root && this.root.eval) { try { this.root.eval(context); } catch (e) { e.message = 'Plugin error during evaluation'; throw new LessError(e, this.root.imports, this.root.filename); } } registry = context.frames[0] && context.frames[0].functionRegistry; if (registry && this.root && this.root.functions) { registry.addMultiple(this.root.functions); } return []; } if (this.skip) { if (typeof this.skip === 'function') { this.skip = this.skip(); } if (this.skip) { return []; } } if (this.options.inline) { var contents = new Anonymous(this.root, 0, { filename: this.importedFilename, reference: this.path._fileInfo && this.path._fileInfo.reference }, true, true); return this.features ? new Media([contents], this.features.value) : [contents]; } else if (this.css) { var newImport = new Import(this.evalPath(context), features, this.options, this._index); if (!newImport.css && this.error) { throw this.error; } return newImport; } else { ruleset = new Ruleset(null, copyArray(this.root.rules)); ruleset.evalImports(context); return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules; } }; return Import; }(Node)); Import.prototype.type = 'Import'; var JsEvalNode = /** @class */ (function (_super) { __extends(JsEvalNode, _super); function JsEvalNode() { return _super !== null && _super.apply(this, arguments) || this; } JsEvalNode.prototype.evaluateJavaScript = function (expression, context) { var result; var that = this; var evalContext = {}; if (!context.javascriptEnabled) { throw { message: 'Inline JavaScript is not enabled. Is it set in your options?', filename: this.fileInfo().filename, index: this.getIndex() }; } expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) { return that.jsify(new Variable("@" + name, that.getIndex(), that.fileInfo()).eval(context)); }); try { expression = new Function("return (" + expression + ")"); } catch (e) { throw { message: "JavaScript evaluation error: " + e.message + " from `" + expression + "`", filename: this.fileInfo().filename, index: this.getIndex() }; } var variables = context.frames[0].variables(); for (var k in variables) { if (variables.hasOwnProperty(k)) { /* jshint loopfunc:true */ evalContext[k.slice(1)] = { value: variables[k].value, toJS: function () { return this.value.eval(context).toCSS(); } }; } } try { result = expression.call(evalContext); } catch (e) { throw { message: "JavaScript evaluation error: '" + e.name + ": " + e.message.replace(/["]/g, '\'') + "'", filename: this.fileInfo().filename, index: this.getIndex() }; } return result; }; JsEvalNode.prototype.jsify = function (obj) { if (Array.isArray(obj.value) && (obj.value.length > 1)) { return "[" + obj.value.map(function (v) { return v.toCSS(); }).join(', ') + "]"; } else { return obj.toCSS(); } }; return JsEvalNode; }(Node)); var JavaScript = /** @class */ (function (_super) { __extends(JavaScript, _super); function JavaScript(string, escaped, index, currentFileInfo) { var _this = _super.call(this) || this; _this.escaped = escaped; _this.expression = string; _this._index = index; _this._fileInfo = currentFileInfo; return _this; } JavaScript.prototype.eval = function (context) { var result = this.evaluateJavaScript(this.expression, context); var type = typeof result; if (type === 'number' && !isNaN(result)) { return new Dimension(result); } else if (type === 'string') { return new Quoted("\"" + result + "\"", result, this.escaped, this._index); } else if (Array.isArray(result)) { return new Anonymous(result.join(', ')); } else { return new Anonymous(result); } }; return JavaScript; }(JsEvalNode)); JavaScript.prototype.type = 'JavaScript'; var Assignment = /** @class */ (function (_super) { __extends(Assignment, _super); function Assignment(key, val) { var _this = _super.call(this) || this; _this.key = key; _this.value = val; return _this; } Assignment.prototype.accept = function (visitor) { this.value = visitor.visit(this.value); }; Assignment.prototype.eval = function (context) { if (this.value.eval) { return new Assignment(this.key, this.value.eval(context)); } return this; }; Assignment.prototype.genCSS = function (context, output) { output.add(this.key + "="); if (this.value.genCSS) { this.value.genCSS(context, output); } else { output.add(this.value); } }; return Assignment; }(Node)); Assignment.prototype.type = 'Assignment'; var Condition = /** @class */ (function (_super) { __extends(Condition, _super); function Condition(op, l, r, i, negate) { var _this = _super.call(this) || this; _this.op = op.trim(); _this.lvalue = l; _this.rvalue = r; _this._index = i; _this.negate = negate; return _this; } Condition.prototype.accept = function (visitor) { this.lvalue = visitor.visit(this.lvalue); this.rvalue = visitor.visit(this.rvalue); }; Condition.prototype.eval = function (context) { var result = (function (op, a, b) { switch (op) { case 'and': return a && b; case 'or': return a || b; default: switch (Node.compare(a, b)) { case -1: return op === '<' || op === '=<' || op === '<='; case 0: return op === '=' || op === '>=' || op === '=<' || op === '<='; case 1: return op === '>' || op === '>='; default: return false; } } })(this.op, this.lvalue.eval(context), this.rvalue.eval(context)); return this.negate ? !result : result; }; return Condition; }(Node)); Condition.prototype.type = 'Condition'; var UnicodeDescriptor = /** @class */ (function (_super) { __extends(UnicodeDescriptor, _super); function UnicodeDescriptor(value) { var _this = _super.call(this) || this; _this.value = value; return _this; } return UnicodeDescriptor; }(Node)); UnicodeDescriptor.prototype.type = 'UnicodeDescriptor'; var Negative = /** @class */ (function (_super) { __extends(Negative, _super); function Negative(node) { var _this = _super.call(this) || this; _this.value = node; return _this; } Negative.prototype.genCSS = function (context, output) { output.add('-'); this.value.genCSS(context, output); }; Negative.prototype.eval = function (context) { if (context.isMathOn()) { return (new Operation('*', [new Dimension(-1), this.value])).eval(context); } return new Negative(this.value.eval(context)); }; return Negative; }(Node)); Negative.prototype.type = 'Negative'; var Extend = /** @class */ (function (_super) { __extends(Extend, _super); function Extend(selector, option, index, currentFileInfo, visibilityInfo) { var _this = _super.call(this) || this; _this.selector = selector; _this.option = option; _this.object_id = Extend.next_id++; _this.parent_ids = [_this.object_id]; _this._index = index; _this._fileInfo = currentFileInfo; _this.copyVisibilityInfo(visibilityInfo); _this.allowRoot = true; switch (option) { case 'all': _this.allowBefore = true; _this.allowAfter = true; break; default: _this.allowBefore = false; _this.allowAfter = false; break; } _this.setParent(_this.selector, _this); return _this; } Extend.prototype.accept = function (visitor) { this.selector = visitor.visit(this.selector); }; Extend.prototype.eval = function (context) { return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }; Extend.prototype.clone = function (context) { return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }; // it concatenates (joins) all selectors in selector array Extend.prototype.findSelfSelectors = function (selectors) { var selfElements = []; var i; var selectorElements; for (i = 0; i < selectors.length; i++) { selectorElements = selectors[i].elements; // duplicate the logic in genCSS function inside the selector node. // future TODO - move both logics into the selector joiner visitor if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') { selectorElements[0].combinator.value = ' '; } selfElements = selfElements.concat(selectors[i].elements); } this.selfSelectors = [new Selector(selfElements)]; this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo()); }; return Extend; }(Node)); Extend.next_id = 0; Extend.prototype.type = 'Extend'; var VariableCall = /** @class */ (function (_super) { __extends(VariableCall, _super); function VariableCall(variable, index, currentFileInfo) { var _this = _super.call(this) || this; _this.variable = variable; _this._index = index; _this._fileInfo = currentFileInfo; _this.allowRoot = true; return _this; } VariableCall.prototype.eval = function (context) { var rules; var detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context); var error = new LessError({ message: "Could not evaluate variable call " + this.variable }); if (!detachedRuleset.ruleset) { if (detachedRuleset.rules) { rules = detachedRuleset; } else if (Array.isArray(detachedRuleset)) { rules = new Ruleset('', detachedRuleset); } else if (Array.isArray(detachedRuleset.value)) { rules = new Ruleset('', detachedRuleset.value); } else { throw error; } detachedRuleset = new DetachedRuleset(rules); } if (detachedRuleset.ruleset) { return detachedRuleset.callEval(context); } throw error; }; return VariableCall; }(Node)); VariableCall.prototype.type = 'VariableCall'; var NamespaceValue = /** @class */ (function (_super) { __extends(NamespaceValue, _super); function NamespaceValue(ruleCall, lookups, index, fileInfo) { var _this = _super.call(this) || this; _this.value = ruleCall; _this.lookups = lookups; _this._index = index; _this._fileInfo = fileInfo; return _this; } NamespaceValue.prototype.eval = function (context) { var i; var name; var rules = this.value.eval(context); for (i = 0; i < this.lookups.length; i++) { name = this.lookups[i]; /** * Eval'd DRs return rulesets. * Eval'd mixins return rules, so let's make a ruleset if we need it. * We need to do this because of late parsing of values */ if (Array.isArray(rules)) { rules = new Ruleset([new Selector()], rules); } if (name === '') { rules = rules.lastDeclaration(); } else if (name.charAt(0) === '@') { if (name.charAt(1) === '@') { name = "@" + new Variable(name.substr(1)).eval(context).value; } if (rules.variables) { rules = rules.variable(name); } if (!rules) { throw { type: 'Name', message: "variable " + name + " not found", filename: this.fileInfo().filename, index: this.getIndex() }; } } else { if (name.substring(0, 2) === '$@') { name = "$" + new Variable(name.substr(1)).eval(context).value; } else { name = name.charAt(0) === '$' ? name : "$" + name; } if (rules.properties) { rules = rules.property(name); } if (!rules) { throw { type: 'Name', message: "property \"" + name.substr(1) + "\" not found", filename: this.fileInfo().filename, index: this.getIndex() }; } // Properties are an array of values, since a ruleset can have multiple props. // We pick the last one (the "cascaded" value) rules = rules[rules.length - 1]; } if (rules.value) { rules = rules.eval(context).value; } if (rules.ruleset) { rules = rules.ruleset.eval(context); } } return rules; }; return NamespaceValue; }(Node)); NamespaceValue.prototype.type = 'NamespaceValue'; var Definition = /** @class */ (function (_super) { __extends(Definition, _super); function Definition(name, params, rules, condition, variadic, frames, visibilityInfo) { var _this = _super.call(this) || this; _this.name = name || 'anonymous mixin'; _this.selectors = [new Selector([new Element(null, name, false, _this._index, _this._fileInfo)])]; _this.params = params; _this.condition = condition; _this.variadic = variadic; _this.arity = params.length; _this.rules = rules; _this._lookups = {}; var optionalParameters = []; _this.required = params.reduce(function (count, p) { if (!p.name || (p.name && !p.value)) { return count + 1; } else { optionalParameters.push(p.name); return count; } }, 0); _this.optionalParameters = optionalParameters; _this.frames = frames; _this.copyVisibilityInfo(visibilityInfo); _this.allowRoot = true; return _this; } Definition.prototype.accept = function (visitor) { if (this.params && this.params.length) { this.params = visitor.visitArray(this.params); } this.rules = visitor.visitArray(this.rules); if (this.condition) { this.condition = visitor.visit(this.condition); } }; Definition.prototype.evalParams = function (context, mixinEnv, args, evaldArguments) { /* jshint boss:true */ var frame = new Ruleset(null, null); var varargs; var arg; var params = copyArray(this.params); var i; var j; var val; var name; var isNamedFound; var argIndex; var argsLength = 0; if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) { frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit(); } mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames)); if (args) { args = copyArray(args); argsLength = args.length; for (i = 0; i < argsLength; i++) { arg = args[i]; if (name = (arg && arg.name)) { isNamedFound = false; for (j = 0; j < params.length; j++) { if (!evaldArguments[j] && name === params[j].name) { evaldArguments[j] = arg.value.eval(context); frame.prependRule(new Declaration(name, arg.value.eval(context))); isNamedFound = true; break; } } if (isNamedFound) { args.splice(i, 1); i--; continue; } else { throw { type: 'Runtime', message: "Named argument for " + this.name + " " + args[i].name + " not found" }; } } } } argIndex = 0; for (i = 0; i < params.length; i++) { if (evaldArguments[i]) { continue; } arg = args && args[argIndex]; if (name = params[i].name) { if (params[i].variadic) { varargs = []; for (j = argIndex; j < argsLength; j++) { varargs.push(args[j].value.eval(context)); } frame.prependRule(new Declaration(name, new Expression(varargs).eval(context))); } else { val = arg && arg.value; if (val) { // This was a mixin call, pass in a detached ruleset of it's eval'd rules if (Array.isArray(val)) { val = new DetachedRuleset(new Ruleset('', val)); } else { val = val.eval(context); } } else if (params[i].value) { val = params[i].value.eval(mixinEnv); frame.resetCache(); } else { throw { type: 'Runtime', message: "wrong number of arguments for " + this.name + " (" + argsLength + " for " + this.arity + ")" }; } frame.prependRule(new Declaration(name, val)); evaldArguments[i] = val; } } if (params[i].variadic && args) { for (j = argIndex; j < argsLength; j++) { evaldArguments[j] = args[j].value.eval(context); } } argIndex++; } return frame; }; Definition.prototype.makeImportant = function () { var rules = !this.rules ? this.rules : this.rules.map(function (r) { if (r.makeImportant) { return r.makeImportant(true); } else { return r; } }); var result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames); return result; }; Definition.prototype.eval = function (context) { return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || copyArray(context.frames)); }; Definition.prototype.evalCall = function (context, args, important) { var _arguments = []; var mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames; var frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments); var rules; var ruleset; frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context))); rules = copyArray(this.rules); ruleset = new Ruleset(null, rules); ruleset.originalRuleset = this; ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames))); if (important) { ruleset = ruleset.makeImportant(); } return ruleset; }; Definition.prototype.matchCondition = function (args, context) { if (this.condition && !this.condition.eval(new contexts.Eval(context, [this.evalParams(context, /* the parameter variables */ new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])] .concat(this.frames || []) // the parent namespace/mixin frames .concat(context.frames)))) { // the current environment frames return false; } return true; }; Definition.prototype.matchArgs = function (args, context) { var allArgsCnt = (args && args.length) || 0; var len; var optionalParameters = this.optionalParameters; var requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) { if (optionalParameters.indexOf(p.name) < 0) { return count + 1; } else { return count; } }, 0); if (!this.variadic) { if (requiredArgsCnt < this.required) { return false; } if (allArgsCnt > this.params.length) { return false; } } else { if (requiredArgsCnt < (this.required - 1)) { return false; } } // check patterns len = Math.min(requiredArgsCnt, this.arity); for (var i_1 = 0; i_1 < len; i_1++) { if (!this.params[i_1].name && !this.params[i_1].variadic) { if (args[i_1].value.eval(context).toCSS() != this.params[i_1].value.eval(context).toCSS()) { return false; } } } return true; }; return Definition; }(Ruleset)); Definition.prototype.type = 'MixinDefinition'; Definition.prototype.evalFirst = true; var MixinCall = /** @class */ (function (_super) { __extends(MixinCall, _super); function MixinCall(elements, args, index, currentFileInfo, important) { var _this = _super.call(this) || this; _this.selector = new Selector(elements); _this.arguments = args || []; _this._index = index; _this._fileInfo = currentFileInfo; _this.important = important; _this.allowRoot = true; _this.setParent(_this.selector, _this); return _this; } MixinCall.prototype.accept = function (visitor) { if (this.selector) { this.selector = visitor.visit(this.selector); } if (this.arguments.length) { this.arguments = visitor.visitArray(this.arguments); } }; MixinCall.prototype.eval = function (context) { var mixins; var mixin; var mixinPath; var args = []; var arg; var argValue; var rules = []; var match = false; var i; var m; var f; var isRecursive; var isOneFound; var candidates = []; var candidate; var conditionResult = []; var defaultResult; var defFalseEitherCase = -1; var defNone = 0; var defTrue = 1; var defFalse = 2; var count; var originalRuleset; var noArgumentsFilter; this.selector = this.selector.eval(context); function calcDefGroup(mixin, mixinPath) { var f; var p; var namespace; for (f = 0; f < 2; f++) { conditionResult[f] = true; defaultFunc.value(f); for (p = 0; p < mixinPath.length && conditionResult[f]; p++) { namespace = mixinPath[p]; if (namespace.matchCondition) { conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context); } } if (mixin.matchCondition) { conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context); } } if (conditionResult[0] || conditionResult[1]) { if (conditionResult[0] != conditionResult[1]) { return conditionResult[1] ? defTrue : defFalse; } return defNone; } return defFalseEitherCase; } for (i = 0; i < this.arguments.length; i++) { arg = this.arguments[i]; argValue = arg.value.eval(context); if (arg.expand && Array.isArray(argValue.value)) { argValue = argValue.value; for (m = 0; m < argValue.length; m++) { args.push({ value: argValue[m] }); } } else { args.push({ name: arg.name, value: argValue }); } } noArgumentsFilter = function (rule) { return rule.matchArgs(null, context); }; for (i = 0; i < context.frames.length; i++) { if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) { isOneFound = true; // To make `default()` function independent of definition order we have two "subpasses" here. // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`), // and build candidate list with corresponding flags. Then, when we know all possible matches, // we make a final decision. for (m = 0; m < mixins.length; m++) { mixin = mixins[m].rule; mixinPath = mixins[m].path; isRecursive = false; for (f = 0; f < context.frames.length; f++) { if ((!(mixin instanceof Definition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) { isRecursive = true; break; } } if (isRecursive) { continue; } if (mixin.matchArgs(args, context)) { candidate = { mixin: mixin, group: calcDefGroup(mixin, mixinPath) }; if (candidate.group !== defFalseEitherCase) { candidates.push(candidate); } match = true; } } defaultFunc.reset(); count = [0, 0, 0]; for (m = 0; m < candidates.length; m++) { count[candidates[m].group]++; } if (count[defNone] > 0) { defaultResult = defFalse; } else { defaultResult = defTrue; if ((count[defTrue] + count[defFalse]) > 1) { throw { type: 'Runtime', message: "Ambiguous use of `default()` found when matching for `" + this.format(args) + "`", index: this.getIndex(), filename: this.fileInfo().filename }; } } for (m = 0; m < candidates.length; m++) { candidate = candidates[m].group; if ((candidate === defNone) || (candidate === defaultResult)) { try { mixin = candidates[m].mixin; if (!(mixin instanceof Definition)) { originalRuleset = mixin.originalRuleset || mixin; mixin = new Definition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo()); mixin.originalRuleset = originalRuleset; } var newRules = mixin.evalCall(context, args, this.important).rules; this._setVisibilityToReplacement(newRules); Array.prototype.push.apply(rules, newRules); } catch (e) { throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack }; } } } if (match) { return rules; } } } if (isOneFound) { throw { type: 'Runtime', message: "No matching definition was found for `" + this.format(args) + "`", index: this.getIndex(), filename: this.fileInfo().filename }; } else { throw { type: 'Name', message: this.selector.toCSS().trim() + " is undefined", index: this.getIndex(), filename: this.fileInfo().filename }; } }; MixinCall.prototype._setVisibilityToReplacement = function (replacement) { var i; var rule; if (this.blocksVisibility()) { for (i = 0; i < replacement.length; i++) { rule = replacement[i]; rule.addVisibilityBlock(); } } }; MixinCall.prototype.format = function (args) { return this.selector.toCSS().trim() + "(" + (args ? args.map(function (a) { var argValue = ''; if (a.name) { argValue += a.name + ":"; } if (a.value.toCSS) { argValue += a.value.toCSS(); } else { argValue += '???'; } return argValue; }).join(', ') : '') + ")"; }; return MixinCall; }(Node)); MixinCall.prototype.type = 'MixinCall'; var tree = { Node: Node, Color: Color, AtRule: AtRule, DetachedRuleset: DetachedRuleset, Operation: Operation, Dimension: Dimension, Unit: Unit, Keyword: Keyword, Variable: Variable, Property: Property, Ruleset: Ruleset, Element: Element, Attribute: Attribute, Combinator: Combinator, Selector: Selector, Quoted: Quoted, Expression: Expression, Declaration: Declaration, Call: Call, URL: URL, Import: Import, Comment: Comment, Anonymous: Anonymous, Value: Value, JavaScript: JavaScript, Assignment: Assignment, Condition: Condition, Paren: Paren, Media: Media, UnicodeDescriptor: UnicodeDescriptor, Negative: Negative, Extend: Extend, VariableCall: VariableCall, NamespaceValue: NamespaceValue, mixin: { Call: MixinCall, Definition: Definition } }; var logger = { error: function (msg) { this._fireEvent('error', msg); }, warn: function (msg) { this._fireEvent('warn', msg); }, info: function (msg) { this._fireEvent('info', msg); }, debug: function (msg) { this._fireEvent('debug', msg); }, addListener: function (listener) { this._listeners.push(listener); }, removeListener: function (listener) { for (var i_1 = 0; i_1 < this._listeners.length; i_1++) { if (this._listeners[i_1] === listener) { this._listeners.splice(i_1, 1); return; } } }, _fireEvent: function (type, msg) { for (var i_2 = 0; i_2 < this._listeners.length; i_2++) { var logFunction = this._listeners[i_2][type]; if (logFunction) { logFunction(msg); } } }, _listeners: [] }; /** * @todo Document why this abstraction exists, and the relationship between * environment, file managers, and plugin manager */ var environment = /** @class */ (function () { function environment(externalEnvironment, fileManagers) { this.fileManagers = fileManagers || []; externalEnvironment = externalEnvironment || {}; var optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator']; var requiredFunctions = []; var functions = requiredFunctions.concat(optionalFunctions); for (var i_1 = 0; i_1 < functions.length; i_1++) { var propName = functions[i_1]; var environmentFunc = externalEnvironment[propName]; if (environmentFunc) { this[propName] = environmentFunc.bind(externalEnvironment); } else if (i_1 < requiredFunctions.length) { this.warn("missing required function in environment - " + propName); } } } environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) { if (!filename) { logger.warn('getFileManager called with no filename.. Please report this issue. continuing.'); } if (currentDirectory == null) { logger.warn('getFileManager called with null directory.. Please report this issue. continuing.'); } var fileManagers = this.fileManagers; if (options.pluginManager) { fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers()); } for (var i_2 = fileManagers.length - 1; i_2 >= 0; i_2--) { var fileManager = fileManagers[i_2]; if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) { return fileManager; } } return null; }; environment.prototype.addFileManager = function (fileManager) { this.fileManagers.push(fileManager); }; environment.prototype.clearFileManagers = function () { this.fileManagers = []; }; return environment; }()); var AbstractFileManager = /** @class */ (function () { function AbstractFileManager() { } AbstractFileManager.prototype.getPath = function (filename) { var j = filename.lastIndexOf('?'); if (j > 0) { filename = filename.slice(0, j); } j = filename.lastIndexOf('/'); if (j < 0) { j = filename.lastIndexOf('\\'); } if (j < 0) { return ''; } return filename.slice(0, j + 1); }; AbstractFileManager.prototype.tryAppendExtension = function (path, ext) { return /(\.[a-z]*$)|([\?;].*)$/.test(path) ? path : path + ext; }; AbstractFileManager.prototype.tryAppendLessExtension = function (path) { return this.tryAppendExtension(path, '.less'); }; AbstractFileManager.prototype.supportsSync = function () { return false; }; AbstractFileManager.prototype.alwaysMakePathsAbsolute = function () { return false; }; AbstractFileManager.prototype.isPathAbsolute = function (filename) { return (/^(?:[a-z-]+:|\/|\\|#)/i).test(filename); }; // TODO: pull out / replace? AbstractFileManager.prototype.join = function (basePath, laterPath) { if (!basePath) { return laterPath; } return basePath + laterPath; }; AbstractFileManager.prototype.pathDiff = function (url, baseUrl) { // diff between two paths to create a relative path var urlParts = this.extractUrlParts(url); var baseUrlParts = this.extractUrlParts(baseUrl); var i; var max; var urlDirectories; var baseUrlDirectories; var diff = ''; if (urlParts.hostPart !== baseUrlParts.hostPart) { return ''; } max = Math.max(baseUrlParts.directories.length, urlParts.directories.length); for (i = 0; i < max; i++) { if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; } } baseUrlDirectories = baseUrlParts.directories.slice(i); urlDirectories = urlParts.directories.slice(i); for (i = 0; i < baseUrlDirectories.length - 1; i++) { diff += '../'; } for (i = 0; i < urlDirectories.length - 1; i++) { diff += urlDirectories[i] + "/"; } return diff; }; // helper function, not part of API AbstractFileManager.prototype.extractUrlParts = function (url, baseUrl) { // urlParts[1] = protocol://hostname/ OR / // urlParts[2] = / if path relative to host base // urlParts[3] = directories // urlParts[4] = filename // urlParts[5] = parameters var urlPartsRegex = /^((?:[a-z-]+:)?\/{2}(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i; var urlParts = url.match(urlPartsRegex); var returner = {}; var rawDirectories = []; var directories = []; var i; var baseUrlParts; if (!urlParts) { throw new Error("Could not parse sheet href - '" + url + "'"); } // Stylesheets in IE don't always return the full path if (baseUrl && (!urlParts[1] || urlParts[2])) { baseUrlParts = baseUrl.match(urlPartsRegex); if (!baseUrlParts) { throw new Error("Could not parse page url - '" + baseUrl + "'"); } urlParts[1] = urlParts[1] || baseUrlParts[1] || ''; if (!urlParts[2]) { urlParts[3] = baseUrlParts[3] + urlParts[3]; } } if (urlParts[3]) { rawDirectories = urlParts[3].replace(/\\/g, '/').split('/'); // collapse '..' and skip '.' for (i = 0; i < rawDirectories.length; i++) { if (rawDirectories[i] === '..') { directories.pop(); } else if (rawDirectories[i] !== '.') { directories.push(rawDirectories[i]); } } } returner.hostPart = urlParts[1]; returner.directories = directories; returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/'); returner.path = (urlParts[1] || '') + directories.join('/'); returner.filename = urlParts[4]; returner.fileUrl = returner.path + (urlParts[4] || ''); returner.url = returner.fileUrl + (urlParts[5] || ''); return returner; }; return AbstractFileManager; }()); var AbstractPluginLoader = /** @class */ (function () { function AbstractPluginLoader() { // Implemented by Node.js plugin loader this.require = function () { return null; }; } AbstractPluginLoader.prototype.evalPlugin = function (contents, context, imports, pluginOptions, fileInfo) { var loader; var registry; var pluginObj; var localModule; var pluginManager; var filename; var result; pluginManager = context.pluginManager; if (fileInfo) { if (typeof fileInfo === 'string') { filename = fileInfo; } else { filename = fileInfo.filename; } } var shortname = (new this.less.FileManager()).extractUrlParts(filename).filename; if (filename) { pluginObj = pluginManager.get(filename); if (pluginObj) { result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); if (result) { return result; } try { if (pluginObj.use) { pluginObj.use.call(this.context, pluginObj); } } catch (e) { e.message = e.message || 'Error during @plugin call'; return new LessError(e, imports, filename); } return pluginObj; } } localModule = { exports: {}, pluginManager: pluginManager, fileInfo: fileInfo }; registry = functionRegistry.create(); var registerPlugin = function (obj) { pluginObj = obj; }; try { loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents); loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo); } catch (e) { return new LessError(e, imports, filename); } if (!pluginObj) { pluginObj = localModule.exports; } pluginObj = this.validatePlugin(pluginObj, filename, shortname); if (pluginObj instanceof LessError) { return pluginObj; } if (pluginObj) { pluginObj.imports = imports; pluginObj.filename = filename; // For < 3.x (or unspecified minVersion) - setOptions() before install() if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) { result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); if (result) { return result; } } // Run on first load pluginManager.addPlugin(pluginObj, fileInfo.filename, registry); pluginObj.functions = registry.getLocalFunctions(); // Need to call setOptions again because the pluginObj might have functions result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); if (result) { return result; } // Run every @plugin call try { if (pluginObj.use) { pluginObj.use.call(this.context, pluginObj); } } catch (e) { e.message = e.message || 'Error during @plugin call'; return new LessError(e, imports, filename); } } else { return new LessError({ message: 'Not a valid plugin' }, imports, filename); } return pluginObj; }; AbstractPluginLoader.prototype.trySetOptions = function (plugin, filename, name, options) { if (options && !plugin.setOptions) { return new LessError({ message: "Options have been provided but the plugin " + name + " does not support any options." }); } try { plugin.setOptions && plugin.setOptions(options); } catch (e) { return new LessError(e); } }; AbstractPluginLoader.prototype.validatePlugin = function (plugin, filename, name) { if (plugin) { // support plugins being a function // so that the plugin can be more usable programmatically if (typeof plugin === 'function') { plugin = new plugin(); } if (plugin.minVersion) { if (this.compareVersion(plugin.minVersion, this.less.version) < 0) { return new LessError({ message: "Plugin " + name + " requires version " + this.versionToString(plugin.minVersion) }); } } return plugin; } return null; }; AbstractPluginLoader.prototype.compareVersion = function (aVersion, bVersion) { if (typeof aVersion === 'string') { aVersion = aVersion.match(/^(\d+)\.?(\d+)?\.?(\d+)?/); aVersion.shift(); } for (var i_1 = 0; i_1 < aVersion.length; i_1++) { if (aVersion[i_1] !== bVersion[i_1]) { return parseInt(aVersion[i_1]) > parseInt(bVersion[i_1]) ? -1 : 1; } } return 0; }; AbstractPluginLoader.prototype.versionToString = function (version) { var versionString = ''; for (var i_2 = 0; i_2 < version.length; i_2++) { versionString += (versionString ? '.' : '') + version[i_2]; } return versionString; }; AbstractPluginLoader.prototype.printUsage = function (plugins) { for (var i_3 = 0; i_3 < plugins.length; i_3++) { var plugin = plugins[i_3]; if (plugin.printUsage) { plugin.printUsage(); } } }; return AbstractPluginLoader; }()); var _visitArgs = { visitDeeper: true }; var _hasIndexed = false; function _noop(node) { return node; } function indexNodeTypes(parent, ticker) { // add .typeIndex to tree node types for lookup table var key; var child; for (key in parent) { /* eslint guard-for-in: 0 */ child = parent[key]; switch (typeof child) { case 'function': // ignore bound functions directly on tree which do not have a prototype // or aren't nodes if (child.prototype && child.prototype.type) { child.prototype.typeIndex = ticker++; } break; case 'object': ticker = indexNodeTypes(child, ticker); break; } } return ticker; } var Visitor = /** @class */ (function () { function Visitor(implementation) { this._implementation = implementation; this._visitInCache = {}; this._visitOutCache = {}; if (!_hasIndexed) { indexNodeTypes(tree, 1); _hasIndexed = true; } } Visitor.prototype.visit = function (node) { if (!node) { return node; } var nodeTypeIndex = node.typeIndex; if (!nodeTypeIndex) { // MixinCall args aren't a node type? if (node.value && node.value.typeIndex) { this.visit(node.value); } return node; } var impl = this._implementation; var func = this._visitInCache[nodeTypeIndex]; var funcOut = this._visitOutCache[nodeTypeIndex]; var visitArgs = _visitArgs; var fnName; visitArgs.visitDeeper = true; if (!func) { fnName = "visit" + node.type; func = impl[fnName] || _noop; funcOut = impl[fnName + "Out"] || _noop; this._visitInCache[nodeTypeIndex] = func; this._visitOutCache[nodeTypeIndex] = funcOut; } if (func !== _noop) { var newNode = func.call(impl, node, visitArgs); if (node && impl.isReplacing) { node = newNode; } } if (visitArgs.visitDeeper && node) { if (node.length) { for (var i = 0, cnt = node.length; i < cnt; i++) { if (node[i].accept) { node[i].accept(this); } } } else if (node.accept) { node.accept(this); } } if (funcOut != _noop) { funcOut.call(impl, node); } return node; }; Visitor.prototype.visitArray = function (nodes, nonReplacing) { if (!nodes) { return nodes; } var cnt = nodes.length; var i; // Non-replacing if (nonReplacing || !this._implementation.isReplacing) { for (i = 0; i < cnt; i++) { this.visit(nodes[i]); } return nodes; } // Replacing var out = []; for (i = 0; i < cnt; i++) { var evald = this.visit(nodes[i]); if (evald === undefined) { continue; } if (!evald.splice) { out.push(evald); } else if (evald.length) { this.flatten(evald, out); } } return out; }; Visitor.prototype.flatten = function (arr, out) { if (!out) { out = []; } var cnt; var i; var item; var nestedCnt; var j; var nestedItem; for (i = 0, cnt = arr.length; i < cnt; i++) { item = arr[i]; if (item === undefined) { continue; } if (!item.splice) { out.push(item); continue; } for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) { nestedItem = item[j]; if (nestedItem === undefined) { continue; } if (!nestedItem.splice) { out.push(nestedItem); } else if (nestedItem.length) { this.flatten(nestedItem, out); } } } return out; }; return Visitor; }()); var ImportSequencer = /** @class */ (function () { function ImportSequencer(onSequencerEmpty) { this.imports = []; this.variableImports = []; this._onSequencerEmpty = onSequencerEmpty; this._currentDepth = 0; } ImportSequencer.prototype.addImport = function (callback) { var importSequencer = this; var importItem = { callback: callback, args: null, isReady: false }; this.imports.push(importItem); return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } importItem.args = Array.prototype.slice.call(args, 0); importItem.isReady = true; importSequencer.tryRun(); }; }; ImportSequencer.prototype.addVariableImport = function (callback) { this.variableImports.push(callback); }; ImportSequencer.prototype.tryRun = function () { this._currentDepth++; try { while (true) { while (this.imports.length > 0) { var importItem = this.imports[0]; if (!importItem.isReady) { return; } this.imports = this.imports.slice(1); importItem.callback.apply(null, importItem.args); } if (this.variableImports.length === 0) { break; } var variableImport = this.variableImports[0]; this.variableImports = this.variableImports.slice(1); variableImport(); } } finally { this._currentDepth--; } if (this._currentDepth === 0 && this._onSequencerEmpty) { this._onSequencerEmpty(); } }; return ImportSequencer; }()); var ImportVisitor = function (importer, finish) { this._visitor = new Visitor(this); this._importer = importer; this._finish = finish; this.context = new contexts.Eval(); this.importCount = 0; this.onceFileDetectionMap = {}; this.recursionDetector = {}; this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this)); }; ImportVisitor.prototype = { isReplacing: false, run: function (root) { try { // process the contents this._visitor.visit(root); } catch (e) { this.error = e; } this.isFinished = true; this._sequencer.tryRun(); }, _onSequencerEmpty: function () { if (!this.isFinished) { return; } this._finish(this.error); }, visitImport: function (importNode, visitArgs) { var inlineCSS = importNode.options.inline; if (!importNode.css || inlineCSS) { var context = new contexts.Eval(this.context, copyArray(this.context.frames)); var importParent = context.frames[0]; this.importCount++; if (importNode.isVariableImport()) { this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent)); } else { this.processImportNode(importNode, context, importParent); } } visitArgs.visitDeeper = false; }, processImportNode: function (importNode, context, importParent) { var evaldImportNode; var inlineCSS = importNode.options.inline; try { evaldImportNode = importNode.evalForImport(context); } catch (e) { if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; } // attempt to eval properly and treat as css importNode.css = true; // if that fails, this error will be thrown importNode.error = e; } if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) { if (evaldImportNode.options.multiple) { context.importMultiple = true; } // try appending if we haven't determined if it is css or not var tryAppendLessExtension = evaldImportNode.css === undefined; for (var i_1 = 0; i_1 < importParent.rules.length; i_1++) { if (importParent.rules[i_1] === importNode) { importParent.rules[i_1] = evaldImportNode; break; } } var onImported = this.onImported.bind(this, evaldImportNode, context); var sequencedOnImported = this._sequencer.addImport(onImported); this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(), evaldImportNode.options, sequencedOnImported); } else { this.importCount--; if (this.isFinished) { this._sequencer.tryRun(); } } }, onImported: function (importNode, context, e, root, importedAtRoot, fullPath) { if (e) { if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; } this.error = e; } var importVisitor = this; var inlineCSS = importNode.options.inline; var isPlugin = importNode.options.isPlugin; var isOptional = importNode.options.optional; var duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector; if (!context.importMultiple) { if (duplicateImport) { importNode.skip = true; } else { importNode.skip = function () { if (fullPath in importVisitor.onceFileDetectionMap) { return true; } importVisitor.onceFileDetectionMap[fullPath] = true; return false; }; } } if (!fullPath && isOptional) { importNode.skip = true; } if (root) { importNode.root = root; importNode.importedFilename = fullPath; if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) { importVisitor.recursionDetector[fullPath] = true; var oldContext = this.context; this.context = context; try { this._visitor.visit(root); } catch (e) { this.error = e; } this.context = oldContext; } } importVisitor.importCount--; if (importVisitor.isFinished) { importVisitor._sequencer.tryRun(); } }, visitDeclaration: function (declNode, visitArgs) { if (declNode.value.type === 'DetachedRuleset') { this.context.frames.unshift(declNode); } else { visitArgs.visitDeeper = false; } }, visitDeclarationOut: function (declNode) { if (declNode.value.type === 'DetachedRuleset') { this.context.frames.shift(); } }, visitAtRule: function (atRuleNode, visitArgs) { this.context.frames.unshift(atRuleNode); }, visitAtRuleOut: function (atRuleNode) { this.context.frames.shift(); }, visitMixinDefinition: function (mixinDefinitionNode, visitArgs) { this.context.frames.unshift(mixinDefinitionNode); }, visitMixinDefinitionOut: function (mixinDefinitionNode) { this.context.frames.shift(); }, visitRuleset: function (rulesetNode, visitArgs) { this.context.frames.unshift(rulesetNode); }, visitRulesetOut: function (rulesetNode) { this.context.frames.shift(); }, visitMedia: function (mediaNode, visitArgs) { this.context.frames.unshift(mediaNode.rules[0]); }, visitMediaOut: function (mediaNode) { this.context.frames.shift(); } }; var SetTreeVisibilityVisitor = /** @class */ (function () { function SetTreeVisibilityVisitor(visible) { this.visible = visible; } SetTreeVisibilityVisitor.prototype.run = function (root) { this.visit(root); }; SetTreeVisibilityVisitor.prototype.visitArray = function (nodes) { if (!nodes) { return nodes; } var cnt = nodes.length; var i; for (i = 0; i < cnt; i++) { this.visit(nodes[i]); } return nodes; }; SetTreeVisibilityVisitor.prototype.visit = function (node) { if (!node) { return node; } if (node.constructor === Array) { return this.visitArray(node); } if (!node.blocksVisibility || node.blocksVisibility()) { return node; } if (this.visible) { node.ensureVisibility(); } else { node.ensureInvisibility(); } node.accept(this); return node; }; return SetTreeVisibilityVisitor; }()); /* jshint loopfunc:true */ var ExtendFinderVisitor = /** @class */ (function () { function ExtendFinderVisitor() { this._visitor = new Visitor(this); this.contexts = []; this.allExtendsStack = [[]]; } ExtendFinderVisitor.prototype.run = function (root) { root = this._visitor.visit(root); root.allExtends = this.allExtendsStack[0]; return root; }; ExtendFinderVisitor.prototype.visitDeclaration = function (declNode, visitArgs) { visitArgs.visitDeeper = false; }; ExtendFinderVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { visitArgs.visitDeeper = false; }; ExtendFinderVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { if (rulesetNode.root) { return; } var i; var j; var extend; var allSelectorsExtendList = []; var extendList; // get &:extend(.a); rules which apply to all selectors in this ruleset var rules = rulesetNode.rules; var ruleCnt = rules ? rules.length : 0; for (i = 0; i < ruleCnt; i++) { if (rulesetNode.rules[i] instanceof tree.Extend) { allSelectorsExtendList.push(rules[i]); rulesetNode.extendOnEveryPath = true; } } // now find every selector and apply the extends that apply to all extends // and the ones which apply to an individual extend var paths = rulesetNode.paths; for (i = 0; i < paths.length; i++) { var selectorPath = paths[i]; var selector = selectorPath[selectorPath.length - 1]; var selExtendList = selector.extendList; extendList = selExtendList ? copyArray(selExtendList).concat(allSelectorsExtendList) : allSelectorsExtendList; if (extendList) { extendList = extendList.map(function (allSelectorsExtend) { return allSelectorsExtend.clone(); }); } for (j = 0; j < extendList.length; j++) { this.foundExtends = true; extend = extendList[j]; extend.findSelfSelectors(selectorPath); extend.ruleset = rulesetNode; if (j === 0) { extend.firstExtendOnThisSelectorPath = true; } this.allExtendsStack[this.allExtendsStack.length - 1].push(extend); } } this.contexts.push(rulesetNode.selectors); }; ExtendFinderVisitor.prototype.visitRulesetOut = function (rulesetNode) { if (!rulesetNode.root) { this.contexts.length = this.contexts.length - 1; } }; ExtendFinderVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { mediaNode.allExtends = []; this.allExtendsStack.push(mediaNode.allExtends); }; ExtendFinderVisitor.prototype.visitMediaOut = function (mediaNode) { this.allExtendsStack.length = this.allExtendsStack.length - 1; }; ExtendFinderVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { atRuleNode.allExtends = []; this.allExtendsStack.push(atRuleNode.allExtends); }; ExtendFinderVisitor.prototype.visitAtRuleOut = function (atRuleNode) { this.allExtendsStack.length = this.allExtendsStack.length - 1; }; return ExtendFinderVisitor; }()); var ProcessExtendsVisitor = /** @class */ (function () { function ProcessExtendsVisitor() { this._visitor = new Visitor(this); } ProcessExtendsVisitor.prototype.run = function (root) { var extendFinder = new ExtendFinderVisitor(); this.extendIndices = {}; extendFinder.run(root); if (!extendFinder.foundExtends) { return root; } root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends)); this.allExtendsStack = [root.allExtends]; var newRoot = this._visitor.visit(root); this.checkExtendsForNonMatched(root.allExtends); return newRoot; }; ProcessExtendsVisitor.prototype.checkExtendsForNonMatched = function (extendList) { var indices = this.extendIndices; extendList.filter(function (extend) { return !extend.hasFoundMatches && extend.parent_ids.length == 1; }).forEach(function (extend) { var selector = '_unknown_'; try { selector = extend.selector.toCSS({}); } catch (_) { } if (!indices[extend.index + " " + selector]) { indices[extend.index + " " + selector] = true; logger.warn("extend '" + selector + "' has no matches"); } }); }; ProcessExtendsVisitor.prototype.doExtendChaining = function (extendsList, extendsListTarget, iterationCount) { // // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering // and pasting the selector we would do normally, but we are also adding an extend with the same target selector // this means this new extend can then go and alter other extends // // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already // processed if we look at each selector at a time, as is done in visitRuleset var extendIndex; var targetExtendIndex; var matches; var extendsToAdd = []; var newSelector; var extendVisitor = this; var selectorPath; var extend; var targetExtend; var newExtend; iterationCount = iterationCount || 0; // loop through comparing every extend with every target extend. // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one // and the second is the target. // the separation into two lists allows us to process a subset of chains with a bigger set, as is the // case when processing media queries for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) { for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) { extend = extendsList[extendIndex]; targetExtend = extendsListTarget[targetExtendIndex]; // look for circular references if (extend.parent_ids.indexOf(targetExtend.object_id) >= 0) { continue; } // find a match in the target extends self selector (the bit before :extend) selectorPath = [targetExtend.selfSelectors[0]]; matches = extendVisitor.findMatch(extend, selectorPath); if (matches.length) { extend.hasFoundMatches = true; // we found a match, so for each self selector.. extend.selfSelectors.forEach(function (selfSelector) { var info = targetExtend.visibilityInfo(); // process the extend as usual newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible()); // but now we create a new extend from it newExtend = new (tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info); newExtend.selfSelectors = newSelector; // add the extend onto the list of extends for that selector newSelector[newSelector.length - 1].extendList = [newExtend]; // record that we need to add it. extendsToAdd.push(newExtend); newExtend.ruleset = targetExtend.ruleset; // remember its parents for circular references newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids); // only process the selector once.. if we have :extend(.a,.b) then multiple // extends will look at the same selector path, so when extending // we know that any others will be duplicates in terms of what is added to the css if (targetExtend.firstExtendOnThisSelectorPath) { newExtend.firstExtendOnThisSelectorPath = true; targetExtend.ruleset.paths.push(newSelector); } }); } } } if (extendsToAdd.length) { // try to detect circular references to stop a stack overflow. // may no longer be needed. this.extendChainCount++; if (iterationCount > 100) { var selectorOne = '{unable to calculate}'; var selectorTwo = '{unable to calculate}'; try { selectorOne = extendsToAdd[0].selfSelectors[0].toCSS(); selectorTwo = extendsToAdd[0].selector.toCSS(); } catch (e) { } throw { message: "extend circular reference detected. One of the circular extends is currently:" + selectorOne + ":extend(" + selectorTwo + ")" }; } // now process the new extends on the existing rules so that we can handle a extending b extending c extending // d extending e... return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1)); } else { return extendsToAdd; } }; ProcessExtendsVisitor.prototype.visitDeclaration = function (ruleNode, visitArgs) { visitArgs.visitDeeper = false; }; ProcessExtendsVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { visitArgs.visitDeeper = false; }; ProcessExtendsVisitor.prototype.visitSelector = function (selectorNode, visitArgs) { visitArgs.visitDeeper = false; }; ProcessExtendsVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { if (rulesetNode.root) { return; } var matches; var pathIndex; var extendIndex; var allExtends = this.allExtendsStack[this.allExtendsStack.length - 1]; var selectorsToAdd = []; var extendVisitor = this; var selectorPath; // look at each selector path in the ruleset, find any extend matches and then copy, find and replace for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) { for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) { selectorPath = rulesetNode.paths[pathIndex]; // extending extends happens initially, before the main pass if (rulesetNode.extendOnEveryPath) { continue; } var extendList = selectorPath[selectorPath.length - 1].extendList; if (extendList && extendList.length) { continue; } matches = this.findMatch(allExtends[extendIndex], selectorPath); if (matches.length) { allExtends[extendIndex].hasFoundMatches = true; allExtends[extendIndex].selfSelectors.forEach(function (selfSelector) { var extendedSelectors; extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible()); selectorsToAdd.push(extendedSelectors); }); } } } rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd); }; ProcessExtendsVisitor.prototype.findMatch = function (extend, haystackSelectorPath) { // // look through the haystack selector path to try and find the needle - extend.selector // returns an array of selector matches that can then be replaced // var haystackSelectorIndex; var hackstackSelector; var hackstackElementIndex; var haystackElement; var targetCombinator; var i; var extendVisitor = this; var needleElements = extend.selector.elements; var potentialMatches = []; var potentialMatch; var matches = []; // loop through the haystack elements for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) { hackstackSelector = haystackSelectorPath[haystackSelectorIndex]; for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) { haystackElement = hackstackSelector.elements[hackstackElementIndex]; // if we allow elements before our match we can add a potential match every time. otherwise only at the first element. if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) { potentialMatches.push({ pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0, initialCombinator: haystackElement.combinator }); } for (i = 0; i < potentialMatches.length; i++) { potentialMatch = potentialMatches[i]; // selectors add " " onto the first element. When we use & it joins the selectors together, but if we don't // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to // work out what the resulting combinator will be targetCombinator = haystackElement.combinator.value; if (targetCombinator === '' && hackstackElementIndex === 0) { targetCombinator = ' '; } // if we don't match, null our match to indicate failure if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) || (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) { potentialMatch = null; } else { potentialMatch.matched++; } // if we are still valid and have finished, test whether we have elements after and whether these are allowed if (potentialMatch) { potentialMatch.finished = potentialMatch.matched === needleElements.length; if (potentialMatch.finished && (!extend.allowAfter && (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) { potentialMatch = null; } } // if null we remove, if not, we are still valid, so either push as a valid match or continue if (potentialMatch) { if (potentialMatch.finished) { potentialMatch.length = needleElements.length; potentialMatch.endPathIndex = haystackSelectorIndex; potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again matches.push(potentialMatch); } } else { potentialMatches.splice(i, 1); i--; } } } } return matches; }; ProcessExtendsVisitor.prototype.isElementValuesEqual = function (elementValue1, elementValue2) { if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') { return elementValue1 === elementValue2; } if (elementValue1 instanceof tree.Attribute) { if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) { return false; } if (!elementValue1.value || !elementValue2.value) { if (elementValue1.value || elementValue2.value) { return false; } return true; } elementValue1 = elementValue1.value.value || elementValue1.value; elementValue2 = elementValue2.value.value || elementValue2.value; return elementValue1 === elementValue2; } elementValue1 = elementValue1.value; elementValue2 = elementValue2.value; if (elementValue1 instanceof tree.Selector) { if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) { return false; } for (var i_1 = 0; i_1 < elementValue1.elements.length; i_1++) { if (elementValue1.elements[i_1].combinator.value !== elementValue2.elements[i_1].combinator.value) { if (i_1 !== 0 || (elementValue1.elements[i_1].combinator.value || ' ') !== (elementValue2.elements[i_1].combinator.value || ' ')) { return false; } } if (!this.isElementValuesEqual(elementValue1.elements[i_1].value, elementValue2.elements[i_1].value)) { return false; } } return true; } return false; }; ProcessExtendsVisitor.prototype.extendSelector = function (matches, selectorPath, replacementSelector, isVisible) { // for a set of matches, replace each match with the replacement selector var currentSelectorPathIndex = 0; var currentSelectorPathElementIndex = 0; var path = []; var matchIndex; var selector; var firstElement; var match; var newElements; for (matchIndex = 0; matchIndex < matches.length; matchIndex++) { match = matches[matchIndex]; selector = selectorPath[match.pathIndex]; firstElement = new tree.Element(match.initialCombinator, replacementSelector.elements[0].value, replacementSelector.elements[0].isVariable, replacementSelector.elements[0].getIndex(), replacementSelector.elements[0].fileInfo()); if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) { path[path.length - 1].elements = path[path.length - 1] .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); currentSelectorPathElementIndex = 0; currentSelectorPathIndex++; } newElements = selector.elements .slice(currentSelectorPathElementIndex, match.index) .concat([firstElement]) .concat(replacementSelector.elements.slice(1)); if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) { path[path.length - 1].elements = path[path.length - 1].elements.concat(newElements); } else { path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex)); path.push(new tree.Selector(newElements)); } currentSelectorPathIndex = match.endPathIndex; currentSelectorPathElementIndex = match.endPathElementIndex; if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) { currentSelectorPathElementIndex = 0; currentSelectorPathIndex++; } } if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) { path[path.length - 1].elements = path[path.length - 1] .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); currentSelectorPathIndex++; } path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length)); path = path.map(function (currentValue) { // we can re-use elements here, because the visibility property matters only for selectors var derived = currentValue.createDerived(currentValue.elements); if (isVisible) { derived.ensureVisibility(); } else { derived.ensureInvisibility(); } return derived; }); return path; }; ProcessExtendsVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { var newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends)); this.allExtendsStack.push(newAllExtends); }; ProcessExtendsVisitor.prototype.visitMediaOut = function (mediaNode) { var lastIndex = this.allExtendsStack.length - 1; this.allExtendsStack.length = lastIndex; }; ProcessExtendsVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { var newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends)); this.allExtendsStack.push(newAllExtends); }; ProcessExtendsVisitor.prototype.visitAtRuleOut = function (atRuleNode) { var lastIndex = this.allExtendsStack.length - 1; this.allExtendsStack.length = lastIndex; }; return ProcessExtendsVisitor; }()); var JoinSelectorVisitor = /** @class */ (function () { function JoinSelectorVisitor() { this.contexts = [[]]; this._visitor = new Visitor(this); } JoinSelectorVisitor.prototype.run = function (root) { return this._visitor.visit(root); }; JoinSelectorVisitor.prototype.visitDeclaration = function (declNode, visitArgs) { visitArgs.visitDeeper = false; }; JoinSelectorVisitor.prototype.visitMixinDefinition = function (mixinDefinitionNode, visitArgs) { visitArgs.visitDeeper = false; }; JoinSelectorVisitor.prototype.visitRuleset = function (rulesetNode, visitArgs) { var context = this.contexts[this.contexts.length - 1]; var paths = []; var selectors; this.contexts.push(paths); if (!rulesetNode.root) { selectors = rulesetNode.selectors; if (selectors) { selectors = selectors.filter(function (selector) { return selector.getIsOutput(); }); rulesetNode.selectors = selectors.length ? selectors : (selectors = null); if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); } } if (!selectors) { rulesetNode.rules = null; } rulesetNode.paths = paths; } }; JoinSelectorVisitor.prototype.visitRulesetOut = function (rulesetNode) { this.contexts.length = this.contexts.length - 1; }; JoinSelectorVisitor.prototype.visitMedia = function (mediaNode, visitArgs) { var context = this.contexts[this.contexts.length - 1]; mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia); }; JoinSelectorVisitor.prototype.visitAtRule = function (atRuleNode, visitArgs) { var context = this.contexts[this.contexts.length - 1]; if (atRuleNode.rules && atRuleNode.rules.length) { atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null); } }; return JoinSelectorVisitor; }()); var CSSVisitorUtils = /** @class */ (function () { function CSSVisitorUtils(context) { this._visitor = new Visitor(this); this._context = context; } CSSVisitorUtils.prototype.containsSilentNonBlockedChild = function (bodyRules) { var rule; if (!bodyRules) { return false; } for (var r = 0; r < bodyRules.length; r++) { rule = bodyRules[r]; if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) { // the atrule contains something that was referenced (likely by extend) // therefore it needs to be shown in output too return true; } } return false; }; CSSVisitorUtils.prototype.keepOnlyVisibleChilds = function (owner) { if (owner && owner.rules) { owner.rules = owner.rules.filter(function (thing) { return thing.isVisible(); }); } }; CSSVisitorUtils.prototype.isEmpty = function (owner) { return (owner && owner.rules) ? (owner.rules.length === 0) : true; }; CSSVisitorUtils.prototype.hasVisibleSelector = function (rulesetNode) { return (rulesetNode && rulesetNode.paths) ? (rulesetNode.paths.length > 0) : false; }; CSSVisitorUtils.prototype.resolveVisibility = function (node, originalRules) { if (!node.blocksVisibility()) { if (this.isEmpty(node) && !this.containsSilentNonBlockedChild(originalRules)) { return; } return node; } var compiledRulesBody = node.rules[0]; this.keepOnlyVisibleChilds(compiledRulesBody); if (this.isEmpty(compiledRulesBody)) { return; } node.ensureVisibility(); node.removeVisibilityBlock(); return node; }; CSSVisitorUtils.prototype.isVisibleRuleset = function (rulesetNode) { if (rulesetNode.firstRoot) { return true; } if (this.isEmpty(rulesetNode)) { return false; } if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) { return false; } return true; }; return CSSVisitorUtils; }()); var ToCSSVisitor = function (context) { this._visitor = new Visitor(this); this._context = context; this.utils = new CSSVisitorUtils(context); }; ToCSSVisitor.prototype = { isReplacing: true, run: function (root) { return this._visitor.visit(root); }, visitDeclaration: function (declNode, visitArgs) { if (declNode.blocksVisibility() || declNode.variable) { return; } return declNode; }, visitMixinDefinition: function (mixinNode, visitArgs) { // mixin definitions do not get eval'd - this means they keep state // so we have to clear that state here so it isn't used if toCSS is called twice mixinNode.frames = []; }, visitExtend: function (extendNode, visitArgs) { }, visitComment: function (commentNode, visitArgs) { if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) { return; } return commentNode; }, visitMedia: function (mediaNode, visitArgs) { var originalRules = mediaNode.rules[0].rules; mediaNode.accept(this._visitor); visitArgs.visitDeeper = false; return this.utils.resolveVisibility(mediaNode, originalRules); }, visitImport: function (importNode, visitArgs) { if (importNode.blocksVisibility()) { return; } return importNode; }, visitAtRule: function (atRuleNode, visitArgs) { if (atRuleNode.rules && atRuleNode.rules.length) { return this.visitAtRuleWithBody(atRuleNode, visitArgs); } else { return this.visitAtRuleWithoutBody(atRuleNode, visitArgs); } }, visitAnonymous: function (anonymousNode, visitArgs) { if (!anonymousNode.blocksVisibility()) { anonymousNode.accept(this._visitor); return anonymousNode; } }, visitAtRuleWithBody: function (atRuleNode, visitArgs) { // if there is only one nested ruleset and that one has no path, then it is // just fake ruleset function hasFakeRuleset(atRuleNode) { var bodyRules = atRuleNode.rules; return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0); } function getBodyRules(atRuleNode) { var nodeRules = atRuleNode.rules; if (hasFakeRuleset(atRuleNode)) { return nodeRules[0].rules; } return nodeRules; } // it is still true that it is only one ruleset in array // this is last such moment // process childs var originalRules = getBodyRules(atRuleNode); atRuleNode.accept(this._visitor); visitArgs.visitDeeper = false; if (!this.utils.isEmpty(atRuleNode)) { this._mergeRules(atRuleNode.rules[0].rules); } return this.utils.resolveVisibility(atRuleNode, originalRules); }, visitAtRuleWithoutBody: function (atRuleNode, visitArgs) { if (atRuleNode.blocksVisibility()) { return; } if (atRuleNode.name === '@charset') { // Only output the debug info together with subsequent @charset definitions // a comment (or @media statement) before the actual @charset atrule would // be considered illegal css as it has to be on the first line if (this.charset) { if (atRuleNode.debugInfo) { var comment = new tree.Comment("/* " + atRuleNode.toCSS(this._context).replace(/\n/g, '') + " */\n"); comment.debugInfo = atRuleNode.debugInfo; return this._visitor.visit(comment); } return; } this.charset = true; } return atRuleNode; }, checkValidNodes: function (rules, isRoot) { if (!rules) { return; } for (var i_1 = 0; i_1 < rules.length; i_1++) { var ruleNode = rules[i_1]; if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) { throw { message: 'Properties must be inside selector blocks. They cannot be in the root', index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; } if (ruleNode instanceof tree.Call) { throw { message: "Function '" + ruleNode.name + "' is undefined", index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; } if (ruleNode.type && !ruleNode.allowRoot) { throw { message: ruleNode.type + " node returned by a function is not valid here", index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; } } }, visitRuleset: function (rulesetNode, visitArgs) { // at this point rulesets are nested into each other var rule; var rulesets = []; this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot); if (!rulesetNode.root) { // remove invisible paths this._compileRulesetPaths(rulesetNode); // remove rulesets from this ruleset body and compile them separately var nodeRules = rulesetNode.rules; var nodeRuleCnt = nodeRules ? nodeRules.length : 0; for (var i_2 = 0; i_2 < nodeRuleCnt;) { rule = nodeRules[i_2]; if (rule && rule.rules) { // visit because we are moving them out from being a child rulesets.push(this._visitor.visit(rule)); nodeRules.splice(i_2, 1); nodeRuleCnt--; continue; } i_2++; } // accept the visitor to remove rules and refactor itself // then we can decide nogw whether we want it or not // compile body if (nodeRuleCnt > 0) { rulesetNode.accept(this._visitor); } else { rulesetNode.rules = null; } visitArgs.visitDeeper = false; } else { // if (! rulesetNode.root) { rulesetNode.accept(this._visitor); visitArgs.visitDeeper = false; } if (rulesetNode.rules) { this._mergeRules(rulesetNode.rules); this._removeDuplicateRules(rulesetNode.rules); } // now decide whether we keep the ruleset if (this.utils.isVisibleRuleset(rulesetNode)) { rulesetNode.ensureVisibility(); rulesets.splice(0, 0, rulesetNode); } if (rulesets.length === 1) { return rulesets[0]; } return rulesets; }, _compileRulesetPaths: function (rulesetNode) { if (rulesetNode.paths) { rulesetNode.paths = rulesetNode.paths .filter(function (p) { var i; if (p[0].elements[0].combinator.value === ' ') { p[0].elements[0].combinator = new (tree.Combinator)(''); } for (i = 0; i < p.length; i++) { if (p[i].isVisible() && p[i].getIsOutput()) { return true; } } return false; }); } }, _removeDuplicateRules: function (rules) { if (!rules) { return; } // remove duplicates var ruleCache = {}; var ruleList; var rule; var i; for (i = rules.length - 1; i >= 0; i--) { rule = rules[i]; if (rule instanceof tree.Declaration) { if (!ruleCache[rule.name]) { ruleCache[rule.name] = rule; } else { ruleList = ruleCache[rule.name]; if (ruleList instanceof tree.Declaration) { ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)]; } var ruleCSS = rule.toCSS(this._context); if (ruleList.indexOf(ruleCSS) !== -1) { rules.splice(i, 1); } else { ruleList.push(ruleCSS); } } } } }, _mergeRules: function (rules) { if (!rules) { return; } var groups = {}; var groupsArr = []; for (var i_3 = 0; i_3 < rules.length; i_3++) { var rule = rules[i_3]; if (rule.merge) { var key = rule.name; groups[key] ? rules.splice(i_3--, 1) : groupsArr.push(groups[key] = []); groups[key].push(rule); } } groupsArr.forEach(function (group) { if (group.length > 0) { var result_1 = group[0]; var space_1 = []; var comma_1 = [new tree.Expression(space_1)]; group.forEach(function (rule) { if ((rule.merge === '+') && (space_1.length > 0)) { comma_1.push(new tree.Expression(space_1 = [])); } space_1.push(rule.value); result_1.important = result_1.important || rule.important; }); result_1.value = new tree.Value(comma_1); } }); } }; var visitors = { Visitor: Visitor, ImportVisitor: ImportVisitor, MarkVisibleSelectorsVisitor: SetTreeVisibilityVisitor, ExtendVisitor: ProcessExtendsVisitor, JoinSelectorVisitor: JoinSelectorVisitor, ToCSSVisitor: ToCSSVisitor }; // Split the input into chunks. var chunker = (function (input, fail) { var len = input.length; var level = 0; var parenLevel = 0; var lastOpening; var lastOpeningParen; var lastMultiComment; var lastMultiCommentEndBrace; var chunks = []; var emitFrom = 0; var chunkerCurrentIndex; var currentChunkStartIndex; var cc; var cc2; var matched; function emitChunk(force) { var len = chunkerCurrentIndex - emitFrom; if (((len < 512) && !force) || !len) { return; } chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1)); emitFrom = chunkerCurrentIndex + 1; } for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) { cc = input.charCodeAt(chunkerCurrentIndex); if (((cc >= 97) && (cc <= 122)) || (cc < 34)) { // a-z or whitespace continue; } switch (cc) { case 40: // ( parenLevel++; lastOpeningParen = chunkerCurrentIndex; continue; case 41: // ) if (--parenLevel < 0) { return fail('missing opening `(`', chunkerCurrentIndex); } continue; case 59: // ; if (!parenLevel) { emitChunk(); } continue; case 123: // { level++; lastOpening = chunkerCurrentIndex; continue; case 125: // } if (--level < 0) { return fail('missing opening `{`', chunkerCurrentIndex); } if (!level && !parenLevel) { emitChunk(); } continue; case 92: // \ if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; } return fail('unescaped `\\`', chunkerCurrentIndex); case 34: case 39: case 96: // ", ' and ` matched = 0; currentChunkStartIndex = chunkerCurrentIndex; for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) { cc2 = input.charCodeAt(chunkerCurrentIndex); if (cc2 > 96) { continue; } if (cc2 == cc) { matched = 1; break; } if (cc2 == 92) { // \ if (chunkerCurrentIndex == len - 1) { return fail('unescaped `\\`', chunkerCurrentIndex); } chunkerCurrentIndex++; } } if (matched) { continue; } return fail("unmatched `" + String.fromCharCode(cc) + "`", currentChunkStartIndex); case 47: // /, check for comment if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; } cc2 = input.charCodeAt(chunkerCurrentIndex + 1); if (cc2 == 47) { // //, find lnfeed for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) { cc2 = input.charCodeAt(chunkerCurrentIndex); if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; } } } else if (cc2 == 42) { // /*, find */ lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex; for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) { cc2 = input.charCodeAt(chunkerCurrentIndex); if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; } if (cc2 != 42) { continue; } if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; } } if (chunkerCurrentIndex == len - 1) { return fail('missing closing `*/`', currentChunkStartIndex); } chunkerCurrentIndex++; } continue; case 42: // *, check for unmatched */ if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) { return fail('unmatched `/*`', chunkerCurrentIndex); } continue; } } if (level !== 0) { if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) { return fail('missing closing `}` or `*/`', lastOpening); } else { return fail('missing closing `}`', lastOpening); } } else if (parenLevel !== 0) { return fail('missing closing `)`', lastOpeningParen); } emitChunk(true); return chunks; }); var getParserInput = (function () { var // Less input string input; var // current chunk j; var // holds state for backtracking saveStack = []; var // furthest index the parser has gone to furthest; var // if this is furthest we got to, this is the probably cause furthestPossibleErrorMessage; var // chunkified input chunks; var // current chunk current; var // index of current chunk, in `input` currentPos; var parserInput = {}; var CHARCODE_SPACE = 32; var CHARCODE_TAB = 9; var CHARCODE_LF = 10; var CHARCODE_CR = 13; var CHARCODE_PLUS = 43; var CHARCODE_COMMA = 44; var CHARCODE_FORWARD_SLASH = 47; var CHARCODE_9 = 57; function skipWhitespace(length) { var oldi = parserInput.i; var oldj = j; var curr = parserInput.i - currentPos; var endIndex = parserInput.i + current.length - curr; var mem = (parserInput.i += length); var inp = input; var c; var nextChar; var comment; for (; parserInput.i < endIndex; parserInput.i++) { c = inp.charCodeAt(parserInput.i); if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) { nextChar = inp.charAt(parserInput.i + 1); if (nextChar === '/') { comment = { index: parserInput.i, isLineComment: true }; var nextNewLine = inp.indexOf('\n', parserInput.i + 2); if (nextNewLine < 0) { nextNewLine = endIndex; } parserInput.i = nextNewLine; comment.text = inp.substr(comment.index, parserInput.i - comment.index); parserInput.commentStore.push(comment); continue; } else if (nextChar === '*') { var nextStarSlash = inp.indexOf('*/', parserInput.i + 2); if (nextStarSlash >= 0) { comment = { index: parserInput.i, text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i), isLineComment: false }; parserInput.i += comment.text.length - 1; parserInput.commentStore.push(comment); continue; } } break; } if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) { break; } } current = current.slice(length + parserInput.i - mem + curr); currentPos = parserInput.i; if (!current.length) { if (j < chunks.length - 1) { current = chunks[++j]; skipWhitespace(0); // skip space at the beginning of a chunk return true; // things changed } parserInput.finished = true; } return oldi !== parserInput.i || oldj !== j; } parserInput.save = function () { currentPos = parserInput.i; saveStack.push({ current: current, i: parserInput.i, j: j }); }; parserInput.restore = function (possibleErrorMessage) { if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) { furthest = parserInput.i; furthestPossibleErrorMessage = possibleErrorMessage; } var state = saveStack.pop(); current = state.current; currentPos = parserInput.i = state.i; j = state.j; }; parserInput.forget = function () { saveStack.pop(); }; parserInput.isWhitespace = function (offset) { var pos = parserInput.i + (offset || 0); var code = input.charCodeAt(pos); return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF); }; // Specialization of $(tok) parserInput.$re = function (tok) { if (parserInput.i > currentPos) { current = current.slice(parserInput.i - currentPos); currentPos = parserInput.i; } var m = tok.exec(current); if (!m) { return null; } skipWhitespace(m[0].length); if (typeof m === 'string') { return m; } return m.length === 1 ? m[0] : m; }; parserInput.$char = function (tok) { if (input.charAt(parserInput.i) !== tok) { return null; } skipWhitespace(1); return tok; }; parserInput.$str = function (tok) { var tokLength = tok.length; // https://jsperf.com/string-startswith/21 for (var i_1 = 0; i_1 < tokLength; i_1++) { if (input.charAt(parserInput.i + i_1) !== tok.charAt(i_1)) { return null; } } skipWhitespace(tokLength); return tok; }; parserInput.$quoted = function (loc) { var pos = loc || parserInput.i; var startChar = input.charAt(pos); if (startChar !== '\'' && startChar !== '"') { return; } var length = input.length; var currentPosition = pos; for (var i_2 = 1; i_2 + currentPosition < length; i_2++) { var nextChar = input.charAt(i_2 + currentPosition); switch (nextChar) { case '\\': i_2++; continue; case '\r': case '\n': break; case startChar: var str = input.substr(currentPosition, i_2 + 1); if (!loc && loc !== 0) { skipWhitespace(i_2 + 1); return str; } return [startChar, str]; } } return null; }; /** * Permissive parsing. Ignores everything except matching {} [] () and quotes * until matching token (outside of blocks) */ parserInput.$parseUntil = function (tok) { var quote = ''; var returnVal = null; var inComment = false; var blockDepth = 0; var blockStack = []; var parseGroups = []; var length = input.length; var startPos = parserInput.i; var lastPos = parserInput.i; var i = parserInput.i; var loop = true; var testChar; if (typeof tok === 'string') { testChar = function (char) { return char === tok; }; } else { testChar = function (char) { return tok.test(char); }; } do { var nextChar = input.charAt(i); if (blockDepth === 0 && testChar(nextChar)) { returnVal = input.substr(lastPos, i - lastPos); if (returnVal) { parseGroups.push(returnVal); } else { parseGroups.push(' '); } returnVal = parseGroups; skipWhitespace(i - startPos); loop = false; } else { if (inComment) { if (nextChar === '*' && input.charAt(i + 1) === '/') { i++; blockDepth--; inComment = false; } i++; continue; } switch (nextChar) { case '\\': i++; nextChar = input.charAt(i); parseGroups.push(input.substr(lastPos, i - lastPos + 1)); lastPos = i + 1; break; case '/': if (input.charAt(i + 1) === '*') { i++; inComment = true; blockDepth++; } break; case '\'': case '"': quote = parserInput.$quoted(i); if (quote) { parseGroups.push(input.substr(lastPos, i - lastPos), quote); i += quote[1].length - 1; lastPos = i + 1; } else { skipWhitespace(i - startPos); returnVal = nextChar; loop = false; } break; case '{': blockStack.push('}'); blockDepth++; break; case '(': blockStack.push(')'); blockDepth++; break; case '[': blockStack.push(']'); blockDepth++; break; case '}': case ')': case ']': var expected = blockStack.pop(); if (nextChar === expected) { blockDepth--; } else { // move the parser to the error and return expected skipWhitespace(i - startPos); returnVal = expected; loop = false; } } i++; if (i > length) { loop = false; } } } while (loop); return returnVal ? returnVal : null; }; parserInput.autoCommentAbsorb = true; parserInput.commentStore = []; parserInput.finished = false; // Same as $(), but don't change the state of the parser, // just return the match. parserInput.peek = function (tok) { if (typeof tok === 'string') { // https://jsperf.com/string-startswith/21 for (var i_3 = 0; i_3 < tok.length; i_3++) { if (input.charAt(parserInput.i + i_3) !== tok.charAt(i_3)) { return false; } } return true; } else { return tok.test(current); } }; // Specialization of peek() // TODO remove or change some currentChar calls to peekChar parserInput.peekChar = function (tok) { return input.charAt(parserInput.i) === tok; }; parserInput.currentChar = function () { return input.charAt(parserInput.i); }; parserInput.prevChar = function () { return input.charAt(parserInput.i - 1); }; parserInput.getInput = function () { return input; }; parserInput.peekNotNumeric = function () { var c = input.charCodeAt(parserInput.i); // Is the first char of the dimension 0-9, '.', '+' or '-' return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA; }; parserInput.start = function (str, chunkInput, failFunction) { input = str; parserInput.i = j = currentPos = furthest = 0; // chunking apparently makes things quicker (but my tests indicate // it might actually make things slower in node at least) // and it is a non-perfect parse - it can't recognise // unquoted urls, meaning it can't distinguish comments // meaning comments with quotes or {}() in them get 'counted' // and then lead to parse errors. // In addition if the chunking chunks in the wrong place we might // not be able to parse a parser statement in one go // this is officially deprecated but can be switched on via an option // in the case it causes too much performance issues. if (chunkInput) { chunks = chunker(str, failFunction); } else { chunks = [str]; } current = chunks[0]; skipWhitespace(0); }; parserInput.end = function () { var message; var isFinished = parserInput.i >= input.length; if (parserInput.i < furthest) { message = furthestPossibleErrorMessage; parserInput.i = furthest; } return { isFinished: isFinished, furthest: parserInput.i, furthestPossibleErrorMessage: message, furthestReachedEnd: parserInput.i >= input.length - 1, furthestChar: input[parserInput.i] }; }; return parserInput; }); // // less.js - parser // // A relatively straight-forward predictive parser. // There is no tokenization/lexing stage, the input is parsed // in one sweep. // // To make the parser fast enough to run in the browser, several // optimization had to be made: // // - Matching and slicing on a huge input is often cause of slowdowns. // The solution is to chunkify the input into smaller strings. // The chunks are stored in the `chunks` var, // `j` holds the current chunk index, and `currentPos` holds // the index of the current chunk in relation to `input`. // This gives us an almost 4x speed-up. // // - In many cases, we don't need to match individual tokens; // for example, if a value doesn't hold any variables, operations // or dynamic references, the parser can effectively 'skip' it, // treating it as a literal. // An example would be '1px solid #000' - which evaluates to itself, // we don't need to know what the individual components are. // The drawback, of course is that you don't get the benefits of // syntax-checking on the CSS. This gives us a 50% speed-up in the parser, // and a smaller speed-up in the code-gen. // // // Token matching is done with the `$` function, which either takes // a terminal string or regexp, or a non-terminal function to call. // It also takes care of moving all the indices forwards. // var Parser = function Parser(context, imports, fileInfo) { var parsers; var parserInput = getParserInput(); function error(msg, type) { throw new LessError({ index: parserInput.i, filename: fileInfo.filename, type: type || 'Syntax', message: msg }, imports); } function expect(arg, msg) { // some older browsers return typeof 'function' for RegExp var result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg); if (result) { return result; } error(msg || (typeof arg === 'string' ? "expected '" + arg + "' got '" + parserInput.currentChar() + "'" : 'unexpected token')); } // Specialization of expect() function expectChar(arg, msg) { if (parserInput.$char(arg)) { return arg; } error(msg || "expected '" + arg + "' got '" + parserInput.currentChar() + "'"); } function getDebugInfo(index) { var filename = fileInfo.filename; return { lineNumber: getLocation(index, parserInput.getInput()).line + 1, fileName: filename }; } /** * Used after initial parsing to create nodes on the fly * * @param {String} str - string to parse * @param {Array} parseList - array of parsers to run input through e.g. ["value", "important"] * @param {Number} currentIndex - start number to begin indexing * @param {Object} fileInfo - fileInfo to attach to created nodes */ function parseNode(str, parseList, currentIndex, fileInfo, callback) { var result; var returnNodes = []; var parser = parserInput; try { parser.start(str, false, function fail(msg, index) { callback({ message: msg, index: index + currentIndex }); }); for (var x = 0, p = void 0, i_1; (p = parseList[x]); x++) { i_1 = parser.i; result = parsers[p](); if (result) { try { result._index = i_1 + currentIndex; result._fileInfo = fileInfo; } catch (e) { } returnNodes.push(result); } else { returnNodes.push(null); } } var endInfo = parser.end(); if (endInfo.isFinished) { callback(null, returnNodes); } else { callback(true, null); } } catch (e) { throw new LessError({ index: e.index + currentIndex, message: e.message }, imports, fileInfo.filename); } } // // The Parser // return { parserInput: parserInput, imports: imports, fileInfo: fileInfo, parseNode: parseNode, // // Parse an input string into an abstract syntax tree, // @param str A string containing 'less' markup // @param callback call `callback` when done. // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply // parse: function (str, callback, additionalData) { var root; var error = null; var globalVars; var modifyVars; var ignored; var preText = ''; globalVars = (additionalData && additionalData.globalVars) ? Parser.serializeVars(additionalData.globalVars) + "\n" : ''; modifyVars = (additionalData && additionalData.modifyVars) ? "\n" + Parser.serializeVars(additionalData.modifyVars) : ''; if (context.pluginManager) { var preProcessors = context.pluginManager.getPreProcessors(); for (var i_2 = 0; i_2 < preProcessors.length; i_2++) { str = preProcessors[i_2].process(str, { context: context, imports: imports, fileInfo: fileInfo }); } } if (globalVars || (additionalData && additionalData.banner)) { preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars; ignored = imports.contentsIgnoredChars; ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0; ignored[fileInfo.filename] += preText.length; } str = str.replace(/\r\n?/g, '\n'); // Remove potential UTF Byte Order Mark str = preText + str.replace(/^\uFEFF/, '') + modifyVars; imports.contents[fileInfo.filename] = str; // Start with the primary rule. // The whole syntax tree is held under a Ruleset node, // with the `root` property set to true, so no `{}` are // output. The callback is called when the input is parsed. try { parserInput.start(str, context.chunkInput, function fail(msg, index) { throw new LessError({ index: index, type: 'Parse', message: msg, filename: fileInfo.filename }, imports); }); tree.Node.prototype.parse = this; root = new tree.Ruleset(null, this.parsers.primary()); tree.Node.prototype.rootNode = root; root.root = true; root.firstRoot = true; root.functionRegistry = functionRegistry.inherit(); } catch (e) { return callback(new LessError(e, imports, fileInfo.filename)); } // If `i` is smaller than the `input.length - 1`, // it means the parser wasn't able to parse the whole // string, so we've got a parsing error. // // We try to extract a \n delimited string, // showing the line where the parse error occurred. // We split it up into two parts (the part which parsed, // and the part which didn't), so we can color them differently. var endInfo = parserInput.end(); if (!endInfo.isFinished) { var message = endInfo.furthestPossibleErrorMessage; if (!message) { message = 'Unrecognised input'; if (endInfo.furthestChar === '}') { message += '. Possibly missing opening \'{\''; } else if (endInfo.furthestChar === ')') { message += '. Possibly missing opening \'(\''; } else if (endInfo.furthestReachedEnd) { message += '. Possibly missing something'; } } error = new LessError({ type: 'Parse', message: message, index: endInfo.furthest, filename: fileInfo.filename }, imports); } var finish = function (e) { e = error || e || imports.error; if (e) { if (!(e instanceof LessError)) { e = new LessError(e, imports, fileInfo.filename); } return callback(e); } else { return callback(null, root); } }; if (context.processImports !== false) { new visitors.ImportVisitor(imports, finish) .run(root); } else { return finish(); } }, // // Here in, the parsing rules/functions // // The basic structure of the syntax tree generated is as follows: // // Ruleset -> Declaration -> Value -> Expression -> Entity // // Here's some Less code: // // .class { // color: #fff; // border: 1px solid #000; // width: @w + 4px; // > .child {...} // } // // And here's what the parse tree might look like: // // Ruleset (Selector '.class', [ // Declaration ("color", Value ([Expression [Color #fff]])) // Declaration ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) // Declaration ("width", Value ([Expression [Operation " + " [Variable "@w"][Dimension 4px]]])) // Ruleset (Selector [Element '>', '.child'], [...]) // ]) // // In general, most rules will try to parse a token with the `$re()` function, and if the return // value is truly, will return a new node, of the relevant type. Sometimes, we need to check // first, before parsing, that's when we use `peek()`. // parsers: parsers = { // // The `primary` rule is the *entry* and *exit* point of the parser. // The rules here can appear at any level of the parse tree. // // The recursive nature of the grammar is an interplay between the `block` // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, // as represented by this simplified grammar: // // primary → (ruleset | declaration)+ // ruleset → selector+ block // block → '{' primary '}' // // Only at one point is the primary rule not called from the // block rule: at the root level. // primary: function () { var mixin = this.mixin; var root = []; var node; while (true) { while (true) { node = this.comment(); if (!node) { break; } root.push(node); } // always process comments before deciding if finished if (parserInput.finished) { break; } if (parserInput.peek('}')) { break; } node = this.extendRule(); if (node) { root = root.concat(node); continue; } node = mixin.definition() || this.declaration() || mixin.call(false, false) || this.ruleset() || this.variableCall() || this.entities.call() || this.atrule(); if (node) { root.push(node); } else { var foundSemiColon = false; while (parserInput.$char(';')) { foundSemiColon = true; } if (!foundSemiColon) { break; } } } return root; }, // comments are collected by the main parsing mechanism and then assigned to nodes // where the current structure allows it comment: function () { if (parserInput.commentStore.length) { var comment = parserInput.commentStore.shift(); return new (tree.Comment)(comment.text, comment.isLineComment, comment.index, fileInfo); } }, // // Entities are tokens which can be found inside an Expression // entities: { mixinLookup: function () { return parsers.mixin.call(true, true); }, // // A string, which supports escaping " and ' // // "milky way" 'he\'s the one!' // quoted: function (forceEscaped) { var str; var index = parserInput.i; var isEscaped = false; parserInput.save(); if (parserInput.$char('~')) { isEscaped = true; } else if (forceEscaped) { parserInput.restore(); return; } str = parserInput.$quoted(); if (!str) { parserInput.restore(); return; } parserInput.forget(); return new (tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index, fileInfo); }, // // A catch-all word, such as: // // black border-collapse // keyword: function () { var k = parserInput.$char('%') || parserInput.$re(/^\[?(?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\]?/); if (k) { return tree.Color.fromKeyword(k) || new (tree.Keyword)(k); } }, // // A function call // // rgb(255, 0, 255) // // The arguments are parsed with the `entities.arguments` parser. // call: function () { var name; var args; var func; var index = parserInput.i; // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 if (parserInput.peek(/^url\(/i)) { return; } parserInput.save(); name = parserInput.$re(/^([\w-]+|%|progid:[\w\.]+)\(/); if (!name) { parserInput.forget(); return; } name = name[1]; func = this.customFuncCall(name); if (func) { args = func.parse(); if (args && func.stop) { parserInput.forget(); return args; } } args = this.arguments(args); if (!parserInput.$char(')')) { parserInput.restore('Could not parse call arguments or missing \')\''); return; } parserInput.forget(); return new (tree.Call)(name, args, index, fileInfo); }, // // Parsing rules for functions with non-standard args, e.g.: // // boolean(not(2 > 1)) // // This is a quick prototype, to be modified/improved when // more custom-parsed funcs come (e.g. `selector(...)`) // customFuncCall: function (name) { /* Ideally the table is to be moved out of here for faster perf., but it's quite tricky since it relies on all these `parsers` and `expect` available only here */ return { alpha: f(parsers.ieAlpha, true), boolean: f(condition), 'if': f(condition) }[name.toLowerCase()]; function f(parse, stop) { return { parse: parse, stop: stop // when true - stop after parse() and return its result, // otherwise continue for plain args }; } function condition() { return [expect(parsers.condition, 'expected condition')]; } }, arguments: function (prevArgs) { var argsComma = prevArgs || []; var argsSemiColon = []; var isSemiColonSeparated; var value; parserInput.save(); while (true) { if (prevArgs) { prevArgs = false; } else { value = parsers.detachedRuleset() || this.assignment() || parsers.expression(); if (!value) { break; } if (value.value && value.value.length == 1) { value = value.value[0]; } argsComma.push(value); } if (parserInput.$char(',')) { continue; } if (parserInput.$char(';') || isSemiColonSeparated) { isSemiColonSeparated = true; value = (argsComma.length < 1) ? argsComma[0] : new tree.Value(argsComma); argsSemiColon.push(value); argsComma = []; } } parserInput.forget(); return isSemiColonSeparated ? argsSemiColon : argsComma; }, literal: function () { return this.dimension() || this.color() || this.quoted() || this.unicodeDescriptor(); }, // Assignments are argument entities for calls. // They are present in ie filter properties as shown below. // // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* ) // assignment: function () { var key; var value; parserInput.save(); key = parserInput.$re(/^\w+(?=\s?=)/i); if (!key) { parserInput.restore(); return; } if (!parserInput.$char('=')) { parserInput.restore(); return; } value = parsers.entity(); if (value) { parserInput.forget(); return new (tree.Assignment)(key, value); } else { parserInput.restore(); } }, // // Parse url() tokens // // We use a specific rule for urls, because they don't really behave like // standard function calls. The difference is that the argument doesn't have // to be enclosed within a string, so it can't be parsed as an Expression. // url: function () { var value; var index = parserInput.i; parserInput.autoCommentAbsorb = false; if (!parserInput.$str('url(')) { parserInput.autoCommentAbsorb = true; return; } value = this.quoted() || this.variable() || this.property() || parserInput.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || ''; parserInput.autoCommentAbsorb = true; expectChar(')'); return new (tree.URL)((value.value != null || value instanceof tree.Variable || value instanceof tree.Property) ? value : new (tree.Anonymous)(value, index), index, fileInfo); }, // // A Variable entity, such as `@fink`, in // // width: @fink + 2px // // We use a different parser for variable definitions, // see `parsers.variable`. // variable: function () { var ch; var name; var index = parserInput.i; parserInput.save(); if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\w-]+/))) { ch = parserInput.currentChar(); if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\s/)) { // this may be a VariableCall lookup var result = parsers.variableCall(name); if (result) { parserInput.forget(); return result; } } parserInput.forget(); return new (tree.Variable)(name, index, fileInfo); } parserInput.restore(); }, // A variable entity using the protective {} e.g. @{var} variableCurly: function () { var curly; var index = parserInput.i; if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) { return new (tree.Variable)("@" + curly[1], index, fileInfo); } }, // // A Property accessor, such as `$color`, in // // background-color: $color // property: function () { var name; var index = parserInput.i; if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\$[\w-]+/))) { return new (tree.Property)(name, index, fileInfo); } }, // A property entity useing the protective {} e.g. ${prop} propertyCurly: function () { var curly; var index = parserInput.i; if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) { return new (tree.Property)("$" + curly[1], index, fileInfo); } }, // // A Hexadecimal color // // #4F3C2F // // `rgb` and `hsl` colors are parsed through the `entities.call` parser. // color: function () { var rgb; parserInput.save(); if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\w.#\[])?/))) { if (!rgb[2]) { parserInput.forget(); return new (tree.Color)(rgb[1], undefined, rgb[0]); } } parserInput.restore(); }, colorKeyword: function () { parserInput.save(); var autoCommentAbsorb = parserInput.autoCommentAbsorb; parserInput.autoCommentAbsorb = false; var k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/); parserInput.autoCommentAbsorb = autoCommentAbsorb; if (!k) { parserInput.forget(); return; } parserInput.restore(); var color = tree.Color.fromKeyword(k); if (color) { parserInput.$str(k); return color; } }, // // A Dimension, that is, a number and a unit // // 0.5em 95% // dimension: function () { if (parserInput.peekNotNumeric()) { return; } var value = parserInput.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i); if (value) { return new (tree.Dimension)(value[1], value[2]); } }, // // A unicode descriptor, as is used in unicode-range // // U+0?? or U+00A1-00A9 // unicodeDescriptor: function () { var ud; ud = parserInput.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/); if (ud) { return new (tree.UnicodeDescriptor)(ud[0]); } }, // // JavaScript code to be evaluated // // `window.location.href` // javascript: function () { var js; var index = parserInput.i; parserInput.save(); var escape = parserInput.$char('~'); var jsQuote = parserInput.$char('`'); if (!jsQuote) { parserInput.restore(); return; } js = parserInput.$re(/^[^`]*`/); if (js) { parserInput.forget(); return new (tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index, fileInfo); } parserInput.restore('invalid javascript definition'); } }, // // The variable part of a variable definition. Used in the `rule` parser // // @fink: // variable: function () { var name; if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)\s*:/))) { return name[1]; } }, // // Call a variable value to retrieve a detached ruleset // or a value from a detached ruleset's rules. // // @fink(); // @fink; // color: @fink[@color]; // variableCall: function (parsedName) { var lookups; var i = parserInput.i; var inValue = !!parsedName; var name = parsedName; parserInput.save(); if (name || (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)(\(\s*\))?/)))) { lookups = this.mixin.ruleLookups(); if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) { parserInput.restore('Missing \'[...]\' lookup in variable call'); return; } if (!inValue) { name = name[1]; } var call = new tree.VariableCall(name, i, fileInfo); if (!inValue && parsers.end()) { parserInput.forget(); return call; } else { parserInput.forget(); return new tree.NamespaceValue(call, lookups, i, fileInfo); } } parserInput.restore(); }, // // extend syntax - used to extend selectors // extend: function (isRule) { var elements; var e; var index = parserInput.i; var option; var extendList; var extend; if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) { return; } do { option = null; elements = null; while (!(option = parserInput.$re(/^(all)(?=\s*(\)|,))/))) { e = this.element(); if (!e) { break; } if (elements) { elements.push(e); } else { elements = [e]; } } option = option && option[1]; if (!elements) { error('Missing target selector for :extend().'); } extend = new (tree.Extend)(new (tree.Selector)(elements), option, index, fileInfo); if (extendList) { extendList.push(extend); } else { extendList = [extend]; } } while (parserInput.$char(',')); expect(/^\)/); if (isRule) { expect(/^;/); } return extendList; }, // // extendRule - used in a rule to extend all the parent selectors // extendRule: function () { return this.extend(true); }, // // Mixins // mixin: { // // A Mixin call, with an optional argument list // // #mixins > .square(#fff); // #mixins.square(#fff); // .rounded(4px, black); // .button; // // We can lookup / return a value using the lookup syntax: // // color: #mixin.square(#fff)[@color]; // // The `while` loop is there because mixins can be // namespaced, but we only support the child and descendant // selector for now. // call: function (inValue, getLookup) { var s = parserInput.currentChar(); var important = false; var lookups; var index = parserInput.i; var elements; var args; var hasParens; if (s !== '.' && s !== '#') { return; } parserInput.save(); // stop us absorbing part of an invalid selector elements = this.elements(); if (elements) { if (parserInput.$char('(')) { args = this.args(true).args; expectChar(')'); hasParens = true; } if (getLookup !== false) { lookups = this.ruleLookups(); } if (getLookup === true && !lookups) { parserInput.restore(); return; } if (inValue && !lookups && !hasParens) { // This isn't a valid in-value mixin call parserInput.restore(); return; } if (!inValue && parsers.important()) { important = true; } if (inValue || parsers.end()) { parserInput.forget(); var mixin = new (tree.mixin.Call)(elements, args, index, fileInfo, !lookups && important); if (lookups) { return new tree.NamespaceValue(mixin, lookups); } else { return mixin; } } } parserInput.restore(); }, /** * Matching elements for mixins * (Start with . or # and can have > ) */ elements: function () { var elements; var e; var c; var elem; var elemIndex; var re = /^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/; while (true) { elemIndex = parserInput.i; e = parserInput.$re(re); if (!e) { break; } elem = new (tree.Element)(c, e, false, elemIndex, fileInfo); if (elements) { elements.push(elem); } else { elements = [elem]; } c = parserInput.$char('>'); } return elements; }, args: function (isCall) { var entities = parsers.entities; var returner = { args: null, variadic: false }; var expressions = []; var argsSemiColon = []; var argsComma = []; var isSemiColonSeparated; var expressionContainsNamed; var name; var nameLoop; var value; var arg; var expand; var hasSep = true; parserInput.save(); while (true) { if (isCall) { arg = parsers.detachedRuleset() || parsers.expression(); } else { parserInput.commentStore.length = 0; if (parserInput.$str('...')) { returner.variadic = true; if (parserInput.$char(';') && !isSemiColonSeparated) { isSemiColonSeparated = true; } (isSemiColonSeparated ? argsSemiColon : argsComma) .push({ variadic: true }); break; } arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true); } if (!arg || !hasSep) { break; } nameLoop = null; if (arg.throwAwayComments) { arg.throwAwayComments(); } value = arg; var val = null; if (isCall) { // Variable if (arg.value && arg.value.length == 1) { val = arg.value[0]; } } else { val = arg; } if (val && (val instanceof tree.Variable || val instanceof tree.Property)) { if (parserInput.$char(':')) { if (expressions.length > 0) { if (isSemiColonSeparated) { error('Cannot mix ; and , as delimiter types'); } expressionContainsNamed = true; } value = parsers.detachedRuleset() || parsers.expression(); if (!value) { if (isCall) { error('could not understand value for named argument'); } else { parserInput.restore(); returner.args = []; return returner; } } nameLoop = (name = val.name); } else if (parserInput.$str('...')) { if (!isCall) { returner.variadic = true; if (parserInput.$char(';') && !isSemiColonSeparated) { isSemiColonSeparated = true; } (isSemiColonSeparated ? argsSemiColon : argsComma) .push({ name: arg.name, variadic: true }); break; } else { expand = true; } } else if (!isCall) { name = nameLoop = val.name; value = null; } } if (value) { expressions.push(value); } argsComma.push({ name: nameLoop, value: value, expand: expand }); if (parserInput.$char(',')) { hasSep = true; continue; } hasSep = parserInput.$char(';') === ';'; if (hasSep || isSemiColonSeparated) { if (expressionContainsNamed) { error('Cannot mix ; and , as delimiter types'); } isSemiColonSeparated = true; if (expressions.length > 1) { value = new (tree.Value)(expressions); } argsSemiColon.push({ name: name, value: value, expand: expand }); name = null; expressions = []; expressionContainsNamed = false; } } parserInput.forget(); returner.args = isSemiColonSeparated ? argsSemiColon : argsComma; return returner; }, // // A Mixin definition, with a list of parameters // // .rounded (@radius: 2px, @color) { // ... // } // // Until we have a finer grained state-machine, we have to // do a look-ahead, to make sure we don't have a mixin call. // See the `rule` function for more information. // // We start by matching `.rounded (`, and then proceed on to // the argument list, which has optional default values. // We store the parameters in `params`, with a `value` key, // if there is a value, such as in the case of `@radius`. // // Once we've got our params list, and a closing `)`, we parse // the `{...}` block. // definition: function () { var name; var params = []; var match; var ruleset; var cond; var variadic = false; if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') || parserInput.peek(/^[^{]*\}/)) { return; } parserInput.save(); match = parserInput.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/); if (match) { name = match[1]; var argInfo = this.args(false); params = argInfo.args; variadic = argInfo.variadic; // .mixincall("@{a}"); // looks a bit like a mixin definition.. // also // .mixincall(@a: {rule: set;}); // so we have to be nice and restore if (!parserInput.$char(')')) { parserInput.restore('Missing closing \')\''); return; } parserInput.commentStore.length = 0; if (parserInput.$str('when')) { // Guard cond = expect(parsers.conditions, 'expected condition'); } ruleset = parsers.block(); if (ruleset) { parserInput.forget(); return new (tree.mixin.Definition)(name, params, ruleset, cond, variadic); } else { parserInput.restore(); } } else { parserInput.restore(); } }, ruleLookups: function () { var rule; var lookups = []; if (parserInput.currentChar() !== '[') { return; } while (true) { parserInput.save(); rule = this.lookupValue(); if (!rule && rule !== '') { parserInput.restore(); break; } lookups.push(rule); parserInput.forget(); } if (lookups.length > 0) { return lookups; } }, lookupValue: function () { parserInput.save(); if (!parserInput.$char('[')) { parserInput.restore(); return; } var name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/); if (!parserInput.$char(']')) { parserInput.restore(); return; } if (name || name === '') { parserInput.forget(); return name; } parserInput.restore(); } }, // // Entities are the smallest recognized token, // and can be found inside a rule's value. // entity: function () { var entities = this.entities; return this.comment() || entities.literal() || entities.variable() || entities.url() || entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) || entities.javascript(); }, // // A Declaration terminator. Note that we use `peek()` to check for '}', // because the `block` rule will be expecting it, but we still need to make sure // it's there, if ';' was omitted. // end: function () { return parserInput.$char(';') || parserInput.peek('}'); }, // // IE's alpha function // // alpha(opacity=88) // ieAlpha: function () { var value; // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 if (!parserInput.$re(/^opacity=/i)) { return; } value = parserInput.$re(/^\d+/); if (!value) { value = expect(parsers.entities.variable, 'Could not parse alpha'); value = "@{" + value.name.slice(1) + "}"; } expectChar(')'); return new tree.Quoted('', "alpha(opacity=" + value + ")"); }, // // A Selector Element // // div // + h1 // #socks // input[type="text"] // // Elements are the building blocks for Selectors, // they are made out of a `Combinator` (see combinator rule), // and an element name, such as a tag a class, or `*`. // element: function () { var e; var c; var v; var index = parserInput.i; c = this.combinator(); e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || parserInput.$char('*') || parserInput.$char('&') || this.attribute() || parserInput.$re(/^\([^&()@]+\)/) || parserInput.$re(/^[\.#:](?=@)/) || this.entities.variableCurly(); if (!e) { parserInput.save(); if (parserInput.$char('(')) { if ((v = this.selector(false)) && parserInput.$char(')')) { e = new (tree.Paren)(v); parserInput.forget(); } else { parserInput.restore('Missing closing \')\''); } } else { parserInput.forget(); } } if (e) { return new (tree.Element)(c, e, e instanceof tree.Variable, index, fileInfo); } }, // // Combinators combine elements together, in a Selector. // // Because our parser isn't white-space sensitive, special care // has to be taken, when parsing the descendant combinator, ` `, // as it's an empty space. We have to check the previous character // in the input, to see if it's a ` ` character. More info on how // we deal with this in *combinator.js*. // combinator: function () { var c = parserInput.currentChar(); if (c === '/') { parserInput.save(); var slashedCombinator = parserInput.$re(/^\/[a-z]+\//i); if (slashedCombinator) { parserInput.forget(); return new (tree.Combinator)(slashedCombinator); } parserInput.restore(); } if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') { parserInput.i++; if (c === '^' && parserInput.currentChar() === '^') { c = '^^'; parserInput.i++; } while (parserInput.isWhitespace()) { parserInput.i++; } return new (tree.Combinator)(c); } else if (parserInput.isWhitespace(-1)) { return new (tree.Combinator)(' '); } else { return new (tree.Combinator)(null); } }, // // A CSS Selector // with less extensions e.g. the ability to extend and guard // // .class > div + h1 // li a:hover // // Selectors are made out of one or more Elements, see above. // selector: function (isLess) { var index = parserInput.i; var elements; var extendList; var c; var e; var allExtends; var when; var condition; isLess = isLess !== false; while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) { if (when) { condition = expect(this.conditions, 'expected condition'); } else if (condition) { error('CSS guard can only be used at the end of selector'); } else if (extendList) { if (allExtends) { allExtends = allExtends.concat(extendList); } else { allExtends = extendList; } } else { if (allExtends) { error('Extend can only be used at the end of selector'); } c = parserInput.currentChar(); if (elements) { elements.push(e); } else { elements = [e]; } e = null; } if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') { break; } } if (elements) { return new (tree.Selector)(elements, allExtends, condition, index, fileInfo); } if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); } }, selectors: function () { var s; var selectors; while (true) { s = this.selector(); if (!s) { break; } if (selectors) { selectors.push(s); } else { selectors = [s]; } parserInput.commentStore.length = 0; if (s.condition && selectors.length > 1) { error("Guards are only currently allowed on a single selector."); } if (!parserInput.$char(',')) { break; } if (s.condition) { error("Guards are only currently allowed on a single selector."); } parserInput.commentStore.length = 0; } return selectors; }, attribute: function () { if (!parserInput.$char('[')) { return; } var entities = this.entities; var key; var val; var op; if (!(key = entities.variableCurly())) { key = expect(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/); } op = parserInput.$re(/^[|~*$^]?=/); if (op) { val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\w-]+/) || entities.variableCurly(); } expectChar(']'); return new (tree.Attribute)(key, op, val); }, // // The `block` rule is used by `ruleset` and `mixin.definition`. // It's a wrapper around the `primary` rule, with added `{}`. // block: function () { var content; if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) { return content; } }, blockRuleset: function () { var block = this.block(); if (block) { block = new tree.Ruleset(null, block); } return block; }, detachedRuleset: function () { var argInfo; var params; var variadic; parserInput.save(); if (parserInput.$re(/^[.#]\(/)) { /** * DR args currently only implemented for each() function, and not * yet settable as `@dr: #(@arg) {}` * This should be done when DRs are merged with mixins. * See: https://github.com/less/less-meta/issues/16 */ argInfo = this.mixin.args(false); params = argInfo.args; variadic = argInfo.variadic; if (!parserInput.$char(')')) { parserInput.restore(); return; } } var blockRuleset = this.blockRuleset(); if (blockRuleset) { parserInput.forget(); if (params) { return new tree.mixin.Definition(null, params, blockRuleset, null, variadic); } return new tree.DetachedRuleset(blockRuleset); } parserInput.restore(); }, // // div, .class, body > p {...} // ruleset: function () { var selectors; var rules; var debugInfo; parserInput.save(); if (context.dumpLineNumbers) { debugInfo = getDebugInfo(parserInput.i); } selectors = this.selectors(); if (selectors && (rules = this.block())) { parserInput.forget(); var ruleset = new (tree.Ruleset)(selectors, rules, context.strictImports); if (context.dumpLineNumbers) { ruleset.debugInfo = debugInfo; } return ruleset; } else { parserInput.restore(); } }, declaration: function () { var name; var value; var index = parserInput.i; var hasDR; var c = parserInput.currentChar(); var important; var merge; var isVariable; if (c === '.' || c === '#' || c === '&' || c === ':') { return; } parserInput.save(); name = this.variable() || this.ruleProperty(); if (name) { isVariable = typeof name === 'string'; if (isVariable) { value = this.detachedRuleset(); if (value) { hasDR = true; } } parserInput.commentStore.length = 0; if (!value) { // a name returned by this.ruleProperty() is always an array of the form: // [string-1, ..., string-n, ""] or [string-1, ..., string-n, "+"] // where each item is a tree.Keyword or tree.Variable merge = !isVariable && name.length > 1 && name.pop().value; // Custom property values get permissive parsing if (name[0].value && name[0].value.slice(0, 2) === '--') { value = this.permissiveValue(); } // Try to store values as anonymous // If we need the value later we'll re-parse it in ruleset.parseValue else { value = this.anonymousValue(); } if (value) { parserInput.forget(); // anonymous values absorb the end ';' which is required for them to work return new (tree.Declaration)(name, value, false, merge, index, fileInfo); } if (!value) { value = this.value(); } if (value) { important = this.important(); } else if (isVariable) { // As a last resort, try permissiveValue value = this.permissiveValue(); } } if (value && (this.end() || hasDR)) { parserInput.forget(); return new (tree.Declaration)(name, value, important, merge, index, fileInfo); } else { parserInput.restore(); } } else { parserInput.restore(); } }, anonymousValue: function () { var index = parserInput.i; var match = parserInput.$re(/^([^.#@\$+\/'"*`(;{}-]*);/); if (match) { return new (tree.Anonymous)(match[1], index); } }, /** * Used for custom properties, at-rules, and variables (as fallback) * Parses almost anything inside of {} [] () "" blocks * until it reaches outer-most tokens. * * First, it will try to parse comments and entities to reach * the end. This is mostly like the Expression parser except no * math is allowed. */ permissiveValue: function (untilTokens) { var i; var e; var done; var value; var tok = untilTokens || ';'; var index = parserInput.i; var result = []; function testCurrentChar() { var char = parserInput.currentChar(); if (typeof tok === 'string') { return char === tok; } else { return tok.test(char); } } if (testCurrentChar()) { return; } value = []; do { e = this.comment(); if (e) { value.push(e); continue; } e = this.entity(); if (e) { value.push(e); } } while (e); done = testCurrentChar(); if (value.length > 0) { value = new (tree.Expression)(value); if (done) { return value; } else { result.push(value); } // Preserve space before $parseUntil as it will not if (parserInput.prevChar() === ' ') { result.push(new tree.Anonymous(' ', index)); } } parserInput.save(); value = parserInput.$parseUntil(tok); if (value) { if (typeof value === 'string') { error("Expected '" + value + "'", 'Parse'); } if (value.length === 1 && value[0] === ' ') { parserInput.forget(); return new tree.Anonymous('', index); } var item = void 0; for (i = 0; i < value.length; i++) { item = value[i]; if (Array.isArray(item)) { // Treat actual quotes as normal quoted values result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo)); } else { if (i === value.length - 1) { item = item.trim(); } // Treat like quoted values, but replace vars like unquoted expressions var quote = new tree.Quoted('\'', item, true, index, fileInfo); quote.variableRegex = /@([\w-]+)/g; quote.propRegex = /\$([\w-]+)/g; result.push(quote); } } parserInput.forget(); return new tree.Expression(result, true); } parserInput.restore(); }, // // An @import atrule // // @import "lib"; // // Depending on our environment, importing is done differently: // In the browser, it's an XHR request, in Node, it would be a // file-system operation. The function used for importing is // stored in `import`, which we pass to the Import constructor. // 'import': function () { var path; var features; var index = parserInput.i; var dir = parserInput.$re(/^@import?\s+/); if (dir) { var options_1 = (dir ? this.importOptions() : null) || {}; if ((path = this.entities.quoted() || this.entities.url())) { features = this.mediaFeatures(); if (!parserInput.$char(';')) { parserInput.i = index; error('missing semi-colon or unrecognised media features on import'); } features = features && new (tree.Value)(features); return new (tree.Import)(path, features, options_1, index, fileInfo); } else { parserInput.i = index; error('malformed import statement'); } } }, importOptions: function () { var o; var options = {}; var optionName; var value; // list of options, surrounded by parens if (!parserInput.$char('(')) { return null; } do { o = this.importOption(); if (o) { optionName = o; value = true; switch (optionName) { case 'css': optionName = 'less'; value = false; break; case 'once': optionName = 'multiple'; value = false; break; } options[optionName] = value; if (!parserInput.$char(',')) { break; } } } while (o); expectChar(')'); return options; }, importOption: function () { var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/); if (opt) { return opt[1]; } }, mediaFeature: function () { var entities = this.entities; var nodes = []; var e; var p; parserInput.save(); do { e = entities.keyword() || entities.variable() || entities.mixinLookup(); if (e) { nodes.push(e); } else if (parserInput.$char('(')) { p = this.property(); e = this.value(); if (parserInput.$char(')')) { if (p && e) { nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i, fileInfo, true))); } else if (e) { nodes.push(new (tree.Paren)(e)); } else { error('badly formed media feature definition'); } } else { error('Missing closing \')\'', 'Parse'); } } } while (e); parserInput.forget(); if (nodes.length > 0) { return new (tree.Expression)(nodes); } }, mediaFeatures: function () { var entities = this.entities; var features = []; var e; do { e = this.mediaFeature(); if (e) { features.push(e); if (!parserInput.$char(',')) { break; } } else { e = entities.variable() || entities.mixinLookup(); if (e) { features.push(e); if (!parserInput.$char(',')) { break; } } } } while (e); return features.length > 0 ? features : null; }, media: function () { var features; var rules; var media; var debugInfo; var index = parserInput.i; if (context.dumpLineNumbers) { debugInfo = getDebugInfo(index); } parserInput.save(); if (parserInput.$str('@media')) { features = this.mediaFeatures(); rules = this.block(); if (!rules) { error('media definitions require block statements after any features'); } parserInput.forget(); media = new (tree.Media)(rules, features, index, fileInfo); if (context.dumpLineNumbers) { media.debugInfo = debugInfo; } return media; } parserInput.restore(); }, // // A @plugin directive, used to import plugins dynamically. // // @plugin (args) "lib"; // plugin: function () { var path; var args; var options; var index = parserInput.i; var dir = parserInput.$re(/^@plugin?\s+/); if (dir) { args = this.pluginArgs(); if (args) { options = { pluginArgs: args, isPlugin: true }; } else { options = { isPlugin: true }; } if ((path = this.entities.quoted() || this.entities.url())) { if (!parserInput.$char(';')) { parserInput.i = index; error('missing semi-colon on @plugin'); } return new (tree.Import)(path, null, options, index, fileInfo); } else { parserInput.i = index; error('malformed @plugin statement'); } } }, pluginArgs: function () { // list of options, surrounded by parens parserInput.save(); if (!parserInput.$char('(')) { parserInput.restore(); return null; } var args = parserInput.$re(/^\s*([^\);]+)\)\s*/); if (args[1]) { parserInput.forget(); return args[1].trim(); } else { parserInput.restore(); return null; } }, // // A CSS AtRule // // @charset "utf-8"; // atrule: function () { var index = parserInput.i; var name; var value; var rules; var nonVendorSpecificName; var hasIdentifier; var hasExpression; var hasUnknown; var hasBlock = true; var isRooted = true; if (parserInput.currentChar() !== '@') { return; } value = this['import']() || this.plugin() || this.media(); if (value) { return value; } parserInput.save(); name = parserInput.$re(/^@[a-z-]+/); if (!name) { return; } nonVendorSpecificName = name; if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) { nonVendorSpecificName = "@" + name.slice(name.indexOf('-', 2) + 1); } switch (nonVendorSpecificName) { case '@charset': hasIdentifier = true; hasBlock = false; break; case '@namespace': hasExpression = true; hasBlock = false; break; case '@keyframes': case '@counter-style': hasIdentifier = true; break; case '@document': case '@supports': hasUnknown = true; isRooted = false; break; default: hasUnknown = true; break; } parserInput.commentStore.length = 0; if (hasIdentifier) { value = this.entity(); if (!value) { error("expected " + name + " identifier"); } } else if (hasExpression) { value = this.expression(); if (!value) { error("expected " + name + " expression"); } } else if (hasUnknown) { value = this.permissiveValue(/^[{;]/); hasBlock = (parserInput.currentChar() === '{'); if (!value) { if (!hasBlock && parserInput.currentChar() !== ';') { error(name + " rule is missing block or ending semi-colon"); } } else if (!value.value) { value = null; } } if (hasBlock) { rules = this.blockRuleset(); } if (rules || (!hasBlock && value && parserInput.$char(';'))) { parserInput.forget(); return new (tree.AtRule)(name, value, rules, index, fileInfo, context.dumpLineNumbers ? getDebugInfo(index) : null, isRooted); } parserInput.restore('at-rule options not recognised'); }, // // A Value is a comma-delimited list of Expressions // // font-family: Baskerville, Georgia, serif; // // In a Rule, a Value represents everything after the `:`, // and before the `;`. // value: function () { var e; var expressions = []; var index = parserInput.i; do { e = this.expression(); if (e) { expressions.push(e); if (!parserInput.$char(',')) { break; } } } while (e); if (expressions.length > 0) { return new (tree.Value)(expressions, index); } }, important: function () { if (parserInput.currentChar() === '!') { return parserInput.$re(/^! *important/); } }, sub: function () { var a; var e; parserInput.save(); if (parserInput.$char('(')) { a = this.addition(); if (a && parserInput.$char(')')) { parserInput.forget(); e = new (tree.Expression)([a]); e.parens = true; return e; } parserInput.restore('Expected \')\''); return; } parserInput.restore(); }, multiplication: function () { var m; var a; var op; var operation; var isSpaced; m = this.operand(); if (m) { isSpaced = parserInput.isWhitespace(-1); while (true) { if (parserInput.peek(/^\/[*\/]/)) { break; } parserInput.save(); op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./'); if (!op) { parserInput.forget(); break; } a = this.operand(); if (!a) { parserInput.restore(); break; } parserInput.forget(); m.parensInOp = true; a.parensInOp = true; operation = new (tree.Operation)(op, [operation || m, a], isSpaced); isSpaced = parserInput.isWhitespace(-1); } return operation || m; } }, addition: function () { var m; var a; var op; var operation; var isSpaced; m = this.multiplication(); if (m) { isSpaced = parserInput.isWhitespace(-1); while (true) { op = parserInput.$re(/^[-+]\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-'))); if (!op) { break; } a = this.multiplication(); if (!a) { break; } m.parensInOp = true; a.parensInOp = true; operation = new (tree.Operation)(op, [operation || m, a], isSpaced); isSpaced = parserInput.isWhitespace(-1); } return operation || m; } }, conditions: function () { var a; var b; var index = parserInput.i; var condition; a = this.condition(true); if (a) { while (true) { if (!parserInput.peek(/^,\s*(not\s*)?\(/) || !parserInput.$char(',')) { break; } b = this.condition(true); if (!b) { break; } condition = new (tree.Condition)('or', condition || a, b, index); } return condition || a; } }, condition: function (needsParens) { var result; var logical; var next; function or() { return parserInput.$str('or'); } result = this.conditionAnd(needsParens); if (!result) { return; } logical = or(); if (logical) { next = this.condition(needsParens); if (next) { result = new (tree.Condition)(logical, result, next); } else { return; } } return result; }, conditionAnd: function (needsParens) { var result; var logical; var next; var self = this; function insideCondition() { var cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens); if (!cond && !needsParens) { return self.atomicCondition(needsParens); } return cond; } function and() { return parserInput.$str('and'); } result = insideCondition(); if (!result) { return; } logical = and(); if (logical) { next = this.conditionAnd(needsParens); if (next) { result = new (tree.Condition)(logical, result, next); } else { return; } } return result; }, negatedCondition: function (needsParens) { if (parserInput.$str('not')) { var result = this.parenthesisCondition(needsParens); if (result) { result.negate = !result.negate; } return result; } }, parenthesisCondition: function (needsParens) { function tryConditionFollowedByParenthesis(me) { var body; parserInput.save(); body = me.condition(needsParens); if (!body) { parserInput.restore(); return; } if (!parserInput.$char(')')) { parserInput.restore(); return; } parserInput.forget(); return body; } var body; parserInput.save(); if (!parserInput.$str('(')) { parserInput.restore(); return; } body = tryConditionFollowedByParenthesis(this); if (body) { parserInput.forget(); return body; } body = this.atomicCondition(needsParens); if (!body) { parserInput.restore(); return; } if (!parserInput.$char(')')) { parserInput.restore("expected ')' got '" + parserInput.currentChar() + "'"); return; } parserInput.forget(); return body; }, atomicCondition: function (needsParens) { var entities = this.entities; var index = parserInput.i; var a; var b; var c; var op; function cond() { return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup(); } cond = cond.bind(this); a = cond(); if (a) { if (parserInput.$char('>')) { if (parserInput.$char('=')) { op = '>='; } else { op = '>'; } } else if (parserInput.$char('<')) { if (parserInput.$char('=')) { op = '<='; } else { op = '<'; } } else if (parserInput.$char('=')) { if (parserInput.$char('>')) { op = '=>'; } else if (parserInput.$char('<')) { op = '=<'; } else { op = '='; } } if (op) { b = cond(); if (b) { c = new (tree.Condition)(op, a, b, index, false); } else { error('expected expression'); } } else { c = new (tree.Condition)('=', a, new (tree.Keyword)('true'), index, false); } return c; } }, // // An operand is anything that can be part of an operation, // such as a Color, or a Variable // operand: function () { var entities = this.entities; var negate; if (parserInput.peek(/^-[@\$\(]/)) { negate = parserInput.$char('-'); } var o = this.sub() || entities.dimension() || entities.color() || entities.variable() || entities.property() || entities.call() || entities.quoted(true) || entities.colorKeyword() || entities.mixinLookup(); if (negate) { o.parensInOp = true; o = new (tree.Negative)(o); } return o; }, // // Expressions either represent mathematical operations, // or white-space delimited Entities. // // 1px solid black // @var * 2 // expression: function () { var entities = []; var e; var delim; var index = parserInput.i; do { e = this.comment(); if (e) { entities.push(e); continue; } e = this.addition() || this.entity(); if (e) { entities.push(e); // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here if (!parserInput.peek(/^\/[\/*]/)) { delim = parserInput.$char('/'); if (delim) { entities.push(new (tree.Anonymous)(delim, index)); } } } } while (e); if (entities.length > 0) { return new (tree.Expression)(entities); } }, property: function () { var name = parserInput.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/); if (name) { return name[1]; } }, ruleProperty: function () { var name = []; var index = []; var s; var k; parserInput.save(); var simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\s*:/); if (simpleProperty) { name = [new (tree.Keyword)(simpleProperty[1])]; parserInput.forget(); return name; } function match(re) { var i = parserInput.i; var chunk = parserInput.$re(re); if (chunk) { index.push(i); return name.push(chunk[1]); } } match(/^(\*?)/); while (true) { if (!match(/^((?:[\w-]+)|(?:[@\$]\{[\w-]+\}))/)) { break; } } if ((name.length > 1) && match(/^((?:\+_|\+)?)\s*:/)) { parserInput.forget(); // at last, we have the complete match now. move forward, // convert name particles to tree objects and return: if (name[0] === '') { name.shift(); index.shift(); } for (k = 0; k < name.length; k++) { s = name[k]; name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ? new (tree.Keyword)(s) : (s.charAt(0) === '@' ? new (tree.Variable)("@" + s.slice(2, -1), index[k], fileInfo) : new (tree.Property)("$" + s.slice(2, -1), index[k], fileInfo)); } return name; } parserInput.restore(); } } }; }; Parser.serializeVars = function (vars) { var s = ''; for (var name_1 in vars) { if (Object.hasOwnProperty.call(vars, name_1)) { var value = vars[name_1]; s += ((name_1[0] === '@') ? '' : '@') + name_1 + ": " + value + ((String(value).slice(-1) === ';') ? '' : ';'); } } return s; }; function boolean(condition) { return condition ? Keyword.True : Keyword.False; } function If(condition, trueValue, falseValue) { return condition ? trueValue : (falseValue || new Anonymous); } var boolean$1 = { boolean: boolean, 'if': If }; var colorFunctions; function clamp$1(val) { return Math.min(1, Math.max(0, val)); } function hsla(origColor, hsl) { var color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a); if (color) { if (origColor.value && /^(rgb|hsl)/.test(origColor.value)) { color.value = origColor.value; } else { color.value = 'rgb'; } return color; } } function toHSL(color) { if (color.toHSL) { return color.toHSL(); } else { throw new Error('Argument cannot be evaluated to a color'); } } function toHSV(color) { if (color.toHSV) { return color.toHSV(); } else { throw new Error('Argument cannot be evaluated to a color'); } } function number(n) { if (n instanceof Dimension) { return parseFloat(n.unit.is('%') ? n.value / 100 : n.value); } else if (typeof n === 'number') { return n; } else { throw { type: 'Argument', message: 'color functions take numbers as parameters' }; } } function scaled(n, size) { if (n instanceof Dimension && n.unit.is('%')) { return parseFloat(n.value * size / 100); } else { return number(n); } } colorFunctions = { rgb: function (r, g, b) { var color = colorFunctions.rgba(r, g, b, 1.0); if (color) { color.value = 'rgb'; return color; } }, rgba: function (r, g, b, a) { try { if (r instanceof Color) { if (g) { a = number(g); } else { a = r.alpha; } return new Color(r.rgb, a, 'rgba'); } var rgb = [r, g, b].map(function (c) { return scaled(c, 255); }); a = number(a); return new Color(rgb, a, 'rgba'); } catch (e) { } }, hsl: function (h, s, l) { var color = colorFunctions.hsla(h, s, l, 1.0); if (color) { color.value = 'hsl'; return color; } }, hsla: function (h, s, l, a) { try { if (h instanceof Color) { if (s) { a = number(s); } else { a = h.alpha; } return new Color(h.rgb, a, 'hsla'); } var m1_1; var m2_1; function hue(h) { h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); if (h * 6 < 1) { return m1_1 + (m2_1 - m1_1) * h * 6; } else if (h * 2 < 1) { return m2_1; } else if (h * 3 < 2) { return m1_1 + (m2_1 - m1_1) * (2 / 3 - h) * 6; } else { return m1_1; } } h = (number(h) % 360) / 360; s = clamp$1(number(s)); l = clamp$1(number(l)); a = clamp$1(number(a)); m2_1 = l <= 0.5 ? l * (s + 1) : l + s - l * s; m1_1 = l * 2 - m2_1; var rgb = [ hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255 ]; a = number(a); return new Color(rgb, a, 'hsla'); } catch (e) { } }, hsv: function (h, s, v) { return colorFunctions.hsva(h, s, v, 1.0); }, hsva: function (h, s, v, a) { h = ((number(h) % 360) / 360) * 360; s = number(s); v = number(v); a = number(a); var i; var f; i = Math.floor((h / 60) % 6); f = (h / 60) - i; var vs = [v, v * (1 - s), v * (1 - f * s), v * (1 - (1 - f) * s)]; var perm = [[0, 3, 1], [2, 0, 1], [1, 0, 3], [1, 2, 0], [3, 1, 0], [0, 1, 2]]; return colorFunctions.rgba(vs[perm[i][0]] * 255, vs[perm[i][1]] * 255, vs[perm[i][2]] * 255, a); }, hue: function (color) { return new Dimension(toHSL(color).h); }, saturation: function (color) { return new Dimension(toHSL(color).s * 100, '%'); }, lightness: function (color) { return new Dimension(toHSL(color).l * 100, '%'); }, hsvhue: function (color) { return new Dimension(toHSV(color).h); }, hsvsaturation: function (color) { return new Dimension(toHSV(color).s * 100, '%'); }, hsvvalue: function (color) { return new Dimension(toHSV(color).v * 100, '%'); }, red: function (color) { return new Dimension(color.rgb[0]); }, green: function (color) { return new Dimension(color.rgb[1]); }, blue: function (color) { return new Dimension(color.rgb[2]); }, alpha: function (color) { return new Dimension(toHSL(color).a); }, luma: function (color) { return new Dimension(color.luma() * color.alpha * 100, '%'); }, luminance: function (color) { var luminance = (0.2126 * color.rgb[0] / 255) + (0.7152 * color.rgb[1] / 255) + (0.0722 * color.rgb[2] / 255); return new Dimension(luminance * color.alpha * 100, '%'); }, saturate: function (color, amount, method) { // filter: saturate(3.2); // should be kept as is, so check for color if (!color.rgb) { return null; } var hsl = toHSL(color); if (typeof method !== 'undefined' && method.value === 'relative') { hsl.s += hsl.s * amount.value / 100; } else { hsl.s += amount.value / 100; } hsl.s = clamp$1(hsl.s); return hsla(color, hsl); }, desaturate: function (color, amount, method) { var hsl = toHSL(color); if (typeof method !== 'undefined' && method.value === 'relative') { hsl.s -= hsl.s * amount.value / 100; } else { hsl.s -= amount.value / 100; } hsl.s = clamp$1(hsl.s); return hsla(color, hsl); }, lighten: function (color, amount, method) { var hsl = toHSL(color); if (typeof method !== 'undefined' && method.value === 'relative') { hsl.l += hsl.l * amount.value / 100; } else { hsl.l += amount.value / 100; } hsl.l = clamp$1(hsl.l); return hsla(color, hsl); }, darken: function (color, amount, method) { var hsl = toHSL(color); if (typeof method !== 'undefined' && method.value === 'relative') { hsl.l -= hsl.l * amount.value / 100; } else { hsl.l -= amount.value / 100; } hsl.l = clamp$1(hsl.l); return hsla(color, hsl); }, fadein: function (color, amount, method) { var hsl = toHSL(color); if (typeof method !== 'undefined' && method.value === 'relative') { hsl.a += hsl.a * amount.value / 100; } else { hsl.a += amount.value / 100; } hsl.a = clamp$1(hsl.a); return hsla(color, hsl); }, fadeout: function (color, amount, method) { var hsl = toHSL(color); if (typeof method !== 'undefined' && method.value === 'relative') { hsl.a -= hsl.a * amount.value / 100; } else { hsl.a -= amount.value / 100; } hsl.a = clamp$1(hsl.a); return hsla(color, hsl); }, fade: function (color, amount) { var hsl = toHSL(color); hsl.a = amount.value / 100; hsl.a = clamp$1(hsl.a); return hsla(color, hsl); }, spin: function (color, amount) { var hsl = toHSL(color); var hue = (hsl.h + amount.value) % 360; hsl.h = hue < 0 ? 360 + hue : hue; return hsla(color, hsl); }, // // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein // http://sass-lang.com // mix: function (color1, color2, weight) { if (!weight) { weight = new Dimension(50); } var p = weight.value / 100.0; var w = p * 2 - 1; var a = toHSL(color1).a - toHSL(color2).a; var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; var w2 = 1 - w1; var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2, color1.rgb[1] * w1 + color2.rgb[1] * w2, color1.rgb[2] * w1 + color2.rgb[2] * w2]; var alpha = color1.alpha * p + color2.alpha * (1 - p); return new Color(rgb, alpha); }, greyscale: function (color) { return colorFunctions.desaturate(color, new Dimension(100)); }, contrast: function (color, dark, light, threshold) { // filter: contrast(3.2); // should be kept as is, so check for color if (!color.rgb) { return null; } if (typeof light === 'undefined') { light = colorFunctions.rgba(255, 255, 255, 1.0); } if (typeof dark === 'undefined') { dark = colorFunctions.rgba(0, 0, 0, 1.0); } // Figure out which is actually light and dark: if (dark.luma() > light.luma()) { var t = light; light = dark; dark = t; } if (typeof threshold === 'undefined') { threshold = 0.43; } else { threshold = number(threshold); } if (color.luma() < threshold) { return light; } else { return dark; } }, // Changes made in 2.7.0 - Reverted in 3.0.0 // contrast: function (color, color1, color2, threshold) { // // Return which of `color1` and `color2` has the greatest contrast with `color` // // according to the standard WCAG contrast ratio calculation. // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef // // The threshold param is no longer used, in line with SASS. // // filter: contrast(3.2); // // should be kept as is, so check for color // if (!color.rgb) { // return null; // } // if (typeof color1 === 'undefined') { // color1 = colorFunctions.rgba(0, 0, 0, 1.0); // } // if (typeof color2 === 'undefined') { // color2 = colorFunctions.rgba(255, 255, 255, 1.0); // } // var contrast1, contrast2; // var luma = color.luma(); // var luma1 = color1.luma(); // var luma2 = color2.luma(); // // Calculate contrast ratios for each color // if (luma > luma1) { // contrast1 = (luma + 0.05) / (luma1 + 0.05); // } else { // contrast1 = (luma1 + 0.05) / (luma + 0.05); // } // if (luma > luma2) { // contrast2 = (luma + 0.05) / (luma2 + 0.05); // } else { // contrast2 = (luma2 + 0.05) / (luma + 0.05); // } // if (contrast1 > contrast2) { // return color1; // } else { // return color2; // } // }, argb: function (color) { return new Anonymous(color.toARGB()); }, color: function (c) { if ((c instanceof Quoted) && (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) { var val = c.value.slice(1); return new Color(val, undefined, "#" + val); } if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) { c.value = undefined; return c; } throw { type: 'Argument', message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF' }; }, tint: function (color, amount) { return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount); }, shade: function (color, amount) { return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount); } }; var color = colorFunctions; // Color Blending // ref: http://www.w3.org/TR/compositing-1 function colorBlend(mode, color1, color2) { var ab = color1.alpha; // result var // backdrop cb; var as = color2.alpha; var // source cs; var ar; var cr; var r = []; ar = as + ab * (1 - as); for (var i_1 = 0; i_1 < 3; i_1++) { cb = color1.rgb[i_1] / 255; cs = color2.rgb[i_1] / 255; cr = mode(cb, cs); if (ar) { cr = (as * cs + ab * (cb - as * (cb + cs - cr))) / ar; } r[i_1] = cr * 255; } return new Color(r, ar); } var colorBlendModeFunctions = { multiply: function (cb, cs) { return cb * cs; }, screen: function (cb, cs) { return cb + cs - cb * cs; }, overlay: function (cb, cs) { cb *= 2; return (cb <= 1) ? colorBlendModeFunctions.multiply(cb, cs) : colorBlendModeFunctions.screen(cb - 1, cs); }, softlight: function (cb, cs) { var d = 1; var e = cb; if (cs > 0.5) { e = 1; d = (cb > 0.25) ? Math.sqrt(cb) : ((16 * cb - 12) * cb + 4) * cb; } return cb - (1 - 2 * cs) * e * (d - cb); }, hardlight: function (cb, cs) { return colorBlendModeFunctions.overlay(cs, cb); }, difference: function (cb, cs) { return Math.abs(cb - cs); }, exclusion: function (cb, cs) { return cb + cs - 2 * cb * cs; }, // non-w3c functions: average: function (cb, cs) { return (cb + cs) / 2; }, negation: function (cb, cs) { return 1 - Math.abs(cb + cs - 1); } }; for (var f in colorBlendModeFunctions) { if (colorBlendModeFunctions.hasOwnProperty(f)) { colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]); } } var dataUri = (function (environment) { var fallback = function (functionThis, node) { return new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); }; return { 'data-uri': function (mimetypeNode, filePathNode) { if (!filePathNode) { filePathNode = mimetypeNode; mimetypeNode = null; } var mimetype = mimetypeNode && mimetypeNode.value; var filePath = filePathNode.value; var currentFileInfo = this.currentFileInfo; var currentDirectory = currentFileInfo.rewriteUrls ? currentFileInfo.currentDirectory : currentFileInfo.entryPath; var fragmentStart = filePath.indexOf('#'); var fragment = ''; if (fragmentStart !== -1) { fragment = filePath.slice(fragmentStart); filePath = filePath.slice(0, fragmentStart); } var context = clone(this.context); context.rawBuffer = true; var fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true); if (!fileManager) { return fallback(this, filePathNode); } var useBase64 = false; // detect the mimetype if not given if (!mimetypeNode) { mimetype = environment.mimeLookup(filePath); if (mimetype === 'image/svg+xml') { useBase64 = false; } else { // use base 64 unless it's an ASCII or UTF-8 format var charset = environment.charsetLookup(mimetype); useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0; } if (useBase64) { mimetype += ';base64'; } } else { useBase64 = /;base64$/.test(mimetype); } var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment); if (!fileSync.contents) { logger.warn("Skipped data-uri embedding of " + filePath + " because file not found"); return fallback(this, filePathNode || mimetypeNode); } var buf = fileSync.contents; if (useBase64 && !environment.encodeBase64) { return fallback(this, filePathNode); } buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf); var uri = "data:" + mimetype + "," + buf + fragment; return new URL(new Quoted("\"" + uri + "\"", uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); } }; }); var getItemsFromNode = function (node) { // handle non-array values as an array of length 1 // return 'undefined' if index is invalid var items = Array.isArray(node.value) ? node.value : Array(node); return items; }; var list = { _SELF: function (n) { return n; }, extract: function (values, index) { // (1-based index) index = index.value - 1; return getItemsFromNode(values)[index]; }, length: function (values) { return new Dimension(getItemsFromNode(values).length); }, /** * Creates a Less list of incremental values. * Modeled after Lodash's range function, also exists natively in PHP * * @param {Dimension} [start=1] * @param {Dimension} end - e.g. 10 or 10px - unit is added to output * @param {Dimension} [step=1] */ range: function (start, end, step) { var from; var to; var stepValue = 1; var list = []; if (end) { to = end; from = start.value; if (step) { stepValue = step.value; } } else { from = 1; to = start; } for (var i_1 = from; i_1 <= to.value; i_1 += stepValue) { list.push(new Dimension(i_1, to.unit)); } return new Expression(list); }, each: function (list, rs) { var rules = []; var newRules; var iterator; if (list.value && !(list instanceof Quoted)) { if (Array.isArray(list.value)) { iterator = list.value; } else { iterator = [list.value]; } } else if (list.ruleset) { iterator = list.ruleset.rules; } else if (list.rules) { iterator = list.rules; } else if (Array.isArray(list)) { iterator = list; } else { iterator = [list]; } var valueName = '@value'; var keyName = '@key'; var indexName = '@index'; if (rs.params) { valueName = rs.params[0] && rs.params[0].name; keyName = rs.params[1] && rs.params[1].name; indexName = rs.params[2] && rs.params[2].name; rs = rs.rules; } else { rs = rs.ruleset; } for (var i_2 = 0; i_2 < iterator.length; i_2++) { var key = void 0; var value = void 0; var item = iterator[i_2]; if (item instanceof Declaration) { key = typeof item.name === 'string' ? item.name : item.name[0].value; value = item.value; } else { key = new Dimension(i_2 + 1); value = item; } if (item instanceof Comment) { continue; } newRules = rs.rules.slice(0); if (valueName) { newRules.push(new Declaration(valueName, value, false, false, this.index, this.currentFileInfo)); } if (indexName) { newRules.push(new Declaration(indexName, new Dimension(i_2 + 1), false, false, this.index, this.currentFileInfo)); } if (keyName) { newRules.push(new Declaration(keyName, key, false, false, this.index, this.currentFileInfo)); } rules.push(new Ruleset([new (Selector)([new Element("", '&')])], newRules, rs.strictImports, rs.visibilityInfo())); } return new Ruleset([new (Selector)([new Element("", '&')])], rules, rs.strictImports, rs.visibilityInfo()).eval(this.context); } }; var MathHelper = function (fn, unit, n) { if (!(n instanceof Dimension)) { throw { type: 'Argument', message: 'argument must be a number' }; } if (unit == null) { unit = n.unit; } else { n = n.unify(); } return new Dimension(fn(parseFloat(n.value)), unit); }; var mathFunctions = { // name, unit ceil: null, floor: null, sqrt: null, abs: null, tan: '', sin: '', cos: '', atan: 'rad', asin: 'rad', acos: 'rad' }; for (var f$1 in mathFunctions) { if (mathFunctions.hasOwnProperty(f$1)) { mathFunctions[f$1] = MathHelper.bind(null, Math[f$1], mathFunctions[f$1]); } } mathFunctions.round = function (n, f) { var fraction = typeof f === 'undefined' ? 0 : f.value; return MathHelper(function (num) { return num.toFixed(fraction); }, null, n); }; var minMax = function (isMin, args) { args = Array.prototype.slice.call(args); switch (args.length) { case 0: throw { type: 'Argument', message: 'one or more arguments required' }; } var i; // key is the unit.toString() for unified Dimension values, var j; var current; var currentUnified; var referenceUnified; var unit; var unitStatic; var unitClone; var // elems only contains original argument values. order = []; var values = {}; // value is the index into the order array. for (i = 0; i < args.length; i++) { current = args[i]; if (!(current instanceof Dimension)) { if (Array.isArray(args[i].value)) { Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value)); } continue; } currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify(); unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString(); unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic; unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone; j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit]; if (j === undefined) { if (unitStatic !== undefined && unit !== unitStatic) { throw { type: 'Argument', message: 'incompatible types' }; } values[unit] = order.length; order.push(current); continue; } referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify(); if (isMin && currentUnified.value < referenceUnified.value || !isMin && currentUnified.value > referenceUnified.value) { order[j] = current; } } if (order.length == 1) { return order[0]; } args = order.map(function (a) { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', '); return new Anonymous((isMin ? 'min' : 'max') + "(" + args + ")"); }; var number$1 = { min: function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return minMax(true, args); }, max: function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return minMax(false, args); }, convert: function (val, unit) { return val.convertTo(unit.value); }, pi: function () { return new Dimension(Math.PI); }, mod: function (a, b) { return new Dimension(a.value % b.value, a.unit); }, pow: function (x, y) { if (typeof x === 'number' && typeof y === 'number') { x = new Dimension(x); y = new Dimension(y); } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) { throw { type: 'Argument', message: 'arguments must be numbers' }; } return new Dimension(Math.pow(x.value, y.value), x.unit); }, percentage: function (n) { var result = MathHelper(function (num) { return num * 100; }, '%', n); return result; } }; var string = { e: function (str) { return new Quoted('"', str instanceof JavaScript ? str.evaluated : str.value, true); }, escape: function (str) { return new Anonymous(encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B') .replace(/\(/g, '%28').replace(/\)/g, '%29')); }, replace: function (string, pattern, replacement, flags) { var result = string.value; replacement = (replacement.type === 'Quoted') ? replacement.value : replacement.toCSS(); result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement); return new Quoted(string.quote || '', result, string.escaped); }, '%': function (string /* arg, arg, ... */) { var args = Array.prototype.slice.call(arguments, 1); var result = string.value; var _loop_1 = function (i_1) { /* jshint loopfunc:true */ result = result.replace(/%[sda]/i, function (token) { var value = ((args[i_1].type === 'Quoted') && token.match(/s/i)) ? args[i_1].value : args[i_1].toCSS(); return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value; }); }; for (var i_1 = 0; i_1 < args.length; i_1++) { _loop_1(i_1); } result = result.replace(/%%/g, '%'); return new Quoted(string.quote || '', result, string.escaped); } }; var svg = (function (environment) { return { 'svg-gradient': function (direction) { var stops; var gradientDirectionSvg; var gradientType = 'linear'; var rectangleDimension = 'x="0" y="0" width="1" height="1"'; var renderEnv = { compress: false }; var returner; var directionValue = direction.toCSS(renderEnv); var i; var color; var position; var positionValue; var alpha; function throwArgumentDescriptor() { throw { type: 'Argument', message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' + ' end_color [end_position] or direction, color list' }; } if (arguments.length == 2) { if (arguments[1].value.length < 2) { throwArgumentDescriptor(); } stops = arguments[1].value; } else if (arguments.length < 3) { throwArgumentDescriptor(); } else { stops = Array.prototype.slice.call(arguments, 1); } switch (directionValue) { case 'to bottom': gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"'; break; case 'to right': gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"'; break; case 'to bottom right': gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"'; break; case 'to top right': gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"'; break; case 'ellipse': case 'ellipse at center': gradientType = 'radial'; gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"'; rectangleDimension = 'x="-50" y="-50" width="101" height="101"'; break; default: throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' + ' \'to bottom right\', \'to top right\' or \'ellipse at center\'' }; } returner = "<" + gradientType + "Gradient id=\"g\" " + gradientDirectionSvg + ">"; for (i = 0; i < stops.length; i += 1) { if (stops[i] instanceof Expression) { color = stops[i].value[0]; position = stops[i].value[1]; } else { color = stops[i]; position = undefined; } if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) { throwArgumentDescriptor(); } positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%'; alpha = color.alpha; returner += ""; } returner += ""; returner = encodeURIComponent(returner); returner = "data:image/svg+xml," + returner; return new URL(new Quoted("'" + returner + "'", returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); } }; }); var isa = function (n, Type) { return (n instanceof Type) ? Keyword.True : Keyword.False; }; var isunit = function (n, unit) { if (unit === undefined) { throw { type: 'Argument', message: 'missing the required second argument to isunit.' }; } unit = typeof unit.value === 'string' ? unit.value : unit; if (typeof unit !== 'string') { throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' }; } return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False; }; var types = { isruleset: function (n) { return isa(n, DetachedRuleset); }, iscolor: function (n) { return isa(n, Color); }, isnumber: function (n) { return isa(n, Dimension); }, isstring: function (n) { return isa(n, Quoted); }, iskeyword: function (n) { return isa(n, Keyword); }, isurl: function (n) { return isa(n, URL); }, ispixel: function (n) { return isunit(n, 'px'); }, ispercentage: function (n) { return isunit(n, '%'); }, isem: function (n) { return isunit(n, 'em'); }, isunit: isunit, unit: function (val, unit) { if (!(val instanceof Dimension)) { throw { type: 'Argument', message: "the first argument to unit must be a number" + (val instanceof Operation ? '. Have you forgotten parenthesis?' : '') }; } if (unit) { if (unit instanceof Keyword) { unit = unit.value; } else { unit = unit.toCSS(); } } else { unit = ''; } return new Dimension(val.value, unit); }, 'get-unit': function (n) { return new Anonymous(n.unit); } }; var Functions = (function (environment) { var functions = { functionRegistry: functionRegistry, functionCaller: functionCaller }; // register functions functionRegistry.addMultiple(boolean$1); functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc)); functionRegistry.addMultiple(color); functionRegistry.addMultiple(colorBlend); functionRegistry.addMultiple(dataUri(environment)); functionRegistry.addMultiple(list); functionRegistry.addMultiple(mathFunctions); functionRegistry.addMultiple(number$1); functionRegistry.addMultiple(string); functionRegistry.addMultiple(svg()); functionRegistry.addMultiple(types); return functions; }); var sourceMapOutput = (function (environment) { var SourceMapOutput = /** @class */ (function () { function SourceMapOutput(options) { this._css = []; this._rootNode = options.rootNode; this._contentsMap = options.contentsMap; this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap; if (options.sourceMapFilename) { this._sourceMapFilename = options.sourceMapFilename.replace(/\\/g, '/'); } this._outputFilename = options.outputFilename; this.sourceMapURL = options.sourceMapURL; if (options.sourceMapBasepath) { this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/'); } if (options.sourceMapRootpath) { this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\/g, '/'); if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') { this._sourceMapRootpath += '/'; } } else { this._sourceMapRootpath = ''; } this._outputSourceFiles = options.outputSourceFiles; this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator(); this._lineNumber = 0; this._column = 0; } SourceMapOutput.prototype.removeBasepath = function (path) { if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) { path = path.substring(this._sourceMapBasepath.length); if (path.charAt(0) === '\\' || path.charAt(0) === '/') { path = path.substring(1); } } return path; }; SourceMapOutput.prototype.normalizeFilename = function (filename) { filename = filename.replace(/\\/g, '/'); filename = this.removeBasepath(filename); return (this._sourceMapRootpath || '') + filename; }; SourceMapOutput.prototype.add = function (chunk, fileInfo, index, mapLines) { // ignore adding empty strings if (!chunk) { return; } var lines; var sourceLines; var columns; var sourceColumns; var i; if (fileInfo && fileInfo.filename) { var inputSource = this._contentsMap[fileInfo.filename]; // remove vars/banner added to the top of the file if (this._contentsIgnoredCharsMap[fileInfo.filename]) { // adjust the index index -= this._contentsIgnoredCharsMap[fileInfo.filename]; if (index < 0) { index = 0; } // adjust the source inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]); } // ignore empty content if (inputSource === undefined) { return; } inputSource = inputSource.substring(0, index); sourceLines = inputSource.split('\n'); sourceColumns = sourceLines[sourceLines.length - 1]; } lines = chunk.split('\n'); columns = lines[lines.length - 1]; if (fileInfo && fileInfo.filename) { if (!mapLines) { this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column }, original: { line: sourceLines.length, column: sourceColumns.length }, source: this.normalizeFilename(fileInfo.filename) }); } else { for (i = 0; i < lines.length; i++) { this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0 }, original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0 }, source: this.normalizeFilename(fileInfo.filename) }); } } } if (lines.length === 1) { this._column += columns.length; } else { this._lineNumber += lines.length - 1; this._column = columns.length; } this._css.push(chunk); }; SourceMapOutput.prototype.isEmpty = function () { return this._css.length === 0; }; SourceMapOutput.prototype.toCSS = function (context) { this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null }); if (this._outputSourceFiles) { for (var filename in this._contentsMap) { if (this._contentsMap.hasOwnProperty(filename)) { var source = this._contentsMap[filename]; if (this._contentsIgnoredCharsMap[filename]) { source = source.slice(this._contentsIgnoredCharsMap[filename]); } this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source); } } } this._rootNode.genCSS(context, this); if (this._css.length > 0) { var sourceMapURL = void 0; var sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON()); if (this.sourceMapURL) { sourceMapURL = this.sourceMapURL; } else if (this._sourceMapFilename) { sourceMapURL = this._sourceMapFilename; } this.sourceMapURL = sourceMapURL; this.sourceMap = sourceMapContent; } return this._css.join(''); }; return SourceMapOutput; }()); return SourceMapOutput; }); var sourceMapBuilder = (function (SourceMapOutput, environment) { var SourceMapBuilder = /** @class */ (function () { function SourceMapBuilder(options) { this.options = options; } SourceMapBuilder.prototype.toCSS = function (rootNode, options, imports) { var sourceMapOutput = new SourceMapOutput({ contentsIgnoredCharsMap: imports.contentsIgnoredChars, rootNode: rootNode, contentsMap: imports.contents, sourceMapFilename: this.options.sourceMapFilename, sourceMapURL: this.options.sourceMapURL, outputFilename: this.options.sourceMapOutputFilename, sourceMapBasepath: this.options.sourceMapBasepath, sourceMapRootpath: this.options.sourceMapRootpath, outputSourceFiles: this.options.outputSourceFiles, sourceMapGenerator: this.options.sourceMapGenerator, sourceMapFileInline: this.options.sourceMapFileInline }); var css = sourceMapOutput.toCSS(options); this.sourceMap = sourceMapOutput.sourceMap; this.sourceMapURL = sourceMapOutput.sourceMapURL; if (this.options.sourceMapInputFilename) { this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename); } if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) { this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL); } return css + this.getCSSAppendage(); }; SourceMapBuilder.prototype.getCSSAppendage = function () { var sourceMapURL = this.sourceMapURL; if (this.options.sourceMapFileInline) { if (this.sourceMap === undefined) { return ''; } sourceMapURL = "data:application/json;base64," + environment.encodeBase64(this.sourceMap); } if (sourceMapURL) { return "/*# sourceMappingURL=" + sourceMapURL + " */"; } return ''; }; SourceMapBuilder.prototype.getExternalSourceMap = function () { return this.sourceMap; }; SourceMapBuilder.prototype.setExternalSourceMap = function (sourceMap) { this.sourceMap = sourceMap; }; SourceMapBuilder.prototype.isInline = function () { return this.options.sourceMapFileInline; }; SourceMapBuilder.prototype.getSourceMapURL = function () { return this.sourceMapURL; }; SourceMapBuilder.prototype.getOutputFilename = function () { return this.options.sourceMapOutputFilename; }; SourceMapBuilder.prototype.getInputFilename = function () { return this.sourceMapInputFilename; }; return SourceMapBuilder; }()); return SourceMapBuilder; }); var transformTree = (function (root, options) { if (options === void 0) { options = {}; } var evaldRoot; var variables = options.variables; var evalEnv = new contexts.Eval(options); // // Allows setting variables with a hash, so: // // `{ color: new tree.Color('#f01') }` will become: // // new tree.Declaration('@color', // new tree.Value([ // new tree.Expression([ // new tree.Color('#f01') // ]) // ]) // ) // if (typeof variables === 'object' && !Array.isArray(variables)) { variables = Object.keys(variables).map(function (k) { var value = variables[k]; if (!(value instanceof tree.Value)) { if (!(value instanceof tree.Expression)) { value = new tree.Expression([value]); } value = new tree.Value([value]); } return new tree.Declaration("@" + k, value, false, null, 0); }); evalEnv.frames = [new tree.Ruleset(null, variables)]; } var visitors$1 = [ new visitors.JoinSelectorVisitor(), new visitors.MarkVisibleSelectorsVisitor(true), new visitors.ExtendVisitor(), new visitors.ToCSSVisitor({ compress: Boolean(options.compress) }) ]; var preEvalVisitors = []; var v; var visitorIterator; /** * first() / get() allows visitors to be added while visiting * * @todo Add scoping for visitors just like functions for @plugin; right now they're global */ if (options.pluginManager) { visitorIterator = options.pluginManager.visitor(); for (var i = 0; i < 2; i++) { visitorIterator.first(); while ((v = visitorIterator.get())) { if (v.isPreEvalVisitor) { if (i === 0 || preEvalVisitors.indexOf(v) === -1) { preEvalVisitors.push(v); v.run(root); } } else { if (i === 0 || visitors$1.indexOf(v) === -1) { if (v.isPreVisitor) { visitors$1.unshift(v); } else { visitors$1.push(v); } } } } } } evaldRoot = root.eval(evalEnv); for (var i = 0; i < visitors$1.length; i++) { visitors$1[i].run(evaldRoot); } // Run any remaining visitors added after eval pass if (options.pluginManager) { visitorIterator.first(); while ((v = visitorIterator.get())) { if (visitors$1.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) { v.run(evaldRoot); } } } return evaldRoot; }); var parseTree = (function (SourceMapBuilder) { var ParseTree = /** @class */ (function () { function ParseTree(root, imports) { this.root = root; this.imports = imports; } ParseTree.prototype.toCSS = function (options) { var evaldRoot; var result = {}; var sourceMapBuilder; try { evaldRoot = transformTree(this.root, options); } catch (e) { throw new LessError(e, this.imports); } try { var compress = Boolean(options.compress); if (compress) { logger.warn('The compress option has been deprecated. ' + 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.'); } var toCSSOptions = { compress: compress, dumpLineNumbers: options.dumpLineNumbers, strictUnits: Boolean(options.strictUnits), numPrecision: 8 }; if (options.sourceMap) { sourceMapBuilder = new SourceMapBuilder(options.sourceMap); result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports); } else { result.css = evaldRoot.toCSS(toCSSOptions); } } catch (e) { throw new LessError(e, this.imports); } if (options.pluginManager) { var postProcessors = options.pluginManager.getPostProcessors(); for (var i_1 = 0; i_1 < postProcessors.length; i_1++) { result.css = postProcessors[i_1].process(result.css, { sourceMap: sourceMapBuilder, options: options, imports: this.imports }); } } if (options.sourceMap) { result.map = sourceMapBuilder.getExternalSourceMap(); } result.imports = []; for (var file_1 in this.imports.files) { if (this.imports.files.hasOwnProperty(file_1) && file_1 !== this.imports.rootFilename) { result.imports.push(file_1); } } return result; }; return ParseTree; }()); return ParseTree; }); var importManager = (function (environment) { // FileInfo = { // 'rewriteUrls' - option - whether to adjust URL's to be relative // 'filename' - full resolved filename of current file // 'rootpath' - path to append to normal URLs for this node // 'currentDirectory' - path to the current file, absolute // 'rootFilename' - filename of the base file // 'entryPath' - absolute path to the entry file // 'reference' - whether the file should not be output and only output parts that are referenced var ImportManager = /** @class */ (function () { function ImportManager(less, context, rootFileInfo) { this.less = less; this.rootFilename = rootFileInfo.filename; this.paths = context.paths || []; // Search paths, when importing this.contents = {}; // map - filename to contents of all the files this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore this.mime = context.mime; this.error = null; this.context = context; // Deprecated? Unused outside of here, could be useful. this.queue = []; // Files which haven't been imported yet this.files = {}; // Holds the imported parse trees. } /** * Add an import to be imported * @param path - the raw path * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension) * @param currentFileInfo - the current file info (used for instance to work out relative paths) * @param importOptions - import options * @param callback - callback for when it is imported */ ImportManager.prototype.push = function (path, tryAppendExtension, currentFileInfo, importOptions, callback) { var importManager = this; var pluginLoader = this.context.pluginManager.Loader; this.queue.push(path); var fileParsedFunc = function (e, root, fullPath) { importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue var importedEqualsRoot = fullPath === importManager.rootFilename; if (importOptions.optional && e) { callback(null, { rules: [] }, false, null); logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional."); } else { // Inline imports aren't cached here. // If we start to cache them, please make sure they won't conflict with non-inline imports of the // same name as they used to do before this comment and the condition below have been added. if (!importManager.files[fullPath] && !importOptions.inline) { importManager.files[fullPath] = { root: root, options: importOptions }; } if (e && !importManager.error) { importManager.error = e; } callback(e, root, importedEqualsRoot, fullPath); } }; var newFileInfo = { rewriteUrls: this.context.rewriteUrls, entryPath: currentFileInfo.entryPath, rootpath: currentFileInfo.rootpath, rootFilename: currentFileInfo.rootFilename }; var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment); if (!fileManager) { fileParsedFunc({ message: "Could not find a file-manager for " + path }); return; } var loadFileCallback = function (loadedFile) { var plugin; var resolvedFilename = loadedFile.filename; var contents = loadedFile.contents.replace(/^\uFEFF/, ''); // Pass on an updated rootpath if path of imported file is relative and file // is in a (sub|sup) directory // // Examples: // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/', // then rootpath should become 'less/module/nav/' // - If path of imported file is '../mixins.less' and rootpath is 'less/', // then rootpath should become 'less/../' newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename); if (newFileInfo.rewriteUrls) { newFileInfo.rootpath = fileManager.join((importManager.context.rootpath || ''), fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath)); if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) { newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath); } } newFileInfo.filename = resolvedFilename; var newEnv = new contexts.Parse(importManager.context); newEnv.processImports = false; importManager.contents[resolvedFilename] = contents; if (currentFileInfo.reference || importOptions.reference) { newFileInfo.reference = true; } if (importOptions.isPlugin) { plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo); if (plugin instanceof LessError) { fileParsedFunc(plugin, null, resolvedFilename); } else { fileParsedFunc(null, plugin, resolvedFilename); } } else if (importOptions.inline) { fileParsedFunc(null, contents, resolvedFilename); } else { // import (multiple) parse trees apparently get altered and can't be cached. // TODO: investigate why this is if (importManager.files[resolvedFilename] && !importManager.files[resolvedFilename].options.multiple && !importOptions.multiple) { fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename); } else { new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) { fileParsedFunc(e, root, resolvedFilename); }); } } }; var promise; var context = clone(this.context); if (tryAppendExtension) { context.ext = importOptions.isPlugin ? '.js' : '.less'; } if (importOptions.isPlugin) { context.mime = 'application/javascript'; promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager); } else { promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment, function (err, loadedFile) { if (err) { fileParsedFunc(err); } else { loadFileCallback(loadedFile); } }); } if (promise) { promise.then(loadFileCallback, fileParsedFunc); } }; return ImportManager; }()); return ImportManager; }); var Render = (function (environment, ParseTree, ImportManager) { var render = function (input, options, callback) { if (typeof options === 'function') { callback = options; options = copyOptions(this.options, {}); } else { options = copyOptions(this.options, options || {}); } if (!callback) { var self_1 = this; return new Promise(function (resolve, reject) { render.call(self_1, input, options, function (err, output) { if (err) { reject(err); } else { resolve(output); } }); }); } else { this.parse(input, options, function (err, root, imports, options) { if (err) { return callback(err); } var result; try { var parseTree = new ParseTree(root, imports); result = parseTree.toCSS(options); } catch (err) { return callback(err); } callback(null, result); }); } }; return render; }); /** * Plugin Manager */ var PluginManager = /** @class */ (function () { function PluginManager(less) { this.less = less; this.visitors = []; this.preProcessors = []; this.postProcessors = []; this.installedPlugins = []; this.fileManagers = []; this.iterator = -1; this.pluginCache = {}; this.Loader = new less.PluginLoader(less); } /** * Adds all the plugins in the array * @param {Array} plugins */ PluginManager.prototype.addPlugins = function (plugins) { if (plugins) { for (var i_1 = 0; i_1 < plugins.length; i_1++) { this.addPlugin(plugins[i_1]); } } }; /** * * @param plugin * @param {String} filename */ PluginManager.prototype.addPlugin = function (plugin, filename, functionRegistry) { this.installedPlugins.push(plugin); if (filename) { this.pluginCache[filename] = plugin; } if (plugin.install) { plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry); } }; /** * * @param filename */ PluginManager.prototype.get = function (filename) { return this.pluginCache[filename]; }; /** * Adds a visitor. The visitor object has options on itself to determine * when it should run. * @param visitor */ PluginManager.prototype.addVisitor = function (visitor) { this.visitors.push(visitor); }; /** * Adds a pre processor object * @param {object} preProcessor * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import */ PluginManager.prototype.addPreProcessor = function (preProcessor, priority) { var indexToInsertAt; for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) { if (this.preProcessors[indexToInsertAt].priority >= priority) { break; } } this.preProcessors.splice(indexToInsertAt, 0, { preProcessor: preProcessor, priority: priority }); }; /** * Adds a post processor object * @param {object} postProcessor * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression */ PluginManager.prototype.addPostProcessor = function (postProcessor, priority) { var indexToInsertAt; for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) { if (this.postProcessors[indexToInsertAt].priority >= priority) { break; } } this.postProcessors.splice(indexToInsertAt, 0, { postProcessor: postProcessor, priority: priority }); }; /** * * @param manager */ PluginManager.prototype.addFileManager = function (manager) { this.fileManagers.push(manager); }; /** * * @returns {Array} * @private */ PluginManager.prototype.getPreProcessors = function () { var preProcessors = []; for (var i_2 = 0; i_2 < this.preProcessors.length; i_2++) { preProcessors.push(this.preProcessors[i_2].preProcessor); } return preProcessors; }; /** * * @returns {Array} * @private */ PluginManager.prototype.getPostProcessors = function () { var postProcessors = []; for (var i_3 = 0; i_3 < this.postProcessors.length; i_3++) { postProcessors.push(this.postProcessors[i_3].postProcessor); } return postProcessors; }; /** * * @returns {Array} * @private */ PluginManager.prototype.getVisitors = function () { return this.visitors; }; PluginManager.prototype.visitor = function () { var self = this; return { first: function () { self.iterator = -1; return self.visitors[self.iterator]; }, get: function () { self.iterator += 1; return self.visitors[self.iterator]; } }; }; /** * * @returns {Array} * @private */ PluginManager.prototype.getFileManagers = function () { return this.fileManagers; }; return PluginManager; }()); var pm; function PluginManagerFactory(less, newFactory) { if (newFactory || !pm) { pm = new PluginManager(less); } return pm; } var Parse = (function (environment, ParseTree, ImportManager) { var parse = function (input, options, callback) { if (typeof options === 'function') { callback = options; options = copyOptions(this.options, {}); } else { options = copyOptions(this.options, options || {}); } if (!callback) { var self_1 = this; return new Promise(function (resolve, reject) { parse.call(self_1, input, options, function (err, output) { if (err) { reject(err); } else { resolve(output); } }); }); } else { var context_1; var rootFileInfo = void 0; var pluginManager_1 = new PluginManagerFactory(this, !options.reUsePluginManager); options.pluginManager = pluginManager_1; context_1 = new contexts.Parse(options); if (options.rootFileInfo) { rootFileInfo = options.rootFileInfo; } else { var filename = options.filename || 'input'; var entryPath = filename.replace(/[^\/\\]*$/, ''); rootFileInfo = { filename: filename, rewriteUrls: context_1.rewriteUrls, rootpath: context_1.rootpath || '', currentDirectory: entryPath, entryPath: entryPath, rootFilename: filename }; // add in a missing trailing slash if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') { rootFileInfo.rootpath += '/'; } } var imports_1 = new ImportManager(this, context_1, rootFileInfo); this.importManager = imports_1; // TODO: allow the plugins to be just a list of paths or names // Do an async plugin queue like lessc if (options.plugins) { options.plugins.forEach(function (plugin) { var evalResult; var contents; if (plugin.fileContent) { contents = plugin.fileContent.replace(/^\uFEFF/, ''); evalResult = pluginManager_1.Loader.evalPlugin(contents, context_1, imports_1, plugin.options, plugin.filename); if (evalResult instanceof LessError) { return callback(evalResult); } } else { pluginManager_1.addPlugin(plugin); } }); } new Parser(context_1, imports_1, rootFileInfo) .parse(input, function (e, root) { if (e) { return callback(e); } callback(null, root, imports_1, options); }, options); } }; return parse; }); var lessRoot = (function (environment$1, fileManagers) { /** * @todo * This original code could be improved quite a bit. * Many classes / modules currently add side-effects / mutations to passed in objects, * which makes it hard to refactor and reason about. */ environment$1 = new environment(environment$1, fileManagers); var SourceMapOutput = sourceMapOutput(environment$1); var SourceMapBuilder = sourceMapBuilder(SourceMapOutput, environment$1); var ParseTree = parseTree(SourceMapBuilder); var ImportManager = importManager(environment$1); var render = Render(environment$1, ParseTree); var parse = Parse(environment$1, ParseTree, ImportManager); var functions = Functions(environment$1); /** * @todo * This root properties / methods need to be organized. * It's not clear what should / must be public and why. */ var initial = { version: [3, 11, 1], data: data, tree: tree, Environment: environment, AbstractFileManager: AbstractFileManager, AbstractPluginLoader: AbstractPluginLoader, environment: environment$1, visitors: visitors, Parser: Parser, functions: functions, contexts: contexts, SourceMapOutput: SourceMapOutput, SourceMapBuilder: SourceMapBuilder, ParseTree: ParseTree, ImportManager: ImportManager, render: render, parse: parse, LessError: LessError, transformTree: transformTree, utils: utils, PluginManager: PluginManagerFactory, logger: logger }; // Create a public API var ctor = function (t) { return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return new (t.bind.apply(t, __spreadArrays([void 0], args)))(); }; }; var t; var api = Object.create(initial); for (var n in initial.tree) { /* eslint guard-for-in: 0 */ t = initial.tree[n]; if (typeof t === 'function') { api[n.toLowerCase()] = ctor(t); } else { api[n] = Object.create(null); for (var o in t) { /* eslint guard-for-in: 0 */ api[n][o.toLowerCase()] = ctor(t[o]); } } } return api; }); /* global window, XMLHttpRequest */ var options; var logger$1; var fileCache = {}; // TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load var FileManager = /** @class */ (function (_super) { __extends(FileManager, _super); function FileManager() { return _super !== null && _super.apply(this, arguments) || this; } FileManager.prototype.alwaysMakePathsAbsolute = function () { return true; }; FileManager.prototype.join = function (basePath, laterPath) { if (!basePath) { return laterPath; } return this.extractUrlParts(laterPath, basePath).path; }; FileManager.prototype.doXHR = function (url, type, callback, errback) { var xhr = new XMLHttpRequest(); var async = options.isFileProtocol ? options.fileAsync : true; if (typeof xhr.overrideMimeType === 'function') { xhr.overrideMimeType('text/css'); } logger$1.debug("XHR: Getting '" + url + "'"); xhr.open('GET', url, async); xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5'); xhr.send(null); function handleResponse(xhr, callback, errback) { if (xhr.status >= 200 && xhr.status < 300) { callback(xhr.responseText, xhr.getResponseHeader('Last-Modified')); } else if (typeof errback === 'function') { errback(xhr.status, url); } } if (options.isFileProtocol && !options.fileAsync) { if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) { callback(xhr.responseText); } else { errback(xhr.status, url); } } else if (async) { xhr.onreadystatechange = function () { if (xhr.readyState == 4) { handleResponse(xhr, callback, errback); } }; } else { handleResponse(xhr, callback, errback); } }; FileManager.prototype.supports = function () { return true; }; FileManager.prototype.clearFileCache = function () { fileCache = {}; }; FileManager.prototype.loadFile = function (filename, currentDirectory, options, environment) { // TODO: Add prefix support like less-node? // What about multiple paths? if (currentDirectory && !this.isPathAbsolute(filename)) { filename = currentDirectory + filename; } filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename; options = options || {}; // sheet may be set to the stylesheet for the initial load or a collection of properties including // some context variables for imports var hrefParts = this.extractUrlParts(filename, window.location.href); var href = hrefParts.url; var self = this; return new Promise(function (resolve, reject) { if (options.useFileCache && fileCache[href]) { try { var lessText_1 = fileCache[href]; return resolve({ contents: lessText_1, filename: href, webInfo: { lastModified: new Date() } }); } catch (e) { return reject({ filename: href, message: "Error loading file " + href + " error was " + e.message }); } } self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) { // per file cache fileCache[href] = data; // Use remote copy (re-parse) resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified } }); }, function doXHRError(status, url) { reject({ type: 'File', message: "'" + url + "' wasn't found (" + status + ")", href: href }); }); }); }; return FileManager; }(AbstractFileManager)); var FM = (function (opts, log) { options = opts; logger$1 = log; return FileManager; }); // TODO: Add tests for browser @plugin /** * Browser Plugin Loader */ var PluginLoader = /** @class */ (function (_super) { __extends(PluginLoader, _super); function PluginLoader(less) { var _this = _super.call(this) || this; _this.less = less; return _this; // Should we shim this.require for browser? Probably not? } PluginLoader.prototype.loadPlugin = function (filename, basePath, context, environment, fileManager) { return new Promise(function (fulfill, reject) { fileManager.loadFile(filename, basePath, context, environment) .then(fulfill).catch(reject); }); }; return PluginLoader; }(AbstractPluginLoader)); var LogListener = (function (less, options) { var logLevel_debug = 4; var logLevel_info = 3; var logLevel_warn = 2; var logLevel_error = 1; // The amount of logging in the javascript console. // 3 - Debug, information and errors // 2 - Information and errors // 1 - Errors // 0 - None // Defaults to 2 options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error); if (!options.loggers) { options.loggers = [{ debug: function (msg) { if (options.logLevel >= logLevel_debug) { console.log(msg); } }, info: function (msg) { if (options.logLevel >= logLevel_info) { console.log(msg); } }, warn: function (msg) { if (options.logLevel >= logLevel_warn) { console.warn(msg); } }, error: function (msg) { if (options.logLevel >= logLevel_error) { console.error(msg); } } }]; } for (var i_1 = 0; i_1 < options.loggers.length; i_1++) { less.logger.addListener(options.loggers[i_1]); } }); var ErrorReporting = (function (window, less, options) { function errorHTML(e, rootHref) { var id = "less-error-message:" + extractId(rootHref || ''); var template = '
  • {content}
  • '; var elem = window.document.createElement('div'); var timer; var content; var errors = []; var filename = e.filename || rootHref; var filenameNoPath = filename.match(/([^\/]+(\?.*)?)$/)[1]; elem.id = id; elem.className = 'less-error-message'; content = "

    " + (e.type || 'Syntax') + "Error: " + (e.message || 'There is an error in your .less file') + ("

    in " + filenameNoPath + " "); var errorline = function (e, i, classname) { if (e.extract[i] !== undefined) { errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1)) .replace(/\{class\}/, classname) .replace(/\{content\}/, e.extract[i])); } }; if (e.line) { errorline(e, 0, ''); errorline(e, 1, 'line'); errorline(e, 2, ''); content += "on line " + e.line + ", column " + (e.column + 1) + ":

      " + errors.join('') + "
    "; } if (e.stack && (e.extract || options.logLevel >= 4)) { content += "
    Stack Trace
    " + e.stack.split('\n').slice(1).join('
    '); } elem.innerHTML = content; // CSS for error messages browser.createCSS(window.document, [ '.less-error-message ul, .less-error-message li {', 'list-style-type: none;', 'margin-right: 15px;', 'padding: 4px 0;', 'margin: 0;', '}', '.less-error-message label {', 'font-size: 12px;', 'margin-right: 15px;', 'padding: 4px 0;', 'color: #cc7777;', '}', '.less-error-message pre {', 'color: #dd6666;', 'padding: 4px 0;', 'margin: 0;', 'display: inline-block;', '}', '.less-error-message pre.line {', 'color: #ff0000;', '}', '.less-error-message h3 {', 'font-size: 20px;', 'font-weight: bold;', 'padding: 15px 0 5px 0;', 'margin: 0;', '}', '.less-error-message a {', 'color: #10a', '}', '.less-error-message .error {', 'color: red;', 'font-weight: bold;', 'padding-bottom: 2px;', 'border-bottom: 1px dashed red;', '}' ].join('\n'), { title: 'error-message' }); elem.style.cssText = [ 'font-family: Arial, sans-serif', 'border: 1px solid #e00', 'background-color: #eee', 'border-radius: 5px', '-webkit-border-radius: 5px', '-moz-border-radius: 5px', 'color: #e00', 'padding: 15px', 'margin-bottom: 15px' ].join(';'); if (options.env === 'development') { timer = setInterval(function () { var document = window.document; var body = document.body; if (body) { if (document.getElementById(id)) { body.replaceChild(elem, document.getElementById(id)); } else { body.insertBefore(elem, body.firstChild); } clearInterval(timer); } }, 10); } } function removeErrorHTML(path) { var node = window.document.getElementById("less-error-message:" + extractId(path)); if (node) { node.parentNode.removeChild(node); } } function removeError(path) { if (!options.errorReporting || options.errorReporting === 'html') { removeErrorHTML(path); } else if (options.errorReporting === 'console') ; else if (typeof options.errorReporting === 'function') { options.errorReporting('remove', path); } } function errorConsole(e, rootHref) { var template = '{line} {content}'; var filename = e.filename || rootHref; var errors = []; var content = (e.type || 'Syntax') + "Error: " + (e.message || 'There is an error in your .less file') + " in " + filename; var errorline = function (e, i, classname) { if (e.extract[i] !== undefined) { errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1)) .replace(/\{class\}/, classname) .replace(/\{content\}/, e.extract[i])); } }; if (e.line) { errorline(e, 0, ''); errorline(e, 1, 'line'); errorline(e, 2, ''); content += " on line " + e.line + ", column " + (e.column + 1) + ":\n" + errors.join('\n'); } if (e.stack && (e.extract || options.logLevel >= 4)) { content += "\nStack Trace\n" + e.stack; } less.logger.error(content); } function error(e, rootHref) { if (!options.errorReporting || options.errorReporting === 'html') { errorHTML(e, rootHref); } else if (options.errorReporting === 'console') { errorConsole(e, rootHref); } else if (typeof options.errorReporting === 'function') { options.errorReporting('add', e, rootHref); } } return { add: error, remove: removeError }; }); // Cache system is a bit outdated and could do with work var Cache = (function (window, options, logger) { var cache = null; if (options.env !== 'development') { try { cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage; } catch (_) { } } return { setCSS: function (path, lastModified, modifyVars, styles) { if (cache) { logger.info("saving " + path + " to cache."); try { cache.setItem(path, styles); cache.setItem(path + ":timestamp", lastModified); if (modifyVars) { cache.setItem(path + ":vars", JSON.stringify(modifyVars)); } } catch (e) { // TODO - could do with adding more robust error handling logger.error("failed to save \"" + path + "\" to local storage for caching."); } } }, getCSS: function (path, webInfo, modifyVars) { var css = cache && cache.getItem(path); var timestamp = cache && cache.getItem(path + ":timestamp"); var vars = cache && cache.getItem(path + ":vars"); modifyVars = modifyVars || {}; vars = vars || "{}"; // if not set, treat as the JSON representation of an empty object if (timestamp && webInfo.lastModified && (new Date(webInfo.lastModified).valueOf() === new Date(timestamp).valueOf()) && JSON.stringify(modifyVars) === vars) { // Use local copy return css; } } }; }); var ImageSize = (function () { function imageSize() { throw { type: 'Runtime', message: 'Image size functions are not supported in browser version of less' }; } var imageFunctions = { 'image-size': function (filePathNode) { imageSize(); return -1; }, 'image-width': function (filePathNode) { imageSize(); return -1; }, 'image-height': function (filePathNode) { imageSize(); return -1; } }; functionRegistry.addMultiple(imageFunctions); }); // var root = (function (window, options) { var document = window.document; var less = lessRoot(); less.options = options; var environment = less.environment; var FileManager = FM(options, less.logger); var fileManager = new FileManager(); environment.addFileManager(fileManager); less.FileManager = FileManager; less.PluginLoader = PluginLoader; LogListener(less, options); var errors = ErrorReporting(window, less, options); var cache = less.cache = options.cache || Cache(window, options, less.logger); ImageSize(less.environment); // Setup user functions - Deprecate? if (options.functions) { less.functions.functionRegistry.addMultiple(options.functions); } var typePattern = /^text\/(x-)?less$/; function clone(obj) { var cloned = {}; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { cloned[prop] = obj[prop]; } } return cloned; } // only really needed for phantom function bind(func, thisArg) { var curryArgs = Array.prototype.slice.call(arguments, 2); return function () { var args = curryArgs.concat(Array.prototype.slice.call(arguments, 0)); return func.apply(thisArg, args); }; } function loadStyles(modifyVars) { var styles = document.getElementsByTagName('style'); var style; for (var i_1 = 0; i_1 < styles.length; i_1++) { style = styles[i_1]; if (style.type.match(typePattern)) { var instanceOptions = clone(options); instanceOptions.modifyVars = modifyVars; var lessText_1 = style.innerHTML || ''; instanceOptions.filename = document.location.href.replace(/#.*$/, ''); /* jshint loopfunc:true */ // use closure to store current style less.render(lessText_1, instanceOptions, bind(function (style, e, result) { if (e) { errors.add(e, 'inline'); } else { style.type = 'text/css'; if (style.styleSheet) { style.styleSheet.cssText = result.css; } else { style.innerHTML = result.css; } } }, null, style)); } } } function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { var instanceOptions = clone(options); addDataAttr(instanceOptions, sheet); instanceOptions.mime = sheet.type; if (modifyVars) { instanceOptions.modifyVars = modifyVars; } function loadInitialFileCallback(loadedFile) { var data = loadedFile.contents; var path = loadedFile.filename; var webInfo = loadedFile.webInfo; var newFileInfo = { currentDirectory: fileManager.getPath(path), filename: path, rootFilename: path, rewriteUrls: instanceOptions.rewriteUrls }; newFileInfo.entryPath = newFileInfo.currentDirectory; newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory; if (webInfo) { webInfo.remaining = remaining; var css = cache.getCSS(path, webInfo, instanceOptions.modifyVars); if (!reload && css) { webInfo.local = true; callback(null, css, data, sheet, webInfo, path); return; } } // TODO add tests around how this behaves when reloading errors.remove(path); instanceOptions.rootFileInfo = newFileInfo; less.render(data, instanceOptions, function (e, result) { if (e) { e.href = path; callback(e); } else { cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css); callback(null, result.css, data, sheet, webInfo, path); } }); } fileManager.loadFile(sheet.href, null, instanceOptions, environment) .then(function (loadedFile) { loadInitialFileCallback(loadedFile); }).catch(function (err) { console.log(err); callback(err); }); } function loadStyleSheets(callback, reload, modifyVars) { for (var i_2 = 0; i_2 < less.sheets.length; i_2++) { loadStyleSheet(less.sheets[i_2], callback, reload, less.sheets.length - (i_2 + 1), modifyVars); } } function initRunningMode() { if (less.env === 'development') { less.watchTimer = setInterval(function () { if (less.watchMode) { fileManager.clearFileCache(); loadStyleSheets(function (e, css, _, sheet, webInfo) { if (e) { errors.add(e, e.href || sheet.href); } else if (css) { browser.createCSS(window.document, css, sheet); } }); } }, options.poll); } } // // Watch mode // less.watch = function () { if (!less.watchMode) { less.env = 'development'; initRunningMode(); } this.watchMode = true; return true; }; less.unwatch = function () { clearInterval(less.watchTimer); this.watchMode = false; return false; }; // // Synchronously get all tags with the 'rel' attribute set to // "stylesheet/less". // less.registerStylesheetsImmediately = function () { var links = document.getElementsByTagName('link'); less.sheets = []; for (var i_3 = 0; i_3 < links.length; i_3++) { if (links[i_3].rel === 'stylesheet/less' || (links[i_3].rel.match(/stylesheet/) && (links[i_3].type.match(typePattern)))) { less.sheets.push(links[i_3]); } } }; // // Asynchronously get all tags with the 'rel' attribute set to // "stylesheet/less", returning a Promise. // less.registerStylesheets = function () { return new Promise(function (resolve, reject) { less.registerStylesheetsImmediately(); resolve(); }); }; // // With this function, it's possible to alter variables and re-render // CSS without reloading less-files // less.modifyVars = function (record) { return less.refresh(true, record, false); }; less.refresh = function (reload, modifyVars, clearFileCache) { if ((reload || clearFileCache) && clearFileCache !== false) { fileManager.clearFileCache(); } return new Promise(function (resolve, reject) { var startTime; var endTime; var totalMilliseconds; var remainingSheets; startTime = endTime = new Date(); // Set counter for remaining unprocessed sheets remainingSheets = less.sheets.length; if (remainingSheets === 0) { endTime = new Date(); totalMilliseconds = endTime - startTime; less.logger.info('Less has finished and no sheets were loaded.'); resolve({ startTime: startTime, endTime: endTime, totalMilliseconds: totalMilliseconds, sheets: less.sheets.length }); } else { // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array loadStyleSheets(function (e, css, _, sheet, webInfo) { if (e) { errors.add(e, e.href || sheet.href); reject(e); return; } if (webInfo.local) { less.logger.info("Loading " + sheet.href + " from cache."); } else { less.logger.info("Rendered " + sheet.href + " successfully."); } browser.createCSS(window.document, css, sheet); less.logger.info("CSS for " + sheet.href + " generated in " + (new Date() - endTime) + "ms"); // Count completed sheet remainingSheets--; // Check if the last remaining sheet was processed and then call the promise if (remainingSheets === 0) { totalMilliseconds = new Date() - startTime; less.logger.info("Less has finished. CSS generated in " + totalMilliseconds + "ms"); resolve({ startTime: startTime, endTime: endTime, totalMilliseconds: totalMilliseconds, sheets: less.sheets.length }); } endTime = new Date(); }, reload, modifyVars); } loadStyles(modifyVars); }); }; less.refreshStyles = loadStyles; return less; }); /** * Kicks off less and compiles any stylesheets * used in the browser distributed version of less * to kick-start less using the browser api */ var options$1 = defaultOptions(); if (window.less) { for (var key in window.less) { if (window.less.hasOwnProperty(key)) { options$1[key] = window.less[key]; } } } addDefaultOptions(window, options$1); options$1.plugins = options$1.plugins || []; if (window.LESS_PLUGINS) { options$1.plugins = options$1.plugins.concat(window.LESS_PLUGINS); } var less = root(window, options$1); window.less = less; var css; var head; var style; // Always restore page visibility function resolveOrReject(data) { if (data.filename) { console.warn(data); } if (!options$1.async) { head.removeChild(style); } } if (options$1.onReady) { if (/!watch/.test(window.location.hash)) { less.watch(); } // Simulate synchronous stylesheet loading by hiding page rendering if (!options$1.async) { css = 'body { display: none !important }'; head = document.head || document.getElementsByTagName('head')[0]; style = document.createElement('style'); style.type = 'text/css'; if (style.styleSheet) { style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style); } less.registerStylesheetsImmediately(); less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject); } return less; }))); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) /***/ }), /***/ "./node_modules/regenerator-runtime/runtime-module.js": /*!************************************************************!*\ !*** ./node_modules/regenerator-runtime/runtime-module.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // This method of obtaining a reference to the global object needs to be // kept identical to the way it is obtained in runtime.js var g = (function() { return this })() || Function("return this")(); // Use `getOwnPropertyNames` because not all browsers support calling // `hasOwnProperty` on the global `self` object in a worker. See #183. var hadRuntime = g.regeneratorRuntime && Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; // Save the old regeneratorRuntime in case it needs to be restored later. var oldRuntime = hadRuntime && g.regeneratorRuntime; // Force reevalutation of runtime.js. g.regeneratorRuntime = undefined; module.exports = __webpack_require__(/*! ./runtime */ "./node_modules/regenerator-runtime/runtime.js"); if (hadRuntime) { // Restore the original runtime. g.regeneratorRuntime = oldRuntime; } else { // Remove the global property added by runtime.js. try { delete g.regeneratorRuntime; } catch(e) { g.regeneratorRuntime = undefined; } } /***/ }), /***/ "./node_modules/regenerator-runtime/runtime.js": /*!*****************************************************!*\ !*** ./node_modules/regenerator-runtime/runtime.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ !(function(global) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; var inModule = typeof module === "object"; var runtime = global.regeneratorRuntime; if (runtime) { if (inModule) { // If regeneratorRuntime is defined globally and we're in a module, // make the exports object identical to regeneratorRuntime. module.exports = runtime; } // Don't bother evaluating the rest of this file if the runtime was // already defined globally. return; } // Define the runtime globally (as expected by generated code) as either // module.exports (if we're in a module) or a new, empty object. runtime = global.regeneratorRuntime = inModule ? module.exports : {}; function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } runtime.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; }; var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { prototype[method] = function(arg) { return this._invoke(method, arg); }; }); } runtime.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; runtime.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; if (!(toStringTagSymbol in genFun)) { genFun[toStringTagSymbol] = "GeneratorFunction"; } } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. runtime.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return Promise.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return Promise.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. If the Promise is rejected, however, the // result for this iteration will be rejected with the same // reason. Note that rejections of yielded Promises are not // thrown back into the generator function, as is the case // when an awaited Promise is rejected. This difference in // behavior between yield and await is important, because it // allows the consumer to decide what to do with the yielded // rejection (swallow it and continue, manually .throw it back // into the generator, abandon iteration, whatever). With // await, by contrast, there is no opportunity to examine the // rejection reason outside the generator function, so the // only option is to throw it from the await expression, and // let the generator function handle the exception. result.value = unwrapped; resolve(result); }, reject); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new Promise(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; runtime.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. runtime.async = function(innerFn, outerFn, self, tryLocsList) { var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList) ); return runtime.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null; if (context.method === "throw") { if (delegate.iterator.return) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. Gp[iteratorSymbol] = function() { return this; }; Gp.toString = function() { return "[object Generator]"; }; function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } runtime.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } // Return an iterator with no values. return { next: doneResult }; } runtime.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } return ContinueSentinel; } }; })( // In sloppy mode, unbound `this` refers to the global object, fallback to // Function constructor if we're in global strict mode. That is sadly a form // of indirect eval which violates Content Security Policy. (function() { return this })() || Function("return this")() ); /***/ }), /***/ "./node_modules/webpack/buildin/global.js": /*!***********************************!*\ !*** (webpack)/buildin/global.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || new Function("return this")(); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /***/ "./src/CamelDesign.js": /*!****************************!*\ !*** ./src/CamelDesign.js ***! \****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.render = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _view = __webpack_require__(/*! ./camel/view */ "./src/camel/view/index.js"); var _utility = __webpack_require__(/*! ./camel/utility */ "./src/camel/utility/index.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var CamelDesign = function () { function CamelDesign(canvas, container, optionBar) { _classCallCheck(this, CamelDesign); this.canvas = canvas; this.camel = null; this.container = container; this.optionBar = optionBar; this.lTree = null; this.propsPanel = null; this.camelContext = new _view.CamelContext(); } // 初始化 _createClass(CamelDesign, [{ key: "Init", value: function Init() { var _this = this; if (this.canvas.getContext) { // 加载图片 new _utility.Resources().onload(function () { _this.initCamelPanel(_this.canvas); // 获取url的值 var str = window.location.search ? window.location.search.replace(/\?/, "").split("&") : ""; if (str) { var params = {}; str.forEach(function (el, index) { params[el.split("=")[0]] = el.split("=")[1].replace(/^\//, ""); }); if (params.eipId) { var eipId = params.eipId; var xml = _this.getXMLConf(params.contextPath, params.appId, eipId); if (xml) { _this.XMLOperate(xml); } } } else { // 如果有xml则解析原有的xml【先执行这部分内容,否则放不下】 if (sessionStorage.getItem("xmlString")) { _this.XMLOperate(sessionStorage.getItem("xmlString")); } } // this.initLTreeView($("#ltree")); _this.initPropsPanel($("#propsBoard")); // this.initRTreeView($("#rTree")); _this.bindEvent(); window.camelParams = _extends({}, _this.camel); } // lTree: this.lTree, ); } else { throw new Error("context is not exist"); } } /** * 获取eip的xml * @param {*} fileId * @returns */ }, { key: "getXMLConf", value: function getXMLConf(contextPath, appId, eipId) { var api = new _utility.Api(); return api.getXMLConf(contextPath, appId, eipId); } // 初始化画板 }, { key: "initCamelPanel", value: function initCamelPanel(canvas) { if (canvas) { this.camel = new _view.CamelPanel(canvas); this.camel.init({ camelcontext: this.camelContext }); } } // 初始化树形面板 }, { key: "initPropsPanel", value: function initPropsPanel($container) { this.propsPanel = new _view.PropsPanel(); this.propsPanel.init({ container: $container, camel: this.camel || null, camelContext: this.camelContext || null, lTree: this.lTree }); } }, { key: "renderPropsPanel", value: function renderPropsPanel() { this.propsPanel.render(); } // 初始化左侧动态组件树 }, { key: "initLTreeView", value: function initLTreeView($container) { this.lTree = new _view.lTree(); this.lTree.init({ container: $container, camel: this.camel || null }); } // 渲染左侧的树 }, { key: "renderLTreeView", value: function renderLTreeView() { this.lTree.render(); } // 解析xml }, { key: "XMLOperate", value: function XMLOperate(xml) { var xmldoc = this.camel.XMLOperate(xml); new _utility.XMLOperate(xmldoc, this.camel).parseXML(); console.log("解析xml", xmldoc); this.camel.paint(); } // 绑定事件 }, { key: "bindEvent", value: function bindEvent() { var _this2 = this; console.log("save及回选内容"); // 添加组件到画布上 var $component = $(this.container); var $optionBar = $(this.optionBar); var $saveBtn = $("#save_btn"); var $showCodeBtn = $("#showCode"); var $camelBoard = $("#camelBoard"); var camel = this.camel; $saveBtn.on("click", function (e) { // console.log(camel.toXML()); // 先存储在缓存里面 sessionStorage.setItem("xmlString", camel.toXML()); window.parent.camelData = { name: _this2.camelContext.name, description: _this2.camelContext.description, xml: camel.toXML() }; console.log(window.parent.camelData.xml); }); $showCodeBtn.on("click", function (e) { camel.checkHasRealtion(); new _view.Modal(e.target, $("#xmlText"), camel).render(); }); // 暂时没有发现有什么用处 $camelBoard.off("click").on("click", function (e) { console.log("执行全局的propspanel"); _this2.renderPropsPanel(); e.stopPropagation(); return false; }); // 关联线 $optionBar.on("mousedown", "#relation", function () { _this2.camel.addRelation(); }); // 删除 $optionBar.on("mousedown", "#del", function () { _this2.camel.remove(); }); // 组件 $component.on("mousedown", "#route", function () { _this2.camel.addRoute(); }); $component.on("mousedown", "#activemq", function () { _this2.camel.addActiveMQ(); }); $component.on("mousedown", "#atom", function () { _this2.camel.addAtom(); }); $component.on("mousedown", "#bean", function () { _this2.camel.addBean(); }); $component.on("mousedown", "#cxf", function () { _this2.camel.addCXF(); }); $component.on("mousedown", "#cxfrs", function () { _this2.camel.addCXFRS(); }); $component.on("mousedown", "#controlbus", function () { _this2.camel.addControlBus(); }); $component.on("mousedown", "#direct", function () { _this2.camel.addDirect(); }); $component.on("mousedown", "#directvm", function () { _this2.camel.addDirectVM(); }); $component.on("mousedown", "#ftp", function () { _this2.camel.addFTP(); }); $component.on("mousedown", "#ftps", function () { _this2.camel.addFTPS(); }); $component.on("mousedown", "#file", function () { _this2.camel.addFile(); }); $component.on("mousedown", "#generic", function () { _this2.camel.addGeneric(); }); $component.on("mousedown", "#imap", function () { _this2.camel.addIMAP(); }); $component.on("mousedown", "#imapsecure", function () { _this2.camel.addIMAPSecure(); }); $component.on("mousedown", "#jdbc", function () { _this2.camel.addJDBC(); }); $component.on("mousedown", "#jgroups", function () { _this2.camel.addJGroups(); }); $component.on("mousedown", "#jms", function () { _this2.camel.addJMS(); }); $component.on("mousedown", "#language", function () { _this2.camel.addLanguage(); }); $component.on("mousedown", "#log", function () { _this2.camel.addLog(); }); $component.on("mousedown", "#mqtt", function () { _this2.camel.addMQTT(); }); $component.on("mousedown", "#mvel", function () { _this2.camel.addMVEL(); }); $component.on("mousedown", "#mina2", function () { _this2.camel.addMina2(); }); $component.on("mousedown", "#netty", function () { _this2.camel.addNetty(); }); $component.on("mousedown", "#nettyhttp", function () { _this2.camel.addNettyHTTP(); }); $component.on("mousedown", "#netty4", function () { _this2.camel.addNetty4(); }); $component.on("mousedown", "#netty4http", function () { _this2.camel.addNetty4HTTP(); }); $component.on("mousedown", "#pop3", function () { _this2.camel.addPOP3(); }); $component.on("mousedown", "#pop3s", function () { _this2.camel.addPOP3S(); }); $component.on("mousedown", "#process", function () { _this2.camel.addProcess(); }); $component.on("mousedown", "#quartz", function () { _this2.camel.addQuartz(); }); $component.on("mousedown", "#quartz2", function () { _this2.camel.addQuartz2(); }); $component.on("mousedown", "#restlet", function () { _this2.camel.addRestlet(); }); $component.on("mousedown", "#sapnetweaver", function () { _this2.camel.addSAPNetWeaver(); }); $component.on("mousedown", "#seda", function () { _this2.camel.addSEDA(); }); $component.on("mousedown", "#sftp", function () { _this2.camel.addSFTP(); }); $component.on("mousedown", "#smtp", function () { _this2.camel.addSMTP(); }); $component.on("mousedown", "#smtps", function () { _this2.camel.addSMTPS(); }); $component.on("mousedown", "#snmp", function () { _this2.camel.addSNMP(); }); $component.on("mousedown", "#sql", function () { _this2.camel.addSQL(); }); $component.on("mousedown", "#salesforce", function () { _this2.camel.addSalesforce(); }); $component.on("mousedown", "#scheduler", function () { _this2.camel.addScheduler(); }); $component.on("mousedown", "#servlet", function () { _this2.camel.addServlet(); }); $component.on("mousedown", "#timer", function () { _this2.camel.addTimer(); }); $component.on("mousedown", "#vm", function () { _this2.camel.addVM(); }); $component.on("mousedown", "#xquery", function () { _this2.camel.addXQuery(); }); $component.on("mousedown", "#xslt", function () { _this2.camel.addXSLT(); }); // routing $component.on("mousedown", "#aggregate", function () { _this2.camel.addAggregate(); }); $component.on("mousedown", "#choice", function () { _this2.camel.addChoice(); }); $component.on("mousedown", "#claimcheck", function () { _this2.camel.addClaimCheck(); }); $component.on("mousedown", "#filter", function () { _this2.camel.addFilter(); }); $component.on("mousedown", "#hystrix", function () { _this2.camel.addHystrix(); }); $component.on("mousedown", "#idempotentconsumer", function () { _this2.camel.addIdempotentConsumer(); }); $component.on("mousedown", "#loadbalance", function () { _this2.camel.addLoadBalance(); }); $component.on("mousedown", "#multicast", function () { _this2.camel.addMulticast(); }); $component.on("mousedown", "#otherwise", function () { _this2.camel.addOtherwise(); }); $component.on("mousedown", "#pipeline", function () { _this2.camel.addPipeline(); }); $component.on("mousedown", "#recipientlist", function () { _this2.camel.addRecipientList(); }); $component.on("mousedown", "#resequence", function () { _this2.camel.addResequence(); }); $component.on("mousedown", "#routingslip", function () { _this2.camel.addRoutingSlip(); }); $component.on("mousedown", "#saga", function () { _this2.camel.addSaga(); }); $component.on("mousedown", "#sort", function () { _this2.camel.addSort(); }); $component.on("mousedown", "#split", function () { _this2.camel.addSplit(); }); $component.on("mousedown", "#when", function () { _this2.camel.addWhen(); }); $component.on("mousedown", "#wiretap", function () { _this2.camel.addWireTap(); }); // controlflow $component.on("mousedown", "#delay", function () { _this2.camel.addDelay(); }); $component.on("mousedown", "#docatch", function () { _this2.camel.addDoCatch(); }); $component.on("mousedown", "#dofinally", function () { _this2.camel.addDoFinally(); }); $component.on("mousedown", "#dotry", function () { _this2.camel.addDoTry(); }); $component.on("mousedown", "#dotry", function () { _this2.camel.addDoTry(); }); $component.on("mousedown", "#intercept", function () { _this2.camel.addIntercept(); }); $component.on("mousedown", "#interceptfrom", function () { _this2.camel.addInterceptFrom(); }); $component.on("mousedown", "#interceptsendtoendpoint", function () { _this2.camel.addInterceptSendToEndpoint(); }); $component.on("mousedown", "#loop", function () { _this2.camel.addLoop(); }); $component.on("mousedown", "#oncompletion", function () { _this2.camel.addOnCompletion(); }); $component.on("mousedown", "#onexception", function () { _this2.camel.addOnException(); }); $component.on("mousedown", "#onfallback", function () { _this2.camel.addOnFallback(); }); $component.on("mousedown", "#rollback", function () { _this2.camel.addRollback(); }); $component.on("mousedown", "#throttle", function () { _this2.camel.addThrottle(); }); $component.on("mousedown", "#throwexception", function () { _this2.camel.addThrowException(); }); $component.on("mousedown", "#transacted", function () { _this2.camel.addTransacted(); }); // transformation $component.on("mousedown", "#convertbodyto", function () { _this2.camel.addConvertBodyTo(); }); $component.on("mousedown", "#enrich", function () { _this2.camel.addEnrich(); }); $component.on("mousedown", "#inonly", function () { _this2.camel.addInOnly(); }); $component.on("mousedown", "#inout", function () { _this2.camel.addInOut(); }); $component.on("mousedown", "#marshal", function () { _this2.camel.addMarshal(); }); $component.on("mousedown", "#pollenrich", function () { _this2.camel.addPollEnrich(); }); $component.on("mousedown", "#removeheader", function () { _this2.camel.addRemoveHeader(); }); $component.on("mousedown", "#removeheaders", function () { _this2.camel.addRemoveHeaders(); }); $component.on("mousedown", "#removeproperties", function () { _this2.camel.addRemoveProperties(); }); $component.on("mousedown", "#removeproperty", function () { _this2.camel.addRemoveProperty(); }); $component.on("mousedown", "#setbody", function () { _this2.camel.addSetBody(); }); $component.on("mousedown", "#setexchangepattern", function () { _this2.camel.addSetExchangePattern(); }); $component.on("mousedown", "#setfaultbody", function () { _this2.camel.addSetBody(); }); $component.on("mousedown", "#setheader", function () { _this2.camel.addSetHeader(); }); $component.on("mousedown", "#setoutheader", function () { _this2.camel.addSetOutHeader(); }); $component.on("mousedown", "#setproperty", function () { _this2.camel.addSetProperty(); }); $component.on("mousedown", "#transform", function () { _this2.camel.addTransform(); }); $component.on("mousedown", "#unmarshal", function () { _this2.camel.addUnmarshal(); }); // miscellaneous $component.on("mousedown", "#aop", function () { _this2.camel.addAop(); }); $component.on("mousedown", "#policy", function () { _this2.camel.addPolicy(); }); $component.on("mousedown", "#sample", function () { _this2.camel.addSample(); }); $component.on("mousedown", "#stop", function () { _this2.camel.addStop(); }); $component.on("mousedown", "#threads", function () { _this2.camel.addThreads(); }); $component.on("mousedown", "#validate", function () { _this2.camel.addValidate(); }); // 如果不是拖拽当前元素那么要注销 $component.on("mouseup", "#route", function (e) { _this2.camel.delElement(); }); $component.on("mouseup", "#activemq", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#atom", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#bean", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#cxf", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#cxfrs", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#controlbus", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#direct", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#directvm", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#ftp", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#ftps", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#file", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#generic", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#imap", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#imapsecure", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#jdbc", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#jgroups", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#jms", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#language", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#log", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#mqtt", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#mvel", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#mina2", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#netty", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#nettyhttp", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#netty4", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#netty4http", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#pop3", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#pop3s", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#process", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#quartz", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#quartz2", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#restlet", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#sapnetweaver", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#seda", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#sftp", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#smtp", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#smtps", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#snmp", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#sql", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#salesforce", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#scheduler", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#servlet", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#timer", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#vm", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#xquery", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#xslt", function () { _this2.camel.delElement(); }); // routing $component.on("mouseup", "#aggregate", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#choice", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#claimcheck", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#filter", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#hystrix", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#idempotentconsumer", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#loadbalance", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#multicast", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#otherwise", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#pipeline", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#recipientlist", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#resequence", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#routingslip", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#saga", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#sort", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#split", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#when", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#wiretap", function () { _this2.camel.delElement(); }); // controlflow $component.on("mouseup", "#delay", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#docatch", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#dofinally", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#dotry", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#dotry", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#intercept", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#interceptfrom", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#interceptsendtoendpoint", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#loop", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#oncompletion", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#onexception", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#onfallback", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#rollback", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#throttle", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#throwexception", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#transacted", function () { _this2.camel.delElement(); }); // transformation $component.on("mouseup", "#convertbodyto", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#enrich", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#inonly", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#inout", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#maeshal", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#pollenrich", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#removeheader", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#removeheaders", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#removeproperties", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#removeproperty", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#setbody", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#setexchangepattern", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#setfaultbody", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#setheader", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#setoutheader", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#setproperty", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#transform", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#unmarshal", function () { _this2.camel.delElement(); }); // miscellaneous $component.on("mouseup", "#aop", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#policy", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#sample", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#stop", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#threads", function () { _this2.camel.delElement(); }); $component.on("mouseup", "#validate", function () { _this2.camel.delElement(); }); } }]); return CamelDesign; }(); var render = exports.render = function render(canvas, container) { new CamelDesign(canvas, container, optionBar).Init(); }; /***/ }), /***/ "./src/camel/element/AbstractCamelElement.js": /*!***************************************************!*\ !*** ./src/camel/element/AbstractCamelElement.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var AbstractCamelElement = function () { function AbstractCamelElement() { _classCallCheck(this, AbstractCamelElement); this.bgcolor = AbstractCamelElement.DEF_BGCOLOR; // 元素的背景色 this.color = AbstractCamelElement.DEF_COLOR; // 元素使用的默认颜色 this.font = AbstractCamelElement.DEF_FONT; // 元素使用的默认字体 // this._currToEdit = window.camelParams._currToElem } /** * 根据rid找到对应的元素 * @param {id} id * @returns */ _createClass(AbstractCamelElement, [{ key: "getElementByID", value: function getElementByID(id) { if (id == null || id.trim().length == 0) { return null; } var elems = window.camelParams._elems; for (var i = 0; i < elems.length; i++) { var em = elems[i]; if (em && em.rid != null && em.rid == id) { return em; } } return null; } }, { key: "isCurrentToEdit", value: function isCurrentToEdit(em) { // if (em != null && this._currToEdit != null && Object.is(em, this._currToEdit)) { // return true; // } else { // return false; // } } }]); return AbstractCamelElement; }(); AbstractCamelElement.DEF_BGCOLOR = "white"; AbstractCamelElement.DEF_COLOR = "black"; AbstractCamelElement.DEF_FONT = '12px -apple-system, "Microsoft YaHei", Arial, sans-serif'; exports.default = AbstractCamelElement; /***/ }), /***/ "./src/camel/element/CamelElement.js": /*!*******************************************!*\ !*** ./src/camel/element/CamelElement.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _AbstractCamelElement2 = __webpack_require__(/*! ./AbstractCamelElement */ "./src/camel/element/AbstractCamelElement.js"); var _AbstractCamelElement3 = _interopRequireDefault(_AbstractCamelElement2); var _utility = __webpack_require__(/*! ../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var CamelElement = function (_AbstractCamelElement) { _inherits(CamelElement, _AbstractCamelElement); function CamelElement() { _classCallCheck(this, CamelElement); var _this = _possibleConstructorReturn(this, (CamelElement.__proto__ || Object.getPrototypeOf(CamelElement)).call(this)); _this.x = 0; _this.y = 0; _this.rid = ""; // 线的id // 鼠标点击要拖动元素的坐标 _this._handlePointX = 0; // 鼠标距离元素左侧距离【抓取点】 _this._handlePointY = 0; // 鼠标距离元素上侧距离【抓取点】 _this._offsetRoute = null; // 子元素相对路由元素的距离 _this.width = CamelElement.DEF_WIDTH; _this.height = CamelElement.DEF_HEIGHT; _this.icon_width = CamelElement.ICON_WIDTH; _this.icon_height = CamelElement.ICON_HEIGHT; return _this; } _createClass(CamelElement, [{ key: "setProps", value: function setProps(prop) { // 遍历当前对象的所有属性值重新赋值 Object.assign(this, prop); } }, { key: "getProp", value: function getProp(prop) {} // 移动元素改变选中元素的坐标 }, { key: "moveTo", value: function moveTo(x, y) { this.x = x - this._handlePointX; this.y = y - this._handlePointY; } // 直达 }, { key: "directTo", value: function directTo(x, y) { this.x = x; this.y = y; } /** * 拖动锚点时更改元素大小 * @param {*} archor * @param {*} x * @param {*} y */ }, { key: "changeElementWhenDragArchor", value: function changeElementWhenDragArchor(archor, x, y) { var width = void 0, height = void 0, movedX = void 0, movedY = void 0; var elementPos = {}; movedX = Math.abs(x - this._handlePointX); movedY = Math.abs(y - this._handlePointY); elementPos.x = this.x + x - this._handlePointX; elementPos.y = this.y + y - this._handlePointY; if (this._handlePointX >= x && this._handlePointY >= y && archor.x == 0 && archor.y == 0) { width = this.width + movedX; height = this.height + movedY; this.setProps({ width: width, height: height, _handlePointX: x, _handlePointY: y, x: elementPos.x, y: elementPos.y }); } else if (this._handlePointX <= x && this._handlePointY <= y && archor.x == 0 && archor.y == 0) { width = this.width - movedX; height = this.height - movedY; this.setProps({ width: width, height: height, _handlePointX: x, _handlePointY: y, x: elementPos.x, y: elementPos.y }); } else if (this._handlePointX <= x && this._handlePointY >= y && archor.x == 1 && archor.y == 0) { width = this.width + movedX; height = this.height + movedY; this.setProps({ width: width, height: height, _handlePointX: x, _handlePointY: y, y: elementPos.y }); } else if (this._handlePointX >= x && this._handlePointY <= y && archor.x == 1 && archor.y == 0) { width = this.width - movedX; height = this.height - movedY; this.setProps({ width: width, height: height, _handlePointX: x, _handlePointY: y, y: elementPos.y }); } else if (this._handlePointX >= x && this._handlePointY <= y && archor.x == 0 && archor.y == 1) { width = this.width + movedX; height = this.height + movedY; this.setProps({ width: width, height: height, _handlePointX: x, _handlePointY: y, x: elementPos.x }); } else if (this._handlePointX <= x && this._handlePointY >= y && archor.x == 0 && archor.y == 1) { width = this.width - movedX; height = this.height - movedY; this.setProps({ width: width, height: height, _handlePointX: x, _handlePointY: y, x: elementPos.x }); } else if (archor.x == 1 && archor.y == 1) { width = this.width + x - this._handlePointX; height = this.height + y - this._handlePointY; this.setProps({ width: width, height: height, _handlePointX: x, _handlePointY: y }); } } // 解析xml并且给每个元素赋值 }, { key: "handleCamelElement", value: function handleCamelElement(xmlNode, obj) { var arr = obj["details"]; var camelElement = {}; camelElement.id = xmlNode.getAttribute("id"); camelElement.x = parseInt(xmlNode.getAttribute("x")); camelElement.y = parseInt(xmlNode.getAttribute("y")); camelElement.scope = xmlNode.getAttribute("scope"); for (var i = 0; i < arr.length; i++) { camelElement[arr[i]] = xmlNode.getAttribute(arr[i]); } camelElement.ref_deprecated = xmlNode.getAttribute("ref"); // 截取值再进行切割 // 将uri解析成对应的参数 if (camelElement.uri) { var uriValue = _utility.StringUtil.dencodeHTML(camelElement.uri); var index1 = uriValue.indexOf(":") + 1; // uri后面第一个冒号 var index2 = uriValue.indexOf(":", uriValue.indexOf(":") + 1); // uri后面第二个冒号 var index3 = uriValue.indexOf("?"); // uri后面第一个问号 var params = { index1: index1, index2: index2, index3: index3 }; switch (camelElement.scope) { case "ActiveMQ": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "Atom": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "ControlBus": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "CXF": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "CXFRS": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "IMAP": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "IMAPSecure": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "Language": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "POP3": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "POP3S": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "SMTP": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "SMTPS": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "SNMP": this.parseUri(params, 2, obj["advanced"]["path"], uriValue, camelElement); break; case "File": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "JDBC": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "JGroups": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "JMS": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "MQTT": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "MVEL": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "RSS": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "SAPNetWeaver": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "SEDA": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "Servlet": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "SQL": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "SQL": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "Timer": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "VM": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "XQuery": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "Direct": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "DirectVM": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; case "DirectVM": this.parseUri(params, 1, obj["advanced"]["path"], uriValue, camelElement); break; } // 如果是冒号中的值需要通过 if (uriValue.indexOf("?") != -1) { var str = uriValue.split("?")[1].split("&"); str.forEach(function (el, index) { camelElement[el.split("=")[0]] = el.split("=")[1]; }); } } console.log(camelElement); return camelElement; } /** * 截取uri将值分到不同的属性值中 * @param {*} params * @param {uri的类型(一个冒号,两个冒号或其他)} type * @param {当前组件的path值} currElePath * @param {上一个函数解析后的uri} uriValue * @param {上一个函数的camelElement} camelElement */ }, { key: "parseUri", value: function parseUri(params, type, currElePath, uriValue, camelElement) { switch (type) { // uri只有一个冒号 case 1: if (params.index3 > 0) { camelElement[currElePath[0]] = uriValue.substring(params.index1, params.index3); } else { camelElement[currElePath[0]] = uriValue.substring(params.index1, uriValue.length); } break; // uri有一个冒号 case 2: if (params.index3 > 0) { camelElement[currElePath[0]] = uriValue.substring(params.index1, params.index2); camelElement[currElePath[1]] = uriValue.substring(params.index2, params.index3); } else { camelElement[currElePath[0]] = uriValue.substring(params.index1, params.index2); camelElement[currElePath[1]] = uriValue.substring(params.index2, uriValue.length); } break; } } /** * 改变uri的值 * @param {原始的组件数据} intValue * @param {当前的组件数据} currElem * @param {当前修改的数据} prop * @param {冒号里的值} tempArr * @param {当前修改组件的类型(一个冒号,两个冒号,其他。。。)} type * @returns */ }, { key: "changeUri", value: function changeUri(intValue, currElem, prop, tempArr, type) { var arr = [], hash = {}; // 找出新旧属性不相同的值 for (var k in intValue) { for (var key in currElem) { if (key == k && currElem[key] !== intValue[k] && key != "color" && key != "x" && key != "y" && key != "parent" && key != "rid" && key != "uri" && key != "_handlePointX" && key != "_handlePointY" && key != "inputid" && key != "outputid" && key != "_offsetRoute" && key != "_img" && key != "description" && key != "pattern" && key != "ref") { arr.push({ key: key, value: currElem[key] }); } } } // 改变后又修改回原来的值[只针对path中的值] var _loop = function _loop(_k) { tempArr = currElem.getPropsDesc().advanced["path"]; tempArr.forEach(function (item) { if (item == _k) arr.push({ key: _k, value: prop[_k] }); }); }; for (var _k in prop) { _loop(_k); } // 去重 arr = arr.reduce(function (item, next) { hash[next.key] ? "" : hash[next.key] = true && item.push(next); return item; }, []); var repStr = ""; // 用于替换uri的暂存字符串 // 获取第一个冒号的下标 var index1 = currElem.uri.indexOf(":") + 1; // 获取第一个问号的下标 var index2 = currElem.uri.indexOf("?"); // 获取第二个冒号的下标 var index3 = currElem.uri.indexOf(":", currElem.uri.indexOf(":") + 1); // 获取第一个斜杠下标(file) var index4 = currElem.uri.indexOf("/") + 1; // 获取第三个冒号 var index5 = currElem.uri.indexOf(":", currElem.uri.indexOf(":", currElem.uri.indexOf(":") + 1)); // 清空上一次的uri if (index2 > 0) { repStr = currElem.uri.substring(index2, currElem.uri.length); currElem.uri = currElem.uri.replace(repStr, ""); } // debugger; // 判断是一个冒号还是两个冒号还是其他 if (arr.length > 0) { if (type == 1) { arr.forEach(function (item) { if (item.key == tempArr[0]) { // 将原来的uri的值替换 repStr = currElem.uri.substring(index1, index2 > 0 ? index2 : currElem.uri.length); currElem.uri = currElem.uri.replace(repStr, item.value); } else { // 如果没有问号就获取冒号到最后一个字符的长度 currElem.uri += (currElem.uri.includes("?") ? "" : "?") + item.key + "=" + item.value + "&"; } }); } else if (type == 2) { arr.map(function (item, i) { if (item.key == tempArr[0]) { // 将原来的uri的值替换 repStr = currElem.uri.substring(index1, index3 > 0 ? index3 : currElem.uri.length); currElem.uri = currElem.uri.replace(repStr, item.value); } else if (item.key == tempArr[1]) { repStr = currElem.uri.substring(index3, index2 > 0 ? index2 : currElem.uri.length); currElem.uri = currElem.uri.replace(repStr, item.value); } else { // 如果没有问号就获取冒号到最后一个字符的长度 currElem.uri += (currElem.uri.includes("?") ? "" : "?") + item.key + "=" + item.value + "&"; } }); } else if (type == "2s") { arr.map(function (item, i) { if (item.key == tempArr[0]) { // 将原来的uri的第一个值替换 repStr = currElem.uri.substring(index1, index3 > 0 ? index3 : currElem.uri.length); currElem.uri = currElem.uri.replace(repStr, item.value); } else if (item.key == tempArr[1]) { // 将原来的uri的第二个值替换 repStr = currElem.uri.substring(index3 + 1, index4); currElem.uri = currElem.uri.replace(repStr, item.value); } else if (item.key == tempArr[2]) { // 将原来的uri的第三个值替换 repStr = currElem.uri.substring(index4, index2 > 0 ? index2 : currElem.uri.length); currElem.uri = currElem.uri.replace(repStr, item.value); } else { // 如果没有问号就获取冒号到最后一个字符的长度 currElem.uri += (currElem.uri.includes("?") ? "" : "?") + item.key + "=" + item.value + "&"; } }); } else if (type == 3) { arr.map(function (item, i) { if (item.key == tempArr[0]) { // 将原来的uri的值替换 repStr = currElem.uri.substring(index1, index3 > 0 ? index3 : currElem.uri.length); currElem.uri = currElem.uri.replace(repStr, item.value); } else if (item.key == tempArr[1]) { repStr = currElem.uri.substring(index3, index2 > 0 ? index2 : currElem.uri.length); currElem.uri = currElem.uri.replace(repStr, item.value); } else if (item.key == tempArr[1]) {} else { // 如果没有问号就获取冒号到最后一个字符的长度 currElem.uri += (currElem.uri.includes("?") ? "" : "?") + item.key + "=" + item.value + "&"; } }); } } if (currElem.uri[currElem.uri.length - 1] == "?" || currElem.uri[currElem.uri.length - 1] == "&") { // 截取问号之后的值替换为空再重新拼接 currElem.uri = currElem.uri.substring(0, currElem.uri.length - 1); } return currElem.uri; } // 判断有无关联线 }, { key: "hasRelation", value: function hasRelation(relation) { var inputCount = 0, outputCount = 0; for (var i = 0; i < relation.length; i++) { if (this.rid == relation[i]._startelemid) { outputCount++; this.outputid = this.rid; } if (this.rid == relation[i]._endelemid) { inputCount++; this.inputid = this.rid; } } return { input: inputCount, output: outputCount }; } // 当前元素是否被选中 }, { key: "isSelected", value: function isSelected(x, y) { if (x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height) { return true; } return false; } // 替换特殊字符【转换填写属性面板的值】 }, { key: "replaceCharacter", value: function replaceCharacter(str) { if (str != null) { while (str.indexOf("&") != -1 || str.indexOf('"') != -1 || str.indexOf("<") != -1 || str.indexOf(">") != -1) { str = str.replace(/&/g, "@amp;"); str = str.replace(/\"/g, "@quot;"); str = str.replace(//g, "@gt;"); } return str; } return ""; } // 转换脚本框内容的值 }, { key: "replaceXML", value: function replaceXML(str) { if (str != null) { while (str.indexOf('"') != -1) { str = str.replace(/\"/g, "@quot;"); } return str; } return ""; } }]); return CamelElement; }(_AbstractCamelElement3.default); CamelElement.DEF_WIDTH = 200; CamelElement.DEF_HEIGHT = 34; CamelElement.PAD = 15; // 默认边距10 CamelElement.ICON_WIDTH = 50; CamelElement.ICON_HEIGHT = 50; exports.default = CamelElement; /***/ }), /***/ "./src/camel/element/Relation.js": /*!***************************************!*\ !*** ./src/camel/element/Relation.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _AbstractCamelElement2 = __webpack_require__(/*! ./AbstractCamelElement */ "./src/camel/element/AbstractCamelElement.js"); var _AbstractCamelElement3 = _interopRequireDefault(_AbstractCamelElement2); var _utility = __webpack_require__(/*! ../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Relation = function (_AbstractCamelElement) { _inherits(Relation, _AbstractCamelElement); function Relation() { _classCallCheck(this, Relation); var _this = _possibleConstructorReturn(this, (Relation.__proto__ || Object.getPrototypeOf(Relation)).call(this)); _this.scope = "relation"; // 属于哪一个类 _this._startEle = null; // 关连线的开始节点 _this._startelemid = ""; // 开始元素id _this._endEle = null; // 关连线的结束节点 _this._endelemid = ""; // 结束元素id _this._mousepoint = null; //拖拉时鼠标的移动点 _this._mousepoint = null; // 画箭头的记录点 _this._startpoint = null; // 关联线要画的开始点 _this._endpoint = null; // 关联线要画的结束点 _this.vector = []; // 线的开始和结束坐标 return _this; } /** * 渲染关联线 */ _createClass(Relation, [{ key: "paint", value: function paint(g) { // 需要起始坐标和结束坐标才能化划线 if (!this.rid) { this.rid = _utility.Sequence.createId(); } var old = this.color; // 保存当前颜色 var startPoint = this.getStartPoint(); var endPoint = this.getEndPoint(); if (startPoint != null && endPoint != null) { var d2 = 0, h2 = 0; if (this.vector.length < 2) { d2 = 0; h2 = 0; } else { var node = this.getEndEle(); d2 = node.width; h2 = node.height; } g.setColor(this.color); var sPoint = null; sPoint = this.getArrowhead(new _utility.Point(endPoint.x, endPoint.y), new _utility.Point(startPoint.x, startPoint.y), d2, h2); // 得到流程线箭头的坐标 var ePoint = null; ePoint = this.getArrowhead(new _utility.Point(startPoint.x, startPoint.y), new _utility.Point(endPoint.x, endPoint.y), d2, h2); // 得到流程线箭头的坐标 if (this.vector.length < 3) { // 鼠标从开始结点拖拉到结尾结点的过程中,鼠标当前移动点作为暂时的尾结点 if (this._movepoint != null) { sPoint = this.getArrowhead(new _utility.Point(this._movepoint.x, this._movepoint.y), new _utility.Point(startPoint.x, startPoint.y), d2, h2); g.drawLine(sPoint.x, sPoint.y, this._movepoint.x, this._movepoint.y); startPoint.x = this._movepoint.x; startPoint.y = this._movepoint.y; ePoint = this.getArrowhead(new _utility.Point(startPoint.x, startPoint.y), new _utility.Point(endPoint.x, endPoint.y), d2, h2); g.drawLine(this._movepoint.x, this._movepoint.y, ePoint.x, ePoint.y); this._movepoint = null; } else { g.drawLine(sPoint.x, sPoint.y, ePoint.x, ePoint.y); } } else { if (this._movepoint != null) { // 画流程线折点时拖拉鼠标的情况 console.log("画流程线折点时拖拉鼠标的情况"); } else { // 鼠标释放点设为新折点 console.log("鼠标释放点设为新折点"); } } ePoint = this.getArrowhead(new _utility.Point(startPoint.x, startPoint.y), new _utility.Point(endPoint.x, endPoint.y), d2, h2); this.drawArrow(g, endPoint.x, endPoint.y, startPoint.x, startPoint.y, ePoint); // 画箭头 g.setColor(_utility.Resources.COLOR.black); } this.color = old; // 恢复当前颜色 } }, { key: "setProps", value: function setProps(prop) { // 遍历当前对象的所有属性值重新赋值 Object.assign(this, prop); } /** * 关连线的开始位置 * @param {*} x * @param {*} y */ }, { key: "setStartpoint", value: function setStartpoint(x, y) { this._startpoint = new _utility.Point(x, y); } /** * @param x * @param y * @roseuid 3E0A6E1B035E */ }, { key: "moveTo", value: function moveTo(x, y) { if (this._mousepoint == null) { this._mousepoint = { x: x, y: y }; this._startpoint = this._mousepoint; console.log("start", x, y); } else { this._mousepoint = { x: x, y: y }; console.log("move", this._mousepoint); } } }, { key: "isSelected", value: function isSelected(x, y) { if (x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height) { return true; } return false; } }, { key: "drawArrow", value: function drawArrow(g, x1, y1, x2, y2, arrowhead) { var hx = void 0, hy = void 0; var sina = void 0, cosa = void 0; sina = Math.abs(Math.sqrt((y2 - y1) * (y2 - y1)) / Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))); cosa = Math.abs(Math.sqrt((x2 - x1) * (x2 - x1)) / Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))); // 第一象限 var arrowstart1 = new _utility.Point(); var arrowstart2 = new _utility.Point(); if (x2 < arrowhead.x && y2 < arrowhead.y) { // 求箭头线的开始点,有两个,分别在流程线的两侧 arrowstart1.x = arrowhead.x + (Relation.ARROW_WIDTH * sina - Relation.ARROW_LONG * cosa); arrowstart1.y = arrowhead.y - (Relation.ARROW_LONG * sina + Relation.ARROW_WIDTH * cosa); arrowstart2.x = arrowhead.x - (Relation.ARROW_LONG * cosa + Relation.ARROW_WIDTH * sina); arrowstart2.y = arrowhead.y + (Relation.ARROW_WIDTH * cosa - Relation.ARROW_LONG * sina); } else if (x2 == arrowhead.x && y2 < arrowhead.y) { arrowstart1.x = arrowhead.x + Relation.ARROW_WIDTH; arrowstart1.y = arrowhead.y - Relation.ARROW_LONG; arrowstart2.x = arrowhead.x - Relation.ARROW_WIDTH; arrowstart2.y = arrowhead.y - Relation.ARROW_LONG; } else if (x2 > arrowhead.x && y2 < arrowhead.y) { arrowstart1.x = arrowhead.x + (Relation.ARROW_LONG * cosa + Relation.ARROW_WIDTH * sina); arrowstart1.y = arrowhead.y + (Relation.ARROW_WIDTH * cosa - Relation.ARROW_LONG * sina); arrowstart2.x = arrowhead.x + (Relation.ARROW_LONG * cosa - Relation.ARROW_WIDTH * sina); arrowstart2.y = arrowhead.y - (Relation.ARROW_LONG * sina + Relation.ARROW_WIDTH * cosa); } else if (x2 > arrowhead.x && y2 == arrowhead.y) { arrowstart1.x = arrowhead.x + Relation.ARROW_LONG; arrowstart1.y = arrowhead.y + Relation.ARROW_WIDTH; arrowstart2.x = arrowhead.x + Relation.ARROW_LONG; arrowstart2.y = arrowhead.y - Relation.ARROW_WIDTH; } else if (x2 > arrowhead.x && y2 > arrowhead.y) { arrowstart1.x = arrowhead.x + (Relation.ARROW_LONG * cosa - Relation.ARROW_WIDTH * sina); arrowstart1.y = arrowhead.y + (Relation.ARROW_LONG * sina + Relation.ARROW_WIDTH * cosa); arrowstart2.x = arrowhead.x + (Relation.ARROW_LONG * cosa + Relation.ARROW_WIDTH * sina); arrowstart2.y = arrowhead.y + (Relation.ARROW_LONG * sina - Relation.ARROW_WIDTH * cosa); } else if (x2 == arrowhead.x && y2 > arrowhead.y) { arrowstart1.x = arrowhead.x - Relation.ARROW_WIDTH; arrowstart1.y = arrowhead.y + Relation.ARROW_LONG; arrowstart2.x = arrowhead.x + Relation.ARROW_WIDTH; arrowstart2.y = arrowhead.y + Relation.ARROW_LONG; } else if (x2 < arrowhead.x && y2 > arrowhead.y) { arrowstart1.x = arrowhead.x - (Relation.ARROW_LONG * cosa + Relation.ARROW_WIDTH * sina); arrowstart1.y = arrowhead.y + (Relation.ARROW_LONG * sina - Relation.ARROW_WIDTH * cosa); arrowstart2.x = arrowhead.x + (Relation.ARROW_WIDTH * sina - Relation.ARROW_LONG * cosa); arrowstart2.y = arrowhead.y + (Relation.ARROW_LONG * sina + Relation.ARROW_WIDTH * cosa); } else { arrowstart1.x = arrowhead.x - Relation.ARROW_LONG; arrowstart1.y = arrowhead.y - Relation.ARROW_WIDTH; arrowstart2.x = arrowhead.x - Relation.ARROW_LONG; arrowstart2.y = arrowhead.y + Relation.ARROW_WIDTH; } hx = arrowhead.x; hy = arrowhead.y; // g.setColor(Color.red); var arrow = new _utility.Polygon(); arrow.addPoint(hx, hy); arrow.addPoint(arrowstart1.x, arrowstart1.y); arrow.addPoint(arrowstart2.x, arrowstart2.y); g.fillPolygon(arrow); } /** * 得到箭头坐标 * * @param p1 * @param p2 * @param d2 * @param h2 * @return */ }, { key: "getArrowhead", value: function getArrowhead(p1, p2, d2, h2) { var k = Math.abs((p2.y - p1.y) / (p2.x - p1.x)); var k2 = h2 / d2; var arrowhead = new _utility.Point(); if (p2.y > p1.y && p2.x > p1.x) { if (k2 >= k) { arrowhead.x = p2.x - d2 / 2; arrowhead.y = p2.y - k * d2 / 2; } else { arrowhead.x = p2.x - h2 / 2 / k; arrowhead.y = p2.y - h2 / 2; } } else if (p2.y == p1.y && p2.x > p1.x) { arrowhead.x = p2.x - d2 / 2; arrowhead.y = p2.y; } else if (p2.y < p1.y && p2.x > p1.x) { if (k2 >= k) { arrowhead.y = p2.y + d2 / 2 * k; arrowhead.x = p2.x - d2 / 2; } else { arrowhead.x = p2.x - h2 / 2 / k; arrowhead.y = p2.y + h2 / 2; } } else if (p2.y < p1.y && p2.x == p1.x) { arrowhead.x = p2.x; arrowhead.y = p2.y + h2 / 2; } else if (p2.y < p1.y && p2.x < p1.x) { if (k2 >= k) { arrowhead.x = p2.x + d2 / 2; arrowhead.y = p2.y + k * d2 / 2; } else { arrowhead.x = p2.x + h2 / 2 / k; arrowhead.y = p2.y + h2 / 2; } } else if (p2.y == p1.y && p2.x < p1.x) { arrowhead.x = p2.x + d2 / 2; arrowhead.y = p2.y; } else if (p2.y > p1.y && p2.x < p1.x) { if (k2 >= k) { arrowhead.x = p2.x + d2 / 2; arrowhead.y = p2.y - d2 * k / 2; } else { arrowhead.x = p2.x + h2 / 2 / k; arrowhead.y = p2.y - h2 / 2; } } else { arrowhead.x = p2.x; arrowhead.y = p2.y - h2 / 2; } return arrowhead; } /** * 返回开始元素 * * @return */ }, { key: "getStartEle", value: function getStartEle() { if (this._startelemid != null && this._startelemid.trim().length > 0) { if (this._startEle == null) { var sn = this.getElementByID(this._startelemid); this._startEle = sn; } return this._startEle; } return null; } /** * 返回结束元素 */ }, { key: "getEndEle", value: function getEndEle() { if (this._endelemid != null && this._endelemid.trim().length > 0) { if (this._endEle == null) { var en = this.getElementByID(this._endelemid); this._endEle = en; } return this._endEle; } return null; } /** * 返回开始结点的坐标 * * @return */ }, { key: "getStartPoint", value: function getStartPoint() { var nd = this.getStartEle(); if (nd != null) { var p = new _utility.Point(nd.x + nd.width / 2, nd.y + nd.height / 2); this._startpoint = p; return p; } return this._startpoint; } /** * 返回结束结点的坐标 * * @return java.awt.Point * @roseuid 3E0A6E1B03CC */ }, { key: "getEndPoint", value: function getEndPoint() { var nd = this.getEndEle(); if (nd != null) { var p = new _utility.Point(nd.x + nd.width / 2, nd.y + nd.height / 2); this._endpoint = p; return p; } return this._endpoint; } }, { key: "setStartId", value: function setStartId(nd) { this._startelemid = nd.rid; } }, { key: "setEndId", value: function setEndId(nd) { this._endelemid = nd.rid; } }, { key: "addVector", value: function addVector(obj) { if (this.vector.length < 2) { this.vector.push(obj); } console.log("vetor", this.vector); } }]); return Relation; }(_AbstractCamelElement3.default); Relation.ARROW_LONG = 14; Relation.ARROW_WIDTH = 4; Relation.PAI = 3.1415926525; exports.default = Relation; /***/ }), /***/ "./src/camel/element/compontent/ActiveMQ.js": /*!**************************************************!*\ !*** ./src/camel/element/compontent/ActiveMQ.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ActiveMQ = function (_CamelElement) { _inherits(ActiveMQ, _CamelElement); function ActiveMQ() { _classCallCheck(this, ActiveMQ); var _this = _possibleConstructorReturn(this, (ActiveMQ.__proto__ || Object.getPrototypeOf(ActiveMQ)).call(this)); _this.scope = "ActiveMQ"; _this.parent = ""; _this.hasUri = true; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "_activemq"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.destinationName = "foo"; _this.destinationType = "queue"; _this.uri = "activemq:" + _this.destinationName + ":" + _this.destinationType; // uri _this.clientId = ""; _this.connectionFactory = ""; _this.disableReplyTo = false; _this.durableSubscriptionName = false; _this.jmsMessageType = ""; _this.testConnectionOnStartup = false; _this.acknowledgementModeName = "AUTO_ACKNOWLEDGE"; _this.asyncConsumer = false; _this.autoStartup = true; _this.bridgeErrorHandler = false; _this.cacheLevel = ""; _this.cacheLevelName = "CACHE_AUTO"; _this.concurrentConsumers = 1; _this.maxConcurrentConsumers = ""; _this.replyTo = ""; _this.replyToDeliveryPersistent = true; _this.selector = ""; _this.subscriptionDurable = ""; _this.subscriptionName = ""; _this.subscriptionShared = false; _this.acceptMessagesWhileStopping = false; _this.allowReplyManagerQuickStop = false; _this.consumerType = "Default"; _this.defaultTaskExecutorType = ""; _this.eagerLoadingOfProperties = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.exposeListenerSession = false; _this.replyToSameDestinationAllowed = false; _this.taskExecutor = ""; _this.deliveryMode = ""; _this.deliveryPersistent = true; _this.explicitQosEnabled = false; _this.formatDateHeadersToIso8601 = false; _this.preserveMessageQos = false; _this.priority = "4"; _this.replyToConcurrentConsumers = 1; _this.replyToMaxConcurrentConsumers = ""; _this.replyToOnTimeoutMaxConcurrentConsumers = 1; _this.replyToOverride = ""; _this.replyToType = ""; _this.requestTimeout = 20000; _this.timeToLive = -1; _this.allowAdditionalHeaders = ""; _this.allowNullBody = true; _this.alwaysCopyMessage = false; _this.correlationProperty = ""; _this.disableTimeToLive = false; _this.forceSendOriginalMessage = false; _this.includeSentJMSMessageID = false; _this.replyToCacheLevelName = ""; _this.replyToDestinationSelectorName = ""; _this.streamMessageTypeEnabled = false; _this.allowSerializedHeaders = false; _this.asyncStartListener = false; _this.asyncStopListener = false; _this.destinationResolver = ""; _this.errorHandler = ""; _this.exceptionListener = ""; _this.headerFilterStrategy = ""; _this.idleConsumerLimit = 1; _this.idleTaskExecutionLimit = 1; _this.includeAllJMSXProperties = false; _this.jmsKeyFormatStrategy = ""; _this.mapJmsMessage = true; _this.maxMessagesPerTask = -1; _this.messageConverter = ""; _this.messageCreatedStrategy = ""; _this.messageIdEnabled = true; _this.messageListenerContainerFactory = ""; _this.messageTimestampEnabled = true; _this.pubSubNoLocal = false; _this.receiveTimeout = 1000; _this.recoveryInterval = 5000; _this.requestTimeoutCheckerInterval = 1000; _this.synchronous = ""; _this.transferException = false; _this.transferExchange = false; _this.transferFault = false; _this.useMessageIDAsCorrelationID = false; _this.waitForProvisionCorrelationToBeUpdatedCounter = 50; _this.waitForProvisionCorrelationToBeUpdatedThreadSleepingTime = 100; _this.errorHandlerLogStackTrace = true; _this.errorHandlerLoggingLevel = "WARN"; _this.password = ""; _this.username = ""; _this.transacted = false; _this.lazyCreateTransactionManager = true; _this.transactionManager = ""; _this.transactionName = ""; _this.transactionTimeout = -1; return _this; } _createClass(ActiveMQ, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } if (this.isCurrentToEdit(this)) { alert(); } g.save(); this.color = "#c8eb79"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) { // 需要解析uri } }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["destinationName", "destinationType"], common: ["clientId", "connectionFactory", "disableReplyTo", "durableSubscriptionName", "jmsMessageType", "testConnectionOnStartup"], consumer: ["acknowledgementModeName", "asyncConsumer", "autoStartup", "bridgeErrorHandler", "cacheLevel", "cacheLevelName", "concurrentConsumers", "maxConcurrentConsumers", "replyTo", "replyToDeliveryPersistent", "selector", "subscriptionDurable", "subscriptionName", "subscriptionShared"], consumer_advanced: ["acceptMessagesWhileStopping", "allowReplyManagerQuickStop", "consumerType", "defaultTaskExecutorType", "eagerLoadingOfProperties", "exceptionHandler", "exchangePattern", "exposeListenerSession", "replyToSameDestinationAllowed", "taskExecutor"], producer: ["deliveryMode", "deliveryPersistent", "explicitQosEnabled", "formatDateHeadersToIso8601", "preserveMessageQos", "priority", "replyToConcurrentConsumers", "replyToMaxConcurrentConsumers", "replyToOnTimeoutMaxConcurrentConsumers", "replyToOverride", "replyToType", "requestTimeout", "timeToLive"], producer_advanced: ["allowAdditionalHeaders", "allowNullBody", "alwaysCopyMessage", "correlationProperty", "disableTimeToLive", "forceSendOriginalMessage", "includeSentJMSMessageID", "replyToCacheLevelName", "replyToDestinationSelectorName", "streamMessageTypeEnabled"], advanceds: ["allowSerializedHeaders", "asyncStartListener", "asyncStopListener", "destinationResolver", "errorHandler", "exceptionListener", "headerFilterStrategy", "idleConsumerLimit", "idleTaskExecutionLimit", "includeAllJMSXProperties", "jmsKeyFormatStrategy", "mapJmsMessage", "maxMessagesPerTask", "messageConverter", "messageCreatedStrategy", "messageIdEnabled", "messageListenerContainerFactory", "messageTimestampEnabled", "pubSubNoLocal", "receiveTimeout", "recoveryInterval", "requestTimeoutCheckerInterval", "synchronous", "transferException", "transferExchange", "transferFault", "useMessageIDAsCorrelationID", "waitForProvisionCorrelationToBeUpdatedCounter", "waitForProvisionCorrelationToBeUpdatedThreadSleepingTime"], logging: ["errorHandlerLogStackTrace", "errorHandlerLoggingLevel"], security: ["password", "username"], transaction: ["transacted"], transaction_advanced: ["lazyCreateTransactionManager", "transactionManager", "transactionName", "transactionTimeout"] }, documentation: ActiveMQ.documentation }; } }]); return ActiveMQ; }(_CamelElement3.default); ActiveMQ.documentation = "
    \n
    \n
    \n
    \n

    ActiveMQ

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    ActiveMQ\n Component

    \n
    \n
    \n
    \n

    The ActiveMQ component allows messages to be sent to a JMS Queue or Topic; or messages to be\n consumed from a JMS Queue or Topic using Apache\n ActiveMQ.

    \n

    This component is based on the JMS\n Component and uses\n Spring’s JMS support for declarative transactions, using Spring’s\n JmsTemplate for sending and a MessageListenerContainer\n for consuming. All the options from the JMS Component component also\n apply for this component.\n

    \n

    To use this component, make sure you have the activemq.jar or\n activemq-core.jar on your classpath along with any Apache Camel\n dependencies\n such as camel-core.jar, camel-spring.jar and\n camel-jms.jar.\n

    \n
    \n \n \n \n \n \n \n \n \n
    \"[Note]\"\nTransacted and caching
    \n

    See section Transactions and Cache Levels\n below on JMS page if you are using transactions with JMS as it can impact performance.\n

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    URI format

    \n
    \n
    \n
    \n
    activemq:[queue:|topic:]destinationName
    \n

    Where destinationName is an ActiveMQ queue or topic name.\n By default, the destinationName is interpreted as a queue\n name. For example, to connect to the queue, FOO.BAR, use:

    \n
    activemq:FOO.BAR
    \n

    You can include the optional queue: prefix, if you prefer:

    \n
    activemq:queue:FOO.BAR
    \n

    To connect to a topic, you must include the topic: prefix. For example,\n to connect to the topic, Stocks.Prices, use:

    \n
    activemq:topic:Stocks.Prices
    \n
    \n
    \n
    \n
    \n
    \n

    Options

    \n
    \n
    \n
    \n

    See Options on the JMS\n Component component as all these options\n also apply for this component.

    \n
    \n
    \n
    \n
    \n
    \n

    Camel on EAP\n deployment

    \n
    \n
    \n
    \n

    This component is supported by the Camel on EAP (Wildfly Camel) framework, which\n offers a simplified deployment model on the Red Hat JBoss Enterprise Application Platform (JBoss EAP)\n container.

    \n

    You can configure the ActiveMQ Camel component to work either with an embedded broker\n or an external broker. To embed a broker in the JBoss EAP container, configure the\n ActiveMQ Resource Adapter in the EAP container configuration file — for details, see\n ActiveMQ Resource Adapter Configuration.\n

    \n
    \n
    \n
    \n
    \n
    \n

    Configuring the Connection\n Factory

    \n
    \n
    \n
    \n

    The following arr case shows how to add an ActiveMQComponent to the CamelContext using the activeMQComponent() method while specifying the brokerURL used to\n connect to ActiveMQ.

    \n camelContext.addComponent(\"activemq\", activeMQComponent(\"vm://localhost?broker.persistent=false\"));\n
    \n
    \n
    \n
    \n
    \n

    Configuring\n the Connection Factory using Spring XML

    \n
    \n
    \n
    \n

    You can configure the ActiveMQ broker URL on the ActiveMQComponent as follows

    \n
    <beans xmlns=\"http://www.springframework.org/schema/beans\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxsi:schemaLocation=\"\nhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd\nhttp://camel.apache.org/schema/spring https://camel.apache.org/schema/spring/camel-spring.xsd\">\n\n<camelContext xmlns=\"http://camel.apache.org/schema/spring\">\n</camelContext>\n\n<bean id=\"activemq\" class=\"org.apache.activemq.camel.component.ActiveMQComponent\">\n<property name=\"brokerURL\" value=\"tcp://somehost:61616\"/>\n</bean>\n\n</beans>
    \n
    \n
    \n
    \n
    \n
    \n

    Using connection pooling

    \n
    \n
    \n
    \n

    When sending to an ActiveMQ broker using Camel it’s recommended to use a pooled connection\n factory to handle efficient pooling of JMS connections, sessions and producers. This is\n documented in the page ActiveMQ\n Spring Support.

    \n

    You can grab Jencks AMQ pool with Maven:

    \n
        <dependency>\n<groupId>org.apache.activemq</groupId>\n<artifactId>activemq-pool</artifactId>\n<version>5.3.2</version>\n</dependency>
    \n

    And then setup the activemq component as follows:

    \n
        <bean id=\"jmsConnectionFactory\" class=\"org.apache.activemq.ActiveMQConnectionFactory\">\n<property name=\"brokerURL\" value=\"tcp://localhost:61616\" />\n</bean>\n\n<bean id=\"pooledConnectionFactory\"    class=\"org.apache.activemq.pool.PooledConnectionFactory\" init-method=\"start\" destroy-method=\"stop\">\n<property name=\"maxConnections\" value=\"8\" />\n<property name=\"connectionFactory\" ref=\"jmsConnectionFactory\" />\n</bean>\n\n<bean id=\"jmsConfig\" class=\"org.apache.camel.component.jms.JmsConfiguration\">\n<property name=\"connectionFactory\" ref=\"pooledConnectionFactory\"/>\n<property name=\"concurrentConsumers\" value=\"10\"/>\n</bean>\n\n<bean id=\"activemq\" class=\"org.apache.activemq.camel.component.ActiveMQComponent\">\n<property name=\"configuration\" ref=\"jmsConfig\"/>\n</bean>
    \n
    \n \n \n \n \n \n \n \n \n
    \"[Note]\"\nNote
    \n

    Notice the init and destroy methods on the pooled connection\n factory. This is important to ensure the connection pool is properly started and\n shutdown.

    \n
    \n
    \n

    The PooledConnectionFactory will then create a connection pool with up to 8\n connections in use at the same time. Each connection can be shared by many sessions. There is an option\n named maxActive you can use to configure the maximum number of sessions per\n connection; the default value is 500. From ActiveMQ 5.7 onwards the option has been renamed to better\n reflect its purpose, being named as maxActiveSessionPerConnection. Notice\n the concurrentConsumers is set to a higher value than maxConnections is. This is okay, as each consumer is using a session, and as\n a session can share the same connection, we are in the safe. In this example we can have 8 * 500 = 4000\n active sessions at the same time.

    \n
    \n
    \n
    \n
    \n
    \n

    Invoking\n MessageListener POJOs in a route

    \n
    \n
    \n
    \n

    The ActiveMQ component also provides a helper Type\n Converter from a JMS MessageListener to a Processor.\n This means that the Bean\n Component component is capable of invoking\n any JMS MessageListener bean directly inside any route.

    \n

    So for example you can create a MessageListener in JMS as follows:

    \n
    public class MyListener implements MessageListener {\npublic void onMessage(Message jmsMessage) {\n// ...\n}\n}
    \n

    Then use it in your route as follows

    \n
    from(\"file://foo/bar\").\nbean(MyListener.class);
    \n

    That is, you can reuse any of the Apache Camel\n components and easily integrate them into your JMS\n MessageListener POJO!\n

    \n
    \n
    \n
    \n
    \n
    \n

    Using ActiveMQ Destination\n Options

    \n
    \n
    \n
    \n

    Available as of ActiveMQ 5.6

    \n

    You can configure the Destination Options in the endpoint uri, using the \"destination.\" prefix. For\n example to mark a consumer as exclusive, and set its prefetch size to 50, you can do as follows:

    \n
    <camelContext xmlns=\"http://camel.apache.org/schema/spring\">\n<route>\n<from uri=\"file://src/arr/data?noop=true\"/>\n<to uri=\"activemq:queue:foo\"/>\n</route>\n<route>\n<!-- use consumer.exclusive ActiveMQ destination option, notice we have to prefix with destination. -->\n<from uri=\"activemq:foo?destination.consumer.exclusive=true&amp;destination.consumer.prefetchSize=50\"/>\n<to uri=\"mock:results\"/>\n</route>\n</camelContext>
    \n
    \n
    \n
    \n
    \n
    \n

    Consuming Advisory Messages

    \n
    \n
    \n
    \n

    ActiveMQ can generate Advisory messages which are put in topics that you can consume. Such messages can\n help you send alerts in case you detect slow consumers or to build statistics (number of\n messages/produced per day, etc.) The following Spring DSL example shows you how to read\n messages from a topic.

    \n
    <route>\n<from uri=\"activemq:topic:ActiveMQ.Advisory.Connection?mapJmsMessage=false\" />\n<convertBodyTo type=\"java.lang.String\"/>\n<transform>\n<simple>{in.body}&#13;</simple>\n</transform>\n<to uri=\"file://data/activemq/?fileExist=Append&ileName=advisoryConnection-{date:now:yyyyMMdd}.txt\" />\n</route>
    \n

    If you consume a message on a queue, you should see the following files under\n data/activemq folder :

    \n

    advisoryConnection-20100312.txt advisoryProducer-20100312.txt

    \n

    and containing string:

    \n
          ActiveMQMessage {commandId = 0, responseRequired = false, messageId = ID:dell-charles-3258-1268399815140\n-1:0:0:0:221, originalDestination = null, originalTransactionId = null, producerId = ID:dell-charles-\n3258-1268399815140-1:0:0:0, destination = topic://ActiveMQ.Advisory.Connection, transactionId = null,\nexpiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1268403383468, brokerOutTime = 1268403383468,\ncorrelationId = null, replyTo = null, persistent = false, type = Advisory, priority = 0, groupID = null,\ngroupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null,\nmarshalledProperties = org.apache.activemq.util.ByteSequence@17e2705, dataStructure = ConnectionInfo\n{commandId = 1, responseRequired = true, connectionId = ID:dell-charles-3258-1268399815140-2:50,\nclientId = ID:dell-charles-3258-1268399815140-14:0, userName = , password = *****,\nbrokerPath = null, brokerMasterConnector = false, manageable = true, clientMaster = true},\nredeliveryCounter = 0, size = 0, properties = {originBrokerName=master, originBrokerId=ID:dell-charles-\n3258-1268399815140-0:0, originBrokerURL=vm://master}, readOnlyProperties = true, readOnlyBody = true,\ndroppable = false}
    \n
    \n
    \n
    \n
    \n
    \n

    Getting\n Component JAR

    \n
    \n
    \n
    \n

    You need this dependency:

    \n
    \n
      \n
    • activemq-camel
    • \n
    \n
    \n

    ActiveMQ is an extension of the JMS\n Component component released with the ActiveMQ project.

    \n
    <dependency>\n<groupId>org.apache.activemq</groupId>\n<artifactId>activemq-camel</artifactId>\n<version>5.6.0</version>\n</dependency>
    \n
    \n
    "; exports.default = ActiveMQ; /***/ }), /***/ "./src/camel/element/compontent/Atom.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/Atom.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Atom = function (_CamelElement) { _inherits(Atom, _CamelElement); function Atom() { _classCallCheck(this, Atom); var _this = _possibleConstructorReturn(this, (Atom.__proto__ || Object.getPrototypeOf(Atom)).call(this)); _this.scope = "Atom"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "_atom"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.feedUri = "feedUri"; _this.uri = "atom:" + _this.feedUri; // uri _this.bridgeErrorHandler = false; _this.feedHeader = true; _this.filter = true; _this.lastUpdate = ""; _this.password = ""; _this.sendEmptyMessageWhenIdle = false; _this.sortEntries = false; _this.splitEntries = true; _this.throttleEntries = true; _this.username = ""; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.pollStrategy = ""; _this.synchronous = false; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 500; _this.greedy = false; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = ""; _this.useFixedDelay = true; return _this; } _createClass(Atom, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据}} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["feedUri"], consumer: ["bridgeErrorHandler", "feedHeader", "filter", "lastUpdate", "password", "sendEmptyMessageWhenIdle", "sortEntries", "splitEntries", "throttleEntries", "username"], consumer_advanced: ["exceptionHandler", "exchangePattern", "pollStrategy"], advanceds: ["synchronous"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"] }, documentation: Atom.documentation }; } }]); return Atom; }(_CamelElement3.default); Atom.documentation = "
    \n
    \n
    \n
    \n

    Atom Component

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    URI format
    \n
    Options
    \n
    Exchange data\n format
    \n
    Message Headers\n
    \n
    Samples
    \n
    See Also
    \n
    \n
    \n

    Available as of Camel version 1.2

    \n

    The atom: component is used for polling Atom feeds.

    \n

    Camel will poll the feed every 60 seconds by default.\n Note: The component currently only supports polling (consuming)\n feeds.\n

    \n

    Maven users will need to add the following dependency to their pom.xml\n for this component:

    \n
    <dependency>\n<groupId>org.apache.camel</groupId>\n<artifactId>camel-atom</artifactId>\n<version>x.x.x</version>\n<!-- use the same version as your Camel core version -->\n</dependency>
    \n
    \n
    \n
    \n
    \n

    URI format

    \n
    \n
    \n
    \n atom://atomUri[?options]\n

    Where atomUri is the URI to the Atom feed to poll.

    \n
    \n
    \n
    \n
    \n
    \n

    Options

    \n
    \n
    \n
    \n \n

    The Atom component has no options.

    \n

    The Atom endpoint is configured using URI syntax:

    \n
    atom:feedUri
    \n

    with the following path and query parameters:

    \n
    \n
    \n
    \n
    \n

    Path Parameters (1\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    feedUri

    \n
    \n

    Required The URI to the feed to\n poll.

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Query Parameters (27\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    bridgeErrorHandler (consumer)

    \n
    \n

    Allows for bridging the consumer to the Camel routing Error Handler, which mean\n any exceptions occurred while the consumer is trying to pickup incoming\n messages, or the likes, will now be processed as a message and handled by the\n routing Error Handler. By default the consumer will use the\n org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be\n logged at WARN or ERROR level and ignored.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    feedHeader (consumer)

    \n
    \n

    Sets whether to add the feed object as a header

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    filter (consumer)

    \n
    \n

    Sets whether to use filtering or not of the entries.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    lastUpdate (consumer)

    \n
    \n

    Sets the timestamp to be used for filtering entries from the atom feeds. This\n options is only in conjunction with the splitEntries.

    \n
     \n

    Date

    \n
    \n

    password (consumer)

    \n
    \n

    Sets the password to be used for basic authentication when polling from a HTTP\n feed

    \n
     \n

    String

    \n
    \n

    sendEmptyMessageWhenIdle (consumer)\n

    \n
    \n

    If the polling consumer did not poll any files, you can enable this option to\n send an empty message (no body) instead.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    sortEntries (consumer)

    \n
    \n

    Sets whether to sort entries by published date. Only works when splitEntries =\n true.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    splitEntries (consumer)

    \n
    \n

    Sets whether or not entries should be sent individually or whether the entire\n feed should be sent as a single message

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    throttleEntries (consumer)

    \n
    \n

    Sets whether all entries identified in a single feed poll should be delivered\n immediately. If true, only one entry is processed per consumer.delay. Only\n applicable when splitEntries = true.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    username (consumer)

    \n
    \n

    Sets the username to be used for basic authentication when polling from a HTTP\n feed

    \n
     \n

    String

    \n
    \n

    exceptionHandler (consumer)

    \n
    \n

    To let the consumer use a custom ExceptionHandler. Notice if the option\n bridgeErrorHandler is enabled then this options is not in use. By default the\n consumer will deal with exceptions, that will be logged at WARN or ERROR level\n and ignored.

    \n
     \n

    ExceptionHandler

    \n
    \n

    exchangePattern (consumer)

    \n
    \n

    Sets the exchange pattern when the consumer creates an exchange.

    \n
     \n

    ExchangePattern

    \n
    \n

    pollStrategy (consumer)

    \n
    \n

    A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to\n provide your custom implementation to control error handling usually occurred\n during the poll operation before an Exchange have been created and being routed\n in Camel.

    \n
     \n

    PollingConsumerPoll Strategy

    \n
    \n

    synchronous (advanced)

    \n
    \n

    Sets whether synchronous processing should be strictly used, or Camel is allowed\n to use asynchronous processing (if supported).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    backoffErrorThreshold (scheduler)\n

    \n
    \n

    The number of subsequent error polls (failed due some error) that should happen\n before the backoffMultipler should kick-in.

    \n
     \n

    int

    \n
    \n

    backoffIdleThreshold (scheduler)

    \n
    \n

    The number of subsequent idle polls that should happen before the\n backoffMultipler should kick-in.

    \n
     \n

    int

    \n
    \n

    backoffMultiplier (scheduler)

    \n
    \n

    To let the scheduled polling consumer backoff if there has been a number of\n subsequent idles/errors in a row. The multiplier is then the number of polls\n that will be skipped before the next actual attempt is happening again. When\n this option is in use then backoffIdleThreshold and/or backoffErrorThreshold\n must also be configured.

    \n
     \n

    int

    \n
    \n

    delay (scheduler)

    \n
    \n

    Milliseconds before the next poll. You can also specify time values using units,\n such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds), and 1h (1 hour).

    \n
    \n

    500

    \n
    \n

    long

    \n
    \n

    greedy (scheduler)

    \n
    \n

    If greedy is enabled, then the ScheduledPollConsumer will run immediately again,\n if the previous run polled 1 or more messages.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    initialDelay (scheduler)

    \n
    \n

    Milliseconds before the first poll starts. You can also specify time values using\n units, such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds), and 1h (1\n hour).

    \n
    \n

    1000

    \n
    \n

    long

    \n
    \n

    runLoggingLevel (scheduler)

    \n
    \n

    The consumer logs a start/complete log line when it polls. This option allows you\n to configure the logging level for that.

    \n
    \n

    TRACE

    \n
    \n

    LoggingLevel

    \n
    \n

    scheduledExecutorService (scheduler)\n

    \n
    \n

    Allows for configuring a custom/shared thread pool to use for the consumer. By\n default each consumer has its own single threaded thread pool.

    \n
     \n

    ScheduledExecutor Service

    \n
    \n

    scheduler (scheduler)

    \n
    \n

    To use a cron scheduler from either camel-spring or camel-quartz2 component

    \n
    \n

    none

    \n
    \n

    ScheduledPollConsumer Scheduler

    \n
    \n

    schedulerProperties (scheduler)

    \n
    \n

    To configure additional properties when using a custom scheduler or any of the\n Quartz2, Spring based scheduler.

    \n
     \n

    Map

    \n
    \n

    startScheduler (scheduler)

    \n
    \n

    Whether the scheduler should be auto started.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    timeUnit (scheduler)

    \n
    \n

    Time unit for initialDelay and delay options.

    \n
    \n

    MILLISECONDS

    \n
    \n

    TimeUnit

    \n
    \n

    useFixedDelay (scheduler)

    \n
    \n

    Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in\n JDK for details.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n
    \n

    You can append query options to the URI in the following format,\n ?option=value&option=value&…​\n

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Exchange data format\n

    \n
    \n
    \n
    \n

    Camel will set the In body on the returned Exchange with the entries.\n Depending on the splitEntries flag Camel will either return one\n Entry or a List<Entry>.\n

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    OptionValueBehavior
    \n

    splitEntries

    \n
    \n

    true

    \n
    \n

    Only a single entry from the currently being processed feed is set:\n exchange.in.body(Entry)\n

    \n
    \n

    splitEntries

    \n
    \n

    false

    \n
    \n

    The entire list of entries from the feed is set:\n exchange.in.body(List<Entry>)\n

    \n
    \n
    \n

    Camel can set the Feed object on the In header (see feedHeader\n option to disable this):

    \n
    \n
    \n
    \n
    \n
    \n

    Message Headers

    \n
    \n
    \n
    \n

    Camel atom uses these headers.

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    HeaderDescription
    \n

    CamelAtomFeed

    \n
    \n

    When consuming the org.apache.abdera.model.Feed object\n is set to this\n header.

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Samples

    \n
    \n
    \n
    \n

    In this sample we poll James Strachan’s blog.

    \n from(\"atom://http://macstrac.blogspot.com/feeds/posts/default\").to(\"seda:feeds\");\n

    In this sample we want to filter only good blogs we like to a SEDA\n queue. The sample also shows how to setup Camel standalone, not running\n in any Container or using Spring.

    \n
    \n
    \n
    \n
    \n
    \n

    See Also

    \n
    \n
    \n
    \n
    \n
      \n
    • Configuring Camel
    • \n
    • Component
    • \n
    • Endpoint
    • \n
    • Getting Started
    • \n
    • RSS
    • \n
    \n
    \n
    \n
    "; exports.default = Atom; /***/ }), /***/ "./src/camel/element/compontent/Bean.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/Bean.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Bean = function (_CamelElement) { _inherits(Bean, _CamelElement); function Bean() { _classCallCheck(this, Bean); var _this = _possibleConstructorReturn(this, (Bean.__proto__ || Object.getPrototypeOf(Bean)).call(this)); _this.scope = "Bean"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.beanType = ""; // 公共类 _this.cache = ""; // 内存 _this.description = ""; // 描述 _this.id = "bean"; // 名称 _this.method = ""; // 方法 _this.multiParameterArray = ""; //多参数数组 _this.ref = ""; // 参考 return _this; } _createClass(Bean, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#f0ab00"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawString(this.id, this.x + this.width / 4, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["beanType", "cache", "description", "id", "method", "multiParameterArray", "ref"], documentation: Bean.documentation }; } }]); return Bean; }(_CamelElement3.default); Bean.documentation = "
    \n
    \n
    \n
    \n

    Bean

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Usage
    \n
    Properties
    \n
    \n
    \n

    Binds a bean to Camel message exchanges

    \n
    \n
    \n
    \n
    \n

    Usage

    \n
    \n
    \n
    \n

    The Bean pattern can be placed anywhere in the body of a route.

    \n
    \n
    \n
    \n
    \n
    \n

    Properties

    \n
    \n
    \n
    \n

    Table 32, “Bean Properties”\n describes the properties you can specify\n using the properties editor.

    \n
    \n

    Table 32. Bean Properties

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescription
    \n

    Bean Type

    \n
    \n

    Specifies the type of the bean.

    \n
    \n

    Cache

    \n
    \n

    Specifies whether Apache Camel will cache the first Registry lookup. Default\n is disabled.

    \n

    NOTE: This property can be enabled\n only\n if the bean in the Registry is defined with a singleton\n scope.

    \n
    \n

    Description

    \n
    \n

    Specifies a text description for the node. This description is included in the\n generated XML file, but it is informational only. It is not used by Apache\n Camel.

    \n
    \n

    Id

    \n
    \n

    Specifies a unique identifier for the endpoint.

    \n

    The tooling automatically generates an id for a node when it is\n created, but you can remove that id or replace it with your own.\n The Camel debugger requires all nodes with a breakpoint set to have\n a unique id.

    \n

    You can use the id to refer to endpoints in your Camel XML\n file.

    \n
    \n

    Method

    \n
    \n

    Specifies the method to invoke on the bean. If no value is provided Apache Camel\n will attempt to determine the method to invoke. If no method can be determined a\n AmbiguousMethodCallException exception is\n thrown.

    \n
    \n

    Multi Parameter Array

    \n
    \n

    Specifies whether to treat the parameters passed in the In message body as an\n array of parameters. Default is\n disabled.\n

    \n
    \n

    Ref

    \n
    \n

    Sets a reference to a bean to use.

    \n
    \n
    \n

    \n

    For more information, see Bean\n Component.

    \n
    \n
    "; exports.default = Bean; /***/ }), /***/ "./src/camel/element/compontent/CXF.js": /*!*********************************************!*\ !*** ./src/camel/element/compontent/CXF.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var CXF = function (_CamelElement) { _inherits(CXF, _CamelElement); function CXF() { _classCallCheck(this, CXF); var _this = _possibleConstructorReturn(this, (CXF.__proto__ || Object.getPrototypeOf(CXF)).call(this)); _this.scope = "CXF"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "_cxf"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.address = "address"; _this.beanId = "beanId"; _this.uri = "cxf:" + _this.beanId + ":" + _this.address; // uri _this.dataFormat = "POJO"; _this.wrappedStyle = false; _this.bindingId = ""; _this.portName = ""; _this.publishedEndpointUrl = ""; _this.serviceClass = ""; _this.serviceName = ""; _this.wsdlURL = ""; _this.bridgeErrorHandler = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.cookieHandler = ""; _this.defaultOperationName = ""; _this.defaultOperationNamespace = ""; _this.hostnameVerifier = ""; _this.sslContextParameters = ""; _this.wrapped = false; _this.allowStreaming = ""; _this.bus = ""; _this.continuationTimeout = 30000; _this.cxfBinding = ""; _this.cxfEndpointConfigurer = ""; _this.defaultBus = false; _this.headerFilterStrategy = ""; _this.mergeProtocolHeaders = false; _this.mtomEnabled = false; _this.properties = ""; _this.skipPayloadMessagePartCheck = false; _this.synchronous = false; _this.loggingFeatureEnabled = false; _this.loggingSizeLimit = 49152; _this.skipFaultLogging = false; _this.password = ""; _this.username = ""; return _this; } _createClass(CXF, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#c8eb79"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "name", "ref_deprecated"], advanced: { path: ["address", "beanId"], common: ["dataFormat", "wrappedStyle"], service: ["bindingId", "portName", "publishedEndpointUrl", "serviceClass", "serviceName", "wsdlURL"], consumer: ["bridgeErrorHandler"], consumer_advanced: ["exceptionHandler", "exchangePattern"], producer: ["cookieHandler", "defaultOperationName", "defaultOperationNamespace", "hostnameVerifier", "sslContextParameters", "wrapped"], advanceds: ["allowStreaming", "bus", "continuationTimeout", "cxfBinding", "cxfEndpointConfigurer", "defaultBus", "headerFilterStrategy", "mergeProtocolHeaders", "mtomEnabled", "properties", "skipPayloadMessagePartCheck", "synchronous"], logging: ["loggingFeatureEnabled", "loggingSizeLimit", "skipFaultLogging"], security: ["password", "username"] }, documentation: CXF.documentation }; } }]); return CXF; }(_CamelElement3.default); CXF.documentation = "
    \n
    \n
    \n
    \n

    CXF

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    CXF consumers on\n {wildfly}
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    CXF Component

    \n
    \n
    \n
    \n

    The cxf: component provides integration with Apache CXF for connecting to\n JAX-WS services hosted in CXF.

    \n

    Maven users will need to add the following dependency to their\n pom.xml for this component:\n

    \n
    <dependency>\n<groupId>org.apache.camel</groupId>\n<artifactId>camel-cxf</artifactId>\n<version>x.x.x</version>\n<!-- use the same version as your Camel core version -->\n</dependency>
    \n
    \n \n \n \n \n \n \n \n \n
    \"[Note]\"\nNote
    \n

    If you want to learn about CXF dependencies, see the WHICH-JARS\n text file.

    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n
    \"[Note]\"\nNote
    \n

    When using CXF in streaming modes (see DataFormat option), then also read about Stream\n caching.

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Camel on EAP\n deployment

    \n
    \n
    \n
    \n

    This component is supported by the Camel on EAP (Wildfly Camel) framework, which\n offers a simplified deployment model on the Red Hat JBoss Enterprise Application Platform (JBoss EAP)\n container.

    \n

    The CXF component integrates with the JBoss EAP webservices susbsystem\n that also uses Apache CXF. For more information, see JAX-WS.

    \n
    \n \n \n \n \n \n \n \n \n
    \"[Note]\"\nNote
    \n

    At present, the Camel on EAP subsystem does not support CXF\n or Restlet consumers. However, it is possible to mimic CXF consumer behaviour, using\n the CamelProxy.

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    URI format

    \n
    \n
    \n
    \n
    cxf:bean:cxfEndpoint[?options]
    \n

    Where cxfEndpoint represents a bean ID that\n references a bean in the Spring bean registry. With this URI format, most of the\n endpoint details are specified in the bean definition.

    \n
    cxf://someAddress[?options]
    \n

    Where someAddress specifies the CXF endpoint’s\n address. With this URI format, most of the endpoint details are specified using\n options.

    \n

    For either style above, you can append options to the URI as follows:

    \n
    cxf:bean:cxfEndpoint?wsdlURL=wsdl/hello_world.wsdl&dataFormat=PAYLOAD
    \n
    \n
    \n
    \n
    \n
    \n

    Options

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n

    Name

    \n
    \n

    Required

    \n
    \n

    Description

    \n
    \n

    wsdlURL

    \n
    \n

    No

    \n
    \n

    The location of the WSDL. WSDL is obtained from endpoint address by\n default. For example:

    \n

    file://local/wsdl/hello.wsdl\n or\n wsdl/hello.wsdl\n

    \n
    \n

    serviceClass

    \n
    \n

    Yes

    \n
    \n

    The name of the SEI (Service Endpoint Interface) class. This class can\n have, but does not require, JSR181 annotations. \n Since 2.0, this option is only required\n by\n POJO mode. If the wsdlURL option is provided, serviceClass is not required\n for PAYLOAD and MESSAGE mode. When wsdlURL option is used without\n serviceClass, the serviceName and portName (endpointName for Spring\n configuration) options MUST be\n provided.\n

    \n

    Since 2.0, it is possible to use # notation to\n reference a\n serviceClass object instance from the registry..\n

    \n

    Please be advised that the referenced object cannot\n be a Proxy (Spring AOP Proxy is OK) as it relies on\n Object.getClass().getName() method for non Spring AOP\n Proxy.\n

    \n

    Since 2.8, it is possible\n to omit both wsdlURL and serviceClass options for PAYLOAD and MESSAGE mode.\n When they are omitted, arbitrary XML elements can be put in CxfPayload’s\n body in PAYLOAD mode to facilitate CXF Dispatch Mode.

    \n

    For example: org.apache.camel.Hello

    \n
    \n

    serviceName

    \n
    \n

    Only if more than one serviceName present in WSDL

    \n
    \n

    The service name this service is implementing, it maps to the\n wsdl:service@name. For example:\n

    \n

    {http://org.apache.camel}ServiceName

    \n
    \n

    endpointName

    \n
    \n

    Only if more than one portName under the\n serviceName is present, and it is required for\n camel-cxf\n consumer since camel 2.2\n

    \n
    \n

    The port name this service is implementing, it maps to the\n wsdl:port@name. For example:\n

    \n

    {http://org.apache.camel}PortName

    \n
    \n

    dataFormat

    \n
    \n

    No

    \n
    \n

    Which message data format the CXF endpoint supports. Possible values are:\n POJO\n (default), PAYLOAD,\n MESSAGE.\n

    \n
    \n

    relayHeaders

    \n
    \n

    No

    \n
    \n

    Please see the Description\n ofrelayHeadersoption\n section for this option. Should a CXF endpoint relay headers along the route.\n Currently\n only available when dataFormat=POJODefault:\n trueExample: true,\n false\n

    \n
    \n

    wrapped

    \n
    \n

    No

    \n
    \n

    Which kind of operation the CXF endpoint producer will invoke. Possible values\n are: true, false\n (default).\n

    \n
    \n

    wrappedStyle

    \n
    \n

    No

    \n
    \n

    Since 2.5.0 The WSDL style that\n describes how\n parameters are represented in the SOAP body. If the value is false,\n CXF will chose the document-literal unwrapped style, If the value is\n true, CXF will chose the document-literal wrapped style\n

    \n
    \n

    setDefaultBus

    \n
    \n

    No

    \n
    \n

    Deprecated: Specifies whether or not to\n use the\n default CXF bus for this endpoint. Possible values are: true,\n false\n (default). This option is deprecated\n and you should use\n defaultBus from Camel 2.16 onwards.\n

    \n
    \n

    defaultBus

    \n
    \n

    No

    \n
    \n

    Deprecated: Specifies whether or not to\n use the\n default CXF bus for this endpoint. Possible values are: true,\n false\n (default). This option is deprecated\n and you should use\n defaultBus from Camel 2.16 onwards.\n

    \n
    \n

    bus

    \n
    \n

    No

    \n
    \n

    Use # notation to reference a bus\n object from the registry — for example,\n bus=#busName. The\n referenced object must be an instance of\n org.apache.cxf.Bus.\n

    \n

    By default, uses the default bus created by CXF Bus Factory.

    \n
    \n

    cxfBinding

    \n
    \n

    No

    \n
    \n

    Use # notation to reference a CXF\n binding object from the registry — for example,\n cxfBinding=#bindingName.\n The referenced object must be an instance of\n org.apache.camel.component.cxf.CxfBinding.\n

    \n
    \n

    headerFilterStrategy

    \n
    \n

    No

    \n
    \n

    Use # notation to reference a header\n filter strategy object from the registry — for example,\n headerFilterStrategy=#strategyName. The referenced\n object\n must be an instance of\n org.apache.camel.spi.HeaderFilterStrategy.\n

    \n
    \n

    loggingFeatureEnabled

    \n
    \n

    No

    \n
    \n

    New in 2.3, this option enables CXF Logging Feature which writes inbound and\n outbound SOAP messages to log. Possible values are: true,\n false\n (default).\n

    \n
    \n

    defaultOperationName

    \n
    \n

    No

    \n
    \n

    New in 2.4, this option will set the default operationName\n that will be used by the CxfProducer that invokes the\n remote\n service. For example:

    \n

    defaultOperationName=greetMe

    \n
    \n

    defaultOperationNamespace

    \n
    \n

    No

    \n
    \n

    New in 2.4, this option will set the default operationNamespace that will\n be used by the CxfProducer which invokes the remote service. For\n example:

    \n

    defaultOperationNamespace=http://apache.org/hello_world_soap_http\n

    \n
    \n

    synchronous

    \n
    \n

    No

    \n
    \n

    New in 2.5, this option will let CXF endpoint decide to use sync or async API to\n do the underlying work. The default value is false,\n which means\n camel-cxf endpoint will try to use async API by\n default.\n

    \n
    \n

    publishedEndpointUrl

    \n
    \n

    No

    \n
    \n

    New in 2.5, this option overrides the endpoint URL that appears in the\n published WSDL that is accessed using the service address URL plus\n ?wsdl. For example:\n

    \n

    publshedEndpointUrl=http://example.com/service

    \n
    \n

    properties.propName

    \n
    \n

    No

    \n
    \n

    Camel 2.8: Allows you to set custom CXF\n properties in the endpoint URI. For example, setting\n properties.mtom-enabled=true to enable MTOM. To make\n sure\n that CXF does not switch the thread when starting the invocation, you can set\n properties.org.apache.cxf.interceptor.OneWayProcessorInterceptor.USE_ORIGINAL_THREAD=true.\n

    \n
    \n

    allowStreaming

    \n
    \n

    No

    \n
    \n

    New in 2.8.2. This option controls whether the CXF component, when running in PAYLOAD\n mode (see below), will DOM parse the incoming messages into DOM Elements or keep the\n payload as a javax.xml.transform.Source object that would allow streaming in some\n cases.

    \n
    \n

    skipFaultLogging

    \n
    \n

    No

    \n
    \n

    New in 2.11. This option controls whether the PhaseInterceptorChain skips logging the\n Fault that it catches.

    \n
    \n

    cxfEndpointConfigurer

    \n
    \n

    No

    \n
    \n

    New in Camel 2.11. This option\n could apply the implementation of\n org.apache.camel.component.cxf.CxfEndpointConfigurer which\n supports to configure the CXF endpoint in programmatic way.\n Since Camel 2.15.0, user can\n configure the CXF server and client by implementing\n configure{Server/Client} method of\n CxfEndpointConfigurer.\n

    \n
    \n

    username

    \n
    \n

    No

    \n
    \n

    New in Camel 2.12.3 This option\n is used to set the basic authentication information of username for\n the CXF client.

    \n
    \n

    password

    \n
    \n

    No

    \n
    \n

    New in Camel 2.12.3 This option\n is used to set the basic authentication information of password for\n the CXF client.

    \n
    \n

    continuationTimeout

    \n
    \n

    No

    \n
    \n

    New in Camel 2.14.0 This option\n is used to set the CXF continuation timeout which could be used in\n CxfConsumer by default when the CXF server is using Jetty or Servlet\n transport. (Before Camel 2.14.0,\n CxfConsumer just set the continuation timeout to be 0, which means\n the continuation suspend operation never timeout.)

    \n

    Default: 30000 Example: continuation=80000

    \n
    \n
    \n

    The serviceName and portName are QNames, so if you provide\n them\n be sure to prefix them with their {namespace} as shown in the\n examples above.

    \n
    \n
    \n
    \n
    \n
    \n

    The descriptions of the\n dataformats

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n

    DataFormat

    \n
    \n

    Description

    \n
    \n

    POJO

    \n
    \n

    POJOs (plain old Java objects) are the Java parameters to the method being\n invoked on the target server. Both Protocol and Logical JAX-WS handlers are\n supported.

    \n
    \n

    PAYLOAD

    \n
    \n

    PAYLOAD is the message payload (the contents of the\n soap:body) after message configuration in the CXF\n endpoint is applied. Only Protocol JAX-WS handler is supported. Logical JAX-WS\n handler is not supported.\n

    \n
    \n

    MESSAGE

    \n
    \n

    MESSAGE is the raw message that is received from the\n transport layer. It is not suppose to touch or change Stream, some of the CXF\n interceptors will be removed if you are using this kind of DataFormat so you\n can’t see any soap headers after the camel-cxf consumer and JAX-WS handler is\n not supported.

    \n
    \n

    CXF_MESSAGE

    \n
    \n

    New in Camel 2.8.2, CXF_MESSAGE allows for invoking the full capabilities of\n CXF interceptors by converting the message from the transport layer into a raw SOAP\n message

    \n
    \n
    \n

    You can determine the data format mode of an exchange by retrieving the exchange\n property, CamelCXFDataFormat. The exchange key constant is defined in\n org.apache.camel.component.cxf.CxfConstants.DATA_FORMAT_PROPERTY.\n

    \n
    \n
    \n
    \n
    \n
    \n

    Configuring\n the CXF Endpoints with Apache Aries Blueprint.

    \n
    \n
    \n
    \n

    Since Camel 2.8, there is support for using Aries blueprint dependency injection for\n your CXF endpoints. The schema is very similar to the Spring schema, so the transition\n is fairly transparent.

    \n

    For example:

    \n
     <blueprint xmlns=\"http://www.osgi.org/xmlns/blueprint/v1.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xmlns:cm=\"http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0\"\n  xmlns:camel-cxf=\"http://camel.apache.org/schema/blueprint/cxf\"\nxmlns:cxfcore=\"http://cxf.apache.org/blueprint/core\"\n  xsi:schemaLocation=\"http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd\">\n\n<camel-cxf:cxfEndpoint id=\"routerEndpoint\"\n            address=\"http://localhost:9001/router\"\n            serviceClass=\"org.apache.servicemix.examples.cxf.HelloWorld\">\n<camel-cxf:properties>\n   <entry key=\"dataFormat\" value=\"MESSAGE\"/>\n</camel-cxf:properties>\n</camel-cxf:cxfEndpoint>\n\n<camel-cxf:cxfEndpoint id=\"serviceEndpoint\"\n  address=\"http://localhost:9000/SoapContext/SoapPort\"\n           serviceClass=\"org.apache.servicemix.examples.cxf.HelloWorld\">\n</camel-cxf:cxfEndpoint>\n\n<camelContext xmlns=\"http://camel.apache.org/schema/blueprint\">\n<route>\n  <from uri=\"routerEndpoint\"/>\n  <to uri=\"log:request\"/>\n</route>\n</camelContext>\n\n</blueprint>
    \n

    Currently the endpoint element is the first supported CXF namespacehandler.

    \n

    You can also use the bean references just as in spring

    \n
    <blueprint xmlns=\"http://www.osgi.org/xmlns/blueprint/v1.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns:cm=\"http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0\"\n xmlns:jaxws=\"http://cxf.apache.org/blueprint/jaxws\"\n xmlns:cxf=\"http://cxf.apache.org/blueprint/core\"\n xmlns:camel=\"http://camel.apache.org/schema/blueprint\"\n xmlns:camelcxf=\"http://camel.apache.org/schema/blueprint/cxf\"\n xsi:schemaLocation=\"\n   http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd\n   http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd\n   http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd\n   \">\n\n<camelcxf:cxfEndpoint id=\"reportIncident\"\n           address=\"/camel-example-cxf-blueprint/webservices/incident\"\n           wsdlURL=\"META-INF/wsdl/report_incident.wsdl\"\n           serviceClass=\"org.apache.camel.example.reportincident.ReportIncidentEndpoint\">\n</camelcxf:cxfEndpoint>\n\n<bean id=\"reportIncidentRoutes\" class=\"org.apache.camel.example.reportincident.ReportIncidentRoutes\" />\n\n<camelContext xmlns=\"http://camel.apache.org/schema/blueprint\">\n<routeBuilder ref=\"reportIncidentRoutes\"/>\n</camelContext>\n\n</blueprint>
    \n
    \n
    \n
    \n
    \n
    \n

    How to enable\n CXF’s LoggingOutInterceptor in MESSAGE mode

    \n
    \n
    \n
    \n

    CXF’s LoggingOutInterceptor outputs outbound message that goes on\n the wire to logging system (java.util.logging). Since the\n LoggingOutInterceptor is in PRE_STREAM phase\n (but PRE_STREAM phase is removed in MESSAGE\n mode),\n you have to configure LoggingOutInterceptor to be run during the\n WRITE phase. The following is an example.\n

    \n
       <bean id=\"loggingOutInterceptor\" class=\"org.apache.cxf.interceptor.LoggingOutInterceptor\">\n<!--  it really should have been user-prestream but CXF does have such phase! -->\n<constructor-arg value=\"target/write\"/>\n</bean>\n\n<cxf:cxfEndpoint id=\"serviceEndpoint\" address=\"http://localhost:9002/helloworld\"\nserviceClass=\"org.apache.camel.component.cxf.HelloService\">\n<cxf:outInterceptors>\n<ref bean=\"loggingOutInterceptor\"/>\n</cxf:outInterceptors>\n<cxf:properties>\n<entry key=\"dataFormat\" value=\"MESSAGE\"/>\n</cxf:properties>\n</cxf:cxfEndpoint>
    \n
    \n
    \n
    \n
    \n
    \n

    Description of relayHeaders\n option

    \n
    \n
    \n
    \n

    There are in-band and out-of-band\n on-the-wire headers from the perspective of a JAXWS WSDL-first developer.

    \n

    The in-band headers are headers that are explicitly defined\n as\n part of the WSDL binding contract for an endpoint such as SOAP headers.

    \n

    The out-of-band headers are headers that are serialized over\n the\n wire, but are not explicitly part of the WSDL binding contract.

    \n

    Headers relaying/filtering is bi-directional.

    \n

    When a route has a CXF endpoint and the developer needs to have on-the-wire headers,\n such as SOAP headers, be relayed along the route to be consumed say by another JAXWS\n endpoint, then relayHeaders should be set to true,\n which is the default value.

    \n
    \n
    \n
    \n
    \n
    \n

    Available only in\n POJO mode

    \n
    \n
    \n
    \n

    The relayHeaders=true setting expresses an intent to relay the\n headers. The actual decision on whether a given header is relayed is delegated to a\n pluggable instance that implements the MessageHeadersRelay interface.\n A concrete implementation of MessageHeadersRelay will be consulted to\n decide if a header needs to be relayed or not. There is already an implementation of\n SoapMessageHeadersRelay which binds itself to well-known SOAP\n name spaces. Currently only out-of-band headers are filtered, and in-band headers will\n always be relayed when relayHeaders=true. If there is a header on the\n wire, whose name space is unknown to the runtime, then a fall back\n DefaultMessageHeadersRelay will be used, which simply allows all\n headers to be relayed.\n

    \n

    The relayHeaders=false setting asserts that all headers, in-band\n and out-of-band, will be dropped.

    \n

    You can plugin your own MessageHeadersRelay implementations\n overriding or adding additional ones to the list of relays. In order to override a\n preloaded relay instance just make sure that your MessageHeadersRelay\n implementation services the same name spaces as the one you looking to override. Also\n note, that the overriding relay has to service all of the name spaces as the one you\n looking to override, or else a runtime exception on route start up will be thrown as\n this would introduce an ambiguity in name spaces to relay instance mappings.

    \n
    <cxf:cxfEndpoint ...>\n<cxf:properties>\n<entry key=\"org.apache.camel.cxf.message.headers.relays\">\n<list>\n<ref bean=\"customHeadersRelay\"/>\n</list>\n</entry>\n</cxf:properties>\n</cxf:cxfEndpoint>\n<bean id=\"customHeadersRelay\" class=\"org.apache.camel.component.cxf.soap.headers.CustomHeadersRelay\"/>
    \n

    Take a look at the tests that show how you’d be able to relay/drop headers\n here:

    \n

    \n link:https://svn.apache.org/repos/asf/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/soap/headers/CxfMessageHeadersRelayTest.java[https://svn.apache.org/repos/asf/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/soap/headers/CxfMessageHeadersRelayTest.java\n ]

    \n
    \n
    \n
    \n
    \n
    \n

    Changes\n since Release 2.0

    \n
    \n
    \n
    \n
    \n
      \n
    • POJO and PAYLOAD\n modes are supported. In\n POJO mode, only out-of-band message headers are available\n for filtering as the in-band headers have been processed and removed from the\n header list by CXF. The in-band headers are incorporated into the\n MessageContentList in POJO mode. The\n camel-cxf component does make any attempt to remove the\n in-band headers from the MessageContentList\n If filtering of in-band headers is required, please use\n PAYLOAD mode or plug in a (pretty straightforward) CXF\n interceptor/JAXWS Handler to the CXF endpoint.\n
    • \n
    • \n

      The Message Header Relay mechanism has been merged into CxfHeaderFilterStrategy. The relayHeaders option, its semantics, and default value remain the\n same, but it is a property of CxfHeaderFilterStrategy.\n Here is an example of configuring it.

      \n
      <bean id=\"dropAllMessageHeadersStrategy\" class=\"org.apache.camel.component.cxf.common.header.CxfHeaderFilterStrategy\">\n\n<!--  Set relayHeaders to false to drop all SOAP headers -->\n<property name=\"relayHeaders\" value=\"false\"/>\n\n</bean>
      \n

      Then, your endpoint can reference the CxfHeaderFilterStrategy.

      \n
      <route>\n<from uri=\"cxf:bean:routerNoRelayEndpoint?headerFilterStrategy=#dropAllMessageHeadersStrategy\"/>\n<to uri=\"cxf:bean:serviceNoRelayEndpoint?headerFilterStrategy=#dropAllMessageHeadersStrategy\"/>\n</route>
      \n
    • \n
    • \n

      The MessageHeadersRelay interface has changed\n slightly and has been renamed to MessageHeaderFilter. It is a\n property of CxfHeaderFilterStrategy. Here is an example of\n configuring user defined Message Header Filters:

      \n
      <bean id=\"customMessageFilterStrategy\" class=\"org.apache.camel.component.cxf.common.header.CxfHeaderFilterStrategy\">\n<property name=\"messageHeaderFilters\">\n<list>\n  <!--  SoapMessageHeaderFilter is the built in filter.  It can be removed by omitting it. -->\n  <bean class=\"org.apache.camel.component.cxf.common.header.SoapMessageHeaderFilter\"/>\n\n  <!--  Add custom filter here -->\n  <bean class=\"org.apache.camel.component.cxf.soap.headers.CustomHeaderFilter\"/>\n</list>\n</property>\n</bean>
      \n
    • \n
    • Other than relayHeaders, there are new properties\n that can\n be configured in CxfHeaderFilterStrategy.
    • \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n

    Name

    \n
    \n

    Description

    \n
    \n

    type

    \n
    \n

    Required?

    \n
    \n

    Default value

    \n
    \n

    relayHeaders

    \n
    \n

    All message headers will be processed by Message Header Filters

    \n
    \n

    boolean

    \n
    \n

    No

    \n
    \n

    true (1.6.1 behavior)

    \n
    \n

    relayAllMessageHeaders

    \n
    \n

    All message headers will be propagated (without processing by Message Header\n Filters)

    \n
    \n

    boolean

    \n
    \n

    No

    \n
    \n

    false (1.6.1 behavior)

    \n
    \n

    allowFilterNamespaceClash

    \n
    \n

    If two filters overlap in activation namespace, the property control how it\n should be handled. If the value is true, last one wins.\n If\n the value is false, it will throw an exception

    \n
    \n

    boolean

    \n
    \n

    No

    \n
    \n

    false (1.6.1 behavior)

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Configure the CXF endpoints\n with Spring

    \n
    \n
    \n
    \n

    You can configure the CXF endpoint with the Spring configuration file shown below, and\n you can also embed the endpoint into the camelContext tags. When you\n are invoking the service endpoint, you can set the operationName and\n operationNamespace headers to explicitly state which operation\n you are calling.\n

    \n

    NOTE In Camel 2.x we change to use\n http://camel.apache.org/schema/cxf\n as the CXF endpoint’s target\n namespace.\n

    \n
    <beans xmlns=\"http://www.springframework.org/schema/beans\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxmlns:cxf=\"http://camel.apache.org/schema/cxf\"\nxsi:schemaLocation=\"\nhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd\nhttp://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd\nhttp://camel.apache.org/schema/spring https://camel.apache.org/schema/spring/camel-spring.xsd     \">\n...
    \n
    \n \n \n \n \n \n \n \n \n
    \"[Note]\"\nNote
    \n

    In Apache Camel 2.x, the\n http://activemq.apache.org/camel/schema/cxfEndpoint\n namespace was\n changed to http://camel.apache.org/schema/cxf.\n

    \n
    \n
    \n

    Be sure to include the JAX-WS schemaLocation attribute specified on\n the root beans element. This allows CXF to validate the file and is required. Also note\n the namespace declarations at the end of the <cxf:cxfEndpoint/>\n tag—​these are required because the combined {namespace}localName syntax is\n presently not supported for this tag’s attribute values.

    \n

    The cxf:cxfEndpoint element supports many additional\n attributes:

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n

    Name

    \n
    \n

    Value

    \n
    \n

    PortName

    \n
    \n

    The endpoint name this service is implementing, it maps to the\n wsdl:port@name. In the format of\n ns:PORT_NAME where ns is a\n namespace\n prefix valid at this scope.\n

    \n
    \n

    serviceName

    \n
    \n

    The service name this service is implementing, it maps to the\n wsdl:service@name. In the format of\n ns:SERVICE_NAME where ns\n is a\n namespace prefix valid at this scope.\n

    \n
    \n

    wsdlURL

    \n
    \n

    The location of the WSDL. Can be on the classpath, file system, or be hosted\n remotely.

    \n
    \n

    bindingId

    \n
    \n

    The bindingId for the service model to use.

    \n
    \n

    address

    \n
    \n

    The service publish address.

    \n
    \n

    bus

    \n
    \n

    The bus name that will be used in the JAX-WS endpoint.

    \n
    \n

    serviceClass

    \n
    \n

    The class name of the SEI (Service Endpoint Interface) class which could have\n JSR181 annotation or not.

    \n
    \n
    \n

    It also supports many child elements:

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n

    Name

    \n
    \n

    Value

    \n
    \n

    cxf:inInterceptors

    \n
    \n

    The incoming interceptors for this endpoint. A list of\n <bean> or <ref>.\n

    \n
    \n

    cxf:inFaultInterceptors

    \n
    \n

    The incoming fault interceptors for this endpoint. A list of\n <bean> or <ref>.\n

    \n
    \n

    cxf:outInterceptors

    \n
    \n

    The outgoing interceptors for this endpoint. A list of\n <bean> or <ref>.\n

    \n
    \n

    cxf:outFaultInterceptors

    \n
    \n

    The outgoing fault interceptors for this endpoint. A list of\n <bean> or <ref>.\n

    \n
    \n

    cxf:properties

    \n
    \n

    A properties map which should be supplied to the JAX-WS endpoint. See below.

    \n
    \n

    cxf:handlers

    \n
    \n

    A JAX-WS handler list which should be supplied to the JAX-WS endpoint. See\n below.

    \n
    \n

    cxf:dataBinding

    \n
    \n

    You can specify the which DataBinding will be use in the\n endpoint. This can be supplied using the Spring <bean\n class=\"MyDataBinding\"/> syntax.

    \n
    \n

    cxf:binding

    \n
    \n

    You can specify the BindingFactory for this endpoint to\n use.\n This can be supplied using the Spring <bean\n class=\"MyBindingFactory\"/> syntax.

    \n
    \n

    cxf:features

    \n
    \n

    The features that hold the interceptors for this endpoint. A list of\n <bean>s or <ref>s\n

    \n
    \n

    cxf:schemaLocations

    \n
    \n

    The schema locations for endpoint to use. A list of\n <schemaLocation>s\n

    \n
    \n

    cxf:serviceFactory

    \n
    \n

    The service factory for this endpoint to use. This can be supplied using the\n Spring <bean class=\"MyServiceFactory\"/> syntax\n

    \n
    \n
    \n

    You can find more advanced examples which show how to provide interceptors, properties\n and handlers here: http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html

    \n
    \n \n \n \n \n \n \n \n \n
    \"[Note]\"\nNote
    \n

    You can use CXF:properties to set the CXF endpoint’s dataFormat and\n setDefaultBus properties from a Spring configuration file,\n as\n follows:\n

    \n
    <cxf:cxfEndpoint id=\"testEndpoint\" address=\"http://localhost:9000/router\"\nserviceClass=\"org.apache.camel.component.cxf.HelloService\"\nendpointName=\"s:PortName\"\nserviceName=\"s:ServiceName\"\nxmlns:s=\"http://www.example.com/test\">\n<cxf:properties>\n<entry key=\"dataFormat\" value=\"MESSAGE\"/>\n<entry key=\"setDefaultBus\" value=\"true\"/>\n</cxf:properties>\n</cxf:cxfEndpoint>
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    How\n to make the camel-cxf component use log4j instead of java.util.logging

    \n
    \n
    \n
    \n

    CXF’s default logger is java.util.logging. If you want to change it\n to log4j, proceed as follows. Create a file, in the classpath, named\n META-INF/cxf/org.apache.cxf.logger. This file should contain the\n fully-qualified name of the class,\n org.apache.cxf.common.logging.Log4jLogger, with no comments, on a\n single line.\n

    \n
    \n
    \n
    \n
    \n
    \n

    How to let\n camel-cxf response message with xml start document

    \n
    \n
    \n
    \n

    If you are using some SOAP client such as PHP, you will get this kind of error,\n because CXF doesn’t add the XML start document <?xml version=\"1.0\"\nencoding=\"utf-8\"?>.

    \n Error:sendSms: SoapFault exception: [Client] looks like we got no XML document in [...]\n

    To resolved this issue, you just need to tell StaxOutInterceptor to write the XML\n start document for you.

    \n
    public class WriteXmlDeclarationInterceptor extends AbstractPhaseInterceptor<SoapMessage> {\npublic WriteXmlDeclarationInterceptor() {\nsuper(Phase.PRE_STREAM);\naddBefore(StaxOutInterceptor.class.getName());\n}\n\npublic void handleMessage(SoapMessage message) throws Fault {\nmessage.put(\"org.apache.cxf.stax.force-start-document\", Boolean.TRUE);\n}\n\n}
    \n

    You can add a customer interceptor like this and configure it into you\n camel-cxf endpont\n

    \n
    <cxf:cxfEndpoint id=\"routerEndpoint\" address=\"http://localhost:{CXFTestSupport.port2}/CXFGreeterRouterTest/CamelContext/RouterPort\"\nserviceClass=\"org.apache.hello_world_soap_http.GreeterImpl\"\nskipFaultLogging=\"true\">\n<cxf:outInterceptors>\n<!-- This interceptor will force the CXF server send the XML start document to client -->\n<bean class=\"org.apache.camel.component.cxf.WriteXmlDeclarationInterceptor\"/>\n</cxf:outInterceptors>\n<cxf:properties>\n<!-- Set the publishedEndpointUrl which could override the service address from generated WSDL as you want -->\n<entry key=\"publishedEndpointUrl\" value=\"http://www.simple.com/services/test\" />\n</cxf:properties>\n</cxf:cxfEndpoint>
    \n

    Or adding a message header for it like this if you are using Camel\n 2.4.

    \n
     // set up the response context which force start document\nMap<String, Object> map = new HashMap<String, Object>();\nmap.put(\"org.apache.cxf.stax.force-start-document\", Boolean.TRUE);\nexchange.getOut().setHeader(Client.RESPONSE_CONTEXT, map);
    \n
    \n
    \n
    \n
    \n
    \n

    How to\n consume a message from a camel-cxf endpoint in POJO data format

    \n
    \n
    \n
    \n

    The camel-cxf endpoint consumer POJO data\n format is\n based on the cxf\n invoker, so the message header has a property with the name of\n CxfConstants.OPERATION_NAME and the message body is a list of the\n SEI method parameters.\n

    \n
    public class PersonProcessor implements Processor {\n\nprivate static final transient Logger LOG = LoggerFactory.getLogger(PersonProcessor.class);\n\n@SuppressWarnings(\"unchecked\")\npublic void process(Exchange exchange) throws Exception {\nLOG.info(\"processing exchange in camel\");\n\nBindingOperationInfo boi = (BindingOperationInfo)exchange.getProperty(BindingOperationInfo.class.toString());\nif (boi != null) {\n  LOG.info(\"boi.isUnwrapped\" + boi.isUnwrapped());\n}\n// Get the parameters list which element is the holder.\nMessageContentsList msgList = (MessageContentsList)exchange.getIn().getBody();\nHolder<String> personId = (Holder<String>)msgList.get(0);\nHolder<String> ssn = (Holder<String>)msgList.get(1);\nHolder<String> name = (Holder<String>)msgList.get(2);\n\nif (personId.value == null || personId.value.length() == 0) {\n  LOG.info(\"person id 123, so throwing exception\");\n  // Try to throw out the soap fault message\n  org.apache.camel.wsdl_first.types.UnknownPersonFault personFault =\n      new org.apache.camel.wsdl_first.types.UnknownPersonFault();\n  personFault.setPersonId(\"\");\n  org.apache.camel.wsdl_first.UnknownPersonFault fault =\n      new org.apache.camel.wsdl_first.UnknownPersonFault(\"Get the null value of person name\", personFault);\n  // Since camel has its own exception handler framework, we can't throw the exception to trigger it\n  // We just set the fault message in the exchange for camel-cxf component handling and return\n  exchange.getOut().setFault(true);\n  exchange.getOut().setBody(fault);\n  return;\n}\n\nname.value = \"Bonjour\";\nssn.value = \"123\";\nLOG.info(\"setting Bonjour as the response\");\n// Set the response message, first element is the return value of the operation,\n// the others are the holders of method parameters\nexchange.getOut().setBody(new Object[] {null, personId, ssn, name});\n}\n\n}
    \n
    \n
    \n
    \n
    \n
    \n

    How\n to prepare the message for the camel-cxf endpoint in POJO data format

    \n
    \n
    \n
    \n

    The camel-cxf endpoint producer is based on the cxf client API. First you need to specify the operation name in the message\n header, then add the method parameters to a list, and initialize the message with this\n parameter list. The response message’s body is a messageContentsList,\n you\n can get the result from that list.

    \n

    If you don’t specify the operation name in the message header,\n CxfProducer will try to use the defaultOperationName from\n CxfEndpoint. If there is no defaultOperationName set on\n CxfEndpoint, it will pick up the first operation name from the\n operation list.\n

    \n

    If you want to get the object array from the message body, you can get the body\n using message.getbody(Object[].class), as follows:

    \n
    Exchange senderExchange = new DefaultExchange(context, ExchangePattern.InOut);\nfinal List<String> params = new ArrayList<String>();\n// Prepare the request message for the camel-cxf procedure\nparams.add(TEST_MESSAGE);\nsenderExchange.getIn().setBody(params);\nsenderExchange.getIn().setHeader(CxfConstants.OPERATION_NAME, ECHO_OPERATION);\n\nExchange exchange = template.send(\"direct:EndpointA\", senderExchange);\n\norg.apache.camel.Message out = exchange.getOut();\n// The response message's body is an MessageContentsList which first element is the return value of the operation,\n// If there are some holder parameters, the holder parameter will be filled in the reset of List.\n// The result will be extract from the MessageContentsList with the String class type\nMessageContentsList result = (MessageContentsList)out.getBody();\nLOG.info(\"Received output text: \" + result.get(0));\nMap<String, Object> responseContext = CastUtils.cast((Map<?, ?>)out.getHeader(Client.RESPONSE_CONTEXT));\nassertNotNull(responseContext);\nassertEquals(\"We should get the response context here\", \"UTF-8\", responseContext.get(org.apache.cxf.message.Message.ENCODING));\nassertEquals(\"Reply body on Camel is wrong\", \"echo \" + TEST_MESSAGE, result.get(0));
    \n
    \n
    \n
    \n
    \n
    \n

    How\n to deal with the message for a camel-cxf endpoint in PAYLOAD data format

    \n
    \n
    \n
    \n

    In Apache Camel 2.0: CxfMessage.getBody() will return\n an org.apache.camel.component.cxf.CxfPayload object, which has\n getters for SOAP message headers and Body elements. This change enables decoupling the\n native CXF message from the Apache Camel message.

    \n
    protected RouteBuilder createRouteBuilder() {\nreturn new RouteBuilder() {\npublic void configure() {\n  from(SIMPLE_ENDPOINT_URI + \"&dataFormat=PAYLOAD\").to(\"log:info\").process(new Processor() {\n      @SuppressWarnings(\"unchecked\")\n      public void process(final Exchange exchange) throws Exception {\n          CxfPayload<SoapHeader> requestPayload = exchange.getIn().getBody(CxfPayload.class);\n          List<Source> inElements = requestPayload.getBodySources();\n          List<Source> outElements = new ArrayList<Source>();\n          // You can use a customer toStringConverter to turn a CxfPayLoad message into String as you want\n          String request = exchange.getIn().getBody(String.class);\n          XmlConverter converter = new XmlConverter();\n          String documentString = ECHO_RESPONSE;\n\n          Element in = new XmlConverter().toDOMElement(inElements.get(0));\n          // Just check the element namespace\n          if (!in.getNamespaceURI().equals(ELEMENT_NAMESPACE)) {\n              throw new IllegalArgumentException(\"Wrong element namespace\");\n          }\n          if (in.getLocalName().equals(\"echoBoolean\")) {\n              documentString = ECHO_BOOLEAN_RESPONSE;\n              checkRequest(\"ECHO_BOOLEAN_REQUEST\", request);\n          } else {\n              documentString = ECHO_RESPONSE;\n              checkRequest(\"ECHO_REQUEST\", request);\n          }\n          Document outDocument = converter.toDOMDocument(documentString);\n          outElements.add(new DOMSource(outDocument.getDocumentElement()));\n          // set the payload header with null\n          CxfPayload<SoapHeader> responsePayload = new CxfPayload<SoapHeader>(null, outElements, null);\n          exchange.getOut().setBody(responsePayload);\n      }\n  });\n}\n};\n}
    \n
    \n
    \n
    \n
    \n
    \n

    How to get and set SOAP\n headers in POJO mode

    \n
    \n
    \n
    \n

    POJO means that the data format is a list of\n Java\n objects when the CXF endpoint produces or consumes Camel exchanges. Even\n though Apache Camel exposes the message body as POJOs in this mode, the CXF component still\n provides access to read and write SOAP headers. However, since CXF interceptors remove\n in-band SOAP headers from the header list after they have been processed, only\n out-of-band SOAP headers are available in POJO mode.

    \n

    The following example illustrates how to get/set SOAP headers. Suppose we have a route\n that forwards from one CXF endpoint to another. That is, SOAP Client → Apache Camel → CXF\n service. We can attach two processors to obtain/insert SOAP headers at (1) before\n request goes out to the CXF service and (2) before response comes back to the SOAP\n Client. Processor (1) and (2) in this example are InsertRequestOutHeaderProcessor and\n InsertResponseOutHeaderProcessor. Our route looks like this:

    \n
    <route>\n<from uri=\"cxf:bean:routerRelayEndpointWithInsertion\"/>\n<process ref=\"InsertRequestOutHeaderProcessor\" />\n<to uri=\"cxf:bean:serviceRelayEndpointWithInsertion\"/>\n<process ref=\"InsertResponseOutHeaderProcessor\" />\n</route>
    \n

    In 2.x SOAP headers are propagated to and from\n Apache Camel Message headers. The Apache Camel message header name is\n org.apache.cxf.headers.Header.list, which is a constant defined in CXF\n (org.apache.cxf.headers.Header.HEADER_LIST). The header value is a\n List<> of CXF SoapHeader objects\n (org.apache.cxf.binding.soap.SoapHeader). The following snippet is the\n InsertResponseOutHeaderProcessor (that inserts a new SOAP header in the\n response message). The way to access SOAP headers in both\n InsertResponseOutHeaderProcessor and\n InsertRequestOutHeaderProcessor are actually the same. The only\n difference between the two processors is setting the direction of the inserted SOAP\n header.\n

    \n
    public static class InsertResponseOutHeaderProcessor implements Processor {\n\n@SuppressWarnings(\"unchecked\")\npublic void process(Exchange exchange) throws Exception {\n// You should be able to get the header if exchange is routed from camel-cxf endpoint\nList<SoapHeader> soapHeaders = CastUtils.cast((List<?>)exchange.getIn().getHeader(Header.HEADER_LIST));\nif (soapHeaders == null) {\n  // we just create a new soap headers in case the header is null\n  soapHeaders = new ArrayList<SoapHeader>();\n}\n\n// Insert a new header\nString xml = \"<?xml version=\"1.0\" encoding=\"utf-8\"?><outofbandHeader \"\n  + \"xmlns=\"http://cxf.apache.org/outofband/Header\" hdrAttribute=\"testHdrAttribute\" \"\n  + \"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" soap:mustUnderstand=\"1\">\"\n  + \"<name>New_testOobHeader</name><value>New_testOobHeaderValue</value></outofbandHeader>\";\nSoapHeader newHeader = new SoapHeader(soapHeaders.get(0).getName(),\n             DOMUtils.readXml(new StringReader(xml)).getDocumentElement());\n// make sure direction is OUT since it is a response message.\nnewHeader.setDirection(Direction.DIRECTION_OUT);\n//newHeader.setMustUnderstand(false);\nsoapHeaders.add(newHeader);\n\n}\n\n}
    \n
    \n
    \n
    \n
    \n
    \n

    How to get and set SOAP\n headers in PAYLOAD mode

    \n
    \n
    \n
    \n

    We have already shown how to access SOAP message (CxfPayload object) in\n PAYLOAD mode (see How to deal\n with the message for a camel-cxf endpoint in PAYLOAD data format).\n

    \n

    Once you obtain a CxfPayload object, you can invoke the\n CxfPayload.getHeaders() method that returns a List of DOM\n Elements (SOAP headers).\n

    \n
    from(getRouterEndpointURI()).process(new Processor() {\n@SuppressWarnings(\"unchecked\")\npublic void process(Exchange exchange) throws Exception {\nCxfPayload<SoapHeader> payload = exchange.getIn().getBody(CxfPayload.class);\nList<Source> elements = payload.getBodySources();\nassertNotNull(\"We should get the elements here\", elements);\nassertEquals(\"Get the wrong elements size\", 1, elements.size());\n\nElement el = new XmlConverter().toDOMElement(elements.get(0));\nelements.set(0, new DOMSource(el));\nassertEquals(\"Get the wrong namespace URI\", \"http://camel.apache.org/pizza/types\",\n      el.getNamespaceURI());\n\nList<SoapHeader> headers = payload.getHeaders();\nassertNotNull(\"We should get the headers here\", headers);\nassertEquals(\"Get the wrong headers size\", headers.size(), 1);\nassertEquals(\"Get the wrong namespace URI\",\n      ((Element)(headers.get(0).getObject())).getNamespaceURI(),\n      \"http://camel.apache.org/pizza/types\");\n}\n\n})\n.to(getServiceEndpointURI());
    \n

    Since Camel 2.16.0, you can use the same approach as described in How to get and set SOAP headers in POJO\n mode to set or get the SOAP\n headers. You can now use the org.apache.cxf.headers.Header.list header to\n get and set a list of SOAP headers. This means that if you have a route that forwards\n from one Camel CXF endpoint to another (SOAP Client → Camel → CXF service), the SOAP\n headers sent by the SOAP client are now also forwarded to the CXF service. If you do not\n want the headers to be forwarded, remove them from the\n org.apache.cxf.headers.Header.list Camel header.\n

    \n
    \n
    \n
    \n
    \n
    \n

    SOAP headers are not\n available in MESSAGE mode

    \n
    \n
    \n
    \n

    SOAP headers are not available in MESSAGE mode as SOAP processing is\n skipped.

    \n
    \n
    \n
    \n
    \n
    \n

    How to throw a SOAP Fault from\n Apache Camel

    \n
    \n
    \n
    \n

    If you are using a CXF endpoint to consume the SOAP request, you may need to throw the\n SOAP Fault from the camel context. Basically, you can use the\n throwFault DSL to do that; it works for POJO,\n PAYLOAD and MESSAGE data format. You can\n define the soap fault like this:\n

    \n
    SOAP_FAULT = new SoapFault(EXCEPTION_MESSAGE, SoapFault.FAULT_CODE_CLIENT);\nElement detail = SOAP_FAULT.getOrCreateDetail();\nDocument doc = detail.getOwnerDocument();\nText tn = doc.createTextNode(DETAIL_TEXT);\ndetail.appendChild(tn);
    \n

    Then throw it as you like:

    \n
    from(routerEndpointURI).setFaultBody(constant(SOAP_FAULT));
    \n

    If your CXF endpoint is working in the MESSAGE data format, you\n could set the the SOAP Fault message in the message body and set the response code in\n the message header.

    \n
    from(routerEndpointURI).process(new Processor() {\n\npublic void process(Exchange exchange) throws Exception {\nMessage out = exchange.getOut();\n// Set the message body with the\nout.setBody(this.getClass().getResourceAsStream(\"SoapFaultMessage.xml\"));\n// Set the response code here\nout.setHeader(org.apache.cxf.message.Message.RESPONSE_CODE, new Integer(500));\n}\n\n});
    \n

    The same is true for the POJO data format. You can set the SOAP Fault on the\n Out body and also indicate it’s a fault by calling\n Message.setFault(true), as follows:\n

    \n
    from(\"direct:start\").onException(SoapFault.class).maximumRedeliveries(0).handled(true)\n.process(new Processor() {\npublic void process(Exchange exchange) throws Exception {\n  SoapFault fault = exchange\n      .getProperty(Exchange.EXCEPTION_CAUGHT, SoapFault.class);\n  exchange.getOut().setFault(true);\n  exchange.getOut().setBody(fault);\n}\n\n}).end().to(serviceURI);
    \n
    \n
    \n
    \n
    \n
    \n

    How to\n propagate a CXF endpoint’s request and response context

    \n
    \n
    \n
    \n

    cxf client API provides a way to invoke the operation with request and\n response context. If you are using a CXF endpoint producer to invoke the external Web\n service, you can set the request context and get the response context with the following\n code:

    \n
            CxfExchange exchange = (CxfExchange)template.send(getJaxwsEndpointUri(), new Processor() {\n   public void process(final Exchange exchange) {\n       final List<String> params = new ArrayList<String>();\n       params.add(TEST_MESSAGE);\n       // Set the request context to the inMessage\n       Map<String, Object> requestContext = new HashMap<String, Object>();\n       requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, JAXWS_SERVER_ADDRESS);\n       exchange.getIn().setBody(params);\n       exchange.getIn().setHeader(Client.REQUEST_CONTEXT , requestContext);\n       exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, GREET_ME_OPERATION);\n   }\n});\norg.apache.camel.Message out = exchange.getOut();\n// The output is an object array, the first element of the array is the return value\nObject[] output = out.getBody(Object[].class);\nLOG.info(\"Received output text: \" + output[0]);\n// Get the response context form outMessage\nMap<String, Object> responseContext = CastUtils.cast((Map)out.getHeader(Client.RESPONSE_CONTEXT));\nassertNotNull(responseContext);\nassertEquals(\"Get the wrong wsdl opertion name\", \"{http://apache.org/hello_world_soap_http}greetMe\",\n            responseContext.get(\"javax.xml.ws.wsdl.operation\").toString());
    \n
    \n
    \n
    \n
    \n
    \n

    Attachment\n Support

    \n
    \n
    \n
    \n

    POJO Mode: Both SOAP with Attachment and MTOM are\n supported (see example in Payload Mode for enabling MTOM). However, SOAP with\n Attachment is not tested. Since attachments are marshalled and unmarshalled into\n POJOs, users typically do not need to deal with the attachment\n themself. Attachments are propagated to Camel message’s attachments since\n 2.1. So, it is possible to retreive attachments by Camel Message API

    \n
    DataHandler Message.getAttachment(String id)
    \n

    .

    \n

    Payload Mode: MTOM is supported since 2.1.\n Attachments can be retrieved by Camel Message APIs mentioned above. SOAP with Attachment\n is not supported as there is no SOAP processing in this mode.

    \n

    To enable MTOM, set the CXF endpoint property \"mtom_enabled\" to\n true. (I believe you can only do it with Spring.)\n

    \n
    <cxf:cxfEndpoint id=\"routerEndpoint\" address=\"http://localhost:{CXFTestSupport.port1}/CxfMtomRouterPayloadModeTest/jaxws-mtom/hello\"\nwsdlURL=\"mtom.wsdl\"\nserviceName=\"ns:HelloService\"\nendpointName=\"ns:HelloPort\"\nxmlns:ns=\"http://apache.org/camel/cxf/mtom_feature\">\n\n<cxf:properties>\n<!--  enable mtom by setting this property to true -->\n<entry key=\"mtom-enabled\" value=\"true\"/>\n\n<!--  set the camel-cxf endpoint data fromat to PAYLOAD mode -->\n<entry key=\"dataFormat\" value=\"PAYLOAD\"/>\n</cxf:properties>
    \n

    You can produce a Camel message with attachment to send to a CXF endpoint in Payload\n mode.

    \n
    Exchange exchange = context.createProducerTemplate().send(\"direct:testEndpoint\", new Processor() {\n\npublic void process(Exchange exchange) throws Exception {\nexchange.setPattern(ExchangePattern.InOut);\nList&lt;Source> elements = new ArrayList&lt;Source>();\nelements.add(new DOMSource(DOMUtils.readXml(new StringReader(MtomTestHelper.REQ_MESSAGE)).getDocumentElement()));\nCxfPayload<SoapHeader> body = new CxfPayload<SoapHeader>(new ArrayList<SoapHeader>(),\n  elements, null);\nexchange.getIn().setBody(body);\nexchange.getIn().addAttachment(MtomTestHelper.REQ_PHOTO_CID,\n  new DataHandler(new ByteArrayDataSource(MtomTestHelper.REQ_PHOTO_DATA, \"application/octet-stream\")));\n\nexchange.getIn().addAttachment(MtomTestHelper.REQ_IMAGE_CID,\n  new DataHandler(new ByteArrayDataSource(MtomTestHelper.requestJpeg, \"image/jpeg\")));\n\n}\n\n});\n\n// process response\n\nCxfPayload<SoapHeader> out = exchange.getOut().getBody(CxfPayload.class);\nAssert.assertEquals(1, out.getBody().size());\n\nMap<String, String> ns = new HashMap<String, String>();\nns.put(\"ns\", MtomTestHelper.SERVICE_TYPES_NS);\nns.put(\"xop\", MtomTestHelper.XOP_NS);\n\nXPathUtils xu = new XPathUtils(ns);\nElement oute = new XmlConverter().toDOMElement(out.getBody().get(0));\nElement ele = (Element)xu.getValue(\"//ns:DetailResponse/ns:photo/xop:Include\", oute,\n                         XPathConstants.NODE);\nString photoId = ele.getAttribute(\"href\").substring(4); // skip \"cid:\"\n\nele = (Element)xu.getValue(\"//ns:DetailResponse/ns:image/xop:Include\", oute,\n                         XPathConstants.NODE);\nString imageId = ele.getAttribute(\"href\").substring(4); // skip \"cid:\"\n\nDataHandler dr = exchange.getOut().getAttachment(photoId);\nAssert.assertEquals(\"application/octet-stream\", dr.getContentType());\nMtomTestHelper.assertEquals(MtomTestHelper.RESP_PHOTO_DATA, IOUtils.readBytesFromStream(dr.getInputStream()));\n\ndr = exchange.getOut().getAttachment(imageId);\nAssert.assertEquals(\"image/jpeg\", dr.getContentType());\n\nBufferedImage image = ImageIO.read(dr.getInputStream());\nAssert.assertEquals(560, image.getWidth());\nAssert.assertEquals(300, image.getHeight());
    \n

    You can also consume a Camel message received from a CXF endpoint in Payload\n mode.

    \n
    public static class MyProcessor implements Processor {\n\n@SuppressWarnings(\"unchecked\")\npublic void process(Exchange exchange) throws Exception {\nCxfPayload<SoapHeader> in = exchange.getIn().getBody(CxfPayload.class);\n\n// verify request\nassertEquals(1, in.getBody().size());\n\nMap<String, String> ns = new HashMap<String, String>();\nns.put(\"ns\", MtomTestHelper.SERVICE_TYPES_NS);\nns.put(\"xop\", MtomTestHelper.XOP_NS);\n\nXPathUtils xu = new XPathUtils(ns);\nElement body = new XmlConverter().toDOMElement(in.getBody().get(0));\nElement ele = (Element)xu.getValue(\"//ns:Detail/ns:photo/xop:Include\", body,\n                                 XPathConstants.NODE);\nString photoId = ele.getAttribute(\"href\").substring(4); // skip \"cid:\"\nassertEquals(MtomTestHelper.REQ_PHOTO_CID, photoId);\n\nele = (Element)xu.getValue(\"//ns:Detail/ns:image/xop:Include\", body,\n                                 XPathConstants.NODE);\nString imageId = ele.getAttribute(\"href\").substring(4); // skip \"cid:\"\nassertEquals(MtomTestHelper.REQ_IMAGE_CID, imageId);\n\nDataHandler dr = exchange.getIn().getAttachment(photoId);\nassertEquals(\"application/octet-stream\", dr.getContentType());\nMtomTestHelper.assertEquals(MtomTestHelper.REQ_PHOTO_DATA, IOUtils.readBytesFromStream(dr.getInputStream()));\n\ndr = exchange.getIn().getAttachment(imageId);\nassertEquals(\"image/jpeg\", dr.getContentType());\nMtomTestHelper.assertEquals(MtomTestHelper.requestJpeg, IOUtils.readBytesFromStream(dr.getInputStream()));\n\n// create response\nList&lt;Source> elements = new ArrayList&lt;Source>();\nelements.add(new DOMSource(DOMUtils.readXml(new StringReader(MtomTestHelper.RESP_MESSAGE)).getDocumentElement()));\nCxfPayload&lt;SoapHeader> sbody = new CxfPayload&lt;SoapHeader>(new ArrayList&lt;SoapHeader>(),\n  elements, null);\nexchange.getOut().setBody(sbody);\nexchange.getOut().addAttachment(MtomTestHelper.RESP_PHOTO_CID,\n  new DataHandler(new ByteArrayDataSource(MtomTestHelper.RESP_PHOTO_DATA, \"application/octet-stream\")));\n\nexchange.getOut().addAttachment(MtomTestHelper.RESP_IMAGE_CID,\n  new DataHandler(new ByteArrayDataSource(MtomTestHelper.responseJpeg, \"image/jpeg\")));\n\n}\n}
    \n

    Message Mode: Attachments are not supported as it\n does not process the message at all.

    \n

    CXF_MESSAGE Mode: MTOM is supported, and Attachments\n can be retrieved by Camel Message APIs mentioned above. Note that when receiving a\n multipart (that is, MTOM) message the default SOAPMessage to\n String converter will provide the complete multi-part payload on the\n body. If you require just the SOAP XML as a String, you can set the message\n body with message.getSOAPPart(), and Camel convert can do the rest of work\n for you.\n

    \n
    \n
    \n
    \n
    \n
    \n

    How to propagate stack trace\n information

    \n
    \n
    \n
    \n

    It is possible to configure a CXF endpoint so that, when a Java exception is thrown on\n the server side, the stack trace for the exception is marshalled into a fault message\n and returned to the client. To enable this feaure, set the dataFormat to\n PAYLOAD and set the faultStackTraceEnabled\n property to\n true in the cxfEndpoint element, as follows:\n

    \n
    <cxf:cxfEndpoint id=\"router\" address=\"http://localhost:9002/TestMessage\"\nwsdlURL=\"ship.wsdl\"\nendpointName=\"s:TestSoapEndpoint\"\nserviceName=\"s:TestService\"\nxmlns:s=\"http://test\">\n<cxf:properties>\n<!-- enable sending the stack trace back to client; the default value is false-->\n<entry key=\"faultStackTraceEnabled\" value=\"true\" />\n<entry key=\"dataFormat\" value=\"PAYLOAD\" />\n</cxf:properties>\n</cxf:cxfEndpoint>
    \n

    For security reasons, the stack trace does not include the causing exception (that is,\n the part of a stack trace that follows Caused by). If you want to include\n the causing exception in the stack trace, set the\n exceptionMessageCauseEnabled property to true\n in the\n cxfEndpoint element, as follows:\n

    \n
    <cxf:cxfEndpoint id=\"router\" address=\"http://localhost:9002/TestMessage\"\nwsdlURL=\"ship.wsdl\"\nendpointName=\"s:TestSoapEndpoint\"\nserviceName=\"s:TestService\"\nxmlns:s=\"http://test\">\n<cxf:properties>\n<!-- enable to show the cause exception message and the default value is false -->\n<entry key=\"exceptionMessageCauseEnabled\" value=\"true\" />\n<!-- enable to send the stack trace back to client,  the default value is false-->\n<entry key=\"faultStackTraceEnabled\" value=\"true\" />\n<entry key=\"dataFormat\" value=\"PAYLOAD\" />\n</cxf:properties>\n</cxf:cxfEndpoint>
    \n
    \n \n \n \n \n \n \n \n \n
    \"[Warning]\"\nWarning
    \n

    You should only enable the exceptionMessageCauseEnabled flag\n for\n testing and diagnostic purposes. It is normal practice for servers to conceal the\n original cause of an exception to make it harder for hostile users to probe the\n server.

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Streaming Support in PAYLOAD mode\n

    \n
    \n
    \n
    \n

    In 2.8.2, the camel-cxf component now supports streaming of incoming messages when using PAYLOAD mode.\n Previously, the incoming messages would have been completely DOM parsed. For large messages, this is\n time consuming and uses a significant amount of memory. Starting in 2.8.2, the incoming messages can\n remain as a javax.xml.transform.Source while being routed and, if nothing modifies the payload, can then\n be directly streamed out to the target destination. For common \"simple proxy\" use cases (example:\n from(\"cxf:…​\").to(\"cxf:…​\")), this can provide very significant performance\n increases as well as significantly lowered memory requirements.

    \n

    However, there are cases where streaming may not be appropriate or desired. Due to the streaming nature,\n invalid incoming XML may not be caught until later in the processing chain. Also, certain actions may\n require the message to be DOM parsed anyway (like WS-Security or message tracing and such) in which case\n the advantages of the streaming is limited. At this point, there are two ways to control the streaming:\n

    \n
    \n
      \n
    • Endpoint property: you can add \"allowStreaming=false\" as an endpoint property\n to turn the streaming on/off.
    • \n
    • Component property: the CxfComponent object also has an allowStreaming property\n that can set the default for endpoints created from that component.
    • \n
    • Global system property: you can add a system property of\n \"org.apache.camel.component.cxf.streaming\" to \"false\" to turn if off. That sets the global\n default, but setting the endpoint property above will override this value for that endpoint.\n
    • \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Using the generic CXF\n Dispatch mode

    \n
    \n
    \n
    \n

    From 2.8.0, the camel-cxf component supports the generic CXF dispatch\n mode that can transport messages of arbitrary structures (i.e., not bound\n to a specific XML schema). To use this mode, you simply omit specifying the wsdlURL\n and serviceClass attributes of the CXF endpoint.

    \n
    <cxf:cxfEndpoint id=\"testEndpoint\" address=\"http://localhost:9000/SoapContext/SoapAnyPort\">\n<cxf:properties>\n<entry key=\"dataFormat\" value=\"PAYLOAD\"/>\n</cxf:properties>\n</cxf:cxfEndpoint>
    \n

    It is noted that the default CXF dispatch client does not send a specific\n SOAPAction header. Therefore, when the target service requires a specific SOAPAction\n value, it is supplied in the Camel header using the key SOAPAction\n (case-insensitive).

    \n
    \n
    \n
    \n
    \n
    \n

    CXF consumers on\n {wildfly}

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Configuring\n alternative ports
    \n
    Configuring SSL\n
    \n
    Configuring security with\n Elytron
    \n
    \n
    \n

    The configuration of camel-cxf consumers on {wildfly} is different to that of standalone Camel. Producer\n endpoints work as per normal.

    \n

    On {wildfly}, camel-cxf consumers leverage the default Undertow HTTP server provided by the container.\n The server is defined within the undertow subsystem configuration. Here’s an excerpt of the\n default configuration from standalone.xml:

    \n
    <subsystem xmlns=\"urn:jboss:domain:undertow:4.0\">\n<buffer-cache name=\"default\" />\n<server name=\"default-server\">\n<http-listener name=\"default\" socket-binding=\"http\" redirect-socket=\"https\" enable-http2=\"true\" />\n<https-listener name=\"https\" socket-binding=\"https\" security-realm=\"ApplicationRealm\" enable-http2=\"true\" />\n<host name=\"default-host\" alias=\"localhost\">\n  <location name=\"/\" handler=\"welcome-content\" />\n  <filter-ref name=\"server-header\" />\n  <filter-ref name=\"x-powered-by-header\" />\n  <http-invoker security-realm=\"ApplicationRealm\" />\n</host>\n</server>\n</subsystem>
    \n

    In this instance, Undertow is configured to listen on interfaces / ports specified by the http and https\n socket-binding. By default this is port 8080 for http and 8443 for https.

    \n

    For example, if you configure an endpoint consumer using different host or port combinations, a warning\n will appear within the server log file. For example the following host & port configurations would\n be ignored:

    \n <cxf:rsServer id=\"cxfRsConsumer\"\n address=\"http://somehost:1234/path/to/resource\"\n serviceClass=\"org.example.ServiceClass\" />\n <cxf:cxfEndpoint id=\"cxfWsConsumer\"\n address=\"http://somehost:1234/path/to/resource\"\n serviceClass=\"org.example.ServiceClass\" />\n [org.wildfly.extension.camel] (pool-2-thread-1) Ignoring configured host: http://somehost:1234/path/to/resource\n

    However, the consumer is still available on the default host & port localhost:8080 or localhost:8443.\n

    \n
    \n \n \n \n \n \n \n \n \n
    \"[Note]\"\nNote
    \n

    Applications which use camel-cxf consumers must be packaged as a WAR.\n In previous {wildfly-camel} releases, other types of archive such as JAR were permitted,\n but this is no longer supported.

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Configuring alternative ports\n

    \n
    \n
    \n
    \n

    If alternative ports are to be accepted, then these must be configured via the {wildfly} subsystem\n configuration. This is explained in the server documentation:

    \n

    https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/configuring_the_web_server_undertow\n

    \n
    \n \n
    \n
    \n
    \n
    \n

    Configuring security with\n Elytron

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Configuring a security\n domain
    \n
    Configuring\n security constraints, authentication methods and security roles
    \n
    \n
    \n

    {wildfly-camel} supports securing camel-cxf consumer endpoints with the Elytron security framework.

    \n
    \n
    \n
    \n
    \n

    Configuring a security\n domain

    \n
    \n
    \n
    \n

    To secure a {wildfly-camel} application with Elytron, an application security domain needs to be\n referenced within WEB-INF/jboss-web.xml of your WAR deployment:

    \n
    <jboss-web>\n<security-domain>my-application-security-domain</security-domain>\n</jboss-web>
    \n

    The <security-domain> configuration references the name of an\n <application-security-domain> defined by the Undertow\n subsystem. For example, the Undertow subsystem <application-security-domain> is configured within the\n {wildfly} server standalone.xml configuration file as follows:

    \n
    <subsystem xmlns=\"urn:jboss:domain:undertow:6.0\">\n...\n<application-security-domains>\n<application-security-domain name=\"my-application-security-domain\" http-authentication-factory=\"application-http-authentication\"/>\n</application-security-domains>\n</subsystem>
    \n

    The <http-authentication-factory> application-http-authentication is defined within the Elytron\n subsystem. application-http-authentication is available by default\n in both the standalone.xml and standalone-full.xml server configuration files. For example:

    \n
    <subsystem xmlns=\"urn:wildfly:elytron:1.2\">\n...\n<http>\n...\n<http-authentication-factory name=\"application-http-authentication\" http-server-mechanism-factory=\"global\" security-domain=\"ApplicationDomain\">\n  <mechanism-configuration>\n      <mechanism mechanism-name=\"BASIC\">\n          <mechanism-realm realm-name=\"Application Realm\" />\n      </mechanism>\n      <mechanism mechanism-name=\"FORM\" />\n  </mechanism-configuration>\n</http-authentication-factory>\n<provider-http-server-mechanism-factory name=\"global\" />\n</http>\n...\n</subsystem>
    \n

    The <http-authentication-factory> named application-http-authentication, holds a reference to a Elytron\n security domain called ApplicationDomain.

    \n

    For more information on how to configure the Elytron subsystem, refer to the Elytron documentation.

    \n
    \n
    \n
    \n
    \n
    \n

    Configuring\n security constraints, authentication methods and security roles

    \n
    \n
    \n
    \n

    Security constraints, authentication methods and security roles for camel-cxf consumer endpoints\n can be configured within your WAR deployment WEB-INF/web.xml. For\n example, to configure BASIC Authentication:

    \n
    <web-app>\n<security-constraint>\n<web-resource-collection>\n<web-resource-name>secure</web-resource-name>\n<url-pattern>/webservices/*</url-pattern>\n</web-resource-collection>\n<auth-constraint>\n<role-name>my-role</role-name>\n</auth-constraint>\n</security-constraint>\n<security-role>\n<description>The role that is required to log in to /webservices/*</description>\n<role-name>my-role</role-name>\n</security-role>\n<login-config>\n<auth-method>BASIC</auth-method>\n<realm-name>my-realm</realm-name>\n</login-config>\n</web-app>
    \n

    Note that the <url-pattern> defined by the Servlet\n Specification is relative to the context path of the web application. If your application is\n packaged as my-app.war, {wildfly} will make it accessible under the\n context path /my-app and the <url-patternpattern> /webservices/* will be applied to paths relative to /my-app.

    \n

    For example, requests against http://my-server/my-app/webservices/my-endpoint\n will match the /webservices/* pattern, while http://my-server/webservices/my-endpoint\n will not match.

    \n

    This is important because {wildfly-camel} allows the creation of camel-cxf endpoint consumers\n whose base path is outside of the host web application context path. For example, it is possible\n to create a camel-cxf consumer for http://my-server/webservices/my-endpoint\n inside my-app.war.

    \n

    In order to define security constraints for such out-of-context endpoints, {wildfly-camel}\n supports a custom, non-standard <url-pattern> convention where prefixing the pattern with three\n forward slashes /// will be interpreted as absolute to server host\n name. For example, to secure http://my-server/webservices/my-endpoint\n inside my-app.war, you would add the following configuration to\n web.xml:

    \n
    <web-app>\n<security-constraint>\n<web-resource-collection>\n<web-resource-name>secure</web-resource-name>\n<url-pattern>///webservices/*</url-pattern>\n</web-resource-collection>\n<auth-constraint>\n<role-name>my-role</role-name>\n</auth-constraint>\n</security-constraint>\n<security-role>\n<description>The role that is required to log in to /webservices/*</description>\n<role-name>my-role</role-name>\n</security-role>\n<login-config>\n<auth-method>BASIC</auth-method>\n<realm-name>my-realm</realm-name>\n</login-config>\n</web-app>
    \n
    \n
    \n
    \n
    "; exports.default = CXF; /***/ }), /***/ "./src/camel/element/compontent/CXFRS.js": /*!***********************************************!*\ !*** ./src/camel/element/compontent/CXFRS.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var CXFRS = function (_CamelElement) { _inherits(CXFRS, _CamelElement); function CXFRS() { _classCallCheck(this, CXFRS); var _this = _possibleConstructorReturn(this, (CXFRS.__proto__ || Object.getPrototypeOf(CXFRS)).call(this)); _this.scope = "CXFRS"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "_cxfrs"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.address = "address"; _this.beanId = "beanId"; _this.uri = "cxf:" + _this.beanId + ":" + _this.address; // uri _this.features = ""; _this.loggingFeatureEnabled = false; _this.loggingSizeLimit = ""; _this.modelRef = ""; _this.providers = ""; _this.resourceClasses = ""; _this.schemaLocations = ""; _this.skipFaultLogging = false; _this.bindingStyle = "Default"; _this.bridgeErrorHandler = false; _this.publishedEndpointUrl = ""; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.serviceBeans = ""; _this.cookieHandler = ""; _this.hostnameVerifier = ""; _this.sslContextParameters = ""; _this.throwExceptionOnFailure = true; _this.httpClientAPI = true; _this.ignoreDeleteMethodMessageBody = false; _this.maxClientCacheSize = 10; _this.binding = ""; _this.bus = ""; _this.continuationTimeout = 30000; _this.cxfRsEndpointConfigurer = ""; _this.defaultBus = false; _this.headerFilterStrategy = ""; _this.performInvocation = false; _this.propagateContexts = false; _this.synchronous = false; return _this; } _createClass(CXFRS, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["address", "beanId"], common: ["features", "loggingFeatureEnabled", "loggingSizeLimit", "modelRef", "providers", "resourceClasses", "schemaLocations", "skipFaultLogging"], consumer: ["bindingStyle", "bridgeErrorHandler", "publishedEndpointUrl"], consumer_advanced: ["exceptionHandler", "exchangePattern", "serviceBeans"], producer: ["cookieHandler", "hostnameVerifier", "sslContextParameters", "throwExceptionOnFailure"], producer_advanced: ["httpClientAPI", "ignoreDeleteMethodMessageBody", "maxClientCacheSize"], advanceds: ["binding", "bus", "continuationTimeout", "cxfRsEndpointConfigurer", "defaultBus", "headerFilterStrategy", "performInvocation", "propagateContexts", "synchronous"] }, documentation: CXFRS.documentation }; } }]); return CXFRS; }(_CamelElement3.default); CXFRS.documentation = "
    \n
    \n
    \n
    \n

    CXF-RS Component

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    URI format
    \n
    Options
    \n
    How to configure\n the REST endpoint in Camel
    \n
    How\n to override the CXF producer address from message header
    \n
    Consuming a REST\n Request - Simple Binding Style
    \n
    Consuming a REST\n Request - Default Binding Style
    \n
    How\n to invoke the REST service through camel-cxfrs producer
    \n
    What’s\n the Camel Transport for CXF
    \n
    Integrate\n Camel into CXF transport layer
    \n
    Configure\n the destination and conduit with Spring
    \n
    Configure\n the destination and conduit with Blueprint
    \n
    Example\n Using Camel as a load balancer for CXF
    \n
    Complete\n Howto and Example for attaching Camel to CXF
    \n
    \n
    \n

    Available as of Camel version 2.0

    \n

    The cxfrs: component provides integration with\n Apache CXF for connecting to JAX-RS 1.1 and\n 2.0\n services hosted in CXF.\n

    \n

    When using CXF as a consumer, the CXF Bean\n Component allows you to factor out how message payloads are received\n from their processing as a RESTful or SOAP web service. This has the\n potential of using a multitude of transports to consume web services.\n The bean component’s configuration is also simpler and provides the\n fastest method to implement web services using Camel and CXF.

    \n

    Maven users will need to add the following dependency to their pom.xml\n for this component:

    \n
    <dependency>\n<groupId>org.apache.camel</groupId>\n<artifactId>camel-cxf</artifactId>\n<version>x.x.x</version>  <!-- use the same version as your Camel core version -->\n</dependency>
    \n
    \n
    \n
    \n
    \n

    URI format

    \n
    \n
    \n
    \n cxfrs://address?options\n

    Where address represents the CXF endpoint’s address\n

    \n
    cxfrs:bean:rsEndpoint
    \n

    Where rsEndpoint represents the spring bean’s name\n which presents the\n CXFRS client or server

    \n

    For either style above, you can append options to the URI as follows:

    \n
    cxfrs:bean:cxfEndpoint?resourceClasses=org.apache.camel.rs.Example
    \n
    \n
    \n
    \n
    \n
    \n

    Options

    \n
    \n
    \n
    \n \n

    The CXF-RS component supports 3 options which are listed below.

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    useGlobalSslContext Parameters\n (security)

    \n
    \n

    Enable usage of global SSL context parameters.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    headerFilterStrategy (filter)

    \n
    \n

    To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and\n from Camel message.

    \n
     \n

    HeaderFilterStrategy

    \n
    \n

    resolveProperty Placeholders (advanced)\n

    \n
    \n

    Whether the component should resolve property placeholders on itself when starting.\n Only properties which are of String type can use property placeholders.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n
    \n

    The CXF-RS endpoint is configured using URI syntax:

    \n
    cxfrs:beanId:address
    \n

    with the following path and query parameters:

    \n
    \n
    \n
    \n
    \n

    Path Parameters (2\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    beanId

    \n
    \n

    To lookup an existing configured CxfRsEndpoint. Must used bean: as prefix.

    \n
     \n

    String

    \n
    \n

    address

    \n
    \n

    The service publish address.

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Query Parameters (29\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    features (common)

    \n
    \n

    Set the feature list to the CxfRs endpoint.

    \n
     \n

    List

    \n
    \n

    loggingFeatureEnabled (common)

    \n
    \n

    This option enables CXF Logging Feature which writes inbound and outbound REST\n messages to log.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    loggingSizeLimit (common)

    \n
    \n

    To limit the total size of number of bytes the logger will output when logging\n feature has been enabled.

    \n
     \n

    int

    \n
    \n

    modelRef (common)

    \n
    \n

    This option is used to specify the model file which is useful for the resource\n class without annotation. When using this option, then the service class can be\n omitted, to emulate document-only endpoints

    \n
     \n

    String

    \n
    \n

    providers (common)

    \n
    \n

    Set custom JAX-RS provider(s) list to the CxfRs endpoint. You can specify a\n string with a list of providers to lookup in the registy separated by comma.

    \n
     \n

    String

    \n
    \n

    resourceClasses (common)

    \n
    \n

    The resource classes which you want to export as REST service. Multiple classes\n can be separated by comma.

    \n
     \n

    List

    \n
    \n

    schemaLocations (common)

    \n
    \n

    Sets the locations of the schema(s) which can be used to validate the incoming\n XML or JAXB-driven JSON.

    \n
     \n

    List

    \n
    \n

    skipFaultLogging (common)

    \n
    \n

    This option controls whether the PhaseInterceptorChain skips logging the Fault\n that it catches.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    bindingStyle (consumer)

    \n
    \n

    Sets how requests and responses will be mapped to/from Camel. Two values are\n possible: SimpleConsumer: This binding style processes request parameters,\n multiparts, etc. and maps them to IN headers, IN attachments and to the message\n body. It aims to eliminate low-level processing of\n org.apache.cxf.message.MessageContentsList. It also also adds more flexibility\n and simplicity to the response mapping. Only available for consumers. Default:\n The default style. For consumers this passes on a MessageContentsList to the\n route, requiring low-level processing in the route. This is the traditional\n binding style, which simply dumps the org.apache.cxf.message.MessageContentsList\n coming in from the CXF stack onto the IN message body. The user is then\n responsible for processing it according to the contract defined by the JAX-RS\n method signature. Custom: allows you to specify a custom binding through the\n binding option.

    \n
    \n

    Default

    \n
    \n

    BindingStyle

    \n
    \n

    bridgeErrorHandler (consumer)

    \n
    \n

    Allows for bridging the consumer to the Camel routing Error Handler, which mean\n any exceptions occurred while the consumer is trying to pickup incoming\n messages, or the likes, will now be processed as a message and handled by the\n routing Error Handler. By default the consumer will use the\n org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be\n logged at WARN or ERROR level and ignored.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    publishedEndpointUrl (consumer)

    \n
    \n

    This option can override the endpointUrl that published from the WADL which can\n be accessed with resource address url plus _wadl

    \n
     \n

    String

    \n
    \n

    exceptionHandler (consumer)

    \n
    \n

    To let the consumer use a custom ExceptionHandler. Notice if the option\n bridgeErrorHandler is enabled then this options is not in use. By default the\n consumer will deal with exceptions, that will be logged at WARN or ERROR level\n and ignored.

    \n
     \n

    ExceptionHandler

    \n
    \n

    exchangePattern (consumer)

    \n
    \n

    Sets the exchange pattern when the consumer creates an exchange.

    \n
     \n

    ExchangePattern

    \n
    \n

    cookieHandler (producer)

    \n
    \n

    Configure a cookie handler to maintain a HTTP session

    \n
     \n

    CookieHandler

    \n
    \n

    hostnameVerifier (producer)

    \n
    \n

    The hostname verifier to be used. Use the notation to reference a\n HostnameVerifier from the registry.

    \n
     \n

    HostnameVerifier

    \n
    \n

    sslContextParameters (producer)

    \n
    \n

    The Camel SSL setting reference. Use the notation to reference the SSL Context.\n

    \n
     \n

    SSLContextParameters

    \n
    \n

    throwExceptionOnFailure (producer)\n

    \n
    \n

    This option tells the CxfRsProducer to inspect return codes and will generate an\n Exception if the return code is larger than 207.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    httpClientAPI (producer)

    \n
    \n

    If it is true, the CxfRsProducer will use the HttpClientAPI to invoke the\n service. If it is false, the CxfRsProducer will use the ProxyClientAPI to invoke\n the service

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    ignoreDeleteMethodMessage Body\n (producer)

    \n
    \n

    This option is used to tell CxfRsProducer to ignore the message body of the\n DELETE method when using HTTP API.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    maxClientCacheSize (producer)

    \n
    \n

    This option allows you to configure the maximum size of the cache. The\n implementation caches CXF clients or ClientFactoryBean in CxfProvider and\n CxfRsProvider.

    \n
    \n

    10

    \n
    \n

    int

    \n
    \n

    binding (advanced)

    \n
    \n

    To use a custom CxfBinding to control the binding between Camel Message and CXF\n Message.

    \n
     \n

    CxfRsBinding

    \n
    \n

    bus (advanced)

    \n
    \n

    To use a custom configured CXF Bus.

    \n
     \n

    Bus

    \n
    \n

    continuationTimeout (advanced)

    \n
    \n

    This option is used to set the CXF continuation timeout which could be used in\n CxfConsumer by default when the CXF server is using Jetty or Servlet transport.\n

    \n
    \n

    30000

    \n
    \n

    long

    \n
    \n

    cxfRsEndpointConfigurer (advanced)\n

    \n
    \n

    This option could apply the implementation of\n org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer which supports to\n configure the CXF endpoint in programmatic way. User can configure the CXF\n server and client by implementing configureServer/Client method of\n CxfEndpointConfigurer.

    \n
     \n

    CxfRsEndpoint Configurer

    \n
    \n

    defaultBus (advanced)

    \n
    \n

    Will set the default bus when CXF endpoint create a bus by itself

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    headerFilterStrategy (advanced)

    \n
    \n

    To use a custom HeaderFilterStrategy to filter header to and from Camel message.\n

    \n
     \n

    HeaderFilterStrategy

    \n
    \n

    performInvocation (advanced)

    \n
    \n

    When the option is true, Camel will perform the invocation of the resource class\n instance and put the response object into the exchange for further processing.\n

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    propagateContexts (advanced)

    \n
    \n

    When the option is true, JAXRS UriInfo, HttpHeaders, Request and SecurityContext\n contexts will be available to custom CXFRS processors as typed Camel exchange\n properties. These contexts can be used to analyze the current requests using\n JAX-RS API.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    synchronous (advanced)

    \n
    \n

    Sets whether synchronous processing should be strictly used, or Camel is allowed\n to use asynchronous processing (if supported).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n
    \n

    You can also configure the CXF REST endpoint through the spring\n configuration. Since there are lots of difference between the CXF REST\n client and CXF REST Server, we provide different configuration for\n them. Please check out the\n schema\n file and CXF\n JAX-RS\n documentation for more information.\n

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    How to configure the REST\n endpoint in Camel

    \n
    \n
    \n
    \n

    In\n camel-cxf\n schema file, there are two elements for the REST endpoint definition.\n cxf:rsServer for REST consumer, cxf:rsClient for REST producer.\n You can find a Camel REST service route configuration example here.\n

    \n
    \n
    \n
    \n
    \n
    \n

    How to override\n the CXF producer address from message header

    \n
    \n
    \n
    \n

    The camel-cxfrs producer supports to override the services address\n by\n setting the message with the key of \"CamelDestinationOverrideUrl\".

    \n
     // set up the service address from the message header to override the setting of CXF endpoint\nexchange.getIn().setHeader(Exchange.DESTINATION_OVERRIDE_URL, constant(getServiceAddress()));
    \n
    \n
    \n
    \n
    \n
    \n

    Consuming a REST Request -\n Simple Binding Style

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Enabling\n the Simple Binding Style
    \n
    Examples\n of request binding with different method signatures
    \n
    More examples of\n the Simple Binding Style
    \n
    \n
    \n

    Available as of Camel 2.11

    \n

    The Default binding style is rather low-level, requiring the user to\n manually process the MessageContentsList object coming into the route.\n Thus, it tightly couples the route logic with the method signature and\n parameter indices of the JAX-RS operation. Somewhat inelegant, difficult\n and error-prone.

    \n

    In contrast, the SimpleConsumer binding style performs the following\n mappings, in order to make the request data more accessible\n to you\n within the Camel Message:

    \n
    \n
      \n
    • JAX-RS Parameters (@HeaderParam, @QueryParam, etc.) are injected as IN\n message headers. The header name matches the value of the annotation.
    • \n
    • The request entity (POJO or other type) becomes the IN message body.\n If a single entity cannot be identified in the JAX-RS method signature,\n it falls back to the original MessageContentsList.
    • \n
    • Binary @Multipart body parts become IN message\n attachments,\n supporting DataHandler, InputStream,\n DataSource and CXF’s\n Attachment class.\n
    • \n
    • Non-binary @Multipart body parts are mapped as IN\n message headers.\n The header name matches the Body Part name.
    • \n
    \n
    \n

    Additionally, the following rules apply to the Response\n mapping:

    \n
    \n
      \n
    • If the message body type is different to javax.ws.rs.core.Response\n (user-built response), a new Response is created and the message\n body\n is set as the entity (so long it’s not null). The response status code\n is taken from the Exchange.HTTP_RESPONSE_CODE header, or defaults\n to\n 200 OK if not present.
    • \n
    • If the message body type is equal to javax.ws.rs.core.Response, it\n means that the user has built a custom response, and therefore it is\n respected and it becomes the final response.
    • \n
    • In all cases, Camel headers permitted by custom or default\n HeaderFilterStrategy are added to the HTTP response.\n
    • \n
    \n
    \n
    \n
    \n
    \n
    \n

    Enabling the Simple\n Binding Style

    \n
    \n
    \n
    \n

    This binding style can be activated by setting the bindingStyle\n parameter in the consumer endpoint to value SimpleConsumer:

    \n from(\"cxfrs:bean:rsServer?bindingStyle=SimpleConsumer\")\n.to(\"log:TEST?showAll=true\");\n
    \n
    \n
    \n
    \n
    \n

    Examples of\n request binding with different method signatures

    \n
    \n
    \n
    \n

    Below is a list of method signatures along with the expected result from\n the Simple binding.

    \n

    public Response doAction(BusinessObject request);\n Request payload is placed in IN message body, replacing the original\n MessageContentsList.

    \n

    public Response doAction(BusinessObject request, @HeaderParam(\"abcd\") String abcd, @QueryParam(\"defg\") String defg);\n Request payload placed in IN message body, replacing the original\n MessageContentsList. Both request params mapped as IN message headers\n with names abcd and defg.

    \n

    public Response doAction(@HeaderParam(\"abcd\") String abcd, @QueryParam(\"defg\") String defg);\n Both request params mapped as IN message headers with names abcd and\n defg. The original MessageContentsList is preserved, even though it only\n contains the 2 parameters.

    \n

    public Response doAction(@Multipart(value=\"body1\") BusinessObject request, @Multipart(value=\"body2\") BusinessObject request2);\n The first parameter is transferred as a header with name body1, and the\n second one is mapped as header body2. The original MessageContentsList\n is preserved as the IN message body.

    \n

    public Response doAction(InputStream abcd);\n The InputStream is unwrapped from the MessageContentsList and preserved\n as the IN message body.

    \n

    public Response doAction(DataHandler abcd);\n The DataHandler is unwrapped from the MessageContentsList and preserved\n as the IN message body.

    \n
    \n
    \n
    \n
    \n
    \n

    More examples of\n the Simple Binding Style

    \n
    \n
    \n
    \n

    Given a JAX-RS resource class with this method:

    \n
        @POST @Path(\"/customers/{type}\")\npublic Response newCustomer(Customer customer, @PathParam(\"type\") String type, @QueryParam(\"active\") @DefaultValue(\"true\") boolean active) {\nreturn null;\n}
    \n

    Serviced by the following route:

    \n from(\"cxfrs:bean:rsServer?bindingStyle=SimpleConsumer\")\n.recipientList(simple(\"direct:{header.operationName}\"));\n\nfrom(\"direct:newCustomer\")\n.log(\"Request: type={header.type}, active={header.active}, customerData={body}\");\n

    The following HTTP request with XML payload (given that the Customer DTO\n is JAXB-annotated):

    \n
    POST /customers/gold?active=true\n\nPayload:\n<Customer>\n<fullName>Raul Kripalani</fullName>\n<country>Spain</country>\n<project>Apache Camel</project>\n</Customer>
    \n

    Will print the message:

    \n Request: type=gold, active=true, customerData=<Customer.toString() representation>\n

    For more examples on how to process requests and write responses can be\n found\n here.\n

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Consuming a REST Request -\n Default Binding Style

    \n
    \n
    \n
    \n

    The CXF JAXRS front\n end\n implements the JAX-RS (JSR-311)\n API, so we can\n export the resources classes as a REST service. And we leverage the\n CXF Invoker\n API to turn a REST request into a normal Java object method\n invocation.\n Unlike the Camel\n Restlet component, you don’t need\n to specify the URI template within your endpoint, CXF takes care of the\n REST request URI to resource class method mapping according to the\n JSR-311 specification. All you need to do in Camel is delegate this\n method request to a right processor or endpoint.\n

    \n

    Here is an example of a CXFRS route…​

    \n

    And the corresponding resource class used to configure the endpoint…​

    \n

    INFO:*Note about resource classes*

    \n

    By default, JAX-RS resource classes are only*used to configure JAX-RS\n properties. Methods will *not be executed during routing of messages to\n the endpoint. Instead, it is the responsibility of the route to do all\n processing.

    \n

    Note that starting from Camel 2.15 it is also sufficient to provide an\n interface only as opposed to a no-op service implementation class for\n the default mode.

    \n

    Starting from Camel 2.15, if a performInvocation option is\n enabled,\n the service implementation will be invoked first, the response will be\n set on the Camel exchange and the route execution will continue as\n usual. This can be useful for integrating the existing JAX-RS implementations into Camel routes and\n for post-processing JAX-RS Responses in custom processors.

    \n
    \n
    \n
    \n
    \n
    \n

    How to invoke\n the REST service through camel-cxfrs producer

    \n
    \n
    \n
    \n

    The CXF JAXRS front\n end\n implements\n a\n proxy-based client API, with this API you can invoke the remote REST\n service through a proxy. The camel-cxfrs producer is based on this\n proxy\n API.\n You just need to specify the operation name in the message header and\n prepare the parameter in the message body, the camel-cxfrs producer will\n generate right REST request for you.\n

    \n

    Here is an example:

    \n

    The CXF JAXRS front\n end also\n provides\n a\n http centric client API. You can also invoke this API from\n camel-cxfrs producer. You need to specify the\n HTTP_PATH\n and\n the HTTP_METHOD and\n let the producer use the http centric client API by using the URI option\n httpClientAPI or by setting the message header\n CxfConstants.CAMEL_CXF_RS_USING_HTTP_API.\n You can turn the response object to the type class specified with the\n message\n header CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS.\n

    \n

    From Camel 2.1, we also support to specify the query parameters from\n cxfrs URI for the CXFRS http centric client.

    \n

    Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:\n Index: 20, Size: 20

    \n

    To support the Dynamical routing, you can override the URI’s query\n parameters by using the CxfConstants.CAMEL_CXF_RS_QUERY_MAP\n header to set the parameter map for it.

    \n
    \n
    \n
    \n
    \n
    \n

    What’s the Camel\n Transport for CXF

    \n
    \n
    \n
    \n

    In CXF you offer or consume a webservice by defining its address. The\n first part of the address specifies the protocol to use. For example\n address=\"http://localhost:9000\" in an endpoint configuration means your\n service will be offered using the http protocol on port 9000 of\n localhost. When you integrate Camel Tranport into CXF you get a new\n transport \"camel\". So you can specify\n address=\"camel://direct:MyEndpointName\" to bind the CXF service address\n to a camel direct endpoint.

    \n

    Technically speaking Camel transport for CXF is a component which\n implements the\n CXF\n transport API with the Camel core library. This allows you to easily\n use Camel’s routing engine and integration patterns support together\n with your CXF services.\n

    \n
    \n
    \n
    \n
    \n
    \n

    Integrate Camel into\n CXF transport layer

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Setting\n up the Camel Transport in Spring
    \n
    Integrating\n the Camel Transport in a programmatic way
    \n
    \n
    \n

    To include the Camel Tranport into your CXF bus you use the\n CamelTransportFactory. You can do this in Java as well as in Spring.

    \n
    \n
    \n
    \n
    \n

    Setting up the\n Camel Transport in Spring

    \n
    \n
    \n
    \n

    You can use the following snippet in your applicationcontext if you want\n to configure anything special. If you only want to activate the camel\n transport you do not have to do anything in your application context. As\n soon as you include the camel-cxf-transport jar (or camel-cxf.jar if\n your camel version is less than 2.7.x) in your app, cxf will scan the\n jar and load a CamelTransportFactory for you.

    \n
    <!-- you don't need to specify the CamelTransportFactory configuration as it is auto load by CXF bus -->\n<bean class=\"org.apache.camel.component.cxf.transport.CamelTransportFactory\">\n<property name=\"bus\" ref=\"cxf\" />\n<property name=\"camelContext\" ref=\"camelContext\" />\n<!-- checkException new added in Camel 2.1 and Camel 1.6.2 -->\n<!-- If checkException is true , CamelDestination will check the outMessage's\nexception and set it into camel exchange. You can also override this value\nin CamelDestination's configuration. The default value is false.\nThis option should be set true when you want to leverage the camel's error\nhandler to deal with fault message -->\n<property name=\"checkException\" value=\"true\" />\n<property name=\"transportIds\">\n<list>\n<value>http://cxf.apache.org/transports/camel</value>\n</list>\n</property>\n</bean>
    \n
    \n
    \n
    \n
    \n
    \n

    Integrating\n the Camel Transport in a programmatic way

    \n
    \n
    \n
    \n

    Camel transport provides a setContext method that you could use to set\n the Camel context into the transport factory. If you want this factory\n take effect, you need to register the factory into the CXF bus. Here is\n a full example for you.

    \n
    import org.apache.cxf.Bus;\nimport org.apache.cxf.BusFactory;\nimport org.apache.cxf.transport.ConduitInitiatorManager;\nimport org.apache.cxf.transport.DestinationFactoryManager;\n...\n\nBusFactory bf = BusFactory.newInstance();\nBus bus = bf.createBus();\nCamelTransportFactory camelTransportFactory = new CamelTransportFactory();\n// set up the CamelContext which will be use by the CamelTransportFactory\ncamelTransportFactory.setCamelContext(context)\n// if you are using CXF higher then 2.4.x the\ncamelTransportFactory.setBus(bus);\n\n// if you are lower CXF, you need to register the ConduitInitiatorManager and DestinationFactoryManager like below\n// register the conduit initiator\nConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);\ncim.registerConduitInitiator(CamelTransportFactory.TRANSPORT_ID, camelTransportFactory);\n// register the destination factory\nDestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);\ndfm.registerDestinationFactory(CamelTransportFactory.TRANSPORT_ID, camelTransportFactory);\n// set or bus as the default bus for cxf\nBusFactory.setDefaultBus(bus);
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Configure\n the destination and conduit with Spring

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Namespace
    \n
    The destination element
    \n
    The\n conduit element
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Namespace

    \n
    \n
    \n
    \n

    The elements used to configure an Camel transport endpoint are defined\n in the namespace http://cxf.apache.org/transports/camel.\n It is\n commonly referred to using the prefix camel. In order to use the Camel\n transport configuration elements, you will need to add the lines shown\n below to the beans element of your endpoint’s configuration file. In\n addition, you will need to add the configuration elements' namespace to\n the xsi:schemaLocation attribute.

    \n

    Adding the Configuration Namespace

    \n
    <beans ...\nxmlns:camel=\"http://cxf.apache.org/transports/camel\n       ...\nxsi:schemaLocation=\"...\n                           http://cxf.apache.org/transports/camel\n                 http://cxf.apache.org/transports/camel.xsd\n                ...>
    \n
    \n
    \n
    \n
    \n
    \n

    The destination element

    \n
    \n
    \n
    \n

    You configure an Camel transport server endpoint using the\n camel:destination element and its children. The camel:destination\n element takes a single attribute, name, that specifies the WSDL port\n element that corresponds to the endpoint. The value for the name\n attribute takes the form portQName.camel-destination. The\n example\n below shows the camel:destination element that would be used to add\n configuration for an endpoint that was specified by the WSDL fragment\n <port binding=\"widgetSOAPBinding\" name=\"widgetSOAPPort\"> if the\n endpoint’s target namespace was http://widgets.widgetvendor.net.\n

    \n

    camel:destination Element

    \n
    ...\n<camel:destination name=\"{http://widgets/widgetvendor.net}widgetSOAPPort.http-destination>\n    <camelContext id=\"context\" xmlns=\"http://activemq.apache.org/camel/schema/spring\">\n<route>\n <from uri=\"direct:EndpointC\" />\n <to uri=\"direct:EndpointD\" />\n</route>\n</camelContext>\n</camel:destination>\n\n<!-- new added feature since Camel 2.11.x\n<camel:destination name=\"{http://widgets/widgetvendor.net}widgetSOAPPort.camel-destination\" camelContextId=\"context\" />\n\n...
    \n

    The camel:destination element for Spring has a number of child\n elements that specify configuration information. They are described\n below.

    \n

    Element

    \n

    Description

    \n

    camel-spring:camelContext

    \n

    You can specify the camel context in the camel destination

    \n

    camel:camelContextRef

    \n

    The camel context id which you want inject into the camel destination

    \n
    \n
    \n
    \n
    \n
    \n

    The conduit element

    \n
    \n
    \n
    \n

    You configure a Camel transport client using the camel:conduit element\n and its children. The camel:conduit element takes a single attribute,\n name, that specifies the WSDL port element that corresponds to the\n endpoint. The value for the name attribute takes the form\n portQName.camel-conduit. For example, the code below shows\n the\n camel:conduit element that would be used to add configuration for an\n endpoint that was specified by the WSDL fragment\n <port binding=\"widgetSOAPBinding\" name=\"widgetSOAPPort\"> if the\n endpoint’s target namespace was http://widgets.widgetvendor.net.\n

    \n

    http-conf:conduit Element

    \n
    ...\n<camelContext id=\"conduit_context\" xmlns=\"http://activemq.apache.org/camel/schema/spring\">\n<route>\n <from uri=\"direct:EndpointA\" />\n <to uri=\"direct:EndpointB\" />\n</route>\n</camelContext>\n\n<camel:conduit name=\"{http://widgets/widgetvendor.net}widgetSOAPPort.camel-conduit\">\n<camel:camelContextRef>conduit_context</camel:camelContextRef>\n</camel:conduit>\n\n<!-- new added feature since Camel 2.11.x\n<camel:conduit name=\"{http://widgets/widgetvendor.net}widgetSOAPPort.camel-conduit\" camelContextId=\"conduit_context\" />\n\n\n<camel:conduit name=\"*.camel-conduit\">\n<!-- you can also using the wild card to specify the camel-conduit that you want to configure -->\n...\n</camel:conduit>\n...
    \n

    The camel:conduit element has a number of child elements that specify\n configuration information. They are described below.

    \n

    Element

    \n

    Description

    \n

    camel-spring:camelContext

    \n

    You can specify the camel context in the camel conduit

    \n

    camel:camelContextRef

    \n

    The camel context id which you want inject into the camel conduit

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Configure\n the destination and conduit with Blueprint

    \n
    \n
    \n
    \n

    From Camel 2.11.x, Camel Transport supports to be configured\n with\n Blueprint.

    \n

    If you are using blueprint, you should use the the namespace\n http://cxf.apache.org/transports/camel/blueprint\n and import the schema\n like the blow.\n

    \n

    Adding the Configuration Namespace for blueprint

    \n
    <beans ...\nxmlns:camel=\"http://cxf.apache.org/transports/camel/blueprint\"\n...\nxsi:schemaLocation=\"...\n                           http://cxf.apache.org/transports/camel/blueprint\n                 http://cxf.apache.org/schmemas/blueprint/camel.xsd\n                ...>
    \n

    In blueprint camel:conduit camel:destination\n only has one\n camelContextId attribute, they doesn’t support to specify the camel\n context in the camel destination.

    \n <camel:conduit id=\"*.camel-conduit\" camelContextId=\"camel1\" />\n<camel:destination id=\"*.camel-destination\" camelContextId=\"camel1\" />\n
    \n
    \n
    \n
    \n
    \n

    Example Using\n Camel as a load balancer for CXF

    \n
    \n
    \n
    \n

    This example shows how to use the camel load balancing feature in CXF.\n You need to load the configuration file in CXF and publish the endpoints\n on the address \"camel://direct:EndpointA\" and \"camel://direct:EndpointB\"

    \n
    \n
    \n
    \n
    \n
    \n

    Complete\n Howto and Example for attaching Camel to CXF

    \n
    \n
    \n
    \n

    Better\n JMS Transport for CXF Webservice using Apache Camel 

    \n
    \n
    "; exports.default = CXFRS; /***/ }), /***/ "./src/camel/element/compontent/ControlBus.js": /*!****************************************************!*\ !*** ./src/camel/element/compontent/ControlBus.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ControlBus = function (_CamelElement) { _inherits(ControlBus, _CamelElement); function ControlBus() { _classCallCheck(this, ControlBus); var _this = _possibleConstructorReturn(this, (ControlBus.__proto__ || Object.getPrototypeOf(ControlBus)).call(this)); _this.scope = "ControlBus"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "_controlbus"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.command = "command"; _this.language = "language"; _this.uri = "controlbus:" + _this.command + ":" + _this.language; // uri _this.action = ""; _this.async = false; _this.loggingLevel = ""; _this.restartDelay = 1000; _this.routeId = ""; _this.synchronous = false; return _this; } _createClass(ControlBus, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["command", "language"], producer: ["action", "async", "loggingLevel", "restartDelay", "routeId"], advanceds: ["synchronous"] }, documentation: ControlBus.documentation }; } }]); return ControlBus; }(_CamelElement3.default); ControlBus.documentation = "
    \n
    \n
    \n
    \n

    Control Bus Component

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    ControlBus\n Component
    \n
    Commands
    \n
    Options
    \n
    Using route\n command
    \n
    Getting performance\n statistics
    \n
    Using Simple\n language
    \n
    \n
    \n

    Available as of Camel version 2.11

    \n

    The Control Bus from the\n EIP patterns allows for the\n integration system to be monitored and managed from within the\n framework.

    \n

    \"image\"

    \n

    Use a Control Bus to manage an enterprise integration system. The\n Control Bus uses the same messaging mechanism used by the application\n data, but uses separate channels to transmit data that is relevant to\n the management of components involved in the message flow.

    \n

    In Camel you can manage and monitor using JMX, or\n by using a Java API from the CamelContext, or from the\n org.apache.camel.api.management package,\n or use the event notifier which has an example\n here.\n

    \n

    From Camel 2.11 onwards we have introduced a new\n ControlBus Component that\n allows you to\n send messages to a control bus Endpoint that reacts\n accordingly.\n

    \n
    \n
    \n
    \n
    \n

    ControlBus Component\n

    \n
    \n
    \n
    \n

    Available as of Camel 2.11

    \n

    The controlbus: component provides easy management of Camel\n applications based on the Control Bus EIP\n pattern.\n For example, by sending a message to an Endpoint\n you can control the lifecycle of routes, or gather performance\n statistics.

    \n
    controlbus:command[?options]
    \n

    Where command can be any string to identify which type of\n command to\n use.

    \n
    \n
    \n
    \n
    \n
    \n

    Commands

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    CommandDescription
    \n

    route

    \n
    \n

    To control routes using the routeId and action parameter.

    \n
    \n

    language

    \n
    \n

    Allows you to specify a Language to use for\n evaluating the message body. If there is any result from the evaluation,\n then the result is put in the message body.

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Options

    \n
    \n
    \n
    \n \n

    The Control Bus component has no options.

    \n

    The Control Bus endpoint is configured using URI syntax:

    \n
    controlbus:command:language
    \n

    with the following path and query parameters:

    \n
    \n
    \n
    \n
    \n

    Path Parameters (2\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    command

    \n
    \n

    Required Command can be either route\n or language

    \n
     \n

    String

    \n
    \n

    language

    \n
    \n

    Allows you to specify the name of a Language to use for evaluating the message\n body. If there is any result from the evaluation, then the result is put in the\n message body.

    \n
     \n

    Language

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Query Parameters (6\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    action (producer)

    \n
    \n

    To denote an action that can be either: start, stop, or status. To either start\n or stop a route, or to get the status of the route as output in the message\n body. You can use suspend and resume from Camel 2.11.1 onwards to either suspend\n or resume a route. And from Camel 2.11.1 onwards you can use stats to get\n performance statics returned in XML format; the routeId option can be used to\n define which route to get the performance stats for, if routeId is not defined,\n then you get statistics for the entire CamelContext. The restart action will\n restart the route.

    \n
     \n

    String

    \n
    \n

    async (producer)

    \n
    \n

    Whether to execute the control bus task asynchronously. Important: If this option\n is enabled, then any result from the task is not set on the Exchange. This is\n only possible if executing tasks synchronously.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    loggingLevel (producer)

    \n
    \n

    Logging level used for logging when task is done, or if any exceptions occurred\n during processing the task.

    \n
    \n

    INFO

    \n
    \n

    LoggingLevel

    \n
    \n

    restartDelay (producer)

    \n
    \n

    The delay in millis to use when restarting a route.

    \n
    \n

    1000

    \n
    \n

    int

    \n
    \n

    routeId (producer)

    \n
    \n

    To specify a route by its id. The special keyword current indicates the current\n route.

    \n
     \n

    String

    \n
    \n

    synchronous (advanced)

    \n
    \n

    Sets whether synchronous processing should be strictly used, or Camel is allowed\n to use asynchronous processing (if supported).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n
    \n

    You can append query options to the URI in the following format,\n ?option=value&option=value&…​\n

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Using route command\n

    \n
    \n
    \n
    \n

    The route command allows you to do common tasks on a given route very\n easily, for example to start a route, you can send an empty message to\n this endpoint:

    \n template.sendBody(\"controlbus:route?routeId=foo&action=start\", null);\n

    To get the status of the route, you can do:

    \n String status = template.requestBody(\"controlbus:route?routeId=foo&action=status\", null, String.class);\n
    \n
    \n
    \n
    \n
    \n

    Getting performance statistics

    \n
    \n
    \n
    \n

    Available as of Camel 2.11.1

    \n

    This requires JMX to be enabled (is by default) then you can get the\n performance statics per route, or for the\n CamelContext. For example to get the statics for\n a route named foo, we can do:

    \n String xml = template.requestBody(\"controlbus:route?routeId=foo&action=stats\", null, String.class);\n

    The returned statics is in XML format. Its the same data you can get\n from JMX with the dumpRouteStatsAsXml operation on the\n ManagedRouteMBean.\n

    \n

    To get statics for the entire CamelContext you\n just omit the routeId parameter as shown below:

    \n String xml = template.requestBody(\"controlbus:route?action=stats\", null, String.class);\n
    \n
    \n
    \n
    \n
    \n

    Using Simple language\n

    \n
    \n
    \n
    \n

    You can use the Simple language\n with the control bus,\n for example to stop a specific route, you can send a message to the\n \"controlbus:language:simple\" endpoint containing the following\n message:\n

    \n template.sendBody(\"controlbus:language:simple\", \"{camelContext.stopRoute('myRoute')}\");\n

    As this is a void operation, no result is returned. However, if you want\n the route status you can do:

    \n String status = template.requestBody(\"controlbus:language:simple\", \"{camelContext.getRouteStatus('myRoute')}\", String.class);\n

    It’s easier to use the route command to control lifecycle of\n routes. The language command allows you to execute a language script\n that has stronger powers such as Groovy or to some\n extend the Simple language.

    \n

    For example to shutdown Camel itself you can do:

    \n template.sendBody(\"controlbus:language:simple?async=true\", \"{camelContext.stop()}\");\n

    We use async=true to stop Camel asynchronously as otherwise we\n would be trying to stop Camel while it was in-flight processing the\n message we sent to the control bus component.

    \n
    \n \n \n \n \n \n \n \n \n
    \"[Tip]\"\n Tip
    \n

    You can also use other languages such as Groovy, etc.

    \n
    \n
    \n
    \n
    "; exports.default = ControlBus; /***/ }), /***/ "./src/camel/element/compontent/Direct.js": /*!************************************************!*\ !*** ./src/camel/element/compontent/Direct.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Direct = function (_CamelElement) { _inherits(Direct, _CamelElement); function Direct() { _classCallCheck(this, Direct); var _this = _possibleConstructorReturn(this, (Direct.__proto__ || Object.getPrototypeOf(Direct)).call(this)); _this.scope = "Direct"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "direct"; // 名字 _this.name = "name"; _this.uri = "direct:" + _this.name; // uri _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.bridgeErrorHandler = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.block = true; _this.failIfNoConsumers = false; _this.timeout = 30000; _this.synchronous = false; return _this; } _createClass(Direct, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据}} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["name"], consumer: ["bridgeErrorHandler"], consumer_advanced: ["exceptionHandler", "exchangePattern"], producer: ["block", "failIfNoConsumers", "timeout"], advanceds: ["synchronous"] }, documentation: Direct.documentation }; } }]); return Direct; }(_CamelElement3.default); Direct.documentation = "
    \n
    \n
    \n
    \n

    Direct Component

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    URI format
    \n
    Options
    \n
    Samples
    \n
    See Also
    \n
    \n
    \n

    Available as of Camel version 1.0

    \n

    The direct: component provides direct, synchronous invocation of\n any\n consumers when a producer sends a message exchange.\n This endpoint can be used to connect existing routes in the same\n camel context.

    \n
    \n \n \n \n \n \n \n \n \n
    \"[Tip]\"Tip
    \n

    Asynchronous\n The SEDA component\n provides asynchronous invocation of\n any consumers when a producer sends a message exchange.

    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n
    \"[Tip]\"Tip
    \n

    Connection to other camel contexts\n The VM component provides\n connections between Camel\n contexts as long they run in the same JVM.

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    URI format

    \n
    \n
    \n
    \n
    direct:someName[?options]
    \n

    Where someName can be any string to uniquely identify the\n endpoint

    \n
    \n
    \n
    \n
    \n
    \n

    Options

    \n
    \n
    \n
    \n \n

    The Direct component supports 3 options which are listed below.

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    block (producer)

    \n
    \n

    If sending a message to a direct endpoint which has no active consumer, then we can\n tell the producer to block and wait for the consumer to become active.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    timeout (producer)

    \n
    \n

    The timeout value to use if block is enabled.

    \n
    \n

    30000

    \n
    \n

    long

    \n
    \n

    resolveProperty Placeholders (advanced)\n

    \n
    \n

    Whether the component should resolve property placeholders on itself when starting.\n Only properties which are of String type can use property placeholders.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n
    \n

    The Direct endpoint is configured using URI syntax:

    \n
    direct:name
    \n

    with the following path and query parameters:

    \n
    \n
    \n
    \n
    \n

    Path Parameters (1\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    name

    \n
    \n

    Required Name of direct endpoint

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Query Parameters (7\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    bridgeErrorHandler (consumer)

    \n
    \n

    Allows for bridging the consumer to the Camel routing Error Handler, which mean\n any exceptions occurred while the consumer is trying to pickup incoming\n messages, or the likes, will now be processed as a message and handled by the\n routing Error Handler. By default the consumer will use the\n org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be\n logged at WARN/ERROR level and ignored.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    exceptionHandler (consumer)

    \n
    \n

    To let the consumer use a custom ExceptionHandler. Notice if the option\n bridgeErrorHandler is enabled then this options is not in use. By default the\n consumer will deal with exceptions, that will be logged at WARN/ERROR level and\n ignored.

    \n
     \n

    ExceptionHandler

    \n
    \n

    exchangePattern (consumer)

    \n
    \n

    Sets the default exchange pattern when creating an exchange.

    \n
     \n

    ExchangePattern

    \n
    \n

    block (producer)

    \n
    \n

    If sending a message to a direct endpoint which has no active consumer, then we\n can tell the producer to block and wait for the consumer to become active.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    failIfNoConsumers (producer)

    \n
    \n

    Whether the producer should fail by throwing an exception, when sending to a\n DIRECT endpoint with no active consumers.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    timeout (producer)

    \n
    \n

    The timeout value to use if block is enabled.

    \n
    \n

    30000

    \n
    \n

    long

    \n
    \n

    synchronous (advanced)

    \n
    \n

    Sets whether synchronous processing should be strictly used, or Camel is allowed\n to use asynchronous processing (if supported).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Samples

    \n
    \n
    \n
    \n

    In the route below we use the direct component to link the two routes\n together:

    \n from(\"activemq:queue:order.in\")\n.to(\"bean:orderServer?method=validate\")\n.to(\"direct:processOrder\");\n\nfrom(\"direct:processOrder\")\n.to(\"bean:orderService?method=process\")\n.to(\"activemq:queue:order.out\");\n

    And the sample using spring DSL:

    \n
    <route>\n<from uri=\"activemq:queue:order.in\"/>\n<to uri=\"bean:orderService?method=validate\"/>\n<to uri=\"direct:processOrder\"/>\n</route>\n\n<route>\n<from uri=\"direct:processOrder\"/>\n<to uri=\"bean:orderService?method=process\"/>\n<to uri=\"activemq:queue:order.out\"/>\n</route>
    \n

    See also samples from the SEDA\n component, how they can\n be used together.

    \n
    \n
    \n
    \n
    \n
    \n

    See Also

    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    "; exports.default = Direct; /***/ }), /***/ "./src/camel/element/compontent/DirectVM.js": /*!**************************************************!*\ !*** ./src/camel/element/compontent/DirectVM.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var DirectVM = function (_CamelElement) { _inherits(DirectVM, _CamelElement); function DirectVM() { _classCallCheck(this, DirectVM); var _this = _possibleConstructorReturn(this, (DirectVM.__proto__ || Object.getPrototypeOf(DirectVM)).call(this)); _this.scope = "DirectVM"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "directvm"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.name = "name"; _this.uri = "direct-vm:" + _this.name; // uri _this.bridgeErrorHandler = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.block = true; _this.failIfNoConsumers = false; _this.timeout = 30000; _this.headerFilterStrategy = ""; _this.propagateProperties = true; _this.synchronous = false; return _this; } _createClass(DirectVM, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据}} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["name"], consumer: ["bridgeErrorHandler"], consumer_advanced: ["exceptionHandler", "exchangePattern"], producer: ["block", "failIfNoConsumers", "timeout"], producer_advanced: ["headerFilterStrategy"], advanceds: ["propagateProperties", "synchronous"] }, documentation: DirectVM.documentation }; } }]); return DirectVM; }(_CamelElement3.default); DirectVM.documentation = "
    \n
    \n
    \n
    \n

    Direct VM Component

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    URI format
    \n
    Options
    \n
    Samples
    \n
    See Also
    \n
    \n
    \n

    Available as of Camel version 2.10

    \n

    The direct-vm: component provides direct, synchronous invocation\n of\n any consumers in the JVM when a producer sends a message exchange.\n This endpoint can be used to connect existing routes in the same camel\n context, as well from other camel contexts in the same JVM.

    \n

    This component differs from the Direct component in\n that Direct-VM supports\n communication across\n CamelContext instances - so you can use this mechanism to communicate\n across web applications (provided that camel-core.jar is on the\n system/boot classpath).

    \n

    At runtime you can swap in new consumers, by stopping the existing\n consumer(s) and start new consumers.\n But at any given time there can be at most only one active consumer for\n a given endpoint.

    \n

    This component allows also to connect routes deployed in different OSGI\n Bundles as you can see here after. Even if they are running in different\n bundles, the camel routes will use\n the same thread. That autorises to develop applications using\n Transactions - Tx.

    \n

    \"image\"

    \n
    \n
    \n
    \n
    \n

    URI format

    \n
    \n
    \n
    \n
    direct-vm:someName
    \n

    Where someName can be any string to uniquely identify the\n endpoint

    \n
    \n
    \n
    \n
    \n
    \n

    Options

    \n
    \n
    \n
    \n \n

    The Direct VM component supports 5 options which are listed below.

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    block (producer)

    \n
    \n

    If sending a message to a direct endpoint which has no active consumer, then we can\n tell the producer to block and wait for the consumer to become active.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    timeout (producer)

    \n
    \n

    The timeout value to use if block is enabled.

    \n
    \n

    30000

    \n
    \n

    long

    \n
    \n

    headerFilterStrategy (advanced)

    \n
    \n

    Sets a HeaderFilterStrategy that will only be applied on producer endpoints (on both\n directions: request and response). Default value: none.

    \n
     \n

    HeaderFilterStrategy

    \n
    \n

    propagateProperties (advanced)

    \n
    \n

    Whether to propagate or not properties from the producer side to the consumer side,\n and vice versa. Default value: true.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    resolveProperty Placeholders (advanced)\n

    \n
    \n

    Whether the component should resolve property placeholders on itself when starting.\n Only properties which are of String type can use property placeholders.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n
    \n

    The Direct VM endpoint is configured using URI syntax:

    \n
    direct-vm:name
    \n

    with the following path and query parameters:

    \n
    \n
    \n
    \n
    \n

    Path Parameters (1\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    name

    \n
    \n

    Required Name of direct-vm endpoint\n

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Query Parameters (9\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    bridgeErrorHandler (consumer)

    \n
    \n

    Allows for bridging the consumer to the Camel routing Error Handler, which mean\n any exceptions occurred while the consumer is trying to pickup incoming\n messages, or the likes, will now be processed as a message and handled by the\n routing Error Handler. By default the consumer will use the\n org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be\n logged at WARN/ERROR level and ignored.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    exceptionHandler (consumer)

    \n
    \n

    To let the consumer use a custom ExceptionHandler. Notice if the option\n bridgeErrorHandler is enabled then this options is not in use. By default the\n consumer will deal with exceptions, that will be logged at WARN/ERROR level and\n ignored.

    \n
     \n

    ExceptionHandler

    \n
    \n

    exchangePattern (consumer)

    \n
    \n

    Sets the default exchange pattern when creating an exchange.

    \n
     \n

    ExchangePattern

    \n
    \n

    block (producer)

    \n
    \n

    If sending a message to a direct endpoint which has no active consumer, then we\n can tell the producer to block and wait for the consumer to become active.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    failIfNoConsumers (producer)

    \n
    \n

    Whether the producer should fail by throwing an exception, when sending to a\n Direct-VM endpoint with no active consumers.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    timeout (producer)

    \n
    \n

    The timeout value to use if block is enabled.

    \n
    \n

    30000

    \n
    \n

    long

    \n
    \n

    headerFilterStrategy (producer)

    \n
    \n

    Sets a HeaderFilterStrategy that will only be applied on producer endpoints (on\n both directions: request and response). Default value: none.

    \n
     \n

    HeaderFilterStrategy

    \n
    \n

    propagateProperties (advanced)

    \n
    \n

    Whether to propagate or not properties from the producer side to the consumer\n side, and vice versa. Default value: true.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    synchronous (advanced)

    \n
    \n

    Sets whether synchronous processing should be strictly used, or Camel is allowed\n to use asynchronous processing (if supported).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Samples

    \n
    \n
    \n
    \n

    In the route below we use the direct component to link the two routes\n together:

    \n from(\"activemq:queue:order.in\")\n.to(\"bean:orderServer?method=validate\")\n.to(\"direct-vm:processOrder\");\n

    And now in another CamelContext, such as another OSGi bundle

    \n from(\"direct-vm:processOrder\")\n.to(\"bean:orderService?method=process\")\n.to(\"activemq:queue:order.out\");\n

    And the sample using spring DSL:

    \n
    <route>\n<from uri=\"activemq:queue:order.in\"/>\n<to uri=\"bean:orderService?method=validate\"/>\n<to uri=\"direct-vm:processOrder\"/>\n</route>\n\n<route>\n<from uri=\"direct-vm:processOrder\"/>\n<to uri=\"bean:orderService?method=process\"/>\n<to uri=\"activemq:queue:order.out\"/>\n</route>
    \n
    \n
    \n
    \n
    \n
    \n

    See Also

    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    "; exports.default = DirectVM; /***/ }), /***/ "./src/camel/element/compontent/FTP.js": /*!*********************************************!*\ !*** ./src/camel/element/compontent/FTP.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var FTP = function (_CamelElement) { _inherits(FTP, _CamelElement); function FTP() { _classCallCheck(this, FTP); var _this = _possibleConstructorReturn(this, (FTP.__proto__ || Object.getPrototypeOf(FTP)).call(this)); _this.scope = "FTP"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "ftp"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.directoryName = "directoryName"; _this.port = "port"; _this.uri = "ftp:" + _this.host + ":" + _this.port + "/" + _this.directoryName; // uri _this.binary = false; _this.charset = ""; _this.disconnect = false; _this.doneFileName = ""; _this.fileName = ""; _this.passiveMode = false; _this.separator = "UNIX"; _this.transferLoggingIntervalSeconds = 5; _this.transferLoggingLevel = "DEBUG"; _this.transferLoggingVerbose = false; _this.fastExistsCheck = false; _this.bridgeErrorHandler = false; _this.delete = false; _this.moveFailed = ""; _this.noop = false; _this.preMove = ""; _this.preSort = false; _this.recursive = false; _this.resumeDownload = false; _this.sendEmptyMessageWhenIdle = false; _this.streamDownload = false; _this.directoryMustExist = false; _this.download = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.handleDirectoryParserAbsoluteResult = false; _this.ignoreFileNotFoundOrPermissionError = false; _this.inProgressRepository = ""; _this.localWorkDirectory = ""; _this.onCompletionExceptionHandler = ""; _this.pollStrategy = ""; _this.processStrategy = ""; _this.receiveBufferSize = 32768; _this.startingDirectoryMustExist = false; _this.useList = true; _this.fileExist = "Override"; _this.flatten = false; _this.jailStartingDirectory = true; _this.moveExisting = ""; _this.tempFileName = ""; _this.tempPrefix = ""; _this.allowNullBody = false; _this.chmod = ""; _this.disconnectOnBatchComplete = false; _this.eagerDeleteTargetFile = true; _this.keepLastModified = false; _this.moveExistingFileStrategy = ""; _this.sendNoop = true; _this.activePortRange = ""; _this.autoCreate = true; _this.bufferSize = 131072; _this.connectTimeout = 10000; _this.ftpClient = ""; _this.ftpClientConfig = ""; _this.ftpClientConfigParameters = ""; _this.ftpClientParameters = ""; _this.maximumReconnectAttempts = ""; _this.reconnectDelay = ""; _this.siteCommand = ""; _this.soTimeout = 300000; _this.stepwise = true; _this.synchronous = false; _this.throwExceptionOnConnectFailed = false; _this.timeout = 30000; _this.antExclude = ""; _this.antFilterCaseSensitive = true; _this.antInclude = ""; _this.eagerMaxMessagesPerPoll = true; _this.exclude = ""; _this.filter = ""; _this.filterDirectory = ""; _this.filterFile = ""; _this.idempotent = false; _this.idempotentKey = ""; _this.idempotentRepository = ""; _this.include = ""; _this.maxDepth = 2147483647; _this.maxMessagesPerPoll = ""; _this.minDepth = ""; _this.move = ""; _this.exclusiveReadLockStrategy = ""; _this.readLock = "none"; _this.readLockCheckInterval = 1000; _this.readLockDeleteOrphanLockFiles = true; _this.readLockLoggingLevel = "DEBUG"; _this.readLockMarkerFile = true; _this.readLockMinAge = ""; _this.readLockMinLength = ""; _this.readLockRemoveOnCommit = false; _this.readLockRemoveOnRollback = true; _this.readLockTimeout = 10000; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 500; _this.greedy = false; _this.initialDelay = ""; _this.runLoggingLevel = "REACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.shuffle = false; _this.sortBy = ""; _this.sorter = ""; _this.account = ""; _this.password = ""; _this.username = ""; return _this; } _createClass(FTP, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号+一个斜杠) * @param {原始的组件数据}} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, "2s"); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port", "directoryName"], common: ["binary", "charset", "disconnect", "doneFileName", "fileName", "passiveMode", "separator", "transferLoggingIntervalSeconds", "transferLoggingLevel", "transferLoggingVerbose"], common_advanced: ["fastExistsCheck"], consumer: ["bridgeErrorHandler", "delete", "moveFailed", "noop", "preMove", "preSort", "recursive", "resumeDownload", "sendEmptyMessageWhenIdle", "streamDownload"], consumer_advanced: ["directoryMustExist", "download", "exceptionHandler", "exchangePattern", "handleDirectoryParserAbsoluteResult", "ignoreFileNotFoundOrPermissionError", "inProgressRepository", "localWorkDirectory", "onCompletionExceptionHandler", "pollStrategy", "processStrategy", "receiveBufferSize", "startingDirectoryMustExist", "useList"], producer: ["fileExist", "flatten", "jailStartingDirectory", "moveExisting", "tempFileName", "tempPrefix"], producer_advanced: ["allowNullBody", "chmod", "disconnectOnBatchComplete", "eagerDeleteTargetFile", "keepLastModified", "moveExistingFileStrategy", "sendNoop"], advanceds: ["activePortRange", "autoCreate", "bufferSize", "connectTimeout", "ftpClient", "ftpClientConfig", "ftpClientConfigParameters", "ftpClientParameters", "maximumReconnectAttempts", "reconnectDelay", "siteCommand", "soTimeout", "stepwise", "synchronous", "throwExceptionOnConnectFailed", "timeout"], filter: ["antExclude", "antFilterCaseSensitive", "antInclude", "eagerMaxMessagesPerPoll", "exclude", "filter", "filterDirectory", "filterFile", "idempotent", "idempotentKey", "idempotentRepository", "include", "maxDepth", "maxMessagesPerPoll", "minDepth", "move"], lock: ["exclusiveReadLockStrategy", "readLock", "readLockCheckInterval", "readLockDeleteOrphanLockFiles", "readLockLoggingLevel", "readLockMarkerFile", "readLockMinAge", "readLockMinLength", "readLockRemoveOnCommit", "readLockRemoveOnRollback", "readLockTimeout"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["shuffle", "sortBy", "sorter"], security: ["account", "password", "username"] }, documentation: FTP.documentation }; } }]); return FTP; }(_CamelElement3.default); FTP.documentation = "
    \n
    \n
    \n
    \n

    FTP Component

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    URI format
    \n
    URI Options
    \n
    FTPS\n component default trust store
    \n
    Examples
    \n
    Concurrency
    \n
    More information\n
    \n
    Default when\n consuming files
    \n
    Message Headers\n
    \n
    About timeouts
    \n
    Using Local Work\n Directory
    \n
    Stepwise changing\n directories
    \n
    Samples
    \n
    Filter\n using org.apache.camel.component.file.GenericFileFilter
    \n
    Filtering\n using ANT path matcher
    \n
    Using a proxy with\n SFTP
    \n
    Setting preferred\n SFTP authentication method
    \n
    Consuming a single\n file using a fixed name
    \n
    Debug logging
    \n
    See Also
    \n
    \n
    \n

    Available as of Camel version 1.1

    \n

    This component provides access to remote file systems over the FTP and\n SFTP protocols.

    \n

    When consuming from remote FTP server make sure you read the section titled Default when consuming files\n further below for details related to consuming files.

    \n

    Absolute path is not supported. Camel 2.16 will translate absolute path to relative by trimming\n all\n leading slashes from directoryname. There’ll be WARN message printed\n in the logs.

    \n

    Maven users will need to add the following dependency to their pom.xml\n for this component:

    \n
    <dependency>\n<groupId>org.apache.camel</groupId>\n<artifactId>camel-ftp</artifactId>\n<version>x.x.x</version>See the documentation of the Apache Commons\n<!-- use the same version as your Camel core version -->\n</dependency>
    \n
    \n
    \n
    \n
    \n

    URI format

    \n
    \n
    \n
    \n ftp://[username@]hostname[:port]/directoryname[?options]\nsftp://[username@]hostname[:port]/directoryname[?options]\nftps://[username@]hostname[:port]/directoryname[?options]\n

    Where directoryname represents the underlying directory. The\n directory\n name is a relative path. Absolute path’s is not\n supported. The\n relative path can contain nested folders, such as /inbox/us.

    \n

    For Camel versions before Camel 2.16, the\n directoryName must exist\n already as this component does not support the autoCreate option\n (which the file component does). The reason is that its the FTP\n administrator (FTP server) task to properly setup user accounts, and\n home directories with the right file permissions etc.

    \n

    For Camel 2.16autoCreate\n option is supported. When consumer\n starts, before polling is scheduled, there’s additional FTP operation\n performed to create the directory configured for endpoint. The default\n value for autoCreate is true.

    \n

    If no username is provided, then anonymous login is attempted using\n no password.\n If no port number is provided, Camel will provide default\n values\n according to the protocol (ftp = 21, sftp = 22, ftps = 2222).

    \n

    You can append query options to the URI in the following format,\n ?option=value&option=value&…​\n

    \n

    This component uses two different libraries for the actual FTP work. FTP\n and FTPS uses Apache Commons Net\n while\n SFTP uses JCraft JSCH.

    \n

    The FTPS component is only available in Camel 2.2 or newer.\n FTPS (also known as FTP Secure) is an extension to FTP that adds\n support for the Transport Layer Security (TLS) and the Secure Sockets\n Layer (SSL) cryptographic protocols.

    \n
    \n
    \n
    \n
    \n
    \n

    URI Options

    \n
    \n
    \n
    \n \n

    The options below are exclusive for the FTP component.

    \n

    The FTP component has no options.

    \n

    The FTP endpoint is configured using URI syntax:

    \n
    ftp:host:port/directoryName
    \n

    with the following path and query parameters:

    \n
    \n
    \n
    \n
    \n

    Path Parameters (3\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    host

    \n
    \n

    Required Hostname of the FTP server\n

    \n
     \n

    String

    \n
    \n

    port

    \n
    \n

    Port of the FTP server

    \n
     \n

    int

    \n
    \n

    directoryName

    \n
    \n

    The starting directory

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Query Parameters (108\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    binary (common)

    \n
    \n

    Specifies the file transfer mode, BINARY or ASCII. Default is ASCII (false).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    charset (common)

    \n
    \n

    This option is used to specify the encoding of the file. You can use this on the\n consumer, to specify the encodings of the files, which allow Camel to know the\n charset it should load the file content in case the file content is being\n accessed. Likewise when writing a file, you can use this option to specify which\n charset to write the file as well. Do mind that when writing the file Camel may\n have to read the message content into memory to be able to convert the data into\n the configured charset, so do not use this if you have big messages.

    \n
     \n

    String

    \n
    \n

    disconnect (common)

    \n
    \n

    Whether or not to disconnect from remote FTP server right after use. Disconnect\n will only disconnect the current connection to the FTP server. If you have a\n consumer which you want to stop, then you need to stop the consumer/route\n instead.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    doneFileName (common)

    \n
    \n

    Producer: If provided, then Camel will write a 2nd done file when the original\n file has been written. The done file will be empty. This option configures what\n file name to use. Either you can specify a fixed name. Or you can use dynamic\n placeholders. The done file will always be written in the same folder as the\n original file. Consumer: If provided, Camel will only consume files if a done\n file exists. This option configures what file name to use. Either you can\n specify a fixed name. Or you can use dynamic placeholders.The done file is\n always expected in the same folder as the original file. Only $file.name and\n $file.name.noext is supported as dynamic placeholders.

    \n
     \n

    String

    \n
    \n

    fileName (common)

    \n
    \n

    Use Expression such as File Language to dynamically set the filename. For\n consumers, it’s used as a filename filter. For producers, it’s used\n to evaluate the filename to write. If an expression is set, it take precedence\n over the CamelFileName header. (Note: The header itself can also be an\n Expression). The expression options support both String and Expression types. If\n the expression is a String type, it is always evaluated using the File Language.\n If the expression is an Expression type, the specified Expression type is used -\n this allows you, for instance, to use OGNL expressions. For the consumer, you\n can use it to filter filenames, so you can for instance consume today’s\n file using the File Language syntax: mydata-$date:now:yyyyMMdd.txt. The\n producers support the CamelOverruleFileName header which takes precedence over\n any existing CamelFileName header; the CamelOverruleFileName is a header that is\n used only once, and makes it easier as this avoids to temporary store\n CamelFileName and have to restore it afterwards.

    \n
     \n

    String

    \n
    \n

    passiveMode (common)

    \n
    \n

    Sets passive mode connections. Default is active mode connections.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    separator (common)

    \n
    \n

    Sets the path separator to be used. UNIX = Uses unix style path separator Windows\n = Uses windows style path separator Auto = (is default) Use existing path\n separator in file name

    \n
    \n

    UNIX

    \n
    \n

    PathSeparator

    \n
    \n

    transferLoggingInterval Seconds\n (common)

    \n
    \n

    Configures the interval in seconds to use when logging the progress of upload and\n download operations that are in-flight. This is used for logging progress when\n operations takes longer time.

    \n
    \n

    5

    \n
    \n

    int

    \n
    \n

    transferLoggingLevel (common)

    \n
    \n

    Configure the logging level to use when logging the progress of upload and\n download operations.

    \n
    \n

    DEBUG

    \n
    \n

    LoggingLevel

    \n
    \n

    transferLoggingVerbose (common)

    \n
    \n

    Configures whether the perform verbose (fine grained) logging of the progress of\n upload and download operations.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    fastExistsCheck (common)

    \n
    \n

    If set this option to be true, camel-ftp will use the list file directly to check\n if the file exists. Since some FTP server may not support to list the file\n directly, if the option is false, camel-ftp will use the old way to list the\n directory and check if the file exists. This option also influences\n readLock=changed to control whether it performs a fast check to update file\n information or not. This can be used to speed up the process if the FTP server\n has a lot of files.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    bridgeErrorHandler (consumer)

    \n
    \n

    Allows for bridging the consumer to the Camel routing Error Handler, which mean\n any exceptions occurred while the consumer is trying to pickup incoming\n messages, or the likes, will now be processed as a message and handled by the\n routing Error Handler. By default the consumer will use the\n org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be\n logged at WARN or ERROR level and ignored.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    delete (consumer)

    \n
    \n

    If true, the file will be deleted after it is processed successfully.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    moveFailed (consumer)

    \n
    \n

    Sets the move failure expression based on Simple language. For example, to move\n files into a .error subdirectory use: .error. Note: When moving the files to the\n fail location Camel will handle the error and will not pick up the file again.\n

    \n
     \n

    String

    \n
    \n

    noop (consumer)

    \n
    \n

    If true, the file is not moved or deleted in any way. This option is good for\n readonly data, or for ETL type requirements. If noop=true, Camel will set\n idempotent=true as well, to avoid consuming the same files over and over again.\n

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    preMove (consumer)

    \n
    \n

    Expression (such as File Language) used to dynamically set the filename when\n moving it before processing. For example to move in-progress files into the\n order directory set this value to order.

    \n
     \n

    String

    \n
    \n

    preSort (consumer)

    \n
    \n

    When pre-sort is enabled then the consumer will sort the file and directory names\n during polling, that was retrieved from the file system. You may want to do this\n in case you need to operate on the files in a sorted order. The pre-sort is\n executed before the consumer starts to filter, and accept files to process by\n Camel. This option is default=false meaning disabled.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    recursive (consumer)

    \n
    \n

    If a directory, will look for files in all the sub-directories as well.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    resumeDownload (consumer)

    \n
    \n

    Configures whether resume download is enabled. This must be supported by the FTP\n server (almost all FTP servers support it). In addition the options\n localWorkDirectory must be configured so downloaded files are stored in a local\n directory, and the option binary must be enabled, which is required to support\n resuming of downloads.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    sendEmptyMessageWhenIdle (consumer)\n

    \n
    \n

    If the polling consumer did not poll any files, you can enable this option to\n send an empty message (no body) instead.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    streamDownload (consumer)

    \n
    \n

    Sets the download method to use when not using a local working directory. If set\n to true, the remote files are streamed to the route as they are read. When set\n to false, the remote files are loaded into memory before being sent into the\n route.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    directoryMustExist (consumer)

    \n
    \n

    Similar to startingDirectoryMustExist but this applies during polling recursive\n sub directories.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    download (consumer)

    \n
    \n

    Whether the FTP consumer should download the file. If this option is set to\n false, then the message body will be null, but the consumer will still trigger a\n Camel Exchange that has details about the file such as file name, file size,\n etc. It’s just that the file will not be downloaded.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    exceptionHandler (consumer)

    \n
    \n

    To let the consumer use a custom ExceptionHandler. Notice if the option\n bridgeErrorHandler is enabled then this options is not in use. By default the\n consumer will deal with exceptions, that will be logged at WARN or ERROR level\n and ignored.

    \n
     \n

    ExceptionHandler

    \n
    \n

    exchangePattern (consumer)

    \n
    \n

    Sets the exchange pattern when the consumer creates an exchange.

    \n
     \n

    ExchangePattern

    \n
    \n

    handleDirectoryParser AbsoluteResult\n (consumer)

    \n
    \n

    Allows you to set how the consumer will handle subfolders and files in the path\n if the directory parser results in with absolute paths The reason for this is\n that some FTP servers may return file names with absolute paths, and if so then\n the FTP component needs to handle this by converting the returned path into a\n relative path.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    ignoreFileNotFoundOr PermissionError\n (consumer)

    \n
    \n

    Whether to ignore when (trying to list files in directories or when downloading a\n file), which does not exist or due to permission error. By default when a\n directory or file does not exists or insufficient permission, then an exception\n is thrown. Setting this option to true allows to ignore that instead.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    inProgressRepository (consumer)

    \n
    \n

    A pluggable in-progress repository org.apache.camel.spi.IdempotentRepository. The\n in-progress repository is used to account the current in progress files being\n consumed. By default a memory based repository is used.

    \n
     \n

    String>

    \n
    \n

    localWorkDirectory (consumer)

    \n
    \n

    When consuming, a local work directory can be used to store the remote file\n content directly in local files, to avoid loading the content into memory. This\n is beneficial, if you consume a very big remote file and thus can conserve\n memory.

    \n
     \n

    String

    \n
    \n

    onCompletionException Handler\n (consumer)

    \n
    \n

    To use a custom org.apache.camel.spi.ExceptionHandler to handle any thrown\n exceptions that happens during the file on completion process where the consumer\n does either a commit or rollback. The default implementation will log any\n exception at WARN level and ignore.

    \n
     \n

    ExceptionHandler

    \n
    \n

    pollStrategy (consumer)

    \n
    \n

    A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to\n provide your custom implementation to control error handling usually occurred\n during the poll operation before an Exchange have been created and being routed\n in Camel.

    \n
     \n

    PollingConsumerPoll Strategy

    \n
    \n

    processStrategy (consumer)

    \n
    \n

    A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing\n you to implement your own readLock option or similar. Can also be used when\n special conditions must be met before a file can be consumed, such as a special\n ready file exists. If this option is set then the readLock option does not\n apply.

    \n
     \n

    GenericFileProcess Strategy<T>

    \n
    \n

    receiveBufferSize (consumer)

    \n
    \n

    The receive (download) buffer size Used only by FTPClient

    \n
    \n

    32768

    \n
    \n

    int

    \n
    \n

    startingDirectoryMustExist\n (consumer)

    \n
    \n

    Whether the starting directory must exist. Mind that the autoCreate option is\n default enabled, which means the starting directory is normally auto created if\n it doesn’t exist. You can disable autoCreate and enable this to ensure the\n starting directory must exist. Will thrown an exception if the directory\n doesn’t exist.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    useList (consumer)

    \n
    \n

    Whether to allow using LIST command when downloading a file. Default is true. In\n some use cases you may want to download a specific file and are not allowed to\n use the LIST command, and therefore you can set this option to false. Notice\n when using this option, then the specific file to download does not include\n meta-data information such as file size, timestamp, permissions etc, because\n those information is only possible to retrieve when LIST command is in use.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    fileExist (producer)

    \n
    \n

    What to do if a file already exists with the same name. Override, which is the\n default, replaces the existing file. Append - adds content to the existing file.\n Fail - throws a GenericFileOperationException, indicating that there is already\n an existing file. Ignore - silently ignores the problem and does not override\n the existing file, but assumes everything is okay. Move - option requires to use\n the moveExisting option to be configured as well. The option\n eagerDeleteTargetFile can be used to control what to do if an moving the file,\n and there exists already an existing file, otherwise causing the move operation\n to fail. The Move option will move any existing files, before writing the target\n file. TryRename is only applicable if tempFileName option is in use. This allows\n to try renaming the file from the temporary name to the actual name, without\n doing any exists check. This check may be faster on some file systems and\n especially FTP servers.

    \n
    \n

    Override

    \n
    \n

    GenericFileExist

    \n
    \n

    flatten (producer)

    \n
    \n

    Flatten is used to flatten the file name path to strip any leading paths, so\n it’s just the file name. This allows you to consume recursively into\n sub-directories, but when you eg write the files to another directory they will\n be written in a single directory. Setting this to true on the producer enforces\n that any file name in CamelFileName header will be stripped for any leading\n paths.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    moveExisting (producer)

    \n
    \n

    Expression (such as File Language) used to compute file name to use when\n fileExist=Move is configured. To move files into a backup subdirectory just\n enter backup. This option only supports the following File Language tokens:\n file:name, file:name.ext, file:name.noext, file:onlyname, file:onlyname.noext,\n file:ext, and file:parent. Notice the file:parent is not supported by the FTP\n component, as the FTP component can only move any existing files to a relative\n directory based on current dir as base.

    \n
     \n

    String

    \n
    \n

    tempFileName (producer)

    \n
    \n

    The same as tempPrefix option but offering a more fine grained control on the\n naming of the temporary filename as it uses the File Language.

    \n
     \n

    String

    \n
    \n

    tempPrefix (producer)

    \n
    \n

    This option is used to write the file using a temporary name and then, after the\n write is complete, rename it to the real name. Can be used to identify files\n being written and also avoid consumers (not using exclusive read locks) reading\n in progress files. Is often used by FTP when uploading big files.

    \n
     \n

    String

    \n
    \n

    allowNullBody (producer)

    \n
    \n

    Used to specify if a null body is allowed during file writing. If set to true\n then an empty file will be created, when set to false, and attempting to send a\n null body to the file component, a GenericFileWriteException of 'Cannot write\n null body to file.' will be thrown. If the fileExist option is set to\n 'Override', then the file will be truncated, and if set to append the file will\n remain unchanged.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    chmod (producer)

    \n
    \n

    Allows you to set chmod on the stored file. For example chmod=640.

    \n
     \n

    String

    \n
    \n

    disconnectOnBatchComplete (producer)\n

    \n
    \n

    Whether or not to disconnect from remote FTP server right after a Batch upload is\n complete. disconnectOnBatchComplete will only disconnect the current connection\n to the FTP server.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    eagerDeleteTargetFile (producer)

    \n
    \n

    Whether or not to eagerly delete any existing target file. This option only\n applies when you use fileExists=Override and the tempFileName option as well.\n You can use this to disable (set it to false) deleting the target file before\n the temp file is written. For example you may write big files and want the\n target file to exists during the temp file is being written. This ensure the\n target file is only deleted until the very last moment, just before the temp\n file is being renamed to the target filename. This option is also used to\n control whether to delete any existing files when fileExist=Move is enabled, and\n an existing file exists. If this option copyAndDeleteOnRenameFails false, then\n an exception will be thrown if an existing file existed, if its true, then the\n existing file is deleted before the move operation.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    keepLastModified (producer)

    \n
    \n

    Will keep the last modified timestamp from the source file (if any). Will use the\n Exchange.FILE_LAST_MODIFIED header to located the timestamp. This header can\n contain either a java.util.Date or long with the timestamp. If the timestamp\n exists and the option is enabled it will set this timestamp on the written file.\n Note: This option only applies to the file producer. You cannot use this option\n with any of the ftp producers.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    sendNoop (producer)

    \n
    \n

    Whether to send a noop command as a pre-write check before uploading files to the\n FTP server. This is enabled by default as a validation of the connection is\n still valid, which allows to silently re-connect to be able to upload the file.\n However if this causes problems, you can turn this option off.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    activePortRange (advanced)

    \n
    \n

    Set the client side port range in active mode. The syntax is: minPort-maxPort\n Both port numbers are inclusive, eg 10000-19999 to include all 1xxxx ports.

    \n
     \n

    String

    \n
    \n

    autoCreate (advanced)

    \n
    \n

    Automatically create missing directories in the file’s pathname. For the\n file consumer, that means creating the starting directory. For the file\n producer, it means the directory the files should be written to.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    bufferSize (advanced)

    \n
    \n

    Write buffer sized in bytes.

    \n
    \n

    131072

    \n
    \n

    int

    \n
    \n

    connectTimeout (advanced)

    \n
    \n

    Sets the connect timeout for waiting for a connection to be established Used by\n both FTPClient and JSCH

    \n
    \n

    10000

    \n
    \n

    int

    \n
    \n

    ftpClient (advanced)

    \n
    \n

    To use a custom instance of FTPClient

    \n
     \n

    FTPClient

    \n
    \n

    ftpClientConfig (advanced)

    \n
    \n

    To use a custom instance of FTPClientConfig to configure the FTP client the\n endpoint should use.

    \n
     \n

    FTPClientConfig

    \n
    \n

    ftpClientConfigParameters (advanced)\n

    \n
    \n

    Used by FtpComponent to provide additional parameters for the FTPClientConfig

    \n
     \n

    Map

    \n
    \n

    ftpClientParameters (advanced)

    \n
    \n

    Used by FtpComponent to provide additional parameters for the FTPClient

    \n
     \n

    Map

    \n
    \n

    maximumReconnectAttempts (advanced)\n

    \n
    \n

    Specifies the maximum reconnect attempts Camel performs when it tries to connect\n to the remote FTP server. Use 0 to disable this behavior.

    \n
     \n

    int

    \n
    \n

    reconnectDelay (advanced)

    \n
    \n

    Delay in millis Camel will wait before performing a reconnect attempt.

    \n
     \n

    long

    \n
    \n

    siteCommand (advanced)

    \n
    \n

    Sets optional site command(s) to be executed after successful login. Multiple\n site commands can be separated using a new line character.

    \n
     \n

    String

    \n
    \n

    soTimeout (advanced)

    \n
    \n

    Sets the so timeout FTP and FTPS Only for Camel 2.4. SFTP for Camel\n 2.14.3/2.15.3/2.16 onwards. Is the SocketOptions.SO_TIMEOUT value in millis.\n Recommended option is to set this to 300000 so as not have a hanged connection.\n On SFTP this option is set as timeout on the JSCH Session instance.

    \n
    \n

    300000

    \n
    \n

    int

    \n
    \n

    stepwise (advanced)

    \n
    \n

    Sets whether we should stepwise change directories while traversing file\n structures when downloading files, or as well when uploading a file to a\n directory. You can disable this if you for example are in a situation where you\n cannot change directory on the FTP server due security reasons.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    synchronous (advanced)

    \n
    \n

    Sets whether synchronous processing should be strictly used, or Camel is allowed\n to use asynchronous processing (if supported).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    throwExceptionOnConnect Failed\n (advanced)

    \n
    \n

    Should an exception be thrown if connection failed (exhausted) By default\n exception is not thrown and a WARN is logged. You can use this to enable\n exception being thrown and handle the thrown exception from the\n org.apache.camel.spi.PollingConsumerPollStrategy rollback method.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    timeout (advanced)

    \n
    \n

    Sets the data timeout for waiting for reply Used only by FTPClient

    \n
    \n

    30000

    \n
    \n

    int

    \n
    \n

    antExclude (filter)

    \n
    \n

    Ant style filter exclusion. If both antInclude and antExclude are used,\n antExclude takes precedence over antInclude. Multiple exclusions may be\n specified in comma-delimited format.

    \n
     \n

    String

    \n
    \n

    antFilterCaseSensitive (filter)

    \n
    \n

    Sets case sensitive flag on ant filter

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    antInclude (filter)

    \n
    \n

    Ant style filter inclusion. Multiple inclusions may be specified in\n comma-delimited format.

    \n
     \n

    String

    \n
    \n

    eagerMaxMessagesPerPoll (filter)

    \n
    \n

    Allows for controlling whether the limit from maxMessagesPerPoll is eager or not.\n If eager then the limit is during the scanning of files. Where as false would\n scan all files, and then perform sorting. Setting this option to false allows\n for sorting all files first, and then limit the poll. Mind that this requires a\n higher memory usage as all file details are in memory to perform the sorting.\n

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    exclude (filter)

    \n
    \n

    Is used to exclude files, if filename matches the regex pattern (matching is case\n in-senstive). Notice if you use symbols such as plus sign and others you would\n need to configure this using the RAW() syntax if configuring this as an endpoint\n uri. See more details at configuring endpoint uris

    \n
     \n

    String

    \n
    \n

    filter (filter)

    \n
    \n

    Pluggable filter as a org.apache.camel.component.file.GenericFileFilter class.\n Will skip files if filter returns false in its accept() method.

    \n
     \n

    GenericFileFilter<T>

    \n
    \n

    filterDirectory (filter)

    \n
    \n

    Filters the directory based on Simple language. For example to filter on current\n date, you can use a simple date pattern such as $date:now:yyyMMdd

    \n
     \n

    String

    \n
    \n

    filterFile (filter)

    \n
    \n

    Filters the file based on Simple language. For example to filter on file size,\n you can use $file:size 5000

    \n
     \n

    String

    \n
    \n

    idempotent (filter)

    \n
    \n

    Option to use the Idempotent Consumer EIP pattern to let Camel skip already\n processed files. Will by default use a memory based LRUCache that holds 1000\n entries. If noop=true then idempotent will be enabled as well to avoid consuming\n the same files over and over again.

    \n
    \n

    false

    \n
    \n

    Boolean

    \n
    \n

    idempotentKey (filter)

    \n
    \n

    To use a custom idempotent key. By default the absolute path of the file is used.\n You can use the File Language, for example to use the file name and file size,\n you can do: idempotentKey=$file:name-$file:size

    \n
     \n

    String

    \n
    \n

    idempotentRepository (filter)

    \n
    \n

    A pluggable repository org.apache.camel.spi.IdempotentRepository which by default\n use MemoryMessageIdRepository if none is specified and idempotent is true.

    \n
     \n

    String>

    \n
    \n

    include (filter)

    \n
    \n

    Is used to include files, if filename matches the regex pattern (matching is case\n in-sensitive). Notice if you use symbols such as plus sign and others you would\n need to configure this using the RAW() syntax if configuring this as an endpoint\n uri. See more details at configuring endpoint uris

    \n
     \n

    String

    \n
    \n

    maxDepth (filter)

    \n
    \n

    The maximum depth to traverse when recursively processing a directory.

    \n
    \n

    2147483647

    \n
    \n

    int

    \n
    \n

    maxMessagesPerPoll (filter)

    \n
    \n

    To define a maximum messages to gather per poll. By default no maximum is set.\n Can be used to set a limit of e.g. 1000 to avoid when starting up the server\n that there are thousands of files. Set a value of 0 or negative to disabled it.\n Notice: If this option is in use then the File and FTP components will limit\n before any sorting. For example if you have 100000 files and use\n maxMessagesPerPoll=500, then only the first 500 files will be picked up, and\n then sorted. You can use the eagerMaxMessagesPerPoll option and set this to\n false to allow to scan all files first and then sort afterwards.

    \n
     \n

    int

    \n
    \n

    minDepth (filter)

    \n
    \n

    The minimum depth to start processing when recursively processing a directory.\n Using minDepth=1 means the base directory. Using minDepth=2 means the first sub\n directory.

    \n
     \n

    int

    \n
    \n

    move (filter)

    \n
    \n

    Expression (such as Simple Language) used to dynamically set the filename when\n moving it after processing. To move files into a .done subdirectory just enter\n .done.

    \n
     \n

    String

    \n
    \n

    exclusiveReadLockStrategy (lock)

    \n
    \n

    Pluggable read-lock as a\n org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy\n implementation.

    \n
     \n

    GenericFileExclusive ReadLockStrategy<T>

    \n
    \n

    readLock (lock)

    \n
    \n

    Used by consumer, to only poll the files if it has exclusive read-lock on the\n file (i.e. the file is not in-progress or being written). Camel will wait until\n the file lock is granted. This option provides the build in strategies: none -\n No read lock is in use markerFile - Camel creates a marker file\n (fileName.camelLock) and then holds a lock on it. This option is not available\n for the FTP component changed - Changed is using file length/modification\n timestamp to detect whether the file is currently being copied or not. Will at\n least use 1 sec to determine this, so this option cannot consume files as fast\n as the others, but can be more reliable as the JDK IO API cannot always\n determine whether a file is currently being used by another process. The option\n readLockCheckInterval can be used to set the check frequency. fileLock - is for\n using java.nio.channels.FileLock. This option is not avail for the FTP\n component. This approach should be avoided when accessing a remote file system\n via a mount/share unless that file system supports distributed file locks.\n rename - rename is for using a try to rename the file as a test if we can get\n exclusive read-lock. idempotent - (only for file component) idempotent is for\n using a idempotentRepository as the read-lock. This allows to use read locks\n that supports clustering if the idempotent repository implementation supports\n that. idempotent-changed - (only for file component) idempotent-changed is for\n using a idempotentRepository and changed as the combined read-lock. This allows\n to use read locks that supports clustering if the idempotent repository\n implementation supports that. idempotent-rename - (only for file component)\n idempotent-rename is for using a idempotentRepository and rename as the combined\n read-lock. This allows to use read locks that supports clustering if the\n idempotent repository implementation supports that. Notice: The various read\n locks is not all suited to work in clustered mode, where concurrent consumers on\n different nodes is competing for the same files on a shared file system. The\n markerFile using a close to atomic operation to create the empty marker file,\n but its not guaranteed to work in a cluster. The fileLock may work better but\n then the file system need to support distributed file locks, and so on. Using\n the idempotent read lock can support clustering if the idempotent repository\n supports clustering, such as Hazelcast Component or Infinispan.

    \n
    \n

    none

    \n
    \n

    String

    \n
    \n

    readLockCheckInterval (lock)

    \n
    \n

    Interval in millis for the read-lock, if supported by the read lock. This\n interval is used for sleeping between attempts to acquire the read lock. For\n example when using the changed read lock, you can set a higher interval period\n to cater for slow writes. The default of 1 sec. may be too fast if the producer\n is very slow writing the file. Notice: For FTP the default readLockCheckInterval\n is 5000. The readLockTimeout value must be higher than readLockCheckInterval,\n but a rule of thumb is to have a timeout that is at least 2 or more times higher\n than the readLockCheckInterval. This is needed to ensure that amble time is\n allowed for the read lock process to try to grab the lock before the timeout was\n hit.

    \n
    \n

    1000

    \n
    \n

    long

    \n
    \n

    readLockDeleteOrphanLock Files\n (lock)

    \n
    \n

    Whether or not read lock with marker files should upon startup delete any orphan\n read lock files, which may have been left on the file system, if Camel was not\n properly shutdown (such as a JVM crash). If turning this option to false then\n any orphaned lock file will cause Camel to not attempt to pickup that file, this\n could also be due another node is concurrently reading files from the same\n shared directory.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    readLockLoggingLevel (lock)

    \n
    \n

    Logging level used when a read lock could not be acquired. By default a WARN is\n logged. You can change this level, for example to OFF to not have any logging.\n This option is only applicable for readLock of types: changed, fileLock,\n idempotent, idempotent-changed, idempotent-rename, rename.

    \n
    \n

    DEBUG

    \n
    \n

    LoggingLevel

    \n
    \n

    readLockMarkerFile (lock)

    \n
    \n

    Whether to use marker file with the changed, rename, or exclusive read lock\n types. By default a marker file is used as well to guard against other processes\n picking up the same files. This behavior can be turned off by setting this\n option to false. For example if you do not want to write marker files to the\n file systems by the Camel application.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    readLockMinAge (lock)

    \n
    \n

    This option applied only for readLock=change. This option allows to specify a\n minimum age the file must be before attempting to acquire the read lock. For\n example use readLockMinAge=300s to require the file is at last 5 minutes old.\n This can speedup the changed read lock as it will only attempt to acquire files\n which are at least that given age.

    \n
    \n

    0

    \n
    \n

    long

    \n
    \n

    readLockMinLength (lock)

    \n
    \n

    This option applied only for readLock=changed. This option allows you to\n configure a minimum file length. By default Camel expects the file to contain\n data, and thus the default value is 1. You can set this option to zero, to allow\n consuming zero-length files.

    \n
    \n

    1

    \n
    \n

    long

    \n
    \n

    readLockRemoveOnCommit (lock)

    \n
    \n

    This option applied only for readLock=idempotent. This option allows to specify\n whether to remove the file name entry from the idempotent repository when\n processing the file is succeeded and a commit happens. By default the file is\n not removed which ensures that any race-condition do not occur so another active\n node may attempt to grab the file. Instead the idempotent repository may support\n eviction strategies that you can configure to evict the file name entry after X\n minutes - this ensures no problems with race conditions.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    readLockRemoveOnRollback (lock)

    \n
    \n

    This option applied only for readLock=idempotent. This option allows to specify\n whether to remove the file name entry from the idempotent repository when\n processing the file failed and a rollback happens. If this option is false, then\n the file name entry is confirmed (as if the file did a commit).

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    readLockTimeout (lock)

    \n
    \n

    Optional timeout in millis for the read-lock, if supported by the read-lock. If\n the read-lock could not be granted and the timeout triggered, then Camel will\n skip the file. At next poll Camel, will try the file again, and this time maybe\n the read-lock could be granted. Use a value of 0 or lower to indicate forever.\n Currently fileLock, changed and rename support the timeout. Notice: For FTP the\n default readLockTimeout value is 20000 instead of 10000. The readLockTimeout\n value must be higher than readLockCheckInterval, but a rule of thumb is to have\n a timeout that is at least 2 or more times higher than the\n readLockCheckInterval. This is needed to ensure that amble time is allowed for\n the read lock process to try to grab the lock before the timeout was hit.

    \n
    \n

    10000

    \n
    \n

    long

    \n
    \n

    backoffErrorThreshold (scheduler)\n

    \n
    \n

    The number of subsequent error polls (failed due some error) that should happen\n before the backoffMultipler should kick-in.

    \n
     \n

    int

    \n
    \n

    backoffIdleThreshold (scheduler)

    \n
    \n

    The number of subsequent idle polls that should happen before the\n backoffMultipler should kick-in.

    \n
     \n

    int

    \n
    \n

    backoffMultiplier (scheduler)

    \n
    \n

    To let the scheduled polling consumer backoff if there has been a number of\n subsequent idles/errors in a row. The multiplier is then the number of polls\n that will be skipped before the next actual attempt is happening again. When\n this option is in use then backoffIdleThreshold and/or backoffErrorThreshold\n must also be configured.

    \n
     \n

    int

    \n
    \n

    delay (scheduler)

    \n
    \n

    Milliseconds before the next poll. You can also specify time values using units,\n such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds), and 1h (1 hour).

    \n
    \n

    500

    \n
    \n

    long

    \n
    \n

    greedy (scheduler)

    \n
    \n

    If greedy is enabled, then the ScheduledPollConsumer will run immediately again,\n if the previous run polled 1 or more messages.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    initialDelay (scheduler)

    \n
    \n

    Milliseconds before the first poll starts. You can also specify time values using\n units, such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds), and 1h (1\n hour).

    \n
    \n

    1000

    \n
    \n

    long

    \n
    \n

    runLoggingLevel (scheduler)

    \n
    \n

    The consumer logs a start/complete log line when it polls. This option allows you\n to configure the logging level for that.

    \n
    \n

    TRACE

    \n
    \n

    LoggingLevel

    \n
    \n

    scheduledExecutorService (scheduler)\n

    \n
    \n

    Allows for configuring a custom/shared thread pool to use for the consumer. By\n default each consumer has its own single threaded thread pool.

    \n
     \n

    ScheduledExecutor Service

    \n
    \n

    scheduler (scheduler)

    \n
    \n

    To use a cron scheduler from either camel-spring or camel-quartz2 component

    \n
    \n

    none

    \n
    \n

    ScheduledPollConsumer Scheduler

    \n
    \n

    schedulerProperties (scheduler)

    \n
    \n

    To configure additional properties when using a custom scheduler or any of the\n Quartz2, Spring based scheduler.

    \n
     \n

    Map

    \n
    \n

    startScheduler (scheduler)

    \n
    \n

    Whether the scheduler should be auto started.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    timeUnit (scheduler)

    \n
    \n

    Time unit for initialDelay and delay options.

    \n
    \n

    MILLISECONDS

    \n
    \n

    TimeUnit

    \n
    \n

    useFixedDelay (scheduler)

    \n
    \n

    Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in\n JDK for details.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    shuffle (sort)

    \n
    \n

    To shuffle the list of files (sort in random order)

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    sortBy (sort)

    \n
    \n

    Built-in sort by using the File Language. Supports nested sorts, so you can have\n a sort by file name and as a 2nd group sort by modified date.

    \n
     \n

    String

    \n
    \n

    sorter (sort)

    \n
    \n

    Pluggable sorter as a java.util.Comparator class.

    \n
     \n

    GenericFile<T>>

    \n
    \n

    account (security)

    \n
    \n

    Account to use for login

    \n
     \n

    String

    \n
    \n

    password (security)

    \n
    \n

    Password to use for login

    \n
     \n

    String

    \n
    \n

    username (security)

    \n
    \n

    Username to use for login

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    FTPS\n component default trust store

    \n
    \n
    \n
    \n

    When using the ftpClient. properties related to SSL with the FTPS\n component, the trust store accept all certificates. If you only want\n trust selective certificates, you have to configure the trust store with\n the ftpClient.trustStore.xxx options or by configuring a custom\n ftpClient.\n

    \n

    When using sslContextParameters, the trust store is managed by the\n configuration of the provided SSLContextParameters instance.

    \n

    You can configure additional options on the ftpClient and\n ftpClientConfig from the URI directly by using the ftpClient. or\n ftpClientConfig. prefix.\n

    \n

    For example to set the setDataTimeout on the FTPClient to 30 seconds\n you can do:

    \n from(\"ftp://foo@myserver?password=secret&ftpClient.dataTimeout=30000\").to(\"bean:foo\");\n

    You can mix and match and have use both prefixes, for example to\n configure date format or timezones.

    \n from(\"ftp://foo@myserver?password=secret&ftpClient.dataTimeout=30000&ftpClientConfig.serverLanguageCode=fr\").to(\"bean:foo\");\n

    You can have as many of these options as you like.

    \n

    See the documentation of the Apache Commons FTP FTPClientConfig for\n possible options and more details. And as well for Apache Commons FTP\n FTPClient.

    \n

    If you do not like having many and long configuration in the url you can\n refer to the ftpClient or ftpClientConfig to\n use by letting Camel\n lookup in the Registry for it.

    \n

    For example:

    \n
       <bean id=\"myConfig\" class=\"org.apache.commons.net.ftp.FTPClientConfig\">\n<property name=\"lenientFutureDates\" value=\"true\"/>\n<property name=\"serverLanguageCode\" value=\"fr\"/>\n</bean>
    \n

    And then let Camel lookup this bean when you use the # notation in the\n url.

    \n from(\"ftp://foo@myserver?password=secret&ftpClientConfig=#myConfig\").to(\"bean:foo\");\n
    \n\n
    \n
    \n
    \n
    \n

    Concurrency

    \n
    \n
    \n
    \n

    FTP Consumer does not support concurrency

    \n

    The FTP consumer (with the same endpoint) does not support concurrency\n (the backing FTP client is not thread safe).\n You can use multiple FTP consumers to poll from different endpoints. It\n is only a single endpoint that does not support concurrent consumers.

    \n

    The FTP producer does not have this issue, it supports\n concurrency.

    \n
    \n
    \n
    \n
    \n
    \n

    More information

    \n
    \n
    \n
    \n

    This component is an extension of the File component.\n So there are more samples and details on the File\n component page.

    \n
    \n
    \n
    \n
    \n
    \n

    Default when\n consuming files

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    limitations
    \n
    \n
    \n

    The FTP consumer will by default leave the consumed\n files untouched on the remote FTP server. You have to configure it\n explicitly if you want it to delete the files or move them to another\n location. For example you can use delete=true to delete the files, or\n use move=.done to move the files into a hidden done sub directory.

    \n

    The regular File consumer is different as it will by\n default move files to a .camel sub directory. The reason Camel does\n not do this by default for the FTP consumer is that it may\n lack\n permissions by default to be able to move or delete files.\n

    \n
    \n
    \n
    \n
    \n

    limitations

    \n
    \n
    \n
    \n

    The option readLock can be used to force Camel not to consume files\n that is currently in the progress of being written. However, this option\n is turned off by default, as it requires that the user has write access.\n See the options table at File2 for more details about\n read locks.\n There are other solutions to avoid consuming files that are currently\n being written over FTP; for instance, you can write to a temporary\n destination and move the file after it has been written.

    \n

    When moving files using move or preMove\n option the files are\n restricted to the FTP_ROOT folder. That prevents you from moving files\n outside the FTP area. If you want to move files to another area you can\n use soft links and move files into a soft linked folder.

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Message Headers

    \n
    \n
    \n
    \n

    The following message headers can be used to affect the behavior of the\n component

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    HeaderDescription
    \n

    CamelFileName

    \n
    \n

    Specifies the output file name (relative to the endpoint directory) to\n be used for the output message when sending to the endpoint. If this is\n not present and no expression either, then a generated message ID is\n used as the filename instead.

    \n
    \n

    CamelFileNameProduced

    \n
    \n

    The actual filepath (path + name) for the output file that was written.\n This header is set by Camel and its purpose is providing end-users the\n name of the file that was written.

    \n
    \n

    CamelFileIndex

    \n
    \n

    Current index out of total number of files being consumed in this batch.

    \n
    \n

    CamelFileSize

    \n
    \n

    Total number of files being consumed in this batch.

    \n
    \n

    CamelFileHost

    \n
    \n

    The remote hostname.

    \n
    \n

    CamelFileLocalWorkPath

    \n
    \n

    Path to the local work file, if local work directory is used.

    \n
    \n
    \n

    In addition the FTP/FTPS consumer and producer will enrich the Camel\n Message with the following headers\n

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    HeaderDescription
    \n

    CamelFtpReplyCode

    \n
    \n

    Camel 2.11.1: The FTP client reply code\n (the type is a integer)

    \n
    \n

    CamelFtpReplyString

    \n
    \n

    Camel 2.11.1: The FTP client reply\n string

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    About timeouts

    \n
    \n
    \n
    \n

    The two set of libraries (see top) has different API for setting\n timeout. You can use the connectTimeout option for both of them to set\n a timeout in millis to establish a network connection. An individual\n soTimeout can also be set on the FTP/FTPS, which corresponds to using\n ftpClient.soTimeout. Notice SFTP will automatically use\n connectTimeout as its soTimeout. The timeout option only applies\n for FTP/FTSP as the data timeout, which corresponds to the\n ftpClient.dataTimeout value. All timeout values are in millis.\n

    \n
    \n
    \n
    \n
    \n
    \n

    Using Local Work\n Directory

    \n
    \n
    \n
    \n

    Camel supports consuming from remote FTP servers and downloading the\n files directly into a local work directory. This avoids reading the\n entire remote file content into memory as it is streamed directly into\n the local file using FileOutputStream.

    \n

    Camel will store to a local file with the same name as the remote file,\n though with .inprogress as extension while the file is being\n downloaded. Afterwards, the file is renamed to remove the .inprogress\n suffix. And finally, when the Exchange is complete\n the local file is deleted.

    \n

    So if you want to download files from a remote FTP server and store it\n as files then you need to route to a file endpoint such as:

    \n from(\"ftp://someone@someserver.com?password=secret&localWorkDirectory=/tmp\").to(\"file://inbox\");\n
    \n \n \n \n \n \n \n \n \n
    \"[Tip]\"\n Tip
    \n

    The route above is ultra efficient as it avoids reading the entire file content into\n memory.\n It will download the remote file directly to a local file stream.\n The java.io.File handle is then used as the Exchange body.\n The file producer leverages this fact and can work directly on the work file java.io.File handle and perform a java.io.File.rename to the target filename.\n As Camel knows it’s a local work file, it can optimize and use a rename instead of\n a file copy, as the work file is meant to be deleted anyway.

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Stepwise\n changing directories

    \n
    \n
    \n
    \n \n

    Camel FTP can operate in two modes in terms of\n traversing directories when consuming files (eg downloading) or\n producing files (eg uploading)

    \n
    \n
      \n
    • stepwise
    • \n
    • not stepwise
    • \n
    \n
    \n

    You may want to pick either one depending on your situation and security\n issues. Some Camel end users can only download files if they use\n stepwise, while others can only download if they do not. At least you\n have the choice to pick (from Camel 2.6 onwards).

    \n

    In Camel 2.0 - 2.5 there is only one mode and it is:

    \n
    \n
      \n
    • before 2.5 not stepwise
    • \n
    • 2.5 stepwise
    • \n
    \n
    \n

    From Camel 2.6 onwards there is now an option stepwise you can use to\n control the behavior.

    \n

    Note that stepwise changing of directory will in most cases only work\n when the user is confined to it’s home directory and when the home\n directory is reported as \"/\".

    \n

    The difference between the two of them is best illustrated with an\n example. Suppose we have the following directory structure on the remote\n FTP server we need to traverse and download files:

    \n
    /\n/one\n/one/two\n/one/two/sub-a\n/one/two/sub-b
    \n

    And that we have a file in each of sub-a (a.txt) and sub-b (b.txt)\n folder.

    \n
    \n
    \n
    \n
    \n

    Using stepwise=true\n (default mode)

    \n
    \n
    \n
    \n
    TYPE A\n200 Type set to A\nPWD\n257 \"/\" is current directory.\nCWD one\n250 CWD successful. \"/one\" is current directory.\nCWD two\n250 CWD successful. \"/one/two\" is current directory.\nSYST\n215 UNIX emulated by FileZilla\nPORT 127,0,0,1,17,94\n200 Port command successful\nLIST\n150 Opening data channel for directory list.\n226 Transfer OK\nCWD sub-a\n250 CWD successful. \"/one/two/sub-a\" is current directory.\nPORT 127,0,0,1,17,95\n200 Port command successful\nLIST\n150 Opening data channel for directory list.\n226 Transfer OK\nCDUP\n200 CDUP successful. \"/one/two\" is current directory.\nCWD sub-b\n250 CWD successful. \"/one/two/sub-b\" is current directory.\nPORT 127,0,0,1,17,96\n200 Port command successful\nLIST\n150 Opening data channel for directory list.\n226 Transfer OK\nCDUP\n200 CDUP successful. \"/one/two\" is current directory.\nCWD /\n250 CWD successful. \"/\" is current directory.\nPWD\n257 \"/\" is current directory.\nCWD one\n250 CWD successful. \"/one\" is current directory.\nCWD two\n250 CWD successful. \"/one/two\" is current directory.\nPORT 127,0,0,1,17,97\n200 Port command successful\nRETR foo.txt\n150 Opening data channel for file transfer.\n226 Transfer OK\nCWD /\n250 CWD successful. \"/\" is current directory.\nPWD\n257 \"/\" is current directory.\nCWD one\n250 CWD successful. \"/one\" is current directory.\nCWD two\n250 CWD successful. \"/one/two\" is current directory.\nCWD sub-a\n250 CWD successful. \"/one/two/sub-a\" is current directory.\nPORT 127,0,0,1,17,98\n200 Port command successful\nRETR a.txt\n150 Opening data channel for file transfer.\n226 Transfer OK\nCWD /\n250 CWD successful. \"/\" is current directory.\nPWD\n257 \"/\" is current directory.\nCWD one\n250 CWD successful. \"/one\" is current directory.\nCWD two\n250 CWD successful. \"/one/two\" is current directory.\nCWD sub-b\n250 CWD successful. \"/one/two/sub-b\" is current directory.\nPORT 127,0,0,1,17,99\n200 Port command successful\nRETR b.txt\n150 Opening data channel for file transfer.\n226 Transfer OK\nCWD /\n250 CWD successful. \"/\" is current directory.\nQUIT\n221 Goodbye\ndisconnected.
    \n

    As you can see when stepwise is enabled, it will traverse the directory\n structure using CD xxx.

    \n
    \n
    \n
    \n
    \n
    \n

    Using stepwise=false

    \n
    \n
    \n
    \n
    230 Logged on\nTYPE A\n200 Type set to A\nSYST\n215 UNIX emulated by FileZilla\nPORT 127,0,0,1,4,122\n200 Port command successful\nLIST one/two\n150 Opening data channel for directory list\n226 Transfer OK\nPORT 127,0,0,1,4,123\n200 Port command successful\nLIST one/two/sub-a\n150 Opening data channel for directory list\n226 Transfer OK\nPORT 127,0,0,1,4,124\n200 Port command successful\nLIST one/two/sub-b\n150 Opening data channel for directory list\n226 Transfer OK\nPORT 127,0,0,1,4,125\n200 Port command successful\nRETR one/two/foo.txt\n150 Opening data channel for file transfer.\n226 Transfer OK\nPORT 127,0,0,1,4,126\n200 Port command successful\nRETR one/two/sub-a/a.txt\n150 Opening data channel for file transfer.\n226 Transfer OK\nPORT 127,0,0,1,4,127\n200 Port command successful\nRETR one/two/sub-b/b.txt\n150 Opening data channel for file transfer.\n226 Transfer OK\nQUIT\n221 Goodbye\ndisconnected.
    \n

    As you can see when not using stepwise, there are no CD operation\n invoked at all.

    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Samples

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Consuming\n a remote FTPS server (implicit SSL) and client authentication
    \n
    Consuming\n a remote FTPS server (explicit TLS) and a custom trust store configuration\n
    \n
    \n
    \n

    In the sample below we set up Camel to download all the reports from the\n FTP server once every hour (60 min) as BINARY content and store it as\n files on the local file system.

    \n

    And the route using Spring DSL:

    \n
      <route>\n<from uri=\"ftp://scott@localhost/public/reports?password=tiger&amp;binary=true&amp;delay=60000\"/>\n<to uri=\"file://target/test-reports\"/>\n</route>
    \n
    \n
    \n
    \n
    \n

    Consuming\n a remote FTPS server (implicit SSL) and client authentication

    \n
    \n
    \n
    \n from(\"ftps://admin@localhost:2222/public/camel?password=admin&securityProtocol=SSL&isImplicit=true\n &ftpClient.keyStore.file=./src/test/resources/server.jks\n&ftpClient.keyStore.password=password&ftpClient.keyStore.keyPassword=password\")\n .to(\"bean:foo\");\n
    \n
    \n
    \n
    \n
    \n

    Consuming\n a remote FTPS server (explicit TLS) and a custom trust store configuration

    \n
    \n
    \n
    \n from(\"ftps://admin@localhost:2222/public/camel?password=admin&ftpClient.trustStore.file=./src/test/resources/server.jks&ftpClient.trustStore.password=password\")\n.to(\"bean:foo\");\n
    \n
    \n
    \n
    \n
    \n
    \n

    Filter\n using org.apache.camel.component.file.GenericFileFilter

    \n
    \n
    \n
    \n

    Camel supports pluggable filtering strategies. This strategy it to use\n the build in org.apache.camel.component.file.GenericFileFilter in\n Java. You can then configure the endpoint with such a filter to skip\n certain filters before being processed.

    \n

    In the sample we have built our own filter that only accepts files\n starting with report in the filename.

    \n

    And then we can configure our route using the filter\n attribute to\n reference our filter (using # notation) that we have defined in the\n spring XML file:

    \n
       <!-- define our sorter as a plain spring bean -->\n<bean id=\"myFilter\" class=\"com.mycompany.MyFileFilter\"/>\n\n<route>\n<from uri=\"ftp://someuser@someftpserver.com?password=secret&amp;filter=#myFilter\"/>\n<to uri=\"bean:processInbox\"/>\n</route>
    \n
    \n
    \n
    \n
    \n
    \n

    Filtering using ANT path matcher

    \n
    \n
    \n
    \n

    The ANT path matcher is a filter that is shipped out-of-the-box in the\n camel-spring jar. So you need to depend on camel-spring if you are\n using Maven.\n The reason is that we leverage Spring’s\n AntPathMatcher\n to do the actual matching.\n

    \n

    The file paths are matched with the following rules:

    \n
    \n
      \n
    • ? matches one character
    • \n
    • * matches zero or more characters
    • \n
    • ** matches zero or more directories in a path
    • \n
    \n
    \n

    The sample below demonstrates how to use it:

    \n
    \n
    \n
    \n
    \n
    \n

    Using a proxy with\n SFTP

    \n
    \n
    \n
    \n

    To use an HTTP proxy to connect to your remote host, you can configure\n your route in the following way:

    \n
    <!-- define our sorter as a plain spring bean -->\n<bean id=\"proxy\" class=\"com.jcraft.jsch.ProxyHTTP\">\n<constructor-arg value=\"localhost\"/>\n<constructor-arg value=\"7777\"/>\n</bean>\n\n<route>\n<from uri=\"sftp://localhost:9999/root?username=admin&password=admin&proxy=#proxy\"/>\n<to uri=\"bean:processFile\"/>\n</route>
    \n

    You can also assign a user name and password to the proxy, if necessary.\n Please consult the documentation for com.jcraft.jsch.Proxy to discover\n all options.

    \n
    \n
    \n
    \n
    \n
    \n

    Setting preferred SFTP\n authentication method

    \n
    \n
    \n
    \n

    If you want to explicitly specify the list of authentication methods\n that should be used by sftp component, use preferredAuthentications\n option. If for example you would like Camel to attempt to authenticate\n with private/public SSH key and fallback to user/password authentication\n in the case when no public key is available, use the following route\n configuration:

    \n from(\"sftp://localhost:9999/root?username=admin&password=admin&preferredAuthentications=publickey,password\").\nto(\"bean:processFile\");\n
    \n
    \n
    \n
    \n
    \n

    Consuming a single file using a\n fixed name

    \n
    \n
    \n
    \n

    When you want to download a single file and knows the file name, you can\n use fileName=myFileName.txt to tell Camel the name of the file to\n download. By default the consumer will still do a FTP LIST command to do\n a directory listing and then filter these files based on the fileName\n option. Though in this use-case it may be desirable to turn off the\n directory listing by setting useList=false. For example the user\n account used to login to the FTP server may not have permission to do a\n FTP LIST command. So you can turn off this with useList=false, and\n then provide the fixed name of the file to download with\n fileName=myFileName.txt, then the FTP consumer can still download the\n file. If the file for some reason does not exist, then Camel will by\n default throw an exception, you can turn this off and ignore this by\n setting ignoreFileNotFoundOrPermissionError=true.\n

    \n

    For example to have a Camel route that pickup a single file, and delete\n it after use you can do

    \n from(\"ftp://admin@localhost:21/nolist/?password=admin&stepwise=false&useList=false&ignoreFileNotFoundOrPermissionError=true&fileName=report.txt&delete=true\")\n.to(\"activemq:queue:report\");\n

    Notice that we have use all the options we talked above above.

    \n

    You can also use this with ConsumerTemplate. For example to download a\n single file (if it exists) and grab the file content as a String type:

    \n String data = template.retrieveBodyNoWait(\"ftp://admin@localhost:21/nolist/?password=admin&stepwise=false&useList=false&ignoreFileNotFoundOrPermissionError=true&fileName=report.txt&delete=true\", String.class);\n
    \n
    \n
    \n
    \n
    \n

    Debug logging

    \n
    \n
    \n
    \n

    This component has log level TRACE that can be helpful if\n you have\n problems.

    \n
    \n
    \n
    \n
    \n
    \n

    See Also

    \n
    \n
    \n
    \n
    \n
      \n
    • Configuring Camel
    • \n
    • Component
    • \n
    • Endpoint
    • \n
    • Getting Started
    • \n
    • File2
    • \n
    \n
    \n
    \n
    "; exports.default = FTP; /***/ }), /***/ "./src/camel/element/compontent/FTPS.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/FTPS.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var FTPS = function (_CamelElement) { _inherits(FTPS, _CamelElement); function FTPS() { _classCallCheck(this, FTPS); var _this = _possibleConstructorReturn(this, (FTPS.__proto__ || Object.getPrototypeOf(FTPS)).call(this)); _this.scope = "FTPS"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "ftp"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.directoryName = "directoryName"; _this.port = "port"; _this.uri = "ftp:" + _this.host + ":" + _this.port + "/" + _this.directoryName; // uri _this.binary = false; _this.charset = ""; _this.disconnect = false; _this.doneFileName = ""; _this.fileName = ""; _this.passiveMode = false; _this.separator = "UNIX"; _this.transferLoggingIntervalSeconds = 5; _this.transferLoggingLevel = "DEBUG"; _this.transferLoggingVerbose = false; _this.fastExistsCheck = false; _this.bridgeErrorHandler = false; _this.delete = false; _this.moveFailed = ""; _this.noop = false; _this.preMove = ""; _this.preSort = false; _this.recursive = false; _this.resumeDownload = false; _this.sendEmptyMessageWhenIdle = false; _this.streamDownload = false; _this.directoryMustExist = false; _this.download = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.handleDirectoryParserAbsoluteResult = false; _this.ignoreFileNotFoundOrPermissionError = false; _this.inProgressRepository = ""; _this.localWorkDirectory = ""; _this.onCompletionExceptionHandler = ""; _this.pollStrategy = ""; _this.processStrategy = ""; _this.receiveBufferSize = 32768; _this.startingDirectoryMustExist = false; _this.useList = true; _this.fileExist = "Override"; _this.flatten = false; _this.jailStartingDirectory = true; _this.moveExisting = ""; _this.tempFileName = ""; _this.tempPrefix = ""; _this.allowNullBody = false; _this.chmod = ""; _this.disconnectOnBatchComplete = false; _this.eagerDeleteTargetFile = true; _this.keepLastModified = false; _this.moveExistingFileStrategy = ""; _this.sendNoop = true; _this.activePortRange = ""; _this.autoCreate = true; _this.bufferSize = 131072; _this.connectTimeout = 10000; _this.ftpClient = ""; _this.ftpClientConfig = ""; _this.ftpClientConfigParameters = ""; _this.ftpClientParameters = ""; _this.maximumReconnectAttempts = ""; _this.reconnectDelay = ""; _this.siteCommand = ""; _this.soTimeout = 300000; _this.stepwise = true; _this.synchronous = false; _this.throwExceptionOnConnectFailed = false; _this.timeout = 30000; _this.antExclude = ""; _this.antFilterCaseSensitive = true; _this.antInclude = ""; _this.eagerMaxMessagesPerPoll = true; _this.exclude = ""; _this.filter = ""; _this.filterDirectory = ""; _this.filterFile = ""; _this.idempotent = false; _this.idempotentKey = ""; _this.idempotentRepository = ""; _this.include = ""; _this.maxDepth = 2147483647; _this.maxMessagesPerPoll = ""; _this.minDepth = ""; _this.move = ""; _this.exclusiveReadLockStrategy = ""; _this.readLock = "none"; _this.readLockCheckInterval = 1000; _this.readLockDeleteOrphanLockFiles = true; _this.readLockLoggingLevel = "DEBUG"; _this.readLockMarkerFile = true; _this.readLockMinAge = ""; _this.readLockMinLength = ""; _this.readLockRemoveOnCommit = false; _this.readLockRemoveOnRollback = true; _this.readLockTimeout = 10000; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 500; _this.greedy = false; _this.initialDelay = ""; _this.runLoggingLevel = "REACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.shuffle = false; _this.sortBy = ""; _this.sorter = ""; _this.account = ""; _this.password = ""; _this.username = ""; _this.disableSecureDataChannelDefaults = false; _this.execPbsz = ""; _this.execProt = ""; _this.ftpClientKeyStoreParameters = ""; _this.ftpClientTrustStoreParameters = ""; _this.isImplicit = false; _this.securityProtocol = "TLS"; _this.sslContextParameters = ""; return _this; } _createClass(FTPS, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号+一个斜杠) * @param {原始的组件数据}} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, "2s"); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "directoryName", "port"], common: ["binary", "charset", "disconnect", "doneFileName", "fileName", "passiveMode", "separator", "transferLoggingIntervalSeconds", "transferLoggingLevel", "transferLoggingVerbose"], common_advanced: ["fastExistsCheck"], consumer: ["bridgeErrorHandler", "delete", "moveFailed", "noop", "preMove", "preSort", "recursive", "resumeDownload", "sendEmptyMessageWhenIdle", "streamDownload"], consumer_advanced: ["directoryMustExist", "download", "exceptionHandler", "exchangePattern", "handleDirectoryParserAbsoluteResult", "ignoreFileNotFoundOrPermissionError", "inProgressRepository", "localWorkDirectory", "onCompletionExceptionHandler", "pollStrategy", "processStrategy", "receiveBufferSize", "startingDirectoryMustExist", "useList"], producer: ["fileExist", "flatten", "jailStartingDirectory", "moveExisting", "tempFileName", "tempPrefix"], producer_advanced: ["allowNullBody", "chmod", "disconnectOnBatchComplete", "eagerDeleteTargetFile", "keepLastModified", "moveExistingFileStrategy", "sendNoop"], advanceds: ["activePortRange", "autoCreate", "bufferSize", "connectTimeout", "ftpClient", "ftpClientConfig", "ftpClientConfigParameters", "ftpClientParameters", "maximumReconnectAttempts", "reconnectDelay", "siteCommand", "soTimeout", "stepwise", "synchronous", "throwExceptionOnConnectFailed", "timeout"], filter: ["antExclude", "antFilterCaseSensitive", "antInclude", "eagerMaxMessagesPerPoll", "exclude", "filter", "filterDirectory", "filterFile", "idempotent", "idempotentKey", "idempotentRepository", "include", "maxDepth", "maxMessagesPerPoll", "minDepth", "move"], lock: ["exclusiveReadLockStrategy", "readLock", "readLockCheckInterval", "readLockDeleteOrphanLockFiles", "readLockLoggingLevel", "readLockMarkerFile", "readLockMinAge", "readLockMinLength", "readLockRemoveOnCommit", "readLockRemoveOnRollback", "readLockTimeout"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["shuffle", "sortBy", "sorter"], security: ["account", "password", "username", "disableSecureDataChannelDefaults", "execPbsz", "execProt", "ftpClientKeyStoreParameters", "ftpClientTrustStoreParameters", "isImplicit", "securityProtocol", "sslContextParameters"] }, documentation: FTPS.documentation }; } }]); return FTPS; }(_CamelElement3.default); FTPS.documentation = "
    \n
    \n
    \n
    \n

    FTPS Component

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    URI Options
    \n
    \n
    \n

    Available as of Camel version 2.2

    \n

    This component provides access to remote file systems over the FTP and\n SFTP protocols.

    \n

    Maven users will need to add the following dependency to their pom.xml\n for this component:

    \n
    <dependency>\n<groupId>org.apache.camel</groupId>\n<artifactId>camel-ftp</artifactId>\n<version>x.x.x</version>\n<!-- use the same version as your Camel core version -->\n</dependency>
    \n

    For more information you can look at FTP\n component

    \n
    \n
    \n
    \n
    \n

    URI Options

    \n
    \n
    \n
    \n \n

    The options below are exclusive for the FTPS component.

    \n

    The FTPS component supports 2 options which are listed below.

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    useGlobalSslContext Parameters\n (security)

    \n
    \n

    Enable usage of global SSL context parameters.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    resolveProperty Placeholders (advanced)\n

    \n
    \n

    Whether the component should resolve property placeholders on itself when starting.\n Only properties which are of String type can use property placeholders.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n
    \n

    The FTPS endpoint is configured using URI syntax:

    \n
    ftps:host:port/directoryName
    \n

    with the following path and query parameters:

    \n
    \n
    \n
    \n
    \n

    Path Parameters (3\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    host

    \n
    \n

    Required Hostname of the FTP server\n

    \n
     \n

    String

    \n
    \n

    port

    \n
    \n

    Port of the FTP server

    \n
     \n

    int

    \n
    \n

    directoryName

    \n
    \n

    The starting directory

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Query Parameters (116\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    binary (common)

    \n
    \n

    Specifies the file transfer mode, BINARY or ASCII. Default is ASCII (false).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    charset (common)

    \n
    \n

    This option is used to specify the encoding of the file. You can use this on the\n consumer, to specify the encodings of the files, which allow Camel to know the\n charset it should load the file content in case the file content is being\n accessed. Likewise when writing a file, you can use this option to specify which\n charset to write the file as well. Do mind that when writing the file Camel may\n have to read the message content into memory to be able to convert the data into\n the configured charset, so do not use this if you have big messages.

    \n
     \n

    String

    \n
    \n

    disconnect (common)

    \n
    \n

    Whether or not to disconnect from remote FTP server right after use. Disconnect\n will only disconnect the current connection to the FTP server. If you have a\n consumer which you want to stop, then you need to stop the consumer/route\n instead.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    doneFileName (common)

    \n
    \n

    Producer: If provided, then Camel will write a 2nd done file when the original\n file has been written. The done file will be empty. This option configures what\n file name to use. Either you can specify a fixed name. Or you can use dynamic\n placeholders. The done file will always be written in the same folder as the\n original file. Consumer: If provided, Camel will only consume files if a done\n file exists. This option configures what file name to use. Either you can\n specify a fixed name. Or you can use dynamic placeholders.The done file is\n always expected in the same folder as the original file. Only $file.name and\n $file.name.noext is supported as dynamic placeholders.

    \n
     \n

    String

    \n
    \n

    fileName (common)

    \n
    \n

    Use Expression such as File Language to dynamically set the filename. For\n consumers, it’s used as a filename filter. For producers, it’s used\n to evaluate the filename to write. If an expression is set, it take precedence\n over the CamelFileName header. (Note: The header itself can also be an\n Expression). The expression options support both String and Expression types. If\n the expression is a String type, it is always evaluated using the File Language.\n If the expression is an Expression type, the specified Expression type is used -\n this allows you, for instance, to use OGNL expressions. For the consumer, you\n can use it to filter filenames, so you can for instance consume today’s\n file using the File Language syntax: mydata-$date:now:yyyyMMdd.txt. The\n producers support the CamelOverruleFileName header which takes precedence over\n any existing CamelFileName header; the CamelOverruleFileName is a header that is\n used only once, and makes it easier as this avoids to temporary store\n CamelFileName and have to restore it afterwards.

    \n
     \n

    String

    \n
    \n

    passiveMode (common)

    \n
    \n

    Sets passive mode connections. Default is active mode connections.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    separator (common)

    \n
    \n

    Sets the path separator to be used. UNIX = Uses unix style path separator Windows\n = Uses windows style path separator Auto = (is default) Use existing path\n separator in file name

    \n
    \n

    UNIX

    \n
    \n

    PathSeparator

    \n
    \n

    transferLoggingInterval Seconds\n (common)

    \n
    \n

    Configures the interval in seconds to use when logging the progress of upload and\n download operations that are in-flight. This is used for logging progress when\n operations takes longer time.

    \n
    \n

    5

    \n
    \n

    int

    \n
    \n

    transferLoggingLevel (common)

    \n
    \n

    Configure the logging level to use when logging the progress of upload and\n download operations.

    \n
    \n

    DEBUG

    \n
    \n

    LoggingLevel

    \n
    \n

    transferLoggingVerbose (common)

    \n
    \n

    Configures whether the perform verbose (fine grained) logging of the progress of\n upload and download operations.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    fastExistsCheck (common)

    \n
    \n

    If set this option to be true, camel-ftp will use the list file directly to check\n if the file exists. Since some FTP server may not support to list the file\n directly, if the option is false, camel-ftp will use the old way to list the\n directory and check if the file exists. This option also influences\n readLock=changed to control whether it performs a fast check to update file\n information or not. This can be used to speed up the process if the FTP server\n has a lot of files.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    bridgeErrorHandler (consumer)

    \n
    \n

    Allows for bridging the consumer to the Camel routing Error Handler, which mean\n any exceptions occurred while the consumer is trying to pickup incoming\n messages, or the likes, will now be processed as a message and handled by the\n routing Error Handler. By default the consumer will use the\n org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be\n logged at WARN or ERROR level and ignored.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    delete (consumer)

    \n
    \n

    If true, the file will be deleted after it is processed successfully.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    moveFailed (consumer)

    \n
    \n

    Sets the move failure expression based on Simple language. For example, to move\n files into a .error subdirectory use: .error. Note: When moving the files to the\n fail location Camel will handle the error and will not pick up the file again.\n

    \n
     \n

    String

    \n
    \n

    noop (consumer)

    \n
    \n

    If true, the file is not moved or deleted in any way. This option is good for\n readonly data, or for ETL type requirements. If noop=true, Camel will set\n idempotent=true as well, to avoid consuming the same files over and over again.\n

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    preMove (consumer)

    \n
    \n

    Expression (such as File Language) used to dynamically set the filename when\n moving it before processing. For example to move in-progress files into the\n order directory set this value to order.

    \n
     \n

    String

    \n
    \n

    preSort (consumer)

    \n
    \n

    When pre-sort is enabled then the consumer will sort the file and directory names\n during polling, that was retrieved from the file system. You may want to do this\n in case you need to operate on the files in a sorted order. The pre-sort is\n executed before the consumer starts to filter, and accept files to process by\n Camel. This option is default=false meaning disabled.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    recursive (consumer)

    \n
    \n

    If a directory, will look for files in all the sub-directories as well.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    resumeDownload (consumer)

    \n
    \n

    Configures whether resume download is enabled. This must be supported by the FTP\n server (almost all FTP servers support it). In addition the options\n localWorkDirectory must be configured so downloaded files are stored in a local\n directory, and the option binary must be enabled, which is required to support\n resuming of downloads.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    sendEmptyMessageWhenIdle (consumer)\n

    \n
    \n

    If the polling consumer did not poll any files, you can enable this option to\n send an empty message (no body) instead.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    streamDownload (consumer)

    \n
    \n

    Sets the download method to use when not using a local working directory. If set\n to true, the remote files are streamed to the route as they are read. When set\n to false, the remote files are loaded into memory before being sent into the\n route.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    directoryMustExist (consumer)

    \n
    \n

    Similar to startingDirectoryMustExist but this applies during polling recursive\n sub directories.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    download (consumer)

    \n
    \n

    Whether the FTP consumer should download the file. If this option is set to\n false, then the message body will be null, but the consumer will still trigger a\n Camel Exchange that has details about the file such as file name, file size,\n etc. It’s just that the file will not be downloaded.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    exceptionHandler (consumer)

    \n
    \n

    To let the consumer use a custom ExceptionHandler. Notice if the option\n bridgeErrorHandler is enabled then this options is not in use. By default the\n consumer will deal with exceptions, that will be logged at WARN or ERROR level\n and ignored.

    \n
     \n

    ExceptionHandler

    \n
    \n

    exchangePattern (consumer)

    \n
    \n

    Sets the exchange pattern when the consumer creates an exchange.

    \n
     \n

    ExchangePattern

    \n
    \n

    handleDirectoryParser AbsoluteResult\n (consumer)

    \n
    \n

    Allows you to set how the consumer will handle subfolders and files in the path\n if the directory parser results in with absolute paths The reason for this is\n that some FTP servers may return file names with absolute paths, and if so then\n the FTP component needs to handle this by converting the returned path into a\n relative path.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    ignoreFileNotFoundOr PermissionError\n (consumer)

    \n
    \n

    Whether to ignore when (trying to list files in directories or when downloading a\n file), which does not exist or due to permission error. By default when a\n directory or file does not exists or insufficient permission, then an exception\n is thrown. Setting this option to true allows to ignore that instead.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    inProgressRepository (consumer)

    \n
    \n

    A pluggable in-progress repository org.apache.camel.spi.IdempotentRepository. The\n in-progress repository is used to account the current in progress files being\n consumed. By default a memory based repository is used.

    \n
     \n

    String>

    \n
    \n

    localWorkDirectory (consumer)

    \n
    \n

    When consuming, a local work directory can be used to store the remote file\n content directly in local files, to avoid loading the content into memory. This\n is beneficial, if you consume a very big remote file and thus can conserve\n memory.

    \n
     \n

    String

    \n
    \n

    onCompletionException Handler\n (consumer)

    \n
    \n

    To use a custom org.apache.camel.spi.ExceptionHandler to handle any thrown\n exceptions that happens during the file on completion process where the consumer\n does either a commit or rollback. The default implementation will log any\n exception at WARN level and ignore.

    \n
     \n

    ExceptionHandler

    \n
    \n

    pollStrategy (consumer)

    \n
    \n

    A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to\n provide your custom implementation to control error handling usually occurred\n during the poll operation before an Exchange have been created and being routed\n in Camel.

    \n
     \n

    PollingConsumerPoll Strategy

    \n
    \n

    processStrategy (consumer)

    \n
    \n

    A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing\n you to implement your own readLock option or similar. Can also be used when\n special conditions must be met before a file can be consumed, such as a special\n ready file exists. If this option is set then the readLock option does not\n apply.

    \n
     \n

    GenericFileProcess Strategy<T>

    \n
    \n

    receiveBufferSize (consumer)

    \n
    \n

    The receive (download) buffer size Used only by FTPClient

    \n
    \n

    32768

    \n
    \n

    int

    \n
    \n

    startingDirectoryMustExist\n (consumer)

    \n
    \n

    Whether the starting directory must exist. Mind that the autoCreate option is\n default enabled, which means the starting directory is normally auto created if\n it doesn’t exist. You can disable autoCreate and enable this to ensure the\n starting directory must exist. Will thrown an exception if the directory\n doesn’t exist.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    useList (consumer)

    \n
    \n

    Whether to allow using LIST command when downloading a file. Default is true. In\n some use cases you may want to download a specific file and are not allowed to\n use the LIST command, and therefore you can set this option to false. Notice\n when using this option, then the specific file to download does not include\n meta-data information such as file size, timestamp, permissions etc, because\n those information is only possible to retrieve when LIST command is in use.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    fileExist (producer)

    \n
    \n

    What to do if a file already exists with the same name. Override, which is the\n default, replaces the existing file. Append - adds content to the existing file.\n Fail - throws a GenericFileOperationException, indicating that there is already\n an existing file. Ignore - silently ignores the problem and does not override\n the existing file, but assumes everything is okay. Move - option requires to use\n the moveExisting option to be configured as well. The option\n eagerDeleteTargetFile can be used to control what to do if an moving the file,\n and there exists already an existing file, otherwise causing the move operation\n to fail. The Move option will move any existing files, before writing the target\n file. TryRename is only applicable if tempFileName option is in use. This allows\n to try renaming the file from the temporary name to the actual name, without\n doing any exists check. This check may be faster on some file systems and\n especially FTP servers.

    \n
    \n

    Override

    \n
    \n

    GenericFileExist

    \n
    \n

    flatten (producer)

    \n
    \n

    Flatten is used to flatten the file name path to strip any leading paths, so\n it’s just the file name. This allows you to consume recursively into\n sub-directories, but when you eg write the files to another directory they will\n be written in a single directory. Setting this to true on the producer enforces\n that any file name in CamelFileName header will be stripped for any leading\n paths.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    moveExisting (producer)

    \n
    \n

    Expression (such as File Language) used to compute file name to use when\n fileExist=Move is configured. To move files into a backup subdirectory just\n enter backup. This option only supports the following File Language tokens:\n file:name, file:name.ext, file:name.noext, file:onlyname, file:onlyname.noext,\n file:ext, and file:parent. Notice the file:parent is not supported by the FTP\n component, as the FTP component can only move any existing files to a relative\n directory based on current dir as base.

    \n
     \n

    String

    \n
    \n

    tempFileName (producer)

    \n
    \n

    The same as tempPrefix option but offering a more fine grained control on the\n naming of the temporary filename as it uses the File Language.

    \n
     \n

    String

    \n
    \n

    tempPrefix (producer)

    \n
    \n

    This option is used to write the file using a temporary name and then, after the\n write is complete, rename it to the real name. Can be used to identify files\n being written and also avoid consumers (not using exclusive read locks) reading\n in progress files. Is often used by FTP when uploading big files.

    \n
     \n

    String

    \n
    \n

    allowNullBody (producer)

    \n
    \n

    Used to specify if a null body is allowed during file writing. If set to true\n then an empty file will be created, when set to false, and attempting to send a\n null body to the file component, a GenericFileWriteException of 'Cannot write\n null body to file.' will be thrown. If the fileExist option is set to\n 'Override', then the file will be truncated, and if set to append the file will\n remain unchanged.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    chmod (producer)

    \n
    \n

    Allows you to set chmod on the stored file. For example chmod=640.

    \n
     \n

    String

    \n
    \n

    disconnectOnBatchComplete (producer)\n

    \n
    \n

    Whether or not to disconnect from remote FTP server right after a Batch upload is\n complete. disconnectOnBatchComplete will only disconnect the current connection\n to the FTP server.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    eagerDeleteTargetFile (producer)

    \n
    \n

    Whether or not to eagerly delete any existing target file. This option only\n applies when you use fileExists=Override and the tempFileName option as well.\n You can use this to disable (set it to false) deleting the target file before\n the temp file is written. For example you may write big files and want the\n target file to exists during the temp file is being written. This ensure the\n target file is only deleted until the very last moment, just before the temp\n file is being renamed to the target filename. This option is also used to\n control whether to delete any existing files when fileExist=Move is enabled, and\n an existing file exists. If this option copyAndDeleteOnRenameFails false, then\n an exception will be thrown if an existing file existed, if its true, then the\n existing file is deleted before the move operation.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    keepLastModified (producer)

    \n
    \n

    Will keep the last modified timestamp from the source file (if any). Will use the\n Exchange.FILE_LAST_MODIFIED header to located the timestamp. This header can\n contain either a java.util.Date or long with the timestamp. If the timestamp\n exists and the option is enabled it will set this timestamp on the written file.\n Note: This option only applies to the file producer. You cannot use this option\n with any of the ftp producers.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    sendNoop (producer)

    \n
    \n

    Whether to send a noop command as a pre-write check before uploading files to the\n FTP server. This is enabled by default as a validation of the connection is\n still valid, which allows to silently re-connect to be able to upload the file.\n However if this causes problems, you can turn this option off.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    activePortRange (advanced)

    \n
    \n

    Set the client side port range in active mode. The syntax is: minPort-maxPort\n Both port numbers are inclusive, eg 10000-19999 to include all 1xxxx ports.

    \n
     \n

    String

    \n
    \n

    autoCreate (advanced)

    \n
    \n

    Automatically create missing directories in the file’s pathname. For the\n file consumer, that means creating the starting directory. For the file\n producer, it means the directory the files should be written to.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    bufferSize (advanced)

    \n
    \n

    Write buffer sized in bytes.

    \n
    \n

    131072

    \n
    \n

    int

    \n
    \n

    connectTimeout (advanced)

    \n
    \n

    Sets the connect timeout for waiting for a connection to be established Used by\n both FTPClient and JSCH

    \n
    \n

    10000

    \n
    \n

    int

    \n
    \n

    ftpClient (advanced)

    \n
    \n

    To use a custom instance of FTPClient

    \n
     \n

    FTPClient

    \n
    \n

    ftpClientConfig (advanced)

    \n
    \n

    To use a custom instance of FTPClientConfig to configure the FTP client the\n endpoint should use.

    \n
     \n

    FTPClientConfig

    \n
    \n

    ftpClientConfigParameters (advanced)\n

    \n
    \n

    Used by FtpComponent to provide additional parameters for the FTPClientConfig

    \n
     \n

    Map

    \n
    \n

    ftpClientParameters (advanced)

    \n
    \n

    Used by FtpComponent to provide additional parameters for the FTPClient

    \n
     \n

    Map

    \n
    \n

    maximumReconnectAttempts (advanced)\n

    \n
    \n

    Specifies the maximum reconnect attempts Camel performs when it tries to connect\n to the remote FTP server. Use 0 to disable this behavior.

    \n
     \n

    int

    \n
    \n

    reconnectDelay (advanced)

    \n
    \n

    Delay in millis Camel will wait before performing a reconnect attempt.

    \n
     \n

    long

    \n
    \n

    siteCommand (advanced)

    \n
    \n

    Sets optional site command(s) to be executed after successful login. Multiple\n site commands can be separated using a new line character.

    \n
     \n

    String

    \n
    \n

    soTimeout (advanced)

    \n
    \n

    Sets the so timeout FTP and FTPS Only for Camel 2.4. SFTP for Camel\n 2.14.3/2.15.3/2.16 onwards. Is the SocketOptions.SO_TIMEOUT value in millis.\n Recommended option is to set this to 300000 so as not have a hanged connection.\n On SFTP this option is set as timeout on the JSCH Session instance.

    \n
    \n

    300000

    \n
    \n

    int

    \n
    \n

    stepwise (advanced)

    \n
    \n

    Sets whether we should stepwise change directories while traversing file\n structures when downloading files, or as well when uploading a file to a\n directory. You can disable this if you for example are in a situation where you\n cannot change directory on the FTP server due security reasons.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    synchronous (advanced)

    \n
    \n

    Sets whether synchronous processing should be strictly used, or Camel is allowed\n to use asynchronous processing (if supported).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    throwExceptionOnConnect Failed\n (advanced)

    \n
    \n

    Should an exception be thrown if connection failed (exhausted) By default\n exception is not thrown and a WARN is logged. You can use this to enable\n exception being thrown and handle the thrown exception from the\n org.apache.camel.spi.PollingConsumerPollStrategy rollback method.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    timeout (advanced)

    \n
    \n

    Sets the data timeout for waiting for reply Used only by FTPClient

    \n
    \n

    30000

    \n
    \n

    int

    \n
    \n

    antExclude (filter)

    \n
    \n

    Ant style filter exclusion. If both antInclude and antExclude are used,\n antExclude takes precedence over antInclude. Multiple exclusions may be\n specified in comma-delimited format.

    \n
     \n

    String

    \n
    \n

    antFilterCaseSensitive (filter)

    \n
    \n

    Sets case sensitive flag on ant filter

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    antInclude (filter)

    \n
    \n

    Ant style filter inclusion. Multiple inclusions may be specified in\n comma-delimited format.

    \n
     \n

    String

    \n
    \n

    eagerMaxMessagesPerPoll (filter)

    \n
    \n

    Allows for controlling whether the limit from maxMessagesPerPoll is eager or not.\n If eager then the limit is during the scanning of files. Where as false would\n scan all files, and then perform sorting. Setting this option to false allows\n for sorting all files first, and then limit the poll. Mind that this requires a\n higher memory usage as all file details are in memory to perform the sorting.\n

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    exclude (filter)

    \n
    \n

    Is used to exclude files, if filename matches the regex pattern (matching is case\n in-senstive). Notice if you use symbols such as plus sign and others you would\n need to configure this using the RAW() syntax if configuring this as an endpoint\n uri. See more details at configuring endpoint uris

    \n
     \n

    String

    \n
    \n

    filter (filter)

    \n
    \n

    Pluggable filter as a org.apache.camel.component.file.GenericFileFilter class.\n Will skip files if filter returns false in its accept() method.

    \n
     \n

    GenericFileFilter<T>

    \n
    \n

    filterDirectory (filter)

    \n
    \n

    Filters the directory based on Simple language. For example to filter on current\n date, you can use a simple date pattern such as $date:now:yyyMMdd

    \n
     \n

    String

    \n
    \n

    filterFile (filter)

    \n
    \n

    Filters the file based on Simple language. For example to filter on file size,\n you can use $file:size 5000

    \n
     \n

    String

    \n
    \n

    idempotent (filter)

    \n
    \n

    Option to use the Idempotent Consumer EIP pattern to let Camel skip already\n processed files. Will by default use a memory based LRUCache that holds 1000\n entries. If noop=true then idempotent will be enabled as well to avoid consuming\n the same files over and over again.

    \n
    \n

    false

    \n
    \n

    Boolean

    \n
    \n

    idempotentKey (filter)

    \n
    \n

    To use a custom idempotent key. By default the absolute path of the file is used.\n You can use the File Language, for example to use the file name and file size,\n you can do: idempotentKey=$file:name-$file:size

    \n
     \n

    String

    \n
    \n

    idempotentRepository (filter)

    \n
    \n

    A pluggable repository org.apache.camel.spi.IdempotentRepository which by default\n use MemoryMessageIdRepository if none is specified and idempotent is true.

    \n
     \n

    String>

    \n
    \n

    include (filter)

    \n
    \n

    Is used to include files, if filename matches the regex pattern (matching is case\n in-sensitive). Notice if you use symbols such as plus sign and others you would\n need to configure this using the RAW() syntax if configuring this as an endpoint\n uri. See more details at configuring endpoint uris

    \n
     \n

    String

    \n
    \n

    maxDepth (filter)

    \n
    \n

    The maximum depth to traverse when recursively processing a directory.

    \n
    \n

    2147483647

    \n
    \n

    int

    \n
    \n

    maxMessagesPerPoll (filter)

    \n
    \n

    To define a maximum messages to gather per poll. By default no maximum is set.\n Can be used to set a limit of e.g. 1000 to avoid when starting up the server\n that there are thousands of files. Set a value of 0 or negative to disabled it.\n Notice: If this option is in use then the File and FTP components will limit\n before any sorting. For example if you have 100000 files and use\n maxMessagesPerPoll=500, then only the first 500 files will be picked up, and\n then sorted. You can use the eagerMaxMessagesPerPoll option and set this to\n false to allow to scan all files first and then sort afterwards.

    \n
     \n

    int

    \n
    \n

    minDepth (filter)

    \n
    \n

    The minimum depth to start processing when recursively processing a directory.\n Using minDepth=1 means the base directory. Using minDepth=2 means the first sub\n directory.

    \n
     \n

    int

    \n
    \n

    move (filter)

    \n
    \n

    Expression (such as Simple Language) used to dynamically set the filename when\n moving it after processing. To move files into a .done subdirectory just enter\n .done.

    \n
     \n

    String

    \n
    \n

    exclusiveReadLockStrategy (lock)

    \n
    \n

    Pluggable read-lock as a\n org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy\n implementation.

    \n
     \n

    GenericFileExclusive ReadLockStrategy<T>

    \n
    \n

    readLock (lock)

    \n
    \n

    Used by consumer, to only poll the files if it has exclusive read-lock on the\n file (i.e. the file is not in-progress or being written). Camel will wait until\n the file lock is granted. This option provides the build in strategies: none -\n No read lock is in use markerFile - Camel creates a marker file\n (fileName.camelLock) and then holds a lock on it. This option is not available\n for the FTP component changed - Changed is using file length/modification\n timestamp to detect whether the file is currently being copied or not. Will at\n least use 1 sec to determine this, so this option cannot consume files as fast\n as the others, but can be more reliable as the JDK IO API cannot always\n determine whether a file is currently being used by another process. The option\n readLockCheckInterval can be used to set the check frequency. fileLock - is for\n using java.nio.channels.FileLock. This option is not avail for the FTP\n component. This approach should be avoided when accessing a remote file system\n via a mount/share unless that file system supports distributed file locks.\n rename - rename is for using a try to rename the file as a test if we can get\n exclusive read-lock. idempotent - (only for file component) idempotent is for\n using a idempotentRepository as the read-lock. This allows to use read locks\n that supports clustering if the idempotent repository implementation supports\n that. idempotent-changed - (only for file component) idempotent-changed is for\n using a idempotentRepository and changed as the combined read-lock. This allows\n to use read locks that supports clustering if the idempotent repository\n implementation supports that. idempotent-rename - (only for file component)\n idempotent-rename is for using a idempotentRepository and rename as the combined\n read-lock. This allows to use read locks that supports clustering if the\n idempotent repository implementation supports that. Notice: The various read\n locks is not all suited to work in clustered mode, where concurrent consumers on\n different nodes is competing for the same files on a shared file system. The\n markerFile using a close to atomic operation to create the empty marker file,\n but its not guaranteed to work in a cluster. The fileLock may work better but\n then the file system need to support distributed file locks, and so on. Using\n the idempotent read lock can support clustering if the idempotent repository\n supports clustering, such as Hazelcast Component or Infinispan.

    \n
    \n

    none

    \n
    \n

    String

    \n
    \n

    readLockCheckInterval (lock)

    \n
    \n

    Interval in millis for the read-lock, if supported by the read lock. This\n interval is used for sleeping between attempts to acquire the read lock. For\n example when using the changed read lock, you can set a higher interval period\n to cater for slow writes. The default of 1 sec. may be too fast if the producer\n is very slow writing the file. Notice: For FTP the default readLockCheckInterval\n is 5000. The readLockTimeout value must be higher than readLockCheckInterval,\n but a rule of thumb is to have a timeout that is at least 2 or more times higher\n than the readLockCheckInterval. This is needed to ensure that amble time is\n allowed for the read lock process to try to grab the lock before the timeout was\n hit.

    \n
    \n

    1000

    \n
    \n

    long

    \n
    \n

    readLockDeleteOrphanLock Files\n (lock)

    \n
    \n

    Whether or not read lock with marker files should upon startup delete any orphan\n read lock files, which may have been left on the file system, if Camel was not\n properly shutdown (such as a JVM crash). If turning this option to false then\n any orphaned lock file will cause Camel to not attempt to pickup that file, this\n could also be due another node is concurrently reading files from the same\n shared directory.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    readLockLoggingLevel (lock)

    \n
    \n

    Logging level used when a read lock could not be acquired. By default a WARN is\n logged. You can change this level, for example to OFF to not have any logging.\n This option is only applicable for readLock of types: changed, fileLock,\n idempotent, idempotent-changed, idempotent-rename, rename.

    \n
    \n

    DEBUG

    \n
    \n

    LoggingLevel

    \n
    \n

    readLockMarkerFile (lock)

    \n
    \n

    Whether to use marker file with the changed, rename, or exclusive read lock\n types. By default a marker file is used as well to guard against other processes\n picking up the same files. This behavior can be turned off by setting this\n option to false. For example if you do not want to write marker files to the\n file systems by the Camel application.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    readLockMinAge (lock)

    \n
    \n

    This option applied only for readLock=change. This option allows to specify a\n minimum age the file must be before attempting to acquire the read lock. For\n example use readLockMinAge=300s to require the file is at last 5 minutes old.\n This can speedup the changed read lock as it will only attempt to acquire files\n which are at least that given age.

    \n
    \n

    0

    \n
    \n

    long

    \n
    \n

    readLockMinLength (lock)

    \n
    \n

    This option applied only for readLock=changed. This option allows you to\n configure a minimum file length. By default Camel expects the file to contain\n data, and thus the default value is 1. You can set this option to zero, to allow\n consuming zero-length files.

    \n
    \n

    1

    \n
    \n

    long

    \n
    \n

    readLockRemoveOnCommit (lock)

    \n
    \n

    This option applied only for readLock=idempotent. This option allows to specify\n whether to remove the file name entry from the idempotent repository when\n processing the file is succeeded and a commit happens. By default the file is\n not removed which ensures that any race-condition do not occur so another active\n node may attempt to grab the file. Instead the idempotent repository may support\n eviction strategies that you can configure to evict the file name entry after X\n minutes - this ensures no problems with race conditions.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    readLockRemoveOnRollback (lock)

    \n
    \n

    This option applied only for readLock=idempotent. This option allows to specify\n whether to remove the file name entry from the idempotent repository when\n processing the file failed and a rollback happens. If this option is false, then\n the file name entry is confirmed (as if the file did a commit).

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    readLockTimeout (lock)

    \n
    \n

    Optional timeout in millis for the read-lock, if supported by the read-lock. If\n the read-lock could not be granted and the timeout triggered, then Camel will\n skip the file. At next poll Camel, will try the file again, and this time maybe\n the read-lock could be granted. Use a value of 0 or lower to indicate forever.\n Currently fileLock, changed and rename support the timeout. Notice: For FTP the\n default readLockTimeout value is 20000 instead of 10000. The readLockTimeout\n value must be higher than readLockCheckInterval, but a rule of thumb is to have\n a timeout that is at least 2 or more times higher than the\n readLockCheckInterval. This is needed to ensure that amble time is allowed for\n the read lock process to try to grab the lock before the timeout was hit.

    \n
    \n

    10000

    \n
    \n

    long

    \n
    \n

    backoffErrorThreshold (scheduler)\n

    \n
    \n

    The number of subsequent error polls (failed due some error) that should happen\n before the backoffMultipler should kick-in.

    \n
     \n

    int

    \n
    \n

    backoffIdleThreshold (scheduler)

    \n
    \n

    The number of subsequent idle polls that should happen before the\n backoffMultipler should kick-in.

    \n
     \n

    int

    \n
    \n

    backoffMultiplier (scheduler)

    \n
    \n

    To let the scheduled polling consumer backoff if there has been a number of\n subsequent idles/errors in a row. The multiplier is then the number of polls\n that will be skipped before the next actual attempt is happening again. When\n this option is in use then backoffIdleThreshold and/or backoffErrorThreshold\n must also be configured.

    \n
     \n

    int

    \n
    \n

    delay (scheduler)

    \n
    \n

    Milliseconds before the next poll. You can also specify time values using units,\n such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds), and 1h (1 hour).

    \n
    \n

    500

    \n
    \n

    long

    \n
    \n

    greedy (scheduler)

    \n
    \n

    If greedy is enabled, then the ScheduledPollConsumer will run immediately again,\n if the previous run polled 1 or more messages.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    initialDelay (scheduler)

    \n
    \n

    Milliseconds before the first poll starts. You can also specify time values using\n units, such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds), and 1h (1\n hour).

    \n
    \n

    1000

    \n
    \n

    long

    \n
    \n

    runLoggingLevel (scheduler)

    \n
    \n

    The consumer logs a start/complete log line when it polls. This option allows you\n to configure the logging level for that.

    \n
    \n

    TRACE

    \n
    \n

    LoggingLevel

    \n
    \n

    scheduledExecutorService (scheduler)\n

    \n
    \n

    Allows for configuring a custom/shared thread pool to use for the consumer. By\n default each consumer has its own single threaded thread pool.

    \n
     \n

    ScheduledExecutor Service

    \n
    \n

    scheduler (scheduler)

    \n
    \n

    To use a cron scheduler from either camel-spring or camel-quartz2 component

    \n
    \n

    none

    \n
    \n

    ScheduledPollConsumer Scheduler

    \n
    \n

    schedulerProperties (scheduler)

    \n
    \n

    To configure additional properties when using a custom scheduler or any of the\n Quartz2, Spring based scheduler.

    \n
     \n

    Map

    \n
    \n

    startScheduler (scheduler)

    \n
    \n

    Whether the scheduler should be auto started.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    timeUnit (scheduler)

    \n
    \n

    Time unit for initialDelay and delay options.

    \n
    \n

    MILLISECONDS

    \n
    \n

    TimeUnit

    \n
    \n

    useFixedDelay (scheduler)

    \n
    \n

    Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in\n JDK for details.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    shuffle (sort)

    \n
    \n

    To shuffle the list of files (sort in random order)

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    sortBy (sort)

    \n
    \n

    Built-in sort by using the File Language. Supports nested sorts, so you can have\n a sort by file name and as a 2nd group sort by modified date.

    \n
     \n

    String

    \n
    \n

    sorter (sort)

    \n
    \n

    Pluggable sorter as a java.util.Comparator class.

    \n
     \n

    GenericFile<T>>

    \n
    \n

    account (security)

    \n
    \n

    Account to use for login

    \n
     \n

    String

    \n
    \n

    disableSecureDataChannel Defaults\n (security)

    \n
    \n

    Use this option to disable default options when using secure data channel. This\n allows you to be in full control what the execPbsz and execProt setting should\n be used. Default is false

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    execPbsz (security)

    \n
    \n

    When using secure data channel you can set the exec protection buffer size

    \n
     \n

    Long

    \n
    \n

    execProt (security)

    \n
    \n

    The exec protection level PROT command. C - Clear S - Safe(SSL protocol only) E -\n Confidential(SSL protocol only) P - Private

    \n
     \n

    String

    \n
    \n

    ftpClientKeyStore Parameters\n (security)

    \n
    \n

    Set the key store parameters

    \n
     \n

    Map

    \n
    \n

    ftpClientTrustStore Parameters\n (security)

    \n
    \n

    Set the trust store parameters

    \n
     \n

    Map

    \n
    \n

    isImplicit (security)

    \n
    \n

    Set the security mode(Implicit/Explicit). true - Implicit Mode / False - Explicit\n Mode

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    password (security)

    \n
    \n

    Password to use for login

    \n
     \n

    String

    \n
    \n

    securityProtocol (security)

    \n
    \n

    Set the underlying security protocol.

    \n
    \n

    TLS

    \n
    \n

    String

    \n
    \n

    sslContextParameters (security)

    \n
    \n

    Gets the JSSE configuration that overrides any settings in link\n FtpsEndpointftpClientKeyStoreParameters, link ftpClientTrustStoreParameters, and\n link FtpsConfigurationgetSecurityProtocol().

    \n
     \n

    SSLContextParameters

    \n
    \n

    username (security)

    \n
    \n

    Username to use for login

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    "; exports.default = FTPS; /***/ }), /***/ "./src/camel/element/compontent/File.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/File.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var File = function (_CamelElement) { _inherits(File, _CamelElement); function File() { _classCallCheck(this, File); var _this = _possibleConstructorReturn(this, (File.__proto__ || Object.getPrototypeOf(File)).call(this)); _this.scope = "File"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "ftp"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.directoryName = "directoryName"; _this.uri = "file:" + _this.directoryName; // uri _this.charset = ""; _this.doneFileName = ""; _this.fileName = ""; _this.bridgeErrorHandler = false; _this.delete = false; _this.moveFailed = ""; _this.noop = false; _this.preMove = ""; _this.preSort = false; _this.recursive = false; _this.sendEmptyMessageWhenIdle = false; _this.directoryMustExist = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.extendedAttributes = ""; _this.inProgressRepository = ""; _this.localWorkDirectory = ""; _this.onCompletionExceptionHandler = ""; _this.pollStrategy = ""; _this.probeContentType = false; _this.processStrategy = ""; _this.startingDirectoryMustExist = false; _this.fileExist = "Override"; _this.flatten = false; _this.jailStartingDirectory = true; _this.moveExisting = ""; _this.tempFileName = ""; _this.tempPrefix = ""; _this.allowNullBody = false; _this.chmod = ""; _this.disconnectOnBatchComplete = ""; _this.eagerDeleteTargetFile = true; _this.forceWrites = true; _this.keepLastModified = false; _this.moveExistingFileStrategy = ""; _this.sendNoop = ""; _this.autoCreate = true; _this.bufferSize = 131072; _this.renameUsingCopy = true; _this.copyAndDeleteOnRenameFail = false; _this.synchronous = false; _this.antExclude = ""; _this.antFilterCaseSensitive = false; _this.antInclude = ""; _this.eagerMaxMessagesPerPoll = false; _this.exclude = ""; _this.filter = ""; _this.filterDirectory = ""; _this.filterFile = ""; _this.idempotent = false; _this.idempotentKey = ""; _this.idempotentRepository = ""; _this.include = ""; _this.maxDepth = 2147483647; _this.maxMessagesPerPoll = ""; _this.minDepth = ""; _this.move = ""; _this.exclusiveReadLockStrategy = ""; _this.readLock = "none"; _this.readLockCheckInterval = 1000; _this.readLockDeleteOrphanLockFiles = true; _this.readLockIdempotentReleaseAsync = false; _this.readLockIdempotentReleaseAsyncPoolSize = ""; _this.readLockIdempotentReleaseDelay = ""; _this.readLockIdempotentReleaseExecutorService = ""; _this.readLockLoggingLevel = "DEBUG"; _this.readLockMarkerFile = true; _this.readLockMinAge = 0; _this.readLockMinLength = 1; _this.readLockRemoveOnCommit = false; _this.readLockRemoveOnRollback = true; _this.readLockTimeout = 10000; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 500; _this.greedy = false; _this.initialDelay = 1000; _this.runLoggingLevel = "REACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.shuffle = false; _this.sortBy = ""; _this.sorter = ""; return _this; } _createClass(File, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["directoryName"], common: ["charset", "doneFileName", "fileName"], consumer: ["bridgeErrorHandler", "delete", "moveFailed", "noop", "preMove", "preSort", "recursive", "sendEmptyMessageWhenIdle"], consumer_advanced: ["directoryMustExist", "exceptionHandler", "exchangePattern", "extendedAttributes", "inProgressRepository", "localWorkDirectory", "onCompletionExceptionHandler", "pollStrategy", "probeContentType", "processStrategy", "startingDirectoryMustExist"], producer: ["fileExist", "flatten", "jailStartingDirectory", "moveExisting", "tempFileName", "tempPrefix"], producer_advanced: ["allowNullBody", "chmod", "disconnectOnBatchComplete", "eagerDeleteTargetFile", "keepLastModified", "moveExistingFileStrategy", "sendNoop"], advanceds: ["autoCreate", "bufferSize", "renameUsingCopy", "copyAndDeleteOnRenameFail", "synchronous"], filter: ["antExclude", "antFilterCaseSensitive", "antInclude", "eagerMaxMessagesPerPoll", "exclude", "filter", "filterDirectory", "filterFile", "idempotent", "idempotentKey", "idempotentRepository", "include", "maxDepth", "maxMessagesPerPoll", "minDepth", "move"], lock: ["exclusiveReadLockStrategy", "readLock", "readLockCheckInterval", "readLockDeleteOrphanLockFiles", "readLockIdempotentReleaseAsync", "readLockIdempotentReleaseAsyncPoolSize", "readLockIdempotentReleaseDelay", "readLockIdempotentReleaseExecutorService", "readLockLoggingLevel", "readLockMarkerFile", "readLockMinAge", "readLockMinLength", "readLockRemoveOnCommit", "readLockRemoveOnRollback", "readLockTimeout"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["shuffle", "sortBy", "sorter"] }, documentation: File.documentation }; } }]); return File; }(_CamelElement3.default); File.documentation = ""; exports.default = File; /***/ }), /***/ "./src/camel/element/compontent/Generic.js": /*!*************************************************!*\ !*** ./src/camel/element/compontent/Generic.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /***/ }), /***/ "./src/camel/element/compontent/IMAP.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/IMAP.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var IMAP = function (_CamelElement) { _inherits(IMAP, _CamelElement); function IMAP() { _classCallCheck(this, IMAP); var _this = _possibleConstructorReturn(this, (IMAP.__proto__ || Object.getPrototypeOf(IMAP)).call(this)); _this.scope = "IMAP"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "imap"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.uri = "imap:" + _this.host + ":" + _this.port; // uri _this.bridgeErrorHandler = false; _this.copyTo = true; _this.closeFolder = ""; _this.delete = false; _this.disconnect = false; _this.handleFailedMessage = false; _this.maxMessagesPerPoll = ""; _this.mimeDecodeHeaders = false; _this.peek = true; _this.sendEmptyMessageWhenIdle = false; _this.skipFailedMessage = false; _this.unseen = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.fetchSize = -1; _this.folderName = "INBOX"; _this.mailUidGenerator = ""; _this.mapMailMessage = true; _this.pollStrategy = ""; _this.postProcessAction = ""; _this.bcc = ""; _this.cc = ""; _this.from = "camel@localhost"; _this.replyTo = ""; _this.subject = ""; _this.to = ""; _this.javaMailSender = ""; _this.additionalJavaMailProperties = ""; _this.alternativeBodyHeader = "CamelMailAlternativeBody"; _this.attachmentsContentTransferEncodingResolver = ""; _this.binding = ""; _this.connectionTimeout = 30000; _this.contentType = "text/plain"; _this.contentTypeResolver = ""; _this.debugMode = false; _this.headerFilterStrategy = ""; _this.ignoreUnsupportedCharset = false; _this.ignoreUriScheme = false; _this.session = ""; _this.synchronous = false; _this.useInlineAttachments = false; _this.idempotentRepository = ""; _this.idempotentRepositoryRemoveOnCommit = true; _this.searchTerm = ""; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 60000; _this.greedy = ""; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.sortTeam = ""; _this.dummyTrustManager = false; _this.password = ""; _this.sslContextParameters = ""; _this.username = ""; return _this; } _createClass(IMAP, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port"], consumer: ["bridgeErrorHandler", "copyTo", "closeFolder", "delete", "disconnect", "handleFailedMessage", "maxMessagesPerPoll", "mimeDecodeHeaders", "peek", "sendEmptyMessageWhenIdle", "skipFailedMessage", "unseen"], consumer_advanced: ["exceptionHandler", "exchangePattern", "fetchSize", "folderName", "mailUidGenerator", "mapMailMessage", "pollStrategy", "postProcessAction"], producer: ["bcc", "cc", "from", "replyTo", "subject", "to"], producer_advanced: ["javaMailSender"], advanceds: ["additionalJavaMailProperties", "alternativeBodyHeader", "attachmentsContentTransferEncodingResolver", "binding", "connectionTimeout", "contentType", "contentTypeResolver", "debugMode", "headerFilterStrategy", "ignoreUnsupportedCharset", "ignoreUriScheme", "session", "synchronous", "useInlineAttachments"], filter: ["idempotentRepository", "idempotentRepositoryRemoveOnCommit", "searchTerm"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["sortTeam"], security: ["dummyTrustManager", "password", "sslContextParameters", "username"] }, documentation: IMAP.documentation }; } }]); return IMAP; }(_CamelElement3.default); IMAP.documentation = ""; exports.default = IMAP; /***/ }), /***/ "./src/camel/element/compontent/IMAPSecure.js": /*!****************************************************!*\ !*** ./src/camel/element/compontent/IMAPSecure.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var IMAPSecure = function (_CamelElement) { _inherits(IMAPSecure, _CamelElement); function IMAPSecure() { _classCallCheck(this, IMAPSecure); var _this = _possibleConstructorReturn(this, (IMAPSecure.__proto__ || Object.getPrototypeOf(IMAPSecure)).call(this)); _this.scope = "IMAPSecure"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "imapsecure"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.uri = "imap:" + _this.host + ":" + _this.port; // uri _this.bridgeErrorHandler = false; _this.copyTo = true; _this.closeFolder = ""; _this.delete = false; _this.disconnect = false; _this.handleFailedMessage = false; _this.maxMessagesPerPoll = ""; _this.mimeDecodeHeaders = false; _this.peek = true; _this.sendEmptyMessageWhenIdle = false; _this.skipFailedMessage = false; _this.unseen = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.fetchSize = -1; _this.folderName = "INBOX"; _this.mailUidGenerator = ""; _this.mapMailMessage = true; _this.pollStrategy = ""; _this.postProcessAction = ""; _this.bcc = ""; _this.cc = ""; _this.from = "camel@localhost"; _this.replyTo = ""; _this.subject = ""; _this.to = ""; _this.javaMailSender = ""; _this.additionalJavaMailProperties = ""; _this.alternativeBodyHeader = "CamelMailAlternativeBody"; _this.attachmentsContentTransferEncodingResolver = ""; _this.binding = ""; _this.connectionTimeout = 30000; _this.contentType = "text/plain"; _this.contentTypeResolver = ""; _this.debugMode = false; _this.headerFilterStrategy = ""; _this.ignoreUnsupportedCharset = false; _this.ignoreUriScheme = false; _this.session = ""; _this.synchronous = false; _this.useInlineAttachments = false; _this.idempotentRepository = ""; _this.idempotentRepositoryRemoveOnCommit = true; _this.searchTerm = ""; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 60000; _this.greedy = ""; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.sortTeam = ""; _this.dummyTrustManager = false; _this.password = ""; _this.sslContextParameters = ""; _this.username = ""; return _this; } _createClass(IMAPSecure, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port"], consumer: ["bridgeErrorHandler", "copyTo", "closeFolder", "delete", "disconnect", "handleFailedMessage", "maxMessagesPerPoll", "mimeDecodeHeaders", "peek", "sendEmptyMessageWhenIdle", "skipFailedMessage", "unseen"], consumer_advanced: ["exceptionHandler", "exchangePattern", "fetchSize", "folderName", "mailUidGenerator", "mapMailMessage", "pollStrategy", "postProcessAction"], producer: ["bcc", "cc", "from", "replyTo", "subject", "to"], producer_advanced: ["javaMailSender"], advanceds: ["additionalJavaMailProperties", "alternativeBodyHeader", "attachmentsContentTransferEncodingResolver", "binding", "connectionTimeout", "contentType", "contentTypeResolver", "debugMode", "headerFilterStrategy", "ignoreUnsupportedCharset", "ignoreUriScheme", "session", "synchronous", "useInlineAttachments"], filter: ["idempotentRepository", "idempotentRepositoryRemoveOnCommit", "searchTerm"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["sortTeam"], security: ["dummyTrustManager", "password", "sslContextParameters", "username"] }, documentation: IMAPSecure.documentation }; } }]); return IMAPSecure; }(_CamelElement3.default); IMAPSecure.documentation = ""; exports.default = IMAPSecure; /***/ }), /***/ "./src/camel/element/compontent/JDBC.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/JDBC.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var JDBC = function (_CamelElement) { _inherits(JDBC, _CamelElement); function JDBC() { _classCallCheck(this, JDBC); var _this = _possibleConstructorReturn(this, (JDBC.__proto__ || Object.getPrototypeOf(JDBC)).call(this)); _this.scope = "JDBC"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "jdbc"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.dataSourceName = "dataSourceName"; _this.uri = "jdbc:" + _this.dataSourceName; // uri _this.allowNamedParameters = true; _this.outputClass = ""; _this.outputType = "SelectList"; _this.parameters = ""; _this.readSize = ""; _this.resetAutoCommit = true; _this.transacted = false; _this.useGetBytesForBlob = false; _this.useHeadersAsParameters = false; _this.useJDBC4ColumnNameAndLabelSemantics = true; _this.beanRowMapper = ""; _this.prepareStatementStrategy = ""; _this.synchronous = false; return _this; } _createClass(JDBC, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["dataSourceName"], producer: ["allowNamedParameters", "outputClass", "outputType", "parameters", "readSize", "resetAutoCommit", "transacted", "useGetBytesForBlob", "useHeadersAsParameters", "useJDBC4ColumnNameAndLabelSemantics"], advanceds: ["beanRowMapper", "prepareStatementStrategy", "synchronous"] }, documentation: JDBC.documentation }; } }]); return JDBC; }(_CamelElement3.default); JDBC.documentation = "
    \n
    \n
    \n
    \n

    JDBC Component

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    URI format
    \n
    Options
    \n
    Result
    \n
    Generated keys
    \n
    Using named\n parameters
    \n
    Samples
    \n
    Sample\n - Polling the database every minute
    \n
    Sample - Move\n Data Between Data Sources
    \n
    See Also
    \n
    \n
    \n

    Available as of Camel version 1.2

    \n

    The jdbc component enables you to access databases through JDBC,\n where\n SQL queries (SELECT) and operations (INSERT, UPDATE, etc) are sent in\n the message body. This component uses the standard JDBC API, unlike the\n SQL Component component, which uses\n spring-jdbc.\n

    \n

    Maven users will need to add the following dependency to their pom.xml\n for this component:

    \n
    <dependency>\n<groupId>org.apache.camel</groupId>\n<artifactId>camel-jdbc</artifactId>\n<version>x.x.x</version>\n<!-- use the same version as your Camel core version -->\n</dependency>
    \n

    This component can only be used to define producer endpoints, which\n means that you cannot use the JDBC component in a from() statement.

    \n
    \n
    \n
    \n
    \n

    URI format

    \n
    \n
    \n
    \n
    jdbc:dataSourceName[?options]
    \n

    This component only supports producer endpoints.

    \n

    You can append query options to the URI in the following format,\n ?option=value&option=value&…​\n

    \n
    \n
    \n
    \n
    \n
    \n

    Options

    \n
    \n
    \n
    \n \n

    The JDBC component supports 2 options which are listed below.

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    dataSource (producer)

    \n
    \n

    To use the DataSource instance instead of looking up the data source by name from the\n registry.

    \n
     \n

    DataSource

    \n
    \n

    resolveProperty Placeholders (advanced)\n

    \n
    \n

    Whether the component should resolve property placeholders on itself when starting.\n Only properties which are of String type can use property placeholders.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n
    \n

    The JDBC endpoint is configured using URI syntax:

    \n
    jdbc:dataSourceName
    \n

    with the following path and query parameters:

    \n
    \n
    \n
    \n
    \n

    Path Parameters (1\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    dataSourceName

    \n
    \n

    Required Name of DataSource to\n lookup in the Registry.

    \n
     \n

    String

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Query Parameters (13\n parameters):

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescriptionDefaultType
    \n

    allowNamedParameters (producer)

    \n
    \n

    Whether to allow using named parameters in the queries.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    outputClass (producer)

    \n
    \n

    Specify the full package and class name to use as conversion when\n outputType=SelectOne or SelectList.

    \n
     \n

    String

    \n
    \n

    outputType (producer)

    \n
    \n

    Determines the output the producer should use.

    \n
    \n

    SelectList

    \n
    \n

    JdbcOutputType

    \n
    \n

    parameters (producer)

    \n
    \n

    Optional parameters to the java.sql.Statement. For example to set maxRows,\n fetchSize etc.

    \n
     \n

    Map

    \n
    \n

    readSize (producer)

    \n
    \n

    The default maximum number of rows that can be read by a polling query. The\n default value is 0.

    \n
     \n

    int

    \n
    \n

    resetAutoCommit (producer)

    \n
    \n

    Camel will set the autoCommit on the JDBC connection to be false, commit the\n change after executed the statement and reset the autoCommit flag of the\n connection at the end, if the resetAutoCommit is true. If the JDBC connection\n doesn’t support to reset the autoCommit flag, you can set the\n resetAutoCommit flag to be false, and Camel will not try to reset the autoCommit\n flag. When used with XA transactions you most likely need to set it to false so\n that the transaction manager is in charge of committing this tx.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    transacted (producer)

    \n
    \n

    Whether transactions are in use.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    useGetBytesForBlob (producer)

    \n
    \n

    To read BLOB columns as bytes instead of string data. This may be needed for\n certain databases such as Oracle where you must read BLOB columns as bytes.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    useHeadersAsParameters (producer)\n

    \n
    \n

    Set this option to true to use the prepareStatementStrategy with named\n parameters. This allows to define queries with named placeholders, and use\n headers with the dynamic values for the query placeholders.

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n

    useJDBC4ColumnNameAnd LabelSemantics\n (producer)

    \n
    \n

    Sets whether to use JDBC 4 or JDBC 3.0 or older semantic when retrieving column\n name. JDBC 4.0 uses columnLabel to get the column name where as JDBC 3.0 uses\n both columnName or columnLabel. Unfortunately JDBC drivers behave differently so\n you can use this option to work out issues around your JDBC driver if you get\n problem using this component This option is default true.

    \n
    \n

    true

    \n
    \n

    boolean

    \n
    \n

    beanRowMapper (advanced)

    \n
    \n

    To use a custom org.apache.camel.component.jdbc.BeanRowMapper when using\n outputClass. The default implementation will lower case the row names and skip\n underscores, and dashes. For example CUST_ID is mapped as custId.

    \n
     \n

    BeanRowMapper

    \n
    \n

    prepareStatementStrategy (advanced)\n

    \n
    \n

    Allows to plugin to use a custom\n org.apache.camel.component.jdbc.JdbcPrepareStatementStrategy to control\n preparation of the query and prepared statement.

    \n
     \n

    JdbcPrepareStatement Strategy

    \n
    \n

    synchronous (advanced)

    \n
    \n

    Sets whether synchronous processing should be strictly used, or Camel is allowed\n to use asynchronous processing (if supported).

    \n
    \n

    false

    \n
    \n

    boolean

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Result

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Message\n Headers
    \n
    \n
    \n

    By default the result is returned in the OUT body as an\n ArrayList<HashMap<String, Object>>. The List object contains the\n list of rows and the Map objects contain each row with the String\n key as the column name. You can use the option outputType to control\n the result.\n

    \n

    Note: This component fetches ResultSetMetaData to be able to return\n the column name as the key in the Map.

    \n
    \n
    \n
    \n
    \n

    Message Headers

    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    HeaderDescription
    \n

    CamelJdbcRowCount

    \n
    \n

    If the query is a SELECT, query the row count is\n returned in this OUT\n header.

    \n
    \n

    CamelJdbcUpdateCount

    \n
    \n

    If the query is an UPDATE, query the update count is\n returned in this\n OUT header.

    \n
    \n

    CamelGeneratedKeysRows

    \n
    \n

    Camel 2.10: Rows that contains the\n generated kets.

    \n
    \n

    CamelGeneratedKeysRowCount

    \n
    \n

    Camel 2.10: The number of rows in\n the header that contains generated\n keys.

    \n
    \n

    CamelJdbcColumnNames

    \n
    \n

    Camel 2.11.1: The column names from\n the ResultSet as a java.util.Set\n type.

    \n
    \n

    CamelJdbcParametes

    \n
    \n

    Camel 2.12: A java.util.Map which has the headers to be used if\n useHeadersAsParameters has been enabled.\n

    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    Generated keys

    \n
    \n
    \n
    \n

    Available as of Camel 2.10

    \n

    If you insert data using SQL INSERT, then the RDBMS may support auto\n generated keys. You can instruct the JDBC producer to\n return the generated keys in headers.\n To do that set the header CamelRetrieveGeneratedKeys=true. Then the\n generated keys will be provided as headers with the keys listed in the\n table above.

    \n

    You can see more details in this\n unit\n test.\n

    \n

    Using generated keys does not work with together with named parameters.

    \n
    \n
    \n
    \n
    \n
    \n

    Using named\n parameters

    \n
    \n
    \n
    \n

    Available as of Camel 2.12

    \n

    In the given route below, we want to get all the projects from the\n projects table. Notice the SQL query has 2 named parameters, :?lic and\n :?min.\n Camel will then lookup these parameters from the message headers.\n Notice in the example above we set two headers with constant value\n for the named parameters:

    \n from(\"direct:projects\")\n.setHeader(\"lic\", constant(\"ASF\"))\n.setHeader(\"min\", constant(123))\n.setBody(\"select * from projects where license = :?lic and id > :?min order by id\")\n.to(\"jdbc:myDataSource?useHeadersAsParameters=true\")\n

    You can also store the header values in a java.util.Map and store the\n map on the headers with the key CamelJdbcParameters.

    \n
    \n
    \n
    \n
    \n
    \n

    Samples

    \n
    \n
    \n
    \n

    In the following example, we fetch the rows from the customer table.

    \n

    First we register our datasource in the Camel registry as testdb:

    \n

    Then we configure a route that routes to the JDBC component, so the SQL\n will be executed. Note how we refer to the testdb datasource that was\n bound in the previous step:

    \n

    Or you can create a DataSource in Spring like this:

    \n

    We create an endpoint, add the SQL query to the body of the IN message,\n and then send the exchange. The result of the query is returned in the\n OUT body:

    \n

    If you want to work on the rows one by one instead of the entire\n ResultSet at once you need to use the Splitter EIP\n such as:

    \n

    In Camel 2.13.x or older

    \n

    In Camel 2.14.x or newer

    \n from(\"direct:hello\")\n// here we split the data from the testdb into new messages one by one\n// so the mock endpoint will receive a message per row in the table\n// the StreamList option allows to stream the result of the query without creating a List of rows\n// and notice we also enable streaming mode on the splitter\n.to(\"jdbc:testdb?outputType=StreamList\")\n.split(body()).streaming()\n.to(\"mock:result\");\n
    \n
    \n
    \n
    \n
    \n

    Sample - Polling the database every\n minute

    \n
    \n
    \n
    \n

    If we want to poll a database using the JDBC component, we need to\n combine it with a polling scheduler such as the Timer\n or Quartz etc. In\n the following example, we retrieve\n data from the database every 60 seconds:

    \n from(\"timer://foo?period=60000\").setBody(constant(\"select * from customer\")).to(\"jdbc:testdb\").to(\"activemq:queue:customers\");\n
    \n
    \n
    \n
    \n
    \n

    Sample - Move Data Between\n Data Sources

    \n
    \n
    \n
    \n

    A common use case is to query for data, process it and move it to\n another data source (ETL operations). In the following example, we\n retrieve new customer records from the source table every hour,\n filter/transform them and move them to a destination table:

    \n from(\"timer://MoveNewCustomersEveryHour?period=3600000\")\n.setBody(constant(\"select * from customer where create_time > (sysdate-1/24)\"))\n.to(\"jdbc:testdb\")\n.split(body())\n.process(new MyCustomerProcessor()) //filter/transform results as needed\n.setBody(simple(\"insert into processed_customer values('{body[ID]}','{body[NAME]}')\"))\n.to(\"jdbc:testdb\");\n

     

    \n
    \n
    \n
    \n
    \n
    \n

    See Also

    \n
    \n
    \n
    \n
    \n
      \n
    • Configuring Camel
    • \n
    • Component
    • \n
    • Endpoint
    • \n
    • Getting Started
    • \n
    • SQL
    • \n
    \n
    \n
    \n
    "; exports.default = JDBC; /***/ }), /***/ "./src/camel/element/compontent/JGroups.js": /*!*************************************************!*\ !*** ./src/camel/element/compontent/JGroups.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var JGroups = function (_CamelElement) { _inherits(JGroups, _CamelElement); function JGroups() { _classCallCheck(this, JGroups); var _this = _possibleConstructorReturn(this, (JGroups.__proto__ || Object.getPrototypeOf(JGroups)).call(this)); _this.scope = "JGroups"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "jgroups"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.clusterName = "clusterName"; _this.uri = "jgroups:" + _this.clusterName; // uri _this.channelProperties = ""; _this.bridgeErrorHandler = false; _this.enableViewMessages = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.synchronous = false; return _this; } _createClass(JGroups, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["clusterName"], common: ["channelProperties"], consumer: ["bridgeErrorHandler", "enableViewMessages"], consumer_advanced: ["exceptionHandler", "exchangePattern"], advanceds: ["synchronous"] }, documentation: JGroups.documentation }; } }]); return JGroups; }(_CamelElement3.default); JGroups.documentation = ""; exports.default = JGroups; /***/ }), /***/ "./src/camel/element/compontent/JMS.js": /*!*********************************************!*\ !*** ./src/camel/element/compontent/JMS.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var JMS = function (_CamelElement) { _inherits(JMS, _CamelElement); function JMS() { _classCallCheck(this, JMS); var _this = _possibleConstructorReturn(this, (JMS.__proto__ || Object.getPrototypeOf(JMS)).call(this)); _this.scope = "JMS"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "jms"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.destinationName = "destinationName"; _this.destinationType = "queue"; _this.uri = "imap:" + _this.destinationName + ":" + _this.destinationType; // uri _this.clientId = ""; _this.connectionFactory = ""; _this.disableReplyTo = false; _this.durableSubscriptionName = ""; _this.jmsMessageType = ""; _this.testConnectionOnStartup = false; _this.acknowledgementModeName = "AUTO_ACKNOWLEDGE"; _this.asyncConsumer = false; _this.autoStartup = true; _this.bridgeErrorHandler = false; _this.cacheLevel = ""; _this.cacheLevelName = "CACHE_AUTO"; _this.concurrentConsumers = 1; _this.maxConcurrentConsumers = ""; _this.replyTo = ""; _this.replyToDeliveryPersistent = true; _this.selector = ""; _this.subscriptionDurable = false; _this.subscriptionName = ""; _this.subscriptionShared = false; _this.acceptMessagesWhileStopping = false; _this.allowReplyManagerQuickStop = false; _this.consumerType = "Defalut"; _this.defaultTaskExecutorType = ""; _this.eagerLoadingOfProperties = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.exposeListenerSession = false; _this.replyToSameDestinationAllowed = false; _this.taskExecutor = ""; _this.deliveryMode = ""; _this.deliveryPersistent = true; _this.explicitQosEnabled = false; _this.formatDateHeadersToIso8601 = false; _this.preserveMessageQos = false; _this.priority = "4"; _this.replyToConcurrentConsumers = 1; _this.replyToMaxConcurrentConsumers = ""; _this.replyToOnTimeoutMaxConcurrentConsumers = 1; _this.replyToOverride = ""; _this.replyToType = ""; _this.requestTimeout = 20000; _this.timeToLive = -1; _this.allowAdditionalHeaders = ""; _this.allowNullBody = true; _this.alwaysCopyMessage = false; _this.correlationProperty = ""; _this.disableTimeToLive = false; _this.forceSendOriginalMessage = false; _this.includeSentJMSMessageID = false; _this.replyToCacheLevelName = ""; _this.replyToDestinationSelectorName = ""; _this.streamMessageTypeEnabled = false; _this.allowSerializedHeaders = false; _this.asyncStartListener = false; _this.asyncStopListener = false; _this.destinationResolver = ""; _this.errorHandler = ""; _this.exceptionListener = ""; _this.headerFilterStrategy = ""; _this.idleConsumerLimit = 1; _this.idleTaskExecutionLimit = 1; _this.includeAllJMSXProperties = false; _this.jmsKeyFormatStrategy = ""; _this.mapJmsMessage = true; _this.maxMessagesPerTask = -1; _this.messageConverter = ""; _this.messageCreatedStrategy = ""; _this.messageIdEnabled = true; _this.messageListenerContainerFactory = ""; _this.messageTimestampEnabled = true; _this.pubSubNoLocal = false; _this.receiveTimeout = 1000; _this.recoveryInterval = 5000; _this.requestTimeoutCheckerInterval = 1000; _this.synchronous = false; _this.transferException = false; _this.transferExchange = false; _this.transferFault = false; _this.useMessageIDAsCorrelationID = false; _this.waitForProvisionCorrelationToBeUpdatedCounter = 50; _this.waitForProvisionCorrelationToBeUpdatedThreadSleepingTime = 100; _this.errorHandlerLogStackTrace = true; _this.errorHandlerLoggingLevel = "WARN"; _this.password = ""; _this.username = ""; _this.transacted = false; _this.lazyCreateTransactionManager = true; _this.transactionManager = ""; _this.transactionName = ""; _this.transactionTimeout = -1; return _this; } _createClass(JMS, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["destinationName", "destinationType"], common: ["clientId", "connectionFactory", "disableReplyTo", "durableSubscriptionName", "jmsMessageType", "testConnectionOnStartup"], consumer: ["acknowledgementModeName", "asyncConsumer", "autoStartup", "bridgeErrorHandler", "cacheLevel", "cacheLevelName", "concurrentConsumers", "maxConcurrentConsumers", "replyTo", "replyToDeliveryPersistent", "selector", "subscriptionDurable", "subscriptionName", "subscriptionShared"], consumer_advanced: ["acceptMessagesWhileStopping", "allowReplyManagerQuickStop", "consumerType", "defaultTaskExecutorType", "eagerLoadingOfProperties", "exceptionHandler", "exchangePattern", "exposeListenerSession", "replyToSameDestinationAllowed", "taskExecutor"], producer: ["deliveryMode", "deliveryPersistent", "explicitQosEnabled", "formatDateHeadersToIso8601", "preserveMessageQos", "priority", "replyToConcurrentConsumers", "replyToMaxConcurrentConsumers", "replyToOnTimeoutMaxConcurrentConsumers", "replyToOverride", "replyToType", "requestTimeout", "timeToLive"], producer_advanced: ["allowAdditionalHeaders", "allowNullBody", "alwaysCopyMessage", "correlationProperty", "disableTimeToLive", "forceSendOriginalMessage", "includeSentJMSMessageID", "replyToCacheLevelName", "replyToDestinationSelectorName", "streamMessageTypeEnabled"], advanceds: ["allowSerializedHeaders", "asyncStartListener", "asyncStopListener", "destinationResolver", "errorHandler", "exceptionListener", "headerFilterStrategy", "idleConsumerLimit", "idleTaskExecutionLimit", "includeAllJMSXProperties", "jmsKeyFormatStrategy", "mapJmsMessage", "maxMessagesPerTask", "messageConverter", "messageCreatedStrategy", "messageIdEnabled", "messageListenerContainerFactory", "messageTimestampEnabled", "pubSubNoLocal", "receiveTimeout", "recoveryInterval", "requestTimeoutCheckerInterval", "synchronous", "transferException", "transferExchange", "transferFault", "useMessageIDAsCorrelationID", "waitForProvisionCorrelationToBeUpdatedCounter", "waitForProvisionCorrelationToBeUpdatedThreadSleepingTime"], logging: ["errorHandlerLogStackTrace", "errorHandlerLoggingLevel"], security: ["password", "username"], transaction: ["transacted"], transaction_advanced: ["lazyCreateTransactionManager", "transactionManager", "transactionName", "transactionTimeout"] }, documentation: JMS.documentation }; } }]); return JMS; }(_CamelElement3.default); JMS.documentation = ""; exports.default = JMS; /***/ }), /***/ "./src/camel/element/compontent/Language.js": /*!**************************************************!*\ !*** ./src/camel/element/compontent/Language.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Language = function (_CamelElement) { _inherits(Language, _CamelElement); function Language() { _classCallCheck(this, Language); var _this = _possibleConstructorReturn(this, (Language.__proto__ || Object.getPrototypeOf(Language)).call(this)); _this.scope = "Language"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "language"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.language = ""; _this.resourceUri = "resourceUri"; _this.uri = "language:" + _this.language + ":" + _this.resourceUri; // uri _this.binary = false; _this.cacheScript = false; _this.contentCache = false; _this.script = ""; _this.transform = true; _this.synchronous = false; return _this; } _createClass(Language, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["language", "resourceUri"], producer: ["binary", "cacheScript", "contentCache", "script", "transform"], advanceds: ["synchronous"] }, documentation: Language.documentation }; } }]); return Language; }(_CamelElement3.default); Language.documentation = ""; exports.default = Language; /***/ }), /***/ "./src/camel/element/compontent/Log.js": /*!*********************************************!*\ !*** ./src/camel/element/compontent/Log.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Log = function (_CamelElement) { _inherits(Log, _CamelElement); function Log() { _classCallCheck(this, Log); var _this = _possibleConstructorReturn(this, (Log.__proto__ || Object.getPrototypeOf(Log)).call(this)); _this.scope = "Log"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "log"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.message = ""; _this.logName = "log"; _this.loggerRef = ""; _this.loggingLevel = "INFO"; _this.marker = ""; return _this; } _createClass(Log, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawString(this.logName, this.x + this.width / 4, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["message", "description", "id", "logName", "loggerRef", "loggingLevel", "marker"], documentation: Log.documentation }; } }]); return Log; }(_CamelElement3.default); Log.documentation = ""; exports.default = Log; /***/ }), /***/ "./src/camel/element/compontent/MQTT.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/MQTT.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var MQTT = function (_CamelElement) { _inherits(MQTT, _CamelElement); function MQTT() { _classCallCheck(this, MQTT); var _this = _possibleConstructorReturn(this, (MQTT.__proto__ || Object.getPrototypeOf(MQTT)).call(this)); _this.scope = "MQTT"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.uri = "language:languageName:resourceUri"; // uri _this.description = ""; // 描述 _this.id = "mqtt"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.name = "name"; _this.blockingExecutor = ""; _this.byDefaultRetain = false; _this.cleanSession = false; _this.clientId = ""; _this.connectAttemptsMax = -1; _this.connectWaitInSeconds = 10; _this.disconnectWaitInSeconds = 5; _this.dispatchQueue = ""; _this.host = "tcp://127.0.0.1:1883"; _this.keepAlive = ""; _this.localAddress = ""; _this.maxReadRate = ""; _this.maxWriteRate = ""; _this.mqttQosPropertyName = "MQTTQos"; _this.mqttRetainPropertyName = "MQTTRetain"; _this.mqttTopicPropertyName = "MQTTTopicPropertyName"; _this.publishTopicName = "camel/mqtt/test"; _this.qualityOfService = "AtLeastOnce"; _this.receiveBufferSize = 65536; _this.reconnectAttemptsMax = -1; _this.reconnectBackOffMultiplier = 2.0; _this.reconnectDelay = 10; _this.reconnectDelayMax = 30000; _this.sendBufferSize = 65536; _this.sendWaitInSeconds = 5; _this.sslContext = ""; _this.subscribeTopicName = ""; _this.subscribeTopicNames = ""; _this.trafficClass = 8; _this.version = "3.1"; _this.willMessage = ""; _this.willQos = "AtMostOnce"; _this.willRetain = ""; _this.willTopic = ""; _this.bridgeErrorHandler = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.lazySessionCreation = true; _this.synchronous = false; return _this; } _createClass(MQTT, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["name"], common: ["blockingExecutor", "byDefaultRetain", "cleanSession", "clientId", "connectAttemptsMax", "connectWaitInSeconds", "disconnectWaitInSeconds", "dispatchQueue", "host", "keepAlive", "localAddress", "maxReadRate", "maxWriteRate", "mqttQosPropertyName", "mqttRetainPropertyName", "mqttTopicPropertyName", "publishTopicName", "qualityOfService", "receiveBufferSize", "reconnectAttemptsMax", "reconnectBackOffMultiplier", "reconnectDelay", "reconnectDelayMax", "sendBufferSize", "sendWaitInSeconds", "sslContext", "subscribeTopicName", "subscribeTopicNames", "trafficClass", "version", "willMessage", "willQos", "willRetain", "willTopic"], consumer: ["bridgeErrorHandler"], consumer_advance: ["exceptionHandler", "exchangePattern"], producer_advanced: ["lazySessionCreation"], advanceds: ["synchronous"] }, documentation: MQTT.documentation }; } }]); return MQTT; }(_CamelElement3.default); MQTT.documentation = ""; exports.default = MQTT; /***/ }), /***/ "./src/camel/element/compontent/MVEL.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/MVEL.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var MVEL = function (_CamelElement) { _inherits(MVEL, _CamelElement); function MVEL() { _classCallCheck(this, MVEL); var _this = _possibleConstructorReturn(this, (MVEL.__proto__ || Object.getPrototypeOf(MVEL)).call(this)); _this.scope = "MVEL"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "mvel"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.language = ""; _this.resourceUri = "resourceUri"; _this.uri = "mvel:" + _this.resourceUri; // uri _this.binary = false; _this.cacheScript = false; _this.contentCache = false; _this.script = ""; _this.transform = true; _this.synchronous = false; return _this; } _createClass(MVEL, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["resourceUri"], producer: ["contentCache", "encoding"], advanceds: ["synchronous"] }, documentation: MVEL.documentation }; } }]); return MVEL; }(_CamelElement3.default); MVEL.documentation = ""; exports.default = MVEL; /***/ }), /***/ "./src/camel/element/compontent/Mina2.js": /*!***********************************************!*\ !*** ./src/camel/element/compontent/Mina2.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Mina2 = function (_CamelElement) { _inherits(Mina2, _CamelElement); function Mina2() { _classCallCheck(this, Mina2); var _this = _possibleConstructorReturn(this, (Mina2.__proto__ || Object.getPrototypeOf(Mina2)).call(this)); _this.scope = "Mina2"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "language"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.protocol = "protocol"; _this.uri = "mina2:" + _this.host + ":" + _this.port + ":" + _this.protocol; // uri _this.disconnect = false; _this.minaLogger = false; _this.sync = true; _this.timeout = 30000; _this.writeTimeout = 10000; _this.bridgeErrorHandler = false; _this.clientMode = false; _this.disconnectOnNoReply = true; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.noReplyLogLevel = "WARN"; _this.cachedAddress = true; _this.lazySessionCreation = true; _this.maximumPoolSize = 16; _this.orderedThreadPoolExecutor = true; _this.synchronous = false; _this.transferExchange = false; _this.allowDefaultCodec = TRUE; _this.codec = ""; _this.decoderMaxLineLength = 1024; _this.encoderMaxLineLength = -1; _this.encoding = ""; _this.filters = ""; _this.textline = false; _this.textlineDelimiter = ""; _this.autoStartTls = true; _this.sslContextParameters = ""; return _this; } _createClass(Mina2, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port", "protocol"], common: ["disconnect", "minaLogger", "sync", "timeout", "writeTimeout"], consumer: ["bridgeErrorHandler", "clientMode"], consumer_advanced: ["disconnectOnNoReply", "exceptionHandler", "exchangePattern", "noReplyLogLevel"], producer_advanced: ["cachedAddress", "lazySessionCreation"], advanceds: ["maximumPoolSize", "orderedThreadPoolExecutor", "synchronous", "transferExchange"], codec: ["allowDefaultCodec", "codec", "decoderMaxLineLength", "encoderMaxLineLength", "encoding", "filters", "textline", "textlineDelimiter"], security: ["autoStartTls", "sslContextParameters"] }, documentation: Mina2.documentation }; } }]); return Mina2; }(_CamelElement3.default); Mina2.documentation = ""; exports.default = Mina2; /***/ }), /***/ "./src/camel/element/compontent/Netty.js": /*!***********************************************!*\ !*** ./src/camel/element/compontent/Netty.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Netty = function (_CamelElement) { _inherits(Netty, _CamelElement); function Netty() { _classCallCheck(this, Netty); var _this = _possibleConstructorReturn(this, (Netty.__proto__ || Object.getPrototypeOf(Netty)).call(this)); _this.scope = "Netty"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "netty"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.protocol = "protocol"; _this.uri = "netty:" + _this.protocol + ":" + _this.host + ":" + _this.port; // uri _this.disconnect = false; _this.keepAlive = true; _this.reuseAddress = true; _this.sync = true; _this.tcpNoDelay = true; _this.bridgeErrorHandler = false; _this.broadcast = false; _this.clientMode = false; _this.backlog = ""; _this.bossCount = 1; _this.bossPool = ""; _this.channelGroup = ""; _this.disconnectOnNoReply = true; _this.exchangePattern = ""; _this.exceptionHandler = ""; _this.maxChannelMemorySize = 10485760; _this.maxTotalMemorySize = 209715200; _this.nettyServerBootstrapFactory = ""; _this.networkInterface = ""; _this.noReplyLogLevel = "WARN"; _this.orderedThreadPoolExecutor = true; _this.serverClosedChannelExceptionCaughtLogLevel = "DEBUG"; _this.serverExceptionCaughtLogLevel = "WARN"; _this.serverPipelineFactory = ""; _this.workerCount = ""; _this.workerPool = ""; _this.connectTimeout = 10000; _this.requestTimeout = ""; _this.clientPipelineFactory = ""; _this.lazyChannelCreation = true; _this.producerPoolEnabled = true; _this.producerPoolMaxActive = -1; _this.producerPoolMaxIdle = 100; _this.producerPoolMinEvictableIdle = 300000; _this.producerPoolMinIdle = ""; _this.udpConnectionlessSending = false; _this.useChannelBuffer = false; _this.bootstrapConfiguration = ""; _this.options = ""; _this.receiveBufferSize = 65536; _this.receiveBufferSizePredictor = ""; _this.sendBufferSize = 65536; _this.synchronous = false; _this.transferExchange = false; _this.allowDefaultCodec = true; _this.autoAppendDelimiter = true; _this.decoder = ""; _this.decoderMaxLineLength = 1024; _this.decoders = ""; _this.delimiter = "LINE"; _this.encoder = ""; _this.encoders = ""; _this.encoding = ""; _this.textline = false; _this.enabledProtocols = "TLSv1,TLSv1.1,TLSv1.2"; _this.keyStoreFile = ""; _this.keyStoreFormat = "JKS"; _this.keyStoreResource = ""; _this.needClientAuth = false; _this.passphrase = ""; _this.securityProvider = "SunX509"; _this.ssl = false; _this.sslClientCertHeaders = false; _this.sslContextParameters = ""; _this.sslHandler = ""; _this.trustStoreFile = ""; _this.trustStoreResource = ""; return _this; } _createClass(Netty, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port", "protocol"], common: ["disconnect", "keepAlive", "reuseAddress", "sync", "tcpNoDelay"], consumer: ["bridgeErrorHandler", "broadcast", "clientMode"], consumer_advanced: ["backlog", "bossCount", "bossPool", "channelGroup", "disconnectOnNoReply", "exchangePattern", "exceptionHandler", "maxChannelMemorySize", "maxTotalMemorySize", "nettyServerBootstrapFactory", "networkInterface", "noReplyLogLevel", "orderedThreadPoolExecutor", "serverClosedChannelExceptionCaughtLogLevel", "serverExceptionCaughtLogLevel", "serverPipelineFactory", "workerCount", "workerPool"], producer: ["connectTimeout", "requestTimeout"], producer_advanced: ["clientPipelineFactory", "lazyChannelCreation", "producerPoolEnabled", "producerPoolMaxActive", "producerPoolMaxIdle", "producerPoolMinEvictableIdle", "producerPoolMinIdle", "udpConnectionlessSending", "useChannelBuffer"], advanceds: ["bootstrapConfiguration", "options", "receiveBufferSize", "receiveBufferSizePredictor", "sendBufferSize", "synchronous", "transferExchange"], codec: ["allowDefaultCodec", "autoAppendDelimiter", "decoder", "decoderMaxLineLength", "decoders", "delimiter", "encoder", "encoders", "encoding", "textline"], security: ["enabledProtocols", "keyStoreFile", "keyStoreFormat", "keyStoreResource", "needClientAuth", "passphrase", "securityProvider", "ssl", "sslClientCertHeaders", "sslContextParameters", "sslHandler", "trustStoreFile", "trustStoreResource"] }, documentation: Netty.documentation }; } }]); return Netty; }(_CamelElement3.default); Netty.documentation = ""; exports.default = Netty; /***/ }), /***/ "./src/camel/element/compontent/Netty4.js": /*!************************************************!*\ !*** ./src/camel/element/compontent/Netty4.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Netty4 = function (_CamelElement) { _inherits(Netty4, _CamelElement); function Netty4() { _classCallCheck(this, Netty4); var _this = _possibleConstructorReturn(this, (Netty4.__proto__ || Object.getPrototypeOf(Netty4)).call(this)); _this.scope = "Netty4"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "netty4"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.protocol = "protocol"; _this.uri = "netty4:" + _this.protocol + ":" + _this.host + ":" + _this.port; // uri _this.disconnect = false; _this.keepAlive = true; _this.reuseAddress = true; _this.reuseChannel = fasle; _this.sync = true; _this.tcpNoDelay = true; _this.bridgeErrorHandler = false; _this.broadcast = false; _this.clientMode = false; _this.reconnect = true; _this.reconnectInterval = 10000; _this.backlog = ""; _this.bossCount = 1; _this.disconnectOnNoReply = true; _this.exchangePattern = ""; _this.exceptionHandler = ""; _this.nettyServerBootstrapFactory = ""; _this.networkInterface = ""; _this.noReplyLogLevel = "WARN"; _this.serverClosedChannelExceptionCaughtLogLevel = "DEBUG"; _this.serverExceptionCaughtLogLevel = "WARN"; _this.serverPipelineFactory = ""; _this.usingExecutorService = true; _this.connectTimeout = 10000; _this.requestTimeout = ""; _this.clientPipelineFactory = ""; _this.correlationManager = ""; _this.lazyChannelCreation = true; _this.producerPoolEnabled = true; _this.producerPoolMaxActive = -1; _this.producerPoolMaxIdle = 100; _this.producerPoolMinEvictableIdle = 300000; _this.producerPoolMinIdle = ""; _this.udpConnectionlessSending = false; _this.useChannelBuffer = false; _this.allowSerializedHeaders = false; _this.bootstrapConfiguration = false; _this.channelGroup = ""; _this.nativeTransport = false; _this.options = ""; _this.receiveBufferSize = 65536; _this.receiveBufferSizePredictor = ""; _this.sendBufferSize = 65536; _this.synchronous = false; _this.transferExchange = false; _this.udpByteArrayCodec = false; _this.workerCount = ""; _this.workerGroup = ""; _this.allowDefaultCodec = true; _this.autoAppendDelimiter = true; _this.decoder = ""; _this.decoderMaxLineLength = 1024; _this.decoders = ""; _this.delimiter = "LINE"; _this.encoder = ""; _this.encoders = ""; _this.encoding = ""; _this.textline = false; _this.enabledProtocols = "TLSv1,TLSv1.1,TLSv1.2"; _this.keyStoreFile = ""; _this.keyStoreFormat = "JKS"; _this.keyStoreResource = ""; _this.needClientAuth = false; _this.passphrase = ""; _this.securityProvider = "SunX509"; _this.ssl = false; _this.sslClientCertHeaders = false; _this.sslContextParameters = ""; _this.sslHandler = ""; _this.trustStoreFile = ""; _this.trustStoreResource = ""; return _this; } _createClass(Netty4, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port", "protocol"], common: ["disconnect", "keepAlive", "reuseAddress", "reuseChannel", "sync", "tcpNoDelay"], consumer: ["bridgeErrorHandler", "broadcast", "clientMode", "reconnect", "reconnectInterval"], consumer_advanced: ["backlog", "bossCount", "disconnectOnNoReply", "exchangePattern", "exceptionHandler", "nettyServerBootstrapFactory", "networkInterface", "noReplyLogLevel", "serverClosedChannelExceptionCaughtLogLevel", "serverExceptionCaughtLogLevel", "serverPipelineFactory", "usingExecutorService"], producer: ["connectTimeout", "requestTimeout"], producer_advanced: ["clientPipelineFactory", "lazyChannelCreation", "producerPoolEnabled", "producerPoolMaxActive", "producerPoolMaxIdle", "producerPoolMinEvictableIdle", "producerPoolMinIdle", "udpConnectionlessSending", "useChannelBuffer"], advanceds: ["allowSerializedHeaders", "bootstrapConfiguration", "channelGroup", "nativeTransport", "options", "receiveBufferSize", "receiveBufferSizePredictor", "sendBufferSize", "synchronous", "transferExchange", "udpByteArrayCodec", "workerCount", "workerGroup"], codec: ["allowDefaultCodec", "autoAppendDelimiter", "decoder", "decoderMaxLineLength", "decoders", "delimiter", "encoder", "encoders", "encoding", "textline"], security: ["enabledProtocols", "keyStoreFile", "keyStoreFormat", "keyStoreResource", "needClientAuth", "passphrase", "securityProvider", "ssl", "sslClientCertHeaders", "sslContextParameters", "sslHandler", "trustStoreFile", "trustStoreResource"] }, documentation: Netty4.documentation }; } }]); return Netty4; }(_CamelElement3.default); Netty4.documentation = ""; exports.default = Netty4; /***/ }), /***/ "./src/camel/element/compontent/Netty4HTTP.js": /*!****************************************************!*\ !*** ./src/camel/element/compontent/Netty4HTTP.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Netty4HTTP = function (_CamelElement) { _inherits(Netty4HTTP, _CamelElement); function Netty4HTTP() { _classCallCheck(this, Netty4HTTP); var _this = _possibleConstructorReturn(this, (Netty4HTTP.__proto__ || Object.getPrototypeOf(Netty4HTTP)).call(this)); _this.scope = "Netty4HTTP"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "netty4-http"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.protocol = "protocol"; _this.path = "path"; _this.port = "port"; _this.uri = "netty4-http:" + _this.protocol + ":" + _this.host + ":" + _this.port + "/" + _this.path; // uri _this.bridgeEndpoint = false; _this.disconnect = false; _this.keepAlive = true; _this.reuseAddress = true; _this.reuseChannel = fasle; _this.sync = true; _this.tcpNoDelay = true; _this.bridgeErrorHandler = false; _this.matchOnUriPrefix = false; _this.send503whenSuspended = true; _this.backlog = ""; _this.bossCount = 1; _this.bossPool = ""; _this.channelGroup = ""; _this.chunkedMaxContentLength = 1048576; _this.compression = false; _this.disableStreamCache = false; _this.disconnectOnNoReply = true; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.httpMethodRestrict = ""; _this.mapHeaders = true; _this.maxHeaderSize = 8192; _this.nettyServerBootstrapFactory = ""; _this.nettySharedHttpServer = ""; _this.noReplyLogLevel = "WARN"; _this.serverClosedChannelExceptionCaughtLogLevel = "DEBUG"; _this.serverExceptionCaughtLogLevel = "WARN"; _this.serverPipelineFactory = ""; _this.traceEnabled = false; _this.urlDecodeHeaders = false; _this.usingExecutorService = true; _this.connectTimeout = 10000; _this.requestTimeout = ""; _this.throwExceptionOnFailure = true; _this.clientPipelineFactory = ""; _this.lazyChannelCreation = true; _this.okStatusCodeRange = "200-299"; _this.producerPoolEnabled = true; _this.producerPoolMaxActive = -1; _this.producerPoolMaxIdle = 100; _this.producerPoolMinEvictableIdle = 300000; _this.useRelativePath = false; _this.allowSerializedHeaders = false; _this.bootstrapConfiguration = ""; _this.channelGroup = ""; _this.configuration = ""; _this.disableStreamCache = false; _this.headerFilterStrategy = ""; _this.nativeTransport = false; _this.nettyHttpBinding = ""; _this.options = ""; _this.receiveBufferSize = 65536; _this.receiveBufferSizePredictor = ""; _this.sendBufferSize = 65536; _this.synchronous = false; _this.transferException = false; _this.transferExchange = false; _this.workerCount = ""; _this.workerGroup = ""; _this.decoder = ""; _this.decoders = ""; _this.encoder = ""; _this.encoders = ""; _this.enabledProtocols = "TLSv1,TLSv1.1,TLSv1.2"; _this.keyStoreFile = ""; _this.keyStoreFormat = "JKS"; _this.keyStoreResource = ""; _this.needClientAuth = false; _this.passphrase = ""; _this.securityConfiguration = ""; _this.securityOptions = ""; _this.securityProvider = "SunX509"; _this.ssl = false; _this.sslClientCertHeaders = false; _this.sslContextParameters = ""; _this.sslHandler = ""; _this.trustStoreFile = ""; _this.trustStoreResource = ""; return _this; } _createClass(Netty4HTTP, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "protocol", "path", "port"], common: ["bridgeEndpoint", "disconnect", "keepAlive", "reuseAddress", "sync", "tcpNoDelay"], consumer: ["bridgeErrorHandler", "matchOnUriPrefix", "send503whenSuspended"], consumer_advanced: ["backlog", "bossCount", "bossPool", "channelGroup", "chunkedMaxContentLength", "compression", "disableStreamCache", "disconnectOnNoReply", "exceptionHandler", "exchangePattern", "httpMethodRestrict", "mapHeaders", "maxHeaderSize", "nettyServerBootstrapFactory", "nettySharedHttpServer", "noReplyLogLevel", "serverClosedChannelExceptionCaughtLogLevel", "serverExceptionCaughtLogLevel", "serverPipelineFactory", "traceEnabled", "urlDecodeHeaders"], producer: ["connectTimeout", "requestTimeout", "throwExceptionOnFailure"], producer_advanced: ["clientPipelineFactory", "lazyChannelCreation", "okStatusCodeRange", "producerPoolEnabled", "producerPoolMaxActive", "producerPoolMaxIdle", "producerPoolMinEvictableIdle", "useRelativePath"], advanceds: ["allowSerializedHeaders", "bootstrapConfiguration", "channelGroup", "configuration", "disableStreamCache", "headerFilterStrategy", "nativeTransport", "nettyHttpBinding", "options", "receiveBufferSize", "receiveBufferSizePredictor", "sendBufferSize", "synchronous", "transferException", "transferExchange", "workerCount", "workerGroup"], codec: ["decoder", "decoders", "encoder", "encoders"], security: ["enabledProtocols", "keyStoreFile", "keyStoreFormat", "keyStoreResource", "needClientAuth", "passphrase", "securityConfiguration", "securityOptions", "securityProvider", "ssl", "sslClientCertHeaders", "sslContextParameters", "sslHandler", "trustStoreFile", "trustStoreResource"] }, documentation: Netty4HTTP.documentation }; } }]); return Netty4HTTP; }(_CamelElement3.default); Netty4HTTP.documentation = ""; exports.default = Netty4HTTP; /***/ }), /***/ "./src/camel/element/compontent/NettyHTTP.js": /*!***************************************************!*\ !*** ./src/camel/element/compontent/NettyHTTP.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var NettyHTTP = function (_CamelElement) { _inherits(NettyHTTP, _CamelElement); function NettyHTTP() { _classCallCheck(this, NettyHTTP); var _this = _possibleConstructorReturn(this, (NettyHTTP.__proto__ || Object.getPrototypeOf(NettyHTTP)).call(this)); _this.scope = "NettyHTTP"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "netty"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.protocol = "protocol"; _this.path = "path"; _this.port = "port"; _this.uri = "netty4-http:" + _this.protocol + ":" + _this.host + ":" + _this.port + "/" + _this.path; // uri _this.bridgeEndpoint = false; _this.disconnect = false; _this.keepAlive = true; _this.reuseAddress = true; _this.sync = true; _this.tcpNoDelay = true; _this.bridgeErrorHandler = true; _this.matchOnUriPrefix = true; _this.send503whenSuspended = false; _this.backlog = ""; _this.bossCount = 1; _this.bossPool = ""; _this.channelGroup = ""; _this.chunkedMaxContentLength = 1048576; _this.compression = false; _this.disableStreamCache = false; _this.disconnectOnNoReply = true; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.httpMethodRestrict = ""; _this.mapHeaders = false; _this.maxChannelMemorySize = 10485760; _this.maxHeaderSize = 8192; _this.maxTotalMemorySize = 209715200; _this.nettyServerBootstrapFactory = ""; _this.nettySharedHttpServer = ""; _this.noReplyLogLevel = "WARN"; _this.orderedThreadPoolExecutor = true; _this.serverClosedChannelExceptionCaughtLogLevel = "DEBUG"; _this.serverExceptionCaughtLogLevel = "WARN"; _this.serverPipelineFactory = ""; _this.traceEnabled = false; _this.urlDecodeHeaders = false; _this.workerCount = ""; _this.workerPool = ""; _this.connectTimeout = 10000; _this.requestTimeout = ""; _this.throwExceptionOnFailure = true; _this.clientPipelineFactory = ""; _this.lazyChannelCreation = true; _this.okStatusCodeRange = "200-299"; _this.producerPoolEnabled = true; _this.producerPoolMaxActive = -1; _this.producerPoolMaxIdle = 100; _this.producerPoolMinEvictableIdle = 300000; _this.producerPoolMinIdle = ""; _this.useChannelBuffer = false; _this.useRelativePath = false; _this.bootstrapConfiguration = ""; _this.configuration = ""; _this.headerFilterStrategy = ""; _this.nettyHttpBinding = ""; _this.options = ""; _this.receiveBufferSize = 65536; _this.receiveBufferSizePredictor = ""; _this.sendBufferSize = 65536; _this.synchronous = false; _this.transferException = false; _this.transferExchange = false; _this.decoder = ""; _this.decoders = ""; _this.encoder = ""; _this.encoders = ""; _this.enabledProtocols = "TLSv1,TLSv1.1,TLSv1.2"; _this.keyStoreFile = ""; _this.keyStoreFormat = "JKS"; _this.keyStoreResource = ""; _this.needClientAuth = false; _this.passphrase = ""; _this.securityConfiguration = ""; _this.securityOptions = ""; _this.securityProvider = "SunX509"; _this.ssl = false; _this.sslClientCertHeaders = false; _this.sslContextParameters = ""; _this.sslHandler = ""; _this.trustStoreFile = ""; _this.trustStoreResource = ""; return _this; } _createClass(NettyHTTP, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "protocol", "path", "port"], common: ["bridgeEndpoint", "disconnect", "keepAlive", "reuseAddress", "sync", "tcpNoDelay"], consumer: ["bridgeErrorHandler", "matchOnUriPrefix", "send503whenSuspended"], consumer_advanced: ["backlog", "bossCount", "bossPool", "channelGroup", "chunkedMaxContentLength", "compression", "disableStreamCache", "disconnectOnNoReply", "exceptionHandler", "exchangePattern", "httpMethodRestrict", "mapHeaders", "maxChannelMemorySize", "maxHeaderSize", "maxTotalMemorySize", "nettyServerBootstrapFactory", "nettySharedHttpServer", "noReplyLogLevel", "orderedThreadPoolExecutor", "serverClosedChannelExceptionCaughtLogLevel", "serverExceptionCaughtLogLevel", "serverPipelineFactory", "traceEnabled", "urlDecodeHeaders", "workerCount", "workerPool"], producer: ["connectTimeout", "requestTimeout", "throwExceptionOnFailure"], producer_advanced: ["clientPipelineFactory", "lazyChannelCreation", "okStatusCodeRange", "producerPoolEnabled", "producerPoolMaxActive", "producerPoolMaxIdle", "producerPoolMinEvictableIdle", "producerPoolMinIdle", "useChannelBuffer", "useRelativePath"], advanceds: ["bootstrapConfiguration", "configuration", "headerFilterStrategy", "nettyHttpBinding", "options", "receiveBufferSize", "receiveBufferSizePredictor", "sendBufferSize", "synchronous", "transferException", "transferExchange"], codec: ["decoder", "decoders", "encoder", "encoders"], security: ["enabledProtocols", "keyStoreFile", "keyStoreFormat", "keyStoreResource", "needClientAuth", "passphrase", "securityConfiguration", "securityOptions", "securityProvider", "ssl", "sslClientCertHeaders", "sslContextParameters", "sslHandler", "trustStoreFile", "trustStoreResource"] }, documentation: NettyHTTP.documentation }; } }]); return NettyHTTP; }(_CamelElement3.default); NettyHTTP.documentation = ""; exports.default = NettyHTTP; /***/ }), /***/ "./src/camel/element/compontent/POP3.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/POP3.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var POP3 = function (_CamelElement) { _inherits(POP3, _CamelElement); function POP3() { _classCallCheck(this, POP3); var _this = _possibleConstructorReturn(this, (POP3.__proto__ || Object.getPrototypeOf(POP3)).call(this)); _this.scope = "POP3"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "pop3"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.uri = "pop3:" + _this.host + ":" + _this.port; // uri _this.bridgeErrorHandler = false; _this.copyTo = true; _this.closeFolder = ""; _this.delete = false; _this.disconnect = false; _this.handleFailedMessage = false; _this.maxMessagesPerPoll = ""; _this.mimeDecodeHeaders = false; _this.peek = true; _this.sendEmptyMessageWhenIdle = false; _this.skipFailedMessage = false; _this.unseen = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.fetchSize = -1; _this.folderName = "INBOX"; _this.mailUidGenerator = ""; _this.mapMailMessage = true; _this.pollStrategy = ""; _this.postProcessAction = ""; _this.bcc = ""; _this.cc = ""; _this.from = "camel@localhost"; _this.replyTo = ""; _this.subject = ""; _this.to = ""; _this.javaMailSender = ""; _this.additionalJavaMailProperties = ""; _this.alternativeBodyHeader = "CamelMailAlternativeBody"; _this.attachmentsContentTransferEncodingResolver = ""; _this.binding = ""; _this.connectionTimeout = 30000; _this.contentType = "text/plain"; _this.contentTypeResolver = ""; _this.debugMode = false; _this.headerFilterStrategy = ""; _this.ignoreUnsupportedCharset = false; _this.ignoreUriScheme = false; _this.session = ""; _this.synchronous = false; _this.useInlineAttachments = false; _this.idempotentRepository = ""; _this.idempotentRepositoryRemoveOnCommit = true; _this.searchTerm = ""; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 60000; _this.greedy = ""; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.sortTeam = ""; _this.dummyTrustManager = false; _this.password = ""; _this.sslContextParameters = ""; _this.username = ""; return _this; } _createClass(POP3, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port"], consumer: ["bridgeErrorHandler", "copyTo", "closeFolder", "delete", "disconnect", "handleFailedMessage", "maxMessagesPerPoll", "mimeDecodeHeaders", "peek", "sendEmptyMessageWhenIdle", "skipFailedMessage", "unseen"], consumer_advanced: ["exceptionHandler", "exchangePattern", "fetchSize", "folderName", "mailUidGenerator", "mapMailMessage", "pollStrategy", "postProcessAction"], producer: ["bcc", "cc", "from", "replyTo", "subject", "to"], producer_advanced: ["javaMailSender"], advanceds: ["additionalJavaMailProperties", "alternativeBodyHeader", "attachmentsContentTransferEncodingResolver", "binding", "connectionTimeout", "contentType", "contentTypeResolver", "debugMode", "headerFilterStrategy", "ignoreUnsupportedCharset", "ignoreUriScheme", "session", "synchronous", "useInlineAttachments"], filter: ["idempotentRepository", "idempotentRepositoryRemoveOnCommit", "searchTerm"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["sortTeam"], security: ["dummyTrustManager", "password", "sslContextParameters", "username"] }, documentation: POP3.documentation }; } }]); return POP3; }(_CamelElement3.default); POP3.documentation = ""; exports.default = POP3; /***/ }), /***/ "./src/camel/element/compontent/POP3S.js": /*!***********************************************!*\ !*** ./src/camel/element/compontent/POP3S.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var POP3S = function (_CamelElement) { _inherits(POP3S, _CamelElement); function POP3S() { _classCallCheck(this, POP3S); var _this = _possibleConstructorReturn(this, (POP3S.__proto__ || Object.getPrototypeOf(POP3S)).call(this)); _this.scope = "POP3S"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "pop3s"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.uri = "pop3s:" + _this.host + ":" + _this.port; // uri _this.bridgeErrorHandler = false; _this.copyTo = true; _this.closeFolder = ""; _this.delete = false; _this.disconnect = false; _this.handleFailedMessage = false; _this.maxMessagesPerPoll = ""; _this.mimeDecodeHeaders = false; _this.peek = true; _this.sendEmptyMessageWhenIdle = false; _this.skipFailedMessage = false; _this.unseen = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.fetchSize = -1; _this.folderName = "INBOX"; _this.mailUidGenerator = ""; _this.mapMailMessage = true; _this.pollStrategy = ""; _this.postProcessAction = ""; _this.bcc = ""; _this.cc = ""; _this.from = "camel@localhost"; _this.replyTo = ""; _this.subject = ""; _this.to = ""; _this.javaMailSender = ""; _this.additionalJavaMailProperties = ""; _this.alternativeBodyHeader = "CamelMailAlternativeBody"; _this.attachmentsContentTransferEncodingResolver = ""; _this.binding = ""; _this.connectionTimeout = 30000; _this.contentType = "text/plain"; _this.contentTypeResolver = ""; _this.debugMode = false; _this.headerFilterStrategy = ""; _this.ignoreUnsupportedCharset = false; _this.ignoreUriScheme = false; _this.session = ""; _this.synchronous = false; _this.useInlineAttachments = false; _this.idempotentRepository = ""; _this.idempotentRepositoryRemoveOnCommit = true; _this.searchTerm = ""; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 60000; _this.greedy = ""; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.sortTeam = ""; _this.dummyTrustManager = false; _this.password = ""; _this.sslContextParameters = ""; _this.username = ""; return _this; } _createClass(POP3S, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port"], consumer: ["bridgeErrorHandler", "copyTo", "closeFolder", "delete", "disconnect", "handleFailedMessage", "maxMessagesPerPoll", "mimeDecodeHeaders", "peek", "sendEmptyMessageWhenIdle", "skipFailedMessage", "unseen"], consumer_advanced: ["exceptionHandler", "exchangePattern", "fetchSize", "folderName", "mailUidGenerator", "mapMailMessage", "pollStrategy", "postProcessAction"], producer: ["bcc", "cc", "from", "replyTo", "subject", "to"], producer_advanced: ["javaMailSender"], advanceds: ["additionalJavaMailProperties", "alternativeBodyHeader", "attachmentsContentTransferEncodingResolver", "binding", "connectionTimeout", "contentType", "contentTypeResolver", "debugMode", "headerFilterStrategy", "ignoreUnsupportedCharset", "ignoreUriScheme", "session", "synchronous", "useInlineAttachments"], filter: ["idempotentRepository", "idempotentRepositoryRemoveOnCommit", "searchTerm"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["sortTeam"], security: ["dummyTrustManager", "password", "sslContextParameters", "username"] }, documentation: POP3S.documentation }; } }]); return POP3S; }(_CamelElement3.default); POP3S.documentation = ""; exports.default = POP3S; /***/ }), /***/ "./src/camel/element/compontent/Process.js": /*!*************************************************!*\ !*** ./src/camel/element/compontent/Process.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Process = function (_CamelElement) { _inherits(Process, _CamelElement); function Process() { _classCallCheck(this, Process); var _this = _possibleConstructorReturn(this, (Process.__proto__ || Object.getPrototypeOf(Process)).call(this)); _this.scope = "Process"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.ref = ""; _this.description = ""; _this.id = "_process1"; return _this; } _createClass(Process, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } if (this.isCurrentToEdit(this)) { alert(); } g.save(); this.color = "#c8eb79"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawString("to", this.x + this.width / 3, this.y + this.height / 2); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["ref", "description", "id"] }; } }]); return Process; }(_CamelElement3.default); exports.default = Process; /***/ }), /***/ "./src/camel/element/compontent/Quartz.js": /*!************************************************!*\ !*** ./src/camel/element/compontent/Quartz.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Quartz = function (_CamelElement) { _inherits(Quartz, _CamelElement); function Quartz() { _classCallCheck(this, Quartz); var _this = _possibleConstructorReturn(this, (Quartz.__proto__ || Object.getPrototypeOf(Quartz)).call(this)); _this.scope = "quartz"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "quartz"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.timerName = "timerName"; _this.groupName = "groupName"; _this.uri = "quartz:" + _this.groupName + "/" + _this.timerName; // uri _this.bridgeErrorHandler = false; _this.cron = ""; _this.deleteJob = true; _this.fireNow = false; _this.pauseJob = false; _this.startDelayedSeconds = ""; _this.stateful = false; _this.usingFixedCamelContextName = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.jobParameters = ""; _this.synchronous = false; _this.triggerParameters = ""; return _this; } _createClass(Quartz, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["timerName", "groupName"], consumer: ["bridgeErrorHandler", "cron", "deleteJob", "fireNow", "pauseJob", "startDelayedSeconds", "stateful", "usingFixedCamelContextName"], consumer_advanced: ["exceptionHandler", "exchangePattern"], advanceds: ["jobParameters", "synchronous", "triggerParameters"] }, documentation: Quartz.documentation }; } }]); return Quartz; }(_CamelElement3.default); Quartz.documentation = ""; exports.default = Quartz; /***/ }), /***/ "./src/camel/element/compontent/Quartz2.js": /*!*************************************************!*\ !*** ./src/camel/element/compontent/Quartz2.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Quartz2 = function (_CamelElement) { _inherits(Quartz2, _CamelElement); function Quartz2() { _classCallCheck(this, Quartz2); var _this = _possibleConstructorReturn(this, (Quartz2.__proto__ || Object.getPrototypeOf(Quartz2)).call(this)); _this.scope = "quartz2"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "quartz2"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.triggerName = "triggerName"; _this.groupName = "groupName"; _this.uri = "quartz:" + _this.groupName + "/" + _this.timerName; // uri _this.bridgeErrorHandler = false; _this.cron = ""; _this.deleteJob = true; _this.fireNow = false; _this.pauseJob = false; _this.recoverableJob = false; _this.stateful = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.customCalendar = ""; _this.jobParameters = ""; _this.prefixJobNameWithEndpointId = false; _this.synchronous = false; _this.triggerParameters = ""; _this.usingFixedCamelContextName = false; _this.autoStartScheduler = true; _this.fireNow = false; _this.startDelayedSeconds = ""; _this.triggerStartDelay = 500; return _this; } _createClass(Quartz2, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["triggerName", "groupName"], consumer: ["bridgeErrorHandler", "cron", "deleteJob", "durableJob", "pauseJob", "recoverableJob", "stateful"], consumer_advanced: ["exceptionHandler", "exchangePattern"], advanceds: ["customCalendar", "jobParameters", "prefixJobNameWithEndpointId", "synchronous", "triggerParameters", "usingFixedCamelContextName"], scheduler: ["autoStartScheduler", "fireNow", "startDelayedSeconds", "triggerStartDelay"] }, documentation: Quartz2.documentation }; } }]); return Quartz2; }(_CamelElement3.default); Quartz2.documentation = ""; exports.default = Quartz2; /***/ }), /***/ "./src/camel/element/compontent/RSS.js": /*!*********************************************!*\ !*** ./src/camel/element/compontent/RSS.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var RSS = function (_CamelElement) { _inherits(RSS, _CamelElement); function RSS() { _classCallCheck(this, RSS); var _this = _possibleConstructorReturn(this, (RSS.__proto__ || Object.getPrototypeOf(RSS)).call(this)); _this.scope = "RSS"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "rss"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.feedUri = "feedUri"; _this.uri = "rss:" + _this.feedUri; // uri _this.bridgeErrorHandler = false; _this.feedHeader = true; _this.filter = true; _this.lastUpdate = ""; _this.password = ""; _this.sendEmptyMessageWhenIdle = false; _this.sortEntries = false; _this.splitEntries = true; _this.throttleEntries = true; _this.username = ""; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.pollStrategy = ""; _this.synchronous = false; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 500; _this.greedy = false; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; return _this; } _createClass(RSS, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["feedUri"], consumer: ["bridgeErrorHandler", "feedHeader", "filter", "lastUpdate", "password", "sendEmptyMessageWhenIdle", "sortEntries", "splitEntries", "throttleEntries", "username"], consumer_advanced: ["exceptionHandler", "exchangePattern", "pollStrategy"], advanceds: ["synchronous"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"] }, documentation: RSS.documentation }; } }]); return RSS; }(_CamelElement3.default); RSS.documentation = ""; exports.default = RSS; /***/ }), /***/ "./src/camel/element/compontent/Restlet.js": /*!*************************************************!*\ !*** ./src/camel/element/compontent/Restlet.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Restlet = function (_CamelElement) { _inherits(Restlet, _CamelElement); function Restlet() { _classCallCheck(this, Restlet); var _this = _possibleConstructorReturn(this, (Restlet.__proto__ || Object.getPrototypeOf(Restlet)).call(this)); _this.scope = "restlet"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "restlet"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.protocol = ""; _this.uriPattern = "uriPattern"; _this.uri = "restlet:" + _this.protocol + ":" + _this.host + ":" + _this.port + "/" + _this.uriPattern; // uri _this.restletMethod = "GET"; _this.bridgeErrorHandler = false; _this.restletMethods = ""; _this.disableStreamCache = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.restletUriPatterns = ""; _this.connectTimeout = 30000; _this.cookieHandler = ""; _this.socketTimeout = 30000; _this.throwExceptionOnFailure = true; _this.autoCloseStream = false; _this.streamRepresentation = false; _this.headerFilterStrategy = ""; _this.restletBinding = ""; _this.synchronous = false; _this.restletRealm = ""; _this.sslContextParameters = ""; return _this; } _createClass(Restlet, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port", "protocol", "uriPattern"], common: ["restletMethod"], consumer: ["bridgeErrorHandler", "restletMethods"], consumer_advanced: ["disableStreamCache", "exceptionHandler", "exchangePattern", "restletUriPatterns"], producer: ["connectTimeout", "cookieHandler", "socketTimeout", "throwExceptionOnFailure"], producer_advanced: ["autoCloseStream", "streamRepresentation"], advanceds: ["headerFilterStrategy", "restletBinding", "synchronous"], security: ["restletRealm", "sslContextParameters"] }, documentation: Restlet.documentation }; } }]); return Restlet; }(_CamelElement3.default); Restlet.documentation = ""; exports.default = Restlet; /***/ }), /***/ "./src/camel/element/compontent/SAPNetWeaver.js": /*!******************************************************!*\ !*** ./src/camel/element/compontent/SAPNetWeaver.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SAPNetWeaver = function (_CamelElement) { _inherits(SAPNetWeaver, _CamelElement); function SAPNetWeaver() { _classCallCheck(this, SAPNetWeaver); var _this = _possibleConstructorReturn(this, (SAPNetWeaver.__proto__ || Object.getPrototypeOf(SAPNetWeaver)).call(this)); _this.scope = "SAPNetWeaver"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "sapnetweaver"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.url = "url"; _this.uri = "sap-netweaver:" + _this.url; // uri _this.password = ""; _this.username = ""; _this.flatternMap = true; _this.json = true; _this.jsonAsMap = true; _this.synchronous = false; return _this; } _createClass(SAPNetWeaver, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["url"], producer: ["password", "username", "flatternMap", "json", "jsonAsMap"], advanceds: ["synchronous"] }, documentation: SAPNetWeaver.documentation }; } }]); return SAPNetWeaver; }(_CamelElement3.default); SAPNetWeaver.documentation = ""; exports.default = SAPNetWeaver; /***/ }), /***/ "./src/camel/element/compontent/SEDA.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/SEDA.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SEDA = function (_CamelElement) { _inherits(SEDA, _CamelElement); function SEDA() { _classCallCheck(this, SEDA); var _this = _possibleConstructorReturn(this, (SEDA.__proto__ || Object.getPrototypeOf(SEDA)).call(this)); _this.scope = "SEDA"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "seda"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.name = "name"; _this.uri = "seda:" + _this.name; // uri _this.size = 1000; _this.bridgeErrorHandler = false; _this.concurrentConsumers = 1; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.limitConcurrentConsumers = true; _this.multipleConsumers = false; _this.pollTimeout = 1000; _this.purgeWhenStopping = false; _this.blockWhenFull = false; _this.discardIfNoConsumers = false; _this.failIfNoConsumers = false; _this.offerTimeout = ""; _this.timeout = 30000; _this.waitForTaskToComplete = "ifReplyExpected"; _this.queue = ""; _this.synchronous = false; return _this; } _createClass(SEDA, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["name"], common: ["size"], consumer: ["bridgeErrorHandler", "concurrentConsumers"], consumer_advanced: ["exceptionHandler", "exchangePattern", "limitConcurrentConsumers", "multipleConsumers", "pollTimeout", "purgeWhenStopping"], producer: ["blockWhenFull", "discardIfNoConsumers", "failIfNoConsumers", "offerTimeout", "timeout", "waitForTaskToComplete"], advanceds: ["queue", "synchronous"] }, documentation: SEDA.documentation }; } }]); return SEDA; }(_CamelElement3.default); SEDA.documentation = ""; exports.default = SEDA; /***/ }), /***/ "./src/camel/element/compontent/SFTP.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/SFTP.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SFTP = function (_CamelElement) { _inherits(SFTP, _CamelElement); function SFTP() { _classCallCheck(this, SFTP); var _this = _possibleConstructorReturn(this, (SFTP.__proto__ || Object.getPrototypeOf(SFTP)).call(this)); _this.scope = "SFTP"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "sftp"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.directoryName = "directoryName"; _this.port = "port"; _this.uri = "sftp:" + _this.host + ":" + _this.port + "/" + _this.directoryName; // uri _this.charset = ""; _this.disconnect = false; _this.doneFileName = ""; _this.fileName = ""; _this.jschLoggingLevel = ""; _this.separator = "UNIX"; _this.transferLoggingIntervalSeconds = 5; _this.transferLoggingLevel = "DEBUG"; _this.transferLoggingVerbose = false; _this.fastExistsCheck = false; _this.bridgeErrorHandler = false; _this.delete = false; _this.moveFailed = ""; _this.noop = false; _this.preMove = ""; _this.preSort = false; _this.recursive = false; _this.resumeDownload = false; _this.sendEmptyMessageWhenIdle = false; _this.streamDownload = false; _this.directoryMustExist = false; _this.download = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.ignoreFileNotFoundOrPermissionError = false; _this.onCompletionExceptionHandler = ""; _this.pollStrategy = ""; _this.processStrategy = ""; _this.startingDirectoryMustExist = false; _this.useList = true; _this.fileExist = "Override"; _this.flatten = false; _this.jailStartingDirectory = true; _this.moveExisting = ""; _this.tempFileName = ""; _this.tempPrefix = ""; _this.allowNullBody = false; _this.chmod = ""; _this.disconnectOnBatchComplete = false; _this.eagerDeleteTargetFile = true; _this.keepLastModified = false; _this.moveExistingFileStrategy = ""; _this.sendNoop = true; _this.autoCreate = true; _this.bindAddress = ""; _this.bufferSize = 131072; _this.soTimeout = 300000; _this.stepwise = true; _this.synchronous = false; _this.throwExceptionOnConnectFailed = false; _this.timeout = 30000; _this.antExclude = ""; _this.antFilterCaseSensitive = true; _this.antInclude = ""; _this.eagerMaxMessagesPerPoll = true; _this.exclude = ""; _this.filter = ""; _this.filterDirectory = ""; _this.filterFile = ""; _this.idempotent = false; _this.idempotentKey = ""; _this.idempotentRepository = ""; _this.include = ""; _this.maxDepth = 2147483647; _this.maxMessagesPerPoll = ""; _this.minDepth = ""; _this.move = ""; _this.exclusiveReadLockStrategy = ""; _this.readLock = "none"; _this.readLockCheckInterval = 1000; _this.readLockDeleteOrphanLockFiles = true; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 500; _this.greedy = false; _this.initialDelay = ""; _this.runLoggingLevel = "REACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.shuffle = false; _this.sortBy = ""; _this.sorter = ""; _this.username = ""; return _this; } _createClass(SFTP, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["host", "directoryName", "port"], common: ["charset", "disconnect", "doneFileName", "fileName", "jschLoggingLevel", "separator"], common_advanced: ["fastExistsCheck"], consumer: ["bridgeErrorHandler", "delete", "moveFailed", "noop", "preMove", "preSort", "recursive", "resumeDownload", "sendEmptyMessageWhenIdle", "streamDownload"], consumer_advanced: ["directoryMustExist", "download", "exceptionHandler", "exchangePattern", "ignoreFileNotFoundOrPermissionError", "inProgressRepository", "localWorkDirectory", "onCompletionExceptionHandler", "pollStrategy", "processStrategy", "startingDirectoryMustExist", "useList"], producer: ["fileExist", "flatten", "jailStartingDirectory", "moveExisting", "tempFileName", "tempPrefix"], producer_advanced: ["allowNullBody", "chmod", "disconnectOnBatchComplete", "eagerDeleteTargetFile", "keepLastModified", "moveExistingFileStrategy", "sendNoop"], advanceds: ["autoCreate", "bindAddress", "bufferSize", "bulkRequests", "compression", "connectTimeout", "maximumReconnectAttempts", "proxy", "reconnectDelay", "serverAliveCountMax", "serverAliveInterval", "soTimeout", "stepwise", "synchronous", "throwExceptionOnConnectFailed", "timeout"], filter: ["antExclude", "antFilterCaseSensitive", "antInclude", "eagerMaxMessagesPerPoll", "exclude", "filter", "filterDirectory", "filterFile", "idempotent", "idempotentKey", "idempotentRepository", "include", "maxDepth", "maxMessagesPerPoll", "minDepth", "move"], lock: ["exclusiveReadLockStrategy", "readLock", "readLockCheckInterval", "readLockDeleteOrphanLockFiles", "readLockIdempotentReleaseAsync", "readLockIdempotentReleaseAsyncPoolSize", "readLockIdempotentReleaseDelay", "readLockIdempotentReleaseExecutorService", "readLockLoggingLevel", "readLockMarkerFile", "readLockMinAge", "readLockMinLength", "readLockRemoveOnCommit", "readLockRemoveOnRollback", "readLockTimeout"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["shuffle", "sortBy", "sorter"], security: ["ciphers", "keyPair", "knownHosts", "knownHostsFile", "knownHostsUri", "password", "preferredAuthentications", "privateKey", "privateKeyFile", "privateKeyPassphrase", "privateKeyUri", "strictHostKeyChecking", "useUserKnownHostsFile", "username"] }, documentation: SFTP.documentation }; } }]); return SFTP; }(_CamelElement3.default); SFTP.documentation = ""; exports.default = SFTP; /***/ }), /***/ "./src/camel/element/compontent/SMTP.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/SMTP.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SMTP = function (_CamelElement) { _inherits(SMTP, _CamelElement); function SMTP() { _classCallCheck(this, SMTP); var _this = _possibleConstructorReturn(this, (SMTP.__proto__ || Object.getPrototypeOf(SMTP)).call(this)); _this.scope = "SMTP"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "smtp"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.uri = "smtp:" + _this.host + ":" + _this.port; // uri _this.bridgeErrorHandler = false; _this.copyTo = true; _this.closeFolder = ""; _this.delete = false; _this.disconnect = false; _this.handleFailedMessage = false; _this.maxMessagesPerPoll = ""; _this.mimeDecodeHeaders = false; _this.peek = true; _this.sendEmptyMessageWhenIdle = false; _this.skipFailedMessage = false; _this.unseen = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.fetchSize = -1; _this.folderName = "INBOX"; _this.mailUidGenerator = ""; _this.mapMailMessage = true; _this.pollStrategy = ""; _this.postProcessAction = ""; _this.bcc = ""; _this.cc = ""; _this.from = "camel@localhost"; _this.replyTo = ""; _this.subject = ""; _this.to = ""; _this.javaMailSender = ""; _this.additionalJavaMailProperties = ""; _this.alternativeBodyHeader = "CamelMailAlternativeBody"; _this.attachmentsContentTransferEncodingResolver = ""; _this.binding = ""; _this.connectionTimeout = 30000; _this.contentType = "text/plain"; _this.contentTypeResolver = ""; _this.debugMode = false; _this.headerFilterStrategy = ""; _this.ignoreUnsupportedCharset = false; _this.ignoreUriScheme = false; _this.session = ""; _this.synchronous = false; _this.useInlineAttachments = false; _this.idempotentRepository = ""; _this.idempotentRepositoryRemoveOnCommit = true; _this.searchTerm = ""; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 60000; _this.greedy = ""; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.sortTeam = ""; _this.dummyTrustManager = false; _this.password = ""; _this.sslContextParameters = ""; _this.username = ""; return _this; } _createClass(SMTP, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port"], consumer: ["bridgeErrorHandler", "copyTo", "closeFolder", "delete", "disconnect", "handleFailedMessage", "maxMessagesPerPoll", "mimeDecodeHeaders", "peek", "sendEmptyMessageWhenIdle", "skipFailedMessage", "unseen"], consumer_advanced: ["exceptionHandler", "exchangePattern", "fetchSize", "folderName", "mailUidGenerator", "mapMailMessage", "pollStrategy", "postProcessAction"], producer: ["bcc", "cc", "from", "replyTo", "subject", "to"], producer_advanced: ["javaMailSender"], advanceds: ["additionalJavaMailProperties", "alternativeBodyHeader", "attachmentsContentTransferEncodingResolver", "binding", "connectionTimeout", "contentType", "contentTypeResolver", "debugMode", "headerFilterStrategy", "ignoreUnsupportedCharset", "ignoreUriScheme", "session", "synchronous", "useInlineAttachments"], filter: ["idempotentRepository", "idempotentRepositoryRemoveOnCommit", "searchTerm"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["sortTeam"], security: ["dummyTrustManager", "password", "sslContextParameters", "username"] }, documentation: SMTP.documentation }; } }]); return SMTP; }(_CamelElement3.default); SMTP.documentation = ""; exports.default = SMTP; /***/ }), /***/ "./src/camel/element/compontent/SMTPS.js": /*!***********************************************!*\ !*** ./src/camel/element/compontent/SMTPS.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SMTPS = function (_CamelElement) { _inherits(SMTPS, _CamelElement); function SMTPS() { _classCallCheck(this, SMTPS); var _this = _possibleConstructorReturn(this, (SMTPS.__proto__ || Object.getPrototypeOf(SMTPS)).call(this)); _this.scope = "SMTPS"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "smtps"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.uri = "smtps:" + _this.host + ":" + _this.port; // uri _this.bridgeErrorHandler = false; _this.copyTo = true; _this.closeFolder = ""; _this.delete = false; _this.disconnect = false; _this.handleFailedMessage = false; _this.maxMessagesPerPoll = ""; _this.mimeDecodeHeaders = false; _this.peek = true; _this.sendEmptyMessageWhenIdle = false; _this.skipFailedMessage = false; _this.unseen = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.fetchSize = -1; _this.folderName = "INBOX"; _this.mailUidGenerator = ""; _this.mapMailMessage = true; _this.pollStrategy = ""; _this.postProcessAction = ""; _this.bcc = ""; _this.cc = ""; _this.from = "camel@localhost"; _this.replyTo = ""; _this.subject = ""; _this.to = ""; _this.javaMailSender = ""; _this.additionalJavaMailProperties = ""; _this.alternativeBodyHeader = "CamelMailAlternativeBody"; _this.attachmentsContentTransferEncodingResolver = ""; _this.binding = ""; _this.connectionTimeout = 30000; _this.contentType = "text/plain"; _this.contentTypeResolver = ""; _this.debugMode = false; _this.headerFilterStrategy = ""; _this.ignoreUnsupportedCharset = false; _this.ignoreUriScheme = false; _this.session = ""; _this.synchronous = false; _this.useInlineAttachments = false; _this.idempotentRepository = ""; _this.idempotentRepositoryRemoveOnCommit = true; _this.searchTerm = ""; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 60000; _this.greedy = ""; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.sortTeam = ""; _this.dummyTrustManager = false; _this.password = ""; _this.sslContextParameters = ""; _this.username = ""; return _this; } _createClass(SMTPS, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced['path']; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port"], consumer: ["bridgeErrorHandler", "copyTo", "closeFolder", "delete", "disconnect", "handleFailedMessage", "maxMessagesPerPoll", "mimeDecodeHeaders", "peek", "sendEmptyMessageWhenIdle", "skipFailedMessage", "unseen"], consumer_advanced: ["exceptionHandler", "exchangePattern", "fetchSize", "folderName", "mailUidGenerator", "mapMailMessage", "pollStrategy", "postProcessAction"], producer: ["bcc", "cc", "from", "replyTo", "subject", "to"], producer_advanced: ["javaMailSender"], advanceds: ["additionalJavaMailProperties", "alternativeBodyHeader", "attachmentsContentTransferEncodingResolver", "binding", "connectionTimeout", "contentType", "contentTypeResolver", "debugMode", "headerFilterStrategy", "ignoreUnsupportedCharset", "ignoreUriScheme", "session", "synchronous", "useInlineAttachments"], filter: ["idempotentRepository", "idempotentRepositoryRemoveOnCommit", "searchTerm"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], sort: ["sortTeam"], security: ["dummyTrustManager", "password", "sslContextParameters", "username"] }, documentation: SMTPS.documentation }; } }]); return SMTPS; }(_CamelElement3.default); SMTPS.documentation = ""; exports.default = SMTPS; /***/ }), /***/ "./src/camel/element/compontent/SNMP.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/SNMP.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SNMP = function (_CamelElement) { _inherits(SNMP, _CamelElement); function SNMP() { _classCallCheck(this, SNMP); var _this = _possibleConstructorReturn(this, (SNMP.__proto__ || Object.getPrototypeOf(SNMP)).call(this)); _this.scope = "SNMP"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "snmp"; // 名字 _this.pattern = ""; //图案 _this.ref_deprecated = ""; // 已弃用(ref) _this.host = "host"; _this.port = "port"; _this.uri = "snmp:" + _this.host + ":" + _this.port; // uri _this.bridgeErrorHandler = false; _this.delay = 60000; _this.oids = ""; _this.protocol = "udp"; _this.retries = 2; _this.sendEmptyMessageWhenIdle = false; _this.snmpCommunity = "public"; _this.snmpContextEngineId = ""; _this.snmpContextName = ""; _this.snmpVersion = "0"; _this.timeout = 1500; _this.treeList = false; _this.type = ""; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.pollStrategy = ""; _this.synchronous = false; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.greedy = false; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; _this.authenticationPassphrase = ""; _this.authenticationProtocol = ""; _this.privacyPassphrase = ""; _this.privacyProtocol = ""; _this.securityLevel = 3; _this.securityName = ""; return _this; } _createClass(SNMP, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(两个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 2); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "ref_deprecated"], advanced: { path: ["host", "port"], consumer: ["bridgeErrorHandler", "delay", "oids", "protocol", "retries", "sendEmptyMessageWhenIdle", "snmpCommunity", "snmpContextEngineId", "snmpContextName", "snmpVersion", "timeout", "treeList", "type"], consumer_advanced: ["exceptionHandler", "exchangePattern", "pollStrategy"], advanceds: ["synchronous"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"], security: ["authenticationPassphrase", "authenticationProtocol", "privacyPassphrase", "privacyProtocol", "securityLevel", "securityName"] }, documentation: SNMP.documentation }; } }]); return SNMP; }(_CamelElement3.default); SNMP.documentation = ""; exports.default = SNMP; /***/ }), /***/ "./src/camel/element/compontent/SQL.js": /*!*********************************************!*\ !*** ./src/camel/element/compontent/SQL.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SQL = function (_CamelElement) { _inherits(SQL, _CamelElement); function SQL() { _classCallCheck(this, SQL); var _this = _possibleConstructorReturn(this, (SQL.__proto__ || Object.getPrototypeOf(SQL)).call(this)); _this.scope = "SQL"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "sql"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.query = "query"; _this.uri = "sql:" + _this.query; // uri _this.allowNamedParameters = true; _this.dataSource = ""; _this.outputClass = ""; _this.dataSourceRef = ""; _this.outputHeader = ""; _this.outputType = "SelectList"; _this.separator = ""; _this.breakBatchOnConsumeFail = false; _this.bridgeErrorHandler = false; _this.expectedUpdateCount = ""; _this.maxMessagesPerPoll = ""; _this.onConsume = ""; _this.onConsumeBatchComplete = ""; _this.onConsumeFailed = ""; _this.routeEmptyResultSet = false; _this.sendEmptyMessageWhenIdle = false; _this.transacted = false; _this.useIterator = true; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.pollStrategy = ""; _this.processingStrategy = ""; _this.batch = false; _this.noop = false; _this.useMessageBodyForSql = false; _this.alwaysPopulateStatement = false; _this.parametersCount = ""; _this.placeholder = "#"; _this.prepareStatementStrategy = ""; _this.synchronous = false; _this.templateOptions = ""; _this.usePlaceholder = true; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 500; _this.greedy = false; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; return _this; } _createClass(SQL, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["query"], common: ["allowNamedParameters", "dataSource", "dataSourceRef", "outputClass", "outputHeader", "outputType", "separator"], consumer: ["breakBatchOnConsumeFail", "bridgeErrorHandler", "expectedUpdateCount", "maxMessagesPerPoll", "onConsume", "onConsumeBatchComplete", "onConsumeFailed", "routeEmptyResultSet", "sendEmptyMessageWhenIdle", "transacted", "useIterator"], consumer_advanced: ["exceptionHandler", "exchangePattern", "pollStrategy", "processingStrategy"], producer: ["batch", "noop", "useMessageBodyForSql"], advanceds: ["alwaysPopulateStatement", "parametersCount", "placeholder", "prepareStatementStrategy", "synchronous", "templateOptions", "usePlaceholder"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"] }, documentation: SQL.documentation }; } }]); return SQL; }(_CamelElement3.default); SQL.documentation = ""; exports.default = SQL; /***/ }), /***/ "./src/camel/element/compontent/Scheduler.js": /*!***************************************************!*\ !*** ./src/camel/element/compontent/Scheduler.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Scheduler = function (_CamelElement) { _inherits(Scheduler, _CamelElement); function Scheduler() { _classCallCheck(this, Scheduler); var _this = _possibleConstructorReturn(this, (Scheduler.__proto__ || Object.getPrototypeOf(Scheduler)).call(this)); _this.scope = "Scheduler"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.uri = "scheduler:query"; // uri _this.description = ""; // 描述 _this.id = "scheduler"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.name = ""; _this.bridgeErrorHandler = false; _this.sendEmptyMessageWhenIdle = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.pollStrategy = ""; _this.synchronous = false; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = 1; _this.delay = 500; _this.greedy = false; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; return _this; } _createClass(Scheduler, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["name"], consumer: ["bridgeErrorHandler", "sendEmptyMessageWhenIdle"], consumer_advanced: ["exceptionHandler", "exchangePattern", "pollStrategy"], advanceds: ["synchronous"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"] }, documentation: Scheduler.documentation }; } }]); return Scheduler; }(_CamelElement3.default); Scheduler.documentation = ""; exports.default = Scheduler; /***/ }), /***/ "./src/camel/element/compontent/Servlet.js": /*!*************************************************!*\ !*** ./src/camel/element/compontent/Servlet.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Servlet = function (_CamelElement) { _inherits(Servlet, _CamelElement); function Servlet() { _classCallCheck(this, Servlet); var _this = _possibleConstructorReturn(this, (Servlet.__proto__ || Object.getPrototypeOf(Servlet)).call(this)); _this.scope = "Servlet"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.uri = "servlet:query"; // uri _this.description = ""; // 描述 _this.id = "sql"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.contextPath = ""; _this.async = false; _this.bridgeErrorHandler = false; _this.chunked = true; _this.httpMethodRestrict = ""; _this.matchOnUriPrefix = false; _this.responseBufferSize = ""; _this.servletName = "CamelServlet"; _this.transferException = false; _this.disableStreamCache = false; _this.headerFilterStrategy = ""; _this.httpBinding = ""; _this.attachmentMultipartBinding = false; _this.eagerCheckContentAvailable = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.fileNameExtWhitelist = ""; _this.optionsEnabled = false; _this.traceEnabled = false; _this.mapHttpMessageBody = true; _this.mapHttpMessageFormUrlEncodedBody = true; _this.mapHttpMessageHeaders = true; _this.synchronous = false; return _this; } _createClass(Servlet, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["contextPath"], consumer: ["async", "bridgeErrorHandler", "chunked", "httpMethodRestrict", "matchOnUriPrefix", "responseBufferSize", "servletName", "transferException"], common: ["disableStreamCache", "headerFilterStrategy"], common_advanced: ["httpBinding"], consumer_advanced: ["attachmentMultipartBinding", "eagerCheckContentAvailable", "exceptionHandler", "exchangePattern", "fileNameExtWhitelist", "optionsEnabled", "traceEnabled"], advanced: ["mapHttpMessageBody", "mapHttpMessageFormUrlEncodedBody", "mapHttpMessageHeaders", "synchronous"] }, documentation: Servlet.documentation }; } }]); return Servlet; }(_CamelElement3.default); Servlet.documentation = ""; exports.default = Servlet; /***/ }), /***/ "./src/camel/element/compontent/Timer.js": /*!***********************************************!*\ !*** ./src/camel/element/compontent/Timer.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Timer = function (_CamelElement) { _inherits(Timer, _CamelElement); function Timer() { _classCallCheck(this, Timer); var _this = _possibleConstructorReturn(this, (Timer.__proto__ || Object.getPrototypeOf(Timer)).call(this)); _this.scope = "Timer"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "timer"; // 名字 _this.uri = "timer:" + _this.timerName; // uri _this.ref_deprecated = ""; // 已弃用(ref) _this.timerName = "timerName"; _this.bridgeErrorHandler = false; _this.delay = 1000; _this.fixedRate = false; _this.period = 1000; _this.repeatCount = 0; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.daemon = true; _this.pattern = ""; _this.synchronous = false; _this.time = ""; _this.timer = ""; return _this; } _createClass(Timer, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["timerName"], consumer: ["bridgeErrorHandler", "delay", "fixedRate", "period", "repeatCount"], consumer_advanved: ["exceptionHandler", "exchangePattern"], advanced: ["daemon", "pattern", "synchronous", "time", "timer"] }, documentation: Timer.documentation }; } }]); return Timer; }(_CamelElement3.default); Timer.documentation = ""; exports.default = Timer; /***/ }), /***/ "./src/camel/element/compontent/VM.js": /*!********************************************!*\ !*** ./src/camel/element/compontent/VM.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var VM = function (_CamelElement) { _inherits(VM, _CamelElement); function VM() { _classCallCheck(this, VM); var _this = _possibleConstructorReturn(this, (VM.__proto__ || Object.getPrototypeOf(VM)).call(this)); _this.scope = "VM"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "vm"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.name = "name"; _this.uri = "sql:" + _this.name; // uri _this.size = 1000; _this.bridgeErrorHandler = false; _this.concurrentConsumers = ""; _this.httpBinding = ""; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.limitConcurrentConsumers = true; _this.multipleConsumers = false; _this.pollTimeout = 1000; _this.purgeWhenStopping = false; _this.blockWhenFull = false; _this.discardIfNoConsumers = false; _this.failIfNoConsumers = false; _this.offerTimeout = ""; _this.timeout = 30000; _this.waitForTaskToComplete = "IfReplyExpected"; return _this; } _createClass(VM, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["name"], consumer: ["bridgeErrorHandler", "concurrentConsumers"], common: ["size"], common_advanced: ["httpBinding"], consumer_advanced: ["exceptionHandler", "exchangePattern", "limitConcurrentConsumers", "multipleConsumers", "pollTimeout", "purgeWhenStopping"], producer: ["blockWhenFull", "discardIfNoConsumers", "failIfNoConsumers", "offerTimeout", "timeout", "waitForTaskToComplete"], advanceds: ["synchronous"] }, documentation: VM.documentation }; } }]); return VM; }(_CamelElement3.default); VM.documentation = ""; exports.default = VM; /***/ }), /***/ "./src/camel/element/compontent/XQuery.js": /*!************************************************!*\ !*** ./src/camel/element/compontent/XQuery.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var XQuery = function (_CamelElement) { _inherits(XQuery, _CamelElement); function XQuery() { _classCallCheck(this, XQuery); var _this = _possibleConstructorReturn(this, (XQuery.__proto__ || Object.getPrototypeOf(XQuery)).call(this)); _this.scope = "XQuery"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "xquery"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.resourceUri = "resourceUri"; _this.uri = "xquery:" + _this.resourceUri; // uri _this.allowStAX = false; _this.headerName = ""; _this.namespacePrefixes = ""; _this.resultType = ""; _this.resultsFormat = "DOM"; _this.stripsAllWhiteSpace = true; _this.bridgeErrorHandler = false; _this.sendEmptyMessageWhenIdle = false; _this.exceptionHandler = ""; _this.exchangePattern = ""; _this.pollStrategy = ""; _this.configuration = ""; _this.configurationProperties = ""; _this.moduleURIResolver = ""; _this.parameters = ""; _this.properties = ""; _this.staticQueryContext = ""; _this.synchronous = false; _this.backoffErrorThreshold = ""; _this.backoffIdleThreshold = ""; _this.backoffMultiplier = ""; _this.delay = 500; _this.greedy = false; _this.initialDelay = 1000; _this.runLoggingLevel = "TRACE"; _this.scheduledExecutorService = ""; _this.scheduler = "none"; _this.schedulerProperties = ""; _this.startScheduler = true; _this.timeUnit = "MILLISECONDS"; _this.useFixedDelay = true; return _this; } _createClass(XQuery, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } /** * 更新uri(一个冒号) * @param {原始的组件数据} intValue * @param {现在要更新的值} prop * @returns */ }, { key: "updateUri", value: function updateUri(intValue, prop) { var tempArr = this.getPropsDesc().advanced["path"]; return this.changeUri(intValue, this, prop, tempArr, 1); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["resourceUri"], common: ["allowStAX", "headerName", "namespacePrefixes", "resultType", "resultsFormat", "stripsAllWhiteSpace"], consumer: ["bridgeErrorHandler", "sendEmptyMessageWhenIdle"], consumer_advanced: ["exceptionHandler", "exchangePattern", "pollStrategy"], advanced: ["configuration", "configurationProperties", "moduleURIResolver", "parameters", "properties", "staticQueryContext", "synchronous"], scheduler: ["backoffErrorThreshold", "backoffIdleThreshold", "backoffMultiplier", "delay", "greedy", "initialDelay", "runLoggingLevel", "scheduledExecutorService", "scheduler", "schedulerProperties", "startScheduler", "timeUnit", "useFixedDelay"] }, documentation: XQuery.documentation }; } }]); return XQuery; }(_CamelElement3.default); XQuery.documentation = ""; exports.default = XQuery; /***/ }), /***/ "./src/camel/element/compontent/XSLT.js": /*!**********************************************!*\ !*** ./src/camel/element/compontent/XSLT.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var XSLT = function (_CamelElement) { _inherits(XSLT, _CamelElement); function XSLT() { _classCallCheck(this, XSLT); var _this = _possibleConstructorReturn(this, (XSLT.__proto__ || Object.getPrototypeOf(XSLT)).call(this)); _this.scope = "XSLT"; _this.hasUri = true; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.description = ""; // 描述 _this.id = "xslt"; // 名字 _this.ref_deprecated = ""; // 已弃用(ref) _this.resourceUri = "resourceUri"; _this.uri = "xquery:" + _this.resourceUri; // uri _this.allowStAX = true; _this.contentCache = true; _this.deleteOutputFile = false; _this.failOnNullBody = true; _this.output = "string"; _this.saxon = false; _this.transformerCacheSize = 0; _this.converter = ""; _this.entityResolver = ""; _this.errorListener = ""; _this.resultHandlerFactory = ""; _this.saxonConfiguration = ""; _this.saxonExtensionFunctions = ""; _this.synchronous = false; _this.transformerFactory = ""; _this.transformerFactoryClass = ""; _this.uriResolver = ""; return _this; } _createClass(XSLT, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.uri, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML(index) { var str = ""; var uriValue = _utility.StringUtil.encodeHTML(this.uri); if (this.outputid && !this.inputid || index == 0) { str += "\n " + this.description + "\n \n"; } else { str = "\n " + this.description + "\n \n"; } return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["uri", "description", "id", "pattern", "ref_deprecated"], advanced: { path: ["resourceUri"], producer: ["allowStAX", "contentCache", "deleteOutputFile", "failOnNullBody", "output", "saxon", "transformerCacheSize"], advanceds: ["converter", "entityResolver", "errorListener", "resultHandlerFactory", "saxonConfiguration", "saxonExtensionFunctions", "synchronous", "transformerFactory", "transformerFactoryClass", "uriResolver"] }, documentation: XSLT.documentation }; } }]); return XSLT; }(_CamelElement3.default); XSLT.documentation = ""; exports.default = XSLT; /***/ }), /***/ "./src/camel/element/compontent/index.js": /*!***********************************************!*\ !*** ./src/camel/element/compontent/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.XSLT = exports.XQuery = exports.VM = exports.Timer = exports.SQL = exports.SNMP = exports.SMTPS = exports.SMTP = exports.SFTP = exports.Servlet = exports.SEDA = exports.Scheduler = exports.SAPNetWeaver = exports.RSS = exports.Restlet = exports.Quartz2 = exports.Quartz = exports.Process = exports.POP3S = exports.POP3 = exports.Netty4HTTP = exports.Netty4 = exports.NettyHTTP = exports.Netty = exports.Mina2 = exports.MVEL = exports.MQTT = exports.Log = exports.Language = exports.JMS = exports.JGroups = exports.JDBC = exports.IMAPSecure = exports.IMAP = exports.Generic = exports.File = exports.FTPS = exports.FTP = exports.DirectVM = exports.Direct = exports.ControlBus = exports.CXFRS = exports.CXF = exports.Bean = exports.Atom = exports.ActiveMQ = undefined; var _ActiveMQ = __webpack_require__(/*! ./ActiveMQ */ "./src/camel/element/compontent/ActiveMQ.js"); var _ActiveMQ2 = _interopRequireDefault(_ActiveMQ); var _Atom = __webpack_require__(/*! ./Atom */ "./src/camel/element/compontent/Atom.js"); var _Atom2 = _interopRequireDefault(_Atom); var _Bean = __webpack_require__(/*! ./Bean */ "./src/camel/element/compontent/Bean.js"); var _Bean2 = _interopRequireDefault(_Bean); var _CXF = __webpack_require__(/*! ./CXF */ "./src/camel/element/compontent/CXF.js"); var _CXF2 = _interopRequireDefault(_CXF); var _CXFRS = __webpack_require__(/*! ./CXFRS */ "./src/camel/element/compontent/CXFRS.js"); var _CXFRS2 = _interopRequireDefault(_CXFRS); var _ControlBus = __webpack_require__(/*! ./ControlBus */ "./src/camel/element/compontent/ControlBus.js"); var _ControlBus2 = _interopRequireDefault(_ControlBus); var _Direct = __webpack_require__(/*! ./Direct */ "./src/camel/element/compontent/Direct.js"); var _Direct2 = _interopRequireDefault(_Direct); var _DirectVM = __webpack_require__(/*! ./DirectVM */ "./src/camel/element/compontent/DirectVM.js"); var _DirectVM2 = _interopRequireDefault(_DirectVM); var _FTP = __webpack_require__(/*! ./FTP */ "./src/camel/element/compontent/FTP.js"); var _FTP2 = _interopRequireDefault(_FTP); var _FTPS = __webpack_require__(/*! ./FTPS */ "./src/camel/element/compontent/FTPS.js"); var _FTPS2 = _interopRequireDefault(_FTPS); var _File = __webpack_require__(/*! ./File */ "./src/camel/element/compontent/File.js"); var _File2 = _interopRequireDefault(_File); var _Generic = __webpack_require__(/*! ./Generic */ "./src/camel/element/compontent/Generic.js"); var _Generic2 = _interopRequireDefault(_Generic); var _IMAP = __webpack_require__(/*! ./IMAP */ "./src/camel/element/compontent/IMAP.js"); var _IMAP2 = _interopRequireDefault(_IMAP); var _IMAPSecure = __webpack_require__(/*! ./IMAPSecure */ "./src/camel/element/compontent/IMAPSecure.js"); var _IMAPSecure2 = _interopRequireDefault(_IMAPSecure); var _JDBC = __webpack_require__(/*! ./JDBC */ "./src/camel/element/compontent/JDBC.js"); var _JDBC2 = _interopRequireDefault(_JDBC); var _JGroups = __webpack_require__(/*! ./JGroups */ "./src/camel/element/compontent/JGroups.js"); var _JGroups2 = _interopRequireDefault(_JGroups); var _JMS = __webpack_require__(/*! ./JMS */ "./src/camel/element/compontent/JMS.js"); var _JMS2 = _interopRequireDefault(_JMS); var _Language = __webpack_require__(/*! ./Language */ "./src/camel/element/compontent/Language.js"); var _Language2 = _interopRequireDefault(_Language); var _Log = __webpack_require__(/*! ./Log */ "./src/camel/element/compontent/Log.js"); var _Log2 = _interopRequireDefault(_Log); var _MQTT = __webpack_require__(/*! ./MQTT */ "./src/camel/element/compontent/MQTT.js"); var _MQTT2 = _interopRequireDefault(_MQTT); var _MVEL = __webpack_require__(/*! ./MVEL */ "./src/camel/element/compontent/MVEL.js"); var _MVEL2 = _interopRequireDefault(_MVEL); var _Mina = __webpack_require__(/*! ./Mina2 */ "./src/camel/element/compontent/Mina2.js"); var _Mina2 = _interopRequireDefault(_Mina); var _Netty = __webpack_require__(/*! ./Netty */ "./src/camel/element/compontent/Netty.js"); var _Netty2 = _interopRequireDefault(_Netty); var _NettyHTTP = __webpack_require__(/*! ./NettyHTTP */ "./src/camel/element/compontent/NettyHTTP.js"); var _NettyHTTP2 = _interopRequireDefault(_NettyHTTP); var _Netty3 = __webpack_require__(/*! ./Netty4 */ "./src/camel/element/compontent/Netty4.js"); var _Netty4 = _interopRequireDefault(_Netty3); var _Netty4HTTP = __webpack_require__(/*! ./Netty4HTTP */ "./src/camel/element/compontent/Netty4HTTP.js"); var _Netty4HTTP2 = _interopRequireDefault(_Netty4HTTP); var _POP = __webpack_require__(/*! ./POP3 */ "./src/camel/element/compontent/POP3.js"); var _POP2 = _interopRequireDefault(_POP); var _POP3S = __webpack_require__(/*! ./POP3S */ "./src/camel/element/compontent/POP3S.js"); var _POP3S2 = _interopRequireDefault(_POP3S); var _Process = __webpack_require__(/*! ./Process */ "./src/camel/element/compontent/Process.js"); var _Process2 = _interopRequireDefault(_Process); var _Quartz = __webpack_require__(/*! ./Quartz */ "./src/camel/element/compontent/Quartz.js"); var _Quartz2 = _interopRequireDefault(_Quartz); var _Quartz3 = __webpack_require__(/*! ./Quartz2 */ "./src/camel/element/compontent/Quartz2.js"); var _Quartz4 = _interopRequireDefault(_Quartz3); var _Restlet = __webpack_require__(/*! ./Restlet */ "./src/camel/element/compontent/Restlet.js"); var _Restlet2 = _interopRequireDefault(_Restlet); var _RSS = __webpack_require__(/*! ./RSS */ "./src/camel/element/compontent/RSS.js"); var _RSS2 = _interopRequireDefault(_RSS); var _SAPNetWeaver = __webpack_require__(/*! ./SAPNetWeaver */ "./src/camel/element/compontent/SAPNetWeaver.js"); var _SAPNetWeaver2 = _interopRequireDefault(_SAPNetWeaver); var _Scheduler = __webpack_require__(/*! ./Scheduler */ "./src/camel/element/compontent/Scheduler.js"); var _Scheduler2 = _interopRequireDefault(_Scheduler); var _SEDA = __webpack_require__(/*! ./SEDA */ "./src/camel/element/compontent/SEDA.js"); var _SEDA2 = _interopRequireDefault(_SEDA); var _Servlet = __webpack_require__(/*! ./Servlet */ "./src/camel/element/compontent/Servlet.js"); var _Servlet2 = _interopRequireDefault(_Servlet); var _SFTP = __webpack_require__(/*! ./SFTP */ "./src/camel/element/compontent/SFTP.js"); var _SFTP2 = _interopRequireDefault(_SFTP); var _SMTP = __webpack_require__(/*! ./SMTP */ "./src/camel/element/compontent/SMTP.js"); var _SMTP2 = _interopRequireDefault(_SMTP); var _SMTPS = __webpack_require__(/*! ./SMTPS */ "./src/camel/element/compontent/SMTPS.js"); var _SMTPS2 = _interopRequireDefault(_SMTPS); var _SNMP = __webpack_require__(/*! ./SNMP */ "./src/camel/element/compontent/SNMP.js"); var _SNMP2 = _interopRequireDefault(_SNMP); var _SQL = __webpack_require__(/*! ./SQL */ "./src/camel/element/compontent/SQL.js"); var _SQL2 = _interopRequireDefault(_SQL); var _Timer = __webpack_require__(/*! ./Timer */ "./src/camel/element/compontent/Timer.js"); var _Timer2 = _interopRequireDefault(_Timer); var _VM = __webpack_require__(/*! ./VM */ "./src/camel/element/compontent/VM.js"); var _VM2 = _interopRequireDefault(_VM); var _XQuery = __webpack_require__(/*! ./XQuery */ "./src/camel/element/compontent/XQuery.js"); var _XQuery2 = _interopRequireDefault(_XQuery); var _XSLT = __webpack_require__(/*! ./XSLT */ "./src/camel/element/compontent/XSLT.js"); var _XSLT2 = _interopRequireDefault(_XSLT); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.ActiveMQ = _ActiveMQ2.default; exports.Atom = _Atom2.default; exports.Bean = _Bean2.default; exports.CXF = _CXF2.default; exports.CXFRS = _CXFRS2.default; exports.ControlBus = _ControlBus2.default; exports.Direct = _Direct2.default; exports.DirectVM = _DirectVM2.default; exports.FTP = _FTP2.default; exports.FTPS = _FTPS2.default; exports.File = _File2.default; exports.Generic = _Generic2.default; exports.IMAP = _IMAP2.default; exports.IMAPSecure = _IMAPSecure2.default; exports.JDBC = _JDBC2.default; exports.JGroups = _JGroups2.default; exports.JMS = _JMS2.default; exports.Language = _Language2.default; exports.Log = _Log2.default; exports.MQTT = _MQTT2.default; exports.MVEL = _MVEL2.default; exports.Mina2 = _Mina2.default; exports.Netty = _Netty2.default; exports.NettyHTTP = _NettyHTTP2.default; exports.Netty4 = _Netty4.default; exports.Netty4HTTP = _Netty4HTTP2.default; exports.POP3 = _POP2.default; exports.POP3S = _POP3S2.default; exports.Process = _Process2.default; exports.Quartz = _Quartz2.default; exports.Quartz2 = _Quartz4.default; exports.Restlet = _Restlet2.default; exports.RSS = _RSS2.default; exports.SAPNetWeaver = _SAPNetWeaver2.default; exports.Scheduler = _Scheduler2.default; exports.SEDA = _SEDA2.default; exports.Servlet = _Servlet2.default; exports.SFTP = _SFTP2.default; exports.SMTP = _SMTP2.default; exports.SMTPS = _SMTPS2.default; exports.SNMP = _SNMP2.default; exports.SQL = _SQL2.default; exports.Timer = _Timer2.default; exports.VM = _VM2.default; exports.XQuery = _XQuery2.default; exports.XSLT = _XSLT2.default; /***/ }), /***/ "./src/camel/element/controlflow/Delay.js": /*!************************************************!*\ !*** ./src/camel/element/controlflow/Delay.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Delay = function (_CamelElement) { _inherits(Delay, _CamelElement); function Delay() { _classCallCheck(this, Delay); var _this = _possibleConstructorReturn(this, (Delay.__proto__ || Object.getPrototypeOf(Delay)).call(this)); _this.scope = "Delay"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_delay"; _this.description = ""; _this.expression = ""; _this.asyncDelayed = false; _this.callerRunsWhenRejected = false; _this.executorServiceRef = ""; return _this; } _createClass(Delay, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Delay", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; if (this.expression) str += "\n <" + this.expression + ">\n " + this.description + "\n \n";else str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression", "asyncDelayed", "callerRunsWhenRejected", "executorServiceRef"] }; } }]); return Delay; }(_CamelElement3.default); exports.default = Delay; /***/ }), /***/ "./src/camel/element/controlflow/DoCatch.js": /*!**************************************************!*\ !*** ./src/camel/element/controlflow/DoCatch.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var DoCatch = function (_CamelElement) { _inherits(DoCatch, _CamelElement); function DoCatch() { _classCallCheck(this, DoCatch); var _this = _possibleConstructorReturn(this, (DoCatch.__proto__ || Object.getPrototypeOf(DoCatch)).call(this)); _this.scope = "DoCatch"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_filter"; _this.description = ""; _this.handled = ""; _this.exception = ""; return _this; } _createClass(DoCatch, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("DoCatch", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; if (this.handled == "") str += "\n \n " + this.description + "\n \n";else str += "\n \n <" + this.handled + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "exception", "handled"] }; } }]); return DoCatch; }(_CamelElement3.default); exports.default = DoCatch; /***/ }), /***/ "./src/camel/element/controlflow/DoFinally.js": /*!****************************************************!*\ !*** ./src/camel/element/controlflow/DoFinally.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var DoFinally = function (_CamelElement) { _inherits(DoFinally, _CamelElement); function DoFinally() { _classCallCheck(this, DoFinally); var _this = _possibleConstructorReturn(this, (DoFinally.__proto__ || Object.getPrototypeOf(DoFinally)).call(this)); _this.scope = "DoFinally"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_doFinally"; _this.description = ""; return _this; } _createClass(DoFinally, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("DoFinally" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description"] }; } }]); return DoFinally; }(_CamelElement3.default); exports.default = DoFinally; /***/ }), /***/ "./src/camel/element/controlflow/DoTry.js": /*!************************************************!*\ !*** ./src/camel/element/controlflow/DoTry.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var DoTry = function (_CamelElement) { _inherits(DoTry, _CamelElement); function DoTry() { _classCallCheck(this, DoTry); var _this = _possibleConstructorReturn(this, (DoTry.__proto__ || Object.getPrototypeOf(DoTry)).call(this)); _this.scope = "DoTry"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_doTry"; _this.description = ""; return _this; } _createClass(DoTry, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("DoTry" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description"] }; } }]); return DoTry; }(_CamelElement3.default); exports.default = DoTry; /***/ }), /***/ "./src/camel/element/controlflow/Intercept.js": /*!****************************************************!*\ !*** ./src/camel/element/controlflow/Intercept.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Intercept = function (_CamelElement) { _inherits(Intercept, _CamelElement); function Intercept() { _classCallCheck(this, Intercept); var _this = _possibleConstructorReturn(this, (Intercept.__proto__ || Object.getPrototypeOf(Intercept)).call(this)); _this.scope = "Intercept"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_intercept"; _this.description = ""; return _this; } _createClass(Intercept, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Intercept" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description"] }; } }]); return Intercept; }(_CamelElement3.default); exports.default = Intercept; /***/ }), /***/ "./src/camel/element/controlflow/InterceptFrom.js": /*!********************************************************!*\ !*** ./src/camel/element/controlflow/InterceptFrom.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var InterceptFrom = function (_CamelElement) { _inherits(InterceptFrom, _CamelElement); function InterceptFrom() { _classCallCheck(this, InterceptFrom); var _this = _possibleConstructorReturn(this, (InterceptFrom.__proto__ || Object.getPrototypeOf(InterceptFrom)).call(this)); _this.scope = "InterceptFrom"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_interceptFrom"; _this.description = ""; _this.uri = ""; return _this; } _createClass(InterceptFrom, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("InterceptFrom" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "uri"] }; } }]); return InterceptFrom; }(_CamelElement3.default); exports.default = InterceptFrom; /***/ }), /***/ "./src/camel/element/controlflow/InterceptSendToEndpoint.js": /*!******************************************************************!*\ !*** ./src/camel/element/controlflow/InterceptSendToEndpoint.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var InterceptSendToEndpoint = function (_CamelElement) { _inherits(InterceptSendToEndpoint, _CamelElement); function InterceptSendToEndpoint() { _classCallCheck(this, InterceptSendToEndpoint); var _this = _possibleConstructorReturn(this, (InterceptSendToEndpoint.__proto__ || Object.getPrototypeOf(InterceptSendToEndpoint)).call(this)); _this.scope = "InterceptSendToEndpoint"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_interceptSendToEndpoint"; _this.description = ""; _this.uri = ""; _this.skipSendToOriginalEndpoint = false; return _this; } _createClass(InterceptSendToEndpoint, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("InterceptSendToEndpoint" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "uri", "skipSendToOriginalEndpoint"] }; } }]); return InterceptSendToEndpoint; }(_CamelElement3.default); exports.default = InterceptSendToEndpoint; /***/ }), /***/ "./src/camel/element/controlflow/Loop.js": /*!***********************************************!*\ !*** ./src/camel/element/controlflow/Loop.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Loop = function (_CamelElement) { _inherits(Loop, _CamelElement); function Loop() { _classCallCheck(this, Loop); var _this = _possibleConstructorReturn(this, (Loop.__proto__ || Object.getPrototypeOf(Loop)).call(this)); _this.scope = "Loop"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_loop"; _this.description = ""; _this.copy = false; _this.doWhile = false; return _this; } _createClass(Loop, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Loop" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; if (this.expression) str += "\n <" + this.expression + ">\n " + this.description + "\n \n";else str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "copy", "doWhile"] }; } }]); return Loop; }(_CamelElement3.default); exports.default = Loop; /***/ }), /***/ "./src/camel/element/controlflow/OnCompletion.js": /*!*******************************************************!*\ !*** ./src/camel/element/controlflow/OnCompletion.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var OnCompletion = function (_CamelElement) { _inherits(OnCompletion, _CamelElement); function OnCompletion() { _classCallCheck(this, OnCompletion); var _this = _possibleConstructorReturn(this, (OnCompletion.__proto__ || Object.getPrototypeOf(OnCompletion)).call(this)); _this.scope = "OnCompletion"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_onCompletion"; _this.description = ""; _this.executorServiceRef = ""; _this.mode = ""; _this.onCompleteOnly = false; _this.onFailureOnly = false; _this.parallelProcessing = false; _this.useOriginalMessage = false; return _this; } _createClass(OnCompletion, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("OnCompletion" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "executorServiceRef", "mode", "onCompleteOnly", "onFailureOnly", "parallelProcessing", "useOriginalMessage"] }; } }]); return OnCompletion; }(_CamelElement3.default); exports.default = OnCompletion; /***/ }), /***/ "./src/camel/element/controlflow/OnException.js": /*!******************************************************!*\ !*** ./src/camel/element/controlflow/OnException.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var OnException = function (_CamelElement) { _inherits(OnException, _CamelElement); function OnException() { _classCallCheck(this, OnException); var _this = _possibleConstructorReturn(this, (OnException.__proto__ || Object.getPrototypeOf(OnException)).call(this)); _this.scope = "OnException"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_onException"; _this.description = ""; _this.exception = ""; _this.onExceptionOccurredRef = ""; _this.onRedeliveryRef = ""; _this.redeliveryPolicyRef = ""; _this.useOriginalMessage = ""; _this.retryWhile = ""; _this.handled = ""; _this.continued = ""; return _this; } _createClass(OnException, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("OnException" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.retryWhile + " \n " + this.handled + " \n " + this.continued + "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "exception", "onExceptionOccurredRef", "onRedeliveryRef", "redeliveryPolicyRef", "useOriginalMessage", "retryWhile", "handled", "continued"] }; } }]); return OnException; }(_CamelElement3.default); exports.default = OnException; /***/ }), /***/ "./src/camel/element/controlflow/OnFallback.js": /*!*****************************************************!*\ !*** ./src/camel/element/controlflow/OnFallback.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Rollback = function (_CamelElement) { _inherits(Rollback, _CamelElement); function Rollback() { _classCallCheck(this, Rollback); var _this = _possibleConstructorReturn(this, (Rollback.__proto__ || Object.getPrototypeOf(Rollback)).call(this)); _this.scope = "Rollback"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_rollback"; _this.description = ""; _this.fallbackViaNetwork = false; return _this; } _createClass(Rollback, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Rollback" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "fallbackViaNetwork"] }; } }]); return Rollback; }(_CamelElement3.default); exports.default = Rollback; /***/ }), /***/ "./src/camel/element/controlflow/Rollback.js": /*!***************************************************!*\ !*** ./src/camel/element/controlflow/Rollback.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Rollback = function (_CamelElement) { _inherits(Rollback, _CamelElement); function Rollback() { _classCallCheck(this, Rollback); var _this = _possibleConstructorReturn(this, (Rollback.__proto__ || Object.getPrototypeOf(Rollback)).call(this)); _this.scope = "Rollback"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_rollback"; _this.description = ""; _this.markRollbackOnly = false; _this.markRollbackOnlyLast = false; _this.message = ""; return _this; } _createClass(Rollback, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Rollback" + this.message, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "markRollbackOnly", "markRollbackOnlyLast", "message"] }; } }]); return Rollback; }(_CamelElement3.default); exports.default = Rollback; /***/ }), /***/ "./src/camel/element/controlflow/Throttle.js": /*!***************************************************!*\ !*** ./src/camel/element/controlflow/Throttle.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Throttle = function (_CamelElement) { _inherits(Throttle, _CamelElement); function Throttle() { _classCallCheck(this, Throttle); var _this = _possibleConstructorReturn(this, (Throttle.__proto__ || Object.getPrototypeOf(Throttle)).call(this)); _this.scope = "Throttle"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_throttle"; _this.expression = ""; _this.asyncDelayed = false; _this.callerRunsWhenRejected = true; _this.executorServiceRef = ""; _this.rejectExecution = false; _this.timePeriodMillis = 1000; return _this; } _createClass(Throttle, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Throttle" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; if (this.expression) str += "\n <" + this.expression + ">\n " + this.description + "\n \n";else str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression", "asyncDelayed", "callerRunsWhenRejected", "executorServiceRef", "rejectExecution", "timePeriodMillis"] }; } }]); return Throttle; }(_CamelElement3.default); exports.default = Throttle; /***/ }), /***/ "./src/camel/element/controlflow/ThrowException.js": /*!*********************************************************!*\ !*** ./src/camel/element/controlflow/ThrowException.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ThrowException = function (_CamelElement) { _inherits(ThrowException, _CamelElement); function ThrowException() { _classCallCheck(this, ThrowException); var _this = _possibleConstructorReturn(this, (ThrowException.__proto__ || Object.getPrototypeOf(ThrowException)).call(this)); _this.scope = "ThrowException"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_throwException"; _this.description = ""; _this.exceptionType = ""; _this.message = ""; return _this; } _createClass(ThrowException, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("ThrowException" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "exceptionType", "message"] }; } }]); return ThrowException; }(_CamelElement3.default); exports.default = ThrowException; /***/ }), /***/ "./src/camel/element/controlflow/Transacted.js": /*!*****************************************************!*\ !*** ./src/camel/element/controlflow/Transacted.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Transacted = function (_CamelElement) { _inherits(Transacted, _CamelElement); function Transacted() { _classCallCheck(this, Transacted); var _this = _possibleConstructorReturn(this, (Transacted.__proto__ || Object.getPrototypeOf(Transacted)).call(this)); _this.scope = "Transacted"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_transacted"; _this.description = ""; _this.ref = ""; return _this; } _createClass(Transacted, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Transacted" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "ref"] }; } }]); return Transacted; }(_CamelElement3.default); exports.default = Transacted; /***/ }), /***/ "./src/camel/element/controlflow/index.js": /*!************************************************!*\ !*** ./src/camel/element/controlflow/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Transacted = exports.ThrowException = exports.Throttle = exports.Rollback = exports.OnFallback = exports.OnException = exports.OnCompletion = exports.Loop = exports.InterceptSendToEndpoint = exports.InterceptFrom = exports.Intercept = exports.DoTry = exports.DoFinally = exports.DoCatch = exports.Delay = undefined; var _Delay = __webpack_require__(/*! ./Delay */ "./src/camel/element/controlflow/Delay.js"); var _Delay2 = _interopRequireDefault(_Delay); var _DoCatch = __webpack_require__(/*! ./DoCatch */ "./src/camel/element/controlflow/DoCatch.js"); var _DoCatch2 = _interopRequireDefault(_DoCatch); var _DoFinally = __webpack_require__(/*! ./DoFinally */ "./src/camel/element/controlflow/DoFinally.js"); var _DoFinally2 = _interopRequireDefault(_DoFinally); var _DoTry = __webpack_require__(/*! ./DoTry */ "./src/camel/element/controlflow/DoTry.js"); var _DoTry2 = _interopRequireDefault(_DoTry); var _Intercept = __webpack_require__(/*! ./Intercept */ "./src/camel/element/controlflow/Intercept.js"); var _Intercept2 = _interopRequireDefault(_Intercept); var _InterceptFrom = __webpack_require__(/*! ./InterceptFrom */ "./src/camel/element/controlflow/InterceptFrom.js"); var _InterceptFrom2 = _interopRequireDefault(_InterceptFrom); var _InterceptSendToEndpoint = __webpack_require__(/*! ./InterceptSendToEndpoint */ "./src/camel/element/controlflow/InterceptSendToEndpoint.js"); var _InterceptSendToEndpoint2 = _interopRequireDefault(_InterceptSendToEndpoint); var _Loop = __webpack_require__(/*! ./Loop */ "./src/camel/element/controlflow/Loop.js"); var _Loop2 = _interopRequireDefault(_Loop); var _OnCompletion = __webpack_require__(/*! ./OnCompletion */ "./src/camel/element/controlflow/OnCompletion.js"); var _OnCompletion2 = _interopRequireDefault(_OnCompletion); var _OnException = __webpack_require__(/*! ./OnException */ "./src/camel/element/controlflow/OnException.js"); var _OnException2 = _interopRequireDefault(_OnException); var _OnFallback = __webpack_require__(/*! ./OnFallback */ "./src/camel/element/controlflow/OnFallback.js"); var _OnFallback2 = _interopRequireDefault(_OnFallback); var _Rollback = __webpack_require__(/*! ./Rollback */ "./src/camel/element/controlflow/Rollback.js"); var _Rollback2 = _interopRequireDefault(_Rollback); var _Throttle = __webpack_require__(/*! ./Throttle */ "./src/camel/element/controlflow/Throttle.js"); var _Throttle2 = _interopRequireDefault(_Throttle); var _ThrowException = __webpack_require__(/*! ./ThrowException */ "./src/camel/element/controlflow/ThrowException.js"); var _ThrowException2 = _interopRequireDefault(_ThrowException); var _Transacted = __webpack_require__(/*! ./Transacted */ "./src/camel/element/controlflow/Transacted.js"); var _Transacted2 = _interopRequireDefault(_Transacted); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.Delay = _Delay2.default; exports.DoCatch = _DoCatch2.default; exports.DoFinally = _DoFinally2.default; exports.DoTry = _DoTry2.default; exports.Intercept = _Intercept2.default; exports.InterceptFrom = _InterceptFrom2.default; exports.InterceptSendToEndpoint = _InterceptSendToEndpoint2.default; exports.Loop = _Loop2.default; exports.OnCompletion = _OnCompletion2.default; exports.OnException = _OnException2.default; exports.OnFallback = _OnFallback2.default; exports.Rollback = _Rollback2.default; exports.Throttle = _Throttle2.default; exports.ThrowException = _ThrowException2.default; exports.Transacted = _Transacted2.default; /***/ }), /***/ "./src/camel/element/index.js": /*!************************************!*\ !*** ./src/camel/element/index.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Route = exports.Relation = exports.CamelElement = exports.AbstractCamelElement = undefined; var _AbstractCamelElement = __webpack_require__(/*! ./AbstractCamelElement */ "./src/camel/element/AbstractCamelElement.js"); var _AbstractCamelElement2 = _interopRequireDefault(_AbstractCamelElement); var _CamelElement = __webpack_require__(/*! ./CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement2 = _interopRequireDefault(_CamelElement); var _Relation = __webpack_require__(/*! ./Relation */ "./src/camel/element/Relation.js"); var _Relation2 = _interopRequireDefault(_Relation); var _Route = __webpack_require__(/*! ./routing/Route */ "./src/camel/element/routing/Route.js"); var _Route2 = _interopRequireDefault(_Route); __webpack_require__(/*! ./compontent */ "./src/camel/element/compontent/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.AbstractCamelElement = _AbstractCamelElement2.default; exports.CamelElement = _CamelElement2.default; exports.Relation = _Relation2.default; exports.Route = _Route2.default; /***/ }), /***/ "./src/camel/element/miscellaneous/Aop.js": /*!************************************************!*\ !*** ./src/camel/element/miscellaneous/Aop.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Aop = function (_CamelElement) { _inherits(Aop, _CamelElement); function Aop() { _classCallCheck(this, Aop); var _this = _possibleConstructorReturn(this, (Aop.__proto__ || Object.getPrototypeOf(Aop)).call(this)); _this.scope = "Aop"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_aop"; _this.description = ""; _this.afterFinallyUri = ""; _this.afterUri = ""; _this.beforeUri = ""; return _this; } _createClass(Aop, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Aop" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "afterFinallyUri", "afterUri", "beforeUri"] }; } }]); return Aop; }(_CamelElement3.default); exports.default = Aop; /***/ }), /***/ "./src/camel/element/miscellaneous/Policy.js": /*!***************************************************!*\ !*** ./src/camel/element/miscellaneous/Policy.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Policy = function (_CamelElement) { _inherits(Policy, _CamelElement); function Policy() { _classCallCheck(this, Policy); var _this = _possibleConstructorReturn(this, (Policy.__proto__ || Object.getPrototypeOf(Policy)).call(this)); _this.scope = "Policy"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_policy"; _this.description = ""; _this.ref = ""; return _this; } _createClass(Policy, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Policy" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "ref"] }; } }]); return Policy; }(_CamelElement3.default); exports.default = Policy; /***/ }), /***/ "./src/camel/element/miscellaneous/Sample.js": /*!***************************************************!*\ !*** ./src/camel/element/miscellaneous/Sample.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Sample = function (_CamelElement) { _inherits(Sample, _CamelElement); function Sample() { _classCallCheck(this, Sample); var _this = _possibleConstructorReturn(this, (Sample.__proto__ || Object.getPrototypeOf(Sample)).call(this)); _this.scope = "Sample"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_sample"; _this.description = ""; _this.messageFrequency = ""; _this.samplePeriod = 1; _this.units = "SECONDS"; return _this; } _createClass(Sample, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Sample" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "messageFrequency", "samplePeriod", "units"] }; } }]); return Sample; }(_CamelElement3.default); exports.default = Sample; /***/ }), /***/ "./src/camel/element/miscellaneous/Stop.js": /*!*************************************************!*\ !*** ./src/camel/element/miscellaneous/Stop.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Stop = function (_CamelElement) { _inherits(Stop, _CamelElement); function Stop() { _classCallCheck(this, Stop); var _this = _possibleConstructorReturn(this, (Stop.__proto__ || Object.getPrototypeOf(Stop)).call(this)); _this.scope = "Stop"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_stop"; _this.description = ""; return _this; } _createClass(Stop, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Stop" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description"] }; } }]); return Stop; }(_CamelElement3.default); exports.default = Stop; /***/ }), /***/ "./src/camel/element/miscellaneous/Threads.js": /*!****************************************************!*\ !*** ./src/camel/element/miscellaneous/Threads.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Threads = function (_CamelElement) { _inherits(Threads, _CamelElement); function Threads() { _classCallCheck(this, Threads); var _this = _possibleConstructorReturn(this, (Threads.__proto__ || Object.getPrototypeOf(Threads)).call(this)); _this.scope = "Threads"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_threads"; _this.description = ""; _this.allowCoreThreadTimeOut = ""; _this.callerRunsWhenRejected = ""; _this.executorServiceRef = ""; _this.keepAliveTime = ""; _this.maxPoolSize = ""; _this.maxQueueSize = ""; _this.poolSize = ""; _this.rejectedPolicy = ""; _this.threadName = "Threads"; _this.timeUnit = ""; return _this; } _createClass(Threads, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Threads" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "allowCoreThreadTimeOut", "callerRunsWhenRejected", "executorServiceRef", "keepAliveTime", "maxPoolSize", "maxQueueSize", "poolSize", "rejectedPolicy", "threadName", "timeUnit"] }; } }]); return Threads; }(_CamelElement3.default); exports.default = Threads; /***/ }), /***/ "./src/camel/element/miscellaneous/Validate.js": /*!*****************************************************!*\ !*** ./src/camel/element/miscellaneous/Validate.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Validate = function (_CamelElement) { _inherits(Validate, _CamelElement); function Validate() { _classCallCheck(this, Validate); var _this = _possibleConstructorReturn(this, (Validate.__proto__ || Object.getPrototypeOf(Validate)).call(this)); _this.scope = "Validate"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_validate"; _this.description = ""; _this.expression = ""; return _this; } _createClass(Validate, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Validate", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression"] }; } }]); return Validate; }(_CamelElement3.default); exports.default = Validate; /***/ }), /***/ "./src/camel/element/miscellaneous/index.js": /*!**************************************************!*\ !*** ./src/camel/element/miscellaneous/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Validate = exports.Threads = exports.Stop = exports.Sample = exports.Policy = exports.Aop = undefined; var _Aop = __webpack_require__(/*! ./Aop */ "./src/camel/element/miscellaneous/Aop.js"); var _Aop2 = _interopRequireDefault(_Aop); var _Policy = __webpack_require__(/*! ./Policy */ "./src/camel/element/miscellaneous/Policy.js"); var _Policy2 = _interopRequireDefault(_Policy); var _Sample = __webpack_require__(/*! ./Sample */ "./src/camel/element/miscellaneous/Sample.js"); var _Sample2 = _interopRequireDefault(_Sample); var _Stop = __webpack_require__(/*! ./Stop */ "./src/camel/element/miscellaneous/Stop.js"); var _Stop2 = _interopRequireDefault(_Stop); var _Threads = __webpack_require__(/*! ./Threads */ "./src/camel/element/miscellaneous/Threads.js"); var _Threads2 = _interopRequireDefault(_Threads); var _Validate = __webpack_require__(/*! ./Validate */ "./src/camel/element/miscellaneous/Validate.js"); var _Validate2 = _interopRequireDefault(_Validate); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.Aop = _Aop2.default; exports.Policy = _Policy2.default; exports.Sample = _Sample2.default; exports.Stop = _Stop2.default; exports.Threads = _Threads2.default; exports.Validate = _Validate2.default; /***/ }), /***/ "./src/camel/element/routing/Aggregate.js": /*!************************************************!*\ !*** ./src/camel/element/routing/Aggregate.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Aggregate = function (_CamelElement) { _inherits(Aggregate, _CamelElement); function Aggregate() { _classCallCheck(this, Aggregate); var _this = _possibleConstructorReturn(this, (Aggregate.__proto__ || Object.getPrototypeOf(Aggregate)).call(this)); _this.scope = "Aggregate"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.correlationExpression = ""; _this.aggregateControllerRef = ""; _this.aggregationRepositoryRef = ""; _this.closeCorrelationKeyOnCompletion = ""; _this.completeAllOnStop = false; _this.completionFromBatchConsumer = false; _this.completionInterval = ""; _this.completionOnNewCorrelationGroup = false; _this.completionPredicate = ""; _this.completionSize = ""; _this.completionTimeout = ""; _this.completionTimeoutCheckerInterval = 1000; _this.discription = ""; _this.discardOnCompletionTimeout = false; _this.eagerCheckCompletion = false; _this.executorServiceRef = ""; _this.forceCompletionOnStop = false; _this.groupExchanges = false; _this.id = "_aggregate"; _this.ignoreInvalidCorrelationKeys = false; _this.optimisticLocking = false; _this.parallelProcessing = false; _this.strategyMethodAllowNull = false; _this.strategyMethodName = ""; _this.strategyRef = ""; _this.timeoutCheckerExecutorServiceRef = ""; _this.description = ""; return _this; } _createClass(Aggregate, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText(this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["correlationExpression", "aggregateControllerRef", "aggregationRepositoryRef", "closeCorrelationKeyOnCompletion", "completeAllOnStop", "completionFromBatchConsumer", "completionInterval", "completionOnNewCorrelationGroup", "completionPredicate", "completionSize", "completionTimeout", "completionTimeoutCheckerInterval", "discription", "discardOnCompletionTimeout", "eagerCheckCompletion", "executorServiceRef", "forceCompletionOnStop", "groupExchanges", "ignoreInvalidCorrelationKeys", "optimisticLocking", "id", "parallelProcessing", "strategyMethodAllowNull", "strategyMethodName", "strategyRef", "timeoutCheckerExecutorServiceRef"] }; } }]); return Aggregate; }(_CamelElement3.default); exports.default = Aggregate; /***/ }), /***/ "./src/camel/element/routing/Choice.js": /*!*********************************************!*\ !*** ./src/camel/element/routing/Choice.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Choice = function (_CamelElement) { _inherits(Choice, _CamelElement); function Choice() { _classCallCheck(this, Choice); var _this = _possibleConstructorReturn(this, (Choice.__proto__ || Object.getPrototypeOf(Choice)).call(this)); _this.scope = "Choice"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_choice"; _this.description = ""; return _this; } _createClass(Choice, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Choice", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description"] }; } }]); return Choice; }(_CamelElement3.default); exports.default = Choice; /***/ }), /***/ "./src/camel/element/routing/ClaimCheck.js": /*!*************************************************!*\ !*** ./src/camel/element/routing/ClaimCheck.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ClaimCheck = function (_CamelElement) { _inherits(ClaimCheck, _CamelElement); function ClaimCheck() { _classCallCheck(this, ClaimCheck); var _this = _possibleConstructorReturn(this, (ClaimCheck.__proto__ || Object.getPrototypeOf(ClaimCheck)).call(this)); _this.scope = "ClaimCheck"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.filter = ""; _this.id = "_claimCheck"; _this.key = ""; _this.operation = ""; _this.strategyMethodName = ""; _this.strategyRef = ""; _this.description = ""; return _this; } _createClass(ClaimCheck, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("ClaimCheck" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["filter", "id", "key", "operation", "strategyMethodName", "strategyRef", "description"] }; } }]); return ClaimCheck; }(_CamelElement3.default); exports.default = ClaimCheck; /***/ }), /***/ "./src/camel/element/routing/Filter.js": /*!*********************************************!*\ !*** ./src/camel/element/routing/Filter.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Filter = function (_CamelElement) { _inherits(Filter, _CamelElement); function Filter() { _classCallCheck(this, Filter); var _this = _possibleConstructorReturn(this, (Filter.__proto__ || Object.getPrototypeOf(Filter)).call(this)); _this.scope = "Filter"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_filter"; _this.description = ""; _this.expression = ""; return _this; } _createClass(Filter, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Filter", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression"] }; } }]); return Filter; }(_CamelElement3.default); exports.default = Filter; /***/ }), /***/ "./src/camel/element/routing/Hystrix.js": /*!**********************************************!*\ !*** ./src/camel/element/routing/Hystrix.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Hystrix = function (_CamelElement) { _inherits(Hystrix, _CamelElement); function Hystrix() { _classCallCheck(this, Hystrix); var _this = _possibleConstructorReturn(this, (Hystrix.__proto__ || Object.getPrototypeOf(Hystrix)).call(this)); _this.scope = "Hystrix"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_hystrix"; _this.description = ""; _this.hystrixConfigurationRef = ""; return _this; } _createClass(Hystrix, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Hystrix" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "hystrixConfigurationRef"] }; } }]); return Hystrix; }(_CamelElement3.default); exports.default = Hystrix; /***/ }), /***/ "./src/camel/element/routing/IdempotentConsumer.js": /*!*********************************************************!*\ !*** ./src/camel/element/routing/IdempotentConsumer.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var IdempotentConsumer = function (_CamelElement) { _inherits(IdempotentConsumer, _CamelElement); function IdempotentConsumer() { _classCallCheck(this, IdempotentConsumer); var _this = _possibleConstructorReturn(this, (IdempotentConsumer.__proto__ || Object.getPrototypeOf(IdempotentConsumer)).call(this)); _this.scope = "IdempotentConsumer"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.expression = ""; _this.completionEager = false; _this.eager = true; _this.messageIdRepositoryRef = ""; _this.removeOnFailure = true; _this.skipDuplicate = true; _this.id = "_idempotentConsumer"; _this.description = ""; _this.expression = ""; return _this; } _createClass(IdempotentConsumer, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("IdempotentConsumer" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["expression", "completionEager", "eager", "messageIdRepositoryRef", "removeOnFailure", "skipDuplicate", "id", "description", "expression"] }; } }]); return IdempotentConsumer; }(_CamelElement3.default); exports.default = IdempotentConsumer; /***/ }), /***/ "./src/camel/element/routing/LoadBalance.js": /*!**************************************************!*\ !*** ./src/camel/element/routing/LoadBalance.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var LoadBalance = function (_CamelElement) { _inherits(LoadBalance, _CamelElement); function LoadBalance() { _classCallCheck(this, LoadBalance); var _this = _possibleConstructorReturn(this, (LoadBalance.__proto__ || Object.getPrototypeOf(LoadBalance)).call(this)); _this.scope = "LoadBalance"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_loadBalance"; _this.description = ""; _this.inheritErrorHandler = false; return _this; } _createClass(LoadBalance, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("LoadBalance" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "inheritErrorHandler"] }; } }]); return LoadBalance; }(_CamelElement3.default); exports.default = LoadBalance; /***/ }), /***/ "./src/camel/element/routing/Multicast.js": /*!************************************************!*\ !*** ./src/camel/element/routing/Multicast.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Multicast = function (_CamelElement) { _inherits(Multicast, _CamelElement); function Multicast() { _classCallCheck(this, Multicast); var _this = _possibleConstructorReturn(this, (Multicast.__proto__ || Object.getPrototypeOf(Multicast)).call(this)); _this.scope = "Multicast"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_multicast"; _this.executorServiceRef = ""; _this.onPrepareRef = ""; _this.parallelAggregate = false; _this.parallelProcessing = false; _this.shareUnitOfWork = false; _this.stopOnAggregateException = false; _this.stopOnException = false; _this.strategyMethodAllowNull = false; _this.strategyMethodName = ""; _this.strategyRef = ""; _this.streaming = false; _this.timeout = 0; return _this; } _createClass(Multicast, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("LoadBalance" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "executorServiceRef", "onPrepareRef", "parallelAggregate", "parallelProcessing", "shareUnitOfWork", "stopOnAggregateException", "stopOnException", "strategyMethodAllowNull", "strategyMethodName", "strategyRef", "streaming", "timeout"] }; } }]); return Multicast; }(_CamelElement3.default); exports.default = Multicast; /***/ }), /***/ "./src/camel/element/routing/Pipeline.js": /*!***********************************************!*\ !*** ./src/camel/element/routing/Pipeline.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Pipeline = function (_CamelElement) { _inherits(Pipeline, _CamelElement); function Pipeline() { _classCallCheck(this, Pipeline); var _this = _possibleConstructorReturn(this, (Pipeline.__proto__ || Object.getPrototypeOf(Pipeline)).call(this)); _this.scope = "Pipeline"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_choice"; _this.description = ""; return _this; } _createClass(Pipeline, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Pipeline" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description"] }; } }]); return Pipeline; }(_CamelElement3.default); exports.default = Pipeline; /***/ }), /***/ "./src/camel/element/routing/RecipientList.js": /*!****************************************************!*\ !*** ./src/camel/element/routing/RecipientList.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var RecipientList = function (_CamelElement) { _inherits(RecipientList, _CamelElement); function RecipientList() { _classCallCheck(this, RecipientList); var _this = _possibleConstructorReturn(this, (RecipientList.__proto__ || Object.getPrototypeOf(RecipientList)).call(this)); _this.scope = "RecipientList"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_recipientlist"; _this.cacheSize = ""; _this.delimiter = ""; _this.description = ""; _this.ignoreInvalidEndpoints = false; _this.executorServiceRef = ""; _this.onPrepareRef = ""; _this.parallelAggregate = false; _this.parallelProcessing = false; _this.shareUnitOfWork = false; _this.stopOnAggregateException = false; _this.stopOnException = false; _this.strategyMethodAllowNull = false; _this.strategyMethodName = ""; _this.strategyRef = ""; _this.streaming = false; _this.timeout = 0; return _this; } _createClass(RecipientList, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("LoadBalance" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "cacheSize", "delimiter", "description", "ignoreInvalidEndpoints", "executorServiceRef", "onPrepareRef", "parallelAggregate", "parallelProcessing", "shareUnitOfWork", "stopOnAggregateException", "stopOnException", "strategyMethodAllowNull", "strategyMethodName", "strategyRef", "streaming", "timeout"] }; } }]); return RecipientList; }(_CamelElement3.default); exports.default = RecipientList; /***/ }), /***/ "./src/camel/element/routing/Resequence.js": /*!*************************************************!*\ !*** ./src/camel/element/routing/Resequence.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Resequence = function (_CamelElement) { _inherits(Resequence, _CamelElement); function Resequence() { _classCallCheck(this, Resequence); var _this = _possibleConstructorReturn(this, (Resequence.__proto__ || Object.getPrototypeOf(Resequence)).call(this)); _this.scope = "Resequence"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_resequence1"; _this.description = ""; _this.expression = ""; return _this; } _createClass(Resequence, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Resequence" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression"] }; } }]); return Resequence; }(_CamelElement3.default); exports.default = Resequence; /***/ }), /***/ "./src/camel/element/routing/Route.js": /*!********************************************!*\ !*** ./src/camel/element/routing/Route.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); var _Relation = __webpack_require__(/*! ../Relation */ "./src/camel/element/Relation.js"); var _Relation2 = _interopRequireDefault(_Relation); var _Archor = __webpack_require__(/*! ../../utility/Archor */ "./src/camel/utility/Archor.js"); var _Archor2 = _interopRequireDefault(_Archor); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Route = function (_CamelElement) { _inherits(Route, _CamelElement); function Route() { _classCallCheck(this, Route); var _this = _possibleConstructorReturn(this, (Route.__proto__ || Object.getPrototypeOf(Route)).call(this)); _this.width = 250; _this.height = 300; _this.scope = "route"; _this.childNode = []; // 存放在route中的元素 _this.input = []; // 线的接入点 _this.output = []; // 线的出口点 _this.helper = new _utility.Helper(); _this.isOpenArchor = false; // 是否显示锚点 _this.autoStartup = ""; _this.delayer = ""; _this.description = ""; _this.errorHandlerRef = ""; _this.group = ""; _this.id = "_route"; _this.logMask = ""; _this.messageHistory = ""; _this.routePolicyRef = ""; _this.shutdownRoute = ""; _this.shutdownRunningTask = ""; _this.startupOrder = ""; _this.streamCache = ""; _this.trace = ""; return _this; } _createClass(Route, [{ key: "paint", value: function paint(g) { g.save(); g.drawOvalBorder(this.x, this.y, this.width, this.height, 15, "#e5f8ff"); g.setColor(_utility.Resources.COLOR.black); g.setFont("20px sans-serif"); g.drawString("Route", this.x + 20, this.y + 30); g.restore(); // 画锚点 // if (this.isOpenArchor) { // const archor = new Archor(); // const openArchor = [ // { x: 0, y: 0 }, // { x: 1, y: 0 }, // { x: 1, y: 1 }, // { x: 0, y: 1 }, // ]; //以当前元素左上角为坐标系,得(0, 0)为左上角,依次类推 // const params = { x: this.x, y: this.y, targetW: this.width, targetH: this.height }; // archor.setProps(params); // archor.paint(g); // } } }, { key: "getEleToTree", value: function getEleToTree(data) { var nodes = []; for (var i = 0; i < data.length; i++) { var fields = { text: data[i].scope, collapseIcon: "glyphicon glyphicon-plus", expandIcon: "glyphicon glyphicon-minus" }; if (!(data[i] instanceof _Relation2.default)) nodes.push(fields); } return nodes; } // 重新设置宽高 }, { key: "resetWH", value: function resetWH(w, h) { this.width = w; this.height = h; } }, { key: "toXML", value: function toXML() { var str = "\n"; var arr = this.childNode; var rels = [], elems = [], startEle = {}; arr.map(function (item) { if (item instanceof _Relation2.default) { rels.push(item); } else { if (item.outputid && !item.inputid) startEle = item;else elems.push(item); } }); // 如果有连线就输出连线的内容,如果没有连线就直接输出现有的内容 if (Object.keys(startEle).length != 0) { var _transEle = this.transEle(startEle, rels, elems), tempArr = _transEle.tempArr, tempArr2 = _transEle.tempArr2; tempArr.forEach(function (item) { return str += item.toXML(); }); if (tempArr2.length > 0) tempArr2.forEach(function (item2) { return str += item2.toXML(); }); //(在有连线数组中的无连线元素) } else { // 全部没有连线 elems.map(function (item, index) { return str += item.toXML(index); }); } str += "\n"; return str; } /** * 递归找到对应的数组[通过线来找对应的元素] * @param {开始元素} startEle * @param {线的数组} rels * @param {所有元素(除开始元素)} elms * @param {需要生成xml的数组} arr * @param {没有连线元素的xml} str */ }, { key: "transEle", value: function transEle(startEle, rels, elms) { var arr = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; var selectRelation = {}, relation = rels, elems = elms; arr.push(startEle); if (elems.length > 0) { // 元素还有但是没有连线 if (relation.length > 0) { for (var i = 0; i < relation.length; i++) { if (relation[i]._startelemid == startEle.id) { selectRelation = relation[i]; // 减去当前的线条 relation.splice(i, 1); break; } } for (var j = 0; j < elems.length; j++) { if (elems[j].id == selectRelation._endelemid) { startEle = elems[j]; elems.splice(j, 1); break; } } this.transEle(startEle, relation, elems, arr); } } return { tempArr: arr, tempArr2: elems }; } }, { key: "parseXML", value: function parseXML(xmlNode) { var _this2 = this; var elem = [], camelEle = {}, that = this; var traversalNode = function traversalNode(xmlNode) { // 由于这里的from是根据谁先连线就谁是from来决定的,因此不能直接通过xmlNode来获取tagName var tagName = xmlNode.attributes["scope"].value; camelEle = _this2.helper.parseNode(xmlNode, tagName, that); elem.push(camelEle); }; if (xmlNode.hasChildNodes()) { for (var i = 0; i < xmlNode.children.length; i++) { traversalNode(xmlNode.children[i]); } } return elem; } }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["autoStartup", "delayer", "description", "name", "errorHandlerRef", "group", "logMask", "messageHistory", "routePolicyRef", "shutdownRoute", "shutdownRunningTask", "startupOrder", "streamCache", "trace"], documentation: Route.documentation }; } }]); return Route; }(_CamelElement3.default); Route.documentation = "
    \n
    \n
    \n
    \n
    \n

    Route

    \n
    \n
    \n
    \n
    \n

    Table of Contents

    \n
    \n
    Usage
    \n
    Properties
    \n
    \n
    \n

    Contains all elements that make up an individual route in a routing context

    \n
    \n
    \n
    \n
    \n

    Usage

    \n
    \n
    \n
    \n

    The Route pattern represents the <route/> element within the\n <camelContext/> element in a routing context file. You can insert\n multiple Route patterns inside the <camelContext/> element to build a\n multiple route project.\n

    \n

    All route-building patterns and components must be placed on the canvas within a Route\n node.

    \n
    \n
    \n
    \n
    \n
    \n

    Properties

    \n
    \n
    \n
    \n
    \n

    Table 54. Route Properties

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    NameDescription
    \n

    Auto Startup

    \n
    \n

    Specifies whether to start the route automatically when Camel\n starts up. The default is true.

    \n
    \n

    Delayer

    \n
    \n

    Specifies a delay, in milliseconds, that slows down message\n processing. This is useful during debugging, making it easier to inspect\n the logs while tracking messages. The default is\n 0.\n

    \n
    \n

    Description

    \n
    \n

    Specifies a textual description for the route. This description is\n included in the generated XML file, but it is informational only. It is\n not used by Apache Camel.

    \n
    \n

    Error Handler Ref

    \n
    \n

    Specifies a reference to a bean that defines and applies an error\n handler.

    \n
    \n

    Group

    \n
    \n

    Specifies the name of a group of which the route is a member. This\n property is informational only. It is not used by Apache Camel.

    \n
    \n

    Handle Fault

    \n
    \n

    Specifies whether to convert fault messages into exceptions. Intended\n for applications deployed into a JBI container, so the Camel error\n handler can react to faults. The default is\n false.\n

    \n
    \n

    Id

    \n
    \n

    [Required] Specifies a unique id for\n the route. This id appears in the generated XML in Source view, on the\n label of the route node on the canvas, and in log entries. The tooling\n automatically generates and assigns a default Id, but you can change\n it.

    \n
    \n

    Message History

    \n
    \n

    Specifies whether to enable/disable Message History. When enabled,\n Apache Camel captures how the exchange is routed as an\n org.apache.camel.MessageHistory entity that is\n stored on the exchange. This information can be retrieved through Java\n code or through the error handler exhausted exceptions logs. For\n details, see Apache\n Camel: Message History The default is\n true.\n

    \n
    \n

    Route Policy Ref

    \n
    \n

    Specifies a reference to a bean that defines and applies a policy\n that controls routes at runtime. The bean can implement any logic that\n you want Apache Camel to invoke at route startup or at route shutdown.

    \n
    \n

    Shutdown Route

    \n
    \n

    Specifies how to gracefully shut down the route. The options are:

    \n
    \n
      \n
    • Default — Shuts\n the route down as soon as possible, but waits a\n timeout period of 300 seconds for any inflight and\n pending messages to complete. After the timeout period,\n it forces the route and its services to shutdown\n immediately.
    • \n
    • Defer — For use\n when an internal route depends on another. This option defers shutdown\n until all inflight exchanges have completed, and allows\n the route to remain active through the graceful shutdown\n timeout period.
    • \n
    \n
    \n
    \n

    Shutdown Running Task

    \n
    \n

    Specifies how to shut down a running task, and determines how a route consumer\n behaves during\n the shutdown. The options are:

    \n
    \n
      \n
    • Complete Current Task\n Only — [Default] The route\n consumer\n shut down as soon as the current, in-progress task\n (message) has been completed.
    • \n
    • Complete All\n Tasks — For use with batch\n consumers\n that operate on many messages in batch. The route\n consumer shuts down after all pending tasks (messages)\n have been completed.
    • \n
    \n
    \n
    \n

    Startup Order

    \n
    \n

    Configures the ordering of the routes being started.

    \n
    \n

    Stream Cache

    \n
    \n

    Specifies whether to cache streams that otherwise could not be\n accessed multiple times. This is necessary for implementing redelivery\n during error handling, which requires reading the stream multiple times.\n The default is false.

    \n
    \n

    Trace

    \n
    \n

    Specifies whether to trace the path of an exchange through a\n particular route. The default is\n false.\n

    \n
    \n
    \n

    \n
    \n
    \n
    "; exports.default = Route; /***/ }), /***/ "./src/camel/element/routing/RoutingSlip.js": /*!**************************************************!*\ !*** ./src/camel/element/routing/RoutingSlip.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Resequence = function (_CamelElement) { _inherits(Resequence, _CamelElement); function Resequence() { _classCallCheck(this, Resequence); var _this = _possibleConstructorReturn(this, (Resequence.__proto__ || Object.getPrototypeOf(Resequence)).call(this)); _this.scope = "Resequence"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_resequence1"; _this.description = ""; _this.expression = ""; _this.cacheSize = ""; _this.ignoreInvalidEndpoints = false; _this.uriDelimiter = ""; return _this; } _createClass(Resequence, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Resequence" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression", "cacheSize", "ignoreInvalidEndpoints", "uriDelimiter"] }; } }]); return Resequence; }(_CamelElement3.default); exports.default = Resequence; /***/ }), /***/ "./src/camel/element/routing/Saga.js": /*!*******************************************!*\ !*** ./src/camel/element/routing/Saga.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Saga = function (_CamelElement) { _inherits(Saga, _CamelElement); function Saga() { _classCallCheck(this, Saga); var _this = _possibleConstructorReturn(this, (Saga.__proto__ || Object.getPrototypeOf(Saga)).call(this)); _this.scope = "Saga"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_saga"; _this.description = ""; _this.completionMode = "AUTO"; _this.propagation = "REQUIRED"; _this.timeoutInMilliseconds = ""; return _this; } _createClass(Saga, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Saga" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "completionMode", "propagation", "timeoutInMilliseconds"] }; } }]); return Saga; }(_CamelElement3.default); exports.default = Saga; /***/ }), /***/ "./src/camel/element/routing/Sort.js": /*!*******************************************!*\ !*** ./src/camel/element/routing/Sort.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Sort = function (_CamelElement) { _inherits(Sort, _CamelElement); function Sort() { _classCallCheck(this, Sort); var _this = _possibleConstructorReturn(this, (Sort.__proto__ || Object.getPrototypeOf(Sort)).call(this)); _this.scope = "Sort"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_sort"; _this.description = ""; _this.expression = ""; _this.comparatorRef = ""; return _this; } _createClass(Sort, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Sort", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression", "comparatorRef"] }; } }]); return Sort; }(_CamelElement3.default); exports.default = Sort; /***/ }), /***/ "./src/camel/element/routing/Split.js": /*!********************************************!*\ !*** ./src/camel/element/routing/Split.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Split = function (_CamelElement) { _inherits(Split, _CamelElement); function Split() { _classCallCheck(this, Split); var _this = _possibleConstructorReturn(this, (Split.__proto__ || Object.getPrototypeOf(Split)).call(this)); _this.scope = "Split"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_split"; _this.executorServiceRef = ""; _this.onPrepareRef = ""; _this.parallelAggregate = false; _this.parallelProcessing = false; _this.shareUnitOfWork = false; _this.stopOnAggregateException = false; _this.stopOnException = false; _this.strategyMethodAllowNull = false; _this.strategyMethodName = ""; _this.strategyRef = ""; _this.streaming = false; _this.timeout = 0; return _this; } _createClass(Split, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Split" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "executorServiceRef", "onPrepareRef", "parallelAggregate", "parallelProcessing", "shareUnitOfWork", "stopOnAggregateException", "stopOnException", "strategyMethodAllowNull", "strategyMethodName", "strategyRef", "streaming", "timeout"] }; } }]); return Split; }(_CamelElement3.default); exports.default = Split; /***/ }), /***/ "./src/camel/element/routing/When.js": /*!*******************************************!*\ !*** ./src/camel/element/routing/When.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var When = function (_CamelElement) { _inherits(When, _CamelElement); function When() { _classCallCheck(this, When); var _this = _possibleConstructorReturn(this, (When.__proto__ || Object.getPrototypeOf(When)).call(this)); _this.scope = "When"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_when"; _this.description = ""; _this.expression = ""; return _this; } _createClass(When, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("When" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression"] }; } }]); return When; }(_CamelElement3.default); exports.default = When; /***/ }), /***/ "./src/camel/element/routing/WireTap.js": /*!**********************************************!*\ !*** ./src/camel/element/routing/WireTap.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var WireTap = function (_CamelElement) { _inherits(WireTap, _CamelElement); function WireTap() { _classCallCheck(this, WireTap); var _this = _possibleConstructorReturn(this, (WireTap.__proto__ || Object.getPrototypeOf(WireTap)).call(this)); _this.scope = "WireTap"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_wireTap"; _this.description = ""; _this.allowOptimisedComponents = true; _this.body = ""; _this.cacheSize = ""; _this.copy = true; _this.dynamicUri = true; _this.executorServiceRef = ""; _this.ignoreInvalidEndpoint = false; _this.onPrepareRef = ""; _this.pattern = ""; _this.processorRef = ""; _this.uri = ""; return _this; } _createClass(WireTap, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("WireTap" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "allowOptimisedComponents", "cacheSize", "copy", "dynamicUri", "executorServiceRef", "ignoreInvalidEndpoint", "onPrepareRef", "pattern", "processorRef", "uri"] }; } }]); return WireTap; }(_CamelElement3.default); exports.default = WireTap; /***/ }), /***/ "./src/camel/element/routing/index.js": /*!********************************************!*\ !*** ./src/camel/element/routing/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WireTap = exports.When = exports.Split = exports.Sort = exports.Saga = exports.RoutingSlip = exports.Route = exports.Resequence = exports.RecipientList = exports.Pipeline = exports.Multicast = exports.LoadBalance = exports.Hystrix = exports.IdempotentConsumer = exports.Filter = exports.ClaimCheck = exports.Choice = exports.Aggregate = undefined; var _Aggregate = __webpack_require__(/*! ./Aggregate */ "./src/camel/element/routing/Aggregate.js"); var _Aggregate2 = _interopRequireDefault(_Aggregate); var _Choice = __webpack_require__(/*! ./Choice */ "./src/camel/element/routing/Choice.js"); var _Choice2 = _interopRequireDefault(_Choice); var _ClaimCheck = __webpack_require__(/*! ./ClaimCheck */ "./src/camel/element/routing/ClaimCheck.js"); var _ClaimCheck2 = _interopRequireDefault(_ClaimCheck); var _Filter = __webpack_require__(/*! ./Filter */ "./src/camel/element/routing/Filter.js"); var _Filter2 = _interopRequireDefault(_Filter); var _IdempotentConsumer = __webpack_require__(/*! ./IdempotentConsumer */ "./src/camel/element/routing/IdempotentConsumer.js"); var _IdempotentConsumer2 = _interopRequireDefault(_IdempotentConsumer); var _Hystrix = __webpack_require__(/*! ./Hystrix */ "./src/camel/element/routing/Hystrix.js"); var _Hystrix2 = _interopRequireDefault(_Hystrix); var _LoadBalance = __webpack_require__(/*! ./LoadBalance */ "./src/camel/element/routing/LoadBalance.js"); var _LoadBalance2 = _interopRequireDefault(_LoadBalance); var _Multicast = __webpack_require__(/*! ./Multicast */ "./src/camel/element/routing/Multicast.js"); var _Multicast2 = _interopRequireDefault(_Multicast); var _Pipeline = __webpack_require__(/*! ./Pipeline */ "./src/camel/element/routing/Pipeline.js"); var _Pipeline2 = _interopRequireDefault(_Pipeline); var _RecipientList = __webpack_require__(/*! ./RecipientList */ "./src/camel/element/routing/RecipientList.js"); var _RecipientList2 = _interopRequireDefault(_RecipientList); var _Resequence = __webpack_require__(/*! ./Resequence */ "./src/camel/element/routing/Resequence.js"); var _Resequence2 = _interopRequireDefault(_Resequence); var _Route = __webpack_require__(/*! ./Route */ "./src/camel/element/routing/Route.js"); var _Route2 = _interopRequireDefault(_Route); var _RoutingSlip = __webpack_require__(/*! ./RoutingSlip */ "./src/camel/element/routing/RoutingSlip.js"); var _RoutingSlip2 = _interopRequireDefault(_RoutingSlip); var _Saga = __webpack_require__(/*! ./Saga */ "./src/camel/element/routing/Saga.js"); var _Saga2 = _interopRequireDefault(_Saga); var _Sort = __webpack_require__(/*! ./Sort */ "./src/camel/element/routing/Sort.js"); var _Sort2 = _interopRequireDefault(_Sort); var _Split = __webpack_require__(/*! ./Split */ "./src/camel/element/routing/Split.js"); var _Split2 = _interopRequireDefault(_Split); var _When = __webpack_require__(/*! ./When */ "./src/camel/element/routing/When.js"); var _When2 = _interopRequireDefault(_When); var _WireTap = __webpack_require__(/*! ./WireTap */ "./src/camel/element/routing/WireTap.js"); var _WireTap2 = _interopRequireDefault(_WireTap); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.Aggregate = _Aggregate2.default; exports.Choice = _Choice2.default; exports.ClaimCheck = _ClaimCheck2.default; exports.Filter = _Filter2.default; exports.IdempotentConsumer = _IdempotentConsumer2.default; exports.Hystrix = _Hystrix2.default; exports.LoadBalance = _LoadBalance2.default; exports.Multicast = _Multicast2.default; exports.Pipeline = _Pipeline2.default; exports.RecipientList = _RecipientList2.default; exports.Resequence = _Resequence2.default; exports.Route = _Route2.default; exports.RoutingSlip = _RoutingSlip2.default; exports.Saga = _Saga2.default; exports.Sort = _Sort2.default; exports.Split = _Split2.default; exports.When = _When2.default; exports.WireTap = _WireTap2.default; /***/ }), /***/ "./src/camel/element/transformation/ConvertBodyTo.js": /*!***********************************************************!*\ !*** ./src/camel/element/transformation/ConvertBodyTo.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ConvertBodyTo = function (_CamelElement) { _inherits(ConvertBodyTo, _CamelElement); function ConvertBodyTo() { _classCallCheck(this, ConvertBodyTo); var _this = _possibleConstructorReturn(this, (ConvertBodyTo.__proto__ || Object.getPrototypeOf(ConvertBodyTo)).call(this)); _this.scope = "ConvertBodyTo"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_convertBodyTo"; _this.description = ""; _this.charset = ""; _this.type = ""; return _this; } _createClass(ConvertBodyTo, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("ConvertBodyTo" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "charset", "type"] }; } }]); return ConvertBodyTo; }(_CamelElement3.default); exports.default = ConvertBodyTo; /***/ }), /***/ "./src/camel/element/transformation/Enrich.js": /*!****************************************************!*\ !*** ./src/camel/element/transformation/Enrich.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Enrich = function (_CamelElement) { _inherits(Enrich, _CamelElement); function Enrich() { _classCallCheck(this, Enrich); var _this = _possibleConstructorReturn(this, (Enrich.__proto__ || Object.getPrototypeOf(Enrich)).call(this)); _this.scope = "Enrich"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_enrich"; _this.description = ""; _this.aggregateOnException = ""; _this.cacheSize = ""; _this.ignoreInvalidEndpoint = false; _this.shareUnitOfWork = false; _this.strategyMethodAllowNull = false; _this.strategyMethodName = ""; _this.strategyRef = ""; _this.expression = ""; return _this; } _createClass(Enrich, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Enrich" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "aggregateOnException", "cacheSize", "ignoreInvalidEndpoint", "shareUnitOfWork", "strategyMethodAllowNull", "strategyMethodName", "strategyRef", "expression"] }; } }]); return Enrich; }(_CamelElement3.default); exports.default = Enrich; /***/ }), /***/ "./src/camel/element/transformation/InOnly.js": /*!****************************************************!*\ !*** ./src/camel/element/transformation/InOnly.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var InOnly = function (_CamelElement) { _inherits(InOnly, _CamelElement); function InOnly() { _classCallCheck(this, InOnly); var _this = _possibleConstructorReturn(this, (InOnly.__proto__ || Object.getPrototypeOf(InOnly)).call(this)); _this.scope = "InOnly"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_inOnly"; _this.description = ""; _this.uri = ""; _this.ref_deprecated = ""; // 已弃用(ref) return _this; } _createClass(InOnly, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("InOnly" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "uri", "ref_deprecated"] }; } }]); return InOnly; }(_CamelElement3.default); exports.default = InOnly; /***/ }), /***/ "./src/camel/element/transformation/InOut.js": /*!***************************************************!*\ !*** ./src/camel/element/transformation/InOut.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var InOut = function (_CamelElement) { _inherits(InOut, _CamelElement); function InOut() { _classCallCheck(this, InOut); var _this = _possibleConstructorReturn(this, (InOut.__proto__ || Object.getPrototypeOf(InOut)).call(this)); _this.scope = "InOut"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_inOut"; _this.description = ""; _this.uri = ""; _this.ref_deprecated = ""; // 已弃用(ref) return _this; } _createClass(InOut, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("InOut" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "uri", "ref_deprecated"] }; } }]); return InOut; }(_CamelElement3.default); exports.default = InOut; /***/ }), /***/ "./src/camel/element/transformation/Marshal.js": /*!*****************************************************!*\ !*** ./src/camel/element/transformation/Marshal.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Marshal = function (_CamelElement) { _inherits(Marshal, _CamelElement); function Marshal() { _classCallCheck(this, Marshal); var _this = _possibleConstructorReturn(this, (Marshal.__proto__ || Object.getPrototypeOf(Marshal)).call(this)); _this.scope = "Marshal"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_marshal"; _this.description = ""; _this.dataFormatType = ""; _this.ref_deprecated = ""; // 已弃用(ref) return _this; } _createClass(Marshal, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Marshal" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.dataFormatType + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "dataFormatType", "ref_deprecated"] }; } }]); return Marshal; }(_CamelElement3.default); exports.default = Marshal; /***/ }), /***/ "./src/camel/element/transformation/PollEnrich.js": /*!********************************************************!*\ !*** ./src/camel/element/transformation/PollEnrich.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var PollEnrich = function (_CamelElement) { _inherits(PollEnrich, _CamelElement); function PollEnrich() { _classCallCheck(this, PollEnrich); var _this = _possibleConstructorReturn(this, (PollEnrich.__proto__ || Object.getPrototypeOf(PollEnrich)).call(this)); _this.scope = "PollEnrich"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_pollEnrich"; _this.description = ""; _this.expression = ""; _this.aggregateOnException = false; _this.cacheSize = ""; _this.ignoreInvalidEndpoint = false; _this.strategyMethodAllowNull = false; _this.strategyMethodName = ""; _this.strategyRef = ""; _this.timeout = -1; return _this; } _createClass(PollEnrich, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("PollEnrich", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression", "aggregateOnException", "cacheSize", "ignoreInvalidEndpoint", "strategyMethodAllowNull", "strategyMethodName", "strategyRef", "timeout"] }; } }]); return PollEnrich; }(_CamelElement3.default); exports.default = PollEnrich; /***/ }), /***/ "./src/camel/element/transformation/RemoveHeader.js": /*!**********************************************************!*\ !*** ./src/camel/element/transformation/RemoveHeader.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var RemoveHeader = function (_CamelElement) { _inherits(RemoveHeader, _CamelElement); function RemoveHeader() { _classCallCheck(this, RemoveHeader); var _this = _possibleConstructorReturn(this, (RemoveHeader.__proto__ || Object.getPrototypeOf(RemoveHeader)).call(this)); _this.scope = "RemoveHeader"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_removeHeader"; _this.description = ""; _this.headerName = ""; return _this; } _createClass(RemoveHeader, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("RemoveHeader" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "headerName"] }; } }]); return RemoveHeader; }(_CamelElement3.default); exports.default = RemoveHeader; /***/ }), /***/ "./src/camel/element/transformation/RemoveHeaders.js": /*!***********************************************************!*\ !*** ./src/camel/element/transformation/RemoveHeaders.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var RemoveHeaders = function (_CamelElement) { _inherits(RemoveHeaders, _CamelElement); function RemoveHeaders() { _classCallCheck(this, RemoveHeaders); var _this = _possibleConstructorReturn(this, (RemoveHeaders.__proto__ || Object.getPrototypeOf(RemoveHeaders)).call(this)); _this.scope = "RemoveHeaders"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_removeHeaders"; _this.description = ""; _this.excludePattern = ""; _this.pattern = ""; return _this; } _createClass(RemoveHeaders, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("RemoveHeaders" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "excludePattern", "pattern"] }; } }]); return RemoveHeaders; }(_CamelElement3.default); exports.default = RemoveHeaders; /***/ }), /***/ "./src/camel/element/transformation/RemoveProperties.js": /*!**************************************************************!*\ !*** ./src/camel/element/transformation/RemoveProperties.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var RemoveProperties = function (_CamelElement) { _inherits(RemoveProperties, _CamelElement); function RemoveProperties() { _classCallCheck(this, RemoveProperties); var _this = _possibleConstructorReturn(this, (RemoveProperties.__proto__ || Object.getPrototypeOf(RemoveProperties)).call(this)); _this.scope = "RemoveProperties"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_removeProperties"; _this.description = ""; _this.excludePattern = ""; _this.pattern = ""; return _this; } _createClass(RemoveProperties, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("RemoveProperties" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "excludePattern", "pattern"] }; } }]); return RemoveProperties; }(_CamelElement3.default); exports.default = RemoveProperties; /***/ }), /***/ "./src/camel/element/transformation/RemoveProperty.js": /*!************************************************************!*\ !*** ./src/camel/element/transformation/RemoveProperty.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var RemoveProperty = function (_CamelElement) { _inherits(RemoveProperty, _CamelElement); function RemoveProperty() { _classCallCheck(this, RemoveProperty); var _this = _possibleConstructorReturn(this, (RemoveProperty.__proto__ || Object.getPrototypeOf(RemoveProperty)).call(this)); _this.scope = "RemoveProperty"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_removeProperty"; _this.description = ""; _this.propertyName = ""; return _this; } _createClass(RemoveProperty, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("RemoveProperty" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "propertyName"] }; } }]); return RemoveProperty; }(_CamelElement3.default); exports.default = RemoveProperty; /***/ }), /***/ "./src/camel/element/transformation/SetBody.js": /*!*****************************************************!*\ !*** ./src/camel/element/transformation/SetBody.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SetBody = function (_CamelElement) { _inherits(SetBody, _CamelElement); function SetBody() { _classCallCheck(this, SetBody); var _this = _possibleConstructorReturn(this, (SetBody.__proto__ || Object.getPrototypeOf(SetBody)).call(this)); _this.scope = "SetBody"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_setBody"; _this.description = ""; _this.expression = ""; return _this; } _createClass(SetBody, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("SetBody", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression"] }; } }]); return SetBody; }(_CamelElement3.default); exports.default = SetBody; /***/ }), /***/ "./src/camel/element/transformation/SetExchangePattern.js": /*!****************************************************************!*\ !*** ./src/camel/element/transformation/SetExchangePattern.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SetExchangePattern = function (_CamelElement) { _inherits(SetExchangePattern, _CamelElement); function SetExchangePattern() { _classCallCheck(this, SetExchangePattern); var _this = _possibleConstructorReturn(this, (SetExchangePattern.__proto__ || Object.getPrototypeOf(SetExchangePattern)).call(this)); _this.scope = "SetExchangePattern"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_setExchangePattern"; _this.description = ""; _this.pattern = ""; return _this; } _createClass(SetExchangePattern, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("SetExchangePattern" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "pattern"] }; } }]); return SetExchangePattern; }(_CamelElement3.default); exports.default = SetExchangePattern; /***/ }), /***/ "./src/camel/element/transformation/SetFaultBody.js": /*!**********************************************************!*\ !*** ./src/camel/element/transformation/SetFaultBody.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SetFaultBody = function (_CamelElement) { _inherits(SetFaultBody, _CamelElement); function SetFaultBody() { _classCallCheck(this, SetFaultBody); var _this = _possibleConstructorReturn(this, (SetFaultBody.__proto__ || Object.getPrototypeOf(SetFaultBody)).call(this)); _this.scope = "SetFaultBody"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_setFaultBody"; _this.description = ""; _this.expression = ""; return _this; } _createClass(SetFaultBody, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("SetFaultBody" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression"] }; } }]); return SetFaultBody; }(_CamelElement3.default); exports.default = SetFaultBody; /***/ }), /***/ "./src/camel/element/transformation/SetHeader.js": /*!*******************************************************!*\ !*** ./src/camel/element/transformation/SetHeader.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SetHeader = function (_CamelElement) { _inherits(SetHeader, _CamelElement); function SetHeader() { _classCallCheck(this, SetHeader); var _this = _possibleConstructorReturn(this, (SetHeader.__proto__ || Object.getPrototypeOf(SetHeader)).call(this)); _this.scope = "SetHeader"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_setHeader"; _this.description = ""; _this.expression = ""; _this.headerName = ""; return _this; } _createClass(SetHeader, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("SetHeader", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression", "headerName"] }; } }]); return SetHeader; }(_CamelElement3.default); exports.default = SetHeader; /***/ }), /***/ "./src/camel/element/transformation/SetOutHeader.js": /*!**********************************************************!*\ !*** ./src/camel/element/transformation/SetOutHeader.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SetOutHeader = function (_CamelElement) { _inherits(SetOutHeader, _CamelElement); function SetOutHeader() { _classCallCheck(this, SetOutHeader); var _this = _possibleConstructorReturn(this, (SetOutHeader.__proto__ || Object.getPrototypeOf(SetOutHeader)).call(this)); _this.scope = "SetOutHeader"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_setOutHeader"; _this.description = ""; _this.expression = ""; _this.headerName = ""; return _this; } _createClass(SetOutHeader, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("SetOutHeader", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; if (this.expression) str += "\n <" + this.expression + ">\n " + this.description + "\n \n";else str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression", "headerName"] }; } }]); return SetOutHeader; }(_CamelElement3.default); exports.default = SetOutHeader; /***/ }), /***/ "./src/camel/element/transformation/SetProperty.js": /*!*********************************************************!*\ !*** ./src/camel/element/transformation/SetProperty.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SetProperty = function (_CamelElement) { _inherits(SetProperty, _CamelElement); function SetProperty() { _classCallCheck(this, SetProperty); var _this = _possibleConstructorReturn(this, (SetProperty.__proto__ || Object.getPrototypeOf(SetProperty)).call(this)); _this.scope = "SetProperty"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_setProperty"; _this.description = ""; _this.propertyName = ""; return _this; } _createClass(SetProperty, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("SetProperty" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "propertyName"] }; } }]); return SetProperty; }(_CamelElement3.default); exports.default = SetProperty; /***/ }), /***/ "./src/camel/element/transformation/Transform.js": /*!*******************************************************!*\ !*** ./src/camel/element/transformation/Transform.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Transform = function (_CamelElement) { _inherits(Transform, _CamelElement); function Transform() { _classCallCheck(this, Transform); var _this = _possibleConstructorReturn(this, (Transform.__proto__ || Object.getPrototypeOf(Transform)).call(this)); _this.scope = "Transform"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_transform"; _this.description = ""; _this.expression = ""; return _this; } _createClass(Transform, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Transform", this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.expression + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "expression"] }; } }]); return Transform; }(_CamelElement3.default); exports.default = Transform; /***/ }), /***/ "./src/camel/element/transformation/Unmarshal.js": /*!*******************************************************!*\ !*** ./src/camel/element/transformation/Unmarshal.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _CamelElement2 = __webpack_require__(/*! ../CamelElement */ "./src/camel/element/CamelElement.js"); var _CamelElement3 = _interopRequireDefault(_CamelElement2); var _utility = __webpack_require__(/*! ../../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Unmarshal = function (_CamelElement) { _inherits(Unmarshal, _CamelElement); function Unmarshal() { _classCallCheck(this, Unmarshal); var _this = _possibleConstructorReturn(this, (Unmarshal.__proto__ || Object.getPrototypeOf(Unmarshal)).call(this)); _this.scope = "Unmarshal"; _this.parent = ""; _this.inputid = ""; // 线的接入 _this.outputid = ""; // 线的出口 _this.id = "_unmarshal"; _this.description = ""; _this.dataFormatType = ""; _this.ref_deprecated = ""; // 已弃用(ref) return _this; } _createClass(Unmarshal, [{ key: "paint", value: function paint(g) { if (this._img == null) { this._img = _utility.Resources.IMG_START_NODE; } g.save(); this.color = "#cebee1"; g.drawOvalBorder(this.x, this.y, this.width, this.height, 10, this.color); g.drawImage(this._img, this.x + 10, this.y + 5, this.icon_width / 2, this.icon_height / 2); g.setColor(_utility.Resources.COLOR.black); g.drawText("Unmarshal" + this.id, this.x + this.width / 6, this.y + this.height / 1.5); g.restore(); } }, { key: "toXML", value: function toXML() { var str = ""; str += "\n <" + this.dataFormatType + ">\n " + this.description + "\n \n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode) {} }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "description", "dataFormatType", "ref_deprecated"] }; } }]); return Unmarshal; }(_CamelElement3.default); exports.default = Unmarshal; /***/ }), /***/ "./src/camel/element/transformation/index.js": /*!***************************************************!*\ !*** ./src/camel/element/transformation/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Unmarshal = exports.Transform = exports.SetProperty = exports.SetOutHeader = exports.SetHeader = exports.SetFaultBody = exports.SetExchangePattern = exports.SetBody = exports.RemoveProperty = exports.RemoveProperties = exports.RemoveHeaders = exports.RemoveHeader = exports.PollEnrich = exports.Marshal = exports.InOut = exports.InOnly = exports.Enrich = exports.ConvertBodyTo = undefined; var _ConvertBodyTo = __webpack_require__(/*! ./ConvertBodyTo */ "./src/camel/element/transformation/ConvertBodyTo.js"); var _ConvertBodyTo2 = _interopRequireDefault(_ConvertBodyTo); var _Enrich = __webpack_require__(/*! ./Enrich */ "./src/camel/element/transformation/Enrich.js"); var _Enrich2 = _interopRequireDefault(_Enrich); var _InOnly = __webpack_require__(/*! ./InOnly */ "./src/camel/element/transformation/InOnly.js"); var _InOnly2 = _interopRequireDefault(_InOnly); var _InOut = __webpack_require__(/*! ./InOut */ "./src/camel/element/transformation/InOut.js"); var _InOut2 = _interopRequireDefault(_InOut); var _Marshal = __webpack_require__(/*! ./Marshal */ "./src/camel/element/transformation/Marshal.js"); var _Marshal2 = _interopRequireDefault(_Marshal); var _PollEnrich = __webpack_require__(/*! ./PollEnrich */ "./src/camel/element/transformation/PollEnrich.js"); var _PollEnrich2 = _interopRequireDefault(_PollEnrich); var _RemoveHeader = __webpack_require__(/*! ./RemoveHeader */ "./src/camel/element/transformation/RemoveHeader.js"); var _RemoveHeader2 = _interopRequireDefault(_RemoveHeader); var _RemoveHeaders = __webpack_require__(/*! ./RemoveHeaders */ "./src/camel/element/transformation/RemoveHeaders.js"); var _RemoveHeaders2 = _interopRequireDefault(_RemoveHeaders); var _RemoveProperties = __webpack_require__(/*! ./RemoveProperties */ "./src/camel/element/transformation/RemoveProperties.js"); var _RemoveProperties2 = _interopRequireDefault(_RemoveProperties); var _RemoveProperty = __webpack_require__(/*! ./RemoveProperty */ "./src/camel/element/transformation/RemoveProperty.js"); var _RemoveProperty2 = _interopRequireDefault(_RemoveProperty); var _SetBody = __webpack_require__(/*! ./SetBody */ "./src/camel/element/transformation/SetBody.js"); var _SetBody2 = _interopRequireDefault(_SetBody); var _SetExchangePattern = __webpack_require__(/*! ./SetExchangePattern */ "./src/camel/element/transformation/SetExchangePattern.js"); var _SetExchangePattern2 = _interopRequireDefault(_SetExchangePattern); var _SetFaultBody = __webpack_require__(/*! ./SetFaultBody */ "./src/camel/element/transformation/SetFaultBody.js"); var _SetFaultBody2 = _interopRequireDefault(_SetFaultBody); var _SetHeader = __webpack_require__(/*! ./SetHeader */ "./src/camel/element/transformation/SetHeader.js"); var _SetHeader2 = _interopRequireDefault(_SetHeader); var _SetOutHeader = __webpack_require__(/*! ./SetOutHeader */ "./src/camel/element/transformation/SetOutHeader.js"); var _SetOutHeader2 = _interopRequireDefault(_SetOutHeader); var _SetProperty = __webpack_require__(/*! ./SetProperty */ "./src/camel/element/transformation/SetProperty.js"); var _SetProperty2 = _interopRequireDefault(_SetProperty); var _Transform = __webpack_require__(/*! ./Transform */ "./src/camel/element/transformation/Transform.js"); var _Transform2 = _interopRequireDefault(_Transform); var _Unmarshal = __webpack_require__(/*! ./Unmarshal */ "./src/camel/element/transformation/Unmarshal.js"); var _Unmarshal2 = _interopRequireDefault(_Unmarshal); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.ConvertBodyTo = _ConvertBodyTo2.default; exports.Enrich = _Enrich2.default; exports.InOnly = _InOnly2.default; exports.InOut = _InOut2.default; exports.Marshal = _Marshal2.default; exports.PollEnrich = _PollEnrich2.default; exports.RemoveHeader = _RemoveHeader2.default; exports.RemoveHeaders = _RemoveHeaders2.default; exports.RemoveProperties = _RemoveProperties2.default; exports.RemoveProperty = _RemoveProperty2.default; exports.SetBody = _SetBody2.default; exports.SetExchangePattern = _SetExchangePattern2.default; exports.SetFaultBody = _SetFaultBody2.default; exports.SetHeader = _SetHeader2.default; exports.SetOutHeader = _SetOutHeader2.default; exports.SetProperty = _SetProperty2.default; exports.Transform = _Transform2.default; exports.Unmarshal = _Unmarshal2.default; /***/ }), /***/ "./src/camel/utility/Api.js": /*!**********************************!*\ !*** ./src/camel/utility/Api.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Api = function () { function Api() { _classCallCheck(this, Api); } // this.contextPath = contextPath; /** * 获取模板 * @param tmlName 需要请求的模板名称 * @return 返回$.Deferred实例,用于后面调用done,fail方法 */ _createClass(Api, [{ key: "getTemplete", value: function getTemplete(tmlName) { if (typeof tmlName == "string" && tmlName.indexOf(".html") == -1) { tmlName += ".html"; } return $.ajax({ async: true, type: "GET", url: "tpl/" + tmlName }); } /** * 获取json配置文件,主要是获取下拉列表的各项选择值 * @return 返回ajax异步实例,用于后面调用done,fail方法 */ }, { key: "getJSON", value: function getJSON() { return $.ajax({ async: true, type: "GET", url: "json/config.json", dataType: "json", contentType: "application/json" }); } /** * 获取对应的xml配置文件,用以反解析生成报表元素 * @return 返回xml字符串 */ }, { key: "getXMLConf", value: function getXMLConf(contextPath, appId, eipId) { var xml = ''; $.ajax({ async: false, type: 'GET', url: "/" + contextPath + "/designtime/applications/" + appId + "/eips/" + eipId, dataType: 'json' }).done(function (data) { if (data.errcode == 0) { xml = data.data.xml; } }); //console.log(xml) return xml; } }]); return Api; }(); exports.default = Api; /***/ }), /***/ "./src/camel/utility/Archor.js": /*!*************************************!*\ !*** ./src/camel/utility/Archor.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Archor = function () { function Archor() { _classCallCheck(this, Archor); this.x = 0; this.y = 0; this.targetW = 0; this.targetH = 0; this.openArchorPos = [{ x: 0, y: 0 }, { x: 1, y: 0 }, { x: 1, y: 1 }, { x: 0, y: 1 }]; this.radius = Archor.DEF_RADIUS; this.color = Archor.DEF_COLOR; this.borderColor = Archor.DEF_BORDER_COLOR; } _createClass(Archor, [{ key: "getProp", value: function getProp(prop) { return this[prop]; } }, { key: "setProps", value: function setProps(newProps) { Object.assign(this, newProps); } //画四个角的小圆 }, { key: "paint", value: function paint(g) { for (var i = 0; i < this.openArchorPos.length; i++) { g.save(); g.drawArc(this.x + this.targetW * this.openArchorPos[i].x, this.y + this.targetH * this.openArchorPos[i].y, this.radius, this.color, this.borderColor); g.restore(); } } /** * 获取锚点的坐标 * @param {*} x * @param {*} y * @returns */ }, { key: "getArchorPosition", value: function getArchorPosition(x, y) { var r = this.radius; if (this.openArchorPos.length > 0) { for (var i = 0; i < this.openArchorPos.length; i++) { var dx = this.x + this.targetW * this.openArchorPos[i].x - x; var dy = this.y + this.targetH * this.openArchorPos[i].y - y; if (dx * dx + dy * dy <= r * r) { return this.openArchorPos[i]; } } return null; } else { return null; } } }]); return Archor; }(); Archor.DEF_RADIUS = 3; Archor.DEF_COLOR = "#F0F0F0"; Archor.DEF_BORDER_COLOR = "#000000"; exports.default = Archor; /***/ }), /***/ "./src/camel/utility/Graphics.js": /*!***************************************!*\ !*** ./src/camel/utility/Graphics.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Graphics = function () { function Graphics(ctx) { _classCallCheck(this, Graphics); this.ctx = ctx; this.ctx.translate(0.5, 0.5); } _createClass(Graphics, [{ key: "setColor", value: function setColor(color) { this.ctx.fillStyle = color; this.ctx.strokeStyle = color; } }, { key: "setFont", value: function setFont(font) { this.ctx.font = font; } }, { key: "setLineWidth", value: function setLineWidth(width) { this.ctx.lineWidth = width; } }, { key: "textAlign", value: function textAlign(align) { this.ctx.textAlign = align; } }, { key: "stringWidth", value: function stringWidth(txt) { return this.ctx.measureText(txt).width; } }, { key: "strokeRect", value: function strokeRect(x, y, width, height) { this.ctx.strokeRect(x, y, width, height); } }, { key: "translate", value: function translate(x, y) { this.ctx.translate(x, y); } }, { key: "fillText", value: function fillText(text, x, y) { //console.log(text,x,y); this.ctx.fillText(text, x, y); } }, { key: "fillRect", value: function fillRect(x, y, width, height) { this.ctx.fillRect(x, y, width, height); } }, { key: "fillPolygon", value: function fillPolygon(polygon) { this.ctx.beginPath(); for (var i = 0; i < polygon.points.length; i++) { if (i == 0) { this.ctx.moveTo(polygon.points[i].x, polygon.points[i].y); } else { this.ctx.lineTo(polygon.points[i].x, polygon.points[i].y); } } this.ctx.fill(); } }, { key: "drawLine", value: function drawLine(x1, y1, x2, y2) { this.ctx.beginPath(); this.ctx.moveTo(x1, y1); this.ctx.lineTo(x2, y2); this.ctx.closePath(); this.ctx.stroke(); } }, { key: "drawOvalBorder", value: function drawOvalBorder(x, y, width, height, p) { var color = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "#000"; var ctx = this.ctx; ctx.beginPath(); ctx.moveTo(x + p, y); ctx.lineTo(x + width - p, y); ctx.quadraticCurveTo(x + width, y, x + width, y + p); ctx.lineTo(x + width, y + height - p); ctx.quadraticCurveTo(x + width, y + height, x + width - p, y + height); ctx.lineTo(x + p, y + height); ctx.quadraticCurveTo(x, y + height, x, y + height - p); ctx.lineTo(x, y + p); ctx.quadraticCurveTo(x, y, x + p, y); this.setColor(color); ctx.stroke(); this.setColor(color); ctx.fill(); } }, { key: "drawImage", value: function drawImage(image, x, y, width, height) { this.ctx.drawImage(image, x, y, width, height); } }, { key: "drawRect", value: function drawRect(x, y, width, height) { this.ctx.strokeRect(x, y, width, height); } }, { key: "drawString", value: function drawString(text, x, y) { this.ctx.fillText(text, x, y); } // yx 计算长度再显示文字[超出第二行显示省略号] /** * * @param {文字} t * @param {横坐标} x * @param {文字高度} y * @param {显示的文字宽度} w */ }, { key: "drawText", value: function drawText(t, x, y) { var w = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 130; var chr = t.split(""); var temp = ""; var row = []; for (var a = 0; a < chr.length; a++) { if (this.ctx.measureText(temp).width < w) {} else { row.push(temp); temp = ""; } temp += chr[a]; } row.push(temp); // 判断小于2行全部画出来,大于两行显示省略号 if (row.length < 2) { for (var b = 0; b < row.length; b++) { this.ctx.fillText(row[b], x + 10, y + b * 16); // 16: 字体大小 } } else { row[0] = row[0] + "..."; this.ctx.fillText(row[0], x + 10, y); } } /** * 画圆 * @param {*} x * @param {*} y * @param {*} r * @param {*} color * @param {*} borderColor * @param {*} staAngle * @param {*} endAngle * @param {*} antiClockWise */ }, { key: "drawArc", value: function drawArc(x, y, r, color, borderColor) { var staAngle = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; var endAngle = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : Math.PI * 2; var antiClockWise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false; this.ctx.beginPath(); this.ctx.arc(x, y, r, staAngle, endAngle, antiClockWise); this.ctx.closePath(); this.setColor(borderColor); this.setLineWidth(1); this.ctx.stroke(); this.setColor(color); this.ctx.fill(); } }, { key: "setFont", value: function setFont(font) { this.ctx.font = font; } }, { key: "save", value: function save() { this.ctx.save(); } }, { key: "restore", value: function restore() { this.ctx.restore(); } }]); return Graphics; }(); exports.default = Graphics; /***/ }), /***/ "./src/camel/utility/Helper.js": /*!*************************************!*\ !*** ./src/camel/utility/Helper.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _compontent = __webpack_require__(/*! ../element/compontent */ "./src/camel/element/compontent/index.js"); var _routing = __webpack_require__(/*! ../element/routing */ "./src/camel/element/routing/index.js"); var _controlflow = __webpack_require__(/*! ../element/controlflow */ "./src/camel/element/controlflow/index.js"); var _transformation = __webpack_require__(/*! ../element/transformation */ "./src/camel/element/transformation/index.js"); var _miscellaneous = __webpack_require__(/*! ../element/miscellaneous */ "./src/camel/element/miscellaneous/index.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Helper = function () { function Helper() { _classCallCheck(this, Helper); this.templete = ""; } /** * 处理请求后获取的模板 * @param tml 需要处理的模板 * @param data 需要填充进模板里的数据 * @param tmlId 需要过滤掉的模板id,用于删除模板里不需要的标签 * @return 返回处理完的模板html字符串 */ _createClass(Helper, [{ key: "handleTemplete", value: function handleTemplete(tml, data, tmlId) { var $tml = $(tml).filter("#" + tmlId).html(); var render = template.compile($tml); return render(data); } /** * 获取相同组件的原始数据(用于uri的比较) * @param {组件名称} name * @returns */ }, { key: "handleInitData", value: function handleInitData(name) { var initComponent = null; switch (name) { // component case "ActiveMQ": initComponent = new _compontent.ActiveMQ(); break; case "Atom": initComponent = new _compontent.Atom(); break; case "CXF": initComponent = new _compontent.CXF(); break; case "CXFRS": initComponent = new _compontent.CXFRS(); break; case "ControlBus": initComponent = new _compontent.ControlBus(); break; case "Direct": initComponent = new _compontent.Direct(); break; case "DirectVM": initComponent = new _compontent.DirectVM(); break; case "FTP": initComponent = new _compontent.FTP(); break; case "FTPS": initComponent = new _compontent.FTPS(); break; case "File": initComponent = new _compontent.File(); break; case "Generic": initComponent = new _compontent.Generic(); break; case "IMAP": initComponent = new _compontent.IMAP(); break; case "IMAPSecure": initComponent = new _compontent.IMAPSecure(); break; case "JDBC": initComponent = new _compontent.JDBC(); break; case "JGroups": initComponent = new _compontent.JGroups(); break; case "JMS": initComponent = new _compontent.JMS(); break; case "Language": initComponent = new _compontent.Language(); break; case "Log": initComponent = new _compontent.Log(); break; case "MQTT": initComponent = new _compontent.MQTT(); break; case "MVEL": initComponent = new _compontent.MVEL(); break; case "Mina2": initComponent = new _compontent.Mina2(); break; case "Netty": initComponent = new _compontent.Netty(); break; case "NettyHTTP": initComponent = new _compontent.NettyHTTP(); break; case "Netty4": initComponent = new _compontent.Netty4(); break; case "Netty4HTTP": initComponent = new _compontent.Netty4HTTP(); break; case "POP3": initComponent = new _compontent.POP3(); break; case "POP3S": initComponent = new _compontent.POP3S(); break; case "Process": initComponent = new _compontent.Process(); break; case "Quartz": initComponent = new _compontent.Quartz(); break; case "Quartz2": initComponent = new _compontent.Quartz2(); break; case "Restlet": initComponent = new _compontent.Restlet(); break; case "RSS": initComponent = new _compontent.RSS(); break; case "SAPNetWeaver": initComponent = new _compontent.SAPNetWeaver(); break; case "Scheduler": initComponent = new _compontent.Scheduler(); break; case "SEDA": initComponent = new _compontent.SEDA(); break; case "Servlet": initComponent = new _compontent.Servlet(); break; case "SFTP": initComponent = new _compontent.SFTP(); break; case "SMTP": initComponent = new _compontent.SMTP(); break; case "SMTPS": initComponent = new _compontent.SMTPS(); break; case "SNMP": initComponent = new _compontent.SNMP(); break; case "SQL": initComponent = new _compontent.SQL(); break; case "Timer": initComponent = new _compontent.Timer(); break; case "VM": initComponent = new _compontent.VM(); break; case "XQuery": initComponent = new _compontent.XQuery(); break; case "XSLT": initComponent = new _compontent.XSLT(); break; default: break; } return initComponent; } /** * 解析xml */ }, { key: "parseNode", value: function parseNode(xmlNode, tagName, that) { var element = null, camelElement = {}; switch (tagName) { // component case "ActiveMQ": element = new _compontent.ActiveMQ(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Atom": element = new _compontent.Atom(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Bean": element = new _compontent.Bean(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "CXF": element = new _compontent.CXF(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "CXFRS": element = new _compontent.CXFRS(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "ControlBus": element = new _compontent.ControlBus(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Direct": element = new _compontent.Direct(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "DirectVM": element = new _compontent.DirectVM(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "FTP": element = new _compontent.FTP(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "FTPS": element = new _compontent.FTPS(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "File": element = new _compontent.File(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Generic": element = new _compontent.Generic(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "IMAP": element = new _compontent.IMAP(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "IMAPSecure": element = new _compontent.IMAPSecure(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "JDBC": element = new _compontent.JDBC(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "JGroups": element = new _compontent.JGroups(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "JMS": element = new _compontent.JMS(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Language": element = new _compontent.Language(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Log": element = new _compontent.Log(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "MQTT": element = new _compontent.MQTT(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "MVEL": element = new _compontent.MVEL(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Mina2": element = new _compontent.Mina2(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Netty": element = new _compontent.Netty(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "NettyHTTP": element = new _compontent.NettyHTTP(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Netty4": element = new _compontent.Netty4(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Netty4HTTP": element = new _compontent.Netty4HTTP(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "POP3": element = new _compontent.POP3(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "POP3S": element = new _compontent.POP3S(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Process": element = new _compontent.Process(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Quartz": element = new _compontent.Quartz(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Quartz2": element = new _compontent.Quartz2(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Restlet": element = new _compontent.Restlet(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "RSS": element = new _compontent.RSS(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SAPNetWeaver": element = new _compontent.SAPNetWeaver(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Scheduler": element = new _compontent.Scheduler(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SEDA": element = new _compontent.SEDA(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Servlet": element = new _compontent.Servlet(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SFTP": element = new _compontent.SFTP(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SMTP": element = new _compontent.SMTP(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SMTPS": element = new _compontent.SMTPS(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SNMP": element = new _compontent.SNMP(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SQL": element = new _compontent.SQL(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Timer": element = new _compontent.Timer(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "VM": element = new _compontent.VM(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "XQuery": element = new _compontent.XQuery(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "XSLT": element = new _compontent.XSLT(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; // routing case "Aggregate": element = new _routing.Aggregate(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Choice": element = new _routing.Choice(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "ClaimCheck": element = new _routing.ClaimCheck(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Filter": element = new _routing.Filter(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Hystrix": element = new _routing.Hystrix(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "IdempotentConsumer": element = new _routing.IdempotentConsumer(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "LoadBalance": element = new _routing.LoadBalance(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Multicast": element = new _routing.Multicast(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Pipeline": element = new _routing.Pipeline(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "RecipientList": element = new _routing.RecipientList(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Resequence": element = new _routing.Resequence(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "RoutingSlip": element = new _routing.RoutingSlip(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Saga": element = new _routing.Saga(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Sort": element = new _routing.Sort(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Split": element = new _routing.Split(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "When": element = new _routing.When(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "WireTap": element = new _routing.WireTap(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; // transformation case "Delay": element = new _controlflow.Delay(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "DoCatch": element = new _controlflow.DoCatch(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "DoFinally": element = new _controlflow.DoFinally(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "DoTry": element = new _controlflow.DoTry(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Intercept": element = new _controlflow.Intercept(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "InterceptFrom": element = new _controlflow.InterceptFrom(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "InterceptSendToEndpoint": element = new _controlflow.InterceptSendToEndpoint(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Loop": element = new _controlflow.Loop(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "OnCompletion": element = new _controlflow.OnCompletion(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "OnException": element = new _controlflow.OnException(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "OnFallback": element = new _controlflow.OnFallback(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Rollback": element = new _controlflow.Rollback(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Throttle": element = new _controlflow.Throttle(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "ThrowException": element = new _controlflow.ThrowException(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Transacted": element = new _controlflow.Transacted(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; // transformation case "ConvertBodyTo": element = new _transformation.ConvertBodyTo(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Enrich": element = new _transformation.Enrich(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "InOnly": element = new _transformation.InOnly(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "InOut": element = new _transformation.InOut(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Marshal": element = new _transformation.Marshal(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "PollEnrich": element = new _transformation.PollEnrich(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "RemoveHeader": element = new _transformation.RemoveHeader(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "RemoveHeaders": element = new _transformation.RemoveHeaders(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "RemoveProperties": element = new _transformation.RemoveProperties(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "RemoveProperty": element = new _transformation.RemoveProperty(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SetBody": element = new _transformation.SetBody(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SetExchangePattern": element = new _transformation.SetExchangePattern(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SetFaultBody": element = new _transformation.SetFaultBody(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SetHeader": element = new _transformation.SetHeader(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SetOutHeader": element = new _transformation.SetOutHeader(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "SetProperty": element = new _transformation.SetProperty(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Transform": element = new _transformation.Transform(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Unmarshal": element = new _transformation.Unmarshal(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; // miscellaneous case "Aop": element = new _miscellaneous.Aop(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Policy": element = new _miscellaneous.Policy(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Sample": element = new _miscellaneous.Sample(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Stop": element = new _miscellaneous.Stop(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Threads": element = new _miscellaneous.Threads(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; case "Validate": element = new _miscellaneous.Validate(); element.parseXML(xmlNode); camelElement = that.handleCamelElement(xmlNode, element.getPropsDesc()); element.setProps(camelElement); break; default: break; } return element; } }]); return Helper; }(); exports.default = Helper; /***/ }), /***/ "./src/camel/utility/Point.js": /*!************************************!*\ !*** ./src/camel/utility/Point.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Point = function () { function Point() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; _classCallCheck(this, Point); this.x = x; this.y = y; } _createClass(Point, [{ key: "move", value: function move(x, y) { this.x = x; this.y = y; } }]); return Point; }(); exports.default = Point; /***/ }), /***/ "./src/camel/utility/Polygon.js": /*!**************************************!*\ !*** ./src/camel/utility/Polygon.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _Point = __webpack_require__(/*! ./Point */ "./src/camel/utility/Point.js"); var _Point2 = _interopRequireDefault(_Point); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Polygon = function () { function Polygon() { _classCallCheck(this, Polygon); this.points = []; } _createClass(Polygon, [{ key: 'addPoint', value: function addPoint(x, y) { this.points.push(new _Point2.default(x, y)); } }]); return Polygon; }(); exports.default = Polygon; /***/ }), /***/ "./src/camel/utility/Resources.js": /*!****************************************!*\ !*** ./src/camel/utility/Resources.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Resources = function () { function Resources() { _classCallCheck(this, Resources); } _createClass(Resources, [{ key: "loadImage", value: function loadImage(url) { return new Promise(function (resolve, reject) { var img = new Image(); img.onload = function () { return resolve(img); }; img.onerror = reject; img.src = url; }); } }, { key: "onload", value: function onload(callback) { var _this = this; var pr = []; var source = { start: "./images/loop.png" }; var _loop = function _loop(key) { if (Object.prototype.hasOwnProperty.call(source, key)) { var url = source[key]; var p = _this.loadImage(url).then(function (img) { switch (key) { case "start": Resources.IMG_START_NODE = img; break; default: break; } return img; }).catch(function (err) { return console.log(err); }); pr.push(p); } }; for (var key in source) { _loop(key); } Promise.all(pr).then(function () { callback(); }); } }]); return Resources; }(); Resources.IMG_START_NODE = null; Resources.FONT_METRICS = { width: 12, height: 12, ascent: 1 }; Resources.COLOR = { white: "rgb(255, 255, 255)", lightGray: "rgb(229, 229, 229)", grey: "#ccc", black: "rgb(0, 0, 0)", lightYellow: "#FFFFE1", blue: "blue" }; exports.default = Resources; /***/ }), /***/ "./src/camel/utility/Sequence.js": /*!***************************************!*\ !*** ./src/camel/utility/Sequence.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Sequence = function Sequence() { _classCallCheck(this, Sequence); }; Sequence.createId = function () { var date = new Date(); var s = "" + date.getTime(); return s; }; Sequence.S4 = function () { return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1); }; Sequence.createUuid = function () { return Sequence.S4() + Sequence.S4() + "-" + Sequence.S4() + "-" + Sequence.S4() + "-" + Sequence.S4() + "-" + Sequence.S4() + Sequence.S4() + Sequence.S4(); }; exports.default = Sequence; /***/ }), /***/ "./src/camel/utility/StringUtil.js": /*!*****************************************!*\ !*** ./src/camel/utility/StringUtil.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var StringUtil = function () { function StringUtil() { _classCallCheck(this, StringUtil); } _createClass(StringUtil, [{ key: 'replaceXML', value: function replaceXML(str) { if (str != null) { while (str.indexOf('"') != -1) { str = str.replace(/\"/g, '@quot;'); } return str; } return ''; } }]); return StringUtil; }(); StringUtil.replaceText = function (text) { if (text != null) { text += ''; text = text.replace(/\!/, ''); text = text.replace(/\[/, ''); text = text.replace(/\]/, ''); text = text.replace(/\/, ''); text = text.replace(/(CDATA)/, ''); return text; } else { return ''; } }; StringUtil.encodeHTMLno = function (t) { var text = t; if (text != null) { text = text.replace(/#/g, '%23'); text = text.replace(/&/g, '&'); text = text.replace(//g, '@gt;'); text = text.replace(/ /g, '@nbsp;'); text = text.replace(/\r/g, ' '); text = text.replace(/\n/g, ' '); } return text; }; StringUtil.encodeHTML = function (t) { var text = t; if (text != null) { text = text.replace(/#/g, '%23'); text = text.replace(/&/g, '&'); text = text.replace(/"/g, '@quot;'); text = text.replace(//g, '@gt;'); text = text.replace(/'/g, '@#146;'); text = text.replace(/ /g, '@nbsp;'); text = text.replace(/\r/g, ' '); text = text.replace(/\n/g, ' '); } return text; }; StringUtil.encodeHTML_Discript = function (t) { var text = t; if (text != null) { text = text.replace(/#/g, '%23'); text = text.replace(/"/g, '@quot;'); text = text.replace(//g, '@gt;'); text = text.replace(/'/g, '@#146;'); text = text.replace(/\r/g, ' '); text = text.replace(/\n/g, ' '); } return text; }; StringUtil.dencodeHTML = function (t) { var text = t; if (text != null) { text = text.replace(/&/g, '&'); text = text.replace(/@amp;/g, '&'); text = text.replace(/"/g, '"'); text = text.replace(/@quot;/g, '"'); text = text.replace(/</g, '<'); text = text.replace(/@lt;/g, '<'); text = text.replace(/>/g, '>'); text = text.replace(/@gt;/g, '>'); text = text.replace(/’/g, "'"); text = text.replace(/@#146;/g, "'"); text = text.replace(/ /g, ' '); text = text.replace(/@nbsp;/g, ' '); text = text.replace(/ /g, '\r'); text = text.replace(/ /g, '\n'); text = text.replace(/ /g, ' '); text = text.replace(/%23/g, '#'); text = text.replace('\n\r', '\n'); text = text.replace('\r\n', '\n'); } return text; }; exports.default = StringUtil; /***/ }), /***/ "./src/camel/utility/XMLOperate.js": /*!*****************************************!*\ !*** ./src/camel/utility/XMLOperate.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _view = __webpack_require__(/*! ../view */ "./src/camel/view/index.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var XMLOperate = function () { function XMLOperate(xml, camel) { _classCallCheck(this, XMLOperate); this.xml = xml; this.camel = camel; } _createClass(XMLOperate, [{ key: "parseXML", value: function parseXML() { var camel = this.camel; var allEle = []; var root = this.xml.children[0]; // 寻找camelcontext而不是最外层的beans var traversalNode = function traversalNode(xmlNode) { var tagName = xmlNode.tagName; switch (tagName) { case "camelContext": var camelcontext = new _view.CamelContext(); allEle = camelcontext.parseXML(xmlNode, camel); var obj = { id: xmlNode.getAttribute("id"), name: xmlNode.getAttribute("name"), autoStartup: xmlNode.getAttribute("autoStartup"), allowUseOriginalMessage: xmlNode.getAttribute("allowUseOriginalMessage"), beans: xmlNode.getAttribute("beans"), beansfactory: xmlNode.getAttribute("beansfactory"), delayer: xmlNode.getAttribute("delayer"), description: xmlNode.getAttribute("description"), errorHandlerRef: xmlNode.getAttribute("errorHandlerRef"), group: xmlNode.getAttribute("group"), handleFault: xmlNode.getAttribute("handleFault"), lazyLoadTypeConverters: xmlNode.getAttribute("lazyLoadTypeConverters"), loadTypeConverters: xmlNode.getAttribute("loadTypeConverters"), logExhaustedMessageBody: xmlNode.getAttribute("logExhaustedMessageBody"), managementNamePattern: xmlNode.getAttribute("managementNamePattern"), registerEndpointIdsFromRoute: xmlNode.getAttribute("registerEndpointIdsFromRoute"), runtimeEndpointRegistryEnabled: xmlNode.getAttribute("runtimeEndpointRegistryEnabled"), shutdownEager: xmlNode.getAttribute("shutdownEager"), shutdownRoute: xmlNode.getAttribute("shutdownRoute"), logMask: xmlNode.getAttribute("logMask"), shutdownRunningTask: xmlNode.getAttribute("shutdownRunningTask"), streamCache: xmlNode.getAttribute("streamCache"), threadNamePattern: xmlNode.getAttribute("threadNamePattern"), trace: xmlNode.getAttribute("trace"), typeConverterExists: xmlNode.getAttribute("typeConverterExists"), typeConverterExistsLoggingLevel: xmlNode.getAttribute("typeConverterExistsLoggingLevel"), typeConverterStatisticsEnabled: xmlNode.getAttribute("typeConverterStatisticsEnabled"), useBreadcrumb: xmlNode.getAttribute("useBreadcrumb"), useDataType: xmlNode.getAttribute("useDataType"), useMDCLogging: xmlNode.getAttribute("useMDCLogging") }; camel.camelcontext.setProps(obj); break; default: break; } }; if (root.hasChildNodes()) { for (var i = 0; i < root.children.length; i++) { traversalNode(root.children[i]); } } camel._elems = allEle; return allEle; } }]); return XMLOperate; }(); exports.default = XMLOperate; /***/ }), /***/ "./src/camel/utility/index.js": /*!************************************!*\ !*** ./src/camel/utility/index.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.XMLOperate = exports.Helper = exports.Polygon = exports.Point = exports.Graphics = exports.Resources = exports.StringUtil = exports.Sequence = exports.Archor = exports.Api = undefined; var _Api = __webpack_require__(/*! ./Api */ "./src/camel/utility/Api.js"); var _Api2 = _interopRequireDefault(_Api); var _Archor = __webpack_require__(/*! ./Archor */ "./src/camel/utility/Archor.js"); var _Archor2 = _interopRequireDefault(_Archor); var _Sequence = __webpack_require__(/*! ./Sequence */ "./src/camel/utility/Sequence.js"); var _Sequence2 = _interopRequireDefault(_Sequence); var _StringUtil = __webpack_require__(/*! ./StringUtil */ "./src/camel/utility/StringUtil.js"); var _StringUtil2 = _interopRequireDefault(_StringUtil); var _Resources = __webpack_require__(/*! ./Resources */ "./src/camel/utility/Resources.js"); var _Resources2 = _interopRequireDefault(_Resources); var _Graphics = __webpack_require__(/*! ./Graphics */ "./src/camel/utility/Graphics.js"); var _Graphics2 = _interopRequireDefault(_Graphics); var _Point = __webpack_require__(/*! ./Point */ "./src/camel/utility/Point.js"); var _Point2 = _interopRequireDefault(_Point); var _Polygon = __webpack_require__(/*! ./Polygon */ "./src/camel/utility/Polygon.js"); var _Polygon2 = _interopRequireDefault(_Polygon); var _Helper = __webpack_require__(/*! ./Helper */ "./src/camel/utility/Helper.js"); var _Helper2 = _interopRequireDefault(_Helper); var _XMLOperate = __webpack_require__(/*! ./XMLOperate */ "./src/camel/utility/XMLOperate.js"); var _XMLOperate2 = _interopRequireDefault(_XMLOperate); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.Api = _Api2.default; exports.Archor = _Archor2.default; exports.Sequence = _Sequence2.default; exports.StringUtil = _StringUtil2.default; exports.Resources = _Resources2.default; exports.Graphics = _Graphics2.default; exports.Point = _Point2.default; exports.Polygon = _Polygon2.default; exports.Helper = _Helper2.default; exports.XMLOperate = _XMLOperate2.default; /***/ }), /***/ "./src/camel/view/CamelContext.js": /*!****************************************!*\ !*** ./src/camel/view/CamelContext.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _element = __webpack_require__(/*! ../element */ "./src/camel/element/index.js"); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var CamelContext = function () { function CamelContext() { _classCallCheck(this, CamelContext); this.id = ""; this.name = "camel"; this.autoStartup = "yes"; this.allowUseOriginalMessage = ""; this.beans = ""; this.beansfactory = ""; this.delayer = ""; this.description = ""; this.errorHandlerRef = ""; this.group = ""; this.handleFault = ""; this.lazyLoadTypeConverters = "true"; this.loadTypeConverters = "true"; this.logExhaustedMessageBody = ""; this.managementNamePattern = ""; this.registerEndpointIdsFromRoute = ""; this.runtimeEndpointRegistryEnabled = ""; this.shutdownEager = ""; this.shutdownRoute = ""; this.logMask = "yes"; this.shutdownRunningTask = ""; this.streamCache = ""; this.threadNamePattern = ""; this.trace = ""; this.typeConverterExists = ""; this.typeConverterExistsLoggingLevel = ""; this.typeConverterStatisticsEnabled = ""; this.useBreadcrumb = ""; this.useDataType = ""; this.useMDCLogging = ""; this._childNode = []; this.autoStartupOption = { true: true, false: false }; } _createClass(CamelContext, [{ key: "toXML", value: function toXML() { var str = "\n "; this._childNode.map(function (item) { if (item instanceof _element.Route) str += item.toXML(); }); str += "\n"; return str; } }, { key: "parseXML", value: function parseXML(xmlNode, camel) { var props = {}, _elems = [], _camelcontext = {}; var traversalNode = function traversalNode(xmlNode) { var _t$childNode; var tagName = xmlNode.tagName; switch (tagName) { case "camelContext": // 重置路由属性的值 var cam = { id: xmlNode.getAttribute("id"), name: xmlNode.getAttribute("name"), autoStartup: xmlNode.getAttribute("autoStartup"), allowUseOriginalMessage: xmlNode.getAttribute("allowUseOriginalMessage"), beans: xmlNode.getAttribute("beans"), beansfactory: xmlNode.getAttribute("beansfactory"), delayer: xmlNode.getAttribute("delayer"), description: xmlNode.getAttribute("description"), errorHandlerRef: xmlNode.getAttribute("errorHandlerRef"), group: xmlNode.getAttribute("group"), handleFault: xmlNode.getAttribute("handleFault"), lazyLoadTypeConverters: xmlNode.getAttribute("lazyLoadTypeConverters"), loadTypeConverters: xmlNode.getAttribute("loadTypeConverters"), logExhaustedMessageBody: xmlNode.getAttribute("logExhaustedMessageBody"), managementNamePattern: xmlNode.getAttribute("managementNamePattern"), registerEndpointIdsFromRoute: xmlNode.getAttribute("registerEndpointIdsFromRoute"), runtimeEndpointRegistryEnabled: xmlNode.getAttribute("runtimeEndpointRegistryEnabled"), shutdownEager: xmlNode.getAttribute("shutdownEager"), shutdownRoute: xmlNode.getAttribute("shutdownRoute"), logMask: xmlNode.getAttribute("logMask"), shutdownRunningTask: xmlNode.getAttribute("shutdownRunningTask"), streamCache: xmlNode.getAttribute("streamCache"), threadNamePattern: xmlNode.getAttribute("threadNamePattern"), trace: xmlNode.getAttribute("trace"), typeConverterExists: xmlNode.getAttribute("typeConverterExists"), typeConverterExistsLoggingLevel: xmlNode.getAttribute("typeConverterExistsLoggingLevel"), typeConverterStatisticsEnabled: xmlNode.getAttribute("typeConverterStatisticsEnabled"), useBreadcrumb: xmlNode.getAttribute("useBreadcrumb"), useDataType: xmlNode.getAttribute("useDataType"), useMDCLogging: xmlNode.getAttribute("useMDCLogging") }; break; case "route": var t = new _element.Route(); var children = t.parseXML(xmlNode); // 将子孩子存放到自己的数组中 if (children.length !== 0) (_t$childNode = t.childNode).push.apply(_t$childNode, _toConsumableArray(children)); // 重置路由属性的值 var obj = { x: parseInt(xmlNode.getAttribute("x")), y: parseInt(xmlNode.getAttribute("y")), id: xmlNode.getAttribute("id"), autoStartup: xmlNode.getAttribute("autoStartup"), delayer: xmlNode.getAttribute("delayer"), description: xmlNode.getAttribute("description"), errorHandlerRef: xmlNode.getAttribute("errorHandlerRef"), group: xmlNode.getAttribute("group"), name: xmlNode.getAttribute("name"), logMask: xmlNode.getAttribute("logMask"), messageHistory: xmlNode.getAttribute("messageHistory"), routePolicyRef: xmlNode.getAttribute("routePolicyRef"), shutdownRoute: xmlNode.getAttribute("shutdownRoute"), shutdownRunningTask: xmlNode.getAttribute("shutdownRunningTask"), startupOrder: xmlNode.getAttribute("startupOrder"), streamCache: xmlNode.getAttribute("streamCache"), trace: xmlNode.getAttribute("trace") }; t.setProps(obj); if (children.length == 0) _elems.push(t);else { // 这里需要children间接入连线 _elems.push.apply(_elems, [t].concat(_toConsumableArray(children))); if (children.length >= 2) { _elems.push.apply(_elems, _toConsumableArray(camel.addAutoLine(children))); } } default: break; } }; if (xmlNode.hasChildNodes()) { for (var i = 0; i < xmlNode.children.length; i++) { traversalNode(xmlNode.children[i]); } // 自身的数值 traversalNode(xmlNode); } this.setProps(props); return _elems; } // 获取属性面板的元素 }, { key: "setPanelEle", value: function setPanelEle(elems) { this._childNode = elems; } // 通过拷贝重新赋值 遍历当前对象的所有属性值重新赋值 }, { key: "setProps", value: function setProps(prop) { Object.assign(this, prop); } }, { key: "getPropsDesc", value: function getPropsDesc() { return { details: ["id", "name", "autoStartup", "allowUseOriginalMessage", "beans", "beansfactory", "delayer", "description", "errorHandlerRef", "group", "handleFault", "lazyLoadTypeConverters", "loadTypeConverters", "logExhaustedMessageBody", "managementNamePattern", "registerEndpointIdsFromRoute", "runtimeEndpointRegistryEnabled", "shutdownEager", "shutdownRoute", "logMask", "shutdownRunningTask", "streamCache", "threadNamePattern", "trace", "typeConverterExists", "typeConverterExistsLoggingLevel", "typeConverterStatisticsEnabled", "useBreadcrumb", "useDataType", "useMDCLogging"] }; } }]); return CamelContext; }(); exports.default = CamelContext; /***/ }), /***/ "./src/camel/view/CamelPanel.js": /*!**************************************!*\ !*** ./src/camel/view/CamelPanel.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _utility = __webpack_require__(/*! ../utility */ "./src/camel/utility/index.js"); var _element = __webpack_require__(/*! ../element */ "./src/camel/element/index.js"); var _compontent = __webpack_require__(/*! ../element/compontent */ "./src/camel/element/compontent/index.js"); var _routing = __webpack_require__(/*! ../element/routing */ "./src/camel/element/routing/index.js"); var _controlflow = __webpack_require__(/*! ../element/controlflow */ "./src/camel/element/controlflow/index.js"); var _transformation = __webpack_require__(/*! ../element/transformation */ "./src/camel/element/transformation/index.js"); var _miscellaneous = __webpack_require__(/*! ../element/miscellaneous */ "./src/camel/element/miscellaneous/index.js"); var _less = __webpack_require__(/*! less */ "./node_modules/less/dist/less.js"); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var CamelPanel = function () { function CamelPanel(canvas) { _classCallCheck(this, CamelPanel); this.canvas = canvas; this.g = new _utility.Graphics(canvas.getContext("2d")); this.width = 1500; // canvas的宽度 this.height = 1536; this._currToElem = null; // 当前选中的组件 this.elem = null; //元素在未添加进区域的临时存放地 this._elems = []; // 存在画布上的所有数组 this._routeEle = null; // 其他元素将要存放在哪一个route中 this._status = CamelPanel.ACTION_NORMAL; // 经过画布的状态【默认是鼠标方式】 this.selectedArchor = null; //是否有被选中的锚点,用于移动时拖拽元素 this.archor = new _utility.Archor(); // 锚点实例 this.isAllowDraw = false; //画布绘图开关 } _createClass(CamelPanel, [{ key: "paint", value: function paint() { var _this = this; var g = this.g; //清空画布 g.save(); g.setColor("#fff"); g.fillRect(0, 0, this.width, this.height); // 画背景网格 g.setColor(_utility.Resources.COLOR.lightGray); // 画纵向线 for (var i = 0; i < this.width / 10; i++) { g.drawLine(i * 10, 0, i * 10, this.height); } // 画横向线 for (var _i = 0; _i < this.width / 10; _i++) { g.drawLine(0, _i * 10, this.width, _i * 10); } g.setColor(_utility.Resources.COLOR.grey); for (var _i2 = 0; _i2 < this.width / 50; _i2++) { g.drawLine(_i2 * 50, 0, _i2 * 50, this.height); } for (var _i3 = 0; _i3 < this.width / 50; _i3++) { g.drawLine(0, _i3 * 50, this.width, _i3 * 50); } g.restore(); // todo 画元素【需要先画route,再画子元素才能使得子元素覆盖在上面】 if (this._elems.length > 0) { // 先画route this._elems.filter(function (ele) { if (ele instanceof _routing.Route) ele.paint(_this.g); }); // 再画其他元素(保持route在最下方) this._elems.filter(function (ele) { if (!(ele instanceof _routing.Route)) ele.paint(_this.g); }); // 再画其他子元素 } //绘制尚未放入区域的移动中的元素 if (this.elem != null) { this.elem.paint(g); } } }, { key: "repaint", value: function repaint() { this.paint(); } }, { key: "init", value: function init(params) { var _this2 = this; this.canvas.onmousemove = function (e) { _this2.handleMouseMove(e); }; this.canvas.onmousedown = function (e) { _this2.handleMouseDown(e); }; this.canvas.onmouseup = function (e) { _this2.handleMouseUp(e); }; this.setProps(params); this.repaint(); } }, { key: "setProps", value: function setProps(newProps) { Object.assign(this, newProps); } }, { key: "handleMouseDown", value: function handleMouseDown(e) { var _this3 = this; // 鼠标在画布的位置 var x = e.offsetX, y = e.offsetY; // 开启绘画画布开关 this.isAllowDraw = true; // 清空上一次选中的元素 this.resetCurrToEdit(); var em = this.chkSelectedElement(x, y); if (em != null) { // 设置抓取点 if (em instanceof _element.CamelElement) { em._handlePointX = x - em.x; em._handlePointY = y - em.y; } // 重新赋值给当前的锚点实例 var params = { x: em.x, y: em.y, targetW: em.width, targetH: em.height }; this.archor.setProps(params); // 锚点的坐标位置 var archorPos = this.archor.getArchorPosition(x, y); if (em && archorPos) { this.selectedArchor = archorPos; em.setProps({ _handlePointX: x, _handlePointY: y }); return false; } if (this._status == CamelPanel.ACTION_BREAK_LINE) { if (em instanceof _element.Relation) { var relation = em; relation.setStartpoint(x, y); } } else if (this._status == CamelPanel.ACTION_REMOVE) { if (em instanceof _element.Relation) { var r = em; this.deleteMSG = "相关流程已处理,不能删除!"; } if (em instanceof _element.CamelElement) { var nd = em; if (em.rid != null && nd._iscurrent) { this.deleteMSG = "当前节点在处理中,不能删除!"; } else { var ems = this._elems; for (var i = 0; i < ems.length && this.deleteMSG == "null"; i++) { var elem = ems[i]; if (elem instanceof _element.Relation) { var rl = elem; if ((rl.startnodeid != null && rl.startnodeid == em.rid || rl.endnodeid != null && rl.endnodeid == em.rid) && rl.ispassed) { this.deleteMSG = "相关流程已处理,不能删除!"; } } } } } if (this.deleteMSG == "null" || this.deleteMSG == null || this.deleteMSG == "") { this.removeElement(em); } else { alert(this.deleteMSG); } } else { if (this.elem instanceof _element.Relation && em instanceof _element.CamelElement) { var _r = this.elem; if (_r.getStartEle() == null && em != null) { _r.setStartId(em); var node = em; var point = { x: node.x, y: node.y }; _r.addVector(point); } } else if (em instanceof _element.Relation) { this.changestatus(CamelPanel.ACTION_BREAK_LINE); console.log("待处理"); } else { // 用于元素拖拽 console.log("暂未发现用处"); // this._currToElem = em; // this._currToElem.moveTo(x, y); } } } else { // 关连线位置没有开始元素和结束元素链接【暂不处理,图标会显示禁止符号】 console.log(e); } // 判断是否选中元素 this._currToElem = this.chkSelectedElement(x, y) || this.elem; // 放下时又重新选中了这个元素 // 如果抓住的是路由元素,需要给每一个路由子元素记录相对于路由元素的值 if (this._currToElem && this._currToElem.scope == "route") { // 给当前路由添加四角锚点 this._currToElem.setProps({ isOpenArchor: true }); this._currToElem.childNode.map(function (item) { item.setProps({ _offsetRoute: { x: item.x - _this3._currToElem.x, y: item.y - _this3._currToElem.y } }); }); } console.log("选中元素", this._currToElem); } }, { key: "handleMouseMove", value: function handleMouseMove(e) { console.log(this._status); var x = e.offsetX, y = e.offsetY; // 如果状态不是删除就修改手势(不加判断删除不了元素) if (this._status != CamelPanel.ACTION_REMOVE) { var em = this.chkSelectedElement(x, y); if (em != null && this._status != CamelPanel.ACTION_REMOVE) { // 在元素范围内改变鼠标的状态 this.changestatus(CamelPanel.ACTION_IN_ELEMENT); } else { this.changestatus(CamelPanel.ACTION_NORMAL); } // 获取当前鼠标相对于画布的位置 if (!this.isAllowDraw) { // console.log(8888); } else { //允许绘画 // console.log(666); // 拖拽未进入画布的元素 if (this.elem != null) { this.elem.setProps({ x: x, y: y }); } else { this.handleMouseDrag(e); } } this.repaint(); } } }, { key: "handleMouseUp", value: function handleMouseUp(e) { // 关闭画布绘画开关 this.isAllowDraw = false; // 鼠标放开的时候锚点选中的开关清空 this.selectedArchor = null; // 更新鼠标的坐标位置【要掉用camelElement中的方法改变坐标位置】 var x = e.offsetX, y = e.offsetY; var em = this.chkSelectedElement(x, y); if (this.elem) { this._currToElem = this.elem; this._currToElem.moveTo(x, y); //当前选择元素设置x和y // 需要先判断直接放置的是否为路由还是其他元素 if (this._currToElem && this._currToElem.scope == "route") { this._elems.push(this._currToElem); } else if (this.ckInRouteEle(x, y)) { this._elems.push(this._currToElem); // 将当前的元素放置到所在route范围中 this._routeEle.childNode.push(this._currToElem); // 当前的元素父级是哪一个 this._currToElem.parent = this._routeEle; // todo 当前元素的父级增大(需要判断当前元素的x+宽,y+高,必须要在父级路由里面) // this._routeEle.setProps({width: this._routeEle.width + 10, height: this._routeEle.height + this._currToElem.height}) } if (this._currToElem != null && this._currToElem instanceof _element.Relation && (em == null || em instanceof _element.CamelElement)) { var r = this._currToElem; if (r.getEndEle() == null) { if (em != null) { var have = false; this._elems.forEach(function (val, ind) { if (val instanceof _element.Relation) { if (val._startelemid == r._startelemid && val._endelemid == em.rid) { haveNum = ind; have = true; } } }); if (have) { this._elems = this._removeElementFromArray(this._elems, r); alert("同方向关联线有且仅有一条"); } else { r.setEndId(em); var node = em; var point = { x: node.x, y: node.y }; r.addVector(point); } } console.log(3333); if (em == null) { // this._elems = this._removeElementFromArray(this._elems, r); } } else { console.log("2222"); } } } // 元素添加到画布之后要清空未添加的元素[relation不属于选中的元素] this.elem = null; // this.resetCurrToEdit();【先注释,属性面板无法选中展示】 this._routeEle = null; this.changestatus(CamelPanel.ACTION_NORMAL); // 重新渲染 this.repaint(); if (window.camelParams && window.camelParams.lTree) { window.camelParams.lTree.render(); console.log("chongxinxuanran"); } console.log(this._elems); } }, { key: "handleMouseDrag", value: function handleMouseDrag(e) { var x = e.offsetX, y = e.offsetY; console.log("drag"); if (this.elem != null && this._status != CamelPanel.ACTION_BREAK_LINE && this.elem instanceof _element.Relation) { // 从一个结点到另一个结点画流程的拖拉过程中 if (this.elem.getEndEle() == null) { this.elem.moveTo(x, y); } else { console.log("待处理2"); } } else if (this._currToElem != null && this._status != CamelPanel.ACTION_BREAK_LINE) { // 判断移动的是不是大的路由 this.addElementToRoute(); this._currToElem.moveTo(x, y); } else if (this._currToElem != null && this._currToElem instanceof _element.Relation && this._status == CamelPanel.ACTION_BREAK_LINE) { console.log(9999); } this.repaint(); } /** * 检查元素是否有关连线 */ }, { key: "checkHasRealtion", value: function checkHasRealtion() { var elems = this._elems; var relationCount = 0; var relation = [], node = []; if (elems.length > 0) { for (var i = 0; i < elems.length; i++) { if (elems[i] instanceof _element.Relation) { relationCount++; relation.push(elems[i]); } else { node.push(elems[i]); } } for (var nl = 0; nl < node.length; nl++) { if (!node[nl].hasRelation(relation)) { return false; } } return true; } // alert("请创建节点元素!"); return false; } /** * 将画布上的区域及元素转变为树结构,用以构建树形菜单 * @return 返回树形格式的数据 */ }, { key: "transformToTree", value: function transformToTree() { var _camelTree$nodes; var elems = this._elems.filter(function (item) { return item.scope == "route"; }); var tree = []; var cmp = []; var camelTree = { text: "Camel Context", collapseIcon: "glyphicon glyphicon-plus", expandIcon: "glyphicon glyphicon-minus", nodes: [] }; if (elems.length > 0) { for (var x = 0; x < elems.length; x++) { // 将元素转换为树 cmp.push({ text: "Route", collapseIcon: "glyphicon glyphicon-plus", expandIcon: "glyphicon glyphicon-minus", nodes: elems[x].getEleToTree(elems[x].childNode) }); // 继续遍历route中的元素 } } (_camelTree$nodes = camelTree.nodes).push.apply(_camelTree$nodes, cmp); // for(let i = 0, len = chunk.length;i < len;i++) { // let data = chunk[i].getNodeConfigInfo(); // reportMain.nodes.push(data); // } tree.push(camelTree); return tree; } /** * 改变鼠标状态 * * @param status * @roseuid 3E0A6E1A0258 */ }, { key: "changestatus", value: function changestatus(status) { this._status = status; switch (this._status) { case CamelPanel.ACTION_NORMAL: this.canvas.style.cursor = "default"; break; case CamelPanel.ACTION_IN_ELEMENT: this.canvas.style.cursor = "pointer"; break; case CamelPanel.ACTION_BREAK_LINE: this.canvas.style.cursor = "pointer"; break; case CamelPanel.ACTION_NOT_ALLOW: this.canvas.style.cursor = "not-allowed"; break; case CamelPanel.ACTION_REMOVE: this.canvas.style.cursor = "pointer"; break; case CamelPanel.ACTION_ARCHOR_UPPER_LEFT: this.canvas.style.cursor = "nw-resize"; break; case CamelPanel.ACTION_ARCHOR_UPPER_RIGHT: this.canvas.style.cursor = "ne-resize"; break; case CamelPanel.ACTION_ARCHOR_LOWER_LEFT: this.canvas.style.cursor = "sw-resize"; break; case CamelPanel.ACTION_ARCHOR_LOWER_RIGHT: this.canvas.style.cursor = "se-resize"; break; default: this.canvas.style.cursor = "initial"; } } /** * 将元素添加到route中 */ }, { key: "addElementToRoute", value: function addElementToRoute() { var currEle = this._currToElem; if (currEle.scope == "route") { // 计算当前元素左侧到route的距离 currEle.childNode.map(function (item) { if (!(item instanceof _element.Relation)) { item.directTo(currEle.x + item._offsetRoute.x, currEle.y + item._offsetRoute.y); console.log("添加元素到路由上"); } }); } else { // 判断是不是移除自己父级的路由范围【移除就删除childnode】 var cp = currEle.parent; if (currEle.x < cp.x || currEle.x > cp.x + cp.width - currEle.width || currEle.y < cp.y || currEle.y > cp.y + cp.height - currEle.height) { console.log("超出当前边界移除元素,且需要判断是否在另外的路由"); // 当前元素显示错误的标志 // 父元素移除当前的元素,当前元素移除父元素 if (cp.childNode && cp.childNode.length > 0) { cp.childNode = this._removeElementFromArray(cp.childNode, currEle); currEle.parent = {}; } } else { // 检查在那个元素里面[如果又route就不push] var em = this.ckInWhichRouter(currEle); // 判断em有值才进行添加 if (em) { // 先判断是否已经有添加了元素避免重复添加 var flag = this.arrayDuplication(em.childNode, currEle); // 给所在的父级路由的children添加当前元素,给当前元素的parent添加父级元素 if (!flag) { em.childNode.push(currEle); currEle.parent = em; } console.log("检查在那个元素里面", em); } } } } /** * 数组去重(判断元素在数组中是否存在) * @param {需要判断有无重复元素的数组} arr * @param {当前元素} addEle */ }, { key: "arrayDuplication", value: function arrayDuplication(arr, addEle) { for (var a = 0; a < arr.length; a++) { if (arr[a].rid == addEle.rid) { return true; } } return false; } // 删除元素 }, { key: "removeElement", value: function removeElement(emn) { var delArr = []; if (emn != null) { if (emn instanceof _element.CamelElement) { var v = this._elems; for (var i = 0; i < v.length; i++) { var elem = v[i]; if (elem instanceof _element.Relation) { var r = elem; if (r._startelemid != null && r._startelemid == emn.rid || r._endelemid != null && r._endelemid == emn.rid) { this._elems = this._removeElementFromArray(this._elems, r); } } } // 移除路由及路由中的所有元素 if (emn.scope == "route") { delArr.push.apply(delArr, _toConsumableArray(emn.childNode)); for (var j = 0; j < delArr.length; j++) { this._elems = this._removeElementFromArray(this._elems, delArr[j]); emn.childNode.splice(j, 1); } } else { // 当前元素的父级也需要移除当前元素 var currParent = emn.parent.childNode; if (currParent && currParent.length > 0) { for (var k = 0; k < currParent.length; k++) { // 如果当前元素在当前元素的父级孩子中能找到,从当前元素的父级孩子中移除 if (emn.rid == currParent[k].rid) { currParent.splice(k, 1); } } } } this._elems = this._removeElementFromArray(this._elems, emn); } else { this._elems = this._removeElementFromArray(this._elems, emn); } } this._currToElem = null; } }, { key: "_removeElementFromArray", value: function _removeElementFromArray(array, element) { for (var i = 0; i < array.length; i++) { var em = array[i]; if (em.rid != null && em.rid == element.rid) { return [].concat(_toConsumableArray(array.slice(0, i)), _toConsumableArray(array.slice(i + 1))); } } } // 删除未添加到画布的元素 }, { key: "delElement", value: function delElement() { this.elem = null; this.isAllowDraw = false; } // 添加组件到画布上 }, { key: "addRoute", value: function addRoute() { var elem = new _routing.Route(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } // component }, { key: "addActiveMQ", value: function addActiveMQ() { var elem = new _compontent.ActiveMQ(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addAtom", value: function addAtom() { var elem = new _compontent.Atom(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addBean", value: function addBean() { var elem = new _compontent.Bean(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addCXF", value: function addCXF() { var elem = new _compontent.CXF(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addCXFRS", value: function addCXFRS() { var elem = new _compontent.CXFRS(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addControlBus", value: function addControlBus() { var elem = new _compontent.ControlBus(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addDirect", value: function addDirect() { var elem = new _compontent.Direct(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addDirectVM", value: function addDirectVM() { var elem = new _compontent.DirectVM(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addFTP", value: function addFTP() { var elem = new _compontent.FTP(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addFTPS", value: function addFTPS() { var elem = new _compontent.FTPS(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addFile", value: function addFile() { var elem = new _compontent.File(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addGeneric", value: function addGeneric() { var elem = new _compontent.Generic(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addIMAP", value: function addIMAP() { var elem = new _compontent.IMAP(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addIMAPSecure", value: function addIMAPSecure() { var elem = new _compontent.IMAPSecure(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addJDBC", value: function addJDBC() { var elem = new _compontent.JDBC(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addJGroups", value: function addJGroups() { var elem = new _compontent.JGroups(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addJMS", value: function addJMS() { var elem = new _compontent.JMS(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addLanguage", value: function addLanguage() { var elem = new _compontent.Language(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addLog", value: function addLog() { var elem = new _compontent.Log(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addMQTT", value: function addMQTT() { var elem = new _compontent.MQTT(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addMVEL", value: function addMVEL() { var elem = new _compontent.MVEL(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addMina2", value: function addMina2() { var elem = new _compontent.Mina2(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addNetty", value: function addNetty() { var elem = new _compontent.Netty(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addNettyHTTP", value: function addNettyHTTP() { var elem = new _compontent.NettyHTTP(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addNetty4", value: function addNetty4() { var elem = new _compontent.Netty4(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addNetty4HTTP", value: function addNetty4HTTP() { var elem = new _compontent.Netty4HTTP(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addPOP3", value: function addPOP3() { var elem = new _compontent.POP3(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addPOP3S", value: function addPOP3S() { var elem = new _compontent.POP3S(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addProcess", value: function addProcess() { var elem = new _compontent.Process(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addQuartz", value: function addQuartz() { var elem = new _compontent.Quartz(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addQuartz2", value: function addQuartz2() { var elem = new _compontent.Quartz2(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRestlet", value: function addRestlet() { var elem = new _compontent.Restlet(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRSS", value: function addRSS() { var elem = new _compontent.RSS(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSAPNetWeaver", value: function addSAPNetWeaver() { var elem = new _compontent.SAPNetWeaver(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSEDA", value: function addSEDA() { var elem = new _compontent.SEDA(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSFTP", value: function addSFTP() { var elem = new _compontent.SFTP(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSMTP", value: function addSMTP() { var elem = new _compontent.SMTP(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSMTPS", value: function addSMTPS() { var elem = new _compontent.SMTPS(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSNMP", value: function addSNMP() { var elem = new _compontent.SNMP(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSQL", value: function addSQL() { var elem = new _compontent.SQL(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSalesforce", value: function addSalesforce() { var elem = new Salesforce(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addScheduler", value: function addScheduler() { var elem = new _compontent.Scheduler(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addServlet", value: function addServlet() { var elem = new _compontent.Servlet(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addTimer", value: function addTimer() { var elem = new _compontent.Timer(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addVM", value: function addVM() { var elem = new _compontent.VM(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addXQuery", value: function addXQuery() { var elem = new _compontent.XQuery(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addXSLT", value: function addXSLT() { var elem = new _compontent.XSLT(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } // routing }, { key: "addAggregate", value: function addAggregate() { var elem = new _routing.Aggregate(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addChoice", value: function addChoice() { var elem = new _routing.Choice(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addClaimCheck", value: function addClaimCheck() { var elem = new _routing.ClaimCheck(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addFilter", value: function addFilter() { var elem = new _routing.Filter(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addHystrix", value: function addHystrix() { var elem = new _routing.Hystrix(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addIdempotentConsumer", value: function addIdempotentConsumer() { var elem = new _routing.IdempotentConsumer(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addLoadBalance", value: function addLoadBalance() { var elem = new _routing.LoadBalance(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addMulticast", value: function addMulticast() { var elem = new _routing.Multicast(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addPipeline", value: function addPipeline() { var elem = new _routing.Pipeline(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRecipientList", value: function addRecipientList() { var elem = new _routing.RecipientList(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addResequence", value: function addResequence() { var elem = new _routing.Resequence(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRoutingSlip", value: function addRoutingSlip() { var elem = new _routing.RoutingSlip(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSaga", value: function addSaga() { var elem = new _routing.Saga(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSort", value: function addSort() { var elem = new _routing.Sort(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSplit", value: function addSplit() { var elem = new _routing.Split(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addWhen", value: function addWhen() { var elem = new _routing.When(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addWireTap", value: function addWireTap() { var elem = new _routing.WireTap(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } // controlflow }, { key: "addDelay", value: function addDelay() { var elem = new _controlflow.Delay(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addDoCatch", value: function addDoCatch() { var elem = new _controlflow.DoCatch(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addDoFinally", value: function addDoFinally() { var elem = new _controlflow.DoFinally(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addDoTry", value: function addDoTry() { var elem = new _controlflow.DoTry(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addIntercept", value: function addIntercept() { var elem = new _controlflow.Intercept(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addInterceptFrom", value: function addInterceptFrom() { var elem = new _controlflow.InterceptFrom(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addInterceptSendToEndpoint", value: function addInterceptSendToEndpoint() { var elem = new _controlflow.InterceptSendToEndpoint(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addLoop", value: function addLoop() { var elem = new _controlflow.Loop(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addOnCompletion", value: function addOnCompletion() { var elem = new _controlflow.OnCompletion(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addOnException", value: function addOnException() { var elem = new _controlflow.OnException(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addOnFallback", value: function addOnFallback() { var elem = new _controlflow.OnFallback(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRollback", value: function addRollback() { var elem = new _controlflow.Rollback(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addThrottle", value: function addThrottle() { var elem = new _controlflow.Throttle(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addThrowException", value: function addThrowException() { var elem = new _controlflow.ThrowException(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addTransacted", value: function addTransacted() { var elem = new _controlflow.Transacted(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } // transformation }, { key: "addConvertBodyTo", value: function addConvertBodyTo() { var elem = new _transformation.ConvertBodyTo(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addEnrich", value: function addEnrich() { var elem = new _transformation.Enrich(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addInOnly", value: function addInOnly() { var elem = new _transformation.InOnly(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addInOut", value: function addInOut() { var elem = new _transformation.InOut(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addMarshal", value: function addMarshal() { var elem = new _transformation.Marshal(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addPollEnrich", value: function addPollEnrich() { var elem = new _transformation.PollEnrich(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRemoveHeader", value: function addRemoveHeader() { var elem = new _transformation.RemoveHeader(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRemoveHeaders", value: function addRemoveHeaders() { var elem = new _transformation.RemoveHeaders(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRemoveProperties", value: function addRemoveProperties() { var elem = new _transformation.RemoveProperties(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addRemoveProperty", value: function addRemoveProperty() { var elem = new _transformation.RemoveProperty(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSetBody", value: function addSetBody() { var elem = new _transformation.SetBody(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSetExchangePattern", value: function addSetExchangePattern() { var elem = new _transformation.SetExchangePattern(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSetFaultBody", value: function addSetFaultBody() { var elem = new _transformation.SetFaultBody(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSetHeader", value: function addSetHeader() { var elem = new _transformation.SetHeader(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSetOutHeader", value: function addSetOutHeader() { var elem = new _transformation.SetOutHeader(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSetProperty", value: function addSetProperty() { var elem = new _transformation.SetProperty(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addTransform", value: function addTransform() { var elem = new _transformation.Transform(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addUnmarshal", value: function addUnmarshal() { var elem = new _transformation.Unmarshal(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } // miscellaneous }, { key: "addAop", value: function addAop() { var elem = new _miscellaneous.Aop(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addPolicy", value: function addPolicy() { var elem = new _miscellaneous.Policy(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addSample", value: function addSample() { var elem = new _miscellaneous.Sample(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addStop", value: function addStop() { var elem = new _miscellaneous.Stop(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addThreads", value: function addThreads() { var elem = new _miscellaneous.Threads(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } }, { key: "addValidate", value: function addValidate() { var elem = new _miscellaneous.Validate(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } // 添加组件到画布上 }, { key: "addRelation", value: function addRelation() { var elem = new _element.Relation(); elem.rid = _utility.Sequence.createId(); this.elem = elem; this.isAllowDraw = true; this.changestatus(CamelPanel.ACTION_NORMAL); } // 删除元素 }, { key: "remove", value: function remove() { this.changestatus(CamelPanel.ACTION_REMOVE); } // 转化xml }, { key: "toXML", value: function toXML() { var str = '\n'; str += '\n'; if (this._elems) this.camelcontext.setPanelEle(this._elems); str += this.camelcontext.toXML(); str += "\n"; return str; } // 解析xml }, { key: "XMLOperate", value: function XMLOperate(xml) { var parse = new DOMParser(); var xmldoc = parse.parseFromString(xml, "text/xml"); return xmldoc; } // 打开弹窗后需要根据数组自动生成连线【】 }, { key: "addAutoLine", value: function addAutoLine(arr) { var currRel = {}; var rels = []; for (var j = 0; j < arr.length; j++) { if (arr[j + 1]) { currRel = new _element.Relation(); currRel.setProps({ _startEle: arr[j], // 关连线的开始节点 _startelemid: arr[j].rid, // 开始元素id _endEle: arr[j + 1], // 关连线的结束节点 _endelemid: arr[j + 1].rid, // 结束元素id vector: [{ x: arr[j].x, y: arr[j].y }, { x: arr[j + 1].x, y: arr[j + 1].y }], _startpoint: { x: arr[j].x + arr[j].width / 2, y: arr[j].y + arr[j].height / 2 }, _endpoint: { x: arr[j + 1].x + arr[j + 1].width / 2, y: arr[j + 1].y + arr[j + 1].height / 2 } }); rels.push(currRel); } } return rels; } //获取当前正在编辑的区域或元素 }, { key: "getCurrToEdit", value: function getCurrToEdit() { return this._currToElem || null; } //清空正在编辑的元素和区域 }, { key: "resetCurrToEdit", value: function resetCurrToEdit() { this._currToElem = null; } /** * @param x * @param y * @return cn.myapps.runtime.workflow.Element * @roseuid 3E0A6E1B00C9 */ }, { key: "chkSelectedElement", value: function chkSelectedElement(x, y) { var elems = this._elems; var arr = []; if (elems.length > 0) { for (var i = 0; i < elems.length; i++) { if (elems[i].isSelected(x, y)) { arr.push(elems[i]); } } if (arr.length > 1) return arr[1];else return arr[0] ? arr[0] : null; } else { return null; } } /** * 判断普通元素是否放置在路由元素里面 */ }, { key: "ckInRouteEle", value: function ckInRouteEle(x, y) { var elems = this._elems; for (var i = 0; i < elems.length; i++) { if (elems[i].scope == "route" && elems[i].x < x && elems[i].x + elems[i].width > x && elems[i].y < y && elems[i].y + elems[i].height > y) { this.ckInWhichRoute(elems[i]); return true; } } return false; } }, { key: "ckInWhichRoute", value: function ckInWhichRoute(elem) { this._routeEle = elem; } }, { key: "ckInWhichRouter", value: function ckInWhichRouter(elem) { var elems = this._elems; for (var i = 0; i < elems.length; i++) { var em = elems[i]; if (elems[i].scope == "route" && elem.x > em.x && elem.x < em.x + em.width && elem.y > em.y && elem.y < em.y + em.height) return em; } return false; } }]); return CamelPanel; }(); CamelPanel.ACTION_NORMAL = 0x00000000; CamelPanel.ACTION_IN_ELEMENT = 0x00000001; CamelPanel.ACTION_NOT_ALLOW = 0x00000002; CamelPanel.ACTION_BREAK_LINE = 0x00000003; CamelPanel.ACTION_REMOVE = 0x00000004; CamelPanel.ACTION_ARCHOR_UPPER_LEFT = 0x00000005; CamelPanel.ACTION_ARCHOR_UPPER_RIGHT = 0x00000006; CamelPanel.ACTION_ARCHOR_LOWER_LEFT = 0x00000007; CamelPanel.ACTION_ARCHOR_LOWER_RIGHT = 0x00000008; exports.default = CamelPanel; /***/ }), /***/ "./src/camel/view/Modal.js": /*!*********************************!*\ !*** ./src/camel/view/Modal.js ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _utility = __webpack_require__(/*! ../utility */ "./src/camel/utility/index.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // import Tree from './Tree'; var Modal = function () { function Modal(target, container, camel) { _classCallCheck(this, Modal); this.target = target; this.container = container; this.camel = camel; this.api = new _utility.Api(); this.helper = new _utility.Helper(); } _createClass(Modal, [{ key: "setProps", value: function setProps(newProps) { Object.assign(this, newProps); } }, { key: "getProp", value: function getProp(prop) { return this[prop]; } }, { key: "render", value: function render() { var $container = $(this.container); var $target = $(this.target); var camel = this.camel; var api = this.api; var helper = this.helper; if (!$container || !$target || !camel) { throw new Error("container or target or camel lose"); } else { if ($target.attr("id") == "showCode") { var xml = camel.toXML(); api.getTemplete("showCodeModal-tmpl").done(function (tml) { var $html = helper.handleTemplete(tml, { xml: xml }, "showCodeModal-tmpl"); $container.html($html); }); } else if ($target.attr("data-id") == "showEditor") { $.when(api.getTemplete("editorModal-tmpl"), api.getJSON()).done(function (tml, data) { var $html = helper.handleTemplete(tml[0], data[0], "editorModal-tmpl"); $container.html($html); }); } this.bindEvent(); } } }, { key: "bindEvent", value: function bindEvent() { var $container = $(this.container); // const tree = Tree.getInstance(); var camel = this.camel; $container.off("click", "#xmlTextConfirm").on("click", "#xmlTextConfirm", function (e) { var xmlString = $container.find("#xmlCode").val(); var parse = new DOMParser(); var xmldoc = parse.parseFromString(xmlString, "text/xml"); new _utility.XMLOperate(xmldoc, camel).parseXML(); camel.paint(); // tree.render(); }); } }]); return Modal; }(); exports.default = Modal; /***/ }), /***/ "./src/camel/view/PropsPanel.js": /*!**************************************!*\ !*** ./src/camel/view/PropsPanel.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _regenerator = __webpack_require__(/*! babel-runtime/regenerator */ "./node_modules/babel-runtime/regenerator/index.js"); var _regenerator2 = _interopRequireDefault(_regenerator); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _utility = __webpack_require__(/*! ../utility */ "./src/camel/utility/index.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var PropsPanel = function () { function PropsPanel() { _classCallCheck(this, PropsPanel); this.container = null; this.camel = null; this.camelContext = null; this.api = new _utility.Api(); this.helper = new _utility.Helper(); this.rendering = false; this.propsDesc = []; //[{propName:'NAME',propType:'TEXT'...}] this.panel = document.getElementById("propsBoard"); this.initComponent = null; // 用户对比uri的属性值 } _createClass(PropsPanel, [{ key: "setProps", value: function setProps(newProps) { Object.assign(this, newProps); } }, { key: "getProp", value: function getProp(prop) { return this[prop]; } }, { key: "init", value: function init(params) { this.setProps(params); this.render(); } }, { key: "bindEvent", value: function bindEvent() { var _this = this; var camel = this.camel; var $container = $(this.container); var currToEdit = camel.getCurrToEdit(); var that = this; $container.off("input change").on("input change", function (e) { var target = $(e.target); var key = target.attr("id"); var prop = {}; prop[key] = target.val(); console.log(key, prop); if (currToEdit == null || currToEdit.scope == 'relation') { _this.camelContext.setProps(prop); } else { currToEdit.setProps(prop); if (currToEdit.hasUri) { // 更新uri var uriValue = currToEdit.updateUri(_this.initComponent, prop); currToEdit.setProps({ uri: uriValue }); // 改变输入框的值 document.getElementById("uri").value = uriValue; } } camel.repaint(); }); } }, { key: "unbindEvent", value: function unbindEvent() { this.initComponent = null; this.panel.removeEventListener("change", this.changeEvent, false); } }, { key: "render", value: function () { var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator2.default.mark(function _callee() { var _this2 = this; var that, camel, $container, api, helper, $html; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: that = this; camel = this.camel; $container = $(this.container); api = this.api; helper = this.helper; $html = ""; if (camel) { (function () { var currToEdit = camel.getCurrToEdit(); if (currToEdit == null || currToEdit.scope == 'relation') { // camelcontext模板 $.when(api.getTemplete("editCamel-tmpl").done(function (tml) { var _camelData; var camelData = (_camelData = { allowUseOriginalMessage: _this2.camelContext.allowUseOriginalMessage, delayer: _this2.camelContext.delayer, depends_on: _this2.camelContext.depends_on, errorHandlerRef: _this2.camelContext.errorHandlerRef, handleFault: _this2.camelContext.handleFault, name: _this2.camelContext.name, logExhaustedMessageBody: _this2.camelContext.logExhaustedMessageBody, loadTypeConverters: _this2.camelContext.loadTypeConverters }, _defineProperty(_camelData, "logExhaustedMessageBody", _this2.camelContext.logExhaustedMessageBody), _defineProperty(_camelData, "logMask", _this2.camelContext.logMask), _defineProperty(_camelData, "managementNamePattern", _this2.camelContext.managementNamePattern), _defineProperty(_camelData, "registerEndpointIdsFromRoute", _this2.camelContext.registerEndpointIdsFromRoute), _defineProperty(_camelData, "runtimeEndpointRegistryEnabled", _this2.camelContext.runtimeEndpointRegistryEnabled), _defineProperty(_camelData, "shutdownEager", _this2.camelContext.shutdownEager), _defineProperty(_camelData, "shutdownRoute", _this2.camelContext.shutdownRoute), _defineProperty(_camelData, "shutdownRunningTask", _this2.camelContext.shutdownRunningTask), _defineProperty(_camelData, "streamCache", _this2.camelContext.streamCache), _defineProperty(_camelData, "threadNamepattern", _this2.camelContext.threadNamepattern), _defineProperty(_camelData, "trace", _this2.camelContext.trace), _defineProperty(_camelData, "typeConverterExists", _this2.camelContext.typeConverterExists), _defineProperty(_camelData, "typeConverterExistsLoggingLevel", _this2.camelContext.typeConverterExistsLoggingLevel), _defineProperty(_camelData, "typeConverterStatisticsEnabled", _this2.camelContext.typeConverterStatisticsEnabled), _defineProperty(_camelData, "usebreadcrumb", _this2.camelContext.usebreadcrumb), _defineProperty(_camelData, "useDataType", _this2.camelContext.useDataType), _camelData); $html = helper.handleTemplete(tml, camelData, "editCamel-tmpl"); $container.html($html); })); // 更新camelcontext模板 _this2.bindEvent(); } else { _this2.propsDesc = currToEdit.getPropsDesc(); _this2.initComponent = helper.handleInitData(currToEdit.scope); var destinationTypeOption = [{ label: "", value: "" }, { label: "队列", value: "queue" }, { label: "主题", value: "topic" }, { label: "临时队列", value: "temp-queue" }, { label: "临时话题", value: "temp-topic" }]; var jmsMessageTypeOption = [{ label: "", value: "" }, { label: "字节", value: "bytes" }, { label: "图", value: "map" }, { label: "对象", value: "object" }, { label: "流", value: "stream" }, { label: "文本", value: "text" }]; var acknowledgementModeNameOption = [{ label: "", value: "" }, { label: "会话时段", value: "SESSION_TRANSACTED" }, { label: "客户确认", value: "CLIENT_ACKNOWLEDGE" }, { label: "自动确认", value: "AUTO_ACKNOWLEDGE" }, { label: "允许副本的确认模式", value: "DUPS_OK_ACKNOWLEDGE" }]; var cacheLevelNameOption = [{ label: "", value: "" }, { label: "自动缓存", value: "CACHE_AUTO" }, { label: "缓存连接", value: "CACHE_CONNECTION" }, { label: "缓存消费", value: "CACHE_CONSUMER" }, { label: "暂无缓存", value: "CACHE_NONE" }, { label: "缓存会话", value: "CACHE_SESSION" }]; var consumerTypeOption = [{ label: "", value: "" }, { label: "简单", value: "Simple" }, { label: "默认", value: "Default" }, { label: "定制", value: "Custom" }]; var defaultTaskExecutorTypeOption = [{ label: "", value: "" }, { label: "线程池", value: "Threadpool" }, { label: "简单同步", value: "Simpleasync" }]; var exchangePatternOption = [{ label: "", value: "" }, { label: "仅进入", value: "InOnly" }, { label: "强制进入", value: "RobustInOnly" }, { label: "进出", value: "InOut" }, { label: "可选输出中", value: "InOptionalOut" }, { label: "仅出", value: "OutOnly" }, { label: "强制进出", value: "RobustInOutOnly" }, { label: "出入", value: "OutIn" }, { label: "出可选进", value: "OutOptionalIn" }]; var deliveryModeOption = [{ label: "", value: "" }, { label: "1", value: "1" }, { label: "2", value: "2" }]; var priorityOption = [{ label: "", value: "" }, { label: "1", value: "1" }, { label: "2", value: "2" }, { label: "3", value: "3" }, { label: "4", value: "4" }, { label: "5", value: "5" }, { label: "6", value: "6" }, { label: "7", value: "7" }, { label: "8", value: "8" }, { label: "9", value: "9" }]; var replyToOverrideOption = [{ label: "", value: "" }, { label: "临时", value: "Temporary" }, { label: "共享", value: "Shared" }, { label: "私有", value: "Exclusives" }]; var errorHandlerLoggingLevelOption = [{ label: "", value: "" }, { label: "跟踪", value: "TRACE" }, { label: "调试", value: "DEBUG" }, { label: "信息", value: "INFO" }, { label: "警告", value: "WARN" }, { label: "错误", value: "ERROR" }, { label: "离开", value: "OFF" }]; var initialDelayOption = [{ label: "", value: "" }, { label: "none", value: "none" }, { label: "spring", value: "spring" }, { label: "quartz2", value: "quartz2" }]; var timeUnitOption = [{ label: "", value: "" }, { label: "纳秒", value: "NANOSECONDS" }, { label: "微秒", value: "MICROSECONDS" }, { label: "秒", value: "SECONDS" }, { label: "分钟", value: "MINUTES" }, { label: "小时", value: "HOURS" }, { label: "天", value: "DAYS" }]; var bindingStyleOption = [{ label: "", value: "" }, { label: "简单消费者", value: "SimpleConsumer" }, { label: "默认", value: "Default" }, { label: "顾客", value: "Custom" }]; var ationOption = [{ label: "", value: "" }, { label: "开始", value: "start" }, { label: "停止", value: "stop" }, { label: "暂停", value: "suspend" }, { label: "恢复", value: "resume" }, { label: "重新开始", value: "restart" }, { label: "状态", value: "status" }, { label: "统计资料", value: "stats" }]; var dataFormatOption = [{ label: "", value: "" }, { label: "播放量", value: "PLAYLOAD" }, { label: "RAW", value: "RAW" }, { label: "信息", value: "MESSAGE" }, { label: "cxf信息", value: "CXF_MESSAGE" }, { label: "POJO", value: "POJO" }]; var commandOption = [{ label: "", value: "command" }, { label: "route", value: "route" }, { label: "languange", value: "languange" }]; var languangeOption = [{ label: "", value: "language" }, { label: "bean", value: "bean" }, { label: "constant", value: "constant" }, { label: "el", value: "el" }, { label: "exchangeProperty", value: "exchangeProperty" }, { label: "file", value: "file" }, { label: "groovy", value: "groovy" }, { label: "header", value: "header" }, { label: "jsonpath", value: "jsonpath" }, { label: "jxpath", value: "jxpath" }, { label: "mvel", value: "mvel" }, { label: "ognl", value: "ognl" }, { label: "ref", value: "ref" }, { label: "simple", value: "simple" }]; var readLockOption = [{ label: "", value: "" }, { label: "none", value: "none" }, { label: "markerFile", value: "markerFile" }, { label: "fileLock", value: "fileLock" }, { label: "rename", value: "rename" }, { label: "changed", value: "changed" }, { label: "idempotent", value: "idempotent" }, { label: "idempotent-change", value: "idempotent-change" }, { label: "idempotent-rename", value: "idempotent-rename" }]; var outputTypeOption = [{ label: "", value: "" }, { label: "SelectOne", value: "SelectOne" }, { label: "SelectList", value: "SelectList" }, { label: "StreanList", value: "StreanList" }]; var fileExistOption = [{ label: "", value: "" }, { label: "Override", value: "Override" }, { label: "Append", value: "Append" }, { label: "Fail", value: "Fail" }, { label: "Ignore", value: "Ignore" }, { label: "Move", value: "Move" }, { label: "TryRename", value: "TryRename" }]; var qualityOfServiceOption = [{ label: "", value: "" }, { label: "AtMostOnce", value: "AtMostOnce" }, { label: "AtLeastOnce", value: "AtLeastOnce" }, { label: "ExactlyOnce", value: "ExactlyOnce" }]; var willRetainOption = [{ label: "", value: "" }, { label: "AT_MOST_ONCE", value: "AT_MOST_ONCE" }, { label: "AT_LEAST_ONCE", value: "AT_LEAST_ONCE" }, { label: "EXACTLY_ONCE", value: "EXACTLY_ONCE" }]; var textlineDelimiterOption = [{ label: "", value: "" }]; var delimiterOption = [{ label: "", value: "" }, { label: "LINE", value: "LINE" }, { label: "NULL", value: "NULL" }]; var protocolOption = [{ label: "", value: "" }, { label: "tcp", value: "tcp" }, { label: "udp", value: "udp" }]; var restletMethodOption = [{ label: "", value: "" }, { label: "ALL", value: "ALL" }, { label: "CONNECT", value: "CONNECT" }, { label: "DELETE", value: "DELETE" }, { label: "GET", value: "GET" }, { label: "HEAD", value: "HEAD" }, { label: "OPTIONS", value: "OPTIONS" }, { label: "PATCH", value: "PATCH" }, { label: "POST", value: "POST" }, { label: "PUT", value: "PUT" }, { label: "TRACE", value: "TRACE" }]; var waitForTaskToCompleteOption = [{ label: "", value: "" }, { label: "Never", value: "Never" }, { label: "ifReplyExpected", value: "ifReplyExpected" }, { label: "Always", value: "Always" }]; var strictHostKeyCheckingOption = [{ label: "no", value: "no" }, { label: "yes", value: "yes" }]; var snmpVersionOption = [{ label: "", value: "" }]; var typeOption = [{ label: "", value: "" }]; var servletNameOption = [{ label: "", value: "" }]; var securityLevelOption = [{ label: "", value: "" }]; var resultsFormatOption = [{ label: "", value: "" }]; var contentTypeOption = [{ label: "", value: "" }]; var formatOption = [{ label: "", value: "" }]; var notFoundBehaviourOption = [{ label: "", value: "" }]; var notifyForOperationsOption = [{ label: "", value: "" }]; var outputOption = [{ label: "", value: "" }]; var saxonOption = [{ label: "", value: "" }]; var operationNameOption = [{ label: "", value: "" }]; var expressionOption = [{ label: "constant", value: "constant" }, { label: "el", value: "el" }, { label: "exchangeProperty", value: "exchangeProperty" }, { label: "groovy", value: "groovy" }, { label: "header", value: "header" }, { label: "javaScript", value: "javaScript" }, { label: "jsonpath", value: "jsonpath" }, { label: "jxpath", value: "jxpath" }, { label: "language", value: "language" }, { label: "method", value: "method" }, { label: "mvel", value: "mvel" }, { label: "ognl", value: "ognl" }, { label: "php", value: "php" }, { label: "python", value: "python" }, { label: "ref", value: "ref" }, { label: "ruby", value: "ruby" }, { label: "simple", value: "simple" }, { label: "spel", value: "spel" }, { label: "sql", value: "sql" }, { label: "terser", value: "terser" }, { label: "tokenize", value: "tokenize" }, { label: "xpath", value: "xpath" }, { label: "xquery", value: "xquery" }, { label: "xtokenize", value: "xtokenize" }, { label: "vtdxml", value: "vtdxml" }]; var operationOption = [{ label: "", value: "" }, { label: "Get", value: "Get" }, { label: "GetAndRemove", value: "GetAndRemove" }, { label: "POP", value: "POP" }, { label: "Push", value: "Push" }, { label: "Set", value: "Set" }]; var completionModeOption = [{ label: "AUTO", value: "AUTO" }, { label: "MANUAL", value: "MANUAL" }]; var propagationOption = [{ label: "", value: "" }, { label: "MANDATORY", value: "MANDATORY" }, { label: "NEVER", value: "NEVER" }, { label: "NOT_SUPPORTED", value: "NOT_SUPPORTED" }, { label: "REQUIRED", value: "REQUIRED" }, { label: "REQUIRES_NEW", value: "REQUIRES_NEW" }, { label: "SUPPORTS", value: "SUPPORTS" }]; var patternOption = [{ label: "", value: "" }]; var modeOption = [{ label: "", value: "" }]; var retryWhileOption = [{ label: "", value: "" }]; var unitsOption = [{ label: "", value: "" }]; var rejectedPolicyOption = [{ label: "", value: "" }]; if (_this2.rendering == false) { _this2.rendering = true; // 清空上一次的值 _this2.panel.innerHTML = ""; // 最外侧div var div = document.createElement("DIV"); div.setAttribute("class", "panel panel-info h100"); // 上方标题 var baseTitle = document.createElement("DIV"); var basetxt = document.createTextNode(currToEdit.scope); baseTitle.setAttribute("class", "panel-heading"); baseTitle.appendChild(basetxt); div.appendChild(baseTitle); // 左侧的tab标签 var lDiv = document.createElement("UL"); lDiv.setAttribute("class", "col-xs-2 lTab nav nav-tabs nav-pills"); // 右侧tab var rDiv = document.createElement("DIV"); rDiv.setAttribute("class", "rTab tab-content col-xs-22"); // 右侧高级嵌套的tab和内容 var rDivTab = document.createElement("UL"); rDivTab.setAttribute("class", "nav nav-tabs"); var rDivTabContent = document.createElement("DIV"); rDivTabContent.setAttribute("class", "rTabContent tab-content"); for (var propPart in _this2.propsDesc) { switch (propPart) { case "details": // 左侧tab标签 var detailTitle = document.createElement("LI"); detailTitle.setAttribute("class", "active w100 tc"); var aDetail = document.createElement("A"); var atxt = document.createTextNode("详情"); aDetail.setAttribute("href", "#details"); aDetail.setAttribute("data-toggle", "tab"); aDetail.appendChild(atxt); detailTitle.appendChild(aDetail); lDiv.appendChild(detailTitle); // 右侧属性面板的值 var firstCon = document.createElement("DIV"); var _loop = function _loop(i) { var propName = that.propsDesc[propPart][i]; var chinaName = null; var span = document.createElement("p"); var html = ""; switch (propName) { case "afterUri": chinaName = "在Uri之后"; html += ""; break; case "afterFinallyUri": chinaName = "在FinalUri之后"; html += ""; break; case "aggregateControllerRef": chinaName = "聚合控制器参考"; html += ""; break; case "aggregateOnException": chinaName = "异常汇总"; html += ""; break; case "aggregationRepositoryRef": chinaName = "聚合存储库参考"; html += ""; break; case "allowCoreThreadTimeOut": chinaName = "允许核心线程超时"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "allowOptimisedComponents": chinaName = "允许优化组件"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "asyncDelayed": chinaName = "异步延迟"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "autoStartup": chinaName = "自动登录"; html += ""; break; case "beanType": chinaName = "公共类"; html += ""; break; case "beforeUri": chinaName = "在Uri之前"; html += ""; break; case "body": chinaName = "身体"; html += ""; break; case "cacheSize": chinaName = "内存大小"; html += ""; break; case "callerRunsWhenRejected": chinaName = "呼叫者被拒绝时运行"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "charset": chinaName = "字符集"; html += ""; break; case "closeCorrelationKeyOnCompletion": chinaName = "close完成时的相关键"; html += ""; break; case "comparatorRef": chinaName = "比较器Ref"; html += ""; break; case "completeAllOnStop": chinaName = "完成所有停止"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "completionEager": chinaName = "渴望完成"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "completionFromBatchConsumer": chinaName = "来自批处理用户的完成"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "completionInterval": chinaName = "完成时间间隔"; html += ""; break; case "completionMode": chinaName = "完成时间间隔"; html += ""; } else { html += ""; } break; case "completionSize": chinaName = "完成大小"; html += ""; break; case "completionPredicate": chinaName = "完成谓词"; html += ""; break; case "continued": chinaName = "继续"; html += ""; expressionOption.forEach(function (el) { if (el.value == currToEdit[propName]) { html += ""; } else { html += ""; } }); break; case "copy": chinaName = "复制"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "dataFormatType": chinaName = "数据格式类型"; html += ""; break; case "delimiter": chinaName = "定界符"; html += ""; break; case "description": chinaName = "描述"; html += ""; break; case "discardOnCompletionTimeout": chinaName = "完成时丢弃超时"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "doWhile": chinaName = "同时"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "dynamicUri": chinaName = "动态Uri"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "eager": chinaName = "渴望"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "eagerCheckCompletion": chinaName = "渴望检查完成"; html += ""; if (currToEdit[propName] == true) { html += ""; } else { html += ""; } break; case "exception": chinaName = "例外"; html += "