Skip to content

Instantly share code, notes, and snippets.

@jschilli
Created September 9, 2011 16:52
Show Gist options
  • Save jschilli/1206724 to your computer and use it in GitHub Desktop.
Save jschilli/1206724 to your computer and use it in GitHub Desktop.
output from bpm failure
(function(program, execJS) { execJS(program) })(function() {
return eval("(function(){ // vim:set ts=4 sts=4 sw=4 st:\n// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License\n// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)\n// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified\n// -- fschaefer Florian Sch\\u00e4fer Copyright (C) 2010 MIT License\n// -- Irakli Gozalishvili Copyright (C) 2010 MIT License\n// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License\n\n/*!\n Copyright (c) 2009, 280 North Inc. http://280north.com/\n MIT License. http://github.com/280north/narwhal/blob/master/README.md\n*/\n\n(function (definition) {\n // RequireJS\n if (typeof define == \"function\") {\n define(function () {\n definition();\n });\n // CommonJS and <script>\n } else {\n definition();\n }\n\n})(function (undefined) {\n\n/**\n * Brings an environment as close to ECMAScript 5 compliance\n * as is possible with the facilities of erstwhile engines.\n *\n * ES5 Draft\n * http://www.ecma-international.org/publications/files/drafts/tc39-2009-050.pdf\n *\n * NOTE: this is a draft, and as such, the URL is subject to change. If the\n * link is broken, check in the parent directory for the latest TC39 PDF.\n * http://www.ecma-international.org/publications/files/drafts/\n *\n * Previous ES5 Draft\n * http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf\n * This is a broken link to the previous draft of ES5 on which most of the\n * numbered specification references and quotes herein were taken. Updating\n * these references and quotes to reflect the new document would be a welcome\n * volunteer project.\n *\n * @module\n */\n\n/*whatsupdoc*/\n\n//\n// Function\n// ========\n//\n\n// ES-5 15.3.4.5\n// http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf\n\nif (!Function.prototype.bind) {\n Function.prototype.bind = function bind(that) { // .length is 1\n // 1. Let Target be the this value.\n var target = this;\n // 2. If IsCallable(Target) is false, throw a TypeError exception.\n // XXX this gets pretty close, for all intents and purposes, letting\n // some duck-types slide\n if (typeof target.apply != \"function\" || typeof target.call != \"function\")\n return new TypeError();\n // 3. Let A be a new (possibly empty) internal list of all of the\n // argument values provided after thisArg (arg1, arg2 etc), in order.\n // XXX slicedArgs will stand in for \"A\" if used\n var args = slice.call(arguments, 1); // for normal call\n // 4. Let F be a new native ECMAScript object.\n // 9. Set the [[Prototype]] internal property of F to the standard\n // built-in Function prototype object as specified in 15.3.3.1.\n // 10. Set the [[Call]] internal property of F as described in\n // 15.3.4.5.1.\n // 11. Set the [[Construct]] internal property of F as described in\n // 15.3.4.5.2.\n // 12. Set the [[HasInstance]] internal property of F as described in\n // 15.3.4.5.3.\n // 13. The [[Scope]] internal property of F is unused and need not\n // exist.\n var bound = function () {\n\n if (this instanceof bound) {\n // 15.3.4.5.2 [[Construct]]\n // When the [[Construct]] internal method of a function object,\n // F that was created using the bind function is called with a\n // list of arguments ExtraArgs the following steps are taken:\n // 1. Let target be the value of F's [[TargetFunction]]\n // internal property.\n // 2. If target has no [[Construct]] internal method, a\n // TypeError exception is thrown.\n // 3. Let boundArgs be the value of F's [[BoundArgs]] internal\n // property.\n // 4. Let args be a new list containing the same values as the\n // list boundArgs in the same order followed by the same\n // values as the list ExtraArgs in the same order.\n\n var self = Object.create(target.prototype);\n var result = target.apply(\n self,\n args.concat(slice.call(arguments))\n );\n if (result !== null && Object(result) === result)\n return result;\n return self;\n\n } else {\n // 15.3.4.5.1 [[Call]]\n // When the [[Call]] internal method of a function object, F,\n // which was created using the bind function is called with a\n // this value and a list of arguments ExtraArgs the following\n // steps are taken:\n // 1. Let boundArgs be the value of F's [[BoundArgs]] internal\n // property.\n // 2. Let boundThis be the value of F's [[BoundThis]] internal\n // property.\n // 3. Let target be the value of F's [[TargetFunction]] internal\n // property.\n // 4. Let args be a new list containing the same values as the list\n // boundArgs in the same order followed by the same values as\n // the list ExtraArgs in the same order. 5. Return the\n // result of calling the [[Call]] internal method of target\n // providing boundThis as the this value and providing args\n // as the arguments.\n\n // equiv: target.call(this, ...boundArgs, ...args)\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n\n }\n\n };\n\n // XXX bound.length is never writable, so don't even try\n //\n // 16. The length own property of F is given attributes as specified in\n // 15.3.5.1.\n // TODO\n // 17. Set the [[Extensible]] internal property of F to true.\n // TODO\n // 18. Call the [[DefineOwnProperty]] internal method of F with\n // arguments \"caller\", PropertyDescriptor {[[Value]]: null,\n // [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]:\n // false}, and false.\n // TODO\n // 19. Call the [[DefineOwnProperty]] internal method of F with\n // arguments \"arguments\", PropertyDescriptor {[[Value]]: null,\n // [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]:\n // false}, and false.\n // TODO\n // NOTE Function objects created using Function.prototype.bind do not\n // have a prototype property.\n // XXX can't delete it in pure-js.\n return bound;\n };\n}\n\n// Shortcut to an often accessed properties, in order to avoid multiple\n// dereference that costs universally.\n// _Please note: Shortcuts are defined after `Function.prototype.bind` as we\n// us it in defining shortcuts.\nvar call = Function.prototype.call;\nvar prototypeOfArray = Array.prototype;\nvar prototypeOfObject = Object.prototype;\nvar slice = prototypeOfArray.slice;\nvar toString = prototypeOfObject.toString;\nvar owns = call.bind(prototypeOfObject.hasOwnProperty);\n\nvar defineGetter, defineSetter, lookupGetter, lookupSetter, supportsAccessors;\n// If JS engine supports accessors creating shortcuts.\nif ((supportsAccessors = owns(prototypeOfObject, \"__defineGetter__\"))) {\n defineGetter = call.bind(prototypeOfObject.__defineGetter__);\n defineSetter = call.bind(prototypeOfObject.__defineSetter__);\n lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);\n lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);\n}\n\n//\n// Array\n// =====\n//\n\n// ES5 15.4.3.2\nif (!Array.isArray) {\n Array.isArray = function isArray(obj) {\n return Object.prototype.toString.call(obj) == \"[object Array]\";\n };\n}\n\n// ES5 15.4.4.18\n// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach\nif (!Array.prototype.forEach) {\n Array.prototype.forEach = function forEach(fun /*, thisp*/) {\n var self = Object(this),\n thisp = arguments[1],\n i = 0,\n length = self.length >>> 0;\n\n // If no callback function or if callback is not a callable function\n if (!fun || !fun.call) {\n throw new TypeError();\n }\n\n while (i < length) {\n if (i in self) {\n // Invoke the callback function with call, passing arguments:\n // context, property value, property key, thisArg object context\n fun.call(thisp, self[i], i, self);\n }\n i++;\n }\n };\n}\n\n// ES5 15.4.4.19\n// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map\nif (!Array.prototype.map) {\n Array.prototype.map = function map(fun /*, thisp*/) {\n var self = Object(this);\n var length = self.length >>> 0;\n if (typeof fun != \"function\")\n throw new TypeError();\n var result = new Array(length);\n var thisp = arguments[1];\n for (var i = 0; i < length; i++) {\n if (i in self)\n result[i] = fun.call(thisp, self[i], i, self);\n }\n return result;\n };\n}\n\n// ES5 15.4.4.20\nif (!Array.prototype.filter) {\n Array.prototype.filter = function filter(fun /*, thisp */) {\n var self = Object(this);\n var length = self.length >>> 0;\n if (typeof fun != \"function\")\n throw new TypeError();\n var result = [];\n var thisp = arguments[1];\n for (var i = 0; i < length; i++)\n if (i in self && fun.call(thisp, self[i], i, self))\n result.push(self[i]);\n return result;\n };\n}\n\n// ES5 15.4.4.16\nif (!Array.prototype.every) {\n Array.prototype.every = function every(fun /*, thisp */) {\n if (this === void 0 || this === null)\n throw new TypeError();\n if (typeof fun !== \"function\")\n throw new TypeError();\n var self = Object(this);\n var length = self.length >>> 0;\n var thisp = arguments[1];\n for (var i = 0; i < length; i++) {\n if (i in self && !fun.call(thisp, self[i], i, self))\n return false;\n }\n return true;\n };\n}\n\n// ES5 15.4.4.17\n// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some\nif (!Array.prototype.some) {\n Array.prototype.some = function some(fun /*, thisp */) {\n if (this === void 0 || this === null)\n throw new TypeError();\n if (typeof fun !== \"function\")\n throw new TypeError();\n var self = Object(this);\n var length = self.length >>> 0;\n var thisp = arguments[1];\n for (var i = 0; i < length; i++) {\n if (i in self && fun.call(thisp, self[i], i, self))\n return true;\n }\n return false;\n };\n}\n\n// ES5 15.4.4.21\n// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce\nif (!Array.prototype.reduce) {\n Array.prototype.reduce = function reduce(fun /*, initial*/) {\n var self = Object(this);\n var length = self.length >>> 0;\n // Whether to include (... || fun instanceof RegExp)\n // in the following expression to trap cases where\n // the provided function was actually a regular\n // expression literal, which in V8 and\n // JavaScriptCore is a typeof \"function\". Only in\n // V8 are regular expression literals permitted as\n // reduce parameters, so it is desirable in the\n // general case for the shim to match the more\n // strict and common behavior of rejecting regular\n // expressions. However, the only case where the\n // shim is applied is IE's Trident (and perhaps very\n // old revisions of other engines). In Trident,\n // regular expressions are a typeof \"object\", so the\n // following guard alone is sufficient.\n if (Object.prototype.toString.call(fun) != \"[object Function]\")\n throw new TypeError();\n\n // no value to return if no initial value and an empty array\n if (!length && arguments.length == 1)\n throw new TypeError();\n\n var i = 0;\n var result;\n if (arguments.length >= 2) {\n result = arguments[1];\n } else {\n do {\n if (i in self) {\n result = self[i++];\n break;\n }\n\n // if array contains no values, no initial value to return\n if (++i >= length)\n throw new TypeError();\n } while (true);\n }\n\n for (; i < length; i++) {\n if (i in self)\n result = fun.call(null, result, self[i], i, self);\n }\n\n return result;\n };\n}\n\n// ES5 15.4.4.22\n// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight\nif (!Array.prototype.reduceRight) {\n Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {\n var self = Object(this);\n var length = self.length >>> 0;\n if (Object.prototype.toString.call(fun) != \"[object Function]\")\n throw new TypeError();\n // no value to return if no initial value, empty array\n if (!length && arguments.length == 1)\n throw new TypeError();\n\n var result, i = length - 1;\n if (arguments.length >= 2) {\n result = arguments[1];\n } else {\n do {\n if (i in self) {\n result = self[i--];\n break;\n }\n\n // if array contains no values, no initial value to return\n if (--i < 0)\n throw new TypeError();\n } while (true);\n }\n\n do {\n if (i in this)\n result = fun.call(null, result, self[i], i, self);\n } while (i--);\n\n return result;\n };\n}\n\n// ES5 15.4.4.14\n// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf\nif (!Array.prototype.indexOf) {\n Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {\n if (this === void 0 || this === null)\n throw new TypeError();\n var self = Object(this);\n var length = self.length >>> 0;\n if (!length)\n return -1;\n var i = 0;\n if (arguments.length > 1)\n i = toInteger(arguments[1]);\n // handle negative indices\n i = i >= 0 ? i : length - Math.abs(i);\n for (; i < length; i++) {\n if (i in self && self[i] === sought) {\n return i;\n }\n }\n return -1;\n }\n}\n\n// ES5 15.4.4.15\nif (!Array.prototype.lastIndexOf) {\n Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {\n if (this === void 0 || this === null)\n throw new TypeError();\n var self = Object(this);\n var length = self.length >>> 0;\n if (!length)\n return -1;\n var i = length - 1;\n if (arguments.length > 1)\n i = toInteger(arguments[1]);\n // handle negative indices\n i = i >= 0 ? i : length - Math.abs(i);\n for (; i >= 0; i--) {\n if (i in self && sought === self[i])\n return i;\n }\n return -1;\n };\n}\n\n//\n// Object\n// ======\n//\n\n// ES5 15.2.3.2\nif (!Object.getPrototypeOf) {\n // https://github.com/kriskowal/es5-shim/issues#issue/2\n // http://ejohn.org/blog/objectgetprototypeof/\n // recommended by fschaefer on github\n Object.getPrototypeOf = function getPrototypeOf(object) {\n return object.__proto__ || object.constructor.prototype;\n // or undefined if not available in this engine\n };\n}\n\n// ES5 15.2.3.3\nif (!Object.getOwnPropertyDescriptor) {\n var ERR_NON_OBJECT = \"Object.getOwnPropertyDescriptor called on a \" +\n \"non-object: \";\n Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {\n if ((typeof object != \"object\" && typeof object != \"function\") || object === null)\n throw new TypeError(ERR_NON_OBJECT + object);\n // If object does not owns property return undefined immediately.\n if (!owns(object, property))\n return undefined;\n\n var descriptor, getter, setter;\n\n // If object has a property then it's for sure both `enumerable` and\n // `configurable`.\n descriptor = { enumerable: true, configurable: true };\n\n // If JS engine supports accessor properties then property may be a\n // getter or setter.\n if (supportsAccessors) {\n // Unfortunately `__lookupGetter__` will return a getter even\n // if object has own non getter property along with a same named\n // inherited getter. To avoid misbehavior we temporary remove\n // `__proto__` so that `__lookupGetter__` will return getter only\n // if it's owned by an object.\n var prototype = object.__proto__;\n object.__proto__ = prototypeOfObject;\n\n var getter = lookupGetter(object, property);\n var setter = lookupSetter(object, property);\n\n // Once we have getter and setter we can put values back.\n object.__proto__ = prototype;\n\n if (getter || setter) {\n if (getter) descriptor.get = getter;\n if (setter) descriptor.set = setter;\n\n // If it was accessor property we're done and return here\n // in order to avoid adding `value` to the descriptor.\n return descriptor;\n }\n }\n\n // If we got this far we know that object has an own property that is\n // not an accessor so we set it as a value and return descriptor.\n descriptor.value = object[property];\n return descriptor;\n };\n}\n\n// ES5 15.2.3.4\nif (!Object.getOwnPropertyNames) {\n Object.getOwnPropertyNames = function getOwnPropertyNames(object) {\n return Object.keys(object);\n };\n}\n\n// ES5 15.2.3.5\nif (!Object.create) {\n Object.create = function create(prototype, properties) {\n var object;\n if (prototype === null) {\n object = { \"__proto__\": null };\n } else {\n if (typeof prototype != \"object\")\n throw new TypeError(\"typeof prototype[\"+(typeof prototype)+\"] != 'object'\");\n var Type = function () {};\n Type.prototype = prototype;\n object = new Type();\n // IE has no built-in implementation of `Object.getPrototypeOf`\n // neither `__proto__`, but this manually setting `__proto__` will\n // guarantee that `Object.getPrototypeOf` will work as expected with\n // objects created using `Object.create`\n object.__proto__ = prototype;\n }\n if (typeof properties != \"undefined\")\n Object.defineProperties(object, properties);\n return object;\n };\n}\n\n// ES5 15.2.3.6\nvar oldDefineProperty = Object.defineProperty;\nvar defineProperty = !!oldDefineProperty;\nif (defineProperty) {\n // detect IE 8's DOM-only implementation of defineProperty;\n var subject = {};\n Object.defineProperty(subject, \"\", {});\n defineProperty = \"\" in subject;\n}\nif (!defineProperty) {\n var ERR_NON_OBJECT_DESCRIPTOR = \"Property description must be an object: \";\n var ERR_NON_OBJECT_TARGET = \"Object.defineProperty called on non-object: \"\n var ERR_ACCESSORS_NOT_SUPPORTED = \"getters & setters can not be defined \" +\n \"on this javascript engine\";\n\n Object.defineProperty = function defineProperty(object, property, descriptor) {\n if (typeof object != \"object\" && typeof object != \"function\")\n throw new TypeError(ERR_NON_OBJECT_TARGET + object);\n if (typeof descriptor != \"object\" || descriptor === null)\n throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);\n // make a valiant attempt to use the real defineProperty\n // for I8's DOM elements.\n if (oldDefineProperty && object.nodeType)\n return oldDefineProperty(object, property, descriptor);\n\n // If it's a data property.\n if (owns(descriptor, \"value\")) {\n // fail silently if \"writable\", \"enumerable\", or \"configurable\"\n // are requested but not supported\n /*\n // alternate approach:\n if ( // can't implement these features; allow false but not true\n !(owns(descriptor, \"writable\") ? descriptor.writable : true) ||\n !(owns(descriptor, \"enumerable\") ? descriptor.enumerable : true) ||\n !(owns(descriptor, \"configurable\") ? descriptor.configurable : true)\n )\n throw new RangeError(\n \"This implementation of Object.defineProperty does not \" +\n \"support configurable, enumerable, or writable.\"\n );\n */\n\n if (supportsAccessors && (lookupGetter(object, property) ||\n lookupSetter(object, property)))\n {\n // As accessors are supported only on engines implementing\n // `__proto__` we can safely override `__proto__` while defining\n // a property to make sure that we don't hit an inherited\n // accessor.\n var prototype = object.__proto__;\n object.__proto__ = prototypeOfObject;\n // Deleting a property anyway since getter / setter may be\n // defined on object itself.\n delete object[property];\n object[property] = descriptor.value;\n // Setting original `__proto__` back now.\n object.__proto__ = prototype;\n } else {\n object[property] = descriptor.value;\n }\n } else {\n if (!supportsAccessors)\n throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);\n // If we got that far then getters and setters can be defined !!\n if (owns(descriptor, \"get\"))\n defineGetter(object, property, descriptor.get);\n if (owns(descriptor, \"set\"))\n defineSetter(object, property, descriptor.set);\n }\n\n return object;\n };\n}\n\n// ES5 15.2.3.7\nif (!Object.defineProperties) {\n Object.defineProperties = function defineProperties(object, properties) {\n for (var property in properties) {\n if (owns(properties, property))\n Object.defineProperty(object, property, properties[property]);\n }\n return object;\n };\n}\n\n// ES5 15.2.3.8\nif (!Object.seal) {\n Object.seal = function seal(object) {\n // this is misleading and breaks feature-detection, but\n // allows \"securable\" code to \"gracefully\" degrade to working\n // but insecure code.\n return object;\n };\n}\n\n// ES5 15.2.3.9\nif (!Object.freeze) {\n Object.freeze = function freeze(object) {\n // this is misleading and breaks feature-detection, but\n // allows \"securable\" code to \"gracefully\" degrade to working\n // but insecure code.\n return object;\n };\n}\n\n// detect a Rhino bug and patch it\ntry {\n Object.freeze(function () {});\n} catch (exception) {\n Object.freeze = (function freeze(freezeObject) {\n return function freeze(object) {\n if (typeof object == \"function\") {\n return object;\n } else {\n return freezeObject(object);\n }\n };\n })(Object.freeze);\n}\n\n// ES5 15.2.3.10\nif (!Object.preventExtensions) {\n Object.preventExtensions = function preventExtensions(object) {\n // this is misleading and breaks feature-detection, but\n // allows \"securable\" code to \"gracefully\" degrade to working\n // but insecure code.\n return object;\n };\n}\n\n// ES5 15.2.3.11\nif (!Object.isSealed) {\n Object.isSealed = function isSealed(object) {\n return false;\n };\n}\n\n// ES5 15.2.3.12\nif (!Object.isFrozen) {\n Object.isFrozen = function isFrozen(object) {\n return false;\n };\n}\n\n// ES5 15.2.3.13\nif (!Object.isExtensible) {\n Object.isExtensible = function isExtensible(object) {\n return true;\n };\n}\n\n// ES5 15.2.3.14\n// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation\nif (!Object.keys) {\n\n var hasDontEnumBug = true,\n dontEnums = [\n \"toString\",\n \"toLocaleString\",\n \"valueOf\",\n \"hasOwnProperty\",\n \"isPrototypeOf\",\n \"propertyIsEnumerable\",\n \"constructor\"\n ],\n dontEnumsLength = dontEnums.length;\n\n for (var key in {\"toString\": null})\n hasDontEnumBug = false;\n\n Object.keys = function keys(object) {\n\n if (\n typeof object != \"object\" && typeof object != \"function\"\n || object === null\n )\n throw new TypeError(\"Object.keys called on a non-object\");\n\n var keys = [];\n for (var name in object) {\n if (owns(object, name)) {\n keys.push(name);\n }\n }\n\n if (hasDontEnumBug) {\n for (var i = 0, ii = dontEnumsLength; i < ii; i++) {\n var dontEnum = dontEnums[i];\n if (owns(object, dontEnum)) {\n keys.push(dontEnum);\n }\n }\n }\n\n return keys;\n };\n\n}\n\n//\n// Date\n// ====\n//\n\n// ES5 15.9.5.43\n// Format a Date object as a string according to a simplified subset of the ISO 8601\n// standard as defined in 15.9.1.15.\nif (!Date.prototype.toISOString) {\n Date.prototype.toISOString = function toISOString() {\n var result, length, value;\n if (!isFinite(this))\n throw new RangeError;\n\n // the date time string format is specified in 15.9.1.15.\n result = [this.getUTCFullYear(), this.getUTCMonth() + 1, this.getUTCDate(),\n this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];\n\n length = result.length;\n while (length--) {\n value = result[length];\n // pad months, days, hours, minutes, and seconds to have two digits.\n if (value < 10)\n result[length] = \"0\" + value;\n }\n // pad milliseconds to have three digits.\n return result.slice(0, 3).join(\"-\") + \"T\" + result.slice(3).join(\":\") + \".\" +\n (\"000\" + this.getUTCMilliseconds()).slice(-3) + \"Z\";\n }\n}\n\n// ES5 15.9.4.4\nif (!Date.now) {\n Date.now = function now() {\n return new Date().getTime();\n };\n}\n\n// ES5 15.9.5.44\nif (!Date.prototype.toJSON) {\n Date.prototype.toJSON = function toJSON(key) {\n // This function provides a String representation of a Date object for\n // use by JSON.stringify (15.12.3). When the toJSON method is called\n // with argument key, the following steps are taken:\n\n // 1. Let O be the result of calling ToObject, giving it the this\n // value as its argument.\n // 2. Let tv be ToPrimitive(O, hint Number).\n // 3. If tv is a Number and is not finite, return null.\n // XXX\n // 4. Let toISO be the result of calling the [[Get]] internal method of\n // O with argument \"toISOString\".\n // 5. If IsCallable(toISO) is false, throw a TypeError exception.\n // XXX this gets pretty close, for all intents and purposes, letting\n // some duck-types slide\n if (typeof this.toISOString.call != \"function\")\n throw new TypeError();\n // 6. Return the result of calling the [[Call]] internal method of\n // toISO with O as the this value and an empty argument list.\n return this.toISOString.call(this);\n\n // NOTE 1 The argument is ignored.\n\n // NOTE 2 The toJSON function is intentionally generic; it does not\n // require that its this value be a Date object. Therefore, it can be\n // transferred to other kinds of objects for use as a method. However,\n // it does require that any such object have a toISOString method. An\n // object is free to use the argument key to filter its\n // stringification.\n };\n}\n\n// 15.9.4.2 Date.parse (string)\n// 15.9.1.15 Date Time String Format\n// Date.parse\n// based on work shared by Daniel Friesen (dantman)\n// http://gist.github.com/303249\nif (isNaN(Date.parse(\"2011-06-15T21:40:05+06:00\"))) {\n // XXX global assignment won't work in embeddings that use\n // an alternate object for the context.\n Date = (function(NativeDate) {\n\n // Date.length === 7\n var Date = function(Y, M, D, h, m, s, ms) {\n var length = arguments.length;\n if (this instanceof NativeDate) {\n var date = length == 1 && String(Y) === Y ? // isString(Y)\n // We explicitly pass it through parse:\n new NativeDate(Date.parse(Y)) :\n // We have to manually make calls depending on argument\n // length here\n length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :\n length >= 6 ? new NativeDate(Y, M, D, h, m, s) :\n length >= 5 ? new NativeDate(Y, M, D, h, m) :\n length >= 4 ? new NativeDate(Y, M, D, h) :\n length >= 3 ? new NativeDate(Y, M, D) :\n length >= 2 ? new NativeDate(Y, M) :\n length >= 1 ? new NativeDate(Y) :\n new NativeDate();\n // Prevent mixups with unfixed Date object\n date.constructor = Date;\n return date;\n }\n return NativeDate.apply(this, arguments);\n };\n\n // 15.9.1.15 Date Time String Format. This pattern does not implement\n // extended years ((15.9.1.15.1), as `Date.UTC` cannot parse them.\n var isoDateExpression = new RegExp(\"^\" +\n \"(\\\\d{4})\" + // four-digit year capture\n \"(?:-(\\\\d{2})\" + // optional month capture\n \"(?:-(\\\\d{2})\" + // optional day capture\n \"(?:\" + // capture hours:minutes:seconds.milliseconds\n \"T(\\\\d{2})\" + // hours capture\n \":(\\\\d{2})\" + // minutes capture\n \"(?:\" + // optional :seconds.milliseconds\n \":(\\\\d{2})\" + // seconds capture\n \"(?:\\\\.(\\\\d{3}))?\" + // milliseconds capture\n \")?\" +\n \"(?:\" + // capture UTC offset component\n \"Z|\" + // UTC capture\n \"(?:\" + // offset specifier +/-hours:minutes\n \"([-+])\" + // sign capture\n \"(\\\\d{2})\" + // hours offset capture\n \":(\\\\d{2})\" + // minutes offest capture\n \")\" +\n \")?)?)?)?\" +\n \"$\");\n\n // Copy any custom methods a 3rd party library may have added\n for (var key in NativeDate)\n Date[key] = NativeDate[key];\n\n // Copy \"native\" methods explicitly; they may be non-enumerable\n Date.now = NativeDate.now;\n Date.UTC = NativeDate.UTC;\n Date.prototype = NativeDate.prototype;\n Date.prototype.constructor = Date;\n\n // Upgrade Date.parse to handle simplified ISO 8601 strings\n Date.parse = function parse(string) {\n var match = isoDateExpression.exec(string);\n if (match) {\n match.shift(); // kill match[0], the full match\n // parse months, days, hours, minutes, seconds, and milliseconds\n for (var i = 1; i < 7; i++) {\n // provide default values if necessary\n match[i] = +(match[i] || (i < 3 ? 1 : 0));\n // match[1] is the month. Months are 0-11 in JavaScript\n // `Date` objects, but 1-12 in ISO notation, so we\n // decrement.\n if (i == 1)\n match[i]--;\n }\n\n // parse the UTC offset component\n var minutesOffset = +match.pop(), hourOffset = +match.pop(), sign = match.pop();\n\n // compute the explicit time zone offset if specified\n var offset = 0;\n if (sign) {\n // detect invalid offsets and return early\n if (hourOffset > 23 || minuteOffset > 59)\n return NaN;\n\n // express the provided time zone offset in minutes. The offset is\n // negative for time zones west of UTC; positive otherwise.\n offset = (hourOffset * 60 + minuteOffset) * 6e4 * (sign == \"+\" ? -1 : 1);\n }\n\n // compute a new UTC date value, accounting for the optional offset\n return NativeDate.UTC.apply(this, match) + offset;\n }\n return NativeDate.parse.apply(this, arguments);\n };\n\n return Date;\n })(Date);\n}\n\n//\n// String\n// ======\n//\n\n// ES5 15.5.4.20\nvar ws = \"\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF\";\nif (!String.prototype.trim || ws.trim()) {\n // http://blog.stevenlevithan.com/archives/faster-trim-javascript\n // http://perfectionkills.com/whitespace-deviations/\n ws = \"[\" + ws + \"]\";\n var trimBeginRegexp = new RegExp(\"^\" + ws + ws + \"*\"),\n trimEndRegexp = new RegExp(ws + ws + \"*$\");\n String.prototype.trim = function trim() {\n return String(this).replace(trimBeginRegexp, \"\").replace(trimEndRegexp, \"\");\n };\n}\n\n//\n// Util\n// ======\n//\n\n// http://jsperf.com/to-integer\nvar toInteger = function (n) {\n n = +n;\n if (n !== n) // isNaN\n n = -1;\n else if (n !== 0 && n !== (1/0) && n !== -(1/0))\n n = (n > 0 || -1) * Math.floor(Math.abs(n));\n return n;\n};\n\n});\n\n window={};\n if (typeof BPM_PLUGIN === 'undefined') BPM_PLUGIN={};\n // ==========================================================================\n// Project: Spade - CommonJS Runtime\n// Copyright: \\u00a92010 Strobe Inc. All rights reserved.\n// License: Licened under MIT license\n// ==========================================================================\n/*jslint evil:true */\n/*globals spade ARGS ARGV ENV __module ActiveXObject */\n\n\n(function() {\n\nvar K, Sandbox, Sp, Evaluator, Ep, Loader, Lp, Spade, Tp;\n\n\n// ..........................................................\n// HELPER FUNCTIONS\n// \n\nK = function() {}; // noop\n\n// assume id is already normalized\nfunction packageIdFor(normalizedId) {\n return normalizedId.slice(0, normalizedId.indexOf('/'));\n}\n\nfunction remap(id, contextPkg) {\n var mappings = contextPkg ? contextPkg.mappings : null;\n if (!mappings) { return id; }\n\n var packageId = packageIdFor(id);\n if (mappings[packageId]) {\n id = mappings[packageId] + id.slice(id.indexOf('/'));\n }\n return id;\n}\n\n// convert a relative or otherwise de-normalized module id into canoncial form\n// normalize('./foo', 'bar/baz') -> 'bar/foo'\n// normalize('foo', 'bar/baz') -> 'foo/main' (or foo/~package is asPackage)\n// normalize('foo/bar', 'bar/baz') -> 'foo/bar'\nfunction normalize(id, contextId, contextPkg, _asPackage) {\n var idx, len;\n\n // slice separator off the end since it is not used...\n if (id[id.length-1]==='/') { id = id.slice(0,-1); }\n\n // need to walk if there is a .\n if (id.indexOf('.')>=0) {\n var parts = contextId && (id.charAt(0) ==='.') ? contextId.split('/') : [],\n part, next,\n packageName = parts[0],\n needsCleanup = false;\n\n idx = 0;\n len = id.length;\n\n if (contextPkg && contextPkg.main && contextId === packageName+'/main') {\n // If we're requiring from main we need to handle relative requires specially\n needsCleanup = true;\n parts = contextPkg.main.replace(/^\\.?\\//, '').split('/');\n }\n\n parts.pop(); // get rid of the last path element since it is a module.\n\n while(idx<len) {\n next = id.indexOf('/', idx);\n if (next<0) { next = len; }\n part = id.slice(idx, next);\n if (part==='..') { parts.pop(); }\n else if (part!=='.' && part!=='' && part!==null) { parts.push(part); }\n // skip .., empty, and null.\n idx = next+1;\n }\n\n id = parts.join('/');\n\n if (needsCleanup) {\n var libPaths = contextPkg.directories.lib;\n for (idx=0,len=libPaths.length; idx<len; idx++){\n id = id.replace(libPaths[idx].replace(/^\\.?\\//, '')+'/', '');\n }\n id = packageName+'/'+id;\n }\n\n // else, just slice off beginning '/' if needed\n } else if (id[0]==='/') { id = id.slice(1); }\n\n // if we end up with no separators, make this a pkg\n if (id.indexOf('/')<0) { id = id+(_asPackage ? '/~package' : '/main'); }\n\n // slice separators off begin and end\n if (id[0]==='/') { id = id.slice(1); }\n\n // Remove unnecessary ~lib references\n id = id.replace('~lib/', '');\n\n return remap(id, contextPkg);\n}\n\n// ..........................................................\n// SANDBOX - you could make a secure version if you want\n// \n\n// runs a factory within context and returns exports...\nfunction execFactory(id, factory, sandbox, spade) {\n var require, mod, factoryData, fullId;\n\n var filename = factory.filename,\n ARGV = sandbox.ARGV,\n ENV = sandbox.ENV;\n\n require = sandbox.makeRequire(id, spade);\n \n sandbox._modules[id] = mod = {\n id: id,\n exports: {},\n sandbox: sandbox\n };\n\n factoryData = factory.data; // extract the raw module body\n\n // evaluate if needed - use cache so we only do it once per sandbox\n if ('string' === typeof factoryData) {\n \n if (sandbox._factories[id]) {\n factoryData = sandbox._factories[id];\n } else {\n sandbox._loading[id] = true;\n\n // The __evalFunc keeps IE 9 happy since it doesn't like\n // unassigned anonymous functions\n factoryData = sandbox.evaluate('__evalFunc = '+factoryData+'\\n//@ sourceURL='+filename+'\\n', filename);\n sandbox._factories[id] = factoryData;\n sandbox._loading[id] = false;\n }\n }\n\n if ('function' === typeof factoryData) {\n var ret = factoryData(require, mod.exports, mod, ARGV, ENV, filename);\n if (ret !== undefined) { mod.exports = ret; } // allow return exports\n } else {\n mod.exports = factoryData;\n }\n\n return mod.exports;\n}\n\n/**\n @constructor\n\n Sandbox provides an isolated context for loading and running modules.\n You can create new sandboxes anytime you want. If you pass true for the\n isolate flag, then the sandbox will be created in a separate context if\n supported on the platform. Otherwise it will share globals with the\n default sandbox context.\n\n Note that isolated sandboxes are not the same as secure sandboxes. For\n example in the browser, a isolated sandbox is created using an iframe\n which still exposes access to the DOM and parent environment.\n\n Isolated sandboxes are mostly useful for testing and sharing plugin code\n that might want to use different versions of packages.\n\n @param {Spade} spade\n The spade instance\n\n @param {String} name\n (Optional) name of the sandbox for debugging purposes\n \n @param {Boolean} isolate\n Set to true if you want to isolate it\n\n @returns {Sandbox} instance\n*/\nSandbox = function(spade, name, isolate) {\n \n // name parameter is optional\n if (typeof name !== 'string') {\n isolate = name;\n name = null;\n }\n\n if (!name) { name = '(anonymous)'; }\n\n this.spade = spade;\n this.name = name;\n this.isIsolated = !!isolate;\n this._factories = {}; // evaluated factories\n this._loading = {}; // list of loading modules\n this._modules = {}; // cached export results\n this._used = {}; // to detect circular references\n};\n\n// alias this to help minifier make the page a bit smaller.\nSp = Sandbox.prototype;\n\nSp.toString = function() {\n return '[Sandbox '+this.name+']';\n};\n\n/**\n Evaluate the passed string in the Sandbox context, returning the result.\n This is the primitive used to evalute string-encoded factories into\n modules that can execute within a specific context.\n*/\nSp.evaluate = function(code, filename) {\n if (this.isDestroyed) { throw new Error(\"Sandbox destroyed\"); }\n if (!this._evaluatorInited) {\n this._evaluatorInited = true;\n this.spade.evaluator.setup(this);\n }\n return this.spade.evaluator.evaluate(code, this, filename);\n};\n\n/**\n NOTE: This is a primitive form of the require() method. Usually you should\n use the require() method defined in your module.\n\n Sandbox-specific require. This is the most primitive form of require. All\n other requires() pass through here.\n \n @param {String} id\n The module id you want to require.\n \n @param {String} callingId\n (Optional) The id of the module requiring the module. This is needed if \n you the id you pass in might be relative.\n \n @returns {Object} exports of the required module\n*/\nSp.require = function(id, callingId) {\n var spade = this.spade,\n pkg, ret, factory;\n \n pkg = callingId ? spade.package(callingId) : null;\n id = normalize(id, callingId, pkg);\n\n ret = this._modules[id];\n if (ret) { ret = ret.exports; }\n\n if (ret) {\n \n // save so we can detect circular references later\n if (!this._used[id]) { this._used[id] = ret; }\n return ret ;\n\n } else {\n factory = spade.loadFactory(spade.resolve(id, this));\n if (!factory) { throw new Error('Module '+id+' not found'); }\n\n if (!this.ENV) { this.ENV = spade.env(); } // get at the last minute\n if (!this.ARGV) { this.ARGV = spade.argv(); }\n\n ret = execFactory(id, factory, this, spade);\n\n if (this._used[id] && (this._used[id] !== ret)) {\n throw new Error(\"Circular require detected for module \"+id);\n }\n }\n\n return ret ;\n};\n\n/**\n NOTE: This is a primitive form of the exists() method. Usually you should\n use the require.exists() method defined on the require() function in your\n module.\n\n Sandbox-specific test to determine if the named module exists or not.\n This property only reflects what is immediately available through the\n sync-loader. Using the async loader may change the return value of this\n call.\n \n @param {String} id\n The module id you want to test\n \n @param {String} callingId\n (Optional) The id of the module requesting the module. Required if the id \n you pass in might be relative.\n \n @returns {Object} exports of the required module\n*/\nSp.exists = function(id, callingId) {\n var spade = this.spade, pkg;\n pkg = callingId ? spade.package(callingId) : null;\n id = normalize(id, callingId, pkg);\n if (this._modules[id]) { return true; }\n return spade.factoryExists(spade.resolve(id, this));\n};\n\n/**\n NOTE: This is a primitive form of the async() method. Usually you should\n use the require.async() method defined on the require() function in your\n module.\n \n Asynchronously attempts to load a module, invoking a callback if and when\n the module is loaded. If the module is already defined, the callback will\n be invoked immediately. Otherwise, this will use the Loader plugin on the\n main spade context to attempt to load the module. If the module cannot \n be loaded, the callback will be invoked with an error object as its first\n parameter to inform you that it failed.\n \n Note that the default Loader that ships with spade is not actually capable\n of asynchronously loading modules, which means this method will always fail\n unless the module is already present. You can use the spade-loader package\n to install an async loader that will work.\n \n @param {String} id\n The module id you want to load\n\n @param {Function} callback\n A callback to invoke when the module is loaded or if the load has failed.\n The calback should expect an error object (or null) as the first \n parameter.\n \n @param {String} callingId\n (Optional) The id of the module requesting the module. Required if the id \n you pass in might be relative.\n \n @returns {void}\n*/\nSp.async = function(id, callback, callingId) {\n var spade = this.spade, pkg;\n pkg = callingId ? spade.package(callingId) : null;\n id = spade.resolve(normalize(id, callingId, pkg), this);\n spade.loadFactory(id, callback);\n};\n\n/**\n NOTE: This is a primitive form of the url() method. Usually you should\n use the require.url() method defined on the require() function in your\n module.\n\n Returns the URL of the given resource based on the settings of the named\n package. This method requires the package information to include a `root`\n property that defines the root URL where resources can be found. \n \n This method is useful for finding non-JavaScript resources such as images,\n video, etc.\n \n @param {String} id\n A module id form of the reference you want to load.\n \n @param {String} ext\n (Optional) and extension to append to the returned URL.\n \n @param {String} callingId\n (Optional) The id of the module requesting the module. Required if the id \n you pass in might be relative.\n\n @param {String} the computed URL.\n*/\nSp.url = function(id, ext, callingId) {\n var spade = this.spade, ret, pkg;\n\n pkg = callingId ? spade.package(callingId) : null;\n id = normalize(id, callingId, pkg);\n\n pkg = spade.package(id);\n if (!pkg) {\n var packageId = packageIdFor(id)+'/~package';\n if (spade.exists(packageId)) { spade.require(packageId); }\n pkg = spade.package(id);\n }\n\n if (!pkg) {\n throw new Error(\"Can't get url for non-existent package \"+id);\n }\n\n if (!pkg.root) {\n throw new Error('Package for '+id+' does not support urls');\n }\n\n ret = pkg.root + id.slice(id.indexOf('/'));\n if (ext) { ret = ret+'.'+ext; }\n return ret ;\n};\n\nSp.isDestroyed = false;\n\nSp.destroy = function() {\n if (!this.isDestroyed) {\n this.isDestroyed = true;\n this.spade.evaluator.teardown(this);\n }\n return this;\n};\n\n/**\n Return a new require function for the normalized module ID. Normally you\n would not call this method yourself but you might override it if you want \n to add new API to the require() methods passed into modules.\n*/\nSp.makeRequire = function(id, spade) {\n var pkg = spade.package(id),\n sandbox = this,\n require;\n\n require = function(moduleId) {\n return sandbox.require(moduleId, id, pkg);\n };\n\n // make the require 'object' have the same API as sandbox and spade.\n require.require = require;\n\n require.exists = function(moduleId) {\n return sandbox.exists(normalize(moduleId, id, pkg));\n };\n\n require.normalize = function(moduleId) {\n return normalize(moduleId, id, pkg);\n };\n\n require.async = function(moduleId, callback) {\n return sandbox.async(normalize(moduleId, id, pkg), callback);\n };\n\n require.sandbox = function(name, isolate) {\n return spade.sandbox(name, isolate);\n };\n\n require.url = function(moduleId, ext) {\n return sandbox.url(normalize(moduleId, id, pkg), ext);\n };\n\n require.id = id; // so you can tell one require from another\n\n return require;\n};\n\n// ..........................................................\n// LOADER\n//\n\n/**\n @constructor \n \n The Loader object is used to asynchronously load modules from the server.\n It also provides other low-level URL resolution and event handling \n functions needed to integrate with the low-level environment. The default\n implementation does not support any kind of async loading. See the \n spade-loader package for a way to add support for this.\n*/\nLoader = function() {\n this._loading = {};\n};\n\nLp = Loader.prototype;\n\n/**\n Called by spade whenever a module is requested that has not already been\n registered in memory. This function should attempt to load the module if \n possible, registering any packages on the spade instance.\n \n If a `done` is a function, then this method should run asynchronously -\n invoking the callback when complete. If the load failed, this method should\n pass an error as the first parameter. Otherwise it should not pass any \n parameter.\n \n If `done` is null, then this method should run synchronously and then simply\n return when it is complete. If the named module cannot be loaded, you can\n just return with no errors as the spade environment will detect this \n condition and fail.\n \n Note that loaders are not required to support both sync and async loading. \n If you don't support one or the other, simply throw an error.\n \n @method\n \n @param {Spade} spade\n The spade instance.\n \n @param {String} id\n The normalized module id to load.\n \n @param {Function} done\n (Optional) if passed, run this function async and invoke the done callback\n when complete.\n \n @returns {void}\n*/\nLp.loadFactory = null;\n\n/**\n Called by spade whenever it wants to detect if a given module exists and the\n id is not yet registered with the spade instance.\n \n This method should do its best to determine if the module exists and return\n the appropriate value. Note that if you only support async loading of \n modules then you may not be able to detect when a module is defined outside\n of what is already registered. In this case it is OK to simply return false.\n \n @method\n \n @param {Spade} spade\n The spade instance.\n \n @param {String} id\n The normalized module id to load\n \n @returns {Boolean} true if module exists\n*/\nLp.exists = null;\n\n// NOTE: On ready stuff mostly stolen from jQuery 1.4. Need to incl here\n// because spade will often be used to load jQuery.\n// Will only be invoked once. Just be prepared to call it\n/**\n Called once by spade on page load to schedule a ready callback, which should\n be invoked once the documents 'ready' event (or an equivalent) is fired.\n\n You should never call this method yourself but you might override it when\n using spade outside of a proper browser.\n\n @param {Function} callback\n The callback to be invoked when the document is 'ready'.\n \n @returns {void}\n*/\nLp.scheduleReady = function(callback) {\n\n // handle case where ready is invoked AFTER the document is already ready\n if ( document.readyState === \"complete\" ) { return setTimeout(callback, 1); }\n\n var handler, handled = false;\n\n // The DOM ready check for Internet Explorer\n function doScrollCheck() {\n if (handled) { return; }\n\n try {\n // If IE is used, use the trick by Diego Perini\n // http://javascript.nwbox.com/IEContentLoaded/\n document.documentElement.doScroll(\"left\");\n } catch(e) {\n setTimeout( doScrollCheck, 1 );\n return;\n }\n\n // and execute any waiting functions\n handler();\n }\n\n // Mozilla, Opera and webkit nightlies currently support this event\n if (document.addEventListener) {\n\n handler = function() {\n if (handled) { return; }\n handled = true;\n document.removeEventListener(\"DOMContentLoaded\", handler, false);\n window.removeEventListener('load', handler, false);\n callback();\n };\n\n document.addEventListener( \"DOMContentLoaded\", handler, false);\n\n // A fallback to window.onload, that will always work\n window.addEventListener( \"load\", handler, false );\n\n // If IE event model is used\n } else if ( document.attachEvent ) {\n\n handler = function() {\n if (!handled && document.readyState === \"complete\") {\n handled = true;\n document.detachEvent( \"onreadystatechange\", handler );\n window.detachEvent('onload', handler);\n callback();\n }\n };\n\n // ensure firing before onload,\n // maybe late but safe also for iframes\n document.attachEvent(\"onreadystatechange\", handler);\n\n // A fallback to window.onload, that will always work\n window.attachEvent( \"onload\", handler);\n\n // If IE and not a frame\n // continually check to see if the document is ready\n var toplevel = false;\n\n try {\n toplevel = window.frameElement === null;\n } catch(e) {}\n if ( document.documentElement.doScroll && toplevel ) { doScrollCheck(); }\n }\n};\n\n// ..........................................................\n// Evaluator Class\n//\n\n/**\n @constructor\n \n An Evaluator instance is used to evaluate code inside of a sandbox. A \n default instance is created on spade and used automatically by sandboxes. \n You can extend this class and replace the default one on spade in order to\n provide additional new features, such as sandbox isolation or secure eval.\n\n The default Evaluator simply evals code in the current context using the \n built-in eval() function. It does not support isolated sandboxes. To add\n isolated sandbox support, add the `spade-isolate` package.\n*/\nEvaluator = function() {};\nEp = Evaluator.prototype;\n\n/**\n Called once on each new sandbox to allow the evaluator to setup any required\n context for future calls. For isolated sandboxes, this is usually where\n you would create the new compilation context and store it on the sandbox for\n future use.\n \n The default implementation does nothing, but will throw an exception if you\n try to setup a new isolated sandbox. (Since the feature is not supported.).\n If you override this method, you do not need to call the default function.\n \n @param {Sandbox} sandbox\n The sandbox to setup.\n \n @returns {void}\n*/\nEp.setup = function(sandbox) {\n if (sandbox.isIsolated) { \n throw new Error(\"Isolated sandboxes are not supported.\"); \n }\n};\n\n/**\n Evaluates the passed JavaScript within the context of a sandbox and returns\n the resulting value (usually a function). The default version simply calls\n the built-in eval().\n \n @param {String} text\n The code to evaluate.\n \n @param {Sandbox} sandbox\n The sandbox owning the code.\n \n @param {String} filename\n An optional filename to associate with the text (may be useful for debug\n support)\n \n @returns {Object} evaluated result.\n*/\nEp.evaluate = function(text, sandbox, filename) {\n return eval(text);\n};\n\n/**\n Called once by the sandbox when it is destroyed to allow the evaluator to\n cleanup any data it might have stashed on the sandbox. For isolated \n sandboxes, this method might destroy the compilation context to allow its \n memory to be reclaimed.\n \n Since the default evaluator does not support isolated contexts, this method\n is a no-op.\n \n @param {Sandbox} sandbox\n The sandbox about to be destroyed.\n \n @returns {void}\n*/\nEp.teardown = function(sandbox) {\n // noop by default\n};\n\n// ..........................................................\n// Spade Class - defined so we can recreate\n//\n\n/**\n @constructor\n \n The root object used to coordinate the entire spade environment. A global\n instance of this class is created on page load called `spade`. Most of the\n time you will only interact with this object directly to register new \n modules and perhaps to load a new module outside of traditional module code.\n \n Note that if you are using BPM and your app is actually published as modules\n then you won't actually need reference this object at all as the details are\n handled for you.\n\n # Registering a Module\n \n If you are manually constructing a JavaScript file to load from the server\n and you want to register new modules, you will need to use the\n `spade.register()` method:\n \n spade.register('package_name/module_name', function() { ... });\n \n This will make the module `package_name/module_name` available to all other\n modules. The first time the module is required, your passed function will\n be called.\n \n You can also register metadata about a package by registering the \n `package_name/~package` module:\n \n spade.register('package_name/~package', { \n \"name\": \"package_name\",\n \"version\": \"1.0.0\",\n ...\n });\n \n Note that in addition to factory functions you can also pass in JSON hashes\n (which will simply be returned directory) or a string of code - which will\n be eval'd on demand.\n \n The string format is particularly important because defining modules as \n strings can dramatically improve load time on mobile devices while also \n allowing you to easily support isolated sandbox contexts.\n \n # Requiring a Module\n \n Normally when you write module code that is managed by Spade you will have\n a `require()` method defined within the module that you should use to load\n modules.\n \n If you happen to be writing code outside of a spade module and need to \n require a module, however, you can use the `spade.require()` method instead:\n \n var jQuery = spade.require('jquery');\n \n This works just like the built-in require method except it will not support\n relative modules (since there is no module to be relative too). This \n method will require modules from the default sandbox, found at \n `spade.defaultSandbox`.\n \n # Plugins\n \n Spade supports a number of plugins that you can use to enhance the way \n spade discovers and loads modules. The two plugins currently supported are\n a `loader` and `evaluator`.\n \n The `loader` plugin is used to asynchronously discover and load modules. It\n expects the object to be an instance of Spade.Loader. See `Loader` \n documentation for more information.\n \n The `evaluator` plugin is used to evaluate code within a sandbox context. It\n can be enhanced to support isolated sandboxes as well as worker threads and\n many other contexts. See the `Evaluator` documentation for more \n information.\n \n*/\nSpade = function() {\n this.loader = new this.Loader(this);\n this.evaluator = new this.Evaluator(this);\n this.defaultSandbox = this.sandbox();\n this._factories = {};\n this._packages = {};\n};\n\nTp = Spade.prototype;\n\nTp.VERSION = \"1.0.0\";\n\n// expose the classes. We do it this way so that you can create a new\n// Spade instance and treat it like the spade module\nTp.Spade = Spade;\nTp.Sandbox = Sandbox;\nTp.Loader = Loader;\nTp.Evaluator = Evaluator;\n\n/**\n Computes and returns a normalized ENV hash. By default this will look for\n a globally defined variable called `ENV` and use that. If not defined,\n it will look for a locally defined `ENV` variable instead.\n \n In either case, this method will also normalize the variable to include at\n least the `LANG` and `SPADE_PLATFORM` properties.\n \n @returns {Hash} the environment hash\n*/\nTp.env = function() {\n var env = this.ENV;\n if (!env) { this.ENV = env = ('undefined' !== typeof ENV) ? ENV : {}; }\n if (!env.SPADE_PLATFORM) { env.SPADE_PLATFORM = 'browser'; }\n if (!env.LANG) {\n env.LANG = ('undefined' !== typeof navigator) ? navigator.language : 'en-US';\n }\n \n return env;\n};\n\n/**\n Computes and returns the ARGV array for the current spade environment. By\n default this will look for a globally defined variable called `ARGV` and \n use that.\n \n ARGV is a useful way to pass in startup options to spade modules.\n \n @returns {Array} the argv array\n*/\nTp.argv = function() {\n var argv = this.ARGV;\n if (!argv) { argv= this.ARGV = ('undefined' !== typeof ARGV) ? ARGV : []; }\n return argv;\n};\n\n/**\n Restores original values after a call to `spade.globalize()`. If you call \n this method more than once it will have no effect.\n \n @returns {void}\n*/\nTp.noConflict = function() {\n var c = this._conflict;\n if (c) {\n delete this._conflict;\n spade = this._conflict;\n }\n return this;\n};\n\n/**\n Returns a new sandbox instance attached to the current spade instance.\n If you pass true for the `isolate` parameter, the new sandbox will attempt\n to load its code in an isolated compilation context (possibly using an \n iframe in browsers). Note that isolated sandboxes are not supported by \n default. Include the spade-isolate package instead.\n\n @param {String} name\n (Optional) name for the sandbox for debugging purposes.\n \n @param {Boolean} isolate\n true if you want the sandbox to be isolated. Throws exception if\n platform cannot isolate.\n\n @returns {Sandbox} sandbox instance\n*/\nTp.sandbox = function(name, isolate) {\n return new this.Sandbox(this, name, isolate);\n};\n\n/**\n Register a module or package information. You can pass one of the\n following:\n\n 'module/id', 'module body string'\n 'module/id', function() { module func }\n 'module/id', { exports: 'foo' }\n 'module/id' - just register module id and no body to indicate presence\n\n Note also that if you pass just a packageId, it will be normalized to\n packageId/~package. This is how you register a package.\n\n @param {String} id\n The module or package id\n\n @param {String|Function|Hash} data\n A module function, module body (as string), or hash of exports to use.\n\n @param {String} opts\n Additional metadata only if you are registering a module factory. Known\n keys include 'filename' and 'format' (for compilation of DSLs).\n\n @returns {void}\n*/\nTp.register = function(id, data, opts) {\n if (!data) { data = K ; }\n var t = typeof data, isExtern, factory, isPkg;\n\n id = normalize(id, null, null, true);\n isPkg = id.slice(-9) === '/~package';\n\n // register - note packages can only accept hashes\n if (isPkg && 'object'!==typeof data) {\n throw new Error('You can only register hashes for packages');\n }\n\n // Set some package defaults\n if (isPkg) {\n if (!data.directories) { data.directories = {}; }\n if (!data.directories.lib) {\n data.directories.lib = ['lib'];\n } else if (typeof data.directories.lib === 'string') {\n data.directories.lib = [data.directories.lib];\n }\n }\n\n factory = { data: data };\n factory.filename = opts && opts.filename ? opts.filename : id;\n\n // Store with generic id if none, or if JS\n this._factories[id] = factory;\n return this;\n};\n\n/**\n Efficient way to register external packages. Pass a hash of packageIds\n and source URLs. If the package is already registered, the extern will\n not replace it so this is safe to call multiple times.\n \n @param {Hash} externs\n A hash of package names and package settings.\n \n @returns {void}\n*/\nTp.externs = function(externs, extern) {\n var tmp, packages = this._packages;\n\n // normalize method call.\n if ('string' === typeof externs) {\n tmp = {};\n tmp[externs] = extern;\n externs = tmp;\n extern = null;\n }\n\n for(var packageId in externs) {\n if (!externs.hasOwnProperty(packageId)) { continue; }\n if (packages[packageId] && !packages[packageId].extern) { continue; }\n\n extern = externs[packageId];\n if ('string' === typeof extern) { extern = {name: packageId, src: extern}; }\n extern.extern = true;\n this.register(packageId, extern);\n }\n};\n\n/**\n Require a module from the default sandbox.\n\n @param {String} id\n The module id.\n\n @returns {Hash} module exports\n*/\nTp.require = function(id) {\n return this.defaultSandbox.require(id, this.defaultSandbox.callerId);\n};\n\n/**\n Async load a module if it is not already a registered factory. Invoke\n the passed callback with an optional error object when the module is\n ready to load.\n*/\nTp.async = function(id, callback) {\n return this.defaultSandbox.async(id, callback);\n};\n\n/**\n Returns true if the passed module exists in the default sandbox.\n \n @param {String} id\n The module id to check.\n \n @returns {Boolean} true if module id exists\n*/\nTp.exists = function(id) {\n return this.defaultSandbox.exists(id);\n};\n\n/**\n Returns the URL for a resource matching the passed module id and optional\n extension.\n \n @param {String} id\n the module id to resolve\n \n @param {String} ext\n (Optional) extension to append to URL\n \n @returns {String} url\n*/\nTp.url = function(id, ext) {\n return this.defaultSandbox.url(id, ext);\n};\n\n/**\n Called by the sandbox to get a factory object for the named moduleId. \n Normally you will not need to call this method directly or even override it.\n \n @param {String} id\n Fully normalized module id\n \n @param {Function} callback\n (Optional) callback to invoke once factory is loaded. If not passed, this\n method will run sync. Otherwise it will run async.\n \n @returns {Hash} factory hash.\n*/\nTp.loadFactory = function(id, callback) {\n \n var ret = this._factories[id],\n loader = this.loader;\n\n if (callback) {\n if (!ret) {\n if (loader && loader.loadFactory) {\n loader.loadFactory(this, id, callback);\n } else { callback(new Error('Module '+id+' not found')); }\n } else { callback(); }\n\n } else if (!ret && loader && loader.loadFactory) {\n loader.loadFactory(this, id);\n ret = this._factories[id];\n }\n\n return ret ;\n};\n\n/**\n Called by the sandbox to determine if the named id exists on the system.\n The id should already be normalized. If the id is not yet registered, the\n loader will also be consulted.\n \n Normally you will not need to call this method directly or override it.\n \n @param {String} id\n Fully normalized module id\n \n @returns {Boolean} true if factory exists\n*/\nTp.factoryExists = function(id) {\n if (this._factories[id]) { return true; }\n var loader = this.loader;\n return loader && loader.exists && loader.exists(this, id);\n};\n\n/**\n Returns the package info, if any, for the named module or packageId\n \n @param {String} id\n A package name or fully normalized module id.\n \n @returns {Hash} package info or null if package is not registered\n*/\nTp.package = function(id) {\n id = packageIdFor(normalize(id))+'/~package';\n var ret = this._factories[id];\n return ret ? ret.data : null;\n};\n\n/**\n Normalize a moduleId, expanding relative values if needed.\n \n @param {String} id\n The module id, possibly de-normalized.\n \n @param {String} contextId\n (Optional) The normalized module id of the calling module. Required if \n your module id might be relative.\n \n @returns {String} the normalized module id\n*/\nTp.normalize = function(id, contextId) {\n return normalize(id, contextId);\n};\n\n/**\n Maps the passed module id to a potentially location specific module id.\n This gives the loader a way to vary the factory function returns for a given\n module id per sandbox. Useful when supporting multiple versions of the \n same package.\n \n @param {String} id\n Normalized module id\n \n @param {Sandbox} sandbox\n The requesting sandbox\n \n @returns {String} resolved module id\n*/\nTp.resolve = function(id, sandbox) {\n var loader = this.loader;\n return sandbox && loader && loader.resolve ? loader.resolve(id, sandbox):id;\n};\n\n/**\n Invokes the passed callback when the browser is ready. This will work \n regardless of the environment you are in.\n \n @param {Function} callback\n Invoked when the browser is ready. If browser is alrady ready, invoked\n immediately.\n \n @returns {void}\n*/\nTp.ready = function(callback) {\n switch(this.readyState) {\n case 'ready':\n callback();\n break;\n\n case 'scheduled':\n this._readyQueue.push(callback);\n break;\n\n default:\n this._readyQueue = [callback];\n this.readyState = 'scheduled';\n if (this.loader.scheduleReady) {\n var that = this;\n this.loader.scheduleReady(function() {\n var queue = that._readyQueue, len = queue ? queue.length : 0;\n that._readyQueue = null;\n that.readyState = 'ready';\n for(var idx=0;idx<len;idx++) { queue[idx](); }\n });\n\n } else {\n throw new Error('Loader does not support activate on ready state');\n }\n }\n};\n\n// instantiate spade and also attach class for testing\nvar newSpade = new Spade();\nif ('undefined' !== typeof spade) newSpade._conflict = spade;\nspade = newSpade;\n\n// make this work when called as a module - both from within spade and from\n// node.\nif ('undefined' !== typeof require) {\n if ('undefined' !== typeof __module) { __module.exports = spade; }\n else if ('undefined' !== typeof module) { module.exports = spade; }\n}\n\n})();\n// BPM PLUGIN: spade/transport\n\n\n(function(exports) {\n/*globals BPM_PLUGIN */\n\nBPM_PLUGIN.compileTransport = function(code, context, filename) {\n var ret = '',\n packageName = context['package'].name,\n id = packageName+'/'+context.moduleId;\n\n // Register package, probably a better way to do this\n if (id.match(/^[^\\/]+\\/main$/)) {\n \n var ctx = context['package'],\n pkg = { name: ctx.name, \n version: ctx.version, \n dependencies: ctx.dependencies };\n \n ret += 'spade.register(\"'+packageName+'\", '+JSON.stringify(pkg)+');\\n\\n';\n }\n\n if (context.settings['spade:format'] === 'function') {\n code = 'function(require, exports, __module, ARGV, ENV, __filename){\\n'+code+'\\n}';\n } else {\n code = context.minify(\"(function(require, exports, __module, ARGV, ENV, __filename){\"+code+\"\\n});\");\n code = JSON.stringify(code);\n }\n\n ret += 'spade.register(\"'+id+'\", '+code+');';\n\n return ret;\n};\n\n\n})(BPM_PLUGIN);\n\n ; // Safety\n CTX = {\"package\":{\"name\":\"uglify-js\",\"author\":\"Mihai Bazon\",\"summary\":\"AST-powered minifier for JavaScript\",\"description\":\"Minify JavaScript applications. Includes plugin support for bpm.\",\"version\":\"1.0.7\",\"repository\":{\"type\":\"git\",\"url\":\"git@github.com:mishoo/UglifyJS.git\"},\"homepage\":\"http://github.com/getbpm/UglifyJS\",\"bpm:provides\":{\"minifier\":\"uglify-js/plugins/minifier\"},\"directories\":{\"lib\":\"lib\",\"plugins\":\"plugins\"},\"dependencies\":{\"spade\":\"~> 1.0.0\"}},\"moduleId\":\"parse-js\",\"settings\":{}};\n DATA = \"/***********************************************************************\\n\\n A JavaScript tokenizer / parser / beautifier / compressor.\\n\\n This version is suitable for Node.js. With minimal changes (the\\n exports stuff) it should work on any JS platform.\\n\\n This file contains the tokenizer/parser. It is a port to JavaScript\\n of parse-js [1], a JavaScript parser library written in Common Lisp\\n by Marijn Haverbeke. Thank you Marijn!\\n\\n [1] http://marijn.haverbeke.nl/parse-js/\\n\\n Exported functions:\\n\\n - tokenizer(code) -- returns a function. Call the returned\\n function to fetch the next token.\\n\\n - parse(code) -- returns an AST of the given JavaScript code.\\n\\n -------------------------------- (C) ---------------------------------\\n\\n Author: Mihai Bazon\\n <mihai.bazon@gmail.com>\\n http://mihai.bazon.net/blog\\n\\n Distributed under the BSD license:\\n\\n Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>\\n Based on parse-js (http://marijn.haverbeke.nl/parse-js/).\\n\\n Redistribution and use in source and binary forms, with or without\\n modification, are permitted provided that the following conditions\\n are met:\\n\\n * Redistributions of source code must retain the above\\n copyright notice, this list of conditions and the following\\n disclaimer.\\n\\n * Redistributions in binary form must reproduce the above\\n copyright notice, this list of conditions and the following\\n disclaimer in the documentation and/or other materials\\n provided with the distribution.\\n\\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER \\u201cAS IS\\u201d AND ANY\\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\\n SUCH DAMAGE.\\n\\n ***********************************************************************/\\n\\n/* -----[ Tokenizer (constants) ]----- */\\n\\n\\nvar KEYWORDS = array_to_hash([\\n \\\"break\\\",\\n \\\"case\\\",\\n \\\"catch\\\",\\n \\\"const\\\",\\n \\\"continue\\\",\\n \\\"default\\\",\\n \\\"delete\\\",\\n \\\"do\\\",\\n \\\"else\\\",\\n \\\"finally\\\",\\n \\\"for\\\",\\n \\\"function\\\",\\n \\\"if\\\",\\n \\\"in\\\",\\n \\\"instanceof\\\",\\n \\\"new\\\",\\n \\\"return\\\",\\n \\\"switch\\\",\\n \\\"throw\\\",\\n \\\"try\\\",\\n \\\"typeof\\\",\\n \\\"var\\\",\\n \\\"void\\\",\\n \\\"while\\\",\\n \\\"with\\\"\\n]);\\n\\nvar RESERVED_WORDS = array_to_hash([\\n \\\"abstract\\\",\\n \\\"boolean\\\",\\n \\\"byte\\\",\\n \\\"char\\\",\\n \\\"class\\\",\\n \\\"debugger\\\",\\n \\\"double\\\",\\n \\\"enum\\\",\\n \\\"export\\\",\\n \\\"extends\\\",\\n \\\"final\\\",\\n \\\"float\\\",\\n \\\"goto\\\",\\n \\\"implements\\\",\\n \\\"import\\\",\\n \\\"int\\\",\\n \\\"interface\\\",\\n \\\"long\\\",\\n \\\"native\\\",\\n \\\"package\\\",\\n \\\"private\\\",\\n \\\"protected\\\",\\n \\\"public\\\",\\n \\\"short\\\",\\n \\\"static\\\",\\n \\\"super\\\",\\n \\\"synchronized\\\",\\n \\\"throws\\\",\\n \\\"transient\\\",\\n \\\"volatile\\\"\\n]);\\n\\nvar KEYWORDS_BEFORE_EXPRESSION = array_to_hash([\\n \\\"return\\\",\\n \\\"new\\\",\\n \\\"delete\\\",\\n \\\"throw\\\",\\n \\\"else\\\",\\n \\\"case\\\"\\n]);\\n\\nvar KEYWORDS_ATOM = array_to_hash([\\n \\\"false\\\",\\n \\\"null\\\",\\n \\\"true\\\",\\n \\\"undefined\\\"\\n]);\\n\\nvar OPERATOR_CHARS = array_to_hash(characters(\\\"+-*&%=<>!?|~^\\\"));\\n\\nvar RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;\\nvar RE_OCT_NUMBER = /^0[0-7]+$/;\\nvar RE_DEC_NUMBER = /^\\\\d*\\\\.?\\\\d*(?:e[+-]?\\\\d*(?:\\\\d\\\\.?|\\\\.?\\\\d)\\\\d*)?$/i;\\n\\nvar OPERATORS = array_to_hash([\\n \\\"in\\\",\\n \\\"instanceof\\\",\\n \\\"typeof\\\",\\n \\\"new\\\",\\n \\\"void\\\",\\n \\\"delete\\\",\\n \\\"++\\\",\\n \\\"--\\\",\\n \\\"+\\\",\\n \\\"-\\\",\\n \\\"!\\\",\\n \\\"~\\\",\\n \\\"&\\\",\\n \\\"|\\\",\\n \\\"^\\\",\\n \\\"*\\\",\\n \\\"/\\\",\\n \\\"%\\\",\\n \\\">>\\\",\\n \\\"<<\\\",\\n \\\">>>\\\",\\n \\\"<\\\",\\n \\\">\\\",\\n \\\"<=\\\",\\n \\\">=\\\",\\n \\\"==\\\",\\n \\\"===\\\",\\n \\\"!=\\\",\\n \\\"!==\\\",\\n \\\"?\\\",\\n \\\"=\\\",\\n \\\"+=\\\",\\n \\\"-=\\\",\\n \\\"/=\\\",\\n \\\"*=\\\",\\n \\\"%=\\\",\\n \\\">>=\\\",\\n \\\"<<=\\\",\\n \\\">>>=\\\",\\n \\\"|=\\\",\\n \\\"^=\\\",\\n \\\"&=\\\",\\n \\\"&&\\\",\\n \\\"||\\\"\\n]);\\n\\nvar WHITESPACE_CHARS = array_to_hash(characters(\\\" \\\\u00a0\\\\n\\\\r\\\\t\\\\f\\\\u000b\\\\u200b\\\"));\\n\\nvar PUNC_BEFORE_EXPRESSION = array_to_hash(characters(\\\"[{}(,.;:\\\"));\\n\\nvar PUNC_CHARS = array_to_hash(characters(\\\"[]{}(),;:\\\"));\\n\\nvar REGEXP_MODIFIERS = array_to_hash(characters(\\\"gmsiy\\\"));\\n\\n/* -----[ Tokenizer ]----- */\\n\\n// regexps adapted from http://xregexp.com/plugins/#unicode\\nvar UNICODE = {\\n letter: new RegExp(\\\"[\\\\\\\\u0041-\\\\\\\\u005A\\\\\\\\u0061-\\\\\\\\u007A\\\\\\\\u00AA\\\\\\\\u00B5\\\\\\\\u00BA\\\\\\\\u00C0-\\\\\\\\u00D6\\\\\\\\u00D8-\\\\\\\\u00F6\\\\\\\\u00F8-\\\\\\\\u02C1\\\\\\\\u02C6-\\\\\\\\u02D1\\\\\\\\u02E0-\\\\\\\\u02E4\\\\\\\\u02EC\\\\\\\\u02EE\\\\\\\\u0370-\\\\\\\\u0374\\\\\\\\u0376\\\\\\\\u0377\\\\\\\\u037A-\\\\\\\\u037D\\\\\\\\u0386\\\\\\\\u0388-\\\\\\\\u038A\\\\\\\\u038C\\\\\\\\u038E-\\\\\\\\u03A1\\\\\\\\u03A3-\\\\\\\\u03F5\\\\\\\\u03F7-\\\\\\\\u0481\\\\\\\\u048A-\\\\\\\\u0523\\\\\\\\u0531-\\\\\\\\u0556\\\\\\\\u0559\\\\\\\\u0561-\\\\\\\\u0587\\\\\\\\u05D0-\\\\\\\\u05EA\\\\\\\\u05F0-\\\\\\\\u05F2\\\\\\\\u0621-\\\\\\\\u064A\\\\\\\\u066E\\\\\\\\u066F\\\\\\\\u0671-\\\\\\\\u06D3\\\\\\\\u06D5\\\\\\\\u06E5\\\\\\\\u06E6\\\\\\\\u06EE\\\\\\\\u06EF\\\\\\\\u06FA-\\\\\\\\u06FC\\\\\\\\u06FF\\\\\\\\u0710\\\\\\\\u0712-\\\\\\\\u072F\\\\\\\\u074D-\\\\\\\\u07A5\\\\\\\\u07B1\\\\\\\\u07CA-\\\\\\\\u07EA\\\\\\\\u07F4\\\\\\\\u07F5\\\\\\\\u07FA\\\\\\\\u0904-\\\\\\\\u0939\\\\\\\\u093D\\\\\\\\u0950\\\\\\\\u0958-\\\\\\\\u0961\\\\\\\\u0971\\\\\\\\u0972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\\\u0EA1-\\\\\\\\u0EA3\\\\\\\\u0EA5\\\\\\\\u0EA7\\\\\\\\u0EAA\\\\\\\\u0EAB\\\\\\\\u0EAD-\\\\\\\\u0EB0\\\\\\\\u0EB2\\\\\\\\u0EB3\\\\\\\\u0EBD\\\\\\\\u0EC0-\\\\\\\\u0EC4\\\\\\\\u0EC6\\\\\\\\u0EDC\\\\\\\\u0EDD\\\\\\\\u0F00\\\\\\\\u0F40-\\\\\\\\u0F47\\\\\\\\u0F49-\\\\\\\\u0F6C\\\\\\\\u0F88-\\\\\\\\u0F8B\\\\\\\\u1000-\\\\\\\\u102A\\\\\\\\u103F\\\\\\\\u1050-\\\\\\\\u1055\\\\\\\\u105A-\\\\\\\\u105D\\\\\\\\u1061\\\\\\\\u1065\\\\\\\\u1066\\\\\\\\u106E-\\\\\\\\u1070\\\\\\\\u1075-\\\\\\\\u1081\\\\\\\\u108E\\\\\\\\u10A0-\\\\\\\\u10C5\\\\\\\\u10D0-\\\\\\\\u10FA\\\\\\\\u10FC\\\\\\\\u1100-\\\\\\\\u1159\\\\\\\\u115F-\\\\\\\\u11A2\\\\\\\\u11A8-\\\\\\\\u11F9\\\\\\\\u1200-\\\\\\\\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-\\\\\\\\u166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\\\uFDF0-\\\\\\\\uFDFB\\\\\\\\uFE70-\\\\\\\\uFE74\\\\\\\\uFE76-\\\\\\\\uFEFC\\\\\\\\uFF21-\\\\\\\\uFF3A\\\\\\\\uFF41-\\\\\\\\uFF5A\\\\\\\\uFF66-\\\\\\\\uFFBE\\\\\\\\uFFC2-\\\\\\\\uFFC7\\\\\\\\uFFCA-\\\\\\\\uFFCF\\\\\\\\uFFD2-\\\\\\\\uFFD7\\\\\\\\uFFDA-\\\\\\\\uFFDC]\\\"),\\n non_spacing_mark: new RegExp(\\\"[\\\\\\\\u0300-\\\\\\\\u036F\\\\\\\\u0483-\\\\\\\\u0487\\\\\\\\u0591-\\\\\\\\u05BD\\\\\\\\u05BF\\\\\\\\u05C1\\\\\\\\u05C2\\\\\\\\u05C4\\\\\\\\u05C5\\\\\\\\u05C7\\\\\\\\u0610-\\\\\\\\u061A\\\\\\\\u064B-\\\\\\\\u065E\\\\\\\\u0670\\\\\\\\u06D6-\\\\\\\\u06DC\\\\\\\\u06DF-\\\\\\\\u06E4\\\\\\\\u06E7\\\\\\\\u06E8\\\\\\\\u06EA-\\\\\\\\u06ED\\\\\\\\u0711\\\\\\\\u0730-\\\\\\\\u074A\\\\\\\\u07A6-\\\\\\\\u07B0\\\\\\\\u07EB-\\\\\\\\u07F3\\\\\\\\u0816-\\\\\\\\u0819\\\\\\\\u081B-\\\\\\\\u0823\\\\\\\\u0825-\\\\\\\\u0827\\\\\\\\u0829-\\\\\\\\u082D\\\\\\\\u0900-\\\\\\\\u0902\\\\\\\\u093C\\\\\\\\u0941-\\\\\\\\u0948\\\\\\\\u094D\\\\\\\\u0951-\\\\\\\\u0955\\\\\\\\u0962\\\\\\\\u0963\\\\\\\\u0981\\\\\\\\u09BC\\\\\\\\u09C1-\\\\\\\\u09C4\\\\\\\\u09CD\\\\\\\\u09E2\\\\\\\\u09E3\\\\\\\\u0A01\\\\\\\\u0A02\\\\\\\\u0A3C\\\\\\\\u0A41\\\\\\\\u0A42\\\\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\\\\\\u17C7\\\\\\\\u17C8\\\\\\\\u1923-\\\\\\\\u1926\\\\\\\\u1929-\\\\\\\\u192B\\\\\\\\u1930\\\\\\\\u1931\\\\\\\\u1933-\\\\\\\\u1938\\\\\\\\u19B0-\\\\\\\\u19C0\\\\\\\\u19C8\\\\\\\\u19C9\\\\\\\\u1A19-\\\\\\\\u1A1B\\\\\\\\u1A55\\\\\\\\u1A57\\\\\\\\u1A61\\\\\\\\u1A63\\\\\\\\u1A64\\\\\\\\u1A6D-\\\\\\\\u1A72\\\\\\\\u1B04\\\\\\\\u1B35\\\\\\\\u1B3B\\\\\\\\u1B3D-\\\\\\\\u1B41\\\\\\\\u1B43\\\\\\\\u1B44\\\\\\\\u1B82\\\\\\\\u1BA1\\\\\\\\u1BA6\\\\\\\\u1BA7\\\\\\\\u1BAA\\\\\\\\u1C24-\\\\\\\\u1C2B\\\\\\\\u1C34\\\\\\\\u1C35\\\\\\\\u1CE1\\\\\\\\u1CF2\\\\\\\\uA823\\\\\\\\uA824\\\\\\\\uA827\\\\\\\\uA880\\\\\\\\uA881\\\\\\\\uA8B4-\\\\\\\\uA8C3\\\\\\\\uA952\\\\\\\\uA953\\\\\\\\uA983\\\\\\\\uA9B4\\\\\\\\uA9B5\\\\\\\\uA9BA\\\\\\\\uA9BB\\\\\\\\uA9BD-\\\\\\\\uA9C0\\\\\\\\uAA2F\\\\\\\\uAA30\\\\\\\\uAA33\\\\\\\\uAA34\\\\\\\\uAA4D\\\\\\\\uAA7B\\\\\\\\uABE3\\\\\\\\uABE4\\\\\\\\uABE6\\\\\\\\uABE7\\\\\\\\uABE9\\\\\\\\uABEA\\\\\\\\uABEC]\\\"),\\n connector_punctuation: new RegExp(\\\"[\\\\\\\\u005F\\\\\\\\u203F\\\\\\\\u2040\\\\\\\\u2054\\\\\\\\uFE33\\\\\\\\uFE34\\\\\\\\uFE4D-\\\\\\\\uFE4F\\\\\\\\uFF3F]\\\")\\n};\\n\\nfunction is_letter(ch) {\\n return UNICODE.letter.test(ch);\\n};\\n\\nfunction is_digit(ch) {\\n ch = ch.charCodeAt(0);\\n return ch >= 48 && ch <= 57; //XXX: find out if \\\"UnicodeDigit\\\" means something else than 0..9\\n};\\n\\nfunction is_alphanumeric_char(ch) {\\n return is_digit(ch) || is_letter(ch);\\n};\\n\\nfunction is_unicode_combining_mark(ch) {\\n return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch);\\n};\\n\\nfunction is_unicode_connector_punctuation(ch) {\\n return UNICODE.connector_punctuation.test(ch);\\n};\\n\\nfunction is_identifier_start(ch) {\\n return ch == \\\"$\\\" || ch == \\\"_\\\" || is_letter(ch);\\n};\\n\\nfunction is_identifier_char(ch) {\\n return is_identifier_start(ch)\\n || is_unicode_combining_mark(ch)\\n || is_digit(ch)\\n || is_unicode_connector_punctuation(ch)\\n || ch == \\\"\\\\u200c\\\" // zero-width non-joiner <ZWNJ>\\n || ch == \\\"\\\\u200d\\\" // zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c)\\n ;\\n};\\n\\nfunction parse_js_number(num) {\\n if (RE_HEX_NUMBER.test(num)) {\\n return parseInt(num.substr(2), 16);\\n } else if (RE_OCT_NUMBER.test(num)) {\\n return parseInt(num.substr(1), 8);\\n } else if (RE_DEC_NUMBER.test(num)) {\\n return parseFloat(num);\\n }\\n};\\n\\nfunction JS_Parse_Error(message, line, col, pos) {\\n this.message = message;\\n this.line = line;\\n this.col = col;\\n this.pos = pos;\\n try {\\n ({})();\\n } catch(ex) {\\n this.stack = ex.stack;\\n };\\n};\\n\\nJS_Parse_Error.prototype.toString = function() {\\n return this.message + \\\" (line: \\\" + this.line + \\\", col: \\\" + this.col + \\\", pos: \\\" + this.pos + \\\")\\\" + \\\"\\\\n\\\\n\\\" + this.stack;\\n};\\n\\nfunction js_error(message, line, col, pos) {\\n throw new JS_Parse_Error(message, line, col, pos);\\n};\\n\\nfunction is_token(token, type, val) {\\n return token.type == type && (val == null || token.value == val);\\n};\\n\\nvar EX_EOF = {};\\n\\nfunction tokenizer($TEXT) {\\n\\n var S = {\\n text : $TEXT.replace(/\\\\r\\\\n?|[\\\\n\\\\u2028\\\\u2029]/g, \\\"\\\\n\\\").replace(/^\\\\uFEFF/, ''),\\n pos : 0,\\n tokpos : 0,\\n line : 0,\\n tokline : 0,\\n col : 0,\\n tokcol : 0,\\n newline_before : false,\\n regex_allowed : false,\\n comments_before : []\\n };\\n\\n function peek() { return S.text.charAt(S.pos); };\\n\\n function next(signal_eof) {\\n var ch = S.text.charAt(S.pos++);\\n if (signal_eof && !ch)\\n throw EX_EOF;\\n if (ch == \\\"\\\\n\\\") {\\n S.newline_before = true;\\n ++S.line;\\n S.col = 0;\\n } else {\\n ++S.col;\\n }\\n return ch;\\n };\\n\\n function eof() {\\n return !S.peek();\\n };\\n\\n function find(what, signal_eof) {\\n var pos = S.text.indexOf(what, S.pos);\\n if (signal_eof && pos == -1) throw EX_EOF;\\n return pos;\\n };\\n\\n function start_token() {\\n S.tokline = S.line;\\n S.tokcol = S.col;\\n S.tokpos = S.pos;\\n };\\n\\n function token(type, value, is_comment) {\\n S.regex_allowed = ((type == \\\"operator\\\" && !HOP(UNARY_POSTFIX, value)) ||\\n (type == \\\"keyword\\\" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) ||\\n (type == \\\"punc\\\" && HOP(PUNC_BEFORE_EXPRESSION, value)));\\n var ret = {\\n type : type,\\n value : value,\\n line : S.tokline,\\n col : S.tokcol,\\n pos : S.tokpos,\\n nlb : S.newline_before\\n };\\n if (!is_comment) {\\n ret.comments_before = S.comments_before;\\n S.comments_before = [];\\n }\\n S.newline_before = false;\\n return ret;\\n };\\n\\n function skip_whitespace() {\\n while (HOP(WHITESPACE_CHARS, peek()))\\n next();\\n };\\n\\n function read_while(pred) {\\n var ret = \\\"\\\", ch = peek(), i = 0;\\n while (ch && pred(ch, i++)) {\\n ret += next();\\n ch = peek();\\n }\\n return ret;\\n };\\n\\n function parse_error(err) {\\n js_error(err, S.tokline, S.tokcol, S.tokpos);\\n };\\n\\n function read_num(prefix) {\\n var has_e = false, after_e = false, has_x = false, has_dot = prefix == \\\".\\\";\\n var num = read_while(function(ch, i){\\n if (ch == \\\"x\\\" || ch == \\\"X\\\") {\\n if (has_x) return false;\\n return has_x = true;\\n }\\n if (!has_x && (ch == \\\"E\\\" || ch == \\\"e\\\")) {\\n if (has_e) return false;\\n return has_e = after_e = true;\\n }\\n if (ch == \\\"-\\\") {\\n if (after_e || (i == 0 && !prefix)) return true;\\n return false;\\n }\\n if (ch == \\\"+\\\") return after_e;\\n after_e = false;\\n if (ch == \\\".\\\") {\\n if (!has_dot && !has_x)\\n return has_dot = true;\\n return false;\\n }\\n return is_alphanumeric_char(ch);\\n });\\n if (prefix)\\n num = prefix + num;\\n var valid = parse_js_number(num);\\n if (!isNaN(valid)) {\\n return token(\\\"num\\\", valid);\\n } else {\\n parse_error(\\\"Invalid syntax: \\\" + num);\\n }\\n };\\n\\n function read_escaped_char() {\\n var ch = next(true);\\n switch (ch) {\\n case \\\"n\\\" : return \\\"\\\\n\\\";\\n case \\\"r\\\" : return \\\"\\\\r\\\";\\n case \\\"t\\\" : return \\\"\\\\t\\\";\\n case \\\"b\\\" : return \\\"\\\\b\\\";\\n case \\\"v\\\" : return \\\"\\\\u000b\\\";\\n case \\\"f\\\" : return \\\"\\\\f\\\";\\n case \\\"0\\\" : return \\\"\\\\0\\\";\\n case \\\"x\\\" : return String.fromCharCode(hex_bytes(2));\\n case \\\"u\\\" : return String.fromCharCode(hex_bytes(4));\\n case \\\"\\\\n\\\": return \\\"\\\";\\n default : return ch;\\n }\\n };\\n\\n function hex_bytes(n) {\\n var num = 0;\\n for (; n > 0; --n) {\\n var digit = parseInt(next(true), 16);\\n if (isNaN(digit))\\n parse_error(\\\"Invalid hex-character pattern in string\\\");\\n num = (num << 4) | digit;\\n }\\n return num;\\n };\\n\\n function read_string() {\\n return with_eof_error(\\\"Unterminated string constant\\\", function(){\\n var quote = next(), ret = \\\"\\\";\\n for (;;) {\\n var ch = next(true);\\n if (ch == \\\"\\\\\\\\\\\") {\\n // read OctalEscapeSequence (XXX: deprecated if \\\"strict mode\\\")\\n // https://github.com/mishoo/UglifyJS/issues/178\\n var octal_len = 0, first = null;\\n ch = read_while(function(ch){\\n if (ch >= \\\"0\\\" && ch <= \\\"7\\\") {\\n if (!first) {\\n first = ch;\\n return ++octal_len;\\n }\\n else if (first <= \\\"3\\\" && octal_len <= 2) return ++octal_len;\\n else if (first >= \\\"4\\\" && octal_len <= 1) return ++octal_len;\\n }\\n return false;\\n });\\n if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));\\n else ch = read_escaped_char();\\n }\\n else if (ch == quote) break;\\n ret += ch;\\n }\\n return token(\\\"string\\\", ret);\\n });\\n };\\n\\n function read_line_comment() {\\n next();\\n var i = find(\\\"\\\\n\\\"), ret;\\n if (i == -1) {\\n ret = S.text.substr(S.pos);\\n S.pos = S.text.length;\\n } else {\\n ret = S.text.substring(S.pos, i);\\n S.pos = i;\\n }\\n return token(\\\"comment1\\\", ret, true);\\n };\\n\\n function read_multiline_comment() {\\n next();\\n return with_eof_error(\\\"Unterminated multiline comment\\\", function(){\\n var i = find(\\\"*/\\\", true),\\n text = S.text.substring(S.pos, i),\\n tok = token(\\\"comment2\\\", text, true);\\n S.pos = i + 2;\\n S.line += text.split(\\\"\\\\n\\\").length - 1;\\n S.newline_before = text.indexOf(\\\"\\\\n\\\") >= 0;\\n\\n // https://github.com/mishoo/UglifyJS/issues/#issue/100\\n if (/^@cc_on/i.test(text)) {\\n warn(\\\"WARNING: at line \\\" + S.line);\\n warn(\\\"*** Found \\\\\\\"conditional comment\\\\\\\": \\\" + text);\\n warn(\\\"*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer.\\\");\\n }\\n\\n return tok;\\n });\\n };\\n\\n function read_name() {\\n var backslash = false, name = \\\"\\\", ch;\\n while ((ch = peek()) != null) {\\n if (!backslash) {\\n if (ch == \\\"\\\\\\\\\\\") backslash = true, next();\\n else if (is_identifier_char(ch)) name += next();\\n else break;\\n }\\n else {\\n if (ch != \\\"u\\\") parse_error(\\\"Expecting UnicodeEscapeSequence -- uXXXX\\\");\\n ch = read_escaped_char();\\n if (!is_identifier_char(ch)) parse_error(\\\"Unicode char: \\\" + ch.charCodeAt(0) + \\\" is not valid in identifier\\\");\\n name += ch;\\n backslash = false;\\n }\\n }\\n return name;\\n };\\n\\n function read_regexp() {\\n return with_eof_error(\\\"Unterminated regular expression\\\", function(){\\n var prev_backslash = false, regexp = \\\"\\\", ch, in_class = false;\\n while ((ch = next(true))) if (prev_backslash) {\\n regexp += \\\"\\\\\\\\\\\" + ch;\\n prev_backslash = false;\\n } else if (ch == \\\"[\\\") {\\n in_class = true;\\n regexp += ch;\\n } else if (ch == \\\"]\\\" && in_class) {\\n in_class = false;\\n regexp += ch;\\n } else if (ch == \\\"/\\\" && !in_class) {\\n break;\\n } else if (ch == \\\"\\\\\\\\\\\") {\\n prev_backslash = true;\\n } else {\\n regexp += ch;\\n }\\n var mods = read_name();\\n return token(\\\"regexp\\\", [ regexp, mods ]);\\n });\\n };\\n\\n function read_operator(prefix) {\\n function grow(op) {\\n if (!peek()) return op;\\n var bigger = op + peek();\\n if (HOP(OPERATORS, bigger)) {\\n next();\\n return grow(bigger);\\n } else {\\n return op;\\n }\\n };\\n return token(\\\"operator\\\", grow(prefix || next()));\\n };\\n\\n function handle_slash() {\\n next();\\n var regex_allowed = S.regex_allowed;\\n switch (peek()) {\\n case \\\"/\\\":\\n S.comments_before.push(read_line_comment());\\n S.regex_allowed = regex_allowed;\\n return next_token();\\n case \\\"*\\\":\\n S.comments_before.push(read_multiline_comment());\\n S.regex_allowed = regex_allowed;\\n return next_token();\\n }\\n return S.regex_allowed ? read_regexp() : read_operator(\\\"/\\\");\\n };\\n\\n function handle_dot() {\\n next();\\n return is_digit(peek())\\n ? read_num(\\\".\\\")\\n : token(\\\"punc\\\", \\\".\\\");\\n };\\n\\n function read_word() {\\n var word = read_name();\\n return !HOP(KEYWORDS, word)\\n ? token(\\\"name\\\", word)\\n : HOP(OPERATORS, word)\\n ? token(\\\"operator\\\", word)\\n : HOP(KEYWORDS_ATOM, word)\\n ? token(\\\"atom\\\", word)\\n : token(\\\"keyword\\\", word);\\n };\\n\\n function with_eof_error(eof_error, cont) {\\n try {\\n return cont();\\n } catch(ex) {\\n if (ex === EX_EOF) parse_error(eof_error);\\n else throw ex;\\n }\\n };\\n\\n function next_token(force_regexp) {\\n if (force_regexp)\\n return read_regexp();\\n skip_whitespace();\\n start_token();\\n var ch = peek();\\n if (!ch) return token(\\\"eof\\\");\\n if (is_digit(ch)) return read_num();\\n if (ch == '\\\"' || ch == \\\"'\\\") return read_string();\\n if (HOP(PUNC_CHARS, ch)) return token(\\\"punc\\\", next());\\n if (ch == \\\".\\\") return handle_dot();\\n if (ch == \\\"/\\\") return handle_slash();\\n if (HOP(OPERATOR_CHARS, ch)) return read_operator();\\n if (ch == \\\"\\\\\\\\\\\" || is_identifier_start(ch)) return read_word();\\n parse_error(\\\"Unexpected character '\\\" + ch + \\\"'\\\");\\n };\\n\\n next_token.context = function(nc) {\\n if (nc) S = nc;\\n return S;\\n };\\n\\n return next_token;\\n\\n};\\n\\n/* -----[ Parser (constants) ]----- */\\n\\nvar UNARY_PREFIX = array_to_hash([\\n \\\"typeof\\\",\\n \\\"void\\\",\\n \\\"delete\\\",\\n \\\"--\\\",\\n \\\"++\\\",\\n \\\"!\\\",\\n \\\"~\\\",\\n \\\"-\\\",\\n \\\"+\\\"\\n]);\\n\\nvar UNARY_POSTFIX = array_to_hash([ \\\"--\\\", \\\"++\\\" ]);\\n\\nvar ASSIGNMENT = (function(a, ret, i){\\n while (i < a.length) {\\n ret[a[i]] = a[i].substr(0, a[i].length - 1);\\n i++;\\n }\\n return ret;\\n})(\\n [\\\"+=\\\", \\\"-=\\\", \\\"/=\\\", \\\"*=\\\", \\\"%=\\\", \\\">>=\\\", \\\"<<=\\\", \\\">>>=\\\", \\\"|=\\\", \\\"^=\\\", \\\"&=\\\"],\\n { \\\"=\\\": true },\\n 0\\n);\\n\\nvar PRECEDENCE = (function(a, ret){\\n for (var i = 0, n = 1; i < a.length; ++i, ++n) {\\n var b = a[i];\\n for (var j = 0; j < b.length; ++j) {\\n ret[b[j]] = n;\\n }\\n }\\n return ret;\\n})(\\n [\\n [\\\"||\\\"],\\n [\\\"&&\\\"],\\n [\\\"|\\\"],\\n [\\\"^\\\"],\\n [\\\"&\\\"],\\n [\\\"==\\\", \\\"===\\\", \\\"!=\\\", \\\"!==\\\"],\\n [\\\"<\\\", \\\">\\\", \\\"<=\\\", \\\">=\\\", \\\"in\\\", \\\"instanceof\\\"],\\n [\\\">>\\\", \\\"<<\\\", \\\">>>\\\"],\\n [\\\"+\\\", \\\"-\\\"],\\n [\\\"*\\\", \\\"/\\\", \\\"%\\\"]\\n ],\\n {}\\n);\\n\\nvar STATEMENTS_WITH_LABELS = array_to_hash([ \\\"for\\\", \\\"do\\\", \\\"while\\\", \\\"switch\\\" ]);\\n\\nvar ATOMIC_START_TOKEN = array_to_hash([ \\\"atom\\\", \\\"num\\\", \\\"string\\\", \\\"regexp\\\", \\\"name\\\" ]);\\n\\n/* -----[ Parser ]----- */\\n\\nfunction NodeWithToken(str, start, end) {\\n this.name = str;\\n this.start = start;\\n this.end = end;\\n};\\n\\nNodeWithToken.prototype.toString = function() { return this.name; };\\n\\nfunction parse($TEXT, exigent_mode, embed_tokens) {\\n\\n var S = {\\n input : typeof $TEXT == \\\"string\\\" ? tokenizer($TEXT, true) : $TEXT,\\n token : null,\\n prev : null,\\n peeked : null,\\n in_function : 0,\\n in_loop : 0,\\n labels : []\\n };\\n\\n S.token = next();\\n\\n function is(type, value) {\\n return is_token(S.token, type, value);\\n };\\n\\n function peek() { return S.peeked || (S.peeked = S.input()); };\\n\\n function next() {\\n S.prev = S.token;\\n if (S.peeked) {\\n S.token = S.peeked;\\n S.peeked = null;\\n } else {\\n S.token = S.input();\\n }\\n return S.token;\\n };\\n\\n function prev() {\\n return S.prev;\\n };\\n\\n function croak(msg, line, col, pos) {\\n var ctx = S.input.context();\\n js_error(msg,\\n line != null ? line : ctx.tokline,\\n col != null ? col : ctx.tokcol,\\n pos != null ? pos : ctx.tokpos);\\n };\\n\\n function token_error(token, msg) {\\n croak(msg, token.line, token.col);\\n };\\n\\n function unexpected(token) {\\n if (token == null)\\n token = S.token;\\n token_error(token, \\\"Unexpected token: \\\" + token.type + \\\" (\\\" + token.value + \\\")\\\");\\n };\\n\\n function expect_token(type, val) {\\n if (is(type, val)) {\\n return next();\\n }\\n token_error(S.token, \\\"Unexpected token \\\" + S.token.type + \\\", expected \\\" + type);\\n };\\n\\n function expect(punc) { return expect_token(\\\"punc\\\", punc); };\\n\\n function can_insert_semicolon() {\\n return !exigent_mode && (\\n S.token.nlb || is(\\\"eof\\\") || is(\\\"punc\\\", \\\"}\\\")\\n );\\n };\\n\\n function semicolon() {\\n if (is(\\\"punc\\\", \\\";\\\")) next();\\n else if (!can_insert_semicolon()) unexpected();\\n };\\n\\n function as() {\\n return slice(arguments);\\n };\\n\\n function parenthesised() {\\n expect(\\\"(\\\");\\n var ex = expression();\\n expect(\\\")\\\");\\n return ex;\\n };\\n\\n function add_tokens(str, start, end) {\\n return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end);\\n };\\n\\n function maybe_embed_tokens(parser) {\\n if (embed_tokens) return function() {\\n var start = S.token;\\n var ast = parser.apply(this, arguments);\\n ast[0] = add_tokens(ast[0], start, prev());\\n return ast;\\n };\\n else return parser;\\n };\\n\\n var statement = maybe_embed_tokens(function() {\\n if (is(\\\"operator\\\", \\\"/\\\")) {\\n S.peeked = null;\\n S.token = S.input(true); // force regexp\\n }\\n switch (S.token.type) {\\n case \\\"num\\\":\\n case \\\"string\\\":\\n case \\\"regexp\\\":\\n case \\\"operator\\\":\\n case \\\"atom\\\":\\n return simple_statement();\\n\\n case \\\"name\\\":\\n return is_token(peek(), \\\"punc\\\", \\\":\\\")\\n ? labeled_statement(prog1(S.token.value, next, next))\\n : simple_statement();\\n\\n case \\\"punc\\\":\\n switch (S.token.value) {\\n case \\\"{\\\":\\n return as(\\\"block\\\", block_());\\n case \\\"[\\\":\\n case \\\"(\\\":\\n return simple_statement();\\n case \\\";\\\":\\n next();\\n return as(\\\"block\\\");\\n default:\\n unexpected();\\n }\\n\\n case \\\"keyword\\\":\\n switch (prog1(S.token.value, next)) {\\n case \\\"break\\\":\\n return break_cont(\\\"break\\\");\\n\\n case \\\"continue\\\":\\n return break_cont(\\\"continue\\\");\\n\\n case \\\"debugger\\\":\\n semicolon();\\n return as(\\\"debugger\\\");\\n\\n case \\\"do\\\":\\n return (function(body){\\n expect_token(\\\"keyword\\\", \\\"while\\\");\\n return as(\\\"do\\\", prog1(parenthesised, semicolon), body);\\n })(in_loop(statement));\\n\\n case \\\"for\\\":\\n return for_();\\n\\n case \\\"function\\\":\\n return function_(true);\\n\\n case \\\"if\\\":\\n return if_();\\n\\n case \\\"return\\\":\\n if (S.in_function == 0)\\n croak(\\\"'return' outside of function\\\");\\n return as(\\\"return\\\",\\n is(\\\"punc\\\", \\\";\\\")\\n ? (next(), null)\\n : can_insert_semicolon()\\n ? null\\n : prog1(expression, semicolon));\\n\\n case \\\"switch\\\":\\n return as(\\\"switch\\\", parenthesised(), switch_block_());\\n\\n case \\\"throw\\\":\\n return as(\\\"throw\\\", prog1(expression, semicolon));\\n\\n case \\\"try\\\":\\n return try_();\\n\\n case \\\"var\\\":\\n return prog1(var_, semicolon);\\n\\n case \\\"const\\\":\\n return prog1(const_, semicolon);\\n\\n case \\\"while\\\":\\n return as(\\\"while\\\", parenthesised(), in_loop(statement));\\n\\n case \\\"with\\\":\\n return as(\\\"with\\\", parenthesised(), statement());\\n\\n default:\\n unexpected();\\n }\\n }\\n });\\n\\n function labeled_statement(label) {\\n S.labels.push(label);\\n var start = S.token, stat = statement();\\n if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0]))\\n unexpected(start);\\n S.labels.pop();\\n return as(\\\"label\\\", label, stat);\\n };\\n\\n function simple_statement() {\\n return as(\\\"stat\\\", prog1(expression, semicolon));\\n };\\n\\n function break_cont(type) {\\n var name;\\n if (!can_insert_semicolon()) {\\n name = is(\\\"name\\\") ? S.token.value : null;\\n }\\n if (name != null) {\\n next();\\n if (!member(name, S.labels))\\n croak(\\\"Label \\\" + name + \\\" without matching loop or statement\\\");\\n }\\n else if (S.in_loop == 0)\\n croak(type + \\\" not inside a loop or switch\\\");\\n semicolon();\\n return as(type, name);\\n };\\n\\n function for_() {\\n expect(\\\"(\\\");\\n var init = null;\\n if (!is(\\\"punc\\\", \\\";\\\")) {\\n init = is(\\\"keyword\\\", \\\"var\\\")\\n ? (next(), var_(true))\\n : expression(true, true);\\n if (is(\\\"operator\\\", \\\"in\\\"))\\n return for_in(init);\\n }\\n return regular_for(init);\\n };\\n\\n function regular_for(init) {\\n expect(\\\";\\\");\\n var test = is(\\\"punc\\\", \\\";\\\") ? null : expression();\\n expect(\\\";\\\");\\n var step = is(\\\"punc\\\", \\\")\\\") ? null : expression();\\n expect(\\\")\\\");\\n return as(\\\"for\\\", init, test, step, in_loop(statement));\\n };\\n\\n function for_in(init) {\\n var lhs = init[0] == \\\"var\\\" ? as(\\\"name\\\", init[1][0]) : init;\\n next();\\n var obj = expression();\\n expect(\\\")\\\");\\n return as(\\\"for-in\\\", init, lhs, obj, in_loop(statement));\\n };\\n\\n var function_ = maybe_embed_tokens(function(in_statement) {\\n var name = is(\\\"name\\\") ? prog1(S.token.value, next) : null;\\n if (in_statement && !name)\\n unexpected();\\n expect(\\\"(\\\");\\n return as(in_statement ? \\\"defun\\\" : \\\"function\\\",\\n name,\\n // arguments\\n (function(first, a){\\n while (!is(\\\"punc\\\", \\\")\\\")) {\\n if (first) first = false; else expect(\\\",\\\");\\n if (!is(\\\"name\\\")) unexpected();\\n a.push(S.token.value);\\n next();\\n }\\n next();\\n return a;\\n })(true, []),\\n // body\\n (function(){\\n ++S.in_function;\\n var loop = S.in_loop;\\n S.in_loop = 0;\\n var a = block_();\\n --S.in_function;\\n S.in_loop = loop;\\n return a;\\n })());\\n });\\n\\n function if_() {\\n var cond = parenthesised(), body = statement(), belse;\\n if (is(\\\"keyword\\\", \\\"else\\\")) {\\n next();\\n belse = statement();\\n }\\n return as(\\\"if\\\", cond, body, belse);\\n };\\n\\n function block_() {\\n expect(\\\"{\\\");\\n var a = [];\\n while (!is(\\\"punc\\\", \\\"}\\\")) {\\n if (is(\\\"eof\\\")) unexpected();\\n a.push(statement());\\n }\\n next();\\n return a;\\n };\\n\\n var switch_block_ = curry(in_loop, function(){\\n expect(\\\"{\\\");\\n var a = [], cur = null;\\n while (!is(\\\"punc\\\", \\\"}\\\")) {\\n if (is(\\\"eof\\\")) unexpected();\\n if (is(\\\"keyword\\\", \\\"case\\\")) {\\n next();\\n cur = [];\\n a.push([ expression(), cur ]);\\n expect(\\\":\\\");\\n }\\n else if (is(\\\"keyword\\\", \\\"default\\\")) {\\n next();\\n expect(\\\":\\\");\\n cur = [];\\n a.push([ null, cur ]);\\n }\\n else {\\n if (!cur) unexpected();\\n cur.push(statement());\\n }\\n }\\n next();\\n return a;\\n });\\n\\n function try_() {\\n var body = block_(), bcatch, bfinally;\\n if (is(\\\"keyword\\\", \\\"catch\\\")) {\\n next();\\n expect(\\\"(\\\");\\n if (!is(\\\"name\\\"))\\n croak(\\\"Name expected\\\");\\n var name = S.token.value;\\n next();\\n expect(\\\")\\\");\\n bcatch = [ name, block_() ];\\n }\\n if (is(\\\"keyword\\\", \\\"finally\\\")) {\\n next();\\n bfinally = block_();\\n }\\n if (!bcatch && !bfinally)\\n croak(\\\"Missing catch/finally blocks\\\");\\n return as(\\\"try\\\", body, bcatch, bfinally);\\n };\\n\\n function vardefs(no_in) {\\n var a = [];\\n for (;;) {\\n if (!is(\\\"name\\\"))\\n unexpected();\\n var name = S.token.value;\\n next();\\n if (is(\\\"operator\\\", \\\"=\\\")) {\\n next();\\n a.push([ name, expression(false, no_in) ]);\\n } else {\\n a.push([ name ]);\\n }\\n if (!is(\\\"punc\\\", \\\",\\\"))\\n break;\\n next();\\n }\\n return a;\\n };\\n\\n function var_(no_in) {\\n return as(\\\"var\\\", vardefs(no_in));\\n };\\n\\n function const_() {\\n return as(\\\"const\\\", vardefs());\\n };\\n\\n function new_() {\\n var newexp = expr_atom(false), args;\\n if (is(\\\"punc\\\", \\\"(\\\")) {\\n next();\\n args = expr_list(\\\")\\\");\\n } else {\\n args = [];\\n }\\n return subscripts(as(\\\"new\\\", newexp, args), true);\\n };\\n\\n var expr_atom = maybe_embed_tokens(function(allow_calls) {\\n if (is(\\\"operator\\\", \\\"new\\\")) {\\n next();\\n return new_();\\n }\\n if (is(\\\"punc\\\")) {\\n switch (S.token.value) {\\n case \\\"(\\\":\\n next();\\n return subscripts(prog1(expression, curry(expect, \\\")\\\")), allow_calls);\\n case \\\"[\\\":\\n next();\\n return subscripts(array_(), allow_calls);\\n case \\\"{\\\":\\n next();\\n return subscripts(object_(), allow_calls);\\n }\\n unexpected();\\n }\\n if (is(\\\"keyword\\\", \\\"function\\\")) {\\n next();\\n return subscripts(function_(false), allow_calls);\\n }\\n if (HOP(ATOMIC_START_TOKEN, S.token.type)) {\\n var atom = S.token.type == \\\"regexp\\\"\\n ? as(\\\"regexp\\\", S.token.value[0], S.token.value[1])\\n : as(S.token.type, S.token.value);\\n return subscripts(prog1(atom, next), allow_calls);\\n }\\n unexpected();\\n });\\n\\n function expr_list(closing, allow_trailing_comma, allow_empty) {\\n var first = true, a = [];\\n while (!is(\\\"punc\\\", closing)) {\\n if (first) first = false; else expect(\\\",\\\");\\n if (allow_trailing_comma && is(\\\"punc\\\", closing)) break;\\n if (is(\\\"punc\\\", \\\",\\\") && allow_empty) {\\n a.push([ \\\"atom\\\", \\\"undefined\\\" ]);\\n } else {\\n a.push(expression(false));\\n }\\n }\\n next();\\n return a;\\n };\\n\\n function array_() {\\n return as(\\\"array\\\", expr_list(\\\"]\\\", !exigent_mode, true));\\n };\\n\\n function object_() {\\n var first = true, a = [];\\n while (!is(\\\"punc\\\", \\\"}\\\")) {\\n if (first) first = false; else expect(\\\",\\\");\\n if (!exigent_mode && is(\\\"punc\\\", \\\"}\\\"))\\n // allow trailing comma\\n break;\\n var type = S.token.type;\\n var name = as_property_name();\\n if (type == \\\"name\\\" && (name == \\\"get\\\" || name == \\\"set\\\") && !is(\\\"punc\\\", \\\":\\\")) {\\n a.push([ as_name(), function_(false), name ]);\\n } else {\\n expect(\\\":\\\");\\n a.push([ name, expression(false) ]);\\n }\\n }\\n next();\\n return as(\\\"object\\\", a);\\n };\\n\\n function as_property_name() {\\n switch (S.token.type) {\\n case \\\"num\\\":\\n case \\\"string\\\":\\n return prog1(S.token.value, next);\\n }\\n return as_name();\\n };\\n\\n function as_name() {\\n switch (S.token.type) {\\n case \\\"name\\\":\\n case \\\"operator\\\":\\n case \\\"keyword\\\":\\n case \\\"atom\\\":\\n return prog1(S.token.value, next);\\n default:\\n unexpected();\\n }\\n };\\n\\n function subscripts(expr, allow_calls) {\\n if (is(\\\"punc\\\", \\\".\\\")) {\\n next();\\n return subscripts(as(\\\"dot\\\", expr, as_name()), allow_calls);\\n }\\n if (is(\\\"punc\\\", \\\"[\\\")) {\\n next();\\n return subscripts(as(\\\"sub\\\", expr, prog1(expression, curry(expect, \\\"]\\\"))), allow_calls);\\n }\\n if (allow_calls && is(\\\"punc\\\", \\\"(\\\")) {\\n next();\\n return subscripts(as(\\\"call\\\", expr, expr_list(\\\")\\\")), true);\\n }\\n return expr;\\n };\\n\\n function maybe_unary(allow_calls) {\\n if (is(\\\"operator\\\") && HOP(UNARY_PREFIX, S.token.value)) {\\n return make_unary(\\\"unary-prefix\\\",\\n prog1(S.token.value, next),\\n maybe_unary(allow_calls));\\n }\\n var val = expr_atom(allow_calls);\\n while (is(\\\"operator\\\") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) {\\n val = make_unary(\\\"unary-postfix\\\", S.token.value, val);\\n next();\\n }\\n return val;\\n };\\n\\n function make_unary(tag, op, expr) {\\n if ((op == \\\"++\\\" || op == \\\"--\\\") && !is_assignable(expr))\\n croak(\\\"Invalid use of \\\" + op + \\\" operator\\\");\\n return as(tag, op, expr);\\n };\\n\\n function expr_op(left, min_prec, no_in) {\\n var op = is(\\\"operator\\\") ? S.token.value : null;\\n if (op && op == \\\"in\\\" && no_in) op = null;\\n var prec = op != null ? PRECEDENCE[op] : null;\\n if (prec != null && prec > min_prec) {\\n next();\\n var right = expr_op(maybe_unary(true), prec, no_in);\\n return expr_op(as(\\\"binary\\\", op, left, right), min_prec, no_in);\\n }\\n return left;\\n };\\n\\n function expr_ops(no_in) {\\n return expr_op(maybe_unary(true), 0, no_in);\\n };\\n\\n function maybe_conditional(no_in) {\\n var expr = expr_ops(no_in);\\n if (is(\\\"operator\\\", \\\"?\\\")) {\\n next();\\n var yes = expression(false);\\n expect(\\\":\\\");\\n return as(\\\"conditional\\\", expr, yes, expression(false, no_in));\\n }\\n return expr;\\n };\\n\\n function is_assignable(expr) {\\n if (!exigent_mode) return true;\\n switch (expr[0]+\\\"\\\") {\\n case \\\"dot\\\":\\n case \\\"sub\\\":\\n case \\\"new\\\":\\n case \\\"call\\\":\\n return true;\\n case \\\"name\\\":\\n return expr[1] != \\\"this\\\";\\n }\\n };\\n\\n function maybe_assign(no_in) {\\n var left = maybe_conditional(no_in), val = S.token.value;\\n if (is(\\\"operator\\\") && HOP(ASSIGNMENT, val)) {\\n if (is_assignable(left)) {\\n next();\\n return as(\\\"assign\\\", ASSIGNMENT[val], left, maybe_assign(no_in));\\n }\\n croak(\\\"Invalid assignment\\\");\\n }\\n return left;\\n };\\n\\n var expression = maybe_embed_tokens(function(commas, no_in) {\\n if (arguments.length == 0)\\n commas = true;\\n var expr = maybe_assign(no_in);\\n if (commas && is(\\\"punc\\\", \\\",\\\")) {\\n next();\\n return as(\\\"seq\\\", expr, expression(true, no_in));\\n }\\n return expr;\\n });\\n\\n function in_loop(cont) {\\n try {\\n ++S.in_loop;\\n return cont();\\n } finally {\\n --S.in_loop;\\n }\\n };\\n\\n return as(\\\"toplevel\\\", (function(a){\\n while (!is(\\\"eof\\\"))\\n a.push(statement());\\n return a;\\n })([]));\\n\\n};\\n\\n/* -----[ Utilities ]----- */\\n\\nfunction curry(f) {\\n var args = slice(arguments, 1);\\n return function() { return f.apply(this, args.concat(slice(arguments))); };\\n};\\n\\nfunction prog1(ret) {\\n if (ret instanceof Function)\\n ret = ret();\\n for (var i = 1, n = arguments.length; --n > 0; ++i)\\n arguments[i]();\\n return ret;\\n};\\n\\nfunction array_to_hash(a) {\\n var ret = {};\\n for (var i = 0; i < a.length; ++i)\\n ret[a[i]] = true;\\n return ret;\\n};\\n\\nfunction slice(a, start) {\\n return Array.prototype.slice.call(a, start || 0);\\n};\\n\\nfunction characters(str) {\\n return str.split(\\\"\\\");\\n};\\n\\nfunction member(name, array) {\\n for (var i = array.length; --i >= 0;)\\n if (array[i] === name)\\n return true;\\n return false;\\n};\\n\\nfunction HOP(obj, prop) {\\n return Object.prototype.hasOwnProperty.call(obj, prop);\\n};\\n\\nvar warn = function() {};\\n\\n/* -----[ Exports ]----- */\\n\\nexports.tokenizer = tokenizer;\\nexports.parse = parse;\\nexports.slice = slice;\\nexports.curry = curry;\\nexports.member = member;\\nexports.array_to_hash = array_to_hash;\\nexports.PRECEDENCE = PRECEDENCE;\\nexports.KEYWORDS_ATOM = KEYWORDS_ATOM;\\nexports.RESERVED_WORDS = RESERVED_WORDS;\\nexports.KEYWORDS = KEYWORDS;\\nexports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;\\nexports.OPERATORS = OPERATORS;\\nexports.is_alphanumeric_char = is_alphanumeric_char;\\nexports.set_logger = function(logger) {\\n warn = logger;\\n};\\n\";\n CTX.additionalContext=CTX.minify=function(body) { return body; };\n\nreturn eval(\"(BPM_PLUGIN.compileTransport(DATA, CTX, 'C:/Users/Jeff/.bpm/gems/uglify-js-1.0.7/lib/parse-js.js'))\") })()");
}, function(program) {
var output;
try {
result = program();
if (typeof result == 'undefined' && result !== null) {
print('["ok"]');
} else {
try {
print(JSON.stringify(['ok', result]));
} catch (err) {
print('["err"]');
}
}
} catch (err) {
print(JSON.stringify(['err', '' + err]));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment