Skip to content

Instantly share code, notes, and snippets.

@1wheel
Last active September 13, 2017 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1wheel/92d8c55e7abff93eaf2236b058440eef to your computer and use it in GitHub Desktop.
Save 1wheel/92d8c55e7abff93eaf2236b058440eef to your computer and use it in GitHub Desktop.
regl-hot-server

regl with hot-server. Adapted from a rreusser demo.

Run with yarn && yarn run start. Edit script.js and the page will update without a full reload.

Dumping all the loaded libraries into global variables isn't particularly pretty. But it is way easier to see how your edits changed the page without the interrupting flash of white from reloading.

glslify could be better - not sure how to change the default function name.

console.clear()
window.regl ? run(null, regl) : reglLib({onDone: run})
function randomWalk(n){
var current = 0
var s = 1/Math.sqrt(n)
var length = Math.floor(1/s)*2
return function(i){
var x = i % length
current = x ? current + (Math.random() - .5)*3 : 0
return [(x - length/2)*s, current*s, i]
}
}
function run (err, regl) {
window.regl = regl
let n = 100000
datasets = []
let colorBasis
let datasetPtr = 0
let pointRadius = 2
let lastSwitchTime = 0
let switchInterval = 1
let switchDuration = 1
const createDatasets = () => {
// This is a cute little pattern that *either* creates a buffer or updates
// the existing buffer since both the constructor and the current instance
// can be called as a function.
datasets = [randomWalk, randomWalk, randomWalk, randomWalk, randomWalk].map((func, i) =>
(datasets[i] || regl.buffer)(vectorFill(ndarray([], [n, 2]), func(n)))
)
// This is just a list from 1 to 0 for coloring:
colorBasis = (colorBasis || regl.buffer)(linspace(ndarray([], [n]), 1, 0))
}
// Initialize:
createDatasets()
const drawPoints = regl({
vert: `
precision mediump float;
attribute vec2 xy0, xy1;
attribute float basis;
varying float t;
uniform float aspect, interp, radius;
void main () {
t = basis;
// Interpolate between the two positions:
// float s = clamp(interp*2.0 + t -1.0, 0, 1);
// float s = clamp(interp*2.0 + t -1.0, 0, 1);
vec2 pos = mix(xy0, xy1, interp);
gl_Position = vec4(pos.x, pos.y * aspect, 0, 1);
gl_PointSize = radius;
}
`,
frag: `
precision mediump float;
${glslViridis}
varying float t;
void main () {
gl_FragColor = viridis(t);
// gl_FragColor = vec4(t, t, 0, 1);
}
`,
depth: {enable: false},
attributes: {
// Pass two buffers between which we ease in the vertex shader:
xy0: () => datasets[datasetPtr % datasets.length],
xy1: () => datasets[(datasetPtr + 1) % datasets.length],
basis: () => colorBasis
},
uniforms: {
radius: () => pointRadius,
aspect: ctx => ctx.viewportWidth / ctx.viewportHeight,
// The current interpolation position, from 0 to 1:
interp: (ctx, props) => Math.max(0, Math.min(1, props.interp))
},
primitive: 'point',
count: () => n
})
if (window.regltick) window.regltick.cancel()
window.regltick = regl.frame(({time}) => {
// Check how long it's been since the last switch, and cycle the buffers
// and reset the timer if it's time for a switch:
if ((time - lastSwitchTime) > switchInterval) {
lastSwitchTime = time
datasetPtr++
}
drawPoints({interp: ease((time - lastSwitchTime) / switchDuration)})
})
}
<!DOCTYPE html>
<html>
<head>
<body></body>
<script src='lib-build.js'></script>
<script src='_script.js'></script>
</html>
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var libs = {
glsl: require('glslify'),
linspace: require('ndarray-linspace'),
vectorFill: require('ndarray-vector-fill'),
ndarray: require('ndarray'),
ease: require('eases/cubic-in-out'),
reglLib: require('regl'),
}
var glsl = require('glslify')
libs.glslViridis = glsl(["#define GLSLIFY 1\nvec4 viridis (float x) {\n const float e0 = 0.0;\n const vec4 v0 = vec4(0.26666666666666666,0.00392156862745098,0.32941176470588235,1);\n const float e1 = 0.13;\n const vec4 v1 = vec4(0.2784313725490196,0.17254901960784313,0.47843137254901963,1);\n const float e2 = 0.25;\n const vec4 v2 = vec4(0.23137254901960785,0.3176470588235294,0.5450980392156862,1);\n const float e3 = 0.38;\n const vec4 v3 = vec4(0.17254901960784313,0.44313725490196076,0.5568627450980392,1);\n const float e4 = 0.5;\n const vec4 v4 = vec4(0.12941176470588237,0.5647058823529412,0.5529411764705883,1);\n const float e5 = 0.63;\n const vec4 v5 = vec4(0.15294117647058825,0.6784313725490196,0.5058823529411764,1);\n const float e6 = 0.75;\n const vec4 v6 = vec4(0.3607843137254902,0.7843137254901961,0.38823529411764707,1);\n const float e7 = 0.88;\n const vec4 v7 = vec4(0.6666666666666666,0.8627450980392157,0.19607843137254902,1);\n const float e8 = 1.0;\n const vec4 v8 = vec4(0.9921568627450981,0.9058823529411765,0.1450980392156863,1);\n float a0 = smoothstep(e0,e1,x);\n float a1 = smoothstep(e1,e2,x);\n float a2 = smoothstep(e2,e3,x);\n float a3 = smoothstep(e3,e4,x);\n float a4 = smoothstep(e4,e5,x);\n float a5 = smoothstep(e5,e6,x);\n float a6 = smoothstep(e6,e7,x);\n float a7 = smoothstep(e7,e8,x);\n return max(mix(v0,v1,a0)*step(e0,x)*step(x,e1),\n max(mix(v1,v2,a1)*step(e1,x)*step(x,e2),\n max(mix(v2,v3,a2)*step(e2,x)*step(x,e3),\n max(mix(v3,v4,a3)*step(e3,x)*step(x,e4),\n max(mix(v4,v5,a4)*step(e4,x)*step(x,e5),\n max(mix(v5,v6,a5)*step(e5,x)*step(x,e6),\n max(mix(v6,v7,a6)*step(e6,x)*step(x,e7),mix(v7,v8,a7)*step(e7,x)*step(x,e8)\n )))))));\n}\n\n",""])
for (key in libs) window[key] = libs[key]
},{"eases/cubic-in-out":8,"glslify":10,"ndarray":17,"ndarray-linspace":15,"ndarray-vector-fill":16,"regl":18}],2:[function(require,module,exports){
"use strict"
var createThunk = require("./lib/thunk.js")
function Procedure() {
this.argTypes = []
this.shimArgs = []
this.arrayArgs = []
this.arrayBlockIndices = []
this.scalarArgs = []
this.offsetArgs = []
this.offsetArgIndex = []
this.indexArgs = []
this.shapeArgs = []
this.funcName = ""
this.pre = null
this.body = null
this.post = null
this.debug = false
}
function compileCwise(user_args) {
//Create procedure
var proc = new Procedure()
//Parse blocks
proc.pre = user_args.pre
proc.body = user_args.body
proc.post = user_args.post
//Parse arguments
var proc_args = user_args.args.slice(0)
proc.argTypes = proc_args
for(var i=0; i<proc_args.length; ++i) {
var arg_type = proc_args[i]
if(arg_type === "array" || (typeof arg_type === "object" && arg_type.blockIndices)) {
proc.argTypes[i] = "array"
proc.arrayArgs.push(i)
proc.arrayBlockIndices.push(arg_type.blockIndices ? arg_type.blockIndices : 0)
proc.shimArgs.push("array" + i)
if(i < proc.pre.args.length && proc.pre.args[i].count>0) {
throw new Error("cwise: pre() block may not reference array args")
}
if(i < proc.post.args.length && proc.post.args[i].count>0) {
throw new Error("cwise: post() block may not reference array args")
}
} else if(arg_type === "scalar") {
proc.scalarArgs.push(i)
proc.shimArgs.push("scalar" + i)
} else if(arg_type === "index") {
proc.indexArgs.push(i)
if(i < proc.pre.args.length && proc.pre.args[i].count > 0) {
throw new Error("cwise: pre() block may not reference array index")
}
if(i < proc.body.args.length && proc.body.args[i].lvalue) {
throw new Error("cwise: body() block may not write to array index")
}
if(i < proc.post.args.length && proc.post.args[i].count > 0) {
throw new Error("cwise: post() block may not reference array index")
}
} else if(arg_type === "shape") {
proc.shapeArgs.push(i)
if(i < proc.pre.args.length && proc.pre.args[i].lvalue) {
throw new Error("cwise: pre() block may not write to array shape")
}
if(i < proc.body.args.length && proc.body.args[i].lvalue) {
throw new Error("cwise: body() block may not write to array shape")
}
if(i < proc.post.args.length && proc.post.args[i].lvalue) {
throw new Error("cwise: post() block may not write to array shape")
}
} else if(typeof arg_type === "object" && arg_type.offset) {
proc.argTypes[i] = "offset"
proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset })
proc.offsetArgIndex.push(i)
} else {
throw new Error("cwise: Unknown argument type " + proc_args[i])
}
}
//Make sure at least one array argument was specified
if(proc.arrayArgs.length <= 0) {
throw new Error("cwise: No array arguments specified")
}
//Make sure arguments are correct
if(proc.pre.args.length > proc_args.length) {
throw new Error("cwise: Too many arguments in pre() block")
}
if(proc.body.args.length > proc_args.length) {
throw new Error("cwise: Too many arguments in body() block")
}
if(proc.post.args.length > proc_args.length) {
throw new Error("cwise: Too many arguments in post() block")
}
//Check debug flag
proc.debug = !!user_args.printCode || !!user_args.debug
//Retrieve name
proc.funcName = user_args.funcName || "cwise"
//Read in block size
proc.blockSize = user_args.blockSize || 64
return createThunk(proc)
}
module.exports = compileCwise
},{"./lib/thunk.js":4}],3:[function(require,module,exports){
"use strict"
var uniq = require("uniq")
// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index)
// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of "pointers" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments.
function innerFill(order, proc, body) {
var dimension = order.length
, nargs = proc.arrayArgs.length
, has_index = proc.indexArgs.length>0
, code = []
, vars = []
, idx=0, pidx=0, i, j
for(i=0; i<dimension; ++i) { // Iteration variables
vars.push(["i",i,"=0"].join(""))
}
//Compute scan deltas
for(j=0; j<nargs; ++j) {
for(i=0; i<dimension; ++i) {
pidx = idx
idx = order[i]
if(i === 0) { // The innermost/fastest dimension's delta is simply its stride
vars.push(["d",j,"s",i,"=t",j,"p",idx].join(""))
} else { // For other dimensions the delta is basically the stride minus something which essentially "rewinds" the previous (more inner) dimension
vars.push(["d",j,"s",i,"=(t",j,"p",idx,"-s",pidx,"*t",j,"p",pidx,")"].join(""))
}
}
}
code.push("var " + vars.join(","))
//Scan loop
for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards
idx = order[i]
code.push(["for(i",i,"=0;i",i,"<s",idx,";++i",i,"){"].join(""))
}
//Push body of inner loop
code.push(body)
//Advance scan pointers
for(i=0; i<dimension; ++i) {
pidx = idx
idx = order[i]
for(j=0; j<nargs; ++j) {
code.push(["p",j,"+=d",j,"s",i].join(""))
}
if(has_index) {
if(i > 0) {
code.push(["index[",pidx,"]-=s",pidx].join(""))
}
code.push(["++index[",idx,"]"].join(""))
}
code.push("}")
}
return code.join("\n")
}
// Generate "outer" loops that loop over blocks of data, applying "inner" loops to the blocks by manipulating the local variables in such a way that the inner loop only "sees" the current block.
// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary.
// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and "shape" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used.
function outerFill(matched, order, proc, body) {
var dimension = order.length
, nargs = proc.arrayArgs.length
, blockSize = proc.blockSize
, has_index = proc.indexArgs.length > 0
, code = []
for(var i=0; i<nargs; ++i) {
code.push(["var offset",i,"=p",i].join(""))
}
//Generate loops for unmatched dimensions
// The order in which these dimensions are traversed is fairly arbitrary (from small stride to large stride, for the first argument)
// TODO: It would be nice if the order in which these loops are placed would also be somehow "optimal" (at the very least we should check that it really doesn't hurt us if they're not).
for(var i=matched; i<dimension; ++i) {
code.push(["for(var j"+i+"=SS[", order[i], "]|0;j", i, ">0;){"].join("")) // Iterate back to front
code.push(["if(j",i,"<",blockSize,"){"].join("")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j).
code.push(["s",order[i],"=j",i].join(""))
code.push(["j",i,"=0"].join(""))
code.push(["}else{s",order[i],"=",blockSize].join(""))
code.push(["j",i,"-=",blockSize,"}"].join(""))
if(has_index) {
code.push(["index[",order[i],"]=j",i].join(""))
}
}
for(var i=0; i<nargs; ++i) {
var indexStr = ["offset"+i]
for(var j=matched; j<dimension; ++j) {
indexStr.push(["j",j,"*t",i,"p",order[j]].join(""))
}
code.push(["p",i,"=(",indexStr.join("+"),")"].join(""))
}
code.push(innerFill(order, proc, body))
for(var i=matched; i<dimension; ++i) {
code.push("}")
}
return code.join("\n")
}
//Count the number of compatible inner orders
// This is the length of the longest common prefix of the arrays in orders.
// Each array in orders lists the dimensions of the correspond ndarray in order of increasing stride.
// This is thus the maximum number of dimensions that can be efficiently traversed by simple nested loops for all arrays.
function countMatches(orders) {
var matched = 0, dimension = orders[0].length
while(matched < dimension) {
for(var j=1; j<orders.length; ++j) {
if(orders[j][matched] !== orders[0][matched]) {
return matched
}
}
++matched
}
return matched
}
//Processes a block according to the given data types
// Replaces variable names by different ones, either "local" ones (that are then ferried in and out of the given array) or ones matching the arguments that the function performing the ultimate loop will accept.
function processBlock(block, proc, dtypes) {
var code = block.body
var pre = []
var post = []
for(var i=0; i<block.args.length; ++i) {
var carg = block.args[i]
if(carg.count <= 0) {
continue
}
var re = new RegExp(carg.name, "g")
var ptrStr = ""
var arrNum = proc.arrayArgs.indexOf(i)
switch(proc.argTypes[i]) {
case "offset":
var offArgIndex = proc.offsetArgIndex.indexOf(i)
var offArg = proc.offsetArgs[offArgIndex]
arrNum = offArg.array
ptrStr = "+q" + offArgIndex // Adds offset to the "pointer" in the array
case "array":
ptrStr = "p" + arrNum + ptrStr
var localStr = "l" + i
var arrStr = "a" + arrNum
if (proc.arrayBlockIndices[arrNum] === 0) { // Argument to body is just a single value from this array
if(carg.count === 1) { // Argument/array used only once(?)
if(dtypes[arrNum] === "generic") {
if(carg.lvalue) {
pre.push(["var ", localStr, "=", arrStr, ".get(", ptrStr, ")"].join("")) // Is this necessary if the argument is ONLY used as an lvalue? (keep in mind that we can have a += something, so we would actually need to check carg.rvalue)
code = code.replace(re, localStr)
post.push([arrStr, ".set(", ptrStr, ",", localStr,")"].join(""))
} else {
code = code.replace(re, [arrStr, ".get(", ptrStr, ")"].join(""))
}
} else {
code = code.replace(re, [arrStr, "[", ptrStr, "]"].join(""))
}
} else if(dtypes[arrNum] === "generic") {
pre.push(["var ", localStr, "=", arrStr, ".get(", ptrStr, ")"].join("")) // TODO: Could we optimize by checking for carg.rvalue?
code = code.replace(re, localStr)
if(carg.lvalue) {
post.push([arrStr, ".set(", ptrStr, ",", localStr,")"].join(""))
}
} else {
pre.push(["var ", localStr, "=", arrStr, "[", ptrStr, "]"].join("")) // TODO: Could we optimize by checking for carg.rvalue?
code = code.replace(re, localStr)
if(carg.lvalue) {
post.push([arrStr, "[", ptrStr, "]=", localStr].join(""))
}
}
} else { // Argument to body is a "block"
var reStrArr = [carg.name], ptrStrArr = [ptrStr]
for(var j=0; j<Math.abs(proc.arrayBlockIndices[arrNum]); j++) {
reStrArr.push("\\s*\\[([^\\]]+)\\]")
ptrStrArr.push("$" + (j+1) + "*t" + arrNum + "b" + j) // Matched index times stride
}
re = new RegExp(reStrArr.join(""), "g")
ptrStr = ptrStrArr.join("+")
if(dtypes[arrNum] === "generic") {
/*if(carg.lvalue) {
pre.push(["var ", localStr, "=", arrStr, ".get(", ptrStr, ")"].join("")) // Is this necessary if the argument is ONLY used as an lvalue? (keep in mind that we can have a += something, so we would actually need to check carg.rvalue)
code = code.replace(re, localStr)
post.push([arrStr, ".set(", ptrStr, ",", localStr,")"].join(""))
} else {
code = code.replace(re, [arrStr, ".get(", ptrStr, ")"].join(""))
}*/
throw new Error("cwise: Generic arrays not supported in combination with blocks!")
} else {
// This does not produce any local variables, even if variables are used multiple times. It would be possible to do so, but it would complicate things quite a bit.
code = code.replace(re, [arrStr, "[", ptrStr, "]"].join(""))
}
}
break
case "scalar":
code = code.replace(re, "Y" + proc.scalarArgs.indexOf(i))
break
case "index":
code = code.replace(re, "index")
break
case "shape":
code = code.replace(re, "shape")
break
}
}
return [pre.join("\n"), code, post.join("\n")].join("\n").trim()
}
function typeSummary(dtypes) {
var summary = new Array(dtypes.length)
var allEqual = true
for(var i=0; i<dtypes.length; ++i) {
var t = dtypes[i]
var digits = t.match(/\d+/)
if(!digits) {
digits = ""
} else {
digits = digits[0]
}
if(t.charAt(0) === 0) {
summary[i] = "u" + t.charAt(1) + digits
} else {
summary[i] = t.charAt(0) + digits
}
if(i > 0) {
allEqual = allEqual && summary[i] === summary[i-1]
}
}
if(allEqual) {
return summary[0]
}
return summary.join("")
}
//Generates a cwise operator
function generateCWiseOp(proc, typesig) {
//Compute dimension
// Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg.
var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0
var orders = new Array(proc.arrayArgs.length)
var dtypes = new Array(proc.arrayArgs.length)
for(var i=0; i<proc.arrayArgs.length; ++i) {
dtypes[i] = typesig[2*i]
orders[i] = typesig[2*i+1]
}
//Determine where block and loop indices start and end
var blockBegin = [], blockEnd = [] // These indices are exposed as blocks
var loopBegin = [], loopEnd = [] // These indices are iterated over
var loopOrders = [] // orders restricted to the loop indices
for(var i=0; i<proc.arrayArgs.length; ++i) {
if (proc.arrayBlockIndices[i]<0) {
loopBegin.push(0)
loopEnd.push(dimension)
blockBegin.push(dimension)
blockEnd.push(dimension+proc.arrayBlockIndices[i])
} else {
loopBegin.push(proc.arrayBlockIndices[i]) // Non-negative
loopEnd.push(proc.arrayBlockIndices[i]+dimension)
blockBegin.push(0)
blockEnd.push(proc.arrayBlockIndices[i])
}
var newOrder = []
for(var j=0; j<orders[i].length; j++) {
if (loopBegin[i]<=orders[i][j] && orders[i][j]<loopEnd[i]) {
newOrder.push(orders[i][j]-loopBegin[i]) // If this is a loop index, put it in newOrder, subtracting loopBegin, to make sure that all loopOrders are using a common set of indices.
}
}
loopOrders.push(newOrder)
}
//First create arguments for procedure
var arglist = ["SS"] // SS is the overall shape over which we iterate
var code = ["'use strict'"]
var vars = []
for(var j=0; j<dimension; ++j) {
vars.push(["s", j, "=SS[", j, "]"].join("")) // The limits for each dimension.
}
for(var i=0; i<proc.arrayArgs.length; ++i) {
arglist.push("a"+i) // Actual data array
arglist.push("t"+i) // Strides
arglist.push("p"+i) // Offset in the array at which the data starts (also used for iterating over the data)
for(var j=0; j<dimension; ++j) { // Unpack the strides into vars for looping
vars.push(["t",i,"p",j,"=t",i,"[",loopBegin[i]+j,"]"].join(""))
}
for(var j=0; j<Math.abs(proc.arrayBlockIndices[i]); ++j) { // Unpack the strides into vars for block iteration
vars.push(["t",i,"b",j,"=t",i,"[",blockBegin[i]+j,"]"].join(""))
}
}
for(var i=0; i<proc.scalarArgs.length; ++i) {
arglist.push("Y" + i)
}
if(proc.shapeArgs.length > 0) {
vars.push("shape=SS.slice(0)") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example)
}
if(proc.indexArgs.length > 0) {
// Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes.
var zeros = new Array(dimension)
for(var i=0; i<dimension; ++i) {
zeros[i] = "0"
}
vars.push(["index=[", zeros.join(","), "]"].join(""))
}
for(var i=0; i<proc.offsetArgs.length; ++i) { // Offset arguments used for stencil operations
var off_arg = proc.offsetArgs[i]
var init_string = []
for(var j=0; j<off_arg.offset.length; ++j) {
if(off_arg.offset[j] === 0) {
continue
} else if(off_arg.offset[j] === 1) {
init_string.push(["t", off_arg.array, "p", j].join(""))
} else {
init_string.push([off_arg.offset[j], "*t", off_arg.array, "p", j].join(""))
}
}
if(init_string.length === 0) {
vars.push("q" + i + "=0")
} else {
vars.push(["q", i, "=", init_string.join("+")].join(""))
}
}
//Prepare this variables
var thisVars = uniq([].concat(proc.pre.thisVars)
.concat(proc.body.thisVars)
.concat(proc.post.thisVars))
vars = vars.concat(thisVars)
code.push("var " + vars.join(","))
for(var i=0; i<proc.arrayArgs.length; ++i) {
code.push("p"+i+"|=0")
}
//Inline prelude
if(proc.pre.body.length > 3) {
code.push(processBlock(proc.pre, proc, dtypes))
}
//Process body
var body = processBlock(proc.body, proc, dtypes)
var matched = countMatches(loopOrders)
if(matched < dimension) {
code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example.
} else {
code.push(innerFill(loopOrders[0], proc, body))
}
//Inline epilog
if(proc.post.body.length > 3) {
code.push(processBlock(proc.post, proc, dtypes))
}
if(proc.debug) {
console.log("-----Generated cwise routine for ", typesig, ":\n" + code.join("\n") + "\n----------")
}
var loopName = [(proc.funcName||"unnamed"), "_cwise_loop_", orders[0].join("s"),"m",matched,typeSummary(dtypes)].join("")
var f = new Function(["function ",loopName,"(", arglist.join(","),"){", code.join("\n"),"} return ", loopName].join(""))
return f()
}
module.exports = generateCWiseOp
},{"uniq":19}],4:[function(require,module,exports){
"use strict"
// The function below is called when constructing a cwise function object, and does the following:
// A function object is constructed which accepts as argument a compilation function and returns another function.
// It is this other function that is eventually returned by createThunk, and this function is the one that actually
// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed.
// The compilation passed to the first function object is used for compiling new functions.
// Once this function object is created, it is called with compile as argument, where the first argument of compile
// is bound to "proc" (essentially containing a preprocessed version of the user arguments to cwise).
// So createThunk roughly works like this:
// function createThunk(proc) {
// var thunk = function(compileBound) {
// var CACHED = {}
// return function(arrays and scalars) {
// if (dtype and order of arrays in CACHED) {
// var func = CACHED[dtype and order of arrays]
// } else {
// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays)
// }
// return func(arrays and scalars)
// }
// }
// return thunk(compile.bind1(proc))
// }
var compile = require("./compile.js")
function createThunk(proc) {
var code = ["'use strict'", "var CACHED={}"]
var vars = []
var thunkName = proc.funcName + "_cwise_thunk"
//Build thunk
code.push(["return function ", thunkName, "(", proc.shimArgs.join(","), "){"].join(""))
var typesig = []
var string_typesig = []
var proc_args = [["array",proc.arrayArgs[0],".shape.slice(", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS).
Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(","+proc.arrayBlockIndices[0]+")"):")"].join("")]
var shapeLengthConditions = [], shapeConditions = []
// Process array arguments
for(var i=0; i<proc.arrayArgs.length; ++i) {
var j = proc.arrayArgs[i]
vars.push(["t", j, "=array", j, ".dtype,",
"r", j, "=array", j, ".order"].join(""))
typesig.push("t" + j)
typesig.push("r" + j)
string_typesig.push("t"+j)
string_typesig.push("r"+j+".join()")
proc_args.push("array" + j + ".data")
proc_args.push("array" + j + ".stride")
proc_args.push("array" + j + ".offset|0")
if (i>0) { // Gather conditions to check for shape equality (ignoring block indices)
shapeLengthConditions.push("array" + proc.arrayArgs[0] + ".shape.length===array" + j + ".shape.length+" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i])))
shapeConditions.push("array" + proc.arrayArgs[0] + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[0]) + "]===array" + j + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[i]) + "]")
}
}
// Check for shape equality
if (proc.arrayArgs.length > 1) {
code.push("if (!(" + shapeLengthConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same dimensionality!')")
code.push("for(var shapeIndex=array" + proc.arrayArgs[0] + ".shape.length-" + Math.abs(proc.arrayBlockIndices[0]) + "; shapeIndex-->0;) {")
code.push("if (!(" + shapeConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same shape!')")
code.push("}")
}
// Process scalar arguments
for(var i=0; i<proc.scalarArgs.length; ++i) {
proc_args.push("scalar" + proc.scalarArgs[i])
}
// Check for cached function (and if not present, generate it)
vars.push(["type=[", string_typesig.join(","), "].join()"].join(""))
vars.push("proc=CACHED[type]")
code.push("var " + vars.join(","))
code.push(["if(!proc){",
"CACHED[type]=proc=compile([", typesig.join(","), "])}",
"return proc(", proc_args.join(","), ")}"].join(""))
if(proc.debug) {
console.log("-----Generated thunk:\n" + code.join("\n") + "\n----------")
}
//Compile thunk
var thunk = new Function("compile", code.join("\n"))
return thunk(compile.bind(undefined, proc))
}
module.exports = createThunk
},{"./compile.js":3}],5:[function(require,module,exports){
(function (global){
"use strict"
var esprima = require("esprima")
var uniq = require("uniq")
var PREFIX_COUNTER = 0
function CompiledArgument(name, lvalue, rvalue) {
this.name = name
this.lvalue = lvalue
this.rvalue = rvalue
this.count = 0
}
function CompiledRoutine(body, args, thisVars, localVars) {
this.body = body
this.args = args
this.thisVars = thisVars
this.localVars = localVars
}
function isGlobal(identifier) {
if(identifier === "eval") {
throw new Error("cwise-parser: eval() not allowed")
}
if(typeof window !== "undefined") {
return identifier in window
} else if(typeof global !== "undefined") {
return identifier in global
} else if(typeof self !== "undefined") {
return identifier in self
} else {
return false
}
}
function getArgNames(ast) {
var params = ast.body[0].expression.callee.params
var names = new Array(params.length)
for(var i=0; i<params.length; ++i) {
names[i] = params[i].name
}
return names
}
function preprocess(func) {
var src = ["(", func, ")()"].join("")
var ast = esprima.parse(src, { range: true })
//Compute new prefix
var prefix = "_inline_" + (PREFIX_COUNTER++) + "_"
//Parse out arguments
var argNames = getArgNames(ast)
var compiledArgs = new Array(argNames.length)
for(var i=0; i<argNames.length; ++i) {
compiledArgs[i] = new CompiledArgument([prefix, "arg", i, "_"].join(""), false, false)
}
//Create temporary data structure for source rewriting
var exploded = new Array(src.length)
for(var i=0, n=src.length; i<n; ++i) {
exploded[i] = src.charAt(i)
}
//Local variables
var localVars = []
var thisVars = []
var computedThis = false
//Retrieves a local variable
function createLocal(id) {
var nstr = prefix + id.replace(/\_/g, "__")
localVars.push(nstr)
return nstr
}
//Creates a this variable
function createThisVar(id) {
var nstr = "this_" + id.replace(/\_/g, "__")
thisVars.push(nstr)
return nstr
}
//Rewrites an ast node
function rewrite(node, nstr) {
var lo = node.range[0], hi = node.range[1]
for(var i=lo+1; i<hi; ++i) {
exploded[i] = ""
}
exploded[lo] = nstr
}
//Remove any underscores
function escapeString(str) {
return "'"+(str.replace(/\_/g, "\\_").replace(/\'/g, "\'"))+"'"
}
//Returns the source of an identifier
function source(node) {
return exploded.slice(node.range[0], node.range[1]).join("")
}
//Computes the usage of a node
var LVALUE = 1
var RVALUE = 2
function getUsage(node) {
if(node.parent.type === "AssignmentExpression") {
if(node.parent.left === node) {
if(node.parent.operator === "=") {
return LVALUE
}
return LVALUE|RVALUE
}
}
if(node.parent.type === "UpdateExpression") {
return LVALUE|RVALUE
}
return RVALUE
}
//Handle visiting a node
(function visit(node, parent) {
node.parent = parent
if(node.type === "MemberExpression") {
//Handle member expression
if(node.computed) {
visit(node.object, node)
visit(node.property, node)
} else if(node.object.type === "ThisExpression") {
rewrite(node, createThisVar(node.property.name))
} else {
visit(node.object, node)
}
} else if(node.type === "ThisExpression") {
throw new Error("cwise-parser: Computed this is not allowed")
} else if(node.type === "Identifier") {
//Handle identifier
var name = node.name
var argNo = argNames.indexOf(name)
if(argNo >= 0) {
var carg = compiledArgs[argNo]
var usage = getUsage(node)
if(usage & LVALUE) {
carg.lvalue = true
}
if(usage & RVALUE) {
carg.rvalue = true
}
++carg.count
rewrite(node, carg.name)
} else if(isGlobal(name)) {
//Don't rewrite globals
} else {
rewrite(node, createLocal(name))
}
} else if(node.type === "Literal") {
if(typeof node.value === "string") {
rewrite(node, escapeString(node.value))
}
} else if(node.type === "WithStatement") {
throw new Error("cwise-parser: with() statements not allowed")
} else {
//Visit all children
var keys = Object.keys(node)
for(var i=0, n=keys.length; i<n; ++i) {
if(keys[i] === "parent") {
continue
}
var value = node[keys[i]]
if(value) {
if(value instanceof Array) {
for(var j=0; j<value.length; ++j) {
if(value[j] && typeof value[j].type === "string") {
visit(value[j], node)
}
}
} else if(typeof value.type === "string") {
visit(value, node)
}
}
}
}
})(ast.body[0].expression.callee.body, undefined)
//Remove duplicate variables
uniq(localVars)
uniq(thisVars)
//Return body
var routine = new CompiledRoutine(source(ast.body[0].expression.callee.body), compiledArgs, thisVars, localVars)
return routine
}
module.exports = preprocess
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"esprima":9,"uniq":19}],6:[function(require,module,exports){
"use strict"
var parse = require("cwise-parser")
var compile = require("cwise-compiler")
var REQUIRED_FIELDS = [ "args", "body" ]
var OPTIONAL_FIELDS = [ "pre", "post", "printCode", "funcName", "blockSize" ]
function createCWise(user_args) {
//Check parameters
for(var id in user_args) {
if(REQUIRED_FIELDS.indexOf(id) < 0 &&
OPTIONAL_FIELDS.indexOf(id) < 0) {
console.warn("cwise: Unknown argument '"+id+"' passed to expression compiler")
}
}
for(var i=0; i<REQUIRED_FIELDS.length; ++i) {
if(!user_args[REQUIRED_FIELDS[i]]) {
throw new Error("cwise: Missing argument: " + REQUIRED_FIELDS[i])
}
}
//Parse blocks
return compile({
args: user_args.args,
pre: parse(user_args.pre || function(){}),
body: parse(user_args.body),
post: parse(user_args.post || function(){}),
debug: !!user_args.printCode,
funcName: user_args.funcName || user_args.body.name || "cwise",
blockSize: user_args.blockSize || 64
})
}
module.exports = createCWise
},{"cwise-compiler":2,"cwise-parser":5}],7:[function(require,module,exports){
module.exports = require("cwise-compiler")
},{"cwise-compiler":2}],8:[function(require,module,exports){
function cubicInOut(t) {
return t < 0.5
? 4.0 * t * t * t
: 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0
}
module.exports = cubicInOut
},{}],9:[function(require,module,exports){
/*
Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>
Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>
Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>
Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*jslint bitwise:true plusplus:true */
/*global esprima:true, define:true, exports:true, window: true,
createLocationMarker: true,
throwError: true, generateStatement: true, peek: true,
parseAssignmentExpression: true, parseBlock: true, parseExpression: true,
parseFunctionDeclaration: true, parseFunctionExpression: true,
parseFunctionSourceElements: true, parseVariableIdentifier: true,
parseLeftHandSideExpression: true,
parseUnaryExpression: true,
parseStatement: true, parseSourceElement: true */
(function (root, factory) {
'use strict';
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,
// Rhino, and plain browser loading.
if (typeof define === 'function' && define.amd) {
define(['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.esprima = {}));
}
}(this, function (exports) {
'use strict';
var Token,
TokenName,
FnExprTokens,
Syntax,
PropertyKind,
Messages,
Regex,
SyntaxTreeDelegate,
source,
strict,
index,
lineNumber,
lineStart,
length,
delegate,
lookahead,
state,
extra;
Token = {
BooleanLiteral: 1,
EOF: 2,
Identifier: 3,
Keyword: 4,
NullLiteral: 5,
NumericLiteral: 6,
Punctuator: 7,
StringLiteral: 8,
RegularExpression: 9
};
TokenName = {};
TokenName[Token.BooleanLiteral] = 'Boolean';
TokenName[Token.EOF] = '<end>';
TokenName[Token.Identifier] = 'Identifier';
TokenName[Token.Keyword] = 'Keyword';
TokenName[Token.NullLiteral] = 'Null';
TokenName[Token.NumericLiteral] = 'Numeric';
TokenName[Token.Punctuator] = 'Punctuator';
TokenName[Token.StringLiteral] = 'String';
TokenName[Token.RegularExpression] = 'RegularExpression';
// A function following one of those tokens is an expression.
FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
'return', 'case', 'delete', 'throw', 'void',
// assignment operators
'=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',
'&=', '|=', '^=', ',',
// binary/unary operators
'+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
'|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
'<=', '<', '>', '!=', '!=='];
Syntax = {
AssignmentExpression: 'AssignmentExpression',
ArrayExpression: 'ArrayExpression',
BlockStatement: 'BlockStatement',
BinaryExpression: 'BinaryExpression',
BreakStatement: 'BreakStatement',
CallExpression: 'CallExpression',
CatchClause: 'CatchClause',
ConditionalExpression: 'ConditionalExpression',
ContinueStatement: 'ContinueStatement',
DoWhileStatement: 'DoWhileStatement',
DebuggerStatement: 'DebuggerStatement',
EmptyStatement: 'EmptyStatement',
ExpressionStatement: 'ExpressionStatement',
ForStatement: 'ForStatement',
ForInStatement: 'ForInStatement',
FunctionDeclaration: 'FunctionDeclaration',
FunctionExpression: 'FunctionExpression',
Identifier: 'Identifier',
IfStatement: 'IfStatement',
Literal: 'Literal',
LabeledStatement: 'LabeledStatement',
LogicalExpression: 'LogicalExpression',
MemberExpression: 'MemberExpression',
NewExpression: 'NewExpression',
ObjectExpression: 'ObjectExpression',
Program: 'Program',
Property: 'Property',
ReturnStatement: 'ReturnStatement',
SequenceExpression: 'SequenceExpression',
SwitchStatement: 'SwitchStatement',
SwitchCase: 'SwitchCase',
ThisExpression: 'ThisExpression',
ThrowStatement: 'ThrowStatement',
TryStatement: 'TryStatement',
UnaryExpression: 'UnaryExpression',
UpdateExpression: 'UpdateExpression',
VariableDeclaration: 'VariableDeclaration',
VariableDeclarator: 'VariableDeclarator',
WhileStatement: 'WhileStatement',
WithStatement: 'WithStatement'
};
PropertyKind = {
Data: 1,
Get: 2,
Set: 4
};
// Error messages should be identical to V8.
Messages = {
UnexpectedToken: 'Unexpected token %0',
UnexpectedNumber: 'Unexpected number',
UnexpectedString: 'Unexpected string',
UnexpectedIdentifier: 'Unexpected identifier',
UnexpectedReserved: 'Unexpected reserved word',
UnexpectedEOS: 'Unexpected end of input',
NewlineAfterThrow: 'Illegal newline after throw',
InvalidRegExp: 'Invalid regular expression',
UnterminatedRegExp: 'Invalid regular expression: missing /',
InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
InvalidLHSInForIn: 'Invalid left-hand side in for-in',
MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
NoCatchOrFinally: 'Missing catch or finally after try',
UnknownLabel: 'Undefined label \'%0\'',
Redeclaration: '%0 \'%1\' has already been declared',
IllegalContinue: 'Illegal continue statement',
IllegalBreak: 'Illegal break statement',
IllegalReturn: 'Illegal return statement',
StrictModeWith: 'Strict mode code may not include a with statement',
StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
StrictVarName: 'Variable name may not be eval or arguments in strict mode',
StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
StrictDelete: 'Delete of an unqualified identifier in strict mode.',
StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',
AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',
AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',
StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
StrictReservedWord: 'Use of future reserved word in strict mode'
};
// See also tools/generate-unicode-regex.py.
Regex = {
NonAsciiIdentifierStart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'),
NonAsciiIdentifierPart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]')
};
// Ensure the condition is true, otherwise throw an error.
// This is only to have a better contract semantic, i.e. another safety net
// to catch a logic error. The condition shall be fulfilled in normal case.
// Do NOT use this to enforce a certain condition on any user input.
function assert(condition, message) {
if (!condition) {
throw new Error('ASSERT: ' + message);
}
}
function isDecimalDigit(ch) {
return (ch >= 48 && ch <= 57); // 0..9
}
function isHexDigit(ch) {
return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;
}
function isOctalDigit(ch) {
return '01234567'.indexOf(ch) >= 0;
}
// 7.2 White Space
function isWhiteSpace(ch) {
return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||
(ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);
}
// 7.3 Line Terminators
function isLineTerminator(ch) {
return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);
}
// 7.6 Identifier Names and Identifiers
function isIdentifierStart(ch) {
return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
(ch >= 0x41 && ch <= 0x5A) || // A..Z
(ch >= 0x61 && ch <= 0x7A) || // a..z
(ch === 0x5C) || // \ (backslash)
((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));
}
function isIdentifierPart(ch) {
return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
(ch >= 0x41 && ch <= 0x5A) || // A..Z
(ch >= 0x61 && ch <= 0x7A) || // a..z
(ch >= 0x30 && ch <= 0x39) || // 0..9
(ch === 0x5C) || // \ (backslash)
((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));
}
// 7.6.1.2 Future Reserved Words
function isFutureReservedWord(id) {
switch (id) {
case 'class':
case 'enum':
case 'export':
case 'extends':
case 'import':
case 'super':
return true;
default:
return false;
}
}
function isStrictModeReservedWord(id) {
switch (id) {
case 'implements':
case 'interface':
case 'package':
case 'private':
case 'protected':
case 'public':
case 'static':
case 'yield':
case 'let':
return true;
default:
return false;
}
}
function isRestrictedWord(id) {
return id === 'eval' || id === 'arguments';
}
// 7.6.1.1 Keywords
function isKeyword(id) {
if (strict && isStrictModeReservedWord(id)) {
return true;
}
// 'const' is specialized as Keyword in V8.
// 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.
// Some others are from future reserved words.
switch (id.length) {
case 2:
return (id === 'if') || (id === 'in') || (id === 'do');
case 3:
return (id === 'var') || (id === 'for') || (id === 'new') ||
(id === 'try') || (id === 'let');
case 4:
return (id === 'this') || (id === 'else') || (id === 'case') ||
(id === 'void') || (id === 'with') || (id === 'enum');
case 5:
return (id === 'while') || (id === 'break') || (id === 'catch') ||
(id === 'throw') || (id === 'const') || (id === 'yield') ||
(id === 'class') || (id === 'super');
case 6:
return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
(id === 'switch') || (id === 'export') || (id === 'import');
case 7:
return (id === 'default') || (id === 'finally') || (id === 'extends');
case 8:
return (id === 'function') || (id === 'continue') || (id === 'debugger');
case 10:
return (id === 'instanceof');
default:
return false;
}
}
// 7.4 Comments
function addComment(type, value, start, end, loc) {
var comment, attacher;
assert(typeof start === 'number', 'Comment must have valid position');
// Because the way the actual token is scanned, often the comments
// (if any) are skipped twice during the lexical analysis.
// Thus, we need to skip adding a comment if the comment array already
// handled it.
if (state.lastCommentStart >= start) {
return;
}
state.lastCommentStart = start;
comment = {
type: type,
value: value
};
if (extra.range) {
comment.range = [start, end];
}
if (extra.loc) {
comment.loc = loc;
}
extra.comments.push(comment);
if (extra.attachComment) {
attacher = {
comment: comment,
leading: null,
trailing: null,
range: [start, end]
};
extra.pendingComments.push(attacher);
}
}
function skipSingleLineComment(offset) {
var start, loc, ch, comment;
start = index - offset;
loc = {
start: {
line: lineNumber,
column: index - lineStart - offset
}
};
while (index < length) {
ch = source.charCodeAt(index);
++index;
if (isLineTerminator(ch)) {
if (extra.comments) {
comment = source.slice(start + offset, index - 1);
loc.end = {
line: lineNumber,
column: index - lineStart - 1
};
addComment('Line', comment, start, index - 1, loc);
}
if (ch === 13 && source.charCodeAt(index) === 10) {
++index;
}
++lineNumber;
lineStart = index;
return;
}
}
if (extra.comments) {
comment = source.slice(start + offset, index);
loc.end = {
line: lineNumber,
column: index - lineStart
};
addComment('Line', comment, start, index, loc);
}
}
function skipMultiLineComment() {
var start, loc, ch, comment;
if (extra.comments) {
start = index - 2;
loc = {
start: {
line: lineNumber,
column: index - lineStart - 2
}
};
}
while (index < length) {
ch = source.charCodeAt(index);
if (isLineTerminator(ch)) {
if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {
++index;
}
++lineNumber;
++index;
lineStart = index;
if (index >= length) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
} else if (ch === 0x2A) {
// Block comment ends with '*/'.
if (source.charCodeAt(index + 1) === 0x2F) {
++index;
++index;
if (extra.comments) {
comment = source.slice(start + 2, index - 2);
loc.end = {
line: lineNumber,
column: index - lineStart
};
addComment('Block', comment, start, index, loc);
}
return;
}
++index;
} else {
++index;
}
}
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
function skipComment() {
var ch, start;
start = (index === 0);
while (index < length) {
ch = source.charCodeAt(index);
if (isWhiteSpace(ch)) {
++index;
} else if (isLineTerminator(ch)) {
++index;
if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {
++index;
}
++lineNumber;
lineStart = index;
start = true;
} else if (ch === 0x2F) { // U+002F is '/'
ch = source.charCodeAt(index + 1);
if (ch === 0x2F) {
++index;
++index;
skipSingleLineComment(2);
start = true;
} else if (ch === 0x2A) { // U+002A is '*'
++index;
++index;
skipMultiLineComment();
} else {
break;
}
} else if (start && ch === 0x2D) { // U+002D is '-'
// U+003E is '>'
if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {
// '-->' is a single-line comment
index += 3;
skipSingleLineComment(3);
} else {
break;
}
} else if (ch === 0x3C) { // U+003C is '<'
if (source.slice(index + 1, index + 4) === '!--') {
++index; // `<`
++index; // `!`
++index; // `-`
++index; // `-`
skipSingleLineComment(4);
} else {
break;
}
} else {
break;
}
}
}
function scanHexEscape(prefix) {
var i, len, ch, code = 0;
len = (prefix === 'u') ? 4 : 2;
for (i = 0; i < len; ++i) {
if (index < length && isHexDigit(source[index])) {
ch = source[index++];
code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
} else {
return '';
}
}
return String.fromCharCode(code);
}
function getEscapedIdentifier() {
var ch, id;
ch = source.charCodeAt(index++);
id = String.fromCharCode(ch);
// '\u' (U+005C, U+0075) denotes an escaped character.
if (ch === 0x5C) {
if (source.charCodeAt(index) !== 0x75) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
++index;
ch = scanHexEscape('u');
if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
id = ch;
}
while (index < length) {
ch = source.charCodeAt(index);
if (!isIdentifierPart(ch)) {
break;
}
++index;
id += String.fromCharCode(ch);
// '\u' (U+005C, U+0075) denotes an escaped character.
if (ch === 0x5C) {
id = id.substr(0, id.length - 1);
if (source.charCodeAt(index) !== 0x75) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
++index;
ch = scanHexEscape('u');
if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
id += ch;
}
}
return id;
}
function getIdentifier() {
var start, ch;
start = index++;
while (index < length) {
ch = source.charCodeAt(index);
if (ch === 0x5C) {
// Blackslash (U+005C) marks Unicode escape sequence.
index = start;
return getEscapedIdentifier();
}
if (isIdentifierPart(ch)) {
++index;
} else {
break;
}
}
return source.slice(start, index);
}
function scanIdentifier() {
var start, id, type;
start = index;
// Backslash (U+005C) starts an escaped character.
id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();
// There is no keyword or literal with only one character.
// Thus, it must be an identifier.
if (id.length === 1) {
type = Token.Identifier;
} else if (isKeyword(id)) {
type = Token.Keyword;
} else if (id === 'null') {
type = Token.NullLiteral;
} else if (id === 'true' || id === 'false') {
type = Token.BooleanLiteral;
} else {
type = Token.Identifier;
}
return {
type: type,
value: id,
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
// 7.7 Punctuators
function scanPunctuator() {
var start = index,
code = source.charCodeAt(index),
code2,
ch1 = source[index],
ch2,
ch3,
ch4;
switch (code) {
// Check for most common single-character punctuators.
case 0x2E: // . dot
case 0x28: // ( open bracket
case 0x29: // ) close bracket
case 0x3B: // ; semicolon
case 0x2C: // , comma
case 0x7B: // { open curly brace
case 0x7D: // } close curly brace
case 0x5B: // [
case 0x5D: // ]
case 0x3A: // :
case 0x3F: // ?
case 0x7E: // ~
++index;
if (extra.tokenize) {
if (code === 0x28) {
extra.openParenToken = extra.tokens.length;
} else if (code === 0x7B) {
extra.openCurlyToken = extra.tokens.length;
}
}
return {
type: Token.Punctuator,
value: String.fromCharCode(code),
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
default:
code2 = source.charCodeAt(index + 1);
// '=' (U+003D) marks an assignment or comparison operator.
if (code2 === 0x3D) {
switch (code) {
case 0x25: // %
case 0x26: // &
case 0x2A: // *:
case 0x2B: // +
case 0x2D: // -
case 0x2F: // /
case 0x3C: // <
case 0x3E: // >
case 0x5E: // ^
case 0x7C: // |
index += 2;
return {
type: Token.Punctuator,
value: String.fromCharCode(code) + String.fromCharCode(code2),
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
case 0x21: // !
case 0x3D: // =
index += 2;
// !== and ===
if (source.charCodeAt(index) === 0x3D) {
++index;
}
return {
type: Token.Punctuator,
value: source.slice(start, index),
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
default:
break;
}
}
break;
}
// Peek more characters.
ch2 = source[index + 1];
ch3 = source[index + 2];
ch4 = source[index + 3];
// 4-character punctuator: >>>=
if (ch1 === '>' && ch2 === '>' && ch3 === '>') {
if (ch4 === '=') {
index += 4;
return {
type: Token.Punctuator,
value: '>>>=',
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
}
// 3-character punctuators: === !== >>> <<= >>=
if (ch1 === '>' && ch2 === '>' && ch3 === '>') {
index += 3;
return {
type: Token.Punctuator,
value: '>>>',
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
if (ch1 === '<' && ch2 === '<' && ch3 === '=') {
index += 3;
return {
type: Token.Punctuator,
value: '<<=',
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
if (ch1 === '>' && ch2 === '>' && ch3 === '=') {
index += 3;
return {
type: Token.Punctuator,
value: '>>=',
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
// Other 2-character punctuators: ++ -- << >> && ||
if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) {
index += 2;
return {
type: Token.Punctuator,
value: ch1 + ch2,
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {
++index;
return {
type: Token.Punctuator,
value: ch1,
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
// 7.8.3 Numeric Literals
function scanHexLiteral(start) {
var number = '';
while (index < length) {
if (!isHexDigit(source[index])) {
break;
}
number += source[index++];
}
if (number.length === 0) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
if (isIdentifierStart(source.charCodeAt(index))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
return {
type: Token.NumericLiteral,
value: parseInt('0x' + number, 16),
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
function scanOctalLiteral(start) {
var number = '0' + source[index++];
while (index < length) {
if (!isOctalDigit(source[index])) {
break;
}
number += source[index++];
}
if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
return {
type: Token.NumericLiteral,
value: parseInt(number, 8),
octal: true,
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
function scanNumericLiteral() {
var number, start, ch;
ch = source[index];
assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
'Numeric literal must start with a decimal digit or a decimal point');
start = index;
number = '';
if (ch !== '.') {
number = source[index++];
ch = source[index];
// Hex number starts with '0x'.
// Octal number starts with '0'.
if (number === '0') {
if (ch === 'x' || ch === 'X') {
++index;
return scanHexLiteral(start);
}
if (isOctalDigit(ch)) {
return scanOctalLiteral(start);
}
// decimal number starts with '0' such as '09' is illegal.
if (ch && isDecimalDigit(ch.charCodeAt(0))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
}
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
ch = source[index];
}
if (ch === '.') {
number += source[index++];
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
ch = source[index];
}
if (ch === 'e' || ch === 'E') {
number += source[index++];
ch = source[index];
if (ch === '+' || ch === '-') {
number += source[index++];
}
if (isDecimalDigit(source.charCodeAt(index))) {
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
} else {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
}
if (isIdentifierStart(source.charCodeAt(index))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
return {
type: Token.NumericLiteral,
value: parseFloat(number),
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
// 7.8.4 String Literals
function scanStringLiteral() {
var str = '', quote, start, ch, code, unescaped, restore, octal = false;
quote = source[index];
assert((quote === '\'' || quote === '"'),
'String literal must starts with a quote');
start = index;
++index;
while (index < length) {
ch = source[index++];
if (ch === quote) {
quote = '';
break;
} else if (ch === '\\') {
ch = source[index++];
if (!ch || !isLineTerminator(ch.charCodeAt(0))) {
switch (ch) {
case 'n':
str += '\n';
break;
case 'r':
str += '\r';
break;
case 't':
str += '\t';
break;
case 'u':
case 'x':
restore = index;
unescaped = scanHexEscape(ch);
if (unescaped) {
str += unescaped;
} else {
index = restore;
str += ch;
}
break;
case 'b':
str += '\b';
break;
case 'f':
str += '\f';
break;
case 'v':
str += '\x0B';
break;
default:
if (isOctalDigit(ch)) {
code = '01234567'.indexOf(ch);
// \0 is not octal escape sequence
if (code !== 0) {
octal = true;
}
if (index < length && isOctalDigit(source[index])) {
octal = true;
code = code * 8 + '01234567'.indexOf(source[index++]);
// 3 digits are only allowed when string starts
// with 0, 1, 2, 3
if ('0123'.indexOf(ch) >= 0 &&
index < length &&
isOctalDigit(source[index])) {
code = code * 8 + '01234567'.indexOf(source[index++]);
}
}
str += String.fromCharCode(code);
} else {
str += ch;
}
break;
}
} else {
++lineNumber;
if (ch === '\r' && source[index] === '\n') {
++index;
}
lineStart = index;
}
} else if (isLineTerminator(ch.charCodeAt(0))) {
break;
} else {
str += ch;
}
}
if (quote !== '') {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
return {
type: Token.StringLiteral,
value: str,
octal: octal,
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
function scanRegExp() {
var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false;
lookahead = null;
skipComment();
start = index;
ch = source[index];
assert(ch === '/', 'Regular expression literal must start with a slash');
str = source[index++];
while (index < length) {
ch = source[index++];
str += ch;
if (ch === '\\') {
ch = source[index++];
// ECMA-262 7.8.5
if (isLineTerminator(ch.charCodeAt(0))) {
throwError({}, Messages.UnterminatedRegExp);
}
str += ch;
} else if (isLineTerminator(ch.charCodeAt(0))) {
throwError({}, Messages.UnterminatedRegExp);
} else if (classMarker) {
if (ch === ']') {
classMarker = false;
}
} else {
if (ch === '/') {
terminated = true;
break;
} else if (ch === '[') {
classMarker = true;
}
}
}
if (!terminated) {
throwError({}, Messages.UnterminatedRegExp);
}
// Exclude leading and trailing slash.
pattern = str.substr(1, str.length - 2);
flags = '';
while (index < length) {
ch = source[index];
if (!isIdentifierPart(ch.charCodeAt(0))) {
break;
}
++index;
if (ch === '\\' && index < length) {
ch = source[index];
if (ch === 'u') {
++index;
restore = index;
ch = scanHexEscape('u');
if (ch) {
flags += ch;
for (str += '\\u'; restore < index; ++restore) {
str += source[restore];
}
} else {
index = restore;
flags += 'u';
str += '\\u';
}
} else {
str += '\\';
}
} else {
flags += ch;
str += ch;
}
}
try {
value = new RegExp(pattern, flags);
} catch (e) {
throwError({}, Messages.InvalidRegExp);
}
if (extra.tokenize) {
return {
type: Token.RegularExpression,
value: value,
lineNumber: lineNumber,
lineStart: lineStart,
range: [start, index]
};
}
return {
literal: str,
value: value,
range: [start, index]
};
}
function collectRegex() {
var pos, loc, regex, token;
skipComment();
pos = index;
loc = {
start: {
line: lineNumber,
column: index - lineStart
}
};
regex = scanRegExp();
loc.end = {
line: lineNumber,
column: index - lineStart
};
if (!extra.tokenize) {
// Pop the previous token, which is likely '/' or '/='
if (extra.tokens.length > 0) {
token = extra.tokens[extra.tokens.length - 1];
if (token.range[0] === pos && token.type === 'Punctuator') {
if (token.value === '/' || token.value === '/=') {
extra.tokens.pop();
}
}
}
extra.tokens.push({
type: 'RegularExpression',
value: regex.literal,
range: [pos, index],
loc: loc
});
}
return regex;
}
function isIdentifierName(token) {
return token.type === Token.Identifier ||
token.type === Token.Keyword ||
token.type === Token.BooleanLiteral ||
token.type === Token.NullLiteral;
}
function advanceSlash() {
var prevToken,
checkToken;
// Using the following algorithm:
// https://github.com/mozilla/sweet.js/wiki/design
prevToken = extra.tokens[extra.tokens.length - 1];
if (!prevToken) {
// Nothing before that: it cannot be a division.
return collectRegex();
}
if (prevToken.type === 'Punctuator') {
if (prevToken.value === ']') {
return scanPunctuator();
}
if (prevToken.value === ')') {
checkToken = extra.tokens[extra.openParenToken - 1];
if (checkToken &&
checkToken.type === 'Keyword' &&
(checkToken.value === 'if' ||
checkToken.value === 'while' ||
checkToken.value === 'for' ||
checkToken.value === 'with')) {
return collectRegex();
}
return scanPunctuator();
}
if (prevToken.value === '}') {
// Dividing a function by anything makes little sense,
// but we have to check for that.
if (extra.tokens[extra.openCurlyToken - 3] &&
extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {
// Anonymous function.
checkToken = extra.tokens[extra.openCurlyToken - 4];
if (!checkToken) {
return scanPunctuator();
}
} else if (extra.tokens[extra.openCurlyToken - 4] &&
extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {
// Named function.
checkToken = extra.tokens[extra.openCurlyToken - 5];
if (!checkToken) {
return collectRegex();
}
} else {
return scanPunctuator();
}
// checkToken determines whether the function is
// a declaration or an expression.
if (FnExprTokens.indexOf(checkToken.value) >= 0) {
// It is an expression.
return scanPunctuator();
}
// It is a declaration.
return collectRegex();
}
return collectRegex();
}
if (prevToken.type === 'Keyword') {
return collectRegex();
}
return scanPunctuator();
}
function advance() {
var ch;
skipComment();
if (index >= length) {
return {
type: Token.EOF,
lineNumber: lineNumber,
lineStart: lineStart,
range: [index, index]
};
}
ch = source.charCodeAt(index);
// Very common: ( and ) and ;
if (ch === 0x28 || ch === 0x29 || ch === 0x3A) {
return scanPunctuator();
}
// String literal starts with single quote (U+0027) or double quote (U+0022).
if (ch === 0x27 || ch === 0x22) {
return scanStringLiteral();
}
if (isIdentifierStart(ch)) {
return scanIdentifier();
}
// Dot (.) U+002E can also start a floating-point number, hence the need
// to check the next character.
if (ch === 0x2E) {
if (isDecimalDigit(source.charCodeAt(index + 1))) {
return scanNumericLiteral();
}
return scanPunctuator();
}
if (isDecimalDigit(ch)) {
return scanNumericLiteral();
}
// Slash (/) U+002F can also start a regex.
if (extra.tokenize && ch === 0x2F) {
return advanceSlash();
}
return scanPunctuator();
}
function collectToken() {
var start, loc, token, range, value;
skipComment();
start = index;
loc = {
start: {
line: lineNumber,
column: index - lineStart
}
};
token = advance();
loc.end = {
line: lineNumber,
column: index - lineStart
};
if (token.type !== Token.EOF) {
range = [token.range[0], token.range[1]];
value = source.slice(token.range[0], token.range[1]);
extra.tokens.push({
type: TokenName[token.type],
value: value,
range: range,
loc: loc
});
}
return token;
}
function lex() {
var token;
token = lookahead;
index = token.range[1];
lineNumber = token.lineNumber;
lineStart = token.lineStart;
lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
index = token.range[1];
lineNumber = token.lineNumber;
lineStart = token.lineStart;
return token;
}
function peek() {
var pos, line, start;
pos = index;
line = lineNumber;
start = lineStart;
lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
index = pos;
lineNumber = line;
lineStart = start;
}
SyntaxTreeDelegate = {
name: 'SyntaxTree',
markStart: function () {
skipComment();
if (extra.loc) {
state.markerStack.push(index - lineStart);
state.markerStack.push(lineNumber);
}
if (extra.range) {
state.markerStack.push(index);
}
},
processComment: function (node) {
var i, attacher, pos, len, candidate;
if (typeof node.type === 'undefined' || node.type === Syntax.Program) {
return;
}
// Check for possible additional trailing comments.
peek();
for (i = 0; i < extra.pendingComments.length; ++i) {
attacher = extra.pendingComments[i];
if (node.range[0] >= attacher.comment.range[1]) {
candidate = attacher.leading;
if (candidate) {
pos = candidate.range[0];
len = candidate.range[1] - pos;
if (node.range[0] <= pos && (node.range[1] - node.range[0] >= len)) {
attacher.leading = node;
}
} else {
attacher.leading = node;
}
}
if (node.range[1] <= attacher.comment.range[0]) {
candidate = attacher.trailing;
if (candidate) {
pos = candidate.range[0];
len = candidate.range[1] - pos;
if (node.range[0] <= pos && (node.range[1] - node.range[0] >= len)) {
attacher.trailing = node;
}
} else {
attacher.trailing = node;
}
}
}
},
markEnd: function (node) {
if (extra.range) {
node.range = [state.markerStack.pop(), index];
}
if (extra.loc) {
node.loc = {
start: {
line: state.markerStack.pop(),
column: state.markerStack.pop()
},
end: {
line: lineNumber,
column: index - lineStart
}
};
this.postProcess(node);
}
if (extra.attachComment) {
this.processComment(node);
}
return node;
},
markEndIf: function (node) {
if (node.range || node.loc) {
if (extra.loc) {
state.markerStack.pop();
state.markerStack.pop();
}
if (extra.range) {
state.markerStack.pop();
}
} else {
this.markEnd(node);
}
return node;
},
postProcess: function (node) {
if (extra.source) {
node.loc.source = extra.source;
}
return node;
},
createArrayExpression: function (elements) {
return {
type: Syntax.ArrayExpression,
elements: elements
};
},
createAssignmentExpression: function (operator, left, right) {
return {
type: Syntax.AssignmentExpression,
operator: operator,
left: left,
right: right
};
},
createBinaryExpression: function (operator, left, right) {
var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :
Syntax.BinaryExpression;
return {
type: type,
operator: operator,
left: left,
right: right
};
},
createBlockStatement: function (body) {
return {
type: Syntax.BlockStatement,
body: body
};
},
createBreakStatement: function (label) {
return {
type: Syntax.BreakStatement,
label: label
};
},
createCallExpression: function (callee, args) {
return {
type: Syntax.CallExpression,
callee: callee,
'arguments': args
};
},
createCatchClause: function (param, body) {
return {
type: Syntax.CatchClause,
param: param,
body: body
};
},
createConditionalExpression: function (test, consequent, alternate) {
return {
type: Syntax.ConditionalExpression,
test: test,
consequent: consequent,
alternate: alternate
};
},
createContinueStatement: function (label) {
return {
type: Syntax.ContinueStatement,
label: label
};
},
createDebuggerStatement: function () {
return {
type: Syntax.DebuggerStatement
};
},
createDoWhileStatement: function (body, test) {
return {
type: Syntax.DoWhileStatement,
body: body,
test: test
};
},
createEmptyStatement: function () {
return {
type: Syntax.EmptyStatement
};
},
createExpressionStatement: function (expression) {
return {
type: Syntax.ExpressionStatement,
expression: expression
};
},
createForStatement: function (init, test, update, body) {
return {
type: Syntax.ForStatement,
init: init,
test: test,
update: update,
body: body
};
},
createForInStatement: function (left, right, body) {
return {
type: Syntax.ForInStatement,
left: left,
right: right,
body: body,
each: false
};
},
createFunctionDeclaration: function (id, params, defaults, body) {
return {
type: Syntax.FunctionDeclaration,
id: id,
params: params,
defaults: defaults,
body: body,
rest: null,
generator: false,
expression: false
};
},
createFunctionExpression: function (id, params, defaults, body) {
return {
type: Syntax.FunctionExpression,
id: id,
params: params,
defaults: defaults,
body: body,
rest: null,
generator: false,
expression: false
};
},
createIdentifier: function (name) {
return {
type: Syntax.Identifier,
name: name
};
},
createIfStatement: function (test, consequent, alternate) {
return {
type: Syntax.IfStatement,
test: test,
consequent: consequent,
alternate: alternate
};
},
createLabeledStatement: function (label, body) {
return {
type: Syntax.LabeledStatement,
label: label,
body: body
};
},
createLiteral: function (token) {
return {
type: Syntax.Literal,
value: token.value,
raw: source.slice(token.range[0], token.range[1])
};
},
createMemberExpression: function (accessor, object, property) {
return {
type: Syntax.MemberExpression,
computed: accessor === '[',
object: object,
property: property
};
},
createNewExpression: function (callee, args) {
return {
type: Syntax.NewExpression,
callee: callee,
'arguments': args
};
},
createObjectExpression: function (properties) {
return {
type: Syntax.ObjectExpression,
properties: properties
};
},
createPostfixExpression: function (operator, argument) {
return {
type: Syntax.UpdateExpression,
operator: operator,
argument: argument,
prefix: false
};
},
createProgram: function (body) {
return {
type: Syntax.Program,
body: body
};
},
createProperty: function (kind, key, value) {
return {
type: Syntax.Property,
key: key,
value: value,
kind: kind
};
},
createReturnStatement: function (argument) {
return {
type: Syntax.ReturnStatement,
argument: argument
};
},
createSequenceExpression: function (expressions) {
return {
type: Syntax.SequenceExpression,
expressions: expressions
};
},
createSwitchCase: function (test, consequent) {
return {
type: Syntax.SwitchCase,
test: test,
consequent: consequent
};
},
createSwitchStatement: function (discriminant, cases) {
return {
type: Syntax.SwitchStatement,
discriminant: discriminant,
cases: cases
};
},
createThisExpression: function () {
return {
type: Syntax.ThisExpression
};
},
createThrowStatement: function (argument) {
return {
type: Syntax.ThrowStatement,
argument: argument
};
},
createTryStatement: function (block, guardedHandlers, handlers, finalizer) {
return {
type: Syntax.TryStatement,
block: block,
guardedHandlers: guardedHandlers,
handlers: handlers,
finalizer: finalizer
};
},
createUnaryExpression: function (operator, argument) {
if (operator === '++' || operator === '--') {
return {
type: Syntax.UpdateExpression,
operator: operator,
argument: argument,
prefix: true
};
}
return {
type: Syntax.UnaryExpression,
operator: operator,
argument: argument,
prefix: true
};
},
createVariableDeclaration: function (declarations, kind) {
return {
type: Syntax.VariableDeclaration,
declarations: declarations,
kind: kind
};
},
createVariableDeclarator: function (id, init) {
return {
type: Syntax.VariableDeclarator,
id: id,
init: init
};
},
createWhileStatement: function (test, body) {
return {
type: Syntax.WhileStatement,
test: test,
body: body
};
},
createWithStatement: function (object, body) {
return {
type: Syntax.WithStatement,
object: object,
body: body
};
}
};
// Return true if there is a line terminator before the next token.
function peekLineTerminator() {
var pos, line, start, found;
pos = index;
line = lineNumber;
start = lineStart;
skipComment();
found = lineNumber !== line;
index = pos;
lineNumber = line;
lineStart = start;
return found;
}
// Throw an exception
function throwError(token, messageFormat) {
var error,
args = Array.prototype.slice.call(arguments, 2),
msg = messageFormat.replace(
/%(\d)/g,
function (whole, index) {
assert(index < args.length, 'Message reference must be in range');
return args[index];
}
);
if (typeof token.lineNumber === 'number') {
error = new Error('Line ' + token.lineNumber + ': ' + msg);
error.index = token.range[0];
error.lineNumber = token.lineNumber;
error.column = token.range[0] - lineStart + 1;
} else {
error = new Error('Line ' + lineNumber + ': ' + msg);
error.index = index;
error.lineNumber = lineNumber;
error.column = index - lineStart + 1;
}
error.description = msg;
throw error;
}
function throwErrorTolerant() {
try {
throwError.apply(null, arguments);
} catch (e) {
if (extra.errors) {
extra.errors.push(e);
} else {
throw e;
}
}
}
// Throw an exception because of the token.
function throwUnexpected(token) {
if (token.type === Token.EOF) {
throwError(token, Messages.UnexpectedEOS);
}
if (token.type === Token.NumericLiteral) {
throwError(token, Messages.UnexpectedNumber);
}
if (token.type === Token.StringLiteral) {
throwError(token, Messages.UnexpectedString);
}
if (token.type === Token.Identifier) {
throwError(token, Messages.UnexpectedIdentifier);
}
if (token.type === Token.Keyword) {
if (isFutureReservedWord(token.value)) {
throwError(token, Messages.UnexpectedReserved);
} else if (strict && isStrictModeReservedWord(token.value)) {
throwErrorTolerant(token, Messages.StrictReservedWord);
return;
}
throwError(token, Messages.UnexpectedToken, token.value);
}
// BooleanLiteral, NullLiteral, or Punctuator.
throwError(token, Messages.UnexpectedToken, token.value);
}
// Expect the next token to match the specified punctuator.
// If not, an exception will be thrown.
function expect(value) {
var token = lex();
if (token.type !== Token.Punctuator || token.value !== value) {
throwUnexpected(token);
}
}
// Expect the next token to match the specified keyword.
// If not, an exception will be thrown.
function expectKeyword(keyword) {
var token = lex();
if (token.type !== Token.Keyword || token.value !== keyword) {
throwUnexpected(token);
}
}
// Return true if the next token matches the specified punctuator.
function match(value) {
return lookahead.type === Token.Punctuator && lookahead.value === value;
}
// Return true if the next token matches the specified keyword
function matchKeyword(keyword) {
return lookahead.type === Token.Keyword && lookahead.value === keyword;
}
// Return true if the next token is an assignment operator
function matchAssign() {
var op;
if (lookahead.type !== Token.Punctuator) {
return false;
}
op = lookahead.value;
return op === '=' ||
op === '*=' ||
op === '/=' ||
op === '%=' ||
op === '+=' ||
op === '-=' ||
op === '<<=' ||
op === '>>=' ||
op === '>>>=' ||
op === '&=' ||
op === '^=' ||
op === '|=';
}
function consumeSemicolon() {
var line;
// Catch the very common case first: immediately a semicolon (U+003B).
if (source.charCodeAt(index) === 0x3B) {
lex();
return;
}
line = lineNumber;
skipComment();
if (lineNumber !== line) {
return;
}
if (match(';')) {
lex();
return;
}
if (lookahead.type !== Token.EOF && !match('}')) {
throwUnexpected(lookahead);
}
}
// Return true if provided expression is LeftHandSideExpression
function isLeftHandSide(expr) {
return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;
}
// 11.1.4 Array Initialiser
function parseArrayInitialiser() {
var elements = [];
expect('[');
while (!match(']')) {
if (match(',')) {
lex();
elements.push(null);
} else {
elements.push(parseAssignmentExpression());
if (!match(']')) {
expect(',');
}
}
}
expect(']');
return delegate.createArrayExpression(elements);
}
// 11.1.5 Object Initialiser
function parsePropertyFunction(param, first) {
var previousStrict, body;
previousStrict = strict;
delegate.markStart();
body = parseFunctionSourceElements();
if (first && strict && isRestrictedWord(param[0].name)) {
throwErrorTolerant(first, Messages.StrictParamName);
}
strict = previousStrict;
return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body));
}
function parseObjectPropertyKey() {
var token;
delegate.markStart();
token = lex();
// Note: This function is called only from parseObjectProperty(), where
// EOF and Punctuator tokens are already filtered out.
if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {
if (strict && token.octal) {
throwErrorTolerant(token, Messages.StrictOctalLiteral);
}
return delegate.markEnd(delegate.createLiteral(token));
}
return delegate.markEnd(delegate.createIdentifier(token.value));
}
function parseObjectProperty() {
var token, key, id, value, param;
token = lookahead;
delegate.markStart();
if (token.type === Token.Identifier) {
id = parseObjectPropertyKey();
// Property Assignment: Getter and Setter.
if (token.value === 'get' && !match(':')) {
key = parseObjectPropertyKey();
expect('(');
expect(')');
value = parsePropertyFunction([]);
return delegate.markEnd(delegate.createProperty('get', key, value));
}
if (token.value === 'set' && !match(':')) {
key = parseObjectPropertyKey();
expect('(');
token = lookahead;
if (token.type !== Token.Identifier) {
expect(')');
throwErrorTolerant(token, Messages.UnexpectedToken, token.value);
value = parsePropertyFunction([]);
} else {
param = [ parseVariableIdentifier() ];
expect(')');
value = parsePropertyFunction(param, token);
}
return delegate.markEnd(delegate.createProperty('set', key, value));
}
expect(':');
value = parseAssignmentExpression();
return delegate.markEnd(delegate.createProperty('init', id, value));
}
if (token.type === Token.EOF || token.type === Token.Punctuator) {
throwUnexpected(token);
} else {
key = parseObjectPropertyKey();
expect(':');
value = parseAssignmentExpression();
return delegate.markEnd(delegate.createProperty('init', key, value));
}
}
function parseObjectInitialiser() {
var properties = [], property, name, key, kind, map = {}, toString = String;
expect('{');
while (!match('}')) {
property = parseObjectProperty();
if (property.key.type === Syntax.Identifier) {
name = property.key.name;
} else {
name = toString(property.key.value);
}
kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;
key = '$' + name;
if (Object.prototype.hasOwnProperty.call(map, key)) {
if (map[key] === PropertyKind.Data) {
if (strict && kind === PropertyKind.Data) {
throwErrorTolerant({}, Messages.StrictDuplicateProperty);
} else if (kind !== PropertyKind.Data) {
throwErrorTolerant({}, Messages.AccessorDataProperty);
}
} else {
if (kind === PropertyKind.Data) {
throwErrorTolerant({}, Messages.AccessorDataProperty);
} else if (map[key] & kind) {
throwErrorTolerant({}, Messages.AccessorGetSet);
}
}
map[key] |= kind;
} else {
map[key] = kind;
}
properties.push(property);
if (!match('}')) {
expect(',');
}
}
expect('}');
return delegate.createObjectExpression(properties);
}
// 11.1.6 The Grouping Operator
function parseGroupExpression() {
var expr;
expect('(');
expr = parseExpression();
expect(')');
return expr;
}
// 11.1 Primary Expressions
function parsePrimaryExpression() {
var type, token, expr;
if (match('(')) {
return parseGroupExpression();
}
type = lookahead.type;
delegate.markStart();
if (type === Token.Identifier) {
expr = delegate.createIdentifier(lex().value);
} else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
if (strict && lookahead.octal) {
throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);
}
expr = delegate.createLiteral(lex());
} else if (type === Token.Keyword) {
if (matchKeyword('this')) {
lex();
expr = delegate.createThisExpression();
} else if (matchKeyword('function')) {
expr = parseFunctionExpression();
}
} else if (type === Token.BooleanLiteral) {
token = lex();
token.value = (token.value === 'true');
expr = delegate.createLiteral(token);
} else if (type === Token.NullLiteral) {
token = lex();
token.value = null;
expr = delegate.createLiteral(token);
} else if (match('[')) {
expr = parseArrayInitialiser();
} else if (match('{')) {
expr = parseObjectInitialiser();
} else if (match('/') || match('/=')) {
if (typeof extra.tokens !== 'undefined') {
expr = delegate.createLiteral(collectRegex());
} else {
expr = delegate.createLiteral(scanRegExp());
}
peek();
}
if (expr) {
return delegate.markEnd(expr);
}
throwUnexpected(lex());
}
// 11.2 Left-Hand-Side Expressions
function parseArguments() {
var args = [];
expect('(');
if (!match(')')) {
while (index < length) {
args.push(parseAssignmentExpression());
if (match(')')) {
break;
}
expect(',');
}
}
expect(')');
return args;
}
function parseNonComputedProperty() {
var token;
delegate.markStart();
token = lex();
if (!isIdentifierName(token)) {
throwUnexpected(token);
}
return delegate.markEnd(delegate.createIdentifier(token.value));
}
function parseNonComputedMember() {
expect('.');
return parseNonComputedProperty();
}
function parseComputedMember() {
var expr;
expect('[');
expr = parseExpression();
expect(']');
return expr;
}
function parseNewExpression() {
var callee, args;
delegate.markStart();
expectKeyword('new');
callee = parseLeftHandSideExpression();
args = match('(') ? parseArguments() : [];
return delegate.markEnd(delegate.createNewExpression(callee, args));
}
function parseLeftHandSideExpressionAllowCall() {
var marker, previousAllowIn, expr, args, property;
marker = createLocationMarker();
previousAllowIn = state.allowIn;
state.allowIn = true;
expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();
state.allowIn = previousAllowIn;
while (match('.') || match('[') || match('(')) {
if (match('(')) {
args = parseArguments();
expr = delegate.createCallExpression(expr, args);
} else if (match('[')) {
property = parseComputedMember();
expr = delegate.createMemberExpression('[', expr, property);
} else {
property = parseNonComputedMember();
expr = delegate.createMemberExpression('.', expr, property);
}
if (marker) {
marker.apply(expr);
}
}
return expr;
}
function parseLeftHandSideExpression() {
var marker, previousAllowIn, expr, property;
marker = createLocationMarker();
previousAllowIn = state.allowIn;
expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();
state.allowIn = previousAllowIn;
while (match('.') || match('[')) {
if (match('[')) {
property = parseComputedMember();
expr = delegate.createMemberExpression('[', expr, property);
} else {
property = parseNonComputedMember();
expr = delegate.createMemberExpression('.', expr, property);
}
if (marker) {
marker.apply(expr);
}
}
return expr;
}
// 11.3 Postfix Expressions
function parsePostfixExpression() {
var expr, token;
delegate.markStart();
expr = parseLeftHandSideExpressionAllowCall();
if (lookahead.type === Token.Punctuator) {
if ((match('++') || match('--')) && !peekLineTerminator()) {
// 11.3.1, 11.3.2
if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
throwErrorTolerant({}, Messages.StrictLHSPostfix);
}
if (!isLeftHandSide(expr)) {
throwErrorTolerant({}, Messages.InvalidLHSInAssignment);
}
token = lex();
expr = delegate.createPostfixExpression(token.value, expr);
}
}
return delegate.markEndIf(expr);
}
// 11.4 Unary Operators
function parseUnaryExpression() {
var token, expr;
delegate.markStart();
if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
expr = parsePostfixExpression();
} else if (match('++') || match('--')) {
token = lex();
expr = parseUnaryExpression();
// 11.4.4, 11.4.5
if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
throwErrorTolerant({}, Messages.StrictLHSPrefix);
}
if (!isLeftHandSide(expr)) {
throwErrorTolerant({}, Messages.InvalidLHSInAssignment);
}
expr = delegate.createUnaryExpression(token.value, expr);
} else if (match('+') || match('-') || match('~') || match('!')) {
token = lex();
expr = parseUnaryExpression();
expr = delegate.createUnaryExpression(token.value, expr);
} else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
token = lex();
expr = parseUnaryExpression();
expr = delegate.createUnaryExpression(token.value, expr);
if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
throwErrorTolerant({}, Messages.StrictDelete);
}
} else {
expr = parsePostfixExpression();
}
return delegate.markEndIf(expr);
}
function binaryPrecedence(token, allowIn) {
var prec = 0;
if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
return 0;
}
switch (token.value) {
case '||':
prec = 1;
break;
case '&&':
prec = 2;
break;
case '|':
prec = 3;
break;
case '^':
prec = 4;
break;
case '&':
prec = 5;
break;
case '==':
case '!=':
case '===':
case '!==':
prec = 6;
break;
case '<':
case '>':
case '<=':
case '>=':
case 'instanceof':
prec = 7;
break;
case 'in':
prec = allowIn ? 7 : 0;
break;
case '<<':
case '>>':
case '>>>':
prec = 8;
break;
case '+':
case '-':
prec = 9;
break;
case '*':
case '/':
case '%':
prec = 11;
break;
default:
break;
}
return prec;
}
// 11.5 Multiplicative Operators
// 11.6 Additive Operators
// 11.7 Bitwise Shift Operators
// 11.8 Relational Operators
// 11.9 Equality Operators
// 11.10 Binary Bitwise Operators
// 11.11 Binary Logical Operators
function parseBinaryExpression() {
var marker, markers, expr, token, prec, stack, right, operator, left, i;
marker = createLocationMarker();
left = parseUnaryExpression();
token = lookahead;
prec = binaryPrecedence(token, state.allowIn);
if (prec === 0) {
return left;
}
token.prec = prec;
lex();
markers = [marker, createLocationMarker()];
right = parseUnaryExpression();
stack = [left, token, right];
while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {
// Reduce: make a binary expression from the three topmost entries.
while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {
right = stack.pop();
operator = stack.pop().value;
left = stack.pop();
expr = delegate.createBinaryExpression(operator, left, right);
markers.pop();
marker = markers.pop();
if (marker) {
marker.apply(expr);
}
stack.push(expr);
markers.push(marker);
}
// Shift.
token = lex();
token.prec = prec;
stack.push(token);
markers.push(createLocationMarker());
expr = parseUnaryExpression();
stack.push(expr);
}
// Final reduce to clean-up the stack.
i = stack.length - 1;
expr = stack[i];
markers.pop();
while (i > 1) {
expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);
i -= 2;
marker = markers.pop();
if (marker) {
marker.apply(expr);
}
}
return expr;
}
// 11.12 Conditional Operator
function parseConditionalExpression() {
var expr, previousAllowIn, consequent, alternate;
delegate.markStart();
expr = parseBinaryExpression();
if (match('?')) {
lex();
previousAllowIn = state.allowIn;
state.allowIn = true;
consequent = parseAssignmentExpression();
state.allowIn = previousAllowIn;
expect(':');
alternate = parseAssignmentExpression();
expr = delegate.markEnd(delegate.createConditionalExpression(expr, consequent, alternate));
} else {
delegate.markEnd({});
}
return expr;
}
// 11.13 Assignment Operators
function parseAssignmentExpression() {
var token, left, right, node;
token = lookahead;
delegate.markStart();
node = left = parseConditionalExpression();
if (matchAssign()) {
// LeftHandSideExpression
if (!isLeftHandSide(left)) {
throwErrorTolerant({}, Messages.InvalidLHSInAssignment);
}
// 11.13.1
if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {
throwErrorTolerant(token, Messages.StrictLHSAssignment);
}
token = lex();
right = parseAssignmentExpression();
node = delegate.createAssignmentExpression(token.value, left, right);
}
return delegate.markEndIf(node);
}
// 11.14 Comma Operator
function parseExpression() {
var expr;
delegate.markStart();
expr = parseAssignmentExpression();
if (match(',')) {
expr = delegate.createSequenceExpression([ expr ]);
while (index < length) {
if (!match(',')) {
break;
}
lex();
expr.expressions.push(parseAssignmentExpression());
}
}
return delegate.markEndIf(expr);
}
// 12.1 Block
function parseStatementList() {
var list = [],
statement;
while (index < length) {
if (match('}')) {
break;
}
statement = parseSourceElement();
if (typeof statement === 'undefined') {
break;
}
list.push(statement);
}
return list;
}
function parseBlock() {
var block;
delegate.markStart();
expect('{');
block = parseStatementList();
expect('}');
return delegate.markEnd(delegate.createBlockStatement(block));
}
// 12.2 Variable Statement
function parseVariableIdentifier() {
var token;
delegate.markStart();
token = lex();
if (token.type !== Token.Identifier) {
throwUnexpected(token);
}
return delegate.markEnd(delegate.createIdentifier(token.value));
}
function parseVariableDeclaration(kind) {
var init = null, id;
delegate.markStart();
id = parseVariableIdentifier();
// 12.2.1
if (strict && isRestrictedWord(id.name)) {
throwErrorTolerant({}, Messages.StrictVarName);
}
if (kind === 'const') {
expect('=');
init = parseAssignmentExpression();
} else if (match('=')) {
lex();
init = parseAssignmentExpression();
}
return delegate.markEnd(delegate.createVariableDeclarator(id, init));
}
function parseVariableDeclarationList(kind) {
var list = [];
do {
list.push(parseVariableDeclaration(kind));
if (!match(',')) {
break;
}
lex();
} while (index < length);
return list;
}
function parseVariableStatement() {
var declarations;
expectKeyword('var');
declarations = parseVariableDeclarationList();
consumeSemicolon();
return delegate.createVariableDeclaration(declarations, 'var');
}
// kind may be `const` or `let`
// Both are experimental and not in the specification yet.
// see http://wiki.ecmascript.org/doku.php?id=harmony:const
// and http://wiki.ecmascript.org/doku.php?id=harmony:let
function parseConstLetDeclaration(kind) {
var declarations;
delegate.markStart();
expectKeyword(kind);
declarations = parseVariableDeclarationList(kind);
consumeSemicolon();
return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind));
}
// 12.3 Empty Statement
function parseEmptyStatement() {
expect(';');
return delegate.createEmptyStatement();
}
// 12.4 Expression Statement
function parseExpressionStatement() {
var expr = parseExpression();
consumeSemicolon();
return delegate.createExpressionStatement(expr);
}
// 12.5 If statement
function parseIfStatement() {
var test, consequent, alternate;
expectKeyword('if');
expect('(');
test = parseExpression();
expect(')');
consequent = parseStatement();
if (matchKeyword('else')) {
lex();
alternate = parseStatement();
} else {
alternate = null;
}
return delegate.createIfStatement(test, consequent, alternate);
}
// 12.6 Iteration Statements
function parseDoWhileStatement() {
var body, test, oldInIteration;
expectKeyword('do');
oldInIteration = state.inIteration;
state.inIteration = true;
body = parseStatement();
state.inIteration = oldInIteration;
expectKeyword('while');
expect('(');
test = parseExpression();
expect(')');
if (match(';')) {
lex();
}
return delegate.createDoWhileStatement(body, test);
}
function parseWhileStatement() {
var test, body, oldInIteration;
expectKeyword('while');
expect('(');
test = parseExpression();
expect(')');
oldInIteration = state.inIteration;
state.inIteration = true;
body = parseStatement();
state.inIteration = oldInIteration;
return delegate.createWhileStatement(test, body);
}
function parseForVariableDeclaration() {
var token, declarations;
delegate.markStart();
token = lex();
declarations = parseVariableDeclarationList();
return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value));
}
function parseForStatement() {
var init, test, update, left, right, body, oldInIteration;
init = test = update = null;
expectKeyword('for');
expect('(');
if (match(';')) {
lex();
} else {
if (matchKeyword('var') || matchKeyword('let')) {
state.allowIn = false;
init = parseForVariableDeclaration();
state.allowIn = true;
if (init.declarations.length === 1 && matchKeyword('in')) {
lex();
left = init;
right = parseExpression();
init = null;
}
} else {
state.allowIn = false;
init = parseExpression();
state.allowIn = true;
if (matchKeyword('in')) {
// LeftHandSideExpression
if (!isLeftHandSide(init)) {
throwErrorTolerant({}, Messages.InvalidLHSInForIn);
}
lex();
left = init;
right = parseExpression();
init = null;
}
}
if (typeof left === 'undefined') {
expect(';');
}
}
if (typeof left === 'undefined') {
if (!match(';')) {
test = parseExpression();
}
expect(';');
if (!match(')')) {
update = parseExpression();
}
}
expect(')');
oldInIteration = state.inIteration;
state.inIteration = true;
body = parseStatement();
state.inIteration = oldInIteration;
return (typeof left === 'undefined') ?
delegate.createForStatement(init, test, update, body) :
delegate.createForInStatement(left, right, body);
}
// 12.7 The continue statement
function parseContinueStatement() {
var label = null, key;
expectKeyword('continue');
// Optimize the most common form: 'continue;'.
if (source.charCodeAt(index) === 0x3B) {
lex();
if (!state.inIteration) {
throwError({}, Messages.IllegalContinue);
}
return delegate.createContinueStatement(null);
}
if (peekLineTerminator()) {
if (!state.inIteration) {
throwError({}, Messages.IllegalContinue);
}
return delegate.createContinueStatement(null);
}
if (lookahead.type === Token.Identifier) {
label = parseVariableIdentifier();
key = '$' + label.name;
if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
throwError({}, Messages.UnknownLabel, label.name);
}
}
consumeSemicolon();
if (label === null && !state.inIteration) {
throwError({}, Messages.IllegalContinue);
}
return delegate.createContinueStatement(label);
}
// 12.8 The break statement
function parseBreakStatement() {
var label = null, key;
expectKeyword('break');
// Catch the very common case first: immediately a semicolon (U+003B).
if (source.charCodeAt(index) === 0x3B) {
lex();
if (!(state.inIteration || state.inSwitch)) {
throwError({}, Messages.IllegalBreak);
}
return delegate.createBreakStatement(null);
}
if (peekLineTerminator()) {
if (!(state.inIteration || state.inSwitch)) {
throwError({}, Messages.IllegalBreak);
}
return delegate.createBreakStatement(null);
}
if (lookahead.type === Token.Identifier) {
label = parseVariableIdentifier();
key = '$' + label.name;
if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
throwError({}, Messages.UnknownLabel, label.name);
}
}
consumeSemicolon();
if (label === null && !(state.inIteration || state.inSwitch)) {
throwError({}, Messages.IllegalBreak);
}
return delegate.createBreakStatement(label);
}
// 12.9 The return statement
function parseReturnStatement() {
var argument = null;
expectKeyword('return');
if (!state.inFunctionBody) {
throwErrorTolerant({}, Messages.IllegalReturn);
}
// 'return' followed by a space and an identifier is very common.
if (source.charCodeAt(index) === 0x20) {
if (isIdentifierStart(source.charCodeAt(index + 1))) {
argument = parseExpression();
consumeSemicolon();
return delegate.createReturnStatement(argument);
}
}
if (peekLineTerminator()) {
return delegate.createReturnStatement(null);
}
if (!match(';')) {
if (!match('}') && lookahead.type !== Token.EOF) {
argument = parseExpression();
}
}
consumeSemicolon();
return delegate.createReturnStatement(argument);
}
// 12.10 The with statement
function parseWithStatement() {
var object, body;
if (strict) {
throwErrorTolerant({}, Messages.StrictModeWith);
}
expectKeyword('with');
expect('(');
object = parseExpression();
expect(')');
body = parseStatement();
return delegate.createWithStatement(object, body);
}
// 12.10 The swith statement
function parseSwitchCase() {
var test,
consequent = [],
statement;
delegate.markStart();
if (matchKeyword('default')) {
lex();
test = null;
} else {
expectKeyword('case');
test = parseExpression();
}
expect(':');
while (index < length) {
if (match('}') || matchKeyword('default') || matchKeyword('case')) {
break;
}
statement = parseStatement();
consequent.push(statement);
}
return delegate.markEnd(delegate.createSwitchCase(test, consequent));
}
function parseSwitchStatement() {
var discriminant, cases, clause, oldInSwitch, defaultFound;
expectKeyword('switch');
expect('(');
discriminant = parseExpression();
expect(')');
expect('{');
cases = [];
if (match('}')) {
lex();
return delegate.createSwitchStatement(discriminant, cases);
}
oldInSwitch = state.inSwitch;
state.inSwitch = true;
defaultFound = false;
while (index < length) {
if (match('}')) {
break;
}
clause = parseSwitchCase();
if (clause.test === null) {
if (defaultFound) {
throwError({}, Messages.MultipleDefaultsInSwitch);
}
defaultFound = true;
}
cases.push(clause);
}
state.inSwitch = oldInSwitch;
expect('}');
return delegate.createSwitchStatement(discriminant, cases);
}
// 12.13 The throw statement
function parseThrowStatement() {
var argument;
expectKeyword('throw');
if (peekLineTerminator()) {
throwError({}, Messages.NewlineAfterThrow);
}
argument = parseExpression();
consumeSemicolon();
return delegate.createThrowStatement(argument);
}
// 12.14 The try statement
function parseCatchClause() {
var param, body;
delegate.markStart();
expectKeyword('catch');
expect('(');
if (match(')')) {
throwUnexpected(lookahead);
}
param = parseVariableIdentifier();
// 12.14.1
if (strict && isRestrictedWord(param.name)) {
throwErrorTolerant({}, Messages.StrictCatchVariable);
}
expect(')');
body = parseBlock();
return delegate.markEnd(delegate.createCatchClause(param, body));
}
function parseTryStatement() {
var block, handlers = [], finalizer = null;
expectKeyword('try');
block = parseBlock();
if (matchKeyword('catch')) {
handlers.push(parseCatchClause());
}
if (matchKeyword('finally')) {
lex();
finalizer = parseBlock();
}
if (handlers.length === 0 && !finalizer) {
throwError({}, Messages.NoCatchOrFinally);
}
return delegate.createTryStatement(block, [], handlers, finalizer);
}
// 12.15 The debugger statement
function parseDebuggerStatement() {
expectKeyword('debugger');
consumeSemicolon();
return delegate.createDebuggerStatement();
}
// 12 Statements
function parseStatement() {
var type = lookahead.type,
expr,
labeledBody,
key;
if (type === Token.EOF) {
throwUnexpected(lookahead);
}
delegate.markStart();
if (type === Token.Punctuator) {
switch (lookahead.value) {
case ';':
return delegate.markEnd(parseEmptyStatement());
case '{':
return delegate.markEnd(parseBlock());
case '(':
return delegate.markEnd(parseExpressionStatement());
default:
break;
}
}
if (type === Token.Keyword) {
switch (lookahead.value) {
case 'break':
return delegate.markEnd(parseBreakStatement());
case 'continue':
return delegate.markEnd(parseContinueStatement());
case 'debugger':
return delegate.markEnd(parseDebuggerStatement());
case 'do':
return delegate.markEnd(parseDoWhileStatement());
case 'for':
return delegate.markEnd(parseForStatement());
case 'function':
return delegate.markEnd(parseFunctionDeclaration());
case 'if':
return delegate.markEnd(parseIfStatement());
case 'return':
return delegate.markEnd(parseReturnStatement());
case 'switch':
return delegate.markEnd(parseSwitchStatement());
case 'throw':
return delegate.markEnd(parseThrowStatement());
case 'try':
return delegate.markEnd(parseTryStatement());
case 'var':
return delegate.markEnd(parseVariableStatement());
case 'while':
return delegate.markEnd(parseWhileStatement());
case 'with':
return delegate.markEnd(parseWithStatement());
default:
break;
}
}
expr = parseExpression();
// 12.12 Labelled Statements
if ((expr.type === Syntax.Identifier) && match(':')) {
lex();
key = '$' + expr.name;
if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
throwError({}, Messages.Redeclaration, 'Label', expr.name);
}
state.labelSet[key] = true;
labeledBody = parseStatement();
delete state.labelSet[key];
return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody));
}
consumeSemicolon();
return delegate.markEnd(delegate.createExpressionStatement(expr));
}
// 13 Function Definition
function parseFunctionSourceElements() {
var sourceElement, sourceElements = [], token, directive, firstRestricted,
oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody;
delegate.markStart();
expect('{');
while (index < length) {
if (lookahead.type !== Token.StringLiteral) {
break;
}
token = lookahead;
sourceElement = parseSourceElement();
sourceElements.push(sourceElement);
if (sourceElement.expression.type !== Syntax.Literal) {
// this is not directive
break;
}
directive = source.slice(token.range[0] + 1, token.range[1] - 1);
if (directive === 'use strict') {
strict = true;
if (firstRestricted) {
throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);
}
} else {
if (!firstRestricted && token.octal) {
firstRestricted = token;
}
}
}
oldLabelSet = state.labelSet;
oldInIteration = state.inIteration;
oldInSwitch = state.inSwitch;
oldInFunctionBody = state.inFunctionBody;
state.labelSet = {};
state.inIteration = false;
state.inSwitch = false;
state.inFunctionBody = true;
while (index < length) {
if (match('}')) {
break;
}
sourceElement = parseSourceElement();
if (typeof sourceElement === 'undefined') {
break;
}
sourceElements.push(sourceElement);
}
expect('}');
state.labelSet = oldLabelSet;
state.inIteration = oldInIteration;
state.inSwitch = oldInSwitch;
state.inFunctionBody = oldInFunctionBody;
return delegate.markEnd(delegate.createBlockStatement(sourceElements));
}
function parseParams(firstRestricted) {
var param, params = [], token, stricted, paramSet, key, message;
expect('(');
if (!match(')')) {
paramSet = {};
while (index < length) {
token = lookahead;
param = parseVariableIdentifier();
key = '$' + token.value;
if (strict) {
if (isRestrictedWord(token.value)) {
stricted = token;
message = Messages.StrictParamName;
}
if (Object.prototype.hasOwnProperty.call(paramSet, key)) {
stricted = token;
message = Messages.StrictParamDupe;
}
} else if (!firstRestricted) {
if (isRestrictedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictParamName;
} else if (isStrictModeReservedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictReservedWord;
} else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {
firstRestricted = token;
message = Messages.StrictParamDupe;
}
}
params.push(param);
paramSet[key] = true;
if (match(')')) {
break;
}
expect(',');
}
}
expect(')');
return {
params: params,
stricted: stricted,
firstRestricted: firstRestricted,
message: message
};
}
function parseFunctionDeclaration() {
var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict;
delegate.markStart();
expectKeyword('function');
token = lookahead;
id = parseVariableIdentifier();
if (strict) {
if (isRestrictedWord(token.value)) {
throwErrorTolerant(token, Messages.StrictFunctionName);
}
} else {
if (isRestrictedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictFunctionName;
} else if (isStrictModeReservedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictReservedWord;
}
}
tmp = parseParams(firstRestricted);
params = tmp.params;
stricted = tmp.stricted;
firstRestricted = tmp.firstRestricted;
if (tmp.message) {
message = tmp.message;
}
previousStrict = strict;
body = parseFunctionSourceElements();
if (strict && firstRestricted) {
throwError(firstRestricted, message);
}
if (strict && stricted) {
throwErrorTolerant(stricted, message);
}
strict = previousStrict;
return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body));
}
function parseFunctionExpression() {
var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict;
delegate.markStart();
expectKeyword('function');
if (!match('(')) {
token = lookahead;
id = parseVariableIdentifier();
if (strict) {
if (isRestrictedWord(token.value)) {
throwErrorTolerant(token, Messages.StrictFunctionName);
}
} else {
if (isRestrictedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictFunctionName;
} else if (isStrictModeReservedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictReservedWord;
}
}
}
tmp = parseParams(firstRestricted);
params = tmp.params;
stricted = tmp.stricted;
firstRestricted = tmp.firstRestricted;
if (tmp.message) {
message = tmp.message;
}
previousStrict = strict;
body = parseFunctionSourceElements();
if (strict && firstRestricted) {
throwError(firstRestricted, message);
}
if (strict && stricted) {
throwErrorTolerant(stricted, message);
}
strict = previousStrict;
return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body));
}
// 14 Program
function parseSourceElement() {
if (lookahead.type === Token.Keyword) {
switch (lookahead.value) {
case 'const':
case 'let':
return parseConstLetDeclaration(lookahead.value);
case 'function':
return parseFunctionDeclaration();
default:
return parseStatement();
}
}
if (lookahead.type !== Token.EOF) {
return parseStatement();
}
}
function parseSourceElements() {
var sourceElement, sourceElements = [], token, directive, firstRestricted;
while (index < length) {
token = lookahead;
if (token.type !== Token.StringLiteral) {
break;
}
sourceElement = parseSourceElement();
sourceElements.push(sourceElement);
if (sourceElement.expression.type !== Syntax.Literal) {
// this is not directive
break;
}
directive = source.slice(token.range[0] + 1, token.range[1] - 1);
if (directive === 'use strict') {
strict = true;
if (firstRestricted) {
throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);
}
} else {
if (!firstRestricted && token.octal) {
firstRestricted = token;
}
}
}
while (index < length) {
sourceElement = parseSourceElement();
if (typeof sourceElement === 'undefined') {
break;
}
sourceElements.push(sourceElement);
}
return sourceElements;
}
function parseProgram() {
var body;
delegate.markStart();
strict = false;
peek();
body = parseSourceElements();
return delegate.markEnd(delegate.createProgram(body));
}
function attachComments() {
var i, attacher, comment, leading, trailing;
for (i = 0; i < extra.pendingComments.length; ++i) {
attacher = extra.pendingComments[i];
comment = attacher.comment;
leading = attacher.leading;
if (leading) {
if (typeof leading.leadingComments === 'undefined') {
leading.leadingComments = [];
}
leading.leadingComments.push(attacher.comment);
}
trailing = attacher.trailing;
if (trailing) {
if (typeof trailing.trailingComments === 'undefined') {
trailing.trailingComments = [];
}
trailing.trailingComments.push(attacher.comment);
}
}
extra.pendingComments = [];
}
function filterTokenLocation() {
var i, entry, token, tokens = [];
for (i = 0; i < extra.tokens.length; ++i) {
entry = extra.tokens[i];
token = {
type: entry.type,
value: entry.value
};
if (extra.range) {
token.range = entry.range;
}
if (extra.loc) {
token.loc = entry.loc;
}
tokens.push(token);
}
extra.tokens = tokens;
}
function LocationMarker() {
this.startIndex = index;
this.startLine = lineNumber;
this.startColumn = index - lineStart;
}
LocationMarker.prototype = {
constructor: LocationMarker,
apply: function (node) {
if (extra.range) {
node.range = [this.startIndex, index];
}
if (extra.loc) {
node.loc = {
start: {
line: this.startLine,
column: this.startColumn
},
end: {
line: lineNumber,
column: index - lineStart
}
};
node = delegate.postProcess(node);
}
if (extra.attachComment) {
delegate.processComment(node);
}
}
};
function createLocationMarker() {
if (!extra.loc && !extra.range) {
return null;
}
skipComment();
return new LocationMarker();
}
function tokenize(code, options) {
var toString,
token,
tokens;
toString = String;
if (typeof code !== 'string' && !(code instanceof String)) {
code = toString(code);
}
delegate = SyntaxTreeDelegate;
source = code;
index = 0;
lineNumber = (source.length > 0) ? 1 : 0;
lineStart = 0;
length = source.length;
lookahead = null;
state = {
allowIn: true,
labelSet: {},
inFunctionBody: false,
inIteration: false,
inSwitch: false,
lastCommentStart: -1
};
extra = {};
// Options matching.
options = options || {};
// Of course we collect tokens here.
options.tokens = true;
extra.tokens = [];
extra.tokenize = true;
// The following two fields are necessary to compute the Regex tokens.
extra.openParenToken = -1;
extra.openCurlyToken = -1;
extra.range = (typeof options.range === 'boolean') && options.range;
extra.loc = (typeof options.loc === 'boolean') && options.loc;
if (typeof options.comment === 'boolean' && options.comment) {
extra.comments = [];
}
if (typeof options.tolerant === 'boolean' && options.tolerant) {
extra.errors = [];
}
if (length > 0) {
if (typeof source[0] === 'undefined') {
// Try first to convert to a string. This is good as fast path
// for old IE which understands string indexing for string
// literals only and not for string object.
if (code instanceof String) {
source = code.valueOf();
}
}
}
try {
peek();
if (lookahead.type === Token.EOF) {
return extra.tokens;
}
token = lex();
while (lookahead.type !== Token.EOF) {
try {
token = lex();
} catch (lexError) {
token = lookahead;
if (extra.errors) {
extra.errors.push(lexError);
// We have to break on the first error
// to avoid infinite loops.
break;
} else {
throw lexError;
}
}
}
filterTokenLocation();
tokens = extra.tokens;
if (typeof extra.comments !== 'undefined') {
tokens.comments = extra.comments;
}
if (typeof extra.errors !== 'undefined') {
tokens.errors = extra.errors;
}
} catch (e) {
throw e;
} finally {
extra = {};
}
return tokens;
}
function parse(code, options) {
var program, toString;
toString = String;
if (typeof code !== 'string' && !(code instanceof String)) {
code = toString(code);
}
delegate = SyntaxTreeDelegate;
source = code;
index = 0;
lineNumber = (source.length > 0) ? 1 : 0;
lineStart = 0;
length = source.length;
lookahead = null;
state = {
allowIn: true,
labelSet: {},
inFunctionBody: false,
inIteration: false,
inSwitch: false,
lastCommentStart: -1,
markerStack: []
};
extra = {};
if (typeof options !== 'undefined') {
extra.range = (typeof options.range === 'boolean') && options.range;
extra.loc = (typeof options.loc === 'boolean') && options.loc;
extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;
if (extra.loc && options.source !== null && options.source !== undefined) {
extra.source = toString(options.source);
}
if (typeof options.tokens === 'boolean' && options.tokens) {
extra.tokens = [];
}
if (typeof options.comment === 'boolean' && options.comment) {
extra.comments = [];
}
if (typeof options.tolerant === 'boolean' && options.tolerant) {
extra.errors = [];
}
if (extra.attachComment) {
extra.range = true;
extra.pendingComments = [];
extra.comments = [];
}
}
if (length > 0) {
if (typeof source[0] === 'undefined') {
// Try first to convert to a string. This is good as fast path
// for old IE which understands string indexing for string
// literals only and not for string object.
if (code instanceof String) {
source = code.valueOf();
}
}
}
try {
program = parseProgram();
if (typeof extra.comments !== 'undefined') {
program.comments = extra.comments;
}
if (typeof extra.tokens !== 'undefined') {
filterTokenLocation();
program.tokens = extra.tokens;
}
if (typeof extra.errors !== 'undefined') {
program.errors = extra.errors;
}
if (extra.attachComment) {
attachComments();
}
} catch (e) {
throw e;
} finally {
extra = {};
}
return program;
}
// Sync with *.json manifests.
exports.version = '1.1.1';
exports.tokenize = tokenize;
exports.parse = parse;
// Deep copy.
exports.Syntax = (function () {
var name, types = {};
if (typeof Object.create === 'function') {
types = Object.create(null);
}
for (name in Syntax) {
if (Syntax.hasOwnProperty(name)) {
types[name] = Syntax[name];
}
}
if (typeof Object.freeze === 'function') {
Object.freeze(types);
}
return types;
}());
}));
/* vim: set sw=4 ts=4 et tw=80 : */
},{}],10:[function(require,module,exports){
module.exports = function(strings) {
if (typeof strings === 'string') strings = [strings]
var exprs = [].slice.call(arguments,1)
var parts = []
for (var i = 0; i < strings.length-1; i++) {
parts.push(strings[i], exprs[i] || '')
}
parts.push(strings[i])
return parts.join('')
}
},{}],11:[function(require,module,exports){
"use strict"
function iota(n) {
var result = new Array(n)
for(var i=0; i<n; ++i) {
result[i] = i
}
return result
}
module.exports = iota
},{}],12:[function(require,module,exports){
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}
},{}],13:[function(require,module,exports){
module.exports = function(arr) {
if (!arr) return false
if (!arr.dtype) return false
var re = new RegExp('function View[0-9]+d(:?' + arr.dtype + ')+')
return re.test(String(arr.constructor))
}
},{}],14:[function(require,module,exports){
"use strict"
var fill = require('cwise/lib/wrapper')({"args":["index","array","scalar"],"pre":{"body":"{}","args":[],"thisVars":[],"localVars":[]},"body":{"body":"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}","args":[{"name":"_inline_1_arg0_","lvalue":false,"rvalue":true,"count":1},{"name":"_inline_1_arg1_","lvalue":true,"rvalue":false,"count":1},{"name":"_inline_1_arg2_","lvalue":false,"rvalue":true,"count":1}],"thisVars":[],"localVars":[]},"post":{"body":"{}","args":[],"thisVars":[],"localVars":[]},"debug":false,"funcName":"cwise","blockSize":64})
module.exports = function(array, f) {
fill(array, f)
return array
}
},{"cwise/lib/wrapper":7}],15:[function(require,module,exports){
'use strict';
var fill = require('ndarray-fill');
var isndarray = require('isndarray');
var isnonneg = require('validate.io-nonnegative-integer');
var isbool = require('validate.io-boolean');
module.exports = linspace;
function linspace (output, start, end, options) {
var n, endpoint, axis, d;
if (!isndarray(output)) {
throw new Error('ndarray-linspace: First argument must be a ndarray');
}
n = output.shape[0];
options = options || {};
if (options.endpoint !== undefined && !isbool(options.endpoint)) {
throw new Error('ndarray-linspace: Endpoint must be a boolean. Got ' + options.endpoint);
}
endpoint = !!(options.endpoint || true);
if (options.axis !== undefined && !isnonneg(options.axis)) {
throw new Error('ndarray-linspace: Axis must be a nonegative integer. Got ' + options.axis);
}
// Default axis, after we've checked the input
axis = options.axis || 0;
if (axis > output.dimension) {
throw new Error('ndarray-linspace: Axis (' + axis + ') must be <= dimension (' + output.dimension + ')');
}
// Precompute the spacing:
d = (end - start) / Math.max(1, n - (endpoint ? 1 : 0));
// Fill it!
fill(output, function () {
return start + arguments[axis] * d;
});
return output;
}
},{"isndarray":13,"ndarray-fill":14,"validate.io-boolean":20,"validate.io-nonnegative-integer":22}],16:[function(require,module,exports){
'use strict';
module.exports = vectorFill;
var cwise = require('cwise');
var fill = cwise({
args: [{blockIndices: -1}, 'scalar', 'index', 'shape'],
body: function (A, func, idx, shape) {
var i;
var args = [];
var n = shape[shape.length - 1];
for (i = 0; i < n; i++) {
if (idx[i] === undefined) break;
args[i] = idx[i];
}
var f = func.apply(null, args);
for (i = 0; i < f.length; i++) {
A[i] = f[i];
}
}
});
function vectorFill (A, func) {
fill(A, func);
return A;
}
},{"cwise":6}],17:[function(require,module,exports){
var iota = require("iota-array")
var isBuffer = require("is-buffer")
var hasTypedArrays = ((typeof Float64Array) !== "undefined")
function compare1st(a, b) {
return a[0] - b[0]
}
function order() {
var stride = this.stride
var terms = new Array(stride.length)
var i
for(i=0; i<terms.length; ++i) {
terms[i] = [Math.abs(stride[i]), i]
}
terms.sort(compare1st)
var result = new Array(terms.length)
for(i=0; i<result.length; ++i) {
result[i] = terms[i][1]
}
return result
}
function compileConstructor(dtype, dimension) {
var className = ["View", dimension, "d", dtype].join("")
if(dimension < 0) {
className = "View_Nil" + dtype
}
var useGetters = (dtype === "generic")
if(dimension === -1) {
//Special case for trivial arrays
var code =
"function "+className+"(a){this.data=a;};\
var proto="+className+".prototype;\
proto.dtype='"+dtype+"';\
proto.index=function(){return -1};\
proto.size=0;\
proto.dimension=-1;\
proto.shape=proto.stride=proto.order=[];\
proto.lo=proto.hi=proto.transpose=proto.step=\
function(){return new "+className+"(this.data);};\
proto.get=proto.set=function(){};\
proto.pick=function(){return null};\
return function construct_"+className+"(a){return new "+className+"(a);}"
var procedure = new Function(code)
return procedure()
} else if(dimension === 0) {
//Special case for 0d arrays
var code =
"function "+className+"(a,d) {\
this.data = a;\
this.offset = d\
};\
var proto="+className+".prototype;\
proto.dtype='"+dtype+"';\
proto.index=function(){return this.offset};\
proto.dimension=0;\
proto.size=1;\
proto.shape=\
proto.stride=\
proto.order=[];\
proto.lo=\
proto.hi=\
proto.transpose=\
proto.step=function "+className+"_copy() {\
return new "+className+"(this.data,this.offset)\
};\
proto.pick=function "+className+"_pick(){\
return TrivialArray(this.data);\
};\
proto.valueOf=proto.get=function "+className+"_get(){\
return "+(useGetters ? "this.data.get(this.offset)" : "this.data[this.offset]")+
"};\
proto.set=function "+className+"_set(v){\
return "+(useGetters ? "this.data.set(this.offset,v)" : "this.data[this.offset]=v")+"\
};\
return function construct_"+className+"(a,b,c,d){return new "+className+"(a,d)}"
var procedure = new Function("TrivialArray", code)
return procedure(CACHED_CONSTRUCTORS[dtype][0])
}
var code = ["'use strict'"]
//Create constructor for view
var indices = iota(dimension)
var args = indices.map(function(i) { return "i"+i })
var index_str = "this.offset+" + indices.map(function(i) {
return "this.stride[" + i + "]*i" + i
}).join("+")
var shapeArg = indices.map(function(i) {
return "b"+i
}).join(",")
var strideArg = indices.map(function(i) {
return "c"+i
}).join(",")
code.push(
"function "+className+"(a," + shapeArg + "," + strideArg + ",d){this.data=a",
"this.shape=[" + shapeArg + "]",
"this.stride=[" + strideArg + "]",
"this.offset=d|0}",
"var proto="+className+".prototype",
"proto.dtype='"+dtype+"'",
"proto.dimension="+dimension)
//view.size:
code.push("Object.defineProperty(proto,'size',{get:function "+className+"_size(){\
return "+indices.map(function(i) { return "this.shape["+i+"]" }).join("*"),
"}})")
//view.order:
if(dimension === 1) {
code.push("proto.order=[0]")
} else {
code.push("Object.defineProperty(proto,'order',{get:")
if(dimension < 4) {
code.push("function "+className+"_order(){")
if(dimension === 2) {
code.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})")
} else if(dimension === 3) {
code.push(
"var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);\
if(s0>s1){\
if(s1>s2){\
return [2,1,0];\
}else if(s0>s2){\
return [1,2,0];\
}else{\
return [1,0,2];\
}\
}else if(s0>s2){\
return [2,0,1];\
}else if(s2>s1){\
return [0,1,2];\
}else{\
return [0,2,1];\
}}})")
}
} else {
code.push("ORDER})")
}
}
//view.set(i0, ..., v):
code.push(
"proto.set=function "+className+"_set("+args.join(",")+",v){")
if(useGetters) {
code.push("return this.data.set("+index_str+",v)}")
} else {
code.push("return this.data["+index_str+"]=v}")
}
//view.get(i0, ...):
code.push("proto.get=function "+className+"_get("+args.join(",")+"){")
if(useGetters) {
code.push("return this.data.get("+index_str+")}")
} else {
code.push("return this.data["+index_str+"]}")
}
//view.index:
code.push(
"proto.index=function "+className+"_index(", args.join(), "){return "+index_str+"}")
//view.hi():
code.push("proto.hi=function "+className+"_hi("+args.join(",")+"){return new "+className+"(this.data,"+
indices.map(function(i) {
return ["(typeof i",i,"!=='number'||i",i,"<0)?this.shape[", i, "]:i", i,"|0"].join("")
}).join(",")+","+
indices.map(function(i) {
return "this.stride["+i + "]"
}).join(",")+",this.offset)}")
//view.lo():
var a_vars = indices.map(function(i) { return "a"+i+"=this.shape["+i+"]" })
var c_vars = indices.map(function(i) { return "c"+i+"=this.stride["+i+"]" })
code.push("proto.lo=function "+className+"_lo("+args.join(",")+"){var b=this.offset,d=0,"+a_vars.join(",")+","+c_vars.join(","))
for(var i=0; i<dimension; ++i) {
code.push(
"if(typeof i"+i+"==='number'&&i"+i+">=0){\
d=i"+i+"|0;\
b+=c"+i+"*d;\
a"+i+"-=d}")
}
code.push("return new "+className+"(this.data,"+
indices.map(function(i) {
return "a"+i
}).join(",")+","+
indices.map(function(i) {
return "c"+i
}).join(",")+",b)}")
//view.step():
code.push("proto.step=function "+className+"_step("+args.join(",")+"){var "+
indices.map(function(i) {
return "a"+i+"=this.shape["+i+"]"
}).join(",")+","+
indices.map(function(i) {
return "b"+i+"=this.stride["+i+"]"
}).join(",")+",c=this.offset,d=0,ceil=Math.ceil")
for(var i=0; i<dimension; ++i) {
code.push(
"if(typeof i"+i+"==='number'){\
d=i"+i+"|0;\
if(d<0){\
c+=b"+i+"*(a"+i+"-1);\
a"+i+"=ceil(-a"+i+"/d)\
}else{\
a"+i+"=ceil(a"+i+"/d)\
}\
b"+i+"*=d\
}")
}
code.push("return new "+className+"(this.data,"+
indices.map(function(i) {
return "a" + i
}).join(",")+","+
indices.map(function(i) {
return "b" + i
}).join(",")+",c)}")
//view.transpose():
var tShape = new Array(dimension)
var tStride = new Array(dimension)
for(var i=0; i<dimension; ++i) {
tShape[i] = "a[i"+i+"]"
tStride[i] = "b[i"+i+"]"
}
code.push("proto.transpose=function "+className+"_transpose("+args+"){"+
args.map(function(n,idx) { return n + "=(" + n + "===undefined?" + idx + ":" + n + "|0)"}).join(";"),
"var a=this.shape,b=this.stride;return new "+className+"(this.data,"+tShape.join(",")+","+tStride.join(",")+",this.offset)}")
//view.pick():
code.push("proto.pick=function "+className+"_pick("+args+"){var a=[],b=[],c=this.offset")
for(var i=0; i<dimension; ++i) {
code.push("if(typeof i"+i+"==='number'&&i"+i+">=0){c=(c+this.stride["+i+"]*i"+i+")|0}else{a.push(this.shape["+i+"]);b.push(this.stride["+i+"])}")
}
code.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}")
//Add return statement
code.push("return function construct_"+className+"(data,shape,stride,offset){return new "+className+"(data,"+
indices.map(function(i) {
return "shape["+i+"]"
}).join(",")+","+
indices.map(function(i) {
return "stride["+i+"]"
}).join(",")+",offset)}")
//Compile procedure
var procedure = new Function("CTOR_LIST", "ORDER", code.join("\n"))
return procedure(CACHED_CONSTRUCTORS[dtype], order)
}
function arrayDType(data) {
if(isBuffer(data)) {
return "buffer"
}
if(hasTypedArrays) {
switch(Object.prototype.toString.call(data)) {
case "[object Float64Array]":
return "float64"
case "[object Float32Array]":
return "float32"
case "[object Int8Array]":
return "int8"
case "[object Int16Array]":
return "int16"
case "[object Int32Array]":
return "int32"
case "[object Uint8Array]":
return "uint8"
case "[object Uint16Array]":
return "uint16"
case "[object Uint32Array]":
return "uint32"
case "[object Uint8ClampedArray]":
return "uint8_clamped"
}
}
if(Array.isArray(data)) {
return "array"
}
return "generic"
}
var CACHED_CONSTRUCTORS = {
"float32":[],
"float64":[],
"int8":[],
"int16":[],
"int32":[],
"uint8":[],
"uint16":[],
"uint32":[],
"array":[],
"uint8_clamped":[],
"buffer":[],
"generic":[]
}
;(function() {
for(var id in CACHED_CONSTRUCTORS) {
CACHED_CONSTRUCTORS[id].push(compileConstructor(id, -1))
}
});
function wrappedNDArrayCtor(data, shape, stride, offset) {
if(data === undefined) {
var ctor = CACHED_CONSTRUCTORS.array[0]
return ctor([])
} else if(typeof data === "number") {
data = [data]
}
if(shape === undefined) {
shape = [ data.length ]
}
var d = shape.length
if(stride === undefined) {
stride = new Array(d)
for(var i=d-1, sz=1; i>=0; --i) {
stride[i] = sz
sz *= shape[i]
}
}
if(offset === undefined) {
offset = 0
for(var i=0; i<d; ++i) {
if(stride[i] < 0) {
offset -= (shape[i]-1)*stride[i]
}
}
}
var dtype = arrayDType(data)
var ctor_list = CACHED_CONSTRUCTORS[dtype]
while(ctor_list.length <= d+1) {
ctor_list.push(compileConstructor(dtype, ctor_list.length-1))
}
var ctor = ctor_list[d+1]
return ctor(data, shape, stride, offset)
}
module.exports = wrappedNDArrayCtor
},{"iota-array":11,"is-buffer":12}],18:[function(require,module,exports){
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.createREGL = factory());
}(this, (function () { 'use strict';
var arrayTypes = {
"[object Int8Array]": 5120,
"[object Int16Array]": 5122,
"[object Int32Array]": 5124,
"[object Uint8Array]": 5121,
"[object Uint8ClampedArray]": 5121,
"[object Uint16Array]": 5123,
"[object Uint32Array]": 5125,
"[object Float32Array]": 5126,
"[object Float64Array]": 5121,
"[object ArrayBuffer]": 5121
};
var isTypedArray = function (x) {
return Object.prototype.toString.call(x) in arrayTypes
};
var extend = function (base, opts) {
var keys = Object.keys(opts);
for (var i = 0; i < keys.length; ++i) {
base[keys[i]] = opts[keys[i]];
}
return base
};
// Error checking and parameter validation.
//
// Statements for the form `check.someProcedure(...)` get removed by
// a browserify transform for optimized/minified bundles.
//
/* globals btoa */
// only used for extracting shader names. if btoa not present, then errors
// will be slightly crappier
function decodeB64 (str) {
if (typeof btoa !== 'undefined') {
return btoa(str)
}
return 'base64:' + str
}
function raise (message) {
var error = new Error('(regl) ' + message);
console.error(error);
throw error
}
function check (pred, message) {
if (!pred) {
raise(message);
}
}
function encolon (message) {
if (message) {
return ': ' + message
}
return ''
}
function checkParameter (param, possibilities, message) {
if (!(param in possibilities)) {
raise('unknown parameter (' + param + ')' + encolon(message) +
'. possible values: ' + Object.keys(possibilities).join());
}
}
function checkIsTypedArray (data, message) {
if (!isTypedArray(data)) {
raise(
'invalid parameter type' + encolon(message) +
'. must be a typed array');
}
}
function checkTypeOf (value, type, message) {
if (typeof value !== type) {
raise(
'invalid parameter type' + encolon(message) +
'. expected ' + type + ', got ' + (typeof value));
}
}
function checkNonNegativeInt (value, message) {
if (!((value >= 0) &&
((value | 0) === value))) {
raise('invalid parameter type, (' + value + ')' + encolon(message) +
'. must be a nonnegative integer');
}
}
function checkOneOf (value, list, message) {
if (list.indexOf(value) < 0) {
raise('invalid value' + encolon(message) + '. must be one of: ' + list);
}
}
var constructorKeys = [
'gl',
'canvas',
'container',
'attributes',
'pixelRatio',
'extensions',
'optionalExtensions',
'profile',
'onDone'
];
function checkConstructor (obj) {
Object.keys(obj).forEach(function (key) {
if (constructorKeys.indexOf(key) < 0) {
raise('invalid regl constructor argument "' + key + '". must be one of ' + constructorKeys);
}
});
}
function leftPad (str, n) {
str = str + '';
while (str.length < n) {
str = ' ' + str;
}
return str
}
function ShaderFile () {
this.name = 'unknown';
this.lines = [];
this.index = {};
this.hasErrors = false;
}
function ShaderLine (number, line) {
this.number = number;
this.line = line;
this.errors = [];
}
function ShaderError (fileNumber, lineNumber, message) {
this.file = fileNumber;
this.line = lineNumber;
this.message = message;
}
function guessCommand () {
var error = new Error();
var stack = (error.stack || error).toString();
var pat = /compileProcedure.*\n\s*at.*\((.*)\)/.exec(stack);
if (pat) {
return pat[1]
}
var pat2 = /compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(stack);
if (pat2) {
return pat2[1]
}
return 'unknown'
}
function guessCallSite () {
var error = new Error();
var stack = (error.stack || error).toString();
var pat = /at REGLCommand.*\n\s+at.*\((.*)\)/.exec(stack);
if (pat) {
return pat[1]
}
var pat2 = /at REGLCommand.*\n\s+at\s+(.*)\n/.exec(stack);
if (pat2) {
return pat2[1]
}
return 'unknown'
}
function parseSource (source, command) {
var lines = source.split('\n');
var lineNumber = 1;
var fileNumber = 0;
var files = {
unknown: new ShaderFile(),
0: new ShaderFile()
};
files.unknown.name = files[0].name = command || guessCommand();
files.unknown.lines.push(new ShaderLine(0, ''));
for (var i = 0; i < lines.length; ++i) {
var line = lines[i];
var parts = /^\s*\#\s*(\w+)\s+(.+)\s*$/.exec(line);
if (parts) {
switch (parts[1]) {
case 'line':
var lineNumberInfo = /(\d+)(\s+\d+)?/.exec(parts[2]);
if (lineNumberInfo) {
lineNumber = lineNumberInfo[1] | 0;
if (lineNumberInfo[2]) {
fileNumber = lineNumberInfo[2] | 0;
if (!(fileNumber in files)) {
files[fileNumber] = new ShaderFile();
}
}
}
break
case 'define':
var nameInfo = /SHADER_NAME(_B64)?\s+(.*)$/.exec(parts[2]);
if (nameInfo) {
files[fileNumber].name = (nameInfo[1]
? decodeB64(nameInfo[2])
: nameInfo[2]);
}
break
}
}
files[fileNumber].lines.push(new ShaderLine(lineNumber++, line));
}
Object.keys(files).forEach(function (fileNumber) {
var file = files[fileNumber];
file.lines.forEach(function (line) {
file.index[line.number] = line;
});
});
return files
}
function parseErrorLog (errLog) {
var result = [];
errLog.split('\n').forEach(function (errMsg) {
if (errMsg.length < 5) {
return
}
var parts = /^ERROR\:\s+(\d+)\:(\d+)\:\s*(.*)$/.exec(errMsg);
if (parts) {
result.push(new ShaderError(
parts[1] | 0,
parts[2] | 0,
parts[3].trim()));
} else if (errMsg.length > 0) {
result.push(new ShaderError('unknown', 0, errMsg));
}
});
return result
}
function annotateFiles (files, errors) {
errors.forEach(function (error) {
var file = files[error.file];
if (file) {
var line = file.index[error.line];
if (line) {
line.errors.push(error);
file.hasErrors = true;
return
}
}
files.unknown.hasErrors = true;
files.unknown.lines[0].errors.push(error);
});
}
function checkShaderError (gl, shader, source, type, command) {
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
var errLog = gl.getShaderInfoLog(shader);
var typeName = type === gl.FRAGMENT_SHADER ? 'fragment' : 'vertex';
checkCommandType(source, 'string', typeName + ' shader source must be a string', command);
var files = parseSource(source, command);
var errors = parseErrorLog(errLog);
annotateFiles(files, errors);
Object.keys(files).forEach(function (fileNumber) {
var file = files[fileNumber];
if (!file.hasErrors) {
return
}
var strings = [''];
var styles = [''];
function push (str, style) {
strings.push(str);
styles.push(style || '');
}
push('file number ' + fileNumber + ': ' + file.name + '\n', 'color:red;text-decoration:underline;font-weight:bold');
file.lines.forEach(function (line) {
if (line.errors.length > 0) {
push(leftPad(line.number, 4) + '| ', 'background-color:yellow; font-weight:bold');
push(line.line + '\n', 'color:red; background-color:yellow; font-weight:bold');
// try to guess token
var offset = 0;
line.errors.forEach(function (error) {
var message = error.message;
var token = /^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(message);
if (token) {
var tokenPat = token[1];
message = token[2];
switch (tokenPat) {
case 'assign':
tokenPat = '=';
break
}
offset = Math.max(line.line.indexOf(tokenPat, offset), 0);
} else {
offset = 0;
}
push(leftPad('| ', 6));
push(leftPad('^^^', offset + 3) + '\n', 'font-weight:bold');
push(leftPad('| ', 6));
push(message + '\n', 'font-weight:bold');
});
push(leftPad('| ', 6) + '\n');
} else {
push(leftPad(line.number, 4) + '| ');
push(line.line + '\n', 'color:red');
}
});
if (typeof document !== 'undefined') {
styles[0] = strings.join('%c');
console.log.apply(console, styles);
} else {
console.log(strings.join(''));
}
});
check.raise('Error compiling ' + typeName + ' shader, ' + files[0].name);
}
}
function checkLinkError (gl, program, fragShader, vertShader, command) {
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
var errLog = gl.getProgramInfoLog(program);
var fragParse = parseSource(fragShader, command);
var vertParse = parseSource(vertShader, command);
var header = 'Error linking program with vertex shader, "' +
vertParse[0].name + '", and fragment shader "' + fragParse[0].name + '"';
if (typeof document !== 'undefined') {
console.log('%c' + header + '\n%c' + errLog,
'color:red;text-decoration:underline;font-weight:bold',
'color:red');
} else {
console.log(header + '\n' + errLog);
}
check.raise(header);
}
}
function saveCommandRef (object) {
object._commandRef = guessCommand();
}
function saveDrawCommandInfo (opts, uniforms, attributes, stringStore) {
saveCommandRef(opts);
function id (str) {
if (str) {
return stringStore.id(str)
}
return 0
}
opts._fragId = id(opts.static.frag);
opts._vertId = id(opts.static.vert);
function addProps (dict, set) {
Object.keys(set).forEach(function (u) {
dict[stringStore.id(u)] = true;
});
}
var uniformSet = opts._uniformSet = {};
addProps(uniformSet, uniforms.static);
addProps(uniformSet, uniforms.dynamic);
var attributeSet = opts._attributeSet = {};
addProps(attributeSet, attributes.static);
addProps(attributeSet, attributes.dynamic);
opts._hasCount = (
'count' in opts.static ||
'count' in opts.dynamic ||
'elements' in opts.static ||
'elements' in opts.dynamic);
}
function commandRaise (message, command) {
var callSite = guessCallSite();
raise(message +
' in command ' + (command || guessCommand()) +
(callSite === 'unknown' ? '' : ' called from ' + callSite));
}
function checkCommand (pred, message, command) {
if (!pred) {
commandRaise(message, command || guessCommand());
}
}
function checkParameterCommand (param, possibilities, message, command) {
if (!(param in possibilities)) {
commandRaise(
'unknown parameter (' + param + ')' + encolon(message) +
'. possible values: ' + Object.keys(possibilities).join(),
command || guessCommand());
}
}
function checkCommandType (value, type, message, command) {
if (typeof value !== type) {
commandRaise(
'invalid parameter type' + encolon(message) +
'. expected ' + type + ', got ' + (typeof value),
command || guessCommand());
}
}
function checkOptional (block) {
block();
}
function checkFramebufferFormat (attachment, texFormats, rbFormats) {
if (attachment.texture) {
checkOneOf(
attachment.texture._texture.internalformat,
texFormats,
'unsupported texture format for attachment');
} else {
checkOneOf(
attachment.renderbuffer._renderbuffer.format,
rbFormats,
'unsupported renderbuffer format for attachment');
}
}
var GL_CLAMP_TO_EDGE = 0x812F;
var GL_NEAREST = 0x2600;
var GL_NEAREST_MIPMAP_NEAREST = 0x2700;
var GL_LINEAR_MIPMAP_NEAREST = 0x2701;
var GL_NEAREST_MIPMAP_LINEAR = 0x2702;
var GL_LINEAR_MIPMAP_LINEAR = 0x2703;
var GL_BYTE = 5120;
var GL_UNSIGNED_BYTE = 5121;
var GL_SHORT = 5122;
var GL_UNSIGNED_SHORT = 5123;
var GL_INT = 5124;
var GL_UNSIGNED_INT = 5125;
var GL_FLOAT = 5126;
var GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
var GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
var GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
var GL_UNSIGNED_INT_24_8_WEBGL = 0x84FA;
var GL_HALF_FLOAT_OES = 0x8D61;
var TYPE_SIZE = {};
TYPE_SIZE[GL_BYTE] =
TYPE_SIZE[GL_UNSIGNED_BYTE] = 1;
TYPE_SIZE[GL_SHORT] =
TYPE_SIZE[GL_UNSIGNED_SHORT] =
TYPE_SIZE[GL_HALF_FLOAT_OES] =
TYPE_SIZE[GL_UNSIGNED_SHORT_5_6_5] =
TYPE_SIZE[GL_UNSIGNED_SHORT_4_4_4_4] =
TYPE_SIZE[GL_UNSIGNED_SHORT_5_5_5_1] = 2;
TYPE_SIZE[GL_INT] =
TYPE_SIZE[GL_UNSIGNED_INT] =
TYPE_SIZE[GL_FLOAT] =
TYPE_SIZE[GL_UNSIGNED_INT_24_8_WEBGL] = 4;
function pixelSize (type, channels) {
if (type === GL_UNSIGNED_SHORT_5_5_5_1 ||
type === GL_UNSIGNED_SHORT_4_4_4_4 ||
type === GL_UNSIGNED_SHORT_5_6_5) {
return 2
} else if (type === GL_UNSIGNED_INT_24_8_WEBGL) {
return 4
} else {
return TYPE_SIZE[type] * channels
}
}
function isPow2 (v) {
return !(v & (v - 1)) && (!!v)
}
function checkTexture2D (info, mipData, limits) {
var i;
var w = mipData.width;
var h = mipData.height;
var c = mipData.channels;
// Check texture shape
check(w > 0 && w <= limits.maxTextureSize &&
h > 0 && h <= limits.maxTextureSize,
'invalid texture shape');
// check wrap mode
if (info.wrapS !== GL_CLAMP_TO_EDGE || info.wrapT !== GL_CLAMP_TO_EDGE) {
check(isPow2(w) && isPow2(h),
'incompatible wrap mode for texture, both width and height must be power of 2');
}
if (mipData.mipmask === 1) {
if (w !== 1 && h !== 1) {
check(
info.minFilter !== GL_NEAREST_MIPMAP_NEAREST &&
info.minFilter !== GL_NEAREST_MIPMAP_LINEAR &&
info.minFilter !== GL_LINEAR_MIPMAP_NEAREST &&
info.minFilter !== GL_LINEAR_MIPMAP_LINEAR,
'min filter requires mipmap');
}
} else {
// texture must be power of 2
check(isPow2(w) && isPow2(h),
'texture must be a square power of 2 to support mipmapping');
check(mipData.mipmask === (w << 1) - 1,
'missing or incomplete mipmap data');
}
if (mipData.type === GL_FLOAT) {
if (limits.extensions.indexOf('oes_texture_float_linear') < 0) {
check(info.minFilter === GL_NEAREST && info.magFilter === GL_NEAREST,
'filter not supported, must enable oes_texture_float_linear');
}
check(!info.genMipmaps,
'mipmap generation not supported with float textures');
}
// check image complete
var mipimages = mipData.images;
for (i = 0; i < 16; ++i) {
if (mipimages[i]) {
var mw = w >> i;
var mh = h >> i;
check(mipData.mipmask & (1 << i), 'missing mipmap data');
var img = mipimages[i];
check(
img.width === mw &&
img.height === mh,
'invalid shape for mip images');
check(
img.format === mipData.format &&
img.internalformat === mipData.internalformat &&
img.type === mipData.type,
'incompatible type for mip image');
if (img.compressed) {
// TODO: check size for compressed images
} else if (img.data) {
// check(img.data.byteLength === mw * mh *
// Math.max(pixelSize(img.type, c), img.unpackAlignment),
var rowSize = Math.ceil(pixelSize(img.type, c) * mw / img.unpackAlignment) * img.unpackAlignment;
check(img.data.byteLength === rowSize * mh,
'invalid data for image, buffer size is inconsistent with image format');
} else if (img.element) {
// TODO: check element can be loaded
} else if (img.copy) {
// TODO: check compatible format and type
}
} else if (!info.genMipmaps) {
check((mipData.mipmask & (1 << i)) === 0, 'extra mipmap data');
}
}
if (mipData.compressed) {
check(!info.genMipmaps,
'mipmap generation for compressed images not supported');
}
}
function checkTextureCube (texture, info, faces, limits) {
var w = texture.width;
var h = texture.height;
var c = texture.channels;
// Check texture shape
check(
w > 0 && w <= limits.maxTextureSize && h > 0 && h <= limits.maxTextureSize,
'invalid texture shape');
check(
w === h,
'cube map must be square');
check(
info.wrapS === GL_CLAMP_TO_EDGE && info.wrapT === GL_CLAMP_TO_EDGE,
'wrap mode not supported by cube map');
for (var i = 0; i < faces.length; ++i) {
var face = faces[i];
check(
face.width === w && face.height === h,
'inconsistent cube map face shape');
if (info.genMipmaps) {
check(!face.compressed,
'can not generate mipmap for compressed textures');
check(face.mipmask === 1,
'can not specify mipmaps and generate mipmaps');
} else {
// TODO: check mip and filter mode
}
var mipmaps = face.images;
for (var j = 0; j < 16; ++j) {
var img = mipmaps[j];
if (img) {
var mw = w >> j;
var mh = h >> j;
check(face.mipmask & (1 << j), 'missing mipmap data');
check(
img.width === mw &&
img.height === mh,
'invalid shape for mip images');
check(
img.format === texture.format &&
img.internalformat === texture.internalformat &&
img.type === texture.type,
'incompatible type for mip image');
if (img.compressed) {
// TODO: check size for compressed images
} else if (img.data) {
check(img.data.byteLength === mw * mh *
Math.max(pixelSize(img.type, c), img.unpackAlignment),
'invalid data for image, buffer size is inconsistent with image format');
} else if (img.element) {
// TODO: check element can be loaded
} else if (img.copy) {
// TODO: check compatible format and type
}
}
}
}
}
var check$1 = extend(check, {
optional: checkOptional,
raise: raise,
commandRaise: commandRaise,
command: checkCommand,
parameter: checkParameter,
commandParameter: checkParameterCommand,
constructor: checkConstructor,
type: checkTypeOf,
commandType: checkCommandType,
isTypedArray: checkIsTypedArray,
nni: checkNonNegativeInt,
oneOf: checkOneOf,
shaderError: checkShaderError,
linkError: checkLinkError,
callSite: guessCallSite,
saveCommandRef: saveCommandRef,
saveDrawInfo: saveDrawCommandInfo,
framebufferFormat: checkFramebufferFormat,
guessCommand: guessCommand,
texture2D: checkTexture2D,
textureCube: checkTextureCube
});
var VARIABLE_COUNTER = 0;
var DYN_FUNC = 0;
function DynamicVariable (type, data) {
this.id = (VARIABLE_COUNTER++);
this.type = type;
this.data = data;
}
function escapeStr (str) {
return str.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
}
function splitParts (str) {
if (str.length === 0) {
return []
}
var firstChar = str.charAt(0);
var lastChar = str.charAt(str.length - 1);
if (str.length > 1 &&
firstChar === lastChar &&
(firstChar === '"' || firstChar === "'")) {
return ['"' + escapeStr(str.substr(1, str.length - 2)) + '"']
}
var parts = /\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(str);
if (parts) {
return (
splitParts(str.substr(0, parts.index))
.concat(splitParts(parts[1]))
.concat(splitParts(str.substr(parts.index + parts[0].length)))
)
}
var subparts = str.split('.');
if (subparts.length === 1) {
return ['"' + escapeStr(str) + '"']
}
var result = [];
for (var i = 0; i < subparts.length; ++i) {
result = result.concat(splitParts(subparts[i]));
}
return result
}
function toAccessorString (str) {
return '[' + splitParts(str).join('][') + ']'
}
function defineDynamic (type, data) {
return new DynamicVariable(type, toAccessorString(data + ''))
}
function isDynamic (x) {
return (typeof x === 'function' && !x._reglType) ||
x instanceof DynamicVariable
}
function unbox (x, path) {
if (typeof x === 'function') {
return new DynamicVariable(DYN_FUNC, x)
}
return x
}
var dynamic = {
DynamicVariable: DynamicVariable,
define: defineDynamic,
isDynamic: isDynamic,
unbox: unbox,
accessor: toAccessorString
};
/* globals requestAnimationFrame, cancelAnimationFrame */
var raf = {
next: typeof requestAnimationFrame === 'function'
? function (cb) { return requestAnimationFrame(cb) }
: function (cb) { return setTimeout(cb, 16) },
cancel: typeof cancelAnimationFrame === 'function'
? function (raf) { return cancelAnimationFrame(raf) }
: clearTimeout
};
/* globals performance */
var clock = (typeof performance !== 'undefined' && performance.now)
? function () { return performance.now() }
: function () { return +(new Date()) };
function createStringStore () {
var stringIds = {'': 0};
var stringValues = [''];
return {
id: function (str) {
var result = stringIds[str];
if (result) {
return result
}
result = stringIds[str] = stringValues.length;
stringValues.push(str);
return result
},
str: function (id) {
return stringValues[id]
}
}
}
// Context and canvas creation helper functions
function createCanvas (element, onDone, pixelRatio) {
var canvas = document.createElement('canvas');
extend(canvas.style, {
border: 0,
margin: 0,
padding: 0,
top: 0,
left: 0
});
element.appendChild(canvas);
if (element === document.body) {
canvas.style.position = 'absolute';
extend(element.style, {
margin: 0,
padding: 0
});
}
function resize () {
var w = window.innerWidth;
var h = window.innerHeight;
if (element !== document.body) {
var bounds = element.getBoundingClientRect();
w = bounds.right - bounds.left;
h = bounds.bottom - bounds.top;
}
canvas.width = pixelRatio * w;
canvas.height = pixelRatio * h;
extend(canvas.style, {
width: w + 'px',
height: h + 'px'
});
}
window.addEventListener('resize', resize, false);
function onDestroy () {
window.removeEventListener('resize', resize);
element.removeChild(canvas);
}
resize();
return {
canvas: canvas,
onDestroy: onDestroy
}
}
function createContext (canvas, contexAttributes) {
function get (name) {
try {
return canvas.getContext(name, contexAttributes)
} catch (e) {
return null
}
}
return (
get('webgl') ||
get('experimental-webgl') ||
get('webgl-experimental')
)
}
function isHTMLElement (obj) {
return (
typeof obj.nodeName === 'string' &&
typeof obj.appendChild === 'function' &&
typeof obj.getBoundingClientRect === 'function'
)
}
function isWebGLContext (obj) {
return (
typeof obj.drawArrays === 'function' ||
typeof obj.drawElements === 'function'
)
}
function parseExtensions (input) {
if (typeof input === 'string') {
return input.split()
}
check$1(Array.isArray(input), 'invalid extension array');
return input
}
function getElement (desc) {
if (typeof desc === 'string') {
check$1(typeof document !== 'undefined', 'not supported outside of DOM');
return document.querySelector(desc)
}
return desc
}
function parseArgs (args_) {
var args = args_ || {};
var element, container, canvas, gl;
var contextAttributes = {};
var extensions = [];
var optionalExtensions = [];
var pixelRatio = (typeof window === 'undefined' ? 1 : window.devicePixelRatio);
var profile = false;
var onDone = function (err) {
if (err) {
check$1.raise(err);
}
};
var onDestroy = function () {};
if (typeof args === 'string') {
check$1(
typeof document !== 'undefined',
'selector queries only supported in DOM enviroments');
element = document.querySelector(args);
check$1(element, 'invalid query string for element');
} else if (typeof args === 'object') {
if (isHTMLElement(args)) {
element = args;
} else if (isWebGLContext(args)) {
gl = args;
canvas = gl.canvas;
} else {
check$1.constructor(args);
if ('gl' in args) {
gl = args.gl;
} else if ('canvas' in args) {
canvas = getElement(args.canvas);
} else if ('container' in args) {
container = getElement(args.container);
}
if ('attributes' in args) {
contextAttributes = args.attributes;
check$1.type(contextAttributes, 'object', 'invalid context attributes');
}
if ('extensions' in args) {
extensions = parseExtensions(args.extensions);
}
if ('optionalExtensions' in args) {
optionalExtensions = parseExtensions(args.optionalExtensions);
}
if ('onDone' in args) {
check$1.type(
args.onDone, 'function',
'invalid or missing onDone callback');
onDone = args.onDone;
}
if ('profile' in args) {
profile = !!args.profile;
}
if ('pixelRatio' in args) {
pixelRatio = +args.pixelRatio;
check$1(pixelRatio > 0, 'invalid pixel ratio');
}
}
} else {
check$1.raise('invalid arguments to regl');
}
if (element) {
if (element.nodeName.toLowerCase() === 'canvas') {
canvas = element;
} else {
container = element;
}
}
if (!gl) {
if (!canvas) {
check$1(
typeof document !== 'undefined',
'must manually specify webgl context outside of DOM environments');
var result = createCanvas(container || document.body, onDone, pixelRatio);
if (!result) {
return null
}
canvas = result.canvas;
onDestroy = result.onDestroy;
}
gl = createContext(canvas, contextAttributes);
}
if (!gl) {
onDestroy();
onDone('webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org');
return null
}
return {
gl: gl,
canvas: canvas,
container: container,
extensions: extensions,
optionalExtensions: optionalExtensions,
pixelRatio: pixelRatio,
profile: profile,
onDone: onDone,
onDestroy: onDestroy
}
}
function createExtensionCache (gl, config) {
var extensions = {};
function tryLoadExtension (name_) {
check$1.type(name_, 'string', 'extension name must be string');
var name = name_.toLowerCase();
var ext;
try {
ext = extensions[name] = gl.getExtension(name);
} catch (e) {}
return !!ext
}
for (var i = 0; i < config.extensions.length; ++i) {
var name = config.extensions[i];
if (!tryLoadExtension(name)) {
config.onDestroy();
config.onDone('"' + name + '" extension is not supported by the current WebGL context, try upgrading your system or a different browser');
return null
}
}
config.optionalExtensions.forEach(tryLoadExtension);
return {
extensions: extensions,
restore: function () {
Object.keys(extensions).forEach(function (name) {
if (!tryLoadExtension(name)) {
throw new Error('(regl): error restoring extension ' + name)
}
});
}
}
}
var GL_SUBPIXEL_BITS = 0x0D50;
var GL_RED_BITS = 0x0D52;
var GL_GREEN_BITS = 0x0D53;
var GL_BLUE_BITS = 0x0D54;
var GL_ALPHA_BITS = 0x0D55;
var GL_DEPTH_BITS = 0x0D56;
var GL_STENCIL_BITS = 0x0D57;
var GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
var GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
var GL_MAX_TEXTURE_SIZE = 0x0D33;
var GL_MAX_VIEWPORT_DIMS = 0x0D3A;
var GL_MAX_VERTEX_ATTRIBS = 0x8869;
var GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
var GL_MAX_VARYING_VECTORS = 0x8DFC;
var GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
var GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
var GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872;
var GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
var GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
var GL_MAX_RENDERBUFFER_SIZE = 0x84E8;
var GL_VENDOR = 0x1F00;
var GL_RENDERER = 0x1F01;
var GL_VERSION = 0x1F02;
var GL_SHADING_LANGUAGE_VERSION = 0x8B8C;
var GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
var GL_MAX_COLOR_ATTACHMENTS_WEBGL = 0x8CDF;
var GL_MAX_DRAW_BUFFERS_WEBGL = 0x8824;
var wrapLimits = function (gl, extensions) {
var maxAnisotropic = 1;
if (extensions.ext_texture_filter_anisotropic) {
maxAnisotropic = gl.getParameter(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT);
}
var maxDrawbuffers = 1;
var maxColorAttachments = 1;
if (extensions.webgl_draw_buffers) {
maxDrawbuffers = gl.getParameter(GL_MAX_DRAW_BUFFERS_WEBGL);
maxColorAttachments = gl.getParameter(GL_MAX_COLOR_ATTACHMENTS_WEBGL);
}
return {
// drawing buffer bit depth
colorBits: [
gl.getParameter(GL_RED_BITS),
gl.getParameter(GL_GREEN_BITS),
gl.getParameter(GL_BLUE_BITS),
gl.getParameter(GL_ALPHA_BITS)
],
depthBits: gl.getParameter(GL_DEPTH_BITS),
stencilBits: gl.getParameter(GL_STENCIL_BITS),
subpixelBits: gl.getParameter(GL_SUBPIXEL_BITS),
// supported extensions
extensions: Object.keys(extensions).filter(function (ext) {
return !!extensions[ext]
}),
// max aniso samples
maxAnisotropic: maxAnisotropic,
// max draw buffers
maxDrawbuffers: maxDrawbuffers,
maxColorAttachments: maxColorAttachments,
// point and line size ranges
pointSizeDims: gl.getParameter(GL_ALIASED_POINT_SIZE_RANGE),
lineWidthDims: gl.getParameter(GL_ALIASED_LINE_WIDTH_RANGE),
maxViewportDims: gl.getParameter(GL_MAX_VIEWPORT_DIMS),
maxCombinedTextureUnits: gl.getParameter(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS),
maxCubeMapSize: gl.getParameter(GL_MAX_CUBE_MAP_TEXTURE_SIZE),
maxRenderbufferSize: gl.getParameter(GL_MAX_RENDERBUFFER_SIZE),
maxTextureUnits: gl.getParameter(GL_MAX_TEXTURE_IMAGE_UNITS),
maxTextureSize: gl.getParameter(GL_MAX_TEXTURE_SIZE),
maxAttributes: gl.getParameter(GL_MAX_VERTEX_ATTRIBS),
maxVertexUniforms: gl.getParameter(GL_MAX_VERTEX_UNIFORM_VECTORS),
maxVertexTextureUnits: gl.getParameter(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS),
maxVaryingVectors: gl.getParameter(GL_MAX_VARYING_VECTORS),
maxFragmentUniforms: gl.getParameter(GL_MAX_FRAGMENT_UNIFORM_VECTORS),
// vendor info
glsl: gl.getParameter(GL_SHADING_LANGUAGE_VERSION),
renderer: gl.getParameter(GL_RENDERER),
vendor: gl.getParameter(GL_VENDOR),
version: gl.getParameter(GL_VERSION)
}
};
function isNDArrayLike (obj) {
return (
!!obj &&
typeof obj === 'object' &&
Array.isArray(obj.shape) &&
Array.isArray(obj.stride) &&
typeof obj.offset === 'number' &&
obj.shape.length === obj.stride.length &&
(Array.isArray(obj.data) ||
isTypedArray(obj.data)))
}
var values = function (obj) {
return Object.keys(obj).map(function (key) { return obj[key] })
};
function loop (n, f) {
var result = Array(n);
for (var i = 0; i < n; ++i) {
result[i] = f(i);
}
return result
}
var GL_BYTE$1 = 5120;
var GL_UNSIGNED_BYTE$2 = 5121;
var GL_SHORT$1 = 5122;
var GL_UNSIGNED_SHORT$1 = 5123;
var GL_INT$1 = 5124;
var GL_UNSIGNED_INT$1 = 5125;
var GL_FLOAT$2 = 5126;
var bufferPool = loop(8, function () {
return []
});
function nextPow16 (v) {
for (var i = 16; i <= (1 << 28); i *= 16) {
if (v <= i) {
return i
}
}
return 0
}
function log2 (v) {
var r, shift;
r = (v > 0xFFFF) << 4;
v >>>= r;
shift = (v > 0xFF) << 3;
v >>>= shift; r |= shift;
shift = (v > 0xF) << 2;
v >>>= shift; r |= shift;
shift = (v > 0x3) << 1;
v >>>= shift; r |= shift;
return r | (v >> 1)
}
function alloc (n) {
var sz = nextPow16(n);
var bin = bufferPool[log2(sz) >> 2];
if (bin.length > 0) {
return bin.pop()
}
return new ArrayBuffer(sz)
}
function free (buf) {
bufferPool[log2(buf.byteLength) >> 2].push(buf);
}
function allocType (type, n) {
var result = null;
switch (type) {
case GL_BYTE$1:
result = new Int8Array(alloc(n), 0, n);
break
case GL_UNSIGNED_BYTE$2:
result = new Uint8Array(alloc(n), 0, n);
break
case GL_SHORT$1:
result = new Int16Array(alloc(2 * n), 0, n);
break
case GL_UNSIGNED_SHORT$1:
result = new Uint16Array(alloc(2 * n), 0, n);
break
case GL_INT$1:
result = new Int32Array(alloc(4 * n), 0, n);
break
case GL_UNSIGNED_INT$1:
result = new Uint32Array(alloc(4 * n), 0, n);
break
case GL_FLOAT$2:
result = new Float32Array(alloc(4 * n), 0, n);
break
default:
return null
}
if (result.length !== n) {
return result.subarray(0, n)
}
return result
}
function freeType (array) {
free(array.buffer);
}
var pool = {
alloc: alloc,
free: free,
allocType: allocType,
freeType: freeType
};
var flattenUtils = {
shape: arrayShape$1,
flatten: flattenArray
};
function flatten1D (array, nx, out) {
for (var i = 0; i < nx; ++i) {
out[i] = array[i];
}
}
function flatten2D (array, nx, ny, out) {
var ptr = 0;
for (var i = 0; i < nx; ++i) {
var row = array[i];
for (var j = 0; j < ny; ++j) {
out[ptr++] = row[j];
}
}
}
function flatten3D (array, nx, ny, nz, out, ptr_) {
var ptr = ptr_;
for (var i = 0; i < nx; ++i) {
var row = array[i];
for (var j = 0; j < ny; ++j) {
var col = row[j];
for (var k = 0; k < nz; ++k) {
out[ptr++] = col[k];
}
}
}
}
function flattenRec (array, shape, level, out, ptr) {
var stride = 1;
for (var i = level + 1; i < shape.length; ++i) {
stride *= shape[i];
}
var n = shape[level];
if (shape.length - level === 4) {
var nx = shape[level + 1];
var ny = shape[level + 2];
var nz = shape[level + 3];
for (i = 0; i < n; ++i) {
flatten3D(array[i], nx, ny, nz, out, ptr);
ptr += stride;
}
} else {
for (i = 0; i < n; ++i) {
flattenRec(array[i], shape, level + 1, out, ptr);
ptr += stride;
}
}
}
function flattenArray (array, shape, type, out_) {
var sz = 1;
if (shape.length) {
for (var i = 0; i < shape.length; ++i) {
sz *= shape[i];
}
} else {
sz = 0;
}
var out = out_ || pool.allocType(type, sz);
switch (shape.length) {
case 0:
break
case 1:
flatten1D(array, shape[0], out);
break
case 2:
flatten2D(array, shape[0], shape[1], out);
break
case 3:
flatten3D(array, shape[0], shape[1], shape[2], out, 0);
break
default:
flattenRec(array, shape, 0, out, 0);
}
return out
}
function arrayShape$1 (array_) {
var shape = [];
for (var array = array_; array.length; array = array[0]) {
shape.push(array.length);
}
return shape
}
var int8 = 5120;
var int16 = 5122;
var int32 = 5124;
var uint8 = 5121;
var uint16 = 5123;
var uint32 = 5125;
var float = 5126;
var float32 = 5126;
var glTypes = {
int8: int8,
int16: int16,
int32: int32,
uint8: uint8,
uint16: uint16,
uint32: uint32,
float: float,
float32: float32
};
var dynamic$1 = 35048;
var stream = 35040;
var usageTypes = {
dynamic: dynamic$1,
stream: stream,
"static": 35044
};
var arrayFlatten = flattenUtils.flatten;
var arrayShape = flattenUtils.shape;
var GL_STATIC_DRAW = 0x88E4;
var GL_STREAM_DRAW = 0x88E0;
var GL_UNSIGNED_BYTE$1 = 5121;
var GL_FLOAT$1 = 5126;
var DTYPES_SIZES = [];
DTYPES_SIZES[5120] = 1; // int8
DTYPES_SIZES[5122] = 2; // int16
DTYPES_SIZES[5124] = 4; // int32
DTYPES_SIZES[5121] = 1; // uint8
DTYPES_SIZES[5123] = 2; // uint16
DTYPES_SIZES[5125] = 4; // uint32
DTYPES_SIZES[5126] = 4; // float32
function typedArrayCode (data) {
return arrayTypes[Object.prototype.toString.call(data)] | 0
}
function copyArray (out, inp) {
for (var i = 0; i < inp.length; ++i) {
out[i] = inp[i];
}
}
function transpose (
result, data, shapeX, shapeY, strideX, strideY, offset) {
var ptr = 0;
for (var i = 0; i < shapeX; ++i) {
for (var j = 0; j < shapeY; ++j) {
result[ptr++] = data[strideX * i + strideY * j + offset];
}
}
}
function wrapBufferState (gl, stats, config) {
var bufferCount = 0;
var bufferSet = {};
function REGLBuffer (type) {
this.id = bufferCount++;
this.buffer = gl.createBuffer();
this.type = type;
this.usage = GL_STATIC_DRAW;
this.byteLength = 0;
this.dimension = 1;
this.dtype = GL_UNSIGNED_BYTE$1;
this.persistentData = null;
if (config.profile) {
this.stats = {size: 0};
}
}
REGLBuffer.prototype.bind = function () {
gl.bindBuffer(this.type, this.buffer);
};
REGLBuffer.prototype.destroy = function () {
destroy(this);
};
var streamPool = [];
function createStream (type, data) {
var buffer = streamPool.pop();
if (!buffer) {
buffer = new REGLBuffer(type);
}
buffer.bind();
initBufferFromData(buffer, data, GL_STREAM_DRAW, 0, 1, false);
return buffer
}
function destroyStream (stream$$1) {
streamPool.push(stream$$1);
}
function initBufferFromTypedArray (buffer, data, usage) {
buffer.byteLength = data.byteLength;
gl.bufferData(buffer.type, data, usage);
}
function initBufferFromData (buffer, data, usage, dtype, dimension, persist) {
var shape;
buffer.usage = usage;
if (Array.isArray(data)) {
buffer.dtype = dtype || GL_FLOAT$1;
if (data.length > 0) {
var flatData;
if (Array.isArray(data[0])) {
shape = arrayShape(data);
var dim = 1;
for (var i = 1; i < shape.length; ++i) {
dim *= shape[i];
}
buffer.dimension = dim;
flatData = arrayFlatten(data, shape, buffer.dtype);
initBufferFromTypedArray(buffer, flatData, usage);
if (persist) {
buffer.persistentData = flatData;
} else {
pool.freeType(flatData);
}
} else if (typeof data[0] === 'number') {
buffer.dimension = dimension;
var typedData = pool.allocType(buffer.dtype, data.length);
copyArray(typedData, data);
initBufferFromTypedArray(buffer, typedData, usage);
if (persist) {
buffer.persistentData = typedData;
} else {
pool.freeType(typedData);
}
} else if (isTypedArray(data[0])) {
buffer.dimension = data[0].length;
buffer.dtype = dtype || typedArrayCode(data[0]) || GL_FLOAT$1;
flatData = arrayFlatten(
data,
[data.length, data[0].length],
buffer.dtype);
initBufferFromTypedArray(buffer, flatData, usage);
if (persist) {
buffer.persistentData = flatData;
} else {
pool.freeType(flatData);
}
} else {
check$1.raise('invalid buffer data');
}
}
} else if (isTypedArray(data)) {
buffer.dtype = dtype || typedArrayCode(data);
buffer.dimension = dimension;
initBufferFromTypedArray(buffer, data, usage);
if (persist) {
buffer.persistentData = new Uint8Array(new Uint8Array(data.buffer));
}
} else if (isNDArrayLike(data)) {
shape = data.shape;
var stride = data.stride;
var offset = data.offset;
var shapeX = 0;
var shapeY = 0;
var strideX = 0;
var strideY = 0;
if (shape.length === 1) {
shapeX = shape[0];
shapeY = 1;
strideX = stride[0];
strideY = 0;
} else if (shape.length === 2) {
shapeX = shape[0];
shapeY = shape[1];
strideX = stride[0];
strideY = stride[1];
} else {
check$1.raise('invalid shape');
}
buffer.dtype = dtype || typedArrayCode(data.data) || GL_FLOAT$1;
buffer.dimension = shapeY;
var transposeData = pool.allocType(buffer.dtype, shapeX * shapeY);
transpose(transposeData,
data.data,
shapeX, shapeY,
strideX, strideY,
offset);
initBufferFromTypedArray(buffer, transposeData, usage);
if (persist) {
buffer.persistentData = transposeData;
} else {
pool.freeType(transposeData);
}
} else {
check$1.raise('invalid buffer data');
}
}
function destroy (buffer) {
stats.bufferCount--;
var handle = buffer.buffer;
check$1(handle, 'buffer must not be deleted already');
gl.deleteBuffer(handle);
buffer.buffer = null;
delete bufferSet[buffer.id];
}
function createBuffer (options, type, deferInit, persistent) {
stats.bufferCount++;
var buffer = new REGLBuffer(type);
bufferSet[buffer.id] = buffer;
function reglBuffer (options) {
var usage = GL_STATIC_DRAW;
var data = null;
var byteLength = 0;
var dtype = 0;
var dimension = 1;
if (Array.isArray(options) ||
isTypedArray(options) ||
isNDArrayLike(options)) {
data = options;
} else if (typeof options === 'number') {
byteLength = options | 0;
} else if (options) {
check$1.type(
options, 'object',
'buffer arguments must be an object, a number or an array');
if ('data' in options) {
check$1(
data === null ||
Array.isArray(data) ||
isTypedArray(data) ||
isNDArrayLike(data),
'invalid data for buffer');
data = options.data;
}
if ('usage' in options) {
check$1.parameter(options.usage, usageTypes, 'invalid buffer usage');
usage = usageTypes[options.usage];
}
if ('type' in options) {
check$1.parameter(options.type, glTypes, 'invalid buffer type');
dtype = glTypes[options.type];
}
if ('dimension' in options) {
check$1.type(options.dimension, 'number', 'invalid dimension');
dimension = options.dimension | 0;
}
if ('length' in options) {
check$1.nni(byteLength, 'buffer length must be a nonnegative integer');
byteLength = options.length | 0;
}
}
buffer.bind();
if (!data) {
gl.bufferData(buffer.type, byteLength, usage);
buffer.dtype = dtype || GL_UNSIGNED_BYTE$1;
buffer.usage = usage;
buffer.dimension = dimension;
buffer.byteLength = byteLength;
} else {
initBufferFromData(buffer, data, usage, dtype, dimension, persistent);
}
if (config.profile) {
buffer.stats.size = buffer.byteLength * DTYPES_SIZES[buffer.dtype];
}
return reglBuffer
}
function setSubData (data, offset) {
check$1(offset + data.byteLength <= buffer.byteLength,
'invalid buffer subdata call, buffer is too small. ' + ' Can\'t write data of size ' + data.byteLength + ' starting from offset ' + offset + ' to a buffer of size ' + buffer.byteLength);
gl.bufferSubData(buffer.type, offset, data);
}
function subdata (data, offset_) {
var offset = (offset_ || 0) | 0;
var shape;
buffer.bind();
if (Array.isArray(data)) {
if (data.length > 0) {
if (typeof data[0] === 'number') {
var converted = pool.allocType(buffer.dtype, data.length);
copyArray(converted, data);
setSubData(converted, offset);
pool.freeType(converted);
} else if (Array.isArray(data[0]) || isTypedArray(data[0])) {
shape = arrayShape(data);
var flatData = arrayFlatten(data, shape, buffer.dtype);
setSubData(flatData, offset);
pool.freeType(flatData);
} else {
check$1.raise('invalid buffer data');
}
}
} else if (isTypedArray(data)) {
setSubData(data, offset);
} else if (isNDArrayLike(data)) {
shape = data.shape;
var stride = data.stride;
var shapeX = 0;
var shapeY = 0;
var strideX = 0;
var strideY = 0;
if (shape.length === 1) {
shapeX = shape[0];
shapeY = 1;
strideX = stride[0];
strideY = 0;
} else if (shape.length === 2) {
shapeX = shape[0];
shapeY = shape[1];
strideX = stride[0];
strideY = stride[1];
} else {
check$1.raise('invalid shape');
}
var dtype = Array.isArray(data.data)
? buffer.dtype
: typedArrayCode(data.data);
var transposeData = pool.allocType(dtype, shapeX * shapeY);
transpose(transposeData,
data.data,
shapeX, shapeY,
strideX, strideY,
data.offset);
setSubData(transposeData, offset);
pool.freeType(transposeData);
} else {
check$1.raise('invalid data for buffer subdata');
}
return reglBuffer
}
if (!deferInit) {
reglBuffer(options);
}
reglBuffer._reglType = 'buffer';
reglBuffer._buffer = buffer;
reglBuffer.subdata = subdata;
if (config.profile) {
reglBuffer.stats = buffer.stats;
}
reglBuffer.destroy = function () { destroy(buffer); };
return reglBuffer
}
function restoreBuffers () {
values(bufferSet).forEach(function (buffer) {
buffer.buffer = gl.createBuffer();
gl.bindBuffer(buffer.type, buffer.buffer);
gl.bufferData(
buffer.type, buffer.persistentData || buffer.byteLength, buffer.usage);
});
}
if (config.profile) {
stats.getTotalBufferSize = function () {
var total = 0;
// TODO: Right now, the streams are not part of the total count.
Object.keys(bufferSet).forEach(function (key) {
total += bufferSet[key].stats.size;
});
return total
};
}
return {
create: createBuffer,
createStream: createStream,
destroyStream: destroyStream,
clear: function () {
values(bufferSet).forEach(destroy);
streamPool.forEach(destroy);
},
getBuffer: function (wrapper) {
if (wrapper && wrapper._buffer instanceof REGLBuffer) {
return wrapper._buffer
}
return null
},
restore: restoreBuffers,
_initBuffer: initBufferFromData
}
}
var points = 0;
var point = 0;
var lines = 1;
var line = 1;
var triangles = 4;
var triangle = 4;
var primTypes = {
points: points,
point: point,
lines: lines,
line: line,
triangles: triangles,
triangle: triangle,
"line loop": 2,
"line strip": 3,
"triangle strip": 5,
"triangle fan": 6
};
var GL_POINTS = 0;
var GL_LINES = 1;
var GL_TRIANGLES = 4;
var GL_BYTE$2 = 5120;
var GL_UNSIGNED_BYTE$3 = 5121;
var GL_SHORT$2 = 5122;
var GL_UNSIGNED_SHORT$2 = 5123;
var GL_INT$2 = 5124;
var GL_UNSIGNED_INT$2 = 5125;
var GL_ELEMENT_ARRAY_BUFFER = 34963;
var GL_STREAM_DRAW$1 = 0x88E0;
var GL_STATIC_DRAW$1 = 0x88E4;
function wrapElementsState (gl, extensions, bufferState, stats) {
var elementSet = {};
var elementCount = 0;
var elementTypes = {
'uint8': GL_UNSIGNED_BYTE$3,
'uint16': GL_UNSIGNED_SHORT$2
};
if (extensions.oes_element_index_uint) {
elementTypes.uint32 = GL_UNSIGNED_INT$2;
}
function REGLElementBuffer (buffer) {
this.id = elementCount++;
elementSet[this.id] = this;
this.buffer = buffer;
this.primType = GL_TRIANGLES;
this.vertCount = 0;
this.type = 0;
}
REGLElementBuffer.prototype.bind = function () {
this.buffer.bind();
};
var bufferPool = [];
function createElementStream (data) {
var result = bufferPool.pop();
if (!result) {
result = new REGLElementBuffer(bufferState.create(
null,
GL_ELEMENT_ARRAY_BUFFER,
true,
false)._buffer);
}
initElements(result, data, GL_STREAM_DRAW$1, -1, -1, 0, 0);
return result
}
function destroyElementStream (elements) {
bufferPool.push(elements);
}
function initElements (
elements,
data,
usage,
prim,
count,
byteLength,
type) {
elements.buffer.bind();
if (data) {
var predictedType = type;
if (!type && (
!isTypedArray(data) ||
(isNDArrayLike(data) && !isTypedArray(data.data)))) {
predictedType = extensions.oes_element_index_uint
? GL_UNSIGNED_INT$2
: GL_UNSIGNED_SHORT$2;
}
bufferState._initBuffer(
elements.buffer,
data,
usage,
predictedType,
3);
} else {
gl.bufferData(GL_ELEMENT_ARRAY_BUFFER, byteLength, usage);
elements.buffer.dtype = dtype || GL_UNSIGNED_BYTE$3;
elements.buffer.usage = usage;
elements.buffer.dimension = 3;
elements.buffer.byteLength = byteLength;
}
var dtype = type;
if (!type) {
switch (elements.buffer.dtype) {
case GL_UNSIGNED_BYTE$3:
case GL_BYTE$2:
dtype = GL_UNSIGNED_BYTE$3;
break
case GL_UNSIGNED_SHORT$2:
case GL_SHORT$2:
dtype = GL_UNSIGNED_SHORT$2;
break
case GL_UNSIGNED_INT$2:
case GL_INT$2:
dtype = GL_UNSIGNED_INT$2;
break
default:
check$1.raise('unsupported type for element array');
}
elements.buffer.dtype = dtype;
}
elements.type = dtype;
// Check oes_element_index_uint extension
check$1(
dtype !== GL_UNSIGNED_INT$2 ||
!!extensions.oes_element_index_uint,
'32 bit element buffers not supported, enable oes_element_index_uint first');
// try to guess default primitive type and arguments
var vertCount = count;
if (vertCount < 0) {
vertCount = elements.buffer.byteLength;
if (dtype === GL_UNSIGNED_SHORT$2) {
vertCount >>= 1;
} else if (dtype === GL_UNSIGNED_INT$2) {
vertCount >>= 2;
}
}
elements.vertCount = vertCount;
// try to guess primitive type from cell dimension
var primType = prim;
if (prim < 0) {
primType = GL_TRIANGLES;
var dimension = elements.buffer.dimension;
if (dimension === 1) primType = GL_POINTS;
if (dimension === 2) primType = GL_LINES;
if (dimension === 3) primType = GL_TRIANGLES;
}
elements.primType = primType;
}
function destroyElements (elements) {
stats.elementsCount--;
check$1(elements.buffer !== null, 'must not double destroy elements');
delete elementSet[elements.id];
elements.buffer.destroy();
elements.buffer = null;
}
function createElements (options, persistent) {
var buffer = bufferState.create(null, GL_ELEMENT_ARRAY_BUFFER, true);
var elements = new REGLElementBuffer(buffer._buffer);
stats.elementsCount++;
function reglElements (options) {
if (!options) {
buffer();
elements.primType = GL_TRIANGLES;
elements.vertCount = 0;
elements.type = GL_UNSIGNED_BYTE$3;
} else if (typeof options === 'number') {
buffer(options);
elements.primType = GL_TRIANGLES;
elements.vertCount = options | 0;
elements.type = GL_UNSIGNED_BYTE$3;
} else {
var data = null;
var usage = GL_STATIC_DRAW$1;
var primType = -1;
var vertCount = -1;
var byteLength = 0;
var dtype = 0;
if (Array.isArray(options) ||
isTypedArray(options) ||
isNDArrayLike(options)) {
data = options;
} else {
check$1.type(options, 'object', 'invalid arguments for elements');
if ('data' in options) {
data = options.data;
check$1(
Array.isArray(data) ||
isTypedArray(data) ||
isNDArrayLike(data),
'invalid data for element buffer');
}
if ('usage' in options) {
check$1.parameter(
options.usage,
usageTypes,
'invalid element buffer usage');
usage = usageTypes[options.usage];
}
if ('primitive' in options) {
check$1.parameter(
options.primitive,
primTypes,
'invalid element buffer primitive');
primType = primTypes[options.primitive];
}
if ('count' in options) {
check$1(
typeof options.count === 'number' && options.count >= 0,
'invalid vertex count for elements');
vertCount = options.count | 0;
}
if ('type' in options) {
check$1.parameter(
options.type,
elementTypes,
'invalid buffer type');
dtype = elementTypes[options.type];
}
if ('length' in options) {
byteLength = options.length | 0;
} else {
byteLength = vertCount;
if (dtype === GL_UNSIGNED_SHORT$2 || dtype === GL_SHORT$2) {
byteLength *= 2;
} else if (dtype === GL_UNSIGNED_INT$2 || dtype === GL_INT$2) {
byteLength *= 4;
}
}
}
initElements(
elements,
data,
usage,
primType,
vertCount,
byteLength,
dtype);
}
return reglElements
}
reglElements(options);
reglElements._reglType = 'elements';
reglElements._elements = elements;
reglElements.subdata = function (data, offset) {
buffer.subdata(data, offset);
return reglElements
};
reglElements.destroy = function () {
destroyElements(elements);
};
return reglElements
}
return {
create: createElements,
createStream: createElementStream,
destroyStream: destroyElementStream,
getElements: function (elements) {
if (typeof elements === 'function' &&
elements._elements instanceof REGLElementBuffer) {
return elements._elements
}
return null
},
clear: function () {
values(elementSet).forEach(destroyElements);
}
}
}
var FLOAT = new Float32Array(1);
var INT = new Uint32Array(FLOAT.buffer);
var GL_UNSIGNED_SHORT$4 = 5123;
function convertToHalfFloat (array) {
var ushorts = pool.allocType(GL_UNSIGNED_SHORT$4, array.length);
for (var i = 0; i < array.length; ++i) {
if (isNaN(array[i])) {
ushorts[i] = 0xffff;
} else if (array[i] === Infinity) {
ushorts[i] = 0x7c00;
} else if (array[i] === -Infinity) {
ushorts[i] = 0xfc00;
} else {
FLOAT[0] = array[i];
var x = INT[0];
var sgn = (x >>> 31) << 15;
var exp = ((x << 1) >>> 24) - 127;
var frac = (x >> 13) & ((1 << 10) - 1);
if (exp < -24) {
// round non-representable denormals to 0
ushorts[i] = sgn;
} else if (exp < -14) {
// handle denormals
var s = -14 - exp;
ushorts[i] = sgn + ((frac + (1 << 10)) >> s);
} else if (exp > 15) {
// round overflow to +/- Infinity
ushorts[i] = sgn + 0x7c00;
} else {
// otherwise convert directly
ushorts[i] = sgn + ((exp + 15) << 10) + frac;
}
}
}
return ushorts
}
function isArrayLike (s) {
return Array.isArray(s) || isTypedArray(s)
}
var GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
var GL_TEXTURE_2D = 0x0DE1;
var GL_TEXTURE_CUBE_MAP = 0x8513;
var GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
var GL_RGBA = 0x1908;
var GL_ALPHA = 0x1906;
var GL_RGB = 0x1907;
var GL_LUMINANCE = 0x1909;
var GL_LUMINANCE_ALPHA = 0x190A;
var GL_RGBA4 = 0x8056;
var GL_RGB5_A1 = 0x8057;
var GL_RGB565 = 0x8D62;
var GL_UNSIGNED_SHORT_4_4_4_4$1 = 0x8033;
var GL_UNSIGNED_SHORT_5_5_5_1$1 = 0x8034;
var GL_UNSIGNED_SHORT_5_6_5$1 = 0x8363;
var GL_UNSIGNED_INT_24_8_WEBGL$1 = 0x84FA;
var GL_DEPTH_COMPONENT = 0x1902;
var GL_DEPTH_STENCIL = 0x84F9;
var GL_SRGB_EXT = 0x8C40;
var GL_SRGB_ALPHA_EXT = 0x8C42;
var GL_HALF_FLOAT_OES$1 = 0x8D61;
var GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
var GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
var GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
var GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
var GL_COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
var GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
var GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
var GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
var GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
var GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
var GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
var GL_COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
var GL_UNSIGNED_BYTE$4 = 0x1401;
var GL_UNSIGNED_SHORT$3 = 0x1403;
var GL_UNSIGNED_INT$3 = 0x1405;
var GL_FLOAT$3 = 0x1406;
var GL_TEXTURE_WRAP_S = 0x2802;
var GL_TEXTURE_WRAP_T = 0x2803;
var GL_REPEAT = 0x2901;
var GL_CLAMP_TO_EDGE$1 = 0x812F;
var GL_MIRRORED_REPEAT = 0x8370;
var GL_TEXTURE_MAG_FILTER = 0x2800;
var GL_TEXTURE_MIN_FILTER = 0x2801;
var GL_NEAREST$1 = 0x2600;
var GL_LINEAR = 0x2601;
var GL_NEAREST_MIPMAP_NEAREST$1 = 0x2700;
var GL_LINEAR_MIPMAP_NEAREST$1 = 0x2701;
var GL_NEAREST_MIPMAP_LINEAR$1 = 0x2702;
var GL_LINEAR_MIPMAP_LINEAR$1 = 0x2703;
var GL_GENERATE_MIPMAP_HINT = 0x8192;
var GL_DONT_CARE = 0x1100;
var GL_FASTEST = 0x1101;
var GL_NICEST = 0x1102;
var GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
var GL_UNPACK_ALIGNMENT = 0x0CF5;
var GL_UNPACK_FLIP_Y_WEBGL = 0x9240;
var GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
var GL_UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
var GL_BROWSER_DEFAULT_WEBGL = 0x9244;
var GL_TEXTURE0 = 0x84C0;
var MIPMAP_FILTERS = [
GL_NEAREST_MIPMAP_NEAREST$1,
GL_NEAREST_MIPMAP_LINEAR$1,
GL_LINEAR_MIPMAP_NEAREST$1,
GL_LINEAR_MIPMAP_LINEAR$1
];
var CHANNELS_FORMAT = [
0,
GL_LUMINANCE,
GL_LUMINANCE_ALPHA,
GL_RGB,
GL_RGBA
];
var FORMAT_CHANNELS = {};
FORMAT_CHANNELS[GL_LUMINANCE] =
FORMAT_CHANNELS[GL_ALPHA] =
FORMAT_CHANNELS[GL_DEPTH_COMPONENT] = 1;
FORMAT_CHANNELS[GL_DEPTH_STENCIL] =
FORMAT_CHANNELS[GL_LUMINANCE_ALPHA] = 2;
FORMAT_CHANNELS[GL_RGB] =
FORMAT_CHANNELS[GL_SRGB_EXT] = 3;
FORMAT_CHANNELS[GL_RGBA] =
FORMAT_CHANNELS[GL_SRGB_ALPHA_EXT] = 4;
function objectName (str) {
return '[object ' + str + ']'
}
var CANVAS_CLASS = objectName('HTMLCanvasElement');
var CONTEXT2D_CLASS = objectName('CanvasRenderingContext2D');
var IMAGE_CLASS = objectName('HTMLImageElement');
var VIDEO_CLASS = objectName('HTMLVideoElement');
var PIXEL_CLASSES = Object.keys(arrayTypes).concat([
CANVAS_CLASS,
CONTEXT2D_CLASS,
IMAGE_CLASS,
VIDEO_CLASS
]);
// for every texture type, store
// the size in bytes.
var TYPE_SIZES = [];
TYPE_SIZES[GL_UNSIGNED_BYTE$4] = 1;
TYPE_SIZES[GL_FLOAT$3] = 4;
TYPE_SIZES[GL_HALF_FLOAT_OES$1] = 2;
TYPE_SIZES[GL_UNSIGNED_SHORT$3] = 2;
TYPE_SIZES[GL_UNSIGNED_INT$3] = 4;
var FORMAT_SIZES_SPECIAL = [];
FORMAT_SIZES_SPECIAL[GL_RGBA4] = 2;
FORMAT_SIZES_SPECIAL[GL_RGB5_A1] = 2;
FORMAT_SIZES_SPECIAL[GL_RGB565] = 2;
FORMAT_SIZES_SPECIAL[GL_DEPTH_STENCIL] = 4;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_S3TC_DXT1_EXT] = 0.5;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT1_EXT] = 0.5;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT3_EXT] = 1;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT5_EXT] = 1;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_ATC_WEBGL] = 0.5;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL] = 1;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL] = 1;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG] = 0.5;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG] = 0.25;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG] = 0.5;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG] = 0.25;
FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_ETC1_WEBGL] = 0.5;
function isNumericArray (arr) {
return (
Array.isArray(arr) &&
(arr.length === 0 ||
typeof arr[0] === 'number'))
}
function isRectArray (arr) {
if (!Array.isArray(arr)) {
return false
}
var width = arr.length;
if (width === 0 || !isArrayLike(arr[0])) {
return false
}
return true
}
function classString (x) {
return Object.prototype.toString.call(x)
}
function isCanvasElement (object) {
return classString(object) === CANVAS_CLASS
}
function isContext2D (object) {
return classString(object) === CONTEXT2D_CLASS
}
function isImageElement (object) {
return classString(object) === IMAGE_CLASS
}
function isVideoElement (object) {
return classString(object) === VIDEO_CLASS
}
function isPixelData (object) {
if (!object) {
return false
}
var className = classString(object);
if (PIXEL_CLASSES.indexOf(className) >= 0) {
return true
}
return (
isNumericArray(object) ||
isRectArray(object) ||
isNDArrayLike(object))
}
function typedArrayCode$1 (data) {
return arrayTypes[Object.prototype.toString.call(data)] | 0
}
function convertData (result, data) {
var n = data.length;
switch (result.type) {
case GL_UNSIGNED_BYTE$4:
case GL_UNSIGNED_SHORT$3:
case GL_UNSIGNED_INT$3:
case GL_FLOAT$3:
var converted = pool.allocType(result.type, n);
converted.set(data);
result.data = converted;
break
case GL_HALF_FLOAT_OES$1:
result.data = convertToHalfFloat(data);
break
default:
check$1.raise('unsupported texture type, must specify a typed array');
}
}
function preConvert (image, n) {
return pool.allocType(
image.type === GL_HALF_FLOAT_OES$1
? GL_FLOAT$3
: image.type, n)
}
function postConvert (image, data) {
if (image.type === GL_HALF_FLOAT_OES$1) {
image.data = convertToHalfFloat(data);
pool.freeType(data);
} else {
image.data = data;
}
}
function transposeData (image, array, strideX, strideY, strideC, offset) {
var w = image.width;
var h = image.height;
var c = image.channels;
var n = w * h * c;
var data = preConvert(image, n);
var p = 0;
for (var i = 0; i < h; ++i) {
for (var j = 0; j < w; ++j) {
for (var k = 0; k < c; ++k) {
data[p++] = array[strideX * j + strideY * i + strideC * k + offset];
}
}
}
postConvert(image, data);
}
function getTextureSize (format, type, width, height, isMipmap, isCube) {
var s;
if (typeof FORMAT_SIZES_SPECIAL[format] !== 'undefined') {
// we have a special array for dealing with weird color formats such as RGB5A1
s = FORMAT_SIZES_SPECIAL[format];
} else {
s = FORMAT_CHANNELS[format] * TYPE_SIZES[type];
}
if (isCube) {
s *= 6;
}
if (isMipmap) {
// compute the total size of all the mipmaps.
var total = 0;
var w = width;
while (w >= 1) {
// we can only use mipmaps on a square image,
// so we can simply use the width and ignore the height:
total += s * w * w;
w /= 2;
}
return total
} else {
return s * width * height
}
}
function createTextureSet (
gl, extensions, limits, reglPoll, contextState, stats, config) {
// -------------------------------------------------------
// Initialize constants and parameter tables here
// -------------------------------------------------------
var mipmapHint = {
"don't care": GL_DONT_CARE,
'dont care': GL_DONT_CARE,
'nice': GL_NICEST,
'fast': GL_FASTEST
};
var wrapModes = {
'repeat': GL_REPEAT,
'clamp': GL_CLAMP_TO_EDGE$1,
'mirror': GL_MIRRORED_REPEAT
};
var magFilters = {
'nearest': GL_NEAREST$1,
'linear': GL_LINEAR
};
var minFilters = extend({
'mipmap': GL_LINEAR_MIPMAP_LINEAR$1,
'nearest mipmap nearest': GL_NEAREST_MIPMAP_NEAREST$1,
'linear mipmap nearest': GL_LINEAR_MIPMAP_NEAREST$1,
'nearest mipmap linear': GL_NEAREST_MIPMAP_LINEAR$1,
'linear mipmap linear': GL_LINEAR_MIPMAP_LINEAR$1
}, magFilters);
var colorSpace = {
'none': 0,
'browser': GL_BROWSER_DEFAULT_WEBGL
};
var textureTypes = {
'uint8': GL_UNSIGNED_BYTE$4,
'rgba4': GL_UNSIGNED_SHORT_4_4_4_4$1,
'rgb565': GL_UNSIGNED_SHORT_5_6_5$1,
'rgb5 a1': GL_UNSIGNED_SHORT_5_5_5_1$1
};
var textureFormats = {
'alpha': GL_ALPHA,
'luminance': GL_LUMINANCE,
'luminance alpha': GL_LUMINANCE_ALPHA,
'rgb': GL_RGB,
'rgba': GL_RGBA,
'rgba4': GL_RGBA4,
'rgb5 a1': GL_RGB5_A1,
'rgb565': GL_RGB565
};
var compressedTextureFormats = {};
if (extensions.ext_srgb) {
textureFormats.srgb = GL_SRGB_EXT;
textureFormats.srgba = GL_SRGB_ALPHA_EXT;
}
if (extensions.oes_texture_float) {
textureTypes.float32 = textureTypes.float = GL_FLOAT$3;
}
if (extensions.oes_texture_half_float) {
textureTypes['float16'] = textureTypes['half float'] = GL_HALF_FLOAT_OES$1;
}
if (extensions.webgl_depth_texture) {
extend(textureFormats, {
'depth': GL_DEPTH_COMPONENT,
'depth stencil': GL_DEPTH_STENCIL
});
extend(textureTypes, {
'uint16': GL_UNSIGNED_SHORT$3,
'uint32': GL_UNSIGNED_INT$3,
'depth stencil': GL_UNSIGNED_INT_24_8_WEBGL$1
});
}
if (extensions.webgl_compressed_texture_s3tc) {
extend(compressedTextureFormats, {
'rgb s3tc dxt1': GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
'rgba s3tc dxt1': GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
'rgba s3tc dxt3': GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
'rgba s3tc dxt5': GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
});
}
if (extensions.webgl_compressed_texture_atc) {
extend(compressedTextureFormats, {
'rgb atc': GL_COMPRESSED_RGB_ATC_WEBGL,
'rgba atc explicit alpha': GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
'rgba atc interpolated alpha': GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL
});
}
if (extensions.webgl_compressed_texture_pvrtc) {
extend(compressedTextureFormats, {
'rgb pvrtc 4bppv1': GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
'rgb pvrtc 2bppv1': GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
'rgba pvrtc 4bppv1': GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
'rgba pvrtc 2bppv1': GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
});
}
if (extensions.webgl_compressed_texture_etc1) {
compressedTextureFormats['rgb etc1'] = GL_COMPRESSED_RGB_ETC1_WEBGL;
}
// Copy over all texture formats
var supportedCompressedFormats = Array.prototype.slice.call(
gl.getParameter(GL_COMPRESSED_TEXTURE_FORMATS));
Object.keys(compressedTextureFormats).forEach(function (name) {
var format = compressedTextureFormats[name];
if (supportedCompressedFormats.indexOf(format) >= 0) {
textureFormats[name] = format;
}
});
var supportedFormats = Object.keys(textureFormats);
limits.textureFormats = supportedFormats;
// associate with every format string its
// corresponding GL-value.
var textureFormatsInvert = [];
Object.keys(textureFormats).forEach(function (key) {
var val = textureFormats[key];
textureFormatsInvert[val] = key;
});
// associate with every type string its
// corresponding GL-value.
var textureTypesInvert = [];
Object.keys(textureTypes).forEach(function (key) {
var val = textureTypes[key];
textureTypesInvert[val] = key;
});
var magFiltersInvert = [];
Object.keys(magFilters).forEach(function (key) {
var val = magFilters[key];
magFiltersInvert[val] = key;
});
var minFiltersInvert = [];
Object.keys(minFilters).forEach(function (key) {
var val = minFilters[key];
minFiltersInvert[val] = key;
});
var wrapModesInvert = [];
Object.keys(wrapModes).forEach(function (key) {
var val = wrapModes[key];
wrapModesInvert[val] = key;
});
// colorFormats[] gives the format (channels) associated to an
// internalformat
var colorFormats = supportedFormats.reduce(function (color, key) {
var glenum = textureFormats[key];
if (glenum === GL_LUMINANCE ||
glenum === GL_ALPHA ||
glenum === GL_LUMINANCE ||
glenum === GL_LUMINANCE_ALPHA ||
glenum === GL_DEPTH_COMPONENT ||
glenum === GL_DEPTH_STENCIL) {
color[glenum] = glenum;
} else if (glenum === GL_RGB5_A1 || key.indexOf('rgba') >= 0) {
color[glenum] = GL_RGBA;
} else {
color[glenum] = GL_RGB;
}
return color
}, {});
function TexFlags () {
// format info
this.internalformat = GL_RGBA;
this.format = GL_RGBA;
this.type = GL_UNSIGNED_BYTE$4;
this.compressed = false;
// pixel storage
this.premultiplyAlpha = false;
this.flipY = false;
this.unpackAlignment = 1;
this.colorSpace = 0;
// shape info
this.width = 0;
this.height = 0;
this.channels = 0;
}
function copyFlags (result, other) {
result.internalformat = other.internalformat;
result.format = other.format;
result.type = other.type;
result.compressed = other.compressed;
result.premultiplyAlpha = other.premultiplyAlpha;
result.flipY = other.flipY;
result.unpackAlignment = other.unpackAlignment;
result.colorSpace = other.colorSpace;
result.width = other.width;
result.height = other.height;
result.channels = other.channels;
}
function parseFlags (flags, options) {
if (typeof options !== 'object' || !options) {
return
}
if ('premultiplyAlpha' in options) {
check$1.type(options.premultiplyAlpha, 'boolean',
'invalid premultiplyAlpha');
flags.premultiplyAlpha = options.premultiplyAlpha;
}
if ('flipY' in options) {
check$1.type(options.flipY, 'boolean',
'invalid texture flip');
flags.flipY = options.flipY;
}
if ('alignment' in options) {
check$1.oneOf(options.alignment, [1, 2, 4, 8],
'invalid texture unpack alignment');
flags.unpackAlignment = options.alignment;
}
if ('colorSpace' in options) {
check$1.parameter(options.colorSpace, colorSpace,
'invalid colorSpace');
flags.colorSpace = colorSpace[options.colorSpace];
}
if ('type' in options) {
var type = options.type;
check$1(extensions.oes_texture_float ||
!(type === 'float' || type === 'float32'),
'you must enable the OES_texture_float extension in order to use floating point textures.');
check$1(extensions.oes_texture_half_float ||
!(type === 'half float' || type === 'float16'),
'you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures.');
check$1(extensions.webgl_depth_texture ||
!(type === 'uint16' || type === 'uint32' || type === 'depth stencil'),
'you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures.');
check$1.parameter(type, textureTypes,
'invalid texture type');
flags.type = textureTypes[type];
}
var w = flags.width;
var h = flags.height;
var c = flags.channels;
var hasChannels = false;
if ('shape' in options) {
check$1(Array.isArray(options.shape) && options.shape.length >= 2,
'shape must be an array');
w = options.shape[0];
h = options.shape[1];
if (options.shape.length === 3) {
c = options.shape[2];
check$1(c > 0 && c <= 4, 'invalid number of channels');
hasChannels = true;
}
check$1(w >= 0 && w <= limits.maxTextureSize, 'invalid width');
check$1(h >= 0 && h <= limits.maxTextureSize, 'invalid height');
} else {
if ('radius' in options) {
w = h = options.radius;
check$1(w >= 0 && w <= limits.maxTextureSize, 'invalid radius');
}
if ('width' in options) {
w = options.width;
check$1(w >= 0 && w <= limits.maxTextureSize, 'invalid width');
}
if ('height' in options) {
h = options.height;
check$1(h >= 0 && h <= limits.maxTextureSize, 'invalid height');
}
if ('channels' in options) {
c = options.channels;
check$1(c > 0 && c <= 4, 'invalid number of channels');
hasChannels = true;
}
}
flags.width = w | 0;
flags.height = h | 0;
flags.channels = c | 0;
var hasFormat = false;
if ('format' in options) {
var formatStr = options.format;
check$1(extensions.webgl_depth_texture ||
!(formatStr === 'depth' || formatStr === 'depth stencil'),
'you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures.');
check$1.parameter(formatStr, textureFormats,
'invalid texture format');
var internalformat = flags.internalformat = textureFormats[formatStr];
flags.format = colorFormats[internalformat];
if (formatStr in textureTypes) {
if (!('type' in options)) {
flags.type = textureTypes[formatStr];
}
}
if (formatStr in compressedTextureFormats) {
flags.compressed = true;
}
hasFormat = true;
}
// Reconcile channels and format
if (!hasChannels && hasFormat) {
flags.channels = FORMAT_CHANNELS[flags.format];
} else if (hasChannels && !hasFormat) {
if (flags.channels !== CHANNELS_FORMAT[flags.format]) {
flags.format = flags.internalformat = CHANNELS_FORMAT[flags.channels];
}
} else if (hasFormat && hasChannels) {
check$1(
flags.channels === FORMAT_CHANNELS[flags.format],
'number of channels inconsistent with specified format');
}
}
function setFlags (flags) {
gl.pixelStorei(GL_UNPACK_FLIP_Y_WEBGL, flags.flipY);
gl.pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL, flags.premultiplyAlpha);
gl.pixelStorei(GL_UNPACK_COLORSPACE_CONVERSION_WEBGL, flags.colorSpace);
gl.pixelStorei(GL_UNPACK_ALIGNMENT, flags.unpackAlignment);
}
// -------------------------------------------------------
// Tex image data
// -------------------------------------------------------
function TexImage () {
TexFlags.call(this);
this.xOffset = 0;
this.yOffset = 0;
// data
this.data = null;
this.needsFree = false;
// html element
this.element = null;
// copyTexImage info
this.needsCopy = false;
}
function parseImage (image, options) {
var data = null;
if (isPixelData(options)) {
data = options;
} else if (options) {
check$1.type(options, 'object', 'invalid pixel data type');
parseFlags(image, options);
if ('x' in options) {
image.xOffset = options.x | 0;
}
if ('y' in options) {
image.yOffset = options.y | 0;
}
if (isPixelData(options.data)) {
data = options.data;
}
}
check$1(
!image.compressed ||
data instanceof Uint8Array,
'compressed texture data must be stored in a uint8array');
if (options.copy) {
check$1(!data, 'can not specify copy and data field for the same texture');
var viewW = contextState.viewportWidth;
var viewH = contextState.viewportHeight;
image.width = image.width || (viewW - image.xOffset);
image.height = image.height || (viewH - image.yOffset);
image.needsCopy = true;
check$1(image.xOffset >= 0 && image.xOffset < viewW &&
image.yOffset >= 0 && image.yOffset < viewH &&
image.width > 0 && image.width <= viewW &&
image.height > 0 && image.height <= viewH,
'copy texture read out of bounds');
} else if (!data) {
image.width = image.width || 1;
image.height = image.height || 1;
image.channels = image.channels || 4;
} else if (isTypedArray(data)) {
image.channels = image.channels || 4;
image.data = data;
if (!('type' in options) && image.type === GL_UNSIGNED_BYTE$4) {
image.type = typedArrayCode$1(data);
}
} else if (isNumericArray(data)) {
image.channels = image.channels || 4;
convertData(image, data);
image.alignment = 1;
image.needsFree = true;
} else if (isNDArrayLike(data)) {
var array = data.data;
if (!Array.isArray(array) && image.type === GL_UNSIGNED_BYTE$4) {
image.type = typedArrayCode$1(array);
}
var shape = data.shape;
var stride = data.stride;
var shapeX, shapeY, shapeC, strideX, strideY, strideC;
if (shape.length === 3) {
shapeC = shape[2];
strideC = stride[2];
} else {
check$1(shape.length === 2, 'invalid ndarray pixel data, must be 2 or 3D');
shapeC = 1;
strideC = 1;
}
shapeX = shape[0];
shapeY = shape[1];
strideX = stride[0];
strideY = stride[1];
image.alignment = 1;
image.width = shapeX;
image.height = shapeY;
image.channels = shapeC;
image.format = image.internalformat = CHANNELS_FORMAT[shapeC];
image.needsFree = true;
transposeData(image, array, strideX, strideY, strideC, data.offset);
} else if (isCanvasElement(data) || isContext2D(data)) {
if (isCanvasElement(data)) {
image.element = data;
} else {
image.element = data.canvas;
}
image.width = image.element.width;
image.height = image.element.height;
image.channels = 4;
} else if (isImageElement(data)) {
image.element = data;
image.width = data.naturalWidth;
image.height = data.naturalHeight;
image.channels = 4;
} else if (isVideoElement(data)) {
image.element = data;
image.width = data.videoWidth;
image.height = data.videoHeight;
image.channels = 4;
} else if (isRectArray(data)) {
var w = image.width || data[0].length;
var h = image.height || data.length;
var c = image.channels;
if (isArrayLike(data[0][0])) {
c = c || data[0][0].length;
} else {
c = c || 1;
}
var arrayShape = flattenUtils.shape(data);
var n = 1;
for (var dd = 0; dd < arrayShape.length; ++dd) {
n *= arrayShape[dd];
}
var allocData = preConvert(image, n);
flattenUtils.flatten(data, arrayShape, '', allocData);
postConvert(image, allocData);
image.alignment = 1;
image.width = w;
image.height = h;
image.channels = c;
image.format = image.internalformat = CHANNELS_FORMAT[c];
image.needsFree = true;
}
if (image.type === GL_FLOAT$3) {
check$1(limits.extensions.indexOf('oes_texture_float') >= 0,
'oes_texture_float extension not enabled');
} else if (image.type === GL_HALF_FLOAT_OES$1) {
check$1(limits.extensions.indexOf('oes_texture_half_float') >= 0,
'oes_texture_half_float extension not enabled');
}
// do compressed texture validation here.
}
function setImage (info, target, miplevel) {
var element = info.element;
var data = info.data;
var internalformat = info.internalformat;
var format = info.format;
var type = info.type;
var width = info.width;
var height = info.height;
setFlags(info);
if (element) {
gl.texImage2D(target, miplevel, format, format, type, element);
} else if (info.compressed) {
gl.compressedTexImage2D(target, miplevel, internalformat, width, height, 0, data);
} else if (info.needsCopy) {
reglPoll();
gl.copyTexImage2D(
target, miplevel, format, info.xOffset, info.yOffset, width, height, 0);
} else {
gl.texImage2D(
target, miplevel, format, width, height, 0, format, type, data);
}
}
function setSubImage (info, target, x, y, miplevel) {
var element = info.element;
var data = info.data;
var internalformat = info.internalformat;
var format = info.format;
var type = info.type;
var width = info.width;
var height = info.height;
setFlags(info);
if (element) {
gl.texSubImage2D(
target, miplevel, x, y, format, type, element);
} else if (info.compressed) {
gl.compressedTexSubImage2D(
target, miplevel, x, y, internalformat, width, height, data);
} else if (info.needsCopy) {
reglPoll();
gl.copyTexSubImage2D(
target, miplevel, x, y, info.xOffset, info.yOffset, width, height);
} else {
gl.texSubImage2D(
target, miplevel, x, y, width, height, format, type, data);
}
}
// texImage pool
var imagePool = [];
function allocImage () {
return imagePool.pop() || new TexImage()
}
function freeImage (image) {
if (image.needsFree) {
pool.freeType(image.data);
}
TexImage.call(image);
imagePool.push(image);
}
// -------------------------------------------------------
// Mip map
// -------------------------------------------------------
function MipMap () {
TexFlags.call(this);
this.genMipmaps = false;
this.mipmapHint = GL_DONT_CARE;
this.mipmask = 0;
this.images = Array(16);
}
function parseMipMapFromShape (mipmap, width, height) {
var img = mipmap.images[0] = allocImage();
mipmap.mipmask = 1;
img.width = mipmap.width = width;
img.height = mipmap.height = height;
img.channels = mipmap.channels = 4;
}
function parseMipMapFromObject (mipmap, options) {
var imgData = null;
if (isPixelData(options)) {
imgData = mipmap.images[0] = allocImage();
copyFlags(imgData, mipmap);
parseImage(imgData, options);
mipmap.mipmask = 1;
} else {
parseFlags(mipmap, options);
if (Array.isArray(options.mipmap)) {
var mipData = options.mipmap;
for (var i = 0; i < mipData.length; ++i) {
imgData = mipmap.images[i] = allocImage();
copyFlags(imgData, mipmap);
imgData.width >>= i;
imgData.height >>= i;
parseImage(imgData, mipData[i]);
mipmap.mipmask |= (1 << i);
}
} else {
imgData = mipmap.images[0] = allocImage();
copyFlags(imgData, mipmap);
parseImage(imgData, options);
mipmap.mipmask = 1;
}
}
copyFlags(mipmap, mipmap.images[0]);
// For textures of the compressed format WEBGL_compressed_texture_s3tc
// we must have that
//
// "When level equals zero width and height must be a multiple of 4.
// When level is greater than 0 width and height must be 0, 1, 2 or a multiple of 4. "
//
// but we do not yet support having multiple mipmap levels for compressed textures,
// so we only test for level zero.
if (mipmap.compressed &&
(mipmap.internalformat === GL_COMPRESSED_RGB_S3TC_DXT1_EXT) ||
(mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) ||
(mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) ||
(mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)) {
check$1(mipmap.width % 4 === 0 &&
mipmap.height % 4 === 0,
'for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4');
}
}
function setMipMap (mipmap, target) {
var images = mipmap.images;
for (var i = 0; i < images.length; ++i) {
if (!images[i]) {
return
}
setImage(images[i], target, i);
}
}
var mipPool = [];
function allocMipMap () {
var result = mipPool.pop() || new MipMap();
TexFlags.call(result);
result.mipmask = 0;
for (var i = 0; i < 16; ++i) {
result.images[i] = null;
}
return result
}
function freeMipMap (mipmap) {
var images = mipmap.images;
for (var i = 0; i < images.length; ++i) {
if (images[i]) {
freeImage(images[i]);
}
images[i] = null;
}
mipPool.push(mipmap);
}
// -------------------------------------------------------
// Tex info
// -------------------------------------------------------
function TexInfo () {
this.minFilter = GL_NEAREST$1;
this.magFilter = GL_NEAREST$1;
this.wrapS = GL_CLAMP_TO_EDGE$1;
this.wrapT = GL_CLAMP_TO_EDGE$1;
this.anisotropic = 1;
this.genMipmaps = false;
this.mipmapHint = GL_DONT_CARE;
}
function parseTexInfo (info, options) {
if ('min' in options) {
var minFilter = options.min;
check$1.parameter(minFilter, minFilters);
info.minFilter = minFilters[minFilter];
if (MIPMAP_FILTERS.indexOf(info.minFilter) >= 0) {
info.genMipmaps = true;
}
}
if ('mag' in options) {
var magFilter = options.mag;
check$1.parameter(magFilter, magFilters);
info.magFilter = magFilters[magFilter];
}
var wrapS = info.wrapS;
var wrapT = info.wrapT;
if ('wrap' in options) {
var wrap = options.wrap;
if (typeof wrap === 'string') {
check$1.parameter(wrap, wrapModes);
wrapS = wrapT = wrapModes[wrap];
} else if (Array.isArray(wrap)) {
check$1.parameter(wrap[0], wrapModes);
check$1.parameter(wrap[1], wrapModes);
wrapS = wrapModes[wrap[0]];
wrapT = wrapModes[wrap[1]];
}
} else {
if ('wrapS' in options) {
var optWrapS = options.wrapS;
check$1.parameter(optWrapS, wrapModes);
wrapS = wrapModes[optWrapS];
}
if ('wrapT' in options) {
var optWrapT = options.wrapT;
check$1.parameter(optWrapT, wrapModes);
wrapT = wrapModes[optWrapT];
}
}
info.wrapS = wrapS;
info.wrapT = wrapT;
if ('anisotropic' in options) {
var anisotropic = options.anisotropic;
check$1(typeof anisotropic === 'number' &&
anisotropic >= 1 && anisotropic <= limits.maxAnisotropic,
'aniso samples must be between 1 and ');
info.anisotropic = options.anisotropic;
}
if ('mipmap' in options) {
var hasMipMap = false;
switch (typeof options.mipmap) {
case 'string':
check$1.parameter(options.mipmap, mipmapHint,
'invalid mipmap hint');
info.mipmapHint = mipmapHint[options.mipmap];
info.genMipmaps = true;
hasMipMap = true;
break
case 'boolean':
hasMipMap = info.genMipmaps = options.mipmap;
break
case 'object':
check$1(Array.isArray(options.mipmap), 'invalid mipmap type');
info.genMipmaps = false;
hasMipMap = true;
break
default:
check$1.raise('invalid mipmap type');
}
if (hasMipMap && !('min' in options)) {
info.minFilter = GL_NEAREST_MIPMAP_NEAREST$1;
}
}
}
function setTexInfo (info, target) {
gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, info.minFilter);
gl.texParameteri(target, GL_TEXTURE_MAG_FILTER, info.magFilter);
gl.texParameteri(target, GL_TEXTURE_WRAP_S, info.wrapS);
gl.texParameteri(target, GL_TEXTURE_WRAP_T, info.wrapT);
if (extensions.ext_texture_filter_anisotropic) {
gl.texParameteri(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, info.anisotropic);
}
if (info.genMipmaps) {
gl.hint(GL_GENERATE_MIPMAP_HINT, info.mipmapHint);
gl.generateMipmap(target);
}
}
// -------------------------------------------------------
// Full texture object
// -------------------------------------------------------
var textureCount = 0;
var textureSet = {};
var numTexUnits = limits.maxTextureUnits;
var textureUnits = Array(numTexUnits).map(function () {
return null
});
function REGLTexture (target) {
TexFlags.call(this);
this.mipmask = 0;
this.internalformat = GL_RGBA;
this.id = textureCount++;
this.refCount = 1;
this.target = target;
this.texture = gl.createTexture();
this.unit = -1;
this.bindCount = 0;
this.texInfo = new TexInfo();
if (config.profile) {
this.stats = {size: 0};
}
}
function tempBind (texture) {
gl.activeTexture(GL_TEXTURE0);
gl.bindTexture(texture.target, texture.texture);
}
function tempRestore () {
var prev = textureUnits[0];
if (prev) {
gl.bindTexture(prev.target, prev.texture);
} else {
gl.bindTexture(GL_TEXTURE_2D, null);
}
}
function destroy (texture) {
var handle = texture.texture;
check$1(handle, 'must not double destroy texture');
var unit = texture.unit;
var target = texture.target;
if (unit >= 0) {
gl.activeTexture(GL_TEXTURE0 + unit);
gl.bindTexture(target, null);
textureUnits[unit] = null;
}
gl.deleteTexture(handle);
texture.texture = null;
texture.params = null;
texture.pixels = null;
texture.refCount = 0;
delete textureSet[texture.id];
stats.textureCount--;
}
extend(REGLTexture.prototype, {
bind: function () {
var texture = this;
texture.bindCount += 1;
var unit = texture.unit;
if (unit < 0) {
for (var i = 0; i < numTexUnits; ++i) {
var other = textureUnits[i];
if (other) {
if (other.bindCount > 0) {
continue
}
other.unit = -1;
}
textureUnits[i] = texture;
unit = i;
break
}
if (unit >= numTexUnits) {
check$1.raise('insufficient number of texture units');
}
if (config.profile && stats.maxTextureUnits < (unit + 1)) {
stats.maxTextureUnits = unit + 1; // +1, since the units are zero-based
}
texture.unit = unit;
gl.activeTexture(GL_TEXTURE0 + unit);
gl.bindTexture(texture.target, texture.texture);
}
return unit
},
unbind: function () {
this.bindCount -= 1;
},
decRef: function () {
if (--this.refCount <= 0) {
destroy(this);
}
}
});
function createTexture2D (a, b) {
var texture = new REGLTexture(GL_TEXTURE_2D);
textureSet[texture.id] = texture;
stats.textureCount++;
function reglTexture2D (a, b) {
var texInfo = texture.texInfo;
TexInfo.call(texInfo);
var mipData = allocMipMap();
if (typeof a === 'number') {
if (typeof b === 'number') {
parseMipMapFromShape(mipData, a | 0, b | 0);
} else {
parseMipMapFromShape(mipData, a | 0, a | 0);
}
} else if (a) {
check$1.type(a, 'object', 'invalid arguments to regl.texture');
parseTexInfo(texInfo, a);
parseMipMapFromObject(mipData, a);
} else {
// empty textures get assigned a default shape of 1x1
parseMipMapFromShape(mipData, 1, 1);
}
if (texInfo.genMipmaps) {
mipData.mipmask = (mipData.width << 1) - 1;
}
texture.mipmask = mipData.mipmask;
copyFlags(texture, mipData);
check$1.texture2D(texInfo, mipData, limits);
texture.internalformat = mipData.internalformat;
reglTexture2D.width = mipData.width;
reglTexture2D.height = mipData.height;
tempBind(texture);
setMipMap(mipData, GL_TEXTURE_2D);
setTexInfo(texInfo, GL_TEXTURE_2D);
tempRestore();
freeMipMap(mipData);
if (config.profile) {
texture.stats.size = getTextureSize(
texture.internalformat,
texture.type,
mipData.width,
mipData.height,
texInfo.genMipmaps,
false);
}
reglTexture2D.format = textureFormatsInvert[texture.internalformat];
reglTexture2D.type = textureTypesInvert[texture.type];
reglTexture2D.mag = magFiltersInvert[texInfo.magFilter];
reglTexture2D.min = minFiltersInvert[texInfo.minFilter];
reglTexture2D.wrapS = wrapModesInvert[texInfo.wrapS];
reglTexture2D.wrapT = wrapModesInvert[texInfo.wrapT];
return reglTexture2D
}
function subimage (image, x_, y_, level_) {
check$1(!!image, 'must specify image data');
var x = x_ | 0;
var y = y_ | 0;
var level = level_ | 0;
var imageData = allocImage();
copyFlags(imageData, texture);
imageData.width = 0;
imageData.height = 0;
parseImage(imageData, image);
imageData.width = imageData.width || ((texture.width >> level) - x);
imageData.height = imageData.height || ((texture.height >> level) - y);
check$1(
texture.type === imageData.type &&
texture.format === imageData.format &&
texture.internalformat === imageData.internalformat,
'incompatible format for texture.subimage');
check$1(
x >= 0 && y >= 0 &&
x + imageData.width <= texture.width &&
y + imageData.height <= texture.height,
'texture.subimage write out of bounds');
check$1(
texture.mipmask & (1 << level),
'missing mipmap data');
check$1(
imageData.data || imageData.element || imageData.needsCopy,
'missing image data');
tempBind(texture);
setSubImage(imageData, GL_TEXTURE_2D, x, y, level);
tempRestore();
freeImage(imageData);
return reglTexture2D
}
function resize (w_, h_) {
var w = w_ | 0;
var h = (h_ | 0) || w;
if (w === texture.width && h === texture.height) {
return reglTexture2D
}
reglTexture2D.width = texture.width = w;
reglTexture2D.height = texture.height = h;
tempBind(texture);
for (var i = 0; texture.mipmask >> i; ++i) {
gl.texImage2D(
GL_TEXTURE_2D,
i,
texture.format,
w >> i,
h >> i,
0,
texture.format,
texture.type,
null);
}
tempRestore();
// also, recompute the texture size.
if (config.profile) {
texture.stats.size = getTextureSize(
texture.internalformat,
texture.type,
w,
h,
false,
false);
}
return reglTexture2D
}
reglTexture2D(a, b);
reglTexture2D.subimage = subimage;
reglTexture2D.resize = resize;
reglTexture2D._reglType = 'texture2d';
reglTexture2D._texture = texture;
if (config.profile) {
reglTexture2D.stats = texture.stats;
}
reglTexture2D.destroy = function () {
texture.decRef();
};
return reglTexture2D
}
function createTextureCube (a0, a1, a2, a3, a4, a5) {
var texture = new REGLTexture(GL_TEXTURE_CUBE_MAP);
textureSet[texture.id] = texture;
stats.cubeCount++;
var faces = new Array(6);
function reglTextureCube (a0, a1, a2, a3, a4, a5) {
var i;
var texInfo = texture.texInfo;
TexInfo.call(texInfo);
for (i = 0; i < 6; ++i) {
faces[i] = allocMipMap();
}
if (typeof a0 === 'number' || !a0) {
var s = (a0 | 0) || 1;
for (i = 0; i < 6; ++i) {
parseMipMapFromShape(faces[i], s, s);
}
} else if (typeof a0 === 'object') {
if (a1) {
parseMipMapFromObject(faces[0], a0);
parseMipMapFromObject(faces[1], a1);
parseMipMapFromObject(faces[2], a2);
parseMipMapFromObject(faces[3], a3);
parseMipMapFromObject(faces[4], a4);
parseMipMapFromObject(faces[5], a5);
} else {
parseTexInfo(texInfo, a0);
parseFlags(texture, a0);
if ('faces' in a0) {
var face_input = a0.faces;
check$1(Array.isArray(face_input) && face_input.length === 6,
'cube faces must be a length 6 array');
for (i = 0; i < 6; ++i) {
check$1(typeof face_input[i] === 'object' && !!face_input[i],
'invalid input for cube map face');
copyFlags(faces[i], texture);
parseMipMapFromObject(faces[i], face_input[i]);
}
} else {
for (i = 0; i < 6; ++i) {
parseMipMapFromObject(faces[i], a0);
}
}
}
} else {
check$1.raise('invalid arguments to cube map');
}
copyFlags(texture, faces[0]);
if (texInfo.genMipmaps) {
texture.mipmask = (faces[0].width << 1) - 1;
} else {
texture.mipmask = faces[0].mipmask;
}
check$1.textureCube(texture, texInfo, faces, limits);
texture.internalformat = faces[0].internalformat;
reglTextureCube.width = faces[0].width;
reglTextureCube.height = faces[0].height;
tempBind(texture);
for (i = 0; i < 6; ++i) {
setMipMap(faces[i], GL_TEXTURE_CUBE_MAP_POSITIVE_X + i);
}
setTexInfo(texInfo, GL_TEXTURE_CUBE_MAP);
tempRestore();
if (config.profile) {
texture.stats.size = getTextureSize(
texture.internalformat,
texture.type,
reglTextureCube.width,
reglTextureCube.height,
texInfo.genMipmaps,
true);
}
reglTextureCube.format = textureFormatsInvert[texture.internalformat];
reglTextureCube.type = textureTypesInvert[texture.type];
reglTextureCube.mag = magFiltersInvert[texInfo.magFilter];
reglTextureCube.min = minFiltersInvert[texInfo.minFilter];
reglTextureCube.wrapS = wrapModesInvert[texInfo.wrapS];
reglTextureCube.wrapT = wrapModesInvert[texInfo.wrapT];
for (i = 0; i < 6; ++i) {
freeMipMap(faces[i]);
}
return reglTextureCube
}
function subimage (face, image, x_, y_, level_) {
check$1(!!image, 'must specify image data');
check$1(typeof face === 'number' && face === (face | 0) &&
face >= 0 && face < 6, 'invalid face');
var x = x_ | 0;
var y = y_ | 0;
var level = level_ | 0;
var imageData = allocImage();
copyFlags(imageData, texture);
imageData.width = 0;
imageData.height = 0;
parseImage(imageData, image);
imageData.width = imageData.width || ((texture.width >> level) - x);
imageData.height = imageData.height || ((texture.height >> level) - y);
check$1(
texture.type === imageData.type &&
texture.format === imageData.format &&
texture.internalformat === imageData.internalformat,
'incompatible format for texture.subimage');
check$1(
x >= 0 && y >= 0 &&
x + imageData.width <= texture.width &&
y + imageData.height <= texture.height,
'texture.subimage write out of bounds');
check$1(
texture.mipmask & (1 << level),
'missing mipmap data');
check$1(
imageData.data || imageData.element || imageData.needsCopy,
'missing image data');
tempBind(texture);
setSubImage(imageData, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, x, y, level);
tempRestore();
freeImage(imageData);
return reglTextureCube
}
function resize (radius_) {
var radius = radius_ | 0;
if (radius === texture.width) {
return
}
reglTextureCube.width = texture.width = radius;
reglTextureCube.height = texture.height = radius;
tempBind(texture);
for (var i = 0; i < 6; ++i) {
for (var j = 0; texture.mipmask >> j; ++j) {
gl.texImage2D(
GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
j,
texture.format,
radius >> j,
radius >> j,
0,
texture.format,
texture.type,
null);
}
}
tempRestore();
if (config.profile) {
texture.stats.size = getTextureSize(
texture.internalformat,
texture.type,
reglTextureCube.width,
reglTextureCube.height,
false,
true);
}
return reglTextureCube
}
reglTextureCube(a0, a1, a2, a3, a4, a5);
reglTextureCube.subimage = subimage;
reglTextureCube.resize = resize;
reglTextureCube._reglType = 'textureCube';
reglTextureCube._texture = texture;
if (config.profile) {
reglTextureCube.stats = texture.stats;
}
reglTextureCube.destroy = function () {
texture.decRef();
};
return reglTextureCube
}
// Called when regl is destroyed
function destroyTextures () {
for (var i = 0; i < numTexUnits; ++i) {
gl.activeTexture(GL_TEXTURE0 + i);
gl.bindTexture(GL_TEXTURE_2D, null);
textureUnits[i] = null;
}
values(textureSet).forEach(destroy);
stats.cubeCount = 0;
stats.textureCount = 0;
}
if (config.profile) {
stats.getTotalTextureSize = function () {
var total = 0;
Object.keys(textureSet).forEach(function (key) {
total += textureSet[key].stats.size;
});
return total
};
}
function restoreTextures () {
values(textureSet).forEach(function (texture) {
texture.texture = gl.createTexture();
gl.bindTexture(texture.target, texture.texture);
for (var i = 0; i < 32; ++i) {
if ((texture.mipmask & (1 << i)) === 0) {
continue
}
if (texture.target === GL_TEXTURE_2D) {
gl.texImage2D(GL_TEXTURE_2D,
i,
texture.internalformat,
texture.width >> i,
texture.height >> i,
0,
texture.internalformat,
texture.type,
null);
} else {
for (var j = 0; j < 6; ++j) {
gl.texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + j,
i,
texture.internalformat,
texture.width >> i,
texture.height >> i,
0,
texture.internalformat,
texture.type,
null);
}
}
}
setTexInfo(texture.texInfo, texture.target);
});
}
return {
create2D: createTexture2D,
createCube: createTextureCube,
clear: destroyTextures,
getTexture: function (wrapper) {
return null
},
restore: restoreTextures
}
}
var GL_RENDERBUFFER = 0x8D41;
var GL_RGBA4$1 = 0x8056;
var GL_RGB5_A1$1 = 0x8057;
var GL_RGB565$1 = 0x8D62;
var GL_DEPTH_COMPONENT16 = 0x81A5;
var GL_STENCIL_INDEX8 = 0x8D48;
var GL_DEPTH_STENCIL$1 = 0x84F9;
var GL_SRGB8_ALPHA8_EXT = 0x8C43;
var GL_RGBA32F_EXT = 0x8814;
var GL_RGBA16F_EXT = 0x881A;
var GL_RGB16F_EXT = 0x881B;
var FORMAT_SIZES = [];
FORMAT_SIZES[GL_RGBA4$1] = 2;
FORMAT_SIZES[GL_RGB5_A1$1] = 2;
FORMAT_SIZES[GL_RGB565$1] = 2;
FORMAT_SIZES[GL_DEPTH_COMPONENT16] = 2;
FORMAT_SIZES[GL_STENCIL_INDEX8] = 1;
FORMAT_SIZES[GL_DEPTH_STENCIL$1] = 4;
FORMAT_SIZES[GL_SRGB8_ALPHA8_EXT] = 4;
FORMAT_SIZES[GL_RGBA32F_EXT] = 16;
FORMAT_SIZES[GL_RGBA16F_EXT] = 8;
FORMAT_SIZES[GL_RGB16F_EXT] = 6;
function getRenderbufferSize (format, width, height) {
return FORMAT_SIZES[format] * width * height
}
var wrapRenderbuffers = function (gl, extensions, limits, stats, config) {
var formatTypes = {
'rgba4': GL_RGBA4$1,
'rgb565': GL_RGB565$1,
'rgb5 a1': GL_RGB5_A1$1,
'depth': GL_DEPTH_COMPONENT16,
'stencil': GL_STENCIL_INDEX8,
'depth stencil': GL_DEPTH_STENCIL$1
};
if (extensions.ext_srgb) {
formatTypes['srgba'] = GL_SRGB8_ALPHA8_EXT;
}
if (extensions.ext_color_buffer_half_float) {
formatTypes['rgba16f'] = GL_RGBA16F_EXT;
formatTypes['rgb16f'] = GL_RGB16F_EXT;
}
if (extensions.webgl_color_buffer_float) {
formatTypes['rgba32f'] = GL_RGBA32F_EXT;
}
var formatTypesInvert = [];
Object.keys(formatTypes).forEach(function (key) {
var val = formatTypes[key];
formatTypesInvert[val] = key;
});
var renderbufferCount = 0;
var renderbufferSet = {};
function REGLRenderbuffer (renderbuffer) {
this.id = renderbufferCount++;
this.refCount = 1;
this.renderbuffer = renderbuffer;
this.format = GL_RGBA4$1;
this.width = 0;
this.height = 0;
if (config.profile) {
this.stats = {size: 0};
}
}
REGLRenderbuffer.prototype.decRef = function () {
if (--this.refCount <= 0) {
destroy(this);
}
};
function destroy (rb) {
var handle = rb.renderbuffer;
check$1(handle, 'must not double destroy renderbuffer');
gl.bindRenderbuffer(GL_RENDERBUFFER, null);
gl.deleteRenderbuffer(handle);
rb.renderbuffer = null;
rb.refCount = 0;
delete renderbufferSet[rb.id];
stats.renderbufferCount--;
}
function createRenderbuffer (a, b) {
var renderbuffer = new REGLRenderbuffer(gl.createRenderbuffer());
renderbufferSet[renderbuffer.id] = renderbuffer;
stats.renderbufferCount++;
function reglRenderbuffer (a, b) {
var w = 0;
var h = 0;
var format = GL_RGBA4$1;
if (typeof a === 'object' && a) {
var options = a;
if ('shape' in options) {
var shape = options.shape;
check$1(Array.isArray(shape) && shape.length >= 2,
'invalid renderbuffer shape');
w = shape[0] | 0;
h = shape[1] | 0;
} else {
if ('radius' in options) {
w = h = options.radius | 0;
}
if ('width' in options) {
w = options.width | 0;
}
if ('height' in options) {
h = options.height | 0;
}
}
if ('format' in options) {
check$1.parameter(options.format, formatTypes,
'invalid renderbuffer format');
format = formatTypes[options.format];
}
} else if (typeof a === 'number') {
w = a | 0;
if (typeof b === 'number') {
h = b | 0;
} else {
h = w;
}
} else if (!a) {
w = h = 1;
} else {
check$1.raise('invalid arguments to renderbuffer constructor');
}
// check shape
check$1(
w > 0 && h > 0 &&
w <= limits.maxRenderbufferSize && h <= limits.maxRenderbufferSize,
'invalid renderbuffer size');
if (w === renderbuffer.width &&
h === renderbuffer.height &&
format === renderbuffer.format) {
return
}
reglRenderbuffer.width = renderbuffer.width = w;
reglRenderbuffer.height = renderbuffer.height = h;
renderbuffer.format = format;
gl.bindRenderbuffer(GL_RENDERBUFFER, renderbuffer.renderbuffer);
gl.renderbufferStorage(GL_RENDERBUFFER, format, w, h);
if (config.profile) {
renderbuffer.stats.size = getRenderbufferSize(renderbuffer.format, renderbuffer.width, renderbuffer.height);
}
reglRenderbuffer.format = formatTypesInvert[renderbuffer.format];
return reglRenderbuffer
}
function resize (w_, h_) {
var w = w_ | 0;
var h = (h_ | 0) || w;
if (w === renderbuffer.width && h === renderbuffer.height) {
return reglRenderbuffer
}
// check shape
check$1(
w > 0 && h > 0 &&
w <= limits.maxRenderbufferSize && h <= limits.maxRenderbufferSize,
'invalid renderbuffer size');
reglRenderbuffer.width = renderbuffer.width = w;
reglRenderbuffer.height = renderbuffer.height = h;
gl.bindRenderbuffer(GL_RENDERBUFFER, renderbuffer.renderbuffer);
gl.renderbufferStorage(GL_RENDERBUFFER, renderbuffer.format, w, h);
// also, recompute size.
if (config.profile) {
renderbuffer.stats.size = getRenderbufferSize(
renderbuffer.format, renderbuffer.width, renderbuffer.height);
}
return reglRenderbuffer
}
reglRenderbuffer(a, b);
reglRenderbuffer.resize = resize;
reglRenderbuffer._reglType = 'renderbuffer';
reglRenderbuffer._renderbuffer = renderbuffer;
if (config.profile) {
reglRenderbuffer.stats = renderbuffer.stats;
}
reglRenderbuffer.destroy = function () {
renderbuffer.decRef();
};
return reglRenderbuffer
}
if (config.profile) {
stats.getTotalRenderbufferSize = function () {
var total = 0;
Object.keys(renderbufferSet).forEach(function (key) {
total += renderbufferSet[key].stats.size;
});
return total
};
}
function restoreRenderbuffers () {
values(renderbufferSet).forEach(function (rb) {
rb.renderbuffer = gl.createRenderbuffer();
gl.bindRenderbuffer(GL_RENDERBUFFER, rb.renderbuffer);
gl.renderbufferStorage(GL_RENDERBUFFER, rb.format, rb.width, rb.height);
});
gl.bindRenderbuffer(GL_RENDERBUFFER, null);
}
return {
create: createRenderbuffer,
clear: function () {
values(renderbufferSet).forEach(destroy);
},
restore: restoreRenderbuffers
}
};
// We store these constants so that the minifier can inline them
var GL_FRAMEBUFFER = 0x8D40;
var GL_RENDERBUFFER$1 = 0x8D41;
var GL_TEXTURE_2D$1 = 0x0DE1;
var GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 = 0x8515;
var GL_COLOR_ATTACHMENT0 = 0x8CE0;
var GL_DEPTH_ATTACHMENT = 0x8D00;
var GL_STENCIL_ATTACHMENT = 0x8D20;
var GL_DEPTH_STENCIL_ATTACHMENT = 0x821A;
var GL_FRAMEBUFFER_COMPLETE = 0x8CD5;
var GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
var GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
var GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
var GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
var GL_HALF_FLOAT_OES$2 = 0x8D61;
var GL_UNSIGNED_BYTE$5 = 0x1401;
var GL_FLOAT$4 = 0x1406;
var GL_RGBA$1 = 0x1908;
var GL_DEPTH_COMPONENT$1 = 0x1902;
var colorTextureFormatEnums = [
GL_RGBA$1
];
// for every texture format, store
// the number of channels
var textureFormatChannels = [];
textureFormatChannels[GL_RGBA$1] = 4;
// for every texture type, store
// the size in bytes.
var textureTypeSizes = [];
textureTypeSizes[GL_UNSIGNED_BYTE$5] = 1;
textureTypeSizes[GL_FLOAT$4] = 4;
textureTypeSizes[GL_HALF_FLOAT_OES$2] = 2;
var GL_RGBA4$2 = 0x8056;
var GL_RGB5_A1$2 = 0x8057;
var GL_RGB565$2 = 0x8D62;
var GL_DEPTH_COMPONENT16$1 = 0x81A5;
var GL_STENCIL_INDEX8$1 = 0x8D48;
var GL_DEPTH_STENCIL$2 = 0x84F9;
var GL_SRGB8_ALPHA8_EXT$1 = 0x8C43;
var GL_RGBA32F_EXT$1 = 0x8814;
var GL_RGBA16F_EXT$1 = 0x881A;
var GL_RGB16F_EXT$1 = 0x881B;
var colorRenderbufferFormatEnums = [
GL_RGBA4$2,
GL_RGB5_A1$2,
GL_RGB565$2,
GL_SRGB8_ALPHA8_EXT$1,
GL_RGBA16F_EXT$1,
GL_RGB16F_EXT$1,
GL_RGBA32F_EXT$1
];
var statusCode = {};
statusCode[GL_FRAMEBUFFER_COMPLETE] = 'complete';
statusCode[GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT] = 'incomplete attachment';
statusCode[GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS] = 'incomplete dimensions';
statusCode[GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT] = 'incomplete, missing attachment';
statusCode[GL_FRAMEBUFFER_UNSUPPORTED] = 'unsupported';
function wrapFBOState (
gl,
extensions,
limits,
textureState,
renderbufferState,
stats) {
var framebufferState = {
cur: null,
next: null,
dirty: false,
setFBO: null
};
var colorTextureFormats = ['rgba'];
var colorRenderbufferFormats = ['rgba4', 'rgb565', 'rgb5 a1'];
if (extensions.ext_srgb) {
colorRenderbufferFormats.push('srgba');
}
if (extensions.ext_color_buffer_half_float) {
colorRenderbufferFormats.push('rgba16f', 'rgb16f');
}
if (extensions.webgl_color_buffer_float) {
colorRenderbufferFormats.push('rgba32f');
}
var colorTypes = ['uint8'];
if (extensions.oes_texture_half_float) {
colorTypes.push('half float', 'float16');
}
if (extensions.oes_texture_float) {
colorTypes.push('float', 'float32');
}
function FramebufferAttachment (target, texture, renderbuffer) {
this.target = target;
this.texture = texture;
this.renderbuffer = renderbuffer;
var w = 0;
var h = 0;
if (texture) {
w = texture.width;
h = texture.height;
} else if (renderbuffer) {
w = renderbuffer.width;
h = renderbuffer.height;
}
this.width = w;
this.height = h;
}
function decRef (attachment) {
if (attachment) {
if (attachment.texture) {
attachment.texture._texture.decRef();
}
if (attachment.renderbuffer) {
attachment.renderbuffer._renderbuffer.decRef();
}
}
}
function incRefAndCheckShape (attachment, width, height) {
if (!attachment) {
return
}
if (attachment.texture) {
var texture = attachment.texture._texture;
var tw = Math.max(1, texture.width);
var th = Math.max(1, texture.height);
check$1(tw === width && th === height,
'inconsistent width/height for supplied texture');
texture.refCount += 1;
} else {
var renderbuffer = attachment.renderbuffer._renderbuffer;
check$1(
renderbuffer.width === width && renderbuffer.height === height,
'inconsistent width/height for renderbuffer');
renderbuffer.refCount += 1;
}
}
function attach (location, attachment) {
if (attachment) {
if (attachment.texture) {
gl.framebufferTexture2D(
GL_FRAMEBUFFER,
location,
attachment.target,
attachment.texture._texture.texture,
0);
} else {
gl.framebufferRenderbuffer(
GL_FRAMEBUFFER,
location,
GL_RENDERBUFFER$1,
attachment.renderbuffer._renderbuffer.renderbuffer);
}
}
}
function parseAttachment (attachment) {
var target = GL_TEXTURE_2D$1;
var texture = null;
var renderbuffer = null;
var data = attachment;
if (typeof attachment === 'object') {
data = attachment.data;
if ('target' in attachment) {
target = attachment.target | 0;
}
}
check$1.type(data, 'function', 'invalid attachment data');
var type = data._reglType;
if (type === 'texture2d') {
texture = data;
check$1(target === GL_TEXTURE_2D$1);
} else if (type === 'textureCube') {
texture = data;
check$1(
target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 &&
target < GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + 6,
'invalid cube map target');
} else if (type === 'renderbuffer') {
renderbuffer = data;
target = GL_RENDERBUFFER$1;
} else {
check$1.raise('invalid regl object for attachment');
}
return new FramebufferAttachment(target, texture, renderbuffer)
}
function allocAttachment (
width,
height,
isTexture,
format,
type) {
if (isTexture) {
var texture = textureState.create2D({
width: width,
height: height,
format: format,
type: type
});
texture._texture.refCount = 0;
return new FramebufferAttachment(GL_TEXTURE_2D$1, texture, null)
} else {
var rb = renderbufferState.create({
width: width,
height: height,
format: format
});
rb._renderbuffer.refCount = 0;
return new FramebufferAttachment(GL_RENDERBUFFER$1, null, rb)
}
}
function unwrapAttachment (attachment) {
return attachment && (attachment.texture || attachment.renderbuffer)
}
function resizeAttachment (attachment, w, h) {
if (attachment) {
if (attachment.texture) {
attachment.texture.resize(w, h);
} else if (attachment.renderbuffer) {
attachment.renderbuffer.resize(w, h);
}
}
}
var framebufferCount = 0;
var framebufferSet = {};
function REGLFramebuffer () {
this.id = framebufferCount++;
framebufferSet[this.id] = this;
this.framebuffer = gl.createFramebuffer();
this.width = 0;
this.height = 0;
this.colorAttachments = [];
this.depthAttachment = null;
this.stencilAttachment = null;
this.depthStencilAttachment = null;
}
function decFBORefs (framebuffer) {
framebuffer.colorAttachments.forEach(decRef);
decRef(framebuffer.depthAttachment);
decRef(framebuffer.stencilAttachment);
decRef(framebuffer.depthStencilAttachment);
}
function destroy (framebuffer) {
var handle = framebuffer.framebuffer;
check$1(handle, 'must not double destroy framebuffer');
gl.deleteFramebuffer(handle);
framebuffer.framebuffer = null;
stats.framebufferCount--;
delete framebufferSet[framebuffer.id];
}
function updateFramebuffer (framebuffer) {
var i;
gl.bindFramebuffer(GL_FRAMEBUFFER, framebuffer.framebuffer);
var colorAttachments = framebuffer.colorAttachments;
for (i = 0; i < colorAttachments.length; ++i) {
attach(GL_COLOR_ATTACHMENT0 + i, colorAttachments[i]);
}
for (i = colorAttachments.length; i < limits.maxColorAttachments; ++i) {
gl.framebufferTexture2D(
GL_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0 + i,
GL_TEXTURE_2D$1,
null,
0);
}
gl.framebufferTexture2D(
GL_FRAMEBUFFER,
GL_DEPTH_STENCIL_ATTACHMENT,
GL_TEXTURE_2D$1,
null,
0);
gl.framebufferTexture2D(
GL_FRAMEBUFFER,
GL_DEPTH_ATTACHMENT,
GL_TEXTURE_2D$1,
null,
0);
gl.framebufferTexture2D(
GL_FRAMEBUFFER,
GL_STENCIL_ATTACHMENT,
GL_TEXTURE_2D$1,
null,
0);
attach(GL_DEPTH_ATTACHMENT, framebuffer.depthAttachment);
attach(GL_STENCIL_ATTACHMENT, framebuffer.stencilAttachment);
attach(GL_DEPTH_STENCIL_ATTACHMENT, framebuffer.depthStencilAttachment);
// Check status code
var status = gl.checkFramebufferStatus(GL_FRAMEBUFFER);
if (status !== GL_FRAMEBUFFER_COMPLETE) {
check$1.raise('framebuffer configuration not supported, status = ' +
statusCode[status]);
}
gl.bindFramebuffer(GL_FRAMEBUFFER, framebufferState.next);
framebufferState.cur = framebufferState.next;
// FIXME: Clear error code here. This is a work around for a bug in
// headless-gl
gl.getError();
}
function createFBO (a0, a1) {
var framebuffer = new REGLFramebuffer();
stats.framebufferCount++;
function reglFramebuffer (a, b) {
var i;
check$1(framebufferState.next !== framebuffer,
'can not update framebuffer which is currently in use');
var extDrawBuffers = extensions.webgl_draw_buffers;
var width = 0;
var height = 0;
var needsDepth = true;
var needsStencil = true;
var colorBuffer = null;
var colorTexture = true;
var colorFormat = 'rgba';
var colorType = 'uint8';
var colorCount = 1;
var depthBuffer = null;
var stencilBuffer = null;
var depthStencilBuffer = null;
var depthStencilTexture = false;
if (typeof a === 'number') {
width = a | 0;
height = (b | 0) || width;
} else if (!a) {
width = height = 1;
} else {
check$1.type(a, 'object', 'invalid arguments for framebuffer');
var options = a;
if ('shape' in options) {
var shape = options.shape;
check$1(Array.isArray(shape) && shape.length >= 2,
'invalid shape for framebuffer');
width = shape[0];
height = shape[1];
} else {
if ('radius' in options) {
width = height = options.radius;
}
if ('width' in options) {
width = options.width;
}
if ('height' in options) {
height = options.height;
}
}
if ('color' in options ||
'colors' in options) {
colorBuffer =
options.color ||
options.colors;
if (Array.isArray(colorBuffer)) {
check$1(
colorBuffer.length === 1 || extDrawBuffers,
'multiple render targets not supported');
}
}
if (!colorBuffer) {
if ('colorCount' in options) {
colorCount = options.colorCount | 0;
check$1(colorCount > 0, 'invalid color buffer count');
}
if ('colorTexture' in options) {
colorTexture = !!options.colorTexture;
colorFormat = 'rgba4';
}
if ('colorType' in options) {
colorType = options.colorType;
if (!colorTexture) {
if (colorType === 'half float' || colorType === 'float16') {
check$1(extensions.ext_color_buffer_half_float,
'you must enable EXT_color_buffer_half_float to use 16-bit render buffers');
colorFormat = 'rgba16f';
} else if (colorType === 'float' || colorType === 'float32') {
check$1(extensions.webgl_color_buffer_float,
'you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers');
colorFormat = 'rgba32f';
}
} else {
check$1(extensions.oes_texture_float ||
!(colorType === 'float' || colorType === 'float32'),
'you must enable OES_texture_float in order to use floating point framebuffer objects');
check$1(extensions.oes_texture_half_float ||
!(colorType === 'half float' || colorType === 'float16'),
'you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects');
}
check$1.oneOf(colorType, colorTypes, 'invalid color type');
}
if ('colorFormat' in options) {
colorFormat = options.colorFormat;
if (colorTextureFormats.indexOf(colorFormat) >= 0) {
colorTexture = true;
} else if (colorRenderbufferFormats.indexOf(colorFormat) >= 0) {
colorTexture = false;
} else {
if (colorTexture) {
check$1.oneOf(
options.colorFormat, colorTextureFormats,
'invalid color format for texture');
} else {
check$1.oneOf(
options.colorFormat, colorRenderbufferFormats,
'invalid color format for renderbuffer');
}
}
}
}
if ('depthTexture' in options || 'depthStencilTexture' in options) {
depthStencilTexture = !!(options.depthTexture ||
options.depthStencilTexture);
check$1(!depthStencilTexture || extensions.webgl_depth_texture,
'webgl_depth_texture extension not supported');
}
if ('depth' in options) {
if (typeof options.depth === 'boolean') {
needsDepth = options.depth;
} else {
depthBuffer = options.depth;
needsStencil = false;
}
}
if ('stencil' in options) {
if (typeof options.stencil === 'boolean') {
needsStencil = options.stencil;
} else {
stencilBuffer = options.stencil;
needsDepth = false;
}
}
if ('depthStencil' in options) {
if (typeof options.depthStencil === 'boolean') {
needsDepth = needsStencil = options.depthStencil;
} else {
depthStencilBuffer = options.depthStencil;
needsDepth = false;
needsStencil = false;
}
}
}
// parse attachments
var colorAttachments = null;
var depthAttachment = null;
var stencilAttachment = null;
var depthStencilAttachment = null;
// Set up color attachments
if (Array.isArray(colorBuffer)) {
colorAttachments = colorBuffer.map(parseAttachment);
} else if (colorBuffer) {
colorAttachments = [parseAttachment(colorBuffer)];
} else {
colorAttachments = new Array(colorCount);
for (i = 0; i < colorCount; ++i) {
colorAttachments[i] = allocAttachment(
width,
height,
colorTexture,
colorFormat,
colorType);
}
}
check$1(extensions.webgl_draw_buffers || colorAttachments.length <= 1,
'you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers.');
check$1(colorAttachments.length <= limits.maxColorAttachments,
'too many color attachments, not supported');
width = width || colorAttachments[0].width;
height = height || colorAttachments[0].height;
if (depthBuffer) {
depthAttachment = parseAttachment(depthBuffer);
} else if (needsDepth && !needsStencil) {
depthAttachment = allocAttachment(
width,
height,
depthStencilTexture,
'depth',
'uint32');
}
if (stencilBuffer) {
stencilAttachment = parseAttachment(stencilBuffer);
} else if (needsStencil && !needsDepth) {
stencilAttachment = allocAttachment(
width,
height,
false,
'stencil',
'uint8');
}
if (depthStencilBuffer) {
depthStencilAttachment = parseAttachment(depthStencilBuffer);
} else if (!depthBuffer && !stencilBuffer && needsStencil && needsDepth) {
depthStencilAttachment = allocAttachment(
width,
height,
depthStencilTexture,
'depth stencil',
'depth stencil');
}
check$1(
(!!depthBuffer) + (!!stencilBuffer) + (!!depthStencilBuffer) <= 1,
'invalid framebuffer configuration, can specify exactly one depth/stencil attachment');
var commonColorAttachmentSize = null;
for (i = 0; i < colorAttachments.length; ++i) {
incRefAndCheckShape(colorAttachments[i], width, height);
check$1(!colorAttachments[i] ||
(colorAttachments[i].texture &&
colorTextureFormatEnums.indexOf(colorAttachments[i].texture._texture.format) >= 0) ||
(colorAttachments[i].renderbuffer &&
colorRenderbufferFormatEnums.indexOf(colorAttachments[i].renderbuffer._renderbuffer.format) >= 0),
'framebuffer color attachment ' + i + ' is invalid');
if (colorAttachments[i] && colorAttachments[i].texture) {
var colorAttachmentSize =
textureFormatChannels[colorAttachments[i].texture._texture.format] *
textureTypeSizes[colorAttachments[i].texture._texture.type];
if (commonColorAttachmentSize === null) {
commonColorAttachmentSize = colorAttachmentSize;
} else {
// We need to make sure that all color attachments have the same number of bitplanes
// (that is, the same numer of bits per pixel)
// This is required by the GLES2.0 standard. See the beginning of Chapter 4 in that document.
check$1(commonColorAttachmentSize === colorAttachmentSize,
'all color attachments much have the same number of bits per pixel.');
}
}
}
incRefAndCheckShape(depthAttachment, width, height);
check$1(!depthAttachment ||
(depthAttachment.texture &&
depthAttachment.texture._texture.format === GL_DEPTH_COMPONENT$1) ||
(depthAttachment.renderbuffer &&
depthAttachment.renderbuffer._renderbuffer.format === GL_DEPTH_COMPONENT16$1),
'invalid depth attachment for framebuffer object');
incRefAndCheckShape(stencilAttachment, width, height);
check$1(!stencilAttachment ||
(stencilAttachment.renderbuffer &&
stencilAttachment.renderbuffer._renderbuffer.format === GL_STENCIL_INDEX8$1),
'invalid stencil attachment for framebuffer object');
incRefAndCheckShape(depthStencilAttachment, width, height);
check$1(!depthStencilAttachment ||
(depthStencilAttachment.texture &&
depthStencilAttachment.texture._texture.format === GL_DEPTH_STENCIL$2) ||
(depthStencilAttachment.renderbuffer &&
depthStencilAttachment.renderbuffer._renderbuffer.format === GL_DEPTH_STENCIL$2),
'invalid depth-stencil attachment for framebuffer object');
// decrement references
decFBORefs(framebuffer);
framebuffer.width = width;
framebuffer.height = height;
framebuffer.colorAttachments = colorAttachments;
framebuffer.depthAttachment = depthAttachment;
framebuffer.stencilAttachment = stencilAttachment;
framebuffer.depthStencilAttachment = depthStencilAttachment;
reglFramebuffer.color = colorAttachments.map(unwrapAttachment);
reglFramebuffer.depth = unwrapAttachment(depthAttachment);
reglFramebuffer.stencil = unwrapAttachment(stencilAttachment);
reglFramebuffer.depthStencil = unwrapAttachment(depthStencilAttachment);
reglFramebuffer.width = framebuffer.width;
reglFramebuffer.height = framebuffer.height;
updateFramebuffer(framebuffer);
return reglFramebuffer
}
function resize (w_, h_) {
check$1(framebufferState.next !== framebuffer,
'can not resize a framebuffer which is currently in use');
var w = w_ | 0;
var h = (h_ | 0) || w;
if (w === framebuffer.width && h === framebuffer.height) {
return reglFramebuffer
}
// resize all buffers
var colorAttachments = framebuffer.colorAttachments;
for (var i = 0; i < colorAttachments.length; ++i) {
resizeAttachment(colorAttachments[i], w, h);
}
resizeAttachment(framebuffer.depthAttachment, w, h);
resizeAttachment(framebuffer.stencilAttachment, w, h);
resizeAttachment(framebuffer.depthStencilAttachment, w, h);
framebuffer.width = reglFramebuffer.width = w;
framebuffer.height = reglFramebuffer.height = h;
updateFramebuffer(framebuffer);
return reglFramebuffer
}
reglFramebuffer(a0, a1);
return extend(reglFramebuffer, {
resize: resize,
_reglType: 'framebuffer',
_framebuffer: framebuffer,
destroy: function () {
destroy(framebuffer);
decFBORefs(framebuffer);
},
use: function (block) {
framebufferState.setFBO({
framebuffer: reglFramebuffer
}, block);
}
})
}
function createCubeFBO (options) {
var faces = Array(6);
function reglFramebufferCube (a) {
var i;
check$1(faces.indexOf(framebufferState.next) < 0,
'can not update framebuffer which is currently in use');
var extDrawBuffers = extensions.webgl_draw_buffers;
var params = {
color: null
};
var radius = 0;
var colorBuffer = null;
var colorFormat = 'rgba';
var colorType = 'uint8';
var colorCount = 1;
if (typeof a === 'number') {
radius = a | 0;
} else if (!a) {
radius = 1;
} else {
check$1.type(a, 'object', 'invalid arguments for framebuffer');
var options = a;
if ('shape' in options) {
var shape = options.shape;
check$1(
Array.isArray(shape) && shape.length >= 2,
'invalid shape for framebuffer');
check$1(
shape[0] === shape[1],
'cube framebuffer must be square');
radius = shape[0];
} else {
if ('radius' in options) {
radius = options.radius | 0;
}
if ('width' in options) {
radius = options.width | 0;
if ('height' in options) {
check$1(options.height === radius, 'must be square');
}
} else if ('height' in options) {
radius = options.height | 0;
}
}
if ('color' in options ||
'colors' in options) {
colorBuffer =
options.color ||
options.colors;
if (Array.isArray(colorBuffer)) {
check$1(
colorBuffer.length === 1 || extDrawBuffers,
'multiple render targets not supported');
}
}
if (!colorBuffer) {
if ('colorCount' in options) {
colorCount = options.colorCount | 0;
check$1(colorCount > 0, 'invalid color buffer count');
}
if ('colorType' in options) {
check$1.oneOf(
options.colorType, colorTypes,
'invalid color type');
colorType = options.colorType;
}
if ('colorFormat' in options) {
colorFormat = options.colorFormat;
check$1.oneOf(
options.colorFormat, colorTextureFormats,
'invalid color format for texture');
}
}
if ('depth' in options) {
params.depth = options.depth;
}
if ('stencil' in options) {
params.stencil = options.stencil;
}
if ('depthStencil' in options) {
params.depthStencil = options.depthStencil;
}
}
var colorCubes;
if (colorBuffer) {
if (Array.isArray(colorBuffer)) {
colorCubes = [];
for (i = 0; i < colorBuffer.length; ++i) {
colorCubes[i] = colorBuffer[i];
}
} else {
colorCubes = [ colorBuffer ];
}
} else {
colorCubes = Array(colorCount);
var cubeMapParams = {
radius: radius,
format: colorFormat,
type: colorType
};
for (i = 0; i < colorCount; ++i) {
colorCubes[i] = textureState.createCube(cubeMapParams);
}
}
// Check color cubes
params.color = Array(colorCubes.length);
for (i = 0; i < colorCubes.length; ++i) {
var cube = colorCubes[i];
check$1(
typeof cube === 'function' && cube._reglType === 'textureCube',
'invalid cube map');
radius = radius || cube.width;
check$1(
cube.width === radius && cube.height === radius,
'invalid cube map shape');
params.color[i] = {
target: GL_TEXTURE_CUBE_MAP_POSITIVE_X$1,
data: colorCubes[i]
};
}
for (i = 0; i < 6; ++i) {
for (var j = 0; j < colorCubes.length; ++j) {
params.color[j].target = GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + i;
}
// reuse depth-stencil attachments across all cube maps
if (i > 0) {
params.depth = faces[0].depth;
params.stencil = faces[0].stencil;
params.depthStencil = faces[0].depthStencil;
}
if (faces[i]) {
(faces[i])(params);
} else {
faces[i] = createFBO(params);
}
}
return extend(reglFramebufferCube, {
width: radius,
height: radius,
color: colorCubes
})
}
function resize (radius_) {
var i;
var radius = radius_ | 0;
check$1(radius > 0 && radius <= limits.maxCubeMapSize,
'invalid radius for cube fbo');
if (radius === reglFramebufferCube.width) {
return reglFramebufferCube
}
var colors = reglFramebufferCube.color;
for (i = 0; i < colors.length; ++i) {
colors[i].resize(radius);
}
for (i = 0; i < 6; ++i) {
faces[i].resize(radius);
}
reglFramebufferCube.width = reglFramebufferCube.height = radius;
return reglFramebufferCube
}
reglFramebufferCube(options);
return extend(reglFramebufferCube, {
faces: faces,
resize: resize,
_reglType: 'framebufferCube',
destroy: function () {
faces.forEach(function (f) {
f.destroy();
});
}
})
}
function restoreFramebuffers () {
values(framebufferSet).forEach(function (fb) {
fb.framebuffer = gl.createFramebuffer();
updateFramebuffer(fb);
});
}
return extend(framebufferState, {
getFramebuffer: function (object) {
if (typeof object === 'function' && object._reglType === 'framebuffer') {
var fbo = object._framebuffer;
if (fbo instanceof REGLFramebuffer) {
return fbo
}
}
return null
},
create: createFBO,
createCube: createCubeFBO,
clear: function () {
values(framebufferSet).forEach(destroy);
},
restore: restoreFramebuffers
})
}
var GL_FLOAT$5 = 5126;
function AttributeRecord () {
this.state = 0;
this.x = 0.0;
this.y = 0.0;
this.z = 0.0;
this.w = 0.0;
this.buffer = null;
this.size = 0;
this.normalized = false;
this.type = GL_FLOAT$5;
this.offset = 0;
this.stride = 0;
this.divisor = 0;
}
function wrapAttributeState (
gl,
extensions,
limits,
bufferState,
stringStore) {
var NUM_ATTRIBUTES = limits.maxAttributes;
var attributeBindings = new Array(NUM_ATTRIBUTES);
for (var i = 0; i < NUM_ATTRIBUTES; ++i) {
attributeBindings[i] = new AttributeRecord();
}
return {
Record: AttributeRecord,
scope: {},
state: attributeBindings
}
}
var GL_FRAGMENT_SHADER = 35632;
var GL_VERTEX_SHADER = 35633;
var GL_ACTIVE_UNIFORMS = 0x8B86;
var GL_ACTIVE_ATTRIBUTES = 0x8B89;
function wrapShaderState (gl, stringStore, stats, config) {
// ===================================================
// glsl compilation and linking
// ===================================================
var fragShaders = {};
var vertShaders = {};
function ActiveInfo (name, id, location, info) {
this.name = name;
this.id = id;
this.location = location;
this.info = info;
}
function insertActiveInfo (list, info) {
for (var i = 0; i < list.length; ++i) {
if (list[i].id === info.id) {
list[i].location = info.location;
return
}
}
list.push(info);
}
function getShader (type, id, command) {
var cache = type === GL_FRAGMENT_SHADER ? fragShaders : vertShaders;
var shader = cache[id];
if (!shader) {
var source = stringStore.str(id);
shader = gl.createShader(type);
gl.shaderSource(shader, source);
gl.compileShader(shader);
check$1.shaderError(gl, shader, source, type, command);
cache[id] = shader;
}
return shader
}
// ===================================================
// program linking
// ===================================================
var programCache = {};
var programList = [];
var PROGRAM_COUNTER = 0;
function REGLProgram (fragId, vertId) {
this.id = PROGRAM_COUNTER++;
this.fragId = fragId;
this.vertId = vertId;
this.program = null;
this.uniforms = [];
this.attributes = [];
if (config.profile) {
this.stats = {
uniformsCount: 0,
attributesCount: 0
};
}
}
function linkProgram (desc, command) {
var i, info;
// -------------------------------
// compile & link
// -------------------------------
var fragShader = getShader(GL_FRAGMENT_SHADER, desc.fragId);
var vertShader = getShader(GL_VERTEX_SHADER, desc.vertId);
var program = desc.program = gl.createProgram();
gl.attachShader(program, fragShader);
gl.attachShader(program, vertShader);
gl.linkProgram(program);
check$1.linkError(
gl,
program,
stringStore.str(desc.fragId),
stringStore.str(desc.vertId),
command);
// -------------------------------
// grab uniforms
// -------------------------------
var numUniforms = gl.getProgramParameter(program, GL_ACTIVE_UNIFORMS);
if (config.profile) {
desc.stats.uniformsCount = numUniforms;
}
var uniforms = desc.uniforms;
for (i = 0; i < numUniforms; ++i) {
info = gl.getActiveUniform(program, i);
if (info) {
if (info.size > 1) {
for (var j = 0; j < info.size; ++j) {
var name = info.name.replace('[0]', '[' + j + ']');
insertActiveInfo(uniforms, new ActiveInfo(
name,
stringStore.id(name),
gl.getUniformLocation(program, name),
info));
}
} else {
insertActiveInfo(uniforms, new ActiveInfo(
info.name,
stringStore.id(info.name),
gl.getUniformLocation(program, info.name),
info));
}
}
}
// -------------------------------
// grab attributes
// -------------------------------
var numAttributes = gl.getProgramParameter(program, GL_ACTIVE_ATTRIBUTES);
if (config.profile) {
desc.stats.attributesCount = numAttributes;
}
var attributes = desc.attributes;
for (i = 0; i < numAttributes; ++i) {
info = gl.getActiveAttrib(program, i);
if (info) {
insertActiveInfo(attributes, new ActiveInfo(
info.name,
stringStore.id(info.name),
gl.getAttribLocation(program, info.name),
info));
}
}
}
if (config.profile) {
stats.getMaxUniformsCount = function () {
var m = 0;
programList.forEach(function (desc) {
if (desc.stats.uniformsCount > m) {
m = desc.stats.uniformsCount;
}
});
return m
};
stats.getMaxAttributesCount = function () {
var m = 0;
programList.forEach(function (desc) {
if (desc.stats.attributesCount > m) {
m = desc.stats.attributesCount;
}
});
return m
};
}
function restoreShaders () {
fragShaders = {};
vertShaders = {};
for (var i = 0; i < programList.length; ++i) {
linkProgram(programList[i]);
}
}
return {
clear: function () {
var deleteShader = gl.deleteShader.bind(gl);
values(fragShaders).forEach(deleteShader);
fragShaders = {};
values(vertShaders).forEach(deleteShader);
vertShaders = {};
programList.forEach(function (desc) {
gl.deleteProgram(desc.program);
});
programList.length = 0;
programCache = {};
stats.shaderCount = 0;
},
program: function (vertId, fragId, command) {
check$1.command(vertId >= 0, 'missing vertex shader', command);
check$1.command(fragId >= 0, 'missing fragment shader', command);
var cache = programCache[fragId];
if (!cache) {
cache = programCache[fragId] = {};
}
var program = cache[vertId];
if (!program) {
program = new REGLProgram(fragId, vertId);
stats.shaderCount++;
linkProgram(program, command);
cache[vertId] = program;
programList.push(program);
}
return program
},
restore: restoreShaders,
shader: getShader,
frag: -1,
vert: -1
}
}
var GL_RGBA$2 = 6408;
var GL_UNSIGNED_BYTE$6 = 5121;
var GL_PACK_ALIGNMENT = 0x0D05;
var GL_FLOAT$6 = 0x1406; // 5126
function wrapReadPixels (
gl,
framebufferState,
reglPoll,
context,
glAttributes,
extensions) {
function readPixelsImpl (input) {
var type;
if (framebufferState.next === null) {
check$1(
glAttributes.preserveDrawingBuffer,
'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer');
type = GL_UNSIGNED_BYTE$6;
} else {
check$1(
framebufferState.next.colorAttachments[0].texture !== null,
'You cannot read from a renderbuffer');
type = framebufferState.next.colorAttachments[0].texture._texture.type;
if (extensions.oes_texture_float) {
check$1(
type === GL_UNSIGNED_BYTE$6 || type === GL_FLOAT$6,
'Reading from a framebuffer is only allowed for the types \'uint8\' and \'float\'');
} else {
check$1(
type === GL_UNSIGNED_BYTE$6,
'Reading from a framebuffer is only allowed for the type \'uint8\'');
}
}
var x = 0;
var y = 0;
var width = context.framebufferWidth;
var height = context.framebufferHeight;
var data = null;
if (isTypedArray(input)) {
data = input;
} else if (input) {
check$1.type(input, 'object', 'invalid arguments to regl.read()');
x = input.x | 0;
y = input.y | 0;
check$1(
x >= 0 && x < context.framebufferWidth,
'invalid x offset for regl.read');
check$1(
y >= 0 && y < context.framebufferHeight,
'invalid y offset for regl.read');
width = (input.width || (context.framebufferWidth - x)) | 0;
height = (input.height || (context.framebufferHeight - y)) | 0;
data = input.data || null;
}
// sanity check input.data
if (data) {
if (type === GL_UNSIGNED_BYTE$6) {
check$1(
data instanceof Uint8Array,
'buffer must be \'Uint8Array\' when reading from a framebuffer of type \'uint8\'');
} else if (type === GL_FLOAT$6) {
check$1(
data instanceof Float32Array,
'buffer must be \'Float32Array\' when reading from a framebuffer of type \'float\'');
}
}
check$1(
width > 0 && width + x <= context.framebufferWidth,
'invalid width for read pixels');
check$1(
height > 0 && height + y <= context.framebufferHeight,
'invalid height for read pixels');
// Update WebGL state
reglPoll();
// Compute size
var size = width * height * 4;
// Allocate data
if (!data) {
if (type === GL_UNSIGNED_BYTE$6) {
data = new Uint8Array(size);
} else if (type === GL_FLOAT$6) {
data = data || new Float32Array(size);
}
}
// Type check
check$1.isTypedArray(data, 'data buffer for regl.read() must be a typedarray');
check$1(data.byteLength >= size, 'data buffer for regl.read() too small');
// Run read pixels
gl.pixelStorei(GL_PACK_ALIGNMENT, 4);
gl.readPixels(x, y, width, height, GL_RGBA$2,
type,
data);
return data
}
function readPixelsFBO (options) {
var result;
framebufferState.setFBO({
framebuffer: options.framebuffer
}, function () {
result = readPixelsImpl(options);
});
return result
}
function readPixels (options) {
if (!options || !('framebuffer' in options)) {
return readPixelsImpl(options)
} else {
return readPixelsFBO(options)
}
}
return readPixels
}
function slice (x) {
return Array.prototype.slice.call(x)
}
function join (x) {
return slice(x).join('')
}
function createEnvironment () {
// Unique variable id counter
var varCounter = 0;
// Linked values are passed from this scope into the generated code block
// Calling link() passes a value into the generated scope and returns
// the variable name which it is bound to
var linkedNames = [];
var linkedValues = [];
function link (value) {
for (var i = 0; i < linkedValues.length; ++i) {
if (linkedValues[i] === value) {
return linkedNames[i]
}
}
var name = 'g' + (varCounter++);
linkedNames.push(name);
linkedValues.push(value);
return name
}
// create a code block
function block () {
var code = [];
function push () {
code.push.apply(code, slice(arguments));
}
var vars = [];
function def () {
var name = 'v' + (varCounter++);
vars.push(name);
if (arguments.length > 0) {
code.push(name, '=');
code.push.apply(code, slice(arguments));
code.push(';');
}
return name
}
return extend(push, {
def: def,
toString: function () {
return join([
(vars.length > 0 ? 'var ' + vars + ';' : ''),
join(code)
])
}
})
}
function scope () {
var entry = block();
var exit = block();
var entryToString = entry.toString;
var exitToString = exit.toString;
function save (object, prop) {
exit(object, prop, '=', entry.def(object, prop), ';');
}
return extend(function () {
entry.apply(entry, slice(arguments));
}, {
def: entry.def,
entry: entry,
exit: exit,
save: save,
set: function (object, prop, value) {
save(object, prop);
entry(object, prop, '=', value, ';');
},
toString: function () {
return entryToString() + exitToString()
}
})
}
function conditional () {
var pred = join(arguments);
var thenBlock = scope();
var elseBlock = scope();
var thenToString = thenBlock.toString;
var elseToString = elseBlock.toString;
return extend(thenBlock, {
then: function () {
thenBlock.apply(thenBlock, slice(arguments));
return this
},
else: function () {
elseBlock.apply(elseBlock, slice(arguments));
return this
},
toString: function () {
var elseClause = elseToString();
if (elseClause) {
elseClause = 'else{' + elseClause + '}';
}
return join([
'if(', pred, '){',
thenToString(),
'}', elseClause
])
}
})
}
// procedure list
var globalBlock = block();
var procedures = {};
function proc (name, count) {
var args = [];
function arg () {
var name = 'a' + args.length;
args.push(name);
return name
}
count = count || 0;
for (var i = 0; i < count; ++i) {
arg();
}
var body = scope();
var bodyToString = body.toString;
var result = procedures[name] = extend(body, {
arg: arg,
toString: function () {
return join([
'function(', args.join(), '){',
bodyToString(),
'}'
])
}
});
return result
}
function compile () {
var code = ['"use strict";',
globalBlock,
'return {'];
Object.keys(procedures).forEach(function (name) {
code.push('"', name, '":', procedures[name].toString(), ',');
});
code.push('}');
var src = join(code)
.replace(/;/g, ';\n')
.replace(/}/g, '}\n')
.replace(/{/g, '{\n');
var proc = Function.apply(null, linkedNames.concat(src));
return proc.apply(null, linkedValues)
}
return {
global: globalBlock,
link: link,
block: block,
proc: proc,
scope: scope,
cond: conditional,
compile: compile
}
}
// "cute" names for vector components
var CUTE_COMPONENTS = 'xyzw'.split('');
var GL_UNSIGNED_BYTE$7 = 5121;
var ATTRIB_STATE_POINTER = 1;
var ATTRIB_STATE_CONSTANT = 2;
var DYN_FUNC$1 = 0;
var DYN_PROP$1 = 1;
var DYN_CONTEXT$1 = 2;
var DYN_STATE$1 = 3;
var DYN_THUNK = 4;
var S_DITHER = 'dither';
var S_BLEND_ENABLE = 'blend.enable';
var S_BLEND_COLOR = 'blend.color';
var S_BLEND_EQUATION = 'blend.equation';
var S_BLEND_FUNC = 'blend.func';
var S_DEPTH_ENABLE = 'depth.enable';
var S_DEPTH_FUNC = 'depth.func';
var S_DEPTH_RANGE = 'depth.range';
var S_DEPTH_MASK = 'depth.mask';
var S_COLOR_MASK = 'colorMask';
var S_CULL_ENABLE = 'cull.enable';
var S_CULL_FACE = 'cull.face';
var S_FRONT_FACE = 'frontFace';
var S_LINE_WIDTH = 'lineWidth';
var S_POLYGON_OFFSET_ENABLE = 'polygonOffset.enable';
var S_POLYGON_OFFSET_OFFSET = 'polygonOffset.offset';
var S_SAMPLE_ALPHA = 'sample.alpha';
var S_SAMPLE_ENABLE = 'sample.enable';
var S_SAMPLE_COVERAGE = 'sample.coverage';
var S_STENCIL_ENABLE = 'stencil.enable';
var S_STENCIL_MASK = 'stencil.mask';
var S_STENCIL_FUNC = 'stencil.func';
var S_STENCIL_OPFRONT = 'stencil.opFront';
var S_STENCIL_OPBACK = 'stencil.opBack';
var S_SCISSOR_ENABLE = 'scissor.enable';
var S_SCISSOR_BOX = 'scissor.box';
var S_VIEWPORT = 'viewport';
var S_PROFILE = 'profile';
var S_FRAMEBUFFER = 'framebuffer';
var S_VERT = 'vert';
var S_FRAG = 'frag';
var S_ELEMENTS = 'elements';
var S_PRIMITIVE = 'primitive';
var S_COUNT = 'count';
var S_OFFSET = 'offset';
var S_INSTANCES = 'instances';
var SUFFIX_WIDTH = 'Width';
var SUFFIX_HEIGHT = 'Height';
var S_FRAMEBUFFER_WIDTH = S_FRAMEBUFFER + SUFFIX_WIDTH;
var S_FRAMEBUFFER_HEIGHT = S_FRAMEBUFFER + SUFFIX_HEIGHT;
var S_VIEWPORT_WIDTH = S_VIEWPORT + SUFFIX_WIDTH;
var S_VIEWPORT_HEIGHT = S_VIEWPORT + SUFFIX_HEIGHT;
var S_DRAWINGBUFFER = 'drawingBuffer';
var S_DRAWINGBUFFER_WIDTH = S_DRAWINGBUFFER + SUFFIX_WIDTH;
var S_DRAWINGBUFFER_HEIGHT = S_DRAWINGBUFFER + SUFFIX_HEIGHT;
var NESTED_OPTIONS = [
S_BLEND_FUNC,
S_BLEND_EQUATION,
S_STENCIL_FUNC,
S_STENCIL_OPFRONT,
S_STENCIL_OPBACK,
S_SAMPLE_COVERAGE,
S_VIEWPORT,
S_SCISSOR_BOX,
S_POLYGON_OFFSET_OFFSET
];
var GL_ARRAY_BUFFER$1 = 34962;
var GL_ELEMENT_ARRAY_BUFFER$1 = 34963;
var GL_FRAGMENT_SHADER$1 = 35632;
var GL_VERTEX_SHADER$1 = 35633;
var GL_TEXTURE_2D$2 = 0x0DE1;
var GL_TEXTURE_CUBE_MAP$1 = 0x8513;
var GL_CULL_FACE = 0x0B44;
var GL_BLEND = 0x0BE2;
var GL_DITHER = 0x0BD0;
var GL_STENCIL_TEST = 0x0B90;
var GL_DEPTH_TEST = 0x0B71;
var GL_SCISSOR_TEST = 0x0C11;
var GL_POLYGON_OFFSET_FILL = 0x8037;
var GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
var GL_SAMPLE_COVERAGE = 0x80A0;
var GL_FLOAT$7 = 5126;
var GL_FLOAT_VEC2 = 35664;
var GL_FLOAT_VEC3 = 35665;
var GL_FLOAT_VEC4 = 35666;
var GL_INT$3 = 5124;
var GL_INT_VEC2 = 35667;
var GL_INT_VEC3 = 35668;
var GL_INT_VEC4 = 35669;
var GL_BOOL = 35670;
var GL_BOOL_VEC2 = 35671;
var GL_BOOL_VEC3 = 35672;
var GL_BOOL_VEC4 = 35673;
var GL_FLOAT_MAT2 = 35674;
var GL_FLOAT_MAT3 = 35675;
var GL_FLOAT_MAT4 = 35676;
var GL_SAMPLER_2D = 35678;
var GL_SAMPLER_CUBE = 35680;
var GL_TRIANGLES$1 = 4;
var GL_FRONT = 1028;
var GL_BACK = 1029;
var GL_CW = 0x0900;
var GL_CCW = 0x0901;
var GL_MIN_EXT = 0x8007;
var GL_MAX_EXT = 0x8008;
var GL_ALWAYS = 519;
var GL_KEEP = 7680;
var GL_ZERO = 0;
var GL_ONE = 1;
var GL_FUNC_ADD = 0x8006;
var GL_LESS = 513;
var GL_FRAMEBUFFER$1 = 0x8D40;
var GL_COLOR_ATTACHMENT0$1 = 0x8CE0;
var blendFuncs = {
'0': 0,
'1': 1,
'zero': 0,
'one': 1,
'src color': 768,
'one minus src color': 769,
'src alpha': 770,
'one minus src alpha': 771,
'dst color': 774,
'one minus dst color': 775,
'dst alpha': 772,
'one minus dst alpha': 773,
'constant color': 32769,
'one minus constant color': 32770,
'constant alpha': 32771,
'one minus constant alpha': 32772,
'src alpha saturate': 776
};
// There are invalid values for srcRGB and dstRGB. See:
// https://www.khronos.org/registry/webgl/specs/1.0/#6.13
// https://github.com/KhronosGroup/WebGL/blob/0d3201f5f7ec3c0060bc1f04077461541f1987b9/conformance-suites/1.0.3/conformance/misc/webgl-specific.html#L56
var invalidBlendCombinations = [
'constant color, constant alpha',
'one minus constant color, constant alpha',
'constant color, one minus constant alpha',
'one minus constant color, one minus constant alpha',
'constant alpha, constant color',
'constant alpha, one minus constant color',
'one minus constant alpha, constant color',
'one minus constant alpha, one minus constant color'
];
var compareFuncs = {
'never': 512,
'less': 513,
'<': 513,
'equal': 514,
'=': 514,
'==': 514,
'===': 514,
'lequal': 515,
'<=': 515,
'greater': 516,
'>': 516,
'notequal': 517,
'!=': 517,
'!==': 517,
'gequal': 518,
'>=': 518,
'always': 519
};
var stencilOps = {
'0': 0,
'zero': 0,
'keep': 7680,
'replace': 7681,
'increment': 7682,
'decrement': 7683,
'increment wrap': 34055,
'decrement wrap': 34056,
'invert': 5386
};
var shaderType = {
'frag': GL_FRAGMENT_SHADER$1,
'vert': GL_VERTEX_SHADER$1
};
var orientationType = {
'cw': GL_CW,
'ccw': GL_CCW
};
function isBufferArgs (x) {
return Array.isArray(x) ||
isTypedArray(x) ||
isNDArrayLike(x)
}
// Make sure viewport is processed first
function sortState (state) {
return state.sort(function (a, b) {
if (a === S_VIEWPORT) {
return -1
} else if (b === S_VIEWPORT) {
return 1
}
return (a < b) ? -1 : 1
})
}
function Declaration (thisDep, contextDep, propDep, append) {
this.thisDep = thisDep;
this.contextDep = contextDep;
this.propDep = propDep;
this.append = append;
}
function isStatic (decl) {
return decl && !(decl.thisDep || decl.contextDep || decl.propDep)
}
function createStaticDecl (append) {
return new Declaration(false, false, false, append)
}
function createDynamicDecl (dyn, append) {
var type = dyn.type;
if (type === DYN_FUNC$1) {
var numArgs = dyn.data.length;
return new Declaration(
true,
numArgs >= 1,
numArgs >= 2,
append)
} else if (type === DYN_THUNK) {
var data = dyn.data;
return new Declaration(
data.thisDep,
data.contextDep,
data.propDep,
append)
} else {
return new Declaration(
type === DYN_STATE$1,
type === DYN_CONTEXT$1,
type === DYN_PROP$1,
append)
}
}
var SCOPE_DECL = new Declaration(false, false, false, function () {});
function reglCore (
gl,
stringStore,
extensions,
limits,
bufferState,
elementState,
textureState,
framebufferState,
uniformState,
attributeState,
shaderState,
drawState,
contextState,
timer,
config) {
var AttributeRecord = attributeState.Record;
var blendEquations = {
'add': 32774,
'subtract': 32778,
'reverse subtract': 32779
};
if (extensions.ext_blend_minmax) {
blendEquations.min = GL_MIN_EXT;
blendEquations.max = GL_MAX_EXT;
}
var extInstancing = extensions.angle_instanced_arrays;
var extDrawBuffers = extensions.webgl_draw_buffers;
// ===================================================
// ===================================================
// WEBGL STATE
// ===================================================
// ===================================================
var currentState = {
dirty: true,
profile: config.profile
};
var nextState = {};
var GL_STATE_NAMES = [];
var GL_FLAGS = {};
var GL_VARIABLES = {};
function propName (name) {
return name.replace('.', '_')
}
function stateFlag (sname, cap, init) {
var name = propName(sname);
GL_STATE_NAMES.push(sname);
nextState[name] = currentState[name] = !!init;
GL_FLAGS[name] = cap;
}
function stateVariable (sname, func, init) {
var name = propName(sname);
GL_STATE_NAMES.push(sname);
if (Array.isArray(init)) {
currentState[name] = init.slice();
nextState[name] = init.slice();
} else {
currentState[name] = nextState[name] = init;
}
GL_VARIABLES[name] = func;
}
// Dithering
stateFlag(S_DITHER, GL_DITHER);
// Blending
stateFlag(S_BLEND_ENABLE, GL_BLEND);
stateVariable(S_BLEND_COLOR, 'blendColor', [0, 0, 0, 0]);
stateVariable(S_BLEND_EQUATION, 'blendEquationSeparate',
[GL_FUNC_ADD, GL_FUNC_ADD]);
stateVariable(S_BLEND_FUNC, 'blendFuncSeparate',
[GL_ONE, GL_ZERO, GL_ONE, GL_ZERO]);
// Depth
stateFlag(S_DEPTH_ENABLE, GL_DEPTH_TEST, true);
stateVariable(S_DEPTH_FUNC, 'depthFunc', GL_LESS);
stateVariable(S_DEPTH_RANGE, 'depthRange', [0, 1]);
stateVariable(S_DEPTH_MASK, 'depthMask', true);
// Color mask
stateVariable(S_COLOR_MASK, S_COLOR_MASK, [true, true, true, true]);
// Face culling
stateFlag(S_CULL_ENABLE, GL_CULL_FACE);
stateVariable(S_CULL_FACE, 'cullFace', GL_BACK);
// Front face orientation
stateVariable(S_FRONT_FACE, S_FRONT_FACE, GL_CCW);
// Line width
stateVariable(S_LINE_WIDTH, S_LINE_WIDTH, 1);
// Polygon offset
stateFlag(S_POLYGON_OFFSET_ENABLE, GL_POLYGON_OFFSET_FILL);
stateVariable(S_POLYGON_OFFSET_OFFSET, 'polygonOffset', [0, 0]);
// Sample coverage
stateFlag(S_SAMPLE_ALPHA, GL_SAMPLE_ALPHA_TO_COVERAGE);
stateFlag(S_SAMPLE_ENABLE, GL_SAMPLE_COVERAGE);
stateVariable(S_SAMPLE_COVERAGE, 'sampleCoverage', [1, false]);
// Stencil
stateFlag(S_STENCIL_ENABLE, GL_STENCIL_TEST);
stateVariable(S_STENCIL_MASK, 'stencilMask', -1);
stateVariable(S_STENCIL_FUNC, 'stencilFunc', [GL_ALWAYS, 0, -1]);
stateVariable(S_STENCIL_OPFRONT, 'stencilOpSeparate',
[GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP]);
stateVariable(S_STENCIL_OPBACK, 'stencilOpSeparate',
[GL_BACK, GL_KEEP, GL_KEEP, GL_KEEP]);
// Scissor
stateFlag(S_SCISSOR_ENABLE, GL_SCISSOR_TEST);
stateVariable(S_SCISSOR_BOX, 'scissor',
[0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight]);
// Viewport
stateVariable(S_VIEWPORT, S_VIEWPORT,
[0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight]);
// ===================================================
// ===================================================
// ENVIRONMENT
// ===================================================
// ===================================================
var sharedState = {
gl: gl,
context: contextState,
strings: stringStore,
next: nextState,
current: currentState,
draw: drawState,
elements: elementState,
buffer: bufferState,
shader: shaderState,
attributes: attributeState.state,
uniforms: uniformState,
framebuffer: framebufferState,
extensions: extensions,
timer: timer,
isBufferArgs: isBufferArgs
};
var sharedConstants = {
primTypes: primTypes,
compareFuncs: compareFuncs,
blendFuncs: blendFuncs,
blendEquations: blendEquations,
stencilOps: stencilOps,
glTypes: glTypes,
orientationType: orientationType
};
check$1.optional(function () {
sharedState.isArrayLike = isArrayLike;
});
if (extDrawBuffers) {
sharedConstants.backBuffer = [GL_BACK];
sharedConstants.drawBuffer = loop(limits.maxDrawbuffers, function (i) {
if (i === 0) {
return [0]
}
return loop(i, function (j) {
return GL_COLOR_ATTACHMENT0$1 + j
})
});
}
var drawCallCounter = 0;
function createREGLEnvironment () {
var env = createEnvironment();
var link = env.link;
var global = env.global;
env.id = drawCallCounter++;
env.batchId = '0';
// link shared state
var SHARED = link(sharedState);
var shared = env.shared = {
props: 'a0'
};
Object.keys(sharedState).forEach(function (prop) {
shared[prop] = global.def(SHARED, '.', prop);
});
// Inject runtime assertion stuff for debug builds
check$1.optional(function () {
env.CHECK = link(check$1);
env.commandStr = check$1.guessCommand();
env.command = link(env.commandStr);
env.assert = function (block, pred, message) {
block(
'if(!(', pred, '))',
this.CHECK, '.commandRaise(', link(message), ',', this.command, ');');
};
sharedConstants.invalidBlendCombinations = invalidBlendCombinations;
});
// Copy GL state variables over
var nextVars = env.next = {};
var currentVars = env.current = {};
Object.keys(GL_VARIABLES).forEach(function (variable) {
if (Array.isArray(currentState[variable])) {
nextVars[variable] = global.def(shared.next, '.', variable);
currentVars[variable] = global.def(shared.current, '.', variable);
}
});
// Initialize shared constants
var constants = env.constants = {};
Object.keys(sharedConstants).forEach(function (name) {
constants[name] = global.def(JSON.stringify(sharedConstants[name]));
});
// Helper function for calling a block
env.invoke = function (block, x) {
switch (x.type) {
case DYN_FUNC$1:
var argList = [
'this',
shared.context,
shared.props,
env.batchId
];
return block.def(
link(x.data), '.call(',
argList.slice(0, Math.max(x.data.length + 1, 4)),
')')
case DYN_PROP$1:
return block.def(shared.props, x.data)
case DYN_CONTEXT$1:
return block.def(shared.context, x.data)
case DYN_STATE$1:
return block.def('this', x.data)
case DYN_THUNK:
x.data.append(env, block);
return x.data.ref
}
};
env.attribCache = {};
var scopeAttribs = {};
env.scopeAttrib = function (name) {
var id = stringStore.id(name);
if (id in scopeAttribs) {
return scopeAttribs[id]
}
var binding = attributeState.scope[id];
if (!binding) {
binding = attributeState.scope[id] = new AttributeRecord();
}
var result = scopeAttribs[id] = link(binding);
return result
};
return env
}
// ===================================================
// ===================================================
// PARSING
// ===================================================
// ===================================================
function parseProfile (options) {
var staticOptions = options.static;
var dynamicOptions = options.dynamic;
var profileEnable;
if (S_PROFILE in staticOptions) {
var value = !!staticOptions[S_PROFILE];
profileEnable = createStaticDecl(function (env, scope) {
return value
});
profileEnable.enable = value;
} else if (S_PROFILE in dynamicOptions) {
var dyn = dynamicOptions[S_PROFILE];
profileEnable = createDynamicDecl(dyn, function (env, scope) {
return env.invoke(scope, dyn)
});
}
return profileEnable
}
function parseFramebuffer (options, env) {
var staticOptions = options.static;
var dynamicOptions = options.dynamic;
if (S_FRAMEBUFFER in staticOptions) {
var framebuffer = staticOptions[S_FRAMEBUFFER];
if (framebuffer) {
framebuffer = framebufferState.getFramebuffer(framebuffer);
check$1.command(framebuffer, 'invalid framebuffer object');
return createStaticDecl(function (env, block) {
var FRAMEBUFFER = env.link(framebuffer);
var shared = env.shared;
block.set(
shared.framebuffer,
'.next',
FRAMEBUFFER);
var CONTEXT = shared.context;
block.set(
CONTEXT,
'.' + S_FRAMEBUFFER_WIDTH,
FRAMEBUFFER + '.width');
block.set(
CONTEXT,
'.' + S_FRAMEBUFFER_HEIGHT,
FRAMEBUFFER + '.height');
return FRAMEBUFFER
})
} else {
return createStaticDecl(function (env, scope) {
var shared = env.shared;
scope.set(
shared.framebuffer,
'.next',
'null');
var CONTEXT = shared.context;
scope.set(
CONTEXT,
'.' + S_FRAMEBUFFER_WIDTH,
CONTEXT + '.' + S_DRAWINGBUFFER_WIDTH);
scope.set(
CONTEXT,
'.' + S_FRAMEBUFFER_HEIGHT,
CONTEXT + '.' + S_DRAWINGBUFFER_HEIGHT);
return 'null'
})
}
} else if (S_FRAMEBUFFER in dynamicOptions) {
var dyn = dynamicOptions[S_FRAMEBUFFER];
return createDynamicDecl(dyn, function (env, scope) {
var FRAMEBUFFER_FUNC = env.invoke(scope, dyn);
var shared = env.shared;
var FRAMEBUFFER_STATE = shared.framebuffer;
var FRAMEBUFFER = scope.def(
FRAMEBUFFER_STATE, '.getFramebuffer(', FRAMEBUFFER_FUNC, ')');
check$1.optional(function () {
env.assert(scope,
'!' + FRAMEBUFFER_FUNC + '||' + FRAMEBUFFER,
'invalid framebuffer object');
});
scope.set(
FRAMEBUFFER_STATE,
'.next',
FRAMEBUFFER);
var CONTEXT = shared.context;
scope.set(
CONTEXT,
'.' + S_FRAMEBUFFER_WIDTH,
FRAMEBUFFER + '?' + FRAMEBUFFER + '.width:' +
CONTEXT + '.' + S_DRAWINGBUFFER_WIDTH);
scope.set(
CONTEXT,
'.' + S_FRAMEBUFFER_HEIGHT,
FRAMEBUFFER +
'?' + FRAMEBUFFER + '.height:' +
CONTEXT + '.' + S_DRAWINGBUFFER_HEIGHT);
return FRAMEBUFFER
})
} else {
return null
}
}
function parseViewportScissor (options, framebuffer, env) {
var staticOptions = options.static;
var dynamicOptions = options.dynamic;
function parseBox (param) {
if (param in staticOptions) {
var box = staticOptions[param];
check$1.commandType(box, 'object', 'invalid ' + param, env.commandStr);
var isStatic = true;
var x = box.x | 0;
var y = box.y | 0;
var w, h;
if ('width' in box) {
w = box.width | 0;
check$1.command(w >= 0, 'invalid ' + param, env.commandStr);
} else {
isStatic = false;
}
if ('height' in box) {
h = box.height | 0;
check$1.command(h >= 0, 'invalid ' + param, env.commandStr);
} else {
isStatic = false;
}
return new Declaration(
!isStatic && framebuffer && framebuffer.thisDep,
!isStatic && framebuffer && framebuffer.contextDep,
!isStatic && framebuffer && framebuffer.propDep,
function (env, scope) {
var CONTEXT = env.shared.context;
var BOX_W = w;
if (!('width' in box)) {
BOX_W = scope.def(CONTEXT, '.', S_FRAMEBUFFER_WIDTH, '-', x);
}
var BOX_H = h;
if (!('height' in box)) {
BOX_H = scope.def(CONTEXT, '.', S_FRAMEBUFFER_HEIGHT, '-', y);
}
return [x, y, BOX_W, BOX_H]
})
} else if (param in dynamicOptions) {
var dynBox = dynamicOptions[param];
var result = createDynamicDecl(dynBox, function (env, scope) {
var BOX = env.invoke(scope, dynBox);
check$1.optional(function () {
env.assert(scope,
BOX + '&&typeof ' + BOX + '==="object"',
'invalid ' + param);
});
var CONTEXT = env.shared.context;
var BOX_X = scope.def(BOX, '.x|0');
var BOX_Y = scope.def(BOX, '.y|0');
var BOX_W = scope.def(
'"width" in ', BOX, '?', BOX, '.width|0:',
'(', CONTEXT, '.', S_FRAMEBUFFER_WIDTH, '-', BOX_X, ')');
var BOX_H = scope.def(
'"height" in ', BOX, '?', BOX, '.height|0:',
'(', CONTEXT, '.', S_FRAMEBUFFER_HEIGHT, '-', BOX_Y, ')');
check$1.optional(function () {
env.assert(scope,
BOX_W + '>=0&&' +
BOX_H + '>=0',
'invalid ' + param);
});
return [BOX_X, BOX_Y, BOX_W, BOX_H]
});
if (framebuffer) {
result.thisDep = result.thisDep || framebuffer.thisDep;
result.contextDep = result.contextDep || framebuffer.contextDep;
result.propDep = result.propDep || framebuffer.propDep;
}
return result
} else if (framebuffer) {
return new Declaration(
framebuffer.thisDep,
framebuffer.contextDep,
framebuffer.propDep,
function (env, scope) {
var CONTEXT = env.shared.context;
return [
0, 0,
scope.def(CONTEXT, '.', S_FRAMEBUFFER_WIDTH),
scope.def(CONTEXT, '.', S_FRAMEBUFFER_HEIGHT)]
})
} else {
return null
}
}
var viewport = parseBox(S_VIEWPORT);
if (viewport) {
var prevViewport = viewport;
viewport = new Declaration(
viewport.thisDep,
viewport.contextDep,
viewport.propDep,
function (env, scope) {
var VIEWPORT = prevViewport.append(env, scope);
var CONTEXT = env.shared.context;
scope.set(
CONTEXT,
'.' + S_VIEWPORT_WIDTH,
VIEWPORT[2]);
scope.set(
CONTEXT,
'.' + S_VIEWPORT_HEIGHT,
VIEWPORT[3]);
return VIEWPORT
});
}
return {
viewport: viewport,
scissor_box: parseBox(S_SCISSOR_BOX)
}
}
function parseProgram (options) {
var staticOptions = options.static;
var dynamicOptions = options.dynamic;
function parseShader (name) {
if (name in staticOptions) {
var id = stringStore.id(staticOptions[name]);
check$1.optional(function () {
shaderState.shader(shaderType[name], id, check$1.guessCommand());
});
var result = createStaticDecl(function () {
return id
});
result.id = id;
return result
} else if (name in dynamicOptions) {
var dyn = dynamicOptions[name];
return createDynamicDecl(dyn, function (env, scope) {
var str = env.invoke(scope, dyn);
var id = scope.def(env.shared.strings, '.id(', str, ')');
check$1.optional(function () {
scope(
env.shared.shader, '.shader(',
shaderType[name], ',',
id, ',',
env.command, ');');
});
return id
})
}
return null
}
var frag = parseShader(S_FRAG);
var vert = parseShader(S_VERT);
var program = null;
var progVar;
if (isStatic(frag) && isStatic(vert)) {
program = shaderState.program(vert.id, frag.id);
progVar = createStaticDecl(function (env, scope) {
return env.link(program)
});
} else {
progVar = new Declaration(
(frag && frag.thisDep) || (vert && vert.thisDep),
(frag && frag.contextDep) || (vert && vert.contextDep),
(frag && frag.propDep) || (vert && vert.propDep),
function (env, scope) {
var SHADER_STATE = env.shared.shader;
var fragId;
if (frag) {
fragId = frag.append(env, scope);
} else {
fragId = scope.def(SHADER_STATE, '.', S_FRAG);
}
var vertId;
if (vert) {
vertId = vert.append(env, scope);
} else {
vertId = scope.def(SHADER_STATE, '.', S_VERT);
}
var progDef = SHADER_STATE + '.program(' + vertId + ',' + fragId;
check$1.optional(function () {
progDef += ',' + env.command;
});
return scope.def(progDef + ')')
});
}
return {
frag: frag,
vert: vert,
progVar: progVar,
program: program
}
}
function parseDraw (options, env) {
var staticOptions = options.static;
var dynamicOptions = options.dynamic;
function parseElements () {
if (S_ELEMENTS in staticOptions) {
var elements = staticOptions[S_ELEMENTS];
if (isBufferArgs(elements)) {
elements = elementState.getElements(elementState.create(elements, true));
} else if (elements) {
elements = elementState.getElements(elements);
check$1.command(elements, 'invalid elements', env.commandStr);
}
var result = createStaticDecl(function (env, scope) {
if (elements) {
var result = env.link(elements);
env.ELEMENTS = result;
return result
}
env.ELEMENTS = null;
return null
});
result.value = elements;
return result
} else if (S_ELEMENTS in dynamicOptions) {
var dyn = dynamicOptions[S_ELEMENTS];
return createDynamicDecl(dyn, function (env, scope) {
var shared = env.shared;
var IS_BUFFER_ARGS = shared.isBufferArgs;
var ELEMENT_STATE = shared.elements;
var elementDefn = env.invoke(scope, dyn);
var elements = scope.def('null');
var elementStream = scope.def(IS_BUFFER_ARGS, '(', elementDefn, ')');
var ifte = env.cond(elementStream)
.then(elements, '=', ELEMENT_STATE, '.createStream(', elementDefn, ');')
.else(elements, '=', ELEMENT_STATE, '.getElements(', elementDefn, ');');
check$1.optional(function () {
env.assert(ifte.else,
'!' + elementDefn + '||' + elements,
'invalid elements');
});
scope.entry(ifte);
scope.exit(
env.cond(elementStream)
.then(ELEMENT_STATE, '.destroyStream(', elements, ');'));
env.ELEMENTS = elements;
return elements
})
}
return null
}
var elements = parseElements();
function parsePrimitive () {
if (S_PRIMITIVE in staticOptions) {
var primitive = staticOptions[S_PRIMITIVE];
check$1.commandParameter(primitive, primTypes, 'invalid primitve', env.commandStr);
return createStaticDecl(function (env, scope) {
return primTypes[primitive]
})
} else if (S_PRIMITIVE in dynamicOptions) {
var dynPrimitive = dynamicOptions[S_PRIMITIVE];
return createDynamicDecl(dynPrimitive, function (env, scope) {
var PRIM_TYPES = env.constants.primTypes;
var prim = env.invoke(scope, dynPrimitive);
check$1.optional(function () {
env.assert(scope,
prim + ' in ' + PRIM_TYPES,
'invalid primitive, must be one of ' + Object.keys(primTypes));
});
return scope.def(PRIM_TYPES, '[', prim, ']')
})
} else if (elements) {
if (isStatic(elements)) {
if (elements.value) {
return createStaticDecl(function (env, scope) {
return scope.def(env.ELEMENTS, '.primType')
})
} else {
return createStaticDecl(function () {
return GL_TRIANGLES$1
})
}
} else {
return new Declaration(
elements.thisDep,
elements.contextDep,
elements.propDep,
function (env, scope) {
var elements = env.ELEMENTS;
return scope.def(elements, '?', elements, '.primType:', GL_TRIANGLES$1)
})
}
}
return null
}
function parseParam (param, isOffset) {
if (param in staticOptions) {
var value = staticOptions[param] | 0;
check$1.command(!isOffset || value >= 0, 'invalid ' + param, env.commandStr);
return createStaticDecl(function (env, scope) {
if (isOffset) {
env.OFFSET = value;
}
return value
})
} else if (param in dynamicOptions) {
var dynValue = dynamicOptions[param];
return createDynamicDecl(dynValue, function (env, scope) {
var result = env.invoke(scope, dynValue);
if (isOffset) {
env.OFFSET = result;
check$1.optional(function () {
env.assert(scope,
result + '>=0',
'invalid ' + param);
});
}
return result
})
} else if (isOffset && elements) {
return createStaticDecl(function (env, scope) {
env.OFFSET = '0';
return 0
})
}
return null
}
var OFFSET = parseParam(S_OFFSET, true);
function parseVertCount () {
if (S_COUNT in staticOptions) {
var count = staticOptions[S_COUNT] | 0;
check$1.command(
typeof count === 'number' && count >= 0, 'invalid vertex count', env.commandStr);
return createStaticDecl(function () {
return count
})
} else if (S_COUNT in dynamicOptions) {
var dynCount = dynamicOptions[S_COUNT];
return createDynamicDecl(dynCount, function (env, scope) {
var result = env.invoke(scope, dynCount);
check$1.optional(function () {
env.assert(scope,
'typeof ' + result + '==="number"&&' +
result + '>=0&&' +
result + '===(' + result + '|0)',
'invalid vertex count');
});
return result
})
} else if (elements) {
if (isStatic(elements)) {
if (elements) {
if (OFFSET) {
return new Declaration(
OFFSET.thisDep,
OFFSET.contextDep,
OFFSET.propDep,
function (env, scope) {
var result = scope.def(
env.ELEMENTS, '.vertCount-', env.OFFSET);
check$1.optional(function () {
env.assert(scope,
result + '>=0',
'invalid vertex offset/element buffer too small');
});
return result
})
} else {
return createStaticDecl(function (env, scope) {
return scope.def(env.ELEMENTS, '.vertCount')
})
}
} else {
var result = createStaticDecl(function () {
return -1
});
check$1.optional(function () {
result.MISSING = true;
});
return result
}
} else {
var variable = new Declaration(
elements.thisDep || OFFSET.thisDep,
elements.contextDep || OFFSET.contextDep,
elements.propDep || OFFSET.propDep,
function (env, scope) {
var elements = env.ELEMENTS;
if (env.OFFSET) {
return scope.def(elements, '?', elements, '.vertCount-',
env.OFFSET, ':-1')
}
return scope.def(elements, '?', elements, '.vertCount:-1')
});
check$1.optional(function () {
variable.DYNAMIC = true;
});
return variable
}
}
return null
}
return {
elements: elements,
primitive: parsePrimitive(),
count: parseVertCount(),
instances: parseParam(S_INSTANCES, false),
offset: OFFSET
}
}
function parseGLState (options, env) {
var staticOptions = options.static;
var dynamicOptions = options.dynamic;
var STATE = {};
GL_STATE_NAMES.forEach(function (prop) {
var param = propName(prop);
function parseParam (parseStatic, parseDynamic) {
if (prop in staticOptions) {
var value = parseStatic(staticOptions[prop]);
STATE[param] = createStaticDecl(function () {
return value
});
} else if (prop in dynamicOptions) {
var dyn = dynamicOptions[prop];
STATE[param] = createDynamicDecl(dyn, function (env, scope) {
return parseDynamic(env, scope, env.invoke(scope, dyn))
});
}
}
switch (prop) {
case S_CULL_ENABLE:
case S_BLEND_ENABLE:
case S_DITHER:
case S_STENCIL_ENABLE:
case S_DEPTH_ENABLE:
case S_SCISSOR_ENABLE:
case S_POLYGON_OFFSET_ENABLE:
case S_SAMPLE_ALPHA:
case S_SAMPLE_ENABLE:
case S_DEPTH_MASK:
return parseParam(
function (value) {
check$1.commandType(value, 'boolean', prop, env.commandStr);
return value
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
'typeof ' + value + '==="boolean"',
'invalid flag ' + prop, env.commandStr);
});
return value
})
case S_DEPTH_FUNC:
return parseParam(
function (value) {
check$1.commandParameter(value, compareFuncs, 'invalid ' + prop, env.commandStr);
return compareFuncs[value]
},
function (env, scope, value) {
var COMPARE_FUNCS = env.constants.compareFuncs;
check$1.optional(function () {
env.assert(scope,
value + ' in ' + COMPARE_FUNCS,
'invalid ' + prop + ', must be one of ' + Object.keys(compareFuncs));
});
return scope.def(COMPARE_FUNCS, '[', value, ']')
})
case S_DEPTH_RANGE:
return parseParam(
function (value) {
check$1.command(
isArrayLike(value) &&
value.length === 2 &&
typeof value[0] === 'number' &&
typeof value[1] === 'number' &&
value[0] <= value[1],
'depth range is 2d array',
env.commandStr);
return value
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
env.shared.isArrayLike + '(' + value + ')&&' +
value + '.length===2&&' +
'typeof ' + value + '[0]==="number"&&' +
'typeof ' + value + '[1]==="number"&&' +
value + '[0]<=' + value + '[1]',
'depth range must be a 2d array');
});
var Z_NEAR = scope.def('+', value, '[0]');
var Z_FAR = scope.def('+', value, '[1]');
return [Z_NEAR, Z_FAR]
})
case S_BLEND_FUNC:
return parseParam(
function (value) {
check$1.commandType(value, 'object', 'blend.func', env.commandStr);
var srcRGB = ('srcRGB' in value ? value.srcRGB : value.src);
var srcAlpha = ('srcAlpha' in value ? value.srcAlpha : value.src);
var dstRGB = ('dstRGB' in value ? value.dstRGB : value.dst);
var dstAlpha = ('dstAlpha' in value ? value.dstAlpha : value.dst);
check$1.commandParameter(srcRGB, blendFuncs, param + '.srcRGB', env.commandStr);
check$1.commandParameter(srcAlpha, blendFuncs, param + '.srcAlpha', env.commandStr);
check$1.commandParameter(dstRGB, blendFuncs, param + '.dstRGB', env.commandStr);
check$1.commandParameter(dstAlpha, blendFuncs, param + '.dstAlpha', env.commandStr);
check$1.command(
(invalidBlendCombinations.indexOf(srcRGB + ', ' + dstRGB) === -1),
'unallowed blending combination (srcRGB, dstRGB) = (' + srcRGB + ', ' + dstRGB + ')', env.commandStr);
return [
blendFuncs[srcRGB],
blendFuncs[dstRGB],
blendFuncs[srcAlpha],
blendFuncs[dstAlpha]
]
},
function (env, scope, value) {
var BLEND_FUNCS = env.constants.blendFuncs;
check$1.optional(function () {
env.assert(scope,
value + '&&typeof ' + value + '==="object"',
'invalid blend func, must be an object');
});
function read (prefix, suffix) {
var func = scope.def(
'"', prefix, suffix, '" in ', value,
'?', value, '.', prefix, suffix,
':', value, '.', prefix);
check$1.optional(function () {
env.assert(scope,
func + ' in ' + BLEND_FUNCS,
'invalid ' + prop + '.' + prefix + suffix + ', must be one of ' + Object.keys(blendFuncs));
});
return func
}
var srcRGB = read('src', 'RGB');
var dstRGB = read('dst', 'RGB');
check$1.optional(function () {
var INVALID_BLEND_COMBINATIONS = env.constants.invalidBlendCombinations;
env.assert(scope,
INVALID_BLEND_COMBINATIONS +
'.indexOf(' + srcRGB + '+", "+' + dstRGB + ') === -1 ',
'unallowed blending combination for (srcRGB, dstRGB)'
);
});
var SRC_RGB = scope.def(BLEND_FUNCS, '[', srcRGB, ']');
var SRC_ALPHA = scope.def(BLEND_FUNCS, '[', read('src', 'Alpha'), ']');
var DST_RGB = scope.def(BLEND_FUNCS, '[', dstRGB, ']');
var DST_ALPHA = scope.def(BLEND_FUNCS, '[', read('dst', 'Alpha'), ']');
return [SRC_RGB, DST_RGB, SRC_ALPHA, DST_ALPHA]
})
case S_BLEND_EQUATION:
return parseParam(
function (value) {
if (typeof value === 'string') {
check$1.commandParameter(value, blendEquations, 'invalid ' + prop, env.commandStr);
return [
blendEquations[value],
blendEquations[value]
]
} else if (typeof value === 'object') {
check$1.commandParameter(
value.rgb, blendEquations, prop + '.rgb', env.commandStr);
check$1.commandParameter(
value.alpha, blendEquations, prop + '.alpha', env.commandStr);
return [
blendEquations[value.rgb],
blendEquations[value.alpha]
]
} else {
check$1.commandRaise('invalid blend.equation', env.commandStr);
}
},
function (env, scope, value) {
var BLEND_EQUATIONS = env.constants.blendEquations;
var RGB = scope.def();
var ALPHA = scope.def();
var ifte = env.cond('typeof ', value, '==="string"');
check$1.optional(function () {
function checkProp (block, name, value) {
env.assert(block,
value + ' in ' + BLEND_EQUATIONS,
'invalid ' + name + ', must be one of ' + Object.keys(blendEquations));
}
checkProp(ifte.then, prop, value);
env.assert(ifte.else,
value + '&&typeof ' + value + '==="object"',
'invalid ' + prop);
checkProp(ifte.else, prop + '.rgb', value + '.rgb');
checkProp(ifte.else, prop + '.alpha', value + '.alpha');
});
ifte.then(
RGB, '=', ALPHA, '=', BLEND_EQUATIONS, '[', value, '];');
ifte.else(
RGB, '=', BLEND_EQUATIONS, '[', value, '.rgb];',
ALPHA, '=', BLEND_EQUATIONS, '[', value, '.alpha];');
scope(ifte);
return [RGB, ALPHA]
})
case S_BLEND_COLOR:
return parseParam(
function (value) {
check$1.command(
isArrayLike(value) &&
value.length === 4,
'blend.color must be a 4d array', env.commandStr);
return loop(4, function (i) {
return +value[i]
})
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
env.shared.isArrayLike + '(' + value + ')&&' +
value + '.length===4',
'blend.color must be a 4d array');
});
return loop(4, function (i) {
return scope.def('+', value, '[', i, ']')
})
})
case S_STENCIL_MASK:
return parseParam(
function (value) {
check$1.commandType(value, 'number', param, env.commandStr);
return value | 0
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
'typeof ' + value + '==="number"',
'invalid stencil.mask');
});
return scope.def(value, '|0')
})
case S_STENCIL_FUNC:
return parseParam(
function (value) {
check$1.commandType(value, 'object', param, env.commandStr);
var cmp = value.cmp || 'keep';
var ref = value.ref || 0;
var mask = 'mask' in value ? value.mask : -1;
check$1.commandParameter(cmp, compareFuncs, prop + '.cmp', env.commandStr);
check$1.commandType(ref, 'number', prop + '.ref', env.commandStr);
check$1.commandType(mask, 'number', prop + '.mask', env.commandStr);
return [
compareFuncs[cmp],
ref,
mask
]
},
function (env, scope, value) {
var COMPARE_FUNCS = env.constants.compareFuncs;
check$1.optional(function () {
function assert () {
env.assert(scope,
Array.prototype.join.call(arguments, ''),
'invalid stencil.func');
}
assert(value + '&&typeof ', value, '==="object"');
assert('!("cmp" in ', value, ')||(',
value, '.cmp in ', COMPARE_FUNCS, ')');
});
var cmp = scope.def(
'"cmp" in ', value,
'?', COMPARE_FUNCS, '[', value, '.cmp]',
':', GL_KEEP);
var ref = scope.def(value, '.ref|0');
var mask = scope.def(
'"mask" in ', value,
'?', value, '.mask|0:-1');
return [cmp, ref, mask]
})
case S_STENCIL_OPFRONT:
case S_STENCIL_OPBACK:
return parseParam(
function (value) {
check$1.commandType(value, 'object', param, env.commandStr);
var fail = value.fail || 'keep';
var zfail = value.zfail || 'keep';
var zpass = value.zpass || 'keep';
check$1.commandParameter(fail, stencilOps, prop + '.fail', env.commandStr);
check$1.commandParameter(zfail, stencilOps, prop + '.zfail', env.commandStr);
check$1.commandParameter(zpass, stencilOps, prop + '.zpass', env.commandStr);
return [
prop === S_STENCIL_OPBACK ? GL_BACK : GL_FRONT,
stencilOps[fail],
stencilOps[zfail],
stencilOps[zpass]
]
},
function (env, scope, value) {
var STENCIL_OPS = env.constants.stencilOps;
check$1.optional(function () {
env.assert(scope,
value + '&&typeof ' + value + '==="object"',
'invalid ' + prop);
});
function read (name) {
check$1.optional(function () {
env.assert(scope,
'!("' + name + '" in ' + value + ')||' +
'(' + value + '.' + name + ' in ' + STENCIL_OPS + ')',
'invalid ' + prop + '.' + name + ', must be one of ' + Object.keys(stencilOps));
});
return scope.def(
'"', name, '" in ', value,
'?', STENCIL_OPS, '[', value, '.', name, ']:',
GL_KEEP)
}
return [
prop === S_STENCIL_OPBACK ? GL_BACK : GL_FRONT,
read('fail'),
read('zfail'),
read('zpass')
]
})
case S_POLYGON_OFFSET_OFFSET:
return parseParam(
function (value) {
check$1.commandType(value, 'object', param, env.commandStr);
var factor = value.factor | 0;
var units = value.units | 0;
check$1.commandType(factor, 'number', param + '.factor', env.commandStr);
check$1.commandType(units, 'number', param + '.units', env.commandStr);
return [factor, units]
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
value + '&&typeof ' + value + '==="object"',
'invalid ' + prop);
});
var FACTOR = scope.def(value, '.factor|0');
var UNITS = scope.def(value, '.units|0');
return [FACTOR, UNITS]
})
case S_CULL_FACE:
return parseParam(
function (value) {
var face = 0;
if (value === 'front') {
face = GL_FRONT;
} else if (value === 'back') {
face = GL_BACK;
}
check$1.command(!!face, param, env.commandStr);
return face
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
value + '==="front"||' +
value + '==="back"',
'invalid cull.face');
});
return scope.def(value, '==="front"?', GL_FRONT, ':', GL_BACK)
})
case S_LINE_WIDTH:
return parseParam(
function (value) {
check$1.command(
typeof value === 'number' &&
value >= limits.lineWidthDims[0] &&
value <= limits.lineWidthDims[1],
'invalid line width, must positive number between ' +
limits.lineWidthDims[0] + ' and ' + limits.lineWidthDims[1], env.commandStr);
return value
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
'typeof ' + value + '==="number"&&' +
value + '>=' + limits.lineWidthDims[0] + '&&' +
value + '<=' + limits.lineWidthDims[1],
'invalid line width');
});
return value
})
case S_FRONT_FACE:
return parseParam(
function (value) {
check$1.commandParameter(value, orientationType, param, env.commandStr);
return orientationType[value]
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
value + '==="cw"||' +
value + '==="ccw"',
'invalid frontFace, must be one of cw,ccw');
});
return scope.def(value + '==="cw"?' + GL_CW + ':' + GL_CCW)
})
case S_COLOR_MASK:
return parseParam(
function (value) {
check$1.command(
isArrayLike(value) && value.length === 4,
'color.mask must be length 4 array', env.commandStr);
return value.map(function (v) { return !!v })
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
env.shared.isArrayLike + '(' + value + ')&&' +
value + '.length===4',
'invalid color.mask');
});
return loop(4, function (i) {
return '!!' + value + '[' + i + ']'
})
})
case S_SAMPLE_COVERAGE:
return parseParam(
function (value) {
check$1.command(typeof value === 'object' && value, param, env.commandStr);
var sampleValue = 'value' in value ? value.value : 1;
var sampleInvert = !!value.invert;
check$1.command(
typeof sampleValue === 'number' &&
sampleValue >= 0 && sampleValue <= 1,
'sample.coverage.value must be a number between 0 and 1', env.commandStr);
return [sampleValue, sampleInvert]
},
function (env, scope, value) {
check$1.optional(function () {
env.assert(scope,
value + '&&typeof ' + value + '==="object"',
'invalid sample.coverage');
});
var VALUE = scope.def(
'"value" in ', value, '?+', value, '.value:1');
var INVERT = scope.def('!!', value, '.invert');
return [VALUE, INVERT]
})
}
});
return STATE
}
function parseUniforms (uniforms, env) {
var staticUniforms = uniforms.static;
var dynamicUniforms = uniforms.dynamic;
var UNIFORMS = {};
Object.keys(staticUniforms).forEach(function (name) {
var value = staticUniforms[name];
var result;
if (typeof value === 'number' ||
typeof value === 'boolean') {
result = createStaticDecl(function () {
return value
});
} else if (typeof value === 'function') {
var reglType = value._reglType;
if (reglType === 'texture2d' ||
reglType === 'textureCube') {
result = createStaticDecl(function (env) {
return env.link(value)
});
} else if (reglType === 'framebuffer' ||
reglType === 'framebufferCube') {
check$1.command(value.color.length > 0,
'missing color attachment for framebuffer sent to uniform "' + name + '"', env.commandStr);
result = createStaticDecl(function (env) {
return env.link(value.color[0])
});
} else {
check$1.commandRaise('invalid data for uniform "' + name + '"', env.commandStr);
}
} else if (isArrayLike(value)) {
result = createStaticDecl(function (env) {
var ITEM = env.global.def('[',
loop(value.length, function (i) {
check$1.command(
typeof value[i] === 'number' ||
typeof value[i] === 'boolean',
'invalid uniform ' + name, env.commandStr);
return value[i]
}), ']');
return ITEM
});
} else {
check$1.commandRaise('invalid or missing data for uniform "' + name + '"', env.commandStr);
}
result.value = value;
UNIFORMS[name] = result;
});
Object.keys(dynamicUniforms).forEach(function (key) {
var dyn = dynamicUniforms[key];
UNIFORMS[key] = createDynamicDecl(dyn, function (env, scope) {
return env.invoke(scope, dyn)
});
});
return UNIFORMS
}
function parseAttributes (attributes, env) {
var staticAttributes = attributes.static;
var dynamicAttributes = attributes.dynamic;
var attributeDefs = {};
Object.keys(staticAttributes).forEach(function (attribute) {
var value = staticAttributes[attribute];
var id = stringStore.id(attribute);
var record = new AttributeRecord();
if (isBufferArgs(value)) {
record.state = ATTRIB_STATE_POINTER;
record.buffer = bufferState.getBuffer(
bufferState.create(value, GL_ARRAY_BUFFER$1, false, true));
record.type = 0;
} else {
var buffer = bufferState.getBuffer(value);
if (buffer) {
record.state = ATTRIB_STATE_POINTER;
record.buffer = buffer;
record.type = 0;
} else {
check$1.command(typeof value === 'object' && value,
'invalid data for attribute ' + attribute, env.commandStr);
if (value.constant) {
var constant = value.constant;
record.buffer = 'null';
record.state = ATTRIB_STATE_CONSTANT;
if (typeof constant === 'number') {
record.x = constant;
} else {
check$1.command(
isArrayLike(constant) &&
constant.length > 0 &&
constant.length <= 4,
'invalid constant for attribute ' + attribute, env.commandStr);
CUTE_COMPONENTS.forEach(function (c, i) {
if (i < constant.length) {
record[c] = constant[i];
}
});
}
} else {
if (isBufferArgs(value.buffer)) {
buffer = bufferState.getBuffer(
bufferState.create(value.buffer, GL_ARRAY_BUFFER$1, false, true));
} else {
buffer = bufferState.getBuffer(value.buffer);
}
check$1.command(!!buffer, 'missing buffer for attribute "' + attribute + '"', env.commandStr);
var offset = value.offset | 0;
check$1.command(offset >= 0,
'invalid offset for attribute "' + attribute + '"', env.commandStr);
var stride = value.stride | 0;
check$1.command(stride >= 0 && stride < 256,
'invalid stride for attribute "' + attribute + '", must be integer betweeen [0, 255]', env.commandStr);
var size = value.size | 0;
check$1.command(!('size' in value) || (size > 0 && size <= 4),
'invalid size for attribute "' + attribute + '", must be 1,2,3,4', env.commandStr);
var normalized = !!value.normalized;
var type = 0;
if ('type' in value) {
check$1.commandParameter(
value.type, glTypes,
'invalid type for attribute ' + attribute, env.commandStr);
type = glTypes[value.type];
}
var divisor = value.divisor | 0;
if ('divisor' in value) {
check$1.command(divisor === 0 || extInstancing,
'cannot specify divisor for attribute "' + attribute + '", instancing not supported', env.commandStr);
check$1.command(divisor >= 0,
'invalid divisor for attribute "' + attribute + '"', env.commandStr);
}
check$1.optional(function () {
var command = env.commandStr;
var VALID_KEYS = [
'buffer',
'offset',
'divisor',
'normalized',
'type',
'size',
'stride'
];
Object.keys(value).forEach(function (prop) {
check$1.command(
VALID_KEYS.indexOf(prop) >= 0,
'unknown parameter "' + prop + '" for attribute pointer "' + attribute + '" (valid parameters are ' + VALID_KEYS + ')',
command);
});
});
record.buffer = buffer;
record.state = ATTRIB_STATE_POINTER;
record.size = size;
record.normalized = normalized;
record.type = type || buffer.dtype;
record.offset = offset;
record.stride = stride;
record.divisor = divisor;
}
}
}
attributeDefs[attribute] = createStaticDecl(function (env, scope) {
var cache = env.attribCache;
if (id in cache) {
return cache[id]
}
var result = {
isStream: false
};
Object.keys(record).forEach(function (key) {
result[key] = record[key];
});
if (record.buffer) {
result.buffer = env.link(record.buffer);
result.type = result.type || (result.buffer + '.dtype');
}
cache[id] = result;
return result
});
});
Object.keys(dynamicAttributes).forEach(function (attribute) {
var dyn = dynamicAttributes[attribute];
function appendAttributeCode (env, block) {
var VALUE = env.invoke(block, dyn);
var shared = env.shared;
var IS_BUFFER_ARGS = shared.isBufferArgs;
var BUFFER_STATE = shared.buffer;
// Perform validation on attribute
check$1.optional(function () {
env.assert(block,
VALUE + '&&(typeof ' + VALUE + '==="object"||typeof ' +
VALUE + '==="function")&&(' +
IS_BUFFER_ARGS + '(' + VALUE + ')||' +
BUFFER_STATE + '.getBuffer(' + VALUE + ')||' +
BUFFER_STATE + '.getBuffer(' + VALUE + '.buffer)||' +
IS_BUFFER_ARGS + '(' + VALUE + '.buffer)||' +
'("constant" in ' + VALUE +
'&&(typeof ' + VALUE + '.constant==="number"||' +
shared.isArrayLike + '(' + VALUE + '.constant))))',
'invalid dynamic attribute "' + attribute + '"');
});
// allocate names for result
var result = {
isStream: block.def(false)
};
var defaultRecord = new AttributeRecord();
defaultRecord.state = ATTRIB_STATE_POINTER;
Object.keys(defaultRecord).forEach(function (key) {
result[key] = block.def('' + defaultRecord[key]);
});
var BUFFER = result.buffer;
var TYPE = result.type;
block(
'if(', IS_BUFFER_ARGS, '(', VALUE, ')){',
result.isStream, '=true;',
BUFFER, '=', BUFFER_STATE, '.createStream(', GL_ARRAY_BUFFER$1, ',', VALUE, ');',
TYPE, '=', BUFFER, '.dtype;',
'}else{',
BUFFER, '=', BUFFER_STATE, '.getBuffer(', VALUE, ');',
'if(', BUFFER, '){',
TYPE, '=', BUFFER, '.dtype;',
'}else if("constant" in ', VALUE, '){',
result.state, '=', ATTRIB_STATE_CONSTANT, ';',
'if(typeof ' + VALUE + '.constant === "number"){',
result[CUTE_COMPONENTS[0]], '=', VALUE, '.constant;',
CUTE_COMPONENTS.slice(1).map(function (n) {
return result[n]
}).join('='), '=0;',
'}else{',
CUTE_COMPONENTS.map(function (name, i) {
return (
result[name] + '=' + VALUE + '.constant.length>=' + i +
'?' + VALUE + '.constant[' + i + ']:0;'
)
}).join(''),
'}}else{',
'if(', IS_BUFFER_ARGS, '(', VALUE, '.buffer)){',
BUFFER, '=', BUFFER_STATE, '.createStream(', GL_ARRAY_BUFFER$1, ',', VALUE, '.buffer);',
'}else{',
BUFFER, '=', BUFFER_STATE, '.getBuffer(', VALUE, '.buffer);',
'}',
TYPE, '="type" in ', VALUE, '?',
shared.glTypes, '[', VALUE, '.type]:', BUFFER, '.dtype;',
result.normalized, '=!!', VALUE, '.normalized;');
function emitReadRecord (name) {
block(result[name], '=', VALUE, '.', name, '|0;');
}
emitReadRecord('size');
emitReadRecord('offset');
emitReadRecord('stride');
emitReadRecord('divisor');
block('}}');
block.exit(
'if(', result.isStream, '){',
BUFFER_STATE, '.destroyStream(', BUFFER, ');',
'}');
return result
}
attributeDefs[attribute] = createDynamicDecl(dyn, appendAttributeCode);
});
return attributeDefs
}
function parseContext (context) {
var staticContext = context.static;
var dynamicContext = context.dynamic;
var result = {};
Object.keys(staticContext).forEach(function (name) {
var value = staticContext[name];
result[name] = createStaticDecl(function (env, scope) {
if (typeof value === 'number' || typeof value === 'boolean') {
return '' + value
} else {
return env.link(value)
}
});
});
Object.keys(dynamicContext).forEach(function (name) {
var dyn = dynamicContext[name];
result[name] = createDynamicDecl(dyn, function (env, scope) {
return env.invoke(scope, dyn)
});
});
return result
}
function parseArguments (options, attributes, uniforms, context, env) {
var staticOptions = options.static;
var dynamicOptions = options.dynamic;
check$1.optional(function () {
var KEY_NAMES = [
S_FRAMEBUFFER,
S_VERT,
S_FRAG,
S_ELEMENTS,
S_PRIMITIVE,
S_OFFSET,
S_COUNT,
S_INSTANCES,
S_PROFILE
].concat(GL_STATE_NAMES);
function checkKeys (dict) {
Object.keys(dict).forEach(function (key) {
check$1.command(
KEY_NAMES.indexOf(key) >= 0,
'unknown parameter "' + key + '"',
env.commandStr);
});
}
checkKeys(staticOptions);
checkKeys(dynamicOptions);
});
var framebuffer = parseFramebuffer(options, env);
var viewportAndScissor = parseViewportScissor(options, framebuffer, env);
var draw = parseDraw(options, env);
var state = parseGLState(options, env);
var shader = parseProgram(options, env);
function copyBox (name) {
var defn = viewportAndScissor[name];
if (defn) {
state[name] = defn;
}
}
copyBox(S_VIEWPORT);
copyBox(propName(S_SCISSOR_BOX));
var dirty = Object.keys(state).length > 0;
var result = {
framebuffer: framebuffer,
draw: draw,
shader: shader,
state: state,
dirty: dirty
};
result.profile = parseProfile(options, env);
result.uniforms = parseUniforms(uniforms, env);
result.attributes = parseAttributes(attributes, env);
result.context = parseContext(context, env);
return result
}
// ===================================================
// ===================================================
// COMMON UPDATE FUNCTIONS
// ===================================================
// ===================================================
function emitContext (env, scope, context) {
var shared = env.shared;
var CONTEXT = shared.context;
var contextEnter = env.scope();
Object.keys(context).forEach(function (name) {
scope.save(CONTEXT, '.' + name);
var defn = context[name];
contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');
});
scope(contextEnter);
}
// ===================================================
// ===================================================
// COMMON DRAWING FUNCTIONS
// ===================================================
// ===================================================
function emitPollFramebuffer (env, scope, framebuffer, skipCheck) {
var shared = env.shared;
var GL = shared.gl;
var FRAMEBUFFER_STATE = shared.framebuffer;
var EXT_DRAW_BUFFERS;
if (extDrawBuffers) {
EXT_DRAW_BUFFERS = scope.def(shared.extensions, '.webgl_draw_buffers');
}
var constants = env.constants;
var DRAW_BUFFERS = constants.drawBuffer;
var BACK_BUFFER = constants.backBuffer;
var NEXT;
if (framebuffer) {
NEXT = framebuffer.append(env, scope);
} else {
NEXT = scope.def(FRAMEBUFFER_STATE, '.next');
}
if (!skipCheck) {
scope('if(', NEXT, '!==', FRAMEBUFFER_STATE, '.cur){');
}
scope(
'if(', NEXT, '){',
GL, '.bindFramebuffer(', GL_FRAMEBUFFER$1, ',', NEXT, '.framebuffer);');
if (extDrawBuffers) {
scope(EXT_DRAW_BUFFERS, '.drawBuffersWEBGL(',
DRAW_BUFFERS, '[', NEXT, '.colorAttachments.length]);');
}
scope('}else{',
GL, '.bindFramebuffer(', GL_FRAMEBUFFER$1, ',null);');
if (extDrawBuffers) {
scope(EXT_DRAW_BUFFERS, '.drawBuffersWEBGL(', BACK_BUFFER, ');');
}
scope(
'}',
FRAMEBUFFER_STATE, '.cur=', NEXT, ';');
if (!skipCheck) {
scope('}');
}
}
function emitPollState (env, scope, args) {
var shared = env.shared;
var GL = shared.gl;
var CURRENT_VARS = env.current;
var NEXT_VARS = env.next;
var CURRENT_STATE = shared.current;
var NEXT_STATE = shared.next;
var block = env.cond(CURRENT_STATE, '.dirty');
GL_STATE_NAMES.forEach(function (prop) {
var param = propName(prop);
if (param in args.state) {
return
}
var NEXT, CURRENT;
if (param in NEXT_VARS) {
NEXT = NEXT_VARS[param];
CURRENT = CURRENT_VARS[param];
var parts = loop(currentState[param].length, function (i) {
return block.def(NEXT, '[', i, ']')
});
block(env.cond(parts.map(function (p, i) {
return p + '!==' + CURRENT + '[' + i + ']'
}).join('||'))
.then(
GL, '.', GL_VARIABLES[param], '(', parts, ');',
parts.map(function (p, i) {
return CURRENT + '[' + i + ']=' + p
}).join(';'), ';'));
} else {
NEXT = block.def(NEXT_STATE, '.', param);
var ifte = env.cond(NEXT, '!==', CURRENT_STATE, '.', param);
block(ifte);
if (param in GL_FLAGS) {
ifte(
env.cond(NEXT)
.then(GL, '.enable(', GL_FLAGS[param], ');')
.else(GL, '.disable(', GL_FLAGS[param], ');'),
CURRENT_STATE, '.', param, '=', NEXT, ';');
} else {
ifte(
GL, '.', GL_VARIABLES[param], '(', NEXT, ');',
CURRENT_STATE, '.', param, '=', NEXT, ';');
}
}
});
if (Object.keys(args.state).length === 0) {
block(CURRENT_STATE, '.dirty=false;');
}
scope(block);
}
function emitSetOptions (env, scope, options, filter) {
var shared = env.shared;
var CURRENT_VARS = env.current;
var CURRENT_STATE = shared.current;
var GL = shared.gl;
sortState(Object.keys(options)).forEach(function (param) {
var defn = options[param];
if (filter && !filter(defn)) {
return
}
var variable = defn.append(env, scope);
if (GL_FLAGS[param]) {
var flag = GL_FLAGS[param];
if (isStatic(defn)) {
if (variable) {
scope(GL, '.enable(', flag, ');');
} else {
scope(GL, '.disable(', flag, ');');
}
} else {
scope(env.cond(variable)
.then(GL, '.enable(', flag, ');')
.else(GL, '.disable(', flag, ');'));
}
scope(CURRENT_STATE, '.', param, '=', variable, ';');
} else if (isArrayLike(variable)) {
var CURRENT = CURRENT_VARS[param];
scope(
GL, '.', GL_VARIABLES[param], '(', variable, ');',
variable.map(function (v, i) {
return CURRENT + '[' + i + ']=' + v
}).join(';'), ';');
} else {
scope(
GL, '.', GL_VARIABLES[param], '(', variable, ');',
CURRENT_STATE, '.', param, '=', variable, ';');
}
});
}
function injectExtensions (env, scope) {
if (extInstancing) {
env.instancing = scope.def(
env.shared.extensions, '.angle_instanced_arrays');
}
}
function emitProfile (env, scope, args, useScope, incrementCounter) {
var shared = env.shared;
var STATS = env.stats;
var CURRENT_STATE = shared.current;
var TIMER = shared.timer;
var profileArg = args.profile;
function perfCounter () {
if (typeof performance === 'undefined') {
return 'Date.now()'
} else {
return 'performance.now()'
}
}
var CPU_START, QUERY_COUNTER;
function emitProfileStart (block) {
CPU_START = scope.def();
block(CPU_START, '=', perfCounter(), ';');
if (typeof incrementCounter === 'string') {
block(STATS, '.count+=', incrementCounter, ';');
} else {
block(STATS, '.count++;');
}
if (timer) {
if (useScope) {
QUERY_COUNTER = scope.def();
block(QUERY_COUNTER, '=', TIMER, '.getNumPendingQueries();');
} else {
block(TIMER, '.beginQuery(', STATS, ');');
}
}
}
function emitProfileEnd (block) {
block(STATS, '.cpuTime+=', perfCounter(), '-', CPU_START, ';');
if (timer) {
if (useScope) {
block(TIMER, '.pushScopeStats(',
QUERY_COUNTER, ',',
TIMER, '.getNumPendingQueries(),',
STATS, ');');
} else {
block(TIMER, '.endQuery();');
}
}
}
function scopeProfile (value) {
var prev = scope.def(CURRENT_STATE, '.profile');
scope(CURRENT_STATE, '.profile=', value, ';');
scope.exit(CURRENT_STATE, '.profile=', prev, ';');
}
var USE_PROFILE;
if (profileArg) {
if (isStatic(profileArg)) {
if (profileArg.enable) {
emitProfileStart(scope);
emitProfileEnd(scope.exit);
scopeProfile('true');
} else {
scopeProfile('false');
}
return
}
USE_PROFILE = profileArg.append(env, scope);
scopeProfile(USE_PROFILE);
} else {
USE_PROFILE = scope.def(CURRENT_STATE, '.profile');
}
var start = env.block();
emitProfileStart(start);
scope('if(', USE_PROFILE, '){', start, '}');
var end = env.block();
emitProfileEnd(end);
scope.exit('if(', USE_PROFILE, '){', end, '}');
}
function emitAttributes (env, scope, args, attributes, filter) {
var shared = env.shared;
function typeLength (x) {
switch (x) {
case GL_FLOAT_VEC2:
case GL_INT_VEC2:
case GL_BOOL_VEC2:
return 2
case GL_FLOAT_VEC3:
case GL_INT_VEC3:
case GL_BOOL_VEC3:
return 3
case GL_FLOAT_VEC4:
case GL_INT_VEC4:
case GL_BOOL_VEC4:
return 4
default:
return 1
}
}
function emitBindAttribute (ATTRIBUTE, size, record) {
var GL = shared.gl;
var LOCATION = scope.def(ATTRIBUTE, '.location');
var BINDING = scope.def(shared.attributes, '[', LOCATION, ']');
var STATE = record.state;
var BUFFER = record.buffer;
var CONST_COMPONENTS = [
record.x,
record.y,
record.z,
record.w
];
var COMMON_KEYS = [
'buffer',
'normalized',
'offset',
'stride'
];
function emitBuffer () {
scope(
'if(!', BINDING, '.buffer){',
GL, '.enableVertexAttribArray(', LOCATION, ');}');
var TYPE = record.type;
var SIZE;
if (!record.size) {
SIZE = size;
} else {
SIZE = scope.def(record.size, '||', size);
}
scope('if(',
BINDING, '.type!==', TYPE, '||',
BINDING, '.size!==', SIZE, '||',
COMMON_KEYS.map(function (key) {
return BINDING + '.' + key + '!==' + record[key]
}).join('||'),
'){',
GL, '.bindBuffer(', GL_ARRAY_BUFFER$1, ',', BUFFER, '.buffer);',
GL, '.vertexAttribPointer(', [
LOCATION,
SIZE,
TYPE,
record.normalized,
record.stride,
record.offset
], ');',
BINDING, '.type=', TYPE, ';',
BINDING, '.size=', SIZE, ';',
COMMON_KEYS.map(function (key) {
return BINDING + '.' + key + '=' + record[key] + ';'
}).join(''),
'}');
if (extInstancing) {
var DIVISOR = record.divisor;
scope(
'if(', BINDING, '.divisor!==', DIVISOR, '){',
env.instancing, '.vertexAttribDivisorANGLE(', [LOCATION, DIVISOR], ');',
BINDING, '.divisor=', DIVISOR, ';}');
}
}
function emitConstant () {
scope(
'if(', BINDING, '.buffer){',
GL, '.disableVertexAttribArray(', LOCATION, ');',
'}if(', CUTE_COMPONENTS.map(function (c, i) {
return BINDING + '.' + c + '!==' + CONST_COMPONENTS[i]
}).join('||'), '){',
GL, '.vertexAttrib4f(', LOCATION, ',', CONST_COMPONENTS, ');',
CUTE_COMPONENTS.map(function (c, i) {
return BINDING + '.' + c + '=' + CONST_COMPONENTS[i] + ';'
}).join(''),
'}');
}
if (STATE === ATTRIB_STATE_POINTER) {
emitBuffer();
} else if (STATE === ATTRIB_STATE_CONSTANT) {
emitConstant();
} else {
scope('if(', STATE, '===', ATTRIB_STATE_POINTER, '){');
emitBuffer();
scope('}else{');
emitConstant();
scope('}');
}
}
attributes.forEach(function (attribute) {
var name = attribute.name;
var arg = args.attributes[name];
var record;
if (arg) {
if (!filter(arg)) {
return
}
record = arg.append(env, scope);
} else {
if (!filter(SCOPE_DECL)) {
return
}
var scopeAttrib = env.scopeAttrib(name);
check$1.optional(function () {
env.assert(scope,
scopeAttrib + '.state',
'missing attribute ' + name);
});
record = {};
Object.keys(new AttributeRecord()).forEach(function (key) {
record[key] = scope.def(scopeAttrib, '.', key);
});
}
emitBindAttribute(
env.link(attribute), typeLength(attribute.info.type), record);
});
}
function emitUniforms (env, scope, args, uniforms, filter) {
var shared = env.shared;
var GL = shared.gl;
var infix;
for (var i = 0; i < uniforms.length; ++i) {
var uniform = uniforms[i];
var name = uniform.name;
var type = uniform.info.type;
var arg = args.uniforms[name];
var UNIFORM = env.link(uniform);
var LOCATION = UNIFORM + '.location';
var VALUE;
if (arg) {
if (!filter(arg)) {
continue
}
if (isStatic(arg)) {
var value = arg.value;
check$1.command(
value !== null && typeof value !== 'undefined',
'missing uniform "' + name + '"', env.commandStr);
if (type === GL_SAMPLER_2D || type === GL_SAMPLER_CUBE) {
check$1.command(
typeof value === 'function' &&
((type === GL_SAMPLER_2D &&
(value._reglType === 'texture2d' ||
value._reglType === 'framebuffer')) ||
(type === GL_SAMPLER_CUBE &&
(value._reglType === 'textureCube' ||
value._reglType === 'framebufferCube'))),
'invalid texture for uniform ' + name, env.commandStr);
var TEX_VALUE = env.link(value._texture || value.color[0]._texture);
scope(GL, '.uniform1i(', LOCATION, ',', TEX_VALUE + '.bind());');
scope.exit(TEX_VALUE, '.unbind();');
} else if (
type === GL_FLOAT_MAT2 ||
type === GL_FLOAT_MAT3 ||
type === GL_FLOAT_MAT4) {
check$1.optional(function () {
check$1.command(isArrayLike(value),
'invalid matrix for uniform ' + name, env.commandStr);
check$1.command(
(type === GL_FLOAT_MAT2 && value.length === 4) ||
(type === GL_FLOAT_MAT3 && value.length === 9) ||
(type === GL_FLOAT_MAT4 && value.length === 16),
'invalid length for matrix uniform ' + name, env.commandStr);
});
var MAT_VALUE = env.global.def('new Float32Array([' +
Array.prototype.slice.call(value) + '])');
var dim = 2;
if (type === GL_FLOAT_MAT3) {
dim = 3;
} else if (type === GL_FLOAT_MAT4) {
dim = 4;
}
scope(
GL, '.uniformMatrix', dim, 'fv(',
LOCATION, ',false,', MAT_VALUE, ');');
} else {
switch (type) {
case GL_FLOAT$7:
check$1.commandType(value, 'number', 'uniform ' + name, env.commandStr);
infix = '1f';
break
case GL_FLOAT_VEC2:
check$1.command(
isArrayLike(value) && value.length === 2,
'uniform ' + name, env.commandStr);
infix = '2f';
break
case GL_FLOAT_VEC3:
check$1.command(
isArrayLike(value) && value.length === 3,
'uniform ' + name, env.commandStr);
infix = '3f';
break
case GL_FLOAT_VEC4:
check$1.command(
isArrayLike(value) && value.length === 4,
'uniform ' + name, env.commandStr);
infix = '4f';
break
case GL_BOOL:
check$1.commandType(value, 'boolean', 'uniform ' + name, env.commandStr);
infix = '1i';
break
case GL_INT$3:
check$1.commandType(value, 'number', 'uniform ' + name, env.commandStr);
infix = '1i';
break
case GL_BOOL_VEC2:
check$1.command(
isArrayLike(value) && value.length === 2,
'uniform ' + name, env.commandStr);
infix = '2i';
break
case GL_INT_VEC2:
check$1.command(
isArrayLike(value) && value.length === 2,
'uniform ' + name, env.commandStr);
infix = '2i';
break
case GL_BOOL_VEC3:
check$1.command(
isArrayLike(value) && value.length === 3,
'uniform ' + name, env.commandStr);
infix = '3i';
break
case GL_INT_VEC3:
check$1.command(
isArrayLike(value) && value.length === 3,
'uniform ' + name, env.commandStr);
infix = '3i';
break
case GL_BOOL_VEC4:
check$1.command(
isArrayLike(value) && value.length === 4,
'uniform ' + name, env.commandStr);
infix = '4i';
break
case GL_INT_VEC4:
check$1.command(
isArrayLike(value) && value.length === 4,
'uniform ' + name, env.commandStr);
infix = '4i';
break
}
scope(GL, '.uniform', infix, '(', LOCATION, ',',
isArrayLike(value) ? Array.prototype.slice.call(value) : value,
');');
}
continue
} else {
VALUE = arg.append(env, scope);
}
} else {
if (!filter(SCOPE_DECL)) {
continue
}
VALUE = scope.def(shared.uniforms, '[', stringStore.id(name), ']');
}
if (type === GL_SAMPLER_2D) {
scope(
'if(', VALUE, '&&', VALUE, '._reglType==="framebuffer"){',
VALUE, '=', VALUE, '.color[0];',
'}');
} else if (type === GL_SAMPLER_CUBE) {
scope(
'if(', VALUE, '&&', VALUE, '._reglType==="framebufferCube"){',
VALUE, '=', VALUE, '.color[0];',
'}');
}
// perform type validation
check$1.optional(function () {
function check (pred, message) {
env.assert(scope, pred,
'bad data or missing for uniform "' + name + '". ' + message);
}
function checkType (type) {
check(
'typeof ' + VALUE + '==="' + type + '"',
'invalid type, expected ' + type);
}
function checkVector (n, type) {
check(
shared.isArrayLike + '(' + VALUE + ')&&' + VALUE + '.length===' + n,
'invalid vector, should have length ' + n, env.commandStr);
}
function checkTexture (target) {
check(
'typeof ' + VALUE + '==="function"&&' +
VALUE + '._reglType==="texture' +
(target === GL_TEXTURE_2D$2 ? '2d' : 'Cube') + '"',
'invalid texture type', env.commandStr);
}
switch (type) {
case GL_INT$3:
checkType('number');
break
case GL_INT_VEC2:
checkVector(2, 'number');
break
case GL_INT_VEC3:
checkVector(3, 'number');
break
case GL_INT_VEC4:
checkVector(4, 'number');
break
case GL_FLOAT$7:
checkType('number');
break
case GL_FLOAT_VEC2:
checkVector(2, 'number');
break
case GL_FLOAT_VEC3:
checkVector(3, 'number');
break
case GL_FLOAT_VEC4:
checkVector(4, 'number');
break
case GL_BOOL:
checkType('boolean');
break
case GL_BOOL_VEC2:
checkVector(2, 'boolean');
break
case GL_BOOL_VEC3:
checkVector(3, 'boolean');
break
case GL_BOOL_VEC4:
checkVector(4, 'boolean');
break
case GL_FLOAT_MAT2:
checkVector(4, 'number');
break
case GL_FLOAT_MAT3:
checkVector(9, 'number');
break
case GL_FLOAT_MAT4:
checkVector(16, 'number');
break
case GL_SAMPLER_2D:
checkTexture(GL_TEXTURE_2D$2);
break
case GL_SAMPLER_CUBE:
checkTexture(GL_TEXTURE_CUBE_MAP$1);
break
}
});
var unroll = 1;
switch (type) {
case GL_SAMPLER_2D:
case GL_SAMPLER_CUBE:
var TEX = scope.def(VALUE, '._texture');
scope(GL, '.uniform1i(', LOCATION, ',', TEX, '.bind());');
scope.exit(TEX, '.unbind();');
continue
case GL_INT$3:
case GL_BOOL:
infix = '1i';
break
case GL_INT_VEC2:
case GL_BOOL_VEC2:
infix = '2i';
unroll = 2;
break
case GL_INT_VEC3:
case GL_BOOL_VEC3:
infix = '3i';
unroll = 3;
break
case GL_INT_VEC4:
case GL_BOOL_VEC4:
infix = '4i';
unroll = 4;
break
case GL_FLOAT$7:
infix = '1f';
break
case GL_FLOAT_VEC2:
infix = '2f';
unroll = 2;
break
case GL_FLOAT_VEC3:
infix = '3f';
unroll = 3;
break
case GL_FLOAT_VEC4:
infix = '4f';
unroll = 4;
break
case GL_FLOAT_MAT2:
infix = 'Matrix2fv';
break
case GL_FLOAT_MAT3:
infix = 'Matrix3fv';
break
case GL_FLOAT_MAT4:
infix = 'Matrix4fv';
break
}
scope(GL, '.uniform', infix, '(', LOCATION, ',');
if (infix.charAt(0) === 'M') {
var matSize = Math.pow(type - GL_FLOAT_MAT2 + 2, 2);
var STORAGE = env.global.def('new Float32Array(', matSize, ')');
scope(
'false,(Array.isArray(', VALUE, ')||', VALUE, ' instanceof Float32Array)?', VALUE, ':(',
loop(matSize, function (i) {
return STORAGE + '[' + i + ']=' + VALUE + '[' + i + ']'
}), ',', STORAGE, ')');
} else if (unroll > 1) {
scope(loop(unroll, function (i) {
return VALUE + '[' + i + ']'
}));
} else {
scope(VALUE);
}
scope(');');
}
}
function emitDraw (env, outer, inner, args) {
var shared = env.shared;
var GL = shared.gl;
var DRAW_STATE = shared.draw;
var drawOptions = args.draw;
function emitElements () {
var defn = drawOptions.elements;
var ELEMENTS;
var scope = outer;
if (defn) {
if ((defn.contextDep && args.contextDynamic) || defn.propDep) {
scope = inner;
}
ELEMENTS = defn.append(env, scope);
} else {
ELEMENTS = scope.def(DRAW_STATE, '.', S_ELEMENTS);
}
if (ELEMENTS) {
scope(
'if(' + ELEMENTS + ')' +
GL + '.bindBuffer(' + GL_ELEMENT_ARRAY_BUFFER$1 + ',' + ELEMENTS + '.buffer.buffer);');
}
return ELEMENTS
}
function emitCount () {
var defn = drawOptions.count;
var COUNT;
var scope = outer;
if (defn) {
if ((defn.contextDep && args.contextDynamic) || defn.propDep) {
scope = inner;
}
COUNT = defn.append(env, scope);
check$1.optional(function () {
if (defn.MISSING) {
env.assert(outer, 'false', 'missing vertex count');
}
if (defn.DYNAMIC) {
env.assert(scope, COUNT + '>=0', 'missing vertex count');
}
});
} else {
COUNT = scope.def(DRAW_STATE, '.', S_COUNT);
check$1.optional(function () {
env.assert(scope, COUNT + '>=0', 'missing vertex count');
});
}
return COUNT
}
var ELEMENTS = emitElements();
function emitValue (name) {
var defn = drawOptions[name];
if (defn) {
if ((defn.contextDep && args.contextDynamic) || defn.propDep) {
return defn.append(env, inner)
} else {
return defn.append(env, outer)
}
} else {
return outer.def(DRAW_STATE, '.', name)
}
}
var PRIMITIVE = emitValue(S_PRIMITIVE);
var OFFSET = emitValue(S_OFFSET);
var COUNT = emitCount();
if (typeof COUNT === 'number') {
if (COUNT === 0) {
return
}
} else {
inner('if(', COUNT, '){');
inner.exit('}');
}
var INSTANCES, EXT_INSTANCING;
if (extInstancing) {
INSTANCES = emitValue(S_INSTANCES);
EXT_INSTANCING = env.instancing;
}
var ELEMENT_TYPE = ELEMENTS + '.type';
var elementsStatic = drawOptions.elements && isStatic(drawOptions.elements);
function emitInstancing () {
function drawElements () {
inner(EXT_INSTANCING, '.drawElementsInstancedANGLE(', [
PRIMITIVE,
COUNT,
ELEMENT_TYPE,
OFFSET + '<<((' + ELEMENT_TYPE + '-' + GL_UNSIGNED_BYTE$7 + ')>>1)',
INSTANCES
], ');');
}
function drawArrays () {
inner(EXT_INSTANCING, '.drawArraysInstancedANGLE(',
[PRIMITIVE, OFFSET, COUNT, INSTANCES], ');');
}
if (ELEMENTS) {
if (!elementsStatic) {
inner('if(', ELEMENTS, '){');
drawElements();
inner('}else{');
drawArrays();
inner('}');
} else {
drawElements();
}
} else {
drawArrays();
}
}
function emitRegular () {
function drawElements () {
inner(GL + '.drawElements(' + [
PRIMITIVE,
COUNT,
ELEMENT_TYPE,
OFFSET + '<<((' + ELEMENT_TYPE + '-' + GL_UNSIGNED_BYTE$7 + ')>>1)'
] + ');');
}
function drawArrays () {
inner(GL + '.drawArrays(' + [PRIMITIVE, OFFSET, COUNT] + ');');
}
if (ELEMENTS) {
if (!elementsStatic) {
inner('if(', ELEMENTS, '){');
drawElements();
inner('}else{');
drawArrays();
inner('}');
} else {
drawElements();
}
} else {
drawArrays();
}
}
if (extInstancing && (typeof INSTANCES !== 'number' || INSTANCES >= 0)) {
if (typeof INSTANCES === 'string') {
inner('if(', INSTANCES, '>0){');
emitInstancing();
inner('}else if(', INSTANCES, '<0){');
emitRegular();
inner('}');
} else {
emitInstancing();
}
} else {
emitRegular();
}
}
function createBody (emitBody, parentEnv, args, program, count) {
var env = createREGLEnvironment();
var scope = env.proc('body', count);
check$1.optional(function () {
env.commandStr = parentEnv.commandStr;
env.command = env.link(parentEnv.commandStr);
});
if (extInstancing) {
env.instancing = scope.def(
env.shared.extensions, '.angle_instanced_arrays');
}
emitBody(env, scope, args, program);
return env.compile().body
}
// ===================================================
// ===================================================
// DRAW PROC
// ===================================================
// ===================================================
function emitDrawBody (env, draw, args, program) {
injectExtensions(env, draw);
emitAttributes(env, draw, args, program.attributes, function () {
return true
});
emitUniforms(env, draw, args, program.uniforms, function () {
return true
});
emitDraw(env, draw, draw, args);
}
function emitDrawProc (env, args) {
var draw = env.proc('draw', 1);
injectExtensions(env, draw);
emitContext(env, draw, args.context);
emitPollFramebuffer(env, draw, args.framebuffer);
emitPollState(env, draw, args);
emitSetOptions(env, draw, args.state);
emitProfile(env, draw, args, false, true);
var program = args.shader.progVar.append(env, draw);
draw(env.shared.gl, '.useProgram(', program, '.program);');
if (args.shader.program) {
emitDrawBody(env, draw, args, args.shader.program);
} else {
var drawCache = env.global.def('{}');
var PROG_ID = draw.def(program, '.id');
var CACHED_PROC = draw.def(drawCache, '[', PROG_ID, ']');
draw(
env.cond(CACHED_PROC)
.then(CACHED_PROC, '.call(this,a0);')
.else(
CACHED_PROC, '=', drawCache, '[', PROG_ID, ']=',
env.link(function (program) {
return createBody(emitDrawBody, env, args, program, 1)
}), '(', program, ');',
CACHED_PROC, '.call(this,a0);'));
}
if (Object.keys(args.state).length > 0) {
draw(env.shared.current, '.dirty=true;');
}
}
// ===================================================
// ===================================================
// BATCH PROC
// ===================================================
// ===================================================
function emitBatchDynamicShaderBody (env, scope, args, program) {
env.batchId = 'a1';
injectExtensions(env, scope);
function all () {
return true
}
emitAttributes(env, scope, args, program.attributes, all);
emitUniforms(env, scope, args, program.uniforms, all);
emitDraw(env, scope, scope, args);
}
function emitBatchBody (env, scope, args, program) {
injectExtensions(env, scope);
var contextDynamic = args.contextDep;
var BATCH_ID = scope.def();
var PROP_LIST = 'a0';
var NUM_PROPS = 'a1';
var PROPS = scope.def();
env.shared.props = PROPS;
env.batchId = BATCH_ID;
var outer = env.scope();
var inner = env.scope();
scope(
outer.entry,
'for(', BATCH_ID, '=0;', BATCH_ID, '<', NUM_PROPS, ';++', BATCH_ID, '){',
PROPS, '=', PROP_LIST, '[', BATCH_ID, '];',
inner,
'}',
outer.exit);
function isInnerDefn (defn) {
return ((defn.contextDep && contextDynamic) || defn.propDep)
}
function isOuterDefn (defn) {
return !isInnerDefn(defn)
}
if (args.needsContext) {
emitContext(env, inner, args.context);
}
if (args.needsFramebuffer) {
emitPollFramebuffer(env, inner, args.framebuffer);
}
emitSetOptions(env, inner, args.state, isInnerDefn);
if (args.profile && isInnerDefn(args.profile)) {
emitProfile(env, inner, args, false, true);
}
if (!program) {
var progCache = env.global.def('{}');
var PROGRAM = args.shader.progVar.append(env, inner);
var PROG_ID = inner.def(PROGRAM, '.id');
var CACHED_PROC = inner.def(progCache, '[', PROG_ID, ']');
inner(
env.shared.gl, '.useProgram(', PROGRAM, '.program);',
'if(!', CACHED_PROC, '){',
CACHED_PROC, '=', progCache, '[', PROG_ID, ']=',
env.link(function (program) {
return createBody(
emitBatchDynamicShaderBody, env, args, program, 2)
}), '(', PROGRAM, ');}',
CACHED_PROC, '.call(this,a0[', BATCH_ID, '],', BATCH_ID, ');');
} else {
emitAttributes(env, outer, args, program.attributes, isOuterDefn);
emitAttributes(env, inner, args, program.attributes, isInnerDefn);
emitUniforms(env, outer, args, program.uniforms, isOuterDefn);
emitUniforms(env, inner, args, program.uniforms, isInnerDefn);
emitDraw(env, outer, inner, args);
}
}
function emitBatchProc (env, args) {
var batch = env.proc('batch', 2);
env.batchId = '0';
injectExtensions(env, batch);
// Check if any context variables depend on props
var contextDynamic = false;
var needsContext = true;
Object.keys(args.context).forEach(function (name) {
contextDynamic = contextDynamic || args.context[name].propDep;
});
if (!contextDynamic) {
emitContext(env, batch, args.context);
needsContext = false;
}
// framebuffer state affects framebufferWidth/height context vars
var framebuffer = args.framebuffer;
var needsFramebuffer = false;
if (framebuffer) {
if (framebuffer.propDep) {
contextDynamic = needsFramebuffer = true;
} else if (framebuffer.contextDep && contextDynamic) {
needsFramebuffer = true;
}
if (!needsFramebuffer) {
emitPollFramebuffer(env, batch, framebuffer);
}
} else {
emitPollFramebuffer(env, batch, null);
}
// viewport is weird because it can affect context vars
if (args.state.viewport && args.state.viewport.propDep) {
contextDynamic = true;
}
function isInnerDefn (defn) {
return (defn.contextDep && contextDynamic) || defn.propDep
}
// set webgl options
emitPollState(env, batch, args);
emitSetOptions(env, batch, args.state, function (defn) {
return !isInnerDefn(defn)
});
if (!args.profile || !isInnerDefn(args.profile)) {
emitProfile(env, batch, args, false, 'a1');
}
// Save these values to args so that the batch body routine can use them
args.contextDep = contextDynamic;
args.needsContext = needsContext;
args.needsFramebuffer = needsFramebuffer;
// determine if shader is dynamic
var progDefn = args.shader.progVar;
if ((progDefn.contextDep && contextDynamic) || progDefn.propDep) {
emitBatchBody(
env,
batch,
args,
null);
} else {
var PROGRAM = progDefn.append(env, batch);
batch(env.shared.gl, '.useProgram(', PROGRAM, '.program);');
if (args.shader.program) {
emitBatchBody(
env,
batch,
args,
args.shader.program);
} else {
var batchCache = env.global.def('{}');
var PROG_ID = batch.def(PROGRAM, '.id');
var CACHED_PROC = batch.def(batchCache, '[', PROG_ID, ']');
batch(
env.cond(CACHED_PROC)
.then(CACHED_PROC, '.call(this,a0,a1);')
.else(
CACHED_PROC, '=', batchCache, '[', PROG_ID, ']=',
env.link(function (program) {
return createBody(emitBatchBody, env, args, program, 2)
}), '(', PROGRAM, ');',
CACHED_PROC, '.call(this,a0,a1);'));
}
}
if (Object.keys(args.state).length > 0) {
batch(env.shared.current, '.dirty=true;');
}
}
// ===================================================
// ===================================================
// SCOPE COMMAND
// ===================================================
// ===================================================
function emitScopeProc (env, args) {
var scope = env.proc('scope', 3);
env.batchId = 'a2';
var shared = env.shared;
var CURRENT_STATE = shared.current;
emitContext(env, scope, args.context);
if (args.framebuffer) {
args.framebuffer.append(env, scope);
}
sortState(Object.keys(args.state)).forEach(function (name) {
var defn = args.state[name];
var value = defn.append(env, scope);
if (isArrayLike(value)) {
value.forEach(function (v, i) {
scope.set(env.next[name], '[' + i + ']', v);
});
} else {
scope.set(shared.next, '.' + name, value);
}
});
emitProfile(env, scope, args, true, true)
;[S_ELEMENTS, S_OFFSET, S_COUNT, S_INSTANCES, S_PRIMITIVE].forEach(
function (opt) {
var variable = args.draw[opt];
if (!variable) {
return
}
scope.set(shared.draw, '.' + opt, '' + variable.append(env, scope));
});
Object.keys(args.uniforms).forEach(function (opt) {
scope.set(
shared.uniforms,
'[' + stringStore.id(opt) + ']',
args.uniforms[opt].append(env, scope));
});
Object.keys(args.attributes).forEach(function (name) {
var record = args.attributes[name].append(env, scope);
var scopeAttrib = env.scopeAttrib(name);
Object.keys(new AttributeRecord()).forEach(function (prop) {
scope.set(scopeAttrib, '.' + prop, record[prop]);
});
});
function saveShader (name) {
var shader = args.shader[name];
if (shader) {
scope.set(shared.shader, '.' + name, shader.append(env, scope));
}
}
saveShader(S_VERT);
saveShader(S_FRAG);
if (Object.keys(args.state).length > 0) {
scope(CURRENT_STATE, '.dirty=true;');
scope.exit(CURRENT_STATE, '.dirty=true;');
}
scope('a1(', env.shared.context, ',a0,', env.batchId, ');');
}
function isDynamicObject (object) {
if (typeof object !== 'object' || isArrayLike(object)) {
return
}
var props = Object.keys(object);
for (var i = 0; i < props.length; ++i) {
if (dynamic.isDynamic(object[props[i]])) {
return true
}
}
return false
}
function splatObject (env, options, name) {
var object = options.static[name];
if (!object || !isDynamicObject(object)) {
return
}
var globals = env.global;
var keys = Object.keys(object);
var thisDep = false;
var contextDep = false;
var propDep = false;
var objectRef = env.global.def('{}');
keys.forEach(function (key) {
var value = object[key];
if (dynamic.isDynamic(value)) {
if (typeof value === 'function') {
value = object[key] = dynamic.unbox(value);
}
var deps = createDynamicDecl(value, null);
thisDep = thisDep || deps.thisDep;
propDep = propDep || deps.propDep;
contextDep = contextDep || deps.contextDep;
} else {
globals(objectRef, '.', key, '=');
switch (typeof value) {
case 'number':
globals(value);
break
case 'string':
globals('"', value, '"');
break
case 'object':
if (Array.isArray(value)) {
globals('[', value.join(), ']');
}
break
default:
globals(env.link(value));
break
}
globals(';');
}
});
function appendBlock (env, block) {
keys.forEach(function (key) {
var value = object[key];
if (!dynamic.isDynamic(value)) {
return
}
var ref = env.invoke(block, value);
block(objectRef, '.', key, '=', ref, ';');
});
}
options.dynamic[name] = new dynamic.DynamicVariable(DYN_THUNK, {
thisDep: thisDep,
contextDep: contextDep,
propDep: propDep,
ref: objectRef,
append: appendBlock
});
delete options.static[name];
}
// ===========================================================================
// ===========================================================================
// MAIN DRAW COMMAND
// ===========================================================================
// ===========================================================================
function compileCommand (options, attributes, uniforms, context, stats) {
var env = createREGLEnvironment();
// link stats, so that we can easily access it in the program.
env.stats = env.link(stats);
// splat options and attributes to allow for dynamic nested properties
Object.keys(attributes.static).forEach(function (key) {
splatObject(env, attributes, key);
});
NESTED_OPTIONS.forEach(function (name) {
splatObject(env, options, name);
});
var args = parseArguments(options, attributes, uniforms, context, env);
emitDrawProc(env, args);
emitScopeProc(env, args);
emitBatchProc(env, args);
return env.compile()
}
// ===========================================================================
// ===========================================================================
// POLL / REFRESH
// ===========================================================================
// ===========================================================================
return {
next: nextState,
current: currentState,
procs: (function () {
var env = createREGLEnvironment();
var poll = env.proc('poll');
var refresh = env.proc('refresh');
var common = env.block();
poll(common);
refresh(common);
var shared = env.shared;
var GL = shared.gl;
var NEXT_STATE = shared.next;
var CURRENT_STATE = shared.current;
common(CURRENT_STATE, '.dirty=false;');
emitPollFramebuffer(env, poll);
emitPollFramebuffer(env, refresh, null, true);
// Refresh updates all attribute state changes
var extInstancing = gl.getExtension('angle_instanced_arrays');
var INSTANCING;
if (extInstancing) {
INSTANCING = env.link(extInstancing);
}
for (var i = 0; i < limits.maxAttributes; ++i) {
var BINDING = refresh.def(shared.attributes, '[', i, ']');
var ifte = env.cond(BINDING, '.buffer');
ifte.then(
GL, '.enableVertexAttribArray(', i, ');',
GL, '.bindBuffer(',
GL_ARRAY_BUFFER$1, ',',
BINDING, '.buffer.buffer);',
GL, '.vertexAttribPointer(',
i, ',',
BINDING, '.size,',
BINDING, '.type,',
BINDING, '.normalized,',
BINDING, '.stride,',
BINDING, '.offset);'
).else(
GL, '.disableVertexAttribArray(', i, ');',
GL, '.vertexAttrib4f(',
i, ',',
BINDING, '.x,',
BINDING, '.y,',
BINDING, '.z,',
BINDING, '.w);',
BINDING, '.buffer=null;');
refresh(ifte);
if (extInstancing) {
refresh(
INSTANCING, '.vertexAttribDivisorANGLE(',
i, ',',
BINDING, '.divisor);');
}
}
Object.keys(GL_FLAGS).forEach(function (flag) {
var cap = GL_FLAGS[flag];
var NEXT = common.def(NEXT_STATE, '.', flag);
var block = env.block();
block('if(', NEXT, '){',
GL, '.enable(', cap, ')}else{',
GL, '.disable(', cap, ')}',
CURRENT_STATE, '.', flag, '=', NEXT, ';');
refresh(block);
poll(
'if(', NEXT, '!==', CURRENT_STATE, '.', flag, '){',
block,
'}');
});
Object.keys(GL_VARIABLES).forEach(function (name) {
var func = GL_VARIABLES[name];
var init = currentState[name];
var NEXT, CURRENT;
var block = env.block();
block(GL, '.', func, '(');
if (isArrayLike(init)) {
var n = init.length;
NEXT = env.global.def(NEXT_STATE, '.', name);
CURRENT = env.global.def(CURRENT_STATE, '.', name);
block(
loop(n, function (i) {
return NEXT + '[' + i + ']'
}), ');',
loop(n, function (i) {
return CURRENT + '[' + i + ']=' + NEXT + '[' + i + '];'
}).join(''));
poll(
'if(', loop(n, function (i) {
return NEXT + '[' + i + ']!==' + CURRENT + '[' + i + ']'
}).join('||'), '){',
block,
'}');
} else {
NEXT = common.def(NEXT_STATE, '.', name);
CURRENT = common.def(CURRENT_STATE, '.', name);
block(
NEXT, ');',
CURRENT_STATE, '.', name, '=', NEXT, ';');
poll(
'if(', NEXT, '!==', CURRENT, '){',
block,
'}');
}
refresh(block);
});
return env.compile()
})(),
compile: compileCommand
}
}
function stats () {
return {
bufferCount: 0,
elementsCount: 0,
framebufferCount: 0,
shaderCount: 0,
textureCount: 0,
cubeCount: 0,
renderbufferCount: 0,
maxTextureUnits: 0
}
}
var GL_QUERY_RESULT_EXT = 0x8866;
var GL_QUERY_RESULT_AVAILABLE_EXT = 0x8867;
var GL_TIME_ELAPSED_EXT = 0x88BF;
var createTimer = function (gl, extensions) {
var extTimer = extensions.ext_disjoint_timer_query;
if (!extTimer) {
return null
}
// QUERY POOL BEGIN
var queryPool = [];
function allocQuery () {
return queryPool.pop() || extTimer.createQueryEXT()
}
function freeQuery (query) {
queryPool.push(query);
}
// QUERY POOL END
var pendingQueries = [];
function beginQuery (stats) {
var query = allocQuery();
extTimer.beginQueryEXT(GL_TIME_ELAPSED_EXT, query);
pendingQueries.push(query);
pushScopeStats(pendingQueries.length - 1, pendingQueries.length, stats);
}
function endQuery () {
extTimer.endQueryEXT(GL_TIME_ELAPSED_EXT);
}
//
// Pending stats pool.
//
function PendingStats () {
this.startQueryIndex = -1;
this.endQueryIndex = -1;
this.sum = 0;
this.stats = null;
}
var pendingStatsPool = [];
function allocPendingStats () {
return pendingStatsPool.pop() || new PendingStats()
}
function freePendingStats (pendingStats) {
pendingStatsPool.push(pendingStats);
}
// Pending stats pool end
var pendingStats = [];
function pushScopeStats (start, end, stats) {
var ps = allocPendingStats();
ps.startQueryIndex = start;
ps.endQueryIndex = end;
ps.sum = 0;
ps.stats = stats;
pendingStats.push(ps);
}
// we should call this at the beginning of the frame,
// in order to update gpuTime
var timeSum = [];
var queryPtr = [];
function update () {
var ptr, i;
var n = pendingQueries.length;
if (n === 0) {
return
}
// Reserve space
queryPtr.length = Math.max(queryPtr.length, n + 1);
timeSum.length = Math.max(timeSum.length, n + 1);
timeSum[0] = 0;
queryPtr[0] = 0;
// Update all pending timer queries
var queryTime = 0;
ptr = 0;
for (i = 0; i < pendingQueries.length; ++i) {
var query = pendingQueries[i];
if (extTimer.getQueryObjectEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT)) {
queryTime += extTimer.getQueryObjectEXT(query, GL_QUERY_RESULT_EXT);
freeQuery(query);
} else {
pendingQueries[ptr++] = query;
}
timeSum[i + 1] = queryTime;
queryPtr[i + 1] = ptr;
}
pendingQueries.length = ptr;
// Update all pending stat queries
ptr = 0;
for (i = 0; i < pendingStats.length; ++i) {
var stats = pendingStats[i];
var start = stats.startQueryIndex;
var end = stats.endQueryIndex;
stats.sum += timeSum[end] - timeSum[start];
var startPtr = queryPtr[start];
var endPtr = queryPtr[end];
if (endPtr === startPtr) {
stats.stats.gpuTime += stats.sum / 1e6;
freePendingStats(stats);
} else {
stats.startQueryIndex = startPtr;
stats.endQueryIndex = endPtr;
pendingStats[ptr++] = stats;
}
}
pendingStats.length = ptr;
}
return {
beginQuery: beginQuery,
endQuery: endQuery,
pushScopeStats: pushScopeStats,
update: update,
getNumPendingQueries: function () {
return pendingQueries.length
},
clear: function () {
queryPool.push.apply(queryPool, pendingQueries);
for (var i = 0; i < queryPool.length; i++) {
extTimer.deleteQueryEXT(queryPool[i]);
}
pendingQueries.length = 0;
queryPool.length = 0;
},
restore: function () {
pendingQueries.length = 0;
queryPool.length = 0;
}
}
};
var GL_COLOR_BUFFER_BIT = 16384;
var GL_DEPTH_BUFFER_BIT = 256;
var GL_STENCIL_BUFFER_BIT = 1024;
var GL_ARRAY_BUFFER = 34962;
var CONTEXT_LOST_EVENT = 'webglcontextlost';
var CONTEXT_RESTORED_EVENT = 'webglcontextrestored';
var DYN_PROP = 1;
var DYN_CONTEXT = 2;
var DYN_STATE = 3;
function find (haystack, needle) {
for (var i = 0; i < haystack.length; ++i) {
if (haystack[i] === needle) {
return i
}
}
return -1
}
function wrapREGL (args) {
var config = parseArgs(args);
if (!config) {
return null
}
var gl = config.gl;
var glAttributes = gl.getContextAttributes();
var contextLost = gl.isContextLost();
var extensionState = createExtensionCache(gl, config);
if (!extensionState) {
return null
}
var stringStore = createStringStore();
var stats$$1 = stats();
var extensions = extensionState.extensions;
var timer = createTimer(gl, extensions);
var START_TIME = clock();
var WIDTH = gl.drawingBufferWidth;
var HEIGHT = gl.drawingBufferHeight;
var contextState = {
tick: 0,
time: 0,
viewportWidth: WIDTH,
viewportHeight: HEIGHT,
framebufferWidth: WIDTH,
framebufferHeight: HEIGHT,
drawingBufferWidth: WIDTH,
drawingBufferHeight: HEIGHT,
pixelRatio: config.pixelRatio
};
var uniformState = {};
var drawState = {
elements: null,
primitive: 4, // GL_TRIANGLES
count: -1,
offset: 0,
instances: -1
};
var limits = wrapLimits(gl, extensions);
var bufferState = wrapBufferState(gl, stats$$1, config);
var elementState = wrapElementsState(gl, extensions, bufferState, stats$$1);
var attributeState = wrapAttributeState(
gl,
extensions,
limits,
bufferState,
stringStore);
var shaderState = wrapShaderState(gl, stringStore, stats$$1, config);
var textureState = createTextureSet(
gl,
extensions,
limits,
function () { core.procs.poll(); },
contextState,
stats$$1,
config);
var renderbufferState = wrapRenderbuffers(gl, extensions, limits, stats$$1, config);
var framebufferState = wrapFBOState(
gl,
extensions,
limits,
textureState,
renderbufferState,
stats$$1);
var core = reglCore(
gl,
stringStore,
extensions,
limits,
bufferState,
elementState,
textureState,
framebufferState,
uniformState,
attributeState,
shaderState,
drawState,
contextState,
timer,
config);
var readPixels = wrapReadPixels(
gl,
framebufferState,
core.procs.poll,
contextState,
glAttributes, extensions);
var nextState = core.next;
var canvas = gl.canvas;
var rafCallbacks = [];
var lossCallbacks = [];
var restoreCallbacks = [];
var destroyCallbacks = [config.onDestroy];
var activeRAF = null;
function handleRAF () {
if (rafCallbacks.length === 0) {
if (timer) {
timer.update();
}
activeRAF = null;
return
}
// schedule next animation frame
activeRAF = raf.next(handleRAF);
// poll for changes
poll();
// fire a callback for all pending rafs
for (var i = rafCallbacks.length - 1; i >= 0; --i) {
var cb = rafCallbacks[i];
if (cb) {
cb(contextState, null, 0);
}
}
// flush all pending webgl calls
gl.flush();
// poll GPU timers *after* gl.flush so we don't delay command dispatch
if (timer) {
timer.update();
}
}
function startRAF () {
if (!activeRAF && rafCallbacks.length > 0) {
activeRAF = raf.next(handleRAF);
}
}
function stopRAF () {
if (activeRAF) {
raf.cancel(handleRAF);
activeRAF = null;
}
}
function handleContextLoss (event) {
event.preventDefault();
// set context lost flag
contextLost = true;
// pause request animation frame
stopRAF();
// lose context
lossCallbacks.forEach(function (cb) {
cb();
});
}
function handleContextRestored (event) {
// clear error code
gl.getError();
// clear context lost flag
contextLost = false;
// refresh state
extensionState.restore();
shaderState.restore();
bufferState.restore();
textureState.restore();
renderbufferState.restore();
framebufferState.restore();
if (timer) {
timer.restore();
}
// refresh state
core.procs.refresh();
// restart RAF
startRAF();
// restore context
restoreCallbacks.forEach(function (cb) {
cb();
});
}
if (canvas) {
canvas.addEventListener(CONTEXT_LOST_EVENT, handleContextLoss, false);
canvas.addEventListener(CONTEXT_RESTORED_EVENT, handleContextRestored, false);
}
function destroy () {
rafCallbacks.length = 0;
stopRAF();
if (canvas) {
canvas.removeEventListener(CONTEXT_LOST_EVENT, handleContextLoss);
canvas.removeEventListener(CONTEXT_RESTORED_EVENT, handleContextRestored);
}
shaderState.clear();
framebufferState.clear();
renderbufferState.clear();
textureState.clear();
elementState.clear();
bufferState.clear();
if (timer) {
timer.clear();
}
destroyCallbacks.forEach(function (cb) {
cb();
});
}
function compileProcedure (options) {
check$1(!!options, 'invalid args to regl({...})');
check$1.type(options, 'object', 'invalid args to regl({...})');
function flattenNestedOptions (options) {
var result = extend({}, options);
delete result.uniforms;
delete result.attributes;
delete result.context;
if ('stencil' in result && result.stencil.op) {
result.stencil.opBack = result.stencil.opFront = result.stencil.op;
delete result.stencil.op;
}
function merge (name) {
if (name in result) {
var child = result[name];
delete result[name];
Object.keys(child).forEach(function (prop) {
result[name + '.' + prop] = child[prop];
});
}
}
merge('blend');
merge('depth');
merge('cull');
merge('stencil');
merge('polygonOffset');
merge('scissor');
merge('sample');
return result
}
function separateDynamic (object) {
var staticItems = {};
var dynamicItems = {};
Object.keys(object).forEach(function (option) {
var value = object[option];
if (dynamic.isDynamic(value)) {
dynamicItems[option] = dynamic.unbox(value, option);
} else {
staticItems[option] = value;
}
});
return {
dynamic: dynamicItems,
static: staticItems
}
}
// Treat context variables separate from other dynamic variables
var context = separateDynamic(options.context || {});
var uniforms = separateDynamic(options.uniforms || {});
var attributes = separateDynamic(options.attributes || {});
var opts = separateDynamic(flattenNestedOptions(options));
var stats$$1 = {
gpuTime: 0.0,
cpuTime: 0.0,
count: 0
};
var compiled = core.compile(opts, attributes, uniforms, context, stats$$1);
var draw = compiled.draw;
var batch = compiled.batch;
var scope = compiled.scope;
// FIXME: we should modify code generation for batch commands so this
// isn't necessary
var EMPTY_ARRAY = [];
function reserve (count) {
while (EMPTY_ARRAY.length < count) {
EMPTY_ARRAY.push(null);
}
return EMPTY_ARRAY
}
function REGLCommand (args, body) {
var i;
if (contextLost) {
check$1.raise('context lost');
}
if (typeof args === 'function') {
return scope.call(this, null, args, 0)
} else if (typeof body === 'function') {
if (typeof args === 'number') {
for (i = 0; i < args; ++i) {
scope.call(this, null, body, i);
}
return
} else if (Array.isArray(args)) {
for (i = 0; i < args.length; ++i) {
scope.call(this, args[i], body, i);
}
return
} else {
return scope.call(this, args, body, 0)
}
} else if (typeof args === 'number') {
if (args > 0) {
return batch.call(this, reserve(args | 0), args | 0)
}
} else if (Array.isArray(args)) {
if (args.length) {
return batch.call(this, args, args.length)
}
} else {
return draw.call(this, args)
}
}
return extend(REGLCommand, {
stats: stats$$1
})
}
var setFBO = framebufferState.setFBO = compileProcedure({
framebuffer: dynamic.define.call(null, DYN_PROP, 'framebuffer')
});
function clearImpl (_, options) {
var clearFlags = 0;
core.procs.poll();
var c = options.color;
if (c) {
gl.clearColor(+c[0] || 0, +c[1] || 0, +c[2] || 0, +c[3] || 0);
clearFlags |= GL_COLOR_BUFFER_BIT;
}
if ('depth' in options) {
gl.clearDepth(+options.depth);
clearFlags |= GL_DEPTH_BUFFER_BIT;
}
if ('stencil' in options) {
gl.clearStencil(options.stencil | 0);
clearFlags |= GL_STENCIL_BUFFER_BIT;
}
check$1(!!clearFlags, 'called regl.clear with no buffer specified');
gl.clear(clearFlags);
}
function clear (options) {
check$1(
typeof options === 'object' && options,
'regl.clear() takes an object as input');
if ('framebuffer' in options) {
if (options.framebuffer &&
options.framebuffer_reglType === 'framebufferCube') {
for (var i = 0; i < 6; ++i) {
setFBO(extend({
framebuffer: options.framebuffer.faces[i]
}, options), clearImpl);
}
} else {
setFBO(options, clearImpl);
}
} else {
clearImpl(null, options);
}
}
function frame (cb) {
check$1.type(cb, 'function', 'regl.frame() callback must be a function');
rafCallbacks.push(cb);
function cancel () {
// FIXME: should we check something other than equals cb here?
// what if a user calls frame twice with the same callback...
//
var i = find(rafCallbacks, cb);
check$1(i >= 0, 'cannot cancel a frame twice');
function pendingCancel () {
var index = find(rafCallbacks, pendingCancel);
rafCallbacks[index] = rafCallbacks[rafCallbacks.length - 1];
rafCallbacks.length -= 1;
if (rafCallbacks.length <= 0) {
stopRAF();
}
}
rafCallbacks[i] = pendingCancel;
}
startRAF();
return {
cancel: cancel
}
}
// poll viewport
function pollViewport () {
var viewport = nextState.viewport;
var scissorBox = nextState.scissor_box;
viewport[0] = viewport[1] = scissorBox[0] = scissorBox[1] = 0;
contextState.viewportWidth =
contextState.framebufferWidth =
contextState.drawingBufferWidth =
viewport[2] =
scissorBox[2] = gl.drawingBufferWidth;
contextState.viewportHeight =
contextState.framebufferHeight =
contextState.drawingBufferHeight =
viewport[3] =
scissorBox[3] = gl.drawingBufferHeight;
}
function poll () {
contextState.tick += 1;
contextState.time = now();
pollViewport();
core.procs.poll();
}
function refresh () {
pollViewport();
core.procs.refresh();
if (timer) {
timer.update();
}
}
function now () {
return (clock() - START_TIME) / 1000.0
}
refresh();
function addListener (event, callback) {
check$1.type(callback, 'function', 'listener callback must be a function');
var callbacks;
switch (event) {
case 'frame':
return frame(callback)
case 'lost':
callbacks = lossCallbacks;
break
case 'restore':
callbacks = restoreCallbacks;
break
case 'destroy':
callbacks = destroyCallbacks;
break
default:
check$1.raise('invalid event, must be one of frame,lost,restore,destroy');
}
callbacks.push(callback);
return {
cancel: function () {
for (var i = 0; i < callbacks.length; ++i) {
if (callbacks[i] === callback) {
callbacks[i] = callbacks[callbacks.length - 1];
callbacks.pop();
return
}
}
}
}
}
var regl = extend(compileProcedure, {
// Clear current FBO
clear: clear,
// Short cuts for dynamic variables
prop: dynamic.define.bind(null, DYN_PROP),
context: dynamic.define.bind(null, DYN_CONTEXT),
this: dynamic.define.bind(null, DYN_STATE),
// executes an empty draw command
draw: compileProcedure({}),
// Resources
buffer: function (options) {
return bufferState.create(options, GL_ARRAY_BUFFER, false, false)
},
elements: function (options) {
return elementState.create(options, false)
},
texture: textureState.create2D,
cube: textureState.createCube,
renderbuffer: renderbufferState.create,
framebuffer: framebufferState.create,
framebufferCube: framebufferState.createCube,
// Expose context attributes
attributes: glAttributes,
// Frame rendering
frame: frame,
on: addListener,
// System limits
limits: limits,
hasExtension: function (name) {
return limits.extensions.indexOf(name.toLowerCase()) >= 0
},
// Read pixels
read: readPixels,
// Destroy regl and all associated resources
destroy: destroy,
// Direct GL state manipulation
_gl: gl,
_refresh: refresh,
poll: function () {
poll();
if (timer) {
timer.update();
}
},
// Current time
now: now,
// regl Statistics Information
stats: stats$$1
});
config.onDone(null, regl);
return regl
}
return wrapREGL;
})));
},{}],19:[function(require,module,exports){
"use strict"
function unique_pred(list, compare) {
var ptr = 1
, len = list.length
, a=list[0], b=list[0]
for(var i=1; i<len; ++i) {
b = a
a = list[i]
if(compare(a, b)) {
if(i === ptr) {
ptr++
continue
}
list[ptr++] = a
}
}
list.length = ptr
return list
}
function unique_eq(list) {
var ptr = 1
, len = list.length
, a=list[0], b = list[0]
for(var i=1; i<len; ++i, b=a) {
b = a
a = list[i]
if(a !== b) {
if(i === ptr) {
ptr++
continue
}
list[ptr++] = a
}
}
list.length = ptr
return list
}
function unique(list, compare, sorted) {
if(list.length === 0) {
return list
}
if(compare) {
if(!sorted) {
list.sort(compare)
}
return unique_pred(list, compare)
}
if(!sorted) {
list.sort()
}
return unique_eq(list)
}
module.exports = unique
},{}],20:[function(require,module,exports){
/**
*
* VALIDATE: boolean
*
*
* DESCRIPTION:
* - Validates if a value is a boolean.
*
*
* NOTES:
* [1]
*
*
* TODO:
* [1]
*
*
* LICENSE:
* MIT
*
* Copyright (c) 2014. Athan Reines.
*
*
* AUTHOR:
* Athan Reines. kgryte@gmail.com. 2014.
*
*/
'use strict';
/**
* FUNCTION: isBoolean( value )
* Validates if a value is a boolean.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating whether value is a boolean
*/
function isBoolean( value ) {
return ( typeof value === 'boolean' || Object.prototype.toString.call( value ) === '[object Boolean]' );
} // end FUNCTION isBoolean()
// EXPORTS //
module.exports = isBoolean;
},{}],21:[function(require,module,exports){
/**
*
* VALIDATE: integer
*
*
* DESCRIPTION:
* - Validates if a value is an integer.
*
*
* NOTES:
* [1]
*
*
* TODO:
* [1]
*
*
* LICENSE:
* MIT
*
* Copyright (c) 2014. Athan Reines.
*
*
* AUTHOR:
* Athan Reines. kgryte@gmail.com. 2014.
*
*/
'use strict';
// MODULES //
var isNumber = require( 'validate.io-number' );
// ISINTEGER //
/**
* FUNCTION: isInteger( value )
* Validates if a value is an integer.
*
* @param {Number} value - value to be validated
* @returns {Boolean} boolean indicating whether value is an integer
*/
function isInteger( value ) {
return isNumber( value ) && value%1 === 0;
} // end FUNCTION isInteger()
// EXPORTS //
module.exports = isInteger;
},{"validate.io-number":23}],22:[function(require,module,exports){
/**
*
* VALIDATE: nonnegative-integer
*
*
* DESCRIPTION:
* - Validates if a value is a nonnegative integer.
*
*
* NOTES:
* [1]
*
*
* TODO:
* [1]
*
*
* LICENSE:
* MIT
*
* Copyright (c) 2015. Athan Reines.
*
*
* AUTHOR:
* Athan Reines. kgryte@gmail.com. 2015.
*
*/
'use strict';
// MODULES //
var isInteger = require( 'validate.io-integer' );
// IS NONNEGATIVE INTEGER //
/**
* FUNCTION: isNonNegativeInteger( value )
* Validates if a value is a nonnegative integer.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating if a value is a nonnegative integer
*/
function isNonNegativeInteger( value ) {
return isInteger( value ) && value >= 0;
} // end FUNCTION isNonNegativeInteger()
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"validate.io-integer":21}],23:[function(require,module,exports){
/**
*
* VALIDATE: number
*
*
* DESCRIPTION:
* - Validates if a value is a number.
*
*
* NOTES:
* [1]
*
*
* TODO:
* [1]
*
*
* LICENSE:
* MIT
*
* Copyright (c) 2014. Athan Reines.
*
*
* AUTHOR:
* Athan Reines. kgryte@gmail.com. 2014.
*
*/
'use strict';
/**
* FUNCTION: isNumber( value )
* Validates if a value is a number.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating whether value is a number
*/
function isNumber( value ) {
return ( typeof value === 'number' || Object.prototype.toString.call( value ) === '[object Number]' ) && value.valueOf() === value.valueOf();
} // end FUNCTION isNumber()
// EXPORTS //
module.exports = isNumber;
},{}]},{},[1]);
var libs = {
glsl: require('glslify'),
linspace: require('ndarray-linspace'),
vectorFill: require('ndarray-vector-fill'),
ndarray: require('ndarray'),
ease: require('eases/cubic-in-out'),
reglLib: require('regl'),
}
var glsl = require('glslify')
libs.glslViridis = glsl`
#pragma glslify: colormap = require(glsl-colormap/viridis)
`
for (key in libs) window[key] = libs[key]
{
"version": "1.0.0",
"description": "watchify and hot-server",
"scripts": {
"start": "watchify -t glslify lib-src.js -o lib-build.js & hot-server",
"budo-start": "budo --open --live --force-default-index index.js -- -t glslify",
"build": "browserify index.js -t glslify | uglifyjs -cm| indexhtmlify | metadataify | github-cornerify > index.html"
},
"dependencies": {
"browserify": "^14.1.0",
"budo": "^9.4.7",
"control-panel": "^1.2.0",
"eases": "^1.0.8",
"es2040": "^1.2.5",
"fail-nicely": "^2.0.0",
"github-cornerify": "^1.0.7",
"glsl-colormap": "^1.0.1",
"glsl-noise": "^0.0.0",
"glslify": "^6.0.1",
"hot-server": "^0.0.11",
"indexhtmlify": "^1.3.1",
"metadataify": "^1.0.3",
"ndarray": "^1.0.18",
"ndarray-linspace": "^2.0.3",
"ndarray-vector-fill": "^1.0.0",
"regl": "^1.3.0",
"standard": "^9.0.1",
"uglify-js": "^2.8.13",
"watchify": "^3.9.0"
}
}
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
JSONStream@^1.0.3:
version "1.3.1"
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a"
dependencies:
jsonparse "^1.2.0"
through ">=2.2.7 <3"
abbrev@1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f"
accepts@~1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca"
dependencies:
mime-types "~2.1.11"
negotiator "0.6.1"
acorn-jsx@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b"
dependencies:
acorn "^3.0.4"
acorn@^1.0.3:
version "1.2.2"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-1.2.2.tgz#c8ce27de0acc76d896d2b1fad3df588d9e82f014"
acorn@^3.0.4:
version "3.3.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
acorn@^4.0.3:
version "4.0.11"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0"
acorn@^5.0.0, acorn@^5.0.1:
version "5.0.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d"
add-px-to-style@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/add-px-to-style/-/add-px-to-style-1.0.0.tgz#d0c135441fa8014a8137904531096f67f28f263a"
ajv-keywords@^1.0.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
ajv@^4.7.0, ajv@^4.9.1:
version "4.11.8"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"
align-text@^0.1.1, align-text@^0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
dependencies:
kind-of "^3.0.2"
longest "^1.0.1"
repeat-string "^1.5.2"
amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
ansi-escapes@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e"
ansi-regex@^0.2.0, ansi-regex@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
ansi-styles@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.0.1.tgz#b033f57f93e2d28adeb8bc11138fa13da0fd20a3"
ansi-styles@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de"
ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
anymatch@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507"
dependencies:
arrify "^1.0.0"
micromatch "^2.1.5"
aproba@^1.0.3:
version "1.1.1"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab"
are-we-there-yet@~1.1.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d"
dependencies:
delegates "^1.0.0"
readable-stream "^2.0.6"
argparse@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
dependencies:
sprintf-js "~1.0.2"
arr-diff@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
dependencies:
arr-flatten "^1.0.1"
arr-flatten@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1"
array-filter@~0.0.0:
version "0.0.1"
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
array-find-index@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1"
array-flatten@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
array-map@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662"
array-reduce@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b"
array-union@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
dependencies:
array-uniq "^1.0.1"
array-uniq@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"
array-unique@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
array.prototype.find@^2.0.1:
version "2.0.4"
resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.7.0"
arrify@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
asn1.js@^4.0.0:
version "4.9.1"
resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40"
dependencies:
bn.js "^4.0.0"
inherits "^2.0.1"
minimalistic-assert "^1.0.0"
asn1@~0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
assert-plus@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234"
assert@^1.4.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91"
dependencies:
util "0.10.3"
astw@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917"
dependencies:
acorn "^4.0.3"
async-each@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
aws-sign2@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"
aws4@^1.2.1:
version "1.6.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
babel-code-frame@^6.16.0, babel-code-frame@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4"
dependencies:
chalk "^1.1.0"
esutils "^2.0.2"
js-tokens "^3.0.0"
babel-core@^6.24.1, babel-core@^6.9.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83"
dependencies:
babel-code-frame "^6.22.0"
babel-generator "^6.24.1"
babel-helpers "^6.24.1"
babel-messages "^6.23.0"
babel-register "^6.24.1"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babylon "^6.11.0"
convert-source-map "^1.1.0"
debug "^2.1.1"
json5 "^0.5.0"
lodash "^4.2.0"
minimatch "^3.0.2"
path-is-absolute "^1.0.0"
private "^0.1.6"
slash "^1.0.0"
source-map "^0.5.0"
babel-generator@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497"
dependencies:
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.24.1"
detect-indent "^4.0.0"
jsesc "^1.3.0"
lodash "^4.2.0"
source-map "^0.5.0"
trim-right "^1.0.1"
babel-helper-call-delegate@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d"
dependencies:
babel-helper-hoist-variables "^6.24.1"
babel-runtime "^6.22.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-helper-get-function-arity@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.24.1"
babel-helper-hoist-variables@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.24.1"
babel-helpers@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-messages@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-check-es2015-constants@^6.8.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-arrow-functions@^6.8.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-block-scoping@^6.9.0:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
lodash "^4.2.0"
babel-plugin-transform-es2015-computed-properties@^6.8.0:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-plugin-transform-es2015-destructuring@^6.9.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-parameters@^6.9.0:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b"
dependencies:
babel-helper-call-delegate "^6.24.1"
babel-helper-get-function-arity "^6.24.1"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-plugin-transform-es2015-shorthand-properties@^6.8.0:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.24.1"
babel-plugin-transform-es2015-spread@^6.8.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-template-literals@^6.8.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d"
dependencies:
babel-runtime "^6.22.0"
babel-preset-es2040@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/babel-preset-es2040/-/babel-preset-es2040-1.1.1.tgz#408cc33724708205c780667b930fa78df5bc8f94"
dependencies:
babel-plugin-check-es2015-constants "^6.8.0"
babel-plugin-transform-es2015-arrow-functions "^6.8.0"
babel-plugin-transform-es2015-block-scoping "^6.9.0"
babel-plugin-transform-es2015-computed-properties "^6.8.0"
babel-plugin-transform-es2015-destructuring "^6.9.0"
babel-plugin-transform-es2015-parameters "^6.9.0"
babel-plugin-transform-es2015-shorthand-properties "^6.8.0"
babel-plugin-transform-es2015-spread "^6.8.0"
babel-plugin-transform-es2015-template-literals "^6.8.0"
babel-register@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f"
dependencies:
babel-core "^6.24.1"
babel-runtime "^6.22.0"
core-js "^2.4.0"
home-or-tmp "^2.0.0"
lodash "^4.2.0"
mkdirp "^0.5.1"
source-map-support "^0.4.2"
babel-runtime@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.10.0"
babel-template@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333"
dependencies:
babel-runtime "^6.22.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babylon "^6.11.0"
lodash "^4.2.0"
babel-traverse@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695"
dependencies:
babel-code-frame "^6.22.0"
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.24.1"
babylon "^6.15.0"
debug "^2.2.0"
globals "^9.0.0"
invariant "^2.2.0"
lodash "^4.2.0"
babel-types@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975"
dependencies:
babel-runtime "^6.22.0"
esutils "^2.0.2"
lodash "^4.2.0"
to-fast-properties "^1.0.1"
babylon@^6.11.0, babylon@^6.15.0:
version "6.17.0"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932"
balanced-match@^0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
base64-js@^1.0.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1"
batch@0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16"
bcrypt-pbkdf@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
dependencies:
tweetnacl "^0.14.3"
binary-extensions@^1.0.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774"
bl@^1.0.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.1.tgz#cac328f7bee45730d404b692203fcb590e172d5e"
dependencies:
readable-stream "^2.0.5"
block-stream@*:
version "0.0.9"
resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
dependencies:
inherits "~2.0.0"
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
version "4.11.6"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215"
body-parser@~1.14.0:
version "1.14.2"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.14.2.tgz#1015cb1fe2c443858259581db53332f8d0cf50f9"
dependencies:
bytes "2.2.0"
content-type "~1.0.1"
debug "~2.2.0"
depd "~1.1.0"
http-errors "~1.3.1"
iconv-lite "0.4.13"
on-finished "~2.3.0"
qs "5.2.0"
raw-body "~2.1.5"
type-is "~1.6.10"
bole@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/bole/-/bole-2.0.0.tgz#d8aa1c690467bfb4fe11b874acb2e8387e382615"
dependencies:
core-util-is ">=1.0.1 <1.1.0-0"
individual ">=3.0.0 <3.1.0-0"
json-stringify-safe ">=5.0.0 <5.1.0-0"
boom@2.x.x:
version "2.10.1"
resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
dependencies:
hoek "2.x.x"
brace-expansion@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59"
dependencies:
balanced-match "^0.4.1"
concat-map "0.0.1"
braces@^1.8.2:
version "1.8.5"
resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7"
dependencies:
expand-range "^1.8.1"
preserve "^0.2.0"
repeat-element "^1.1.2"
brfs@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/brfs/-/brfs-1.4.3.tgz#db675d6f5e923e6df087fca5859c9090aaed3216"
dependencies:
quote-stream "^1.0.1"
resolve "^1.1.5"
static-module "^1.1.0"
through2 "^2.0.0"
brorand@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
browser-pack@^6.0.1:
version "6.0.2"
resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.2.tgz#f86cd6cef4f5300c8e63e07a4d512f65fbff4531"
dependencies:
JSONStream "^1.0.3"
combine-source-map "~0.7.1"
defined "^1.0.0"
through2 "^2.0.0"
umd "^3.0.0"
browser-resolve@^1.11.0, browser-resolve@^1.7.0:
version "1.11.2"
resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce"
dependencies:
resolve "1.1.7"
browserify-aes@^1.0.0, browserify-aes@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a"
dependencies:
buffer-xor "^1.0.2"
cipher-base "^1.0.0"
create-hash "^1.1.0"
evp_bytestokey "^1.0.0"
inherits "^2.0.1"
browserify-cipher@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a"
dependencies:
browserify-aes "^1.0.4"
browserify-des "^1.0.0"
evp_bytestokey "^1.0.0"
browserify-des@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd"
dependencies:
cipher-base "^1.0.1"
des.js "^1.0.0"
inherits "^2.0.1"
browserify-rsa@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524"
dependencies:
bn.js "^4.1.0"
randombytes "^2.0.1"
browserify-sign@^4.0.0:
version "4.0.4"
resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298"
dependencies:
bn.js "^4.1.1"
browserify-rsa "^4.0.0"
create-hash "^1.1.0"
create-hmac "^1.1.2"
elliptic "^6.0.0"
inherits "^2.0.1"
parse-asn1 "^5.0.0"
browserify-zlib@~0.1.2:
version "0.1.4"
resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d"
dependencies:
pako "~0.2.0"
browserify@^13.0.1:
version "13.3.0"
resolved "https://registry.yarnpkg.com/browserify/-/browserify-13.3.0.tgz#b5a9c9020243f0c70e4675bec8223bc627e415ce"
dependencies:
JSONStream "^1.0.3"
assert "^1.4.0"
browser-pack "^6.0.1"
browser-resolve "^1.11.0"
browserify-zlib "~0.1.2"
buffer "^4.1.0"
cached-path-relative "^1.0.0"
concat-stream "~1.5.1"
console-browserify "^1.1.0"
constants-browserify "~1.0.0"
crypto-browserify "^3.0.0"
defined "^1.0.0"
deps-sort "^2.0.0"
domain-browser "~1.1.0"
duplexer2 "~0.1.2"
events "~1.1.0"
glob "^7.1.0"
has "^1.0.0"
htmlescape "^1.1.0"
https-browserify "~0.0.0"
inherits "~2.0.1"
insert-module-globals "^7.0.0"
labeled-stream-splicer "^2.0.0"
module-deps "^4.0.8"
os-browserify "~0.1.1"
parents "^1.0.1"
path-browserify "~0.0.0"
process "~0.11.0"
punycode "^1.3.2"
querystring-es3 "~0.2.0"
read-only-stream "^2.0.0"
readable-stream "^2.0.2"
resolve "^1.1.4"
shasum "^1.0.0"
shell-quote "^1.6.1"
stream-browserify "^2.0.0"
stream-http "^2.0.0"
string_decoder "~0.10.0"
subarg "^1.0.0"
syntax-error "^1.1.1"
through2 "^2.0.0"
timers-browserify "^1.0.1"
tty-browserify "~0.0.0"
url "~0.11.0"
util "~0.10.1"
vm-browserify "~0.0.1"
xtend "^4.0.0"
browserify@^14.0.0, browserify@^14.1.0:
version "14.3.0"
resolved "https://registry.yarnpkg.com/browserify/-/browserify-14.3.0.tgz#fd003a2386ac1aec127f097885a3cc6373b745c4"
dependencies:
JSONStream "^1.0.3"
assert "^1.4.0"
browser-pack "^6.0.1"
browser-resolve "^1.11.0"
browserify-zlib "~0.1.2"
buffer "^5.0.2"
cached-path-relative "^1.0.0"
concat-stream "~1.5.1"
console-browserify "^1.1.0"
constants-browserify "~1.0.0"
crypto-browserify "^3.0.0"
defined "^1.0.0"
deps-sort "^2.0.0"
domain-browser "~1.1.0"
duplexer2 "~0.1.2"
events "~1.1.0"
glob "^7.1.0"
has "^1.0.0"
htmlescape "^1.1.0"
https-browserify "^1.0.0"
inherits "~2.0.1"
insert-module-globals "^7.0.0"
labeled-stream-splicer "^2.0.0"
module-deps "^4.0.8"
os-browserify "~0.1.1"
parents "^1.0.1"
path-browserify "~0.0.0"
process "~0.11.0"
punycode "^1.3.2"
querystring-es3 "~0.2.0"
read-only-stream "^2.0.0"
readable-stream "^2.0.2"
resolve "^1.1.4"
shasum "^1.0.0"
shell-quote "^1.6.1"
stream-browserify "^2.0.0"
stream-http "^2.0.0"
string_decoder "~0.10.0"
subarg "^1.0.0"
syntax-error "^1.1.1"
through2 "^2.0.0"
timers-browserify "^1.0.1"
tty-browserify "~0.0.0"
url "~0.11.0"
util "~0.10.1"
vm-browserify "~0.0.1"
xtend "^4.0.0"
budo@^9.4.7:
version "9.4.7"
resolved "https://registry.yarnpkg.com/budo/-/budo-9.4.7.tgz#a6cdcf2572c22ed1331ae91f34a07f265b3dd20b"
dependencies:
bole "^2.0.0"
browserify "^13.0.1"
chokidar "^1.0.1"
connect-pushstate "^1.0.0"
escape-html "^1.0.3"
events "^1.0.2"
garnish "^5.0.0"
get-ports "^1.0.2"
http-proxy "^1.14.0"
inject-lr-script "^2.0.0"
internal-ip "^1.0.1"
micromatch "^2.2.0"
minimist "^1.1.0"
on-finished "^2.3.0"
on-headers "^1.0.1"
once "^1.3.2"
opn "^3.0.2"
pem "^1.8.3"
resolve "^1.1.6"
resp-modifier "^6.0.0"
serve-static "^1.10.0"
simple-html-index "^1.4.0"
stacked "^1.1.1"
stdout-stream "^1.4.0"
strip-ansi "^3.0.0"
term-color "^1.0.1"
tiny-lr "^0.2.0"
url-trim "^1.0.0"
watchify-middleware "^1.6.0"
xtend "^4.0.0"
buffer-equal@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-0.0.1.tgz#91bc74b11ea405bc916bc6aa908faafa5b4aac4b"
buffer-shims@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
buffer-xor@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9"
buffer@^4.1.0:
version "4.9.1"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298"
dependencies:
base64-js "^1.0.2"
ieee754 "^1.1.4"
isarray "^1.0.0"
buffer@^5.0.2:
version "5.0.6"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.6.tgz#2ea669f7eec0b6eda05b08f8b5ff661b28573588"
dependencies:
base64-js "^1.0.2"
ieee754 "^1.1.4"
builtin-modules@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
builtin-status-codes@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
bytes@2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-2.2.0.tgz#fd35464a403f6f9117c2de3609ecff9cae000588"
bytes@2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-2.4.0.tgz#7d97196f9d5baf7f6935e25985549edd2a6c2339"
cached-path-relative@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7"
caller-path@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
dependencies:
callsites "^0.2.0"
callsites@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
camelcase-keys@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7"
dependencies:
camelcase "^2.0.0"
map-obj "^1.0.0"
camelcase@^1.0.2:
version "1.2.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"
camelcase@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
center-align@^0.1.1:
version "0.1.3"
resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad"
dependencies:
align-text "^0.1.3"
lazy-cache "^1.0.3"
chalk@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174"
dependencies:
ansi-styles "^1.1.0"
escape-string-regexp "^1.0.0"
has-ansi "^0.1.0"
strip-ansi "^0.3.0"
supports-color "^0.2.0"
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"
chokidar@^1.0.0, chokidar@^1.0.1, chokidar@^1.6.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
dependencies:
anymatch "^1.3.0"
async-each "^1.0.0"
glob-parent "^2.0.0"
inherits "^2.0.1"
is-binary-path "^1.0.0"
is-glob "^2.0.0"
path-is-absolute "^1.0.0"
readdirp "^2.0.0"
optionalDependencies:
fsevents "^1.0.0"
cipher-base@^1.0.0, cipher-base@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07"
dependencies:
inherits "^2.0.1"
circular-json@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d"
cli-cursor@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987"
dependencies:
restore-cursor "^1.0.1"
cli-width@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a"
cliui@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
dependencies:
center-align "^0.1.1"
right-align "^0.1.1"
wordwrap "0.0.2"
co@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
colors@~0.6.0-1:
version "0.6.2"
resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc"
combine-source-map@~0.7.1:
version "0.7.2"
resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e"
dependencies:
convert-source-map "~1.1.0"
inline-source-map "~0.6.0"
lodash.memoize "~3.0.3"
source-map "~0.5.3"
combined-stream@^1.0.5, combined-stream@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
dependencies:
delayed-stream "~1.0.0"
commander@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.1.0.tgz#d121bbae860d9992a3d517ba96f56588e47c6781"
component-emitter@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
concat-stream@^1.0.0, concat-stream@^1.5.0, concat-stream@^1.5.2, concat-stream@~1.5.0, concat-stream@~1.5.1:
version "1.5.2"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266"
dependencies:
inherits "~2.0.1"
readable-stream "~2.0.0"
typedarray "~0.0.5"
concat-stream@~1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7"
dependencies:
inherits "^2.0.3"
readable-stream "^2.2.2"
typedarray "^0.0.6"
connect-pushstate@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/connect-pushstate/-/connect-pushstate-1.1.0.tgz#bcab224271c439604a0fb0f614c0a5f563e88e24"
console-browserify@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
dependencies:
date-now "^0.1.4"
console-control-strings@^1.0.0, console-control-strings@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
constants-browserify@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
content-disposition@0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4"
content-type@~1.0.1, content-type@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.2.tgz#b7d113aee7a8dd27bd21133c4dc2529df1721eed"
control-panel@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/control-panel/-/control-panel-1.2.0.tgz#a064f74c6da2de8c1ec2c4d8fa12a79ef9c8b89b"
dependencies:
brfs "^1.4.3"
dom-css "^2.0.0"
inherits "^2.0.1"
insert-css "^0.2.0"
is-numeric "0.0.5"
is-string "^1.0.4"
node-uuid "^1.4.7"
param-case "^1.1.2"
simple-color-picker "0.0.9"
tinycolor2 "^1.3.0"
convert-source-map@^1.1.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5"
convert-source-map@~1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860"
cookie-signature@1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
cookie@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
core-js@^2.4.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
"core-util-is@>=1.0.1 <1.1.0-0", core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
create-ecdh@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d"
dependencies:
bn.js "^4.1.0"
elliptic "^6.0.0"
create-hash@^1.1.0, create-hash@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad"
dependencies:
cipher-base "^1.0.1"
inherits "^2.0.1"
ripemd160 "^1.0.0"
sha.js "^2.3.6"
create-hmac@^1.1.0, create-hmac@^1.1.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170"
dependencies:
create-hash "^1.1.0"
inherits "^2.0.1"
cryptiles@2.x.x:
version "2.0.5"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
dependencies:
boom "2.x.x"
crypto-browserify@^3.0.0:
version "3.11.0"
resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522"
dependencies:
browserify-cipher "^1.0.0"
browserify-sign "^4.0.0"
create-ecdh "^4.0.0"
create-hash "^1.1.0"
create-hmac "^1.1.0"
diffie-hellman "^5.0.0"
inherits "^2.0.1"
pbkdf2 "^3.0.3"
public-encrypt "^4.0.0"
randombytes "^2.0.0"
cssauron@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/cssauron/-/cssauron-1.4.0.tgz#a6602dff7e04a8306dc0db9a551e92e8b5662ad8"
dependencies:
through X.X.X
currently-unhandled@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"
dependencies:
array-find-index "^1.0.1"
cwise-compiler@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/cwise-compiler/-/cwise-compiler-1.1.2.tgz#3bcbfd063bd1d69d25b3eebfc56df0de15d4c9d0"
dependencies:
uniq "^1.0.0"
cwise-parser@^1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/cwise-parser/-/cwise-parser-1.0.3.tgz#8e493c17d54f97cb030a9e9854bc86c9dfb354fe"
dependencies:
esprima "^1.0.3"
uniq "^1.0.0"
cwise@^1.0.10, cwise@^1.0.9:
version "1.0.10"
resolved "https://registry.yarnpkg.com/cwise/-/cwise-1.0.10.tgz#24eee6072ebdfd6b8c6f5dadb17090b649b12bef"
dependencies:
cwise-compiler "^1.1.1"
cwise-parser "^1.0.0"
static-module "^1.0.0"
uglify-js "^2.6.0"
d@1:
version "1.0.0"
resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f"
dependencies:
es5-ext "^0.10.9"
dashdash@^1.12.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
dependencies:
assert-plus "^1.0.0"
date-now@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
debounce@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.0.2.tgz#503cc674d8d7f737099664fb75ddbd36b9626dc6"
debug-log@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f"
debug@2.6.4:
version "2.6.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0"
dependencies:
ms "0.7.3"
debug@2.6.8:
version "2.6.8"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
dependencies:
ms "2.0.0"
debug@^2.1.1, debug@^2.2.0:
version "2.6.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a"
dependencies:
ms "0.7.3"
debug@~2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
dependencies:
ms "0.7.1"
decamelize@^1.0.0, decamelize@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
deep-equal@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"
deep-extend@~0.4.0:
version "0.4.1"
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253"
deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
define-properties@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
dependencies:
foreach "^2.0.5"
object-keys "^1.0.8"
defined@^1.0.0, defined@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"
deglob@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a"
dependencies:
find-root "^1.0.0"
glob "^7.0.5"
ignore "^3.0.9"
pkg-config "^1.1.0"
run-parallel "^1.1.2"
uniq "^1.0.1"
del@^2.0.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8"
dependencies:
globby "^5.0.0"
is-path-cwd "^1.0.0"
is-path-in-cwd "^1.0.0"
object-assign "^4.0.1"
pify "^2.0.0"
pinkie-promise "^2.0.0"
rimraf "^2.2.8"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
depd@1.1.0, depd@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3"
depd@1.1.1, depd@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359"
deps-sort@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5"
dependencies:
JSONStream "^1.0.3"
shasum "^1.0.0"
subarg "^1.0.0"
through2 "^2.0.0"
des.js@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc"
dependencies:
inherits "^2.0.1"
minimalistic-assert "^1.0.0"
destroy@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
detect-indent@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208"
dependencies:
repeating "^2.0.0"
detective@^4.0.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/detective/-/detective-4.5.0.tgz#6e5a8c6b26e6c7a254b1c6b6d7490d98ec91edd1"
dependencies:
acorn "^4.0.3"
defined "^1.0.0"
diffie-hellman@^5.0.0:
version "5.0.2"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e"
dependencies:
bn.js "^4.1.0"
miller-rabin "^4.0.0"
randombytes "^2.0.0"
doctrine@^1.2.2:
version "1.5.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa"
dependencies:
esutils "^2.0.2"
isarray "^1.0.0"
doctrine@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63"
dependencies:
esutils "^2.0.2"
isarray "^1.0.0"
dom-css@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/dom-css/-/dom-css-2.1.0.tgz#fdbc2d5a015d0a3e1872e11472bbd0e7b9e6a202"
dependencies:
add-px-to-style "1.0.0"
prefix-style "2.0.1"
to-camel-case "1.0.0"
dom-transform@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/dom-transform/-/dom-transform-1.0.1.tgz#5062848f71b3fbed8d41b1ca26d100713a443b23"
dependencies:
prefix "^0.2.1"
trim "0.0.1"
domain-browser@~1.1.0:
version "1.1.7"
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc"
duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
dependencies:
readable-stream "^2.0.2"
duplexer2@~0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db"
dependencies:
readable-stream "~1.1.9"
duplexify@^3.4.5:
version "3.5.0"
resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604"
dependencies:
end-of-stream "1.0.0"
inherits "^2.0.1"
readable-stream "^2.0.0"
stream-shift "^1.0.0"
eases@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/eases/-/eases-1.0.8.tgz#f1f5069a6b6ed2ea510f9c6110398d63efe9aee6"
ecc-jsbn@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"
dependencies:
jsbn "~0.1.0"
ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
elliptic@^6.0.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df"
dependencies:
bn.js "^4.4.0"
brorand "^1.0.1"
hash.js "^1.0.0"
hmac-drbg "^1.0.0"
inherits "^2.0.1"
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"
encodeurl@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20"
end-of-stream@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e"
dependencies:
once "~1.3.0"
ent@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d"
entities@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
error-ex@^1.2.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc"
dependencies:
is-arrayish "^0.2.1"
es-abstract@^1.5.0, es-abstract@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c"
dependencies:
es-to-primitive "^1.1.1"
function-bind "^1.1.0"
is-callable "^1.1.3"
is-regex "^1.0.3"
es-to-primitive@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
dependencies:
is-callable "^1.1.1"
is-date-object "^1.0.1"
is-symbol "^1.0.1"
es2040@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/es2040/-/es2040-1.2.5.tgz#a535dd7d4472ba346cde80e5d42fcdf939aa4f77"
dependencies:
babel-core "^6.9.1"
babel-preset-es2040 "^1.1.0"
through2 "^2.0.1"
es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14:
version "0.10.15"
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6"
dependencies:
es6-iterator "2"
es6-symbol "~3.1"
es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512"
dependencies:
d "1"
es5-ext "^0.10.14"
es6-symbol "^3.1"
es6-map@^0.1.3:
version "0.1.5"
resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0"
dependencies:
d "1"
es5-ext "~0.10.14"
es6-iterator "~2.0.1"
es6-set "~0.1.5"
es6-symbol "~3.1.1"
event-emitter "~0.3.5"
es6-set@~0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1"
dependencies:
d "1"
es5-ext "~0.10.14"
es6-iterator "~2.0.1"
es6-symbol "3.1.1"
event-emitter "~0.3.5"
es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77"
dependencies:
d "1"
es5-ext "~0.10.14"
es6-weak-map@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f"
dependencies:
d "1"
es5-ext "^0.10.14"
es6-iterator "^2.0.1"
es6-symbol "^3.1.1"
escape-html@^1.0.3, escape-html@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
escodegen@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018"
dependencies:
esprima "^2.7.1"
estraverse "^1.9.1"
esutils "^2.0.2"
optionator "^0.8.1"
optionalDependencies:
source-map "~0.2.0"
escodegen@~0.0.24:
version "0.0.28"
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-0.0.28.tgz#0e4ff1715f328775d6cab51ac44a406cd7abffd3"
dependencies:
esprima "~1.0.2"
estraverse "~1.3.0"
optionalDependencies:
source-map ">= 0.1.2"
escodegen@~1.3.2:
version "1.3.3"
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.3.3.tgz#f024016f5a88e046fd12005055e939802e6c5f23"
dependencies:
esprima "~1.1.1"
estraverse "~1.5.0"
esutils "~1.0.0"
optionalDependencies:
source-map "~0.1.33"
escope@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3"
dependencies:
es6-map "^0.1.3"
es6-weak-map "^2.0.1"
esrecurse "^4.1.0"
estraverse "^4.1.1"
eslint-config-standard-jsx@3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-3.3.0.tgz#cab0801a15a360bf63facb97ab22fbdd88d8a5e0"
eslint-config-standard@7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-7.1.0.tgz#47e769ea0739f5b2d5693b1a501c21c9650fafcf"
eslint-plugin-promise@~3.4.0:
version "3.4.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.4.2.tgz#1be2793eafe2d18b5b123b8136c269f804fe7122"
eslint-plugin-react@~6.9.0:
version "6.9.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.9.0.tgz#54c2e9906b76f9d10142030bdc34e9d6840a0bb2"
dependencies:
array.prototype.find "^2.0.1"
doctrine "^1.2.2"
jsx-ast-utils "^1.3.4"
eslint-plugin-standard@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-2.0.1.tgz#3589699ff9c917f2c25f76a916687f641c369ff3"
eslint@~3.18.0:
version "3.18.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b"
dependencies:
babel-code-frame "^6.16.0"
chalk "^1.1.3"
concat-stream "^1.5.2"
debug "^2.1.1"
doctrine "^2.0.0"
escope "^3.6.0"
espree "^3.4.0"
esquery "^1.0.0"
estraverse "^4.2.0"
esutils "^2.0.2"
file-entry-cache "^2.0.0"
glob "^7.0.3"
globals "^9.14.0"
ignore "^3.2.0"
imurmurhash "^0.1.4"
inquirer "^0.12.0"
is-my-json-valid "^2.10.0"
is-resolvable "^1.0.0"
js-yaml "^3.5.1"
json-stable-stringify "^1.0.0"
levn "^0.3.0"
lodash "^4.0.0"
mkdirp "^0.5.0"
natural-compare "^1.4.0"
optionator "^0.8.2"
path-is-inside "^1.0.1"
pluralize "^1.2.1"
progress "^1.1.8"
require-uncached "^1.0.2"
shelljs "^0.7.5"
strip-bom "^3.0.0"
strip-json-comments "~2.0.1"
table "^3.7.8"
text-table "~0.2.0"
user-home "^2.0.0"
espree@^3.4.0:
version "3.4.3"
resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374"
dependencies:
acorn "^5.0.1"
acorn-jsx "^3.0.0"
esprima@^1.0.3, esprima@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.1.1.tgz#5b6f1547f4d102e670e140c509be6771d6aeb549"
esprima@^2.7.1:
version "2.7.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
esprima@^3.1.1:
version "3.1.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
esprima@~1.0.2:
version "1.0.4"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad"
esquery@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa"
dependencies:
estraverse "^4.0.0"
esrecurse@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220"
dependencies:
estraverse "~4.1.0"
object-assign "^4.0.1"
estraverse@^1.9.1:
version "1.9.3"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44"
estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
estraverse@~1.3.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.3.2.tgz#37c2b893ef13d723f276d878d60d8535152a6c42"
estraverse@~1.5.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.5.1.tgz#867a3e8e58a9f84618afb6c2ddbcd916b7cbaf71"
estraverse@~4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2"
esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
esutils@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.0.0.tgz#8151d358e20c8acc7fb745e7472c0025fe496570"
etag@~1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051"
event-emitter@~0.3.5:
version "0.3.5"
resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39"
dependencies:
d "1"
es5-ext "~0.10.14"
eventemitter3@1.x.x:
version "1.2.0"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508"
events@^1.0.2, events@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
evp_bytestokey@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53"
dependencies:
create-hash "^1.1.1"
exit-hook@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8"
expand-brackets@^0.1.4:
version "0.1.5"
resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
dependencies:
is-posix-bracket "^0.1.0"
expand-range@^1.8.1:
version "1.8.2"
resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337"
dependencies:
fill-range "^2.1.0"
express@^4.14.0:
version "4.15.4"
resolved "https://registry.yarnpkg.com/express/-/express-4.15.4.tgz#032e2253489cf8fce02666beca3d11ed7a2daed1"
dependencies:
accepts "~1.3.3"
array-flatten "1.1.1"
content-disposition "0.5.2"
content-type "~1.0.2"
cookie "0.3.1"
cookie-signature "1.0.6"
debug "2.6.8"
depd "~1.1.1"
encodeurl "~1.0.1"
escape-html "~1.0.3"
etag "~1.8.0"
finalhandler "~1.0.4"
fresh "0.5.0"
merge-descriptors "1.0.1"
methods "~1.1.2"
on-finished "~2.3.0"
parseurl "~1.3.1"
path-to-regexp "0.1.7"
proxy-addr "~1.1.5"
qs "6.5.0"
range-parser "~1.2.0"
send "0.15.4"
serve-static "1.12.4"
setprototypeof "1.0.3"
statuses "~1.3.1"
type-is "~1.6.15"
utils-merge "1.0.0"
vary "~1.1.1"
extend@~3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
extglob@^0.3.1:
version "0.3.2"
resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1"
dependencies:
is-extglob "^1.0.0"
extsprintf@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
fail-nicely@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/fail-nicely/-/fail-nicely-2.0.0.tgz#d72895233827aa93e60a7a7e9e2ffbe827ed9600"
dependencies:
h "^0.1.0"
falafel@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/falafel/-/falafel-1.2.0.tgz#c18d24ef5091174a497f318cd24b026a25cddab4"
dependencies:
acorn "^1.0.3"
foreach "^2.0.5"
isarray "0.0.1"
object-keys "^1.0.6"
falafel@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.1.0.tgz#96bb17761daba94f46d001738b3cedf3a67fe06c"
dependencies:
acorn "^5.0.0"
foreach "^2.0.5"
isarray "0.0.1"
object-keys "^1.0.6"
fast-levenshtein@~2.0.4:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
faye-websocket@~0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4"
dependencies:
websocket-driver ">=0.5.1"
figures@^1.3.5:
version "1.7.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e"
dependencies:
escape-string-regexp "^1.0.5"
object-assign "^4.1.0"
file-entry-cache@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361"
dependencies:
flat-cache "^1.2.1"
object-assign "^4.0.1"
filename-regex@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
fill-range@^2.1.0:
version "2.2.3"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723"
dependencies:
is-number "^2.1.0"
isobject "^2.0.0"
randomatic "^1.1.3"
repeat-element "^1.1.2"
repeat-string "^1.5.2"
finalhandler@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.4.tgz#18574f2e7c4b98b8ae3b230c21f201f31bdb3fb7"
dependencies:
debug "2.6.8"
encodeurl "~1.0.1"
escape-html "~1.0.3"
on-finished "~2.3.0"
parseurl "~1.3.1"
statuses "~1.3.1"
unpipe "~1.0.0"
find-root@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.0.0.tgz#962ff211aab25c6520feeeb8d6287f8f6e95807a"
find-up@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
dependencies:
path-exists "^2.0.0"
pinkie-promise "^2.0.0"
find-up@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
dependencies:
locate-path "^2.0.0"
findup@^0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/findup/-/findup-0.1.5.tgz#8ad929a3393bac627957a7e5de4623b06b0e2ceb"
dependencies:
colors "~0.6.0-1"
commander "~2.1.0"
flat-cache@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96"
dependencies:
circular-json "^0.3.1"
del "^2.0.2"
graceful-fs "^4.1.2"
write "^0.2.1"
for-each@~0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4"
dependencies:
is-function "~1.0.0"
for-in@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
for-own@^0.1.4:
version "0.1.5"
resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce"
dependencies:
for-in "^1.0.1"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
form-data@~2.1.1:
version "2.1.4"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1"
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.5"
mime-types "^2.1.12"
forwarded@~0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.0.tgz#19ef9874c4ae1c297bcf078fde63a09b66a84363"
fresh@0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.0.tgz#f474ca5e6a9246d6fd8e0953cfa9b9c805afa78e"
from2-string@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/from2-string/-/from2-string-1.1.0.tgz#18282b27d08a267cb3030cd2b8b4b0f212af752a"
dependencies:
from2 "^2.0.3"
from2@^2.0.3, from2@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af"
dependencies:
inherits "^2.0.1"
readable-stream "^2.0.0"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
fsevents@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.1.tgz#f19fd28f43eeaf761680e519a203c4d0b3d31aff"
dependencies:
nan "^2.3.0"
node-pre-gyp "^0.6.29"
fstream-ignore@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105"
dependencies:
fstream "^1.0.0"
inherits "2"
minimatch "^3.0.0"
fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2:
version "1.0.11"
resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171"
dependencies:
graceful-fs "^4.1.2"
inherits "~2.0.0"
mkdirp ">=0.5 0"
rimraf "2"
function-bind@^1.0.2, function-bind@^1.1.0, function-bind@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"
garnish@^5.0.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/garnish/-/garnish-5.2.0.tgz#bed43659382e4b198e33c793897be7c701e65577"
dependencies:
chalk "^0.5.1"
minimist "^1.1.0"
pad-left "^2.0.0"
pad-right "^0.2.2"
prettier-bytes "^1.0.3"
pretty-ms "^2.1.0"
right-now "^1.0.0"
split2 "^0.2.1"
stdout-stream "^1.4.0"
url-trim "^1.0.0"
gauge@~2.7.3:
version "2.7.4"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
dependencies:
aproba "^1.0.3"
console-control-strings "^1.0.0"
has-unicode "^2.0.0"
object-assign "^4.1.0"
signal-exit "^3.0.0"
string-width "^1.0.1"
strip-ansi "^3.0.1"
wide-align "^1.1.0"
generate-function@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
generate-object-property@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0"
dependencies:
is-property "^1.0.0"
get-ports@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/get-ports/-/get-ports-1.0.3.tgz#f40bd580aca7ec0efb7b96cbfcbeb03ef894b5e8"
dependencies:
map-limit "0.0.1"
get-stdin@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
get-stdin@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
getpass@^0.1.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
dependencies:
assert-plus "^1.0.0"
github-cornerify@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/github-cornerify/-/github-cornerify-1.0.7.tgz#ca58bcd8e4421c8a586850b25c3865b2dd4e0a35"
dependencies:
hyperstream "^1.2.2"
minimist "^1.2.0"
pkg-up "^1.0.0"
stream-replace "^1.0.0"
stream-to-string "^1.1.0"
string-to-stream "^1.1.0"
uglifycss "^0.0.25"
util-extend "^1.0.3"
wrap-stream "^2.0.0"
glob-base@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
dependencies:
glob-parent "^2.0.0"
is-glob "^2.0.0"
glob-parent@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28"
dependencies:
is-glob "^2.0.0"
glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.0, glob@~7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.2"
once "^1.3.0"
path-is-absolute "^1.0.0"
globals@^9.0.0, globals@^9.14.0:
version "9.17.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286"
globby@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d"
dependencies:
array-union "^1.0.1"
arrify "^1.0.0"
glob "^7.0.3"
object-assign "^4.0.1"
pify "^2.0.0"
pinkie-promise "^2.0.0"
glsl-colormap@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/glsl-colormap/-/glsl-colormap-1.0.1.tgz#0ab16e4fe031edb53aad628cf8ebbf4fa48bf763"
glsl-inject-defines@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/glsl-inject-defines/-/glsl-inject-defines-1.0.3.tgz#dd1aacc2c17fcb2bd3fc32411c6633d0d7b60fd4"
dependencies:
glsl-token-inject-block "^1.0.0"
glsl-token-string "^1.0.1"
glsl-tokenizer "^2.0.2"
glsl-noise@^0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/glsl-noise/-/glsl-noise-0.0.0.tgz#367745f3a33382c0eeec4cb54b7e99cfc1d7670b"
glsl-resolve@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/glsl-resolve/-/glsl-resolve-0.0.1.tgz#894bef73910d792c81b5143180035d0a78af76d3"
dependencies:
resolve "^0.6.1"
xtend "^2.1.2"
glsl-token-assignments@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/glsl-token-assignments/-/glsl-token-assignments-2.0.2.tgz#a5d82ab78499c2e8a6b83cb69495e6e665ce019f"
glsl-token-defines@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/glsl-token-defines/-/glsl-token-defines-1.0.0.tgz#cb892aa959936231728470d4f74032489697fa9d"
dependencies:
glsl-tokenizer "^2.0.0"
glsl-token-depth@^1.1.0, glsl-token-depth@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/glsl-token-depth/-/glsl-token-depth-1.1.2.tgz#23c5e30ee2bd255884b4a28bc850b8f791e95d84"
glsl-token-descope@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/glsl-token-descope/-/glsl-token-descope-1.0.2.tgz#0fc90ab326186b82f597b2e77dc9e21efcd32076"
dependencies:
glsl-token-assignments "^2.0.0"
glsl-token-depth "^1.1.0"
glsl-token-properties "^1.0.0"
glsl-token-scope "^1.1.0"
glsl-token-inject-block@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/glsl-token-inject-block/-/glsl-token-inject-block-1.1.0.tgz#e1015f5980c1091824adaa2625f1dfde8bd00034"
glsl-token-properties@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/glsl-token-properties/-/glsl-token-properties-1.0.1.tgz#483dc3d839f0d4b5c6171d1591f249be53c28a9e"
glsl-token-scope@^1.1.0, glsl-token-scope@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz#a1728e78df24444f9cb93fd18ef0f75503a643b1"
glsl-token-string@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/glsl-token-string/-/glsl-token-string-1.0.1.tgz#59441d2f857de7c3449c945666021ece358e48ec"
glsl-token-whitespace-trim@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/glsl-token-whitespace-trim/-/glsl-token-whitespace-trim-1.0.0.tgz#46d1dfe98c75bd7d504c05d7d11b1b3e9cc93b10"
glsl-tokenizer@^2.0.0, glsl-tokenizer@^2.0.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/glsl-tokenizer/-/glsl-tokenizer-2.1.2.tgz#720307522e03c57af35c00551950c4a70ef2dfb9"
dependencies:
through2 "^0.6.3"
glslify-bundle@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/glslify-bundle/-/glslify-bundle-5.0.0.tgz#0252ada1ef9df30b660006e0bb21fd130b486e42"
dependencies:
glsl-inject-defines "^1.0.1"
glsl-token-defines "^1.0.0"
glsl-token-depth "^1.1.1"
glsl-token-descope "^1.0.2"
glsl-token-scope "^1.1.1"
glsl-token-string "^1.0.1"
glsl-token-whitespace-trim "^1.0.0"
glsl-tokenizer "^2.0.2"
murmurhash-js "^1.0.0"
shallow-copy "0.0.1"
glslify-deps@^1.2.5:
version "1.3.0"
resolved "https://registry.yarnpkg.com/glslify-deps/-/glslify-deps-1.3.0.tgz#0b2234c8ea9e3d3fd7f6b3cb7f03ae59e6b51a59"
dependencies:
events "^1.0.2"
findup "^0.1.5"
glsl-resolve "0.0.1"
glsl-tokenizer "^2.0.0"
graceful-fs "^4.1.2"
inherits "^2.0.1"
map-limit "0.0.1"
resolve "^1.0.0"
glslify@^6.0.1:
version "6.0.2"
resolved "https://registry.yarnpkg.com/glslify/-/glslify-6.0.2.tgz#9312362ff69ba2b818cf89eaf1618fa2a342cef8"
dependencies:
bl "^1.0.0"
concat-stream "^1.5.2"
duplexify "^3.4.5"
falafel "^2.0.0"
from2 "^2.3.0"
glsl-resolve "0.0.1"
glsl-token-whitespace-trim "^1.0.0"
glslify-bundle "^5.0.0"
glslify-deps "^1.2.5"
minimist "^1.2.0"
resolve "^1.1.5"
stack-trace "0.0.9"
static-eval "^1.1.1"
tape "^4.6.0"
through2 "^2.0.1"
xtend "^4.0.0"
graceful-fs@^4.1.2:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
h@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/h/-/h-0.1.0.tgz#24211fe1d9cef2b36cae8ff8255606ea12ecdfb5"
har-schema@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e"
har-validator@~4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a"
dependencies:
ajv "^4.9.1"
har-schema "^1.0.5"
has-ansi@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e"
dependencies:
ansi-regex "^0.2.0"
has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
dependencies:
ansi-regex "^2.0.0"
has-unicode@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
has@^1.0.0, has@^1.0.1, has@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
dependencies:
function-bind "^1.0.2"
hash.js@^1.0.0, hash.js@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573"
dependencies:
inherits "^2.0.1"
hawk@~3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
dependencies:
boom "2.x.x"
cryptiles "2.x.x"
hoek "2.x.x"
sntp "1.x.x"
hmac-drbg@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
dependencies:
hash.js "^1.0.3"
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"
hoek@2.x.x:
version "2.16.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
home-or-tmp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
dependencies:
os-homedir "^1.0.0"
os-tmpdir "^1.0.1"
hosted-git-info@^2.1.4:
version "2.4.2"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67"
hot-server@^0.0.11:
version "0.0.11"
resolved "https://registry.yarnpkg.com/hot-server/-/hot-server-0.0.11.tgz#a6b458e885ed403bf808ba131bbb55d7200c357a"
dependencies:
chokidar "^1.6.0"
express "^4.14.0"
minimist "^1.2.0"
serve-index "^1.8.0"
serve-static "^1.11.1"
ws "^1.1.1"
html-select@^2.3.5:
version "2.3.24"
resolved "https://registry.yarnpkg.com/html-select/-/html-select-2.3.24.tgz#46ad6d712e732cf31c6739d5d0110a5fabf17585"
dependencies:
cssauron "^1.1.0"
duplexer2 "~0.0.2"
inherits "^2.0.1"
minimist "~0.0.8"
readable-stream "^1.0.27-1"
split "~0.3.0"
stream-splicer "^1.2.0"
through2 "^1.0.0"
html-tokenize@^1.1.1:
version "1.2.5"
resolved "https://registry.yarnpkg.com/html-tokenize/-/html-tokenize-1.2.5.tgz#7e5ba99ecb51ef906ec9a7fcdee6ca3267c7897e"
dependencies:
inherits "~2.0.1"
minimist "~0.0.8"
readable-stream "~1.0.27-1"
through2 "~0.4.1"
htmlescape@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351"
http-errors@~1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.3.1.tgz#197e22cdebd4198585e8694ef6786197b91ed942"
dependencies:
inherits "~2.0.1"
statuses "1"
http-errors@~1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.1.tgz#5f8b8ed98aca545656bf572997387f904a722257"
dependencies:
depd "1.1.0"
inherits "2.0.3"
setprototypeof "1.0.3"
statuses ">= 1.3.1 < 2"
http-errors@~1.6.2:
version "1.6.2"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736"
dependencies:
depd "1.1.1"
inherits "2.0.3"
setprototypeof "1.0.3"
statuses ">= 1.3.1 < 2"
http-proxy@^1.14.0:
version "1.16.2"
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.16.2.tgz#06dff292952bf64dbe8471fa9df73066d4f37742"
dependencies:
eventemitter3 "1.x.x"
requires-port "1.x.x"
http-signature@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
dependencies:
assert-plus "^0.2.0"
jsprim "^1.2.2"
sshpk "^1.7.0"
https-browserify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
https-browserify@~0.0.0:
version "0.0.1"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82"
hyperstream@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/hyperstream/-/hyperstream-1.2.2.tgz#3adc79c6eb947a9ffb7430cfd06c6c769df0bb3d"
dependencies:
concat-stream "^1.0.0"
ent "^2.0.0"
stream-combiner2 "~1.0.1"
through2 "~0.5.1"
trumpet "^1.6.4"
utf8-stream "~0.0.0"
iconv-lite@0.4.13:
version "0.4.13"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2"
ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
ignore@^3.0.9, ignore@^3.2.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.0.tgz#3812d22cbe9125f2c2b4915755a1b8abd745a001"
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
indent-string@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80"
dependencies:
repeating "^2.0.0"
indexhtmlify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/indexhtmlify/-/indexhtmlify-1.3.1.tgz#884a8f0f18039597fbc278ce7f4ee28850faf463"
dependencies:
optimist "~0.6.0"
through2 "^0.4.1"
indexof@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
"individual@>=3.0.0 <3.1.0-0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/individual/-/individual-3.0.0.tgz#e7ca4f85f8957b018734f285750dc22ec2f9862d"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@2.0.3, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
inherits@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
ini@~1.3.0:
version "1.3.4"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e"
inject-lr-script@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/inject-lr-script/-/inject-lr-script-2.1.0.tgz#e61b5e84c118733906cbea01ec3d746698a39f65"
dependencies:
resp-modifier "^6.0.0"
inline-source-map@~0.6.0:
version "0.6.2"
resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5"
dependencies:
source-map "~0.5.3"
inquirer@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e"
dependencies:
ansi-escapes "^1.1.0"
ansi-regex "^2.0.0"
chalk "^1.0.0"
cli-cursor "^1.0.1"
cli-width "^2.0.0"
figures "^1.3.5"
lodash "^4.3.0"
readline2 "^1.0.1"
run-async "^0.1.0"
rx-lite "^3.1.2"
string-width "^1.0.1"
strip-ansi "^3.0.0"
through "^2.3.6"
insert-css@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/insert-css/-/insert-css-0.2.0.tgz#d15789971662d9899c28977fb6220d5381d2451a"
insert-module-globals@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.1.tgz#c03bf4e01cb086d5b5e5ace8ad0afe7889d638c3"
dependencies:
JSONStream "^1.0.3"
combine-source-map "~0.7.1"
concat-stream "~1.5.1"
is-buffer "^1.1.0"
lexical-scope "^1.2.0"
process "~0.11.0"
through2 "^2.0.0"
xtend "^4.0.0"
internal-ip@^1.0.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-1.2.0.tgz#ae9fbf93b984878785d50a8de1b356956058cf5c"
dependencies:
meow "^3.3.0"
interpret@^1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
invariant@^2.2.0:
version "2.2.2"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
dependencies:
loose-envify "^1.0.0"
iota-array@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/iota-array/-/iota-array-1.0.0.tgz#81ef57fe5d05814cd58c2483632a99c30a0e8087"
ipaddr.js@1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.4.0.tgz#296aca878a821816e5b85d0a285a99bcff4582f0"
is-arrayish@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
is-binary-path@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898"
dependencies:
binary-extensions "^1.0.0"
is-buffer@^1.0.2, is-buffer@^1.1.0, is-buffer@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc"
is-builtin-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe"
dependencies:
builtin-modules "^1.0.0"
is-callable@^1.1.1, is-callable@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
is-date-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
is-dotfile@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d"
is-equal-shallow@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534"
dependencies:
is-primitive "^2.0.0"
is-extendable@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
is-extglob@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0"
is-finite@^1.0.0, is-finite@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa"
dependencies:
number-is-nan "^1.0.0"
is-fullwidth-code-point@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
dependencies:
number-is-nan "^1.0.0"
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
is-function@~1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5"
is-glob@^2.0.0, is-glob@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863"
dependencies:
is-extglob "^1.0.0"
is-my-json-valid@^2.10.0:
version "2.16.0"
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693"
dependencies:
generate-function "^2.0.0"
generate-object-property "^1.1.0"
jsonpointer "^4.0.0"
xtend "^4.0.0"
is-number@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-1.1.2.tgz#9d82409f3a8a8beecf249b1bc7dada49829966e4"
is-number@^2.0.2, is-number@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
dependencies:
kind-of "^3.0.2"
is-numeric@0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/is-numeric/-/is-numeric-0.0.5.tgz#5f26778b3385005334344b1b5985ee7ea63316e6"
is-path-cwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
is-path-in-cwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc"
dependencies:
is-path-inside "^1.0.0"
is-path-inside@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f"
dependencies:
path-is-inside "^1.0.1"
is-posix-bracket@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4"
is-primitive@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
is-property@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
is-regex@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
dependencies:
has "^1.0.1"
is-resolvable@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62"
dependencies:
tryit "^1.0.1"
is-string@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
is-typedarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
is-utf8@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
isarray@0.0.1, isarray@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
isndarray@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isndarray/-/isndarray-1.0.0.tgz#67d1d08c61b8b00de8f03e234e030da70104005c"
isobject@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
dependencies:
isarray "1.0.0"
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
jodid25519@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967"
dependencies:
jsbn "~0.1.0"
js-tokens@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7"
js-yaml@^3.5.1:
version "3.8.4"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6"
dependencies:
argparse "^1.0.7"
esprima "^3.1.1"
jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
jsesc@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b"
json-schema@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af"
dependencies:
jsonify "~0.0.0"
json-stable-stringify@~0.0.0:
version "0.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45"
dependencies:
jsonify "~0.0.0"
"json-stringify-safe@>=5.0.0 <5.1.0-0", json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
json5@^0.5.0:
version "0.5.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
jsonify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
jsonparse@^1.2.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.0.tgz#85fc245b1d9259acc6941960b905adf64e7de0e8"
jsonpointer@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
jsprim@^1.2.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918"
dependencies:
assert-plus "1.0.0"
extsprintf "1.0.2"
json-schema "0.2.3"
verror "1.3.6"
jsx-ast-utils@^1.3.4:
version "1.4.1"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1"
kind-of@^3.0.2:
version "3.2.0"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.0.tgz#b58abe4d5c044ad33726a8c1525b48cf891bff07"
dependencies:
is-buffer "^1.1.5"
labeled-stream-splicer@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59"
dependencies:
inherits "^2.0.1"
isarray "~0.0.1"
stream-splicer "^2.0.0"
lazy-cache@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
levn@^0.3.0, levn@~0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
dependencies:
prelude-ls "~1.1.2"
type-check "~0.3.2"
lexical-scope@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4"
dependencies:
astw "^2.0.0"
livereload-js@^2.2.0:
version "2.2.2"
resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.2.2.tgz#6c87257e648ab475bc24ea257457edcc1f8d0bc2"
load-json-file@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"
dependencies:
graceful-fs "^4.1.2"
parse-json "^2.2.0"
pify "^2.0.0"
pinkie-promise "^2.0.0"
strip-bom "^2.0.0"
load-json-file@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
dependencies:
graceful-fs "^4.1.2"
parse-json "^2.2.0"
pify "^2.0.0"
strip-bom "^3.0.0"
locate-path@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
dependencies:
p-locate "^2.0.0"
path-exists "^3.0.0"
lodash._baseflatten@^3.0.0:
version "3.1.4"
resolved "https://registry.yarnpkg.com/lodash._baseflatten/-/lodash._baseflatten-3.1.4.tgz#0770ff80131af6e34f3b511796a7ba5214e65ff7"
dependencies:
lodash.isarguments "^3.0.0"
lodash.isarray "^3.0.0"
lodash._basefunctions@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._basefunctions/-/lodash._basefunctions-3.0.0.tgz#1bdffbadb4d2195c722968a02d56f4913413fcdb"
dependencies:
lodash.isfunction "^3.0.0"
lodash._createwrapper@^3.0.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/lodash._createwrapper/-/lodash._createwrapper-3.2.0.tgz#df453e664163217b895a454065af1c47a0ea3c4d"
dependencies:
lodash._root "^3.0.0"
lodash._root@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
lodash.bindall@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/lodash.bindall/-/lodash.bindall-3.1.0.tgz#72c7bd1aec8b56a9bc7d6b3484fdd4f2c7dc5469"
dependencies:
lodash._baseflatten "^3.0.0"
lodash._createwrapper "^3.0.0"
lodash.functions "^3.0.0"
lodash.restparam "^3.0.0"
lodash.functions@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash.functions/-/lodash.functions-3.0.0.tgz#4b037381a9f9276598869340086675d48cf3baf5"
dependencies:
lodash._basefunctions "^3.0.0"
lodash.keysin "^3.0.0"
lodash.isarguments@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
lodash.isarray@^3.0.0:
version "3.0.4"
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
lodash.isfunction@^3.0.0:
version "3.0.8"
resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.8.tgz#4db709fc81bc4a8fd7127a458a5346c5cdce2c6b"
lodash.keysin@^3.0.0:
version "3.0.8"
resolved "https://registry.yarnpkg.com/lodash.keysin/-/lodash.keysin-3.0.8.tgz#22c4493ebbedb1427962a54b445b2c8a767fb47f"
dependencies:
lodash.isarguments "^3.0.0"
lodash.isarray "^3.0.0"
lodash.memoize@~3.0.3:
version "3.0.4"
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f"
lodash.restparam@^3.0.0:
version "3.6.1"
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
lodash@^4.0.0, lodash@^4.2.0, lodash@^4.3.0:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
longest@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
loose-envify@^1.0.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
js-tokens "^3.0.0"
loud-rejection@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
dependencies:
currently-unhandled "^0.4.1"
signal-exit "^3.0.0"
lower-case@^1.1.1:
version "1.1.4"
resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac"
map-limit@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/map-limit/-/map-limit-0.0.1.tgz#eb7961031c0f0e8d001bf2d56fab685d58822f38"
dependencies:
once "~1.3.0"
map-obj@^1.0.0, map-obj@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d"
media-typer@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
meow@^3.3.0:
version "3.7.0"
resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb"
dependencies:
camelcase-keys "^2.0.0"
decamelize "^1.1.2"
loud-rejection "^1.0.0"
map-obj "^1.0.1"
minimist "^1.1.3"
normalize-package-data "^2.3.4"
object-assign "^4.0.1"
read-pkg-up "^1.0.1"
redent "^1.0.0"
trim-newlines "^1.0.0"
merge-descriptors@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
metadataify@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/metadataify/-/metadataify-1.0.3.tgz#7876b1418a7ebaffde94494dabccf1a38edec73b"
dependencies:
entities "^1.1.1"
hyperstream "^1.2.2"
minimist "^1.2.0"
pkg-up "^1.0.0"
methods@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
micromatch@^2.1.5, micromatch@^2.2.0:
version "2.3.11"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
dependencies:
arr-diff "^2.0.0"
array-unique "^0.2.1"
braces "^1.8.2"
expand-brackets "^0.1.4"
extglob "^0.3.1"
filename-regex "^2.0.0"
is-extglob "^1.0.0"
is-glob "^2.0.1"
kind-of "^3.0.2"
normalize-path "^2.0.1"
object.omit "^2.0.0"
parse-glob "^3.0.4"
regex-cache "^0.4.2"
miller-rabin@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d"
dependencies:
bn.js "^4.0.0"
brorand "^1.0.1"
mime-db@~1.27.0:
version "1.27.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1"
mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.15, mime-types@~2.1.7:
version "2.1.15"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed"
dependencies:
mime-db "~1.27.0"
mime@1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53"
minimalistic-assert@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3"
minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
minimatch@^3.0.0, minimatch@^3.0.2:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"
minimist@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0, minimist@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
minimist@~0.0.1, minimist@~0.0.8:
version "0.0.10"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
dependencies:
minimist "0.0.8"
module-deps@^4.0.8:
version "4.1.1"
resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd"
dependencies:
JSONStream "^1.0.3"
browser-resolve "^1.7.0"
cached-path-relative "^1.0.0"
concat-stream "~1.5.0"
defined "^1.0.0"
detective "^4.0.0"
duplexer2 "^0.1.2"
inherits "^2.0.1"
parents "^1.0.0"
readable-stream "^2.0.2"
resolve "^1.1.3"
stream-combiner2 "^1.1.1"
subarg "^1.0.0"
through2 "^2.0.0"
xtend "^4.0.0"
ms@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
ms@0.7.3:
version "0.7.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff"
ms@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-1.0.0.tgz#59adcd22edc543f7b5381862d31387b1f4bc9473"
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
murmurhash-js@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/murmurhash-js/-/murmurhash-js-1.0.0.tgz#b06278e21fc6c37fa5313732b0412bcb6ae15f51"
mute-stream@0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0"
nan@^2.3.0:
version "2.6.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
ndarray-fill@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/ndarray-fill/-/ndarray-fill-1.0.2.tgz#a30a60f7188e0c9582fcdd58896acdcb522a1ed6"
dependencies:
cwise "^1.0.10"
ndarray-linspace@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/ndarray-linspace/-/ndarray-linspace-2.0.3.tgz#ca7079ba0d58c87c0bb42021d5e4f7966898b791"
dependencies:
isndarray "^1.0.0"
ndarray-fill "^1.0.1"
validate.io-boolean "^1.0.4"
validate.io-nonnegative-integer "^1.0.0"
ndarray-vector-fill@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ndarray-vector-fill/-/ndarray-vector-fill-1.0.0.tgz#6543cb88aac2b6ead15559fbf36dac2fbf7b253f"
dependencies:
cwise "^1.0.9"
ndarray@^1.0.18:
version "1.0.18"
resolved "https://registry.yarnpkg.com/ndarray/-/ndarray-1.0.18.tgz#b60d3a73224ec555d0faa79711e502448fd3f793"
dependencies:
iota-array "^1.0.0"
is-buffer "^1.0.2"
negotiator@0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
node-pre-gyp@^0.6.29:
version "0.6.34"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7"
dependencies:
mkdirp "^0.5.1"
nopt "^4.0.1"
npmlog "^4.0.2"
rc "^1.1.7"
request "^2.81.0"
rimraf "^2.6.1"
semver "^5.3.0"
tar "^2.2.1"
tar-pack "^3.4.0"
node-uuid@^1.4.7:
version "1.4.8"
resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907"
nopt@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d"
dependencies:
abbrev "1"
osenv "^0.1.4"
normalize-package-data@^2.3.2, normalize-package-data@^2.3.4:
version "2.3.8"
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb"
dependencies:
hosted-git-info "^2.1.4"
is-builtin-module "^1.0.0"
semver "2 || 3 || 4 || 5"
validate-npm-package-license "^3.0.1"
normalize-path@^2.0.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
dependencies:
remove-trailing-separator "^1.0.1"
npmlog@^4.0.2:
version "4.1.0"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.0.tgz#dc59bee85f64f00ed424efb2af0783df25d1c0b5"
dependencies:
are-we-there-yet "~1.1.2"
console-control-strings "~1.1.0"
gauge "~2.7.3"
set-blocking "~2.0.0"
number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
oauth-sign@~0.8.1:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
object-assign@^4.0.1, object-assign@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
object-inspect@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-0.4.0.tgz#f5157c116c1455b243b06ee97703392c5ad89fec"
object-inspect@~1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.2.2.tgz#c82115e4fcc888aea14d64c22e4f17f6a70d5e5a"
object-keys@^1.0.6, object-keys@^1.0.8:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
object-keys@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336"
object.omit@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa"
dependencies:
for-own "^0.1.4"
is-extendable "^0.1.1"
on-finished@^2.3.0, on-finished@~2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
dependencies:
ee-first "1.1.1"
on-headers@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7"
once@^1.3.0, once@^1.3.2, once@^1.3.3:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
once@~1.3.0:
version "1.3.3"
resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20"
dependencies:
wrappy "1"
onetime@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789"
opn@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/opn/-/opn-3.0.3.tgz#b6d99e7399f78d65c3baaffef1fb288e9b85243a"
dependencies:
object-assign "^4.0.1"
optimist@~0.6.0:
version "0.6.1"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
dependencies:
minimist "~0.0.1"
wordwrap "~0.0.2"
optionator@^0.8.1, optionator@^0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
dependencies:
deep-is "~0.1.3"
fast-levenshtein "~2.0.4"
levn "~0.3.0"
prelude-ls "~1.1.2"
type-check "~0.3.2"
wordwrap "~1.0.0"
options@>=0.0.5:
version "0.0.6"
resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f"
os-browserify@~0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.1.2.tgz#49ca0293e0b19590a5f5de10c7f265a617d8fe54"
os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
os-tmpdir@^1.0.0, os-tmpdir@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
osenv@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644"
dependencies:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"
outpipe@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/outpipe/-/outpipe-1.1.1.tgz#50cf8616365e87e031e29a5ec9339a3da4725fa2"
dependencies:
shell-quote "^1.4.2"
p-limit@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc"
p-locate@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
dependencies:
p-limit "^1.1.0"
pad-left@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/pad-left/-/pad-left-2.1.0.tgz#16e6a3b2d44a8e138cb0838cc7cb403a4fc9e994"
dependencies:
repeat-string "^1.5.4"
pad-right@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/pad-right/-/pad-right-0.2.2.tgz#6fbc924045d244f2a2a244503060d3bfc6009774"
dependencies:
repeat-string "^1.5.2"
pako@~0.2.0:
version "0.2.9"
resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75"
param-case@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/param-case/-/param-case-1.1.2.tgz#dcb091a43c259b9228f1c341e7b6a44ea0bf9743"
dependencies:
sentence-case "^1.1.2"
parents@^1.0.0, parents@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751"
dependencies:
path-platform "~0.11.15"
parse-asn1@^5.0.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712"
dependencies:
asn1.js "^4.0.0"
browserify-aes "^1.0.0"
create-hash "^1.1.0"
evp_bytestokey "^1.0.0"
pbkdf2 "^3.0.3"
parse-glob@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
dependencies:
glob-base "^0.3.0"
is-dotfile "^1.0.0"
is-extglob "^1.0.0"
is-glob "^2.0.0"
parse-json@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
dependencies:
error-ex "^1.2.0"
parse-ms@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-1.0.1.tgz#56346d4749d78f23430ca0c713850aef91aa361d"
parseurl@~1.3.0, parseurl@~1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56"
path-browserify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a"
path-exists@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
dependencies:
pinkie-promise "^2.0.0"
path-exists@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
path-is-inside@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
path-parse@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
path-platform@~0.11.15:
version "0.11.15"
resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2"
path-to-regexp@0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
path-type@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
dependencies:
graceful-fs "^4.1.2"
pify "^2.0.0"
pinkie-promise "^2.0.0"
pbkdf2@^3.0.3:
version "3.0.9"
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693"
dependencies:
create-hmac "^1.1.2"
pem@^1.8.3:
version "1.9.7"
resolved "https://registry.yarnpkg.com/pem/-/pem-1.9.7.tgz#d387f996f292c7c9dea639a535805e74cb503161"
dependencies:
os-tmpdir "^1.0.1"
which "^1.2.4"
performance-now@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"
pify@^2.0.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
pinkie-promise@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
dependencies:
pinkie "^2.0.0"
pinkie@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
pkg-conf@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.0.0.tgz#071c87650403bccfb9c627f58751bfe47c067279"
dependencies:
find-up "^2.0.0"
load-json-file "^2.0.0"
pkg-config@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/pkg-config/-/pkg-config-1.1.1.tgz#557ef22d73da3c8837107766c52eadabde298fe4"
dependencies:
debug-log "^1.0.0"
find-root "^1.0.0"
xtend "^4.0.1"
pkg-up@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26"
dependencies:
find-up "^1.0.0"
plur@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/plur/-/plur-1.0.0.tgz#db85c6814f5e5e5a3b49efc28d604fec62975156"
pluralize@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45"
prefix-style@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/prefix-style/-/prefix-style-2.0.1.tgz#66bba9a870cfda308a5dc20e85e9120932c95a06"
prefix@^0.2.1:
version "0.2.6"
resolved "https://registry.yarnpkg.com/prefix/-/prefix-0.2.6.tgz#73971b0ddd18e129a6d601dda87a3f96d2e10674"
prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
prettier-bytes@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/prettier-bytes/-/prettier-bytes-1.0.3.tgz#932b31c23efddb36fc66a82dcef362af3122982f"
pretty-ms@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-2.1.0.tgz#4257c256df3fb0b451d6affaab021884126981dc"
dependencies:
is-finite "^1.0.1"
parse-ms "^1.0.0"
plur "^1.0.0"
private@^0.1.6:
version "0.1.7"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1"
process-nextick-args@~1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
process@~0.11.0:
version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
progress@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
promise-polyfill@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-1.1.6.tgz#cd04eff46f5c95c3a7d045591d79b5e3e01f12d7"
proxy-addr@~1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.5.tgz#71c0ee3b102de3f202f3b64f608d173fcba1a918"
dependencies:
forwarded "~0.1.0"
ipaddr.js "1.4.0"
public-encrypt@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6"
dependencies:
bn.js "^4.1.0"
browserify-rsa "^4.0.0"
create-hash "^1.1.0"
parse-asn1 "^5.0.0"
randombytes "^2.0.1"
punycode@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
punycode@^1.3.2, punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
qs@5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-5.2.0.tgz#a9f31142af468cb72b25b30136ba2456834916be"
qs@6.5.0:
version "6.5.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.0.tgz#8d04954d364def3efc55b5a0793e1e2c8b1e6e49"
qs@~5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-5.1.0.tgz#4d932e5c7ea411cca76a312d39a606200fd50cd9"
qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
querystring-es3@~0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
querystring@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
quote-stream@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-1.0.2.tgz#84963f8c9c26b942e153feeb53aae74652b7e0b2"
dependencies:
buffer-equal "0.0.1"
minimist "^1.1.3"
through2 "^2.0.0"
quote-stream@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-0.0.0.tgz#cde29e94c409b16e19dc7098b89b6658f9721d3b"
dependencies:
minimist "0.0.8"
through2 "~0.4.1"
randomatic@^1.1.3:
version "1.1.6"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb"
dependencies:
is-number "^2.0.2"
kind-of "^3.0.2"
randombytes@^2.0.0, randombytes@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec"
range-parser@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
raw-body@~2.1.5:
version "2.1.7"
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.1.7.tgz#adfeace2e4fb3098058014d08c072dcc59758774"
dependencies:
bytes "2.4.0"
iconv-lite "0.4.13"
unpipe "1.0.0"
rc@^1.1.7:
version "1.2.1"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95"
dependencies:
deep-extend "~0.4.0"
ini "~1.3.0"
minimist "^1.2.0"
strip-json-comments "~2.0.1"
read-only-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
dependencies:
readable-stream "^2.0.2"
read-pkg-up@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
dependencies:
find-up "^1.0.0"
read-pkg "^1.0.0"
read-pkg@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28"
dependencies:
load-json-file "^1.0.0"
normalize-package-data "^2.3.2"
path-type "^1.0.0"
"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@^1.0.27-1, readable-stream@~1.0.17, readable-stream@~1.0.2, readable-stream@~1.0.27-1:
version "1.0.34"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "0.0.1"
string_decoder "~0.10.x"
"readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.1.13-1, readable-stream@~1.1.9:
version "1.1.14"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "0.0.1"
string_decoder "~0.10.x"
readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.0, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.6:
version "2.2.9"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8"
dependencies:
buffer-shims "~1.0.0"
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
string_decoder "~1.0.0"
util-deprecate "~1.0.1"
readable-stream@~2.0.0:
version "2.0.6"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
string_decoder "~0.10.x"
util-deprecate "~1.0.1"
readable-wrap@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/readable-wrap/-/readable-wrap-1.0.0.tgz#3b5a211c631e12303a54991c806c17e7ae206bff"
dependencies:
readable-stream "^1.1.13-1"
readdirp@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78"
dependencies:
graceful-fs "^4.1.2"
minimatch "^3.0.2"
readable-stream "^2.0.2"
set-immediate-shim "^1.0.1"
readline2@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35"
dependencies:
code-point-at "^1.0.0"
is-fullwidth-code-point "^1.0.0"
mute-stream "0.0.5"
rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
dependencies:
resolve "^1.1.6"
redent@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde"
dependencies:
indent-string "^2.1.0"
strip-indent "^1.0.1"
regenerator-runtime@^0.10.0:
version "0.10.5"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
regex-cache@^0.4.2:
version "0.4.3"
resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145"
dependencies:
is-equal-shallow "^0.1.3"
is-primitive "^2.0.0"
regl@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/regl/-/regl-1.3.0.tgz#ccde82eff8a8a068a559581ceacbef1afea78ebd"
remove-trailing-separator@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4"
repeat-element@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a"
repeat-string@^1.5.2, repeat-string@^1.5.4:
version "1.6.1"
resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
repeating@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda"
dependencies:
is-finite "^1.0.0"
request@^2.81.0:
version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
dependencies:
aws-sign2 "~0.6.0"
aws4 "^1.2.1"
caseless "~0.12.0"
combined-stream "~1.0.5"
extend "~3.0.0"
forever-agent "~0.6.1"
form-data "~2.1.1"
har-validator "~4.2.1"
hawk "~3.1.3"
http-signature "~1.1.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.7"
oauth-sign "~0.8.1"
performance-now "^0.2.0"
qs "~6.4.0"
safe-buffer "^5.0.1"
stringstream "~0.0.4"
tough-cookie "~2.3.0"
tunnel-agent "^0.6.0"
uuid "^3.0.0"
require-uncached@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
dependencies:
caller-path "^0.1.0"
resolve-from "^1.0.0"
requires-port@1.x.x:
version "1.0.0"
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
resolve@1.1.7, resolve@~1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
resolve@^0.6.1:
version "0.6.3"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.6.3.tgz#dd957982e7e736debdf53b58a4dd91754575dd46"
resolve@^1.0.0, resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.5, resolve@^1.1.6:
version "1.3.3"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5"
dependencies:
path-parse "^1.0.5"
resp-modifier@^6.0.0:
version "6.0.2"
resolved "https://registry.yarnpkg.com/resp-modifier/-/resp-modifier-6.0.2.tgz#b124de5c4fbafcba541f48ffa73970f4aa456b4f"
dependencies:
debug "^2.2.0"
minimatch "^3.0.2"
restore-cursor@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541"
dependencies:
exit-hook "^1.0.0"
onetime "^1.0.0"
resumer@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759"
dependencies:
through "~2.3.4"
right-align@^0.1.1:
version "0.1.3"
resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef"
dependencies:
align-text "^0.1.1"
right-now@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/right-now/-/right-now-1.0.0.tgz#6e89609deebd7dcdaf8daecc9aea39cf585a0918"
rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d"
dependencies:
glob "^7.0.5"
ripemd160@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e"
run-async@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389"
dependencies:
once "^1.3.0"
run-parallel@^1.1.2:
version "1.1.6"
resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.6.tgz#29003c9a2163e01e2d2dfc90575f2c6c1d61a039"
rx-lite@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102"
safe-buffer@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7"
"semver@2 || 3 || 4 || 5", semver@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
send@0.15.2:
version "0.15.2"
resolved "https://registry.yarnpkg.com/send/-/send-0.15.2.tgz#f91fab4403bcf87e716f70ceb5db2f578bdc17d6"
dependencies:
debug "2.6.4"
depd "~1.1.0"
destroy "~1.0.4"
encodeurl "~1.0.1"
escape-html "~1.0.3"
etag "~1.8.0"
fresh "0.5.0"
http-errors "~1.6.1"
mime "1.3.4"
ms "1.0.0"
on-finished "~2.3.0"
range-parser "~1.2.0"
statuses "~1.3.1"
send@0.15.4:
version "0.15.4"
resolved "https://registry.yarnpkg.com/send/-/send-0.15.4.tgz#985faa3e284b0273c793364a35c6737bd93905b9"
dependencies:
debug "2.6.8"
depd "~1.1.1"
destroy "~1.0.4"
encodeurl "~1.0.1"
escape-html "~1.0.3"
etag "~1.8.0"
fresh "0.5.0"
http-errors "~1.6.2"
mime "1.3.4"
ms "2.0.0"
on-finished "~2.3.0"
range-parser "~1.2.0"
statuses "~1.3.1"
sentence-case@^1.1.2:
version "1.1.3"
resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-1.1.3.tgz#8034aafc2145772d3abe1509aa42c9e1042dc139"
dependencies:
lower-case "^1.1.1"
serve-index@^1.8.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.0.tgz#d2b280fc560d616ee81b48bf0fa82abed2485ce7"
dependencies:
accepts "~1.3.3"
batch "0.6.1"
debug "2.6.8"
escape-html "~1.0.3"
http-errors "~1.6.1"
mime-types "~2.1.15"
parseurl "~1.3.1"
serve-static@1.12.4:
version "1.12.4"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.4.tgz#9b6aa98eeb7253c4eedc4c1f6fdbca609901a961"
dependencies:
encodeurl "~1.0.1"
escape-html "~1.0.3"
parseurl "~1.3.1"
send "0.15.4"
serve-static@^1.10.0, serve-static@^1.11.1:
version "1.12.2"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.2.tgz#e546e2726081b81b4bcec8e90808ebcdd323afba"
dependencies:
encodeurl "~1.0.1"
escape-html "~1.0.3"
parseurl "~1.3.1"
send "0.15.2"
set-blocking@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
set-immediate-shim@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
setprototypeof@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
sha.js@^2.3.6, sha.js@~2.4.4:
version "2.4.8"
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f"
dependencies:
inherits "^2.0.1"
shallow-copy@0.0.1, shallow-copy@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170"
shasum@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f"
dependencies:
json-stable-stringify "~0.0.0"
sha.js "~2.4.4"
shell-quote@^1.4.2, shell-quote@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767"
dependencies:
array-filter "~0.0.0"
array-map "~0.0.0"
array-reduce "~0.0.0"
jsonify "~0.0.0"
shelljs@^0.7.5:
version "0.7.7"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1"
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"
signal-exit@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
simple-color-picker@0.0.9:
version "0.0.9"
resolved "https://registry.yarnpkg.com/simple-color-picker/-/simple-color-picker-0.0.9.tgz#096062ff5d67b48968de511cfc785b21d6f8392a"
dependencies:
component-emitter "^1.2.0"
dom-transform "^1.0.1"
is-number "^1.1.2"
lodash.bindall "^3.1.0"
tinycolor2 "^1.1.2"
simple-html-index@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/simple-html-index/-/simple-html-index-1.5.0.tgz#2c93eeaebac001d8a135fc0022bd4ade8f58996f"
dependencies:
from2-string "^1.1.0"
slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
slice-ansi@0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"
sntp@1.x.x:
version "1.0.9"
resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198"
dependencies:
hoek "2.x.x"
source-map-support@^0.4.2:
version "0.4.15"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1"
dependencies:
source-map "^0.5.6"
"source-map@>= 0.1.2", source-map@^0.5.0, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
source-map@~0.1.33:
version "0.1.43"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
dependencies:
amdefine ">=0.0.4"
source-map@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d"
dependencies:
amdefine ">=0.0.4"
spdx-correct@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40"
dependencies:
spdx-license-ids "^1.0.2"
spdx-expression-parse@~1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c"
spdx-license-ids@^1.0.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57"
split2@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/split2/-/split2-0.2.1.tgz#02ddac9adc03ec0bb78c1282ec079ca6e85ae900"
dependencies:
through2 "~0.6.1"
split@~0.3.0:
version "0.3.3"
resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f"
dependencies:
through "2"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
sshpk@^1.7.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.0.tgz#ff2a3e4fd04497555fed97b39a0fd82fafb3a33c"
dependencies:
asn1 "~0.2.3"
assert-plus "^1.0.0"
dashdash "^1.12.0"
getpass "^0.1.1"
optionalDependencies:
bcrypt-pbkdf "^1.0.0"
ecc-jsbn "~0.1.1"
jodid25519 "^1.0.0"
jsbn "~0.1.0"
tweetnacl "~0.14.0"
stack-trace@0.0.9:
version "0.0.9"
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.9.tgz#a8f6eaeca90674c333e7c43953f275b451510695"
stacked@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/stacked/-/stacked-1.1.1.tgz#2c7fa38cc7e37a3411a77cd8e792de448f9f6975"
standard-engine@~5.4.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-5.4.0.tgz#e0e86959ea0786425d3383e40c1bf70d2f985579"
dependencies:
deglob "^2.1.0"
get-stdin "^5.0.1"
home-or-tmp "^2.0.0"
minimist "^1.1.0"
pkg-conf "^2.0.0"
standard@^9.0.1:
version "9.0.2"
resolved "https://registry.yarnpkg.com/standard/-/standard-9.0.2.tgz#9bd3b9467492e212b1914d78553943ff9b48fd99"
dependencies:
eslint "~3.18.0"
eslint-config-standard "7.1.0"
eslint-config-standard-jsx "3.3.0"
eslint-plugin-promise "~3.4.0"
eslint-plugin-react "~6.9.0"
eslint-plugin-standard "~2.0.1"
standard-engine "~5.4.0"
static-eval@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-1.1.1.tgz#ca8130210354cf13d9a722bc7e923778457bb192"
dependencies:
escodegen "^1.8.1"
static-eval@~0.2.0:
version "0.2.4"
resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-0.2.4.tgz#b7d34d838937b969f9641ca07d48f8ede263ea7b"
dependencies:
escodegen "~0.0.24"
static-module@^1.0.0, static-module@^1.1.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/static-module/-/static-module-1.3.2.tgz#329fb9f223a566266bda71843b7d932c767174f3"
dependencies:
concat-stream "~1.6.0"
duplexer2 "~0.0.2"
escodegen "~1.3.2"
falafel "^1.0.0"
has "^1.0.0"
object-inspect "~0.4.0"
quote-stream "~0.0.0"
readable-stream "~1.0.27-1"
shallow-copy "~0.0.1"
static-eval "~0.2.0"
through2 "~0.4.1"
statuses@1, "statuses@>= 1.3.1 < 2", statuses@~1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e"
stdout-stream@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.0.tgz#a2c7c8587e54d9427ea9edb3ac3f2cd522df378b"
dependencies:
readable-stream "^2.0.1"
stream-browserify@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db"
dependencies:
inherits "~2.0.1"
readable-stream "^2.0.2"
stream-combiner2@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe"
dependencies:
duplexer2 "~0.1.0"
readable-stream "^2.0.2"
stream-combiner2@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.0.2.tgz#ba72a6b50cbfabfa950fc8bc87604bd01eb60671"
dependencies:
duplexer2 "~0.0.2"
through2 "~0.5.1"
stream-http@^2.0.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.0.tgz#cec1f4e3b494bc4a81b451808970f8b20b4ed5f6"
dependencies:
builtin-status-codes "^3.0.0"
inherits "^2.0.1"
readable-stream "^2.2.6"
to-arraybuffer "^1.0.0"
xtend "^4.0.0"
stream-replace@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/stream-replace/-/stream-replace-1.0.0.tgz#0acc0bf3275662666e48bc5da22c080700b2690d"
stream-shift@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952"
stream-splicer@^1.2.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-1.3.2.tgz#3c0441be15b9bf4e226275e6dc83964745546661"
dependencies:
indexof "0.0.1"
inherits "^2.0.1"
isarray "~0.0.1"
readable-stream "^1.1.13-1"
readable-wrap "^1.0.0"
through2 "^1.0.0"
stream-splicer@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83"
dependencies:
inherits "^2.0.1"
readable-stream "^2.0.2"
stream-to-string@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/stream-to-string/-/stream-to-string-1.1.0.tgz#39210b01317e6abb35e854538e013037b6a35940"
dependencies:
promise-polyfill "^1.1.6"
string-to-stream@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/string-to-stream/-/string-to-stream-1.1.0.tgz#acf2c9ead1c418e148509a12d2cbb469f333a218"
dependencies:
inherits "^2.0.1"
readable-stream "^2.1.0"
string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
dependencies:
code-point-at "^1.0.0"
is-fullwidth-code-point "^1.0.0"
strip-ansi "^3.0.0"
string-width@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e"
dependencies:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^3.0.0"
string.prototype.trim@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.5.0"
function-bind "^1.0.2"
string_decoder@~0.10.0, string_decoder@~0.10.x:
version "0.10.31"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
string_decoder@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667"
dependencies:
buffer-shims "~1.0.0"
stringstream@~0.0.4:
version "0.0.5"
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
strip-ansi@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220"
dependencies:
ansi-regex "^0.2.1"
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"
strip-bom@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
dependencies:
is-utf8 "^0.2.0"
strip-bom@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
strip-indent@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2"
dependencies:
get-stdin "^4.0.1"
strip-json-comments@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
subarg@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2"
dependencies:
minimist "^1.1.0"
supports-color@1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.3.1.tgz#15758df09d8ff3b4acc307539fabe27095e1042d"
supports-color@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a"
supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
syntax-error@^1.1.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.3.0.tgz#1ed9266c4d40be75dc55bf9bb1cb77062bb96ca1"
dependencies:
acorn "^4.0.3"
table@^3.7.8:
version "3.8.3"
resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f"
dependencies:
ajv "^4.7.0"
ajv-keywords "^1.0.0"
chalk "^1.1.1"
lodash "^4.0.0"
slice-ansi "0.0.4"
string-width "^2.0.0"
tape@^4.6.0:
version "4.6.3"
resolved "https://registry.yarnpkg.com/tape/-/tape-4.6.3.tgz#637e77581e9ab2ce17577e9bd4ce4f575806d8b6"
dependencies:
deep-equal "~1.0.1"
defined "~1.0.0"
for-each "~0.3.2"
function-bind "~1.1.0"
glob "~7.1.1"
has "~1.0.1"
inherits "~2.0.3"
minimist "~1.2.0"
object-inspect "~1.2.1"
resolve "~1.1.7"
resumer "~0.0.0"
string.prototype.trim "~1.1.2"
through "~2.3.8"
tar-pack@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984"
dependencies:
debug "^2.2.0"
fstream "^1.0.10"
fstream-ignore "^1.0.5"
once "^1.3.3"
readable-stream "^2.1.4"
rimraf "^2.5.1"
tar "^2.2.1"
uid-number "^0.0.6"
tar@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1"
dependencies:
block-stream "*"
fstream "^1.0.2"
inherits "2"
term-color@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/term-color/-/term-color-1.0.1.tgz#38e192553a473e35e41604ff5199846bf8117a3a"
dependencies:
ansi-styles "2.0.1"
supports-color "1.3.1"
text-table@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
through2@^0.4.1, through2@^0.4.2, through2@~0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/through2/-/through2-0.4.2.tgz#dbf5866031151ec8352bb6c4db64a2292a840b9b"
dependencies:
readable-stream "~1.0.17"
xtend "~2.1.1"
through2@^0.6.3, through2@~0.6.1:
version "0.6.5"
resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48"
dependencies:
readable-stream ">=1.0.33-1 <1.1.0-0"
xtend ">=4.0.0 <4.1.0-0"
through2@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/through2/-/through2-1.1.1.tgz#0847cbc4449f3405574dbdccd9bb841b83ac3545"
dependencies:
readable-stream ">=1.1.13-1 <1.2.0-0"
xtend ">=4.0.0 <4.1.0-0"
through2@^2.0.0, through2@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
dependencies:
readable-stream "^2.1.5"
xtend "~4.0.1"
through2@~0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/through2/-/through2-0.5.1.tgz#dfdd012eb9c700e2323fd334f38ac622ab372da7"
dependencies:
readable-stream "~1.0.17"
xtend "~3.0.0"
through@2, "through@>=2.2.7 <3", through@X.X.X, through@^2.3.6, through@~2.3.4, through@~2.3.8:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
timers-browserify@^1.0.1:
version "1.4.2"
resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d"
dependencies:
process "~0.11.0"
tiny-lr@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-0.2.1.tgz#b3fdba802e5d56a33c2f6f10794b32e477ac729d"
dependencies:
body-parser "~1.14.0"
debug "~2.2.0"
faye-websocket "~0.10.0"
livereload-js "^2.2.0"
parseurl "~1.3.0"
qs "~5.1.0"
tinycolor2@^1.1.2, tinycolor2@^1.3.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8"
to-arraybuffer@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43"
to-camel-case@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/to-camel-case/-/to-camel-case-1.0.0.tgz#1a56054b2f9d696298ce66a60897322b6f423e46"
dependencies:
to-space-case "^1.0.0"
to-fast-properties@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"
to-no-case@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/to-no-case/-/to-no-case-1.0.2.tgz#c722907164ef6b178132c8e69930212d1b4aa16a"
to-space-case@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/to-space-case/-/to-space-case-1.0.0.tgz#b052daafb1b2b29dc770cea0163e5ec0ebc9fc17"
dependencies:
to-no-case "^1.0.0"
tough-cookie@~2.3.0:
version "2.3.2"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a"
dependencies:
punycode "^1.4.1"
trim-newlines@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"
trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
trim@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd"
trumpet@^1.6.4:
version "1.7.2"
resolved "https://registry.yarnpkg.com/trumpet/-/trumpet-1.7.2.tgz#b02c69e465d171f55e44924bf9b5bdd20974c830"
dependencies:
duplexer2 "~0.0.2"
html-select "^2.3.5"
html-tokenize "^1.1.1"
inherits "^2.0.0"
readable-stream "^1.0.27-1"
through2 "^1.0.0"
tryit@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb"
tty-browserify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
dependencies:
safe-buffer "^5.0.1"
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
type-check@~0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
dependencies:
prelude-ls "~1.1.2"
type-is@~1.6.10, type-is@~1.6.15:
version "1.6.15"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410"
dependencies:
media-typer "0.3.0"
mime-types "~2.1.15"
typedarray@^0.0.6, typedarray@~0.0.5:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
uglify-js@^2.6.0, uglify-js@^2.8.13:
version "2.8.23"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.23.tgz#8230dd9783371232d62a7821e2cf9a817270a8a0"
dependencies:
source-map "~0.5.1"
yargs "~3.10.0"
optionalDependencies:
uglify-to-browserify "~1.0.0"
uglify-to-browserify@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
uglifycss@^0.0.25:
version "0.0.25"
resolved "https://registry.yarnpkg.com/uglifycss/-/uglifycss-0.0.25.tgz#bea72bf4979eacef13a302cf47b2d1af3f344197"
uid-number@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"
ultron@1.0.x:
version "1.0.2"
resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa"
umd@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e"
uniq@^1.0.0, uniq@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"
unpipe@1.0.0, unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
url-trim@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/url-trim/-/url-trim-1.0.0.tgz#40057e2f164b88e5daca7269da47e6d1dd837adc"
url@~0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
dependencies:
punycode "1.3.2"
querystring "0.2.0"
user-home@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f"
dependencies:
os-homedir "^1.0.0"
utf8-stream@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/utf8-stream/-/utf8-stream-0.0.0.tgz#05ce4107fceaf893a2c838fe63a1d423455c1fc4"
dependencies:
readable-stream "~1.0.2"
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
util-extend@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/util-extend/-/util-extend-1.0.3.tgz#a7c216d267545169637b3b6edc6ca9119e2ff93f"
util@0.10.3, util@~0.10.1:
version "0.10.3"
resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9"
dependencies:
inherits "2.0.1"
utils-merge@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8"
uuid@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1"
validate-npm-package-license@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc"
dependencies:
spdx-correct "~1.0.0"
spdx-expression-parse "~1.0.0"
validate.io-boolean@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/validate.io-boolean/-/validate.io-boolean-1.0.4.tgz#d6b7ade1f862d629ee4480a32dfdebb8fa9510a3"
validate.io-integer@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/validate.io-integer/-/validate.io-integer-1.0.5.tgz#168496480b95be2247ec443f2233de4f89878068"
dependencies:
validate.io-number "^1.0.3"
validate.io-nonnegative-integer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/validate.io-nonnegative-integer/-/validate.io-nonnegative-integer-1.0.0.tgz#8069243a08c5f98e95413c929dfd7b18f3f6f29f"
dependencies:
validate.io-integer "^1.0.5"
validate.io-number@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/validate.io-number/-/validate.io-number-1.0.3.tgz#f63ffeda248bf28a67a8d48e0e3b461a1665baf8"
vary@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.1.tgz#67535ebb694c1d52257457984665323f587e8d37"
verror@1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c"
dependencies:
extsprintf "1.0.2"
vm-browserify@~0.0.1:
version "0.0.4"
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73"
dependencies:
indexof "0.0.1"
watchify-middleware@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/watchify-middleware/-/watchify-middleware-1.6.0.tgz#6db6e28f0279de1ca1209ae4f1a7f063745877c4"
dependencies:
concat-stream "^1.5.0"
debounce "^1.0.0"
events "^1.0.2"
object-assign "^4.0.1"
strip-ansi "^3.0.0"
watchify "^3.3.1"
watchify@^3.3.1, watchify@^3.9.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/watchify/-/watchify-3.9.0.tgz#f075fd2e8a86acde84cedba6e5c2a0bedd523d9e"
dependencies:
anymatch "^1.3.0"
browserify "^14.0.0"
chokidar "^1.0.0"
defined "^1.0.0"
outpipe "^1.1.0"
through2 "^2.0.0"
xtend "^4.0.0"
websocket-driver@>=0.5.1:
version "0.6.5"
resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.6.5.tgz#5cb2556ceb85f4373c6d8238aa691c8454e13a36"
dependencies:
websocket-extensions ">=0.1.1"
websocket-extensions@>=0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7"
which@^1.2.4:
version "1.2.14"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
dependencies:
isexe "^2.0.0"
wide-align@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad"
dependencies:
string-width "^1.0.1"
window-size@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"
wordwrap@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
wordwrap@~0.0.2:
version "0.0.3"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
wordwrap@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
wrap-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/wrap-stream/-/wrap-stream-2.0.0.tgz#a800753de07a5e022b37a90de82f2ac0bd473830"
dependencies:
through2 "^0.4.2"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
write@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"
dependencies:
mkdirp "^0.5.1"
ws@^1.1.1:
version "1.1.4"
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.4.tgz#57f40d036832e5f5055662a397c4de76ed66bf61"
dependencies:
options ">=0.0.5"
ultron "1.0.x"
"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
xtend@^2.1.2, xtend@~2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b"
dependencies:
object-keys "~0.4.0"
xtend@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a"
yargs@~3.10.0:
version "3.10.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"
dependencies:
camelcase "^1.0.2"
cliui "^2.1.0"
decamelize "^1.0.0"
window-size "0.1.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment