code
stringlengths 24
2.07M
| docstring
stringlengths 25
85.3k
| func_name
stringlengths 1
92
| language
stringclasses 1
value | repo
stringlengths 5
64
| path
stringlengths 4
172
| url
stringlengths 44
218
| license
stringclasses 7
values |
|---|---|---|---|---|---|---|---|
addRow(position) {
const rng = this.getLastRange(this.$editable);
if (rng.isCollapsed() && rng.isOnCell()) {
this.beforeCommand();
this.table.addRow(rng, position);
this.afterCommand();
}
}
|
returns link info
@return {Object}
@return {WrappedRange} return.range
@return {String} return.text
@return {Boolean} [return.isNewWindow=true]
@return {String} [return.url=""]
|
addRow
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
addCol(position) {
const rng = this.getLastRange(this.$editable);
if (rng.isCollapsed() && rng.isOnCell()) {
this.beforeCommand();
this.table.addCol(rng, position);
this.afterCommand();
}
}
|
returns link info
@return {Object}
@return {WrappedRange} return.range
@return {String} return.text
@return {Boolean} [return.isNewWindow=true]
@return {String} [return.url=""]
|
addCol
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
deleteRow() {
const rng = this.getLastRange(this.$editable);
if (rng.isCollapsed() && rng.isOnCell()) {
this.beforeCommand();
this.table.deleteRow(rng);
this.afterCommand();
}
}
|
returns link info
@return {Object}
@return {WrappedRange} return.range
@return {String} return.text
@return {Boolean} [return.isNewWindow=true]
@return {String} [return.url=""]
|
deleteRow
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
deleteCol() {
const rng = this.getLastRange(this.$editable);
if (rng.isCollapsed() && rng.isOnCell()) {
this.beforeCommand();
this.table.deleteCol(rng);
this.afterCommand();
}
}
|
returns link info
@return {Object}
@return {WrappedRange} return.range
@return {String} return.text
@return {Boolean} [return.isNewWindow=true]
@return {String} [return.url=""]
|
deleteCol
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
deleteTable() {
const rng = this.getLastRange(this.$editable);
if (rng.isCollapsed() && rng.isOnCell()) {
this.beforeCommand();
this.table.deleteTable(rng);
this.afterCommand();
}
}
|
returns link info
@return {Object}
@return {WrappedRange} return.range
@return {String} return.text
@return {Boolean} [return.isNewWindow=true]
@return {String} [return.url=""]
|
deleteTable
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
resizeTo(pos, $target, bKeepRatio) {
let imageSize;
if (bKeepRatio) {
const newRatio = pos.y / pos.x;
const ratio = $target.data('ratio');
imageSize = {
width: ratio > newRatio ? pos.x : pos.y / ratio,
height: ratio > newRatio ? pos.x * ratio : pos.y,
};
} else {
imageSize = {
width: pos.x,
height: pos.y,
};
}
$target.css(imageSize);
}
|
@param {Position} pos
@param {jQuery} $target - target element
@param {Boolean} [bKeepRatio] - keep ratio
|
resizeTo
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
hasFocus() {
return this.$editable.is(':focus');
}
|
returns whether editable area has focus or not.
|
hasFocus
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
isEmpty() {
return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html();
}
|
returns whether contents is empty or not.
@return {Boolean}
|
isEmpty
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
empty() {
this.context.invoke('code', dom.emptyPara);
}
|
Removes all contents and restores the editable instance to an _emptyPara_.
|
empty
|
javascript
|
summernote/summernote
|
src/js/module/Editor.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/Editor.js
|
MIT
|
showImageDialog() {
return $.Deferred((deferred) => {
const $imageInput = this.$dialog.find('.note-image-input');
const $imageUrl = this.$dialog.find('.note-image-url');
const $imageBtn = this.$dialog.find('.note-image-btn');
this.ui.onDialogShown(this.$dialog, () => {
this.context.triggerEvent('dialog.shown');
// Cloning imageInput to clear element.
$imageInput.replaceWith($imageInput.clone().on('change', (event) => {
deferred.resolve(event.target.files || event.target.value);
}).val(''));
$imageUrl.on('input paste propertychange', () => {
this.ui.toggleBtn($imageBtn, $imageUrl.val());
}).val('');
if (!env.isSupportTouch) {
$imageUrl.trigger('focus');
}
$imageBtn.on('click', (event) => {
event.preventDefault();
deferred.resolve($imageUrl.val());
});
this.bindEnterKey($imageUrl, $imageBtn);
});
this.ui.onDialogHidden(this.$dialog, () => {
$imageInput.off();
$imageUrl.off();
$imageBtn.off();
if (deferred.state() === 'pending') {
deferred.reject();
}
});
this.ui.showDialog(this.$dialog);
});
}
|
show image dialog
@param {jQuery} $dialog
@return {Promise}
|
showImageDialog
|
javascript
|
summernote/summernote
|
src/js/module/ImageDialog.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/ImageDialog.js
|
MIT
|
constructor(context) {
this.context = context;
this.ui = $.summernote.ui;
this.editable = context.layoutInfo.editable[0];
this.options = context.options;
this.events = {
'summernote.disable summernote.dialog.shown': () => {
this.hide();
},
'summernote.blur': (we, event) => {
if (event.originalEvent && event.originalEvent.relatedTarget) {
if (!this.$popover[0].contains(event.originalEvent.relatedTarget)) {
this.hide();
}
} else {
this.hide();
}
},
};
}
|
Image popover module
mouse events that show/hide popover will be handled by Handle.js.
Handle.js will receive the events and invoke 'imagePopover.update'.
|
constructor
|
javascript
|
summernote/summernote
|
src/js/module/ImagePopover.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/ImagePopover.js
|
MIT
|
shouldInitialize() {
return !lists.isEmpty(this.options.popover.image);
}
|
Image popover module
mouse events that show/hide popover will be handled by Handle.js.
Handle.js will receive the events and invoke 'imagePopover.update'.
|
shouldInitialize
|
javascript
|
summernote/summernote
|
src/js/module/ImagePopover.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/ImagePopover.js
|
MIT
|
initialize() {
this.$popover = this.ui.popover({
className: 'note-image-popover',
}).render().appendTo(this.options.container);
const $content = this.$popover.find('.popover-content,.note-popover-content');
this.context.invoke('buttons.build', $content, this.options.popover.image);
this.$popover.on('mousedown', (event) => { event.preventDefault(); });
}
|
Image popover module
mouse events that show/hide popover will be handled by Handle.js.
Handle.js will receive the events and invoke 'imagePopover.update'.
|
initialize
|
javascript
|
summernote/summernote
|
src/js/module/ImagePopover.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/ImagePopover.js
|
MIT
|
update(target, event) {
if (dom.isImg(target)) {
const position = $(target).offset();
const containerOffset = $(this.options.container).offset();
let pos = {};
if (this.options.popatmouse) {
pos.left = event.pageX - 20;
pos.top = event.pageY;
} else {
pos = position;
}
pos.top -= containerOffset.top;
pos.left -= containerOffset.left;
this.$popover.css({
display: 'block',
left: pos.left,
top: pos.top,
});
} else {
this.hide();
}
}
|
Image popover module
mouse events that show/hide popover will be handled by Handle.js.
Handle.js will receive the events and invoke 'imagePopover.update'.
|
update
|
javascript
|
summernote/summernote
|
src/js/module/ImagePopover.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/ImagePopover.js
|
MIT
|
showLinkDialog(linkInfo) {
return $.Deferred((deferred) => {
const $linkText = this.$dialog.find('.note-link-text');
const $linkUrl = this.$dialog.find('.note-link-url');
const $linkBtn = this.$dialog.find('.note-link-btn');
const $openInNewWindow = this.$dialog
.find('.sn-checkbox-open-in-new-window input[type=checkbox]');
this.ui.onDialogShown(this.$dialog, () => {
this.context.triggerEvent('dialog.shown');
// If no url was given and given text is valid URL then copy that into URL Field
if (!linkInfo.url && func.isValidUrl(linkInfo.text)) {
linkInfo.url = this.checkLinkUrl(linkInfo.text);
}
$linkText.on('input paste propertychange', () => {
// If linktext was modified by input events,
// cloning text from linkUrl will be stopped.
let text = $linkText.val();
let div = document.createElement('div');
div.innerText = text;
text = div.innerHTML;
linkInfo.text = text;
this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);
}).val(linkInfo.text);
$linkUrl.on('input paste propertychange', () => {
// Display same text on `Text to display` as default
// when linktext has no text
if (!linkInfo.text) {
$linkText.val($linkUrl.val());
}
this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);
}).val(linkInfo.url);
if (!env.isSupportTouch) {
$linkUrl.trigger('focus');
}
this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);
this.bindEnterKey($linkUrl, $linkBtn);
this.bindEnterKey($linkText, $linkBtn);
this.onCheckLinkUrl($linkUrl);
const isNewWindowChecked = linkInfo.isNewWindow !== undefined
? linkInfo.isNewWindow : this.context.options.linkTargetBlank;
$openInNewWindow.prop('checked', isNewWindowChecked);
$linkBtn.one('click', (event) => {
event.preventDefault();
deferred.resolve({
range: linkInfo.range,
url: $linkUrl.val(),
text: $linkText.val(),
isNewWindow: $openInNewWindow.is(':checked'),
});
this.ui.hideDialog(this.$dialog);
});
});
this.ui.onDialogHidden(this.$dialog, () => {
// detach events
$linkText.off();
$linkUrl.off();
$linkBtn.off();
if (deferred.state() === 'pending') {
deferred.reject();
}
});
this.ui.showDialog(this.$dialog);
}).promise();
}
|
Show link dialog and set event handlers on dialog controls.
@param {Object} linkInfo
@return {Promise}
|
showLinkDialog
|
javascript
|
summernote/summernote
|
src/js/module/LinkDialog.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/LinkDialog.js
|
MIT
|
showVideoDialog(/* text */) {
return $.Deferred((deferred) => {
const $videoUrl = this.$dialog.find('.note-video-url');
const $videoBtn = this.$dialog.find('.note-video-btn');
this.ui.onDialogShown(this.$dialog, () => {
this.context.triggerEvent('dialog.shown');
$videoUrl.on('input paste propertychange', () => {
this.ui.toggleBtn($videoBtn, $videoUrl.val());
});
if (!env.isSupportTouch) {
$videoUrl.trigger('focus');
}
$videoBtn.on('click', (event) => {
event.preventDefault();
deferred.resolve($videoUrl.val());
});
this.bindEnterKey($videoUrl, $videoBtn);
});
this.ui.onDialogHidden(this.$dialog, () => {
$videoUrl.off();
$videoBtn.off();
if (deferred.state() === 'pending') {
deferred.reject();
}
});
this.ui.showDialog(this.$dialog);
});
}
|
show video dialog
@param {jQuery} $dialog
@return {Promise}
|
showVideoDialog
|
javascript
|
summernote/summernote
|
src/js/module/VideoDialog.js
|
https://github.com/summernote/summernote/blob/master/src/js/module/VideoDialog.js
|
MIT
|
function initSwitchStyle(swEl, options, sw) {
classList(swEl).
add(
'switch',
'switch-' + (legalSize.includes(options.size) ? options.size : 'default'),
options.checked ? SWITCH_ON_CLASS : SWITCH_OFF_CLASS
);
setJackText.call(sw);
setSwitchColor.call(sw);
setJackPosition.call(sw);
setSwitchDisabled.call(sw, sw._options.disabled);
}
|
remove switch form DOM and show the checkbox
@public
|
initSwitchStyle
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function initSwitchAttr(swEl, options) {
swEl.setAttribute('tabindex', 0);
swEl.setAttribute('role', 'checkbox');
swEl.setAttribute('aria-checked', options.checked);
swEl.setAttribute('aria-disabled', options.disabled);
}
|
remove switch form DOM and show the checkbox
@public
|
initSwitchAttr
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function insertSwitch(source, target) {
target.parentNode.insertBefore(source, target.nextSibling);
}
|
remove switch form DOM and show the checkbox
@public
|
insertSwitch
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function setSwitchColor() {
if(this._el.checked){
this._switch.style.boxShadow = 'inset 0 0 0 ' + this._switch.clientHeight/1.8 + 'px ' + this._options.onSwitchColor;
this._switch.style.border = '1px solid ' + this._options.onSwitchColor;
this._switch.style.transition = 'border 0.4s, box-shadow 0.4s, background-color 1.4s';
this._switch.style.backgroundColor = this._options.onSwitchColor;
this._jack.style.backgroundColor = this._options.onJackColor;
}else {
this._switch.style.boxShadow = 'inset 0 0 0 0 ' + this._options.offSwitchColor;
this._switch.style.border = '1px solid ' + SWITCH_BORDER_COLOR;
this._switch.style.transition = 'border 0.4s, box-shadow 0.4s';
this._switch.style.backgroundColor = this._options.offSwitchColor;
this._jack.style.backgroundColor = this._options.offJackColor;
}
}
|
remove switch form DOM and show the checkbox
@public
|
setSwitchColor
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function setSwitchDisabled(disabled) {
this._el.disabled = disabled;
classList(this._switch)[disabled? 'add' : 'remove']('switch-disabled');
this._switch.setAttribute('aria-disabled', disabled);
}
|
remove switch form DOM and show the checkbox
@public
|
setSwitchDisabled
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function setJackPosition() {
let offset = parseInt(window.getComputedStyle(this._switch).width) - parseInt(window.getComputedStyle(this._jack).width);
this._jack.style.left = this._el.checked ? offset+'px' : 0;
}
|
remove switch form DOM and show the checkbox
@public
|
setJackPosition
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function setJackText() {
if(!this._options.showText)return;
this._jack.innerHTML = this._el.checked ? this._options.onText : this._options.offText;
}
|
remove switch form DOM and show the checkbox
@public
|
setJackText
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function mergeOptions(a, b) {
if(!b)return a;
Object.keys(b).forEach(key => {
a[key] = b[key];
});
return a;
}
|
remove switch form DOM and show the checkbox
@public
|
mergeOptions
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function bindEvents(events, sw) {
for(let[value, el] of events){
value = value.split(' ');
(function (event, func) {
el.addEventListener(event, switchEventsHandles[func])
})(value[0], value[1]);
}
}
|
remove switch form DOM and show the checkbox
@public
|
bindEvents
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
function unbindEvents(events,sw) {
for(let[value, el] of events){
value = value.split(' ');
(function (event, func) {
console.log();
el.removeEventListener(event, switchEventsHandles[func]);
})(value[0], value[1]);
}
}
|
remove switch form DOM and show the checkbox
@public
|
unbindEvents
|
javascript
|
weatherstar/switch
|
src/switch.js
|
https://github.com/weatherstar/switch/blob/master/src/switch.js
|
MIT
|
async function start() {
// Make sure the database tables are up to date
await models.sequelize.sync({ force: true });
// Create sample data
const foo = await models.User.create({ name: 'Foo' });
const bar = await models.User.create({ name: 'Bar' });
await foo.createPet({ name: 'Bat' });
await bar.createPet({ name: 'Baz' });
// Start the GraphQL server
server.start(() => {
console.log('Server is running on localhost:4000');
});
}
|
DISCLAIMER: using sequelize#sync is not recommended for production use. Please, please
use migrations. This method of creating a database is used in this demo for simplicity's sake.
|
start
|
javascript
|
mickhansen/graphql-sequelize
|
examples/graphql-yoga/src/index.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/examples/graphql-yoga/src/index.js
|
MIT
|
toCursor = function (item, index) {
const model = getModelOfInstance(item);
const id = model ?
typeof model.primaryKeyAttribute === 'string' ? item[model.primaryKeyAttribute] : null :
item[Object.keys(item)[0]];
return base64(JSON.stringify([id, index]));
}
|
Creates a cursor given a item returned from the Database
@param {Object} item sequelize row
@param {Integer} index the index of this item within the results, 0 indexed
@return {String} The Base64 encoded cursor string
|
toCursor
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
toCursor = function (item, index) {
const model = getModelOfInstance(item);
const id = model ?
typeof model.primaryKeyAttribute === 'string' ? item[model.primaryKeyAttribute] : null :
item[Object.keys(item)[0]];
return base64(JSON.stringify([id, index]));
}
|
Creates a cursor given a item returned from the Database
@param {Object} item sequelize row
@param {Integer} index the index of this item within the results, 0 indexed
@return {String} The Base64 encoded cursor string
|
toCursor
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
fromCursor = function (cursor) {
let [id, index] = JSON.parse(unbase64(cursor));
return {
id,
index
};
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
fromCursor
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
fromCursor = function (cursor) {
let [id, index] = JSON.parse(unbase64(cursor));
return {
id,
index
};
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
fromCursor
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
argsToWhere = function (args) {
let result = {};
if (where === undefined) return result;
_.each(args, (value, key) => {
if (ignoreArgs && key in ignoreArgs) return;
Object.assign(result, where(key, value, result));
});
return replaceWhereOperators(result);
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
argsToWhere
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
argsToWhere = function (args) {
let result = {};
if (where === undefined) return result;
_.each(args, (value, key) => {
if (ignoreArgs && key in ignoreArgs) return;
Object.assign(result, where(key, value, result));
});
return replaceWhereOperators(result);
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
argsToWhere
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
resolveEdge = function (item, index, queriedCursor, sourceArgs = {}, source) {
let startIndex = null;
if (queriedCursor) startIndex = Number(queriedCursor.index);
if (startIndex !== null) {
startIndex++;
} else {
startIndex = 0;
}
return {
cursor: toCursor(item, index + startIndex),
node: item,
source: source,
sourceArgs
};
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
resolveEdge
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
resolveEdge = function (item, index, queriedCursor, sourceArgs = {}, source) {
let startIndex = null;
if (queriedCursor) startIndex = Number(queriedCursor.index);
if (startIndex !== null) {
startIndex++;
} else {
startIndex = 0;
}
return {
cursor: toCursor(item, index + startIndex),
node: item,
source: source,
sourceArgs
};
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
resolveEdge
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
resolveConnection = (source, args, context, info) => {
var fieldNodes = info.fieldASTs || info.fieldNodes;
if (simplifyAST(fieldNodes[0], info).fields.edges) {
return $resolver(source, args, context, info);
}
return after({
source,
args,
where: argsToWhere(args)
}, args, context, info);
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
resolveConnection
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
resolveConnection = (source, args, context, info) => {
var fieldNodes = info.fieldASTs || info.fieldNodes;
if (simplifyAST(fieldNodes[0], info).fields.edges) {
return $resolver(source, args, context, info);
}
return after({
source,
args,
where: argsToWhere(args)
}, args, context, info);
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
resolveConnection
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
function createConnection({
name,
nodeType,
target: targetMaybeThunk,
orderBy: orderByEnum,
before,
after,
connectionFields,
edgeFields,
where
}) {
const {
edgeType,
connectionType
} = connectionDefinitions({
name,
nodeType,
connectionFields,
edgeFields
});
let $connectionArgs = {
...connectionArgs
};
if (orderByEnum) {
$connectionArgs.orderBy = {
type: new GraphQLList(orderByEnum)
};
}
const {
resolveEdge,
resolveConnection
} = createConnectionResolver({
orderBy: orderByEnum,
target: targetMaybeThunk,
before,
after,
where,
ignoreArgs: $connectionArgs
});
return {
connectionType,
edgeType,
nodeType,
resolveEdge,
resolveConnection,
connectionArgs: $connectionArgs,
resolve: resolveConnection
};
}
|
Decode a cursor into its component parts
@param {String} cursor Base64 encoded cursor
@return {Object} Object containing ID and index
|
createConnection
|
javascript
|
mickhansen/graphql-sequelize
|
src/relay.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js
|
MIT
|
function replaceKeyDeep(obj, keyMap) {
return Object.getOwnPropertySymbols(obj).concat(Object.keys(obj)).reduce((memo, key)=> {
// determine which key we are going to use
let targetKey = keyMap[key] ? keyMap[key] : key;
if (Array.isArray(obj[key])) {
// recurse if an array
memo[targetKey] = obj[key].map((val) => {
if (Object.prototype.toString.call(val) === '[object Object]') {
return replaceKeyDeep(val, keyMap);
}
return val;
});
} else if (Object.prototype.toString.call(obj[key]) === '[object Object]') {
// recurse if Object
memo[targetKey] = replaceKeyDeep(obj[key], keyMap);
} else {
// assign the new value
memo[targetKey] = obj[key];
}
// return the modified object
return memo;
}, {});
}
|
Replace a key deeply in an object
@param obj
@param keyMap
@returns {Object}
|
replaceKeyDeep
|
javascript
|
mickhansen/graphql-sequelize
|
src/replaceWhereOperators.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/replaceWhereOperators.js
|
MIT
|
function replaceWhereOperators(where) {
return replaceKeyDeep(where, sequelizeOps);
}
|
Replace the where arguments object and return the sequelize compatible version.
@param where arguments object in GraphQL Safe format meaning no leading "$" chars.
@returns {Object}
|
replaceWhereOperators
|
javascript
|
mickhansen/graphql-sequelize
|
src/replaceWhereOperators.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/replaceWhereOperators.js
|
MIT
|
function mapType(mapFunc) {
customTypeMapper = mapFunc;
}
|
A function to set a custom mapping of types
@param {Function} mapFunc
|
mapType
|
javascript
|
mickhansen/graphql-sequelize
|
src/typeMapper.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/typeMapper.js
|
MIT
|
function sanitizeEnumValue(value) {
return value
.trim()
.replace(/([^_a-zA-Z0-9])/g, (_, p) => specialCharsMap.get(p) || ' ')
.split(' ')
.map((v, i) => i ? _.upperFirst(v) : v)
.join('')
.replace(/(^\d)/, '_$1');
}
|
Checks the type of the sequelize data type and
returns the corresponding type in GraphQL
@param {Object} sequelizeType
@param {Object} sequelizeTypes
@return {Function} GraphQL type declaration
|
sanitizeEnumValue
|
javascript
|
mickhansen/graphql-sequelize
|
src/typeMapper.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/typeMapper.js
|
MIT
|
serialize(d) {
if (!d) {
return null;
}
if (d instanceof Date) {
return d.toISOString();
}
return d;
}
|
serialize
@param {Date} d Date obj
@return {String} Serialised date object
|
serialize
|
javascript
|
mickhansen/graphql-sequelize
|
src/types/dateType.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/types/dateType.js
|
MIT
|
parseValue(value) {
try {
if (!value) {
return null;
}
return new Date(value);
} catch (e) {
return null;
}
}
|
parseValue
@param {String} value date string
@return {Date} Date object
|
parseValue
|
javascript
|
mickhansen/graphql-sequelize
|
src/types/dateType.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/types/dateType.js
|
MIT
|
parseLiteral(ast) {
return new Date(ast.value);
}
|
parseValue
@param {String} value date string
@return {Date} Date object
|
parseLiteral
|
javascript
|
mickhansen/graphql-sequelize
|
src/types/dateType.js
|
https://github.com/mickhansen/graphql-sequelize/blob/master/src/types/dateType.js
|
MIT
|
function strip(start, end) {
return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
}
|
/) {
var $0 = $$.length - 1;
switch (yystate) {
case 1:
return $$[$0 - 1];
break;
case 2:
this.$ = yy.prepareProgram($$[$0]);
break;
case 3:
this.$ = $$[$0];
break;
case 4:
this.$ = $$[$0];
break;
case 5:
this.$ = $$[$0];
break;
case 6:
this.$ = $$[$0];
break;
case 7:
this.$ = $$[$0];
break;
case 8:
this.$ = $$[$0];
break;
case 9:
this.$ = {
type: 'CommentStatement',
value: yy.stripComment($$[$0]),
strip: yy.stripFlags($$[$0], $$[$0]),
loc: yy.locInfo(this._$)
};
break;
case 10:
this.$ = {
type: 'ContentStatement',
original: $$[$0],
value: $$[$0],
loc: yy.locInfo(this._$)
};
break;
case 11:
this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
break;
case 12:
this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
break;
case 13:
this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
break;
case 14:
this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
break;
case 15:
this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 16:
this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 17:
this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 18:
this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
break;
case 19:
var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
program.chained = true;
this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
break;
case 20:
this.$ = $$[$0];
break;
case 21:
this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
break;
case 22:
this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
break;
case 23:
this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
break;
case 24:
this.$ = {
type: 'PartialStatement',
name: $$[$0 - 3],
params: $$[$0 - 2],
hash: $$[$0 - 1],
indent: '',
strip: yy.stripFlags($$[$0 - 4], $$[$0]),
loc: yy.locInfo(this._$)
};
break;
case 25:
this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
break;
case 26:
this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
break;
case 27:
this.$ = $$[$0];
break;
case 28:
this.$ = $$[$0];
break;
case 29:
this.$ = {
type: 'SubExpression',
path: $$[$0 - 3],
params: $$[$0 - 2],
hash: $$[$0 - 1],
loc: yy.locInfo(this._$)
};
break;
case 30:
this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
break;
case 31:
this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
break;
case 32:
this.$ = yy.id($$[$0 - 1]);
break;
case 33:
this.$ = $$[$0];
break;
case 34:
this.$ = $$[$0];
break;
case 35:
this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
break;
case 36:
this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
break;
case 37:
this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
break;
case 38:
this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
break;
case 39:
this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
break;
case 40:
this.$ = $$[$0];
break;
case 41:
this.$ = $$[$0];
break;
case 42:
this.$ = yy.preparePath(true, $$[$0], this._$);
break;
case 43:
this.$ = yy.preparePath(false, $$[$0], this._$);
break;
case 44:
$$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
break;
case 45:
this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
break;
case 46:
this.$ = [];
break;
case 47:
$$[$0 - 1].push($$[$0]);
break;
case 48:
this.$ = [$$[$0]];
break;
case 49:
$$[$0 - 1].push($$[$0]);
break;
case 50:
this.$ = [];
break;
case 51:
$$[$0 - 1].push($$[$0]);
break;
case 58:
this.$ = [];
break;
case 59:
$$[$0 - 1].push($$[$0]);
break;
case 64:
this.$ = [];
break;
case 65:
$$[$0 - 1].push($$[$0]);
break;
case 70:
this.$ = [];
break;
case 71:
$$[$0 - 1].push($$[$0]);
break;
case 78:
this.$ = [];
break;
case 79:
$$[$0 - 1].push($$[$0]);
break;
case 82:
this.$ = [];
break;
case 83:
$$[$0 - 1].push($$[$0]);
break;
case 86:
this.$ = [];
break;
case 87:
$$[$0 - 1].push($$[$0]);
break;
case 90:
this.$ = [];
break;
case 91:
$$[$0 - 1].push($$[$0]);
break;
case 94:
this.$ = [];
break;
case 95:
$$[$0 - 1].push($$[$0]);
break;
case 98:
this.$ = [$$[$0]];
break;
case 99:
$$[$0 - 1].push($$[$0]);
break;
case 100:
this.$ = [$$[$0]];
break;
case 101:
$$[$0 - 1].push($$[$0]);
break;
}
},
table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] },
parseError: function parseError(str, hash) {
throw new Error(str);
},
parse: function parse(input) {
var self = this,
stack = [0],
vstack = [null],
lstack = [],
table = this.table,
yytext = "",
yylineno = 0,
yyleng = 0,
recovering = 0,
TERROR = 2,
EOF = 1;
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
this.yy.parser = this;
if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
var yyloc = this.lexer.yylloc;
lstack.push(yyloc);
var ranges = this.lexer.options && this.lexer.options.ranges;
if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
function lex() {
var token;
token = self.lexer.lex() || 1;
if (typeof token !== "number") {
token = self.symbols_[token] || token;
}
return token;
}
var symbol,
preErrorSymbol,
state,
action,
a,
r,
yyval = {},
p,
len,
newState,
expected;
while (true) {
state = stack[stack.length - 1];
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol === null || typeof symbol == "undefined") {
symbol = lex();
}
action = table[state] && table[state][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
if (!recovering) {
expected = [];
for (p in table[state]) if (this.terminals_[p] && p > 2) {
expected.push("'" + this.terminals_[p] + "'");
}
if (this.lexer.showPosition) {
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
} else {
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
}
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(this.lexer.yytext);
lstack.push(this.lexer.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
yyloc = this.lexer.yylloc;
if (recovering > 0) recovering--;
} else {
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
len = this.productions_[action[1]][1];
yyval.$ = vstack[vstack.length - len];
yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
if (ranges) {
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
}
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
if (typeof r !== "undefined") {
return r;
}
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
return true;
}
}
return true;
}
};
/* Jison generated lexer
|
strip
|
javascript
|
goofychris/art-template
|
example/web-test-speed/js/handlebars.js
|
https://github.com/goofychris/art-template/blob/master/example/web-test-speed/js/handlebars.js
|
MIT
|
function Parser() {
this.yy = {};
}
|
/) {
var $0 = $$.length - 1;
switch (yystate) {
case 1:
return $$[$0 - 1];
break;
case 2:
this.$ = yy.prepareProgram($$[$0]);
break;
case 3:
this.$ = $$[$0];
break;
case 4:
this.$ = $$[$0];
break;
case 5:
this.$ = $$[$0];
break;
case 6:
this.$ = $$[$0];
break;
case 7:
this.$ = $$[$0];
break;
case 8:
this.$ = $$[$0];
break;
case 9:
this.$ = {
type: 'CommentStatement',
value: yy.stripComment($$[$0]),
strip: yy.stripFlags($$[$0], $$[$0]),
loc: yy.locInfo(this._$)
};
break;
case 10:
this.$ = {
type: 'ContentStatement',
original: $$[$0],
value: $$[$0],
loc: yy.locInfo(this._$)
};
break;
case 11:
this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
break;
case 12:
this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
break;
case 13:
this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
break;
case 14:
this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
break;
case 15:
this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 16:
this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 17:
this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 18:
this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
break;
case 19:
var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
program.chained = true;
this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
break;
case 20:
this.$ = $$[$0];
break;
case 21:
this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
break;
case 22:
this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
break;
case 23:
this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
break;
case 24:
this.$ = {
type: 'PartialStatement',
name: $$[$0 - 3],
params: $$[$0 - 2],
hash: $$[$0 - 1],
indent: '',
strip: yy.stripFlags($$[$0 - 4], $$[$0]),
loc: yy.locInfo(this._$)
};
break;
case 25:
this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
break;
case 26:
this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
break;
case 27:
this.$ = $$[$0];
break;
case 28:
this.$ = $$[$0];
break;
case 29:
this.$ = {
type: 'SubExpression',
path: $$[$0 - 3],
params: $$[$0 - 2],
hash: $$[$0 - 1],
loc: yy.locInfo(this._$)
};
break;
case 30:
this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
break;
case 31:
this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
break;
case 32:
this.$ = yy.id($$[$0 - 1]);
break;
case 33:
this.$ = $$[$0];
break;
case 34:
this.$ = $$[$0];
break;
case 35:
this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
break;
case 36:
this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
break;
case 37:
this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
break;
case 38:
this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
break;
case 39:
this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
break;
case 40:
this.$ = $$[$0];
break;
case 41:
this.$ = $$[$0];
break;
case 42:
this.$ = yy.preparePath(true, $$[$0], this._$);
break;
case 43:
this.$ = yy.preparePath(false, $$[$0], this._$);
break;
case 44:
$$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
break;
case 45:
this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
break;
case 46:
this.$ = [];
break;
case 47:
$$[$0 - 1].push($$[$0]);
break;
case 48:
this.$ = [$$[$0]];
break;
case 49:
$$[$0 - 1].push($$[$0]);
break;
case 50:
this.$ = [];
break;
case 51:
$$[$0 - 1].push($$[$0]);
break;
case 58:
this.$ = [];
break;
case 59:
$$[$0 - 1].push($$[$0]);
break;
case 64:
this.$ = [];
break;
case 65:
$$[$0 - 1].push($$[$0]);
break;
case 70:
this.$ = [];
break;
case 71:
$$[$0 - 1].push($$[$0]);
break;
case 78:
this.$ = [];
break;
case 79:
$$[$0 - 1].push($$[$0]);
break;
case 82:
this.$ = [];
break;
case 83:
$$[$0 - 1].push($$[$0]);
break;
case 86:
this.$ = [];
break;
case 87:
$$[$0 - 1].push($$[$0]);
break;
case 90:
this.$ = [];
break;
case 91:
$$[$0 - 1].push($$[$0]);
break;
case 94:
this.$ = [];
break;
case 95:
$$[$0 - 1].push($$[$0]);
break;
case 98:
this.$ = [$$[$0]];
break;
case 99:
$$[$0 - 1].push($$[$0]);
break;
case 100:
this.$ = [$$[$0]];
break;
case 101:
$$[$0 - 1].push($$[$0]);
break;
}
},
table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] },
parseError: function parseError(str, hash) {
throw new Error(str);
},
parse: function parse(input) {
var self = this,
stack = [0],
vstack = [null],
lstack = [],
table = this.table,
yytext = "",
yylineno = 0,
yyleng = 0,
recovering = 0,
TERROR = 2,
EOF = 1;
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
this.yy.parser = this;
if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
var yyloc = this.lexer.yylloc;
lstack.push(yyloc);
var ranges = this.lexer.options && this.lexer.options.ranges;
if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
function lex() {
var token;
token = self.lexer.lex() || 1;
if (typeof token !== "number") {
token = self.symbols_[token] || token;
}
return token;
}
var symbol,
preErrorSymbol,
state,
action,
a,
r,
yyval = {},
p,
len,
newState,
expected;
while (true) {
state = stack[stack.length - 1];
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol === null || typeof symbol == "undefined") {
symbol = lex();
}
action = table[state] && table[state][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
if (!recovering) {
expected = [];
for (p in table[state]) if (this.terminals_[p] && p > 2) {
expected.push("'" + this.terminals_[p] + "'");
}
if (this.lexer.showPosition) {
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
} else {
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
}
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(this.lexer.yytext);
lstack.push(this.lexer.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
yyloc = this.lexer.yylloc;
if (recovering > 0) recovering--;
} else {
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
len = this.productions_[action[1]][1];
yyval.$ = vstack[vstack.length - len];
yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
if (ranges) {
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
}
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
if (typeof r !== "undefined") {
return r;
}
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
return true;
}
}
return true;
}
};
/* Jison generated lexer
|
Parser
|
javascript
|
goofychris/art-template
|
example/web-test-speed/js/handlebars.js
|
https://github.com/goofychris/art-template/blob/master/example/web-test-speed/js/handlebars.js
|
MIT
|
function r(e,t){var n={absolute:t.options.explicitRoot,relative:!t.options.explicitRoot&&t.options.explicitTarget,
fromBase:t.options.relativeTo};return n.absolute||n.relative?(n.absolute&&t.options.explicitTarget&&t.warnings.push("Both 'root' and output file given so rebasing URLs as absolute paths"),n.absolute&&(n.toBase=i.resolve(t.options.root)),n.relative&&(n.toBase=i.resolve(t.options.target)),n.fromBase&&n.toBase?o(e,n,t):e):e}
|
/",SINGLE_QUOTE:"'",DOUBLE_QUOTE:'"',TEMPLATE_QUOTE:"`",REGEXP:"//g"},f=n.BRACKETS={"(":")","{":"}","[":"]"},d={")":"(","}":"{","]":"["};n.parse=r,n.parseUntil=i,n.parseChar=o,n.defaultState=function(){return new s},s.prototype.current=function(){return this.stack[this.stack.length-1]},s.prototype.isString=function(){return this.current()===h.SINGLE_QUOTE||this.current()===h.DOUBLE_QUOTE||this.current()===h.TEMPLATE_QUOTE},s.prototype.isComment=function(){return this.current()===h.LINE_COMMENT||this.current()===h.BLOCK_COMMENT},s.prototype.isNesting=function(e){return(!e||!e.ignoreLineComment||1!==this.stack.length||this.stack[0]!==h.LINE_COMMENT)&&!!this.stack.length},n.isPunctuator=u,n.isKeyword=c},{"is-regex":97}],13:[function(e,t,n){t.exports=e("./lib/clean")},{"./lib/clean":14}],14:[function(e,t,n){(function(n){function r(e){return void 0===e?["all"]:e}function i(e){return!T.existsSync(e)&&!/\.css$/.test(e)}function o(e){return T.existsSync(e)&&T.statSync(e).isDirectory()}function s(e){return e?{hostname:F.parse(e).hostname,port:parseInt(F.parse(e).port)}:{}}function a(e,t){function n(n){return n=t.options.debug?c(t,n):p(t,n),n=u(t,n),e?e.call(null,t.errors.length>0?t.errors:null,n):n}return function(e){return t.options.sourceMap?t.inputSourceMapTracker.track(e,function(){return t.options.sourceMapInlineSources?t.inputSourceMapTracker.resolveSources(function(){return n(e)}):n(e)}):n(e)}}function u(e,t){return t.stats=e.stats,t.errors=e.errors,t.warnings=e.warnings,t}function c(e,t){var r=n.hrtime();e.stats.originalSize=e.sourceTracker.removeAll(t).length,t=p(e,t);var i=n.hrtime(r);return e.stats.timeSpent=~~(1e3*i[0]+i[1]/1e6),e.stats.efficiency=1-t.styles.length/e.stats.originalSize,e.stats.minifiedSize=t.styles.length,t}function l(e){return function(t,r){var i=t.constructor.name+"#"+r,o=n.hrtime();e(t,r);var s=n.hrtime(o);console.log("%d ms: "+i,1e3*s[0]+s[1]/1e6)}}function p(e,t){function n(t,n){return t=s.restore(t,n),t=a.restore(t),t=r.rebase?f(t,e):t,t=o.restore(t),i.restore(t)}var r=e.options,i=new b(e,r.keepSpecialComments,r.keepBreaks,r.sourceMap),o=new _(r.sourceMap),s=new x(r.sourceMap),a=new w(e,r.sourceMap,r.compatibility.properties.urlQuotes),u=r.sourceMap?y:v,c=function(e,n){t="function"==typeof e?e(t):e[n](t)};r.benchmark&&(c=l(c)),c(i,"escape"),c(o,"escape"),c(a,"escape"),c(s,"escape");var p=d(t,e);return m(p,r,e),r.advanced&&g(p,r,e,!0),u(p,r,n,e.inputSourceMapTracker)}var h=e("./imports/inliner"),f=e("./urls/rebase"),d=e("./tokenizer/tokenize"),m=e("./selectors/simple"),g=e("./selectors/advanced"),v=e("./stringifier/simple"),y=e("./stringifier/source-maps"),b=e("./text/comments-processor"),_=e("./text/expressions-processor"),x=e("./text/free-text-processor"),w=e("./text/urls-processor"),k=e("./utils/compatibility"),E=e("./utils/input-source-map-tracker"),A=e("./utils/source-tracker"),C=e("./utils/source-reader"),S=e("./properties/validator"),T=e("fs"),O=e("path"),F=e("url"),D=e("./utils/object").override;(t.exports=function(e){e=e||{},this.options={advanced:void 0===e.advanced||!!e.advanced,aggressiveMerging:void 0===e.aggressiveMerging||!!e.aggressiveMerging,benchmark:e.benchmark,compatibility:new k(e.compatibility).toOptions(),debug:e.debug,explicitRoot:!!e.root,explicitTarget:!!e.target,inliner:e.inliner||{},keepBreaks:e.keepBreaks||!1,keepSpecialComments:"keepSpecialComments"in e?e.keepSpecialComments:"*",mediaMerging:void 0===e.mediaMerging||!!e.mediaMerging,processImport:void 0===e.processImport||!!e.processImport,processImportFrom:r(e.processImportFrom),rebase:void 0===e.rebase||!!e.rebase,relativeTo:e.relativeTo,restructuring:void 0===e.restructuring||!!e.restructuring,root:e.root||n.cwd(),roundingPrecision:e.roundingPrecision,semanticMerging:void 0!==e.semanticMerging&&!!e.semanticMerging,shorthandCompacting:void 0===e.shorthandCompacting||!!e.shorthandCompacting,sourceMap:e.sourceMap,sourceMapInlineSources:!!e.sourceMapInlineSources,target:!e.target||i(e.target)||o(e.target)?e.target:O.dirname(e.target)},this.options.inliner.timeout=this.options.inliner.timeout||5e3,this.options.inliner.request=D(s(n.env.HTTP_PROXY||n.env.http_proxy),this.options.inliner.request||{})}).prototype.minify=function(e,t){var r={stats:{},errors:[],warnings:[],options:this.options,debug:this.options.debug,localOnly:!t,sourceTracker:new A,validator:new S(this.options.compatibility)};return r.options.sourceMap&&(r.inputSourceMapTracker=new E(r)),r.sourceReader=new C(r,e),e=r.sourceReader.toString(),r.options.processImport||e.indexOf("@shallow")>0?(t?n.nextTick:function(e){return e()})(function(){return new h(r).process(e,{localOnly:r.localOnly,imports:r.options.processImportFrom,whenDone:a(t,r)})}):a(t,r)(e)}}).call(this,e("_process"))},{"./imports/inliner":18,"./properties/validator":33,"./selectors/advanced":36,"./selectors/simple":49,"./stringifier/simple":53,"./stringifier/source-maps":54,"./text/comments-processor":55,"./text/expressions-processor":57,"./text/free-text-processor":58,"./text/urls-processor":59,"./tokenizer/tokenize":62,"./urls/rebase":63,"./utils/compatibility":67,"./utils/input-source-map-tracker":68,"./utils/object":69,"./utils/source-reader":71,"./utils/source-tracker":72,_process:104,fs:10,path:103,url:150}],15:[function(e,t,n){function r(e,t,n,r){return t+a[n.toLowerCase()]+r}function i(e,t,n){return u[t.toLowerCase()]+n}var o={},s={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},a={},u={};for(var c in s){var l=s[c];c.length<l.length?u[l]=c:a[c]=l}var p=new RegExp("(^| |,|\\))("+Object.keys(a).join("|")+")( |,|\\)|$)","ig"),h=new RegExp("("+Object.keys(u).join("|")+")([^a-f0-9]|$)","ig");o.shorten=function(e){var t=e.indexOf("#")>-1,n=e.replace(p,r);return n!=e&&(n=n.replace(p,r)),t?n.replace(h,i):n},t.exports=o},{}],16:[function(e,t,n){function r(e,t,n){this.hue=e,this.saturation=t,this.lightness=n}function i(e,t,n){var r,i,s;if(e%=360,e<0&&(e+=360),e=~~e/360,t<0?t=0:t>100&&(t=100),t=~~t/100,n<0?n=0:n>100&&(n=100),n=~~n/100,0===t)r=i=s=n;else{var a=n<.5?n*(1+t):n+t-n*t,u=2*n-a;r=o(u,a,e+1/3),i=o(u,a,e),s=o(u,a,e-1/3)}return[~~(255*r),~~(255*i),~~(255*s)]}function o(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}r.prototype.toHex=function(){var e=i(this.hue,this.saturation,this.lightness),t=e[0].toString(16),n=e[1].toString(16),r=e[2].toString(16);return"#"+(1==t.length?"0":"")+t+(1==n.length?"0":"")+n+(1==r.length?"0":"")+r},t.exports=r},{}],17:[function(e,t,n){function r(e,t,n){this.red=e,this.green=t,this.blue=n}r.prototype.toHex=function(){return"#"+("00000"+(Math.max(0,Math.min(~~this.red,255))<<16|Math.max(0,Math.min(~~this.green,255))<<8|Math.max(0,Math.min(~~this.blue,255))).toString(16)).slice(-6)},t.exports=r},{}],18:[function(e,t,n){(function(n){function r(e){this.outerContext=e}function i(e,t){if(t.shallow)return t.shallow=!1,t.done.push(e),a(t);for(var n=0,r=0,i=0,o=u(e);r<e.length&&-1!=(n=s(e,i));){if(!o(n)){if(-1==(r=e.indexOf(";",n))){i=e.length,e="";break}var p=e.substring(0,n);return t.done.push(p),t.left.unshift([e.substring(r+1),w(t,{shallow:!1})]),t.afterContent=c(p),l(e,n,r,t)}i=n+1}return t.done.push(e),a(t)}function o(e,t){return e.replace(k,function(e,n){return E.test(n)?e:e.replace(n,b.resolve(t,n))})}function s(e,t){var n=e.indexOf("@import",t),r=e.indexOf("@IMPORT",t);return n>-1&&-1==r?n:-1==n&&r>-1?r:Math.min(n,r)}function a(e){return e.left.length>0?i.apply(null,e.left.shift()):e.whenDone(e.done.join(""))}function u(e){var t=0,n=0,r=!1;return function(i){var o,s=0,a=0,u=0,c=0;if(r)return!1;do{if(i>t&&i<n)return!0;if(!(o=e.match(/(\/\*(?!\*\/)[\s\S]*?\*\/)/)))return r=!0,!1;t=s=o.index,a=s+o[0].length,c=a+n,u=c-o[0].length,e=e.substring(a),n=c}while(c<i);return c>i&&i>u}}function c(e){for(var t=u(e),n=-1;;)if(-1==(n=e.indexOf("{",n+1))||!t(n))break;return n>-1}function l(e,t,n,r){r.shallow=e.indexOf("@shallow")>0;var i=e.substring(s(e,t)+"@import".length+1,n).replace(/@shallow\)$/,")").trim(),o=0===i.indexOf("url("),u=o?4:0,l=/^['"]/.exec(i.substring(u,u+2)),m=l?i.indexOf(l[0],u+1):x(i," ")[0].length-(o?1:0),g=i.substring(u,m).replace(/['"]/g,"").replace(/\)$/,"").trim(),v=i.substring(m+1).replace(/^\)/,"").trim(),y=r.isRemote||E.test(g);return!y||!r.localOnly&&p(g,!0,r.imports)?y||p(g,!1,r.imports)?!y&&r.afterContent?(r.warnings.push('Ignoring local @import of "'+g+'" as after other CSS content.'),a(r)):(y?h:f)(g,v,r):(r.afterImport?r.warnings.push('Ignoring local @import of "'+g+'" as after other inlined content.'):d(g,v,r),a(r)):(r.afterContent||c(r.done.join(""))?r.warnings.push('Ignoring remote @import of "'+g+'" as no callback given.'):d(g,v,r),a(r))}function p(e,t,n){if(0===n.length)return!1;t&&A.test(e)&&(e="http:"+e);for(var r=t?b.parse(e).host:e,i=!0,o=0;o<n.length;o++){var s=n[o];"all"==s?i=!0:t&&"local"==s?i=!1:t&&"remote"==s?i=!0:t||"remote"!=s?t||"local"!=s?"!"==s[0]&&s.substring(1)===r&&(i=!1):i=!0:i=!1}return i}function h(e,t,r){function s(e){f||(f=!0,r.errors.push('Broken @import declaration of "'+u+'" - '+e),d(u,t,r),n.nextTick(function(){a(r)}))}var u=E.test(e)?e:b.resolve(r.relativeTo,e),c=u;if(A.test(u)&&(u="http:"+u),r.visited.indexOf(u)>-1)return a(r);r.debug&&console.error("Inlining remote stylesheet: "+u),r.visited.push(u);var l=r.inliner.request.protocol||r.inliner.request.hostname,p=l&&0!==l.indexOf("https://")||0===u.indexOf("http://")?v.get:y.get,f=!1,m=w(b.parse(u),r.inliner.request);void 0!==r.inliner.request.hostname&&(m.protocol=r.inliner.request.protocol||"http:",m.path=m.href),p(m,function(e){if(e.statusCode<200||e.statusCode>399)return s("error "+e.statusCode);if(e.statusCode>299){return h(b.resolve(u,e.headers.location),t,r)}var a=[],l=b.parse(u);e.on("data",function(e){a.push(e.toString())}),e.on("end",function(){var e=a.join("");r.rebase&&(e=_(e,{toBase:c},r)),r.sourceReader.trackSource(u,e),e=r.sourceTracker.store(u,e),e=o(e,u),t.length>0&&(e="@media "+t+"{"+e+"}"),r.afterImport=!0;var s=w(r,{isRemote:!0,relativeTo:l.protocol+"//"+l.host+l.pathname});n.nextTick(function(){i(e,s)})})}).on("error",function(e){s(e.message)}).on("timeout",function(){s("timeout")}).setTimeout(r.inliner.timeout)}function f(e,t,n){var r="/"==e[0]?n.root:n.relativeTo,o=g.resolve(g.join(r,e));if(!m.existsSync(o)||!m.statSync(o).isFile())return n.errors.push('Broken @import declaration of "'+e+'"'),a(n);if(n.visited.indexOf(o)>-1)return a(n);n.debug&&console.error("Inlining local stylesheet: "+o),n.visited.push(o);var s=g.dirname(o),u=m.readFileSync(o,"utf8");if(n.rebase){var c={relative:!0,fromBase:s,toBase:n.baseRelativeTo};u=_(u,c,n)}var l=g.relative(n.root,o);return n.sourceReader.trackSource(l,u),u=n.sourceTracker.store(l,u),t.length>0&&(u="@media "+t+"{"+u+"}"),n.afterImport=!0,i(u,w(n,{relativeTo:s}))}function d(e,t,n){var r="@import url("+e+")"+(t.length>0?" "+t:"")+";";n.done.push(r)}var m=e("fs"),g=e("path"),v=e("http"),y=e("https"),b=e("url"),_=e("../urls/rewrite"),x=e("../utils/split"),w=e("../utils/object.js").override,k=/\/\*# sourceMappingURL=(\S+) \*\//,E=/^(https?:)?\/\//,A=/^\/\//;r.prototype.process=function(e,t){var n=this.outerContext.options.root;return t=w(t,{baseRelativeTo:this.outerContext.options.relativeTo||n,debug:this.outerContext.options.debug,done:[],errors:this.outerContext.errors,left:[],inliner:this.outerContext.options.inliner,rebase:this.outerContext.options.rebase,relativeTo:this.outerContext.options.relativeTo||n,root:n,sourceReader:this.outerContext.sourceReader,sourceTracker:this.outerContext.sourceTracker,warnings:this.outerContext.warnings,visited:[]}),i(e,t)},t.exports=r}).call(this,e("_process"))},{"../urls/rewrite":65,"../utils/object.js":69,"../utils/split":73,_process:104,fs:10,http:10,https:10,path:103,url:150}],19:[function(e,t,n){function r(e){return function(t){return"invert"==t[0]||e.isValidColor(t[0])}}function i(e){return function(t){return"inherit"!=t[0]&&e.isValidStyle(t[0])&&!e.isValidColorValue(t[0])}}function o(e,t,n){var r=n[e];return f(r.doubleValues&&2==r.defaultValue.length?[[e,t.important],[r.defaultValue[0]],[r.defaultValue[1]]]:r.doubleValues&&1==r.defaultValue.length?[[e,t.important],[r.defaultValue[0]]]:[[e,t.important],[r.defaultValue]])}function s(e){return function(t){return"inherit"!=t[0]&&e.isValidWidth(t[0])&&!e.isValidStyleKeyword(t[0])&&!e.isValidColorValue(t[0])}}function a(e,t,n){var r=o("background-image",e,t),i=o("background-position",e,t),s=o("background-size",e,t),a=o("background-repeat",e,t),u=o("background-attachment",e,t),c=o("background-origin",e,t),l=o("background-clip",e,t),p=o("background-color",e,t),h=[r,i,s,a,u,c,l,p],f=e.value,d=!1,g=!1,v=!1,y=!1;if(1==e.value.length&&"inherit"==e.value[0][0])return p.value=r.value=a.value=i.value=s.value=c.value=l.value=e.value,h;for(var b=f.length-1;b>=0;b--){var _=f[b];if(n.isValidBackgroundAttachment(_[0]))u.value=[_];else if(n.isValidBackgroundBox(_[0]))g?(c.value=[_],v=!0):(l.value=[_],g=!0);else if(n.isValidBackgroundRepeat(_[0]))y?a.value.unshift(_):(a.value=[_],y=!0);else if(n.isValidBackgroundPositionPart(_[0])||n.isValidBackgroundSizePart(_[0]))if(b>0){var x=f[b-1];if(x[0].indexOf("/")>0){var w=m(x[0],"/");s.value=[[w.pop()].concat(x.slice(1)),_],f[b-1]=[w.pop()].concat(x.slice(1))}else b>1&&"/"==f[b-2][0]?(s.value=[x,_],b-=2):"/"==x[0]?s.value=[_]:(d||(i.value=[]),i.value.unshift(_),d=!0)}else d||(i.value=[]),i.value.unshift(_),d=!0;else if(n.isValidBackgroundPositionAndSize(_[0])){var k=m(_[0],"/");s.value=[[k.pop()].concat(_.slice(1))],i.value=[[k.pop()].concat(_.slice(1))]}else p.value[0][0]!=t[p.name].defaultValue&&"none"!=p.value[0][0]||!n.isValidColor(_[0])?(n.isValidUrl(_[0])||n.isValidFunction(_[0]))&&(r.value=[_]):p.value=[_]}return g&&!v&&(c.value=l.value.slice(0)),h}function u(e,t){for(var n=e.value,r=-1,i=0,s=n.length;i<s;i++)if("/"==n[i][0]){r=i;break}if(0===r||r===n.length-1)throw new d("Invalid border-radius value.");var a=o(e.name,e,t);a.value=r>-1?n.slice(0,r):n.slice(0),a.components=c(a,t);var u=o(e.name,e,t);u.value=r>-1?n.slice(r+1):n.slice(0),u.components=c(u,t);for(var l=0;l<4;l++)a.components[l].multiplex=!0,a.components[l].value=a.components[l].value.concat(u.components[l].value);return a.components}function c(e,t){var n=t[e.name].components,r=[],i=e.value;if(i.length<1)return[];i.length<2&&(i[1]=i[0].slice(0)),i.length<3&&(i[2]=i[0].slice(0)),i.length<4&&(i[3]=i[1].slice(0));for(var o=n.length-1;o>=0;o--){var s=f([[n[o],e.important]]);s.value=[i[o]],r.unshift(s)}return r}function l(e){return function(t,n,r){var i,s,a,u,c=[],l=t.value;for(i=0,a=l.length;i<a;i++)","==l[i][0]&&c.push(i);if(0===c.length)return e(t,n,r);var p=[];for(i=0,a=c.length;i<=a;i++){var h=0===i?0:c[i-1]+1,f=i<a?c[i]:l.length,d=o(t.name,t,n);d.value=l.slice(h,f),p.push(e(d,n,r))}var m=p[0];for(i=0,a=m.length;i<a;i++)for(m[i].multiplex=!0,s=1,u=p.length;s<u;s++)m[i].value.push([g]),Array.prototype.push.apply(m[i].value,p[s][i].value);return m}}function p(e,t,n){var r=o("list-style-type",e,t),i=o("list-style-position",e,t),s=o("list-style-image",e,t),a=[r,i,s];if(1==e.value.length&&"inherit"==e.value[0][0])return r.value=i.value=s.value=[e.value[0]],a;var u=e.value.slice(0),c=u.length,l=0;for(l=0,c=u.length;l<c;l++)if(n.isValidUrl(u[l][0])||"0"==u[l][0]){s.value=[u[l]],u.splice(l,1);break}for(l=0,c=u.length;l<c;l++)if(n.isValidListStyleType(u[l][0])){r.value=[u[l]],u.splice(l,1);break}return u.length>0&&n.isValidListStylePosition(u[0][0])&&(i.value=[u[0]]),a}function h(e,t,n){for(var a,u,c,l=t[e.name],p=[o(l.components[0],e,t),o(l.components[1],e,t),o(l.components[2],e,t)],h=0;h<3;h++){var f=p[h];f.name.indexOf("color")>0?a=f:f.name.indexOf("style")>0?u=f:c=f}if(1==e.value.length&&"inherit"==e.value[0][0]||3==e.value.length&&"inherit"==e.value[0][0]&&"inherit"==e.value[1][0]&&"inherit"==e.value[2][0])return a.value=u.value=c.value=[e.value[0]],p;var d,m,g=e.value.slice(0);return g.length>0&&(m=g.filter(s(n)),(d=m.length>1&&("none"==m[0][0]||"auto"==m[0][0])?m[1]:m[0])&&(c.value=[d],g.splice(g.indexOf(d),1))),g.length>0&&(d=g.filter(i(n))[0])&&(u.value=[d],g.splice(g.indexOf(d),1)),g.length>0&&(d=g.filter(r(n))[0])&&(a.value=[d],g.splice(g.indexOf(d),1)),p}var f=e("./wrap-for-optimizing").single,d=e("./invalid-property-error"),m=e("../utils/split"),g=",";t.exports={background:a,border:h,borderRadius:u,fourValues:c,listStyle:p,multiplex:l,outline:h}},{"../utils/split":73,"./invalid-property-error":25,"./wrap-for-optimizing":35}],20:[function(e,t,n){function r(){return!0}function i(e,t,n){var r=e.value[0][0],i=t.value[0][0],o=n.isValidFunction(r),s=n.isValidFunction(i);return o&&s?n.areSameFunction(r,i):!(!o&&s)}function o(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!("none"!=i&&"inherit"!=i&&!n.isValidUrl(i))||"none"!=r&&"inherit"!=r&&!n.isValidUrl(r)&&l(e,t,n)}function s(e,t,n){return a(e.components[2],t.components[2],n)}function a(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!(!n.colorOpacity&&(n.isValidRgbaColor(r)||n.isValidHslaColor(r)))&&(!(!n.colorOpacity&&(n.isValidRgbaColor(i)||n.isValidHslaColor(i)))&&(!(!n.isValidNamedColor(i)&&!n.isValidHexColor(i))||!n.isValidNamedColor(r)&&!n.isValidHexColor(r)&&(!(!n.isValidRgbaColor(i)&&!n.isValidHslaColor(i))||!n.isValidRgbaColor(r)&&!n.isValidHslaColor(r)&&l(e,t,n))))}function u(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!(n.isValidFunction(r)^n.isValidFunction(i))}function c(e,t){return e.value[0][0]===t.value[0][0]}function l(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!!n.areSameFunction(r,i)||r===i}function p(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!(n.isValidAndCompatibleUnitWithoutFunction(r)&&!n.isValidAndCompatibleUnitWithoutFunction(i))&&(!!n.isValidUnitWithoutFunction(i)||!n.isValidUnitWithoutFunction(r)&&(!(!n.isValidFunctionWithoutVendorPrefix(i)||!n.isValidFunctionWithoutVendorPrefix(r))||l(e,t,n)))}t.exports={always:r,alwaysButIntoFunction:i,backgroundImage:o,border:s,color:a,sameValue:c,sameFunctionOrValue:l,twoOptionalFunctions:u,unit:p}},{}],21:[function(e,t,n){function r(e){for(var t=i(e),n=e.components.length-1;n>=0;n--){var r=i(e.components[n]);r.value=e.components[n].value.slice(0),t.components.unshift(r)}return t.dirty=!0,t.value=e.value.slice(0),t}function i(e){var t=o([[e.name,e.important,e.hack]]);return t.unused=!1,t}var o=e("./wrap-for-optimizing").single;t.exports={deep:r,shallow:i}},{"./wrap-for-optimizing":35}],22:[function(e,t,n){var r=e("./break-up"),i=e("./can-override"),o=e("./restore"),s={color:{canOverride:i.color,defaultValue:"transparent",shortestValue:"red"},background:{components:["background-image","background-position","background-size","background-repeat","background-attachment","background-origin","background-clip","background-color"],breakUp:r.multiplex(r.background),defaultValue:"0 0",restore:o.multiplex(o.background),shortestValue:"0",shorthand:!0},"background-clip":{canOverride:i.always,defaultValue:"border-box",shortestValue:"border-box"},"background-color":{canOverride:i.color,defaultValue:"transparent",multiplexLastOnly:!0,nonMergeableValue:"none",shortestValue:"red"},"background-image":{canOverride:i.backgroundImage,defaultValue:"none"},"background-origin":{canOverride:i.always,defaultValue:"padding-box",shortestValue:"border-box"},"background-repeat":{canOverride:i.always,defaultValue:["repeat"],doubleValues:!0},"background-position":{canOverride:i.alwaysButIntoFunction,defaultValue:["0","0"],doubleValues:!0,shortestValue:"0"},"background-size":{
canOverride:i.alwaysButIntoFunction,defaultValue:["auto"],doubleValues:!0,shortestValue:"0 0"},"background-attachment":{canOverride:i.always,defaultValue:"scroll"},border:{breakUp:r.border,canOverride:i.border,components:["border-width","border-style","border-color"],defaultValue:"none",restore:o.withoutDefaults,shorthand:!0},"border-color":{canOverride:i.color,defaultValue:"none",shorthand:!0},"border-style":{canOverride:i.always,defaultValue:"none",shorthand:!0},"border-width":{canOverride:i.unit,defaultValue:"medium",shortestValue:"0",shorthand:!0},"list-style":{components:["list-style-type","list-style-position","list-style-image"],canOverride:i.always,breakUp:r.listStyle,restore:o.withoutDefaults,defaultValue:"outside",shortestValue:"none",shorthand:!0},"list-style-type":{canOverride:i.always,defaultValue:"__hack",shortestValue:"none"},"list-style-position":{canOverride:i.always,defaultValue:"outside",shortestValue:"inside"},"list-style-image":{canOverride:i.always,defaultValue:"none"},outline:{components:["outline-color","outline-style","outline-width"],breakUp:r.outline,restore:o.withoutDefaults,defaultValue:"0",shorthand:!0},"outline-color":{canOverride:i.color,defaultValue:"invert",shortestValue:"red"},"outline-style":{canOverride:i.always,defaultValue:"none"},"outline-width":{canOverride:i.unit,defaultValue:"medium",shortestValue:"0"},"-moz-transform":{canOverride:i.sameFunctionOrValue},"-ms-transform":{canOverride:i.sameFunctionOrValue},"-webkit-transform":{canOverride:i.sameFunctionOrValue},transform:{canOverride:i.sameFunctionOrValue}},a=function(e,t,n){n=n||{},s[e]={canOverride:n.canOverride,components:t,breakUp:n.breakUp||r.fourValues,defaultValue:n.defaultValue||"0",restore:n.restore||o.fourValues,shortestValue:n.shortestValue,shorthand:!0};for(var a=0;a<t.length;a++)s[t[a]]={breakUp:n.breakUp||r.fourValues,canOverride:n.canOverride||i.unit,defaultValue:n.defaultValue||"0",shortestValue:n.shortestValue}};["","-moz-","-o-"].forEach(function(e){a(e+"border-radius",[e+"border-top-left-radius",e+"border-top-right-radius",e+"border-bottom-right-radius",e+"border-bottom-left-radius"],{breakUp:r.borderRadius,restore:o.borderRadius})}),a("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"],{breakUp:r.fourValues,canOverride:i.color,defaultValue:"none",shortestValue:"red"}),a("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"],{breakUp:r.fourValues,canOverride:i.always,defaultValue:"none"}),a("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"],{defaultValue:"medium",shortestValue:"0"}),a("padding",["padding-top","padding-right","padding-bottom","padding-left"]),a("margin",["margin-top","margin-right","margin-bottom","margin-left"]);for(var u in s)if(s[u].shorthand)for(var c=0,l=s[u].components.length;c<l;c++)s[s[u].components[c]].componentOf=u;t.exports=s},{"./break-up":19,"./can-override":20,"./restore":31}],23:[function(e,t,n){function r(e,t,n,r){for(var s=!(t.shorthand||n.shorthand||t.multiplex||n.multiplex),a=i(t),u=i(n),c=0,l=t.value.length;c<l;c++)for(var p=0,h=n.value.length;p<h;p++)if(t.value[c][0]!=o&&n.value[p][0]!=o&&!(s&&c!=p||(a.value=[t.value[c]],u.value=[n.value[p]],e(a,u,r))))return!1;return!0}var i=e("./clone").shallow,o=",";t.exports=r},{"./clone":21}],24:[function(e,t,n){function r(e){for(var t=e.value.length-1;t>=0;t--)if("inherit"==e.value[t][0])return!0;return!1}t.exports=r},{}],25:[function(e,t,n){function r(e){this.name="InvalidPropertyError",this.message=e,this.stack=(new Error).stack}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,t.exports=r},{}],26:[function(e,t,n){function r(e,t,n,r){var i,s,a={},u=null;e:for(var c=0,l=e.length;c<l;c++){var p=e[c],d=!("-ms-filter"!=p.name&&"filter"!=p.name||"background"!=u&&"background-image"!=u)?u:p.name,m=p.important,g=p.hack;if(!p.unused)if(c>0&&i&&d==u&&m==i.important&&g==i.hack&&function(t){var n=e[t-1],r=e[t];return h(n.all,n.position)==h(r.all,r.position)}(c)&&!i.unused)p.unused=!0;else{if(d in a&&(n&&d!=u||function(e){return!1===t||!0===t?t:t.indexOf(e)>-1}(c))){var v=a[d],y=o[d]&&o[d].canOverride,b=!1;for(s=v.length-1;s>=0;s--){var _=e[v[s]],x=_.name!=d,w=_.important,k=_.hack;if(!_.unused&&((!x||!w)&&(w||!(k&&!g||!k&&g))&&(!w||"star"!=g&&"underscore"!=g)&&(k||g||x||!y||y(_,p,r)))){if(w&&!m||w&&g){p.unused=!0,i=p;continue e}b=!0,_.unused=!0}}if(b){c=-1,i=null,u=null,a={};continue}}else{a[d]=a[d]||[],a[d].push(c);var E=f[d];if(E)for(s=E.length-1;s>=0;s--){var A=E[s];a[A]=a[A]||[],a[A].push(c)}}u=d,i=p}}}function i(e,t,n,o,h,f){var d=f.validator,m=f.warnings,g=s(t);a(g,d,m),r(g,n,h.aggressiveMerging,d);for(var v=0,y=g.length;v<y;v++){var b=g[v];b.variable&&b.block&&i(e,b.value[0],n,o,h,f)}o&&h.shorthandCompacting&&(u(g,h.compatibility,d),c(g,h.sourceMap,d)),p(g),l(g)}var o=e("./compactable"),s=e("./wrap-for-optimizing").all,a=e("./populate-components"),u=e("./override-compactor"),c=e("./shorthand-compactor"),l=e("./remove-unused"),p=e("./restore-from-optimizing"),h=e("../stringifier/one-time").property,f={"animation-delay":["animation"],"animation-direction":["animation"],"animation-duration":["animation"],"animation-fill-mode":["animation"],"animation-iteration-count":["animation"],"animation-name":["animation"],"animation-play-state":["animation"],"animation-timing-function":["animation"],"-moz-animation-delay":["-moz-animation"],"-moz-animation-direction":["-moz-animation"],"-moz-animation-duration":["-moz-animation"],"-moz-animation-fill-mode":["-moz-animation"],"-moz-animation-iteration-count":["-moz-animation"],"-moz-animation-name":["-moz-animation"],"-moz-animation-play-state":["-moz-animation"],"-moz-animation-timing-function":["-moz-animation"],"-o-animation-delay":["-o-animation"],"-o-animation-direction":["-o-animation"],"-o-animation-duration":["-o-animation"],"-o-animation-fill-mode":["-o-animation"],"-o-animation-iteration-count":["-o-animation"],"-o-animation-name":["-o-animation"],"-o-animation-play-state":["-o-animation"],"-o-animation-timing-function":["-o-animation"],"-webkit-animation-delay":["-webkit-animation"],"-webkit-animation-direction":["-webkit-animation"],"-webkit-animation-duration":["-webkit-animation"],"-webkit-animation-fill-mode":["-webkit-animation"],"-webkit-animation-iteration-count":["-webkit-animation"],"-webkit-animation-name":["-webkit-animation"],"-webkit-animation-play-state":["-webkit-animation"],"-webkit-animation-timing-function":["-webkit-animation"],"border-color":["border"],"border-style":["border"],"border-width":["border"],"border-bottom":["border"],"border-bottom-color":["border-bottom","border-color","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left":["border"],"border-left-color":["border-left","border-color","border"],"border-left-style":["border-left","border-style","border"],"border-left-width":["border-left","border-width","border"],"border-right":["border"],"border-right-color":["border-right","border-color","border"],"border-right-style":["border-right","border-style","border"],"border-right-width":["border-right","border-width","border"],"border-top":["border"],"border-top-color":["border-top","border-color","border"],"border-top-style":["border-top","border-style","border"],"border-top-width":["border-top","border-width","border"],"font-family":["font"],"font-size":["font"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"transition-delay":["transition"],"transition-duration":["transition"],"transition-property":["transition"],"transition-timing-function":["transition"],"-moz-transition-delay":["-moz-transition"],"-moz-transition-duration":["-moz-transition"],"-moz-transition-property":["-moz-transition"],"-moz-transition-timing-function":["-moz-transition"],"-o-transition-delay":["-o-transition"],"-o-transition-duration":["-o-transition"],"-o-transition-property":["-o-transition"],"-o-transition-timing-function":["-o-transition"],"-webkit-transition-delay":["-webkit-transition"],"-webkit-transition-duration":["-webkit-transition"],"-webkit-transition-property":["-webkit-transition"],"-webkit-transition-timing-function":["-webkit-transition"]};t.exports=i},{"../stringifier/one-time":52,"./compactable":22,"./override-compactor":27,"./populate-components":28,"./remove-unused":29,"./restore-from-optimizing":30,"./shorthand-compactor":32,"./wrap-for-optimizing":35}],27:[function(e,t,n){function r(e){return function(t){return e.name===t.name}}function i(e,t){for(var n=0;n<e.components.length;n++){var r=e.components[n],i=E[r.name],o=i&&i.canOverride||o.sameValue,s=C(r);if(s.value=[[i.defaultValue]],!o(s,r,t))return!0}return!1}function o(e,t){return E[e.name].components.indexOf(t.name)>-1}function s(e,t){t.unused=!0,p(t,h(e)),e.value=t.value}function a(e,t){t.unused=!0,e.multiplex=!0,e.value=t.value}function u(e,t){t.unused=!0,e.value=t.value}function c(e,t){t.multiplex?a(e,t):e.multiplex?s(e,t):u(e,t)}function l(e,t){t.unused=!0;for(var n=0,r=e.components.length;n<r;n++)c(e.components[n],t.components[n],e.multiplex)}function p(e,t){e.multiplex=!0;for(var n=0,r=e.components.length;n<r;n++){var i=e.components[n];if(!i.multiplex)for(var o=i.value.slice(0),s=1;s<t;s++)i.value.push([B]),Array.prototype.push.apply(i.value,o)}}function h(e){for(var t=0,n=0,r=e.value.length;n<r;n++)e.value[n][0]==B&&t++;return t+1}function f(e){var t=[[e.name]].concat(e.value);return D([t],0).length}function d(e,t,n){for(var r=0,i=t;i>=0&&(e[i].name!=n||e[i].unused||r++,!(r>1));i--);return r>1}function m(e,t){for(var n=0,r=e.components.length;n<r;n++)if(g(t.isValidFunction,e.components[n]))return!0;return!1}function g(e,t){for(var n=0,r=t.value.length;n<r;n++)if(t.value[n][0]!=B&&e(t.value[n][0]))return!0;return!1}function v(e,t){if(!e.multiplex&&!t.multiplex||e.multiplex&&t.multiplex)return!1;var n,i=e.multiplex?e:t,o=e.multiplex?t:e,u=A(i);T([u]);var c=A(o);T([c]);var l=f(u)+1+f(c);return e.multiplex?(n=u.components.filter(r(c))[0],s(n,c)):(n=c.components.filter(r(u))[0],p(c,h(u)),a(n,u)),T([c]),l<f(c)}function y(e){return e.name in E}function b(e,t){return!e.multiplex&&("background"==e.name||"background-image"==e.name)&&t.multiplex&&("background"==t.name||"background-image"==t.name)&&_(t.value)}function _(e){for(var t=x(e),n=0,r=t.length;n<r;n++)if(1==t[n].length&&"none"==t[n][0][0])return!0;return!1}function x(e){for(var t=[],n=0,r=[],i=e.length;n<i;n++){var o=e[n];o[0]==B?(t.push(r),r=[]):r.push(o)}return t.push(r),t}function w(e,t,n){var s,a,u,f,_,x,w;e:for(_=e.length-1;_>=0;_--)if(a=e[_],y(a)&&!a.variable)for(s=E[a.name].canOverride||k.sameValue,x=_-1;x>=0;x--)if(u=e[x],y(u)&&!(u.variable||u.unused||a.unused||u.hack&&!a.hack||!u.hack&&a.hack||S(a)||b(u,a)))if(!u.shorthand&&a.shorthand&&o(a,u)){if(!a.important&&u.important)continue;if(!F([u],a.components))continue;if(!g(n.isValidFunction,u)&&m(a,n))continue;f=a.components.filter(r(u))[0],s=E[u.name]&&E[u.name].canOverride||k.sameValue,O(s,u,f,n)&&(u.unused=!0)}else if(u.shorthand&&!a.shorthand&&o(u,a)){if(a.important&&!u.important)continue;if(!a.important&&u.important){a.unused=!0;continue}if(d(e,_-1,u.name))continue;if(m(u,n))continue;if(f=u.components.filter(r(a))[0],O(s,f,a,n)){var A=!t.properties.backgroundClipMerging&&f.name.indexOf("background-clip")>-1||!t.properties.backgroundOriginMerging&&f.name.indexOf("background-origin")>-1||!t.properties.backgroundSizeMerging&&f.name.indexOf("background-size")>-1,C=E[a.name].nonMergeableValue===a.value[0][0];if(A||C)continue;if(!t.properties.merging&&i(u,n))continue;if(f.value[0][0]!=a.value[0][0]&&(S(u)||S(a)))continue;if(v(u,a))continue;!u.multiplex&&a.multiplex&&p(u,h(a)),c(f,a),u.dirty=!0}}else if(u.shorthand&&a.shorthand&&u.name==a.name){if(!u.multiplex&&a.multiplex)continue;if(!a.important&&u.important){a.unused=!0;continue e}if(a.important&&!u.important){u.unused=!0;continue}for(w=u.components.length-1;w>=0;w--){var T=u.components[w],D=a.components[w];if(s=E[T.name].canOverride||k.sameValue,!O(s,T,D,n))continue e;if(!O(k.twoOptionalFunctions,T,D,n)&&n.isValidFunction(D))continue e}l(u,a),u.dirty=!0}else if(u.shorthand&&a.shorthand&&o(u,a)){if(!u.important&&a.important)continue;if(f=u.components.filter(r(a))[0],s=E[a.name].canOverride||k.sameValue,!O(s,f,a,n))continue;if(u.important&&!a.important){a.unused=!0;continue}var B=E[a.name].restore(a,E);if(B.length>1)continue;f=u.components.filter(r(a))[0],c(f,a),a.dirty=!0}else if(u.name==a.name){if(u.important&&!a.important){a.unused=!0;continue}if(s=E[a.name].canOverride||k.sameValue,!O(s,u,a,n))continue;u.unused=!0}}var k=e("./can-override"),E=e("./compactable"),A=e("./clone").deep,C=e("./clone").shallow,S=e("./has-inherit"),T=e("./restore-from-optimizing"),O=e("./every-combination"),F=e("./vendor-prefixes").same,D=e("../stringifier/one-time").property,B=",";t.exports=w},{"../stringifier/one-time":52,"./can-override":20,"./clone":21,"./compactable":22,"./every-combination":23,"./has-inherit":24,"./restore-from-optimizing":30,"./vendor-prefixes":34}],28:[function(e,t,n){function r(e,t,n){for(var r=e.length-1;r>=0;r--){var s=e[r],a=i[s.name];if(a&&a.shorthand){s.shorthand=!0,s.dirty=!0;try{s.components=a.breakUp(s,i,t)}catch(e){if(!(e instanceof o))throw e;s.components=[],n.push(e.message)}s.components.length>0?s.multiplex=s.components[0].multiplex:s.unused=!0}}}var i=e("./compactable"),o=e("./invalid-property-error");t.exports=r},{"./compactable":22,"./invalid-property-error":25}],29:[function(e,t,n){function r(e){for(var t=e.length-1;t>=0;t--){var n=e[t];n.unused&&n.all.splice(n.position,1)}}t.exports=r},{}],30:[function(e,t,n){function r(e){e.value[e.value.length-1][0]+=u}function i(e){"underscore"==e.hack?e.name=l+e.name:"star"==e.hack?e.name=c+e.name:"backslash"==e.hack?e.value[e.value.length-1][0]+=a:"bang"==e.hack&&(e.value[e.value.length-1][0]+=" "+p)}function o(e,t){for(var n=e.length-1;n>=0;n--){var o,a=e[n],u=s[a.name];if(!a.unused&&((a.dirty||a.important||a.hack)&&(!t&&u&&u.shorthand?(o=u.restore(a,s),a.value=o):o=a.value,a.important&&r(a),a.hack&&i(a),"all"in a))){var c=a.all[a.position];c[0][0]=a.name,c.splice(1,c.length-1),Array.prototype.push.apply(c,o)}}}var s=e("./compactable"),a="\\9",u="!important",c="*",l="_",p="!ie";t.exports=o},{"./compactable":22}],31:[function(e,t,n){function r(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if("inherit"!=r&&r!=l&&r!=p)return!1}return!0}function i(e,t,n){function i(e){Array.prototype.unshift.apply(c,e.value)}function o(e){var n=t[e.name];return n.doubleValues?1==n.defaultValue.length?e.value[0][0]==n.defaultValue[0]&&(!e.value[1]||e.value[1][0]==n.defaultValue[0]):e.value[0][0]==n.defaultValue[0]&&(e.value[1]?e.value[1][0]:e.value[0][0])==n.defaultValue[1]:e.value[0][0]==n.defaultValue}for(var s,a,u=e.components,c=[],l=u.length-1;l>=0;l--){var h=u[l],f=o(h);if("background-clip"==h.name){var d=u[l-1],m=o(d);s=h.value[0][0]==d.value[0][0],a=!s&&(m&&!f||!m&&!f||!m&&f&&h.value[0][0]!=d.value[0][0]),s?i(d):a&&(i(h),i(d)),l--}else if("background-size"==h.name){var g=u[l-1],v=o(g);s=!v&&f,a=!s&&(v&&!f||!v&&!f),s?i(g):a?(i(h),c.unshift([p]),i(g)):1==g.value.length&&i(g),l--}else{if(f||t[h.name].multiplexLastOnly&&!n)continue;i(h)}}return 0===c.length&&1==e.value.length&&"0"==e.value[0][0]&&c.push(e.value[0]),0===c.length&&c.push([t[e.name].defaultValue]),r(c)?[c[0]]:c}function o(e,t){if(e.multiplex){for(var n=c(e),r=c(e),i=0;i<4;i++){var o=e.components[i],a=c(e);a.value=[o.value[0]],n.components.push(a);var u=c(e);u.value=[o.value[1]||o.value[0]],r.components.push(u)}var l=s(n),p=s(r);return l.length!=p.length||l[0][0]!=p[0][0]||l.length>1&&l[1][0]!=p[1][0]||l.length>2&&l[2][0]!=p[2][0]||l.length>3&&l[3][0]!=p[3][0]?l.concat([["/"]]).concat(p):l}return s(e)}function s(e){var t=e.components,n=t[0].value[0],r=t[1].value[0],i=t[2].value[0],o=t[3].value[0];return n[0]==r[0]&&n[0]==i[0]&&n[0]==o[0]?[n]:n[0]==i[0]&&r[0]==o[0]?[n,r]:r[0]==o[0]?[n,r,i]:[n,r,i,o]}function a(e){return function(t,n){if(!t.multiplex)return e(t,n,!0);var r,i,o=0,s=[],a={};for(r=0,i=t.components[0].value.length;r<i;r++)t.components[0].value[r][0]==l&&o++;for(r=0;r<=o;r++){for(var u=c(t),p=0,h=t.components.length;p<h;p++){var f=t.components[p],d=c(f);u.components.push(d);for(var m=a[d.name]||0,g=f.value.length;m<g;m++){if(f.value[m][0]==l){a[d.name]=m+1;break}d.value.push(f.value[m])}}var v=r==o,y=e(u,n,v);Array.prototype.push.apply(s,y),r<o&&s.push([","])}return s}}function u(e,t){for(var n=e.components,i=[],o=n.length-1;o>=0;o--){var s=n[o],a=t[s.name];s.value[0][0]!=a.defaultValue&&i.unshift(s.value[0])}return 0===i.length&&i.push([t[e.name].defaultValue]),r(i)?[i[0]]:i}var c=e("./clone").shallow,l=",",p="/";t.exports={background:i,borderRadius:o,fourValues:s,multiplex:a,withoutDefaults:u}},{"./clone":21}],32:[function(e,t,n){function r(e){var t;for(var n in e){if(void 0!==t&&e[n].important!=t)return!0;t=e[n].important}return!1}function i(e){var t=[];for(var n in e){var r=e[n],i=r.all[r.position],o=i[0][i[0].length-1];Array.isArray(o)&&Array.prototype.push.apply(t,o)}return t}function o(e,t,n,r,o){var s,a=u[n],d=[[n],[a.defaultValue]],m=h(d);m.shorthand=!0,m.dirty=!0,p([m],o,[]);for(var g=0,v=a.components.length;g<v;g++){var y=t[a.components[g]],b=u[y.name].canOverride;if(l(y))return;if(!f(b,m.components[g],y,o))return;m.components[g]=c(y),m.important=y.important,s=y.all}for(var _ in t)t[_].unused=!0;if(r){var x=i(t);x.length>0&&d[0].push(x)}m.position=s.length,m.all=s,m.all.push(d),e.push(m)}function s(e,t,n,i,s){var a=e[t];for(var c in n)if(void 0===a||c!=a.name){var l=u[c],p=n[c];l.components.length>Object.keys(p).length?delete n[c]:r(p)||o(e,p,c,i,s)}}function a(e,t,n){var r={};if(!(e.length<3)){for(var i=0,o=e.length;i<o;i++){var a=e[i];if(!a.unused&&(!a.hack&&!a.variable)){var c=u[a.name];if(c&&c.componentOf)if(a.shorthand)s(e,i,r,t,n);else{var l=c.componentOf;r[l]=r[l]||{},r[l][a.name]=a}}}s(e,i,r,t,n)}}var u=e("./compactable"),c=e("./clone").deep,l=e("./has-inherit"),p=e("./populate-components"),h=e("./wrap-for-optimizing").single,f=e("./every-combination");t.exports=a},{"./clone":21,"./compactable":22,"./every-combination":23,"./has-inherit":24,"./populate-components":28,"./wrap-for-optimizing":35}],33:[function(e,t,n){function r(e){var t=s.slice(0).filter(function(t){return!(t in e.units)||!0===e.units[t]}),n="(\\-?\\.?\\d+\\.?\\d*("+t.join("|")+"|)|auto|inherit)";this.compatibleCssUnitRegex=new RegExp("^"+n+"$","i"),this.compatibleCssUnitAnyRegex=new RegExp("^(none|"+o.join("|")+"|"+n+"|"+l+"|"+u+"|"+c+")$","i"),this.colorOpacity=e.colors.opacity}var i=e("../utils/split"),o=["thin","thick","medium","inherit","initial"],s=["px","%","em","in","cm","mm","ex","pt","pc","ch","rem","vh","vm","vmin","vmax","vw"],a="(\\-?\\.?\\d+\\.?\\d*("+s.join("|")+"|)|auto|inherit)",u="[A-Z]+(\\-|[A-Z]|[0-9])+\\(.*?\\)",c="\\-(\\-|[A-Z]|[0-9])+\\(.*?\\)",l="var\\(\\-\\-[^\\)]+\\)",p="("+l+"|"+u+"|"+c+")",h="("+a+"|(\\-moz\\-|\\-webkit\\-)?calc\\([^\\)]+\\))",f="(none|"+o.join("|")+"|"+a+"|"+l+"|"+u+"|"+c+")",d=new RegExp("^"+u+"$","i"),m=new RegExp("^"+c+"$","i"),g=new RegExp("^"+l+"$","i"),v=new RegExp("^"+p+"$","i"),y=new RegExp("^"+a+"$","i"),b=new RegExp("^"+h+"$","i"),_=new RegExp("^"+f+"$","i"),x=["repeat","no-repeat","repeat-x","repeat-y","inherit"],w=["inherit","scroll","fixed","local"],k=["center","top","bottom","left","right"],E=["contain","cover"],A=["border-box","content-box","padding-box"],C=["auto","inherit","hidden","none","dotted","dashed","solid","double","groove","ridge","inset","outset"],S=["armenian","circle","cjk-ideographic","decimal","decimal-leading-zero","disc","georgian","hebrew","hiragana","hiragana-iroha","inherit","katakana","katakana-iroha","lower-alpha","lower-greek","lower-latin","lower-roman","none","square","upper-alpha","upper-latin","upper-roman"],T=["inside","outside","inherit"];r.prototype.isValidHexColor=function(e){return(4===e.length||7===e.length)&&"#"===e[0]},r.prototype.isValidRgbaColor=function(e){return e=e.split(" ").join(""),e.length>0&&0===e.indexOf("rgba(")&&e.indexOf(")")===e.length-1},r.prototype.isValidHslaColor=function(e){return e=e.split(" ").join(""),e.length>0&&0===e.indexOf("hsla(")&&e.indexOf(")")===e.length-1},r.prototype.isValidNamedColor=function(e){return"auto"!==e&&("transparent"===e||"inherit"===e||/^[a-zA-Z]+$/.test(e))},r.prototype.isValidVariable=function(e){return g.test(e)},r.prototype.isValidColor=function(e){return this.isValidNamedColor(e)||this.isValidColorValue(e)||this.isValidVariable(e)||this.isValidVendorPrefixedValue(e)},r.prototype.isValidColorValue=function(e){return this.isValidHexColor(e)||this.isValidRgbaColor(e)||this.isValidHslaColor(e)},r.prototype.isValidUrl=function(e){return 0===e.indexOf("__ESCAPED_URL_CLEAN_CSS")},r.prototype.isValidUnit=function(e){return _.test(e)},r.prototype.isValidUnitWithoutFunction=function(e){return y.test(e)},r.prototype.isValidAndCompatibleUnit=function(e){return this.compatibleCssUnitAnyRegex.test(e)},r.prototype.isValidAndCompatibleUnitWithoutFunction=function(e){return this.compatibleCssUnitRegex.test(e)},r.prototype.isValidFunctionWithoutVendorPrefix=function(e){return d.test(e)},r.prototype.isValidFunctionWithVendorPrefix=function(e){return m.test(e)},r.prototype.isValidFunction=function(e){return v.test(e)},r.prototype.isValidBackgroundRepeat=function(e){return x.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidBackgroundAttachment=function(e){return w.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidBackgroundBox=function(e){return A.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidBackgroundPositionPart=function(e){return k.indexOf(e)>=0||b.test(e)||this.isValidVariable(e)},r.prototype.isValidBackgroundPosition=function(e){if("inherit"===e)return!0;for(var t=e.split(" "),n=0,r=t.length;n<r;n++)if(""!==t[n]&&!this.isValidBackgroundPositionPart(t[n])&&!this.isValidVariable(t[n]))return!1;return!0},r.prototype.isValidBackgroundSizePart=function(e){return E.indexOf(e)>=0||y.test(e)||this.isValidVariable(e)},r.prototype.isValidBackgroundPositionAndSize=function(e){if(e.indexOf("/")<0)return!1;var t=i(e,"/");return this.isValidBackgroundSizePart(t.pop())&&this.isValidBackgroundPositionPart(t.pop())},r.prototype.isValidListStyleType=function(e){return S.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidListStylePosition=function(e){return T.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidStyle=function(e){return this.isValidStyleKeyword(e)||this.isValidVariable(e)},r.prototype.isValidStyleKeyword=function(e){return C.indexOf(e)>=0},r.prototype.isValidWidth=function(e){return this.isValidUnit(e)||this.isValidWidthKeyword(e)||this.isValidVariable(e)},r.prototype.isValidWidthKeyword=function(e){return o.indexOf(e)>=0},r.prototype.isValidVendorPrefixedValue=function(e){return/^-([A-Za-z0-9]|-)*$/gi.test(e)},r.prototype.areSameFunction=function(e,t){return!(!this.isValidFunction(e)||!this.isValidFunction(t))&&e.substring(0,e.indexOf("("))===t.substring(0,t.indexOf("("))},t.exports=r},{"../utils/split":73}],34:[function(e,t,n){function r(e){for(var t=[],n=0,r=e.length;n<r;n++)for(var i=e[n],s=0,a=i.value.length;s<a;s++){var u=o.exec(i.value[s][0]);u&&-1==t.indexOf(u[0])&&t.push(u[0])}return t}function i(e,t){return r(e).sort().join(",")==r(t).sort().join(",")}var o=/$\-moz\-|\-ms\-|\-o\-|\-webkit\-/;t.exports={same:i}},{}],35:[function(e,t,n){function r(e){for(var t=[],n=e.length-1;n>=0;n--)if("string"!=typeof e[n][0]){var r=l(e[n]);r.all=e,r.position=n,t.unshift(r)}return t}function i(e){for(var t=1,n=e.length;t<n;t++)if(","==e[t][0]||"/"==e[t][0])return!0;return!1}function o(e){var t=!1,n=e[0][0],r=e[e.length-1];return n[0]==m?t="underscore":n[0]==d?t="star":r[0][0]!=g||r[0].match(h)?r[0].indexOf(g)>0&&!r[0].match(h)?t="bang":r[0].indexOf(p)>0&&r[0].indexOf(p)==r[0].length-p.length-1?t="backslash":0===r[0].indexOf(p)&&2==r[0].length&&(t="backslash"):t="bang",t}function s(e){if(e.length>1){var t=e[e.length-1][0];if("string"==typeof t)return f.test(t)}return!1}function a(e){e.length>0&&(e[e.length-1][0]=e[e.length-1][0].replace(f,""))}function u(e){e[0][0]=e[0][0].substring(1)}function c(e,t){var n=e[e.length-1];n[0]=n[0].substring(0,n[0].indexOf("backslash"==t?p:g)).trim(),0===n[0].length&&e.pop()}function l(e){var t=s(e);t&&a(e);var n=o(e);"star"==n||"underscore"==n?u(e):"backslash"!=n&&"bang"!=n||c(e,n);var r=0===e[0][0].indexOf("--");return{block:r&&e[1]&&Array.isArray(e[1][0][0]),components:[],dirty:!1,hack:n,important:t,name:e[0][0],multiplex:e.length>2&&i(e),position:0,shorthand:!1,unused:e.length<2,value:e.slice(1),variable:r}}var p="\\",h=new RegExp("important$","i"),f=new RegExp("!important$","i"),d="*",m="_",g="!";t.exports={all:r,single:l}},{}],36:[function(e,t,n){function r(e){for(var t=0,n=e.length;t<n;t++){var i=e[t],o=!1;switch(i[0]){case"selector":o=0===i[1].length||0===i[2].length;break;case"block":r(i[2]),o=0===i[2].length}o&&(e.splice(t,1),t--,n--)}}function i(e,t,n){for(var r=0,i=e.length;r<i;r++){var o=e[r];if("block"==o[0]){var a=/@(-moz-|-o-|-webkit-)?keyframes/.test(o[1][0]);s(o[2],t,n,!a)}}}function o(e,t,n){for(var r=0,i=e.length;r<i;r++){var s=e[r];switch(s[0]){case"selector":a(s[1],s[2],!1,!0,t,n);break;case"block":o(s[2],t,n)}}}function s(e,t,n,a){if(i(e,t,n),o(e,t,n),u(e),c(e,t,n),l(e,t,n),p(e,t,n),h(e,t),t.restructuring&&a&&(f(e,t),c(e,t,n)),t.mediaMerging){d(e);for(var g=m(e),v=g.length-1;v>=0;v--)s(g[v][2],t,n,!1)}r(e)}var a=e("../properties/optimizer"),u=e("./remove-duplicates"),c=e("./merge-adjacent"),l=e("./reduce-non-adjacent"),p=e("./merge-non-adjacent-by-selector"),h=e("./merge-non-adjacent-by-body"),f=e("./restructure"),d=e("./remove-duplicate-media-queries"),m=e("./merge-media-queries");t.exports=s},{"../properties/optimizer":26,"./merge-adjacent":40,"./merge-media-queries":41,"./merge-non-adjacent-by-body":42,"./merge-non-adjacent-by-selector":43,"./reduce-non-adjacent":44,"./remove-duplicate-media-queries":45,"./remove-duplicates":46,"./restructure":48}],37:[function(e,t,n){function r(e,t){return"["+t.replace(/ /g,"")+"]"}function i(e,t){return e[0]>t[0]?1:-1}function o(e,t,n,r){return t&&n&&r.length?t+n+" ":t&&n?t+n:n}var s={selectors:function(e,t,n){for(var s=[],a=[],u=0,c=e.length;u<c;u++){var l=e[u],p=l[0].replace(/\s+/g," ").replace(/ ?, ?/g,",").replace(/\s*(\\)?([>+~])(\s*)/g,o).trim();n&&p.indexOf("nav")>0&&(p=p.replace(/\+nav(\S|$)/,"+ nav$1")),(!t||-1==p.indexOf("*+html ")&&-1==p.indexOf("*:first-child+html "))&&(p.indexOf("*")>-1&&(p=p.replace(/\*([:#\.\[])/g,"$1").replace(/^(\:first\-child)?\+html/,"*$1+html")),p.indexOf("[")>-1&&(p=p.replace(/\[([^\]]+)\]/g,r)),-1==a.indexOf(p)&&(l[0]=p,a.push(p),s.push(l)))}return s.sort(i)},selectorDuplicates:function(e){for(var t=[],n=[],r=0,o=e.length;r<o;r++){var s=e[r];-1==n.indexOf(s[0])&&(n.push(s[0]),t.push(s))}return t.sort(i)},block:function(e,t){e[0]=e[0].replace(/\s+/g," ").replace(/(,|:|\() /g,"$1").replace(/ \)/g,")"),t||(e[0]=e[0].replace(/\) /g,")"))},atRule:function(e){e[0]=e[0].replace(/\s+/g," ").trim()}};t.exports=s},{}],38:[function(e,t,n){function r(e){var t=[];if("selector"==e[0])for(var n=!/[\.\+>~]/.test(o(e[1])),u=0,c=e[2].length;u<c;u++){var l=e[2][u];if(0!==l.indexOf("__ESCAPED")&&l[0]!=a){var p=e[2][u][0][0];if(0!==p.length&&0!==p.indexOf("--")){var h=s(e[2],u);t.push([p,h,i(p),e[2][u],p+":"+h,e[1],n])}}}else if("block"==e[0])for(var f=0,d=e[2].length;f<d;f++)t=t.concat(r(e[2][f]));return t}function i(e){return"list-style"==e?e:e.indexOf("-radius")>0?"border-radius":"border-collapse"==e||"border-spacing"==e||"border-image"==e?e:0===e.indexOf("border-")&&/^border\-\w+\-\w+$/.test(e)?e.match(/border\-\w+/)[0]:0===e.indexOf("border-")&&/^border\-\w+$/.test(e)?"border":0===e.indexOf("text-")?e:e.replace(/^\-\w+\-/,"").match(/([a-zA-Z]+)/)[0].toLowerCase()}var o=e("../stringifier/one-time").selectors,s=e("../stringifier/one-time").value,a="at-rule";t.exports=r},{"../stringifier/one-time":52}],39:[function(e,t,n){function r(e,t){return e.compatibility.selectors.special.test(t)}t.exports=r},{}],40:[function(e,t,n){function r(e,t,n){for(var r=[null,[],[]],c=t.compatibility.selectors.adjacentSpace,l=0,p=e.length;l<p;l++){var h=e[l];if("selector"==h[0])if("selector"==r[0]&&s(h[1])==s(r[1])){var f=[r[2].length];Array.prototype.push.apply(r[2],h[2]),i(h[1],r[2],f,!0,t,n),h[2]=[]}else"selector"!=r[0]||o(h[2])!=o(r[2])||u(t,s(h[1]))||u(t,s(r[1]))?r=h:(r[1]=a(r[1].concat(h[1]),!1,c),h[2]=[]);else r=[null,[],[]]}}var i=e("../properties/optimizer"),o=e("../stringifier/one-time").body,s=e("../stringifier/one-time").selectors,a=e("./clean-up").selectors,u=e("./is-special");t.exports=r},{"../properties/optimizer":26,"../stringifier/one-time":52,"./clean-up":37,"./is-special":39}],41:[function(e,t,n){function r(e){for(var t={},n=[],r=e.length-1;r>=0;r--){var s=e[r];if("block"==s[0]){var a=t[s[1][0]];a||(a=[],t[s[1][0]]=a),a.push(r)}}for(var u in t){var c=t[u];e:for(var l=c.length-1;l>0;l--){var p=c[l],h=e[p],f=c[l-1],d=e[f];t:for(var m=1;m>=-1;m-=2){for(var g=1==m,v=g?p+1:f-1,y=g?f:p,b=g?1:-1,_=g?h:d,x=g?d:h,w=o(_);v!=y;){var k=o(e[v]);if(v+=b,!i(w,k))continue t}x[2]=g?_[2].concat(x[2]):x[2].concat(_[2]),_[2]=[],n.push(x);continue e}}}return n}var i=e("./reorderable").canReorder,o=e("./extractor");t.exports=r},{"./extractor":38,"./reorderable":47}],42:[function(e,t,n){function r(e){return/\.|\*| :/.test(e)}function i(e){var t=c(e[1]);return t.indexOf("__")>-1||t.indexOf("--")>-1}function o(e){return e.replace(/--[^ ,>\+~:]+/g,"")}function s(e,t){var n=o(c(e[1]));for(var r in t){var i=t[r],s=o(c(i[1]));(s.indexOf(n)>-1||n.indexOf(s)>-1)&&delete t[r]}}function a(e,t){for(var n={},o=t.compatibility.selectors.adjacentSpace,a=e.length-1;a>=0;a--){var h=e[a];if("selector"==h[0]){h[2].length>0&&!t.semanticMerging&&r(c(h[1]))&&(n={}),h[2].length>0&&t.semanticMerging&&i(h)&&s(h,n);var f=u(h[2]),d=n[f];!d||p(t,c(h[1]))||p(t,c(d[1]))||(h[1]=h[2].length>0?l(d[1].concat(h[1]),!1,o):d[1].concat(h[1]),d[2]=[],n[f]=null),n[u(h[2])]=h}}}var u=e("../stringifier/one-time").body,c=e("../stringifier/one-time").selectors,l=e("./clean-up").selectors,p=e("./is-special");t.exports=a},{"../stringifier/one-time":52,"./clean-up":37,"./is-special":39}],43:[function(e,t,n){function r(e,t,n){var r,u={},c=[];for(r=e.length-1;r>=0;r--)if("selector"==e[r][0]&&0!==e[r][2].length){var l=o(e[r][1]);u[l]=[r].concat(u[l]||[]),2==u[l].length&&c.push(l)}for(r=c.length-1;r>=0;r--){var p=u[c[r]];e:for(var h=p.length-1;h>0;h--){var f=p[h-1],d=e[f],m=p[h],g=e[m];t:for(var v=1;v>=-1;v-=2){for(var y,b=1==v,_=b?f+1:m-1,x=b?m:f,w=b?1:-1,k=b?d:g,E=b?g:d,A=s(k);_!=x;){var C=s(e[_]);_+=w;var S=b?a(A,C):a(C,A);if(!S&&!b)continue e;if(!S&&b)continue t}b?(y=[k[2].length],Array.prototype.push.apply(k[2],E[2]),E[2]=k[2]):(y=[E[2].length],Array.prototype.push.apply(E[2],k[2])),i(E[1],E[2],y,!0,t,n),k[2]=[]}}}}var i=e("../properties/optimizer"),o=e("../stringifier/one-time").selectors,s=e("./extractor"),a=e("./reorderable").canReorder;t.exports=r},{"../properties/optimizer":26,"../stringifier/one-time":52,"./extractor":38,"./reorderable":47}],44:[function(e,t,n){function r(e,t,n){for(var r={},a=[],u=e.length-1;u>=0;u--){var c=e[u];if("selector"==c[0]&&0!==c[2].length)for(var h=l(c[1]),f=c[1].length>1&&!p(t,h),d=t.sourceMap?i(c[1]):c[1],m=f?[h].concat(d):[h],g=0,v=m.length;g<v;g++){var y=m[g];r[y]?a.push(y):r[y]=[],r[y].push({where:u,list:d,isPartial:f&&g>0,isComplex:f&&0===g})}}o(e,a,r,t,n),s(e,r,t,n)}function i(e){for(var t=[],n=0;n<e.length;n++)t.push([e[n][0]]);return t}function o(e,t,n,r,i){function o(e,t){return p[e].isPartial&&0===t.length}function s(e,t,n,r){p[n-r-1].isPartial||(e[2]=t)}for(var u=0,c=t.length;u<c;u++){var l=t[u],p=n[l];a(e,l,p,{filterOut:o,callback:s},r,i)}}function s(e,t,n,r){function i(e){return s.data[e].where<s.intoPosition}function o(e,t,n,r){0===r&&s.reducedBodies.push(t)}var s={}
;e:for(var u in t){var l=t[u];if(l[0].isComplex){var h=l[l.length-1].where,f=e[h],d=[],m=p(n,u)?[u]:l[0].list;s.intoPosition=h,s.reducedBodies=d;for(var g=0,v=m.length;g<v;g++){var y=m[g],b=t[y];if(b.length<2)continue e;if(s.data=b,a(e,y,b,{filterOut:i,callback:o},n,r),c(d[d.length-1])!=c(d[0]))continue e}f[2]=d[0]}}}function a(e,t,n,r,i,o){for(var s=[],a=[],c=[],l=[],p=n.length-1,f=0;p>=0;p--)if(!r.filterOut(p,s)){var d=n[p].where,m=e[d],g=h(m[2]);s=s.concat(g),a.push(g),l.push(d)}for(p=0,f=a.length;p<f;p++)a[p].length>0&&c.push((c.length>0?c[c.length-1]:0)+a[p].length);u(t,s,c,!1,i,o);for(var v=l.length,y=s.length-1,b=v-1;b>=0;)if((0===b||s[y]&&a[b].indexOf(s[y])>-1)&&y>-1)y--;else{var _=s.splice(y+1);r.callback(e[l[b]],_,v,b),b--}}var u=e("../properties/optimizer"),c=e("../stringifier/one-time").body,l=e("../stringifier/one-time").selectors,p=e("./is-special"),h=e("../utils/clone-array");t.exports=r},{"../properties/optimizer":26,"../stringifier/one-time":52,"../utils/clone-array":66,"./is-special":39}],45:[function(e,t,n){function r(e){for(var t={},n=0,r=e.length;n<r;n++){var o=e[n];if("block"==o[0]){var s=o[1][0]+"%"+i(o[2]),a=t[s];a&&(a[2]=[]),t[s]=o}}}var i=e("../stringifier/one-time").all;t.exports=r},{"../stringifier/one-time":52}],46:[function(e,t,n){function r(e){for(var t,n,r,s,a={},u=[],c=0,l=e.length;c<l;c++)n=e[c],"selector"==n[0]&&(t=o(n[1]),a[t]&&1==a[t].length?u.push(t):a[t]=a[t]||[],a[t].push(c));for(c=0,l=u.length;c<l;c++){t=u[c],s=[];for(var p=a[t].length-1;p>=0;p--)n=e[a[t][p]],r=i(n[2]),s.indexOf(r)>-1?n[2]=[]:s.push(r)}}var i=e("../stringifier/one-time").body,o=e("../stringifier/one-time").selectors;t.exports=r},{"../stringifier/one-time":52}],47:[function(e,t,n){function r(e,t){for(var n=t.length-1;n>=0;n--)for(var r=e.length-1;r>=0;r--)if(!i(e[r],t[n]))return!1;return!0}function i(e,t){var n=e[0],r=e[1],i=e[2],m=e[5],g=e[6],v=t[0],y=t[1],b=t[2],_=t[5],x=t[6];return!("font"==n&&"line-height"==v||"font"==v&&"line-height"==n)&&((!f.test(n)||!f.test(v))&&(!(i==b&&s(n)==s(v)&&o(n)^o(v))&&(("border"!=i||!d.test(b)||!("border"==n||n==b||r!=y&&a(n,v)))&&(("border"!=b||!d.test(i)||!("border"==v||v==i||r!=y&&a(n,v)))&&(("border"!=i||"border"!=b||n==v||!(u(n)&&c(v)||c(n)&&u(v)))&&(i!=b||(!(n!=v||i!=b||r!=y&&!l(r,y))||(n!=v&&i==b&&n!=i&&v!=b||(n!=v&&i==b&&r==y||!(!x||!g||h(i)||h(b)||!p(_,m)))))))))))}function o(e){return/^\-(?:moz|webkit|ms|o)\-/.test(e)}function s(e){return e.replace(/^\-(?:moz|webkit|ms|o)\-/,"")}function a(e,t){return e.split("-").pop()==t.split("-").pop()}function u(e){return"border-top"==e||"border-right"==e||"border-bottom"==e||"border-left"==e}function c(e){return"border-color"==e||"border-style"==e||"border-width"==e}function l(e,t){return o(e)&&o(t)&&e.split("-")[1]!=t.split("-")[2]}function p(e,t){for(var n=0,r=e.length;n<r;n++)for(var i=0,o=t.length;i<o;i++)if(e[n][0]==t[i][0])return!1;return!0}function h(e){return"font"==e||"line-height"==e||"list-style"==e}var f=/align\-items|box\-align|box\-pack|flex|justify/,d=/^border\-(top|right|bottom|left|color|style|width|radius)/;t.exports={canReorder:r,canReorderSingle:i}},{}],48:[function(e,t,n){function r(e,t){return e>t}function i(e,t){var n=h(e);return n[5]=n[5].concat(t[5]),n}function o(e,t){function n(e,t,n){for(var r=n.length-1;r>=0;r--){var i=n[r][0],s=o(t,i);if(C[s].length>1&&k(e,C[s])){h(s);break}}}function o(e,t){var n=f(t);return C[n]=C[n]||[],C[n].push([e,t]),n}function h(e){var t,n=e.split(O),r=[];for(var i in C){var o=i.split(O);for(t=o.length-1;t>=0;t--)if(n.indexOf(o[t])>-1){r.push(i);break}}for(t=r.length-1;t>=0;t--)delete C[r[t]]}function f(e){for(var t=[],n=0,r=e.length;n<r;n++)t.push(c(e[n][1]));return t.join(O)}function d(e){for(var n=[],r=[],i=e.length-1;i>=0;i--)p(t,c(e[i][1]))||(r.unshift(e[i]),e[i][2].length>0&&-1==n.indexOf(e[i])&&n.push(e[i]));return n.length>1?r:[]}function m(e,t){var r=t[0],i=t[1],o=t[4],s=r.length+i.length+1,a=[],u=[],c=d(E[o]);if(!(c.length<2)){var p=v(c,s,1),h=p[0];if(h[1]>0)return n(e,t,p);for(var f=h[0].length-1;f>=0;f--)a=h[0][f][1].concat(a),u.unshift(h[0][f]);a=l(a),_(e,[t],a,u)}}function g(e,t){return e[1]>t[1]}function v(e,t,n){return y(e,t,n,T-1).sort(g)}function y(e,t,n,r){var i=[[e,b(e,t,n)]];if(e.length>2&&r>0)for(var o=e.length-1;o>=0;o--){var s=Array.prototype.slice.call(e,0);s.splice(o,1),i=i.concat(y(s,t,n,r-1))}return i}function b(e,t,n){for(var r=0,i=e.length-1;i>=0;i--)r+=e[i][2].length>n?c(e[i][1]).length:-1;return r-(e.length-1)*t+1}function _(t,n,r,i){var o,s,a,c,l=[];for(o=i.length-1;o>=0;o--){var p=i[o];for(s=p[2].length-1;s>=0;s--){var h=p[2][s];for(a=0,c=n.length;a<c;a++){var f=n[a],d=h[0][0],m=f[0],g=f[4];if(d==m&&u([h])==g){p[2].splice(s,1);break}}}}for(o=n.length-1;o>=0;o--)l.unshift(n[o][3]);var v=["selector",r,l];e.splice(t,0,v)}function x(e,t){var n=t[4],r=E[n];r&&r.length>1&&(w(e,t)||m(e,t))}function w(e,t){var n,r,i=[],o=[],s=t[4],a=d(E[s]);if(!(a.length<2)){e:for(var u in E){var c=E[u];for(n=a.length-1;n>=0;n--)if(-1==c.indexOf(a[n]))continue e;i.push(u)}if(i.length<2)return!1;for(n=i.length-1;n>=0;n--)for(r=A.length-1;r>=0;r--)if(A[r][4]==i[n]){o.unshift([A[r],a]);break}return k(e,o)}}function k(e,t){for(var n,r=0,i=[],o=t.length-1;o>=0;o--){n=t[o][0];r+=n[4].length+(o>0?1:0),i.push(n)}var s=t[0][1],a=v(s,r,i.length)[0];if(a[1]>0)return!1;var u=[],c=[];for(o=a[0].length-1;o>=0;o--)u=a[0][o][1].concat(u),c.unshift(a[0][o]);for(u=l(u),_(e,i,u,c),o=i.length-1;o>=0;o--){n=i[o];var p=A.indexOf(n);delete E[n[4]],p>-1&&-1==S.indexOf(p)&&S.push(p)}return!0}for(var E={},A=[],C={},S=[],T=2,O="%",F=e.length-1;F>=0;F--){var D,B,L,R,N,P=e[F];if("selector"==P[0])D=!0;else{if("block"!=P[0])continue;D=!1}var M=A.length,I=s(P);S=[];var j=[];for(B=I.length-1;B>=0;B--)for(L=B-1;L>=0;L--)if(!a(I[B],I[L])){j.push(B);break}for(B=I.length-1;B>=0;B--){var V=I[B],z=!1;for(L=0;L<M;L++){var U=A[L];-1!=S.indexOf(L)||a(V,U)||function(e,t,n){if(e[0]!=t[0])return!1;var r=t[4],i=E[r];return i&&i.indexOf(n)>-1}(V,U,P)||(x(F+1,U),-1==S.indexOf(L)&&(S.push(L),delete E[U[4]])),z||(z=V[0]==U[0]&&V[1]==U[1])&&(N=L)}if(D&&!(j.indexOf(B)>-1)){var $=V[4];E[$]=E[$]||[],E[$].push(P),z?A[N]=i(A[N],V):A.push(V)}}for(S=S.sort(r),B=0,R=S.length;B<R;B++){var q=S[B]-B;A.splice(q,1)}}for(var H=e[0]&&"at-rule"==e[0][0]&&0===e[0][1][0].indexOf("@charset")?1:0;H<e.length-1;H++){var W="at-rule"===e[H][0]&&0===e[H][1][0].indexOf("@import"),G="text"===e[H][0]&&0===e[H][1][0].indexOf("__ESCAPED_COMMENT_SPECIAL");if(!W&&!G)break}for(F=0;F<A.length;F++)x(H,A[F])}var s=e("./extractor"),a=e("./reorderable").canReorderSingle,u=e("../stringifier/one-time").body,c=e("../stringifier/one-time").selectors,l=e("./clean-up").selectorDuplicates,p=e("./is-special"),h=e("../utils/clone-array");t.exports=o},{"../stringifier/one-time":52,"../utils/clone-array":66,"./clean-up":37,"./extractor":38,"./is-special":39,"./reorderable":47}],49:[function(e,t,n){function r(e,t){return e.value[t]&&"-"==e.value[t][0][0]&&parseFloat(e.value[t][0])<0}function i(e,t){return-1==t.indexOf("0")?t:(t.indexOf("-")>-1&&(t=t.replace(/([^\w\d\-]|^)\-0([^\.]|$)/g,"$10$2").replace(/([^\w\d\-]|^)\-0([^\.]|$)/g,"$10$2")),t.replace(/(^|\s)0+([1-9])/g,"$1$2").replace(/(^|\D)\.0+(\D|$)/g,"$10$2").replace(/(^|\D)\.0+(\D|$)/g,"$10$2").replace(/\.([1-9]*)0+(\D|$)/g,function(e,t,n){return(t.length>0?".":"")+t+n}).replace(/(^|\D)0\.(\d)/g,"$1.$2"))}function o(e,t){return-1==t.indexOf("0deg")?t:t.replace(/\(0deg\)/g,"(0)")}function s(e,t){return e.indexOf("filter")>-1||-1==t.indexOf(" ")?t:(t=t.replace(/\s+/g," "),t.indexOf("calc")>-1&&(t=t.replace(/\) ?\/ ?/g,")/ ")),t.replace(/\( /g,"(").replace(/ \)/g,")").replace(/, /g,","))}function a(e,t,n){return-1===n.value||-1===t.indexOf(".")?t:t.replace(n.regexp,function(e,t){return Math.round(parseFloat(t)*n.multiplier)/n.multiplier+"px"}).replace(/(\d)\.($|\D)/g,"$1$2")}function u(e,t,n){return/^(?:\-moz\-calc|\-webkit\-calc|calc)\(/.test(t)?t:"flex"==e||"-ms-flex"==e||"-webkit-flex"==e||"flex-basis"==e||"-webkit-flex-basis"==e?t:t.indexOf("%")>0&&("height"==e||"max-height"==e)?t:t.replace(n,"$10$2").replace(n,"$10$2")}function c(e){var t,n=e.value;4==n.length&&"0"===n[0][0]&&"0"===n[1][0]&&"0"===n[2][0]&&"0"===n[3][0]&&(t=e.name.indexOf("box-shadow")>-1?2:1),t&&(e.value.splice(t),e.dirty=!0)}function l(e,t,n){return-1===t.indexOf("#")&&-1==t.indexOf("rgb")&&-1==t.indexOf("hsl")?S.shorten(t):(t=t.replace(/rgb\((\-?\d+),(\-?\d+),(\-?\d+)\)/g,function(e,t,n,r){return new A(t,n,r).toHex()}).replace(/hsl\((-?\d+),(-?\d+)%?,(-?\d+)%?\)/g,function(e,t,n,r){return new C(t,n,r).toHex()}).replace(/(^|[^='"])#([0-9a-f]{6})/gi,function(e,t,n){return n[0]==n[1]&&n[2]==n[3]&&n[4]==n[5]?t+"#"+n[0]+n[2]+n[4]:t+"#"+n}).replace(/(rgb|rgba|hsl|hsla)\(([^\)]+)\)/g,function(e,t,n){var r=n.split(",");return"hsl"==t&&3==r.length||"hsla"==t&&4==r.length||"rgb"==t&&3==r.length&&n.indexOf("%")>0||"rgba"==t&&4==r.length&&n.indexOf("%")>0?(-1==r[1].indexOf("%")&&(r[1]+="%"),-1==r[2].indexOf("%")&&(r[2]+="%"),t+"("+r.join(",")+")"):e}),n.colors.opacity&&-1==e.indexOf("background")&&(t=t.replace(/(?:rgba|hsla)\(0,0%?,0%?,0\)/g,function(e){return E(t,",").pop().indexOf("gradient(")>-1?e:"transparent"})),S.shorten(t))}function p(e,t,n){return I.test(t)?t.replace(I,function(e,t){var r,i=parseInt(t);return 0===i?e:(n.properties.shorterLengthUnits&&n.units.pt&&3*i%4==0&&(r=3*i/4+"pt"),n.properties.shorterLengthUnits&&n.units.pc&&i%16==0&&(r=i/16+"pc"),n.properties.shorterLengthUnits&&n.units.in&&i%96==0&&(r=i/96+"in"),r&&(r=e.substring(0,e.indexOf(t))+r),r&&r.length<e.length?r:e)}):t}function h(e,t){return j.test(t)?t.replace(j,function(e,t,n){var r;return"ms"==n?r=parseInt(t)/1e3+"s":"s"==n&&(r=1e3*parseFloat(t)+"ms"),r.length<e.length?r:e}):t}function f(e){var t,n=e.value;3==n.length&&"/"==n[1][0]&&n[0][0]==n[2][0]?t=1:5==n.length&&"/"==n[2][0]&&n[0][0]==n[3][0]&&n[1][0]==n[4][0]?t=2:7==n.length&&"/"==n[3][0]&&n[0][0]==n[4][0]&&n[1][0]==n[5][0]&&n[2][0]==n[6][0]?t=3:9==n.length&&"/"==n[4][0]&&n[0][0]==n[5][0]&&n[1][0]==n[6][0]&&n[2][0]==n[7][0]&&n[3][0]==n[8][0]&&(t=4),t&&(e.value.splice(t),e.dirty=!0)}function d(e){1==e.value.length&&(e.value[0][0]=e.value[0][0].replace(/progid:DXImageTransform\.Microsoft\.(Alpha|Chroma)(\W)/,function(e,t,n){return t.toLowerCase()+n})),e.value[0][0]=e.value[0][0].replace(/,(\S)/g,", $1").replace(/ ?= ?/g,"=")}function m(e){var t=e.value;if(!(N.indexOf(t[0][0])>-1||t[1]&&N.indexOf(t[1][0])>-1||t[2]&&N.indexOf(t[2][0])>-1)&&"/"!=t[1]){var n=0;if("normal"==t[0][0]&&n++,t[1]&&"normal"==t[1][0]&&n++,t[2]&&"normal"==t[2][0]&&n++,!(n>1)){var r;M.indexOf(t[0][0])>-1?r=0:t[1]&&M.indexOf(t[1][0])>-1?r=1:t[2]&&M.indexOf(t[2][0])>-1?r=2:P.indexOf(t[0][0])>-1?r=0:t[1]&&P.indexOf(t[1][0])>-1?r=1:t[2]&&P.indexOf(t[2][0])>-1&&(r=2),void 0!==r&&(e.value[r][0]=V["font-weight"](t[r][0]),e.dirty=!0)}}}function g(e,t){for(var n,v,y,b=T(e),_=0,x=b.length;_<x;_++)if(n=b[_],v=n.name,n.hack&&(("star"==n.hack||"underscore"==n.hack)&&!t.compatibility.properties.iePrefixHack||"backslash"==n.hack&&!t.compatibility.properties.ieSuffixHack||"bang"==n.hack&&!t.compatibility.properties.ieBangHack)&&(n.unused=!0),0===v.indexOf("padding")&&(r(n,0)||r(n,1)||r(n,2)||r(n,3))&&(n.unused=!0),!n.unused)if(n.variable)n.block&&g(n.value[0],t);else{for(var w=0,k=n.value.length;w<k;w++)y=n.value[w][0],V[v]&&(y=V[v](y,w,k)),y=s(v,y),y=a(v,y,t.precision),y=p(v,y,t.compatibility),y=h(v,y),y=i(v,y),t.compatibility.properties.zeroUnits&&(y=o(v,y),y=u(v,y,t.unitsRegexp)),t.compatibility.properties.colors&&(y=l(v,y,t.compatibility)),n.value[w][0]=y;c(n),0===v.indexOf("border")&&v.indexOf("radius")>0?f(n):"filter"==v?d(n):"font"==v&&m(n)}O(b,!0),F(b)}function v(e){for(var t=!1,n=0,r=e.length;n<r;n++){var i=e[n];"at-rule"==i[0]&&(L.test(i[1][0])&&(t||-1==i[1][0].indexOf(B)?(e.splice(n,1),n--,r--):(t=!0,e.splice(n,1),e.unshift(["at-rule",[i[1][0].replace(L,B)]]))))}}function y(e){var t=["px","em","ex","cm","mm","in","pt","pc","%"];return["ch","rem","vh","vm","vmax","vmin","vw"].forEach(function(n){e.compatibility.units[n]&&t.push(n)}),new RegExp("(^|\\s|\\(|,)0(?:"+t.join("|")+")(\\W|$)","g")}function b(e){var t={};return t.value=void 0===e.roundingPrecision?D:e.roundingPrecision,t.multiplier=Math.pow(10,t.value),t.regexp=new RegExp("(\\d*\\.\\d{"+(t.value+1)+",})px","g"),t}function _(e,t,n){var r=t.compatibility.selectors.ie7Hack,i=t.compatibility.selectors.adjacentSpace,o=t.compatibility.properties.spaceAfterClosingBrace,s=!1,a=!1;t.unitsRegexp=y(t),t.precision=b(t);for(var u=0,c=e.length;u<c;u++){var l=e[u];switch(l[0]){case"selector":l[1]=x(l[1],!r,i),g(l[2],t),a=!0;break;case"block":w(l[1],o),_(l[2],t,n),a=!0;break;case"flat-block":w(l[1],o),g(l[2],t),a=!0;break;case"at-rule":k(l[1]),s=!0}"at-rule"==l[0]&&R.test(l[1])&&a&&(n.warnings.push('Ignoring @import rule "'+l[1]+'" as it appears after rules thus browsers will ignore them.'),l[1]=""),(0===l[1].length||l[2]&&0===l[2].length)&&(e.splice(u,1),u--,c--)}s&&v(e)}var x=e("./clean-up").selectors,w=e("./clean-up").block,k=e("./clean-up").atRule,E=e("../utils/split"),A=e("../colors/rgb"),C=e("../colors/hsl"),S=e("../colors/hex-name-shortener"),T=e("../properties/wrap-for-optimizing").all,O=e("../properties/restore-from-optimizing"),F=e("../properties/remove-unused"),D=2,B="@charset",L=new RegExp("^"+B,"i"),R=/^@import["'\s]/i,N=["100","200","300","400","500","600","700","800","900"],P=["normal","bold","bolder","lighter"],M=["bold","bolder","lighter"],I=/(?:^|\s|\()(-?\d+)px/,j=/^(\-?[\d\.]+)(m?s)$/,V={background:function(e,t,n){return 0!==t||1!=n||"none"!=e&&"transparent"!=e?e:"0 0"},"font-weight":function(e){return"normal"==e?"400":"bold"==e?"700":e},outline:function(e,t,n){return 0===t&&1==n&&"none"==e?"0":e}};t.exports=_},{"../colors/hex-name-shortener":15,"../colors/hsl":16,"../colors/rgb":17,"../properties/remove-unused":29,"../properties/restore-from-optimizing":30,"../properties/wrap-for-optimizing":35,"../utils/split":73,"./clean-up":37}],50:[function(e,t,n){function r(e,t,n){if(!n&&-1==e.indexOf("\n"))return 0===e.indexOf(u)?e:void(t.column+=e.length);for(var r=0,i=e.split("\n"),o=i.length,s=0;;){if(r==o-1)break;var a=i[r];if(/\S/.test(a))break;s+=a.length+1,r++}return t.line+=r,t.column=r>0?0:t.column,t.column+=/^(\s)
|
r
|
javascript
|
goofychris/art-template
|
example/web-test-speed/js/pug.min.js
|
https://github.com/goofychris/art-template/blob/master/example/web-test-speed/js/pug.min.js
|
MIT
|
function r(e,t){for(var n=[],r=0;r<t;r++)n.push("a"+r)
;var i=["return function ("+n.join(",")+") {","var self = this;","return new Promise(function (rs, rj) {","var res = fn.call(",["self"].concat(n).concat([a]).join(","),");","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],i)(o,e)}
|
/",SINGLE_QUOTE:"'",DOUBLE_QUOTE:'"',TEMPLATE_QUOTE:"`",REGEXP:"//g"},f=n.BRACKETS={"(":")","{":"}","[":"]"},d={")":"(","}":"{","]":"["};n.parse=r,n.parseUntil=i,n.parseChar=o,n.defaultState=function(){return new s},s.prototype.current=function(){return this.stack[this.stack.length-1]},s.prototype.isString=function(){return this.current()===h.SINGLE_QUOTE||this.current()===h.DOUBLE_QUOTE||this.current()===h.TEMPLATE_QUOTE},s.prototype.isComment=function(){return this.current()===h.LINE_COMMENT||this.current()===h.BLOCK_COMMENT},s.prototype.isNesting=function(e){return(!e||!e.ignoreLineComment||1!==this.stack.length||this.stack[0]!==h.LINE_COMMENT)&&!!this.stack.length},n.isPunctuator=u,n.isKeyword=c},{"is-regex":97}],13:[function(e,t,n){t.exports=e("./lib/clean")},{"./lib/clean":14}],14:[function(e,t,n){(function(n){function r(e){return void 0===e?["all"]:e}function i(e){return!T.existsSync(e)&&!/\.css$/.test(e)}function o(e){return T.existsSync(e)&&T.statSync(e).isDirectory()}function s(e){return e?{hostname:F.parse(e).hostname,port:parseInt(F.parse(e).port)}:{}}function a(e,t){function n(n){return n=t.options.debug?c(t,n):p(t,n),n=u(t,n),e?e.call(null,t.errors.length>0?t.errors:null,n):n}return function(e){return t.options.sourceMap?t.inputSourceMapTracker.track(e,function(){return t.options.sourceMapInlineSources?t.inputSourceMapTracker.resolveSources(function(){return n(e)}):n(e)}):n(e)}}function u(e,t){return t.stats=e.stats,t.errors=e.errors,t.warnings=e.warnings,t}function c(e,t){var r=n.hrtime();e.stats.originalSize=e.sourceTracker.removeAll(t).length,t=p(e,t);var i=n.hrtime(r);return e.stats.timeSpent=~~(1e3*i[0]+i[1]/1e6),e.stats.efficiency=1-t.styles.length/e.stats.originalSize,e.stats.minifiedSize=t.styles.length,t}function l(e){return function(t,r){var i=t.constructor.name+"#"+r,o=n.hrtime();e(t,r);var s=n.hrtime(o);console.log("%d ms: "+i,1e3*s[0]+s[1]/1e6)}}function p(e,t){function n(t,n){return t=s.restore(t,n),t=a.restore(t),t=r.rebase?f(t,e):t,t=o.restore(t),i.restore(t)}var r=e.options,i=new b(e,r.keepSpecialComments,r.keepBreaks,r.sourceMap),o=new _(r.sourceMap),s=new x(r.sourceMap),a=new w(e,r.sourceMap,r.compatibility.properties.urlQuotes),u=r.sourceMap?y:v,c=function(e,n){t="function"==typeof e?e(t):e[n](t)};r.benchmark&&(c=l(c)),c(i,"escape"),c(o,"escape"),c(a,"escape"),c(s,"escape");var p=d(t,e);return m(p,r,e),r.advanced&&g(p,r,e,!0),u(p,r,n,e.inputSourceMapTracker)}var h=e("./imports/inliner"),f=e("./urls/rebase"),d=e("./tokenizer/tokenize"),m=e("./selectors/simple"),g=e("./selectors/advanced"),v=e("./stringifier/simple"),y=e("./stringifier/source-maps"),b=e("./text/comments-processor"),_=e("./text/expressions-processor"),x=e("./text/free-text-processor"),w=e("./text/urls-processor"),k=e("./utils/compatibility"),E=e("./utils/input-source-map-tracker"),A=e("./utils/source-tracker"),C=e("./utils/source-reader"),S=e("./properties/validator"),T=e("fs"),O=e("path"),F=e("url"),D=e("./utils/object").override;(t.exports=function(e){e=e||{},this.options={advanced:void 0===e.advanced||!!e.advanced,aggressiveMerging:void 0===e.aggressiveMerging||!!e.aggressiveMerging,benchmark:e.benchmark,compatibility:new k(e.compatibility).toOptions(),debug:e.debug,explicitRoot:!!e.root,explicitTarget:!!e.target,inliner:e.inliner||{},keepBreaks:e.keepBreaks||!1,keepSpecialComments:"keepSpecialComments"in e?e.keepSpecialComments:"*",mediaMerging:void 0===e.mediaMerging||!!e.mediaMerging,processImport:void 0===e.processImport||!!e.processImport,processImportFrom:r(e.processImportFrom),rebase:void 0===e.rebase||!!e.rebase,relativeTo:e.relativeTo,restructuring:void 0===e.restructuring||!!e.restructuring,root:e.root||n.cwd(),roundingPrecision:e.roundingPrecision,semanticMerging:void 0!==e.semanticMerging&&!!e.semanticMerging,shorthandCompacting:void 0===e.shorthandCompacting||!!e.shorthandCompacting,sourceMap:e.sourceMap,sourceMapInlineSources:!!e.sourceMapInlineSources,target:!e.target||i(e.target)||o(e.target)?e.target:O.dirname(e.target)},this.options.inliner.timeout=this.options.inliner.timeout||5e3,this.options.inliner.request=D(s(n.env.HTTP_PROXY||n.env.http_proxy),this.options.inliner.request||{})}).prototype.minify=function(e,t){var r={stats:{},errors:[],warnings:[],options:this.options,debug:this.options.debug,localOnly:!t,sourceTracker:new A,validator:new S(this.options.compatibility)};return r.options.sourceMap&&(r.inputSourceMapTracker=new E(r)),r.sourceReader=new C(r,e),e=r.sourceReader.toString(),r.options.processImport||e.indexOf("@shallow")>0?(t?n.nextTick:function(e){return e()})(function(){return new h(r).process(e,{localOnly:r.localOnly,imports:r.options.processImportFrom,whenDone:a(t,r)})}):a(t,r)(e)}}).call(this,e("_process"))},{"./imports/inliner":18,"./properties/validator":33,"./selectors/advanced":36,"./selectors/simple":49,"./stringifier/simple":53,"./stringifier/source-maps":54,"./text/comments-processor":55,"./text/expressions-processor":57,"./text/free-text-processor":58,"./text/urls-processor":59,"./tokenizer/tokenize":62,"./urls/rebase":63,"./utils/compatibility":67,"./utils/input-source-map-tracker":68,"./utils/object":69,"./utils/source-reader":71,"./utils/source-tracker":72,_process:104,fs:10,path:103,url:150}],15:[function(e,t,n){function r(e,t,n,r){return t+a[n.toLowerCase()]+r}function i(e,t,n){return u[t.toLowerCase()]+n}var o={},s={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},a={},u={};for(var c in s){var l=s[c];c.length<l.length?u[l]=c:a[c]=l}var p=new RegExp("(^| |,|\\))("+Object.keys(a).join("|")+")( |,|\\)|$)","ig"),h=new RegExp("("+Object.keys(u).join("|")+")([^a-f0-9]|$)","ig");o.shorten=function(e){var t=e.indexOf("#")>-1,n=e.replace(p,r);return n!=e&&(n=n.replace(p,r)),t?n.replace(h,i):n},t.exports=o},{}],16:[function(e,t,n){function r(e,t,n){this.hue=e,this.saturation=t,this.lightness=n}function i(e,t,n){var r,i,s;if(e%=360,e<0&&(e+=360),e=~~e/360,t<0?t=0:t>100&&(t=100),t=~~t/100,n<0?n=0:n>100&&(n=100),n=~~n/100,0===t)r=i=s=n;else{var a=n<.5?n*(1+t):n+t-n*t,u=2*n-a;r=o(u,a,e+1/3),i=o(u,a,e),s=o(u,a,e-1/3)}return[~~(255*r),~~(255*i),~~(255*s)]}function o(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}r.prototype.toHex=function(){var e=i(this.hue,this.saturation,this.lightness),t=e[0].toString(16),n=e[1].toString(16),r=e[2].toString(16);return"#"+(1==t.length?"0":"")+t+(1==n.length?"0":"")+n+(1==r.length?"0":"")+r},t.exports=r},{}],17:[function(e,t,n){function r(e,t,n){this.red=e,this.green=t,this.blue=n}r.prototype.toHex=function(){return"#"+("00000"+(Math.max(0,Math.min(~~this.red,255))<<16|Math.max(0,Math.min(~~this.green,255))<<8|Math.max(0,Math.min(~~this.blue,255))).toString(16)).slice(-6)},t.exports=r},{}],18:[function(e,t,n){(function(n){function r(e){this.outerContext=e}function i(e,t){if(t.shallow)return t.shallow=!1,t.done.push(e),a(t);for(var n=0,r=0,i=0,o=u(e);r<e.length&&-1!=(n=s(e,i));){if(!o(n)){if(-1==(r=e.indexOf(";",n))){i=e.length,e="";break}var p=e.substring(0,n);return t.done.push(p),t.left.unshift([e.substring(r+1),w(t,{shallow:!1})]),t.afterContent=c(p),l(e,n,r,t)}i=n+1}return t.done.push(e),a(t)}function o(e,t){return e.replace(k,function(e,n){return E.test(n)?e:e.replace(n,b.resolve(t,n))})}function s(e,t){var n=e.indexOf("@import",t),r=e.indexOf("@IMPORT",t);return n>-1&&-1==r?n:-1==n&&r>-1?r:Math.min(n,r)}function a(e){return e.left.length>0?i.apply(null,e.left.shift()):e.whenDone(e.done.join(""))}function u(e){var t=0,n=0,r=!1;return function(i){var o,s=0,a=0,u=0,c=0;if(r)return!1;do{if(i>t&&i<n)return!0;if(!(o=e.match(/(\/\*(?!\*\/)[\s\S]*?\*\/)/)))return r=!0,!1;t=s=o.index,a=s+o[0].length,c=a+n,u=c-o[0].length,e=e.substring(a),n=c}while(c<i);return c>i&&i>u}}function c(e){for(var t=u(e),n=-1;;)if(-1==(n=e.indexOf("{",n+1))||!t(n))break;return n>-1}function l(e,t,n,r){r.shallow=e.indexOf("@shallow")>0;var i=e.substring(s(e,t)+"@import".length+1,n).replace(/@shallow\)$/,")").trim(),o=0===i.indexOf("url("),u=o?4:0,l=/^['"]/.exec(i.substring(u,u+2)),m=l?i.indexOf(l[0],u+1):x(i," ")[0].length-(o?1:0),g=i.substring(u,m).replace(/['"]/g,"").replace(/\)$/,"").trim(),v=i.substring(m+1).replace(/^\)/,"").trim(),y=r.isRemote||E.test(g);return!y||!r.localOnly&&p(g,!0,r.imports)?y||p(g,!1,r.imports)?!y&&r.afterContent?(r.warnings.push('Ignoring local @import of "'+g+'" as after other CSS content.'),a(r)):(y?h:f)(g,v,r):(r.afterImport?r.warnings.push('Ignoring local @import of "'+g+'" as after other inlined content.'):d(g,v,r),a(r)):(r.afterContent||c(r.done.join(""))?r.warnings.push('Ignoring remote @import of "'+g+'" as no callback given.'):d(g,v,r),a(r))}function p(e,t,n){if(0===n.length)return!1;t&&A.test(e)&&(e="http:"+e);for(var r=t?b.parse(e).host:e,i=!0,o=0;o<n.length;o++){var s=n[o];"all"==s?i=!0:t&&"local"==s?i=!1:t&&"remote"==s?i=!0:t||"remote"!=s?t||"local"!=s?"!"==s[0]&&s.substring(1)===r&&(i=!1):i=!0:i=!1}return i}function h(e,t,r){function s(e){f||(f=!0,r.errors.push('Broken @import declaration of "'+u+'" - '+e),d(u,t,r),n.nextTick(function(){a(r)}))}var u=E.test(e)?e:b.resolve(r.relativeTo,e),c=u;if(A.test(u)&&(u="http:"+u),r.visited.indexOf(u)>-1)return a(r);r.debug&&console.error("Inlining remote stylesheet: "+u),r.visited.push(u);var l=r.inliner.request.protocol||r.inliner.request.hostname,p=l&&0!==l.indexOf("https://")||0===u.indexOf("http://")?v.get:y.get,f=!1,m=w(b.parse(u),r.inliner.request);void 0!==r.inliner.request.hostname&&(m.protocol=r.inliner.request.protocol||"http:",m.path=m.href),p(m,function(e){if(e.statusCode<200||e.statusCode>399)return s("error "+e.statusCode);if(e.statusCode>299){return h(b.resolve(u,e.headers.location),t,r)}var a=[],l=b.parse(u);e.on("data",function(e){a.push(e.toString())}),e.on("end",function(){var e=a.join("");r.rebase&&(e=_(e,{toBase:c},r)),r.sourceReader.trackSource(u,e),e=r.sourceTracker.store(u,e),e=o(e,u),t.length>0&&(e="@media "+t+"{"+e+"}"),r.afterImport=!0;var s=w(r,{isRemote:!0,relativeTo:l.protocol+"//"+l.host+l.pathname});n.nextTick(function(){i(e,s)})})}).on("error",function(e){s(e.message)}).on("timeout",function(){s("timeout")}).setTimeout(r.inliner.timeout)}function f(e,t,n){var r="/"==e[0]?n.root:n.relativeTo,o=g.resolve(g.join(r,e));if(!m.existsSync(o)||!m.statSync(o).isFile())return n.errors.push('Broken @import declaration of "'+e+'"'),a(n);if(n.visited.indexOf(o)>-1)return a(n);n.debug&&console.error("Inlining local stylesheet: "+o),n.visited.push(o);var s=g.dirname(o),u=m.readFileSync(o,"utf8");if(n.rebase){var c={relative:!0,fromBase:s,toBase:n.baseRelativeTo};u=_(u,c,n)}var l=g.relative(n.root,o);return n.sourceReader.trackSource(l,u),u=n.sourceTracker.store(l,u),t.length>0&&(u="@media "+t+"{"+u+"}"),n.afterImport=!0,i(u,w(n,{relativeTo:s}))}function d(e,t,n){var r="@import url("+e+")"+(t.length>0?" "+t:"")+";";n.done.push(r)}var m=e("fs"),g=e("path"),v=e("http"),y=e("https"),b=e("url"),_=e("../urls/rewrite"),x=e("../utils/split"),w=e("../utils/object.js").override,k=/\/\*# sourceMappingURL=(\S+) \*\//,E=/^(https?:)?\/\//,A=/^\/\//;r.prototype.process=function(e,t){var n=this.outerContext.options.root;return t=w(t,{baseRelativeTo:this.outerContext.options.relativeTo||n,debug:this.outerContext.options.debug,done:[],errors:this.outerContext.errors,left:[],inliner:this.outerContext.options.inliner,rebase:this.outerContext.options.rebase,relativeTo:this.outerContext.options.relativeTo||n,root:n,sourceReader:this.outerContext.sourceReader,sourceTracker:this.outerContext.sourceTracker,warnings:this.outerContext.warnings,visited:[]}),i(e,t)},t.exports=r}).call(this,e("_process"))},{"../urls/rewrite":65,"../utils/object.js":69,"../utils/split":73,_process:104,fs:10,http:10,https:10,path:103,url:150}],19:[function(e,t,n){function r(e){return function(t){return"invert"==t[0]||e.isValidColor(t[0])}}function i(e){return function(t){return"inherit"!=t[0]&&e.isValidStyle(t[0])&&!e.isValidColorValue(t[0])}}function o(e,t,n){var r=n[e];return f(r.doubleValues&&2==r.defaultValue.length?[[e,t.important],[r.defaultValue[0]],[r.defaultValue[1]]]:r.doubleValues&&1==r.defaultValue.length?[[e,t.important],[r.defaultValue[0]]]:[[e,t.important],[r.defaultValue]])}function s(e){return function(t){return"inherit"!=t[0]&&e.isValidWidth(t[0])&&!e.isValidStyleKeyword(t[0])&&!e.isValidColorValue(t[0])}}function a(e,t,n){var r=o("background-image",e,t),i=o("background-position",e,t),s=o("background-size",e,t),a=o("background-repeat",e,t),u=o("background-attachment",e,t),c=o("background-origin",e,t),l=o("background-clip",e,t),p=o("background-color",e,t),h=[r,i,s,a,u,c,l,p],f=e.value,d=!1,g=!1,v=!1,y=!1;if(1==e.value.length&&"inherit"==e.value[0][0])return p.value=r.value=a.value=i.value=s.value=c.value=l.value=e.value,h;for(var b=f.length-1;b>=0;b--){var _=f[b];if(n.isValidBackgroundAttachment(_[0]))u.value=[_];else if(n.isValidBackgroundBox(_[0]))g?(c.value=[_],v=!0):(l.value=[_],g=!0);else if(n.isValidBackgroundRepeat(_[0]))y?a.value.unshift(_):(a.value=[_],y=!0);else if(n.isValidBackgroundPositionPart(_[0])||n.isValidBackgroundSizePart(_[0]))if(b>0){var x=f[b-1];if(x[0].indexOf("/")>0){var w=m(x[0],"/");s.value=[[w.pop()].concat(x.slice(1)),_],f[b-1]=[w.pop()].concat(x.slice(1))}else b>1&&"/"==f[b-2][0]?(s.value=[x,_],b-=2):"/"==x[0]?s.value=[_]:(d||(i.value=[]),i.value.unshift(_),d=!0)}else d||(i.value=[]),i.value.unshift(_),d=!0;else if(n.isValidBackgroundPositionAndSize(_[0])){var k=m(_[0],"/");s.value=[[k.pop()].concat(_.slice(1))],i.value=[[k.pop()].concat(_.slice(1))]}else p.value[0][0]!=t[p.name].defaultValue&&"none"!=p.value[0][0]||!n.isValidColor(_[0])?(n.isValidUrl(_[0])||n.isValidFunction(_[0]))&&(r.value=[_]):p.value=[_]}return g&&!v&&(c.value=l.value.slice(0)),h}function u(e,t){for(var n=e.value,r=-1,i=0,s=n.length;i<s;i++)if("/"==n[i][0]){r=i;break}if(0===r||r===n.length-1)throw new d("Invalid border-radius value.");var a=o(e.name,e,t);a.value=r>-1?n.slice(0,r):n.slice(0),a.components=c(a,t);var u=o(e.name,e,t);u.value=r>-1?n.slice(r+1):n.slice(0),u.components=c(u,t);for(var l=0;l<4;l++)a.components[l].multiplex=!0,a.components[l].value=a.components[l].value.concat(u.components[l].value);return a.components}function c(e,t){var n=t[e.name].components,r=[],i=e.value;if(i.length<1)return[];i.length<2&&(i[1]=i[0].slice(0)),i.length<3&&(i[2]=i[0].slice(0)),i.length<4&&(i[3]=i[1].slice(0));for(var o=n.length-1;o>=0;o--){var s=f([[n[o],e.important]]);s.value=[i[o]],r.unshift(s)}return r}function l(e){return function(t,n,r){var i,s,a,u,c=[],l=t.value;for(i=0,a=l.length;i<a;i++)","==l[i][0]&&c.push(i);if(0===c.length)return e(t,n,r);var p=[];for(i=0,a=c.length;i<=a;i++){var h=0===i?0:c[i-1]+1,f=i<a?c[i]:l.length,d=o(t.name,t,n);d.value=l.slice(h,f),p.push(e(d,n,r))}var m=p[0];for(i=0,a=m.length;i<a;i++)for(m[i].multiplex=!0,s=1,u=p.length;s<u;s++)m[i].value.push([g]),Array.prototype.push.apply(m[i].value,p[s][i].value);return m}}function p(e,t,n){var r=o("list-style-type",e,t),i=o("list-style-position",e,t),s=o("list-style-image",e,t),a=[r,i,s];if(1==e.value.length&&"inherit"==e.value[0][0])return r.value=i.value=s.value=[e.value[0]],a;var u=e.value.slice(0),c=u.length,l=0;for(l=0,c=u.length;l<c;l++)if(n.isValidUrl(u[l][0])||"0"==u[l][0]){s.value=[u[l]],u.splice(l,1);break}for(l=0,c=u.length;l<c;l++)if(n.isValidListStyleType(u[l][0])){r.value=[u[l]],u.splice(l,1);break}return u.length>0&&n.isValidListStylePosition(u[0][0])&&(i.value=[u[0]]),a}function h(e,t,n){for(var a,u,c,l=t[e.name],p=[o(l.components[0],e,t),o(l.components[1],e,t),o(l.components[2],e,t)],h=0;h<3;h++){var f=p[h];f.name.indexOf("color")>0?a=f:f.name.indexOf("style")>0?u=f:c=f}if(1==e.value.length&&"inherit"==e.value[0][0]||3==e.value.length&&"inherit"==e.value[0][0]&&"inherit"==e.value[1][0]&&"inherit"==e.value[2][0])return a.value=u.value=c.value=[e.value[0]],p;var d,m,g=e.value.slice(0);return g.length>0&&(m=g.filter(s(n)),(d=m.length>1&&("none"==m[0][0]||"auto"==m[0][0])?m[1]:m[0])&&(c.value=[d],g.splice(g.indexOf(d),1))),g.length>0&&(d=g.filter(i(n))[0])&&(u.value=[d],g.splice(g.indexOf(d),1)),g.length>0&&(d=g.filter(r(n))[0])&&(a.value=[d],g.splice(g.indexOf(d),1)),p}var f=e("./wrap-for-optimizing").single,d=e("./invalid-property-error"),m=e("../utils/split"),g=",";t.exports={background:a,border:h,borderRadius:u,fourValues:c,listStyle:p,multiplex:l,outline:h}},{"../utils/split":73,"./invalid-property-error":25,"./wrap-for-optimizing":35}],20:[function(e,t,n){function r(){return!0}function i(e,t,n){var r=e.value[0][0],i=t.value[0][0],o=n.isValidFunction(r),s=n.isValidFunction(i);return o&&s?n.areSameFunction(r,i):!(!o&&s)}function o(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!("none"!=i&&"inherit"!=i&&!n.isValidUrl(i))||"none"!=r&&"inherit"!=r&&!n.isValidUrl(r)&&l(e,t,n)}function s(e,t,n){return a(e.components[2],t.components[2],n)}function a(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!(!n.colorOpacity&&(n.isValidRgbaColor(r)||n.isValidHslaColor(r)))&&(!(!n.colorOpacity&&(n.isValidRgbaColor(i)||n.isValidHslaColor(i)))&&(!(!n.isValidNamedColor(i)&&!n.isValidHexColor(i))||!n.isValidNamedColor(r)&&!n.isValidHexColor(r)&&(!(!n.isValidRgbaColor(i)&&!n.isValidHslaColor(i))||!n.isValidRgbaColor(r)&&!n.isValidHslaColor(r)&&l(e,t,n))))}function u(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!(n.isValidFunction(r)^n.isValidFunction(i))}function c(e,t){return e.value[0][0]===t.value[0][0]}function l(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!!n.areSameFunction(r,i)||r===i}function p(e,t,n){var r=e.value[0][0],i=t.value[0][0];return!(n.isValidAndCompatibleUnitWithoutFunction(r)&&!n.isValidAndCompatibleUnitWithoutFunction(i))&&(!!n.isValidUnitWithoutFunction(i)||!n.isValidUnitWithoutFunction(r)&&(!(!n.isValidFunctionWithoutVendorPrefix(i)||!n.isValidFunctionWithoutVendorPrefix(r))||l(e,t,n)))}t.exports={always:r,alwaysButIntoFunction:i,backgroundImage:o,border:s,color:a,sameValue:c,sameFunctionOrValue:l,twoOptionalFunctions:u,unit:p}},{}],21:[function(e,t,n){function r(e){for(var t=i(e),n=e.components.length-1;n>=0;n--){var r=i(e.components[n]);r.value=e.components[n].value.slice(0),t.components.unshift(r)}return t.dirty=!0,t.value=e.value.slice(0),t}function i(e){var t=o([[e.name,e.important,e.hack]]);return t.unused=!1,t}var o=e("./wrap-for-optimizing").single;t.exports={deep:r,shallow:i}},{"./wrap-for-optimizing":35}],22:[function(e,t,n){var r=e("./break-up"),i=e("./can-override"),o=e("./restore"),s={color:{canOverride:i.color,defaultValue:"transparent",shortestValue:"red"},background:{components:["background-image","background-position","background-size","background-repeat","background-attachment","background-origin","background-clip","background-color"],breakUp:r.multiplex(r.background),defaultValue:"0 0",restore:o.multiplex(o.background),shortestValue:"0",shorthand:!0},"background-clip":{canOverride:i.always,defaultValue:"border-box",shortestValue:"border-box"},"background-color":{canOverride:i.color,defaultValue:"transparent",multiplexLastOnly:!0,nonMergeableValue:"none",shortestValue:"red"},"background-image":{canOverride:i.backgroundImage,defaultValue:"none"},"background-origin":{canOverride:i.always,defaultValue:"padding-box",shortestValue:"border-box"},"background-repeat":{canOverride:i.always,defaultValue:["repeat"],doubleValues:!0},"background-position":{canOverride:i.alwaysButIntoFunction,defaultValue:["0","0"],doubleValues:!0,shortestValue:"0"},"background-size":{
canOverride:i.alwaysButIntoFunction,defaultValue:["auto"],doubleValues:!0,shortestValue:"0 0"},"background-attachment":{canOverride:i.always,defaultValue:"scroll"},border:{breakUp:r.border,canOverride:i.border,components:["border-width","border-style","border-color"],defaultValue:"none",restore:o.withoutDefaults,shorthand:!0},"border-color":{canOverride:i.color,defaultValue:"none",shorthand:!0},"border-style":{canOverride:i.always,defaultValue:"none",shorthand:!0},"border-width":{canOverride:i.unit,defaultValue:"medium",shortestValue:"0",shorthand:!0},"list-style":{components:["list-style-type","list-style-position","list-style-image"],canOverride:i.always,breakUp:r.listStyle,restore:o.withoutDefaults,defaultValue:"outside",shortestValue:"none",shorthand:!0},"list-style-type":{canOverride:i.always,defaultValue:"__hack",shortestValue:"none"},"list-style-position":{canOverride:i.always,defaultValue:"outside",shortestValue:"inside"},"list-style-image":{canOverride:i.always,defaultValue:"none"},outline:{components:["outline-color","outline-style","outline-width"],breakUp:r.outline,restore:o.withoutDefaults,defaultValue:"0",shorthand:!0},"outline-color":{canOverride:i.color,defaultValue:"invert",shortestValue:"red"},"outline-style":{canOverride:i.always,defaultValue:"none"},"outline-width":{canOverride:i.unit,defaultValue:"medium",shortestValue:"0"},"-moz-transform":{canOverride:i.sameFunctionOrValue},"-ms-transform":{canOverride:i.sameFunctionOrValue},"-webkit-transform":{canOverride:i.sameFunctionOrValue},transform:{canOverride:i.sameFunctionOrValue}},a=function(e,t,n){n=n||{},s[e]={canOverride:n.canOverride,components:t,breakUp:n.breakUp||r.fourValues,defaultValue:n.defaultValue||"0",restore:n.restore||o.fourValues,shortestValue:n.shortestValue,shorthand:!0};for(var a=0;a<t.length;a++)s[t[a]]={breakUp:n.breakUp||r.fourValues,canOverride:n.canOverride||i.unit,defaultValue:n.defaultValue||"0",shortestValue:n.shortestValue}};["","-moz-","-o-"].forEach(function(e){a(e+"border-radius",[e+"border-top-left-radius",e+"border-top-right-radius",e+"border-bottom-right-radius",e+"border-bottom-left-radius"],{breakUp:r.borderRadius,restore:o.borderRadius})}),a("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"],{breakUp:r.fourValues,canOverride:i.color,defaultValue:"none",shortestValue:"red"}),a("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"],{breakUp:r.fourValues,canOverride:i.always,defaultValue:"none"}),a("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"],{defaultValue:"medium",shortestValue:"0"}),a("padding",["padding-top","padding-right","padding-bottom","padding-left"]),a("margin",["margin-top","margin-right","margin-bottom","margin-left"]);for(var u in s)if(s[u].shorthand)for(var c=0,l=s[u].components.length;c<l;c++)s[s[u].components[c]].componentOf=u;t.exports=s},{"./break-up":19,"./can-override":20,"./restore":31}],23:[function(e,t,n){function r(e,t,n,r){for(var s=!(t.shorthand||n.shorthand||t.multiplex||n.multiplex),a=i(t),u=i(n),c=0,l=t.value.length;c<l;c++)for(var p=0,h=n.value.length;p<h;p++)if(t.value[c][0]!=o&&n.value[p][0]!=o&&!(s&&c!=p||(a.value=[t.value[c]],u.value=[n.value[p]],e(a,u,r))))return!1;return!0}var i=e("./clone").shallow,o=",";t.exports=r},{"./clone":21}],24:[function(e,t,n){function r(e){for(var t=e.value.length-1;t>=0;t--)if("inherit"==e.value[t][0])return!0;return!1}t.exports=r},{}],25:[function(e,t,n){function r(e){this.name="InvalidPropertyError",this.message=e,this.stack=(new Error).stack}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,t.exports=r},{}],26:[function(e,t,n){function r(e,t,n,r){var i,s,a={},u=null;e:for(var c=0,l=e.length;c<l;c++){var p=e[c],d=!("-ms-filter"!=p.name&&"filter"!=p.name||"background"!=u&&"background-image"!=u)?u:p.name,m=p.important,g=p.hack;if(!p.unused)if(c>0&&i&&d==u&&m==i.important&&g==i.hack&&function(t){var n=e[t-1],r=e[t];return h(n.all,n.position)==h(r.all,r.position)}(c)&&!i.unused)p.unused=!0;else{if(d in a&&(n&&d!=u||function(e){return!1===t||!0===t?t:t.indexOf(e)>-1}(c))){var v=a[d],y=o[d]&&o[d].canOverride,b=!1;for(s=v.length-1;s>=0;s--){var _=e[v[s]],x=_.name!=d,w=_.important,k=_.hack;if(!_.unused&&((!x||!w)&&(w||!(k&&!g||!k&&g))&&(!w||"star"!=g&&"underscore"!=g)&&(k||g||x||!y||y(_,p,r)))){if(w&&!m||w&&g){p.unused=!0,i=p;continue e}b=!0,_.unused=!0}}if(b){c=-1,i=null,u=null,a={};continue}}else{a[d]=a[d]||[],a[d].push(c);var E=f[d];if(E)for(s=E.length-1;s>=0;s--){var A=E[s];a[A]=a[A]||[],a[A].push(c)}}u=d,i=p}}}function i(e,t,n,o,h,f){var d=f.validator,m=f.warnings,g=s(t);a(g,d,m),r(g,n,h.aggressiveMerging,d);for(var v=0,y=g.length;v<y;v++){var b=g[v];b.variable&&b.block&&i(e,b.value[0],n,o,h,f)}o&&h.shorthandCompacting&&(u(g,h.compatibility,d),c(g,h.sourceMap,d)),p(g),l(g)}var o=e("./compactable"),s=e("./wrap-for-optimizing").all,a=e("./populate-components"),u=e("./override-compactor"),c=e("./shorthand-compactor"),l=e("./remove-unused"),p=e("./restore-from-optimizing"),h=e("../stringifier/one-time").property,f={"animation-delay":["animation"],"animation-direction":["animation"],"animation-duration":["animation"],"animation-fill-mode":["animation"],"animation-iteration-count":["animation"],"animation-name":["animation"],"animation-play-state":["animation"],"animation-timing-function":["animation"],"-moz-animation-delay":["-moz-animation"],"-moz-animation-direction":["-moz-animation"],"-moz-animation-duration":["-moz-animation"],"-moz-animation-fill-mode":["-moz-animation"],"-moz-animation-iteration-count":["-moz-animation"],"-moz-animation-name":["-moz-animation"],"-moz-animation-play-state":["-moz-animation"],"-moz-animation-timing-function":["-moz-animation"],"-o-animation-delay":["-o-animation"],"-o-animation-direction":["-o-animation"],"-o-animation-duration":["-o-animation"],"-o-animation-fill-mode":["-o-animation"],"-o-animation-iteration-count":["-o-animation"],"-o-animation-name":["-o-animation"],"-o-animation-play-state":["-o-animation"],"-o-animation-timing-function":["-o-animation"],"-webkit-animation-delay":["-webkit-animation"],"-webkit-animation-direction":["-webkit-animation"],"-webkit-animation-duration":["-webkit-animation"],"-webkit-animation-fill-mode":["-webkit-animation"],"-webkit-animation-iteration-count":["-webkit-animation"],"-webkit-animation-name":["-webkit-animation"],"-webkit-animation-play-state":["-webkit-animation"],"-webkit-animation-timing-function":["-webkit-animation"],"border-color":["border"],"border-style":["border"],"border-width":["border"],"border-bottom":["border"],"border-bottom-color":["border-bottom","border-color","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left":["border"],"border-left-color":["border-left","border-color","border"],"border-left-style":["border-left","border-style","border"],"border-left-width":["border-left","border-width","border"],"border-right":["border"],"border-right-color":["border-right","border-color","border"],"border-right-style":["border-right","border-style","border"],"border-right-width":["border-right","border-width","border"],"border-top":["border"],"border-top-color":["border-top","border-color","border"],"border-top-style":["border-top","border-style","border"],"border-top-width":["border-top","border-width","border"],"font-family":["font"],"font-size":["font"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"transition-delay":["transition"],"transition-duration":["transition"],"transition-property":["transition"],"transition-timing-function":["transition"],"-moz-transition-delay":["-moz-transition"],"-moz-transition-duration":["-moz-transition"],"-moz-transition-property":["-moz-transition"],"-moz-transition-timing-function":["-moz-transition"],"-o-transition-delay":["-o-transition"],"-o-transition-duration":["-o-transition"],"-o-transition-property":["-o-transition"],"-o-transition-timing-function":["-o-transition"],"-webkit-transition-delay":["-webkit-transition"],"-webkit-transition-duration":["-webkit-transition"],"-webkit-transition-property":["-webkit-transition"],"-webkit-transition-timing-function":["-webkit-transition"]};t.exports=i},{"../stringifier/one-time":52,"./compactable":22,"./override-compactor":27,"./populate-components":28,"./remove-unused":29,"./restore-from-optimizing":30,"./shorthand-compactor":32,"./wrap-for-optimizing":35}],27:[function(e,t,n){function r(e){return function(t){return e.name===t.name}}function i(e,t){for(var n=0;n<e.components.length;n++){var r=e.components[n],i=E[r.name],o=i&&i.canOverride||o.sameValue,s=C(r);if(s.value=[[i.defaultValue]],!o(s,r,t))return!0}return!1}function o(e,t){return E[e.name].components.indexOf(t.name)>-1}function s(e,t){t.unused=!0,p(t,h(e)),e.value=t.value}function a(e,t){t.unused=!0,e.multiplex=!0,e.value=t.value}function u(e,t){t.unused=!0,e.value=t.value}function c(e,t){t.multiplex?a(e,t):e.multiplex?s(e,t):u(e,t)}function l(e,t){t.unused=!0;for(var n=0,r=e.components.length;n<r;n++)c(e.components[n],t.components[n],e.multiplex)}function p(e,t){e.multiplex=!0;for(var n=0,r=e.components.length;n<r;n++){var i=e.components[n];if(!i.multiplex)for(var o=i.value.slice(0),s=1;s<t;s++)i.value.push([B]),Array.prototype.push.apply(i.value,o)}}function h(e){for(var t=0,n=0,r=e.value.length;n<r;n++)e.value[n][0]==B&&t++;return t+1}function f(e){var t=[[e.name]].concat(e.value);return D([t],0).length}function d(e,t,n){for(var r=0,i=t;i>=0&&(e[i].name!=n||e[i].unused||r++,!(r>1));i--);return r>1}function m(e,t){for(var n=0,r=e.components.length;n<r;n++)if(g(t.isValidFunction,e.components[n]))return!0;return!1}function g(e,t){for(var n=0,r=t.value.length;n<r;n++)if(t.value[n][0]!=B&&e(t.value[n][0]))return!0;return!1}function v(e,t){if(!e.multiplex&&!t.multiplex||e.multiplex&&t.multiplex)return!1;var n,i=e.multiplex?e:t,o=e.multiplex?t:e,u=A(i);T([u]);var c=A(o);T([c]);var l=f(u)+1+f(c);return e.multiplex?(n=u.components.filter(r(c))[0],s(n,c)):(n=c.components.filter(r(u))[0],p(c,h(u)),a(n,u)),T([c]),l<f(c)}function y(e){return e.name in E}function b(e,t){return!e.multiplex&&("background"==e.name||"background-image"==e.name)&&t.multiplex&&("background"==t.name||"background-image"==t.name)&&_(t.value)}function _(e){for(var t=x(e),n=0,r=t.length;n<r;n++)if(1==t[n].length&&"none"==t[n][0][0])return!0;return!1}function x(e){for(var t=[],n=0,r=[],i=e.length;n<i;n++){var o=e[n];o[0]==B?(t.push(r),r=[]):r.push(o)}return t.push(r),t}function w(e,t,n){var s,a,u,f,_,x,w;e:for(_=e.length-1;_>=0;_--)if(a=e[_],y(a)&&!a.variable)for(s=E[a.name].canOverride||k.sameValue,x=_-1;x>=0;x--)if(u=e[x],y(u)&&!(u.variable||u.unused||a.unused||u.hack&&!a.hack||!u.hack&&a.hack||S(a)||b(u,a)))if(!u.shorthand&&a.shorthand&&o(a,u)){if(!a.important&&u.important)continue;if(!F([u],a.components))continue;if(!g(n.isValidFunction,u)&&m(a,n))continue;f=a.components.filter(r(u))[0],s=E[u.name]&&E[u.name].canOverride||k.sameValue,O(s,u,f,n)&&(u.unused=!0)}else if(u.shorthand&&!a.shorthand&&o(u,a)){if(a.important&&!u.important)continue;if(!a.important&&u.important){a.unused=!0;continue}if(d(e,_-1,u.name))continue;if(m(u,n))continue;if(f=u.components.filter(r(a))[0],O(s,f,a,n)){var A=!t.properties.backgroundClipMerging&&f.name.indexOf("background-clip")>-1||!t.properties.backgroundOriginMerging&&f.name.indexOf("background-origin")>-1||!t.properties.backgroundSizeMerging&&f.name.indexOf("background-size")>-1,C=E[a.name].nonMergeableValue===a.value[0][0];if(A||C)continue;if(!t.properties.merging&&i(u,n))continue;if(f.value[0][0]!=a.value[0][0]&&(S(u)||S(a)))continue;if(v(u,a))continue;!u.multiplex&&a.multiplex&&p(u,h(a)),c(f,a),u.dirty=!0}}else if(u.shorthand&&a.shorthand&&u.name==a.name){if(!u.multiplex&&a.multiplex)continue;if(!a.important&&u.important){a.unused=!0;continue e}if(a.important&&!u.important){u.unused=!0;continue}for(w=u.components.length-1;w>=0;w--){var T=u.components[w],D=a.components[w];if(s=E[T.name].canOverride||k.sameValue,!O(s,T,D,n))continue e;if(!O(k.twoOptionalFunctions,T,D,n)&&n.isValidFunction(D))continue e}l(u,a),u.dirty=!0}else if(u.shorthand&&a.shorthand&&o(u,a)){if(!u.important&&a.important)continue;if(f=u.components.filter(r(a))[0],s=E[a.name].canOverride||k.sameValue,!O(s,f,a,n))continue;if(u.important&&!a.important){a.unused=!0;continue}var B=E[a.name].restore(a,E);if(B.length>1)continue;f=u.components.filter(r(a))[0],c(f,a),a.dirty=!0}else if(u.name==a.name){if(u.important&&!a.important){a.unused=!0;continue}if(s=E[a.name].canOverride||k.sameValue,!O(s,u,a,n))continue;u.unused=!0}}var k=e("./can-override"),E=e("./compactable"),A=e("./clone").deep,C=e("./clone").shallow,S=e("./has-inherit"),T=e("./restore-from-optimizing"),O=e("./every-combination"),F=e("./vendor-prefixes").same,D=e("../stringifier/one-time").property,B=",";t.exports=w},{"../stringifier/one-time":52,"./can-override":20,"./clone":21,"./compactable":22,"./every-combination":23,"./has-inherit":24,"./restore-from-optimizing":30,"./vendor-prefixes":34}],28:[function(e,t,n){function r(e,t,n){for(var r=e.length-1;r>=0;r--){var s=e[r],a=i[s.name];if(a&&a.shorthand){s.shorthand=!0,s.dirty=!0;try{s.components=a.breakUp(s,i,t)}catch(e){if(!(e instanceof o))throw e;s.components=[],n.push(e.message)}s.components.length>0?s.multiplex=s.components[0].multiplex:s.unused=!0}}}var i=e("./compactable"),o=e("./invalid-property-error");t.exports=r},{"./compactable":22,"./invalid-property-error":25}],29:[function(e,t,n){function r(e){for(var t=e.length-1;t>=0;t--){var n=e[t];n.unused&&n.all.splice(n.position,1)}}t.exports=r},{}],30:[function(e,t,n){function r(e){e.value[e.value.length-1][0]+=u}function i(e){"underscore"==e.hack?e.name=l+e.name:"star"==e.hack?e.name=c+e.name:"backslash"==e.hack?e.value[e.value.length-1][0]+=a:"bang"==e.hack&&(e.value[e.value.length-1][0]+=" "+p)}function o(e,t){for(var n=e.length-1;n>=0;n--){var o,a=e[n],u=s[a.name];if(!a.unused&&((a.dirty||a.important||a.hack)&&(!t&&u&&u.shorthand?(o=u.restore(a,s),a.value=o):o=a.value,a.important&&r(a),a.hack&&i(a),"all"in a))){var c=a.all[a.position];c[0][0]=a.name,c.splice(1,c.length-1),Array.prototype.push.apply(c,o)}}}var s=e("./compactable"),a="\\9",u="!important",c="*",l="_",p="!ie";t.exports=o},{"./compactable":22}],31:[function(e,t,n){function r(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if("inherit"!=r&&r!=l&&r!=p)return!1}return!0}function i(e,t,n){function i(e){Array.prototype.unshift.apply(c,e.value)}function o(e){var n=t[e.name];return n.doubleValues?1==n.defaultValue.length?e.value[0][0]==n.defaultValue[0]&&(!e.value[1]||e.value[1][0]==n.defaultValue[0]):e.value[0][0]==n.defaultValue[0]&&(e.value[1]?e.value[1][0]:e.value[0][0])==n.defaultValue[1]:e.value[0][0]==n.defaultValue}for(var s,a,u=e.components,c=[],l=u.length-1;l>=0;l--){var h=u[l],f=o(h);if("background-clip"==h.name){var d=u[l-1],m=o(d);s=h.value[0][0]==d.value[0][0],a=!s&&(m&&!f||!m&&!f||!m&&f&&h.value[0][0]!=d.value[0][0]),s?i(d):a&&(i(h),i(d)),l--}else if("background-size"==h.name){var g=u[l-1],v=o(g);s=!v&&f,a=!s&&(v&&!f||!v&&!f),s?i(g):a?(i(h),c.unshift([p]),i(g)):1==g.value.length&&i(g),l--}else{if(f||t[h.name].multiplexLastOnly&&!n)continue;i(h)}}return 0===c.length&&1==e.value.length&&"0"==e.value[0][0]&&c.push(e.value[0]),0===c.length&&c.push([t[e.name].defaultValue]),r(c)?[c[0]]:c}function o(e,t){if(e.multiplex){for(var n=c(e),r=c(e),i=0;i<4;i++){var o=e.components[i],a=c(e);a.value=[o.value[0]],n.components.push(a);var u=c(e);u.value=[o.value[1]||o.value[0]],r.components.push(u)}var l=s(n),p=s(r);return l.length!=p.length||l[0][0]!=p[0][0]||l.length>1&&l[1][0]!=p[1][0]||l.length>2&&l[2][0]!=p[2][0]||l.length>3&&l[3][0]!=p[3][0]?l.concat([["/"]]).concat(p):l}return s(e)}function s(e){var t=e.components,n=t[0].value[0],r=t[1].value[0],i=t[2].value[0],o=t[3].value[0];return n[0]==r[0]&&n[0]==i[0]&&n[0]==o[0]?[n]:n[0]==i[0]&&r[0]==o[0]?[n,r]:r[0]==o[0]?[n,r,i]:[n,r,i,o]}function a(e){return function(t,n){if(!t.multiplex)return e(t,n,!0);var r,i,o=0,s=[],a={};for(r=0,i=t.components[0].value.length;r<i;r++)t.components[0].value[r][0]==l&&o++;for(r=0;r<=o;r++){for(var u=c(t),p=0,h=t.components.length;p<h;p++){var f=t.components[p],d=c(f);u.components.push(d);for(var m=a[d.name]||0,g=f.value.length;m<g;m++){if(f.value[m][0]==l){a[d.name]=m+1;break}d.value.push(f.value[m])}}var v=r==o,y=e(u,n,v);Array.prototype.push.apply(s,y),r<o&&s.push([","])}return s}}function u(e,t){for(var n=e.components,i=[],o=n.length-1;o>=0;o--){var s=n[o],a=t[s.name];s.value[0][0]!=a.defaultValue&&i.unshift(s.value[0])}return 0===i.length&&i.push([t[e.name].defaultValue]),r(i)?[i[0]]:i}var c=e("./clone").shallow,l=",",p="/";t.exports={background:i,borderRadius:o,fourValues:s,multiplex:a,withoutDefaults:u}},{"./clone":21}],32:[function(e,t,n){function r(e){var t;for(var n in e){if(void 0!==t&&e[n].important!=t)return!0;t=e[n].important}return!1}function i(e){var t=[];for(var n in e){var r=e[n],i=r.all[r.position],o=i[0][i[0].length-1];Array.isArray(o)&&Array.prototype.push.apply(t,o)}return t}function o(e,t,n,r,o){var s,a=u[n],d=[[n],[a.defaultValue]],m=h(d);m.shorthand=!0,m.dirty=!0,p([m],o,[]);for(var g=0,v=a.components.length;g<v;g++){var y=t[a.components[g]],b=u[y.name].canOverride;if(l(y))return;if(!f(b,m.components[g],y,o))return;m.components[g]=c(y),m.important=y.important,s=y.all}for(var _ in t)t[_].unused=!0;if(r){var x=i(t);x.length>0&&d[0].push(x)}m.position=s.length,m.all=s,m.all.push(d),e.push(m)}function s(e,t,n,i,s){var a=e[t];for(var c in n)if(void 0===a||c!=a.name){var l=u[c],p=n[c];l.components.length>Object.keys(p).length?delete n[c]:r(p)||o(e,p,c,i,s)}}function a(e,t,n){var r={};if(!(e.length<3)){for(var i=0,o=e.length;i<o;i++){var a=e[i];if(!a.unused&&(!a.hack&&!a.variable)){var c=u[a.name];if(c&&c.componentOf)if(a.shorthand)s(e,i,r,t,n);else{var l=c.componentOf;r[l]=r[l]||{},r[l][a.name]=a}}}s(e,i,r,t,n)}}var u=e("./compactable"),c=e("./clone").deep,l=e("./has-inherit"),p=e("./populate-components"),h=e("./wrap-for-optimizing").single,f=e("./every-combination");t.exports=a},{"./clone":21,"./compactable":22,"./every-combination":23,"./has-inherit":24,"./populate-components":28,"./wrap-for-optimizing":35}],33:[function(e,t,n){function r(e){var t=s.slice(0).filter(function(t){return!(t in e.units)||!0===e.units[t]}),n="(\\-?\\.?\\d+\\.?\\d*("+t.join("|")+"|)|auto|inherit)";this.compatibleCssUnitRegex=new RegExp("^"+n+"$","i"),this.compatibleCssUnitAnyRegex=new RegExp("^(none|"+o.join("|")+"|"+n+"|"+l+"|"+u+"|"+c+")$","i"),this.colorOpacity=e.colors.opacity}var i=e("../utils/split"),o=["thin","thick","medium","inherit","initial"],s=["px","%","em","in","cm","mm","ex","pt","pc","ch","rem","vh","vm","vmin","vmax","vw"],a="(\\-?\\.?\\d+\\.?\\d*("+s.join("|")+"|)|auto|inherit)",u="[A-Z]+(\\-|[A-Z]|[0-9])+\\(.*?\\)",c="\\-(\\-|[A-Z]|[0-9])+\\(.*?\\)",l="var\\(\\-\\-[^\\)]+\\)",p="("+l+"|"+u+"|"+c+")",h="("+a+"|(\\-moz\\-|\\-webkit\\-)?calc\\([^\\)]+\\))",f="(none|"+o.join("|")+"|"+a+"|"+l+"|"+u+"|"+c+")",d=new RegExp("^"+u+"$","i"),m=new RegExp("^"+c+"$","i"),g=new RegExp("^"+l+"$","i"),v=new RegExp("^"+p+"$","i"),y=new RegExp("^"+a+"$","i"),b=new RegExp("^"+h+"$","i"),_=new RegExp("^"+f+"$","i"),x=["repeat","no-repeat","repeat-x","repeat-y","inherit"],w=["inherit","scroll","fixed","local"],k=["center","top","bottom","left","right"],E=["contain","cover"],A=["border-box","content-box","padding-box"],C=["auto","inherit","hidden","none","dotted","dashed","solid","double","groove","ridge","inset","outset"],S=["armenian","circle","cjk-ideographic","decimal","decimal-leading-zero","disc","georgian","hebrew","hiragana","hiragana-iroha","inherit","katakana","katakana-iroha","lower-alpha","lower-greek","lower-latin","lower-roman","none","square","upper-alpha","upper-latin","upper-roman"],T=["inside","outside","inherit"];r.prototype.isValidHexColor=function(e){return(4===e.length||7===e.length)&&"#"===e[0]},r.prototype.isValidRgbaColor=function(e){return e=e.split(" ").join(""),e.length>0&&0===e.indexOf("rgba(")&&e.indexOf(")")===e.length-1},r.prototype.isValidHslaColor=function(e){return e=e.split(" ").join(""),e.length>0&&0===e.indexOf("hsla(")&&e.indexOf(")")===e.length-1},r.prototype.isValidNamedColor=function(e){return"auto"!==e&&("transparent"===e||"inherit"===e||/^[a-zA-Z]+$/.test(e))},r.prototype.isValidVariable=function(e){return g.test(e)},r.prototype.isValidColor=function(e){return this.isValidNamedColor(e)||this.isValidColorValue(e)||this.isValidVariable(e)||this.isValidVendorPrefixedValue(e)},r.prototype.isValidColorValue=function(e){return this.isValidHexColor(e)||this.isValidRgbaColor(e)||this.isValidHslaColor(e)},r.prototype.isValidUrl=function(e){return 0===e.indexOf("__ESCAPED_URL_CLEAN_CSS")},r.prototype.isValidUnit=function(e){return _.test(e)},r.prototype.isValidUnitWithoutFunction=function(e){return y.test(e)},r.prototype.isValidAndCompatibleUnit=function(e){return this.compatibleCssUnitAnyRegex.test(e)},r.prototype.isValidAndCompatibleUnitWithoutFunction=function(e){return this.compatibleCssUnitRegex.test(e)},r.prototype.isValidFunctionWithoutVendorPrefix=function(e){return d.test(e)},r.prototype.isValidFunctionWithVendorPrefix=function(e){return m.test(e)},r.prototype.isValidFunction=function(e){return v.test(e)},r.prototype.isValidBackgroundRepeat=function(e){return x.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidBackgroundAttachment=function(e){return w.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidBackgroundBox=function(e){return A.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidBackgroundPositionPart=function(e){return k.indexOf(e)>=0||b.test(e)||this.isValidVariable(e)},r.prototype.isValidBackgroundPosition=function(e){if("inherit"===e)return!0;for(var t=e.split(" "),n=0,r=t.length;n<r;n++)if(""!==t[n]&&!this.isValidBackgroundPositionPart(t[n])&&!this.isValidVariable(t[n]))return!1;return!0},r.prototype.isValidBackgroundSizePart=function(e){return E.indexOf(e)>=0||y.test(e)||this.isValidVariable(e)},r.prototype.isValidBackgroundPositionAndSize=function(e){if(e.indexOf("/")<0)return!1;var t=i(e,"/");return this.isValidBackgroundSizePart(t.pop())&&this.isValidBackgroundPositionPart(t.pop())},r.prototype.isValidListStyleType=function(e){return S.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidListStylePosition=function(e){return T.indexOf(e)>=0||this.isValidVariable(e)},r.prototype.isValidStyle=function(e){return this.isValidStyleKeyword(e)||this.isValidVariable(e)},r.prototype.isValidStyleKeyword=function(e){return C.indexOf(e)>=0},r.prototype.isValidWidth=function(e){return this.isValidUnit(e)||this.isValidWidthKeyword(e)||this.isValidVariable(e)},r.prototype.isValidWidthKeyword=function(e){return o.indexOf(e)>=0},r.prototype.isValidVendorPrefixedValue=function(e){return/^-([A-Za-z0-9]|-)*$/gi.test(e)},r.prototype.areSameFunction=function(e,t){return!(!this.isValidFunction(e)||!this.isValidFunction(t))&&e.substring(0,e.indexOf("("))===t.substring(0,t.indexOf("("))},t.exports=r},{"../utils/split":73}],34:[function(e,t,n){function r(e){for(var t=[],n=0,r=e.length;n<r;n++)for(var i=e[n],s=0,a=i.value.length;s<a;s++){var u=o.exec(i.value[s][0]);u&&-1==t.indexOf(u[0])&&t.push(u[0])}return t}function i(e,t){return r(e).sort().join(",")==r(t).sort().join(",")}var o=/$\-moz\-|\-ms\-|\-o\-|\-webkit\-/;t.exports={same:i}},{}],35:[function(e,t,n){function r(e){for(var t=[],n=e.length-1;n>=0;n--)if("string"!=typeof e[n][0]){var r=l(e[n]);r.all=e,r.position=n,t.unshift(r)}return t}function i(e){for(var t=1,n=e.length;t<n;t++)if(","==e[t][0]||"/"==e[t][0])return!0;return!1}function o(e){var t=!1,n=e[0][0],r=e[e.length-1];return n[0]==m?t="underscore":n[0]==d?t="star":r[0][0]!=g||r[0].match(h)?r[0].indexOf(g)>0&&!r[0].match(h)?t="bang":r[0].indexOf(p)>0&&r[0].indexOf(p)==r[0].length-p.length-1?t="backslash":0===r[0].indexOf(p)&&2==r[0].length&&(t="backslash"):t="bang",t}function s(e){if(e.length>1){var t=e[e.length-1][0];if("string"==typeof t)return f.test(t)}return!1}function a(e){e.length>0&&(e[e.length-1][0]=e[e.length-1][0].replace(f,""))}function u(e){e[0][0]=e[0][0].substring(1)}function c(e,t){var n=e[e.length-1];n[0]=n[0].substring(0,n[0].indexOf("backslash"==t?p:g)).trim(),0===n[0].length&&e.pop()}function l(e){var t=s(e);t&&a(e);var n=o(e);"star"==n||"underscore"==n?u(e):"backslash"!=n&&"bang"!=n||c(e,n);var r=0===e[0][0].indexOf("--");return{block:r&&e[1]&&Array.isArray(e[1][0][0]),components:[],dirty:!1,hack:n,important:t,name:e[0][0],multiplex:e.length>2&&i(e),position:0,shorthand:!1,unused:e.length<2,value:e.slice(1),variable:r}}var p="\\",h=new RegExp("important$","i"),f=new RegExp("!important$","i"),d="*",m="_",g="!";t.exports={all:r,single:l}},{}],36:[function(e,t,n){function r(e){for(var t=0,n=e.length;t<n;t++){var i=e[t],o=!1;switch(i[0]){case"selector":o=0===i[1].length||0===i[2].length;break;case"block":r(i[2]),o=0===i[2].length}o&&(e.splice(t,1),t--,n--)}}function i(e,t,n){for(var r=0,i=e.length;r<i;r++){var o=e[r];if("block"==o[0]){var a=/@(-moz-|-o-|-webkit-)?keyframes/.test(o[1][0]);s(o[2],t,n,!a)}}}function o(e,t,n){for(var r=0,i=e.length;r<i;r++){var s=e[r];switch(s[0]){case"selector":a(s[1],s[2],!1,!0,t,n);break;case"block":o(s[2],t,n)}}}function s(e,t,n,a){if(i(e,t,n),o(e,t,n),u(e),c(e,t,n),l(e,t,n),p(e,t,n),h(e,t),t.restructuring&&a&&(f(e,t),c(e,t,n)),t.mediaMerging){d(e);for(var g=m(e),v=g.length-1;v>=0;v--)s(g[v][2],t,n,!1)}r(e)}var a=e("../properties/optimizer"),u=e("./remove-duplicates"),c=e("./merge-adjacent"),l=e("./reduce-non-adjacent"),p=e("./merge-non-adjacent-by-selector"),h=e("./merge-non-adjacent-by-body"),f=e("./restructure"),d=e("./remove-duplicate-media-queries"),m=e("./merge-media-queries");t.exports=s},{"../properties/optimizer":26,"./merge-adjacent":40,"./merge-media-queries":41,"./merge-non-adjacent-by-body":42,"./merge-non-adjacent-by-selector":43,"./reduce-non-adjacent":44,"./remove-duplicate-media-queries":45,"./remove-duplicates":46,"./restructure":48}],37:[function(e,t,n){function r(e,t){return"["+t.replace(/ /g,"")+"]"}function i(e,t){return e[0]>t[0]?1:-1}function o(e,t,n,r){return t&&n&&r.length?t+n+" ":t&&n?t+n:n}var s={selectors:function(e,t,n){for(var s=[],a=[],u=0,c=e.length;u<c;u++){var l=e[u],p=l[0].replace(/\s+/g," ").replace(/ ?, ?/g,",").replace(/\s*(\\)?([>+~])(\s*)/g,o).trim();n&&p.indexOf("nav")>0&&(p=p.replace(/\+nav(\S|$)/,"+ nav$1")),(!t||-1==p.indexOf("*+html ")&&-1==p.indexOf("*:first-child+html "))&&(p.indexOf("*")>-1&&(p=p.replace(/\*([:#\.\[])/g,"$1").replace(/^(\:first\-child)?\+html/,"*$1+html")),p.indexOf("[")>-1&&(p=p.replace(/\[([^\]]+)\]/g,r)),-1==a.indexOf(p)&&(l[0]=p,a.push(p),s.push(l)))}return s.sort(i)},selectorDuplicates:function(e){for(var t=[],n=[],r=0,o=e.length;r<o;r++){var s=e[r];-1==n.indexOf(s[0])&&(n.push(s[0]),t.push(s))}return t.sort(i)},block:function(e,t){e[0]=e[0].replace(/\s+/g," ").replace(/(,|:|\() /g,"$1").replace(/ \)/g,")"),t||(e[0]=e[0].replace(/\) /g,")"))},atRule:function(e){e[0]=e[0].replace(/\s+/g," ").trim()}};t.exports=s},{}],38:[function(e,t,n){function r(e){var t=[];if("selector"==e[0])for(var n=!/[\.\+>~]/.test(o(e[1])),u=0,c=e[2].length;u<c;u++){var l=e[2][u];if(0!==l.indexOf("__ESCAPED")&&l[0]!=a){var p=e[2][u][0][0];if(0!==p.length&&0!==p.indexOf("--")){var h=s(e[2],u);t.push([p,h,i(p),e[2][u],p+":"+h,e[1],n])}}}else if("block"==e[0])for(var f=0,d=e[2].length;f<d;f++)t=t.concat(r(e[2][f]));return t}function i(e){return"list-style"==e?e:e.indexOf("-radius")>0?"border-radius":"border-collapse"==e||"border-spacing"==e||"border-image"==e?e:0===e.indexOf("border-")&&/^border\-\w+\-\w+$/.test(e)?e.match(/border\-\w+/)[0]:0===e.indexOf("border-")&&/^border\-\w+$/.test(e)?"border":0===e.indexOf("text-")?e:e.replace(/^\-\w+\-/,"").match(/([a-zA-Z]+)/)[0].toLowerCase()}var o=e("../stringifier/one-time").selectors,s=e("../stringifier/one-time").value,a="at-rule";t.exports=r},{"../stringifier/one-time":52}],39:[function(e,t,n){function r(e,t){return e.compatibility.selectors.special.test(t)}t.exports=r},{}],40:[function(e,t,n){function r(e,t,n){for(var r=[null,[],[]],c=t.compatibility.selectors.adjacentSpace,l=0,p=e.length;l<p;l++){var h=e[l];if("selector"==h[0])if("selector"==r[0]&&s(h[1])==s(r[1])){var f=[r[2].length];Array.prototype.push.apply(r[2],h[2]),i(h[1],r[2],f,!0,t,n),h[2]=[]}else"selector"!=r[0]||o(h[2])!=o(r[2])||u(t,s(h[1]))||u(t,s(r[1]))?r=h:(r[1]=a(r[1].concat(h[1]),!1,c),h[2]=[]);else r=[null,[],[]]}}var i=e("../properties/optimizer"),o=e("../stringifier/one-time").body,s=e("../stringifier/one-time").selectors,a=e("./clean-up").selectors,u=e("./is-special");t.exports=r},{"../properties/optimizer":26,"../stringifier/one-time":52,"./clean-up":37,"./is-special":39}],41:[function(e,t,n){function r(e){for(var t={},n=[],r=e.length-1;r>=0;r--){var s=e[r];if("block"==s[0]){var a=t[s[1][0]];a||(a=[],t[s[1][0]]=a),a.push(r)}}for(var u in t){var c=t[u];e:for(var l=c.length-1;l>0;l--){var p=c[l],h=e[p],f=c[l-1],d=e[f];t:for(var m=1;m>=-1;m-=2){for(var g=1==m,v=g?p+1:f-1,y=g?f:p,b=g?1:-1,_=g?h:d,x=g?d:h,w=o(_);v!=y;){var k=o(e[v]);if(v+=b,!i(w,k))continue t}x[2]=g?_[2].concat(x[2]):x[2].concat(_[2]),_[2]=[],n.push(x);continue e}}}return n}var i=e("./reorderable").canReorder,o=e("./extractor");t.exports=r},{"./extractor":38,"./reorderable":47}],42:[function(e,t,n){function r(e){return/\.|\*| :/.test(e)}function i(e){var t=c(e[1]);return t.indexOf("__")>-1||t.indexOf("--")>-1}function o(e){return e.replace(/--[^ ,>\+~:]+/g,"")}function s(e,t){var n=o(c(e[1]));for(var r in t){var i=t[r],s=o(c(i[1]));(s.indexOf(n)>-1||n.indexOf(s)>-1)&&delete t[r]}}function a(e,t){for(var n={},o=t.compatibility.selectors.adjacentSpace,a=e.length-1;a>=0;a--){var h=e[a];if("selector"==h[0]){h[2].length>0&&!t.semanticMerging&&r(c(h[1]))&&(n={}),h[2].length>0&&t.semanticMerging&&i(h)&&s(h,n);var f=u(h[2]),d=n[f];!d||p(t,c(h[1]))||p(t,c(d[1]))||(h[1]=h[2].length>0?l(d[1].concat(h[1]),!1,o):d[1].concat(h[1]),d[2]=[],n[f]=null),n[u(h[2])]=h}}}var u=e("../stringifier/one-time").body,c=e("../stringifier/one-time").selectors,l=e("./clean-up").selectors,p=e("./is-special");t.exports=a},{"../stringifier/one-time":52,"./clean-up":37,"./is-special":39}],43:[function(e,t,n){function r(e,t,n){var r,u={},c=[];for(r=e.length-1;r>=0;r--)if("selector"==e[r][0]&&0!==e[r][2].length){var l=o(e[r][1]);u[l]=[r].concat(u[l]||[]),2==u[l].length&&c.push(l)}for(r=c.length-1;r>=0;r--){var p=u[c[r]];e:for(var h=p.length-1;h>0;h--){var f=p[h-1],d=e[f],m=p[h],g=e[m];t:for(var v=1;v>=-1;v-=2){for(var y,b=1==v,_=b?f+1:m-1,x=b?m:f,w=b?1:-1,k=b?d:g,E=b?g:d,A=s(k);_!=x;){var C=s(e[_]);_+=w;var S=b?a(A,C):a(C,A);if(!S&&!b)continue e;if(!S&&b)continue t}b?(y=[k[2].length],Array.prototype.push.apply(k[2],E[2]),E[2]=k[2]):(y=[E[2].length],Array.prototype.push.apply(E[2],k[2])),i(E[1],E[2],y,!0,t,n),k[2]=[]}}}}var i=e("../properties/optimizer"),o=e("../stringifier/one-time").selectors,s=e("./extractor"),a=e("./reorderable").canReorder;t.exports=r},{"../properties/optimizer":26,"../stringifier/one-time":52,"./extractor":38,"./reorderable":47}],44:[function(e,t,n){function r(e,t,n){for(var r={},a=[],u=e.length-1;u>=0;u--){var c=e[u];if("selector"==c[0]&&0!==c[2].length)for(var h=l(c[1]),f=c[1].length>1&&!p(t,h),d=t.sourceMap?i(c[1]):c[1],m=f?[h].concat(d):[h],g=0,v=m.length;g<v;g++){var y=m[g];r[y]?a.push(y):r[y]=[],r[y].push({where:u,list:d,isPartial:f&&g>0,isComplex:f&&0===g})}}o(e,a,r,t,n),s(e,r,t,n)}function i(e){for(var t=[],n=0;n<e.length;n++)t.push([e[n][0]]);return t}function o(e,t,n,r,i){function o(e,t){return p[e].isPartial&&0===t.length}function s(e,t,n,r){p[n-r-1].isPartial||(e[2]=t)}for(var u=0,c=t.length;u<c;u++){var l=t[u],p=n[l];a(e,l,p,{filterOut:o,callback:s},r,i)}}function s(e,t,n,r){function i(e){return s.data[e].where<s.intoPosition}function o(e,t,n,r){0===r&&s.reducedBodies.push(t)}var s={}
;e:for(var u in t){var l=t[u];if(l[0].isComplex){var h=l[l.length-1].where,f=e[h],d=[],m=p(n,u)?[u]:l[0].list;s.intoPosition=h,s.reducedBodies=d;for(var g=0,v=m.length;g<v;g++){var y=m[g],b=t[y];if(b.length<2)continue e;if(s.data=b,a(e,y,b,{filterOut:i,callback:o},n,r),c(d[d.length-1])!=c(d[0]))continue e}f[2]=d[0]}}}function a(e,t,n,r,i,o){for(var s=[],a=[],c=[],l=[],p=n.length-1,f=0;p>=0;p--)if(!r.filterOut(p,s)){var d=n[p].where,m=e[d],g=h(m[2]);s=s.concat(g),a.push(g),l.push(d)}for(p=0,f=a.length;p<f;p++)a[p].length>0&&c.push((c.length>0?c[c.length-1]:0)+a[p].length);u(t,s,c,!1,i,o);for(var v=l.length,y=s.length-1,b=v-1;b>=0;)if((0===b||s[y]&&a[b].indexOf(s[y])>-1)&&y>-1)y--;else{var _=s.splice(y+1);r.callback(e[l[b]],_,v,b),b--}}var u=e("../properties/optimizer"),c=e("../stringifier/one-time").body,l=e("../stringifier/one-time").selectors,p=e("./is-special"),h=e("../utils/clone-array");t.exports=r},{"../properties/optimizer":26,"../stringifier/one-time":52,"../utils/clone-array":66,"./is-special":39}],45:[function(e,t,n){function r(e){for(var t={},n=0,r=e.length;n<r;n++){var o=e[n];if("block"==o[0]){var s=o[1][0]+"%"+i(o[2]),a=t[s];a&&(a[2]=[]),t[s]=o}}}var i=e("../stringifier/one-time").all;t.exports=r},{"../stringifier/one-time":52}],46:[function(e,t,n){function r(e){for(var t,n,r,s,a={},u=[],c=0,l=e.length;c<l;c++)n=e[c],"selector"==n[0]&&(t=o(n[1]),a[t]&&1==a[t].length?u.push(t):a[t]=a[t]||[],a[t].push(c));for(c=0,l=u.length;c<l;c++){t=u[c],s=[];for(var p=a[t].length-1;p>=0;p--)n=e[a[t][p]],r=i(n[2]),s.indexOf(r)>-1?n[2]=[]:s.push(r)}}var i=e("../stringifier/one-time").body,o=e("../stringifier/one-time").selectors;t.exports=r},{"../stringifier/one-time":52}],47:[function(e,t,n){function r(e,t){for(var n=t.length-1;n>=0;n--)for(var r=e.length-1;r>=0;r--)if(!i(e[r],t[n]))return!1;return!0}function i(e,t){var n=e[0],r=e[1],i=e[2],m=e[5],g=e[6],v=t[0],y=t[1],b=t[2],_=t[5],x=t[6];return!("font"==n&&"line-height"==v||"font"==v&&"line-height"==n)&&((!f.test(n)||!f.test(v))&&(!(i==b&&s(n)==s(v)&&o(n)^o(v))&&(("border"!=i||!d.test(b)||!("border"==n||n==b||r!=y&&a(n,v)))&&(("border"!=b||!d.test(i)||!("border"==v||v==i||r!=y&&a(n,v)))&&(("border"!=i||"border"!=b||n==v||!(u(n)&&c(v)||c(n)&&u(v)))&&(i!=b||(!(n!=v||i!=b||r!=y&&!l(r,y))||(n!=v&&i==b&&n!=i&&v!=b||(n!=v&&i==b&&r==y||!(!x||!g||h(i)||h(b)||!p(_,m)))))))))))}function o(e){return/^\-(?:moz|webkit|ms|o)\-/.test(e)}function s(e){return e.replace(/^\-(?:moz|webkit|ms|o)\-/,"")}function a(e,t){return e.split("-").pop()==t.split("-").pop()}function u(e){return"border-top"==e||"border-right"==e||"border-bottom"==e||"border-left"==e}function c(e){return"border-color"==e||"border-style"==e||"border-width"==e}function l(e,t){return o(e)&&o(t)&&e.split("-")[1]!=t.split("-")[2]}function p(e,t){for(var n=0,r=e.length;n<r;n++)for(var i=0,o=t.length;i<o;i++)if(e[n][0]==t[i][0])return!1;return!0}function h(e){return"font"==e||"line-height"==e||"list-style"==e}var f=/align\-items|box\-align|box\-pack|flex|justify/,d=/^border\-(top|right|bottom|left|color|style|width|radius)/;t.exports={canReorder:r,canReorderSingle:i}},{}],48:[function(e,t,n){function r(e,t){return e>t}function i(e,t){var n=h(e);return n[5]=n[5].concat(t[5]),n}function o(e,t){function n(e,t,n){for(var r=n.length-1;r>=0;r--){var i=n[r][0],s=o(t,i);if(C[s].length>1&&k(e,C[s])){h(s);break}}}function o(e,t){var n=f(t);return C[n]=C[n]||[],C[n].push([e,t]),n}function h(e){var t,n=e.split(O),r=[];for(var i in C){var o=i.split(O);for(t=o.length-1;t>=0;t--)if(n.indexOf(o[t])>-1){r.push(i);break}}for(t=r.length-1;t>=0;t--)delete C[r[t]]}function f(e){for(var t=[],n=0,r=e.length;n<r;n++)t.push(c(e[n][1]));return t.join(O)}function d(e){for(var n=[],r=[],i=e.length-1;i>=0;i--)p(t,c(e[i][1]))||(r.unshift(e[i]),e[i][2].length>0&&-1==n.indexOf(e[i])&&n.push(e[i]));return n.length>1?r:[]}function m(e,t){var r=t[0],i=t[1],o=t[4],s=r.length+i.length+1,a=[],u=[],c=d(E[o]);if(!(c.length<2)){var p=v(c,s,1),h=p[0];if(h[1]>0)return n(e,t,p);for(var f=h[0].length-1;f>=0;f--)a=h[0][f][1].concat(a),u.unshift(h[0][f]);a=l(a),_(e,[t],a,u)}}function g(e,t){return e[1]>t[1]}function v(e,t,n){return y(e,t,n,T-1).sort(g)}function y(e,t,n,r){var i=[[e,b(e,t,n)]];if(e.length>2&&r>0)for(var o=e.length-1;o>=0;o--){var s=Array.prototype.slice.call(e,0);s.splice(o,1),i=i.concat(y(s,t,n,r-1))}return i}function b(e,t,n){for(var r=0,i=e.length-1;i>=0;i--)r+=e[i][2].length>n?c(e[i][1]).length:-1;return r-(e.length-1)*t+1}function _(t,n,r,i){var o,s,a,c,l=[];for(o=i.length-1;o>=0;o--){var p=i[o];for(s=p[2].length-1;s>=0;s--){var h=p[2][s];for(a=0,c=n.length;a<c;a++){var f=n[a],d=h[0][0],m=f[0],g=f[4];if(d==m&&u([h])==g){p[2].splice(s,1);break}}}}for(o=n.length-1;o>=0;o--)l.unshift(n[o][3]);var v=["selector",r,l];e.splice(t,0,v)}function x(e,t){var n=t[4],r=E[n];r&&r.length>1&&(w(e,t)||m(e,t))}function w(e,t){var n,r,i=[],o=[],s=t[4],a=d(E[s]);if(!(a.length<2)){e:for(var u in E){var c=E[u];for(n=a.length-1;n>=0;n--)if(-1==c.indexOf(a[n]))continue e;i.push(u)}if(i.length<2)return!1;for(n=i.length-1;n>=0;n--)for(r=A.length-1;r>=0;r--)if(A[r][4]==i[n]){o.unshift([A[r],a]);break}return k(e,o)}}function k(e,t){for(var n,r=0,i=[],o=t.length-1;o>=0;o--){n=t[o][0];r+=n[4].length+(o>0?1:0),i.push(n)}var s=t[0][1],a=v(s,r,i.length)[0];if(a[1]>0)return!1;var u=[],c=[];for(o=a[0].length-1;o>=0;o--)u=a[0][o][1].concat(u),c.unshift(a[0][o]);for(u=l(u),_(e,i,u,c),o=i.length-1;o>=0;o--){n=i[o];var p=A.indexOf(n);delete E[n[4]],p>-1&&-1==S.indexOf(p)&&S.push(p)}return!0}for(var E={},A=[],C={},S=[],T=2,O="%",F=e.length-1;F>=0;F--){var D,B,L,R,N,P=e[F];if("selector"==P[0])D=!0;else{if("block"!=P[0])continue;D=!1}var M=A.length,I=s(P);S=[];var j=[];for(B=I.length-1;B>=0;B--)for(L=B-1;L>=0;L--)if(!a(I[B],I[L])){j.push(B);break}for(B=I.length-1;B>=0;B--){var V=I[B],z=!1;for(L=0;L<M;L++){var U=A[L];-1!=S.indexOf(L)||a(V,U)||function(e,t,n){if(e[0]!=t[0])return!1;var r=t[4],i=E[r];return i&&i.indexOf(n)>-1}(V,U,P)||(x(F+1,U),-1==S.indexOf(L)&&(S.push(L),delete E[U[4]])),z||(z=V[0]==U[0]&&V[1]==U[1])&&(N=L)}if(D&&!(j.indexOf(B)>-1)){var $=V[4];E[$]=E[$]||[],E[$].push(P),z?A[N]=i(A[N],V):A.push(V)}}for(S=S.sort(r),B=0,R=S.length;B<R;B++){var q=S[B]-B;A.splice(q,1)}}for(var H=e[0]&&"at-rule"==e[0][0]&&0===e[0][1][0].indexOf("@charset")?1:0;H<e.length-1;H++){var W="at-rule"===e[H][0]&&0===e[H][1][0].indexOf("@import"),G="text"===e[H][0]&&0===e[H][1][0].indexOf("__ESCAPED_COMMENT_SPECIAL");if(!W&&!G)break}for(F=0;F<A.length;F++)x(H,A[F])}var s=e("./extractor"),a=e("./reorderable").canReorderSingle,u=e("../stringifier/one-time").body,c=e("../stringifier/one-time").selectors,l=e("./clean-up").selectorDuplicates,p=e("./is-special"),h=e("../utils/clone-array");t.exports=o},{"../stringifier/one-time":52,"../utils/clone-array":66,"./clean-up":37,"./extractor":38,"./is-special":39,"./reorderable":47}],49:[function(e,t,n){function r(e,t){return e.value[t]&&"-"==e.value[t][0][0]&&parseFloat(e.value[t][0])<0}function i(e,t){return-1==t.indexOf("0")?t:(t.indexOf("-")>-1&&(t=t.replace(/([^\w\d\-]|^)\-0([^\.]|$)/g,"$10$2").replace(/([^\w\d\-]|^)\-0([^\.]|$)/g,"$10$2")),t.replace(/(^|\s)0+([1-9])/g,"$1$2").replace(/(^|\D)\.0+(\D|$)/g,"$10$2").replace(/(^|\D)\.0+(\D|$)/g,"$10$2").replace(/\.([1-9]*)0+(\D|$)/g,function(e,t,n){return(t.length>0?".":"")+t+n}).replace(/(^|\D)0\.(\d)/g,"$1.$2"))}function o(e,t){return-1==t.indexOf("0deg")?t:t.replace(/\(0deg\)/g,"(0)")}function s(e,t){return e.indexOf("filter")>-1||-1==t.indexOf(" ")?t:(t=t.replace(/\s+/g," "),t.indexOf("calc")>-1&&(t=t.replace(/\) ?\/ ?/g,")/ ")),t.replace(/\( /g,"(").replace(/ \)/g,")").replace(/, /g,","))}function a(e,t,n){return-1===n.value||-1===t.indexOf(".")?t:t.replace(n.regexp,function(e,t){return Math.round(parseFloat(t)*n.multiplier)/n.multiplier+"px"}).replace(/(\d)\.($|\D)/g,"$1$2")}function u(e,t,n){return/^(?:\-moz\-calc|\-webkit\-calc|calc)\(/.test(t)?t:"flex"==e||"-ms-flex"==e||"-webkit-flex"==e||"flex-basis"==e||"-webkit-flex-basis"==e?t:t.indexOf("%")>0&&("height"==e||"max-height"==e)?t:t.replace(n,"$10$2").replace(n,"$10$2")}function c(e){var t,n=e.value;4==n.length&&"0"===n[0][0]&&"0"===n[1][0]&&"0"===n[2][0]&&"0"===n[3][0]&&(t=e.name.indexOf("box-shadow")>-1?2:1),t&&(e.value.splice(t),e.dirty=!0)}function l(e,t,n){return-1===t.indexOf("#")&&-1==t.indexOf("rgb")&&-1==t.indexOf("hsl")?S.shorten(t):(t=t.replace(/rgb\((\-?\d+),(\-?\d+),(\-?\d+)\)/g,function(e,t,n,r){return new A(t,n,r).toHex()}).replace(/hsl\((-?\d+),(-?\d+)%?,(-?\d+)%?\)/g,function(e,t,n,r){return new C(t,n,r).toHex()}).replace(/(^|[^='"])#([0-9a-f]{6})/gi,function(e,t,n){return n[0]==n[1]&&n[2]==n[3]&&n[4]==n[5]?t+"#"+n[0]+n[2]+n[4]:t+"#"+n}).replace(/(rgb|rgba|hsl|hsla)\(([^\)]+)\)/g,function(e,t,n){var r=n.split(",");return"hsl"==t&&3==r.length||"hsla"==t&&4==r.length||"rgb"==t&&3==r.length&&n.indexOf("%")>0||"rgba"==t&&4==r.length&&n.indexOf("%")>0?(-1==r[1].indexOf("%")&&(r[1]+="%"),-1==r[2].indexOf("%")&&(r[2]+="%"),t+"("+r.join(",")+")"):e}),n.colors.opacity&&-1==e.indexOf("background")&&(t=t.replace(/(?:rgba|hsla)\(0,0%?,0%?,0\)/g,function(e){return E(t,",").pop().indexOf("gradient(")>-1?e:"transparent"})),S.shorten(t))}function p(e,t,n){return I.test(t)?t.replace(I,function(e,t){var r,i=parseInt(t);return 0===i?e:(n.properties.shorterLengthUnits&&n.units.pt&&3*i%4==0&&(r=3*i/4+"pt"),n.properties.shorterLengthUnits&&n.units.pc&&i%16==0&&(r=i/16+"pc"),n.properties.shorterLengthUnits&&n.units.in&&i%96==0&&(r=i/96+"in"),r&&(r=e.substring(0,e.indexOf(t))+r),r&&r.length<e.length?r:e)}):t}function h(e,t){return j.test(t)?t.replace(j,function(e,t,n){var r;return"ms"==n?r=parseInt(t)/1e3+"s":"s"==n&&(r=1e3*parseFloat(t)+"ms"),r.length<e.length?r:e}):t}function f(e){var t,n=e.value;3==n.length&&"/"==n[1][0]&&n[0][0]==n[2][0]?t=1:5==n.length&&"/"==n[2][0]&&n[0][0]==n[3][0]&&n[1][0]==n[4][0]?t=2:7==n.length&&"/"==n[3][0]&&n[0][0]==n[4][0]&&n[1][0]==n[5][0]&&n[2][0]==n[6][0]?t=3:9==n.length&&"/"==n[4][0]&&n[0][0]==n[5][0]&&n[1][0]==n[6][0]&&n[2][0]==n[7][0]&&n[3][0]==n[8][0]&&(t=4),t&&(e.value.splice(t),e.dirty=!0)}function d(e){1==e.value.length&&(e.value[0][0]=e.value[0][0].replace(/progid:DXImageTransform\.Microsoft\.(Alpha|Chroma)(\W)/,function(e,t,n){return t.toLowerCase()+n})),e.value[0][0]=e.value[0][0].replace(/,(\S)/g,", $1").replace(/ ?= ?/g,"=")}function m(e){var t=e.value;if(!(N.indexOf(t[0][0])>-1||t[1]&&N.indexOf(t[1][0])>-1||t[2]&&N.indexOf(t[2][0])>-1)&&"/"!=t[1]){var n=0;if("normal"==t[0][0]&&n++,t[1]&&"normal"==t[1][0]&&n++,t[2]&&"normal"==t[2][0]&&n++,!(n>1)){var r;M.indexOf(t[0][0])>-1?r=0:t[1]&&M.indexOf(t[1][0])>-1?r=1:t[2]&&M.indexOf(t[2][0])>-1?r=2:P.indexOf(t[0][0])>-1?r=0:t[1]&&P.indexOf(t[1][0])>-1?r=1:t[2]&&P.indexOf(t[2][0])>-1&&(r=2),void 0!==r&&(e.value[r][0]=V["font-weight"](t[r][0]),e.dirty=!0)}}}function g(e,t){for(var n,v,y,b=T(e),_=0,x=b.length;_<x;_++)if(n=b[_],v=n.name,n.hack&&(("star"==n.hack||"underscore"==n.hack)&&!t.compatibility.properties.iePrefixHack||"backslash"==n.hack&&!t.compatibility.properties.ieSuffixHack||"bang"==n.hack&&!t.compatibility.properties.ieBangHack)&&(n.unused=!0),0===v.indexOf("padding")&&(r(n,0)||r(n,1)||r(n,2)||r(n,3))&&(n.unused=!0),!n.unused)if(n.variable)n.block&&g(n.value[0],t);else{for(var w=0,k=n.value.length;w<k;w++)y=n.value[w][0],V[v]&&(y=V[v](y,w,k)),y=s(v,y),y=a(v,y,t.precision),y=p(v,y,t.compatibility),y=h(v,y),y=i(v,y),t.compatibility.properties.zeroUnits&&(y=o(v,y),y=u(v,y,t.unitsRegexp)),t.compatibility.properties.colors&&(y=l(v,y,t.compatibility)),n.value[w][0]=y;c(n),0===v.indexOf("border")&&v.indexOf("radius")>0?f(n):"filter"==v?d(n):"font"==v&&m(n)}O(b,!0),F(b)}function v(e){for(var t=!1,n=0,r=e.length;n<r;n++){var i=e[n];"at-rule"==i[0]&&(L.test(i[1][0])&&(t||-1==i[1][0].indexOf(B)?(e.splice(n,1),n--,r--):(t=!0,e.splice(n,1),e.unshift(["at-rule",[i[1][0].replace(L,B)]]))))}}function y(e){var t=["px","em","ex","cm","mm","in","pt","pc","%"];return["ch","rem","vh","vm","vmax","vmin","vw"].forEach(function(n){e.compatibility.units[n]&&t.push(n)}),new RegExp("(^|\\s|\\(|,)0(?:"+t.join("|")+")(\\W|$)","g")}function b(e){var t={};return t.value=void 0===e.roundingPrecision?D:e.roundingPrecision,t.multiplier=Math.pow(10,t.value),t.regexp=new RegExp("(\\d*\\.\\d{"+(t.value+1)+",})px","g"),t}function _(e,t,n){var r=t.compatibility.selectors.ie7Hack,i=t.compatibility.selectors.adjacentSpace,o=t.compatibility.properties.spaceAfterClosingBrace,s=!1,a=!1;t.unitsRegexp=y(t),t.precision=b(t);for(var u=0,c=e.length;u<c;u++){var l=e[u];switch(l[0]){case"selector":l[1]=x(l[1],!r,i),g(l[2],t),a=!0;break;case"block":w(l[1],o),_(l[2],t,n),a=!0;break;case"flat-block":w(l[1],o),g(l[2],t),a=!0;break;case"at-rule":k(l[1]),s=!0}"at-rule"==l[0]&&R.test(l[1])&&a&&(n.warnings.push('Ignoring @import rule "'+l[1]+'" as it appears after rules thus browsers will ignore them.'),l[1]=""),(0===l[1].length||l[2]&&0===l[2].length)&&(e.splice(u,1),u--,c--)}s&&v(e)}var x=e("./clean-up").selectors,w=e("./clean-up").block,k=e("./clean-up").atRule,E=e("../utils/split"),A=e("../colors/rgb"),C=e("../colors/hsl"),S=e("../colors/hex-name-shortener"),T=e("../properties/wrap-for-optimizing").all,O=e("../properties/restore-from-optimizing"),F=e("../properties/remove-unused"),D=2,B="@charset",L=new RegExp("^"+B,"i"),R=/^@import["'\s]/i,N=["100","200","300","400","500","600","700","800","900"],P=["normal","bold","bolder","lighter"],M=["bold","bolder","lighter"],I=/(?:^|\s|\()(-?\d+)px/,j=/^(\-?[\d\.]+)(m?s)$/,V={background:function(e,t,n){return 0!==t||1!=n||"none"!=e&&"transparent"!=e?e:"0 0"},"font-weight":function(e){return"normal"==e?"400":"bold"==e?"700":e},outline:function(e,t,n){return 0===t&&1==n&&"none"==e?"0":e}};t.exports=_},{"../colors/hex-name-shortener":15,"../colors/hsl":16,"../colors/rgb":17,"../properties/remove-unused":29,"../properties/restore-from-optimizing":30,"../properties/wrap-for-optimizing":35,"../utils/split":73,"./clean-up":37}],50:[function(e,t,n){function r(e,t,n){if(!n&&-1==e.indexOf("\n"))return 0===e.indexOf(u)?e:void(t.column+=e.length);for(var r=0,i=e.split("\n"),o=i.length,s=0;;){if(r==o-1)break;var a=i[r];if(/\S/.test(a))break;s+=a.length+1,r++}return t.line+=r,t.column=r>0?0:t.column,t.column+=/^(\s)
|
r
|
javascript
|
goofychris/art-template
|
example/web-test-speed/js/pug.min.js
|
https://github.com/goofychris/art-template/blob/master/example/web-test-speed/js/pug.min.js
|
MIT
|
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
str
);
if (!match) {
return;
}
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'weeks':
case 'week':
case 'w':
return n * w;
case 'days':
case 'day':
case 'd':
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
default:
return undefined;
}
}
|
Parse the given `str` and return milliseconds.
@param {String} str
@return {Number}
@api private
|
parse
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function fmtShort(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return Math.round(ms / d) + 'd';
}
if (msAbs >= h) {
return Math.round(ms / h) + 'h';
}
if (msAbs >= m) {
return Math.round(ms / m) + 'm';
}
if (msAbs >= s) {
return Math.round(ms / s) + 's';
}
return ms + 'ms';
}
|
Short format for `ms`.
@param {Number} ms
@return {String}
@api private
|
fmtShort
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function fmtLong(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return plural(ms, msAbs, d, 'day');
}
if (msAbs >= h) {
return plural(ms, msAbs, h, 'hour');
}
if (msAbs >= m) {
return plural(ms, msAbs, m, 'minute');
}
if (msAbs >= s) {
return plural(ms, msAbs, s, 'second');
}
return ms + ' ms';
}
|
Long format for `ms`.
@param {Number} ms
@return {String}
@api private
|
fmtLong
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
return true;
}
// Internet Explorer and Edge do not support colors.
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
// Is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// Is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// Is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// Double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
|
Currently only WebKit-based Web Inspectors, Firefox >= v31,
and the Firebug extension (any Firefox version) are known
to support "%c" CSS customizations.
TODO: add a `localStorage` variable to explicitly enable/disable colors
|
useColors
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function formatArgs(args) {
args[0] = (this.useColors ? '%c' : '') +
this.namespace +
(this.useColors ? ' %c' : ' ') +
args[0] +
(this.useColors ? '%c ' : ' ') +
'+' + module.exports.humanize(this.diff);
if (!this.useColors) {
return;
}
const c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit');
// The final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
let index = 0;
let lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, match => {
if (match === '%%') {
return;
}
index++;
if (match === '%c') {
// We only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
}
|
Colorize log arguments if enabled.
@api public
|
formatArgs
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function save(namespaces) {
try {
if (namespaces) {
exports.storage.setItem('debug', namespaces);
} else {
exports.storage.removeItem('debug');
}
} catch (error) {
// Swallow
// XXX (@Qix-) should we be logging these?
}
}
|
Save `namespaces`.
@param {String} namespaces
@api private
|
save
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function load() {
let r;
try {
r = exports.storage.getItem('debug');
} catch (error) {
// Swallow
// XXX (@Qix-) should we be logging these?
}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
return r;
}
|
Load `namespaces`.
@return {String} returns the previously persisted debug modes
@api private
|
load
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function localstorage() {
try {
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
// The Browser also has localStorage in the global context.
return localStorage;
} catch (error) {
// Swallow
// XXX (@Qix-) should we be logging these?
}
}
|
Localstorage attempts to return the localstorage.
This is necessary because safari throws
when a user disables cookies/localstorage
and you attempt to access it.
@return {LocalStorage}
@api private
|
localstorage
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function setup(env) {
createDebug.debug = createDebug;
createDebug.default = createDebug;
createDebug.coerce = coerce;
createDebug.disable = disable;
createDebug.enable = enable;
createDebug.enabled = enabled;
createDebug.humanize = require('ms');
createDebug.destroy = destroy;
Object.keys(env).forEach(key => {
createDebug[key] = env[key];
});
/**
* The currently active debug mode names, and names to skip.
*/
createDebug.names = [];
createDebug.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
*/
createDebug.formatters = {};
/**
* Selects a color for a debug namespace
* @param {String} namespace The namespace string for the debug instance to be colored
* @return {Number|String} An ANSI color code for the given namespace
* @api private
*/
function selectColor(namespace) {
let hash = 0;
for (let i = 0; i < namespace.length; i++) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
}
createDebug.selectColor = selectColor;
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function createDebug(namespace) {
let prevTime;
let enableOverride = null;
let namespacesCache;
let enabledCache;
function debug(...args) {
// Disabled?
if (!debug.enabled) {
return;
}
const self = debug;
// Set `diff` timestamp
const curr = Number(new Date());
const ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
args[0] = createDebug.coerce(args[0]);
if (typeof args[0] !== 'string') {
// Anything else let's inspect with %O
args.unshift('%O');
}
// Apply any `formatters` transformations
let index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
// If we encounter an escaped % then don't increase the array index
if (match === '%%') {
return '%';
}
index++;
const formatter = createDebug.formatters[format];
if (typeof formatter === 'function') {
const val = args[index];
match = formatter.call(self, val);
// Now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// Apply env-specific formatting (colors, etc.)
createDebug.formatArgs.call(self, args);
const logFn = self.log || createDebug.log;
logFn.apply(self, args);
}
debug.namespace = namespace;
debug.useColors = createDebug.useColors();
debug.color = createDebug.selectColor(namespace);
debug.extend = extend;
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
Object.defineProperty(debug, 'enabled', {
enumerable: true,
configurable: false,
get: () => {
if (enableOverride !== null) {
return enableOverride;
}
if (namespacesCache !== createDebug.namespaces) {
namespacesCache = createDebug.namespaces;
enabledCache = createDebug.enabled(namespace);
}
return enabledCache;
},
set: v => {
enableOverride = v;
}
});
// Env-specific initialization logic for debug instances
if (typeof createDebug.init === 'function') {
createDebug.init(debug);
}
return debug;
}
function extend(namespace, delimiter) {
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
newDebug.log = this.log;
return newDebug;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
createDebug.save(namespaces);
createDebug.namespaces = namespaces;
createDebug.names = [];
createDebug.skips = [];
let i;
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
const len = split.length;
for (i = 0; i < len; i++) {
if (!split[i]) {
// ignore empty strings
continue;
}
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
createDebug.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @return {String} namespaces
* @api public
*/
function disable() {
const namespaces = [
...createDebug.names.map(toNamespace),
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
].join(',');
createDebug.enable('');
return namespaces;
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
if (name[name.length - 1] === '*') {
return true;
}
let i;
let len;
for (i = 0, len = createDebug.skips.length; i < len; i++) {
if (createDebug.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = createDebug.names.length; i < len; i++) {
if (createDebug.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Convert regexp to namespace
*
* @param {RegExp} regxep
* @return {String} namespace
* @api private
*/
function toNamespace(regexp) {
return regexp.toString()
.substring(2, regexp.toString().length - 2)
.replace(/\.\*\?$/, '*');
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) {
return val.stack || val.message;
}
return val;
}
/**
* XXX DO NOT USE. This is a temporary stub function.
* XXX It WILL be removed in the next major release.
*/
function destroy() {
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
}
createDebug.enable(createDebug.load());
return createDebug;
}
|
This is the common logic for both the Node.js and web browser
implementations of `debug()`.
|
setup
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function selectColor(namespace) {
let hash = 0;
for (let i = 0; i < namespace.length; i++) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
}
|
Selects a color for a debug namespace
@param {String} namespace The namespace string for the debug instance to be colored
@return {Number|String} An ANSI color code for the given namespace
@api private
|
selectColor
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function createDebug(namespace) {
let prevTime;
let enableOverride = null;
let namespacesCache;
let enabledCache;
function debug(...args) {
// Disabled?
if (!debug.enabled) {
return;
}
const self = debug;
// Set `diff` timestamp
const curr = Number(new Date());
const ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
args[0] = createDebug.coerce(args[0]);
if (typeof args[0] !== 'string') {
// Anything else let's inspect with %O
args.unshift('%O');
}
// Apply any `formatters` transformations
let index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
// If we encounter an escaped % then don't increase the array index
if (match === '%%') {
return '%';
}
index++;
const formatter = createDebug.formatters[format];
if (typeof formatter === 'function') {
const val = args[index];
match = formatter.call(self, val);
// Now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// Apply env-specific formatting (colors, etc.)
createDebug.formatArgs.call(self, args);
const logFn = self.log || createDebug.log;
logFn.apply(self, args);
}
debug.namespace = namespace;
debug.useColors = createDebug.useColors();
debug.color = createDebug.selectColor(namespace);
debug.extend = extend;
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
Object.defineProperty(debug, 'enabled', {
enumerable: true,
configurable: false,
get: () => {
if (enableOverride !== null) {
return enableOverride;
}
if (namespacesCache !== createDebug.namespaces) {
namespacesCache = createDebug.namespaces;
enabledCache = createDebug.enabled(namespace);
}
return enabledCache;
},
set: v => {
enableOverride = v;
}
});
// Env-specific initialization logic for debug instances
if (typeof createDebug.init === 'function') {
createDebug.init(debug);
}
return debug;
}
|
Create a debugger with the given `namespace`.
@param {String} namespace
@return {Function}
@api public
|
createDebug
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function debug(...args) {
// Disabled?
if (!debug.enabled) {
return;
}
const self = debug;
// Set `diff` timestamp
const curr = Number(new Date());
const ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
args[0] = createDebug.coerce(args[0]);
if (typeof args[0] !== 'string') {
// Anything else let's inspect with %O
args.unshift('%O');
}
// Apply any `formatters` transformations
let index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
// If we encounter an escaped % then don't increase the array index
if (match === '%%') {
return '%';
}
index++;
const formatter = createDebug.formatters[format];
if (typeof formatter === 'function') {
const val = args[index];
match = formatter.call(self, val);
// Now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// Apply env-specific formatting (colors, etc.)
createDebug.formatArgs.call(self, args);
const logFn = self.log || createDebug.log;
logFn.apply(self, args);
}
|
Create a debugger with the given `namespace`.
@param {String} namespace
@return {Function}
@api public
|
debug
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function extend(namespace, delimiter) {
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
newDebug.log = this.log;
return newDebug;
}
|
Create a debugger with the given `namespace`.
@param {String} namespace
@return {Function}
@api public
|
extend
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function enable(namespaces) {
createDebug.save(namespaces);
createDebug.namespaces = namespaces;
createDebug.names = [];
createDebug.skips = [];
let i;
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
const len = split.length;
for (i = 0; i < len; i++) {
if (!split[i]) {
// ignore empty strings
continue;
}
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
createDebug.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
|
Enables a debug mode by namespaces. This can include modes
separated by a colon and wildcards.
@param {String} namespaces
@api public
|
enable
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function disable() {
const namespaces = [
...createDebug.names.map(toNamespace),
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
].join(',');
createDebug.enable('');
return namespaces;
}
|
Disable debug output.
@return {String} namespaces
@api public
|
disable
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function enabled(name) {
if (name[name.length - 1] === '*') {
return true;
}
let i;
let len;
for (i = 0, len = createDebug.skips.length; i < len; i++) {
if (createDebug.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = createDebug.names.length; i < len; i++) {
if (createDebug.names[i].test(name)) {
return true;
}
}
return false;
}
|
Returns true if the given mode name is enabled, false otherwise.
@param {String} name
@return {Boolean}
@api public
|
enabled
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function toNamespace(regexp) {
return regexp.toString()
.substring(2, regexp.toString().length - 2)
.replace(/\.\*\?$/, '*');
}
|
Convert regexp to namespace
@param {RegExp} regxep
@return {String} namespace
@api private
|
toNamespace
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function coerce(val) {
if (val instanceof Error) {
return val.stack || val.message;
}
return val;
}
|
Coerce `val`.
@param {Mixed} val
@return {Mixed}
@api private
|
coerce
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function destroy() {
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
}
|
XXX DO NOT USE. This is a temporary stub function.
XXX It WILL be removed in the next major release.
|
destroy
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function decode(input) {
try {
return decodeURIComponent(input.replace(/\+/g, ' '));
} catch (e) {
return null;
}
}
|
Decode a URI encoded string.
@param {String} input The URI encoded string.
@returns {String|Null} The decoded string.
@api private
|
decode
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function encode(input) {
try {
return encodeURIComponent(input);
} catch (e) {
return null;
}
}
|
Attempts to encode a given input.
@param {String} input The string that needs to be encoded.
@returns {String|Null} The encoded string.
@api private
|
encode
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function querystring(query) {
var parser = /([^=?&]+)=?([^&]*)/g
, result = {}
, part;
while (part = parser.exec(query)) {
var key = decode(part[1])
, value = decode(part[2]);
//
// Prevent overriding of existing properties. This ensures that build-in
// methods like `toString` or __proto__ are not overriden by malicious
// querystrings.
//
// In the case if failed decoding, we want to omit the key/value pairs
// from the result.
//
if (key === null || value === null || key in result) continue;
result[key] = value;
}
return result;
}
|
Simple query string parser.
@param {String} query The query string that needs to be parsed.
@returns {Object}
@api public
|
querystring
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function querystringify(obj, prefix) {
prefix = prefix || '';
var pairs = []
, value
, key;
//
// Optionally prefix with a '?' if needed
//
if ('string' !== typeof prefix) prefix = '?';
for (key in obj) {
if (has.call(obj, key)) {
value = obj[key];
//
// Edge cases where we actually want to encode the value to an empty
// string instead of the stringified value.
//
if (!value && (value === null || value === undef || isNaN(value))) {
value = '';
}
key = encodeURIComponent(key);
value = encodeURIComponent(value);
//
// If we failed to encode the strings, we should bail out as we don't
// want to add invalid strings to the query.
//
if (key === null || value === null) continue;
pairs.push(key +'='+ value);
}
}
return pairs.length ? prefix + pairs.join('&') : '';
}
|
Transform a query string to an object.
@param {Object} obj Object that should be transformed.
@param {String} prefix Optional prefix.
@returns {String}
@api public
|
querystringify
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function trimLeft(str) {
return (str ? str : '').toString().replace(controlOrWhitespace, '');
}
|
Remove control characters and whitespace from the beginning of a string.
@param {Object|String} str String to trim.
@returns {String} A new string representing `str` stripped of control
characters and whitespace from its beginning.
@public
|
trimLeft
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function lolcation(loc) {
var globalVar;
if (typeof window !== 'undefined') globalVar = window;
else if (typeof global !== 'undefined') globalVar = global;
else if (typeof self !== 'undefined') globalVar = self;
else globalVar = {};
var location = globalVar.location || {};
loc = loc || location;
var finaldestination = {}
, type = typeof loc
, key;
if ('blob:' === loc.protocol) {
finaldestination = new Url(unescape(loc.pathname), {});
} else if ('string' === type) {
finaldestination = new Url(loc, {});
for (key in ignore) delete finaldestination[key];
} else if ('object' === type) {
for (key in loc) {
if (key in ignore) continue;
finaldestination[key] = loc[key];
}
if (finaldestination.slashes === undefined) {
finaldestination.slashes = slashes.test(loc.href);
}
}
return finaldestination;
}
|
The location object differs when your code is loaded through a normal page,
Worker or through a worker using a blob. And with the blobble begins the
trouble as the location object will contain the URL of the blob, not the
location of the page where our code is loaded in. The actual origin is
encoded in the `pathname` so we can thankfully generate a good "default"
location from it so we can generate proper relative URL's again.
@param {Object|String} loc Optional default location object.
@returns {Object} lolcation object.
@public
|
lolcation
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function isSpecial(scheme) {
return (
scheme === 'file:' ||
scheme === 'ftp:' ||
scheme === 'http:' ||
scheme === 'https:' ||
scheme === 'ws:' ||
scheme === 'wss:'
);
}
|
Check whether a protocol scheme is special.
@param {String} The protocol scheme of the URL
@return {Boolean} `true` if the protocol scheme is special, else `false`
@private
|
isSpecial
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function extractProtocol(address, location) {
address = trimLeft(address);
address = address.replace(CRHTLF, '');
location = location || {};
var match = protocolre.exec(address);
var protocol = match[1] ? match[1].toLowerCase() : '';
var forwardSlashes = !!match[2];
var otherSlashes = !!match[3];
var slashesCount = 0;
var rest;
if (forwardSlashes) {
if (otherSlashes) {
rest = match[2] + match[3] + match[4];
slashesCount = match[2].length + match[3].length;
} else {
rest = match[2] + match[4];
slashesCount = match[2].length;
}
} else {
if (otherSlashes) {
rest = match[3] + match[4];
slashesCount = match[3].length;
} else {
rest = match[4]
}
}
if (protocol === 'file:') {
if (slashesCount >= 2) {
rest = rest.slice(2);
}
} else if (isSpecial(protocol)) {
rest = match[4];
} else if (protocol) {
if (forwardSlashes) {
rest = rest.slice(2);
}
} else if (slashesCount >= 2 && isSpecial(location.protocol)) {
rest = match[4];
}
return {
protocol: protocol,
slashes: forwardSlashes || isSpecial(protocol),
slashesCount: slashesCount,
rest: rest
};
}
|
Extract protocol information from a URL with/without double slash ("//").
@param {String} address URL we want to extract from.
@param {Object} location
@return {ProtocolExtract} Extracted information.
@private
|
extractProtocol
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function resolve(relative, base) {
if (relative === '') return base;
var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))
, i = path.length
, last = path[i - 1]
, unshift = false
, up = 0;
while (i--) {
if (path[i] === '.') {
path.splice(i, 1);
} else if (path[i] === '..') {
path.splice(i, 1);
up++;
} else if (up) {
if (i === 0) unshift = true;
path.splice(i, 1);
up--;
}
}
if (unshift) path.unshift('');
if (last === '.' || last === '..') path.push('');
return path.join('/');
}
|
Resolve a relative URL pathname against a base URL pathname.
@param {String} relative Pathname of the relative URL.
@param {String} base Pathname of the base URL.
@return {String} Resolved pathname.
@private
|
resolve
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function Url(address, location, parser) {
address = trimLeft(address);
address = address.replace(CRHTLF, '');
if (!(this instanceof Url)) {
return new Url(address, location, parser);
}
var relative, extracted, parse, instruction, index, key
, instructions = rules.slice()
, type = typeof location
, url = this
, i = 0;
//
// The following if statements allows this module two have compatibility with
// 2 different API:
//
// 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments
// where the boolean indicates that the query string should also be parsed.
//
// 2. The `URL` interface of the browser which accepts a URL, object as
// arguments. The supplied object will be used as default values / fall-back
// for relative paths.
//
if ('object' !== type && 'string' !== type) {
parser = location;
location = null;
}
if (parser && 'function' !== typeof parser) parser = qs.parse;
location = lolcation(location);
//
// Extract protocol information before running the instructions.
//
extracted = extractProtocol(address || '', location);
relative = !extracted.protocol && !extracted.slashes;
url.slashes = extracted.slashes || relative && location.slashes;
url.protocol = extracted.protocol || location.protocol || '';
address = extracted.rest;
//
// When the authority component is absent the URL starts with a path
// component.
//
if (
extracted.protocol === 'file:' && (
extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||
(!extracted.slashes &&
(extracted.protocol ||
extracted.slashesCount < 2 ||
!isSpecial(url.protocol)))
) {
instructions[3] = [/(.*)/, 'pathname'];
}
for (; i < instructions.length; i++) {
instruction = instructions[i];
if (typeof instruction === 'function') {
address = instruction(address, url);
continue;
}
parse = instruction[0];
key = instruction[1];
if (parse !== parse) {
url[key] = address;
} else if ('string' === typeof parse) {
index = parse === '@'
? address.lastIndexOf(parse)
: address.indexOf(parse);
if (~index) {
if ('number' === typeof instruction[2]) {
url[key] = address.slice(0, index);
address = address.slice(index + instruction[2]);
} else {
url[key] = address.slice(index);
address = address.slice(0, index);
}
}
} else if ((index = parse.exec(address))) {
url[key] = index[1];
address = address.slice(0, index.index);
}
url[key] = url[key] || (
relative && instruction[3] ? location[key] || '' : ''
);
//
// Hostname, host and protocol should be lowercased so they can be used to
// create a proper `origin`.
//
if (instruction[4]) url[key] = url[key].toLowerCase();
}
//
// Also parse the supplied query string in to an object. If we're supplied
// with a custom parser as function use that instead of the default build-in
// parser.
//
if (parser) url.query = parser(url.query);
//
// If the URL is relative, resolve the pathname against the base URL.
//
if (
relative
&& location.slashes
&& url.pathname.charAt(0) !== '/'
&& (url.pathname !== '' || location.pathname !== '')
) {
url.pathname = resolve(url.pathname, location.pathname);
}
//
// Default to a / for pathname if none exists. This normalizes the URL
// to always have a /
//
if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {
url.pathname = '/' + url.pathname;
}
//
// We should not add port numbers if they are already the default port number
// for a given protocol. As the host also contains the port number we're going
// override it with the hostname which contains no port number.
//
if (!required(url.port, url.protocol)) {
url.host = url.hostname;
url.port = '';
}
//
// Parse down the `auth` for the username and password.
//
url.username = url.password = '';
if (url.auth) {
index = url.auth.indexOf(':');
if (~index) {
url.username = url.auth.slice(0, index);
url.username = encodeURIComponent(decodeURIComponent(url.username));
url.password = url.auth.slice(index + 1);
url.password = encodeURIComponent(decodeURIComponent(url.password))
} else {
url.username = encodeURIComponent(decodeURIComponent(url.auth));
}
url.auth = url.password ? url.username +':'+ url.password : url.username;
}
url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host
? url.protocol +'//'+ url.host
: 'null';
//
// The href is just the compiled result.
//
url.href = url.toString();
}
|
The actual URL instance. Instead of returning an object we've opted-in to
create an actual constructor as it's much more memory efficient and
faster and it pleases my OCD.
It is worth noting that we should not use `URL` as class name to prevent
clashes with the global URL instance that got introduced in browsers.
@constructor
@param {String} address URL we want to parse.
@param {Object|String} [location] Location defaults for relative paths.
@param {Boolean|Function} [parser] Parser for the query string.
@private
|
Url
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function set(part, value, fn) {
var url = this;
switch (part) {
case 'query':
if ('string' === typeof value && value.length) {
value = (fn || qs.parse)(value);
}
url[part] = value;
break;
case 'port':
url[part] = value;
if (!required(value, url.protocol)) {
url.host = url.hostname;
url[part] = '';
} else if (value) {
url.host = url.hostname +':'+ value;
}
break;
case 'hostname':
url[part] = value;
if (url.port) value += ':'+ url.port;
url.host = value;
break;
case 'host':
url[part] = value;
if (port.test(value)) {
value = value.split(':');
url.port = value.pop();
url.hostname = value.join(':');
} else {
url.hostname = value;
url.port = '';
}
break;
case 'protocol':
url.protocol = value.toLowerCase();
url.slashes = !fn;
break;
case 'pathname':
case 'hash':
if (value) {
var char = part === 'pathname' ? '/' : '#';
url[part] = value.charAt(0) !== char ? char + value : value;
} else {
url[part] = value;
}
break;
case 'username':
case 'password':
url[part] = encodeURIComponent(value);
break;
case 'auth':
var index = value.indexOf(':');
if (~index) {
url.username = value.slice(0, index);
url.username = encodeURIComponent(decodeURIComponent(url.username));
url.password = value.slice(index + 1);
url.password = encodeURIComponent(decodeURIComponent(url.password));
} else {
url.username = encodeURIComponent(decodeURIComponent(value));
}
}
for (var i = 0; i < rules.length; i++) {
var ins = rules[i];
if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
}
url.auth = url.password ? url.username +':'+ url.password : url.username;
url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host
? url.protocol +'//'+ url.host
: 'null';
url.href = url.toString();
return url;
}
|
This is convenience method for changing properties in the URL instance to
insure that they all propagate correctly.
@param {String} part Property we need to adjust.
@param {Mixed} value The newly assigned value.
@param {Boolean|Function} fn When setting the query, it will be the function
used to parse the query.
When setting the protocol, double slash will be
removed from the final url if it is true.
@returns {URL} URL instance for chaining.
@public
|
set
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function toString(stringify) {
if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;
var query
, url = this
, host = url.host
, protocol = url.protocol;
if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
var result =
protocol +
((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');
if (url.username) {
result += url.username;
if (url.password) result += ':'+ url.password;
result += '@';
} else if (url.password) {
result += ':'+ url.password;
result += '@';
} else if (
url.protocol !== 'file:' &&
isSpecial(url.protocol) &&
!host &&
url.pathname !== '/'
) {
//
// Add back the empty userinfo, otherwise the original invalid URL
// might be transformed into a valid one with `url.pathname` as host.
//
result += '@';
}
//
// Trailing colon is removed from `url.host` when it is parsed. If it still
// ends with a colon, then add back the trailing colon that was removed. This
// prevents an invalid URL from being transformed into a valid one.
//
if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {
host += ':';
}
result += host + url.pathname;
query = 'object' === typeof url.query ? stringify(url.query) : url.query;
if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;
if (url.hash) result += url.hash;
return result;
}
|
Transform the properties back in to a valid and full URL string.
@param {Function} stringify Optional query stringify function.
@returns {String} Compiled version of the URL.
@public
|
toString
|
javascript
|
sockjs/sockjs-client
|
dist/sockjs.js
|
https://github.com/sockjs/sockjs-client/blob/master/dist/sockjs.js
|
MIT
|
function require(name){
if (cache[name]) return cache[name].exports;
if (modules[name]) return call(name, require);
throw new Error('cannot find module "' + name + '"');
}
|
Require `name`.
@param {String} name
@api public
|
require
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function call(id, require){
var m = cache[id] = { exports: {} };
var mod = modules[id];
var name = mod[2];
var fn = mod[0];
var threw = true;
try {
fn.call(m.exports, function(req){
var dep = modules[id][1][req];
return require(dep || req);
}, m, m.exports, outer, modules, cache, entries);
threw = false;
} finally {
if (threw) {
delete cache[id];
} else if (name) {
// expose as 'name'.
cache[name] = cache[id];
}
}
return cache[id].exports;
}
|
Call module `id` and cache it.
@param {Number} id
@param {Function} require
@return {Function}
@api private
|
call
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function Facade (obj) {
obj = clone(obj);
if (!obj.hasOwnProperty('timestamp')) obj.timestamp = new Date();
else obj.timestamp = newDate(obj.timestamp);
traverse(obj);
this.obj = obj;
}
|
Initialize a new `Facade` with an `obj` of arguments.
@param {Object} obj
|
Facade
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function transform(obj){
var cloned = clone(obj);
return cloned;
}
|
Return the cloned and traversed object
@param {Mixed} obj
@return {Mixed}
|
transform
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function traverse (input, strict) {
if (strict === undefined) strict = true;
if (is.object(input)) return object(input, strict);
if (is.array(input)) return array(input, strict);
return input;
}
|
Traverse an object or array, and return a clone with all ISO strings parsed
into Date objects.
@param {Object} obj
@return {Object}
|
traverse
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function object (obj, strict) {
each(obj, function (key, val) {
if (isodate.is(val, strict)) {
obj[key] = isodate.parse(val);
} else if (is.object(val) || is.array(val)) {
traverse(val, strict);
}
});
return obj;
}
|
Object traverser.
@param {Object} obj
@param {Boolean} strict
@return {Object}
|
object
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function array (arr, strict) {
each(arr, function (val, x) {
if (is.object(val)) {
traverse(val, strict);
} else if (isodate.is(val, strict)) {
arr[x] = isodate.parse(val);
}
});
return arr;
}
|
Array traverser.
@param {Array} arr
@param {Boolean} strict
@return {Array}
|
array
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function generate (type) {
return function (value) {
return type === typeOf(value);
};
}
|
Generate a type checker.
@param {String} type
@return {Function}
|
generate
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function isEmpty (val) {
if (null == val) return true;
if ('number' == typeof val) return 0 === val;
if (undefined !== val.length) return 0 === val.length;
for (var key in val) if (has.call(val, key)) return false;
return true;
}
|
Test whether a value is "empty".
@param {Mixed} val
@return {Boolean}
|
isEmpty
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function string(obj, fn) {
for (var i = 0; i < obj.length; ++i) {
fn(obj.charAt(i), i);
}
}
|
Iterate string chars.
@param {String} obj
@param {Function} fn
@api private
|
string
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function object(obj, fn) {
for (var key in obj) {
if (has.call(obj, key)) {
fn(key, obj[key]);
}
}
}
|
Iterate object keys.
@param {Object} obj
@param {Function} fn
@api private
|
object
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function array(obj, fn) {
for (var i = 0; i < obj.length; ++i) {
fn(obj[i], i);
}
}
|
Iterate array-ish.
@param {Array|Object} obj
@param {Function} fn
@api private
|
array
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function trait(a, b){
return function(){
var traits = this.traits();
var props = this.properties ? this.properties() : {};
return get(traits, 'address.' + a)
|| get(traits, a)
|| (b ? get(traits, 'address.' + b) : null)
|| (b ? get(traits, b) : null)
|| get(props, 'address.' + a)
|| get(props, a)
|| (b ? get(props, 'address.' + b) : null)
|| (b ? get(props, b) : null);
};
}
|
Add address getters to `proto`.
@param {Function} proto
|
trait
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function multiple (fn) {
return function (obj, path, val, options) {
var normalize = options && isFunction(options.normalizer) ? options.normalizer : defaultNormalize;
path = normalize(path);
var key;
var finished = false;
while (!finished) loop();
function loop() {
for (key in obj) {
var normalizedKey = normalize(key);
if (0 === path.indexOf(normalizedKey)) {
var temp = path.substr(normalizedKey.length);
if (temp.charAt(0) === '.' || temp.length === 0) {
path = temp.substr(1);
var child = obj[key];
// we're at the end and there is nothing.
if (null == child) {
finished = true;
return;
}
// we're at the end and there is something.
if (!path.length) {
finished = true;
return;
}
// step into child
obj = child;
// but we're done here
return;
}
}
}
key = undefined;
// if we found no matching properties
// on the current object, there's no match.
finished = true;
}
if (!key) return;
if (null == obj) return obj;
// the `obj` and `key` is one above the leaf object and key, so
// start object: { a: { 'b.c': 10 } }
// end object: { 'b.c': 10 }
// end key: 'b.c'
// this way, you can do `obj[key]` and get `10`.
return fn(obj, key, val);
};
}
|
Compose applying the function to a nested key
|
multiple
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function loop() {
for (key in obj) {
var normalizedKey = normalize(key);
if (0 === path.indexOf(normalizedKey)) {
var temp = path.substr(normalizedKey.length);
if (temp.charAt(0) === '.' || temp.length === 0) {
path = temp.substr(1);
var child = obj[key];
// we're at the end and there is nothing.
if (null == child) {
finished = true;
return;
}
// we're at the end and there is something.
if (!path.length) {
finished = true;
return;
}
// step into child
obj = child;
// but we're done here
return;
}
}
}
key = undefined;
// if we found no matching properties
// on the current object, there's no match.
finished = true;
}
|
Compose applying the function to a nested key
|
loop
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function find (obj, key) {
if (obj.hasOwnProperty(key)) return obj[key];
}
|
Find an object by its key
find({ first_name : 'Calvin' }, 'firstName')
|
find
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function del (obj, key) {
if (obj.hasOwnProperty(key)) delete obj[key];
return obj;
}
|
Delete a value for a given key
del({ a : 'b', x : 'y' }, 'X' }) -> { a : 'b' }
|
del
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function replace (obj, key, val) {
if (obj.hasOwnProperty(key)) obj[key] = val;
return obj;
}
|
Replace an objects existing value with a new one
replace({ a : 'b' }, 'a', 'c') -> { a : 'c' }
|
replace
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function defaultNormalize(path) {
return path.replace(/[^a-zA-Z0-9\.]+/g, '').toLowerCase();
}
|
Normalize a `dot.separated.path`.
A.HELL(!*&#(!)O_WOR LD.bar => ahelloworldbar
@param {String} path
@return {String}
|
defaultNormalize
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
function isFunction(val) {
return typeof val === 'function';
}
|
Check if a value is a function.
@param {*} val
@return {boolean} Returns `true` if `val` is a function, otherwise `false`.
|
isFunction
|
javascript
|
segmentio/analytics.js
|
analytics.js
|
https://github.com/segmentio/analytics.js/blob/master/analytics.js
|
MIT
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.