pict 1.0.126 → 1.0.128

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.
@@ -766,7 +766,9 @@ _this13.UUID=new libFableUUID(_this13.SettingsManager.settings);// Instantiate t
766
766
  _this13.Logging=new libFableLog(_this13.SettingsManager.settings);_this13.Logging.initialize();// Initialization Phase 1.5: Instantiate the service manager
767
767
  // This is the start actual bootstrapping point for fable.
768
768
  // For consistency fable is treated as a service.
769
- _this13.ServiceManager=_assertThisInitialized(_this13);_this13.connectFable(_assertThisInitialized(_this13));// --> Bootstrapping of fable into the Service Manager is complete
769
+ _this13.ServiceManager=_assertThisInitialized(_this13);// TODO: Remove this when Orator and meadow-endpoints are shifted to this new pattern
770
+ _this13.serviceManager=_assertThisInitialized(_this13);// END TODO
771
+ _this13.connectFable(_assertThisInitialized(_this13));// --> Bootstrapping of fable into the Service Manager is complete
770
772
  // Initialization Phase 2: Map in the default services.
771
773
  // They will then be available in the Default service provider set as well.
772
774
  _this13.connectPreinitServiceProviderInstance(_this13.UUID);_this13.connectPreinitServiceProviderInstance(_this13.Logging);_this13.connectPreinitServiceProviderInstance(_this13.SettingsManager);// Initialize and instantiate the default baked-in Data Arithmatic service
@@ -2109,8 +2111,8 @@ this.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpData,tmpContent)
2109
2111
  this.onBeforeRender(tmpRenderable,tmpRenderDestinationAddress,tmpData);// Render the template (asynchronously)
