pict 1.0.51 → 1.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pict.compatible.js +44 -476
- package/dist/pict.compatible.min.js +2 -2
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +44 -476
- package/dist/pict.min.js +2 -2
- package/dist/pict.min.js.map +1 -1
- package/package.json +2 -3
- package/source/Pict.js +1 -3
package/dist/pict.compatible.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _defineProperty2(obj,key,value){key=_toPropertyKey2(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _classCallCheck2(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey2(descriptor.key),descriptor);}}function _createClass2(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey2(arg){var key=_toPrimitive2(arg,"string");return _typeof(key)==="symbol"?key:String(key);}function _toPrimitive2(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}(function(f){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"){module.exports=f();}else if(typeof define==="function"&&define.amd){define([],f);}else{var g;if(typeof window!=="undefined"){g=window;}else if(typeof global!=="undefined"){g=global;}else if(typeof self!=="undefined"){g=self;}else{g=this;}g.Pict=f();}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a;}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r);},p,p.exports,r,e,n,t);}return n[i].exports;}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o;}return r;}()({1:[function(require,module,exports){'use strict';var eachOfLimit=require('async.util.eachoflimit');var withoutIndex=require('async.util.withoutindex');module.exports=function eachLimit(arr,limit,iterator,cb){return eachOfLimit(limit)(arr,withoutIndex(iterator),cb);};},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(require,module,exports){'use strict';module.exports=function(tasks){function makeCallback(index){function fn(){if(tasks.length){tasks[index].apply(null,arguments);}return fn.next();}fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null;};return fn;}return makeCallback(0);};},{}],3:[function(require,module,exports){var once=require('async.util.once');var noop=require('async.util.noop');var onlyOnce=require('async.util.onlyonce');var keyIterator=require('async.util.keyiterator');module.exports=function eachOfLimit(limit){return function(obj,iterator,cb){cb=once(cb||noop);obj=obj||[];var nextKey=keyIterator(obj);if(limit<=0){return cb(null);}var done=false;var running=0;var errored=false;(function replenish(){if(done&&running<=0){return cb(null);}while(running<limit&&!errored){var key=nextKey();if(key===null){done=true;if(running<=0){cb(null);}return;}running+=1;iterator(obj[key],key,onlyOnce(function(err){running-=1;if(err){cb(err);errored=true;}else{replenish();}}));}})();};};},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(require,module,exports){'use strict';var setImmediate=require('async.util.setimmediate');var restParam=require('async.util.restparam');module.exports=function(fn){return restParam(function(args){var callback=args.pop();args.push(function(){var innerArgs=arguments;if(sync){setImmediate(function(){callback.apply(null,innerArgs);});}else{callback.apply(null,innerArgs);}});var sync=true;fn.apply(this,args);sync=false;});};},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(require,module,exports){'use strict';module.exports=Array.isArray||function isArray(obj){return Object.prototype.toString.call(obj)==='[object Array]';};},{}],6:[function(require,module,exports){'use strict';var isArray=require('async.util.isarray');module.exports=function isArrayLike(arr){return isArray(arr)||// has a positive integer length property
|
|
2
2
|
typeof arr.length==='number'&&arr.length>=0&&arr.length%1===0;};},{"async.util.isarray":5}],7:[function(require,module,exports){'use strict';var _keys=require('async.util.keys');var isArrayLike=require('async.util.isarraylike');module.exports=function keyIterator(coll){var i=-1;var len;var keys;if(isArrayLike(coll)){len=coll.length;return function next(){i++;return i<len?i:null;};}else{keys=_keys(coll);len=keys.length;return function next(){i++;return i<len?keys[i]:null;};}};},{"async.util.isarraylike":6,"async.util.keys":8}],8:[function(require,module,exports){'use strict';module.exports=Object.keys||function keys(obj){var _keys=[];for(var k in obj){if(obj.hasOwnProperty(k)){_keys.push(k);}}return _keys;};},{}],9:[function(require,module,exports){'use strict';module.exports=function noop(){};},{}],10:[function(require,module,exports){'use strict';module.exports=function once(fn){return function(){if(fn===null)return;fn.apply(this,arguments);fn=null;};};},{}],11:[function(require,module,exports){'use strict';module.exports=function only_once(fn){return function(){if(fn===null)throw new Error('Callback was already called.');fn.apply(this,arguments);fn=null;};};},{}],12:[function(require,module,exports){'use strict';module.exports=function restParam(func,startIndex){startIndex=startIndex==null?func.length-1:+startIndex;return function(){var length=Math.max(arguments.length-startIndex,0);var rest=new Array(length);for(var index=0;index<length;index++){rest[index]=arguments[index+startIndex];}switch(startIndex){case 0:return func.call(this,rest);case 1:return func.call(this,arguments[0],rest);}};};},{}],13:[function(require,module,exports){(function(setImmediate){(function(){'use strict';var _setImmediate=typeof setImmediate==='function'&&setImmediate;var fallback=function fallback(fn){setTimeout(fn,0);};module.exports=function setImmediate(fn){// not a direct alias for IE10 compatibility
|
|
3
|
-
return(_setImmediate||fallback)(fn);};}).call(this);}).call(this,require("timers").setImmediate);},{"timers":
|
|
3
|
+
return(_setImmediate||fallback)(fn);};}).call(this);}).call(this,require("timers").setImmediate);},{"timers":98}],14:[function(require,module,exports){'use strict';module.exports=function withoutIndex(iterator){return function(value,index,callback){return iterator(value,callback);};};},{}],15:[function(require,module,exports){'use strict';var once=require('async.util.once');var noop=require('async.util.noop');var isArray=require('async.util.isarray');var restParam=require('async.util.restparam');var ensureAsync=require('async.util.ensureasync');var iterator=require('async.iterator');module.exports=function(tasks,cb){cb=once(cb||noop);if(!isArray(tasks))return cb(new Error('First argument to waterfall must be an array of functions'));if(!tasks.length)return cb();function wrapIterator(iterator){return restParam(function(err,args){if(err){cb.apply(null,[err].concat(args));}else{var next=iterator.next();if(next){args.push(wrapIterator(next));}else{args.push(cb);}ensureAsync(iterator).apply(null,args);}});}wrapIterator(iterator(tasks))();};},{"async.iterator":2,"async.util.ensureasync":4,"async.util.isarray":5,"async.util.noop":9,"async.util.once":10,"async.util.restparam":12}],16:[function(require,module,exports){'use strict';exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i;}// Support decoding URL-safe base64 strings, as Node.js does.
|
|
4
4
|
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
5
5
|
revLookup['-'.charCodeAt(0)]=62;revLookup['_'.charCodeAt(0)]=63;function getLens(b64){var len=b64.length;if(len%4>0){throw new Error('Invalid string. Length must be a multiple of 4');}// Trim off extra bytes after placeholder bytes are found
|
|
6
6
|
// See: https://github.com/beatgammit/base64-js/issues/42
|
|
@@ -335,7 +335,7 @@ var tmpConstructedBufferOutputString='';for(var i=0;i<tmpLineStrings.length;i++)
|
|
|
335
335
|
tmpConstructedBufferOutputString+="".concat(tmpLineStrings[i],"\n");if(tmpObjectStrings[i]!==false){tmpConstructedBufferOutputString+="".concat(tmpObjectStrings[i],"\n");}}if(!this.fileWriter.write(tmpConstructedBufferOutputString,'utf8')){// If the streamwriter returns false, we need to wait for it to drain.
|
|
336
336
|
this.fileWriter.once('drain',this.completeBufferFlushToLogFile.bind(this,tmpFlushComplete));}else{return this.completeBufferFlushToLogFile(tmpFlushComplete);}}}},{key:"write",value:function write(pLevel,pLogText,pObject){var tmpLogLine=_get(_getPrototypeOf(SimpleFlatFileLogger.prototype),"write",this).call(this,pLevel,pLogText,pObject);// Use a very simple array as the write buffer
|
|
337
337
|
this.logLineStrings.push(tmpLogLine);// Write out the object on a separate line if it is passed in
|
|
338
|
-
if(typeof pObject!=='undefined'){this.logObjectStrings.push(JSON.stringify(pObject,null,4));}else{this.logObjectStrings.push(false);}this.flushBufferToLogFile();}}]);return SimpleFlatFileLogger;}(libConsoleLog);module.exports=SimpleFlatFileLogger;},{"./Fable-Log-Logger-Console.js":28,"fs":18,"path":
|
|
338
|
+
if(typeof pObject!=='undefined'){this.logObjectStrings.push(JSON.stringify(pObject,null,4));}else{this.logObjectStrings.push(false);}this.flushBufferToLogFile();}}]);return SimpleFlatFileLogger;}(libConsoleLog);module.exports=SimpleFlatFileLogger;},{"./Fable-Log-Logger-Console.js":28,"fs":18,"path":66}],30:[function(require,module,exports){/**
|
|
339
339
|
* Fable Logging Service
|
|
340
340
|
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;var FableLog=/*#__PURE__*/function(_libFableServiceProvi2){_inherits(FableLog,_libFableServiceProvi2);var _super4=_createSuper(FableLog);function FableLog(pSettings,pServiceHash){var _this8;_classCallCheck2(this,FableLog);_this8=_super4.call(this,pSettings,pServiceHash);_this8.serviceType='Logging';var tmpSettings=_typeof(pSettings)==='object'?pSettings:{};_this8._Settings=tmpSettings;_this8._Providers=require('./Fable-Log-DefaultProviders-Node.js');_this8._StreamDefinitions=tmpSettings.hasOwnProperty('LogStreams')?tmpSettings.LogStreams:require('./Fable-Log-DefaultStreams.json');_this8.logStreams=[];// This object gets decorated for one-time instantiated providers that
|
|
341
341
|
// have multiple outputs, such as bunyan.
|
|
@@ -371,7 +371,7 @@ function connectFable(pFable){this.fable=pFable;return true;}}]);return FableCor
|
|
|
371
371
|
*/var libPrecedent=require('precedent');var FableSettingsTemplateProcessor=/*#__PURE__*/function(){function FableSettingsTemplateProcessor(pDependencies){_classCallCheck2(this,FableSettingsTemplateProcessor);// Use a no-dependencies templating engine to parse out environment variables
|
|
372
372
|
this.templateProcessor=new libPrecedent();// TODO: Make the environment variable wrap expression demarcation characters configurable?
|
|
373
373
|
this.templateProcessor.addPattern('${','}',function(pTemplateValue){var tmpTemplateValue=pTemplateValue.trim();var tmpSeparatorIndex=tmpTemplateValue.indexOf('|');// If there is no pipe, the default value will end up being whatever the variable name is.
|
|
374
|
-
var tmpDefaultValue=tmpTemplateValue.substring(tmpSeparatorIndex+1);var tmpEnvironmentVariableName=tmpSeparatorIndex>-1?tmpTemplateValue.substring(0,tmpSeparatorIndex):tmpTemplateValue;if(process.env.hasOwnProperty(tmpEnvironmentVariableName)){return process.env[tmpEnvironmentVariableName];}else{return tmpDefaultValue;}});}_createClass2(FableSettingsTemplateProcessor,[{key:"parseSetting",value:function parseSetting(pString){return this.templateProcessor.parseString(pString);}}]);return FableSettingsTemplateProcessor;}();module.exports=FableSettingsTemplateProcessor;}).call(this);}).call(this,require('_process'));},{"_process":
|
|
374
|
+
var tmpDefaultValue=tmpTemplateValue.substring(tmpSeparatorIndex+1);var tmpEnvironmentVariableName=tmpSeparatorIndex>-1?tmpTemplateValue.substring(0,tmpSeparatorIndex):tmpTemplateValue;if(process.env.hasOwnProperty(tmpEnvironmentVariableName)){return process.env[tmpEnvironmentVariableName];}else{return tmpDefaultValue;}});}_createClass2(FableSettingsTemplateProcessor,[{key:"parseSetting",value:function parseSetting(pString){return this.templateProcessor.parseString(pString);}}]);return FableSettingsTemplateProcessor;}();module.exports=FableSettingsTemplateProcessor;}).call(this);}).call(this,require('_process'));},{"_process":70,"precedent":67}],35:[function(require,module,exports){/**
|
|
375
375
|
* Fable Settings Add-on
|
|
376
376
|
*
|
|
377
377
|
*
|
|
@@ -828,7 +828,7 @@ for(var i=0;i<pPatternStart.length;i++)tmpLeaf=this.addChild(tmpLeaf,pPatternSta
|
|
|
828
828
|
_this20.prepareRequestOptions=function(pOptions){return pOptions;};return _this20;}_createClass2(FableServiceRestClient,[{key:"preRequest",value:function preRequest(pOptions){// Validate the options object
|
|
829
829
|
return this.prepareRequestOptions(pOptions);}},{key:"executeChunkedRequest",value:function executeChunkedRequest(pOptions,fCallback){var _this21=this;var tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this21.TraceLog){var tmpConnectTime=_this21.fable.log.getTimeStamp();_this21.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this21.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpData='';pResponse.on('data',function(pChunk){// For JSON, the chunk is the serialized object.
|
|
830
830
|
if(_this21.TraceLog){var tmpChunkTime=_this21.fable.log.getTimeStamp();_this21.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this21.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpData+=pChunk;});pResponse.on('end',function(){if(_this21.TraceLog){var tmpCompletionTime=_this21.fable.log.getTimeStamp();_this21.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpData.length,"b received in ").concat(_this21.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpData);});});}},{key:"executeJSONRequest",value:function executeJSONRequest(pOptions,fCallback){var _this22=this;pOptions.json=true;var tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," JSON request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this22.TraceLog){var tmpConnectTime=_this22.fable.log.getTimeStamp();_this22.fable.log.debug("--> JSON ".concat(tmpOptions.method," connected in ").concat(_this22.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}pResponse.on('data',function(pChunk){if(_this22.TraceLog){var tmpChunkTime=_this22.fable.log.getTimeStamp();_this22.fable.log.debug("--> JSON ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this22.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}// In a JSON request, the chunk is the serialized method.
|
|
831
|
-
return fCallback(pError,pResponse,JSON.parse(pChunk));});pResponse.on('end',function(){if(_this22.TraceLog){var tmpCompletionTime=_this22.fable.log.getTimeStamp();_this22.fable.log.debug("==> JSON ".concat(tmpOptions.method," completed - received in ").concat(_this22.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}});});}},{key:"getJSON",value:function getJSON(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeJSONRequest(tmpRequestOptions,fCallback);}},{key:"putJSON",value:function putJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PUT JSON Error Invalid options object"));}pOptions.method='PUT';return this.executeJSONRequest(pOptions,fCallback);}},{key:"postJSON",value:function postJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("POST JSON Error Invalid options object"));}pOptions.method='POST';return this.executeJSONRequest(pOptions,fCallback);}},{key:"patchJSON",value:function patchJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PATCH JSON Error Invalid options object"));}pOptions.method='PATCH';return this.executeJSONRequest(pOptions,fCallback);}},{key:"headJSON",value:function headJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("HEAD JSON Error Invalid options object"));}pOptions.method='HEAD';return this.executeJSONRequest(pOptions,fCallback);}},{key:"delJSON",value:function delJSON(pOptions,fCallback){pOptions.method='DELETE';return this.executeJSONRequest(pOptions,fCallback);}},{key:"getRawText",value:function getRawText(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeChunkedRequest(tmpRequestOptions,fCallback);}}]);return FableServiceRestClient;}(libFableServiceBase);module.exports=FableServiceRestClient;},{"../Fable-ServiceManager.js":38,"simple-get":
|
|
831
|
+
return fCallback(pError,pResponse,JSON.parse(pChunk));});pResponse.on('end',function(){if(_this22.TraceLog){var tmpCompletionTime=_this22.fable.log.getTimeStamp();_this22.fable.log.debug("==> JSON ".concat(tmpOptions.method," completed - received in ").concat(_this22.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}});});}},{key:"getJSON",value:function getJSON(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeJSONRequest(tmpRequestOptions,fCallback);}},{key:"putJSON",value:function putJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PUT JSON Error Invalid options object"));}pOptions.method='PUT';return this.executeJSONRequest(pOptions,fCallback);}},{key:"postJSON",value:function postJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("POST JSON Error Invalid options object"));}pOptions.method='POST';return this.executeJSONRequest(pOptions,fCallback);}},{key:"patchJSON",value:function patchJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PATCH JSON Error Invalid options object"));}pOptions.method='PATCH';return this.executeJSONRequest(pOptions,fCallback);}},{key:"headJSON",value:function headJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("HEAD JSON Error Invalid options object"));}pOptions.method='HEAD';return this.executeJSONRequest(pOptions,fCallback);}},{key:"delJSON",value:function delJSON(pOptions,fCallback){pOptions.method='DELETE';return this.executeJSONRequest(pOptions,fCallback);}},{key:"getRawText",value:function getRawText(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeChunkedRequest(tmpRequestOptions,fCallback);}}]);return FableServiceRestClient;}(libFableServiceBase);module.exports=FableServiceRestClient;},{"../Fable-ServiceManager.js":38,"simple-get":77}],49:[function(require,module,exports){var libFableServiceBase=require('../Fable-ServiceManager.js').ServiceProviderBase;var FableServiceTemplate=/*#__PURE__*/function(_libFableServiceBase5){_inherits(FableServiceTemplate,_libFableServiceBase5);var _super14=_createSuper(FableServiceTemplate);// Underscore and lodash have a behavior, _.template, which compiles a
|
|
832
832
|
// string-based template with code snippets into simple executable pieces,
|
|
833
833
|
// with the added twist of returning a precompiled function ready to go.
|
|
834
834
|
//
|
|
@@ -900,7 +900,7 @@ tmpTimeZoneOffsetInHours=parseInt(tmpDateParts[7])+tmpTimeZoneOffsetInMinutes;//
|
|
|
900
900
|
if(pISOString.substr(-6,1)=="+"){// Make the offset negative since the hours will need to be subtracted from the date.
|
|
901
901
|
tmpTimeZoneOffsetInHours*=-1;}}// Get the current hours for the date and add the offset to get the correct time adjusted for timezone.
|
|
902
902
|
tmpReturnDate.setHours(tmpReturnDate.getHours()+tmpTimeZoneOffsetInHours);// Return the Date object calculated from the string.
|
|
903
|
-
return tmpReturnDate;}}]);return FableServiceUtility;}(libFableServiceBase);module.exports=FableServiceUtility;},{"../Fable-ServiceManager.js":38,"async.eachlimit":1,"async.waterfall":15}],51:[function(require,module,exports){var http=require('http');var url=require('url');var https=module.exports;for(var key in http){if(http.hasOwnProperty(key))https[key]=http[key];}https.request=function(params,cb){params=validateParams(params);return http.request.call(this,params,cb);};https.get=function(params,cb){params=validateParams(params);return http.get.call(this,params,cb);};function validateParams(params){if(typeof params==='string'){params=url.parse(params);}if(!params.protocol){params.protocol='https:';}if(params.protocol!=='https:'){throw new Error('Protocol "'+params.protocol+'" not supported. Expected "https:"');}return params;}},{"http":
|
|
903
|
+
return tmpReturnDate;}}]);return FableServiceUtility;}(libFableServiceBase);module.exports=FableServiceUtility;},{"../Fable-ServiceManager.js":38,"async.eachlimit":1,"async.waterfall":15}],51:[function(require,module,exports){var http=require('http');var url=require('url');var https=module.exports;for(var key in http){if(http.hasOwnProperty(key))https[key]=http[key];}https.request=function(params,cb){params=validateParams(params);return http.request.call(this,params,cb);};https.get=function(params,cb){params=validateParams(params);return http.get.call(this,params,cb);};function validateParams(params){if(typeof params==='string'){params=url.parse(params);}if(!params.protocol){params.protocol='https:';}if(params.protocol!=='https:'){throw new Error('Protocol "'+params.protocol+'" not supported. Expected "https:"');}return params;}},{"http":78,"url":99}],52:[function(require,module,exports){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias;}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity;}else{m=m+Math.pow(2,mLen);e=e-eBias;}return(s?-1:1)*m*Math.pow(2,e-mLen);};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax;}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*Math.pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias;}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0;}}for(;mLen>=8;buffer[offset+i]=m&0xff,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&0xff,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128;};},{}],53:[function(require,module,exports){if(typeof Object.create==='function'){// implementation from standard node.js 'util' module
|
|
904
904
|
module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}});}};}else{// old school shim for old browsers
|
|
905
905
|
module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function TempCtor(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor();ctor.prototype.constructor=ctor;}};}},{}],54:[function(require,module,exports){// When a boxed property is passed in, it should have quotes of some
|
|
906
906
|
// kind around it.
|
|
@@ -1548,439 +1548,7 @@ var tmpOverwriteProperties=typeof pOverwriteProperties=='undefined'?false:pOverw
|
|
|
1548
1548
|
// The default filter function just returns true, populating everything.
|
|
1549
1549
|
var tmpFilterFunction=typeof fFilter=='function'?fFilter:function(pDescriptor){return true;};this.elementAddresses.forEach(function(pAddress){var tmpDescriptor=_this29.getDescriptor(pAddress);// Check the filter function to see if this is an address we want to set the value for.
|
|
1550
1550
|
if(tmpFilterFunction(tmpDescriptor)){// If we are overwriting properties OR the property does not exist
|
|
1551
|
-
if(tmpOverwriteProperties||!_this29.checkAddressExists(tmpObject,pAddress)){_this29.setValueAtAddress(tmpObject,pAddress,_this29.getDefaultValue(tmpDescriptor));}}});return tmpObject;}}]);return Manyfest;}(libFableServiceProviderBase);;module.exports=Manyfest;},{"./Manyfest-HashTranslation.js":55,"./Manyfest-LogToConsole.js":56,"./Manyfest-ObjectAddress-CheckAddressExists.js":57,"./Manyfest-ObjectAddress-DeleteValue.js":58,"./Manyfest-ObjectAddress-GetValue.js":59,"./Manyfest-ObjectAddress-SetValue.js":60,"./Manyfest-ObjectAddressGeneration.js":61,"./Manyfest-SchemaManipulation.js":63,"fable-serviceproviderbase":32}],65:[function(require,module,exports){
|
|
1552
|
-
* Copyright 2012-2017 Craig Campbell
|
|
1553
|
-
*
|
|
1554
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1555
|
-
* you may not use this file except in compliance with the License.
|
|
1556
|
-
* You may obtain a copy of the License at
|
|
1557
|
-
*
|
|
1558
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1559
|
-
*
|
|
1560
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1561
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1562
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1563
|
-
* See the License for the specific language governing permissions and
|
|
1564
|
-
* limitations under the License.
|
|
1565
|
-
*
|
|
1566
|
-
* Mousetrap is a simple keyboard shortcut library for Javascript with
|
|
1567
|
-
* no external dependencies
|
|
1568
|
-
*
|
|
1569
|
-
* @version 1.6.5
|
|
1570
|
-
* @url craig.is/killing/mice
|
|
1571
|
-
*/(function(window,document,undefined){// Check if mousetrap is used inside browser, if not, return
|
|
1572
|
-
if(!window){return;}/**
|
|
1573
|
-
* mapping of special keycodes to their corresponding keys
|
|
1574
|
-
*
|
|
1575
|
-
* everything in this dictionary cannot use keypress events
|
|
1576
|
-
* so it has to be here to map to the correct keycodes for
|
|
1577
|
-
* keyup/keydown events
|
|
1578
|
-
*
|
|
1579
|
-
* @type {Object}
|
|
1580
|
-
*/var _MAP={8:'backspace',9:'tab',13:'enter',16:'shift',17:'ctrl',18:'alt',20:'capslock',27:'esc',32:'space',33:'pageup',34:'pagedown',35:'end',36:'home',37:'left',38:'up',39:'right',40:'down',45:'ins',46:'del',91:'meta',93:'meta',224:'meta'};/**
|
|
1581
|
-
* mapping for special characters so they can support
|
|
1582
|
-
*
|
|
1583
|
-
* this dictionary is only used incase you want to bind a
|
|
1584
|
-
* keyup or keydown event to one of these keys
|
|
1585
|
-
*
|
|
1586
|
-
* @type {Object}
|
|
1587
|
-
*/var _KEYCODE_MAP={106:'*',107:'+',109:'-',110:'.',111:'/',186:';',187:'=',188:',',189:'-',190:'.',191:'/',192:'`',219:'[',220:'\\',221:']',222:'\''};/**
|
|
1588
|
-
* this is a mapping of keys that require shift on a US keypad
|
|
1589
|
-
* back to the non shift equivelents
|
|
1590
|
-
*
|
|
1591
|
-
* this is so you can use keyup events with these keys
|
|
1592
|
-
*
|
|
1593
|
-
* note that this will only work reliably on US keyboards
|
|
1594
|
-
*
|
|
1595
|
-
* @type {Object}
|
|
1596
|
-
*/var _SHIFT_MAP={'~':'`','!':'1','@':'2','#':'3','$':'4','%':'5','^':'6','&':'7','*':'8','(':'9',')':'0','_':'-','+':'=',':':';','\"':'\'','<':',','>':'.','?':'/','|':'\\'};/**
|
|
1597
|
-
* this is a list of special strings you can use to map
|
|
1598
|
-
* to modifier keys when you specify your keyboard shortcuts
|
|
1599
|
-
*
|
|
1600
|
-
* @type {Object}
|
|
1601
|
-
*/var _SPECIAL_ALIASES={'option':'alt','command':'meta','return':'enter','escape':'esc','plus':'+','mod':/Mac|iPod|iPhone|iPad/.test(navigator.platform)?'meta':'ctrl'};/**
|
|
1602
|
-
* variable to store the flipped version of _MAP from above
|
|
1603
|
-
* needed to check if we should use keypress or not when no action
|
|
1604
|
-
* is specified
|
|
1605
|
-
*
|
|
1606
|
-
* @type {Object|undefined}
|
|
1607
|
-
*/var _REVERSE_MAP;/**
|
|
1608
|
-
* loop through the f keys, f1 to f19 and add them to the map
|
|
1609
|
-
* programatically
|
|
1610
|
-
*/for(var i=1;i<20;++i){_MAP[111+i]='f'+i;}/**
|
|
1611
|
-
* loop through to map numbers on the numeric keypad
|
|
1612
|
-
*/for(i=0;i<=9;++i){// This needs to use a string cause otherwise since 0 is falsey
|
|
1613
|
-
// mousetrap will never fire for numpad 0 pressed as part of a keydown
|
|
1614
|
-
// event.
|
|
1615
|
-
//
|
|
1616
|
-
// @see https://github.com/ccampbell/mousetrap/pull/258
|
|
1617
|
-
_MAP[i+96]=i.toString();}/**
|
|
1618
|
-
* cross browser add event method
|
|
1619
|
-
*
|
|
1620
|
-
* @param {Element|HTMLDocument} object
|
|
1621
|
-
* @param {string} type
|
|
1622
|
-
* @param {Function} callback
|
|
1623
|
-
* @returns void
|
|
1624
|
-
*/function _addEvent(object,type,callback){if(object.addEventListener){object.addEventListener(type,callback,false);return;}object.attachEvent('on'+type,callback);}/**
|
|
1625
|
-
* takes the event and returns the key character
|
|
1626
|
-
*
|
|
1627
|
-
* @param {Event} e
|
|
1628
|
-
* @return {string}
|
|
1629
|
-
*/function _characterFromEvent(e){// for keypress events we should return the character as is
|
|
1630
|
-
if(e.type=='keypress'){var character=String.fromCharCode(e.which);// if the shift key is not pressed then it is safe to assume
|
|
1631
|
-
// that we want the character to be lowercase. this means if
|
|
1632
|
-
// you accidentally have caps lock on then your key bindings
|
|
1633
|
-
// will continue to work
|
|
1634
|
-
//
|
|
1635
|
-
// the only side effect that might not be desired is if you
|
|
1636
|
-
// bind something like 'A' cause you want to trigger an
|
|
1637
|
-
// event when capital A is pressed caps lock will no longer
|
|
1638
|
-
// trigger the event. shift+a will though.
|
|
1639
|
-
if(!e.shiftKey){character=character.toLowerCase();}return character;}// for non keypress events the special maps are needed
|
|
1640
|
-
if(_MAP[e.which]){return _MAP[e.which];}if(_KEYCODE_MAP[e.which]){return _KEYCODE_MAP[e.which];}// if it is not in the special map
|
|
1641
|
-
// with keydown and keyup events the character seems to always
|
|
1642
|
-
// come in as an uppercase character whether you are pressing shift
|
|
1643
|
-
// or not. we should make sure it is always lowercase for comparisons
|
|
1644
|
-
return String.fromCharCode(e.which).toLowerCase();}/**
|
|
1645
|
-
* checks if two arrays are equal
|
|
1646
|
-
*
|
|
1647
|
-
* @param {Array} modifiers1
|
|
1648
|
-
* @param {Array} modifiers2
|
|
1649
|
-
* @returns {boolean}
|
|
1650
|
-
*/function _modifiersMatch(modifiers1,modifiers2){return modifiers1.sort().join(',')===modifiers2.sort().join(',');}/**
|
|
1651
|
-
* takes a key event and figures out what the modifiers are
|
|
1652
|
-
*
|
|
1653
|
-
* @param {Event} e
|
|
1654
|
-
* @returns {Array}
|
|
1655
|
-
*/function _eventModifiers(e){var modifiers=[];if(e.shiftKey){modifiers.push('shift');}if(e.altKey){modifiers.push('alt');}if(e.ctrlKey){modifiers.push('ctrl');}if(e.metaKey){modifiers.push('meta');}return modifiers;}/**
|
|
1656
|
-
* prevents default for this event
|
|
1657
|
-
*
|
|
1658
|
-
* @param {Event} e
|
|
1659
|
-
* @returns void
|
|
1660
|
-
*/function _preventDefault(e){if(e.preventDefault){e.preventDefault();return;}e.returnValue=false;}/**
|
|
1661
|
-
* stops propogation for this event
|
|
1662
|
-
*
|
|
1663
|
-
* @param {Event} e
|
|
1664
|
-
* @returns void
|
|
1665
|
-
*/function _stopPropagation(e){if(e.stopPropagation){e.stopPropagation();return;}e.cancelBubble=true;}/**
|
|
1666
|
-
* determines if the keycode specified is a modifier key or not
|
|
1667
|
-
*
|
|
1668
|
-
* @param {string} key
|
|
1669
|
-
* @returns {boolean}
|
|
1670
|
-
*/function _isModifier(key){return key=='shift'||key=='ctrl'||key=='alt'||key=='meta';}/**
|
|
1671
|
-
* reverses the map lookup so that we can look for specific keys
|
|
1672
|
-
* to see what can and can't use keypress
|
|
1673
|
-
*
|
|
1674
|
-
* @return {Object}
|
|
1675
|
-
*/function _getReverseMap(){if(!_REVERSE_MAP){_REVERSE_MAP={};for(var key in _MAP){// pull out the numeric keypad from here cause keypress should
|
|
1676
|
-
// be able to detect the keys from the character
|
|
1677
|
-
if(key>95&&key<112){continue;}if(_MAP.hasOwnProperty(key)){_REVERSE_MAP[_MAP[key]]=key;}}}return _REVERSE_MAP;}/**
|
|
1678
|
-
* picks the best action based on the key combination
|
|
1679
|
-
*
|
|
1680
|
-
* @param {string} key - character for key
|
|
1681
|
-
* @param {Array} modifiers
|
|
1682
|
-
* @param {string=} action passed in
|
|
1683
|
-
*/function _pickBestAction(key,modifiers,action){// if no action was picked in we should try to pick the one
|
|
1684
|
-
// that we think would work best for this key
|
|
1685
|
-
if(!action){action=_getReverseMap()[key]?'keydown':'keypress';}// modifier keys don't work as expected with keypress,
|
|
1686
|
-
// switch to keydown
|
|
1687
|
-
if(action=='keypress'&&modifiers.length){action='keydown';}return action;}/**
|
|
1688
|
-
* Converts from a string key combination to an array
|
|
1689
|
-
*
|
|
1690
|
-
* @param {string} combination like "command+shift+l"
|
|
1691
|
-
* @return {Array}
|
|
1692
|
-
*/function _keysFromString(combination){if(combination==='+'){return['+'];}combination=combination.replace(/\+{2}/g,'+plus');return combination.split('+');}/**
|
|
1693
|
-
* Gets info for a specific key combination
|
|
1694
|
-
*
|
|
1695
|
-
* @param {string} combination key combination ("command+s" or "a" or "*")
|
|
1696
|
-
* @param {string=} action
|
|
1697
|
-
* @returns {Object}
|
|
1698
|
-
*/function _getKeyInfo(combination,action){var keys;var key;var i;var modifiers=[];// take the keys from this pattern and figure out what the actual
|
|
1699
|
-
// pattern is all about
|
|
1700
|
-
keys=_keysFromString(combination);for(i=0;i<keys.length;++i){key=keys[i];// normalize key names
|
|
1701
|
-
if(_SPECIAL_ALIASES[key]){key=_SPECIAL_ALIASES[key];}// if this is not a keypress event then we should
|
|
1702
|
-
// be smart about using shift keys
|
|
1703
|
-
// this will only work for US keyboards however
|
|
1704
|
-
if(action&&action!='keypress'&&_SHIFT_MAP[key]){key=_SHIFT_MAP[key];modifiers.push('shift');}// if this key is a modifier then add it to the list of modifiers
|
|
1705
|
-
if(_isModifier(key)){modifiers.push(key);}}// depending on what the key combination is
|
|
1706
|
-
// we will try to pick the best event for it
|
|
1707
|
-
action=_pickBestAction(key,modifiers,action);return{key:key,modifiers:modifiers,action:action};}function _belongsTo(element,ancestor){if(element===null||element===document){return false;}if(element===ancestor){return true;}return _belongsTo(element.parentNode,ancestor);}function Mousetrap(targetElement){var self=this;targetElement=targetElement||document;if(!(self instanceof Mousetrap)){return new Mousetrap(targetElement);}/**
|
|
1708
|
-
* element to attach key events to
|
|
1709
|
-
*
|
|
1710
|
-
* @type {Element}
|
|
1711
|
-
*/self.target=targetElement;/**
|
|
1712
|
-
* a list of all the callbacks setup via Mousetrap.bind()
|
|
1713
|
-
*
|
|
1714
|
-
* @type {Object}
|
|
1715
|
-
*/self._callbacks={};/**
|
|
1716
|
-
* direct map of string combinations to callbacks used for trigger()
|
|
1717
|
-
*
|
|
1718
|
-
* @type {Object}
|
|
1719
|
-
*/self._directMap={};/**
|
|
1720
|
-
* keeps track of what level each sequence is at since multiple
|
|
1721
|
-
* sequences can start out with the same sequence
|
|
1722
|
-
*
|
|
1723
|
-
* @type {Object}
|
|
1724
|
-
*/var _sequenceLevels={};/**
|
|
1725
|
-
* variable to store the setTimeout call
|
|
1726
|
-
*
|
|
1727
|
-
* @type {null|number}
|
|
1728
|
-
*/var _resetTimer;/**
|
|
1729
|
-
* temporary state where we will ignore the next keyup
|
|
1730
|
-
*
|
|
1731
|
-
* @type {boolean|string}
|
|
1732
|
-
*/var _ignoreNextKeyup=false;/**
|
|
1733
|
-
* temporary state where we will ignore the next keypress
|
|
1734
|
-
*
|
|
1735
|
-
* @type {boolean}
|
|
1736
|
-
*/var _ignoreNextKeypress=false;/**
|
|
1737
|
-
* are we currently inside of a sequence?
|
|
1738
|
-
* type of action ("keyup" or "keydown" or "keypress") or false
|
|
1739
|
-
*
|
|
1740
|
-
* @type {boolean|string}
|
|
1741
|
-
*/var _nextExpectedAction=false;/**
|
|
1742
|
-
* resets all sequence counters except for the ones passed in
|
|
1743
|
-
*
|
|
1744
|
-
* @param {Object} doNotReset
|
|
1745
|
-
* @returns void
|
|
1746
|
-
*/function _resetSequences(doNotReset){doNotReset=doNotReset||{};var activeSequences=false,key;for(key in _sequenceLevels){if(doNotReset[key]){activeSequences=true;continue;}_sequenceLevels[key]=0;}if(!activeSequences){_nextExpectedAction=false;}}/**
|
|
1747
|
-
* finds all callbacks that match based on the keycode, modifiers,
|
|
1748
|
-
* and action
|
|
1749
|
-
*
|
|
1750
|
-
* @param {string} character
|
|
1751
|
-
* @param {Array} modifiers
|
|
1752
|
-
* @param {Event|Object} e
|
|
1753
|
-
* @param {string=} sequenceName - name of the sequence we are looking for
|
|
1754
|
-
* @param {string=} combination
|
|
1755
|
-
* @param {number=} level
|
|
1756
|
-
* @returns {Array}
|
|
1757
|
-
*/function _getMatches(character,modifiers,e,sequenceName,combination,level){var i;var callback;var matches=[];var action=e.type;// if there are no events related to this keycode
|
|
1758
|
-
if(!self._callbacks[character]){return[];}// if a modifier key is coming up on its own we should allow it
|
|
1759
|
-
if(action=='keyup'&&_isModifier(character)){modifiers=[character];}// loop through all callbacks for the key that was pressed
|
|
1760
|
-
// and see if any of them match
|
|
1761
|
-
for(i=0;i<self._callbacks[character].length;++i){callback=self._callbacks[character][i];// if a sequence name is not specified, but this is a sequence at
|
|
1762
|
-
// the wrong level then move onto the next match
|
|
1763
|
-
if(!sequenceName&&callback.seq&&_sequenceLevels[callback.seq]!=callback.level){continue;}// if the action we are looking for doesn't match the action we got
|
|
1764
|
-
// then we should keep going
|
|
1765
|
-
if(action!=callback.action){continue;}// if this is a keypress event and the meta key and control key
|
|
1766
|
-
// are not pressed that means that we need to only look at the
|
|
1767
|
-
// character, otherwise check the modifiers as well
|
|
1768
|
-
//
|
|
1769
|
-
// chrome will not fire a keypress if meta or control is down
|
|
1770
|
-
// safari will fire a keypress if meta or meta+shift is down
|
|
1771
|
-
// firefox will fire a keypress if meta or control is down
|
|
1772
|
-
if(action=='keypress'&&!e.metaKey&&!e.ctrlKey||_modifiersMatch(modifiers,callback.modifiers)){// when you bind a combination or sequence a second time it
|
|
1773
|
-
// should overwrite the first one. if a sequenceName or
|
|
1774
|
-
// combination is specified in this call it does just that
|
|
1775
|
-
//
|
|
1776
|
-
// @todo make deleting its own method?
|
|
1777
|
-
var deleteCombo=!sequenceName&&callback.combo==combination;var deleteSequence=sequenceName&&callback.seq==sequenceName&&callback.level==level;if(deleteCombo||deleteSequence){self._callbacks[character].splice(i,1);}matches.push(callback);}}return matches;}/**
|
|
1778
|
-
* actually calls the callback function
|
|
1779
|
-
*
|
|
1780
|
-
* if your callback function returns false this will use the jquery
|
|
1781
|
-
* convention - prevent default and stop propogation on the event
|
|
1782
|
-
*
|
|
1783
|
-
* @param {Function} callback
|
|
1784
|
-
* @param {Event} e
|
|
1785
|
-
* @returns void
|
|
1786
|
-
*/function _fireCallback(callback,e,combo,sequence){// if this event should not happen stop here
|
|
1787
|
-
if(self.stopCallback(e,e.target||e.srcElement,combo,sequence)){return;}if(callback(e,combo)===false){_preventDefault(e);_stopPropagation(e);}}/**
|
|
1788
|
-
* handles a character key event
|
|
1789
|
-
*
|
|
1790
|
-
* @param {string} character
|
|
1791
|
-
* @param {Array} modifiers
|
|
1792
|
-
* @param {Event} e
|
|
1793
|
-
* @returns void
|
|
1794
|
-
*/self._handleKey=function(character,modifiers,e){var callbacks=_getMatches(character,modifiers,e);var i;var doNotReset={};var maxLevel=0;var processedSequenceCallback=false;// Calculate the maxLevel for sequences so we can only execute the longest callback sequence
|
|
1795
|
-
for(i=0;i<callbacks.length;++i){if(callbacks[i].seq){maxLevel=Math.max(maxLevel,callbacks[i].level);}}// loop through matching callbacks for this key event
|
|
1796
|
-
for(i=0;i<callbacks.length;++i){// fire for all sequence callbacks
|
|
1797
|
-
// this is because if for example you have multiple sequences
|
|
1798
|
-
// bound such as "g i" and "g t" they both need to fire the
|
|
1799
|
-
// callback for matching g cause otherwise you can only ever
|
|
1800
|
-
// match the first one
|
|
1801
|
-
if(callbacks[i].seq){// only fire callbacks for the maxLevel to prevent
|
|
1802
|
-
// subsequences from also firing
|
|
1803
|
-
//
|
|
1804
|
-
// for example 'a option b' should not cause 'option b' to fire
|
|
1805
|
-
// even though 'option b' is part of the other sequence
|
|
1806
|
-
//
|
|
1807
|
-
// any sequences that do not match here will be discarded
|
|
1808
|
-
// below by the _resetSequences call
|
|
1809
|
-
if(callbacks[i].level!=maxLevel){continue;}processedSequenceCallback=true;// keep a list of which sequences were matches for later
|
|
1810
|
-
doNotReset[callbacks[i].seq]=1;_fireCallback(callbacks[i].callback,e,callbacks[i].combo,callbacks[i].seq);continue;}// if there were no sequence matches but we are still here
|
|
1811
|
-
// that means this is a regular match so we should fire that
|
|
1812
|
-
if(!processedSequenceCallback){_fireCallback(callbacks[i].callback,e,callbacks[i].combo);}}// if the key you pressed matches the type of sequence without
|
|
1813
|
-
// being a modifier (ie "keyup" or "keypress") then we should
|
|
1814
|
-
// reset all sequences that were not matched by this event
|
|
1815
|
-
//
|
|
1816
|
-
// this is so, for example, if you have the sequence "h a t" and you
|
|
1817
|
-
// type "h e a r t" it does not match. in this case the "e" will
|
|
1818
|
-
// cause the sequence to reset
|
|
1819
|
-
//
|
|
1820
|
-
// modifier keys are ignored because you can have a sequence
|
|
1821
|
-
// that contains modifiers such as "enter ctrl+space" and in most
|
|
1822
|
-
// cases the modifier key will be pressed before the next key
|
|
1823
|
-
//
|
|
1824
|
-
// also if you have a sequence such as "ctrl+b a" then pressing the
|
|
1825
|
-
// "b" key will trigger a "keypress" and a "keydown"
|
|
1826
|
-
//
|
|
1827
|
-
// the "keydown" is expected when there is a modifier, but the
|
|
1828
|
-
// "keypress" ends up matching the _nextExpectedAction since it occurs
|
|
1829
|
-
// after and that causes the sequence to reset
|
|
1830
|
-
//
|
|
1831
|
-
// we ignore keypresses in a sequence that directly follow a keydown
|
|
1832
|
-
// for the same character
|
|
1833
|
-
var ignoreThisKeypress=e.type=='keypress'&&_ignoreNextKeypress;if(e.type==_nextExpectedAction&&!_isModifier(character)&&!ignoreThisKeypress){_resetSequences(doNotReset);}_ignoreNextKeypress=processedSequenceCallback&&e.type=='keydown';};/**
|
|
1834
|
-
* handles a keydown event
|
|
1835
|
-
*
|
|
1836
|
-
* @param {Event} e
|
|
1837
|
-
* @returns void
|
|
1838
|
-
*/function _handleKeyEvent(e){// normalize e.which for key events
|
|
1839
|
-
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
|
|
1840
|
-
if(typeof e.which!=='number'){e.which=e.keyCode;}var character=_characterFromEvent(e);// no character found then stop
|
|
1841
|
-
if(!character){return;}// need to use === for the character check because the character can be 0
|
|
1842
|
-
if(e.type=='keyup'&&_ignoreNextKeyup===character){_ignoreNextKeyup=false;return;}self.handleKey(character,_eventModifiers(e),e);}/**
|
|
1843
|
-
* called to set a 1 second timeout on the specified sequence
|
|
1844
|
-
*
|
|
1845
|
-
* this is so after each key press in the sequence you have 1 second
|
|
1846
|
-
* to press the next key before you have to start over
|
|
1847
|
-
*
|
|
1848
|
-
* @returns void
|
|
1849
|
-
*/function _resetSequenceTimer(){clearTimeout(_resetTimer);_resetTimer=setTimeout(_resetSequences,1000);}/**
|
|
1850
|
-
* binds a key sequence to an event
|
|
1851
|
-
*
|
|
1852
|
-
* @param {string} combo - combo specified in bind call
|
|
1853
|
-
* @param {Array} keys
|
|
1854
|
-
* @param {Function} callback
|
|
1855
|
-
* @param {string=} action
|
|
1856
|
-
* @returns void
|
|
1857
|
-
*/function _bindSequence(combo,keys,callback,action){// start off by adding a sequence level record for this combination
|
|
1858
|
-
// and setting the level to 0
|
|
1859
|
-
_sequenceLevels[combo]=0;/**
|
|
1860
|
-
* callback to increase the sequence level for this sequence and reset
|
|
1861
|
-
* all other sequences that were active
|
|
1862
|
-
*
|
|
1863
|
-
* @param {string} nextAction
|
|
1864
|
-
* @returns {Function}
|
|
1865
|
-
*/function _increaseSequence(nextAction){return function(){_nextExpectedAction=nextAction;++_sequenceLevels[combo];_resetSequenceTimer();};}/**
|
|
1866
|
-
* wraps the specified callback inside of another function in order
|
|
1867
|
-
* to reset all sequence counters as soon as this sequence is done
|
|
1868
|
-
*
|
|
1869
|
-
* @param {Event} e
|
|
1870
|
-
* @returns void
|
|
1871
|
-
*/function _callbackAndReset(e){_fireCallback(callback,e,combo);// we should ignore the next key up if the action is key down
|
|
1872
|
-
// or keypress. this is so if you finish a sequence and
|
|
1873
|
-
// release the key the final key will not trigger a keyup
|
|
1874
|
-
if(action!=='keyup'){_ignoreNextKeyup=_characterFromEvent(e);}// weird race condition if a sequence ends with the key
|
|
1875
|
-
// another sequence begins with
|
|
1876
|
-
setTimeout(_resetSequences,10);}// loop through keys one at a time and bind the appropriate callback
|
|
1877
|
-
// function. for any key leading up to the final one it should
|
|
1878
|
-
// increase the sequence. after the final, it should reset all sequences
|
|
1879
|
-
//
|
|
1880
|
-
// if an action is specified in the original bind call then that will
|
|
1881
|
-
// be used throughout. otherwise we will pass the action that the
|
|
1882
|
-
// next key in the sequence should match. this allows a sequence
|
|
1883
|
-
// to mix and match keypress and keydown events depending on which
|
|
1884
|
-
// ones are better suited to the key provided
|
|
1885
|
-
for(var i=0;i<keys.length;++i){var isFinal=i+1===keys.length;var wrappedCallback=isFinal?_callbackAndReset:_increaseSequence(action||_getKeyInfo(keys[i+1]).action);_bindSingle(keys[i],wrappedCallback,action,combo,i);}}/**
|
|
1886
|
-
* binds a single keyboard combination
|
|
1887
|
-
*
|
|
1888
|
-
* @param {string} combination
|
|
1889
|
-
* @param {Function} callback
|
|
1890
|
-
* @param {string=} action
|
|
1891
|
-
* @param {string=} sequenceName - name of sequence if part of sequence
|
|
1892
|
-
* @param {number=} level - what part of the sequence the command is
|
|
1893
|
-
* @returns void
|
|
1894
|
-
*/function _bindSingle(combination,callback,action,sequenceName,level){// store a direct mapped reference for use with Mousetrap.trigger
|
|
1895
|
-
self._directMap[combination+':'+action]=callback;// make sure multiple spaces in a row become a single space
|
|
1896
|
-
combination=combination.replace(/\s+/g,' ');var sequence=combination.split(' ');var info;// if this pattern is a sequence of keys then run through this method
|
|
1897
|
-
// to reprocess each pattern one key at a time
|
|
1898
|
-
if(sequence.length>1){_bindSequence(combination,sequence,callback,action);return;}info=_getKeyInfo(combination,action);// make sure to initialize array if this is the first time
|
|
1899
|
-
// a callback is added for this key
|
|
1900
|
-
self._callbacks[info.key]=self._callbacks[info.key]||[];// remove an existing match if there is one
|
|
1901
|
-
_getMatches(info.key,info.modifiers,{type:info.action},sequenceName,combination,level);// add this call back to the array
|
|
1902
|
-
// if it is a sequence put it at the beginning
|
|
1903
|
-
// if not put it at the end
|
|
1904
|
-
//
|
|
1905
|
-
// this is important because the way these are processed expects
|
|
1906
|
-
// the sequence ones to come first
|
|
1907
|
-
self._callbacks[info.key][sequenceName?'unshift':'push']({callback:callback,modifiers:info.modifiers,action:info.action,seq:sequenceName,level:level,combo:combination});}/**
|
|
1908
|
-
* binds multiple combinations to the same callback
|
|
1909
|
-
*
|
|
1910
|
-
* @param {Array} combinations
|
|
1911
|
-
* @param {Function} callback
|
|
1912
|
-
* @param {string|undefined} action
|
|
1913
|
-
* @returns void
|
|
1914
|
-
*/self._bindMultiple=function(combinations,callback,action){for(var i=0;i<combinations.length;++i){_bindSingle(combinations[i],callback,action);}};// start!
|
|
1915
|
-
_addEvent(targetElement,'keypress',_handleKeyEvent);_addEvent(targetElement,'keydown',_handleKeyEvent);_addEvent(targetElement,'keyup',_handleKeyEvent);}/**
|
|
1916
|
-
* binds an event to mousetrap
|
|
1917
|
-
*
|
|
1918
|
-
* can be a single key, a combination of keys separated with +,
|
|
1919
|
-
* an array of keys, or a sequence of keys separated by spaces
|
|
1920
|
-
*
|
|
1921
|
-
* be sure to list the modifier keys first to make sure that the
|
|
1922
|
-
* correct key ends up getting bound (the last key in the pattern)
|
|
1923
|
-
*
|
|
1924
|
-
* @param {string|Array} keys
|
|
1925
|
-
* @param {Function} callback
|
|
1926
|
-
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
|
|
1927
|
-
* @returns void
|
|
1928
|
-
*/Mousetrap.prototype.bind=function(keys,callback,action){var self=this;keys=keys instanceof Array?keys:[keys];self._bindMultiple.call(self,keys,callback,action);return self;};/**
|
|
1929
|
-
* unbinds an event to mousetrap
|
|
1930
|
-
*
|
|
1931
|
-
* the unbinding sets the callback function of the specified key combo
|
|
1932
|
-
* to an empty function and deletes the corresponding key in the
|
|
1933
|
-
* _directMap dict.
|
|
1934
|
-
*
|
|
1935
|
-
* TODO: actually remove this from the _callbacks dictionary instead
|
|
1936
|
-
* of binding an empty function
|
|
1937
|
-
*
|
|
1938
|
-
* the keycombo+action has to be exactly the same as
|
|
1939
|
-
* it was defined in the bind method
|
|
1940
|
-
*
|
|
1941
|
-
* @param {string|Array} keys
|
|
1942
|
-
* @param {string} action
|
|
1943
|
-
* @returns void
|
|
1944
|
-
*/Mousetrap.prototype.unbind=function(keys,action){var self=this;return self.bind.call(self,keys,function(){},action);};/**
|
|
1945
|
-
* triggers an event that has already been bound
|
|
1946
|
-
*
|
|
1947
|
-
* @param {string} keys
|
|
1948
|
-
* @param {string=} action
|
|
1949
|
-
* @returns void
|
|
1950
|
-
*/Mousetrap.prototype.trigger=function(keys,action){var self=this;if(self._directMap[keys+':'+action]){self._directMap[keys+':'+action]({},keys);}return self;};/**
|
|
1951
|
-
* resets the library back to its initial state. this is useful
|
|
1952
|
-
* if you want to clear out the current keyboard shortcuts and bind
|
|
1953
|
-
* new ones - for example if you switch to another page
|
|
1954
|
-
*
|
|
1955
|
-
* @returns void
|
|
1956
|
-
*/Mousetrap.prototype.reset=function(){var self=this;self._callbacks={};self._directMap={};return self;};/**
|
|
1957
|
-
* should we stop this event before firing off callbacks
|
|
1958
|
-
*
|
|
1959
|
-
* @param {Event} e
|
|
1960
|
-
* @param {Element} element
|
|
1961
|
-
* @return {boolean}
|
|
1962
|
-
*/Mousetrap.prototype.stopCallback=function(e,element){var self=this;// if the element has the class "mousetrap" then no need to stop
|
|
1963
|
-
if((' '+element.className+' ').indexOf(' mousetrap ')>-1){return false;}if(_belongsTo(element,self.target)){return false;}// Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
|
|
1964
|
-
// not the initial event target in the shadow tree. Note that not all events cross the
|
|
1965
|
-
// shadow boundary.
|
|
1966
|
-
// For shadow trees with `mode: 'open'`, the initial event target is the first element in
|
|
1967
|
-
// the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
|
|
1968
|
-
// target cannot be obtained.
|
|
1969
|
-
if('composedPath'in e&&typeof e.composedPath==='function'){// For open shadow trees, update `element` so that the following check works.
|
|
1970
|
-
var initialEventTarget=e.composedPath()[0];if(initialEventTarget!==e.target){element=initialEventTarget;}}// stop for input, select, and textarea
|
|
1971
|
-
return element.tagName=='INPUT'||element.tagName=='SELECT'||element.tagName=='TEXTAREA'||element.isContentEditable;};/**
|
|
1972
|
-
* exposes _handleKey publicly so it can be overwritten by extensions
|
|
1973
|
-
*/Mousetrap.prototype.handleKey=function(){var self=this;return self._handleKey.apply(self,arguments);};/**
|
|
1974
|
-
* allow custom key mappings
|
|
1975
|
-
*/Mousetrap.addKeycodes=function(object){for(var key in object){if(object.hasOwnProperty(key)){_MAP[key]=object[key];}}_REVERSE_MAP=null;};/**
|
|
1976
|
-
* Init the global mousetrap functions
|
|
1977
|
-
*
|
|
1978
|
-
* This method is needed to allow the global mousetrap functions to work
|
|
1979
|
-
* now that mousetrap is a constructor function.
|
|
1980
|
-
*/Mousetrap.init=function(){var documentMousetrap=Mousetrap(document);for(var method in documentMousetrap){if(method.charAt(0)!=='_'){Mousetrap[method]=function(method){return function(){return documentMousetrap[method].apply(documentMousetrap,arguments);};}(method);}}};Mousetrap.init();// expose mousetrap to the global object
|
|
1981
|
-
window.Mousetrap=Mousetrap;// expose as a common js module
|
|
1982
|
-
if(typeof module!=='undefined'&&module.exports){module.exports=Mousetrap;}// expose mousetrap as an AMD module
|
|
1983
|
-
if(typeof define==='function'&&define.amd){define(function(){return Mousetrap;});}})(typeof window!=='undefined'?window:null,typeof window!=='undefined'?document:null);},{}],66:[function(require,module,exports){var wrappy=require('wrappy');module.exports=wrappy(once);module.exports.strict=wrappy(onceStrict);once.proto=once(function(){Object.defineProperty(Function.prototype,'once',{value:function value(){return once(this);},configurable:true});Object.defineProperty(Function.prototype,'onceStrict',{value:function value(){return onceStrict(this);},configurable:true});});function once(fn){var f=function f(){if(f.called)return f.value;f.called=true;return f.value=fn.apply(this,arguments);};f.called=false;return f;}function onceStrict(fn){var f=function f(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=fn.apply(this,arguments);};var name=fn.name||'Function wrapped with `once`';f.onceError=name+" shouldn't be called more than once";f.called=false;return f;}},{"wrappy":103}],67:[function(require,module,exports){(function(process){(function(){// 'path' module extracted from Node.js v8.11.1 (only the posix part)
|
|
1551
|
+
if(tmpOverwriteProperties||!_this29.checkAddressExists(tmpObject,pAddress)){_this29.setValueAtAddress(tmpObject,pAddress,_this29.getDefaultValue(tmpDescriptor));}}});return tmpObject;}}]);return Manyfest;}(libFableServiceProviderBase);;module.exports=Manyfest;},{"./Manyfest-HashTranslation.js":55,"./Manyfest-LogToConsole.js":56,"./Manyfest-ObjectAddress-CheckAddressExists.js":57,"./Manyfest-ObjectAddress-DeleteValue.js":58,"./Manyfest-ObjectAddress-GetValue.js":59,"./Manyfest-ObjectAddress-SetValue.js":60,"./Manyfest-ObjectAddressGeneration.js":61,"./Manyfest-SchemaManipulation.js":63,"fable-serviceproviderbase":32}],65:[function(require,module,exports){var wrappy=require('wrappy');module.exports=wrappy(once);module.exports.strict=wrappy(onceStrict);once.proto=once(function(){Object.defineProperty(Function.prototype,'once',{value:function value(){return once(this);},configurable:true});Object.defineProperty(Function.prototype,'onceStrict',{value:function value(){return onceStrict(this);},configurable:true});});function once(fn){var f=function f(){if(f.called)return f.value;f.called=true;return f.value=fn.apply(this,arguments);};f.called=false;return f;}function onceStrict(fn){var f=function f(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=fn.apply(this,arguments);};var name=fn.name||'Function wrapped with `once`';f.onceError=name+" shouldn't be called more than once";f.called=false;return f;}},{"wrappy":102}],66:[function(require,module,exports){(function(process){(function(){// 'path' module extracted from Node.js v8.11.1 (only the posix part)
|
|
1984
1552
|
// transplited with Babel
|
|
1985
1553
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
1986
1554
|
//
|
|
@@ -2062,7 +1630,7 @@ if(startDot===-1)startDot=i;else if(preDotState!==1)preDotState=1;}else if(start
|
|
|
2062
1630
|
// have a good chance at having a non-empty extension
|
|
2063
1631
|
preDotState=-1;}}if(startDot===-1||end===-1||// We saw a non-dot character immediately before the dot
|
|
2064
1632
|
preDotState===0||// The (right-most) trimmed path component is exactly '..'
|
|
2065
|
-
preDotState===1&&startDot===end-1&&startDot===startPart+1){if(end!==-1){if(startPart===0&&isAbsolute)ret.base=ret.name=path.slice(1,end);else ret.base=ret.name=path.slice(startPart,end);}}else{if(startPart===0&&isAbsolute){ret.name=path.slice(1,startDot);ret.base=path.slice(1,end);}else{ret.name=path.slice(startPart,startDot);ret.base=path.slice(startPart,end);}ret.ext=path.slice(startDot,end);}if(startPart>0)ret.dir=path.slice(0,startPart-1);else if(isAbsolute)ret.dir='/';return ret;},sep:'/',delimiter:':',win32:null,posix:null};posix.posix=posix;module.exports=posix;}).call(this);}).call(this,require('_process'));},{"_process":
|
|
1633
|
+
preDotState===1&&startDot===end-1&&startDot===startPart+1){if(end!==-1){if(startPart===0&&isAbsolute)ret.base=ret.name=path.slice(1,end);else ret.base=ret.name=path.slice(startPart,end);}}else{if(startPart===0&&isAbsolute){ret.name=path.slice(1,startDot);ret.base=path.slice(1,end);}else{ret.name=path.slice(startPart,startDot);ret.base=path.slice(startPart,end);}ret.ext=path.slice(startDot,end);}if(startPart>0)ret.dir=path.slice(0,startPart-1);else if(isAbsolute)ret.dir='/';return ret;},sep:'/',delimiter:':',win32:null,posix:null};posix.posix=posix;module.exports=posix;}).call(this);}).call(this,require('_process'));},{"_process":70}],67:[function(require,module,exports){/**
|
|
2066
1634
|
* Precedent Meta-Templating
|
|
2067
1635
|
*
|
|
2068
1636
|
* @license MIT
|
|
@@ -2085,7 +1653,7 @@ preDotState===1&&startDot===end-1&&startDot===startPart+1){if(end!==-1){if(start
|
|
|
2085
1653
|
* @param {string} pString - The string to parse
|
|
2086
1654
|
* @param {object} pData - Data to pass in as the second argument
|
|
2087
1655
|
* @return {string} The result from the parser
|
|
2088
|
-
*/},{key:"parseString",value:function parseString(pString,pData){return this.StringParser.parseString(pString,this.ParseTree,pData);}}]);return Precedent;}();module.exports=Precedent;},{"./StringParser.js":
|
|
1656
|
+
*/},{key:"parseString",value:function parseString(pString,pData){return this.StringParser.parseString(pString,this.ParseTree,pData);}}]);return Precedent;}();module.exports=Precedent;},{"./StringParser.js":68,"./WordTree.js":69}],68:[function(require,module,exports){/**
|
|
2089
1657
|
* String Parser
|
|
2090
1658
|
* @author Steven Velozo <steven@velozo.com>
|
|
2091
1659
|
* @description Parse a string, properly processing each matched token in the word tree.
|
|
@@ -2146,7 +1714,7 @@ else{pParserState.Output+=pCharacter;}}/**
|
|
|
2146
1714
|
* @param {string} pString - The string to parse.
|
|
2147
1715
|
* @param {Object} pParseTree - The parse tree to begin parsing from (usually root)
|
|
2148
1716
|
* @param {Object} pData - The data to pass to the function as a second parameter
|
|
2149
|
-
*/},{key:"parseString",value:function parseString(pString,pParseTree,pData){var tmpParserState=this.newParserState(pParseTree);for(var i=0;i<pString.length;i++){this.parseCharacter(pString[i],tmpParserState,pData);}this.flushOutputBuffer(tmpParserState);return tmpParserState.Output;}}]);return StringParser;}();module.exports=StringParser;},{}],
|
|
1717
|
+
*/},{key:"parseString",value:function parseString(pString,pParseTree,pData){var tmpParserState=this.newParserState(pParseTree);for(var i=0;i<pString.length;i++){this.parseCharacter(pString[i],tmpParserState,pData);}this.flushOutputBuffer(tmpParserState);return tmpParserState.Output;}}]);return StringParser;}();module.exports=StringParser;},{}],69:[function(require,module,exports){/**
|
|
2150
1718
|
* Word Tree
|
|
2151
1719
|
* @author Steven Velozo <steven@velozo.com>
|
|
2152
1720
|
* @description Create a tree (directed graph) of Javascript objects, one character per object.
|
|
@@ -2167,7 +1735,7 @@ else{pParserState.Output+=pCharacter;}}/**
|
|
|
2167
1735
|
* @param {number} pParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
|
|
2168
1736
|
* @return {bool} True if adding the pattern was successful
|
|
2169
1737
|
*/},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,pParser){if(pPatternStart.length<1)return false;if(typeof pPatternEnd==='string'&&pPatternEnd.length<1)return false;var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
|
|
2170
|
-
for(var i=0;i<pPatternStart.length;i++)tmpLeaf=this.addChild(tmpLeaf,pPatternStart,i);tmpLeaf.PatternStart=pPatternStart;tmpLeaf.PatternEnd=typeof pPatternEnd==='string'&&pPatternEnd.length>0?pPatternEnd:pPatternStart;tmpLeaf.Parse=typeof pParser==='function'?pParser:typeof pParser==='string'?function(){return pParser;}:function(pData){return pData;};return true;}}]);return WordTree;}();module.exports=WordTree;},{}],
|
|
1738
|
+
for(var i=0;i<pPatternStart.length;i++)tmpLeaf=this.addChild(tmpLeaf,pPatternStart,i);tmpLeaf.PatternStart=pPatternStart;tmpLeaf.PatternEnd=typeof pPatternEnd==='string'&&pPatternEnd.length>0?pPatternEnd:pPatternStart;tmpLeaf.Parse=typeof pParser==='function'?pParser:typeof pParser==='string'?function(){return pParser;}:function(pData){return pData;};return true;}}]);return WordTree;}();module.exports=WordTree;},{}],70:[function(require,module,exports){// shim for using process in browser
|
|
2171
1739
|
var process=module.exports={};// cached from whatever global is present so that test runners that stub it
|
|
2172
1740
|
// don't break things. But we need to wrap it in a try catch in case it is
|
|
2173
1741
|
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
@@ -2185,7 +1753,7 @@ return cachedClearTimeout.call(null,marker);}catch(e){// same as above but when
|
|
|
2185
1753
|
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
2186
1754
|
return cachedClearTimeout.call(this,marker);}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return;}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue);}else{queueIndex=-1;}if(queue.length){drainQueue();}}function drainQueue(){if(draining){return;}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run();}}queueIndex=-1;len=queue.length;}currentQueue=null;draining=false;runClearTimeout(timeout);}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i];}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue);}};// v8 likes predictible objects
|
|
2187
1755
|
function Item(fun,array){this.fun=fun;this.array=array;}Item.prototype.run=function(){this.fun.apply(null,this.array);};process.title='browser';process.browser=true;process.env={};process.argv=[];process.version='';// empty string to avoid regexp issues
|
|
2188
|
-
process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[];};process.binding=function(name){throw new Error('process.binding is not supported');};process.cwd=function(){return'/';};process.chdir=function(dir){throw new Error('process.chdir is not supported');};process.umask=function(){return 0;};},{}],
|
|
1756
|
+
process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[];};process.binding=function(name){throw new Error('process.binding is not supported');};process.cwd=function(){return'/';};process.chdir=function(dir){throw new Error('process.chdir is not supported');};process.umask=function(){return 0;};},{}],71:[function(require,module,exports){(function(global){(function(){/*! https://mths.be/punycode v1.4.1 by @mathias */;(function(root){/** Detect free variables */var freeExports=_typeof(exports)=='object'&&exports&&!exports.nodeType&&exports;var freeModule=_typeof(module)=='object'&&module&&!module.nodeType&&module;var freeGlobal=_typeof(global)=='object'&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal){root=freeGlobal;}/**
|
|
2189
1757
|
* The `punycode` object.
|
|
2190
1758
|
* @name punycode
|
|
2191
1759
|
* @type Object
|
|
@@ -2340,7 +1908,7 @@ for/* no condition */(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:
|
|
|
2340
1908
|
if(typeof define=='function'&&_typeof(define.amd)=='object'&&define.amd){define('punycode',function(){return punycode;});}else if(freeExports&&freeModule){if(module.exports==freeExports){// in Node.js, io.js, or RingoJS v0.8.0+
|
|
2341
1909
|
freeModule.exports=punycode;}else{// in Narwhal or RingoJS v0.7.0-
|
|
2342
1910
|
for(key in punycode){punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key]);}}}else{// in Rhino or a web browser
|
|
2343
|
-
root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],
|
|
1911
|
+
root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],72:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
2344
1912
|
//
|
|
2345
1913
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
2346
1914
|
// copy of this software and associated documentation files (the
|
|
@@ -2364,7 +1932,7 @@ root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="und
|
|
|
2364
1932
|
// obj.hasOwnProperty(prop) will break.
|
|
2365
1933
|
// See: https://github.com/joyent/node/issues/1707
|
|
2366
1934
|
function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}module.exports=function(qs,sep,eq,options){sep=sep||'&';eq=eq||'=';var obj={};if(typeof qs!=='string'||qs.length===0){return obj;}var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1000;if(options&&typeof options.maxKeys==='number'){maxKeys=options.maxKeys;}var len=qs.length;// maxKeys <= 0 means that we should not limit keys count
|
|
2367
|
-
if(maxKeys>0&&len>maxKeys){len=maxKeys;}for(var i=0;i<len;++i){var x=qs[i].replace(regexp,'%20'),idx=x.indexOf(eq),kstr,vstr,k,v;if(idx>=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1);}else{kstr=x;vstr='';}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v;}else if(isArray(obj[k])){obj[k].push(v);}else{obj[k]=[obj[k],v];}}return obj;};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};},{}],
|
|
1935
|
+
if(maxKeys>0&&len>maxKeys){len=maxKeys;}for(var i=0;i<len;++i){var x=qs[i].replace(regexp,'%20'),idx=x.indexOf(eq),kstr,vstr,k,v;if(idx>=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1);}else{kstr=x;vstr='';}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v;}else if(isArray(obj[k])){obj[k].push(v);}else{obj[k]=[obj[k],v];}}return obj;};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};},{}],73:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
2368
1936
|
//
|
|
2369
1937
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
2370
1938
|
// copy of this software and associated documentation files (the
|
|
@@ -2384,10 +1952,10 @@ if(maxKeys>0&&len>maxKeys){len=maxKeys;}for(var i=0;i<len;++i){var x=qs[i].repla
|
|
|
2384
1952
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
2385
1953
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
2386
1954
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
2387
|
-
'use strict';var stringifyPrimitive=function stringifyPrimitive(v){switch(_typeof(v)){case'string':return v;case'boolean':return v?'true':'false';case'number':return isFinite(v)?v:'';default:return'';}};module.exports=function(obj,sep,eq,name){sep=sep||'&';eq=eq||'=';if(obj===null){obj=undefined;}if(_typeof(obj)==='object'){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v));}).join(sep);}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]));}}).join(sep);}if(!name)return'';return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj));};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i<xs.length;i++){res.push(f(xs[i],i));}return res;}var objectKeys=Object.keys||function(obj){var res=[];for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))res.push(key);}return res;};},{}],
|
|
1955
|
+
'use strict';var stringifyPrimitive=function stringifyPrimitive(v){switch(_typeof(v)){case'string':return v;case'boolean':return v?'true':'false';case'number':return isFinite(v)?v:'';default:return'';}};module.exports=function(obj,sep,eq,name){sep=sep||'&';eq=eq||'=';if(obj===null){obj=undefined;}if(_typeof(obj)==='object'){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v));}).join(sep);}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]));}}).join(sep);}if(!name)return'';return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj));};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i<xs.length;i++){res.push(f(xs[i],i));}return res;}var objectKeys=Object.keys||function(obj){var res=[];for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))res.push(key);}return res;};},{}],74:[function(require,module,exports){'use strict';exports.decode=exports.parse=require('./decode');exports.encode=exports.stringify=require('./encode');},{"./decode":72,"./encode":73}],75:[function(require,module,exports){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /* eslint-disable node/no-deprecated-api */var buffer=require('buffer');var Buffer=buffer.Buffer;// alternative to using Object.keys for old browsers
|
|
2388
1956
|
function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}if(Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow){module.exports=buffer;}else{// Copy properties from require('buffer')
|
|
2389
1957
|
copyProps(buffer,exports);exports.Buffer=SafeBuffer;}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length);}SafeBuffer.prototype=Object.create(Buffer.prototype);// Copy static methods from Buffer
|
|
2390
|
-
copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==='number'){throw new TypeError('Argument must not be a number');}return Buffer(arg,encodingOrOffset,length);};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==='string'){buf.fill(fill,encoding);}else{buf.fill(fill);}}else{buf.fill(0);}return buf;};SafeBuffer.allocUnsafe=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return Buffer(size);};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return buffer.SlowBuffer(size);};},{"buffer":19}],
|
|
1958
|
+
copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==='number'){throw new TypeError('Argument must not be a number');}return Buffer(arg,encodingOrOffset,length);};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==='string'){buf.fill(fill,encoding);}else{buf.fill(fill);}}else{buf.fill(0);}return buf;};SafeBuffer.allocUnsafe=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return Buffer(size);};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return buffer.SlowBuffer(size);};},{"buffer":19}],76:[function(require,module,exports){(function(Buffer){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */module.exports=function(stream,cb){var chunks=[];stream.on('data',function(chunk){chunks.push(chunk);});stream.once('end',function(){if(cb)cb(null,Buffer.concat(chunks));cb=null;});stream.once('error',function(err){if(cb)cb(err);cb=null;});};}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":19}],77:[function(require,module,exports){(function(Buffer){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */module.exports=simpleGet;var concat=require('simple-concat');var decompressResponse=require('decompress-response');// excluded from browser build
|
|
2391
1959
|
var http=require('http');var https=require('https');var once=require('once');var querystring=require('querystring');var url=require('url');var isStream=function isStream(o){return o!==null&&_typeof(o)==='object'&&typeof o.pipe==='function';};function simpleGet(opts,cb){opts=Object.assign({maxRedirects:10},typeof opts==='string'?{url:opts}:opts);cb=once(cb);if(opts.url){var _url$parse=url.parse(opts.url),hostname=_url$parse.hostname,port=_url$parse.port,_protocol=_url$parse.protocol,auth=_url$parse.auth,path=_url$parse.path;// eslint-disable-line node/no-deprecated-api
|
|
2392
1960
|
delete opts.url;if(!hostname&&!port&&!_protocol&&!auth)opts.path=path;// Relative redirect
|
|
2393
1961
|
else Object.assign(opts,{hostname:hostname,port:port,protocol:_protocol,auth:auth,path:path});// Absolute redirect
|
|
@@ -2399,13 +1967,13 @@ res.resume();// Discard response
|
|
|
2399
1967
|
var redirectHost=url.parse(opts.url).hostname;// eslint-disable-line node/no-deprecated-api
|
|
2400
1968
|
// If redirected host is different than original host, drop headers to prevent cookie leak (#73)
|
|
2401
1969
|
if(redirectHost!==null&&redirectHost!==originalHost){delete opts.headers.cookie;delete opts.headers.authorization;}if(opts.method==='POST'&&[301,302].includes(res.statusCode)){opts.method='GET';// On 301/302 redirect, change POST to GET (see #35)
|
|
2402
|
-
delete opts.headers['content-length'];delete opts.headers['content-type'];}if(opts.maxRedirects--===0)return cb(new Error('too many redirects'));else return simpleGet(opts,cb);}var tryUnzip=typeof decompressResponse==='function'&&opts.method!=='HEAD';cb(null,tryUnzip?decompressResponse(res):res);});req.on('timeout',function(){req.abort();cb(new Error('Request timed out'));});req.on('error',cb);if(isStream(body))body.on('error',cb).pipe(req);else req.end(body);return req;}simpleGet.concat=function(opts,cb){return simpleGet(opts,function(err,res){if(err)return cb(err);concat(res,function(err,data){if(err)return cb(err);if(opts.json){try{data=JSON.parse(data.toString());}catch(err){return cb(err,res,data);}}cb(null,res,data);});});};['get','post','put','patch','head','delete'].forEach(function(method){simpleGet[method]=function(opts,cb){if(typeof opts==='string')opts={url:opts};return simpleGet(Object.assign({method:method.toUpperCase()},opts),cb);};});}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":19,"decompress-response":17,"http":
|
|
1970
|
+
delete opts.headers['content-length'];delete opts.headers['content-type'];}if(opts.maxRedirects--===0)return cb(new Error('too many redirects'));else return simpleGet(opts,cb);}var tryUnzip=typeof decompressResponse==='function'&&opts.method!=='HEAD';cb(null,tryUnzip?decompressResponse(res):res);});req.on('timeout',function(){req.abort();cb(new Error('Request timed out'));});req.on('error',cb);if(isStream(body))body.on('error',cb).pipe(req);else req.end(body);return req;}simpleGet.concat=function(opts,cb){return simpleGet(opts,function(err,res){if(err)return cb(err);concat(res,function(err,data){if(err)return cb(err);if(opts.json){try{data=JSON.parse(data.toString());}catch(err){return cb(err,res,data);}}cb(null,res,data);});});};['get','post','put','patch','head','delete'].forEach(function(method){simpleGet[method]=function(opts,cb){if(typeof opts==='string')opts={url:opts};return simpleGet(Object.assign({method:method.toUpperCase()},opts),cb);};});}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":19,"decompress-response":17,"http":78,"https":51,"once":65,"querystring":74,"simple-concat":76,"url":99}],78:[function(require,module,exports){(function(global){(function(){var ClientRequest=require('./lib/request');var response=require('./lib/response');var extend=require('xtend');var statusCodes=require('builtin-status-codes');var url=require('url');var http=exports;http.request=function(opts,cb){if(typeof opts==='string')opts=url.parse(opts);else opts=extend(opts);// Normally, the page is loaded from http or https, so not specifying a protocol
|
|
2403
1971
|
// will result in a (valid) protocol-relative url. However, this won't work if
|
|
2404
1972
|
// the protocol is something else, like 'file:'
|
|
2405
1973
|
var defaultProtocol=global.location.protocol.search(/^https?:$/)===-1?'http:':'';var protocol=opts.protocol||defaultProtocol;var host=opts.hostname||opts.host;var port=opts.port;var path=opts.path||'/';// Necessary for IPv6 addresses
|
|
2406
1974
|
if(host&&host.indexOf(':')!==-1)host='['+host+']';// This may be a relative url. The browser should always be able to interpret it correctly.
|
|
2407
1975
|
opts.url=(host?protocol+'//'+host:'')+(port?':'+port:'')+path;opts.method=(opts.method||'GET').toUpperCase();opts.headers=opts.headers||{};// Also valid opts.auth, opts.mode
|
|
2408
|
-
var req=new ClientRequest(opts);if(cb)req.on('response',cb);return req;};http.get=function get(opts,cb){var req=http.request(opts,cb);req.end();return req;};http.ClientRequest=ClientRequest;http.IncomingMessage=response.IncomingMessage;http.Agent=function(){};http.Agent.defaultMaxSockets=4;http.globalAgent=new http.Agent();http.STATUS_CODES=statusCodes;http.METHODS=['CHECKOUT','CONNECT','COPY','DELETE','GET','HEAD','LOCK','M-SEARCH','MERGE','MKACTIVITY','MKCOL','MOVE','NOTIFY','OPTIONS','PATCH','POST','PROPFIND','PROPPATCH','PURGE','PUT','REPORT','SEARCH','SUBSCRIBE','TRACE','UNLOCK','UNSUBSCRIBE'];}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./lib/request":
|
|
1976
|
+
var req=new ClientRequest(opts);if(cb)req.on('response',cb);return req;};http.get=function get(opts,cb){var req=http.request(opts,cb);req.end();return req;};http.ClientRequest=ClientRequest;http.IncomingMessage=response.IncomingMessage;http.Agent=function(){};http.Agent.defaultMaxSockets=4;http.globalAgent=new http.Agent();http.STATUS_CODES=statusCodes;http.METHODS=['CHECKOUT','CONNECT','COPY','DELETE','GET','HEAD','LOCK','M-SEARCH','MERGE','MKACTIVITY','MKCOL','MOVE','NOTIFY','OPTIONS','PATCH','POST','PROPFIND','PROPPATCH','PURGE','PUT','REPORT','SEARCH','SUBSCRIBE','TRACE','UNLOCK','UNSUBSCRIBE'];}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./lib/request":80,"./lib/response":81,"builtin-status-codes":20,"url":99,"xtend":103}],79:[function(require,module,exports){(function(global){(function(){exports.fetch=isFunction(global.fetch)&&isFunction(global.ReadableStream);exports.writableStream=isFunction(global.WritableStream);exports.abortController=isFunction(global.AbortController);// The xhr request to example.com may violate some restrictive CSP configurations,
|
|
2409
1977
|
// so if we're running in a browser that supports `fetch`, avoid calling getXHR()
|
|
2410
1978
|
// and assume support for certain features below.
|
|
2411
1979
|
var xhr;function getXHR(){// Cache the xhr value
|
|
@@ -2420,7 +1988,7 @@ exports.arraybuffer=exports.fetch||checkTypeSupport('arraybuffer');// These next
|
|
|
2420
1988
|
exports.msstream=!exports.fetch&&checkTypeSupport('ms-stream');exports.mozchunkedarraybuffer=!exports.fetch&&checkTypeSupport('moz-chunked-arraybuffer');// If fetch is supported, then overrideMimeType will be supported too. Skip calling
|
|
2421
1989
|
// getXHR().
|
|
2422
1990
|
exports.overrideMimeType=exports.fetch||(getXHR()?isFunction(getXHR().overrideMimeType):false);function isFunction(value){return typeof value==='function';}xhr=null;// Help gc
|
|
2423
|
-
}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],
|
|
1991
|
+
}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],80:[function(require,module,exports){(function(process,global,Buffer){(function(){var capability=require('./capability');var inherits=require('inherits');var response=require('./response');var stream=require('readable-stream');var IncomingMessage=response.IncomingMessage;var rStates=response.readyStates;function decideMode(preferBinary,useFetch){if(capability.fetch&&useFetch){return'fetch';}else if(capability.mozchunkedarraybuffer){return'moz-chunked-arraybuffer';}else if(capability.msstream){return'ms-stream';}else if(capability.arraybuffer&&preferBinary){return'arraybuffer';}else{return'text';}}var ClientRequest=module.exports=function(opts){var self=this;stream.Writable.call(self);self._opts=opts;self._body=[];self._headers={};if(opts.auth)self.setHeader('Authorization','Basic '+Buffer.from(opts.auth).toString('base64'));Object.keys(opts.headers).forEach(function(name){self.setHeader(name,opts.headers[name]);});var preferBinary;var useFetch=true;if(opts.mode==='disable-fetch'||'requestTimeout'in opts&&!capability.abortController){// If the use of XHR should be preferred. Not typically needed.
|
|
2424
1992
|
useFetch=false;preferBinary=true;}else if(opts.mode==='prefer-streaming'){// If streaming is a high priority but binary compatibility and
|
|
2425
1993
|
// the accuracy of the 'content-type' header aren't
|
|
2426
1994
|
preferBinary=false;}else if(opts.mode==='allow-wrong-content-type'){// If streaming is more important than preserving the 'content-type' header
|
|
@@ -2437,7 +2005,7 @@ if(self._mode==='moz-chunked-arraybuffer'){xhr.onprogress=function(){self._onXHR
|
|
|
2437
2005
|
* Even though the spec says it should be available in readyState 3,
|
|
2438
2006
|
* accessing it throws an exception in IE8
|
|
2439
2007
|
*/function statusValid(xhr){try{var status=xhr.status;return status!==null&&status!==0;}catch(e){return false;}}ClientRequest.prototype._onXHRProgress=function(){var self=this;self._resetTimers(false);if(!statusValid(self._xhr)||self._destroyed)return;if(!self._response)self._connect();self._response._onXHRProgress(self._resetTimers.bind(self));};ClientRequest.prototype._connect=function(){var self=this;if(self._destroyed)return;self._response=new IncomingMessage(self._xhr,self._fetchResponse,self._mode,self._resetTimers.bind(self));self._response.on('error',function(err){self.emit('error',err);});self.emit('response',self._response);};ClientRequest.prototype._write=function(chunk,encoding,cb){var self=this;self._body.push(chunk);cb();};ClientRequest.prototype._resetTimers=function(done){var self=this;global.clearTimeout(self._socketTimer);self._socketTimer=null;if(done){global.clearTimeout(self._fetchTimer);self._fetchTimer=null;}else if(self._socketTimeout){self._socketTimer=global.setTimeout(function(){self.emit('timeout');},self._socketTimeout);}};ClientRequest.prototype.abort=ClientRequest.prototype.destroy=function(err){var self=this;self._destroyed=true;self._resetTimers(true);if(self._response)self._response._destroyed=true;if(self._xhr)self._xhr.abort();else if(self._fetchAbortController)self._fetchAbortController.abort();if(err)self.emit('error',err);};ClientRequest.prototype.end=function(data,encoding,cb){var self=this;if(typeof data==='function'){cb=data;data=undefined;}stream.Writable.prototype.end.call(self,data,encoding,cb);};ClientRequest.prototype.setTimeout=function(timeout,cb){var self=this;if(cb)self.once('timeout',cb);self._socketTimeout=timeout;self._resetTimers(false);};ClientRequest.prototype.flushHeaders=function(){};ClientRequest.prototype.setNoDelay=function(){};ClientRequest.prototype.setSocketKeepAlive=function(){};// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method
|
|
2440
|
-
var unsafeHeaders=['accept-charset','accept-encoding','access-control-request-headers','access-control-request-method','connection','content-length','cookie','cookie2','date','dnt','expect','host','keep-alive','origin','referer','te','trailer','transfer-encoding','upgrade','via'];}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":
|
|
2008
|
+
var unsafeHeaders=['accept-charset','accept-encoding','access-control-request-headers','access-control-request-method','connection','content-length','cookie','cookie2','date','dnt','expect','host','keep-alive','origin','referer','te','trailer','transfer-encoding','upgrade','via'];}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":79,"./response":81,"_process":70,"buffer":19,"inherits":53,"readable-stream":96}],81:[function(require,module,exports){(function(process,global,Buffer){(function(){var capability=require('./capability');var inherits=require('inherits');var stream=require('readable-stream');var rStates=exports.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};var IncomingMessage=exports.IncomingMessage=function(xhr,response,mode,resetTimers){var self=this;stream.Readable.call(self);self._mode=mode;self.headers={};self.rawHeaders=[];self.trailers={};self.rawTrailers=[];// Fake the 'close' event, but only once 'end' fires
|
|
2441
2009
|
self.on('end',function(){// The nextTick is necessary to prevent the 'request' module from causing an infinite loop
|
|
2442
2010
|
process.nextTick(function(){self.emit('close');});});if(mode==='fetch'){var read=function read(){reader.read().then(function(result){if(self._destroyed)return;resetTimers(result.done);if(result.done){self.push(null);return;}self.push(Buffer.from(result.value));read();})["catch"](function(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);});};self._fetchResponse=response;self.url=response.url;self.statusCode=response.status;self.statusMessage=response.statusText;response.headers.forEach(function(header,key){self.headers[key.toLowerCase()]=header;self.rawHeaders.push(key,header);});if(capability.writableStream){var writable=new WritableStream({write:function write(chunk){resetTimers(false);return new Promise(function(resolve,reject){if(self._destroyed){reject();}else if(self.push(Buffer.from(chunk))){resolve();}else{self._resumeFetch=resolve;}});},close:function close(){resetTimers(true);if(!self._destroyed)self.push(null);},abort:function abort(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);}});try{response.body.pipeTo(writable)["catch"](function(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);});return;}catch(e){}// pipeTo method isn't defined. Can't find a better way to feature test this
|
|
2443
2011
|
}// fallback for when writableStream or pipeTo aren't available
|
|
@@ -2445,13 +2013,13 @@ var reader=response.body.getReader();read();}else{self._xhr=xhr;self._pos=0;self
|
|
|
2445
2013
|
}}};inherits(IncomingMessage,stream.Readable);IncomingMessage.prototype._read=function(){var self=this;var resolve=self._resumeFetch;if(resolve){self._resumeFetch=null;resolve();}};IncomingMessage.prototype._onXHRProgress=function(resetTimers){var self=this;var xhr=self._xhr;var response=null;switch(self._mode){case'text':response=xhr.responseText;if(response.length>self._pos){var newData=response.substr(self._pos);if(self._charset==='x-user-defined'){var buffer=Buffer.alloc(newData.length);for(var i=0;i<newData.length;i++)buffer[i]=newData.charCodeAt(i)&0xff;self.push(buffer);}else{self.push(newData,self._charset);}self._pos=response.length;}break;case'arraybuffer':if(xhr.readyState!==rStates.DONE||!xhr.response)break;response=xhr.response;self.push(Buffer.from(new Uint8Array(response)));break;case'moz-chunked-arraybuffer':// take whole
|
|
2446
2014
|
response=xhr.response;if(xhr.readyState!==rStates.LOADING||!response)break;self.push(Buffer.from(new Uint8Array(response)));break;case'ms-stream':response=xhr.response;if(xhr.readyState!==rStates.LOADING)break;var reader=new global.MSStreamReader();reader.onprogress=function(){if(reader.result.byteLength>self._pos){self.push(Buffer.from(new Uint8Array(reader.result.slice(self._pos))));self._pos=reader.result.byteLength;}};reader.onload=function(){resetTimers(true);self.push(null);};// reader.onerror = ??? // TODO: this
|
|
2447
2015
|
reader.readAsArrayBuffer(response);break;}// The ms-stream case handles end separately in reader.onload()
|
|
2448
|
-
if(self._xhr.readyState===rStates.DONE&&self._mode!=='ms-stream'){resetTimers(true);self.push(null);}};}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":
|
|
2016
|
+
if(self._xhr.readyState===rStates.DONE&&self._mode!=='ms-stream'){resetTimers(true);self.push(null);}};}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":79,"_process":70,"buffer":19,"inherits":53,"readable-stream":96}],82:[function(require,module,exports){'use strict';function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}var codes={};function createErrorType(code,message,Base){if(!Base){Base=Error;}function getMessage(arg1,arg2,arg3){if(typeof message==='string'){return message;}else{return message(arg1,arg2,arg3);}}var NodeError=/*#__PURE__*/function(_Base){_inheritsLoose(NodeError,_Base);function NodeError(arg1,arg2,arg3){return _Base.call(this,getMessage(arg1,arg2,arg3))||this;}return NodeError;}(Base);NodeError.prototype.name=Base.name;NodeError.prototype.code=code;codes[code]=NodeError;}// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
|
|
2449
2017
|
function oneOf(expected,thing){if(Array.isArray(expected)){var len=expected.length;expected=expected.map(function(i){return String(i);});if(len>2){return"one of ".concat(thing," ").concat(expected.slice(0,len-1).join(', '),", or ")+expected[len-1];}else if(len===2){return"one of ".concat(thing," ").concat(expected[0]," or ").concat(expected[1]);}else{return"of ".concat(thing," ").concat(expected[0]);}}else{return"of ".concat(thing," ").concat(String(expected));}}// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
|
|
2450
2018
|
function startsWith(str,search,pos){return str.substr(!pos||pos<0?0:+pos,search.length)===search;}// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
|
|
2451
2019
|
function endsWith(str,search,this_len){if(this_len===undefined||this_len>str.length){this_len=str.length;}return str.substring(this_len-search.length,this_len)===search;}// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
|
|
2452
2020
|
function includes(str,search,start){if(typeof start!=='number'){start=0;}if(start+search.length>str.length){return false;}else{return str.indexOf(search,start)!==-1;}}createErrorType('ERR_INVALID_OPT_VALUE',function(name,value){return'The value "'+value+'" is invalid for option "'+name+'"';},TypeError);createErrorType('ERR_INVALID_ARG_TYPE',function(name,expected,actual){// determiner: 'must be' or 'must not be'
|
|
2453
2021
|
var determiner;if(typeof expected==='string'&&startsWith(expected,'not ')){determiner='must not be';expected=expected.replace(/^not /,'');}else{determiner='must be';}var msg;if(endsWith(name,' argument')){// For cases like 'first argument'
|
|
2454
|
-
msg="The ".concat(name," ").concat(determiner," ").concat(oneOf(expected,'type'));}else{var type=includes(name,'.')?'property':'argument';msg="The \"".concat(name,"\" ").concat(type," ").concat(determiner," ").concat(oneOf(expected,'type'));}msg+=". Received type ".concat(_typeof(actual));return msg;},TypeError);createErrorType('ERR_STREAM_PUSH_AFTER_EOF','stream.push() after EOF');createErrorType('ERR_METHOD_NOT_IMPLEMENTED',function(name){return'The '+name+' method is not implemented';});createErrorType('ERR_STREAM_PREMATURE_CLOSE','Premature close');createErrorType('ERR_STREAM_DESTROYED',function(name){return'Cannot call '+name+' after a stream was destroyed';});createErrorType('ERR_MULTIPLE_CALLBACK','Callback called multiple times');createErrorType('ERR_STREAM_CANNOT_PIPE','Cannot pipe, not readable');createErrorType('ERR_STREAM_WRITE_AFTER_END','write after end');createErrorType('ERR_STREAM_NULL_VALUES','May not write null values to stream',TypeError);createErrorType('ERR_UNKNOWN_ENCODING',function(arg){return'Unknown encoding: '+arg;},TypeError);createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT','stream.unshift() after end event');module.exports.codes=codes;},{}],
|
|
2022
|
+
msg="The ".concat(name," ").concat(determiner," ").concat(oneOf(expected,'type'));}else{var type=includes(name,'.')?'property':'argument';msg="The \"".concat(name,"\" ").concat(type," ").concat(determiner," ").concat(oneOf(expected,'type'));}msg+=". Received type ".concat(_typeof(actual));return msg;},TypeError);createErrorType('ERR_STREAM_PUSH_AFTER_EOF','stream.push() after EOF');createErrorType('ERR_METHOD_NOT_IMPLEMENTED',function(name){return'The '+name+' method is not implemented';});createErrorType('ERR_STREAM_PREMATURE_CLOSE','Premature close');createErrorType('ERR_STREAM_DESTROYED',function(name){return'Cannot call '+name+' after a stream was destroyed';});createErrorType('ERR_MULTIPLE_CALLBACK','Callback called multiple times');createErrorType('ERR_STREAM_CANNOT_PIPE','Cannot pipe, not readable');createErrorType('ERR_STREAM_WRITE_AFTER_END','write after end');createErrorType('ERR_STREAM_NULL_VALUES','May not write null values to stream',TypeError);createErrorType('ERR_UNKNOWN_ENCODING',function(arg){return'Unknown encoding: '+arg;},TypeError);createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT','stream.unshift() after end event');module.exports.codes=codes;},{}],83:[function(require,module,exports){(function(process){(function(){// Copyright Joyent, Inc. and other Node contributors.
|
|
2455
2023
|
//
|
|
2456
2024
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
2457
2025
|
// copy of this software and associated documentation files (the
|
|
@@ -2496,7 +2064,7 @@ enumerable:false,get:function get(){if(this._readableState===undefined||this._wr
|
|
|
2496
2064
|
// has not been initialized yet
|
|
2497
2065
|
if(this._readableState===undefined||this._writableState===undefined){return;}// backward compatibility, the user is explicitly
|
|
2498
2066
|
// managing destroyed
|
|
2499
|
-
this._readableState.destroyed=value;this._writableState.destroyed=value;}});}).call(this);}).call(this,require('_process'));},{"./_stream_readable":
|
|
2067
|
+
this._readableState.destroyed=value;this._writableState.destroyed=value;}});}).call(this);}).call(this,require('_process'));},{"./_stream_readable":85,"./_stream_writable":87,"_process":70,"inherits":53}],84:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
2500
2068
|
//
|
|
2501
2069
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
2502
2070
|
// copy of this software and associated documentation files (the
|
|
@@ -2519,7 +2087,7 @@ this._readableState.destroyed=value;this._writableState.destroyed=value;}});}).c
|
|
|
2519
2087
|
// a passthrough stream.
|
|
2520
2088
|
// basically just the most minimal sort of Transform stream.
|
|
2521
2089
|
// Every written chunk gets output as-is.
|
|
2522
|
-
'use strict';module.exports=PassThrough;var Transform=require('./_stream_transform');require('inherits')(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options);}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk);};},{"./_stream_transform":
|
|
2090
|
+
'use strict';module.exports=PassThrough;var Transform=require('./_stream_transform');require('inherits')(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options);}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk);};},{"./_stream_transform":86,"inherits":53}],85:[function(require,module,exports){(function(process,global){(function(){// Copyright Joyent, Inc. and other Node contributors.
|
|
2523
2091
|
//
|
|
2524
2092
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
2525
2093
|
// copy of this software and associated documentation files (the
|
|
@@ -2771,7 +2339,7 @@ if(state.decoder)ret=state.buffer.join('');else if(state.buffer.length===1)ret=s
|
|
|
2771
2339
|
ret=state.buffer.consume(n,state.decoder);}return ret;}function endReadable(stream){var state=stream._readableState;debug('endReadable',state.endEmitted);if(!state.endEmitted){state.ended=true;process.nextTick(endReadableNT,state,stream);}}function endReadableNT(state,stream){debug('endReadableNT',state.endEmitted,state.length);// Check that we didn't get one last unshift.
|
|
2772
2340
|
if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit('end');if(state.autoDestroy){// In case of duplex streams we need a way to detect
|
|
2773
2341
|
// if the writable side is ready for autoDestroy as well
|
|
2774
|
-
var wState=stream._writableState;if(!wState||wState.autoDestroy&&wState.finished){stream.destroy();}}}}if(typeof Symbol==='function'){Readable.from=function(iterable,opts){if(from===undefined){from=require('./internal/streams/from');}return from(Readable,iterable,opts);};}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i;}return-1;}}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":
|
|
2342
|
+
var wState=stream._writableState;if(!wState||wState.autoDestroy&&wState.finished){stream.destroy();}}}}if(typeof Symbol==='function'){Readable.from=function(iterable,opts){if(from===undefined){from=require('./internal/streams/from');}return from(Readable,iterable,opts);};}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i;}return-1;}}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":82,"./_stream_duplex":83,"./internal/streams/async_iterator":88,"./internal/streams/buffer_list":89,"./internal/streams/destroy":90,"./internal/streams/from":92,"./internal/streams/state":94,"./internal/streams/stream":95,"_process":70,"buffer":19,"events":24,"inherits":53,"string_decoder/":97,"util":17}],86:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
2775
2343
|
//
|
|
2776
2344
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
2777
2345
|
// copy of this software and associated documentation files (the
|
|
@@ -2857,7 +2425,7 @@ ts.needTransform=true;}};Transform.prototype._destroy=function(err,cb){Duplex.pr
|
|
|
2857
2425
|
stream.push(data);// TODO(BridgeAR): Write a test for these two error cases
|
|
2858
2426
|
// if there's nothing in the write buffer, then that means
|
|
2859
2427
|
// that nothing more will ever be provided
|
|
2860
|
-
if(stream._writableState.length)throw new ERR_TRANSFORM_WITH_LENGTH_0();if(stream._transformState.transforming)throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();return stream.push(null);}},{"../errors":
|
|
2428
|
+
if(stream._writableState.length)throw new ERR_TRANSFORM_WITH_LENGTH_0();if(stream._transformState.transforming)throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();return stream.push(null);}},{"../errors":82,"./_stream_duplex":83,"inherits":53}],87:[function(require,module,exports){(function(process,global){(function(){// Copyright Joyent, Inc. and other Node contributors.
|
|
2861
2429
|
//
|
|
2862
2430
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
2863
2431
|
// copy of this software and associated documentation files (the
|
|
@@ -2992,7 +2560,7 @@ enumerable:false,get:function get(){if(this._writableState===undefined){return f
|
|
|
2992
2560
|
// has not been initialized yet
|
|
2993
2561
|
if(!this._writableState){return;}// backward compatibility, the user is explicitly
|
|
2994
2562
|
// managing destroyed
|
|
2995
|
-
this._writableState.destroyed=value;}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){cb(err);};}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":
|
|
2563
|
+
this._writableState.destroyed=value;}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){cb(err);};}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":82,"./_stream_duplex":83,"./internal/streams/destroy":90,"./internal/streams/state":94,"./internal/streams/stream":95,"_process":70,"buffer":19,"inherits":53,"util-deprecate":101}],88:[function(require,module,exports){(function(process){(function(){'use strict';var _Object$setPrototypeO;function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}var finished=require('./end-of-stream');var kLastResolve=Symbol('lastResolve');var kLastReject=Symbol('lastReject');var kError=Symbol('error');var kEnded=Symbol('ended');var kLastPromise=Symbol('lastPromise');var kHandlePromise=Symbol('handlePromise');var kStream=Symbol('stream');function createIterResult(value,done){return{value:value,done:done};}function readAndResolve(iter){var resolve=iter[kLastResolve];if(resolve!==null){var data=iter[kStream].read();// we defer if data is null
|
|
2996
2564
|
// we can be expecting either 'end' or
|
|
2997
2565
|
// 'error'
|
|
2998
2566
|
if(data!==null){iter[kLastPromise]=null;iter[kLastResolve]=null;iter[kLastReject]=null;resolve(createIterResult(data,false));}}}function onReadable(iter){// we wait for the next tick, because it might
|
|
@@ -3014,7 +2582,7 @@ var data=this[kStream].read();if(data!==null){return Promise.resolve(createIterR
|
|
|
3014
2582
|
// Readable class this is attached to
|
|
3015
2583
|
return new Promise(function(resolve,reject){_this2[kStream].destroy(null,function(err){if(err){reject(err);return;}resolve(createIterResult(undefined,true));});});}),_Object$setPrototypeO),AsyncIteratorPrototype);var createReadableStreamAsyncIterator=function createReadableStreamAsyncIterator(stream){var _Object$create;var iterator=Object.create(ReadableStreamAsyncIteratorPrototype,(_Object$create={},_defineProperty(_Object$create,kStream,{value:stream,writable:true}),_defineProperty(_Object$create,kLastResolve,{value:null,writable:true}),_defineProperty(_Object$create,kLastReject,{value:null,writable:true}),_defineProperty(_Object$create,kError,{value:null,writable:true}),_defineProperty(_Object$create,kEnded,{value:stream._readableState.endEmitted,writable:true}),_defineProperty(_Object$create,kHandlePromise,{value:function value(resolve,reject){var data=iterator[kStream].read();if(data){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;resolve(createIterResult(data,false));}else{iterator[kLastResolve]=resolve;iterator[kLastReject]=reject;}},writable:true}),_Object$create));iterator[kLastPromise]=null;finished(stream,function(err){if(err&&err.code!=='ERR_STREAM_PREMATURE_CLOSE'){var reject=iterator[kLastReject];// reject if we are waiting for data in the Promise
|
|
3016
2584
|
// returned by next() and store the error
|
|
3017
|
-
if(reject!==null){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;reject(err);}iterator[kError]=err;return;}var resolve=iterator[kLastResolve];if(resolve!==null){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;resolve(createIterResult(undefined,true));}iterator[kEnded]=true;});stream.on('readable',onReadable.bind(null,iterator));return iterator;};module.exports=createReadableStreamAsyncIterator;}).call(this);}).call(this,require('_process'));},{"./end-of-stream":
|
|
2585
|
+
if(reject!==null){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;reject(err);}iterator[kError]=err;return;}var resolve=iterator[kLastResolve];if(resolve!==null){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;resolve(createIterResult(undefined,true));}iterator[kEnded]=true;});stream.on('readable',onReadable.bind(null,iterator));return iterator;};module.exports=createReadableStreamAsyncIterator;}).call(this);}).call(this,require('_process'));},{"./end-of-stream":91,"_process":70}],89:[function(require,module,exports){'use strict';function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}var _require=require('buffer'),Buffer=_require.Buffer;var _require2=require('util'),inspect=_require2.inspect;var custom=inspect&&inspect.custom||'inspect';function copyBuffer(src,target,offset){Buffer.prototype.copy.call(src,target,offset);}module.exports=/*#__PURE__*/function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0;}_createClass(BufferList,[{key:"push",value:function push(v){var entry={data:v,next:null};if(this.length>0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length;}},{key:"unshift",value:function unshift(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length;}},{key:"shift",value:function shift(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret;}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0;}},{key:"join",value:function join(s){if(this.length===0)return'';var p=this.head;var ret=''+p.data;while(p=p.next)ret+=s+p.data;return ret;}},{key:"concat",value:function concat(n){if(this.length===0)return Buffer.alloc(0);var ret=Buffer.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){copyBuffer(p.data,ret,i);i+=p.data.length;p=p.next;}return ret;}// Consumes a specified amount of bytes or characters from the buffered data.
|
|
3018
2586
|
},{key:"consume",value:function consume(n,hasStrings){var ret;if(n<this.head.data.length){// `slice` is the same for buffers and strings.
|
|
3019
2587
|
ret=this.head.data.slice(0,n);this.head.data=this.head.data.slice(n);}else if(n===this.head.data.length){// First chunk is a perfect match.
|
|
3020
2588
|
ret=this.shift();}else{// Result spans more than one buffer.
|
|
@@ -3023,7 +2591,7 @@ ret=hasStrings?this._getString(n):this._getBuffer(n);}return ret;}},{key:"first"
|
|
|
3023
2591
|
},{key:"_getBuffer",value:function _getBuffer(n){var ret=Buffer.allocUnsafe(n);var p=this.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)this.head=p.next;else this.head=this.tail=null;}else{this.head=p;p.data=buf.slice(nb);}break;}++c;}this.length-=c;return ret;}// Make sure the linked list only shows the minimal necessary information.
|
|
3024
2592
|
},{key:custom,value:function value(_,options){return inspect(this,_objectSpread(_objectSpread({},options),{},{// Only inspect one level.
|
|
3025
2593
|
depth:0,// It should not recurse.
|
|
3026
|
-
customInspect:false}));}}]);return BufferList;}();},{"buffer":19,"util":17}],
|
|
2594
|
+
customInspect:false}));}}]);return BufferList;}();},{"buffer":19,"util":17}],90:[function(require,module,exports){(function(process){(function(){'use strict';// undocumented cb() API, needed for core, not for public API
|
|
3027
2595
|
function destroy(err,cb){var _this=this;var readableDestroyed=this._readableState&&this._readableState.destroyed;var writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed){if(cb){cb(err);}else if(err){if(!this._writableState){process.nextTick(emitErrorNT,this,err);}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,err);}}return this;}// we set destroyed to true before firing error callbacks in order
|
|
3028
2596
|
// to make it re-entrance safe in case destroy() is called within callbacks
|
|
3029
2597
|
if(this._readableState){this._readableState.destroyed=true;}// if this is a duplex stream mark the writable part as destroyed as well
|
|
@@ -3032,15 +2600,15 @@ if(this._writableState){this._writableState.destroyed=true;}this._destroy(err||n
|
|
|
3032
2600
|
// For now when you opt-in to autoDestroy we allow
|
|
3033
2601
|
// the error to be emitted nextTick. In a future
|
|
3034
2602
|
// semver major update we should change the default to this.
|
|
3035
|
-
var rState=stream._readableState;var wState=stream._writableState;if(rState&&rState.autoDestroy||wState&&wState.autoDestroy)stream.destroy(err);else stream.emit('error',err);}module.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy};}).call(this);}).call(this,require('_process'));},{"_process":
|
|
2603
|
+
var rState=stream._readableState;var wState=stream._writableState;if(rState&&rState.autoDestroy||wState&&wState.autoDestroy)stream.destroy(err);else stream.emit('error',err);}module.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy};}).call(this);}).call(this,require('_process'));},{"_process":70}],91:[function(require,module,exports){// Ported from https://github.com/mafintosh/end-of-stream with
|
|
3036
2604
|
// permission from the author, Mathias Buus (@mafintosh).
|
|
3037
2605
|
'use strict';var ERR_STREAM_PREMATURE_CLOSE=require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;function once(callback){var called=false;return function(){if(called)return;called=true;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}callback.apply(this,args);};}function noop(){}function isRequest(stream){return stream.setHeader&&typeof stream.abort==='function';}function eos(stream,opts,callback){if(typeof opts==='function')return eos(stream,null,opts);if(!opts)opts={};callback=once(callback||noop);var readable=opts.readable||opts.readable!==false&&stream.readable;var writable=opts.writable||opts.writable!==false&&stream.writable;var onlegacyfinish=function onlegacyfinish(){if(!stream.writable)onfinish();};var writableEnded=stream._writableState&&stream._writableState.finished;var onfinish=function onfinish(){writable=false;writableEnded=true;if(!readable)callback.call(stream);};var readableEnded=stream._readableState&&stream._readableState.endEmitted;var onend=function onend(){readable=false;readableEnded=true;if(!writable)callback.call(stream);};var onerror=function onerror(err){callback.call(stream,err);};var onclose=function onclose(){var err;if(readable&&!readableEnded){if(!stream._readableState||!stream._readableState.ended)err=new ERR_STREAM_PREMATURE_CLOSE();return callback.call(stream,err);}if(writable&&!writableEnded){if(!stream._writableState||!stream._writableState.ended)err=new ERR_STREAM_PREMATURE_CLOSE();return callback.call(stream,err);}};var onrequest=function onrequest(){stream.req.on('finish',onfinish);};if(isRequest(stream)){stream.on('complete',onfinish);stream.on('abort',onclose);if(stream.req)onrequest();else stream.on('request',onrequest);}else if(writable&&!stream._writableState){// legacy streams
|
|
3038
|
-
stream.on('end',onlegacyfinish);stream.on('close',onlegacyfinish);}stream.on('end',onend);stream.on('finish',onfinish);if(opts.error!==false)stream.on('error',onerror);stream.on('close',onclose);return function(){stream.removeListener('complete',onfinish);stream.removeListener('abort',onclose);stream.removeListener('request',onrequest);if(stream.req)stream.req.removeListener('finish',onfinish);stream.removeListener('end',onlegacyfinish);stream.removeListener('close',onlegacyfinish);stream.removeListener('finish',onfinish);stream.removeListener('end',onend);stream.removeListener('error',onerror);stream.removeListener('close',onclose);};}module.exports=eos;},{"../../../errors":
|
|
2606
|
+
stream.on('end',onlegacyfinish);stream.on('close',onlegacyfinish);}stream.on('end',onend);stream.on('finish',onfinish);if(opts.error!==false)stream.on('error',onerror);stream.on('close',onclose);return function(){stream.removeListener('complete',onfinish);stream.removeListener('abort',onclose);stream.removeListener('request',onrequest);if(stream.req)stream.req.removeListener('finish',onfinish);stream.removeListener('end',onlegacyfinish);stream.removeListener('close',onlegacyfinish);stream.removeListener('finish',onfinish);stream.removeListener('end',onend);stream.removeListener('error',onerror);stream.removeListener('close',onclose);};}module.exports=eos;},{"../../../errors":82}],92:[function(require,module,exports){module.exports=function(){throw new Error('Readable.from is not available in the browser');};},{}],93:[function(require,module,exports){// Ported from https://github.com/mafintosh/pump with
|
|
3039
2607
|
// permission from the author, Mathias Buus (@mafintosh).
|
|
3040
2608
|
'use strict';var eos;function once(callback){var called=false;return function(){if(called)return;called=true;callback.apply(void 0,arguments);};}var _require$codes=require('../../../errors').codes,ERR_MISSING_ARGS=_require$codes.ERR_MISSING_ARGS,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED;function noop(err){// Rethrow the error if it exists to avoid swallowing it
|
|
3041
2609
|
if(err)throw err;}function isRequest(stream){return stream.setHeader&&typeof stream.abort==='function';}function destroyer(stream,reading,writing,callback){callback=once(callback);var closed=false;stream.on('close',function(){closed=true;});if(eos===undefined)eos=require('./end-of-stream');eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=true;callback();});var destroyed=false;return function(err){if(closed)return;if(destroyed)return;destroyed=true;// request.destroy just do .end - .abort is what we want
|
|
3042
|
-
if(isRequest(stream))return stream.abort();if(typeof stream.destroy==='function')return stream.destroy();callback(err||new ERR_STREAM_DESTROYED('pipe'));};}function call(fn){fn();}function pipe(from,to){return from.pipe(to);}function popCallback(streams){if(!streams.length)return noop;if(typeof streams[streams.length-1]!=='function')return noop;return streams.pop();}function pipeline(){for(var _len=arguments.length,streams=new Array(_len),_key=0;_key<_len;_key++){streams[_key]=arguments[_key];}var callback=popCallback(streams);if(Array.isArray(streams[0]))streams=streams[0];if(streams.length<2){throw new ERR_MISSING_ARGS('streams');}var error;var destroys=streams.map(function(stream,i){var reading=i<streams.length-1;var writing=i>0;return destroyer(stream,reading,writing,function(err){if(!error)error=err;if(err)destroys.forEach(call);if(reading)return;destroys.forEach(call);callback(error);});});return streams.reduce(pipe);}module.exports=pipeline;},{"../../../errors":
|
|
3043
|
-
return state.objectMode?16:16*1024;}module.exports={getHighWaterMark:getHighWaterMark};},{"../../../errors":
|
|
2610
|
+
if(isRequest(stream))return stream.abort();if(typeof stream.destroy==='function')return stream.destroy();callback(err||new ERR_STREAM_DESTROYED('pipe'));};}function call(fn){fn();}function pipe(from,to){return from.pipe(to);}function popCallback(streams){if(!streams.length)return noop;if(typeof streams[streams.length-1]!=='function')return noop;return streams.pop();}function pipeline(){for(var _len=arguments.length,streams=new Array(_len),_key=0;_key<_len;_key++){streams[_key]=arguments[_key];}var callback=popCallback(streams);if(Array.isArray(streams[0]))streams=streams[0];if(streams.length<2){throw new ERR_MISSING_ARGS('streams');}var error;var destroys=streams.map(function(stream,i){var reading=i<streams.length-1;var writing=i>0;return destroyer(stream,reading,writing,function(err){if(!error)error=err;if(err)destroys.forEach(call);if(reading)return;destroys.forEach(call);callback(error);});});return streams.reduce(pipe);}module.exports=pipeline;},{"../../../errors":82,"./end-of-stream":91}],94:[function(require,module,exports){'use strict';var ERR_INVALID_OPT_VALUE=require('../../../errors').codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(options,isDuplex,duplexKey){return options.highWaterMark!=null?options.highWaterMark:isDuplex?options[duplexKey]:null;}function getHighWaterMark(state,options,duplexKey,isDuplex){var hwm=highWaterMarkFrom(options,isDuplex,duplexKey);if(hwm!=null){if(!(isFinite(hwm)&&Math.floor(hwm)===hwm)||hwm<0){var name=isDuplex?duplexKey:'highWaterMark';throw new ERR_INVALID_OPT_VALUE(name,hwm);}return Math.floor(hwm);}// Default value
|
|
2611
|
+
return state.objectMode?16:16*1024;}module.exports={getHighWaterMark:getHighWaterMark};},{"../../../errors":82}],95:[function(require,module,exports){module.exports=require('events').EventEmitter;},{"events":24}],96:[function(require,module,exports){exports=module.exports=require('./lib/_stream_readable.js');exports.Stream=exports;exports.Readable=exports;exports.Writable=require('./lib/_stream_writable.js');exports.Duplex=require('./lib/_stream_duplex.js');exports.Transform=require('./lib/_stream_transform.js');exports.PassThrough=require('./lib/_stream_passthrough.js');exports.finished=require('./lib/internal/streams/end-of-stream.js');exports.pipeline=require('./lib/internal/streams/pipeline.js');},{"./lib/_stream_duplex.js":83,"./lib/_stream_passthrough.js":84,"./lib/_stream_readable.js":85,"./lib/_stream_transform.js":86,"./lib/_stream_writable.js":87,"./lib/internal/streams/end-of-stream.js":91,"./lib/internal/streams/pipeline.js":93}],97:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
3044
2612
|
//
|
|
3045
2613
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
3046
2614
|
// copy of this software and associated documentation files (the
|
|
@@ -3094,13 +2662,13 @@ function utf8End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed)
|
|
|
3094
2662
|
function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString('utf16le',i);if(r){var c=r.charCodeAt(r.length-1);if(c>=0xD800&&c<=0xDBFF){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1);}}return r;}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString('utf16le',i,buf.length-1);}// For UTF-16LE we do not explicitly append special replacement characters if we
|
|
3095
2663
|
// end on a partial character, we simply let v8 handle that.
|
|
3096
2664
|
function utf16End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString('utf16le',0,end);}return r;}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString('base64',i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1];}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];}return buf.toString('base64',i,buf.length-n);}function base64End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed)return r+this.lastChar.toString('base64',0,3-this.lastNeed);return r;}// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
|
|
3097
|
-
function simpleWrite(buf){return buf.toString(this.encoding);}function simpleEnd(buf){return buf&&buf.length?this.write(buf):'';}},{"safe-buffer":
|
|
2665
|
+
function simpleWrite(buf){return buf.toString(this.encoding);}function simpleEnd(buf){return buf&&buf.length?this.write(buf):'';}},{"safe-buffer":75}],98:[function(require,module,exports){(function(setImmediate,clearImmediate){(function(){var nextTick=require('process/browser.js').nextTick;var apply=Function.prototype.apply;var slice=Array.prototype.slice;var immediateIds={};var nextImmediateId=0;// DOM APIs, for completeness
|
|
3098
2666
|
exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout);};exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval);};exports.clearTimeout=exports.clearInterval=function(timeout){timeout.close();};function Timeout(id,clearFn){this._id=id;this._clearFn=clearFn;}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(window,this._id);};// Does not start the time, just sets up the members needed.
|
|
3099
2667
|
exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId);item._idleTimeout=msecs;};exports.unenroll=function(item){clearTimeout(item._idleTimeoutId);item._idleTimeout=-1;};exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;if(msecs>=0){item._idleTimeoutId=setTimeout(function onTimeout(){if(item._onTimeout)item._onTimeout();},msecs);}};// That's not how node.js implements it but the exposed api is the same.
|
|
3100
2668
|
exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick(function onNextTick(){if(immediateIds[id]){// fn.call() is faster so we optimize for the common use-case
|
|
3101
2669
|
// @see http://jsperf.com/call-apply-segu
|
|
3102
2670
|
if(args){fn.apply(null,args);}else{fn.call(null);}// Prevent ids from leaking
|
|
3103
|
-
exports.clearImmediate(id);}});return id;};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id];};}).call(this);}).call(this,require("timers").setImmediate,require("timers").clearImmediate);},{"process/browser.js":
|
|
2671
|
+
exports.clearImmediate(id);}});return id;};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id];};}).call(this);}).call(this,require("timers").setImmediate,require("timers").clearImmediate);},{"process/browser.js":70,"timers":98}],99:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
3104
2672
|
//
|
|
3105
2673
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
3106
2674
|
// copy of this software and associated documentation files (the
|
|
@@ -3247,7 +2815,7 @@ if(psychotic){result.hostname=result.host=isAbsolute?'':srcPath.length?srcPath.s
|
|
|
3247
2815
|
//this especially happens in cases like
|
|
3248
2816
|
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
|
|
3249
2817
|
var authInHost=result.host&&result.host.indexOf('@')>0?result.host.split('@'):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift();}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift('');}if(!srcPath.length){result.pathname=null;result.path=null;}else{result.pathname=srcPath.join('/');}//to support request.http
|
|
3250
|
-
if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(result.pathname?result.pathname:'')+(result.search?result.search:'');}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result;};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==':'){this.port=port.substr(1);}host=host.substr(0,host.length-port.length);}if(host)this.hostname=host;};},{"./util":
|
|
2818
|
+
if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(result.pathname?result.pathname:'')+(result.search?result.search:'');}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result;};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==':'){this.port=port.substr(1);}host=host.substr(0,host.length-port.length);}if(host)this.hostname=host;};},{"./util":100,"punycode":71,"querystring":74}],100:[function(require,module,exports){'use strict';module.exports={isString:function isString(arg){return typeof arg==='string';},isObject:function isObject(arg){return _typeof(arg)==='object'&&arg!==null;},isNull:function isNull(arg){return arg===null;},isNullOrUndefined:function isNullOrUndefined(arg){return arg==null;}};},{}],101:[function(require,module,exports){(function(global){(function(){/**
|
|
3251
2819
|
* Module exports.
|
|
3252
2820
|
*/module.exports=deprecate;/**
|
|
3253
2821
|
* Mark that a method should not be used.
|
|
@@ -3272,16 +2840,16 @@ if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(resu
|
|
|
3272
2840
|
* @returns {Boolean}
|
|
3273
2841
|
* @api private
|
|
3274
2842
|
*/function config(name){// accessing global.localStorage can trigger a DOMException in sandboxed iframes
|
|
3275
|
-
try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==='true';}}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],
|
|
2843
|
+
try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==='true';}}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],102:[function(require,module,exports){// Returns a wrapper function that returns a wrapped callback
|
|
3276
2844
|
// The wrapper function should do some stuff, and return a
|
|
3277
2845
|
// presumably different callback function.
|
|
3278
2846
|
// This makes sure that own properties are retained, so that
|
|
3279
2847
|
// decorations and such are not lost along the way.
|
|
3280
|
-
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],
|
|
2848
|
+
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],103:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],104:[function(require,module,exports){/**
|
|
3281
2849
|
* Pict browser shim loader
|
|
3282
2850
|
* @author <steven@velozo.com>
|
|
3283
2851
|
*/ // Load the pict module into the browser global automatically.
|
|
3284
|
-
var libPict=require('./Pict.js');if((typeof window==="undefined"?"undefined":_typeof(window))==='object'){window.Pict=libPict;}module.exports=libPict;},{"./Pict.js":
|
|
2852
|
+
var libPict=require('./Pict.js');if((typeof window==="undefined"?"undefined":_typeof(window))==='object'){window.Pict=libPict;}module.exports=libPict;},{"./Pict.js":109}],105:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictContentAssignment=/*#__PURE__*/function(_libFableServiceBase7){_inherits(PictContentAssignment,_libFableServiceBase7);var _super17=_createSuper(PictContentAssignment);function PictContentAssignment(pFable,pOptions,pServiceHash){var _this30;_classCallCheck2(this,PictContentAssignment);_this30=_super17.call(this,pFable,pOptions,pServiceHash);_this30.serviceType='PictContentAssignment';// Check to see if we are running in a browser
|
|
3285
2853
|
_this30.inBrowser=false;_this30.hasDocument=false;if((typeof window==="undefined"?"undefined":_typeof(window))=='object'){_this30.inBrowser=true;// Now check that the browser has a document object
|
|
3286
2854
|
if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){_this30.hasDocument=true;}}// If we're in a browser, check to see if jQuery is available.
|
|
3287
2855
|
_this30.hasJquery=false;_this30.jQuery=false;if(_this30.inBrowser&&typeof window.jQuery!=='undefined'){_this30.hasJquery=true;}// API Consumers can also craft their own assign function
|
|
@@ -3294,7 +2862,7 @@ var tmpTargetElement=window.jQuery(pAddress);// Should we ensure we matched 1 an
|
|
|
3294
2862
|
tmpTargetElement.html(pContent);//}
|
|
3295
2863
|
}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=window.document.querySelectorAll(pAddress);for(var i=0;i<tmpTargetElementSet.length;i++){tmpTargetElementSet[i].innerHTML=pContent;}}else{// Just log it out for now
|
|
3296
2864
|
this.fable.log.trace("PICT Content ASSIGN to [".concat(pAddress,"]:"),pContent);}}},{key:"appendContent",value:function appendContent(pAddress,pContent){if(this.customAppendFunction){return this.customAppendFunction(pAddress,pContent);}else if(this.hasJquery){var tmpTargetElement=window.jQuery(pAddress);tmpTargetElement.append(pContent);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=window.document.querySelectorAll(pAddress);for(var i=0;i<tmpTargetElementSet.length;i++){tmpTargetElementSet[i].insertAdjacentHTML("beforeend",pContent);}}else{// Just log it out for now -- nothing browser in our mix.
|
|
3297
|
-
this.fable.log.trace("PICT Content APPEND to [".concat(pAddress,"]:"),pContent);}}}]);return PictContentAssignment;}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":39}],
|
|
2865
|
+
this.fable.log.trace("PICT Content APPEND to [".concat(pAddress,"]:"),pContent);}}}]);return PictContentAssignment;}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":39}],106:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase8){_inherits(PictMeadowEntityProvider,_libFableServiceBase8);var _super18=_createSuper(PictMeadowEntityProvider);function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this31;_classCallCheck2(this,PictMeadowEntityProvider);_this31=_super18.call(this,pFable,pOptions,pServiceHash);_defineProperty2(_assertThisInitialized(_this31),"getEntitySet",function(pEntity,pMeadowFilterExpression,fCallback){var _this32=this;this.initializeCache(pEntity);// TODO: Should we test for too many record IDs here by string length?
|
|
3298
2866
|
// FBL~ID${pDestinationEntity}~INN~${tmpIDRecordsCommaSeparated}
|
|
3299
2867
|
// Discard anything from the cache that has expired or is over size.
|
|
3300
2868
|
this.cache[pEntity].prune(function(){var tmpCountOptions={url:"".concat(_this32.options.urlPrefix).concat(pEntity,"s/Count/FilteredTo/").concat(pMeadowFilterExpression)};tmpCountOptions=_this32.prepareRequestOptions(tmpCountOptions);return _this32.restClient.getJSON(tmpCountOptions,function(pError,pResponse,pBody){if(pError){_this32.fable.log.error("Error getting bulk entity count of [".concat(pEntity,"] filtered to [").concat(pMeadowFilterExpression,"] from server [").concat(tmpCountOptions.url,"]: ").concat(pError));return fCallback(pError);}var tmpRecordCount=0;if(pBody.Count){tmpRecordCount=pBody.Count;}var tmpDownloadURIFragments=[];var tmpDownloadBatchSize=_this32.options.downloadBatchSize;for(var i=0;i<tmpRecordCount/tmpDownloadBatchSize;i++){// Generate each of the URI fragments to download
|
|
@@ -3304,7 +2872,7 @@ return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){retur
|
|
|
3304
2872
|
if(!this.cache.hasOwnProperty(pEntity)){this.cache[pEntity]=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration('ObjectCache');// TODO: Make this a configuration?
|
|
3305
2873
|
// For now cache for 30 seconds.
|
|
3306
2874
|
this.cache[pEntity].maxAge=30000;this.cache[pEntity].maxLength=10000;this.fable.Bundle[pEntity]=this.cache[pEntity].RecordMap;}}},{key:"getEntity",value:function getEntity(pEntity,pIDRecord,fCallback){var _this33=this;this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
|
|
3307
|
-
this.cache[pEntity].prune(function(){var tmpPossibleRecord=_this33.cache[pEntity].read(pIDRecord);if(tmpPossibleRecord){return tmpPossibleRecord;}var tmpOptions={url:"".concat(_this33.options.urlPrefix).concat(pEntity,"/").concat(pIDRecord)};tmpOptions=_this33.prepareRequestOptions(tmpOptions);return _this33.restClient.getJSON(tmpOptions,function(pError,pResponse,pBody){if(pBody){_this33.cache[pEntity].put(pBody,pIDRecord);}return fCallback(pError,pBody);});});}}]);return PictMeadowEntityProvider;}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":39}],
|
|
2875
|
+
this.cache[pEntity].prune(function(){var tmpPossibleRecord=_this33.cache[pEntity].read(pIDRecord);if(tmpPossibleRecord){return tmpPossibleRecord;}var tmpOptions={url:"".concat(_this33.options.urlPrefix).concat(pEntity,"/").concat(pIDRecord)};tmpOptions=_this33.prepareRequestOptions(tmpOptions);return _this33.restClient.getJSON(tmpOptions,function(pError,pResponse,pBody){if(pBody){_this33.cache[pEntity].put(pBody,pIDRecord);}return fCallback(pError,pBody);});});}}]);return PictMeadowEntityProvider;}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":39}],107:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(_libFableServiceBase9){_inherits(PictTemplateProvider,_libFableServiceBase9);var _super19=_createSuper(PictTemplateProvider);function PictTemplateProvider(pFable,pOptions,pServiceHash){var _this34;_classCallCheck2(this,PictTemplateProvider);_this34=_super19.call(this,pFable,pOptions,pServiceHash);_this34.serviceType='PictTemplateProvider';_this34.templates={};_this34.templateSources={};// Default templates are stored by prefix.
|
|
3308
2876
|
// The longest prefix match is used.
|
|
3309
2877
|
// Case sensitive.
|
|
3310
2878
|
_this34.defaultTemplates=[];// This function can be overloaded to load templates from a database, in a page or other source.
|
|
@@ -3320,7 +2888,7 @@ _this34.loadTemplateFunction=function(pTemplateHash){return false;};return _this
|
|
|
3320
2888
|
*/for(var i=0;i<this.defaultTemplates.length;i++){if(pTemplateHash.indexOf(this.defaultTemplates[i].postfix)==pTemplateHash.length-this.defaultTemplates[i].postfix.length&&pTemplateHash.indexOf(this.defaultTemplates[i].prefix)==0){this.templates[pTemplateHash]=this.defaultTemplates[i].template;this.templateSources[pTemplateHash]="Auto created in checkDefaultTemplateHash('".concat(pTemplateHash,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(this.defaultTemplates[i].prefix,"]...[").concat(this.defaultTemplates[i].postfix,"]");return this.templates[pTemplateHash];}}return false;}},{key:"getTemplate",value:function getTemplate(pTemplateHash){// TODO: Optimize this.
|
|
3321
2889
|
// If the template doesn't exist, try to load it with the loading function
|
|
3322
2890
|
if(!this.templates.hasOwnProperty(pTemplateHash)){this.loadTemplate(pTemplateHash);}// If the loading function fails, try to load it from the default templates
|
|
3323
|
-
if(!this.templates.hasOwnProperty(pTemplateHash)){this.checkDefaultTemplateHash(pTemplateHash);}if(this.templates.hasOwnProperty(pTemplateHash)){return this.templates[pTemplateHash];}else{return false;}}},{key:"loadTemplate",value:function loadTemplate(pTemplateHash){var tmpTemplate=this.loadTemplateFunction(pTemplateHash);if(tmpTemplate){this.templates[pTemplateHash]=tmpTemplate.template;this.templateSources[pTemplateHash]="Loaded in loadTemplate('".concat(pTemplateHash,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(tmpTemplate.source,"]");}return tmpTemplate;}}]);return PictTemplateProvider;}(libFableServiceBase);module.exports=PictTemplateProvider;},{"fable":39}],
|
|
2891
|
+
if(!this.templates.hasOwnProperty(pTemplateHash)){this.checkDefaultTemplateHash(pTemplateHash);}if(this.templates.hasOwnProperty(pTemplateHash)){return this.templates[pTemplateHash];}else{return false;}}},{key:"loadTemplate",value:function loadTemplate(pTemplateHash){var tmpTemplate=this.loadTemplateFunction(pTemplateHash);if(tmpTemplate){this.templates[pTemplateHash]=tmpTemplate.template;this.templateSources[pTemplateHash]="Loaded in loadTemplate('".concat(pTemplateHash,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(tmpTemplate.source,"]");}return tmpTemplate;}}]);return PictTemplateProvider;}(libFableServiceBase);module.exports=PictTemplateProvider;},{"fable":39}],108:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var defaultPictViewSettings={DefaultRenderable:false,DefaultTemplateRecordAddress:false,DefaultDestinationAddress:false,ViewIdentifier:'DEFAULT',RenderOnLoad:false,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};var PictView=/*#__PURE__*/function(_libFableServiceBase10){_inherits(PictView,_libFableServiceBase10);var _super20=_createSuper(PictView);function PictView(pFable,pOptions,pServiceHash){var _this35;_classCallCheck2(this,PictView);_this35=_super20.call(this,pFable,pOptions,pServiceHash);_this35.options=_this35.fable.Utility.extend(defaultPictViewSettings,_this35.options);_this35.serviceType='PictView';// Load all templates from the array in the options
|
|
3324
2892
|
// Templates are in the form of {Hash:'Some-Template-Hash',Template:'Template content',Source:'TemplateSource'}
|
|
3325
2893
|
for(var i=0;i<_this35.options.Templates.length;i++){var tmpTemplate=_this35.options.Templates[i];if(!tmpTemplate.hasOwnProperty('Hash')||!tmpTemplate.hasOwnProperty('Template')){_this35.fable.log.error("PictView [".concat(_this35.UUID,"]::[").concat(_this35.Hash,"] ").concat(_this35.options.ViewIdentifier," could not load Template ").concat(i," in the options array."),tmpTemplate);}else{if(!tmpTemplate.Source){tmpTemplate.Source="PictView [".concat(_this35.UUID,"]::[").concat(_this35.Hash,"] ").concat(_this35.options.ViewIdentifier," options object.");}_this35.fable.TemplateProvider.addTemplate(tmpTemplate.Hash,tmpTemplate.Template,tmpTemplate.Source);}}// Load all default templates from the array in the options
|
|
3326
2894
|
// Templates are in the form of {Prefix:'',Postfix:'-List-Row',Template:'Template content',Source:'TemplateSourceString'}
|
|
@@ -3329,9 +2897,9 @@ for(var _i10=0;_i10<_this35.options.DefaultTemplates.length;_i10++){var tmpDefau
|
|
|
3329
2897
|
// They look as such: {Identifier:'ContentEntry', TemplateHash:'Content-Entry-Section-Main', ContentDestinationAddress:'#ContentSection', RecordAddress:'AppData.Content.DefaultText', ManifestTransformation:'ManyfestHash', ManifestDestinationAddress:'AppData.Content.DataToTransformContent'}
|
|
3330
2898
|
// The only parts that are necessary are Identifier and Template
|
|
3331
2899
|
// A developer can then do render('ContentEntry') and it just kinda works. Or they can override the ContentDestinationAddress
|
|
3332
|
-
_this35.renderables={};for(var _i11=0;_i11<_this35.options.Renderables.length;_i11++){var tmpRenderable=_this35.options.Renderables[_i11];if(!tmpRenderable.hasOwnProperty('RenderableHash')||!tmpRenderable.hasOwnProperty('TemplateHash')){_this35.fable.log.error("PictView [".concat(_this35.UUID,"]::[").concat(_this35.Hash,"] ").concat(_this35.options.ViewIdentifier," could not load Renderable ").concat(_i11," in the options array."),tmpRenderable);}else{_this35.renderables[tmpRenderable.RenderableHash]=tmpRenderable;}}if(_this35.options.RenderOnLoad){_this35.render(_this35.options.DefaultRenderable);}return _this35;}_createClass2(PictView,[{key:"render",value:function render(pRenderable,pRenderDestinationAddress,pTemplateDataAddress){if(!this.renderables.hasOwnProperty(pRenderable)){this.fable.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(pRenderable," because it is not a valid renderable."));return false;}var tmpRenderable=this.renderables[pRenderable];var tmpRenderDestinationAddress=typeof pRenderDestinationAddress==='string'?pRenderDestinationAddress:typeof tmpRenderable.ContentDestinationAddress==='string'?tmpRenderable.ContentDestinationAddress:typeof this.options.DefaultDestinationAddress==='string'?this.options.DefaultDestinationAddress:false;if(!tmpRenderDestinationAddress){this.fable.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(pRenderable," because it does not have a valid destination address."));return false;}var tmpDataAddress=typeof pTemplateDataAddress==='string'?pTemplateDataAddress:typeof tmpRenderable.RecordAddress==='string'?tmpRenderable.RecordAddress:typeof this.options.DefaultTemplateRecordAddress==='string'?this.options.DefaultTemplateRecordAddress:false;var tmpData=typeof tmpDataAddress==='string'?this.fable.DataProvider.getDataByAddress(tmpDataAddress):undefined;var tmpContent=this.fable.parseTemplateByHash(tmpRenderable.TemplateHash,tmpData);return this.fable.ContentAssignment.assignContent(tmpRenderDestinationAddress,tmpContent);}},{key:"renderAsync",value:function renderAsync(pRenderable,pRenderDestinationAddress,pTemplateDataAddress,fCallback){var _this36=this;if(!this.renderables.hasOwnProperty(pRenderable)){this.fable.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(pRenderable," because it is not a valid renderable."));return false;}var tmpRenderable=this.renderables[pRenderable];var tmpRenderDestinationAddress=typeof pRenderDestinationAddress==='string'?pRenderDestinationAddress:typeof tmpRenderable.ContentDestinationAddress==='string'?tmpRenderable.ContentDestinationAddress:typeof this.options.DefaultDestinationAddress==='string'?this.options.DefaultDestinationAddress:false;if(!tmpRenderDestinationAddress){this.fable.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(pRenderable," because it does not have a valid destination address."));return false;}var tmpDataAddress=typeof pTemplateDataAddress==='string'?pTemplateDataAddress:typeof tmpRenderable.RecordAddress==='string'?tmpRenderable.RecordAddress:typeof this.options.DefaultTemplateRecordAddress==='string'?this.options.DefaultTemplateRecordAddress:false;var tmpData=typeof tmpDataAddress==='string'?this.fable.DataProvider.getDataByAddress(tmpDataAddress):undefined;this.fable.parseTemplateByHash(tmpRenderable.TemplateHash,tmpData,function(pError,pContent){if(pError){_this36.fable.log.error("PictView [".concat(_this36.UUID,"]::[").concat(_this36.Hash,"] ").concat(_this36.options.ViewIdentifier," could not render ").concat(pRenderable," because it could not parse the template."),pError);return fCallback(pError);}_this36.fable.ContentAssignment.assignContent(tmpRenderDestinationAddress,pContent);return fCallback(null,pContent);});}}]);return PictView;}(libFableServiceBase);module.exports=PictView;},{"fable":39}],
|
|
2900
|
+
_this35.renderables={};for(var _i11=0;_i11<_this35.options.Renderables.length;_i11++){var tmpRenderable=_this35.options.Renderables[_i11];if(!tmpRenderable.hasOwnProperty('RenderableHash')||!tmpRenderable.hasOwnProperty('TemplateHash')){_this35.fable.log.error("PictView [".concat(_this35.UUID,"]::[").concat(_this35.Hash,"] ").concat(_this35.options.ViewIdentifier," could not load Renderable ").concat(_i11," in the options array."),tmpRenderable);}else{_this35.renderables[tmpRenderable.RenderableHash]=tmpRenderable;}}if(_this35.options.RenderOnLoad){_this35.render(_this35.options.DefaultRenderable);}return _this35;}_createClass2(PictView,[{key:"render",value:function render(pRenderable,pRenderDestinationAddress,pTemplateDataAddress){if(!this.renderables.hasOwnProperty(pRenderable)){this.fable.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(pRenderable," because it is not a valid renderable."));return false;}var tmpRenderable=this.renderables[pRenderable];var tmpRenderDestinationAddress=typeof pRenderDestinationAddress==='string'?pRenderDestinationAddress:typeof tmpRenderable.ContentDestinationAddress==='string'?tmpRenderable.ContentDestinationAddress:typeof this.options.DefaultDestinationAddress==='string'?this.options.DefaultDestinationAddress:false;if(!tmpRenderDestinationAddress){this.fable.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(pRenderable," because it does not have a valid destination address."));return false;}var tmpDataAddress=typeof pTemplateDataAddress==='string'?pTemplateDataAddress:typeof tmpRenderable.RecordAddress==='string'?tmpRenderable.RecordAddress:typeof this.options.DefaultTemplateRecordAddress==='string'?this.options.DefaultTemplateRecordAddress:false;var tmpData=typeof tmpDataAddress==='string'?this.fable.DataProvider.getDataByAddress(tmpDataAddress):undefined;var tmpContent=this.fable.parseTemplateByHash(tmpRenderable.TemplateHash,tmpData);return this.fable.ContentAssignment.assignContent(tmpRenderDestinationAddress,tmpContent);}},{key:"renderAsync",value:function renderAsync(pRenderable,pRenderDestinationAddress,pTemplateDataAddress,fCallback){var _this36=this;if(!this.renderables.hasOwnProperty(pRenderable)){this.fable.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(pRenderable," because it is not a valid renderable."));return false;}var tmpRenderable=this.renderables[pRenderable];var tmpRenderDestinationAddress=typeof pRenderDestinationAddress==='string'?pRenderDestinationAddress:typeof tmpRenderable.ContentDestinationAddress==='string'?tmpRenderable.ContentDestinationAddress:typeof this.options.DefaultDestinationAddress==='string'?this.options.DefaultDestinationAddress:false;if(!tmpRenderDestinationAddress){this.fable.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(pRenderable," because it does not have a valid destination address."));return false;}var tmpDataAddress=typeof pTemplateDataAddress==='string'?pTemplateDataAddress:typeof tmpRenderable.RecordAddress==='string'?tmpRenderable.RecordAddress:typeof this.options.DefaultTemplateRecordAddress==='string'?this.options.DefaultTemplateRecordAddress:false;var tmpData=typeof tmpDataAddress==='string'?this.fable.DataProvider.getDataByAddress(tmpDataAddress):undefined;this.fable.parseTemplateByHash(tmpRenderable.TemplateHash,tmpData,function(pError,pContent){if(pError){_this36.fable.log.error("PictView [".concat(_this36.UUID,"]::[").concat(_this36.Hash,"] ").concat(_this36.options.ViewIdentifier," could not render ").concat(pRenderable," because it could not parse the template."),pError);return fCallback(pError);}_this36.fable.ContentAssignment.assignContent(tmpRenderDestinationAddress,pContent);return fCallback(null,pContent);});}}]);return PictView;}(libFableServiceBase);module.exports=PictView;},{"fable":39}],109:[function(require,module,exports){/**
|
|
3333
2901
|
* @author <steven@velozo.com>
|
|
3334
|
-
*/var libFable=require('fable');var
|
|
2902
|
+
*/var libFable=require('fable');var defaultPictSettings={// The main "viewport" is the view that is used to launch the entire application
|
|
3335
2903
|
MainViewportTemplateHash:'Default-Viewport',// The Element ID of where to stuff the main Viewport
|
|
3336
2904
|
ScreenDestinationElementID:'PICTViewport',// Whether or not we should automatically render the main viewport when appropriate
|
|
3337
2905
|
AutoRenderMainViewport:false,// The prefix to prepend on all template destination hashes
|
|
@@ -3371,4 +2939,4 @@ return _this38.parseTemplateSetByHash(tmpTemplateHash,pData);}else{return _this3
|
|
|
3371
2939
|
var fDataRender=function fDataRender(pHash,pData){var tmpHash=pHash.trim();var tmpValue=_this38.manifest.getValueByHash({AppData:_this38.AppData,Bundle:_this38.Bundle,Record:pData},tmpHash);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return tmpValue;};this.defaultServices.MetaTemplate.addPattern('{~D:','~}',fDataRender);this.defaultServices.MetaTemplate.addPattern('{~Data:','~}',fDataRender);this.defaultServices.MetaTemplate.addPattern('{~Dollars:','~}',function(pHash,pData){var tmpHash=pHash.trim();var tmpColumnData=_this38.manifest.getValueByHash({AppData:_this38.AppData,Bundle:_this38.Bundle,Record:pData},tmpHash);return _this38.defaultServices.DataFormat.formatterDollars(tmpColumnData);});this.defaultServices.MetaTemplate.addPattern('{~Digits:','~}',function(pHash,pData){var tmpHash=pHash.trim();var tmpColumnData=_this38.manifest.getValueByHash({AppData:_this38.AppData,Bundle:_this38.Bundle,Record:pData},tmpHash);return _this38.defaultServices.DataFormat.formatterAddCommasToNumber(_this38.defaultServices.DataFormat.formatterRoundNumber(tmpColumnData,2));});this._DefaultPictTemplatesInitialized=true;}}},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback){return this.defaultServices.MetaTemplate.parseString(pTemplateString,pData,fCallback);}},{key:"parseTemplateByHash",value:function parseTemplateByHash(pTemplateHash,pData,fCallback){var tmpTemplateString=this.defaultServices.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
3372
2940
|
if(!tmpTemplateString){return'';}return this.parseTemplate(tmpTemplateString,pData,fCallback);}},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback){var _this39=this;// TODO: This will need streaming -- for now janky old string append does the trick
|
|
3373
2941
|
var tmpValue='';if(typeof fCallback=='function'){if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){this.defaultServices.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this39.parseTemplate(pTemplateString,pRecord,function(pError,pTemplateResult){tmpValue+=pTemplateResult;return fRecordTemplateCallback();});},function(pError){return fCallback(pError,tmpValue);});}else{return fCallback(Error('Pict: Template Set: pDataSet is not an array or object.'),'');}}else{if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){if(Array.isArray(pDataSet)){for(var i=0;i<pDataSet.length;i++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[i]);}}else{var tmpKeys=Object.keys(pDataSet);for(var _i12=0;_i12<tmpKeys.length;_i12++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i12]]);}}return tmpValue;}else{return'';}}}},{key:"parseTemplateSetByHash",value:function parseTemplateSetByHash(pTemplateHash,pDataSet,fCallback){var tmpTemplateString=this.defaultServices.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
3374
|
-
if(!tmpTemplateString){return'';}return this.parseTemplateSet(tmpTemplateString,pDataSet,fCallback);}}]);return Pict;}(libFable);;module.exports=Pict;},{"./Pict-Content-Assignment.js":
|
|
2942
|
+
if(!tmpTemplateString){return'';}return this.parseTemplateSet(tmpTemplateString,pDataSet,fCallback);}}]);return Pict;}(libFable);;module.exports=Pict;},{"./Pict-Content-Assignment.js":105,"./Pict-Meadow-EntityProvider.js":106,"./Pict-Template-Provider.js":107,"./Pict-View.js":108,"fable":39}]},{},[104])(104);});
|