pict 1.0.84 → 1.0.85

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.
@@ -1,4 +1,4 @@
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(){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
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
3
  return(_setImmediate||fallback)(fn);};}).call(this);}).call(this,require("timers").setImmediate);},{"timers":105}],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
@@ -511,22 +511,23 @@ function autoConstruct(pSettings){return new FableUUID(pSettings);}module.export
511
511
  */var libFableServiceBase=require('fable-serviceproviderbase');var FableService=/*#__PURE__*/function(_libFableServiceBase$){_inherits(FableService,_libFableServiceBase$);var _super7=_createSuper(FableService);function FableService(pSettings,pServiceHash){var _this12;_classCallCheck2(this,FableService);_this12=_super7.call(this,pSettings,pServiceHash);_this12.serviceType='ServiceManager';_this12.serviceTypes=[];// A map of instantiated services
512
512
  _this12.services={};// A map of the default instantiated service by type
513
513
  _this12.defaultServices={};// A map of class constructors for services
514
- _this12.serviceClasses={};return _this12;}_createClass2(FableService,[{key:"addServiceType",value:function addServiceType(pServiceType,pServiceClass){// Add the type to the list of types
514
+ _this12.serviceClasses={};// If we need extra service initialization capabilities
515
+ _this12.extraServiceInitialization=false;return _this12;}_createClass2(FableService,[{key:"addServiceType",value:function addServiceType(pServiceType,pServiceClass){// Add the type to the list of types
515
516
  this.serviceTypes.push(pServiceType);// Add the container for instantiated services to go in
516
517
  this.services[pServiceType]={};// Using the static member of the class is a much more reliable way to check if it is a service class than instanceof
517
518
  if(typeof pServiceClass=='function'&&pServiceClass.isFableService){// Add the class to the list of classes
518
519
  this.serviceClasses[pServiceType]=pServiceClass;}else{// Add the base class to the list of classes
519
520
  this.fable.log.error("Attempted to add service type [".concat(pServiceType,"] with an invalid class. Using base service class, which will not crash but won't provide meaningful services."));this.serviceClasses[pServiceType]=libFableServiceBase;}}// This is for the services that are meant to run mostly single-instance so need a default at initialization
520
- },{key:"addAndInstantiateServiceType",value:function addAndInstantiateServiceType(pServiceType,pServiceClass){this.addServiceType(pServiceType,pServiceClass);this.instantiateServiceProvider(pServiceType,{},"".concat(pServiceType,"-Default"));}// Some servicds expect to be overloaded / customized class.
521
+ },{key:"addAndInstantiateServiceType",value:function addAndInstantiateServiceType(pServiceType,pServiceClass){this.addServiceType(pServiceType,pServiceClass);this.instantiateServiceProvider(pServiceType,{},"".concat(pServiceType,"-Default"));}// Some services expect to be overloaded / customized class.
521
522
  },{key:"instantiateServiceProviderFromPrototype",value:function instantiateServiceProviderFromPrototype(pServiceType,pOptions,pCustomServiceHash,pServicePrototype){// Instantiate the service
522
- var tmpService=new pServicePrototype(this.fable,pOptions,pCustomServiceHash);// Add the service to the service map
523
+ var tmpService=new pServicePrototype(this.fable,pOptions,pCustomServiceHash);if(this.extraServiceInitialization){tmpService=this.extraServiceInitialization(tmpService);}// Add the service to the service map
523
524
  this.services[pServiceType][tmpService.Hash]=tmpService;// If this is the first service of this type, make it the default
524
525
  if(!this.defaultServices.hasOwnProperty(pServiceType)){this.setDefaultServiceInstantiation(pServiceType,tmpService.Hash);}return tmpService;}},{key:"instantiateServiceProvider",value:function instantiateServiceProvider(pServiceType,pOptions,pCustomServiceHash){// Instantiate the service
525
526
  var tmpService=this.instantiateServiceProviderWithoutRegistration(pServiceType,pOptions,pCustomServiceHash);// Add the service to the service map
526
527
  this.services[pServiceType][tmpService.Hash]=tmpService;// If this is the first service of this type, make it the default
527
528
  if(!this.defaultServices.hasOwnProperty(pServiceType)){this.setDefaultServiceInstantiation(pServiceType,tmpService.Hash);}return tmpService;}// Create a service provider but don't register it to live forever in fable.services
528
529
  },{key:"instantiateServiceProviderWithoutRegistration",value:function instantiateServiceProviderWithoutRegistration(pServiceType,pOptions,pCustomServiceHash){// Instantiate the service
529
- var tmpService=new this.serviceClasses[pServiceType](this.fable,pOptions,pCustomServiceHash);return tmpService;}// Connect an initialized service provider that came before Fable was initialized
530
+ var tmpService=new this.serviceClasses[pServiceType](this.fable,pOptions,pCustomServiceHash);if(this.extraServiceInitialization){tmpService=this.extraServiceInitialization(tmpService);}return tmpService;}// Connect an initialized service provider that came before Fable was initialized
530
531
  },{key:"connectPreinitServiceProviderInstance",value:function connectPreinitServiceProviderInstance(pServiceInstance){var tmpServiceType=pServiceInstance.serviceType;var tmpServiceHash=pServiceInstance.Hash;// The service should already be instantiated, so just connect it to fable
531
532
  pServiceInstance.connectFable(this.fable);if(!this.services.hasOwnProperty(tmpServiceType)){// If the core service hasn't registered itself yet, create the service container for it.
532
533
  // This means you couldn't register another with this type unless it was later registered with a constructor class.
@@ -2968,19 +2969,14 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
2968
2969
  // presumably different callback function.
2969
2970
  // This makes sure that own properties are retained, so that
2970
2971
  // decorations and such are not lost along the way.
2971
- 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;}}},{}],107:[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;}},{}],108:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var defaultPictSettings={Name:'DefaultPictApplication',InitializeOnLoad:true,// The main "viewport" is the view that is used to host our application
2972
- MainViewportView:'Default-View',MainViewportRenderable:'Application-Default-View-Renderable',MainViewportDestinationAddress:'Application-Destination-Address',MainViewportDefaultDataAddress:'',// Whether or not we should automatically render the main viewport when appropriate
2973
- AutoRenderMainViewportView:false,Manifests:{},// The prefix to prepend on all template destination hashes
2974
- IdentifierAddressPrefix:'PICT-'};var PictApplication=/*#__PURE__*/function(_libFableServiceBase10){_inherits(PictApplication,_libFableServiceBase10);var _super20=_createSuper(PictApplication);function PictApplication(pFable,pOptions,pServiceHash){var _this34;_classCallCheck2(this,PictApplication);var tmpOptions=Object.assign({},defaultPictSettings,pOptions);_this34=_super20.call(this,pFable,tmpOptions,pServiceHash);_this34.serviceType='PictApplication';_this34.AppData=_this34.fable.AppData;_this34.initializationFunctionSet=[];var tmpManifestKeys=Object.keys(_this34.options.Manifests);if(tmpManifestKeys.length>0){for(var i=0;i<tmpManifestKeys.length;i++){// Load each manifest
2975
- var tmpManifestKey=tmpManifestKeys[i];_this34.fable.serviceManager.instantiateServiceProvider('Manifest',_this34.options.Manifests[tmpManifestKey],tmpManifestKey);}}if(_this34.options.InitializeOnLoad){return _possibleConstructorReturn(_this34,_this34.initialize());}if(_this34.options.AutoRenderMainViewportView){_this34.log.info("Pict Application ".concat(_this34.options.Name,"[").concat(_this34.UUID,"]::[").concat(_this34.Hash,"] beginning auto render of [").concat(_this34.options.MainViewportView,"::").concat(_this34.options.MainViewportRenderable,"]."));_this34.renderAsync(_this34.options.MainViewportView,_this34.options.MainViewportRenderable,_this34.options.MainViewportDestinationAddress,_this34.options.MainViewportDefaultDataAddress,function(){});}return _this34;}// TODO: do we need an asynchronous version of this?
2976
- _createClass2(PictApplication,[{key:"solve",value:function solve(){this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] executing solve() function..."));return true;}},{key:"internalInitialize",value:function internalInitialize(){return true;}},{key:"initialize",value:function initialize(){this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] beginning initialization..."));this.internalInitialize();this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] initialization complete."));}},{key:"render",value:function render(pViewHash,pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress){var tmpView=typeof pViewHash==='string'?this.services.PictView[pViewHash]:false;if(!tmpView){this.log.error("PictApplication [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(pViewHash," because it is not a valid view."));return false;}return tmpView.render(pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress);}},{key:"renderAsync",value:function renderAsync(pViewHash,pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress,fCallback){var tmpView=typeof pViewHash==='string'?this.services.PictView[pViewHash]:false;if(!tmpView){this.log.error("PictApplication [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(pViewHash," because it is not a valid view."));return false;}return tmpView.renderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress,fCallback);}}]);return PictApplication;}(libFableServiceBase);module.exports=PictApplication;},{"fable":39}],109:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictContentAssignment=/*#__PURE__*/function(_libFableServiceBase11){_inherits(PictContentAssignment,_libFableServiceBase11);var _super21=_createSuper(PictContentAssignment);function PictContentAssignment(pFable,pOptions,pServiceHash){var _this35;_classCallCheck2(this,PictContentAssignment);_this35=_super21.call(this,pFable,pOptions,pServiceHash);_this35.serviceType='PictContentAssignment';// Check to see if we are running in a browser
2977
- _this35.inBrowser=false;_this35.hasDocument=false;if((typeof window==="undefined"?"undefined":_typeof(window))=='object'){_this35.inBrowser=true;// Now check that the browser has a document object
2978
- if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){_this35.hasDocument=true;}}// If we're in a browser, check to see if jQuery is available.
2979
- _this35.hasJquery=false;_this35.jQuery=false;if(_this35.inBrowser&&typeof window.jQuery!=='undefined'){_this35.hasJquery=true;}// API Consumers can also craft their own assign function
2980
- _this35.customAssignFunction=false;// API Consumers can also craft their own append function
2981
- _this35.customAppendFunction=false;// API Consumers can also craft their own read function
2982
- _this35.customReadFunction=false;// API Consumers can even craft their own get element function.
2983
- _this35.customGetElementFunction=false;return _this35;}_createClass2(PictContentAssignment,[{key:"getElement",value:function getElement(pAddress){if(this.customGetElementFunction){return this.customGetElementFunction(pAddress);}else if(this.hasJquery){var tmpElements=window.jQuery(pAddress);if(tmpElements.length==0){return[];}else if(tmpElements.length==1){return[tmpElements[0]];}else{// TODO: This isn't the most efficient method, but it is the most compatible.
2972
+ 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;}}},{}],110:[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;}},{}],111:[function(require,module,exports){module.exports=require('pict-application');},{"pict-application":72}],112:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictContentAssignment=/*#__PURE__*/function(_libFableServiceBase12){_inherits(PictContentAssignment,_libFableServiceBase12);var _super22=_createSuper(PictContentAssignment);function PictContentAssignment(pFable,pOptions,pServiceHash){var _this37;_classCallCheck2(this,PictContentAssignment);_this37=_super22.call(this,pFable,pOptions,pServiceHash);_this37.serviceType='PictContentAssignment';// Check to see if we are running in a browser
2973
+ _this37.inBrowser=false;_this37.hasDocument=false;if((typeof window==="undefined"?"undefined":_typeof(window))=='object'){_this37.inBrowser=true;// Now check that the browser has a document object
2974
+ if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){_this37.hasDocument=true;}}// If we're in a browser, check to see if jQuery is available.
2975
+ _this37.hasJquery=false;_this37.jQuery=false;if(_this37.inBrowser&&typeof window.jQuery!=='undefined'){_this37.hasJquery=true;}// API Consumers can also craft their own assign function
2976
+ _this37.customAssignFunction=false;// API Consumers can also craft their own append function
2977
+ _this37.customAppendFunction=false;// API Consumers can also craft their own read function
2978
+ _this37.customReadFunction=false;// API Consumers can even craft their own get element function.
2979
+ _this37.customGetElementFunction=false;return _this37;}_createClass2(PictContentAssignment,[{key:"getElement",value:function getElement(pAddress){if(this.customGetElementFunction){return this.customGetElementFunction(pAddress);}else if(this.hasJquery){var tmpElements=window.jQuery(pAddress);if(tmpElements.length==0){return[];}else if(tmpElements.length==1){return[tmpElements[0]];}else{// TODO: This isn't the most efficient method, but it is the most compatible.
2984
2980
  var tmpElementSet=[];for(var i=0;i<tmpElements.length;i++){tmpElementSet.push(tmpElements[i]);}return tmpElementSet;}}else if(this.inBrowser&&this.hasDocument){return window.document.querySelectorAll(pAddress);}else{// Just log it out for now
2985
2981
  this.log.trace("PICT Content GET ELEMENT for [".concat(pAddress,"] will return empty because none of the browser methods are available"));return[];}}},{key:"assignContent",value:function assignContent(pAddress,pContent){if(this.customAssignFunction){return this.customAssignFunction(pAddress,pContent);}else if(this.hasJquery){// Get the element
2986
2982
  var tmpTargetElement=window.jQuery(pAddress);// Should we ensure we matched 1 and exactly 1 element?
@@ -3066,4 +3062,4 @@ var fDataRender=function fDataRender(pHash,pData){var tmpHash=pHash.trim();var t
3066
3062
  if(!tmpTemplateString){return'';}return this.parseTemplate(tmpTemplateString,pData,fCallback);}},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback){var _this45=this;// TODO: This will need streaming -- for now janky old string append does the trick
3067
3063
  var tmpValue='';if(typeof fCallback=='function'){if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){this.defaultServices.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this45.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 _i13=0;_i13<tmpKeys.length;_i13++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i13]]);}}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
3068
3064
  if(!tmpTemplateString){return'';}return this.parseTemplateSet(tmpTemplateString,pDataSet,fCallback);}}]);return Pict;}(libFable);;module.exports=Pict;module.exports.PictApplicationClass=require('./Pict-Application.js');module.exports.PictViewClass=require('./Pict-View.js');// This is to help understand the type of enivironement we're executing in
3069
- module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");},{"./Pict-Application.js":108,"./Pict-Content-Assignment.js":109,"./Pict-DataProvider.js":110,"./Pict-Meadow-EntityProvider.js":111,"./Pict-Template-Provider.js":112,"./Pict-View.js":113,"fable":39}]},{},[114]);
3065
+ module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");},{"./Pict-Application.js":111,"./Pict-Content-Assignment.js":112,"./Pict-DataProvider.js":113,"./Pict-Meadow-EntityProvider.js":114,"./Pict-Template-Provider.js":115,"./Pict-View.js":116,"fable":40}]},{},[117])(117);});