2110
2112
  this.pict.parseTemplateByHash(tmpRenderable.TemplateHash,tmpData,function(pError,pContent){if(pError){_this45.log.error("PictView [".concat(_this45.UUID,"]::[").concat(_this45.Hash,"] ").concat(_this45.options.ViewIdentifier," could not render (asynchronously) ").concat(tmpRenderableHash," (param ").concat(pRenderable,") because it did not parse the template."),pError);return fCallback(pError);}// Assign the content to the destination address
2111
2113
  switch(tmpRenderable.RenderMethod){case'append':_this45.pict.ContentAssignment.appendContent(tmpRenderDestinationAddress,pContent);break;case'prepend':_this45.pict.ContentAssignment.prependContent(tmpRenderDestinationAddress,pContent);break;case'append_once':// Try to find the content in the destination address
2112
- var tmpExistingContent=_this45.pict.ContentAssignment.getElement("#".concat(tmpRenderableHash));if(tmpExistingContent.length<1){_this45.pict.ContentAssignment.appendContent(tmpRenderDestinationAddress,pContent);}case'replace':default:_this45.pict.ContentAssignment.assignContent(tmpRenderDestinationAddress,pContent);break;}// Execute the developer-overridable post-render behavior
2113
- _this45.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpData,pContent);_this45.lastRenderedTimestamp=_this45.pict.log.getTimeStamp();return fCallback(null,pContent);});}},{key:"onAfterRender",value:function onAfterRender(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRender:"));}return true;}},{key:"onAfterRenderAsync",value:function onAfterRenderAsync(fCallback){this.onAfterRender();return fCallback();}/* -------------------------------------------------------------------------- */ /* Code Section: Solver */ /* -------------------------------------------------------------------------- */},{key:"onBeforeSolve",value:function onBeforeSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeSolve:"));}return true;}},{key:"onBeforeSolveAsync",value:function onBeforeSolveAsync(fCallback){this.onBeforeSolve();return fCallback();}},{key:"onSolve",value:function onSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onSolve:"));}return true;}},{key:"onSolveAsync",value:function onSolveAsync(fCallback){this.onSolve();return fCallback();}},{key:"solve",value:function solve(){if(this.pict.LogNoisiness>2){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function..."));}this.onBeforeSolve();this.onSolve();this.onAfterSolve();this.lastSolvedTimestamp=this.pict.log.getTimeStamp();return true;}},{key:"solveAsync",value:function solveAsync(fCallback){var _this46=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');tmpAnticipate.anticipate(this.onBeforeSolveAsync.bind(this));tmpAnticipate.anticipate(this.onSolveAsync.bind(this));tmpAnticipate.anticipate(this.onAfterSolveAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this46.pict.LogNoisiness>2){_this46.log.trace("PictView [".concat(_this46.UUID,"]::[").concat(_this46.Hash,"] ").concat(_this46.options.ViewIdentifier," solveAsync() complete."));}_this46.lastSolvedTimestamp=_this46.pict.log.getTimeStamp();return fCallback(pError);});}},{key:"onAfterSolve",value:function onAfterSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterSolve:"));}return true;}},{key:"onAfterSolveAsync",value:function onAfterSolveAsync(fCallback){this.onAfterSolve();return fCallback();}/* -------------------------------------------------------------------------- */ /* Code Section: Marshal From View */ /* -------------------------------------------------------------------------- */},{key:"onBeforeMarshalFromView",value:function onBeforeMarshalFromView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeMarshalFromView:"));}return true;}},{key:"onBeforeMarshalFromViewAsync",value:function onBeforeMarshalFromViewAsync(fCallback){this.onBeforeMarshalFromView();return fCallback();}},{key:"onMarshalFromView",value:function onMarshalFromView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onMarshalFromView:"));}return true;}},{key:"onMarshalFromViewAsync",value:function onMarshalFromViewAsync(fCallback){this.onMarshalFromView();return fCallback();}},{key:"marshalFromView",value:function marshalFromView(){if(this.pict.LogNoisiness>2){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function..."));}this.onBeforeMarshalFromView();this.onMarshalFromView();this.onAfterMarshalFromView();this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp();return true;}},{key:"marshalFromViewAsync",value:function marshalFromViewAsync(fCallback){var _this47=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');tmpAnticipate.anticipate(this.onBeforeMarshalFromViewAsync.bind(this));tmpAnticipate.anticipate(this.onMarshalFromViewAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalFromViewAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this47.pict.LogNoisiness>2){_this47.log.trace("PictView [".concat(_this47.UUID,"]::[").concat(_this47.Hash,"] ").concat(_this47.options.ViewIdentifier," solveAsync() complete."));}_this47.lastMarshalFromViewTimestamp=_this47.pict.log.getTimeStamp();return fCallback(pError);});}},{key:"onAfterMarshalFromView",value:function onAfterMarshalFromView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalFromView:"));}return true;}},{key:"onAfterMarshalFromViewAsync",value:function onAfterMarshalFromViewAsync(fCallback){this.onAfterMarshalFromView();return fCallback();}/* -------------------------------------------------------------------------- */ /* Code Section: Marshal To View */ /* -------------------------------------------------------------------------- */},{key:"onBeforeMarshalToView",value:function onBeforeMarshalToView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeMarshalToView:"));}return true;}},{key:"onBeforeMarshalToViewAsync",value:function onBeforeMarshalToViewAsync(fCallback){this.onBeforeMarshalToView();return fCallback();}},{key:"onMarshalToView",value:function onMarshalToView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onMarshalToView:"));}return true;}},{key:"onMarshalToViewAsync",value:function onMarshalToViewAsync(fCallback){this.onMarshalToView();return fCallback();}},{key:"marshalToView",value:function marshalToView(){if(this.pict.LogNoisiness>2){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function..."));}this.onBeforeMarshalToView();this.onMarshalToView();this.onAfterMarshalToView();this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp();return true;}},{key:"marshalToViewAsync",value:function marshalToViewAsync(fCallback){var _this48=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');tmpAnticipate.anticipate(this.onBeforeMarshalToViewAsync.bind(this));tmpAnticipate.anticipate(this.onMarshalToViewAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalToViewAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this48.pict.LogNoisiness>2){_this48.log.trace("PictView [".concat(_this48.UUID,"]::[").concat(_this48.Hash,"] ").concat(_this48.options.ViewIdentifier," solveAsync() complete."));}_this48.lastMarshalToViewTimestamp=_this48.pict.log.getTimeStamp();return fCallback(pError);});}},{key:"onAfterMarshalToView",value:function onAfterMarshalToView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalToView:"));}return true;}},{key:"onAfterMarshalToViewAsync",value:function onAfterMarshalToViewAsync(fCallback){this.onAfterMarshalToView();return fCallback();}}]);return PictView;}(libFableServiceBase);module.exports=PictView;},{"fable-serviceproviderbase":43}],92:[function(require,module,exports){/**
2114
+ var tmpExistingContent=_this45.pict.ContentAssignment.getElement("#".concat(tmpRenderableHash));if(tmpExistingContent.length<1){_this45.pict.ContentAssignment.appendContent(tmpRenderDestinationAddress,pContent);}case'replace':default:_this45.pict.ContentAssignment.assignContent(tmpRenderDestinationAddress,pContent);break;}// Execute the developer-overridable asynchronous post-render behavior
2115
+ _this45.lastRenderedTimestamp=_this45.pict.log.getTimeStamp();return _this45.onAfterRenderAsync(fCallback,pContent);});}},{key:"onAfterRender",value:function onAfterRender(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRender:"));}return true;}},{key:"onAfterRenderAsync",value:function onAfterRenderAsync(fCallback){this.onAfterRender();return fCallback();}/* -------------------------------------------------------------------------- */ /* Code Section: Solver */ /* -------------------------------------------------------------------------- */},{key:"onBeforeSolve",value:function onBeforeSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeSolve:"));}return true;}},{key:"onBeforeSolveAsync",value:function onBeforeSolveAsync(fCallback){this.onBeforeSolve();return fCallback();}},{key:"onSolve",value:function onSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onSolve:"));}return true;}},{key:"onSolveAsync",value:function onSolveAsync(fCallback){this.onSolve();return fCallback();}},{key:"solve",value:function solve(){if(this.pict.LogNoisiness>2){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function..."));}this.onBeforeSolve();this.onSolve();this.onAfterSolve();this.lastSolvedTimestamp=this.pict.log.getTimeStamp();return true;}},{key:"solveAsync",value:function solveAsync(fCallback){var _this46=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');tmpAnticipate.anticipate(this.onBeforeSolveAsync.bind(this));tmpAnticipate.anticipate(this.onSolveAsync.bind(this));tmpAnticipate.anticipate(this.onAfterSolveAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this46.pict.LogNoisiness>2){_this46.log.trace("PictView [".concat(_this46.UUID,"]::[").concat(_this46.Hash,"] ").concat(_this46.options.ViewIdentifier," solveAsync() complete."));}_this46.lastSolvedTimestamp=_this46.pict.log.getTimeStamp();return fCallback(pError);});}},{key:"onAfterSolve",value:function onAfterSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterSolve:"));}return true;}},{key:"onAfterSolveAsync",value:function onAfterSolveAsync(fCallback){this.onAfterSolve();return fCallback();}/* -------------------------------------------------------------------------- */ /* Code Section: Marshal From View */ /* -------------------------------------------------------------------------- */},{key:"onBeforeMarshalFromView",value:function onBeforeMarshalFromView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeMarshalFromView:"));}return true;}},{key:"onBeforeMarshalFromViewAsync",value:function onBeforeMarshalFromViewAsync(fCallback){this.onBeforeMarshalFromView();return fCallback();}},{key:"onMarshalFromView",value:function onMarshalFromView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onMarshalFromView:"));}return true;}},{key:"onMarshalFromViewAsync",value:function onMarshalFromViewAsync(fCallback){this.onMarshalFromView();return fCallback();}},{key:"marshalFromView",value:function marshalFromView(){if(this.pict.LogNoisiness>2){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function..."));}this.onBeforeMarshalFromView();this.onMarshalFromView();this.onAfterMarshalFromView();this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp();return true;}},{key:"marshalFromViewAsync",value:function marshalFromViewAsync(fCallback){var _this47=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');tmpAnticipate.anticipate(this.onBeforeMarshalFromViewAsync.bind(this));tmpAnticipate.anticipate(this.onMarshalFromViewAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalFromViewAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this47.pict.LogNoisiness>2){_this47.log.trace("PictView [".concat(_this47.UUID,"]::[").concat(_this47.Hash,"] ").concat(_this47.options.ViewIdentifier," solveAsync() complete."));}_this47.lastMarshalFromViewTimestamp=_this47.pict.log.getTimeStamp();return fCallback(pError);});}},{key:"onAfterMarshalFromView",value:function onAfterMarshalFromView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalFromView:"));}return true;}},{key:"onAfterMarshalFromViewAsync",value:function onAfterMarshalFromViewAsync(fCallback){this.onAfterMarshalFromView();return fCallback();}/* -------------------------------------------------------------------------- */ /* Code Section: Marshal To View */ /* -------------------------------------------------------------------------- */},{key:"onBeforeMarshalToView",value:function onBeforeMarshalToView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeMarshalToView:"));}return true;}},{key:"onBeforeMarshalToViewAsync",value:function onBeforeMarshalToViewAsync(fCallback){this.onBeforeMarshalToView();return fCallback();}},{key:"onMarshalToView",value:function onMarshalToView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onMarshalToView:"));}return true;}},{key:"onMarshalToViewAsync",value:function onMarshalToViewAsync(fCallback){this.onMarshalToView();return fCallback();}},{key:"marshalToView",value:function marshalToView(){if(this.pict.LogNoisiness>2){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function..."));}this.onBeforeMarshalToView();this.onMarshalToView();this.onAfterMarshalToView();this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp();return true;}},{key:"marshalToViewAsync",value:function marshalToViewAsync(fCallback){var _this48=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');tmpAnticipate.anticipate(this.onBeforeMarshalToViewAsync.bind(this));tmpAnticipate.anticipate(this.onMarshalToViewAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalToViewAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this48.pict.LogNoisiness>2){_this48.log.trace("PictView [".concat(_this48.UUID,"]::[").concat(_this48.Hash,"] ").concat(_this48.options.ViewIdentifier," solveAsync() complete."));}_this48.lastMarshalToViewTimestamp=_this48.pict.log.getTimeStamp();return fCallback(pError);});}},{key:"onAfterMarshalToView",value:function onAfterMarshalToView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalToView:"));}return true;}},{key:"onAfterMarshalToViewAsync",value:function onAfterMarshalToViewAsync(fCallback){this.onAfterMarshalToView();return fCallback();}}]);return PictView;}(libFableServiceBase);module.exports=PictView;},{"fable-serviceproviderbase":43}],92:[function(require,module,exports){/**
2114
2116
  * Precedent Meta-Templating
2115
2117
  *
2116
2118
  * @license MIT
@@ -3439,21 +3441,22 @@ this.log.trace("PICT Content READ from [".concat(pAddress,"]..."));return'';}}},
3439
3441
  var tmpTargetElement=window.jQuery(pAddress);tmpTargetElement.addClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=window.document.querySelectorAll(pAddress);for(var i=0;i<tmpTargetElementSet.length;i++){tmpTargetElementSet[i].classList.add(pClass);}}else{this.log.trace("PICT Content ADDCLASS to [".concat(pAddress,"]:"),pClass);}}},{key:"removeClass",value:function removeClass(pAddress,pClass){if(this.customRemoveClassFunction){return this.customRemoveClassFunction(pAddress,pClass);}else if(this.hasJquery){// Get the element
3440
3442
  var tmpTargetElement=window.jQuery(pAddress);tmpTargetElement.removeClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=window.document.querySelectorAll(pAddress);for(var i=0;i<tmpTargetElementSet.length;i++){tmpTargetElementSet[i].classList.remove(pClass);}}else{this.log.trace("PICT Content REMOVECLASS from [".concat(pAddress,"]:"),pClass);}}},{key:"toggleClass",value:function toggleClass(pAddress,pClass){// STUB
3441
3443
  }},{key:"hasClass",value:function hasClass(pAddress,pClass){// STUB
3442
- }}]);return PictContentAssignment;}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":49}],136:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase14){_inherits(PictDataProvider,_libFableServiceBase14);var _super26=_createSuper(PictDataProvider);function PictDataProvider(pFable,pOptions,pServiceHash){var _this52;_classCallCheck2(this,PictDataProvider);_this52=_super26.call(this,pFable,pOptions,pServiceHash);_this52.serviceType='PictDataProvider';return _this52;}_createClass2(PictDataProvider,[{key:"getDataByAddress",value:function getDataByAddress(pAddress,pData){var tmpData=typeof pData==='undefined'?{}:pData;return this.fable.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:tmpData},pAddress);}}]);return PictDataProvider;}(libFableServiceBase);module.exports=PictDataProvider;},{"fable":49}],137:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase15){_inherits(PictMeadowEntityProvider,_libFableServiceBase15);var _super27=_createSuper(PictMeadowEntityProvider);function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this53;_classCallCheck2(this,PictMeadowEntityProvider);_this53=_super27.call(this,pFable,pOptions,pServiceHash);_defineProperty2(_assertThisInitialized(_this53),"getEntitySet",function(pEntity,pMeadowFilterExpression,fCallback){var _this54=this;this.initializeCache(pEntity);// TODO: Should we test for too many record IDs here by string length?
3443
- // FBL~ID${pDestinationEntity}~INN~${tmpIDRecordsCommaSeparated}
3444
- // Discard anything from the cache that has expired or is over size.
3445
- this.cache[pEntity].prune(function(){var tmpCountOptions={url:"".concat(_this54.options.urlPrefix).concat(pEntity,"s/Count/FilteredTo/").concat(pMeadowFilterExpression)};tmpCountOptions=_this54.prepareRequestOptions(tmpCountOptions);return _this54.restClient.getJSON(tmpCountOptions,function(pError,pResponse,pBody){if(pError){_this54.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=_this54.options.downloadBatchSize;for(var i=0;i<tmpRecordCount/tmpDownloadBatchSize;i++){// Generate each of the URI fragments to download
3446
- tmpDownloadURIFragments.push("".concat(_this54.options.urlPrefix).concat(pEntity,"s/FilteredTo/").concat(pMeadowFilterExpression,"/").concat(i*tmpDownloadBatchSize,"/").concat(tmpDownloadBatchSize));}var tmpEntitySet=[];// Now run these in series (it's possible to parallelize but no reason to)
3447
- _this54.fable.Utility.eachLimit(tmpDownloadURIFragments,1,function(pURIFragment,fDownloadCallback){var tmpOptions={url:"".concat(_this54.options.urlPrefix).concat(pURIFragment)};tmpOptions=_this54.prepareRequestOptions(tmpOptions);_this54.restClient.getJSON(pURIFragment,function(pDownloadError,pDownloadResponse,pDownloadBody){tmpEntitySet=tmpEntitySet.concat(pDownloadBody);// Should we be caching each record?
3448
- return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){return fCallback(pFullDownloadError,tmpEntitySet);});});});});_this53.serviceType='PictMeadowProvider';if(_this53.fable.settings.PictDefaultURLPrefix){_this53.options.urlPrefix=_this53.fable.settings.PictDefaultURLPrefix;}else if(!_this53.options.urlPrefix){_this53.options.urlPrefix='/1.0/';}if(_this53.fable.settings.PictDefaultDownloadBatchSize){_this53.options.downloadBatchSize=_this53.fable.settings.PictDefaultDownloadBatchSize;}else if(!_this53.options.downloadBatchSize){_this53.options.downloadBatchSize=100;}_this53.restClient=_this53.fable.instantiateServiceProviderWithoutRegistration('RestClient');_this53.cache={};_this53.prepareRequestOptions=function(pOptions){return pOptions;};return _this53;}_createClass2(PictMeadowEntityProvider,[{key:"initializeCache",value:function initializeCache(pEntity){// This should not be happening as often as it's happening.
3444
+ }}]);return PictContentAssignment;}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":49}],136:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase14){_inherits(PictDataProvider,_libFableServiceBase14);var _super26=_createSuper(PictDataProvider);function PictDataProvider(pFable,pOptions,pServiceHash){var _this52;_classCallCheck2(this,PictDataProvider);_this52=_super26.call(this,pFable,pOptions,pServiceHash);_this52.serviceType='PictDataProvider';return _this52;}_createClass2(PictDataProvider,[{key:"getDataByAddress",value:function getDataByAddress(pAddress,pData){var tmpData=typeof pData==='undefined'?{}:pData;return this.fable.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:tmpData},pAddress);}}]);return PictDataProvider;}(libFableServiceBase);module.exports=PictDataProvider;},{"fable":49}],137:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase15){_inherits(PictMeadowEntityProvider,_libFableServiceBase15);var _super27=_createSuper(PictMeadowEntityProvider);function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this53;_classCallCheck2(this,PictMeadowEntityProvider);_this53=_super27.call(this,pFable,pOptions,pServiceHash);_this53.serviceType='PictMeadowProvider';if(_this53.fable.settings.PictDefaultURLPrefix){_this53.options.urlPrefix=_this53.fable.settings.PictDefaultURLPrefix;}else if(!_this53.options.urlPrefix){_this53.options.urlPrefix='/1.0/';}if(_this53.fable.settings.PictDefaultDownloadBatchSize){_this53.options.downloadBatchSize=_this53.fable.settings.PictDefaultDownloadBatchSize;}else if(!_this53.options.downloadBatchSize){_this53.options.downloadBatchSize=100;}_this53.restClient=_this53.fable.instantiateServiceProviderWithoutRegistration('RestClient');_this53.cache={};_this53.prepareRequestOptions=function(pOptions){return pOptions;};return _this53;}_createClass2(PictMeadowEntityProvider,[{key:"initializeCache",value:function initializeCache(pEntity){// This should not be happening as often as it's happening.
3449
3445
  if(!this.cache.hasOwnProperty(pEntity)){this.cache[pEntity]=this.fable.instantiateServiceProviderWithoutRegistration('ObjectCache');// TODO: Make this a configuration?
3450
3446
  // For now cache for 30 seconds.
3451
- 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 _this55=this;this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
3452
- this.cache[pEntity].prune(function(){var tmpPossibleRecord=_this55.cache[pEntity].read(pIDRecord);if(tmpPossibleRecord){return tmpPossibleRecord;}var tmpOptions={url:"".concat(_this55.options.urlPrefix).concat(pEntity,"/").concat(pIDRecord)};tmpOptions=_this55.prepareRequestOptions(tmpOptions);return _this55.restClient.getJSON(tmpOptions,function(pError,pResponse,pBody){if(pBody){_this55.cache[pEntity].put(pBody,pIDRecord);}return fCallback(pError,pBody);});});}}]);return PictMeadowEntityProvider;}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":49}],138:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(_libFableServiceBase16){_inherits(PictTemplateProvider,_libFableServiceBase16);var _super28=_createSuper(PictTemplateProvider);function PictTemplateProvider(pFable,pOptions,pServiceHash){var _this56;_classCallCheck2(this,PictTemplateProvider);_this56=_super28.call(this,pFable,pOptions,pServiceHash);_this56.serviceType='PictTemplateProvider';_this56.templates={};_this56.templateSources={};// Default templates are stored by prefix.
3447
+ 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 _this54=this;this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
3448
+ this.cache[pEntity].prune(function(){var tmpPossibleRecord=_this54.cache[pEntity].read(pIDRecord);if(tmpPossibleRecord){return tmpPossibleRecord;}var tmpOptions={url:"".concat(_this54.options.urlPrefix).concat(pEntity,"/").concat(pIDRecord)};tmpOptions=_this54.prepareRequestOptions(tmpOptions);return _this54.restClient.getJSON(tmpOptions,function(pError,pResponse,pBody){if(pBody){_this54.cache[pEntity].put(pBody,pIDRecord);}return fCallback(pError,pBody);});});}},{key:"getEntitySetPage",value:function getEntitySetPage(pEntity,pMeadowFilterExpression,pRecordStartCursor,pRecordCount,fCallback){var tmpURL="".concat(this.options.urlPrefix).concat(pEntity,"s/FilteredTo/").concat(pMeadowFilterExpression,"/").concat(pRecordStartCursor,"/").concat(pRecordCount);return this.restClient.getJSON(tmpURL,function(pDownloadError,pDownloadResponse,pDownloadBody){return fCallback(pDownloadError,pDownloadBody);});}},{key:"getEntitySetRecordCount",value:function getEntitySetRecordCount(pEntity,pMeadowFilterExpression,fCallback){var _this55=this;var tmpURL="".concat(this.options.urlPrefix).concat(pEntity,"s/Count/FilteredTo/").concat(pMeadowFilterExpression);return this.restClient.getJSON(tmpURL,function(pError,pResponse,pBody){if(pError){_this55.log.error("Error getting entity count of [".concat(pEntity,"] filtered to [").concat(pMeadowFilterExpression,"] from url [").concat(tmpURL,"]: ").concat(pError));return fCallback(pError);}var tmpRecordCount=0;if(pBody.Count){tmpRecordCount=pBody.Count;}return fCallback(pError,tmpRecordCount);});}},{key:"getEntitySet",value:function getEntitySet(pEntity,pMeadowFilterExpression,fCallback){var _this56=this;// TODO: Should we test for too many record IDs here by string length in pMeadowFilterExpression?
3449
+ // FBL~ID${pDestinationEntity}~INN~${tmpIDRecordsCommaSeparated}
3450
+ // If the list is mega-long we can parse it and break it into chunks.
3451
+ this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
3452
+ this.cache[pEntity].prune(function(){return _this56.getEntitySetRecordCount(pEntity,pMeadowFilterExpression,function(pRecordCountError,pRecordCount){if(pRecordCountError){return fCallback(pRecordCountError);}var tmpRecordCount=pRecordCount;if(isNaN(pRecordCount)){_this56.log.error("Entity count did not return a number for [".concat(pEntity,"] filtered to [").concat(pMeadowFilterExpression,"]... something is fatally wrong from the server accessed in getEntitySet call."));return fCallback(new Error('Entity count did not return a number in getEntitySet.'));}var tmpDownloadURIFragments=[];var tmpDownloadBatchSize=_this56.options.downloadBatchSize;for(var i=0;i<tmpRecordCount/tmpDownloadBatchSize;i++){// Generate each of the URI fragments to download
3453
+ tmpDownloadURIFragments.push("".concat(_this56.options.urlPrefix).concat(pEntity,"s/FilteredTo/").concat(pMeadowFilterExpression,"/").concat(i*tmpDownloadBatchSize,"/").concat(tmpDownloadBatchSize));}var tmpEntitySet=[];// Now run these in series (it's possible to parallelize the requests but they would not be in server order)
3454
+ _this56.fable.Utility.eachLimit(tmpDownloadURIFragments,1,function(pURIFragment,fDownloadCallback){_this56.restClient.getJSON(pURIFragment,function(pDownloadError,pDownloadResponse,pDownloadBody){tmpEntitySet=tmpEntitySet.concat(pDownloadBody);// Should we be caching each record?
3455
+ return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){return fCallback(pFullDownloadError,tmpEntitySet);});});});}}]);return PictMeadowEntityProvider;}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":49}],138:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(_libFableServiceBase16){_inherits(PictTemplateProvider,_libFableServiceBase16);var _super28=_createSuper(PictTemplateProvider);function PictTemplateProvider(pFable,pOptions,pServiceHash){var _this57;_classCallCheck2(this,PictTemplateProvider);_this57=_super28.call(this,pFable,pOptions,pServiceHash);_this57.serviceType='PictTemplateProvider';_this57.templates={};_this57.templateSources={};// Default templates are stored by prefix.
3453
3456
  // The longest prefix match is used.
3454
3457
  // Case sensitive.
3455
- _this56.defaultTemplates=[];// This function can be overloaded to load templates from a database, in a page or other source.
3456
- _this56.loadTemplateFunction=function(pTemplateHash){return false;};return _this56;}_createClass2(PictTemplateProvider,[{key:"addTemplate",value:function addTemplate(pTemplateHash,pTemplate,pTemplateSource){this.templates[pTemplateHash]=pTemplate;if(typeof pTemplateSource=='string'){this.templateSources[pTemplateHash]=pTemplateSource;}else{this.templateSources[pTemplateHash]="Direct addTemplate('".concat(pTemplateHash,"') function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]");}}},{key:"addDefaultTemplate",value:function addDefaultTemplate(pPrefix,pPostfix,pTemplate,pSource){var tmpSource=typeof pSource=='string'?pSource:"Direct addDefaultTemplate('".concat(pPrefix,"','").concat(pPostfix,"',..) function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]");var tmpDefaultTemplate={prefix:pPrefix,postfix:pPostfix,template:pTemplate,source:tmpSource};if(typeof pTemplate!='string'){this.log.error('PictTemplateProvider.addDefaultTemplate: pTemplate is not a string.');}this.defaultTemplates.push(tmpDefaultTemplate);}},{key:"checkDefaultTemplateHash",value:function checkDefaultTemplateHash(pTemplateHash){/*
3458
+ _this57.defaultTemplates=[];// This function can be overloaded to load templates from a database, in a page or other source.
3459
+ _this57.loadTemplateFunction=function(pTemplateHash){return false;};return _this57;}_createClass2(PictTemplateProvider,[{key:"addTemplate",value:function addTemplate(pTemplateHash,pTemplate,pTemplateSource){this.templates[pTemplateHash]=pTemplate;if(typeof pTemplateSource=='string'){this.templateSources[pTemplateHash]=pTemplateSource;}else{this.templateSources[pTemplateHash]="Direct addTemplate('".concat(pTemplateHash,"') function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]");}}},{key:"addDefaultTemplate",value:function addDefaultTemplate(pPrefix,pPostfix,pTemplate,pSource){var tmpSource=typeof pSource=='string'?pSource:"Direct addDefaultTemplate('".concat(pPrefix,"','").concat(pPostfix,"',..) function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]");var tmpDefaultTemplate={prefix:pPrefix,postfix:pPostfix,template:pTemplate,source:tmpSource};if(typeof pTemplate!='string'){this.log.error('PictTemplateProvider.addDefaultTemplate: pTemplate is not a string.');}this.defaultTemplates.push(tmpDefaultTemplate);}},{key:"checkDefaultTemplateHash",value:function checkDefaultTemplateHash(pTemplateHash){/*
3457
3460
  * Default templates are managed by postfix and prefix. The use case is things like titles, headers, list
3458
3461
  * wrappers, rows, etc.
3459
3462
  *
@@ -3467,11 +3470,11 @@ _this56.loadTemplateFunction=function(pTemplateHash){return false;};return _this
3467
3470
  if(!this.templates.hasOwnProperty(pTemplateHash)){this.loadTemplate(pTemplateHash);}// If the loading function fails, try to load it from the default templates
3468
3471
  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":49}],139:[function(require,module,exports){/**
3469
3472
  * @author <steven@velozo.com>
3470
- */var libFable=require('fable');var Pict=/*#__PURE__*/function(_libFable){_inherits(Pict,_libFable);var _super29=_createSuper(Pict);function Pict(pSettings){var _this57;_classCallCheck2(this,Pict);_this57=_super29.call(this,pSettings);_this57.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");// The templateProvider provides a basic key->template mapping with default fallback capabilities
3471
- _this57.addAndInstantiateServiceType('TemplateProvider',require('./Pict-Template-Provider.js'));_this57.addAndInstantiateServiceType('EntityProvider',require('./Pict-Meadow-EntityProvider.js'));_this57.addAndInstantiateServiceType('DataProvider',require('./Pict-DataProvider.js'));_this57.addAndInstantiateServiceType('ContentAssignment',require('./Pict-Content-Assignment.js'));_this57.addAndInstantiateServiceType('CSSMap',require('./Pict-CSS.js'));_this57.instantiateServiceProvider('MetaTemplate');_this57.instantiateServiceProvider('DataGeneration');_this57.manifest=_this57.instantiateServiceProvider('Manifest');_this57.AppData={};_this57.Bundle={};// Log noisness goes from 0 - 5, where 5 is show me everything.
3472
- _this57.LogNoisiness=0;// Load manifest sets
3473
- if(_this57.settings.Manifests){_this57.loadManifestSet(_this57.settings.Manifests);}_this57._DefaultPictTemplatesInitialized=false;_this57.initializePictTemplateEngine();_this57.addServiceType('PictView',require('pict-view'));_this57.addServiceType('PictApplication',require('pict-application'));// Expose the named views directly, through a convenience accessor
3474
- _this57.views=_this57.servicesMap.PictView;return _this57;}// Load manifests in as Hashed services
3473
+ */var libFable=require('fable');var Pict=/*#__PURE__*/function(_libFable){_inherits(Pict,_libFable);var _super29=_createSuper(Pict);function Pict(pSettings){var _this58;_classCallCheck2(this,Pict);_this58=_super29.call(this,pSettings);_this58.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");// The templateProvider provides a basic key->template mapping with default fallback capabilities
3474
+ _this58.addAndInstantiateServiceType('TemplateProvider',require('./Pict-Template-Provider.js'));_this58.addAndInstantiateServiceType('EntityProvider',require('./Pict-Meadow-EntityProvider.js'));_this58.addAndInstantiateServiceType('DataProvider',require('./Pict-DataProvider.js'));_this58.addAndInstantiateServiceType('ContentAssignment',require('./Pict-Content-Assignment.js'));_this58.addAndInstantiateServiceType('CSSMap',require('./Pict-CSS.js'));_this58.instantiateServiceProvider('MetaTemplate');_this58.instantiateServiceProvider('DataGeneration');_this58.manifest=_this58.instantiateServiceProvider('Manifest');_this58.AppData={};_this58.Bundle={};// Log noisness goes from 0 - 5, where 5 is show me everything.
3475
+ _this58.LogNoisiness=0;// Load manifest sets
3476
+ if(_this58.settings.Manifests){_this58.loadManifestSet(_this58.settings.Manifests);}_this58._DefaultPictTemplatesInitialized=false;_this58.initializePictTemplateEngine();_this58.addServiceType('PictView',require('pict-view'));_this58.addServiceType('PictApplication',require('pict-application'));// Expose the named views directly, through a convenience accessor
3477
+ _this58.views=_this58.servicesMap.PictView;return _this58;}// Load manifests in as Hashed services
3475
3478
  _createClass2(Pict,[{key:"loadManifestSet",value:function loadManifestSet(pManifestSet){if(_typeof(pManifestSet)!='object'){this.log.warn("PICT [".concat(this.UUID,"] could not load Manifest Set; pManifestSet was not an object."));return false;}var tmpManifestKeys=Object.keys(pManifestSet);if(tmpManifestKeys.length>0){for(var i=0;i<tmpManifestKeys.length;i++){// Load each manifest
3476
3479
  var tmpManifestKey=tmpManifestKeys[i];this.instantiateServiceProvider('Manifest',pManifestSet[tmpManifestKey],tmpManifestKey);}}}// Just passing an options will construct one for us.
3477
3480
  // Passing a hash will set the hash.
@@ -3481,7 +3484,7 @@ if(pViewPrototype.hasOwnProperty('default_configuration')){tmpOptions=this.fable
3481
3484
  // Passing a hash will set the hash.
3482
3485
  // Passing a prototype will use that!
3483
3486
  },{key:"addApplication",value:function addApplication(pApplicationHash,pOptions,pApplicationPrototype){var tmpOptions=_typeof(pOptions)=='object'?pOptions:{};var tmpApplicationHash=typeof pApplicationHash=='string'?pApplicationHash:this.fable.getUUID();if(typeof pApplicationPrototype!='undefined'){// If the prototype has a default_configuration, it will be merged with options.
3484
- if(pApplicationPrototype.hasOwnProperty('default_configuration')){tmpOptions=this.fable.Utility.extend({},pApplicationPrototype.default_configuration,tmpOptions);}return this.instantiateServiceProviderFromPrototype('PictApplication',tmpOptions,tmpApplicationHash,pApplicationPrototype);}else{return this.instantiateServiceProvider('PictApplication',tmpOptions,tmpApplicationHash);}}},{key:"initializePictTemplateEngine",value:function initializePictTemplateEngine(){var _this58=this;/*
3487
+ if(pApplicationPrototype.hasOwnProperty('default_configuration')){tmpOptions=this.fable.Utility.extend({},pApplicationPrototype.default_configuration,tmpOptions);}return this.instantiateServiceProviderFromPrototype('PictApplication',tmpOptions,tmpApplicationHash,pApplicationPrototype);}else{return this.instantiateServiceProvider('PictApplication',tmpOptions,tmpApplicationHash);}}},{key:"initializePictTemplateEngine",value:function initializePictTemplateEngine(){var _this59=this;/*
3485
3488
  *
3486
3489
  * To stave off madness, these are inefficient for now. The wkhtmltopdf renderer leaves much to be desired
3487
3490
  * in the way of feedback with regards to javascript compatibility.
@@ -3493,29 +3496,29 @@ if(pApplicationPrototype.hasOwnProperty('default_configuration')){tmpOptions=thi
3493
3496
  // ...meaning GET BOOK with IDBook FROM AppData.Some.Address.IDBook
3494
3497
  // {~E:Book:AppData.Some.Address.IDBook:Render-Book-Template~}
3495
3498
  // ...meaning GET BOOK with IDBook FROM AppData.Some.Address.IDBook and render it to Render-Book-Template
3496
- var fEntityRender=function fEntityRender(pHash,pData,fCallback){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>0){_this58.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"]"));}var tmpEntity=false;var tmpEntityID=false;var tmpEntityTemplate=false;// This expression requires 2 parts -- a third is optional, and, if present, is the template to render to.
3499
+ var fEntityRender=function fEntityRender(pHash,pData,fCallback){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this59.LogNoisiness>4){_this59.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this59.LogNoisiness>0){_this59.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"]"));}var tmpEntity=false;var tmpEntityID=false;var tmpEntityTemplate=false;// This expression requires 2 parts -- a third is optional, and, if present, is the template to render to.
3497
3500
  var tmpHashSeparator=tmpHash.indexOf('|');if(tmpHashSeparator<0){// This is just a simple 2 part hash (the entity and the ID)
3498
3501
  var tmpHashEntitySeparator=tmpHash.indexOf(':');tmpEntity=tmpHash.substring(0,tmpHashEntitySeparator);tmpEntityID=tmpHash.substring(tmpHashEntitySeparator+1);}else{// This is a 3 part hash (the entity, the ID, and the template)
3499
3502
  var _tmpHashEntitySeparator=tmpHash.indexOf(':');tmpEntity=tmpHash.substring(0,_tmpHashEntitySeparator);var tmpHashTemplateSeparator=tmpHash.indexOf('|');tmpEntityID=tmpHash.substring(_tmpHashEntitySeparator+1,tmpHashTemplateSeparator);tmpEntityTemplate=tmpHash.substring(tmpHashTemplateSeparator+1);}if(!isNaN(tmpEntityID)){tmpEntityID=parseInt(tmpEntityID);}else{// This is an address, so we need to get the value at the address
3500
- tmpEntityID=_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpEntityID);}// No Entity or EntityID
3501
- if(!tmpEntity||!tmpEntityID){_this58.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]"));return fCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]")),'');}// Now try to get the entity
3502
- _this58.EntityProvider.getEntity(tmpEntity,tmpEntityID,function(pError,pRecord){if(pError){_this58.log.error("Pict: Entity Render: Error getting entity [".concat(tmpEntity,"] with ID [").concat(tmpEntityID,"] for [").concat(tmpHash,"]: ").concat(pError),pError);return fCallback(pError,'');}// Now render the template
3503
- if(tmpEntityTemplate){return fCallback(null,_this58.parseTemplateByHash(tmpEntityTemplate,pRecord));}else{return fCallback(null,'');}});};this.MetaTemplate.addPatternAsync('{~E:','~}',fEntityRender);this.MetaTemplate.addPatternAsync('{~Entity:','~}',fEntityRender);// {NE~Some.Address|If the left value is truthy, render this value.~}
3504
- var fNotEmptyRender=function fNotEmptyRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>2){_this58.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"]"));}// Should switch this to indexOf so pipes can be in the content.
3503
+ tmpEntityID=_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpEntityID);}// No Entity or EntityID
3504
+ if(!tmpEntity||!tmpEntityID){_this59.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]"));return fCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]")),'');}// Now try to get the entity
3505
+ _this59.EntityProvider.getEntity(tmpEntity,tmpEntityID,function(pError,pRecord){if(pError){_this59.log.error("Pict: Entity Render: Error getting entity [".concat(tmpEntity,"] with ID [").concat(tmpEntityID,"] for [").concat(tmpHash,"]: ").concat(pError),pError);return fCallback(pError,'');}// Now render the template
3506
+ if(tmpEntityTemplate){return fCallback(null,_this59.parseTemplateByHash(tmpEntityTemplate,pRecord));}else{return fCallback(null,'');}});};this.MetaTemplate.addPatternAsync('{~E:','~}',fEntityRender);this.MetaTemplate.addPatternAsync('{~Entity:','~}',fEntityRender);// {NE~Some.Address|If the left value is truthy, render this value.~}
3507
+ var fNotEmptyRender=function fNotEmptyRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this59.LogNoisiness>4){_this59.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this59.LogNoisiness>2){_this59.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"]"));}// Should switch this to indexOf so pipes can be in the content.
3505
3508
  var tmpHashParts=tmpHash.split('|');// For now just check truthiness
3506
- if(_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpHashParts[0])){return tmpHashParts[1];}else{return'';}};this.MetaTemplate.addPattern('{~NotEmpty:','~}',fNotEmptyRender);this.MetaTemplate.addPattern('{~NE:','~}',fNotEmptyRender);// {~T:Template:AddressOfData~}
3507
- var fTemplateRender=function fTemplateRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>0){_this58.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
3509
+ if(_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpHashParts[0])){return tmpHashParts[1];}else{return'';}};this.MetaTemplate.addPattern('{~NotEmpty:','~}',fNotEmptyRender);this.MetaTemplate.addPattern('{~NE:','~}',fNotEmptyRender);// {~T:Template:AddressOfData~}
3510
+ var fTemplateRender=function fTemplateRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this59.LogNoisiness>4){_this59.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this59.LogNoisiness>0){_this59.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
3508
3511
  var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
3509
- if(!tmpTemplateHash){_this58.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
3510
- return _this58.parseTemplateByHash(tmpTemplateHash,pData);}else{return _this58.parseTemplateByHash(tmpTemplateHash,_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpAddressOfData));}};this.MetaTemplate.addPattern('{~T:','~}',fTemplateRender);this.MetaTemplate.addPattern('{~Template:','~}',fTemplateRender);// {~TS:Template:AddressOfDataSet~}
3511
- var fTemplateSetRender=function fTemplateSetRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>0){_this58.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
3512
+ if(!tmpTemplateHash){_this59.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
3513
+ return _this59.parseTemplateByHash(tmpTemplateHash,pData);}else{return _this59.parseTemplateByHash(tmpTemplateHash,_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpAddressOfData));}};this.MetaTemplate.addPattern('{~T:','~}',fTemplateRender);this.MetaTemplate.addPattern('{~Template:','~}',fTemplateRender);// {~TS:Template:AddressOfDataSet~}
3514
+ var fTemplateSetRender=function fTemplateSetRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this59.LogNoisiness>4){_this59.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this59.LogNoisiness>0){_this59.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
3512
3515
  var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
3513
- if(!tmpTemplateHash){_this58.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
3514
- return _this58.parseTemplateSetByHash(tmpTemplateHash,pData);}else{return _this58.parseTemplateSetByHash(tmpTemplateHash,_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpAddressOfData));}};this.MetaTemplate.addPattern('{~TS:','~}',fTemplateSetRender);this.MetaTemplate.addPattern('{~TemplateSet:','~}',fTemplateSetRender);//{~Data:AppData.Some.Value.to.Render~}
3515
- var fDataRender=function fDataRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>3){_this58.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"]"));}var tmpValue=_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpHash);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return tmpValue;};this.MetaTemplate.addPattern('{~D:','~}',fDataRender);this.MetaTemplate.addPattern('{~Data:','~}',fDataRender);this.MetaTemplate.addPattern('{~Dollars:','~}',function(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>3){_this58.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"]"));}var tmpColumnData=_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpHash);return _this58.DataFormat.formatterDollars(tmpColumnData);});this.MetaTemplate.addPattern('{~Digits:','~}',function(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>3){_this58.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"]"));}var tmpColumnData=_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpHash);return _this58.DataFormat.formatterAddCommasToNumber(_this58.DataFormat.formatterRoundNumber(tmpColumnData,2));});var fRandomNumberString=function fRandomNumberString(pHash,pData){var tmpHash=pHash.trim();if(_this58.LogNoisiness>3){_this58.log.trace("PICT Template [fRandomNumberString]::[".concat(tmpHash,"]"));}var tmpStringLength=4;var tmpMaxNumber=9999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){tmpStringLength=parseInt(tmpHashParts[0]);}if(tmpHashParts.length>1){tmpMaxNumber=parseInt(tmpHashParts[1]);}}return _this58.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);};this.MetaTemplate.addPattern('{~RandomNumberString:','~}',fRandomNumberString);this.MetaTemplate.addPattern('{~RNS:','~}',fRandomNumberString);var fRandomNumber=function fRandomNumber(pHash,pData){var tmpHash=pHash.trim();if(_this58.LogNoisiness>3){_this58.log.trace("PICT Template [fRandomNumber]::[".concat(tmpHash,"]"));}var tmpMinimumNumber=0;var tmpMaxNumber=9999999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){tmpMinimumNumber=parseInt(tmpHashParts[0]);}if(tmpHashParts.length>1){tmpMaxNumber=parseInt(tmpHashParts[1]);}}return _this58.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);};this.MetaTemplate.addPattern('{~RandomNumber:','~}',fRandomNumber);this.MetaTemplate.addPattern('{~RN:','~}',fRandomNumber);var fPascalCaseIdentifier=function fPascalCaseIdentifier(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>3){_this58.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"]"));}var tmpValue=_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpHash);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return _this58.DataFormat.cleanNonAlphaCharacters(_this58.DataFormat.capitalizeEachWord(tmpValue));};this.MetaTemplate.addPattern('{~PascalCaseIdentifier:','~}',fPascalCaseIdentifier);var fLogValue=function fLogValue(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};var tmpValue=_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpHash);var tmpValueType=_typeof(tmpValue);if(tmpValue==null||tmpValueType=='undefined'){_this58.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is ").concat(tmpValueType,"."));}else if(tmpValueType=='object'){_this58.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is an obect."),tmpValue);}else{_this58.log.trace("PICT Template Log Value: [".concat(tmpHash,"] if a ").concat(tmpValueType," = [").concat(tmpValue,"]"));}return'';};this.MetaTemplate.addPattern('{~LogValue:','~}',fLogValue);this.MetaTemplate.addPattern('{~LV:','~}',fLogValue);var fLogStatement=function fLogStatement(pHash,pData){var tmpHash=pHash.trim();_this58.log.trace("PICT Template Log Message: ".concat(tmpHash));return'';};this.MetaTemplate.addPattern('{~LogStatement:','~}',fLogStatement);this.MetaTemplate.addPattern('{~LS:','~}',fLogStatement);var fBreakpoint=function fBreakpoint(pHash,pData){var tmpHash=pHash.trim();var tmpError=new Error("PICT Template Breakpoint: ".concat(tmpHash));_this58.log.trace("PICT Template Breakpoint: ".concat(tmpHash),tmpError.stack);debugger;return'';};this.MetaTemplate.addPattern('{~Breakpoint','~}',fBreakpoint);this._DefaultPictTemplatesInitialized=true;}}},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback){var tmpData=_typeof(pData)==='object'?pData:{};return this.MetaTemplate.parseString(pTemplateString,tmpData,fCallback);}},{key:"parseTemplateByHash",value:function parseTemplateByHash(pTemplateHash,pData,fCallback){var tmpTemplateString=this.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
3516
- if(!tmpTemplateString){return'';}return this.parseTemplate(tmpTemplateString,pData,fCallback);}},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback){var _this59=this;// TODO: This will need streaming -- for now janky old string append does the trick
3517
- var tmpValue='';if(typeof fCallback=='function'){if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this59.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 _i23=0;_i23<tmpKeys.length;_i23++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i23]]);}}return tmpValue;}else{return'';}}}},{key:"parseTemplateSetByHash",value:function parseTemplateSetByHash(pTemplateHash,pDataSet,fCallback){var tmpTemplateString=this.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
3518
- if(!tmpTemplateString){return'';}return this.parseTemplateSet(tmpTemplateString,pDataSet,fCallback);}}]);return Pict;}(libFable);;module.exports=Pict;module.exports.PictApplicationClass=require('pict-application');module.exports.PictViewClass=require('pict-view');module.exports.EnvironmentLog=require('./environments/Pict-Environment-Log.js');// This is to help understand the type of enivironement we're executing in
3516
+ if(!tmpTemplateHash){_this59.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
3517
+ return _this59.parseTemplateSetByHash(tmpTemplateHash,pData);}else{return _this59.parseTemplateSetByHash(tmpTemplateHash,_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpAddressOfData));}};this.MetaTemplate.addPattern('{~TS:','~}',fTemplateSetRender);this.MetaTemplate.addPattern('{~TemplateSet:','~}',fTemplateSetRender);//{~Data:AppData.Some.Value.to.Render~}
3518
+ var fDataRender=function fDataRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this59.LogNoisiness>4){_this59.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this59.LogNoisiness>3){_this59.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"]"));}var tmpValue=_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpHash);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return tmpValue;};this.MetaTemplate.addPattern('{~D:','~}',fDataRender);this.MetaTemplate.addPattern('{~Data:','~}',fDataRender);this.MetaTemplate.addPattern('{~Dollars:','~}',function(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this59.LogNoisiness>4){_this59.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this59.LogNoisiness>3){_this59.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"]"));}var tmpColumnData=_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpHash);return _this59.DataFormat.formatterDollars(tmpColumnData);});this.MetaTemplate.addPattern('{~Digits:','~}',function(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this59.LogNoisiness>4){_this59.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this59.LogNoisiness>3){_this59.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"]"));}var tmpColumnData=_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpHash);return _this59.DataFormat.formatterAddCommasToNumber(_this59.DataFormat.formatterRoundNumber(tmpColumnData,2));});var fRandomNumberString=function fRandomNumberString(pHash,pData){var tmpHash=pHash.trim();if(_this59.LogNoisiness>3){_this59.log.trace("PICT Template [fRandomNumberString]::[".concat(tmpHash,"]"));}var tmpStringLength=4;var tmpMaxNumber=9999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){tmpStringLength=parseInt(tmpHashParts[0]);}if(tmpHashParts.length>1){tmpMaxNumber=parseInt(tmpHashParts[1]);}}return _this59.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);};this.MetaTemplate.addPattern('{~RandomNumberString:','~}',fRandomNumberString);this.MetaTemplate.addPattern('{~RNS:','~}',fRandomNumberString);var fRandomNumber=function fRandomNumber(pHash,pData){var tmpHash=pHash.trim();if(_this59.LogNoisiness>3){_this59.log.trace("PICT Template [fRandomNumber]::[".concat(tmpHash,"]"));}var tmpMinimumNumber=0;var tmpMaxNumber=9999999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){tmpMinimumNumber=parseInt(tmpHashParts[0]);}if(tmpHashParts.length>1){tmpMaxNumber=parseInt(tmpHashParts[1]);}}return _this59.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);};this.MetaTemplate.addPattern('{~RandomNumber:','~}',fRandomNumber);this.MetaTemplate.addPattern('{~RN:','~}',fRandomNumber);var fPascalCaseIdentifier=function fPascalCaseIdentifier(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this59.LogNoisiness>4){_this59.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this59.LogNoisiness>3){_this59.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"]"));}var tmpValue=_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpHash);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return _this59.DataFormat.cleanNonAlphaCharacters(_this59.DataFormat.capitalizeEachWord(tmpValue));};this.MetaTemplate.addPattern('{~PascalCaseIdentifier:','~}',fPascalCaseIdentifier);var fLogValue=function fLogValue(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};var tmpValue=_this59.manifest.getValueByHash({AppData:_this59.AppData,Bundle:_this59.Bundle,Record:tmpData},tmpHash);var tmpValueType=_typeof(tmpValue);if(tmpValue==null||tmpValueType=='undefined'){_this59.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is ").concat(tmpValueType,"."));}else if(tmpValueType=='object'){_this59.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is an obect."),tmpValue);}else{_this59.log.trace("PICT Template Log Value: [".concat(tmpHash,"] if a ").concat(tmpValueType," = [").concat(tmpValue,"]"));}return'';};this.MetaTemplate.addPattern('{~LogValue:','~}',fLogValue);this.MetaTemplate.addPattern('{~LV:','~}',fLogValue);var fLogStatement=function fLogStatement(pHash,pData){var tmpHash=pHash.trim();_this59.log.trace("PICT Template Log Message: ".concat(tmpHash));return'';};this.MetaTemplate.addPattern('{~LogStatement:','~}',fLogStatement);this.MetaTemplate.addPattern('{~LS:','~}',fLogStatement);var fBreakpoint=function fBreakpoint(pHash,pData){var tmpHash=pHash.trim();var tmpError=new Error("PICT Template Breakpoint: ".concat(tmpHash));_this59.log.trace("PICT Template Breakpoint: ".concat(tmpHash),tmpError.stack);debugger;return'';};this.MetaTemplate.addPattern('{~Breakpoint','~}',fBreakpoint);this._DefaultPictTemplatesInitialized=true;}}},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback){var tmpData=_typeof(pData)==='object'?pData:{};return this.MetaTemplate.parseString(pTemplateString,tmpData,fCallback);}},{key:"parseTemplateByHash",value:function parseTemplateByHash(pTemplateHash,pData,fCallback){var tmpTemplateString=this.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
3519
+ if(!tmpTemplateString){return'';}return this.parseTemplate(tmpTemplateString,pData,fCallback);}},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback){var _this60=this;// TODO: This will need streaming -- for now janky old string append does the trick
3520
+ var tmpValue='';if(typeof fCallback=='function'){if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this60.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 _i23=0;_i23<tmpKeys.length;_i23++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i23]]);}}return tmpValue;}else{return'';}}}},{key:"parseTemplateSetByHash",value:function parseTemplateSetByHash(pTemplateHash,pDataSet,fCallback){var tmpTemplateString=this.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
3521
+ if(!tmpTemplateString){return'';}return this.parseTemplateSet(tmpTemplateString,pDataSet,fCallback);}}]);return Pict;}(libFable);;module.exports=Pict;module.exports.PictApplicationClass=require('pict-application');module.exports.PictViewClass=require('pict-view');module.exports.EnvironmentLog=require('./environments/Pict-Environment-Log.js');module.exports.EnvironmentObject=require('./environments/Pict-Environment-Log.js');// This is to help understand the type of enivironement we're executing in
3519
3522
  module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");},{"./Pict-CSS.js":134,"./Pict-Content-Assignment.js":135,"./Pict-DataProvider.js":136,"./Pict-Meadow-EntityProvider.js":137,"./Pict-Template-Provider.js":138,"./environments/Pict-Environment-Log.js":140,"fable":49,"pict-application":90,"pict-view":91}],140:[function(require,module,exports){/**
3520
3523
  * Pict browser shim loader
3521
3524
  * @author <steven@velozo.com>