code_text
stringlengths 604
999k
| repo_name
stringlengths 4
100
| file_path
stringlengths 4
873
| language
stringclasses 23
values | license
stringclasses 15
values | size
int32 1.02k
999k
|
---|---|---|---|---|---|
/*
YUI 3.15.0 (build 834026e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('resize-constrain', function (Y, NAME) {
var Lang = Y.Lang,
isBoolean = Lang.isBoolean,
isNumber = Lang.isNumber,
isString = Lang.isString,
capitalize = Y.Resize.capitalize,
isNode = function(v) {
return (v instanceof Y.Node);
},
toNumber = function(num) {
return parseFloat(num) || 0;
},
BORDER_BOTTOM_WIDTH = 'borderBottomWidth',
BORDER_LEFT_WIDTH = 'borderLeftWidth',
BORDER_RIGHT_WIDTH = 'borderRightWidth',
BORDER_TOP_WIDTH = 'borderTopWidth',
BORDER = 'border',
BOTTOM = 'bottom',
CON = 'con',
CONSTRAIN = 'constrain',
HOST = 'host',
LEFT = 'left',
MAX_HEIGHT = 'maxHeight',
MAX_WIDTH = 'maxWidth',
MIN_HEIGHT = 'minHeight',
MIN_WIDTH = 'minWidth',
NODE = 'node',
OFFSET_HEIGHT = 'offsetHeight',
OFFSET_WIDTH = 'offsetWidth',
PRESEVE_RATIO = 'preserveRatio',
REGION = 'region',
RESIZE_CONTRAINED = 'resizeConstrained',
RIGHT = 'right',
TICK_X = 'tickX',
TICK_Y = 'tickY',
TOP = 'top',
WIDTH = 'width',
VIEW = 'view',
VIEWPORT_REGION = 'viewportRegion';
/**
A Resize plugin that will attempt to constrain the resize node to the boundaries.
@module resize
@submodule resize-contrain
@class ResizeConstrained
@param config {Object} Object literal specifying widget configuration properties.
@constructor
@extends Plugin.Base
@namespace Plugin
*/
function ResizeConstrained() {
ResizeConstrained.superclass.constructor.apply(this, arguments);
}
Y.mix(ResizeConstrained, {
NAME: RESIZE_CONTRAINED,
NS: CON,
ATTRS: {
/**
* Will attempt to constrain the resize node to the boundaries. Arguments:<br>
* 'view': Contrain to Viewport<br>
* '#selector_string': Constrain to this node<br>
* '{Region Object}': An Object Literal containing a valid region (top, right, bottom, left) of page positions
*
* @attribute constrain
* @type {String|Object|Node}
*/
constrain: {
setter: function(v) {
if (v && (isNode(v) || isString(v) || v.nodeType)) {
v = Y.one(v);
}
return v;
}
},
/**
* The minimum height of the element
*
* @attribute minHeight
* @default 15
* @type Number
*/
minHeight: {
value: 15,
validator: isNumber
},
/**
* The minimum width of the element
*
* @attribute minWidth
* @default 15
* @type Number
*/
minWidth: {
value: 15,
validator: isNumber
},
/**
* The maximum height of the element
*
* @attribute maxHeight
* @default Infinity
* @type Number
*/
maxHeight: {
value: Infinity,
validator: isNumber
},
/**
* The maximum width of the element
*
* @attribute maxWidth
* @default Infinity
* @type Number
*/
maxWidth: {
value: Infinity,
validator: isNumber
},
/**
* Maintain the element's ratio when resizing.
*
* @attribute preserveRatio
* @default false
* @type boolean
*/
preserveRatio: {
value: false,
validator: isBoolean
},
/**
* The number of x ticks to span the resize to.
*
* @attribute tickX
* @default false
* @type Number | false
*/
tickX: {
value: false
},
/**
* The number of y ticks to span the resize to.
*
* @attribute tickY
* @default false
* @type Number | false
*/
tickY: {
value: false
}
}
});
Y.extend(ResizeConstrained, Y.Plugin.Base, {
/**
* Stores the <code>constrain</code>
* surrounding information retrieved from
* <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.
*
* @property constrainSurrounding
* @type Object
* @default null
*/
constrainSurrounding: null,
initializer: function() {
var instance = this,
host = instance.get(HOST);
host.delegate.dd.plug(
Y.Plugin.DDConstrained,
{
tickX: instance.get(TICK_X),
tickY: instance.get(TICK_Y)
}
);
host.after('resize:align', Y.bind(instance._handleResizeAlignEvent, instance));
host.on('resize:start', Y.bind(instance._handleResizeStartEvent, instance));
},
/**
* Helper method to update the current values on
* <a href="Resize.html#property_info">info</a> to respect the
* constrain node.
*
* @method _checkConstrain
* @param {String} axis 'top' or 'left'
* @param {String} axisConstrain 'bottom' or 'right'
* @param {String} offset 'offsetHeight' or 'offsetWidth'
* @protected
*/
_checkConstrain: function(axis, axisConstrain, offset) {
var instance = this,
point1,
point1Constrain,
point2,
point2Constrain,
host = instance.get(HOST),
info = host.info,
constrainBorders = instance.constrainSurrounding.border,
region = instance._getConstrainRegion();
if (region) {
point1 = info[axis] + info[offset];
point1Constrain = region[axisConstrain] - toNumber(constrainBorders[capitalize(BORDER, axisConstrain, WIDTH)]);
if (point1 >= point1Constrain) {
info[offset] -= (point1 - point1Constrain);
}
point2 = info[axis];
point2Constrain = region[axis] + toNumber(constrainBorders[capitalize(BORDER, axis, WIDTH)]);
if (point2 <= point2Constrain) {
info[axis] += (point2Constrain - point2);
info[offset] -= (point2Constrain - point2);
}
}
},
/**
* Update the current values on <a href="Resize.html#property_info">info</a>
* to respect the maxHeight and minHeight.
*
* @method _checkHeight
* @protected
*/
_checkHeight: function() {
var instance = this,
host = instance.get(HOST),
info = host.info,
maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),
minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding);
instance._checkConstrain(TOP, BOTTOM, OFFSET_HEIGHT);
if (info.offsetHeight > maxHeight) {
host._checkSize(OFFSET_HEIGHT, maxHeight);
}
if (info.offsetHeight < minHeight) {
host._checkSize(OFFSET_HEIGHT, minHeight);
}
},
/**
* Update the current values on <a href="Resize.html#property_info">info</a>
* calculating the correct ratio for the other values.
*
* @method _checkRatio
* @protected
*/
_checkRatio: function() {
var instance = this,
host = instance.get(HOST),
info = host.info,
originalInfo = host.originalInfo,
oWidth = originalInfo.offsetWidth,
oHeight = originalInfo.offsetHeight,
oTop = originalInfo.top,
oLeft = originalInfo.left,
oBottom = originalInfo.bottom,
oRight = originalInfo.right,
// wRatio/hRatio functions keep the ratio information always synced with the current info information
// RETURN: percentage how much width/height has changed from the original width/height
wRatio = function() {
return (info.offsetWidth/oWidth);
},
hRatio = function() {
return (info.offsetHeight/oHeight);
},
isClosestToHeight = host.changeHeightHandles,
bottomDiff,
constrainBorders,
constrainRegion,
leftDiff,
rightDiff,
topDiff;
// check whether the resizable node is closest to height or not
if (instance.get(CONSTRAIN) && host.changeHeightHandles && host.changeWidthHandles) {
constrainRegion = instance._getConstrainRegion();
constrainBorders = instance.constrainSurrounding.border;
bottomDiff = (constrainRegion.bottom - toNumber(constrainBorders[BORDER_BOTTOM_WIDTH])) - oBottom;
leftDiff = oLeft - (constrainRegion.left + toNumber(constrainBorders[BORDER_LEFT_WIDTH]));
rightDiff = (constrainRegion.right - toNumber(constrainBorders[BORDER_RIGHT_WIDTH])) - oRight;
topDiff = oTop - (constrainRegion.top + toNumber(constrainBorders[BORDER_TOP_WIDTH]));
if (host.changeLeftHandles && host.changeTopHandles) {
isClosestToHeight = (topDiff < leftDiff);
}
else if (host.changeLeftHandles) {
isClosestToHeight = (bottomDiff < leftDiff);
}
else if (host.changeTopHandles) {
isClosestToHeight = (topDiff < rightDiff);
}
else {
isClosestToHeight = (bottomDiff < rightDiff);
}
}
// when the height of the resizable element touch the border of the constrain first
// force the offsetWidth to be calculated based on the height ratio
if (isClosestToHeight) {
info.offsetWidth = oWidth*hRatio();
instance._checkWidth();
info.offsetHeight = oHeight*wRatio();
}
else {
info.offsetHeight = oHeight*wRatio();
instance._checkHeight();
info.offsetWidth = oWidth*hRatio();
}
// fixing the top on handles which are able to change top
// the idea here is change the top based on how much the height has changed instead of follow the dy
if (host.changeTopHandles) {
info.top = oTop + (oHeight - info.offsetHeight);
}
// fixing the left on handles which are able to change left
// the idea here is change the left based on how much the width has changed instead of follow the dx
if (host.changeLeftHandles) {
info.left = oLeft + (oWidth - info.offsetWidth);
}
// rounding values to avoid pixel jumpings
Y.each(info, function(value, key) {
if (isNumber(value)) {
info[key] = Math.round(value);
}
});
},
/**
* Check whether the resizable node is inside the constrain region.
*
* @method _checkRegion
* @protected
* @return {boolean}
*/
_checkRegion: function() {
var instance = this,
host = instance.get(HOST),
region = instance._getConstrainRegion();
return Y.DOM.inRegion(null, region, true, host.info);
},
/**
* Update the current values on <a href="Resize.html#property_info">info</a>
* to respect the maxWidth and minWidth.
*
* @method _checkWidth
* @protected
*/
_checkWidth: function() {
var instance = this,
host = instance.get(HOST),
info = host.info,
maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),
minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding);
instance._checkConstrain(LEFT, RIGHT, OFFSET_WIDTH);
if (info.offsetWidth < minWidth) {
host._checkSize(OFFSET_WIDTH, minWidth);
}
if (info.offsetWidth > maxWidth) {
host._checkSize(OFFSET_WIDTH, maxWidth);
}
},
/**
* Get the constrain region based on the <code>constrain</code>
* attribute.
*
* @method _getConstrainRegion
* @protected
* @return {Object Region}
*/
_getConstrainRegion: function() {
var instance = this,
host = instance.get(HOST),
node = host.get(NODE),
constrain = instance.get(CONSTRAIN),
region = null;
if (constrain) {
if (constrain === VIEW) {
region = node.get(VIEWPORT_REGION);
}
else if (isNode(constrain)) {
region = constrain.get(REGION);
}
else {
region = constrain;
}
}
return region;
},
_handleResizeAlignEvent: function() {
var instance = this,
host = instance.get(HOST);
// check the max/min height and locking top when these values are reach
instance._checkHeight();
// check the max/min width and locking left when these values are reach
instance._checkWidth();
// calculating the ratio, for proportionally resizing
if (instance.get(PRESEVE_RATIO)) {
instance._checkRatio();
}
if (instance.get(CONSTRAIN) && !instance._checkRegion()) {
host.info = host.lastInfo;
}
},
_handleResizeStartEvent: function() {
var instance = this,
constrain = instance.get(CONSTRAIN),
host = instance.get(HOST);
instance.constrainSurrounding = host._getBoxSurroundingInfo(constrain);
}
});
Y.namespace('Plugin');
Y.Plugin.ResizeConstrained = ResizeConstrained;
}, '3.15.0', {"requires": ["plugin", "resize-base"]});
| koggdal/cdnjs | ajax/libs/yui/3.15.0/resize-constrain/resize-constrain-debug.js | JavaScript | mit | 13,790 |
var mongoose = require('../../lib')
var Schema = mongoose.Schema;
console.log('Running mongoose version %s', mongoose.version);
/**
* Console schema
*/
var consoleSchema = Schema({
name: String
, manufacturer: String
, released: Date
})
var Console = mongoose.model('Console', consoleSchema);
/**
* Game schema
*/
var gameSchema = Schema({
name: String
, developer: String
, released: Date
, consoles: [{ type: Schema.Types.ObjectId, ref: 'Console' }]
})
var Game = mongoose.model('Game', gameSchema);
/**
* Connect to the console database on localhost with
* the default port (27017)
*/
mongoose.connect('mongodb://localhost/console', function (err) {
// if we failed to connect, abort
if (err) throw err;
// we connected ok
createData();
})
/**
* Data generation
*/
function createData () {
Console.create({
name: 'Nintendo 64'
, manufacturer: 'Nintendo'
, released: 'September 29, 1996'
}, {
name: 'Super Nintendo'
, manufacturer: 'Nintendo'
, released: 'August 23, 1991'
}, function (err, nintendo64, superNintendo) {
if (err) return done(err);
Game.create({
name: 'Legend of Zelda: Ocarina of Time'
, developer: 'Nintendo'
, released: new Date('November 21, 1998')
, consoles: [nintendo64]
}, {
name: 'Mario Kart'
, developer: 'Nintendo'
, released: 'September 1, 1992'
, consoles: [superNintendo]
}, function (err) {
if (err) return done(err);
example();
})
})
}
/**
* Population
*/
function example () {
Game
.find({})
.exec(function (err, games) {
if (err) return done(err);
console.log('found %d games', games.length);
var options = { path: 'consoles', select: 'name released -_id' };
Game.populate(games, options, function (err, games) {
if (err) return done(err);
games.forEach(function (game) {
console.log(
'"%s" was released for the %s on %s'
, game.name
, game.consoles[0].name
, game.released.toLocaleDateString());
})
done()
})
})
}
function done (err) {
if (err) console.error(err);
Console.remove(function () {
Game.remove(function () {
mongoose.disconnect();
})
})
}
| mypmnode/mypmnode | node_modules/mongoose/examples/population/population-of-multiple-existing-docs.js | JavaScript | mit | 2,285 |
/*
YUI 3.15.0 (build 834026e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('app-transitions-native', function (Y, NAME) {
/**
Provides the implementation of view transitions for `Y.App.Transitions` in
browsers which support native CSS3 transitions.
@module app
@submodule app-transitions-native
@since 3.5.0
**/
var AppTransitions = Y.App.Transitions;
/**
Provides the implementation of view transitions for `Y.App.Transitions` in
browsers which support native CSS3 transitions.
When this module is used, `Y.App.TransitionsNative` will automatically mix
itself in to `Y.App`.
@class App.TransitionsNative
@extensionfor App
@since 3.5.0
**/
function AppTransitionsNative() {}
AppTransitionsNative.prototype = {
// -- Protected Properties -------------------------------------------------
/**
Whether this app is currently transitioning its `activeView`.
@property _transitioning
@type Boolean
@default false
@protected
@since 3.5.0
**/
/**
A queue that holds pending calls to this app's `_uiTransitionActiveView()`
method.
@property _viewTransitionQueue
@type Array
@default []
@protected
@since 3.5.0
**/
// -- Lifecycle Methods ----------------------------------------------------
initializer: function () {
this._transitioning = false;
this._viewTransitionQueue = [];
// TODO: Consider the AOP approach that `Plugin.WidgetAnim` uses.
Y.Do.before(this._queueActiveView, this, '_uiSetActiveView');
},
// -- Protected Methods ----------------------------------------------------
/**
Dequeues any pending calls to `_uiTransitionActiveView()`.
**Note:** When there is more than one queued transition, only the most
recent `activeView` change will be visually transitioned, while the others
will have their `transition` option overridden to `false`.
@method _dequeueActiveView
@protected
@since 3.5.0
**/
_dequeueActiveView: function () {
var queue = this._viewTransitionQueue,
transition = queue.shift(),
options;
if (transition) {
// When items are still left in the queue, override the transition
// so it does not run.
if (queue.length) {
// Overrides `transition` option and splices in the new options.
options = Y.merge(transition[2], {transition: false});
transition.splice(2, 1, options);
}
this._uiTransitionActiveView.apply(this, transition);
}
},
/**
Returns an object containing a named fx for both `viewIn` and `viewOut`
based on the relationship between the specified `newView` and `oldView`.
@method _getFx
@param {View} newView The view being transitioned-in.
@param {View} oldView The view being transitioned-out.
@param {String} [transition] The preferred transition to use.
@return {Object} An object containing a named fx for both `viewIn` and
`viewOut`.
@protected
@since 3.5.0
**/
_getFx: function (newView, oldView, transition) {
var fx = AppTransitions.FX,
transitions = this.get('transitions');
if (transition === false || !transitions) {
return null;
}
if (transition) {
return fx[transition];
}
if (this._isChildView(newView, oldView)) {
return fx[transitions.toChild];
}
if (this._isParentView(newView, oldView)) {
return fx[transitions.toParent];
}
return fx[transitions.navigate];
},
/**
Queues calls to `_uiTransitionActiveView()` to make sure a currently running
transition isn't interrupted.
**Note:** This method prevents the default `_uiSetActiveView()` method from
running.
@method _queueActiveView
@protected
@since 3.5.0
**/
_queueActiveView: function () {
var args = Y.Array(arguments, 0, true);
this._viewTransitionQueue.push(args);
if (!this._transitioning) {
this._dequeueActiveView();
}
return new Y.Do.Prevent();
},
/**
Performs the actual change of this app's `activeView` by visually
transitioning between the `newView` and `oldView` using any specified
`options`.
The `newView` is attached to the app by rendering it to the `viewContainer`,
and making this app a bubble target of its events.
The `oldView` is detached from the app by removing it from the
`viewContainer`, and removing this app as a bubble target for its events.
The `oldView` will either be preserved or properly destroyed.
**Note:** This method overrides `_uiSetActiveView()` and provides all of its
functionality plus supports visual transitions. Also, the `activeView`
attribute is read-only and can be changed by calling the `showView()`
method.
@method _uiTransitionActiveView
@param {View} newView The View which is now this app's `activeView`.
@param {View} [oldView] The View which was this app's `activeView`.
@param {Object} [options] Optional object containing any of the following
properties:
@param {Function} [options.callback] Optional callback function to call
after new `activeView` is ready to use, the function will be passed:
@param {View} options.callback.view A reference to the new
`activeView`.
@param {Boolean} [options.prepend=false] Whether the `view` should be
prepended instead of appended to the `viewContainer`.
@param {Boolean} [options.render] Whether the `view` should be rendered.
**Note:** If no value is specified, a view instance will only be
rendered if it's newly created by this method.
@param {Boolean|String} [options.transition] Optional transition override.
A transition can be specified which will override the default, or
`false` for no transition.
@param {Boolean} [options.update=false] Whether an existing view should
have its attributes updated by passing the `config` object to its
`setAttrs()` method. **Note:** This option does not have an effect if
the `view` instance is created as a result of calling this method.
@protected
@since 3.5.0
**/
_uiTransitionActiveView: function (newView, oldView, options) {
options || (options = {});
var callback = options.callback,
container, transitioning, isChild, isParent, prepend,
fx, fxConfig, transitions;
// Quits early when to new and old views are the same.
if (newView === oldView) {
callback && callback.call(this, newView);
this._transitioning = false;
return this._dequeueActiveView();
}
fx = this._getFx(newView, oldView, options.transition);
isChild = this._isChildView(newView, oldView);
isParent = !isChild && this._isParentView(newView, oldView);
prepend = !!options.prepend || isParent;
// Preforms simply attach/detach of the new and old view respectively
// when there's no transition to perform.
if (!fx) {
this._attachView(newView, prepend);
this._detachView(oldView);
callback && callback.call(this, newView);
this._transitioning = false;
return this._dequeueActiveView();
}
this._transitioning = true;
container = this.get('container');
transitioning = Y.App.CLASS_NAMES.transitioning;
container.addClass(transitioning);
this._attachView(newView, prepend);
// Called when view transitions completed, if none were added this will
// run right away.
function complete() {
this._detachView(oldView);
container.removeClass(transitioning);
callback && callback.call(this, newView);
this._transitioning = false;
return this._dequeueActiveView();
}
// Setup a new stack to run the view transitions in parallel.
transitions = new Y.Parallel({context: this});
fxConfig = {
crossView: !!oldView && !!newView,
prepended: prepend
};
// Transition the new view first to prevent a gap when sliding.
if (newView && fx.viewIn) {
newView.get('container')
.transition(fx.viewIn, fxConfig, transitions.add());
}
if (oldView && fx.viewOut) {
oldView.get('container')
.transition(fx.viewOut, fxConfig, transitions.add());
}
transitions.done(complete);
}
};
// -- Transition fx ------------------------------------------------------------
Y.mix(Y.Transition.fx, {
'app:fadeIn': {
opacity : 1,
duration: 0.3,
on: {
start: function (data) {
var styles = {opacity: 0},
config = data.config;
if (config.crossView && !config.prepended) {
styles.transform = 'translateX(-100%)';
}
this.setStyles(styles);
},
end: function () {
this.setStyle('transform', 'translateX(0)');
}
}
},
'app:fadeOut': {
opacity : 0,
duration: 0.3,
on: {
start: function (data) {
var styles = {opacity: 1},
config = data.config;
if (config.crossView && config.prepended) {
styles.transform = 'translateX(-100%)';
}
this.setStyles(styles);
},
end: function () {
this.setStyle('transform', 'translateX(0)');
}
}
},
'app:slideLeft': {
duration : 0.3,
transform: 'translateX(-100%)',
on: {
start: function () {
this.setStyles({
opacity : 1,
transform: 'translateX(0%)'
});
},
end: function () {
this.setStyle('transform', 'translateX(0)');
}
}
},
'app:slideRight': {
duration : 0.3,
transform: 'translateX(0)',
on: {
start: function () {
this.setStyles({
opacity : 1,
transform: 'translateX(-100%)'
});
},
end: function () {
this.setStyle('transform', 'translateX(0)');
}
}
}
});
// -- Namespacae ---------------------------------------------------------------
Y.App.TransitionsNative = AppTransitionsNative;
Y.Base.mix(Y.App, [AppTransitionsNative]);
}, '3.15.0', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});
| a8m/cdnjs | ajax/libs/yui/3.15.0/app-transitions-native/app-transitions-native.js | JavaScript | mit | 11,128 |
var mongoose = require('../../lib')
var Schema = mongoose.Schema;
console.log('Running mongoose version %s', mongoose.version);
/**
* Console schema
*/
var consoleSchema = Schema({
name: String
, manufacturer: String
, released: Date
})
var Console = mongoose.model('Console', consoleSchema);
/**
* Game schema
*/
var gameSchema = Schema({
name: String
, developer: String
, released: Date
, consoles: [{ type: Schema.Types.ObjectId, ref: 'Console' }]
})
var Game = mongoose.model('Game', gameSchema);
/**
* Connect to the console database on localhost with
* the default port (27017)
*/
mongoose.connect('mongodb://localhost/console', function (err) {
// if we failed to connect, abort
if (err) throw err;
// we connected ok
createData();
})
/**
* Data generation
*/
function createData () {
Console.create({
name: 'Nintendo 64'
, manufacturer: 'Nintendo'
, released: 'September 29, 1996'
}, function (err, nintendo64) {
if (err) return done(err);
Game.create({
name: 'Legend of Zelda: Ocarina of Time'
, developer: 'Nintendo'
, released: new Date('November 21, 1998')
, consoles: [nintendo64]
}, function (err) {
if (err) return done(err);
example();
})
})
}
/**
* Population
*/
function example () {
Game
.findOne({ name: /^Legend of Zelda/ })
.exec(function (err, ocinara) {
if (err) return done(err);
console.log('"%s" console _id: %s', ocinara.name, ocinara.consoles[0]);
// population of existing document
ocinara.populate('consoles', function (err) {
if (err) return done(err);
console.log(
'"%s" was released for the %s on %s'
, ocinara.name
, ocinara.consoles[0].name
, ocinara.released.toLocaleDateString());
done();
})
})
}
function done (err) {
if (err) console.error(err);
Console.remove(function () {
Game.remove(function () {
mongoose.disconnect();
})
})
}
| karan/node-slides | source/3-blog/node_modules/mongoose/examples/population/population-of-existing-doc.js | JavaScript | mit | 2,003 |
/*
YUI 3.15.0 (build 834026e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('datasource-xmlschema', function (Y, NAME) {
/**
* Extends DataSource with schema-parsing on XML data.
*
* @module datasource
* @submodule datasource-xmlschema
*/
/**
* Adds schema-parsing to the DataSource Utility.
* @class DataSourceXMLSchema
* @extends Plugin.Base
*/
var DataSourceXMLSchema = function() {
DataSourceXMLSchema.superclass.constructor.apply(this, arguments);
};
Y.mix(DataSourceXMLSchema, {
/**
* The namespace for the plugin. This will be the property on the host which
* references the plugin instance.
*
* @property NS
* @type String
* @static
* @final
* @value "schema"
*/
NS: "schema",
/**
* Class name.
*
* @property NAME
* @type String
* @static
* @final
* @value "dataSourceXMLSchema"
*/
NAME: "dataSourceXMLSchema",
/////////////////////////////////////////////////////////////////////////////
//
// DataSourceXMLSchema Attributes
//
/////////////////////////////////////////////////////////////////////////////
ATTRS: {
schema: {
//value: {}
}
}
});
Y.extend(DataSourceXMLSchema, Y.Plugin.Base, {
/**
* Internal init() handler.
*
* @method initializer
* @param config {Object} Config object.
* @private
*/
initializer: function(config) {
this.doBefore("_defDataFn", this._beforeDefDataFn);
},
/**
* Parses raw data into a normalized response.
*
* @method _beforeDefDataFn
* @param tId {Number} Unique transaction ID.
* @param request {Object} The request.
* @param callback {Object} The callback object with the following properties:
* <dl>
* <dt>success (Function)</dt> <dd>Success handler.</dd>
* <dt>failure (Function)</dt> <dd>Failure handler.</dd>
* </dl>
* @param data {Object} Raw data.
* @protected
*/
_beforeDefDataFn: function(e) {
var schema = this.get('schema'),
payload = e.details[0],
// TODO: Do I need to sniff for DS.IO + responseXML.nodeType 9?
data = Y.XML.parse(e.data.responseText) || e.data;
payload.response = Y.DataSchema.XML.apply.call(this, schema, data) || {
meta: {},
results: data
};
this.get("host").fire("response", payload);
return new Y.Do.Halt("DataSourceXMLSchema plugin halted _defDataFn");
}
});
Y.namespace('Plugin').DataSourceXMLSchema = DataSourceXMLSchema;
}, '3.15.0', {"requires": ["datasource-local", "plugin", "datatype-xml", "dataschema-xml"]});
| jimmybyrum/cdnjs | ajax/libs/yui/3.15.0/datasource-xmlschema/datasource-xmlschema.js | JavaScript | mit | 2,802 |
/*
YUI 3.15.0 (build 834026e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('cookie', function (Y, NAME) {
/**
* Utilities for cookie management
* @module cookie
*/
//shortcuts
var L = Y.Lang,
O = Y.Object,
NULL = null,
//shortcuts to functions
isString = L.isString,
isObject = L.isObject,
isUndefined = L.isUndefined,
isFunction = L.isFunction,
encode = encodeURIComponent,
decode = decodeURIComponent,
//shortcut to document
doc = Y.config.doc;
/*
* Throws an error message.
*/
function error(message){
throw new TypeError(message);
}
/*
* Checks the validity of a cookie name.
*/
function validateCookieName(name){
if (!isString(name) || name === ""){
error("Cookie name must be a non-empty string.");
}
}
/*
* Checks the validity of a subcookie name.
*/
function validateSubcookieName(subName){
if (!isString(subName) || subName === ""){
error("Subcookie name must be a non-empty string.");
}
}
/**
* Cookie utility.
* @class Cookie
* @static
*/
Y.Cookie = {
//-------------------------------------------------------------------------
// Private Methods
//-------------------------------------------------------------------------
/**
* Creates a cookie string that can be assigned into document.cookie.
* @param {String} name The name of the cookie.
* @param {String} value The value of the cookie.
* @param {Boolean} encodeValue True to encode the value, false to leave as-is.
* @param {Object} options (Optional) Options for the cookie.
* @return {String} The formatted cookie string.
* @method _createCookieString
* @private
* @static
*/
_createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {
options = options || {};
var text /*:String*/ = encode(name) + "=" + (encodeValue ? encode(value) : value),
expires = options.expires,
path = options.path,
domain = options.domain;
if (isObject(options)){
//expiration date
if (expires instanceof Date){
text += "; expires=" + expires.toUTCString();
}
//path
if (isString(path) && path !== ""){
text += "; path=" + path;
}
//domain
if (isString(domain) && domain !== ""){
text += "; domain=" + domain;
}
//secure
if (options.secure === true){
text += "; secure";
}
}
return text;
},
/**
* Formats a cookie value for an object containing multiple values.
* @param {Object} hash An object of key-value pairs to create a string for.
* @return {String} A string suitable for use as a cookie value.
* @method _createCookieHashString
* @private
* @static
*/
_createCookieHashString : function (hash /*:Object*/) /*:String*/ {
if (!isObject(hash)){
error("Cookie._createCookieHashString(): Argument must be an object.");
}
var text /*:Array*/ = [];
O.each(hash, function(value, key){
if (!isFunction(value) && !isUndefined(value)){
text.push(encode(key) + "=" + encode(String(value)));
}
});
return text.join("&");
},
/**
* Parses a cookie hash string into an object.
* @param {String} text The cookie hash string to parse (format: n1=v1&n2=v2).
* @return {Object} An object containing entries for each cookie value.
* @method _parseCookieHash
* @private
* @static
*/
_parseCookieHash : function (text) {
var hashParts = text.split("&"),
hashPart = NULL,
hash = {};
if (text.length){
for (var i=0, len=hashParts.length; i < len; i++){
hashPart = hashParts[i].split("=");
hash[decode(hashPart[0])] = decode(hashPart[1]);
}
}
return hash;
},
/**
* Parses a cookie string into an object representing all accessible cookies.
* @param {String} text The cookie string to parse.
* @param {Boolean} shouldDecode (Optional) Indicates if the cookie values should be decoded or not. Default is true.
* @param {Object} options (Optional) Contains settings for loading the cookie.
* @return {Object} An object containing entries for each accessible cookie.
* @method _parseCookieString
* @private
* @static
*/
_parseCookieString : function (text /*:String*/, shouldDecode /*:Boolean*/, options /*:Object*/) /*:Object*/ {
var cookies /*:Object*/ = {};
if (isString(text) && text.length > 0) {
var decodeValue = (shouldDecode === false ? function(s){return s;} : decode),
cookieParts = text.split(/;\s/g),
cookieName = NULL,
cookieValue = NULL,
cookieNameValue = NULL;
for (var i=0, len=cookieParts.length; i < len; i++){
//check for normally-formatted cookie (name-value)
cookieNameValue = cookieParts[i].match(/([^=]+)=/i);
if (cookieNameValue instanceof Array){
try {
cookieName = decode(cookieNameValue[1]);
cookieValue = decodeValue(cookieParts[i].substring(cookieNameValue[1].length+1));
} catch (ex){
//intentionally ignore the cookie - the encoding is wrong
}
} else {
//means the cookie does not have an "=", so treat it as a boolean flag
cookieName = decode(cookieParts[i]);
cookieValue = "";
}
// don't overwrite an already loaded cookie if set by option
if (!isUndefined(options) && options.reverseCookieLoading) {
if (isUndefined(cookies[cookieName])) {
cookies[cookieName] = cookieValue;
}
} else {
cookies[cookieName] = cookieValue;
}
}
}
return cookies;
},
/**
* Sets the document object that the cookie utility uses for setting
* cookies. This method is necessary to ensure that the cookie utility
* unit tests can pass even when run on a domain instead of locally.
* This method should not be used otherwise; you should use
* <code>Y.config.doc</code> to change the document that the cookie
* utility uses for everyday purposes.
* @param {Object} newDoc The object to use as the document.
* @method _setDoc
* @private
*/
_setDoc: function(newDoc){
doc = newDoc;
},
//-------------------------------------------------------------------------
// Public Methods
//-------------------------------------------------------------------------
/**
* Determines if the cookie with the given name exists. This is useful for
* Boolean cookies (those that do not follow the name=value convention).
* @param {String} name The name of the cookie to check.
* @return {Boolean} True if the cookie exists, false if not.
* @method exists
* @static
*/
exists: function(name) {
validateCookieName(name); //throws error
var cookies = this._parseCookieString(doc.cookie, true);
return cookies.hasOwnProperty(name);
},
/**
* Returns the cookie value for the given name.
* @param {String} name The name of the cookie to retrieve.
* @param {Function|Object} options (Optional) An object containing one or more
* cookie options: raw (true/false), reverseCookieLoading (true/false)
* and converter (a function).
* The converter function is run on the value before returning it. The
* function is not used if the cookie doesn't exist. The function can be
* passed instead of the options object for backwards compatibility. When
* raw is set to true, the cookie value is not URI decoded.
* @return {Any} If no converter is specified, returns a string or null if
* the cookie doesn't exist. If the converter is specified, returns the value
* returned from the converter or null if the cookie doesn't exist.
* @method get
* @static
*/
get : function (name, options) {
validateCookieName(name); //throws error
var cookies,
cookie,
converter;
//if options is a function, then it's the converter
if (isFunction(options)) {
converter = options;
options = {};
} else if (isObject(options)) {
converter = options.converter;
} else {
options = {};
}
cookies = this._parseCookieString(doc.cookie, !options.raw, options);
cookie = cookies[name];
//should return null, not undefined if the cookie doesn't exist
if (isUndefined(cookie)) {
return NULL;
}
if (!isFunction(converter)){
return cookie;
} else {
return converter(cookie);
}
},
/**
* Returns the value of a subcookie.
* @param {String} name The name of the cookie to retrieve.
* @param {String} subName The name of the subcookie to retrieve.
* @param {Function} converter (Optional) A function to run on the value before returning
* it. The function is not used if the cookie doesn't exist.
* @param {Object} options (Optional) Containing one or more settings for cookie parsing.
* @return {Any} If the cookie doesn't exist, null is returned. If the subcookie
* doesn't exist, null if also returned. If no converter is specified and the
* subcookie exists, a string is returned. If a converter is specified and the
* subcookie exists, the value returned from the converter is returned.
* @method getSub
* @static
*/
getSub : function (name /*:String*/, subName /*:String*/, converter /*:Function*/, options /*:Object*/) /*:Variant*/ {
var hash /*:Variant*/ = this.getSubs(name, options);
if (hash !== NULL) {
validateSubcookieName(subName); //throws error
if (isUndefined(hash[subName])){
return NULL;
}
if (!isFunction(converter)){
return hash[subName];
} else {
return converter(hash[subName]);
}
} else {
return NULL;
}
},
/**
* Returns an object containing name-value pairs stored in the cookie with the given name.
* @param {String} name The name of the cookie to retrieve.
* @param {Object} options (Optional) Containing one or more settings for cookie parsing.
* @return {Object} An object of name-value pairs if the cookie with the given name
* exists, null if it does not.
* @method getSubs
* @static
*/
getSubs : function (name /*:String*/, options /*:Object*/) {
validateCookieName(name); //throws error
var cookies = this._parseCookieString(doc.cookie, false, options);
if (isString(cookies[name])){
return this._parseCookieHash(cookies[name]);
}
return NULL;
},
/**
* Removes a cookie from the machine by setting its expiration date to
* sometime in the past.
* @param {String} name The name of the cookie to remove.
* @param {Object} options (Optional) An object containing one or more
* cookie options: path (a string), domain (a string),
* and secure (true/false). The expires option will be overwritten
* by the method.
* @return {String} The created cookie string.
* @method remove
* @static
*/
remove : function (name, options) {
validateCookieName(name); //throws error
//set options
options = Y.merge(options || {}, {
expires: new Date(0)
});
//set cookie
return this.set(name, "", options);
},
/**
* Removes a sub cookie with a given name.
* @param {String} name The name of the cookie in which the subcookie exists.
* @param {String} subName The name of the subcookie to remove.
* @param {Object} options (Optional) An object containing one or more
* cookie options: path (a string), domain (a string), expires (a Date object),
* removeIfEmpty (true/false), and secure (true/false). This must be the same
* settings as the original subcookie.
* @return {String} The created cookie string.
* @method removeSub
* @static
*/
removeSub : function(name, subName, options) {
validateCookieName(name); //throws error
validateSubcookieName(subName); //throws error
options = options || {};
//get all subcookies for this cookie
var subs = this.getSubs(name);
//delete the indicated subcookie
if (isObject(subs) && subs.hasOwnProperty(subName)){
delete subs[subName];
if (!options.removeIfEmpty) {
//reset the cookie
return this.setSubs(name, subs, options);
} else {
//reset the cookie if there are subcookies left, else remove
for (var key in subs){
if (subs.hasOwnProperty(key) && !isFunction(subs[key]) && !isUndefined(subs[key])){
return this.setSubs(name, subs, options);
}
}
return this.remove(name, options);
}
} else {
return "";
}
},
/**
* Sets a cookie with a given name and value.
* @param {String} name The name of the cookie to set.
* @param {Any} value The value to set for the cookie.
* @param {Object} options (Optional) An object containing one or more
* cookie options: path (a string), domain (a string), expires (a Date object),
* secure (true/false), and raw (true/false). Setting raw to true indicates
* that the cookie should not be URI encoded before being set.
* @return {String} The created cookie string.
* @method set
* @static
*/
set : function (name, value, options) {
validateCookieName(name); //throws error
if (isUndefined(value)){
error("Cookie.set(): Value cannot be undefined.");
}
options = options || {};
var text = this._createCookieString(name, value, !options.raw, options);
doc.cookie = text;
return text;
},
/**
* Sets a sub cookie with a given name to a particular value.
* @param {String} name The name of the cookie to set.
* @param {String} subName The name of the subcookie to set.
* @param {Any} value The value to set.
* @param {Object} options (Optional) An object containing one or more
* cookie options: path (a string), domain (a string), expires (a Date object),
* and secure (true/false).
* @return {String} The created cookie string.
* @method setSub
* @static
*/
setSub : function (name, subName, value, options) {
validateCookieName(name); //throws error
validateSubcookieName(subName); //throws error
if (isUndefined(value)){
error("Cookie.setSub(): Subcookie value cannot be undefined.");
}
var hash = this.getSubs(name);
if (!isObject(hash)){
hash = {};
}
hash[subName] = value;
return this.setSubs(name, hash, options);
},
/**
* Sets a cookie with a given name to contain a hash of name-value pairs.
* @param {String} name The name of the cookie to set.
* @param {Object} value An object containing name-value pairs.
* @param {Object} options (Optional) An object containing one or more
* cookie options: path (a string), domain (a string), expires (a Date object),
* and secure (true/false).
* @return {String} The created cookie string.
* @method setSubs
* @static
*/
setSubs : function (name, value, options) {
validateCookieName(name); //throws error
if (!isObject(value)){
error("Cookie.setSubs(): Cookie value must be an object.");
}
var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);
doc.cookie = text;
return text;
}
};
}, '3.15.0', {"requires": ["yui-base"]});
| whardier/cdnjs | ajax/libs/yui/3.15.0/cookie/cookie-debug.js | JavaScript | mit | 18,749 |
YUI.add('datatable-base', function(Y) {
var YLang = Y.Lang,
YisValue = YLang.isValue,
fromTemplate = Y.Lang.sub,
YNode = Y.Node,
Ycreate = YNode.create,
YgetClassName = Y.ClassNameManager.getClassName,
DATATABLE = "datatable",
COLUMN = "column",
FOCUS = "focus",
KEYDOWN = "keydown",
MOUSEENTER = "mouseenter",
MOUSELEAVE = "mouseleave",
MOUSEUP = "mouseup",
MOUSEDOWN = "mousedown",
CLICK = "click",
DBLCLICK = "dblclick",
CLASS_COLUMNS = YgetClassName(DATATABLE, "columns"),
CLASS_DATA = YgetClassName(DATATABLE, "data"),
CLASS_MSG = YgetClassName(DATATABLE, "msg"),
CLASS_LINER = YgetClassName(DATATABLE, "liner"),
CLASS_FIRST = YgetClassName(DATATABLE, "first"),
CLASS_LAST = YgetClassName(DATATABLE, "last"),
CLASS_EVEN = YgetClassName(DATATABLE, "even"),
CLASS_ODD = YgetClassName(DATATABLE, "odd"),
TEMPLATE_TABLE = '<table></table>',
TEMPLATE_COL = '<col></col>',
TEMPLATE_THEAD = '<thead class="'+CLASS_COLUMNS+'"></thead>',
TEMPLATE_TBODY = '<tbody class="'+CLASS_DATA+'"></tbody>',
TEMPLATE_TH = '<th id="{id}" rowspan="{rowspan}" colspan="{colspan}" class="{classnames}" abbr="{abbr}"><div class="'+CLASS_LINER+'">{value}</div></th>',
TEMPLATE_TR = '<tr id="{id}"></tr>',
TEMPLATE_TD = '<td headers="{headers}" class="{classnames}"><div class="'+CLASS_LINER+'">{value}</div></td>',
TEMPLATE_VALUE = '{value}',
TEMPLATE_MSG = '<tbody class="'+CLASS_MSG+'"></tbody>';
/**
* The Column class defines and manages attributes of Columns for DataTable.
*
* @class Column
* @extends Widget
* @constructor
*/
function Column(config) {
Column.superclass.constructor.apply(this, arguments);
}
/////////////////////////////////////////////////////////////////////////////
//
// STATIC PROPERTIES
//
/////////////////////////////////////////////////////////////////////////////
Y.mix(Column, {
/**
* Class name.
*
* @property NAME
* @type {String}
* @static
* @final
* @value "column"
*/
NAME: "column",
/////////////////////////////////////////////////////////////////////////////
//
// ATTRIBUTES
//
/////////////////////////////////////////////////////////////////////////////
ATTRS: {
/**
Unique internal identifier, used to stamp ID on TH element.
@attribute id
@type {String}
@readOnly
**/
id: {
valueFn: "_defaultId",
readOnly: true
},
/**
User-supplied identifier. Defaults to id.
@attribute key
@type {String}
**/
key: {
valueFn: "_defaultKey"
},
/**
Points to underlying data field (for sorting or formatting, for
example). Useful when column doesn't hold any data itself, but is just
a visual representation of data from another column or record field.
Defaults to key.
@attribute field
@type {String}
@default (column key)
**/
field: {
valueFn: "_defaultField"
},
/**
Display label for column header. Defaults to key.
@attribute label
@type {String}
**/
label: {
valueFn: "_defaultLabel"
},
/**
Array of child column definitions (for nested headers).
@attribute children
@type {String}
@default null
**/
children: {
value: null
},
/**
TH abbr attribute.
@attribute abbr
@type {String}
@default ""
**/
abbr: {
value: ""
},
//TODO: support custom classnames
// TH CSS classnames
classnames: {
readOnly: true,
getter: "_getClassnames"
},
/**
Formating template string or function for cells in this column.
Function formatters receive a single object (described below) and are
expected to output the `innerHTML` of the cell.
String templates can include markup and {placeholder} tokens to be
filled in from the object passed to function formatters.
@attribute formatter
@type {String|Function}
@param {Object} data Data relevant to the rendering of this cell
@param {String} data.classnames CSS classes to add to the cell
@param {Column} data.column This Column instance
@param {Object} data.data The raw object data from the Record
@param {String} data.field This Column's "field" attribute value
@param {String} data.headers TH ids to reference in the cell's
"headers" attribute
@param {Record} data.record The Record instance for this row
@param {Number} data.rowindex The index for this row
@param {Node} data.tbody The TBODY Node that will house the cell
@param {Node} data.tr The row TR Node that will house the cell
@param {Any} data.value The raw Record data for this cell
**/
formatter: {},
/**
The default markup to display in cells that have no corresponding record
data or content from formatters.
@attribute emptyCellValue
@type {String}
@default ''
**/
emptyCellValue: {
value: '',
validator: Y.Lang.isString
},
//requires datatable-sort
sortable: {
value: false
},
//sortOptions:defaultDir, sortFn, field
//TODO: support editable columns
// Column editor
editor: {},
//TODO: support resizeable columns
//TODO: support setting widths
// requires datatable-colresize
width: {},
resizeable: {},
minimized: {},
minWidth: {},
maxAutoWidth: {}
}
});
/////////////////////////////////////////////////////////////////////////////
//
// PROTOTYPE
//
/////////////////////////////////////////////////////////////////////////////
Y.extend(Column, Y.Widget, {
/////////////////////////////////////////////////////////////////////////////
//
// ATTRIBUTE HELPERS
//
/////////////////////////////////////////////////////////////////////////////
/**
* Return ID for instance.
*
* @method _defaultId
* @return {String}
* @private
*/
_defaultId: function() {
return Y.guid();
},
/**
* Return key for instance. Defaults to ID if one was not provided.
*
* @method _defaultKey
* @return {String}
* @private
*/
_defaultKey: function(key) {
return key || Y.guid();
},
/**
* Return field for instance. Defaults to key if one was not provided.
*
* @method _defaultField
* @return {String}
* @private
*/
_defaultField: function(field) {
return field || this.get("key");
},
/**
* Return label for instance. Defaults to key if one was not provided.
*
* @method _defaultLabel
* @return {String}
* @private
*/
_defaultLabel: function(label) {
return label || this.get("key");
},
/**
* Updates the UI if changes are made to abbr.
*
* @method _afterAbbrChange
* @param e {Event} Custom event for the attribute change.
* @private
*/
_afterAbbrChange: function (e) {
this._uiSetAbbr(e.newVal);
},
/////////////////////////////////////////////////////////////////////////////
//
// PROPERTIES
//
/////////////////////////////////////////////////////////////////////////////
/**
* Reference to Column's current position index within its Columnset's keys
* array, if applicable. This property only applies to non-nested and bottom-
* level child Columns. Value is set by Columnset code.
*
* @property keyIndex
* @type {Number}
*/
keyIndex: null,
/**
* Array of TH IDs associated with this column, for TD "headers" attribute.
* Value is set by Columnset code
*
* @property headers
* @type {String[]}
*/
headers: null,
/**
* Number of cells the header spans. Value is set by Columnset code.
*
* @property colSpan
* @type {Number}
* @default 1
*/
colSpan: 1,
/**
* Number of rows the header spans. Value is set by Columnset code.
*
* @property rowSpan
* @type {Number}
* @default 1
*/
rowSpan: 1,
/**
* Column's parent Column instance, if applicable. Value is set by Columnset
* code.
*
* @property parent
* @type {Column}
*/
parent: null,
/**
* The Node reference to the associated TH element.
*
* @property thNode
* @type {Node}
*/
thNode: null,
/*TODO
* The Node reference to the associated liner element.
*
* @property thLinerNode
* @type {Node}
thLinerNode: null,*/
/////////////////////////////////////////////////////////////////////////////
//
// METHODS
//
/////////////////////////////////////////////////////////////////////////////
/**
* Initializer.
*
* @method initializer
* @param config {Object} Config object.
* @private
*/
initializer: function(config) {
},
/**
* Destructor.
*
* @method destructor
* @private
*/
destructor: function() {
},
/**
* Returns classnames for Column.
*
* @method _getClassnames
* @private
*/
_getClassnames: function () {
return Y.ClassNameManager.getClassName(COLUMN, this.get("key").replace(/[^\w\-]/g,""));
},
////////////////////////////////////////////////////////////////////////////
//
// SYNC
//
////////////////////////////////////////////////////////////////////////////
/**
* Syncs UI to intial state.
*
* @method syncUI
* @private
*/
syncUI: function() {
this._uiSetAbbr(this.get("abbr"));
},
/**
* Updates abbr.
*
* @method _uiSetAbbr
* @param val {String} New abbr.
* @protected
*/
_uiSetAbbr: function(val) {
this.thNode.set("abbr", val);
}
});
Y.Column = Column;
/**
* The Columnset class defines and manages a collection of Columns.
*
* @class Columnset
* @extends Base
* @constructor
*/
function Columnset(config) {
Columnset.superclass.constructor.apply(this, arguments);
}
/////////////////////////////////////////////////////////////////////////////
//
// STATIC PROPERTIES
//
/////////////////////////////////////////////////////////////////////////////
Y.mix(Columnset, {
/**
* Class name.
*
* @property NAME
* @type String
* @static
* @final
* @value "columnset"
*/
NAME: "columnset",
/////////////////////////////////////////////////////////////////////////////
//
// ATTRIBUTES
//
/////////////////////////////////////////////////////////////////////////////
ATTRS: {
/**
* @attribute definitions
* @description Array of column definitions that will populate this Columnset.
* @type Array
*/
definitions: {
setter: "_setDefinitions"
}
}
});
/////////////////////////////////////////////////////////////////////////////
//
// PROTOTYPE
//
/////////////////////////////////////////////////////////////////////////////
Y.extend(Columnset, Y.Base, {
/////////////////////////////////////////////////////////////////////////////
//
// ATTRIBUTE HELPERS
//
/////////////////////////////////////////////////////////////////////////////
/**
* @method _setDefinitions
* @description Clones definitions before setting.
* @param definitions {Array} Array of column definitions.
* @return Array
* @private
*/
_setDefinitions: function(definitions) {
return Y.clone(definitions);
},
/////////////////////////////////////////////////////////////////////////////
//
// PROPERTIES
//
/////////////////////////////////////////////////////////////////////////////
/**
* Top-down tree representation of Column hierarchy. Used to create DOM
* elements.
*
* @property tree
* @type {Column[]}
*/
tree: null,
/**
* Hash of all Columns by ID.
*
* @property idHash
* @type Object
*/
idHash: null,
/**
* Hash of all Columns by key.
*
* @property keyHash
* @type Object
*/
keyHash: null,
/**
* Array of only Columns that are meant to be displayed in DOM.
*
* @property keys
* @type {Column[]}
*/
keys: null,
/////////////////////////////////////////////////////////////////////////////
//
// METHODS
//
/////////////////////////////////////////////////////////////////////////////
/**
* Initializer. Generates all internal representations of the collection of
* Columns.
*
* @method initializer
* @param config {Object} Config object.
* @private
*/
initializer: function() {
// DOM tree representation of all Columns
var tree = [],
// Hash of all Columns by ID
idHash = {},
// Hash of all Columns by key
keyHash = {},
// Flat representation of only Columns that are meant to display data
keys = [],
// Original definitions
definitions = this.get("definitions"),
self = this;
// Internal recursive function to define Column instances
function parseColumns(depth, currentDefinitions, parent) {
var i=0,
len = currentDefinitions.length,
currentDefinition,
column,
currentChildren;
// One level down
depth++;
// Create corresponding dom node if not already there for this depth
if(!tree[depth]) {
tree[depth] = [];
}
// Parse each node at this depth for attributes and any children
for(; i<len; ++i) {
currentDefinition = currentDefinitions[i];
currentDefinition = YLang.isString(currentDefinition) ? {key:currentDefinition} : currentDefinition;
// Instantiate a new Column for each node
column = new Y.Column(currentDefinition);
// Cross-reference Column ID back to the original object literal definition
currentDefinition.yuiColumnId = column.get("id");
// Add the new Column to the hash
idHash[column.get("id")] = column;
keyHash[column.get("key")] = column;
// Assign its parent as an attribute, if applicable
if(parent) {
column.parent = parent;
}
// The Column has descendants
if(YLang.isArray(currentDefinition.children)) {
currentChildren = currentDefinition.children;
column._set("children", currentChildren);
self._setColSpans(column, currentDefinition);
self._cascadePropertiesToChildren(column, currentChildren);
// The children themselves must also be parsed for Column instances
if(!tree[depth+1]) {
tree[depth+1] = [];
}
parseColumns(depth, currentChildren, column);
}
// This Column does not have any children
else {
column.keyIndex = keys.length;
// Default is already 1
//column.colSpan = 1;
keys.push(column);
}
// Add the Column to the top-down dom tree
tree[depth].push(column);
}
depth--;
}
// Parse out Column instances from the array of object literals
parseColumns(-1, definitions);
// Save to the Columnset instance
this.tree = tree;
this.idHash = idHash;
this.keyHash = keyHash;
this.keys = keys;
this._setRowSpans();
this._setHeaders();
},
/**
* Destructor.
*
* @method destructor
* @private
*/
destructor: function() {
},
/////////////////////////////////////////////////////////////////////////////
//
// COLUMN HELPERS
//
/////////////////////////////////////////////////////////////////////////////
/**
* Cascade certain properties to children if not defined on their own.
*
* @method _cascadePropertiesToChildren
* @private
*/
_cascadePropertiesToChildren: function(column, currentChildren) {
//TODO: this is all a giant todo
var i = 0,
len = currentChildren.length,
child;
// Cascade certain properties to children if not defined on their own
for(; i<len; ++i) {
child = currentChildren[i];
if(column.get("className") && (child.className === undefined)) {
child.className = column.get("className");
}
if(column.get("editor") && (child.editor === undefined)) {
child.editor = column.get("editor");
}
if(column.get("formatter") && (child.formatter === undefined)) {
child.formatter = column.get("formatter");
}
if(column.get("resizeable") && (child.resizeable === undefined)) {
child.resizeable = column.get("resizeable");
}
if(column.get("sortable") && (child.sortable === undefined)) {
child.sortable = column.get("sortable");
}
if(column.get("hidden")) {
child.hidden = true;
}
if(column.get("width") && (child.width === undefined)) {
child.width = column.get("width");
}
if(column.get("minWidth") && (child.minWidth === undefined)) {
child.minWidth = column.get("minWidth");
}
if(column.get("maxAutoWidth") && (child.maxAutoWidth === undefined)) {
child.maxAutoWidth = column.get("maxAutoWidth");
}
}
},
/**
* @method _setColSpans
* @description Calculates and sets colSpan attribute on given Column.
* @param column {Array} Column instance.
* @param definition {Object} Column definition.
* @private
*/
_setColSpans: function(column, definition) {
// Determine COLSPAN value for this Column
var terminalChildNodes = 0;
function countTerminalChildNodes(ancestor) {
var descendants = ancestor.children,
i = 0,
len = descendants.length;
// Drill down each branch and count terminal nodes
for(; i<len; ++i) {
// Keep drilling down
if(YLang.isArray(descendants[i].children)) {
countTerminalChildNodes(descendants[i]);
}
// Reached branch terminus
else {
terminalChildNodes++;
}
}
}
countTerminalChildNodes(definition);
column.colSpan = terminalChildNodes;
},
/**
* @method _setRowSpans
* @description Calculates and sets rowSpan attribute on all Columns.
* @private
*/
_setRowSpans: function() {
// Determine ROWSPAN value for each Column in the DOM tree
function parseDomTreeForRowSpan(tree) {
var maxRowDepth = 1,
currentRow,
currentColumn,
m,p;
// Calculate the max depth of descendants for this row
function countMaxRowDepth(row, tmpRowDepth) {
tmpRowDepth = tmpRowDepth || 1;
var i = 0,
len = row.length,
col;
for(; i<len; ++i) {
col = row[i];
// Column has children, so keep counting
if(YLang.isArray(col.children)) {
tmpRowDepth++;
countMaxRowDepth(col.children, tmpRowDepth);
tmpRowDepth--;
}
// Column has children, so keep counting
else if(col.get && YLang.isArray(col.get("children"))) {
tmpRowDepth++;
countMaxRowDepth(col.get("children"), tmpRowDepth);
tmpRowDepth--;
}
// No children, is it the max depth?
else {
if(tmpRowDepth > maxRowDepth) {
maxRowDepth = tmpRowDepth;
}
}
}
}
// Count max row depth for each row
for(m=0; m<tree.length; m++) {
currentRow = tree[m];
countMaxRowDepth(currentRow);
// Assign the right ROWSPAN values to each Column in the row
for(p=0; p<currentRow.length; p++) {
currentColumn = currentRow[p];
if(!YLang.isArray(currentColumn.get("children"))) {
currentColumn.rowSpan = maxRowDepth;
}
// Default is already 1
// else currentColumn.rowSpan =1;
}
// Reset counter for next row
maxRowDepth = 1;
}
}
parseDomTreeForRowSpan(this.tree);
},
/**
* @method _setHeaders
* @description Calculates and sets headers attribute on all Columns.
* @private
*/
_setHeaders: function() {
var headers, column,
allKeys = this.keys,
i=0, len = allKeys.length;
function recurseAncestorsForHeaders(headers, column) {
headers.push(column.get("id"));
if(column.parent) {
recurseAncestorsForHeaders(headers, column.parent);
}
}
for(; i<len; ++i) {
headers = [];
column = allKeys[i];
recurseAncestorsForHeaders(headers, column);
column.headers = headers.reverse().join(" ");
}
},
//TODO
getColumn: function() {
}
});
Y.Columnset = Columnset;
/**
* The DataTable widget provides a progressively enhanced DHTML control for
* displaying tabular data across A-grade browsers.
*
* @module datatable
* @main datatable
*/
/**
* Provides the base DataTable implementation, which can be extended to add
* additional functionality, such as sorting or scrolling.
*
* @module datatable
* @submodule datatable-base
*/
/**
* Base class for the DataTable widget.
* @class DataTable.Base
* @extends Widget
* @constructor
*/
function DTBase(config) {
DTBase.superclass.constructor.apply(this, arguments);
}
/////////////////////////////////////////////////////////////////////////////
//
// STATIC PROPERTIES
//
/////////////////////////////////////////////////////////////////////////////
Y.mix(DTBase, {
/**
* Class name.
*
* @property NAME
* @type String
* @static
* @final
* @value "dataTable"
*/
NAME: "dataTable",
/////////////////////////////////////////////////////////////////////////////
//
// ATTRIBUTES
//
/////////////////////////////////////////////////////////////////////////////
ATTRS: {
/**
* @attribute columnset
* @description Pointer to Columnset instance.
* @type Array | Y.Columnset
*/
columnset: {
setter: "_setColumnset"
},
/**
* @attribute recordset
* @description Pointer to Recordset instance.
* @type Array | Y.Recordset
*/
recordset: {
valueFn: '_initRecordset',
setter: "_setRecordset"
},
/*TODO
* @attribute state
* @description Internal state.
* @readonly
* @type
*/
/*state: {
value: new Y.State(),
readOnly: true
},*/
/**
* @attribute summary
* @description Summary.
* @type String
*/
summary: {
},
/**
* @attribute caption
* @description Caption
* @type String
*/
caption: {
},
/**
* @attribute thValueTemplate
* @description Tokenized markup template for TH value.
* @type String
* @default '{value}'
*/
thValueTemplate: {
value: TEMPLATE_VALUE
},
/**
* @attribute tdValueTemplate
* @description Tokenized markup template for TD value.
* @type String
* @default '{value}'
*/
tdValueTemplate: {
value: TEMPLATE_VALUE
},
/**
* @attribute trTemplate
* @description Tokenized markup template for TR node creation.
* @type String
* @default '<tr id="{id}"></tr>'
*/
trTemplate: {
value: TEMPLATE_TR
}
},
/////////////////////////////////////////////////////////////////////////////
//
// TODO: HTML_PARSER
//
/////////////////////////////////////////////////////////////////////////////
HTML_PARSER: {
/*caption: function (srcNode) {
}*/
}
});
/////////////////////////////////////////////////////////////////////////////
//
// PROTOTYPE
//
/////////////////////////////////////////////////////////////////////////////
Y.extend(DTBase, Y.Widget, {
/**
* @property thTemplate
* @description Tokenized markup template for TH node creation.
* @type String
* @default '<th id="{id}" rowspan="{rowspan}" colspan="{colspan}" class="{classnames}" abbr="{abbr}"><div class="'+CLASS_LINER+'">{value}</div></th>'
*/
thTemplate: TEMPLATE_TH,
/**
* @property tdTemplate
* @description Tokenized markup template for TD node creation.
* @type String
* @default '<td headers="{headers}" class="{classnames}"><div class="yui3-datatable-liner">{value}</div></td>'
*/
tdTemplate: TEMPLATE_TD,
/**
* @property _theadNode
* @description Pointer to THEAD node.
* @type {Node}
* @private
*/
_theadNode: null,
/**
* @property _tbodyNode
* @description Pointer to TBODY node.
* @type {Node}
* @private
*/
_tbodyNode: null,
/**
* @property _msgNode
* @description Pointer to message display node.
* @type {Node}
* @private
*/
_msgNode: null,
/////////////////////////////////////////////////////////////////////////////
//
// ATTRIBUTE HELPERS
//
/////////////////////////////////////////////////////////////////////////////
/**
* @method _setColumnset
* @description Converts Array to Y.Columnset.
* @param columns {Array | Y.Columnset}
* @return {Columnset}
* @private
*/
_setColumnset: function(columns) {
return YLang.isArray(columns) ? new Y.Columnset({definitions:columns}) : columns;
},
/**
* Updates the UI if Columnset is changed.
*
* @method _afterColumnsetChange
* @param e {Event} Custom event for the attribute change.
* @protected
*/
_afterColumnsetChange: function (e) {
this._uiSetColumnset(e.newVal);
},
/**
* @method _setRecordset
* @description Converts Array to Y.Recordset.
* @param records {Array | Recordset}
* @return {Recordset}
* @private
*/
_setRecordset: function(rs) {
if(YLang.isArray(rs)) {
rs = new Y.Recordset({records:rs});
}
rs.addTarget(this);
return rs;
},
/**
* Updates the UI if Recordset is changed.
*
* @method _afterRecordsetChange
* @param e {Event} Custom event for the attribute change.
* @protected
*/
_afterRecordsetChange: function (e) {
this._uiSetRecordset(e.newVal);
},
/**
* Updates the UI if Recordset records are changed.
*
* @method _afterRecordsChange
* @param e {Event} Custom event for the attribute change.
* @protected
*/
_afterRecordsChange: function (e) {
this._uiSetRecordset(this.get('recordset'));
},
/**
* Updates the UI if summary is changed.
*
* @method _afterSummaryChange
* @param e {Event} Custom event for the attribute change.
* @protected
*/
_afterSummaryChange: function (e) {
this._uiSetSummary(e.newVal);
},
/**
* Updates the UI if caption is changed.
*
* @method _afterCaptionChange
* @param e {Event} Custom event for the attribute change.
* @protected
*/
_afterCaptionChange: function (e) {
this._uiSetCaption(e.newVal);
},
////////////////////////////////////////////////////////////////////////////
//
// METHODS
//
////////////////////////////////////////////////////////////////////////////
/**
* Destructor.
*
* @method destructor
* @private
*/
destructor: function() {
this.get("recordset").removeTarget(this);
},
////////////////////////////////////////////////////////////////////////////
//
// RENDER
//
////////////////////////////////////////////////////////////////////////////
/**
* Renders UI.
*
* @method renderUI
* @private
*/
renderUI: function() {
// TABLE
this._addTableNode(this.get("contentBox"));
// COLGROUP
this._addColgroupNode(this._tableNode);
// THEAD
this._addTheadNode(this._tableNode);
// Primary TBODY
this._addTbodyNode(this._tableNode);
// Message TBODY
this._addMessageNode(this._tableNode);
// CAPTION
this._addCaptionNode(this._tableNode);
},
/**
* Creates and attaches TABLE element to given container.
*
* @method _addTableNode
* @param containerNode {Node} Parent node.
* @protected
* @return {Node}
*/
_addTableNode: function(containerNode) {
if (!this._tableNode) {
this._tableNode = containerNode.appendChild(Ycreate(TEMPLATE_TABLE));
}
return this._tableNode;
},
/**
* Creates and attaches COLGROUP element to given TABLE.
*
* @method _addColgroupNode
* @param tableNode {Node} Parent node.
* @protected
* @return {Node}
*/
_addColgroupNode: function(tableNode) {
// Add COLs to DOCUMENT FRAGMENT
var len = this.get("columnset").keys.length,
i = 0,
allCols = ["<colgroup>"];
for(; i<len; ++i) {
allCols.push(TEMPLATE_COL);
}
allCols.push("</colgroup>");
// Create COLGROUP
this._colgroupNode = tableNode.insertBefore(Ycreate(allCols.join("")), tableNode.get("firstChild"));
return this._colgroupNode;
},
/**
* Creates and attaches THEAD element to given container.
*
* @method _addTheadNode
* @param tableNode {Node} Parent node.
* @protected
* @return {Node}
*/
_addTheadNode: function(tableNode) {
if(tableNode) {
this._theadNode = tableNode.insertBefore(Ycreate(TEMPLATE_THEAD), this._colgroupNode.next());
return this._theadNode;
}
},
/**
* Creates and attaches TBODY element to given container.
*
* @method _addTbodyNode
* @param tableNode {Node} Parent node.
* @protected
* @return {Node}
*/
_addTbodyNode: function(tableNode) {
this._tbodyNode = tableNode.appendChild(Ycreate(TEMPLATE_TBODY));
return this._tbodyNode;
},
/**
* Creates and attaches message display element to given container.
*
* @method _addMessageNode
* @param tableNode {Node} Parent node.
* @protected
* @return {Node}
*/
_addMessageNode: function(tableNode) {
this._msgNode = tableNode.insertBefore(Ycreate(TEMPLATE_MSG), this._tbodyNode);
return this._msgNode;
},
/**
* Creates and attaches CAPTION element to given container.
*
* @method _addCaptionNode
* @param tableNode {Node} Parent node.
* @protected
* @return {Node}
*/
_addCaptionNode: function(tableNode) {
this._captionNode = Y.Node.create('<caption></caption>');
},
////////////////////////////////////////////////////////////////////////////
//
// BIND
//
////////////////////////////////////////////////////////////////////////////
/**
* Binds events.
*
* @method bindUI
* @private
*/
bindUI: function() {
this.after({
columnsetChange: this._afterColumnsetChange,
summaryChange : this._afterSummaryChange,
captionChange : this._afterCaptionChange,
recordsetChange: this._afterRecordsChange,
"recordset:tableChange": this._afterRecordsChange
});
},
delegate: function(type) {
//TODO: is this necessary?
if(type==="dblclick") {
this.get("boundingBox").delegate.apply(this.get("boundingBox"), arguments);
}
else {
this.get("contentBox").delegate.apply(this.get("contentBox"), arguments);
}
},
////////////////////////////////////////////////////////////////////////////
//
// SYNC
//
////////////////////////////////////////////////////////////////////////////
/**
* Syncs UI to intial state.
*
* @method syncUI
* @private
*/
syncUI: function() {
// THEAD ROWS
this._uiSetColumnset(this.get("columnset"));
// DATA ROWS
this._uiSetRecordset(this.get("recordset"));
// SUMMARY
this._uiSetSummary(this.get("summary"));
// CAPTION
this._uiSetCaption(this.get("caption"));
},
/**
* Updates summary.
*
* @method _uiSetSummary
* @param val {String} New summary.
* @protected
*/
_uiSetSummary: function(val) {
val = YisValue(val) ? val : "";
this._tableNode.set("summary", val);
},
/**
* Updates caption.
*
* @method _uiSetCaption
* @param val {String} New caption.
* @protected
*/
_uiSetCaption: function(val) {
var caption = this._captionNode,
inDoc = caption.inDoc(),
method = val ? (!inDoc && 'prepend') : (inDoc && 'removeChild');
caption.setContent(val || '');
if (method) {
// prepend of remove necessary
this._tableNode[method](caption);
}
},
////////////////////////////////////////////////////////////////////////////
//
// THEAD/COLUMNSET FUNCTIONALITY
//
////////////////////////////////////////////////////////////////////////////
/**
* Updates THEAD.
*
* @method _uiSetColumnset
* @param cs {Columnset} New Columnset.
* @protected
*/
_uiSetColumnset: function(cs) {
var tree = cs.tree,
thead = this._theadNode,
i = 0,
len = tree.length,
parent = thead.get("parentNode"),
nextSibling = thead.next();
// Move THEAD off DOM
thead.remove();
thead.get("children").remove(true);
// Iterate tree of columns to add THEAD rows
for(; i<len; ++i) {
this._addTheadTrNode({
thead: thead,
columns: tree[i],
id : '' // to avoid {id} leftovers from the trTemplate
}, (i === 0), (i === len - 1));
}
// Column helpers needs _theadNode to exist
//this._createColumnHelpers();
// Re-attach THEAD to DOM
parent.insert(thead, nextSibling);
},
/**
* Creates and attaches header row element.
*
* @method _addTheadTrNode
* @param o {Object} {thead, columns}.
* @param isFirst {Boolean} Is first row.
* @param isFirst {Boolean} Is last row.
* @protected
*/
_addTheadTrNode: function(o, isFirst, isLast) {
o.tr = this._createTheadTrNode(o, isFirst, isLast);
this._attachTheadTrNode(o);
},
/**
* Creates header row element.
*
* @method _createTheadTrNode
* @param o {Object} {thead, columns}.
* @param isFirst {Boolean} Is first row.
* @param isLast {Boolean} Is last row.
* @protected
* @return {Node}
*/
_createTheadTrNode: function(o, isFirst, isLast) {
//TODO: custom classnames
var tr = Ycreate(fromTemplate(this.get("trTemplate"), o)),
i = 0,
columns = o.columns,
len = columns.length,
column;
// Set FIRST/LAST class
if(isFirst) {
tr.addClass(CLASS_FIRST);
}
if(isLast) {
tr.addClass(CLASS_LAST);
}
for(; i<len; ++i) {
column = columns[i];
this._addTheadThNode({value:column.get("label"), column: column, tr:tr});
}
return tr;
},
/**
* Attaches header row element.
*
* @method _attachTheadTrNode
* @param o {Object} {thead, columns, tr}.
* @protected
*/
_attachTheadTrNode: function(o) {
o.thead.appendChild(o.tr);
},
/**
* Creates and attaches header cell element.
*
* @method _addTheadThNode
* @param o {Object} {value, column, tr}.
* @protected
*/
_addTheadThNode: function(o) {
o.th = this._createTheadThNode(o);
this._attachTheadThNode(o);
//TODO: assign all node pointers: thNode, thLinerNode, thLabelNode
o.column.thNode = o.th;
},
/**
* Creates header cell element.
*
* @method _createTheadThNode
* @param o {Object} {value, column, tr}.
* @protected
* @return {Node}
*/
_createTheadThNode: function(o) {
var column = o.column;
// Populate template object
o.id = column.get("id");//TODO: validate 1 column ID per document
o.colspan = column.colSpan;
o.rowspan = column.rowSpan;
o.abbr = column.get("abbr");
o.classnames = column.get("classnames");
o.value = fromTemplate(this.get("thValueTemplate"), o);
/*TODO
// Clear minWidth on hidden Columns
if(column.get("hidden")) {
//this._clearMinWidth(column);
}
*/
return Ycreate(fromTemplate(this.thTemplate, o));
},
/**
* Attaches header cell element.
*
* @method _attachTheadThNode
* @param o {Object} {value, column, tr}.
* @protected
*/
_attachTheadThNode: function(o) {
o.tr.appendChild(o.th);
},
////////////////////////////////////////////////////////////////////////////
//
// TBODY/RECORDSET FUNCTIONALITY
//
////////////////////////////////////////////////////////////////////////////
/**
* Updates TBODY.
*
* @method _uiSetRecordset
* @param rs {Recordset} New Recordset.
* @protected
*/
_uiSetRecordset: function(rs) {
var self = this,
oldTbody = this._tbodyNode,
parent = oldTbody.get("parentNode"),
nextSibling = oldTbody.next(),
columns = this.get('columnset').keys,
cellValueTemplate = this.get('tdValueTemplate'),
o = {},
newTbody, i, len, column, formatter;
// Replace TBODY with a new one
//TODO: split _addTbodyNode into create/attach
oldTbody.remove();
oldTbody = null;
newTbody = this._addTbodyNode(this._tableNode);
newTbody.remove();
this._tbodyNode = newTbody;
o.tbody = newTbody;
o.rowTemplate = this.get('trTemplate');
o.columns = [];
// Build up column data to avoid passing through Attribute APIs inside
// render loops for rows and cells
for (i = columns.length - 1; i >= 0; --i) {
column = columns[i];
o.columns[i] = {
column : column,
fields : column.get('field'),
classnames : column.get('classnames'),
emptyCellValue: column.get('emptyCellValue')
}
formatter = column.get('formatter');
if (YLang.isFunction(formatter)) {
// function formatters need to run before checking if the value
// needs defaulting from column.emptyCellValue
formatter = Y.bind(this._functionFormatter, this, formatter);
} else {
if (!YLang.isString(formatter)) {
formatter = cellValueTemplate;
}
// string formatters need the value defaulted before processing
formatter = Y.bind(this._templateFormatter, this, formatter);
}
o.columns[i].formatter = formatter;
}
// Iterate Recordset to use existing TR when possible or add new TR
// TODO i = this.get("state.offsetIndex")
// TODO len =this.get("state.pageLength")
for (i = 0, len = rs.size(); i < len; ++i) {
o.record = rs.item(i);
o.data = o.record.get("data");
o.rowindex = i;
this._addTbodyTrNode(o); //TODO: sometimes rowindex != recordindex
}
// TBODY to DOM
parent.insert(this._tbodyNode, nextSibling);
},
_functionFormatter: function (formatter, o) {
var value = formatter.call(this, o);
return (value !== undefined) ? value : o.emptyCellValue;
},
_templateFormatter: function (template, o) {
if (o.value === undefined) {
o.value = o.emptyCellValue;
}
return fromTemplate(template, o);
},
/**
* Creates and attaches data row element.
*
* @method _addTbodyTrNode
* @param o {Object} {tbody, record}
* @protected
*/
_addTbodyTrNode: function(o) {
var row = o.tbody.one("#" + o.record.get("id"));
o.tr = row || this._createTbodyTrNode(o);
this._attachTbodyTrNode(o);
},
/**
* Creates data row element.
*
* @method _createTbodyTrNode
* @param o {Object} {tbody, record}
* @protected
* @return {Node}
*/
_createTbodyTrNode: function(o) {
var columns = o.columns,
i, len, columnInfo;
o.tr = Ycreate(fromTemplate(o.rowTemplate, { id: o.record.get('id') }));
for (i = 0, len = columns.length; i < len; ++i) {
columnInfo = columns[i];
o.column = columnInfo.column;
o.field = columnInfo.fields;
o.classnames = columnInfo.classnames;
o.formatter = columnInfo.formatter;
o.emptyCellValue= columnInfo.emptyCellValue;
this._addTbodyTdNode(o);
}
return o.tr;
},
/**
* Attaches data row element.
*
* @method _attachTbodyTrNode
* @param o {Object} {tbody, record, tr}.
* @protected
*/
_attachTbodyTrNode: function(o) {
var tbody = o.tbody,
tr = o.tr,
index = o.rowindex,
nextSibling = tbody.get("children").item(index) || null,
isOdd = (index % 2);
if(isOdd) {
tr.replaceClass(CLASS_EVEN, CLASS_ODD);
} else {
tr.replaceClass(CLASS_ODD, CLASS_EVEN);
}
tbody.insertBefore(tr, nextSibling);
},
/**
* Creates and attaches data cell element.
*
* @method _addTbodyTdNode
* @param o {Object} {record, column, tr}.
* @protected
*/
_addTbodyTdNode: function(o) {
o.td = this._createTbodyTdNode(o);
this._attachTbodyTdNode(o);
delete o.td;
},
/**
Creates a TD Node from the tdTemplate property using the input object as
template {placeholder} values. The created Node is also assigned to the
`td` property on the input object.
If the input object already has a `td` property, it is returned an no new
Node is created.
@method createCell
@param {Object} data Template values
@return {Node}
**/
createCell: function (data) {
return data && (data.td ||
(data.td = Ycreate(fromTemplate(this.tdTemplate, data))));
},
/**
* Creates data cell element.
*
* @method _createTbodyTdNode
* @param o {Object} {record, column, tr}.
* @protected
* @return {Node}
*/
_createTbodyTdNode: function(o) {
o.headers = o.column.headers;
o.value = this.formatDataCell(o);
return o.td || this.createCell(o);
},
/**
* Attaches data cell element.
*
* @method _attachTbodyTdNode
* @param o {Object} {record, column, tr, headers, classnames, value}.
* @protected
*/
_attachTbodyTdNode: function(o) {
o.tr.appendChild(o.td);
},
/**
* Returns markup to insert into data cell element.
*
* @method formatDataCell
* @param @param o {Object} {record, column, tr, headers, classnames}.
*/
formatDataCell: function (o) {
o.value = o.data[o.field];
return o.formatter.call(this, o);
},
_initRecordset: function () {
return new Y.Recordset({ records: [] });
}
});
Y.namespace("DataTable").Base = DTBase;
}, '@VERSION@' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});
| AMoo-Miki/cdnjs | ajax/libs/yui/3.4.1/datatable-base/datatable-base.js | JavaScript | mit | 46,483 |
YUI.add("uploader",function(e){var b=e.Event,c=e.Node;var a=e.Env.cdn+"uploader/assets/uploader.swf";function d(f){d.superclass.constructor.apply(this,arguments);if(f.hasOwnProperty("boundingBox")){this.set("boundingBox",f.boundingBox);}if(f.hasOwnProperty("buttonSkin")){this.set("buttonSkin",f.buttonSkin);}if(f.hasOwnProperty("transparent")){this.set("transparent",f.transparent);}if(f.hasOwnProperty("swfURL")){this.set("swfURL",f.swfURL);}}e.extend(d,e.Base,{uploaderswf:null,_id:"",initializer:function(){this._id=e.guid("uploader");var f=c.one(this.get("boundingBox"));var i={version:"10.0.45",fixedAttributes:{allowScriptAccess:"always",allowNetworking:"all",scale:"noscale"},flashVars:{}};if(this.get("buttonSkin")!=""){i.flashVars["buttonSkin"]=this.get("buttonSkin");}if(this.get("transparent")){i.fixedAttributes["wmode"]="transparent";}this.uploaderswf=new e.SWF(f,this.get("swfURL"),i);var h=this.uploaderswf;var g=e.bind(this._relayEvent,this);h.on("swfReady",e.bind(this._initializeUploader,this));h.on("click",g);h.on("fileselect",g);h.on("mousedown",g);h.on("mouseup",g);h.on("mouseleave",g);h.on("mouseenter",g);h.on("uploadcancel",g);h.on("uploadcomplete",g);h.on("uploadcompletedata",g);h.on("uploaderror",g);h.on("uploadprogress",g);h.on("uploadstart",g);},removeFile:function(f){return this.uploaderswf.callSWF("removeFile",[f]);},clearFileList:function(){return this.uploaderswf.callSWF("clearFileList",[]);},upload:function(f,h,j,g,i){if(e.Lang.isArray(f)){return this.uploaderswf.callSWF("uploadThese",[f,h,j,g,i]);}else{if(e.Lang.isString(f)){return this.uploaderswf.callSWF("upload",[f,h,j,g,i]);}}},uploadThese:function(h,g,j,f,i){return this.uploaderswf.callSWF("uploadThese",[h,g,j,f,i]);},uploadAll:function(g,i,f,h){return this.uploaderswf.callSWF("uploadAll",[g,i,f,h]);},cancel:function(f){return this.uploaderswf.callSWF("cancel",[f]);},setAllowLogging:function(f){this.uploaderswf.callSWF("setAllowLogging",[f]);},setAllowMultipleFiles:function(f){this.uploaderswf.callSWF("setAllowMultipleFiles",[f]);},setSimUploadLimit:function(f){this.uploaderswf.callSWF("setSimUploadLimit",[f]);},setFileFilters:function(f){this.uploaderswf.callSWF("setFileFilters",[f]);},enable:function(){this.uploaderswf.callSWF("enable");},disable:function(){this.uploaderswf.callSWF("disable");},_initializeUploader:function(f){this.publish("uploaderReady",{fireOnce:true});this.fire("uploaderReady",{});},_relayEvent:function(f){this.fire(f.type,f);},toString:function(){return"Uploader "+this._id;}},{ATTRS:{log:{value:false,setter:"setAllowLogging"},multiFiles:{value:false,setter:"setAllowMultipleFiles"},simLimit:{value:2,setter:"setSimUploadLimit"},fileFilters:{value:[],setter:"setFileFilters"},boundingBox:{value:null,writeOnce:"initOnly"},buttonSkin:{value:null,writeOnce:"initOnly"},transparent:{value:true,writeOnce:"initOnly"},swfURL:{value:a,writeOnce:"initOnly"}}});e.Uploader=d;},"@VERSION@",{requires:["swf","base","node","event-custom"]}); | froala/cdnjs | ajax/libs/yui/3.4.1/uploader/uploader-min.js | JavaScript | mit | 2,971 |
/**
* Sortable lists
* @module Ink.UI.SortableList_1
* @version 1
*/
Ink.createModule('Ink.UI.SortableList', '1', ['Ink.UI.Common_1','Ink.Dom.Css_1','Ink.Dom.Event_1','Ink.Dom.Element_1','Ink.Dom.Selector_1'], function( Common, Css, Events, Element, Selector ) {
'use strict';
var hasTouch = (('ontouchstart' in window) || // html5 browsers
(navigator.maxTouchPoints > 0) || // future IE
(navigator.msMaxTouchPoints > 0));
/**
* Adds sortable behaviour to any list.
*
* @class Ink.UI.SortableList
* @constructor
* @version 1
* @param {String|Element} selector The list you wish to be sortable.
* @param {String} [options.placeholderClass] CSS class added to the "ghost" element being dragged around. Defaults to 'placeholder'.
* @param {String} [options.draggedClass] CSS class added to the original element being dragged around. Defaults to 'hide-all'.
* @param {String} [options.draggingClass] CSS class added to the html element when the user is dragging. Defaults to 'dragging'.
* @param {String} [options.dragSelector] CSS selector for the drag enabled nodes. Defaults to 'li'.
* @param {String} [options.handleSelector] CSS selector for the drag handle. If present, you can only drag nodes by this selector.
* @param {String} [options.moveSelector] CSS selector to validate a node move. If present, you can only move nodes inside this selector.
* @param {Boolean} [options.swap] Flag to swap dragged element and target element instead of reordering it.
* @param {Boolean} [options.cancelMouseOut] Flag to cancel draggin if mouse leaves the container element.
* @param {Function} [options.onDrop] Callback to be executed after dropping an element. Receives { droppedElement: Element } as an argument.
*
* @sample Ink_UI_SortableList_1.html
*/
function SortableList() {
Common.BaseUIComponent.apply(this, arguments);
}
SortableList._name = 'SortableList_1';
SortableList._optionDefinition = {
'placeholderClass': ['String', 'placeholder'],
'draggedClass': ['String', 'hide-all'],
'draggingClass': ['String', 'dragging'],
'dragSelector': ['String', '> li'],
'handleSelector': ['String', ':not(button, button *, a[href], a[href] *)'],
'moveSelector': ['String', false],
'swap': ['Boolean', false],
'cancelMouseOut': ['Boolean', false],
'onDrop': ['Function', function(){}]
};
SortableList.prototype = {
/**
* Init function called by the constructor.
*
* @method _init
* @private
*/
_init: function() {
this._handlers = {
down: Ink.bind(this._onDown, this),
move: Ink.bind(this._onMove, this),
up: Ink.bind(this._onUp, this)
};
this._isMoving = false;
this._down = hasTouch ? 'touchstart mousedown' : 'mousedown';
this._move = hasTouch ? 'touchmove mousemove' : 'mousemove';
this._up = hasTouch ? 'touchend mouseup' : 'mouseup';
this._observe();
},
/**
* Sets the event handlers.
*
* @method _observe
* @private
*/
_observe: function() {
Events.on(this._element, this._down, this._options.dragSelector, this._handlers.down);
Events.on(this._element, this._move, this._options.dragSelector, this._handlers.move);
if(this._options.cancelMouseOut) {
Events.on(this._element, 'mouseleave', Ink.bind(this.stopMoving, this));
}
Events.on(document.documentElement, this._up, this._handlers.up);
},
/**
* Mousedown or touchstart handler
*
* @method _onDown
* @param {Event} ev
* @private
*/
_onDown: function(ev) {
if (this._isMoving || this._placeholder) { return; }
if(this._options.handleSelector && !Selector.matchesSelector(ev.target, this._options.handleSelector)) { return; }
var tgtEl = ev.currentTarget;
this._isMoving = tgtEl;
this._placeholder = tgtEl.cloneNode(true);
this._movePlaceholder(tgtEl);
this._addMovingClasses();
return false;
},
/**
* Mousemove or touchmove handler
*
* @method _onMove
* @param {Event} ev
* @private
*/
_onMove: function(ev) {
var target = ev.currentTarget;
// Touch events give you the element where the finger touched first,
// not the element under it like mouse events.
if (ev.type === 'touchmove') {
var touch = ev.touches[0];
target = document.elementFromPoint(touch.clientX, touch.clientY);
target = Element.findUpwardsBySelector(target, this._options.dragSelector);
}
this.validateMove(target);
ev.preventDefault();
},
/**
* Mouseup or touchend handler
*
* @method _onUp
* @param {Event} ev
* @private
*/
_onUp: function(ev) {
if (!this._isMoving || !this._placeholder) { return; }
if (ev.currentTarget === this._isMoving) { return; }
if (ev.currentTarget === this._placeholder) { return; }
Element.insertBefore(this._isMoving, this._placeholder);
this.stopMoving();
this._options.onDrop.call(this, { droppedElement: ev.currentTarget });
return false;
},
/**
* Adds the CSS classes to interactive elements
*
* @method _addMovingClasses
* @private
*/
_addMovingClasses: function(){
Css.addClassName(this._placeholder, this._options.placeholderClass);
Css.addClassName(this._isMoving, this._options.draggedClass);
Css.addClassName(document.documentElement, this._options.draggingClass);
},
/**
* Removes the CSS classes from interactive elements
*
* @method _removeMovingClasses
* @private
*/
_removeMovingClasses: function(){
if(this._isMoving) { Css.removeClassName(this._isMoving, this._options.draggedClass); }
if(this._placeholder) { Css.removeClassName(this._placeholder, this._options.placeholderClass); }
Css.removeClassName(document.documentElement, this._options.draggingClass);
},
/**
* Moves the placeholder element relative to the target element
*
* @method _movePlaceholder
* @param {Element} target_position
* @private
*/
_movePlaceholder: function(target){
var placeholder = this._placeholder,
target_position,
placeholder_position,
from_top,
from_left;
if(!placeholder) {
Element.insertAfter(placeholder, target);
} else if(this._options.swap){
Element.insertAfter(placeholder, target);
Element.insertBefore(target, this._isMoving);
Element.insertBefore(this._isMoving, placeholder);
} else {
target_position = Element.offset(target);
placeholder_position = Element.offset(this._placeholder);
from_top = target_position[1] > placeholder_position[1];
from_left = target_position[0] > placeholder_position[0];
if( ( from_top && from_left ) || ( !from_top && !from_left ) ) {
Element.insertBefore(placeholder, target);
} else {
Element.insertAfter(placeholder, target);
}
Element.insertBefore(this._isMoving, placeholder);
}
},
/**************
* PUBLIC API *
**************/
/**
* Unregisters the component and removes its markup
*
* @method destroy
* @public
*/
destroy: Common.destroyComponent,
/**
* Visually stops moving.
* Removes the placeholder as well as the styling classes.
*
* @method _movePlaceholder
* @public
*/
stopMoving: function(){
this._removeMovingClasses();
Element.remove(this._placeholder);
this._placeholder = false;
this._isMoving = false;
},
/**
* Validate a move.
* This method is used by the move handler
*
* @method _movePlaceholder
* @param {Element} elem
* @public
*/
validateMove: function(elem){
if (!elem || !this._isMoving || !this._placeholder) { return; }
if (elem === this._placeholder) { return; }
if (elem === this._isMoving) { return; }
if(!this._options.moveSelector || Selector.matchesSelector(elem, this._options.moveSelector)){
this._movePlaceholder(elem);
} else {
this.stopMoving();
}
}
};
Common.createUIComponent(SortableList);
return SortableList;
});
| alexmojaki/jsdelivr | files/ink/3.1.2/js/ink.sortablelist.js | JavaScript | mit | 9,776 |
YUI.add('datatable-sort', function (Y, NAME) {
/**
Adds support for sorting the table data by API methods `table.sort(...)` or
`table.toggleSort(...)` or by clicking on column headers in the rendered UI.
@module datatable
@submodule datatable-sort
@since 3.5.0
**/
var YLang = Y.Lang,
isBoolean = YLang.isBoolean,
isString = YLang.isString,
isArray = YLang.isArray,
isObject = YLang.isObject,
toArray = Y.Array,
sub = YLang.sub,
dirMap = {
asc : 1,
desc: -1,
"1" : 1,
"-1": -1
};
/**
_API docs for this extension are included in the DataTable class._
This DataTable class extension adds support for sorting the table data by API
methods `table.sort(...)` or `table.toggleSort(...)` or by clicking on column
headers in the rendered UI.
Sorting by the API is enabled automatically when this module is `use()`d. To
enable UI triggered sorting, set the DataTable's `sortable` attribute to
`true`.
<pre><code>
var table = new Y.DataTable({
columns: [ 'id', 'username', 'name', 'birthdate' ],
data: [ ... ],
sortable: true
});
table.render('#table');
</code></pre>
Setting `sortable` to `true` will enable UI sorting for all columns. To enable
UI sorting for certain columns only, set `sortable` to an array of column keys,
or just add `sortable: true` to the respective column configuration objects.
This uses the default setting of `sortable: auto` for the DataTable instance.
<pre><code>
var table = new Y.DataTable({
columns: [
'id',
{ key: 'username', sortable: true },
{ key: 'name', sortable: true },
{ key: 'birthdate', sortable: true }
],
data: [ ... ]
// sortable: 'auto' is the default
});
// OR
var table = new Y.DataTable({
columns: [ 'id', 'username', 'name', 'birthdate' ],
data: [ ... ],
sortable: [ 'username', 'name', 'birthdate' ]
});
</code></pre>
To disable UI sorting for all columns, set `sortable` to `false`. This still
permits sorting via the API methods.
As new records are inserted into the table's `data` ModelList, they will be inserted at the correct index to preserve the sort order.
The current sort order is stored in the `sortBy` attribute. Assigning this value at instantiation will automatically sort your data.
Sorting is done by a simple value comparison using < and > on the field
value. If you need custom sorting, add a sort function in the column's
`sortFn` property. Columns whose content is generated by formatters, but don't
relate to a single `key`, require a `sortFn` to be sortable.
<pre><code>
function nameSort(a, b, desc) {
var aa = a.get('lastName') + a.get('firstName'),
bb = a.get('lastName') + b.get('firstName'),
order = (aa > bb) ? 1 : -(aa < bb);
return desc ? -order : order;
}
var table = new Y.DataTable({
columns: [ 'id', 'username', { key: name, sortFn: nameSort }, 'birthdate' ],
data: [ ... ],
sortable: [ 'username', 'name', 'birthdate' ]
});
</code></pre>
See the user guide for more details.
@class DataTable.Sortable
@for DataTable
@since 3.5.0
**/
function Sortable() {}
Sortable.ATTRS = {
// Which columns in the UI should suggest and respond to sorting interaction
// pass an empty array if no UI columns should show sortable, but you want the
// table.sort(...) API
/**
Controls which column headers can trigger sorting by user clicks.
Acceptable values are:
* "auto" - (default) looks for `sortable: true` in the column configurations
* `true` - all columns are enabled
* `false - no UI sortable is enabled
* {String[]} - array of key names to give sortable headers
@attribute sortable
@type {String|String[]|Boolean}
@default "auto"
@since 3.5.0
**/
sortable: {
value: 'auto',
validator: '_validateSortable'
},
/**
The current sort configuration to maintain in the data.
Accepts column `key` strings or objects with a single property, the column
`key`, with a value of 1, -1, "asc", or "desc". E.g. `{ username: 'asc'
}`. String values are assumed to be ascending.
Example values would be:
* `"username"` - sort by the data's `username` field or the `key`
associated to a column with that `name`.
* `{ username: "desc" }` - sort by `username` in descending order.
Alternately, use values "asc", 1 (same as "asc"), or -1 (same as "desc").
* `["lastName", "firstName"]` - ascending sort by `lastName`, but for
records with the same `lastName`, ascending subsort by `firstName`.
Array can have as many items as you want.
* `[{ lastName: -1 }, "firstName"]` - descending sort by `lastName`,
ascending subsort by `firstName`. Mixed types are ok.
@attribute sortBy
@type {String|String[]|Object|Object[]}
@since 3.5.0
**/
sortBy: {
validator: '_validateSortBy',
getter: '_getSortBy'
},
/**
Strings containing language for sorting tooltips.
@attribute strings
@type {Object}
@default (strings for current lang configured in the YUI instance config)
@since 3.5.0
**/
strings: {}
};
Y.mix(Sortable.prototype, {
/**
Sort the data in the `data` ModelList and refresh the table with the new
order.
Acceptable values for `fields` are `key` strings or objects with a single
property, the column `key`, with a value of 1, -1, "asc", or "desc". E.g.
`{ username: 'asc' }`. String values are assumed to be ascending.
Example values would be:
* `"username"` - sort by the data's `username` field or the `key`
associated to a column with that `name`.
* `{ username: "desc" }` - sort by `username` in descending order.
Alternately, use values "asc", 1 (same as "asc"), or -1 (same as "desc").
* `["lastName", "firstName"]` - ascending sort by `lastName`, but for
records with the same `lastName`, ascending subsort by `firstName`.
Array can have as many items as you want.
* `[{ lastName: -1 }, "firstName"]` - descending sort by `lastName`,
ascending subsort by `firstName`. Mixed types are ok.
@method sort
@param {String|String[]|Object|Object[]} fields The field(s) to sort by
@param {Object} [payload] Extra `sort` event payload you want to send along
@return {DataTable}
@chainable
@since 3.5.0
**/
sort: function (fields, payload) {
/**
Notifies of an impending sort, either from clicking on a column
header, or from a call to the `sort` or `toggleSort` method.
The requested sort is available in the `sortBy` property of the event.
The default behavior of this event sets the table's `sortBy` attribute.
@event sort
@param {String|String[]|Object|Object[]} sortBy The requested sort
@preventable _defSortFn
**/
return this.fire('sort', Y.merge((payload || {}), {
sortBy: fields || this.get('sortBy')
}));
},
/**
Template for the node that will wrap the header content for sortable
columns.
@property SORTABLE_HEADER_TEMPLATE
@type {HTML}
@value '<div class="{className}" tabindex="0"><span class="{indicatorClass}"></span></div>'
@since 3.5.0
**/
SORTABLE_HEADER_TEMPLATE: '<div class="{className}" tabindex="0"><span class="{indicatorClass}"></span></div>',
/**
Reverse the current sort direction of one or more fields currently being
sorted by.
Pass the `key` of the column or columns you want the sort order reversed
for.
@method toggleSort
@param {String|String[]} fields The field(s) to reverse sort order for
@param {Object} [payload] Extra `sort` event payload you want to send along
@return {DataTable}
@chainable
@since 3.5.0
**/
toggleSort: function (columns, payload) {
var current = this._sortBy,
sortBy = [],
i, len, j, col, index;
// To avoid updating column configs or sortBy directly
for (i = 0, len = current.length; i < len; ++i) {
col = {};
col[current[i]._id] = current[i].sortDir;
sortBy.push(col);
}
if (columns) {
columns = toArray(columns);
for (i = 0, len = columns.length; i < len; ++i) {
col = columns[i];
index = -1;
for (j = sortBy.length - 1; i >= 0; --i) {
if (sortBy[j][col]) {
sortBy[j][col] *= -1;
break;
}
}
}
} else {
for (i = 0, len = sortBy.length; i < len; ++i) {
for (col in sortBy[i]) {
if (sortBy[i].hasOwnProperty(col)) {
sortBy[i][col] *= -1;
break;
}
}
}
}
return this.fire('sort', Y.merge((payload || {}), {
sortBy: sortBy
}));
},
//--------------------------------------------------------------------------
// Protected properties and methods
//--------------------------------------------------------------------------
/**
Sorts the `data` ModelList based on the new `sortBy` configuration.
@method _afterSortByChange
@param {EventFacade} e The `sortByChange` event
@protected
@since 3.5.0
**/
_afterSortByChange: function (e) {
// Can't use a setter because it's a chicken and egg problem. The
// columns need to be set up to translate, but columns are initialized
// from Core's initializer. So construction-time assignment would
// fail.
this._setSortBy();
// Don't sort unless sortBy has been set
if (this._sortBy.length) {
if (!this.data.comparator) {
this.data.comparator = this._sortComparator;
}
this.data.sort();
}
},
/**
Applies the sorting logic to the new ModelList if the `newVal` is a new
ModelList.
@method _afterSortDataChange
@param {EventFacade} e the `dataChange` event
@protected
@since 3.5.0
**/
_afterSortDataChange: function (e) {
// object values always trigger a change event, but we only want to
// call _initSortFn if the value passed to the `data` attribute was a
// new ModelList, not a set of new data as an array, or even the same
// ModelList.
if (e.prevVal !== e.newVal || e.newVal.hasOwnProperty('_compare')) {
this._initSortFn();
}
},
/**
Checks if any of the fields in the modified record are fields that are
currently being sorted by, and if so, resorts the `data` ModelList.
@method _afterSortRecordChange
@param {EventFacade} e The Model's `change` event
@protected
@since 3.5.0
**/
_afterSortRecordChange: function (e) {
var i, len;
for (i = 0, len = this._sortBy.length; i < len; ++i) {
if (e.changed[this._sortBy[i].key]) {
this.data.sort();
break;
}
}
},
/**
Subscribes to state changes that warrant updating the UI, and adds the
click handler for triggering the sort operation from the UI.
@method _bindSortUI
@protected
@since 3.5.0
**/
_bindSortUI: function () {
var handles = this._eventHandles;
if (!handles.sortAttrs) {
handles.sortAttrs = this.after(
['sortableChange', 'sortByChange', 'columnsChange'],
Y.bind('_uiSetSortable', this));
}
if (!handles.sortUITrigger && this._theadNode) {
handles.sortUITrigger = this.delegate(['click','keydown'],
Y.rbind('_onUITriggerSort', this),
'.' + this.getClassName('sortable', 'column'));
}
},
/**
Sets the `sortBy` attribute from the `sort` event's `e.sortBy` value.
@method _defSortFn
@param {EventFacade} e The `sort` event
@protected
@since 3.5.0
**/
_defSortFn: function (e) {
this.set.apply(this, ['sortBy', e.sortBy].concat(e.details));
},
/**
Getter for the `sortBy` attribute.
Supports the special subattribute "sortBy.state" to get a normalized JSON
version of the current sort state. Otherwise, returns the last assigned
value.
For example:
<pre><code>var table = new Y.DataTable({
columns: [ ... ],
data: [ ... ],
sortBy: 'username'
});
table.get('sortBy'); // 'username'
table.get('sortBy.state'); // { key: 'username', dir: 1 }
table.sort(['lastName', { firstName: "desc" }]);
table.get('sortBy'); // ['lastName', { firstName: "desc" }]
table.get('sortBy.state'); // [{ key: "lastName", dir: 1 }, { key: "firstName", dir: -1 }]
</code></pre>
@method _getSortBy
@param {String|String[]|Object|Object[]} val The current sortBy value
@param {String} detail String passed to `get(HERE)`. to parse subattributes
@protected
@since 3.5.0
**/
_getSortBy: function (val, detail) {
var state, i, len, col;
// "sortBy." is 7 characters. Used to catch
detail = detail.slice(7);
// TODO: table.get('sortBy.asObject')? table.get('sortBy.json')?
if (detail === 'state') {
state = [];
for (i = 0, len = this._sortBy.length; i < len; ++i) {
col = this._sortBy[i];
state.push({
column: col._id,
dir: col.sortDir
});
}
// TODO: Always return an array?
return { state: (state.length === 1) ? state[0] : state };
} else {
return val;
}
},
/**
Sets up the initial sort state and instance properties. Publishes events
and subscribes to attribute change events to maintain internal state.
@method initializer
@protected
@since 3.5.0
**/
initializer: function () {
var boundParseSortable = Y.bind('_parseSortable', this);
this._parseSortable();
this._setSortBy();
this._initSortFn();
this._initSortStrings();
this.after({
'table:renderHeader': Y.bind('_renderSortable', this),
dataChange : Y.bind('_afterSortDataChange', this),
sortByChange : Y.bind('_afterSortByChange', this),
sortableChange : boundParseSortable,
columnsChange : boundParseSortable
});
this.data.after(this.data.model.NAME + ":change",
Y.bind('_afterSortRecordChange', this));
// TODO: this event needs magic, allowing async remote sorting
this.publish('sort', {
defaultFn: Y.bind('_defSortFn', this)
});
},
/**
Creates a `_compare` function for the `data` ModelList to allow custom
sorting by multiple fields.
@method _initSortFn
@protected
@since 3.5.0
**/
_initSortFn: function () {
var self = this;
// TODO: This should be a ModelList extension.
// FIXME: Modifying a component of the host seems a little smelly
// FIXME: Declaring inline override to leverage closure vs
// compiling a new function for each column/sortable change or
// binding the _compare implementation to this, resulting in an
// extra function hop during sorting. Lesser of three evils?
this.data._compare = function (a, b) {
var cmp = 0,
i, len, col, dir, cs, aa, bb;
for (i = 0, len = self._sortBy.length; !cmp && i < len; ++i) {
col = self._sortBy[i];
dir = col.sortDir,
cs = col.caseSensitive;
if (col.sortFn) {
cmp = col.sortFn(a, b, (dir === -1));
} else {
// FIXME? Requires columns without sortFns to have key
aa = a.get(col.key) || '';
bb = b.get(col.key) || '';
if (!cs && typeof(aa) === "string" && typeof(bb) === "string"){// Not case sensitive
aa = aa.toLowerCase();
bb = bb.toLowerCase();
}
cmp = (aa > bb) ? dir : ((aa < bb) ? -dir : 0);
}
}
return cmp;
};
if (this._sortBy.length) {
this.data.comparator = this._sortComparator;
// TODO: is this necessary? Should it be elsewhere?
this.data.sort();
} else {
// Leave the _compare method in place to avoid having to set it
// up again. Mistake?
delete this.data.comparator;
}
},
/**
Add the sort related strings to the `strings` map.
@method _initSortStrings
@protected
@since 3.5.0
**/
_initSortStrings: function () {
// Not a valueFn because other class extensions will want to add to it
this.set('strings', Y.mix((this.get('strings') || {}),
Y.Intl.get('datatable-sort')));
},
/**
Fires the `sort` event in response to user clicks on sortable column
headers.
@method _onUITriggerSort
@param {DOMEventFacade} e The `click` event
@protected
@since 3.5.0
**/
_onUITriggerSort: function (e) {
var id = e.currentTarget.getAttribute('data-yui3-col-id'),
sortBy = e.shiftKey ? this.get('sortBy') : [{}],
column = id && this.getColumn(id),
i, len;
if (e.type === 'keydown' && e.keyCode !== 32) {
return;
}
// In case a headerTemplate injected a link
// TODO: Is this overreaching?
e.preventDefault();
if (column) {
if (e.shiftKey) {
for (i = 0, len = sortBy.length; i < len; ++i) {
if (id === sortBy[i] || Math.abs(sortBy[i][id]) === 1) {
if (!isObject(sortBy[i])) {
sortBy[i] = {};
}
sortBy[i][id] = -(column.sortDir|0) || 1;
break;
}
}
if (i >= len) {
sortBy.push(column._id);
}
} else {
sortBy[0][id] = -(column.sortDir|0) || 1;
}
this.fire('sort', {
originEvent: e,
sortBy: sortBy
});
}
},
/**
Normalizes the possible input values for the `sortable` attribute, storing
the results in the `_sortable` property.
@method _parseSortable
@protected
@since 3.5.0
**/
_parseSortable: function () {
var sortable = this.get('sortable'),
columns = [],
i, len, col;
if (isArray(sortable)) {
for (i = 0, len = sortable.length; i < len; ++i) {
col = sortable[i];
// isArray is called because arrays are objects, but will rely
// on getColumn to nullify them for the subsequent if (col)
if (!isObject(col, true) || isArray(col)) {
col = this.getColumn(col);
}
if (col) {
columns.push(col);
}
}
} else if (sortable) {
columns = this._displayColumns.slice();
if (sortable === 'auto') {
for (i = columns.length - 1; i >= 0; --i) {
if (!columns[i].sortable) {
columns.splice(i, 1);
}
}
}
}
this._sortable = columns;
},
/**
Initial application of the sortable UI.
@method _renderSortable
@protected
@since 3.5.0
**/
_renderSortable: function () {
this._uiSetSortable();
this._bindSortUI();
},
/**
Parses the current `sortBy` attribute into a normalized structure for the
`data` ModelList's `_compare` method. Also updates the column
configurations' `sortDir` properties.
@method _setSortBy
@protected
@since 3.5.0
**/
_setSortBy: function () {
var columns = this._displayColumns,
sortBy = this.get('sortBy') || [],
sortedClass = ' ' + this.getClassName('sorted'),
i, len, name, dir, field, column;
this._sortBy = [];
// Purge current sort state from column configs
for (i = 0, len = columns.length; i < len; ++i) {
column = columns[i];
delete column.sortDir;
if (column.className) {
// TODO: be more thorough
column.className = column.className.replace(sortedClass, '');
}
}
sortBy = toArray(sortBy);
for (i = 0, len = sortBy.length; i < len; ++i) {
name = sortBy[i];
dir = 1;
if (isObject(name)) {
field = name;
// Have to use a for-in loop to process sort({ foo: -1 })
for (name in field) {
if (field.hasOwnProperty(name)) {
dir = dirMap[field[name]];
break;
}
}
}
if (name) {
// Allow sorting of any model field and any column
// FIXME: this isn't limited to model attributes, but there's no
// convenient way to get a list of the attributes for a Model
// subclass *including* the attributes of its superclasses.
column = this.getColumn(name) || { _id: name, key: name };
if (column) {
column.sortDir = dir;
if (!column.className) {
column.className = '';
}
column.className += sortedClass;
this._sortBy.push(column);
}
}
}
},
/**
Array of column configuration objects of those columns that need UI setup
for user interaction.
@property _sortable
@type {Object[]}
@protected
@since 3.5.0
**/
//_sortable: null,
/**
Array of column configuration objects for those columns that are currently
being used to sort the data. Fake column objects are used for fields that
are not rendered as columns.
@property _sortBy
@type {Object[]}
@protected
@since 3.5.0
**/
//_sortBy: null,
/**
Replacement `comparator` for the `data` ModelList that defers sorting logic
to the `_compare` method. The deferral is accomplished by returning `this`.
@method _sortComparator
@param {Model} item The record being evaluated for sort position
@return {Model} The record
@protected
@since 3.5.0
**/
_sortComparator: function (item) {
// Defer sorting to ModelList's _compare
return item;
},
/**
Applies the appropriate classes to the `boundingBox` and column headers to
indicate sort state and sortability.
Also currently wraps the header content of sortable columns in a `<div>`
liner to give a CSS anchor for sort indicators.
@method _uiSetSortable
@protected
@since 3.5.0
**/
_uiSetSortable: function () {
var columns = this._sortable || [],
sortableClass = this.getClassName('sortable', 'column'),
ascClass = this.getClassName('sorted'),
descClass = this.getClassName('sorted', 'desc'),
linerClass = this.getClassName('sort', 'liner'),
indicatorClass= this.getClassName('sort', 'indicator'),
sortableCols = {},
i, len, col, node, liner, title, desc;
this.get('boundingBox').toggleClass(
this.getClassName('sortable'),
columns.length);
for (i = 0, len = columns.length; i < len; ++i) {
sortableCols[columns[i].id] = columns[i];
}
// TODO: this.head.render() + decorate cells?
this._theadNode.all('.' + sortableClass).each(function (node) {
var col = sortableCols[node.get('id')],
liner = node.one('.' + linerClass),
indicator;
if (col) {
if (!col.sortDir) {
node.removeClass(ascClass)
.removeClass(descClass);
}
} else {
node.removeClass(sortableClass)
.removeClass(ascClass)
.removeClass(descClass);
if (liner) {
liner.replace(liner.get('childNodes').toFrag());
}
indicator = node.one('.' + indicatorClass);
if (indicator) {
indicator.remove().destroy(true);
}
}
});
for (i = 0, len = columns.length; i < len; ++i) {
col = columns[i];
node = this._theadNode.one('#' + col.id);
desc = col.sortDir === -1;
if (node) {
liner = node.one('.' + linerClass);
node.addClass(sortableClass);
if (col.sortDir) {
node.addClass(ascClass);
node.toggleClass(descClass, desc);
node.setAttribute('aria-sort', desc ?
'descending' : 'ascending');
}
if (!liner) {
liner = Y.Node.create(Y.Lang.sub(
this.SORTABLE_HEADER_TEMPLATE, {
className: linerClass,
indicatorClass: indicatorClass
}));
liner.prepend(node.get('childNodes').toFrag());
node.append(liner);
}
title = sub(this.getString(
(col.sortDir === 1) ? 'reverseSortBy' : 'sortBy'), {
column: col.abbr || col.label ||
col.key || ('column ' + i)
});
node.setAttribute('title', title);
// To combat VoiceOver from reading the sort title as the
// column header
node.setAttribute('aria-labelledby', col.id);
}
}
},
/**
Allows values `true`, `false`, "auto", or arrays of column names through.
@method _validateSortable
@param {Any} val The input value to `set("sortable", VAL)`
@return {Boolean}
@protected
@since 3.5.0
**/
_validateSortable: function (val) {
return val === 'auto' || isBoolean(val) || isArray(val);
},
/**
Allows strings, arrays of strings, objects, or arrays of objects.
@method _validateSortBy
@param {String|String[]|Object|Object[]} val The new `sortBy` value
@return {Boolean}
@protected
@since 3.5.0
**/
_validateSortBy: function (val) {
return val === null ||
isString(val) ||
isObject(val, true) ||
(isArray(val) && (isString(val[0]) || isObject(val, true)));
}
}, true);
Y.DataTable.Sortable = Sortable;
Y.Base.mix(Y.DataTable, [Sortable]);
}, '@VERSION@', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});
| robfletcher/cdnjs | ajax/libs/yui/3.8.1/datatable-sort/datatable-sort.js | JavaScript | mit | 27,823 |
CodeMirror.defineMode("ruby", function(config) {
function wordObj(words) {
var o = {};
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
return o;
}
var keywords = wordObj([
"alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else",
"elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or",
"redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless",
"until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc",
"caller", "lambda", "proc", "public", "protected", "private", "require", "load",
"require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__"
]);
var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then",
"catch", "loop", "proc", "begin"]);
var dedentWords = wordObj(["end", "until"]);
var matching = {"[": "]", "{": "}", "(": ")"};
var curPunc;
function chain(newtok, stream, state) {
state.tokenize.push(newtok);
return newtok(stream, state);
}
function tokenBase(stream, state) {
curPunc = null;
if (stream.sol() && stream.match("=begin") && stream.eol()) {
state.tokenize.push(readBlockComment);
return "comment";
}
if (stream.eatSpace()) return null;
var ch = stream.next(), m;
if (ch == "`" || ch == "'" || ch == '"') {
return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
} else if (ch == "/" && !stream.eol() && stream.peek() != " ") {
if (stream.eat("=")) return "operator";
return chain(readQuoted(ch, "string-2", true), stream, state);
} else if (ch == "%") {
var style = "string", embed = true;
if (stream.eat("s")) style = "atom";
else if (stream.eat(/[WQ]/)) style = "string";
else if (stream.eat(/[r]/)) style = "string-2";
else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }
var delim = stream.eat(/[^\w\s]/);
if (!delim) return "operator";
if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
return chain(readQuoted(delim, style, embed, true), stream, state);
} else if (ch == "#") {
stream.skipToEnd();
return "comment";
} else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
return chain(readHereDoc(m[1]), stream, state);
} else if (ch == "0") {
if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
else if (stream.eat("b")) stream.eatWhile(/[01]/);
else stream.eatWhile(/[0-7]/);
return "number";
} else if (/\d/.test(ch)) {
stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
return "number";
} else if (ch == "?") {
while (stream.match(/^\\[CM]-/)) {}
if (stream.eat("\\")) stream.eatWhile(/\w/);
else stream.next();
return "string";
} else if (ch == ":") {
if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
// :> :>> :< :<< are valid symbols
if (stream.eat(/[\<\>]/)) {
stream.eat(/[\<\>]/);
return "atom";
}
// :+ :- :/ :* :| :& :! are valid symbols
if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) {
return "atom";
}
// Symbols can't start by a digit
if (stream.eat(/[a-zA-Z$@_]/)) {
stream.eatWhile(/[\w]/);
// Only one ? ! = is allowed and only as the last character
stream.eat(/[\?\!\=]/);
return "atom";
}
return "operator";
} else if (ch == "@" && stream.match(/^@?[a-zA-Z_]/)) {
stream.eat("@");
stream.eatWhile(/[\w]/);
return "variable-2";
} else if (ch == "$") {
if (stream.eat(/[a-zA-Z_]/)) {
stream.eatWhile(/[\w]/);
} else if (stream.eat(/\d/)) {
stream.eat(/\d/);
} else {
stream.next(); // Must be a special global like $: or $!
}
return "variable-3";
} else if (/[a-zA-Z_]/.test(ch)) {
stream.eatWhile(/[\w]/);
stream.eat(/[\?\!]/);
if (stream.eat(":")) return "atom";
return "ident";
} else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
curPunc = "|";
return null;
} else if (/[\(\)\[\]{}\\;]/.test(ch)) {
curPunc = ch;
return null;
} else if (ch == "-" && stream.eat(">")) {
return "arrow";
} else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
return "operator";
} else {
return null;
}
}
function tokenBaseUntilBrace() {
var depth = 1;
return function(stream, state) {
if (stream.peek() == "}") {
depth--;
if (depth == 0) {
state.tokenize.pop();
return state.tokenize[state.tokenize.length-1](stream, state);
}
} else if (stream.peek() == "{") {
depth++;
}
return tokenBase(stream, state);
};
}
function tokenBaseOnce() {
var alreadyCalled = false;
return function(stream, state) {
if (alreadyCalled) {
state.tokenize.pop();
return state.tokenize[state.tokenize.length-1](stream, state);
}
alreadyCalled = true;
return tokenBase(stream, state);
};
}
function readQuoted(quote, style, embed, unescaped) {
return function(stream, state) {
var escaped = false, ch;
if (state.context.type === 'read-quoted-paused') {
state.context = state.context.prev;
stream.eat("}");
}
while ((ch = stream.next()) != null) {
if (ch == quote && (unescaped || !escaped)) {
state.tokenize.pop();
break;
}
if (embed && ch == "#" && !escaped) {
if (stream.eat("{")) {
if (quote == "}") {
state.context = {prev: state.context, type: 'read-quoted-paused'};
}
state.tokenize.push(tokenBaseUntilBrace());
break;
} else if (/[@\$]/.test(stream.peek())) {
state.tokenize.push(tokenBaseOnce());
break;
}
}
escaped = !escaped && ch == "\\";
}
return style;
};
}
function readHereDoc(phrase) {
return function(stream, state) {
if (stream.match(phrase)) state.tokenize.pop();
else stream.skipToEnd();
return "string";
};
}
function readBlockComment(stream, state) {
if (stream.sol() && stream.match("=end") && stream.eol())
state.tokenize.pop();
stream.skipToEnd();
return "comment";
}
return {
startState: function() {
return {tokenize: [tokenBase],
indented: 0,
context: {type: "top", indented: -config.indentUnit},
continuedLine: false,
lastTok: null,
varList: false};
},
token: function(stream, state) {
if (stream.sol()) state.indented = stream.indentation();
var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
if (style == "ident") {
var word = stream.current();
style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
: /^[A-Z]/.test(word) ? "tag"
: (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
: "variable";
if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
kwtype = "indent";
else if (word == "do" && state.context.indented < state.indented)
kwtype = "indent";
}
if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style;
if (curPunc == "|") state.varList = !state.varList;
if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
state.context = state.context.prev;
if (stream.eol())
state.continuedLine = (curPunc == "\\" || style == "operator");
return style;
},
indent: function(state, textAfter) {
if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
var firstChar = textAfter && textAfter.charAt(0);
var ct = state.context;
var closing = ct.type == matching[firstChar] ||
ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
return ct.indented + (closing ? 0 : config.indentUnit) +
(state.continuedLine ? config.indentUnit : 0);
},
electricChars: "}de", // enD and rescuE
lineComment: "#"
};
});
CodeMirror.defineMIME("text/x-ruby", "ruby");
| ProfNandaa/cdnjs | ajax/libs/codemirror/3.22.0/mode/ruby/ruby.js | JavaScript | mit | 9,048 |
(function(a){if(typeof define==="function"&&define.amd){define(["moment"],a)}else{if(typeof exports==="object"){module.exports=a(require("../moment"))}else{a(window.moment)}}}(function(a){return a.lang("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D. MMMM, YYYY LT"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})})); | legomushroom/cdnjs | ajax/libs/moment.js/2.6.0/lang/da.min.js | JavaScript | mit | 1,071 |
(function(a){if(typeof define==="function"&&define.amd){define(["moment"],a)}else{if(typeof exports==="object"){module.exports=a(require("../moment"))}else{a(window.moment)}}}(function(a){return a.lang("ar",{months:"يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"),monthsShort:"يناير/ كانون الثاني_فبراير/ شباط_مارس/ آذار_أبريل/ نيسان_مايو/ أيار_يونيو/ حزيران_يوليو/ تموز_أغسطس/ آب_سبتمبر/ أيلول_أكتوبر/ تشرين الأول_نوفمبر/ تشرين الثاني_ديسمبر/ كانون الأول".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})})); | dbeckwith/cdnjs | ajax/libs/moment.js/2.3.0/lang/ar.min.js | JavaScript | mit | 1,761 |
div.anythingSlider-metallic .anythingWindow{border-top:3px solid #333;border-bottom:3px solid #333}div.anythingSlider-metallic .thumbNav a{border:1px solid #000}div.anythingSlider-metallic .start-stop{border:1px solid #000}div.anythingSlider-metallic .start-stop.playing{background-color:#300}div.anythingSlider-metallic .start-stop:hover,div.anythingSlider-metallic .start-stop.hover{color:#ddd}div.anythingSlider-metallic.activeSlider .anythingWindow{border-color:#0355a3}div.anythingSlider-metallic.activeSlider .thumbNav a{background-color:transparent;background-position:-68px -40px}div.anythingSlider-metallic.activeSlider .thumbNav a:hover,div.anythingSlider-metallic.activeSlider .thumbNav a.cur{background-position:-76px -57px}div.anythingSlider-metallic.activeSlider .start-stop.playing{background-color:red}div.anythingSlider-metallic .start-stop:hover,div.anythingSlider-metallic .start-stop.hover{color:#fff}div.anythingSlider-metallic .arrow{top:50%;position:absolute;display:block;z-index:100}div.anythingSlider-metallic .arrow a{display:block;height:95px;margin-top:-47px;width:45px;outline:0;background:url(../images/arrows-metallic.png) no-repeat;text-indent:-9999px}div.anythingSlider-metallic .forward{right:0}div.anythingSlider-metallic .back{left:0}div.anythingSlider-metallic .forward a{background-position:right bottom}div.anythingSlider-metallic .back a{background-position:left bottom}div.anythingSlider-metallic .forward a:hover,div.anythingSlider-metallic .forward a.hover{background-position:right top}div.anythingSlider-metallic .back a:hover,div.anythingSlider-metallic .back a.hover{background-position:left top}div.anythingSlider-metallic .anythingControls{position:absolute;width:80%;bottom:-2px;right:10%;z-index:100;opacity:.90;filter:alpha(opacity=90)}div.anythingSlider-metallic .thumbNav{float:right;margin:0;z-index:100}div.anythingSlider-metallic .thumbNav li{display:inline}div.anythingSlider-metallic .thumbNav a{display:inline-block;background:transparent url(../images/arrows-metallic.png) -68px -136px no-repeat;height:10px;width:10px;margin:3px;padding:0;text-indent:-9999px;outline:0;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}div.anythingSlider-metallic .thumbNav a:hover,div.anythingSlider-metallic .thumbNav a.cur{background:transparent url(../images/arrows-metallic.png) -76px -57px no-repeat}div.anythingSlider-metallic.rtl .thumbNav a{float:right}div.anythingSlider-metallic.rtl .thumbNav{float:left}div.anythingSlider-metallic .start-stop{margin:3px;padding:0;display:inline-block;width:14px;height:14px;position:relative;bottom:2px;left:0;z-index:100;text-indent:-9999px;float:right;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px}div.anythingSlider-metallic{padding:0 23px} | dmsanchez86/cdnjs | ajax/libs/anythingslider/1.5.6.4/css/theme-metallic.min.css | CSS | mit | 2,773 |
/* This is a compiled file, you should be editing the file in the templates directory */
.pace {
-webkit-pointer-events: none;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-perspective: 12rem;
-moz-perspective: 12rem;
-ms-perspective: 12rem;
-o-perspective: 12rem;
perspective: 12rem;
z-index: 2000;
position: fixed;
height: 6rem;
width: 6rem;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.pace.pace-inactive .pace-progress {
display: none;
}
.pace .pace-progress {
position: fixed;
z-index: 2000;
display: block;
position: absolute;
left: 0;
top: 0;
height: 6rem;
width: 6rem !important;
line-height: 6rem;
font-size: 2rem;
border-radius: 50%;
background: rgba(0, 0, 0, 0.8);
color: #fff;
font-family: "Helvetica Neue", sans-serif;
font-weight: 100;
text-align: center;
-webkit-animation: pace-3d-spinner linear infinite 2s;
-moz-animation: pace-3d-spinner linear infinite 2s;
-ms-animation: pace-3d-spinner linear infinite 2s;
-o-animation: pace-3d-spinner linear infinite 2s;
animation: pace-3d-spinner linear infinite 2s;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.pace .pace-progress:after {
content: attr(data-progress-text);
display: block;
}
@-webkit-keyframes pace-3d-spinner {
from {
-webkit-transform: rotateY(0deg);
}
to {
-webkit-transform: rotateY(360deg);
}
}
@-moz-keyframes pace-3d-spinner {
from {
-moz-transform: rotateY(0deg);
}
to {
-moz-transform: rotateY(360deg);
}
}
@-ms-keyframes pace-3d-spinner {
from {
-ms-transform: rotateY(0deg);
}
to {
-ms-transform: rotateY(360deg);
}
}
@-o-keyframes pace-3d-spinner {
from {
-o-transform: rotateY(0deg);
}
to {
-o-transform: rotateY(360deg);
}
}
@keyframes pace-3d-spinner {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
| mojio/cdnjs | ajax/libs/pace/0.5.3/themes/black/pace-theme-center-circle.css | CSS | mit | 2,097 |
/* This is a compiled file, you should be editing the file in the templates directory */
.pace {
-webkit-pointer-events: none;
pointer-events: none;
z-index: 2000;
position: fixed;
height: 90px;
width: 90px;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.pace.pace-inactive .pace-activity {
display: none;
}
.pace .pace-activity {
position: fixed;
z-index: 2000;
display: block;
position: absolute;
left: -30px;
top: -30px;
height: 90px;
width: 90px;
display: block;
border-width: 30px;
border-style: double;
border-color: #000000 transparent transparent;
border-radius: 50%;
-webkit-animation: spin 1s linear infinite;
-moz-animation: spin 1s linear infinite;
-o-animation: spin 1s linear infinite;
animation: spin 1s linear infinite;
}
.pace .pace-activity:before {
content: ' ';
position: absolute;
top: 10px;
left: 10px;
height: 50px;
width: 50px;
display: block;
border-width: 10px;
border-style: solid;
border-color: #000000 transparent transparent;
border-radius: 50%;
}
@-webkit-keyframes spin {
100% { -webkit-transform: rotate(359deg); }
}
@-moz-keyframes spin {
100% { -moz-transform: rotate(359deg); }
}
@-o-keyframes spin {
100% { -moz-transform: rotate(359deg); }
}
@keyframes spin {
100% { transform: rotate(359deg); }
}
| StoneCypher/cdnjs | ajax/libs/pace/0.7.0/themes/black/pace-theme-center-radar.css | CSS | mit | 1,359 |
.medium-toolbar-arrow-under:after{top:50px;border-color:#242424 transparent transparent}.medium-toolbar-arrow-over:before{top:-8px;border-color:transparent transparent #242424}.medium-editor-toolbar{border:1px solid #000;background:-webkit-linear-gradient(top,#242424,rgba(36,36,36,.75));background:linear-gradient(to bottom,#242424,rgba(36,36,36,.75));border-radius:5px;box-shadow:0 0 3px #000}.medium-editor-toolbar li button{min-width:50px;height:50px;border:0;border-right:1px solid #000;border-left:1px solid #333;border-left:1px solid rgba(255,255,255,.1);color:#fff;background:-webkit-linear-gradient(top,#242424,rgba(36,36,36,.89));background:linear-gradient(to bottom,#242424,rgba(36,36,36,.89));box-shadow:0 2px 2px rgba(0,0,0,.3);-webkit-transition:background-color .2s ease-in;transition:background-color .2s ease-in}.medium-editor-toolbar li button:hover{background-color:#000;color:#ff0}.medium-editor-toolbar li .medium-editor-button-first{border-top-left-radius:5px;border-bottom-left-radius:5px}.medium-editor-toolbar li .medium-editor-button-last{border-top-right-radius:5px;border-bottom-right-radius:5px}.medium-editor-toolbar li .medium-editor-button-active{color:#fff;background:-webkit-linear-gradient(top,#242424,rgba(0,0,0,.89));background:linear-gradient(to bottom,#242424,rgba(0,0,0,.89))}.medium-editor-toolbar-form{background:#242424;color:#999;border-radius:5px}.medium-editor-toolbar-form .medium-editor-toolbar-input{height:50px;background:#242424;color:#ccc;box-sizing:border-box}.medium-editor-toolbar-form a{color:#fff}.medium-editor-toolbar-anchor-preview{background:#242424;color:#fff;border-radius:5px}.medium-editor-placeholder:after{color:#b3b3b1} | rlugojr/cdnjs | ajax/libs/medium-editor/4.12.5/css/themes/default.min.css | CSS | mit | 1,687 |
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.ServiceModel
{
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
public abstract class DuplexClientBase<TChannel> : ClientBase<TChannel>
where TChannel : class
{
// IMPORTANT: any changes to the set of protected .ctors of this class need to be reflected
// in ServiceContractGenerator.cs as well.
protected DuplexClientBase(object callbackInstance)
: this(new InstanceContext(callbackInstance))
{
}
protected DuplexClientBase(object callbackInstance, string endpointConfigurationName)
: this(new InstanceContext(callbackInstance), endpointConfigurationName)
{
}
protected DuplexClientBase(object callbackInstance, string endpointConfigurationName, string remoteAddress)
: this(new InstanceContext(callbackInstance), endpointConfigurationName, remoteAddress)
{
}
protected DuplexClientBase(object callbackInstance, string endpointConfigurationName, EndpointAddress remoteAddress)
: this(new InstanceContext(callbackInstance), endpointConfigurationName, remoteAddress)
{
}
protected DuplexClientBase(object callbackInstance, Binding binding, EndpointAddress remoteAddress)
: this(new InstanceContext(callbackInstance), binding, remoteAddress)
{
}
protected DuplexClientBase(object callbackInstance, ServiceEndpoint endpoint)
: this(new InstanceContext(callbackInstance), endpoint)
{
}
protected DuplexClientBase(InstanceContext callbackInstance)
: base(callbackInstance)
{
}
protected DuplexClientBase(InstanceContext callbackInstance, string endpointConfigurationName)
: base(callbackInstance, endpointConfigurationName)
{
}
protected DuplexClientBase(InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress)
: base(callbackInstance, endpointConfigurationName, remoteAddress)
{
}
protected DuplexClientBase(InstanceContext callbackInstance, string endpointConfigurationName, EndpointAddress remoteAddress)
: base(callbackInstance, endpointConfigurationName, remoteAddress)
{
}
protected DuplexClientBase(InstanceContext callbackInstance, Binding binding, EndpointAddress remoteAddress)
: base(callbackInstance, binding, remoteAddress)
{
}
protected DuplexClientBase(InstanceContext callbackInstance, ServiceEndpoint endpoint)
: base(callbackInstance, endpoint)
{
}
public IDuplexContextChannel InnerDuplexChannel
{
get
{
return (IDuplexContextChannel)InnerChannel;
}
}
}
}
| evincarofautumn/referencesource | System.ServiceModel/System/ServiceModel/DuplexClientBase.cs | C# | mit | 3,093 |
/*
*
* This file is part of libmpeg3
*
* LibMPEG3
* Author: Adam Williams <broadcast@earthling.net>
* Page: heroine.linuxbox.com
* Page: http://www.smalltalkconsulting.com/html/mpeg3source.html (for Squeak)
*
LibMPEG3 was originally licenced under GPL. It was relicensed by
the author under the LGPL and the Squeak license on Nov 1st, 2000
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also licensed under the Squeak license.
http://www.squeak.org/license.html
*/
#include "mpeg3video.h"
#include "slice.h"
#include "vlc.h"
#include <stdio.h>
int mpeg3video_get_macroblock_address(mpeg3_slice_t *slice)
{
int code, val = 0;
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
while((code = mpeg3slice_showbits(slice_buffer, 11)) < 24)
{
/* Is not macroblock_stuffing */
if(code != 15)
{
/* Is macroblock_escape */
if(code == 8)
{
val += 33;
}
else
{
/* fprintf(stderr, "mpeg3video_get_macroblock_address: invalid macroblock_address_increment code\n"); */
slice->fault = 1;
return 1;
}
}
mpeg3slice_flushbits(slice_buffer, 11);
}
if(code >= 1024)
{
mpeg3slice_flushbit(slice_buffer);
return val + 1;
}
if(code >= 128)
{
code >>= 6;
mpeg3slice_flushbits(slice_buffer, mpeg3_MBAtab1[code].len);
return val + mpeg3_MBAtab1[code].val;
}
code -= 24;
mpeg3slice_flushbits(slice_buffer, mpeg3_MBAtab2[code].len);
return val + mpeg3_MBAtab2[code].val;
}
/* macroblock_type for pictures with spatial scalability */
static inline int mpeg3video_getsp_imb_type(mpeg3_slice_t *slice)
{
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
unsigned int code = mpeg3slice_showbits(slice_buffer, 4);
if(!code)
{
/* fprintf(stderr,"mpeg3video_getsp_imb_type: invalid macroblock_type code\n"); */
slice->fault = 1;
return 0;
}
mpeg3slice_flushbits(slice_buffer, mpeg3_spIMBtab[code].len);
return mpeg3_spIMBtab[code].val;
}
static inline int mpeg3video_getsp_pmb_type(mpeg3_slice_t *slice)
{
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
int code = mpeg3slice_showbits(slice_buffer, 7);
if(code < 2)
{
/* fprintf(stderr,"mpeg3video_getsp_pmb_type: invalid macroblock_type code\n"); */
slice->fault = 1;
return 0;
}
if(code >= 16)
{
code >>= 3;
mpeg3slice_flushbits(slice_buffer, mpeg3_spPMBtab0[code].len);
return mpeg3_spPMBtab0[code].val;
}
mpeg3slice_flushbits(slice_buffer, mpeg3_spPMBtab1[code].len);
return mpeg3_spPMBtab1[code].val;
}
static inline int mpeg3video_getsp_bmb_type(mpeg3_slice_t *slice)
{
mpeg3_VLCtab_t *p;
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
int code = mpeg3slice_showbits9(slice_buffer);
if(code >= 64)
p = &mpeg3_spBMBtab0[(code >> 5) - 2];
else
if(code >= 16)
p = &mpeg3_spBMBtab1[(code >> 2) - 4];
else
if(code >= 8)
p = &mpeg3_spBMBtab2[code - 8];
else
{
/* fprintf(stderr,"mpeg3video_getsp_bmb_type: invalid macroblock_type code\n"); */
slice->fault = 1;
return 0;
}
mpeg3slice_flushbits(slice_buffer, p->len);
return p->val;
}
static inline int mpeg3video_get_imb_type(mpeg3_slice_t *slice)
{
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
if(mpeg3slice_getbit(slice_buffer))
{
return 1;
}
if(!mpeg3slice_getbit(slice_buffer))
{
/* fprintf(stderr,"mpeg3video_get_imb_type: invalid macroblock_type code\n"); */
slice->fault = 1;
}
return 17;
}
static inline int mpeg3video_get_pmb_type(mpeg3_slice_t *slice)
{
int code;
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
if((code = mpeg3slice_showbits(slice_buffer, 6)) >= 8)
{
code >>= 3;
mpeg3slice_flushbits(slice_buffer, mpeg3_PMBtab0[code].len);
return mpeg3_PMBtab0[code].val;
}
if(code == 0)
{
/* fprintf(stderr,"mpeg3video_get_pmb_type: invalid macroblock_type code\n"); */
slice->fault = 1;
return 0;
}
mpeg3slice_flushbits(slice_buffer, mpeg3_PMBtab1[code].len);
return mpeg3_PMBtab1[code].val;
}
static inline int mpeg3video_get_bmb_type(mpeg3_slice_t *slice)
{
int code;
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
if((code = mpeg3slice_showbits(slice_buffer, 6)) >= 8)
{
code >>= 2;
mpeg3slice_flushbits(slice_buffer, mpeg3_BMBtab0[code].len);
return mpeg3_BMBtab0[code].val;
}
if(code == 0)
{
/* fprintf(stderr,"mpeg3video_get_bmb_type: invalid macroblock_type code\n"); */
slice->fault = 1;
return 0;
}
mpeg3slice_flushbits(slice_buffer, mpeg3_BMBtab1[code].len);
return mpeg3_BMBtab1[code].val;
}
static inline int mpeg3video_get_dmb_type(mpeg3_slice_t *slice)
{
if(!mpeg3slice_getbit(slice->slice_buffer))
{
/* fprintf(stderr,"mpeg3video_get_dmb_type: invalid macroblock_type code\n"); */
slice->fault=1;
}
return 1;
}
static inline int mpeg3video_get_snrmb_type(mpeg3_slice_t *slice)
{
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
int code = mpeg3slice_showbits(slice_buffer, 3);
if(code == 0)
{
/* fprintf(stderr,"mpeg3video_get_snrmb_type: invalid macroblock_type code\n"); */
slice->fault = 1;
return 0;
}
mpeg3slice_flushbits(slice_buffer, mpeg3_SNRMBtab[code].len);
return mpeg3_SNRMBtab[code].val;
}
int mpeg3video_get_mb_type(mpeg3_slice_t *slice, mpeg3video_t *video)
{
if(video->scalable_mode == SC_SNR)
{
return mpeg3video_get_snrmb_type(slice);
}
else
{
switch(video->pict_type)
{
case I_TYPE: return video->pict_scal ? mpeg3video_getsp_imb_type(slice) : mpeg3video_get_imb_type(slice);
case P_TYPE: return video->pict_scal ? mpeg3video_getsp_pmb_type(slice) : mpeg3video_get_pmb_type(slice);
case B_TYPE: return video->pict_scal ? mpeg3video_getsp_bmb_type(slice) : mpeg3video_get_bmb_type(slice);
case D_TYPE: return mpeg3video_get_dmb_type(slice);
default:
/*fprintf(stderr, "mpeg3video_getmbtype: unknown coding type\n"); */
break;
/* MPEG-1 only, not implemented */
}
}
return 0;
}
int mpeg3video_macroblock_modes(mpeg3_slice_t *slice,
mpeg3video_t *video,
int *pmb_type,
int *pstwtype,
int *pstwclass,
int *pmotion_type,
int *pmv_count,
int *pmv_format,
int *pdmv,
int *pmvscale,
int *pdct_type)
{
int mb_type;
int stwtype, stwcode, stwclass;
int motion_type = 0, mv_count, mv_format, dmv, mvscale;
int dct_type;
mpeg3_slice_buffer_t *slice_buffer = slice->slice_buffer;
static unsigned char stwc_table[3][4]
= { {6,3,7,4}, {2,1,5,4}, {2,5,7,4} };
static unsigned char stwclass_table[9]
= {0, 1, 2, 1, 1, 2, 3, 3, 4};
/* get macroblock_type */
mb_type = mpeg3video_get_mb_type(slice, video);
if(slice->fault) return 1;
/* get spatial_temporal_weight_code */
if(mb_type & MB_WEIGHT)
{
if(video->stwc_table_index == 0)
stwtype = 4;
else
{
stwcode = mpeg3slice_getbits2(slice_buffer);
stwtype = stwc_table[video->stwc_table_index - 1][stwcode];
}
}
else
stwtype = (mb_type & MB_CLASS4) ? 8 : 0;
/* derive spatial_temporal_weight_class (Table 7-18) */
stwclass = stwclass_table[stwtype];
/* get frame/field motion type */
if(mb_type & (MB_FORWARD | MB_BACKWARD))
{
if(video->pict_struct == FRAME_PICTURE)
{
/* frame_motion_type */
motion_type = video->frame_pred_dct ? MC_FRAME : mpeg3slice_getbits2(slice_buffer);
}
else
{
/* field_motion_type */
motion_type = mpeg3slice_getbits2(slice_buffer);
}
}
else
if((mb_type & MB_INTRA) && video->conceal_mv)
{
/* concealment motion vectors */
motion_type = (video->pict_struct == FRAME_PICTURE) ? MC_FRAME : MC_FIELD;
}
/* derive mv_count, mv_format and dmv, (table 6-17, 6-18) */
if(video->pict_struct == FRAME_PICTURE)
{
mv_count = (motion_type == MC_FIELD && stwclass < 2) ? 2 : 1;
mv_format = (motion_type == MC_FRAME) ? MV_FRAME : MV_FIELD;
}
else
{
mv_count = (motion_type == MC_16X8) ? 2 : 1;
mv_format = MV_FIELD;
}
dmv = (motion_type == MC_DMV); /* dual prime */
/* field mv predictions in frame pictures have to be scaled */
mvscale = ((mv_format == MV_FIELD) && (video->pict_struct == FRAME_PICTURE));
/* get dct_type (frame DCT / field DCT) */
dct_type = (video->pict_struct == FRAME_PICTURE) &&
(!video->frame_pred_dct) &&
(mb_type & (MB_PATTERN | MB_INTRA)) ?
mpeg3slice_getbit(slice_buffer) : 0;
/* return values */
*pmb_type = mb_type;
*pstwtype = stwtype;
*pstwclass = stwclass;
*pmotion_type = motion_type;
*pmv_count = mv_count;
*pmv_format = mv_format;
*pdmv = dmv;
*pmvscale = mvscale;
*pdct_type = dct_type;
return 0;
}
| takano32/pharo-vm | platforms/Cross/plugins/Mpeg3Plugin/libmpeg/video/macroblocks.c | C | mit | 9,594 |
<!doctype html>
<html>
<title>npm-outdated</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-outdated.html">
<script async=true src="../../static/toc.js"></script>
<body>
<div id="wrapper">
<h1><a href="../cli/npm-outdated.html">npm-outdated</a></h1> <p>Check for outdated packages</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm outdated [<name> [<name> ...]]
</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command will check the registry to see if any (or, specific) installed
packages are currently outdated.</p>
<p>The resulting field 'wanted' shows the latest version according to the
version specified in the package.json, the field 'latest' the very latest
version of the package.</p>
<h2 id="configuration">CONFIGURATION</h2>
<h3 id="json">json</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Show information in JSON format.</p>
<h3 id="long">long</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Show extended information.</p>
<h3 id="parseable">parseable</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Show parseable output instead of tree view.</p>
<h3 id="global">global</h3>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Check packages in the global install prefix instead of in the current
project.</p>
<h3 id="depth">depth</h3>
<ul>
<li>Type: Int</li>
</ul>
<p>Max depth for checking dependency tree.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-update.html">npm-update(1)</a></li>
<li><a href="../misc/npm-registry.html">npm-registry(7)</a></li>
<li><a href="../files/npm-folders.html">npm-folders(5)</a></li>
</ul>
</div>
<table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
<tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18> </td></tr>
<tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td colspan=6 style="width:60px;height:10px;background:#fff"> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td></tr>
<tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2> </td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td></tr>
<tr><td style="width:10px;height:10px;background:#fff" rowspan=2> </td></tr>
<tr><td style="width:10px;height:10px;background:#fff"> </td></tr>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
<p id="footer">npm-outdated — npm@1.4.21</p>
| Skaelv/bieber | web/angular-seed/app/bower_components/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/html/doc/cli/npm-outdated.html | HTML | mit | 3,993 |
/* snapper css snap points carousel */
;(function( w, $ ){
var pluginName = "snapper";
$.fn[ pluginName ] = function(optionsOrMethod){
var pluginArgs = arguments;
var scrollListening = true;
// css snap points feature test.
// even if this test passes, several behaviors will still be polyfilled, such as snapping after resize, and animated advancing of slides with anchor links or next/prev links
var testProp = "scroll-snap-type";
var snapSupported = w.CSS && w.CSS.supports && ( w.CSS.supports( testProp, "mandatory") || w.CSS.supports("-webkit-" + testProp, "mandatory") || w.CSS.supports("-ms-" + testProp, "mandatory") );
// get the snapper_item elements whose left offsets fall within the scroll pane. Returns a wrapped array.
function itemsAtOffset( elem, offset ){
var $childNodes = $( elem ).find( "." + pluginName + "_item" );
var containWidth = $( elem ).width();
var activeItems = [];
$childNodes.each(function( i ){
if( this.offsetLeft >= offset - 5 && this.offsetLeft < offset + containWidth - 5 ){
activeItems.push( this );
}
});
return $( activeItems );
}
function outerWidth( $elem ){
return $elem.width() + parseFloat( $elem.css( "margin-left" ) ) + parseFloat( $elem.css( "margin-right" ) );
}
function outerHeight( $elem ){
return $elem.height() + parseFloat( $elem.css( "margin-bottom" ) ) + parseFloat( $elem.css( "margin-top" ) );
}
// snapEvent dispatches the "snapper.snap" event.
// The snapper_item elements with left offsets that are inside the scroll viewport are listed in an array in the second callback argument's activeSlides property.
// use like this: $( ".snapper" ).bind( "snapper.snap", function( event, data ){ console.log( data.activeSlides ); } );
function snapEvent( elem, x, prefix ){
prefix = prefix ? prefix + "-" : "";
var activeSlides = itemsAtOffset( elem, x );
$( elem ).trigger( pluginName + "." + prefix + "snap", { activeSlides: activeSlides } );
}
// optional: include toss() in your page to get a smooth scroll, otherwise it'll just jump to the slide
function goto( elem, x, nothrow, callback ){
scrollListening = false;
snapEvent( elem, x );
var after = function(){
elem.scrollLeft = x;
$(elem).closest( "." + pluginName ).removeClass( pluginName + "-looping" );
$( elem ).trigger( pluginName + ".after-goto", {
activeSlides: itemsAtOffset( elem, x )
});
if( callback ){ callback(); };
snapEvent( elem, x, "after" );
scrollListening = true;
};
// backport to old toss for compat
if( !w.toss && w.overthrow ){
w.toss = w.overthrow.toss;
}
if( typeof w.toss !== "undefined" && !nothrow ){
w.toss( elem, { left: x, finished: after });
}
else {
elem.scrollLeft = x;
after();
}
}
var result, innerResult;
// Loop through snapper elements and enhance/bind events
result = this.each(function(){
if( innerResult !== undefined ){
return;
}
var self = this;
var $self = $( self );
var addNextPrev = $self.is( "[data-" + pluginName + "-nextprev]" );
var autoTimeout;
var $slider = $( "." + pluginName + "_pane", self );
var enhancedClass = pluginName + "-enhanced";
var $itemsContain = $slider.find( "." + pluginName + "_items" );
var $items = $itemsContain.children();
$items.addClass( pluginName + "_item" );
var numItems = $items.length;
var $nav = $( "." + pluginName + "_nav", self );
var navSelectedClass = pluginName + "_nav_item-selected";
var useDeepLinking = $self.attr( "data-snapper-deeplinking" ) !== "false";
if( typeof optionsOrMethod === "string" ){
var args = Array.prototype.slice.call(pluginArgs, 1);
var index;
var itemWidth = ( $itemsContain.width() / numItems );
switch(optionsOrMethod) {
case "goto":
index = args[0] % numItems;
// width / items * index to make sure it goes
offset = itemWidth * index;
goto( $slider[ 0 ], offset, false, function(){
// snap the scroll to the right position
snapScroll();
// invoke the callback if it was supplied
if( typeof args[1] === "function" ){
args[1]();
}
});
break;
case "getIndex":
// NOTE make the scroll left value large enough to overcome
// subpixel widths
innerResult = Math.floor(($slider[ 0 ].scrollLeft + 1)/ itemWidth);
break;
case "updateWidths":
updateWidths();
break;
}
return;
}
// NOTE all state manipulation has to come after method invocation to
// avoid monkeying with the DOM when it's unwarranted
var $navInner = $nav.find( "." + pluginName + "_nav_inner" );
if( !$navInner.length ){
$navInner = $( '<div class="'+ pluginName + '_nav_inner"></div>' ).append( $nav.children() ).appendTo( $nav );
}
// give the pane a tabindex for arrow key handling
$slider.attr("tabindex", "0");
function getAutoplayInterval() {
var autoTiming = $self.attr( "data-autoplay" ) || $self.attr( "data-snapper-autoplay" );
var parseError = false;
if( autoTiming ) {
try {
autoTiming = parseInt(autoTiming, 10);
} catch(e) {
parseError = true;
}
// if NaN or there was an error throw an exception
if( !autoTiming || parseError ) {
var msg = "Snapper: `data-autoplay` must have an natural number value.";
throw new Error(msg);
}
}
return autoTiming;
}
// this function updates the widths of the items within the slider, and their container.
// It factors in margins and converts those to values that make sense when all items are placed in a long row
function updateWidths(){
var itemsContainStyle = $itemsContain.attr( "style" );
$itemsContain.attr( "style", "" );
var itemStyle = $items.eq(0).attr( "style" );
$items.eq(0).attr( "style", "" );
var sliderWidth = $slider.width();
var itemWidth = $items.eq(0).width();
var computed = w.getComputedStyle( $items[ 0 ], null );
var itemLeftMargin = parseFloat( computed.getPropertyValue( "margin-left" ) );
var itemRightMargin = parseFloat( computed.getPropertyValue( "margin-right" ) );
var outerItemWidth = itemWidth + itemLeftMargin + itemRightMargin;
$items.eq(0).attr( "style", itemStyle );
$itemsContain.attr( "style", itemsContainStyle );
var parentWidth = numItems / Math.round(sliderWidth / outerItemWidth) * 100;
var iPercentWidth = itemWidth / sliderWidth * 100;
var iPercentRightMargin = itemRightMargin / sliderWidth * 100;
var iPercentLeftMargin = itemLeftMargin / sliderWidth * 100;
var outerPercentWidth = iPercentWidth + iPercentLeftMargin + iPercentRightMargin;
var percentAsWidth = iPercentWidth / outerPercentWidth;
var percentAsRightMargin = iPercentRightMargin / outerPercentWidth;
var percentAsLeftMargin = iPercentLeftMargin / outerPercentWidth;
$itemsContain.css( "width", parentWidth + "%");
$items.css( "width", 100 / numItems * percentAsWidth + "%" );
$items.css( "margin-left", 100 / numItems * percentAsLeftMargin + "%" );
$items.css( "margin-right", 100 / numItems * percentAsRightMargin + "%" );
}
updateWidths();
$( self ).addClass( enhancedClass );
// if the nextprev option is set, add the nextprev nav
if( addNextPrev ){
var $nextprev = $( '<ul class="snapper_nextprev"><li class="snapper_nextprev_item"><a href="#prev" class="snapper_nextprev_prev">Prev</a></li><li class="snapper_nextprev_item"><a href="#next" class="snapper_nextprev_next">Next</a></li></ul>' );
var $nextprevContain = $( ".snapper_nextprev_contain", self );
if( !$nextprevContain.length ){
$nextprevContain = $( self );
}
$nextprev.appendTo( $nextprevContain );
}
// This click binding will allow deep-linking to slides without causing the page to scroll to the carousel container
// this also supports click handling for generated next/prev links
$( "a", this ).bind( "click", function( e ){
clearTimeout(autoTimeout);
var slideID = $( this ).attr( "href" );
if( $( this ).is( ".snapper_nextprev_next" ) ){
e.preventDefault();
return arrowNavigate( true );
}
else if( $( this ).is( ".snapper_nextprev_prev" ) ){
e.preventDefault();
return arrowNavigate( false );
}
// internal links to slides
else if( slideID.indexOf( "#" ) === 0 && slideID.length > 1 ){
e.preventDefault();
var $slide = $( slideID, self );
if( $slide.length ){
goto( $slider[ 0 ], $slide[ 0 ].offsetLeft );
if( useDeepLinking && "replaceState" in w.history ){
w.history.replaceState( {}, document.title, slideID );
}
}
}
});
// arrow key bindings for next/prev
$( this )
.bind( "keydown", function( e ){
if( e.keyCode === 37 || e.keyCode === 38 ){
clearTimeout(autoTimeout);
e.preventDefault();
e.stopImmediatePropagation();
arrowNavigate( false );
}
if( e.keyCode === 39 || e.keyCode === 40 ){
clearTimeout(autoTimeout);
e.preventDefault();
e.stopImmediatePropagation();
arrowNavigate( true );
}
} );
var snapScrollCancelled = false;
// snap to nearest slide. Useful after a scroll stops, for polyfilling snap points
function snapScroll(){
if(isTouched){
snapScrollCancelled = true;
return;
}
var currScroll = $slider[ 0 ].scrollLeft;
var width = $itemsContain.width();
var itemWidth = $items[ 1 ] ? $items[ 1 ].offsetLeft : outerWidth( $items.eq( 0 ) );
var roundedScroll = Math.round(currScroll/itemWidth)*itemWidth;
var maxScroll = width - $slider.width();
if( roundedScroll > maxScroll ){
roundedScroll = maxScroll;
}
if( currScroll !== roundedScroll ){
if( snapSupported ){
snapEvent( $slider[ 0 ], roundedScroll );
snapEvent( $slider[ 0 ], roundedScroll, "after" );
}
else {
goto( $slider[ 0 ], roundedScroll );
}
}
snapScrollCancelled = false;
}
// retain snapping on resize (necessary even in scroll-snap supporting browsers currently, unfortunately)
var startSlide;
var afterResize;
function snapStay(){
var currScroll = $slider[ 0 ].scrollLeft;
var numItems = $items.length;
var width = $itemsContain.width();
if( startSlide === undefined ){
startSlide = Math.round( currScroll / width * numItems );
}
if( afterResize ){
clearTimeout( afterResize );
}
afterResize = setTimeout( function(){
updateWidths();
goto( $slider[ 0 ], $items[ startSlide ].offsetLeft, true );
startSlide = afterResize = undefined;
}, 50 );
}
$( w ).bind( "resize", snapStay );
// next/prev links or arrows should loop back to the other end when an extreme is reached
function arrowNavigate( forward ){
var currScroll = $slider[ 0 ].scrollLeft;
var width = $itemsContain.width();
var itemWidth = outerWidth( $slider );
var maxScroll = width - itemWidth - 5;
if( forward ){
if( currScroll >= maxScroll ){
$self.addClass( pluginName + "-looping" );
return first();
}
else {
return next();
}
}
else {
if( currScroll === 0 ){
$self.addClass( pluginName + "-looping" );
return last();
}
else {
return prev();
}
}
}
// advance slide one full scrollpane's width forward
function next(){
goto( $slider[ 0 ], $slider[ 0 ].scrollLeft + ( $itemsContain.width() / numItems ), false, function(){
$slider.trigger( pluginName + ".after-next" );
});
}
// advance slide one full scrollpane's width backwards
function prev(){
goto( $slider[ 0 ], $slider[ 0 ].scrollLeft - ( $itemsContain.width() / numItems ), false, function(){
$slider.trigger( pluginName + ".after-prev" );
});
}
// go to first slide
function first(){
goto( $slider[ 0 ], 0 );
}
// go to last slide
function last(){
goto( $slider[ 0 ], $itemsContain.width() - $slider.width() );
}
// update thumbnail state on pane scroll
if( $nav.length ){
// function for scrolling to the xy of the active thumbnail
function scrollNav(elem, x, y){
if( typeof w.toss !== "undefined" ){
w.toss( elem, { left: x, top:y });
}
else {
elem.scrollLeft = x;
elem.scrollTop = y;
}
}
var lastActiveItem;
function activeItem( force ){
var currTime = new Date().getTime();
if( force || lastActiveItem && currTime - lastActiveItem < 200 ){
return;
}
lastActiveItem = currTime;
var currScroll = $slider[ 0 ].scrollLeft;
var width = outerWidth( $itemsContain );
var navWidth = outerWidth( $nav );
var navHeight = outerHeight( $nav );
var activeIndex = Math.round( currScroll / width * numItems ) || 0;
var childs = $nav.find( "a" ).removeClass( navSelectedClass );
var activeChild = childs.eq( activeIndex ).addClass( navSelectedClass );
var thumbX = activeChild[ 0 ].offsetLeft - (navWidth/2);
var thumbY = activeChild[ 0 ].offsetTop - (navHeight/2);
scrollNav( $navInner[ 0 ], thumbX, thumbY );
}
// set active item on init
activeItem();
$slider.bind( "scroll", activeItem );
}
// apply snapping after scroll, in browsers that don't support CSS scroll-snap
var scrollStop;
var scrolling;
var lastScroll = 0;
$slider.bind( "scroll", function(e){
lastScroll = new Date().getTime();
scrolling = true;
});
setInterval(function(){
if( scrolling && lastScroll <= new Date().getTime() - 150) {
snapScroll();
if( activeItem ){
activeItem( true );
}
scrolling = false;
}
}, 150);
var isTouched = false;
// if a touch event is fired on the snapper we know the user is trying to
// interact with it and we should disable the auto play
$slider.bind("touchstart", function(){
clearTimeout(autoTimeout);
isTouched = true;
});
$slider.bind("touchend", function(){
isTouched = false;
if(snapScrollCancelled && !scrolling){
snapScroll();
scrolling = false;
}
});
// if the `data-autoplay` attribute is assigned a natural number value
// use it to make the slides cycle until there is a user interaction
function autoplay( autoTiming ) {
if( autoTiming ){
// autoTimeout is cleared in each user interaction binding
autoTimeout = setTimeout(function(){
var timeout = getAutoplayInterval();
if( timeout ) {
arrowNavigate(true);
autoplay( timeout );
}
}, autoTiming);
}
}
autoplay( getAutoplayInterval() );
});
return (innerResult !== undefined ? innerResult : result);
};
}( this, jQuery ));
| froala/cdnjs | ajax/libs/fg-snapper/3.1.2/snapper.js | JavaScript | mit | 14,822 |
<?php
namespace Concrete\Core\File\Image\Thumbnail\Type;
use Concrete\Core\File\Version as FileVersion;
use Core;
/**
* Handles regular and retina thumbnails. e.g. Each thumbnail type has two versions of itself
* the regular one and the 2x one.
*/
class Version
{
protected $directoryName;
protected $handle;
protected $name;
protected $width;
protected $height;
protected $isDoubledVersion;
public function __construct($directoryName, $handle, $name, $width, $height, $isDoubledVersion = false)
{
$this->handle = $handle;
$this->name = $name;
$this->width = $width;
$this->height = $height;
$this->directoryName = $directoryName;
$this->isDoubledVersion = (bool) $isDoubledVersion;
}
/**
* @param mixed $handle
*/
public function setHandle($handle)
{
$this->handle = $handle;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @param mixed $name
*/
public function setHeight($height)
{
$this->height = $height;
}
/**
* @return mixed
*/
public function getHandle()
{
return $this->handle;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/** Returns the display name for this thumbnail type version (localized and escaped accordingly to $format)
* @param string $format = 'html'
* Escape the result in html format (if $format is 'html').
* If $format is 'text' or any other value, the display name won't be escaped.
*
* @return string
*/
public function getDisplayName($format = 'html')
{
$value = tc('ThumbnailTypeName', $this->getName());
if ($this->isDoubledVersion) {
$value = t('%s (Retina Version)', $value);
}
switch ($format) {
case 'html':
return h($value);
case 'text':
default:
return $value;
}
}
/**
* @param mixed $width
*/
public function setWidth($width)
{
$this->width = $width;
}
/**
* @return mixed
*/
public function getWidth()
{
return $this->width;
}
/**
* @return mixed
*/
public function getHeight()
{
return $this->height;
}
/**
* @param mixed $directoryName
*/
public function setDirectoryName($directoryName)
{
$this->directoryName = $directoryName;
}
/**
* @return mixed
*/
public function getDirectoryName()
{
return $this->directoryName;
}
public static function getByHandle($handle)
{
$list = Type::getVersionList();
foreach ($list as $version) {
if ($version->getHandle() == $handle) {
return $version;
}
}
}
public function getFilePath(FileVersion $fv)
{
$prefix = $fv->getPrefix();
$filename = $fv->getFileName();
$hi = Core::make('helper/file');
$ii = Core::make('helper/concrete/file');
$f1 = REL_DIR_FILES_THUMBNAILS . '/' . $this->getDirectoryName() . $ii->prefix($prefix, $filename);
$f2 = REL_DIR_FILES_THUMBNAILS . '/' . $this->getDirectoryName() . $ii->prefix($prefix,
$hi->replaceExtension($filename, 'jpg'));
// 5.7.4 keeps extension; older sets it to .jpg
$filesystem = $fv->getFile()->getFileStorageLocationObject()->getFileSystemObject();
if ($filesystem->has($f1)) {
return $f1;
}
//fallback
return $f2;
}
}
| matahaka/concrete5test | concrete/src/File/Image/Thumbnail/Type/Version.php | PHP | mit | 3,753 |
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
namespace System.ServiceModel.Configuration
{
using System;
using System.ServiceModel;
using System.Configuration;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.Security.Cryptography;
using System.Xml;
public sealed partial class DnsElement : ConfigurationElement
{
public DnsElement()
{
}
[ConfigurationProperty(ConfigurationStrings.Value, DefaultValue = "")]
[StringValidator(MinLength = 0)]
public String Value
{
get { return (string)base[ConfigurationStrings.Value]; }
set
{
if (String.IsNullOrEmpty(value))
{
value = String.Empty;
}
base[ConfigurationStrings.Value] = value;
}
}
}
}
| sekcheong/referencesource | System.ServiceModel/System/ServiceModel/Configuration/DnsElement.cs | C# | mit | 1,090 |
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*=============================================================================
**
** Class: ICustomQueryInterface
**
**
** Purpose: This the interface that be implemented by class that want to
** customize the behavior of QueryInterface.
**
**
=============================================================================*/
namespace System.Runtime.InteropServices {
using System;
//====================================================================
// The enum of the return value of IQuerable.GetInterface
//====================================================================
[Serializable]
[System.Runtime.InteropServices.ComVisible(false)]
public enum CustomQueryInterfaceResult
{
Handled = 0,
NotHandled = 1,
Failed = 2,
}
//====================================================================
// The interface for customizing IQueryInterface
//====================================================================
[System.Runtime.InteropServices.ComVisible(false)]
public interface ICustomQueryInterface
{
[System.Security.SecurityCritical]
CustomQueryInterfaceResult GetInterface([In]ref Guid iid, out IntPtr ppv);
}
}
| sunandab/referencesource | mscorlib/system/runtime/interopservices/icustomqueryinterface.cs | C# | mit | 1,384 |
!function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var n=r(1),o=window&&window._rollbarConfig,i=o&&o.globalAlias||"Rollbar",a=window&&window[i]&&"function"==typeof window[i].shimId&&void 0!==window[i].shimId();if(window&&!window._rollbarStartTime&&(window._rollbarStartTime=(new Date).getTime()),!a&&o){var s=new n(o);window[i]=s}else window.rollbar=n,window._rollbarDidLoad=!0;t.exports=n},function(t,e,r){"use strict";function n(t,e){this.options=c.extend(!0,_,t);var r=new l(this.options,h,d);this.client=e||new u(this.options,r,p,"browser"),i(this.client.notifier),a(this.client.queue),(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(f.captureUncaughtExceptions(window,this),f.wrapGlobals(window,this)),(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&f.captureUnhandledRejections(window,this),this.instrumenter=new b(this.options,this.client.telemeter,this,window,document),this.instrumenter.instrument()}function o(t){var e="Rollbar is not initialized";p.error(e),t&&t(new Error(e))}function i(t){t.addTransform(m.handleItemWithError).addTransform(m.ensureItemHasSomethingToSay).addTransform(m.addBaseInfo).addTransform(m.addRequestInfo(window)).addTransform(m.addClientInfo(window)).addTransform(m.addPluginInfo(window)).addTransform(m.addBody).addTransform(g.addMessageWithError).addTransform(g.addTelemetryData).addTransform(m.scrubPayload).addTransform(m.userTransform).addTransform(g.itemToPayload)}function a(t){t.addPredicate(v.checkIgnore).addPredicate(v.userCheckIgnore).addPredicate(v.urlIsWhitelisted).addPredicate(v.messageIsIgnored)}function s(t){for(var e=0,r=t.length;e<r;++e)if(c.isFunction(t[e]))return t[e]}var u=r(2),c=r(5),l=r(10),p=r(12),f=r(15),h=r(16),d=r(17),m=r(18),g=r(22),v=r(23),y=r(19),b=r(24),w=null;n.init=function(t,e){return w?w.global(t).configure(t):w=new n(t,e)},n.prototype.global=function(t){return this.client.global(t),this},n.global=function(t){return w?w.global(t):void o()},n.prototype.configure=function(t,e){var r=this.options,n={};return e&&(n={payload:e}),this.options=c.extend(!0,{},r,t,n),this.client.configure(t,e),this},n.configure=function(t,e){return w?w.configure(t,e):void o()},n.prototype.lastError=function(){return this.client.lastError},n.lastError=function(){return w?w.lastError():void o()},n.prototype.log=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}},n.log=function(){if(w)return w.log.apply(w,arguments);var t=s(arguments);o(t)},n.prototype.debug=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}},n.debug=function(){if(w)return w.debug.apply(w,arguments);var t=s(arguments);o(t)},n.prototype.info=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}},n.info=function(){if(w)return w.info.apply(w,arguments);var t=s(arguments);o(t)},n.prototype.warn=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}},n.warn=function(){if(w)return w.warn.apply(w,arguments);var t=s(arguments);o(t)},n.prototype.warning=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}},n.warning=function(){if(w)return w.warning.apply(w,arguments);var t=s(arguments);o(t)},n.prototype.error=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}},n.error=function(){if(w)return w.error.apply(w,arguments);var t=s(arguments);o(t)},n.prototype.critical=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}},n.critical=function(){if(w)return w.critical.apply(w,arguments);var t=s(arguments);o(t)},n.prototype.handleUncaughtException=function(t,e,r,n,o,i){var a,s=c.makeUnhandledStackInfo(t,e,r,n,o,"onerror","uncaught exception",y);c.isError(o)?(a=this._createItem([t,o,i]),a._unhandledStackInfo=s):c.isError(e)?(a=this._createItem([t,e,i]),a._unhandledStackInfo=s):(a=this._createItem([t,i]),a.stackInfo=s),a.level=this.options.uncaughtErrorLevel,a._isUncaught=!0,this.client.log(a)},n.prototype.handleUnhandledRejection=function(t,e){var r="unhandled rejection was null or undefined!";r=t?t.message||String(t):r;var n,o=t&&t._rollbarContext||e&&e._rollbarContext;c.isError(t)?n=this._createItem([r,t,o]):(n=this._createItem([r,t,o]),n.stackInfo=c.makeUnhandledStackInfo(r,"",0,0,null,"unhandledrejection","",y)),n.level=this.options.uncaughtErrorLevel,n._isUncaught=!0,n._originalArgs=n._originalArgs||[],n._originalArgs.push(e),this.client.log(n)},n.prototype.wrap=function(t,e,r){try{var n;if(n=c.isFunction(e)?e:function(){return e||{}},!c.isFunction(t))return t;if(t._isWrap)return t;if(!t._rollbar_wrapped&&(t._rollbar_wrapped=function(){r&&c.isFunction(r)&&r.apply(this,arguments);try{return t.apply(this,arguments)}catch(r){var e=r;throw c.isType(e,"string")&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=t.toString(),window._rollbarWrappedError=e,e}},t._rollbar_wrapped._isWrap=!0,t.hasOwnProperty))for(var o in t)t.hasOwnProperty(o)&&(t._rollbar_wrapped[o]=t[o]);return t._rollbar_wrapped}catch(e){return t}},n.wrap=function(t,e){return w?w.wrap(t,e):void o()},n.prototype.captureEvent=function(t,e){return this.client.captureEvent(t,e)},n.captureEvent=function(t,e){return w?w.captureEvent(t,e):void o()},n.prototype.captureDomContentLoaded=function(t,e){return e||(e=new Date),this.client.captureDomContentLoaded(e)},n.prototype.captureLoad=function(t,e){return e||(e=new Date),this.client.captureLoad(e)},n.prototype._createItem=function(t){return c.createItem(t,p,this)};var _={version:"2.2.3",scrubFields:["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","secret_key","secretKey","secretToken"],logLevel:"debug",reportLevel:"debug",uncaughtErrorLevel:"error",endpoint:"api.rollbar.com/api/1/",verbose:!1,enabled:!0};t.exports=n},function(t,e,r){"use strict";function n(t,e,r,o){this.options=u.extend(!0,{},t),this.logger=r,n.rateLimiter.setPlatformOptions(o,this.options),this.queue=new i(n.rateLimiter,e,r,this.options),this.notifier=new a(this.queue,this.options),this.telemeter=new s(this.options),this.lastError=null}var o=r(3),i=r(4),a=r(8),s=r(9),u=r(5),c={maxItems:0,itemsPerMinute:60};n.rateLimiter=new o(c),n.prototype.global=function(t){return n.rateLimiter.configureGlobal(t),this},n.prototype.configure=function(t,e){this.notifier&&this.notifier.configure(t);var r=this.options,n={};return e&&(n={payload:e}),this.options=u.extend(!0,{},r,t,n),this},n.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},n.prototype.debug=function(t){this._log("debug",t)},n.prototype.info=function(t){this._log("info",t)},n.prototype.warn=function(t){this._log("warning",t)},n.prototype.warning=function(t){this._log("warning",t)},n.prototype.error=function(t){this._log("error",t)},n.prototype.critical=function(t){this._log("critical",t)},n.prototype.wait=function(t){this.queue.wait(t)},n.prototype.captureEvent=function(t,e){return this.telemeter.captureEvent(t,e)},n.prototype.captureDomContentLoaded=function(t){return this.telemeter.captureDomContentLoaded(t)},n.prototype.captureLoad=function(t){return this.telemeter.captureLoad(t)},n.prototype._log=function(t,e){if(!this._sameAsLastError(e))try{var r=null;e.callback&&(r=e.callback,delete e.callback),e.level=e.level||t,e.telemetryEvents=this.telemeter.copyEvents(),this.telemeter._captureRollbarItem(e),this.notifier.log(e,r)}catch(t){this.logger.error(t)}},n.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},n.prototype._sameAsLastError=function(t){return!(!this.lastError||this.lastError!==t.err)||(this.lastError=t.err,!1)},t.exports=n},function(t,e){"use strict";function r(t){this.startTime=(new Date).getTime(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(t)}function n(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>=e}function o(t,e,r,n,o){var a=null;return r&&(r=new Error(r)),r||n||(a=i(t,e,o)),{error:r,shouldSend:n,payload:a}}function i(t,e,r){var n=e.environment||e.payload&&e.payload.environment,o={body:{message:{body:"maxItems has been hit. Ignoring errors until reset.",extra:{maxItems:r}}},language:"javascript",environment:n,notifier:{version:e.notifier&&e.notifier.version||e.version}};return"browser"===t?(o.platform="browser",o.framework="browser-js",o.notifier.name="rollbar-browser-js"):"server"===t&&(o.framework=e.framework||"node-js",o.notifier.name=e.notifier.name),o}r.globalSettings={startTime:(new Date).getTime(),maxItems:void 0,itemsPerMinute:void 0},r.prototype.configureGlobal=function(t){void 0!==t.startTime&&(r.globalSettings.startTime=t.startTime),void 0!==t.maxItems&&(r.globalSettings.maxItems=t.maxItems),void 0!==t.itemsPerMinute&&(r.globalSettings.itemsPerMinute=t.itemsPerMinute)},r.prototype.shouldSend=function(t,e){e=e||(new Date).getTime(),e-this.startTime>=6e4&&(this.startTime=e,this.perMinCounter=0);var i=r.globalSettings.maxItems,a=r.globalSettings.itemsPerMinute;if(n(t,i,this.counter))return o(this.platform,this.platformOptions,i+" max items reached",!1);if(n(t,a,this.perMinCounter))return o(this.platform,this.platformOptions,a+" items per minute reached",!1);this.counter++,this.perMinCounter++;var s=!n(t,i,this.counter);return o(this.platform,this.platformOptions,null,s,i)},r.prototype.setPlatformOptions=function(t,e){this.platform=t,this.platformOptions=e},t.exports=r},function(t,e,r){"use strict";function n(t,e,r,n){this.rateLimiter=t,this.api=e,this.logger=r,this.options=n,this.predicates=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}var o=r(5);n.prototype.configure=function(t){this.api&&this.api.configure(t);var e=this.options;return this.options=o.extend(!0,{},e,t),this},n.prototype.addPredicate=function(t){return o.isFunction(t)&&this.predicates.push(t),this},n.prototype.addItem=function(t,e,r){e&&o.isFunction(e)||(e=function(){});var n=this._applyPredicates(t);if(n.stop)return void e(n.err);if(this.waitCallback)return void e();this._maybeLog(t,r),this.pendingRequests.push(t);try{this._makeApiRequest(t,function(r,n){this._dequeuePendingRequest(t),e(r,n)}.bind(this))}catch(r){this._dequeuePendingRequest(t),e(r)}},n.prototype.wait=function(t){o.isFunction(t)&&(this.waitCallback=t,this._maybeCallWait()||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval(function(){this._maybeCallWait()}.bind(this),500)))},n.prototype._applyPredicates=function(t){for(var e=null,r=0,n=this.predicates.length;r<n;r++)if(e=this.predicates[r](t,this.options),!e||void 0!==e.err)return{stop:!0,err:e.err};return{stop:!1,err:null}},n.prototype._makeApiRequest=function(t,e){var r=this.rateLimiter.shouldSend(t);r.shouldSend?this.api.postItem(t,function(r,n){r?this._maybeRetry(r,t,e):e(r,n)}.bind(this)):r.error?e(r.error):this.api.postItem(r.payload,e)};var i=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"];n.prototype._maybeRetry=function(t,e,r){var n=!1;if(this.options.retryInterval)for(var o=0,a=i.length;o<a;o++)if(t.code===i[o]){n=!0;break}n?this._retryApiRequest(e,r):r(t)},n.prototype._retryApiRequest=function(t,e){this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval(function(){for(;this.retryQueue.length;){var t=this.retryQueue.shift();this._makeApiRequest(t.item,t.callback)}}.bind(this),this.options.retryInterval))},n.prototype._dequeuePendingRequest=function(t){for(var e=this.pendingRequests.length;e>=0;e--)if(this.pendingRequests[e]==t)return this.pendingRequests.splice(e,1),void this._maybeCallWait()},n.prototype._maybeLog=function(t,e){if(this.logger&&this.options.verbose){var r=e;if(r=r||o.get(t,"body.trace.exception.message"),r=r||o.get(t,"body.trace_chain.0.exception.message"))return void this.logger.error(r);r=o.get(t,"body.message.body"),r&&this.logger.log(r)}},n.prototype._maybeCallWait=function(){return!(!o.isFunction(this.waitCallback)||0!==this.pendingRequests.length)&&(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),!0)},t.exports=n},function(t,e,r){"use strict";function n(){if(!C&&(C=!0,s(JSON)&&(a(JSON.stringify)&&(L.stringify=JSON.stringify),a(JSON.parse)&&(L.parse=JSON.parse)),!a(L.stringify)||!a(L.parse))){var t=r(7);t(L)}}function o(t,e){return e===i(t)}function i(t){var e=typeof t;return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function a(t){return o(t,"function")}function s(t){return!o(t,"undefined")}function u(t){var e=i(t);return"object"===e||"array"===e}function c(t){return o(t,"error")}function l(t,e,r){var n,i,a,s=o(t,"object"),u=o(t,"array"),c=[];if(s&&r.indexOf(t)!==-1)return t;if(r.push(t),s)for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&c.push(n);else if(u)for(a=0;a<t.length;++a)c.push(a);for(a=0;a<c.length;++a)n=c[a],i=t[n],t[n]=e(n,i,r);return t}function p(){return"********"}function f(){var t=O(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:7&r|8).toString(16)});return e}function h(t){var e=d(t);return""===e.anchor&&(e.source=e.source.replace("#","")),t=e.source.replace("?"+e.query,"")}function d(t){if(!o(t,"string"))throw new Error("received invalid input");for(var e=A,r=e.parser[e.strictMode?"strict":"loose"].exec(t),n={},i=e.key.length;i--;)n[e.key[i]]=r[i]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(t,r,o){r&&(n[e.q.name][r]=o)}),n}function m(t,e,r){r=r||{},r.access_token=t;var n,o=[];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&o.push([n,r[n]].join("="));var i="?"+o.sort().join("&");e=e||{},e.path=e.path||"";var a,s=e.path.indexOf("?"),u=e.path.indexOf("#");s!==-1&&(u===-1||u>s)?(a=e.path,e.path=a.substring(0,s)+i+"&"+a.substring(s+1)):u!==-1?(a=e.path,e.path=a.substring(0,u)+i+a.substring(u)):e.path=e.path+i}function g(t,e){if(e=e||t.protocol,!e&&t.port&&(80===t.port?e="http:":443===t.port&&(e="https:")),e=e||"https:",!t.hostname)return null;var r=e+"//"+t.hostname;return t.port&&(r=r+":"+t.port),t.path&&(r+=t.path),r}function v(t,e){var r,n;try{r=L.stringify(t)}catch(o){if(e&&a(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function y(t){var e,r;try{e=L.parse(t)}catch(t){r=t}return{error:r,value:e}}function b(t,e,r,n,o,i,a,s){var u={url:e||"",line:r,column:n};u.func=s.guessFunctionName(u.url,u.line),u.context=s.gatherContext(u.url,u.line);var c=document&&document.location&&document.location.href,l=window&&window.navigator&&window.navigator.userAgent;return{mode:i,message:o?String(o):t||a,url:c,stack:[u],useragent:l}}function w(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function _(t,e,r,n){for(var o,a,s,u,c,l,p=[],h=0,d=t.length;h<d;++h){l=t[h];var m=i(l);switch(m){case"undefined":break;case"string":o?p.push(l):o=l;break;case"function":u=w(e,l);break;case"date":p.push(l);break;case"error":case"domexception":a?p.push(l):a=l;break;case"object":case"array":if(l instanceof Error||"undefined"!=typeof DOMException&&l instanceof DOMException){a?p.push(l):a=l;break}if(n&&"object"===m&&!c){for(var g=0,v=n.length;g<v;++g)if(void 0!==l[n[g]]){c=l;break}if(c)break}s?p.push(l):s=l;break;default:if(l instanceof Error||"undefined"!=typeof DOMException&&l instanceof DOMException){a?p.push(l):a=l;break}p.push(l)}}p.length>0&&(s=N(!0,{},s),s.extraArgs=p);var y={message:o,err:a,custom:s,timestamp:O(),callback:u,uuid:f()};return s&&void 0!==s.level&&(y.level=s.level,delete s.level),n&&c&&(y.request=c),y._originalArgs=t,y}function x(t,e){if(t){var r=e.split("."),n=t;try{for(var o=0,i=r.length;o<i;++o)n=n[r[o]]}catch(t){n=void 0}return n}}function k(t,e,r){if(t){var n=e.split("."),o=n.length;if(!(o<1)){if(1===o)return void(t[n[0]]=r);try{for(var i=t[n[0]]||{},a=i,s=1;s<o-1;s++)i[n[s]]=i[n[s]]||{},i=i[n[s]];i[n[o-1]]=r,t[n[0]]=a}catch(t){return}}}}function E(t,e){function r(t,e,r,n,o,i){return e+p(i)}function n(t){var e;if(o(t,"string"))for(e=0;e<u.length;++e)t=t.replace(u[e],r);return t}function i(t,e){var r;for(r=0;r<s.length;++r)if(s[r].test(t)){e=p(e);break}return e}function a(t,e,r){var s=i(t,e);return s===e?o(e,"object")||o(e,"array")?l(e,a,r):n(s):s}e=e||[];var s=I(e),u=T(e);return l(t,a,[]),t}function I(t){for(var e,r=[],n=0;n<t.length;++n)e="\\[?(%5[bB])?"+t[n]+"\\[?(%5[bB])?\\]?(%5[dD])?",r.push(new RegExp(e,"i"));return r}function T(t){for(var e,r=[],n=0;n<t.length;++n)e="\\[?(%5[bB])?"+t[n]+"\\[?(%5[bB])?\\]?(%5[dD])?",r.push(new RegExp("("+e+"=)([^&\\n]+)","igm"));return r}function S(t){var e,r,n,o=[];for(e=0,r=t.length;e<r;e++)n=t[e],"object"==typeof n?(n=v(n),n=n.error||n.value,n.length>500&&(n=n.substr(0,500)+"...")):"undefined"==typeof n&&(n="undefined"),o.push(n);return o.join(" ")}function O(){return Date.now?Date.now():+new Date}var N=r(6),L={},C=!1;n();var j={debug:0,info:1,warning:2,error:3,critical:4},A={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};t.exports={isType:o,typeName:i,isFunction:a,isIterable:u,isError:c,extend:N,traverse:l,redact:p,uuid4:f,LEVELS:j,sanitizeUrl:h,addParamsAndAccessTokenToPath:m,formatUrl:g,stringify:v,jsonParse:y,makeUnhandledStackInfo:b,createItem:_,get:x,set:k,scrub:E,formatArgsAsString:S,now:O}},function(t,e){"use strict";var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===n.call(t)},i=function(t){if(!t||"[object Object]"!==n.call(t))return!1;var e=r.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!o)return!1;var i;for(i in t);return"undefined"==typeof i||r.call(t,i)};t.exports=function t(){var e,r,n,a,s,u,c=arguments[0],l=1,p=arguments.length,f=!1;for("boolean"==typeof c?(f=c,c=arguments[1]||{},l=2):("object"!=typeof c&&"function"!=typeof c||null==c)&&(c={});l<p;++l)if(e=arguments[l],null!=e)for(r in e)n=c[r],a=e[r],c!==a&&(f&&a&&(i(a)||(s=o(a)))?(s?(s=!1,u=n&&o(n)?n:[]):u=n&&i(n)?n:{},c[r]=t(f,u,a)):"undefined"!=typeof a&&(c[r]=a));return c}},function(t,e){var r=function(t){function e(t){return t<10?"0"+t:t}function r(){return this.valueOf()}function n(t){return i.lastIndex=0,i.test(t)?'"'+t.replace(i,function(t){var e=u[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function o(t,e){var r,i,u,l,p,f=a,h=e[t];switch(h&&"object"==typeof h&&"function"==typeof h.toJSON&&(h=h.toJSON(t)),"function"==typeof c&&(h=c.call(e,t,h)),typeof h){case"string":return n(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":return String(h);case"object":if(!h)return"null";if(a+=s,p=[],"[object Array]"===Object.prototype.toString.apply(h)){for(l=h.length,r=0;r<l;r+=1)p[r]=o(r,h)||"null";return u=0===p.length?"[]":a?"[\n"+a+p.join(",\n"+a)+"\n"+f+"]":"["+p.join(",")+"]",a=f,u}if(c&&"object"==typeof c)for(l=c.length,r=0;r<l;r+=1)"string"==typeof c[r]&&(i=c[r],u=o(i,h),u&&p.push(n(i)+(a?": ":":")+u));else for(i in h)Object.prototype.hasOwnProperty.call(h,i)&&(u=o(i,h),u&&p.push(n(i)+(a?": ":":")+u));return u=0===p.length?"{}":a?"{\n"+a+p.join(",\n"+a)+"\n"+f+"}":"{"+p.join(",")+"}",a=f,u}}var i=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=r,Number.prototype.toJSON=r,String.prototype.toJSON=r);var a,s,u,c;"function"!=typeof t.stringify&&(u={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t.stringify=function(t,e,r){var n;if(a="",s="","number"==typeof r)for(n=0;n<r;n+=1)s+=" ";else"string"==typeof r&&(s=r);if(c=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return o("",{"":t})}),"function"!=typeof t.parse&&(t.parse=function(){function t(t){return t.replace(/\\(?:u(.{4})|([^u]))/g,function(t,e,r){return e?String.fromCharCode(parseInt(e,16)):a[r]})}var e,r,n,o,i,a={"\\":"\\",'"':'"',"/":"/",t:"\t",n:"\n",r:"\r",f:"\f",b:"\b"},s={go:function(){e="ok"},firstokey:function(){o=i,e="colon"},okey:function(){o=i,e="colon"},ovalue:function(){e="ocomma"},firstavalue:function(){e="acomma"},avalue:function(){e="acomma"}},u={go:function(){e="ok"},ovalue:function(){e="ocomma"},firstavalue:function(){e="acomma"},avalue:function(){e="acomma"}},c={"{":{go:function(){r.push({state:"ok"}),n={},e="firstokey"},ovalue:function(){r.push({container:n,state:"ocomma",key:o}),n={},e="firstokey"},firstavalue:function(){r.push({container:n,state:"acomma"}),n={},e="firstokey"},avalue:function(){r.push({container:n,state:"acomma"}),n={},e="firstokey"}},"}":{firstokey:function(){var t=r.pop();i=n,n=t.container,o=t.key,e=t.state},ocomma:function(){var t=r.pop();n[o]=i,i=n,n=t.container,o=t.key,e=t.state}},"[":{go:function(){r.push({state:"ok"}),n=[],e="firstavalue"},ovalue:function(){r.push({container:n,state:"ocomma",key:o}),n=[],e="firstavalue"},firstavalue:function(){r.push({container:n,state:"acomma"}),n=[],e="firstavalue"},avalue:function(){r.push({container:n,state:"acomma"}),n=[],e="firstavalue"}},"]":{firstavalue:function(){var t=r.pop();i=n,n=t.container,o=t.key,e=t.state},acomma:function(){var t=r.pop();n.push(i),i=n,n=t.container,o=t.key,e=t.state}},":":{colon:function(){if(Object.hasOwnProperty.call(n,o))throw new SyntaxError("Duplicate key '"+o+'"');e="ovalue"}},",":{ocomma:function(){n[o]=i,e="okey"},acomma:function(){n.push(i),e="avalue"}},true:{go:function(){i=!0,e="ok"},ovalue:function(){i=!0,e="ocomma"},firstavalue:function(){i=!0,e="acomma"},avalue:function(){i=!0,e="acomma"}},false:{go:function(){i=!1,e="ok"},ovalue:function(){i=!1,e="ocomma"},firstavalue:function(){i=!1,e="acomma"},avalue:function(){i=!1,e="acomma"}},null:{go:function(){i=null,e="ok"},ovalue:function(){i=null,e="ocomma"},firstavalue:function(){i=null,e="acomma"},avalue:function(){i=null,e="acomma"}}};return function(n,o){var a,l=/^[\u0020\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/;e="go",r=[];try{for(;;){if(a=l.exec(n),!a)break;a[1]?c[a[1]][e]():a[2]?(i=+a[2],u[e]()):(i=t(a[3]),s[e]()),n=n.slice(a[0].length)}}catch(t){e=t}if("ok"!==e||/[^\u0020\t\n\r]/.test(n))throw e instanceof SyntaxError?e:new SyntaxError("JSON");return"function"==typeof o?function t(e,r){var n,a,s=e[r];if(s&&"object"==typeof s)for(n in i)Object.prototype.hasOwnProperty.call(s,n)&&(a=t(s,n),void 0!==a?s[n]=a:delete s[n]);return o.call(e,r,s)}({"":i},""):i}}())};t.exports=r},function(t,e,r){"use strict";function n(t,e){this.queue=t,this.options=e,this.transforms=[]}var o=r(5);n.prototype.configure=function(t){this.queue&&this.queue.configure(t);var e=this.options;return this.options=o.extend(!0,{},e,t),this},n.prototype.addTransform=function(t){return o.isFunction(t)&&this.transforms.push(t),this},n.prototype.log=function(t,e){if(e&&o.isFunction(e)||(e=function(){}),!this.options.enabled)return e(new Error("Rollbar is not enabled"));var r=t.err;this._applyTransforms(t,function(t,n){return t?e(t,null):void this.queue.addItem(n,e,r)}.bind(this))},n.prototype._applyTransforms=function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,a=function(t,s){return t?void e(t,null):(r++,r===n?void e(null,s):void o[r](s,i,a))};a(null,t)},t.exports=n},function(t,e,r){"use strict";function n(t){this.queue=[],this.options=i.extend(!0,{},t);var e=this.options.maxTelemetryEvents||a;this.maxQueueSize=Math.max(0,Math.min(e,a))}function o(t,e){if(e)return e;var r={error:"error",manual:"info"};return r[t]||"info"}var i=r(5),a=100;n.prototype.copyEvents=function(){return Array.prototype.slice.call(this.queue,0)},n.prototype.capture=function(t,e,r,n,a){var s={level:o(t,r),type:t,timestamp_ms:a||i.now(),body:e,source:"client"};return n&&(s.uuid=n),this.push(s),s},n.prototype.captureEvent=function(t,e,r){return this.capture("manual",t,e,r)},n.prototype.captureError=function(t,e,r,n){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,r,n)},n.prototype.captureLog=function(t,e,r,n){return this.capture("log",{message:t},e,r,n)},n.prototype.captureNetwork=function(t,e,r){e=e||"xhr",t.subtype=t.subtype||e;var n=this.levelFromStatus(t.status_code);return this.capture("network",t,n,r)},n.prototype.levelFromStatus=function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"},n.prototype.captureDom=function(t,e,r,n,o){var i={subtype:t,element:e};return void 0!==r&&(i.value=r),void 0!==n&&(i.checked=n),this.capture("dom",i,"info",o)},n.prototype.captureNavigation=function(t,e,r){return this.capture("navigation",{from:t,to:e},"info",r)},n.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},n.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},n.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},n.prototype._captureRollbarItem=function(t){return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},n.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=n},function(t,e,r){"use strict";function n(t,e,r,n){this.options=t,this.transport=e,this.url=r,this.jsonBackup=n,this.accessToken=t.accessToken,this.transportOptions=o(t,r)}function o(t,e){return a.getTransportFromOptions(t,s,e)}var i=r(5),a=r(11),s={hostname:"api.rollbar.com",path:"/api/1",search:null,version:"1",protocol:"https:",port:443};n.prototype.postItem=function(t,e){var r=a.transportOptions(this.transportOptions,"/item/","POST"),n=a.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,r,n,e)},n.prototype.configure=function(t){var e=this.oldOptions;return this.options=i.extend(!0,{},e,t),this.transportOptions=o(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=n},function(t,e,r){"use strict";function n(t,e,r){if(s.isType(e.context,"object")){var n=s.stringify(e.context,r);n.error?e.context="Error: could not serialize 'context'":e.context=n.value||"",e.context.length>255&&(e.context=e.context.substr(0,255))}return{access_token:t,data:e}}function o(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,a=e.path,s=e.search,u=t.proxy;if(t.endpoint){var c=r.parse(t.endpoint);n=c.hostname,o=c.protocol,i=c.port,a=c.pathname,s=c.search}return{hostname:n,protocol:o,port:i,path:a,search:s,proxy:u}}function i(t,e,r){var n=t.protocol||"https:",o=t.port||("http:"===n?80:"https:"===n?443:void 0),i=t.hostname;return e=a(t.path,e),t.search&&(e+=t.search),t.proxy&&(e=n+"//"+i+e,i=t.proxy.host||t.proxy.hostname,o=t.proxy.port,n=t.proxy.protocol||n),{protocol:n,hostname:i,path:e,port:o,method:r}}function a(t,e){var r=/\/$/.test(t),n=/^\//.test(e);return r&&n?e=e.substring(1):r||n||(e="/"+e),t+e}var s=r(5);t.exports={buildPayload:n,getTransportFromOptions:o,transportOptions:i,appendPathToPath:a}},function(t,e,r){"use strict";function n(){var t=Array.prototype.slice.call(arguments,0);t.unshift("Rollbar:"),a.ieVersion()<=8?console.error(s.formatArgsAsString(t)):console.error.apply(console,t)}function o(){var t=Array.prototype.slice.call(arguments,0);t.unshift("Rollbar:"),a.ieVersion()<=8?console.info(s.formatArgsAsString(t)):console.info.apply(console,t)}function i(){var t=Array.prototype.slice.call(arguments,0);t.unshift("Rollbar:"),a.ieVersion()<=8?console.log(s.formatArgsAsString(t)):console.log.apply(console,t)}r(13);var a=r(14),s=r(5);t.exports={error:n,info:o,log:i}},function(t,e){!function(t){"use strict";t.console||(t.console={});for(var e,r,n=t.console,o=function(){},i=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=i.pop();)n[e]||(n[e]={});for(;r=a.pop();)n[r]||(n[r]=o)}("undefined"==typeof window?this:window)},function(t,e){"use strict";function r(){var t;if(!document)return t;for(var e=3,r=document.createElement("div"),n=r.getElementsByTagName("i");r.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->",n[0];);return e>4?e:t}var n={ieVersion:r};t.exports=n},function(t,e){"use strict";function r(t,e,r){if(t){var o;"function"==typeof e._rollbarOldOnError?o=e._rollbarOldOnError:t.onerror&&!t.onerror.belongsToShim&&(o=t.onerror,e._rollbarOldOnError=o);var i=function(){var r=Array.prototype.slice.call(arguments,0);n(t,e,o,r)};i.belongsToShim=r,t.onerror=i}}function n(t,e,r,n){t._rollbarWrappedError&&(n[4]||(n[4]=t._rollbarWrappedError),n[5]||(n[5]=t._rollbarWrappedError._rollbarContext),t._rollbarWrappedError=null),e.handleUncaughtException.apply(e,n),r&&r.apply(t,n)}function o(t,e,r){if(t){"function"==typeof t._rollbarURH&&t._rollbarURH.belongsToShim&&t.removeEventListener("unhandledrejection",t._rollbarURH);var n=function(t){var r=t.reason,n=t.promise,o=t.detail;!r&&o&&(r=o.reason,n=o.promise),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(r,n)};n.belongsToShim=r,t._rollbarURH=n,t.addEventListener("unhandledrejection",n)}}function i(t,e,r){if(t){var n,o,i="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(n=0;n<i.length;++n)o=i[n],t[o]&&t[o].prototype&&a(e,t[o].prototype,r)}}function a(t,e,r){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var o=function(e,r,o){n.call(this,e,t.wrap(r),o)};o._rollbarOldAdd=n,o.belongsToShim=r,e.addEventListener=o;for(var i=e.removeEventListener;i._rollbarOldRemove&&i.belongsToShim;)i=i._rollbarOldRemove;var a=function(t,e,r){i.call(this,t,e&&e._rollbar_wrapped||e,r)};a._rollbarOldRemove=i,a.belongsToShim=r,e.removeEventListener=a}}t.exports={captureUncaughtExceptions:r,captureUnhandledRejections:o,wrapGlobals:i}},function(t,e,r){"use strict";function n(t,e,r,n,o){n&&l.isFunction(n)||(n=function(){}),l.addParamsAndAccessTokenToPath(t,e,r);var a="GET",s=l.formatUrl(e);i(t,s,a,null,n,o)}function o(t,e,r,n,o){if(n&&l.isFunction(n)||(n=function(){}),!r)return n(new Error("Cannot send empty request"));var a=l.stringify(r);if(a.error)return n(a.error);
var s=a.value,u="POST",c=l.formatUrl(e);i(t,c,u,s,n,o)}function i(t,e,r,n,o,i){var f;if(f=i?i():a(),!f)return o(new Error("No way to send a request"));try{try{var h=function(){try{if(h&&4===f.readyState){h=void 0;var t=l.jsonParse(f.responseText);if(s(f))return void o(t.error,t.value);if(u(f)){if(403===f.status){var e=t.value&&t.value.message;p.error(e)}o(new Error(String(f.status)))}else{var r="XHR response had no status code (likely connection failure)";o(c(r))}}}catch(t){var n;n=t&&t.stack?t:new Error(t),o(n)}};f.open(r,e,!0),f.setRequestHeader&&(f.setRequestHeader("Content-Type","application/json"),f.setRequestHeader("X-Rollbar-Access-Token",t)),f.onreadystatechange=h,f.send(n)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return o(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===e.substring(0,5)&&(e="http"+e.substring(5));var d=new XDomainRequest;d.onprogress=function(){},d.ontimeout=function(){var t="Request timed out",e="ETIMEDOUT";o(c(t,e))},d.onerror=function(){o(new Error("Error during request"))},d.onload=function(){var t=l.jsonParse(d.responseText);o(t.error,t.value)},d.open(r,e,!0),d.send(n)}else o(new Error("Cannot find a method to transport a request"))}}catch(t){o(t)}}function a(){var t,e,r=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=r.length;for(e=0;e<n;e++)try{t=r[e]();break}catch(t){}return t}function s(t){return t&&t.status&&200===t.status}function u(t){return t&&l.isType(t.status,"number")&&t.status>=400&&t.status<600}function c(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}var l=r(5),p=r(12);t.exports={get:n,post:o}},function(t,e){"use strict";function r(t){var e,r,n={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(e=t.indexOf("//"),e!==-1?(n.protocol=t.substring(0,e),r=e+2):r=0,e=t.indexOf("@",r),e!==-1&&(n.auth=t.substring(r,e),r=e+1),e=t.indexOf("/",r),e===-1){if(e=t.indexOf("?",r),e===-1)return e=t.indexOf("#",r),e===-1?n.host=t.substring(r):(n.host=t.substring(r,e),n.hash=t.substring(e)),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),n;n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e}else n.host=t.substring(r,e),n.hostname=n.host.split(":")[0],n.port=n.host.split(":")[1],n.port&&(n.port=parseInt(n.port,10)),r=e;if(e=t.indexOf("#",r),e===-1?n.path=t.substring(r):(n.path=t.substring(r,e),n.hash=t.substring(e)),n.path){var o=n.path.split("?");n.pathname=o[0],n.query=o[1],n.search=n.query?"?"+n.query:null}return n}t.exports={parse:r}},function(t,e,r){"use strict";function n(t,e,r){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||m.parse(t.err)}catch(e){g.error("Error while parsing the error object.",e),t.message=t.err.message||t.err.description||t.message||String(t.err),delete t.err}r(null,t)}function o(t,e,r){t.message||t.stackInfo||t.custom||r(new Error("No message, stack info, or custom data"),null),r(null,t)}function i(t,e,r){var n=e.payload&&e.payload.environment||e.environment;t.data=d.extend(!0,{},t.data,{environment:n,level:t.level,endpoint:e.endpoint,platform:"browser",framework:"browser-js",language:"javascript",server:{},uuid:t.uuid,notifier:{name:"rollbar-browser-js",version:e.version}}),r(null,t)}function a(t){return function(e,r,n){return t&&t.location?(d.set(e,"data.request",{url:t.location.href,query_string:t.location.search,user_ip:"$remote_ip"}),void n(null,e)):n(null,e)}}function s(t){return function(e,r,n){return t?(d.set(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:t.navigator.userAgent,language:t.navigator.language,cookie_enabled:t.navigator.cookieEnabled,screen:{width:t.screen.width,height:t.screen.height}}}),void n(null,e)):n(null,e)}}function u(t){return function(e,r,n){if(!t||!t.navigator)return n(null,e);for(var o,i=[],a=t.navigator.plugins||[],s=0,u=a.length;s<u;++s)o=a[s],i.push({name:o.name,description:o.description});d.set(e,"data.client.javascript.plugins",i),n(null,e)}}function c(t,e,r){t.stackInfo?p(t,e,r):l(t,e,r)}function l(t,e,r){var n=t.message,o=t.custom;if(!n)if(o){var i=e.scrubFields,a=d.stringify(d.scrub(o,i));n=a.error||a.value||""}else n="";var s={body:n};o&&(s.extra=d.extend(!0,{},o)),d.set(t,"data.body",{message:s}),r(null,t)}function p(t,e,r){var n=t.data.description,o=t.stackInfo,i=t.custom,a=m.guessErrorClass(o.message),s=o.name||a[0],u=a[1],c={exception:{class:s,message:u}};n&&(c.exception.description=n);var p=o.stack;if(p&&0===p.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(p=t._unhandledStackInfo.stack),p){var f,h,g,v,y,b,w,_;for(c.frames=[],w=0;w<p.length;++w)f=p[w],h={filename:f.url?d.sanitizeUrl(f.url):"(unknown)",lineno:f.line||null,method:f.func&&"?"!==f.func?f.func:"[anonymous]",colno:f.column},h.method&&h.method.endsWith&&h.method.endsWith("._rollbar_wrapped")||(g=v=y=null,b=f.context?f.context.length:0,b&&(_=Math.floor(b/2),v=f.context.slice(0,_),g=f.context[_],y=f.context.slice(_)),g&&(h.code=g),(v||y)&&(h.context={},v&&v.length&&(h.context.pre=v),y&&y.length&&(h.context.post=y)),f.args&&(h.args=f.args),c.frames.push(h));c.frames.reverse(),i&&(c.extra=d.extend(!0,{},i)),d.set(t,"data.body",{trace:c}),r(null,t)}else t.message=s+": "+u,l(t,e,r)}function f(t,e,r){var n=e.scrubFields;d.scrub(t.data,n),r(null,t)}function h(t,e,r){var n=d.extend(!0,{},t);try{d.isFunction(e.transform)&&e.transform(n.data)}catch(n){return e.transform=null,g.error("Error while calling custom transform() function. Removing custom transform().",n),void r(null,t)}r(null,n)}var d=r(5),m=r(19),g=r(12);t.exports={handleItemWithError:n,ensureItemHasSomethingToSay:o,addBaseInfo:i,addRequestInfo:a,addClientInfo:s,addPluginInfo:u,addBody:c,scrubPayload:f,userTransform:h}},function(t,e,r){"use strict";function n(){return l}function o(){return null}function i(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=o(e.url,e.line),e}function a(t){function e(){var e=[];try{e=c.parse(t)}catch(t){e=[]}for(var r=[],n=0;n<e.length;n++)r.push(new i(e[n]));return r}return{stack:e(),message:t.message,name:t.name}}function s(t){return new a(t)}function u(t){if(!t)return["Unknown error. There was no error message to display.",""];var e=t.match(p),r="(unknown)";return e&&(r=e[e.length-1],t=t.replace((e[e.length-2]||"")+r+":",""),t=t.replace(/(^[\s]+|[\s]+$)/g,"")),[r,t]}var c=r(20),l="?",p=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");t.exports={guessFunctionName:n,guessErrorClass:u,gatherContext:o,parse:s,Stack:a,Frame:i}},function(t,e,r){var n,o,i;!function(a,s){"use strict";o=[r(21)],n=s,i="function"==typeof n?n.apply(e,o):n,!(void 0!==i&&(t.exports=i))}(this,function(t){"use strict";function e(t,e,r){if("function"==typeof Array.prototype.map)return t.map(e,r);for(var n=new Array(t.length),o=0;o<t.length;o++)n[o]=e.call(r,t[o]);return n}function r(t,e,r){if("function"==typeof Array.prototype.filter)return t.filter(e,r);for(var n=[],o=0;o<t.length;o++)e.call(r,t[o])&&n.push(t[o]);return n}var n=/(^|@)\S+\:\d+/,o=/^\s*at .*(\S+\:\d+|\(native\))/m,i=/^(eval@)?(\[native code\])?$/;return{parse:function(t){if("undefined"!=typeof t.stacktrace||"undefined"!=typeof t["opera#sourceloc"])return this.parseOpera(t);if(t.stack&&t.stack.match(o))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(t.indexOf(":")===-1)return[t];var e=t.replace(/[\(\)\s]/g,"").split(":"),r=e.pop(),n=e[e.length-1];if(!isNaN(parseFloat(n))&&isFinite(n)){var o=e.pop();return[e.join(":"),o,r]}return[e.join(":"),r,void 0]},parseV8OrIE:function(n){var i=r(n.stack.split("\n"),function(t){return!!t.match(o)},this);return e(i,function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var r=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(r.pop()),o=r.join(" ")||void 0,i="eval"===n[0]?void 0:n[0];return new t(o,void 0,i,n[1],n[2],e)},this)},parseFFOrSafari:function(n){var o=r(n.stack.split("\n"),function(t){return!t.match(i)},this);return e(o,function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),e.indexOf("@")===-1&&e.indexOf(":")===-1)return new t(e);var r=e.split("@"),n=this.extractLocation(r.pop()),o=r.shift()||void 0;return new t(o,void 0,n[0],n[1],n[2],e)},this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push(new t(void 0,void 0,s[2],s[1],void 0,n[i]))}return o},parseOpera10:function(e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push(new t(s[3]||void 0,void 0,s[2],s[1],void 0,n[i]))}return o},parseOpera11:function(o){var i=r(o.stack.split("\n"),function(t){return!!t.match(n)&&!t.match(/^Error created at/)},this);return e(i,function(e){var r,n=e.split("@"),o=this.extractLocation(n.pop()),i=n.shift()||"",a=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;i.match(/\(([^\)]*)\)/)&&(r=i.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new t(a,s,o[0],o[1],o[2],e)},this)}}})},function(t,e,r){var n,o,i;!function(r,a){"use strict";o=[],n=a,i="function"==typeof n?n.apply(e,o):n,!(void 0!==i&&(t.exports=i))}(this,function(){"use strict";function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t,e,r,n,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==r&&this.setFileName(r),void 0!==n&&this.setLineNumber(n),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return e.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(e){if(!t(e))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(e)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(e){if(!t(e))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(e)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){var e=this.getFunctionName()||"{anonymous}",r="("+(this.getArgs()||[]).join(",")+")",n=this.getFileName()?"@"+this.getFileName():"",o=t(this.getLineNumber())?":"+this.getLineNumber():"",i=t(this.getColumnNumber())?":"+this.getColumnNumber():"";return e+r+n+o+i}},e})},function(t,e,r){"use strict";function n(t,e,r){var n=e.payload||{};n.body&&delete n.body;var o=a.extend(!0,{},t.data,n);t._isUncaught&&(o._isUncaught=!0),r(null,o)}function o(t,e,r){t.telemetryEvents&&a.set(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function i(t,e,r){if(!t.message)return void r(null,t);var n="data.body.trace_chain.0",o=a.get(t,n);if(o||(n="data.body.trace",o=a.get(t,n)),o){if(!o.exception||!o.exception.description)return a.set(t,n+".exception.description",t.message),void r(null,t);var i=a.get(t,n+".extra")||{},s=a.extend(!0,{},i,{message:t.message});a.set(t,n+".extra",s)}r(null,t)}var a=r(5);t.exports={itemToPayload:n,addTelemetryData:o,addMessageWithError:i}},function(t,e,r){"use strict";function n(t,e){var r=t.level,n=c.LEVELS[r]||0,o=c.LEVELS[e.reportLevel]||0;return!(n<o)&&(!c.get(e,"plugins.jquery.ignoreAjaxErrors")||!c.get(t,"body.message.extra.isAjax"))}function o(t,e){var r=!!t._isUncaught;delete t._isUncaught;var n=t._originalArgs;delete t._originalArgs;try{if(c.isFunction(e.checkIgnore)&&e.checkIgnore(r,n,t))return!1}catch(t){e.checkIgnore=null,l.error("Error while calling custom checkIgnore(), removing",t)}return!0}function i(t,e){return s(t,e,"blacklist")}function a(t,e){return s(t,e,"whitelist")}function s(t,e,r){var n=!1;"blacklist"===r&&(n=!0);var o,i,a,s,u,p,f,h,d,m;try{if(o=n?e.hostBlackList:e.hostWhiteList,f=o&&o.length,i=c.get(t,"body.trace"),!o||0===f)return!0;if(!i||!i.frames)return!0;for(u=i.frames.length,d=0;d<u;d++){if(a=i.frames[d],s=a.filename,!c.isType(s,"string"))return!0;for(m=0;m<f;m++)if(p=o[m],h=new RegExp(p),h.test(s))return!n}}catch(t){n?e.hostBlackList=null:e.hostWhiteList=null;var g=n?"hostBlackList":"hostWhiteList";return l.error("Error while reading your configuration's "+g+" option. Removing custom "+g+".",t),!0}return n}function u(t,e){var r,n,o,i,a,s,u,p,f;try{if(a=!1,o=e.ignoredMessages,!o||0===o.length)return!0;if(u=t.body,p=c.get(u,"trace.exception.message"),f=c.get(u,"message.body"),r=p||f,!r)return!0;for(i=o.length,n=0;n<i&&(s=new RegExp(o[n],"gi"),!(a=s.test(r)));n++);}catch(t){e.ignoredMessages=null,l.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!a}var c=r(5),l=r(12);t.exports={checkIgnore:n,userCheckIgnore:o,urlIsBlacklisted:i,urlIsWhitelisted:a,messageIsIgnored:u}},function(t,e,r){"use strict";function n(t,e,r,n){var o=t[e];t[e]=r(o),n&&n.push([t,e,o])}function o(t){for(var e;t.length;)e=t.shift(),e[0][e[1]]=e[2]}function i(t,e,r,n,o){var i=t.autoInstrument;return i===!1?void(this.autoInstrument={}):(h.isType(i,"object")||(i=m),this.autoInstrument=h.extend(!0,{},m,i),this.telemeter=e,this.rollbar=r,this._window=n||{},this._document=o||{},this.replacements=[],this._location=this._window.location,void(this._lastHref=this._location&&this._location.href))}function a(t){return(t.getAttribute("type")||"").toLowerCase()}function s(t,e,r){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!r)return!0;t=a(t);for(var n=0;n<r.length;n++)if(r[n]===t)return!0;return!1}function u(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0}function c(t){for(var e,r=5,n=[],o=0;t&&o<r&&(e=f(t),"html"!==e.tagName);o++)n.push(e),t=t.parentNode;return n.reverse()}function l(t){for(var e,r,n=80,o=" > ",i=o.length,a=[],s=0,u=0;u<t.length&&(e=p(t[u]),r=s+a.length*i+e.length,!(u>0&&r>=n));u++)a.push(e),s+=e.length;return a.join(o)}function p(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));for(var r=0;r<t.attributes.length;r++)e.push("["+t.attributes[r].key+'="'+t.attributes[r].value+'"]');return e.join("")}function f(t){if(!t||!t.tagName)return null;var e,r,n,o,i={};i.tagName=t.tagName.toLowerCase(),t.id&&(i.id=t.id),e=t.className,e&&h.isType(e,"string")&&(i.classes=e.split(/\s+/));var a=["type","name","title","alt"];for(i.attributes=[],o=0;o<a.length;o++)r=a[o],n=t.getAttribute(r),n&&i.attributes.push({key:r,value:n});return i}var h=r(5),d=r(17),m={network:!0,log:!0,dom:!0,navigation:!0,connectivity:!0};i.prototype.instrument=function(){this.autoInstrument.network&&this.instrumentNetwork(),this.autoInstrument.log&&this.instrumentConsole(),this.autoInstrument.dom&&this.instrumentDom(),this.autoInstrument.navigation&&this.instrumentNavigation(),this.autoInstrument.connectivity&&this.instrumentConnectivity()},i.prototype.instrumentNetwork=function(){function t(t,r){t in r&&h.isFunction(r[t])&&n(r,t,function(t){return e.rollbar.wrap(t)},e.replacements)}var e=this;if("XMLHttpRequest"in this._window){var r=this._window.XMLHttpRequest.prototype;n(r,"open",function(t){return function(e,r){return h.isType(r,"string")&&(this.__rollbar_xhr={method:e,url:r,status_code:null,start_time_ms:h.now(),end_time_ms:null}),t.apply(this,arguments)}},this.replacements),n(r,"send",function(r){return function(o){function i(){if(a.__rollbar_xhr&&(1===a.readyState||4===a.readyState)){null===a.__rollbar_xhr.status_code&&(a.__rollbar_xhr.status_code=0,a.__rollbar_event=e.telemeter.captureNetwork(a.__rollbar_xhr,"xhr")),1===a.readyState?a.__rollbar_xhr.start_time_ms=h.now():a.__rollbar_xhr.end_time_ms=h.now();try{var t=a.status;t=1223===t?204:t,a.__rollbar_xhr.status_code=t,a.__rollbar_event.level=e.telemeter.levelFromStatus(t)}catch(t){}}}var a=this;return t("onload",a),t("onerror",a),t("onprogress",a),"onreadystatechange"in a&&h.isFunction(a.onreadystatechange)?n(a,"onreadystatechange",function(t){return e.rollbar.wrap(t,void 0,i)}):a.onreadystatechange=i,r.apply(this,arguments)}},this.replacements)}"fetch"in this._window&&n(this._window,"fetch",function(t){return function(r,n){for(var o=new Array(arguments.length),i=0,a=o.length;i<a;i++)o[i]=arguments[i];var s,u=o[0],c="GET";h.isType(u,"string")?s=u:(s=u.url,u.method&&(c=u.method)),o[1]&&o[1].method&&(c=o[1].method);var l={method:c,url:s,status_code:null,start_time_ms:h.now(),end_time_ms:null};return e.telemeter.captureNetwork(l,"fetch"),t.apply(this,o).then(function(t){return l.end_time_ms=h.now(),l.status_code=t.status,t})}},this.replacements)},i.prototype.instrumentConsole=function(){function t(t){var n=r[t],o=r,i="warn"===t?"warning":t;r[t]=function(){var t=Array.prototype.slice.call(arguments),r=h.formatArgsAsString(t);e.telemeter.captureLog(r,i),n&&Function.prototype.apply.call(n,o,t)}}if("console"in this._window&&this._window.console.log)for(var e=this,r=this._window.console,n=["debug","info","warn","error","log"],o=0,i=n.length;o<i;o++)t(n[o])},i.prototype.instrumentDom=function(){if("addEventListener"in this._window||"attachEvent"in this._window){var t=this.handleClick.bind(this),e=this.handleBlur.bind(this);this._window.addEventListener?(this._window.addEventListener("click",t,!0),this._window.addEventListener("blur",e,!0)):(this._window.attachEvent("click",t),this._window.attachEvent("onfocusout",e))}},i.prototype.handleClick=function(t){try{var e=u(t,this._document),r=e&&e.tagName,n=s(e,"a")||s(e,"button");r&&(n||s(e,"input",["button","submit"]))?this.captureDomEvent("click",e):s(e,"input",["checkbox","radio"])&&this.captureDomEvent("input",e,e.value,e.checked)}catch(t){}},i.prototype.handleBlur=function(t){try{var e=u(t,this._document);e&&e.tagName&&(s(e,"textarea")?this.captureDomEvent("input",e,e.value):s(e,"select")&&e.options&&e.options.length?this.handleSelectInputChanged(e):s(e,"input")&&!s(e,"input",["button","submit","hidden","checkbox","radio"])&&this.captureDomEvent("input",e,e.value))}catch(t){}},i.prototype.handleSelectInputChanged=function(t){if(t.multiple)for(var e=0;e<t.options.length;e++)t.options[e].selected&&this.captureDomEvent("input",t,t.options[e].value);else t.selectedIndex>=0&&t.options[t.selectedIndex]&&this.captureDomEvent("input",t,t.options[t.selectedIndex].value)},i.prototype.captureDomEvent=function(t,e,r,n){"password"===a(e)&&(r=void 0);var o=l(c(e));this.telemeter.captureDom(t,o,r,n)},i.prototype.instrumentNavigation=function(){var t=this._window.chrome,e=t&&t.app&&t.app.runtime,r=!e&&this._window.history&&this._window.history.pushState;if(r){var o=this,i=this._window.onpopstate;this._window.onpopstate=function(){var t=o._location.href;o.handleUrlChange(o._lastHref,t),i&&i.apply(this,arguments)},n(this._window.history,"pushState",function(t){return function(){var e=arguments.length>2?arguments[2]:void 0;return e&&o.handleUrlChange(o._lastHref,e+""),t.apply(this,arguments)}},this.replacements)}},i.prototype.handleUrlChange=function(t,e){var r=d.parse(this._location.href),n=d.parse(e),o=d.parse(t);this._lastHref=e,r.protocol===n.protocol&&r.host===n.host&&(e=n.path+(n.hash||"")),r.protocol===o.protocol&&r.host===o.host&&(t=o.path+(o.hash||"")),this.telemeter.captureNavigation(t,e)},i.prototype.instrumentConnectivity=function(){("addEventListener"in this._window||"body"in this._document)&&(this._window.addEventListener?(this._window.addEventListener("online",function(){this.telemeter.captureConnectivityChange("online")}.bind(this),!0),this._window.addEventListener("offline",function(){this.telemeter.captureConnectivityChange("offline")}.bind(this),!0)):(this._document.body.ononline=function(){this.telemeter.captureConnectivityChange("online")}.bind(this),this._document.body.onoffline=function(){this.telemeter.captureConnectivityChange("offline")}.bind(this)))},i.prototype.restore=function(){o(this.replacements),this.replacements=[]},t.exports=i}]); | pvnr0082t/cdnjs | ajax/libs/rollbar.js/2.2.3/rollbar.min.js | JavaScript | mit | 52,991 |
/*!
* OOjs UI v0.22.5
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2017 OOjs UI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
* Date: 2017-08-22T21:37:41Z
*/.oo-ui-icon-edit{background-image:url(themes/wikimediaui/images/icons/edit-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr.png)}.oo-ui-image-progressive.oo-ui-icon-edit{background-image:url(themes/wikimediaui/images/icons/edit-ltr-progressive.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr-progressive.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr-progressive.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr-progressive.png)}.oo-ui-image-invert.oo-ui-icon-edit{background-image:url(themes/wikimediaui/images/icons/edit-ltr-invert.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr-invert.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr-invert.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/edit-ltr-invert.png)}.oo-ui-icon-editLock{background-image:url(themes/wikimediaui/images/icons/editLock-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr.png)}.oo-ui-image-invert.oo-ui-icon-editLock{background-image:url(themes/wikimediaui/images/icons/editLock-ltr-invert.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr-invert.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr-invert.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr-invert.png)}.oo-ui-image-progressive.oo-ui-icon-editLock{background-image:url(themes/wikimediaui/images/icons/editLock-ltr-progressive.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr-progressive.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr-progressive.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editLock-ltr-progressive.png)}.oo-ui-icon-editUndo{background-image:url(themes/wikimediaui/images/icons/editUndo-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr.png)}.oo-ui-image-invert.oo-ui-icon-editUndo{background-image:url(themes/wikimediaui/images/icons/editUndo-ltr-invert.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr-invert.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr-invert.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr-invert.png)}.oo-ui-image-progressive.oo-ui-icon-editUndo{background-image:url(themes/wikimediaui/images/icons/editUndo-ltr-progressive.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr-progressive.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr-progressive.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/editUndo-ltr-progressive.png)}.oo-ui-icon-link{background-image:url(themes/wikimediaui/images/icons/link-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr.png)}.oo-ui-image-invert.oo-ui-icon-link{background-image:url(themes/wikimediaui/images/icons/link-ltr-invert.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr-invert.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr-invert.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr-invert.png)}.oo-ui-image-progressive.oo-ui-icon-link{background-image:url(themes/wikimediaui/images/icons/link-ltr-progressive.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr-progressive.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr-progressive.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/link-ltr-progressive.png)}.oo-ui-icon-linkExternal{background-image:url(themes/wikimediaui/images/icons/external-link-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr.png)}.oo-ui-image-invert.oo-ui-icon-linkExternal{background-image:url(themes/wikimediaui/images/icons/external-link-ltr-invert.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr-invert.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr-invert.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr-invert.png)}.oo-ui-image-progressive.oo-ui-icon-linkExternal{background-image:url(themes/wikimediaui/images/icons/external-link-ltr-progressive.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr-progressive.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr-progressive.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/external-link-ltr-progressive.png)}.oo-ui-icon-linkSecure{background-image:url(themes/wikimediaui/images/icons/secure-link.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link.png)}.oo-ui-image-invert.oo-ui-icon-linkSecure{background-image:url(themes/wikimediaui/images/icons/secure-link-invert.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link-invert.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link-invert.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link-invert.png)}.oo-ui-image-progressive.oo-ui-icon-linkSecure{background-image:url(themes/wikimediaui/images/icons/secure-link-progressive.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link-progressive.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link-progressive.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/secure-link-progressive.png)}.oo-ui-icon-redo{background-image:url(themes/wikimediaui/images/icons/arched-arrow-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr.png)}.oo-ui-image-invert.oo-ui-icon-redo{background-image:url(themes/wikimediaui/images/icons/arched-arrow-ltr-invert.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr-invert.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr-invert.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr-invert.png)}.oo-ui-image-progressive.oo-ui-icon-redo{background-image:url(themes/wikimediaui/images/icons/arched-arrow-ltr-progressive.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr-progressive.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr-progressive.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-ltr-progressive.png)}.oo-ui-icon-undo{background-image:url(themes/wikimediaui/images/icons/arched-arrow-rtl.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl.png)}.oo-ui-image-invert.oo-ui-icon-undo{background-image:url(themes/wikimediaui/images/icons/arched-arrow-rtl-invert.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl-invert.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl-invert.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl-invert.png)}.oo-ui-image-progressive.oo-ui-icon-undo{background-image:url(themes/wikimediaui/images/icons/arched-arrow-rtl-progressive.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl-progressive.svg);background-image:linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl-progressive.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/wikimediaui/images/icons/arched-arrow-rtl-progressive.png)} | tholu/cdnjs | ajax/libs/oojs-ui/0.22.5/oojs-ui-wikimediaui-icons-editing-core.min.css | CSS | mit | 11,737 |
/*
* /MathJax/localization/pl/HTML-CSS.js
*
* Copyright (c) 2009-2018 The MathJax Consortium
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.Localization.addTranslation("pl","HTML-CSS",{version:"2.7.5",isLoaded:true,strings:{LoadWebFont:"\u0141aduj\u0119 czcionk\u0119 %1",CantLoadWebFont:"Nie mo\u017Cna za\u0142adowa\u0107 czcionki %1",FirefoxCantLoadWebFont:"Firefox nie mo\u017Ce za\u0142adowa\u0107 czcionek ze zdalnego hosta",CantFindFontUsing:"Nie mo\u017Cna znale\u017A\u0107 w\u0142a\u015Bciwej czcionki u\u017Cywaj\u0105c %1",WebFontsNotAvailable:"Czcionki internetowe nie dost\u0119pne - zamiast tego u\u017Cywane s\u0105 czcionki obrazkowe"}});MathJax.Ajax.loadComplete("[MathJax]/localization/pl/HTML-CSS.js");
| sashberd/cdnjs | ajax/libs/mathjax/2.7.5/localization/pl/HTML-CSS.js | JavaScript | mit | 1,261 |
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Sqlite.php 24593 2012-01-05 20:35:02Z matthew $
*/
/**
* @see Zend_Cache_Backend_Interface
*/
#require_once 'Zend/Cache/Backend/ExtendedInterface.php';
/**
* @see Zend_Cache_Backend
*/
#require_once 'Zend/Cache/Backend.php';
/**
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Cache_Backend_Sqlite extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
{
/**
* Available options
*
* =====> (string) cache_db_complete_path :
* - the complete path (filename included) of the SQLITE database
*
* ====> (int) automatic_vacuum_factor :
* - Disable / Tune the automatic vacuum process
* - The automatic vacuum process defragment the database file (and make it smaller)
* when a clean() or delete() is called
* 0 => no automatic vacuum
* 1 => systematic vacuum (when delete() or clean() methods are called)
* x (integer) > 1 => automatic vacuum randomly 1 times on x clean() or delete()
*
* @var array Available options
*/
protected $_options = array(
'cache_db_complete_path' => null,
'automatic_vacuum_factor' => 10
);
/**
* DB ressource
*
* @var mixed $_db
*/
private $_db = null;
/**
* Boolean to store if the structure has benn checked or not
*
* @var boolean $_structureChecked
*/
private $_structureChecked = false;
/**
* Constructor
*
* @param array $options Associative array of options
* @throws Zend_cache_Exception
* @return void
*/
public function __construct(array $options = array())
{
parent::__construct($options);
if ($this->_options['cache_db_complete_path'] === null) {
Zend_Cache::throwException('cache_db_complete_path option has to set');
}
if (!extension_loaded('sqlite')) {
Zend_Cache::throwException("Cannot use SQLite storage because the 'sqlite' extension is not loaded in the current PHP environment");
}
$this->_getConnection();
}
/**
* Destructor
*
* @return void
*/
public function __destruct()
{
@sqlite_close($this->_getConnection());
}
/**
* Test if a cache is available for the given id and (if yes) return it (false else)
*
* @param string $id Cache id
* @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
* @return string|false Cached datas
*/
public function load($id, $doNotTestCacheValidity = false)
{
$this->_checkAndBuildStructure();
$sql = "SELECT content FROM cache WHERE id='$id'";
if (!$doNotTestCacheValidity) {
$sql = $sql . " AND (expire=0 OR expire>" . time() . ')';
}
$result = $this->_query($sql);
$row = @sqlite_fetch_array($result);
if ($row) {
return $row['content'];
}
return false;
}
/**
* Test if a cache is available or not (for the given id)
*
* @param string $id Cache id
* @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
*/
public function test($id)
{
$this->_checkAndBuildStructure();
$sql = "SELECT lastModified FROM cache WHERE id='$id' AND (expire=0 OR expire>" . time() . ')';
$result = $this->_query($sql);
$row = @sqlite_fetch_array($result);
if ($row) {
return ((int) $row['lastModified']);
}
return false;
}
/**
* Save some string datas into a cache record
*
* Note : $data is always "string" (serialization is done by the
* core not by the backend)
*
* @param string $data Datas to cache
* @param string $id Cache id
* @param array $tags Array of strings, the cache record will be tagged by each string entry
* @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
* @throws Zend_Cache_Exception
* @return boolean True if no problem
*/
public function save($data, $id, $tags = array(), $specificLifetime = false)
{
$this->_checkAndBuildStructure();
$lifetime = $this->getLifetime($specificLifetime);
$data = @sqlite_escape_string($data);
$mktime = time();
if ($lifetime === null) {
$expire = 0;
} else {
$expire = $mktime + $lifetime;
}
$this->_query("DELETE FROM cache WHERE id='$id'");
$sql = "INSERT INTO cache (id, content, lastModified, expire) VALUES ('$id', '$data', $mktime, $expire)";
$res = $this->_query($sql);
if (!$res) {
$this->_log("Zend_Cache_Backend_Sqlite::save() : impossible to store the cache id=$id");
return false;
}
$res = true;
foreach ($tags as $tag) {
$res = $this->_registerTag($id, $tag) && $res;
}
return $res;
}
/**
* Remove a cache record
*
* @param string $id Cache id
* @return boolean True if no problem
*/
public function remove($id)
{
$this->_checkAndBuildStructure();
$res = $this->_query("SELECT COUNT(*) AS nbr FROM cache WHERE id='$id'");
$result1 = @sqlite_fetch_single($res);
$result2 = $this->_query("DELETE FROM cache WHERE id='$id'");
$result3 = $this->_query("DELETE FROM tag WHERE id='$id'");
$this->_automaticVacuum();
return ($result1 && $result2 && $result3);
}
/**
* Clean some cache records
*
* Available modes are :
* Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
* Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
* Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
* ($tags can be an array of strings or a single string)
* Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
* ($tags can be an array of strings or a single string)
* Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
* ($tags can be an array of strings or a single string)
*
* @param string $mode Clean mode
* @param array $tags Array of tags
* @return boolean True if no problem
*/
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
$this->_checkAndBuildStructure();
$return = $this->_clean($mode, $tags);
$this->_automaticVacuum();
return $return;
}
/**
* Return an array of stored cache ids
*
* @return array array of stored cache ids (string)
*/
public function getIds()
{
$this->_checkAndBuildStructure();
$res = $this->_query("SELECT id FROM cache WHERE (expire=0 OR expire>" . time() . ")");
$result = array();
while ($id = @sqlite_fetch_single($res)) {
$result[] = $id;
}
return $result;
}
/**
* Return an array of stored tags
*
* @return array array of stored tags (string)
*/
public function getTags()
{
$this->_checkAndBuildStructure();
$res = $this->_query("SELECT DISTINCT(name) AS name FROM tag");
$result = array();
while ($id = @sqlite_fetch_single($res)) {
$result[] = $id;
}
return $result;
}
/**
* Return an array of stored cache ids which match given tags
*
* In case of multiple tags, a logical AND is made between tags
*
* @param array $tags array of tags
* @return array array of matching cache ids (string)
*/
public function getIdsMatchingTags($tags = array())
{
$first = true;
$ids = array();
foreach ($tags as $tag) {
$res = $this->_query("SELECT DISTINCT(id) AS id FROM tag WHERE name='$tag'");
if (!$res) {
return array();
}
$rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
$ids2 = array();
foreach ($rows as $row) {
$ids2[] = $row['id'];
}
if ($first) {
$ids = $ids2;
$first = false;
} else {
$ids = array_intersect($ids, $ids2);
}
}
$result = array();
foreach ($ids as $id) {
$result[] = $id;
}
return $result;
}
/**
* Return an array of stored cache ids which don't match given tags
*
* In case of multiple tags, a logical OR is made between tags
*
* @param array $tags array of tags
* @return array array of not matching cache ids (string)
*/
public function getIdsNotMatchingTags($tags = array())
{
$res = $this->_query("SELECT id FROM cache");
$rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
$result = array();
foreach ($rows as $row) {
$id = $row['id'];
$matching = false;
foreach ($tags as $tag) {
$res = $this->_query("SELECT COUNT(*) AS nbr FROM tag WHERE name='$tag' AND id='$id'");
if (!$res) {
return array();
}
$nbr = (int) @sqlite_fetch_single($res);
if ($nbr > 0) {
$matching = true;
}
}
if (!$matching) {
$result[] = $id;
}
}
return $result;
}
/**
* Return an array of stored cache ids which match any given tags
*
* In case of multiple tags, a logical AND is made between tags
*
* @param array $tags array of tags
* @return array array of any matching cache ids (string)
*/
public function getIdsMatchingAnyTags($tags = array())
{
$first = true;
$ids = array();
foreach ($tags as $tag) {
$res = $this->_query("SELECT DISTINCT(id) AS id FROM tag WHERE name='$tag'");
if (!$res) {
return array();
}
$rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
$ids2 = array();
foreach ($rows as $row) {
$ids2[] = $row['id'];
}
if ($first) {
$ids = $ids2;
$first = false;
} else {
$ids = array_merge($ids, $ids2);
}
}
$result = array();
foreach ($ids as $id) {
$result[] = $id;
}
return $result;
}
/**
* Return the filling percentage of the backend storage
*
* @throws Zend_Cache_Exception
* @return int integer between 0 and 100
*/
public function getFillingPercentage()
{
$dir = dirname($this->_options['cache_db_complete_path']);
$free = disk_free_space($dir);
$total = disk_total_space($dir);
if ($total == 0) {
Zend_Cache::throwException('can\'t get disk_total_space');
} else {
if ($free >= $total) {
return 100;
}
return ((int) (100. * ($total - $free) / $total));
}
}
/**
* Return an array of metadatas for the given cache id
*
* The array must include these keys :
* - expire : the expire timestamp
* - tags : a string array of tags
* - mtime : timestamp of last modification time
*
* @param string $id cache id
* @return array array of metadatas (false if the cache id is not found)
*/
public function getMetadatas($id)
{
$tags = array();
$res = $this->_query("SELECT name FROM tag WHERE id='$id'");
if ($res) {
$rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
foreach ($rows as $row) {
$tags[] = $row['name'];
}
}
$this->_query('CREATE TABLE cache (id TEXT PRIMARY KEY, content BLOB, lastModified INTEGER, expire INTEGER)');
$res = $this->_query("SELECT lastModified,expire FROM cache WHERE id='$id'");
if (!$res) {
return false;
}
$row = @sqlite_fetch_array($res, SQLITE_ASSOC);
return array(
'tags' => $tags,
'mtime' => $row['lastModified'],
'expire' => $row['expire']
);
}
/**
* Give (if possible) an extra lifetime to the given cache id
*
* @param string $id cache id
* @param int $extraLifetime
* @return boolean true if ok
*/
public function touch($id, $extraLifetime)
{
$sql = "SELECT expire FROM cache WHERE id='$id' AND (expire=0 OR expire>" . time() . ')';
$res = $this->_query($sql);
if (!$res) {
return false;
}
$expire = @sqlite_fetch_single($res);
$newExpire = $expire + $extraLifetime;
$res = $this->_query("UPDATE cache SET lastModified=" . time() . ", expire=$newExpire WHERE id='$id'");
if ($res) {
return true;
} else {
return false;
}
}
/**
* Return an associative array of capabilities (booleans) of the backend
*
* The array must include these keys :
* - automatic_cleaning (is automating cleaning necessary)
* - tags (are tags supported)
* - expired_read (is it possible to read expired cache records
* (for doNotTestCacheValidity option for example))
* - priority does the backend deal with priority when saving
* - infinite_lifetime (is infinite lifetime can work with this backend)
* - get_list (is it possible to get the list of cache ids and the complete list of tags)
*
* @return array associative of with capabilities
*/
public function getCapabilities()
{
return array(
'automatic_cleaning' => true,
'tags' => true,
'expired_read' => true,
'priority' => false,
'infinite_lifetime' => true,
'get_list' => true
);
}
/**
* PUBLIC METHOD FOR UNIT TESTING ONLY !
*
* Force a cache record to expire
*
* @param string $id Cache id
*/
public function ___expire($id)
{
$time = time() - 1;
$this->_query("UPDATE cache SET lastModified=$time, expire=$time WHERE id='$id'");
}
/**
* Return the connection resource
*
* If we are not connected, the connection is made
*
* @throws Zend_Cache_Exception
* @return resource Connection resource
*/
private function _getConnection()
{
if (is_resource($this->_db)) {
return $this->_db;
} else {
$this->_db = @sqlite_open($this->_options['cache_db_complete_path']);
if (!(is_resource($this->_db))) {
Zend_Cache::throwException("Impossible to open " . $this->_options['cache_db_complete_path'] . " cache DB file");
}
return $this->_db;
}
}
/**
* Execute an SQL query silently
*
* @param string $query SQL query
* @return mixed|false query results
*/
private function _query($query)
{
$db = $this->_getConnection();
if (is_resource($db)) {
$res = @sqlite_query($db, $query);
if ($res === false) {
return false;
} else {
return $res;
}
}
return false;
}
/**
* Deal with the automatic vacuum process
*
* @return void
*/
private function _automaticVacuum()
{
if ($this->_options['automatic_vacuum_factor'] > 0) {
$rand = rand(1, $this->_options['automatic_vacuum_factor']);
if ($rand == 1) {
$this->_query('VACUUM');
}
}
}
/**
* Register a cache id with the given tag
*
* @param string $id Cache id
* @param string $tag Tag
* @return boolean True if no problem
*/
private function _registerTag($id, $tag) {
$res = $this->_query("DELETE FROM TAG WHERE name='$tag' AND id='$id'");
$res = $this->_query("INSERT INTO tag (name, id) VALUES ('$tag', '$id')");
if (!$res) {
$this->_log("Zend_Cache_Backend_Sqlite::_registerTag() : impossible to register tag=$tag on id=$id");
return false;
}
return true;
}
/**
* Build the database structure
*
* @return false
*/
private function _buildStructure()
{
$this->_query('DROP INDEX tag_id_index');
$this->_query('DROP INDEX tag_name_index');
$this->_query('DROP INDEX cache_id_expire_index');
$this->_query('DROP TABLE version');
$this->_query('DROP TABLE cache');
$this->_query('DROP TABLE tag');
$this->_query('CREATE TABLE version (num INTEGER PRIMARY KEY)');
$this->_query('CREATE TABLE cache (id TEXT PRIMARY KEY, content BLOB, lastModified INTEGER, expire INTEGER)');
$this->_query('CREATE TABLE tag (name TEXT, id TEXT)');
$this->_query('CREATE INDEX tag_id_index ON tag(id)');
$this->_query('CREATE INDEX tag_name_index ON tag(name)');
$this->_query('CREATE INDEX cache_id_expire_index ON cache(id, expire)');
$this->_query('INSERT INTO version (num) VALUES (1)');
}
/**
* Check if the database structure is ok (with the good version)
*
* @return boolean True if ok
*/
private function _checkStructureVersion()
{
$result = $this->_query("SELECT num FROM version");
if (!$result) return false;
$row = @sqlite_fetch_array($result);
if (!$row) {
return false;
}
if (((int) $row['num']) != 1) {
// old cache structure
$this->_log('Zend_Cache_Backend_Sqlite::_checkStructureVersion() : old cache structure version detected => the cache is going to be dropped');
return false;
}
return true;
}
/**
* Clean some cache records
*
* Available modes are :
* Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
* Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
* Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
* ($tags can be an array of strings or a single string)
* Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
* ($tags can be an array of strings or a single string)
* Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
* ($tags can be an array of strings or a single string)
*
* @param string $mode Clean mode
* @param array $tags Array of tags
* @return boolean True if no problem
*/
private function _clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
switch ($mode) {
case Zend_Cache::CLEANING_MODE_ALL:
$res1 = $this->_query('DELETE FROM cache');
$res2 = $this->_query('DELETE FROM tag');
return $res1 && $res2;
break;
case Zend_Cache::CLEANING_MODE_OLD:
$mktime = time();
$res1 = $this->_query("DELETE FROM tag WHERE id IN (SELECT id FROM cache WHERE expire>0 AND expire<=$mktime)");
$res2 = $this->_query("DELETE FROM cache WHERE expire>0 AND expire<=$mktime");
return $res1 && $res2;
break;
case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
$ids = $this->getIdsMatchingTags($tags);
$result = true;
foreach ($ids as $id) {
$result = $this->remove($id) && $result;
}
return $result;
break;
case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
$ids = $this->getIdsNotMatchingTags($tags);
$result = true;
foreach ($ids as $id) {
$result = $this->remove($id) && $result;
}
return $result;
break;
case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
$ids = $this->getIdsMatchingAnyTags($tags);
$result = true;
foreach ($ids as $id) {
$result = $this->remove($id) && $result;
}
return $result;
break;
default:
break;
}
return false;
}
/**
* Check if the database structure is ok (with the good version), if no : build it
*
* @throws Zend_Cache_Exception
* @return boolean True if ok
*/
private function _checkAndBuildStructure()
{
if (!($this->_structureChecked)) {
if (!$this->_checkStructureVersion()) {
$this->_buildStructure();
if (!$this->_checkStructureVersion()) {
Zend_Cache::throwException("Impossible to build cache structure in " . $this->_options['cache_db_complete_path']);
}
}
$this->_structureChecked = true;
}
return true;
}
}
| exehs/magentoEquipe2 | lib/Zend/Cache/Backend/Sqlite.php | PHP | mit | 22,997 |
!function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):"object"==typeof exports?module.exports=e(require("jquery"),require("moment")):e(jQuery,moment)}(function(e,t){!function(){t.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日 HH:mm",LLLL:"YYYY年MMMD日dddd HH:mm",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日 HH:mm",llll:"YYYY年MMMD日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,a){var d=100*e+t;return d<600?"凌晨":d<900?"早上":d<1130?"上午":d<1230?"中午":d<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(),e.fullCalendar.datepickerLocale("zh-tw","zh-TW",{closeText:"關閉",prevText:"<上月",nextText:"下月>",currentText:"今天",monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],dayNamesMin:["日","一","二","三","四","五","六"],weekHeader:"周",dateFormat:"yy/mm/dd",firstDay:1,isRTL:!1,showMonthAfterYear:!0,yearSuffix:"年"}),e.fullCalendar.locale("zh-tw",{buttonText:{month:"月",week:"週",day:"天",list:"活動列表"},allDayText:"整天",eventLimitText:"顯示更多",noEventsMessage:"没有任何活動"})}); | nolsherry/cdnjs | ajax/libs/fullcalendar/3.4.0/locale/zh-tw.js | JavaScript | mit | 2,661 |
.minicolors{position:relative;display:inline-block;z-index:1}.minicolors-focus{z-index:2}.minicolors.minicolors-theme-default .minicolors-input{margin:0 -1px 0 0;border:1px solid #CCC;font:14px sans-serif;width:65px;height:16px;border-radius:0;box-shadow:inset 0 2px 4px rgba(0,0,0,.04);padding:2px}.minicolors-theme-default.minicolors .minicolors-input{vertical-align:middle;outline:0}.minicolors-theme-default.minicolors-swatch-left .minicolors-input{margin-left:-1px;margin-right:auto}.minicolors-theme-default.minicolors-focus .minicolors-input,.minicolors-theme-default.minicolors-focus .minicolors-swatch{border-color:#999}.minicolors-hidden{position:absolute;left:-9999em}.minicolors-swatch{position:relative;width:20px;height:20px;text-align:left;background:url(jquery.minicolors.png) -80px 0;border:1px solid #CCC;vertical-align:middle;display:inline-block}.minicolors-swatch SPAN{position:absolute;width:100%;height:100%;background:0 0;box-shadow:inset 0 9px 0 rgba(255,255,255,.1);display:inline-block}.minicolors-panel{position:absolute;top:26px;left:0;width:173px;height:152px;background:#fff;border:1px solid #CCC;box-shadow:0 0 20px rgba(0,0,0,.2);display:none}.minicolors-position-top .minicolors-panel{top:-156px}.minicolors-position-left .minicolors-panel{left:-83px}.minicolors-position-left.minicolors-with-opacity .minicolors-panel{left:-104px}.minicolors-with-opacity .minicolors-panel{width:194px}.minicolors .minicolors-grid{position:absolute;top:1px;left:1px;width:150px;height:150px;background:url(jquery.minicolors.png) -120px 0;cursor:crosshair}.minicolors .minicolors-grid-inner{position:absolute;top:0;left:0;width:150px;height:150px;background:0 0}.minicolors-slider-saturation .minicolors-grid{background-position:-420px 0}.minicolors-slider-saturation .minicolors-grid-inner{background:url(jquery.minicolors.png) -270px 0}.minicolors-slider-brightness .minicolors-grid{background-position:-570px 0}.minicolors-slider-brightness .minicolors-grid-inner{background:#000}.minicolors-slider-wheel .minicolors-grid{background-position:-720px 0}.minicolors-opacity-slider,.minicolors-slider{position:absolute;top:1px;left:152px;width:20px;height:150px;background:url(jquery.minicolors.png) #fff;cursor:crosshair}.minicolors-slider-saturation .minicolors-slider{background-position:-60px 0}.minicolors-slider-brightness .minicolors-slider,.minicolors-slider-wheel .minicolors-slider{background-position:-20px 0}.minicolors-opacity-slider{left:173px;background-position:-40px 0;display:none}.minicolors-with-opacity .minicolors-opacity-slider{display:block}.minicolors-grid .minicolors-picker{position:absolute;top:70px;left:70px;width:10px;height:10px;border:1px solid #000;border-radius:10px;margin-top:-6px;margin-left:-6px;background:0 0}.minicolors-grid .minicolors-picker SPAN{position:absolute;top:0;left:0;width:6px;height:6px;border-radius:6px;border:2px solid #fff}.minicolors-picker{position:absolute;top:0;left:0;width:18px;height:2px;background:#fff;border:1px solid #000;margin-top:-2px}.minicolors-inline .minicolors-input,.minicolors-inline .minicolors-swatch{display:none}.minicolors-inline .minicolors-panel{position:relative;top:auto;left:auto;display:inline-block}.minicolors-theme-bootstrap .minicolors-input{padding:4px 6px 4px 30px;background-color:#fff;border:1px solid #CCC;border-radius:3px;color:#555;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:14px;height:19px;margin:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.minicolors-theme-bootstrap.minicolors-focus .minicolors-input{border-color:#6fb8f1;box-shadow:0 0 10px #6fb8f1;outline:0}.minicolors-theme-bootstrap .minicolors-swatch{position:absolute;left:4px;top:4px;z-index:2}.minicolors-theme-bootstrap.minicolors-swatch-position-right .minicolors-input{padding-left:6px;padding-right:30px}.minicolors-theme-bootstrap.minicolors-swatch-position-right .minicolors-swatch{left:auto;right:4px}.minicolors-theme-bootstrap .minicolors-panel{top:28px;z-index:3}.minicolors-theme-bootstrap.minicolors-position-top .minicolors-panel{top:-154px}.minicolors-theme-bootstrap.minicolors-position-left .minicolors-panel{left:-63px}.minicolors-theme-bootstrap.minicolors-position-left.minicolors-with-opacity .minicolors-panel{left:-84px}/*# sourceMappingURL=jquery.minicolors.min.css.map */ | honestree/cdnjs | ajax/libs/jquery-minicolors/2.0.0/jquery.minicolors.min.css | CSS | mit | 4,304 |
<?php
/*
* This file is part of the Assetic package, an OpenSky project.
*
* (c) 2010-2011 OpenSky Project Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Assetic\Test\Factory\Resource;
use Assetic\Factory\Resource\CoalescingDirectoryResource;
use Assetic\Factory\Resource\DirectoryResource;
class CoalescingDirectoryResourceTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function shouldFilterFiles()
{
// notice only one directory has a trailing slash
$resource = new CoalescingDirectoryResource(array(
new DirectoryResource(__DIR__.'/Fixtures/dir1/', '/\.txt$/'),
new DirectoryResource(__DIR__.'/Fixtures/dir2', '/\.txt$/'),
));
$paths = array();
foreach ($resource as $file) {
$paths[] = (string) $file;
}
sort($paths);
$this->assertEquals(array(
__DIR__.'/Fixtures/dir1/file1.txt',
__DIR__.'/Fixtures/dir1/file2.txt',
__DIR__.'/Fixtures/dir2/file3.txt',
), $paths, 'files from multiple directories are merged');
}
}
| mhughes2k/VCC | vendor/assetic/tests/Assetic/Test/Factory/Resource/CoalescingDirectoryResourceTest.php | PHP | mit | 1,217 |
/*
ractive-legacy.runtime.js v0.5.5
2014-07-13 - commit 8b1d34ef
http://ractivejs.org
http://twitter.com/RactiveJS
Released under the MIT License.
*/
( function( global ) {
'use strict';
var noConflict = global.Ractive;
/* config/defaults/options.js */
var options = function() {
// These are both the values for Ractive.defaults
// as well as the determination for whether an option
// value will be placed on Component.defaults
// (versus directly on Component) during an extend operation
var defaultOptions = {
// render placement:
el: void 0,
append: false,
// template:
template: {
v: 1,
t: []
},
// parse:
preserveWhitespace: false,
sanitize: false,
stripComments: true,
// data & binding:
data: {},
computed: {},
magic: false,
modifyArrays: true,
adapt: [],
isolated: false,
twoway: true,
lazy: false,
// transitions:
noIntro: false,
transitionsEnabled: true,
complete: void 0,
// css:
noCssTransform: false,
// debug:
debug: false
};
return defaultOptions;
}();
/* config/defaults/easing.js */
var easing = {
linear: function( pos ) {
return pos;
},
easeIn: function( pos ) {
return Math.pow( pos, 3 );
},
easeOut: function( pos ) {
return Math.pow( pos - 1, 3 ) + 1;
},
easeInOut: function( pos ) {
if ( ( pos /= 0.5 ) < 1 ) {
return 0.5 * Math.pow( pos, 3 );
}
return 0.5 * ( Math.pow( pos - 2, 3 ) + 2 );
}
};
/* circular.js */
var circular = [];
/* utils/hasOwnProperty.js */
var hasOwn = Object.prototype.hasOwnProperty;
/* utils/isArray.js */
var isArray = function() {
var toString = Object.prototype.toString;
// thanks, http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/
return function( thing ) {
return toString.call( thing ) === '[object Array]';
};
}();
/* utils/isObject.js */
var isObject = function() {
var toString = Object.prototype.toString;
return function( thing ) {
return thing && toString.call( thing ) === '[object Object]';
};
}();
/* utils/isNumeric.js */
var isNumeric = function( thing ) {
return !isNaN( parseFloat( thing ) ) && isFinite( thing );
};
/* config/defaults/interpolators.js */
var interpolators = function( circular, hasOwnProperty, isArray, isObject, isNumeric ) {
var interpolators, interpolate, cssLengthPattern;
circular.push( function() {
interpolate = circular.interpolate;
} );
cssLengthPattern = /^([+-]?[0-9]+\.?(?:[0-9]+)?)(px|em|ex|%|in|cm|mm|pt|pc)$/;
interpolators = {
number: function( from, to ) {
var delta;
if ( !isNumeric( from ) || !isNumeric( to ) ) {
return null;
}
from = +from;
to = +to;
delta = to - from;
if ( !delta ) {
return function() {
return from;
};
}
return function( t ) {
return from + t * delta;
};
},
array: function( from, to ) {
var intermediate, interpolators, len, i;
if ( !isArray( from ) || !isArray( to ) ) {
return null;
}
intermediate = [];
interpolators = [];
i = len = Math.min( from.length, to.length );
while ( i-- ) {
interpolators[ i ] = interpolate( from[ i ], to[ i ] );
}
// surplus values - don't interpolate, but don't exclude them either
for ( i = len; i < from.length; i += 1 ) {
intermediate[ i ] = from[ i ];
}
for ( i = len; i < to.length; i += 1 ) {
intermediate[ i ] = to[ i ];
}
return function( t ) {
var i = len;
while ( i-- ) {
intermediate[ i ] = interpolators[ i ]( t );
}
return intermediate;
};
},
object: function( from, to ) {
var properties, len, interpolators, intermediate, prop;
if ( !isObject( from ) || !isObject( to ) ) {
return null;
}
properties = [];
intermediate = {};
interpolators = {};
for ( prop in from ) {
if ( hasOwnProperty.call( from, prop ) ) {
if ( hasOwnProperty.call( to, prop ) ) {
properties.push( prop );
interpolators[ prop ] = interpolate( from[ prop ], to[ prop ] );
} else {
intermediate[ prop ] = from[ prop ];
}
}
}
for ( prop in to ) {
if ( hasOwnProperty.call( to, prop ) && !hasOwnProperty.call( from, prop ) ) {
intermediate[ prop ] = to[ prop ];
}
}
len = properties.length;
return function( t ) {
var i = len,
prop;
while ( i-- ) {
prop = properties[ i ];
intermediate[ prop ] = interpolators[ prop ]( t );
}
return intermediate;
};
},
cssLength: function( from, to ) {
var fromMatch, toMatch, fromUnit, toUnit, fromValue, toValue, unit, delta;
if ( from !== 0 && typeof from !== 'string' || to !== 0 && typeof to !== 'string' ) {
return null;
}
fromMatch = cssLengthPattern.exec( from );
toMatch = cssLengthPattern.exec( to );
fromUnit = fromMatch ? fromMatch[ 2 ] : '';
toUnit = toMatch ? toMatch[ 2 ] : '';
if ( fromUnit && toUnit && fromUnit !== toUnit ) {
return null;
}
unit = fromUnit || toUnit;
fromValue = fromMatch ? +fromMatch[ 1 ] : 0;
toValue = toMatch ? +toMatch[ 1 ] : 0;
delta = toValue - fromValue;
if ( !delta ) {
return function() {
return fromValue + unit;
};
}
return function( t ) {
return fromValue + t * delta + unit;
};
}
};
return interpolators;
}( circular, hasOwn, isArray, isObject, isNumeric );
/* config/svg.js */
var svg = function() {
var svg;
if ( typeof document === 'undefined' ) {
svg = false;
} else {
svg = document && document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1' );
}
return svg;
}();
/* utils/removeFromArray.js */
var removeFromArray = function( array, member ) {
var index = array.indexOf( member );
if ( index !== -1 ) {
array.splice( index, 1 );
}
};
/* utils/Promise.js */
var Promise = function() {
var _Promise, PENDING = {},
FULFILLED = {},
REJECTED = {};
if ( typeof Promise === 'function' ) {
// use native Promise
_Promise = Promise;
} else {
_Promise = function( callback ) {
var fulfilledHandlers = [],
rejectedHandlers = [],
state = PENDING,
result, dispatchHandlers, makeResolver, fulfil, reject, promise;
makeResolver = function( newState ) {
return function( value ) {
if ( state !== PENDING ) {
return;
}
result = value;
state = newState;
dispatchHandlers = makeDispatcher( state === FULFILLED ? fulfilledHandlers : rejectedHandlers, result );
// dispatch onFulfilled and onRejected handlers asynchronously
wait( dispatchHandlers );
};
};
fulfil = makeResolver( FULFILLED );
reject = makeResolver( REJECTED );
try {
callback( fulfil, reject );
} catch ( err ) {
reject( err );
}
promise = {
// `then()` returns a Promise - 2.2.7
then: function( onFulfilled, onRejected ) {
var promise2 = new _Promise( function( fulfil, reject ) {
var processResolutionHandler = function( handler, handlers, forward ) {
// 2.2.1.1
if ( typeof handler === 'function' ) {
handlers.push( function( p1result ) {
var x;
try {
x = handler( p1result );
resolve( promise2, x, fulfil, reject );
} catch ( err ) {
reject( err );
}
} );
} else {
// Forward the result of promise1 to promise2, if resolution handlers
// are not given
handlers.push( forward );
}
};
// 2.2
processResolutionHandler( onFulfilled, fulfilledHandlers, fulfil );
processResolutionHandler( onRejected, rejectedHandlers, reject );
if ( state !== PENDING ) {
// If the promise has resolved already, dispatch the appropriate handlers asynchronously
wait( dispatchHandlers );
}
} );
return promise2;
}
};
promise[ 'catch' ] = function( onRejected ) {
return this.then( null, onRejected );
};
return promise;
};
_Promise.all = function( promises ) {
return new _Promise( function( fulfil, reject ) {
var result = [],
pending, i, processPromise;
if ( !promises.length ) {
fulfil( result );
return;
}
processPromise = function( i ) {
promises[ i ].then( function( value ) {
result[ i ] = value;
if ( !--pending ) {
fulfil( result );
}
}, reject );
};
pending = i = promises.length;
while ( i-- ) {
processPromise( i );
}
} );
};
_Promise.resolve = function( value ) {
return new _Promise( function( fulfil ) {
fulfil( value );
} );
};
_Promise.reject = function( reason ) {
return new _Promise( function( fulfil, reject ) {
reject( reason );
} );
};
}
return _Promise;
// TODO use MutationObservers or something to simulate setImmediate
function wait( callback ) {
setTimeout( callback, 0 );
}
function makeDispatcher( handlers, result ) {
return function() {
var handler;
while ( handler = handlers.shift() ) {
handler( result );
}
};
}
function resolve( promise, x, fulfil, reject ) {
// Promise Resolution Procedure
var then;
// 2.3.1
if ( x === promise ) {
throw new TypeError( 'A promise\'s fulfillment handler cannot return the same promise' );
}
// 2.3.2
if ( x instanceof _Promise ) {
x.then( fulfil, reject );
} else if ( x && ( typeof x === 'object' || typeof x === 'function' ) ) {
try {
then = x.then;
} catch ( e ) {
reject( e );
// 2.3.3.2
return;
}
// 2.3.3.3
if ( typeof then === 'function' ) {
var called, resolvePromise, rejectPromise;
resolvePromise = function( y ) {
if ( called ) {
return;
}
called = true;
resolve( promise, y, fulfil, reject );
};
rejectPromise = function( r ) {
if ( called ) {
return;
}
called = true;
reject( r );
};
try {
then.call( x, resolvePromise, rejectPromise );
} catch ( e ) {
if ( !called ) {
// 2.3.3.3.4.1
reject( e );
// 2.3.3.3.4.2
called = true;
return;
}
}
} else {
fulfil( x );
}
} else {
fulfil( x );
}
}
}();
/* utils/normaliseRef.js */
var normaliseRef = function() {
var regex = /\[\s*(\*|[0-9]|[1-9][0-9]+)\s*\]/g;
return function normaliseRef( ref ) {
return ( ref || '' ).replace( regex, '.$1' );
};
}();
/* shared/getInnerContext.js */
var getInnerContext = function( fragment ) {
do {
if ( fragment.context ) {
return fragment.context;
}
} while ( fragment = fragment.parent );
return '';
};
/* utils/isEqual.js */
var isEqual = function( a, b ) {
if ( a === null && b === null ) {
return true;
}
if ( typeof a === 'object' || typeof b === 'object' ) {
return false;
}
return a === b;
};
/* shared/createComponentBinding.js */
var createComponentBinding = function( circular, isArray, isEqual ) {
var runloop;
circular.push( function() {
return runloop = circular.runloop;
} );
var Binding = function( ractive, keypath, otherInstance, otherKeypath, priority ) {
this.root = ractive;
this.keypath = keypath;
this.priority = priority;
this.otherInstance = otherInstance;
this.otherKeypath = otherKeypath;
this.bind();
this.value = this.root.viewmodel.get( this.keypath );
};
Binding.prototype = {
setValue: function( value ) {
var this$0 = this;
// Only *you* can prevent infinite loops
if ( this.updating || this.counterpart && this.counterpart.updating ) {
this.value = value;
return;
}
// Is this a smart array update? If so, it'll update on its
// own, we shouldn't do anything
if ( isArray( value ) && value._ractive && value._ractive.setting ) {
return;
}
if ( !isEqual( value, this.value ) ) {
this.updating = true;
// TODO maybe the case that `value === this.value` - should that result
// in an update rather than a set?
runloop.addViewmodel( this.otherInstance.viewmodel );
this.otherInstance.viewmodel.set( this.otherKeypath, value );
this.value = value;
// TODO will the counterpart update after this line, during
// the runloop end cycle? may be a problem...
runloop.scheduleTask( function() {
return this$0.updating = false;
} );
}
},
bind: function() {
this.root.viewmodel.register( this.keypath, this );
},
rebind: function( newKeypath ) {
this.unbind();
this.keypath = newKeypath;
this.counterpart.otherKeypath = newKeypath;
this.bind();
},
unbind: function() {
this.root.viewmodel.unregister( this.keypath, this );
}
};
return function createComponentBinding( component, parentInstance, parentKeypath, childKeypath ) {
var hash, childInstance, bindings, priority, parentToChildBinding, childToParentBinding;
hash = parentKeypath + '=' + childKeypath;
bindings = component.bindings;
if ( bindings[ hash ] ) {
// TODO does this ever happen?
return;
}
bindings[ hash ] = true;
childInstance = component.instance;
priority = component.parentFragment.priority;
parentToChildBinding = new Binding( parentInstance, parentKeypath, childInstance, childKeypath, priority );
bindings.push( parentToChildBinding );
if ( childInstance.twoway ) {
childToParentBinding = new Binding( childInstance, childKeypath, parentInstance, parentKeypath, 1 );
bindings.push( childToParentBinding );
parentToChildBinding.counterpart = childToParentBinding;
childToParentBinding.counterpart = parentToChildBinding;
}
};
}( circular, isArray, isEqual );
/* shared/resolveRef.js */
var resolveRef = function( normaliseRef, getInnerContext, createComponentBinding ) {
var ancestorErrorMessage, getOptions;
ancestorErrorMessage = 'Could not resolve reference - too many "../" prefixes';
getOptions = {
evaluateWrapped: true
};
return function resolveRef( ractive, ref, fragment ) {
var context, key, index, keypath, parentValue, hasContextChain, parentKeys, childKeys, parentKeypath, childKeypath;
ref = normaliseRef( ref );
// If a reference begins '~/', it's a top-level reference
if ( ref.substr( 0, 2 ) === '~/' ) {
return ref.substring( 2 );
}
// If a reference begins with '.', it's either a restricted reference or
// an ancestor reference...
if ( ref.charAt( 0 ) === '.' ) {
return resolveAncestorReference( getInnerContext( fragment ), ref );
}
// ...otherwise we need to find the keypath
key = ref.split( '.' )[ 0 ];
do {
context = fragment.context;
if ( !context ) {
continue;
}
hasContextChain = true;
parentValue = ractive.viewmodel.get( context, getOptions );
if ( parentValue && ( typeof parentValue === 'object' || typeof parentValue === 'function' ) && key in parentValue ) {
return context + '.' + ref;
}
} while ( fragment = fragment.parent );
// Root/computed property?
if ( key in ractive.data || key in ractive.viewmodel.computations ) {
return ref;
}
// If this is an inline component, and it's not isolated, we
// can try going up the scope chain
if ( ractive._parent && !ractive.isolated ) {
fragment = ractive.component.parentFragment;
// Special case - index refs
if ( fragment.indexRefs && ( index = fragment.indexRefs[ ref ] ) !== undefined ) {
// Create an index ref binding, so that it can be rebound letter if necessary.
// It doesn't have an alias since it's an implicit binding, hence `...[ ref ] = ref`
ractive.component.indexRefBindings[ ref ] = ref;
ractive.viewmodel.set( ref, index, true );
return;
}
keypath = resolveRef( ractive._parent, ref, fragment );
if ( keypath ) {
// We need to create an inter-component binding
// If parent keypath is 'one.foo' and child is 'two.foo', we bind
// 'one' to 'two' as it's more efficient and avoids edge cases
parentKeys = keypath.split( '.' );
childKeys = ref.split( '.' );
while ( parentKeys.length > 1 && childKeys.length > 1 && parentKeys[ parentKeys.length - 1 ] === childKeys[ childKeys.length - 1 ] ) {
parentKeys.pop();
childKeys.pop();
}
parentKeypath = parentKeys.join( '.' );
childKeypath = childKeys.join( '.' );
ractive.viewmodel.set( childKeypath, ractive._parent.viewmodel.get( parentKeypath ), true );
createComponentBinding( ractive.component, ractive._parent, parentKeypath, childKeypath );
return ref;
}
}
// If there's no context chain, and the instance is either a) isolated or
// b) an orphan, then we know that the keypath is identical to the reference
if ( !hasContextChain ) {
return ref;
}
if ( ractive.viewmodel.get( ref ) !== undefined ) {
return ref;
}
};
function resolveAncestorReference( baseContext, ref ) {
var contextKeys;
// {{.}} means 'current context'
if ( ref === '.' )
return baseContext;
contextKeys = baseContext ? baseContext.split( '.' ) : [];
// ancestor references (starting "../") go up the tree
if ( ref.substr( 0, 3 ) === '../' ) {
while ( ref.substr( 0, 3 ) === '../' ) {
if ( !contextKeys.length ) {
throw new Error( ancestorErrorMessage );
}
contextKeys.pop();
ref = ref.substring( 3 );
}
contextKeys.push( ref );
return contextKeys.join( '.' );
}
// not an ancestor reference - must be a restricted reference (prepended with "." or "./")
if ( !baseContext ) {
return ref.replace( /^\.\/?/, '' );
}
return baseContext + ref.replace( /^\.\//, '.' );
}
}( normaliseRef, getInnerContext, createComponentBinding );
/* global/TransitionManager.js */
var TransitionManager = function( removeFromArray ) {
var TransitionManager = function( callback, parent ) {
this.callback = callback;
this.parent = parent;
this.intros = [];
this.outros = [];
this.children = [];
this.totalChildren = this.outroChildren = 0;
this.detachQueue = [];
this.outrosComplete = false;
if ( parent ) {
parent.addChild( this );
}
};
TransitionManager.prototype = {
addChild: function( child ) {
this.children.push( child );
this.totalChildren += 1;
this.outroChildren += 1;
},
decrementOutros: function() {
this.outroChildren -= 1;
check( this );
},
decrementTotal: function() {
this.totalChildren -= 1;
check( this );
},
add: function( transition ) {
var list = transition.isIntro ? this.intros : this.outros;
list.push( transition );
},
remove: function( transition ) {
var list = transition.isIntro ? this.intros : this.outros;
removeFromArray( list, transition );
check( this );
},
init: function() {
this.ready = true;
check( this );
},
detachNodes: function() {
this.detachQueue.forEach( detach );
this.children.forEach( detachNodes );
}
};
function detach( element ) {
element.detach();
}
function detachNodes( tm ) {
tm.detachNodes();
}
function check( tm ) {
if ( !tm.ready || tm.outros.length || tm.outroChildren )
return;
// If all outros are complete, and we haven't already done this,
// we notify the parent if there is one, otherwise
// start detaching nodes
if ( !tm.outrosComplete ) {
if ( tm.parent ) {
tm.parent.decrementOutros( tm );
} else {
tm.detachNodes();
}
tm.outrosComplete = true;
}
// Once everything is done, we can notify parent transition
// manager and call the callback
if ( !tm.intros.length && !tm.totalChildren ) {
if ( typeof tm.callback === 'function' ) {
tm.callback();
}
if ( tm.parent ) {
tm.parent.decrementTotal();
}
}
}
return TransitionManager;
}( removeFromArray );
/* global/runloop.js */
var runloop = function( circular, removeFromArray, Promise, resolveRef, TransitionManager ) {
var batch, runloop, unresolved = [];
runloop = {
start: function( instance, returnPromise ) {
var promise, fulfilPromise;
if ( returnPromise ) {
promise = new Promise( function( f ) {
return fulfilPromise = f;
} );
}
batch = {
previousBatch: batch,
transitionManager: new TransitionManager( fulfilPromise, batch && batch.transitionManager ),
views: [],
tasks: [],
viewmodels: []
};
if ( instance ) {
batch.viewmodels.push( instance.viewmodel );
}
return promise;
},
end: function() {
flushChanges();
batch.transitionManager.init();
batch = batch.previousBatch;
},
addViewmodel: function( viewmodel ) {
if ( batch ) {
if ( batch.viewmodels.indexOf( viewmodel ) === -1 ) {
batch.viewmodels.push( viewmodel );
}
} else {
viewmodel.applyChanges();
}
},
registerTransition: function( transition ) {
transition._manager = batch.transitionManager;
batch.transitionManager.add( transition );
},
addView: function( view ) {
batch.views.push( view );
},
addUnresolved: function( thing ) {
unresolved.push( thing );
},
removeUnresolved: function( thing ) {
removeFromArray( unresolved, thing );
},
// synchronise node detachments with transition ends
detachWhenReady: function( thing ) {
batch.transitionManager.detachQueue.push( thing );
},
scheduleTask: function( task ) {
if ( !batch ) {
task();
} else {
batch.tasks.push( task );
}
}
};
circular.runloop = runloop;
return runloop;
function flushChanges() {
var i, thing, changeHash;
for ( i = 0; i < batch.viewmodels.length; i += 1 ) {
thing = batch.viewmodels[ i ];
changeHash = thing.applyChanges();
if ( changeHash ) {
thing.ractive.fire( 'change', changeHash );
}
}
batch.viewmodels.length = 0;
attemptKeypathResolution();
// Now that changes have been fully propagated, we can update the DOM
// and complete other tasks
for ( i = 0; i < batch.views.length; i += 1 ) {
batch.views[ i ].update();
}
batch.views.length = 0;
for ( i = 0; i < batch.tasks.length; i += 1 ) {
batch.tasks[ i ]();
}
batch.tasks.length = 0;
// If updating the view caused some model blowback - e.g. a triple
// containing <option> elements caused the binding on the <select>
// to update - then we start over
if ( batch.viewmodels.length )
return flushChanges();
}
function attemptKeypathResolution() {
var array, thing, keypath;
if ( !unresolved.length ) {
return;
}
// see if we can resolve any unresolved references
array = unresolved.splice( 0, unresolved.length );
while ( thing = array.pop() ) {
if ( thing.keypath ) {
continue;
}
keypath = resolveRef( thing.root, thing.ref, thing.parentFragment );
if ( keypath !== undefined ) {
// If we've resolved the keypath, we can initialise this item
thing.resolve( keypath );
} else {
// If we can't resolve the reference, try again next time
unresolved.push( thing );
}
}
}
}( circular, removeFromArray, Promise, resolveRef, TransitionManager );
/* utils/createBranch.js */
var createBranch = function() {
var numeric = /^\s*[0-9]+\s*$/;
return function( key ) {
return numeric.test( key ) ? [] : {};
};
}();
/* viewmodel/prototype/get/magicAdaptor.js */
var viewmodel$get_magicAdaptor = function( runloop, createBranch, isArray ) {
var magicAdaptor, MagicWrapper;
try {
Object.defineProperty( {}, 'test', {
value: 0
} );
magicAdaptor = {
filter: function( object, keypath, ractive ) {
var keys, key, parentKeypath, parentWrapper, parentValue;
if ( !keypath ) {
return false;
}
keys = keypath.split( '.' );
key = keys.pop();
parentKeypath = keys.join( '.' );
// If the parent value is a wrapper, other than a magic wrapper,
// we shouldn't wrap this property
if ( ( parentWrapper = ractive.viewmodel.wrapped[ parentKeypath ] ) && !parentWrapper.magic ) {
return false;
}
parentValue = ractive.get( parentKeypath );
// if parentValue is an array that doesn't include this member,
// we should return false otherwise lengths will get messed up
if ( isArray( parentValue ) && /^[0-9]+$/.test( key ) ) {
return false;
}
return parentValue && ( typeof parentValue === 'object' || typeof parentValue === 'function' );
},
wrap: function( ractive, property, keypath ) {
return new MagicWrapper( ractive, property, keypath );
}
};
MagicWrapper = function( ractive, value, keypath ) {
var keys, objKeypath, template, siblings;
this.magic = true;
this.ractive = ractive;
this.keypath = keypath;
this.value = value;
keys = keypath.split( '.' );
this.prop = keys.pop();
objKeypath = keys.join( '.' );
this.obj = objKeypath ? ractive.get( objKeypath ) : ractive.data;
template = this.originalDescriptor = Object.getOwnPropertyDescriptor( this.obj, this.prop );
// Has this property already been wrapped?
if ( template && template.set && ( siblings = template.set._ractiveWrappers ) ) {
// Yes. Register this wrapper to this property, if it hasn't been already
if ( siblings.indexOf( this ) === -1 ) {
siblings.push( this );
}
return;
}
// No, it hasn't been wrapped
createAccessors( this, value, template );
};
MagicWrapper.prototype = {
get: function() {
return this.value;
},
reset: function( value ) {
if ( this.updating ) {
return;
}
this.updating = true;
this.obj[ this.prop ] = value;
// trigger set() accessor
runloop.addViewmodel( this.ractive.viewmodel );
this.ractive.viewmodel.mark( this.keypath );
this.updating = false;
},
set: function( key, value ) {
if ( this.updating ) {
return;
}
if ( !this.obj[ this.prop ] ) {
this.updating = true;
this.obj[ this.prop ] = createBranch( key );
this.updating = false;
}
this.obj[ this.prop ][ key ] = value;
},
teardown: function() {
var template, set, value, wrappers, index;
// If this method was called because the cache was being cleared as a
// result of a set()/update() call made by this wrapper, we return false
// so that it doesn't get torn down
if ( this.updating ) {
return false;
}
template = Object.getOwnPropertyDescriptor( this.obj, this.prop );
set = template && template.set;
if ( !set ) {
// most likely, this was an array member that was spliced out
return;
}
wrappers = set._ractiveWrappers;
index = wrappers.indexOf( this );
if ( index !== -1 ) {
wrappers.splice( index, 1 );
}
// Last one out, turn off the lights
if ( !wrappers.length ) {
value = this.obj[ this.prop ];
Object.defineProperty( this.obj, this.prop, this.originalDescriptor || {
writable: true,
enumerable: true,
configurable: true
} );
this.obj[ this.prop ] = value;
}
}
};
} catch ( err ) {
magicAdaptor = false;
}
return magicAdaptor;
function createAccessors( originalWrapper, value, template ) {
var object, property, oldGet, oldSet, get, set;
object = originalWrapper.obj;
property = originalWrapper.prop;
// Is this template configurable?
if ( template && !template.configurable ) {
// Special case - array length
if ( property === 'length' ) {
return;
}
throw new Error( 'Cannot use magic mode with property "' + property + '" - object is not configurable' );
}
// Time to wrap this property
if ( template ) {
oldGet = template.get;
oldSet = template.set;
}
get = oldGet || function() {
return value;
};
set = function( v ) {
if ( oldSet ) {
oldSet( v );
}
value = oldGet ? oldGet() : v;
set._ractiveWrappers.forEach( updateWrapper );
};
function updateWrapper( wrapper ) {
var keypath, ractive;
wrapper.value = value;
if ( wrapper.updating ) {
return;
}
ractive = wrapper.ractive;
keypath = wrapper.keypath;
wrapper.updating = true;
runloop.start( ractive );
ractive.viewmodel.mark( keypath );
runloop.end();
wrapper.updating = false;
}
// Create an array of wrappers, in case other keypaths/ractives depend on this property.
// Handily, we can store them as a property of the set function. Yay JavaScript.
set._ractiveWrappers = [ originalWrapper ];
Object.defineProperty( object, property, {
get: get,
set: set,
enumerable: true,
configurable: true
} );
}
}( runloop, createBranch, isArray );
/* config/magic.js */
var magic = function( magicAdaptor ) {
return !!magicAdaptor;
}( viewmodel$get_magicAdaptor );
/* config/namespaces.js */
var namespaces = {
html: 'http://www.w3.org/1999/xhtml',
mathml: 'http://www.w3.org/1998/Math/MathML',
svg: 'http://www.w3.org/2000/svg',
xlink: 'http://www.w3.org/1999/xlink',
xml: 'http://www.w3.org/XML/1998/namespace',
xmlns: 'http://www.w3.org/2000/xmlns/'
};
/* utils/createElement.js */
var createElement = function( svg, namespaces ) {
var createElement;
// Test for SVG support
if ( !svg ) {
createElement = function( type, ns ) {
if ( ns && ns !== namespaces.html ) {
throw 'This browser does not support namespaces other than http://www.w3.org/1999/xhtml. The most likely cause of this error is that you\'re trying to render SVG in an older browser. See http://docs.ractivejs.org/latest/svg-and-older-browsers for more information';
}
return document.createElement( type );
};
} else {
createElement = function( type, ns ) {
if ( !ns || ns === namespaces.html ) {
return document.createElement( type );
}
return document.createElementNS( ns, type );
};
}
return createElement;
}( svg, namespaces );
/* config/isClient.js */
var isClient = function() {
var isClient = typeof document === 'object';
return isClient;
}();
/* utils/defineProperty.js */
var defineProperty = function( isClient ) {
var defineProperty;
try {
Object.defineProperty( {}, 'test', {
value: 0
} );
if ( isClient ) {
Object.defineProperty( document.createElement( 'div' ), 'test', {
value: 0
} );
}
defineProperty = Object.defineProperty;
} catch ( err ) {
// Object.defineProperty doesn't exist, or we're in IE8 where you can
// only use it with DOM objects (what the fuck were you smoking, MSFT?)
defineProperty = function( obj, prop, desc ) {
obj[ prop ] = desc.value;
};
}
return defineProperty;
}( isClient );
/* utils/defineProperties.js */
var defineProperties = function( createElement, defineProperty, isClient ) {
var defineProperties;
try {
try {
Object.defineProperties( {}, {
test: {
value: 0
}
} );
} catch ( err ) {
// TODO how do we account for this? noMagic = true;
throw err;
}
if ( isClient ) {
Object.defineProperties( createElement( 'div' ), {
test: {
value: 0
}
} );
}
defineProperties = Object.defineProperties;
} catch ( err ) {
defineProperties = function( obj, props ) {
var prop;
for ( prop in props ) {
if ( props.hasOwnProperty( prop ) ) {
defineProperty( obj, prop, props[ prop ] );
}
}
};
}
return defineProperties;
}( createElement, defineProperty, isClient );
/* Ractive/prototype/shared/add.js */
var Ractive$shared_add = function( isNumeric ) {
return function add( root, keypath, d ) {
var value;
if ( typeof keypath !== 'string' || !isNumeric( d ) ) {
throw new Error( 'Bad arguments' );
}
value = +root.get( keypath ) || 0;
if ( !isNumeric( value ) ) {
throw new Error( 'Cannot add to a non-numeric value' );
}
return root.set( keypath, value + d );
};
}( isNumeric );
/* Ractive/prototype/add.js */
var Ractive$add = function( add ) {
return function Ractive$add( keypath, d ) {
return add( this, keypath, d === undefined ? 1 : +d );
};
}( Ractive$shared_add );
/* utils/normaliseKeypath.js */
var normaliseKeypath = function( normaliseRef ) {
var leadingDot = /^\.+/;
return function normaliseKeypath( keypath ) {
return normaliseRef( keypath ).replace( leadingDot, '' );
};
}( normaliseRef );
/* config/vendors.js */
var vendors = [
'o',
'ms',
'moz',
'webkit'
];
/* utils/requestAnimationFrame.js */
var requestAnimationFrame = function( vendors ) {
var requestAnimationFrame;
// If window doesn't exist, we don't need requestAnimationFrame
if ( typeof window === 'undefined' ) {
requestAnimationFrame = null;
} else {
// https://gist.github.com/paulirish/1579671
( function( vendors, lastTime, window ) {
var x, setTimeout;
if ( window.requestAnimationFrame ) {
return;
}
for ( x = 0; x < vendors.length && !window.requestAnimationFrame; ++x ) {
window.requestAnimationFrame = window[ vendors[ x ] + 'RequestAnimationFrame' ];
}
if ( !window.requestAnimationFrame ) {
setTimeout = window.setTimeout;
window.requestAnimationFrame = function( callback ) {
var currTime, timeToCall, id;
currTime = Date.now();
timeToCall = Math.max( 0, 16 - ( currTime - lastTime ) );
id = setTimeout( function() {
callback( currTime + timeToCall );
}, timeToCall );
lastTime = currTime + timeToCall;
return id;
};
}
}( vendors, 0, window ) );
requestAnimationFrame = window.requestAnimationFrame;
}
return requestAnimationFrame;
}( vendors );
/* utils/getTime.js */
var getTime = function() {
var getTime;
if ( typeof window !== 'undefined' && window.performance && typeof window.performance.now === 'function' ) {
getTime = function() {
return window.performance.now();
};
} else {
getTime = function() {
return Date.now();
};
}
return getTime;
}();
/* shared/animations.js */
var animations = function( rAF, getTime, runloop ) {
var queue = [];
var animations = {
tick: function() {
var i, animation, now;
now = getTime();
runloop.start();
for ( i = 0; i < queue.length; i += 1 ) {
animation = queue[ i ];
if ( !animation.tick( now ) ) {
// animation is complete, remove it from the stack, and decrement i so we don't miss one
queue.splice( i--, 1 );
}
}
runloop.end();
if ( queue.length ) {
rAF( animations.tick );
} else {
animations.running = false;
}
},
add: function( animation ) {
queue.push( animation );
if ( !animations.running ) {
animations.running = true;
rAF( animations.tick );
}
},
// TODO optimise this
abort: function( keypath, root ) {
var i = queue.length,
animation;
while ( i-- ) {
animation = queue[ i ];
if ( animation.root === root && animation.keypath === keypath ) {
animation.stop();
}
}
}
};
return animations;
}( requestAnimationFrame, getTime, runloop );
/* utils/warn.js */
var warn = function() {
/* global console */
var warn, warned = {};
if ( typeof console !== 'undefined' && typeof console.warn === 'function' && typeof console.warn.apply === 'function' ) {
warn = function( message, allowDuplicates ) {
if ( !allowDuplicates ) {
if ( warned[ message ] ) {
return;
}
warned[ message ] = true;
}
console.warn( message );
};
} else {
warn = function() {};
}
return warn;
}();
/* config/options/css/transform.js */
var transform = function() {
var selectorsPattern = /(?:^|\})?\s*([^\{\}]+)\s*\{/g,
commentsPattern = /\/\*.*?\*\//g,
selectorUnitPattern = /((?:(?:\[[^\]+]\])|(?:[^\s\+\>\~:]))+)((?::[^\s\+\>\~]+)?\s*[\s\+\>\~]?)\s*/g,
mediaQueryPattern = /^@media/,
dataRvcGuidPattern = /\[data-rvcguid="[a-z0-9-]+"]/g;
return function transformCss( css, guid ) {
var transformed, addGuid;
addGuid = function( selector ) {
var selectorUnits, match, unit, dataAttr, base, prepended, appended, i, transformed = [];
selectorUnits = [];
while ( match = selectorUnitPattern.exec( selector ) ) {
selectorUnits.push( {
str: match[ 0 ],
base: match[ 1 ],
modifiers: match[ 2 ]
} );
}
// For each simple selector within the selector, we need to create a version
// that a) combines with the guid, and b) is inside the guid
dataAttr = '[data-rvcguid="' + guid + '"]';
base = selectorUnits.map( extractString );
i = selectorUnits.length;
while ( i-- ) {
appended = base.slice();
// Pseudo-selectors should go after the attribute selector
unit = selectorUnits[ i ];
appended[ i ] = unit.base + dataAttr + unit.modifiers || '';
prepended = base.slice();
prepended[ i ] = dataAttr + ' ' + prepended[ i ];
transformed.push( appended.join( ' ' ), prepended.join( ' ' ) );
}
return transformed.join( ', ' );
};
if ( dataRvcGuidPattern.test( css ) ) {
transformed = css.replace( dataRvcGuidPattern, '[data-rvcguid="' + guid + '"]' );
} else {
transformed = css.replace( commentsPattern, '' ).replace( selectorsPattern, function( match, $1 ) {
var selectors, transformed;
// don't transform media queries!
if ( mediaQueryPattern.test( $1 ) )
return match;
selectors = $1.split( ',' ).map( trim );
transformed = selectors.map( addGuid ).join( ', ' ) + ' ';
return match.replace( $1, transformed );
} );
}
return transformed;
};
function trim( str ) {
if ( str.trim ) {
return str.trim();
}
return str.replace( /^\s+/, '' ).replace( /\s+$/, '' );
}
function extractString( unit ) {
return unit.str;
}
}();
/* config/options/css/css.js */
var css = function( transformCss ) {
var cssConfig = {
name: 'css',
extend: extend,
init: function() {}
};
function extend( Parent, proto, options ) {
var guid = proto.constructor._guid,
css;
if ( css = getCss( options.css, options, guid ) || getCss( Parent.css, Parent, guid ) ) {
proto.constructor.css = css;
}
}
function getCss( css, target, guid ) {
if ( !css ) {
return;
}
return target.noCssTransform ? css : transformCss( css, guid );
}
return cssConfig;
}( transform );
/* utils/wrapMethod.js */
var wrapMethod = function() {
return function( method, superMethod, force ) {
if ( force || needsSuper( method, superMethod ) ) {
return function() {
var hasSuper = '_super' in this,
_super = this._super,
result;
this._super = superMethod;
result = method.apply( this, arguments );
if ( hasSuper ) {
this._super = _super;
}
return result;
};
} else {
return method;
}
};
function needsSuper( method, superMethod ) {
return typeof superMethod === 'function' && /_super/.test( method );
}
}();
/* config/options/data.js */
var data = function( wrap ) {
var dataConfig = {
name: 'data',
extend: extend,
init: init,
reset: reset
};
return dataConfig;
function combine( Parent, target, options ) {
var value = options.data || {},
parentValue = getAddedKeys( Parent.prototype.data );
return dispatch( parentValue, value );
}
function extend( Parent, proto, options ) {
proto.data = combine( Parent, proto, options );
}
function init( Parent, ractive, options ) {
var value = options.data,
result = combine( Parent, ractive, options );
if ( typeof result === 'function' ) {
result = result.call( ractive, value ) || value;
}
return ractive.data = result || {};
}
function reset( ractive ) {
var result = this.init( ractive.constructor, ractive, ractive );
if ( result ) {
ractive.data = result;
return true;
}
}
function getAddedKeys( parent ) {
// only for functions that had keys added
if ( typeof parent !== 'function' || !Object.keys( parent ).length ) {
return parent;
}
// copy the added keys to temp 'object', otherwise
// parent would be interpreted as 'function' by dispatch
var temp = {};
copy( parent, temp );
// roll in added keys
return dispatch( parent, temp );
}
function dispatch( parent, child ) {
if ( typeof child === 'function' ) {
return extendFn( child, parent );
} else if ( typeof parent === 'function' ) {
return fromFn( child, parent );
} else {
return fromProperties( child, parent );
}
}
function copy( from, to, fillOnly ) {
for ( var key in from ) {
if ( fillOnly && key in to ) {
continue;
}
to[ key ] = from[ key ];
}
}
function fromProperties( child, parent ) {
child = child || {};
if ( !parent ) {
return child;
}
copy( parent, child, true );
return child;
}
function fromFn( child, parentFn ) {
return function( data ) {
var keys;
if ( child ) {
// Track the keys that our on the child,
// but not on the data. We'll need to apply these
// after the parent function returns.
keys = [];
for ( var key in child ) {
if ( !data || !( key in data ) ) {
keys.push( key );
}
}
}
// call the parent fn, use data if no return value
data = parentFn.call( this, data ) || data;
// Copy child keys back onto data. The child keys
// should take precedence over whatever the
// parent did with the data.
if ( keys && keys.length ) {
data = data || {};
keys.forEach( function( key ) {
data[ key ] = child[ key ];
} );
}
return data;
};
}
function extendFn( childFn, parent ) {
var parentFn;
if ( typeof parent !== 'function' ) {
// copy props to data
parentFn = function( data ) {
fromProperties( data, parent );
};
} else {
parentFn = function( data ) {
// give parent function it's own this._super context,
// otherwise this._super is from child and
// causes infinite loop
parent = wrap( parent, function() {}, true );
return parent.call( this, data ) || data;
};
}
return wrap( childFn, parentFn );
}
}( wrapMethod );
/* config/errors.js */
var errors = {
missingParser: 'Missing Ractive.parse - cannot parse template. Either preparse or use the version that includes the parser',
mergeComparisonFail: 'Merge operation: comparison failed. Falling back to identity checking',
noComponentEventArguments: 'Components currently only support simple events - you cannot include arguments. Sorry!',
noTemplateForPartial: 'Could not find template for partial "{name}"',
noNestedPartials: 'Partials ({{>{name}}}) cannot contain nested inline partials',
evaluationError: 'Error evaluating "{uniqueString}": {err}',
badArguments: 'Bad arguments "{arguments}". I\'m not allowed to argue unless you\'ve paid.',
failedComputation: 'Failed to compute "{key}": {err}',
missingPlugin: 'Missing "{name}" {plugin} plugin. You may need to download a {plugin} via http://docs.ractivejs.org/latest/plugins#{plugin}s',
badRadioInputBinding: 'A radio input can have two-way binding on its name attribute, or its checked attribute - not both',
noRegistryFunctionReturn: 'A function was specified for "{name}" {registry}, but no {registry} was returned'
};
/* empty/parse.js */
var parse = null;
/* utils/create.js */
var create = function() {
var create;
try {
Object.create( null );
create = Object.create;
} catch ( err ) {
// sigh
create = function() {
var F = function() {};
return function( proto, props ) {
var obj;
if ( proto === null ) {
return {};
}
F.prototype = proto;
obj = new F();
if ( props ) {
Object.defineProperties( obj, props );
}
return obj;
};
}();
}
return create;
}();
/* legacy.js */
var legacy = function() {
var win, doc, exportedShims;
if ( typeof window === 'undefined' ) {
exportedShims = null;
}
win = window;
doc = win.document;
exportedShims = {};
if ( !doc ) {
exportedShims = null;
}
// Shims for older browsers
if ( !Date.now ) {
Date.now = function() {
return +new Date();
};
}
if ( !String.prototype.trim ) {
String.prototype.trim = function() {
return this.replace( /^\s+/, '' ).replace( /\s+$/, '' );
};
}
// Polyfill for Object.keys
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/keys
if ( !Object.keys ) {
Object.keys = function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !{
toString: null
}.propertyIsEnumerable( 'toString' ),
dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
],
dontEnumsLength = dontEnums.length;
return function( obj ) {
if ( typeof obj !== 'object' && typeof obj !== 'function' || obj === null ) {
throw new TypeError( 'Object.keys called on non-object' );
}
var result = [];
for ( var prop in obj ) {
if ( hasOwnProperty.call( obj, prop ) ) {
result.push( prop );
}
}
if ( hasDontEnumBug ) {
for ( var i = 0; i < dontEnumsLength; i++ ) {
if ( hasOwnProperty.call( obj, dontEnums[ i ] ) ) {
result.push( dontEnums[ i ] );
}
}
}
return result;
};
}();
}
// TODO: use defineProperty to make these non-enumerable
// Array extras
if ( !Array.prototype.indexOf ) {
Array.prototype.indexOf = function( needle, i ) {
var len;
if ( i === undefined ) {
i = 0;
}
if ( i < 0 ) {
i += this.length;
}
if ( i < 0 ) {
i = 0;
}
for ( len = this.length; i < len; i++ ) {
if ( this.hasOwnProperty( i ) && this[ i ] === needle ) {
return i;
}
}
return -1;
};
}
if ( !Array.prototype.forEach ) {
Array.prototype.forEach = function( callback, context ) {
var i, len;
for ( i = 0, len = this.length; i < len; i += 1 ) {
if ( this.hasOwnProperty( i ) ) {
callback.call( context, this[ i ], i, this );
}
}
};
}
if ( !Array.prototype.map ) {
Array.prototype.map = function( mapper, context ) {
var array = this,
i, len, mapped = [],
isActuallyString;
// incredibly, if you do something like
// Array.prototype.map.call( someString, iterator )
// then `this` will become an instance of String in IE8.
// And in IE8, you then can't do string[i]. Facepalm.
if ( array instanceof String ) {
array = array.toString();
isActuallyString = true;
}
for ( i = 0, len = array.length; i < len; i += 1 ) {
if ( array.hasOwnProperty( i ) || isActuallyString ) {
mapped[ i ] = mapper.call( context, array[ i ], i, array );
}
}
return mapped;
};
}
if ( typeof Array.prototype.reduce !== 'function' ) {
Array.prototype.reduce = function( callback, opt_initialValue ) {
var i, value, len, valueIsSet;
if ( 'function' !== typeof callback ) {
throw new TypeError( callback + ' is not a function' );
}
len = this.length;
valueIsSet = false;
if ( arguments.length > 1 ) {
value = opt_initialValue;
valueIsSet = true;
}
for ( i = 0; i < len; i += 1 ) {
if ( this.hasOwnProperty( i ) ) {
if ( valueIsSet ) {
value = callback( value, this[ i ], i, this );
}
} else {
value = this[ i ];
valueIsSet = true;
}
}
if ( !valueIsSet ) {
throw new TypeError( 'Reduce of empty array with no initial value' );
}
return value;
};
}
if ( !Array.prototype.filter ) {
Array.prototype.filter = function( filter, context ) {
var i, len, filtered = [];
for ( i = 0, len = this.length; i < len; i += 1 ) {
if ( this.hasOwnProperty( i ) && filter.call( context, this[ i ], i, this ) ) {
filtered[ filtered.length ] = this[ i ];
}
}
return filtered;
};
}
if ( !Array.prototype.every ) {
Array.prototype.every = function( iterator, context ) {
var t, len, i;
if ( this == null ) {
throw new TypeError();
}
t = Object( this );
len = t.length >>> 0;
if ( typeof iterator !== 'function' ) {
throw new TypeError();
}
for ( i = 0; i < len; i += 1 ) {
if ( i in t && !iterator.call( context, t[ i ], i, t ) ) {
return false;
}
}
return true;
};
}
/*
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
if (!Array.prototype.find) {
Array.prototype.find = function(predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
var thisArg = arguments[1];
var value;
for (var i = 0; i < length; i++) {
if (i in list) {
value = list[i];
if (predicate.call(thisArg, value, i, list)) {
return value;
}
}
}
return undefined;
}
}
*/
if ( typeof Function.prototype.bind !== 'function' ) {
Function.prototype.bind = function( context ) {
var args, fn, Empty, bound, slice = [].slice;
if ( typeof this !== 'function' ) {
throw new TypeError( 'Function.prototype.bind called on non-function' );
}
args = slice.call( arguments, 1 );
fn = this;
Empty = function() {};
bound = function() {
var ctx = this instanceof Empty && context ? this : context;
return fn.apply( ctx, args.concat( slice.call( arguments ) ) );
};
Empty.prototype = this.prototype;
bound.prototype = new Empty();
return bound;
};
}
// https://gist.github.com/Rich-Harris/6010282 via https://gist.github.com/jonathantneal/2869388
// addEventListener polyfill IE6+
if ( !win.addEventListener ) {
( function( win, doc ) {
var Event, addEventListener, removeEventListener, head, style, origCreateElement;
Event = function( e, element ) {
var property, instance = this;
for ( property in e ) {
instance[ property ] = e[ property ];
}
instance.currentTarget = element;
instance.target = e.srcElement || element;
instance.timeStamp = +new Date();
instance.preventDefault = function() {
e.returnValue = false;
};
instance.stopPropagation = function() {
e.cancelBubble = true;
};
};
addEventListener = function( type, listener ) {
var element = this,
listeners, i;
listeners = element.listeners || ( element.listeners = [] );
i = listeners.length;
listeners[ i ] = [
listener,
function( e ) {
listener.call( element, new Event( e, element ) );
}
];
element.attachEvent( 'on' + type, listeners[ i ][ 1 ] );
};
removeEventListener = function( type, listener ) {
var element = this,
listeners, i;
if ( !element.listeners ) {
return;
}
listeners = element.listeners;
i = listeners.length;
while ( i-- ) {
if ( listeners[ i ][ 0 ] === listener ) {
element.detachEvent( 'on' + type, listeners[ i ][ 1 ] );
}
}
};
win.addEventListener = doc.addEventListener = addEventListener;
win.removeEventListener = doc.removeEventListener = removeEventListener;
if ( 'Element' in win ) {
win.Element.prototype.addEventListener = addEventListener;
win.Element.prototype.removeEventListener = removeEventListener;
} else {
// First, intercept any calls to document.createElement - this is necessary
// because the CSS hack (see below) doesn't come into play until after a
// node is added to the DOM, which is too late for a lot of Ractive setup work
origCreateElement = doc.createElement;
doc.createElement = function( tagName ) {
var el = origCreateElement( tagName );
el.addEventListener = addEventListener;
el.removeEventListener = removeEventListener;
return el;
};
// Then, mop up any additional elements that weren't created via
// document.createElement (i.e. with innerHTML).
head = doc.getElementsByTagName( 'head' )[ 0 ];
style = doc.createElement( 'style' );
head.insertBefore( style, head.firstChild );
}
}( win, doc ) );
}
// The getComputedStyle polyfill interacts badly with jQuery, so we don't attach
// it to window. Instead, we export it for other modules to use as needed
// https://github.com/jonathantneal/Polyfills-for-IE8/blob/master/getComputedStyle.js
if ( !win.getComputedStyle ) {
exportedShims.getComputedStyle = function() {
var borderSizes = {};
function getPixelSize( element, style, property, fontSize ) {
var sizeWithSuffix = style[ property ],
size = parseFloat( sizeWithSuffix ),
suffix = sizeWithSuffix.split( /\d/ )[ 0 ],
rootSize;
if ( isNaN( size ) ) {
if ( /^thin|medium|thick$/.test( sizeWithSuffix ) ) {
size = getBorderPixelSize( sizeWithSuffix );
suffix = '';
} else {}
}
fontSize = fontSize != null ? fontSize : /%|em/.test( suffix ) && element.parentElement ? getPixelSize( element.parentElement, element.parentElement.currentStyle, 'fontSize', null ) : 16;
rootSize = property == 'fontSize' ? fontSize : /width/i.test( property ) ? element.clientWidth : element.clientHeight;
return suffix == 'em' ? size * fontSize : suffix == 'in' ? size * 96 : suffix == 'pt' ? size * 96 / 72 : suffix == '%' ? size / 100 * rootSize : size;
}
function getBorderPixelSize( size ) {
var div, bcr;
// `thin`, `medium` and `thick` vary between browsers. (Don't ever use them.)
if ( !borderSizes[ size ] ) {
div = document.createElement( 'div' );
div.style.display = 'block';
div.style.position = 'fixed';
div.style.width = div.style.height = '0';
div.style.borderRight = size + ' solid black';
document.getElementsByTagName( 'body' )[ 0 ].appendChild( div );
bcr = div.getBoundingClientRect();
borderSizes[ size ] = bcr.right - bcr.left;
}
return borderSizes[ size ];
}
function setShortStyleProperty( style, property ) {
var borderSuffix = property == 'border' ? 'Width' : '',
t = property + 'Top' + borderSuffix,
r = property + 'Right' + borderSuffix,
b = property + 'Bottom' + borderSuffix,
l = property + 'Left' + borderSuffix;
style[ property ] = ( style[ t ] == style[ r ] == style[ b ] == style[ l ] ? [ style[ t ] ] : style[ t ] == style[ b ] && style[ l ] == style[ r ] ? [
style[ t ],
style[ r ]
] : style[ l ] == style[ r ] ? [
style[ t ],
style[ r ],
style[ b ]
] : [
style[ t ],
style[ r ],
style[ b ],
style[ l ]
] ).join( ' ' );
}
function CSSStyleDeclaration( element ) {
var currentStyle, style, fontSize, property;
currentStyle = element.currentStyle;
style = this;
fontSize = getPixelSize( element, currentStyle, 'fontSize', null );
// TODO tidy this up, test it, send PR to jonathantneal!
for ( property in currentStyle ) {
if ( /width|height|margin.|padding.|border.+W/.test( property ) ) {
if ( currentStyle[ property ] === 'auto' ) {
if ( /^width|height/.test( property ) ) {
// just use clientWidth/clientHeight...
style[ property ] = ( property === 'width' ? element.clientWidth : element.clientHeight ) + 'px';
} else if ( /(?:padding)?Top|Bottom$/.test( property ) ) {
style[ property ] = '0px';
}
} else {
style[ property ] = getPixelSize( element, currentStyle, property, fontSize ) + 'px';
}
} else if ( property === 'styleFloat' ) {
style.float = currentStyle[ property ];
} else {
style[ property ] = currentStyle[ property ];
}
}
setShortStyleProperty( style, 'margin' );
setShortStyleProperty( style, 'padding' );
setShortStyleProperty( style, 'border' );
style.fontSize = fontSize + 'px';
return style;
}
CSSStyleDeclaration.prototype = {
constructor: CSSStyleDeclaration,
getPropertyPriority: function() {},
getPropertyValue: function( prop ) {
return this[ prop ] || '';
},
item: function() {},
removeProperty: function() {},
setProperty: function() {},
getPropertyCSSValue: function() {}
};
function getComputedStyle( element ) {
return new CSSStyleDeclaration( element );
}
return getComputedStyle;
}();
}
return exportedShims;
}();
/* config/options/groups/optionGroup.js */
var optionGroup = function() {
return function createOptionGroup( keys, config ) {
var group = keys.map( config );
keys.forEach( function( key, i ) {
group[ key ] = group[ i ];
} );
return group;
};
}( legacy );
/* config/options/groups/parseOptions.js */
var parseOptions = function( optionGroup ) {
var keys, parseOptions;
keys = [
'preserveWhitespace',
'sanitize',
'stripComments',
'delimiters',
'tripleDelimiters'
];
parseOptions = optionGroup( keys, function( key ) {
return key;
} );
return parseOptions;
}( optionGroup );
/* config/options/template/parser.js */
var parser = function( errors, isClient, parse, create, parseOptions ) {
var parser = {
parse: doParse,
fromId: fromId,
isHashedId: isHashedId,
isParsed: isParsed,
getParseOptions: getParseOptions,
createHelper: createHelper
};
function createHelper( parseOptions ) {
var helper = create( parser );
helper.parse = function( template, options ) {
return doParse( template, options || parseOptions );
};
return helper;
}
function doParse( template, parseOptions ) {
if ( !parse ) {
throw new Error( errors.missingParser );
}
return parse( template, parseOptions || this.options );
}
function fromId( id, options ) {
var template;
if ( !isClient ) {
if ( options && options.noThrow ) {
return;
}
throw new Error( 'Cannot retrieve template #' + id + ' as Ractive is not running in a browser.' );
}
if ( isHashedId( id ) ) {
id = id.substring( 1 );
}
if ( !( template = document.getElementById( id ) ) ) {
if ( options && options.noThrow ) {
return;
}
throw new Error( 'Could not find template element with id #' + id );
}
// Do we want to turn this on?
/*
if ( template.tagName.toUpperCase() !== 'SCRIPT' )) {
if ( options && options.noThrow ) { return; }
throw new Error( 'Template element with id #' + id + ', must be a <script> element' );
}
*/
return template.innerHTML;
}
function isHashedId( id ) {
return id.charAt( 0 ) === '#';
}
function isParsed( template ) {
return !( typeof template === 'string' );
}
function getParseOptions( ractive ) {
// Could be Ractive or a Component
if ( ractive.defaults ) {
ractive = ractive.defaults;
}
return parseOptions.reduce( function( val, key ) {
val[ key ] = ractive[ key ];
return val;
}, {} );
}
return parser;
}( errors, isClient, parse, create, parseOptions );
/* config/options/template/template.js */
var template = function( parser, parse ) {
var templateConfig = {
name: 'template',
extend: function extend( Parent, proto, options ) {
var template;
// only assign if exists
if ( 'template' in options ) {
template = options.template;
if ( typeof template === 'function' ) {
proto.template = template;
} else {
proto.template = parseIfString( template, proto );
}
}
},
init: function init( Parent, ractive, options ) {
var template, fn;
// TODO because of prototypal inheritance, we might just be able to use
// ractive.template, and not bother passing through the Parent object.
// At present that breaks the test mocks' expectations
template = 'template' in options ? options.template : Parent.prototype.template;
if ( typeof template === 'function' ) {
fn = template;
template = getDynamicTemplate( ractive, fn );
ractive._config.template = {
fn: fn,
result: template
};
}
template = parseIfString( template, ractive );
// TODO the naming of this is confusing - ractive.template refers to [...],
// but Component.prototype.template refers to {v:1,t:[],p:[]}...
// it's unnecessary, because the developer never needs to access
// ractive.template
ractive.template = template.t;
if ( template.p ) {
extendPartials( ractive.partials, template.p );
}
},
reset: function( ractive ) {
var result = resetValue( ractive ),
parsed;
if ( result ) {
parsed = parseIfString( result, ractive );
ractive.template = parsed.t;
extendPartials( ractive.partials, parsed.p, true );
return true;
}
}
};
function resetValue( ractive ) {
var initial = ractive._config.template,
result;
// If this isn't a dynamic template, there's nothing to do
if ( !initial || !initial.fn ) {
return;
}
result = getDynamicTemplate( ractive, initial.fn );
// TODO deep equality check to prevent unnecessary re-rendering
// in the case of already-parsed templates
if ( result !== initial.result ) {
initial.result = result;
result = parseIfString( result, ractive );
return result;
}
}
function getDynamicTemplate( ractive, fn ) {
var helper = parser.createHelper( parser.getParseOptions( ractive ) );
return fn.call( ractive, ractive.data, helper );
}
function parseIfString( template, ractive ) {
if ( typeof template === 'string' ) {
// ID of an element containing the template?
if ( template[ 0 ] === '#' ) {
template = parser.fromId( template );
}
template = parse( template, parser.getParseOptions( ractive ) );
} else if ( template.v !== 1 ) {
throw new Error( 'Mismatched template version! Please ensure you are using the latest version of Ractive.js in your build process as well as in your app' );
}
return template;
}
function extendPartials( existingPartials, newPartials, overwrite ) {
if ( !newPartials )
return;
// TODO there's an ambiguity here - we need to overwrite in the `reset()`
// case, but not initially...
for ( var key in newPartials ) {
if ( overwrite || !existingPartials.hasOwnProperty( key ) ) {
existingPartials[ key ] = newPartials[ key ];
}
}
}
return templateConfig;
}( parser, parse );
/* config/options/Registry.js */
var Registry = function( create ) {
function Registry( name, useDefaults ) {
this.name = name;
this.useDefaults = useDefaults;
}
Registry.prototype = {
constructor: Registry,
extend: function( Parent, proto, options ) {
this.configure( this.useDefaults ? Parent.defaults : Parent, this.useDefaults ? proto : proto.constructor, options );
},
init: function( Parent, ractive, options ) {
this.configure( this.useDefaults ? Parent.defaults : Parent, ractive, options );
},
configure: function( Parent, target, options ) {
var name = this.name,
option = options[ name ],
registry;
registry = create( Parent[ name ] );
for ( var key in option ) {
registry[ key ] = option[ key ];
}
target[ name ] = registry;
},
reset: function( ractive ) {
var registry = ractive[ this.name ];
var changed = false;
Object.keys( registry ).forEach( function( key ) {
var item = registry[ key ];
if ( item._fn ) {
if ( item._fn.isOwner ) {
registry[ key ] = item._fn;
} else {
delete registry[ key ];
}
changed = true;
}
} );
return changed;
},
findOwner: function( ractive, key ) {
return ractive[ this.name ].hasOwnProperty( key ) ? ractive : this.findConstructor( ractive.constructor, key );
},
findConstructor: function( constructor, key ) {
if ( !constructor ) {
return;
}
return constructor[ this.name ].hasOwnProperty( key ) ? constructor : this.findConstructor( constructor._parent, key );
},
find: function( ractive, key ) {
var this$0 = this;
return recurseFind( ractive, function( r ) {
return r[ this$0.name ][ key ];
} );
},
findInstance: function( ractive, key ) {
var this$0 = this;
return recurseFind( ractive, function( r ) {
return r[ this$0.name ][ key ] ? r : void 0;
} );
}
};
function recurseFind( ractive, fn ) {
var find, parent;
if ( find = fn( ractive ) ) {
return find;
}
if ( !ractive.isolated && ( parent = ractive._parent ) ) {
return recurseFind( parent, fn );
}
}
return Registry;
}( create, legacy );
/* config/options/groups/registries.js */
var registries = function( optionGroup, Registry ) {
var keys = [
'adaptors',
'components',
'computed',
'decorators',
'easing',
'events',
'interpolators',
'partials',
'transitions'
],
registries = optionGroup( keys, function( key ) {
return new Registry( key, key === 'computed' );
} );
return registries;
}( optionGroup, Registry );
/* utils/noop.js */
var noop = function() {};
/* utils/wrapPrototypeMethod.js */
var wrapPrototypeMethod = function( noop ) {
return function wrap( parent, name, method ) {
if ( !/_super/.test( method ) ) {
return method;
}
var wrapper = function wrapSuper() {
var superMethod = getSuperMethod( wrapper._parent, name ),
hasSuper = '_super' in this,
oldSuper = this._super,
result;
this._super = superMethod;
result = method.apply( this, arguments );
if ( hasSuper ) {
this._super = oldSuper;
} else {
delete this._super;
}
return result;
};
wrapper._parent = parent;
wrapper._method = method;
return wrapper;
};
function getSuperMethod( parent, name ) {
var method;
if ( name in parent ) {
var value = parent[ name ];
if ( typeof value === 'function' ) {
method = value;
} else {
method = function returnValue() {
return value;
};
}
} else {
method = noop;
}
return method;
}
}( noop );
/* config/deprecate.js */
var deprecate = function( warn, isArray ) {
function deprecate( options, deprecated, correct ) {
if ( deprecated in options ) {
if ( !( correct in options ) ) {
warn( getMessage( deprecated, correct ) );
options[ correct ] = options[ deprecated ];
} else {
throw new Error( getMessage( deprecated, correct, true ) );
}
}
}
function getMessage( deprecated, correct, isError ) {
return 'options.' + deprecated + ' has been deprecated in favour of options.' + correct + '.' + ( isError ? ' You cannot specify both options, please use options.' + correct + '.' : '' );
}
function deprecateEventDefinitions( options ) {
deprecate( options, 'eventDefinitions', 'events' );
}
function deprecateAdaptors( options ) {
// Using extend with Component instead of options,
// like Human.extend( Spider ) means adaptors as a registry
// gets copied to options. So we have to check if actually an array
if ( isArray( options.adaptors ) ) {
deprecate( options, 'adaptors', 'adapt' );
}
}
return function deprecateOptions( options ) {
deprecateEventDefinitions( options );
deprecateAdaptors( options );
};
}( warn, isArray );
/* config/config.js */
var config = function( css, data, defaults, template, parseOptions, registries, wrap, deprecate ) {
var custom, options, config;
custom = {
data: data,
template: template,
css: css
};
options = Object.keys( defaults ).filter( function( key ) {
return !registries[ key ] && !custom[ key ] && !parseOptions[ key ];
} );
// this defines the order:
config = [].concat( custom.data, parseOptions, options, registries, custom.template, custom.css );
for ( var key in custom ) {
config[ key ] = custom[ key ];
}
// for iteration
config.keys = Object.keys( defaults ).concat( registries.map( function( r ) {
return r.name;
} ) ).concat( [ 'css' ] );
config.parseOptions = parseOptions;
config.registries = registries;
function customConfig( method, key, Parent, instance, options ) {
custom[ key ][ method ]( Parent, instance, options );
}
config.extend = function( Parent, proto, options ) {
configure( 'extend', Parent, proto, options );
};
config.init = function( Parent, ractive, options ) {
configure( 'init', Parent, ractive, options );
if ( ractive._config ) {
ractive._config.options = options;
}
};
function configure( method, Parent, instance, options ) {
deprecate( options );
customConfig( method, 'data', Parent, instance, options );
config.parseOptions.forEach( function( key ) {
if ( key in options ) {
instance[ key ] = options[ key ];
}
} );
for ( var key in options ) {
if ( key in defaults && !( key in config.parseOptions ) && !( key in custom ) ) {
var value = options[ key ];
instance[ key ] = typeof value === 'function' ? wrap( Parent.prototype, key, value ) : value;
}
}
config.registries.forEach( function( registry ) {
registry[ method ]( Parent, instance, options );
} );
customConfig( method, 'template', Parent, instance, options );
customConfig( method, 'css', Parent, instance, options );
}
config.reset = function( ractive ) {
return config.filter( function( c ) {
return c.reset && c.reset( ractive );
} ).map( function( c ) {
return c.name;
} );
};
return config;
}( css, data, options, template, parseOptions, registries, wrapPrototypeMethod, deprecate );
/* shared/interpolate.js */
var interpolate = function( circular, warn, interpolators, config ) {
var interpolate = function( from, to, ractive, type ) {
if ( from === to ) {
return snap( to );
}
if ( type ) {
var interpol = config.registries.interpolators.find( ractive, type );
if ( interpol ) {
return interpol( from, to ) || snap( to );
}
warn( 'Missing "' + type + '" interpolator. You may need to download a plugin from [TODO]' );
}
return interpolators.number( from, to ) || interpolators.array( from, to ) || interpolators.object( from, to ) || interpolators.cssLength( from, to ) || snap( to );
};
circular.interpolate = interpolate;
return interpolate;
function snap( to ) {
return function() {
return to;
};
}
}( circular, warn, interpolators, config );
/* Ractive/prototype/animate/Animation.js */
var Ractive$animate_Animation = function( warn, runloop, interpolate ) {
var Animation = function( options ) {
var key;
this.startTime = Date.now();
// from and to
for ( key in options ) {
if ( options.hasOwnProperty( key ) ) {
this[ key ] = options[ key ];
}
}
this.interpolator = interpolate( this.from, this.to, this.root, this.interpolator );
this.running = true;
};
Animation.prototype = {
tick: function() {
var elapsed, t, value, timeNow, index, keypath;
keypath = this.keypath;
if ( this.running ) {
timeNow = Date.now();
elapsed = timeNow - this.startTime;
if ( elapsed >= this.duration ) {
if ( keypath !== null ) {
runloop.start( this.root );
this.root.viewmodel.set( keypath, this.to );
runloop.end();
}
if ( this.step ) {
this.step( 1, this.to );
}
this.complete( this.to );
index = this.root._animations.indexOf( this );
// TODO investigate why this happens
if ( index === -1 ) {
warn( 'Animation was not found' );
}
this.root._animations.splice( index, 1 );
this.running = false;
return false;
}
t = this.easing ? this.easing( elapsed / this.duration ) : elapsed / this.duration;
if ( keypath !== null ) {
value = this.interpolator( t );
runloop.start( this.root );
this.root.viewmodel.set( keypath, value );
runloop.end();
}
if ( this.step ) {
this.step( t, value );
}
return true;
}
return false;
},
stop: function() {
var index;
this.running = false;
index = this.root._animations.indexOf( this );
// TODO investigate why this happens
if ( index === -1 ) {
warn( 'Animation was not found' );
}
this.root._animations.splice( index, 1 );
}
};
return Animation;
}( warn, runloop, interpolate );
/* Ractive/prototype/animate.js */
var Ractive$animate = function( isEqual, Promise, normaliseKeypath, animations, Animation ) {
var noop = function() {},
noAnimation = {
stop: noop
};
return function Ractive$animate( keypath, to, options ) {
var promise, fulfilPromise, k, animation, animations, easing, duration, step, complete, makeValueCollector, currentValues, collectValue, dummy, dummyOptions;
promise = new Promise( function( fulfil ) {
fulfilPromise = fulfil;
} );
// animate multiple keypaths
if ( typeof keypath === 'object' ) {
options = to || {};
easing = options.easing;
duration = options.duration;
animations = [];
// we don't want to pass the `step` and `complete` handlers, as they will
// run for each animation! So instead we'll store the handlers and create
// our own...
step = options.step;
complete = options.complete;
if ( step || complete ) {
currentValues = {};
options.step = null;
options.complete = null;
makeValueCollector = function( keypath ) {
return function( t, value ) {
currentValues[ keypath ] = value;
};
};
}
for ( k in keypath ) {
if ( keypath.hasOwnProperty( k ) ) {
if ( step || complete ) {
collectValue = makeValueCollector( k );
options = {
easing: easing,
duration: duration
};
if ( step ) {
options.step = collectValue;
}
}
options.complete = complete ? collectValue : noop;
animations.push( animate( this, k, keypath[ k ], options ) );
}
}
if ( step || complete ) {
dummyOptions = {
easing: easing,
duration: duration
};
if ( step ) {
dummyOptions.step = function( t ) {
step( t, currentValues );
};
}
if ( complete ) {
promise.then( function( t ) {
complete( t, currentValues );
} );
}
dummyOptions.complete = fulfilPromise;
dummy = animate( this, null, null, dummyOptions );
animations.push( dummy );
}
return {
stop: function() {
var animation;
while ( animation = animations.pop() ) {
animation.stop();
}
if ( dummy ) {
dummy.stop();
}
}
};
}
// animate a single keypath
options = options || {};
if ( options.complete ) {
promise.then( options.complete );
}
options.complete = fulfilPromise;
animation = animate( this, keypath, to, options );
promise.stop = function() {
animation.stop();
};
return promise;
};
function animate( root, keypath, to, options ) {
var easing, duration, animation, from;
if ( keypath ) {
keypath = normaliseKeypath( keypath );
}
if ( keypath !== null ) {
from = root.viewmodel.get( keypath );
}
// cancel any existing animation
// TODO what about upstream/downstream keypaths?
animations.abort( keypath, root );
// don't bother animating values that stay the same
if ( isEqual( from, to ) ) {
if ( options.complete ) {
options.complete( options.to );
}
return noAnimation;
}
// easing function
if ( options.easing ) {
if ( typeof options.easing === 'function' ) {
easing = options.easing;
} else {
easing = root.easing[ options.easing ];
}
if ( typeof easing !== 'function' ) {
easing = null;
}
}
// duration
duration = options.duration === undefined ? 400 : options.duration;
// TODO store keys, use an internal set method
animation = new Animation( {
keypath: keypath,
from: from,
to: to,
root: root,
duration: duration,
easing: easing,
interpolator: options.interpolator,
// TODO wrap callbacks if necessary, to use instance as context
step: options.step,
complete: options.complete
} );
animations.add( animation );
root._animations.push( animation );
return animation;
}
}( isEqual, Promise, normaliseKeypath, animations, Ractive$animate_Animation );
/* Ractive/prototype/detach.js */
var Ractive$detach = function( removeFromArray ) {
return function Ractive$detach() {
if ( this.el ) {
removeFromArray( this.el.__ractive_instances__, this );
}
return this.fragment.detach();
};
}( removeFromArray );
/* Ractive/prototype/find.js */
var Ractive$find = function Ractive$find( selector ) {
if ( !this.el ) {
return null;
}
return this.fragment.find( selector );
};
/* utils/matches.js */
var matches = function( isClient, vendors, createElement ) {
var matches, div, methodNames, unprefixed, prefixed, i, j, makeFunction;
if ( !isClient ) {
matches = null;
} else {
div = createElement( 'div' );
methodNames = [
'matches',
'matchesSelector'
];
makeFunction = function( methodName ) {
return function( node, selector ) {
return node[ methodName ]( selector );
};
};
i = methodNames.length;
while ( i-- && !matches ) {
unprefixed = methodNames[ i ];
if ( div[ unprefixed ] ) {
matches = makeFunction( unprefixed );
} else {
j = vendors.length;
while ( j-- ) {
prefixed = vendors[ i ] + unprefixed.substr( 0, 1 ).toUpperCase() + unprefixed.substring( 1 );
if ( div[ prefixed ] ) {
matches = makeFunction( prefixed );
break;
}
}
}
}
// IE8...
if ( !matches ) {
matches = function( node, selector ) {
var nodes, parentNode, i;
parentNode = node.parentNode;
if ( !parentNode ) {
// empty dummy <div>
div.innerHTML = '';
parentNode = div;
node = node.cloneNode();
div.appendChild( node );
}
nodes = parentNode.querySelectorAll( selector );
i = nodes.length;
while ( i-- ) {
if ( nodes[ i ] === node ) {
return true;
}
}
return false;
};
}
}
return matches;
}( isClient, vendors, createElement );
/* Ractive/prototype/shared/makeQuery/test.js */
var Ractive$shared_makeQuery_test = function( matches ) {
return function( item, noDirty ) {
var itemMatches = this._isComponentQuery ? !this.selector || item.name === this.selector : matches( item.node, this.selector );
if ( itemMatches ) {
this.push( item.node || item.instance );
if ( !noDirty ) {
this._makeDirty();
}
return true;
}
};
}( matches );
/* Ractive/prototype/shared/makeQuery/cancel.js */
var Ractive$shared_makeQuery_cancel = function() {
var liveQueries, selector, index;
liveQueries = this._root[ this._isComponentQuery ? 'liveComponentQueries' : 'liveQueries' ];
selector = this.selector;
index = liveQueries.indexOf( selector );
if ( index !== -1 ) {
liveQueries.splice( index, 1 );
liveQueries[ selector ] = null;
}
};
/* Ractive/prototype/shared/makeQuery/sortByItemPosition.js */
var Ractive$shared_makeQuery_sortByItemPosition = function() {
return function( a, b ) {
var ancestryA, ancestryB, oldestA, oldestB, mutualAncestor, indexA, indexB, fragments, fragmentA, fragmentB;
ancestryA = getAncestry( a.component || a._ractive.proxy );
ancestryB = getAncestry( b.component || b._ractive.proxy );
oldestA = ancestryA[ ancestryA.length - 1 ];
oldestB = ancestryB[ ancestryB.length - 1 ];
// remove items from the end of both ancestries as long as they are identical
// - the final one removed is the closest mutual ancestor
while ( oldestA && oldestA === oldestB ) {
ancestryA.pop();
ancestryB.pop();
mutualAncestor = oldestA;
oldestA = ancestryA[ ancestryA.length - 1 ];
oldestB = ancestryB[ ancestryB.length - 1 ];
}
// now that we have the mutual ancestor, we can find which is earliest
oldestA = oldestA.component || oldestA;
oldestB = oldestB.component || oldestB;
fragmentA = oldestA.parentFragment;
fragmentB = oldestB.parentFragment;
// if both items share a parent fragment, our job is easy
if ( fragmentA === fragmentB ) {
indexA = fragmentA.items.indexOf( oldestA );
indexB = fragmentB.items.indexOf( oldestB );
// if it's the same index, it means one contains the other,
// so we see which has the longest ancestry
return indexA - indexB || ancestryA.length - ancestryB.length;
}
// if mutual ancestor is a section, we first test to see which section
// fragment comes first
if ( fragments = mutualAncestor.fragments ) {
indexA = fragments.indexOf( fragmentA );
indexB = fragments.indexOf( fragmentB );
return indexA - indexB || ancestryA.length - ancestryB.length;
}
throw new Error( 'An unexpected condition was met while comparing the position of two components. Please file an issue at https://github.com/RactiveJS/Ractive/issues - thanks!' );
};
function getParent( item ) {
var parentFragment;
if ( parentFragment = item.parentFragment ) {
return parentFragment.owner;
}
if ( item.component && ( parentFragment = item.component.parentFragment ) ) {
return parentFragment.owner;
}
}
function getAncestry( item ) {
var ancestry, ancestor;
ancestry = [ item ];
ancestor = getParent( item );
while ( ancestor ) {
ancestry.push( ancestor );
ancestor = getParent( ancestor );
}
return ancestry;
}
}();
/* Ractive/prototype/shared/makeQuery/sortByDocumentPosition.js */
var Ractive$shared_makeQuery_sortByDocumentPosition = function( sortByItemPosition ) {
return function( node, otherNode ) {
var bitmask;
if ( node.compareDocumentPosition ) {
bitmask = node.compareDocumentPosition( otherNode );
return bitmask & 2 ? 1 : -1;
}
// In old IE, we can piggy back on the mechanism for
// comparing component positions
return sortByItemPosition( node, otherNode );
};
}( Ractive$shared_makeQuery_sortByItemPosition );
/* Ractive/prototype/shared/makeQuery/sort.js */
var Ractive$shared_makeQuery_sort = function( sortByDocumentPosition, sortByItemPosition ) {
return function() {
this.sort( this._isComponentQuery ? sortByItemPosition : sortByDocumentPosition );
this._dirty = false;
};
}( Ractive$shared_makeQuery_sortByDocumentPosition, Ractive$shared_makeQuery_sortByItemPosition );
/* Ractive/prototype/shared/makeQuery/dirty.js */
var Ractive$shared_makeQuery_dirty = function( runloop ) {
return function() {
var this$0 = this;
if ( !this._dirty ) {
this._dirty = true;
// Once the DOM has been updated, ensure the query
// is correctly ordered
runloop.scheduleTask( function() {
this$0._sort();
} );
}
};
}( runloop );
/* Ractive/prototype/shared/makeQuery/remove.js */
var Ractive$shared_makeQuery_remove = function( nodeOrComponent ) {
var index = this.indexOf( this._isComponentQuery ? nodeOrComponent.instance : nodeOrComponent );
if ( index !== -1 ) {
this.splice( index, 1 );
}
};
/* Ractive/prototype/shared/makeQuery/_makeQuery.js */
var Ractive$shared_makeQuery__makeQuery = function( defineProperties, test, cancel, sort, dirty, remove ) {
return function makeQuery( ractive, selector, live, isComponentQuery ) {
var query = [];
defineProperties( query, {
selector: {
value: selector
},
live: {
value: live
},
_isComponentQuery: {
value: isComponentQuery
},
_test: {
value: test
}
} );
if ( !live ) {
return query;
}
defineProperties( query, {
cancel: {
value: cancel
},
_root: {
value: ractive
},
_sort: {
value: sort
},
_makeDirty: {
value: dirty
},
_remove: {
value: remove
},
_dirty: {
value: false,
writable: true
}
} );
return query;
};
}( defineProperties, Ractive$shared_makeQuery_test, Ractive$shared_makeQuery_cancel, Ractive$shared_makeQuery_sort, Ractive$shared_makeQuery_dirty, Ractive$shared_makeQuery_remove );
/* Ractive/prototype/findAll.js */
var Ractive$findAll = function( makeQuery ) {
return function Ractive$findAll( selector, options ) {
var liveQueries, query;
if ( !this.el ) {
return [];
}
options = options || {};
liveQueries = this._liveQueries;
// Shortcut: if we're maintaining a live query with this
// selector, we don't need to traverse the parallel DOM
if ( query = liveQueries[ selector ] ) {
// Either return the exact same query, or (if not live) a snapshot
return options && options.live ? query : query.slice();
}
query = makeQuery( this, selector, !!options.live, false );
// Add this to the list of live queries Ractive needs to maintain,
// if applicable
if ( query.live ) {
liveQueries.push( selector );
liveQueries[ '_' + selector ] = query;
}
this.fragment.findAll( selector, query );
return query;
};
}( Ractive$shared_makeQuery__makeQuery );
/* Ractive/prototype/findAllComponents.js */
var Ractive$findAllComponents = function( makeQuery ) {
return function Ractive$findAllComponents( selector, options ) {
var liveQueries, query;
options = options || {};
liveQueries = this._liveComponentQueries;
// Shortcut: if we're maintaining a live query with this
// selector, we don't need to traverse the parallel DOM
if ( query = liveQueries[ selector ] ) {
// Either return the exact same query, or (if not live) a snapshot
return options && options.live ? query : query.slice();
}
query = makeQuery( this, selector, !!options.live, true );
// Add this to the list of live queries Ractive needs to maintain,
// if applicable
if ( query.live ) {
liveQueries.push( selector );
liveQueries[ '_' + selector ] = query;
}
this.fragment.findAllComponents( selector, query );
return query;
};
}( Ractive$shared_makeQuery__makeQuery );
/* Ractive/prototype/findComponent.js */
var Ractive$findComponent = function Ractive$findComponent( selector ) {
return this.fragment.findComponent( selector );
};
/* Ractive/prototype/fire.js */
var Ractive$fire = function Ractive$fire( eventName ) {
var args, i, len, subscribers = this._subs[ eventName ];
if ( !subscribers ) {
return;
}
args = Array.prototype.slice.call( arguments, 1 );
for ( i = 0, len = subscribers.length; i < len; i += 1 ) {
subscribers[ i ].apply( this, args );
}
};
/* Ractive/prototype/get.js */
var Ractive$get = function( normaliseKeypath ) {
var options = {
capture: true
};
// top-level calls should be intercepted
return function Ractive$get( keypath ) {
keypath = normaliseKeypath( keypath );
return this.viewmodel.get( keypath, options );
};
}( normaliseKeypath );
/* utils/getElement.js */
var getElement = function getElement( input ) {
var output;
if ( !input || typeof input === 'boolean' ) {
return;
}
if ( typeof window === 'undefined' || !document || !input ) {
return null;
}
// We already have a DOM node - no work to do. (Duck typing alert!)
if ( input.nodeType ) {
return input;
}
// Get node from string
if ( typeof input === 'string' ) {
// try ID first
output = document.getElementById( input );
// then as selector, if possible
if ( !output && document.querySelector ) {
output = document.querySelector( input );
}
// did it work?
if ( output && output.nodeType ) {
return output;
}
}
// If we've been given a collection (jQuery, Zepto etc), extract the first item
if ( input[ 0 ] && input[ 0 ].nodeType ) {
return input[ 0 ];
}
return null;
};
/* Ractive/prototype/insert.js */
var Ractive$insert = function( getElement ) {
return function Ractive$insert( target, anchor ) {
if ( !this.rendered ) {
// TODO create, and link to, documentation explaining this
throw new Error( 'The API has changed - you must call `ractive.render(target[, anchor])` to render your Ractive instance. Once rendered you can use `ractive.insert()`.' );
}
target = getElement( target );
anchor = getElement( anchor ) || null;
if ( !target ) {
throw new Error( 'You must specify a valid target to insert into' );
}
target.insertBefore( this.detach(), anchor );
this.el = target;
( target.__ractive_instances__ || ( target.__ractive_instances__ = [] ) ).push( this );
};
}( getElement );
/* Ractive/prototype/merge.js */
var Ractive$merge = function( runloop, isArray, normaliseKeypath ) {
return function Ractive$merge( keypath, array, options ) {
var currentArray, promise;
keypath = normaliseKeypath( keypath );
currentArray = this.viewmodel.get( keypath );
// If either the existing value or the new value isn't an
// array, just do a regular set
if ( !isArray( currentArray ) || !isArray( array ) ) {
return this.set( keypath, array, options && options.complete );
}
// Manage transitions
promise = runloop.start( this, true );
this.viewmodel.merge( keypath, currentArray, array, options );
runloop.end();
// attach callback as fulfilment handler, if specified
if ( options && options.complete ) {
promise.then( options.complete );
}
return promise;
};
}( runloop, isArray, normaliseKeypath );
/* Ractive/prototype/observe/Observer.js */
var Ractive$observe_Observer = function( runloop, isEqual ) {
var Observer = function( ractive, keypath, callback, options ) {
this.root = ractive;
this.keypath = keypath;
this.callback = callback;
this.defer = options.defer;
// Observers are notified before any DOM changes take place (though
// they can defer execution until afterwards)
this.priority = 0;
// default to root as context, but allow it to be overridden
this.context = options && options.context ? options.context : ractive;
};
Observer.prototype = {
init: function( immediate ) {
this.value = this.root.viewmodel.get( this.keypath );
if ( immediate !== false ) {
this.update();
}
},
setValue: function( value ) {
var this$0 = this;
if ( !isEqual( value, this.value ) ) {
this.value = value;
if ( this.defer && this.ready ) {
runloop.scheduleTask( function() {
return this$0.update();
} );
} else {
this.update();
}
}
},
update: function() {
// Prevent infinite loops
if ( this.updating ) {
return;
}
this.updating = true;
this.callback.call( this.context, this.value, this.oldValue, this.keypath );
this.oldValue = this.value;
this.updating = false;
}
};
return Observer;
}( runloop, isEqual );
/* shared/getMatchingKeypaths.js */
var getMatchingKeypaths = function( isArray ) {
return function getMatchingKeypaths( ractive, pattern ) {
var keys, key, matchingKeypaths;
keys = pattern.split( '.' );
matchingKeypaths = [ '' ];
while ( key = keys.shift() ) {
if ( key === '*' ) {
// expand to find all valid child keypaths
matchingKeypaths = matchingKeypaths.reduce( expand, [] );
} else {
if ( matchingKeypaths[ 0 ] === '' ) {
// first key
matchingKeypaths[ 0 ] = key;
} else {
matchingKeypaths = matchingKeypaths.map( concatenate( key ) );
}
}
}
return matchingKeypaths;
function expand( matchingKeypaths, keypath ) {
var value, key, childKeypath;
value = ractive.viewmodel.wrapped[ keypath ] ? ractive.viewmodel.wrapped[ keypath ].get() : ractive.get( keypath );
for ( key in value ) {
if ( value.hasOwnProperty( key ) && ( key !== '_ractive' || !isArray( value ) ) ) {
// for benefit of IE8
childKeypath = keypath ? keypath + '.' + key : key;
matchingKeypaths.push( childKeypath );
}
}
return matchingKeypaths;
}
function concatenate( key ) {
return function( keypath ) {
return keypath ? keypath + '.' + key : key;
};
}
};
}( isArray );
/* Ractive/prototype/observe/getPattern.js */
var Ractive$observe_getPattern = function( getMatchingKeypaths ) {
return function getPattern( ractive, pattern ) {
var matchingKeypaths, values;
matchingKeypaths = getMatchingKeypaths( ractive, pattern );
values = {};
matchingKeypaths.forEach( function( keypath ) {
values[ keypath ] = ractive.get( keypath );
} );
return values;
};
}( getMatchingKeypaths );
/* Ractive/prototype/observe/PatternObserver.js */
var Ractive$observe_PatternObserver = function( runloop, isEqual, getPattern ) {
var PatternObserver, wildcard = /\*/,
slice = Array.prototype.slice;
PatternObserver = function( ractive, keypath, callback, options ) {
this.root = ractive;
this.callback = callback;
this.defer = options.defer;
this.keypath = keypath;
this.regex = new RegExp( '^' + keypath.replace( /\./g, '\\.' ).replace( /\*/g, '([^\\.]+)' ) + '$' );
this.values = {};
if ( this.defer ) {
this.proxies = [];
}
// Observers are notified before any DOM changes take place (though
// they can defer execution until afterwards)
this.priority = 'pattern';
// default to root as context, but allow it to be overridden
this.context = options && options.context ? options.context : ractive;
};
PatternObserver.prototype = {
init: function( immediate ) {
var values, keypath;
values = getPattern( this.root, this.keypath );
if ( immediate !== false ) {
for ( keypath in values ) {
if ( values.hasOwnProperty( keypath ) ) {
this.update( keypath );
}
}
} else {
this.values = values;
}
},
update: function( keypath ) {
var values;
if ( wildcard.test( keypath ) ) {
values = getPattern( this.root, keypath );
for ( keypath in values ) {
if ( values.hasOwnProperty( keypath ) ) {
this.update( keypath );
}
}
return;
}
// special case - array mutation should not trigger `array.*`
// pattern observer with `array.length`
if ( this.root.viewmodel.implicitChanges[ keypath ] ) {
return;
}
if ( this.defer && this.ready ) {
runloop.addObserver( this.getProxy( keypath ) );
return;
}
this.reallyUpdate( keypath );
},
reallyUpdate: function( keypath ) {
var value, keys, args;
value = this.root.viewmodel.get( keypath );
// Prevent infinite loops
if ( this.updating ) {
this.values[ keypath ] = value;
return;
}
this.updating = true;
if ( !isEqual( value, this.values[ keypath ] ) || !this.ready ) {
keys = slice.call( this.regex.exec( keypath ), 1 );
args = [
value,
this.values[ keypath ],
keypath
].concat( keys );
this.callback.apply( this.context, args );
this.values[ keypath ] = value;
}
this.updating = false;
},
getProxy: function( keypath ) {
var self = this;
if ( !this.proxies[ keypath ] ) {
this.proxies[ keypath ] = {
update: function() {
self.reallyUpdate( keypath );
}
};
}
return this.proxies[ keypath ];
}
};
return PatternObserver;
}( runloop, isEqual, Ractive$observe_getPattern );
/* Ractive/prototype/observe/getObserverFacade.js */
var Ractive$observe_getObserverFacade = function( normaliseKeypath, Observer, PatternObserver ) {
var wildcard = /\*/,
emptyObject = {};
return function getObserverFacade( ractive, keypath, callback, options ) {
var observer, isPatternObserver, cancelled;
keypath = normaliseKeypath( keypath );
options = options || emptyObject;
// pattern observers are treated differently
if ( wildcard.test( keypath ) ) {
observer = new PatternObserver( ractive, keypath, callback, options );
ractive.viewmodel.patternObservers.push( observer );
isPatternObserver = true;
} else {
observer = new Observer( ractive, keypath, callback, options );
}
ractive.viewmodel.register( keypath, observer, isPatternObserver ? 'patternObservers' : 'observers' );
observer.init( options.init );
// This flag allows observers to initialise even with undefined values
observer.ready = true;
return {
cancel: function() {
var index;
if ( cancelled ) {
return;
}
if ( isPatternObserver ) {
index = ractive.viewmodel.patternObservers.indexOf( observer );
ractive.viewmodel.patternObservers.splice( index, 1 );
ractive.viewmodel.unregister( keypath, observer, 'patternObservers' );
}
ractive.viewmodel.unregister( keypath, observer, 'observers' );
cancelled = true;
}
};
};
}( normaliseKeypath, Ractive$observe_Observer, Ractive$observe_PatternObserver );
/* Ractive/prototype/observe.js */
var Ractive$observe = function( isObject, getObserverFacade ) {
return function Ractive$observe( keypath, callback, options ) {
var observers, map, keypaths, i;
// Allow a map of keypaths to handlers
if ( isObject( keypath ) ) {
options = callback;
map = keypath;
observers = [];
for ( keypath in map ) {
if ( map.hasOwnProperty( keypath ) ) {
callback = map[ keypath ];
observers.push( this.observe( keypath, callback, options ) );
}
}
return {
cancel: function() {
while ( observers.length ) {
observers.pop().cancel();
}
}
};
}
// Allow `ractive.observe( callback )` - i.e. observe entire model
if ( typeof keypath === 'function' ) {
options = callback;
callback = keypath;
keypath = '';
return getObserverFacade( this, keypath, callback, options );
}
keypaths = keypath.split( ' ' );
// Single keypath
if ( keypaths.length === 1 ) {
return getObserverFacade( this, keypath, callback, options );
}
// Multiple space-separated keypaths
observers = [];
i = keypaths.length;
while ( i-- ) {
keypath = keypaths[ i ];
if ( keypath ) {
observers.push( getObserverFacade( this, keypath, callback, options ) );
}
}
return {
cancel: function() {
while ( observers.length ) {
observers.pop().cancel();
}
}
};
};
}( isObject, Ractive$observe_getObserverFacade );
/* Ractive/prototype/shared/trim.js */
var Ractive$shared_trim = function( str ) {
return str.trim();
};
/* Ractive/prototype/shared/notEmptyString.js */
var Ractive$shared_notEmptyString = function( str ) {
return str !== '';
};
/* Ractive/prototype/off.js */
var Ractive$off = function( trim, notEmptyString ) {
return function Ractive$off( eventName, callback ) {
var this$0 = this;
var eventNames;
// if no arguments specified, remove all callbacks
if ( !eventName ) {
// TODO use this code instead, once the following issue has been resolved
// in PhantomJS (tests are unpassable otherwise!)
// https://github.com/ariya/phantomjs/issues/11856
// defineProperty( this, '_subs', { value: create( null ), configurable: true });
for ( eventName in this._subs ) {
delete this._subs[ eventName ];
}
} else {
// Handle multiple space-separated event names
eventNames = eventName.split( ' ' ).map( trim ).filter( notEmptyString );
eventNames.forEach( function( eventName ) {
var subscribers, index;
// If we have subscribers for this event...
if ( subscribers = this$0._subs[ eventName ] ) {
// ...if a callback was specified, only remove that
if ( callback ) {
index = subscribers.indexOf( callback );
if ( index !== -1 ) {
subscribers.splice( index, 1 );
}
} else {
this$0._subs[ eventName ] = [];
}
}
} );
}
return this;
};
}( Ractive$shared_trim, Ractive$shared_notEmptyString );
/* Ractive/prototype/on.js */
var Ractive$on = function( trim, notEmptyString ) {
return function Ractive$on( eventName, callback ) {
var this$0 = this;
var self = this,
listeners, n, eventNames;
// allow mutliple listeners to be bound in one go
if ( typeof eventName === 'object' ) {
listeners = [];
for ( n in eventName ) {
if ( eventName.hasOwnProperty( n ) ) {
listeners.push( this.on( n, eventName[ n ] ) );
}
}
return {
cancel: function() {
var listener;
while ( listener = listeners.pop() ) {
listener.cancel();
}
}
};
}
// Handle multiple space-separated event names
eventNames = eventName.split( ' ' ).map( trim ).filter( notEmptyString );
eventNames.forEach( function( eventName ) {
( this$0._subs[ eventName ] || ( this$0._subs[ eventName ] = [] ) ).push( callback );
} );
return {
cancel: function() {
self.off( eventName, callback );
}
};
};
}( Ractive$shared_trim, Ractive$shared_notEmptyString );
/* shared/getSpliceEquivalent.js */
var getSpliceEquivalent = function( array, methodName, args ) {
switch ( methodName ) {
case 'splice':
return args;
case 'sort':
case 'reverse':
return null;
case 'pop':
if ( array.length ) {
return [ -1 ];
}
return null;
case 'push':
return [
array.length,
0
].concat( args );
case 'shift':
return [
0,
1
];
case 'unshift':
return [
0,
0
].concat( args );
}
};
/* shared/summariseSpliceOperation.js */
var summariseSpliceOperation = function( array, args ) {
var rangeStart, rangeEnd, newLength, addedItems, removedItems, balance;
if ( !args ) {
return null;
}
// figure out where the changes started...
rangeStart = +( args[ 0 ] < 0 ? array.length + args[ 0 ] : args[ 0 ] );
// ...and how many items were added to or removed from the array
addedItems = Math.max( 0, args.length - 2 );
removedItems = args[ 1 ] !== undefined ? args[ 1 ] : array.length - rangeStart;
// It's possible to do e.g. [ 1, 2, 3 ].splice( 2, 2 ) - i.e. the second argument
// means removing more items from the end of the array than there are. In these
// cases we need to curb JavaScript's enthusiasm or we'll get out of sync
removedItems = Math.min( removedItems, array.length - rangeStart );
balance = addedItems - removedItems;
newLength = array.length + balance;
// We need to find the end of the range affected by the splice
if ( !balance ) {
rangeEnd = rangeStart + addedItems;
} else {
rangeEnd = Math.max( array.length, newLength );
}
return {
rangeStart: rangeStart,
rangeEnd: rangeEnd,
balance: balance,
added: addedItems,
removed: removedItems
};
};
/* Ractive/prototype/shared/makeArrayMethod.js */
var Ractive$shared_makeArrayMethod = function( isArray, runloop, getSpliceEquivalent, summariseSpliceOperation ) {
var arrayProto = Array.prototype;
return function( methodName ) {
return function( keypath ) {
var SLICE$0 = Array.prototype.slice;
var args = SLICE$0.call( arguments, 1 );
var array, spliceEquivalent, spliceSummary, promise;
array = this.get( keypath );
if ( !isArray( array ) ) {
throw new Error( 'Called ractive.' + methodName + '(\'' + keypath + '\'), but \'' + keypath + '\' does not refer to an array' );
}
spliceEquivalent = getSpliceEquivalent( array, methodName, args );
spliceSummary = summariseSpliceOperation( array, spliceEquivalent );
arrayProto[ methodName ].apply( array, args );
promise = runloop.start( this, true );
if ( spliceSummary ) {
this.viewmodel.splice( keypath, spliceSummary );
} else {
this.viewmodel.mark( keypath );
}
runloop.end();
return promise;
};
};
}( isArray, runloop, getSpliceEquivalent, summariseSpliceOperation );
/* Ractive/prototype/pop.js */
var Ractive$pop = function( makeArrayMethod ) {
return makeArrayMethod( 'pop' );
}( Ractive$shared_makeArrayMethod );
/* Ractive/prototype/push.js */
var Ractive$push = function( makeArrayMethod ) {
return makeArrayMethod( 'push' );
}( Ractive$shared_makeArrayMethod );
/* global/css.js */
var global_css = function( circular, isClient, removeFromArray ) {
var css, update, runloop, styleElement, head, styleSheet, inDom, prefix = '/* Ractive.js component styles */\n',
componentsInPage = {},
styles = [];
if ( !isClient ) {
css = null;
} else {
circular.push( function() {
runloop = circular.runloop;
} );
styleElement = document.createElement( 'style' );
styleElement.type = 'text/css';
head = document.getElementsByTagName( 'head' )[ 0 ];
inDom = false;
// Internet Exploder won't let you use styleSheet.innerHTML - we have to
// use styleSheet.cssText instead
styleSheet = styleElement.styleSheet;
update = function() {
var css;
if ( styles.length ) {
css = prefix + styles.join( ' ' );
if ( styleSheet ) {
styleSheet.cssText = css;
} else {
styleElement.innerHTML = css;
}
if ( !inDom ) {
head.appendChild( styleElement );
inDom = true;
}
} else if ( inDom ) {
head.removeChild( styleElement );
inDom = false;
}
};
css = {
add: function( Component ) {
if ( !Component.css ) {
return;
}
if ( !componentsInPage[ Component._guid ] ) {
// we create this counter so that we can in/decrement it as
// instances are added and removed. When all components are
// removed, the style is too
componentsInPage[ Component._guid ] = 0;
styles.push( Component.css );
runloop.scheduleTask( update );
}
componentsInPage[ Component._guid ] += 1;
},
remove: function( Component ) {
if ( !Component.css ) {
return;
}
componentsInPage[ Component._guid ] -= 1;
if ( !componentsInPage[ Component._guid ] ) {
removeFromArray( styles, Component.css );
runloop.scheduleTask( update );
}
}
};
}
return css;
}( circular, isClient, removeFromArray );
/* Ractive/prototype/render.js */
var Ractive$render = function( runloop, css, getElement ) {
var queues = {},
rendering = {};
return function Ractive$render( target, anchor ) {
var this$0 = this;
var promise, instances;
rendering[ this._guid ] = true;
promise = runloop.start( this, true );
if ( this.rendered ) {
throw new Error( 'You cannot call ractive.render() on an already rendered instance! Call ractive.unrender() first' );
}
target = getElement( target ) || this.el;
anchor = getElement( anchor ) || this.anchor;
this.el = target;
this.anchor = anchor;
// Add CSS, if applicable
if ( this.constructor.css ) {
css.add( this.constructor );
}
if ( target ) {
if ( !( instances = target.__ractive_instances__ ) ) {
target.__ractive_instances__ = [ this ];
} else {
instances.push( this );
}
if ( anchor ) {
target.insertBefore( this.fragment.render(), anchor );
} else {
target.appendChild( this.fragment.render() );
}
}
// Only init once, until we rework lifecycle events
if ( !this._hasInited ) {
this._hasInited = true;
// If this is *isn't* a child of a component that's in the process of rendering,
// it should call any `init()` methods at this point
if ( !this._parent || !rendering[ this._parent._guid ] ) {
init( this );
} else {
getChildInitQueue( this._parent ).push( this );
}
}
rendering[ this._guid ] = false;
runloop.end();
this.rendered = true;
if ( this.complete ) {
promise.then( function() {
return this$0.complete();
} );
}
return promise;
};
function init( instance ) {
if ( instance.init ) {
instance.init( instance._config.options );
}
getChildInitQueue( instance ).forEach( init );
queues[ instance._guid ] = null;
}
function getChildInitQueue( instance ) {
return queues[ instance._guid ] || ( queues[ instance._guid ] = [] );
}
}( runloop, global_css, getElement );
/* virtualdom/Fragment/prototype/bubble.js */
var virtualdom_Fragment$bubble = function Fragment$bubble() {
this.dirtyValue = this.dirtyArgs = true;
if ( this.inited && this.owner.bubble ) {
this.owner.bubble();
}
};
/* virtualdom/Fragment/prototype/detach.js */
var virtualdom_Fragment$detach = function Fragment$detach() {
var docFrag;
if ( this.items.length === 1 ) {
return this.items[ 0 ].detach();
}
docFrag = document.createDocumentFragment();
this.items.forEach( function( item ) {
docFrag.appendChild( item.detach() );
} );
return docFrag;
};
/* virtualdom/Fragment/prototype/find.js */
var virtualdom_Fragment$find = function Fragment$find( selector ) {
var i, len, item, queryResult;
if ( this.items ) {
len = this.items.length;
for ( i = 0; i < len; i += 1 ) {
item = this.items[ i ];
if ( item.find && ( queryResult = item.find( selector ) ) ) {
return queryResult;
}
}
return null;
}
};
/* virtualdom/Fragment/prototype/findAll.js */
var virtualdom_Fragment$findAll = function Fragment$findAll( selector, query ) {
var i, len, item;
if ( this.items ) {
len = this.items.length;
for ( i = 0; i < len; i += 1 ) {
item = this.items[ i ];
if ( item.findAll ) {
item.findAll( selector, query );
}
}
}
return query;
};
/* virtualdom/Fragment/prototype/findAllComponents.js */
var virtualdom_Fragment$findAllComponents = function Fragment$findAllComponents( selector, query ) {
var i, len, item;
if ( this.items ) {
len = this.items.length;
for ( i = 0; i < len; i += 1 ) {
item = this.items[ i ];
if ( item.findAllComponents ) {
item.findAllComponents( selector, query );
}
}
}
return query;
};
/* virtualdom/Fragment/prototype/findComponent.js */
var virtualdom_Fragment$findComponent = function Fragment$findComponent( selector ) {
var len, i, item, queryResult;
if ( this.items ) {
len = this.items.length;
for ( i = 0; i < len; i += 1 ) {
item = this.items[ i ];
if ( item.findComponent && ( queryResult = item.findComponent( selector ) ) ) {
return queryResult;
}
}
return null;
}
};
/* virtualdom/Fragment/prototype/findNextNode.js */
var virtualdom_Fragment$findNextNode = function Fragment$findNextNode( item ) {
var index = item.index,
node;
if ( this.items[ index + 1 ] ) {
node = this.items[ index + 1 ].firstNode();
} else if ( this.owner === this.root ) {
if ( !this.owner.component ) {
// TODO but something else could have been appended to
// this.root.el, no?
node = null;
} else {
node = this.owner.component.findNextNode();
}
} else {
node = this.owner.findNextNode( this );
}
return node;
};
/* virtualdom/Fragment/prototype/firstNode.js */
var virtualdom_Fragment$firstNode = function Fragment$firstNode() {
if ( this.items && this.items[ 0 ] ) {
return this.items[ 0 ].firstNode();
}
return null;
};
/* virtualdom/Fragment/prototype/getNode.js */
var virtualdom_Fragment$getNode = function Fragment$getNode() {
var fragment = this;
do {
if ( fragment.pElement ) {
return fragment.pElement.node;
}
} while ( fragment = fragment.parent );
return this.root.el;
};
/* config/types.js */
var types = {
TEXT: 1,
INTERPOLATOR: 2,
TRIPLE: 3,
SECTION: 4,
INVERTED: 5,
CLOSING: 6,
ELEMENT: 7,
PARTIAL: 8,
COMMENT: 9,
DELIMCHANGE: 10,
MUSTACHE: 11,
TAG: 12,
ATTRIBUTE: 13,
CLOSING_TAG: 14,
COMPONENT: 15,
NUMBER_LITERAL: 20,
STRING_LITERAL: 21,
ARRAY_LITERAL: 22,
OBJECT_LITERAL: 23,
BOOLEAN_LITERAL: 24,
GLOBAL: 26,
KEY_VALUE_PAIR: 27,
REFERENCE: 30,
REFINEMENT: 31,
MEMBER: 32,
PREFIX_OPERATOR: 33,
BRACKETED: 34,
CONDITIONAL: 35,
INFIX_OPERATOR: 36,
INVOCATION: 40,
SECTION_IF: 50,
SECTION_UNLESS: 51,
SECTION_EACH: 52,
SECTION_WITH: 53
};
/* parse/Parser/expressions/shared/errors.js */
var parse_Parser_expressions_shared_errors = {
expectedExpression: 'Expected a JavaScript expression',
expectedParen: 'Expected closing paren'
};
/* parse/Parser/expressions/primary/literal/numberLiteral.js */
var numberLiteral = function( types ) {
// bulletproof number regex from https://gist.github.com/Rich-Harris/7544330
var numberPattern = /^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/;
return function( parser ) {
var result;
if ( result = parser.matchPattern( numberPattern ) ) {
return {
t: types.NUMBER_LITERAL,
v: result
};
}
return null;
};
}( types );
/* parse/Parser/expressions/primary/literal/booleanLiteral.js */
var booleanLiteral = function( types ) {
return function( parser ) {
var remaining = parser.remaining();
if ( remaining.substr( 0, 4 ) === 'true' ) {
parser.pos += 4;
return {
t: types.BOOLEAN_LITERAL,
v: 'true'
};
}
if ( remaining.substr( 0, 5 ) === 'false' ) {
parser.pos += 5;
return {
t: types.BOOLEAN_LITERAL,
v: 'false'
};
}
return null;
};
}( types );
/* parse/Parser/expressions/primary/literal/stringLiteral/makeQuotedStringMatcher.js */
var makeQuotedStringMatcher = function() {
var stringMiddlePattern, escapeSequencePattern, lineContinuationPattern;
// Match one or more characters until: ", ', \, or EOL/EOF.
// EOL/EOF is written as (?!.) (meaning there's no non-newline char next).
stringMiddlePattern = /^(?=.)[^"'\\]+?(?:(?!.)|(?=["'\\]))/;
// Match one escape sequence, including the backslash.
escapeSequencePattern = /^\\(?:['"\\bfnrt]|0(?![0-9])|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|(?=.)[^ux0-9])/;
// Match one ES5 line continuation (backslash + line terminator).
lineContinuationPattern = /^\\(?:\r\n|[\u000A\u000D\u2028\u2029])/;
// Helper for defining getDoubleQuotedString and getSingleQuotedString.
return function( okQuote ) {
return function( parser ) {
var start, literal, done, next;
start = parser.pos;
literal = '"';
done = false;
while ( !done ) {
next = parser.matchPattern( stringMiddlePattern ) || parser.matchPattern( escapeSequencePattern ) || parser.matchString( okQuote );
if ( next ) {
if ( next === '"' ) {
literal += '\\"';
} else if ( next === '\\\'' ) {
literal += '\'';
} else {
literal += next;
}
} else {
next = parser.matchPattern( lineContinuationPattern );
if ( next ) {
// convert \(newline-like) into a \u escape, which is allowed in JSON
literal += '\\u' + ( '000' + next.charCodeAt( 1 ).toString( 16 ) ).slice( -4 );
} else {
done = true;
}
}
}
literal += '"';
// use JSON.parse to interpret escapes
return JSON.parse( literal );
};
};
}();
/* parse/Parser/expressions/primary/literal/stringLiteral/singleQuotedString.js */
var singleQuotedString = function( makeQuotedStringMatcher ) {
return makeQuotedStringMatcher( '"' );
}( makeQuotedStringMatcher );
/* parse/Parser/expressions/primary/literal/stringLiteral/doubleQuotedString.js */
var doubleQuotedString = function( makeQuotedStringMatcher ) {
return makeQuotedStringMatcher( '\'' );
}( makeQuotedStringMatcher );
/* parse/Parser/expressions/primary/literal/stringLiteral/_stringLiteral.js */
var stringLiteral = function( types, getSingleQuotedString, getDoubleQuotedString ) {
return function( parser ) {
var start, string;
start = parser.pos;
if ( parser.matchString( '"' ) ) {
string = getDoubleQuotedString( parser );
if ( !parser.matchString( '"' ) ) {
parser.pos = start;
return null;
}
return {
t: types.STRING_LITERAL,
v: string
};
}
if ( parser.matchString( '\'' ) ) {
string = getSingleQuotedString( parser );
if ( !parser.matchString( '\'' ) ) {
parser.pos = start;
return null;
}
return {
t: types.STRING_LITERAL,
v: string
};
}
return null;
};
}( types, singleQuotedString, doubleQuotedString );
/* parse/Parser/expressions/shared/patterns.js */
var patterns = {
name: /^[a-zA-Z_$][a-zA-Z_$0-9]*/
};
/* parse/Parser/expressions/shared/key.js */
var key = function( getStringLiteral, getNumberLiteral, patterns ) {
var identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
// http://mathiasbynens.be/notes/javascript-properties
// can be any name, string literal, or number literal
return function( parser ) {
var token;
if ( token = getStringLiteral( parser ) ) {
return identifier.test( token.v ) ? token.v : '"' + token.v.replace( /"/g, '\\"' ) + '"';
}
if ( token = getNumberLiteral( parser ) ) {
return token.v;
}
if ( token = parser.matchPattern( patterns.name ) ) {
return token;
}
};
}( stringLiteral, numberLiteral, patterns );
/* parse/Parser/expressions/primary/literal/objectLiteral/keyValuePair.js */
var keyValuePair = function( types, getKey ) {
return function( parser ) {
var start, key, value;
start = parser.pos;
// allow whitespace between '{' and key
parser.allowWhitespace();
key = getKey( parser );
if ( key === null ) {
parser.pos = start;
return null;
}
// allow whitespace between key and ':'
parser.allowWhitespace();
// next character must be ':'
if ( !parser.matchString( ':' ) ) {
parser.pos = start;
return null;
}
// allow whitespace between ':' and value
parser.allowWhitespace();
// next expression must be a, well... expression
value = parser.readExpression();
if ( value === null ) {
parser.pos = start;
return null;
}
return {
t: types.KEY_VALUE_PAIR,
k: key,
v: value
};
};
}( types, key );
/* parse/Parser/expressions/primary/literal/objectLiteral/keyValuePairs.js */
var keyValuePairs = function( getKeyValuePair ) {
return function getKeyValuePairs( parser ) {
var start, pairs, pair, keyValuePairs;
start = parser.pos;
pair = getKeyValuePair( parser );
if ( pair === null ) {
return null;
}
pairs = [ pair ];
if ( parser.matchString( ',' ) ) {
keyValuePairs = getKeyValuePairs( parser );
if ( !keyValuePairs ) {
parser.pos = start;
return null;
}
return pairs.concat( keyValuePairs );
}
return pairs;
};
}( keyValuePair );
/* parse/Parser/expressions/primary/literal/objectLiteral/_objectLiteral.js */
var objectLiteral = function( types, getKeyValuePairs ) {
return function( parser ) {
var start, keyValuePairs;
start = parser.pos;
// allow whitespace
parser.allowWhitespace();
if ( !parser.matchString( '{' ) ) {
parser.pos = start;
return null;
}
keyValuePairs = getKeyValuePairs( parser );
// allow whitespace between final value and '}'
parser.allowWhitespace();
if ( !parser.matchString( '}' ) ) {
parser.pos = start;
return null;
}
return {
t: types.OBJECT_LITERAL,
m: keyValuePairs
};
};
}( types, keyValuePairs );
/* parse/Parser/expressions/shared/expressionList.js */
var expressionList = function( errors ) {
return function getExpressionList( parser ) {
var start, expressions, expr, next;
start = parser.pos;
parser.allowWhitespace();
expr = parser.readExpression();
if ( expr === null ) {
return null;
}
expressions = [ expr ];
// allow whitespace between expression and ','
parser.allowWhitespace();
if ( parser.matchString( ',' ) ) {
next = getExpressionList( parser );
if ( next === null ) {
parser.error( errors.expectedExpression );
}
next.forEach( append );
}
function append( expression ) {
expressions.push( expression );
}
return expressions;
};
}( parse_Parser_expressions_shared_errors );
/* parse/Parser/expressions/primary/literal/arrayLiteral.js */
var arrayLiteral = function( types, getExpressionList ) {
return function( parser ) {
var start, expressionList;
start = parser.pos;
// allow whitespace before '['
parser.allowWhitespace();
if ( !parser.matchString( '[' ) ) {
parser.pos = start;
return null;
}
expressionList = getExpressionList( parser );
if ( !parser.matchString( ']' ) ) {
parser.pos = start;
return null;
}
return {
t: types.ARRAY_LITERAL,
m: expressionList
};
};
}( types, expressionList );
/* parse/Parser/expressions/primary/literal/_literal.js */
var literal = function( getNumberLiteral, getBooleanLiteral, getStringLiteral, getObjectLiteral, getArrayLiteral ) {
return function( parser ) {
var literal = getNumberLiteral( parser ) || getBooleanLiteral( parser ) || getStringLiteral( parser ) || getObjectLiteral( parser ) || getArrayLiteral( parser );
return literal;
};
}( numberLiteral, booleanLiteral, stringLiteral, objectLiteral, arrayLiteral );
/* parse/Parser/expressions/primary/reference.js */
var reference = function( types, patterns ) {
var dotRefinementPattern, arrayMemberPattern, getArrayRefinement, globals, keywords;
dotRefinementPattern = /^\.[a-zA-Z_$0-9]+/;
getArrayRefinement = function( parser ) {
var num = parser.matchPattern( arrayMemberPattern );
if ( num ) {
return '.' + num;
}
return null;
};
arrayMemberPattern = /^\[(0|[1-9][0-9]*)\]/;
// if a reference is a browser global, we don't deference it later, so it needs special treatment
globals = /^(?:Array|Date|RegExp|decodeURIComponent|decodeURI|encodeURIComponent|encodeURI|isFinite|isNaN|parseFloat|parseInt|JSON|Math|NaN|undefined|null)$/;
// keywords are not valid references, with the exception of `this`
keywords = /^(?:break|case|catch|continue|debugger|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|void|while|with)$/;
return function( parser ) {
var startPos, ancestor, name, dot, combo, refinement, lastDotIndex;
startPos = parser.pos;
// we might have a root-level reference
if ( parser.matchString( '~/' ) ) {
ancestor = '~/';
} else {
// we might have ancestor refs...
ancestor = '';
while ( parser.matchString( '../' ) ) {
ancestor += '../';
}
}
if ( !ancestor ) {
// we might have an implicit iterator or a restricted reference
dot = parser.matchString( '.' ) || '';
}
name = parser.matchPattern( /^@(?:index|key)/ ) || parser.matchPattern( patterns.name ) || '';
// bug out if it's a keyword
if ( keywords.test( name ) ) {
parser.pos = startPos;
return null;
}
// if this is a browser global, stop here
if ( !ancestor && !dot && globals.test( name ) ) {
return {
t: types.GLOBAL,
v: name
};
}
combo = ( ancestor || dot ) + name;
if ( !combo ) {
return null;
}
while ( refinement = parser.matchPattern( dotRefinementPattern ) || getArrayRefinement( parser ) ) {
combo += refinement;
}
if ( parser.matchString( '(' ) ) {
// if this is a method invocation (as opposed to a function) we need
// to strip the method name from the reference combo, else the context
// will be wrong
lastDotIndex = combo.lastIndexOf( '.' );
if ( lastDotIndex !== -1 ) {
combo = combo.substr( 0, lastDotIndex );
parser.pos = startPos + combo.length;
} else {
parser.pos -= 1;
}
}
return {
t: types.REFERENCE,
n: combo.replace( /^this\./, './' ).replace( /^this$/, '.' )
};
};
}( types, patterns );
/* parse/Parser/expressions/primary/bracketedExpression.js */
var bracketedExpression = function( types, errors ) {
return function( parser ) {
var start, expr;
start = parser.pos;
if ( !parser.matchString( '(' ) ) {
return null;
}
parser.allowWhitespace();
expr = parser.readExpression();
if ( !expr ) {
parser.error( errors.expectedExpression );
}
parser.allowWhitespace();
if ( !parser.matchString( ')' ) ) {
parser.error( errors.expectedParen );
}
return {
t: types.BRACKETED,
x: expr
};
};
}( types, parse_Parser_expressions_shared_errors );
/* parse/Parser/expressions/primary/_primary.js */
var primary = function( getLiteral, getReference, getBracketedExpression ) {
return function( parser ) {
return getLiteral( parser ) || getReference( parser ) || getBracketedExpression( parser );
};
}( literal, reference, bracketedExpression );
/* parse/Parser/expressions/shared/refinement.js */
var refinement = function( types, errors, patterns ) {
return function getRefinement( parser ) {
var start, name, expr;
start = parser.pos;
parser.allowWhitespace();
// "." name
if ( parser.matchString( '.' ) ) {
parser.allowWhitespace();
if ( name = parser.matchPattern( patterns.name ) ) {
return {
t: types.REFINEMENT,
n: name
};
}
parser.error( 'Expected a property name' );
}
// "[" expression "]"
if ( parser.matchString( '[' ) ) {
parser.allowWhitespace();
expr = parser.readExpression();
if ( !expr ) {
parser.error( errors.expectedExpression );
}
parser.allowWhitespace();
if ( !parser.matchString( ']' ) ) {
parser.error( 'Expected \']\'' );
}
return {
t: types.REFINEMENT,
x: expr
};
}
return null;
};
}( types, parse_Parser_expressions_shared_errors, patterns );
/* parse/Parser/expressions/memberOrInvocation.js */
var memberOrInvocation = function( types, getPrimary, getExpressionList, getRefinement, errors ) {
return function( parser ) {
var current, expression, refinement, expressionList;
expression = getPrimary( parser );
if ( !expression ) {
return null;
}
while ( expression ) {
current = parser.pos;
if ( refinement = getRefinement( parser ) ) {
expression = {
t: types.MEMBER,
x: expression,
r: refinement
};
} else if ( parser.matchString( '(' ) ) {
parser.allowWhitespace();
expressionList = getExpressionList( parser );
parser.allowWhitespace();
if ( !parser.matchString( ')' ) ) {
parser.error( errors.expectedParen );
}
expression = {
t: types.INVOCATION,
x: expression
};
if ( expressionList ) {
expression.o = expressionList;
}
} else {
break;
}
}
return expression;
};
}( types, primary, expressionList, refinement, parse_Parser_expressions_shared_errors );
/* parse/Parser/expressions/typeof.js */
var _typeof = function( types, errors, getMemberOrInvocation ) {
var getTypeof, makePrefixSequenceMatcher;
makePrefixSequenceMatcher = function( symbol, fallthrough ) {
return function( parser ) {
var expression;
if ( expression = fallthrough( parser ) ) {
return expression;
}
if ( !parser.matchString( symbol ) ) {
return null;
}
parser.allowWhitespace();
expression = parser.readExpression();
if ( !expression ) {
parser.error( errors.expectedExpression );
}
return {
s: symbol,
o: expression,
t: types.PREFIX_OPERATOR
};
};
};
// create all prefix sequence matchers, return getTypeof
( function() {
var i, len, matcher, prefixOperators, fallthrough;
prefixOperators = '! ~ + - typeof'.split( ' ' );
fallthrough = getMemberOrInvocation;
for ( i = 0, len = prefixOperators.length; i < len; i += 1 ) {
matcher = makePrefixSequenceMatcher( prefixOperators[ i ], fallthrough );
fallthrough = matcher;
}
// typeof operator is higher precedence than multiplication, so provides the
// fallthrough for the multiplication sequence matcher we're about to create
// (we're skipping void and delete)
getTypeof = fallthrough;
}() );
return getTypeof;
}( types, parse_Parser_expressions_shared_errors, memberOrInvocation );
/* parse/Parser/expressions/logicalOr.js */
var logicalOr = function( types, getTypeof ) {
var getLogicalOr, makeInfixSequenceMatcher;
makeInfixSequenceMatcher = function( symbol, fallthrough ) {
return function( parser ) {
var start, left, right;
left = fallthrough( parser );
if ( !left ) {
return null;
}
// Loop to handle left-recursion in a case like `a * b * c` and produce
// left association, i.e. `(a * b) * c`. The matcher can't call itself
// to parse `left` because that would be infinite regress.
while ( true ) {
start = parser.pos;
parser.allowWhitespace();
if ( !parser.matchString( symbol ) ) {
parser.pos = start;
return left;
}
// special case - in operator must not be followed by [a-zA-Z_$0-9]
if ( symbol === 'in' && /[a-zA-Z_$0-9]/.test( parser.remaining().charAt( 0 ) ) ) {
parser.pos = start;
return left;
}
parser.allowWhitespace();
// right operand must also consist of only higher-precedence operators
right = fallthrough( parser );
if ( !right ) {
parser.pos = start;
return left;
}
left = {
t: types.INFIX_OPERATOR,
s: symbol,
o: [
left,
right
]
};
}
};
};
// create all infix sequence matchers, and return getLogicalOr
( function() {
var i, len, matcher, infixOperators, fallthrough;
// All the infix operators on order of precedence (source: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Operator_Precedence)
// Each sequence matcher will initially fall through to its higher precedence
// neighbour, and only attempt to match if one of the higher precedence operators
// (or, ultimately, a literal, reference, or bracketed expression) already matched
infixOperators = '* / % + - << >> >>> < <= > >= in instanceof == != === !== & ^ | && ||'.split( ' ' );
// A typeof operator is higher precedence than multiplication
fallthrough = getTypeof;
for ( i = 0, len = infixOperators.length; i < len; i += 1 ) {
matcher = makeInfixSequenceMatcher( infixOperators[ i ], fallthrough );
fallthrough = matcher;
}
// Logical OR is the fallthrough for the conditional matcher
getLogicalOr = fallthrough;
}() );
return getLogicalOr;
}( types, _typeof );
/* parse/Parser/expressions/conditional.js */
var conditional = function( types, getLogicalOr, errors ) {
// The conditional operator is the lowest precedence operator, so we start here
return function( parser ) {
var start, expression, ifTrue, ifFalse;
expression = getLogicalOr( parser );
if ( !expression ) {
return null;
}
start = parser.pos;
parser.allowWhitespace();
if ( !parser.matchString( '?' ) ) {
parser.pos = start;
return expression;
}
parser.allowWhitespace();
ifTrue = parser.readExpression();
if ( !ifTrue ) {
parser.error( errors.expectedExpression );
}
parser.allowWhitespace();
if ( !parser.matchString( ':' ) ) {
parser.error( 'Expected ":"' );
}
parser.allowWhitespace();
ifFalse = parser.readExpression();
if ( !ifFalse ) {
parser.error( errors.expectedExpression );
}
return {
t: types.CONDITIONAL,
o: [
expression,
ifTrue,
ifFalse
]
};
};
}( types, logicalOr, parse_Parser_expressions_shared_errors );
/* parse/Parser/utils/flattenExpression.js */
var flattenExpression = function( types, isObject ) {
return function( expression ) {
var refs = [],
flattened;
extractRefs( expression, refs );
flattened = {
r: refs,
s: stringify( this, expression, refs )
};
return flattened;
};
function quoteStringLiteral( str ) {
return JSON.stringify( String( str ) );
}
// TODO maybe refactor this?
function extractRefs( node, refs ) {
var i, list;
if ( node.t === types.REFERENCE ) {
if ( refs.indexOf( node.n ) === -1 ) {
refs.unshift( node.n );
}
}
list = node.o || node.m;
if ( list ) {
if ( isObject( list ) ) {
extractRefs( list, refs );
} else {
i = list.length;
while ( i-- ) {
extractRefs( list[ i ], refs );
}
}
}
if ( node.x ) {
extractRefs( node.x, refs );
}
if ( node.r ) {
extractRefs( node.r, refs );
}
if ( node.v ) {
extractRefs( node.v, refs );
}
}
function stringify( parser, node, refs ) {
var stringifyAll = function( item ) {
return stringify( parser, item, refs );
};
switch ( node.t ) {
case types.BOOLEAN_LITERAL:
case types.GLOBAL:
case types.NUMBER_LITERAL:
return node.v;
case types.STRING_LITERAL:
return quoteStringLiteral( node.v );
case types.ARRAY_LITERAL:
return '[' + ( node.m ? node.m.map( stringifyAll ).join( ',' ) : '' ) + ']';
case types.OBJECT_LITERAL:
return '{' + ( node.m ? node.m.map( stringifyAll ).join( ',' ) : '' ) + '}';
case types.KEY_VALUE_PAIR:
return node.k + ':' + stringify( parser, node.v, refs );
case types.PREFIX_OPERATOR:
return ( node.s === 'typeof' ? 'typeof ' : node.s ) + stringify( parser, node.o, refs );
case types.INFIX_OPERATOR:
return stringify( parser, node.o[ 0 ], refs ) + ( node.s.substr( 0, 2 ) === 'in' ? ' ' + node.s + ' ' : node.s ) + stringify( parser, node.o[ 1 ], refs );
case types.INVOCATION:
return stringify( parser, node.x, refs ) + '(' + ( node.o ? node.o.map( stringifyAll ).join( ',' ) : '' ) + ')';
case types.BRACKETED:
return '(' + stringify( parser, node.x, refs ) + ')';
case types.MEMBER:
return stringify( parser, node.x, refs ) + stringify( parser, node.r, refs );
case types.REFINEMENT:
return node.n ? '.' + node.n : '[' + stringify( parser, node.x, refs ) + ']';
case types.CONDITIONAL:
return stringify( parser, node.o[ 0 ], refs ) + '?' + stringify( parser, node.o[ 1 ], refs ) + ':' + stringify( parser, node.o[ 2 ], refs );
case types.REFERENCE:
return '${' + refs.indexOf( node.n ) + '}';
default:
parser.error( 'Expected legal JavaScript' );
}
}
}( types, isObject );
/* parse/Parser/_Parser.js */
var Parser = function( circular, create, hasOwnProperty, getConditional, flattenExpression ) {
var Parser, ParseError, leadingWhitespace = /^\s+/;
ParseError = function( message ) {
this.name = 'ParseError';
this.message = message;
try {
throw new Error( message );
} catch ( e ) {
this.stack = e.stack;
}
};
ParseError.prototype = Error.prototype;
Parser = function( str, options ) {
var items, item;
this.str = str;
this.options = options || {};
this.pos = 0;
// Custom init logic
if ( this.init )
this.init( str, options );
items = [];
while ( this.pos < this.str.length && ( item = this.read() ) ) {
items.push( item );
}
this.leftover = this.remaining();
this.result = this.postProcess ? this.postProcess( items, options ) : items;
};
Parser.prototype = {
read: function( converters ) {
var pos, i, len, item;
if ( !converters )
converters = this.converters;
pos = this.pos;
len = converters.length;
for ( i = 0; i < len; i += 1 ) {
this.pos = pos;
// reset for each attempt
if ( item = converters[ i ]( this ) ) {
return item;
}
}
return null;
},
readExpression: function() {
// The conditional operator is the lowest precedence operator (except yield,
// assignment operators, and commas, none of which are supported), so we
// start there. If it doesn't match, it 'falls through' to progressively
// higher precedence operators, until it eventually matches (or fails to
// match) a 'primary' - a literal or a reference. This way, the abstract syntax
// tree has everything in its proper place, i.e. 2 + 3 * 4 === 14, not 20.
return getConditional( this );
},
flattenExpression: flattenExpression,
getLinePos: function() {
var lines, currentLine, currentLineEnd, nextLineEnd, lineNum, columnNum;
lines = this.str.split( '\n' );
lineNum = -1;
nextLineEnd = 0;
do {
currentLineEnd = nextLineEnd;
lineNum++;
currentLine = lines[ lineNum ];
nextLineEnd += currentLine.length + 1;
} while ( nextLineEnd <= this.pos );
columnNum = this.pos - currentLineEnd;
return {
line: lineNum + 1,
ch: columnNum + 1,
text: currentLine,
toJSON: function() {
return [
this.line,
this.ch
];
},
toString: function() {
return 'line ' + this.line + ' character ' + this.ch + ':\n' + this.text + '\n' + this.text.substr( 0, this.ch - 1 ).replace( /[\S]/g, ' ' ) + '^----';
}
};
},
error: function( err ) {
var pos, message;
pos = this.getLinePos();
message = err + ' at ' + pos;
throw new ParseError( message );
},
matchString: function( string ) {
if ( this.str.substr( this.pos, string.length ) === string ) {
this.pos += string.length;
return string;
}
},
matchPattern: function( pattern ) {
var match;
if ( match = pattern.exec( this.remaining() ) ) {
this.pos += match[ 0 ].length;
return match[ 1 ] || match[ 0 ];
}
},
allowWhitespace: function() {
this.matchPattern( leadingWhitespace );
},
remaining: function() {
return this.str.substring( this.pos );
},
nextChar: function() {
return this.str.charAt( this.pos );
}
};
Parser.extend = function( proto ) {
var Parent = this,
Child, key;
Child = function( str, options ) {
Parser.call( this, str, options );
};
Child.prototype = create( Parent.prototype );
for ( key in proto ) {
if ( hasOwnProperty.call( proto, key ) ) {
Child.prototype[ key ] = proto[ key ];
}
}
Child.extend = Parser.extend;
return Child;
};
circular.Parser = Parser;
return Parser;
}( circular, create, hasOwn, conditional, flattenExpression );
/* utils/parseJSON.js */
var parseJSON = function( Parser, getStringLiteral, getKey ) {
// simple JSON parser, without the restrictions of JSON parse
// (i.e. having to double-quote keys).
//
// If passed a hash of values as the second argument, ${placeholders}
// will be replaced with those values
var JsonParser, specials, specialsPattern, numberPattern, placeholderPattern, placeholderAtStartPattern, onlyWhitespace;
specials = {
'true': true,
'false': false,
'undefined': undefined,
'null': null
};
specialsPattern = new RegExp( '^(?:' + Object.keys( specials ).join( '|' ) + ')' );
numberPattern = /^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/;
placeholderPattern = /\$\{([^\}]+)\}/g;
placeholderAtStartPattern = /^\$\{([^\}]+)\}/;
onlyWhitespace = /^\s*$/;
JsonParser = Parser.extend( {
init: function( str, options ) {
this.values = options.values;
},
postProcess: function( result ) {
if ( result.length !== 1 || !onlyWhitespace.test( this.leftover ) ) {
return null;
}
return {
value: result[ 0 ].v
};
},
converters: [
function getPlaceholder( parser ) {
var placeholder;
if ( !parser.values ) {
return null;
}
placeholder = parser.matchPattern( placeholderAtStartPattern );
if ( placeholder && parser.values.hasOwnProperty( placeholder ) ) {
return {
v: parser.values[ placeholder ]
};
}
},
function getSpecial( parser ) {
var special;
if ( special = parser.matchPattern( specialsPattern ) ) {
return {
v: specials[ special ]
};
}
},
function getNumber( parser ) {
var number;
if ( number = parser.matchPattern( numberPattern ) ) {
return {
v: +number
};
}
},
function getString( parser ) {
var stringLiteral = getStringLiteral( parser ),
values;
if ( stringLiteral && ( values = parser.values ) ) {
return {
v: stringLiteral.v.replace( placeholderPattern, function( match, $1 ) {
return $1 in values ? values[ $1 ] : $1;
} )
};
}
return stringLiteral;
},
function getObject( parser ) {
var result, pair;
if ( !parser.matchString( '{' ) ) {
return null;
}
result = {};
parser.allowWhitespace();
if ( parser.matchString( '}' ) ) {
return {
v: result
};
}
while ( pair = getKeyValuePair( parser ) ) {
result[ pair.key ] = pair.value;
parser.allowWhitespace();
if ( parser.matchString( '}' ) ) {
return {
v: result
};
}
if ( !parser.matchString( ',' ) ) {
return null;
}
}
return null;
},
function getArray( parser ) {
var result, valueToken;
if ( !parser.matchString( '[' ) ) {
return null;
}
result = [];
parser.allowWhitespace();
if ( parser.matchString( ']' ) ) {
return {
v: result
};
}
while ( valueToken = parser.read() ) {
result.push( valueToken.v );
parser.allowWhitespace();
if ( parser.matchString( ']' ) ) {
return {
v: result
};
}
if ( !parser.matchString( ',' ) ) {
return null;
}
parser.allowWhitespace();
}
return null;
}
]
} );
function getKeyValuePair( parser ) {
var key, valueToken, pair;
parser.allowWhitespace();
key = getKey( parser );
if ( !key ) {
return null;
}
pair = {
key: key
};
parser.allowWhitespace();
if ( !parser.matchString( ':' ) ) {
return null;
}
parser.allowWhitespace();
valueToken = parser.read();
if ( !valueToken ) {
return null;
}
pair.value = valueToken.v;
return pair;
}
return function( str, values ) {
var parser = new JsonParser( str, {
values: values
} );
return parser.result;
};
}( Parser, stringLiteral, key );
/* virtualdom/Fragment/prototype/getValue.js */
var virtualdom_Fragment$getValue = function( parseJSON ) {
var empty = {};
return function Fragment$getValue() {
var options = arguments[ 0 ];
if ( options === void 0 )
options = empty;
var asArgs, values, source, parsed, cachedResult, dirtyFlag, result;
asArgs = options.args;
cachedResult = asArgs ? 'argsList' : 'value';
dirtyFlag = asArgs ? 'dirtyArgs' : 'dirtyValue';
if ( this[ dirtyFlag ] ) {
source = processItems( this.items, values = {}, this.root._guid );
parsed = parseJSON( asArgs ? '[' + source + ']' : source, values );
if ( !parsed ) {
result = asArgs ? [ this.toString() ] : this.toString();
} else {
result = parsed.value;
}
this[ cachedResult ] = result;
this[ dirtyFlag ] = false;
}
return this[ cachedResult ];
};
function processItems( items, values, guid, counter ) {
counter = counter || 0;
return items.map( function( item ) {
var placeholderId, wrapped, value;
if ( item.text ) {
return item.text;
}
if ( item.fragments ) {
return item.fragments.map( function( fragment ) {
return processItems( fragment.items, values, guid, counter );
} ).join( '' );
}
placeholderId = guid + '-' + counter++;
if ( wrapped = item.root.viewmodel.wrapped[ item.keypath ] ) {
value = wrapped.value;
} else {
value = item.getValue();
}
values[ placeholderId ] = value;
return '${' + placeholderId + '}';
} ).join( '' );
}
}( parseJSON );
/* utils/escapeHtml.js */
var escapeHtml = function() {
var lessThan = /</g,
greaterThan = />/g;
return function escapeHtml( str ) {
return str.replace( lessThan, '<' ).replace( greaterThan, '>' );
};
}();
/* utils/detachNode.js */
var detachNode = function detachNode( node ) {
if ( node && node.parentNode ) {
node.parentNode.removeChild( node );
}
return node;
};
/* virtualdom/items/shared/detach.js */
var detach = function( detachNode ) {
return function() {
return detachNode( this.node );
};
}( detachNode );
/* virtualdom/items/Text.js */
var Text = function( types, escapeHtml, detach ) {
var Text = function( options ) {
this.type = types.TEXT;
this.text = options.template;
};
Text.prototype = {
detach: detach,
firstNode: function() {
return this.node;
},
render: function() {
if ( !this.node ) {
this.node = document.createTextNode( this.text );
}
return this.node;
},
toString: function( escape ) {
return escape ? escapeHtml( this.text ) : this.text;
},
unrender: function( shouldDestroy ) {
if ( shouldDestroy ) {
return this.detach();
}
}
};
return Text;
}( types, escapeHtml, detach );
/* virtualdom/items/shared/unbind.js */
var unbind = function( runloop ) {
return function unbind() {
if ( !this.keypath ) {
// this was on the 'unresolved' list, we need to remove it
runloop.removeUnresolved( this );
} else {
// this was registered as a dependant
this.root.viewmodel.unregister( this.keypath, this );
}
if ( this.resolver ) {
this.resolver.teardown();
}
};
}( runloop );
/* virtualdom/items/shared/Mustache/getValue.js */
var getValue = function Mustache$getValue() {
return this.value;
};
/* shared/Unresolved.js */
var Unresolved = function( runloop ) {
var Unresolved = function( ractive, ref, parentFragment, callback ) {
this.root = ractive;
this.ref = ref;
this.parentFragment = parentFragment;
this.resolve = callback;
runloop.addUnresolved( this );
};
Unresolved.prototype = {
teardown: function() {
runloop.removeUnresolved( this );
}
};
return Unresolved;
}( runloop );
/* virtualdom/items/shared/utils/startsWithKeypath.js */
var startsWithKeypath = function startsWithKeypath( target, keypath ) {
return target.substr( 0, keypath.length + 1 ) === keypath + '.';
};
/* virtualdom/items/shared/utils/getNewKeypath.js */
var getNewKeypath = function( startsWithKeypath ) {
return function getNewKeypath( targetKeypath, oldKeypath, newKeypath ) {
// exact match
if ( targetKeypath === oldKeypath ) {
return newKeypath;
}
// partial match based on leading keypath segments
if ( startsWithKeypath( targetKeypath, oldKeypath ) ) {
return targetKeypath.replace( oldKeypath + '.', newKeypath + '.' );
}
};
}( startsWithKeypath );
/* utils/log.js */
var log = function( consolewarn, errors ) {
var log = {
warn: function( options, passthru ) {
if ( !options.debug && !passthru ) {
return;
}
this.logger( getMessage( options ), options.allowDuplicates );
},
error: function( options ) {
this.errorOnly( options );
if ( !options.debug ) {
this.warn( options, true );
}
},
errorOnly: function( options ) {
if ( options.debug ) {
this.critical( options );
}
},
critical: function( options ) {
var err = options.err || new Error( getMessage( options ) );
this.thrower( err );
},
logger: consolewarn,
thrower: function( err ) {
throw err;
}
};
function getMessage( options ) {
var message = errors[ options.message ] || options.message || '';
return interpolate( message, options.args );
}
// simple interpolation. probably quicker (and better) out there,
// but log is not in golden path of execution, only exceptions
function interpolate( message, args ) {
return message.replace( /{([^{}]*)}/g, function( a, b ) {
return args[ b ];
} );
}
return log;
}( warn, errors );
/* viewmodel/Computation/diff.js */
var diff = function diff( computation, dependencies, newDependencies ) {
var i, keypath;
// remove dependencies that are no longer used
i = dependencies.length;
while ( i-- ) {
keypath = dependencies[ i ];
if ( newDependencies.indexOf( keypath ) === -1 ) {
computation.viewmodel.unregister( keypath, computation, 'computed' );
}
}
// create references for any new dependencies
i = newDependencies.length;
while ( i-- ) {
keypath = newDependencies[ i ];
if ( dependencies.indexOf( keypath ) === -1 ) {
computation.viewmodel.register( keypath, computation, 'computed' );
}
}
computation.dependencies = newDependencies.slice();
};
/* virtualdom/items/shared/Evaluator/Evaluator.js */
var Evaluator = function( log, isEqual, defineProperty, diff ) {
// TODO this is a red flag... should be treated the same?
var Evaluator, cache = {};
Evaluator = function( root, keypath, uniqueString, functionStr, args, priority ) {
var evaluator = this,
viewmodel = root.viewmodel;
evaluator.root = root;
evaluator.viewmodel = viewmodel;
evaluator.uniqueString = uniqueString;
evaluator.keypath = keypath;
evaluator.priority = priority;
evaluator.fn = getFunctionFromString( functionStr, args.length );
evaluator.explicitDependencies = [];
evaluator.dependencies = [];
// created by `this.get()` within functions
evaluator.argumentGetters = args.map( function( arg ) {
var keypath, index;
if ( !arg ) {
return void 0;
}
if ( arg.indexRef ) {
index = arg.value;
return index;
}
keypath = arg.keypath;
evaluator.explicitDependencies.push( keypath );
viewmodel.register( keypath, evaluator, 'computed' );
return function() {
var value = viewmodel.get( keypath );
return typeof value === 'function' ? wrap( value, root ) : value;
};
} );
};
Evaluator.prototype = {
wake: function() {
this.awake = true;
},
sleep: function() {
this.awake = false;
},
getValue: function() {
var args, value, newImplicitDependencies;
args = this.argumentGetters.map( call );
if ( this.updating ) {
// Prevent infinite loops caused by e.g. in-place array mutations
return;
}
this.updating = true;
this.viewmodel.capture();
try {
value = this.fn.apply( null, args );
} catch ( err ) {
if ( this.root.debug ) {
log.warn( {
debug: this.root.debug,
message: 'evaluationError',
args: {
uniqueString: this.uniqueString,
err: err.message || err
}
} );
}
value = undefined;
}
newImplicitDependencies = this.viewmodel.release();
diff( this, this.dependencies, newImplicitDependencies );
this.updating = false;
return value;
},
update: function() {
var value = this.getValue();
if ( !isEqual( value, this.value ) ) {
this.value = value;
this.root.viewmodel.mark( this.keypath );
}
return this;
},
// TODO should evaluators ever get torn down? At present, they don't...
teardown: function() {
var this$0 = this;
this.explicitDependencies.concat( this.dependencies ).forEach( function( keypath ) {
return this$0.viewmodel.unregister( keypath, this$0, 'computed' );
} );
this.root.viewmodel.evaluators[ this.keypath ] = null;
}
};
return Evaluator;
function getFunctionFromString( str, i ) {
var fn, args;
str = str.replace( /\$\{([0-9]+)\}/g, '_$1' );
if ( cache[ str ] ) {
return cache[ str ];
}
args = [];
while ( i-- ) {
args[ i ] = '_' + i;
}
fn = new Function( args.join( ',' ), 'return(' + str + ')' );
cache[ str ] = fn;
return fn;
}
function wrap( fn, ractive ) {
var wrapped, prop;
if ( fn._noWrap ) {
return fn;
}
prop = '__ractive_' + ractive._guid;
wrapped = fn[ prop ];
if ( wrapped ) {
return wrapped;
} else if ( /this/.test( fn.toString() ) ) {
defineProperty( fn, prop, {
value: fn.bind( ractive )
} );
return fn[ prop ];
}
defineProperty( fn, '__ractive_nowrap', {
value: fn
} );
return fn.__ractive_nowrap;
}
function call( arg ) {
return typeof arg === 'function' ? arg() : arg;
}
}( log, isEqual, defineProperty, diff );
/* virtualdom/items/shared/Resolvers/ExpressionResolver.js */
var ExpressionResolver = function( removeFromArray, resolveRef, Unresolved, Evaluator, getNewKeypath ) {
var ExpressionResolver = function( owner, parentFragment, expression, callback ) {
var expressionResolver = this,
ractive, indexRefs, args;
ractive = owner.root;
this.root = ractive;
this.callback = callback;
this.owner = owner;
this.str = expression.s;
this.args = args = [];
this.unresolved = [];
this.pending = 0;
indexRefs = parentFragment.indexRefs;
// some expressions don't have references. edge case, but, yeah.
if ( !expression.r || !expression.r.length ) {
this.resolved = this.ready = true;
this.bubble();
return;
}
// Create resolvers for each reference
expression.r.forEach( function( reference, i ) {
var index, keypath, unresolved;
// Is this an index reference?
if ( indexRefs && ( index = indexRefs[ reference ] ) !== undefined ) {
args[ i ] = {
indexRef: reference,
value: index
};
return;
}
// Can we resolve it immediately?
if ( keypath = resolveRef( ractive, reference, parentFragment ) ) {
args[ i ] = {
keypath: keypath
};
return;
}
// Couldn't resolve yet
args[ i ] = null;
expressionResolver.pending += 1;
unresolved = new Unresolved( ractive, reference, parentFragment, function( keypath ) {
expressionResolver.resolve( i, keypath );
removeFromArray( expressionResolver.unresolved, unresolved );
} );
expressionResolver.unresolved.push( unresolved );
} );
this.ready = true;
this.bubble();
};
ExpressionResolver.prototype = {
bubble: function() {
if ( !this.ready ) {
return;
}
this.uniqueString = getUniqueString( this.str, this.args );
this.keypath = getKeypath( this.uniqueString );
this.createEvaluator();
this.callback( this.keypath );
},
teardown: function() {
var unresolved;
while ( unresolved = this.unresolved.pop() ) {
unresolved.teardown();
}
},
resolve: function( index, keypath ) {
this.args[ index ] = {
keypath: keypath
};
this.bubble();
// when all references have been resolved, we can flag the entire expression
// as having been resolved
this.resolved = !--this.pending;
},
createEvaluator: function() {
var evaluator = this.root.viewmodel.evaluators[ this.keypath ];
// only if it doesn't exist yet!
if ( !evaluator ) {
evaluator = new Evaluator( this.root, this.keypath, this.uniqueString, this.str, this.args, this.owner.priority );
this.root.viewmodel.evaluators[ this.keypath ] = evaluator;
}
evaluator.update();
},
rebind: function( indexRef, newIndex, oldKeypath, newKeypath ) {
var changed;
this.args.forEach( function( arg ) {
var changedKeypath;
if ( !arg )
return;
if ( arg.keypath && ( changedKeypath = getNewKeypath( arg.keypath, oldKeypath, newKeypath ) ) ) {
arg.keypath = changedKeypath;
changed = true;
} else if ( arg.indexRef && arg.indexRef === indexRef ) {
arg.value = newIndex;
changed = true;
}
} );
if ( changed ) {
this.bubble();
}
}
};
return ExpressionResolver;
function getUniqueString( str, args ) {
// get string that is unique to this expression
return str.replace( /\$\{([0-9]+)\}/g, function( match, $1 ) {
var arg = args[ $1 ];
if ( !arg )
return 'undefined';
if ( arg.indexRef )
return arg.value;
return arg.keypath;
} );
}
function getKeypath( uniqueString ) {
// Sanitize by removing any periods or square brackets. Otherwise
// we can't split the keypath into keys!
return '${' + uniqueString.replace( /[\.\[\]]/g, '-' ) + '}';
}
}( removeFromArray, resolveRef, Unresolved, Evaluator, getNewKeypath );
/* virtualdom/items/shared/Resolvers/ReferenceExpressionResolver/MemberResolver.js */
var MemberResolver = function( types, resolveRef, Unresolved, getNewKeypath, ExpressionResolver ) {
var MemberResolver = function( template, resolver, parentFragment ) {
var member = this,
ref, indexRefs, index, ractive, keypath;
member.resolver = resolver;
member.root = resolver.root;
member.viewmodel = resolver.root.viewmodel;
if ( typeof template === 'string' ) {
member.value = template;
} else if ( template.t === types.REFERENCE ) {
ref = member.ref = template.n;
// If it's an index reference, our job is simple
if ( ( indexRefs = parentFragment.indexRefs ) && ( index = indexRefs[ ref ] ) !== undefined ) {
member.indexRef = ref;
member.value = index;
} else {
ractive = resolver.root;
// Can we resolve the reference immediately?
if ( keypath = resolveRef( ractive, ref, parentFragment ) ) {
member.resolve( keypath );
} else {
// Couldn't resolve yet
member.unresolved = new Unresolved( ractive, ref, parentFragment, function( keypath ) {
member.unresolved = null;
member.resolve( keypath );
} );
}
}
} else {
new ExpressionResolver( resolver, parentFragment, template, function( keypath ) {
member.resolve( keypath );
} );
}
};
MemberResolver.prototype = {
resolve: function( keypath ) {
this.keypath = keypath;
this.value = this.viewmodel.get( keypath );
this.bind();
this.resolver.bubble();
},
bind: function() {
this.viewmodel.register( this.keypath, this );
},
rebind: function( indexRef, newIndex, oldKeypath, newKeypath ) {
var keypath;
if ( indexRef && this.indexRef === indexRef ) {
if ( newIndex !== this.value ) {
this.value = newIndex;
return true;
}
} else if ( this.keypath && ( keypath = getNewKeypath( this.keypath, oldKeypath, newKeypath ) ) ) {
this.unbind();
this.keypath = keypath;
this.value = this.root.viewmodel.get( keypath );
this.bind();
return true;
}
},
setValue: function( value ) {
this.value = value;
this.resolver.bubble();
},
unbind: function() {
if ( this.keypath ) {
this.root.viewmodel.unregister( this.keypath, this );
}
},
teardown: function() {
this.unbind();
if ( this.unresolved ) {
this.unresolved.teardown();
}
},
forceResolution: function() {
if ( this.unresolved ) {
this.unresolved.teardown();
this.unresolved = null;
this.keypath = this.ref;
this.value = this.viewmodel.get( this.ref );
this.bind();
}
}
};
return MemberResolver;
}( types, resolveRef, Unresolved, getNewKeypath, ExpressionResolver );
/* virtualdom/items/shared/Resolvers/ReferenceExpressionResolver/ReferenceExpressionResolver.js */
var ReferenceExpressionResolver = function( resolveRef, Unresolved, MemberResolver ) {
var ReferenceExpressionResolver = function( mustache, template, callback ) {
var this$0 = this;
var resolver = this,
ractive, ref, keypath, parentFragment;
parentFragment = mustache.parentFragment;
resolver.root = ractive = mustache.root;
resolver.mustache = mustache;
resolver.priority = mustache.priority;
resolver.ref = ref = template.r;
resolver.callback = callback;
resolver.unresolved = [];
// Find base keypath
if ( keypath = resolveRef( ractive, ref, parentFragment ) ) {
resolver.base = keypath;
} else {
resolver.baseResolver = new Unresolved( ractive, ref, parentFragment, function( keypath ) {
resolver.base = keypath;
resolver.baseResolver = null;
resolver.bubble();
} );
}
// Find values for members, or mark them as unresolved
resolver.members = template.m.map( function( template ) {
return new MemberResolver( template, this$0, parentFragment );
} );
resolver.ready = true;
resolver.bubble();
};
ReferenceExpressionResolver.prototype = {
getKeypath: function() {
var values = this.members.map( getValue );
if ( !values.every( isDefined ) || this.baseResolver ) {
return;
}
return this.base + '.' + values.join( '.' );
},
bubble: function() {
if ( !this.ready || this.baseResolver ) {
return;
}
this.callback( this.getKeypath() );
},
teardown: function() {
this.members.forEach( unbind );
},
rebind: function( indexRef, newIndex, oldKeypath, newKeypath ) {
var changed;
this.members.forEach( function( members ) {
if ( members.rebind( indexRef, newIndex, oldKeypath, newKeypath ) ) {
changed = true;
}
} );
if ( changed ) {
this.bubble();
}
},
forceResolution: function() {
if ( this.baseResolver ) {
this.base = this.ref;
this.baseResolver.teardown();
this.baseResolver = null;
}
this.members.forEach( function( m ) {
return m.forceResolution();
} );
this.bubble();
}
};
function getValue( member ) {
return member.value;
}
function isDefined( value ) {
return value != undefined;
}
function unbind( member ) {
member.unbind();
}
return ReferenceExpressionResolver;
}( resolveRef, Unresolved, MemberResolver );
/* virtualdom/items/shared/Mustache/initialise.js */
var initialise = function( types, runloop, resolveRef, ReferenceExpressionResolver, ExpressionResolver ) {
return function Mustache$init( mustache, options ) {
var ref, keypath, indexRefs, index, parentFragment, template;
parentFragment = options.parentFragment;
template = options.template;
mustache.root = parentFragment.root;
mustache.parentFragment = parentFragment;
mustache.pElement = parentFragment.pElement;
mustache.template = options.template;
mustache.index = options.index || 0;
mustache.priority = parentFragment.priority;
mustache.isStatic = options.template.s;
mustache.type = options.template.t;
// if this is a simple mustache, with a reference, we just need to resolve
// the reference to a keypath
if ( ref = template.r ) {
indexRefs = parentFragment.indexRefs;
if ( indexRefs && ( index = indexRefs[ ref ] ) !== undefined ) {
mustache.indexRef = ref;
mustache.setValue( index );
return;
}
keypath = resolveRef( mustache.root, ref, mustache.parentFragment );
if ( keypath !== undefined ) {
mustache.resolve( keypath );
} else {
mustache.ref = ref;
runloop.addUnresolved( mustache );
}
}
// if it's an expression, we have a bit more work to do
if ( options.template.x ) {
mustache.resolver = new ExpressionResolver( mustache, parentFragment, options.template.x, resolveAndRebindChildren );
}
if ( options.template.rx ) {
mustache.resolver = new ReferenceExpressionResolver( mustache, options.template.rx, resolveAndRebindChildren );
}
// Special case - inverted sections
if ( mustache.template.n === types.SECTION_UNLESS && !mustache.hasOwnProperty( 'value' ) ) {
mustache.setValue( undefined );
}
function resolveAndRebindChildren( newKeypath ) {
var oldKeypath = mustache.keypath;
if ( newKeypath !== oldKeypath ) {
mustache.resolve( newKeypath );
if ( oldKeypath !== undefined ) {
mustache.fragments && mustache.fragments.forEach( function( f ) {
f.rebind( null, null, oldKeypath, newKeypath );
} );
}
}
}
};
}( types, runloop, resolveRef, ReferenceExpressionResolver, ExpressionResolver );
/* virtualdom/items/shared/Mustache/resolve.js */
var resolve = function Mustache$resolve( keypath ) {
var wasResolved, value, twowayBinding;
// If we resolved previously, we need to unregister
if ( this.keypath !== undefined ) {
this.root.viewmodel.unregister( this.keypath, this );
wasResolved = true;
}
this.keypath = keypath;
// If the new keypath exists, we need to register
// with the viewmodel
if ( keypath !== undefined ) {
value = this.root.viewmodel.get( keypath );
this.root.viewmodel.register( keypath, this );
}
// Either way we need to queue up a render (`value`
// will be `undefined` if there's no keypath)
this.setValue( value );
// Two-way bindings need to point to their new target keypath
if ( wasResolved && ( twowayBinding = this.twowayBinding ) ) {
twowayBinding.rebound();
}
};
/* virtualdom/items/shared/Mustache/rebind.js */
var rebind = function( getNewKeypath ) {
return function Mustache$rebind( indexRef, newIndex, oldKeypath, newKeypath ) {
var keypath;
// Children first
if ( this.fragments ) {
this.fragments.forEach( function( f ) {
return f.rebind( indexRef, newIndex, oldKeypath, newKeypath );
} );
}
// Expression mustache?
if ( this.resolver ) {
this.resolver.rebind( indexRef, newIndex, oldKeypath, newKeypath );
}
// Normal keypath mustache or reference expression?
if ( this.keypath ) {
// was a new keypath created?
if ( keypath = getNewKeypath( this.keypath, oldKeypath, newKeypath ) ) {
// resolve it
this.resolve( keypath );
}
} else if ( indexRef !== undefined && this.indexRef === indexRef ) {
this.setValue( newIndex );
}
};
}( getNewKeypath );
/* virtualdom/items/shared/Mustache/_Mustache.js */
var Mustache = function( getValue, init, resolve, rebind ) {
return {
getValue: getValue,
init: init,
resolve: resolve,
rebind: rebind
};
}( getValue, initialise, resolve, rebind );
/* virtualdom/items/Interpolator.js */
var Interpolator = function( types, runloop, escapeHtml, detachNode, unbind, Mustache, detach ) {
var Interpolator = function( options ) {
this.type = types.INTERPOLATOR;
Mustache.init( this, options );
};
Interpolator.prototype = {
update: function() {
this.node.data = this.value == undefined ? '' : this.value;
},
resolve: Mustache.resolve,
rebind: Mustache.rebind,
detach: detach,
unbind: unbind,
render: function() {
if ( !this.node ) {
this.node = document.createTextNode( this.value != undefined ? this.value : '' );
}
return this.node;
},
unrender: function( shouldDestroy ) {
if ( shouldDestroy ) {
detachNode( this.node );
}
},
getValue: Mustache.getValue,
// TEMP
setValue: function( value ) {
var wrapper;
// TODO is there a better way to approach this?
if ( wrapper = this.root.viewmodel.wrapped[ this.keypath ] ) {
value = wrapper.get();
}
if ( value !== this.value ) {
this.value = value;
this.parentFragment.bubble();
if ( this.node ) {
runloop.addView( this );
}
}
},
firstNode: function() {
return this.node;
},
toString: function( escape ) {
var string = this.value != undefined ? '' + this.value : '';
return escape ? escapeHtml( string ) : string;
}
};
return Interpolator;
}( types, runloop, escapeHtml, detachNode, unbind, Mustache, detach );
/* virtualdom/items/Section/prototype/bubble.js */
var virtualdom_items_Section$bubble = function Section$bubble() {
this.parentFragment.bubble();
};
/* virtualdom/items/Section/prototype/detach.js */
var virtualdom_items_Section$detach = function Section$detach() {
var docFrag;
if ( this.fragments.length === 1 ) {
return this.fragments[ 0 ].detach();
}
docFrag = document.createDocumentFragment();
this.fragments.forEach( function( item ) {
docFrag.appendChild( item.detach() );
} );
return docFrag;
};
/* virtualdom/items/Section/prototype/find.js */
var virtualdom_items_Section$find = function Section$find( selector ) {
var i, len, queryResult;
len = this.fragments.length;
for ( i = 0; i < len; i += 1 ) {
if ( queryResult = this.fragments[ i ].find( selector ) ) {
return queryResult;
}
}
return null;
};
/* virtualdom/items/Section/prototype/findAll.js */
var virtualdom_items_Section$findAll = function Section$findAll( selector, query ) {
var i, len;
len = this.fragments.length;
for ( i = 0; i < len; i += 1 ) {
this.fragments[ i ].findAll( selector, query );
}
};
/* virtualdom/items/Section/prototype/findAllComponents.js */
var virtualdom_items_Section$findAllComponents = function Section$findAllComponents( selector, query ) {
var i, len;
len = this.fragments.length;
for ( i = 0; i < len; i += 1 ) {
this.fragments[ i ].findAllComponents( selector, query );
}
};
/* virtualdom/items/Section/prototype/findComponent.js */
var virtualdom_items_Section$findComponent = function Section$findComponent( selector ) {
var i, len, queryResult;
len = this.fragments.length;
for ( i = 0; i < len; i += 1 ) {
if ( queryResult = this.fragments[ i ].findComponent( selector ) ) {
return queryResult;
}
}
return null;
};
/* virtualdom/items/Section/prototype/findNextNode.js */
var virtualdom_items_Section$findNextNode = function Section$findNextNode( fragment ) {
if ( this.fragments[ fragment.index + 1 ] ) {
return this.fragments[ fragment.index + 1 ].firstNode();
}
return this.parentFragment.findNextNode( this );
};
/* virtualdom/items/Section/prototype/firstNode.js */
var virtualdom_items_Section$firstNode = function Section$firstNode() {
var len, i, node;
if ( len = this.fragments.length ) {
for ( i = 0; i < len; i += 1 ) {
if ( node = this.fragments[ i ].firstNode() ) {
return node;
}
}
}
return this.parentFragment.findNextNode( this );
};
/* virtualdom/items/Section/prototype/merge.js */
var virtualdom_items_Section$merge = function( runloop, circular ) {
var Fragment;
circular.push( function() {
Fragment = circular.Fragment;
} );
return function Section$merge( newIndices ) {
var section = this,
parentFragment, firstChange, i, newLength, reboundFragments, fragmentOptions, fragment, nextNode;
if ( this.unbound ) {
return;
}
parentFragment = this.parentFragment;
reboundFragments = [];
// first, rebind existing fragments
newIndices.forEach( function rebindIfNecessary( newIndex, oldIndex ) {
var fragment, by, oldKeypath, newKeypath;
if ( newIndex === oldIndex ) {
reboundFragments[ newIndex ] = section.fragments[ oldIndex ];
return;
}
fragment = section.fragments[ oldIndex ];
if ( firstChange === undefined ) {
firstChange = oldIndex;
}
// does this fragment need to be torn down?
if ( newIndex === -1 ) {
section.fragmentsToUnrender.push( fragment );
fragment.unbind();
return;
}
// Otherwise, it needs to be rebound to a new index
by = newIndex - oldIndex;
oldKeypath = section.keypath + '.' + oldIndex;
newKeypath = section.keypath + '.' + newIndex;
fragment.rebind( section.template.i, newIndex, oldKeypath, newKeypath );
reboundFragments[ newIndex ] = fragment;
} );
newLength = this.root.get( this.keypath ).length;
// If nothing changed with the existing fragments, then we start adding
// new fragments at the end...
if ( firstChange === undefined ) {
// ...unless there are no new fragments to add
if ( this.length === newLength ) {
return;
}
firstChange = this.length;
}
this.length = this.fragments.length = newLength;
runloop.addView( this );
// Prepare new fragment options
fragmentOptions = {
template: this.template.f,
root: this.root,
owner: this
};
if ( this.template.i ) {
fragmentOptions.indexRef = this.template.i;
}
// Add as many new fragments as we need to, or add back existing
// (detached) fragments
for ( i = firstChange; i < newLength; i += 1 ) {
// is this an existing fragment?
if ( fragment = reboundFragments[ i ] ) {
this.docFrag.appendChild( fragment.detach( false ) );
} else {
// Fragment will be created when changes are applied
// by the runloop
this.fragmentsToCreate.push( i );
}
this.fragments[ i ] = fragment;
}
// reinsert fragment
nextNode = parentFragment.findNextNode( this );
this.parentFragment.getNode().insertBefore( this.docFrag, nextNode );
};
}( runloop, circular );
/* virtualdom/items/Section/prototype/render.js */
var virtualdom_items_Section$render = function Section$render() {
var docFrag;
docFrag = this.docFrag = document.createDocumentFragment();
this.update();
this.rendered = true;
return docFrag;
};
/* virtualdom/items/Section/prototype/setValue.js */
var virtualdom_items_Section$setValue = function( types, isArray, isObject, runloop, circular ) {
var Fragment;
circular.push( function() {
Fragment = circular.Fragment;
} );
return function Section$setValue( value ) {
var this$0 = this;
var wrapper, fragmentOptions;
if ( this.updating ) {
// If a child of this section causes a re-evaluation - for example, an
// expression refers to a function that mutates the array that this
// section depends on - we'll end up with a double rendering bug (see
// https://github.com/ractivejs/ractive/issues/748). This prevents it.
return;
}
this.updating = true;
// with sections, we need to get the fake value if we have a wrapped object
if ( wrapper = this.root.viewmodel.wrapped[ this.keypath ] ) {
value = wrapper.get();
}
// If any fragments are awaiting creation after a splice,
// this is the place to do it
if ( this.fragmentsToCreate.length ) {
fragmentOptions = {
template: this.template.f,
root: this.root,
pElement: this.pElement,
owner: this,
indexRef: this.template.i
};
this.fragmentsToCreate.forEach( function( index ) {
var fragment;
fragmentOptions.context = this$0.keypath + '.' + index;
fragmentOptions.index = index;
fragment = new Fragment( fragmentOptions );
this$0.fragmentsToRender.push( this$0.fragments[ index ] = fragment );
} );
this.fragmentsToCreate.length = 0;
} else if ( reevaluateSection( this, value ) ) {
this.bubble();
if ( this.rendered ) {
runloop.addView( this );
}
}
this.value = value;
this.updating = false;
};
function reevaluateSection( section, value ) {
var fragmentOptions = {
template: section.template.f,
root: section.root,
pElement: section.parentFragment.pElement,
owner: section
};
// If we already know the section type, great
// TODO can this be optimised? i.e. pick an reevaluateSection function during init
// and avoid doing this each time?
if ( section.subtype ) {
switch ( section.subtype ) {
case types.SECTION_IF:
return reevaluateConditionalSection( section, value, false, fragmentOptions );
case types.SECTION_UNLESS:
return reevaluateConditionalSection( section, value, true, fragmentOptions );
case types.SECTION_WITH:
return reevaluateContextSection( section, fragmentOptions );
case types.SECTION_EACH:
if ( isObject( value ) ) {
return reevaluateListObjectSection( section, value, fragmentOptions );
}
}
}
// Otherwise we need to work out what sort of section we're dealing with
section.ordered = !!isArray( value );
// Ordered list section
if ( section.ordered ) {
return reevaluateListSection( section, value, fragmentOptions );
}
// Unordered list, or context
if ( isObject( value ) || typeof value === 'function' ) {
// Index reference indicates section should be treated as a list
if ( section.template.i ) {
return reevaluateListObjectSection( section, value, fragmentOptions );
}
// Otherwise, object provides context for contents
return reevaluateContextSection( section, fragmentOptions );
}
// Conditional section
return reevaluateConditionalSection( section, value, false, fragmentOptions );
}
function reevaluateListSection( section, value, fragmentOptions ) {
var i, length, fragment;
length = value.length;
if ( length === section.length ) {
// Nothing to do
return false;
}
// if the array is shorter than it was previously, remove items
if ( length < section.length ) {
section.fragmentsToUnrender = section.fragments.splice( length, section.length - length );
section.fragmentsToUnrender.forEach( unbind );
} else {
if ( length > section.length ) {
// add any new ones
for ( i = section.length; i < length; i += 1 ) {
// append list item to context stack
fragmentOptions.context = section.keypath + '.' + i;
fragmentOptions.index = i;
if ( section.template.i ) {
fragmentOptions.indexRef = section.template.i;
}
fragment = new Fragment( fragmentOptions );
section.fragmentsToRender.push( section.fragments[ i ] = fragment );
}
}
}
section.length = length;
return true;
}
function reevaluateListObjectSection( section, value, fragmentOptions ) {
var id, i, hasKey, fragment, changed;
hasKey = section.hasKey || ( section.hasKey = {} );
// remove any fragments that should no longer exist
i = section.fragments.length;
while ( i-- ) {
fragment = section.fragments[ i ];
if ( !( fragment.index in value ) ) {
changed = true;
fragment.unbind();
section.fragmentsToUnrender.push( fragment );
section.fragments.splice( i, 1 );
hasKey[ fragment.index ] = false;
}
}
// add any that haven't been created yet
for ( id in value ) {
if ( !hasKey[ id ] ) {
changed = true;
fragmentOptions.context = section.keypath + '.' + id;
fragmentOptions.index = id;
if ( section.template.i ) {
fragmentOptions.indexRef = section.template.i;
}
fragment = new Fragment( fragmentOptions );
section.fragmentsToRender.push( fragment );
section.fragments.push( fragment );
hasKey[ id ] = true;
}
}
section.length = section.fragments.length;
return changed;
}
function reevaluateContextSection( section, fragmentOptions ) {
var fragment;
// ...then if it isn't rendered, render it, adding section.keypath to the context stack
// (if it is already rendered, then any children dependent on the context stack
// will update themselves without any prompting)
if ( !section.length ) {
// append this section to the context stack
fragmentOptions.context = section.keypath;
fragmentOptions.index = 0;
fragment = new Fragment( fragmentOptions );
section.fragmentsToRender.push( section.fragments[ 0 ] = fragment );
section.length = 1;
return true;
}
}
function reevaluateConditionalSection( section, value, inverted, fragmentOptions ) {
var doRender, emptyArray, fragment;
emptyArray = isArray( value ) && value.length === 0;
if ( inverted ) {
doRender = emptyArray || !value;
} else {
doRender = value && !emptyArray;
}
if ( doRender ) {
if ( !section.length ) {
// no change to context stack
fragmentOptions.index = 0;
fragment = new Fragment( fragmentOptions );
section.fragmentsToRender.push( section.fragments[ 0 ] = fragment );
section.length = 1;
return true;
}
if ( section.length > 1 ) {
section.fragmentsToUnrender = section.fragments.splice( 1 );
section.fragmentsToUnrender.forEach( unbind );
return true;
}
} else if ( section.length ) {
section.fragmentsToUnrender = section.fragments.splice( 0, section.fragments.length );
section.fragmentsToUnrender.forEach( unbind );
section.length = 0;
return true;
}
}
function unbind( fragment ) {
fragment.unbind();
}
}( types, isArray, isObject, runloop, circular );
/* virtualdom/items/Section/prototype/splice.js */
var virtualdom_items_Section$splice = function( runloop, circular ) {
var Fragment;
circular.push( function() {
Fragment = circular.Fragment;
} );
return function Section$splice( spliceSummary ) {
var section = this,
balance, start, insertStart, insertEnd, spliceArgs;
// In rare cases, a section will receive a splice instruction after it has
// been unbound (see https://github.com/ractivejs/ractive/issues/967). This
// prevents errors arising from those situations
if ( this.unbound ) {
return;
}
balance = spliceSummary.balance;
if ( !balance ) {
// The array length hasn't changed - we don't need to add or remove anything
return;
}
// Register with the runloop, so we can (un)render with the
// next batch of DOM changes
runloop.addView( section );
start = spliceSummary.rangeStart;
section.length += balance;
// If more items were removed from the array than added, we tear down
// the excess fragments and remove them...
if ( balance < 0 ) {
section.fragmentsToUnrender = section.fragments.splice( start, -balance );
section.fragmentsToUnrender.forEach( unbind );
// Reassign fragments after the ones we've just removed
rebindFragments( section, start, section.length, balance );
// Nothing more to do
return;
}
// ...otherwise we need to add some things to the DOM.
insertStart = start + spliceSummary.removed;
insertEnd = start + spliceSummary.added;
// Make room for the new fragments by doing a splice that simulates
// what happened to the data array
spliceArgs = [
insertStart,
0
];
spliceArgs.length += balance;
section.fragments.splice.apply( section.fragments, spliceArgs );
// Rebind existing fragments at the end of the array
rebindFragments( section, insertEnd, section.length, balance );
// Schedule new fragments to be created
section.fragmentsToCreate = range( insertStart, insertEnd );
};
function unbind( fragment ) {
fragment.unbind();
}
function range( start, end ) {
var array = [],
i;
for ( i = start; i < end; i += 1 ) {
array.push( i );
}
return array;
}
function rebindFragments( section, start, end, by ) {
var i, fragment, indexRef, oldKeypath, newKeypath;
indexRef = section.template.i;
for ( i = start; i < end; i += 1 ) {
fragment = section.fragments[ i ];
oldKeypath = section.keypath + '.' + ( i - by );
newKeypath = section.keypath + '.' + i;
// change the fragment index
fragment.index = i;
fragment.rebind( indexRef, i, oldKeypath, newKeypath );
}
}
}( runloop, circular );
/* virtualdom/items/Section/prototype/toString.js */
var virtualdom_items_Section$toString = function Section$toString( escape ) {
var str, i, len;
str = '';
i = 0;
len = this.length;
for ( i = 0; i < len; i += 1 ) {
str += this.fragments[ i ].toString( escape );
}
return str;
};
/* virtualdom/items/Section/prototype/unbind.js */
var virtualdom_items_Section$unbind = function( unbind ) {
return function Section$unbind() {
this.fragments.forEach( unbindFragment );
unbind.call( this );
this.length = 0;
this.unbound = true;
};
function unbindFragment( fragment ) {
fragment.unbind();
}
}( unbind );
/* virtualdom/items/Section/prototype/unrender.js */
var virtualdom_items_Section$unrender = function() {
return function Section$unrender( shouldDestroy ) {
this.fragments.forEach( shouldDestroy ? unrenderAndDestroy : unrender );
};
function unrenderAndDestroy( fragment ) {
fragment.unrender( true );
}
function unrender( fragment ) {
fragment.unrender( false );
}
}();
/* virtualdom/items/Section/prototype/update.js */
var virtualdom_items_Section$update = function Section$update() {
var fragment, rendered, nextFragment, anchor, target;
while ( fragment = this.fragmentsToUnrender.pop() ) {
fragment.unrender( true );
}
// If we have no new nodes to insert (i.e. the section length stayed the
// same, or shrank), we don't need to go any further
if ( !this.fragmentsToRender.length ) {
return;
}
if ( this.rendered ) {
target = this.parentFragment.getNode();
}
// Render new fragments to our docFrag
while ( fragment = this.fragmentsToRender.shift() ) {
rendered = fragment.render();
this.docFrag.appendChild( rendered );
// If this is an ordered list, and it's already rendered, we may
// need to insert content into the appropriate place
if ( this.rendered && this.ordered ) {
// If the next fragment is already rendered, use it as an anchor...
nextFragment = this.fragments[ fragment.index + 1 ];
if ( nextFragment && nextFragment.rendered ) {
target.insertBefore( this.docFrag, nextFragment.firstNode() || null );
}
}
}
if ( this.rendered && this.docFrag.childNodes.length ) {
anchor = this.parentFragment.findNextNode( this );
target.insertBefore( this.docFrag, anchor );
}
};
/* virtualdom/items/Section/_Section.js */
var Section = function( types, Mustache, bubble, detach, find, findAll, findAllComponents, findComponent, findNextNode, firstNode, merge, render, setValue, splice, toString, unbind, unrender, update ) {
var Section = function( options ) {
this.type = types.SECTION;
this.subtype = options.template.n;
this.inverted = this.subtype === types.SECTION_UNLESS;
this.pElement = options.pElement;
this.fragments = [];
this.fragmentsToCreate = [];
this.fragmentsToRender = [];
this.fragmentsToUnrender = [];
this.length = 0;
// number of times this section is rendered
Mustache.init( this, options );
};
Section.prototype = {
bubble: bubble,
detach: detach,
find: find,
findAll: findAll,
findAllComponents: findAllComponents,
findComponent: findComponent,
findNextNode: findNextNode,
firstNode: firstNode,
getValue: Mustache.getValue,
merge: merge,
rebind: Mustache.rebind,
render: render,
resolve: Mustache.resolve,
setValue: setValue,
splice: splice,
toString: toString,
unbind: unbind,
unrender: unrender,
update: update
};
return Section;
}( types, Mustache, virtualdom_items_Section$bubble, virtualdom_items_Section$detach, virtualdom_items_Section$find, virtualdom_items_Section$findAll, virtualdom_items_Section$findAllComponents, virtualdom_items_Section$findComponent, virtualdom_items_Section$findNextNode, virtualdom_items_Section$firstNode, virtualdom_items_Section$merge, virtualdom_items_Section$render, virtualdom_items_Section$setValue, virtualdom_items_Section$splice, virtualdom_items_Section$toString, virtualdom_items_Section$unbind, virtualdom_items_Section$unrender, virtualdom_items_Section$update );
/* virtualdom/items/Triple/prototype/detach.js */
var virtualdom_items_Triple$detach = function Triple$detach() {
var len, i;
if ( this.docFrag ) {
len = this.nodes.length;
for ( i = 0; i < len; i += 1 ) {
this.docFrag.appendChild( this.nodes[ i ] );
}
return this.docFrag;
}
};
/* virtualdom/items/Triple/prototype/find.js */
var virtualdom_items_Triple$find = function( matches ) {
return function Triple$find( selector ) {
var i, len, node, queryResult;
len = this.nodes.length;
for ( i = 0; i < len; i += 1 ) {
node = this.nodes[ i ];
if ( node.nodeType !== 1 ) {
continue;
}
if ( matches( node, selector ) ) {
return node;
}
if ( queryResult = node.querySelector( selector ) ) {
return queryResult;
}
}
return null;
};
}( matches );
/* virtualdom/items/Triple/prototype/findAll.js */
var virtualdom_items_Triple$findAll = function( matches ) {
return function Triple$findAll( selector, queryResult ) {
var i, len, node, queryAllResult, numNodes, j;
len = this.nodes.length;
for ( i = 0; i < len; i += 1 ) {
node = this.nodes[ i ];
if ( node.nodeType !== 1 ) {
continue;
}
if ( matches( node, selector ) ) {
queryResult.push( node );
}
if ( queryAllResult = node.querySelectorAll( selector ) ) {
numNodes = queryAllResult.length;
for ( j = 0; j < numNodes; j += 1 ) {
queryResult.push( queryAllResult[ j ] );
}
}
}
};
}( matches );
/* virtualdom/items/Triple/prototype/firstNode.js */
var virtualdom_items_Triple$firstNode = function Triple$firstNode() {
if ( this.rendered && this.nodes[ 0 ] ) {
return this.nodes[ 0 ];
}
return this.parentFragment.findNextNode( this );
};
/* virtualdom/items/Triple/helpers/insertHtml.js */
var insertHtml = function( namespaces, createElement ) {
var elementCache = {},
ieBug, ieBlacklist;
try {
createElement( 'table' ).innerHTML = 'foo';
} catch ( err ) {
ieBug = true;
ieBlacklist = {
TABLE: [
'<table class="x">',
'</table>'
],
THEAD: [
'<table><thead class="x">',
'</thead></table>'
],
TBODY: [
'<table><tbody class="x">',
'</tbody></table>'
],
TR: [
'<table><tr class="x">',
'</tr></table>'
],
SELECT: [
'<select class="x">',
'</select>'
]
};
}
return function( html, node, docFrag ) {
var container, nodes = [],
wrapper, selectedOption, child, i;
if ( html ) {
if ( ieBug && ( wrapper = ieBlacklist[ node.tagName ] ) ) {
container = element( 'DIV' );
container.innerHTML = wrapper[ 0 ] + html + wrapper[ 1 ];
container = container.querySelector( '.x' );
if ( container.tagName === 'SELECT' ) {
selectedOption = container.options[ container.selectedIndex ];
}
} else if ( node.namespaceURI === namespaces.svg ) {
container = element( 'DIV' );
container.innerHTML = '<svg class="x">' + html + '</svg>';
container = container.querySelector( '.x' );
} else {
container = element( node.tagName );
container.innerHTML = html;
}
while ( child = container.firstChild ) {
nodes.push( child );
docFrag.appendChild( child );
}
// This is really annoying. Extracting <option> nodes from the
// temporary container <select> causes the remaining ones to
// become selected. So now we have to deselect them. IE8, you
// amaze me. You really do
if ( ieBug && node.tagName === 'SELECT' ) {
i = nodes.length;
while ( i-- ) {
if ( nodes[ i ] !== selectedOption ) {
nodes[ i ].selected = false;
}
}
}
}
return nodes;
};
function element( tagName ) {
return elementCache[ tagName ] || ( elementCache[ tagName ] = createElement( tagName ) );
}
}( namespaces, createElement );
/* utils/toArray.js */
var toArray = function toArray( arrayLike ) {
var array = [],
i = arrayLike.length;
while ( i-- ) {
array[ i ] = arrayLike[ i ];
}
return array;
};
/* virtualdom/items/Triple/helpers/updateSelect.js */
var updateSelect = function( toArray ) {
return function updateSelect( parentElement ) {
var selectedOptions, option, value;
if ( !parentElement || parentElement.name !== 'select' || !parentElement.binding ) {
return;
}
selectedOptions = toArray( parentElement.node.options ).filter( isSelected );
// If one of them had a `selected` attribute, we need to sync
// the model to the view
if ( parentElement.getAttribute( 'multiple' ) ) {
value = selectedOptions.map( function( o ) {
return o.value;
} );
} else if ( option = selectedOptions[ 0 ] ) {
value = option.value;
}
if ( value !== undefined ) {
parentElement.binding.setValue( value );
}
parentElement.bubble();
};
function isSelected( option ) {
return option.selected;
}
}( toArray );
/* virtualdom/items/Triple/prototype/render.js */
var virtualdom_items_Triple$render = function( insertHtml, updateSelect ) {
return function Triple$render() {
if ( this.rendered ) {
throw new Error( 'Attempted to render an item that was already rendered' );
}
this.docFrag = document.createDocumentFragment();
this.nodes = insertHtml( this.value, this.parentFragment.getNode(), this.docFrag );
// Special case - we're inserting the contents of a <select>
updateSelect( this.pElement );
this.rendered = true;
return this.docFrag;
};
}( insertHtml, updateSelect );
/* virtualdom/items/Triple/prototype/setValue.js */
var virtualdom_items_Triple$setValue = function( runloop ) {
return function Triple$setValue( value ) {
var wrapper;
// TODO is there a better way to approach this?
if ( wrapper = this.root.viewmodel.wrapped[ this.keypath ] ) {
value = wrapper.get();
}
if ( value !== this.value ) {
this.value = value;
this.parentFragment.bubble();
if ( this.rendered ) {
runloop.addView( this );
}
}
};
}( runloop );
/* virtualdom/items/Triple/prototype/toString.js */
var virtualdom_items_Triple$toString = function Triple$toString() {
return this.value != undefined ? this.value : '';
};
/* virtualdom/items/Triple/prototype/unrender.js */
var virtualdom_items_Triple$unrender = function( detachNode ) {
return function Triple$unrender( shouldDestroy ) {
if ( this.rendered && shouldDestroy ) {
this.nodes.forEach( detachNode );
this.rendered = false;
}
};
}( detachNode );
/* virtualdom/items/Triple/prototype/update.js */
var virtualdom_items_Triple$update = function( insertHtml, updateSelect ) {
return function Triple$update() {
var node, parentNode;
if ( !this.rendered ) {
return;
}
// Remove existing nodes
while ( this.nodes && this.nodes.length ) {
node = this.nodes.pop();
node.parentNode.removeChild( node );
}
// Insert new nodes
parentNode = this.parentFragment.getNode();
this.nodes = insertHtml( this.value, parentNode, this.docFrag );
parentNode.insertBefore( this.docFrag, this.parentFragment.findNextNode( this ) );
// Special case - we're inserting the contents of a <select>
updateSelect( this.pElement );
};
}( insertHtml, updateSelect );
/* virtualdom/items/Triple/_Triple.js */
var Triple = function( types, Mustache, detach, find, findAll, firstNode, render, setValue, toString, unrender, update, unbind ) {
var Triple = function( options ) {
this.type = types.TRIPLE;
Mustache.init( this, options );
};
Triple.prototype = {
detach: detach,
find: find,
findAll: findAll,
firstNode: firstNode,
getValue: Mustache.getValue,
rebind: Mustache.rebind,
render: render,
resolve: Mustache.resolve,
setValue: setValue,
toString: toString,
unbind: unbind,
unrender: unrender,
update: update
};
return Triple;
}( types, Mustache, virtualdom_items_Triple$detach, virtualdom_items_Triple$find, virtualdom_items_Triple$findAll, virtualdom_items_Triple$firstNode, virtualdom_items_Triple$render, virtualdom_items_Triple$setValue, virtualdom_items_Triple$toString, virtualdom_items_Triple$unrender, virtualdom_items_Triple$update, unbind );
/* virtualdom/items/Element/prototype/bubble.js */
var virtualdom_items_Element$bubble = function() {
this.parentFragment.bubble();
};
/* virtualdom/items/Element/prototype/detach.js */
var virtualdom_items_Element$detach = function Element$detach() {
var node = this.node,
parentNode;
if ( node ) {
// need to check for parent node - DOM may have been altered
// by something other than Ractive! e.g. jQuery UI...
if ( parentNode = node.parentNode ) {
parentNode.removeChild( node );
}
return node;
}
};
/* virtualdom/items/Element/prototype/find.js */
var virtualdom_items_Element$find = function( matches ) {
return function( selector ) {
if ( matches( this.node, selector ) ) {
return this.node;
}
if ( this.fragment && this.fragment.find ) {
return this.fragment.find( selector );
}
};
}( matches );
/* virtualdom/items/Element/prototype/findAll.js */
var virtualdom_items_Element$findAll = function( selector, query ) {
// Add this node to the query, if applicable, and register the
// query on this element
if ( query._test( this, true ) && query.live ) {
( this.liveQueries || ( this.liveQueries = [] ) ).push( query );
}
if ( this.fragment ) {
this.fragment.findAll( selector, query );
}
};
/* virtualdom/items/Element/prototype/findAllComponents.js */
var virtualdom_items_Element$findAllComponents = function( selector, query ) {
if ( this.fragment ) {
this.fragment.findAllComponents( selector, query );
}
};
/* virtualdom/items/Element/prototype/findComponent.js */
var virtualdom_items_Element$findComponent = function( selector ) {
if ( this.fragment ) {
return this.fragment.findComponent( selector );
}
};
/* virtualdom/items/Element/prototype/findNextNode.js */
var virtualdom_items_Element$findNextNode = function Element$findNextNode() {
return null;
};
/* virtualdom/items/Element/prototype/firstNode.js */
var virtualdom_items_Element$firstNode = function Element$firstNode() {
return this.node;
};
/* virtualdom/items/Element/prototype/getAttribute.js */
var virtualdom_items_Element$getAttribute = function Element$getAttribute( name ) {
if ( !this.attributes || !this.attributes[ name ] ) {
return;
}
return this.attributes[ name ].value;
};
/* virtualdom/items/Element/shared/enforceCase.js */
var enforceCase = function() {
var svgCamelCaseElements, svgCamelCaseAttributes, createMap, map;
svgCamelCaseElements = 'altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath vkern'.split( ' ' );
svgCamelCaseAttributes = 'attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits contentScriptType contentStyleType diffuseConstant edgeMode externalResourcesRequired filterRes filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan'.split( ' ' );
createMap = function( items ) {
var map = {},
i = items.length;
while ( i-- ) {
map[ items[ i ].toLowerCase() ] = items[ i ];
}
return map;
};
map = createMap( svgCamelCaseElements.concat( svgCamelCaseAttributes ) );
return function( elementName ) {
var lowerCaseElementName = elementName.toLowerCase();
return map[ lowerCaseElementName ] || lowerCaseElementName;
};
}();
/* virtualdom/items/Element/Attribute/prototype/bubble.js */
var virtualdom_items_Element_Attribute$bubble = function( runloop ) {
return function Attribute$bubble() {
var value = this.fragment.getValue();
// TODO this can register the attribute multiple times (see render test
// 'Attribute with nested mustaches')
if ( value !== this.value ) {
this.value = value;
if ( this.name === 'value' && this.node ) {
// We need to store the value on the DOM like this so we
// can retrieve it later without it being coerced to a string
this.node._ractive.value = value;
}
if ( this.rendered ) {
runloop.addView( this );
}
}
};
}( runloop );
/* virtualdom/items/Element/Attribute/helpers/determineNameAndNamespace.js */
var determineNameAndNamespace = function( namespaces, enforceCase ) {
return function( attribute, name ) {
var colonIndex, namespacePrefix;
// are we dealing with a namespaced attribute, e.g. xlink:href?
colonIndex = name.indexOf( ':' );
if ( colonIndex !== -1 ) {
// looks like we are, yes...
namespacePrefix = name.substr( 0, colonIndex );
// ...unless it's a namespace *declaration*, which we ignore (on the assumption
// that only valid namespaces will be used)
if ( namespacePrefix !== 'xmlns' ) {
name = name.substring( colonIndex + 1 );
attribute.name = enforceCase( name );
attribute.namespace = namespaces[ namespacePrefix.toLowerCase() ];
if ( !attribute.namespace ) {
throw 'Unknown namespace ("' + namespacePrefix + '")';
}
return;
}
}
// SVG attribute names are case sensitive
attribute.name = attribute.element.namespace !== namespaces.html ? enforceCase( name ) : name;
};
}( namespaces, enforceCase );
/* virtualdom/items/Element/Attribute/helpers/getInterpolator.js */
var getInterpolator = function( types ) {
return function getInterpolator( attribute ) {
var items = attribute.fragment.items;
if ( items.length !== 1 ) {
return;
}
if ( items[ 0 ].type === types.INTERPOLATOR ) {
return items[ 0 ];
}
};
}( types );
/* virtualdom/items/Element/Attribute/helpers/determinePropertyName.js */
var determinePropertyName = function( namespaces ) {
// the property name equivalents for element attributes, where they differ
// from the lowercased attribute name
var propertyNames = {
'accept-charset': 'acceptCharset',
accesskey: 'accessKey',
bgcolor: 'bgColor',
'class': 'className',
codebase: 'codeBase',
colspan: 'colSpan',
contenteditable: 'contentEditable',
datetime: 'dateTime',
dirname: 'dirName',
'for': 'htmlFor',
'http-equiv': 'httpEquiv',
ismap: 'isMap',
maxlength: 'maxLength',
novalidate: 'noValidate',
pubdate: 'pubDate',
readonly: 'readOnly',
rowspan: 'rowSpan',
tabindex: 'tabIndex',
usemap: 'useMap'
};
return function( attribute, options ) {
var propertyName;
if ( attribute.pNode && !attribute.namespace && ( !options.pNode.namespaceURI || options.pNode.namespaceURI === namespaces.html ) ) {
propertyName = propertyNames[ attribute.name ] || attribute.name;
if ( options.pNode[ propertyName ] !== undefined ) {
attribute.propertyName = propertyName;
}
// is attribute a boolean attribute or 'value'? If so we're better off doing e.g.
// node.selected = true rather than node.setAttribute( 'selected', '' )
if ( typeof options.pNode[ propertyName ] === 'boolean' || propertyName === 'value' ) {
attribute.useProperty = true;
}
}
};
}( namespaces );
/* virtualdom/items/Element/Attribute/prototype/init.js */
var virtualdom_items_Element_Attribute$init = function( types, determineNameAndNamespace, getInterpolator, determinePropertyName, circular ) {
var Fragment;
circular.push( function() {
Fragment = circular.Fragment;
} );
return function Attribute$init( options ) {
this.type = types.ATTRIBUTE;
this.element = options.element;
this.root = options.root;
determineNameAndNamespace( this, options.name );
// if it's an empty attribute, or just a straight key-value pair, with no
// mustache shenanigans, set the attribute accordingly and go home
if ( !options.value || typeof options.value === 'string' ) {
this.value = options.value || true;
return;
}
// otherwise we need to do some work
// share parentFragment with parent element
this.parentFragment = this.element.parentFragment;
this.fragment = new Fragment( {
template: options.value,
root: this.root,
owner: this
} );
this.value = this.fragment.getValue();
// Store a reference to this attribute's interpolator, if its fragment
// takes the form `{{foo}}`. This is necessary for two-way binding and
// for correctly rendering HTML later
this.interpolator = getInterpolator( this );
this.isBindable = !!this.interpolator;
// can we establish this attribute's property name equivalent?
determinePropertyName( this, options );
// mark as ready
this.ready = true;
};
}( types, determineNameAndNamespace, getInterpolator, determinePropertyName, circular );
/* virtualdom/items/Element/Attribute/prototype/rebind.js */
var virtualdom_items_Element_Attribute$rebind = function Attribute$rebind( indexRef, newIndex, oldKeypath, newKeypath ) {
if ( this.fragment ) {
this.fragment.rebind( indexRef, newIndex, oldKeypath, newKeypath );
}
};
/* virtualdom/items/Element/Attribute/prototype/render.js */
var virtualdom_items_Element_Attribute$render = function( namespaces ) {
// the property name equivalents for element attributes, where they differ
// from the lowercased attribute name
var propertyNames = {
'accept-charset': 'acceptCharset',
'accesskey': 'accessKey',
'bgcolor': 'bgColor',
'class': 'className',
'codebase': 'codeBase',
'colspan': 'colSpan',
'contenteditable': 'contentEditable',
'datetime': 'dateTime',
'dirname': 'dirName',
'for': 'htmlFor',
'http-equiv': 'httpEquiv',
'ismap': 'isMap',
'maxlength': 'maxLength',
'novalidate': 'noValidate',
'pubdate': 'pubDate',
'readonly': 'readOnly',
'rowspan': 'rowSpan',
'tabindex': 'tabIndex',
'usemap': 'useMap'
};
return function Attribute$render( node ) {
var propertyName;
this.node = node;
// should we use direct property access, or setAttribute?
if ( !node.namespaceURI || node.namespaceURI === namespaces.html ) {
propertyName = propertyNames[ this.name ] || this.name;
if ( node[ propertyName ] !== undefined ) {
this.propertyName = propertyName;
}
// is attribute a boolean attribute or 'value'? If so we're better off doing e.g.
// node.selected = true rather than node.setAttribute( 'selected', '' )
if ( typeof node[ propertyName ] === 'boolean' || propertyName === 'value' ) {
this.useProperty = true;
}
if ( propertyName === 'value' ) {
this.useProperty = true;
node._ractive.value = this.value;
}
}
this.rendered = true;
this.update();
};
}( namespaces );
/* virtualdom/items/Element/Attribute/prototype/toString.js */
var virtualdom_items_Element_Attribute$toString = function() {
return function Attribute$toString() {
var name, value, interpolator;
name = this.name;
value = this.value;
// Special case - select values (should not be stringified)
if ( name === 'value' && this.element.name === 'select' ) {
return;
}
// Special case - radio names
if ( name === 'name' && this.element.name === 'input' && ( interpolator = this.interpolator ) ) {
return 'name={{' + ( interpolator.keypath || interpolator.ref ) + '}}';
}
// Numbers
if ( typeof value === 'number' ) {
return name + '="' + value + '"';
}
// Strings
if ( typeof value === 'string' ) {
return name + '="' + escape( value ) + '"';
}
// Everything else
return value ? name : '';
};
function escape( value ) {
return value.replace( /&/g, '&' ).replace( /"/g, '"' ).replace( /'/g, ''' );
}
}();
/* virtualdom/items/Element/Attribute/prototype/unbind.js */
var virtualdom_items_Element_Attribute$unbind = function Attribute$unbind() {
// ignore non-dynamic attributes
if ( this.fragment ) {
this.fragment.unbind();
}
};
/* virtualdom/items/Element/Attribute/prototype/update/updateSelectValue.js */
var virtualdom_items_Element_Attribute$update_updateSelectValue = function Attribute$updateSelect() {
var value = this.value,
options, option, optionValue, i;
if ( !this.locked ) {
this.node._ractive.value = value;
options = this.node.options;
i = options.length;
while ( i-- ) {
option = options[ i ];
optionValue = option._ractive ? option._ractive.value : option.value;
// options inserted via a triple don't have _ractive
if ( optionValue == value ) {
// double equals as we may be comparing numbers with strings
option.selected = true;
break;
}
}
}
};
/* virtualdom/items/Element/Attribute/prototype/update/updateMultipleSelectValue.js */
var virtualdom_items_Element_Attribute$update_updateMultipleSelectValue = function( isArray ) {
return function Attribute$updateMultipleSelect() {
var value = this.value,
options, i, option, optionValue;
if ( !isArray( value ) ) {
value = [ value ];
}
options = this.node.options;
i = options.length;
while ( i-- ) {
option = options[ i ];
optionValue = option._ractive ? option._ractive.value : option.value;
// options inserted via a triple don't have _ractive
option.selected = value.indexOf( optionValue ) !== -1;
}
};
}( isArray );
/* virtualdom/items/Element/Attribute/prototype/update/updateRadioName.js */
var virtualdom_items_Element_Attribute$update_updateRadioName = function Attribute$updateRadioName() {
var node = ( value = this ).node,
value = value.value;
node.checked = value == node._ractive.value;
};
/* virtualdom/items/Element/Attribute/prototype/update/updateRadioValue.js */
var virtualdom_items_Element_Attribute$update_updateRadioValue = function( runloop ) {
return function Attribute$updateRadioValue() {
var wasChecked, node = this.node,
binding, bindings, i;
wasChecked = node.checked;
node.value = this.element.getAttribute( 'value' );
node.checked = this.element.getAttribute( 'value' ) === this.element.getAttribute( 'name' );
// This is a special case - if the input was checked, and the value
// changed so that it's no longer checked, the twoway binding is
// most likely out of date. To fix it we have to jump through some
// hoops... this is a little kludgy but it works
if ( wasChecked && !node.checked && this.element.binding ) {
bindings = this.element.binding.siblings;
if ( i = bindings.length ) {
while ( i-- ) {
binding = bindings[ i ];
if ( !binding.element.node ) {
// this is the initial render, siblings are still rendering!
// we'll come back later...
return;
}
if ( binding.element.node.checked ) {
runloop.addViewmodel( binding.root.viewmodel );
return binding.handleChange();
}
}
runloop.addViewmodel( binding.root.viewmodel );
this.root.viewmodel.set( binding.keypath, undefined );
}
}
};
}( runloop );
/* virtualdom/items/Element/Attribute/prototype/update/updateCheckboxName.js */
var virtualdom_items_Element_Attribute$update_updateCheckboxName = function( isArray ) {
return function Attribute$updateCheckboxName() {
var node, value;
node = this.node;
value = this.value;
if ( !isArray( value ) ) {
node.checked = value == node._ractive.value;
} else {
node.checked = value.indexOf( node._ractive.value ) !== -1;
}
};
}( isArray );
/* virtualdom/items/Element/Attribute/prototype/update/updateClassName.js */
var virtualdom_items_Element_Attribute$update_updateClassName = function Attribute$updateClassName() {
var node, value;
node = this.node;
value = this.value;
if ( value === undefined ) {
value = '';
}
node.className = value;
};
/* virtualdom/items/Element/Attribute/prototype/update/updateIdAttribute.js */
var virtualdom_items_Element_Attribute$update_updateIdAttribute = function Attribute$updateIdAttribute() {
var node, value;
node = this.node;
value = this.value;
if ( value !== undefined ) {
this.root.nodes[ value ] = undefined;
}
this.root.nodes[ value ] = node;
node.id = value;
};
/* virtualdom/items/Element/Attribute/prototype/update/updateIEStyleAttribute.js */
var virtualdom_items_Element_Attribute$update_updateIEStyleAttribute = function Attribute$updateIEStyleAttribute() {
var node, value;
node = this.node;
value = this.value;
if ( value === undefined ) {
value = '';
}
node.style.setAttribute( 'cssText', value );
};
/* virtualdom/items/Element/Attribute/prototype/update/updateContentEditableValue.js */
var virtualdom_items_Element_Attribute$update_updateContentEditableValue = function Attribute$updateContentEditableValue() {
var node, value;
node = this.node;
value = this.value;
if ( value === undefined ) {
value = '';
}
if ( !this.locked ) {
node.innerHTML = value;
}
};
/* virtualdom/items/Element/Attribute/prototype/update/updateValue.js */
var virtualdom_items_Element_Attribute$update_updateValue = function Attribute$updateValue() {
var node, value;
node = this.node;
value = this.value;
// store actual value, so it doesn't get coerced to a string
node._ractive.value = value;
// with two-way binding, only update if the change wasn't initiated by the user
// otherwise the cursor will often be sent to the wrong place
if ( !this.locked ) {
node.value = value == undefined ? '' : value;
}
};
/* virtualdom/items/Element/Attribute/prototype/update/updateBoolean.js */
var virtualdom_items_Element_Attribute$update_updateBoolean = function Attribute$updateBooleanAttribute() {
// with two-way binding, only update if the change wasn't initiated by the user
// otherwise the cursor will often be sent to the wrong place
if ( !this.locked ) {
this.node[ this.propertyName ] = this.value;
}
};
/* virtualdom/items/Element/Attribute/prototype/update/updateEverythingElse.js */
var virtualdom_items_Element_Attribute$update_updateEverythingElse = function Attribute$updateEverythingElse() {
var node, name, value;
node = this.node;
name = this.name;
value = this.value;
if ( this.namespace ) {
node.setAttributeNS( this.namespace, name, value );
} else if ( typeof value === 'string' || typeof value === 'number' ) {
node.setAttribute( name, value );
} else {
if ( value ) {
node.setAttribute( name, '' );
} else {
node.removeAttribute( name );
}
}
};
/* virtualdom/items/Element/Attribute/prototype/update.js */
var virtualdom_items_Element_Attribute$update = function( namespaces, noop, updateSelectValue, updateMultipleSelectValue, updateRadioName, updateRadioValue, updateCheckboxName, updateClassName, updateIdAttribute, updateIEStyleAttribute, updateContentEditableValue, updateValue, updateBoolean, updateEverythingElse ) {
// There are a few special cases when it comes to updating attributes. For this reason,
// the prototype .update() method points to this method, which waits until the
// attribute has finished initialising, then replaces the prototype method with a more
// suitable one. That way, we save ourselves doing a bunch of tests on each call
return function Attribute$update() {
var name, element, node, type, updateMethod;
name = this.name;
element = this.element;
node = this.node;
if ( name === 'id' ) {
updateMethod = updateIdAttribute;
} else if ( name === 'value' ) {
// special case - selects
if ( element.name === 'select' && name === 'value' ) {
updateMethod = node.multiple ? updateMultipleSelectValue : updateSelectValue;
} else if ( element.name === 'textarea' ) {
updateMethod = updateValue;
} else if ( node.getAttribute( 'contenteditable' ) ) {
updateMethod = updateContentEditableValue;
} else if ( element.name === 'input' ) {
type = element.getAttribute( 'type' );
// type='file' value='{{fileList}}'>
if ( type === 'file' ) {
updateMethod = noop;
} else if ( type === 'radio' && element.binding && element.binding.name === 'name' ) {
updateMethod = updateRadioValue;
} else {
updateMethod = updateValue;
}
}
} else if ( this.twoway && name === 'name' ) {
if ( node.type === 'radio' ) {
updateMethod = updateRadioName;
} else if ( node.type === 'checkbox' ) {
updateMethod = updateCheckboxName;
}
} else if ( name === 'style' && node.style.setAttribute ) {
updateMethod = updateIEStyleAttribute;
} else if ( name === 'class' && ( !node.namespaceURI || node.namespaceURI === namespaces.html ) ) {
updateMethod = updateClassName;
} else if ( this.useProperty ) {
updateMethod = updateBoolean;
}
if ( !updateMethod ) {
updateMethod = updateEverythingElse;
}
this.update = updateMethod;
this.update();
};
}( namespaces, noop, virtualdom_items_Element_Attribute$update_updateSelectValue, virtualdom_items_Element_Attribute$update_updateMultipleSelectValue, virtualdom_items_Element_Attribute$update_updateRadioName, virtualdom_items_Element_Attribute$update_updateRadioValue, virtualdom_items_Element_Attribute$update_updateCheckboxName, virtualdom_items_Element_Attribute$update_updateClassName, virtualdom_items_Element_Attribute$update_updateIdAttribute, virtualdom_items_Element_Attribute$update_updateIEStyleAttribute, virtualdom_items_Element_Attribute$update_updateContentEditableValue, virtualdom_items_Element_Attribute$update_updateValue, virtualdom_items_Element_Attribute$update_updateBoolean, virtualdom_items_Element_Attribute$update_updateEverythingElse );
/* virtualdom/items/Element/Attribute/_Attribute.js */
var Attribute = function( bubble, init, rebind, render, toString, unbind, update ) {
var Attribute = function( options ) {
this.init( options );
};
Attribute.prototype = {
bubble: bubble,
init: init,
rebind: rebind,
render: render,
toString: toString,
unbind: unbind,
update: update
};
return Attribute;
}( virtualdom_items_Element_Attribute$bubble, virtualdom_items_Element_Attribute$init, virtualdom_items_Element_Attribute$rebind, virtualdom_items_Element_Attribute$render, virtualdom_items_Element_Attribute$toString, virtualdom_items_Element_Attribute$unbind, virtualdom_items_Element_Attribute$update );
/* virtualdom/items/Element/prototype/init/createAttributes.js */
var virtualdom_items_Element$init_createAttributes = function( Attribute ) {
return function( element, attributes ) {
var name, attribute, result = [];
for ( name in attributes ) {
if ( attributes.hasOwnProperty( name ) ) {
attribute = new Attribute( {
element: element,
name: name,
value: attributes[ name ],
root: element.root
} );
result.push( result[ name ] = attribute );
}
}
return result;
};
}( Attribute );
/* utils/extend.js */
var extend = function( target ) {
var SLICE$0 = Array.prototype.slice;
var sources = SLICE$0.call( arguments, 1 );
var prop, source;
while ( source = sources.shift() ) {
for ( prop in source ) {
if ( source.hasOwnProperty( prop ) ) {
target[ prop ] = source[ prop ];
}
}
}
return target;
};
/* virtualdom/items/Element/Binding/Binding.js */
var Binding = function( runloop, warn, create, extend, removeFromArray ) {
var Binding = function( element ) {
var interpolator, keypath, value;
this.element = element;
this.root = element.root;
this.attribute = element.attributes[ this.name || 'value' ];
interpolator = this.attribute.interpolator;
interpolator.twowayBinding = this;
if ( interpolator.keypath && interpolator.keypath.substr === '${' ) {
warn( 'Two-way binding does not work with expressions: ' + interpolator.keypath );
return false;
}
// A mustache may be *ambiguous*. Let's say we were given
// `value="{{bar}}"`. If the context was `foo`, and `foo.bar`
// *wasn't* `undefined`, the keypath would be `foo.bar`.
// Then, any user input would result in `foo.bar` being updated.
//
// If, however, `foo.bar` *was* undefined, and so was `bar`, we would be
// left with an unresolved partial keypath - so we are forced to make an
// assumption. That assumption is that the input in question should
// be forced to resolve to `bar`, and any user input would affect `bar`
// and not `foo.bar`.
//
// Did that make any sense? No? Oh. Sorry. Well the moral of the story is
// be explicit when using two-way data-binding about what keypath you're
// updating. Using it in lists is probably a recipe for confusion...
if ( !interpolator.keypath ) {
if ( interpolator.ref ) {
interpolator.resolve( interpolator.ref );
}
// If we have a reference expression resolver, we have to force
// members to attach themselves to the root
if ( interpolator.resolver ) {
interpolator.resolver.forceResolution();
}
}
this.keypath = keypath = interpolator.keypath;
// initialise value, if it's undefined
if ( this.root.viewmodel.get( keypath ) === undefined && this.getInitialValue ) {
value = this.getInitialValue();
if ( value !== undefined ) {
this.root.viewmodel.set( keypath, value );
}
}
};
Binding.prototype = {
handleChange: function() {
var this$0 = this;
runloop.start( this.root );
this.attribute.locked = true;
this.root.viewmodel.set( this.keypath, this.getValue() );
runloop.scheduleTask( function() {
return this$0.attribute.locked = false;
} );
runloop.end();
},
rebound: function() {
var bindings, oldKeypath, newKeypath;
oldKeypath = this.keypath;
newKeypath = this.attribute.interpolator.keypath;
// The attribute this binding is linked to has already done the work
if ( oldKeypath === newKeypath ) {
return;
}
removeFromArray( this.root._twowayBindings[ oldKeypath ], this );
this.keypath = newKeypath;
bindings = this.root._twowayBindings[ newKeypath ] || ( this.root._twowayBindings[ newKeypath ] = [] );
bindings.push( this );
},
unbind: function() {}
};
Binding.extend = function( properties ) {
var Parent = this,
SpecialisedBinding;
SpecialisedBinding = function( element ) {
Binding.call( this, element );
if ( this.init ) {
this.init();
}
};
SpecialisedBinding.prototype = create( Parent.prototype );
extend( SpecialisedBinding.prototype, properties );
SpecialisedBinding.extend = Binding.extend;
return SpecialisedBinding;
};
return Binding;
}( runloop, warn, create, extend, removeFromArray );
/* virtualdom/items/Element/Binding/shared/handleDomEvent.js */
var handleDomEvent = function handleChange() {
this._ractive.binding.handleChange();
};
/* virtualdom/items/Element/Binding/ContentEditableBinding.js */
var ContentEditableBinding = function( Binding, handleDomEvent ) {
var ContentEditableBinding = Binding.extend( {
getInitialValue: function() {
return this.element.fragment ? this.element.fragment.toString() : '';
},
render: function() {
var node = this.element.node;
node.addEventListener( 'change', handleDomEvent, false );
if ( !this.root.lazy ) {
node.addEventListener( 'input', handleDomEvent, false );
if ( node.attachEvent ) {
node.addEventListener( 'keyup', handleDomEvent, false );
}
}
},
unrender: function() {
var node = this.element.node;
node.removeEventListener( 'change', handleDomEvent, false );
node.removeEventListener( 'input', handleDomEvent, false );
node.removeEventListener( 'keyup', handleDomEvent, false );
},
getValue: function() {
return this.element.node.innerHTML;
}
} );
return ContentEditableBinding;
}( Binding, handleDomEvent );
/* virtualdom/items/Element/Binding/shared/getSiblings.js */
var getSiblings = function() {
var sets = {};
return function getSiblings( id, group, keypath ) {
var hash = id + group + keypath;
return sets[ hash ] || ( sets[ hash ] = [] );
};
}();
/* virtualdom/items/Element/Binding/RadioBinding.js */
var RadioBinding = function( runloop, removeFromArray, Binding, getSiblings, handleDomEvent ) {
var RadioBinding = Binding.extend( {
name: 'checked',
init: function() {
this.siblings = getSiblings( this.root._guid, 'radio', this.element.getAttribute( 'name' ) );
this.siblings.push( this );
},
render: function() {
var node = this.element.node;
node.addEventListener( 'change', handleDomEvent, false );
if ( node.attachEvent ) {
node.addEventListener( 'click', handleDomEvent, false );
}
},
unrender: function() {
var node = this.element.node;
node.removeEventListener( 'change', handleDomEvent, false );
node.removeEventListener( 'click', handleDomEvent, false );
},
handleChange: function() {
runloop.start( this.root );
this.siblings.forEach( function( binding ) {
binding.root.viewmodel.set( binding.keypath, binding.getValue() );
} );
runloop.end();
},
getValue: function() {
return this.element.node.checked;
},
unbind: function() {
removeFromArray( this.siblings, this );
}
} );
return RadioBinding;
}( runloop, removeFromArray, Binding, getSiblings, handleDomEvent );
/* virtualdom/items/Element/Binding/RadioNameBinding.js */
var RadioNameBinding = function( removeFromArray, Binding, handleDomEvent, getSiblings ) {
var RadioNameBinding = Binding.extend( {
name: 'name',
init: function() {
this.siblings = getSiblings( this.root._guid, 'radioname', this.keypath );
this.siblings.push( this );
this.radioName = true;
// so that ractive.updateModel() knows what to do with this
this.attribute.twoway = true;
},
getInitialValue: function() {
if ( this.element.getAttribute( 'checked' ) ) {
return this.element.getAttribute( 'value' );
}
},
render: function() {
var node = this.element.node;
node.name = '{{' + this.keypath + '}}';
node.checked = this.root.viewmodel.get( this.keypath ) == this.element.getAttribute( 'value' );
node.addEventListener( 'change', handleDomEvent, false );
if ( node.attachEvent ) {
node.addEventListener( 'click', handleDomEvent, false );
}
},
unrender: function() {
var node = this.element.node;
node.removeEventListener( 'change', handleDomEvent, false );
node.removeEventListener( 'click', handleDomEvent, false );
},
getValue: function() {
var node = this.element.node;
return node._ractive ? node._ractive.value : node.value;
},
handleChange: function() {
// If this <input> is the one that's checked, then the value of its
// `name` keypath gets set to its value
if ( this.element.node.checked ) {
Binding.prototype.handleChange.call( this );
}
},
rebound: function( indexRef, newIndex, oldKeypath, newKeypath ) {
var node;
Binding.prototype.rebound.call( this, indexRef, newIndex, oldKeypath, newKeypath );
if ( node = this.element.node ) {
node.name = '{{' + this.keypath + '}}';
}
},
unbind: function() {
removeFromArray( this.siblings, this );
}
} );
return RadioNameBinding;
}( removeFromArray, Binding, handleDomEvent, getSiblings );
/* virtualdom/items/Element/Binding/CheckboxNameBinding.js */
var CheckboxNameBinding = function( isArray, removeFromArray, Binding, getSiblings, handleDomEvent ) {
var CheckboxNameBinding = Binding.extend( {
name: 'name',
getInitialValue: function() {
// This only gets called once per group (of inputs that
// share a name), because it only gets called if there
// isn't an initial value. By the same token, we can make
// a note of that fact that there was no initial value,
// and populate it using any `checked` attributes that
// exist (which users should avoid, but which we should
// support anyway to avoid breaking expectations)
this.noInitialValue = true;
return [];
},
init: function() {
var existingValue, bindingValue, noInitialValue;
this.checkboxName = true;
// so that ractive.updateModel() knows what to do with this
// Each input has a reference to an array containing it and its
// siblings, as two-way binding depends on being able to ascertain
// the status of all inputs within the group
this.siblings = getSiblings( this.root._guid, 'checkboxes', this.keypath );
this.siblings.push( this );
if ( this.noInitialValue ) {
this.siblings.noInitialValue = true;
}
noInitialValue = this.siblings.noInitialValue;
existingValue = this.root.viewmodel.get( this.keypath );
bindingValue = this.element.getAttribute( 'value' );
if ( noInitialValue ) {
this.isChecked = this.element.getAttribute( 'checked' );
if ( this.isChecked ) {
existingValue.push( bindingValue );
}
} else {
this.isChecked = isArray( existingValue ) ? existingValue.indexOf( bindingValue ) !== -1 : existingValue === bindingValue;
}
},
unbind: function() {
removeFromArray( this.siblings, this );
},
render: function() {
var node = this.element.node;
node.name = '{{' + this.keypath + '}}';
node.checked = this.isChecked;
node.addEventListener( 'change', handleDomEvent, false );
// in case of IE emergency, bind to click event as well
if ( node.attachEvent ) {
node.addEventListener( 'click', handleDomEvent, false );
}
},
unrender: function() {
var node = this.element.node;
node.removeEventListener( 'change', handleDomEvent, false );
node.removeEventListener( 'click', handleDomEvent, false );
},
changed: function() {
var wasChecked = !!this.isChecked;
this.isChecked = this.element.node.checked;
return this.isChecked === wasChecked;
},
handleChange: function() {
this.isChecked = this.element.node.checked;
Binding.prototype.handleChange.call( this );
},
getValue: function() {
return this.siblings.filter( isChecked ).map( getValue );
}
} );
function isChecked( binding ) {
return binding.isChecked;
}
function getValue( binding ) {
return binding.element.getAttribute( 'value' );
}
return CheckboxNameBinding;
}( isArray, removeFromArray, Binding, getSiblings, handleDomEvent );
/* virtualdom/items/Element/Binding/CheckboxBinding.js */
var CheckboxBinding = function( Binding, handleDomEvent ) {
var CheckboxBinding = Binding.extend( {
name: 'checked',
render: function() {
var node = this.element.node;
node.addEventListener( 'change', handleDomEvent, false );
if ( node.attachEvent ) {
node.addEventListener( 'click', handleDomEvent, false );
}
},
unrender: function() {
var node = this.element.node;
node.removeEventListener( 'change', handleDomEvent, false );
node.removeEventListener( 'click', handleDomEvent, false );
},
getValue: function() {
return this.element.node.checked;
}
} );
return CheckboxBinding;
}( Binding, handleDomEvent );
/* virtualdom/items/Element/Binding/SelectBinding.js */
var SelectBinding = function( runloop, Binding, handleDomEvent ) {
var SelectBinding = Binding.extend( {
getInitialValue: function() {
var options = this.element.options,
len, i;
i = len = options.length;
if ( !len ) {
return;
}
// take the final selected option...
while ( i-- ) {
if ( options[ i ].getAttribute( 'selected' ) ) {
return options[ i ].getAttribute( 'value' );
}
}
// or the first non-disabled option, if none are selected
while ( ++i < len ) {
if ( !options[ i ].getAttribute( 'disabled' ) ) {
return options[ i ].getAttribute( 'value' );
}
}
},
render: function() {
this.element.node.addEventListener( 'change', handleDomEvent, false );
},
unrender: function() {
this.element.node.removeEventListener( 'change', handleDomEvent, false );
},
// TODO this method is an anomaly... is it necessary?
setValue: function( value ) {
runloop.addViewmodel( this.root.viewmodel );
this.root.viewmodel.set( this.keypath, value );
},
getValue: function() {
var options, i, len, option, optionValue;
options = this.element.node.options;
len = options.length;
for ( i = 0; i < len; i += 1 ) {
option = options[ i ];
if ( options[ i ].selected ) {
optionValue = option._ractive ? option._ractive.value : option.value;
return optionValue;
}
}
},
forceUpdate: function() {
var this$0 = this;
var value = this.getValue();
if ( value !== undefined ) {
this.attribute.locked = true;
runloop.addViewmodel( this.root.viewmodel );
runloop.scheduleTask( function() {
return this$0.attribute.locked = false;
} );
this.root.viewmodel.set( this.keypath, value );
}
}
} );
return SelectBinding;
}( runloop, Binding, handleDomEvent );
/* utils/arrayContentsMatch.js */
var arrayContentsMatch = function( isArray ) {
return function( a, b ) {
var i;
if ( !isArray( a ) || !isArray( b ) ) {
return false;
}
if ( a.length !== b.length ) {
return false;
}
i = a.length;
while ( i-- ) {
if ( a[ i ] !== b[ i ] ) {
return false;
}
}
return true;
};
}( isArray );
/* virtualdom/items/Element/Binding/MultipleSelectBinding.js */
var MultipleSelectBinding = function( runloop, arrayContentsMatch, SelectBinding, handleDomEvent ) {
var MultipleSelectBinding = SelectBinding.extend( {
getInitialValue: function() {
return this.element.options.filter( function( option ) {
return option.getAttribute( 'selected' );
} ).map( function( option ) {
return option.getAttribute( 'value' );
} );
},
render: function() {
var valueFromModel;
this.element.node.addEventListener( 'change', handleDomEvent, false );
valueFromModel = this.root.viewmodel.get( this.keypath );
if ( valueFromModel === undefined ) {
// get value from DOM, if possible
this.handleChange();
}
},
unrender: function() {
this.element.node.removeEventListener( 'change', handleDomEvent, false );
},
setValue: function() {
throw new Error( 'TODO not implemented yet' );
},
getValue: function() {
var selectedValues, options, i, len, option, optionValue;
selectedValues = [];
options = this.element.node.options;
len = options.length;
for ( i = 0; i < len; i += 1 ) {
option = options[ i ];
if ( option.selected ) {
optionValue = option._ractive ? option._ractive.value : option.value;
selectedValues.push( optionValue );
}
}
return selectedValues;
},
handleChange: function() {
var attribute, previousValue, value;
attribute = this.attribute;
previousValue = attribute.value;
value = this.getValue();
if ( previousValue === undefined || !arrayContentsMatch( value, previousValue ) ) {
SelectBinding.prototype.handleChange.call( this );
}
return this;
},
forceUpdate: function() {
var this$0 = this;
var value = this.getValue();
if ( value !== undefined ) {
this.attribute.locked = true;
runloop.addViewmodel( this.root.viewmodel );
runloop.scheduleTask( function() {
return this$0.attribute.locked = false;
} );
this.root.viewmodel.set( this.keypath, value );
}
},
updateModel: function() {
if ( this.attribute.value === undefined || !this.attribute.value.length ) {
this.root.viewmodel.set( this.keypath, this.initialValue );
}
}
} );
return MultipleSelectBinding;
}( runloop, arrayContentsMatch, SelectBinding, handleDomEvent );
/* virtualdom/items/Element/Binding/FileListBinding.js */
var FileListBinding = function( Binding, handleDomEvent ) {
var FileListBinding = Binding.extend( {
render: function() {
this.element.node.addEventListener( 'change', handleDomEvent, false );
},
unrender: function() {
this.element.node.removeEventListener( 'change', handleDomEvent, false );
},
getValue: function() {
return this.element.node.files;
}
} );
return FileListBinding;
}( Binding, handleDomEvent );
/* virtualdom/items/Element/Binding/GenericBinding.js */
var GenericBinding = function( Binding, handleDomEvent ) {
var GenericBinding, getOptions;
getOptions = {
evaluateWrapped: true
};
GenericBinding = Binding.extend( {
getInitialValue: function() {
return '';
},
getValue: function() {
return this.element.node.value;
},
render: function() {
var node = this.element.node;
node.addEventListener( 'change', handleDomEvent, false );
if ( !this.root.lazy ) {
node.addEventListener( 'input', handleDomEvent, false );
if ( node.attachEvent ) {
node.addEventListener( 'keyup', handleDomEvent, false );
}
}
node.addEventListener( 'blur', handleBlur, false );
},
unrender: function() {
var node = this.element.node;
node.removeEventListener( 'change', handleDomEvent, false );
node.removeEventListener( 'input', handleDomEvent, false );
node.removeEventListener( 'keyup', handleDomEvent, false );
node.removeEventListener( 'blur', handleBlur, false );
}
} );
return GenericBinding;
function handleBlur() {
var value;
handleDomEvent.call( this );
value = this._ractive.root.viewmodel.get( this._ractive.binding.keypath, getOptions );
this.value = value == undefined ? '' : value;
}
}( Binding, handleDomEvent );
/* virtualdom/items/Element/Binding/NumericBinding.js */
var NumericBinding = function( GenericBinding ) {
return GenericBinding.extend( {
getInitialValue: function() {
return undefined;
},
getValue: function() {
var value = parseFloat( this.element.node.value );
return isNaN( value ) ? undefined : value;
}
} );
}( GenericBinding );
/* virtualdom/items/Element/prototype/init/createTwowayBinding.js */
var virtualdom_items_Element$init_createTwowayBinding = function( log, ContentEditableBinding, RadioBinding, RadioNameBinding, CheckboxNameBinding, CheckboxBinding, SelectBinding, MultipleSelectBinding, FileListBinding, NumericBinding, GenericBinding ) {
return function createTwowayBinding( element ) {
var attributes = element.attributes,
type, Binding, bindName, bindChecked;
// if this is a late binding, and there's already one, it
// needs to be torn down
if ( element.binding ) {
element.binding.teardown();
element.binding = null;
}
// contenteditable
if ( element.getAttribute( 'contenteditable' ) && isBindable( attributes.value ) ) {
Binding = ContentEditableBinding;
} else if ( element.name === 'input' ) {
type = element.getAttribute( 'type' );
if ( type === 'radio' || type === 'checkbox' ) {
bindName = isBindable( attributes.name );
bindChecked = isBindable( attributes.checked );
// we can either bind the name attribute, or the checked attribute - not both
if ( bindName && bindChecked ) {
log.error( {
message: 'badRadioInputBinding'
} );
}
if ( bindName ) {
Binding = type === 'radio' ? RadioNameBinding : CheckboxNameBinding;
} else if ( bindChecked ) {
Binding = type === 'radio' ? RadioBinding : CheckboxBinding;
}
} else if ( type === 'file' && isBindable( attributes.value ) ) {
Binding = FileListBinding;
} else if ( isBindable( attributes.value ) ) {
Binding = type === 'number' || type === 'range' ? NumericBinding : GenericBinding;
}
} else if ( element.name === 'select' && isBindable( attributes.value ) ) {
Binding = element.getAttribute( 'multiple' ) ? MultipleSelectBinding : SelectBinding;
} else if ( element.name === 'textarea' && isBindable( attributes.value ) ) {
Binding = GenericBinding;
}
if ( Binding ) {
return new Binding( element );
}
};
function isBindable( attribute ) {
return attribute && attribute.isBindable;
}
}( log, ContentEditableBinding, RadioBinding, RadioNameBinding, CheckboxNameBinding, CheckboxBinding, SelectBinding, MultipleSelectBinding, FileListBinding, NumericBinding, GenericBinding );
/* virtualdom/items/Element/EventHandler/prototype/fire.js */
var virtualdom_items_Element_EventHandler$fire = function EventHandler$fire( event ) {
this.root.fire( this.action.toString().trim(), event );
};
/* virtualdom/items/Element/EventHandler/prototype/init.js */
var virtualdom_items_Element_EventHandler$init = function( circular ) {
var Fragment, getValueOptions = {
args: true
};
circular.push( function() {
Fragment = circular.Fragment;
} );
return function EventHandler$init( element, name, template ) {
var action;
this.element = element;
this.root = element.root;
this.name = name;
this.proxies = [];
// Get action ('foo' in 'on-click='foo')
action = template.n || template;
if ( typeof action !== 'string' ) {
action = new Fragment( {
template: action,
root: this.root,
owner: this.element
} );
}
this.action = action;
// Get parameters
if ( template.d ) {
this.dynamicParams = new Fragment( {
template: template.d,
root: this.root,
owner: this.element
} );
this.fire = fireEventWithDynamicParams;
} else if ( template.a ) {
this.params = template.a;
this.fire = fireEventWithParams;
}
};
function fireEventWithParams( event ) {
this.root.fire.apply( this.root, [
this.action.toString().trim(),
event
].concat( this.params ) );
}
function fireEventWithDynamicParams( event ) {
var args = this.dynamicParams.getValue( getValueOptions );
// need to strip [] from ends if a string!
if ( typeof args === 'string' ) {
args = args.substr( 1, args.length - 2 );
}
this.root.fire.apply( this.root, [
this.action.toString().trim(),
event
].concat( args ) );
}
}( circular );
/* virtualdom/items/Element/EventHandler/prototype/rebind.js */
var virtualdom_items_Element_EventHandler$rebind = function EventHandler$rebind( indexRef, newIndex, oldKeypath, newKeypath ) {
if ( typeof this.action !== 'string' ) {
this.action.rebind( indexRef, newIndex, oldKeypath, newKeypath );
}
if ( this.dynamicParams ) {
this.dynamicParams.rebind( indexRef, newIndex, oldKeypath, newKeypath );
}
};
/* virtualdom/items/Element/EventHandler/shared/genericHandler.js */
var genericHandler = function genericHandler( event ) {
var storage, handler;
storage = this._ractive;
handler = storage.events[ event.type ];
handler.fire( {
node: this,
original: event,
index: storage.index,
keypath: storage.keypath,
context: storage.root.get( storage.keypath )
} );
};
/* virtualdom/items/Element/EventHandler/prototype/render.js */
var virtualdom_items_Element_EventHandler$render = function( warn, config, genericHandler ) {
var customHandlers = {};
return function EventHandler$render() {
var name = this.name,
definition;
this.node = this.element.node;
if ( definition = config.registries.events.find( this.root, name ) ) {
this.custom = definition( this.node, getCustomHandler( name ) );
} else {
// Looks like we're dealing with a standard DOM event... but let's check
if ( !( 'on' + name in this.node ) && !( window && 'on' + name in window ) ) {
warn( 'Missing "' + this.name + '" event. You may need to download a plugin via http://docs.ractivejs.org/latest/plugins#events' );
}
this.node.addEventListener( name, genericHandler, false );
}
// store this on the node itself, so it can be retrieved by a
// universal handler
this.node._ractive.events[ name ] = this;
};
function getCustomHandler( name ) {
if ( !customHandlers[ name ] ) {
customHandlers[ name ] = function( event ) {
var storage = event.node._ractive;
event.index = storage.index;
event.keypath = storage.keypath;
event.context = storage.root.get( storage.keypath );
storage.events[ name ].fire( event );
};
}
return customHandlers[ name ];
}
}( warn, config, genericHandler );
/* virtualdom/items/Element/EventHandler/prototype/teardown.js */
var virtualdom_items_Element_EventHandler$teardown = function EventHandler$teardown() {
// Tear down dynamic name
if ( typeof this.action !== 'string' ) {
this.action.teardown();
}
// Tear down dynamic parameters
if ( this.dynamicParams ) {
this.dynamicParams.teardown();
}
};
/* virtualdom/items/Element/EventHandler/prototype/unrender.js */
var virtualdom_items_Element_EventHandler$unrender = function( genericHandler ) {
return function EventHandler$unrender() {
if ( this.custom ) {
this.custom.teardown();
} else {
this.node.removeEventListener( this.name, genericHandler, false );
}
};
}( genericHandler );
/* virtualdom/items/Element/EventHandler/_EventHandler.js */
var EventHandler = function( fire, init, rebind, render, teardown, unrender ) {
var EventHandler = function( element, name, template ) {
this.init( element, name, template );
};
EventHandler.prototype = {
fire: fire,
init: init,
rebind: rebind,
render: render,
teardown: teardown,
unrender: unrender
};
return EventHandler;
}( virtualdom_items_Element_EventHandler$fire, virtualdom_items_Element_EventHandler$init, virtualdom_items_Element_EventHandler$rebind, virtualdom_items_Element_EventHandler$render, virtualdom_items_Element_EventHandler$teardown, virtualdom_items_Element_EventHandler$unrender );
/* virtualdom/items/Element/prototype/init/createEventHandlers.js */
var virtualdom_items_Element$init_createEventHandlers = function( EventHandler ) {
return function( element, template ) {
var i, name, names, handler, result = [];
for ( name in template ) {
if ( template.hasOwnProperty( name ) ) {
names = name.split( '-' );
i = names.length;
while ( i-- ) {
handler = new EventHandler( element, names[ i ], template[ name ] );
result.push( handler );
}
}
}
return result;
};
}( EventHandler );
/* virtualdom/items/Element/Decorator/_Decorator.js */
var Decorator = function( log, circular, config ) {
var Fragment, getValueOptions, Decorator;
circular.push( function() {
Fragment = circular.Fragment;
} );
getValueOptions = {
args: true
};
Decorator = function( element, template ) {
var decorator = this,
ractive, name, fragment;
decorator.element = element;
decorator.root = ractive = element.root;
name = template.n || template;
if ( typeof name !== 'string' ) {
fragment = new Fragment( {
template: name,
root: ractive,
owner: element
} );
name = fragment.toString();
fragment.unbind();
}
if ( template.a ) {
decorator.params = template.a;
} else if ( template.d ) {
decorator.fragment = new Fragment( {
template: template.d,
root: ractive,
owner: element
} );
decorator.params = decorator.fragment.getValue( getValueOptions );
decorator.fragment.bubble = function() {
this.dirtyArgs = this.dirtyValue = true;
decorator.params = this.getValue( getValueOptions );
if ( decorator.ready ) {
decorator.update();
}
};
}
decorator.fn = config.registries.decorators.find( ractive, name );
if ( !decorator.fn ) {
log.error( {
debug: ractive.debug,
message: 'missingPlugin',
args: {
plugin: 'decorator',
name: name
}
} );
}
};
Decorator.prototype = {
init: function() {
var decorator = this,
node, result, args;
node = decorator.element.node;
if ( decorator.params ) {
args = [ node ].concat( decorator.params );
result = decorator.fn.apply( decorator.root, args );
} else {
result = decorator.fn.call( decorator.root, node );
}
if ( !result || !result.teardown ) {
throw new Error( 'Decorator definition must return an object with a teardown method' );
}
// TODO does this make sense?
decorator.actual = result;
decorator.ready = true;
},
update: function() {
if ( this.actual.update ) {
this.actual.update.apply( this.root, this.params );
} else {
this.actual.teardown( true );
this.init();
}
},
teardown: function( updating ) {
this.actual.teardown();
if ( !updating && this.fragment ) {
this.fragment.unbind();
}
}
};
return Decorator;
}( log, circular, config );
/* virtualdom/items/Element/special/select/sync.js */
var sync = function( toArray ) {
return function syncSelect( selectElement ) {
var selectNode, selectValue, isMultiple, options, optionWasSelected;
selectNode = selectElement.node;
if ( !selectNode ) {
return;
}
options = toArray( selectNode.options );
selectValue = selectElement.getAttribute( 'value' );
isMultiple = selectElement.getAttribute( 'multiple' );
// If the <select> has a specified value, that should override
// these options
if ( selectValue !== undefined ) {
options.forEach( function( o ) {
var optionValue, shouldSelect;
optionValue = o._ractive ? o._ractive.value : o.value;
shouldSelect = isMultiple ? valueContains( selectValue, optionValue ) : selectValue == optionValue;
if ( shouldSelect ) {
optionWasSelected = true;
}
o.selected = shouldSelect;
} );
if ( !optionWasSelected ) {
if ( options[ 0 ] ) {
options[ 0 ].selected = true;
}
if ( selectElement.binding ) {
selectElement.binding.forceUpdate();
}
}
} else if ( selectElement.binding ) {
selectElement.binding.forceUpdate();
}
};
function valueContains( selectValue, optionValue ) {
var i = selectValue.length;
while ( i-- ) {
if ( selectValue[ i ] == optionValue ) {
return true;
}
}
}
}( toArray );
/* virtualdom/items/Element/special/select/bubble.js */
var bubble = function( runloop, syncSelect ) {
return function bubbleSelect() {
var this$0 = this;
if ( !this.dirty ) {
this.dirty = true;
runloop.scheduleTask( function() {
syncSelect( this$0 );
this$0.dirty = false;
} );
}
this.parentFragment.bubble();
};
}( runloop, sync );
/* virtualdom/items/Element/special/option/findParentSelect.js */
var findParentSelect = function findParentSelect( element ) {
do {
if ( element.name === 'select' ) {
return element;
}
} while ( element = element.parent );
};
/* virtualdom/items/Element/special/option/init.js */
var init = function( findParentSelect ) {
return function initOption( option, template ) {
option.select = findParentSelect( option.parent );
option.select.options.push( option );
// If the value attribute is missing, use the element's content
if ( !template.a ) {
template.a = {};
}
// ...as long as it isn't disabled
if ( !template.a.value && !template.a.hasOwnProperty( 'disabled' ) ) {
template.a.value = template.f;
}
// If there is a `selected` attribute, but the <select>
// already has a value, delete it
if ( 'selected' in template.a && option.select.getAttribute( 'value' ) !== undefined ) {
delete template.a.selected;
}
};
}( findParentSelect );
/* virtualdom/items/Element/prototype/init.js */
var virtualdom_items_Element$init = function( types, enforceCase, createAttributes, createTwowayBinding, createEventHandlers, Decorator, bubbleSelect, initOption, circular ) {
var Fragment;
circular.push( function() {
Fragment = circular.Fragment;
} );
return function Element$init( options ) {
var parentFragment, template, ractive, binding, bindings;
this.type = types.ELEMENT;
// stuff we'll need later
parentFragment = this.parentFragment = options.parentFragment;
template = this.template = options.template;
this.parent = options.pElement || parentFragment.pElement;
this.root = ractive = parentFragment.root;
this.index = options.index;
this.name = enforceCase( template.e );
// Special case - <option> elements
if ( this.name === 'option' ) {
initOption( this, template );
}
// Special case - <select> elements
if ( this.name === 'select' ) {
this.options = [];
this.bubble = bubbleSelect;
}
// create attributes
this.attributes = createAttributes( this, template.a );
// append children, if there are any
if ( template.f ) {
this.fragment = new Fragment( {
template: template.f,
root: ractive,
owner: this,
pElement: this
} );
}
// create twoway binding
if ( ractive.twoway && ( binding = createTwowayBinding( this, template.a ) ) ) {
this.binding = binding;
// register this with the root, so that we can do ractive.updateModel()
bindings = this.root._twowayBindings[ binding.keypath ] || ( this.root._twowayBindings[ binding.keypath ] = [] );
bindings.push( binding );
}
// create event proxies
if ( template.v ) {
this.eventHandlers = createEventHandlers( this, template.v );
}
// create decorator
if ( template.o ) {
this.decorator = new Decorator( this, template.o );
}
// create transitions
this.intro = template.t0 || template.t1;
this.outro = template.t0 || template.t2;
};
}( types, enforceCase, virtualdom_items_Element$init_createAttributes, virtualdom_items_Element$init_createTwowayBinding, virtualdom_items_Element$init_createEventHandlers, Decorator, bubble, init, circular );
/* virtualdom/items/shared/utils/startsWith.js */
var startsWith = function( startsWithKeypath ) {
return function startsWith( target, keypath ) {
return target === keypath || startsWithKeypath( target, keypath );
};
}( startsWithKeypath );
/* virtualdom/items/shared/utils/assignNewKeypath.js */
var assignNewKeypath = function( startsWith, getNewKeypath ) {
return function assignNewKeypath( target, property, oldKeypath, newKeypath ) {
var existingKeypath = target[ property ];
if ( !existingKeypath || startsWith( existingKeypath, newKeypath ) || !startsWith( existingKeypath, oldKeypath ) ) {
return;
}
target[ property ] = getNewKeypath( existingKeypath, oldKeypath, newKeypath );
};
}( startsWith, getNewKeypath );
/* virtualdom/items/Element/prototype/rebind.js */
var virtualdom_items_Element$rebind = function( assignNewKeypath ) {
return function Element$rebind( indexRef, newIndex, oldKeypath, newKeypath ) {
var i, storage, liveQueries, ractive;
if ( this.attributes ) {
this.attributes.forEach( rebind );
}
if ( this.eventHandlers ) {
this.eventHandlers.forEach( rebind );
}
// rebind children
if ( this.fragment ) {
rebind( this.fragment );
}
// Update live queries, if necessary
if ( liveQueries = this.liveQueries ) {
ractive = this.root;
i = liveQueries.length;
while ( i-- ) {
liveQueries[ i ]._makeDirty();
}
}
if ( this.node && ( storage = this.node._ractive ) ) {
// adjust keypath if needed
assignNewKeypath( storage, 'keypath', oldKeypath, newKeypath );
if ( indexRef != undefined ) {
storage.index[ indexRef ] = newIndex;
}
}
function rebind( thing ) {
thing.rebind( indexRef, newIndex, oldKeypath, newKeypath );
}
};
}( assignNewKeypath );
/* virtualdom/items/Element/special/img/render.js */
var render = function renderImage( img ) {
var width, height, loadHandler;
// if this is an <img>, and we're in a crap browser, we may need to prevent it
// from overriding width and height when it loads the src
if ( ( width = img.getAttribute( 'width' ) ) || ( height = img.getAttribute( 'height' ) ) ) {
img.node.addEventListener( 'load', loadHandler = function() {
if ( width ) {
img.node.width = width.value;
}
if ( height ) {
img.node.height = height.value;
}
img.node.removeEventListener( 'load', loadHandler, false );
}, false );
}
};
/* virtualdom/items/Element/Transition/prototype/init.js */
var virtualdom_items_Element_Transition$init = function( log, config, circular ) {
var Fragment, getValueOptions = {};
// TODO what are the options?
circular.push( function() {
Fragment = circular.Fragment;
} );
return function Transition$init( element, template, isIntro ) {
var t = this,
ractive, name, fragment;
t.element = element;
t.root = ractive = element.root;
t.isIntro = isIntro;
name = template.n || template;
if ( typeof name !== 'string' ) {
fragment = new Fragment( {
template: name,
root: ractive,
owner: element
} );
name = fragment.toString();
fragment.unbind();
}
t.name = name;
if ( template.a ) {
t.params = template.a;
} else if ( template.d ) {
// TODO is there a way to interpret dynamic arguments without all the
// 'dependency thrashing'?
fragment = new Fragment( {
template: template.d,
root: ractive,
owner: element
} );
t.params = fragment.getValue( getValueOptions );
fragment.unbind();
}
t._fn = config.registries.transitions.find( ractive, name );
if ( !t._fn ) {
log.error( {
debug: ractive.debug,
message: 'missingPlugin',
args: {
plugin: 'transition',
name: name
}
} );
return;
}
};
}( log, config, circular );
/* utils/camelCase.js */
var camelCase = function( hyphenatedStr ) {
return hyphenatedStr.replace( /-([a-zA-Z])/g, function( match, $1 ) {
return $1.toUpperCase();
} );
};
/* virtualdom/items/Element/Transition/helpers/prefix.js */
var prefix = function( isClient, vendors, createElement, camelCase ) {
var prefix, prefixCache, testStyle;
if ( !isClient ) {
prefix = null;
} else {
prefixCache = {};
testStyle = createElement( 'div' ).style;
prefix = function( prop ) {
var i, vendor, capped;
prop = camelCase( prop );
if ( !prefixCache[ prop ] ) {
if ( testStyle[ prop ] !== undefined ) {
prefixCache[ prop ] = prop;
} else {
// test vendors...
capped = prop.charAt( 0 ).toUpperCase() + prop.substring( 1 );
i = vendors.length;
while ( i-- ) {
vendor = vendors[ i ];
if ( testStyle[ vendor + capped ] !== undefined ) {
prefixCache[ prop ] = vendor + capped;
break;
}
}
}
}
return prefixCache[ prop ];
};
}
return prefix;
}( isClient, vendors, createElement, camelCase );
/* virtualdom/items/Element/Transition/prototype/getStyle.js */
var virtualdom_items_Element_Transition$getStyle = function( legacy, isClient, isArray, prefix ) {
var getStyle, getComputedStyle;
if ( !isClient ) {
getStyle = null;
} else {
getComputedStyle = window.getComputedStyle || legacy.getComputedStyle;
getStyle = function( props ) {
var computedStyle, styles, i, prop, value;
computedStyle = getComputedStyle( this.node );
if ( typeof props === 'string' ) {
value = computedStyle[ prefix( props ) ];
if ( value === '0px' ) {
value = 0;
}
return value;
}
if ( !isArray( props ) ) {
throw new Error( 'Transition$getStyle must be passed a string, or an array of strings representing CSS properties' );
}
styles = {};
i = props.length;
while ( i-- ) {
prop = props[ i ];
value = computedStyle[ prefix( prop ) ];
if ( value === '0px' ) {
value = 0;
}
styles[ prop ] = value;
}
return styles;
};
}
return getStyle;
}( legacy, isClient, isArray, prefix );
/* virtualdom/items/Element/Transition/prototype/setStyle.js */
var virtualdom_items_Element_Transition$setStyle = function( prefix ) {
return function( style, value ) {
var prop;
if ( typeof style === 'string' ) {
this.node.style[ prefix( style ) ] = value;
} else {
for ( prop in style ) {
if ( style.hasOwnProperty( prop ) ) {
this.node.style[ prefix( prop ) ] = style[ prop ];
}
}
}
return this;
};
}( prefix );
/* shared/Ticker.js */
var Ticker = function( warn, getTime, animations ) {
// TODO what happens if a transition is aborted?
// TODO use this with Animation to dedupe some code?
var Ticker = function( options ) {
var easing;
this.duration = options.duration;
this.step = options.step;
this.complete = options.complete;
// easing
if ( typeof options.easing === 'string' ) {
easing = options.root.easing[ options.easing ];
if ( !easing ) {
warn( 'Missing easing function ("' + options.easing + '"). You may need to download a plugin from [TODO]' );
easing = linear;
}
} else if ( typeof options.easing === 'function' ) {
easing = options.easing;
} else {
easing = linear;
}
this.easing = easing;
this.start = getTime();
this.end = this.start + this.duration;
this.running = true;
animations.add( this );
};
Ticker.prototype = {
tick: function( now ) {
var elapsed, eased;
if ( !this.running ) {
return false;
}
if ( now > this.end ) {
if ( this.step ) {
this.step( 1 );
}
if ( this.complete ) {
this.complete( 1 );
}
return false;
}
elapsed = now - this.start;
eased = this.easing( elapsed / this.duration );
if ( this.step ) {
this.step( eased );
}
return true;
},
stop: function() {
if ( this.abort ) {
this.abort();
}
this.running = false;
}
};
return Ticker;
function linear( t ) {
return t;
}
}( warn, getTime, animations );
/* virtualdom/items/Element/Transition/helpers/unprefix.js */
var unprefix = function( vendors ) {
var unprefixPattern = new RegExp( '^-(?:' + vendors.join( '|' ) + ')-' );
return function( prop ) {
return prop.replace( unprefixPattern, '' );
};
}( vendors );
/* virtualdom/items/Element/Transition/helpers/hyphenate.js */
var hyphenate = function( vendors ) {
var vendorPattern = new RegExp( '^(?:' + vendors.join( '|' ) + ')([A-Z])' );
return function( str ) {
var hyphenated;
if ( !str ) {
return '';
}
if ( vendorPattern.test( str ) ) {
str = '-' + str;
}
hyphenated = str.replace( /[A-Z]/g, function( match ) {
return '-' + match.toLowerCase();
} );
return hyphenated;
};
}( vendors );
/* virtualdom/items/Element/Transition/prototype/animateStyle/createTransitions.js */
var virtualdom_items_Element_Transition$animateStyle_createTransitions = function( isClient, warn, createElement, camelCase, interpolate, Ticker, prefix, unprefix, hyphenate ) {
var createTransitions, testStyle, TRANSITION, TRANSITIONEND, CSS_TRANSITIONS_ENABLED, TRANSITION_DURATION, TRANSITION_PROPERTY, TRANSITION_TIMING_FUNCTION, canUseCssTransitions = {},
cannotUseCssTransitions = {};
if ( !isClient ) {
createTransitions = null;
} else {
testStyle = createElement( 'div' ).style;
// determine some facts about our environment
( function() {
if ( testStyle.transition !== undefined ) {
TRANSITION = 'transition';
TRANSITIONEND = 'transitionend';
CSS_TRANSITIONS_ENABLED = true;
} else if ( testStyle.webkitTransition !== undefined ) {
TRANSITION = 'webkitTransition';
TRANSITIONEND = 'webkitTransitionEnd';
CSS_TRANSITIONS_ENABLED = true;
} else {
CSS_TRANSITIONS_ENABLED = false;
}
}() );
if ( TRANSITION ) {
TRANSITION_DURATION = TRANSITION + 'Duration';
TRANSITION_PROPERTY = TRANSITION + 'Property';
TRANSITION_TIMING_FUNCTION = TRANSITION + 'TimingFunction';
}
createTransitions = function( t, to, options, changedProperties, resolve ) {
// Wait a beat (otherwise the target styles will be applied immediately)
// TODO use a fastdom-style mechanism?
setTimeout( function() {
var hashPrefix, jsTransitionsComplete, cssTransitionsComplete, checkComplete, transitionEndHandler;
checkComplete = function() {
if ( jsTransitionsComplete && cssTransitionsComplete ) {
t.root.fire( t.name + ':end', t.node, t.isIntro );
resolve();
}
};
// this is used to keep track of which elements can use CSS to animate
// which properties
hashPrefix = ( t.node.namespaceURI || '' ) + t.node.tagName;
t.node.style[ TRANSITION_PROPERTY ] = changedProperties.map( prefix ).map( hyphenate ).join( ',' );
t.node.style[ TRANSITION_TIMING_FUNCTION ] = hyphenate( options.easing || 'linear' );
t.node.style[ TRANSITION_DURATION ] = options.duration / 1000 + 's';
transitionEndHandler = function( event ) {
var index;
index = changedProperties.indexOf( camelCase( unprefix( event.propertyName ) ) );
if ( index !== -1 ) {
changedProperties.splice( index, 1 );
}
if ( changedProperties.length ) {
// still transitioning...
return;
}
t.node.removeEventListener( TRANSITIONEND, transitionEndHandler, false );
cssTransitionsComplete = true;
checkComplete();
};
t.node.addEventListener( TRANSITIONEND, transitionEndHandler, false );
setTimeout( function() {
var i = changedProperties.length,
hash, originalValue, index, propertiesToTransitionInJs = [],
prop, suffix;
while ( i-- ) {
prop = changedProperties[ i ];
hash = hashPrefix + prop;
if ( CSS_TRANSITIONS_ENABLED && !cannotUseCssTransitions[ hash ] ) {
t.node.style[ prefix( prop ) ] = to[ prop ];
// If we're not sure if CSS transitions are supported for
// this tag/property combo, find out now
if ( !canUseCssTransitions[ hash ] ) {
originalValue = t.getStyle( prop );
// if this property is transitionable in this browser,
// the current style will be different from the target style
canUseCssTransitions[ hash ] = t.getStyle( prop ) != to[ prop ];
cannotUseCssTransitions[ hash ] = !canUseCssTransitions[ hash ];
// Reset, if we're going to use timers after all
if ( cannotUseCssTransitions[ hash ] ) {
t.node.style[ prefix( prop ) ] = originalValue;
}
}
}
if ( !CSS_TRANSITIONS_ENABLED || cannotUseCssTransitions[ hash ] ) {
// we need to fall back to timer-based stuff
if ( originalValue === undefined ) {
originalValue = t.getStyle( prop );
}
// need to remove this from changedProperties, otherwise transitionEndHandler
// will get confused
index = changedProperties.indexOf( prop );
if ( index === -1 ) {
warn( 'Something very strange happened with transitions. If you see this message, please let @RactiveJS know. Thanks!' );
} else {
changedProperties.splice( index, 1 );
}
// TODO Determine whether this property is animatable at all
suffix = /[^\d]*$/.exec( to[ prop ] )[ 0 ];
// ...then kick off a timer-based transition
propertiesToTransitionInJs.push( {
name: prefix( prop ),
interpolator: interpolate( parseFloat( originalValue ), parseFloat( to[ prop ] ) ),
suffix: suffix
} );
}
}
// javascript transitions
if ( propertiesToTransitionInJs.length ) {
new Ticker( {
root: t.root,
duration: options.duration,
easing: camelCase( options.easing || '' ),
step: function( pos ) {
var prop, i;
i = propertiesToTransitionInJs.length;
while ( i-- ) {
prop = propertiesToTransitionInJs[ i ];
t.node.style[ prop.name ] = prop.interpolator( pos ) + prop.suffix;
}
},
complete: function() {
jsTransitionsComplete = true;
checkComplete();
}
} );
} else {
jsTransitionsComplete = true;
}
if ( !changedProperties.length ) {
// We need to cancel the transitionEndHandler, and deal with
// the fact that it will never fire
t.node.removeEventListener( TRANSITIONEND, transitionEndHandler, false );
cssTransitionsComplete = true;
checkComplete();
}
}, 0 );
}, options.delay || 0 );
};
}
return createTransitions;
}( isClient, warn, createElement, camelCase, interpolate, Ticker, prefix, unprefix, hyphenate );
/* virtualdom/items/Element/Transition/prototype/animateStyle/visibility.js */
var virtualdom_items_Element_Transition$animateStyle_visibility = function( vendors ) {
var hidden, vendor, prefix, i, visibility;
if ( typeof document !== 'undefined' ) {
hidden = 'hidden';
visibility = {};
if ( hidden in document ) {
prefix = '';
} else {
i = vendors.length;
while ( i-- ) {
vendor = vendors[ i ];
hidden = vendor + 'Hidden';
if ( hidden in document ) {
prefix = vendor;
}
}
}
if ( prefix !== undefined ) {
document.addEventListener( prefix + 'visibilitychange', onChange );
// initialise
onChange();
} else {
// gah, we're in an old browser
if ( 'onfocusout' in document ) {
document.addEventListener( 'focusout', onHide );
document.addEventListener( 'focusin', onShow );
} else {
window.addEventListener( 'pagehide', onHide );
window.addEventListener( 'blur', onHide );
window.addEventListener( 'pageshow', onShow );
window.addEventListener( 'focus', onShow );
}
visibility.hidden = false;
}
}
function onChange() {
visibility.hidden = document[ hidden ];
}
function onHide() {
visibility.hidden = true;
}
function onShow() {
visibility.hidden = false;
}
return visibility;
}( vendors );
/* virtualdom/items/Element/Transition/prototype/animateStyle/_animateStyle.js */
var virtualdom_items_Element_Transition$animateStyle__animateStyle = function( legacy, isClient, warn, Promise, prefix, createTransitions, visibility ) {
var animateStyle, getComputedStyle, resolved;
if ( !isClient ) {
animateStyle = null;
} else {
getComputedStyle = window.getComputedStyle || legacy.getComputedStyle;
animateStyle = function( style, value, options, complete ) {
var t = this,
to;
// Special case - page isn't visible. Don't animate anything, because
// that way you'll never get CSS transitionend events
if ( visibility.hidden ) {
this.setStyle( style, value );
return resolved || ( resolved = Promise.resolve() );
}
if ( typeof style === 'string' ) {
to = {};
to[ style ] = value;
} else {
to = style;
// shuffle arguments
complete = options;
options = value;
}
// As of 0.3.9, transition authors should supply an `option` object with
// `duration` and `easing` properties (and optional `delay`), plus a
// callback function that gets called after the animation completes
// TODO remove this check in a future version
if ( !options ) {
warn( 'The "' + t.name + '" transition does not supply an options object to `t.animateStyle()`. This will break in a future version of Ractive. For more info see https://github.com/RactiveJS/Ractive/issues/340' );
options = t;
complete = t.complete;
}
var promise = new Promise( function( resolve ) {
var propertyNames, changedProperties, computedStyle, current, from, i, prop;
// Edge case - if duration is zero, set style synchronously and complete
if ( !options.duration ) {
t.setStyle( to );
resolve();
return;
}
// Get a list of the properties we're animating
propertyNames = Object.keys( to );
changedProperties = [];
// Store the current styles
computedStyle = getComputedStyle( t.node );
from = {};
i = propertyNames.length;
while ( i-- ) {
prop = propertyNames[ i ];
current = computedStyle[ prefix( prop ) ];
if ( current === '0px' ) {
current = 0;
}
// we need to know if we're actually changing anything
if ( current != to[ prop ] ) {
// use != instead of !==, so we can compare strings with numbers
changedProperties.push( prop );
// make the computed style explicit, so we can animate where
// e.g. height='auto'
t.node.style[ prefix( prop ) ] = current;
}
}
// If we're not actually changing anything, the transitionend event
// will never fire! So we complete early
if ( !changedProperties.length ) {
resolve();
return;
}
createTransitions( t, to, options, changedProperties, resolve );
} );
// If a callback was supplied, do the honours
// TODO remove this check in future
if ( complete ) {
warn( 't.animateStyle returns a Promise as of 0.4.0. Transition authors should do t.animateStyle(...).then(callback)' );
promise.then( complete );
}
return promise;
};
}
return animateStyle;
}( legacy, isClient, warn, Promise, prefix, virtualdom_items_Element_Transition$animateStyle_createTransitions, virtualdom_items_Element_Transition$animateStyle_visibility );
/* utils/fillGaps.js */
var fillGaps = function( target, source ) {
var key;
for ( key in source ) {
if ( source.hasOwnProperty( key ) && !( key in target ) ) {
target[ key ] = source[ key ];
}
}
return target;
};
/* virtualdom/items/Element/Transition/prototype/processParams.js */
var virtualdom_items_Element_Transition$processParams = function( fillGaps ) {
return function( params, defaults ) {
if ( typeof params === 'number' ) {
params = {
duration: params
};
} else if ( typeof params === 'string' ) {
if ( params === 'slow' ) {
params = {
duration: 600
};
} else if ( params === 'fast' ) {
params = {
duration: 200
};
} else {
params = {
duration: 400
};
}
} else if ( !params ) {
params = {};
}
return fillGaps( params, defaults );
};
}( fillGaps );
/* virtualdom/items/Element/Transition/prototype/start.js */
var virtualdom_items_Element_Transition$start = function() {
return function Transition$start() {
var t = this,
node, originalStyle;
node = t.node = t.element.node;
originalStyle = node.getAttribute( 'style' );
// create t.complete() - we don't want this on the prototype,
// because we don't want `this` silliness when passing it as
// an argument
t.complete = function( noReset ) {
if ( !noReset && t.isIntro ) {
resetStyle( node, originalStyle );
}
node._ractive.transition = null;
t._manager.remove( t );
};
// If the transition function doesn't exist, abort
if ( !t._fn ) {
t.complete();
return;
}
t._fn.apply( t.root, [ t ].concat( t.params ) );
};
function resetStyle( node, style ) {
if ( style ) {
node.setAttribute( 'style', style );
} else {
// Next line is necessary, to remove empty style attribute!
// See http://stackoverflow.com/a/7167553
node.getAttribute( 'style' );
node.removeAttribute( 'style' );
}
}
}();
/* virtualdom/items/Element/Transition/_Transition.js */
var Transition = function( init, getStyle, setStyle, animateStyle, processParams, start, circular ) {
var Fragment, Transition;
circular.push( function() {
Fragment = circular.Fragment;
} );
Transition = function( owner, template, isIntro ) {
this.init( owner, template, isIntro );
};
Transition.prototype = {
init: init,
start: start,
getStyle: getStyle,
setStyle: setStyle,
animateStyle: animateStyle,
processParams: processParams
};
return Transition;
}( virtualdom_items_Element_Transition$init, virtualdom_items_Element_Transition$getStyle, virtualdom_items_Element_Transition$setStyle, virtualdom_items_Element_Transition$animateStyle__animateStyle, virtualdom_items_Element_Transition$processParams, virtualdom_items_Element_Transition$start, circular );
/* virtualdom/items/Element/prototype/render.js */
var virtualdom_items_Element$render = function( namespaces, isArray, warn, create, createElement, defineProperty, noop, runloop, getInnerContext, renderImage, Transition ) {
var updateCss, updateScript;
updateCss = function() {
var node = this.node,
content = this.fragment.toString( false );
if ( node.styleSheet ) {
node.styleSheet.cssText = content;
} else {
while ( node.hasChildNodes() ) {
node.removeChild( node.firstChild );
}
node.appendChild( document.createTextNode( content ) );
}
};
updateScript = function() {
if ( !this.node.type || this.node.type === 'text/javascript' ) {
warn( 'Script tag was updated. This does not cause the code to be re-evaluated!' );
}
this.node.text = this.fragment.toString( false );
};
return function Element$render() {
var this$0 = this;
var root = this.root,
namespace, node;
namespace = getNamespace( this );
node = this.node = createElement( this.name, namespace );
// Is this a top-level node of a component? If so, we may need to add
// a data-rvcguid attribute, for CSS encapsulation
// NOTE: css no longer copied to instance, so we check constructor.css -
// we can enhance to handle instance, but this is more "correct" with current
// functionality
if ( root.constructor.css && this.parentFragment.getNode() === root.el ) {
this.node.setAttribute( 'data-rvcguid', root.constructor._guid );
}
// Add _ractive property to the node - we use this object to store stuff
// related to proxy events, two-way bindings etc
defineProperty( this.node, '_ractive', {
value: {
proxy: this,
keypath: getInnerContext( this.parentFragment ),
index: this.parentFragment.indexRefs,
events: create( null ),
root: root
}
} );
// Render attributes
this.attributes.forEach( function( a ) {
return a.render( node );
} );
// Render children
if ( this.fragment ) {
// Special case - <script> element
if ( this.name === 'script' ) {
this.bubble = updateScript;
this.node.text = this.fragment.toString( false );
// bypass warning initially
this.fragment.unrender = noop;
} else if ( this.name === 'style' ) {
this.bubble = updateCss;
this.bubble();
this.fragment.unrender = noop;
} else if ( this.binding && this.getAttribute( 'contenteditable' ) ) {
this.fragment.unrender = noop;
} else {
this.node.appendChild( this.fragment.render() );
}
}
// Add proxy event handlers
if ( this.eventHandlers ) {
this.eventHandlers.forEach( function( h ) {
return h.render();
} );
}
// deal with two-way bindings
if ( this.binding ) {
this.binding.render();
this.node._ractive.binding = this.binding;
}
// Special case: if this is an <img>, and we're in a crap browser, we may
// need to prevent it from overriding width and height when it loads the src
if ( this.name === 'img' ) {
renderImage( this );
}
// apply decorator(s)
if ( this.decorator && this.decorator.fn ) {
runloop.scheduleTask( function() {
this$0.decorator.init();
} );
}
// trigger intro transition
if ( root.transitionsEnabled && this.intro ) {
var transition = new Transition( this, this.intro, true );
runloop.registerTransition( transition );
runloop.scheduleTask( function() {
return transition.start();
} );
}
if ( this.name === 'option' ) {
processOption( this );
}
if ( this.node.autofocus ) {
// Special case. Some browsers (*cough* Firefix *cough*) have a problem
// with dynamically-generated elements having autofocus, and they won't
// allow you to programmatically focus the element until it's in the DOM
runloop.scheduleTask( function() {
return this$0.node.focus();
} );
}
updateLiveQueries( this );
return this.node;
};
function getNamespace( element ) {
var namespace, xmlns, parent;
// Use specified namespace...
if ( xmlns = element.getAttribute( 'xmlns' ) ) {
namespace = xmlns;
} else if ( element.name === 'svg' ) {
namespace = namespaces.svg;
} else if ( parent = element.parent ) {
// ...or HTML, if the parent is a <foreignObject>
if ( parent.name === 'foreignObject' ) {
namespace = namespaces.html;
} else {
namespace = parent.node.namespaceURI;
}
} else {
namespace = element.root.el.namespaceURI;
}
return namespace;
}
function processOption( option ) {
var optionValue, selectValue, i;
selectValue = option.select.getAttribute( 'value' );
if ( selectValue === undefined ) {
return;
}
optionValue = option.getAttribute( 'value' );
if ( option.select.node.multiple && isArray( selectValue ) ) {
i = selectValue.length;
while ( i-- ) {
if ( optionValue == selectValue[ i ] ) {
option.node.selected = true;
break;
}
}
} else {
option.node.selected = optionValue == selectValue;
}
}
function updateLiveQueries( element ) {
var instance, liveQueries, i, selector, query;
// Does this need to be added to any live queries?
instance = element.root;
do {
liveQueries = instance._liveQueries;
i = liveQueries.length;
while ( i-- ) {
selector = liveQueries[ i ];
query = liveQueries[ '_' + selector ];
if ( query._test( element ) ) {
// keep register of applicable selectors, for when we teardown
( element.liveQueries || ( element.liveQueries = [] ) ).push( query );
}
}
} while ( instance = instance._parent );
}
}( namespaces, isArray, warn, create, createElement, defineProperty, noop, runloop, getInnerContext, render, Transition );
/* config/voidElementNames.js */
var voidElementNames = function() {
var voidElementNames = /^(?:area|base|br|col|command|doctype|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/i;
return voidElementNames;
}();
/* virtualdom/items/Element/prototype/toString.js */
var virtualdom_items_Element$toString = function( voidElementNames, isArray ) {
return function() {
var str, escape;
str = '<' + ( this.template.y ? '!DOCTYPE' : this.template.e );
str += this.attributes.map( stringifyAttribute ).join( '' );
// Special case - selected options
if ( this.name === 'option' && optionIsSelected( this ) ) {
str += ' selected';
}
// Special case - two-way radio name bindings
if ( this.name === 'input' && inputIsCheckedRadio( this ) ) {
str += ' checked';
}
str += '>';
if ( this.fragment ) {
escape = this.name !== 'script' && this.name !== 'style';
str += this.fragment.toString( escape );
}
// add a closing tag if this isn't a void element
if ( !voidElementNames.test( this.template.e ) ) {
str += '</' + this.template.e + '>';
}
return str;
};
function optionIsSelected( element ) {
var optionValue, selectValue, i;
optionValue = element.getAttribute( 'value' );
if ( optionValue === undefined ) {
return false;
}
selectValue = element.select.getAttribute( 'value' );
if ( selectValue == optionValue ) {
return true;
}
if ( element.select.getAttribute( 'multiple' ) && isArray( selectValue ) ) {
i = selectValue.length;
while ( i-- ) {
if ( selectValue[ i ] == optionValue ) {
return true;
}
}
}
}
function inputIsCheckedRadio( element ) {
var attributes, typeAttribute, valueAttribute, nameAttribute;
attributes = element.attributes;
typeAttribute = attributes.type;
valueAttribute = attributes.value;
nameAttribute = attributes.name;
if ( !typeAttribute || typeAttribute.value !== 'radio' || !valueAttribute || !nameAttribute.interpolator ) {
return;
}
if ( valueAttribute.value === nameAttribute.interpolator.value ) {
return true;
}
}
function stringifyAttribute( attribute ) {
var str = attribute.toString();
return str ? ' ' + str : '';
}
}( voidElementNames, isArray );
/* virtualdom/items/Element/special/option/unbind.js */
var virtualdom_items_Element_special_option_unbind = function( removeFromArray ) {
return function unbindOption( option ) {
removeFromArray( option.select.options, option );
};
}( removeFromArray );
/* virtualdom/items/Element/prototype/unbind.js */
var virtualdom_items_Element$unbind = function( unbindOption ) {
return function Element$unbind() {
if ( this.fragment ) {
this.fragment.unbind();
}
if ( this.binding ) {
this.binding.unbind();
}
// Special case - <option>
if ( this.name === 'option' ) {
unbindOption( this );
}
this.attributes.forEach( unbindAttribute );
};
function unbindAttribute( attribute ) {
attribute.unbind();
}
}( virtualdom_items_Element_special_option_unbind );
/* virtualdom/items/Element/prototype/unrender.js */
var virtualdom_items_Element$unrender = function( runloop, Transition ) {
return function Element$unrender( shouldDestroy ) {
var binding, bindings;
// Detach as soon as we can
if ( this.name === 'option' ) {
// <option> elements detach immediately, so that
// their parent <select> element syncs correctly, and
// since option elements can't have transitions anyway
this.detach();
} else if ( shouldDestroy ) {
runloop.detachWhenReady( this );
}
// Children first. that way, any transitions on child elements will be
// handled by the current transitionManager
if ( this.fragment ) {
this.fragment.unrender( false );
}
if ( binding = this.binding ) {
this.binding.unrender();
this.node._ractive.binding = null;
bindings = this.root._twowayBindings[ binding.keypath ];
bindings.splice( bindings.indexOf( binding ), 1 );
}
// Remove event handlers
if ( this.eventHandlers ) {
this.eventHandlers.forEach( function( h ) {
return h.unrender();
} );
}
if ( this.decorator ) {
this.decorator.teardown();
}
// trigger outro transition if necessary
if ( this.root.transitionsEnabled && this.outro ) {
var transition = new Transition( this, this.outro, false );
runloop.registerTransition( transition );
runloop.scheduleTask( function() {
return transition.start();
} );
}
// Remove this node from any live queries
if ( this.liveQueries ) {
removeFromLiveQueries( this );
}
};
function removeFromLiveQueries( element ) {
var query, selector, i;
i = element.liveQueries.length;
while ( i-- ) {
query = element.liveQueries[ i ];
selector = query.selector;
query._remove( element.node );
}
}
}( runloop, Transition );
/* virtualdom/items/Element/_Element.js */
var Element = function( bubble, detach, find, findAll, findAllComponents, findComponent, findNextNode, firstNode, getAttribute, init, rebind, render, toString, unbind, unrender ) {
var Element = function( options ) {
this.init( options );
};
Element.prototype = {
bubble: bubble,
detach: detach,
find: find,
findAll: findAll,
findAllComponents: findAllComponents,
findComponent: findComponent,
findNextNode: findNextNode,
firstNode: firstNode,
getAttribute: getAttribute,
init: init,
rebind: rebind,
render: render,
toString: toString,
unbind: unbind,
unrender: unrender
};
return Element;
}( virtualdom_items_Element$bubble, virtualdom_items_Element$detach, virtualdom_items_Element$find, virtualdom_items_Element$findAll, virtualdom_items_Element$findAllComponents, virtualdom_items_Element$findComponent, virtualdom_items_Element$findNextNode, virtualdom_items_Element$firstNode, virtualdom_items_Element$getAttribute, virtualdom_items_Element$init, virtualdom_items_Element$rebind, virtualdom_items_Element$render, virtualdom_items_Element$toString, virtualdom_items_Element$unbind, virtualdom_items_Element$unrender );
/* virtualdom/items/Partial/deIndent.js */
var deIndent = function() {
var empty = /^\s*$/,
leadingWhitespace = /^\s*/;
return function( str ) {
var lines, firstLine, lastLine, minIndent;
lines = str.split( '\n' );
// remove first and last line, if they only contain whitespace
firstLine = lines[ 0 ];
if ( firstLine !== undefined && empty.test( firstLine ) ) {
lines.shift();
}
lastLine = lines[ lines.length - 1 ];
if ( lastLine !== undefined && empty.test( lastLine ) ) {
lines.pop();
}
minIndent = lines.reduce( reducer, null );
if ( minIndent ) {
str = lines.map( function( line ) {
return line.replace( minIndent, '' );
} ).join( '\n' );
}
return str;
};
function reducer( previous, line ) {
var lineIndent = leadingWhitespace.exec( line )[ 0 ];
if ( previous === null || lineIndent.length < previous.length ) {
return lineIndent;
}
return previous;
}
}();
/* virtualdom/items/Partial/getPartialDescriptor.js */
var getPartialDescriptor = function( log, config, parser, deIndent ) {
return function getPartialDescriptor( ractive, name ) {
var partial;
// If the partial in instance or view heirarchy instances, great
if ( partial = getPartialFromRegistry( ractive, name ) ) {
return partial;
}
// Does it exist on the page as a script tag?
partial = parser.fromId( name, {
noThrow: true
} );
if ( partial ) {
// is this necessary?
partial = deIndent( partial );
// parse and register to this ractive instance
var parsed = parser.parse( partial, parser.getParseOptions( ractive ) );
// register (and return main partial if there are others in the template)
return ractive.partials[ name ] = parsed.t;
}
log.error( {
debug: ractive.debug,
message: 'noTemplateForPartial',
args: {
name: name
}
} );
// No match? Return an empty array
return [];
};
function getPartialFromRegistry( ractive, name ) {
var partials = config.registries.partials;
// find first instance in the ractive or view hierarchy that has this partial
var instance = partials.findInstance( ractive, name );
if ( !instance ) {
return;
}
var partial = instance.partials[ name ],
fn;
// partial is a function?
if ( typeof partial === 'function' ) {
fn = partial.bind( instance );
fn.isOwner = instance.partials.hasOwnProperty( name );
partial = fn( instance.data, parser );
}
if ( !partial ) {
log.warn( {
debug: ractive.debug,
message: 'noRegistryFunctionReturn',
args: {
registry: 'partial',
name: name
}
} );
return;
}
// If this was added manually to the registry,
// but hasn't been parsed, parse it now
if ( !parser.isParsed( partial ) ) {
// use the parseOptions of the ractive instance on which it was found
var parsed = parser.parse( partial, parser.getParseOptions( instance ) );
// Partials cannot contain nested partials!
// TODO add a test for this
if ( parsed.p ) {
log.warn( {
debug: ractive.debug,
message: 'noNestedPartials',
args: {
rname: name
}
} );
}
// if fn, use instance to store result, otherwise needs to go
// in the correct point in prototype chain on instance or constructor
var target = fn ? instance : partials.findOwner( instance, name );
// may be a template with partials, which need to be registered and main template extracted
target.partials[ name ] = partial = parsed.t;
}
// store for reset
if ( fn ) {
partial._fn = fn;
}
return partial.v ? partial.t : partial;
}
}( log, config, parser, deIndent );
/* virtualdom/items/Partial/applyIndent.js */
var applyIndent = function( string, indent ) {
var indented;
if ( !indent ) {
return string;
}
indented = string.split( '\n' ).map( function( line, notFirstLine ) {
return notFirstLine ? indent + line : line;
} ).join( '\n' );
return indented;
};
/* virtualdom/items/Partial/_Partial.js */
var Partial = function( types, getPartialDescriptor, applyIndent, circular ) {
var Partial, Fragment;
circular.push( function() {
Fragment = circular.Fragment;
} );
Partial = function( options ) {
var parentFragment = this.parentFragment = options.parentFragment,
template;
this.type = types.PARTIAL;
this.name = options.template.r;
this.index = options.index;
this.root = parentFragment.root;
if ( !options.template.r ) {
// TODO support dynamic partial switching
throw new Error( 'Partials must have a static reference (no expressions). This may change in a future version of Ractive.' );
}
template = getPartialDescriptor( parentFragment.root, options.template.r );
this.fragment = new Fragment( {
template: template,
root: parentFragment.root,
owner: this,
pElement: parentFragment.pElement
} );
};
Partial.prototype = {
bubble: function() {
this.parentFragment.bubble();
},
firstNode: function() {
return this.fragment.firstNode();
},
findNextNode: function() {
return this.parentFragment.findNextNode( this );
},
detach: function() {
return this.fragment.detach();
},
render: function() {
return this.fragment.render();
},
unrender: function( shouldDestroy ) {
this.fragment.unrender( shouldDestroy );
},
rebind: function( indexRef, newIndex, oldKeypath, newKeypath ) {
return this.fragment.rebind( indexRef, newIndex, oldKeypath, newKeypath );
},
unbind: function() {
this.fragment.unbind();
},
toString: function( toString ) {
var string, previousItem, lastLine, match;
string = this.fragment.toString( toString );
previousItem = this.parentFragment.items[ this.index - 1 ];
if ( !previousItem || previousItem.type !== types.TEXT ) {
return string;
}
lastLine = previousItem.template.split( '\n' ).pop();
if ( match = /^\s+$/.exec( lastLine ) ) {
return applyIndent( string, match[ 0 ] );
}
return string;
},
find: function( selector ) {
return this.fragment.find( selector );
},
findAll: function( selector, query ) {
return this.fragment.findAll( selector, query );
},
findComponent: function( selector ) {
return this.fragment.findComponent( selector );
},
findAllComponents: function( selector, query ) {
return this.fragment.findAllComponents( selector, query );
},
getValue: function() {
return this.fragment.getValue();
}
};
return Partial;
}( types, getPartialDescriptor, applyIndent, circular );
/* virtualdom/items/Component/getComponent.js */
var getComponent = function( config, log, circular ) {
var Ractive;
circular.push( function() {
Ractive = circular.Ractive;
} );
// finds the component constructor in the registry or view hierarchy registries
return function getComponent( ractive, name ) {
var component, instance = config.registries.components.findInstance( ractive, name );
if ( instance ) {
component = instance.components[ name ];
// best test we have for not Ractive.extend
if ( !component._parent ) {
// function option, execute and store for reset
var fn = component.bind( instance );
fn.isOwner = instance.components.hasOwnProperty( name );
component = fn( instance.data );
if ( !component ) {
log.warn( {
debug: ractive.debug,
message: 'noRegistryFunctionReturn',
args: {
registry: 'component',
name: name
}
} );
return;
}
if ( typeof component === 'string' ) {
//allow string lookup
component = getComponent( ractive, component );
}
component._fn = fn;
instance.components[ name ] = component;
}
}
return component;
};
}( config, log, circular );
/* virtualdom/items/Component/prototype/detach.js */
var virtualdom_items_Component$detach = function Component$detach() {
return this.instance.fragment.detach();
};
/* virtualdom/items/Component/prototype/find.js */
var virtualdom_items_Component$find = function Component$find( selector ) {
return this.instance.fragment.find( selector );
};
/* virtualdom/items/Component/prototype/findAll.js */
var virtualdom_items_Component$findAll = function Component$findAll( selector, query ) {
return this.instance.fragment.findAll( selector, query );
};
/* virtualdom/items/Component/prototype/findAllComponents.js */
var virtualdom_items_Component$findAllComponents = function Component$findAllComponents( selector, query ) {
query._test( this, true );
if ( this.instance.fragment ) {
this.instance.fragment.findAllComponents( selector, query );
}
};
/* virtualdom/items/Component/prototype/findComponent.js */
var virtualdom_items_Component$findComponent = function Component$findComponent( selector ) {
if ( !selector || selector === this.name ) {
return this.instance;
}
if ( this.instance.fragment ) {
return this.instance.fragment.findComponent( selector );
}
return null;
};
/* virtualdom/items/Component/prototype/findNextNode.js */
var virtualdom_items_Component$findNextNode = function Component$findNextNode() {
return this.parentFragment.findNextNode( this );
};
/* virtualdom/items/Component/prototype/firstNode.js */
var virtualdom_items_Component$firstNode = function Component$firstNode() {
if ( this.rendered ) {
return this.instance.fragment.firstNode();
}
return null;
};
/* virtualdom/items/Component/initialise/createModel/ComponentParameter.js */
var ComponentParameter = function( runloop, circular ) {
var Fragment, ComponentParameter;
circular.push( function() {
Fragment = circular.Fragment;
} );
ComponentParameter = function( component, key, value ) {
this.parentFragment = component.parentFragment;
this.component = component;
this.key = key;
this.fragment = new Fragment( {
template: value,
root: component.root,
owner: this
} );
this.value = this.fragment.getValue();
};
ComponentParameter.prototype = {
bubble: function() {
if ( !this.dirty ) {
this.dirty = true;
runloop.addView( this );
}
},
update: function() {
var value = this.fragment.getValue();
this.component.instance.viewmodel.set( this.key, value );
runloop.addViewmodel( this.component.instance.viewmodel );
this.value = value;
this.dirty = false;
},
rebind: function( indexRef, newIndex, oldKeypath, newKeypath ) {
this.fragment.rebind( indexRef, newIndex, oldKeypath, newKeypath );
},
unbind: function() {
this.fragment.unbind();
}
};
return ComponentParameter;
}( runloop, circular );
/* virtualdom/items/Component/initialise/createModel/_createModel.js */
var createModel = function( types, parseJSON, resolveRef, ComponentParameter ) {
return function( component, defaultData, attributes, toBind ) {
var data = {},
key, value;
// some parameters, e.g. foo="The value is {{bar}}", are 'complex' - in
// other words, we need to construct a string fragment to watch
// when they change. We store these so they can be torn down later
component.complexParameters = [];
for ( key in attributes ) {
if ( attributes.hasOwnProperty( key ) ) {
value = getValue( component, key, attributes[ key ], toBind );
if ( value !== undefined || defaultData[ key ] === undefined ) {
data[ key ] = value;
}
}
}
return data;
};
function getValue( component, key, template, toBind ) {
var parameter, parsed, parentInstance, parentFragment, keypath, indexRef;
parentInstance = component.root;
parentFragment = component.parentFragment;
// If this is a static value, great
if ( typeof template === 'string' ) {
parsed = parseJSON( template );
if ( !parsed ) {
return template;
}
return parsed.value;
}
// If null, we treat it as a boolean attribute (i.e. true)
if ( template === null ) {
return true;
}
// If a regular interpolator, we bind to it
if ( template.length === 1 && template[ 0 ].t === types.INTERPOLATOR && template[ 0 ].r ) {
// Is it an index reference?
if ( parentFragment.indexRefs && parentFragment.indexRefs[ indexRef = template[ 0 ].r ] !== undefined ) {
component.indexRefBindings[ indexRef ] = key;
return parentFragment.indexRefs[ indexRef ];
}
// TODO what about references that resolve late? Should these be considered?
keypath = resolveRef( parentInstance, template[ 0 ].r, parentFragment ) || template[ 0 ].r;
// We need to set up bindings between parent and child, but
// we can't do it yet because the child instance doesn't exist
// yet - so we make a note instead
toBind.push( {
childKeypath: key,
parentKeypath: keypath
} );
return parentInstance.viewmodel.get( keypath );
}
// We have a 'complex parameter' - we need to create a full-blown string
// fragment in order to evaluate and observe its value
parameter = new ComponentParameter( component, key, template );
component.complexParameters.push( parameter );
return parameter.value;
}
}( types, parseJSON, resolveRef, ComponentParameter );
/* virtualdom/items/Component/initialise/createInstance.js */
var createInstance = function( component, Component, data, contentDescriptor ) {
var instance, parentFragment, partials, root;
parentFragment = component.parentFragment;
root = component.root;
// Make contents available as a {{>content}} partial
partials = {
content: contentDescriptor || []
};
instance = new Component( {
append: true,
data: data,
partials: partials,
magic: root.magic || Component.defaults.magic,
modifyArrays: root.modifyArrays,
_parent: root,
_component: component,
// need to inherit runtime parent adaptors
adapt: root.adapt
} );
return instance;
};
/* virtualdom/items/Component/initialise/createBindings.js */
var createBindings = function( createComponentBinding ) {
return function createInitialComponentBindings( component, toBind ) {
toBind.forEach( function createInitialComponentBinding( pair ) {
var childValue, parentValue;
createComponentBinding( component, component.root, pair.parentKeypath, pair.childKeypath );
childValue = component.instance.viewmodel.get( pair.childKeypath );
parentValue = component.root.viewmodel.get( pair.parentKeypath );
if ( childValue !== undefined && parentValue === undefined ) {
component.root.viewmodel.set( pair.parentKeypath, childValue );
}
} );
};
}( createComponentBinding );
/* virtualdom/items/Component/initialise/propagateEvents.js */
var propagateEvents = function( log ) {
// TODO how should event arguments be handled? e.g.
// <widget on-foo='bar:1,2,3'/>
// The event 'bar' will be fired on the parent instance
// when 'foo' fires on the child, but the 1,2,3 arguments
// will be lost
return function( component, eventsDescriptor ) {
var eventName;
for ( eventName in eventsDescriptor ) {
if ( eventsDescriptor.hasOwnProperty( eventName ) ) {
propagateEvent( component.instance, component.root, eventName, eventsDescriptor[ eventName ] );
}
}
};
function propagateEvent( childInstance, parentInstance, eventName, proxyEventName ) {
if ( typeof proxyEventName !== 'string' ) {
log.error( {
debug: parentInstance.debug,
message: 'noComponentEventArguments'
} );
}
childInstance.on( eventName, function() {
var args = Array.prototype.slice.call( arguments );
args.unshift( proxyEventName );
parentInstance.fire.apply( parentInstance, args );
} );
}
}( log );
/* virtualdom/items/Component/initialise/updateLiveQueries.js */
var updateLiveQueries = function( component ) {
var ancestor, query;
// If there's a live query for this component type, add it
ancestor = component.root;
while ( ancestor ) {
if ( query = ancestor._liveComponentQueries[ '_' + component.name ] ) {
query.push( component.instance );
}
ancestor = ancestor._parent;
}
};
/* virtualdom/items/Component/prototype/init.js */
var virtualdom_items_Component$init = function( types, warn, createModel, createInstance, createBindings, propagateEvents, updateLiveQueries ) {
return function Component$init( options, Component ) {
var parentFragment, root, data, toBind;
parentFragment = this.parentFragment = options.parentFragment;
root = parentFragment.root;
this.root = root;
this.type = types.COMPONENT;
this.name = options.template.e;
this.index = options.index;
this.indexRefBindings = {};
this.bindings = [];
if ( !Component ) {
throw new Error( 'Component "' + this.name + '" not found' );
}
// First, we need to create a model for the component - e.g. if we
// encounter <widget foo='bar'/> then we need to create a widget
// with `data: { foo: 'bar' }`.
//
// This may involve setting up some bindings, but we can't do it
// yet so we take some notes instead
toBind = [];
data = createModel( this, Component.defaults.data || {}, options.template.a, toBind );
createInstance( this, Component, data, options.template.f );
createBindings( this, toBind );
propagateEvents( this, options.template.v );
// intro, outro and decorator directives have no effect
if ( options.template.t1 || options.template.t2 || options.template.o ) {
warn( 'The "intro", "outro" and "decorator" directives have no effect on components' );
}
updateLiveQueries( this );
};
}( types, warn, createModel, createInstance, createBindings, propagateEvents, updateLiveQueries );
/* virtualdom/items/Component/prototype/rebind.js */
var virtualdom_items_Component$rebind = function( runloop, getNewKeypath ) {
return function Component$rebind( indexRef, newIndex, oldKeypath, newKeypath ) {
var childInstance = this.instance,
parentInstance = childInstance._parent,
indexRefAlias, query;
this.bindings.forEach( function( binding ) {
var updated;
if ( binding.root !== parentInstance ) {
return;
}
if ( updated = getNewKeypath( binding.keypath, oldKeypath, newKeypath ) ) {
binding.rebind( updated );
}
} );
this.complexParameters.forEach( function( parameter ) {
parameter.rebind( indexRef, newIndex, oldKeypath, newKeypath );
} );
if ( indexRefAlias = this.indexRefBindings[ indexRef ] ) {
runloop.addViewmodel( childInstance.viewmodel );
childInstance.viewmodel.set( indexRefAlias, newIndex );
}
if ( query = this.root._liveComponentQueries[ '_' + this.name ] ) {
query._makeDirty();
}
};
}( runloop, getNewKeypath );
/* virtualdom/items/Component/prototype/render.js */
var virtualdom_items_Component$render = function Component$render() {
var instance = this.instance;
instance.render( this.parentFragment.getNode() );
this.rendered = true;
return instance.detach();
};
/* virtualdom/items/Component/prototype/toString.js */
var virtualdom_items_Component$toString = function Component$toString() {
return this.instance.fragment.toString();
};
/* virtualdom/items/Component/prototype/unbind.js */
var virtualdom_items_Component$unbind = function() {
return function Component$unbind() {
this.complexParameters.forEach( unbind );
this.bindings.forEach( unbind );
removeFromLiveComponentQueries( this );
this.instance.fragment.unbind();
};
function unbind( thing ) {
thing.unbind();
}
function removeFromLiveComponentQueries( component ) {
var instance, query;
instance = component.root;
do {
if ( query = instance._liveComponentQueries[ '_' + component.name ] ) {
query._remove( component );
}
} while ( instance = instance._parent );
}
}();
/* virtualdom/items/Component/prototype/unrender.js */
var virtualdom_items_Component$unrender = function Component$unrender( shouldDestroy ) {
this.instance.fire( 'teardown' );
this.shouldDestroy = shouldDestroy;
this.instance.unrender();
};
/* virtualdom/items/Component/_Component.js */
var Component = function( detach, find, findAll, findAllComponents, findComponent, findNextNode, firstNode, init, rebind, render, toString, unbind, unrender ) {
var Component = function( options, Constructor ) {
this.init( options, Constructor );
};
Component.prototype = {
detach: detach,
find: find,
findAll: findAll,
findAllComponents: findAllComponents,
findComponent: findComponent,
findNextNode: findNextNode,
firstNode: firstNode,
init: init,
rebind: rebind,
render: render,
toString: toString,
unbind: unbind,
unrender: unrender
};
return Component;
}( virtualdom_items_Component$detach, virtualdom_items_Component$find, virtualdom_items_Component$findAll, virtualdom_items_Component$findAllComponents, virtualdom_items_Component$findComponent, virtualdom_items_Component$findNextNode, virtualdom_items_Component$firstNode, virtualdom_items_Component$init, virtualdom_items_Component$rebind, virtualdom_items_Component$render, virtualdom_items_Component$toString, virtualdom_items_Component$unbind, virtualdom_items_Component$unrender );
/* virtualdom/items/Comment.js */
var Comment = function( types, detach ) {
var Comment = function( options ) {
this.type = types.COMMENT;
this.value = options.template.c;
};
Comment.prototype = {
detach: detach,
firstNode: function() {
return this.node;
},
render: function() {
if ( !this.node ) {
this.node = document.createComment( this.value );
}
return this.node;
},
toString: function() {
return '<!--' + this.value + '-->';
},
unrender: function( shouldDestroy ) {
if ( shouldDestroy ) {
this.node.parentNode.removeChild( this.node );
}
}
};
return Comment;
}( types, detach );
/* virtualdom/Fragment/prototype/init/createItem.js */
var virtualdom_Fragment$init_createItem = function( types, Text, Interpolator, Section, Triple, Element, Partial, getComponent, Component, Comment ) {
return function createItem( options ) {
if ( typeof options.template === 'string' ) {
return new Text( options );
}
switch ( options.template.t ) {
case types.INTERPOLATOR:
return new Interpolator( options );
case types.SECTION:
return new Section( options );
case types.TRIPLE:
return new Triple( options );
case types.ELEMENT:
var constructor;
if ( constructor = getComponent( options.parentFragment.root, options.template.e ) ) {
return new Component( options, constructor );
}
return new Element( options );
case types.PARTIAL:
return new Partial( options );
case types.COMMENT:
return new Comment( options );
default:
throw new Error( 'Something very strange happened. Please file an issue at https://github.com/ractivejs/ractive/issues. Thanks!' );
}
};
}( types, Text, Interpolator, Section, Triple, Element, Partial, getComponent, Component, Comment );
/* virtualdom/Fragment/prototype/init.js */
var virtualdom_Fragment$init = function( types, create, createItem ) {
return function Fragment$init( options ) {
var this$0 = this;
var parentFragment, parentRefs, ref;
// The item that owns this fragment - an element, section, partial, or attribute
this.owner = options.owner;
parentFragment = this.parent = this.owner.parentFragment;
// inherited properties
this.root = options.root;
this.pElement = options.pElement;
this.context = options.context;
// If parent item is a section, this may not be the only fragment
// that belongs to it - we need to make a note of the index
if ( this.owner.type === types.SECTION ) {
this.index = options.index;
}
// index references (the 'i' in {{#section:i}}...{{/section}}) need to cascade
// down the tree
if ( parentFragment ) {
parentRefs = parentFragment.indexRefs;
if ( parentRefs ) {
this.indexRefs = create( null );
// avoids need for hasOwnProperty
for ( ref in parentRefs ) {
this.indexRefs[ ref ] = parentRefs[ ref ];
}
}
}
// inherit priority
this.priority = parentFragment ? parentFragment.priority + 1 : 1;
if ( options.indexRef ) {
if ( !this.indexRefs ) {
this.indexRefs = {};
}
this.indexRefs[ options.indexRef ] = options.index;
}
// Time to create this fragment's child items
// TEMP should this be happening?
if ( typeof options.template === 'string' ) {
options.template = [ options.template ];
} else if ( !options.template ) {
options.template = [];
}
this.items = options.template.map( function( template, i ) {
return createItem( {
parentFragment: this$0,
pElement: options.pElement,
template: template,
index: i
} );
} );
this.value = this.argsList = null;
this.dirtyArgs = this.dirtyValue = true;
this.inited = true;
};
}( types, create, virtualdom_Fragment$init_createItem );
/* virtualdom/Fragment/prototype/rebind.js */
var virtualdom_Fragment$rebind = function( assignNewKeypath ) {
return function Fragment$rebind( indexRef, newIndex, oldKeypath, newKeypath ) {
// assign new context keypath if needed
assignNewKeypath( this, 'context', oldKeypath, newKeypath );
if ( this.indexRefs && this.indexRefs[ indexRef ] !== undefined ) {
this.indexRefs[ indexRef ] = newIndex;
}
this.items.forEach( function( item ) {
if ( item.rebind ) {
item.rebind( indexRef, newIndex, oldKeypath, newKeypath );
}
} );
};
}( assignNewKeypath );
/* virtualdom/Fragment/prototype/render.js */
var virtualdom_Fragment$render = function Fragment$render() {
var result;
if ( this.items.length === 1 ) {
result = this.items[ 0 ].render();
} else {
result = document.createDocumentFragment();
this.items.forEach( function( item ) {
result.appendChild( item.render() );
} );
}
this.rendered = true;
return result;
};
/* virtualdom/Fragment/prototype/toString.js */
var virtualdom_Fragment$toString = function Fragment$toString( escape ) {
if ( !this.items ) {
return '';
}
return this.items.map( function( item ) {
return item.toString( escape );
} ).join( '' );
};
/* virtualdom/Fragment/prototype/unbind.js */
var virtualdom_Fragment$unbind = function() {
return function Fragment$unbind() {
this.items.forEach( unbindItem );
};
function unbindItem( item ) {
if ( item.unbind ) {
item.unbind();
}
}
}();
/* virtualdom/Fragment/prototype/unrender.js */
var virtualdom_Fragment$unrender = function Fragment$unrender( shouldDestroy ) {
if ( !this.rendered ) {
throw new Error( 'Attempted to unrender a fragment that was not rendered' );
}
this.items.forEach( function( i ) {
return i.unrender( shouldDestroy );
} );
};
/* virtualdom/Fragment.js */
var Fragment = function( bubble, detach, find, findAll, findAllComponents, findComponent, findNextNode, firstNode, getNode, getValue, init, rebind, render, toString, unbind, unrender, circular ) {
var Fragment = function( options ) {
this.init( options );
};
Fragment.prototype = {
bubble: bubble,
detach: detach,
find: find,
findAll: findAll,
findAllComponents: findAllComponents,
findComponent: findComponent,
findNextNode: findNextNode,
firstNode: firstNode,
getNode: getNode,
getValue: getValue,
init: init,
rebind: rebind,
render: render,
toString: toString,
unbind: unbind,
unrender: unrender
};
circular.Fragment = Fragment;
return Fragment;
}( virtualdom_Fragment$bubble, virtualdom_Fragment$detach, virtualdom_Fragment$find, virtualdom_Fragment$findAll, virtualdom_Fragment$findAllComponents, virtualdom_Fragment$findComponent, virtualdom_Fragment$findNextNode, virtualdom_Fragment$firstNode, virtualdom_Fragment$getNode, virtualdom_Fragment$getValue, virtualdom_Fragment$init, virtualdom_Fragment$rebind, virtualdom_Fragment$render, virtualdom_Fragment$toString, virtualdom_Fragment$unbind, virtualdom_Fragment$unrender, circular );
/* Ractive/prototype/reset.js */
var Ractive$reset = function( runloop, Fragment, config ) {
var shouldRerender = [
'template',
'partials',
'components',
'decorators',
'events'
];
return function Ractive$reset( data, callback ) {
var promise, wrapper, changes, i, rerender;
if ( typeof data === 'function' && !callback ) {
callback = data;
data = {};
} else {
data = data || {};
}
if ( typeof data !== 'object' ) {
throw new Error( 'The reset method takes either no arguments, or an object containing new data' );
}
// If the root object is wrapped, try and use the wrapper's reset value
if ( ( wrapper = this.viewmodel.wrapped[ '' ] ) && wrapper.reset ) {
if ( wrapper.reset( data ) === false ) {
// reset was rejected, we need to replace the object
this.data = data;
}
} else {
this.data = data;
}
// reset config items and track if need to rerender
changes = config.reset( this );
i = changes.length;
while ( i-- ) {
if ( shouldRerender.indexOf( changes[ i ] ) > -1 ) {
rerender = true;
break;
}
}
if ( rerender ) {
var component;
this.viewmodel.mark( '' );
// Is this is a component, we need to set the `shouldDestroy`
// flag, otherwise it will assume by default that a parent node
// will be detached, and therefore it doesn't need to bother
// detaching its own nodes
if ( component = this.component ) {
component.shouldDestroy = true;
}
this.unrender();
if ( component ) {
component.shouldDestroy = false;
}
// If the template changed, we need to destroy the parallel DOM
// TODO if we're here, presumably it did?
if ( this.fragment.template !== this.template ) {
this.fragment.unbind();
this.fragment = new Fragment( {
template: this.template,
root: this,
owner: this
} );
}
promise = this.render( this.el, this.anchor );
} else {
promise = runloop.start( this, true );
this.viewmodel.mark( '' );
runloop.end();
}
this.fire( 'reset', data );
if ( callback ) {
promise.then( callback );
}
return promise;
};
}( runloop, Fragment, config );
/* Ractive/prototype/resetTemplate.js */
var Ractive$resetTemplate = function( config, Fragment ) {
// TODO should resetTemplate be asynchronous? i.e. should it be a case
// of outro, update template, intro? I reckon probably not, since that
// could be achieved with unrender-resetTemplate-render. Also, it should
// conceptually be similar to resetPartial, which couldn't be async
return function Ractive$resetTemplate( template ) {
var transitionsEnabled, component;
config.template.init( null, this, {
template: template
} );
transitionsEnabled = this.transitionsEnabled;
this.transitionsEnabled = false;
// Is this is a component, we need to set the `shouldDestroy`
// flag, otherwise it will assume by default that a parent node
// will be detached, and therefore it doesn't need to bother
// detaching its own nodes
if ( component = this.component ) {
component.shouldDestroy = true;
}
this.unrender();
if ( component ) {
component.shouldDestroy = false;
}
// remove existing fragment and create new one
this.fragment.unbind();
this.fragment = new Fragment( {
template: this.template,
root: this,
owner: this
} );
this.render( this.el, this.anchor );
this.transitionsEnabled = transitionsEnabled;
};
}( config, Fragment );
/* Ractive/prototype/reverse.js */
var Ractive$reverse = function( makeArrayMethod ) {
return makeArrayMethod( 'reverse' );
}( Ractive$shared_makeArrayMethod );
/* Ractive/prototype/set.js */
var Ractive$set = function( runloop, isObject, normaliseKeypath, getMatchingKeypaths ) {
var wildcard = /\*/;
return function Ractive$set( keypath, value, callback ) {
var this$0 = this;
var map, promise;
promise = runloop.start( this, true );
// Set multiple keypaths in one go
if ( isObject( keypath ) ) {
map = keypath;
callback = value;
for ( keypath in map ) {
if ( map.hasOwnProperty( keypath ) ) {
value = map[ keypath ];
keypath = normaliseKeypath( keypath );
this.viewmodel.set( keypath, value );
}
}
} else {
keypath = normaliseKeypath( keypath );
if ( wildcard.test( keypath ) ) {
getMatchingKeypaths( this, keypath ).forEach( function( keypath ) {
this$0.viewmodel.set( keypath, value );
} );
} else {
this.viewmodel.set( keypath, value );
}
}
runloop.end();
if ( callback ) {
promise.then( callback.bind( this ) );
}
return promise;
};
}( runloop, isObject, normaliseKeypath, getMatchingKeypaths );
/* Ractive/prototype/shift.js */
var Ractive$shift = function( makeArrayMethod ) {
return makeArrayMethod( 'shift' );
}( Ractive$shared_makeArrayMethod );
/* Ractive/prototype/sort.js */
var Ractive$sort = function( makeArrayMethod ) {
return makeArrayMethod( 'sort' );
}( Ractive$shared_makeArrayMethod );
/* Ractive/prototype/splice.js */
var Ractive$splice = function( makeArrayMethod ) {
return makeArrayMethod( 'splice' );
}( Ractive$shared_makeArrayMethod );
/* Ractive/prototype/subtract.js */
var Ractive$subtract = function( add ) {
return function Ractive$subtract( keypath, d ) {
return add( this, keypath, d === undefined ? -1 : -d );
};
}( Ractive$shared_add );
/* Ractive/prototype/teardown.js */
var Ractive$teardown = function( Promise ) {
// Teardown. This goes through the root fragment and all its children, removing observers
// and generally cleaning up after itself
return function Ractive$teardown( callback ) {
var promise;
this.fire( 'teardown' );
this.fragment.unbind();
this.viewmodel.teardown();
promise = this.rendered ? this.unrender() : Promise.resolve();
if ( callback ) {
// TODO deprecate this?
promise.then( callback.bind( this ) );
}
return promise;
};
}( Promise );
/* Ractive/prototype/toggle.js */
var Ractive$toggle = function( log ) {
return function Ractive$toggle( keypath, callback ) {
var value;
if ( typeof keypath !== 'string' ) {
log.errorOnly( {
debug: this.debug,
messsage: 'badArguments',
arg: {
arguments: keypath
}
} );
}
value = this.get( keypath );
return this.set( keypath, !value, callback );
};
}( log );
/* Ractive/prototype/toHTML.js */
var Ractive$toHTML = function Ractive$toHTML() {
return this.fragment.toString( true );
};
/* Ractive/prototype/unrender.js */
var Ractive$unrender = function( removeFromArray, runloop, css ) {
return function Ractive$unrender() {
var this$0 = this;
var promise, shouldDestroy;
if ( !this.rendered ) {
throw new Error( 'ractive.unrender() was called on a Ractive instance that was not rendered' );
}
promise = runloop.start( this, true );
// If this is a component, and the component isn't marked for destruction,
// don't detach nodes from the DOM unnecessarily
shouldDestroy = !this.component || this.component.shouldDestroy;
shouldDestroy = shouldDestroy || this.shouldDestroy;
if ( this.constructor.css ) {
promise.then( function() {
css.remove( this$0.constructor );
} );
}
// Cancel any animations in progress
while ( this._animations[ 0 ] ) {
this._animations[ 0 ].stop();
}
this.fragment.unrender( shouldDestroy );
this.rendered = false;
removeFromArray( this.el.__ractive_instances__, this );
runloop.end();
return promise;
};
}( removeFromArray, runloop, global_css );
/* Ractive/prototype/unshift.js */
var Ractive$unshift = function( makeArrayMethod ) {
return makeArrayMethod( 'unshift' );
}( Ractive$shared_makeArrayMethod );
/* Ractive/prototype/update.js */
var Ractive$update = function( runloop ) {
return function Ractive$update( keypath, callback ) {
var promise;
if ( typeof keypath === 'function' ) {
callback = keypath;
keypath = '';
} else {
keypath = keypath || '';
}
promise = runloop.start( this, true );
this.viewmodel.mark( keypath );
runloop.end();
this.fire( 'update', keypath );
if ( callback ) {
promise.then( callback.bind( this ) );
}
return promise;
};
}( runloop );
/* Ractive/prototype/updateModel.js */
var Ractive$updateModel = function( arrayContentsMatch, isEqual ) {
return function Ractive$updateModel( keypath, cascade ) {
var values;
if ( typeof keypath !== 'string' ) {
keypath = '';
cascade = true;
}
consolidateChangedValues( this, keypath, values = {}, cascade );
return this.set( values );
};
function consolidateChangedValues( ractive, keypath, values, cascade ) {
var bindings, childDeps, i, binding, oldValue, newValue, checkboxGroups = [];
bindings = ractive._twowayBindings[ keypath ];
if ( bindings && ( i = bindings.length ) ) {
while ( i-- ) {
binding = bindings[ i ];
// special case - radio name bindings
if ( binding.radioName && !binding.element.node.checked ) {
continue;
}
// special case - checkbox name bindings come in groups, so
// we want to get the value once at most
if ( binding.checkboxName ) {
if ( !checkboxGroups[ binding.keypath ] && !binding.changed() ) {
checkboxGroups.push( binding.keypath );
checkboxGroups[ binding.keypath ] = binding;
}
continue;
}
oldValue = binding.attribute.value;
newValue = binding.getValue();
if ( arrayContentsMatch( oldValue, newValue ) ) {
continue;
}
if ( !isEqual( oldValue, newValue ) ) {
values[ keypath ] = newValue;
}
}
}
// Handle groups of `<input type='checkbox' name='{{foo}}' ...>`
if ( checkboxGroups.length ) {
checkboxGroups.forEach( function( keypath ) {
var binding, oldValue, newValue;
binding = checkboxGroups[ keypath ];
// one to represent the entire group
oldValue = binding.attribute.value;
newValue = binding.getValue();
if ( !arrayContentsMatch( oldValue, newValue ) ) {
values[ keypath ] = newValue;
}
} );
}
if ( !cascade ) {
return;
}
// cascade
childDeps = ractive.viewmodel.depsMap[ 'default' ][ keypath ];
if ( childDeps ) {
i = childDeps.length;
while ( i-- ) {
consolidateChangedValues( ractive, childDeps[ i ], values, cascade );
}
}
}
}( arrayContentsMatch, isEqual );
/* Ractive/prototype.js */
var prototype = function( add, animate, detach, find, findAll, findAllComponents, findComponent, fire, get, insert, merge, observe, off, on, pop, push, render, reset, resetTemplate, reverse, set, shift, sort, splice, subtract, teardown, toggle, toHTML, unrender, unshift, update, updateModel ) {
return {
add: add,
animate: animate,
detach: detach,
find: find,
findAll: findAll,
findAllComponents: findAllComponents,
findComponent: findComponent,
fire: fire,
get: get,
insert: insert,
merge: merge,
observe: observe,
off: off,
on: on,
pop: pop,
push: push,
render: render,
reset: reset,
resetTemplate: resetTemplate,
reverse: reverse,
set: set,
shift: shift,
sort: sort,
splice: splice,
subtract: subtract,
teardown: teardown,
toggle: toggle,
toHTML: toHTML,
unrender: unrender,
unshift: unshift,
update: update,
updateModel: updateModel
};
}( Ractive$add, Ractive$animate, Ractive$detach, Ractive$find, Ractive$findAll, Ractive$findAllComponents, Ractive$findComponent, Ractive$fire, Ractive$get, Ractive$insert, Ractive$merge, Ractive$observe, Ractive$off, Ractive$on, Ractive$pop, Ractive$push, Ractive$render, Ractive$reset, Ractive$resetTemplate, Ractive$reverse, Ractive$set, Ractive$shift, Ractive$sort, Ractive$splice, Ractive$subtract, Ractive$teardown, Ractive$toggle, Ractive$toHTML, Ractive$unrender, Ractive$unshift, Ractive$update, Ractive$updateModel );
/* utils/getGuid.js */
var getGuid = function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace( /[xy]/g, function( c ) {
var r, v;
r = Math.random() * 16 | 0;
v = c == 'x' ? r : r & 3 | 8;
return v.toString( 16 );
} );
};
/* utils/getNextNumber.js */
var getNextNumber = function() {
var i = 0;
return function() {
return 'r-' + i++;
};
}();
/* viewmodel/prototype/get/arrayAdaptor/processWrapper.js */
var viewmodel$get_arrayAdaptor_processWrapper = function( wrapper, array, methodName, spliceSummary ) {
var root = wrapper.root,
keypath = wrapper.keypath;
// If this is a sort or reverse, we just do root.set()...
// TODO use merge logic?
if ( methodName === 'sort' || methodName === 'reverse' ) {
root.viewmodel.set( keypath, array );
return;
}
if ( !spliceSummary ) {
// (presumably we tried to pop from an array of zero length.
// in which case there's nothing to do)
return;
}
root.viewmodel.splice( keypath, spliceSummary );
};
/* viewmodel/prototype/get/arrayAdaptor/patch.js */
var viewmodel$get_arrayAdaptor_patch = function( runloop, defineProperty, getSpliceEquivalent, summariseSpliceOperation, processWrapper ) {
var patchedArrayProto = [],
mutatorMethods = [
'pop',
'push',
'reverse',
'shift',
'sort',
'splice',
'unshift'
],
testObj, patchArrayMethods, unpatchArrayMethods;
mutatorMethods.forEach( function( methodName ) {
var method = function() {
var spliceEquivalent, spliceSummary, result, wrapper, i;
// push, pop, shift and unshift can all be represented as a splice operation.
// this makes life easier later
spliceEquivalent = getSpliceEquivalent( this, methodName, Array.prototype.slice.call( arguments ) );
spliceSummary = summariseSpliceOperation( this, spliceEquivalent );
// apply the underlying method
result = Array.prototype[ methodName ].apply( this, arguments );
// trigger changes
this._ractive.setting = true;
i = this._ractive.wrappers.length;
while ( i-- ) {
wrapper = this._ractive.wrappers[ i ];
runloop.start( wrapper.root );
processWrapper( wrapper, this, methodName, spliceSummary );
runloop.end();
}
this._ractive.setting = false;
return result;
};
defineProperty( patchedArrayProto, methodName, {
value: method
} );
} );
// can we use prototype chain injection?
// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/#wrappers_prototype_chain_injection
testObj = {};
if ( testObj.__proto__ ) {
// yes, we can
patchArrayMethods = function( array ) {
array.__proto__ = patchedArrayProto;
};
unpatchArrayMethods = function( array ) {
array.__proto__ = Array.prototype;
};
} else {
// no, we can't
patchArrayMethods = function( array ) {
var i, methodName;
i = mutatorMethods.length;
while ( i-- ) {
methodName = mutatorMethods[ i ];
defineProperty( array, methodName, {
value: patchedArrayProto[ methodName ],
configurable: true
} );
}
};
unpatchArrayMethods = function( array ) {
var i;
i = mutatorMethods.length;
while ( i-- ) {
delete array[ mutatorMethods[ i ] ];
}
};
}
patchArrayMethods.unpatch = unpatchArrayMethods;
return patchArrayMethods;
}( runloop, defineProperty, getSpliceEquivalent, summariseSpliceOperation, viewmodel$get_arrayAdaptor_processWrapper );
/* viewmodel/prototype/get/arrayAdaptor.js */
var viewmodel$get_arrayAdaptor = function( defineProperty, isArray, patch ) {
var arrayAdaptor,
// helpers
ArrayWrapper, errorMessage;
arrayAdaptor = {
filter: function( object ) {
// wrap the array if a) b) it's an array, and b) either it hasn't been wrapped already,
// or the array didn't trigger the get() itself
return isArray( object ) && ( !object._ractive || !object._ractive.setting );
},
wrap: function( ractive, array, keypath ) {
return new ArrayWrapper( ractive, array, keypath );
}
};
ArrayWrapper = function( ractive, array, keypath ) {
this.root = ractive;
this.value = array;
this.keypath = keypath;
// if this array hasn't already been ractified, ractify it
if ( !array._ractive ) {
// define a non-enumerable _ractive property to store the wrappers
defineProperty( array, '_ractive', {
value: {
wrappers: [],
instances: [],
setting: false
},
configurable: true
} );
patch( array );
}
// store the ractive instance, so we can handle transitions later
if ( !array._ractive.instances[ ractive._guid ] ) {
array._ractive.instances[ ractive._guid ] = 0;
array._ractive.instances.push( ractive );
}
array._ractive.instances[ ractive._guid ] += 1;
array._ractive.wrappers.push( this );
};
ArrayWrapper.prototype = {
get: function() {
return this.value;
},
teardown: function() {
var array, storage, wrappers, instances, index;
array = this.value;
storage = array._ractive;
wrappers = storage.wrappers;
instances = storage.instances;
// if teardown() was invoked because we're clearing the cache as a result of
// a change that the array itself triggered, we can save ourselves the teardown
// and immediate setup
if ( storage.setting ) {
return false;
}
index = wrappers.indexOf( this );
if ( index === -1 ) {
throw new Error( errorMessage );
}
wrappers.splice( index, 1 );
// if nothing else depends on this array, we can revert it to its
// natural state
if ( !wrappers.length ) {
delete array._ractive;
patch.unpatch( this.value );
} else {
// remove ractive instance if possible
instances[ this.root._guid ] -= 1;
if ( !instances[ this.root._guid ] ) {
index = instances.indexOf( this.root );
if ( index === -1 ) {
throw new Error( errorMessage );
}
instances.splice( index, 1 );
}
}
}
};
errorMessage = 'Something went wrong in a rather interesting way';
return arrayAdaptor;
}( defineProperty, isArray, viewmodel$get_arrayAdaptor_patch );
/* viewmodel/prototype/get/magicArrayAdaptor.js */
var viewmodel$get_magicArrayAdaptor = function( magicAdaptor, arrayAdaptor ) {
var magicArrayAdaptor, MagicArrayWrapper;
if ( magicAdaptor ) {
magicArrayAdaptor = {
filter: function( object, keypath, ractive ) {
return magicAdaptor.filter( object, keypath, ractive ) && arrayAdaptor.filter( object );
},
wrap: function( ractive, array, keypath ) {
return new MagicArrayWrapper( ractive, array, keypath );
}
};
MagicArrayWrapper = function( ractive, array, keypath ) {
this.value = array;
this.magic = true;
this.magicWrapper = magicAdaptor.wrap( ractive, array, keypath );
this.arrayWrapper = arrayAdaptor.wrap( ractive, array, keypath );
};
MagicArrayWrapper.prototype = {
get: function() {
return this.value;
},
teardown: function() {
this.arrayWrapper.teardown();
this.magicWrapper.teardown();
},
reset: function( value ) {
return this.magicWrapper.reset( value );
}
};
}
return magicArrayAdaptor;
}( viewmodel$get_magicAdaptor, viewmodel$get_arrayAdaptor );
/* viewmodel/prototype/adapt.js */
var viewmodel$adapt = function( config, arrayAdaptor, magicAdaptor, magicArrayAdaptor ) {
var prefixers = {};
return function Viewmodel$adapt( keypath, value ) {
var ractive = this.ractive,
len, i, adaptor, wrapped;
// Do we have an adaptor for this value?
len = ractive.adapt.length;
for ( i = 0; i < len; i += 1 ) {
adaptor = ractive.adapt[ i ];
// Adaptors can be specified as e.g. [ 'Backbone.Model', 'Backbone.Collection' ] -
// we need to get the actual adaptor if that's the case
if ( typeof adaptor === 'string' ) {
var found = config.registries.adaptors.find( ractive, adaptor );
if ( !found ) {
throw new Error( 'Missing adaptor "' + adaptor + '"' );
}
adaptor = ractive.adapt[ i ] = found;
}
if ( adaptor.filter( value, keypath, ractive ) ) {
wrapped = this.wrapped[ keypath ] = adaptor.wrap( ractive, value, keypath, getPrefixer( keypath ) );
wrapped.value = value;
return value;
}
}
if ( ractive.magic ) {
if ( magicArrayAdaptor.filter( value, keypath, ractive ) ) {
this.wrapped[ keypath ] = magicArrayAdaptor.wrap( ractive, value, keypath );
} else if ( magicAdaptor.filter( value, keypath, ractive ) ) {
this.wrapped[ keypath ] = magicAdaptor.wrap( ractive, value, keypath );
}
} else if ( ractive.modifyArrays && arrayAdaptor.filter( value, keypath, ractive ) ) {
this.wrapped[ keypath ] = arrayAdaptor.wrap( ractive, value, keypath );
}
return value;
};
function prefixKeypath( obj, prefix ) {
var prefixed = {},
key;
if ( !prefix ) {
return obj;
}
prefix += '.';
for ( key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
prefixed[ prefix + key ] = obj[ key ];
}
}
return prefixed;
}
function getPrefixer( rootKeypath ) {
var rootDot;
if ( !prefixers[ rootKeypath ] ) {
rootDot = rootKeypath ? rootKeypath + '.' : '';
prefixers[ rootKeypath ] = function( relativeKeypath, value ) {
var obj;
if ( typeof relativeKeypath === 'string' ) {
obj = {};
obj[ rootDot + relativeKeypath ] = value;
return obj;
}
if ( typeof relativeKeypath === 'object' ) {
// 'relativeKeypath' is in fact a hash, not a keypath
return rootDot ? prefixKeypath( relativeKeypath, rootKeypath ) : relativeKeypath;
}
};
}
return prefixers[ rootKeypath ];
}
}( config, viewmodel$get_arrayAdaptor, viewmodel$get_magicAdaptor, viewmodel$get_magicArrayAdaptor );
/* viewmodel/helpers/getUpstreamChanges.js */
var getUpstreamChanges = function getUpstreamChanges( changes ) {
var upstreamChanges = [ '' ],
i, keypath, keys, upstreamKeypath;
i = changes.length;
while ( i-- ) {
keypath = changes[ i ];
keys = keypath.split( '.' );
while ( keys.length > 1 ) {
keys.pop();
upstreamKeypath = keys.join( '.' );
if ( upstreamChanges.indexOf( upstreamKeypath ) === -1 ) {
upstreamChanges.push( upstreamKeypath );
}
}
}
return upstreamChanges;
};
/* viewmodel/prototype/applyChanges/getPotentialWildcardMatches.js */
var viewmodel$applyChanges_getPotentialWildcardMatches = function() {
var starMaps = {};
// This function takes a keypath such as 'foo.bar.baz', and returns
// all the variants of that keypath that include a wildcard in place
// of a key, such as 'foo.bar.*', 'foo.*.baz', 'foo.*.*' and so on.
// These are then checked against the dependants map (ractive.viewmodel.depsMap)
// to see if any pattern observers are downstream of one or more of
// these wildcard keypaths (e.g. 'foo.bar.*.status')
return function getPotentialWildcardMatches( keypath ) {
var keys, starMap, mapper, result;
keys = keypath.split( '.' );
starMap = getStarMap( keys.length );
mapper = function( star, i ) {
return star ? '*' : keys[ i ];
};
result = starMap.map( function( mask ) {
return mask.map( mapper ).join( '.' );
} );
return result;
};
// This function returns all the possible true/false combinations for
// a given number - e.g. for two, the possible combinations are
// [ true, true ], [ true, false ], [ false, true ], [ false, false ].
// It does so by getting all the binary values between 0 and e.g. 11
function getStarMap( length ) {
var ones = '',
max, binary, starMap, mapper, i;
if ( !starMaps[ length ] ) {
starMap = [];
while ( ones.length < length ) {
ones += 1;
}
max = parseInt( ones, 2 );
mapper = function( digit ) {
return digit === '1';
};
for ( i = 0; i <= max; i += 1 ) {
binary = i.toString( 2 );
while ( binary.length < length ) {
binary = '0' + binary;
}
starMap[ i ] = Array.prototype.map.call( binary, mapper );
}
starMaps[ length ] = starMap;
}
return starMaps[ length ];
}
}();
/* viewmodel/prototype/applyChanges/notifyPatternObservers.js */
var viewmodel$applyChanges_notifyPatternObservers = function( getPotentialWildcardMatches ) {
var lastKey = /[^\.]+$/;
return notifyPatternObservers;
function notifyPatternObservers( viewmodel, keypath, onlyDirect ) {
var potentialWildcardMatches;
updateMatchingPatternObservers( viewmodel, keypath );
if ( onlyDirect ) {
return;
}
potentialWildcardMatches = getPotentialWildcardMatches( keypath );
potentialWildcardMatches.forEach( function( upstreamPattern ) {
cascade( viewmodel, upstreamPattern, keypath );
} );
}
function cascade( viewmodel, upstreamPattern, keypath ) {
var group, map, actualChildKeypath;
group = viewmodel.depsMap.patternObservers;
map = group[ upstreamPattern ];
if ( map ) {
map.forEach( function( childKeypath ) {
var key = lastKey.exec( childKeypath )[ 0 ];
// 'baz'
actualChildKeypath = keypath ? keypath + '.' + key : key;
// 'foo.bar.baz'
updateMatchingPatternObservers( viewmodel, actualChildKeypath );
cascade( viewmodel, childKeypath, actualChildKeypath );
} );
}
}
function updateMatchingPatternObservers( viewmodel, keypath ) {
viewmodel.patternObservers.forEach( function( observer ) {
if ( observer.regex.test( keypath ) ) {
observer.update( keypath );
}
} );
}
}( viewmodel$applyChanges_getPotentialWildcardMatches );
/* viewmodel/prototype/applyChanges.js */
var viewmodel$applyChanges = function( getUpstreamChanges, notifyPatternObservers ) {
var dependantGroups = [
'observers',
'default'
];
return function Viewmodel$applyChanges() {
var this$0 = this;
var self = this,
changes, upstreamChanges, allChanges = [],
computations, addComputations, cascade, hash = {};
if ( !this.changes.length ) {
// TODO we end up here on initial render. Perhaps we shouldn't?
return;
}
addComputations = function( keypath ) {
var newComputations;
if ( newComputations = self.deps.computed[ keypath ] ) {
addNewItems( computations, newComputations );
}
};
cascade = function( keypath ) {
var map;
addComputations( keypath );
if ( map = self.depsMap.computed[ keypath ] ) {
map.forEach( cascade );
}
};
// Find computations and evaluators that are invalidated by
// these changes. If they have changed, add them to the
// list of changes. Lather, rinse and repeat until the
// system is settled
do {
changes = this.changes;
addNewItems( allChanges, changes );
this.changes = [];
computations = [];
upstreamChanges = getUpstreamChanges( changes );
upstreamChanges.forEach( addComputations );
changes.forEach( cascade );
computations.forEach( updateComputation );
} while ( this.changes.length );
upstreamChanges = getUpstreamChanges( allChanges );
// Pattern observers are a weird special case
if ( this.patternObservers.length ) {
upstreamChanges.forEach( function( keypath ) {
return notifyPatternObservers( this$0, keypath, true );
} );
allChanges.forEach( function( keypath ) {
return notifyPatternObservers( this$0, keypath );
} );
}
dependantGroups.forEach( function( group ) {
if ( !this$0.deps[ group ] ) {
return;
}
upstreamChanges.forEach( function( keypath ) {
return notifyUpstreamDependants( this$0, keypath, group );
} );
notifyAllDependants( this$0, allChanges, group );
} );
// Return a hash of keypaths to updated values
allChanges.forEach( function( keypath ) {
hash[ keypath ] = this$0.get( keypath );
} );
this.implicitChanges = {};
return hash;
};
function updateComputation( computation ) {
computation.update();
}
function notifyUpstreamDependants( viewmodel, keypath, groupName ) {
var dependants, value;
if ( dependants = findDependants( viewmodel, keypath, groupName ) ) {
value = viewmodel.get( keypath );
dependants.forEach( function( d ) {
return d.setValue( value );
} );
}
}
function notifyAllDependants( viewmodel, keypaths, groupName ) {
var queue = [];
addKeypaths( keypaths );
queue.forEach( dispatch );
function addKeypaths( keypaths ) {
keypaths.forEach( addKeypath );
keypaths.forEach( cascade );
}
function addKeypath( keypath ) {
var deps = findDependants( viewmodel, keypath, groupName );
if ( deps ) {
queue.push( {
keypath: keypath,
deps: deps
} );
}
}
function cascade( keypath ) {
var childDeps;
if ( childDeps = viewmodel.depsMap[ groupName ][ keypath ] ) {
addKeypaths( childDeps );
}
}
function dispatch( set ) {
var value = viewmodel.get( set.keypath );
set.deps.forEach( function( d ) {
return d.setValue( value );
} );
}
}
function findDependants( viewmodel, keypath, groupName ) {
var group = viewmodel.deps[ groupName ];
return group ? group[ keypath ] : null;
}
function addNewItems( arr, items ) {
items.forEach( function( item ) {
if ( arr.indexOf( item ) === -1 ) {
arr.push( item );
}
} );
}
}( getUpstreamChanges, viewmodel$applyChanges_notifyPatternObservers );
/* viewmodel/prototype/capture.js */
var viewmodel$capture = function Viewmodel$capture() {
this.capturing = true;
this.captured = [];
};
/* viewmodel/prototype/clearCache.js */
var viewmodel$clearCache = function Viewmodel$clearCache( keypath, dontTeardownWrapper ) {
var cacheMap, wrapper, computation;
if ( !dontTeardownWrapper ) {
// Is there a wrapped property at this keypath?
if ( wrapper = this.wrapped[ keypath ] ) {
// Did we unwrap it?
if ( wrapper.teardown() !== false ) {
this.wrapped[ keypath ] = null;
}
}
}
if ( computation = this.computations[ keypath ] ) {
computation.compute();
}
this.cache[ keypath ] = undefined;
if ( cacheMap = this.cacheMap[ keypath ] ) {
while ( cacheMap.length ) {
this.clearCache( cacheMap.pop() );
}
}
};
/* viewmodel/prototype/get/FAILED_LOOKUP.js */
var viewmodel$get_FAILED_LOOKUP = {
FAILED_LOOKUP: true
};
/* viewmodel/prototype/get/UnresolvedImplicitDependency.js */
var viewmodel$get_UnresolvedImplicitDependency = function( removeFromArray, runloop ) {
var empty = {};
var UnresolvedImplicitDependency = function( viewmodel, keypath ) {
this.viewmodel = viewmodel;
this.root = viewmodel.ractive;
// TODO eliminate this
this.ref = keypath;
this.parentFragment = empty;
viewmodel.unresolvedImplicitDependencies[ keypath ] = true;
viewmodel.unresolvedImplicitDependencies.push( this );
runloop.addUnresolved( this );
};
UnresolvedImplicitDependency.prototype = {
resolve: function() {
this.viewmodel.mark( this.ref );
this.viewmodel.unresolvedImplicitDependencies[ this.ref ] = false;
removeFromArray( this.viewmodel.unresolvedImplicitDependencies, this );
},
teardown: function() {
runloop.removeUnresolved( this );
}
};
return UnresolvedImplicitDependency;
}( removeFromArray, runloop );
/* viewmodel/prototype/get.js */
var viewmodel$get = function( FAILED_LOOKUP, UnresolvedImplicitDependency ) {
var empty = {};
return function Viewmodel$get( keypath ) {
var options = arguments[ 1 ];
if ( options === void 0 )
options = empty;
var ractive = this.ractive,
cache = this.cache,
value, computation, wrapped, evaluator;
if ( cache[ keypath ] === undefined ) {
// Is this a computed property?
if ( computation = this.computations[ keypath ] ) {
value = computation.value;
} else if ( wrapped = this.wrapped[ keypath ] ) {
value = wrapped.value;
} else if ( !keypath ) {
this.adapt( '', ractive.data );
value = ractive.data;
} else if ( evaluator = this.evaluators[ keypath ] ) {
value = evaluator.value;
} else {
value = retrieve( this, keypath );
}
cache[ keypath ] = value;
} else {
value = cache[ keypath ];
}
if ( options.evaluateWrapped && ( wrapped = this.wrapped[ keypath ] ) ) {
value = wrapped.get();
}
// capture the keypath, if we're inside a computation or evaluator
if ( options.capture && this.capturing && this.captured.indexOf( keypath ) === -1 ) {
this.captured.push( keypath );
// if we couldn't resolve the keypath, we need to make it as a failed
// lookup, so that the evaluator updates correctly once we CAN
// resolve the keypath
if ( value === FAILED_LOOKUP && this.unresolvedImplicitDependencies[ keypath ] !== true ) {
new UnresolvedImplicitDependency( this, keypath );
}
}
return value === FAILED_LOOKUP ? void 0 : value;
};
function retrieve( viewmodel, keypath ) {
var keys, key, parentKeypath, parentValue, cacheMap, value, wrapped;
keys = keypath.split( '.' );
key = keys.pop();
parentKeypath = keys.join( '.' );
parentValue = viewmodel.get( parentKeypath );
if ( wrapped = viewmodel.wrapped[ parentKeypath ] ) {
parentValue = wrapped.get();
}
if ( parentValue === null || parentValue === undefined ) {
return;
}
// update cache map
if ( !( cacheMap = viewmodel.cacheMap[ parentKeypath ] ) ) {
viewmodel.cacheMap[ parentKeypath ] = [ keypath ];
} else {
if ( cacheMap.indexOf( keypath ) === -1 ) {
cacheMap.push( keypath );
}
}
// If this property doesn't exist, we return a sentinel value
// so that we know to query parent scope (if such there be)
if ( typeof parentValue === 'object' && !( key in parentValue ) ) {
return viewmodel.cache[ keypath ] = FAILED_LOOKUP;
}
value = parentValue[ key ];
// Do we have an adaptor for this value?
viewmodel.adapt( keypath, value, false );
// Update cache
viewmodel.cache[ keypath ] = value;
return value;
}
}( viewmodel$get_FAILED_LOOKUP, viewmodel$get_UnresolvedImplicitDependency );
/* viewmodel/prototype/mark.js */
var viewmodel$mark = function Viewmodel$mark( keypath, isImplicitChange ) {
// implicit changes (i.e. `foo.length` on `ractive.push('foo',42)`)
// should not be picked up by pattern observers
if ( isImplicitChange ) {
this.implicitChanges[ keypath ] = true;
}
if ( this.changes.indexOf( keypath ) === -1 ) {
this.changes.push( keypath );
this.clearCache( keypath );
}
};
/* viewmodel/prototype/merge/mapOldToNewIndex.js */
var viewmodel$merge_mapOldToNewIndex = function( oldArray, newArray ) {
var usedIndices, firstUnusedIndex, newIndices, changed;
usedIndices = {};
firstUnusedIndex = 0;
newIndices = oldArray.map( function( item, i ) {
var index, start, len;
start = firstUnusedIndex;
len = newArray.length;
do {
index = newArray.indexOf( item, start );
if ( index === -1 ) {
changed = true;
return -1;
}
start = index + 1;
} while ( usedIndices[ index ] && start < len );
// keep track of the first unused index, so we don't search
// the whole of newArray for each item in oldArray unnecessarily
if ( index === firstUnusedIndex ) {
firstUnusedIndex += 1;
}
if ( index !== i ) {
changed = true;
}
usedIndices[ index ] = true;
return index;
} );
newIndices.unchanged = !changed;
return newIndices;
};
/* viewmodel/prototype/merge.js */
var viewmodel$merge = function( types, warn, mapOldToNewIndex ) {
var comparators = {};
return function Viewmodel$merge( keypath, currentArray, array, options ) {
var this$0 = this;
var oldArray, newArray, comparator, newIndices, dependants;
this.mark( keypath );
if ( options && options.compare ) {
comparator = getComparatorFunction( options.compare );
try {
oldArray = currentArray.map( comparator );
newArray = array.map( comparator );
} catch ( err ) {
// fallback to an identity check - worst case scenario we have
// to do more DOM manipulation than we thought...
// ...unless we're in debug mode of course
if ( this.debug ) {
throw err;
} else {
warn( 'Merge operation: comparison failed. Falling back to identity checking' );
}
oldArray = currentArray;
newArray = array;
}
} else {
oldArray = currentArray;
newArray = array;
}
// find new indices for members of oldArray
newIndices = mapOldToNewIndex( oldArray, newArray );
// Indices that are being removed should be marked as dirty
newIndices.forEach( function( newIndex, oldIndex ) {
if ( newIndex === -1 ) {
this$0.mark( keypath + '.' + oldIndex );
}
} );
// Update the model
// TODO allow existing array to be updated in place, rather than replaced?
this.set( keypath, array, true );
if ( dependants = this.deps[ 'default' ][ keypath ] ) {
dependants.filter( canMerge ).forEach( function( dependant ) {
return dependant.merge( newIndices );
} );
}
if ( currentArray.length !== array.length ) {
this.mark( keypath + '.length', true );
}
};
function canMerge( dependant ) {
return typeof dependant.merge === 'function' && ( !dependant.subtype || dependant.subtype === types.SECTION_EACH );
}
function stringify( item ) {
return JSON.stringify( item );
}
function getComparatorFunction( comparator ) {
// If `compare` is `true`, we use JSON.stringify to compare
// objects that are the same shape, but non-identical - i.e.
// { foo: 'bar' } !== { foo: 'bar' }
if ( comparator === true ) {
return stringify;
}
if ( typeof comparator === 'string' ) {
if ( !comparators[ comparator ] ) {
comparators[ comparator ] = function( item ) {
return item[ comparator ];
};
}
return comparators[ comparator ];
}
if ( typeof comparator === 'function' ) {
return comparator;
}
throw new Error( 'The `compare` option must be a function, or a string representing an identifying field (or `true` to use JSON.stringify)' );
}
}( types, warn, viewmodel$merge_mapOldToNewIndex );
/* viewmodel/prototype/register.js */
var viewmodel$register = function() {
return function Viewmodel$register( keypath, dependant ) {
var group = arguments[ 2 ];
if ( group === void 0 )
group = 'default';
var depsByKeypath, deps, evaluator;
if ( dependant.isStatic ) {
return;
}
depsByKeypath = this.deps[ group ] || ( this.deps[ group ] = {} );
deps = depsByKeypath[ keypath ] || ( depsByKeypath[ keypath ] = [] );
deps.push( dependant );
if ( !keypath ) {
return;
}
if ( evaluator = this.evaluators[ keypath ] ) {
if ( !evaluator.dependants ) {
evaluator.wake();
}
evaluator.dependants += 1;
}
updateDependantsMap( this, keypath, group );
};
function updateDependantsMap( viewmodel, keypath, group ) {
var keys, parentKeypath, map, parent;
// update dependants map
keys = keypath.split( '.' );
while ( keys.length ) {
keys.pop();
parentKeypath = keys.join( '.' );
map = viewmodel.depsMap[ group ] || ( viewmodel.depsMap[ group ] = {} );
parent = map[ parentKeypath ] || ( map[ parentKeypath ] = [] );
if ( parent[ keypath ] === undefined ) {
parent[ keypath ] = 0;
parent.push( keypath );
}
parent[ keypath ] += 1;
keypath = parentKeypath;
}
}
}();
/* viewmodel/prototype/release.js */
var viewmodel$release = function Viewmodel$release() {
this.capturing = false;
return this.captured;
};
/* viewmodel/prototype/set.js */
var viewmodel$set = function( isEqual, createBranch ) {
return function Viewmodel$set( keypath, value, silent ) {
var keys, lastKey, parentKeypath, parentValue, computation, wrapper, evaluator, dontTeardownWrapper;
if ( isEqual( this.cache[ keypath ], value ) ) {
return;
}
computation = this.computations[ keypath ];
wrapper = this.wrapped[ keypath ];
evaluator = this.evaluators[ keypath ];
if ( computation && !computation.setting ) {
computation.set( value );
}
// If we have a wrapper with a `reset()` method, we try and use it. If the
// `reset()` method returns false, the wrapper should be torn down, and
// (most likely) a new one should be created later
if ( wrapper && wrapper.reset ) {
dontTeardownWrapper = wrapper.reset( value ) !== false;
if ( dontTeardownWrapper ) {
value = wrapper.get();
}
}
// Update evaluator value. This may be from the evaluator itself, or
// it may be from the wrapper that wraps an evaluator's result - it
// doesn't matter
if ( evaluator ) {
evaluator.value = value;
}
if ( !computation && !evaluator && !dontTeardownWrapper ) {
keys = keypath.split( '.' );
lastKey = keys.pop();
parentKeypath = keys.join( '.' );
wrapper = this.wrapped[ parentKeypath ];
if ( wrapper && wrapper.set ) {
wrapper.set( lastKey, value );
} else {
parentValue = wrapper ? wrapper.get() : this.get( parentKeypath );
if ( !parentValue ) {
parentValue = createBranch( lastKey );
this.set( parentKeypath, parentValue, true );
}
parentValue[ lastKey ] = value;
}
}
if ( !silent ) {
this.mark( keypath );
} else {
// We're setting a parent of the original target keypath (i.e.
// creating a fresh branch) - we need to clear the cache, but
// not mark it as a change
this.clearCache( keypath );
}
};
}( isEqual, createBranch );
/* viewmodel/prototype/splice.js */
var viewmodel$splice = function( types ) {
return function Viewmodel$splice( keypath, spliceSummary ) {
var viewmodel = this,
i, dependants;
// Mark changed keypaths
for ( i = spliceSummary.rangeStart; i < spliceSummary.rangeEnd; i += 1 ) {
viewmodel.mark( keypath + '.' + i );
}
if ( spliceSummary.balance ) {
viewmodel.mark( keypath + '.length', true );
}
// Trigger splice operations
if ( dependants = viewmodel.deps[ 'default' ][ keypath ] ) {
dependants.filter( canSplice ).forEach( function( dependant ) {
return dependant.splice( spliceSummary );
} );
}
};
function canSplice( dependant ) {
return dependant.type === types.SECTION && ( !dependant.subtype || dependant.subtype === types.SECTION_EACH ) && dependant.rendered;
}
}( types );
/* viewmodel/prototype/teardown.js */
var viewmodel$teardown = function Viewmodel$teardown() {
var this$0 = this;
var unresolvedImplicitDependency;
// Clear entire cache - this has the desired side-effect
// of unwrapping adapted values (e.g. arrays)
Object.keys( this.cache ).forEach( function( keypath ) {
return this$0.clearCache( keypath );
} );
// Teardown any failed lookups - we don't need them to resolve any more
while ( unresolvedImplicitDependency = this.unresolvedImplicitDependencies.pop() ) {
unresolvedImplicitDependency.teardown();
}
};
/* viewmodel/prototype/unregister.js */
var viewmodel$unregister = function() {
return function Viewmodel$unregister( keypath, dependant ) {
var group = arguments[ 2 ];
if ( group === void 0 )
group = 'default';
var deps, index, evaluator;
if ( dependant.isStatic ) {
return;
}
deps = this.deps[ group ][ keypath ];
index = deps.indexOf( dependant );
if ( index === -1 ) {
throw new Error( 'Attempted to remove a dependant that was no longer registered! This should not happen. If you are seeing this bug in development please raise an issue at https://github.com/RactiveJS/Ractive/issues - thanks' );
}
deps.splice( index, 1 );
if ( !keypath ) {
return;
}
if ( evaluator = this.evaluators[ keypath ] ) {
evaluator.dependants -= 1;
if ( !evaluator.dependants ) {
evaluator.sleep();
}
}
updateDependantsMap( this, keypath, group );
};
function updateDependantsMap( viewmodel, keypath, group ) {
var keys, parentKeypath, map, parent;
// update dependants map
keys = keypath.split( '.' );
while ( keys.length ) {
keys.pop();
parentKeypath = keys.join( '.' );
map = viewmodel.depsMap[ group ];
parent = map[ parentKeypath ];
parent[ keypath ] -= 1;
if ( !parent[ keypath ] ) {
// remove from parent deps map
parent.splice( parent.indexOf( keypath ), 1 );
parent[ keypath ] = undefined;
}
keypath = parentKeypath;
}
}
}();
/* viewmodel/Computation/getComputationSignature.js */
var getComputationSignature = function() {
var pattern = /\$\{([^\}]+)\}/g;
return function( signature ) {
if ( typeof signature === 'function' ) {
return {
get: signature
};
}
if ( typeof signature === 'string' ) {
return {
get: createFunctionFromString( signature )
};
}
if ( typeof signature === 'object' && typeof signature.get === 'string' ) {
signature = {
get: createFunctionFromString( signature.get ),
set: signature.set
};
}
return signature;
};
function createFunctionFromString( signature ) {
var functionBody = 'var __ractive=this;return(' + signature.replace( pattern, function( match, keypath ) {
return '__ractive.get("' + keypath + '")';
} ) + ')';
return new Function( functionBody );
}
}();
/* viewmodel/Computation/Computation.js */
var Computation = function( log, isEqual, diff ) {
var Computation = function( ractive, key, signature ) {
this.ractive = ractive;
this.viewmodel = ractive.viewmodel;
this.key = key;
this.getter = signature.get;
this.setter = signature.set;
this.dependencies = [];
this.update();
};
Computation.prototype = {
set: function( value ) {
if ( this.setting ) {
this.value = value;
return;
}
if ( !this.setter ) {
throw new Error( 'Computed properties without setters are read-only. (This may change in a future version of Ractive!)' );
}
this.setter.call( this.ractive, value );
},
// returns `false` if the computation errors
compute: function() {
var ractive, errored, newDependencies;
ractive = this.ractive;
ractive.viewmodel.capture();
try {
this.value = this.getter.call( ractive );
} catch ( err ) {
log.warn( {
debug: ractive.debug,
message: 'failedComputation',
args: {
key: this.key,
err: err.message || err
}
} );
errored = true;
}
newDependencies = ractive.viewmodel.release();
diff( this, this.dependencies, newDependencies );
return errored ? false : true;
},
update: function() {
var oldValue = this.value;
if ( this.compute() && !isEqual( this.value, oldValue ) ) {
this.ractive.viewmodel.mark( this.key );
}
}
};
return Computation;
}( log, isEqual, diff );
/* viewmodel/Computation/createComputations.js */
var createComputations = function( getComputationSignature, Computation ) {
return function createComputations( ractive, computed ) {
var key, signature;
for ( key in computed ) {
signature = getComputationSignature( computed[ key ] );
ractive.viewmodel.computations[ key ] = new Computation( ractive, key, signature );
}
};
}( getComputationSignature, Computation );
/* viewmodel/adaptConfig.js */
var adaptConfig = function() {
// should this be combined with prototype/adapt.js?
var configure = {
lookup: function( target, adaptors ) {
var i, adapt = target.adapt;
if ( !adapt || !adapt.length ) {
return adapt;
}
if ( adaptors && Object.keys( adaptors ).length && ( i = adapt.length ) ) {
while ( i-- ) {
var adaptor = adapt[ i ];
if ( typeof adaptor === 'string' ) {
adapt[ i ] = adaptors[ adaptor ] || adaptor;
}
}
}
return adapt;
},
combine: function( parent, adapt ) {
// normalize 'Foo' to [ 'Foo' ]
parent = arrayIfString( parent );
adapt = arrayIfString( adapt );
// no parent? return adapt
if ( !parent || !parent.length ) {
return adapt;
}
// no adapt? return 'copy' of parent
if ( !adapt || !adapt.length ) {
return parent.slice();
}
// add parent adaptors to options
parent.forEach( function( a ) {
// don't put in duplicates
if ( adapt.indexOf( a ) === -1 ) {
adapt.push( a );
}
} );
return adapt;
}
};
function arrayIfString( adapt ) {
if ( typeof adapt === 'string' ) {
adapt = [ adapt ];
}
return adapt;
}
return configure;
}();
/* viewmodel/Viewmodel.js */
var Viewmodel = function( create, adapt, applyChanges, capture, clearCache, get, mark, merge, register, release, set, splice, teardown, unregister, createComputations, adaptConfig ) {
// TODO: fix our ES6 modules so we can have multiple exports
// then this magic check can be reused by magicAdaptor
var noMagic;
try {
Object.defineProperty( {}, 'test', {
value: 0
} );
} catch ( err ) {
noMagic = true;
}
var Viewmodel = function( ractive ) {
this.ractive = ractive;
// TODO eventually, we shouldn't need this reference
Viewmodel.extend( ractive.constructor, ractive );
//this.ractive.data
this.cache = {};
// we need to be able to use hasOwnProperty, so can't inherit from null
this.cacheMap = create( null );
this.deps = {
computed: {},
'default': {}
};
this.depsMap = {
computed: {},
'default': {}
};
this.patternObservers = [];
this.wrapped = create( null );
// TODO these are conceptually very similar. Can they be merged somehow?
this.evaluators = create( null );
this.computations = create( null );
this.captured = null;
this.unresolvedImplicitDependencies = [];
this.changes = [];
this.implicitChanges = {};
};
Viewmodel.extend = function( Parent, instance ) {
if ( instance.magic && noMagic ) {
throw new Error( 'Getters and setters (magic mode) are not supported in this browser' );
}
instance.adapt = adaptConfig.combine( Parent.prototype.adapt, instance.adapt ) || [];
instance.adapt = adaptConfig.lookup( instance, instance.adaptors );
};
Viewmodel.prototype = {
adapt: adapt,
applyChanges: applyChanges,
capture: capture,
clearCache: clearCache,
get: get,
mark: mark,
merge: merge,
register: register,
release: release,
set: set,
splice: splice,
teardown: teardown,
unregister: unregister,
// createComputations, in the computations, may call back through get or set
// of ractive. So, for now, we delay creation of computed from constructor.
// on option would be to have the Computed class be lazy about using .update()
compute: function() {
createComputations( this.ractive, this.ractive.computed );
}
};
return Viewmodel;
}( create, viewmodel$adapt, viewmodel$applyChanges, viewmodel$capture, viewmodel$clearCache, viewmodel$get, viewmodel$mark, viewmodel$merge, viewmodel$register, viewmodel$release, viewmodel$set, viewmodel$splice, viewmodel$teardown, viewmodel$unregister, createComputations, adaptConfig );
/* Ractive/initialise.js */
var Ractive_initialise = function( config, create, getElement, getNextNumber, Viewmodel, Fragment ) {
return function initialiseRactiveInstance( ractive ) {
var options = arguments[ 1 ];
if ( options === void 0 )
options = {};
initialiseProperties( ractive, options );
// init config from Parent and options
config.init( ractive.constructor, ractive, options );
// TEMPORARY. This is so we can implement Viewmodel gradually
ractive.viewmodel = new Viewmodel( ractive );
// hacky circular problem until we get this sorted out
// if viewmodel immediately processes computed properties,
// they may call ractive.get, which calls ractive.viewmodel,
// which hasn't been set till line above finishes.
ractive.viewmodel.compute();
// Render our *root fragment*
if ( ractive.template ) {
ractive.fragment = new Fragment( {
template: ractive.template,
root: ractive,
owner: ractive
} );
}
ractive.viewmodel.applyChanges();
// render automatically ( if `el` is specified )
tryRender( ractive );
};
function tryRender( ractive ) {
var el;
if ( el = getElement( ractive.el ) ) {
var wasEnabled = ractive.transitionsEnabled;
// Temporarily disable transitions, if `noIntro` flag is set
if ( ractive.noIntro ) {
ractive.transitionsEnabled = false;
}
// If the target contains content, and `append` is falsy, clear it
if ( el && !ractive.append ) {
// Tear down any existing instances on this element
if ( el.__ractive_instances__ ) {
try {
el.__ractive_instances__.splice( 0, el.__ractive_instances__.length ).forEach( function( r ) {
return r.teardown();
} );
} catch ( err ) {}
}
el.innerHTML = '';
}
ractive.render( el, ractive.append );
// reset transitionsEnabled
ractive.transitionsEnabled = wasEnabled;
}
}
function initialiseProperties( ractive, options ) {
// Generate a unique identifier, for places where you'd use a weak map if it
// existed
ractive._guid = getNextNumber();
// events
ractive._subs = create( null );
// storage for item configuration from instantiation to reset,
// like dynamic functions or original values
ractive._config = {};
// two-way bindings
ractive._twowayBindings = create( null );
// animations (so we can stop any in progress at teardown)
ractive._animations = [];
// nodes registry
ractive.nodes = {};
// live queries
ractive._liveQueries = [];
ractive._liveComponentQueries = [];
// If this is a component, store a reference to the parent
if ( options._parent && options._component ) {
ractive._parent = options._parent;
ractive.component = options._component;
// And store a reference to the instance on the component
options._component.instance = ractive;
}
}
}( config, create, getElement, getNextNumber, Viewmodel, Fragment );
/* extend/initChildInstance.js */
var initChildInstance = function( initialise ) {
// The Child constructor contains the default init options for this class
return function initChildInstance( child, Child, options ) {
if ( child.beforeInit ) {
child.beforeInit( options );
}
initialise( child, options );
};
}( Ractive_initialise );
/* extend/childOptions.js */
var childOptions = function( wrapPrototype, wrap, config, circular ) {
var Ractive,
// would be nice to not have these here,
// they get added during initialise, so for now we have
// to make sure not to try and extend them.
// Possibly, we could re-order and not add till later
// in process.
blacklisted = {
'_parent': true,
'_component': true
},
childOptions = {
toPrototype: toPrototype,
toOptions: toOptions
},
registries = config.registries;
config.keys.forEach( function( key ) {
return blacklisted[ key ] = true;
} );
circular.push( function() {
Ractive = circular.Ractive;
} );
return childOptions;
function toPrototype( parent, proto, options ) {
for ( var key in options ) {
if ( !( key in blacklisted ) && options.hasOwnProperty( key ) ) {
var member = options[ key ];
// if this is a method that overwrites a method, wrap it:
if ( typeof member === 'function' ) {
member = wrapPrototype( parent, key, member );
}
proto[ key ] = member;
}
}
}
function toOptions( Child ) {
if ( !( Child.prototype instanceof Ractive ) ) {
return Child;
}
var options = {};
while ( Child ) {
registries.forEach( function( r ) {
addRegistry( r.useDefaults ? Child.prototype : Child, options, r.name );
} );
Object.keys( Child.prototype ).forEach( function( key ) {
if ( key === 'computed' ) {
return;
}
var value = Child.prototype[ key ];
if ( !( key in options ) ) {
options[ key ] = value._method ? value._method : value;
} else if ( typeof options[ key ] === 'function' && typeof value === 'function' && options[ key ]._method ) {
var result, needsSuper = value._method;
if ( needsSuper ) {
value = value._method;
}
// rewrap bound directly to parent fn
result = wrap( options[ key ]._method, value );
if ( needsSuper ) {
result._method = result;
}
options[ key ] = result;
}
} );
if ( Child._parent !== Ractive ) {
Child = Child._parent;
} else {
Child = false;
}
}
return options;
}
function addRegistry( target, options, name ) {
var registry, keys = Object.keys( target[ name ] );
if ( !keys.length ) {
return;
}
if ( !( registry = options[ name ] ) ) {
registry = options[ name ] = {};
}
keys.filter( function( key ) {
return !( key in registry );
} ).forEach( function( key ) {
return registry[ key ] = target[ name ][ key ];
} );
}
}( wrapPrototypeMethod, wrapMethod, config, circular );
/* extend/_extend.js */
var Ractive_extend = function( create, defineProperties, getGuid, config, initChildInstance, Viewmodel, childOptions ) {
return function extend() {
var options = arguments[ 0 ];
if ( options === void 0 )
options = {};
var Parent = this,
Child, proto, staticProperties;
// if we're extending with another Ractive instance, inherit its
// prototype methods and default options as well
options = childOptions.toOptions( options );
// create Child constructor
Child = function( options ) {
initChildInstance( this, Child, options );
};
proto = create( Parent.prototype );
proto.constructor = Child;
staticProperties = {
// each component needs a guid, for managing CSS etc
_guid: {
value: getGuid()
},
// alias prototype as defaults
defaults: {
value: proto
},
// extendable
extend: {
value: extend,
writable: true,
configurable: true
},
// Parent - for IE8, can't use Object.getPrototypeOf
_parent: {
value: Parent
}
};
defineProperties( Child, staticProperties );
// extend configuration
config.extend( Parent, proto, options );
Viewmodel.extend( Parent, proto );
// and any other properties or methods on options...
childOptions.toPrototype( Parent.prototype, proto, options );
Child.prototype = proto;
return Child;
};
}( create, defineProperties, getGuid, config, initChildInstance, Viewmodel, childOptions );
/* Ractive.js */
var Ractive = function( defaults, easing, interpolators, svg, magic, defineProperties, proto, Promise, extendObj, extend, parse, initialise, circular ) {
var Ractive, properties;
// Main Ractive required object
Ractive = function( options ) {
initialise( this, options );
};
// Ractive properties
properties = {
// static methods:
extend: {
value: extend
},
parse: {
value: parse
},
// Namespaced constructors
Promise: {
value: Promise
},
// support
svg: {
value: svg
},
magic: {
value: magic
},
// version
VERSION: {
value: '0.5.5'
},
// Plugins
adaptors: {
writable: true,
value: {}
},
components: {
writable: true,
value: {}
},
decorators: {
writable: true,
value: {}
},
easing: {
writable: true,
value: easing
},
events: {
writable: true,
value: {}
},
interpolators: {
writable: true,
value: interpolators
},
partials: {
writable: true,
value: {}
},
transitions: {
writable: true,
value: {}
}
};
// Ractive properties
defineProperties( Ractive, properties );
Ractive.prototype = extendObj( proto, defaults );
Ractive.prototype.constructor = Ractive;
// alias prototype as defaults
Ractive.defaults = Ractive.prototype;
// Certain modules have circular dependencies. If we were bundling a
// module loader, e.g. almond.js, this wouldn't be a problem, but we're
// not - we're using amdclean as part of the build process. Because of
// this, we need to wait until all modules have loaded before those
// circular dependencies can be required.
circular.Ractive = Ractive;
while ( circular.length ) {
circular.pop()();
}
// Ractive.js makes liberal use of things like Array.prototype.indexOf. In
// older browsers, these are made available via a shim - here, we do a quick
// pre-flight check to make sure that either a) we're not in a shit browser,
// or b) we're using a Ractive-legacy.js build
var FUNCTION = 'function';
if ( typeof Date.now !== FUNCTION || typeof String.prototype.trim !== FUNCTION || typeof Object.keys !== FUNCTION || typeof Array.prototype.indexOf !== FUNCTION || typeof Array.prototype.forEach !== FUNCTION || typeof Array.prototype.map !== FUNCTION || typeof Array.prototype.filter !== FUNCTION || typeof window !== 'undefined' && typeof window.addEventListener !== FUNCTION ) {
throw new Error( 'It looks like you\'re attempting to use Ractive.js in an older browser. You\'ll need to use one of the \'legacy builds\' in order to continue - see http://docs.ractivejs.org/latest/legacy-builds for more information.' );
}
return Ractive;
}( options, easing, interpolators, svg, magic, defineProperties, prototype, Promise, extend, Ractive_extend, parse, Ractive_initialise, circular );
// export as Common JS module...
if ( typeof module !== "undefined" && module.exports ) {
module.exports = Ractive;
}
// ... or as AMD module
else if ( typeof define === "function" && define.amd ) {
define( function() {
return Ractive;
} );
}
// ... or as browser global
global.Ractive = Ractive;
Ractive.noConflict = function() {
global.Ractive = noConflict;
return Ractive;
};
}( typeof window !== 'undefined' ? window : this ) );
| squaredup/ractive | perf/old-versions/0.5.5/ractive-legacy.runtime.js | JavaScript | mit | 379,013 |
<?php
/**
* Locale data for 'es_NI'.
*
* This file is automatically generated by yiic cldr command.
*
* Copyright © 1991-2007 Unicode, Inc. All rights reserved.
* Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
*
* @copyright 2008-2013 Yii Software LLC (http://www.yiiframework.com/license/)
*/
return array (
'version' => '5884',
'numberSymbols' =>
array (
'alias' => '',
'decimal' => ',',
'group' => '.',
'list' => ';',
'percentSign' => '%',
'plusSign' => '+',
'minusSign' => '-',
'exponential' => 'E',
'perMille' => '‰',
'infinity' => '∞',
'nan' => 'NaN',
),
'decimalFormat' => '#,##0.###',
'scientificFormat' => '#E0',
'percentFormat' => '#,##0%',
'currencyFormat' => '#,##0.00 ¤',
'currencySymbols' =>
array (
'AUD' => 'AU$',
'BRL' => 'R$',
'CAD' => 'CA$',
'CNY' => 'CN¥',
'EUR' => '€',
'GBP' => '£',
'HKD' => 'HK$',
'ILS' => '₪',
'INR' => '₹',
'JPY' => 'JP¥',
'KRW' => '₩',
'MXN' => 'MX$',
'NZD' => 'NZ$',
'THB' => '฿',
'TWD' => 'NT$',
'USD' => 'US$',
'VND' => '₫',
'XAF' => 'FCFA',
'XCD' => 'EC$',
'XOF' => 'CFA',
'XPF' => 'CFPF',
'AFN' => 'Af',
'ANG' => 'NAf.',
'AOA' => 'Kz',
'ARS' => 'AR$',
'AWG' => 'Afl.',
'AZN' => 'man.',
'ESP' => '₧',
'NIO' => 'C$',
),
'monthNames' =>
array (
'wide' =>
array (
1 => 'enero',
2 => 'febrero',
3 => 'marzo',
4 => 'abril',
5 => 'mayo',
6 => 'junio',
7 => 'julio',
8 => 'agosto',
9 => 'septiembre',
10 => 'octubre',
11 => 'noviembre',
12 => 'diciembre',
),
'abbreviated' =>
array (
1 => 'ene',
2 => 'feb',
3 => 'mar',
4 => 'abr',
5 => 'may',
6 => 'jun',
7 => 'jul',
8 => 'ago',
9 => 'sep',
10 => 'oct',
11 => 'nov',
12 => 'dic',
),
),
'monthNamesSA' =>
array (
'narrow' =>
array (
1 => 'E',
2 => 'F',
3 => 'M',
4 => 'A',
5 => 'M',
6 => 'J',
7 => 'J',
8 => 'A',
9 => 'S',
10 => 'O',
11 => 'N',
12 => 'D',
),
'abbreviated' =>
array (
5 => 'mayo',
),
),
'weekDayNames' =>
array (
'wide' =>
array (
0 => 'domingo',
1 => 'lunes',
2 => 'martes',
3 => 'miércoles',
4 => 'jueves',
5 => 'viernes',
6 => 'sábado',
),
'abbreviated' =>
array (
0 => 'dom',
1 => 'lun',
2 => 'mar',
3 => 'mié',
4 => 'jue',
5 => 'vie',
6 => 'sáb',
),
),
'weekDayNamesSA' =>
array (
'narrow' =>
array (
0 => 'D',
1 => 'L',
2 => 'M',
3 => 'X',
4 => 'J',
5 => 'V',
6 => 'S',
),
),
'eraNames' =>
array (
'abbreviated' =>
array (
0 => 'a.C.',
1 => 'd.C.',
),
'wide' =>
array (
0 => 'antes de Cristo',
1 => 'anno Dómini',
),
'narrow' =>
array (
0 => 'a.C.',
1 => 'd.C.',
),
),
'dateFormats' =>
array (
'full' => 'EEEE, d \'de\' MMMM \'de\' y',
'long' => 'd \'de\' MMMM \'de\' y',
'medium' => 'dd/MM/yyyy',
'short' => 'dd/MM/yy',
),
'timeFormats' =>
array (
'full' => 'HH:mm:ss zzzz',
'long' => 'HH:mm:ss z',
'medium' => 'HH:mm:ss',
'short' => 'HH:mm',
),
'dateTimeFormat' => '{1} {0}',
'amName' => 'a.m.',
'pmName' => 'p.m.',
'orientation' => 'ltr',
'languages' =>
array (
'aa' => 'afar',
'ab' => 'abjasio',
'ace' => 'acehnés',
'ach' => 'acoli',
'ada' => 'adangme',
'ady' => 'adigeo',
'ae' => 'avéstico',
'af' => 'afrikaans',
'afa' => 'lengua afroasiática',
'afh' => 'afrihili',
'ain' => 'ainu',
'ak' => 'akan',
'akk' => 'acadio',
'ale' => 'aleutiano',
'alg' => 'lenguas algonquinas',
'alt' => 'altái meridional',
'am' => 'amárico',
'an' => 'aragonés',
'ang' => 'inglés antiguo',
'anp' => 'angika',
'apa' => 'lenguas apache',
'ar' => 'árabe',
'arc' => 'arameo',
'arn' => 'araucano',
'arp' => 'arapaho',
'art' => 'lengua artificial',
'arw' => 'arahuaco',
'as' => 'asamés',
'ast' => 'asturiano',
'ath' => 'lenguas atabascas',
'aus' => 'lenguas australianas',
'av' => 'avar',
'awa' => 'avadhi',
'ay' => 'aimara',
'az' => 'azerí',
'ba' => 'bashkir',
'bad' => 'banda',
'bai' => 'lenguas bamileke',
'bal' => 'baluchi',
'ban' => 'balinés',
'bas' => 'basa',
'bat' => 'lengua báltica',
'be' => 'bielorruso',
'bej' => 'beja',
'bem' => 'bemba',
'ber' => 'bereber',
'bg' => 'búlgaro',
'bh' => 'bihari',
'bho' => 'bhojpuri',
'bi' => 'bislama',
'bik' => 'bicol',
'bin' => 'bini',
'bla' => 'siksika',
'bm' => 'bambara',
'bn' => 'bengalí',
'bnt' => 'bantú',
'bo' => 'tibetano',
'br' => 'bretón',
'bra' => 'braj',
'bs' => 'bosnio',
'btk' => 'batak',
'bua' => 'buriat',
'bug' => 'buginés',
'byn' => 'blin',
'ca' => 'catalán',
'cad' => 'caddo',
'cai' => 'lengua india centroamericana',
'car' => 'caribe',
'cau' => 'lengua caucásica',
'cch' => 'atsam',
'ce' => 'checheno',
'ceb' => 'cebuano',
'cel' => 'lengua celta',
'ch' => 'chamorro',
'chb' => 'chibcha',
'chg' => 'chagatái',
'chk' => 'trukés',
'chm' => 'marí',
'chn' => 'jerga chinuk',
'cho' => 'choctaw',
'chp' => 'chipewyan',
'chr' => 'cherokee',
'chy' => 'cheyene',
'cmc' => 'lenguas chámicas',
'co' => 'corso',
'cop' => 'copto',
'cpe' => 'lengua criolla o pidgin basada en el inglés',
'cpf' => 'lengua criolla o pidgin basada en el francés',
'cpp' => 'lengua criolla o pidgin basada en el portugués',
'cr' => 'cree',
'crh' => 'tártaro de Crimea',
'crp' => 'lengua criolla o pidgin',
'cs' => 'checo',
'csb' => 'casubio',
'cu' => 'eslavo eclesiástico',
'cus' => 'lengua cusita',
'cv' => 'chuvash',
'cy' => 'galés',
'da' => 'danés',
'dak' => 'dakota',
'dar' => 'dargva',
'day' => 'dayak',
'de' => 'alemán',
'de_at' => 'alemán austríaco',
'de_ch' => 'alto alemán de Suiza',
'del' => 'delaware',
'den' => 'slave',
'dgr' => 'dogrib',
'din' => 'dinka',
'doi' => 'dogri',
'dra' => 'lengua dravídica',
'dsb' => 'sorbio inferior',
'dua' => 'duala',
'dum' => 'neerlandés medieval',
'dv' => 'divehi',
'dyu' => 'diula',
'dz' => 'dzongkha',
'ee' => 'ewe',
'efi' => 'efik',
'egy' => 'egipcio antiguo',
'eka' => 'ekajuk',
'el' => 'griego',
'elx' => 'elamita',
'en' => 'inglés',
'en_au' => 'inglés australiano',
'en_ca' => 'inglés canadiense',
'en_gb' => 'inglés británico',
'en_us' => 'inglés estadounidense',
'enm' => 'inglés medieval',
'eo' => 'esperanto',
'es' => 'español',
'es_419' => 'español latinoamericano',
'es_es' => 'español de España',
'et' => 'estonio',
'eu' => 'vasco',
'ewo' => 'ewondo',
'fa' => 'persa',
'fan' => 'fang',
'fat' => 'fanti',
'ff' => 'fula',
'fi' => 'finés',
'fil' => 'filipino',
'fiu' => 'lengua finoúgria',
'fj' => 'fidjiano',
'fo' => 'feroés',
'fon' => 'fon',
'fr' => 'francés',
'fr_ca' => 'francés canadiense',
'fr_ch' => 'francés de Suiza',
'frm' => 'francés medieval',
'fro' => 'francés antiguo',
'frr' => 'frisón septentrional',
'frs' => 'frisón oriental',
'fur' => 'friulano',
'fy' => 'frisón occidental',
'ga' => 'irlandés',
'gaa' => 'ga',
'gay' => 'gayo',
'gba' => 'gbaya',
'gd' => 'gaélico escocés',
'gem' => 'lengua germánica',
'gez' => 'geez',
'gil' => 'gilbertés',
'gl' => 'gallego',
'gmh' => 'alemán de la alta edad media',
'gn' => 'guaraní',
'goh' => 'alemán de la alta edad antigua',
'gon' => 'gondi',
'gor' => 'gorontalo',
'got' => 'gótico',
'grb' => 'grebo',
'grc' => 'griego antiguo',
'gsw' => 'alemán suizo',
'gu' => 'gujarati',
'gv' => 'gaélico manés',
'gwi' => 'kutchin',
'ha' => 'hausa',
'hai' => 'haida',
'haw' => 'hawaiano',
'he' => 'hebreo',
'hi' => 'hindi',
'hil' => 'hiligaynon',
'him' => 'himachali',
'hit' => 'hitita',
'hmn' => 'hmong',
'ho' => 'hiri motu',
'hr' => 'croata',
'hsb' => 'sorbio superior',
'ht' => 'haitiano',
'hu' => 'húngaro',
'hup' => 'hupa',
'hy' => 'armenio',
'hz' => 'herero',
'ia' => 'interlingua',
'iba' => 'iban',
'id' => 'indonesio',
'ie' => 'interlingue',
'ig' => 'igbo',
'ii' => 'sichuan yi',
'ijo' => 'ijo',
'ik' => 'inupiaq',
'ilo' => 'ilocano',
'inc' => 'lengua índica',
'ine' => 'lengua indoeuropea',
'inh' => 'ingush',
'io' => 'ido',
'ira' => 'lengua irania',
'iro' => 'lenguas iroquesas',
'is' => 'islandés',
'it' => 'italiano',
'iu' => 'inuktitut',
'ja' => 'japonés',
'jbo' => 'lojban',
'jpr' => 'judeo-persa',
'jrb' => 'judeo-árabe',
'jv' => 'javanés',
'ka' => 'georgiano',
'kaa' => 'karakalpako',
'kab' => 'cabila',
'kac' => 'kachin',
'kaj' => 'jju',
'kam' => 'kamba',
'kar' => 'karen',
'kaw' => 'kawi',
'kbd' => 'kabardiano',
'kcg' => 'tyap',
'kfo' => 'koro',
'kg' => 'kongo',
'kha' => 'khasi',
'khi' => 'lengua joisana',
'kho' => 'kotanés',
'ki' => 'kikuyu',
'kj' => 'kuanyama',
'kk' => 'kazajo',
'kl' => 'groenlandés',
'km' => 'jemer',
'kmb' => 'kimbundu',
'kn' => 'canarés',
'ko' => 'coreano',
'kok' => 'konkani',
'kos' => 'kosraeano',
'kpe' => 'kpelle',
'kr' => 'kanuri',
'krc' => 'karachay-balkar',
'krl' => 'carelio',
'kro' => 'kru',
'kru' => 'kurukh',
'ks' => 'cachemiro',
'ku' => 'kurdo',
'kum' => 'kumyk',
'kut' => 'kutenai',
'kv' => 'komi',
'kw' => 'córnico',
'ky' => 'kirghiz',
'la' => 'latín',
'lad' => 'ladino',
'lah' => 'lahnda',
'lam' => 'lamba',
'lb' => 'luxemburgués',
'lez' => 'lezgiano',
'lg' => 'ganda',
'li' => 'limburgués',
'ln' => 'lingala',
'lo' => 'laosiano',
'lol' => 'mongo',
'loz' => 'lozi',
'lt' => 'lituano',
'lu' => 'luba-katanga',
'lua' => 'luba-lulua',
'lui' => 'luiseño',
'lun' => 'lunda',
'luo' => 'luo',
'lus' => 'lushai',
'lv' => 'letón',
'mad' => 'madurés',
'mag' => 'magahi',
'mai' => 'maithili',
'mak' => 'macasar',
'man' => 'mandingo',
'map' => 'lengua austronesia',
'mas' => 'masai',
'mdf' => 'moksha',
'mdr' => 'mandar',
'men' => 'mende',
'mg' => 'malgache',
'mga' => 'irlandés medieval',
'mh' => 'marshalés',
'mi' => 'maorí',
'mic' => 'micmac',
'min' => 'minangkabau',
'mis' => 'lenguas varias',
'mk' => 'macedonio',
'mkh' => 'lengua mon-jemer',
'ml' => 'malayalam',
'mn' => 'mongol',
'mnc' => 'manchú',
'mni' => 'manipuri',
'mno' => 'lenguas manobo',
'mo' => 'moldavo',
'moh' => 'mohawk',
'mos' => 'mossi',
'mr' => 'marathi',
'ms' => 'malayo',
'mt' => 'maltés',
'mul' => 'lenguas múltiples',
'mun' => 'lenguas munda',
'mus' => 'creek',
'mwl' => 'mirandés',
'mwr' => 'marwari',
'my' => 'birmano',
'myn' => 'maya',
'myv' => 'erzya',
'na' => 'nauruano',
'nah' => 'náhuatl',
'nai' => 'lengua india norteamericana',
'nap' => 'napolitano',
'nb' => 'bokmal noruego',
'nd' => 'ndebele septentrional',
'nds' => 'bajo alemán',
'ne' => 'nepalí',
'new' => 'newari',
'ng' => 'ndonga',
'nia' => 'nias',
'nic' => 'lengua níger-cordofana',
'niu' => 'niueano',
'nl' => 'neerlandés',
'nl_be' => 'flamenco',
'nn' => 'nynorsk noruego',
'no' => 'noruego',
'nog' => 'nogai',
'non' => 'nórdico antiguo',
'nqo' => 'n’ko',
'nr' => 'ndebele meridional',
'nso' => 'sotho septentrional',
'nub' => 'lenguas nubias',
'nv' => 'navajo',
'nwc' => 'newari clásico',
'ny' => 'nyanja',
'nym' => 'nyamwezi',
'nyn' => 'nyankole',
'nyo' => 'nyoro',
'nzi' => 'nzima',
'oc' => 'occitano',
'oj' => 'ojibwa',
'om' => 'oromo',
'or' => 'oriya',
'os' => 'osético',
'osa' => 'osage',
'ota' => 'turco otomano',
'oto' => 'lenguas otomanas',
'pa' => 'punjabí',
'paa' => 'lengua papú',
'pag' => 'pangasinán',
'pal' => 'pahlavi',
'pam' => 'pampanga',
'pap' => 'papiamento',
'pau' => 'palauano',
'peo' => 'persa antiguo',
'phi' => 'lengua filipina',
'phn' => 'fenicio',
'pi' => 'pali',
'pl' => 'polaco',
'pon' => 'pohnpeiano',
'pra' => 'lenguas prácritas',
'pro' => 'provenzal antiguo',
'ps' => 'pashto',
'pt' => 'portugués',
'pt_br' => 'portugués de Brasil',
'pt_pt' => 'portugués de Portugal',
'qu' => 'quechua',
'raj' => 'rajasthani',
'rap' => 'rapanui',
'rar' => 'rarotongano',
'rm' => 'retorrománico',
'rn' => 'kiroundi',
'ro' => 'rumano',
'roa' => 'lengua romance',
'rom' => 'romaní',
'root' => 'raíz',
'ru' => 'ruso',
'rup' => 'arrumano',
'rw' => 'kinyarwanda',
'sa' => 'sánscrito',
'sad' => 'sandawe',
'sah' => 'sakha',
'sai' => 'lengua india sudamericana',
'sal' => 'lenguas salish',
'sam' => 'arameo samaritano',
'sas' => 'sasak',
'sat' => 'santali',
'sc' => 'sardo',
'scn' => 'siciliano',
'sco' => 'escocés',
'sd' => 'sindhi',
'se' => 'sami septentrional',
'sel' => 'selkup',
'sem' => 'lengua semítica',
'sg' => 'sango',
'sga' => 'irlandés antiguo',
'sgn' => 'lenguajes de signos',
'sh' => 'serbocroata',
'shn' => 'shan',
'si' => 'cingalés',
'sid' => 'sidamo',
'sio' => 'lenguas sioux',
'sit' => 'lengua sino-tibetana',
'sk' => 'eslovaco',
'sl' => 'esloveno',
'sla' => 'lengua eslava',
'sm' => 'samoano',
'sma' => 'sami meridional',
'smi' => 'lengua sami',
'smj' => 'sami lule',
'smn' => 'sami inari',
'sms' => 'sami skolt',
'sn' => 'shona',
'snk' => 'soninké',
'so' => 'somalí',
'sog' => 'sogdiano',
'son' => 'songhai',
'sq' => 'albanés',
'sr' => 'serbio',
'srn' => 'sranan tongo',
'srr' => 'serer',
'ss' => 'siswati',
'ssa' => 'lengua nilo-sahariana',
'st' => 'sesotho meridional',
'su' => 'sundanés',
'suk' => 'sukuma',
'sus' => 'susu',
'sux' => 'sumerio',
'sv' => 'sueco',
'sw' => 'swahili',
'swb' => 'comorense',
'syc' => 'siríaco clásico',
'syr' => 'siriaco',
'ta' => 'tamil',
'tai' => 'lengua tai',
'te' => 'telugu',
'tem' => 'temne',
'ter' => 'tereno',
'tet' => 'tetún',
'tg' => 'tayiko',
'th' => 'tailandés',
'ti' => 'tigriña',
'tig' => 'tigré',
'tiv' => 'tiv',
'tk' => 'turcomano',
'tkl' => 'tokelauano',
'tl' => 'tagalo',
'tlh' => 'klingon',
'tli' => 'tlingit',
'tmh' => 'tamashek',
'tn' => 'setchwana',
'to' => 'tongano',
'tog' => 'tonga del Nyasa',
'tpi' => 'tok pisin',
'tr' => 'turco',
'ts' => 'tsonga',
'tsi' => 'tsimshiano',
'tt' => 'tártaro',
'tum' => 'tumbuka',
'tup' => 'lenguas tupí',
'tut' => 'lengua altaica',
'tvl' => 'tuvaluano',
'tw' => 'twi',
'ty' => 'tahitiano',
'tyv' => 'tuviniano',
'udm' => 'udmurt',
'ug' => 'uygur',
'uga' => 'ugarítico',
'uk' => 'ucraniano',
'umb' => 'umbundu',
'und' => 'lengua desconocida',
'ur' => 'urdu',
'uz' => 'uzbeko',
'vai' => 'vai',
've' => 'venda',
'vi' => 'vietnamita',
'vo' => 'volapük',
'vot' => 'vótico',
'wa' => 'valón',
'wak' => 'lenguas wakasha',
'wal' => 'walamo',
'war' => 'waray',
'was' => 'washo',
'wen' => 'lenguas sorbias',
'wo' => 'uolof',
'xal' => 'kalmyk',
'xh' => 'xhosa',
'yao' => 'yao',
'yap' => 'yapés',
'yi' => 'yídish',
'yo' => 'yoruba',
'ypk' => 'lenguas yupik',
'yue' => 'cantonés',
'za' => 'zhuang',
'zap' => 'zapoteco',
'zbl' => 'símbolos Bliss',
'zen' => 'zenaga',
'zh' => 'chino',
'zh_hans' => 'chino simplificado',
'zh_hant' => 'chino tradicional',
'znd' => 'zande',
'zu' => 'zulú',
'zun' => 'zuni',
'zxx' => 'sin contenido lingüístico',
'zza' => 'zazaki',
),
'scripts' =>
array (
'arab' => 'perso-arábigo',
'armn' => 'armenio',
'avst' => 'avéstico',
'bali' => 'balinés',
'batk' => 'batak',
'beng' => 'bengalí',
'blis' => 'símbolos blis',
'bopo' => 'bopomofo',
'brah' => 'brahmi',
'brai' => 'braille',
'bugi' => 'buginés',
'buhd' => 'buhid',
'cans' => 'símbolos aborígenes canadienses unificados',
'cari' => 'cario',
'cham' => 'cham',
'cher' => 'cherokee',
'cirt' => 'cirth',
'copt' => 'copto',
'cprt' => 'chipriota',
'cyrl' => 'cirílico',
'cyrs' => 'cirílico del antiguo eslavo eclesiástico',
'deva' => 'devanagari',
'dsrt' => 'deseret',
'egyd' => 'egipcio demótico',
'egyh' => 'egipcio hierático',
'egyp' => 'jeroglíficos egipcios',
'ethi' => 'etiópico',
'geok' => 'georgiano eclesiástico',
'geor' => 'georgiano',
'glag' => 'glagolítico',
'goth' => 'gótico',
'grek' => 'griego',
'gujr' => 'gujarati',
'guru' => 'gurmuji',
'hang' => 'hangul',
'hani' => 'han',
'hano' => 'hanunoo',
'hans' => 'hanzi simplificado',
'hant' => 'hanzi tradicional',
'hebr' => 'hebreo',
'hira' => 'hiragana',
'hmng' => 'pahawh hmong',
'hrkt' => 'katakana o hiragana',
'hung' => 'húngaro antiguo',
'inds' => 'Indio (harappan)',
'ital' => 'antigua bastardilla',
'java' => 'javanés',
'jpan' => 'japonés',
'kali' => 'kayah li',
'kana' => 'katakana',
'khar' => 'kharosthi',
'khmr' => 'jemer',
'knda' => 'canarés',
'kore' => 'coreano',
'lana' => 'lanna',
'laoo' => 'lao',
'latf' => 'latino fraktur',
'latg' => 'latino gaélico',
'latn' => 'latín',
'lepc' => 'lepcha',
'limb' => 'limbu',
'lina' => 'lineal A',
'linb' => 'lineal B',
'lyci' => 'licio',
'lydi' => 'lidio',
'mand' => 'mandeo',
'maya' => 'jeroglíficos mayas',
'mero' => 'meroítico',
'mlym' => 'malayálam',
'mong' => 'mongol',
'moon' => 'moon',
'mtei' => 'manipuri',
'mymr' => 'birmano',
'nkoo' => 'n’ko',
'ogam' => 'ogham',
'olck' => 'ol ciki',
'orkh' => 'orkhon',
'orya' => 'oriya',
'osma' => 'osmaniya',
'perm' => 'permiano antiguo',
'phag' => 'phags-pa',
'phnx' => 'fenicio',
'plrd' => 'Pollard Miao',
'rjng' => 'rejang',
'roro' => 'rongo-rongo',
'runr' => 'rúnico',
'sara' => 'sarati',
'saur' => 'saurashtra',
'sgnw' => 'SignWriting',
'shaw' => 'shaviano',
'sinh' => 'binhala',
'sund' => 'sundanés',
'sylo' => 'syloti nagri',
'syrc' => 'siriaco',
'syre' => 'siriaco estrangelo',
'syrj' => 'siriaco occidental',
'syrn' => 'siriaco oriental',
'tagb' => 'tagbanúa',
'tale' => 'tai le',
'talu' => 'nuevo tai lue',
'taml' => 'tamil',
'telu' => 'telugu',
'teng' => 'tengwar',
'tfng' => 'tifinagh',
'tglg' => 'tagalo',
'thaa' => 'thaana',
'thai' => 'tailandés',
'tibt' => 'tibetano',
'ugar' => 'ugarítico',
'vaii' => 'vai',
'visp' => 'lenguaje visible',
'xpeo' => 'persa antiguo',
'xsux' => 'cuneiforme sumerio-acadio',
'yiii' => 'yi',
'zinh' => 'heredado',
'zsym' => 'símbolos',
'zxxx' => 'no escrito',
'zyyy' => 'común',
'zzzz' => 'alfabeto desconocido',
),
'territories' =>
array (
'001' => 'Mundo',
'002' => 'África',
'003' => 'América del Norte',
'005' => 'Suramérica',
'009' => 'Oceanía',
'011' => 'África occidental',
'013' => 'Centroamérica',
'014' => 'África oriental',
'015' => 'África septentrional',
'017' => 'África central',
'018' => 'África meridional',
'019' => 'Américas',
'021' => 'Norteamérica',
'029' => 'Caribe',
'030' => 'Asia oriental',
'034' => 'Asia meridional',
'035' => 'Sudeste asiático',
'039' => 'Europa meridional',
'053' => 'Australia y Nueva Zelanda',
'054' => 'Melanesia',
'057' => 'Micronesia [057]',
'061' => 'Polinesia',
142 => 'Asia',
143 => 'Asia central',
145 => 'Asia occidental',
150 => 'Europa',
151 => 'Europa oriental',
154 => 'Europa septentrional',
155 => 'Europa occidental',
419 => 'Latinoamérica',
'ac' => 'Isla de la Ascensión',
'ad' => 'Andorra',
'ae' => 'Emiratos Árabes Unidos',
'af' => 'Afganistán',
'ag' => 'Antigua y Barbuda',
'ai' => 'Anguila',
'al' => 'Albania',
'am' => 'Armenia',
'an' => 'Antillas Neerlandesas',
'ao' => 'Angola',
'aq' => 'Antártida',
'ar' => 'Argentina',
'as' => 'Samoa Americana',
'at' => 'Austria',
'au' => 'Australia',
'aw' => 'Aruba',
'ax' => 'Islas Åland',
'az' => 'Azerbaiyán',
'ba' => 'Bosnia-Herzegovina',
'bb' => 'Barbados',
'bd' => 'Bangladesh',
'be' => 'Bélgica',
'bf' => 'Burkina Faso',
'bg' => 'Bulgaria',
'bh' => 'Bahréin',
'bi' => 'Burundi',
'bj' => 'Benín',
'bl' => 'San Bartolomé',
'bm' => 'Bermudas',
'bn' => 'Brunéi',
'bo' => 'Bolivia',
'br' => 'Brasil',
'bs' => 'Bahamas',
'bt' => 'Bután',
'bv' => 'Isla Bouvet',
'bw' => 'Botsuana',
'by' => 'Bielorrusia',
'bz' => 'Belice',
'ca' => 'Canadá',
'cc' => 'Islas Cocos',
'cd' => 'Congo [República Democrática del Congo]',
'cf' => 'República Centroafricana',
'cg' => 'Congo [República]',
'ch' => 'Suiza',
'ci' => 'Costa de Marfil',
'ck' => 'Islas Cook',
'cl' => 'Chile',
'cm' => 'Camerún',
'cn' => 'China',
'co' => 'Colombia',
'cp' => 'Isla Clipperton',
'cr' => 'Costa Rica',
'cs' => 'Serbia y Montenegro',
'cu' => 'Cuba',
'cv' => 'Cabo Verde',
'cx' => 'Isla Christmas',
'cy' => 'Chipre',
'cz' => 'República Checa',
'de' => 'Alemania',
'dg' => 'Diego García',
'dj' => 'Yibuti',
'dk' => 'Dinamarca',
'dm' => 'Dominica',
'do' => 'República Dominicana',
'dz' => 'Argelia',
'ea' => 'Ceuta y Melilla',
'ec' => 'Ecuador',
'ee' => 'Estonia',
'eg' => 'Egipto',
'eh' => 'Sáhara Occidental',
'er' => 'Eritrea',
'es' => 'España',
'et' => 'Etiopía',
'eu' => 'Unión Europea',
'fi' => 'Finlandia',
'fj' => 'Fiyi',
'fk' => 'Islas Malvinas [Islas Falkland]',
'fm' => 'Micronesia',
'fo' => 'Islas Feroe',
'fr' => 'Francia',
'fx' => 'Francia metropolitana',
'ga' => 'Gabón',
'gb' => 'Reino Unido',
'gd' => 'Granada',
'ge' => 'Georgia',
'gf' => 'Guayana Francesa',
'gg' => 'Guernsey',
'gh' => 'Ghana',
'gi' => 'Gibraltar',
'gl' => 'Groenlandia',
'gm' => 'Gambia',
'gn' => 'Guinea',
'gp' => 'Guadalupe',
'gq' => 'Guinea Ecuatorial',
'gr' => 'Grecia',
'gs' => 'Islas Georgia del Sur y Sandwich del Sur',
'gt' => 'Guatemala',
'gu' => 'Guam',
'gw' => 'Guinea-Bissau',
'gy' => 'Guyana',
'hk' => 'Hong Kong',
'hm' => 'Islas Heard y McDonald',
'hn' => 'Honduras',
'hr' => 'Croacia',
'ht' => 'Haití',
'hu' => 'Hungría',
'ic' => 'Islas Canarias',
'id' => 'Indonesia',
'ie' => 'Irlanda',
'il' => 'Israel',
'im' => 'Isla de Man',
'in' => 'India',
'io' => 'Territorio Británico del Océano Índico',
'iq' => 'Iraq',
'ir' => 'Irán',
'is' => 'Islandia',
'it' => 'Italia',
'je' => 'Jersey',
'jm' => 'Jamaica',
'jo' => 'Jordania',
'jp' => 'Japón',
'ke' => 'Kenia',
'kg' => 'Kirguistán',
'kh' => 'Camboya',
'ki' => 'Kiribati',
'km' => 'Comoras',
'kn' => 'San Cristóbal y Nieves',
'kp' => 'Corea del Norte',
'kr' => 'Corea del Sur',
'kw' => 'Kuwait',
'ky' => 'Islas Caimán',
'kz' => 'Kazajistán',
'la' => 'Laos',
'lb' => 'Líbano',
'lc' => 'Santa Lucía',
'li' => 'Liechtenstein',
'lk' => 'Sri Lanka',
'lr' => 'Liberia',
'ls' => 'Lesoto',
'lt' => 'Lituania',
'lu' => 'Luxemburgo',
'lv' => 'Letonia',
'ly' => 'Libia',
'ma' => 'Marruecos',
'mc' => 'Mónaco',
'md' => 'Moldavia',
'me' => 'Montenegro',
'mf' => 'San Martín',
'mg' => 'Madagascar',
'mh' => 'Islas Marshall',
'mk' => 'Macedonia [ERYM]',
'ml' => 'Mali',
'mm' => 'Myanmar [Birmania]',
'mn' => 'Mongolia',
'mo' => 'Macao',
'mp' => 'Islas Marianas del Norte',
'mq' => 'Martinica',
'mr' => 'Mauritania',
'ms' => 'Montserrat',
'mt' => 'Malta',
'mu' => 'Mauricio',
'mv' => 'Maldivas',
'mw' => 'Malaui',
'mx' => 'México',
'my' => 'Malasia',
'mz' => 'Mozambique',
'na' => 'Namibia',
'nc' => 'Nueva Caledonia',
'ne' => 'Níger',
'nf' => 'Isla Norfolk',
'ng' => 'Nigeria',
'ni' => 'Nicaragua',
'nl' => 'Países Bajos',
'no' => 'Noruega',
'np' => 'Nepal',
'nr' => 'Nauru',
'nu' => 'Isla Niue',
'nz' => 'Nueva Zelanda',
'om' => 'Omán',
'pa' => 'Panamá',
'pe' => 'Perú',
'pf' => 'Polinesia Francesa',
'pg' => 'Papúa Nueva Guinea',
'ph' => 'Filipinas',
'pk' => 'Pakistán',
'pl' => 'Polonia',
'pm' => 'San Pedro y Miquelón',
'pn' => 'Islas Pitcairn',
'pr' => 'Puerto Rico',
'ps' => 'Territorios Palestinos',
'pt' => 'Portugal',
'pw' => 'Palau',
'py' => 'Paraguay',
'qa' => 'Qatar',
'qo' => 'Territorios alejados de Oceanía',
're' => 'Reunión',
'ro' => 'Rumanía',
'rs' => 'Serbia',
'ru' => 'Rusia',
'rw' => 'Ruanda',
'sa' => 'Arabia Saudí',
'sb' => 'Islas Salomón',
'sc' => 'Seychelles',
'sd' => 'Sudán',
'se' => 'Suecia',
'sg' => 'Singapur',
'sh' => 'Santa Elena',
'si' => 'Eslovenia',
'sj' => 'Svalbard y Jan Mayen',
'sk' => 'Eslovaquia',
'sl' => 'Sierra Leona',
'sm' => 'San Marino',
'sn' => 'Senegal',
'so' => 'Somalia',
'sr' => 'Surinam',
'st' => 'Santo Tomé y Príncipe',
'sv' => 'El Salvador',
'sy' => 'Siria',
'sz' => 'Suazilandia',
'ta' => 'Tristán da Cunha',
'tc' => 'Islas Turcas y Caicos',
'td' => 'Chad',
'tf' => 'Territorios Australes Franceses',
'tg' => 'Togo',
'th' => 'Tailandia',
'tj' => 'Tayikistán',
'tk' => 'Tokelau',
'tl' => 'Timor Oriental',
'tm' => 'Turkmenistán',
'tn' => 'Túnez',
'to' => 'Tonga',
'tr' => 'Turquía',
'tt' => 'Trinidad y Tobago',
'tv' => 'Tuvalu',
'tw' => 'Taiwán',
'tz' => 'Tanzania',
'ua' => 'Ucrania',
'ug' => 'Uganda',
'um' => 'Islas menores alejadas de los Estados Unidos',
'us' => 'Estados Unidos',
'uy' => 'Uruguay',
'uz' => 'Uzbekistán',
'va' => 'Ciudad del Vaticano',
'vc' => 'San Vicente y las Granadinas',
've' => 'Venezuela',
'vg' => 'Islas Vírgenes Británicas',
'vi' => 'Islas Vírgenes de los Estados Unidos',
'vn' => 'Vietnam',
'vu' => 'Vanuatu',
'wf' => 'Wallis y Futuna',
'ws' => 'Samoa',
'ye' => 'Yemen',
'yt' => 'Mayotte',
'za' => 'Sudáfrica',
'zm' => 'Zambia',
'zw' => 'Zimbabue',
'zz' => 'Región desconocida',
),
'pluralRules' =>
array (
0 => 'n==1',
1 => 'true',
),
);
| fydo23/mySurvey | framework/i18n/data/es_ni.php | PHP | mit | 28,024 |
<?php
// TCPDF FONT FILE DESCRIPTION
$type='TrueTypeUnicode';
$name='DejaVuSerifCondensed-BoldItalic';
$up=-63;
$ut=44;
$dw=540;
$diff='';
$originalsize=335940;
$enc='';
$file='dejavuserifcondensedbi.z';
$ctg='dejavuserifcondensedbi.ctg.z';
$desc=array('Flags'=>96,'FontBBox'=>'[-815 -389 1579 1145]','ItalicAngle'=>-11,'Ascent'=>939,'Descent'=>-236,'Leading'=>0,'CapHeight'=>729,'XHeight'=>519,'StemV'=>60,'StemH'=>26,'AvgWidth'=>509,'MaxWidth'=>1631,'MissingWidth'=>540);
$cbbox=array(0=>array(44,-177,495,705),33=>array(65,-14,345,729),34=>array(85,458,383,729),35=>array(61,0,693,718),36=>array(37,-146,568,761),37=>array(53,-14,802,742),38=>array(6,-14,803,742),39=>array(85,458,190,729),40=>array(84,-156,459,760),41=>array(-35,-156,340,760),42=>array(20,278,451,742),43=>array(95,1,659,627),44=>array(-4,-165,254,156),45=>array(37,202,336,334),46=>array(73,-14,241,172),47=>array(-72,-93,401,729),48=>array(42,-14,584,742),49=>array(58,0,482,742),50=>array(-5,0,571,742),51=>array(3,-14,576,742),52=>array(5,0,569,742),53=>array(16,-14,573,729),54=>array(52,-14,605,742),55=>array(93,0,616,729),56=>array(17,-14,589,742),57=>array(21,-14,574,742),58=>array(55,-14,277,490),59=>array(-22,-161,290,490),60=>array(95,32,659,595),61=>array(95,147,659,480),62=>array(95,32,659,595),63=>array(92,-14,517,742),64=>array(58,-174,848,703),65=>array(-71,0,655,729),66=>array(-22,0,704,729),67=>array(38,-14,708,742),68=>array(-22,0,743,729),69=>array(-22,0,696,729),70=>array(-22,0,691,729),71=>array(38,-14,730,742),72=>array(-22,0,874,729),73=>array(-22,0,444,729),74=>array(-142,-208,474,729),75=>array(-22,0,812,729),76=>array(-22,0,582,729),77=>array(-26,0,1018,729),78=>array(-24,0,851,729),79=>array(38,-14,746,742),80=>array(-22,0,681,729),81=>array(44,-196,771,742),82=>array(-22,0,700,729),83=>array(12,-14,613,742),84=>array(42,0,725,729),85=>array(85,-14,831,729),86=>array(48,0,775,729),87=>array(45,0,1085,729),88=>array(-48,0,727,729),89=>array(45,0,715,729),90=>array(-31,0,684,729),91=>array(34,-132,440,760),92=>array(72,-93,257,729),93=>array(-15,-132,392,760),94=>array(91,457,664,729),95=>array(0,-236,450,-143),96=>array(115,616,319,800),97=>array(31,-14,519,533),98=>array(22,-14,581,760),99=>array(30,-14,533,533),100=>array(9,-14,610,760),101=>array(30,-14,534,533),102=>array(-53,-190,516,760),103=>array(20,-222,600,533),104=>array(30,0,578,760),105=>array(30,0,303,760),106=>array(-149,-222,318,760),107=>array(30,0,583,760),108=>array(30,0,319,760),109=>array(50,0,896,533),110=>array(50,0,598,533),111=>array(30,-14,571,533),112=>array(22,-208,618,533),113=>array(47,-208,599,533),114=>array(50,0,529,533),115=>array(-0,-14,488,533),116=>array(43,-14,407,680),117=>array(57,-14,604,519),118=>array(19,0,530,521),119=>array(27,0,801,519),120=>array(-17,0,545,519),121=>array(-18,-222,574,519),122=>array(-14,-41,526,560),123=>array(70,-163,579,760),124=>array(116,-236,211,764),125=>array(1,-163,509,760),126=>array(95,221,659,406),161=>array(50,0,330,742),162=>array(70,-146,568,662),163=>array(-0,0,610,742),164=>array(33,30,541,596),165=>array(25,0,663,729),166=>array(116,-171,211,699),167=>array(-1,-95,464,742),168=>array(147,645,474,788),169=>array(124,0,776,725),170=>array(6,246,395,745),171=>array(62,64,518,522),172=>array(95,140,659,441),173=>array(37,202,336,334),174=>array(124,0,776,725),175=>array(140,664,433,756),176=>array(78,424,371,749),177=>array(95,0,659,627),178=>array(2,334,357,742),179=>array(6,326,361,742),180=>array(204,616,473,800),181=>array(28,-208,625,519),182=>array(101,-96,590,729),183=>array(73,255,241,440),184=>array(101,-196,313,0),185=>array(35,334,305,742),186=>array(6,246,433,742),187=>array(44,64,500,522),188=>array(35,-14,842,742),189=>array(35,-14,845,742),190=>array(6,-14,842,742),191=>array(10,-14,435,742),192=>array(-71,0,655,927),193=>array(-71,0,655,927),194=>array(-71,0,655,927),195=>array(-71,0,655,929),196=>array(-71,0,655,939),197=>array(-88,0,638,928),198=>array(-92,0,940,729),199=>array(38,-196,708,742),200=>array(-22,0,696,927),201=>array(-22,0,696,927),202=>array(-22,0,696,927),203=>array(-22,0,696,939),204=>array(-22,0,444,927),205=>array(-22,0,445,927),206=>array(-22,0,448,927),207=>array(-22,0,452,939),208=>array(-16,0,749,729),209=>array(-24,0,851,929),210=>array(38,-14,746,927),211=>array(38,-14,746,927),212=>array(38,-14,746,927),213=>array(38,-14,746,929),214=>array(38,-14,746,939),215=>array(116,23,638,604),216=>array(-33,-38,816,766),217=>array(85,-14,831,927),218=>array(85,-14,831,927),219=>array(85,-14,831,927),220=>array(85,-14,831,939),221=>array(45,0,715,927),222=>array(-22,0,656,729),223=>array(-69,-190,614,760),224=>array(31,-14,519,800),225=>array(31,-14,519,800),226=>array(31,-14,519,800),227=>array(31,-14,519,792),228=>array(31,-14,519,788),229=>array(31,-14,519,888),230=>array(24,-14,800,533),231=>array(30,-196,533,533),232=>array(30,-14,534,800),233=>array(30,-14,534,800),234=>array(30,-14,534,800),235=>array(30,-14,535,788),236=>array(51,0,298,800),237=>array(51,0,419,800),238=>array(41,0,373,800),239=>array(51,0,419,788),240=>array(15,-14,570,764),241=>array(50,0,598,792),242=>array(30,-14,571,800),243=>array(30,-14,571,800),244=>array(30,-14,571,800),245=>array(30,-14,571,792),246=>array(30,-14,571,788),247=>array(95,60,659,567),248=>array(-24,-50,625,567),249=>array(57,-14,604,800),250=>array(57,-14,604,800),251=>array(57,-14,604,800),252=>array(57,-14,604,788),253=>array(-18,-222,574,800),254=>array(2,-208,598,760),255=>array(-18,-222,574,788),256=>array(-71,0,655,914),257=>array(31,-14,519,763),258=>array(-71,0,655,936),259=>array(31,-14,519,776),260=>array(-71,-196,655,729),261=>array(31,-196,519,533),262=>array(38,-14,708,927),263=>array(30,-14,540,800),264=>array(38,-14,708,927),265=>array(30,-14,533,800),266=>array(38,-14,708,939),267=>array(30,-14,533,788),268=>array(38,-14,708,927),269=>array(30,-14,535,800),270=>array(-22,0,743,927),271=>array(9,-14,835,760),272=>array(-16,0,749,729),273=>array(9,-14,667,760),274=>array(-22,0,696,914),275=>array(30,-14,534,763),276=>array(-22,0,696,927),277=>array(30,-14,534,776),278=>array(-22,0,696,939),279=>array(30,-14,534,788),280=>array(-22,-196,696,729),281=>array(30,-196,534,533),282=>array(-22,0,696,930),283=>array(30,-14,535,800),284=>array(38,-14,730,927),285=>array(20,-222,600,800),286=>array(38,-14,730,927),287=>array(20,-222,600,776),288=>array(38,-14,730,939),289=>array(20,-222,600,788),290=>array(38,-240,730,742),291=>array(20,-222,600,753),292=>array(-22,0,874,927),293=>array(30,0,578,927),294=>array(-22,0,874,729),295=>array(30,0,578,760),296=>array(-22,0,468,929),297=>array(51,0,408,792),298=>array(-22,0,447,914),299=>array(51,0,351,763),300=>array(-22,0,464,927),301=>array(51,0,400,776),302=>array(-5,-196,461,729),303=>array(47,-196,320,760),304=>array(-22,0,444,939),305=>array(51,0,298,519),306=>array(-22,-208,896,729),307=>array(30,-222,668,760),308=>array(-142,-208,474,927),309=>array(-128,-222,342,800),310=>array(-22,-226,812,729),311=>array(30,-226,583,760),312=>array(52,0,604,518),313=>array(-22,0,582,928),314=>array(30,0,431,928),315=>array(-22,-226,582,729),316=>array(30,-226,319,760),317=>array(-22,0,617,729),318=>array(30,0,531,760),319=>array(-22,0,639,729),320=>array(30,0,479,760),321=>array(-16,0,587,729),322=>array(-7,0,370,760),323=>array(-24,0,851,928),324=>array(50,0,598,776),325=>array(-24,-226,851,729),326=>array(50,-226,598,533),327=>array(-24,0,851,927),328=>array(50,0,598,800),329=>array(67,0,812,742),330=>array(31,-208,772,743),331=>array(70,-222,604,533),332=>array(38,-14,746,914),333=>array(30,-14,571,763),334=>array(38,-14,746,927),335=>array(30,-14,571,776),336=>array(38,-14,746,927),337=>array(30,-14,587,800),338=>array(38,0,1072,729),339=>array(31,-14,885,533),340=>array(-22,0,700,928),341=>array(50,0,536,776),342=>array(-22,-226,700,729),343=>array(50,-226,529,533),344=>array(-22,0,700,927),345=>array(50,0,535,800),346=>array(12,-14,624,928),347=>array(-0,-14,536,776),348=>array(12,-14,613,927),349=>array(-0,-14,488,800),350=>array(12,-196,613,742),351=>array(-0,-196,488,533),352=>array(12,-14,613,927),353=>array(-0,-14,497,800),354=>array(42,-196,725,729),355=>array(43,-196,407,680),356=>array(42,0,725,927),357=>array(43,-14,524,780),358=>array(42,0,725,729),359=>array(9,-14,407,680),360=>array(85,-14,831,929),361=>array(57,-14,604,792),362=>array(85,-14,831,914),363=>array(57,-14,604,763),364=>array(85,-14,831,927),365=>array(57,-14,604,776),366=>array(85,-14,831,1057),367=>array(57,-14,604,854),368=>array(85,-14,831,927),369=>array(57,-14,604,800),370=>array(85,-204,831,729),371=>array(57,-196,604,519),372=>array(45,0,1085,931),373=>array(27,0,801,800),374=>array(45,0,715,931),375=>array(-18,-222,574,800),376=>array(45,0,715,939),377=>array(-31,0,684,928),378=>array(-14,-41,536,776),379=>array(-31,0,684,952),380=>array(-14,-41,526,759),381=>array(-31,0,684,927),382=>array(-14,-41,526,800),383=>array(-53,-190,516,760),384=>array(22,-14,581,760),385=>array(-86,0,704,729),386=>array(-22,0,743,729),387=>array(-45,-14,574,760),388=>array(-22,0,693,729),389=>array(-45,-14,574,760),390=>array(0,-14,671,742),391=>array(29,-14,887,840),392=>array(21,-14,715,709),393=>array(-16,0,749,729),394=>array(-86,0,743,729),395=>array(15,0,783,729),396=>array(0,-14,661,760),397=>array(35,-246,585,533),398=>array(-22,0,704,729),399=>array(38,-14,746,742),400=>array(72,-14,697,742),401=>array(-154,-208,709,729),402=>array(-166,-190,516,760),403=>array(29,-14,910,840),404=>array(75,-92,746,729),405=>array(31,-1,881,760),406=>array(91,0,444,729),407=>array(-22,0,444,729),408=>array(-22,0,875,729),409=>array(31,0,583,760),410=>array(5,0,319,760),411=>array(-33,0,540,739),412=>array(68,-14,997,729),413=>array(-156,-208,869,729),414=>array(68,-208,597,533),415=>array(38,-14,746,742),416=>array(37,-14,844,760),417=>array(31,-14,680,548),418=>array(51,-171,992,742),419=>array(54,-208,790,533),420=>array(-86,0,681,729),421=>array(7,-208,595,709),422=>array(-11,-142,688,729),423=>array(32,-14,622,742),424=>array(21,-14,489,533),425=>array(-27,0,640,729),426=>array(-47,-223,414,760),427=>array(57,-222,465,680),428=>array(38,0,725,729),429=>array(37,-14,473,760),430=>array(60,-208,743,729),431=>array(88,-14,1015,816),432=>array(59,-14,734,548),433=>array(35,-14,822,729),434=>array(120,0,757,729),435=>array(45,0,796,730),436=>array(-19,-222,701,533),437=>array(-31,0,684,729),438=>array(-14,-41,526,560),439=>array(-27,-14,546,729),440=>array(3,-14,583,729),441=>array(5,-203,586,519),442=>array(-2,-220,545,519),443=>array(-5,0,581,742),444=>array(57,-14,692,729),445=>array(-25,-203,579,519),446=>array(-34,-15,341,680),447=>array(20,-208,649,560),448=>array(21,0,244,729),449=>array(21,0,421,729),450=>array(-15,0,428,729),451=>array(21,0,244,729),452=>array(-22,0,1464,927),453=>array(-22,-41,1307,800),454=>array(9,-41,1156,800),455=>array(-22,-208,1106,729),456=>array(-22,-222,951,760),457=>array(30,-222,660,760),458=>array(-24,-208,1296,729),459=>array(-24,-222,1141,760),460=>array(50,-222,973,760),461=>array(-71,0,655,927),462=>array(31,-14,519,800),463=>array(-22,0,473,927),464=>array(51,0,406,800),465=>array(38,-14,746,927),466=>array(30,-14,571,800),467=>array(85,-14,831,927),468=>array(57,-14,604,800),469=>array(85,-14,831,1036),470=>array(57,-14,604,899),471=>array(85,-14,831,1057),472=>array(57,-14,604,920),473=>array(85,-14,831,1058),474=>array(57,-14,604,921),475=>array(85,-14,831,1057),476=>array(57,-14,604,920),477=>array(41,-14,532,533),478=>array(-71,0,655,1036),479=>array(31,-14,519,899),480=>array(-71,0,655,1036),481=>array(31,-14,519,899),482=>array(-92,0,940,914),483=>array(24,-14,800,763),484=>array(38,-14,758,742),485=>array(20,-222,632,533),486=>array(19,-17,711,927),487=>array(-3,-222,576,800),488=>array(-37,0,796,927),489=>array(15,0,568,927),490=>array(38,-204,746,742),491=>array(30,-204,571,533),492=>array(38,-204,746,914),493=>array(30,-204,571,763),494=>array(-27,-14,546,927),495=>array(-25,-203,544,800),496=>array(-128,-222,425,800),497=>array(-22,0,1464,729),498=>array(-22,-41,1307,729),499=>array(9,-41,1156,760),500=>array(21,-14,714,928),501=>array(-3,-222,576,776),502=>array(-21,-14,1097,729),503=>array(-41,-208,751,742),504=>array(-40,0,835,927),505=>array(-40,0,574,800),506=>array(-88,0,638,928),507=>array(31,-14,537,928),508=>array(-92,0,940,928),509=>array(24,-14,800,800),510=>array(-33,-38,816,928),511=>array(-24,-50,625,800),512=>array(-71,0,655,928),513=>array(30,-14,519,800),514=>array(-71,0,655,958),515=>array(30,-14,519,776),516=>array(-22,0,696,928),517=>array(30,-14,534,800),518=>array(-22,0,696,958),519=>array(30,-14,534,776),520=>array(-22,0,444,928),521=>array(14,0,330,801),522=>array(-22,0,451,958),523=>array(30,0,351,767),524=>array(38,-14,746,928),525=>array(30,-14,570,800),526=>array(38,-14,746,958),527=>array(30,-14,570,776),528=>array(-22,0,700,928),529=>array(50,0,528,800),530=>array(-22,0,700,958),531=>array(50,0,528,776),532=>array(85,-14,831,928),533=>array(56,-14,604,800),534=>array(85,-14,831,958),535=>array(56,-14,604,776),536=>array(12,-230,613,742),537=>array(-0,-230,488,533),538=>array(42,-230,725,729),539=>array(43,-230,407,680),540=>array(-23,-210,589,742),541=>array(-21,-211,514,531),542=>array(-22,0,874,927),543=>array(30,0,577,927),544=>array(31,-208,772,743),545=>array(20,-48,650,760),546=>array(4,-14,555,742),547=>array(12,-14,506,760),548=>array(-8,-263,707,729),549=>array(9,-263,549,519),550=>array(-71,0,655,939),551=>array(30,-14,519,788),552=>array(-22,-196,696,729),553=>array(30,-196,534,533),554=>array(38,-14,746,1036),555=>array(30,-14,571,899),556=>array(38,-14,746,1036),557=>array(30,-14,571,894),558=>array(38,-14,746,939),559=>array(30,-14,571,788),560=>array(38,-14,746,1036),561=>array(30,-14,571,899),562=>array(45,0,715,914),563=>array(-18,-222,574,763),564=>array(74,-113,458,760),565=>array(60,-113,792,533),566=>array(52,-113,458,680),567=>array(-128,-222,317,519),568=>array(17,-14,873,760),569=>array(53,-208,908,533),570=>array(-75,-38,774,766),571=>array(-66,-38,783,766),572=>array(-51,-50,599,567),573=>array(-22,0,581,729),574=>array(-89,-38,760,766),575=>array(17,-217,506,533),576=>array(5,-222,546,519),577=>array(-1,0,599,729),578=>array(66,0,479,533),579=>array(-22,0,704,729),580=>array(24,-14,831,729),581=>array(-71,0,655,729),582=>array(-22,-57,696,785),583=>array(30,-56,534,581),584=>array(-142,-208,474,729),585=>array(-128,-222,345,760),586=>array(55,-208,808,742),587=>array(47,-222,660,533),588=>array(-22,0,700,729),589=>array(20,0,529,533),590=>array(18,0,715,729),591=>array(-18,-222,593,519),592=>array(64,-14,552,533),593=>array(37,-14,672,532),594=>array(21,-14,656,531),595=>array(22,-14,574,760),596=>array(11,-14,508,533),597=>array(42,-113,540,527),598=>array(35,-222,641,760),599=>array(17,-14,770,760),600=>array(30,-14,532,533),601=>array(41,-14,532,533),602=>array(36,-14,829,533),603=>array(22,-12,529,526),604=>array(-5,-12,492,526),605=>array(-5,-12,829,526),606=>array(37,-18,630,533),607=>array(-128,-222,345,519),608=>array(0,-222,788,760),609=>array(21,-222,673,519),610=>array(56,-4,536,520),611=>array(44,-219,540,519),612=>array(64,-37,585,520),613=>array(74,-208,621,519),614=>array(31,0,578,760),615=>array(50,-222,578,760),616=>array(5,0,304,760),617=>array(67,0,298,519),618=>array(-15,0,365,519),619=>array(21,0,363,760),620=>array(33,0,439,760),621=>array(40,-222,353,760),622=>array(48,-203,728,760),623=>array(57,-14,902,519),624=>array(74,-208,919,519),625=>array(70,-222,896,533),626=>array(-129,-222,617,533),627=>array(70,-222,686,533),628=>array(11,0,636,519),629=>array(37,-14,564,533),630=>array(56,0,942,521),631=>array(26,-14,626,530),632=>array(-5,-213,602,760),633=>array(-20,-14,459,519),634=>array(-41,-14,480,760),635=>array(-1,-222,534,519),636=>array(32,-207,547,533),637=>array(59,-222,548,533),638=>array(50,0,459,533),639=>array(55,0,368,533),640=>array(11,0,635,519),641=>array(11,0,716,519),642=>array(4,-222,506,533),643=>array(-150,-223,429,760),644=>array(-149,-222,519,760),645=>array(80,-222,410,527),646=>array(-125,-223,429,760),647=>array(35,-161,398,533),648=>array(38,-222,425,680),649=>array(27,-14,626,519),650=>array(34,-14,623,519),651=>array(66,-1,588,519),652=>array(19,0,530,520),653=>array(27,0,801,519),654=>array(1,0,593,741),655=>array(91,0,649,520),656=>array(5,-222,603,519),657=>array(-6,-89,534,519),658=>array(-25,-203,544,519),659=>array(57,-203,544,519),660=>array(47,0,461,761),661=>array(72,0,490,761),662=>array(51,0,469,761),663=>array(60,-223,509,761),664=>array(38,-14,746,742),665=>array(-15,0,580,519),666=>array(14,-18,607,533),667=>array(35,-4,724,760),668=>array(-15,0,674,519),669=>array(-107,-223,338,760),670=>array(90,-208,643,519),671=>array(11,0,517,519),672=>array(34,-208,786,760),673=>array(47,0,461,761),674=>array(72,0,490,761),675=>array(17,-41,1017,760),676=>array(34,-203,1017,760),677=>array(23,-89,1007,760),678=>array(42,0,811,680),679=>array(55,-223,775,760),680=>array(44,-20,823,680),681=>array(-50,-222,916,760),682=>array(31,0,743,760),683=>array(31,-41,726,760),684=>array(30,0,615,625),685=>array(-5,120,406,625),686=>array(-14,-208,600,760),687=>array(-13,-222,657,760),688=>array(47,326,402,751),689=>array(45,329,400,754),690=>array(-7,202,282,752),691=>array(58,334,363,632),692=>array(14,321,318,620),693=>array(24,202,374,617),694=>array(14,326,464,617),695=>array(17,334,505,620),696=>array(-11,212,361,620),697=>array(49,557,217,800),698=>array(49,557,415,800),699=>array(37,456,275,742),700=>array(37,456,275,742),701=>array(87,456,248,742),702=>array(138,481,288,760),703=>array(143,481,293,760),704=>array(4,327,264,752),705=>array(20,327,280,752),706=>array(110,517,361,843),707=>array(88,517,340,843),708=>array(57,561,351,800),709=>array(99,561,393,800),710=>array(95,616,426,800),711=>array(136,616,468,800),712=>array(64,513,190,759),713=>array(140,664,433,756),714=>array(204,616,473,800),715=>array(115,616,319,800),716=>array(64,-90,190,156),717=>array(-9,-189,284,-97),720=>array(60,0,272,434),721=>array(109,303,246,434),722=>array(100,269,250,547),723=>array(106,269,256,547),726=>array(41,165,278,411),727=>array(41,242,278,334),728=>array(153,624,454,776),729=>array(229,645,358,788),730=>array(170,610,421,888),731=>array(137,-196,327,0),732=>array(120,638,461,792),733=>array(131,616,511,800),734=>array(-17,299,364,500),736=>array(28,204,340,617),737=>array(45,326,221,751),738=>array(18,327,328,633),739=>array(-11,334,343,620),740=>array(20,327,280,752),741=>array(131,0,424,693),742=>array(105,0,424,693),743=>array(79,0,424,693),744=>array(52,0,424,693),745=>array(26,0,424,693),748=>array(71,-281,365,-42),750=>array(48,456,471,742),751=>array(49,-241,381,-58),752=>array(29,-281,323,-42),755=>array(100,-240,351,38),759=>array(54,-193,396,-40),768=>array(-365,616,-161,800),769=>array(-276,616,-7,800),770=>array(-386,616,-54,800),771=>array(-360,638,-19,792),772=>array(-340,664,-47,756),773=>array(-450,663,0,755),774=>array(-328,624,-26,776),775=>array(-251,645,-122,788),776=>array(-333,645,-7,788),777=>array(-397,616,-195,866),778=>array(-311,610,-60,888),779=>array(-350,616,31,800),780=>array(-344,616,-13,800),781=>array(-376,616,-258,813),782=>array(-458,616,-176,813),783=>array(-379,616,-63,800),784=>array(-389,624,-88,903),785=>array(-330,624,-28,776),786=>array(-268,456,-84,617),787=>array(-254,606,-113,847),788=>array(-250,606,-111,847),789=>array(-93,616,93,800),790=>array(-373,-253,-168,-69),791=>array(-315,-251,-46,-67),792=>array(-303,-357,-121,-111),793=>array(-330,-357,-147,-111),794=>array(-174,684,63,930),795=>array(-114,338,79,548),796=>array(-288,-389,-138,-111),797=>array(-349,-280,-111,-111),798=>array(-338,-280,-100,-111),799=>array(-342,-357,-104,-111),800=>array(-344,-203,-106,-111),801=>array(-493,-222,-114,139),802=>array(-367,-222,-53,139),803=>array(-358,-213,-229,-70),804=>array(-391,-213,-64,-70),805=>array(-330,-240,-123,-11),806=>array(-318,-230,-135,-69),807=>array(-350,-196,-138,0),808=>array(-313,-196,-123,0),809=>array(-280,-266,-163,-69),810=>array(-380,-253,-70,-69),811=>array(-370,-221,-53,-69),812=>array(-375,-251,-43,-67),813=>array(-407,-253,-75,-69),814=>array(-362,-221,-62,-69),815=>array(-389,-221,-88,-69),816=>array(-398,-222,-57,-68),817=>array(-372,-161,-79,-69),818=>array(-450,-236,0,-143),819=>array(-450,-236,0,-9),820=>array(-686,210,-70,417),821=>array(-315,234,-15,293),822=>array(-630,234,-32,293),823=>array(-629,-50,20,567),824=>array(-815,-38,34,766),825=>array(-297,-378,-147,-100),826=>array(-380,-242,-71,-59),827=>array(-376,-350,-75,-69),828=>array(-397,-221,-80,-69),829=>array(-433,581,-199,820),830=>array(-280,598,-94,877),831=>array(-450,528,0,755),835=>array(-254,606,-113,847),856=>array(12,645,141,788),864=>array(-264,723,510,898),865=>array(-278,729,523,902),880=>array(-22,0,688,729),881=>array(52,0,497,519),882=>array(16,0,762,729),883=>array(31,0,703,519),884=>array(49,557,217,800),885=>array(30,-208,199,35),886=>array(60,0,811,729),887=>array(45,0,612,519),890=>array(184,-208,309,-60),891=>array(20,-14,514,533),892=>array(30,-14,533,533),893=>array(20,-14,514,533),894=>array(-22,-161,290,490),900=>array(204,616,473,800),901=>array(147,645,545,996),902=>array(-71,0,655,800),903=>array(73,255,241,440),904=>array(38,0,859,800),905=>array(38,0,1040,800),906=>array(38,0,610,800),908=>array(38,-14,760,800),910=>array(38,0,928,800),911=>array(1,0,787,800),912=>array(66,16,491,996),913=>array(-71,0,655,729),914=>array(-22,0,704,729),915=>array(-22,0,691,729),916=>array(-38,0,604,729),917=>array(-22,0,696,729),918=>array(-31,0,684,729),919=>array(-22,0,874,729),920=>array(38,-14,746,742),921=>array(-22,0,444,729),922=>array(-22,0,812,729),923=>array(-71,0,655,729),924=>array(-26,0,1018,729),925=>array(-24,0,851,729),926=>array(-14,0,642,729),927=>array(38,-14,746,742),928=>array(-22,0,874,729),929=>array(-22,0,681,729),931=>array(-27,0,640,729),932=>array(42,0,725,729),933=>array(45,0,715,729),934=>array(38,0,745,729),935=>array(-48,0,727,729),936=>array(60,0,880,729),937=>array(-21,0,766,742),938=>array(-22,0,457,939),939=>array(45,0,715,939),940=>array(37,-14,672,800),941=>array(22,-12,545,800),942=>array(68,-208,596,800),943=>array(66,16,430,800),944=>array(66,-1,631,996),945=>array(37,-14,672,532),946=>array(-29,-208,569,769),947=>array(76,-209,601,519),948=>array(17,-14,566,765),949=>array(22,-12,529,526),950=>array(34,-208,573,760),951=>array(68,-208,596,533),952=>array(37,-17,564,771),953=>array(66,16,371,519),954=>array(-15,0,644,519),955=>array(-33,0,540,739),956=>array(28,-208,625,519),957=>array(51,0,604,519),958=>array(24,-208,573,760),959=>array(30,-14,571,533),960=>array(-15,0,674,519),961=>array(-8,-208,580,533),962=>array(54,-208,550,533),963=>array(38,-14,664,519),964=>array(52,16,606,519),965=>array(66,-1,592,519),966=>array(62,-208,792,519),967=>array(-53,-222,636,533),968=>array(97,-208,872,519),969=>array(38,-1,822,519),970=>array(66,16,423,788),971=>array(66,-1,592,788),972=>array(30,-14,571,800),973=>array(66,-1,592,800),974=>array(38,-1,822,800),975=>array(-0,-240,833,729),976=>array(37,-17,545,771),977=>array(45,-17,733,771),978=>array(80,0,697,729),979=>array(38,0,881,800),980=>array(80,0,697,939),981=>array(34,-208,806,760),982=>array(38,-1,876,519),983=>array(26,-222,600,521),984=>array(54,-207,762,742),985=>array(54,-207,582,533),986=>array(55,-208,725,742),987=>array(46,-208,564,616),988=>array(-22,0,691,729),989=>array(-163,-211,508,742),990=>array(15,0,517,729),991=>array(72,0,528,759),992=>array(7,-209,675,742),993=>array(22,-208,574,533),1008=>array(8,-5,581,521),1009=>array(20,-210,580,533),1010=>array(30,-14,533,533),1011=>array(-149,-222,318,760),1012=>array(38,-14,746,742),1013=>array(30,-14,534,533),1014=>array(20,-14,508,533),1015=>array(-22,0,656,729),1016=>array(2,-208,598,760),1017=>array(38,-14,708,742),1018=>array(-26,0,1018,729),1019=>array(0,-208,797,519),1020=>array(-18,-208,604,533),1021=>array(10,-14,679,742),1022=>array(38,-14,708,742),1023=>array(10,-14,679,742),1024=>array(-22,0,696,927),1025=>array(-22,0,696,939),1026=>array(9,-214,727,729),1027=>array(-22,0,673,927),1028=>array(38,-14,708,742),1029=>array(12,-14,613,742),1030=>array(-22,0,444,729),1031=>array(-22,0,490,939),1032=>array(-142,-208,474,729),1033=>array(-39,-14,1017,729),1034=>array(-22,0,1070,729),1035=>array(-10,0,765,729),1036=>array(-22,0,830,927),1037=>array(-22,0,874,927),1038=>array(35,-14,786,997),1039=>array(-8,-157,888,729),1040=>array(-55,0,671,729),1041=>array(-22,0,743,729),1042=>array(-22,0,704,729),1043=>array(-22,0,673,729),1044=>array(-35,-157,817,729),1045=>array(-22,0,696,729),1046=>array(-55,0,1191,729),1047=>array(1,-14,611,742),1048=>array(-22,0,874,729),1049=>array(-22,0,874,999),1050=>array(-22,0,830,729),1051=>array(-39,-14,821,729),1052=>array(-26,0,1018,729),1053=>array(-22,0,874,729),1054=>array(38,-14,746,742),1055=>array(-22,0,874,729),1056=>array(-22,0,681,729),1057=>array(38,-14,708,742),1058=>array(42,0,725,729),1059=>array(35,-14,786,729),1060=>array(34,0,821,729),1061=>array(-48,0,727,729),1062=>array(-8,-157,887,729),1063=>array(81,0,839,729),1064=>array(-26,0,1167,729),1065=>array(-13,-157,1181,729),1066=>array(37,0,796,729),1067=>array(-22,0,1104,729),1068=>array(-22,0,678,729),1069=>array(10,-14,679,742),1070=>array(-22,-14,1114,742),1071=>array(-44,0,817,729),1072=>array(31,-14,519,533),1073=>array(35,-14,625,786),1074=>array(30,-14,550,533),1075=>array(50,-14,498,534),1076=>array(31,-14,597,760),1077=>array(30,-14,534,533),1078=>array(9,-14,1192,533),1079=>array(21,-14,534,533),1080=>array(57,-14,604,519),1081=>array(57,-14,604,817),1082=>array(50,-14,614,533),1083=>array(9,-14,608,519),1084=>array(9,-14,805,519),1085=>array(50,0,606,519),1086=>array(30,-14,571,533),1087=>array(50,0,598,533),1088=>array(22,-208,618,533),1089=>array(30,-14,533,533),1090=>array(50,0,896,533),1091=>array(-18,-222,574,519),1092=>array(27,-208,779,760),1093=>array(-17,0,545,519),1094=>array(57,-217,673,519),1095=>array(57,0,593,519),1096=>array(57,-14,902,519),1097=>array(57,-217,971,519),1098=>array(16,-14,622,534),1099=>array(57,-14,866,519),1100=>array(57,-14,561,519),1101=>array(31,-14,551,533),1102=>array(50,-14,872,533),1103=>array(9,-14,666,519),1104=>array(30,-14,534,800),1105=>array(30,-14,535,788),1106=>array(27,-222,578,760),1107=>array(50,-14,521,800),1108=>array(30,-14,534,533),1109=>array(-0,-14,488,533),1110=>array(30,0,303,760),1111=>array(51,0,419,788),1112=>array(-149,-222,318,760),1113=>array(9,-14,880,519),1114=>array(50,-14,877,519),1115=>array(31,0,578,760),1116=>array(50,-14,614,800),1117=>array(57,-14,604,800),1118=>array(-18,-222,574,823),1119=>array(57,-220,604,519),1122=>array(28,0,728,729),1123=>array(50,-14,912,534),1124=>array(-22,-14,1068,742),1125=>array(68,-14,853,533),1130=>array(9,0,1183,729),1131=>array(25,-14,919,519),1132=>array(-22,0,1405,729),1133=>array(68,-14,1133,519),1136=>array(55,0,1052,729),1137=>array(43,-208,1027,760),1138=>array(38,-14,746,742),1139=>array(31,-14,558,533),1140=>array(61,0,877,742),1141=>array(44,0,707,533),1142=>array(61,0,877,927),1143=>array(44,0,707,800),1164=>array(26,0,726,729),1165=>array(44,-14,570,760),1168=>array(-22,0,708,872),1169=>array(52,0,570,668),1170=>array(-22,0,673,729),1171=>array(50,-14,498,534),1172=>array(-22,-214,691,729),1173=>array(-15,-222,562,519),1174=>array(-55,-157,1191,729),1175=>array(9,-217,1192,533),1176=>array(1,-196,611,742),1177=>array(21,-196,534,533),1178=>array(-22,-157,830,729),1179=>array(50,-217,614,533),1182=>array(-22,0,830,729),1183=>array(50,-14,614,760),1184=>array(37,0,948,729),1185=>array(19,-14,688,533),1186=>array(-22,-157,874,729),1187=>array(50,-217,670,519),1188=>array(-22,0,1103,729),1189=>array(50,0,848,519),1190=>array(-22,-214,1107,729),1191=>array(-15,-222,851,519),1194=>array(38,-196,708,742),1195=>array(30,-196,533,533),1196=>array(42,-157,724,729),1197=>array(50,-217,973,533),1198=>array(45,0,715,729),1199=>array(42,-208,566,519),1200=>array(45,0,714,729),1201=>array(42,-208,566,519),1202=>array(-48,-157,727,729),1203=>array(-17,-217,572,519),1204=>array(20,-157,926,729),1205=>array(31,-217,700,519),1206=>array(81,-157,839,729),1207=>array(57,-217,658,519),1210=>array(-36,0,719,729),1211=>array(30,0,578,760),1216=>array(-22,0,444,729),1217=>array(-55,0,1191,927),1218=>array(9,-14,1192,776),1219=>array(-22,-214,812,729),1220=>array(-15,-222,644,519),1223=>array(-22,-214,874,729),1224=>array(-15,-222,674,519),1227=>array(145,-157,903,729),1228=>array(65,-162,674,519),1231=>array(-36,0,386,760),1232=>array(-55,0,671,936),1233=>array(31,-14,519,776),1234=>array(-55,0,671,939),1235=>array(31,-14,519,788),1236=>array(-92,0,940,729),1237=>array(24,-14,800,533),1238=>array(-22,0,696,927),1239=>array(30,-14,534,776),1240=>array(38,-14,746,742),1241=>array(41,-14,532,533),1242=>array(38,-14,746,939),1243=>array(41,-14,536,788),1244=>array(-55,0,1191,939),1245=>array(9,-14,1192,788),1246=>array(1,-14,611,939),1247=>array(21,-14,534,788),1248=>array(-27,-14,546,729),1249=>array(-25,-203,544,519),1250=>array(-22,0,874,914),1251=>array(57,-14,604,763),1252=>array(-22,0,874,939),1253=>array(57,-14,604,788),1254=>array(38,-14,746,939),1255=>array(30,-14,571,788),1256=>array(38,-14,746,742),1257=>array(37,-14,564,533),1258=>array(38,-14,746,939),1259=>array(37,-14,564,788),1260=>array(10,-14,679,939),1261=>array(31,-14,554,788),1262=>array(35,-14,786,914),1263=>array(-18,-222,574,763),1264=>array(35,-14,786,939),1265=>array(-18,-222,574,788),1266=>array(35,-14,786,927),1267=>array(-18,-222,574,800),1268=>array(81,0,839,939),1269=>array(57,0,593,788),1270=>array(-22,-157,673,729),1271=>array(50,-217,498,534),1272=>array(-22,0,1104,939),1273=>array(57,-14,866,788),1296=>array(72,-14,697,742),1297=>array(15,-14,567,533),1298=>array(-22,-208,838,729),1299=>array(9,-222,609,519),1300=>array(-39,-14,1153,729),1301=>array(9,-14,913,519),1306=>array(44,-196,771,742),1307=>array(47,-208,599,533),1308=>array(45,0,1085,729),1309=>array(27,0,801,519),1329=>array(85,-14,856,729),1330=>array(-34,0,722,743),1331=>array(50,0,822,743),1332=>array(18,0,835,743),1333=>array(85,-14,769,729),1334=>array(22,-72,709,743),1335=>array(-26,-72,716,729),1336=>array(-28,-72,727,743),1337=>array(-33,-10,1063,743),1338=>array(14,-14,869,729),1339=>array(-20,0,698,729),1340=>array(-13,-72,615,729),1341=>array(-19,-14,1054,729),1342=>array(74,-13,831,743),1343=>array(70,0,723,729),1344=>array(-40,-66,625,729),1345=>array(25,-32,720,743),1346=>array(24,-72,794,743),1347=>array(-33,0,734,739),1348=>array(85,-14,963,729),1349=>array(18,-14,708,742),1350=>array(27,-14,797,801),1351=>array(57,-14,725,729),1352=>array(-34,0,699,743),1353=>array(83,-84,708,743),1354=>array(18,0,845,743),1355=>array(27,-72,723,744),1356=>array(-34,0,885,743),1357=>array(85,-14,818,729),1358=>array(41,-72,795,729),1359=>array(18,-14,677,742),1360=>array(-34,0,721,743),1361=>array(15,-14,694,742),1362=>array(-33,0,725,729),1363=>array(35,0,827,729),1364=>array(-100,0,756,743),1365=>array(28,-14,754,742),1366=>array(9,-14,828,729),1369=>array(143,481,293,760),1370=>array(-4,408,254,729),1371=>array(-13,615,292,799),1372=>array(-22,618,377,893),1373=>array(27,615,268,799),1374=>array(-15,605,393,854),1375=>array(26,618,413,760),1377=>array(53,-14,899,519),1378=>array(-25,-208,611,533),1379=>array(62,-208,694,533),1380=>array(15,-208,716,533),1381=>array(50,-14,617,760),1382=>array(62,-208,686,533),1383=>array(-27,0,576,760),1384=>array(-25,-208,624,533),1385=>array(-25,-208,838,532),1386=>array(25,-14,729,760),1387=>array(-58,-208,591,760),1388=>array(-24,-208,375,519),1389=>array(-54,-208,923,760),1390=>array(23,-14,624,789),1391=>array(68,-208,593,760),1392=>array(-24,0,589,760),1393=>array(13,-14,541,783),1394=>array(15,-208,680,533),1395=>array(31,-14,625,771),1396=>array(31,-14,708,771),1397=>array(-138,-208,308,519),1398=>array(40,-14,573,771),1399=>array(-67,-208,455,538),1400=>array(-3,0,611,533),1401=>array(-38,-208,396,540),1402=>array(70,-208,916,519),1403=>array(0,-208,598,537),1404=>array(-3,0,617,533),1405=>array(53,-14,601,519),1406=>array(49,-208,639,760),1407=>array(52,-14,883,533),1408=>array(-34,-208,615,533),1409=>array(36,-222,688,533),1410=>array(-1,0,431,519),1411=>array(49,-208,880,760),1412=>array(-16,-208,637,533),1413=>array(42,-14,582,533),1414=>array(19,-208,826,760),1415=>array(50,-14,717,760),1417=>array(64,-14,240,434),1418=>array(31,203,328,365),4256=>array(8,0,674,848),4257=>array(118,0,748,847),4258=>array(53,-81,729,848),4259=>array(18,-0,787,847),4260=>array(56,-0,730,848),4261=>array(53,-0,883,848),4262=>array(104,-1,840,847),4263=>array(42,-1,1009,847),4264=>array(104,-0,571,847),4265=>array(87,-0,638,847),4266=>array(57,-0,873,847),4267=>array(10,-0,834,847),4268=>array(-33,-0,682,847),4269=>array(39,-35,952,847),4270=>array(104,-0,865,847),4271=>array(104,-0,839,846),4272=>array(56,-0,916,846),4273=>array(53,-0,680,846),4274=>array(8,-0,672,847),4275=>array(41,-58,848,846),4276=>array(55,-0,854,846),4277=>array(72,-0,891,846),4278=>array(-33,-0,661,846),4279=>array(118,-0,777,846),4280=>array(44,-0,767,847),4281=>array(-32,-0,637,846),4282=>array(-10,-1,764,848),4283=>array(13,-0,857,847),4284=>array(-33,-0,690,847),4285=>array(9,-0,717,847),4286=>array(8,-0,759,846),4287=>array(-33,-0,971,846),4288=>array(57,-0,976,846),4289=>array(-33,-0,667,846),4290=>array(36,-0,730,847),4291=>array(89,-1,749,846),4292=>array(56,-0,819,846),4293=>array(12,-0,960,847),4304=>array(18,0,475,596),4305=>array(32,0,525,853),4306=>array(-44,-225,507,566),4307=>array(24,-220,763,556),4308=>array(-51,-225,521,556),4309=>array(-51,-225,522,556),4310=>array(66,0,639,855),4311=>array(31,0,787,556),4312=>array(31,0,514,556),4313=>array(-66,-225,479,556),4314=>array(31,-220,981,562),4315=>array(31,0,619,854),4316=>array(35,0,634,877),4317=>array(35,-123,754,556),4318=>array(17,1,580,854),4319=>array(-42,-225,580,555),4320=>array(39,-0,754,846),4321=>array(75,0,532,854),4322=>array(3,-225,651,706),4323=>array(53,-225,647,556),4324=>array(47,-225,752,556),4325=>array(-35,-225,656,855),4326=>array(19,-220,793,556),4327=>array(-62,-225,566,556),4328=>array(42,0,627,854),4329=>array(-14,-5,538,855),4330=>array(14,-225,618,556),4331=>array(28,0,615,854),4332=>array(18,-229,663,854),4333=>array(-41,-225,573,854),4334=>array(75,0,569,854),4335=>array(-84,-225,667,556),4336=>array(18,0,609,854),4337=>array(24,0,633,863),4338=>array(-51,-94,526,556),4339=>array(-35,-225,581,615),4340=>array(-35,-225,570,855),4341=>array(15,0,666,854),4342=>array(27,-225,810,699),4343=>array(-30,-225,512,566),4344=>array(-24,-225,524,556),4345=>array(24,-225,572,561),4346=>array(38,-69,535,556),4347=>array(-39,0,377,511),4348=>array(62,341,457,882),7424=>array(-15,0,558,519),7425=>array(-15,0,815,519),7426=>array(39,-14,814,533),7427=>array(-15,0,620,519),7428=>array(37,-14,533,533),7429=>array(-15,0,580,519),7430=>array(-15,0,580,519),7431=>array(-20,0,568,519),7432=>array(-39,-18,448,533),7433=>array(-3,-238,270,522),7434=>array(-28,-14,518,519),7435=>array(-15,0,644,519),7436=>array(-3,0,517,519),7437=>array(-15,0,796,519),7438=>array(45,0,679,519),7439=>array(30,-14,571,533),7440=>array(15,-14,511,533),7441=>array(37,-33,529,553),7442=>array(31,-2,526,521),7443=>array(54,-50,548,567),7444=>array(40,-14,895,533),7445=>array(2,-14,487,534),7446=>array(82,260,610,533),7447=>array(82,-14,610,259),7448=>array(-15,0,534,519),7449=>array(5,0,710,519),7450=>array(85,0,710,519),7451=>array(49,0,562,519),7452=>array(57,-14,617,519),7453=>array(-1,-74,583,596),7454=>array(28,-74,817,596),7455=>array(-29,-240,614,761),7456=>array(19,0,591,519),7457=>array(27,0,838,519),7458=>array(-14,0,526,519),7459=>array(-5,-14,527,519),7460=>array(-1,-14,532,742),7461=>array(-15,-14,680,533),7462=>array(-15,0,540,519),7463=>array(-15,0,558,519),7464=>array(-15,0,674,519),7465=>array(-15,0,534,519),7466=>array(68,0,792,519),7467=>array(-26,-14,650,519),7468=>array(-44,334,413,735),7469=>array(-58,334,592,735),7470=>array(-14,334,444,735),7471=>array(-9,334,473,742),7472=>array(-14,334,468,735),7473=>array(-14,334,438,735),7474=>array(26,334,483,735),7475=>array(23,326,460,742),7476=>array(-14,334,551,735),7477=>array(-14,334,280,735),7478=>array(-90,220,299,735),7479=>array(-14,334,512,735),7480=>array(-14,334,366,735),7481=>array(-17,334,642,735),7482=>array(-16,334,536,735),7483=>array(42,326,559,734),7484=>array(23,326,470,742),7485=>array(4,326,351,750),7486=>array(-14,334,429,735),7487=>array(-14,334,441,735),7488=>array(26,334,457,735),7489=>array(53,326,523,735),7490=>array(28,334,684,735),7491=>array(19,318,327,625),7492=>array(40,318,348,625),7493=>array(23,318,423,624),7494=>array(24,318,513,625),7495=>array(39,326,391,752),7496=>array(21,326,399,752),7497=>array(33,326,352,627),7498=>array(40,326,350,627),7499=>array(23,324,330,627),7500=>array(28,324,334,627),7501=>array(27,212,438,627),7502=>array(48,203,220,621),7503=>array(38,334,386,752),7504=>array(50,334,583,627),7505=>array(62,212,399,627),7506=>array(34,326,374,627),7507=>array(22,326,334,627),7508=>array(66,477,399,627),7509=>array(66,326,399,477),7510=>array(39,220,414,627),7511=>array(52,326,281,708),7512=>array(61,326,405,620),7513=>array(3,285,364,660),7514=>array(61,326,593,620),7515=>array(60,334,387,620),7516=>array(-6,326,430,633),7517=>array(-13,217,354,765),7518=>array(44,217,375,625),7519=>array(12,326,352,763),7520=>array(37,217,497,625),7521=>array(-29,209,396,633),7522=>array(19,0,191,418),7523=>array(58,0,363,298),7524=>array(61,-8,405,286),7525=>array(60,0,387,286),7526=>array(-13,-117,354,431),7527=>array(44,-117,375,291),7528=>array(-1,-117,364,299),7529=>array(37,-117,497,291),7530=>array(-29,-125,396,299),7531=>array(57,-14,900,533),7543=>array(-11,-222,575,533),7544=>array(-14,334,551,735),7547=>array(-15,0,365,519),7548=>array(28,0,336,519),7549=>array(22,-208,657,533),7550=>array(18,-14,617,519),7551=>array(-19,-14,634,519),7557=>array(-35,-222,386,760),7579=>array(13,326,413,631),7580=>array(34,326,351,627),7581=>array(43,272,357,624),7582=>array(23,326,374,754),7583=>array(24,324,334,627),7584=>array(-34,229,325,752),7585=>array(-1,212,280,620),7586=>array(28,212,439,620),7587=>array(71,220,416,620),7588=>array(21,334,210,752),7589=>array(60,334,206,620),7590=>array(9,334,249,620),7591=>array(38,334,277,620),7592=>array(-4,211,273,752),7593=>array(43,212,241,752),7594=>array(15,212,281,752),7595=>array(9,334,328,621),7596=>array(62,212,583,627),7597=>array(71,220,604,620),7598=>array(-2,212,468,627),7599=>array(62,212,451,627),7600=>array(9,334,403,621),7601=>array(38,326,370,627),7602=>array(36,217,418,752),7603=>array(16,212,333,627),7604=>array(-14,211,351,752),7605=>array(60,212,317,708),7606=>array(42,326,419,620),7607=>array(36,332,379,628),7608=>array(33,326,386,625),7609=>array(60,333,389,620),7610=>array(12,334,334,620),7611=>array(-9,312,332,642),7612=>array(21,212,397,620),7613=>array(14,285,354,620),7614=>array(2,222,361,620),7615=>array(38,325,370,758),7620=>array(-381,616,5,800),7621=>array(-420,616,-87,800),7622=>array(-363,616,-30,800),7623=>array(-456,616,-69,800),7624=>array(-447,616,-3,800),7625=>array(-482,616,32,800),7680=>array(-71,-240,655,729),7681=>array(30,-240,519,533),7682=>array(-22,0,704,939),7683=>array(21,-14,581,939),7684=>array(-22,-213,704,729),7685=>array(21,-213,581,760),7686=>array(-22,-161,704,729),7687=>array(21,-161,581,760),7688=>array(38,-196,708,927),7689=>array(30,-196,540,800),7690=>array(-22,0,743,939),7691=>array(9,-14,609,939),7692=>array(-22,-213,743,729),7693=>array(9,-213,610,760),7694=>array(-22,-161,743,729),7695=>array(9,-161,609,760),7696=>array(-22,-196,743,729),7697=>array(9,-196,609,760),7698=>array(-22,-240,743,729),7699=>array(9,-240,610,760),7700=>array(-22,0,696,1057),7701=>array(30,-14,534,926),7702=>array(-22,0,696,1057),7703=>array(30,-14,578,926),7704=>array(-22,-240,696,729),7705=>array(30,-240,534,533),7706=>array(-22,-222,696,729),7707=>array(30,-222,534,533),7708=>array(-22,-196,696,927),7709=>array(30,-196,534,776),7710=>array(-22,0,691,939),7711=>array(-53,-190,516,939),7712=>array(38,-14,730,938),7713=>array(20,-222,600,756),7714=>array(-22,0,874,939),7715=>array(30,0,577,939),7716=>array(-22,-213,874,729),7717=>array(30,-213,578,760),7718=>array(-22,0,874,939),7719=>array(30,0,577,939),7720=>array(-22,-196,874,729),7721=>array(30,-196,577,760),7722=>array(-22,-221,874,729),7723=>array(30,-221,577,760),7724=>array(-52,-222,444,729),7725=>array(-98,-222,303,760),7726=>array(-22,0,481,1057),7727=>array(51,0,435,917),7728=>array(-22,0,812,927),7729=>array(30,0,583,927),7730=>array(-22,-213,812,729),7731=>array(30,-213,583,760),7732=>array(-22,-161,812,729),7733=>array(30,-161,583,760),7734=>array(-22,-213,582,729),7735=>array(20,-213,319,760),7736=>array(-22,-213,582,914),7737=>array(20,-213,411,914),7738=>array(-22,-161,582,729),7739=>array(-66,-161,319,760),7740=>array(-22,-240,582,729),7741=>array(-100,-240,319,760),7742=>array(-26,0,1018,927),7743=>array(50,0,895,800),7744=>array(-26,0,1018,937),7745=>array(50,0,896,788),7746=>array(-26,-213,1018,729),7747=>array(50,-213,896,533),7748=>array(-24,0,851,939),7749=>array(50,0,598,788),7750=>array(-24,-213,851,729),7751=>array(50,-213,598,533),7752=>array(-24,-161,851,729),7753=>array(50,-161,597,533),7754=>array(-24,-257,851,729),7755=>array(50,-243,598,533),7756=>array(38,-14,746,1057),7757=>array(30,-14,620,916),7758=>array(38,-14,746,1055),7759=>array(30,-14,586,912),7760=>array(38,-14,746,1057),7761=>array(30,-14,571,926),7762=>array(38,-14,746,1057),7763=>array(30,-14,593,926),7764=>array(-22,0,681,927),7765=>array(22,-208,618,800),7766=>array(-22,0,681,939),7767=>array(22,-208,618,788),7768=>array(-22,0,700,939),7769=>array(50,0,528,788),7770=>array(-22,-213,700,729),7771=>array(42,-213,529,533),7772=>array(-22,-213,700,914),7773=>array(42,-213,529,756),7774=>array(-22,-161,700,729),7775=>array(-46,-161,528,533),7776=>array(12,-14,613,939),7777=>array(-0,-14,488,788),7778=>array(12,-213,613,742),7779=>array(-0,-213,488,533),7780=>array(12,-14,628,959),7781=>array(-0,-14,533,777),7782=>array(12,-14,613,1065),7783=>array(-0,-14,505,883),7784=>array(12,-213,613,939),7785=>array(-0,-213,488,788),7786=>array(42,0,725,939),7787=>array(43,-14,407,939),7788=>array(42,-213,725,729),7789=>array(43,-213,407,680),7790=>array(42,-161,724,729),7791=>array(20,-161,407,680),7792=>array(42,-240,725,729),7793=>array(-18,-240,407,680),7794=>array(85,-213,831,729),7795=>array(56,-213,604,519),7796=>array(85,-222,831,729),7797=>array(56,-222,604,519),7798=>array(85,-240,831,729),7799=>array(56,-240,604,519),7800=>array(85,-14,831,1057),7801=>array(57,-14,632,915),7802=>array(85,-14,831,1055),7803=>array(57,-14,604,930),7804=>array(47,0,774,929),7805=>array(18,0,529,792),7806=>array(48,-213,775,729),7807=>array(19,-213,530,521),7808=>array(45,0,1085,931),7809=>array(27,0,801,800),7810=>array(45,0,1085,931),7811=>array(27,0,801,800),7812=>array(45,0,1085,945),7813=>array(27,0,801,736),7814=>array(45,0,1085,974),7815=>array(26,0,801,788),7816=>array(45,-211,1085,729),7817=>array(27,-213,801,519),7818=>array(-48,0,727,939),7819=>array(-17,0,545,788),7820=>array(-48,0,727,939),7821=>array(-17,0,545,788),7822=>array(45,0,715,942),7823=>array(-18,-222,574,788),7824=>array(-31,0,684,982),7825=>array(-14,-41,526,800),7826=>array(-31,-213,684,729),7827=>array(-14,-213,526,560),7828=>array(-31,-161,684,729),7829=>array(-14,-161,526,560),7830=>array(30,-161,577,760),7831=>array(43,-14,430,939),7832=>array(26,0,801,888),7833=>array(-18,-222,574,888),7834=>array(30,-14,870,760),7835=>array(-53,-190,516,939),7836=>array(-53,-190,516,760),7837=>array(-53,-190,516,760),7838=>array(-35,-14,807,743),7839=>array(17,-14,566,765),7840=>array(-71,-213,655,729),7841=>array(30,-213,519,533),7842=>array(-71,0,655,1048),7843=>array(30,-14,519,866),7844=>array(-71,0,748,1054),7845=>array(31,-14,658,872),7846=>array(-71,0,688,1054),7847=>array(31,-14,599,872),7848=>array(-71,0,761,1116),7849=>array(31,-14,671,934),7850=>array(-71,0,655,1069),7851=>array(31,-14,532,887),7852=>array(-71,-213,655,982),7853=>array(30,-213,519,800),7854=>array(-71,0,655,1057),7855=>array(31,-14,539,901),7856=>array(-71,0,655,1057),7857=>array(31,-14,519,901),7858=>array(-71,0,655,1145),7859=>array(31,-14,519,989),7860=>array(-71,0,655,1069),7861=>array(31,-14,550,913),7862=>array(-71,-213,655,958),7863=>array(30,-213,519,776),7864=>array(-22,-213,696,729),7865=>array(30,-213,534,533),7866=>array(-22,0,696,1048),7867=>array(30,-14,534,866),7868=>array(-22,0,696,929),7869=>array(30,-14,534,792),7870=>array(-22,0,766,1054),7871=>array(30,-14,681,872),7872=>array(-22,0,708,1054),7873=>array(30,-14,622,872),7874=>array(-22,0,779,1116),7875=>array(30,-14,694,934),7876=>array(-22,0,696,1069),7877=>array(30,-14,554,887),7878=>array(-22,-213,696,982),7879=>array(30,-213,534,800),7880=>array(-22,0,444,1048),7881=>array(30,0,418,1106),7882=>array(-22,-213,444,729),7883=>array(28,-213,303,760),7884=>array(38,-213,746,742),7885=>array(30,-213,571,533),7886=>array(38,-14,746,1048),7887=>array(30,-14,570,866),7888=>array(38,-14,800,1054),7889=>array(30,-14,695,872),7890=>array(38,-14,746,1054),7891=>array(30,-14,636,872),7892=>array(38,-14,813,1116),7893=>array(30,-14,708,934),7894=>array(38,-14,746,1069),7895=>array(30,-14,571,887),7896=>array(38,-213,746,982),7897=>array(30,-213,570,800),7898=>array(37,-14,844,927),7899=>array(31,-14,680,800),7900=>array(37,-14,844,927),7901=>array(31,-14,680,800),7902=>array(37,-14,844,1048),7903=>array(31,-14,680,866),7904=>array(37,-14,844,929),7905=>array(31,-14,680,792),7906=>array(37,-213,844,760),7907=>array(31,-213,680,548),7908=>array(85,-213,831,729),7909=>array(57,-213,604,519),7910=>array(85,-14,831,1048),7911=>array(56,-14,604,866),7912=>array(88,-14,1015,927),7913=>array(59,-14,734,800),7914=>array(88,-14,1015,927),7915=>array(59,-14,734,800),7916=>array(88,-14,1015,1048),7917=>array(59,-14,734,866),7918=>array(88,-14,1015,929),7919=>array(59,-14,734,792),7920=>array(88,-213,1015,816),7921=>array(59,-213,734,548),7922=>array(45,0,715,931),7923=>array(-18,-222,574,776),7924=>array(45,-213,714,729),7925=>array(-18,-222,574,519),7926=>array(45,0,714,1051),7927=>array(-18,-222,574,866),7928=>array(45,0,714,929),7929=>array(-18,-222,574,792),7930=>array(-22,0,918,729),7931=>array(31,0,653,760),7936=>array(37,-14,672,837),7937=>array(37,-14,672,837),7938=>array(37,-14,672,837),7939=>array(37,-14,672,837),7940=>array(37,-14,672,837),7941=>array(37,-14,672,837),7942=>array(37,-14,672,1009),7943=>array(37,-14,672,1009),7944=>array(-71,0,655,837),7945=>array(-71,0,655,837),7946=>array(55,0,837,837),7947=>array(63,0,837,837),7948=>array(-21,0,705,837),7949=>array(-5,0,721,837),7950=>array(-71,0,655,1009),7951=>array(-71,0,655,1009),7952=>array(22,-12,529,837),7953=>array(22,-12,529,837),7954=>array(22,-12,529,837),7955=>array(22,-12,529,837),7956=>array(22,-12,567,837),7957=>array(22,-12,570,837),7960=>array(62,0,835,837),7961=>array(63,0,828,837),7962=>array(55,0,1063,837),7963=>array(63,0,1063,837),7964=>array(51,0,994,837),7965=>array(57,0,1018,837),7968=>array(68,-208,596,837),7969=>array(68,-208,596,837),7970=>array(68,-208,596,837),7971=>array(68,-208,596,837),7972=>array(68,-208,610,837),7973=>array(68,-208,606,837),7974=>array(68,-208,613,1009),7975=>array(68,-208,604,1009),7976=>array(62,0,1014,837),7977=>array(63,0,1008,837),7978=>array(55,0,1246,837),7979=>array(63,0,1249,837),7980=>array(51,0,1174,837),7981=>array(57,0,1201,837),7982=>array(95,0,1101,1009),7983=>array(92,0,1098,1009),7984=>array(66,16,371,837),7985=>array(66,16,371,837),7986=>array(40,16,417,837),7987=>array(50,16,425,837),7988=>array(62,16,448,837),7989=>array(53,16,448,837),7990=>array(66,16,459,1009),7991=>array(66,16,453,1009),7992=>array(62,0,589,837),7993=>array(63,0,578,837),7994=>array(55,0,813,837),7995=>array(63,0,815,837),7996=>array(51,0,742,837),7997=>array(57,0,771,837),7998=>array(95,0,673,1009),7999=>array(92,0,665,1009),8000=>array(30,-14,571,837),8001=>array(30,-14,571,837),8002=>array(30,-14,571,837),8003=>array(30,-14,571,837),8004=>array(30,-14,601,837),8005=>array(30,-14,591,837),8008=>array(62,-14,772,837),8009=>array(63,-14,803,837),8010=>array(55,-14,1077,837),8011=>array(63,-14,1075,837),8012=>array(51,-14,893,837),8013=>array(57,-14,921,837),8016=>array(66,-1,592,837),8017=>array(66,-1,592,837),8018=>array(66,-1,592,837),8019=>array(66,-1,592,837),8020=>array(66,-1,603,837),8021=>array(66,-1,600,837),8022=>array(66,-1,592,1009),8023=>array(66,-1,592,1009),8025=>array(63,0,902,837),8027=>array(63,0,1139,837),8029=>array(57,0,1092,837),8031=>array(92,0,989,1009),8032=>array(38,-1,822,837),8033=>array(38,-1,822,837),8034=>array(38,-1,822,837),8035=>array(38,-1,822,837),8036=>array(38,-1,822,837),8037=>array(38,-1,822,837),8038=>array(38,-1,822,1009),8039=>array(38,-1,822,1009),8040=>array(17,0,803,837),8041=>array(45,0,832,837),8042=>array(55,0,1106,837),8043=>array(63,0,1111,837),8044=>array(51,0,914,837),8045=>array(57,0,944,837),8046=>array(95,0,885,1009),8047=>array(92,0,919,1009),8048=>array(37,-14,672,800),8049=>array(37,-14,672,800),8050=>array(22,-12,529,800),8051=>array(22,-12,545,800),8052=>array(68,-208,596,800),8053=>array(68,-208,596,800),8054=>array(66,16,371,800),8055=>array(66,16,430,800),8056=>array(30,-14,571,800),8057=>array(30,-14,571,800),8058=>array(66,-1,592,800),8059=>array(66,-1,592,800),8060=>array(38,-1,822,800),8061=>array(38,-1,822,800),8064=>array(37,-208,672,837),8065=>array(37,-208,672,837),8066=>array(37,-208,672,837),8067=>array(37,-208,672,837),8068=>array(37,-208,672,837),8069=>array(37,-208,672,837),8070=>array(37,-208,672,1009),8071=>array(37,-208,672,1009),8072=>array(-71,-208,655,837),8073=>array(-71,-208,655,837),8074=>array(55,-208,837,837),8075=>array(63,-208,837,837),8076=>array(-21,-208,705,837),8077=>array(-5,-208,721,837),8078=>array(-71,-208,655,1009),8079=>array(-71,-208,655,1009),8080=>array(68,-208,596,837),8081=>array(68,-208,596,837),8082=>array(68,-208,596,837),8083=>array(68,-208,596,837),8084=>array(68,-208,610,837),8085=>array(68,-208,606,837),8086=>array(68,-208,613,1009),8087=>array(68,-208,604,1009),8088=>array(62,-208,1014,837),8089=>array(63,-208,1008,837),8090=>array(55,-208,1246,837),8091=>array(63,-208,1249,837),8092=>array(51,-208,1174,837),8093=>array(57,-208,1201,837),8094=>array(95,-208,1101,1009),8095=>array(92,-208,1098,1009),8096=>array(38,-208,822,837),8097=>array(38,-208,822,837),8098=>array(38,-208,822,837),8099=>array(38,-208,822,837),8100=>array(38,-208,822,837),8101=>array(38,-208,822,837),8102=>array(38,-208,822,1009),8103=>array(38,-208,822,1009),8104=>array(17,-208,803,837),8105=>array(45,-208,832,837),8106=>array(55,-208,1106,837),8107=>array(63,-208,1111,837),8108=>array(51,-208,914,837),8109=>array(57,-208,944,837),8110=>array(95,-208,885,1009),8111=>array(92,-208,919,1009),8112=>array(37,-14,672,776),8113=>array(37,-14,672,756),8114=>array(37,-208,672,800),8115=>array(37,-208,672,532),8116=>array(37,-208,672,800),8118=>array(37,-14,672,792),8119=>array(37,-208,672,792),8120=>array(-71,0,655,936),8121=>array(-71,0,655,914),8122=>array(-40,0,687,800),8123=>array(-71,0,655,800),8124=>array(-71,-208,655,729),8125=>array(210,596,350,837),8126=>array(184,-208,309,-60),8127=>array(210,596,350,837),8128=>array(120,638,461,792),8129=>array(147,645,520,959),8130=>array(68,-208,596,800),8131=>array(68,-208,596,533),8132=>array(68,-208,596,800),8134=>array(68,-208,596,792),8135=>array(68,-208,596,792),8136=>array(55,0,910,800),8137=>array(38,0,859,800),8138=>array(55,0,1095,800),8139=>array(38,0,1040,800),8140=>array(-22,-208,874,729),8141=>array(92,596,468,837),8142=>array(101,596,487,837),8143=>array(160,596,501,1009),8144=>array(66,16,407,776),8145=>array(66,16,391,756),8146=>array(66,16,423,997),8147=>array(66,16,491,996),8150=>array(66,16,411,792),8151=>array(66,16,470,959),8152=>array(-22,0,444,927),8153=>array(-22,0,444,914),8154=>array(55,0,665,800),8155=>array(38,0,610,800),8157=>array(101,596,476,837),8158=>array(91,596,487,837),8159=>array(157,596,499,1009),8160=>array(66,-1,592,776),8161=>array(66,-1,592,756),8162=>array(66,-1,592,997),8163=>array(66,-1,631,996),8164=>array(-8,-208,580,837),8165=>array(-8,-208,580,837),8166=>array(66,-1,592,792),8167=>array(66,-1,604,959),8168=>array(45,0,715,927),8169=>array(45,0,715,914),8170=>array(55,0,989,800),8171=>array(38,0,928,800),8172=>array(63,0,824,837),8173=>array(147,645,474,997),8174=>array(147,645,545,996),8175=>array(115,616,319,800),8178=>array(38,-208,822,800),8179=>array(38,-208,822,519),8180=>array(38,-208,822,800),8182=>array(38,-1,822,746),8183=>array(38,-208,822,746),8184=>array(55,-14,923,800),8185=>array(38,-14,760,800),8186=>array(55,0,956,800),8187=>array(1,0,787,800),8188=>array(-21,-208,766,742),8189=>array(204,616,473,800),8190=>array(212,596,352,837),8208=>array(37,202,336,334),8209=>array(37,202,336,334),8210=>array(38,207,588,324),8211=>array(38,207,412,324),8212=>array(38,207,862,324),8213=>array(-10,207,911,324),8214=>array(116,-236,356,764),8215=>array(0,-236,450,-9),8216=>array(37,456,275,742),8217=>array(29,443,268,729),8218=>array(13,-130,251,156),8219=>array(75,443,239,729),8220=>array(37,456,479,742),8221=>array(29,443,472,729),8222=>array(13,-130,456,156),8223=>array(75,443,444,729),8224=>array(44,-96,483,729),8225=>array(-13,-96,483,729),8226=>array(129,196,446,547),8227=>array(129,157,481,586),8228=>array(73,-14,241,172),8229=>array(73,-14,534,172),8230=>array(73,-14,827,172),8240=>array(53,-14,1194,742),8241=>array(53,-14,1579,742),8242=>array(1,547,232,729),8243=>array(1,547,396,729),8244=>array(1,547,562,729),8245=>array(145,547,312,729),8246=>array(145,547,479,729),8247=>array(145,547,642,729),8248=>array(91,-238,569,29),8249=>array(62,64,316,522),8250=>array(44,64,298,522),8252=>array(9,-14,570,729),8253=>array(92,-14,517,742),8254=>array(0,663,450,755),8258=>array(20,-37,901,832),8260=>array(-234,-14,384,742),8261=>array(35,-132,439,760),8262=>array(-14,-132,391,760),8263=>array(63,-14,975,742),8264=>array(92,-14,776,742),8265=>array(9,-14,742,742),8267=>array(42,-96,554,729),8268=>array(67,189,382,541),8269=>array(67,189,382,541),8270=>array(20,0,451,464),8271=>array(34,-161,231,490),8273=>array(47,-14,396,797),8274=>array(2,-93,476,729),8275=>array(44,221,856,406),8279=>array(1,547,726,729),8304=>array(21,326,364,742),8305=>array(19,334,191,752),8308=>array(4,334,354,742),8309=>array(10,326,362,742),8310=>array(19,326,368,742),8311=>array(31,334,362,742),8312=>array(10,326,373,742),8313=>array(13,326,363,742),8314=>array(60,334,415,679),8315=>array(60,475,415,537),8316=>array(60,415,415,598),8317=>array(53,249,290,752),8318=>array(-22,249,215,752),8319=>array(31,334,376,627),8320=>array(21,0,364,416),8321=>array(35,8,305,416),8322=>array(2,8,357,416),8323=>array(6,0,361,416),8324=>array(4,8,354,416),8325=>array(10,0,362,416),8326=>array(19,0,368,416),8327=>array(31,8,362,416),8328=>array(10,0,373,416),8329=>array(13,0,363,416),8330=>array(60,8,415,353),8331=>array(60,149,415,211),8332=>array(60,89,415,272),8333=>array(53,-78,290,426),8334=>array(-22,-78,215,426),8336=>array(19,-8,327,299),8337=>array(33,0,352,301),8338=>array(34,0,374,301),8339=>array(-11,8,343,293),8340=>array(40,0,350,301),8341=>array(47,0,402,425),8342=>array(38,8,386,426),8343=>array(45,0,221,425),8344=>array(50,8,583,301),8345=>array(31,8,376,301),8346=>array(39,-106,414,301),8347=>array(18,1,328,307),8348=>array(52,0,281,382),8358=>array(-16,0,642,729),8364=>array(-22,-14,626,742),8367=>array(-17,-193,1051,723),8369=>array(-22,0,726,729),8372=>array(3,-14,788,742),8373=>array(74,-146,620,761),8376=>array(37,0,725,729),8377=>array(48,0,654,729),8451=>array(78,-14,1070,749),8457=>array(78,0,1053,749),8462=>array(30,0,578,760),8463=>array(31,0,578,760),8470=>array(-31,-14,938,731),8482=>array(104,447,756,729),8486=>array(-21,0,766,742),8487=>array(35,-13,822,729),8490=>array(-22,0,812,729),8491=>array(-88,0,638,928),8498=>array(-52,0,661,729),8513=>array(4,-14,672,742),8514=>array(8,0,499,729),8515=>array(10,0,604,729),8516=>array(2,0,674,729),8523=>array(42,-14,838,742),8526=>array(-35,0,553,519),8528=>array(25,-14,906,742),8529=>array(25,-14,907,742),8530=>array(25,-14,1303,742),8531=>array(25,-14,905,742),8532=>array(2,-14,905,742),8533=>array(25,-14,906,742),8534=>array(2,-14,906,742),8535=>array(6,-14,906,742),8536=>array(4,-14,906,742),8537=>array(25,-14,913,742),8538=>array(10,-14,913,742),8539=>array(25,-14,917,742),8540=>array(6,-14,917,742),8541=>array(10,-14,917,742),8542=>array(31,-14,917,742),8543=>array(25,-14,788,742),8544=>array(-22,0,444,729),8545=>array(-22,0,686,729),8546=>array(-22,0,927,729),8547=>array(-22,0,1061,729),8548=>array(48,0,775,729),8549=>array(48,0,1037,729),8550=>array(48,0,1279,729),8551=>array(48,0,1521,729),8552=>array(-22,0,991,729),8553=>array(-48,0,727,729),8554=>array(-48,0,993,729),8555=>array(-48,0,1235,729),8556=>array(-22,0,582,729),8557=>array(38,-14,708,742),8558=>array(-22,0,743,729),8559=>array(-26,0,1018,729),8560=>array(30,0,303,760),8561=>array(30,0,645,760),8562=>array(30,0,987,760),8563=>array(30,0,872,760),8564=>array(19,0,530,521),8565=>array(19,0,826,760),8566=>array(19,0,1168,760),8567=>array(19,0,1510,760),8568=>array(30,0,887,760),8569=>array(-17,0,545,519),8570=>array(-17,0,840,760),8571=>array(-17,0,1182,760),8572=>array(30,0,319,760),8573=>array(30,-14,533,533),8574=>array(9,-14,610,760),8575=>array(50,0,896,533),8576=>array(33,0,1115,729),8577=>array(-22,0,751,729),8578=>array(33,0,1115,729),8579=>array(10,-14,679,742),8580=>array(20,-14,514,533),8581=>array(54,-208,725,742),8585=>array(21,-14,905,742),8592=>array(33,119,703,527),8593=>array(193,0,561,744),8594=>array(51,119,721,527),8595=>array(193,-20,561,724),8596=>array(33,119,721,527),8597=>array(193,-20,561,744),8598=>array(132,29,642,595),8599=>array(112,29,622,595),8600=>array(112,52,622,617),8601=>array(132,52,642,617),8602=>array(33,88,703,558),8603=>array(51,88,721,558),8604=>array(48,191,716,499),8605=>array(38,191,706,499),8606=>array(33,119,703,527),8607=>array(193,0,561,744),8608=>array(51,119,721,527),8609=>array(193,-20,561,724),8610=>array(33,118,710,529),8611=>array(44,118,721,529),8612=>array(33,119,703,527),8613=>array(193,0,561,744),8614=>array(51,119,721,527),8615=>array(193,-20,561,724),8616=>array(193,0,561,744),8617=>array(33,119,703,571),8618=>array(51,119,721,571),8619=>array(33,119,703,571),8620=>array(51,119,721,571),8621=>array(33,119,721,527),8622=>array(33,88,721,558),8623=>array(154,-17,629,730),8624=>array(187,0,549,744),8625=>array(205,0,567,744),8626=>array(187,-20,549,724),8627=>array(205,-20,567,724),8628=>array(117,90,655,614),8629=>array(132,53,604,650),8630=>array(68,141,672,569),8631=>array(82,141,686,569),8632=>array(119,29,642,736),8633=>array(51,-52,703,698),8634=>array(103,48,660,600),8635=>array(94,48,651,600),8636=>array(31,270,703,527),8637=>array(31,119,703,377),8638=>array(329,0,561,747),8639=>array(193,0,426,747),8640=>array(51,270,724,527),8641=>array(51,119,724,377),8642=>array(329,-23,561,724),8643=>array(193,-23,426,724),8644=>array(33,-52,721,698),8645=>array(40,-20,715,744),8646=>array(33,-52,721,698),8647=>array(33,-101,703,747),8648=>array(-4,0,759,744),8649=>array(51,-101,721,747),8650=>array(-4,-20,759,724),8651=>array(31,21,724,625),8652=>array(31,21,724,625),8653=>array(33,88,703,558),8654=>array(33,88,721,558),8655=>array(51,88,721,558),8656=>array(33,119,703,527),8657=>array(193,0,561,744),8658=>array(51,119,721,527),8659=>array(193,-20,561,724),8660=>array(33,119,721,527),8661=>array(193,-20,561,744),8662=>array(132,-31,696,595),8663=>array(58,-31,622,595),8664=>array(58,52,622,677),8665=>array(132,52,696,677),8666=>array(33,70,703,576),8667=>array(51,70,721,576),8668=>array(33,119,703,527),8669=>array(51,119,721,527),8670=>array(193,0,561,744),8671=>array(193,-20,561,724),8672=>array(33,119,703,527),8673=>array(193,0,561,744),8674=>array(51,119,721,527),8675=>array(193,-20,561,724),8676=>array(51,119,703,527),8677=>array(51,119,703,527),8678=>array(33,119,703,527),8679=>array(193,0,561,744),8680=>array(51,119,721,527),8681=>array(193,-20,561,724),8682=>array(193,0,561,744),8683=>array(172,0,582,744),8684=>array(172,0,582,744),8685=>array(172,0,582,744),8686=>array(193,0,561,744),8687=>array(172,0,582,744),8688=>array(51,96,721,550),8689=>array(69,0,690,694),8690=>array(64,0,686,694),8691=>array(193,-20,561,744),8692=>array(51,119,721,527),8693=>array(40,-20,715,744),8694=>array(51,-140,721,786),8695=>array(33,119,703,527),8696=>array(51,119,721,527),8697=>array(33,119,721,527),8698=>array(33,119,703,527),8699=>array(51,119,721,527),8700=>array(33,119,721,527),8701=>array(33,119,703,527),8702=>array(51,119,721,527),8703=>array(33,119,721,527),8704=>array(4,0,573,729),8706=>array(33,-12,449,659),8707=>array(63,0,479,729),8708=>array(63,-120,479,849),8710=>array(18,0,661,729),8711=>array(18,0,661,729),8712=>array(95,0,571,627),8713=>array(95,-138,571,765),8715=>array(95,0,571,627),8716=>array(95,-138,571,765),8719=>array(21,-192,734,719),8720=>array(21,-192,734,719),8721=>array(9,-192,661,719),8722=>array(95,257,659,369),8723=>array(95,0,659,627),8724=>array(95,0,659,681),8725=>array(-72,-93,401,729),8727=>array(95,82,527,546),8728=>array(95,161,372,468),8729=>array(95,161,372,468),8730=>array(31,-20,593,827),8731=>array(31,-20,593,940),8732=>array(29,-20,593,928),8733=>array(90,97,515,499),8734=>array(90,97,661,499),8735=>array(106,79,648,681),8736=>array(106,79,648,681),8739=>array(95,-98,197,827),8740=>array(78,-98,469,827),8741=>array(95,-98,381,827),8742=>array(78,-98,619,827),8743=>array(136,0,595,584),8744=>array(136,0,595,584),8745=>array(95,0,659,627),8746=>array(95,-12,659,615),8747=>array(21,-182,500,759),8748=>array(21,-182,852,759),8749=>array(21,-182,1203,759),8760=>array(95,258,659,567),8761=>array(95,60,659,567),8762=>array(95,60,659,567),8763=>array(95,60,659,567),8764=>array(95,222,659,406),8765=>array(95,222,659,406),8770=>array(95,119,659,480),8771=>array(95,147,659,508),8776=>array(95,119,659,508),8784=>array(95,147,659,717),8785=>array(95,-90,659,717),8786=>array(95,-90,659,717),8787=>array(95,-90,659,717),8788=>array(95,110,879,518),8789=>array(95,110,879,518),8800=>array(95,-5,659,631),8801=>array(95,91,659,536),8804=>array(95,0,659,580),8805=>array(95,0,659,580),8834=>array(95,0,659,627),8835=>array(95,0,659,627),8836=>array(95,-138,659,765),8837=>array(95,-138,659,765),8838=>array(95,-85,659,712),8839=>array(95,-85,659,712),8844=>array(95,-12,659,615),8845=>array(95,-12,659,615),8846=>array(95,-12,659,615),8847=>array(95,1,659,627),8848=>array(95,1,659,627),8849=>array(95,-85,659,712),8850=>array(95,-85,659,712),8851=>array(95,0,659,627),8852=>array(95,0,659,627),8853=>array(95,0,659,627),8854=>array(95,0,659,627),8855=>array(95,0,659,627),8856=>array(95,0,659,627),8857=>array(95,0,659,627),8858=>array(95,0,659,627),8859=>array(95,0,659,627),8860=>array(95,0,659,627),8861=>array(95,0,659,627),8862=>array(95,1,659,627),8863=>array(95,1,659,627),8864=>array(95,1,659,627),8865=>array(95,1,659,627),8866=>array(95,0,701,729),8867=>array(95,0,701,729),8868=>array(95,0,769,688),8869=>array(95,0,769,688),8870=>array(95,0,459,729),8871=>array(95,0,459,729),8872=>array(95,0,701,729),8873=>array(95,0,701,729),8874=>array(95,0,701,729),8875=>array(95,0,876,729),8876=>array(95,-123,701,852),8877=>array(95,-123,701,852),8878=>array(95,-123,701,852),8879=>array(95,-123,876,852),8901=>array(95,255,263,440),8962=>array(64,0,687,596),8968=>array(34,-132,440,760),8969=>array(79,-132,391,760),8970=>array(34,-132,346,760),8971=>array(-15,-132,391,760),8976=>array(95,140,659,441),8977=>array(2,113,482,646),8984=>array(76,0,759,759),8985=>array(95,140,659,441),8992=>array(203,-250,500,925),8993=>array(20,-239,316,940),8997=>array(76,0,824,723),9000=>array(53,0,1247,729),9085=>array(1,-228,906,85),9115=>array(56,-252,394,928),9116=>array(56,-252,185,940),9117=>array(56,-240,394,940),9118=>array(56,-252,394,928),9119=>array(266,-252,394,940),9120=>array(56,-240,394,940),9121=>array(56,-252,394,928),9122=>array(56,-252,185,940),9123=>array(56,-240,394,940),9124=>array(56,-252,394,928),9125=>array(266,-252,394,940),9126=>array(56,-240,394,940),9127=>array(275,-261,602,928),9128=>array(74,-247,400,934),9129=>array(275,-240,602,934),9130=>array(275,-256,400,934),9131=>array(74,-261,400,928),9132=>array(275,-247,602,934),9133=>array(74,-240,400,934),9134=>array(203,-250,316,940),9167=>array(82,0,769,596),9251=>array(24,-228,702,85),9600=>array(-9,260,701,770),9601=>array(-9,-250,701,-123),9602=>array(-9,-250,701,-5),9603=>array(-9,-250,701,132),9604=>array(-9,-250,701,260),9605=>array(-9,-250,701,387),9606=>array(-9,-250,701,515),9607=>array(-9,-250,701,642),9608=>array(-9,-250,701,770),9609=>array(-9,-250,612,770),9610=>array(-9,-250,523,770),9611=>array(-9,-250,435,770),9612=>array(-9,-250,346,770),9613=>array(-9,-250,257,770),9614=>array(-9,-250,168,770),9615=>array(-9,-250,80,770),9616=>array(346,-250,701,770),9617=>array(-9,-250,612,770),9618=>array(-9,-250,701,770),9619=>array(-9,-250,701,770),9620=>array(-9,642,701,770),9621=>array(612,-250,701,770),9622=>array(-9,-250,347,260),9623=>array(346,-250,701,260),9624=>array(-9,260,347,770),9625=>array(-9,-250,701,770),9626=>array(-9,-250,701,770),9627=>array(-9,-250,701,770),9628=>array(-9,-250,701,770),9629=>array(346,260,701,770),9630=>array(-9,-250,701,770),9631=>array(-9,-250,701,770),9632=>array(82,-124,769,643),9633=>array(82,-124,769,643),9634=>array(82,-124,769,643),9635=>array(82,-124,769,643),9636=>array(82,-124,769,643),9637=>array(82,-124,769,643),9638=>array(82,-124,769,643),9639=>array(82,-124,769,643),9640=>array(82,-124,769,643),9641=>array(82,-124,769,643),9642=>array(82,11,528,509),9643=>array(82,11,528,509),9644=>array(82,75,769,444),9645=>array(82,75,769,444),9646=>array(82,-122,414,642),9647=>array(82,-122,414,642),9648=>array(2,75,690,444),9649=>array(2,75,690,444),9650=>array(2,-124,690,643),9651=>array(2,-124,690,643),9652=>array(2,11,449,509),9653=>array(2,11,449,509),9654=>array(2,-124,690,643),9655=>array(2,-124,690,643),9656=>array(2,11,449,509),9657=>array(2,11,449,509),9658=>array(2,11,690,509),9659=>array(2,11,690,509),9660=>array(2,-124,690,643),9661=>array(2,-124,690,643),9662=>array(2,11,449,509),9663=>array(2,11,449,509),9664=>array(2,-124,690,643),9665=>array(2,-124,690,643),9666=>array(2,11,449,509),9667=>array(2,11,449,509),9668=>array(2,11,690,509),9669=>array(2,11,690,509),9670=>array(2,-124,690,643),9671=>array(2,-124,690,643),9672=>array(2,-124,690,643),9673=>array(49,-125,736,645),9674=>array(2,-233,442,807),9675=>array(49,-125,736,645),9676=>array(50,-125,735,644),9677=>array(49,-125,736,645),9678=>array(49,-125,736,645),9679=>array(49,-123,736,641),9680=>array(49,-123,736,641),9681=>array(49,-123,736,641),9682=>array(49,-123,736,641),9683=>array(49,-123,736,641),9684=>array(49,-123,736,641),9685=>array(49,-123,736,641),9686=>array(49,-125,393,645),9687=>array(82,-125,425,645),9688=>array(82,-10,630,770),9689=>array(82,-250,792,770),9690=>array(82,260,792,770),9691=>array(82,-250,792,260),9692=>array(2,260,346,645),9693=>array(2,260,346,645),9694=>array(2,-125,346,260),9695=>array(2,-125,346,260),9696=>array(49,260,736,645),9697=>array(49,-125,736,260),9698=>array(2,-124,690,643),9699=>array(2,-124,690,643),9700=>array(2,-124,690,643),9701=>array(2,-124,690,643),9702=>array(135,227,396,516),9703=>array(82,-124,769,643),9704=>array(82,-124,769,643),9705=>array(82,-124,769,643),9706=>array(82,-124,769,643),9707=>array(82,-124,769,643),9708=>array(2,-124,690,643),9709=>array(2,-124,690,643),9710=>array(2,-124,690,643),9711=>array(49,-250,958,770),9712=>array(82,-124,769,643),9713=>array(82,-124,769,643),9714=>array(82,-124,769,643),9715=>array(82,-124,769,643),9716=>array(49,-123,736,641),9717=>array(49,-123,736,641),9718=>array(49,-123,736,641),9719=>array(49,-123,736,641),9720=>array(2,-124,690,643),9721=>array(2,-124,690,643),9722=>array(2,-124,690,643),9723=>array(82,-66,666,585),9724=>array(82,-66,666,585),9725=>array(82,-17,578,537),9726=>array(82,-17,578,537),9727=>array(2,-124,690,643),9728=>array(75,0,731,729),9784=>array(71,3,735,721),9785=>array(75,0,732,730),9786=>array(75,0,732,730),9787=>array(75,0,732,730),9788=>array(75,0,732,730),9791=>array(77,-102,476,732),9792=>array(77,-125,581,731),9793=>array(77,-125,581,731),9794=>array(77,-5,748,729),9795=>array(149,0,657,730),9796=>array(197,0,609,730),9797=>array(109,0,697,730),9798=>array(114,0,692,730),9799=>array(216,0,590,730),9824=>array(142,0,665,729),9825=>array(81,0,726,727),9826=>array(151,0,655,729),9827=>array(100,0,707,729),9828=>array(141,0,666,729),9829=>array(80,0,728,729),9830=>array(151,0,655,729),9831=>array(100,0,707,732),9833=>array(75,-5,306,729),9834=>array(75,-5,499,729),9835=>array(165,-102,642,729),9836=>array(83,-5,724,729),9837=>array(79,-3,353,731),9838=>array(75,0,246,731),9839=>array(76,0,360,731),10145=>array(51,119,721,527),10181=>array(4,-163,394,769),10182=>array(-33,-163,429,769),10208=>array(2,-233,442,807),10216=>array(94,-132,417,759),10217=>array(-6,-132,317,759),10224=>array(62,0,693,744),10225=>array(62,-20,693,724),10226=>array(68,48,672,618),10227=>array(82,48,686,618),10228=>array(51,39,896,608),10229=>array(33,119,1239,527),10230=>array(51,119,1257,527),10231=>array(33,119,1257,527),10232=>array(33,119,1239,527),10233=>array(51,119,1257,527),10234=>array(33,119,1257,527),10235=>array(33,119,1239,527),10236=>array(51,119,1257,527),10237=>array(33,119,1239,527),10238=>array(51,119,1257,527),10239=>array(51,119,1257,527),10241=>array(132,586,308,781),10242=>array(132,325,308,521),10243=>array(132,325,308,781),10244=>array(132,65,308,260),10245=>array(132,65,308,781),10246=>array(132,65,308,521),10247=>array(132,65,308,781),10248=>array(396,586,571,781),10249=>array(132,586,571,781),10250=>array(132,325,571,781),10251=>array(132,325,571,781),10252=>array(132,65,571,781),10253=>array(132,65,571,781),10254=>array(132,65,571,781),10255=>array(132,65,571,781),10256=>array(396,325,571,521),10257=>array(132,325,571,781),10258=>array(132,325,571,521),10259=>array(132,325,571,781),10260=>array(132,65,571,521),10261=>array(132,65,571,781),10262=>array(132,65,571,521),10263=>array(132,65,571,781),10264=>array(396,325,571,781),10265=>array(132,325,571,781),10266=>array(132,325,571,781),10267=>array(132,325,571,781),10268=>array(132,65,571,781),10269=>array(132,65,571,781),10270=>array(132,65,571,781),10271=>array(132,65,571,781),10272=>array(396,65,571,260),10273=>array(132,65,571,781),10274=>array(132,65,571,521),10275=>array(132,65,571,781),10276=>array(132,65,571,260),10277=>array(132,65,571,781),10278=>array(132,65,571,521),10279=>array(132,65,571,781),10280=>array(396,65,571,781),10281=>array(132,65,571,781),10282=>array(132,65,571,781),10283=>array(132,65,571,781),10284=>array(132,65,571,781),10285=>array(132,65,571,781),10286=>array(132,65,571,781),10287=>array(132,65,571,781),10288=>array(396,65,571,521),10289=>array(132,65,571,781),10290=>array(132,65,571,521),10291=>array(132,65,571,781),10292=>array(132,65,571,521),10293=>array(132,65,571,781),10294=>array(132,65,571,521),10295=>array(132,65,571,781),10296=>array(396,65,571,781),10297=>array(132,65,571,781),10298=>array(132,65,571,781),10299=>array(132,65,571,781),10300=>array(132,65,571,781),10301=>array(132,65,571,781),10302=>array(132,65,571,781),10303=>array(132,65,571,781),10304=>array(132,-195,308,0),10305=>array(132,-195,308,781),10306=>array(132,-195,308,521),10307=>array(132,-195,308,781),10308=>array(132,-195,308,260),10309=>array(132,-195,308,781),10310=>array(132,-195,308,521),10311=>array(132,-195,308,781),10312=>array(132,-195,571,781),10313=>array(132,-195,571,781),10314=>array(132,-195,571,781),10315=>array(132,-195,571,781),10316=>array(132,-195,571,781),10317=>array(132,-195,571,781),10318=>array(132,-195,571,781),10319=>array(132,-195,571,781),10320=>array(132,-195,571,521),10321=>array(132,-195,571,781),10322=>array(132,-195,571,521),10323=>array(132,-195,571,781),10324=>array(132,-195,571,521),10325=>array(132,-195,571,781),10326=>array(132,-195,571,521),10327=>array(132,-195,571,781),10328=>array(132,-195,571,781),10329=>array(132,-195,571,781),10330=>array(132,-195,571,781),10331=>array(132,-195,571,781),10332=>array(132,-195,571,781),10333=>array(132,-195,571,781),10334=>array(132,-195,571,781),10335=>array(132,-195,571,781),10336=>array(132,-195,571,260),10337=>array(132,-195,571,781),10338=>array(132,-195,571,521),10339=>array(132,-195,571,781),10340=>array(132,-195,571,260),10341=>array(132,-195,571,781),10342=>array(132,-195,571,521),10343=>array(132,-195,571,781),10344=>array(132,-195,571,781),10345=>array(132,-195,571,781),10346=>array(132,-195,571,781),10347=>array(132,-195,571,781),10348=>array(132,-195,571,781),10349=>array(132,-195,571,781),10350=>array(132,-195,571,781),10351=>array(132,-195,571,781),10352=>array(132,-195,571,521),10353=>array(132,-195,571,781),10354=>array(132,-195,571,521),10355=>array(132,-195,571,781),10356=>array(132,-195,571,521),10357=>array(132,-195,571,781),10358=>array(132,-195,571,521),10359=>array(132,-195,571,781),10360=>array(132,-195,571,781),10361=>array(132,-195,571,781),10362=>array(132,-195,571,781),10363=>array(132,-195,571,781),10364=>array(132,-195,571,781),10365=>array(132,-195,571,781),10366=>array(132,-195,571,781),10367=>array(132,-195,571,781),10368=>array(396,-195,571,0),10369=>array(132,-195,571,781),10370=>array(132,-195,571,521),10371=>array(132,-195,571,781),10372=>array(132,-195,571,260),10373=>array(132,-195,571,781),10374=>array(132,-195,571,521),10375=>array(132,-195,571,781),10376=>array(396,-195,571,781),10377=>array(132,-195,571,781),10378=>array(132,-195,571,781),10379=>array(132,-195,571,781),10380=>array(132,-195,571,781),10381=>array(132,-195,571,781),10382=>array(132,-195,571,781),10383=>array(132,-195,571,781),10384=>array(396,-195,571,521),10385=>array(132,-195,571,781),10386=>array(132,-195,571,521),10387=>array(132,-195,571,781),10388=>array(132,-195,571,521),10389=>array(132,-195,571,781),10390=>array(132,-195,571,521),10391=>array(132,-195,571,781),10392=>array(396,-195,571,781),10393=>array(132,-195,571,781),10394=>array(132,-195,571,781),10395=>array(132,-195,571,781),10396=>array(132,-195,571,781),10397=>array(132,-195,571,781),10398=>array(132,-195,571,781),10399=>array(132,-195,571,781),10400=>array(396,-195,571,260),10401=>array(132,-195,571,781),10402=>array(132,-195,571,521),10403=>array(132,-195,571,781),10404=>array(132,-195,571,260),10405=>array(132,-195,571,781),10406=>array(132,-195,571,521),10407=>array(132,-195,571,781),10408=>array(396,-195,571,781),10409=>array(132,-195,571,781),10410=>array(132,-195,571,781),10411=>array(132,-195,571,781),10412=>array(132,-195,571,781),10413=>array(132,-195,571,781),10414=>array(132,-195,571,781),10415=>array(132,-195,571,781),10416=>array(396,-195,571,521),10417=>array(132,-195,571,781),10418=>array(132,-195,571,521),10419=>array(132,-195,571,781),10420=>array(132,-195,571,521),10421=>array(132,-195,571,781),10422=>array(132,-195,571,521),10423=>array(132,-195,571,781),10424=>array(396,-195,571,781),10425=>array(132,-195,571,781),10426=>array(132,-195,571,781),10427=>array(132,-195,571,781),10428=>array(132,-195,571,781),10429=>array(132,-195,571,781),10430=>array(132,-195,571,781),10431=>array(132,-195,571,781),10432=>array(132,-195,571,0),10433=>array(132,-195,571,781),10434=>array(132,-195,571,521),10435=>array(132,-195,571,781),10436=>array(132,-195,571,260),10437=>array(132,-195,571,781),10438=>array(132,-195,571,521),10439=>array(132,-195,571,781),10440=>array(132,-195,571,781),10441=>array(132,-195,571,781),10442=>array(132,-195,571,781),10443=>array(132,-195,571,781),10444=>array(132,-195,571,781),10445=>array(132,-195,571,781),10446=>array(132,-195,571,781),10447=>array(132,-195,571,781),10448=>array(132,-195,571,521),10449=>array(132,-195,571,781),10450=>array(132,-195,571,521),10451=>array(132,-195,571,781),10452=>array(132,-195,571,521),10453=>array(132,-195,571,781),10454=>array(132,-195,571,521),10455=>array(132,-195,571,781),10456=>array(132,-195,571,781),10457=>array(132,-195,571,781),10458=>array(132,-195,571,781),10459=>array(132,-195,571,781),10460=>array(132,-195,571,781),10461=>array(132,-195,571,781),10462=>array(132,-195,571,781),10463=>array(132,-195,571,781),10464=>array(132,-195,571,260),10465=>array(132,-195,571,781),10466=>array(132,-195,571,521),10467=>array(132,-195,571,781),10468=>array(132,-195,571,260),10469=>array(132,-195,571,781),10470=>array(132,-195,571,521),10471=>array(132,-195,571,781),10472=>array(132,-195,571,781),10473=>array(132,-195,571,781),10474=>array(132,-195,571,781),10475=>array(132,-195,571,781),10476=>array(132,-195,571,781),10477=>array(132,-195,571,781),10478=>array(132,-195,571,781),10479=>array(132,-195,571,781),10480=>array(132,-195,571,521),10481=>array(132,-195,571,781),10482=>array(132,-195,571,521),10483=>array(132,-195,571,781),10484=>array(132,-195,571,521),10485=>array(132,-195,571,781),10486=>array(132,-195,571,521),10487=>array(132,-195,571,781),10488=>array(132,-195,571,781),10489=>array(132,-195,571,781),10490=>array(132,-195,571,781),10491=>array(132,-195,571,781),10492=>array(132,-195,571,781),10493=>array(132,-195,571,781),10494=>array(132,-195,571,781),10495=>array(132,-195,571,781),10496=>array(51,119,721,527),10497=>array(51,119,721,527),10498=>array(33,119,703,527),10499=>array(51,119,721,527),10500=>array(33,119,721,527),10501=>array(51,119,721,527),10502=>array(33,119,703,527),10503=>array(51,119,721,527),10504=>array(193,-20,561,724),10505=>array(193,0,561,744),10506=>array(149,0,605,744),10507=>array(149,-20,605,724),10508=>array(33,119,703,527),10509=>array(51,119,721,527),10510=>array(33,119,703,527),10511=>array(51,119,721,527),10512=>array(44,118,721,529),10513=>array(48,119,721,527),10514=>array(193,0,561,724),10515=>array(193,0,561,724),10516=>array(44,118,721,529),10517=>array(44,118,721,529),10518=>array(44,118,721,529),10519=>array(44,118,721,529),10520=>array(44,118,721,529),10521=>array(51,118,710,529),10522=>array(44,118,703,529),10523=>array(51,118,710,529),10524=>array(44,118,703,529),10525=>array(33,119,703,527),10526=>array(51,119,721,527),10527=>array(33,119,703,527),10528=>array(51,119,721,527),10529=>array(132,52,622,595),10530=>array(132,52,622,595),10531=>array(132,-45,585,595),10532=>array(168,-45,622,595),10533=>array(168,52,622,692),10534=>array(132,52,585,692),10535=>array(112,29,642,595),10536=>array(112,29,622,617),10537=>array(112,52,642,617),10538=>array(132,29,642,617),10539=>array(112,29,642,617),10540=>array(112,29,642,617),10541=>array(112,29,622,617),10542=>array(112,29,622,617),10543=>array(112,29,642,617),10544=>array(112,29,642,617),10545=>array(112,29,642,595),10546=>array(112,29,642,595),10547=>array(38,119,721,527),10548=>array(131,94,637,623),10549=>array(131,80,637,608),10550=>array(132,70,608,632),10551=>array(146,70,622,632),10552=>array(255,-13,532,735),10553=>array(222,-13,499,735),10554=>array(46,188,720,495),10555=>array(35,151,708,459),10556=>array(35,78,708,495),10557=>array(46,0,720,495),10558=>array(126,58,623,593),10559=>array(132,58,628,593),10560=>array(121,48,633,719),10561=>array(121,48,633,719),10562=>array(33,-52,721,698),10563=>array(33,-52,721,698),10564=>array(33,-52,721,698),10565=>array(51,0,721,527),10566=>array(33,0,703,527),10567=>array(51,119,721,527),10568=>array(33,119,721,527),10569=>array(193,-12,561,744),10570=>array(31,119,724,527),10571=>array(31,119,724,527),10572=>array(193,-23,561,747),10573=>array(193,-23,561,747),10574=>array(31,270,724,527),10575=>array(329,-23,561,747),10576=>array(31,119,724,377),10577=>array(193,-23,426,747),10578=>array(51,131,703,527),10579=>array(51,131,703,527),10580=>array(204,0,561,724),10581=>array(204,0,561,724),10582=>array(51,119,703,515),10583=>array(51,119,703,515),10584=>array(193,0,550,724),10585=>array(193,0,550,724),10586=>array(31,131,703,527),10587=>array(51,131,724,527),10588=>array(204,0,561,747),10589=>array(204,-23,561,724),10590=>array(31,119,703,515),10591=>array(51,119,724,515),10592=>array(193,0,550,747),10593=>array(193,-23,550,724),10594=>array(31,21,703,625),10595=>array(105,0,649,747),10596=>array(51,21,724,625),10597=>array(105,-23,649,724),10598=>array(31,172,724,625),10599=>array(31,21,724,475),10600=>array(31,172,724,625),10601=>array(31,21,724,475),10602=>array(31,184,703,613),10603=>array(31,34,703,462),10604=>array(51,184,724,613),10605=>array(51,34,724,462),10606=>array(105,-23,649,747),10607=>array(105,-23,649,747),10608=>array(51,270,703,571),10609=>array(51,119,721,757),10610=>array(51,119,721,610),10611=>array(33,36,703,527),10612=>array(51,36,721,527),10613=>array(51,-138,721,527),10614=>array(33,-76,703,791),10615=>array(33,42,878,604),10616=>array(51,-76,721,791),10617=>array(51,-76,721,748),10618=>array(33,10,813,637),10619=>array(33,-76,703,748),10620=>array(147,11,618,636),10621=>array(136,11,606,636),10622=>array(96,62,659,584),10623=>array(96,54,659,576),10731=>array(2,-233,442,807),10764=>array(21,-182,1555,759),10765=>array(22,-182,527,760),10766=>array(22,-182,527,760),10799=>array(116,23,638,604),10858=>array(95,222,659,567),10859=>array(95,60,659,567),11008=>array(64,-28,621,591),11009=>array(133,-28,690,591),11010=>array(64,52,621,671),11011=>array(133,52,690,671),11012=>array(33,119,721,527),11013=>array(33,119,703,527),11014=>array(193,0,561,744),11015=>array(193,-20,561,724),11016=>array(64,-28,621,591),11017=>array(133,-28,690,591),11018=>array(64,52,621,671),11019=>array(133,52,690,671),11020=>array(33,119,721,527),11021=>array(193,-20,561,744),11022=>array(51,112,721,514),11023=>array(51,132,721,534),11024=>array(33,112,703,514),11025=>array(33,132,703,534),11026=>array(82,-124,769,643),11027=>array(82,-124,769,643),11028=>array(82,-124,769,643),11029=>array(82,-124,769,643),11030=>array(2,-124,690,643),11031=>array(2,-124,690,643),11032=>array(2,-124,690,643),11033=>array(2,-124,690,643),11034=>array(82,-124,769,643),11360=>array(-22,0,581,729),11361=>array(-16,0,366,760),11363=>array(-22,0,681,729),11364=>array(129,-208,764,729),11367=>array(-8,-157,888,729),11368=>array(31,-217,655,760),11369=>array(-8,-157,826,729),11370=>array(31,-217,594,760),11371=>array(-17,-157,698,729),11372=>array(-14,-214,526,560),11373=>array(26,-14,791,742),11374=>array(38,-208,1082,729),11375=>array(110,0,836,729),11376=>array(-26,-14,739,742),11377=>array(18,0,682,533),11378=>array(45,0,1160,730),11379=>array(26,0,930,533),11381=>array(-22,0,688,729),11382=>array(52,0,497,519),11383=>array(44,-14,774,533),11385=>array(-41,-14,449,760),11386=>array(82,-14,610,533),11387=>array(-18,0,575,519),11388=>array(-7,-132,282,418),11389=>array(119,326,576,734),11390=>array(29,-208,630,742),11391=>array(-13,-208,703,729),11520=>array(86,-53,722,514),11521=>array(28,-218,598,514),11522=>array(83,-218,750,514),11523=>array(75,-2,642,759),11524=>array(92,-217,735,514),11525=>array(40,-217,891,514),11526=>array(108,0,707,759),11527=>array(40,0,890,514),11528=>array(88,0,583,514),11529=>array(38,-217,608,729),11530=>array(34,0,886,514),11531=>array(74,-4,622,759),11532=>array(38,0,608,759),11533=>array(39,-2,892,514),11534=>array(96,0,787,514),11535=>array(81,-218,835,759),11536=>array(40,0,890,759),11537=>array(38,0,607,759),11538=>array(29,-217,589,515),11539=>array(40,-221,909,675),11540=>array(70,-217,836,555),11541=>array(57,-218,792,759),11542=>array(38,0,606,514),11543=>array(38,-217,608,514),11544=>array(38,-217,607,514),11545=>array(54,-217,611,759),11546=>array(66,-217,646,514),11547=>array(70,0,822,759),11548=>array(71,-217,909,514),11549=>array(29,-217,640,515),11550=>array(61,-217,636,514),11551=>array(23,-218,793,518),11552=>array(88,0,1026,514),11553=>array(48,-217,596,759),11554=>array(60,-3,572,579),11555=>array(38,-217,639,759),11556=>array(38,-217,701,514),11557=>array(79,-4,818,759),11800=>array(10,-14,435,742),11807=>array(95,60,659,406),11810=>array(112,314,440,760),11811=>array(131,314,392,760),11812=>array(34,-132,294,314),11813=>array(-15,-132,313,314),11822=>array(88,-14,547,742),42564=>array(32,-14,622,742),42565=>array(21,-14,489,533),42566=>array(91,0,444,729),42567=>array(67,0,298,519),42576=>array(37,0,1222,729),42577=>array(16,-14,926,534),42580=>array(53,-14,1180,742),42581=>array(40,-14,854,533),42582=>array(-22,0,1115,729),42583=>array(68,-14,862,533),42760=>array(131,0,424,693),42761=>array(105,0,424,693),42762=>array(79,0,424,693),42763=>array(52,0,424,693),42764=>array(26,0,424,693),42765=>array(26,0,424,693),42766=>array(26,0,398,693),42767=>array(26,0,372,693),42768=>array(26,0,345,693),42769=>array(26,0,319,693),42770=>array(26,0,424,693),42771=>array(26,0,398,693),42772=>array(26,0,372,693),42773=>array(26,0,345,693),42774=>array(26,0,319,693),42779=>array(71,326,305,743),42780=>array(41,315,275,731),42781=>array(44,318,213,734),42782=>array(36,326,205,742),42783=>array(-21,0,147,416),42790=>array(-4,-208,892,729),42791=>array(50,-222,578,760),42792=>array(60,-203,861,729),42793=>array(60,-203,780,680),42794=>array(2,-14,628,742),42795=>array(11,-12,549,742),42796=>array(11,-14,534,729),42797=>array(11,-222,515,519),42798=>array(19,-104,638,729),42799=>array(13,-240,601,519),42800=>array(-20,0,568,519),42801=>array(-0,-14,488,533),42802=>array(-71,0,1127,729),42803=>array(31,-14,821,533),42804=>array(-71,-14,1096,742),42805=>array(31,-14,875,533),42806=>array(-90,-14,1097,729),42807=>array(31,-14,856,533),42808=>array(-71,0,991,729),42809=>array(31,-14,756,533),42810=>array(-71,0,991,729),42811=>array(18,-14,766,533),42812=>array(-53,-208,990,729),42813=>array(31,-222,723,533),42814=>array(10,-14,679,742),42815=>array(20,-14,514,533),42816=>array(-22,0,812,729),42817=>array(31,0,583,760),42822=>array(96,0,772,729),42823=>array(83,0,446,760),42826=>array(-11,-14,920,742),42827=>array(-9,-14,703,533),42830=>array(38,-14,1265,742),42831=>array(37,-14,918,533),42856=>array(-40,-208,752,729),42857=>array(23,-208,653,519),42875=>array(31,-208,694,742),42876=>array(32,-208,547,533),42880=>array(52,0,655,729),42881=>array(22,-240,311,519),42882=>array(31,-208,721,743),42883=>array(32,-208,625,533),42884=>array(31,-208,694,742),42885=>array(32,-208,547,533),42886=>array(39,-14,745,729),42887=>array(38,-14,563,519),42891=>array(143,225,345,729),42892=>array(62,458,214,729),42893=>array(81,0,839,729),42896=>array(-24,-157,851,729),42897=>array(50,-217,676,533),42922=>array(-86,0,874,729),43002=>array(-16,0,976,519),43003=>array(45,0,661,729),43004=>array(48,0,699,729),43005=>array(-22,0,1022,729),43006=>array(-40,0,461,928),43007=>array(-71,0,1231,729),62464=>array(6,-15,570,876),62465=>array(19,-15,579,876),62466=>array(11,-15,625,875),62467=>array(73,-15,894,876),62468=>array(5,-15,642,876),62469=>array(-1,-15,631,876),62470=>array(75,-15,676,876),62471=>array(33,-14,924,875),62472=>array(41,-15,627,876),62473=>array(6,-15,626,876),62474=>array(75,-21,1177,876),62475=>array(20,-15,659,876),62476=>array(29,-15,681,888),62477=>array(42,-146,891,876),62478=>array(12,-15,633,876),62479=>array(5,-15,702,877),62480=>array(22,-15,888,860),62481=>array(59,-15,645,876),62482=>array(29,-15,712,876),62483=>array(72,-15,723,876),62484=>array(82,-15,906,876),62485=>array(-1,-15,699,864),62486=>array(81,-16,896,875),62487=>array(4,-15,698,875),62488=>array(23,-15,669,876),62489=>array(-24,-15,600,876),62490=>array(25,-15,677,870),62491=>array(19,-15,658,876),62492=>array(29,-15,714,876),62493=>array(1,-15,618,910),62494=>array(64,-15,641,876),62495=>array(-19,-25,866,875),62496=>array(1,-15,647,882),62497=>array(31,-15,742,879),62498=>array(-26,-57,631,876),62499=>array(3,-15,702,895),62500=>array(3,-15,646,876),62501=>array(-0,-15,690,876),62502=>array(66,-14,908,876),62504=>array(64,-217,809,759),63172=>array(51,0,351,763),63173=>array(11,-14,597,756),63174=>array(20,-222,600,533),63175=>array(57,-14,644,731),63176=>array(57,-14,938,731),63185=>array(53,616,404,816),63188=>array(72,624,406,840),64256=>array(-53,-190,875,760),64257=>array(-53,-190,611,760),64258=>array(-53,-190,648,760),64259=>array(-53,-190,968,760),64260=>array(-53,-190,1003,760),64261=>array(-53,-190,791,760),64262=>array(-0,-14,878,748),65533=>array(94,-108,1052,956),65535=>array(44,-177,495,705));
$cw=array(0=>540,32=>313,33=>395,34=>469,35=>754,36=>626,37=>855,38=>813,39=>275,40=>426,41=>426,42=>470,43=>754,44=>313,45=>374,46=>313,47=>329,48=>626,49=>626,50=>626,51=>626,52=>626,53=>626,54=>626,55=>626,56=>626,57=>626,58=>332,59=>332,60=>754,61=>754,62=>754,63=>527,64=>900,65=>698,66=>760,67=>716,68=>780,69=>686,70=>639,71=>769,72=>850,73=>421,74=>426,75=>782,76=>633,77=>996,78=>822,79=>784,80=>677,81=>784,82=>748,83=>650,84=>669,85=>785,86=>698,87=>1011,88=>698,89=>642,90=>657,91=>426,92=>329,93=>426,94=>754,95=>450,96=>450,97=>583,98=>629,99=>548,100=>629,101=>572,102=>387,103=>629,104=>654,105=>342,106=>325,107=>624,108=>342,109=>952,110=>654,111=>600,112=>629,113=>629,114=>474,115=>506,116=>416,117=>654,118=>523,119=>774,120=>536,121=>523,122=>511,123=>579,124=>327,125=>579,126=>754,160=>313,161=>395,162=>626,163=>626,164=>572,165=>626,166=>327,167=>470,168=>450,169=>900,170=>438,171=>563,172=>754,173=>374,174=>900,175=>450,176=>450,177=>754,178=>394,179=>394,180=>450,181=>659,182=>572,183=>313,184=>450,185=>394,186=>450,187=>563,188=>938,189=>938,190=>938,191=>527,192=>698,193=>698,194=>698,195=>698,196=>698,197=>698,198=>931,199=>716,200=>686,201=>686,202=>686,203=>686,204=>421,205=>421,206=>421,207=>421,208=>787,209=>822,210=>784,211=>784,212=>784,213=>784,214=>784,215=>754,216=>784,217=>785,218=>785,219=>785,220=>785,221=>642,222=>681,223=>684,224=>583,225=>583,226=>583,227=>583,228=>583,229=>583,230=>838,231=>548,232=>572,233=>572,234=>572,235=>572,236=>342,237=>342,238=>342,239=>342,240=>600,241=>654,242=>600,243=>600,244=>600,245=>600,246=>600,247=>754,248=>600,249=>654,250=>654,251=>654,252=>654,253=>523,254=>629,255=>523,256=>698,257=>583,258=>698,259=>583,260=>698,261=>583,262=>716,263=>548,264=>716,265=>548,266=>716,267=>548,268=>716,269=>548,270=>780,271=>629,272=>787,273=>629,274=>686,275=>572,276=>686,277=>572,278=>686,279=>572,280=>686,281=>572,282=>686,283=>572,284=>769,285=>629,286=>769,287=>629,288=>769,289=>629,290=>769,291=>629,292=>850,293=>654,294=>850,295=>654,296=>421,297=>342,298=>421,299=>342,300=>421,301=>342,302=>421,303=>342,304=>421,305=>342,306=>848,307=>676,308=>426,309=>325,310=>782,311=>624,312=>624,313=>633,314=>342,315=>633,316=>342,317=>633,318=>457,319=>633,320=>501,321=>639,322=>346,323=>822,324=>654,325=>822,326=>654,327=>822,328=>654,329=>907,330=>785,331=>654,332=>784,333=>600,334=>784,335=>600,336=>784,337=>600,338=>1062,339=>925,340=>748,341=>474,342=>748,343=>474,344=>748,345=>474,346=>650,347=>506,348=>650,349=>506,350=>650,351=>506,352=>650,353=>506,354=>669,355=>416,356=>669,357=>416,358=>669,359=>416,360=>785,361=>654,362=>785,363=>654,364=>785,365=>654,366=>785,367=>654,368=>785,369=>654,370=>785,371=>654,372=>1011,373=>774,374=>642,375=>523,376=>642,377=>657,378=>511,379=>657,380=>511,381=>657,382=>511,383=>387,384=>629,385=>760,386=>769,387=>629,388=>769,389=>629,390=>716,391=>716,392=>548,393=>787,394=>780,395=>769,396=>629,397=>600,398=>686,399=>784,400=>649,401=>639,402=>387,403=>769,404=>693,405=>938,406=>421,407=>421,408=>782,409=>624,410=>342,411=>631,412=>952,413=>822,414=>654,415=>784,416=>784,417=>600,418=>1080,419=>849,420=>677,421=>629,422=>748,423=>650,424=>506,425=>636,426=>298,427=>416,428=>669,429=>416,430=>669,431=>785,432=>654,433=>801,434=>801,435=>642,436=>628,437=>657,438=>511,439=>591,440=>591,441=>591,442=>591,443=>626,444=>678,445=>511,446=>482,447=>644,448=>265,449=>443,450=>413,451=>265,452=>1437,453=>1292,454=>1140,455=>1059,456=>958,457=>667,458=>1248,459=>1148,460=>980,461=>698,462=>583,463=>421,464=>342,465=>784,466=>600,467=>785,468=>654,469=>785,470=>654,471=>785,472=>654,473=>785,474=>654,475=>785,476=>654,477=>572,478=>698,479=>583,480=>698,481=>583,482=>931,483=>877,484=>806,485=>629,486=>769,487=>629,488=>782,489=>624,490=>784,491=>600,492=>784,493=>600,494=>591,495=>511,496=>325,497=>1437,498=>1292,499=>1140,500=>769,501=>629,502=>1099,503=>708,504=>822,505=>654,506=>698,507=>583,508=>931,509=>838,510=>784,511=>600,512=>698,513=>583,514=>698,515=>583,516=>686,517=>572,518=>686,519=>572,520=>421,521=>342,522=>421,523=>342,524=>784,525=>600,526=>784,527=>600,528=>748,529=>474,530=>748,531=>474,532=>785,533=>654,534=>785,535=>654,536=>650,537=>506,538=>669,539=>416,540=>621,541=>546,542=>850,543=>654,544=>785,545=>711,546=>632,547=>554,548=>657,549=>511,550=>698,551=>583,552=>686,553=>572,554=>784,555=>600,556=>784,557=>600,558=>784,559=>600,560=>784,561=>600,562=>642,563=>523,564=>516,565=>830,566=>508,567=>325,568=>928,569=>928,570=>698,571=>716,572=>548,573=>633,574=>669,575=>506,576=>511,577=>594,578=>492,579=>760,580=>785,581=>698,582=>686,583=>572,584=>426,585=>348,586=>763,587=>629,588=>748,589=>474,590=>642,591=>523,592=>583,593=>692,594=>692,595=>629,596=>548,597=>548,598=>629,599=>657,600=>572,601=>572,602=>816,603=>547,604=>505,605=>816,606=>647,607=>348,608=>629,609=>629,610=>563,611=>541,612=>564,613=>654,614=>654,615=>654,616=>342,617=>342,618=>342,619=>368,620=>462,621=>342,622=>716,623=>952,624=>952,625=>952,626=>654,627=>654,628=>641,629=>600,630=>955,631=>674,632=>600,633=>514,634=>514,635=>514,636=>474,637=>474,638=>406,639=>438,640=>721,641=>721,642=>506,643=>298,644=>387,645=>486,646=>298,647=>443,648=>416,649=>654,650=>611,651=>624,652=>523,653=>774,654=>571,655=>654,656=>511,657=>511,658=>511,659=>511,660=>482,661=>482,662=>482,663=>490,664=>784,665=>625,666=>647,667=>563,668=>659,669=>345,670=>666,671=>555,672=>629,673=>482,674=>482,675=>1005,676=>1061,677=>1005,678=>844,679=>643,680=>851,681=>935,682=>782,683=>716,684=>596,685=>398,686=>552,687=>646,688=>469,689=>466,690=>282,691=>372,692=>372,693=>432,694=>474,695=>488,696=>329,697=>271,698=>469,699=>313,700=>313,701=>313,702=>330,703=>330,704=>282,705=>282,706=>450,707=>450,708=>450,709=>450,710=>450,711=>450,712=>254,713=>450,714=>450,715=>450,716=>254,717=>450,720=>332,721=>332,722=>330,723=>330,726=>353,727=>353,728=>450,729=>450,730=>450,731=>450,732=>450,733=>450,734=>375,736=>340,737=>263,738=>355,739=>338,740=>282,741=>450,742=>450,743=>450,744=>450,745=>450,748=>450,750=>498,751=>450,752=>450,755=>450,759=>450,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,864=>0,865=>0,880=>701,881=>519,882=>722,883=>699,884=>271,885=>271,886=>866,887=>664,890=>450,891=>548,892=>548,893=>548,894=>332,900=>450,901=>450,902=>698,903=>313,904=>852,905=>1022,906=>595,908=>798,910=>857,911=>820,912=>435,913=>698,914=>760,915=>639,916=>698,917=>686,918=>657,919=>850,920=>784,921=>421,922=>782,923=>698,924=>996,925=>822,926=>633,927=>784,928=>850,929=>677,931=>636,932=>669,933=>642,934=>784,935=>698,936=>822,937=>801,938=>421,939=>642,940=>692,941=>547,942=>654,943=>435,944=>624,945=>692,946=>598,947=>594,948=>600,949=>547,950=>533,951=>654,952=>600,953=>435,954=>674,955=>631,956=>659,957=>624,958=>533,959=>600,960=>659,961=>598,962=>548,963=>664,964=>605,965=>624,966=>814,967=>592,968=>847,969=>857,970=>435,971=>624,972=>600,973=>624,974=>857,975=>782,976=>600,977=>764,978=>687,979=>872,980=>687,981=>847,982=>857,983=>589,984=>784,985=>600,986=>716,987=>548,988=>639,989=>475,990=>531,991=>593,992=>716,993=>600,1008=>589,1009=>598,1010=>548,1011=>325,1012=>784,1013=>548,1014=>548,1015=>681,1016=>629,1017=>716,1018=>996,1019=>774,1020=>623,1021=>716,1022=>716,1023=>716,1024=>686,1025=>686,1026=>811,1027=>621,1028=>716,1029=>650,1030=>421,1031=>421,1032=>426,1033=>1081,1034=>1135,1035=>866,1036=>818,1037=>850,1038=>730,1039=>850,1040=>733,1041=>769,1042=>760,1043=>621,1044=>800,1045=>686,1046=>1181,1047=>649,1048=>850,1049=>850,1050=>818,1051=>795,1052=>996,1053=>850,1054=>784,1055=>850,1056=>677,1057=>716,1058=>669,1059=>730,1060=>854,1061=>698,1062=>870,1063=>822,1064=>1141,1065=>1164,1066=>861,1067=>1081,1068=>743,1069=>716,1070=>1158,1071=>793,1072=>583,1073=>650,1074=>591,1075=>506,1076=>625,1077=>572,1078=>1175,1079=>574,1080=>654,1081=>654,1082=>609,1083=>659,1084=>855,1085=>656,1086=>600,1087=>654,1088=>629,1089=>548,1090=>952,1091=>538,1092=>812,1093=>536,1094=>723,1095=>643,1096=>952,1097=>1021,1098=>654,1099=>916,1100=>593,1101=>580,1102=>901,1103=>716,1104=>572,1105=>572,1106=>646,1107=>506,1108=>548,1109=>506,1110=>342,1111=>342,1112=>325,1113=>913,1114=>910,1115=>654,1116=>609,1117=>654,1118=>538,1119=>654,1122=>792,1123=>945,1124=>1076,1125=>867,1130=>1181,1131=>909,1132=>1467,1133=>1122,1136=>986,1137=>995,1138=>784,1139=>587,1140=>824,1141=>673,1142=>824,1143=>673,1164=>761,1165=>606,1168=>630,1169=>556,1170=>621,1171=>506,1172=>768,1173=>634,1174=>1181,1175=>1175,1176=>649,1177=>574,1178=>812,1179=>633,1182=>818,1183=>609,1184=>937,1185=>684,1186=>856,1187=>725,1188=>1050,1189=>859,1190=>1191,1191=>911,1194=>716,1195=>548,1196=>669,1197=>1028,1198=>642,1199=>515,1200=>642,1201=>515,1202=>709,1203=>536,1204=>909,1205=>749,1206=>822,1207=>712,1210=>819,1211=>654,1216=>421,1217=>1181,1218=>1175,1219=>782,1220=>624,1223=>850,1224=>659,1227=>885,1228=>659,1231=>342,1232=>733,1233=>583,1234=>733,1235=>583,1236=>931,1237=>877,1238=>686,1239=>572,1240=>784,1241=>572,1242=>784,1243=>572,1244=>1181,1245=>1175,1246=>649,1247=>574,1248=>591,1249=>511,1250=>850,1251=>654,1252=>850,1253=>654,1254=>784,1255=>600,1256=>784,1257=>600,1258=>784,1259=>600,1260=>716,1261=>580,1262=>730,1263=>538,1264=>730,1265=>538,1266=>730,1267=>538,1268=>822,1269=>643,1270=>621,1271=>506,1272=>1081,1273=>916,1296=>649,1297=>574,1298=>795,1299=>659,1300=>1123,1301=>904,1306=>738,1307=>576,1308=>925,1309=>770,1329=>848,1330=>748,1331=>804,1332=>817,1333=>739,1334=>738,1335=>672,1336=>748,1337=>1013,1338=>804,1339=>722,1340=>650,1341=>1069,1342=>798,1343=>757,1344=>663,1345=>777,1346=>826,1347=>766,1348=>879,1349=>750,1350=>822,1351=>759,1352=>784,1353=>736,1354=>931,1355=>761,1356=>867,1357=>784,1358=>822,1359=>727,1360=>727,1361=>752,1362=>639,1363=>859,1364=>802,1365=>784,1366=>867,1369=>276,1370=>237,1371=>264,1372=>352,1373=>290,1374=>396,1375=>450,1377=>949,1378=>625,1379=>699,1380=>721,1381=>655,1382=>668,1383=>539,1384=>660,1385=>818,1386=>690,1387=>651,1388=>358,1389=>978,1390=>625,1391=>647,1392=>663,1393=>615,1394=>664,1395=>633,1396=>651,1397=>323,1398=>647,1399=>446,1400=>664,1401=>385,1402=>953,1403=>602,1404=>669,1405=>651,1406=>651,1407=>936,1408=>651,1409=>642,1410=>444,1411=>936,1412=>660,1413=>624,1414=>860,1415=>750,1417=>306,1418=>349,4256=>688,4257=>851,4258=>788,4259=>795,4260=>712,4261=>979,4262=>921,4263=>1100,4264=>587,4265=>745,4266=>955,4267=>954,4268=>725,4269=>1030,4270=>880,4271=>820,4272=>1007,4273=>721,4274=>689,4275=>977,4276=>887,4277=>968,4278=>738,4279=>758,4280=>748,4281=>759,4282=>826,4283=>978,4284=>701,4285=>748,4286=>740,4287=>1008,4288=>1019,4289=>730,4290=>812,4291=>730,4292=>801,4293=>965,4304=>535,4305=>563,4306=>579,4307=>798,4308=>553,4309=>549,4310=>599,4311=>823,4312=>552,4313=>540,4314=>1008,4315=>589,4316=>576,4317=>791,4318=>561,4319=>571,4320=>790,4321=>591,4322=>721,4323=>676,4324=>782,4325=>575,4326=>820,4327=>559,4328=>583,4329=>576,4330=>656,4331=>577,4332=>575,4333=>566,4334=>606,4335=>663,4336=>563,4337=>591,4338=>563,4339=>563,4340=>562,4341=>603,4342=>846,4343=>612,4344=>572,4345=>605,4346=>562,4347=>401,4348=>327,7424=>577,7425=>802,7426=>838,7427=>625,7428=>548,7429=>607,7430=>607,7431=>555,7432=>458,7433=>288,7434=>505,7435=>650,7436=>555,7437=>782,7438=>664,7439=>600,7440=>548,7441=>565,7442=>565,7443=>600,7444=>925,7445=>538,7446=>600,7447=>600,7448=>527,7449=>721,7450=>721,7451=>558,7452=>583,7453=>597,7454=>831,7455=>589,7456=>523,7457=>774,7458=>511,7459=>511,7460=>529,7461=>721,7462=>527,7463=>577,7464=>659,7465=>527,7466=>769,7467=>634,7468=>439,7469=>586,7470=>479,7471=>479,7472=>491,7473=>432,7474=>432,7475=>483,7476=>536,7477=>265,7478=>268,7479=>492,7480=>398,7481=>627,7482=>518,7483=>545,7484=>493,7485=>398,7486=>426,7487=>471,7488=>422,7489=>494,7490=>637,7491=>367,7492=>367,7493=>436,7494=>528,7495=>448,7496=>448,7497=>400,7498=>400,7499=>370,7500=>370,7501=>448,7502=>270,7503=>471,7504=>655,7505=>426,7506=>420,7507=>384,7508=>420,7509=>420,7510=>448,7511=>333,7512=>468,7513=>376,7514=>655,7515=>442,7516=>454,7517=>376,7518=>374,7519=>378,7520=>513,7521=>373,7522=>215,7523=>372,7524=>468,7525=>442,7526=>376,7527=>374,7528=>377,7529=>513,7530=>373,7531=>938,7543=>576,7544=>536,7547=>342,7548=>342,7549=>629,7550=>583,7551=>611,7557=>342,7579=>436,7580=>384,7581=>384,7582=>420,7583=>370,7584=>244,7585=>335,7586=>448,7587=>470,7588=>270,7589=>276,7590=>270,7591=>270,7592=>333,7593=>331,7594=>289,7595=>387,7596=>613,7597=>655,7598=>529,7599=>528,7600=>425,7601=>420,7602=>470,7603=>360,7604=>348,7605=>333,7606=>468,7607=>427,7608=>367,7609=>439,7610=>329,7611=>321,7612=>474,7613=>371,7614=>407,7615=>420,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>698,7681=>583,7682=>760,7683=>629,7684=>760,7685=>629,7686=>760,7687=>629,7688=>716,7689=>548,7690=>780,7691=>629,7692=>780,7693=>629,7694=>780,7695=>629,7696=>780,7697=>629,7698=>780,7699=>629,7700=>686,7701=>572,7702=>686,7703=>572,7704=>686,7705=>572,7706=>686,7707=>572,7708=>686,7709=>572,7710=>639,7711=>387,7712=>769,7713=>629,7714=>850,7715=>654,7716=>850,7717=>654,7718=>850,7719=>654,7720=>850,7721=>654,7722=>850,7723=>654,7724=>421,7725=>342,7726=>421,7727=>342,7728=>782,7729=>624,7730=>782,7731=>624,7732=>782,7733=>624,7734=>633,7735=>342,7736=>633,7737=>342,7738=>633,7739=>342,7740=>633,7741=>342,7742=>996,7743=>952,7744=>996,7745=>952,7746=>996,7747=>952,7748=>822,7749=>654,7750=>822,7751=>654,7752=>822,7753=>654,7754=>822,7755=>654,7756=>784,7757=>600,7758=>784,7759=>600,7760=>784,7761=>600,7762=>784,7763=>600,7764=>677,7765=>629,7766=>677,7767=>629,7768=>748,7769=>474,7770=>748,7771=>474,7772=>748,7773=>474,7774=>748,7775=>474,7776=>650,7777=>506,7778=>650,7779=>506,7780=>650,7781=>506,7782=>650,7783=>506,7784=>650,7785=>506,7786=>669,7787=>416,7788=>669,7789=>416,7790=>669,7791=>416,7792=>669,7793=>416,7794=>785,7795=>654,7796=>785,7797=>654,7798=>785,7799=>654,7800=>785,7801=>654,7802=>785,7803=>654,7804=>698,7805=>523,7806=>698,7807=>523,7808=>1011,7809=>774,7810=>1011,7811=>774,7812=>1011,7813=>774,7814=>1011,7815=>774,7816=>1011,7817=>774,7818=>698,7819=>536,7820=>698,7821=>536,7822=>642,7823=>523,7824=>657,7825=>511,7826=>657,7827=>511,7828=>657,7829=>511,7830=>654,7831=>416,7832=>774,7833=>523,7834=>913,7835=>387,7836=>387,7837=>387,7838=>852,7839=>600,7840=>698,7841=>583,7842=>698,7843=>583,7844=>698,7845=>583,7846=>698,7847=>583,7848=>698,7849=>583,7850=>698,7851=>583,7852=>698,7853=>583,7854=>698,7855=>583,7856=>698,7857=>583,7858=>698,7859=>583,7860=>698,7861=>583,7862=>698,7863=>583,7864=>686,7865=>572,7866=>686,7867=>572,7868=>686,7869=>572,7870=>686,7871=>572,7872=>686,7873=>572,7874=>686,7875=>572,7876=>686,7877=>572,7878=>686,7879=>572,7880=>421,7881=>342,7882=>421,7883=>342,7884=>784,7885=>600,7886=>784,7887=>600,7888=>784,7889=>600,7890=>784,7891=>600,7892=>784,7893=>600,7894=>784,7895=>600,7896=>784,7897=>600,7898=>784,7899=>600,7900=>784,7901=>600,7902=>784,7903=>600,7904=>784,7905=>600,7906=>784,7907=>600,7908=>785,7909=>654,7910=>785,7911=>654,7912=>785,7913=>654,7914=>785,7915=>654,7916=>785,7917=>654,7918=>785,7919=>654,7920=>785,7921=>654,7922=>642,7923=>523,7924=>642,7925=>523,7926=>642,7927=>523,7928=>642,7929=>523,7930=>970,7931=>630,7936=>692,7937=>692,7938=>692,7939=>692,7940=>692,7941=>692,7942=>692,7943=>692,7944=>698,7945=>698,7946=>880,7947=>880,7948=>748,7949=>764,7950=>698,7951=>698,7952=>547,7953=>547,7954=>547,7955=>547,7956=>547,7957=>547,7960=>826,7961=>817,7962=>1052,7963=>1052,7964=>984,7965=>1007,7968=>654,7969=>654,7970=>654,7971=>654,7972=>654,7973=>654,7974=>654,7975=>654,7976=>990,7977=>984,7978=>1222,7979=>1225,7980=>1151,7981=>1177,7982=>1077,7983=>1074,7984=>435,7985=>435,7986=>435,7987=>435,7988=>435,7989=>435,7990=>435,7991=>435,7992=>566,7993=>555,7994=>790,7995=>792,7996=>719,7997=>748,7998=>650,7999=>642,8000=>600,8001=>600,8002=>600,8003=>600,8004=>600,8005=>600,8008=>810,8009=>841,8010=>1116,8011=>1113,8012=>931,8013=>959,8016=>624,8017=>624,8018=>624,8019=>624,8020=>624,8021=>624,8022=>624,8023=>624,8025=>830,8027=>1067,8029=>1020,8031=>917,8032=>857,8033=>857,8034=>857,8035=>857,8036=>857,8037=>857,8038=>857,8039=>857,8040=>838,8041=>867,8042=>1141,8043=>1146,8044=>949,8045=>979,8046=>920,8047=>954,8048=>692,8049=>692,8050=>547,8051=>547,8052=>654,8053=>654,8054=>435,8055=>435,8056=>600,8057=>600,8058=>624,8059=>624,8060=>857,8061=>857,8064=>692,8065=>692,8066=>692,8067=>692,8068=>692,8069=>692,8070=>692,8071=>692,8072=>698,8073=>698,8074=>880,8075=>880,8076=>748,8077=>764,8078=>698,8079=>698,8080=>654,8081=>654,8082=>654,8083=>654,8084=>654,8085=>654,8086=>654,8087=>654,8088=>990,8089=>984,8090=>1222,8091=>1225,8092=>1151,8093=>1177,8094=>1077,8095=>1074,8096=>857,8097=>857,8098=>857,8099=>857,8100=>857,8101=>857,8102=>857,8103=>857,8104=>838,8105=>867,8106=>1141,8107=>1146,8108=>949,8109=>979,8110=>920,8111=>954,8112=>692,8113=>692,8114=>692,8115=>692,8116=>692,8118=>692,8119=>692,8120=>698,8121=>698,8122=>729,8123=>698,8124=>698,8125=>450,8126=>450,8127=>450,8128=>450,8129=>450,8130=>654,8131=>654,8132=>654,8134=>654,8135=>654,8136=>899,8137=>852,8138=>1072,8139=>1006,8140=>850,8141=>450,8142=>450,8143=>450,8144=>435,8145=>435,8146=>435,8147=>435,8150=>435,8151=>435,8152=>421,8153=>421,8154=>642,8155=>595,8157=>450,8158=>450,8159=>450,8160=>624,8161=>624,8162=>624,8163=>624,8164=>598,8165=>598,8166=>624,8167=>624,8168=>642,8169=>642,8170=>917,8171=>857,8172=>819,8173=>450,8174=>450,8175=>450,8178=>857,8179=>857,8180=>857,8182=>857,8183=>857,8184=>962,8185=>798,8186=>991,8187=>820,8188=>801,8189=>450,8190=>450,8192=>450,8193=>900,8194=>450,8195=>900,8196=>296,8197=>225,8198=>150,8199=>626,8200=>313,8201=>180,8202=>89,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>374,8209=>374,8210=>626,8211=>450,8212=>900,8213=>900,8214=>450,8215=>450,8216=>313,8217=>313,8218=>313,8219=>313,8220=>518,8221=>518,8222=>518,8223=>518,8224=>470,8225=>470,8226=>575,8227=>575,8228=>313,8229=>606,8230=>900,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>180,8240=>1246,8241=>1631,8242=>237,8243=>402,8244=>567,8245=>237,8246=>402,8247=>567,8248=>659,8249=>360,8250=>360,8252=>566,8253=>527,8254=>450,8258=>920,8260=>150,8261=>426,8262=>426,8263=>974,8264=>770,8265=>770,8267=>572,8268=>450,8269=>450,8270=>470,8271=>332,8273=>470,8274=>500,8275=>900,8279=>731,8287=>200,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>394,8305=>215,8308=>394,8309=>394,8310=>394,8311=>394,8312=>394,8313=>394,8314=>475,8315=>475,8316=>475,8317=>268,8318=>268,8319=>412,8320=>394,8321=>394,8322=>394,8323=>394,8324=>394,8325=>394,8326=>394,8327=>394,8328=>394,8329=>394,8330=>475,8331=>475,8332=>475,8333=>268,8334=>268,8336=>367,8337=>400,8338=>420,8339=>338,8340=>400,8341=>469,8342=>471,8343=>263,8344=>655,8345=>412,8346=>448,8347=>355,8348=>333,8358=>626,8364=>626,8367=>1039,8369=>710,8372=>788,8373=>626,8376=>669,8377=>626,8451=>1078,8457=>1001,8462=>654,8463=>654,8470=>978,8482=>900,8486=>801,8487=>801,8490=>782,8491=>698,8498=>639,8513=>707,8514=>518,8515=>573,8516=>684,8523=>813,8526=>533,8528=>932,8529=>932,8530=>1326,8531=>932,8532=>932,8533=>932,8534=>932,8535=>932,8536=>932,8537=>932,8538=>932,8539=>932,8540=>932,8541=>932,8542=>932,8543=>554,8544=>421,8545=>663,8546=>904,8547=>984,8548=>698,8549=>1014,8550=>1256,8551=>1498,8552=>962,8553=>698,8554=>970,8555=>1212,8556=>633,8557=>716,8558=>780,8559=>996,8560=>342,8561=>684,8562=>1025,8563=>865,8564=>523,8565=>865,8566=>1207,8567=>1548,8568=>878,8569=>536,8570=>878,8571=>1220,8572=>342,8573=>548,8574=>629,8575=>952,8576=>1129,8577=>780,8578=>1141,8579=>716,8580=>548,8581=>716,8585=>932,8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754,8598=>754,8599=>754,8600=>754,8601=>754,8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754,8608=>754,8609=>754,8610=>754,8611=>754,8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754,8618=>754,8619=>754,8620=>754,8621=>754,8622=>754,8623=>765,8624=>754,8625=>754,8626=>754,8627=>754,8628=>754,8629=>754,8630=>754,8631=>754,8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754,8638=>754,8639=>754,8640=>754,8641=>754,8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754,8648=>754,8649=>754,8650=>754,8651=>754,8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754,8658=>754,8659=>754,8660=>754,8661=>754,8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754,8668=>754,8669=>754,8670=>754,8671=>754,8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754,8678=>754,8679=>754,8680=>754,8681=>754,8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754,8688=>754,8689=>754,8690=>754,8691=>754,8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754,8698=>754,8699=>754,8700=>754,8701=>754,8702=>754,8703=>754,8704=>577,8706=>480,8707=>558,8708=>558,8710=>677,8711=>677,8712=>666,8713=>666,8715=>666,8716=>666,8719=>757,8720=>757,8721=>677,8722=>754,8723=>754,8724=>754,8725=>329,8727=>622,8728=>466,8729=>466,8730=>591,8731=>591,8732=>591,8733=>604,8734=>750,8735=>754,8736=>754,8739=>292,8740=>546,8741=>476,8742=>696,8743=>730,8744=>730,8745=>754,8746=>754,8747=>521,8748=>900,8749=>1252,8760=>754,8761=>754,8762=>754,8763=>754,8764=>754,8765=>754,8770=>754,8771=>754,8776=>754,8784=>754,8785=>754,8786=>754,8787=>754,8788=>974,8789=>974,8800=>754,8801=>754,8804=>754,8805=>754,8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754,8844=>754,8845=>754,8846=>754,8847=>754,8848=>754,8849=>754,8850=>754,8851=>754,8852=>754,8853=>754,8854=>754,8855=>754,8856=>754,8857=>754,8858=>754,8859=>754,8860=>754,8861=>754,8862=>754,8863=>754,8864=>754,8865=>754,8866=>795,8867=>795,8868=>864,8869=>864,8870=>554,8871=>554,8872=>795,8873=>795,8874=>795,8875=>971,8876=>795,8877=>795,8878=>795,8879=>971,8901=>358,8962=>751,8968=>426,8969=>426,8970=>426,8971=>426,8976=>754,8977=>484,8984=>835,8985=>754,8992=>521,8993=>521,8997=>900,9000=>1299,9085=>907,9115=>450,9116=>450,9117=>450,9118=>450,9119=>450,9120=>450,9121=>450,9122=>450,9123=>450,9124=>450,9125=>450,9126=>450,9127=>675,9128=>675,9129=>675,9130=>675,9131=>675,9132=>675,9133=>675,9134=>521,9167=>850,9251=>751,9600=>692,9601=>692,9602=>692,9603=>692,9604=>692,9605=>692,9606=>692,9607=>692,9608=>692,9609=>692,9610=>692,9611=>692,9612=>692,9613=>692,9614=>692,9615=>692,9616=>692,9617=>692,9618=>692,9619=>692,9620=>692,9621=>692,9622=>692,9623=>692,9624=>692,9625=>692,9626=>692,9627=>692,9628=>692,9629=>692,9630=>692,9631=>692,9632=>850,9633=>850,9634=>850,9635=>850,9636=>850,9637=>850,9638=>850,9639=>850,9640=>850,9641=>850,9642=>610,9643=>610,9644=>850,9645=>850,9646=>495,9647=>495,9648=>692,9649=>692,9650=>692,9651=>692,9652=>452,9653=>452,9654=>692,9655=>692,9656=>452,9657=>452,9658=>692,9659=>692,9660=>692,9661=>692,9662=>452,9663=>452,9664=>692,9665=>692,9666=>452,9667=>452,9668=>692,9669=>692,9670=>692,9671=>692,9672=>692,9673=>785,9674=>444,9675=>785,9676=>785,9677=>785,9678=>785,9679=>785,9680=>785,9681=>785,9682=>785,9683=>785,9684=>785,9685=>785,9686=>474,9687=>474,9688=>712,9689=>873,9690=>873,9691=>873,9692=>348,9693=>348,9694=>348,9695=>348,9696=>785,9697=>785,9698=>692,9699=>692,9700=>692,9701=>692,9702=>531,9703=>850,9704=>850,9705=>850,9706=>850,9707=>850,9708=>692,9709=>692,9710=>692,9711=>1007,9712=>850,9713=>850,9714=>850,9715=>850,9716=>785,9717=>785,9718=>785,9719=>785,9720=>692,9721=>692,9722=>692,9723=>747,9724=>747,9725=>659,9726=>659,9727=>692,9728=>807,9784=>807,9785=>807,9786=>807,9787=>807,9788=>807,9791=>552,9792=>658,9793=>658,9794=>807,9795=>807,9796=>807,9797=>807,9798=>807,9799=>807,9824=>807,9825=>807,9826=>807,9827=>807,9828=>807,9829=>807,9830=>807,9831=>807,9833=>424,9834=>574,9835=>807,9836=>807,9837=>424,9838=>321,9839=>435,10145=>754,10181=>411,10182=>411,10208=>444,10216=>411,10217=>411,10224=>754,10225=>754,10226=>754,10227=>754,10228=>930,10229=>1290,10230=>1290,10231=>1290,10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290,10237=>1290,10238=>1290,10239=>1290,10240=>703,10241=>703,10242=>703,10243=>703,10244=>703,10245=>703,10246=>703,10247=>703,10248=>703,10249=>703,10250=>703,10251=>703,10252=>703,10253=>703,10254=>703,10255=>703,10256=>703,10257=>703,10258=>703,10259=>703,10260=>703,10261=>703,10262=>703,10263=>703,10264=>703,10265=>703,10266=>703,10267=>703,10268=>703,10269=>703,10270=>703,10271=>703,10272=>703,10273=>703,10274=>703,10275=>703,10276=>703,10277=>703,10278=>703,10279=>703,10280=>703,10281=>703,10282=>703,10283=>703,10284=>703,10285=>703,10286=>703,10287=>703,10288=>703,10289=>703,10290=>703,10291=>703,10292=>703,10293=>703,10294=>703,10295=>703,10296=>703,10297=>703,10298=>703,10299=>703,10300=>703,10301=>703,10302=>703,10303=>703,10304=>703,10305=>703,10306=>703,10307=>703,10308=>703,10309=>703,10310=>703,10311=>703,10312=>703,10313=>703,10314=>703,10315=>703,10316=>703,10317=>703,10318=>703,10319=>703,10320=>703,10321=>703,10322=>703,10323=>703,10324=>703,10325=>703,10326=>703,10327=>703,10328=>703,10329=>703,10330=>703,10331=>703,10332=>703,10333=>703,10334=>703,10335=>703,10336=>703,10337=>703,10338=>703,10339=>703,10340=>703,10341=>703,10342=>703,10343=>703,10344=>703,10345=>703,10346=>703,10347=>703,10348=>703,10349=>703,10350=>703,10351=>703,10352=>703,10353=>703,10354=>703,10355=>703,10356=>703,10357=>703,10358=>703,10359=>703,10360=>703,10361=>703,10362=>703,10363=>703,10364=>703,10365=>703,10366=>703,10367=>703,10368=>703,10369=>703,10370=>703,10371=>703,10372=>703,10373=>703,10374=>703,10375=>703,10376=>703,10377=>703,10378=>703,10379=>703,10380=>703,10381=>703,10382=>703,10383=>703,10384=>703,10385=>703,10386=>703,10387=>703,10388=>703,10389=>703,10390=>703,10391=>703,10392=>703,10393=>703,10394=>703,10395=>703,10396=>703,10397=>703,10398=>703,10399=>703,10400=>703,10401=>703,10402=>703,10403=>703,10404=>703,10405=>703,10406=>703,10407=>703,10408=>703,10409=>703,10410=>703,10411=>703,10412=>703,10413=>703,10414=>703,10415=>703,10416=>703,10417=>703,10418=>703,10419=>703,10420=>703,10421=>703,10422=>703,10423=>703,10424=>703,10425=>703,10426=>703,10427=>703,10428=>703,10429=>703,10430=>703,10431=>703,10432=>703,10433=>703,10434=>703,10435=>703,10436=>703,10437=>703,10438=>703,10439=>703,10440=>703,10441=>703,10442=>703,10443=>703,10444=>703,10445=>703,10446=>703,10447=>703,10448=>703,10449=>703,10450=>703,10451=>703,10452=>703,10453=>703,10454=>703,10455=>703,10456=>703,10457=>703,10458=>703,10459=>703,10460=>703,10461=>703,10462=>703,10463=>703,10464=>703,10465=>703,10466=>703,10467=>703,10468=>703,10469=>703,10470=>703,10471=>703,10472=>703,10473=>703,10474=>703,10475=>703,10476=>703,10477=>703,10478=>703,10479=>703,10480=>703,10481=>703,10482=>703,10483=>703,10484=>703,10485=>703,10486=>703,10487=>703,10488=>703,10489=>703,10490=>703,10491=>703,10492=>703,10493=>703,10494=>703,10495=>703,10496=>754,10497=>754,10498=>754,10499=>754,10500=>754,10501=>754,10502=>754,10503=>754,10504=>754,10505=>754,10506=>754,10507=>754,10508=>754,10509=>754,10510=>754,10511=>754,10512=>754,10513=>754,10514=>754,10515=>754,10516=>754,10517=>754,10518=>754,10519=>754,10520=>754,10521=>754,10522=>754,10523=>754,10524=>754,10525=>754,10526=>754,10527=>754,10528=>754,10529=>754,10530=>754,10531=>754,10532=>754,10533=>754,10534=>754,10535=>754,10536=>754,10537=>754,10538=>754,10539=>754,10540=>754,10541=>754,10542=>754,10543=>754,10544=>754,10545=>754,10546=>754,10547=>754,10548=>754,10549=>754,10550=>754,10551=>754,10552=>754,10553=>754,10554=>754,10555=>754,10556=>754,10557=>754,10558=>754,10559=>754,10560=>754,10561=>754,10562=>754,10563=>754,10564=>754,10565=>754,10566=>754,10567=>754,10568=>754,10569=>754,10570=>754,10571=>754,10572=>754,10573=>754,10574=>754,10575=>754,10576=>754,10577=>754,10578=>754,10579=>754,10580=>754,10581=>754,10582=>754,10583=>754,10584=>754,10585=>754,10586=>754,10587=>754,10588=>754,10589=>754,10590=>754,10591=>754,10592=>754,10593=>754,10594=>754,10595=>754,10596=>754,10597=>754,10598=>754,10599=>754,10600=>754,10601=>754,10602=>754,10603=>754,10604=>754,10605=>754,10606=>754,10607=>754,10608=>754,10609=>754,10610=>754,10611=>754,10612=>754,10613=>754,10614=>754,10615=>929,10616=>754,10617=>754,10618=>864,10619=>754,10620=>754,10621=>754,10622=>754,10623=>754,10731=>444,10764=>1604,10765=>549,10766=>549,10799=>754,10858=>754,10859=>754,11008=>754,11009=>754,11010=>754,11011=>754,11012=>754,11013=>754,11014=>754,11015=>754,11016=>754,11017=>754,11018=>754,11019=>754,11020=>754,11021=>754,11022=>754,11023=>754,11024=>754,11025=>754,11026=>850,11027=>850,11028=>850,11029=>850,11030=>692,11031=>692,11032=>692,11033=>692,11034=>850,11360=>633,11361=>342,11363=>677,11364=>748,11367=>850,11368=>654,11369=>782,11370=>624,11371=>657,11372=>511,11373=>763,11374=>996,11375=>698,11376=>763,11377=>638,11378=>1099,11379=>886,11381=>701,11382=>519,11383=>814,11385=>514,11386=>600,11387=>555,11388=>282,11389=>439,11390=>650,11391=>657,11520=>695,11521=>571,11522=>723,11523=>592,11524=>708,11525=>866,11526=>680,11527=>864,11528=>555,11529=>581,11530=>866,11531=>567,11532=>581,11533=>866,11534=>761,11535=>779,11536=>865,11537=>580,11538=>580,11539=>863,11540=>851,11541=>777,11542=>580,11543=>581,11544=>580,11545=>584,11546=>619,11547=>842,11548=>883,11549=>613,11550=>608,11551=>766,11552=>1002,11553=>569,11554=>580,11555=>582,11556=>674,11557=>822,11800=>527,11807=>754,11810=>426,11811=>426,11812=>426,11813=>426,11822=>527,42564=>650,42565=>506,42566=>421,42567=>342,42576=>1200,42577=>976,42580=>1158,42581=>923,42582=>1158,42583=>926,42760=>450,42761=>450,42762=>450,42763=>450,42764=>450,42765=>450,42766=>450,42767=>450,42768=>450,42769=>450,42770=>450,42771=>450,42772=>450,42773=>450,42774=>450,42779=>346,42780=>346,42781=>249,42782=>249,42783=>249,42790=>850,42791=>641,42792=>903,42793=>817,42794=>626,42795=>548,42796=>570,42797=>538,42798=>667,42799=>635,42800=>533,42801=>506,42802=>1170,42803=>885,42804=>1134,42805=>886,42806=>1051,42807=>906,42808=>914,42809=>749,42810=>914,42811=>749,42812=>895,42813=>671,42814=>716,42815=>548,42816=>782,42817=>624,42822=>824,42823=>523,42826=>909,42827=>692,42830=>1303,42831=>954,42856=>708,42857=>644,42875=>625,42876=>474,42880=>633,42881=>342,42882=>785,42883=>654,42884=>625,42885=>474,42886=>716,42887=>548,42891=>395,42892=>275,42893=>822,42896=>822,42897=>730,42922=>850,43002=>961,43003=>639,43004=>677,43005=>996,43006=>421,43007=>1157,62464=>653,62465=>663,62466=>707,62467=>917,62468=>663,62469=>658,62470=>716,62471=>952,62472=>663,62473=>663,62474=>1196,62475=>679,62476=>678,62477=>922,62478=>663,62479=>678,62480=>963,62481=>736,62482=>783,62483=>737,62484=>914,62485=>677,62486=>907,62487=>677,62488=>684,62489=>678,62490=>720,62491=>678,62492=>684,62493=>664,62494=>721,62495=>860,62496=>663,62497=>762,62498=>664,62499=>663,62500=>663,62501=>714,62502=>930,62504=>813,63172=>342,63173=>600,63174=>629,63175=>654,63176=>952,63185=>450,63188=>450,64256=>744,64257=>654,64258=>654,64259=>998,64260=>1031,64261=>791,64262=>874,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1002,65535=>540);
// --- EOF ---
| mmaltmalt/mmaltmalt.github.io | hw7/tcpdf/fonts/dejavuserifcondensedbi.php | PHP | mit | 119,938 |
(function(){function t(t,n){var e=t.split("."),r=T;e[0]in r||!r.execScript||r.execScript("var "+e[0]);for(var i;e.length&&(i=e.shift());)e.length||void 0===n?r=r[i]?r[i]:r[i]={}:r[i]=n}function n(t,n){function e(){}e.prototype=n.prototype,t.M=n.prototype,t.prototype=new e,t.prototype.constructor=t,t.N=function(t,e,r){for(var i=Array(arguments.length-2),a=2;a<arguments.length;a++)i[a-2]=arguments[a];return n.prototype[e].apply(t,i)}}function e(t,n){null!=t&&this.a.apply(this,arguments)}function r(t){t.b=""}function i(t,n){t.sort(n||a)}function a(t,n){return t>n?1:n>t?-1:0}function l(t){var n,e=[],r=0;for(n in t)e[r++]=t[n];return e}function u(t,n){this.b=t,this.a={};for(var e=0;e<n.length;e++){var r=n[e];this.a[r.b]=r}}function o(t){return t=l(t.a),i(t,function(t,n){return t.b-n.b}),t}function s(t,n){switch(this.b=t,this.g=!!n.G,this.a=n.c,this.j=n.type,this.h=!1,this.a){case k:case J:case K:case L:case O:case Y:case U:this.h=!0}this.f=n.defaultValue}function f(){this.a={},this.f=this.i().a,this.b=this.g=null}function c(t,n){for(var e=o(t.i()),r=0;r<e.length;r++){var i=e[r],a=i.b;if(null!=n.a[a]){t.b&&delete t.b[i.b];var l=11==i.a||10==i.a;if(i.g)for(var i=p(n,a)||[],u=0;u<i.length;u++){var s=t,f=a,h=l?i[u].clone():i[u];s.a[f]||(s.a[f]=[]),s.a[f].push(h),s.b&&delete s.b[f]}else i=p(n,a),l?(l=p(t,a))?c(l,i):b(t,a,i.clone()):b(t,a,i)}}}function p(t,n){var e=t.a[n];if(null==e)return null;if(t.g){if(!(n in t.b)){var r=t.g,i=t.f[n];if(null!=e)if(i.g){for(var a=[],l=0;l<e.length;l++)a[l]=r.b(i,e[l]);e=a}else e=r.b(i,e);return t.b[n]=e}return t.b[n]}return e}function h(t,n,e){var r=p(t,n);return t.f[n].g?r[e||0]:r}function g(t,n){var e;if(null!=t.a[n])e=h(t,n,void 0);else t:{if(e=t.f[n],void 0===e.f){var r=e.j;if(r===Boolean)e.f=!1;else if(r===Number)e.f=0;else{if(r!==String){e=new r;break t}e.f=e.h?"0":""}}e=e.f}return e}function m(t,n){return t.f[n].g?null!=t.a[n]?t.a[n].length:0:null!=t.a[n]?1:0}function b(t,n,e){t.a[n]=e,t.b&&(t.b[n]=e)}function d(t,n){var e,r=[];for(e in n)0!=e&&r.push(new s(e,n[e]));return new u(t,r)}/*
Protocol Buffer 2 Copyright 2008 Google Inc.
All other code copyright its respective owners.
Copyright (C) 2010 The Libphonenumber Authors
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
function y(){f.call(this)}function v(){f.call(this)}function _(){f.call(this)}function $(){}function S(){}function w(){}/*
Copyright (C) 2010 The Libphonenumber Authors.
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
function x(){this.a={}}function A(t,n){if(null==n)return null;n=n.toUpperCase();var e=t.a[n];if(null==e){if(e=tt[n],null==e)return null;e=(new w).a(_.i(),e),t.a[n]=e}return e}function N(t){return t=X[t],null==t?"ZZ":t[0]}function j(t){this.H=RegExp(" "),this.B="",this.m=new e,this.v="",this.h=new e,this.u=new e,this.j=!0,this.w=this.o=this.D=!1,this.F=x.b(),this.s=0,this.b=new e,this.A=!1,this.l="",this.a=new e,this.f=[],this.C=t,this.J=this.g=R(this,this.C)}function R(t,n){var e;if(null!=n&&isNaN(n)&&n.toUpperCase()in tt){if(e=A(t.F,n),null==e)throw"Invalid region code: "+n;e=g(e,10)}else e=0;return e=A(t.F,N(e)),null!=e?e:at}function E(t){for(var n=t.f.length,e=0;n>e;++e){var i=t.f[e],a=g(i,1);if(t.v==a)return!1;var l;l=t;var u=i,o=g(u,1);if(-1!=o.indexOf("|"))l=!1;else{o=o.replace(lt,"\\d"),o=o.replace(ut,"\\d"),r(l.m);var s;s=l;var u=g(u,2),f="999999999999999".match(o)[0];f.length<s.a.b.length?s="":(s=f.replace(new RegExp(o,"g"),u),s=s.replace(RegExp("9","g")," ")),0<s.length?(l.m.a(s),l=!0):l=!1}if(l)return t.v=a,t.A=st.test(h(i,4)),t.s=0,!0}return t.j=!1}function C(t,n){for(var e=[],r=n.length-3,i=t.f.length,a=0;i>a;++a){var l=t.f[a];0==m(l,3)?e.push(t.f[a]):(l=h(l,3,Math.min(r,m(l,3)-1)),0==n.search(l)&&e.push(t.f[a]))}t.f=e}function F(t,n){t.h.a(n);var e=n;if(rt.test(e)||1==t.h.b.length&&et.test(e)){var i,e=n;"+"==e?(i=e,t.u.a(e)):(i=nt[e],t.u.a(i),t.a.a(i)),n=i}else t.j=!1,t.D=!0;if(!t.j){if(!t.D)if(P(t)){if(V(t))return B(t)}else if(0<t.l.length&&(e=t.a.toString(),r(t.a),t.a.a(t.l),t.a.a(e),e=t.b.toString(),i=e.lastIndexOf(t.l),r(t.b),t.b.a(e.substring(0,i))),t.l!=G(t))return t.b.a(" "),B(t);return t.h.toString()}switch(t.u.b.length){case 0:case 1:case 2:return t.h.toString();case 3:if(!P(t))return t.l=G(t),H(t);t.w=!0;default:return t.w?(V(t)&&(t.w=!1),t.b.toString()+t.a.toString()):0<t.f.length?(e=q(t,n),i=I(t),0<i.length?i:(C(t,t.a.toString()),E(t)?M(t):t.j?D(t,e):t.h.toString())):H(t)}}function B(t){return t.j=!0,t.w=!1,t.f=[],t.s=0,r(t.m),t.v="",H(t)}function I(t){for(var n=t.a.toString(),e=t.f.length,r=0;e>r;++r){var i=t.f[r],a=g(i,1);if(new RegExp("^(?:"+a+")$").test(n))return t.A=st.test(h(i,4)),n=n.replace(new RegExp(a,"g"),h(i,2)),D(t,n)}return""}function D(t,n){var e=t.b.b.length;return t.A&&e>0&&" "!=t.b.toString().charAt(e-1)?t.b+" "+n:t.b+n}function H(t){var n=t.a.toString();if(3<=n.length){for(var e=t.o&&0<m(t.g,20)?p(t.g,20)||[]:p(t.g,19)||[],r=e.length,i=0;r>i;++i){var a,l=e[i];(a=null==t.g.a[12]||t.o||h(l,6))||(a=g(l,4),a=0==a.length||it.test(a)),a&&ot.test(g(l,2))&&t.f.push(l)}return C(t,n),n=I(t),0<n.length?n:E(t)?M(t):t.h.toString()}return D(t,n)}function M(t){var n=t.a.toString(),e=n.length;if(e>0){for(var r="",i=0;e>i;i++)r=q(t,n.charAt(i));return t.j?D(t,r):t.h.toString()}return t.b.toString()}function G(t){var n,e=t.a.toString(),i=0;return 1!=h(t.g,10)?n=!1:(n=t.a.toString(),n="1"==n.charAt(0)&&"0"!=n.charAt(1)&&"1"!=n.charAt(1)),n?(i=1,t.b.a("1").a(" "),t.o=!0):null!=t.g.a[15]&&(n=new RegExp("^(?:"+h(t.g,15)+")"),n=e.match(n),null!=n&&null!=n[0]&&0<n[0].length&&(t.o=!0,i=n[0].length,t.b.a(e.substring(0,i)))),r(t.a),t.a.a(e.substring(i)),e.substring(0,i)}function P(t){var n=t.u.toString(),e=new RegExp("^(?:\\+|"+h(t.g,11)+")"),e=n.match(e);return null!=e&&null!=e[0]&&0<e[0].length?(t.o=!0,e=e[0].length,r(t.a),t.a.a(n.substring(e)),r(t.b),t.b.a(n.substring(0,e)),"+"!=n.charAt(0)&&t.b.a(" "),!0):!1}function V(t){if(0==t.a.b.length)return!1;var n,i=new e;t:{if(n=t.a.toString(),0!=n.length&&"0"!=n.charAt(0))for(var a,l=n.length,u=1;3>=u&&l>=u;++u)if(a=parseInt(n.substring(0,u),10),a in X){i.a(n.substring(u)),n=a;break t}n=0}return 0==n?!1:(r(t.a),t.a.a(i.toString()),i=N(n),"001"==i?t.g=A(t.F,""+n):i!=t.C&&(t.g=R(t,i)),t.b.a(""+n).a(" "),t.l="",!0)}function q(t,n){var e=t.m.toString();if(0<=e.substring(t.s).search(t.H)){var i=e.search(t.H),e=e.replace(t.H,n);return r(t.m),t.m.a(e),t.s=i,e.substring(0,t.s+1)}return 1==t.f.length&&(t.j=!1),t.v="",t.h.toString()}var T=this;e.prototype.b="",e.prototype.set=function(t){this.b=""+t},e.prototype.a=function(t,n,e){if(this.b+=String(t),null!=n)for(var r=1;r<arguments.length;r++)this.b+=arguments[r];return this},e.prototype.toString=function(){return this.b};var U=1,Y=2,k=3,J=4,K=6,L=16,O=18;f.prototype.set=function(t,n){b(this,t.b,n)},f.prototype.clone=function(){var t=new this.constructor;return t!=this&&(t.a={},t.b&&(t.b={}),c(t,this)),t};var Z;n(y,f);var z;n(v,f);var Q;n(_,f),y.prototype.i=function(){return Z||(Z=d(y,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",G:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),Z},y.ctor=y,y.ctor.i=y.prototype.i,v.prototype.i=function(){return z||(z=d(v,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},3:{name:"possible_number_pattern",c:9,type:String},6:{name:"example_number",c:9,type:String},7:{name:"national_number_matcher_data",c:12,type:String},8:{name:"possible_number_matcher_data",c:12,type:String}})),z},v.ctor=v,v.ctor.i=v.prototype.i,_.prototype.i=function(){return Q||(Q=d(_,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:v},2:{name:"fixed_line",c:11,type:v},3:{name:"mobile",c:11,type:v},4:{name:"toll_free",c:11,type:v},5:{name:"premium_rate",c:11,type:v},6:{name:"shared_cost",c:11,type:v},7:{name:"personal_number",c:11,type:v},8:{name:"voip",c:11,type:v},21:{name:"pager",c:11,type:v},25:{name:"uan",c:11,type:v},27:{name:"emergency",c:11,type:v},28:{name:"voicemail",c:11,type:v},24:{name:"no_international_dialling",c:11,type:v},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",G:!0,c:11,type:y},20:{name:"intl_number_format",G:!0,c:11,type:y},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),Q},_.ctor=_,_.ctor.i=_.prototype.i,$.prototype.a=function(t){throw new t.b,Error("Unimplemented")},$.prototype.b=function(t,n){if(11==t.a||10==t.a)return n instanceof f?n:this.a(t.j.prototype.i(),n);if(14==t.a){if("string"==typeof n&&W.test(n)){var e=Number(n);if(e>0)return e}return n}if(!t.h)return n;if(e=t.j,e===String){if("number"==typeof n)return String(n)}else if(e===Number&&"string"==typeof n&&("Infinity"===n||"-Infinity"===n||"NaN"===n||W.test(n)))return Number(n);return n};var W=/^-?[0-9]+$/;n(S,$),S.prototype.a=function(t,n){var e=new t.b;return e.g=this,e.a=n,e.b={},e},n(w,S),w.prototype.b=function(t,n){return 8==t.a?!!n:$.prototype.b.apply(this,arguments)},w.prototype.a=function(t,n){return w.M.a.call(this,t,n)};/*
Copyright (C) 2010 The Libphonenumber Authors
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var X={385:["HR"]},tt={HR:[null,[null,null,"[1-7]\\d{5,8}|[89]\\d{6,11}","\\d{6,12}"],[null,null,"1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}","\\d{6,9}",null,null,"12345678"],[null,null,"9(?:[1-9]\\d{6,10}|01\\d{6,9})","\\d{8,12}",null,null,"912345678"],[null,null,"80[01]\\d{4,7}","\\d{7,10}",null,null,"8001234567"],[null,null,"6(?:[01459]\\d{4,7})","\\d{6,9}",null,null,"611234"],[null,null,"NA","NA"],[null,null,"7[45]\\d{4,7}","\\d{6,9}",null,null,"741234567"],[null,null,"NA","NA"],"HR",385,"00","0",null,null,"0",null,null,null,[[null,"(1)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],[null,"(6[09])(\\d{4})(\\d{3})","$1 $2 $3",["6[09]"],"0$1"],[null,"([67]2)(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]2"],"0$1"],[null,"([2-5]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],[null,"(9\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],[null,"(9\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1"],[null,"(9\\d)(\\d{3,4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"],"0$1"],[null,"(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[0145]|7"],"0$1"],[null,"(\\d{2})(\\d{3,4})(\\d{3})","$1 $2 $3",["6[0145]|7"],"0$1"],[null,"(80[01])(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],[null,"(80[01])(\\d{3,4})(\\d{3})","$1 $2 $3",["8"],"0$1"]],null,[null,null,"NA","NA"],null,null,[null,null,"NA","NA"],[null,null,"[76]2\\d{6,7}","\\d{8,9}",null,null,"62123456"],null,null,[null,null,"NA","NA"]]};x.b=function(){return x.a?x.a:x.a=new x};var nt={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"},et=RegExp("[++]+"),rt=RegExp("([0-90-9٠-٩۰-۹])"),it=/^\(?\$1\)?$/,at=new _;b(at,11,"NA");var lt=/\[([^\[\]])*\]/g,ut=/\d(?=[^,}][^,}])/g,ot=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),st=/[- ]/;j.prototype.K=function(){this.B="",r(this.h),r(this.u),r(this.m),this.s=0,this.v="",r(this.b),this.l="",r(this.a),this.j=!0,this.w=this.o=this.D=!1,this.f=[],this.A=!1,this.g!=this.J&&(this.g=R(this,this.C))},j.prototype.L=function(t){return this.B=F(this,t)},t("Cleave.AsYouTypeFormatter",j),t("Cleave.AsYouTypeFormatter.prototype.inputDigit",j.prototype.L),t("Cleave.AsYouTypeFormatter.prototype.clear",j.prototype.K)}).call(window); | joeyparrish/cdnjs | ajax/libs/cleave.js/0.4.7/addons/cleave-phone.hr.js | JavaScript | mit | 13,893 |
(function(){function t(t,n){var e=t.split("."),r=T;e[0]in r||!r.execScript||r.execScript("var "+e[0]);for(var i;e.length&&(i=e.shift());)e.length||void 0===n?r=r[i]?r[i]:r[i]={}:r[i]=n}function n(t,n){function e(){}e.prototype=n.prototype,t.M=n.prototype,t.prototype=new e,t.prototype.constructor=t,t.N=function(t,e,r){for(var i=Array(arguments.length-2),a=2;a<arguments.length;a++)i[a-2]=arguments[a];return n.prototype[e].apply(t,i)}}function e(t,n){null!=t&&this.a.apply(this,arguments)}function r(t){t.b=""}function i(t,n){t.sort(n||a)}function a(t,n){return t>n?1:n>t?-1:0}function l(t){var n,e=[],r=0;for(n in t)e[r++]=t[n];return e}function o(t,n){this.b=t,this.a={};for(var e=0;e<n.length;e++){var r=n[e];this.a[r.b]=r}}function u(t){return t=l(t.a),i(t,function(t,n){return t.b-n.b}),t}function s(t,n){switch(this.b=t,this.g=!!n.G,this.a=n.c,this.j=n.type,this.h=!1,this.a){case k:case J:case K:case L:case O:case Y:case U:this.h=!0}this.f=n.defaultValue}function f(){this.a={},this.f=this.i().a,this.b=this.g=null}function c(t,n){for(var e=u(t.i()),r=0;r<e.length;r++){var i=e[r],a=i.b;if(null!=n.a[a]){t.b&&delete t.b[i.b];var l=11==i.a||10==i.a;if(i.g)for(var i=p(n,a)||[],o=0;o<i.length;o++){var s=t,f=a,h=l?i[o].clone():i[o];s.a[f]||(s.a[f]=[]),s.a[f].push(h),s.b&&delete s.b[f]}else i=p(n,a),l?(l=p(t,a))?c(l,i):b(t,a,i.clone()):b(t,a,i)}}}function p(t,n){var e=t.a[n];if(null==e)return null;if(t.g){if(!(n in t.b)){var r=t.g,i=t.f[n];if(null!=e)if(i.g){for(var a=[],l=0;l<e.length;l++)a[l]=r.b(i,e[l]);e=a}else e=r.b(i,e);return t.b[n]=e}return t.b[n]}return e}function h(t,n,e){var r=p(t,n);return t.f[n].g?r[e||0]:r}function g(t,n){var e;if(null!=t.a[n])e=h(t,n,void 0);else t:{if(e=t.f[n],void 0===e.f){var r=e.j;if(r===Boolean)e.f=!1;else if(r===Number)e.f=0;else{if(r!==String){e=new r;break t}e.f=e.h?"0":""}}e=e.f}return e}function m(t,n){return t.f[n].g?null!=t.a[n]?t.a[n].length:0:null!=t.a[n]?1:0}function b(t,n,e){t.a[n]=e,t.b&&(t.b[n]=e)}function y(t,n){var e,r=[];for(e in n)0!=e&&r.push(new s(e,n[e]));return new o(t,r)}/*
Protocol Buffer 2 Copyright 2008 Google Inc.
All other code copyright its respective owners.
Copyright (C) 2010 The Libphonenumber Authors
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
function v(){f.call(this)}function d(){f.call(this)}function _(){f.call(this)}function S(){}function w(){}function A(){}/*
Copyright (C) 2010 The Libphonenumber Authors.
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
function x(){this.a={}}function N(t,n){if(null==n)return null;n=n.toUpperCase();var e=t.a[n];if(null==e){if(e=tt[n],null==e)return null;e=(new A).a(_.i(),e),t.a[n]=e}return e}function j(t){return t=X[t],null==t?"ZZ":t[0]}function E(t){this.H=RegExp(" "),this.B="",this.m=new e,this.v="",this.h=new e,this.u=new e,this.j=!0,this.w=this.o=this.D=!1,this.F=x.b(),this.s=0,this.b=new e,this.A=!1,this.l="",this.a=new e,this.f=[],this.C=t,this.J=this.g=I(this,this.C)}function I(t,n){var e;if(null!=n&&isNaN(n)&&n.toUpperCase()in tt){if(e=N(t.F,n),null==e)throw"Invalid region code: "+n;e=g(e,10)}else e=0;return e=N(t.F,j(e)),null!=e?e:at}function R(t){for(var n=t.f.length,e=0;n>e;++e){var i=t.f[e],a=g(i,1);if(t.v==a)return!1;var l;l=t;var o=i,u=g(o,1);if(-1!=u.indexOf("|"))l=!1;else{u=u.replace(lt,"\\d"),u=u.replace(ot,"\\d"),r(l.m);var s;s=l;var o=g(o,2),f="999999999999999".match(u)[0];f.length<s.a.b.length?s="":(s=f.replace(new RegExp(u,"g"),o),s=s.replace(RegExp("9","g")," ")),0<s.length?(l.m.a(s),l=!0):l=!1}if(l)return t.v=a,t.A=st.test(h(i,4)),t.s=0,!0}return t.j=!1}function C(t,n){for(var e=[],r=n.length-3,i=t.f.length,a=0;i>a;++a){var l=t.f[a];0==m(l,3)?e.push(t.f[a]):(l=h(l,3,Math.min(r,m(l,3)-1)),0==n.search(l)&&e.push(t.f[a]))}t.f=e}function F(t,n){t.h.a(n);var e=n;if(rt.test(e)||1==t.h.b.length&&et.test(e)){var i,e=n;"+"==e?(i=e,t.u.a(e)):(i=nt[e],t.u.a(i),t.a.a(i)),n=i}else t.j=!1,t.D=!0;if(!t.j){if(!t.D)if(P(t)){if(V(t))return B(t)}else if(0<t.l.length&&(e=t.a.toString(),r(t.a),t.a.a(t.l),t.a.a(e),e=t.b.toString(),i=e.lastIndexOf(t.l),r(t.b),t.b.a(e.substring(0,i))),t.l!=H(t))return t.b.a(" "),B(t);return t.h.toString()}switch(t.u.b.length){case 0:case 1:case 2:return t.h.toString();case 3:if(!P(t))return t.l=H(t),G(t);t.w=!0;default:return t.w?(V(t)&&(t.w=!1),t.b.toString()+t.a.toString()):0<t.f.length?(e=q(t,n),i=$(t),0<i.length?i:(C(t,t.a.toString()),R(t)?M(t):t.j?D(t,e):t.h.toString())):G(t)}}function B(t){return t.j=!0,t.w=!1,t.f=[],t.s=0,r(t.m),t.v="",G(t)}function $(t){for(var n=t.a.toString(),e=t.f.length,r=0;e>r;++r){var i=t.f[r],a=g(i,1);if(new RegExp("^(?:"+a+")$").test(n))return t.A=st.test(h(i,4)),n=n.replace(new RegExp(a,"g"),h(i,2)),D(t,n)}return""}function D(t,n){var e=t.b.b.length;return t.A&&e>0&&" "!=t.b.toString().charAt(e-1)?t.b+" "+n:t.b+n}function G(t){var n=t.a.toString();if(3<=n.length){for(var e=t.o&&0<m(t.g,20)?p(t.g,20)||[]:p(t.g,19)||[],r=e.length,i=0;r>i;++i){var a,l=e[i];(a=null==t.g.a[12]||t.o||h(l,6))||(a=g(l,4),a=0==a.length||it.test(a)),a&&ut.test(g(l,2))&&t.f.push(l)}return C(t,n),n=$(t),0<n.length?n:R(t)?M(t):t.h.toString()}return D(t,n)}function M(t){var n=t.a.toString(),e=n.length;if(e>0){for(var r="",i=0;e>i;i++)r=q(t,n.charAt(i));return t.j?D(t,r):t.h.toString()}return t.b.toString()}function H(t){var n,e=t.a.toString(),i=0;return 1!=h(t.g,10)?n=!1:(n=t.a.toString(),n="1"==n.charAt(0)&&"0"!=n.charAt(1)&&"1"!=n.charAt(1)),n?(i=1,t.b.a("1").a(" "),t.o=!0):null!=t.g.a[15]&&(n=new RegExp("^(?:"+h(t.g,15)+")"),n=e.match(n),null!=n&&null!=n[0]&&0<n[0].length&&(t.o=!0,i=n[0].length,t.b.a(e.substring(0,i)))),r(t.a),t.a.a(e.substring(i)),e.substring(0,i)}function P(t){var n=t.u.toString(),e=new RegExp("^(?:\\+|"+h(t.g,11)+")"),e=n.match(e);return null!=e&&null!=e[0]&&0<e[0].length?(t.o=!0,e=e[0].length,r(t.a),t.a.a(n.substring(e)),r(t.b),t.b.a(n.substring(0,e)),"+"!=n.charAt(0)&&t.b.a(" "),!0):!1}function V(t){if(0==t.a.b.length)return!1;var n,i=new e;t:{if(n=t.a.toString(),0!=n.length&&"0"!=n.charAt(0))for(var a,l=n.length,o=1;3>=o&&l>=o;++o)if(a=parseInt(n.substring(0,o),10),a in X){i.a(n.substring(o)),n=a;break t}n=0}return 0==n?!1:(r(t.a),t.a.a(i.toString()),i=j(n),"001"==i?t.g=N(t.F,""+n):i!=t.C&&(t.g=I(t,i)),t.b.a(""+n).a(" "),t.l="",!0)}function q(t,n){var e=t.m.toString();if(0<=e.substring(t.s).search(t.H)){var i=e.search(t.H),e=e.replace(t.H,n);return r(t.m),t.m.a(e),t.s=i,e.substring(0,t.s+1)}return 1==t.f.length&&(t.j=!1),t.v="",t.h.toString()}var T=this;e.prototype.b="",e.prototype.set=function(t){this.b=""+t},e.prototype.a=function(t,n,e){if(this.b+=String(t),null!=n)for(var r=1;r<arguments.length;r++)this.b+=arguments[r];return this},e.prototype.toString=function(){return this.b};var U=1,Y=2,k=3,J=4,K=6,L=16,O=18;f.prototype.set=function(t,n){b(this,t.b,n)},f.prototype.clone=function(){var t=new this.constructor;return t!=this&&(t.a={},t.b&&(t.b={}),c(t,this)),t};var Z;n(v,f);var z;n(d,f);var Q;n(_,f),v.prototype.i=function(){return Z||(Z=y(v,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",G:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),Z},v.ctor=v,v.ctor.i=v.prototype.i,d.prototype.i=function(){return z||(z=y(d,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},3:{name:"possible_number_pattern",c:9,type:String},6:{name:"example_number",c:9,type:String},7:{name:"national_number_matcher_data",c:12,type:String},8:{name:"possible_number_matcher_data",c:12,type:String}})),z},d.ctor=d,d.ctor.i=d.prototype.i,_.prototype.i=function(){return Q||(Q=y(_,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:d},2:{name:"fixed_line",c:11,type:d},3:{name:"mobile",c:11,type:d},4:{name:"toll_free",c:11,type:d},5:{name:"premium_rate",c:11,type:d},6:{name:"shared_cost",c:11,type:d},7:{name:"personal_number",c:11,type:d},8:{name:"voip",c:11,type:d},21:{name:"pager",c:11,type:d},25:{name:"uan",c:11,type:d},27:{name:"emergency",c:11,type:d},28:{name:"voicemail",c:11,type:d},24:{name:"no_international_dialling",c:11,type:d},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",G:!0,c:11,type:v},20:{name:"intl_number_format",G:!0,c:11,type:v},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),Q},_.ctor=_,_.ctor.i=_.prototype.i,S.prototype.a=function(t){throw new t.b,Error("Unimplemented")},S.prototype.b=function(t,n){if(11==t.a||10==t.a)return n instanceof f?n:this.a(t.j.prototype.i(),n);if(14==t.a){if("string"==typeof n&&W.test(n)){var e=Number(n);if(e>0)return e}return n}if(!t.h)return n;if(e=t.j,e===String){if("number"==typeof n)return String(n)}else if(e===Number&&"string"==typeof n&&("Infinity"===n||"-Infinity"===n||"NaN"===n||W.test(n)))return Number(n);return n};var W=/^-?[0-9]+$/;n(w,S),w.prototype.a=function(t,n){var e=new t.b;return e.g=this,e.a=n,e.b={},e},n(A,w),A.prototype.b=function(t,n){return 8==t.a?!!n:S.prototype.b.apply(this,arguments)},A.prototype.a=function(t,n){return A.M.a.call(this,t,n)};/*
Copyright (C) 2010 The Libphonenumber Authors
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var X={350:["GI"]},tt={GI:[null,[null,null,"[2568]\\d{7}","\\d{8}"],[null,null,"2(?:00\\d|1(?:6[24-7]|9\\d)|2(?:00|2[2457]))\\d{4}","\\d{8}",null,null,"20012345"],[null,null,"(?:5[46-8]|62)\\d{6}","\\d{8}",null,null,"57123456"],[null,null,"80\\d{6}","\\d{8}",null,null,"80123456"],[null,null,"8[1-689]\\d{6}","\\d{8}",null,null,"88123456"],[null,null,"87\\d{6}","\\d{8}",null,null,"87123456"],[null,null,"NA","NA"],[null,null,"NA","NA"],"GI",350,"00",null,null,null,null,null,null,null,[[null,"(\\d{3})(\\d{5})","$1 $2",["2"]]],null,[null,null,"NA","NA"],null,null,[null,null,"NA","NA"],[null,null,"NA","NA"],null,null,[null,null,"NA","NA"]]};x.b=function(){return x.a?x.a:x.a=new x};var nt={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"},et=RegExp("[++]+"),rt=RegExp("([0-90-9٠-٩۰-۹])"),it=/^\(?\$1\)?$/,at=new _;b(at,11,"NA");var lt=/\[([^\[\]])*\]/g,ot=/\d(?=[^,}][^,}])/g,ut=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),st=/[- ]/;E.prototype.K=function(){this.B="",r(this.h),r(this.u),r(this.m),this.s=0,this.v="",r(this.b),this.l="",r(this.a),this.j=!0,this.w=this.o=this.D=!1,this.f=[],this.A=!1,this.g!=this.J&&(this.g=I(this,this.C))},E.prototype.L=function(t){return this.B=F(this,t)},t("Cleave.AsYouTypeFormatter",E),t("Cleave.AsYouTypeFormatter.prototype.inputDigit",E.prototype.L),t("Cleave.AsYouTypeFormatter.prototype.clear",E.prototype.K)}).call(window); | cdnjs/cdnjs | ajax/libs/cleave.js/0.5.1/addons/cleave-phone.gi.js | JavaScript | mit | 13,166 |
(function(){function t(t,n){var e=t.split("."),r=q;e[0]in r||!r.execScript||r.execScript("var "+e[0]);for(var i;e.length&&(i=e.shift());)e.length||void 0===n?r=r[i]?r[i]:r[i]={}:r[i]=n}function n(t,n){function e(){}e.prototype=n.prototype,t.M=n.prototype,t.prototype=new e,t.prototype.constructor=t,t.N=function(t,e,r){for(var i=Array(arguments.length-2),a=2;a<arguments.length;a++)i[a-2]=arguments[a];return n.prototype[e].apply(t,i)}}function e(t,n){null!=t&&this.a.apply(this,arguments)}function r(t){t.b=""}function i(t,n){t.sort(n||a)}function a(t,n){return t>n?1:n>t?-1:0}function l(t){var n,e=[],r=0;for(n in t)e[r++]=t[n];return e}function o(t,n){this.b=t,this.a={};for(var e=0;e<n.length;e++){var r=n[e];this.a[r.b]=r}}function u(t){return t=l(t.a),i(t,function(t,n){return t.b-n.b}),t}function s(t,n){switch(this.b=t,this.g=!!n.G,this.a=n.c,this.j=n.type,this.h=!1,this.a){case Y:case k:case J:case K:case L:case U:case T:this.h=!0}this.f=n.defaultValue}function f(){this.a={},this.f=this.i().a,this.b=this.g=null}function c(t,n){for(var e=u(t.i()),r=0;r<e.length;r++){var i=e[r],a=i.b;if(null!=n.a[a]){t.b&&delete t.b[i.b];var l=11==i.a||10==i.a;if(i.g)for(var i=p(n,a)||[],o=0;o<i.length;o++){var s=t,f=a,h=l?i[o].clone():i[o];s.a[f]||(s.a[f]=[]),s.a[f].push(h),s.b&&delete s.b[f]}else i=p(n,a),l?(l=p(t,a))?c(l,i):b(t,a,i.clone()):b(t,a,i)}}}function p(t,n){var e=t.a[n];if(null==e)return null;if(t.g){if(!(n in t.b)){var r=t.g,i=t.f[n];if(null!=e)if(i.g){for(var a=[],l=0;l<e.length;l++)a[l]=r.b(i,e[l]);e=a}else e=r.b(i,e);return t.b[n]=e}return t.b[n]}return e}function h(t,n,e){var r=p(t,n);return t.f[n].g?r[e||0]:r}function g(t,n){var e;if(null!=t.a[n])e=h(t,n,void 0);else t:{if(e=t.f[n],void 0===e.f){var r=e.j;if(r===Boolean)e.f=!1;else if(r===Number)e.f=0;else{if(r!==String){e=new r;break t}e.f=e.h?"0":""}}e=e.f}return e}function m(t,n){return t.f[n].g?null!=t.a[n]?t.a[n].length:0:null!=t.a[n]?1:0}function b(t,n,e){t.a[n]=e,t.b&&(t.b[n]=e)}function y(t,n){var e,r=[];for(e in n)0!=e&&r.push(new s(e,n[e]));return new o(t,r)}/*
Protocol Buffer 2 Copyright 2008 Google Inc.
All other code copyright its respective owners.
Copyright (C) 2010 The Libphonenumber Authors
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
function v(){f.call(this)}function d(){f.call(this)}function _(){f.call(this)}function S(){}function w(){}function A(){}/*
Copyright (C) 2010 The Libphonenumber Authors.
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
function N(){this.a={}}function x(t,n){if(null==n)return null;n=n.toUpperCase();var e=t.a[n];if(null==e){if(e=tt[n],null==e)return null;e=(new A).a(_.i(),e),t.a[n]=e}return e}function j(t){return t=X[t],null==t?"ZZ":t[0]}function $(t){this.H=RegExp(" "),this.B="",this.m=new e,this.v="",this.h=new e,this.u=new e,this.j=!0,this.w=this.o=this.D=!1,this.F=N.b(),this.s=0,this.b=new e,this.A=!1,this.l="",this.a=new e,this.f=[],this.C=t,this.J=this.g=E(this,this.C)}function E(t,n){var e;if(null!=n&&isNaN(n)&&n.toUpperCase()in tt){if(e=x(t.F,n),null==e)throw"Invalid region code: "+n;e=g(e,10)}else e=0;return e=x(t.F,j(e)),null!=e?e:at}function R(t){for(var n=t.f.length,e=0;n>e;++e){var i=t.f[e],a=g(i,1);if(t.v==a)return!1;var l;l=t;var o=i,u=g(o,1);if(-1!=u.indexOf("|"))l=!1;else{u=u.replace(lt,"\\d"),u=u.replace(ot,"\\d"),r(l.m);var s;s=l;var o=g(o,2),f="999999999999999".match(u)[0];f.length<s.a.b.length?s="":(s=f.replace(new RegExp(u,"g"),o),s=s.replace(RegExp("9","g")," ")),0<s.length?(l.m.a(s),l=!0):l=!1}if(l)return t.v=a,t.A=st.test(h(i,4)),t.s=0,!0}return t.j=!1}function C(t,n){for(var e=[],r=n.length-3,i=t.f.length,a=0;i>a;++a){var l=t.f[a];0==m(l,3)?e.push(t.f[a]):(l=h(l,3,Math.min(r,m(l,3)-1)),0==n.search(l)&&e.push(t.f[a]))}t.f=e}function F(t,n){t.h.a(n);var e=n;if(rt.test(e)||1==t.h.b.length&&et.test(e)){var i,e=n;"+"==e?(i=e,t.u.a(e)):(i=nt[e],t.u.a(i),t.a.a(i)),n=i}else t.j=!1,t.D=!0;if(!t.j){if(!t.D)if(H(t)){if(P(t))return B(t)}else if(0<t.l.length&&(e=t.a.toString(),r(t.a),t.a.a(t.l),t.a.a(e),e=t.b.toString(),i=e.lastIndexOf(t.l),r(t.b),t.b.a(e.substring(0,i))),t.l!=G(t))return t.b.a(" "),B(t);return t.h.toString()}switch(t.u.b.length){case 0:case 1:case 2:return t.h.toString();case 3:if(!H(t))return t.l=G(t),D(t);t.w=!0;default:return t.w?(P(t)&&(t.w=!1),t.b.toString()+t.a.toString()):0<t.f.length?(e=V(t,n),i=I(t),0<i.length?i:(C(t,t.a.toString()),R(t)?Z(t):t.j?M(t,e):t.h.toString())):D(t)}}function B(t){return t.j=!0,t.w=!1,t.f=[],t.s=0,r(t.m),t.v="",D(t)}function I(t){for(var n=t.a.toString(),e=t.f.length,r=0;e>r;++r){var i=t.f[r],a=g(i,1);if(new RegExp("^(?:"+a+")$").test(n))return t.A=st.test(h(i,4)),n=n.replace(new RegExp(a,"g"),h(i,2)),M(t,n)}return""}function M(t,n){var e=t.b.b.length;return t.A&&e>0&&" "!=t.b.toString().charAt(e-1)?t.b+" "+n:t.b+n}function D(t){var n=t.a.toString();if(3<=n.length){for(var e=t.o&&0<m(t.g,20)?p(t.g,20)||[]:p(t.g,19)||[],r=e.length,i=0;r>i;++i){var a,l=e[i];(a=null==t.g.a[12]||t.o||h(l,6))||(a=g(l,4),a=0==a.length||it.test(a)),a&&ut.test(g(l,2))&&t.f.push(l)}return C(t,n),n=I(t),0<n.length?n:R(t)?Z(t):t.h.toString()}return M(t,n)}function Z(t){var n=t.a.toString(),e=n.length;if(e>0){for(var r="",i=0;e>i;i++)r=V(t,n.charAt(i));return t.j?M(t,r):t.h.toString()}return t.b.toString()}function G(t){var n,e=t.a.toString(),i=0;return 1!=h(t.g,10)?n=!1:(n=t.a.toString(),n="1"==n.charAt(0)&&"0"!=n.charAt(1)&&"1"!=n.charAt(1)),n?(i=1,t.b.a("1").a(" "),t.o=!0):null!=t.g.a[15]&&(n=new RegExp("^(?:"+h(t.g,15)+")"),n=e.match(n),null!=n&&null!=n[0]&&0<n[0].length&&(t.o=!0,i=n[0].length,t.b.a(e.substring(0,i)))),r(t.a),t.a.a(e.substring(i)),e.substring(0,i)}function H(t){var n=t.u.toString(),e=new RegExp("^(?:\\+|"+h(t.g,11)+")"),e=n.match(e);return null!=e&&null!=e[0]&&0<e[0].length?(t.o=!0,e=e[0].length,r(t.a),t.a.a(n.substring(e)),r(t.b),t.b.a(n.substring(0,e)),"+"!=n.charAt(0)&&t.b.a(" "),!0):!1}function P(t){if(0==t.a.b.length)return!1;var n,i=new e;t:{if(n=t.a.toString(),0!=n.length&&"0"!=n.charAt(0))for(var a,l=n.length,o=1;3>=o&&l>=o;++o)if(a=parseInt(n.substring(0,o),10),a in X){i.a(n.substring(o)),n=a;break t}n=0}return 0==n?!1:(r(t.a),t.a.a(i.toString()),i=j(n),"001"==i?t.g=x(t.F,""+n):i!=t.C&&(t.g=E(t,i)),t.b.a(""+n).a(" "),t.l="",!0)}function V(t,n){var e=t.m.toString();if(0<=e.substring(t.s).search(t.H)){var i=e.search(t.H),e=e.replace(t.H,n);return r(t.m),t.m.a(e),t.s=i,e.substring(0,t.s+1)}return 1==t.f.length&&(t.j=!1),t.v="",t.h.toString()}var q=this;e.prototype.b="",e.prototype.set=function(t){this.b=""+t},e.prototype.a=function(t,n,e){if(this.b+=String(t),null!=n)for(var r=1;r<arguments.length;r++)this.b+=arguments[r];return this},e.prototype.toString=function(){return this.b};var T=1,U=2,Y=3,k=4,J=6,K=16,L=18;f.prototype.set=function(t,n){b(this,t.b,n)},f.prototype.clone=function(){var t=new this.constructor;return t!=this&&(t.a={},t.b&&(t.b={}),c(t,this)),t};var O;n(v,f);var z;n(d,f);var Q;n(_,f),v.prototype.i=function(){return O||(O=y(v,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",G:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),O},v.ctor=v,v.ctor.i=v.prototype.i,d.prototype.i=function(){return z||(z=y(d,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},3:{name:"possible_number_pattern",c:9,type:String},6:{name:"example_number",c:9,type:String},7:{name:"national_number_matcher_data",c:12,type:String},8:{name:"possible_number_matcher_data",c:12,type:String}})),z},d.ctor=d,d.ctor.i=d.prototype.i,_.prototype.i=function(){return Q||(Q=y(_,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:d},2:{name:"fixed_line",c:11,type:d},3:{name:"mobile",c:11,type:d},4:{name:"toll_free",c:11,type:d},5:{name:"premium_rate",c:11,type:d},6:{name:"shared_cost",c:11,type:d},7:{name:"personal_number",c:11,type:d},8:{name:"voip",c:11,type:d},21:{name:"pager",c:11,type:d},25:{name:"uan",c:11,type:d},27:{name:"emergency",c:11,type:d},28:{name:"voicemail",c:11,type:d},24:{name:"no_international_dialling",c:11,type:d},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",G:!0,c:11,type:v},20:{name:"intl_number_format",G:!0,c:11,type:v},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),Q},_.ctor=_,_.ctor.i=_.prototype.i,S.prototype.a=function(t){throw new t.b,Error("Unimplemented")},S.prototype.b=function(t,n){if(11==t.a||10==t.a)return n instanceof f?n:this.a(t.j.prototype.i(),n);if(14==t.a){if("string"==typeof n&&W.test(n)){var e=Number(n);if(e>0)return e}return n}if(!t.h)return n;if(e=t.j,e===String){if("number"==typeof n)return String(n)}else if(e===Number&&"string"==typeof n&&("Infinity"===n||"-Infinity"===n||"NaN"===n||W.test(n)))return Number(n);return n};var W=/^-?[0-9]+$/;n(w,S),w.prototype.a=function(t,n){var e=new t.b;return e.g=this,e.a=n,e.b={},e},n(A,w),A.prototype.b=function(t,n){return 8==t.a?!!n:S.prototype.b.apply(this,arguments)},A.prototype.a=function(t,n){return A.M.a.call(this,t,n)};/*
Copyright (C) 2010 The Libphonenumber Authors
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var X={258:["MZ"]},tt={MZ:[null,[null,null,"[28]\\d{7,8}","\\d{8,9}"],[null,null,"2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}","\\d{8}",null,null,"21123456"],[null,null,"8[23467]\\d{7}","\\d{9}",null,null,"821234567"],[null,null,"800\\d{6}","\\d{9}",null,null,"800123456"],[null,null,"NA","NA"],[null,null,"NA","NA"],[null,null,"NA","NA"],[null,null,"NA","NA"],"MZ",258,"00",null,null,null,null,null,null,null,[[null,"([28]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-7]"]],[null,"(80\\d)(\\d{3})(\\d{3})","$1 $2 $3",["80"]]],null,[null,null,"NA","NA"],null,null,[null,null,"NA","NA"],[null,null,"NA","NA"],null,null,[null,null,"NA","NA"]]};N.b=function(){return N.a?N.a:N.a=new N};var nt={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"},et=RegExp("[++]+"),rt=RegExp("([0-90-9٠-٩۰-۹])"),it=/^\(?\$1\)?$/,at=new _;b(at,11,"NA");var lt=/\[([^\[\]])*\]/g,ot=/\d(?=[^,}][^,}])/g,ut=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),st=/[- ]/;$.prototype.K=function(){this.B="",r(this.h),r(this.u),r(this.m),this.s=0,this.v="",r(this.b),this.l="",r(this.a),this.j=!0,this.w=this.o=this.D=!1,this.f=[],this.A=!1,this.g!=this.J&&(this.g=E(this,this.C))},$.prototype.L=function(t){return this.B=F(this,t)},t("Cleave.AsYouTypeFormatter",$),t("Cleave.AsYouTypeFormatter.prototype.inputDigit",$.prototype.L),t("Cleave.AsYouTypeFormatter.prototype.clear",$.prototype.K)}).call(window); | redmunds/cdnjs | ajax/libs/cleave.js/0.6.11/addons/cleave-phone.mz.js | JavaScript | mit | 13,158 |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/
return array(
'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
'ai' => array('application/pdf', 'application/postscript'),
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => array('application/x-javascript', 'text/plain'),
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => array('audio/x-aiff', 'audio/aiff'),
'aiff' => array('audio/x-aiff', 'audio/aiff'),
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => array('text/css', 'text/plain'),
'html' => array('text/html', 'text/plain'),
'htm' => array('text/html', 'text/plain'),
'shtml' => array('text/html', 'text/plain'),
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => array('application/xml', 'text/xml', 'text/plain'),
'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
'dot' => array('application/msword', 'application/vnd.ms-office'),
'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json'),
'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
'p10' => array('application/x-pkcs10', 'application/pkcs10'),
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
'3g2' => 'video/3gpp2',
'3gp' => 'video/3gp',
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => 'video/mp4',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => 'audio/ogg',
'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
'ics' => 'text/calendar',
'ical' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7zip' => array('application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
'vcf' => 'text/x-vcard'
);
| dedyismanto/ismspro | application/config/mimes.php | PHP | mit | 8,265 |
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports = minimatch
minimatch.Minimatch = Minimatch
var path = { sep: '/' }
try {
path = require('path')
} catch (er) {}
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
var expand = require('brace-expansion')
// any single thing other than /
// don't need to escape / when using new RegExp()
var qmark = '[^/]'
// * => any number of characters
var star = qmark + '*?'
// ** when dots are allowed. Anything goes, except .. and .
// not (^ or / followed by one or two dots followed by $ or /),
// followed by anything, any number of times.
var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
// not a ^ or / followed by a dot,
// followed by anything, any number of times.
var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
// characters that need to be escaped in RegExp.
var reSpecials = charSet('().*{}+?[]^$\\!')
// "abc" -> { a:true, b:true, c:true }
function charSet (s) {
return s.split('').reduce(function (set, c) {
set[c] = true
return set
}, {})
}
// normalizes slashes.
var slashSplit = /\/+/
minimatch.filter = filter
function filter (pattern, options) {
options = options || {}
return function (p, i, list) {
return minimatch(p, pattern, options)
}
}
function ext (a, b) {
a = a || {}
b = b || {}
var t = {}
Object.keys(b).forEach(function (k) {
t[k] = b[k]
})
Object.keys(a).forEach(function (k) {
t[k] = a[k]
})
return t
}
minimatch.defaults = function (def) {
if (!def || !Object.keys(def).length) return minimatch
var orig = minimatch
var m = function minimatch (p, pattern, options) {
return orig.minimatch(p, pattern, ext(def, options))
}
m.Minimatch = function Minimatch (pattern, options) {
return new orig.Minimatch(pattern, ext(def, options))
}
return m
}
Minimatch.defaults = function (def) {
if (!def || !Object.keys(def).length) return Minimatch
return minimatch.defaults(def).Minimatch
}
function minimatch (p, pattern, options) {
if (typeof pattern !== 'string') {
throw new TypeError('glob pattern string required')
}
if (!options) options = {}
// shortcut: comments match nothing.
if (!options.nocomment && pattern.charAt(0) === '#') {
return false
}
// "" only matches ""
if (pattern.trim() === '') return p === ''
return new Minimatch(pattern, options).match(p)
}
function Minimatch (pattern, options) {
if (!(this instanceof Minimatch)) {
return new Minimatch(pattern, options)
}
if (typeof pattern !== 'string') {
throw new TypeError('glob pattern string required')
}
if (!options) options = {}
pattern = pattern.trim()
// windows support: need to use /, not \
if (path.sep !== '/') {
pattern = pattern.split(path.sep).join('/')
}
this.options = options
this.set = []
this.pattern = pattern
this.regexp = null
this.negate = false
this.comment = false
this.empty = false
// make the set of regexps etc.
this.make()
}
Minimatch.prototype.debug = function () {}
Minimatch.prototype.make = make
function make () {
// don't do it more than once.
if (this._made) return
var pattern = this.pattern
var options = this.options
// empty patterns and comments match nothing.
if (!options.nocomment && pattern.charAt(0) === '#') {
this.comment = true
return
}
if (!pattern) {
this.empty = true
return
}
// step 1: figure out negation, etc.
this.parseNegate()
// step 2: expand braces
var set = this.globSet = this.braceExpand()
if (options.debug) this.debug = console.error
this.debug(this.pattern, set)
// step 3: now we have a set, so turn each one into a series of path-portion
// matching patterns.
// These will be regexps, except in the case of "**", which is
// set to the GLOBSTAR object for globstar behavior,
// and will not contain any / characters
set = this.globParts = set.map(function (s) {
return s.split(slashSplit)
})
this.debug(this.pattern, set)
// glob --> regexps
set = set.map(function (s, si, set) {
return s.map(this.parse, this)
}, this)
this.debug(this.pattern, set)
// filter out everything that didn't compile properly.
set = set.filter(function (s) {
return s.indexOf(false) === -1
})
this.debug(this.pattern, set)
this.set = set
}
Minimatch.prototype.parseNegate = parseNegate
function parseNegate () {
var pattern = this.pattern
var negate = false
var options = this.options
var negateOffset = 0
if (options.nonegate) return
for (var i = 0, l = pattern.length
; i < l && pattern.charAt(i) === '!'
; i++) {
negate = !negate
negateOffset++
}
if (negateOffset) this.pattern = pattern.substr(negateOffset)
this.negate = negate
}
// Brace expansion:
// a{b,c}d -> abd acd
// a{b,}c -> abc ac
// a{0..3}d -> a0d a1d a2d a3d
// a{b,c{d,e}f}g -> abg acdfg acefg
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
//
// Invalid sets are not expanded.
// a{2..}b -> a{2..}b
// a{b}c -> a{b}c
minimatch.braceExpand = function (pattern, options) {
return braceExpand(pattern, options)
}
Minimatch.prototype.braceExpand = braceExpand
function braceExpand (pattern, options) {
if (!options) {
if (this instanceof Minimatch) {
options = this.options
} else {
options = {}
}
}
pattern = typeof pattern === 'undefined'
? this.pattern : pattern
if (typeof pattern === 'undefined') {
throw new Error('undefined pattern')
}
if (options.nobrace ||
!pattern.match(/\{.*\}/)) {
// shortcut. no need to expand.
return [pattern]
}
return expand(pattern)
}
// parse a component of the expanded set.
// At this point, no pattern may contain "/" in it
// so we're going to return a 2d array, where each entry is the full
// pattern, split on '/', and then turned into a regular expression.
// A regexp is made at the end which joins each array with an
// escaped /, and another full one which joins each regexp with |.
//
// Following the lead of Bash 4.1, note that "**" only has special meaning
// when it is the *only* thing in a path portion. Otherwise, any series
// of * is equivalent to a single *. Globstar behavior is enabled by
// default, and can be disabled by setting options.noglobstar.
Minimatch.prototype.parse = parse
var SUBPARSE = {}
function parse (pattern, isSub) {
var options = this.options
// shortcuts
if (!options.noglobstar && pattern === '**') return GLOBSTAR
if (pattern === '') return ''
var re = ''
var hasMagic = !!options.nocase
var escaping = false
// ? => one single character
var patternListStack = []
var plType
var stateChar
var inClass = false
var reClassStart = -1
var classStart = -1
// . and .. never match anything that doesn't start with .,
// even when options.dot is set.
var patternStart = pattern.charAt(0) === '.' ? '' // anything
// not (start or / followed by . or .. followed by / or end)
: options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
: '(?!\\.)'
var self = this
function clearStateChar () {
if (stateChar) {
// we had some state-tracking character
// that wasn't consumed by this pass.
switch (stateChar) {
case '*':
re += star
hasMagic = true
break
case '?':
re += qmark
hasMagic = true
break
default:
re += '\\' + stateChar
break
}
self.debug('clearStateChar %j %j', stateChar, re)
stateChar = false
}
}
for (var i = 0, len = pattern.length, c
; (i < len) && (c = pattern.charAt(i))
; i++) {
this.debug('%s\t%s %s %j', pattern, i, re, c)
// skip over any that are escaped.
if (escaping && reSpecials[c]) {
re += '\\' + c
escaping = false
continue
}
switch (c) {
case '/':
// completely not allowed, even escaped.
// Should already be path-split by now.
return false
case '\\':
clearStateChar()
escaping = true
continue
// the various stateChar values
// for the "extglob" stuff.
case '?':
case '*':
case '+':
case '@':
case '!':
this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
// all of those are literals inside a class, except that
// the glob [!a] means [^a] in regexp
if (inClass) {
this.debug(' in class')
if (c === '!' && i === classStart + 1) c = '^'
re += c
continue
}
// if we already have a stateChar, then it means
// that there was something like ** or +? in there.
// Handle the stateChar, then proceed with this one.
self.debug('call clearStateChar %j', stateChar)
clearStateChar()
stateChar = c
// if extglob is disabled, then +(asdf|foo) isn't a thing.
// just clear the statechar *now*, rather than even diving into
// the patternList stuff.
if (options.noext) clearStateChar()
continue
case '(':
if (inClass) {
re += '('
continue
}
if (!stateChar) {
re += '\\('
continue
}
plType = stateChar
patternListStack.push({ type: plType, start: i - 1, reStart: re.length })
// negation is (?:(?!js)[^/]*)
re += stateChar === '!' ? '(?:(?!' : '(?:'
this.debug('plType %j %j', stateChar, re)
stateChar = false
continue
case ')':
if (inClass || !patternListStack.length) {
re += '\\)'
continue
}
clearStateChar()
hasMagic = true
re += ')'
plType = patternListStack.pop().type
// negation is (?:(?!js)[^/]*)
// The others are (?:<pattern>)<type>
switch (plType) {
case '!':
re += '[^/]*?)'
break
case '?':
case '+':
case '*':
re += plType
break
case '@': break // the default anyway
}
continue
case '|':
if (inClass || !patternListStack.length || escaping) {
re += '\\|'
escaping = false
continue
}
clearStateChar()
re += '|'
continue
// these are mostly the same in regexp and glob
case '[':
// swallow any state-tracking char before the [
clearStateChar()
if (inClass) {
re += '\\' + c
continue
}
inClass = true
classStart = i
reClassStart = re.length
re += c
continue
case ']':
// a right bracket shall lose its special
// meaning and represent itself in
// a bracket expression if it occurs
// first in the list. -- POSIX.2 2.8.3.2
if (i === classStart + 1 || !inClass) {
re += '\\' + c
escaping = false
continue
}
// handle the case where we left a class open.
// "[z-a]" is valid, equivalent to "\[z-a\]"
if (inClass) {
// split where the last [ was, make sure we don't have
// an invalid re. if so, re-walk the contents of the
// would-be class to re-translate any characters that
// were passed through as-is
// TODO: It would probably be faster to determine this
// without a try/catch and a new RegExp, but it's tricky
// to do safely. For now, this is safe and works.
var cs = pattern.substring(classStart + 1, i)
try {
RegExp('[' + cs + ']')
} catch (er) {
// not a valid class!
var sp = this.parse(cs, SUBPARSE)
re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
hasMagic = hasMagic || sp[1]
inClass = false
continue
}
}
// finish up the class.
hasMagic = true
inClass = false
re += c
continue
default:
// swallow any state char that wasn't consumed
clearStateChar()
if (escaping) {
// no need
escaping = false
} else if (reSpecials[c]
&& !(c === '^' && inClass)) {
re += '\\'
}
re += c
} // switch
} // for
// handle the case where we left a class open.
// "[abc" is valid, equivalent to "\[abc"
if (inClass) {
// split where the last [ was, and escape it
// this is a huge pita. We now have to re-walk
// the contents of the would-be class to re-translate
// any characters that were passed through as-is
cs = pattern.substr(classStart + 1)
sp = this.parse(cs, SUBPARSE)
re = re.substr(0, reClassStart) + '\\[' + sp[0]
hasMagic = hasMagic || sp[1]
}
// handle the case where we had a +( thing at the *end*
// of the pattern.
// each pattern list stack adds 3 chars, and we need to go through
// and escape any | chars that were passed through as-is for the regexp.
// Go through and escape them, taking care not to double-escape any
// | chars that were already escaped.
for (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
var tail = re.slice(pl.reStart + 3)
// maybe some even number of \, then maybe 1 \, followed by a |
tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {
if (!$2) {
// the | isn't already escaped, so escape it.
$2 = '\\'
}
// need to escape all those slashes *again*, without escaping the
// one that we need for escaping the | character. As it works out,
// escaping an even number of slashes can be done by simply repeating
// it exactly after itself. That's why this trick works.
//
// I am sorry that you have to see this.
return $1 + $1 + $2 + '|'
})
this.debug('tail=%j\n %s', tail, tail)
var t = pl.type === '*' ? star
: pl.type === '?' ? qmark
: '\\' + pl.type
hasMagic = true
re = re.slice(0, pl.reStart) + t + '\\(' + tail
}
// handle trailing things that only matter at the very end.
clearStateChar()
if (escaping) {
// trailing \\
re += '\\\\'
}
// only need to apply the nodot start if the re starts with
// something that could conceivably capture a dot
var addPatternStart = false
switch (re.charAt(0)) {
case '.':
case '[':
case '(': addPatternStart = true
}
// if the re is not "" at this point, then we need to make sure
// it doesn't match against an empty path part.
// Otherwise a/* will match a/, which it should not.
if (re !== '' && hasMagic) re = '(?=.)' + re
if (addPatternStart) re = patternStart + re
// parsing just a piece of a larger pattern.
if (isSub === SUBPARSE) {
return [re, hasMagic]
}
// skip the regexp for non-magical patterns
// unescape anything in it, though, so that it'll be
// an exact match against a file etc.
if (!hasMagic) {
return globUnescape(pattern)
}
var flags = options.nocase ? 'i' : ''
var regExp = new RegExp('^' + re + '$', flags)
regExp._glob = pattern
regExp._src = re
return regExp
}
minimatch.makeRe = function (pattern, options) {
return new Minimatch(pattern, options || {}).makeRe()
}
Minimatch.prototype.makeRe = makeRe
function makeRe () {
if (this.regexp || this.regexp === false) return this.regexp
// at this point, this.set is a 2d array of partial
// pattern strings, or "**".
//
// It's better to use .match(). This function shouldn't
// be used, really, but it's pretty convenient sometimes,
// when you just want to work with a regex.
var set = this.set
if (!set.length) {
this.regexp = false
return this.regexp
}
var options = this.options
var twoStar = options.noglobstar ? star
: options.dot ? twoStarDot
: twoStarNoDot
var flags = options.nocase ? 'i' : ''
var re = set.map(function (pattern) {
return pattern.map(function (p) {
return (p === GLOBSTAR) ? twoStar
: (typeof p === 'string') ? regExpEscape(p)
: p._src
}).join('\\\/')
}).join('|')
// must match entire pattern
// ending in a * or ** will make it less strict.
re = '^(?:' + re + ')$'
// can match anything, as long as it's not this.
if (this.negate) re = '^(?!' + re + ').*$'
try {
this.regexp = new RegExp(re, flags)
} catch (ex) {
this.regexp = false
}
return this.regexp
}
minimatch.match = function (list, pattern, options) {
options = options || {}
var mm = new Minimatch(pattern, options)
list = list.filter(function (f) {
return mm.match(f)
})
if (mm.options.nonull && !list.length) {
list.push(pattern)
}
return list
}
Minimatch.prototype.match = match
function match (f, partial) {
this.debug('match', f, this.pattern)
// short-circuit in the case of busted things.
// comments, etc.
if (this.comment) return false
if (this.empty) return f === ''
if (f === '/' && partial) return true
var options = this.options
// windows: need to use /, not \
if (path.sep !== '/') {
f = f.split(path.sep).join('/')
}
// treat the test path as a set of pathparts.
f = f.split(slashSplit)
this.debug(this.pattern, 'split', f)
// just ONE of the pattern sets in this.set needs to match
// in order for it to be valid. If negating, then just one
// match means that we have failed.
// Either way, return on the first hit.
var set = this.set
this.debug(this.pattern, 'set', set)
// Find the basename of the path by looking for the last non-empty segment
var filename
var i
for (i = f.length - 1; i >= 0; i--) {
filename = f[i]
if (filename) break
}
for (i = 0; i < set.length; i++) {
var pattern = set[i]
var file = f
if (options.matchBase && pattern.length === 1) {
file = [filename]
}
var hit = this.matchOne(file, pattern, partial)
if (hit) {
if (options.flipNegate) return true
return !this.negate
}
}
// didn't get any hits. this is success if it's a negative
// pattern, failure otherwise.
if (options.flipNegate) return false
return this.negate
}
// set partial to true to test if, for example,
// "/a/b" matches the start of "/*/b/*/d"
// Partial means, if you run out of file before you run
// out of pattern, then that's fine, as long as all
// the parts match.
Minimatch.prototype.matchOne = function (file, pattern, partial) {
var options = this.options
this.debug('matchOne',
{ 'this': this, file: file, pattern: pattern })
this.debug('matchOne', file.length, pattern.length)
for (var fi = 0,
pi = 0,
fl = file.length,
pl = pattern.length
; (fi < fl) && (pi < pl)
; fi++, pi++) {
this.debug('matchOne loop')
var p = pattern[pi]
var f = file[fi]
this.debug(pattern, p, f)
// should be impossible.
// some invalid regexp stuff in the set.
if (p === false) return false
if (p === GLOBSTAR) {
this.debug('GLOBSTAR', [pattern, p, f])
// "**"
// a/**/b/**/c would match the following:
// a/b/x/y/z/c
// a/x/y/z/b/c
// a/b/x/b/x/c
// a/b/c
// To do this, take the rest of the pattern after
// the **, and see if it would match the file remainder.
// If so, return success.
// If not, the ** "swallows" a segment, and try again.
// This is recursively awful.
//
// a/**/b/**/c matching a/b/x/y/z/c
// - a matches a
// - doublestar
// - matchOne(b/x/y/z/c, b/**/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi
var pr = pi + 1
if (pr === pl) {
this.debug('** at the end')
// a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' ||
(!options.dot && file[fi].charAt(0) === '.')) return false
}
return true
}
// ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr]
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
// XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee)
// found a match.
return true
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' ||
(!options.dot && swallowee.charAt(0) === '.')) {
this.debug('dot detected!', file, fr, pattern, pr)
break
}
// ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue')
fr++
}
}
// no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
if (fr === fl) return true
}
return false
}
// something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase()
} else {
hit = f === p
}
this.debug('string match', p, f, hit)
} else {
hit = f.match(p)
this.debug('pattern match', p, f, hit)
}
if (!hit) return false
}
// Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
return emptyFileEnd
}
// should be unreachable.
throw new Error('wtf?')
}
// replace stuff like \* with *
function globUnescape (s) {
return s.replace(/\\(.)/g, '$1')
}
function regExpEscape (s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
}
},{"brace-expansion":2,"path":undefined}],2:[function(require,module,exports){
var concatMap = require('concat-map');
var balanced = require('balanced-match');
module.exports = expandTop;
var escSlash = '\0SLASH'+Math.random()+'\0';
var escOpen = '\0OPEN'+Math.random()+'\0';
var escClose = '\0CLOSE'+Math.random()+'\0';
var escComma = '\0COMMA'+Math.random()+'\0';
var escPeriod = '\0PERIOD'+Math.random()+'\0';
function numeric(str) {
return parseInt(str, 10) == str
? parseInt(str, 10)
: str.charCodeAt(0);
}
function escapeBraces(str) {
return str.split('\\\\').join(escSlash)
.split('\\{').join(escOpen)
.split('\\}').join(escClose)
.split('\\,').join(escComma)
.split('\\.').join(escPeriod);
}
function unescapeBraces(str) {
return str.split(escSlash).join('\\')
.split(escOpen).join('{')
.split(escClose).join('}')
.split(escComma).join(',')
.split(escPeriod).join('.');
}
// Basically just str.split(","), but handling cases
// where we have nested braced sections, which should be
// treated as individual members, like {a,{b,c},d}
function parseCommaParts(str) {
if (!str)
return [''];
var parts = [];
var m = balanced('{', '}', str);
if (!m)
return str.split(',');
var pre = m.pre;
var body = m.body;
var post = m.post;
var p = pre.split(',');
p[p.length-1] += '{' + body + '}';
var postParts = parseCommaParts(post);
if (post.length) {
p[p.length-1] += postParts.shift();
p.push.apply(p, postParts);
}
parts.push.apply(parts, p);
return parts;
}
function expandTop(str) {
if (!str)
return [];
var expansions = expand(escapeBraces(str));
return expansions.filter(identity).map(unescapeBraces);
}
function identity(e) {
return e;
}
function embrace(str) {
return '{' + str + '}';
}
function isPadded(el) {
return /^-?0\d/.test(el);
}
function lte(i, y) {
return i <= y;
}
function gte(i, y) {
return i >= y;
}
function expand(str) {
var expansions = [];
var m = balanced('{', '}', str);
if (!m || /\$$/.test(m.pre)) return [str];
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
var isSequence = isNumericSequence || isAlphaSequence;
var isOptions = /^(.*,)+(.+)?$/.test(m.body);
if (!isSequence && !isOptions) {
// {a},b}
if (m.post.match(/,.*}/)) {
str = m.pre + '{' + m.body + escClose + m.post;
return expand(str);
}
return [str];
}
var n;
if (isSequence) {
n = m.body.split(/\.\./);
} else {
n = parseCommaParts(m.body);
if (n.length === 1) {
// x{{a,b}}y ==> x{a}y x{b}y
n = expand(n[0]).map(embrace);
if (n.length === 1) {
var post = m.post.length
? expand(m.post)
: [''];
return post.map(function(p) {
return m.pre + n[0] + p;
});
}
}
}
// at this point, n is the parts, and we know it's not a comma set
// with a single entry.
// no need to expand pre, since it is guaranteed to be free of brace-sets
var pre = m.pre;
var post = m.post.length
? expand(m.post)
: [''];
var N;
if (isSequence) {
var x = numeric(n[0]);
var y = numeric(n[1]);
var width = Math.max(n[0].length, n[1].length)
var incr = n.length == 3
? Math.abs(numeric(n[2]))
: 1;
var test = lte;
var reverse = y < x;
if (reverse) {
incr *= -1;
test = gte;
}
var pad = n.some(isPadded);
N = [];
for (var i = x; test(i, y); i += incr) {
var c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === '\\')
c = '';
} else {
c = String(i);
if (pad) {
var need = width - c.length;
if (need > 0) {
var z = new Array(need + 1).join('0');
if (i < 0)
c = '-' + z + c.slice(1);
else
c = z + c;
}
}
}
N.push(c);
}
} else {
N = concatMap(n, function(el) { return expand(el) });
}
for (var j = 0; j < N.length; j++) {
for (var k = 0; k < post.length; k++) {
expansions.push([pre, N[j], post[k]].join(''))
}
}
return expansions;
}
},{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){
module.exports = balanced;
function balanced(a, b, str) {
var bal = 0;
var m = {};
var ended = false;
for (var i = 0; i < str.length; i++) {
if (a == str.substr(i, a.length)) {
if (!('start' in m)) m.start = i;
bal++;
}
else if (b == str.substr(i, b.length) && 'start' in m) {
ended = true;
bal--;
if (!bal) {
m.end = i;
m.pre = str.substr(0, m.start);
m.body = (m.end - m.start > 1)
? str.substring(m.start + a.length, m.end)
: '';
m.post = str.slice(m.end + b.length);
return m;
}
}
}
// if we opened more than we closed, find the one we closed
if (bal && ended) {
var start = m.start + a.length;
m = balanced(a, b, str.substr(start));
if (m) {
m.start += start;
m.end += start;
m.pre = str.slice(0, start) + m.pre;
}
return m;
}
}
},{}],4:[function(require,module,exports){
module.exports = function (xs, fn) {
var res = [];
for (var i = 0; i < xs.length; i++) {
var x = fn(xs[i], i);
if (Array.isArray(x)) res.push.apply(res, x);
else res.push(x);
}
return res;
};
},{}]},{},[1]);
| waddedMeat/ember-proxy-example | test-app/node_modules/ember-cli-babel/node_modules/broccoli-filter/node_modules/broccoli-kitchen-sink-helpers/node_modules/glob/node_modules/minimatch/browser.js | JavaScript | mit | 29,665 |
define("dojo/_base/Color", ["./kernel", "./lang", "./array", "./config"], function(dojo, lang, ArrayUtil, config){
var Color = dojo.Color = function(/*Array|String|Object*/ color){
// summary:
// Takes a named string, hex string, array of rgb or rgba values,
// an object with r, g, b, and a properties, or another `Color` object
// and creates a new Color instance to work from.
//
// example:
// Work with a Color instance:
// | require(["dojo/_base/color"], function(Color){
// | var c = new Color();
// | c.setColor([0,0,0]); // black
// | var hex = c.toHex(); // #000000
// | });
//
// example:
// Work with a node's color:
// |
// | require(["dojo/_base/color", "dojo/dom-style"], function(Color, domStyle){
// | var color = domStyle("someNode", "backgroundColor");
// | var n = new Color(color);
// | // adjust the color some
// | n.r *= .5;
// | console.log(n.toString()); // rgb(128, 255, 255);
// | });
if(color){ this.setColor(color); }
};
// FIXME:
// there's got to be a more space-efficient way to encode or discover
// these!! Use hex?
Color.named = {
// summary:
// Dictionary list of all CSS named colors, by name. Values are 3-item arrays with corresponding RG and B values.
"black": [0,0,0],
"silver": [192,192,192],
"gray": [128,128,128],
"white": [255,255,255],
"maroon": [128,0,0],
"red": [255,0,0],
"purple": [128,0,128],
"fuchsia":[255,0,255],
"green": [0,128,0],
"lime": [0,255,0],
"olive": [128,128,0],
"yellow": [255,255,0],
"navy": [0,0,128],
"blue": [0,0,255],
"teal": [0,128,128],
"aqua": [0,255,255],
"transparent": config.transparentColor || [0,0,0,0]
};
lang.extend(Color, {
r: 255, g: 255, b: 255, a: 1,
_set: function(r, g, b, a){
var t = this; t.r = r; t.g = g; t.b = b; t.a = a;
},
setColor: function(/*Array|String|Object*/ color){
// summary:
// Takes a named string, hex string, array of rgb or rgba values,
// an object with r, g, b, and a properties, or another `Color` object
// and sets this color instance to that value.
//
// example:
// | require(["dojo/_base/color"], function(Color){
// | var c = new Color(); // no color
// | c.setColor("#ededed"); // greyish
// | });
if(lang.isString(color)){
Color.fromString(color, this);
}else if(lang.isArray(color)){
Color.fromArray(color, this);
}else{
this._set(color.r, color.g, color.b, color.a);
if(!(color instanceof Color)){ this.sanitize(); }
}
return this; // Color
},
sanitize: function(){
// summary:
// Ensures the object has correct attributes
// description:
// the default implementation does nothing, include dojo.colors to
// augment it with real checks
return this; // Color
},
toRgb: function(){
// summary:
// Returns 3 component array of rgb values
// example:
// | require(["dojo/_base/color"], function(Color){
// | var c = new Color("#000000");
// | console.log(c.toRgb()); // [0,0,0]
// | });
var t = this;
return [t.r, t.g, t.b]; // Array
},
toRgba: function(){
// summary:
// Returns a 4 component array of rgba values from the color
// represented by this object.
var t = this;
return [t.r, t.g, t.b, t.a]; // Array
},
toHex: function(){
// summary:
// Returns a CSS color string in hexadecimal representation
// example:
// | require(["dojo/_base/color"], function(Color){
// | console.log(new Color([0,0,0]).toHex()); // #000000
// | });
var arr = ArrayUtil.map(["r", "g", "b"], function(x){
var s = this[x].toString(16);
return s.length < 2 ? "0" + s : s;
}, this);
return "#" + arr.join(""); // String
},
toCss: function(/*Boolean?*/ includeAlpha){
// summary:
// Returns a css color string in rgb(a) representation
// example:
// | require(["dojo/_base/color"], function(Color){
// | var c = new Color("#FFF").toCss();
// | console.log(c); // rgb('255','255','255')
// | });
var t = this, rgb = t.r + ", " + t.g + ", " + t.b;
return (includeAlpha ? "rgba(" + rgb + ", " + t.a : "rgb(" + rgb) + ")"; // String
},
toString: function(){
// summary:
// Returns a visual representation of the color
return this.toCss(true); // String
}
});
Color.blendColors = dojo.blendColors = function(
/*Color*/ start,
/*Color*/ end,
/*Number*/ weight,
/*Color?*/ obj
){
// summary:
// Blend colors end and start with weight from 0 to 1, 0.5 being a 50/50 blend,
// can reuse a previously allocated Color object for the result
var t = obj || new Color();
ArrayUtil.forEach(["r", "g", "b", "a"], function(x){
t[x] = start[x] + (end[x] - start[x]) * weight;
if(x != "a"){ t[x] = Math.round(t[x]); }
});
return t.sanitize(); // Color
};
Color.fromRgb = dojo.colorFromRgb = function(/*String*/ color, /*Color?*/ obj){
// summary:
// Returns a `Color` instance from a string of the form
// "rgb(...)" or "rgba(...)". Optionally accepts a `Color`
// object to update with the parsed value and return instead of
// creating a new object.
// returns:
// A Color object. If obj is passed, it will be the return value.
var m = color.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);
return m && Color.fromArray(m[1].split(/\s*,\s*/), obj); // Color
};
Color.fromHex = dojo.colorFromHex = function(/*String*/ color, /*Color?*/ obj){
// summary:
// Converts a hex string with a '#' prefix to a color object.
// Supports 12-bit #rgb shorthand. Optionally accepts a
// `Color` object to update with the parsed value.
//
// returns:
// A Color object. If obj is passed, it will be the return value.
//
// example:
// | require(["dojo/_base/color"], function(Color){
// | var thing = new Color().fromHex("#ededed"); // grey, longhand
// | var thing2 = new Color().fromHex("#000"); // black, shorthand
// | });
var t = obj || new Color(),
bits = (color.length == 4) ? 4 : 8,
mask = (1 << bits) - 1;
color = Number("0x" + color.substr(1));
if(isNaN(color)){
return null; // Color
}
ArrayUtil.forEach(["b", "g", "r"], function(x){
var c = color & mask;
color >>= bits;
t[x] = bits == 4 ? 17 * c : c;
});
t.a = 1;
return t; // Color
};
Color.fromArray = dojo.colorFromArray = function(/*Array*/ a, /*Color?*/ obj){
// summary:
// Builds a `Color` from a 3 or 4 element array, mapping each
// element in sequence to the rgb(a) values of the color.
// example:
// | require(["dojo/_base/color"], function(Color){
// | var myColor = new Color().fromArray([237,237,237,0.5]); // grey, 50% alpha
// | });
// returns:
// A Color object. If obj is passed, it will be the return value.
var t = obj || new Color();
t._set(Number(a[0]), Number(a[1]), Number(a[2]), Number(a[3]));
if(isNaN(t.a)){ t.a = 1; }
return t.sanitize(); // Color
};
Color.fromString = dojo.colorFromString = function(/*String*/ str, /*Color?*/ obj){
// summary:
// Parses `str` for a color value. Accepts hex, rgb, and rgba
// style color values.
// description:
// Acceptable input values for str may include arrays of any form
// accepted by dojo.colorFromArray, hex strings such as "#aaaaaa", or
// rgb or rgba strings such as "rgb(133, 200, 16)" or "rgba(10, 10,
// 10, 50)"
// returns:
// A Color object. If obj is passed, it will be the return value.
var a = Color.named[str];
return a && Color.fromArray(a, obj) || Color.fromRgb(str, obj) || Color.fromHex(str, obj); // Color
};
return Color;
});
| keicheng/cdnjs | ajax/libs/dojo/1.11.0-rc4/_base/Color.js.uncompressed.js | JavaScript | mit | 7,631 |
/* This is a compiled file, you should be editing the file in the templates directory */
.pace {
-webkit-pointer-events: none;
pointer-events: none;
z-index: 2000;
position: fixed;
height: 90px;
width: 90px;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.pace.pace-inactive .pace-activity {
display: none;
}
.pace .pace-activity {
position: fixed;
z-index: 2000;
display: block;
position: absolute;
left: -30px;
top: -30px;
height: 90px;
width: 90px;
display: block;
border-width: 30px;
border-style: double;
border-color: #22df80 transparent transparent;
border-radius: 50%;
-webkit-animation: spin 1s linear infinite;
-moz-animation: spin 1s linear infinite;
-o-animation: spin 1s linear infinite;
animation: spin 1s linear infinite;
}
.pace .pace-activity:before {
content: ' ';
position: absolute;
top: 10px;
left: 10px;
height: 50px;
width: 50px;
display: block;
border-width: 10px;
border-style: solid;
border-color: #22df80 transparent transparent;
border-radius: 50%;
}
@-webkit-keyframes spin {
100% { -webkit-transform: rotate(359deg); }
}
@-moz-keyframes spin {
100% { -moz-transform: rotate(359deg); }
}
@-o-keyframes spin {
100% { -moz-transform: rotate(359deg); }
}
@keyframes spin {
100% { transform: rotate(359deg); }
}
| RobLoach/cdnjs | ajax/libs/pace/0.6.0/themes/green/pace-theme-center-radar.css | CSS | mit | 1,359 |
/* This is a compiled file, you should be editing the file in the templates directory */
.pace {
-webkit-pointer-events: none;
pointer-events: none;
z-index: 2000;
position: fixed;
height: 90px;
width: 90px;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.pace.pace-inactive .pace-activity {
display: none;
}
.pace .pace-activity {
position: fixed;
z-index: 2000;
display: block;
position: absolute;
left: -30px;
top: -30px;
height: 90px;
width: 90px;
display: block;
border-width: 30px;
border-style: double;
border-color: #ee3148 transparent transparent;
border-radius: 50%;
-webkit-animation: spin 1s linear infinite;
-moz-animation: spin 1s linear infinite;
-o-animation: spin 1s linear infinite;
animation: spin 1s linear infinite;
}
.pace .pace-activity:before {
content: ' ';
position: absolute;
top: 10px;
left: 10px;
height: 50px;
width: 50px;
display: block;
border-width: 10px;
border-style: solid;
border-color: #ee3148 transparent transparent;
border-radius: 50%;
}
@-webkit-keyframes spin {
100% { -webkit-transform: rotate(359deg); }
}
@-moz-keyframes spin {
100% { -moz-transform: rotate(359deg); }
}
@-o-keyframes spin {
100% { -moz-transform: rotate(359deg); }
}
@keyframes spin {
100% { transform: rotate(359deg); }
}
| a8m/cdnjs | ajax/libs/pace/0.5.3/themes/red/pace-theme-center-radar.css | CSS | mit | 1,359 |
/* This is a compiled file, you should be editing the file in the templates directory */
.pace {
-webkit-pointer-events: none;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.pace .pace-activity {
display: block;
position: fixed;
z-index: 2000;
top: 0;
right: 0;
width: 300px;
height: 300px;
background: #e90f92;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
-webkit-transform: translateX(100%) translateY(-100%) rotate(45deg);
transform: translateX(100%) translateY(-100%) rotate(45deg);
pointer-events: none;
}
.pace.pace-active .pace-activity {
-webkit-transform: translateX(50%) translateY(-50%) rotate(45deg);
transform: translateX(50%) translateY(-50%) rotate(45deg);
}
.pace .pace-activity::before,
.pace .pace-activity::after {
position: absolute;
bottom: 30px;
left: 50%;
display: block;
border: 5px solid #fff;
border-radius: 50%;
content: '';
}
.pace .pace-activity::before {
margin-left: -40px;
width: 80px;
height: 80px;
border-right-color: rgba(0, 0, 0, .2);
border-left-color: rgba(0, 0, 0, .2);
-webkit-animation: pace-rotation 3s linear infinite;
animation: pace-rotation 3s linear infinite;
}
.pace .pace-activity::after {
bottom: 50px;
margin-left: -20px;
width: 40px;
height: 40px;
border-top-color: rgba(0, 0, 0, .2);
border-bottom-color: rgba(0, 0, 0, .2);
-webkit-animation: pace-rotation 1s linear infinite;
animation: pace-rotation 1s linear infinite;
}
@-webkit-keyframes pace-rotation {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(359deg); }
}
@keyframes pace-rotation {
0% { transform: rotate(0deg); }
100% { transform: rotate(359deg); }
}
| skidding/cdnjs | ajax/libs/pace/0.6.0/themes/pink/pace-theme-corner-indicator.css | CSS | mit | 1,812 |
<?php
/**
* SimplePie
*
* A PHP-Based RSS and Atom Feed Framework.
* Takes the hard work out of managing a complete RSS/Atom solution.
*
* Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* * Neither the name of the SimplePie Team nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
* AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @package SimplePie
* @version 1.3.1
* @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
* @author Ryan Parman
* @author Geoffrey Sneddon
* @author Ryan McCue
* @link http://simplepie.org/ SimplePie
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*/
/**
* Handles everything related to enclosures (including Media RSS and iTunes RSS)
*
* Used by {@see SimplePie_Item::get_enclosure()} and {@see SimplePie_Item::get_enclosures()}
*
* This class can be overloaded with {@see SimplePie::set_enclosure_class()}
*
* @package SimplePie
* @subpackage API
*/
class SimplePie_Enclosure
{
/**
* @var string
* @see get_bitrate()
*/
var $bitrate;
/**
* @var array
* @see get_captions()
*/
var $captions;
/**
* @var array
* @see get_categories()
*/
var $categories;
/**
* @var int
* @see get_channels()
*/
var $channels;
/**
* @var SimplePie_Copyright
* @see get_copyright()
*/
var $copyright;
/**
* @var array
* @see get_credits()
*/
var $credits;
/**
* @var string
* @see get_description()
*/
var $description;
/**
* @var int
* @see get_duration()
*/
var $duration;
/**
* @var string
* @see get_expression()
*/
var $expression;
/**
* @var string
* @see get_framerate()
*/
var $framerate;
/**
* @var string
* @see get_handler()
*/
var $handler;
/**
* @var array
* @see get_hashes()
*/
var $hashes;
/**
* @var string
* @see get_height()
*/
var $height;
/**
* @deprecated
* @var null
*/
var $javascript;
/**
* @var array
* @see get_keywords()
*/
var $keywords;
/**
* @var string
* @see get_language()
*/
var $lang;
/**
* @var string
* @see get_length()
*/
var $length;
/**
* @var string
* @see get_link()
*/
var $link;
/**
* @var string
* @see get_medium()
*/
var $medium;
/**
* @var string
* @see get_player()
*/
var $player;
/**
* @var array
* @see get_ratings()
*/
var $ratings;
/**
* @var array
* @see get_restrictions()
*/
var $restrictions;
/**
* @var string
* @see get_sampling_rate()
*/
var $samplingrate;
/**
* @var array
* @see get_thumbnails()
*/
var $thumbnails;
/**
* @var string
* @see get_title()
*/
var $title;
/**
* @var string
* @see get_type()
*/
var $type;
/**
* @var string
* @see get_width()
*/
var $width;
/**
* Constructor, used to input the data
*
* For documentation on all the parameters, see the corresponding
* properties and their accessors
*
* @uses idna_convert If available, this will convert an IDN
*/
public function __construct($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null)
{
$this->bitrate = $bitrate;
$this->captions = $captions;
$this->categories = $categories;
$this->channels = $channels;
$this->copyright = $copyright;
$this->credits = $credits;
$this->description = $description;
$this->duration = $duration;
$this->expression = $expression;
$this->framerate = $framerate;
$this->hashes = $hashes;
$this->height = $height;
$this->keywords = $keywords;
$this->lang = $lang;
$this->length = $length;
$this->link = $link;
$this->medium = $medium;
$this->player = $player;
$this->ratings = $ratings;
$this->restrictions = $restrictions;
$this->samplingrate = $samplingrate;
$this->thumbnails = $thumbnails;
$this->title = $title;
$this->type = $type;
$this->width = $width;
if (class_exists('idna_convert'))
{
$idn = new idna_convert();
$parsed = SimplePie_Misc::parse_url($link);
$this->link = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']);
}
$this->handler = $this->get_handler(); // Needs to load last
}
/**
* String-ified version
*
* @return string
*/
public function __toString()
{
// There is no $this->data here
return md5(serialize($this));
}
/**
* Get the bitrate
*
* @return string|null
*/
public function get_bitrate()
{
if ($this->bitrate !== null)
{
return $this->bitrate;
}
else
{
return null;
}
}
/**
* Get a single caption
*
* @param int $key
* @return SimplePie_Caption|null
*/
public function get_caption($key = 0)
{
$captions = $this->get_captions();
if (isset($captions[$key]))
{
return $captions[$key];
}
else
{
return null;
}
}
/**
* Get all captions
*
* @return array|null Array of {@see SimplePie_Caption} objects
*/
public function get_captions()
{
if ($this->captions !== null)
{
return $this->captions;
}
else
{
return null;
}
}
/**
* Get a single category
*
* @param int $key
* @return SimplePie_Category|null
*/
public function get_category($key = 0)
{
$categories = $this->get_categories();
if (isset($categories[$key]))
{
return $categories[$key];
}
else
{
return null;
}
}
/**
* Get all categories
*
* @return array|null Array of {@see SimplePie_Category} objects
*/
public function get_categories()
{
if ($this->categories !== null)
{
return $this->categories;
}
else
{
return null;
}
}
/**
* Get the number of audio channels
*
* @return int|null
*/
public function get_channels()
{
if ($this->channels !== null)
{
return $this->channels;
}
else
{
return null;
}
}
/**
* Get the copyright information
*
* @return SimplePie_Copyright|null
*/
public function get_copyright()
{
if ($this->copyright !== null)
{
return $this->copyright;
}
else
{
return null;
}
}
/**
* Get a single credit
*
* @param int $key
* @return SimplePie_Credit|null
*/
public function get_credit($key = 0)
{
$credits = $this->get_credits();
if (isset($credits[$key]))
{
return $credits[$key];
}
else
{
return null;
}
}
/**
* Get all credits
*
* @return array|null Array of {@see SimplePie_Credit} objects
*/
public function get_credits()
{
if ($this->credits !== null)
{
return $this->credits;
}
else
{
return null;
}
}
/**
* Get the description of the enclosure
*
* @return string|null
*/
public function get_description()
{
if ($this->description !== null)
{
return $this->description;
}
else
{
return null;
}
}
/**
* Get the duration of the enclosure
*
* @param string $convert Convert seconds into hh:mm:ss
* @return string|int|null 'hh:mm:ss' string if `$convert` was specified, otherwise integer (or null if none found)
*/
public function get_duration($convert = false)
{
if ($this->duration !== null)
{
if ($convert)
{
$time = SimplePie_Misc::time_hms($this->duration);
return $time;
}
else
{
return $this->duration;
}
}
else
{
return null;
}
}
/**
* Get the expression
*
* @return string Probably one of 'sample', 'full', 'nonstop', 'clip'. Defaults to 'full'
*/
public function get_expression()
{
if ($this->expression !== null)
{
return $this->expression;
}
else
{
return 'full';
}
}
/**
* Get the file extension
*
* @return string|null
*/
public function get_extension()
{
if ($this->link !== null)
{
$url = SimplePie_Misc::parse_url($this->link);
if ($url['path'] !== '')
{
return pathinfo($url['path'], PATHINFO_EXTENSION);
}
}
return null;
}
/**
* Get the framerate (in frames-per-second)
*
* @return string|null
*/
public function get_framerate()
{
if ($this->framerate !== null)
{
return $this->framerate;
}
else
{
return null;
}
}
/**
* Get the preferred handler
*
* @return string|null One of 'flash', 'fmedia', 'quicktime', 'wmedia', 'mp3'
*/
public function get_handler()
{
return $this->get_real_type(true);
}
/**
* Get a single hash
*
* @link http://www.rssboard.org/media-rss#media-hash
* @param int $key
* @return string|null Hash as per `media:hash`, prefixed with "$algo:"
*/
public function get_hash($key = 0)
{
$hashes = $this->get_hashes();
if (isset($hashes[$key]))
{
return $hashes[$key];
}
else
{
return null;
}
}
/**
* Get all credits
*
* @return array|null Array of strings, see {@see get_hash()}
*/
public function get_hashes()
{
if ($this->hashes !== null)
{
return $this->hashes;
}
else
{
return null;
}
}
/**
* Get the height
*
* @return string|null
*/
public function get_height()
{
if ($this->height !== null)
{
return $this->height;
}
else
{
return null;
}
}
/**
* Get the language
*
* @link http://tools.ietf.org/html/rfc3066
* @return string|null Language code as per RFC 3066
*/
public function get_language()
{
if ($this->lang !== null)
{
return $this->lang;
}
else
{
return null;
}
}
/**
* Get a single keyword
*
* @param int $key
* @return string|null
*/
public function get_keyword($key = 0)
{
$keywords = $this->get_keywords();
if (isset($keywords[$key]))
{
return $keywords[$key];
}
else
{
return null;
}
}
/**
* Get all keywords
*
* @return array|null Array of strings
*/
public function get_keywords()
{
if ($this->keywords !== null)
{
return $this->keywords;
}
else
{
return null;
}
}
/**
* Get length
*
* @return float Length in bytes
*/
public function get_length()
{
if ($this->length !== null)
{
return $this->length;
}
else
{
return null;
}
}
/**
* Get the URL
*
* @return string|null
*/
public function get_link()
{
if ($this->link !== null)
{
return urldecode($this->link);
}
else
{
return null;
}
}
/**
* Get the medium
*
* @link http://www.rssboard.org/media-rss#media-content
* @return string|null Should be one of 'image', 'audio', 'video', 'document', 'executable'
*/
public function get_medium()
{
if ($this->medium !== null)
{
return $this->medium;
}
else
{
return null;
}
}
/**
* Get the player URL
*
* Typically the same as {@see get_permalink()}
* @return string|null Player URL
*/
public function get_player()
{
if ($this->player !== null)
{
return $this->player;
}
else
{
return null;
}
}
/**
* Get a single rating
*
* @param int $key
* @return SimplePie_Rating|null
*/
public function get_rating($key = 0)
{
$ratings = $this->get_ratings();
if (isset($ratings[$key]))
{
return $ratings[$key];
}
else
{
return null;
}
}
/**
* Get all ratings
*
* @return array|null Array of {@see SimplePie_Rating} objects
*/
public function get_ratings()
{
if ($this->ratings !== null)
{
return $this->ratings;
}
else
{
return null;
}
}
/**
* Get a single restriction
*
* @param int $key
* @return SimplePie_Restriction|null
*/
public function get_restriction($key = 0)
{
$restrictions = $this->get_restrictions();
if (isset($restrictions[$key]))
{
return $restrictions[$key];
}
else
{
return null;
}
}
/**
* Get all restrictions
*
* @return array|null Array of {@see SimplePie_Restriction} objects
*/
public function get_restrictions()
{
if ($this->restrictions !== null)
{
return $this->restrictions;
}
else
{
return null;
}
}
/**
* Get the sampling rate (in kHz)
*
* @return string|null
*/
public function get_sampling_rate()
{
if ($this->samplingrate !== null)
{
return $this->samplingrate;
}
else
{
return null;
}
}
/**
* Get the file size (in MiB)
*
* @return float|null File size in mebibytes (1048 bytes)
*/
public function get_size()
{
$length = $this->get_length();
if ($length !== null)
{
return round($length/1048576, 2);
}
else
{
return null;
}
}
/**
* Get a single thumbnail
*
* @param int $key
* @return string|null Thumbnail URL
*/
public function get_thumbnail($key = 0)
{
$thumbnails = $this->get_thumbnails();
if (isset($thumbnails[$key]))
{
return $thumbnails[$key];
}
else
{
return null;
}
}
/**
* Get all thumbnails
*
* @return array|null Array of thumbnail URLs
*/
public function get_thumbnails()
{
if ($this->thumbnails !== null)
{
return $this->thumbnails;
}
else
{
return null;
}
}
/**
* Get the title
*
* @return string|null
*/
public function get_title()
{
if ($this->title !== null)
{
return $this->title;
}
else
{
return null;
}
}
/**
* Get mimetype of the enclosure
*
* @see get_real_type()
* @return string|null MIME type
*/
public function get_type()
{
if ($this->type !== null)
{
return $this->type;
}
else
{
return null;
}
}
/**
* Get the width
*
* @return string|null
*/
public function get_width()
{
if ($this->width !== null)
{
return $this->width;
}
else
{
return null;
}
}
/**
* Embed the enclosure using `<embed>`
*
* @deprecated Use the second parameter to {@see embed} instead
*
* @param array|string $options See first paramter to {@see embed}
* @return string HTML string to output
*/
public function native_embed($options='')
{
return $this->embed($options, true);
}
/**
* Embed the enclosure using Javascript
*
* `$options` is an array or comma-separated key:value string, with the
* following properties:
*
* - `alt` (string): Alternate content for when an end-user does not have
* the appropriate handler installed or when a file type is
* unsupported. Can be any text or HTML. Defaults to blank.
* - `altclass` (string): If a file type is unsupported, the end-user will
* see the alt text (above) linked directly to the content. That link
* will have this value as its class name. Defaults to blank.
* - `audio` (string): This is an image that should be used as a
* placeholder for audio files before they're loaded (QuickTime-only).
* Can be any relative or absolute URL. Defaults to blank.
* - `bgcolor` (string): The background color for the media, if not
* already transparent. Defaults to `#ffffff`.
* - `height` (integer): The height of the embedded media. Accepts any
* numeric pixel value (such as `360`) or `auto`. Defaults to `auto`,
* and it is recommended that you use this default.
* - `loop` (boolean): Do you want the media to loop when its done?
* Defaults to `false`.
* - `mediaplayer` (string): The location of the included
* `mediaplayer.swf` file. This allows for the playback of Flash Video
* (`.flv`) files, and is the default handler for non-Odeo MP3's.
* Defaults to blank.
* - `video` (string): This is an image that should be used as a
* placeholder for video files before they're loaded (QuickTime-only).
* Can be any relative or absolute URL. Defaults to blank.
* - `width` (integer): The width of the embedded media. Accepts any
* numeric pixel value (such as `480`) or `auto`. Defaults to `auto`,
* and it is recommended that you use this default.
* - `widescreen` (boolean): Is the enclosure widescreen or standard?
* This applies only to video enclosures, and will automatically resize
* the content appropriately. Defaults to `false`, implying 4:3 mode.
*
* Note: Non-widescreen (4:3) mode with `width` and `height` set to `auto`
* will default to 480x360 video resolution. Widescreen (16:9) mode with
* `width` and `height` set to `auto` will default to 480x270 video resolution.
*
* @todo If the dimensions for media:content are defined, use them when width/height are set to 'auto'.
* @param array|string $options Comma-separated key:value list, or array
* @param bool $native Use `<embed>`
* @return string HTML string to output
*/
public function embed($options = '', $native = false)
{
// Set up defaults
$audio = '';
$video = '';
$alt = '';
$altclass = '';
$loop = 'false';
$width = 'auto';
$height = 'auto';
$bgcolor = '#ffffff';
$mediaplayer = '';
$widescreen = false;
$handler = $this->get_handler();
$type = $this->get_real_type();
// Process options and reassign values as necessary
if (is_array($options))
{
extract($options);
}
else
{
$options = explode(',', $options);
foreach($options as $option)
{
$opt = explode(':', $option, 2);
if (isset($opt[0], $opt[1]))
{
$opt[0] = trim($opt[0]);
$opt[1] = trim($opt[1]);
switch ($opt[0])
{
case 'audio':
$audio = $opt[1];
break;
case 'video':
$video = $opt[1];
break;
case 'alt':
$alt = $opt[1];
break;
case 'altclass':
$altclass = $opt[1];
break;
case 'loop':
$loop = $opt[1];
break;
case 'width':
$width = $opt[1];
break;
case 'height':
$height = $opt[1];
break;
case 'bgcolor':
$bgcolor = $opt[1];
break;
case 'mediaplayer':
$mediaplayer = $opt[1];
break;
case 'widescreen':
$widescreen = $opt[1];
break;
}
}
}
}
$mime = explode('/', $type, 2);
$mime = $mime[0];
// Process values for 'auto'
if ($width === 'auto')
{
if ($mime === 'video')
{
if ($height === 'auto')
{
$width = 480;
}
elseif ($widescreen)
{
$width = round((intval($height)/9)*16);
}
else
{
$width = round((intval($height)/3)*4);
}
}
else
{
$width = '100%';
}
}
if ($height === 'auto')
{
if ($mime === 'audio')
{
$height = 0;
}
elseif ($mime === 'video')
{
if ($width === 'auto')
{
if ($widescreen)
{
$height = 270;
}
else
{
$height = 360;
}
}
elseif ($widescreen)
{
$height = round((intval($width)/16)*9);
}
else
{
$height = round((intval($width)/4)*3);
}
}
else
{
$height = 376;
}
}
elseif ($mime === 'audio')
{
$height = 0;
}
// Set proper placeholder value
if ($mime === 'audio')
{
$placeholder = $audio;
}
elseif ($mime === 'video')
{
$placeholder = $video;
}
$embed = '';
// Flash
if ($handler === 'flash')
{
if ($native)
{
$embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>";
}
else
{
$embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>";
}
}
// Flash Media Player file types.
// Preferred handler for MP3 file types.
elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== ''))
{
$height += 20;
if ($native)
{
$embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>";
}
else
{
$embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>";
}
}
// QuickTime 7 file types. Need to test with QuickTime 6.
// Only handle MP3's if the Flash Media Player is not present.
elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === ''))
{
$height += 16;
if ($native)
{
if ($placeholder !== '')
{
$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
}
else
{
$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
}
}
else
{
$embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>";
}
}
// Windows Media
elseif ($handler === 'wmedia')
{
$height += 45;
if ($native)
{
$embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>";
}
else
{
$embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>";
}
}
// Everything else
else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>';
return $embed;
}
/**
* Get the real media type
*
* Often, feeds lie to us, necessitating a bit of deeper inspection. This
* converts types to their canonical representations based on the file
* extension
*
* @see get_type()
* @param bool $find_handler Internal use only, use {@see get_handler()} instead
* @return string MIME type
*/
public function get_real_type($find_handler = false)
{
// Mime-types by handler.
$types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash
$types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player
$types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime
$types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media
$types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3
if ($this->get_type() !== null)
{
$type = strtolower($this->type);
}
else
{
$type = null;
}
// If we encounter an unsupported mime-type, check the file extension and guess intelligently.
if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3)))
{
switch (strtolower($this->get_extension()))
{
// Audio mime-types
case 'aac':
case 'adts':
$type = 'audio/acc';
break;
case 'aif':
case 'aifc':
case 'aiff':
case 'cdda':
$type = 'audio/aiff';
break;
case 'bwf':
$type = 'audio/wav';
break;
case 'kar':
case 'mid':
case 'midi':
case 'smf':
$type = 'audio/midi';
break;
case 'm4a':
$type = 'audio/x-m4a';
break;
case 'mp3':
case 'swa':
$type = 'audio/mp3';
break;
case 'wav':
$type = 'audio/wav';
break;
case 'wax':
$type = 'audio/x-ms-wax';
break;
case 'wma':
$type = 'audio/x-ms-wma';
break;
// Video mime-types
case '3gp':
case '3gpp':
$type = 'video/3gpp';
break;
case '3g2':
case '3gp2':
$type = 'video/3gpp2';
break;
case 'asf':
$type = 'video/x-ms-asf';
break;
case 'flv':
$type = 'video/x-flv';
break;
case 'm1a':
case 'm1s':
case 'm1v':
case 'm15':
case 'm75':
case 'mp2':
case 'mpa':
case 'mpeg':
case 'mpg':
case 'mpm':
case 'mpv':
$type = 'video/mpeg';
break;
case 'm4v':
$type = 'video/x-m4v';
break;
case 'mov':
case 'qt':
$type = 'video/quicktime';
break;
case 'mp4':
case 'mpg4':
$type = 'video/mp4';
break;
case 'sdv':
$type = 'video/sd-video';
break;
case 'wm':
$type = 'video/x-ms-wm';
break;
case 'wmv':
$type = 'video/x-ms-wmv';
break;
case 'wvx':
$type = 'video/x-ms-wvx';
break;
// Flash mime-types
case 'spl':
$type = 'application/futuresplash';
break;
case 'swf':
$type = 'application/x-shockwave-flash';
break;
}
}
if ($find_handler)
{
if (in_array($type, $types_flash))
{
return 'flash';
}
elseif (in_array($type, $types_fmedia))
{
return 'fmedia';
}
elseif (in_array($type, $types_quicktime))
{
return 'quicktime';
}
elseif (in_array($type, $types_wmedia))
{
return 'wmedia';
}
elseif (in_array($type, $types_mp3))
{
return 'mp3';
}
else
{
return null;
}
}
else
{
return $type;
}
}
}
| FTraian/educoptim | public_html/wp-includes/SimplePie/Enclosure.php | PHP | mit | 27,487 |
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Data.Linq.Mapping;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace System.Data.Linq.Provider {
internal static class BindingList {
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
internal static IBindingList Create<T>(DataContext context, IEnumerable<T> sequence) {
List<T> list = sequence.ToList();
MetaTable metaTable = context.Services.Model.GetTable(typeof(T));
if (metaTable != null) {
ITable table = context.GetTable(metaTable.RowType.Type);
Type bindingType = typeof(DataBindingList<>).MakeGenericType(metaTable.RowType.Type);
return (IBindingList)Activator.CreateInstance(bindingType,
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null,
new object[] { list, table }, null
);
} else {
return new SortableBindingList<T>(list);
}
}
}
internal class DataBindingList<TEntity> : SortableBindingList<TEntity>
where TEntity : class {
private Table<TEntity> data;
private TEntity addNewInstance;
private TEntity cancelNewInstance;
private bool addingNewInstance;
internal DataBindingList(IList<TEntity> sequence, Table<TEntity> data)
: base(sequence != null ? sequence : new List<TEntity>()) {
if (sequence == null) {
throw Error.ArgumentNull("sequence");
}
if (data == null) {
throw Error.ArgumentNull("data");
}
this.data = data;
}
protected override object AddNewCore() {
addingNewInstance = true;
addNewInstance = (TEntity)base.AddNewCore();
return addNewInstance;
}
protected override void InsertItem(int index, TEntity item) {
base.InsertItem(index, item);
if (!addingNewInstance && index >= 0 && index <= Count) {
this.data.InsertOnSubmit(item);
}
}
protected override void RemoveItem(int index) {
if (index >= 0 && index < Count && this[index] == cancelNewInstance) {
cancelNewInstance = null;
}
else {
this.data.DeleteOnSubmit(this[index]);
}
base.RemoveItem(index);
}
protected override void SetItem(int index, TEntity item) {
TEntity removedItem = this[index];
base.SetItem(index, item);
if (index >= 0 && index < Count) {
//Check to see if the user is trying to set an item that is currently being added via AddNew
//If so then the list should not continue the AddNew; but instead add the item
//that is being passed in.
if (removedItem == addNewInstance) {
addNewInstance = null;
addingNewInstance = false;
}
else {
this.data.DeleteOnSubmit(removedItem);
}
this.data.InsertOnSubmit(item);
}
}
protected override void ClearItems() {
this.data.DeleteAllOnSubmit(this.data.ToList());
base.ClearItems();
}
public override void EndNew(int itemIndex) {
if (itemIndex >= 0 && itemIndex < Count && this[itemIndex] == addNewInstance) {
this.data.InsertOnSubmit(addNewInstance);
addNewInstance = null;
addingNewInstance = false;
}
base.EndNew(itemIndex);
}
public override void CancelNew(int itemIndex) {
if (itemIndex >= 0 && itemIndex < Count && this[itemIndex] == addNewInstance) {
cancelNewInstance = addNewInstance;
addNewInstance = null;
addingNewInstance = false;
}
base.CancelNew(itemIndex);
}
}
}
| directhex/referencesource | System.Data.Linq/DataBindingList.cs | C# | mit | 4,240 |
module ActiveModel
module Validations
class WithValidator < EachValidator # :nodoc:
def validate_each(record, attr, val)
method_name = options[:with]
if record.method(method_name).arity == 0
record.send method_name
else
record.send method_name, attr
end
end
end
module ClassMethods
# Passes the record off to the class or classes specified and allows them
# to add errors based on more complex conditions.
#
# class Person
# include ActiveModel::Validations
# validates_with MyValidator
# end
#
# class MyValidator < ActiveModel::Validator
# def validate(record)
# if some_complex_logic
# record.errors.add :base, 'This record is invalid'
# end
# end
#
# private
# def some_complex_logic
# # ...
# end
# end
#
# You may also pass it multiple classes, like so:
#
# class Person
# include ActiveModel::Validations
# validates_with MyValidator, MyOtherValidator, on: :create
# end
#
# Configuration options:
# * <tt>:on</tt> - Specifies the contexts where this validation is active.
# Runs in all validation contexts by default (nil). You can pass a symbol
# or an array of symbols. (e.g. <tt>on: :create</tt> or
# <tt>on: :custom_validation_context</tt> or
# <tt>on: [:create, :custom_validation_context]</tt>)
# * <tt>:if</tt> - Specifies a method, proc or string to call to determine
# if the validation should occur (e.g. <tt>if: :allow_validation</tt>,
# or <tt>if: Proc.new { |user| user.signup_step > 2 }</tt>).
# The method, proc or string should return or evaluate to a +true+ or
# +false+ value.
# * <tt>:unless</tt> - Specifies a method, proc or string to call to
# determine if the validation should not occur
# (e.g. <tt>unless: :skip_validation</tt>, or
# <tt>unless: Proc.new { |user| user.signup_step <= 2 }</tt>).
# The method, proc or string should return or evaluate to a +true+ or
# +false+ value.
# * <tt>:strict</tt> - Specifies whether validation should be strict.
# See <tt>ActiveModel::Validation#validates!</tt> for more information.
#
# If you pass any additional configuration options, they will be passed
# to the class and available as +options+:
#
# class Person
# include ActiveModel::Validations
# validates_with MyValidator, my_custom_key: 'my custom value'
# end
#
# class MyValidator < ActiveModel::Validator
# def validate(record)
# options[:my_custom_key] # => "my custom value"
# end
# end
def validates_with(*args, &block)
options = args.extract_options!
options[:class] = self
args.each do |klass|
validator = klass.new(options, &block)
if validator.respond_to?(:attributes) && !validator.attributes.empty?
validator.attributes.each do |attribute|
_validators[attribute.to_sym] << validator
end
else
_validators[nil] << validator
end
validate(validator, options)
end
end
end
# Passes the record off to the class or classes specified and allows them
# to add errors based on more complex conditions.
#
# class Person
# include ActiveModel::Validations
#
# validate :instance_validations
#
# def instance_validations
# validates_with MyValidator
# end
# end
#
# Please consult the class method documentation for more information on
# creating your own validator.
#
# You may also pass it multiple classes, like so:
#
# class Person
# include ActiveModel::Validations
#
# validate :instance_validations, on: :create
#
# def instance_validations
# validates_with MyValidator, MyOtherValidator
# end
# end
#
# Standard configuration options (<tt>:on</tt>, <tt>:if</tt> and
# <tt>:unless</tt>), which are available on the class version of
# +validates_with+, should instead be placed on the +validates+ method
# as these are applied and tested in the callback.
#
# If you pass any additional configuration options, they will be passed
# to the class and available as +options+, please refer to the
# class version of this method for more information.
def validates_with(*args, &block)
options = args.extract_options!
options[:class] = self.class
args.each do |klass|
validator = klass.new(options, &block)
validator.validate(self)
end
end
end
end
| afuerstenau/daily-notes | vendor/cache/ruby/2.5.0/gems/activemodel-5.0.6/lib/active_model/validations/with.rb | Ruby | mit | 4,962 |
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2013, 2014 Damien P. George
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <stdlib.h>
#include "py/obj.h"
#include "py/runtime0.h"
#include "py/runtime.h"
typedef struct _mp_obj_bool_t {
mp_obj_base_t base;
bool value;
} mp_obj_bool_t;
STATIC void bool_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
mp_obj_bool_t *self = MP_OBJ_TO_PTR(self_in);
if (MICROPY_PY_UJSON && kind == PRINT_JSON) {
if (self->value) {
mp_print_str(print, "true");
} else {
mp_print_str(print, "false");
}
} else {
if (self->value) {
mp_print_str(print, "True");
} else {
mp_print_str(print, "False");
}
}
}
STATIC mp_obj_t bool_make_new(const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
(void)type_in;
mp_arg_check_num(n_args, n_kw, 0, 1, false);
if (n_args == 0) {
return mp_const_false;
} else {
return mp_obj_new_bool(mp_obj_is_true(args[0]));
}
}
STATIC mp_obj_t bool_unary_op(mp_uint_t op, mp_obj_t o_in) {
if (op == MP_UNARY_OP_LEN) {
return MP_OBJ_NULL;
}
mp_obj_bool_t *self = MP_OBJ_TO_PTR(o_in);
return mp_unary_op(op, MP_OBJ_NEW_SMALL_INT(self->value));
}
STATIC mp_obj_t bool_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
mp_obj_bool_t *self = MP_OBJ_TO_PTR(lhs_in);
return mp_binary_op(op, MP_OBJ_NEW_SMALL_INT(self->value), rhs_in);
}
const mp_obj_type_t mp_type_bool = {
{ &mp_type_type },
.name = MP_QSTR_bool,
.print = bool_print,
.make_new = bool_make_new,
.unary_op = bool_unary_op,
.binary_op = bool_binary_op,
};
const mp_obj_bool_t mp_const_false_obj = {{&mp_type_bool}, false};
const mp_obj_bool_t mp_const_true_obj = {{&mp_type_bool}, true};
| Peetz0r/micropython-esp32 | py/objbool.c | C | mit | 3,002 |
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.ServiceModel.Activities.Tracking.Configuration
{
internal static class TrackingConfigurationStrings
{
internal const string ActivityDefinitionId = "activityDefinitionId";
internal const string ActivityName = "activityName";
internal const string ActivityQueries = "activityStateQueries";
internal const string ActivityQuery = "activityStateQuery";
internal const string ActivityScheduledQueries = "activityScheduledQueries";
internal const string ActivityScheduledQuery = "activityScheduledQuery";
internal const string ArgumentQueries = "arguments";
internal const string ArgumentQuery = "argument";
internal const string StarWildcard = "*";
internal const string Annotation = "annotation";
internal const string Annotations = "annotations";
internal const string BookmarkResumptionQueries = "bookmarkResumptionQueries";
internal const string BookmarkResumptionQuery = "bookmarkResumptionQuery";
internal const string CancelRequestedQueries = "cancelRequestedQueries";
internal const string CancelRequestedQuery = "cancelRequestedQuery";
internal const string ChildActivityName = "childActivityName";
internal const string Clear = "clear";
internal const string FaultHandlerActivityName = "faultHandlerActivityName";
internal const string FaultSourceActivityName = "faultSourceActivityName";
internal const string FaultPropagationQueries = "faultPropagationQueries";
internal const string FaultPropagationQuery = "faultPropagationQuery";
internal const string ImplementationVisibility = "implementationVisibility";
internal const string Name = "name";
internal const string Profiles = "profiles";
internal const string Remove = "remove";
internal const string State = "state";
internal const string States = "states";
internal const string Tracking = "tracking";
internal const string TrackingProfile = "trackingProfile";
internal const string CustomTrackingQueries = "customTrackingQueries";
internal const string CustomTrackingQuery = "customTrackingQuery";
internal const string StateMachineStateQueries = "stateMachineStateQueries";
internal const string StateMachineStateQuery = "stateMachineStateQuery";
internal const string Value = "value";
internal const string VariableQueries = "variables";
internal const string VariableQuery = "variable";
internal const string Workflow = "workflow";
internal const string WorkflowInstanceQuery = "workflowInstanceQuery";
internal const string WorkflowInstanceQueries = "workflowInstanceQueries";
}
}
| huoxudong125/referencesource | System.ServiceModel.Activities/System/ServiceModel/Activities/Tracking/Configuration/TrackingConfigurationStrings.cs | C# | mit | 3,054 |
/*!
* Bootstrap v3.0.0
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world by @mdo and @fat.
*/
/*! normalize.css v2.1.0 | MIT License | git.io/normalize */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body {
margin: 0;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
margin: 0.67em 0;
font-size: 2em;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
hr {
height: 0;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
mark {
color: #000;
background: #ff0;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
pre {
white-space: pre-wrap;
}
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
fieldset {
padding: 0.35em 0.625em 0.75em;
margin: 0 2px;
border: 1px solid #c0c0c0;
}
legend {
padding: 0;
border: 0;
}
button,
input,
select,
textarea {
margin: 0;
font-family: inherit;
font-size: 100%;
}
button,
input {
line-height: normal;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
cursor: pointer;
-webkit-appearance: button;
}
button[disabled],
html input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
padding: 0;
box-sizing: border-box;
}
input[type="search"] {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
@media print {
* {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
.ir a:after,
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
@page {
margin: 2cm .5cm;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
.navbar {
display: none;
}
.table td,
.table th {
background-color: #fff !important;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
}
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 62.5%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input,
select[multiple],
textarea {
background-image: none;
}
a {
color: #428bca;
text-decoration: none;
}
a:hover,
a:focus {
color: #2a6496;
text-decoration: underline;
}
a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
img {
vertical-align: middle;
}
.img-responsive {
display: block;
height: auto;
max-width: 100%;
}
.img-rounded {
border-radius: 6px;
}
.img-thumbnail {
display: inline-block;
height: auto;
max-width: 100%;
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0;
}
p {
margin: 0 0 10px;
}
.lead {
margin-bottom: 20px;
font-size: 16.099999999999998px;
font-weight: 200;
line-height: 1.4;
}
@media (min-width: 768px) {
.lead {
font-size: 21px;
}
}
small {
font-size: 85%;
}
cite {
font-style: normal;
}
.text-muted {
color: #999999;
}
.text-primary {
color: #428bca;
}
.text-warning {
color: #c09853;
}
.text-danger {
color: #b94a48;
}
.text-success {
color: #468847;
}
.text-info {
color: #3a87ad;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 500;
line-height: 1.1;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small {
font-weight: normal;
line-height: 1;
color: #999999;
}
h1,
h2,
h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h4,
h5,
h6 {
margin-top: 10px;
margin-bottom: 10px;
}
h1,
.h1 {
font-size: 36px;
}
h2,
.h2 {
font-size: 30px;
}
h3,
.h3 {
font-size: 24px;
}
h4,
.h4 {
font-size: 18px;
}
h5,
.h5 {
font-size: 14px;
}
h6,
.h6 {
font-size: 12px;
}
h1 small,
.h1 small {
font-size: 24px;
}
h2 small,
.h2 small {
font-size: 18px;
}
h3 small,
.h3 small,
h4 small,
.h4 small {
font-size: 14px;
}
.page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eeeeee;
}
ul,
ol {
margin-top: 0;
margin-bottom: 10px;
}
ul ul,
ol ul,
ul ol,
ol ol {
margin-bottom: 0;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.list-inline {
padding-left: 0;
list-style: none;
}
.list-inline > li {
display: inline-block;
padding-right: 5px;
padding-left: 5px;
}
dl {
margin-bottom: 20px;
}
dt,
dd {
line-height: 1.428571429;
}
dt {
font-weight: bold;
}
dd {
margin-left: 0;
}
@media (min-width: 768px) {
.dl-horizontal dt {
float: left;
width: 160px;
overflow: hidden;
clear: left;
text-align: right;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #999999;
}
abbr.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
border-left: 5px solid #eeeeee;
}
blockquote p {
font-size: 17.5px;
font-weight: 300;
line-height: 1.25;
}
blockquote p:last-child {
margin-bottom: 0;
}
blockquote small {
display: block;
line-height: 1.428571429;
color: #999999;
}
blockquote small:before {
content: '\2014 \00A0';
}
blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
}
blockquote.pull-right p,
blockquote.pull-right small {
text-align: right;
}
blockquote.pull-right small:before {
content: '';
}
blockquote.pull-right small:after {
content: '\00A0 \2014';
}
q:before,
q:after,
blockquote:before,
blockquote:after {
content: "";
}
address {
display: block;
margin-bottom: 20px;
font-style: normal;
line-height: 1.428571429;
}
code,
pre {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
white-space: nowrap;
background-color: #f9f2f4;
border-radius: 4px;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.428571429;
color: #333333;
word-break: break-all;
word-wrap: break-word;
background-color: #f5f5f5;
border: 1px solid #cccccc;
border-radius: 4px;
}
pre.prettyprint {
margin-bottom: 20px;
}
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border: 0;
}
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.container {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.col-xs-1,
.col-xs-2,
.col-xs-3,
.col-xs-4,
.col-xs-5,
.col-xs-6,
.col-xs-7,
.col-xs-8,
.col-xs-9,
.col-xs-10,
.col-xs-11,
.col-xs-12,
.col-sm-1,
.col-sm-2,
.col-sm-3,
.col-sm-4,
.col-sm-5,
.col-sm-6,
.col-sm-7,
.col-sm-8,
.col-sm-9,
.col-sm-10,
.col-sm-11,
.col-sm-12,
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-11,
.col-md-12,
.col-lg-1,
.col-lg-2,
.col-lg-3,
.col-lg-4,
.col-lg-5,
.col-lg-6,
.col-lg-7,
.col-lg-8,
.col-lg-9,
.col-lg-10,
.col-lg-11,
.col-lg-12 {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
}
.col-xs-1,
.col-xs-2,
.col-xs-3,
.col-xs-4,
.col-xs-5,
.col-xs-6,
.col-xs-7,
.col-xs-8,
.col-xs-9,
.col-xs-10,
.col-xs-11 {
float: left;
}
.col-xs-1 {
width: 8.333333333333332%;
}
.col-xs-2 {
width: 16.666666666666664%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-4 {
width: 33.33333333333333%;
}
.col-xs-5 {
width: 41.66666666666667%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-7 {
width: 58.333333333333336%;
}
.col-xs-8 {
width: 66.66666666666666%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-10 {
width: 83.33333333333334%;
}
.col-xs-11 {
width: 91.66666666666666%;
}
.col-xs-12 {
width: 100%;
}
@media (min-width: 768px) {
.container {
max-width: 750px;
}
.col-sm-1,
.col-sm-2,
.col-sm-3,
.col-sm-4,
.col-sm-5,
.col-sm-6,
.col-sm-7,
.col-sm-8,
.col-sm-9,
.col-sm-10,
.col-sm-11 {
float: left;
}
.col-sm-1 {
width: 8.333333333333332%;
}
.col-sm-2 {
width: 16.666666666666664%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-4 {
width: 33.33333333333333%;
}
.col-sm-5 {
width: 41.66666666666667%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-7 {
width: 58.333333333333336%;
}
.col-sm-8 {
width: 66.66666666666666%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-10 {
width: 83.33333333333334%;
}
.col-sm-11 {
width: 91.66666666666666%;
}
.col-sm-12 {
width: 100%;
}
.col-sm-push-1 {
left: 8.333333333333332%;
}
.col-sm-push-2 {
left: 16.666666666666664%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-4 {
left: 33.33333333333333%;
}
.col-sm-push-5 {
left: 41.66666666666667%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-7 {
left: 58.333333333333336%;
}
.col-sm-push-8 {
left: 66.66666666666666%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-10 {
left: 83.33333333333334%;
}
.col-sm-push-11 {
left: 91.66666666666666%;
}
.col-sm-pull-1 {
right: 8.333333333333332%;
}
.col-sm-pull-2 {
right: 16.666666666666664%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-4 {
right: 33.33333333333333%;
}
.col-sm-pull-5 {
right: 41.66666666666667%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-7 {
right: 58.333333333333336%;
}
.col-sm-pull-8 {
right: 66.66666666666666%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-10 {
right: 83.33333333333334%;
}
.col-sm-pull-11 {
right: 91.66666666666666%;
}
.col-sm-offset-1 {
margin-left: 8.333333333333332%;
}
.col-sm-offset-2 {
margin-left: 16.666666666666664%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-4 {
margin-left: 33.33333333333333%;
}
.col-sm-offset-5 {
margin-left: 41.66666666666667%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-7 {
margin-left: 58.333333333333336%;
}
.col-sm-offset-8 {
margin-left: 66.66666666666666%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-10 {
margin-left: 83.33333333333334%;
}
.col-sm-offset-11 {
margin-left: 91.66666666666666%;
}
}
@media (min-width: 992px) {
.container {
max-width: 970px;
}
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-11 {
float: left;
}
.col-md-1 {
width: 8.333333333333332%;
}
.col-md-2 {
width: 16.666666666666664%;
}
.col-md-3 {
width: 25%;
}
.col-md-4 {
width: 33.33333333333333%;
}
.col-md-5 {
width: 41.66666666666667%;
}
.col-md-6 {
width: 50%;
}
.col-md-7 {
width: 58.333333333333336%;
}
.col-md-8 {
width: 66.66666666666666%;
}
.col-md-9 {
width: 75%;
}
.col-md-10 {
width: 83.33333333333334%;
}
.col-md-11 {
width: 91.66666666666666%;
}
.col-md-12 {
width: 100%;
}
.col-md-push-0 {
left: auto;
}
.col-md-push-1 {
left: 8.333333333333332%;
}
.col-md-push-2 {
left: 16.666666666666664%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-4 {
left: 33.33333333333333%;
}
.col-md-push-5 {
left: 41.66666666666667%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-7 {
left: 58.333333333333336%;
}
.col-md-push-8 {
left: 66.66666666666666%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-10 {
left: 83.33333333333334%;
}
.col-md-push-11 {
left: 91.66666666666666%;
}
.col-md-pull-0 {
right: auto;
}
.col-md-pull-1 {
right: 8.333333333333332%;
}
.col-md-pull-2 {
right: 16.666666666666664%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-4 {
right: 33.33333333333333%;
}
.col-md-pull-5 {
right: 41.66666666666667%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-7 {
right: 58.333333333333336%;
}
.col-md-pull-8 {
right: 66.66666666666666%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-10 {
right: 83.33333333333334%;
}
.col-md-pull-11 {
right: 91.66666666666666%;
}
.col-md-offset-0 {
margin-left: 0;
}
.col-md-offset-1 {
margin-left: 8.333333333333332%;
}
.col-md-offset-2 {
margin-left: 16.666666666666664%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-4 {
margin-left: 33.33333333333333%;
}
.col-md-offset-5 {
margin-left: 41.66666666666667%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-7 {
margin-left: 58.333333333333336%;
}
.col-md-offset-8 {
margin-left: 66.66666666666666%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-10 {
margin-left: 83.33333333333334%;
}
.col-md-offset-11 {
margin-left: 91.66666666666666%;
}
}
@media (min-width: 1200px) {
.container {
max-width: 1170px;
}
.col-lg-1,
.col-lg-2,
.col-lg-3,
.col-lg-4,
.col-lg-5,
.col-lg-6,
.col-lg-7,
.col-lg-8,
.col-lg-9,
.col-lg-10,
.col-lg-11 {
float: left;
}
.col-lg-1 {
width: 8.333333333333332%;
}
.col-lg-2 {
width: 16.666666666666664%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-4 {
width: 33.33333333333333%;
}
.col-lg-5 {
width: 41.66666666666667%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-7 {
width: 58.333333333333336%;
}
.col-lg-8 {
width: 66.66666666666666%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-10 {
width: 83.33333333333334%;
}
.col-lg-11 {
width: 91.66666666666666%;
}
.col-lg-12 {
width: 100%;
}
.col-lg-push-0 {
left: auto;
}
.col-lg-push-1 {
left: 8.333333333333332%;
}
.col-lg-push-2 {
left: 16.666666666666664%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-4 {
left: 33.33333333333333%;
}
.col-lg-push-5 {
left: 41.66666666666667%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-7 {
left: 58.333333333333336%;
}
.col-lg-push-8 {
left: 66.66666666666666%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-10 {
left: 83.33333333333334%;
}
.col-lg-push-11 {
left: 91.66666666666666%;
}
.col-lg-pull-0 {
right: auto;
}
.col-lg-pull-1 {
right: 8.333333333333332%;
}
.col-lg-pull-2 {
right: 16.666666666666664%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-4 {
right: 33.33333333333333%;
}
.col-lg-pull-5 {
right: 41.66666666666667%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-7 {
right: 58.333333333333336%;
}
.col-lg-pull-8 {
right: 66.66666666666666%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-10 {
right: 83.33333333333334%;
}
.col-lg-pull-11 {
right: 91.66666666666666%;
}
.col-lg-offset-0 {
margin-left: 0;
}
.col-lg-offset-1 {
margin-left: 8.333333333333332%;
}
.col-lg-offset-2 {
margin-left: 16.666666666666664%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-4 {
margin-left: 33.33333333333333%;
}
.col-lg-offset-5 {
margin-left: 41.66666666666667%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-7 {
margin-left: 58.333333333333336%;
}
.col-lg-offset-8 {
margin-left: 66.66666666666666%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-10 {
margin-left: 83.33333333333334%;
}
.col-lg-offset-11 {
margin-left: 91.66666666666666%;
}
}
table {
max-width: 100%;
background-color: transparent;
}
th {
text-align: left;
}
.table {
width: 100%;
margin-bottom: 20px;
}
.table thead > tr > th,
.table tbody > tr > th,
.table tfoot > tr > th,
.table thead > tr > td,
.table tbody > tr > td,
.table tfoot > tr > td {
padding: 8px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #dddddd;
}
.table thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #dddddd;
}
.table caption + thead tr:first-child th,
.table colgroup + thead tr:first-child th,
.table thead:first-child tr:first-child th,
.table caption + thead tr:first-child td,
.table colgroup + thead tr:first-child td,
.table thead:first-child tr:first-child td {
border-top: 0;
}
.table tbody + tbody {
border-top: 2px solid #dddddd;
}
.table .table {
background-color: #ffffff;
}
.table-condensed thead > tr > th,
.table-condensed tbody > tr > th,
.table-condensed tfoot > tr > th,
.table-condensed thead > tr > td,
.table-condensed tbody > tr > td,
.table-condensed tfoot > tr > td {
padding: 5px;
}
.table-bordered {
border: 1px solid #dddddd;
}
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
border: 1px solid #dddddd;
}
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
background-color: #f5f5f5;
}
table col[class*="col-"] {
display: table-column;
float: none;
}
table td[class*="col-"],
table th[class*="col-"] {
display: table-cell;
float: none;
}
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.table > thead > tr > td.success,
.table > tbody > tr > td.success,
.table > tfoot > tr > td.success,
.table > thead > tr > th.success,
.table > tbody > tr > th.success,
.table > tfoot > tr > th.success,
.table > thead > tr.success > td,
.table > tbody > tr.success > td,
.table > tfoot > tr.success > td,
.table > thead > tr.success > th,
.table > tbody > tr.success > th,
.table > tfoot > tr.success > th {
background-color: #dff0d8;
border-color: #d6e9c6;
}
.table-hover > tbody > tr > td.success:hover,
.table-hover > tbody > tr > th.success:hover,
.table-hover > tbody > tr.success:hover > td,
.table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6;
border-color: #c9e2b3;
}
.table > thead > tr > td.danger,
.table > tbody > tr > td.danger,
.table > tfoot > tr > td.danger,
.table > thead > tr > th.danger,
.table > tbody > tr > th.danger,
.table > tfoot > tr > th.danger,
.table > thead > tr.danger > td,
.table > tbody > tr.danger > td,
.table > tfoot > tr.danger > td,
.table > thead > tr.danger > th,
.table > tbody > tr.danger > th,
.table > tfoot > tr.danger > th {
background-color: #f2dede;
border-color: #eed3d7;
}
.table-hover > tbody > tr > td.danger:hover,
.table-hover > tbody > tr > th.danger:hover,
.table-hover > tbody > tr.danger:hover > td,
.table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc;
border-color: #e6c1c7;
}
.table > thead > tr > td.warning,
.table > tbody > tr > td.warning,
.table > tfoot > tr > td.warning,
.table > thead > tr > th.warning,
.table > tbody > tr > th.warning,
.table > tfoot > tr > th.warning,
.table > thead > tr.warning > td,
.table > tbody > tr.warning > td,
.table > tfoot > tr.warning > td,
.table > thead > tr.warning > th,
.table > tbody > tr.warning > th,
.table > tfoot > tr.warning > th {
background-color: #fcf8e3;
border-color: #fbeed5;
}
.table-hover > tbody > tr > td.warning:hover,
.table-hover > tbody > tr > th.warning:hover,
.table-hover > tbody > tr.warning:hover > td,
.table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc;
border-color: #f8e5be;
}
@media (max-width: 768px) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-x: scroll;
overflow-y: hidden;
border: 1px solid #dddddd;
}
.table-responsive > .table {
margin-bottom: 0;
background-color: #fff;
}
.table-responsive > .table > thead > tr > th,
.table-responsive > .table > tbody > tr > th,
.table-responsive > .table > tfoot > tr > th,
.table-responsive > .table > thead > tr > td,
.table-responsive > .table > tbody > tr > td,
.table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.table-responsive > .table-bordered {
border: 0;
}
.table-responsive > .table-bordered > thead > tr > th:first-child,
.table-responsive > .table-bordered > tbody > tr > th:first-child,
.table-responsive > .table-bordered > tfoot > tr > th:first-child,
.table-responsive > .table-bordered > thead > tr > td:first-child,
.table-responsive > .table-bordered > tbody > tr > td:first-child,
.table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.table-responsive > .table-bordered > thead > tr > th:last-child,
.table-responsive > .table-bordered > tbody > tr > th:last-child,
.table-responsive > .table-bordered > tfoot > tr > th:last-child,
.table-responsive > .table-bordered > thead > tr > td:last-child,
.table-responsive > .table-bordered > tbody > tr > td:last-child,
.table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.table-responsive > .table-bordered > thead > tr:last-child > th,
.table-responsive > .table-bordered > tbody > tr:last-child > th,
.table-responsive > .table-bordered > tfoot > tr:last-child > th,
.table-responsive > .table-bordered > thead > tr:last-child > td,
.table-responsive > .table-bordered > tbody > tr:last-child > td,
.table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
fieldset {
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
label {
display: inline-block;
margin-bottom: 5px;
font-weight: bold;
}
input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
/* IE8-9 */
line-height: normal;
}
input[type="file"] {
display: block;
}
select[multiple],
select[size] {
height: auto;
}
select optgroup {
font-family: inherit;
font-size: inherit;
font-style: inherit;
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
height: auto;
}
.form-control:-moz-placeholder {
color: #999999;
}
.form-control::-moz-placeholder {
color: #999999;
}
.form-control:-ms-input-placeholder {
color: #999999;
}
.form-control::-webkit-input-placeholder {
color: #999999;
}
.form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
cursor: not-allowed;
background-color: #eeeeee;
}
textarea.form-control {
height: auto;
}
.form-group {
margin-bottom: 15px;
}
.radio,
.checkbox {
display: block;
min-height: 20px;
padding-left: 20px;
margin-top: 10px;
margin-bottom: 10px;
vertical-align: middle;
}
.radio label,
.checkbox label {
display: inline;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
float: left;
margin-left: -20px;
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: -5px;
}
.radio-inline,
.checkbox-inline {
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
vertical-align: middle;
cursor: pointer;
}
.radio-inline + .radio-inline,
.checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
.radio[disabled],
.radio-inline[disabled],
.checkbox[disabled],
.checkbox-inline[disabled],
fieldset[disabled] input[type="radio"],
fieldset[disabled] input[type="checkbox"],
fieldset[disabled] .radio,
fieldset[disabled] .radio-inline,
fieldset[disabled] .checkbox,
fieldset[disabled] .checkbox-inline {
cursor: not-allowed;
}
.input-sm {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-sm {
height: 30px;
line-height: 30px;
}
textarea.input-sm {
height: auto;
}
.input-lg {
height: 45px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.input-lg {
height: 45px;
line-height: 45px;
}
textarea.input-lg {
height: auto;
}
.has-warning .help-block,
.has-warning .control-label {
color: #c09853;
}
.has-warning .form-control {
border-color: #c09853;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-warning .form-control:focus {
border-color: #a47e3c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
.has-warning .input-group-addon {
color: #c09853;
background-color: #fcf8e3;
border-color: #c09853;
}
.has-error .help-block,
.has-error .control-label {
color: #b94a48;
}
.has-error .form-control {
border-color: #b94a48;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-error .form-control:focus {
border-color: #953b39;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.has-error .input-group-addon {
color: #b94a48;
background-color: #f2dede;
border-color: #b94a48;
}
.has-success .help-block,
.has-success .control-label {
color: #468847;
}
.has-success .form-control {
border-color: #468847;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-success .form-control:focus {
border-color: #356635;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
.has-success .input-group-addon {
color: #468847;
background-color: #dff0d8;
border-color: #468847;
}
.form-control-static {
padding-top: 7px;
margin-bottom: 0;
}
.help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
}
@media (min-width: 768px) {
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .form-control {
display: inline-block;
}
.form-inline .radio,
.form-inline .checkbox {
display: inline-block;
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
.form-horizontal .control-label,
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
padding-top: 7px;
margin-top: 0;
margin-bottom: 0;
}
.form-horizontal .form-group {
margin-right: -15px;
margin-left: -15px;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
text-align: right;
}
}
.btn {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.428571429;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.btn:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.btn:hover,
.btn:focus {
color: #333333;
text-decoration: none;
}
.btn:active,
.btn.active {
background-image: none;
outline: 0;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
pointer-events: none;
cursor: not-allowed;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-default {
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
}
.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active,
.open .dropdown-toggle.btn-default {
color: #333333;
background-color: #ebebeb;
border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open .dropdown-toggle.btn-default {
background-image: none;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default,
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled:active,
.btn-default[disabled]:active,
fieldset[disabled] .btn-default:active,
.btn-default.disabled.active,
.btn-default[disabled].active,
fieldset[disabled] .btn-default.active {
background-color: #ffffff;
border-color: #cccccc;
}
.btn-primary {
color: #ffffff;
background-color: #428bca;
border-color: #357ebd;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
background-color: #428bca;
border-color: #357ebd;
}
.btn-warning {
color: #ffffff;
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.open .dropdown-toggle.btn-warning {
color: #ffffff;
background-color: #ed9c28;
border-color: #d58512;
}
.btn-warning:active,
.btn-warning.active,
.open .dropdown-toggle.btn-warning {
background-image: none;
}
.btn-warning.disabled,
.btn-warning[disabled],
fieldset[disabled] .btn-warning,
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled:active,
.btn-warning[disabled]:active,
fieldset[disabled] .btn-warning:active,
.btn-warning.disabled.active,
.btn-warning[disabled].active,
fieldset[disabled] .btn-warning.active {
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-danger {
color: #ffffff;
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.open .dropdown-toggle.btn-danger {
color: #ffffff;
background-color: #d2322d;
border-color: #ac2925;
}
.btn-danger:active,
.btn-danger.active,
.open .dropdown-toggle.btn-danger {
background-image: none;
}
.btn-danger.disabled,
.btn-danger[disabled],
fieldset[disabled] .btn-danger,
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled:active,
.btn-danger[disabled]:active,
fieldset[disabled] .btn-danger:active,
.btn-danger.disabled.active,
.btn-danger[disabled].active,
fieldset[disabled] .btn-danger.active {
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-success {
color: #ffffff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
color: #ffffff;
background-color: #47a447;
border-color: #398439;
}
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
background-image: none;
}
.btn-success.disabled,
.btn-success[disabled],
fieldset[disabled] .btn-success,
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active,
.btn-success.disabled.active,
.btn-success[disabled].active,
fieldset[disabled] .btn-success.active {
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-info {
color: #ffffff;
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active,
.open .dropdown-toggle.btn-info {
color: #ffffff;
background-color: #39b3d7;
border-color: #269abc;
}
.btn-info:active,
.btn-info.active,
.open .dropdown-toggle.btn-info {
background-image: none;
}
.btn-info.disabled,
.btn-info[disabled],
fieldset[disabled] .btn-info,
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled:active,
.btn-info[disabled]:active,
fieldset[disabled] .btn-info:active,
.btn-info.disabled.active,
.btn-info[disabled].active,
fieldset[disabled] .btn-info.active {
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-link {
font-weight: normal;
color: #428bca;
cursor: pointer;
border-radius: 0;
}
.btn-link,
.btn-link:active,
.btn-link[disabled],
fieldset[disabled] .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:active {
border-color: transparent;
}
.btn-link:hover,
.btn-link:focus {
color: #2a6496;
text-decoration: underline;
background-color: transparent;
}
.btn-link[disabled]:hover,
fieldset[disabled] .btn-link:hover,
.btn-link[disabled]:focus,
fieldset[disabled] .btn-link:focus {
color: #999999;
text-decoration: none;
}
.btn-lg {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.btn-sm,
.btn-xs {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-xs {
padding: 1px 5px;
}
.btn-block {
display: block;
width: 100%;
padding-right: 0;
padding-left: 0;
}
.btn-block + .btn-block {
margin-top: 5px;
}
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
width: 100%;
}
.fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.fade.in {
opacity: 1;
}
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
transition: height 0.35s ease;
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
-webkit-font-smoothing: antialiased;
font-style: normal;
font-weight: normal;
line-height: 1;
}
.glyphicon-asterisk:before {
content: "\2a";
}
.glyphicon-plus:before {
content: "\2b";
}
.glyphicon-euro:before {
content: "\20ac";
}
.glyphicon-minus:before {
content: "\2212";
}
.glyphicon-cloud:before {
content: "\2601";
}
.glyphicon-envelope:before {
content: "\2709";
}
.glyphicon-pencil:before {
content: "\270f";
}
.glyphicon-glass:before {
content: "\e001";
}
.glyphicon-music:before {
content: "\e002";
}
.glyphicon-search:before {
content: "\e003";
}
.glyphicon-heart:before {
content: "\e005";
}
.glyphicon-star:before {
content: "\e006";
}
.glyphicon-star-empty:before {
content: "\e007";
}
.glyphicon-user:before {
content: "\e008";
}
.glyphicon-film:before {
content: "\e009";
}
.glyphicon-th-large:before {
content: "\e010";
}
.glyphicon-th:before {
content: "\e011";
}
.glyphicon-th-list:before {
content: "\e012";
}
.glyphicon-ok:before {
content: "\e013";
}
.glyphicon-remove:before {
content: "\e014";
}
.glyphicon-zoom-in:before {
content: "\e015";
}
.glyphicon-zoom-out:before {
content: "\e016";
}
.glyphicon-off:before {
content: "\e017";
}
.glyphicon-signal:before {
content: "\e018";
}
.glyphicon-cog:before {
content: "\e019";
}
.glyphicon-trash:before {
content: "\e020";
}
.glyphicon-home:before {
content: "\e021";
}
.glyphicon-file:before {
content: "\e022";
}
.glyphicon-time:before {
content: "\e023";
}
.glyphicon-road:before {
content: "\e024";
}
.glyphicon-download-alt:before {
content: "\e025";
}
.glyphicon-download:before {
content: "\e026";
}
.glyphicon-upload:before {
content: "\e027";
}
.glyphicon-inbox:before {
content: "\e028";
}
.glyphicon-play-circle:before {
content: "\e029";
}
.glyphicon-repeat:before {
content: "\e030";
}
.glyphicon-refresh:before {
content: "\e031";
}
.glyphicon-list-alt:before {
content: "\e032";
}
.glyphicon-flag:before {
content: "\e034";
}
.glyphicon-headphones:before {
content: "\e035";
}
.glyphicon-volume-off:before {
content: "\e036";
}
.glyphicon-volume-down:before {
content: "\e037";
}
.glyphicon-volume-up:before {
content: "\e038";
}
.glyphicon-qrcode:before {
content: "\e039";
}
.glyphicon-barcode:before {
content: "\e040";
}
.glyphicon-tag:before {
content: "\e041";
}
.glyphicon-tags:before {
content: "\e042";
}
.glyphicon-book:before {
content: "\e043";
}
.glyphicon-print:before {
content: "\e045";
}
.glyphicon-font:before {
content: "\e047";
}
.glyphicon-bold:before {
content: "\e048";
}
.glyphicon-italic:before {
content: "\e049";
}
.glyphicon-text-height:before {
content: "\e050";
}
.glyphicon-text-width:before {
content: "\e051";
}
.glyphicon-align-left:before {
content: "\e052";
}
.glyphicon-align-center:before {
content: "\e053";
}
.glyphicon-align-right:before {
content: "\e054";
}
.glyphicon-align-justify:before {
content: "\e055";
}
.glyphicon-list:before {
content: "\e056";
}
.glyphicon-indent-left:before {
content: "\e057";
}
.glyphicon-indent-right:before {
content: "\e058";
}
.glyphicon-facetime-video:before {
content: "\e059";
}
.glyphicon-picture:before {
content: "\e060";
}
.glyphicon-map-marker:before {
content: "\e062";
}
.glyphicon-adjust:before {
content: "\e063";
}
.glyphicon-tint:before {
content: "\e064";
}
.glyphicon-edit:before {
content: "\e065";
}
.glyphicon-share:before {
content: "\e066";
}
.glyphicon-check:before {
content: "\e067";
}
.glyphicon-move:before {
content: "\e068";
}
.glyphicon-step-backward:before {
content: "\e069";
}
.glyphicon-fast-backward:before {
content: "\e070";
}
.glyphicon-backward:before {
content: "\e071";
}
.glyphicon-play:before {
content: "\e072";
}
.glyphicon-pause:before {
content: "\e073";
}
.glyphicon-stop:before {
content: "\e074";
}
.glyphicon-forward:before {
content: "\e075";
}
.glyphicon-fast-forward:before {
content: "\e076";
}
.glyphicon-step-forward:before {
content: "\e077";
}
.glyphicon-eject:before {
content: "\e078";
}
.glyphicon-chevron-left:before {
content: "\e079";
}
.glyphicon-chevron-right:before {
content: "\e080";
}
.glyphicon-plus-sign:before {
content: "\e081";
}
.glyphicon-minus-sign:before {
content: "\e082";
}
.glyphicon-remove-sign:before {
content: "\e083";
}
.glyphicon-ok-sign:before {
content: "\e084";
}
.glyphicon-question-sign:before {
content: "\e085";
}
.glyphicon-info-sign:before {
content: "\e086";
}
.glyphicon-screenshot:before {
content: "\e087";
}
.glyphicon-remove-circle:before {
content: "\e088";
}
.glyphicon-ok-circle:before {
content: "\e089";
}
.glyphicon-ban-circle:before {
content: "\e090";
}
.glyphicon-arrow-left:before {
content: "\e091";
}
.glyphicon-arrow-right:before {
content: "\e092";
}
.glyphicon-arrow-up:before {
content: "\e093";
}
.glyphicon-arrow-down:before {
content: "\e094";
}
.glyphicon-share-alt:before {
content: "\e095";
}
.glyphicon-resize-full:before {
content: "\e096";
}
.glyphicon-resize-small:before {
content: "\e097";
}
.glyphicon-exclamation-sign:before {
content: "\e101";
}
.glyphicon-gift:before {
content: "\e102";
}
.glyphicon-leaf:before {
content: "\e103";
}
.glyphicon-eye-open:before {
content: "\e105";
}
.glyphicon-eye-close:before {
content: "\e106";
}
.glyphicon-warning-sign:before {
content: "\e107";
}
.glyphicon-plane:before {
content: "\e108";
}
.glyphicon-random:before {
content: "\e110";
}
.glyphicon-comment:before {
content: "\e111";
}
.glyphicon-magnet:before {
content: "\e112";
}
.glyphicon-chevron-up:before {
content: "\e113";
}
.glyphicon-chevron-down:before {
content: "\e114";
}
.glyphicon-retweet:before {
content: "\e115";
}
.glyphicon-shopping-cart:before {
content: "\e116";
}
.glyphicon-folder-close:before {
content: "\e117";
}
.glyphicon-folder-open:before {
content: "\e118";
}
.glyphicon-resize-vertical:before {
content: "\e119";
}
.glyphicon-resize-horizontal:before {
content: "\e120";
}
.glyphicon-hdd:before {
content: "\e121";
}
.glyphicon-bullhorn:before {
content: "\e122";
}
.glyphicon-certificate:before {
content: "\e124";
}
.glyphicon-thumbs-up:before {
content: "\e125";
}
.glyphicon-thumbs-down:before {
content: "\e126";
}
.glyphicon-hand-right:before {
content: "\e127";
}
.glyphicon-hand-left:before {
content: "\e128";
}
.glyphicon-hand-up:before {
content: "\e129";
}
.glyphicon-hand-down:before {
content: "\e130";
}
.glyphicon-circle-arrow-right:before {
content: "\e131";
}
.glyphicon-circle-arrow-left:before {
content: "\e132";
}
.glyphicon-circle-arrow-up:before {
content: "\e133";
}
.glyphicon-circle-arrow-down:before {
content: "\e134";
}
.glyphicon-globe:before {
content: "\e135";
}
.glyphicon-tasks:before {
content: "\e137";
}
.glyphicon-filter:before {
content: "\e138";
}
.glyphicon-fullscreen:before {
content: "\e140";
}
.glyphicon-dashboard:before {
content: "\e141";
}
.glyphicon-heart-empty:before {
content: "\e143";
}
.glyphicon-link:before {
content: "\e144";
}
.glyphicon-phone:before {
content: "\e145";
}
.glyphicon-usd:before {
content: "\e148";
}
.glyphicon-gbp:before {
content: "\e149";
}
.glyphicon-sort:before {
content: "\e150";
}
.glyphicon-sort-by-alphabet:before {
content: "\e151";
}
.glyphicon-sort-by-alphabet-alt:before {
content: "\e152";
}
.glyphicon-sort-by-order:before {
content: "\e153";
}
.glyphicon-sort-by-order-alt:before {
content: "\e154";
}
.glyphicon-sort-by-attributes:before {
content: "\e155";
}
.glyphicon-sort-by-attributes-alt:before {
content: "\e156";
}
.glyphicon-unchecked:before {
content: "\e157";
}
.glyphicon-expand:before {
content: "\e158";
}
.glyphicon-collapse-down:before {
content: "\e159";
}
.glyphicon-collapse-up:before {
content: "\e160";
}
.glyphicon-log-in:before {
content: "\e161";
}
.glyphicon-flash:before {
content: "\e162";
}
.glyphicon-log-out:before {
content: "\e163";
}
.glyphicon-new-window:before {
content: "\e164";
}
.glyphicon-record:before {
content: "\e165";
}
.glyphicon-save:before {
content: "\e166";
}
.glyphicon-open:before {
content: "\e167";
}
.glyphicon-saved:before {
content: "\e168";
}
.glyphicon-import:before {
content: "\e169";
}
.glyphicon-export:before {
content: "\e170";
}
.glyphicon-send:before {
content: "\e171";
}
.glyphicon-floppy-disk:before {
content: "\e172";
}
.glyphicon-floppy-saved:before {
content: "\e173";
}
.glyphicon-floppy-remove:before {
content: "\e174";
}
.glyphicon-floppy-save:before {
content: "\e175";
}
.glyphicon-floppy-open:before {
content: "\e176";
}
.glyphicon-credit-card:before {
content: "\e177";
}
.glyphicon-transfer:before {
content: "\e178";
}
.glyphicon-cutlery:before {
content: "\e179";
}
.glyphicon-header:before {
content: "\e180";
}
.glyphicon-compressed:before {
content: "\e181";
}
.glyphicon-earphone:before {
content: "\e182";
}
.glyphicon-phone-alt:before {
content: "\e183";
}
.glyphicon-tower:before {
content: "\e184";
}
.glyphicon-stats:before {
content: "\e185";
}
.glyphicon-sd-video:before {
content: "\e186";
}
.glyphicon-hd-video:before {
content: "\e187";
}
.glyphicon-subtitles:before {
content: "\e188";
}
.glyphicon-sound-stereo:before {
content: "\e189";
}
.glyphicon-sound-dolby:before {
content: "\e190";
}
.glyphicon-sound-5-1:before {
content: "\e191";
}
.glyphicon-sound-6-1:before {
content: "\e192";
}
.glyphicon-sound-7-1:before {
content: "\e193";
}
.glyphicon-copyright-mark:before {
content: "\e194";
}
.glyphicon-registration-mark:before {
content: "\e195";
}
.glyphicon-cloud-download:before {
content: "\e197";
}
.glyphicon-cloud-upload:before {
content: "\e198";
}
.glyphicon-tree-conifer:before {
content: "\e199";
}
.glyphicon-tree-deciduous:before {
content: "\e200";
}
.glyphicon-briefcase:before {
content: "\1f4bc";
}
.glyphicon-calendar:before {
content: "\1f4c5";
}
.glyphicon-pushpin:before {
content: "\1f4cc";
}
.glyphicon-paperclip:before {
content: "\1f4ce";
}
.glyphicon-camera:before {
content: "\1f4f7";
}
.glyphicon-lock:before {
content: "\1f512";
}
.glyphicon-bell:before {
content: "\1f514";
}
.glyphicon-bookmark:before {
content: "\1f516";
}
.glyphicon-fire:before {
content: "\1f525";
}
.glyphicon-wrench:before {
content: "\1f527";
}
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid #000000;
border-right: 4px solid transparent;
border-bottom: 0 dotted;
border-left: 4px solid transparent;
content: "";
}
.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
list-style: none;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #333333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
color: #ffffff;
text-decoration: none;
background-color: #428bca;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
background-color: #428bca;
outline: 0;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #999999;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.428571429;
color: #999999;
}
.dropdown-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0 dotted;
border-bottom: 4px solid #000000;
content: "";
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
right: 0;
left: auto;
}
}
.btn-default .caret {
border-top-color: #333333;
}
.btn-primary .caret,
.btn-success .caret,
.btn-warning .caret,
.btn-danger .caret,
.btn-info .caret {
border-top-color: #fff;
}
.dropup .btn-default .caret {
border-bottom-color: #333333;
}
.dropup .btn-primary .caret,
.dropup .btn-success .caret,
.dropup .btn-warning .caret,
.dropup .btn-danger .caret,
.dropup .btn-info .caret {
border-bottom-color: #fff;
}
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.btn-group > .btn,
.btn-group-vertical > .btn {
position: relative;
float: left;
}
.btn-group > .btn:hover,
.btn-group-vertical > .btn:hover,
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus,
.btn-group > .btn:active,
.btn-group-vertical > .btn:active,
.btn-group > .btn.active,
.btn-group-vertical > .btn.active {
z-index: 2;
}
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus {
outline: none;
}
.btn-group .btn + .btn,
.btn-group .btn + .btn-group,
.btn-group .btn-group + .btn,
.btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.btn-toolbar:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar .btn-group {
float: left;
}
.btn-toolbar > .btn + .btn,
.btn-toolbar > .btn-group + .btn,
.btn-toolbar > .btn + .btn-group,
.btn-toolbar > .btn-group + .btn-group {
margin-left: 5px;
}
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.btn-group > .btn:first-child {
margin-left: 0;
}
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.btn-group > .btn-group {
float: left;
}
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group > .btn-group:first-child > .btn:last-child,
.btn-group > .btn-group:first-child > .dropdown-toggle {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.btn-group > .btn-group:last-child > .btn:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group-xs > .btn {
padding: 5px 10px;
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.btn-group > .btn + .dropdown-toggle {
padding-right: 8px;
padding-left: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-right: 12px;
padding-left: 12px;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn .caret {
margin-left: 0;
}
.btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.btn-group-vertical > .btn,
.btn-group-vertical > .btn-group {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group > .btn {
float: none;
}
.btn-group-vertical > .btn + .btn,
.btn-group-vertical > .btn + .btn-group,
.btn-group-vertical > .btn-group + .btn,
.btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn:last-child:not(:first-child) {
border-top-right-radius: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 0;
}
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group-vertical > .btn-group:first-child > .btn:last-child,
.btn-group-vertical > .btn-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn-group:last-child > .btn:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.btn-group-justified {
display: table;
width: 100%;
border-collapse: separate;
table-layout: fixed;
}
.btn-group-justified .btn {
display: table-cell;
float: none;
width: 1%;
}
[data-toggle="buttons"] > .btn > input[type="radio"],
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group.col {
float: none;
padding-right: 0;
padding-left: 0;
}
.input-group .form-control {
width: 100%;
margin-bottom: 0;
}
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
height: 45px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.input-group-lg > .form-control,
select.input-group-lg > .input-group-addon,
select.input-group-lg > .input-group-btn > .btn {
height: 45px;
line-height: 45px;
}
textarea.input-group-lg > .form-control,
textarea.input-group-lg > .input-group-addon,
textarea.input-group-lg > .input-group-btn > .btn {
height: auto;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-group-sm > .form-control,
select.input-group-sm > .input-group-addon,
select.input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.input-group-sm > .form-control,
textarea.input-group-sm > .input-group-addon,
textarea.input-group-sm > .input-group-btn > .btn {
height: auto;
}
.input-group-addon,
.input-group-btn,
.input-group .form-control {
display: table-cell;
}
.input-group-addon:not(:first-child):not(:last-child),
.input-group-btn:not(:first-child):not(:last-child),
.input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.input-group-addon,
.input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
text-align: center;
background-color: #eeeeee;
border: 1px solid #cccccc;
border-radius: 4px;
}
.input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.input-group-addon.input-lg {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.input-group-addon input[type="radio"],
.input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.input-group-addon:last-child {
border-left: 0;
}
.input-group-btn {
position: relative;
white-space: nowrap;
}
.input-group-btn > .btn {
position: relative;
}
.input-group-btn > .btn + .btn {
margin-left: -4px;
}
.input-group-btn > .btn:hover,
.input-group-btn > .btn:active {
z-index: 2;
}
.nav {
padding-left: 0;
margin-bottom: 0;
list-style: none;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.nav > li {
position: relative;
display: block;
}
.nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.nav > li > a:hover,
.nav > li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.nav > li.disabled > a {
color: #999999;
}
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #999999;
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
}
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #eeeeee;
border-color: #428bca;
}
.nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.nav > li > a > img {
max-width: none;
}
.nav-tabs {
border-bottom: 1px solid #dddddd;
}
.nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.nav-tabs > li > a {
margin-right: 2px;
line-height: 1.428571429;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #dddddd;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
color: #555555;
cursor: default;
background-color: #ffffff;
border: 1px solid #dddddd;
border-bottom-color: transparent;
}
.nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.nav-tabs.nav-justified > li {
float: none;
}
.nav-tabs.nav-justified > li > a {
text-align: center;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
}
.nav-tabs.nav-justified > li > a {
margin-right: 0;
border-bottom: 1px solid #dddddd;
}
.nav-tabs.nav-justified > .active > a {
border-bottom-color: #ffffff;
}
.nav-pills > li {
float: left;
}
.nav-pills > li > a {
border-radius: 5px;
}
.nav-pills > li + li {
margin-left: 2px;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
color: #ffffff;
background-color: #428bca;
}
.nav-stacked > li {
float: none;
}
.nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.nav-justified {
width: 100%;
}
.nav-justified > li {
float: none;
}
.nav-justified > li > a {
text-align: center;
}
@media (min-width: 768px) {
.nav-justified > li {
display: table-cell;
width: 1%;
}
}
.nav-tabs-justified {
border-bottom: 0;
}
.nav-tabs-justified > li > a {
margin-right: 0;
border-bottom: 1px solid #dddddd;
}
.nav-tabs-justified > .active > a {
border-bottom-color: #ffffff;
}
.tabbable:before,
.tabbable:after {
display: table;
content: " ";
}
.tabbable:after {
clear: both;
}
.tabbable:before,
.tabbable:after {
display: table;
content: " ";
}
.tabbable:after {
clear: both;
}
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: none;
}
.tab-content > .active,
.pill-content > .active {
display: block;
}
.nav .caret {
border-top-color: #428bca;
border-bottom-color: #428bca;
}
.nav a:hover .caret {
border-top-color: #2a6496;
border-bottom-color: #2a6496;
}
.nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar {
position: relative;
z-index: 1000;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
@media (min-width: 768px) {
.navbar-header {
float: left;
}
}
.navbar-collapse {
max-height: 340px;
padding-right: 15px;
padding-left: 15px;
overflow-x: visible;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.navbar-collapse.in {
overflow-y: visible;
}
.navbar-collapse .navbar-nav.navbar-left:first-child {
margin-left: -15px;
}
.navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: -15px;
}
.navbar-collapse .navbar-text:last-child {
margin-right: 0;
}
}
.container > .navbar-header,
.container > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.container > .navbar-header,
.container > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.navbar-static-top {
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.navbar-static-top {
border-radius: 0;
}
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
}
.navbar-fixed-top {
top: 0;
z-index: 1030;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
}
.navbar-brand {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
}
.navbar-brand:hover,
.navbar-brand:focus {
text-decoration: none;
}
@media (min-width: 768px) {
.navbar > .container .navbar-brand {
margin-left: -15px;
}
}
.navbar-toggle {
position: relative;
float: right;
padding: 9px 10px;
margin-top: 8px;
margin-right: 15px;
margin-bottom: 8px;
background-color: transparent;
border: 1px solid transparent;
border-radius: 4px;
}
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.navbar-toggle {
display: none;
}
}
.navbar-nav {
margin: 7.5px -15px;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.navbar-nav .open .dropdown-menu > li > a,
.navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.navbar-nav {
float: left;
margin: 0;
}
.navbar-nav > li {
float: left;
}
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
@media (min-width: 768px) {
.navbar-left {
float: left !important;
}
.navbar-right {
float: right !important;
}
}
.navbar-form {
padding: 10px 15px;
margin-top: 8px;
margin-right: -15px;
margin-bottom: 8px;
margin-left: -15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
}
@media (min-width: 768px) {
.navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .form-control {
display: inline-block;
}
.navbar-form .radio,
.navbar-form .checkbox {
display: inline-block;
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
}
.navbar-form .radio input[type="radio"],
.navbar-form .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
}
@media (min-width: 768px) {
.navbar-form {
width: auto;
padding-top: 0;
padding-bottom: 0;
margin-right: 0;
margin-left: 0;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.navbar-nav.pull-right > li > .dropdown-menu,
.navbar-nav > li > .dropdown-menu.pull-right {
right: 0;
left: auto;
}
.navbar-btn {
margin-top: 8px;
margin-bottom: 8px;
}
.navbar-text {
float: left;
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.navbar-text {
margin-right: 15px;
margin-left: 15px;
}
}
.navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7;
}
.navbar-default .navbar-brand {
color: #777777;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.navbar-default .navbar-text {
color: #777777;
}
.navbar-default .navbar-nav > li > a {
color: #777777;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.navbar-default .navbar-toggle {
border-color: #dddddd;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #dddddd;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #cccccc;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #e6e6e6;
}
.navbar-default .navbar-nav > .dropdown > a:hover .caret,
.navbar-default .navbar-nav > .dropdown > a:focus .caret {
border-top-color: #333333;
border-bottom-color: #333333;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav > .open > a .caret,
.navbar-default .navbar-nav > .open > a:hover .caret,
.navbar-default .navbar-nav > .open > a:focus .caret {
border-top-color: #555555;
border-bottom-color: #555555;
}
.navbar-default .navbar-nav > .dropdown > a .caret {
border-top-color: #777777;
border-bottom-color: #777777;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777777;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
}
.navbar-default .navbar-link {
color: #777777;
}
.navbar-default .navbar-link:hover {
color: #333333;
}
.navbar-inverse {
background-color: #222222;
border-color: #080808;
}
.navbar-inverse .navbar-brand {
color: #999999;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #ffffff;
background-color: transparent;
}
.navbar-inverse .navbar-text {
color: #999999;
}
.navbar-inverse .navbar-nav > li > a {
color: #999999;
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.navbar-inverse .navbar-nav > .disabled > a,
.navbar-inverse .navbar-nav > .disabled > a:hover,
.navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
.navbar-inverse .navbar-toggle {
border-color: #333333;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #333333;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border-color: #101010;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
color: #ffffff;
background-color: #080808;
}
.navbar-inverse .navbar-nav > .dropdown > a:hover .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.navbar-inverse .navbar-nav > .dropdown > a .caret {
border-top-color: #999999;
border-bottom-color: #999999;
}
.navbar-inverse .navbar-nav > .open > a .caret,
.navbar-inverse .navbar-nav > .open > a:hover .caret,
.navbar-inverse .navbar-nav > .open > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #999999;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
}
.navbar-inverse .navbar-link {
color: #999999;
}
.navbar-inverse .navbar-link:hover {
color: #ffffff;
}
.breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb > li + li:before {
padding: 0 5px;
color: #cccccc;
content: "/\00a0";
}
.breadcrumb > .active {
color: #999999;
}
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.pagination > li {
display: inline;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
margin-left: -1px;
line-height: 1.428571429;
text-decoration: none;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
background-color: #eeeeee;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
z-index: 2;
color: #ffffff;
cursor: default;
background-color: #428bca;
border-color: #428bca;
}
.pagination > .disabled > span,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
color: #999999;
cursor: not-allowed;
background-color: #ffffff;
border-color: #dddddd;
}
.pagination-lg > li > a,
.pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px;
}
.pagination-lg > li:first-child > a,
.pagination-lg > li:first-child > span {
border-bottom-left-radius: 6px;
border-top-left-radius: 6px;
}
.pagination-lg > li:last-child > a,
.pagination-lg > li:last-child > span {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
.pagination-sm > li > a,
.pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
}
.pagination-sm > li:first-child > a,
.pagination-sm > li:first-child > span {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.pagination-sm > li:last-child > a,
.pagination-sm > li:last-child > span {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.pager {
padding-left: 0;
margin: 20px 0;
text-align: center;
list-style: none;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.pager li {
display: inline;
}
.pager li > a,
.pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 15px;
}
.pager li > a:hover,
.pager li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.pager .next > a,
.pager .next > span {
float: right;
}
.pager .previous > a,
.pager .previous > span {
float: left;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
color: #999999;
cursor: not-allowed;
background-color: #ffffff;
}
.label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
.label[href]:hover,
.label[href]:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.label:empty {
display: none;
}
.label-default {
background-color: #999999;
}
.label-default[href]:hover,
.label-default[href]:focus {
background-color: #808080;
}
.label-primary {
background-color: #428bca;
}
.label-primary[href]:hover,
.label-primary[href]:focus {
background-color: #3071a9;
}
.label-success {
background-color: #5cb85c;
}
.label-success[href]:hover,
.label-success[href]:focus {
background-color: #449d44;
}
.label-info {
background-color: #5bc0de;
}
.label-info[href]:hover,
.label-info[href]:focus {
background-color: #31b0d5;
}
.label-warning {
background-color: #f0ad4e;
}
.label-warning[href]:hover,
.label-warning[href]:focus {
background-color: #ec971f;
}
.label-danger {
background-color: #d9534f;
}
.label-danger[href]:hover,
.label-danger[href]:focus {
background-color: #c9302c;
}
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
background-color: #999999;
border-radius: 10px;
}
.badge:empty {
display: none;
}
a.badge:hover,
a.badge:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.btn .badge {
position: relative;
top: -1px;
}
a.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #428bca;
background-color: #ffffff;
}
.nav-pills > li > a > .badge {
margin-left: 3px;
}
.jumbotron {
padding: 30px;
margin-bottom: 30px;
font-size: 21px;
font-weight: 200;
line-height: 2.1428571435;
color: inherit;
background-color: #eeeeee;
}
.jumbotron h1 {
line-height: 1;
color: inherit;
}
.jumbotron p {
line-height: 1.4;
}
.container .jumbotron {
border-radius: 6px;
}
@media screen and (min-width: 768px) {
.jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .jumbotron {
padding-right: 60px;
padding-left: 60px;
}
.jumbotron h1 {
font-size: 63px;
}
}
.thumbnail {
display: inline-block;
display: block;
height: auto;
max-width: 100%;
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.thumbnail > img {
display: block;
height: auto;
max-width: 100%;
}
a.thumbnail:hover,
a.thumbnail:focus {
border-color: #428bca;
}
.thumbnail > img {
margin-right: auto;
margin-left: auto;
}
.thumbnail .caption {
padding: 9px;
color: #333333;
}
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: bold;
}
.alert > p,
.alert > ul {
margin-bottom: 0;
}
.alert > p + p {
margin-top: 5px;
}
.alert-dismissable {
padding-right: 35px;
}
.alert-dismissable .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.alert-success {
color: #468847;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #356635;
}
.alert-info {
color: #3a87ad;
background-color: #d9edf7;
border-color: #bce8f1;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #2d6987;
}
.alert-warning {
color: #c09853;
background-color: #fcf8e3;
border-color: #fbeed5;
}
.alert-warning hr {
border-top-color: #f8e5be;
}
.alert-warning .alert-link {
color: #a47e3c;
}
.alert-danger {
color: #b94a48;
background-color: #f2dede;
border-color: #eed3d7;
}
.alert-danger hr {
border-top-color: #e6c1c7;
}
.alert-danger .alert-link {
color: #953b39;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-moz-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-o-keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.progress {
height: 20px;
margin-bottom: 20px;
overflow: hidden;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.progress-bar {
float: left;
width: 0;
height: 100%;
font-size: 12px;
color: #ffffff;
text-align: center;
background-color: #428bca;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.progress-striped .progress-bar {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 40px 40px;
}
.progress.active .progress-bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
-ms-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.progress-bar-success {
background-color: #5cb85c;
}
.progress-striped .progress-bar-success {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-info {
background-color: #5bc0de;
}
.progress-striped .progress-bar-info {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-warning {
background-color: #f0ad4e;
}
.progress-striped .progress-bar-warning {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-danger {
background-color: #d9534f;
}
.progress-striped .progress-bar-danger {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.media,
.media-body {
overflow: hidden;
zoom: 1;
}
.media,
.media .media {
margin-top: 15px;
}
.media:first-child {
margin-top: 0;
}
.media-object {
display: block;
}
.media-heading {
margin: 0 0 5px;
}
.media > .pull-left {
margin-right: 10px;
}
.media > .pull-right {
margin-left: 10px;
}
.media-list {
padding-left: 0;
list-style: none;
}
.list-group {
padding-left: 0;
margin-bottom: 20px;
}
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.list-group-item:first-child {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.list-group-item > .badge {
float: right;
}
.list-group-item > .badge + .badge {
margin-right: 5px;
}
a.list-group-item {
color: #555555;
}
a.list-group-item .list-group-item-heading {
color: #333333;
}
a.list-group-item:hover,
a.list-group-item:focus {
text-decoration: none;
background-color: #f5f5f5;
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
z-index: 2;
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
.list-group-item.active .list-group-item-heading,
.list-group-item.active:hover .list-group-item-heading,
.list-group-item.active:focus .list-group-item-heading {
color: inherit;
}
.list-group-item.active .list-group-item-text,
.list-group-item.active:hover .list-group-item-text,
.list-group-item.active:focus .list-group-item-text {
color: #e1edf7;
}
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.panel {
margin-bottom: 20px;
background-color: #ffffff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-body {
padding: 15px;
}
.panel-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel > .list-group {
margin-bottom: 0;
}
.panel > .list-group .list-group-item {
border-width: 1px 0;
}
.panel > .list-group .list-group-item:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.panel > .list-group .list-group-item:last-child {
border-bottom: 0;
}
.panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.panel > .table {
margin-bottom: 0;
}
.panel > .panel-body + .table {
border-top: 1px solid #dddddd;
}
.panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
}
.panel-title > a {
color: inherit;
}
.panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel-group .panel {
margin-bottom: 0;
overflow: hidden;
border-radius: 4px;
}
.panel-group .panel + .panel {
margin-top: 5px;
}
.panel-group .panel-heading {
border-bottom: 0;
}
.panel-group .panel-heading + .panel-collapse .panel-body {
border-top: 1px solid #dddddd;
}
.panel-group .panel-footer {
border-top: 0;
}
.panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #dddddd;
}
.panel-default {
border-color: #dddddd;
}
.panel-default > .panel-heading {
color: #333333;
background-color: #f5f5f5;
border-color: #dddddd;
}
.panel-default > .panel-heading + .panel-collapse .panel-body {
border-top-color: #dddddd;
}
.panel-default > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #dddddd;
}
.panel-primary {
border-color: #428bca;
}
.panel-primary > .panel-heading {
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
.panel-primary > .panel-heading + .panel-collapse .panel-body {
border-top-color: #428bca;
}
.panel-primary > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #428bca;
}
.panel-success {
border-color: #d6e9c6;
}
.panel-success > .panel-heading {
color: #468847;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.panel-success > .panel-heading + .panel-collapse .panel-body {
border-top-color: #d6e9c6;
}
.panel-success > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #d6e9c6;
}
.panel-warning {
border-color: #fbeed5;
}
.panel-warning > .panel-heading {
color: #c09853;
background-color: #fcf8e3;
border-color: #fbeed5;
}
.panel-warning > .panel-heading + .panel-collapse .panel-body {
border-top-color: #fbeed5;
}
.panel-warning > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #fbeed5;
}
.panel-danger {
border-color: #eed3d7;
}
.panel-danger > .panel-heading {
color: #b94a48;
background-color: #f2dede;
border-color: #eed3d7;
}
.panel-danger > .panel-heading + .panel-collapse .panel-body {
border-top-color: #eed3d7;
}
.panel-danger > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #eed3d7;
}
.panel-info {
border-color: #bce8f1;
}
.panel-info > .panel-heading {
color: #3a87ad;
background-color: #d9edf7;
border-color: #bce8f1;
}
.panel-info > .panel-heading + .panel-collapse .panel-body {
border-top-color: #bce8f1;
}
.panel-info > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #bce8f1;
}
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15);
}
.well-lg {
padding: 24px;
border-radius: 6px;
}
.well-sm {
padding: 9px;
border-radius: 3px;
}
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.close:hover,
.close:focus {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
}
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.modal-open {
overflow: hidden;
}
body.modal-open,
.modal-open .navbar-fixed-top,
.modal-open .navbar-fixed-bottom {
margin-right: 15px;
}
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
display: none;
overflow: auto;
overflow-y: scroll;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-dialog {
z-index: 1050;
width: auto;
padding: 10px;
margin-right: auto;
margin-left: auto;
}
.modal-content {
position: relative;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
outline: none;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1030;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
min-height: 16.428571429px;
padding: 15px;
border-bottom: 1px solid #e5e5e5;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.428571429;
}
.modal-body {
position: relative;
padding: 20px;
}
.modal-footer {
padding: 19px 20px 20px;
margin-top: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer .btn + .btn {
margin-bottom: 0;
margin-left: 5px;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
@media screen and (min-width: 768px) {
.modal-dialog {
right: auto;
left: 50%;
width: 600px;
padding-top: 30px;
padding-bottom: 30px;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
}
.tooltip {
position: absolute;
z-index: 1030;
display: block;
font-size: 12px;
line-height: 1.4;
opacity: 0;
filter: alpha(opacity=0);
visibility: visible;
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
padding: 5px 0;
margin-top: -3px;
}
.tooltip.right {
padding: 0 5px;
margin-left: 3px;
}
.tooltip.bottom {
padding: 5px 0;
margin-top: 3px;
}
.tooltip.left {
padding: 0 5px;
margin-left: -3px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: #000000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-top-color: #000000;
border-width: 5px 5px 0;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
left: 5px;
border-top-color: #000000;
border-width: 5px 5px 0;
}
.tooltip.top-right .tooltip-arrow {
right: 5px;
bottom: 0;
border-top-color: #000000;
border-width: 5px 5px 0;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-right-color: #000000;
border-width: 5px 5px 5px 0;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-left-color: #000000;
border-width: 5px 0 5px 5px;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-bottom-color: #000000;
border-width: 0 5px 5px;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
left: 5px;
border-bottom-color: #000000;
border-width: 0 5px 5px;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
right: 5px;
border-bottom-color: #000000;
border-width: 0 5px 5px;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
max-width: 276px;
padding: 1px;
text-align: left;
white-space: normal;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
background-clip: padding-box;
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
padding: 8px 14px;
margin: 0;
font-size: 14px;
font-weight: normal;
line-height: 18px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover .arrow,
.popover .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover .arrow {
border-width: 11px;
}
.popover .arrow:after {
border-width: 10px;
content: "";
}
.popover.top .arrow {
bottom: -11px;
left: 50%;
margin-left: -11px;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
border-bottom-width: 0;
}
.popover.top .arrow:after {
bottom: 1px;
margin-left: -10px;
border-top-color: #ffffff;
border-bottom-width: 0;
content: " ";
}
.popover.right .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
border-left-width: 0;
}
.popover.right .arrow:after {
bottom: -10px;
left: 1px;
border-right-color: #ffffff;
border-left-width: 0;
content: " ";
}
.popover.bottom .arrow {
top: -11px;
left: 50%;
margin-left: -11px;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
border-top-width: 0;
}
.popover.bottom .arrow:after {
top: 1px;
margin-left: -10px;
border-bottom-color: #ffffff;
border-top-width: 0;
content: " ";
}
.popover.left .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
border-right-width: 0;
}
.popover.left .arrow:after {
right: 1px;
bottom: -10px;
border-left-color: #ffffff;
border-right-width: 0;
content: " ";
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
width: 100%;
overflow: hidden;
}
.carousel-inner > .item {
position: relative;
display: none;
-webkit-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
height: auto;
max-width: 100%;
line-height: 1;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 15%;
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
opacity: 0.5;
filter: alpha(opacity=50);
}
.carousel-control.left {
background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0), color-stop(rgba(0, 0, 0, 0.0001) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
}
.carousel-control.right {
right: 0;
left: auto;
background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0), color-stop(rgba(0, 0, 0, 0.5) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
}
.carousel-control:hover,
.carousel-control:focus {
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
left: 50%;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
padding-left: 0;
margin-left: -30%;
text-align: center;
list-style: none;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
cursor: pointer;
border: 1px solid #ffffff;
border-radius: 10px;
}
.carousel-indicators .active {
width: 12px;
height: 12px;
margin: 0;
background-color: #ffffff;
}
.carousel-caption {
position: absolute;
right: 15%;
bottom: 20px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
margin-left: -15px;
font-size: 30px;
}
.carousel-caption {
right: 20%;
left: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after {
display: table;
content: " ";
}
.clearfix:after {
clear: both;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
@media screen and (max-width: 400px) {
@-ms-viewport {
width: 320px;
}
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.visible-xs {
display: none !important;
}
tr.visible-xs {
display: none !important;
}
th.visible-xs,
td.visible-xs {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-xs.visible-sm {
display: block !important;
}
tr.visible-xs.visible-sm {
display: table-row !important;
}
th.visible-xs.visible-sm,
td.visible-xs.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-xs.visible-md {
display: block !important;
}
tr.visible-xs.visible-md {
display: table-row !important;
}
th.visible-xs.visible-md,
td.visible-xs.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-xs.visible-lg {
display: block !important;
}
tr.visible-xs.visible-lg {
display: table-row !important;
}
th.visible-xs.visible-lg,
td.visible-xs.visible-lg {
display: table-cell !important;
}
}
.visible-sm {
display: none !important;
}
tr.visible-sm {
display: none !important;
}
th.visible-sm,
td.visible-sm {
display: none !important;
}
@media (max-width: 767px) {
.visible-sm.visible-xs {
display: block !important;
}
tr.visible-sm.visible-xs {
display: table-row !important;
}
th.visible-sm.visible-xs,
td.visible-sm.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-sm.visible-md {
display: block !important;
}
tr.visible-sm.visible-md {
display: table-row !important;
}
th.visible-sm.visible-md,
td.visible-sm.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-sm.visible-lg {
display: block !important;
}
tr.visible-sm.visible-lg {
display: table-row !important;
}
th.visible-sm.visible-lg,
td.visible-sm.visible-lg {
display: table-cell !important;
}
}
.visible-md {
display: none !important;
}
tr.visible-md {
display: none !important;
}
th.visible-md,
td.visible-md {
display: none !important;
}
@media (max-width: 767px) {
.visible-md.visible-xs {
display: block !important;
}
tr.visible-md.visible-xs {
display: table-row !important;
}
th.visible-md.visible-xs,
td.visible-md.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-md.visible-sm {
display: block !important;
}
tr.visible-md.visible-sm {
display: table-row !important;
}
th.visible-md.visible-sm,
td.visible-md.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-md.visible-lg {
display: block !important;
}
tr.visible-md.visible-lg {
display: table-row !important;
}
th.visible-md.visible-lg,
td.visible-md.visible-lg {
display: table-cell !important;
}
}
.visible-lg {
display: none !important;
}
tr.visible-lg {
display: none !important;
}
th.visible-lg,
td.visible-lg {
display: none !important;
}
@media (max-width: 767px) {
.visible-lg.visible-xs {
display: block !important;
}
tr.visible-lg.visible-xs {
display: table-row !important;
}
th.visible-lg.visible-xs,
td.visible-lg.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-lg.visible-sm {
display: block !important;
}
tr.visible-lg.visible-sm {
display: table-row !important;
}
th.visible-lg.visible-sm,
td.visible-lg.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-lg.visible-md {
display: block !important;
}
tr.visible-lg.visible-md {
display: table-row !important;
}
th.visible-lg.visible-md,
td.visible-lg.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
.hidden-xs {
display: block !important;
}
tr.hidden-xs {
display: table-row !important;
}
th.hidden-xs,
td.hidden-xs {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-xs {
display: none !important;
}
tr.hidden-xs {
display: none !important;
}
th.hidden-xs,
td.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-xs.hidden-sm {
display: none !important;
}
tr.hidden-xs.hidden-sm {
display: none !important;
}
th.hidden-xs.hidden-sm,
td.hidden-xs.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-xs.hidden-md {
display: none !important;
}
tr.hidden-xs.hidden-md {
display: none !important;
}
th.hidden-xs.hidden-md,
td.hidden-xs.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-xs.hidden-lg {
display: none !important;
}
tr.hidden-xs.hidden-lg {
display: none !important;
}
th.hidden-xs.hidden-lg,
td.hidden-xs.hidden-lg {
display: none !important;
}
}
.hidden-sm {
display: block !important;
}
tr.hidden-sm {
display: table-row !important;
}
th.hidden-sm,
td.hidden-sm {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-sm.hidden-xs {
display: none !important;
}
tr.hidden-sm.hidden-xs {
display: none !important;
}
th.hidden-sm.hidden-xs,
td.hidden-sm.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm {
display: none !important;
}
tr.hidden-sm {
display: none !important;
}
th.hidden-sm,
td.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-sm.hidden-md {
display: none !important;
}
tr.hidden-sm.hidden-md {
display: none !important;
}
th.hidden-sm.hidden-md,
td.hidden-sm.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-sm.hidden-lg {
display: none !important;
}
tr.hidden-sm.hidden-lg {
display: none !important;
}
th.hidden-sm.hidden-lg,
td.hidden-sm.hidden-lg {
display: none !important;
}
}
.hidden-md {
display: block !important;
}
tr.hidden-md {
display: table-row !important;
}
th.hidden-md,
td.hidden-md {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-md.hidden-xs {
display: none !important;
}
tr.hidden-md.hidden-xs {
display: none !important;
}
th.hidden-md.hidden-xs,
td.hidden-md.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-md.hidden-sm {
display: none !important;
}
tr.hidden-md.hidden-sm {
display: none !important;
}
th.hidden-md.hidden-sm,
td.hidden-md.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md {
display: none !important;
}
tr.hidden-md {
display: none !important;
}
th.hidden-md,
td.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-md.hidden-lg {
display: none !important;
}
tr.hidden-md.hidden-lg {
display: none !important;
}
th.hidden-md.hidden-lg,
td.hidden-md.hidden-lg {
display: none !important;
}
}
.hidden-lg {
display: block !important;
}
tr.hidden-lg {
display: table-row !important;
}
th.hidden-lg,
td.hidden-lg {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-lg.hidden-xs {
display: none !important;
}
tr.hidden-lg.hidden-xs {
display: none !important;
}
th.hidden-lg.hidden-xs,
td.hidden-lg.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-lg.hidden-sm {
display: none !important;
}
tr.hidden-lg.hidden-sm {
display: none !important;
}
th.hidden-lg.hidden-sm,
td.hidden-lg.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-lg.hidden-md {
display: none !important;
}
tr.hidden-lg.hidden-md {
display: none !important;
}
th.hidden-lg.hidden-md,
td.hidden-lg.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg {
display: none !important;
}
tr.hidden-lg {
display: none !important;
}
th.hidden-lg,
td.hidden-lg {
display: none !important;
}
}
.visible-print {
display: none !important;
}
tr.visible-print {
display: none !important;
}
th.visible-print,
td.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
.hidden-print {
display: none !important;
}
tr.hidden-print {
display: none !important;
}
th.hidden-print,
td.hidden-print {
display: none !important;
}
} | unmonastery/TrelloDB | src/files/vendor/twitter-bootstrap/dist/css/bootstrap.css | CSS | mit | 120,029 |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>basic_datagram_socket::at_mark (2 of 2 overloads)</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../at_mark.html" title="basic_datagram_socket::at_mark">
<link rel="prev" href="overload1.html" title="basic_datagram_socket::at_mark (1 of 2 overloads)">
<link rel="next" href="../available.html" title="basic_datagram_socket::available">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overload1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../at_mark.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../available.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_asio.reference.basic_datagram_socket.at_mark.overload2"></a><a class="link" href="overload2.html" title="basic_datagram_socket::at_mark (2 of 2 overloads)">basic_datagram_socket::at_mark
(2 of 2 overloads)</a>
</h5></div></div></div>
<p>
<span class="emphasis"><em>Inherited from basic_socket.</em></span>
</p>
<p>
Determine whether the socket is at the out-of-band data mark.
</p>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">at_mark</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
This function is used to check whether the socket input is currently
positioned at the out-of-band data mark.
</p>
<h6>
<a name="boost_asio.reference.basic_datagram_socket.at_mark.overload2.h0"></a>
<span class="phrase"><a name="boost_asio.reference.basic_datagram_socket.at_mark.overload2.parameters"></a></span><a class="link" href="overload2.html#boost_asio.reference.basic_datagram_socket.at_mark.overload2.parameters">Parameters</a>
</h6>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">ec</span></dt>
<dd><p>
Set to indicate what error occurred, if any.
</p></dd>
</dl>
</div>
<h6>
<a name="boost_asio.reference.basic_datagram_socket.at_mark.overload2.h1"></a>
<span class="phrase"><a name="boost_asio.reference.basic_datagram_socket.at_mark.overload2.return_value"></a></span><a class="link" href="overload2.html#boost_asio.reference.basic_datagram_socket.at_mark.overload2.return_value">Return
Value</a>
</h6>
<p>
A bool indicating whether the socket is at the out-of-band data mark.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2015 Christopher M.
Kohlhoff<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overload1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../at_mark.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../available.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| BenKeyFSI/poedit | deps/boost/doc/html/boost_asio/reference/basic_datagram_socket/at_mark/overload2.html | HTML | mit | 4,974 |
/**
* Copyright (c) 2015 Famous Industries, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* @license MIT
*/
/**
* PinchSync
* ------------
*
* PinchSync handles piped-in two-finger touch events to change
* position via pinching / expanding. It outputs an object with
* position, velocity, touch IDs, and distance.
*
* In this example, we create a PinchSync and display the data
* it receives to the screen. Based on the data, we can decide if
* it is pinching or expanding.
*/
define(function(require, exports, module) {
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var PinchSync = require("famous/inputs/PinchSync");
var mainCtx = Engine.createContext();
var start = 0;
var update = 0;
var end = 0;
var direction = "";
var distance = 0;
var delta = 0;
var displacement = 0;
var pinchSync = new PinchSync();
Engine.pipe(pinchSync);
var contentTemplate = function() {
return "<div>Start Count: " + start + "</div>" +
"<div>End Count: " + end + "</div>" +
"<div>Update Count: " + update + "</div>" +
"<div>Pinch Direction: " + direction + "</div>" +
"<div>Delta: " + delta.toFixed(3) + "</div>" +
"<div>Separation Distance: " + distance.toFixed(3) + "</div>" +
"<div>Separation Displacement: " + displacement.toFixed(3) + "</div>";
};
var surface = new Surface({
size: [undefined, undefined],
classes: ["grey-bg"],
content: contentTemplate()
});
pinchSync.on("start", function() {
start++;
surface.setContent(contentTemplate());
});
pinchSync.on("update", function(data) {
update++;
distance = data.distance;
direction = data.velocity > 0 ? "Expanding" : "Contracting";
displacement = data.displacement;
delta = data.delta;
surface.setContent(contentTemplate());
});
pinchSync.on("end", function() {
end++;
surface.setContent(contentTemplate());
});
mainCtx.add(surface);
});
| M1Reeder/famous-example-server | app/public/famous-dependencies/inputs/PinchSync/example.js | JavaScript | mit | 3,160 |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.lang['bn']={"editor":"Rich Text Editor","common":{"editorHelp":"Press ALT 0 for help","browseServer":"ব্রাউজ সার্ভার","url":"URL","protocol":"প্রোটোকল","upload":"আপলোড","uploadSubmit":"ইহাকে সার্ভারে প্রেরন কর","image":"ছবির লেবেল যুক্ত কর","flash":"ফ্লাশ লেবেল যুক্ত কর","form":"ফর্ম","checkbox":"চেক বাক্স","radio":"রেডিও বাটন","textField":"টেক্সট ফীল্ড","textarea":"টেক্সট এরিয়া","hiddenField":"গুপ্ত ফীল্ড","button":"বাটন","select":"বাছাই ফীল্ড","imageButton":"ছবির বাটন","notSet":"<সেট নেই>","id":"আইডি","name":"নাম","langDir":"ভাষা লেখার দিক","langDirLtr":"বাম থেকে ডান (LTR)","langDirRtl":"ডান থেকে বাম (RTL)","langCode":"ভাষা কোড","longDescr":"URL এর লম্বা বর্ণনা","cssClass":"স্টাইল-শীট ক্লাস","advisoryTitle":"পরামর্শ শীর্ষক","cssStyle":"স্টাইল","ok":"ওকে","cancel":"বাতিল","close":"Close","preview":"প্রিভিউ","resize":"Resize","generalTab":"General","advancedTab":"এডভান্সড","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"Some of the options have been changed. Are you sure to close the dialog?","options":"Options","target":"টার্গেট","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"বাম থেকে ডান (LTR)","langDirRTL":"ডান থেকে বাম (RTL)","styles":"স্টাইল","cssClasses":"স্টাইল-শীট ক্লাস","width":"প্রস্থ","height":"দৈর্ঘ্য","align":"এলাইন","alignLeft":"বামে","alignRight":"ডানে","alignCenter":"মাঝখানে","alignTop":"উপর","alignMiddle":"মধ্য","alignBottom":"নীচে","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">, unavailable</span>"},"about":{"copy":"Copyright © $1. All rights reserved.","dlgTitle":"About CKEditor","help":"Check $1 for help.","moreInfo":"For licensing information please visit our web site:","title":"About CKEditor","userGuide":"CKEditor User's Guide"},"basicstyles":{"bold":"বোল্ড","italic":"ইটালিক","strike":"স্ট্রাইক থ্রু","subscript":"অধোলেখ","superscript":"অভিলেখ","underline":"আন্ডারলাইন"},"blockquote":{"toolbar":"Block Quote"},"clipboard":{"copy":"কপি","copyError":"আপনার ব্রাউজারের সুরক্ষা সেটিংস এডিটরকে অটোমেটিক কপি করার অনুমতি দেয়নি। দয়া করে এই কাজের জন্য কিবোর্ড ব্যবহার করুন (Ctrl/Cmd+C)।","cut":"কাট","cutError":"আপনার ব্রাউজারের সুরক্ষা সেটিংস এডিটরকে অটোমেটিক কাট করার অনুমতি দেয়নি। দয়া করে এই কাজের জন্য কিবোর্ড ব্যবহার করুন (Ctrl/Cmd+X)।","paste":"পেস্ট","pasteArea":"Paste Area","pasteMsg":"অনুগ্রহ করে নীচের বাক্সে কিবোর্ড ব্যবহার করে (<STRONG>Ctrl/Cmd+V</STRONG>) পেস্ট করুন এবং <STRONG>OK</STRONG> চাপ দিন","securityMsg":"Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.","title":"পেস্ট"},"contextmenu":{"options":"Context Menu Options"},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"format":{"label":"ফন্ট ফরমেট","panelTitle":"ফন্ট ফরমেট","tag_address":"ঠিকানা","tag_div":"শীর্ষক (DIV)","tag_h1":"শীর্ষক ১","tag_h2":"শীর্ষক ২","tag_h3":"শীর্ষক ৩","tag_h4":"শীর্ষক ৪","tag_h5":"শীর্ষক ৫","tag_h6":"শীর্ষক ৬","tag_p":"সাধারণ","tag_pre":"ফর্মেটেড"},"horizontalrule":{"toolbar":"রেখা যুক্ত কর"},"image":{"alertUrl":"অনুগ্রহক করে ছবির URL টাইপ করুন","alt":"বিকল্প টেক্সট","border":"বর্ডার","btnUpload":"ইহাকে সার্ভারে প্রেরন কর","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"হরাইজন্টাল স্পেস","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"ছবির তথ্য","linkTab":"লিংক","lockRatio":"অনুপাত লক কর","menu":"ছবির প্রোপার্টি","resetSize":"সাইজ পূর্বাবস্থায় ফিরিয়ে দাও","title":"ছবির প্রোপার্টি","titleButton":"ছবি বাটন প্রোপার্টি","upload":"আপলোড","urlMissing":"Image source URL is missing.","vSpace":"ভার্টিকেল স্পেস","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"indent":{"indent":"ইনডেন্ট বাড়াও","outdent":"ইনডেন্ট কমাও"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"link":{"acccessKey":"এক্সেস কী","advanced":"এডভান্সড","advisoryContentType":"পরামর্শ কন্টেন্টের প্রকার","advisoryTitle":"পরামর্শ শীর্ষক","anchor":{"toolbar":"নোঙ্গর","menu":"নোঙর প্রোপার্টি","title":"নোঙর প্রোপার্টি","name":"নোঙরের নাম","errorName":"নোঙরের নাম টাইপ করুন","remove":"Remove Anchor"},"anchorId":"নোঙরের আইডি দিয়ে","anchorName":"নোঙরের নাম দিয়ে","charset":"লিংক রিসোর্স ক্যারেক্টর সেট","cssClasses":"স্টাইল-শীট ক্লাস","emailAddress":"ইমেইল ঠিকানা","emailBody":"মেসেজের দেহ","emailSubject":"মেসেজের বিষয়","id":"আইডি","info":"লিংক তথ্য","langCode":"ভাষা লেখার দিক","langDir":"ভাষা লেখার দিক","langDirLTR":"বাম থেকে ডান (LTR)","langDirRTL":"ডান থেকে বাম (RTL)","menu":"লিংক সম্পাদন","name":"নাম","noAnchors":"(No anchors available in the document)","noEmail":"অনুগ্রহ করে ইমেইল এড্রেস টাইপ করুন","noUrl":"অনুগ্রহ করে URL লিংক টাইপ করুন","other":"<other>","popupDependent":"ডিপেন্ডেন্ট (Netscape)","popupFeatures":"পপআপ উইন্ডো ফীচার সমূহ","popupFullScreen":"পূর্ণ পর্দা জুড়ে (IE)","popupLeft":"বামের পজিশন","popupLocationBar":"লোকেশন বার","popupMenuBar":"মেন্যু বার","popupResizable":"Resizable","popupScrollBars":"স্ক্রল বার","popupStatusBar":"স্ট্যাটাস বার","popupToolbar":"টুল বার","popupTop":"ডানের পজিশন","rel":"Relationship","selectAnchor":"নোঙর বাছাই","styles":"স্টাইল","tabIndex":"ট্যাব ইন্ডেক্স","target":"টার্গেট","targetFrame":"<ফ্রেম>","targetFrameName":"টার্গেট ফ্রেমের নাম","targetPopup":"<পপআপ উইন্ডো>","targetPopupName":"পপআপ উইন্ডোর নাম","title":"লিংক","toAnchor":"এই পেজে নোঙর কর","toEmail":"ইমেইল","toUrl":"URL","toolbar":"লিংক যুক্ত কর","type":"লিংক প্রকার","unlink":"লিংক সরাও","upload":"আপলোড"},"list":{"bulletedlist":"বুলেট লিস্ট লেবেল","numberedlist":"সাংখ্যিক লিস্টের লেবেল"},"magicline":{"title":"Insert paragraph here"},"maximize":{"maximize":"Maximize","minimize":"Minimize"},"pastetext":{"button":"সাদা টেক্সট হিসেবে পেস্ট কর","title":"সাদা টেক্সট হিসেবে পেস্ট কর"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"পেস্ট (শব্দ)","toolbar":"পেস্ট (শব্দ)"},"removeformat":{"toolbar":"ফরমেট সরাও"},"sourcearea":{"toolbar":"সোর্স"},"specialchar":{"options":"Special Character Options","title":"বিশেষ ক্যারেক্টার বাছাই কর","toolbar":"বিশেষ অক্ষর যুক্ত কর"},"scayt":{"about":"About SCAYT","aboutTab":"About","addWord":"Add Word","allCaps":"Ignore All-Caps Words","dic_create":"Create","dic_delete":"Delete","dic_field_name":"Dictionary name","dic_info":"Initially the User Dictionary is stored in a Cookie. However, Cookies are limited in size. When the User Dictionary grows to a point where it cannot be stored in a Cookie, then the dictionary may be stored on our server. To store your personal dictionary on our server you should specify a name for your dictionary. If you already have a stored dictionary, please type its name and click the Restore button.","dic_rename":"Rename","dic_restore":"Restore","dictionariesTab":"Dictionaries","disable":"Disable SCAYT","emptyDic":"Dictionary name should not be empty.","enable":"Enable SCAYT","ignore":"Ignore","ignoreAll":"Ignore All","ignoreDomainNames":"Ignore Domain Names","langs":"Languages","languagesTab":"Languages","mixedCase":"Ignore Words with Mixed Case","mixedWithDigits":"Ignore Words with Numbers","moreSuggestions":"More suggestions","opera_title":"Not supported by Opera","options":"Options","optionsTab":"Options","title":"Spell Check As You Type","toggle":"Toggle SCAYT","noSuggestions":"No suggestion"},"stylescombo":{"label":"স্টাইল","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"table":{"border":"বর্ডার সাইজ","caption":"শীর্ষক","cell":{"menu":"সেল","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"সেল মুছে দাও","merge":"সেল জোড়া দাও","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"সেল প্যাডিং","cellSpace":"সেল স্পেস","column":{"menu":"কলাম","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"কলাম মুছে দাও"},"columns":"কলাম","deleteTable":"টেবিল ডিলীট কর","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"টেবিল প্রোপার্টি","row":{"menu":"রো","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"রো মুছে দাও"},"rows":"রো","summary":"সারাংশ","title":"টেবিল প্রোপার্টি","toolbar":"টেবিলের লেবেল যুক্ত কর","widthPc":"শতকরা","widthPx":"পিক্সেল","widthUnit":"width unit"},"undo":{"redo":"রি-ডু","undo":"আনডু"},"wsc":{"btnIgnore":"ইগনোর কর","btnIgnoreAll":"সব ইগনোর কর","btnReplace":"বদলে দাও","btnReplaceAll":"সব বদলে দাও","btnUndo":"আন্ডু","changeTo":"এতে বদলাও","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"বানান পরীক্ষক ইনস্টল করা নেই। আপনি কি এখনই এটা ডাউনলোড করতে চান?","manyChanges":"বানান পরীক্ষা শেষ: %1 গুলো শব্দ বদলে গ্যাছে","noChanges":"বানান পরীক্ষা শেষ: কোন শব্দ পরিবর্তন করা হয়নি","noMispell":"বানান পরীক্ষা শেষ: কোন ভুল বানান পাওয়া যায়নি","noSuggestions":"- কোন সাজেশন নেই -","notAvailable":"Sorry, but service is unavailable now.","notInDic":"শব্দকোষে নেই","oneChange":"বানান পরীক্ষা শেষ: একটি মাত্র শব্দ পরিবর্তন করা হয়েছে","progress":"বানান পরীক্ষা চলছে...","title":"Spell Check","toolbar":"বানান চেক"}}; | akhokhar/eProcurement-Application | includes/admin/plugins/ckeditor/lang/bn.js | JavaScript | mit | 16,237 |
// @param endpoint {String} URL to Meteor app
// "http://subdomain.meteor.com/" or "/" or
// "ddp+sockjs://foo-**.meteor.com/sockjs"
//
// We do some rewriting of the URL to eventually make it "ws://" or "wss://",
// whatever was passed in. At the very least, what Meteor.absoluteUrl() returns
// us should work.
//
// We don't do any heartbeating. (The logic that did this in sockjs was removed,
// because it used a built-in sockjs mechanism. We could do it with WebSocket
// ping frames or with DDP-level messages.)
LivedataTest.ClientStream = function (endpoint, options) {
var self = this;
options = options || {};
self.options = _.extend({
retry: true
}, options);
self.client = null; // created in _launchConnection
self.endpoint = endpoint;
self.headers = self.options.headers || {};
self.npmFayeOptions = self.options.npmFayeOptions || {};
self._initCommon(self.options);
//// Kickoff!
self._launchConnection();
};
_.extend(LivedataTest.ClientStream.prototype, {
// data is a utf8 string. Data sent while not connected is dropped on
// the floor, and it is up the user of this API to retransmit lost
// messages on 'reset'
send: function (data) {
var self = this;
if (self.currentStatus.connected) {
self.client.send(data);
}
},
// Changes where this connection points
_changeUrl: function (url) {
var self = this;
self.endpoint = url;
},
_onConnect: function (client) {
var self = this;
if (client !== self.client) {
// This connection is not from the last call to _launchConnection.
// But _launchConnection calls _cleanup which closes previous connections.
// It's our belief that this stifles future 'open' events, but maybe
// we are wrong?
throw new Error("Got open from inactive client " + !!self.client);
}
if (self._forcedToDisconnect) {
// We were asked to disconnect between trying to open the connection and
// actually opening it. Let's just pretend this never happened.
self.client.close();
self.client = null;
return;
}
if (self.currentStatus.connected) {
// We already have a connection. It must have been the case that we
// started two parallel connection attempts (because we wanted to
// 'reconnect now' on a hanging connection and we had no way to cancel the
// connection attempt.) But this shouldn't happen (similarly to the client
// !== self.client check above).
throw new Error("Two parallel connections?");
}
self._clearConnectionTimer();
// update status
self.currentStatus.status = "connected";
self.currentStatus.connected = true;
self.currentStatus.retryCount = 0;
self.statusChanged();
// fire resets. This must come after status change so that clients
// can call send from within a reset callback.
_.each(self.eventCallbacks.reset, function (callback) { callback(); });
},
_cleanup: function (maybeError) {
var self = this;
self._clearConnectionTimer();
if (self.client) {
var client = self.client;
self.client = null;
client.close();
_.each(self.eventCallbacks.disconnect, function (callback) {
callback(maybeError);
});
}
},
_clearConnectionTimer: function () {
var self = this;
if (self.connectionTimer) {
clearTimeout(self.connectionTimer);
self.connectionTimer = null;
}
},
_getProxyUrl: function (targetUrl) {
var self = this;
// Similar to code in tools/http-helpers.js.
var proxy = process.env.HTTP_PROXY || process.env.http_proxy || null;
// if we're going to a secure url, try the https_proxy env variable first.
if (targetUrl.match(/^wss:/)) {
proxy = process.env.HTTPS_PROXY || process.env.https_proxy || proxy;
}
return proxy;
},
_launchConnection: function () {
var self = this;
self._cleanup(); // cleanup the old socket, if there was one.
// Since server-to-server DDP is still an experimental feature, we only
// require the module if we actually create a server-to-server
// connection.
var FayeWebSocket = Npm.require('faye-websocket');
var deflate = Npm.require('permessage-deflate');
var targetUrl = toWebsocketUrl(self.endpoint);
var fayeOptions = {
headers: self.headers,
extensions: [deflate]
};
fayeOptions = _.extend(fayeOptions, self.npmFayeOptions);
var proxyUrl = self._getProxyUrl(targetUrl);
if (proxyUrl) {
fayeOptions.proxy = { origin: proxyUrl };
};
// We would like to specify 'ddp' as the subprotocol here. The npm module we
// used to use as a client would fail the handshake if we ask for a
// subprotocol and the server doesn't send one back (and sockjs doesn't).
// Faye doesn't have that behavior; it's unclear from reading RFC 6455 if
// Faye is erroneous or not. So for now, we don't specify protocols.
var subprotocols = [];
var client = self.client = new FayeWebSocket.Client(
targetUrl, subprotocols, fayeOptions);
self._clearConnectionTimer();
self.connectionTimer = Meteor.setTimeout(
function () {
self._lostConnection(
new DDP.ConnectionError("DDP connection timed out"));
},
self.CONNECT_TIMEOUT);
self.client.on('open', Meteor.bindEnvironment(function () {
return self._onConnect(client);
}, "stream connect callback"));
var clientOnIfCurrent = function (event, description, f) {
self.client.on(event, Meteor.bindEnvironment(function () {
// Ignore events from any connection we've already cleaned up.
if (client !== self.client)
return;
f.apply(this, arguments);
}, description));
};
clientOnIfCurrent('error', 'stream error callback', function (error) {
if (!self.options._dontPrintErrors)
Meteor._debug("stream error", error.message);
// Faye's 'error' object is not a JS error (and among other things,
// doesn't stringify well). Convert it to one.
self._lostConnection(new DDP.ConnectionError(error.message));
});
clientOnIfCurrent('close', 'stream close callback', function () {
self._lostConnection();
});
clientOnIfCurrent('message', 'stream message callback', function (message) {
// Ignore binary frames, where message.data is a Buffer
if (typeof message.data !== "string")
return;
_.each(self.eventCallbacks.message, function (callback) {
callback(message.data);
});
});
}
});
| devgrok/meteor | packages/ddp-client/stream_client_nodejs.js | JavaScript | mit | 6,608 |
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is built by mktables from e.g. UnicodeData.txt.
# Any changes made here will be lost!
#
# Linebreak category 'Combining_Mark'
#
return <<'END';
0000 0008
000B
000E 001F
007F 0084
0086 009F
0300 034E
0350 035C
0363 036F
0483 0486
0488 0489
0591 05B9
05BB 05BD
05BF
05C1 05C2
05C4 05C5
05C7
0610 0615
064B 065E
0670
06D6 06DC
06DE 06E4
06E7 06E8
06EA 06ED
0711
0730 074A
07A6 07B0
0901 0903
093C
093E 094D
0951 0954
0962 0963
0981 0983
09BC
09BE 09C4
09C7 09C8
09CB 09CD
09D7
09E2 09E3
0A01 0A03
0A3C
0A3E 0A42
0A47 0A48
0A4B 0A4D
0A70 0A71
0A81 0A83
0ABC
0ABE 0AC5
0AC7 0AC9
0ACB 0ACD
0AE2 0AE3
0B01 0B03
0B3C
0B3E 0B43
0B47 0B48
0B4B 0B4D
0B56 0B57
0B82
0BBE 0BC2
0BC6 0BC8
0BCA 0BCD
0BD7
0C01 0C03
0C3E 0C44
0C46 0C48
0C4A 0C4D
0C55 0C56
0C82 0C83
0CBC
0CBE 0CC4
0CC6 0CC8
0CCA 0CCD
0CD5 0CD6
0D02 0D03
0D3E 0D43
0D46 0D48
0D4A 0D4D
0D57
0D82 0D83
0DCA
0DCF 0DD4
0DD6
0DD8 0DDF
0DF2 0DF3
0E31
0E34 0E3A
0E47 0E4E
0EB1
0EB4 0EB9
0EBB 0EBC
0EC8 0ECD
0F18 0F19
0F35
0F37
0F39
0F3E 0F3F
0F71 0F7E
0F80 0F84
0F86 0F87
0F90 0F97
0F99 0FBC
0FC6
102C 1032
1036 1039
1056 1059
135F
1712 1714
1732 1734
1752 1753
1772 1773
17B6 17D3
17DD
180B 180D
18A9
1920 192B
1930 193B
19B0 19C0
19C8 19C9
1A17 1A1B
1DC0 1DC3
200C 200F
202A 202E
206A 206F
20D0 20EB
302A 302F
3099 309A
A802
A806
A80B
A823 A827
FB1E
FE00 FE0F
FE20 FE23
FFF9 FFFB
10A01 10A03
10A05 10A06
10A0C 10A0F
10A38 10A3A
10A3F
1D165 1D169
1D16D 1D182
1D185 1D18B
1D1AA 1D1AD
1D242 1D244
E0001
E0020 E007F
E0100 E01EF
END
| ASlave2Audio/Restaurant-App | lib/perl5/5.8/unicore/lib/lb/CM.pl | Perl | mit | 1,708 |
"use strict";
var f = require('util').format
, crypto = require('crypto')
, Query = require('../connection/commands').Query
, MongoError = require('../error');
var AuthSession = function(db, username, password) {
this.db = db;
this.username = username;
this.password = password;
}
AuthSession.prototype.equal = function(session) {
return session.db == this.db
&& session.username == this.username
&& session.password == this.password;
}
/**
* Creates a new MongoCR authentication mechanism
* @class
* @return {MongoCR} A cursor instance
*/
var MongoCR = function(bson) {
this.bson = bson;
this.authStore = [];
}
// Add to store only if it does not exist
var addAuthSession = function(authStore, session) {
var found = false;
for(var i = 0; i < authStore.length; i++) {
if(authStore[i].equal(session)) {
found = true;
break;
}
}
if(!found) authStore.push(session);
}
/**
* Authenticate
* @method
* @param {{Server}|{ReplSet}|{Mongos}} server Topology the authentication method is being called on
* @param {[]Connections} connections Connections to authenticate using this authenticator
* @param {string} db Name of the database
* @param {string} username Username
* @param {string} password Password
* @param {authResultCallback} callback The callback to return the result from the authentication
* @return {object}
*/
MongoCR.prototype.auth = function(server, connections, db, username, password, callback) {
var self = this;
// Total connections
var count = connections.length;
if(count == 0) return callback(null, null);
// Valid connections
var numberOfValidConnections = 0;
var errorObject = null;
// For each connection we need to authenticate
while(connections.length > 0) {
// Execute MongoCR
var executeMongoCR = function(connection) {
// Write the commmand on the connection
server(connection, new Query(self.bson, f("%s.$cmd", db), {
getnonce:1
}, {
numberToSkip: 0, numberToReturn: 1
}), function(err, r) {
var nonce = null;
var key = null;
// Adjust the number of connections left
// Get nonce
if(err == null) {
nonce = r.result.nonce;
// Use node md5 generator
var md5 = crypto.createHash('md5');
// Generate keys used for authentication
md5.update(username + ":mongo:" + password, 'utf8');
var hash_password = md5.digest('hex');
// Final key
md5 = crypto.createHash('md5');
md5.update(nonce + username + hash_password, 'utf8');
key = md5.digest('hex');
}
// Execute command
// Write the commmand on the connection
server(connection, new Query(self.bson, f("%s.$cmd", db), {
authenticate: 1, user: username, nonce: nonce, key:key
}, {
numberToSkip: 0, numberToReturn: 1
}), function(err, r) {
count = count - 1;
// If we have an error
if(err) {
errorObject = err;
} else if(r.result['$err']) {
errorObject = r.result;
} else if(r.result['errmsg']) {
errorObject = r.result;
} else {
numberOfValidConnections = numberOfValidConnections + 1;
}
// We have authenticated all connections
if(count == 0 && numberOfValidConnections > 0) {
// Store the auth details
addAuthSession(self.authStore, new AuthSession(db, username, password));
// Return correct authentication
callback(null, true);
} else if(count == 0) {
if(errorObject == null) errorObject = new MongoError(f("failed to authenticate using mongocr"));
callback(errorObject, false);
}
});
});
}
var _execute = function(_connection) {
process.nextTick(function() {
executeMongoCR(_connection);
});
}
_execute(connections.shift());
}
}
/**
* Remove authStore credentials
* @method
* @param {string} db Name of database we are removing authStore details about
* @return {object}
*/
MongoCR.prototype.logout = function(dbName) {
this.authStore = this.authStore.filter(function(x) {
return x.db != dbName;
});
}
/**
* Re authenticate pool
* @method
* @param {{Server}|{ReplSet}|{Mongos}} server Topology the authentication method is being called on
* @param {[]Connections} connections Connections to authenticate using this authenticator
* @param {authResultCallback} callback The callback to return the result from the authentication
* @return {object}
*/
MongoCR.prototype.reauthenticate = function(server, connections, callback) {
var authStore = this.authStore.slice(0);
var count = authStore.length;
if(count == 0) return callback(null, null);
// Iterate over all the auth details stored
for(var i = 0; i < authStore.length; i++) {
this.auth(server, connections, authStore[i].db, authStore[i].username, authStore[i].password, function(err) {
count = count - 1;
// Done re-authenticating
if(count == 0) {
callback(err, null);
}
});
}
}
/**
* This is a result from a authentication strategy
*
* @callback authResultCallback
* @param {error} error An error object. Set to null if no error present
* @param {boolean} result The result of the authentication process
*/
module.exports = MongoCR;
| koreach/TEAM_OP | node_modules/mongodb/node_modules/mongodb-core/lib/auth/mongocr.js | JavaScript | mit | 5,480 |
.medium-toolbar-arrow-over:before,.medium-toolbar-arrow-under:after{display:none}.medium-editor-toolbar{border:1px solid #cdd6e0;background:-webkit-linear-gradient(bottom,#dee7f0,#fff);background:linear-gradient(to bottom,#dee7f0,#fff);border-radius:2px;box-shadow:0 2px 6px rgba(0,0,0,.45)}.medium-editor-toolbar li button{min-width:50px;height:50px;border:none;border-right:1px solid #cdd6e0;background-color:transparent;color:#40648a;-webkit-transition:background-color .2s ease-in,color .2s ease-in;transition:background-color .2s ease-in,color .2s ease-in}.medium-editor-toolbar li button:hover{background-color:#5c90c7;background-color:rgba(92,144,199,.45);color:#fff}.medium-editor-toolbar li .medium-editor-button-first{border-top-left-radius:2px;border-bottom-left-radius:2px}.medium-editor-toolbar li .medium-editor-button-last{border-top-right-radius:2px;border-bottom-right-radius:2px}.medium-editor-toolbar li .medium-editor-button-active{color:#000;background:-webkit-linear-gradient(bottom,#dee7f0,rgba(0,0,0,.1));background:linear-gradient(to bottom,#dee7f0,rgba(0,0,0,.1))}.medium-editor-toolbar-form{background:#dee7f0;color:#999;border-radius:2px}.medium-editor-toolbar-form .medium-editor-toolbar-input{height:50px;background:#dee7f0;color:#40648a;box-sizing:border-box}.medium-editor-toolbar-form a{color:#40648a}.medium-editor-toolbar-anchor-preview{background:#dee7f0;color:#40648a;border-radius:2px}.medium-editor-placeholder:after{color:#cdd6e0} | dominicrico/cdnjs | ajax/libs/medium-editor/3.0.7/css/themes/mani.min.css | CSS | mit | 1,470 |
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMakeLists.txt is
created for each configuration.
This module's original purpose was to support editing in IDEs like KDevelop
which use CMake for project management. It is also possible to use CMake to
generate projects for other IDEs such as eclipse cdt and code::blocks. QtCreator
will convert the CMakeLists.txt to a code::blocks cbp for the editor to read,
but build using CMake. As a result QtCreator editor is unaware of compiler
defines. The generated CMakeLists.txt can also be used to build on Linux. There
is currently no support for building on platforms other than Linux.
The generated CMakeLists.txt should properly compile all projects. However,
there is a mismatch between gyp and cmake with regard to linking. All attempts
are made to work around this, but CMake sometimes sees -Wl,--start-group as a
library and incorrectly repeats it. As a result the output of this generator
should not be relied on for building.
When using with kdevelop, use version 4.4+. Previous versions of kdevelop will
not be able to find the header file directories described in the generated
CMakeLists.txt file.
"""
import multiprocessing
import os
import signal
import string
import subprocess
import gyp.common
generator_default_variables = {
'EXECUTABLE_PREFIX': '',
'EXECUTABLE_SUFFIX': '',
'STATIC_LIB_PREFIX': 'lib',
'STATIC_LIB_SUFFIX': '.a',
'SHARED_LIB_PREFIX': 'lib',
'SHARED_LIB_SUFFIX': '.so',
'SHARED_LIB_DIR': '${builddir}/lib.${TOOLSET}',
'LIB_DIR': '${obj}.${TOOLSET}',
'INTERMEDIATE_DIR': '${obj}.${TOOLSET}/${TARGET}/geni',
'SHARED_INTERMEDIATE_DIR': '${obj}/gen',
'PRODUCT_DIR': '${builddir}',
'RULE_INPUT_PATH': '${RULE_INPUT_PATH}',
'RULE_INPUT_DIRNAME': '${RULE_INPUT_DIRNAME}',
'RULE_INPUT_NAME': '${RULE_INPUT_NAME}',
'RULE_INPUT_ROOT': '${RULE_INPUT_ROOT}',
'RULE_INPUT_EXT': '${RULE_INPUT_EXT}',
'CONFIGURATION_NAME': '${configuration}',
}
FULL_PATH_VARS = ('${CMAKE_SOURCE_DIR}', '${builddir}', '${obj}')
generator_supports_multiple_toolsets = True
generator_wants_static_library_dependencies_adjusted = True
COMPILABLE_EXTENSIONS = {
'.c': 'cc',
'.cc': 'cxx',
'.cpp': 'cxx',
'.cxx': 'cxx',
'.s': 's', # cc
'.S': 's', # cc
}
def RemovePrefix(a, prefix):
"""Returns 'a' without 'prefix' if it starts with 'prefix'."""
return a[len(prefix):] if a.startswith(prefix) else a
def CalculateVariables(default_variables, params):
"""Calculate additional variables for use in the build (called by gyp)."""
default_variables.setdefault('OS', gyp.common.GetFlavor(params))
def Compilable(filename):
"""Return true if the file is compilable (should be in OBJS)."""
return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS)
def Linkable(filename):
"""Return true if the file is linkable (should be on the link line)."""
return filename.endswith('.o')
def NormjoinPathForceCMakeSource(base_path, rel_path):
"""Resolves rel_path against base_path and returns the result.
If rel_path is an absolute path it is returned unchanged.
Otherwise it is resolved against base_path and normalized.
If the result is a relative path, it is forced to be relative to the
CMakeLists.txt.
"""
if os.path.isabs(rel_path):
return rel_path
if any([rel_path.startswith(var) for var in FULL_PATH_VARS]):
return rel_path
# TODO: do we need to check base_path for absolute variables as well?
return os.path.join('${CMAKE_SOURCE_DIR}',
os.path.normpath(os.path.join(base_path, rel_path)))
def NormjoinPath(base_path, rel_path):
"""Resolves rel_path against base_path and returns the result.
TODO: what is this really used for?
If rel_path begins with '$' it is returned unchanged.
Otherwise it is resolved against base_path if relative, then normalized.
"""
if rel_path.startswith('$') and not rel_path.startswith('${configuration}'):
return rel_path
return os.path.normpath(os.path.join(base_path, rel_path))
def CMakeStringEscape(a):
"""Escapes the string 'a' for use inside a CMake string.
This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
The following do not need to be escaped
'#' when the lexer is in string state, this does not start a comment
The following are yet unknown
'$' generator variables (like ${obj}) must not be escaped,
but text $ should be escaped
what is wanted is to know which $ come from generator variables
"""
return a.replace('\\', '\\\\').replace(';', '\\;').replace('"', '\\"')
def SetFileProperty(output, source_name, property_name, values, sep):
"""Given a set of source file, sets the given property on them."""
output.write('set_source_files_properties(')
output.write(source_name)
output.write(' PROPERTIES ')
output.write(property_name)
output.write(' "')
for value in values:
output.write(CMakeStringEscape(value))
output.write(sep)
output.write('")\n')
def SetFilesProperty(output, source_names, property_name, values, sep):
"""Given a set of source files, sets the given property on them."""
output.write('set_source_files_properties(\n')
for source_name in source_names:
output.write(' ')
output.write(source_name)
output.write('\n')
output.write(' PROPERTIES\n ')
output.write(property_name)
output.write(' "')
for value in values:
output.write(CMakeStringEscape(value))
output.write(sep)
output.write('"\n)\n')
def SetTargetProperty(output, target_name, property_name, values, sep=''):
"""Given a target, sets the given property."""
output.write('set_target_properties(')
output.write(target_name)
output.write(' PROPERTIES ')
output.write(property_name)
output.write(' "')
for value in values:
output.write(CMakeStringEscape(value))
output.write(sep)
output.write('")\n')
def SetVariable(output, variable_name, value):
"""Sets a CMake variable."""
output.write('set(')
output.write(variable_name)
output.write(' "')
output.write(CMakeStringEscape(value))
output.write('")\n')
def SetVariableList(output, variable_name, values):
"""Sets a CMake variable to a list."""
if not values:
return SetVariable(output, variable_name, "")
if len(values) == 1:
return SetVariable(output, variable_name, values[0])
output.write('list(APPEND ')
output.write(variable_name)
output.write('\n "')
output.write('"\n "'.join([CMakeStringEscape(value) for value in values]))
output.write('")\n')
def UnsetVariable(output, variable_name):
"""Unsets a CMake variable."""
output.write('unset(')
output.write(variable_name)
output.write(')\n')
def WriteVariable(output, variable_name, prepend=None):
if prepend:
output.write(prepend)
output.write('${')
output.write(variable_name)
output.write('}')
class CMakeTargetType:
def __init__(self, command, modifier, property_modifier):
self.command = command
self.modifier = modifier
self.property_modifier = property_modifier
cmake_target_type_from_gyp_target_type = {
'executable': CMakeTargetType('add_executable', None, 'RUNTIME'),
'static_library': CMakeTargetType('add_library', 'STATIC', 'ARCHIVE'),
'shared_library': CMakeTargetType('add_library', 'SHARED', 'LIBRARY'),
'loadable_module': CMakeTargetType('add_library', 'MODULE', 'LIBRARY'),
'none': CMakeTargetType('add_custom_target', 'SOURCES', None),
}
def StringToCMakeTargetName(a):
"""Converts the given string 'a' to a valid CMake target name.
All invalid characters are replaced by '_'.
Invalid for cmake: ' ', '/', '(', ')'
Invalid for make: ':'
Invalid for unknown reasons but cause failures: '.'
"""
return a.translate(string.maketrans(' /():.', '______'))
def WriteActions(target_name, actions, extra_sources, extra_deps,
path_to_gyp, output):
"""Write CMake for the 'actions' in the target.
Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_sources: [(<cmake_src>, <src>)] to append with generated source files.
extra_deps: [<cmake_taget>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
for action in actions:
action_name = StringToCMakeTargetName(action['action_name'])
action_target_name = '%s__%s' % (target_name, action_name)
inputs = action['inputs']
inputs_name = action_target_name + '__input'
SetVariableList(output, inputs_name,
[NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs])
outputs = action['outputs']
cmake_outputs = [NormjoinPathForceCMakeSource(path_to_gyp, out)
for out in outputs]
outputs_name = action_target_name + '__output'
SetVariableList(output, outputs_name, cmake_outputs)
# Build up a list of outputs.
# Collect the output dirs we'll need.
dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir)
if int(action.get('process_outputs_as_sources', False)):
extra_sources.extend(zip(cmake_outputs, outputs))
# add_custom_command
output.write('add_custom_command(OUTPUT ')
WriteVariable(output, outputs_name)
output.write('\n')
if len(dirs) > 0:
for directory in dirs:
output.write(' COMMAND ${CMAKE_COMMAND} -E make_directory ')
output.write(directory)
output.write('\n')
output.write(' COMMAND ')
output.write(gyp.common.EncodePOSIXShellList(action['action']))
output.write('\n')
output.write(' DEPENDS ')
WriteVariable(output, inputs_name)
output.write('\n')
output.write(' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
output.write(path_to_gyp)
output.write('\n')
output.write(' COMMENT ')
if 'message' in action:
output.write(action['message'])
else:
output.write(action_target_name)
output.write('\n')
output.write(' VERBATIM\n')
output.write(')\n')
# add_custom_target
output.write('add_custom_target(')
output.write(action_target_name)
output.write('\n DEPENDS ')
WriteVariable(output, outputs_name)
output.write('\n SOURCES ')
WriteVariable(output, inputs_name)
output.write('\n)\n')
extra_deps.append(action_target_name)
def NormjoinRulePathForceCMakeSource(base_path, rel_path, rule_source):
if rel_path.startswith(("${RULE_INPUT_PATH}","${RULE_INPUT_DIRNAME}")):
if any([rule_source.startswith(var) for var in FULL_PATH_VARS]):
return rel_path
return NormjoinPathForceCMakeSource(base_path, rel_path)
def WriteRules(target_name, rules, extra_sources, extra_deps,
path_to_gyp, output):
"""Write CMake for the 'rules' in the target.
Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_sources: [(<cmake_src>, <src>)] to append with generated source files.
extra_deps: [<cmake_taget>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
for rule in rules:
rule_name = StringToCMakeTargetName(target_name + '__' + rule['rule_name'])
inputs = rule.get('inputs', [])
inputs_name = rule_name + '__input'
SetVariableList(output, inputs_name,
[NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs])
outputs = rule['outputs']
var_outputs = []
for count, rule_source in enumerate(rule.get('rule_sources', [])):
action_name = rule_name + '_' + str(count)
rule_source_dirname, rule_source_basename = os.path.split(rule_source)
rule_source_root, rule_source_ext = os.path.splitext(rule_source_basename)
SetVariable(output, 'RULE_INPUT_PATH', rule_source)
SetVariable(output, 'RULE_INPUT_DIRNAME', rule_source_dirname)
SetVariable(output, 'RULE_INPUT_NAME', rule_source_basename)
SetVariable(output, 'RULE_INPUT_ROOT', rule_source_root)
SetVariable(output, 'RULE_INPUT_EXT', rule_source_ext)
# Build up a list of outputs.
# Collect the output dirs we'll need.
dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir)
# Create variables for the output, as 'local' variable will be unset.
these_outputs = []
for output_index, out in enumerate(outputs):
output_name = action_name + '_' + str(output_index)
SetVariable(output, output_name,
NormjoinRulePathForceCMakeSource(path_to_gyp, out,
rule_source))
if int(rule.get('process_outputs_as_sources', False)):
extra_sources.append(('${' + output_name + '}', out))
these_outputs.append('${' + output_name + '}')
var_outputs.append('${' + output_name + '}')
# add_custom_command
output.write('add_custom_command(OUTPUT\n')
for out in these_outputs:
output.write(' ')
output.write(out)
output.write('\n')
for directory in dirs:
output.write(' COMMAND ${CMAKE_COMMAND} -E make_directory ')
output.write(directory)
output.write('\n')
output.write(' COMMAND ')
output.write(gyp.common.EncodePOSIXShellList(rule['action']))
output.write('\n')
output.write(' DEPENDS ')
WriteVariable(output, inputs_name)
output.write(' ')
output.write(NormjoinPath(path_to_gyp, rule_source))
output.write('\n')
# CMAKE_SOURCE_DIR is where the CMakeLists.txt lives.
# The cwd is the current build directory.
output.write(' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
output.write(path_to_gyp)
output.write('\n')
output.write(' COMMENT ')
if 'message' in rule:
output.write(rule['message'])
else:
output.write(action_name)
output.write('\n')
output.write(' VERBATIM\n')
output.write(')\n')
UnsetVariable(output, 'RULE_INPUT_PATH')
UnsetVariable(output, 'RULE_INPUT_DIRNAME')
UnsetVariable(output, 'RULE_INPUT_NAME')
UnsetVariable(output, 'RULE_INPUT_ROOT')
UnsetVariable(output, 'RULE_INPUT_EXT')
# add_custom_target
output.write('add_custom_target(')
output.write(rule_name)
output.write(' DEPENDS\n')
for out in var_outputs:
output.write(' ')
output.write(out)
output.write('\n')
output.write('SOURCES ')
WriteVariable(output, inputs_name)
output.write('\n')
for rule_source in rule.get('rule_sources', []):
output.write(' ')
output.write(NormjoinPath(path_to_gyp, rule_source))
output.write('\n')
output.write(')\n')
extra_deps.append(rule_name)
def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output):
"""Write CMake for the 'copies' in the target.
Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_deps: [<cmake_taget>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
copy_name = target_name + '__copies'
# CMake gets upset with custom targets with OUTPUT which specify no output.
have_copies = any(copy['files'] for copy in copies)
if not have_copies:
output.write('add_custom_target(')
output.write(copy_name)
output.write(')\n')
extra_deps.append(copy_name)
return
class Copy:
def __init__(self, ext, command):
self.cmake_inputs = []
self.cmake_outputs = []
self.gyp_inputs = []
self.gyp_outputs = []
self.ext = ext
self.inputs_name = None
self.outputs_name = None
self.command = command
file_copy = Copy('', 'copy')
dir_copy = Copy('_dirs', 'copy_directory')
for copy in copies:
files = copy['files']
destination = copy['destination']
for src in files:
path = os.path.normpath(src)
basename = os.path.split(path)[1]
dst = os.path.join(destination, basename)
copy = file_copy if os.path.basename(src) else dir_copy
copy.cmake_inputs.append(NormjoinPath(path_to_gyp, src))
copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst))
copy.gyp_inputs.append(src)
copy.gyp_outputs.append(dst)
for copy in (file_copy, dir_copy):
if copy.cmake_inputs:
copy.inputs_name = copy_name + '__input' + copy.ext
SetVariableList(output, copy.inputs_name, copy.cmake_inputs)
copy.outputs_name = copy_name + '__output' + copy.ext
SetVariableList(output, copy.outputs_name, copy.cmake_outputs)
# add_custom_command
output.write('add_custom_command(\n')
output.write('OUTPUT')
for copy in (file_copy, dir_copy):
if copy.outputs_name:
WriteVariable(output, copy.outputs_name, ' ')
output.write('\n')
for copy in (file_copy, dir_copy):
for src, dst in zip(copy.gyp_inputs, copy.gyp_outputs):
# 'cmake -E copy src dst' will create the 'dst' directory if needed.
output.write('COMMAND ${CMAKE_COMMAND} -E %s ' % copy.command)
output.write(src)
output.write(' ')
output.write(dst)
output.write("\n")
output.write('DEPENDS')
for copy in (file_copy, dir_copy):
if copy.inputs_name:
WriteVariable(output, copy.inputs_name, ' ')
output.write('\n')
output.write('WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
output.write(path_to_gyp)
output.write('\n')
output.write('COMMENT Copying for ')
output.write(target_name)
output.write('\n')
output.write('VERBATIM\n')
output.write(')\n')
# add_custom_target
output.write('add_custom_target(')
output.write(copy_name)
output.write('\n DEPENDS')
for copy in (file_copy, dir_copy):
if copy.outputs_name:
WriteVariable(output, copy.outputs_name, ' ')
output.write('\n SOURCES')
if file_copy.inputs_name:
WriteVariable(output, file_copy.inputs_name, ' ')
output.write('\n)\n')
extra_deps.append(copy_name)
def CreateCMakeTargetBaseName(qualified_target):
"""This is the name we would like the target to have."""
_, gyp_target_name, gyp_target_toolset = (
gyp.common.ParseQualifiedTarget(qualified_target))
cmake_target_base_name = gyp_target_name
if gyp_target_toolset and gyp_target_toolset != 'target':
cmake_target_base_name += '_' + gyp_target_toolset
return StringToCMakeTargetName(cmake_target_base_name)
def CreateCMakeTargetFullName(qualified_target):
"""An unambiguous name for the target."""
gyp_file, gyp_target_name, gyp_target_toolset = (
gyp.common.ParseQualifiedTarget(qualified_target))
cmake_target_full_name = gyp_file + ':' + gyp_target_name
if gyp_target_toolset and gyp_target_toolset != 'target':
cmake_target_full_name += '_' + gyp_target_toolset
return StringToCMakeTargetName(cmake_target_full_name)
class CMakeNamer(object):
"""Converts Gyp target names into CMake target names.
CMake requires that target names be globally unique. One way to ensure
this is to fully qualify the names of the targets. Unfortunatly, this
ends up with all targets looking like "chrome_chrome_gyp_chrome" instead
of just "chrome". If this generator were only interested in building, it
would be possible to fully qualify all target names, then create
unqualified target names which depend on all qualified targets which
should have had that name. This is more or less what the 'make' generator
does with aliases. However, one goal of this generator is to create CMake
files for use with IDEs, and fully qualified names are not as user
friendly.
Since target name collision is rare, we do the above only when required.
Toolset variants are always qualified from the base, as this is required for
building. However, it also makes sense for an IDE, as it is possible for
defines to be different.
"""
def __init__(self, target_list):
self.cmake_target_base_names_conficting = set()
cmake_target_base_names_seen = set()
for qualified_target in target_list:
cmake_target_base_name = CreateCMakeTargetBaseName(qualified_target)
if cmake_target_base_name not in cmake_target_base_names_seen:
cmake_target_base_names_seen.add(cmake_target_base_name)
else:
self.cmake_target_base_names_conficting.add(cmake_target_base_name)
def CreateCMakeTargetName(self, qualified_target):
base_name = CreateCMakeTargetBaseName(qualified_target)
if base_name in self.cmake_target_base_names_conficting:
return CreateCMakeTargetFullName(qualified_target)
return base_name
def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
options, generator_flags, all_qualified_targets, output):
# The make generator does this always.
# TODO: It would be nice to be able to tell CMake all dependencies.
circular_libs = generator_flags.get('circular', True)
if not generator_flags.get('standalone', False):
output.write('\n#')
output.write(qualified_target)
output.write('\n')
gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target)
rel_gyp_file = gyp.common.RelativePath(gyp_file, options.toplevel_dir)
rel_gyp_dir = os.path.dirname(rel_gyp_file)
# Relative path from build dir to top dir.
build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir)
# Relative path from build dir to gyp dir.
build_to_gyp = os.path.join(build_to_top, rel_gyp_dir)
path_from_cmakelists_to_gyp = build_to_gyp
spec = target_dicts.get(qualified_target, {})
config = spec.get('configurations', {}).get(config_to_use, {})
target_name = spec.get('target_name', '<missing target name>')
target_type = spec.get('type', '<missing target type>')
target_toolset = spec.get('toolset')
SetVariable(output, 'TARGET', target_name)
SetVariable(output, 'TOOLSET', target_toolset)
cmake_target_name = namer.CreateCMakeTargetName(qualified_target)
extra_sources = []
extra_deps = []
# Actions must come first, since they can generate more OBJs for use below.
if 'actions' in spec:
WriteActions(cmake_target_name, spec['actions'], extra_sources, extra_deps,
path_from_cmakelists_to_gyp, output)
# Rules must be early like actions.
if 'rules' in spec:
WriteRules(cmake_target_name, spec['rules'], extra_sources, extra_deps,
path_from_cmakelists_to_gyp, output)
# Copies
if 'copies' in spec:
WriteCopies(cmake_target_name, spec['copies'], extra_deps,
path_from_cmakelists_to_gyp, output)
# Target and sources
srcs = spec.get('sources', [])
# Gyp separates the sheep from the goats based on file extensions.
def partition(l, p):
return reduce(lambda x, e: x[not p(e)].append(e) or x, l, ([], []))
compilable_srcs, other_srcs = partition(srcs, Compilable)
# CMake gets upset when executable targets provide no sources.
if target_type == 'executable' and not compilable_srcs and not extra_sources:
print ('Executable %s has no complilable sources, treating as "none".' %
target_name )
target_type = 'none'
cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type)
if cmake_target_type is None:
print ('Target %s has unknown target type %s, skipping.' %
( target_name, target_type ) )
return
other_srcs_name = None
if other_srcs:
other_srcs_name = cmake_target_name + '__other_srcs'
SetVariableList(output, other_srcs_name,
[NormjoinPath(path_from_cmakelists_to_gyp, src) for src in other_srcs])
# CMake is opposed to setting linker directories and considers the practice
# of setting linker directories dangerous. Instead, it favors the use of
# find_library and passing absolute paths to target_link_libraries.
# However, CMake does provide the command link_directories, which adds
# link directories to targets defined after it is called.
# As a result, link_directories must come before the target definition.
# CMake unfortunately has no means of removing entries from LINK_DIRECTORIES.
library_dirs = config.get('library_dirs')
if library_dirs is not None:
output.write('link_directories(')
for library_dir in library_dirs:
output.write(' ')
output.write(NormjoinPath(path_from_cmakelists_to_gyp, library_dir))
output.write('\n')
output.write(')\n')
output.write(cmake_target_type.command)
output.write('(')
output.write(cmake_target_name)
if cmake_target_type.modifier is not None:
output.write(' ')
output.write(cmake_target_type.modifier)
if other_srcs_name:
WriteVariable(output, other_srcs_name, ' ')
output.write('\n')
for src in compilable_srcs:
output.write(' ')
output.write(NormjoinPath(path_from_cmakelists_to_gyp, src))
output.write('\n')
for extra_source in extra_sources:
output.write(' ')
src, _ = extra_source
output.write(NormjoinPath(path_from_cmakelists_to_gyp, src))
output.write('\n')
output.write(')\n')
# Output name and location.
if target_type != 'none':
# Mark uncompiled sources as uncompiled.
if other_srcs_name:
output.write('set_source_files_properties(')
WriteVariable(output, other_srcs_name, '')
output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n')
# Output directory
target_output_directory = spec.get('product_dir')
if target_output_directory is None:
if target_type in ('executable', 'loadable_module'):
target_output_directory = generator_default_variables['PRODUCT_DIR']
elif target_type in ('shared_library'):
target_output_directory = '${builddir}/lib.${TOOLSET}'
elif spec.get('standalone_static_library', False):
target_output_directory = generator_default_variables['PRODUCT_DIR']
else:
base_path = gyp.common.RelativePath(os.path.dirname(gyp_file),
options.toplevel_dir)
target_output_directory = '${obj}.${TOOLSET}'
target_output_directory = (
os.path.join(target_output_directory, base_path))
cmake_target_output_directory = NormjoinPathForceCMakeSource(
path_from_cmakelists_to_gyp,
target_output_directory)
SetTargetProperty(output,
cmake_target_name,
cmake_target_type.property_modifier + '_OUTPUT_DIRECTORY',
cmake_target_output_directory)
# Output name
default_product_prefix = ''
default_product_name = target_name
default_product_ext = ''
if target_type == 'static_library':
static_library_prefix = generator_default_variables['STATIC_LIB_PREFIX']
default_product_name = RemovePrefix(default_product_name,
static_library_prefix)
default_product_prefix = static_library_prefix
default_product_ext = generator_default_variables['STATIC_LIB_SUFFIX']
elif target_type in ('loadable_module', 'shared_library'):
shared_library_prefix = generator_default_variables['SHARED_LIB_PREFIX']
default_product_name = RemovePrefix(default_product_name,
shared_library_prefix)
default_product_prefix = shared_library_prefix
default_product_ext = generator_default_variables['SHARED_LIB_SUFFIX']
elif target_type != 'executable':
print ('ERROR: What output file should be generated?',
'type', target_type, 'target', target_name)
product_prefix = spec.get('product_prefix', default_product_prefix)
product_name = spec.get('product_name', default_product_name)
product_ext = spec.get('product_extension')
if product_ext:
product_ext = '.' + product_ext
else:
product_ext = default_product_ext
SetTargetProperty(output, cmake_target_name, 'PREFIX', product_prefix)
SetTargetProperty(output, cmake_target_name,
cmake_target_type.property_modifier + '_OUTPUT_NAME',
product_name)
SetTargetProperty(output, cmake_target_name, 'SUFFIX', product_ext)
# Make the output of this target referenceable as a source.
cmake_target_output_basename = product_prefix + product_name + product_ext
cmake_target_output = os.path.join(cmake_target_output_directory,
cmake_target_output_basename)
SetFileProperty(output, cmake_target_output, 'GENERATED', ['TRUE'], '')
# Let CMake know if the 'all' target should depend on this target.
exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets
else 'FALSE')
SetTargetProperty(output, cmake_target_name,
'EXCLUDE_FROM_ALL', exclude_from_all)
for extra_target_name in extra_deps:
SetTargetProperty(output, extra_target_name,
'EXCLUDE_FROM_ALL', exclude_from_all)
# Includes
includes = config.get('include_dirs')
if includes:
# This (target include directories) is what requires CMake 2.8.8
includes_name = cmake_target_name + '__include_dirs'
SetVariableList(output, includes_name,
[NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include)
for include in includes])
output.write('set_property(TARGET ')
output.write(cmake_target_name)
output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ')
WriteVariable(output, includes_name, '')
output.write(')\n')
# Defines
defines = config.get('defines')
if defines is not None:
SetTargetProperty(output,
cmake_target_name,
'COMPILE_DEFINITIONS',
defines,
';')
# Compile Flags - http://www.cmake.org/Bug/view.php?id=6493
# CMake currently does not have target C and CXX flags.
# So, instead of doing...
# cflags_c = config.get('cflags_c')
# if cflags_c is not None:
# SetTargetProperty(output, cmake_target_name,
# 'C_COMPILE_FLAGS', cflags_c, ' ')
# cflags_cc = config.get('cflags_cc')
# if cflags_cc is not None:
# SetTargetProperty(output, cmake_target_name,
# 'CXX_COMPILE_FLAGS', cflags_cc, ' ')
# Instead we must...
s_sources = []
c_sources = []
cxx_sources = []
for src in srcs:
_, ext = os.path.splitext(src)
src_type = COMPILABLE_EXTENSIONS.get(ext, None)
if src_type == 's':
s_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
if src_type == 'cc':
c_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
if src_type == 'cxx':
cxx_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
for extra_source in extra_sources:
src, real_source = extra_source
_, ext = os.path.splitext(real_source)
src_type = COMPILABLE_EXTENSIONS.get(ext, None)
if src_type == 's':
s_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
if src_type == 'cc':
c_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
if src_type == 'cxx':
cxx_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
cflags = config.get('cflags', [])
cflags_c = config.get('cflags_c', [])
cflags_cxx = config.get('cflags_cc', [])
if c_sources and not (s_sources or cxx_sources):
flags = []
flags.extend(cflags)
flags.extend(cflags_c)
SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
elif cxx_sources and not (s_sources or c_sources):
flags = []
flags.extend(cflags)
flags.extend(cflags_cxx)
SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
else:
if s_sources and cflags:
SetFilesProperty(output, s_sources, 'COMPILE_FLAGS', cflags, ' ')
if c_sources and (cflags or cflags_c):
flags = []
flags.extend(cflags)
flags.extend(cflags_c)
SetFilesProperty(output, c_sources, 'COMPILE_FLAGS', flags, ' ')
if cxx_sources and (cflags or cflags_cxx):
flags = []
flags.extend(cflags)
flags.extend(cflags_cxx)
SetFilesProperty(output, cxx_sources, 'COMPILE_FLAGS', flags, ' ')
# Have assembly link as c if there are no other files
if not c_sources and not cxx_sources and s_sources:
SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C'])
# Linker flags
ldflags = config.get('ldflags')
if ldflags is not None:
SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ')
# Note on Dependencies and Libraries:
# CMake wants to handle link order, resolving the link line up front.
# Gyp does not retain or enforce specifying enough information to do so.
# So do as other gyp generators and use --start-group and --end-group.
# Give CMake as little information as possible so that it doesn't mess it up.
# Dependencies
rawDeps = spec.get('dependencies', [])
static_deps = []
shared_deps = []
other_deps = []
for rawDep in rawDeps:
dep_cmake_name = namer.CreateCMakeTargetName(rawDep)
dep_spec = target_dicts.get(rawDep, {})
dep_target_type = dep_spec.get('type', None)
if dep_target_type == 'static_library':
static_deps.append(dep_cmake_name)
elif dep_target_type == 'shared_library':
shared_deps.append(dep_cmake_name)
else:
other_deps.append(dep_cmake_name)
# ensure all external dependencies are complete before internal dependencies
# extra_deps currently only depend on their own deps, so otherwise run early
if static_deps or shared_deps or other_deps:
for extra_dep in extra_deps:
output.write('add_dependencies(')
output.write(extra_dep)
output.write('\n')
for deps in (static_deps, shared_deps, other_deps):
for dep in gyp.common.uniquer(deps):
output.write(' ')
output.write(dep)
output.write('\n')
output.write(')\n')
linkable = target_type in ('executable', 'loadable_module', 'shared_library')
other_deps.extend(extra_deps)
if other_deps or (not linkable and (static_deps or shared_deps)):
output.write('add_dependencies(')
output.write(cmake_target_name)
output.write('\n')
for dep in gyp.common.uniquer(other_deps):
output.write(' ')
output.write(dep)
output.write('\n')
if not linkable:
for deps in (static_deps, shared_deps):
for lib_dep in gyp.common.uniquer(deps):
output.write(' ')
output.write(lib_dep)
output.write('\n')
output.write(')\n')
# Libraries
if linkable:
external_libs = [lib for lib in spec.get('libraries', []) if len(lib) > 0]
if external_libs or static_deps or shared_deps:
output.write('target_link_libraries(')
output.write(cmake_target_name)
output.write('\n')
if static_deps:
write_group = circular_libs and len(static_deps) > 1
if write_group:
output.write('-Wl,--start-group\n')
for dep in gyp.common.uniquer(static_deps):
output.write(' ')
output.write(dep)
output.write('\n')
if write_group:
output.write('-Wl,--end-group\n')
if shared_deps:
for dep in gyp.common.uniquer(shared_deps):
output.write(' ')
output.write(dep)
output.write('\n')
if external_libs:
for lib in gyp.common.uniquer(external_libs):
output.write(' ')
output.write(lib)
output.write('\n')
output.write(')\n')
UnsetVariable(output, 'TOOLSET')
UnsetVariable(output, 'TARGET')
def GenerateOutputForConfig(target_list, target_dicts, data,
params, config_to_use):
options = params['options']
generator_flags = params['generator_flags']
# generator_dir: relative path from pwd to where make puts build files.
# Makes migrating from make to cmake easier, cmake doesn't put anything here.
# Each Gyp configuration creates a different CMakeLists.txt file
# to avoid incompatibilities between Gyp and CMake configurations.
generator_dir = os.path.relpath(options.generator_output or '.')
# output_dir: relative path from generator_dir to the build directory.
output_dir = generator_flags.get('output_dir', 'out')
# build_dir: relative path from source root to our output files.
# e.g. "out/Debug"
build_dir = os.path.normpath(os.path.join(generator_dir,
output_dir,
config_to_use))
toplevel_build = os.path.join(options.toplevel_dir, build_dir)
output_file = os.path.join(toplevel_build, 'CMakeLists.txt')
gyp.common.EnsureDirExists(output_file)
output = open(output_file, 'w')
output.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n')
output.write('cmake_policy(VERSION 2.8.8)\n')
_, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1])
output.write('project(')
output.write(project_target)
output.write(')\n')
SetVariable(output, 'configuration', config_to_use)
# The following appears to be as-yet undocumented.
# http://public.kitware.com/Bug/view.php?id=8392
output.write('enable_language(ASM)\n')
# ASM-ATT does not support .S files.
# output.write('enable_language(ASM-ATT)\n')
SetVariable(output, 'builddir', '${CMAKE_BINARY_DIR}')
SetVariable(output, 'obj', '${builddir}/obj')
output.write('\n')
# TODO: Undocumented/unsupported (the CMake Java generator depends on it).
# CMake by default names the object resulting from foo.c to be foo.c.o.
# Gyp traditionally names the object resulting from foo.c foo.o.
# This should be irrelevant, but some targets extract .o files from .a
# and depend on the name of the extracted .o files.
output.write('set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)\n')
output.write('set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n')
output.write('\n')
namer = CMakeNamer(target_list)
# The list of targets upon which the 'all' target should depend.
# CMake has it's own implicit 'all' target, one is not created explicitly.
all_qualified_targets = set()
for build_file in params['build_files']:
for qualified_target in gyp.common.AllTargets(target_list,
target_dicts,
os.path.normpath(build_file)):
all_qualified_targets.add(qualified_target)
for qualified_target in target_list:
WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
options, generator_flags, all_qualified_targets, output)
output.close()
def PerformBuild(data, configurations, params):
options = params['options']
generator_flags = params['generator_flags']
# generator_dir: relative path from pwd to where make puts build files.
# Makes migrating from make to cmake easier, cmake doesn't put anything here.
generator_dir = os.path.relpath(options.generator_output or '.')
# output_dir: relative path from generator_dir to the build directory.
output_dir = generator_flags.get('output_dir', 'out')
for config_name in configurations:
# build_dir: relative path from source root to our output files.
# e.g. "out/Debug"
build_dir = os.path.normpath(os.path.join(generator_dir,
output_dir,
config_name))
arguments = ['cmake', '-G', 'Ninja']
print 'Generating [%s]: %s' % (config_name, arguments)
subprocess.check_call(arguments, cwd=build_dir)
arguments = ['ninja', '-C', build_dir]
print 'Building [%s]: %s' % (config_name, arguments)
subprocess.check_call(arguments)
def CallGenerateOutputForConfig(arglist):
# Ignore the interrupt signal so that the parent process catches it and
# kills all multiprocessing children.
signal.signal(signal.SIGINT, signal.SIG_IGN)
target_list, target_dicts, data, params, config_name = arglist
GenerateOutputForConfig(target_list, target_dicts, data, params, config_name)
def GenerateOutput(target_list, target_dicts, data, params):
user_config = params.get('generator_flags', {}).get('config', None)
if user_config:
GenerateOutputForConfig(target_list, target_dicts, data,
params, user_config)
else:
config_names = target_dicts[target_list[0]]['configurations'].keys()
if params['parallel']:
try:
pool = multiprocessing.Pool(len(config_names))
arglists = []
for config_name in config_names:
arglists.append((target_list, target_dicts, data,
params, config_name))
pool.map(CallGenerateOutputForConfig, arglists)
except KeyboardInterrupt, e:
pool.terminate()
raise e
else:
for config_name in config_names:
GenerateOutputForConfig(target_list, target_dicts, data,
params, config_name)
| joshua-oxley/Target | node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | Python | mit | 41,681 |
//
// BuddyBuildDemoIntroductionViewController.m
// m2048
//
// Created by Chris on 2015-12-25.
// Copyright © 2015 Danqing. All rights reserved.
//
#import "BuddyBuildDemoIntroductionViewController.h"
#import "M2AppDelegate.h"
@interface BuddyBuildDemoIntroductionViewController ()
@property (nonatomic, strong) IBOutlet UIButton* okButton;
@end
@implementation BuddyBuildDemoIntroductionViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)ok {
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
M2AppDelegate* appDelegate = (M2AppDelegate*)[[UIApplication sharedApplication] delegate];
appDelegate.screenshottingAllowed = true;
}
- (BOOL)prefersStatusBarHidden {
return YES;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
| test-driver/southern-shine-total | m2048/buddybuild Demo/BuddyBuildDemoIntroductionViewController.m | Matlab | mit | 1,312 |
// Knockout JavaScript library v3.0.0
// (c) Steven Sanderson - http://knockoutjs.com/
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
(function() {(function(q){var y=this||(0,eval)("this"),w=y.document,K=y.navigator,u=y.jQuery,B=y.JSON;(function(q){"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?q(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],q):q(y.ko={})})(function(F){function G(a,c){return null===a||typeof a in N?a===c:!1}function H(b,c,d,e){a.d[b]={init:function(b){a.a.f.set(b,L,{});return{controlsDescendantBindings:!0}},update:function(b,h,k,m,f){k=a.a.f.get(b,L);h=a.a.c(h());
m=!d!==!h;var p=!k.ob;if(p||c||m!==k.Db)p&&(k.ob=a.a.Ya(a.e.childNodes(b),!0)),m?(p||a.e.S(b,a.a.Ya(k.ob)),a.Ta(e?e(f,h):f,b)):a.e.Z(b),k.Db=m}};a.g.Y[b]=!1;a.e.P[b]=!0}var a="undefined"!==typeof F?F:{};a.b=function(b,c){for(var d=b.split("."),e=a,g=0;g<d.length-1;g++)e=e[d[g]];e[d[d.length-1]]=c};a.s=function(a,c,d){a[c]=d};a.version="3.0.0";a.b("version",a.version);a.a=function(){function b(a,b){for(var f in a)a.hasOwnProperty(f)&&b(f,a[f])}function c(k,b){if("input"!==a.a.v(k)||!k.type||"click"!=
b.toLowerCase())return!1;var f=k.type;return"checkbox"==f||"radio"==f}var d={},e={};d[K&&/Firefox\/2/i.test(K.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];d.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(d,function(a,b){if(b.length)for(var f=0,c=b.length;f<c;f++)e[b[f]]=a});var g={propertychange:!0},h=w&&function(){for(var a=3,b=w.createElement("div"),f=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+
++a+"]><i></i><![endif]--\x3e",f[0];);return 4<a?a:q}();return{$a:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],n:function(a,b){for(var f=0,c=a.length;f<c;f++)b(a[f])},l:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var f=0,c=a.length;f<c;f++)if(a[f]===b)return f;return-1},Ua:function(a,b,f){for(var c=0,d=a.length;c<d;c++)if(b.call(f,a[c]))return a[c];return null},ia:function(b,c){var f=a.a.l(b,c);0<=f&&b.splice(f,1)},Va:function(b){b=
b||[];for(var c=[],f=0,d=b.length;f<d;f++)0>a.a.l(c,b[f])&&c.push(b[f]);return c},ha:function(a,b){a=a||[];for(var f=[],c=0,d=a.length;c<d;c++)f.push(b(a[c]));return f},ga:function(a,b){a=a||[];for(var f=[],c=0,d=a.length;c<d;c++)b(a[c])&&f.push(a[c]);return f},X:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var f=0,c=b.length;f<c;f++)a.push(b[f]);return a},V:function(b,c,f){var d=a.a.l(a.a.Ha(b),c);0>d?f&&b.push(c):f||b.splice(d,1)},extend:function(a,b){if(b)for(var f in b)b.hasOwnProperty(f)&&
(a[f]=b[f]);return a},K:b,Da:function(a,b){if(!a)return a;var f={},c;for(c in a)a.hasOwnProperty(c)&&(f[c]=b(a[c],c,a));return f},wa:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Vb:function(b){b=a.a.Q(b);for(var c=w.createElement("div"),f=0,d=b.length;f<d;f++)c.appendChild(a.L(b[f]));return c},Ya:function(b,c){for(var f=0,d=b.length,e=[];f<d;f++){var g=b[f].cloneNode(!0);e.push(c?a.L(g):g)}return e},S:function(b,c){a.a.wa(b);if(c)for(var f=0,d=c.length;f<d;f++)b.appendChild(c[f])},nb:function(b,
c){var f=b.nodeType?[b]:b;if(0<f.length){for(var d=f[0],e=d.parentNode,g=0,n=c.length;g<n;g++)e.insertBefore(c[g],d);g=0;for(n=f.length;g<n;g++)a.removeNode(f[g])}},$:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);if(1<a.length){var f=a[0],c=a[a.length-1];for(a.length=0;f!==c;)if(a.push(f),f=f.nextSibling,!f)return;a.push(c)}}return a},qb:function(a,b){7>h?a.setAttribute("selected",b):a.selected=b},la:function(a){return null===a||a===
q?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},ec:function(b,c){for(var f=[],d=(b||"").split(c),e=0,g=d.length;e<g;e++){var n=a.a.la(d[e]);""!==n&&f.push(n)}return f},ac:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},Gb:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(3===a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;
return!!a},va:function(b){return a.a.Gb(b,b.ownerDocument.documentElement)},Ra:function(b){return!!a.a.Ua(b,a.a.va)},v:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},r:function(b,d,f){var e=h&&g[d];if(e||"undefined"==typeof u)if(e||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var s=function(a){f.call(b,a)},l="on"+d;b.attachEvent(l,s);a.a.C.ea(b,function(){b.detachEvent(l,s)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(d,
f,!1);else{if(c(b,d)){var n=f;f=function(a,b){var f=this.checked;b&&(this.checked=!0!==b.Ab);n.call(this,a);this.checked=f}}u(b).bind(d,f)}},da:function(a,b){if(!a||!a.nodeType)throw Error("element must be a DOM node when calling triggerEvent");if("undefined"!=typeof u){var f=[];c(a,b)&&f.push({Ab:a.checked});u(a).trigger(b,f)}else if("function"==typeof w.createEvent)if("function"==typeof a.dispatchEvent)f=w.createEvent(e[b]||"HTMLEvents"),f.initEvent(b,!0,!0,y,0,0,0,0,0,!1,!1,!1,!1,0,a),a.dispatchEvent(f);
else throw Error("The supplied element doesn't support dispatchEvent");else if("undefined"!=typeof a.fireEvent)c(a,b)&&(a.checked=!0!==a.checked),a.fireEvent("on"+b);else throw Error("Browser doesn't support triggering events");},c:function(b){return a.M(b)?b():b},Ha:function(b){return a.M(b)?b.t():b},ma:function(b,c,f){if(c){var d=/\S+/g,e=b.className.match(d)||[];a.a.n(c.match(d),function(b){a.a.V(e,b,f)});b.className=e.join(" ")}},Ma:function(b,c){var f=a.a.c(c);if(null===f||f===q)f="";var d=a.e.firstChild(b);
!d||3!=d.nodeType||a.e.nextSibling(d)?a.e.S(b,[w.createTextNode(f)]):d.data=f;a.a.Jb(b)},pb:function(a,b){a.name=b;if(7>=h)try{a.mergeAttributes(w.createElement("<input name='"+a.name+"'/>"),!1)}catch(f){}},Jb:function(a){9<=h&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},Hb:function(a){if(h){var b=a.style.width;a.style.width=0;a.style.width=b}},Zb:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var f=[],d=b;d<=c;d++)f.push(d);return f},Q:function(a){for(var b=[],c=0,d=a.length;c<
d;c++)b.push(a[c]);return b},cc:6===h,dc:7===h,ja:h,ab:function(b,c){for(var f=a.a.Q(b.getElementsByTagName("input")).concat(a.a.Q(b.getElementsByTagName("textarea"))),d="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},e=[],g=f.length-1;0<=g;g--)d(f[g])&&e.push(f[g]);return e},Wb:function(b){return"string"==typeof b&&(b=a.a.la(b))?B&&B.parse?B.parse(b):(new Function("return "+b))():null},Na:function(b,c,f){if(!B||!B.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
return B.stringify(a.a.c(b),c,f)},Xb:function(c,d,f){f=f||{};var e=f.params||{},g=f.includeFields||this.$a,h=c;if("object"==typeof c&&"form"===a.a.v(c))for(var h=c.action,n=g.length-1;0<=n;n--)for(var r=a.a.ab(c,g[n]),v=r.length-1;0<=v;v--)e[r[v].name]=r[v].value;d=a.a.c(d);var t=w.createElement("form");t.style.display="none";t.action=h;t.method="post";for(var E in d)c=w.createElement("input"),c.name=E,c.value=a.a.Na(a.a.c(d[E])),t.appendChild(c);b(e,function(a,b){var c=w.createElement("input");c.name=
a;c.value=b;t.appendChild(c)});w.body.appendChild(t);f.submitter?f.submitter(t):t.submit();setTimeout(function(){t.parentNode.removeChild(t)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.n);a.b("utils.arrayFirst",a.a.Ua);a.b("utils.arrayFilter",a.a.ga);a.b("utils.arrayGetDistinctValues",a.a.Va);a.b("utils.arrayIndexOf",a.a.l);a.b("utils.arrayMap",a.a.ha);a.b("utils.arrayPushAll",a.a.X);a.b("utils.arrayRemoveItem",a.a.ia);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",
a.a.$a);a.b("utils.getFormFields",a.a.ab);a.b("utils.peekObservable",a.a.Ha);a.b("utils.postJson",a.a.Xb);a.b("utils.parseJson",a.a.Wb);a.b("utils.registerEventHandler",a.a.r);a.b("utils.stringifyJson",a.a.Na);a.b("utils.range",a.a.Zb);a.b("utils.toggleDomNodeCssClass",a.a.ma);a.b("utils.triggerEvent",a.a.da);a.b("utils.unwrapObservable",a.a.c);a.b("utils.objectForEach",a.a.K);a.b("utils.addOrRemoveItem",a.a.V);a.b("unwrap",a.a.c);Function.prototype.bind||(Function.prototype.bind=function(a){var c=
this,d=Array.prototype.slice.call(arguments);a=d.shift();return function(){return c.apply(a,d.concat(Array.prototype.slice.call(arguments)))}});a.a.f=new function(){function a(b,h){var k=b[d];if(!k||"null"===k||!e[k]){if(!h)return q;k=b[d]="ko"+c++;e[k]={}}return e[k]}var c=0,d="__ko__"+(new Date).getTime(),e={};return{get:function(c,d){var e=a(c,!1);return e===q?q:e[d]},set:function(c,d,e){if(e!==q||a(c,!1)!==q)a(c,!0)[d]=e},clear:function(a){var b=a[d];return b?(delete e[b],a[d]=null,!0):!1},D:function(){return c++ +
d}}};a.b("utils.domData",a.a.f);a.b("utils.domData.clear",a.a.f.clear);a.a.C=new function(){function b(b,c){var e=a.a.f.get(b,d);e===q&&c&&(e=[],a.a.f.set(b,d,e));return e}function c(d){var e=b(d,!1);if(e)for(var e=e.slice(0),m=0;m<e.length;m++)e[m](d);a.a.f.clear(d);"function"==typeof u&&"function"==typeof u.cleanData&&u.cleanData([d]);if(g[d.nodeType])for(e=d.firstChild;d=e;)e=d.nextSibling,8===d.nodeType&&c(d)}var d=a.a.f.D(),e={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{ea:function(a,c){if("function"!=
typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},mb:function(c,e){var g=b(c,!1);g&&(a.a.ia(g,e),0==g.length&&a.a.f.set(c,d,q))},L:function(b){if(e[b.nodeType]&&(c(b),g[b.nodeType])){var d=[];a.a.X(d,b.getElementsByTagName("*"));for(var m=0,f=d.length;m<f;m++)c(d[m])}return b},removeNode:function(b){a.L(b);b.parentNode&&b.parentNode.removeChild(b)}}};a.L=a.a.C.L;a.removeNode=a.a.C.removeNode;a.b("cleanNode",a.L);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.C);
a.b("utils.domNodeDisposal.addDisposeCallback",a.a.C.ea);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.C.mb);(function(){a.a.Fa=function(b){var c;if("undefined"!=typeof u)if(u.parseHTML)c=u.parseHTML(b)||[];else{if((c=u.clean([b]))&&c[0]){for(b=c[0];b.parentNode&&11!==b.parentNode.nodeType;)b=b.parentNode;b.parentNode&&b.parentNode.removeChild(b)}}else{var d=a.a.la(b).toLowerCase();c=w.createElement("div");d=d.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!d.indexOf("<tr")&&[2,
"<table><tbody>","</tbody></table>"]||(!d.indexOf("<td")||!d.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];b="ignored<div>"+d[1]+b+d[2]+"</div>";for("function"==typeof y.innerShiv?c.appendChild(y.innerShiv(b)):c.innerHTML=b;d[0]--;)c=c.lastChild;c=a.a.Q(c.lastChild.childNodes)}return c};a.a.Ka=function(b,c){a.a.wa(b);c=a.a.c(c);if(null!==c&&c!==q)if("string"!=typeof c&&(c=c.toString()),"undefined"!=typeof u)u(b).html(c);else for(var d=a.a.Fa(c),e=0;e<d.length;e++)b.appendChild(d[e])}})();
a.b("utils.parseHtmlFragment",a.a.Fa);a.b("utils.setHtml",a.a.Ka);a.u=function(){function b(c,e){if(c)if(8==c.nodeType){var g=a.u.jb(c.nodeValue);null!=g&&e.push({Fb:c,Tb:g})}else if(1==c.nodeType)for(var g=0,h=c.childNodes,k=h.length;g<k;g++)b(h[g],e)}var c={};return{Ca:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);
c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},ub:function(a,b){var g=c[a];if(g===q)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return g.apply(null,b||[]),!0}finally{delete c[a]}},vb:function(c,e){var g=[];b(c,g);for(var h=0,k=g.length;h<k;h++){var m=g[h].Fb,f=[m];e&&a.a.X(f,e);a.u.ub(g[h].Tb,f);m.nodeValue="";m.parentNode&&m.parentNode.removeChild(m)}},jb:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.u);a.b("memoization.memoize",
a.u.Ca);a.b("memoization.unmemoize",a.u.ub);a.b("memoization.parseMemoText",a.u.jb);a.b("memoization.unmemoizeDomNodeAndDescendants",a.u.vb);a.xa={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.h({read:b,write:function(a){clearTimeout(d);d=setTimeout(function(){b(a)},c)}})},notify:function(a,c){a.equalityComparer="always"==c?null:G}};var N={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.xa);a.sb=function(b,c,d){this.target=b;this.qa=c;this.Eb=d;a.s(this,"dispose",
this.B)};a.sb.prototype.B=function(){this.Qb=!0;this.Eb()};a.ca=function(){this.F={};a.a.extend(this,a.ca.fn);a.s(this,"subscribe",this.T);a.s(this,"extend",this.extend);a.s(this,"getSubscriptionsCount",this.Lb)};var I="change";a.ca.fn={T:function(b,c,d){d=d||I;var e=new a.sb(this,c?b.bind(c):b,function(){a.a.ia(this.F[d],e)}.bind(this));this.F[d]||(this.F[d]=[]);this.F[d].push(e);return e},notifySubscribers:function(b,c){c=c||I;if(this.cb(c))try{a.i.Wa();for(var d=this.F[c].slice(0),e=0,g;g=d[e];++e)g&&
!0!==g.Qb&&g.qa(b)}finally{a.i.end()}},cb:function(a){return this.F[a]&&this.F[a].length},Lb:function(){var b=0;a.a.K(this.F,function(a,d){b+=d.length});return b},extend:function(b){var c=this;b&&a.a.K(b,function(b,e){var g=a.xa[b];"function"==typeof g&&(c=g(c,e)||c)});return c}};a.fb=function(a){return null!=a&&"function"==typeof a.T&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.ca);a.b("isSubscribable",a.fb);a.i=function(){var b=[];return{Wa:function(a){b.push(a&&{qa:a,Za:[]})},
end:function(){b.pop()},lb:function(c){if(!a.fb(c))throw Error("Only subscribable things can act as dependencies");if(0<b.length){var d=b[b.length-1];!d||0<=a.a.l(d.Za,c)||(d.Za.push(c),d.qa(c))}},p:function(a,d,e){try{return b.push(null),a.apply(d,e||[])}finally{b.pop()}}}}();a.q=function(b){function c(){if(0<arguments.length)return c.equalityComparer&&c.equalityComparer(d,arguments[0])||(c.O(),d=arguments[0],c.N()),this;a.i.lb(c);return d}var d=b;a.ca.call(c);c.t=function(){return d};c.N=function(){c.notifySubscribers(d)};
c.O=function(){c.notifySubscribers(d,"beforeChange")};a.a.extend(c,a.q.fn);a.s(c,"peek",c.t);a.s(c,"valueHasMutated",c.N);a.s(c,"valueWillMutate",c.O);return c};a.q.fn={equalityComparer:G};var C=a.q.Yb="__ko_proto__";a.q.fn[C]=a.q;a.ya=function(b,c){return null===b||b===q||b[C]===q?!1:b[C]===c?!0:a.ya(b[C],c)};a.M=function(b){return a.ya(b,a.q)};a.gb=function(b){return"function"==typeof b&&b[C]===a.q||"function"==typeof b&&b[C]===a.h&&b.Nb?!0:!1};a.b("observable",a.q);a.b("isObservable",a.M);a.b("isWriteableObservable",
a.gb);a.ba=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.q(b);a.a.extend(b,a.ba.fn);return b.extend({trackArrayChanges:!0})};a.ba.fn={remove:function(b){for(var c=this.t(),d=[],e="function"!=typeof b||a.M(b)?function(a){return a===b}:b,g=0;g<c.length;g++){var h=c[g];e(h)&&(0===d.length&&this.O(),d.push(h),c.splice(g,1),g--)}d.length&&this.N();return d},removeAll:function(b){if(b===
q){var c=this.t(),d=c.slice(0);this.O();c.splice(0,c.length);this.N();return d}return b?this.remove(function(c){return 0<=a.a.l(b,c)}):[]},destroy:function(b){var c=this.t(),d="function"!=typeof b||a.M(b)?function(a){return a===b}:b;this.O();for(var e=c.length-1;0<=e;e--)d(c[e])&&(c[e]._destroy=!0);this.N()},destroyAll:function(b){return b===q?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.l(b,c)}):[]},indexOf:function(b){var c=this();return a.a.l(c,b)},replace:function(a,
c){var d=this.indexOf(a);0<=d&&(this.O(),this.t()[d]=c,this.N())}};a.a.n("pop push reverse shift sort splice unshift".split(" "),function(b){a.ba.fn[b]=function(){var a=this.t();this.O();this.Xa(a,b,arguments);a=a[b].apply(a,arguments);this.N();return a}});a.a.n(["slice"],function(b){a.ba.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.b("observableArray",a.ba);var J="arrayChange";a.xa.trackArrayChanges=function(b){function c(){if(!d){d=!0;var c=b.notifySubscribers;b.notifySubscribers=
function(a,b){b&&b!==I||++g;return c.apply(this,arguments)};var m=[].concat(b.t()||[]);e=null;b.T(function(c){c=[].concat(c||[]);if(b.cb(J)){var d;if(!e||1<g)e=a.a.ra(m,c,{sparse:!0});d=e;d.length&&b.notifySubscribers(d,J)}m=c;e=null;g=0})}}if(!b.Xa){var d=!1,e=null,g=0,h=b.T;b.T=b.subscribe=function(a,b,f){f===J&&c();return h.apply(this,arguments)};b.Xa=function(a,b,c){function p(a,b,c){h.push({status:a,value:b,index:c})}if(d&&!g){var h=[],l=a.length,n=c.length,r=0;switch(b){case "push":r=l;case "unshift":for(b=
0;b<n;b++)p("added",c[b],r+b);break;case "pop":r=l-1;case "shift":l&&p("deleted",a[r],r);break;case "splice":b=Math.min(Math.max(0,0>c[0]?l+c[0]:c[0]),l);for(var l=1===n?l:Math.min(b+(c[1]||0),l),n=b+n-2,r=Math.max(l,n),v=2;b<r;++b,++v)b<l&&p("deleted",a[b],b),b<n&&p("added",c[v],b);break;default:return}e=h}}}};a.h=function(b,c,d){function e(){a.a.n(z,function(a){a.B()});z=[]}function g(){var a=k.throttleEvaluation;a&&0<=a?(clearTimeout(x),x=setTimeout(h,a)):h()}function h(){if(!s){if(E&&E()){if(!l){D();
p=!0;return}}else l=!1;s=!0;try{var b=a.a.ha(z,function(a){return a.target});a.i.Wa(function(c){var d;0<=(d=a.a.l(b,c))?b[d]=q:z.push(c.T(g))});for(var d=c?n.call(c):n(),e=b.length-1;0<=e;e--)b[e]&&z.splice(e,1)[0].B();p=!0;k.equalityComparer&&k.equalityComparer(f,d)||(k.notifySubscribers(f,"beforeChange"),f=d,k.notifySubscribers(f))}finally{a.i.end(),s=!1}z.length||D()}}function k(){if(0<arguments.length){if("function"===typeof r)r.apply(c,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
return this}p||h();a.i.lb(k);return f}function m(){return!p||0<z.length}var f,p=!1,s=!1,l=!1,n=b;n&&"object"==typeof n?(d=n,n=d.read):(d=d||{},n||(n=d.read));if("function"!=typeof n)throw Error("Pass a function that returns the value of the ko.computed");var r=d.write,v=d.disposeWhenNodeIsRemoved||d.I||null,t=d.disposeWhen||d.ua,E=t,D=e,z=[],x=null;c||(c=d.owner);k.t=function(){p||h();return f};k.Kb=function(){return z.length};k.Nb="function"===typeof d.write;k.B=function(){D()};k.aa=m;a.ca.call(k);
a.a.extend(k,a.h.fn);a.s(k,"peek",k.t);a.s(k,"dispose",k.B);a.s(k,"isActive",k.aa);a.s(k,"getDependenciesCount",k.Kb);v&&(l=!0,v.nodeType&&(E=function(){return!a.a.va(v)||t&&t()}));!0!==d.deferEvaluation&&h();v&&m()&&(D=function(){a.a.C.mb(v,D);e()},a.a.C.ea(v,D));return k};a.Pb=function(b){return a.ya(b,a.h)};F=a.q.Yb;a.h[F]=a.q;a.h.fn={equalityComparer:G};a.h.fn[F]=a.h;a.b("dependentObservable",a.h);a.b("computed",a.h);a.b("isComputed",a.Pb);(function(){function b(a,g,h){h=h||new d;a=g(a);if("object"!=
typeof a||null===a||a===q||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var k=a instanceof Array?[]:{};h.save(a,k);c(a,function(c){var d=g(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":k[c]=d;break;case "object":case "undefined":var p=h.get(d);k[c]=p!==q?p:b(d,g,h)}});return k}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"function"==typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function d(){this.keys=
[];this.Qa=[]}a.tb=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(c,function(b){for(var c=0;a.M(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.tb(b);return a.a.Na(b,c,d)};d.prototype={save:function(b,c){var d=a.a.l(this.keys,b);0<=d?this.Qa[d]=c:(this.keys.push(b),this.Qa.push(c))},get:function(b){b=a.a.l(this.keys,b);return 0<=b?this.Qa[b]:q}}})();a.b("toJS",a.tb);a.b("toJSON",a.toJSON);(function(){a.k={o:function(b){switch(a.a.v(b)){case "option":return!0===
b.__ko__hasDomDataOptionValue__?a.a.f.get(b,a.d.options.Ea):7>=a.a.ja?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.k.o(b.options[b.selectedIndex]):q;default:return b.value}},na:function(b,c){switch(a.a.v(b)){case "option":switch(typeof c){case "string":a.a.f.set(b,a.d.options.Ea,q);"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=c;break;default:a.a.f.set(b,a.d.options.Ea,c),b.__ko__hasDomDataOptionValue__=
!0,b.value="number"===typeof c?c:""}break;case "select":""===c&&(c=q);if(null===c||c===q)b.selectedIndex=-1;for(var d=b.options.length-1;0<=d;d--)if(a.k.o(b.options[d])==c){b.selectedIndex=d;break}1<b.size||-1!==b.selectedIndex||(b.selectedIndex=0);break;default:if(null===c||c===q)c="";b.value=c}}}})();a.b("selectExtensions",a.k);a.b("selectExtensions.readValue",a.k.o);a.b("selectExtensions.writeValue",a.k.na);a.g=function(){function b(b){b=a.a.la(b);123===b.charCodeAt(0)&&(b=b.slice(1,-1));var c=
[],d=b.match(e),k,l,n=0;if(d){d.push(",");for(var r=0,v;v=d[r];++r){var t=v.charCodeAt(0);if(44===t){if(0>=n){k&&c.push(l?{key:k,value:l.join("")}:{unknown:k});k=l=n=0;continue}}else if(58===t){if(!l)continue}else if(47===t&&r&&1<v.length)(t=d[r-1].match(g))&&!h[t[0]]&&(b=b.substr(b.indexOf(v)+1),d=b.match(e),d.push(","),r=-1,v="/");else if(40===t||123===t||91===t)++n;else if(41===t||125===t||93===t)--n;else if(!k&&!l){k=34===t||39===t?v.slice(1,-1):v;continue}l?l.push(v):l=[v]}}return c}var c=["true",
"false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),g=/[\])"'A-Za-z0-9_$]+$/,h={"in":1,"return":1,"typeof":1},k={};return{Y:[],U:k,Ga:b,ka:function(e,f){function g(b,f){var e,r=a.getBindingHandler(b);if(r&&r.preprocess?f=r.preprocess(f,b,g):1){if(r=k[b])e=f,0<=a.a.l(c,e)?e=!1:(r=e.match(d),e=null===r?!1:r[1]?"Object("+r[1]+")"+
r[2]:e),r=e;r&&l.push("'"+b+"':function(_z){"+e+"=_z}");n&&(f="function(){return "+f+" }");h.push("'"+b+"':"+f)}}f=f||{};var h=[],l=[],n=f.valueAccessors,r="string"===typeof e?b(e):e;a.a.n(r,function(a){g(a.key||a.unknown,a.value)});l.length&&g("_ko_property_writers","{"+l.join(",")+"}");return h.join(",")},Sb:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},oa:function(b,c,d,e,k){if(b&&a.M(b))!a.gb(b)||k&&b.t()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();
a.b("expressionRewriting",a.g);a.b("expressionRewriting.bindingRewriteValidators",a.g.Y);a.b("expressionRewriting.parseObjectLiteral",a.g.Ga);a.b("expressionRewriting.preProcessBindings",a.g.ka);a.b("expressionRewriting._twoWayBindings",a.g.U);a.b("jsonExpressionRewriting",a.g);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.g.ka);(function(){function b(a){return 8==a.nodeType&&h.test(g?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&k.test(g?a.text:a.nodeValue)}function d(a,
d){for(var e=a,k=1,n=[];e=e.nextSibling;){if(c(e)&&(k--,0===k))return n;n.push(e);b(e)&&k++}if(!d)throw Error("Cannot find closing comment tag to match: "+a.nodeValue);return null}function e(a,b){var c=d(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var g=w&&"\x3c!--test--\x3e"===w.createComment("test").text,h=g?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=g?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,m={ul:!0,ol:!0};a.e={P:{},childNodes:function(a){return b(a)?
d(a):a.childNodes},Z:function(c){if(b(c)){c=a.e.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.wa(c)},S:function(c,d){if(b(c)){a.e.Z(c);for(var e=c.nextSibling,k=0,n=d.length;k<n;k++)e.parentNode.insertBefore(d[k],e)}else a.a.S(c,d)},kb:function(a,c){b(a)?a.parentNode.insertBefore(c,a.nextSibling):a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)},eb:function(c,d,e){e?b(c)?c.parentNode.insertBefore(d,e.nextSibling):e.nextSibling?c.insertBefore(d,e.nextSibling):
c.appendChild(d):a.e.kb(c,d)},firstChild:function(a){return b(a)?!a.nextSibling||c(a.nextSibling)?null:a.nextSibling:a.firstChild},nextSibling:function(a){b(a)&&(a=e(a));return a.nextSibling&&c(a.nextSibling)?null:a.nextSibling},Mb:b,bc:function(a){return(a=(g?a.text:a.nodeValue).match(h))?a[1]:null},ib:function(d){if(m[a.a.v(d)]){var k=d.firstChild;if(k){do if(1===k.nodeType){var g;g=k.firstChild;var h=null;if(g){do if(h)h.push(g);else if(b(g)){var n=e(g,!0);n?g=n:h=[g]}else c(g)&&(h=[g]);while(g=
g.nextSibling)}if(g=h)for(h=k.nextSibling,n=0;n<g.length;n++)h?d.insertBefore(g[n],h):d.appendChild(g[n])}while(k=k.nextSibling)}}}}})();a.b("virtualElements",a.e);a.b("virtualElements.allowedBindings",a.e.P);a.b("virtualElements.emptyNode",a.e.Z);a.b("virtualElements.insertAfter",a.e.eb);a.b("virtualElements.prepend",a.e.kb);a.b("virtualElements.setDomNodeChildren",a.e.S);(function(){a.H=function(){this.zb={}};a.a.extend(a.H.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=
b.getAttribute("data-bind");case 8:return a.e.Mb(b);default:return!1}},getBindings:function(a,c){var d=this.getBindingsString(a,c);return d?this.parseBindingsString(d,c,a):null},getBindingAccessors:function(a,c){var d=this.getBindingsString(a,c);return d?this.parseBindingsString(d,c,a,{valueAccessors:!0}):null},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.e.bc(b);default:return null}},parseBindingsString:function(b,c,d,e){try{var g=this.zb,
h=b+(e&&e.valueAccessors||""),k;if(!(k=g[h])){var m,f="with($context){with($data||{}){return{"+a.g.ka(b,e)+"}}}";m=new Function("$context","$element",f);k=g[h]=m}return k(c,d)}catch(p){throw p.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+p.message,p;}}});a.H.instance=new a.H})();a.b("bindingProvider",a.H);(function(){function b(a){return function(){return a}}function c(a){return a()}function d(b){return a.a.Da(a.i.p(b),function(a,c){return function(){return b()[c]}})}function e(a,
b){return d(this.getBindings.bind(this,a,b))}function g(b,c,d){var f,e=a.e.firstChild(c),k=a.H.instance,g=k.preprocessNode;if(g){for(;f=e;)e=a.e.nextSibling(f),g.call(k,f);e=a.e.firstChild(c)}for(;f=e;)e=a.e.nextSibling(f),h(b,f,d)}function h(b,c,d){var f=!0,e=1===c.nodeType;e&&a.e.ib(c);if(e&&d||a.H.instance.nodeHasBindings(c))f=m(c,null,b,d).shouldBindDescendants;f&&!p[a.a.v(c)]&&g(b,c,!e)}function k(b){var c=[],d={},f=[];a.a.K(b,function D(e){if(!d[e]){var k=a.getBindingHandler(e);k&&(k.after&&
(f.push(e),a.a.n(k.after,function(c){if(b[c]){if(-1!==a.a.l(f,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+f.join(", "));D(c)}}),f.pop()),c.push({key:e,bb:k}));d[e]=!0}});return c}function m(b,d,f,g){var h=a.a.f.get(b,s);if(!d){if(h)throw Error("You cannot apply bindings multiple times to the same element.");a.a.f.set(b,s,!0)}!h&&g&&a.rb(b,f);var m;if(d&&"function"!==typeof d)m=d;else{var p=a.H.instance,l=p.getBindingAccessors||e;if(d||f.A){var A=
a.h(function(){(m=d?d(f,b):l.call(p,b,f))&&f.A&&f.A();return m},null,{I:b});m&&A.aa()||(A=null)}else m=a.i.p(l,p,[b,f])}var u;if(m){var w=A?function(a){return function(){return c(A()[a])}}:function(a){return m[a]},y=function(){return a.a.Da(A?A():m,c)};y.get=function(a){return m[a]&&c(w(a))};y.has=function(a){return a in m};g=k(m);a.a.n(g,function(c){var d=c.bb.init,e=c.bb.update,k=c.key;if(8===b.nodeType&&!a.e.P[k])throw Error("The binding '"+k+"' cannot be used with virtual elements");try{"function"==
typeof d&&a.i.p(function(){var a=d(b,w(k),y,f.$data,f);if(a&&a.controlsDescendantBindings){if(u!==q)throw Error("Multiple bindings ("+u+" and "+k+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=k}}),"function"==typeof e&&a.h(function(){e(b,w(k),y,f.$data,f)},null,{I:b})}catch(g){throw g.message='Unable to process binding "'+k+": "+m[k]+'"\nMessage: '+g.message,g;}})}return{shouldBindDescendants:u===q}}function f(b){return b&&
b instanceof a.G?b:new a.G(b)}a.d={};var p={script:!0};a.getBindingHandler=function(b){return a.d[b]};a.G=function(b,c,d,f){var e=this,k="function"==typeof b,g,h=a.h(function(){var g=k?b():b;c?(c.A&&c.A(),a.a.extend(e,c),h&&(e.A=h)):(e.$parents=[],e.$root=g,e.ko=a);e.$rawData=b;e.$data=g;d&&(e[d]=g);f&&f(e,c,g);return e.$data},null,{ua:function(){return g&&!a.a.Ra(g)},I:!0});h.aa()&&(e.A=h,h.equalityComparer=null,g=[],h.wb=function(b){g.push(b);a.a.C.ea(b,function(b){a.a.ia(g,b);g.length||(h.B(),
e.A=h=q)})})};a.G.prototype.createChildContext=function(b,c,d){return new a.G(b,this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)})};a.G.prototype.extend=function(b){return new a.G(this.$rawData,this,null,function(c){a.a.extend(c,"function"==typeof b?b():b)})};var s=a.a.f.D(),l=a.a.f.D();a.rb=function(b,c){if(2==arguments.length)a.a.f.set(b,l,c),c.A&&c.A.wb(b);else return a.a.f.get(b,l)};a.pa=function(b,c,d){1===b.nodeType&&
a.e.ib(b);return m(b,c,f(d),!0)};a.xb=function(c,e,k){k=f(k);return a.pa(c,"function"===typeof e?d(e.bind(null,k,c)):a.a.Da(e,b),k)};a.Ta=function(a,b){1!==b.nodeType&&8!==b.nodeType||g(f(a),b,!0)};a.Sa=function(a,b){if(b&&1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");b=b||y.document.body;h(f(a),b,!0)};a.ta=function(b){switch(b.nodeType){case 1:case 8:var c=a.rb(b);if(c)return c;if(b.parentNode)return a.ta(b.parentNode)}return q};
a.Cb=function(b){return(b=a.ta(b))?b.$data:q};a.b("bindingHandlers",a.d);a.b("applyBindings",a.Sa);a.b("applyBindingsToDescendants",a.Ta);a.b("applyBindingAccessorsToNode",a.pa);a.b("applyBindingsToNode",a.xb);a.b("contextFor",a.ta);a.b("dataFor",a.Cb)})();var M={"class":"className","for":"htmlFor"};a.d.attr={update:function(b,c){var d=a.a.c(c())||{};a.a.K(d,function(c,d){d=a.a.c(d);var h=!1===d||null===d||d===q;h&&b.removeAttribute(c);8>=a.a.ja&&c in M?(c=M[c],h?b.removeAttribute(c):b[c]=d):h||b.setAttribute(c,
d.toString());"name"===c&&a.a.pb(b,h?"":d.toString())})}};(function(){a.d.checked={after:["value","attr"],init:function(b,c,d){function e(){return d.has("checkedValue")?a.a.c(d.get("checkedValue")):b.value}function g(){var k=b.checked,g=s?e():k;if(l&&(!m||k)){var h=a.i.p(c);f?p!==g?(k&&(a.a.V(h,g,!0),a.a.V(h,p,!1)),p=g):a.a.V(h,g,k):a.g.oa(h,d,"checked",g,!0)}}function h(){var d=a.a.c(c());b.checked=f?0<=a.a.l(d,e()):k?d:e()===d}var k="checkbox"==b.type,m="radio"==b.type;if(k||m){var f=k&&a.a.c(c())instanceof
Array,p=f?e():q,s=m||f,l=!1;m&&!b.name&&a.d.uniqueName.init(b,function(){return!0});a.h(g,null,{I:b});a.a.r(b,"click",g);a.h(h,null,{I:b});l=!0}}};a.g.U.checked=!0;a.d.checkedValue={update:function(b,c){b.value=a.a.c(c())}}})();a.d.css={update:function(b,c){var d=a.a.c(c());"object"==typeof d?a.a.K(d,function(c,d){d=a.a.c(d);a.a.ma(b,c,d)}):(d=String(d||""),a.a.ma(b,b.__ko__cssValue,!1),b.__ko__cssValue=d,a.a.ma(b,d,!0))}};a.d.enable={update:function(b,c){var d=a.a.c(c());d&&b.disabled?b.removeAttribute("disabled"):
d||b.disabled||(b.disabled=!0)}};a.d.disable={update:function(b,c){a.d.enable.update(b,function(){return!a.a.c(c())})}};a.d.event={init:function(b,c,d,e,g){var h=c()||{};a.a.K(h,function(k){"string"==typeof k&&a.a.r(b,k,function(b){var f,h=c()[k];if(h){try{var s=a.a.Q(arguments);e=g.$data;s.unshift(e);f=h.apply(e,s)}finally{!0!==f&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(k+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.d.foreach={hb:function(b){return function(){var c=
b(),d=a.a.Ha(c);if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.J.Aa};a.a.c(c);return{foreach:d.data,as:d.as,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.J.Aa}}},init:function(b,c){return a.d.template.init(b,a.d.foreach.hb(c))},update:function(b,c,d,e,g){return a.d.template.update(b,a.d.foreach.hb(c),d,e,g)}};a.g.Y.foreach=!1;a.e.P.foreach=!0;a.d.hasfocus=
{init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var g=b.ownerDocument;if("activeElement"in g){var f;try{f=g.activeElement}catch(h){f=g.body}e=f===b}g=c();a.g.oa(g,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var g=e.bind(null,!0),h=e.bind(null,!1);a.a.r(b,"focus",g);a.a.r(b,"focusin",g);a.a.r(b,"blur",h);a.a.r(b,"focusout",h)},update:function(b,c){var d=!!a.a.c(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),a.i.p(a.a.da,
null,[b,d?"focusin":"focusout"]))}};a.g.U.hasfocus=!0;a.d.hasFocus=a.d.hasfocus;a.g.U.hasFocus=!0;a.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Ka(b,c())}};var L=a.a.f.D();H("if");H("ifnot",!1,!0);H("with",!0,!1,function(a,c){return a.createChildContext(c)});a.d.options={init:function(b){if("select"!==a.a.v(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,
c,d){function e(){return a.a.ga(b.options,function(a){return a.selected})}function g(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function h(c,d){if(p.length){var f=0<=a.a.l(p,a.k.o(d[0]));a.a.qb(d[0],f);l&&!f&&a.i.p(a.a.da,null,[b,"change"])}}var k=0!=b.length&&b.multiple?b.scrollTop:null;c=a.a.c(c());var m=d.get("optionsIncludeDestroyed"),f={},p;p=b.multiple?a.a.ha(e(),a.k.o):0<=b.selectedIndex?[a.k.o(b.options[b.selectedIndex])]:[];if(c){"undefined"==typeof c.length&&(c=[c]);
var s=a.a.ga(c,function(b){return m||b===q||null===b||!a.a.c(b._destroy)});d.has("optionsCaption")&&(c=a.a.c(d.get("optionsCaption")),null!==c&&c!==q&&s.unshift(f))}else c=[];var l=!1;c=h;d.has("optionsAfterRender")&&(c=function(b,c){h(0,c);a.i.p(d.get("optionsAfterRender"),null,[c[0],b!==f?b:q])});a.a.Ja(b,s,function(b,c,e){e.length&&(p=e[0].selected?[a.k.o(e[0])]:[],l=!0);c=w.createElement("option");b===f?(a.a.Ma(c,d.get("optionsCaption")),a.k.na(c,q)):(e=g(b,d.get("optionsValue"),b),a.k.na(c,a.a.c(e)),
b=g(b,d.get("optionsText"),e),a.a.Ma(c,b));return[c]},null,c);(b.multiple?p.length&&e().length<p.length:p.length&&0<=b.selectedIndex?a.k.o(b.options[b.selectedIndex])!==p[0]:p.length||0<=b.selectedIndex)&&a.i.p(a.a.da,null,[b,"change"]);a.a.Hb(b);k&&20<Math.abs(k-b.scrollTop)&&(b.scrollTop=k)}};a.d.options.Ea=a.a.f.D();a.d.selectedOptions={after:["options","foreach"],init:function(b,c,d){a.a.r(b,"change",function(){var e=c(),g=[];a.a.n(b.getElementsByTagName("option"),function(b){b.selected&&g.push(a.k.o(b))});
a.g.oa(e,d,"selectedOptions",g)})},update:function(b,c){if("select"!=a.a.v(b))throw Error("values binding applies only to SELECT elements");var d=a.a.c(c());d&&"number"==typeof d.length&&a.a.n(b.getElementsByTagName("option"),function(b){var c=0<=a.a.l(d,a.k.o(b));a.a.qb(b,c)})}};a.g.U.selectedOptions=!0;a.d.style={update:function(b,c){var d=a.a.c(c()||{});a.a.K(d,function(c,d){d=a.a.c(d);b.style[c]=d||""})}};a.d.submit={init:function(b,c,d,e,g){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");
a.a.r(b,"submit",function(a){var d,e=c();try{d=e.call(g.$data,b)}finally{!0!==d&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Ma(b,c())}};a.e.P.text=!0;a.d.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.d.uniqueName.Bb;a.a.pb(b,d)}}};a.d.uniqueName.Bb=0;a.d.value={after:["options","foreach"],init:function(b,c,d){function e(){k=!1;var e=c(),f=a.k.o(b);a.g.oa(e,d,"value",f)}var g=
["change"],h=d.get("valueUpdate"),k=!1;h&&("string"==typeof h&&(h=[h]),a.a.X(g,h),g=a.a.Va(g));!a.a.ja||"input"!=b.tagName.toLowerCase()||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.l(g,"propertychange")||(a.a.r(b,"propertychange",function(){k=!0}),a.a.r(b,"blur",function(){k&&e()}));a.a.n(g,function(c){var d=e;a.a.ac(c,"after")&&(d=function(){setTimeout(e,0)},c=c.substring(5));a.a.r(b,c,d)})},update:function(b,c){var d="select"===a.a.v(b),e=a.a.c(c()),g=a.k.o(b);
e!==g&&(g=function(){a.k.na(b,e)},g(),d&&(e!==a.k.o(b)?a.i.p(a.a.da,null,[b,"change"]):setTimeout(g,0)))}};a.g.U.value=!0;a.d.visible={update:function(b,c){var d=a.a.c(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};(function(b){a.d[b]={init:function(c,d,e,g,h){return a.d.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,g,h)}}})("click");a.w=function(){};a.w.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");
};a.w.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.w.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.m.j(d)}if(1==b.nodeType||8==b.nodeType)return new a.m.W(b);throw Error("Unknown template type: "+b);};a.w.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,
d)};a.w.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.w.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.w);a.Oa=function(){function b(b,c,d,k){b=a.g.Ga(b);for(var m=a.g.Y,f=0;f<b.length;f++){var p=b[f].key;if(m.hasOwnProperty(p)){var s=m[p];if("function"===typeof s){if(p=s(b[f].value))throw Error(p);}else if(!s)throw Error("This template engine does not support the '"+
p+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.g.ka(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return k.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Ib:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.Oa.Ub(b,c)},
d)},Ub:function(a,g){return a.replace(c,function(a,c,d,f,e){return b(e,c,d,g)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",g)})},yb:function(b,c){return a.u.Ca(function(d,k){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.pa(m,b,k)})}}}();a.b("__tr_ambtns",a.Oa.yb);(function(){a.m={};a.m.j=function(a){this.j=a};a.m.j.prototype.text=function(){var b=a.a.v(this.j),b="script"===b?"text":"textarea"===b?"value":"innerHTML";if(0==arguments.length)return this.j[b];var c=arguments[0];
"innerHTML"===b?a.a.Ka(this.j,c):this.j[b]=c};var b=a.a.f.D()+"_";a.m.j.prototype.data=function(c){if(1===arguments.length)return a.a.f.get(this.j,b+c);a.a.f.set(this.j,b+c,arguments[1])};var c=a.a.f.D();a.m.W=function(a){this.j=a};a.m.W.prototype=new a.m.j;a.m.W.prototype.text=function(){if(0==arguments.length){var b=a.a.f.get(this.j,c)||{};b.Pa===q&&b.sa&&(b.Pa=b.sa.innerHTML);return b.Pa}a.a.f.set(this.j,c,{Pa:arguments[0]})};a.m.j.prototype.nodes=function(){if(0==arguments.length)return(a.a.f.get(this.j,
c)||{}).sa;a.a.f.set(this.j,c,{sa:arguments[0]})};a.b("templateSources",a.m);a.b("templateSources.domElement",a.m.j);a.b("templateSources.anonymousTemplate",a.m.W)})();(function(){function b(b,c,d){var e;for(c=a.e.nextSibling(c);b&&(e=b)!==c;)b=a.e.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var f=c[0],e=c[c.length-1],g=f.parentNode,h=a.H.instance,n=h.preprocessNode;if(n){b(f,e,function(a,b){var c=a.previousSibling,d=n.call(h,a);d&&(a===f&&(f=d[0]||b),a===e&&(e=d[d.length-1]||c))});c.length=
0;if(!f)return;f===e?c.push(f):(c.push(f,e),a.a.$(c,g))}b(f,e,function(b){1!==b.nodeType&&8!==b.nodeType||a.Sa(d,b)});b(f,e,function(b){1!==b.nodeType&&8!==b.nodeType||a.u.vb(b,[d])});a.a.$(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,s){s=s||{};var l=b&&d(b),l=l&&l.ownerDocument,n=s.templateEngine||g;a.Oa.Ib(f,n,l);f=n.renderTemplate(f,h,s,l);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");
l=!1;switch(e){case "replaceChildren":a.e.S(b,f);l=!0;break;case "replaceNode":a.a.nb(b,f);l=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}l&&(c(f,h),s.afterRender&&a.i.p(s.afterRender,null,[f,h.$data]));return f}var g;a.La=function(b){if(b!=q&&!(b instanceof a.w))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.Ia=function(b,c,f,h,s){f=f||{};if((f.templateEngine||g)==q)throw Error("Set a template engine before calling renderTemplate");
s=s||"replaceChildren";if(h){var l=d(h);return a.h(function(){var g=c&&c instanceof a.G?c:new a.G(a.a.c(c)),r="function"==typeof b?b(g.$data,g):b,g=e(h,s,r,g,f);"replaceNode"==s&&(h=g,l=d(h))},null,{ua:function(){return!l||!a.a.va(l)},I:l&&"replaceNode"==s?l.parentNode:l})}return a.u.Ca(function(d){a.Ia(b,c,f,d,"replaceNode")})};a.$b=function(b,d,f,g,h){function l(a,b){c(b,r);f.afterRender&&f.afterRender(b,a)}function n(a,c){r=h.createChildContext(a,f.as,function(a){a.$index=c});var d="function"==
typeof b?b(a,r):b;return e(null,"ignoreTargetNode",d,r,f)}var r;return a.h(function(){var b=a.a.c(d)||[];"undefined"==typeof b.length&&(b=[b]);b=a.a.ga(b,function(b){return f.includeDestroyed||b===q||null===b||!a.a.c(b._destroy)});a.i.p(a.a.Ja,null,[g,b,n,f,l])},null,{I:g})};var h=a.a.f.D();a.d.template={init:function(b,c){var d=a.a.c(c());"string"==typeof d||d.name?a.e.Z(b):(d=a.e.childNodes(b),d=a.a.Vb(d),(new a.m.W(b)).nodes(d));return{controlsDescendantBindings:!0}},update:function(b,c,d,e,g){c=
a.a.c(c());d={};e=!0;var l,n=null;"string"!=typeof c&&(d=c,c=a.a.c(d.name),"if"in d&&(e=a.a.c(d["if"])),e&&"ifnot"in d&&(e=!a.a.c(d.ifnot)),l=a.a.c(d.data));"foreach"in d?n=a.$b(c||b,e&&d.foreach||[],d,b,g):e?(g="data"in d?g.createChildContext(l,d.as):g,n=a.Ia(c||b,g,d,b)):a.e.Z(b);g=n;(l=a.a.f.get(b,h))&&"function"==typeof l.B&&l.B();a.a.f.set(b,h,g&&g.aa()?g:q)}};a.g.Y.template=function(b){b=a.g.Ga(b);return 1==b.length&&b[0].unknown||a.g.Sb(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};
a.e.P.template=!0})();a.b("setTemplateEngine",a.La);a.b("renderTemplate",a.Ia);a.a.ra=function(){function a(b,d,e,g,h){var k=Math.min,m=Math.max,f=[],p,q=b.length,l,n=d.length,r=n-q||1,v=q+n+1,t,u,w;for(p=0;p<=q;p++)for(u=t,f.push(t=[]),w=k(n,p+r),l=m(0,p-1);l<=w;l++)t[l]=l?p?b[p-1]===d[l-1]?u[l-1]:k(u[l]||v,t[l-1]||v)+1:l+1:p+1;k=[];m=[];r=[];p=q;for(l=n;p||l;)n=f[p][l]-1,l&&n===f[p][l-1]?m.push(k[k.length]={status:e,value:d[--l],index:l}):p&&n===f[p-1][l]?r.push(k[k.length]={status:g,value:b[--p],
index:p}):(--l,--p,h.sparse||k.push({status:"retained",value:d[l]}));if(m.length&&r.length){b=10*q;var z;for(d=e=0;(h.dontLimitMoves||d<b)&&(z=m[e]);e++){for(g=0;f=r[g];g++)if(z.value===f.value){z.moved=f.index;f.moved=z.index;r.splice(g,1);d=g=0;break}d+=g}}return k.reverse()}return function(c,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};c=c||[];d=d||[];return c.length<=d.length?a(c,d,"added","deleted",e):a(d,c,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.ra);(function(){function b(b,
c,g,h,k){var m=[],f=a.h(function(){var f=c(g,k,a.a.$(m,b))||[];0<m.length&&(a.a.nb(m,f),h&&a.i.p(h,null,[g,f,k]));m.splice(0,m.length);a.a.X(m,f)},null,{I:b,ua:function(){return!a.a.Ra(m)}});return{R:m,h:f.aa()?f:q}}var c=a.a.f.D();a.a.Ja=function(d,e,g,h,k){function m(b,c){x=s[c];t!==c&&(z[b]=x);x.za(t++);a.a.$(x.R,d);r.push(x);w.push(x)}function f(b,c){if(b)for(var d=0,e=c.length;d<e;d++)c[d]&&a.a.n(c[d].R,function(a){b(a,d,c[d].fa)})}e=e||[];h=h||{};var p=a.a.f.get(d,c)===q,s=a.a.f.get(d,c)||[],
l=a.a.ha(s,function(a){return a.fa}),n=a.a.ra(l,e,h.dontLimitMoves),r=[],v=0,t=0,u=[],w=[];e=[];for(var z=[],l=[],x,A=0,y,B;y=n[A];A++)switch(B=y.moved,y.status){case "deleted":B===q&&(x=s[v],x.h&&x.h.B(),u.push.apply(u,a.a.$(x.R,d)),h.beforeRemove&&(e[A]=x,w.push(x)));v++;break;case "retained":m(A,v++);break;case "added":B!==q?m(A,B):(x={fa:y.value,za:a.q(t++)},r.push(x),w.push(x),p||(l[A]=x))}f(h.beforeMove,z);a.a.n(u,h.beforeRemove?a.L:a.removeNode);for(var A=0,p=a.e.firstChild(d),C;x=w[A];A++){x.R||
a.a.extend(x,b(d,g,x.fa,k,x.za));for(v=0;n=x.R[v];p=n.nextSibling,C=n,v++)n!==p&&a.e.eb(d,n,C);!x.Ob&&k&&(k(x.fa,x.R,x.za),x.Ob=!0)}f(h.beforeRemove,e);f(h.afterMove,z);f(h.afterAdd,l);a.a.f.set(d,c,r)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.Ja);a.J=function(){this.allowTemplateRewriting=!1};a.J.prototype=new a.w;a.J.prototype.renderTemplateSource=function(b){var c=(9>a.a.ja?0:b.nodes)?b.nodes():null;if(c)return a.a.Q(c.cloneNode(!0).childNodes);b=b.text();return a.a.Fa(b)};a.J.Aa=
new a.J;a.La(a.J.Aa);a.b("nativeTemplateEngine",a.J);(function(){a.Ba=function(){var a=this.Rb=function(){if("undefined"==typeof u||!u.tmpl)return 0;try{if(0<=u.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,g){g=g||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=u.template(null,"{{ko_with $item.koBindingContext}}"+h+
"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=u.extend({koBindingContext:e},g.templateOptions);e=u.tmpl(h,b,e);e.appendTo(w.createElement("div"));u.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){w.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(u.tmpl.tag.ko_code={open:"__.push($1 || '');"},u.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.Ba.prototype=
new a.w;var b=new a.Ba;0<b.Rb&&a.La(b);a.b("jqueryTmplTemplateEngine",a.Ba)})()})})();})();
| bragma/cdnjs | ajax/libs/knockout/3.0.0/knockout-min.js | JavaScript | mit | 46,129 |
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc.tag",regex:"\\bTODO\\b"},{defaultToken:"comment.doc"}]}};r.inherits(s,i),s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),define("ace/mode/dot_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/doc_comment_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./doc_comment_highlight_rules").DocCommentHighlightRules,u=function(){var e=i.arrayToMap("strict|node|edge|graph|digraph|subgraph".split("|")),t=i.arrayToMap("damping|k|url|area|arrowhead|arrowsize|arrowtail|aspect|bb|bgcolor|center|charset|clusterrank|color|colorscheme|comment|compound|concentrate|constraint|decorate|defaultdist|dim|dimen|dir|diredgeconstraints|distortion|dpi|edgeurl|edgehref|edgetarget|edgetooltip|epsilon|esep|fillcolor|fixedsize|fontcolor|fontname|fontnames|fontpath|fontsize|forcelabels|gradientangle|group|headurl|head_lp|headclip|headhref|headlabel|headport|headtarget|headtooltip|height|href|id|image|imagepath|imagescale|label|labelurl|label_scheme|labelangle|labeldistance|labelfloat|labelfontcolor|labelfontname|labelfontsize|labelhref|labeljust|labelloc|labeltarget|labeltooltip|landscape|layer|layerlistsep|layers|layerselect|layersep|layout|len|levels|levelsgap|lhead|lheight|lp|ltail|lwidth|margin|maxiter|mclimit|mindist|minlen|mode|model|mosek|nodesep|nojustify|normalize|nslimit|nslimit1|ordering|orientation|outputorder|overlap|overlap_scaling|pack|packmode|pad|page|pagedir|pencolor|penwidth|peripheries|pin|pos|quadtree|quantum|rank|rankdir|ranksep|ratio|rects|regular|remincross|repulsiveforce|resolution|root|rotate|rotation|samehead|sametail|samplepoints|scale|searchsize|sep|shape|shapefile|showboxes|sides|size|skew|smoothing|sortv|splines|start|style|stylesheet|tailurl|tail_lp|tailclip|tailhref|taillabel|tailport|tailtarget|tailtooltip|target|tooltip|truecolor|vertices|viewport|voro_margin|weight|width|xlabel|xlp|z".split("|"));this.$rules={start:[{token:"comment",regex:/\/\/.*$/},{token:"comment",regex:/#.*$/},{token:"comment",merge:!0,regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/[+\-]?\d+(?:(?:\.\d*)?(?:[eE][+\-]?\d+)?)?\b/},{token:"keyword.operator",regex:/\+|=|\->/},{token:"punctuation.operator",regex:/,|;/},{token:"paren.lparen",regex:/[\[{]/},{token:"paren.rparen",regex:/[\]}]/},{token:"comment",regex:/^#!.*$/},{token:function(n){return e.hasOwnProperty(n.toLowerCase())?"keyword":t.hasOwnProperty(n.toLowerCase())?"variable":"text"},regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}],comment:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"string",regex:'[^"\\\\]+',merge:!0},{token:"string",regex:"\\\\$",next:"qqstring",merge:!0},{token:"string",regex:'"|$',next:"start",merge:!0}],qstring:[{token:"string",regex:"[^'\\\\]+",merge:!0},{token:"string",regex:"\\\\$",next:"qstring",merge:!0},{token:"string",regex:"'|$",next:"start",merge:!0}]}};r.inherits(u,s),t.DotHighlightRules=u}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n),s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)}}.call(o.prototype)}),define("ace/mode/dot",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/matching_brace_outdent","ace/mode/dot_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./matching_brace_outdent").MatchingBraceOutdent,o=e("./dot_highlight_rules").DotHighlightRules,u=e("./folding/cstyle").FoldMode,a=function(){this.HighlightRules=o,this.$outdent=new s,this.foldingRules=new u};r.inherits(a,i),function(){this.lineCommentStart=["//","#"],this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/dot"}.call(a.prototype),t.Mode=a}) | zhangbg/cdnjs | ajax/libs/ace/1.1.5/mode-dot.js | JavaScript | mit | 6,646 |
var es = require('../')
, it = require('it-is').style('colour')
, d = require('ubelt')
, join = require('path').join
, fs = require('fs')
, Stream = require('stream').Stream
, spec = require('stream-spec')
exports ['es.split() works like String#split'] = function (test) {
var readme = join(__filename)
, expected = fs.readFileSync(readme, 'utf-8').split('\n')
, cs = es.split()
, actual = []
, ended = false
, x = spec(cs).through()
var a = new Stream ()
a.write = function (l) {
actual.push(l.trim())
}
a.end = function () {
ended = true
expected.forEach(function (v,k) {
//String.split will append an empty string ''
//if the string ends in a split pattern.
//es.split doesn't which was breaking this test.
//clearly, appending the empty string is correct.
//tests are passing though. which is the current job.
if(v)
it(actual[k]).like(v)
})
//give the stream time to close
process.nextTick(function () {
test.done()
x.validate()
})
}
a.writable = true
fs.createReadStream(readme, {flags: 'r'}).pipe(cs)
cs.pipe(a)
}
require('./helper')(module)
| dvmoomoodv/CORK-server | vendor/codeigniter/framework/frontend/node_modules/event-stream/test/split.asynct.js | JavaScript | mit | 1,226 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('yui-later', function (Y, NAME) {
/**
* Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module,
* <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>.
*
* @module yui
* @submodule yui-later
*/
var NO_ARGS = [];
/**
* Executes the supplied function in the context of the supplied
* object 'when' milliseconds later. Executes the function a
* single time unless periodic is set to true.
* @for YUI
* @method later
* @param when {Number} the number of milliseconds to wait until the fn
* is executed.
* @param o the context object.
* @param fn {Function|String} the function to execute or the name of
* the method in the 'o' object to execute.
* @param data [Array] data that is provided to the function. This
* accepts either a single item or an array. If an array is provided,
* the function is executed with one parameter for each array item.
* If you need to pass a single array parameter, it needs to be wrapped
* in an array [myarray].
*
* Note: native methods in IE may not have the call and apply methods.
* In this case, it will work, but you are limited to four arguments.
*
* @param periodic {boolean} if true, executes continuously at supplied
* interval until canceled.
* @return {object} a timer object. Call the cancel() method on this
* object to stop the timer.
*/
Y.later = function(when, o, fn, data, periodic) {
when = when || 0;
data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
o = o || Y.config.win || Y;
var cancelled = false,
method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
wrapper = function() {
// IE 8- may execute a setInterval callback one last time
// after clearInterval was called, so in order to preserve
// the cancel() === no more runny-run, we have to jump through
// an extra hoop.
if (!cancelled) {
if (!method.apply) {
method(data[0], data[1], data[2], data[3]);
} else {
method.apply(o, data || NO_ARGS);
}
}
},
id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);
return {
id: id,
interval: periodic,
cancel: function() {
cancelled = true;
if (this.interval) {
clearInterval(id);
} else {
clearTimeout(id);
}
}
};
};
Y.Lang.later = Y.later;
}, '3.17.2', {"requires": ["yui-base"]});
| hagabaka/cdnjs | ajax/libs/yui/3.17.2/yui-later/yui-later-debug.js | JavaScript | mit | 2,748 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-night .yui3-calendar-content{padding:10px;color:#cbcbcb;border:1px solid #303030;background:#151515;background:-moz-linear-gradient(top,#222 0,#151515 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#222),color-stop(100%,#151515));background:-webkit-linear-gradient(top,#222 0,#151515 100%);background:-o-linear-gradient(top,#222 0,#151515 100%);background:-ms-linear-gradient(top,#222 0,#151515 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#222222',endColorstr='#151515',GradientType=0);background:linear-gradient(top,#222 0,#151515 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-night .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-night .yui3-calendar-header{padding-bottom:10px}.yui3-skin-night .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold;text-align:center;width:100%}.yui3-skin-night .yui3-calendar-day,.yui3-skin-night .yui3-calendar-prevmonth-day,.yui3-skin-night .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #151515;background:#262727;text-align:center}.yui3-skin-night .yui3-calendar-day:hover{background:#383939;color:#fff}.yui3-skin-night .yui3-calendar-selection-disabled,.yui3-skin-night .yui3-calendar-selection-disabled:hover{background:#151515;color:#596060}.yui3-skin-night .yui3-calendar-weekday{color:#4f4f4f;font-weight:bold;text-align:center}.yui3-skin-night .yui3-calendar-prevmonth-day,.yui3-skin-night .yui3-calendar-nextmonth-day{color:#4f4f4f}.yui3-skin-night .yui3-calendar-day{font-weight:bold}.yui3-skin-night .yui3-calendar-day-selected{background-color:#505151;color:#fff}.yui3-skin-night .yui3-calendar-left-grid{margin-right:1em}[dir="rtl"] .yui3-skin-night .yui3-calendar-left-grid,.yui3-skin-night [dir="rtl"] .yui3-calendar-left-grid{margin-right:auto;margin-left:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}[dir="rtl"] .yui3-skin-night .yui3-calendar-right-grid,.yui3-skin-night [dir="rtl"] .yui3-calendar-right-grid{margin-left:auto;margin-right:1em}#yui3-css-stamp.skin-night-calendar-base{display:none}
| moay/jsdelivr | files/yui/3.17.2/calendar-base/assets/skins/night/calendar-base.css | CSS | mit | 2,365 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('editor-bidi', function (Y, NAME) {
/**
* Plugin for Editor to support BiDirectional (bidi) text operations.
* @class Plugin.EditorBidi
* @extends Base
* @constructor
* @module editor
* @submodule editor-bidi
*/
var EditorBidi = function() {
EditorBidi.superclass.constructor.apply(this, arguments);
}, HOST = 'host', DIR = 'dir', NODE_CHANGE = 'nodeChange',
B_C_CHANGE = 'bidiContextChange', STYLE = 'style';
Y.extend(EditorBidi, Y.Base, {
/**
* Place holder for the last direction when checking for a switch
* @private
* @property lastDirection
*/
lastDirection: null,
/**
* Tells us that an initial bidi check has already been performed
* @private
* @property firstEvent
*/
firstEvent: null,
/**
* Method checks to see if the direction of the text has changed based on a nodeChange event.
* @private
* @method _checkForChange
*/
_checkForChange: function() {
var host = this.get(HOST),
inst = host.getInstance(),
sel = new inst.EditorSelection(),
node, direction;
if (sel.isCollapsed) {
node = EditorBidi.blockParent(sel.focusNode, false, inst.EditorSelection.ROOT);
if (node) {
direction = node.getStyle('direction');
if (direction !== this.lastDirection) {
host.fire(B_C_CHANGE, { changedTo: direction });
this.lastDirection = direction;
}
}
} else {
host.fire(B_C_CHANGE, { changedTo: 'select' });
this.lastDirection = null;
}
},
/**
* Checked for a change after a specific nodeChange event has been fired.
* @private
* @method _afterNodeChange
*/
_afterNodeChange: function(e) {
// If this is the first event ever, or an event that can result in a context change
if (this.firstEvent || EditorBidi.EVENTS[e.changedType]) {
this._checkForChange();
this.firstEvent = false;
}
},
/**
* Checks for a direction change after a mouseup occurs.
* @private
* @method _afterMouseUp
*/
_afterMouseUp: function() {
this._checkForChange();
this.firstEvent = false;
},
initializer: function() {
var host = this.get(HOST);
this.firstEvent = true;
host.after(NODE_CHANGE, Y.bind(this._afterNodeChange, this));
host.after('dom:mouseup', Y.bind(this._afterMouseUp, this));
}
}, {
/**
* The events to check for a direction change on
* @property EVENTS
* @static
*/
EVENTS: {
'backspace-up': true,
'pageup-up': true,
'pagedown-down': true,
'end-up': true,
'home-up': true,
'left-up': true,
'up-up': true,
'right-up': true,
'down-up': true,
'delete-up': true
},
/**
* More elements may be needed. BODY *must* be in the list to take care of the special case.
*
* blockParent could be changed to use inst.EditorSelection.BLOCKS
* instead, but that would make Y.Plugin.EditorBidi.blockParent
* unusable in non-RTE contexts (it being usable is a nice
* side-effect).
* @property BLOCKS
* @static
*/
//BLOCKS: Y.EditorSelection.BLOCKS+',LI,HR,' + BODY,
BLOCKS: Y.EditorSelection.BLOCKS,
/**
* Template for creating a block element
* @static
* @property DIV_WRAPPER
*/
DIV_WRAPPER: '<DIV></DIV>',
/**
* Returns a block parent for a given element
* @static
* @method blockParent
*/
blockParent: function(node, wrap, root) {
var parent = node, divNode, firstChild;
root = root || Y.EditorSelection.ROOT;
if (!parent) {
parent = root;
}
if (!parent.test(EditorBidi.BLOCKS)) {
parent = parent.ancestor(EditorBidi.BLOCKS);
}
if (wrap && parent.compareTo(root)) {
// This shouldn't happen if the RTE handles everything
// according to spec: we should get to a P before ROOT. But
// we don't want to set the direction of ROOT even if that
// happens, so we wrap everything in a DIV.
// The code is based on YUI3's Y.EditorSelection._wrapBlock function.
divNode = Y.Node.create(EditorBidi.DIV_WRAPPER);
parent.get('children').each(function(node, index) {
if (index === 0) {
firstChild = node;
} else {
divNode.append(node);
}
});
firstChild.replace(divNode);
divNode.prepend(firstChild);
parent = divNode;
}
return parent;
},
/**
* The data key to store on the node.
* @static
* @property _NODE_SELECTED
*/
_NODE_SELECTED: 'bidiSelected',
/**
* Generates a list of all the block parents of the current NodeList
* @static
* @method addParents
*/
addParents: function(nodeArray, root) {
var i, parent, addParent;
tester = function(sibling) {
if (!sibling.getData(EditorBidi._NODE_SELECTED)) {
addParent = false;
return true; // stop more processing
}
};
root = root || Y.EditorSelection.ROOT;
for (i = 0; i < nodeArray.length; i += 1) {
nodeArray[i].setData(EditorBidi._NODE_SELECTED, true);
}
// This works automagically, since new parents added get processed
// later themselves. So if there's a node early in the process that
// we haven't discovered some of its siblings yet, thus resulting in
// its parent not added, the parent will be added later, since those
// siblings will be added to the array and then get processed.
for (i = 0; i < nodeArray.length; i += 1) {
parent = nodeArray[i].get('parentNode');
// Don't add the parent if the parent is the ROOT element.
// We don't want to change the direction of ROOT. Also don't
// do it if the parent is already in the list.
if (!root.compareTo(parent) && !parent.getData(EditorBidi._NODE_SELECTED)) {
addParent = true;
parent.get('children').some(tester);
if (addParent) {
nodeArray.push(parent);
parent.setData(EditorBidi._NODE_SELECTED, true);
}
}
}
for (i = 0; i < nodeArray.length; i += 1) {
nodeArray[i].clearData(EditorBidi._NODE_SELECTED);
}
return nodeArray;
},
/**
* editorBidi
* @static
* @property NAME
*/
NAME: 'editorBidi',
/**
* editorBidi
* @static
* @property NS
*/
NS: 'editorBidi',
ATTRS: {
host: {
value: false
}
},
/**
* Regex for testing/removing text-align style from an element
* @static
* @property RE_TEXT_ALIGN
*/
RE_TEXT_ALIGN: /text-align:\s*\w*\s*;/,
/**
* Method to test a node's style attribute for text-align and removing it.
* @static
* @method removeTextAlign
*/
removeTextAlign: function(n) {
if (n) {
if (n.getAttribute(STYLE).match(EditorBidi.RE_TEXT_ALIGN)) {
n.setAttribute(STYLE, n.getAttribute(STYLE).replace(EditorBidi.RE_TEXT_ALIGN, ''));
}
if (n.hasAttribute('align')) {
n.removeAttribute('align');
}
}
return n;
}
});
Y.namespace('Plugin');
Y.Plugin.EditorBidi = EditorBidi;
/**
* bidi execCommand override for setting the text direction of a node.
* This property is added to the `Y.Plugin.ExecCommands.COMMANDS`
* collection.
*
* @for Plugin.ExecCommand
* @property bidi
*/
//TODO -- This should not add this command unless the plugin is added to the instance..
Y.Plugin.ExecCommand.COMMANDS.bidi = function(cmd, direction) {
var inst = this.getInstance(),
sel = new inst.EditorSelection(),
ns = this.get(HOST).get(HOST).editorBidi,
returnValue, block, b,
root = inst.EditorSelection.ROOT,
selected, selectedBlocks, dir;
if (!ns) {
Y.error('bidi execCommand is not available without the EditorBiDi plugin.');
return;
}
inst.EditorSelection.filterBlocks();
if (sel.isCollapsed) { // No selection
block = EditorBidi.blockParent(sel.anchorNode, false, root);
if (!block) {
block = root.one(inst.EditorSelection.BLOCKS);
}
//Remove text-align attribute if it exists
block = EditorBidi.removeTextAlign(block);
if (!direction) {
//If no direction is set, auto-detect the proper setting to make it "toggle"
dir = block.getAttribute(DIR);
if (!dir || dir === 'ltr') {
direction = 'rtl';
} else {
direction = 'ltr';
}
}
block.setAttribute(DIR, direction);
if (Y.UA.ie) {
b = block.all('br.yui-cursor');
if (b.size() === 1 && block.get('childNodes').size() === 1) {
b.remove();
}
}
returnValue = block;
} else { // some text is selected
selected = sel.getSelected();
selectedBlocks = [];
selected.each(function(node) {
selectedBlocks.push(EditorBidi.blockParent(node, false, root));
});
selectedBlocks = inst.all(EditorBidi.addParents(selectedBlocks, root));
selectedBlocks.each(function(n) {
var d = direction;
//Remove text-align attribute if it exists
n = EditorBidi.removeTextAlign(n);
if (!d) {
dir = n.getAttribute(DIR);
if (!dir || dir === 'ltr') {
d = 'rtl';
} else {
d = 'ltr';
}
}
n.setAttribute(DIR, d);
});
returnValue = selectedBlocks;
}
ns._checkForChange();
return returnValue;
};
}, '3.17.2', {"requires": ["editor-base"]});
| joeylakay/cdnjs | ajax/libs/yui/3.17.2/editor-bidi/editor-bidi-debug.js | JavaScript | mit | 11,707 |
var isIterateeCall = require('../internal/isIterateeCall'),
keys = require('./keys');
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite property
* assignments of previous values unless `multiValue` is `true`.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to invert.
* @param {boolean} [multiValue] Allow multiple values per key.
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*
* // with `multiValue`
* _.invert(object, true);
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function invert(object, multiValue, guard) {
if (guard && isIterateeCall(object, multiValue, guard)) {
multiValue = undefined;
}
var index = -1,
props = keys(object),
length = props.length,
result = {};
while (++index < length) {
var key = props[index],
value = object[key];
if (multiValue) {
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
else {
result[value] = key;
}
}
return result;
}
module.exports = invert;
| Anoop-Goudar/apiIntegration | node_modules/bower/lib/node_modules/inquirer/node_modules/lodash/object/invert.js | JavaScript | mit | 1,578 |
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="gu_IN">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Namecoin</source>
<translation>બીટકોઈન વિષે</translation>
</message>
<message>
<location line="+39"/>
<source><b>Namecoin</b> version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+17"/>
<source>Copyright</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>2009-%1 The Bitcoin and Namecoin developers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-46"/>
<source>These are your Namecoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Namecoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified Namecoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+66"/>
<source>Copy &Label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+263"/>
<source>Export Address Book Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+146"/>
<source>Label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR NAMECOINS</b>!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-56"/>
<source>Namecoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Namecoins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoin.cpp" line="+118"/>
<source>A fatal error occurred. Namecoin can no longer continue safely and will quit.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="+74"/>
<location line="+565"/>
<source>Namecoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-565"/>
<source>Wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+142"/>
<source>&Overview</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Send coins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Send coins to a Namecoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Receive coins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Transactions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Address Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Manage Names</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Manage names registered via Namecoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+19"/>
<source>E&xit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&About Namecoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Namecoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Modify configuration options for Namecoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>&Show / Hide</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Sign &message...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Sign messages with your Namecoin addresses to prove you own them</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>&Verify message...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Verify messages to ensure they were signed with specified Namecoin addresses</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>&Export...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>&Debug window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>&File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Actions toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<location line="+81"/>
<source>[testnet]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-5"/>
<location line="+5"/>
<source>Namecoin client</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+81"/>
<source>%n active connection(s) to Namecoin network</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+24"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+14"/>
<source>%n hour(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+5"/>
<source>%1 behind</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Catching up...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+68"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Sent transaction</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+112"/>
<location line="+28"/>
<source>URI handling</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-28"/>
<location line="+28"/>
<source>URI can not be parsed! This can be caused by an invalid Namecoin address or malformed URI parameters.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Backup Wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConfigureNameDialog</name>
<message>
<location filename="../forms/configurenamedialog.ui" line="+20"/>
<source>Configure Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+41"/>
<source>&Data:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>D&NS Configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>&Name servers:
(one per line,
host or IP)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+44"/>
<source><html><head/><body><p>Enter substitution name that will be used in DNS queries.</p><p>For example: bitcoin.org</p></body></html></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-29"/>
<source>Enter name servers as host names (preferable), or IP addresses. E.g.
ns0.web-sweet-web.net
ns1.web-sweet-web.net
ns0.xname.org
1.2.3.4
1.2.3.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>T&ranslate name:
(optional)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<location line="+94"/>
<source>&SSL fingerprint:
(optional)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-80"/>
<location line="+73"/>
<source>Enter SSL certificate fingerprint if you want to use HTTPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-33"/>
<source>&IP Configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>I&P Address:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>IP address, e.g. 1.2.3.4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Subdomains will be mapped to the same IP</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+45"/>
<source>&Custom Configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Enter JSON string, e.g. {&quot;ns&quot;: [&quot;1.2.3.4&quot;, &quot;1.2.3.5&quot;]}</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">See <a href="http://dot-bit.org/HowToRegisterAndConfigureBitDomains"><span style=" text-decoration: underline; color:#0000ff;">How to Register and Configure Bit Domains</span></a></p></body></html></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Enter JSON string that will be associated with the name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+44"/>
<source>&Address:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>&Transfer to:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+35"/>
<source>Choose address from address book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<location line="+56"/>
<source>Alt+P</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-26"/>
<source>Namecoin address to which the name is assigned</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Copy address to clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-412"/>
<source>Domain name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+322"/>
<source>The Namecoin address to transfer
the domain to, e.g.
N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9
Leave empty, if not needed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+53"/>
<source>(can be left empty)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../configurenamedialog.cpp" line="+51"/>
<source>(not a domain name)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+121"/>
<source>Name_firstupdate transaction will be queued and broadcasted when corresponding name_new is %1 blocks old</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Do not close your client while the name is pending!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Name_update transaction will be issued immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Update Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+58"/>
<source>Name update error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+86"/>
<source>Valid JSON string</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Invalid JSON string (can still be used, if not intended as JSON string)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Namecoin address.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+423"/>
<location line="+12"/>
<source>Namecoin-Qt</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ManageNamesPage</name>
<message>
<location filename="../forms/managenamespage.ui" line="+20"/>
<source>Manage Names</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>&New name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Enter a name or domain name (prefixed with d/) to be registered via Namecoin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source><html><head/><body><p>Use <span style=" font-weight:600;">d/</span> prefix for domain names. E.g. <span style=" font-weight:600;">d/mysite</span> will register <span style=" font-weight:600;">mysite.bit</span> (note: domains can be lower-case only, valid characters are alphanumeric and hyphen; hyphen can't be first/last character).</p><p>See <a href="http://dot-bit.org/Namespace:Domain_names"><span style=" text-decoration: underline; color:#0000ff;">Domain names</span></a> in Namecoin wiki for reference. Other prefixes can be used for miscellaneous purposes (not domain names).</p></body></html></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+28"/>
<source>Confirm the new name action. Sends name_new transaction
to the network and creates a pending name_firstupdate transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>&Submit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+36"/>
<source>Your registered names:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+29"/>
<source>Enter part of name to search for</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Enter part of value to search for</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Enter Namecoin address (or prefix of it)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+31"/>
<source>Double-click name to configure</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+42"/>
<source>Configure name and submit update operation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<location filename="../managenamespage.cpp" line="+86"/>
<source>&Configure Name...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../managenamespage.cpp" line="-3"/>
<source>Copy &Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy &Value</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy &Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+37"/>
<source>Name filter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Value filter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Address filter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+90"/>
<source>Name registration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Name not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<location line="+10"/>
<source>Name registration warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-9"/>
<source>The name you entered contains whitespace characters. It is probably invalid. Are you sure you want to use this name?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>The name you entered does not start with prefix (such as "d/"). It may be invalid for certain tasks. Are you sure you want to use this name?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Are you sure you want to register domain name %1, which corresponds to domain %2?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Are you sure you want to register non-domain name %1?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This will issue both a name_new and a postponed name_firstupdate. Let the program run for three hours to make sure the process can finish.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Confirm name registration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+57"/>
<source>Name registration failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+93"/>
<source>Export Registered Names Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Error exporting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NameTableModel</name>
<message>
<location filename="../nametablemodel.cpp" line="+365"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Value</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Expires in</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+140"/>
<source>Name registered using Namecoin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Data associated with the name.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Namecoin address to which the name is registered.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Number of blocks, after which the name will expire. Update name to renew it.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start Namecoin after logging in to the system.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Start Namecoin on system login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Namecoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the Namecoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Namecoin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Namecoin addresses in the transaction list or not.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Namecoin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+51"/>
<location line="+183"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Namecoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-141"/>
<source>Balance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+58"/>
<source>Number of transactions:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+124"/>
<source>Immature:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-118"/>
<source>Your current balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+20"/>
<source>Total number of transactions in wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+115"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+108"/>
<source>Cannot start namecoin: click-to-pay handler</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+345"/>
<source>N/A</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Show the Namecoin-Qt help message to get a list with possible Namecoin command-line options.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-104"/>
<source>Namecoin - Debug window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Namecoin Core</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Open the Namecoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Namecoin RPC console.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+125"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>... NMC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Namecoin address (e.g. N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Namecoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Namecoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+26"/>
<location line="+3"/>
<source>Enter a Namecoin address (e.g. N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Enter Namecoin signature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+82"/>
<location line="+82"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-82"/>
<location line="+82"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-74"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Message signing failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+51"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+21"/>
<source>Open until %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+88"/>
<source>To</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-107"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+115"/>
<location line="+16"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="-171"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+74"/>
<source>Name operation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+40"/>
<location line="+8"/>
<location line="+14"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-254"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+227"/>
<source>Date</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Name operation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+41"/>
<source>(n/a)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+200"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Name operation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+137"/>
<source>Export Transaction Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+95"/>
<source>Range:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+565"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+36"/>
<source>Cannot find stored tx hash for name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Cannot find stored rand value for name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+38"/>
<source>Invalid Namecoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>There are pending operations on that name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Could not find a coin with this name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>This coin is not in your wallet</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>namecoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+9"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=namecoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Namecoin is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Listen for JSON-RPC connections on <port> (default: 8336 or testnet: 18336)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Set the number of script verification threads (1-16, 0=auto, default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Unable to bind to %s on this computer. Namecoin is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Namecoin will not work properly.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Namecoin version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Block creation options:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Don't generate coins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Done loading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error initializing block database</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Namecoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error opening block database</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error: could not start node</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Generate coins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Importing blocks from block database...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Listen for connections on <port> (default: 8334 or testnet: 18334)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Loading addresses...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Loading block index...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Loading wallet...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Options:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Rebuild blockchain index from current blk000??.dat files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or namecoind</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Specify configuration file (default: bitcoin.conf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Specify data directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: namecoind.pid)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>System error: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This help message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>To use the %s option</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Verifying database...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet integrity...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart Namecoin to complete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
| acmeyer/namecoin | src/qt/locale/bitcoin_gu_IN.ts | TypeScript | mit | 119,269 |
function hex2b64(t){var e,n,i="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),i+=b64map.charAt(n>>6)+b64map.charAt(63&n);if(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),i+=b64map.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),i+=b64map.charAt(n>>2)+b64map.charAt((3&n)<<4)),b64pad)for(;(3&i.length)>0;)i+=b64pad;return i}function b64tohex(t){var e,n,i,r="",s=0;for(e=0;e<t.length&&t.charAt(e)!=b64pad;++e)i=b64map.indexOf(t.charAt(e)),0>i||(0==s?(r+=int2char(i>>2),n=3&i,s=1):1==s?(r+=int2char(n<<2|i>>4),n=15&i,s=2):2==s?(r+=int2char(n),r+=int2char(i>>2),n=3&i,s=3):(r+=int2char(n<<2|i>>4),r+=int2char(15&i),s=0));return 1==s&&(r+=int2char(n<<2)),r}function b64toBA(t){var e,n=b64tohex(t),i=new Array;for(e=0;2*e<n.length;++e)i[e]=parseInt(n.substring(2*e,2*e+2),16);return i}function BigInteger(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function nbi(){return new BigInteger(null)}function am1(t,e,n,i,r,s){for(;--s>=0;){var a=e*this[t++]+n[i]+r;r=Math.floor(a/67108864),n[i++]=67108863&a}return r}function am2(t,e,n,i,r,s){for(var a=32767&e,o=e>>15;--s>=0;){var h=32767&this[t],u=this[t++]>>15,c=o*h+u*a;h=a*h+((32767&c)<<15)+n[i]+(1073741823&r),r=(h>>>30)+(c>>>15)+o*u+(r>>>30),n[i++]=1073741823&h}return r}function am3(t,e,n,i,r,s){for(var a=16383&e,o=e>>14;--s>=0;){var h=16383&this[t],u=this[t++]>>14,c=o*h+u*a;h=a*h+((16383&c)<<14)+n[i]+r,r=(h>>28)+(c>>14)+o*u,n[i++]=268435455&h}return r}function int2char(t){return BI_RM.charAt(t)}function intAt(t,e){var n=BI_RC[t.charCodeAt(e)];return null==n?-1:n}function bnpCopyTo(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function bnpFromInt(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+this.DV:this.t=0}function nbv(t){var e=nbi();return e.fromInt(t),e}function bnpFromString(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,r=!1,s=0;--i>=0;){var a=8==n?255&t[i]:intAt(t,i);0>a?"-"==t.charAt(i)&&(r=!0):(r=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,s+=n,s>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),r&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function bnToString(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,i=(1<<e)-1,r=!1,s="",a=this.t,o=this.DB-a*this.DB%e;if(a-- >0)for(o<this.DB&&(n=this[a]>>o)>0&&(r=!0,s=int2char(n));a>=0;)e>o?(n=(this[a]&(1<<o)-1)<<e-o,n|=this[--a]>>(o+=this.DB-e)):(n=this[a]>>(o-=e)&i,0>=o&&(o+=this.DB,--a)),n>0&&(r=!0),r&&(s+=int2char(n));return r?s:"0"}function bnNegate(){var t=nbi();return BigInteger.ZERO.subTo(this,t),t}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(e=n-t.t,0!=e)return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0}function nbits(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function bnpDRShiftTo(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function bnpLShiftTo(t,e){var n,i=t%this.DB,r=this.DB-i,s=(1<<r)-1,a=Math.floor(t/this.DB),o=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)e[n+a+1]=this[n]>>r|o,o=(this[n]&s)<<i;for(n=a-1;n>=0;--n)e[n]=0;e[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()}function bnpRShiftTo(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)return void(e.t=0);var i=t%this.DB,r=this.DB-i,s=(1<<i)-1;e[0]=this[n]>>i;for(var a=n+1;a<this.t;++a)e[a-n-1]|=(this[a]&s)<<r,e[a-n]=this[a]>>i;i>0&&(e[this.t-n-1]|=(this.s&s)<<r),e.t=this.t-n,e.clamp()}function bnpSubTo(t,e){for(var n=0,i=0,r=Math.min(t.t,this.t);r>n;)i+=this[n]-t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i-=t[n],e[n++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=0>i?-1:0,-1>i?e[n++]=this.DV+i:i>0&&(e[n++]=i),e.t=n,e.clamp()}function bnpMultiplyTo(t,e){var n=this.abs(),i=t.abs(),r=n.t;for(e.t=r+i.t;--r>=0;)e[r]=0;for(r=0;r<i.t;++r)e[r+n.t]=n.am(0,i[r],e,r,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&BigInteger.ZERO.subTo(e,e)}function bnpSquareTo(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var i=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,i,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function bnpDivRemTo(t,e,n){var i=t.abs();if(!(i.t<=0)){var r=this.abs();if(r.t<i.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=nbi());var s=nbi(),a=this.s,o=t.s,h=this.DB-nbits(i[i.t-1]);h>0?(i.lShiftTo(h,s),r.lShiftTo(h,n)):(i.copyTo(s),r.copyTo(n));var u=s.t,c=s[u-1];if(0!=c){var f=c*(1<<this.F1)+(u>1?s[u-2]>>this.F2:0),g=this.FV/f,l=(1<<this.F1)/f,d=1<<this.F2,p=n.t,y=p-u,S=null==e?nbi():e;for(s.dlShiftTo(y,S),n.compareTo(S)>=0&&(n[n.t++]=1,n.subTo(S,n)),BigInteger.ONE.dlShiftTo(u,S),S.subTo(s,s);s.t<u;)s[s.t++]=0;for(;--y>=0;){var A=n[--p]==c?this.DM:Math.floor(n[p]*g+(n[p-1]+d)*l);if((n[p]+=s.am(0,A,n,y,0,u))<A)for(s.dlShiftTo(y,S),n.subTo(S,n);n[p]<--A;)n.subTo(S,n)}null!=e&&(n.drShiftTo(u,e),a!=o&&BigInteger.ZERO.subTo(e,e)),n.t=u,n.clamp(),h>0&&n.rShiftTo(h,n),0>a&&BigInteger.ZERO.subTo(n,n)}}}function bnMod(t){var e=nbi();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(BigInteger.ZERO)>0&&t.subTo(e,e),e}function Classic(t){this.m=t}function cConvert(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function cRevert(t){return t}function cReduce(t){t.divRemTo(this.m,null,t)}function cMulTo(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function cSqrTo(t,e){t.squareTo(e),this.reduce(e)}function bnpInvDigit(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Montgomery(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function montConvert(t){var e=nbi();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(BigInteger.ZERO)>0&&this.m.subTo(e,e),e}function montRevert(t){var e=nbi();return t.copyTo(e),this.reduce(e),e}function montReduce(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],i=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,i,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function montSqrTo(t,e){t.squareTo(e),this.reduce(e)}function montMulTo(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(t,e){if(t>4294967295||1>t)return BigInteger.ONE;var n=nbi(),i=nbi(),r=e.convert(this),s=nbits(t)-1;for(r.copyTo(n);--s>=0;)if(e.sqrTo(n,i),(t&1<<s)>0)e.mulTo(i,r,n);else{var a=n;n=i,i=a}return e.revert(n)}function bnModPowInt(t,e){var n;return n=256>t||e.isEven()?new Classic(e):new Montgomery(e),this.exp(t,n)}function bnClone(){var t=nbi();return this.copyTo(t),t}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(t){if(null==t&&(t=10),0==this.signum()||2>t||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),i=nbv(n),r=nbi(),s=nbi(),a="";for(this.divRemTo(i,r,s);r.signum()>0;)a=(n+s.intValue()).toString(t).substr(1)+a,r.divRemTo(i,r,s);return s.intValue().toString(t)+a}function bnpFromRadix(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),r=!1,s=0,a=0,o=0;o<t.length;++o){var h=intAt(t,o);0>h?"-"==t.charAt(o)&&0==this.signum()&&(r=!0):(a=e*a+h,++s>=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),r&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(t,e,n){if("number"==typeof e)if(2>t)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(t-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(BigInteger.ONE.shiftLeft(t-1),this);else{var i=new Array,r=7&t;i.length=(t>>3)+1,e.nextBytes(i),r>0?i[0]&=(1<<r)-1:i[0]=0,this.fromString(i,256)}}function bnToByteArray(){var t=this.t,e=new Array;e[0]=this.s;var n,i=this.DB-t*this.DB%8,r=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(e[r++]=n|this.s<<this.DB-i);t>=0;)8>i?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,0>=i&&(i+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==r&&(128&this.s)!=(128&n)&&++r,(r>0||n!=this.s)&&(e[r++]=n);return e}function bnEquals(t){return 0==this.compareTo(t)}function bnMin(t){return this.compareTo(t)<0?this:t}function bnMax(t){return this.compareTo(t)>0?this:t}function bnpBitwiseTo(t,e,n){var i,r,s=Math.min(t.t,this.t);for(i=0;s>i;++i)n[i]=e(this[i],t[i]);if(t.t<this.t){for(r=t.s&this.DM,i=s;i<this.t;++i)n[i]=e(this[i],r);n.t=this.t}else{for(r=this.s&this.DM,i=s;i<t.t;++i)n[i]=e(r,t[i]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()}function op_and(t,e){return t&e}function bnAnd(t){var e=nbi();return this.bitwiseTo(t,op_and,e),e}function op_or(t,e){return t|e}function bnOr(t){var e=nbi();return this.bitwiseTo(t,op_or,e),e}function op_xor(t,e){return t^e}function bnXor(t){var e=nbi();return this.bitwiseTo(t,op_xor,e),e}function op_andnot(t,e){return t&~e}function bnAndNot(t){var e=nbi();return this.bitwiseTo(t,op_andnot,e),e}function bnNot(){for(var t=nbi(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function bnShiftLeft(t){var e=nbi();return 0>t?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function bnShiftRight(t){var e=nbi();return 0>t?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function lbit(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function bnGetLowestSetBit(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+lbit(this[t]);return this.s<0?this.t*this.DB:-1}function cbit(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function bnBitCount(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=cbit(this[n]^e);return t}function bnTestBit(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)}function bnpChangeBit(t,e){var n=BigInteger.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n}function bnSetBit(t){return this.changeBit(t,op_or)}function bnClearBit(t){return this.changeBit(t,op_andnot)}function bnFlipBit(t){return this.changeBit(t,op_xor)}function bnpAddTo(t,e){for(var n=0,i=0,r=Math.min(t.t,this.t);r>n;)i+=this[n]+t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i+=t[n],e[n++]=i&this.DM,i>>=this.DB;i+=t.s}e.s=0>i?-1:0,i>0?e[n++]=i:-1>i&&(e[n++]=this.DV+i),e.t=n,e.clamp()}function bnAdd(t){var e=nbi();return this.addTo(t,e),e}function bnSubtract(t){var e=nbi();return this.subTo(t,e),e}function bnMultiply(t){var e=nbi();return this.multiplyTo(t,e),e}function bnSquare(){var t=nbi();return this.squareTo(t),t}function bnDivide(t){var e=nbi();return this.divRemTo(t,e,null),e}function bnRemainder(t){var e=nbi();return this.divRemTo(t,null,e),e}function bnDivideAndRemainder(t){var e=nbi(),n=nbi();return this.divRemTo(t,e,n),new Array(e,n)}function bnpDMultiply(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function NullExp(){}function nNop(t){return t}function nMulTo(t,e,n){t.multiplyTo(e,n)}function nSqrTo(t,e){t.squareTo(e)}function bnPow(t){return this.exp(t,new NullExp)}function bnpMultiplyLowerTo(t,e,n){var i=Math.min(this.t+t.t,e);for(n.s=0,n.t=i;i>0;)n[--i]=0;var r;for(r=n.t-this.t;r>i;++i)n[i+this.t]=this.am(0,t[i],n,i,0,this.t);for(r=Math.min(t.t,e);r>i;++i)this.am(0,t[i],n,i,0,e-i);n.clamp()}function bnpMultiplyUpperTo(t,e,n){--e;var i=n.t=this.t+t.t-e;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)n[this.t+i-e]=this.am(e-i,t[i],n,0,0,this.t+i-e);n.clamp(),n.drShiftTo(1,n)}function Barrett(t){this.r2=nbi(),this.q3=nbi(),BigInteger.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function barrettConvert(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=nbi();return t.copyTo(e),this.reduce(e),e}function barrettRevert(t){return t}function barrettReduce(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function barrettSqrTo(t,e){t.squareTo(e),this.reduce(e)}function barrettMulTo(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function bnModPow(t,e){var n,i,r=t.bitLength(),s=nbv(1);if(0>=r)return s;n=18>r?1:48>r?3:144>r?4:768>r?5:6,i=8>r?new Classic(e):e.isEven()?new Barrett(e):new Montgomery(e);var a=new Array,o=3,h=n-1,u=(1<<n)-1;if(a[1]=i.convert(this),n>1){var c=nbi();for(i.sqrTo(a[1],c);u>=o;)a[o]=nbi(),i.mulTo(c,a[o-2],a[o]),o+=2}var f,g,l=t.t-1,d=!0,p=nbi();for(r=nbits(t[l])-1;l>=0;){for(r>=h?f=t[l]>>r-h&u:(f=(t[l]&(1<<r+1)-1)<<h-r,l>0&&(f|=t[l-1]>>this.DB+r-h)),o=n;0==(1&f);)f>>=1,--o;if((r-=o)<0&&(r+=this.DB,--l),d)a[f].copyTo(s),d=!1;else{for(;o>1;)i.sqrTo(s,p),i.sqrTo(p,s),o-=2;o>0?i.sqrTo(s,p):(g=s,s=p,p=g),i.mulTo(p,a[f],s)}for(;l>=0&&0==(t[l]&1<<r);)i.sqrTo(s,p),g=s,s=p,p=g,--r<0&&(r=this.DB-1,--l)}return i.revert(s)}function bnGCD(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var i=e;e=n,n=i}var r=e.getLowestSetBit(),s=n.getLowestSetBit();if(0>s)return e;for(s>r&&(s=r),s>0&&(e.rShiftTo(s,e),n.rShiftTo(s,n));e.signum()>0;)(r=e.getLowestSetBit())>0&&e.rShiftTo(r,e),(r=n.getLowestSetBit())>0&&n.rShiftTo(r,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return s>0&&n.lShiftTo(s,n),n}function bnpModInt(t){if(0>=t)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var i=this.t-1;i>=0;--i)n=(e*n+this[i])%t;return n}function bnModInverse(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return BigInteger.ZERO;for(var n=t.clone(),i=this.clone(),r=nbv(1),s=nbv(0),a=nbv(0),o=nbv(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(r.isEven()&&s.isEven()||(r.addTo(this,r),s.subTo(t,s)),r.rShiftTo(1,r)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),e?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(t,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);n.compareTo(i)>=0?(n.subTo(i,n),e&&r.subTo(a,r),s.subTo(o,s)):(i.subTo(n,i),e&&a.subTo(r,a),o.subTo(s,o))}return 0!=i.compareTo(BigInteger.ONE)?BigInteger.ZERO:o.compareTo(t)>=0?o.subtract(t):o.signum()<0?(o.addTo(t,o),o.signum()<0?o.add(t):o):o}function bnIsProbablePrime(t){var e,n=this.abs();if(1==n.t&&n[0]<=lowprimes[lowprimes.length-1]){for(e=0;e<lowprimes.length;++e)if(n[0]==lowprimes[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<lowprimes.length;){for(var i=lowprimes[e],r=e+1;r<lowprimes.length&&lplim>i;)i*=lowprimes[r++];for(i=n.modInt(i);r>e;)if(i%lowprimes[e++]==0)return!1}return n.millerRabin(t)}function bnpMillerRabin(t){var e=this.subtract(BigInteger.ONE),n=e.getLowestSetBit();if(0>=n)return!1;var i=e.shiftRight(n);t=t+1>>1,t>lowprimes.length&&(t=lowprimes.length);for(var r=nbi(),s=0;t>s;++s){r.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var a=r.modPow(i,this);if(0!=a.compareTo(BigInteger.ONE)&&0!=a.compareTo(e)){for(var o=1;o++<n&&0!=a.compareTo(e);)if(a=a.modPowInt(2,this),0==a.compareTo(BigInteger.ONE))return!1;if(0!=a.compareTo(e))return!1}}return!0}function Arcfour(){this.i=0,this.j=0,this.S=new Array}function ARC4init(t){var e,n,i;for(e=0;256>e;++e)this.S[e]=e;for(n=0,e=0;256>e;++e)n=n+this.S[e]+t[e%t.length]&255,i=this.S[e],this.S[e]=this.S[n],this.S[n]=i;this.i=0,this.j=0}function ARC4next(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}function rng_seed_int(t){rng_pool[rng_pptr++]^=255&t,rng_pool[rng_pptr++]^=t>>8&255,rng_pool[rng_pptr++]^=t>>16&255,rng_pool[rng_pptr++]^=t>>24&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(t){var e;for(e=0;e<t.length;++e)t[e]=rng_get_byte()}function SecureRandom(){}function parseBigInt(t,e){return new BigInteger(t,e)}function linebrk(t,e){for(var n="",i=0;i+e<t.length;)n+=t.substring(i,i+e)+"\n",i+=e;return n+t.substring(i,t.length)}function byte2Hex(t){return 16>t?"0"+t.toString(16):t.toString(16)}function pkcs1pad2(t,e){if(e<t.length+11)return alert("Message too long for RSA"),null;for(var n=new Array,i=t.length-1;i>=0&&e>0;){var r=t.charCodeAt(i--);128>r?n[--e]=r:r>127&&2048>r?(n[--e]=63&r|128,n[--e]=r>>6|192):(n[--e]=63&r|128,n[--e]=r>>6&63|128,n[--e]=r>>12|224)}n[--e]=0;for(var s=new SecureRandom,a=new Array;e>2;){for(a[0]=0;0==a[0];)s.nextBytes(a);n[--e]=a[0]}return n[--e]=2,n[--e]=0,new BigInteger(n)}function oaep_mgf1_arr(t,e,n){for(var i="",r=0;i.length<e;)i+=n(String.fromCharCode.apply(String,t.concat([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r]))),r+=1;return i}function oaep_pad(t,e,n){if(t.length+2*SHA1_SIZE+2>e)throw"Message too long for RSA";var i,r="";for(i=0;i<e-t.length-2*SHA1_SIZE-2;i+=1)r+="\x00";var s=rstr_sha1("")+r+""+t,a=new Array(SHA1_SIZE);(new SecureRandom).nextBytes(a);var o=oaep_mgf1_arr(a,s.length,n||rstr_sha1),h=[];for(i=0;i<s.length;i+=1)h[i]=s.charCodeAt(i)^o.charCodeAt(i);var u=oaep_mgf1_arr(h,a.length,rstr_sha1),c=[0];for(i=0;i<a.length;i+=1)c[i+1]=a[i]^u.charCodeAt(i);return new BigInteger(c.concat(h))}function RSAKey(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function RSASetPublic(t,e){this.isPublic=!0,"string"!=typeof t?(this.n=t,this.e=e):null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=parseBigInt(t,16),this.e=parseInt(e,16)):alert("Invalid RSA public key")}function RSADoPublic(t){return t.modPowInt(this.e,this.n)}function RSAEncrypt(t){var e=pkcs1pad2(t,this.n.bitLength()+7>>3);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var i=n.toString(16);return 0==(1&i.length)?i:"0"+i}function RSAEncryptOAEP(t,e){var n=oaep_pad(t,this.n.bitLength()+7>>3,e);if(null==n)return null;var i=this.doPublic(n);if(null==i)return null;var r=i.toString(16);return 0==(1&r.length)?r:"0"+r}function pkcs1unpad2(t,e){for(var n=t.toByteArray(),i=0;i<n.length&&0==n[i];)++i;if(n.length-i!=e-1||2!=n[i])return null;for(++i;0!=n[i];)if(++i>=n.length)return null;for(var r="";++i<n.length;){var s=255&n[i];128>s?r+=String.fromCharCode(s):s>191&&224>s?(r+=String.fromCharCode((31&s)<<6|63&n[i+1]),++i):(r+=String.fromCharCode((15&s)<<12|(63&n[i+1])<<6|63&n[i+2]),i+=2)}return r}function oaep_mgf1_str(t,e,n){for(var i="",r=0;i.length<e;)i+=n(t+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])),r+=1;return i}function oaep_unpad(t,e,n){t=t.toByteArray();var i;for(i=0;i<t.length;i+=1)t[i]&=255;for(;t.length<e;)t.unshift(0);if(t=String.fromCharCode.apply(String,t),t.length<2*SHA1_SIZE+2)throw"Cipher too short";var i,r=t.substr(1,SHA1_SIZE),s=t.substr(SHA1_SIZE+1),a=oaep_mgf1_str(s,SHA1_SIZE,n||rstr_sha1),o=[];for(i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i)^a.charCodeAt(i);var h=oaep_mgf1_str(String.fromCharCode.apply(String,o),t.length-SHA1_SIZE,rstr_sha1),u=[];for(i=0;i<s.length;i+=1)u[i]=s.charCodeAt(i)^h.charCodeAt(i);if(u=String.fromCharCode.apply(String,u),u.substr(0,SHA1_SIZE)!==rstr_sha1(""))throw"Hash mismatch";u=u.substr(SHA1_SIZE);var c=u.indexOf(""),f=-1!=c?u.substr(0,c).lastIndexOf("\x00"):-1;if(f+1!=c)throw"Malformed data";return u.substr(c+1)}function RSASetPrivate(t,e,n){this.isPrivate=!0,"string"!=typeof t?(this.n=t,this.e=e,this.d=n):null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=parseBigInt(t,16),this.e=parseInt(e,16),this.d=parseBigInt(n,16)):alert("Invalid RSA private key")}function RSASetPrivateEx(t,e,n,i,r,s,a,o){if(this.isPrivate=!0,null==t)throw"RSASetPrivateEx N == null";if(null==e)throw"RSASetPrivateEx E == null";if(0==t.length)throw"RSASetPrivateEx N.length == 0";if(0==e.length)throw"RSASetPrivateEx E.length == 0";null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=parseBigInt(t,16),this.e=parseInt(e,16),this.d=parseBigInt(n,16),this.p=parseBigInt(i,16),this.q=parseBigInt(r,16),this.dmp1=parseBigInt(s,16),this.dmq1=parseBigInt(a,16),this.coeff=parseBigInt(o,16)):alert("Invalid RSA private key in RSASetPrivateEx")}function RSAGenerate(t,e){var n=new SecureRandom,i=t>>1;this.e=parseInt(e,16);for(var r=new BigInteger(e,16);;){for(;this.p=new BigInteger(t-i,1,n),0!=this.p.subtract(BigInteger.ONE).gcd(r).compareTo(BigInteger.ONE)||!this.p.isProbablePrime(10););for(;this.q=new BigInteger(i,1,n),0!=this.q.subtract(BigInteger.ONE).gcd(r).compareTo(BigInteger.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var a=this.p.subtract(BigInteger.ONE),o=this.q.subtract(BigInteger.ONE),h=a.multiply(o);if(0==h.gcd(r).compareTo(BigInteger.ONE)){this.n=this.p.multiply(this.q),this.d=r.modInverse(h),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(o),this.coeff=this.q.modInverse(this.p);break}}}function RSADoPrivate(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),n=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(n)<0;)e=e.add(this.p);return e.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)}function RSADecrypt(t){var e=parseBigInt(t,16),n=this.doPrivate(e);return null==n?null:pkcs1unpad2(n,this.n.bitLength()+7>>3)}function RSADecryptOAEP(t,e){var n=parseBigInt(t,16),i=this.doPrivate(n);return null==i?null:oaep_unpad(i,this.n.bitLength()+7>>3,e)}function ECFieldElementFp(t,e){this.x=e,this.q=t}function feFpEquals(t){return t==this?!0:this.q.equals(t.q)&&this.x.equals(t.x)}function feFpToBigInteger(){return this.x}function feFpNegate(){return new ECFieldElementFp(this.q,this.x.negate().mod(this.q))}function feFpAdd(t){return new ECFieldElementFp(this.q,this.x.add(t.toBigInteger()).mod(this.q))}function feFpSubtract(t){return new ECFieldElementFp(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}function feFpMultiply(t){return new ECFieldElementFp(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}function feFpSquare(){return new ECFieldElementFp(this.q,this.x.square().mod(this.q))}function feFpDivide(t){return new ECFieldElementFp(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}function ECPointFp(t,e,n,i){this.curve=t,this.x=e,this.y=n,null==i?this.z=BigInteger.ONE:this.z=i,this.zinv=null}function pointFpGetX(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpGetY(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpEquals(t){if(t==this)return!0;if(this.isInfinity())return t.isInfinity();if(t.isInfinity())return this.isInfinity();var e,n;return e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),e.equals(BigInteger.ZERO)?(n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q),n.equals(BigInteger.ZERO)):!1}function pointFpIsInfinity(){return null==this.x&&null==this.y?!0:this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)}function pointFpNegate(){return new ECPointFp(this.curve,this.x,this.y.negate(),this.z)}function pointFpAdd(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(n))return BigInteger.ZERO.equals(e)?this.twice():this.curve.getInfinity();var i=new BigInteger("3"),r=this.x.toBigInteger(),s=this.y.toBigInteger(),a=(t.x.toBigInteger(),t.y.toBigInteger(),n.square()),o=a.multiply(n),h=r.multiply(a),u=e.square().multiply(this.z),c=u.subtract(h.shiftLeft(1)).multiply(t.z).subtract(o).multiply(n).mod(this.curve.q),f=h.multiply(i).multiply(e).subtract(s.multiply(o)).subtract(u.multiply(e)).multiply(t.z).add(e.multiply(o)).mod(this.curve.q),g=o.multiply(this.z).multiply(t.z).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(f),g)}function pointFpTwice(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new BigInteger("3"),e=this.x.toBigInteger(),n=this.y.toBigInteger(),i=n.multiply(this.z),r=i.multiply(n).mod(this.curve.q),s=this.curve.a.toBigInteger(),a=e.square().multiply(t);BigInteger.ZERO.equals(s)||(a=a.add(this.z.square().multiply(s))),a=a.mod(this.curve.q);var o=a.square().subtract(e.shiftLeft(3).multiply(r)).shiftLeft(1).multiply(i).mod(this.curve.q),h=a.multiply(t).multiply(e).subtract(r.shiftLeft(1)).shiftLeft(2).multiply(r).subtract(a.square().multiply(a)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(o),this.curve.fromBigInteger(h),u)}function pointFpMultiply(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,i=n.multiply(new BigInteger("3")),r=this.negate(),s=this;for(e=i.bitLength()-2;e>0;--e){s=s.twice();var a=i.testBit(e),o=n.testBit(e);a!=o&&(s=s.add(a?this:r))}return s}function pointFpMultiplyTwo(t,e,n){var i;i=t.bitLength()>n.bitLength()?t.bitLength()-1:n.bitLength()-1;for(var r=this.curve.getInfinity(),s=this.add(e);i>=0;)r=r.twice(),t.testBit(i)?r=n.testBit(i)?r.add(s):r.add(this):n.testBit(i)&&(r=r.add(e)),--i;return r}function ECCurveFp(t,e,n){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(n),this.infinity=new ECPointFp(this,null,null)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(t){return t==this?!0:this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(t){return new ECFieldElementFp(this.q,t)}function curveFpDecodePointHex(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(t.length-2)/2,n=t.substr(2,e),i=t.substr(e+2,e);return new ECPointFp(this,this.fromBigInteger(new BigInteger(n,16)),this.fromBigInteger(new BigInteger(i,16)));default:return null}}function Base64x(){}function stoBA(t){for(var e=new Array,n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function BAtos(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}function BAtohex(t){for(var e="",n=0;n<t.length;n++){var i=t[n].toString(16);1==i.length&&(i="0"+i),e+=i}return e}function stohex(t){return BAtohex(stoBA(t))}function stob64(t){return hex2b64(stohex(t))}function stob64u(t){return b64tob64u(hex2b64(stohex(t)))}function b64utos(t){return BAtos(b64toBA(b64utob64(t)))}function b64tob64u(t){return t=t.replace(/\=/g,""),t=t.replace(/\+/g,"-"),t=t.replace(/\//g,"_")}function b64utob64(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=t.replace(/-/g,"+"),t=t.replace(/_/g,"/")}function hextob64u(t){return t.length%2==1&&(t="0"+t),b64tob64u(hex2b64(t))}function b64utohex(t){return b64tohex(b64utob64(t))}function utf8tob64(t){return hex2b64(uricmptohex(encodeURIComponentAll(t)))}function b64toutf8(t){return decodeURIComponent(hextouricmp(b64tohex(t)))}function utf8tohex(t){return uricmptohex(encodeURIComponentAll(t))}function hextoutf8(t){return decodeURIComponent(hextouricmp(t))}function hextorstr(t){for(var e="",n=0;n<t.length-1;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e}function rstrtohex(t){for(var e="",n=0;n<t.length;n++)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e}function hextob64(t){return hex2b64(t)}function hextob64nl(t){var e=hextob64(t),n=e.replace(/(.{64})/g,"$1\r\n");return n=n.replace(/\r\n$/,"")}function b64nltohex(t){var e=t.replace(/[^0-9A-Za-z\/+=]*/g,""),n=b64tohex(e);return n}function uricmptohex(t){return t.replace(/%/g,"")}function hextouricmp(t){return t.replace(/(..)/g,"%$1")}function encodeURIComponentAll(t){for(var e=encodeURIComponent(t),n="",i=0;i<e.length;i++)"%"==e[i]?(n+=e.substr(i,3),i+=2):n=n+"%"+stohex(e[i]);return n}function newline_toUnix(t){return t=t.replace(/\r\n/gm,"\n")}function newline_toDos(t){return t=t.replace(/\r\n/gm,"\n"),t=t.replace(/\n/gm,"\r\n")}function intarystrtohex(t){t=t.replace(/^\s*\[\s*/,""),t=t.replace(/\s*\]\s*$/,""),t=t.replace(/\s*/g,"");try{var e=t.split(/,/).map(function(t,e,n){var i=parseInt(t);if(0>i||i>255)throw"integer not in range 0-255";var r=("00"+i.toString(16)).slice(-2);return r}).join("");return e}catch(n){throw"malformed integer array string: "+n}}function _rsapem_pemToBase64(t){var e=t;return e=e.replace("-----BEGIN RSA PRIVATE KEY-----",""),e=e.replace("-----END RSA PRIVATE KEY-----",""),e=e.replace(/[ \n]+/g,"")}function _rsapem_getPosArrayOfChildrenFromHex(t){var e=new Array,n=ASN1HEX.getStartPosOfV_AtObj(t,0),i=ASN1HEX.getPosOfNextSibling_AtObj(t,n),r=ASN1HEX.getPosOfNextSibling_AtObj(t,i),s=ASN1HEX.getPosOfNextSibling_AtObj(t,r),a=ASN1HEX.getPosOfNextSibling_AtObj(t,s),o=ASN1HEX.getPosOfNextSibling_AtObj(t,a),h=ASN1HEX.getPosOfNextSibling_AtObj(t,o),u=ASN1HEX.getPosOfNextSibling_AtObj(t,h),c=ASN1HEX.getPosOfNextSibling_AtObj(t,u);return e.push(n,i,r,s,a,o,h,u,c),e}function _rsapem_getHexValueArrayOfChildrenFromHex(t){var e=_rsapem_getPosArrayOfChildrenFromHex(t),n=ASN1HEX.getHexOfV_AtObj(t,e[0]),i=ASN1HEX.getHexOfV_AtObj(t,e[1]),r=ASN1HEX.getHexOfV_AtObj(t,e[2]),s=ASN1HEX.getHexOfV_AtObj(t,e[3]),a=ASN1HEX.getHexOfV_AtObj(t,e[4]),o=ASN1HEX.getHexOfV_AtObj(t,e[5]),h=ASN1HEX.getHexOfV_AtObj(t,e[6]),u=ASN1HEX.getHexOfV_AtObj(t,e[7]),c=ASN1HEX.getHexOfV_AtObj(t,e[8]),f=new Array;return f.push(n,i,r,s,a,o,h,u,c),f}function _rsapem_readPrivateKeyFromASN1HexString(t){var e=_rsapem_getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);
}function _rsapem_readPrivateKeyFromPEMString(t){var e=_rsapem_pemToBase64(t),n=b64tohex(e),i=_rsapem_getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])}function _rsasign_getHexPaddedDigestInfoForString(t,e,n){var i=function(t){return KJUR.crypto.Util.hashString(t,n)},r=i(t);return KJUR.crypto.Util.getPaddedDigestInfoHex(r,n,e)}function _zeroPaddingOfSignature(t,e){for(var n="",i=e/4-t.length,r=0;i>r;r++)n+="0";return n+t}function _rsasign_signString(t,e){var n=function(t){return KJUR.crypto.Util.hashString(t,e)},i=n(t);return this.signWithMessageHash(i,e)}function _rsasign_signWithMessageHash(t,e){var n=KJUR.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),i=parseBigInt(n,16),r=this.doPrivate(i),s=r.toString(16);return _zeroPaddingOfSignature(s,this.n.bitLength())}function _rsasign_signStringWithSHA1(t){return _rsasign_signString.call(this,t,"sha1")}function _rsasign_signStringWithSHA256(t){return _rsasign_signString.call(this,t,"sha256")}function pss_mgf1_str(t,e,n){for(var i="",r=0;i.length<e;)i+=hextorstr(n(rstrtohex(t+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])))),r+=1;return i}function _rsasign_signStringPSS(t,e,n){var i=function(t){return KJUR.crypto.Util.hashHex(t,e)},r=i(rstrtohex(t));return void 0===n&&(n=-1),this.signWithMessageHashPSS(r,e,n)}function _rsasign_signWithMessageHashPSS(t,e,n){var i,r=hextorstr(t),s=r.length,a=this.n.bitLength()-1,o=Math.ceil(a/8),h=function(t){return KJUR.crypto.Util.hashHex(t,e)};if(-1===n||void 0===n)n=s;else if(-2===n)n=o-s-2;else if(-2>n)throw"invalid salt length";if(s+n+2>o)throw"data too long";var u="";n>0&&(u=new Array(n),(new SecureRandom).nextBytes(u),u=String.fromCharCode.apply(String,u));var c=hextorstr(h(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+r+u))),f=[];for(i=0;o-n-s-2>i;i+=1)f[i]=0;var g=String.fromCharCode.apply(String,f)+""+u,l=pss_mgf1_str(c,g.length,h),d=[];for(i=0;i<g.length;i+=1)d[i]=g.charCodeAt(i)^l.charCodeAt(i);var p=65280>>8*o-a&255;for(d[0]&=~p,i=0;s>i;i++)d.push(c.charCodeAt(i));return d.push(188),_zeroPaddingOfSignature(this.doPrivate(new BigInteger(d)).toString(16),this.n.bitLength())}function _rsasign_getDecryptSignatureBI(t,e,n){var i=new RSAKey;i.setPublic(e,n);var r=i.doPublic(t);return r}function _rsasign_getHexDigestInfoFromSig(t,e,n){var i=_rsasign_getDecryptSignatureBI(t,e,n),r=i.toString(16).replace(/^1f+00/,"");return r}function _rsasign_getAlgNameAndHashFromHexDisgestInfo(t){for(var e in KJUR.crypto.Util.DIGESTINFOHEAD){var n=KJUR.crypto.Util.DIGESTINFOHEAD[e],i=n.length;if(t.substring(0,i)==n){var r=[e,t.substring(i)];return r}}return[]}function _rsasign_verifySignatureWithArgs(t,e,n,i){var r=_rsasign_getHexDigestInfoFromSig(e,n,i),s=_rsasign_getAlgNameAndHashFromHexDisgestInfo(r);if(0==s.length)return!1;var a=s[0],o=s[1],h=function(t){return KJUR.crypto.Util.hashString(t,a)},u=h(t);return o==u}function _rsasign_verifyHexSignatureForMessage(t,e){var n=parseBigInt(t,16),i=_rsasign_verifySignatureWithArgs(e,n,this.n.toString(16),this.e.toString(16));return i}function _rsasign_verifyString(t,e){e=e.replace(_RE_HEXDECONLY,""),e=e.replace(/[ \n]+/g,"");var n=parseBigInt(e,16);if(n.bitLength()>this.n.bitLength())return 0;var i=this.doPublic(n),r=i.toString(16).replace(/^1f+00/,""),s=_rsasign_getAlgNameAndHashFromHexDisgestInfo(r);if(0==s.length)return!1;var a=s[0],o=s[1],h=function(t){return KJUR.crypto.Util.hashString(t,a)},u=h(t);return o==u}function _rsasign_verifyWithMessageHash(t,e){e=e.replace(_RE_HEXDECONLY,""),e=e.replace(/[ \n]+/g,"");var n=parseBigInt(e,16);if(n.bitLength()>this.n.bitLength())return 0;var i=this.doPublic(n),r=i.toString(16).replace(/^1f+00/,""),s=_rsasign_getAlgNameAndHashFromHexDisgestInfo(r);if(0==s.length)return!1;var a=(s[0],s[1]);return a==t}function _rsasign_verifyStringPSS(t,e,n,i){var r=function(t){return KJUR.crypto.Util.hashHex(t,n)},s=r(rstrtohex(t));return void 0===i&&(i=-1),this.verifyWithMessageHashPSS(s,e,n,i)}function _rsasign_verifyWithMessageHashPSS(t,e,n,i){var r=new BigInteger(e,16);if(r.bitLength()>this.n.bitLength())return!1;var s,a=function(t){return KJUR.crypto.Util.hashHex(t,n)},o=hextorstr(t),h=o.length,u=this.n.bitLength()-1,c=Math.ceil(u/8);if(-1===i||void 0===i)i=h;else if(-2===i)i=c-h-2;else if(-2>i)throw"invalid salt length";if(h+i+2>c)throw"data too long";var f=this.doPublic(r).toByteArray();for(s=0;s<f.length;s+=1)f[s]&=255;for(;f.length<c;)f.unshift(0);if(188!==f[c-1])throw"encoded message does not end in 0xbc";f=String.fromCharCode.apply(String,f);var g=f.substr(0,c-h-1),l=f.substr(g.length,h),d=65280>>8*c-u&255;if(0!==(g.charCodeAt(0)&d))throw"bits beyond keysize not zero";var p=pss_mgf1_str(l,g.length,a),y=[];for(s=0;s<g.length;s+=1)y[s]=g.charCodeAt(s)^p.charCodeAt(s);y[0]&=~d;var S=c-h-i-2;for(s=0;S>s;s+=1)if(0!==y[s])throw"leftmost octets not zero";if(1!==y[S])throw"0x01 marker not found";return l===hextorstr(a(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+o+String.fromCharCode.apply(String,y.slice(-i)))))}function X509(){this.subjectPublicKeyRSA=null,this.subjectPublicKeyRSA_hN=null,this.subjectPublicKeyRSA_hE=null,this.hex=null,this.getSerialNumberHex=function(){return ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,1])},this.getIssuerHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3])},this.getIssuerString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3]))},this.getSubjectHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5])},this.getSubjectString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5]))},this.getNotBefore=function(){var t=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,0]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,1]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.readCertPEM=function(t){var e=X509.pemToHex(t),n=X509.getPublicKeyHexArrayFromCertHex(e),i=new RSAKey;i.setPublic(n[0],n[1]),this.subjectPublicKeyRSA=i,this.subjectPublicKeyRSA_hN=n[0],this.subjectPublicKeyRSA_hE=n[1],this.hex=e},this.readCertPEMWithoutRSAInit=function(t){var e=X509.pemToHex(t),n=X509.getPublicKeyHexArrayFromCertHex(e);this.subjectPublicKeyRSA.setPublic(n[0],n[1]),this.subjectPublicKeyRSA_hN=n[0],this.subjectPublicKeyRSA_hE=n[1],this.hex=e}}function readFileUTF8(t){return require("fs").readFileSync(t,"utf8")}function readFileHexByBin(t){var e=require("jsrsasign"),n=require("fs");return e.rstrtohex(n.readFileSync(t,"binary"))}function readFile(t){var e=require("fs");return e.readFileSync(t,"binary")}function saveFile(t,e){var n=require("fs");n.writeFileSync(t,e,"binary")}function saveFileBinByHex(t,e){var n=require("fs"),i=require("jsrsasign"),r=i.hextorstr(e);n.writeFileSync(t,r,"binary")}var navigator={};navigator.userAgent=!1;var window={};if("undefined"==typeof YAHOO||!YAHOO)var YAHOO={};YAHOO.namespace=function(){var t,e,n,i=arguments,r=null;for(t=0;t<i.length;t+=1)for(n=(""+i[t]).split("."),r=YAHOO,e="YAHOO"==n[0]?1:0;e<n.length;e+=1)r[n[e]]=r[n[e]]||{},r=r[n[e]];return r},YAHOO.log=function(t,e,n){var i=YAHOO.widget.Logger;return i&&i.log?i.log(t,e,n):!1},YAHOO.register=function(t,e,n){var i,r,s,a,o,h=YAHOO.env.modules;for(h[t]||(h[t]={versions:[],builds:[]}),i=h[t],r=n.version,s=n.build,a=YAHOO.env.listeners,i.name=t,i.version=r,i.build=s,i.versions.push(r),i.builds.push(s),i.mainClass=e,o=0;o<a.length;o+=1)a[o](i);e?(e.VERSION=r,e.BUILD=s):YAHOO.log("mainClass is undefined for module "+t,"warn")},YAHOO.env=YAHOO.env||{modules:[],listeners:[]},YAHOO.env.getVersion=function(t){return YAHOO.env.modules[t]||null},YAHOO.env.parseUA=function(t){var e,n=function(t){var e=0;return parseFloat(t.replace(/\./g,function(){return 1==e++?"":"."}))},i=navigator,r={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null},s=t||navigator&&navigator.userAgent,a=window&&window.location,o=a&&a.href;return r.secure=o&&0===o.toLowerCase().indexOf("https"),s&&(/windows|win32/i.test(s)?r.os="windows":/macintosh/i.test(s)?r.os="macintosh":/rhino/i.test(s)&&(r.os="rhino"),/KHTML/.test(s)&&(r.webkit=1),e=s.match(/AppleWebKit\/([^\s]*)/),e&&e[1]&&(r.webkit=n(e[1]),/ Mobile\//.test(s)?(r.mobile="Apple",e=s.match(/OS ([^\s]*)/),e&&e[1]&&(e=n(e[1].replace("_","."))),r.ios=e,r.ipad=r.ipod=r.iphone=0,e=s.match(/iPad|iPod|iPhone/),e&&e[0]&&(r[e[0].toLowerCase()]=r.ios)):(e=s.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/),e&&(r.mobile=e[0]),/webOS/.test(s)&&(r.mobile="WebOS",e=s.match(/webOS\/([^\s]*);/),e&&e[1]&&(r.webos=n(e[1]))),/ Android/.test(s)&&(r.mobile="Android",e=s.match(/Android ([^\s]*);/),e&&e[1]&&(r.android=n(e[1])))),e=s.match(/Chrome\/([^\s]*)/),e&&e[1]?r.chrome=n(e[1]):(e=s.match(/AdobeAIR\/([^\s]*)/),e&&(r.air=e[0]))),r.webkit||(e=s.match(/Opera[\s\/]([^\s]*)/),e&&e[1]?(r.opera=n(e[1]),e=s.match(/Version\/([^\s]*)/),e&&e[1]&&(r.opera=n(e[1])),e=s.match(/Opera Mini[^;]*/),e&&(r.mobile=e[0])):(e=s.match(/MSIE\s([^;]*)/),e&&e[1]?r.ie=n(e[1]):(e=s.match(/Gecko\/([^\s]*)/),e&&(r.gecko=1,e=s.match(/rv:([^\s\)]*)/),e&&e[1]&&(r.gecko=n(e[1]))))))),r},YAHOO.env.ua=YAHOO.env.parseUA(),function(){if(YAHOO.namespace("util","widget","example"),"undefined"!=typeof YAHOO_config){var t,e=YAHOO_config.listener,n=YAHOO.env.listeners,i=!0;if(e){for(t=0;t<n.length;t++)if(n[t]==e){i=!1;break}i&&n.push(e)}}}(),YAHOO.lang=YAHOO.lang||{},function(){var t=YAHOO.lang,e=Object.prototype,n="[object Array]",i="[object Function]",r="[object Object]",s=[],a={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"},o=["toString","valueOf"],h={isArray:function(t){return e.toString.apply(t)===n},isBoolean:function(t){return"boolean"==typeof t},isFunction:function(t){return"function"==typeof t||e.toString.apply(t)===i},isNull:function(t){return null===t},isNumber:function(t){return"number"==typeof t&&isFinite(t)},isObject:function(e){return e&&("object"==typeof e||t.isFunction(e))||!1},isString:function(t){return"string"==typeof t},isUndefined:function(t){return"undefined"==typeof t},_IEEnumFix:YAHOO.env.ua.ie?function(n,i){var r,s,a;for(r=0;r<o.length;r+=1)s=o[r],a=i[s],t.isFunction(a)&&a!=e[s]&&(n[s]=a)}:function(){},escapeHTML:function(t){return t.replace(/[&<>"'\/`]/g,function(t){return a[t]})},extend:function(n,i,r){if(!i||!n)throw new Error("extend failed, please check that all dependencies are included.");var s,a=function(){};if(a.prototype=i.prototype,n.prototype=new a,n.prototype.constructor=n,n.superclass=i.prototype,i.prototype.constructor==e.constructor&&(i.prototype.constructor=i),r){for(s in r)t.hasOwnProperty(r,s)&&(n.prototype[s]=r[s]);t._IEEnumFix(n.prototype,r)}},augmentObject:function(e,n){if(!n||!e)throw new Error("Absorb failed, verify dependencies.");var i,r,s=arguments,a=s[2];if(a&&a!==!0)for(i=2;i<s.length;i+=1)e[s[i]]=n[s[i]];else{for(r in n)!a&&r in e||(e[r]=n[r]);t._IEEnumFix(e,n)}return e},augmentProto:function(e,n){if(!n||!e)throw new Error("Augment failed, verify dependencies.");var i,r=[e.prototype,n.prototype];for(i=2;i<arguments.length;i+=1)r.push(arguments[i]);return t.augmentObject.apply(this,r),e},dump:function(e,n){var i,r,s=[],a="{...}",o="f(){...}",h=", ",u=" => ";if(!t.isObject(e))return e+"";if(e instanceof Date||"nodeType"in e&&"tagName"in e)return e;if(t.isFunction(e))return o;if(n=t.isNumber(n)?n:3,t.isArray(e)){for(s.push("["),i=0,r=e.length;r>i;i+=1)t.isObject(e[i])?s.push(n>0?t.dump(e[i],n-1):a):s.push(e[i]),s.push(h);s.length>1&&s.pop(),s.push("]")}else{s.push("{");for(i in e)t.hasOwnProperty(e,i)&&(s.push(i+u),t.isObject(e[i])?s.push(n>0?t.dump(e[i],n-1):a):s.push(e[i]),s.push(h));s.length>1&&s.pop(),s.push("}")}return s.join("")},substitute:function(e,n,i,s){for(var a,o,h,u,c,f,g,l,d,p=[],y=e.length,S="dump",A=" ",v="{",m="}";(a=e.lastIndexOf(v,y),!(0>a))&&(o=e.indexOf(m,a),!(a+1>o));)g=e.substring(a+1,o),u=g,f=null,h=u.indexOf(A),h>-1&&(f=u.substring(h+1),u=u.substring(0,h)),c=n[u],i&&(c=i(u,c,f)),t.isObject(c)?t.isArray(c)?c=t.dump(c,parseInt(f,10)):(f=f||"",l=f.indexOf(S),l>-1&&(f=f.substring(4)),d=c.toString(),c=d===r||l>-1?t.dump(c,parseInt(f,10)):d):t.isString(c)||t.isNumber(c)||(c="~-"+p.length+"-~",p[p.length]=g),e=e.substring(0,a)+c+e.substring(o+1),s===!1&&(y=a-1);for(a=p.length-1;a>=0;a-=1)e=e.replace(new RegExp("~-"+a+"-~"),"{"+p[a]+"}","g");return e},trim:function(t){try{return t.replace(/^\s+|\s+$/g,"")}catch(e){return t}},merge:function(){var e,n={},i=arguments,r=i.length;for(e=0;r>e;e+=1)t.augmentObject(n,i[e],!0);return n},later:function(e,n,i,r,a){e=e||0,n=n||{};var o,h,u=i,c=r;if(t.isString(i)&&(u=n[i]),!u)throw new TypeError("method undefined");return t.isUndefined(r)||t.isArray(c)||(c=[r]),o=function(){u.apply(n,c||s)},h=a?setInterval(o,e):setTimeout(o,e),{interval:a,cancel:function(){this.interval?clearInterval(h):clearTimeout(h)}}},isValue:function(e){return t.isObject(e)||t.isString(e)||t.isNumber(e)||t.isBoolean(e)}};t.hasOwnProperty=e.hasOwnProperty?function(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}:function(e,n){return!t.isUndefined(e[n])&&e.constructor.prototype[n]!==e[n]},h.augmentObject(t,h,!0),YAHOO.util.Lang=t,t.augment=t.augmentProto,YAHOO.augment=t.augmentProto,YAHOO.extend=t.extend}(),YAHOO.register("yahoo",YAHOO,{version:"2.9.0",build:"2800"});var CryptoJS=CryptoJS||function(t,e){var n={},i=n.lib={},r=i.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var n=new t;return e&&n.mixIn(e),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=i.WordArray=r.extend({init:function(t,n){t=this.words=t||[],n!=e?this.sigBytes=n:this.sigBytes=4*t.length},toString:function(t){return(t||o).stringify(this)},concat:function(t){var e=this.words,n=t.words,i=this.sigBytes,r=t.sigBytes;if(this.clamp(),i%4)for(var s=0;r>s;s++){var a=n[s>>>2]>>>24-s%4*8&255;e[i+s>>>2]|=a<<24-(i+s)%4*8}else for(var s=0;r>s;s+=4)e[i+s>>>2]=n[s>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=r.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n=[],i=0;e>i;i+=4)n.push(4294967296*t.random()|0);return new s.init(n,e)}}),a=n.enc={},o=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;n>r;r++){var s=e[r>>>2]>>>24-r%4*8&255;i.push((s>>>4).toString(16)),i.push((15&s).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;e>i;i+=2)n[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new s.init(n,e/2)}},h=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;n>r;r++){var s=e[r>>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(s))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;e>i;i++)n[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new s.init(n,e)}},u=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},c=i.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,i=n.words,r=n.sigBytes,a=this.blockSize,o=4*a,h=r/o;h=e?t.ceil(h):t.max((0|h)-this._minBufferSize,0);var u=h*a,c=t.min(4*u,r);if(u){for(var f=0;u>f;f+=a)this._doProcessBlock(i,f);var g=i.splice(0,u);n.sigBytes-=c}return new s.init(g,c)},clone:function(){var t=r.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),f=(i.Hasher=c.extend({cfg:r.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new f.HMAC.init(t,n).finalize(e)}}}),n.algo={});return n}(Math);!function(t){var e=CryptoJS,n=e.lib,i=n.Base,r=n.WordArray,e=e.x64={};e.Word=i.extend({init:function(t,e){this.high=t,this.low=e}}),e.WordArray=i.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:8*e.length},toX32:function(){for(var t=this.words,e=t.length,n=[],i=0;e>i;i++){var s=t[i];n.push(s.high),n.push(s.low)}return r.create(n,this.sigBytes)},clone:function(){for(var t=i.clone.call(this),e=t.words=this.words.slice(0),n=e.length,r=0;n>r;r++)e[r]=e[r].clone();return t}})}(),CryptoJS.lib.Cipher||function(t){var e=CryptoJS,n=e.lib,i=n.Base,r=n.WordArray,s=n.BufferedBlockAlgorithm,a=e.enc.Base64,o=e.algo.EvpKDF,h=n.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,n,i){return("string"==typeof n?d:l).encrypt(t,e,n,i)},decrypt:function(e,n,i){return("string"==typeof n?d:l).decrypt(t,e,n,i)}}}});n.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=e.mode={},c=function(e,n,i){var r=this._iv;r?this._iv=t:r=this._prevBlock;for(var s=0;i>s;s++)e[n+s]^=r[s]},f=(n.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();f.Encryptor=f.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize;c.call(this,t,e,i),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+i)}}),f.Decryptor=f.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize,r=t.slice(e,e+i);n.decryptBlock(t,e),c.call(this,t,e,i),this._prevBlock=r}}),u=u.CBC=f,f=(e.pad={}).Pkcs7={pad:function(t,e){for(var n=4*e,n=n-t.sigBytes%n,i=n<<24|n<<16|n<<8|n,s=[],a=0;n>a;a+=4)s.push(i);n=r.create(s,n),t.concat(n)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:u,padding:f}),reset:function(){h.reset.call(this);var t=this.cfg,e=t.iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=t.createEncryptor;else n=t.createDecryptor,this._minBufferSize=1;this._mode=n.call(t,this,e&&e.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var g=n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),u=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return t=t.salt,(t?r.create([1398893684,1701076831]).concat(t).concat(e):e).toString(a)},parse:function(t){t=a.parse(t);var e=t.words;if(1398893684==e[0]&&1701076831==e[1]){var n=r.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return g.create({ciphertext:t,salt:n})}},l=n.SerializableCipher=i.extend({cfg:i.extend({format:u}),encrypt:function(t,e,n,i){i=this.cfg.extend(i);var r=t.createEncryptor(n,i);return e=r.finalize(e),r=r.cfg,g.create({ciphertext:e,key:n,iv:r.iv,algorithm:t,mode:r.mode,padding:r.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,n,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(n,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),e=(e.kdf={}).OpenSSL={execute:function(t,e,n,i){return i||(i=r.random(8)),t=o.create({keySize:e+n}).compute(t,i),n=r.create(t.words.slice(e),4*n),t.sigBytes=4*e,g.create({key:t,iv:n,salt:i})}},d=n.PasswordBasedCipher=l.extend({cfg:l.cfg.extend({kdf:e}),encrypt:function(t,e,n,i){return i=this.cfg.extend(i),n=i.kdf.execute(n,t.keySize,t.ivSize),i.iv=n.iv,t=l.encrypt.call(this,t,e,n.key,i),t.mixIn(n),t},decrypt:function(t,e,n,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),n=i.kdf.execute(n,t.keySize,t.ivSize,e.salt),i.iv=n.iv,l.decrypt.call(this,t,e,n.key,i)}})}(),function(){for(var t=CryptoJS,e=t.lib.BlockCipher,n=t.algo,i=[],r=[],s=[],a=[],o=[],h=[],u=[],c=[],f=[],g=[],l=[],d=0;256>d;d++)l[d]=128>d?d<<1:d<<1^283;for(var p=0,y=0,d=0;256>d;d++){var S=y^y<<1^y<<2^y<<3^y<<4,S=S>>>8^255&S^99;i[p]=S,r[S]=p;var A=l[p],v=l[A],m=l[v],E=257*l[S]^16843008*S;s[p]=E<<24|E>>>8,a[p]=E<<16|E>>>16,o[p]=E<<8|E>>>24,h[p]=E,E=16843009*m^65537*v^257*A^16843008*p,u[S]=E<<24|E>>>8,c[S]=E<<16|E>>>16,f[S]=E<<8|E>>>24,g[S]=E,p?(p=A^l[l[l[m^A]]],y^=l[l[y]]):p=y=1}var b=[0,1,2,4,8,16,32,64,128,27,54],n=n.AES=e.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes/4,t=4*((this._nRounds=n+6)+1),r=this._keySchedule=[],s=0;t>s;s++)if(n>s)r[s]=e[s];else{var a=r[s-1];s%n?n>6&&4==s%n&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a]):(a=a<<8|a>>>24,a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a],a^=b[s/n|0]<<24),r[s]=r[s-n]^a}for(e=this._invKeySchedule=[],n=0;t>n;n++)s=t-n,a=n%4?r[s]:r[s-4],e[n]=4>n||4>=s?a:u[i[a>>>24]]^c[i[a>>>16&255]]^f[i[a>>>8&255]]^g[i[255&a]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,o,h,i)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,u,c,f,g,r),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,i,r,s,a,o){for(var h=this._nRounds,u=t[e]^n[0],c=t[e+1]^n[1],f=t[e+2]^n[2],g=t[e+3]^n[3],l=4,d=1;h>d;d++)var p=i[u>>>24]^r[c>>>16&255]^s[f>>>8&255]^a[255&g]^n[l++],y=i[c>>>24]^r[f>>>16&255]^s[g>>>8&255]^a[255&u]^n[l++],S=i[f>>>24]^r[g>>>16&255]^s[u>>>8&255]^a[255&c]^n[l++],g=i[g>>>24]^r[u>>>16&255]^s[c>>>8&255]^a[255&f]^n[l++],u=p,c=y,f=S;p=(o[u>>>24]<<24|o[c>>>16&255]<<16|o[f>>>8&255]<<8|o[255&g])^n[l++],y=(o[c>>>24]<<24|o[f>>>16&255]<<16|o[g>>>8&255]<<8|o[255&u])^n[l++],S=(o[f>>>24]<<24|o[g>>>16&255]<<16|o[u>>>8&255]<<8|o[255&c])^n[l++],g=(o[g>>>24]<<24|o[u>>>16&255]<<16|o[c>>>8&255]<<8|o[255&f])^n[l++],t[e]=p,t[e+1]=y,t[e+2]=S,t[e+3]=g},keySize:8});t.AES=e._createHelper(n)}(),function(){function t(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<<t}function e(t,e){var n=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<<t}var n=CryptoJS,i=n.lib,r=i.WordArray,i=i.BlockCipher,s=n.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=s.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;56>n;n++){var i=a[n]-1;e[n]=t[i>>>5]>>>31-i%32&1}for(t=this._subKeys=[],i=0;16>i;i++){for(var r=t[i]=[],s=h[i],n=0;24>n;n++)r[n/6|0]|=e[(o[n]-1+s)%28]<<31-n%6,r[4+(n/6|0)]|=e[28+(o[n+24]-1+s)%28]<<31-n%6;for(r[0]=r[0]<<1|r[0]>>>31,n=1;7>n;n++)r[n]>>>=4*(n-1)+3;r[7]=r[7]<<5|r[7]>>>27}for(e=this._invSubKeys=[],n=0;16>n;n++)e[n]=t[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(n,i,r){this._lBlock=n[i],this._rBlock=n[i+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;16>s;s++){for(var a=r[s],o=this._lBlock,h=this._rBlock,f=0,g=0;8>g;g++)f|=u[g][((h^a[g])&c[g])>>>0];
this._lBlock=h,this._rBlock=o^f}r=this._lBlock,this._lBlock=this._rBlock,this._rBlock=r,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),n[i]=this._lBlock,n[i+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=i._createHelper(f),s=s.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=f.createEncryptor(r.create(t.slice(0,2))),this._des2=f.createEncryptor(r.create(t.slice(2,4))),this._des3=f.createEncryptor(r.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),n.TripleDES=i._createHelper(s)}(),function(){var t=CryptoJS,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,i=this._map;t.clamp(),t=[];for(var r=0;n>r;r+=3)for(var s=(e[r>>>2]>>>24-8*(r%4)&255)<<16|(e[r+1>>>2]>>>24-8*((r+1)%4)&255)<<8|e[r+2>>>2]>>>24-8*((r+2)%4)&255,a=0;4>a&&n>r+.75*a;a++)t.push(i.charAt(s>>>6*(3-a)&63));if(e=i.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var n=t.length,i=this._map,r=i.charAt(64);r&&(r=t.indexOf(r),-1!=r&&(n=r));for(var r=[],s=0,a=0;n>a;a++)if(a%4){var o=i.indexOf(t.charAt(a-1))<<2*(a%4),h=i.indexOf(t.charAt(a))>>>6-2*(a%4);r[s>>>2]|=(o|h)<<24-8*(s%4),s++}return e.create(r,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,n,i,r,s,a){return t=t+(e&n|~e&i)+r+a,(t<<s|t>>>32-s)+e}function n(t,e,n,i,r,s,a){return t=t+(e&i|n&~i)+r+a,(t<<s|t>>>32-s)+e}function i(t,e,n,i,r,s,a){return t=t+(e^n^i)+r+a,(t<<s|t>>>32-s)+e}function r(t,e,n,i,r,s,a){return t=t+(n^(e|~i))+r+a,(t<<s|t>>>32-s)+e}for(var s=CryptoJS,a=s.lib,o=a.WordArray,h=a.Hasher,a=s.algo,u=[],c=0;64>c;c++)u[c]=4294967296*t.abs(t.sin(c+1))|0;a=a.MD5=h.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,s){for(var a=0;16>a;a++){var o=s+a,h=t[o];t[o]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}var a=this._hash.words,o=t[s+0],h=t[s+1],c=t[s+2],f=t[s+3],g=t[s+4],l=t[s+5],d=t[s+6],p=t[s+7],y=t[s+8],S=t[s+9],A=t[s+10],v=t[s+11],m=t[s+12],E=t[s+13],b=t[s+14],F=t[s+15],R=a[0],x=a[1],K=a[2],H=a[3],R=e(R,x,K,H,o,7,u[0]),H=e(H,R,x,K,h,12,u[1]),K=e(K,H,R,x,c,17,u[2]),x=e(x,K,H,R,f,22,u[3]),R=e(R,x,K,H,g,7,u[4]),H=e(H,R,x,K,l,12,u[5]),K=e(K,H,R,x,d,17,u[6]),x=e(x,K,H,R,p,22,u[7]),R=e(R,x,K,H,y,7,u[8]),H=e(H,R,x,K,S,12,u[9]),K=e(K,H,R,x,A,17,u[10]),x=e(x,K,H,R,v,22,u[11]),R=e(R,x,K,H,m,7,u[12]),H=e(H,R,x,K,E,12,u[13]),K=e(K,H,R,x,b,17,u[14]),x=e(x,K,H,R,F,22,u[15]),R=n(R,x,K,H,h,5,u[16]),H=n(H,R,x,K,d,9,u[17]),K=n(K,H,R,x,v,14,u[18]),x=n(x,K,H,R,o,20,u[19]),R=n(R,x,K,H,l,5,u[20]),H=n(H,R,x,K,A,9,u[21]),K=n(K,H,R,x,F,14,u[22]),x=n(x,K,H,R,g,20,u[23]),R=n(R,x,K,H,S,5,u[24]),H=n(H,R,x,K,b,9,u[25]),K=n(K,H,R,x,f,14,u[26]),x=n(x,K,H,R,y,20,u[27]),R=n(R,x,K,H,E,5,u[28]),H=n(H,R,x,K,c,9,u[29]),K=n(K,H,R,x,p,14,u[30]),x=n(x,K,H,R,m,20,u[31]),R=i(R,x,K,H,l,4,u[32]),H=i(H,R,x,K,y,11,u[33]),K=i(K,H,R,x,v,16,u[34]),x=i(x,K,H,R,b,23,u[35]),R=i(R,x,K,H,h,4,u[36]),H=i(H,R,x,K,g,11,u[37]),K=i(K,H,R,x,p,16,u[38]),x=i(x,K,H,R,A,23,u[39]),R=i(R,x,K,H,E,4,u[40]),H=i(H,R,x,K,o,11,u[41]),K=i(K,H,R,x,f,16,u[42]),x=i(x,K,H,R,d,23,u[43]),R=i(R,x,K,H,S,4,u[44]),H=i(H,R,x,K,m,11,u[45]),K=i(K,H,R,x,F,16,u[46]),x=i(x,K,H,R,c,23,u[47]),R=r(R,x,K,H,o,6,u[48]),H=r(H,R,x,K,p,10,u[49]),K=r(K,H,R,x,b,15,u[50]),x=r(x,K,H,R,l,21,u[51]),R=r(R,x,K,H,m,6,u[52]),H=r(H,R,x,K,f,10,u[53]),K=r(K,H,R,x,A,15,u[54]),x=r(x,K,H,R,h,21,u[55]),R=r(R,x,K,H,y,6,u[56]),H=r(H,R,x,K,F,10,u[57]),K=r(K,H,R,x,d,15,u[58]),x=r(x,K,H,R,E,21,u[59]),R=r(R,x,K,H,g,6,u[60]),H=r(H,R,x,K,v,10,u[61]),K=r(K,H,R,x,c,15,u[62]),x=r(x,K,H,R,S,21,u[63]);a[0]=a[0]+R|0,a[1]=a[1]+x|0,a[2]=a[2]+K|0,a[3]=a[3]+H|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;n[r>>>5]|=128<<24-r%32;var s=t.floor(i/4294967296);for(n[(r+64>>>9<<4)+15]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[(r+64>>>9<<4)+14]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(n.length+1),this._process(),e=this._hash,n=e.words,i=0;4>i;i++)r=n[i],n[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return e},clone:function(){var t=h.clone.call(this);return t._hash=this._hash.clone(),t}}),s.MD5=h._createHelper(a),s.HmacMD5=h._createHmacHelper(a)}(Math),function(){var t=CryptoJS,e=t.lib,n=e.WordArray,i=e.Hasher,r=[],e=t.algo.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],s=n[1],a=n[2],o=n[3],h=n[4],u=0;80>u;u++){if(16>u)r[u]=0|t[e+u];else{var c=r[u-3]^r[u-8]^r[u-14]^r[u-16];r[u]=c<<1|c>>>31}c=(i<<5|i>>>27)+h+r[u],c=20>u?c+((s&a|~s&o)+1518500249):40>u?c+((s^a^o)+1859775393):60>u?c+((s&a|s&o|a&o)-1894007588):c+((s^a^o)-899497514),h=o,o=a,a=s<<30|s>>>2,s=i,i=c}n[0]=n[0]+i|0,n[1]=n[1]+s|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+h|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[(i+64>>>9<<4)+14]=Math.floor(n/4294967296),e[(i+64>>>9<<4)+15]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=i._createHelper(e),t.HmacSHA1=i._createHmacHelper(e)}(),function(t){for(var e=CryptoJS,n=e.lib,i=n.WordArray,r=n.Hasher,n=e.algo,s=[],a=[],o=function(t){return 4294967296*(t-(0|t))|0},h=2,u=0;64>u;){var c;t:{c=h;for(var f=t.sqrt(c),g=2;f>=g;g++)if(!(c%g)){c=!1;break t}c=!0}c&&(8>u&&(s[u]=o(t.pow(h,.5))),a[u]=o(t.pow(h,1/3)),u++),h++}var l=[],n=n.SHA256=r.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],s=n[2],o=n[3],h=n[4],u=n[5],c=n[6],f=n[7],g=0;64>g;g++){if(16>g)l[g]=0|t[e+g];else{var d=l[g-15],p=l[g-2];l[g]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+l[g-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+l[g-16]}d=f+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&u^~h&c)+a[g]+l[g],p=((i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22))+(i&r^i&s^r&s),f=c,c=u,u=h,h=o+d|0,o=s,s=r,r=i,i=d+p|0}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+h|0,n[5]=n[5]+u|0,n[6]=n[6]+c|0,n[7]=n[7]+f|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;return n[r>>>5]|=128<<24-r%32,n[(r+64>>>9<<4)+14]=t.floor(i/4294967296),n[(r+64>>>9<<4)+15]=i,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(n),e.HmacSHA256=r._createHmacHelper(n)}(Math),function(){var t=CryptoJS,e=t.lib.WordArray,n=t.algo,i=n.SHA256,n=n.SHA224=i.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=i._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=i._createHelper(n),t.HmacSHA224=i._createHmacHelper(n)}(),function(){function t(){return r.create.apply(r,arguments)}for(var e=CryptoJS,n=e.lib.Hasher,i=e.x64,r=i.Word,s=i.WordArray,i=e.algo,a=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],o=[],h=0;80>h;h++)o[h]=t();i=i.SHA512=n.extend({_doReset:function(){this._hash=new s.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],s=n[2],h=n[3],u=n[4],c=n[5],f=n[6],n=n[7],g=i.high,l=i.low,d=r.high,p=r.low,y=s.high,S=s.low,A=h.high,v=h.low,m=u.high,E=u.low,b=c.high,F=c.low,R=f.high,x=f.low,K=n.high,H=n.low,w=g,O=l,C=d,U=p,I=y,P=S,J=A,B=v,D=m,N=E,T=b,j=F,_=R,V=x,L=K,M=H,k=0;80>k;k++){var X=o[k];if(16>k)var q=X.high=0|t[e+2*k],Y=X.low=0|t[e+2*k+1];else{var q=o[k-15],Y=q.high,z=q.low,q=(Y>>>1|z<<31)^(Y>>>8|z<<24)^Y>>>7,z=(z>>>1|Y<<31)^(z>>>8|Y<<24)^(z>>>7|Y<<25),W=o[k-2],Y=W.high,G=W.low,W=(Y>>>19|G<<13)^(Y<<3|G>>>29)^Y>>>6,G=(G>>>19|Y<<13)^(G<<3|Y>>>29)^(G>>>6|Y<<26),Y=o[k-7],$=Y.high,Z=o[k-16],Q=Z.high,Z=Z.low,Y=z+Y.low,q=q+$+(z>>>0>Y>>>0?1:0),Y=Y+G,q=q+W+(G>>>0>Y>>>0?1:0),Y=Y+Z,q=q+Q+(Z>>>0>Y>>>0?1:0);X.high=q,X.low=Y}var $=D&T^~D&_,Z=N&j^~N&V,X=w&C^w&I^C&I,tt=O&U^O&P^U&P,z=(w>>>28|O<<4)^(w<<30|O>>>2)^(w<<25|O>>>7),W=(O>>>28|w<<4)^(O<<30|w>>>2)^(O<<25|w>>>7),G=a[k],et=G.high,nt=G.low,G=M+((N>>>14|D<<18)^(N>>>18|D<<14)^(N<<23|D>>>9)),Q=L+((D>>>14|N<<18)^(D>>>18|N<<14)^(D<<23|N>>>9))+(M>>>0>G>>>0?1:0),G=G+Z,Q=Q+$+(Z>>>0>G>>>0?1:0),G=G+nt,Q=Q+et+(nt>>>0>G>>>0?1:0),G=G+Y,Q=Q+q+(Y>>>0>G>>>0?1:0),Y=W+tt,X=z+X+(W>>>0>Y>>>0?1:0),L=_,M=V,_=T,V=j,T=D,j=N,N=B+G|0,D=J+Q+(B>>>0>N>>>0?1:0)|0,J=I,B=P,I=C,P=U,C=w,U=O,O=G+Y|0,w=Q+X+(G>>>0>O>>>0?1:0)|0}l=i.low=l+O,i.high=g+w+(O>>>0>l>>>0?1:0),p=r.low=p+U,r.high=d+C+(U>>>0>p>>>0?1:0),S=s.low=S+P,s.high=y+I+(P>>>0>S>>>0?1:0),v=h.low=v+B,h.high=A+J+(B>>>0>v>>>0?1:0),E=u.low=E+N,u.high=m+D+(N>>>0>E>>>0?1:0),F=c.low=F+j,c.high=b+T+(j>>>0>F>>>0?1:0),x=f.low=x+V,f.high=R+_+(V>>>0>x>>>0?1:0),H=n.low=H+M,n.high=K+L+(M>>>0>H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[(i+128>>>10<<5)+30]=Math.floor(n/4294967296),e[(i+128>>>10<<5)+31]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=n._createHelper(i),e.HmacSHA512=n._createHmacHelper(i)}(),function(){var t=CryptoJS,e=t.x64,n=e.Word,i=e.WordArray,e=t.algo,r=e.SHA512,e=e.SHA384=r.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=r._createHelper(e),t.HmacSHA384=r._createHmacHelper(e)}(),function(){var t=CryptoJS,e=t.lib,n=e.WordArray,i=e.Hasher,e=t.algo,r=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),o=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=n.create([0,1518500249,1859775393,2400959708,2840853838]),u=n.create([1352829926,1548603684,1836072691,2053994217,0]),e=e.RIPEMD160=i.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;16>n;n++){var i=e+n,c=t[i];t[i]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var f,g,l,d,p,y,S,A,v,m,i=this._hash.words,c=h.words,E=u.words,b=r.words,F=s.words,R=a.words,x=o.words;y=f=i[0],S=g=i[1],A=l=i[2],v=d=i[3],m=p=i[4];for(var K,n=0;80>n;n+=1)K=f+t[e+b[n]]|0,K=16>n?K+((g^l^d)+c[0]):32>n?K+((g&l|~g&d)+c[1]):48>n?K+(((g|~l)^d)+c[2]):64>n?K+((g&d|l&~d)+c[3]):K+((g^(l|~d))+c[4]),K|=0,K=K<<R[n]|K>>>32-R[n],K=K+p|0,f=p,p=d,d=l<<10|l>>>22,l=g,g=K,K=y+t[e+F[n]]|0,K=16>n?K+((S^(A|~v))+E[0]):32>n?K+((S&v|A&~v)+E[1]):48>n?K+(((S|~A)^v)+E[2]):64>n?K+((S&A|~S&v)+E[3]):K+((S^A^v)+E[4]),K|=0,K=K<<x[n]|K>>>32-x[n],K=K+m|0,y=m,m=v,v=A<<10|A>>>22,A=S,S=K;K=i[1]+l+v|0,i[1]=i[2]+d+m|0,i[2]=i[3]+p+y|0,i[3]=i[4]+f+S|0,i[4]=i[0]+g+A|0,i[0]=K},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;for(e[i>>>5]|=128<<24-i%32,e[(i+64>>>9<<4)+14]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process(),t=this._hash,e=t.words,n=0;5>n;n++)i=e[n],e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=i._createHelper(e),t.HmacRIPEMD160=i._createHmacHelper(e)}(Math),function(){var t=CryptoJS,e=t.enc.Utf8;t.algo.HMAC=t.lib.Base.extend({init:function(t,n){t=this._hasher=new t.init,"string"==typeof n&&(n=e.parse(n));var i=t.blockSize,r=4*i;n.sigBytes>r&&(n=t.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),a=this._iKey=n.clone(),o=s.words,h=a.words,u=0;i>u;u++)o[u]^=1549556828,h[u]^=909522486;s.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}})}(),function(){var t=CryptoJS,e=t.lib,n=e.Base,i=e.WordArray,e=t.algo,r=e.HMAC,s=e.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:e.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,s=r.create(n.hasher,t),a=i.create(),o=i.create([1]),h=a.words,u=o.words,c=n.keySize,n=n.iterations;h.length<c;){var f=s.update(e).finalize(o);s.reset();for(var g=f.words,l=g.length,d=f,p=1;n>p;p++){d=s.finalize(d),s.reset();for(var y=d.words,S=0;l>S;S++)g[S]^=y[S]}a.concat(f),u[0]++}return a.sigBytes=4*c,a}});t.PBKDF2=function(t,e,n){return s.create(n).compute(t,e)}}();var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64pad="=",dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;9>=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next;var rng_psize=256,rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new Array,rng_pptr=0;var t;if(window.crypto&&window.crypto.getRandomValues){var ua=new Uint8Array(32);for(window.crypto.getRandomValues(ua),t=0;32>t;++t)rng_pool[rng_pptr++]=ua[t]}if("Netscape"==navigator.appName&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=255&z.charCodeAt(t)}for(;rng_psize>rng_pptr;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=255&t;rng_pptr=0,rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes;var SHA1_SIZE=20;RSAKey.prototype.doPublic=RSADoPublic,RSAKey.prototype.setPublic=RSASetPublic,RSAKey.prototype.encrypt=RSAEncrypt,RSAKey.prototype.encryptOAEP=RSAEncryptOAEP,RSAKey.prototype.type="RSA";var SHA1_SIZE=20;RSAKey.prototype.doPrivate=RSADoPrivate,RSAKey.prototype.setPrivate=RSASetPrivate,RSAKey.prototype.setPrivateEx=RSASetPrivateEx,RSAKey.prototype.generate=RSAGenerate,RSAKey.prototype.decrypt=RSADecrypt,RSAKey.prototype.decryptOAEP=RSADecryptOAEP,ECFieldElementFp.prototype.equals=feFpEquals,ECFieldElementFp.prototype.toBigInteger=feFpToBigInteger,ECFieldElementFp.prototype.negate=feFpNegate,ECFieldElementFp.prototype.add=feFpAdd,ECFieldElementFp.prototype.subtract=feFpSubtract,ECFieldElementFp.prototype.multiply=feFpMultiply,ECFieldElementFp.prototype.square=feFpSquare,ECFieldElementFp.prototype.divide=feFpDivide,ECPointFp.prototype.getX=pointFpGetX,ECPointFp.prototype.getY=pointFpGetY,ECPointFp.prototype.equals=pointFpEquals,ECPointFp.prototype.isInfinity=pointFpIsInfinity,ECPointFp.prototype.negate=pointFpNegate,ECPointFp.prototype.add=pointFpAdd,ECPointFp.prototype.twice=pointFpTwice,ECPointFp.prototype.multiply=pointFpMultiply,ECPointFp.prototype.multiplyTwo=pointFpMultiplyTwo,ECCurveFp.prototype.getQ=curveFpGetQ,ECCurveFp.prototype.getA=curveFpGetA,ECCurveFp.prototype.getB=curveFpGetB,ECCurveFp.prototype.equals=curveFpEquals,ECCurveFp.prototype.getInfinity=curveFpGetInfinity,ECCurveFp.prototype.fromBigInteger=curveFpFromBigInteger,ECCurveFp.prototype.decodePointHex=curveFpDecodePointHex,ECFieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ECPointFp.prototype.getEncoded=function(t){var e=function(t,e){var n=t.toByteArrayUnsigned();if(e<n.length)n=n.slice(n.length-e);else for(;e>n.length;)n.unshift(0);return n},n=this.getX().toBigInteger(),i=this.getY().toBigInteger(),r=e(n,32);return t?i.isEven()?r.unshift(2):r.unshift(3):(r.unshift(4),r=r.concat(e(i,32))),r},ECPointFp.decodeFrom=function(t,e){var n=(e[0],e.length-1),i=e.slice(1,1+n/2),r=e.slice(1+n/2,1+n);i.unshift(0),r.unshift(0);var s=new BigInteger(i),a=new BigInteger(r);return new ECPointFp(t,t.fromBigInteger(s),t.fromBigInteger(a))},ECPointFp.decodeFromHex=function(t,e){var n=(e.substr(0,2),e.length-2),i=e.substr(2,n/2),r=e.substr(2+n/2,n/2),s=new BigInteger(i,16),a=new BigInteger(r,16);return new ECPointFp(t,t.fromBigInteger(s),t.fromBigInteger(a))},ECPointFp.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),n=t.y.subtract(this.y),i=n.divide(e),r=i.square().subtract(this.x).subtract(t.x),s=i.multiply(this.x.subtract(r)).subtract(this.y);return new ECPointFp(this.curve,r,s)},ECPointFp.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(BigInteger.valueOf(2)),e=this.curve.fromBigInteger(BigInteger.valueOf(3)),n=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),i=n.square().subtract(this.x.multiply(t)),r=n.multiply(this.x.subtract(i)).subtract(this.y);return new ECPointFp(this.curve,i,r)},ECPointFp.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,i=n.multiply(new BigInteger("3")),r=this.negate(),s=this;for(e=i.bitLength()-2;e>0;--e){s=s.twice();var a=i.testBit(e),o=n.testBit(e);a!=o&&(s=s.add2D(a?this:r))}return s},ECPointFp.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),n=this.curve.getA().toBigInteger(),i=this.curve.getB().toBigInteger(),r=this.curve.getQ(),s=e.multiply(e).mod(r),a=t.multiply(t).multiply(t).add(n.multiply(t)).add(i).mod(r);return s.equals(a)},ECPointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ECPointFp.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),n=this.getY().toBigInteger();if(e.compareTo(BigInteger.ONE)<0||e.compareTo(t.subtract(BigInteger.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(BigInteger.ONE)<0||n.compareTo(t.subtract(BigInteger.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var jsonParse=function(){function t(t,e,n){return e?a[e]:String.fromCharCode(parseInt(n,16))}var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)",n='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))',i='(?:"'+n+'*")',r=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+i+")","g"),s=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),a={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},o=new String(""),h="\\",u=({"{":Object,"[":Array},Object.hasOwnProperty);return function(e,n){var i,a=e.match(r),c=a[0],f=!1;"{"===c?i={}:"["===c?i=[]:(i=[],f=!0);for(var g,l=[i],d=1-f,p=a.length;p>d;++d){c=a[d];var y;switch(c.charCodeAt(0)){default:y=l[0],y[g||y.length]=+c,g=void 0;break;case 34:if(c=c.substring(1,c.length-1),-1!==c.indexOf(h)&&(c=c.replace(s,t)),y=l[0],!g){if(!(y instanceof Array)){g=c||o;break}g=y.length}y[g]=c,g=void 0;break;case 91:y=l[0],l.unshift(y[g||y.length]=[]),g=void 0;break;case 93:l.shift();break;case 102:y=l[0],y[g||y.length]=!1,g=void 0;break;case 110:y=l[0],y[g||y.length]=null,g=void 0;break;case 116:y=l[0],y[g||y.length]=!0,g=void 0;break;case 123:y=l[0],l.unshift(y[g||y.length]={}),g=void 0;break;case 125:l.shift()}}if(f){if(1!==l.length)throw new Error;i=i[0]}else if(l.length)throw new Error;if(n){var S=function(t,e){var i=t[e];if(i&&"object"==typeof i){var r=null;for(var s in i)if(u.call(i,s)&&i!==t){var a=S(i,s);void 0!==a?i[s]=a:(r||(r=[]),r.push(s))}if(r)for(var o=r.length;--o>=0;)delete i[r[o]]}return n.call(t,e,i)};i=S({"":i},"")}return i}}();"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var n=e.substr(1),i=n.length;i%2==1?i+=1:e.match(/^[0-7]/)||(i+=2);for(var r="",s=0;i>s;s++)r+="f";var a=new BigInteger(r,16),o=a.xor(t).add(BigInteger.ONE);e=o.toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){var n=(KJUR.asn1,CryptoJS.enc.Hex.parse(t)),i=CryptoJS.enc.Base64.stringify(n),r=i.replace(/(.{64})/g,"$1\r\n");return r=r.replace(/\r\n$/,""),"-----BEGIN "+e+"-----\r\n"+r+"\r\n-----END "+e+"-----\r\n"},this.newObject=function(t){var e=KJUR.asn1,n=Object.keys(t);if(1!=n.length)throw"key of param shall be only one.";var i=n[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+i+":"))throw"undefined key: "+i;if("bool"==i)return new e.DERBoolean(t[i]);if("int"==i)return new e.DERInteger(t[i]);if("bitstr"==i)return new e.DERBitString(t[i]);if("octstr"==i)return new e.DEROctetString(t[i]);if("null"==i)return new e.DERNull(t[i]);if("oid"==i)return new e.DERObjectIdentifier(t[i]);if("enum"==i)return new e.DEREnumerated(t[i]);if("utf8str"==i)return new e.DERUTF8String(t[i]);if("numstr"==i)return new e.DERNumericString(t[i]);if("prnstr"==i)return new e.DERPrintableString(t[i]);if("telstr"==i)return new e.DERTeletexString(t[i]);if("ia5str"==i)return new e.DERIA5String(t[i]);if("utctime"==i)return new e.DERUTCTime(t[i]);if("gentime"==i)return new e.DERGeneralizedTime(t[i]);if("seq"==i){for(var r=t[i],s=[],a=0;a<r.length;a++){var o=e.ASN1Util.newObject(r[a]);s.push(o)}return new e.DERSequence({array:s})}if("set"==i){for(var r=t[i],s=[],a=0;a<r.length;a++){var o=e.ASN1Util.newObject(r[a]);s.push(o)}return new e.DERSet({array:s})}if("tag"==i){var h=t[i];if("[object Array]"===Object.prototype.toString.call(h)&&3==h.length){var u=e.ASN1Util.newObject(h[2]);return new e.DERTaggedObject({tag:h[0],explicit:h[1],obj:u})}var c={};if(void 0!==h.explicit&&(c.explicit=h.explicit),void 0!==h.tag&&(c.tag=h.tag),void 0===h.obj)throw"obj shall be specified for 'tag'.";return c.obj=e.ASN1Util.newObject(h.obj),new e.DERTaggedObject(c)}},this.jsonToASN1HEX=function(t){var e=this.newObject(t);return e.getEncodedHex()}},KJUR.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",n=parseInt(t.substr(0,2),16),i=Math.floor(n/40),r=n%40,e=i+"."+r,s="",a=2;a<t.length;a+=2){var o=parseInt(t.substr(a,2),16),h=("00000000"+o.toString(2)).slice(-8);if(s+=h.substr(1,7),"0"==h.substr(0,1)){var u=new BigInteger(s,2);e=e+"."+u.toString(10),s=""}}return e},KJUR.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",i=new BigInteger(t,10),r=i.toString(2),s=7-r.length%7;7==s&&(s=0);for(var a="",o=0;s>o;o++)a+="0";r=a+r;for(var o=0;o<r.length-1;o+=7){var h=r.substr(o,7);o!=r.length-7&&(h="1"+h),n+=e(parseInt(h,2))}return n};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="",r=t.split("."),s=40*parseInt(r[0])+parseInt(r[1]);i+=e(s),r.splice(0,2);for(var a=0;a<r.length;a++)i+=n(r[a]);return i},KJUR.asn1.ASN1Object=function(){var t="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+t.length+",v="+this.hV;var e=this.hV.length/2,n=e.toString(16);if(n.length%2==1&&(n="0"+n),128>e)return n;var i=n.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);var r=128+i;return r.toString(16)+n},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s;
},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("string"==typeof t?this.setString(t):"undefined"!=typeof t.str?this.setString(t.str):"undefined"!=typeof t.hex&&this.setStringHex(t.hex))},YAHOO.lang.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(t){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e},this.formatDate=function(t,e,n){var i=this.zeroPadding,r=this.localDateToUTC(t),s=String(r.getFullYear());"utc"==e&&(s=s.substr(2,2));var a=i(String(r.getMonth()+1),2),o=i(String(r.getDate()),2),h=i(String(r.getHours()),2),u=i(String(r.getMinutes()),2),c=i(String(r.getSeconds()),2),f=s+a+o+h+u+c;if(n===!0){var g=r.getMilliseconds();if(0!=g){var l=i(String(g),3);l=l.replace(/[0]+$/,""),f=f+"."+l}}return f+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,n,i,r,s){var a=new Date(Date.UTC(t,e-1,n,i,r,s,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},YAHOO.lang.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,"undefined"!=typeof t&&"undefined"!=typeof t.array&&(this.asn1Array=t.array)},YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(t){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new BigInteger(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t.bigint?this.setByBigInteger(t.bigint):"undefined"!=typeof t["int"]?this.setByInteger(t["int"]):"number"==typeof t?this.setByInteger(t):"undefined"!=typeof t.hex&&this.setValueHex(t.hex))},YAHOO.lang.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(t){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(0>t||t>7)throw"unused bits shall be from 0 to 7: u = "+t;var n="0"+t;this.hTLV=null,this.isModified=!0,this.hV=n+e},this.setByBinaryString=function(t){t=t.replace(/0+$/,"");var e=8-t.length%8;8==e&&(e=0);for(var n=0;e>=n;n++)t+="0";for(var i="",n=0;n<t.length-1;n+=8){var r=t.substr(n,8),s=parseInt(r,2).toString(16);1==s.length&&(s="0"+s),i+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+e+i},this.setByBooleanArray=function(t){for(var e="",n=0;n<t.length;n++)e+=1==t[n]?"1":"0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),n=0;t>n;n++)e[n]=!1;return e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):"undefined"!=typeof t.hex?this.setHexValueIncludingUnusedBits(t.hex):"undefined"!=typeof t.bin?this.setByBinaryString(t.bin):"undefined"!=typeof t.array&&this.setByBooleanArray(t.array))},YAHOO.lang.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(t){KJUR.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},YAHOO.lang.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},YAHOO.lang.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",i=new BigInteger(t,10),r=i.toString(2),s=7-r.length%7;7==s&&(s=0);for(var a="",o=0;s>o;o++)a+="0";r=a+r;for(var o=0;o<r.length-1;o+=7){var h=r.substr(o,7);o!=r.length-7&&(h="1"+h),n+=e(parseInt(h,2))}return n};KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="",r=t.split("."),s=40*parseInt(r[0])+parseInt(r[1]);i+=e(s),r.splice(0,2);for(var a=0;a<r.length;a++)i+=n(r[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=i},this.setValueName=function(t){if("undefined"==typeof KJUR.asn1.x509.OID.name2oidList[t])throw"DERObjectIdentifier oidName undefined: "+t;var e=KJUR.asn1.x509.OID.name2oidList[t];this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("string"==typeof t&&t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):void 0!==KJUR.asn1.x509.OID.name2oidList[t]?this.setValueOidString(KJUR.asn1.x509.OID.name2oidList[t]):"undefined"!=typeof t.oid?this.setValueOidString(t.oid):"undefined"!=typeof t.hex?this.setValueHex(t.hex):"undefined"!=typeof t.name&&this.setValueName(t.name))},YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier,KJUR.asn1.ASN1Object),KJUR.asn1.DEREnumerated=function(t){KJUR.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new BigInteger(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t["int"]?this.setByInteger(t["int"]):"number"==typeof t?this.setByInteger(t):"undefined"!=typeof t.hex&&this.setValueHex(t.hex))},YAHOO.lang.extend(KJUR.asn1.DEREnumerated,KJUR.asn1.ASN1Object),KJUR.asn1.DERUTF8String=function(t){KJUR.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},YAHOO.lang.extend(KJUR.asn1.DERUTF8String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNumericString=function(t){KJUR.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},YAHOO.lang.extend(KJUR.asn1.DERNumericString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERPrintableString=function(t){KJUR.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},YAHOO.lang.extend(KJUR.asn1.DERPrintableString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERTeletexString=function(t){KJUR.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},YAHOO.lang.extend(KJUR.asn1.DERTeletexString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERIA5String=function(t){KJUR.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},YAHOO.lang.extend(KJUR.asn1.DERIA5String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERUTCTime=function(t){KJUR.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return"undefined"==typeof this.date&&"undefined"==typeof this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},YAHOO.lang.extend(KJUR.asn1.DERUTCTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERGeneralizedTime=function(t){KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),t.millis===!0&&(this.withMillis=!0))},YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERSequence=function(t){KJUR.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t+=n.getEncodedHex()}return this.hV=t,this.hV}},YAHOO.lang.extend(KJUR.asn1.DERSequence,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERSet=function(t){KJUR.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t.push(n.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},"undefined"!=typeof t&&"undefined"!=typeof t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},YAHOO.lang.extend(KJUR.asn1.DERSet,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERTaggedObject=function(t){KJUR.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,n){this.hT=e,this.isExplicit=t,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t.tag&&(this.hT=t.tag),"undefined"!=typeof t.explicit&&(this.isExplicit=t.explicit),"undefined"!=typeof t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},YAHOO.lang.extend(KJUR.asn1.DERTaggedObject,KJUR.asn1.ASN1Object);var ASN1HEX=new function(){this.getByteLengthOfL_AtObj=function(t,e){if("8"!=t.substring(e+2,e+3))return 1;var n=parseInt(t.substring(e+3,e+4));return 0==n?-1:n>0&&10>n?n+1:-2},this.getHexOfL_AtObj=function(t,e){var n=this.getByteLengthOfL_AtObj(t,e);return 1>n?"":t.substring(e+2,e+2+2*n)},this.getIntOfL_AtObj=function(t,e){var n=this.getHexOfL_AtObj(t,e);if(""==n)return-1;var i;return i=parseInt(n.substring(0,1))<8?new BigInteger(n,16):new BigInteger(n.substring(2),16),i.intValue()},this.getStartPosOfV_AtObj=function(t,e){var n=this.getByteLengthOfL_AtObj(t,e);return 0>n?n:e+2*(n+1)},this.getHexOfV_AtObj=function(t,e){var n=this.getStartPosOfV_AtObj(t,e),i=this.getIntOfL_AtObj(t,e);return t.substring(n,n+2*i)},this.getHexOfTLV_AtObj=function(t,e){var n=t.substr(e,2),i=this.getHexOfL_AtObj(t,e),r=this.getHexOfV_AtObj(t,e);return n+i+r},this.getPosOfNextSibling_AtObj=function(t,e){var n=this.getStartPosOfV_AtObj(t,e),i=this.getIntOfL_AtObj(t,e);return n+2*i},this.getPosArrayOfChildren_AtObj=function(t,e){var n=new Array,i=this.getStartPosOfV_AtObj(t,e);n.push(i);for(var r=this.getIntOfL_AtObj(t,e),s=i,a=0;;){var o=this.getPosOfNextSibling_AtObj(t,s);if(null==o||o-i>=2*r)break;if(a>=200)break;n.push(o),s=o,a++}return n},this.getNthChildIndex_AtObj=function(t,e,n){var i=this.getPosArrayOfChildren_AtObj(t,e);return i[n]},this.getDecendantIndexByNthList=function(t,e,n){if(0==n.length)return e;var i=n.shift(),r=this.getPosArrayOfChildren_AtObj(t,e);return this.getDecendantIndexByNthList(t,r[i],n)},this.getDecendantHexTLVByNthList=function(t,e,n){var i=this.getDecendantIndexByNthList(t,e,n);return this.getHexOfTLV_AtObj(t,i)},this.getDecendantHexVByNthList=function(t,e,n){var i=this.getDecendantIndexByNthList(t,e,n);return this.getHexOfV_AtObj(t,i)}};ASN1HEX.getVbyList=function(t,e,n,i){var r=this.getDecendantIndexByNthList(t,e,n);if(void 0===r)throw"can't find nthList object";if(void 0!==i&&t.substr(r,2)!=i)throw"checking tag doesn't match: "+t.substr(r,2)+"!="+i;return this.getHexOfV_AtObj(t,r)},ASN1HEX.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},n=[],i=t.substr(0,2),r=parseInt(i,16);n[0]=new String(Math.floor(r/40)),n[1]=new String(r%40);for(var s=t.substr(2),a=[],o=0;o<s.length/2;o++)a.push(parseInt(s.substr(2*o,2),16));for(var h=[],u="",o=0;o<a.length;o++)128&a[o]?u+=e((127&a[o]).toString(2),7):(u+=e((127&a[o]).toString(2),7),h.push(new String(parseInt(u,2))),u="");var c=n.join(".");return h.length>0&&(c=c+"."+h.join(".")),c},ASN1HEX.dump=function(t,e,n,i){var r=function(t,e){if(t.length<=2*e)return t;var n=t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e);return n};void 0===e&&(e={ommit_long_octet:32}),void 0===n&&(n=0),void 0===i&&(i="");var s=e.ommit_long_octet;if("01"==t.substr(n,2)){var a=ASN1HEX.getHexOfV_AtObj(t,n);return"00"==a?i+"BOOLEAN FALSE\n":i+"BOOLEAN TRUE\n"}if("02"==t.substr(n,2)){var a=ASN1HEX.getHexOfV_AtObj(t,n);return i+"INTEGER "+r(a,s)+"\n"}if("03"==t.substr(n,2)){var a=ASN1HEX.getHexOfV_AtObj(t,n);return i+"BITSTRING "+r(a,s)+"\n"}if("04"==t.substr(n,2)){var a=ASN1HEX.getHexOfV_AtObj(t,n);if(ASN1HEX.isASN1HEX(a)){var o=i+"OCTETSTRING, encapsulates\n";return o+=ASN1HEX.dump(a,e,0,i+" ")}return i+"OCTETSTRING "+r(a,s)+"\n"}if("05"==t.substr(n,2))return i+"NULL\n";if("06"==t.substr(n,2)){var h=ASN1HEX.getHexOfV_AtObj(t,n),u=KJUR.asn1.ASN1Util.oidHexToInt(h),c=KJUR.asn1.x509.OID.oid2name(u),f=u.replace(/\./g," ");return""!=c?i+"ObjectIdentifier "+c+" ("+f+")\n":i+"ObjectIdentifier ("+f+")\n"}if("0c"==t.substr(n,2))return i+"UTF8String '"+hextoutf8(ASN1HEX.getHexOfV_AtObj(t,n))+"'\n";if("13"==t.substr(n,2))return i+"PrintableString '"+hextoutf8(ASN1HEX.getHexOfV_AtObj(t,n))+"'\n";if("14"==t.substr(n,2))return i+"TeletexString '"+hextoutf8(ASN1HEX.getHexOfV_AtObj(t,n))+"'\n";if("16"==t.substr(n,2))return i+"IA5String '"+hextoutf8(ASN1HEX.getHexOfV_AtObj(t,n))+"'\n";if("17"==t.substr(n,2))return i+"UTCTime "+hextoutf8(ASN1HEX.getHexOfV_AtObj(t,n))+"\n";if("18"==t.substr(n,2))return i+"GeneralizedTime "+hextoutf8(ASN1HEX.getHexOfV_AtObj(t,n))+"\n";if("30"==t.substr(n,2)){if("3000"==t.substr(n,4))return i+"SEQUENCE {}\n";var o=i+"SEQUENCE\n",g=ASN1HEX.getPosArrayOfChildren_AtObj(t,n),l=e;if((2==g.length||3==g.length)&&"06"==t.substr(g[0],2)&&"04"==t.substr(g[g.length-1],2)){var d=ASN1HEX.getHexOfV_AtObj(t,g[0]),u=KJUR.asn1.ASN1Util.oidHexToInt(d),c=KJUR.asn1.x509.OID.oid2name(u),p=JSON.parse(JSON.stringify(e));p.x509ExtName=c,l=p}for(var y=0;y<g.length;y++)o+=ASN1HEX.dump(t,l,g[y],i+" ");return o}if("31"==t.substr(n,2)){for(var o=i+"SET\n",g=ASN1HEX.getPosArrayOfChildren_AtObj(t,n),y=0;y<g.length;y++)o+=ASN1HEX.dump(t,e,g[y],i+" ");return o}var S=parseInt(t.substr(n,2),16);if(0!=(128&S)){var A=31&S;if(0!=(32&S)){for(var o=i+"["+A+"]\n",g=ASN1HEX.getPosArrayOfChildren_AtObj(t,n),y=0;y<g.length;y++)o+=ASN1HEX.dump(t,e,g[y],i+" ");return o}var a=ASN1HEX.getHexOfV_AtObj(t,n);"68747470"==a.substr(0,8)&&(a=hextoutf8(a)),"subjectAltName"===e.x509ExtName&&2==A&&(a=hextoutf8(a));var o=i+"["+A+"] "+a+"\n";return o}return i+"UNKNOWN("+t.substr(n,2)+") "+ASN1HEX.getHexOfV_AtObj(t,n)+"\n"},ASN1HEX.isASN1HEX=function(t){if(t.length%2==1)return!1;var e=ASN1HEX.getIntOfL_AtObj(t,0),n=t.substr(0,2),i=ASN1HEX.getHexOfL_AtObj(t,0),r=t.length-n.length-i.length;return r==2*e},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),"undefined"!=typeof KJUR.asn1.x509&&KJUR.asn1.x509||(KJUR.asn1.x509={}),KJUR.asn1.x509.Certificate=function(t){KJUR.asn1.x509.Certificate.superclass.constructor.call(this);this.setRsaPrvKeyByPEMandPass=function(t,e){var n=PKCS5PKEY.getDecryptedKeyHex(t,e),i=new RSAKey;i.readPrivateKeyFromASN1HexString(n),this.prvKey=i},this.sign=function(){this.asn1SignatureAlg=this.asn1TBSCert.asn1SignatureAlg,sig=new KJUR.crypto.Signature({alg:"SHA1withRSA"}),sig.init(this.prvKey),sig.updateHex(this.asn1TBSCert.getEncodedHex()),this.hexSig=sig.sign(),this.asn1Sig=new KJUR.asn1.DERBitString({hex:"00"+this.hexSig});var t=new KJUR.asn1.DERSequence({array:[this.asn1TBSCert,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=t.getEncodedHex(),this.isModified=!1},this.setSignatureHex=function(t){this.asn1SignatureAlg=this.asn1TBSCert.asn1SignatureAlg,this.hexSig=t,this.asn1Sig=new KJUR.asn1.DERBitString({hex:"00"+this.hexSig});var e=new KJUR.asn1.DERSequence({array:[this.asn1TBSCert,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=e.getEncodedHex(),this.isModified=!1},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},this.getPEMString=function(){var t=this.getEncodedHex(),e=CryptoJS.enc.Hex.parse(t),n=CryptoJS.enc.Base64.stringify(e),i=n.replace(/(.{64})/g,"$1\r\n");return"-----BEGIN CERTIFICATE-----\r\n"+i+"\r\n-----END CERTIFICATE-----\r\n"},"undefined"!=typeof t&&("undefined"!=typeof t.tbscertobj&&(this.asn1TBSCert=t.tbscertobj),"undefined"!=typeof t.prvkeyobj?this.prvKey=t.prvkeyobj:"undefined"!=typeof t.rsaprvkey?this.prvKey=t.rsaprvkey:"undefined"!=typeof t.rsaprvpem&&"undefined"!=typeof t.rsaprvpas&&this.setRsaPrvKeyByPEMandPass(t.rsaprvpem,t.rsaprvpas))},YAHOO.lang.extend(KJUR.asn1.x509.Certificate,KJUR.asn1.ASN1Object),KJUR.asn1.x509.TBSCertificate=function(t){KJUR.asn1.x509.TBSCertificate.superclass.constructor.call(this),this._initialize=function(){this.asn1Array=new Array,this.asn1Version=new KJUR.asn1.DERTaggedObject({obj:new KJUR.asn1.DERInteger({"int":2})}),this.asn1SerialNumber=null,this.asn1SignatureAlg=null,this.asn1Issuer=null,this.asn1NotBefore=null,this.asn1NotAfter=null,this.asn1Subject=null,this.asn1SubjPKey=null,this.extensionsArray=new Array},this.setSerialNumberByParam=function(t){this.asn1SerialNumber=new KJUR.asn1.DERInteger(t)},this.setSignatureAlgByParam=function(t){this.asn1SignatureAlg=new KJUR.asn1.x509.AlgorithmIdentifier(t)},this.setIssuerByParam=function(t){this.asn1Issuer=new KJUR.asn1.x509.X500Name(t)},this.setNotBeforeByParam=function(t){this.asn1NotBefore=new KJUR.asn1.x509.Time(t)},this.setNotAfterByParam=function(t){this.asn1NotAfter=new KJUR.asn1.x509.Time(t)},this.setSubjectByParam=function(t){this.asn1Subject=new KJUR.asn1.x509.X500Name(t)},this.setSubjectPublicKeyByParam=function(t){this.asn1SubjPKey=new KJUR.asn1.x509.SubjectPublicKeyInfo(t)},this.setSubjectPublicKeyByGetKey=function(t){var e=KEYUTIL.getKey(t);this.asn1SubjPKey=new KJUR.asn1.x509.SubjectPublicKeyInfo(e)},this.appendExtension=function(t){this.extensionsArray.push(t)},this.appendExtensionByName=function(t,e){if("basicconstraints"==t.toLowerCase()){var n=new KJUR.asn1.x509.BasicConstraints(e);this.appendExtension(n)}else if("keyusage"==t.toLowerCase()){var n=new KJUR.asn1.x509.KeyUsage(e);this.appendExtension(n)}else if("crldistributionpoints"==t.toLowerCase()){var n=new KJUR.asn1.x509.CRLDistributionPoints(e);this.appendExtension(n)}else if("extkeyusage"==t.toLowerCase()){var n=new KJUR.asn1.x509.ExtKeyUsage(e);this.appendExtension(n)}else{if("authoritykeyidentifier"!=t.toLowerCase())throw"unsupported extension name: "+t;var n=new KJUR.asn1.x509.AuthorityKeyIdentifier(e);this.appendExtension(n)}},this.getEncodedHex=function(){if(null==this.asn1NotBefore||null==this.asn1NotAfter)throw"notBefore and/or notAfter not set";var t=new KJUR.asn1.DERSequence({array:[this.asn1NotBefore,this.asn1NotAfter]});if(this.asn1Array=new Array,this.asn1Array.push(this.asn1Version),this.asn1Array.push(this.asn1SerialNumber),this.asn1Array.push(this.asn1SignatureAlg),this.asn1Array.push(this.asn1Issuer),this.asn1Array.push(t),this.asn1Array.push(this.asn1Subject),this.asn1Array.push(this.asn1SubjPKey),this.extensionsArray.length>0){var e=new KJUR.asn1.DERSequence({array:this.extensionsArray}),n=new KJUR.asn1.DERTaggedObject({explicit:!0,tag:"a3",obj:e});this.asn1Array.push(n)}var i=new KJUR.asn1.DERSequence({array:this.asn1Array});return this.hTLV=i.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize()},YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object),KJUR.asn1.x509.Extension=function(t){KJUR.asn1.x509.Extension.superclass.constructor.call(this);this.getEncodedHex=function(){var t=new KJUR.asn1.DERObjectIdentifier({oid:this.oid}),e=new KJUR.asn1.DEROctetString({hex:this.getExtnValueHex()}),n=new Array;n.push(t),this.critical&&n.push(new KJUR.asn1.DERBoolean),n.push(e);var i=new KJUR.asn1.DERSequence({array:n});return i.getEncodedHex()},this.critical=!1,"undefined"!=typeof t&&"undefined"!=typeof t.critical&&(this.critical=t.critical)},YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object),KJUR.asn1.x509.KeyUsage=function(t){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,t),this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.15","undefined"!=typeof t&&"undefined"!=typeof t.bin&&(this.asn1ExtnValue=new KJUR.asn1.DERBitString(t))},YAHOO.lang.extend(KJUR.asn1.x509.KeyUsage,KJUR.asn1.x509.Extension),KJUR.asn1.x509.BasicConstraints=function(t){KJUR.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new KJUR.asn1.DERBoolean),this.pathLen>-1&&t.push(new KJUR.asn1.DERInteger({"int":this.pathLen}));var e=new KJUR.asn1.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,"undefined"!=typeof t&&("undefined"!=typeof t.cA&&(this.cA=t.cA),"undefined"!=typeof t.pathLen&&(this.pathLen=t.pathLen))},YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension),KJUR.asn1.x509.CRLDistributionPoints=function(t){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t),this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.setByDPArray=function(t){this.asn1ExtnValue=new KJUR.asn1.DERSequence({array:t})},this.setByOneURI=function(t){var e=new KJUR.asn1.x509.GeneralNames([{uri:t}]),n=new KJUR.asn1.x509.DistributionPointName(e),i=new KJUR.asn1.x509.DistributionPoint({dpobj:n});this.setByDPArray([i])},this.oid="2.5.29.31","undefined"!=typeof t&&("undefined"!=typeof t.array?this.setByDPArray(t.array):"undefined"!=typeof t.uri&&this.setByOneURI(t.uri))},YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension),KJUR.asn1.x509.ExtKeyUsage=function(t){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t),this.setPurposeArray=function(t){this.asn1ExtnValue=new KJUR.asn1.DERSequence;for(var e=0;e<t.length;e++){var n=new KJUR.asn1.DERObjectIdentifier(t[e]);this.asn1ExtnValue.appendASN1Object(n)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.37","undefined"!=typeof t&&"undefined"!=typeof t.array&&this.setPurposeArray(t.array)},YAHOO.lang.extend(KJUR.asn1.x509.ExtKeyUsage,KJUR.asn1.x509.Extension),KJUR.asn1.x509.AuthorityKeyIdentifier=function(t){KJUR.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t),this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new KJUR.asn1.DERTaggedObject({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new KJUR.asn1.DERTaggedObject({explicit:!1,tag:"a1",obj:this.asn1CertIssuer})),this.asn1CertSN&&t.push(new KJUR.asn1.DERTaggedObject({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new KJUR.asn1.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(t){this.asn1KID=new KJUR.asn1.DEROctetString(t)},this.setCertIssuerByParam=function(t){this.asn1CertIssuer=new KJUR.asn1.x509.X500Name(t)},this.setCertSNByParam=function(t){this.asn1CertSN=new KJUR.asn1.DERInteger(t)},this.oid="2.5.29.35","undefined"!=typeof t&&("undefined"!=typeof t.kid&&this.setKIDByParam(t.kid),"undefined"!=typeof t.issuer&&this.setCertIssuerByParam(t.issuer),"undefined"!=typeof t.sn&&this.setCertSNByParam(t.sn))},YAHOO.lang.extend(KJUR.asn1.x509.AuthorityKeyIdentifier,KJUR.asn1.x509.Extension),KJUR.asn1.x509.CRL=function(t){KJUR.asn1.x509.CRL.superclass.constructor.call(this);this.setRsaPrvKeyByPEMandPass=function(t,e){var n=PKCS5PKEY.getDecryptedKeyHex(t,e),i=new RSAKey;i.readPrivateKeyFromASN1HexString(n),this.rsaPrvKey=i},this.sign=function(){this.asn1SignatureAlg=this.asn1TBSCertList.asn1SignatureAlg,sig=new KJUR.crypto.Signature({alg:"SHA1withRSA",prov:"cryptojs/jsrsa"}),sig.initSign(this.rsaPrvKey),sig.updateHex(this.asn1TBSCertList.getEncodedHex()),this.hexSig=sig.sign(),this.asn1Sig=new KJUR.asn1.DERBitString({hex:"00"+this.hexSig});var t=new KJUR.asn1.DERSequence({array:[this.asn1TBSCertList,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=t.getEncodedHex(),this.isModified=!1},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},this.getPEMString=function(){var t=this.getEncodedHex(),e=CryptoJS.enc.Hex.parse(t),n=CryptoJS.enc.Base64.stringify(e),i=n.replace(/(.{64})/g,"$1\r\n");return"-----BEGIN X509 CRL-----\r\n"+i+"\r\n-----END X509 CRL-----\r\n"},"undefined"!=typeof t&&("undefined"!=typeof t.tbsobj&&(this.asn1TBSCertList=t.tbsobj),"undefined"!=typeof t.rsaprvkey&&(this.rsaPrvKey=t.rsaprvkey),"undefined"!=typeof t.rsaprvpem&&"undefined"!=typeof t.rsaprvpas&&this.setRsaPrvKeyByPEMandPass(t.rsaprvpem,t.rsaprvpas))},YAHOO.lang.extend(KJUR.asn1.x509.CRL,KJUR.asn1.ASN1Object),KJUR.asn1.x509.TBSCertList=function(t){KJUR.asn1.x509.TBSCertList.superclass.constructor.call(this);this.setSignatureAlgByParam=function(t){this.asn1SignatureAlg=new KJUR.asn1.x509.AlgorithmIdentifier(t)},this.setIssuerByParam=function(t){this.asn1Issuer=new KJUR.asn1.x509.X500Name(t)},this.setThisUpdateByParam=function(t){this.asn1ThisUpdate=new KJUR.asn1.x509.Time(t)},this.setNextUpdateByParam=function(t){this.asn1NextUpdate=new KJUR.asn1.x509.Time(t)},this.addRevokedCert=function(t,e){var n={};void 0!=t&&null!=t&&(n.sn=t),void 0!=e&&null!=e&&(n.time=e);var i=new KJUR.asn1.x509.CRLEntry(n);this.aRevokedCert.push(i)},this.getEncodedHex=function(){if(this.asn1Array=new Array,null!=this.asn1Version&&this.asn1Array.push(this.asn1Version),this.asn1Array.push(this.asn1SignatureAlg),this.asn1Array.push(this.asn1Issuer),this.asn1Array.push(this.asn1ThisUpdate),null!=this.asn1NextUpdate&&this.asn1Array.push(this.asn1NextUpdate),this.aRevokedCert.length>0){var t=new KJUR.asn1.DERSequence({array:this.aRevokedCert});this.asn1Array.push(t)}var e=new KJUR.asn1.DERSequence({array:this.asn1Array});return this.hTLV=e.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize=function(){this.asn1Version=null,this.asn1SignatureAlg=null,this.asn1Issuer=null,this.asn1ThisUpdate=null,this.asn1NextUpdate=null,this.aRevokedCert=new Array},this._initialize()},YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object),KJUR.asn1.x509.CRLEntry=function(t){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);this.setCertSerial=function(t){this.sn=new KJUR.asn1.DERInteger(t)},this.setRevocationDate=function(t){this.time=new KJUR.asn1.x509.Time(t)},this.getEncodedHex=function(){var t=new KJUR.asn1.DERSequence({array:[this.sn,this.time]});return this.TLV=t.getEncodedHex(),this.TLV},"undefined"!=typeof t&&("undefined"!=typeof t.time&&this.setRevocationDate(t.time),"undefined"!=typeof t.sn&&this.setCertSerial(t.sn))},YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object),KJUR.asn1.x509.X500Name=function(t){if(KJUR.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=new Array,this.setByString=function(t){var e=t.split("/");e.shift();for(var n=0;n<e.length;n++)this.asn1Array.push(new KJUR.asn1.x509.RDN({str:e[n]}))},this.setByObject=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=new KJUR.asn1.x509.RDN({str:e+"="+t[e]});this.asn1Array?this.asn1Array.push(n):this.asn1Array=[n]}},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;var t=new KJUR.asn1.DERSequence({array:this.asn1Array});return this.hTLV=t.getEncodedHex(),this.hTLV},"undefined"!=typeof t){if("undefined"!=typeof t.str?this.setByString(t.str):"object"==typeof t&&this.setByObject(t),"undefined"!=typeof t.certissuer){var e=new X509;e.hex=X509.pemToHex(t.certissuer),this.hTLV=e.getIssuerHex()}if("undefined"!=typeof t.certsubject){var e=new X509;e.hex=X509.pemToHex(t.certsubject),this.hTLV=e.getSubjectHex()}}},YAHOO.lang.extend(KJUR.asn1.x509.X500Name,KJUR.asn1.ASN1Object),KJUR.asn1.x509.RDN=function(t){KJUR.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=new Array,this.addByString=function(t){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:t}))},this.getEncodedHex=function(){var t=new KJUR.asn1.DERSet({array:this.asn1Array});return this.TLV=t.getEncodedHex(),this.TLV},"undefined"!=typeof t&&"undefined"!=typeof t.str&&this.addByString(t.str)},YAHOO.lang.extend(KJUR.asn1.x509.RDN,KJUR.asn1.ASN1Object),KJUR.asn1.x509.AttributeTypeAndValue=function(t){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var e="utf8";this.setByString=function(t){if(!t.match(/^([^=]+)=(.+)$/))throw"malformed attrTypeAndValueStr: "+t;this.setByAttrTypeAndValueStr(RegExp.$1,RegExp.$2)},this.setByAttrTypeAndValueStr=function(t,n){this.typeObj=KJUR.asn1.x509.OID.atype2obj(t);var i=e;"C"==t&&(i="prn"),this.valueObj=this.getValueObj(i,n)},this.getValueObj=function(t,e){if("utf8"==t)return new KJUR.asn1.DERUTF8String({str:e});if("prn"==t)return new KJUR.asn1.DERPrintableString({str:e});if("tel"==t)return new KJUR.asn1.DERTeletexString({str:e});if("ia5"==t)return new KJUR.asn1.DERIA5String({str:e});throw"unsupported directory string type: type="+t+" value="+e},this.getEncodedHex=function(){var t=new KJUR.asn1.DERSequence({array:[this.typeObj,this.valueObj]});return this.TLV=t.getEncodedHex(),this.TLV},"undefined"!=typeof t&&"undefined"!=typeof t.str&&this.setByString(t.str)},YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object),KJUR.asn1.x509.SubjectPublicKeyInfo=function(t){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);this.setRSAKey=function(t){if(!RSAKey.prototype.isPrototypeOf(t))throw"argument is not RSAKey instance";this.rsaKey=t;var e=new KJUR.asn1.DERInteger({bigint:t.n}),n=new KJUR.asn1.DERInteger({"int":t.e}),i=new KJUR.asn1.DERSequence({array:[e,n]}),r=i.getEncodedHex();this.asn1AlgId=new KJUR.asn1.x509.AlgorithmIdentifier({name:"rsaEncryption"}),this.asn1SubjPKey=new KJUR.asn1.DERBitString({hex:"00"+r})},this.setRSAPEM=function(t){if(!t.match(/-----BEGIN PUBLIC KEY-----/))throw"key not supported";var e=t;e=e.replace(/^-----[^-]+-----/,""),e=e.replace(/-----[^-]+-----\s*$/,"");var n=e.replace(/\s+/g,""),i=CryptoJS.enc.Base64.parse(n),r=CryptoJS.enc.Hex.stringify(i),s=_rsapem_getHexValueArrayOfChildrenFromHex(r),a=s[1],o=a.substr(2),h=_rsapem_getHexValueArrayOfChildrenFromHex(o),u=new RSAKey;u.setPublic(h[0],h[1]),this.setRSAKey(u)},this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";var t=new KJUR.asn1.DERSequence({array:[this.asn1AlgId,this.asn1SubjPKey]});return t},this.getEncodedHex=function(){var t=this.getASN1Object();return this.hTLV=t.getEncodedHex(),this.hTLV},this._setRSAKey=function(t){var e=KJUR.asn1.ASN1Util.newObject({seq:[{"int":{bigint:t.n}},{"int":{"int":t.e}}]}),n=e.getEncodedHex();this.asn1AlgId=new KJUR.asn1.x509.AlgorithmIdentifier({name:"rsaEncryption"
}),this.asn1SubjPKey=new KJUR.asn1.DERBitString({hex:"00"+n})},this._setEC=function(t){var e=new KJUR.asn1.DERObjectIdentifier({name:t.curveName});this.asn1AlgId=new KJUR.asn1.x509.AlgorithmIdentifier({name:"ecPublicKey",asn1params:e}),this.asn1SubjPKey=new KJUR.asn1.DERBitString({hex:"00"+t.pubKeyHex})},this._setDSA=function(t){var e=new KJUR.asn1.ASN1Util.newObject({seq:[{"int":{bigint:t.p}},{"int":{bigint:t.q}},{"int":{bigint:t.g}}]});this.asn1AlgId=new KJUR.asn1.x509.AlgorithmIdentifier({name:"dsa",asn1params:e});var n=new KJUR.asn1.DERInteger({bigint:t.y});this.asn1SubjPKey=new KJUR.asn1.DERBitString({hex:"00"+n.getEncodedHex()})},"undefined"!=typeof t&&("undefined"!=typeof RSAKey&&t instanceof RSAKey?this._setRSAKey(t):"undefined"!=typeof KJUR.crypto.ECDSA&&t instanceof KJUR.crypto.ECDSA?this._setEC(t):"undefined"!=typeof KJUR.crypto.DSA&&t instanceof KJUR.crypto.DSA?this._setDSA(t):"undefined"!=typeof t.rsakey?this.setRSAKey(t.rsakey):"undefined"!=typeof t.rsapem&&this.setRSAPEM(t.rsapem))},YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object),KJUR.asn1.x509.Time=function(t){KJUR.asn1.x509.Time.superclass.constructor.call(this);this.setTimeParams=function(t){this.timeParams=t},this.getEncodedHex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new KJUR.asn1.DERUTCTime(this.timeParams):new KJUR.asn1.DERGeneralizedTime(this.timeParams):"utc"==this.type?new KJUR.asn1.DERUTCTime:new KJUR.asn1.DERGeneralizedTime,this.TLV=t.getEncodedHex(),this.TLV},this.type="utc","undefined"!=typeof t&&("undefined"!=typeof t.type?this.type=t.type:"undefined"!=typeof t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object),KJUR.asn1.x509.AlgorithmIdentifier=function(t){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.getEncodedHex=function(){if(null==this.nameAlg&&null==this.asn1Alg)throw"algorithm not specified";null!=this.nameAlg&&null==this.asn1Alg&&(this.asn1Alg=KJUR.asn1.x509.OID.name2obj(this.nameAlg));var t=[this.asn1Alg];this.paramEmpty||t.push(this.asn1Params);var e=new KJUR.asn1.DERSequence({array:t});return this.hTLV=e.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&("undefined"!=typeof t.name&&(this.nameAlg=t.name),"undefined"!=typeof t.asn1params&&(this.asn1Params=t.asn1params),"undefined"!=typeof t.paramempty&&(this.paramEmpty=t.paramempty)),null==this.asn1Params&&(this.asn1Params=new KJUR.asn1.DERNull)},YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object),KJUR.asn1.x509.GeneralName=function(t){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var e={rfc822:"81",dns:"82",dn:"a4",uri:"86"};this.explicit=!1,this.setByParam=function(t){var n=null;if("undefined"!=typeof t){if("undefined"!=typeof t.rfc822&&(this.type="rfc822",n=new KJUR.asn1.DERIA5String({str:t[this.type]})),"undefined"!=typeof t.dns&&(this.type="dns",n=new KJUR.asn1.DERIA5String({str:t[this.type]})),"undefined"!=typeof t.uri&&(this.type="uri",n=new KJUR.asn1.DERIA5String({str:t[this.type]})),"undefined"!=typeof t.certissuer){this.type="dn",this.explicit=!0;var i=t.certissuer,r=null;if(i.match(/^[0-9A-Fa-f]+$/),-1!=i.indexOf("-----BEGIN ")&&(r=X509.pemToHex(i)),null==r)throw"certissuer param not cert";var s=new X509;s.hex=r;var a=s.getIssuerHex();n=new KJUR.asn1.ASN1Object,n.hTLV=a}if("undefined"!=typeof t.certsubj){this.type="dn",this.explicit=!0;var i=t.certsubj,r=null;if(i.match(/^[0-9A-Fa-f]+$/),-1!=i.indexOf("-----BEGIN ")&&(r=X509.pemToHex(i)),null==r)throw"certsubj param not cert";var s=new X509;s.hex=r;var a=s.getSubjectHex();n=new KJUR.asn1.ASN1Object,n.hTLV=a}if(null==this.type)throw"unsupported type in params="+t;this.asn1Obj=new KJUR.asn1.DERTaggedObject({explicit:this.explicit,tag:e[this.type],obj:n})}},this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()},"undefined"!=typeof t&&this.setByParam(t)},YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object),KJUR.asn1.x509.GeneralNames=function(t){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);this.setByParamArray=function(t){for(var e=0;e<t.length;e++){var n=new KJUR.asn1.x509.GeneralName(t[e]);this.asn1Array.push(n)}},this.getEncodedHex=function(){var t=new KJUR.asn1.DERSequence({array:this.asn1Array});return t.getEncodedHex()},this.asn1Array=new Array,"undefined"!=typeof t&&this.setByParamArray(t)},YAHOO.lang.extend(KJUR.asn1.x509.GeneralNames,KJUR.asn1.ASN1Object),KJUR.asn1.x509.DistributionPointName=function(t){KJUR.asn1.x509.DistributionPointName.superclass.constructor.call(this);if(this.getEncodedHex=function(){if("full"!=this.type)throw"currently type shall be 'full': "+this.type;return this.asn1Obj=new KJUR.asn1.DERTaggedObject({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.getEncodedHex(),this.hTLV},"undefined"!=typeof t){if(!KJUR.asn1.x509.GeneralNames.prototype.isPrototypeOf(t))throw"This class supports GeneralNames only as argument";this.type="full",this.tag="a0",this.asn1V=t}},YAHOO.lang.extend(KJUR.asn1.x509.DistributionPointName,KJUR.asn1.ASN1Object),KJUR.asn1.x509.DistributionPoint=function(t){KJUR.asn1.x509.DistributionPoint.superclass.constructor.call(this);this.getEncodedHex=function(){var t=new KJUR.asn1.DERSequence;if(null!=this.asn1DP){var e=new KJUR.asn1.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(e)}return this.hTLV=t.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&"undefined"!=typeof t.dpobj&&(this.asn1DP=t.dpobj)},YAHOO.lang.extend(KJUR.asn1.x509.DistributionPoint,KJUR.asn1.ASN1Object),KJUR.asn1.x509.OID=new function(t){this.atype2oidList={C:"2.5.4.6",O:"2.5.4.10",OU:"2.5.4.11",ST:"2.5.4.8",L:"2.5.4.7",CN:"2.5.4.3",DN:"2.5.4.49",DC:"0.9.2342.19200300.100.1.25"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",countryName:"2.5.4.6",organization:"2.5.4.10",organizationalUnit:"2.5.4.11",stateOrProvinceName:"2.5.4.8",locality:"2.5.4.7",commonName:"2.5.4.3",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",basicConstraints:"2.5.29.19",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",ecPublicKey:"1.2.840.10045.2.1",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4"},this.objCache={},this.name2obj=function(t){if("undefined"!=typeof this.objCache[t])return this.objCache[t];if("undefined"==typeof this.name2oidList[t])throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],n=new KJUR.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=n,n},this.atype2obj=function(t){if("undefined"!=typeof this.objCache[t])return this.objCache[t];if("undefined"==typeof this.atype2oidList[t])throw"AttributeType name undefined: "+t;var e=this.atype2oidList[t],n=new KJUR.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=n,n}},KJUR.asn1.x509.OID.oid2name=function(t){var e=KJUR.asn1.x509.OID.name2oidList;for(var n in e)if(e[n]==t)return n;return""},KJUR.asn1.x509.OID.name2oid=function(t){var e=KJUR.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},KJUR.asn1.x509.X509Util=new function(){this.getPKCS8PubKeyPEMfromRSAKey=function(t){var e=null,n=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t.n),i=KJUR.asn1.ASN1Util.integerToByteHex(t.e),r=new KJUR.asn1.DERInteger({hex:n}),s=new KJUR.asn1.DERInteger({hex:i}),a=new KJUR.asn1.DERSequence({array:[r,s]}),o=a.getEncodedHex(),h=new KJUR.asn1.x509.AlgorithmIdentifier({name:"rsaEncryption"}),u=new KJUR.asn1.DERBitString({hex:"00"+o}),c=new KJUR.asn1.DERSequence({array:[h,u]}),f=c.getEncodedHex(),e=KJUR.asn1.ASN1Util.getPEMStringFromHex(f,"PUBLIC KEY");return e}},KJUR.asn1.x509.X509Util.newCertPEM=function(t){var e=KJUR.asn1.x509,n=new e.TBSCertificate;if(void 0===t.serial)throw"serial number undefined.";if(n.setSerialNumberByParam(t.serial),"string"!=typeof t.sigalg.name)throw"unproper signature algorithm name";if(n.setSignatureAlgByParam(t.sigalg),void 0===t.issuer)throw"issuer name undefined.";if(n.setIssuerByParam(t.issuer),void 0===t.notbefore)throw"notbefore undefined.";if(n.setNotBeforeByParam(t.notbefore),void 0===t.notafter)throw"notafter undefined.";if(n.setNotAfterByParam(t.notafter),void 0===t.subject)throw"subject name undefined.";if(n.setSubjectByParam(t.subject),void 0===t.sbjpubkey)throw"subject public key undefined.";if(n.setSubjectPublicKeyByGetKey(t.sbjpubkey),void 0!==t.ext&&void 0!==t.ext.length)for(var i=0;i<t.ext.length;i++)for(key in t.ext[i])n.appendExtensionByName(key,t.ext[i][key]);if(void 0===t.cakey&&void 0===t.sighex)throw"param cakey and sighex undefined.";var r=null,s=null;return t.cakey&&(r=KEYUTIL.getKey.apply(null,t.cakey),s=new e.Certificate({tbscertobj:n,prvkeyobj:r}),s.sign()),t.sighex&&(s=new e.Certificate({tbscertobj:n}),s.setSignatureHex(t.sighex)),s.getPEMString()},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),"undefined"!=typeof KJUR.asn1.cms&&KJUR.asn1.cms||(KJUR.asn1.cms={}),KJUR.asn1.cms.Attribute=function(t){KJUR.asn1.cms.Attribute.superclass.constructor.call(this);this.getEncodedHex=function(){var t,e,n;t=new KJUR.asn1.DERObjectIdentifier({oid:this.attrTypeOid}),e=new KJUR.asn1.DERSet({array:this.valueList});try{e.getEncodedHex()}catch(i){throw"fail valueSet.getEncodedHex in Attribute(1)/"+i}n=new KJUR.asn1.DERSequence({array:[t,e]});try{this.hTLV=n.getEncodedHex()}catch(i){throw"failed seq.getEncodedHex in Attribute(2)/"+i}return this.hTLV}},YAHOO.lang.extend(KJUR.asn1.cms.Attribute,KJUR.asn1.ASN1Object),KJUR.asn1.cms.ContentType=function(t){KJUR.asn1.cms.ContentType.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.3";var e=null;if("undefined"!=typeof t){var e=new KJUR.asn1.DERObjectIdentifier(t);this.valueList=[e]}},YAHOO.lang.extend(KJUR.asn1.cms.ContentType,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.MessageDigest=function(t){if(KJUR.asn1.cms.MessageDigest.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.4","undefined"!=typeof t)if(t.eciObj instanceof KJUR.asn1.cms.EncapsulatedContentInfo&&"string"==typeof t.hashAlg){var e=t.eciObj.eContentValueHex,n=t.hashAlg,i=KJUR.crypto.Util.hashHex(e,n),r=new KJUR.asn1.DEROctetString({hex:i});r.getEncodedHex(),this.valueList=[r]}else{var r=new KJUR.asn1.DEROctetString(t);r.getEncodedHex(),this.valueList=[r]}},YAHOO.lang.extend(KJUR.asn1.cms.MessageDigest,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.SigningTime=function(t){if(KJUR.asn1.cms.SigningTime.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.5","undefined"!=typeof t){var e=new KJUR.asn1.x509.Time(t);try{e.getEncodedHex()}catch(n){throw"SigningTime.getEncodedHex() failed/"+n}this.valueList=[e]}},YAHOO.lang.extend(KJUR.asn1.cms.SigningTime,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.SigningCertificate=function(t){KJUR.asn1.cms.SigningCertificate.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.12";var e=KJUR.asn1,n=KJUR.asn1.cms,i=KJUR.crypto;this.setCerts=function(t){for(var r=[],s=0;s<t.length;s++){var a=KEYUTIL.getHexFromPEM(t[s]),o=i.Util.hashHex(a,"sha1"),h=new e.DEROctetString({hex:o});h.getEncodedHex();var u=new n.IssuerAndSerialNumber({cert:t[s]});u.getEncodedHex();var c=new e.DERSequence({array:[h,u]});c.getEncodedHex(),r.push(c)}var f=new e.DERSequence({array:r});f.getEncodedHex(),this.valueList=[f]},"undefined"!=typeof t&&"object"==typeof t.array&&this.setCerts(t.array)},YAHOO.lang.extend(KJUR.asn1.cms.SigningCertificate,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.SigningCertificateV2=function(t){KJUR.asn1.cms.SigningCertificateV2.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.47";var e=KJUR.asn1,n=KJUR.asn1.x509,i=KJUR.asn1.cms,r=KJUR.crypto;if(this.setCerts=function(t,s){for(var a=[],o=0;o<t.length;o++){var h=KEYUTIL.getHexFromPEM(t[o]),u=[];"sha256"!=s&&u.push(new n.AlgorithmIdentifier({name:s}));var c=r.Util.hashHex(h,s),f=new e.DEROctetString({hex:c});f.getEncodedHex(),u.push(f);var g=new i.IssuerAndSerialNumber({cert:t[o]});g.getEncodedHex(),u.push(g);var l=new e.DERSequence({array:u});l.getEncodedHex(),a.push(l)}var d=new e.DERSequence({array:a});d.getEncodedHex(),this.valueList=[d]},"undefined"!=typeof t&&"object"==typeof t.array){var s="sha256";"string"==typeof t.hashAlg&&(s=t.hashAlg),this.setCerts(t.array,s)}},YAHOO.lang.extend(KJUR.asn1.cms.SigningCertificateV2,KJUR.asn1.cms.Attribute),KJUR.asn1.cms.IssuerAndSerialNumber=function(t){KJUR.asn1.cms.IssuerAndSerialNumber.superclass.constructor.call(this);var e=KJUR.asn1,n=e.x509;this.setByCertPEM=function(t){var i=KEYUTIL.getHexFromPEM(t),r=new X509;r.hex=i;var s=r.getIssuerHex();this.dIssuer=new n.X500Name,this.dIssuer.hTLV=s;var a=r.getSerialNumberHex();this.dSerial=new e.DERInteger({hex:a})},this.getEncodedHex=function(){var t=new KJUR.asn1.DERSequence({array:[this.dIssuer,this.dSerial]});return this.hTLV=t.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&this.setByCertPEM(t),t.issuer&&t.serial&&(t.issuer instanceof KJUR.asn1.x509.X500Name?this.dIssuer=t.issuer:this.dIssuer=new KJUR.asn1.x509.X500Name(t.issuer),t.serial instanceof KJUR.asn1.DERInteger?this.dSerial=t.serial:this.dSerial=new KJUR.asn1.DERInteger(t.serial)),"string"==typeof t.cert&&this.setByCertPEM(t.cert))},YAHOO.lang.extend(KJUR.asn1.cms.IssuerAndSerialNumber,KJUR.asn1.ASN1Object),KJUR.asn1.cms.AttributeList=function(t){KJUR.asn1.cms.AttributeList.superclass.constructor.call(this),this.list=new Array,this.sortFlag=!0,this.add=function(t){t instanceof KJUR.asn1.cms.Attribute&&this.list.push(t)},this.length=function(){return this.list.length},this.clear=function(){this.list=new Array,this.hTLV=null,this.hV=null},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;var t=new KJUR.asn1.DERSet({array:this.list,sortflag:this.sortFlag});return this.hTLV=t.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&"undefined"!=typeof t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},YAHOO.lang.extend(KJUR.asn1.cms.AttributeList,KJUR.asn1.ASN1Object),KJUR.asn1.cms.SignerInfo=function(t){KJUR.asn1.cms.SignerInfo.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.cms,i=KJUR.asn1.x509;this.dCMSVersion=new e.DERInteger({"int":1}),this.dSignerIdentifier=null,this.dDigestAlgorithm=null,this.dSignedAttrs=new n.AttributeList,this.dSigAlg=null,this.dSig=null,this.dUnsignedAttrs=new n.AttributeList,this.setSignerIdentifier=function(t){if("string"==typeof t&&-1!=t.indexOf("CERTIFICATE")&&-1!=t.indexOf("BEGIN")&&-1!=t.indexOf("END")){this.dSignerIdentifier=new n.IssuerAndSerialNumber({cert:t})}},this.setForContentAndHash=function(t){"undefined"!=typeof t&&(t.eciObj instanceof KJUR.asn1.cms.EncapsulatedContentInfo&&(this.dSignedAttrs.add(new n.ContentType({oid:"1.2.840.113549.1.7.1"})),this.dSignedAttrs.add(new n.MessageDigest({eciObj:t.eciObj,hashAlg:t.hashAlg}))),"undefined"!=typeof t.sdObj&&t.sdObj instanceof KJUR.asn1.cms.SignedData&&-1==t.sdObj.digestAlgNameList.join(":").indexOf(t.hashAlg)&&t.sdObj.digestAlgNameList.push(t.hashAlg),"string"==typeof t.hashAlg&&(this.dDigestAlgorithm=new i.AlgorithmIdentifier({name:t.hashAlg})))},this.sign=function(t,n){this.dSigAlg=new i.AlgorithmIdentifier({name:n});var r=this.dSignedAttrs.getEncodedHex(),s=KEYUTIL.getKey(t),a=new KJUR.crypto.Signature({alg:n});a.init(s),a.updateHex(r);var o=a.sign();this.dSig=new e.DEROctetString({hex:o})},this.addUnsigned=function(t){this.hTLV=null,this.dUnsignedAttrs.hTLV=null,this.dUnsignedAttrs.add(t)},this.getEncodedHex=function(){if(this.dSignedAttrs instanceof KJUR.asn1.cms.AttributeList&&0==this.dSignedAttrs.length())throw"SignedAttrs length = 0 (empty)";var t=new e.DERTaggedObject({obj:this.dSignedAttrs,tag:"a0",explicit:!1}),n=null;this.dUnsignedAttrs.length()>0&&(n=new e.DERTaggedObject({obj:this.dUnsignedAttrs,tag:"a1",explicit:!1}));var i=[this.dCMSVersion,this.dSignerIdentifier,this.dDigestAlgorithm,t,this.dSigAlg,this.dSig];null!=n&&i.push(n);var r=new e.DERSequence({array:i});return this.hTLV=r.getEncodedHex(),this.hTLV}},YAHOO.lang.extend(KJUR.asn1.cms.SignerInfo,KJUR.asn1.ASN1Object),KJUR.asn1.cms.EncapsulatedContentInfo=function(t){KJUR.asn1.cms.EncapsulatedContentInfo.superclass.constructor.call(this);var e=KJUR.asn1;KJUR.asn1.cms,KJUR.asn1.x509;this.dEContentType=new e.DERObjectIdentifier({name:"data"}),this.dEContent=null,this.isDetached=!1,this.eContentValueHex=null,this.setContentType=function(t){t.match(/^[0-2][.][0-9.]+$/)?this.dEContentType=new e.DERObjectIdentifier({oid:t}):this.dEContentType=new e.DERObjectIdentifier({name:t})},this.setContentValue=function(t){"undefined"!=typeof t&&("string"==typeof t.hex?this.eContentValueHex=t.hex:"string"==typeof t.str&&(this.eContentValueHex=utf8tohex(t.str)))},this.setContentValueHex=function(t){this.eContentValueHex=t},this.setContentValueStr=function(t){this.eContentValueHex=utf8tohex(t)},this.getEncodedHex=function(){if("string"!=typeof this.eContentValueHex)throw"eContentValue not yet set";var t=new e.DEROctetString({hex:this.eContentValueHex});this.dEContent=new e.DERTaggedObject({obj:t,tag:"a0",explicit:!0});var n=[this.dEContentType];this.isDetached||n.push(this.dEContent);var i=new e.DERSequence({array:n});return this.hTLV=i.getEncodedHex(),this.hTLV}},YAHOO.lang.extend(KJUR.asn1.cms.EncapsulatedContentInfo,KJUR.asn1.ASN1Object),KJUR.asn1.cms.ContentInfo=function(t){KJUR.asn1.cms.ContentInfo.superclass.constructor.call(this);var e=KJUR.asn1,n=(KJUR.asn1.cms,KJUR.asn1.x509);this.dContentType=null,this.dContent=null,this.setContentType=function(t){"string"==typeof t&&(this.dContentType=n.OID.name2obj(t))},this.getEncodedHex=function(){var t=new e.DERTaggedObject({obj:this.dContent,tag:"a0",explicit:!0}),n=new e.DERSequence({array:[this.dContentType,t]});return this.hTLV=n.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&(t.type&&this.setContentType(t.type),t.obj&&t.obj instanceof e.ASN1Object&&(this.dContent=t.obj))},YAHOO.lang.extend(KJUR.asn1.cms.ContentInfo,KJUR.asn1.ASN1Object),KJUR.asn1.cms.SignedData=function(t){KJUR.asn1.cms.SignedData.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.cms,i=KJUR.asn1.x509;this.dCMSVersion=new e.DERInteger({"int":1}),this.dDigestAlgs=null,this.digestAlgNameList=[],this.dEncapContentInfo=new n.EncapsulatedContentInfo,this.dCerts=null,this.certificateList=[],this.crlList=[],this.signerInfoList=[new n.SignerInfo],this.addCertificatesByPEM=function(t){var n=KEYUTIL.getHexFromPEM(t),i=new e.ASN1Object;i.hTLV=n,this.certificateList.push(i)},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(null==this.dDigestAlgs){for(var t=[],n=0;n<this.digestAlgNameList.length;n++){var r=this.digestAlgNameList[n],s=new i.AlgorithmIdentifier({name:r});t.push(s)}this.dDigestAlgs=new e.DERSet({array:t})}var a=[this.dCMSVersion,this.dDigestAlgs,this.dEncapContentInfo];if(null==this.dCerts&&this.certificateList.length>0){var o=new e.DERSet({array:this.certificateList});this.dCerts=new e.DERTaggedObject({obj:o,tag:"a0",explicit:!1})}null!=this.dCerts&&a.push(this.dCerts);var h=new e.DERSet({array:this.signerInfoList});a.push(h);var u=new e.DERSequence({array:a});return this.hTLV=u.getEncodedHex(),this.hTLV},this.getContentInfo=function(){this.getEncodedHex();var t=new n.ContentInfo({type:"signed-data",obj:this});return t},this.getContentInfoEncodedHex=function(){var t=this.getContentInfo(),e=t.getEncodedHex();return e},this.getPEM=function(){var t=this.getContentInfoEncodedHex(),n=e.ASN1Util.getPEMStringFromHex(t,"CMS");return n}},YAHOO.lang.extend(KJUR.asn1.cms.SignedData,KJUR.asn1.ASN1Object),KJUR.asn1.cms.CMSUtil=new function(){},KJUR.asn1.cms.CMSUtil.newSignedData=function(t){var e=KJUR.asn1.cms,n=KJUR.asn1.cades,i=new e.SignedData;if(i.dEncapContentInfo.setContentValue(t.content),"object"==typeof t.certs)for(var r=0;r<t.certs.length;r++)i.addCertificatesByPEM(t.certs[r]);i.signerInfoList=[];for(var r=0;r<t.signerInfos.length;r++){var s=t.signerInfos[r],a=new e.SignerInfo;a.setSignerIdentifier(s.signerCert),a.setForContentAndHash({sdObj:i,eciObj:i.dEncapContentInfo,hashAlg:s.hashAlg});for(attrName in s.sAttr){var o=s.sAttr[attrName];if("SigningTime"==attrName){var h=new e.SigningTime(o);a.dSignedAttrs.add(h)}if("SigningCertificate"==attrName){var h=new e.SigningCertificate(o);a.dSignedAttrs.add(h)}if("SigningCertificateV2"==attrName){var h=new e.SigningCertificateV2(o);a.dSignedAttrs.add(h)}if("SignaturePolicyIdentifier"==attrName){var h=new n.SignaturePolicyIdentifier(o);a.dSignedAttrs.add(h)}}a.sign(s.signerPrvKey,s.sigAlg),i.signerInfoList.push(a)}return i},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),"undefined"!=typeof KJUR.asn1.tsp&&KJUR.asn1.tsp||(KJUR.asn1.tsp={}),KJUR.asn1.tsp.Accuracy=function(t){KJUR.asn1.tsp.Accuracy.superclass.constructor.call(this);var e=KJUR.asn1;this.seconds=null,this.millis=null,this.micros=null,this.getEncodedHex=function(){var t=null,n=null,i=null,r=[];if(null!=this.seconds&&(t=new e.DERInteger({"int":this.seconds}),r.push(t)),null!=this.millis){var s=new e.DERInteger({"int":this.millis});n=new e.DERTaggedObject({obj:s,tag:"80",explicit:!1}),r.push(n)}if(null!=this.micros){var a=new e.DERInteger({"int":this.micros});i=new e.DERTaggedObject({obj:a,tag:"81",explicit:!1}),r.push(i)}var o=new e.DERSequence({array:r});return this.hTLV=o.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&("number"==typeof t.seconds&&(this.seconds=t.seconds),"number"==typeof t.millis&&(this.millis=t.millis),"number"==typeof t.micros&&(this.micros=t.micros))},YAHOO.lang.extend(KJUR.asn1.tsp.Accuracy,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.MessageImprint=function(t){KJUR.asn1.tsp.MessageImprint.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.x509;this.dHashAlg=null,this.dHashValue=null,this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;var t=new e.DERSequence({array:[this.dHashAlg,this.dHashValue]});return t.getEncodedHex()},"undefined"!=typeof t&&("string"==typeof t.hashAlg&&(this.dHashAlg=new n.AlgorithmIdentifier({name:t.hashAlg})),"string"==typeof t.hashValue&&(this.dHashValue=new e.DEROctetString({hex:t.hashValue})))},YAHOO.lang.extend(KJUR.asn1.tsp.MessageImprint,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.TimeStampReq=function(t){KJUR.asn1.tsp.TimeStampReq.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.tsp;this.dVersion=new e.DERInteger({"int":1}),this.dMessageImprint=null,this.dPolicy=null,this.dNonce=null,this.certReq=!0,this.setMessageImprint=function(t){return t instanceof KJUR.asn1.tsp.MessageImprint?void(this.dMessageImprint=t):void("object"==typeof t&&(this.dMessageImprint=new n.MessageImprint(t)))},this.getEncodedHex=function(){if(null==this.dMessageImprint)throw"messageImprint shall be specified";var t=[this.dVersion,this.dMessageImprint];null!=this.dPolicy&&t.push(this.dPolicy),null!=this.dNonce&&t.push(this.dNonce),this.certReq&&t.push(new e.DERBoolean);var n=new e.DERSequence({array:t});return this.hTLV=n.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&("object"==typeof t.mi&&this.setMessageImprint(t.mi),"object"==typeof t.policy&&(this.dPolicy=new e.DERObjectIdentifier(t.policy)),"object"==typeof t.nonce&&(this.dNonce=new e.DERInteger(t.nonce)),"boolean"==typeof t.certreq&&(this.certReq=t.certreq))},YAHOO.lang.extend(KJUR.asn1.tsp.TimeStampReq,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.TSTInfo=function(t){KJUR.asn1.tsp.TSTInfo.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.x509,i=KJUR.asn1.tsp;if(this.dVersion=new e.DERInteger({"int":1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerialNumber=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.getEncodedHex=function(){var t=[this.dVersion];if(null==this.dPolicy)throw"policy shall be specified.";if(t.push(this.dPolicy),null==this.dMessageImprint)throw"messageImprint shall be specified.";if(t.push(this.dMessageImprint),null==this.dSerialNumber)throw"serialNumber shall be specified.";if(t.push(this.dSerialNumber),null==this.dGenTime)throw"genTime shall be specified.";t.push(this.dGenTime),null!=this.dAccuracy&&t.push(this.dAccuracy),null!=this.dOrdering&&t.push(this.dOrdering),null!=this.dNonce&&t.push(this.dNonce),null!=this.dTsa&&t.push(this.dTsa);var n=new e.DERSequence({array:t});return this.hTLV=n.getEncodedHex(),this.hTLV},"undefined"!=typeof t){if("string"==typeof t.policy){if(!t.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new e.DERObjectIdentifier({oid:t.policy})}"undefined"!=typeof t.messageImprint&&(this.dMessageImprint=new i.MessageImprint(t.messageImprint)),"undefined"!=typeof t.serialNumber&&(this.dSerialNumber=new e.DERInteger(t.serialNumber)),"undefined"!=typeof t.genTime&&(this.dGenTime=new e.DERGeneralizedTime(t.genTime)),"undefind"!=typeof t.accuracy&&(this.dAccuracy=new i.Accuracy(t.accuracy)),"undefined"!=typeof t.ordering&&1==t.ordering&&(this.dOrdering=new e.DERBoolean),"undefined"!=typeof t.nonce&&(this.dNonce=new e.DERInteger(t.nonce)),"undefined"!=typeof t.tsa&&(this.dTsa=new n.X500Name(t.tsa))}},YAHOO.lang.extend(KJUR.asn1.tsp.TSTInfo,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.TimeStampResp=function(t){KJUR.asn1.tsp.TimeStampResp.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.tsp;this.dStatus=null,this.dTST=null,this.getEncodedHex=function(){if(null==this.dStatus)throw"status shall be specified";var t=[this.dStatus];null!=this.dTST&&t.push(this.dTST);var n=new e.DERSequence({array:t});return this.hTLV=n.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&("object"==typeof t.status&&(this.dStatus=new n.PKIStatusInfo(t.status)),"undefined"!=typeof t.tst&&t.tst instanceof KJUR.asn1.ASN1Object&&(this.dTST=t.tst.getContentInfo()))},YAHOO.lang.extend(KJUR.asn1.tsp.TimeStampResp,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIStatusInfo=function(t){KJUR.asn1.tsp.PKIStatusInfo.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.tsp;this.dStatus=null,this.dStatusString=null,this.dFailureInfo=null,this.getEncodedHex=function(){if(null==this.dStatus)throw"status shall be specified";var t=[this.dStatus];null!=this.dStatusString&&t.push(this.dStatusString),null!=this.dFailureInfo&&t.push(this.dFailureInfo);var n=new e.DERSequence({array:t});return this.hTLV=n.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&("object"==typeof t.status&&(this.dStatus=new n.PKIStatus(t.status)),"object"==typeof t.statstr&&(this.dStatusString=new n.PKIFreeText({array:t.statstr})),"object"==typeof t.failinfo&&(this.dFailureInfo=new n.PKIFailureInfo(t.failinfo)))},YAHOO.lang.extend(KJUR.asn1.tsp.PKIStatusInfo,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIStatus=function(t){KJUR.asn1.tsp.PKIStatus.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.tsp;if(this.getEncodedHex=function(){return this.hTLV=this.dStatus.getEncodedHex(),this.hTLV},"undefined"!=typeof t)if("undefined"!=typeof t.name){var i=n.PKIStatus.valueList;if("undefined"==typeof i[t.name])throw"name undefined: "+t.name;this.dStatus=new e.DERInteger({"int":i[t.name]})}else this.dStatus=new e.DERInteger(t)},YAHOO.lang.extend(KJUR.asn1.tsp.PKIStatus,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIStatus.valueList={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5},KJUR.asn1.tsp.PKIFreeText=function(t){KJUR.asn1.tsp.PKIFreeText.superclass.constructor.call(this);var e=KJUR.asn1;this.textList=[],this.getEncodedHex=function(){for(var t=[],n=0;n<this.textList.length;n++)t.push(new e.DERUTF8String({str:this.textList[n]}));var i=new e.DERSequence({array:t});return this.hTLV=i.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&"object"==typeof t.array&&(this.textList=t.array)},YAHOO.lang.extend(KJUR.asn1.tsp.PKIFreeText,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIFailureInfo=function(t){KJUR.asn1.tsp.PKIFailureInfo.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.tsp;if(this.value=null,this.getEncodedHex=function(){if(null==this.value)throw"value shall be specified";var t=new Number(this.value).toString(2),n=new e.DERBitString;return n.setByBinaryString(t),this.hTLV=n.getEncodedHex(),this.hTLV},"undefined"!=typeof t)if("string"==typeof t.name){var i=n.PKIFailureInfo.valueList;if("undefined"==typeof i[t.name])throw"name undefined: "+t.name;this.value=i[t.name]}else"number"==typeof t["int"]&&(this.value=t["int"])},YAHOO.lang.extend(KJUR.asn1.tsp.PKIFailureInfo,KJUR.asn1.ASN1Object),KJUR.asn1.tsp.PKIFailureInfo.valueList={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25},KJUR.asn1.tsp.AbstractTSAAdapter=function(t){this.getTSTHex=function(t,e){throw"not implemented yet"}},KJUR.asn1.tsp.SimpleTSAAdapter=function(t){KJUR.asn1.tsp.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(t,e){var n=KJUR.crypto.Util.hashHex(t,e);this.params.tstInfo.messageImprint={hashAlg:e,hashValue:n},this.params.tstInfo.serialNumber={"int":this.serial++};var i=Math.floor(1e9*Math.random());this.params.tstInfo.nonce={"int":i};var r=KJUR.asn1.tsp.TSPUtil.newTimeStampToken(this.params);return r.getContentInfoEncodedHex()},"undefined"!=typeof t&&(this.params=t)},YAHOO.lang.extend(KJUR.asn1.tsp.SimpleTSAAdapter,KJUR.asn1.tsp.AbstractTSAAdapter),KJUR.asn1.tsp.FixedTSAAdapter=function(t){KJUR.asn1.tsp.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(t,e){var n=KJUR.crypto.Util.hashHex(t,e);this.params.tstInfo.messageImprint={hashAlg:e,hashValue:n};var i=KJUR.asn1.tsp.TSPUtil.newTimeStampToken(this.params);return i.getContentInfoEncodedHex()},"undefined"!=typeof t&&(this.params=t)},YAHOO.lang.extend(KJUR.asn1.tsp.FixedTSAAdapter,KJUR.asn1.tsp.AbstractTSAAdapter),KJUR.asn1.tsp.TSPUtil=new function(){},KJUR.asn1.tsp.TSPUtil.newTimeStampToken=function(t){var e=KJUR.asn1.cms,n=KJUR.asn1.tsp,i=new e.SignedData,r=new n.TSTInfo(t.tstInfo),s=r.getEncodedHex();if(i.dEncapContentInfo.setContentValue({hex:s}),i.dEncapContentInfo.setContentType("tstinfo"),"object"==typeof t.certs)for(var a=0;a<t.certs.length;a++)i.addCertificatesByPEM(t.certs[a]);var o=i.signerInfoList[0];o.setSignerIdentifier(t.signerCert),o.setForContentAndHash({sdObj:i,eciObj:i.dEncapContentInfo,hashAlg:t.hashAlg});var h=new e.SigningCertificate({array:[t.signerCert]
});return o.dSignedAttrs.add(h),o.sign(t.signerPrvKey,t.sigAlg),i},KJUR.asn1.tsp.TSPUtil.parseTimeStampReq=function(t){var e={};e.certreq=!1;var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(n.length<2)throw"TimeStampReq must have at least 2 items";var i=ASN1HEX.getHexOfTLV_AtObj(t,n[1]);e.mi=KJUR.asn1.tsp.TSPUtil.parseMessageImprint(i);for(var r=2;r<n.length;r++){var s=n[r],a=t.substr(s,2);if("06"==a){var o=ASN1HEX.getHexOfV_AtObj(t,s);e.policy=ASN1HEX.hextooidstr(o)}"02"==a&&(e.nonce=ASN1HEX.getHexOfV_AtObj(t,s)),"01"==a&&(e.certreq=!0)}return e},KJUR.asn1.tsp.TSPUtil.parseMessageImprint=function(t){var e={};if("30"!=t.substr(0,2))throw"head of messageImprint hex shall be '30'";var n=(ASN1HEX.getPosArrayOfChildren_AtObj(t,0),ASN1HEX.getDecendantIndexByNthList(t,0,[0,0])),i=ASN1HEX.getHexOfV_AtObj(t,n),r=ASN1HEX.hextooidstr(i),s=KJUR.asn1.x509.OID.oid2name(r);if(""==s)throw"hashAlg name undefined: "+r;var a=s,o=ASN1HEX.getDecendantIndexByNthList(t,0,[1]);return e.hashAlg=a,e.hashValue=ASN1HEX.getHexOfV_AtObj(t,o),e},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),"undefined"!=typeof KJUR.asn1.cades&&KJUR.asn1.cades||(KJUR.asn1.cades={}),KJUR.asn1.cades.SignaturePolicyIdentifier=function(t){KJUR.asn1.cades.SignaturePolicyIdentifier.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.15";var e=KJUR.asn1,n=KJUR.asn1.cades;if("undefined"!=typeof t&&"string"==typeof t.oid&&"object"==typeof t.hash){var i=new e.DERObjectIdentifier({oid:t.oid}),r=new n.OtherHashAlgAndValue(t.hash),s=new e.DERSequence({array:[i,r]});this.valueList=[s]}},YAHOO.lang.extend(KJUR.asn1.cades.SignaturePolicyIdentifier,KJUR.asn1.cms.Attribute),KJUR.asn1.cades.OtherHashAlgAndValue=function(t){KJUR.asn1.cades.OtherHashAlgAndValue.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.x509;this.dAlg=null,this.dHash=null,this.getEncodedHex=function(){var t=new e.DERSequence({array:[this.dAlg,this.dHash]});return this.hTLV=t.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&"string"==typeof t.alg&&"string"==typeof t.hash&&(this.dAlg=new n.AlgorithmIdentifier({name:t.alg}),this.dHash=new e.DEROctetString({hex:t.hash}))},YAHOO.lang.extend(KJUR.asn1.cades.OtherHashAlgAndValue,KJUR.asn1.ASN1Object),KJUR.asn1.cades.SignatureTimeStamp=function(t){KJUR.asn1.cades.SignatureTimeStamp.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.14",this.tstHex=null;var e=KJUR.asn1;if("undefined"!=typeof t){if("undefined"!=typeof t.res)if("string"==typeof t.res&&t.res.match(/^[0-9A-Fa-f]+$/));else if(!(t.res instanceof KJUR.asn1.ASN1Object))throw"res param shall be ASN1Object or hex string";if("undefined"!=typeof t.tst)if("string"==typeof t.tst&&t.tst.match(/^[0-9A-Fa-f]+$/)){var n=new e.ASN1Object;this.tstHex=t.tst,n.hTLV=this.tstHex,n.getEncodedHex(),this.valueList=[n]}else if(!(t.tst instanceof KJUR.asn1.ASN1Object))throw"tst param shall be ASN1Object or hex string"}},YAHOO.lang.extend(KJUR.asn1.cades.SignatureTimeStamp,KJUR.asn1.cms.Attribute),KJUR.asn1.cades.CompleteCertificateRefs=function(t){KJUR.asn1.cades.CompleteCertificateRefs.superclass.constructor.call(this),this.attrTypeOid="1.2.840.113549.1.9.16.2.21";var e=(KJUR.asn1,KJUR.asn1.cades);this.setByArray=function(t){this.valueList=[];for(var n=0;n<t.length;n++){var i=new e.OtherCertID(t[n]);this.valueList.push(i)}},"undefined"!=typeof t&&"object"==typeof t&&"number"==typeof t.length&&this.setByArray(t)},YAHOO.lang.extend(KJUR.asn1.cades.CompleteCertificateRefs,KJUR.asn1.cms.Attribute),KJUR.asn1.cades.OtherCertID=function(t){KJUR.asn1.cades.OtherCertID.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.cms,i=KJUR.asn1.cades;this.hasIssuerSerial=!0,this.dOtherCertHash=null,this.dIssuerSerial=null,this.setByCertPEM=function(t){this.dOtherCertHash=new i.OtherHash(t),this.hasIssuerSerial&&(this.dIssuerSerial=new n.IssuerAndSerialNumber(t))},this.getEncodedHex=function(){if(null!=this.hTLV)return this.hTLV;if(null==this.dOtherCertHash)throw"otherCertHash not set";var t=[this.dOtherCertHash];null!=this.dIssuerSerial&&t.push(this.dIssuerSerial);var n=new e.DERSequence({array:t});return this.hTLV=n.getEncodedHex(),this.hTLV},"undefined"!=typeof t&&("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&this.setByCertPEM(t),"object"==typeof t&&(t.hasis===!1&&(this.hasIssuerSerial=!1),"string"==typeof t.cert&&this.setByCertPEM(t.cert)))},YAHOO.lang.extend(KJUR.asn1.cades.OtherCertID,KJUR.asn1.ASN1Object),KJUR.asn1.cades.OtherHash=function(t){KJUR.asn1.cades.OtherHash.superclass.constructor.call(this);var e=KJUR.asn1,n=KJUR.asn1.cades;if(this.alg="sha256",this.dOtherHash=null,this.setByCertPEM=function(t){if(-1==t.indexOf("-----BEGIN "))throw"certPEM not to seem PEM format";var e=X509.pemToHex(t),i=KJUR.crypto.Util.hashHex(e,this.alg);this.dOtherHash=new n.OtherHashAlgAndValue({alg:this.alg,hash:i})},this.getEncodedHex=function(){if(null==this.dOtherHash)throw"OtherHash not set";return this.dOtherHash.getEncodedHex()},"undefined"!=typeof t)if("string"==typeof t)if(-1!=t.indexOf("-----BEGIN "))this.setByCertPEM(t);else{if(!t.match(/^[0-9A-Fa-f]+$/))throw"unsupported string value for params";this.dOtherHash=new e.DEROctetString({hex:t})}else"object"==typeof t&&("string"==typeof t.cert?("string"==typeof t.alg&&(this.alg=t.alg),this.setByCertPEM(t.cert)):this.dOtherHash=new n.OtherHashAlgAndValue(t))},YAHOO.lang.extend(KJUR.asn1.cades.OtherHash,KJUR.asn1.ASN1Object),KJUR.asn1.cades.CAdESUtil=new function(){},KJUR.asn1.cades.CAdESUtil.addSigTS=function(t,e,n){},KJUR.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(t){var e=KJUR.asn1,n=KJUR.asn1.cms,i=KJUR.asn1.cades.CAdESUtil,r={};if("06092a864886f70d010702"!=ASN1HEX.getDecendantHexTLVByNthList(t,0,[0]))throw"hex is not CMS SignedData";var s=ASN1HEX.getDecendantIndexByNthList(t,0,[1,0]),a=ASN1HEX.getPosArrayOfChildren_AtObj(t,s);if(a.length<4)throw"num of SignedData elem shall be 4 at least";var o=a.shift();r.version=ASN1HEX.getHexOfTLV_AtObj(t,o);var h=a.shift();r.algs=ASN1HEX.getHexOfTLV_AtObj(t,h);var u=a.shift();r.encapcontent=ASN1HEX.getHexOfTLV_AtObj(t,u),r.certs=null,r.revs=null,r.si=[];var c=a.shift();"a0"==t.substr(c,2)&&(r.certs=ASN1HEX.getHexOfTLV_AtObj(t,c),c=a.shift()),"a1"==t.substr(c,2)&&(r.revs=ASN1HEX.getHexOfTLV_AtObj(t,c),c=a.shift());var f=c;if("31"!=t.substr(f,2))throw"Can't find signerInfos";for(var g=ASN1HEX.getPosArrayOfChildren_AtObj(t,f),l=0;l<g.length;l++){var d=g[l],p=i.parseSignerInfoForAddingUnsigned(t,d,l);r.si[l]=p}var y=null;r.obj=new n.SignedData,y=new e.ASN1Object,y.hTLV=r.version,r.obj.dCMSVersion=y,y=new e.ASN1Object,y.hTLV=r.algs,r.obj.dDigestAlgs=y,y=new e.ASN1Object,y.hTLV=r.encapcontent,r.obj.dEncapContentInfo=y,y=new e.ASN1Object,y.hTLV=r.certs,r.obj.dCerts=y,r.obj.signerInfoList=[];for(var l=0;l<r.si.length;l++)r.obj.signerInfoList.push(r.si[l].obj);return r},KJUR.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(t,e,n){var i=KJUR.asn1,r=KJUR.asn1.cms,s={},a=ASN1HEX.getPosArrayOfChildren_AtObj(t,e);if(6!=a.length)throw"not supported items for SignerInfo (!=6)";var o=a.shift();s.version=ASN1HEX.getHexOfTLV_AtObj(t,o);var h=a.shift();s.si=ASN1HEX.getHexOfTLV_AtObj(t,h);var u=a.shift();s.digalg=ASN1HEX.getHexOfTLV_AtObj(t,u);var c=a.shift();s.sattrs=ASN1HEX.getHexOfTLV_AtObj(t,c);var f=a.shift();s.sigalg=ASN1HEX.getHexOfTLV_AtObj(t,f);var g=a.shift();s.sig=ASN1HEX.getHexOfTLV_AtObj(t,g),s.sigval=ASN1HEX.getHexOfV_AtObj(t,g);var l=null;return s.obj=new r.SignerInfo,l=new i.ASN1Object,l.hTLV=s.version,s.obj.dCMSVersion=l,l=new i.ASN1Object,l.hTLV=s.si,s.obj.dSignerIdentifier=l,l=new i.ASN1Object,l.hTLV=s.digalg,s.obj.dDigestAlgorithm=l,l=new i.ASN1Object,l.hTLV=s.sattrs,s.obj.dSignedAttrs=l,l=new i.ASN1Object,l.hTLV=s.sigalg,s.obj.dSigAlg=l,l=new i.ASN1Object,l.hTLV=s.sig,s.obj.dSig=l,s.obj.dUnsignedAttrs=new r.AttributeList,s},"undefined"!=typeof KJUR.asn1.csr&&KJUR.asn1.csr||(KJUR.asn1.csr={}),KJUR.asn1.csr.CertificationRequest=function(t){KJUR.asn1.csr.CertificationRequest.superclass.constructor.call(this);this.sign=function(t,e){null==this.prvKey&&(this.prvKey=e),this.asn1SignatureAlg=new KJUR.asn1.x509.AlgorithmIdentifier({name:t}),sig=new KJUR.crypto.Signature({alg:t}),sig.initSign(this.prvKey),sig.updateHex(this.asn1CSRInfo.getEncodedHex()),this.hexSig=sig.sign(),this.asn1Sig=new KJUR.asn1.DERBitString({hex:"00"+this.hexSig});var n=new KJUR.asn1.DERSequence({array:[this.asn1CSRInfo,this.asn1SignatureAlg,this.asn1Sig]});this.hTLV=n.getEncodedHex(),this.isModified=!1},this.getPEMString=function(){var t=KJUR.asn1.ASN1Util.getPEMStringFromHex(this.getEncodedHex(),"CERTIFICATE REQUEST");return t},this.getEncodedHex=function(){if(0==this.isModified&&null!=this.hTLV)return this.hTLV;throw"not signed yet"},"undefined"!=typeof t&&"undefined"!=typeof t.csrinfo&&(this.asn1CSRInfo=t.csrinfo)},YAHOO.lang.extend(KJUR.asn1.csr.CertificationRequest,KJUR.asn1.ASN1Object),KJUR.asn1.csr.CertificationRequestInfo=function(t){KJUR.asn1.csr.CertificationRequestInfo.superclass.constructor.call(this),this._initialize=function(){this.asn1Array=new Array,this.asn1Version=new KJUR.asn1.DERInteger({"int":0}),this.asn1Subject=null,this.asn1SubjPKey=null,this.extensionsArray=new Array},this.setSubjectByParam=function(t){this.asn1Subject=new KJUR.asn1.x509.X500Name(t)},this.setSubjectPublicKeyByGetKey=function(t){var e=KEYUTIL.getKey(t);this.asn1SubjPKey=new KJUR.asn1.x509.SubjectPublicKeyInfo(e)},this.getEncodedHex=function(){this.asn1Array=new Array,this.asn1Array.push(this.asn1Version),this.asn1Array.push(this.asn1Subject),this.asn1Array.push(this.asn1SubjPKey);var t=new KJUR.asn1.DERSequence({array:this.extensionsArray}),e=new KJUR.asn1.DERTaggedObject({explicit:!1,tag:"a0",obj:t});this.asn1Array.push(e);var n=new KJUR.asn1.DERSequence({array:this.asn1Array});return this.hTLV=n.getEncodedHex(),this.isModified=!1,this.hTLV},this._initialize()},YAHOO.lang.extend(KJUR.asn1.csr.CertificationRequestInfo,KJUR.asn1.ASN1Object),KJUR.asn1.csr.CSRUtil=new function(){},KJUR.asn1.csr.CSRUtil.newCSRPEM=function(t){var e=KJUR.asn1.csr;if(void 0===t.subject)throw"parameter subject undefined";if(void 0===t.sbjpubkey)throw"parameter sbjpubkey undefined";if(void 0===t.sigalg)throw"parameter sigalg undefined";if(void 0===t.sbjprvkey)throw"parameter sbjpubkey undefined";var n=new e.CertificationRequestInfo;n.setSubjectByParam(t.subject),n.setSubjectPublicKeyByGetKey(t.sbjpubkey);var i=new e.CertificationRequest({csrinfo:n}),r=KEYUTIL.getKey(t.sbjprvkey);i.sign(t.sigalg,r);var s=i.getPEMString();return s};var utf8tob64u,b64utoutf8;"function"==typeof Buffer?(utf8tob64u=function(t){return b64tob64u(new Buffer(t,"utf8").toString("base64"))},b64utoutf8=function(t){return new Buffer(b64utob64(t),"base64").toString("utf8")}):(utf8tob64u=function(t){return hextob64u(uricmptohex(encodeURIComponentAll(t)))},b64utoutf8=function(t){return decodeURIComponent(hextouricmp(b64utohex(t)))});var strdiffidx=function(t,e){var n=t.length;t.length>e.length&&(n=e.length);for(var i=0;n>i;i++)if(t.charCodeAt(i)!=e.charCodeAt(i))return i;return t.length!=e.length?n:-1};"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:CryptoJS.algo.MD5,sha1:CryptoJS.algo.SHA1,sha224:CryptoJS.algo.SHA224,sha256:CryptoJS.algo.SHA256,sha384:CryptoJS.algo.SHA384,sha512:CryptoJS.algo.SHA512,ripemd160:CryptoJS.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if("undefined"==typeof this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,n){var i=this.getDigestInfoHex(t,e),r=n/4;if(i.length+22>r)throw"key is too short for SigAlg: keylen="+n+","+e;for(var s="0001",a="00"+i,o="",h=r-s.length-a.length,u=0;h>u;u+=2)o+="ff";var c=s+o+a;return c},this.hashString=function(t,e){var n=new KJUR.crypto.MessageDigest({alg:e});return n.digestString(t)},this.hashHex=function(t,e){var n=new KJUR.crypto.MessageDigest({alg:e});return n.digestHex(t)},this.sha1=function(t){var e=new KJUR.crypto.MessageDigest({alg:"sha1",prov:"cryptojs"});return e.digestString(t)},this.sha256=function(t){var e=new KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return e.digestString(t)},this.sha256Hex=function(t){var e=new KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return e.digestHex(t)},this.sha512=function(t){var e=new KJUR.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return e.digestString(t)},this.sha512Hex=function(t){var e=new KJUR.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return e.digestHex(t)},this.md5=function(t){var e=new KJUR.crypto.MessageDigest({alg:"md5",prov:"cryptojs"});return e.digestString(t)},this.ripemd160=function(t){var e=new KJUR.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"});return e.digestString(t)},this.getCryptoJSMDByName=function(t){}},KJUR.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!=t&&void 0===e&&(e=KJUR.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(n){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+n}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=CryptoJS.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return t.toString(CryptoJS.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(n){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+n}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},KJUR.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(t=t.toLowerCase(),null==t&&(t="hmacsha1"),t=t.toLowerCase(),"hmac"!=t.substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=KJUR.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var n=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==e){try{var i=KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=CryptoJS.algo.HMAC.create(i,this.pass)}catch(r){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+r}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=CryptoJS.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){var t=this.mac.finalize();return t.toString(CryptoJS.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=rstrtohex(t)),void(this.pass=CryptoJS.enc.Hex.parse(e))}if("object"!=typeof t)throw"KJUR.crypto.Mac unsupported password type: "+t;var e=null;if(void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=utf8tohex(t.utf8)),void 0!==t.rstr&&(e=rstrtohex(t.rstr)),void 0!==t.b64&&(e=b64tohex(t.b64)),void 0!==t.b64u&&(e=b64utohex(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=CryptoJS.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},KJUR.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){this.algName.match(/^(.+)with(.+)$/)&&(this.mdAlgName=RegExp.$1.toLowerCase(),this.pubkeyAlgName=RegExp.$2.toLowerCase())},this._zeroPaddingOfSignature=function(t,e){for(var n="",i=e/4-t.length,r=0;i>r;r++)n+="0";return n+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw"provider not supported: "+e;if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new KJUR.crypto.MessageDigest({alg:this.mdAlgName})}catch(n){throw"setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+n}this.init=function(t,e){var n=null;try{n=void 0===e?KEYUTIL.getKey(t):KEYUTIL.getKey(t,e)}catch(i){throw"init failed:"+i}if(n.isPrivate===!0)this.prvKey=n,this.state="SIGN";else{if(n.isPublic!==!0)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.initSign=function(t){"string"==typeof t.ecprvhex&&"string"==typeof t.eccurvename?(this.ecprvhex=t.ecprvhex,this.eccurvename=t.eccurvename):this.prvKey=t,this.state="SIGN"},this.initVerifyByPublicKey=function(t){"string"==typeof t.ecpubhex&&"string"==typeof t.eccurvename?(this.ecpubhex=t.ecpubhex,this.eccurvename=t.eccurvename):t instanceof KJUR.crypto.ECDSA?this.pubKey=t:t instanceof RSAKey&&(this.pubKey=t),this.state="VERIFY"},this.initVerifyByCertificatePEM=function(t){var e=new X509;e.readCertPEM(t),this.pubKey=e.subjectPublicKeyRSA,this.state="VERIFY"},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecprvhex&&"undefined"!=typeof this.eccurvename){var t=new KJUR.crypto.ECDSA({curve:this.eccurvename});this.hSign=t.signHex(this.sHashHex,this.ecprvhex)}else if(this.prvKey instanceof RSAKey&&"rsaandmgf1"==this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof RSAKey&&"rsa"==this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof KJUR.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof KJUR.crypto.DSA))throw"Signature: unsupported public key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecpubhex&&"undefined"!=typeof this.eccurvename){var e=new KJUR.crypto.ECDSA({curve:this.eccurvename});return e.verifyHex(this.sHashHex,t,this.ecpubhex)}if(this.pubKey instanceof RSAKey&&"rsaandmgf1"==this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof RSAKey&&"rsa"==this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(this.pubKey instanceof KJUR.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(this.pubKey instanceof KJUR.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.initVerifyByPublicKey=function(t){throw"initVerifyByPublicKey(rsaPubKeyy) not supported for this alg:prov="+this.algProvName},this.initVerifyByCertificatePEM=function(t){throw"initVerifyByCertificatePEM(certPEM) not supported for this alg:prov="+this.algProvName},this.initSign=function(t){throw"initSign(prvKey) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{var e=new RSAKey;e.readPrivateKeyFromPEMString(t.prvkeypem),this.initSign(e)}catch(n){throw"fatal error to load pem private key: "+n}}},KJUR.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.ECDSA=function(t){var e="secp256r1",n=new SecureRandom;this.type="EC",this.getBigRandom=function(t){return new BigInteger(t.bitLength(),n).mod(t.subtract(BigInteger.ONE)).add(BigInteger.ONE)},this.setNamedCurve=function(t){this.ecparams=KJUR.crypto.ECParameterDB.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),n=this.ecparams.G.multiply(e),i=n.getX().toBigInteger(),r=n.getY().toBigInteger(),s=this.ecparams.keylen/4,a=("0000000000"+e.toString(16)).slice(-s),o=("0000000000"+i.toString(16)).slice(-s),h=("0000000000"+r.toString(16)).slice(-s),u="04"+o+h;return this.setPrivateKeyHex(a),this.setPublicKeyHex(u),{ecprvhex:a,ecpubhex:u}},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var n=new BigInteger(e,16),i=this.ecparams.n,r=new BigInteger(t,16);do var s=this.getBigRandom(i),a=this.ecparams.G,o=a.multiply(s),h=o.getX().toBigInteger().mod(i);while(h.compareTo(BigInteger.ZERO)<=0);var u=s.modInverse(i).multiply(r.add(n.multiply(h))).mod(i);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(h,u)},this.sign=function(t,e){var n=e,i=this.ecparams.n,r=BigInteger.fromByteArrayUnsigned(t);do var s=this.getBigRandom(i),a=this.ecparams.G,o=a.multiply(s),h=o.getX().toBigInteger().mod(i);while(h.compareTo(BigInteger.ZERO)<=0);var u=s.modInverse(i).multiply(r.add(n.multiply(h))).mod(i);return this.serializeSig(h,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,n){var i,r,s=KJUR.crypto.ECDSA.parseSigHex(e);i=s.r,r=s.s;var a;a=ECPointFp.decodeFromHex(this.ecparams.curve,n);var o=new BigInteger(t,16);return this.verifyRaw(o,i,r,a)},this.verify=function(t,e,n){var i,r;if(Bitcoin.Util.isArray(e)){var s=this.parseSig(e);i=s.r,r=s.s}else{if("object"!=typeof e||!e.r||!e.s)throw"Invalid value for signature";i=e.r,r=e.s}var a;if(n instanceof ECPointFp)a=n;else{if(!Bitcoin.Util.isArray(n))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=ECPointFp.decodeFrom(this.ecparams.curve,n)}var o=BigInteger.fromByteArrayUnsigned(t);return this.verifyRaw(o,i,r,a)},this.verifyRaw=function(t,e,n,i){var r=this.ecparams.n,s=this.ecparams.G;if(e.compareTo(BigInteger.ONE)<0||e.compareTo(r)>=0)return!1;if(n.compareTo(BigInteger.ONE)<0||n.compareTo(r)>=0)return!1;var a=n.modInverse(r),o=t.multiply(a).mod(r),h=e.multiply(a).mod(r),u=s.multiply(o).add(i.multiply(h)),c=u.getX().toBigInteger().mod(r);return c.equals(e)},this.serializeSig=function(t,e){var n=t.toByteArraySigned(),i=e.toByteArraySigned(),r=[];return r.push(2),r.push(n.length),r=r.concat(n),r.push(2),r.push(i.length),r=r.concat(i),r.unshift(r.length),r.unshift(48),r},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(e=2,2!=t[e])throw new Error("First element in signature must be a DERInteger");var n=t.slice(e+2,e+2+t[e+1]);if(e+=2+t[e+1],2!=t[e])throw new Error("Second element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);e+=2+t[e+1];var r=BigInteger.fromByteArrayUnsigned(n),s=BigInteger.fromByteArrayUnsigned(i);return{r:r,s:s}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(0>e||e>7)throw"Invalid signature type";var n=this.ecparams.n,i=BigInteger.fromByteArrayUnsigned(t.slice(1,33)).mod(n),r=BigInteger.fromByteArrayUnsigned(t.slice(33,65)).mod(n);return{r:i,s:r,i:e}},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName=e),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},KJUR.crypto.ECDSA.parseSigHex=function(t){var e=KJUR.crypto.ECDSA.parseSigHexInHexRS(t),n=new BigInteger(e.r,16),i=new BigInteger(e.s,16);return{r:n,s:i}},KJUR.crypto.ECDSA.parseSigHexInHexRS=function(t){if("30"!=t.substr(0,2))throw"signature is not a ASN.1 sequence";var e=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=e.length)throw"number of signature ASN.1 sequence elements seem wrong";var n=e[0],i=e[1];if("02"!=t.substr(n,2))throw"1st item of sequene of signature is not ASN.1 integer";if("02"!=t.substr(i,2))throw"2nd item of sequene of signature is not ASN.1 integer";var r=ASN1HEX.getHexOfV_AtObj(t,n),s=ASN1HEX.getHexOfV_AtObj(t,i);return{r:r,s:s}},KJUR.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=KJUR.crypto.ECDSA.parseSigHexInHexRS(t),n=e.r,i=e.s;if("00"==n.substr(0,2)&&n.length/2*8%128==8&&(n=n.substr(2)),"00"==i.substr(0,2)&&i.length/2*8%128==8&&(i=i.substr(2)),n.length/2*8%128!=0)throw"unknown ECDSA sig r length error";if(i.length/2*8%128!=0)throw"unknown ECDSA sig s length error";return n+i},KJUR.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var e=t.substr(0,t.length/2),n=t.substr(t.length/2);return KJUR.crypto.ECDSA.hexRSSigToASN1Sig(e,n)},KJUR.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var n=new BigInteger(t,16),i=new BigInteger(e,16);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(n,i)},KJUR.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var n=new KJUR.asn1.DERInteger({bigint:t}),i=new KJUR.asn1.DERInteger({bigint:e}),r=new KJUR.asn1.DERSequence({array:[n,i]});return r.getEncodedHex()},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.ECParameterDB=new function(){function t(t){return new BigInteger(t,16)}var e={},n={};this.getByName=function(t){var i=t;if("undefined"!=typeof n[i]&&(i=n[t]),"undefined"!=typeof e[i])return e[i];throw"unregistered EC curve name: "+i},this.regist=function(i,r,s,a,o,h,u,c,f,g,l,d){e[i]={};var p=t(s),y=t(a),S=t(o),A=t(h),v=t(u),m=new ECCurveFp(p,y,S),E=m.decodePointHex("04"+c+f);e[i].name=i,e[i].keylen=r,e[i].curve=m,e[i].G=E,e[i].n=A,e[i].h=v,e[i].oid=l,e[i].info=d;for(var b=0;b<g.length;b++)n[g[b]]=i}},KJUR.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),KJUR.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),KJUR.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),KJUR.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),KJUR.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),KJUR.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),
KJUR.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),KJUR.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),KJUR.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),KJUR.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.DSA=function(){function t(t,e,n,r,s,a){var o=KJUR.crypto.Util.hashString(e,t.toLowerCase()),o=o.substr(0,s.bitLength()/4),h=new BigInteger(o,16),u=i(BigInteger.ONE.add(BigInteger.ONE),s.subtract(BigInteger.ONE)),c=n.modPow(u,r).mod(s),f=u.modInverse(s).multiply(h.add(a.multiply(c))).mod(s),g=new Array;return g[0]=c,g[1]=f,g}function e(t){var e=openpgp.config.config.prefer_hash_algorithm;switch(Math.round(t.bitLength()/8)){case 20:return 2!=e&&e>11&&10!=e&&8>e?2:e;case 28:return e>11&&8>e?11:e;case 32:return e>10&&8>e?8:e;default:return util.print_debug("DSA select hash algorithm: returning null for an unknown length of q"),null}}function n(t,e,n,i,r,s,a,o){var h=KJUR.crypto.Util.hashString(i,t.toLowerCase()),h=h.substr(0,s.bitLength()/4),u=new BigInteger(h,16);if(BigInteger.ZERO.compareTo(e)>0||e.compareTo(s)>0||BigInteger.ZERO.compareTo(n)>0||n.compareTo(s)>0)return util.print_error("invalid DSA Signature"),null;var c=n.modInverse(s),f=u.multiply(c).mod(s),g=e.multiply(c).mod(s),l=a.modPow(f,r).multiply(o.modPow(g,r)).mod(r).mod(s);return 0==l.compareTo(e)}function i(t,e){if(!(e.compareTo(t)<=0)){for(var n=e.subtract(t),i=r(n.bitLength());i>n;)i=r(n.bitLength());return t.add(i)}}function r(t){if(0>t)return null;var e=Math.floor((t+7)/8),n=s(e);return t%8>0&&(n=String.fromCharCode(Math.pow(2,t%8)-1&n.charCodeAt(0))+n.substring(1)),new BigInteger(o(n),16)}function s(t){for(var e="",n=0;t>n;n++)e+=String.fromCharCode(a());return e}function a(){var t=new Uint32Array(1);return window.crypto.getRandomValues(t),255&t[0]}function o(t){if(null==t)return"";for(var e,n=[],i=t.length,r=0;i>r;){for(e=t[r++].charCodeAt().toString(16);e.length<2;)e="0"+e;n.push(""+e)}return n.join("")}this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.setPrivate=function(t,e,n,i,r){this.isPrivate=!0,this.p=t,this.q=e,this.g=n,this.y=i,this.x=r},this.setPublic=function(t,e,n,i){this.isPublic=!0,this.p=t,this.q=e,this.g=n,this.y=i,this.x=null},this.signWithMessageHash=function(t){var e=this.p,n=this.q,r=this.g,s=(this.y,this.x),a=(t.substr(0,n.bitLength()/4),new BigInteger(t,16)),o=i(BigInteger.ONE.add(BigInteger.ONE),n.subtract(BigInteger.ONE)),h=r.modPow(o,e).mod(n),u=o.modInverse(n).multiply(a.add(s.multiply(h))).mod(n),c=KJUR.asn1.ASN1Util.jsonToASN1HEX({seq:[{"int":{bigint:h}},{"int":{bigint:u}}]});return c},this.verifyWithMessageHash=function(t,e){var n=this.p,i=this.q,r=this.g,s=this.y,a=this.parseASN1Signature(e),o=a[0],h=a[1],t=t.substr(0,i.bitLength()/4),u=new BigInteger(t,16);if(BigInteger.ZERO.compareTo(o)>0||o.compareTo(i)>0||BigInteger.ZERO.compareTo(h)>0||h.compareTo(i)>0)throw"invalid DSA signature";var c=h.modInverse(i),f=u.multiply(c).mod(i),g=o.multiply(c).mod(i),l=r.modPow(f,n).multiply(s.modPow(g,n)).mod(n).mod(i);return 0==l.compareTo(o)},this.parseASN1Signature=function(t){try{var e=new BigInteger(ASN1HEX.getVbyList(t,0,[0],"02"),16),n=new BigInteger(ASN1HEX.getVbyList(t,0,[1],"02"),16);return[e,n]}catch(i){throw"malformed DSA signature"}},this.select_hash_algorithm=e,this.sign=t,this.verify=n,this.getRandomBigIntegerInRange=i,this.getRandomBigInteger=r,this.getRandomBytes=s};var PKCS5PKEY=function(){var t=function(t,e,i){return n(CryptoJS.AES,t,e,i)},e=function(t,e,i){return n(CryptoJS.TripleDES,t,e,i)},n=function(t,e,n,i){var r=CryptoJS.enc.Hex.parse(e),s=CryptoJS.enc.Hex.parse(n),a=CryptoJS.enc.Hex.parse(i),o={};o.key=s,o.iv=a,o.ciphertext=r;var h=t.decrypt(o,s,{iv:a});return CryptoJS.enc.Hex.stringify(h)},i=function(t,e,n){return s(CryptoJS.AES,t,e,n)},r=function(t,e,n){return s(CryptoJS.TripleDES,t,e,n)},s=function(t,e,n,i){var r=CryptoJS.enc.Hex.parse(e),s=CryptoJS.enc.Hex.parse(n),a=CryptoJS.enc.Hex.parse(i),o=t.encrypt(r,s,{iv:a}),h=CryptoJS.enc.Hex.parse(o.toString()),u=CryptoJS.enc.Base64.stringify(h);return u},a={"AES-256-CBC":{proc:t,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:e,eproc:r,keylen:24,ivlen:8}},o=function(t){return a[t].proc},h=function(t){var e=CryptoJS.lib.WordArray.random(t),n=CryptoJS.enc.Hex.stringify(e);return n},u=function(t){var e={};t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"))&&(e.cipher=RegExp.$1,e.ivsalt=RegExp.$2),t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"))&&(e.type=RegExp.$1);var n=-1,i=0;-1!=t.indexOf("\r\n\r\n")&&(n=t.indexOf("\r\n\r\n"),i=2),-1!=t.indexOf("\n\n")&&(n=t.indexOf("\n\n"),i=1);var r=t.indexOf("-----END");if(-1!=n&&-1!=r){var s=t.substring(n+2*i,r-i);s=s.replace(/\s+/g,""),e.data=s}return e},c=function(t,e,n){for(var i=n.substring(0,16),r=CryptoJS.enc.Hex.parse(i),s=CryptoJS.enc.Utf8.parse(e),o=a[t].keylen+a[t].ivlen,h="",u=null;;){var c=CryptoJS.algo.MD5.create();if(null!=u&&c.update(u),c.update(s),c.update(r),u=c.finalize(),h+=CryptoJS.enc.Hex.stringify(u),h.length>=2*o)break}var f={};return f.keyhex=h.substr(0,2*a[t].keylen),f.ivhex=h.substr(2*a[t].keylen,2*a[t].ivlen),f},f=function(t,e,n,i){var r=CryptoJS.enc.Base64.parse(t),s=CryptoJS.enc.Hex.stringify(r),o=a[e].proc,h=o(s,n,i);return h},g=function(t,e,n,i){var r=a[e].eproc,s=r(t,n,i);return s};return{version:"1.0.5",getHexFromPEM:function(t,e){var n=t;if(-1==n.indexOf("BEGIN "+e))throw"can't find PEM header: "+e;n=n.replace("-----BEGIN "+e+"-----",""),n=n.replace("-----END "+e+"-----","");var i=n.replace(/\s+/g,""),r=b64tohex(i);return r},getDecryptedKeyHexByKeyIV:function(t,e,n,i){var r=o(e);return r(t,n,i)},parsePKCS5PEM:function(t){return u(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,n){return c(t,e,n)},decryptKeyB64:function(t,e,n,i){return f(t,e,n,i)},getDecryptedKeyHex:function(t,e){var n=u(t),i=(n.type,n.cipher),r=n.ivsalt,s=n.data,a=c(i,e,r),o=a.keyhex,h=f(s,i,o,r);return h},getRSAKeyFromEncryptedPKCS5PEM:function(t,e){var n=this.getDecryptedKeyHex(t,e),i=new RSAKey;return i.readPrivateKeyFromASN1HexString(n),i},getEryptedPKCS5PEMFromPrvKeyHex:function(t,e,n,i){var r="";if("undefined"!=typeof n&&null!=n||(n="AES-256-CBC"),"undefined"==typeof a[n])throw"PKCS5PKEY unsupported algorithm: "+n;if("undefined"==typeof i||null==i){var s=a[n].ivlen,o=h(s);i=o.toUpperCase()}var u=c(n,e,i),f=u.keyhex,l=g(t,n,f,i),d=l.replace(/(.{64})/g,"$1\r\n"),r="-----BEGIN RSA PRIVATE KEY-----\r\n";return r+="Proc-Type: 4,ENCRYPTED\r\n",r+="DEK-Info: "+n+","+i+"\r\n",r+="\r\n",r+=d,r+="\r\n-----END RSA PRIVATE KEY-----\r\n"},getEryptedPKCS5PEMFromRSAKey:function(t,e,n,i){var r=new KJUR.asn1.DERInteger({"int":0}),s=new KJUR.asn1.DERInteger({bigint:t.n}),a=new KJUR.asn1.DERInteger({"int":t.e}),o=new KJUR.asn1.DERInteger({bigint:t.d}),h=new KJUR.asn1.DERInteger({bigint:t.p}),u=new KJUR.asn1.DERInteger({bigint:t.q}),c=new KJUR.asn1.DERInteger({bigint:t.dmp1}),f=new KJUR.asn1.DERInteger({bigint:t.dmq1}),g=new KJUR.asn1.DERInteger({bigint:t.coeff}),l=new KJUR.asn1.DERSequence({array:[r,s,a,o,h,u,c,f,g]}),d=l.getEncodedHex();return this.getEryptedPKCS5PEMFromPrvKeyHex(d,e,n,i)},newEncryptedPKCS5PEM:function(t,e,n,i){"undefined"!=typeof e&&null!=e||(e=1024),"undefined"!=typeof n&&null!=n||(n="10001");var r=new RSAKey;r.generate(e,n);var s=null;return s="undefined"==typeof i||null==i?this.getEncryptedPKCS5PEMFromRSAKey(pkey,t):this.getEncryptedPKCS5PEMFromRSAKey(pkey,t,i)},getRSAKeyFromPlainPKCS8PEM:function(t){if(t.match(/ENCRYPTED/))throw"pem shall be not ENCRYPTED";var e=this.getHexFromPEM(t,"PRIVATE KEY"),n=this.getRSAKeyFromPlainPKCS8Hex(e);return n},getRSAKeyFromPlainPKCS8Hex:function(t){var e=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(3!=e.length)throw"outer DERSequence shall have 3 elements: "+e.length;var n=ASN1HEX.getHexOfTLV_AtObj(t,e[1]);if("300d06092a864886f70d0101010500"!=n)throw"PKCS8 AlgorithmIdentifier is not rsaEnc: "+n;var n=ASN1HEX.getHexOfTLV_AtObj(t,e[1]),i=ASN1HEX.getHexOfTLV_AtObj(t,e[2]),r=ASN1HEX.getHexOfV_AtObj(i,0),s=new RSAKey;return s.readPrivateKeyFromASN1HexString(r),s},parseHexOfEncryptedPKCS8:function(t){var e={},n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=n.length)throw"malformed format: SEQUENCE(0).items != 2: "+n.length;e.ciphertext=ASN1HEX.getHexOfV_AtObj(t,n[1]);var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n[0]);if(2!=i.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+i.length;if("2a864886f70d01050d"!=ASN1HEX.getHexOfV_AtObj(t,i[0]))throw"this only supports pkcs5PBES2";var r=ASN1HEX.getPosArrayOfChildren_AtObj(t,i[1]);if(2!=i.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+r.length;var s=ASN1HEX.getPosArrayOfChildren_AtObj(t,r[1]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+s.length;if("2a864886f70d0307"!=ASN1HEX.getHexOfV_AtObj(t,s[0]))throw"this only supports TripleDES";e.encryptionSchemeAlg="TripleDES",e.encryptionSchemeIV=ASN1HEX.getHexOfV_AtObj(t,s[1]);var a=ASN1HEX.getPosArrayOfChildren_AtObj(t,r[0]);if(2!=a.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+a.length;if("2a864886f70d01050c"!=ASN1HEX.getHexOfV_AtObj(t,a[0]))throw"this only supports pkcs5PBKDF2";var o=ASN1HEX.getPosArrayOfChildren_AtObj(t,a[1]);if(o.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+o.length;e.pbkdf2Salt=ASN1HEX.getHexOfV_AtObj(t,o[0]);var h=ASN1HEX.getHexOfV_AtObj(t,o[1]);try{e.pbkdf2Iter=parseInt(h,16)}catch(u){throw"malformed format pbkdf2Iter: "+h}return e},getPBKDF2KeyHexFromParam:function(t,e){var n=CryptoJS.enc.Hex.parse(t.pbkdf2Salt),i=t.pbkdf2Iter,r=CryptoJS.PBKDF2(e,n,{keySize:6,iterations:i}),s=CryptoJS.enc.Hex.stringify(r);return s},getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var n=this.getHexFromPEM(t,"ENCRYPTED PRIVATE KEY"),i=this.parseHexOfEncryptedPKCS8(n),r=PKCS5PKEY.getPBKDF2KeyHexFromParam(i,e),s={};s.ciphertext=CryptoJS.enc.Hex.parse(i.ciphertext);var a=CryptoJS.enc.Hex.parse(r),o=CryptoJS.enc.Hex.parse(i.encryptionSchemeIV),h=CryptoJS.TripleDES.decrypt(s,a,{iv:o}),u=CryptoJS.enc.Hex.stringify(h);return u},getRSAKeyFromEncryptedPKCS8PEM:function(t,e){var n=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e),i=this.getRSAKeyFromPlainPKCS8Hex(n);return i},getKeyFromEncryptedPKCS8PEM:function(t,e){var n=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e),i=this.getKeyFromPlainPrivatePKCS8Hex(n);return i},parsePlainPrivatePKCS8Hex:function(t){var e={};if(e.algparam=null,"30"!=t.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(3!=n.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=t.substr(n[1],2))throw"malformed PKCS8 private key(code:003)";var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n[1]);if(2!=i.length)throw"malformed PKCS8 private key(code:004)";if("06"!=t.substr(i[0],2))throw"malformed PKCS8 private key(code:005)";if(e.algoid=ASN1HEX.getHexOfV_AtObj(t,i[0]),"06"==t.substr(i[1],2)&&(e.algparam=ASN1HEX.getHexOfV_AtObj(t,i[1])),"04"!=t.substr(n[2],2))throw"malformed PKCS8 private key(code:006)";return e.keyidx=ASN1HEX.getStartPosOfV_AtObj(t,n[2]),e},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=this.getHexFromPEM(t,"PRIVATE KEY"),n=this.getKeyFromPlainPrivatePKCS8Hex(e);return n},getKeyFromPlainPrivatePKCS8Hex:function(t){var e=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==e.algoid){this.parsePrivateRawRSAKeyHexAtObj(t,e);var n=e.key,i=new RSAKey;return i.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),i}if("2a8648ce3d0201"==e.algoid){if(this.parsePrivateRawECKeyHexAtObj(t,e),void 0===KJUR.crypto.OID.oidhex2name[e.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+e.algparam;var r=KJUR.crypto.OID.oidhex2name[e.algparam],i=new KJUR.crypto.ECDSA({curve:r,prv:e.key});return i}throw"unsupported private key algorithm"},getRSAKeyFromPublicPKCS8PEM:function(t){var e=this.getHexFromPEM(t,"PUBLIC KEY"),n=this.getRSAKeyFromPublicPKCS8Hex(e);return n},getKeyFromPublicPKCS8PEM:function(t){var e=this.getHexFromPEM(t,"PUBLIC KEY"),n=this.getKeyFromPublicPKCS8Hex(e);return n},getKeyFromPublicPKCS8Hex:function(t){var e=this.parsePublicPKCS8Hex(t);if("2a864886f70d010101"==e.algoid){var n=this.parsePublicRawRSAKeyHex(e.key),i=new RSAKey;return i.setPublic(n.n,n.e),i}if("2a8648ce3d0201"==e.algoid){if(void 0===KJUR.crypto.OID.oidhex2name[e.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+e.algparam;var r=KJUR.crypto.OID.oidhex2name[e.algparam],i=new KJUR.crypto.ECDSA({curve:r,pub:e.key});return i}throw"unsupported public key algorithm"},parsePublicRawRSAKeyHex:function(t){var e={};if("30"!=t.substr(0,2))throw"malformed RSA key(code:001)";var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=n.length)throw"malformed RSA key(code:002)";if("02"!=t.substr(n[0],2))throw"malformed RSA key(code:003)";if(e.n=ASN1HEX.getHexOfV_AtObj(t,n[0]),"02"!=t.substr(n[1],2))throw"malformed RSA key(code:004)";return e.e=ASN1HEX.getHexOfV_AtObj(t,n[1]),e},parsePrivateRawRSAKeyHexAtObj:function(t,e){var n=e.keyidx;if("30"!=t.substr(n,2))throw"malformed RSA private key(code:001)";var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n);if(9!=i.length)throw"malformed RSA private key(code:002)";e.key={},e.key.n=ASN1HEX.getHexOfV_AtObj(t,i[1]),e.key.e=ASN1HEX.getHexOfV_AtObj(t,i[2]),e.key.d=ASN1HEX.getHexOfV_AtObj(t,i[3]),e.key.p=ASN1HEX.getHexOfV_AtObj(t,i[4]),e.key.q=ASN1HEX.getHexOfV_AtObj(t,i[5]),e.key.dp=ASN1HEX.getHexOfV_AtObj(t,i[6]),e.key.dq=ASN1HEX.getHexOfV_AtObj(t,i[7]),e.key.co=ASN1HEX.getHexOfV_AtObj(t,i[8])},parsePrivateRawECKeyHexAtObj:function(t,e){var n=e.keyidx;if("30"!=t.substr(n,2))throw"malformed ECC private key(code:001)";var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n);if(3!=i.length)throw"malformed ECC private key(code:002)";if("04"!=t.substr(i[1],2))throw"malformed ECC private key(code:003)";e.key=ASN1HEX.getHexOfV_AtObj(t,i[1])},parsePublicPKCS8Hex:function(t){var e={};e.algparam=null;var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=n.length)throw"outer DERSequence shall have 2 elements: "+n.length;var i=n[0];if("30"!=t.substr(i,2))throw"malformed PKCS8 public key(code:001)";var r=ASN1HEX.getPosArrayOfChildren_AtObj(t,i);if(2!=r.length)throw"malformed PKCS8 public key(code:002)";if("06"!=t.substr(r[0],2))throw"malformed PKCS8 public key(code:003)";if(e.algoid=ASN1HEX.getHexOfV_AtObj(t,r[0]),"06"==t.substr(r[1],2)&&(e.algparam=ASN1HEX.getHexOfV_AtObj(t,r[1])),"03"!=t.substr(n[1],2))throw"malformed PKCS8 public key(code:004)";return e.key=ASN1HEX.getHexOfV_AtObj(t,n[1]).substr(2),e},getRSAKeyFromPublicPKCS8Hex:function(t){var e=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=e.length)throw"outer DERSequence shall have 2 elements: "+e.length;var n=ASN1HEX.getHexOfTLV_AtObj(t,e[0]);if("300d06092a864886f70d0101010500"!=n)throw"PKCS8 AlgorithmId is not rsaEncryption";if("03"!=t.substr(e[1],2))throw"PKCS8 Public Key is not BITSTRING encapslated.";var i=ASN1HEX.getStartPosOfV_AtObj(t,e[1])+2;if("30"!=t.substr(i,2))throw"PKCS8 Public Key is not SEQUENCE.";var r=ASN1HEX.getPosArrayOfChildren_AtObj(t,i);if(2!=r.length)throw"inner DERSequence shall have 2 elements: "+r.length;if("02"!=t.substr(r[0],2))throw"N is not ASN.1 INTEGER";if("02"!=t.substr(r[1],2))throw"E is not ASN.1 INTEGER";var s=ASN1HEX.getHexOfV_AtObj(t,r[0]),a=ASN1HEX.getHexOfV_AtObj(t,r[1]),o=new RSAKey;return o.setPublic(s,a),o}}}(),KEYUTIL=function(){var t=function(t,e,n){return i(CryptoJS.AES,t,e,n)},e=function(t,e,n){return i(CryptoJS.TripleDES,t,e,n)},n=function(t,e,n){return i(CryptoJS.DES,t,e,n)},i=function(t,e,n,i){var r=CryptoJS.enc.Hex.parse(e),s=CryptoJS.enc.Hex.parse(n),a=CryptoJS.enc.Hex.parse(i),o={};o.key=s,o.iv=a,o.ciphertext=r;var h=t.decrypt(o,s,{iv:a});return CryptoJS.enc.Hex.stringify(h)},r=function(t,e,n){return o(CryptoJS.AES,t,e,n)},s=function(t,e,n){return o(CryptoJS.TripleDES,t,e,n)},a=function(t,e,n){return o(CryptoJS.DES,t,e,n)},o=function(t,e,n,i){var r=CryptoJS.enc.Hex.parse(e),s=CryptoJS.enc.Hex.parse(n),a=CryptoJS.enc.Hex.parse(i),o=t.encrypt(r,s,{iv:a}),h=CryptoJS.enc.Hex.parse(o.toString()),u=CryptoJS.enc.Base64.stringify(h);return u},h={"AES-256-CBC":{proc:t,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:e,eproc:s,keylen:24,ivlen:8},"DES-CBC":{proc:n,eproc:a,keylen:8,ivlen:8}},u=function(t){return h[t].proc},c=function(t){var e=CryptoJS.lib.WordArray.random(t),n=CryptoJS.enc.Hex.stringify(e);return n},f=function(t){var e={};t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"))&&(e.cipher=RegExp.$1,e.ivsalt=RegExp.$2),t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"))&&(e.type=RegExp.$1);var n=-1,i=0;-1!=t.indexOf("\r\n\r\n")&&(n=t.indexOf("\r\n\r\n"),i=2),-1!=t.indexOf("\n\n")&&(n=t.indexOf("\n\n"),i=1);var r=t.indexOf("-----END");if(-1!=n&&-1!=r){var s=t.substring(n+2*i,r-i);s=s.replace(/\s+/g,""),e.data=s}return e},g=function(t,e,n){for(var i=n.substring(0,16),r=CryptoJS.enc.Hex.parse(i),s=CryptoJS.enc.Utf8.parse(e),a=h[t].keylen+h[t].ivlen,o="",u=null;;){var c=CryptoJS.algo.MD5.create();if(null!=u&&c.update(u),c.update(s),c.update(r),u=c.finalize(),o+=CryptoJS.enc.Hex.stringify(u),o.length>=2*a)break}var f={};return f.keyhex=o.substr(0,2*h[t].keylen),f.ivhex=o.substr(2*h[t].keylen,2*h[t].ivlen),f},l=function(t,e,n,i){var r=CryptoJS.enc.Base64.parse(t),s=CryptoJS.enc.Hex.stringify(r),a=h[e].proc,o=a(s,n,i);return o},d=function(t,e,n,i){var r=h[e].eproc,s=r(t,n,i);return s};return{version:"1.0.0",getHexFromPEM:function(t,e){var n=t;if(-1==n.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;"string"==typeof e&&""!=e?(n=n.replace("-----BEGIN "+e+"-----",""),n=n.replace("-----END "+e+"-----","")):(n=n.replace(/-----BEGIN [^-]+-----/,""),n=n.replace(/-----END [^-]+-----/,""));var i=n.replace(/\s+/g,""),r=b64tohex(i);return r},getDecryptedKeyHexByKeyIV:function(t,e,n,i){var r=u(e);return r(t,n,i)},parsePKCS5PEM:function(t){return f(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,n){return g(t,e,n)},decryptKeyB64:function(t,e,n,i){return l(t,e,n,i)},getDecryptedKeyHex:function(t,e){var n=f(t),i=(n.type,n.cipher),r=n.ivsalt,s=n.data,a=g(i,e,r),o=a.keyhex,h=l(s,i,o,r);return h},getRSAKeyFromEncryptedPKCS5PEM:function(t,e){var n=this.getDecryptedKeyHex(t,e),i=new RSAKey;return i.readPrivateKeyFromASN1HexString(n),i},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,n,i,r){var s="";if("undefined"!=typeof i&&null!=i||(i="AES-256-CBC"),"undefined"==typeof h[i])throw"KEYUTIL unsupported algorithm: "+i;if("undefined"==typeof r||null==r){var a=h[i].ivlen,o=c(a);r=o.toUpperCase()}var u=g(i,n,r),f=u.keyhex,l=d(e,i,f,r),p=l.replace(/(.{64})/g,"$1\r\n"),s="-----BEGIN "+t+" PRIVATE KEY-----\r\n";return s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+i+","+r+"\r\n",s+="\r\n",s+=p,s+="\r\n-----END "+t+" PRIVATE KEY-----\r\n"},getEncryptedPKCS5PEMFromRSAKey:function(t,e,n,i){var r=new KJUR.asn1.DERInteger({"int":0}),s=new KJUR.asn1.DERInteger({bigint:t.n}),a=new KJUR.asn1.DERInteger({"int":t.e}),o=new KJUR.asn1.DERInteger({bigint:t.d}),h=new KJUR.asn1.DERInteger({bigint:t.p}),u=new KJUR.asn1.DERInteger({bigint:t.q}),c=new KJUR.asn1.DERInteger({bigint:t.dmp1}),f=new KJUR.asn1.DERInteger({bigint:t.dmq1}),g=new KJUR.asn1.DERInteger({bigint:t.coeff}),l=new KJUR.asn1.DERSequence({array:[r,s,a,o,h,u,c,f,g]}),d=l.getEncodedHex();return this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",d,e,n,i)},newEncryptedPKCS5PEM:function(t,e,n,i){"undefined"!=typeof e&&null!=e||(e=1024),"undefined"!=typeof n&&null!=n||(n="10001");var r=new RSAKey;r.generate(e,n);var s=null;return s="undefined"==typeof i||null==i?this.getEncryptedPKCS5PEMFromRSAKey(r,t):this.getEncryptedPKCS5PEMFromRSAKey(r,t,i)},getRSAKeyFromPlainPKCS8PEM:function(t){if(t.match(/ENCRYPTED/))throw"pem shall be not ENCRYPTED";var e=this.getHexFromPEM(t,"PRIVATE KEY"),n=this.getRSAKeyFromPlainPKCS8Hex(e);return n},getRSAKeyFromPlainPKCS8Hex:function(t){var e=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(3!=e.length)throw"outer DERSequence shall have 3 elements: "+e.length;var n=ASN1HEX.getHexOfTLV_AtObj(t,e[1]);if("300d06092a864886f70d0101010500"!=n)throw"PKCS8 AlgorithmIdentifier is not rsaEnc: "+n;var n=ASN1HEX.getHexOfTLV_AtObj(t,e[1]),i=ASN1HEX.getHexOfTLV_AtObj(t,e[2]),r=ASN1HEX.getHexOfV_AtObj(i,0),s=new RSAKey;return s.readPrivateKeyFromASN1HexString(r),s},parseHexOfEncryptedPKCS8:function(t){var e={},n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=n.length)throw"malformed format: SEQUENCE(0).items != 2: "+n.length;e.ciphertext=ASN1HEX.getHexOfV_AtObj(t,n[1]);var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n[0]);if(2!=i.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+i.length;if("2a864886f70d01050d"!=ASN1HEX.getHexOfV_AtObj(t,i[0]))throw"this only supports pkcs5PBES2";var r=ASN1HEX.getPosArrayOfChildren_AtObj(t,i[1]);if(2!=i.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+r.length;var s=ASN1HEX.getPosArrayOfChildren_AtObj(t,r[1]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+s.length;if("2a864886f70d0307"!=ASN1HEX.getHexOfV_AtObj(t,s[0]))throw"this only supports TripleDES";e.encryptionSchemeAlg="TripleDES",e.encryptionSchemeIV=ASN1HEX.getHexOfV_AtObj(t,s[1]);var a=ASN1HEX.getPosArrayOfChildren_AtObj(t,r[0]);if(2!=a.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+a.length;if("2a864886f70d01050c"!=ASN1HEX.getHexOfV_AtObj(t,a[0]))throw"this only supports pkcs5PBKDF2";var o=ASN1HEX.getPosArrayOfChildren_AtObj(t,a[1]);if(o.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+o.length;e.pbkdf2Salt=ASN1HEX.getHexOfV_AtObj(t,o[0]);var h=ASN1HEX.getHexOfV_AtObj(t,o[1]);try{e.pbkdf2Iter=parseInt(h,16)}catch(u){throw"malformed format pbkdf2Iter: "+h}return e},getPBKDF2KeyHexFromParam:function(t,e){var n=CryptoJS.enc.Hex.parse(t.pbkdf2Salt),i=t.pbkdf2Iter,r=CryptoJS.PBKDF2(e,n,{keySize:6,iterations:i}),s=CryptoJS.enc.Hex.stringify(r);return s},getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var n=this.getHexFromPEM(t,"ENCRYPTED PRIVATE KEY"),i=this.parseHexOfEncryptedPKCS8(n),r=KEYUTIL.getPBKDF2KeyHexFromParam(i,e),s={};s.ciphertext=CryptoJS.enc.Hex.parse(i.ciphertext);var a=CryptoJS.enc.Hex.parse(r),o=CryptoJS.enc.Hex.parse(i.encryptionSchemeIV),h=CryptoJS.TripleDES.decrypt(s,a,{iv:o}),u=CryptoJS.enc.Hex.stringify(h);return u},getRSAKeyFromEncryptedPKCS8PEM:function(t,e){var n=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e),i=this.getRSAKeyFromPlainPKCS8Hex(n);return i},getKeyFromEncryptedPKCS8PEM:function(t,e){var n=this.getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e),i=this.getKeyFromPlainPrivatePKCS8Hex(n);return i},parsePlainPrivatePKCS8Hex:function(t){var e={};if(e.algparam=null,"30"!=t.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(3!=n.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=t.substr(n[1],2))throw"malformed PKCS8 private key(code:003)";var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n[1]);if(2!=i.length)throw"malformed PKCS8 private key(code:004)";if("06"!=t.substr(i[0],2))throw"malformed PKCS8 private key(code:005)";if(e.algoid=ASN1HEX.getHexOfV_AtObj(t,i[0]),"06"==t.substr(i[1],2)&&(e.algparam=ASN1HEX.getHexOfV_AtObj(t,i[1])),"04"!=t.substr(n[2],2))throw"malformed PKCS8 private key(code:006)";return e.keyidx=ASN1HEX.getStartPosOfV_AtObj(t,n[2]),e},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=this.getHexFromPEM(t,"PRIVATE KEY"),n=this.getKeyFromPlainPrivatePKCS8Hex(e);return n},getKeyFromPlainPrivatePKCS8Hex:function(t){var e=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==e.algoid){this.parsePrivateRawRSAKeyHexAtObj(t,e);var n=e.key,i=new RSAKey;return i.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),i}if("2a8648ce3d0201"==e.algoid){if(this.parsePrivateRawECKeyHexAtObj(t,e),void 0===KJUR.crypto.OID.oidhex2name[e.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+e.algparam;var r=KJUR.crypto.OID.oidhex2name[e.algparam],i=new KJUR.crypto.ECDSA({curve:r});return i.setPublicKeyHex(e.pubkey),i.setPrivateKeyHex(e.key),i.isPublic=!1,i}if("2a8648ce380401"==e.algoid){var s=ASN1HEX.getVbyList(t,0,[1,1,0],"02"),a=ASN1HEX.getVbyList(t,0,[1,1,1],"02"),o=ASN1HEX.getVbyList(t,0,[1,1,2],"02"),h=ASN1HEX.getVbyList(t,0,[2,0],"02"),u=new BigInteger(s,16),c=new BigInteger(a,16),f=new BigInteger(o,16),g=new BigInteger(h,16),i=new KJUR.crypto.DSA;return i.setPrivate(u,c,f,null,g),i}throw"unsupported private key algorithm"},getRSAKeyFromPublicPKCS8PEM:function(t){var e=this.getHexFromPEM(t,"PUBLIC KEY"),n=this.getRSAKeyFromPublicPKCS8Hex(e);return n},getKeyFromPublicPKCS8PEM:function(t){var e=this.getHexFromPEM(t,"PUBLIC KEY"),n=this.getKeyFromPublicPKCS8Hex(e);return n},getKeyFromPublicPKCS8Hex:function(t){var e=this.parsePublicPKCS8Hex(t);if("2a864886f70d010101"==e.algoid){var n=this.parsePublicRawRSAKeyHex(e.key),i=new RSAKey;return i.setPublic(n.n,n.e),i}if("2a8648ce3d0201"==e.algoid){if(void 0===KJUR.crypto.OID.oidhex2name[e.algparam])throw"KJUR.crypto.OID.oidhex2name undefined: "+e.algparam;var r=KJUR.crypto.OID.oidhex2name[e.algparam],i=new KJUR.crypto.ECDSA({curve:r,pub:e.key});return i}if("2a8648ce380401"==e.algoid){var s=e.algparam,a=ASN1HEX.getHexOfV_AtObj(e.key,0),i=new KJUR.crypto.DSA;return i.setPublic(new BigInteger(s.p,16),new BigInteger(s.q,16),new BigInteger(s.g,16),new BigInteger(a,16)),i}throw"unsupported public key algorithm"},parsePublicRawRSAKeyHex:function(t){var e={};if("30"!=t.substr(0,2))throw"malformed RSA key(code:001)";var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=n.length)throw"malformed RSA key(code:002)";if("02"!=t.substr(n[0],2))throw"malformed RSA key(code:003)";if(e.n=ASN1HEX.getHexOfV_AtObj(t,n[0]),"02"!=t.substr(n[1],2))throw"malformed RSA key(code:004)";return e.e=ASN1HEX.getHexOfV_AtObj(t,n[1]),e},parsePrivateRawRSAKeyHexAtObj:function(t,e){var n=e.keyidx;if("30"!=t.substr(n,2))throw"malformed RSA private key(code:001)";var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n);if(9!=i.length)throw"malformed RSA private key(code:002)";e.key={},e.key.n=ASN1HEX.getHexOfV_AtObj(t,i[1]),e.key.e=ASN1HEX.getHexOfV_AtObj(t,i[2]),e.key.d=ASN1HEX.getHexOfV_AtObj(t,i[3]),e.key.p=ASN1HEX.getHexOfV_AtObj(t,i[4]),e.key.q=ASN1HEX.getHexOfV_AtObj(t,i[5]),e.key.dp=ASN1HEX.getHexOfV_AtObj(t,i[6]),e.key.dq=ASN1HEX.getHexOfV_AtObj(t,i[7]),e.key.co=ASN1HEX.getHexOfV_AtObj(t,i[8])},parsePrivateRawECKeyHexAtObj:function(t,e){var n=e.keyidx,i=ASN1HEX.getVbyList(t,n,[1],"04"),r=ASN1HEX.getVbyList(t,n,[2,0],"03").substr(2);e.key=i,e.pubkey=r},parsePublicPKCS8Hex:function(t){var e={};e.algparam=null;var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=n.length)throw"outer DERSequence shall have 2 elements: "+n.length;var i=n[0];if("30"!=t.substr(i,2))throw"malformed PKCS8 public key(code:001)";var r=ASN1HEX.getPosArrayOfChildren_AtObj(t,i);if(2!=r.length)throw"malformed PKCS8 public key(code:002)";if("06"!=t.substr(r[0],2))throw"malformed PKCS8 public key(code:003)";if(e.algoid=ASN1HEX.getHexOfV_AtObj(t,r[0]),"06"==t.substr(r[1],2)?e.algparam=ASN1HEX.getHexOfV_AtObj(t,r[1]):"30"==t.substr(r[1],2)&&(e.algparam={},e.algparam.p=ASN1HEX.getVbyList(t,r[1],[0],"02"),e.algparam.q=ASN1HEX.getVbyList(t,r[1],[1],"02"),e.algparam.g=ASN1HEX.getVbyList(t,r[1],[2],"02")),"03"!=t.substr(n[1],2))throw"malformed PKCS8 public key(code:004)";return e.key=ASN1HEX.getHexOfV_AtObj(t,n[1]).substr(2),e},getRSAKeyFromPublicPKCS8Hex:function(t){var e=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(2!=e.length)throw"outer DERSequence shall have 2 elements: "+e.length;var n=ASN1HEX.getHexOfTLV_AtObj(t,e[0]);if("300d06092a864886f70d0101010500"!=n)throw"PKCS8 AlgorithmId is not rsaEncryption";if("03"!=t.substr(e[1],2))throw"PKCS8 Public Key is not BITSTRING encapslated.";var i=ASN1HEX.getStartPosOfV_AtObj(t,e[1])+2;if("30"!=t.substr(i,2))throw"PKCS8 Public Key is not SEQUENCE.";var r=ASN1HEX.getPosArrayOfChildren_AtObj(t,i);if(2!=r.length)throw"inner DERSequence shall have 2 elements: "+r.length;if("02"!=t.substr(r[0],2))throw"N is not ASN.1 INTEGER";if("02"!=t.substr(r[1],2))throw"E is not ASN.1 INTEGER";var s=ASN1HEX.getHexOfV_AtObj(t,r[0]),a=ASN1HEX.getHexOfV_AtObj(t,r[1]),o=new RSAKey;return o.setPublic(s,a),o}}}();KEYUTIL.getKey=function(t,e,n){if("undefined"!=typeof RSAKey&&t instanceof RSAKey)return t;if("undefined"!=typeof KJUR.crypto.ECDSA&&t instanceof KJUR.crypto.ECDSA)return t;if("undefined"!=typeof KJUR.crypto.DSA&&t instanceof KJUR.crypto.DSA)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new KJUR.crypto.ECDSA({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new KJUR.crypto.ECDSA({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d){var i=new RSAKey;return i.setPublic(t.n,t.e),i}if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi){var i=new RSAKey;return i.setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),i}if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p){var i=new RSAKey;return i.setPrivate(t.n,t.e,t.d),i}if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x){var i=new KJUR.crypto.DSA;return i.setPublic(t.p,t.q,t.g,t.y),i}if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x){var i=new KJUR.crypto.DSA;return i.setPrivate(t.p,t.q,t.g,t.y,t.x),i}if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d){var i=new RSAKey;return i.setPublic(b64utohex(t.n),b64utohex(t.e)),i}if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi){var i=new RSAKey;return i.setPrivateEx(b64utohex(t.n),b64utohex(t.e),b64utohex(t.d),b64utohex(t.p),b64utohex(t.q),b64utohex(t.dp),b64utohex(t.dq),b64utohex(t.qi)),
i}if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d){var i=new RSAKey;return i.setPrivate(b64utohex(t.n),b64utohex(t.e),b64utohex(t.d)),i}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var r=new KJUR.crypto.ECDSA({curve:t.crv}),s=r.ecparams.keylen/4,a=("0000000000"+b64utohex(t.x)).slice(-s),o=("0000000000"+b64utohex(t.y)).slice(-s),h="04"+a+o;return r.setPublicKeyHex(h),r}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){var r=new KJUR.crypto.ECDSA({curve:t.crv}),s=r.ecparams.keylen/4,u=("0000000000"+b64utohex(t.d)).slice(-s);return r.setPrivateKeyHex(u),r}if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return X509.getPublicKeyFromCertPEM(t);if("pkcs8pub"===n)return KEYUTIL.getKeyFromPublicPKCS8Hex(t);if(-1!=t.indexOf("-END PUBLIC KEY-"))return KEYUTIL.getKeyFromPublicPKCS8PEM(t);if("pkcs5prv"===n){var i=new RSAKey;return i.readPrivateKeyFromASN1HexString(t),i}if("pkcs5prv"===n){var i=new RSAKey;return i.readPrivateKeyFromASN1HexString(t),i}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var c=KEYUTIL.getHexFromPEM(t,"RSA PRIVATE KEY");return KEYUTIL.getKey(c,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var f=this.getHexFromPEM(t,"DSA PRIVATE KEY"),g=ASN1HEX.getVbyList(f,0,[1],"02"),l=ASN1HEX.getVbyList(f,0,[2],"02"),d=ASN1HEX.getVbyList(f,0,[3],"02"),p=ASN1HEX.getVbyList(f,0,[4],"02"),y=ASN1HEX.getVbyList(f,0,[5],"02"),i=new KJUR.crypto.DSA;return i.setPrivate(new BigInteger(g,16),new BigInteger(l,16),new BigInteger(d,16),new BigInteger(p,16),new BigInteger(y,16)),i}if(-1!=t.indexOf("-END PRIVATE KEY-"))return KEYUTIL.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED"))return KEYUTIL.getRSAKeyFromEncryptedPKCS5PEM(t,e);if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var f=KEYUTIL.getDecryptedKeyHex(t,e),i=ASN1HEX.getVbyList(f,0,[1],"04"),S=ASN1HEX.getVbyList(f,0,[2,0],"06"),A=ASN1HEX.getVbyList(f,0,[3,0],"03").substr(2),v="";if(void 0===KJUR.crypto.OID.oidhex2name[S])throw"undefined OID(hex) in KJUR.crypto.OID: "+S;v=KJUR.crypto.OID.oidhex2name[S];var r=new KJUR.crypto.ECDSA({name:v});return r.setPublicKeyHex(A),r.setPrivateKeyHex(i),r.isPublic=!1,r}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var f=KEYUTIL.getDecryptedKeyHex(t,e),g=ASN1HEX.getVbyList(f,0,[1],"02"),l=ASN1HEX.getVbyList(f,0,[2],"02"),d=ASN1HEX.getVbyList(f,0,[3],"02"),p=ASN1HEX.getVbyList(f,0,[4],"02"),y=ASN1HEX.getVbyList(f,0,[5],"02"),i=new KJUR.crypto.DSA;return i.setPrivate(new BigInteger(g,16),new BigInteger(l,16),new BigInteger(d,16),new BigInteger(p,16),new BigInteger(y,16)),i}if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return KEYUTIL.getKeyFromEncryptedPKCS8PEM(t,e);throw"not supported argument"},KEYUTIL.generateKeypair=function(t,e){if("RSA"==t){var n=e,i=new RSAKey;i.generate(n,"10001"),i.isPrivate=!0,i.isPublic=!0;var r=new RSAKey,s=i.n.toString(16),a=i.e.toString(16);r.setPublic(s,a),r.isPrivate=!1,r.isPublic=!0;var o={};return o.prvKeyObj=i,o.pubKeyObj=r,o}if("EC"==t){var h=e,u=new KJUR.crypto.ECDSA({curve:h}),c=u.generateKeyPairHex(),i=new KJUR.crypto.ECDSA({curve:h});i.setPrivateKeyHex(c.ecprvhex),i.isPrivate=!0,i.isPublic=!1;var r=new KJUR.crypto.ECDSA({curve:h});r.setPublicKeyHex(c.ecpubhex),r.isPrivate=!1,r.isPublic=!0;var o={};return o.prvKeyObj=i,o.pubKeyObj=r,o}throw"unknown algorithm: "+t},KEYUTIL.getPEM=function(t,e,n,i,r){function s(t){var e=KJUR.asn1.ASN1Util.newObject({seq:[{"int":0},{"int":{bigint:t.n}},{"int":t.e},{"int":{bigint:t.d}},{"int":{bigint:t.p}},{"int":{bigint:t.q}},{"int":{bigint:t.dmp1}},{"int":{bigint:t.dmq1}},{"int":{bigint:t.coeff}}]});return e}function a(t){var e=KJUR.asn1.ASN1Util.newObject({seq:[{"int":1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]});return e}function o(t){var e=KJUR.asn1.ASN1Util.newObject({seq:[{"int":0},{"int":{bigint:t.p}},{"int":{bigint:t.q}},{"int":{bigint:t.g}},{"int":{bigint:t.y}},{"int":{bigint:t.x}}]});return e}var h=KJUR.asn1,u=KJUR.crypto;if(("undefined"!=typeof RSAKey&&t instanceof RSAKey||"undefined"!=typeof u.DSA&&t instanceof u.DSA||"undefined"!=typeof u.ECDSA&&t instanceof u.ECDSA)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e)){var c=new KJUR.asn1.x509.SubjectPublicKeyInfo(t),f=c.getEncodedHex();return h.ASN1Util.getPEMStringFromHex(f,"PUBLIC KEY")}if("PKCS1PRV"==e&&"undefined"!=typeof RSAKey&&t instanceof RSAKey&&(void 0===n||null==n)&&1==t.isPrivate){var c=s(t),f=c.getEncodedHex();return h.ASN1Util.getPEMStringFromHex(f,"RSA PRIVATE KEY")}if("PKCS1PRV"==e&&"undefined"!=typeof RSAKey&&t instanceof KJUR.crypto.ECDSA&&(void 0===n||null==n)&&1==t.isPrivate){var g=new KJUR.asn1.DERObjectIdentifier({name:t.curveName}),l=g.getEncodedHex(),d=a(t),p=d.getEncodedHex(),y="";return y+=h.ASN1Util.getPEMStringFromHex(l,"EC PARAMETERS"),y+=h.ASN1Util.getPEMStringFromHex(p,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&"undefined"!=typeof KJUR.crypto.DSA&&t instanceof KJUR.crypto.DSA&&(void 0===n||null==n)&&1==t.isPrivate){var c=o(t),f=c.getEncodedHex();return h.ASN1Util.getPEMStringFromHex(f,"DSA PRIVATE KEY")}if("PKCS5PRV"==e&&"undefined"!=typeof RSAKey&&t instanceof RSAKey&&void 0!==n&&null!=n&&1==t.isPrivate){var c=s(t),f=c.getEncodedHex();return void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",f,n,i)}if("PKCS5PRV"==e&&"undefined"!=typeof KJUR.crypto.ECDSA&&t instanceof KJUR.crypto.ECDSA&&void 0!==n&&null!=n&&1==t.isPrivate){var c=a(t),f=c.getEncodedHex();return void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",f,n,i)}if("PKCS5PRV"==e&&"undefined"!=typeof KJUR.crypto.DSA&&t instanceof KJUR.crypto.DSA&&void 0!==n&&null!=n&&1==t.isPrivate){var c=o(t),f=c.getEncodedHex();return void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",f,n,i)}var S=function(t,e){var n=A(t,e),i=new KJUR.asn1.ASN1Util.newObject({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{"int":n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]});return i.getEncodedHex()},A=function(t,e){var n=100,i=CryptoJS.lib.WordArray.random(8),r="DES-EDE3-CBC",s=CryptoJS.lib.WordArray.random(8),a=CryptoJS.PBKDF2(e,i,{keySize:6,iterations:n}),o=CryptoJS.enc.Hex.parse(t),h=CryptoJS.TripleDES.encrypt(o,a,{iv:s})+"",u={};return u.ciphertext=h,u.pbkdf2Salt=CryptoJS.enc.Hex.stringify(i),u.pbkdf2Iter=n,u.encryptionSchemeAlg=r,u.encryptionSchemeIV=CryptoJS.enc.Hex.stringify(s),u};if("PKCS8PRV"==e&&"undefined"!=typeof RSAKey&&t instanceof RSAKey&&1==t.isPrivate){var v=s(t),m=v.getEncodedHex(),c=KJUR.asn1.ASN1Util.newObject({seq:[{"int":0},{seq:[{oid:{name:"rsaEncryption"}},{"null":!0}]},{octstr:{hex:m}}]}),f=c.getEncodedHex();if(void 0===n||null==n)return h.ASN1Util.getPEMStringFromHex(f,"PRIVATE KEY");var p=S(f,n);return h.ASN1Util.getPEMStringFromHex(p,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&"undefined"!=typeof KJUR.crypto.ECDSA&&t instanceof KJUR.crypto.ECDSA&&1==t.isPrivate){var v=new KJUR.asn1.ASN1Util.newObject({seq:[{"int":1},{octstr:{hex:t.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]}),m=v.getEncodedHex(),c=KJUR.asn1.ASN1Util.newObject({seq:[{"int":0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:m}}]}),f=c.getEncodedHex();if(void 0===n||null==n)return h.ASN1Util.getPEMStringFromHex(f,"PRIVATE KEY");var p=S(f,n);return h.ASN1Util.getPEMStringFromHex(p,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&"undefined"!=typeof KJUR.crypto.DSA&&t instanceof KJUR.crypto.DSA&&1==t.isPrivate){var v=new KJUR.asn1.DERInteger({bigint:t.x}),m=v.getEncodedHex(),c=KJUR.asn1.ASN1Util.newObject({seq:[{"int":0},{seq:[{oid:{name:"dsa"}},{seq:[{"int":{bigint:t.p}},{"int":{bigint:t.q}},{"int":{bigint:t.g}}]}]},{octstr:{hex:m}}]}),f=c.getEncodedHex();if(void 0===n||null==n)return h.ASN1Util.getPEMStringFromHex(f,"PRIVATE KEY");var p=S(f,n);return h.ASN1Util.getPEMStringFromHex(p,"ENCRYPTED PRIVATE KEY")}throw"unsupported object nor format"},KEYUTIL.getKeyFromCSRPEM=function(t){var e=KEYUTIL.getHexFromPEM(t,"CERTIFICATE REQUEST"),n=KEYUTIL.getKeyFromCSRHex(e);return n},KEYUTIL.getKeyFromCSRHex=function(t){var e=KEYUTIL.parseCSRHex(t),n=KEYUTIL.getKey(e.p8pubkeyhex,null,"pkcs8pub");return n},KEYUTIL.parseCSRHex=function(t){var e={},n=t;if("30"!=n.substr(0,2))throw"malformed CSR(code:001)";var i=ASN1HEX.getPosArrayOfChildren_AtObj(n,0);if(i.length<1)throw"malformed CSR(code:002)";if("30"!=n.substr(i[0],2))throw"malformed CSR(code:003)";var r=ASN1HEX.getPosArrayOfChildren_AtObj(n,i[0]);if(r.length<3)throw"malformed CSR(code:004)";return e.p8pubkeyhex=ASN1HEX.getHexOfTLV_AtObj(n,r[2]),e},RSAKey.prototype.readPrivateKeyFromPEMString=_rsapem_readPrivateKeyFromPEMString,RSAKey.prototype.readPrivateKeyFromASN1HexString=_rsapem_readPrivateKeyFromASN1HexString;var _RE_HEXDECONLY=new RegExp("");_RE_HEXDECONLY.compile("[^0-9a-f]","gi"),RSAKey.prototype.signWithMessageHash=_rsasign_signWithMessageHash,RSAKey.prototype.signString=_rsasign_signString,RSAKey.prototype.signStringWithSHA1=_rsasign_signStringWithSHA1,RSAKey.prototype.signStringWithSHA256=_rsasign_signStringWithSHA256,RSAKey.prototype.sign=_rsasign_signString,RSAKey.prototype.signWithSHA1=_rsasign_signStringWithSHA1,RSAKey.prototype.signWithSHA256=_rsasign_signStringWithSHA256,RSAKey.prototype.signWithMessageHashPSS=_rsasign_signWithMessageHashPSS,RSAKey.prototype.signStringPSS=_rsasign_signStringPSS,RSAKey.prototype.signPSS=_rsasign_signStringPSS,RSAKey.SALT_LEN_HLEN=-1,RSAKey.SALT_LEN_MAX=-2,RSAKey.prototype.verifyWithMessageHash=_rsasign_verifyWithMessageHash,RSAKey.prototype.verifyString=_rsasign_verifyString,RSAKey.prototype.verifyHexSignatureForMessage=_rsasign_verifyHexSignatureForMessage,RSAKey.prototype.verify=_rsasign_verifyString,RSAKey.prototype.verifyHexSignatureForByteArrayMessage=_rsasign_verifyHexSignatureForMessage,RSAKey.prototype.verifyWithMessageHashPSS=_rsasign_verifyWithMessageHashPSS,RSAKey.prototype.verifyStringPSS=_rsasign_verifyStringPSS,RSAKey.prototype.verifyPSS=_rsasign_verifyStringPSS,RSAKey.SALT_LEN_RECOVER=-2,X509.pemToBase64=function(t){var e=t;return e=e.replace("-----BEGIN CERTIFICATE-----",""),e=e.replace("-----END CERTIFICATE-----",""),e=e.replace(/[ \n]+/g,"")},X509.pemToHex=function(t){var e=X509.pemToBase64(t),n=b64tohex(e);return n},X509.getSubjectPublicKeyPosFromCertHex=function(t){var e=X509.getSubjectPublicKeyInfoPosFromCertHex(t);if(-1==e)return-1;var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,e);if(2!=n.length)return-1;var i=n[1];if("03"!=t.substring(i,i+2))return-1;var r=ASN1HEX.getStartPosOfV_AtObj(t,i);return"00"!=t.substring(r,r+2)?-1:r+2},X509.getSubjectPublicKeyInfoPosFromCertHex=function(t){var e=ASN1HEX.getStartPosOfV_AtObj(t,0),n=ASN1HEX.getPosArrayOfChildren_AtObj(t,e);return n.length<1?-1:"a003020102"==t.substring(n[0],n[0]+10)?n.length<6?-1:n[6]:n.length<5?-1:n[5]},X509.getPublicKeyHexArrayFromCertHex=function(t){var e=X509.getSubjectPublicKeyPosFromCertHex(t),n=ASN1HEX.getPosArrayOfChildren_AtObj(t,e);if(2!=n.length)return[];var i=ASN1HEX.getHexOfV_AtObj(t,n[0]),r=ASN1HEX.getHexOfV_AtObj(t,n[1]);return null!=i&&null!=r?[i,r]:[]},X509.getHexTbsCertificateFromCert=function(t){var e=ASN1HEX.getStartPosOfV_AtObj(t,0);return e},X509.getPublicKeyHexArrayFromCertPEM=function(t){var e=X509.pemToHex(t),n=X509.getPublicKeyHexArrayFromCertHex(e);return n},X509.hex2dn=function(t){for(var e="",n=ASN1HEX.getPosArrayOfChildren_AtObj(t,0),i=0;i<n.length;i++){var r=ASN1HEX.getHexOfTLV_AtObj(t,n[i]);e=e+"/"+X509.hex2rdn(r)}return e},X509.hex2rdn=function(t){var e=ASN1HEX.getDecendantHexTLVByNthList(t,0,[0,0]),n=ASN1HEX.getDecendantHexVByNthList(t,0,[0,1]),i="";try{i=X509.DN_ATTRHEX[e]}catch(r){i=e}n=n.replace(/(..)/g,"%$1");var s=decodeURIComponent(n);return i+"="+s},X509.DN_ATTRHEX={"0603550406":"C","060355040a":"O","060355040b":"OU","0603550403":"CN","0603550405":"SN","0603550408":"ST","0603550407":"L"},X509.getPublicKeyFromCertPEM=function(t){var e=X509.getPublicKeyInfoPropOfCertPEM(t);if("2a864886f70d010101"==e.algoid){var n=KEYUTIL.parsePublicRawRSAKeyHex(e.keyhex),i=new RSAKey;return i.setPublic(n.n,n.e),i}if("2a8648ce3d0201"==e.algoid){var r=KJUR.crypto.OID.oidhex2name[e.algparam],i=new KJUR.crypto.ECDSA({curve:r,info:e.keyhex});return i.setPublicKeyHex(e.keyhex),i}if("2a8648ce380401"==e.algoid){var s=ASN1HEX.getVbyList(e.algparam,0,[0],"02"),a=ASN1HEX.getVbyList(e.algparam,0,[1],"02"),o=ASN1HEX.getVbyList(e.algparam,0,[2],"02"),h=ASN1HEX.getHexOfV_AtObj(e.keyhex,0);h=h.substr(2);var i=new KJUR.crypto.DSA;return i.setPublic(new BigInteger(s,16),new BigInteger(a,16),new BigInteger(o,16),new BigInteger(h,16)),i}throw"unsupported key"},X509.getPublicKeyInfoPropOfCertPEM=function(t){var e={};e.algparam=null;var n=X509.pemToHex(t),i=ASN1HEX.getPosArrayOfChildren_AtObj(n,0);if(3!=i.length)throw"malformed X.509 certificate PEM (code:001)";if("30"!=n.substr(i[0],2))throw"malformed X.509 certificate PEM (code:002)";var r=ASN1HEX.getPosArrayOfChildren_AtObj(n,i[0]);if(r.length<7)throw"malformed X.509 certificate PEM (code:003)";var s=ASN1HEX.getPosArrayOfChildren_AtObj(n,r[6]);if(2!=s.length)throw"malformed X.509 certificate PEM (code:004)";var a=ASN1HEX.getPosArrayOfChildren_AtObj(n,s[0]);if(2!=a.length)throw"malformed X.509 certificate PEM (code:005)";if(e.algoid=ASN1HEX.getHexOfV_AtObj(n,a[0]),"06"==n.substr(a[1],2)?e.algparam=ASN1HEX.getHexOfV_AtObj(n,a[1]):"30"==n.substr(a[1],2)&&(e.algparam=ASN1HEX.getHexOfTLV_AtObj(n,a[1])),"03"!=n.substr(s[1],2))throw"malformed X.509 certificate PEM (code:006)";var o=ASN1HEX.getHexOfV_AtObj(n,s[1]);return e.keyhex=o.substr(2),e},X509.getPublicKeyInfoPosOfCertHEX=function(t){var e=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(3!=e.length)throw"malformed X.509 certificate PEM (code:001)";if("30"!=t.substr(e[0],2))throw"malformed X.509 certificate PEM (code:002)";var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,e[0]);if(n.length<7)throw"malformed X.509 certificate PEM (code:003)";return n[6]},X509.getV3ExtInfoListOfCertHex=function(t){var e=ASN1HEX.getPosArrayOfChildren_AtObj(t,0);if(3!=e.length)throw"malformed X.509 certificate PEM (code:001)";if("30"!=t.substr(e[0],2))throw"malformed X.509 certificate PEM (code:002)";var n=ASN1HEX.getPosArrayOfChildren_AtObj(t,e[0]);if(n.length<8)throw"malformed X.509 certificate PEM (code:003)";if("a3"!=t.substr(n[7],2))throw"malformed X.509 certificate PEM (code:004)";var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n[7]);if(1!=i.length)throw"malformed X.509 certificate PEM (code:005)";if("30"!=t.substr(i[0],2))throw"malformed X.509 certificate PEM (code:006)";for(var r=ASN1HEX.getPosArrayOfChildren_AtObj(t,i[0]),s=r.length,a=new Array(s),o=0;s>o;o++)a[o]=X509.getV3ExtItemInfo_AtObj(t,r[o]);return a},X509.getV3ExtItemInfo_AtObj=function(t,e){var n={};n.posTLV=e;var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,e);if(2!=i.length&&3!=i.length)throw"malformed X.509v3 Ext (code:001)";if("06"!=t.substr(i[0],2))throw"malformed X.509v3 Ext (code:002)";var r=ASN1HEX.getHexOfV_AtObj(t,i[0]);n.oid=ASN1HEX.hextooidstr(r),n.critical=!1,3==i.length&&(n.critical=!0);var s=i[i.length-1];if("04"!=t.substr(s,2))throw"malformed X.509v3 Ext (code:003)";return n.posV=ASN1HEX.getStartPosOfV_AtObj(t,s),n},X509.getHexOfTLV_V3ExtValue=function(t,e){var n=X509.getPosOfTLV_V3ExtValue(t,e);return-1==n?null:ASN1HEX.getHexOfTLV_AtObj(t,n)},X509.getHexOfV_V3ExtValue=function(t,e){var n=X509.getPosOfTLV_V3ExtValue(t,e);return-1==n?null:ASN1HEX.getHexOfV_AtObj(t,n)},X509.getPosOfTLV_V3ExtValue=function(t,e){var n=e;if(e.match(/^[0-9.]+$/)||(n=KJUR.asn1.x509.OID.name2oid(e)),""==n)return-1;for(var i=X509.getV3ExtInfoListOfCertHex(t),r=0;r<i.length;r++){var s=i[r];if(s.oid==n)return s.posV}return-1},X509.getExtBasicConstraints=function(t){var e=X509.getHexOfV_V3ExtValue(t,"basicConstraints");if(null===e)return null;if(""===e)return{};if("0101ff"===e)return{cA:!0};if("0101ff02"===e.substr(0,8)){var n=ASN1HEX.getHexOfV_AtObj(e,6),i=parseInt(n,16);return{cA:!0,pathLen:i}}throw"unknown error"},X509.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],X509.getExtKeyUsageBin=function(t){var e=X509.getHexOfV_V3ExtValue(t,"keyUsage");if(""==e)return"";if(e.length%2!=0||e.length<=2)throw"malformed key usage value";var n=parseInt(e.substr(0,2)),i=parseInt(e.substr(2),16).toString(2);return i.substr(0,i.length-n)},X509.getExtKeyUsageString=function(t){for(var e=X509.getExtKeyUsageBin(t),n=new Array,i=0;i<e.length;i++)"1"==e.substr(i,1)&&n.push(X509.KEYUSAGE_NAME[i]);return n.join(",")},X509.getExtAIAInfo=function(t){var e={};e.ocsp=[],e.caissuer=[];var n=X509.getPosOfTLV_V3ExtValue(t,"authorityInfoAccess");if(-1==n)return null;if("30"!=t.substr(n,2))throw"malformed AIA Extn Value";for(var i=ASN1HEX.getPosArrayOfChildren_AtObj(t,n),r=0;r<i.length;r++){var s=i[r],a=ASN1HEX.getPosArrayOfChildren_AtObj(t,s);if(2!=a.length)throw"malformed AccessDescription of AIA Extn";var o=a[0],h=a[1];"2b06010505073001"==ASN1HEX.getHexOfV_AtObj(t,o)&&"86"==t.substr(h,2)&&e.ocsp.push(hextoutf8(ASN1HEX.getHexOfV_AtObj(t,h))),"2b06010505073002"==ASN1HEX.getHexOfV_AtObj(t,o)&&"86"==t.substr(h,2)&&e.caissuer.push(hextoutf8(ASN1HEX.getHexOfV_AtObj(t,h)))}return e},X509.getSignatureAlgorithmName=function(t){var e=ASN1HEX.getDecendantHexVByNthList(t,0,[1,0]),n=KJUR.asn1.ASN1Util.oidHexToInt(e),i=KJUR.asn1.x509.OID.oid2name(n);return i},X509.getSignatureValueHex=function(t){var e=ASN1HEX.getDecendantHexVByNthList(t,0,[2]);if("00"!==e.substr(0,2))throw"can't get signature value";return e.substr(2)},X509.getSerialNumberHex=function(t){return ASN1HEX.getDecendantHexVByNthList(t,0,[0,1])},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.jws&&KJUR.jws||(KJUR.jws={}),KJUR.jws.JWS=function(){var t=KJUR.jws.JWS;this.parseJWS=function(e,n){if(void 0===this.parsedJWS||!n&&void 0===this.parsedJWS.sigvalH){if(null==e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/))throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=RegExp.$1,r=RegExp.$2,s=RegExp.$3,a=i+"."+r;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=r,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,!n){var o=b64utohex(s),h=parseBigInt(o,16);this.parsedJWS.sigvalH=o,this.parsedJWS.sigvalBI=h}var u=b64utoutf8(i),c=b64utoutf8(r);if(this.parsedJWS.headS=u,this.parsedJWS.payloadS=c,!t.isSafeJSONString(u,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+u}}},KJUR.jws.JWS.sign=function(t,e,n,i,r){var s,a,o,h=KJUR.jws.JWS;if("string"!=typeof e&&"object"!=typeof e)throw"spHeader must be JSON string or object: "+e;if("object"==typeof e&&(a=e,s=JSON.stringify(a)),"string"==typeof e){if(s=e,!h.isSafeJSONString(s))throw"JWS Head is not safe JSON string: "+s;a=h.readSafeJSONString(s)}if(o=n,"object"==typeof n&&(o=JSON.stringify(n)),""!=t&&null!=t||void 0===a.alg||(t=a.alg),""!=t&&null!=t&&void 0===a.alg&&(a.alg=t,s=JSON.stringify(a)),t!==a.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+a.alg;var u=null;if(void 0===h.jwsalg2sigalg[t])throw"unsupported alg name: "+t;u=h.jwsalg2sigalg[t];var c=utf8tob64u(s),f=utf8tob64u(o),g=c+"."+f,l="";if("Hmac"==u.substr(0,4)){if(void 0===i)throw"mac key shall be specified for HS* alg";var d=new KJUR.crypto.Mac({alg:u,prov:"cryptojs",pass:i});d.updateString(g),l=d.doFinal()}else if(-1!=u.indexOf("withECDSA")){var p=new KJUR.crypto.Signature({alg:u});p.init(i,r),p.updateString(g),hASN1Sig=p.sign(),l=KJUR.crypto.ECDSA.asn1SigToConcatSig(hASN1Sig)}else if("none"!=u){var p=new KJUR.crypto.Signature({alg:u});p.init(i,r),p.updateString(g),l=p.sign()}var y=hextob64u(l);return g+"."+y},KJUR.jws.JWS.verify=function(t,e,n){var i=KJUR.jws.JWS,r=t.split("."),s=r[0],a=r[1],o=s+"."+a,h=b64utohex(r[2]),u=i.readSafeJSONString(b64utoutf8(r[0])),c=null,f=null;if(void 0===u.alg)throw"algorithm not specified in header";if(c=u.alg,f=c.substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0){var g=":"+n.join(":")+":";if(-1==g.indexOf(":"+c+":"))throw"algorithm '"+c+"' not accepted in the list"}if("none"!=c&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=KEYUTIL.getKey(e)),!("RS"!=f&&"PS"!=f||e instanceof RSAKey))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==f&&!(e instanceof KJUR.crypto.ECDSA))throw"key shall be a ECDSA obj for ES* algs";var l=null;if(void 0===i.jwsalg2sigalg[u.alg])throw"unsupported alg name: "+c;if(l=i.jwsalg2sigalg[c],"none"==l)throw"not supported";if("Hmac"==l.substr(0,4)){var d=null;if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var p=new KJUR.crypto.Mac({alg:l,pass:e});return p.updateString(o),d=p.doFinal(),h==d}if(-1!=l.indexOf("withECDSA")){var y=null;try{y=KJUR.crypto.ECDSA.concatSigToASN1Sig(h)}catch(S){return!1}var A=new KJUR.crypto.Signature({alg:l});return A.init(e),A.updateString(o),A.verify(y)}var A=new KJUR.crypto.Signature({alg:l});return A.init(e),A.updateString(o),A.verify(h)},KJUR.jws.JWS.parse=function(t){var e,n,i,r=t.split("."),s={};if(2!=r.length&&3!=r.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=r[0],n=r[1],3==r.length&&(i=r[2]),s.headerObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(e)),s.payloadObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(n)),s.headerPP=JSON.stringify(s.headerObj,null," "),null==s.payloadObj?s.payloadPP=b64utoutf8(n):s.payloadPP=JSON.stringify(s.payloadObj,null," "),void 0!==i&&(s.sigHex=b64utohex(i)),s},KJUR.jws.JWS.verifyJWT=function(t,e,n){var i=KJUR.jws.JWS,r=t.split("."),s=r[0],a=r[1],o=(b64utohex(r[2]),i.readSafeJSONString(b64utoutf8(s))),h=i.readSafeJSONString(b64utoutf8(a));if(void 0===o.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!i.inArray(o.alg,n.alg))return!1;if(void 0!==h.iss&&"object"==typeof n.iss&&!i.inArray(h.iss,n.iss))return!1;if(void 0!==h.sub&&"object"==typeof n.sub&&!i.inArray(h.sub,n.sub))return!1;if(void 0!==h.aud&&"object"==typeof n.aud)if("string"==typeof h.aud){if(!i.inArray(h.aud,n.aud))return!1}else if("object"==typeof h.aud&&!i.includedArray(h.aud,n.aud))return!1;var u=KJUR.jws.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(u=n.verifyAt),void 0!==h.exp&&"number"==typeof h.exp&&h.exp<u?!1:void 0!==h.nbf&&"number"==typeof h.nbf&&u<h.nbf?!1:void 0!==h.iat&&"number"==typeof h.iat&&u<h.iat?!1:void 0!==h.jti&&void 0!==n.jti&&h.jti!==n.jti?!1:!!KJUR.jws.JWS.verify(t,e,n.alg)},KJUR.jws.JWS.includedArray=function(t,e){var n=KJUR.jws.JWS.inArray;if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var i=0;i<t.length;i++)if(!n(t[i],e))return!1;return!0},KJUR.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var n=0;n<e.length;n++)if(e[n]==t)return!0;return!1},KJUR.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},KJUR.jws.JWS.isSafeJSONString=function(t,e,n){var i=null;try{return i=jsonParse(t),"object"!=typeof i?0:i.constructor===Array?0:(e&&(e[n]=i),1)}catch(r){return 0}},KJUR.jws.JWS.readSafeJSONString=function(t){var e=null;try{return e=jsonParse(t),"object"!=typeof e?null:e.constructor===Array?null:e}catch(n){return null}},KJUR.jws.JWS.getEncodedSignatureValueFromJWS=function(t){if(null==t.match(/^[^.]+\.[^.]+\.([^.]+)$/))throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return RegExp.$1},KJUR.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var n=rstrtohex(e),i=KJUR.crypto.Util.hashHex(n,"sha256"),r=hextob64u(i);return r},KJUR.jws.IntDate={},KJUR.jws.IntDate.get=function(t){if("now"==t)return KJUR.jws.IntDate.getNow();if("now + 1hour"==t)return KJUR.jws.IntDate.getNow()+3600;if("now + 1day"==t)return KJUR.jws.IntDate.getNow()+86400;if("now + 1month"==t)return KJUR.jws.IntDate.getNow()+2592e3;if("now + 1year"==t)return KJUR.jws.IntDate.getNow()+31536e3;if(t.match(/Z$/))return KJUR.jws.IntDate.getZulu(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},KJUR.jws.IntDate.getZulu=function(t){var e;if(e=t.match(/(\d+)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)Z/)){var n=RegExp.$1,i=parseInt(n);if(4==n.length);else{if(2!=n.length)throw"malformed year string";if(i>=50&&100>i)i=1900+i;else{if(!(i>=0&&50>i))throw"malformed year string for UTCTime";i=2e3+i}}var r=parseInt(RegExp.$2)-1,s=parseInt(RegExp.$3),a=parseInt(RegExp.$4),o=parseInt(RegExp.$5),h=parseInt(RegExp.$6),u=new Date(Date.UTC(i,r,s,a,o,h));return~~(u/1e3)}throw"unsupported format: "+t},KJUR.jws.IntDate.getNow=function(){var t=~~(new Date/1e3);return t},KJUR.jws.IntDate.intDate2UTCString=function(t){var e=new Date(1e3*t);return e.toUTCString()},KJUR.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t),n=("0000"+e.getUTCFullYear()).slice(-4),i=("00"+(e.getUTCMonth()+1)).slice(-2),r=("00"+e.getUTCDate()).slice(-2),s=("00"+e.getUTCHours()).slice(-2),a=("00"+e.getUTCMinutes()).slice(-2),o=("00"+e.getUTCSeconds()).slice(-2);return n+i+r+s+a+o+"Z"},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.jws&&KJUR.jws||(KJUR.jws={}),KJUR.jws.JWSJS=function(){var t=KJUR.jws.JWS;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload="",this.aSignature=[]},this.initWithJWS=function(t){this.init();var e=new KJUR.jws.JWS;e.parseJWS(t),this.aHeader.push(e.parsedJWS.headB64U),this.sPayload=e.parsedJWS.payloadB64U,this.aSignature.push(e.parsedJWS.sigvalB64U)},this.addSignatureByHeaderKey=function(t,e){var n=b64utoutf8(this.sPayload),i=new KJUR.jws.JWS;i.generateJWSByP1PrvKey(t,n,e);this.aHeader.push(i.parsedJWS.headB64U),this.aSignature.push(i.parsedJWS.sigvalB64U)},this.addSignatureByHeaderPayloadKey=function(t,e,n){var i=new KJUR.jws.JWS;i.generateJWSByP1PrvKey(t,e,n);this.aHeader.push(i.parsedJWS.headB64U),this.sPayload=i.parsedJWS.payloadB64U,this.aSignature.push(i.parsedJWS.sigvalB64U)},this.verifyWithCerts=function(t){if(this.aHeader.length!=t.length)throw"num headers does not match with num certs";if(this.aSignature.length!=t.length)throw"num signatures does not match with num certs";for(var e=this.sPayload,n="",i=0;i<t.length;i++){var r=t[i],s=this.aHeader[i],a=this.aSignature[i],o=s+"."+e+"."+a,h=new KJUR.jws.JWS;try{var u=h.verifyJWSByPemX509Cert(o,r);1!=u&&(n+=i+1+"th signature unmatch. ")}catch(c){n+=i+1+"th signature fail("+c+"). "}}if(""==n)return 1;throw n},this.readJWSJS=function(e){var n=t.readSafeJSONString(e);if(null==n)throw"argument is not JSON string: "+e;this.aHeader=n.headers,this.sPayload=n.payload,this.aSignature=n.signatures},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},exports.SecureRandom=SecureRandom,exports.rng_seed_time=rng_seed_time,exports.BigInteger=BigInteger,exports.RSAKey=RSAKey,exports.ECDSA=KJUR.crypto.ECDSA,exports.DSA=KJUR.crypto.DSA,exports.Signature=KJUR.crypto.Signature,exports.MessageDigest=KJUR.crypto.MessageDigest,exports.Mac=KJUR.crypto.Mac,exports.KEYUTIL=KEYUTIL,exports.ASN1HEX=ASN1HEX,exports.X509=X509,exports.CryptoJS=CryptoJS,exports.b64tohex=b64tohex,exports.b64toBA=b64toBA,exports.stoBA=stoBA,exports.BAtos=BAtos,exports.BAtohex=BAtohex,exports.stohex=stohex,exports.stob64=stob64,exports.stob64u=stob64u,exports.b64utos=b64utos,exports.b64tob64u=b64tob64u,exports.b64utob64=b64utob64,exports.hex2b64=hex2b64,exports.hextob64u=hextob64u,exports.b64utohex=b64utohex,exports.b64tohex=b64tohex,exports.utf8tob64u=utf8tob64u,exports.b64utoutf8=b64utoutf8,exports.utf8tob64=utf8tob64,exports.b64toutf8=b64toutf8,exports.utf8tohex=utf8tohex,exports.hextoutf8=hextoutf8,exports.hextorstr=hextorstr,exports.rstrtohex=rstrtohex,exports.newline_toUnix=newline_toUnix,exports.newline_toDos=newline_toDos,exports.intarystrtohex=intarystrtohex,exports.strdiffidx=strdiffidx,exports.crypto=KJUR.crypto,exports.asn1=KJUR.asn1,exports.jws=KJUR.jws,exports.readFileUTF8=readFileUTF8,exports.readFileHexByBin=readFileHexByBin,exports.readFile=readFile,exports.saveFile=saveFile,exports.saveFileBinByHex=saveFileBinByHex;
//# sourceMappingURL=jsrsasign.min.js.map | Amomo/cdnjs | ajax/libs/jsrsasign/5.0.9/jsrsasign.min.js | JavaScript | mit | 253,784 |
'use strict';
// alias for cljs runtime
var window = this;
var log = [];
// intercept and collect console calls from within ClojureScript source
console.log = function() {
log.push({ sev: 'log', args: toArgsStr(arguments) });
};
console.error = function() {
log.push({ sev: 'error', args: toArgsStr(arguments) });
};
var consoleSev = {
log: function(args) {
return 'console.log("' + args + '");';
},
error: function(args) {
return 'console.error("' + args + '");';
}
};
function toArgsStr(args) {
return Array.prototype.slice.call(args).join(',');
}
function appendLog(result) {
return '(function(){' +
log.map(function(l) { return consoleSev[l.sev](l.args); }).join('') +
'})();';
}
function resetNS(code) {
return '(ns cljs.user)' + code;
}
onmessage = function(event) {
// load self-hoasted ClojureScript
if (event.data.name === 'cljs') {
importScripts(event.data.path);
postMessage({ name: 'ready' });
}
// evaluate code
if (event.data.name === 'eval') {
jsbin_cljs.core.eval_expr(resetNS(event.data.code), function(err, result) {
cljs.user = null;
if (err) {
log = [];
throw Error(err);
} else {
postMessage({ name: 'eval', result: appendLog(eval(result)) });
log = []; // reset collected log
}
});
}
}
| AverageMarcus/jsbin | public/js/workers/cljs-worker.js | JavaScript | mit | 1,347 |
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Bundle\CurrencyBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusCurrencyBundleTest extends WebTestCase
{
/**
* @test
*/
public function its_services_are_initializable(): void
{
/** @var ContainerBuilder $container */
$container = self::createClient()->getContainer();
$services = $container->getServiceIds();
$services = array_filter($services, function (string $serviceId): bool {
return 0 === strpos($serviceId, 'sylius.');
});
foreach ($services as $id) {
Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE));
}
}
}
| itinance/Sylius | src/Sylius/Bundle/CurrencyBundle/test/src/Tests/SyliusCurrencyBundleTest.php | PHP | mit | 1,119 |
/*!
* Vue Material v0.7.2
* Made with love by Marcos Moura
* Released under the MIT License.
*/
!(function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueMaterial=e():t.VueMaterial=e()})(this,(function(){return (function(t){function e(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=476)})({0:function(t,e){t.exports=function(t,e,n,i,a){var r,o=t=t||{},s=typeof t.default;"object"!==s&&"function"!==s||(r=t,o=t.default);var c="function"==typeof o?o.options:o;e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns),i&&(c._scopeId=i);var u;if(a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):n&&(u=n),u){var d=c.functional,l=d?c.render:c.beforeCreate;d?c.render=function(t,e){return u.call(e),l(t,e)}:c.beforeCreate=l?[].concat(l,u):[u]}return{esModule:r,exports:o,options:c}}},1:function(t,e,n){"use strict";function i(t){if(!t)return null;var e=t.mdTheme;return e||"md-theme"!==t.$options._componentTag||(e=t.mdName),e||i(t.$parent)}Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{mdTheme:String},computed:{mdEffectiveTheme:function(){return i(this)||this.$material.currentTheme},themeClass:function(){return this.$material.prefix+this.mdEffectiveTheme}},watch:{mdTheme:function(t){this.$material.useTheme(t)}},beforeMount:function(){var t=this.mdTheme;this.$material.useTheme(t?t:"default")}},t.exports=e.default},10:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function t(e,n){return!(!e||!e.$el)&&(0!==e._uid&&(e.$el.classList.contains(n)?e:t(e.$parent,n)))};e.default=i,t.exports=e.default},11:function(t,e,n){var i=n(9),a=n(17);t.exports=n(3)?function(t,e,n){return i.f(t,e,a(1,n))}:function(t,e,n){return t[e]=n,t}},110:function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function a(t){t.component("md-tabs",o.default),t.component("md-tab",c.default),t.material.styles.push(d.default)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var r=n(365),o=i(r),s=n(364),c=i(s),u=n(292),d=i(u);t.exports=e.default},12:function(t,e,n){var i=n(22)("wks"),a=n(20),r=n(2).Symbol,o="function"==typeof r,s=t.exports=function(t){return i[t]||(i[t]=o&&r[t]||(o?r:a)("Symbol."+t))};s.store=i},13:function(t,e,n){var i=n(6);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},14:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},15:function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},16:function(t,e,n){var i=n(2),a=n(4),r=n(28),o=n(11),s="prototype",c=function(t,e,n){var u,d,l,f=t&c.F,h=t&c.G,b=t&c.S,m=t&c.P,v=t&c.B,p=t&c.W,g=h?a:a[e]||(a[e]={}),T=g[s],_=h?i:b?i[e]:(i[e]||{})[s];h&&(n=e);for(u in n)d=!f&&_&&void 0!==_[u],d&&u in g||(l=d?_[u]:n[u],g[u]=h&&"function"!=typeof _[u]?n[u]:v&&d?r(l,i):p&&_[u]==l?(function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e[s]=t[s],e})(l):m&&"function"==typeof l?r(Function.call,l):l,m&&((g.virtual||(g.virtual={}))[u]=l,t&c.R&&T&&!T[u]&&o(T,u,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},17:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},18:function(t,e,n){var i=n(31),a=n(21);t.exports=Object.keys||function(t){return i(t,a)}},19:function(t,e,n){var i=n(22)("keys"),a=n(20);t.exports=function(t){return i[t]||(i[t]=a(t))}},195:function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=n(36),r=i(a),o=n(10),s=i(o);e.default={name:"md-tab",props:{id:[String,Number],mdLabel:[String,Number],mdIcon:String,mdActive:Boolean,mdDisabled:Boolean,mdOptions:{default:void 0},mdTooltip:String,mdTooltipDelay:{type:String,default:"0"},mdTooltipDirection:{type:String,default:"bottom"}},data:function(){return{mounted:!1,tabId:this.id||"tab-"+(0,r.default)(),width:"0px",left:"0px"}},watch:{mdActive:function(){this.updateTabData()},mdDisabled:function(){this.updateTabData()},mdIcon:function(){this.updateTabData()},mdOptions:{deep:!0,handler:function(){this.updateTabData()}},mdLabel:function(){this.updateTabData()},mdTooltip:function(){this.updateTabData()},mdTooltipDelay:function(){this.updateTabData()},mdTooltipDirection:function(){this.updateTabData()}},computed:{styles:function(){return{width:this.width,left:this.left}}},methods:{getTabData:function(){return{id:this.tabId,label:this.mdLabel,icon:this.mdIcon,options:this.mdOptions,active:this.mdActive,disabled:this.mdDisabled,tooltip:this.mdTooltip,tooltipDelay:this.mdTooltipDelay,tooltipDirection:this.mdTooltipDirection,ref:this}},updateTabData:function(){this.parentTabs.updateTab(this.getTabData())}},mounted:function(){var t=this.getTabData();if(this.parentTabs=(0,s.default)(this.$parent,"md-tabs"),!this.parentTabs)throw new Error("You must wrap the md-tab in a md-tabs");this.mounted=!0,this.parentTabs.updateTab(t),this.mdActive&&this.parentTabs.setActiveTab(t)},beforeDestroy:function(){this.parentTabs.unregisterTab(this.getTabData())}},t.exports=e.default},196:function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=n(38),r=i(a),o=n(202),s=i(o),c=n(1),u=i(c),d=n(50),l=i(d);e.default={name:"md-tabs",props:{mdFixed:Boolean,mdCentered:Boolean,mdRight:Boolean,mdNavigation:{type:Boolean,default:!0},mdDynamicHeight:{type:Boolean,default:!0},mdElevation:{type:[String,Number],default:0}},mixins:[u.default],data:function(){return{tabList:{},activeTab:null,activeTabNumber:0,hasIcons:!1,hasLabel:!1,hasNavigationScroll:!1,isNavigationOnStart:!0,isNavigationOnEnd:!1,transitionControl:null,transitionOff:!1,contentHeight:"0px",contentWidth:"0px"}},computed:{tabClasses:function(){return{"md-dynamic-height":this.mdDynamicHeight,"md-transition-off":this.transitionOff}},navigationClasses:function(){return{"md-has-icon":this.hasIcons,"md-has-label":this.hasLabel,"md-fixed":this.mdFixed,"md-right":!this.mdCentered&&this.mdRight,"md-centered":this.mdCentered||this.mdFixed,"md-has-navigation-scroll":this.hasNavigationScroll}},indicatorClasses:function(){var t=this.lastIndicatorNumber>this.activeTabNumber;return this.lastIndicatorNumber=this.activeTabNumber,{"md-transition-off":this.transitionOff,"md-to-right":!t,"md-to-left":t}},navigationLeftButtonClasses:function(){return{"md-disabled":this.isNavigationOnStart}},navigationRightButtonClasses:function(){return{"md-disabled":this.isNavigationOnEnd}}},methods:{getHeaderClass:function(t){return{"md-active":this.activeTab===t.id,"md-disabled":t.disabled}},registerTab:function(t){var e=!1,n=!0,i=!1,a=void 0;try{for(var o,c=(0,s.default)((0,r.default)(this.tabList));!(n=(o=c.next()).done);n=!0){var u=o.value;if(this.tabList[u].active){e=!0;break}}}catch(t){i=!0,a=t}finally{try{!n&&c.return&&c.return()}finally{if(i)throw a}}this.$set(this.tabList,t.id,t),e||(this.tabList[t.id].active=!0)},unregisterTab:function(t){this.$delete(this.tabList,t.id)},updateTab:function(t){if(this.registerTab(t),t.active)if(t.disabled){if((0,r.default)(this.tabList).length){var e=(0,r.default)(this.tabList),n=e.indexOf(t.id)+1,i=e[n];i?this.setActiveTab(this.tabList[i]):this.setActiveTab(this.tabList[0])}}else this.setActiveTab(t)},observeElementChanges:function(){this.parentObserver=new MutationObserver((0,l.default)(this.calculateOnWatch,50)),this.parentObserver.observe(this.$refs.tabContent,{childList:!0,attributes:!0,subtree:!0})},getTabIndex:function(t){var e=(0,r.default)(this.tabList);return e.indexOf(t)},calculateIndicatorPos:function(){if(this.$refs.tabHeader&&this.$refs.tabHeader[this.activeTabNumber]){var t=this.$el.offsetWidth,e=this.$refs.tabHeader[this.activeTabNumber],n=e.offsetLeft-this.$refs.tabsContainer.scrollLeft,i=t-n-e.offsetWidth;this.$refs.indicator.style.left=n+"px",this.$refs.indicator.style.right=i+"px"}},calculateTabsWidthAndPosition:function(){var t=this.$el.offsetWidth,e=0;this.contentWidth=t*this.activeTabNumber+"px";for(var n in this.tabList){var i=this.tabList[n];i.ref.width=t+"px",i.ref.left=t*e+"px",e++}},calculateContentHeight:function(){var t=this;this.$nextTick((function(){if((0,r.default)(t.tabList).length){var e=t.tabList[t.activeTab].ref.$el.offsetHeight;t.contentHeight=e+"px"}}))},calculatePosition:function(){var t=this;window.requestAnimationFrame((function(){t.calculateIndicatorPos(),t.calculateTabsWidthAndPosition(),t.calculateContentHeight(),t.checkNavigationScroll()}))},debounceTransition:function(){var t=this;window.clearTimeout(this.transitionControl),this.transitionControl=window.setTimeout((function(){t.calculatePosition(),t.transitionOff=!1}),200)},calculateOnWatch:function(){this.calculatePosition(),this.debounceTransition()},calculateOnResize:function(){this.transitionOff=!0,this.calculateOnWatch()},calculateScrollPos:function(){var t=this.$refs.tabsContainer,e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;this.isNavigationOnStart=e<32,this.isNavigationOnEnd=n-e-32<i},handleNavigationScroll:function(){var t=this;window.requestAnimationFrame((function(){t.calculateIndicatorPos(),t.calculateScrollPos()}))},checkNavigationScroll:function(){var t=this.$refs.tabsContainer,e=t.scrollWidth,n=t.clientWidth;this.hasNavigationScroll=e>n},setActiveTab:function(t){this.hasIcons=!!t.icon,this.hasLabel=!!t.label,this.activeTab=t.id,this.activeTabNumber=this.getTabIndex(this.activeTab),this.calculatePosition(),this.$emit("change",this.activeTabNumber)},navigationScrollLeft:function(){var t=this.$refs.tabsContainer,e=t.scrollLeft,n=t.clientWidth;this.$refs.tabsContainer.scrollLeft=Math.max(0,e-n)},navigationScrollRight:function(){var t=this.$refs.tabsContainer,e=t.scrollLeft,n=t.clientWidth,i=t.scrollWidth;this.$refs.tabsContainer.scrollLeft=Math.min(i,e+n)}},mounted:function(){var t=this;this.$nextTick((function(){if(t.observeElementChanges(),window.addEventListener("resize",t.calculateOnResize),(0,r.default)(t.tabList).length&&!t.activeTab){var e=(0,r.default)(t.tabList)[0];t.setActiveTab(t.tabList[e])}}))},beforeDestroy:function(){this.parentObserver&&this.parentObserver.disconnect(),window.removeEventListener("resize",this.calculateOnResize)}},t.exports=e.default},2:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},20:function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},202:function(t,e,n){t.exports={default:n(210),__esModule:!0}},21:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},210:function(t,e,n){n(68),n(49),t.exports=n(221)},22:function(t,e,n){var i=n(2),a="__core-js_shared__",r=i[a]||(i[a]={});t.exports=function(t){return r[t]||(r[t]={})}},221:function(t,e,n){var i=n(13),a=n(57);t.exports=n(4).getIterator=function(t){var e=a(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return i(e.call(t))}},23:function(t,e,n){var i=n(14);t.exports=function(t){return Object(i(t))}},24:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},241:function(t,e){},25:function(t,e,n){var i=n(6),a=n(2).document,r=i(a)&&i(a.createElement);t.exports=function(t){return r?a.createElement(t):{}}},26:function(t,e,n){var i=n(24);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},27:function(t,e,n){var i=n(6);t.exports=function(t,e){if(!i(t))return t;var n,a;if(e&&"function"==typeof(n=t.toString)&&!i(a=n.call(t)))return a;if("function"==typeof(n=t.valueOf)&&!i(a=n.call(t)))return a;if(!e&&"function"==typeof(n=t.toString)&&!i(a=n.call(t)))return a;throw TypeError("Can't convert object to primitive value")}},28:function(t,e,n){var i=n(33);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,a){return t.call(e,n,i,a)}}return function(){return t.apply(e,arguments)}}},29:function(t,e,n){var i=n(15),a=Math.min;t.exports=function(t){return t>0?a(i(t),9007199254740991):0}},292:function(t,e){t.exports=".THEME_NAME.md-tabs>.md-tabs-navigation{background-color:PRIMARY-COLOR}.THEME_NAME.md-tabs>.md-tabs-navigation .md-tab-header{color:PRIMARY-CONTRAST-0.54}.THEME_NAME.md-tabs>.md-tabs-navigation .md-tab-header.md-active,.THEME_NAME.md-tabs>.md-tabs-navigation .md-tab-header:focus{color:PRIMARY-CONTRAST}.THEME_NAME.md-tabs>.md-tabs-navigation .md-tab-header.md-disabled{color:PRIMARY-CONTRAST-0.26}.THEME_NAME.md-tabs>.md-tabs-navigation .md-tab-indicator{background-color:ACCENT-COLOR}.THEME_NAME.md-tabs>.md-tabs-navigation .md-tab-header-navigation-button{color:PRIMARY-CONTRAST-0.54;background-color:PRIMARY-COLOR}.THEME_NAME.md-tabs.md-transparent>.md-tabs-navigation{background-color:transparent;border-bottom:1px solid BACKGROUND-CONTRAST-0.12}.THEME_NAME.md-tabs.md-transparent>.md-tabs-navigation .md-tab-header{color:BACKGROUND-CONTRAST-0.54}.THEME_NAME.md-tabs.md-transparent>.md-tabs-navigation .md-tab-header.md-active,.THEME_NAME.md-tabs.md-transparent>.md-tabs-navigation .md-tab-header:focus{color:PRIMARY-COLOR}.THEME_NAME.md-tabs.md-transparent>.md-tabs-navigation .md-tab-header.md-disabled{color:BACKGROUND-CONTRAST-0.26}.THEME_NAME.md-tabs.md-transparent>.md-tabs-navigation .md-tab-indicator{background-color:PRIMARY-COLOR}.THEME_NAME.md-tabs.md-accent>.md-tabs-navigation{background-color:ACCENT-COLOR}.THEME_NAME.md-tabs.md-accent>.md-tabs-navigation .md-tab-header{color:ACCENT-CONTRAST-0.54}.THEME_NAME.md-tabs.md-accent>.md-tabs-navigation .md-tab-header.md-active,.THEME_NAME.md-tabs.md-accent>.md-tabs-navigation .md-tab-header:focus{color:ACCENT-CONTRAST}.THEME_NAME.md-tabs.md-accent>.md-tabs-navigation .md-tab-header.md-disabled{color:ACCENT-CONTRAST-0.26}.THEME_NAME.md-tabs.md-accent>.md-tabs-navigation .md-tab-indicator{background-color:BACKGROUND-COLOR}.THEME_NAME.md-tabs.md-warn>.md-tabs-navigation{background-color:WARN-COLOR}.THEME_NAME.md-tabs.md-warn>.md-tabs-navigation .md-tab-header{color:WARN-CONTRAST-0.54}.THEME_NAME.md-tabs.md-warn>.md-tabs-navigation .md-tab-header.md-active,.THEME_NAME.md-tabs.md-warn>.md-tabs-navigation .md-tab-header:focus{color:WARN-CONTRAST}.THEME_NAME.md-tabs.md-warn>.md-tabs-navigation .md-tab-header.md-disabled{color:WARN-CONTRAST-0.26}.THEME_NAME.md-tabs.md-warn>.md-tabs-navigation .md-tab-indicator{background-color:BACKGROUND-COLOR}\n"},3:function(t,e,n){t.exports=!n(5)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},30:function(t,e,n){t.exports=!n(3)&&!n(5)((function(){return 7!=Object.defineProperty(n(25)("div"),"a",{get:function(){return 7}}).a}))},31:function(t,e,n){var i=n(8),a=n(7),r=n(34)(!1),o=n(19)("IE_PROTO");t.exports=function(t,e){var n,s=a(t),c=0,u=[];for(n in s)n!=o&&i(s,n)&&u.push(n);for(;e.length>c;)i(s,n=e[c++])&&(~r(u,n)||u.push(n));return u}},32:function(t,e){t.exports={}},33:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},34:function(t,e,n){var i=n(7),a=n(29),r=n(35);t.exports=function(t){return function(e,n,o){var s,c=i(e),u=a(c.length),d=r(o,u);if(t&&n!=n){for(;u>d;)if(s=c[d++],s!=s)return!0}else for(;u>d;d++)if((t||d in c)&&c[d]===n)return t||d||0;return!t&&-1}}},35:function(t,e,n){var i=n(15),a=Math.max,r=Math.min;t.exports=function(t,e){return t=i(t),t<0?a(t+e,0):r(t,e)}},36:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return Math.random().toString(36).slice(4)};e.default=i,t.exports=e.default},364:function(t,e,n){var i=n(0)(n(195),n(371),null,null,null);t.exports=i.exports},365:function(t,e,n){function i(t){n(241)}var a=n(0)(n(196),n(401),i,null,null);t.exports=a.exports},37:function(t,e,n){var i=n(9).f,a=n(8),r=n(12)("toStringTag");t.exports=function(t,e,n){t&&!a(t=n?t:t.prototype,r)&&i(t,r,{configurable:!0,value:e})}},371:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-tab",style:t.styles,attrs:{id:t.tabId}},[t._t("default")],2)},staticRenderFns:[]}},38:function(t,e,n){t.exports={default:n(43),__esModule:!0}},39:function(t,e){t.exports=!0},4:function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},401:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-tabs",class:[t.themeClass,t.tabClasses]},[n("md-whiteframe",{ref:"tabNavigation",staticClass:"md-tabs-navigation",class:t.navigationClasses,attrs:{"md-tag":"nav","md-elevation":t.mdElevation}},[n("div",{ref:"tabsContainer",staticClass:"md-tabs-navigation-container",on:{scroll:t.handleNavigationScroll}},[n("div",{staticClass:"md-tabs-navigation-scroll-container"},[t._l(t.tabList,(function(e){return n("button",{key:e.id,ref:"tabHeader",refInFor:!0,staticClass:"md-tab-header",class:t.getHeaderClass(e),attrs:{type:"button",disabled:e.disabled},on:{click:function(n){t.setActiveTab(e)}}},[n("md-ink-ripple",{attrs:{"md-disabled":e.disabled}}),t._v(" "),n("div",{staticClass:"md-tab-header-container"},[e.icon?n("md-icon",[t._v(t._s(e.icon))]):t._e(),t._v(" "),e.label?n("span",[t._v(t._s(e.label))]):t._e(),t._v(" "),e.tooltip?n("md-tooltip",{attrs:{"md-direction":e.tooltipDirection,"md-delay":e.tooltipDelay}},[t._v(t._s(e.tooltip))]):t._e()],1)],1)})),t._v(" "),n("span",{ref:"indicator",staticClass:"md-tab-indicator",class:t.indicatorClasses})],2)]),t._v(" "),t.mdNavigation&&t.hasNavigationScroll?n("button",{staticClass:"md-tab-header-navigation-button md-left",class:t.navigationLeftButtonClasses,on:{click:t.navigationScrollLeft}},[n("md-icon",[t._v("keyboard_arrow_left")])],1):t._e(),t._v(" "),t.mdNavigation&&t.hasNavigationScroll?n("button",{staticClass:"md-tab-header-navigation-button md-right",class:t.navigationRightButtonClasses,on:{click:t.navigationScrollRight}},[n("md-icon",[t._v("keyboard_arrow_right")])],1):t._e()]),t._v(" "),n("div",{ref:"tabContent",staticClass:"md-tabs-content",style:{height:t.contentHeight}},[n("div",{staticClass:"md-tabs-wrapper",style:{transform:"translate3D(-"+t.contentWidth+", 0, 0)"}},[t._t("default")],2)])],1)},staticRenderFns:[]}},42:function(t,e,n){"use strict";var i=n(39),a=n(16),r=n(47),o=n(11),s=n(8),c=n(32),u=n(53),d=n(37),l=n(55),f=n(12)("iterator"),h=!([].keys&&"next"in[].keys()),b="@@iterator",m="keys",v="values",p=function(){return this};t.exports=function(t,e,n,g,T,_,y){u(n,e,g);var E,O,x,C=function(t){if(!h&&t in R)return R[t];switch(t){case m:return function(){return new n(this,t)};case v:return function(){return new n(this,t)}}return function(){return new n(this,t)}},M=e+" Iterator",N=T==v,A=!1,R=t.prototype,S=R[f]||R[b]||T&&R[T],w=S||C(T),L=T?N?C("entries"):w:void 0,P="Array"==e?R.entries||S:S;if(P&&(x=l(P.call(new t)),x!==Object.prototype&&(d(x,M,!0),i||s(x,f)||o(x,f,p))),N&&S&&S.name!==v&&(A=!0,w=function(){return S.call(this)}),i&&!y||!h&&!A&&R[f]||o(R,f,w),c[e]=w,c[M]=p,T)if(E={values:N?w:C(v),keys:_?w:C(m),entries:L},y)for(O in E)O in R||r(R,O,E[O]);else a(a.P+a.F*(h||A),e,E);return E}},43:function(t,e,n){n(48),t.exports=n(4).Object.keys},44:function(t,e,n){var i=n(13),a=n(54),r=n(21),o=n(19)("IE_PROTO"),s=function(){},c="prototype",u=function(){var t,e=n(25)("iframe"),i=r.length,a="<",o=">";for(e.style.display="none",n(52).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(a+"script"+o+"document.F=Object"+a+"/script"+o),t.close(),u=t.F;i--;)delete u[c][r[i]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[c]=i(t),n=new s,s[c]=null,n[o]=t):n=u(),void 0===e?n:a(n,e)}},46:function(t,e,n){var i=n(16),a=n(4),r=n(5);t.exports=function(t,e){var n=(a.Object||{})[t]||Object[t],o={};o[t]=e(n),i(i.S+i.F*r((function(){n(1)})),"Object",o)}},47:function(t,e,n){t.exports=n(11)},476:function(t,e,n){t.exports=n(110)},48:function(t,e,n){var i=n(23),a=n(18);n(46)("keys",(function(){return function(t){return a(i(t))}}))},49:function(t,e,n){"use strict";var i=n(56)(!0);n(42)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})}))},5:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},50:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t,e){var n=!1;return function(){n||(t.call(),n=!0,window.setTimeout((function(){n=!1}),e))}};e.default=i,t.exports=e.default},52:function(t,e,n){t.exports=n(2).document&&document.documentElement},53:function(t,e,n){"use strict";var i=n(44),a=n(17),r=n(37),o={};n(11)(o,n(12)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=i(o,{next:a(1,n)}),r(t,e+" Iterator")}},54:function(t,e,n){var i=n(9),a=n(13),r=n(18);t.exports=n(3)?Object.defineProperties:function(t,e){a(t);for(var n,o=r(e),s=o.length,c=0;s>c;)i.f(t,n=o[c++],e[n]);return t}},55:function(t,e,n){var i=n(8),a=n(23),r=n(19)("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=a(t),i(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},56:function(t,e,n){var i=n(15),a=n(14);t.exports=function(t){return function(e,n){var r,o,s=String(a(e)),c=i(n),u=s.length;return c<0||c>=u?t?"":void 0:(r=s.charCodeAt(c),r<55296||r>56319||c+1===u||(o=s.charCodeAt(c+1))<56320||o>57343?t?s.charAt(c):r:t?s.slice(c,c+2):(r-55296<<10)+(o-56320)+65536)}}},57:function(t,e,n){var i=n(60),a=n(12)("iterator"),r=n(32);t.exports=n(4).getIteratorMethod=function(t){if(void 0!=t)return t[a]||t["@@iterator"]||r[i(t)]}},6:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},60:function(t,e,n){var i=n(24),a=n(12)("toStringTag"),r="Arguments"==i(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=o(e=Object(t),a))?n:r?i(e):"Object"==(s=i(e))&&"function"==typeof e.callee?"Arguments":s}},68:function(t,e,n){n(79);for(var i=n(2),a=n(11),r=n(32),o=n(12)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],c=0;c<5;c++){var u=s[c],d=i[u],l=d&&d.prototype;l&&!l[o]&&a(l,o,u),r[u]=r.Array}},7:function(t,e,n){var i=n(26),a=n(14);t.exports=function(t){return i(a(t))}},71:function(t,e){t.exports=function(){}},76:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},79:function(t,e,n){"use strict";var i=n(71),a=n(76),r=n(32),o=n(7);t.exports=n(42)(Array,"Array",(function(t,e){this._t=o(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,a(1)):"keys"==e?a(0,n):"values"==e?a(0,t[n]):a(0,[n,t[n]])}),"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},8:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},9:function(t,e,n){var i=n(13),a=n(30),r=n(27),o=Object.defineProperty;e.f=n(3)?Object.defineProperty:function(t,e,n){if(i(t),e=r(e,!0),i(n),a)try{return o(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}}})})); | seogi1004/cdnjs | ajax/libs/vue-material/0.7.2/components/mdTabs/index.js | JavaScript | mit | 24,341 |
#!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import subprocess
import sys
import shutil
from os import access
from os import getenv
from os import X_OK
jar_file = 'PeptideShaker-1.15.1.jar'
default_jvm_mem_opts = ['-Xms512m', '-Xmx1g']
# !!! End of parameter section. No user-serviceable code below this line !!!
def real_dirname(path):
"""Return the symlink-resolved, canonicalized directory-portion of path."""
return os.path.dirname(os.path.realpath(path))
def java_executable():
"""Return the executable name of the Java interpreter."""
java_home = getenv('JAVA_HOME')
java_bin = os.path.join('bin', 'java')
if java_home and access(os.path.join(java_home, java_bin), X_OK):
return os.path.join(java_home, java_bin)
else:
return 'java'
def jvm_opts(argv):
"""Construct list of Java arguments based on our argument list.
The argument list passed in argv must not include the script name.
The return value is a 3-tuple lists of strings of the form:
(memory_options, prop_options, passthrough_options)
"""
mem_opts = []
prop_opts = []
pass_args = []
exec_dir = None
for arg in argv:
if arg.startswith('-D'):
prop_opts.append(arg)
elif arg.startswith('-XX'):
prop_opts.append(arg)
elif arg.startswith('-Xm'):
mem_opts.append(arg)
elif arg.startswith('--exec_dir='):
exec_dir = arg.split('=')[1].strip('"').strip("'")
if not os.path.exists(exec_dir):
shutil.copytree(real_dirname(sys.argv[0]), exec_dir, symlinks=False, ignore=None)
else:
pass_args.append(arg)
# In the original shell script the test coded below read:
# if [ "$jvm_mem_opts" == "" ] && [ -z ${_JAVA_OPTIONS+x} ]
# To reproduce the behaviour of the above shell code fragment
# it is important to explictly check for equality with None
# in the second condition, so a null envar value counts as True!
if mem_opts == [] and getenv('_JAVA_OPTIONS') is None:
mem_opts = default_jvm_mem_opts
return (mem_opts, prop_opts, pass_args, exec_dir)
def main():
java = java_executable()
"""
PeptideShaker updates files relative to the path of the jar file.
In a multiuser setting, the option --exec_dir="exec_dir"
can be used as the location for the peptide-shaker distribution.
If the exec_dir dies not exist,
we copy the jar file, lib, and resources to the exec_dir directory.
"""
(mem_opts, prop_opts, pass_args, exec_dir) = jvm_opts(sys.argv[1:])
jar_dir = exec_dir if exec_dir else real_dirname(sys.argv[0])
if pass_args != [] and pass_args[0].startswith('eu'):
jar_arg = '-cp'
else:
jar_arg = '-jar'
jar_path = os.path.join(jar_dir, jar_file)
java_args = [java] + mem_opts + prop_opts + [jar_arg] + [jar_path] + pass_args
sys.exit(subprocess.call(java_args))
if __name__ == '__main__':
main()
| dmaticzka/bioconda-recipes | recipes/peptide-shaker/1.15.1/peptide-shaker.py | Python | mit | 3,271 |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Internal.Cryptography;
using Internal.NativeCrypto;
using System.IO;
namespace System.Security.Cryptography
{
public sealed partial class RSACryptoServiceProvider : RSA, ICspAsymmetricAlgorithm
{
private const int DefaultKeySize = 1024;
private readonly RSA _impl;
private bool _publicOnly;
public RSACryptoServiceProvider()
: this(DefaultKeySize) { }
public RSACryptoServiceProvider(int dwKeySize)
{
if (dwKeySize < 0)
throw new ArgumentOutOfRangeException(nameof(dwKeySize), SR.ArgumentOutOfRange_NeedNonNegNum);
// This class wraps RSA
_impl = RSA.Create(dwKeySize);
}
public RSACryptoServiceProvider(int dwKeySize, CspParameters parameters) =>
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspParameters)));
public RSACryptoServiceProvider(CspParameters parameters) =>
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspParameters)));
public CspKeyContainerInfo CspKeyContainerInfo =>
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspKeyContainerInfo)));
public byte[] Decrypt(byte[] rgb, bool fOAEP)
{
if (rgb == null)
throw new ArgumentNullException(nameof(rgb));
// size check -- must be at most the modulus size
if (rgb.Length > (KeySize / 8))
throw new CryptographicException(SR.Format(SR.Cryptography_Padding_DecDataTooBig, Convert.ToString(KeySize / 8)));
return _impl.Decrypt(rgb, fOAEP ? RSAEncryptionPadding.OaepSHA1 : RSAEncryptionPadding.Pkcs1);
}
public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding)
{
if (data == null)
throw new ArgumentNullException(nameof(data));
if (padding == null)
throw new ArgumentNullException(nameof(padding));
return
padding == RSAEncryptionPadding.Pkcs1 ? Decrypt(data, fOAEP: false) :
padding == RSAEncryptionPadding.OaepSHA1 ? Decrypt(data, fOAEP: true) : // For compat, this prevents OaepSHA2 options as fOAEP==true will cause Decrypt to use OaepSHA1
throw PaddingModeNotSupported();
}
public override bool TryDecrypt(ReadOnlySpan<byte> source, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten)
{
if (padding == null)
throw new ArgumentNullException(nameof(padding));
if (source.Length > (KeySize / 8))
throw new CryptographicException(SR.Format(SR.Cryptography_Padding_DecDataTooBig, Convert.ToString(KeySize / 8)));
if (padding != RSAEncryptionPadding.Pkcs1 && padding != RSAEncryptionPadding.OaepSHA1)
throw PaddingModeNotSupported();
return _impl.TryDecrypt(source, destination, padding, out bytesWritten);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
_impl.Dispose();
base.Dispose(disposing);
}
}
public byte[] Encrypt(byte[] rgb, bool fOAEP)
{
if (rgb == null)
throw new ArgumentNullException(nameof(rgb));
return _impl.Encrypt(rgb, fOAEP ? RSAEncryptionPadding.OaepSHA1 : RSAEncryptionPadding.Pkcs1);
}
public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding)
{
if (data == null)
throw new ArgumentNullException(nameof(data));
if (padding == null)
throw new ArgumentNullException(nameof(padding));
return
padding == RSAEncryptionPadding.Pkcs1 ? Encrypt(data, fOAEP: false) :
padding == RSAEncryptionPadding.OaepSHA1 ? Encrypt(data, fOAEP: true) : // For compat, this prevents OaepSHA2 options as fOAEP==true will cause Decrypt to use OaepSHA1
throw PaddingModeNotSupported();
}
public override bool TryEncrypt(ReadOnlySpan<byte> source, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten)
{
if (padding == null)
throw new ArgumentNullException(nameof(padding));
if (padding != RSAEncryptionPadding.Pkcs1 && padding != RSAEncryptionPadding.OaepSHA1)
throw PaddingModeNotSupported();
return _impl.TryEncrypt(source, destination, padding, out bytesWritten);
}
public byte[] ExportCspBlob(bool includePrivateParameters)
{
RSAParameters parameters = ExportParameters(includePrivateParameters);
return parameters.ToKeyBlob();
}
public override RSAParameters ExportParameters(bool includePrivateParameters) =>
_impl.ExportParameters(includePrivateParameters);
protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) =>
AsymmetricAlgorithmHelpers.HashData(data, offset, count, hashAlgorithm);
protected override bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) =>
AsymmetricAlgorithmHelpers.TryHashData(source, destination, hashAlgorithm, out bytesWritten);
protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) =>
AsymmetricAlgorithmHelpers.HashData(data, hashAlgorithm);
public override void FromXmlString(string xmlString) => _impl.FromXmlString(xmlString);
public void ImportCspBlob(byte[] keyBlob)
{
RSAParameters parameters = CapiHelper.ToRSAParameters(keyBlob, !IsPublic(keyBlob));
ImportParameters(parameters);
}
public override void ImportParameters(RSAParameters parameters)
{
// Although _impl supports larger Exponent, limit here for compat.
if (parameters.Exponent == null || parameters.Exponent.Length > 4)
throw new CryptographicException(SR.Argument_InvalidValue);
_impl.ImportParameters(parameters);
// P was verified in ImportParameters
_publicOnly = (parameters.P == null || parameters.P.Length == 0);
}
public override string KeyExchangeAlgorithm => _impl.KeyExchangeAlgorithm;
public override int KeySize
{
get { return _impl.KeySize; }
set { _impl.KeySize = value; }
}
public override KeySizes[] LegalKeySizes =>
_impl.LegalKeySizes; // Csp Windows and RSAOpenSsl are the same (384, 16384, 8)
// PersistKeyInCsp has no effect in Unix
public bool PersistKeyInCsp { get; set; }
public bool PublicOnly => _publicOnly;
public override string SignatureAlgorithm => "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) =>
_impl.SignData(data, hashAlgorithm, padding);
public override byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) =>
_impl.SignData(data, offset, count, hashAlgorithm, padding);
public override bool TrySignData(ReadOnlySpan<byte> source, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) =>
_impl.TrySignData(source, destination, hashAlgorithm, padding, out bytesWritten);
public byte[] SignData(byte[] buffer, int offset, int count, object halg) =>
_impl.SignData(buffer, offset, count, HashAlgorithmNames.ObjToHashAlgorithmName(halg), RSASignaturePadding.Pkcs1);
public byte[] SignData(byte[] buffer, object halg) =>
_impl.SignData(buffer, HashAlgorithmNames.ObjToHashAlgorithmName(halg), RSASignaturePadding.Pkcs1);
public byte[] SignData(Stream inputStream, object halg) =>
_impl.SignData(inputStream, HashAlgorithmNames.ObjToHashAlgorithmName(halg), RSASignaturePadding.Pkcs1);
public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) =>
_impl.SignHash(hash, hashAlgorithm, padding);
public override bool TrySignHash(ReadOnlySpan<byte> source, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) =>
_impl.TrySignHash(source, destination, hashAlgorithm, padding, out bytesWritten);
public byte[] SignHash(byte[] rgbHash, string str)
{
if (rgbHash == null)
throw new ArgumentNullException(nameof(rgbHash));
if (PublicOnly)
throw new CryptographicException(SR.Cryptography_CSP_NoPrivateKey);
HashAlgorithmName algName = HashAlgorithmNames.NameOrOidToHashAlgorithmName(str);
return _impl.SignHash(rgbHash, algName, RSASignaturePadding.Pkcs1);
}
public override string ToXmlString(bool includePrivateParameters) => _impl.ToXmlString(includePrivateParameters);
public bool VerifyData(byte[] buffer, object halg, byte[] signature) =>
_impl.VerifyData(buffer, signature, HashAlgorithmNames.ObjToHashAlgorithmName(halg), RSASignaturePadding.Pkcs1);
public override bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) =>
_impl.VerifyData(data, offset, count, signature, hashAlgorithm, padding);
public override bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) =>
_impl.VerifyData(data, signature, hashAlgorithm, padding);
public override bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
{
if (hash == null)
{
throw new ArgumentNullException(nameof(hash));
}
if (signature == null)
{
throw new ArgumentNullException(nameof(signature));
}
return VerifyHash((ReadOnlySpan<byte>)hash, (ReadOnlySpan<byte>)signature, hashAlgorithm, padding);
}
public override bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) =>
padding == null ? throw new ArgumentNullException(nameof(padding)) :
padding != RSASignaturePadding.Pkcs1 ? throw PaddingModeNotSupported() :
_impl.VerifyHash(hash, signature, hashAlgorithm, padding);
public bool VerifyHash(byte[] rgbHash, string str, byte[] rgbSignature)
{
if (rgbHash == null)
{
throw new ArgumentNullException(nameof(rgbHash));
}
if (rgbSignature == null)
{
throw new ArgumentNullException(nameof(rgbSignature));
}
return VerifyHash(
(ReadOnlySpan<byte>)rgbHash, (ReadOnlySpan<byte>)rgbSignature,
HashAlgorithmNames.NameOrOidToHashAlgorithmName(str), RSASignaturePadding.Pkcs1);
}
// UseMachineKeyStore has no effect in Unix
public static bool UseMachineKeyStore { get; set; }
private static Exception PaddingModeNotSupported()
{
return new CryptographicException(SR.Cryptography_InvalidPaddingMode);
}
/// <summary>
/// find whether an RSA key blob is public.
/// </summary>
private static bool IsPublic(byte[] keyBlob)
{
if (keyBlob == null)
throw new ArgumentNullException(nameof(keyBlob));
// The CAPI RSA public key representation consists of the following sequence:
// - BLOBHEADER
// - RSAPUBKEY
// The first should be PUBLICKEYBLOB and magic should be RSA_PUB_MAGIC "RSA1"
if (keyBlob[0] != CapiHelper.PUBLICKEYBLOB)
{
return false;
}
if (keyBlob[11] != 0x31 || keyBlob[10] != 0x41 || keyBlob[9] != 0x53 || keyBlob[8] != 0x52)
{
return false;
}
return true;
}
}
}
| Ermiar/corefx | src/System.Security.Cryptography.Csp/src/System/Security/Cryptography/RSACryptoServiceProvider.Unix.cs | C# | mit | 12,893 |
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Angular-xeditable Starter Template</title>
<!-- Bootstrap 3 css -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<!-- Angular.js -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
<!-- Angular-xeditable -->
<link href="angular-xeditable/css/xeditable.css" rel="stylesheet">
<script src="angular-xeditable/js/xeditable.js"></script>
<!-- app.js -->
<script src="app.js"></script>
</head>
<body style="padding: 20px">
<h1 style="margin-bottom: 20px">Angular-xeditable Starter Template</h1>
<div ng-controller="Ctrl">
<!-- editable element -->
<a href="#" editable-text="user.name">{{ user.name || "empty" }}</a>
<div id="debug" style="margin-top: 30px">
{{ user | json }}
</div>
</div>
</body>
</html> | hookano/angular-xeditable | starter/index.html | HTML | mit | 1,039 |
var os = require('os');
var compact = require('lodash.compact');
var defaults = require('lodash.defaults');
function getTransformedComments(todos, config) {
var transformFn = config.transformComment;
if (!todos.length) {
//early return in case of no comments
//FIXME: make the default header a configurable option
return {
TODO: []
};
}
var output = todos.reduce(function (mem, comment) {
var kind = comment.kind;
mem[kind] = mem[kind] || [];
// transformed comment as an array item
var transformedComment = transformFn(comment.file, comment.line, comment.text, kind);
// enforce array type
if (!Array.isArray(transformedComment)) {
transformedComment = [transformedComment];
}
// append to kind array
mem[kind] = mem[kind].concat(transformedComment);
return mem;
}, {});
return output;
}
function joinBlocksByHeaders(output, config) {
var padding = config.padding;
var newLine = config.newLine;
var transformHeader = config.transformHeader;
var header;
var contents = '';
//prepend headers
Object.keys(output).forEach(function (kind) {
header = transformHeader(kind);
// enforce array response
if (!Array.isArray(header)) {
header = [header];
}
output[kind] = compact(header.concat(output[kind]));
// add padding between kind blocks
if (contents.length) {
contents += new Array(padding + 1).join(newLine);
}
contents += output[kind].join(newLine);
});
return contents;
}
function parseConfig(_config) {
var config = defaults(_config || {}, {
padding: 2,
newLine: os.EOL,
transformComment: function (file, line, text, kind) {
//jshint unused:false
return ['file: ' + file, 'line: ' + line, 'text: ' + text];
},
transformHeader: function (kind) {
return ['kind: ' + kind];
}
});
if (typeof config.transformHeader !== 'function') {
throw new Error('transformHeader must be a function');
}
if (typeof config.transformComment !== 'function') {
throw new Error('transformComment must be a function');
}
// padding must be a minimum of 0
// enforce padding to be a number as well
config.padding = Math.max(0, parseInt(config.padding, 10));
return config;
}
module.exports = function (todos, _config) {
var config = parseConfig(_config);
var output = getTransformedComments(todos, config);
return joinBlocksByHeaders(output, config);
};
module.exports.joinBlocksByHeaders = joinBlocksByHeaders;
module.exports.getTransformedComments = getTransformedComments;
| gingerchris/leasot | lib/reporters/custom.js | JavaScript | mit | 2,801 |
/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-dotnav{padding:0;list-style:none;font-size:0}.uk-dotnav>li{display:inline-block;font-size:1rem;vertical-align:top}.uk-dotnav>li:nth-child(n+2){margin-left:15px}.uk-dotnav>li>a{display:inline-block;-moz-box-sizing:content-box;box-sizing:content-box;width:20px;height:20px;border-radius:50%;background:rgba(50,50,50,.1);vertical-align:top;overflow:hidden;text-indent:-999%}.uk-dotnav>li>a:hover,.uk-dotnav>li>a:focus{background:rgba(50,50,50,.4);outline:0}.uk-dotnav>li>a:active{background:rgba(50,50,50,.6)}.uk-dotnav>li.uk-active>a{background:rgba(50,50,50,.4)}.uk-dotnav-vertical>li{display:block}.uk-dotnav-vertical>li:nth-child(n+2){margin-left:0;margin-top:15px}.uk-slidenav{display:inline-block;-moz-box-sizing:border-box;box-sizing:border-box;width:60px;height:60px;line-height:60px;color:rgba(50,50,50,.4);font-size:60px;text-align:center}.uk-slidenav:hover,.uk-slidenav:focus{outline:0;text-decoration:none;color:rgba(50,50,50,.7);cursor:pointer}.uk-slidenav:active{color:rgba(50,50,50,.9)}.uk-slidenav-previous:before{content:"\f104";font-family:FontAwesome}.uk-slidenav-next:before{content:"\f105";font-family:FontAwesome}.uk-slidenav-position{display:inline-block;position:relative;max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}.uk-slidenav-position .uk-slidenav{display:none;position:absolute;top:50%;margin-top:-30px}.uk-slidenav-position:hover .uk-slidenav{display:block}.uk-slidenav-position .uk-slidenav-previous{left:20px}.uk-slidenav-position .uk-slidenav-next{right:20px}.uk-form input[type=radio],.uk-form input[type=checkbox]{display:inline-block;height:14px;width:14px;border:1px solid #aaa;overflow:hidden;margin-top:-4px;vertical-align:middle;-webkit-appearance:none;outline:0;background:0 0}.uk-form input[type=radio]{border-radius:50%}.uk-form input[type=checkbox]:checked:before,.uk-form input[type=radio]:checked:before{display:block}.uk-form input[type=radio]:checked:before{content:'';width:8px;height:8px;margin:2px auto 0;border-radius:50%;background:#00a8e6}.uk-form input[type=checkbox]:checked:before{content:"\f00c";font-family:FontAwesome;font-size:12px;-webkit-font-smoothing:antialiased;text-align:center;line-height:12px;color:#00a8e6}.uk-form input[type=radio]:disabled,.uk-form input[type=checkbox]:disabled{border-color:#ddd}.uk-form input[type=radio]:disabled:checked:before{background-color:#aaa}.uk-form input[type=checkbox]:disabled:checked:before{color:#aaa}.uk-form-file{display:inline-block;vertical-align:middle;position:relative;overflow:hidden}.uk-form-file input[type=file]{position:absolute;top:0;z-index:1;width:100%;opacity:0;cursor:pointer;left:0;font-size:500px}.uk-form-password{display:inline-block;position:relative;max-width:100%}.uk-form-password-toggle{display:block;position:absolute;top:50%;right:10px;margin-top:-6px;font-size:13px;line-height:13px;color:#999}.uk-form-password-toggle:hover{color:#999;text-decoration:none}.uk-form-password>input{padding-right:50px!important}.uk-form-select{display:inline-block;vertical-align:middle;position:relative;overflow:hidden}.uk-form-select select{position:absolute;top:0;z-index:1;width:100%;height:100%;opacity:0;cursor:pointer;left:0;-webkit-appearance:none}.uk-placeholder{margin-bottom:15px;padding:20px;border:1px dashed #ddd;background:#fafafa;color:#444}*+.uk-placeholder{margin-top:15px}.uk-placeholder>:last-child{margin-bottom:0}.uk-placeholder-large{padding-top:80px;padding-bottom:80px}.uk-autocomplete{display:inline-block;position:relative;max-width:100%;vertical-align:middle}.uk-nav-autocomplete>li>a{color:#444}.uk-nav-autocomplete>li.uk-active>a{background:#00a8e6;color:#fff;outline:0}.uk-nav-autocomplete .uk-nav-header{color:#999}.uk-nav-autocomplete .uk-nav-divider{border-top:1px solid #ddd}.uk-datepicker{width:auto;-webkit-animation:uk-fade .2s ease-in-out;animation:uk-fade .2s ease-in-out;-webkit-transform-origin:0 0;transform-origin:0 0}.uk-datepicker-nav{margin-bottom:15px;text-align:center;line-height:20px}.uk-datepicker-nav:before,.uk-datepicker-nav:after{content:" ";display:table}.uk-datepicker-nav:after{clear:both}.uk-datepicker-nav a{color:#444;text-decoration:none}.uk-datepicker-nav a:hover{color:#444}.uk-datepicker-previous{float:left}.uk-datepicker-next{float:right}.uk-datepicker-previous:after,.uk-datepicker-next:after{width:20px;font-family:FontAwesome}.uk-datepicker-previous:after{content:"\f053"}.uk-datepicker-next:after{content:"\f054"}.uk-datepicker-table{width:100%}.uk-datepicker-table th,.uk-datepicker-table td{padding:2px}.uk-datepicker-table th{font-size:12px}.uk-datepicker-table a{display:block;width:26px;line-height:24px;text-align:center;color:#444;text-decoration:none}a.uk-datepicker-table-muted{color:#999}.uk-datepicker-table a:hover,.uk-datepicker-table a:focus{background-color:#ddd;color:#444;outline:0}.uk-datepicker-table a:active{background-color:#ccc;color:#444}.uk-datepicker-table a.uk-active{background:#00a8e6;color:#fff}.uk-htmleditor-navbar{background:#eee}.uk-htmleditor-navbar:before,.uk-htmleditor-navbar:after{content:" ";display:table}.uk-htmleditor-navbar:after{clear:both}.uk-htmleditor-navbar-nav{margin:0;padding:0;list-style:none;float:left}.uk-htmleditor-navbar-nav>li{float:left}.uk-htmleditor-navbar-nav>li>a{display:block;-moz-box-sizing:border-box;box-sizing:border-box;text-decoration:none;height:40px;padding:0 15px;line-height:40px;color:#444;font-size:11px;cursor:pointer}.uk-htmleditor-navbar-nav>li:hover>a,.uk-htmleditor-navbar-nav>li>a:focus{background-color:#f5f5f5;color:#444;outline:0}.uk-htmleditor-navbar-nav>li>a:active{background-color:#ddd;color:#444}.uk-htmleditor-navbar-nav>li.uk-active>a{background-color:#f5f5f5;color:#444}.uk-htmleditor-navbar-flip{float:right}[data-mode=split] .uk-htmleditor-button-code,[data-mode=split] .uk-htmleditor-button-preview{display:none}.uk-htmleditor-content{border-left:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd;background:#fff}.uk-htmleditor-content:before,.uk-htmleditor-content:after{content:" ";display:table}.uk-htmleditor-content:after{clear:both}.uk-htmleditor-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;z-index:990}.uk-htmleditor-fullscreen .uk-htmleditor-content{position:absolute;top:40px;left:0;right:0;bottom:0}.uk-htmleditor-fullscreen .uk-icon-expand:before{content:"\f066"}.uk-htmleditor-code,.uk-htmleditor-preview{-moz-box-sizing:border-box;box-sizing:border-box}.uk-htmleditor-preview{padding:20px;overflow-y:scroll;position:relative}[data-mode=tab][data-active-tab=code] .uk-htmleditor-preview,[data-mode=tab][data-active-tab=preview] .uk-htmleditor-code{display:none}[data-mode=split] .uk-htmleditor-code,[data-mode=split] .uk-htmleditor-preview{float:left;width:50%}[data-mode=split] .uk-htmleditor-code{border-right:1px solid #eee}.uk-htmleditor-iframe{position:absolute;top:0;left:0;width:100%;height:100%}.uk-htmleditor .CodeMirror{padding:10px;-moz-box-sizing:border-box;box-sizing:border-box}.uk-nestable{padding:0;list-style:none}.uk-nestable-list{margin:0;padding-left:40px;list-style:none}.uk-nestable-list-dragged{position:absolute;z-index:1050;padding-left:0;pointer-events:none}.uk-nestable-item{margin-bottom:10px;padding:5px;background:#f5f5f5}.uk-nestable-placeholder{-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:10px;border:1px dashed #ddd}.uk-nestable-empty{min-height:40px}.uk-nestable-handle{display:inline-block;font-size:18px;color:#ddd}.uk-nestable-handle:hover{cursor:move}.uk-nestable-handle:after{content:"\f0c9";font-family:FontAwesome}.uk-nestable-moving,.uk-nestable-moving *{cursor:move}[data-nestable-action=toggle]{display:inline-block;color:#999;visibility:hidden}[data-nestable-action=toggle]:hover{color:#444;cursor:pointer}[data-nestable-action=toggle]:after{content:"\f147";font-family:FontAwesome}.uk-parent>.uk-nestable-item [data-nestable-action=toggle]{visibility:visible}.uk-collapsed>.uk-nestable-item [data-nestable-action=toggle]:after{content:"\f196"}.uk-collapsed .uk-nestable-list{display:none}.uk-notify{position:fixed;top:10px;left:10px;z-index:1040;-moz-box-sizing:border-box;box-sizing:border-box;width:350px}.uk-notify-top-right,.uk-notify-bottom-right{left:auto;right:10px}.uk-notify-top-center,.uk-notify-bottom-center{left:50%;margin-left:-175px}.uk-notify-bottom-left,.uk-notify-bottom-right,.uk-notify-bottom-center{top:auto;bottom:10px}@media (max-width:479px){.uk-notify{left:10px;right:10px;width:auto;margin:0}}.uk-notify-message{position:relative;margin-bottom:10px;padding:15px;background:#444;color:#fff;font-size:16px;line-height:22px;cursor:pointer}.uk-notify-message>.uk-close{visibility:hidden;float:right}.uk-notify-message:hover>.uk-close{visibility:visible}.uk-notify-message-primary{background:#ebf7fd;color:#2d7091}.uk-notify-message-success{background:#f2fae3;color:#659f13}.uk-notify-message-warning{background:#fffceb;color:#e28327}.uk-notify-message-danger{background:#fff1f0;color:#d85030}.uk-search{display:inline-block;position:relative;margin:0}.uk-search:before{content:"\f002";position:absolute;top:0;left:0;width:30px;line-height:30px;text-align:center;font-family:FontAwesome;font-size:14px;color:rgba(0,0,0,.2)}.uk-search-field{width:120px;height:30px;padding:0 0 0 30px;border:1px solid rgba(0,0,0,0);background:rgba(0,0,0,0);color:#444;-webkit-transition:all linear .2s;transition:all linear .2s;border-radius:0}input.uk-search-field{-webkit-appearance:none}.uk-search-field:-ms-input-placeholder{color:#999}.uk-search-field::-moz-placeholder{color:#999}.uk-search-field::-webkit-input-placeholder{color:#999}.uk-search-field::-ms-clear{display:none}.uk-search-field:focus{outline:0}.uk-search-field:focus,.uk-search.uk-active .uk-search-field{width:180px}.uk-dropdown-search{width:300px;margin-top:0;background:#f5f5f5;color:#444}.uk-open>.uk-dropdown-search{-webkit-animation:uk-slide-top-fixed .2s ease-in-out;animation:uk-slide-top-fixed .2s ease-in-out}.uk-navbar-flip .uk-dropdown-search{margin-top:5px;margin-right:-15px}.uk-nav-search>li>a{color:#444}.uk-nav-search>li.uk-active>a{background:#00a8e6;color:#fff;outline:0}.uk-nav-search .uk-nav-header{color:#999}.uk-nav-search .uk-nav-divider{border-top:1px solid #ddd}.uk-nav-search ul a{color:#07d}.uk-nav-search ul a:hover{color:#059}.uk-offcanvas .uk-search{display:block;margin:20px 15px}.uk-offcanvas .uk-search:before{color:#777}.uk-offcanvas .uk-search-field{width:100%;border-color:rgba(0,0,0,0);background:#1a1a1a;color:#ccc}.uk-offcanvas .uk-search-field:-ms-input-placeholder{color:#777}.uk-offcanvas .uk-search-field::-moz-placeholder{color:#777}.uk-offcanvas .uk-search-field::-webkit-input-placeholder{color:#777}.uk-sortable{position:relative}.uk-sortable>*{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.uk-sortable>* *{-webkit-user-drag:none;user-drag:none}.uk-sortable-dragged{position:absolute;z-index:1050;pointer-events:none}.uk-sortable-placeholder{opacity:0}.uk-sortable-over{opacity:.3}.uk-sortable-moving,.uk-sortable-moving *{cursor:move}[data-uk-sticky].uk-active{z-index:980;-moz-box-sizing:border-box;box-sizing:border-box}[data-uk-sticky][class*=uk-animation-]{-webkit-animation-duration:.15s;animation-duration:.15s}[data-uk-sticky].uk-animation-reverse{-webkit-animation-duration:.04s;animation-duration:.04s}.uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)}.uk-flex{display:-ms-flexbox;display:-webkit-flex;display:flex}.uk-flex-top{-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.uk-flex-middle{-ms-flex-align:center;-webkit-align-items:center;align-items:center}.uk-flex-bottom{-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end}.uk-flex-center{-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}.uk-flex-right{-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.uk-cover-background{background-position:50% 50%;background-size:cover;background-repeat:no-repeat}.uk-cover{overflow:hidden}.uk-cover-object{width:auto;height:auto;min-width:100%;min-height:100%;max-width:none;position:relative;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}[data-uk-cover]{position:relative;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)} | voronianski/cdnjs | ajax/libs/uikit/2.9.0/css/addons/uikit.addons.min.css | CSS | mit | 12,367 |
"use strict";
var path = require("path");
var fs = require("fs");
var _ = require("../../lodash.custom");
var utils = require("../utils");
var opts = require("./cli-options").utils;
/**
* $ browser-sync start <options>
*
* This commands starts the Browsersync servers
* & Optionally UI.
*
* @param opts
* @returns {Function}
*/
module.exports = function (opts) {
var flags = preprocessFlags(opts.cli.flags);
var maybepkg = path.resolve(process.cwd(), "package.json");
var input = flags;
if (flags.config) {
var maybeconf = path.resolve(process.cwd(), flags.config);
if (fs.existsSync(maybeconf)) {
var conf = require(maybeconf);
input = _.merge({}, conf, flags);
} else {
utils.fail(true, new Error("Configuration file '" + flags.config + "' not found"), opts.cb);
}
} else {
if (fs.existsSync(maybepkg)) {
var pkg = require(maybepkg);
if (pkg["browser-sync"]) {
console.log("> Configuration obtained from package.json");
input = _.merge({}, pkg["browser-sync"], flags);
}
}
}
return require("../../")
.create("cli")
.init(input, opts.cb);
};
/**
* @param flags
* @returns {*}
*/
function preprocessFlags (flags) {
return [
stripUndefined,
legacyFilesArgs
].reduce(function (flags, fn) {
return fn.call(null, flags);
}, flags);
}
/**
* Incoming undefined values are problematic as
* they interfere with Immutable.Map.mergeDeep
* @param subject
* @returns {*}
*/
function stripUndefined (subject) {
return Object.keys(subject).reduce(function (acc, key) {
var value = subject[key];
if (typeof value === "undefined") {
return acc;
}
acc[key] = value;
return acc;
}, {});
}
/**
* @param flags
* @returns {*}
*/
function legacyFilesArgs(flags) {
if (flags.files && flags.files.length) {
flags.files = flags.files.reduce(function (acc, item) {
return acc.concat(opts.explodeFilesArg(item));
}, []);
}
return flags;
}
| benidev/swissphotographics.ch | node_modules/browser-sync/lib/cli/command.start.js | JavaScript | mit | 2,186 |
import Input from './input';
import Node from './node';
import Root from './root';
export default class Parser {
input: Input;
pos: number;
root: Root;
spaces: string;
semicolon: boolean;
private current;
private tokens;
constructor(input: Input);
tokenize(): void;
loop(): void;
comment(token: any): void;
emptyRule(token: any): void;
word(): void;
rule(tokens: any): void;
decl(tokens: any): void;
atrule(token: any): void;
end(token: any): void;
endFile(): void;
init(node: Node, line?: number, column?: number): void;
raw(node: any, prop: any, tokens: any): void;
spacesFromEnd(tokens: any): string;
spacesFromStart(tokens: any): string;
stringFrom(tokens: any, from: any): string;
colon(tokens: any): number | boolean;
unclosedBracket(bracket: any): void;
unknownWord(start: any): void;
unexpectedClose(token: any): void;
unclosedBlock(): void;
doubleColon(token: any): void;
unnamedAtrule(node: any, token: any): void;
precheckMissedSemicolon(tokens: any): void;
checkMissedSemicolon(tokens: any): void;
}
| tnga/crud-theclub-m | node_modules/gulp-autoprefixer/node_modules/postcss/d.ts/parser.d.ts | TypeScript | mit | 1,140 |
var chmodr = require("../")
, test = require("tap").test
, mkdirp = require("mkdirp")
, rimraf = require("rimraf")
, fs = require("fs")
, dirs = []
rimraf("/tmp/chmodr", function (er) {
if (er) throw er
var cnt = 5
for (var i = 0; i < 5; i ++) {
mkdirp(getDir(), then)
}
function then (er) {
if (er) throw er
if (-- cnt === 0) {
runTest()
}
}
})
function getDir () {
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var dir = "/tmp/chmodr/" + [x,y,z].join("/")
dirs.push(dir)
return dir
}
function runTest () {
test("should complete successfully", function (t) {
console.error("calling chmodr 0700")
chmodr.sync("/tmp/chmodr", 0700)
t.end()
})
dirs.forEach(function (dir) {
test("verify "+dir, function (t) {
fs.stat(dir, function (er, st) {
if (er) {
t.ifError(er)
return t.end()
}
t.equal(st.mode & 0777, 0700, "uid should be 0700")
t.end()
})
})
})
test("cleanup", function (t) {
rimraf("/tmp/chmodr", function (er) {
t.ifError(er)
t.end()
})
})
}
| deeba39/assign1 | node_modules/bower/node_modules/chmodr/test/sync.js | JavaScript | mit | 1,265 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('series-spline', function (Y, NAME) {
/**
* Provides functionality for creating a spline series.
*
* @module charts
* @submodule series-spline
*/
/**
* SplineSeries renders a graph with data points connected by a curve.
*
* @class SplineSeries
* @extends LineSeries
* @uses CurveUtil
* @uses Lines
* @constructor
* @param {Object} config (optional) Configuration parameters.
* @submodule series-spline
*/
Y.SplineSeries = Y.Base.create("splineSeries", Y.LineSeries, [Y.CurveUtil, Y.Lines], {
/**
* @protected
*
* Draws the series.
*
* @method drawSeries
*/
drawSeries: function()
{
this.drawSpline();
}
}, {
ATTRS : {
/**
* Read-only attribute indicating the type of series.
*
* @attribute type
* @type String
* @default spline
*/
type : {
value:"spline"
}
/**
* Style properties used for drawing lines. This attribute is inherited from `Renderer`.
* Below are the default values:
* <dl>
* <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on
* the graph. The color will be retrieved from the following array:
* `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`
* <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>
* <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>
* <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd>
* <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value
* is 10.</dd>
* <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is
* 10.</dd>
* <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null
* value between points. The default value is true.</dd>
* <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The
* default value is solid.</dd>
* <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash.
* The default value is 10.</dd>
* <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes.
* The default value is 10.</dd>
* </dl>
*
* @attribute styles
* @type Object
*/
}
});
}, '3.17.2', {"requires": ["series-line", "series-curve-util"]});
| Piicksarn/cdnjs | ajax/libs/yui/3.17.2/series-spline/series-spline.js | JavaScript | mit | 3,119 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('jsonp-url', function (Y, NAME) {
var JSONPRequest = Y.JSONPRequest,
getByPath = Y.Object.getValue,
noop = function () {};
/**
* Adds support for parsing complex callback identifiers from the jsonp url.
* This includes callback=foo[1]bar.baz["goo"] as well as referencing methods
* in the YUI instance.
*
* @module jsonp
* @submodule jsonp-url
* @for JSONPRequest
*/
Y.mix(JSONPRequest.prototype, {
/**
* RegExp used by the default URL formatter to insert the generated callback
* name into the JSONP url. Looks for a query param callback=. If a value
* is assigned, it will be clobbered.
*
* @property _pattern
* @type RegExp
* @default /\bcallback=.*?(?=&|$)/i
* @protected
*/
_pattern: /\bcallback=(.*?)(?=&|$)/i,
/**
* Template used by the default URL formatter to add the callback function
* name to the url.
*
* @property _template
* @type String
* @default "callback={callback}"
* @protected
*/
_template: "callback={callback}",
/**
* <p>Parses the url for a callback named explicitly in the string.
* Override this if the target JSONP service uses a different query
* parameter or url format.</p>
*
* <p>If the callback is declared inline, the corresponding function will
* be returned. Otherwise null.</p>
*
* @method _defaultCallback
* @param url {String} the url to search in
* @return {Function} the callback function if found, or null
* @protected
*/
_defaultCallback: function (url) {
var match = url.match(this._pattern),
keys = [],
i = 0,
locator, path, callback;
if (match) {
// Strip the ["string keys"] and [1] array indexes
locator = match[1]
.replace(/\[(['"])(.*?)\1\]/g,
function (x, $1, $2) {
keys[i] = $2;
return '.@' + (i++);
})
.replace(/\[(\d+)\]/g,
function (x, $1) {
keys[i] = parseInt($1, 10) | 0;
return '.@' + (i++);
})
.replace(/^\./, ''); // remove leading dot
// Validate against problematic characters.
if (!/[^\w\.\$@]/.test(locator)) {
path = locator.split('.');
for (i = path.length - 1; i >= 0; --i) {
if (path[i].charAt(0) === '@') {
path[i] = keys[parseInt(path[i].substr(1), 10)];
}
}
// First look for a global function, then the Y, then try the Y
// again from the second token (to support "callback=Y.handler")
callback = getByPath(Y.config.win, path) ||
getByPath(Y, path) ||
getByPath(Y, path.slice(1));
}
}
return callback || noop;
},
/**
* URL formatter that looks for callback= in the url and appends it
* if not present. The supplied proxy name will be assigned to the query
* param. Override this method by passing a function as the
* "format" property in the config object to the constructor.
*
* @method _format
* @param url { String } the original url
* @param proxy {String} the function name that will be used as a proxy to
* the configured callback methods.
* @return {String} fully qualified JSONP url
* @protected
*/
_format: function (url, proxy) {
var callbackRE = /\{callback\}/,
callback, lastChar;
if (callbackRE.test(url)) {
return url.replace(callbackRE, proxy);
}
callback = this._template.replace(callbackRE, proxy);
if (this._pattern.test(url)) {
return url.replace(this._pattern, callback);
} else {
lastChar = url.slice(-1);
if (lastChar !== '&' && lastChar !== '?') {
url += (url.indexOf('?') > -1) ? '&' : '?';
}
return url + callback;
}
}
}, true);
}, '3.17.2', {"requires": ["jsonp"]});
| BitsyCode/cdnjs | ajax/libs/yui/3.17.2/jsonp-url/jsonp-url-debug.js | JavaScript | mit | 4,449 |
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// test compression/decompression with dictionary
var common = require('../common.js');
var assert = require('assert');
var zlib = require('zlib');
var path = require('path');
var spdyDict = new Buffer([
'optionsgetheadpostputdeletetraceacceptaccept-charsetaccept-encodingaccept-',
'languageauthorizationexpectfromhostif-modified-sinceif-matchif-none-matchi',
'f-rangeif-unmodifiedsincemax-forwardsproxy-authorizationrangerefererteuser',
'-agent10010120020120220320420520630030130230330430530630740040140240340440',
'5406407408409410411412413414415416417500501502503504505accept-rangesageeta',
'glocationproxy-authenticatepublicretry-afterservervarywarningwww-authentic',
'ateallowcontent-basecontent-encodingcache-controlconnectiondatetrailertran',
'sfer-encodingupgradeviawarningcontent-languagecontent-lengthcontent-locati',
'oncontent-md5content-rangecontent-typeetagexpireslast-modifiedset-cookieMo',
'ndayTuesdayWednesdayThursdayFridaySaturdaySundayJanFebMarAprMayJunJulAugSe',
'pOctNovDecchunkedtext/htmlimage/pngimage/jpgimage/gifapplication/xmlapplic',
'ation/xhtmltext/plainpublicmax-agecharset=iso-8859-1utf-8gzipdeflateHTTP/1',
'.1statusversionurl\0'
].join(''));
var deflate = zlib.createDeflate({ dictionary: spdyDict });
var input = [
'HTTP/1.1 200 Ok',
'Server: node.js',
'Content-Length: 0',
''
].join('\r\n');
var called = 0;
//
// We'll use clean-new inflate stream each time
// and .reset() old dirty deflate one
//
function run(num) {
var inflate = zlib.createInflate({ dictionary: spdyDict });
if (num === 2) {
deflate.reset();
deflate.removeAllListeners('data');
}
// Put data into deflate stream
deflate.on('data', function(chunk) {
inflate.write(chunk);
});
// Get data from inflate stream
var output = [];
inflate.on('data', function(chunk) {
output.push(chunk);
});
inflate.on('end', function() {
called++;
assert.equal(output.join(''), input);
if (num < 2) run(num + 1);
});
deflate.write(input);
deflate.flush(function() {
inflate.end();
});
}
run(1);
process.on('exit', function() {
assert.equal(called, 2);
});
| marclundgren/mithril-fidm-app | node_modules/watchify/node_modules/browserify/node_modules/browserify-zlib/test/ignored/test-zlib-dictionary.js | JavaScript | mit | 3,287 |
/*
* blueimp Gallery jQuery plugin 1.2.2
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define([
'jquery',
'./blueimp-gallery'
], factory);
} else {
factory(
window.jQuery,
window.blueimp.Gallery
);
}
}(function ($, Gallery) {
'use strict';
// Global click handler to open links with data-gallery attribute
// in the Gallery lightbox:
$(document).on('click', '[data-gallery]', function (event) {
// Get the container id from the data-gallery attribute:
var id = $(this).data('gallery'),
widget = $(id),
container = (widget.length && widget) ||
$(Gallery.prototype.options.container),
callbacks = {
onopen: function () {
container
.data('gallery', this)
.trigger('open');
},
onopened: function () {
container.trigger('opened');
},
onslide: function () {
container.trigger('slide', arguments);
},
onslideend: function () {
container.trigger('slideend', arguments);
},
onslidecomplete: function () {
container.trigger('slidecomplete', arguments);
},
onclose: function () {
container.trigger('close');
},
onclosed: function () {
container
.trigger('closed')
.removeData('gallery');
}
},
options = $.extend(
// Retrieve custom options from data-attributes
// on the Gallery widget:
container.data(),
{
container: container[0],
index: this,
event: event
},
callbacks
),
// Select all links with the same data-gallery attribute:
links = $('[data-gallery="' + id + '"]');
if (options.filter) {
links = links.filter(options.filter);
}
return new Gallery(links, options);
});
}));
| neveldo/cdnjs | ajax/libs/blueimp-gallery/2.12.5/js/jquery.blueimp-gallery.js | JavaScript | mit | 2,633 |
// Declare internals
var internals = {};
exports.escapeJavaScript = function (input) {
if (!input) {
return '';
}
var escaped = '';
for (var i = 0, il = input.length; i < il; ++i) {
var charCode = input.charCodeAt(i);
if (internals.isSafe(charCode)) {
escaped += input[i];
}
else {
escaped += internals.escapeJavaScriptChar(charCode);
}
}
return escaped;
};
exports.escapeHtml = function (input) {
if (!input) {
return '';
}
var escaped = '';
for (var i = 0, il = input.length; i < il; ++i) {
var charCode = input.charCodeAt(i);
if (internals.isSafe(charCode)) {
escaped += input[i];
}
else {
escaped += internals.escapeHtmlChar(charCode);
}
}
return escaped;
};
internals.escapeJavaScriptChar = function (charCode) {
if (charCode >= 256) {
return '\\u' + internals.padLeft('' + charCode, 4);
}
var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
return '\\x' + internals.padLeft(hexValue, 2);
};
internals.escapeHtmlChar = function (charCode) {
var namedEscape = internals.namedHtml[charCode];
if (typeof namedEscape !== 'undefined') {
return namedEscape;
}
if (charCode >= 256) {
return '&#' + charCode + ';';
}
var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
return '&#x' + internals.padLeft(hexValue, 2) + ';';
};
internals.padLeft = function (str, len) {
while (str.length < len) {
str = '0' + str;
}
return str;
};
internals.isSafe = function (charCode) {
return (typeof internals.safeCharCodes[charCode] !== 'undefined');
};
internals.namedHtml = {
'38': '&',
'60': '<',
'62': '>',
'34': '"',
'160': ' ',
'162': '¢',
'163': '£',
'164': '¤',
'169': '©',
'174': '®'
};
internals.safeCharCodes = (function () {
var safe = {};
for (var i = 32; i < 123; ++i) {
if ((i >= 97 && i <= 122) || // a-z
(i >= 65 && i <= 90) || // A-Z
(i >= 48 && i <= 57) || // 0-9
i === 32 || // space
i === 46 || // .
i === 44 || // ,
i === 45 || // -
i === 58 || // :
i === 95) { // _
safe[i] = null;
}
}
return safe;
}()); | apiology/freezerwatch-gem | node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js | JavaScript | mit | 2,807 |
videojs.addLanguage("zh-CN",{
"Play": "播放",
"Pause": "暂停",
"Current Time": "当前时间",
"Duration Time": "时长",
"Remaining Time": "剩余时间",
"Stream Type": "媒体流类型",
"LIVE": "直播",
"Loaded": "加载完毕",
"Progress": "进度",
"Fullscreen": "全屏",
"Non-Fullscreen": "退出全屏",
"Mute": "静音",
"Unmuted": "取消静音",
"Playback Rate": "播放码率",
"Subtitles": "字幕",
"subtitles off": "字幕关闭",
"Captions": "内嵌字幕",
"captions off": "内嵌字幕关闭",
"Chapters": "节目段落",
"You aborted the video playback": "视频播放被终止",
"A network error caused the video download to fail part-way.": "网络错误导致视频下载中途失败。",
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。",
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。",
"No compatible source was found for this video.": "无法找到此视频兼容的源。",
"The video is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。"
}); | kennynaoh/cdnjs | ajax/libs/video.js/5.0.0-11/lang/zh-CN.js | JavaScript | mit | 1,364 |
var fs = require('fs')
var path = require('path')
var test = require('tape')
var postcss = require('postcss')
var Detector = require('../lib/detect-feature-use')
/*
* Parse the feature-key: count lines in the leading comment of
* each test case fixture.
*/
var parseTestCase = function (cssString) {
var meta = /\s*\/\*(\s*only)?\s*expect:\s*([a-zA-Z0-9\-:\s\n]*)/
var matches = cssString.match(meta)
if (!matches) { return }
var features = {}
matches[2].split('\n')
.filter(function (s) {
return s.trim().length > 0
})
.forEach(function (s) {
var line = s.replace(/\s*/, '').split(':')
var feat = line[0]
var count = +line[1]
features[feat] = count
})
if (Object.keys(features).length > 0) {
return {
only: !!matches[1],
expected: features
}
} else {
return false
}
}
/**
* make a spy callback.
*
* spy functions save results from calls on `spyFn.results`.
*/
var spy = function () {
var results = []
var fn = function (param) {
var feature = param.feature
var usage = param.usage
var obj = {
feature: feature,
location: usage.source.start,
selector: usage.selector,
property: usage.property,
value: usage.value
}
if (results[feature]) {
results[feature]
} else {
results[feature] = []
}
return results[feature].push(obj)
}
fn.results = results
return fn
}
var runTest = function (tc, cssString, expected, only) {
var features = Object.keys(expected).sort()
var testFn = only ? test.only.bind(test) : test
testFn('detecting CSS features (' + tc.replace('.css', '') + ')', function (t) {
var detector = new Detector(features)
var cb = spy()
detector.process(postcss.parse(cssString), cb)
var res = Object.keys(cb.results).sort()
for (var feature in expected) {
if (expected[feature] === 0) {
t.notOk(cb.results[feature])
} else {
t.deepEqual(res, features)
t.equal(cb.results[feature].length, expected[feature], 'count of ' + feature)
}
}
t.end()
})
}
var caseFiles = fs.readdirSync(path.join(__dirname, '/cases'))
.filter(function (tc) { return /\.css$/.test(tc) })
var cases = []
for (var i = 0; i < caseFiles.length; ++i) {
var tc = caseFiles[i]
var cssString = fs.readFileSync(path.join(__dirname, 'cases', tc)).toString()
var parsed = parseTestCase(cssString)
if (parsed) {
var testCase = {
name: tc,
expected: parsed.expected,
cssString: cssString
}
cases.push(testCase)
}
}
cases.forEach(function (testCase) {
runTest(testCase.name, testCase.cssString, testCase.expected, cases.length === 1)
})
| andeemarks/conf-gen-div-react | node_modules/doiuse/test/detect-feature-use.js | JavaScript | mit | 2,715 |
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("fortran",function(){function e(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function t(e,t){if(e.match(c))return"operator";var l=e.next();if("!"==l)return e.skipToEnd(),"comment";if('"'==l||"'"==l)return t.tokenize=n(l),t.tokenize(e,t);if(/[\[\]\(\),]/.test(l))return null;if(/\d/.test(l))return e.eatWhile(/[\w\.]/),"number";if(o.test(l))return e.eatWhile(o),"operator";e.eatWhile(/[\w\$_]/);var s=e.current().toLowerCase();return i.hasOwnProperty(s)?"keyword":a.hasOwnProperty(s)||r.hasOwnProperty(s)?"builtin":"variable"}function n(e){return function(t,n){for(var i,a=!1,r=!1;null!=(i=t.next());){if(i==e&&!a){r=!0;break}a=!a&&"\\"==i}return!r&&a||(n.tokenize=null),"string"}}var i=e(["abstract","accept","allocatable","allocate","array","assign","asynchronous","backspace","bind","block","byte","call","case","class","close","common","contains","continue","cycle","data","deallocate","decode","deferred","dimension","do","elemental","else","encode","end","endif","entry","enumerator","equivalence","exit","external","extrinsic","final","forall","format","function","generic","go","goto","if","implicit","import","include","inquire","intent","interface","intrinsic","module","namelist","non_intrinsic","non_overridable","none","nopass","nullify","open","optional","options","parameter","pass","pause","pointer","print","private","program","protected","public","pure","read","recursive","result","return","rewind","save","select","sequence","stop","subroutine","target","then","to","type","use","value","volatile","where","while","write"]),a=e(["abort","abs","access","achar","acos","adjustl","adjustr","aimag","aint","alarm","all","allocated","alog","amax","amin","amod","and","anint","any","asin","associated","atan","besj","besjn","besy","besyn","bit_size","btest","cabs","ccos","ceiling","cexp","char","chdir","chmod","clog","cmplx","command_argument_count","complex","conjg","cos","cosh","count","cpu_time","cshift","csin","csqrt","ctime","c_funloc","c_loc","c_associated","c_null_ptr","c_null_funptr","c_f_pointer","c_null_char","c_alert","c_backspace","c_form_feed","c_new_line","c_carriage_return","c_horizontal_tab","c_vertical_tab","dabs","dacos","dasin","datan","date_and_time","dbesj","dbesj","dbesjn","dbesy","dbesy","dbesyn","dble","dcos","dcosh","ddim","derf","derfc","dexp","digits","dim","dint","dlog","dlog","dmax","dmin","dmod","dnint","dot_product","dprod","dsign","dsinh","dsin","dsqrt","dtanh","dtan","dtime","eoshift","epsilon","erf","erfc","etime","exit","exp","exponent","extends_type_of","fdate","fget","fgetc","float","floor","flush","fnum","fputc","fput","fraction","fseek","fstat","ftell","gerror","getarg","get_command","get_command_argument","get_environment_variable","getcwd","getenv","getgid","getlog","getpid","getuid","gmtime","hostnm","huge","iabs","iachar","iand","iargc","ibclr","ibits","ibset","ichar","idate","idim","idint","idnint","ieor","ierrno","ifix","imag","imagpart","index","int","ior","irand","isatty","ishft","ishftc","isign","iso_c_binding","is_iostat_end","is_iostat_eor","itime","kill","kind","lbound","len","len_trim","lge","lgt","link","lle","llt","lnblnk","loc","log","logical","long","lshift","lstat","ltime","matmul","max","maxexponent","maxloc","maxval","mclock","merge","move_alloc","min","minexponent","minloc","minval","mod","modulo","mvbits","nearest","new_line","nint","not","or","pack","perror","precision","present","product","radix","rand","random_number","random_seed","range","real","realpart","rename","repeat","reshape","rrspacing","rshift","same_type_as","scale","scan","second","selected_int_kind","selected_real_kind","set_exponent","shape","short","sign","signal","sinh","sin","sleep","sngl","spacing","spread","sqrt","srand","stat","sum","symlnk","system","system_clock","tan","tanh","time","tiny","transfer","transpose","trim","ttynam","ubound","umask","unlink","unpack","verify","xor","zabs","zcos","zexp","zlog","zsin","zsqrt"]),r=e(["c_bool","c_char","c_double","c_double_complex","c_float","c_float_complex","c_funptr","c_int","c_int16_t","c_int32_t","c_int64_t","c_int8_t","c_int_fast16_t","c_int_fast32_t","c_int_fast64_t","c_int_fast8_t","c_int_least16_t","c_int_least32_t","c_int_least64_t","c_int_least8_t","c_intmax_t","c_intptr_t","c_long","c_long_double","c_long_double_complex","c_long_long","c_ptr","c_short","c_signed_char","c_size_t","character","complex","double","integer","logical","real"]),o=/[+\-*&=<>\/\:]/,c=new RegExp("(.and.|.or.|.eq.|.lt.|.le.|.gt.|.ge.|.ne.|.not.|.eqv.|.neqv.)","i");return{startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var i=(n.tokenize||t)(e,n);return i}}}),e.defineMIME("text/x-fortran","fortran")});
//# sourceMappingURL=fortran.min.js.map | holtkamp/cdnjs | ajax/libs/codemirror/5.25.2/mode/fortran/fortran.min.js | JavaScript | mit | 4,949 |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Xunit;
namespace System.Text.Tests
{
public class ConvertUnicodeEncodings
{
// The characters to encode:
// Latin Small Letter Z (U+007A)
// Latin Small Letter A (U+0061)
// Combining Breve (U+0306)
// Latin Small Letter AE With Acute (U+01FD)
// Greek Small Letter Beta (U+03B2)
// a high-surrogate value (U+D8FF)
// a low-surrogate value (U+DCFF)
private static char[] s_myChars = new char[] { 'z', 'a', '\u0306', '\u01FD', '\u03B2', '\uD8FF', '\uDCFF' };
private static string s_myString = new String(s_myChars);
private static byte[] s_leBytes = new byte[] { 0x7A, 0x00, 0x61, 0x00, 0x06, 0x03, 0xFD, 0x01, 0xB2, 0x03, 0xFF, 0xD8, 0xFF, 0xDC };
private static byte[] s_beBytes = new byte[] { 0x00, 0x7A, 0x00, 0x61, 0x03, 0x06, 0x01, 0xFD, 0x03, 0xB2, 0xD8, 0xFF, 0xDC, 0xFF };
private static byte[] s_utf8Bytes = new byte[] { 0x7A, 0x61, 0xCC, 0x86, 0xC7, 0xBD, 0xCE, 0xB2, 0xF1, 0x8F, 0xB3, 0xBF };
[Fact]
public void TestGetEncoding()
{
Encoding unicodeEnc = Encoding.Unicode;
Encoding bigEndianEnc = Encoding.BigEndianUnicode;
Encoding utf8Enc = Encoding.UTF8;
TestEncoding(Encoding.BigEndianUnicode, 14, 16, s_beBytes);
TestEncoding(Encoding.Unicode, 14, 16, s_leBytes);
TestEncoding(Encoding.UTF8, 12, 24, s_utf8Bytes);
unicodeEnc = Encoding.GetEncoding("utf-16");
bigEndianEnc = Encoding.GetEncoding("utf-16BE");
utf8Enc = Encoding.GetEncoding("utf-8");
TestEncoding(Encoding.BigEndianUnicode, 14, 16, s_beBytes);
TestEncoding(Encoding.Unicode, 14, 16, s_leBytes);
TestEncoding(Encoding.UTF8, 12, 24, s_utf8Bytes);
}
[Fact]
public void TestConversion()
{
Assert.Equal(Encoding.Convert(Encoding.Unicode, Encoding.UTF8, s_leBytes), s_utf8Bytes);
Assert.Equal(Encoding.Convert(Encoding.UTF8, Encoding.Unicode, s_utf8Bytes), s_leBytes);
Assert.Equal(Encoding.Convert(Encoding.BigEndianUnicode, Encoding.UTF8, s_beBytes), s_utf8Bytes);
Assert.Equal(Encoding.Convert(Encoding.UTF8, Encoding.BigEndianUnicode, s_utf8Bytes), s_beBytes);
Assert.Equal(Encoding.Convert(Encoding.BigEndianUnicode, Encoding.Unicode, s_beBytes), s_leBytes);
Assert.Equal(Encoding.Convert(Encoding.Unicode, Encoding.BigEndianUnicode, s_leBytes), s_beBytes);
}
private void TestEncoding(Encoding enc, int byteCount, int maxByteCount, byte[] bytes)
{
Assert.Equal(byteCount, enc.GetByteCount(s_myChars));
Assert.Equal(maxByteCount, enc.GetMaxByteCount(s_myChars.Length));
Assert.Equal(enc.GetBytes(s_myChars), bytes);
Assert.Equal(enc.GetCharCount(bytes), s_myChars.Length);
Assert.Equal(enc.GetChars(bytes), s_myChars);
Assert.Equal(enc.GetString(bytes, 0, bytes.Length), s_myString);
Assert.NotEqual(0, enc.GetHashCode());
}
}
} | PatrickMcDonald/corefx | src/System.Text.Encoding/tests/Encoding/ConvertUnicodeEncodings.cs | C# | mit | 3,300 |
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\Common\Annotations;
use Doctrine\Common\Annotations\Annotation\Target;
/**
* Simple Annotation Reader.
*
* This annotation reader is intended to be used in projects where you have
* full-control over all annotations that are available.
*
* @since 2.2
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
* @author Fabio B. Silva <fabio.bat.silva@gmail.com>
*/
class SimpleAnnotationReader implements Reader
{
/**
* @var DocParser
*/
private $parser;
/**
* Constructor.
*
* Initializes a new SimpleAnnotationReader.
*/
public function __construct()
{
$this->parser = new DocParser();
$this->parser->setIgnoreNotImportedAnnotations(true);
}
/**
* Adds a namespace in which we will look for annotations.
*
* @param string $namespace
*/
public function addNamespace($namespace)
{
$this->parser->addNamespace($namespace);
}
/**
* Gets the annotations applied to a class.
*
* @param \ReflectionClass $class The ReflectionClass of the class from which
* the class annotations should be read.
*
* @return array An array of Annotations.
*/
public function getClassAnnotations(\ReflectionClass $class)
{
return $this->parser->parse($class->getDocComment(), 'class '.$class->getName());
}
/**
* Gets the annotations applied to a method.
*
* @param \ReflectionMethod $method The ReflectionMethod of the method from which
* the annotations should be read.
*
* @return array An array of Annotations.
*/
public function getMethodAnnotations(\ReflectionMethod $method)
{
return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()');
}
/**
* Gets the annotations applied to a property.
*
* @param \ReflectionProperty $property The ReflectionProperty of the property
* from which the annotations should be read.
*
* @return array An array of Annotations.
*/
public function getPropertyAnnotations(\ReflectionProperty $property)
{
return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName());
}
/**
* Gets a class annotation.
*
* @param \ReflectionClass $class The ReflectionClass of the class from which
* the class annotations should be read.
* @param string $annotationName The name of the annotation.
*
* @return mixed The Annotation or NULL, if the requested annotation does not exist.
*/
public function getClassAnnotation(\ReflectionClass $class, $annotationName)
{
foreach ($this->getClassAnnotations($class) as $annot) {
if ($annot instanceof $annotationName) {
return $annot;
}
}
return null;
}
/**
* Gets a method annotation.
*
* @param \ReflectionMethod $method
* @param string $annotationName The name of the annotation.
*
* @return mixed The Annotation or NULL, if the requested annotation does not exist.
*/
public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
{
foreach ($this->getMethodAnnotations($method) as $annot) {
if ($annot instanceof $annotationName) {
return $annot;
}
}
return null;
}
/**
* Gets a property annotation.
*
* @param \ReflectionProperty $property
* @param string $annotationName The name of the annotation.
* @return mixed The Annotation or NULL, if the requested annotation does not exist.
*/
public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
{
foreach ($this->getPropertyAnnotations($property) as $annot) {
if ($annot instanceof $annotationName) {
return $annot;
}
}
return null;
}
}
| smailovski/E-institut | vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php | PHP | mit | 5,364 |
// Copyright 2011 The Closure Library Authors. All Rights Reserved.
// Use of this source code is governed by the Apache License, Version 2.0.
goog.provide('goog.vec.RayTest');
goog.setTestOnly('goog.vec.RayTest');
goog.require('goog.vec.Float32Array');
goog.require('goog.vec.Ray');
goog.require('goog.testing.jsunit');
function testConstructor() {
var new_ray = new goog.vec.Ray();
assertElementsEquals([0, 0, 0], new_ray.origin);
assertElementsEquals([0, 0, 0], new_ray.dir);
new_ray = new goog.vec.Ray([1, 2, 3], [4, 5, 6]);
assertElementsEquals([1, 2, 3], new_ray.origin);
assertElementsEquals([4, 5, 6], new_ray.dir);
}
function testSet() {
var new_ray = new goog.vec.Ray();
new_ray.set([2, 3, 4], [5, 6, 7]);
assertElementsEquals([2, 3, 4], new_ray.origin);
assertElementsEquals([5, 6, 7], new_ray.dir);
}
function testSetOrigin() {
var new_ray = new goog.vec.Ray();
new_ray.setOrigin([1, 2, 3]);
assertElementsEquals([1, 2, 3], new_ray.origin);
assertElementsEquals([0, 0, 0], new_ray.dir);
}
function testSetDir() {
var new_ray = new goog.vec.Ray();
new_ray.setDir([2, 3, 4]);
assertElementsEquals([0, 0, 0], new_ray.origin);
assertElementsEquals([2, 3, 4], new_ray.dir);
}
function testEquals() {
var r0 = new goog.vec.Ray([1, 2, 3], [4, 5, 6]);
var r1 = new goog.vec.Ray([5, 2, 3], [4, 5, 6]);
assertFalse(r0.equals(r1));
assertFalse(r0.equals(null));
assertTrue(r1.equals(r1));
r1.setOrigin(r0.origin);
assertTrue(r1.equals(r0));
assertTrue(r0.equals(r1));
}
| carto-tragsatec/visorCatastroColombia | WebContent/visorcatastrocol/lib/openlayers/v4.3.3/closure-library/closure/goog/vec/ray_test.js | JavaScript | mit | 1,532 |
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("proptypes"),require("preact")):"function"==typeof define&&define.amd?define(["proptypes","preact"],e):t.preactCompat=e(t.PropTypes,t.preact)}(this,function(t,e){function r(t){var e=t.nodeName,r=t.attributes;t.attributes={},e.defaultProps&&g(t.attributes,e.defaultProps),r&&g(t.attributes,r),r=t.attributes,t.children&&!t.children.length&&(t.children=void 0),t.children&&(r.children=t.children)}function n(t,e){var r,n,o;if(e){for(o in e)if(r=$.test(o))break;if(r){n=t.attributes={};for(o in e)e.hasOwnProperty(o)&&(n[$.test(o)?o.replace(/([A-Z0-9])/,"-$1").toLowerCase():o]=e[o])}}}function o(t,r,n){var o=r._preactCompatRendered;o&&o.parentNode!==r&&(o=null),o||(o=r.children[0]);for(var i=r.childNodes.length;i--;)r.childNodes[i]!==o&&r.removeChild(r.childNodes[i]);var a=e.render(t,r,o);return r._preactCompatRendered=a,"function"==typeof n&&n(),a&&a._component||a.base}function i(t,r,n,i){var a=e.h(V,{context:t.context},r),p=o(a,n);return i&&i(p),p}function a(t){var r=t._preactCompatRendered;return!(!r||r.parentNode!==t)&&(e.render(e.h(L),t,r),!0)}function p(t){return f.bind(null,t)}function c(t,e){for(var r=e||0;r<t.length;r++){var n=t[r];Array.isArray(n)?c(n):n&&"object"==typeof n&&!y(n)&&(n.props&&n.type||n.attributes&&n.nodeName||n.children)&&(t[r]=f(n.type||n.nodeName,n.props||n.attributes,n.children))}}function s(t){return"function"==typeof t&&!(t.prototype&&t.prototype.render)}function u(t){return P({displayName:t.displayName||t.name,render:function(e,r,n){return t(e,n)}})}function l(t){var e=t[K];return e?e===!0?t:e:(e=u(t),Object.defineProperty(e,K,{configurable:!0,value:!0}),e.displayName=t.displayName,e.propTypes=t.propTypes,e.defaultProps=t.defaultProps,Object.defineProperty(t,K,{configurable:!0,value:e}),e)}function f(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return c(t,2),d(e.h.apply(void 0,t))}function d(t){t.preactCompatNormalized=!0,v(t),s(t.nodeName)&&(t.nodeName=l(t.nodeName));var e=t.attributes.ref,r=e&&typeof e;return!Z||"string"!==r&&"number"!==r||(t.attributes.ref=m(e,Z)),b(t),t}function h(t,r){for(var n=[],o=arguments.length-2;o-- >0;)n[o]=arguments[o+2];if(!y(t))return t;var i=t.attributes||t.props,a=e.h(t.nodeName||t.type,i,t.children||i&&i.children);return d(e.cloneElement.apply(void 0,[a,r].concat(n)))}function y(t){return t&&(t instanceof I||t.$$typeof===j)}function m(t,e){return e._refProxies[t]||(e._refProxies[t]=function(r){e&&e.refs&&(e.refs[t]=r,null===r&&(delete e._refProxies[t],e=null))})}function b(t){var e=t.nodeName,r=t.attributes;if(r&&"string"==typeof e){var n={};for(var o in r)n[o.toLowerCase()]=o;if(n.onchange){e=e.toLowerCase();var i="input"===e&&"checkbox"===String(r.type).toLowerCase()?"onclick":"oninput",a=n[i]||i;r[a]||(r[a]=O([r[n[i]],r[n.onchange]]))}}}function v(t){var e=t.attributes;if(e){var r=e.className||e.class;r&&(e.className=r)}}function g(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function C(t,e){for(var r in t)if(!(r in e))return!0;for(var n in e)if(t[n]!==e[n])return!0;return!1}function N(){}function P(t){function e(e,n){g(this,t),r&&x(this,r),R.call(this,e,n,q),_(this),k.call(this,e,n)}var r=t.mixins&&w(t.mixins);return t.statics&&g(e,t.statics),t.propTypes&&(e.propTypes=t.propTypes),t.defaultProps&&(e.defaultProps=t.defaultProps),t.getDefaultProps&&(e.defaultProps=t.getDefaultProps()),N.prototype=R.prototype,e.prototype=new N,e.prototype.constructor=e,e.displayName=t.displayName||"Component",e}function w(t){for(var e={},r=0;r<t.length;r++){var n=t[r];for(var o in n)n.hasOwnProperty(o)&&"function"==typeof n[o]&&(e[o]||(e[o]=[])).push(n[o])}return e}function x(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=O(e[r].concat(t[r]||r)))}function _(t){for(var e in t){var r=t[e];"function"!=typeof r||r.__bound||M.hasOwnProperty(e)||((t[e]=r.bind(t)).__bound=!0)}}function A(t,e,r){if("string"==typeof e&&(e=t.constructor.prototype[e]),"function"==typeof e)return e.apply(t,r)}function O(t){return function(){for(var e,r=arguments,n=this,o=0;o<t.length;o++){var i=A(n,t[o],r);"undefined"!=typeof i&&(e=i)}return e}}function k(t,e){S.call(this,t,e),this.componentWillReceiveProps=O([S,this.componentWillReceiveProps||"componentWillReceiveProps"]),this.render=O([S,E,this.render||"render",D])}function S(t,e){var r=this;if(t){var n=t.children;if(n&&Array.isArray(n)&&1===n.length&&(t.children=n[0],t.children&&"object"==typeof t.children&&(t.children.length=1,t.children[0]=t.children)),z){var o="function"==typeof this?this:this.constructor,i=this.propTypes||o.propTypes;if(i)for(var a in i)if(i.hasOwnProperty(a)&&"function"==typeof i[a]){var p=r.displayName||o.name,c=i[a](t,a,p,"prop");c&&console.error(new Error(c.message||c))}}}}function E(t){Z=this}function D(){Z===this&&(Z=null)}function R(t,r,n){e.Component.call(this,t,r),this.getInitialState&&(this.state=this.getInitialState()),this.refs={},this._refProxies={},n!==q&&k.call(this,t,r)}function T(t,e){R.call(this,t,e)}t="default"in t?t.default:t;var U="15.1.0",W="a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" "),j="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,M={constructor:1,render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},$=/^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vert|word|writing|x)[A-Z]/,q={},z="undefined"!=typeof process&&process.env&&"production"!==process.env.NODE_ENV,L=function(){return null},I=e.h("").constructor;I.prototype.$$typeof=j,I.prototype.preactCompatUpgraded=!1,I.prototype.preactCompatNormalized=!1,Object.defineProperty(I.prototype,"type",{get:function(){return this.nodeName},set:function(t){this.nodeName=t},configurable:!0}),Object.defineProperty(I.prototype,"props",{get:function(){return this.attributes},set:function(t){this.attributes=t},configurable:!0});var G=e.options.vnode;e.options.vnode=function(t){if(!t.preactCompatUpgraded){t.preactCompatUpgraded=!0;var e=t.nodeName,o=t.attributes;o||(o=t.attributes={}),"function"==typeof e?(e[K]===!0||e.prototype&&"isReactComponent"in e.prototype)&&(t.preactCompatNormalized||d(t),r(t)):o&&n(t,o)}G&&G(t)};var V=function(){};V.prototype.getChildContext=function(){return this.props.context},V.prototype.render=function(t){return t.children[0]};for(var Z,F=[],B={map:function(t,e,r){return t=B.toArray(t),r&&r!==t&&(e=e.bind(r)),t.map(e)},forEach:function(t,e,r){t=B.toArray(t),r&&r!==t&&(e=e.bind(r)),t.forEach(e)},count:function(t){return t=B.toArray(t),t.length},only:function(t){if(t=B.toArray(t),1!==t.length)throw new Error("Children.only() expects only one child.");return t[0]},toArray:function(t){return Array.isArray&&Array.isArray(t)?t:F.concat(t)}},H={},J=W.length;J--;)H[W[J]]=p(W[J]);var K="undefined"!=typeof Symbol?Symbol.for("__preactCompatWrapper"):"__preactCompatWrapper",Q=function(t){return t&&t.base||t};R.prototype=new e.Component,g(R.prototype,{constructor:R,isReactComponent:{},replaceState:function(t,e){var r=this;this.setState(t,e);for(var n in this.state)n in t||delete r.state[n]},getDOMNode:function(){return this.base},isMounted:function(){return!!this.base}}),T.prototype=new R({},{},q),T.prototype.shouldComponentUpdate=function(t,e){return C(this.props,t)||C(this.state,e)};var X={version:U,DOM:H,PropTypes:t,Children:B,render:o,createClass:P,createFactory:p,createElement:f,cloneElement:h,isValidElement:y,findDOMNode:Q,unmountComponentAtNode:a,Component:R,PureComponent:T,unstable_renderSubtreeIntoContainer:i};return X});
//# sourceMappingURL=preact-compat.min.js.map | cdnjs/cdnjs | ajax/libs/preact-compat/3.9.0/preact-compat.min.js | JavaScript | mit | 8,473 |
/*!
* OOjs UI v0.22.1
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2017 OOjs UI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
* Date: 2017-05-31T19:07:44Z
*/.oo-ui-icon-block{background-image:url(themes/apex/images/icons/block.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/block.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/block.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/block.png)}.oo-ui-icon-unBlock{background-image:url(themes/apex/images/icons/unBlock-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unBlock-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/unBlock-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unBlock-ltr.png)}.oo-ui-icon-clip{background-image:url(themes/apex/images/icons/clip.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/clip.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/clip.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/clip.png)}.oo-ui-icon-unClip{background-image:url(themes/apex/images/icons/unClip.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unClip.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/unClip.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unClip.png)}.oo-ui-icon-flag{background-image:url(themes/apex/images/icons/flag-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/flag-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/flag-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/flag-ltr.png)}.oo-ui-icon-unFlag{background-image:url(themes/apex/images/icons/unFlag-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unFlag-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/unFlag-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unFlag-ltr.png)}.oo-ui-icon-lock{background-image:url(themes/apex/images/icons/lock.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/lock.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/lock.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/lock.png)}.oo-ui-icon-unLock{background-image:url(themes/apex/images/icons/unLock-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unLock-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/unLock-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unLock-ltr.png)}.oo-ui-icon-star{background-image:url(themes/apex/images/icons/star.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/star.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/star.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/star.png)}.oo-ui-icon-halfStar{background-image:url(themes/apex/images/icons/halfStar-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/halfStar-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/halfStar-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/halfStar-ltr.png)}.oo-ui-icon-unStar{background-image:url(themes/apex/images/icons/unStar.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unStar.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/unStar.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unStar.png)}.oo-ui-icon-trash{background-image:url(themes/apex/images/icons/trash.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/trash.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/trash.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/trash.png)}.oo-ui-icon-unTrash{background-image:url(themes/apex/images/icons/unTrash-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unTrash-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/unTrash-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/unTrash-ltr.png)}.oo-ui-icon-pushPin{background-image:url(themes/apex/images/icons/pushPin.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/pushPin.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/pushPin.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/pushPin.png)}.oo-ui-icon-ongoingConversation{background-image:url(themes/apex/images/icons/ongoingConversation-ltr.png);background-image:-webkit-linear-gradient(transparent,transparent),url(themes/apex/images/icons/ongoingConversation-ltr.svg);background-image:linear-gradient(transparent,transparent),url(themes/apex/images/icons/ongoingConversation-ltr.svg);background-image:-o-linear-gradient(transparent,transparent),url(themes/apex/images/icons/ongoingConversation-ltr.png)} | BenjaminVanRyseghem/cdnjs | ajax/libs/oojs-ui/0.22.1/oojs-ui-apex-icons-moderation.min.css | CSS | mit | 6,158 |
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.cellx = factory());
}(this, (function () { 'use strict';
var ErrorLogger = {
_handler: null,
/**
* @typesign (handler: (...msg));
*/
setHandler: function setHandler(handler) {
this._handler = handler;
},
/**
* @typesign (...msg);
*/
log: function log() {
this._handler.apply(this, arguments);
}
};
var uidCounter = 0;
/**
* @typesign () -> string;
*/
function nextUID() {
return String(++uidCounter);
}
var Symbol = Function('return this;')().Symbol;
if (!Symbol) {
Symbol = function Symbol(key) {
return '__' + key + '_' + Math.floor(Math.random() * 1e9) + '_' + nextUID() + '__';
};
Symbol.iterator = Symbol('Symbol.iterator');
}
var Symbol$1 = Symbol;
var UID = Symbol$1('cellx.uid');
var CELLS = Symbol$1('cellx.cells');
var global$1 = Function('return this;')();
var hasOwn$1 = Object.prototype.hasOwnProperty;
var Map = global$1.Map;
if (!Map || Map.toString().indexOf('[native code]') == -1 || !new Map([[1, 1]]).size) {
var entryStub = {
value: undefined
};
Map = function Map(entries) {
this._entries = Object.create(null);
this._objectStamps = {};
this._first = null;
this._last = null;
this.size = 0;
if (entries) {
for (var i = 0, l = entries.length; i < l; i++) {
this.set(entries[i][0], entries[i][1]);
}
}
};
Map.prototype = {
constructor: Map,
has: function has(key) {
return !!this._entries[this._getValueStamp(key)];
},
get: function get(key) {
return (this._entries[this._getValueStamp(key)] || entryStub).value;
},
set: function set(key, value) {
var entries = this._entries;
var keyStamp = this._getValueStamp(key);
if (entries[keyStamp]) {
entries[keyStamp].value = value;
} else {
var entry = entries[keyStamp] = {
key: key,
keyStamp: keyStamp,
value: value,
prev: this._last,
next: null
};
if (this.size++) {
this._last.next = entry;
} else {
this._first = entry;
}
this._last = entry;
}
return this;
},
delete: function delete_(key) {
var keyStamp = this._getValueStamp(key);
var entry = this._entries[keyStamp];
if (!entry) {
return false;
}
if (--this.size) {
var prev = entry.prev;
var next = entry.next;
if (prev) {
prev.next = next;
} else {
this._first = next;
}
if (next) {
next.prev = prev;
} else {
this._last = prev;
}
} else {
this._first = null;
this._last = null;
}
delete this._entries[keyStamp];
delete this._objectStamps[keyStamp];
return true;
},
clear: function clear() {
var entries = this._entries;
for (var stamp in entries) {
delete entries[stamp];
}
this._objectStamps = {};
this._first = null;
this._last = null;
this.size = 0;
},
_getValueStamp: function _getValueStamp(value) {
switch (typeof value) {
case 'undefined':
{
return 'undefined';
}
case 'object':
{
if (value === null) {
return 'null';
}
break;
}
case 'boolean':
{
return '?' + value;
}
case 'number':
{
return '+' + value;
}
case 'string':
{
return ',' + value;
}
}
return this._getObjectStamp(value);
},
_getObjectStamp: function _getObjectStamp(obj) {
if (!hasOwn$1.call(obj, UID)) {
if (!Object.isExtensible(obj)) {
var stamps = this._objectStamps;
var stamp;
for (stamp in stamps) {
if (hasOwn$1.call(stamps, stamp) && stamps[stamp] == obj) {
return stamp;
}
}
stamp = nextUID();
stamps[stamp] = obj;
return stamp;
}
Object.defineProperty(obj, UID, {
value: nextUID()
});
}
return obj[UID];
},
forEach: function forEach(cb, context) {
var entry = this._first;
while (entry) {
cb.call(context, entry.value, entry.key, this);
do {
entry = entry.next;
} while (entry && !this._entries[entry.keyStamp]);
}
},
toString: function toString() {
return '[object Map]';
}
};
[['keys', function keys(entry) {
return entry.key;
}], ['values', function values(entry) {
return entry.value;
}], ['entries', function entries(entry) {
return [entry.key, entry.value];
}]].forEach((function (settings) {
var getStepValue = settings[1];
Map.prototype[settings[0]] = function () {
var entries = this._entries;
var entry;
var done = false;
var map = this;
return {
next: function () {
if (!done) {
if (entry) {
do {
entry = entry.next;
} while (entry && !entries[entry.keyStamp]);
} else {
entry = map._first;
}
if (entry) {
return {
value: getStepValue(entry),
done: false
};
}
done = true;
}
return {
value: undefined,
done: true
};
}
};
};
}));
}
if (!Map.prototype[Symbol$1.iterator]) {
Map.prototype[Symbol$1.iterator] = Map.prototype.entries;
}
var Map$1 = Map;
var IS_EVENT = {};
/**
* @typedef {{
* listener: (evt: cellx~Event) -> ?boolean,
* context
* }} cellx~EmitterEvent
*/
/**
* @typedef {{
* target?: Object,
* type: string,
* bubbles?: boolean,
* isPropagationStopped?: boolean
* }} cellx~Event
*/
/**
* @class cellx.EventEmitter
* @extends {Object}
* @typesign new EventEmitter() -> cellx.EventEmitter;
*/
function EventEmitter() {
/**
* @type {{ [type: string]: cellx~EmitterEvent | Array<cellx~EmitterEvent> }}
*/
this._events = new Map$1();
}
EventEmitter.currentlySubscribing = false;
EventEmitter.prototype = {
constructor: EventEmitter,
/**
* @typesign () -> { [type: string]: Array<cellx~EmitterEvent> };
* @typesign (type: string) -> Array<cellx~EmitterEvent>;
*/
getEvents: function getEvents(type) {
var events;
if (type) {
events = this._events.get(type);
if (!events) {
return [];
}
return events._isEvent === IS_EVENT ? [events] : events;
}
events = Object.create(null);
this._events.forEach((function (typeEvents, type) {
events[type] = typeEvents._isEvent === IS_EVENT ? [typeEvents] : typeEvents;
}));
return events;
},
/**
* @typesign (
* type: string,
* listener: (evt: cellx~Event) -> ?boolean,
* context?
* ) -> cellx.EventEmitter;
*
* @typesign (
* listeners: { [type: string]: (evt: cellx~Event) -> ?boolean },
* context?
* ) -> cellx.EventEmitter;
*/
on: function on(type, listener, context) {
if (typeof type == 'object') {
context = arguments.length >= 2 ? listener : this;
var listeners = type;
for (type in listeners) {
this._on(type, listeners[type], context);
}
} else {
this._on(type, listener, arguments.length >= 3 ? context : this);
}
return this;
},
/**
* @typesign (
* type: string,
* listener: (evt: cellx~Event) -> ?boolean,
* context?
* ) -> cellx.EventEmitter;
*
* @typesign (
* listeners: { [type: string]: (evt: cellx~Event) -> ?boolean },
* context?
* ) -> cellx.EventEmitter;
*
* @typesign () -> cellx.EventEmitter;
*/
off: function off(type, listener, context) {
var argCount = arguments.length;
if (argCount) {
if (typeof type == 'object') {
context = argCount >= 2 ? listener : this;
var listeners = type;
for (type in listeners) {
this._off(type, listeners[type], context);
}
} else {
this._off(type, listener, argCount >= 3 ? context : this);
}
} else {
this._events.clear();
}
return this;
},
/**
* @typesign (
* type: string,
* listener: (evt: cellx~Event) -> ?boolean,
* context
* );
*/
_on: function _on(type, listener, context) {
var index = type.indexOf(':');
if (index != -1) {
var propName = type.slice(index + 1);
EventEmitter.currentlySubscribing = true;
(this['_' + propName] || (this[propName], this['_' + propName])).on(type.slice(0, index), listener, context);
EventEmitter.currentlySubscribing = false;
} else {
var events = this._events.get(type);
var evt = {
_isEvent: IS_EVENT,
listener: listener,
context: context
};
if (!events) {
this._events.set(type, evt);
} else if (events._isEvent === IS_EVENT) {
this._events.set(type, [events, evt]);
} else {
events.push(evt);
}
}
},
/**
* @typesign (
* type: string,
* listener: (evt: cellx~Event) -> ?boolean,
* context
* );
*/
_off: function _off(type, listener, context) {
var index = type.indexOf(':');
if (index != -1) {
var propName = type.slice(index + 1);
(this['_' + propName] || (this[propName], this['_' + propName])).off(type.slice(0, index), listener, context);
} else {
var events = this._events.get(type);
if (!events) {
return;
}
var isEvent = events._isEvent === IS_EVENT;
var evt;
if (isEvent || events.length == 1) {
evt = isEvent ? events : events[0];
if (evt.listener == listener && evt.context === context) {
this._events.delete(type);
}
} else {
for (var i = events.length; i;) {
evt = events[--i];
if (evt.listener == listener && evt.context === context) {
events.splice(i, 1);
break;
}
}
}
}
},
/**
* @typesign (
* type: string,
* listener: (evt: cellx~Event) -> ?boolean,
* context?
* ) -> (evt: cellx~Event) -> ?boolean;
*/
once: function once(type, listener, context) {
if (arguments.length < 3) {
context = this;
}
function wrapper(evt) {
this._off(type, wrapper, context);
return listener.call(this, evt);
}
this._on(type, wrapper, context);
return wrapper;
},
/**
* @typesign (evt: cellx~Event) -> cellx~Event;
* @typesign (type: string) -> cellx~Event;
*/
emit: function emit(evt) {
if (typeof evt == 'string') {
evt = {
target: this,
type: evt
};
} else if (!evt.target) {
evt.target = this;
} else if (evt.target != this) {
throw new TypeError('Event cannot be emitted on this object');
}
this._handleEvent(evt);
return evt;
},
/**
* @typesign (evt: cellx~Event);
*
* For override:
* @example
* function View(el) {
* this.element = el;
* el._view = this;
* }
*
* View.prototype = {
* __proto__: EventEmitter.prototype,
* constructor: View,
*
* getParent: function() {
* var node = this.element;
*
* while (node = node.parentNode) {
* if (node._view) {
* return node._view;
* }
* }
*
* return null;
* },
*
* _handleEvent: function(evt) {
* EventEmitter.prototype._handleEvent.call(this, evt);
*
* if (evt.bubbles !== false && !evt.isPropagationStopped) {
* var parent = this.getParent();
*
* if (parent) {
* parent._handleEvent(evt);
* }
* }
* }
* };
*/
_handleEvent: function _handleEvent(evt) {
var events = this._events.get(evt.type);
if (!events) {
return;
}
if (events._isEvent === IS_EVENT) {
if (this._tryEventListener(events, evt) === false) {
evt.isPropagationStopped = true;
}
} else {
var eventCount = events.length;
if (eventCount == 1) {
if (this._tryEventListener(events[0], evt) === false) {
evt.isPropagationStopped = true;
}
} else {
events = events.slice();
for (var i = 0; i < eventCount; i++) {
if (this._tryEventListener(events[i], evt) === false) {
evt.isPropagationStopped = true;
}
}
}
}
},
/**
* @typesign (emEvt: cellx~EmitterEvent, evt: cellx~Event);
*/
_tryEventListener: function _tryEventListener(emEvt, evt) {
try {
return emEvt.listener.call(emEvt.context, evt);
} catch (err) {
this._logError(err);
}
},
/**
* @typesign (...msg);
*/
_logError: function _logError() {
ErrorLogger.log.apply(ErrorLogger, arguments);
}
};
function ObservableCollectionMixin() {
/**
* @type {Map<*, uint>}
*/
this._valueCounts = new Map$1();
}
ObservableCollectionMixin.prototype = {
/**
* @typesign (evt: cellx~Event);
*/
_onItemChange: function _onItemChange(evt) {
this._handleEvent(evt);
},
/**
* @typesign (value);
*/
_registerValue: function _registerValue(value) {
var valueCounts = this._valueCounts;
var valueCount = valueCounts.get(value);
if (valueCount) {
valueCounts.set(value, valueCount + 1);
} else {
valueCounts.set(value, 1);
if (this.adoptsValueChanges && value instanceof EventEmitter) {
value.on('change', this._onItemChange, this);
}
}
},
/**
* @typesign (value);
*/
_unregisterValue: function _unregisterValue(value) {
var valueCounts = this._valueCounts;
var valueCount = valueCounts.get(value);
if (valueCount > 1) {
valueCounts.set(value, valueCount - 1);
} else {
valueCounts.delete(value);
if (this.adoptsValueChanges && value instanceof EventEmitter) {
value.off('change', this._onItemChange, this);
}
}
}
};
/**
* @typesign (a, b) -> boolean;
*/
var is = Object.is || function is(a, b) {
if (a === 0 && b === 0) {
return 1 / a == 1 / b;
}
return a === b || a != a && b != b;
};
/**
* @typesign (target: Object, ...sources: Array<Object>) -> Object;
*/
function mixin(target, source) {
var names = Object.getOwnPropertyNames(source);
for (var i = 0, l = names.length; i < l; i++) {
var name = names[i];
Object.defineProperty(target, name, Object.getOwnPropertyDescriptor(source, name));
}
if (arguments.length > 2) {
var i = 2;
do {
mixin(target, arguments[i]);
} while (++i < arguments.length);
}
return target;
}
/**
* @class cellx.ObservableMap
* @extends {cellx.EventEmitter}
* @implements {cellx.ObservableCollectionMixin}
*
* @typesign new ObservableMap(entries?: Object | cellx.ObservableMap | Map | Array<{ 0, 1 }>, opts?: {
* adoptsValueChanges?: boolean
* }) -> cellx.ObservableMap;
*
* @typesign new ObservableMap(
* entries?: Object | cellx.ObservableMap | Map | Array<{ 0, 1 }>,
* adoptsValueChanges?: boolean
* ) -> cellx.ObservableMap;
*/
function ObservableMap(entries, opts) {
EventEmitter.call(this);
ObservableCollectionMixin.call(this);
if (typeof opts == 'boolean') {
opts = { adoptsValueChanges: opts };
}
this._entries = new Map$1();
this.size = 0;
/**
* @type {boolean}
*/
this.adoptsValueChanges = !!(opts && opts.adoptsValueChanges);
if (entries) {
var mapEntries = this._entries;
if (entries instanceof ObservableMap || entries instanceof Map$1) {
entries._entries.forEach((function (value, key) {
this._registerValue(value);
mapEntries.set(key, value);
}), this);
} else if (Array.isArray(entries)) {
for (var i = 0, l = entries.length; i < l; i++) {
var entry = entries[i];
this._registerValue(entry[1]);
mapEntries.set(entry[0], entry[1]);
}
} else {
for (var key in entries) {
this._registerValue(entries[key]);
mapEntries.set(key, entries[key]);
}
}
this.size = mapEntries.size;
}
}
ObservableMap.prototype = mixin({ __proto__: EventEmitter.prototype }, ObservableCollectionMixin.prototype, {
constructor: ObservableMap,
/**
* @typesign (key) -> boolean;
*/
has: function has(key) {
return this._entries.has(key);
},
/**
* @typesign (value) -> boolean;
*/
contains: function contains(value) {
return this._valueCounts.has(value);
},
/**
* @typesign (key) -> *;
*/
get: function get(key) {
return this._entries.get(key);
},
/**
* @typesign (key, value) -> cellx.ObservableMap;
*/
set: function set(key, value) {
var entries = this._entries;
var hasKey = entries.has(key);
var oldValue;
if (hasKey) {
oldValue = entries.get(key);
if (is(value, oldValue)) {
return this;
}
this._unregisterValue(oldValue);
}
this._registerValue(value);
entries.set(key, value);
if (!hasKey) {
this.size++;
}
this.emit({
type: 'change',
subtype: hasKey ? 'update' : 'add',
key: key,
oldValue: oldValue,
value: value
});
return this;
},
/**
* @typesign (key) -> boolean;
*/
delete: function delete_(key) {
var entries = this._entries;
if (!entries.has(key)) {
return false;
}
var value = entries.get(key);
this._unregisterValue(value);
entries.delete(key);
this.size--;
this.emit({
type: 'change',
subtype: 'delete',
key: key,
oldValue: value,
value: undefined
});
return true;
},
/**
* @typesign () -> cellx.ObservableMap;
*/
clear: function clear() {
if (!this.size) {
return this;
}
if (this.adoptsValueChanges) {
this._valueCounts.forEach((function (value) {
if (value instanceof EventEmitter) {
value.off('change', this._onItemChange, this);
}
}), this);
}
this._entries.clear();
this._valueCounts.clear();
this.size = 0;
this.emit({
type: 'change',
subtype: 'clear'
});
return this;
},
/**
* @typesign (
* cb: (value, key, map: cellx.ObservableMap),
* context?
* );
*/
forEach: function forEach(cb, context) {
this._entries.forEach((function (value, key) {
cb.call(context, value, key, this);
}), this);
},
/**
* @typesign () -> { next: () -> { value, done: boolean } };
*/
keys: function keys() {
return this._entries.keys();
},
/**
* @typesign () -> { next: () -> { value, done: boolean } };
*/
values: function values() {
return this._entries.values();
},
/**
* @typesign () -> { next: () -> { value: { 0, 1 }, done: boolean } };
*/
entries: function entries() {
return this._entries.entries();
},
/**
* @typesign () -> cellx.ObservableMap;
*/
clone: function clone() {
return new this.constructor(this, {
adoptsValueChanges: this.adoptsValueChanges
});
}
});
ObservableMap.prototype[Symbol$1.iterator] = ObservableMap.prototype.entries;
var push = Array.prototype.push;
var splice = Array.prototype.splice;
/**
* @typesign (a, b) -> -1 | 1 | 0;
*/
function defaultComparator(a, b) {
return a < b ? -1 : a > b ? 1 : 0;
}
/**
* @class cellx.ObservableList
* @extends {cellx.EventEmitter}
* @implements {cellx.ObservableCollectionMixin}
*
* @typesign new ObservableList(items?: Array | cellx.ObservableList, opts?: {
* adoptsValueChanges?: boolean,
* comparator?: (a, b) -> int,
* sorted?: boolean
* }) -> cellx.ObservableList;
*
* @typesign new ObservableList(
* items?: Array | cellx.ObservableList,
* adoptsValueChanges?: boolean
* ) -> cellx.ObservableList;
*/
function ObservableList(items, opts) {
EventEmitter.call(this);
ObservableCollectionMixin.call(this);
if (typeof opts == 'boolean') {
opts = { adoptsValueChanges: opts };
}
this._items = [];
this.length = 0;
/**
* @type {boolean}
*/
this.adoptsValueChanges = !!(opts && opts.adoptsValueChanges);
/**
* @type {?(a, b) -> int}
*/
this.comparator = null;
this.sorted = false;
if (opts && (opts.sorted || opts.comparator && opts.sorted !== false)) {
this.comparator = opts.comparator || defaultComparator;
this.sorted = true;
}
if (items) {
this._addRange(items);
}
}
ObservableList.prototype = mixin({ __proto__: EventEmitter.prototype }, ObservableCollectionMixin.prototype, {
constructor: ObservableList,
/**
* @typesign (index: ?int, allowedEndIndex?: boolean) -> ?uint;
*/
_validateIndex: function _validateIndex(index, allowedEndIndex) {
if (index === undefined) {
return index;
}
if (index < 0) {
index += this.length;
if (index < 0) {
throw new RangeError('Index out of valid range');
}
} else if (index >= this.length + (allowedEndIndex ? 1 : 0)) {
throw new RangeError('Index out of valid range');
}
return index;
},
/**
* @typesign (value) -> boolean;
*/
contains: function contains(value) {
return this._valueCounts.has(value);
},
/**
* @typesign (value, fromIndex?: int) -> int;
*/
indexOf: function indexOf(value, fromIndex) {
return this._items.indexOf(value, this._validateIndex(fromIndex, true));
},
/**
* @typesign (value, fromIndex?: int) -> int;
*/
lastIndexOf: function lastIndexOf(value, fromIndex) {
return this._items.lastIndexOf(value, fromIndex === undefined ? -1 : this._validateIndex(fromIndex, true));
},
/**
* @typesign (index: int) -> *;
*/
get: function get(index) {
return this._items[this._validateIndex(index, true)];
},
/**
* @typesign (index: int, count?: uint) -> Array;
*/
getRange: function getRange(index, count) {
index = this._validateIndex(index, true);
var items = this._items;
if (count === undefined) {
return items.slice(index);
}
if (index + count > items.length) {
throw new RangeError('Sum of "index" and "count" out of valid range');
}
return items.slice(index, index + count);
},
/**
* @typesign (index: int, value) -> cellx.ObservableList;
*/
set: function set(index, value) {
if (this.sorted) {
throw new TypeError('Cannot set to sorted list');
}
index = this._validateIndex(index, true);
var items = this._items;
if (is(value, items[index])) {
return this;
}
this._unregisterValue(items[index]);
this._registerValue(value);
items[index] = value;
this.emit('change');
return this;
},
/**
* @typesign (index: int, values: Array | cellx.ObservableList) -> cellx.ObservableList;
*/
setRange: function setRange(index, values) {
if (this.sorted) {
throw new TypeError('Cannot set to sorted list');
}
index = this._validateIndex(index, true);
if (values instanceof ObservableList) {
values = values._items;
}
var valueCount = values.length;
if (!valueCount) {
return this;
}
if (index + valueCount > this.length) {
throw new RangeError('Sum of "index" and "values.length" out of valid range');
}
var items = this._items;
var changed = false;
for (var i = index + valueCount; i > index;) {
var value = values[--i - index];
if (!is(value, items[i])) {
this._unregisterValue(items[i]);
this._registerValue(value);
items[i] = value;
changed = true;
}
}
if (changed) {
this.emit('change');
}
return this;
},
/**
* @typesign (value) -> cellx.ObservableList;
*/
add: function add(value) {
if (this.sorted) {
this._insertValue(value);
} else {
this._registerValue(value);
this._items.push(value);
}
this.length++;
this.emit('change');
return this;
},
/**
* @typesign (values: Array | cellx.ObservableList) -> cellx.ObservableList;
*/
addRange: function addRange(values) {
if (values.length) {
this._addRange(values);
this.emit('change');
}
return this;
},
/**
* @typesign (values: Array | cellx.ObservableList);
*/
_addRange: function _addRange(values) {
if (values instanceof ObservableList) {
values = values._items;
}
if (this.sorted) {
for (var i = 0, l = values.length; i < l; i++) {
this._insertValue(values[i]);
}
this.length += values.length;
} else {
for (var j = values.length; j;) {
this._registerValue(values[--j]);
}
this.length = push.apply(this._items, values);
}
},
/**
* @typesign (value);
*/
_insertValue: function _insertValue(value) {
this._registerValue(value);
var items = this._items;
var comparator = this.comparator;
var low = 0;
var high = items.length;
while (low != high) {
var mid = low + high >> 1;
if (comparator(value, items[mid]) < 0) {
high = mid;
} else {
low = mid + 1;
}
}
items.splice(low, 0, value);
},
/**
* @typesign (index: int, value) -> cellx.ObservableList;
*/
insert: function insert(index, value) {
if (this.sorted) {
throw new TypeError('Cannot insert to sorted list');
}
index = this._validateIndex(index, true);
this._registerValue(value);
this._items.splice(index, 0, value);
this.length++;
this.emit('change');
return this;
},
/**
* @typesign (index: int, values: Array | cellx.ObservableList) -> cellx.ObservableList;
*/
insertRange: function insertRange(index, values) {
if (this.sorted) {
throw new TypeError('Cannot insert to sorted list');
}
index = this._validateIndex(index, true);
if (values instanceof ObservableList) {
values = values._items;
}
var valueCount = values.length;
if (!valueCount) {
return this;
}
for (var i = valueCount; i;) {
this._registerValue(values[--i]);
}
splice.apply(this._items, [index, 0].concat(values));
this.length += valueCount;
this.emit('change');
return this;
},
/**
* @typesign (value, fromIndex?: int) -> boolean;
*/
remove: function remove(value, fromIndex) {
var index = this._items.indexOf(value, this._validateIndex(fromIndex, true));
if (index == -1) {
return false;
}
this._unregisterValue(value);
this._items.splice(index, 1);
this.length--;
this.emit('change');
return true;
},
/**
* @typesign (value, fromIndex?: int) -> boolean;
*/
removeAll: function removeAll(value, fromIndex) {
var index = this._validateIndex(fromIndex, true);
var items = this._items;
var changed = false;
while ((index = items.indexOf(value, index)) != -1) {
this._unregisterValue(value);
items.splice(index, 1);
changed = true;
}
if (changed) {
this.length = items.length;
this.emit('change');
}
return changed;
},
/**
* @typesign (values: Array | cellx.ObservableList, fromIndex?: int) -> boolean;
*/
removeEach: function removeEach(values, fromIndex) {
fromIndex = this._validateIndex(fromIndex, true);
if (values instanceof ObservableList) {
values = values._items;
}
var items = this._items;
var changed = false;
for (var i = 0, l = values.length; i < l; i++) {
var value = values[i];
var index = items.indexOf(value, fromIndex);
if (index != -1) {
this._unregisterValue(value);
items.splice(index, 1);
changed = true;
}
}
if (changed) {
this.length = items.length;
this.emit('change');
}
return changed;
},
/**
* @typesign (values: Array | cellx.ObservableList, fromIndex?: int) -> boolean;
*/
removeAllEach: function removeAllEach(values, fromIndex) {
fromIndex = this._validateIndex(fromIndex, true);
if (values instanceof ObservableList) {
values = values._items;
}
var items = this._items;
var changed = false;
for (var i = 0, l = values.length; i < l; i++) {
var value = values[i];
for (var index = fromIndex; (index = items.indexOf(value, index)) != -1;) {
this._unregisterValue(value);
items.splice(index, 1);
changed = true;
}
}
if (changed) {
this.length = items.length;
this.emit('change');
}
return changed;
},
/**
* @typesign (index: int) -> *;
*/
removeAt: function removeAt(index) {
var value = this._items.splice(this._validateIndex(index), 1)[0];
this._unregisterValue(value);
this.length--;
this.emit('change');
return value;
},
/**
* @typesign (index: int, count?: uint) -> Array;
*/
removeRange: function removeRange(index, count) {
index = this._validateIndex(index, true);
var items = this._items;
if (count === undefined) {
count = items.length - index;
} else if (index + count > items.length) {
throw new RangeError('Sum of "index" and "count" out of valid range');
}
if (!count) {
return [];
}
for (var i = index + count; i > index;) {
this._unregisterValue(items[--i]);
}
var values = items.splice(index, count);
this.length -= count;
this.emit('change');
return values;
},
/**
* @typesign () -> cellx.ObservableList;
*/
clear: function clear() {
if (!this.length) {
return this;
}
if (this.adoptsValueChanges) {
this._valueCounts.forEach((function (value) {
if (value instanceof EventEmitter) {
value.off('change', this._onItemChange, this);
}
}), this);
}
this._items.length = 0;
this._valueCounts.clear();
this.length = 0;
this.emit({
type: 'change',
subtype: 'clear'
});
return this;
},
/**
* @typesign (separator?: string) -> string;
*/
join: function join(separator) {
return this._items.join(separator);
},
/**
* @typesign (
* cb: (item, index: uint, list: cellx.ObservableList),
* context?
* );
*/
forEach: null,
/**
* @typesign (
* cb: (item, index: uint, list: cellx.ObservableList) -> *,
* context?
* ) -> Array;
*/
map: null,
/**
* @typesign (
* cb: (item, index: uint, list: cellx.ObservableList) -> ?boolean,
* context?
* ) -> Array;
*/
filter: null,
/**
* @typesign (
* cb: (item, index: uint, list: cellx.ObservableList) -> ?boolean,
* context?
* ) -> *;
*/
find: function (cb, context) {
var items = this._items;
for (var i = 0, l = items.length; i < l; i++) {
var item = items[i];
if (cb.call(context, item, i, this)) {
return item;
}
}
},
/**
* @typesign (
* cb: (item, index: uint, list: cellx.ObservableList) -> ?boolean,
* context?
* ) -> int;
*/
findIndex: function (cb, context) {
var items = this._items;
for (var i = 0, l = items.length; i < l; i++) {
if (cb.call(context, items[i], i, this)) {
return i;
}
}
return -1;
},
/**
* @typesign (
* cb: (item, index: uint, list: cellx.ObservableList) -> ?boolean,
* context?
* ) -> boolean;
*/
every: null,
/**
* @typesign (
* cb: (item, index: uint, list: cellx.ObservableList) -> ?boolean,
* context?
* ) -> boolean;
*/
some: null,
/**
* @typesign (
* cb: (accumulator, item, index: uint, list: cellx.ObservableList) -> *,
* initialValue?
* ) -> *;
*/
reduce: null,
/**
* @typesign (
* cb: (accumulator, item, index: uint, list: cellx.ObservableList) -> *,
* initialValue?
* ) -> *;
*/
reduceRight: null,
/**
* @typesign () -> cellx.ObservableList;
*/
clone: function clone() {
return new this.constructor(this, {
adoptsValueChanges: this.adoptsValueChanges,
comparator: this.comparator,
sorted: this.sorted
});
},
/**
* @typesign () -> Array;
*/
toArray: function toArray() {
return this._items.slice();
},
/**
* @typesign () -> string;
*/
toString: function toString() {
return this._items.join();
}
});
['forEach', 'map', 'filter', 'every', 'some'].forEach((function (name) {
ObservableList.prototype[name] = function (cb, context) {
return this._items[name]((function (item, index) {
return cb.call(context, item, index, this);
}), this);
};
}));
['reduce', 'reduceRight'].forEach((function (name) {
ObservableList.prototype[name] = function (cb, initialValue) {
var items = this._items;
var list = this;
function wrapper(accumulator, item, index) {
return cb(accumulator, item, index, list);
}
return arguments.length >= 2 ? items[name](wrapper, initialValue) : items[name](wrapper);
};
}));
[['keys', function keys(index) {
return index;
}], ['values', function values(index, item) {
return item;
}], ['entries', function entries(index, item) {
return [index, item];
}]].forEach((function (settings) {
var getStepValue = settings[1];
ObservableList.prototype[settings[0]] = function () {
var items = this._items;
var index = 0;
var done = false;
return {
next: function () {
if (!done) {
if (index < items.length) {
return {
value: getStepValue(index, items[index++]),
done: false
};
}
done = true;
}
return {
value: undefined,
done: true
};
}
};
};
}));
ObservableList.prototype[Symbol$1.iterator] = ObservableList.prototype.values;
/**
* @typesign (cb: ());
*/
var nextTick;
/* istanbul ignore next */
if (global$1.process && process.toString() == '[object process]' && process.nextTick) {
nextTick = process.nextTick;
} else if (global$1.setImmediate) {
nextTick = function nextTick(cb) {
setImmediate(cb);
};
} else if (global$1.Promise && Promise.toString().indexOf('[native code]') != -1) {
var prm = Promise.resolve();
nextTick = function nextTick(cb) {
prm.then((function () {
cb();
}));
};
} else {
var queue;
global$1.addEventListener('message', (function () {
if (queue) {
var track = queue;
queue = null;
for (var i = 0, l = track.length; i < l; i++) {
try {
track[i]();
} catch (err) {
ErrorLogger.log(err);
}
}
}
}));
nextTick = function nextTick(cb) {
if (queue) {
queue.push(cb);
} else {
queue = [cb];
postMessage('__tic__', '*');
}
};
}
var nextTick$1 = nextTick;
function noop() {}
var slice$1 = Array.prototype.slice;
var EventEmitterProto = EventEmitter.prototype;
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 0x1fffffffffffff;
var KEY_WRAPPERS = Symbol$1('wrappers');
var errorIndexCounter = 0;
var pushingIndexCounter = 0;
var releasePlan = new Map$1();
var releasePlanIndex = MAX_SAFE_INTEGER;
var releasePlanToIndex = -1;
var releasePlanned = false;
var currentlyRelease = false;
var currentCell = null;
var error = { original: null };
var releaseVersion = 1;
var transactionLevel = 0;
var transactionFailure = false;
var pendingReactions = [];
var afterReleaseCallbacks;
var STATE_INITED = 128;
var STATE_CURRENTLY_PULLING = 64;
var STATE_ACTIVE = 32;
var STATE_HAS_FOLLOWERS = 16;
var STATE_PENDING = 8;
var STATE_FULFILLED = 4;
var STATE_REJECTED = 2;
var STATE_CAN_CANCEL_CHANGE = 1;
function release() {
if (!releasePlanned) {
return;
}
releasePlanned = false;
currentlyRelease = true;
var queue = releasePlan.get(releasePlanIndex);
for (;;) {
var cell = queue && queue.shift();
if (!cell) {
if (releasePlanIndex == releasePlanToIndex) {
break;
}
queue = releasePlan.get(++releasePlanIndex);
continue;
}
var level = cell._level;
var changeEvent = cell._changeEvent;
if (!changeEvent) {
if (level > releasePlanIndex || cell._levelInRelease == -1) {
if (!queue.length) {
if (releasePlanIndex == releasePlanToIndex) {
break;
}
queue = releasePlan.get(++releasePlanIndex);
}
continue;
}
cell.pull();
level = cell._level;
if (level > releasePlanIndex) {
if (!queue.length) {
queue = releasePlan.get(++releasePlanIndex);
}
continue;
}
changeEvent = cell._changeEvent;
}
cell._levelInRelease = -1;
if (changeEvent) {
var oldReleasePlanIndex = releasePlanIndex;
cell._fixedValue = cell._value;
cell._changeEvent = null;
cell._handleEvent(changeEvent);
var pushingIndex = cell._pushingIndex;
var slaves = cell._slaves;
for (var i = 0, l = slaves.length; i < l; i++) {
var slave = slaves[i];
if (slave._level <= level) {
slave._level = level + 1;
}
if (pushingIndex >= slave._pushingIndex) {
slave._pushingIndex = pushingIndex;
slave._changeEvent = null;
slave._addToRelease();
}
}
if (releasePlanIndex != oldReleasePlanIndex) {
queue = releasePlan.get(releasePlanIndex);
continue;
}
}
if (!queue.length) {
if (releasePlanIndex == releasePlanToIndex) {
break;
}
queue = releasePlan.get(++releasePlanIndex);
}
}
releasePlanIndex = MAX_SAFE_INTEGER;
releasePlanToIndex = -1;
currentlyRelease = false;
releaseVersion++;
if (afterReleaseCallbacks) {
var callbacks = afterReleaseCallbacks;
afterReleaseCallbacks = null;
for (var j = 0, m = callbacks.length; j < m; j++) {
callbacks[j]();
}
}
}
/**
* @typesign (cell: Cell, value);
*/
function defaultPut(cell, value) {
cell.push(value);
}
var config = {
asynchronous: true
};
/**
* @class cellx.Cell
* @extends {cellx.EventEmitter}
*
* @example
* var a = new Cell(1);
* var b = new Cell(2);
* var c = new Cell(function() {
* return a.get() + b.get();
* });
*
* c.on('change', function() {
* console.log('c = ' + c.get());
* });
*
* console.log(c.get());
* // => 3
*
* a.set(5);
* b.set(10);
* // => 'c = 15'
*
* @typesign new Cell(value?, opts?: {
* debugKey?: string,
* owner?: Object,
* get?: (value) -> *,
* validate?: (value, oldValue),
* merge: (value, oldValue) -> *,
* put?: (cell: Cell, value, oldValue),
* reap?: (),
* onChange?: (evt: cellx~Event) -> ?boolean,
* onError?: (evt: cellx~Event) -> ?boolean
* }) -> cellx.Cell;
*
* @typesign new Cell(pull: (cell: Cell, next) -> *, opts?: {
* debugKey?: string,
* owner?: Object,
* get?: (value) -> *,
* validate?: (value, oldValue),
* merge: (value, oldValue) -> *,
* put?: (cell: Cell, value, oldValue),
* reap?: (),
* onChange?: (evt: cellx~Event) -> ?boolean,
* onError?: (evt: cellx~Event) -> ?boolean
* }) -> cellx.Cell;
*/
function Cell(value, opts) {
EventEmitter.call(this);
this.debugKey = opts && opts.debugKey;
this.owner = opts && opts.owner || this;
this._pull = typeof value == 'function' ? value : null;
this._get = opts && opts.get || null;
this._validate = opts && opts.validate || null;
this._merge = opts && opts.merge || null;
this._put = opts && opts.put || defaultPut;
this._onFulfilled = this._onRejected = null;
this._reap = opts && opts.reap || null;
if (this._pull) {
this._fixedValue = this._value = undefined;
} else {
if (this._validate) {
this._validate(value, undefined);
}
if (this._merge) {
value = this._merge(value, undefined);
}
this._fixedValue = this._value = value;
if (value instanceof EventEmitter) {
value.on('change', this._onValueChange, this);
}
}
this._error = null;
this._selfErrorCell = null;
this._errorCell = null;
this._errorIndex = 0;
this._pushingIndex = 0;
this._version = 0;
/**
* Ведущие ячейки.
* @type {?Array<cellx.Cell>}
*/
this._masters = undefined;
/**
* Ведомые ячейки.
* @type {Array<cellx.Cell>}
*/
this._slaves = [];
this._level = 0;
this._levelInRelease = -1;
this._selfPendingStatusCell = null;
this._pendingStatusCell = null;
this._status = null;
this._changeEvent = null;
this._lastErrorEvent = null;
this._state = STATE_CAN_CANCEL_CHANGE;
if (opts) {
if (opts.onChange) {
this.on('change', opts.onChange);
}
if (opts.onError) {
this.on('error', opts.onError);
}
}
}
mixin(Cell, {
/**
* @typesign (cnfg: { asynchronous?: boolean });
*/
configure: function configure(cnfg) {
if (cnfg.asynchronous !== undefined) {
if (releasePlanned) {
release();
}
config.asynchronous = cnfg.asynchronous;
}
},
/**
* @type {boolean}
*/
get currentlyPulling() {
return !!currentCell;
},
/**
* @typesign (cb: (), context?) -> ();
*/
autorun: function autorun(cb, context) {
var disposer;
new Cell(function () {
var cell = this;
if (!disposer) {
disposer = function disposer() {
cell.dispose();
};
}
if (transactionLevel) {
var index = pendingReactions.indexOf(this);
if (index != -1) {
pendingReactions.splice(index, 1);
}
pendingReactions.push(this);
} else {
cb.call(context, disposer);
}
}, { onChange: noop });
return disposer;
},
/**
* @typesign ();
*/
forceRelease: function forceRelease() {
if (releasePlanned) {
release();
}
},
/**
* @typesign (cb: ());
*/
transaction: function transaction(cb) {
if (!transactionLevel++ && releasePlanned) {
release();
}
try {
cb();
} catch (err) {
ErrorLogger.log(err);
transactionFailure = true;
}
if (transactionFailure) {
for (var iterator = releasePlan.values(), step; !(step = iterator.next()).done;) {
var queue = step.value;
for (var i = queue.length; i;) {
var cell = queue[--i];
cell._value = cell._fixedValue;
cell._levelInRelease = -1;
cell._changeEvent = null;
}
}
releasePlan.clear();
releasePlanIndex = MAX_SAFE_INTEGER;
releasePlanToIndex = -1;
releasePlanned = false;
pendingReactions.length = 0;
}
if (! --transactionLevel && !transactionFailure) {
for (var i = 0, l = pendingReactions.length; i < l; i++) {
var reaction = pendingReactions[i];
if (reaction instanceof Cell) {
reaction.pull();
} else {
EventEmitterProto._handleEvent.call(reaction[1], reaction[0]);
}
}
transactionFailure = false;
pendingReactions.length = 0;
if (releasePlanned) {
release();
}
}
},
/**
* @typesign (cb: ());
*/
afterRelease: function afterRelease(cb) {
(afterReleaseCallbacks || (afterReleaseCallbacks = [])).push(cb);
}
});
Cell.prototype = {
__proto__: EventEmitter.prototype,
constructor: Cell,
_handleEvent: function _handleEvent(evt) {
if (transactionLevel) {
pendingReactions.push([evt, this]);
} else {
EventEmitterProto._handleEvent.call(this, evt);
}
},
/**
* @override
*/
on: function on(type, listener, context) {
if (releasePlanned) {
release();
}
this._activate();
if (typeof type == 'object') {
EventEmitterProto.on.call(this, type, arguments.length >= 2 ? listener : this.owner);
} else {
EventEmitterProto.on.call(this, type, listener, arguments.length >= 3 ? context : this.owner);
}
this._state |= STATE_HAS_FOLLOWERS;
return this;
},
/**
* @override
*/
off: function off(type, listener, context) {
if (releasePlanned) {
release();
}
var argCount = arguments.length;
if (argCount) {
if (typeof type == 'object') {
EventEmitterProto.off.call(this, type, argCount >= 2 ? listener : this.owner);
} else {
EventEmitterProto.off.call(this, type, listener, argCount >= 3 ? context : this.owner);
}
} else {
EventEmitterProto.off.call(this);
}
if (!this._slaves.length && !this._events.has('change') && !this._events.has('error') && this._state & STATE_HAS_FOLLOWERS) {
this._state ^= STATE_HAS_FOLLOWERS;
this._deactivate();
if (this._reap) {
this._reap.call(this.owner);
}
}
return this;
},
/**
* @typesign (
* listener: (evt: cellx~Event) -> ?boolean,
* context?
* ) -> cellx.Cell;
*/
addChangeListener: function addChangeListener(listener, context) {
return this.on('change', listener, arguments.length >= 2 ? context : this.owner);
},
/**
* @typesign (
* listener: (evt: cellx~Event) -> ?boolean,
* context?
* ) -> cellx.Cell;
*/
removeChangeListener: function removeChangeListener(listener, context) {
return this.off('change', listener, arguments.length >= 2 ? context : this.owner);
},
/**
* @typesign (
* listener: (evt: cellx~Event) -> ?boolean,
* context?
* ) -> cellx.Cell;
*/
addErrorListener: function addErrorListener(listener, context) {
return this.on('error', listener, arguments.length >= 2 ? context : this.owner);
},
/**
* @typesign (
* listener: (evt: cellx~Event) -> ?boolean,
* context?
* ) -> cellx.Cell;
*/
removeErrorListener: function removeErrorListener(listener, context) {
return this.off('error', listener, arguments.length >= 2 ? context : this.owner);
},
/**
* @typesign (
* listener: (err: ?Error, evt: cellx~Event) -> ?boolean,
* context?
* ) -> cellx.Cell;
*/
subscribe: function subscribe(listener, context) {
var wrappers = listener[KEY_WRAPPERS];
if (wrappers && wrappers.has(listener)) {
return this;
}
function wrapper(evt) {
return listener.call(this, evt.error || null, evt);
}
(wrappers || (listener[KEY_WRAPPERS] = new Map$1())).set(this, wrapper);
if (arguments.length < 2) {
context = this.owner;
}
return this.on('change', wrapper, context).on('error', wrapper, context);
},
/**
* @typesign (
* listener: (err: ?Error, evt: cellx~Event) -> ?boolean,
* context?
* ) -> cellx.Cell;
*/
unsubscribe: function unsubscribe(listener, context) {
if (arguments.length < 2) {
context = this.owner;
}
var wrappers = listener[KEY_WRAPPERS];
var wrapper = wrappers && wrappers.get(this);
if (!wrapper) {
return this;
}
wrappers.delete(this);
return this.off('change', wrapper, context).off('error', wrapper, context);
},
/**
* @typesign (slave: cellx.Cell);
*/
_registerSlave: function _registerSlave(slave) {
this._activate();
this._slaves.push(slave);
this._state |= STATE_HAS_FOLLOWERS;
},
/**
* @typesign (slave: cellx.Cell);
*/
_unregisterSlave: function _unregisterSlave(slave) {
this._slaves.splice(this._slaves.indexOf(slave), 1);
if (!this._slaves.length && !this._events.has('change') && !this._events.has('error')) {
this._state ^= STATE_HAS_FOLLOWERS;
this._deactivate();
if (this._reap) {
this._reap.call(this.owner);
}
}
},
/**
* @typesign ();
*/
_activate: function _activate() {
if (!this._pull || this._state & STATE_ACTIVE || this._masters === null) {
return;
}
var masters = this._masters;
if (this._version < releaseVersion) {
var value = this._tryPull();
if (masters || this._masters || !(this._state & STATE_INITED)) {
if (value === error) {
this._fail(error.original, false);
} else {
this._push(value, false, false);
}
}
masters = this._masters;
}
if (masters) {
var i = masters.length;
do {
masters[--i]._registerSlave(this);
} while (i);
this._state |= STATE_ACTIVE;
}
},
/**
* @typesign ();
*/
_deactivate: function _deactivate() {
if (!(this._state & STATE_ACTIVE)) {
return;
}
var masters = this._masters;
var i = masters.length;
do {
masters[--i]._unregisterSlave(this);
} while (i);
if (this._levelInRelease != -1 && !this._changeEvent) {
this._levelInRelease = -1;
}
this._state ^= STATE_ACTIVE;
},
/**
* @typesign ();
*/
_addToRelease: function _addToRelease() {
var level = this._level;
if (level <= this._levelInRelease) {
return;
}
var queue;
(releasePlan.get(level) || (releasePlan.set(level, queue = []), queue)).push(this);
if (releasePlanIndex > level) {
releasePlanIndex = level;
}
if (releasePlanToIndex < level) {
releasePlanToIndex = level;
}
this._levelInRelease = level;
if (!releasePlanned && !currentlyRelease) {
releasePlanned = true;
if (!transactionLevel && !config.asynchronous) {
release();
} else {
nextTick$1(release);
}
}
},
/**
* @typesign (evt: cellx~Event);
*/
_onValueChange: function _onValueChange(evt) {
this._pushingIndex = ++pushingIndexCounter;
if (this._changeEvent) {
evt.prev = this._changeEvent;
this._changeEvent = evt;
if (this._value === this._fixedValue) {
this._state &= ~STATE_CAN_CANCEL_CHANGE;
}
} else {
evt.prev = null;
this._changeEvent = evt;
this._state &= ~STATE_CAN_CANCEL_CHANGE;
this._addToRelease();
}
},
/**
* @typesign () -> *;
*/
get: function get() {
if (releasePlanned && this._pull) {
release();
}
if (this._pull && !(this._state & STATE_ACTIVE) && this._version < releaseVersion && this._masters !== null) {
var oldMasters = this._masters;
var value = this._tryPull();
var masters = this._masters;
if (oldMasters || masters || !(this._state & STATE_INITED)) {
if (masters && this._state & STATE_HAS_FOLLOWERS) {
var i = masters.length;
do {
masters[--i]._registerSlave(this);
} while (i);
this._state |= STATE_ACTIVE;
}
if (value === error) {
this._fail(error.original, false);
} else {
this._push(value, false, false);
}
}
}
if (currentCell) {
var currentCellMasters = currentCell._masters;
var level = this._level;
if (currentCellMasters) {
if (currentCellMasters.indexOf(this) == -1) {
currentCellMasters.push(this);
if (currentCell._level <= level) {
currentCell._level = level + 1;
}
}
} else {
currentCell._masters = [this];
currentCell._level = level + 1;
}
}
return this._get ? this._get(this._value) : this._value;
},
/**
* @typesign () -> boolean;
*/
pull: function pull() {
if (!this._pull) {
return false;
}
if (releasePlanned) {
release();
}
var hasFollowers = this._state & STATE_HAS_FOLLOWERS;
var oldMasters;
var oldLevel;
if (hasFollowers) {
oldMasters = this._masters;
oldLevel = this._level;
}
var value = this._tryPull();
if (hasFollowers) {
var masters = this._masters;
var newMasterCount = 0;
if (masters) {
var i = masters.length;
do {
var master = masters[--i];
if (!oldMasters || oldMasters.indexOf(master) == -1) {
master._registerSlave(this);
newMasterCount++;
}
} while (i);
}
if (oldMasters && (masters ? masters.length - newMasterCount : 0) < oldMasters.length) {
for (var j = oldMasters.length; j;) {
var oldMaster = oldMasters[--j];
if (!masters || masters.indexOf(oldMaster) == -1) {
oldMaster._unregisterSlave(this);
}
}
}
if (masters && masters.length) {
this._state |= STATE_ACTIVE;
} else {
this._state &= ~STATE_ACTIVE;
}
if (currentlyRelease && this._level > oldLevel) {
this._addToRelease();
return false;
}
}
if (value === error) {
this._fail(error.original, false);
return true;
}
return this._push(value, false, true);
},
/**
* @typesign () -> *;
*/
_tryPull: function _tryPull() {
if (this._state & STATE_CURRENTLY_PULLING) {
throw new TypeError('Circular pulling detected');
}
var pull = this._pull;
if (pull.length) {
this._state |= STATE_PENDING;
if (this._selfPendingStatusCell) {
this._selfPendingStatusCell.set(true);
}
this._state &= ~(STATE_FULFILLED | STATE_REJECTED);
}
var prevCell = currentCell;
currentCell = this;
this._state |= STATE_CURRENTLY_PULLING;
this._masters = null;
this._level = 0;
try {
return pull.length ? pull.call(this.owner, this, this._value) : pull.call(this.owner);
} catch (err) {
error.original = err;
return error;
} finally {
currentCell = prevCell;
this._version = releaseVersion + currentlyRelease;
var pendingStatusCell = this._pendingStatusCell;
if (pendingStatusCell && pendingStatusCell._state & STATE_ACTIVE) {
pendingStatusCell.pull();
}
var errorCell = this._errorCell;
if (errorCell && errorCell._state & STATE_ACTIVE) {
errorCell.pull();
}
this._state ^= STATE_CURRENTLY_PULLING;
}
},
/**
* @typesign () -> ?Error;
*/
getError: function getError() {
var errorCell = this._errorCell;
if (!errorCell) {
var debugKey = this.debugKey;
this._selfErrorCell = new Cell(this._error, debugKey ? { debugKey: debugKey + '._selfErrorCell' } : null);
errorCell = this._errorCell = new Cell(function () {
this.get();
var err = this._selfErrorCell.get();
var index;
if (err) {
index = this._errorIndex;
if (index == errorIndexCounter) {
return err;
}
}
var masters = this._masters;
if (masters) {
var i = masters.length;
do {
var master = masters[--i];
var masterError = master.getError();
if (masterError) {
var masterErrorIndex = master._errorIndex;
if (masterErrorIndex == errorIndexCounter) {
return masterError;
}
if (!err || index < masterErrorIndex) {
err = masterError;
index = masterErrorIndex;
}
}
} while (i);
}
return err;
}, debugKey ? { debugKey: debugKey + '._errorCell', owner: this } : { owner: this });
}
return errorCell.get();
},
/**
* @typesign () -> boolean;
*/
isPending: function isPending() {
var pendingStatusCell = this._pendingStatusCell;
if (!pendingStatusCell) {
var debugKey = this.debugKey;
this._selfPendingStatusCell = new Cell(!!(this._state & STATE_PENDING), debugKey ? { debugKey: debugKey + '._selfPendingStatusCell' } : null);
pendingStatusCell = this._pendingStatusCell = new Cell(function () {
if (this._selfPendingStatusCell.get()) {
return true;
}
this.get();
var masters = this._masters;
if (masters) {
var i = masters.length;
do {
if (masters[--i].isPending()) {
return true;
}
} while (i);
}
return false;
}, debugKey ? { debugKey: debugKey + '._pendingStatusCell', owner: this } : { owner: this });
}
return pendingStatusCell.get();
},
getStatus: function getStatus() {
var status = this._status;
if (!status) {
var cell = this;
status = this._status = {
get success() {
return !cell.getError();
},
get pending() {
return cell.isPending();
}
};
}
return status;
},
/**
* @typesign (value) -> cellx.Cell;
*/
set: function set(value) {
if (this._validate) {
this._validate(value, this._value);
}
if (this._merge) {
value = this._merge(value, this._value);
}
this._state |= STATE_PENDING;
if (this._selfPendingStatusCell) {
this._selfPendingStatusCell.set(true);
}
this._state &= ~(STATE_FULFILLED | STATE_REJECTED);
if (this._put.length >= 3) {
this._put.call(this.owner, this, value, this._value);
} else {
this._put.call(this.owner, this, value);
}
return this;
},
/**
* @typesign (value) -> cellx.Cell;
*/
push: function push(value) {
this._push(value, true, false);
return this;
},
/**
* @typesign (value, external: boolean, pulling: boolean) -> boolean;
*/
_push: function _push(value, external, pulling) {
this._state |= STATE_INITED;
var oldValue = this._value;
if (external && currentlyRelease && this._state & STATE_HAS_FOLLOWERS) {
if (is(value, oldValue)) {
this._setError(null);
this._fulfill(value);
return false;
}
var cell = this;
(afterReleaseCallbacks || (afterReleaseCallbacks = [])).push((function () {
cell._push(value, true, false);
}));
return true;
}
if (external || !currentlyRelease && pulling) {
this._pushingIndex = ++pushingIndexCounter;
}
this._setError(null);
if (is(value, oldValue)) {
if (external || currentlyRelease && pulling) {
this._fulfill(value);
}
return false;
}
this._value = value;
if (oldValue instanceof EventEmitter) {
oldValue.off('change', this._onValueChange, this);
}
if (value instanceof EventEmitter) {
value.on('change', this._onValueChange, this);
}
if (this._state & STATE_HAS_FOLLOWERS || transactionLevel) {
if (this._changeEvent) {
if (is(value, this._fixedValue) && this._state & STATE_CAN_CANCEL_CHANGE) {
this._levelInRelease = -1;
this._changeEvent = null;
} else {
this._changeEvent = {
target: this,
type: 'change',
oldValue: oldValue,
value: value,
prev: this._changeEvent
};
}
} else {
this._changeEvent = {
target: this,
type: 'change',
oldValue: oldValue,
value: value,
prev: null
};
this._state |= STATE_CAN_CANCEL_CHANGE;
this._addToRelease();
}
} else {
if (external || !currentlyRelease && pulling) {
releaseVersion++;
}
this._fixedValue = value;
this._version = releaseVersion + currentlyRelease;
}
if (external || currentlyRelease && pulling) {
this._fulfill(value);
}
return true;
},
/**
* @typesign (value);
*/
_fulfill: function _fulfill(value) {
this._resolvePending();
if (!(this._state & STATE_FULFILLED)) {
this._state |= STATE_FULFILLED;
if (this._onFulfilled) {
this._onFulfilled(value);
}
}
},
/**
* @typesign (err) -> cellx.Cell;
*/
fail: function fail(err) {
this._fail(err, true);
return this;
},
/**
* @typesign (err, external: boolean);
*/
_fail: function _fail(err, external) {
if (transactionLevel) {
transactionFailure = true;
}
this._logError(err);
if (!(err instanceof Error)) {
err = new Error(String(err));
}
this._setError(err);
if (external) {
this._reject(err);
}
},
/**
* @typesign (err: ?Error);
*/
_setError: function _setError(err) {
if (!err && !this._error) {
return;
}
this._error = err;
if (this._selfErrorCell) {
this._selfErrorCell.set(err);
}
if (err) {
this._errorIndex = ++errorIndexCounter;
this._handleErrorEvent({
type: 'error',
error: err
});
}
},
/**
* @typesign (evt: cellx~Event{ error: Error });
*/
_handleErrorEvent: function _handleErrorEvent(evt) {
if (this._lastErrorEvent === evt) {
return;
}
this._lastErrorEvent = evt;
this._handleEvent(evt);
var slaves = this._slaves;
for (var i = 0, l = slaves.length; i < l; i++) {
slaves[i]._handleErrorEvent(evt);
}
},
/**
* @typesign (err: Error);
*/
_reject: function _reject(err) {
this._resolvePending();
if (!(this._state & STATE_REJECTED)) {
this._state |= STATE_REJECTED;
if (this._onRejected) {
this._onRejected(err);
}
}
},
/**
* @typesign ();
*/
_resolvePending: function _resolvePending() {
if (this._state & STATE_PENDING) {
this._state ^= STATE_PENDING;
if (this._selfPendingStatusCell) {
this._selfPendingStatusCell.set(false);
}
}
},
/**
* @typesign (onFulfilled: ?(value) -> *, onRejected?: (err) -> *) -> Promise;
*/
then: function then(onFulfilled, onRejected) {
if (releasePlanned) {
release();
}
if (!this._pull || this._state & STATE_FULFILLED) {
return Promise.resolve(this._get ? this._get(this._value) : this._value).then(onFulfilled);
}
if (this._state & STATE_REJECTED) {
return Promise.reject(this._error).catch(onRejected);
}
var cell = this;
var promise = new Promise(function (resolve, reject) {
cell._onFulfilled = function onFulfilled(value) {
cell._onFulfilled = cell._onRejected = null;
resolve(cell._get ? cell._get(value) : value);
};
cell._onRejected = function onRejected(err) {
cell._onFulfilled = cell._onRejected = null;
reject(err);
};
}).then(onFulfilled, onRejected);
if (!(this._state & STATE_PENDING)) {
this.pull();
}
if (cell.isPending()) {
cell._pendingStatusCell.on('change', (function onPendingStatusCellChange() {
cell._pendingStatusCell.off('change', onPendingStatusCellChange);
if (!(cell._state & STATE_FULFILLED) && !(cell._state & STATE_REJECTED)) {
var err = cell.getError();
if (err) {
cell._reject(err);
} else {
cell._fulfill(cell._get ? cell._get(cell._value) : cell._value);
}
}
}));
}
return promise;
},
/**
* @typesign (onRejected: (err) -> *) -> Promise;
*/
catch: function catch_(onRejected) {
return this.then(null, onRejected);
},
/**
* @override
*/
_logError: function _logError() {
var msg = slice$1.call(arguments);
if (this.debugKey) {
msg.unshift('[' + this.debugKey + ']');
}
EventEmitterProto._logError.apply(this, msg);
},
/**
* @typesign () -> cellx.Cell;
*/
reap: function reap() {
var slaves = this._slaves;
for (var i = 0, l = slaves.length; i < l; i++) {
slaves[i].reap();
}
return this.off();
},
/**
* @typesign () -> cellx.Cell;
*/
dispose: function dispose() {
return this.reap();
}
};
Cell.prototype[Symbol$1.iterator] = function () {
return this._value[Symbol$1.iterator]();
};
var map$1 = Array.prototype.map;
/**
* @typesign (...msg);
*/
function logError() {
var console = global$1.console;
(console && console.error || noop).call(console || global$1, map$1.call(arguments, (function (arg) {
return arg === Object(arg) && arg.stack || arg;
})).join(' '));
}
var hasOwn = Object.prototype.hasOwnProperty;
var slice = Array.prototype.slice;
ErrorLogger.setHandler(logError);
var assign = Object.assign || function (target, source) {
for (var name in source) {
target[name] = source[name];
}
return target;
};
/**
* @typesign (value?, opts?: {
* debugKey?: string,
* owner?: Object,
* validate?: (value, oldValue),
* merge: (value, oldValue) -> *,
* put?: (cell: Cell, value, oldValue),
* reap?: (),
* onChange?: (evt: cellx~Event) -> ?boolean,
* onError?: (evt: cellx~Event) -> ?boolean
* }) -> cellx;
*
* @typesign (pull: (cell: Cell, next) -> *, opts?: {
* debugKey?: string,
* owner?: Object,
* validate?: (value, oldValue),
* merge: (value, oldValue) -> *,
* put?: (cell: Cell, value, oldValue),
* reap?: (),
* onChange?: (evt: cellx~Event) -> ?boolean,
* onError?: (evt: cellx~Event) -> ?boolean
* }) -> cellx;
*/
function cellx(value, opts) {
if (!opts) {
opts = {};
}
var initialValue = value;
function cx(value) {
var owner = this;
if (!owner || owner == global$1) {
owner = cx;
}
if (!hasOwn.call(owner, CELLS)) {
Object.defineProperty(owner, CELLS, { value: new Map$1() });
}
var cell = owner[CELLS].get(cx);
if (!cell) {
if (value === 'dispose' && arguments.length >= 2) {
return;
}
cell = new Cell(initialValue, assign({ owner: owner }, opts));
owner[CELLS].set(cx, cell);
}
switch (arguments.length) {
case 0:
{
return cell.get();
}
case 1:
{
cell.set(value);
return value;
}
default:
{
var method = value;
switch (method) {
case 'bind':
{
cx = cx.bind(owner);
cx.constructor = cellx;
return cx;
}
case 'unwrap':
{
return cell;
}
default:
{
var result = Cell.prototype[method].apply(cell, slice.call(arguments, 1));
return result === cell ? cx : result;
}
}
}
}
}
cx.constructor = cellx;
if (opts.onChange || opts.onError) {
cx.call(opts.owner || global$1);
}
return cx;
}
cellx.configure = function (config) {
Cell.configure(config);
};
cellx.ErrorLogger = ErrorLogger;
cellx.EventEmitter = EventEmitter;
cellx.ObservableCollectionMixin = ObservableCollectionMixin;
cellx.ObservableMap = ObservableMap;
cellx.ObservableList = ObservableList;
cellx.Cell = Cell;
cellx.autorun = Cell.autorun;
cellx.transact = cellx.transaction = Cell.transaction;
cellx.KEY_UID = UID;
cellx.KEY_CELLS = CELLS;
/**
* @typesign (
* entries?: Object | Array<{ 0, 1 }> | cellx.ObservableMap,
* opts?: { adoptsValueChanges?: boolean }
* ) -> cellx.ObservableMap;
*
* @typesign (
* entries?: Object | Array<{ 0, 1 }> | cellx.ObservableMap,
* adoptsValueChanges?: boolean
* ) -> cellx.ObservableMap;
*/
function map(entries, opts) {
return new ObservableMap(entries, opts);
}
cellx.map = map;
/**
* @typesign (items?: Array | cellx.ObservableList, opts?: {
* adoptsValueChanges?: boolean,
* comparator?: (a, b) -> int,
* sorted?: boolean
* }) -> cellx.ObservableList;
*
* @typesign (items?: Array | cellx.ObservableList, adoptsValueChanges?: boolean) -> cellx.ObservableList;
*/
function list(items, opts) {
return new ObservableList(items, opts);
}
cellx.list = list;
/**
* @typesign (obj: cellx.EventEmitter, name: string, value) -> cellx.EventEmitter;
*/
function defineObservableProperty(obj, name, value) {
var privateName = '_' + name;
obj[privateName] = value instanceof Cell ? value : new Cell(value, { owner: obj });
Object.defineProperty(obj, name, {
configurable: true,
enumerable: true,
get: function () {
return this[privateName].get();
},
set: function (value) {
this[privateName].set(value);
}
});
return obj;
}
cellx.defineObservableProperty = defineObservableProperty;
/**
* @typesign (obj: cellx.EventEmitter, props: Object) -> cellx.EventEmitter;
*/
function defineObservableProperties(obj, props) {
Object.keys(props).forEach((function (name) {
defineObservableProperty(obj, name, props[name]);
}));
return obj;
}
cellx.defineObservableProperties = defineObservableProperties;
/**
* @typesign (obj: cellx.EventEmitter, name: string, value) -> cellx.EventEmitter;
* @typesign (obj: cellx.EventEmitter, props: Object) -> cellx.EventEmitter;
*/
function define(obj, name, value) {
if (arguments.length == 3) {
defineObservableProperty(obj, name, value);
} else {
defineObservableProperties(obj, name);
}
return obj;
}
cellx.define = define;
cellx.JS = {
is: is,
Symbol: Symbol$1,
Map: Map$1
};
cellx.Utils = {
logError: logError,
nextUID: nextUID,
mixin: mixin,
nextTick: nextTick$1,
noop: noop
};
cellx.cellx = cellx;
cellx.__esModule = true;
cellx.default = cellx;
return cellx;
})));
| tholu/cdnjs | ajax/libs/cellx/1.7.15/cellx.js | JavaScript | mit | 64,815 |
tinymce.addI18n('mn_MN',{
"Cut": "\u041e\u0433\u0442\u043b\u043e\u0445",
"Header 2": "Header 2",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.",
"Div": "Div",
"Paste": "\u0425\u0443\u0443\u043b\u0431\u0430\u0440 \u0431\u0443\u0443\u043b\u0433\u0430\u0445",
"Close": "Close",
"Font Family": "Font Family",
"Pre": "Pre",
"Align right": "Align right",
"New document": "\u0428\u0438\u043d\u044d \u0431\u0430\u0440\u0438\u043c\u0442",
"Blockquote": "Blockquote",
"Numbered list": "Numbered list",
"Increase indent": "Increase indent",
"Formats": "Formats",
"Headers": "Headers",
"Select all": "\u0411\u04af\u0433\u0434\u0438\u0439\u0433 \u0441\u043e\u043d\u0433\u043e\u0445",
"Header 3": "Header 3",
"Blocks": "Blocks",
"Undo": "\u04ae\u0439\u043b\u0434\u043b\u0438\u0439\u0433 \u0431\u0443\u0446\u0430\u0430\u0445",
"Strikethrough": "\u0414\u0443\u043d\u0434\u0443\u0443\u0440 \u0437\u0443\u0440\u0430\u0430\u0441",
"Bullet list": "Bullet list",
"Header 1": "Header 1",
"Superscript": "\u0417\u044d\u0440\u044d\u0433",
"Clear formatting": "\u0424\u043e\u0440\u043c\u0430\u0442\u043b\u0430\u043b\u044b\u0433 \u0430\u0440\u0438\u043b\u0433\u0430\u0445",
"Font Sizes": "Font Sizes",
"Subscript": "\u0418\u043d\u0434\u0435\u043a\u0441",
"Header 6": "Header 6",
"Redo": "\u0414\u0430\u0445\u0438\u043d \u0445\u0438\u0439\u0445",
"Paragraph": "Paragraph",
"Ok": "\u041e\u043a",
"Bold": "\u0422\u043e\u0434",
"Code": "Code",
"Italic": "\u041d\u0430\u043b\u0443\u0443",
"Align center": "\u0422\u04e9\u0432\u0434 \u0437\u044d\u0440\u044d\u0433\u0446\u04af\u04af\u043b\u044d\u0445",
"Header 5": "Header 5",
"Decrease indent": "Decrease indent",
"Header 4": "Header 4",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",
"Underline": "\u0414\u043e\u043e\u0433\u0443\u0443\u0440 \u0437\u0443\u0440\u0430\u0430\u0441",
"Cancel": "\u0411\u043e\u043b\u0438\u0445",
"Justify": "Justify",
"Inline": "Inline",
"Copy": "\u0425\u0443\u0443\u043b\u0430\u0445",
"Align left": "\u0417\u04af\u04af\u043d\u0434 \u0437\u044d\u0440\u044d\u0433\u0446\u04af\u04af\u043b\u044d\u0445",
"Visual aids": "\u0412\u0438\u0437\u0443\u0430\u043b \u0442\u0443\u0441\u043b\u0430\u043c\u0436",
"Lower Greek": "Lower Greek",
"Square": "Square",
"Default": "Default",
"Lower Alpha": "Lower Alpha",
"Circle": "Circle",
"Disc": "Disc",
"Upper Alpha": "Upper Alpha",
"Upper Roman": "Upper Roman",
"Lower Roman": "Lower Roman",
"Name": "Name",
"Anchor": "Anchor",
"You have unsaved changes are you sure you want to navigate away?": "You have unsaved changes are you sure you want to navigate away?",
"Restore last draft": "Restore last draft",
"Special character": "Special character",
"Source code": "Source code",
"Right to left": "Right to left",
"Left to right": "Left to right",
"Emoticons": "Emoticons",
"Robots": "Robots",
"Document properties": "Document properties",
"Title": "Title",
"Keywords": "Keywords",
"Encoding": "Encoding",
"Description": "Description",
"Author": "Author",
"Fullscreen": "Fullscreen",
"Horizontal line": "Horizontal line",
"Horizontal space": "Horizontal space",
"Insert\/edit image": "Insert\/edit image",
"General": "General",
"Advanced": "Advanced",
"Source": "Source",
"Border": "Border",
"Constrain proportions": "Constrain proportions",
"Vertical space": "Vertical space",
"Image description": "Image description",
"Style": "Style",
"Dimensions": "Dimensions",
"Insert image": "Insert image",
"Insert date\/time": "Insert date\/time",
"Remove link": "Remove link",
"Url": "Url",
"Text to display": "Text to display",
"Anchors": "Anchors",
"Insert link": "Insert link",
"New window": "New window",
"None": "None",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?",
"Target": "Target",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
"Insert\/edit link": "Insert\/edit link",
"Insert\/edit video": "Insert\/edit video",
"Poster": "Poster",
"Alternative source": "Alternative source",
"Paste your embed code below:": "Paste your embed code below:",
"Insert video": "Insert video",
"Embed": "Embed",
"Nonbreaking space": "Nonbreaking space",
"Page break": "Page break",
"Paste as text": "Paste as text",
"Preview": "Preview",
"Print": "Print",
"Save": "Save",
"Could not find the specified string.": "Could not find the specified string.",
"Replace": "Replace",
"Next": "Next",
"Whole words": "Whole words",
"Find and replace": "Find and replace",
"Replace with": "Replace with",
"Find": "Find",
"Replace all": "Replace all",
"Match case": "Match case",
"Prev": "Prev",
"Spellcheck": "Spellcheck",
"Finish": "Finish",
"Ignore all": "Ignore all",
"Ignore": "Ignore",
"Insert row before": "Insert row before",
"Rows": "Rows",
"Height": "Height",
"Paste row after": "Paste row after",
"Alignment": "Alignment",
"Column group": "Column group",
"Row": "Row",
"Insert column before": "Insert column before",
"Split cell": "Split cell",
"Cell padding": "Cell padding",
"Cell spacing": "Cell spacing",
"Row type": "Row type",
"Insert table": "Insert table",
"Body": "Body",
"Caption": "Caption",
"Footer": "Footer",
"Delete row": "Delete row",
"Paste row before": "Paste row before",
"Scope": "Scope",
"Delete table": "Delete table",
"Header cell": "Header cell",
"Column": "Column",
"Cell": "Cell",
"Header": "Header",
"Cell type": "Cell type",
"Copy row": "Copy row",
"Row properties": "Row properties",
"Table properties": "Table properties",
"Row group": "Row group",
"Right": "Right",
"Insert column after": "Insert column after",
"Cols": "Cols",
"Insert row after": "Insert row after",
"Width": "Width",
"Cell properties": "Cell properties",
"Left": "Left",
"Cut row": "Cut row",
"Delete column": "Delete column",
"Center": "Center",
"Merge cells": "Merge cells",
"Insert template": "Insert template",
"Templates": "Templates",
"Background color": "Background color",
"Text color": "Text color",
"Show blocks": "Show blocks",
"Show invisible characters": "Show invisible characters",
"Words: {0}": "Words: {0}",
"Insert": "Insert",
"File": "File",
"Edit": "Edit",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help",
"Tools": "Tools",
"View": "View",
"Table": "Table",
"Format": "Format"
}); | kcsry/django-tinymce | tinymce/static/tinymce/langs/mn_MN.js | JavaScript | mit | 6,876 |
import { Observable } from '../Observable';
export declare function first<T, S extends T>(this: Observable<T>, predicate: (value: T, index: number, source: Observable<T>) => value is S): Observable<S>;
export declare function first<T, S extends T, R>(this: Observable<T>, predicate: (value: T | S, index: number, source: Observable<T>) => value is S, resultSelector: (value: S, index: number) => R, defaultValue?: R): Observable<R>;
export declare function first<T, S extends T>(this: Observable<T>, predicate: (value: T, index: number, source: Observable<T>) => value is S, resultSelector: void, defaultValue?: S): Observable<S>;
export declare function first<T>(this: Observable<T>, predicate?: (value: T, index: number, source: Observable<T>) => boolean): Observable<T>;
export declare function first<T, R>(this: Observable<T>, predicate: (value: T, index: number, source: Observable<T>) => boolean, resultSelector?: (value: T, index: number) => R, defaultValue?: R): Observable<R>;
export declare function first<T>(this: Observable<T>, predicate: (value: T, index: number, source: Observable<T>) => boolean, resultSelector: void, defaultValue?: T): Observable<T>;
| k3ralas/it-network-app | node_modules/rxjs/operator/first.d.ts | TypeScript | mit | 1,168 |
/*
* /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/SuppMathOperators.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS["STIXGeneral-bold"],{10764:[824,320,1484,32,1664],10765:[824,320,593,32,733],10766:[824,320,593,32,733],10767:[824,320,593,32,733],10768:[824,320,593,32,733],10769:[824,320,593,32,733],10770:[824,320,613,32,733],10771:[824,320,593,32,733],10772:[824,320,675,32,735],10773:[824,320,593,32,733],10774:[824,320,623,32,733],10775:[824,320,791,32,871],10776:[824,320,633,32,733],10777:[824,320,653,32,733],10778:[824,320,653,32,733],10779:[959,320,557,32,737],10780:[824,455,557,32,737],10786:[894,57,750,65,685],10787:[736,57,750,65,685],10788:[746,57,750,65,685],10789:[563,287,750,65,685],10790:[563,240,750,65,685],10791:[563,247,780,65,778],10794:[297,37,750,66,685],10795:[543,37,750,66,685],10796:[543,37,750,66,685],10800:[745,33,702,66,636],10801:[538,191,702,66,636],10802:[538,59,702,66,636],10815:[676,0,734,27,707],10846:[887,28,640,52,588],10851:[536,379,640,52,588],10854:[399,161,750,68,682],10855:[775,-27,750,68,682],10858:[565,-132,750,67,682],10861:[759,60,750,68,683],10862:[884,-107,750,68,682],10863:[752,-26,750,68,683],10864:[680,176,750,68,683],10865:[665,159,750,65,685],10866:[665,159,750,65,685],10867:[568,60,750,67,682],10877:[648,140,750,80,670],10878:[648,140,750,80,670],10887:[646,213,750,80,670],10888:[646,213,750,80,670],10889:[792,305,750,67,682],10890:[792,305,750,67,682],10901:[648,140,750,80,670],10902:[648,140,750,80,670],10909:[689,183,750,67,682],10910:[689,183,750,67,682],10927:[619,111,750,80,670],10928:[619,111,750,80,670],10941:[547,13,750,82,668],10942:[547,13,750,82,668],10949:[730,222,750,80,670],10950:[730,222,750,80,670]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Bold/SuppMathOperators.js");
| tonytlwu/cdnjs | ajax/libs/mathjax/2.5.3/jax/output/HTML-CSS/fonts/STIX/General/Bold/SuppMathOperators.js | JavaScript | mit | 2,452 |
/*
* /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Italic/BoxDrawing.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS["STIXGeneral-italic"],{9472:[340,-267,708,-11,719],9474:[910,303,708,317,390],9484:[340,303,708,317,720],9488:[340,303,708,-11,390],9492:[910,-267,708,317,720],9496:[910,-267,708,-11,390],9500:[910,303,708,317,719],9508:[910,303,708,-11,390],9516:[340,303,708,-11,719],9524:[910,-267,708,-11,719],9532:[910,303,708,-11,719],9552:[433,-174,708,-11,719],9553:[910,303,708,225,483],9554:[433,303,708,317,720],9555:[340,303,708,225,720],9556:[433,303,708,225,719],9557:[433,303,708,-11,390],9558:[340,303,708,-11,483],9559:[433,303,708,-11,483],9560:[910,-174,708,317,720],9561:[910,-267,708,225,720],9562:[910,-174,708,225,719],9563:[910,-174,708,-11,390],9564:[910,-267,708,-11,483],9565:[910,-174,708,-11,483],9566:[910,303,708,317,720],9567:[910,303,708,225,720],9568:[910,303,708,225,720],9569:[910,303,708,-11,390],9570:[910,303,708,-11,483],9571:[910,303,708,-11,483],9572:[433,303,708,-11,719],9573:[340,303,708,-11,719],9574:[433,303,708,-11,719],9575:[910,-174,708,-11,719],9576:[910,-267,708,-11,719],9577:[910,-174,708,-11,719],9578:[910,303,708,-11,719],9579:[910,303,708,-11,719],9580:[910,303,708,-11,719]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Italic/BoxDrawing.js");
| schoren/cdnjs | ajax/libs/mathjax/2.5.0/jax/output/HTML-CSS/fonts/STIX/General/Italic/BoxDrawing.js | JavaScript | mit | 1,983 |
/*
* /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GeneralPunctuation.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXGeneral,{8208:[259,-193,333,39,285],8209:[257,-194,333,39,285],8210:[259,-193,500,0,500],8211:[250,-201,500,0,500],8212:[250,-201,1000,0,1000],8213:[250,-201,2000,0,2000],8214:[690,189,523,129,394],8215:[-141,300,500,0,500],8216:[676,-433,333,115,254],8217:[676,-433,333,79,218],8218:[102,141,333,79,218],8219:[676,-433,333,79,218],8220:[676,-433,444,43,414],8221:[676,-433,444,30,401],8222:[102,141,444,45,416],8223:[676,-433,444,30,401],8226:[444,-59,523,70,455],8229:[100,11,667,111,555],8240:[706,19,1109,61,1048],8241:[706,19,1471,61,1410],8243:[678,-401,426,75,351],8244:[678,-401,563,75,488],8245:[678,-402,289,75,214],8246:[678,-401,426,75,351],8247:[678,-401,563,75,488],8248:[102,156,511,59,454],8249:[416,-33,333,63,285],8250:[416,-33,333,48,270],8251:[547,41,685,48,635],8252:[676,9,549,130,452],8256:[709,-512,798,72,726],8259:[332,-172,333,39,285],8260:[676,14,167,-168,331],8263:[676,8,839,68,809],8270:[240,171,500,68,433],8271:[459,141,278,60,199],8272:[691,40,790,55,735],8273:[676,171,501,68,433],8274:[706,200,471,54,417],8279:[678,-401,710,75,635],8287:[0,0,1000,0,0]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Regular/GeneralPunctuation.js");
| jdh8/cdnjs | ajax/libs/mathjax/2.5.2/jax/output/HTML-CSS/fonts/STIX/General/Regular/GeneralPunctuation.js | JavaScript | mit | 1,977 |
/*
* /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Arrows.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXGeneral,{8602:[450,-58,926,60,866],8603:[450,-58,926,60,866],8604:[411,-102,926,70,856],8605:[411,-102,926,70,856],8606:[449,-58,926,70,856],8607:[662,154,511,60,451],8608:[449,-58,926,70,856],8609:[662,154,511,60,451],8610:[449,-58,926,70,856],8611:[449,-58,926,70,856],8612:[450,-57,926,70,857],8613:[662,154,511,60,451],8615:[662,154,511,59,451],8616:[662,154,511,59,451],8619:[553,0,926,70,856],8620:[553,0,926,70,856],8621:[449,-58,1200,49,1151],8622:[450,-58,926,38,888],8623:[662,154,511,60,451],8624:[662,156,463,30,424],8625:[662,156,463,39,433],8626:[662,154,463,25,419],8627:[662,154,463,39,433],8628:[662,154,926,70,856],8629:[662,156,926,70,856],8630:[534,0,926,44,882],8631:[534,0,926,44,882],8632:[732,156,926,55,872],8633:[598,92,926,60,866],8634:[686,116,974,116,858],8635:[686,116,974,116,858],8638:[662,156,511,222,441],8639:[662,156,511,69,288],8642:[662,156,511,222,441],8643:[662,156,511,69,288],8644:[598,92,926,71,856],8645:[662,156,773,31,742],8646:[598,92,926,71,856],8647:[599,92,926,70,856],8648:[662,156,773,41,732],8649:[599,92,926,70,856],8650:[662,156,773,41,732],8651:[539,33,926,70,856],8653:[551,45,926,60,866],8654:[517,10,926,20,906],8655:[551,45,926,60,866],8662:[662,156,926,55,874],8663:[662,156,926,55,874],8664:[662,156,926,55,874],8665:[662,156,926,55,874],8666:[644,139,926,46,852],8667:[645,138,926,74,880],8668:[449,-58,926,60,866],8669:[449,-58,926,60,866],8670:[662,156,511,60,451],8671:[662,156,511,60,451],8672:[449,-58,926,60,866],8673:[662,156,511,60,451],8674:[449,-58,926,60,866],8675:[662,156,511,60,451],8676:[450,-58,926,60,866],8677:[450,-58,926,60,866],8678:[551,45,926,60,866],8679:[662,156,685,45,641],8680:[551,45,926,60,866],8681:[662,156,685,45,641],8682:[690,184,685,45,641],8692:[448,-57,926,70,856],8693:[662,156,773,31,742],8694:[739,232,926,60,866],8695:[450,-58,926,60,866],8696:[450,-58,926,55,861],8697:[450,-58,926,48,878],8698:[450,-58,926,60,866],8699:[450,-58,926,60,866],8700:[450,-58,926,38,888],8701:[449,-57,926,60,866],8702:[449,-57,926,60,866],8703:[449,-57,926,20,906]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Regular/Arrows.js");
| xujunxuan/nodePPT | assets/js/mathjax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Arrows.js | JavaScript | mit | 2,916 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;
/**
* Registers the cache warmers.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class AddCacheWarmerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('cache_warmer')) {
return;
}
$warmers = array();
foreach ($container->findTaggedServiceIds('kernel.cache_warmer') as $id => $attributes) {
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
$warmers[$priority][] = new Reference($id);
}
if (empty($warmers)) {
return;
}
// sort by priority and flatten
krsort($warmers);
$warmers = call_user_func_array('array_merge', $warmers);
$container->getDefinition('cache_warmer')->replaceArgument(0, $warmers);
}
}
| progmohamed/rawafedtask | vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheWarmerPass.php | PHP | mit | 1,408 |
/*
* /MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathSSItalicBold.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS["STIXGeneral-bold-italic"],{120380:[690,0,690,25,665],120381:[676,0,636,80,691],120382:[691,19,723,119,797],120383:[676,0,709,80,772],120384:[676,0,635,80,728],120385:[676,0,582,80,725],120386:[691,19,746,107,785],120387:[676,0,715,80,803],120388:[676,0,440,79,534],120389:[676,96,481,15,574],120390:[676,0,712,80,816],120391:[676,0,603,80,612],120392:[676,0,913,80,1001],120393:[676,18,724,80,812],120394:[692,18,778,106,840],120395:[676,0,581,80,695],120396:[691,176,779,105,839],120397:[676,0,670,80,698],120398:[691,19,554,66,637],120399:[676,0,641,157,785],120400:[676,19,699,123,792],120401:[676,18,690,193,833],120402:[676,15,997,198,1135],120403:[676,0,740,40,853],120404:[676,0,694,188,842],120405:[676,0,653,25,769],120406:[473,14,489,48,507],120407:[676,13,512,51,558],120408:[473,14,462,71,524],120409:[676,14,518,69,625],120410:[473,13,452,71,492],120411:[692,0,340,72,533],120412:[473,206,504,2,599],120413:[676,0,510,55,542],120414:[688,0,245,59,366],120415:[688,202,324,-90,440],120416:[676,0,519,55,599],120417:[676,0,235,55,348],120418:[473,0,776,55,809],120419:[473,0,510,55,542],120420:[473,14,501,72,542],120421:[473,205,512,3,559],120422:[473,205,512,69,574],120423:[473,0,411,55,519],120424:[473,13,385,37,442],120425:[631,12,386,98,447],120426:[462,15,518,81,569],120427:[462,14,462,129,561],120428:[462,14,701,131,798],120429:[462,0,506,20,582],120430:[462,204,472,-27,569],120431:[462,0,441,21,530]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/BoldItalic/MathSSItalicBold.js");
| samthor/cdnjs | ajax/libs/mathjax/2.5.1/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/MathSSItalicBold.js | JavaScript | mit | 2,311 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.