@osovitny/anatoly 2.0.21 → 2.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/osovitny-anatoly.umd.js +382 -234
- package/bundles/osovitny-anatoly.umd.js.map +1 -1
- package/bundles/osovitny-anatoly.umd.min.js +2 -2
- package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
- package/esm2015/lib/core/localization/localization.service.js +115 -0
- package/esm2015/lib/core/utils.js +58 -14
- package/esm2015/lib/ui/components/html-editor/forms-html-editor.component.js +2 -2
- package/esm2015/lib/ui/index.js +4 -4
- package/esm2015/lib/ui/ui.module.js +25 -25
- package/esm2015/lib/ui/validation/form-validation-summary.component.js +64 -0
- package/esm2015/lib/ui/validation/item-validation-summary.component.js +38 -0
- package/esm2015/lib/ui/validation/validation-summary.component.js +117 -0
- package/fesm2015/osovitny-anatoly.js +328 -183
- package/fesm2015/osovitny-anatoly.js.map +1 -1
- package/lib/core/localization/localization.service.d.ts +18 -0
- package/lib/core/utils.d.ts +9 -0
- package/lib/ui/index.d.ts +3 -3
- package/lib/ui/ui.module.d.ts +2 -2
- package/lib/ui/{components/validation → validation}/validation-summary.component.d.ts +1 -1
- package/osovitny-anatoly.metadata.json +1 -1
- package/package.json +1 -1
- package/esm2015/lib/ui/components/validation/form-validation-summary.component.js +0 -64
- package/esm2015/lib/ui/components/validation/item-validation-summary.component.js +0 -38
- package/esm2015/lib/ui/components/validation/validation-summary.component.js +0 -117
- /package/lib/ui/{components/validation → validation}/form-validation-summary.component.d.ts +0 -0
- /package/lib/ui/{components/validation → validation}/item-validation-summary.component.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("sweetalert2"),require("
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("sweetalert2"),require("@angular/core"),require("@ngx-translate/core"),require("date-fns"),require("date-fns/locale/en-US"),require("@angular/common"),require("@angular/common/http"),require("rxjs/operators"),require("rxjs"),require("uuid"),require("@angular/router"),require("@angular/forms"),require("angular-froala-wysiwyg")):"function"==typeof define&&define.amd?define("@osovitny/anatoly",["exports","sweetalert2","@angular/core","@ngx-translate/core","date-fns","date-fns/locale/en-US","@angular/common","@angular/common/http","rxjs/operators","rxjs","uuid","@angular/router","@angular/forms","angular-froala-wysiwyg"],e):e(((t=t||self).osovitny=t.osovitny||{},t.osovitny.anatoly={}),t.Swal,t.ng.core,t.i1,t.dateFns,t.enUS,t.ng.common,t.ng.common.http,t.rxjs.operators,t.rxjs,t.uuid,t.ng.router,t.ng.forms,t.angularFroalaWysiwyg)}(this,(function(t,e,n,r,o,i,a,s,u,l,c,p,d,f){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;var h=JSON.parse(document.getElementById("contextInitState").getAttribute("data-contextinitstate")),g=JSON.parse(document.getElementById("appCoreSettings").getAttribute("data-appcoresettings"));function m(t,e){if(t)throw new Error(e+" has already been loaded. Import "+e+" modules in the AppModule only.")}var y=function(){function t(){}return t.Info=function(t){e.fire({title:"Information",text:t,icon:"info",confirmButtonText:"OK"})},t.Warning=function(t){e.fire({title:"Warning",text:t,icon:"warning",confirmButtonText:"OK"})},t.Error=function(t){e.fire({title:"Error",text:t,icon:"error",confirmButtonText:"OK"})},t.NotImplemented=function(){this.Warning("Not Implemented Yet")},t.ErrorOccurred=function(){this.Error("Sorry, an unexpected error occurred")},t.AreYouSure=function(t,n,r,o,i,a){void 0!==n&&null!=n||(n="Are you sure?"),e.fire({title:n,text:t,icon:"warning",confirmButtonText:r,cancelButtonText:o,showCancelButton:!0}).then((function(t){t.value?i&&i():t.dismiss!=e.DismissReason.cancel&&t.dismiss!=e.DismissReason.close||a&&a()}))},t.Success=function(t,n,r){void 0!==n&&null!=n||(n="Success"),t||(t="Operation was successful"),e.fire({title:n,text:t,icon:"success",confirmButtonText:"OK"}).then((function(){r&&r()}))},t.Cancel=function(t){t||(t="Operation has been cancled"),e.fire({title:"Cancelled",text:t,icon:"info"})},t.NotificationCancel=function(t,n){void 0!==n&&null!=n||(n="Canceled"),t||(t="Operation has been canceled"),e.mixin({toast:!0,position:"top-end",showConfirmButton:!1,timer:3e3,timerProgressBar:!0}).fire({title:n,text:t,icon:"info"})},t.NotificationSuccess=function(t,n){void 0!==n&&null!=n||(n="Success"),t||(t="Operation was successful"),e.mixin({toast:!0,position:"top-end",showConfirmButton:!1,timer:3e3,timerProgressBar:!0}).fire({title:n,text:t,icon:"success"})},t}(),v=function(){function t(t){this.translate=t,this.setSupportedLanguages(["en"])}return t.prototype.format=function(t,e){return t.replace(/{(\d+)}/g,(function(t,n){return void 0!==e[n]?e[n]:t}))},t.prototype.configureTranslationSettings=function(t){return t.setDefaultLang("en"),"en"},t.prototype.getBrowserLanguage=function(){return this.translate.getBrowserLang()},t.prototype.getDatefnsLocale=function(){var t;switch(this.getBrowserLanguage()){case"en":t={locale:i};break;default:t={locale:i}}return t},t.prototype.setDefaultLanguage=function(t){this.translate.setDefaultLang(t)},t.prototype.setSupportedLanguages=function(t){this.translate.addLangs(t)},t.prototype.updateLanguage=function(t){this.translate.use(t)},t.prototype.getLocalizedValue=function(t,e){var n=this.translate.instant(t);return e&&0!==e.length?this.format(n,e):n},t.prototype.getLocalizedDate=function(t){return o.isValid(new Date(t))?o.format(new Date(t),g.DATE_FORMATS.angular,this.dateFnsLocale):"Invalid Date"},t.prototype.getLocalizedDateTime=function(t){var e=new Date(t);if(o.isValid(e)){var n=D.convertToLocalizedDateTime(e);return o.format(n,g.DATE_FORMATS.angularWithTime,this.dateFnsLocale)}return"Invalid Date"},t.prototype.getLocalizedDistanceToNowInWords=function(t){return o.isValid(new Date(t))?o.formatDistanceToNow(new Date(t),this.dateFnsLocale):"Invalid Date"},t.prototype.getLocalizedDistanceInWords=function(t,e){return o.isValid(new Date(t))&&o.isValid(new Date(e))?o.formatDistance(new Date(t),new Date(e),this.dateFnsLocale):"Invalid Date"},t}();v.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new v(n.ɵɵinject(r.TranslateService))},token:v,providedIn:"root"}),v.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],v.ctorParameters=function(){return[{type:r.TranslateService}]};
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var S=function(t,e){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function x(t,e){function n(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;function C(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function P(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function E(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(P(arguments[e]));return t}Object.create;var w=function(){function t(t){this.http=t,this.baseUrl=""}return t.prototype.serializeParams=function(t){return t?"?"+$.param(t):""},t.prototype.get=function(t,e,n){n||(n="json");var r=this.baseUrl+"/"+t+this.serializeParams(e);return this.http.get(r,{responseType:n}).pipe(a.map((function(t){return t})))},t.prototype.post=function(t,e,n){n||(n="text");var r=this.baseUrl+"/"+t;return this.http.post(r,e,{responseType:n})},t.prototype.postQS=function(t,e,n){n||(n="text");var r=this.baseUrl+"/"+t+this.serializeParams(e);return this.http.post(r,null,{responseType:n})},t.prototype.delete=function(t,e,n){n||(n="text");var r=this.baseUrl+"/"+t+this.serializeParams(e);return this.http.delete(r,{responseType:n})},t.prototype.getById=function(t){return this.get("getById",{id:t})},t.prototype.getAll=function(t){return this.get("getall",t).pipe(a.map((function(t){return t})))},t.prototype.getJsonFile=function(t,e,n){e||(e="/dist/jsons"),n||(n="1.0");var r=e+"/"+t+"?"+n;return this.http.get(r).pipe(a.map((function(t){return t})))},t.prototype.getNewGuid=function(){var t=this.baseUrl+"/getNewGuid";return this.http.get(t,{responseType:"text"})},t}();w.decorators=[{type:r.Injectable}],w.ctorParameters=function(){return[{type:i.HttpClient}]};var U=function(t){function e(e){var n=t.call(this,e)||this;return n.http=e,n.current=null,n.successes=[],n.subscription=null,n.baseUrl="/api/appContext",n}return x(e,t),e.prototype.getCurrent=function(t){var e=this;void 0!==t&&(null==this.current?(this.successes.push(t),null==this.subscription&&(this.subscription=this.get("GetCurrentContext",null).subscribe((function(t){e.dataReceived(t)}),(function(t){})))):t(this.current))},e.prototype.dataReceived=function(t){this.current=t;for(var e=0;e<this.successes.length;e++){(0,this.successes[e])(t)}this.successes=[],this.subscription.unsubscribe(),this.subscription=null,this.current=null},e.prototype.isUserSignedIn=function(){return p.isUserSignedIn},e.prototype.isUserAdmin=function(){return p.isUserAdmin},e}(w);U.decorators=[{type:r.Injectable}],U.ctorParameters=function(){return[{type:i.HttpClient}]};var A=function(t){function e(){var e=t.call(this,!1)||this;return e.counter=0,e.isFreezed=!1,e}return x(e,t),e.prototype.show=function(){this.counter++;var t=this;setTimeout((function(){t.counter>0&&t.next(!0)}),1e3)},e.prototype.hide=function(){this.counter<=0||(this.counter--,0==this.counter&&this.next(!1))},e.prototype.freeze=function(t){var e=this;void 0===t&&(t=1e3),this.isFreezed=!0;setTimeout((function(){e.isFreezed=!1}),t)},e}(s.BehaviorSubject);A.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new A},token:A,providedIn:"root"}),A.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],A.ctorParameters=function(){return[]};var O=function(){function t(t,e){this.loadingService=t,this.loggingService=e,this.longRunningExceptionsList=[],this.autoCDNSASTokenUrls=["chunks","resources"],this.externalSiteUrls=["azurewebsites.net"]}return t.prototype.intercept=function(t,e){var n,r,o,s,u,l,c=this,p=d.IsCDNEnabled,f=d.CDNSASToken,h=this.loadingService.isFreezed,m=!h,y=t.url.toLowerCase(),g=t.url;if(!h)try{for(var v=C(this.longRunningExceptionsList),b=v.next();!b.done;b=v.next()){var I=b.value;if(y.indexOf(this.longRunningExceptionsList[I])>=0){m=!1;break}}}catch(t){n={error:t}}finally{try{b&&!b.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}if(p)try{for(var S=C(this.autoCDNSASTokenUrls),x=S.next();!x.done;x=S.next()){I=x.value;if(y.indexOf(this.autoCDNSASTokenUrls[I])>=0){t=t.clone({url:g+f});break}}}catch(t){o={error:t}}finally{try{x&&!x.done&&(s=S.return)&&s.call(S)}finally{if(o)throw o.error}}try{for(var P=C(this.externalSiteUrls),E=P.next();!E.done;E=P.next()){I=E.value;if(y.indexOf(this.externalSiteUrls[I])>=0){!0;break}}}catch(t){u={error:t}}finally{try{E&&!E.done&&(l=P.return)&&l.call(P)}finally{if(u)throw u.error}}if(y.indexOf("/api/")>-1){var w="",U=(new Date).getTime().toString();w=y.indexOf("?")>-1?g+"&t="+U:g+"?t="+U,t=t.clone({url:w})}return t=t.clone({headers:t.headers.set("Accept","application/json")}),this.onRequestStart(m),e.handle(t).pipe(a.tap((function(t){t instanceof i.HttpResponse&&c.onRequestEnd(m)}),(function(t){c.onRequestEnd(m),c.loggingService.logError(t)})))},t.prototype.onRequestStart=function(t){t&&this.loadingService.show()},t.prototype.onRequestEnd=function(t){t&&this.loadingService.hide()},t}();O.decorators=[{type:r.Injectable}],O.ctorParameters=function(){return[{type:A},{type:b}]};var T=[b,U,A],q=function(t,e){this.injector=t,f(e,"AnatolyCoreModule"),this.injector};q.decorators=[{type:r.NgModule,args:[{imports:[u.CommonModule],providers:E(T)}]}],q.ctorParameters=function(){return[{type:r.Injector},{type:q,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var B=function(t){function e(e){var n=t.call(this,[])||this;return n.http=e,n.baseReadUrl="",n.data=[],n}return x(e,t),e.prototype.serializeParams=function(t){return t?"?"+$.param(t):""},e.prototype.read=function(e,n,r){var o=this;if(this.data.length)return t.prototype.next.call(this,this.data);var i=this.baseReadUrl;void 0===e&&(e=this.savedReadParams),e&&(i=this.baseReadUrl+""+this.serializeParams(e),this.savedReadParams=e),this.http.get(i).pipe(a.map((function(t){return t}))).subscribe((function(e){t.prototype.next.call(o,e),n&&n()}),(function(t){r&&r(t)}))},e}(s.BehaviorSubject);B.decorators=[{type:r.Injectable}],B.ctorParameters=function(){return[{type:i.HttpClient}]};var N=function(t){function e(e){var n=t.call(this,e)||this;return n.http=e,n.baseUrl="",n}return x(e,t),e.prototype.reset=function(){this.data=[]},e.prototype.resetItem=function(e){if(e){var n=this.data.find((function(t){return t.Id===e.Id}));Object.assign(n,e),t.prototype.next.call(this,this.data)}},e.prototype.save=function(t,e,n){var r=this,o=e?"add":"update";this.reset(),this.post(o,t).subscribe((function(){}),(function(){r.read()}),(function(){r.read(),n&&n()}))},e.prototype.remove=function(t,e){var n=this;this.reset(),this.post("remove",t).subscribe((function(){}),(function(){n.read()}),(function(){n.read(),e&&e()}))},e.prototype.post=function(t,e){var n=this.baseUrl+""+t+this.serializeParams(e);return this.http.post(n,e).pipe(a.map((function(t){return t})))},e}(B);N.decorators=[{type:r.Injectable}],N.ctorParameters=function(){return[{type:i.HttpClient}]};var j=function(t){function e(e){var n=t.call(this,e)||this;return n.http=e,n.baseUrl+="billing/",n}return x(e,t),e.prototype.requestNewSubscription=function(t,e,n){this.postQS("requestNewSubscription",{requestedPlan:t}).subscribe((function(t){}),(function(t){n&&n()}),(function(){e&&e()}))},e.prototype.cancelRequestedSubscription=function(t,e){this.postQS("cancelRequestedSubscription",null).subscribe((function(t){}),(function(t){e&&e()}),(function(){t&&t()}))},e.prototype.buyAccess=function(t,e,n){this.postQS("buyAccess",{requestedPlan:t}).subscribe((function(t){}),(function(t){n&&n()}),(function(){e&&e()}))},e}(w);j.decorators=[{type:r.Injectable}],j.ctorParameters=function(){return[{type:i.HttpClient}]};var R=function(){};R.decorators=[{type:r.NgModule,args:[{imports:[u.CommonModule],providers:[j]}]}];var k=function(){function t(t,e){this.appcontext=t,this.api=e,this.contextUpdated=!1,this.isUserSignedIn=!1,this.currentPlan=0,this.currentPlanTitle=""}return t.prototype.ngOnInit=function(){var t=this;this.appcontext.isUserSignedIn()?this.appcontext.getCurrent((function(e){t.isUserSignedIn=e.isUserSignedIn,t.isUserSignedIn&&(t.currentPlan=e.account.billingPlan,t.currentPlanTitle=e.account.billingPlanAsString),t.contextUpdated=!0})):this.contextUpdated=!0},t.prototype.onBuyPlan=function(){var t="Requested plan: "+this.plantitle+" ",e=this;h.AreYouSure(t,"Buying access","Confirm change","Cancel",(function(){e.api.buyAccess(e.plan,(function(){h.Success("Access Granted",null,(function(){window.location.reload()}))}))}))},t}();k.decorators=[{type:r.Component,args:[{selector:"anatoly-buyaccess-button",template:'<div *ngIf="contextUpdated">\r\n <div *ngIf="!isUserSignedIn">\r\n <anatoly-signup-button classbtn="btn btn-block btn-primary"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf="isUserSignedIn">\r\n <button class="btn btn-block btn-success selectPlan" *ngIf="plan == currentPlan">\r\n Your Plan\r\n </button>\r\n\r\n <button class="btn btn-block btn-warning selectPlan" *ngIf="plan != currentPlan && currentPlan == 1" (click)="onBuyPlan()">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n'}]}],k.ctorParameters=function(){return[{type:U},{type:j}]},k.propDecorators={plan:[{type:r.Input}],plantitle:[{type:r.Input}]};var z=function(){function t(t){this.appcontext=t,this.contextUpdated=!1,this.isUserSignedIn=!1,this.currentPlan=0,this.currentPlanTitle="",this.requestedPlan=0,this.requestedPlanTitle=""}return t.prototype.ngOnInit=function(){var t=this;this.appcontext.isUserSignedIn()?this.appcontext.getCurrent((function(e){t.isUserSignedIn=e.isUserSignedIn,t.isUserSignedIn&&(t.currentPlan=e.account.billingPlan,t.currentPlanTitle=e.account.billingPlanAsString,t.requestedPlan=e.account.requestedBillingPlan,t.requestedPlanTitle=e.account.requestedBillingPlanAsString),t.contextUpdated=!0})):this.contextUpdated=!0},t}();z.decorators=[{type:r.Component,args:[{selector:"anatoly-subscribe-plan-button",template:'<div *ngIf="contextUpdated">\r\n <div *ngIf="!isUserSignedIn">\r\n <anatoly-signup-button classbtn="btn btn-block btn-primary"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf="isUserSignedIn">\r\n <button class="btn btn-block btn-success selectPlan" *ngIf="plan == currentPlan">\r\n Your Plan\r\n </button>\r\n\r\n <button class="btn btn-block btn-warning selectPlan" *ngIf="requestedPlan != null && requestedPlan != 0 && plan == requestedPlan">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf="plan != currentPlan && plan != requestedPlan"\r\n [currentplantitle]="currentPlanTitle"\r\n [requestedplan]=plan\r\n [requestedplantitle]="plantitle">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n'}]}],z.ctorParameters=function(){return[{type:U}]},z.propDecorators={plan:[{type:r.Input}],plantitle:[{type:r.Input}]};var F=function(){function t(t){this.api=t}return t.prototype.onUpgradePlan=function(){var t="Current plan: "+this.currentplantitle+" New plan: "+this.requestedplantitle,e=this;h.AreYouSure(t,"Change billing plan","Confirm change","Cancel",(function(){e.api.requestNewSubscription(e.requestedplan,(function(){h.Success("Your request for changing plan has been sent.",null,(function(){window.location.reload()}))}))}))},t}();F.decorators=[{type:r.Component,args:[{selector:"anatoly-upgrade-plan-button",template:'<button class="btn btn-block btn-primary" (click)="onUpgradePlan()">\r\n Upgrade\r\n</button>\r\n'}]}],F.ctorParameters=function(){return[{type:j}]},F.propDecorators={currentplantitle:[{type:r.Input}],requestedplan:[{type:r.Input}],requestedplantitle:[{type:r.Input}]};var D=function(){};D.decorators=[{type:r.Component,args:[{selector:"anatoly-signin-button",template:'<a href="identity/signIn" class="{{classbtn}}">Sign In</a>\r\n'}]}],D.ctorParameters=function(){return[]},D.propDecorators={classbtn:[{type:r.Input}]};var M=function(){};M.decorators=[{type:r.Component,args:[{selector:"anatoly-signout-button",template:'<a href="identity/signOut" class="{{classbtn}}">Sign Out</a>\r\n'}]}],M.ctorParameters=function(){return[]},M.propDecorators={classbtn:[{type:r.Input}]};var G=function(){};G.decorators=[{type:r.Component,args:[{selector:"anatoly-signup-button",template:'<a href="identity/signup" class="{{classbtn}}">Sign Up</a>\r\n'}]}],G.propDecorators={classbtn:[{type:r.Input}]};var V=function(){function t(){}return t.prototype.ngOnInit=function(){null==this.title&&(this.title="")},t}();V.decorators=[{type:r.Component,args:[{selector:"anatoly-content-header",template:'<h2 class="page-header">\r\n {{title}}\r\n \x3c!--<small>Optional {{title}}</small>--\x3e\r\n</h2>\r\n'}]}],V.propDecorators={title:[{type:r.Input}]};var L=function(){function t(){}return t.prototype.getQSId=function(){var t=m.getValueByNameInQS("id");return void 0===t||""==t?null:t},t}(),H=function(t){function e(){var e=t.call(this)||this;return e.formSubmitted=!1,e}return x(e,t),e.prototype.isActionAdding=function(){var t=m.getValueByNameInQS("id");return void 0===t||""==t},e.prototype.getEntityId=function(){return this.getQSId()},e.prototype.isControlValid=function(t,e){return void 0===e&&(e=null),!this.isControlInvalid(t,e)},e.prototype.isControlInvalid=function(t,e){if(void 0===e&&(e=null),void 0===t||""==t)return!1;var n=e||this.formGroup;return!!n&&(!!n.get(t)&&(this.formSubmitted&&n.get(t).invalid||n.get(t).touched&&n.get(t).invalid))},e.prototype.getFormValue=function(t,e){return void 0===e&&(e=null),(e||this.formGroup).controls[t].value},e.prototype.setFormValue=function(t,e,n){void 0===n&&(n=null),(n||this.formGroup).controls[t].setValue(e)},e.prototype.getFormGroupValue=function(t,e,n){return void 0===n&&(n=null),(n||this.formGroup).controls[t].get(e).value},e.prototype.setFormGroupValue=function(t,e,n,r){void 0===r&&(r=null),(r||this.formGroup).controls[t].get(e).setValue(n)},e}(L);H.propDecorators={formGroup:[{type:r.Input}],formSubmitted:[{type:r.Input}]};var K={placeholderText:"Edit Your Content Here",charCounterCount:!0,heightMin:100,toolbarInline:!1,toolbarButtons:{moreText:{buttons:["bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","backgroundColor","inlineClass","inlineStyle"]},moreParagraph:{buttons:["alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"]},moreRich:{buttons:["insertLink","insertImage","insertTable","emoticons","fontAwesome","specialCharacters","embedly"]},moreMisc:{buttons:["selectAll","clearFormatting","html","undo","redo","fullscreen"],align:"right"}},imageUploadURL:"/api/HtmlEditor/UploadImage",imageAllowedTypes:["jpeg","jpg","png"],imageUploadParams:{uploadType:"",uploadParentId:""}},_=function(t){function e(){var e=t.call(this)||this;return e.froalaEditorInitialized=!1,e.afterInitializedActions=[],e.editorLabelText="Html",e.editorOptions={},e}return x(e,t),e.prototype.ngOnInit=function(){var t=this.editorOptions;"string"==typeof this.editorOptions&&(t=JSON.parse(this.editorOptions));var e=$.extend({},K,t),n=d.froalaEditorKey;n&&(e=$.extend({},e,JSON.parse('{ "key": "'+n+'" }'))),e.events&&e.events.initialized&&(e.events.initialized.overridden=!1),this.options=e},e.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.froalaEditorInitialized=!0,t.onInitialized()}),300)},e.prototype.onInitialized=function(){var t=this.afterInitializedActions;if(this.afterInitializedActions=[],t)for(var e=0;e<t.length;e++)t[e]()},e.prototype.getEditor=function(){return this.froalaEditor?this.froalaEditor.getEditor():null},e.prototype.doAfterInitialized=function(t){var e=this;this.froalaEditorInitialized?t(e):this.afterInitializedActions.push((function(){t(e)}))},e.prototype.initializeControl=function(t){this.froalaEditor=t,this.froalaEditor.initialize()},e.prototype.setUploadParams=function(t,e){this.doAfterInitialized((function(n){var r=n.getEditor();void 0!==r&&null!=r&&(r.opts.imageUploadParams.uploadType=t,r.opts.imageUploadParams.uploadParentId=e)}))},e}(H);_.propDecorators={editorLabelText:[{type:r.Input}],editorOptions:[{type:r.Input}]};var Q=function(t){function e(){return t.call(this)||this}return x(e,t),e.prototype.setHtml=function(t){this.doAfterInitialized((function(e){var n=e.getEditor();void 0!==n&&null!=n&&n.html.set(t)}))},e.prototype.getHtml=function(){var t=this.getEditor();if(void 0!==t&&null!=t)return t.html.get(!1)},e}(_);Q.decorators=[{type:r.Component,args:[{selector:"anatoly-html-editor",template:'<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]="options" (froalaInit)="initializeControl($event)">\r\n </textarea>\r\n</div>'}]}],Q.ctorParameters=function(){return[]};var Y=function(t){function e(){var e=t.call(this)||this;return e.editorFormKey="html",e}return x(e,t),e.prototype.setFormValueAfterInitialized=function(t,e){this.doAfterInitialized((function(n){n.setFormValue(t,e)}))},e}(_);Y.decorators=[{type:r.Component,args:[{selector:"anatoly-forms-html-editor",template:'<div [formGroup]="formGroup">\r\n <div class="form-group" [ngClass]="{\'has-error\': isItemInvalid(editorFormKey) }">\r\n <label class="control-label">{{ editorLabelText }}</label>\r\n <textarea [formControlName]="editorFormKey"\r\n [froalaEditor]="options" (froalaInit)="initializeControl($event)">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]="formGroup"\r\n [formSubmitted]="formSubmitted"\r\n [controlName]="editorFormKey"\r\n [controlTitle]="editorLabelText">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n'}]}],Y.ctorParameters=function(){return[]},Y.propDecorators={editorFormKey:[{type:r.Input}]};var J=function(t){function e(){return t.call(this)||this}return x(e,t),e.prototype.getFormValidationMessages=function(){var t=this,e=[];return Object.keys(this.formGroup.controls).forEach((function(n){var r=t.formGroup.controls[n];null!=r.controls?Object.keys(r.controls).forEach((function(n){var o=r.controls[n];t.getValidationMessages(o,t.getControlName(o,n)).forEach((function(t){return e.push(t)}))})):t.getValidationMessages(r,t.getControlName(r,n)).forEach((function(t){return e.push(t)}))})),e},e.prototype.getValidationMessages=function(t,e){var n=t.path||e,r=[];if(t.errors)for(var o in t.errors)if(t.errors.hasOwnProperty(o))switch(o){case"required":r.push(n+" is required");break;case"minlength":r.push(n+" must be at least "+t.errors.minlength.requiredLength+" characters");break;case"pattern":r.push(n+" contains illegal characters");break;case"format":r.push(n+" format mismatch");break;case"maxlength":r.push(n+" must have maximum "+t.errors.maxlength.requiredLength+" characters");break;case"specialcharacters":r.push(n+" contains special characters")}return r},e.prototype.getControlName=function(t,e){var n=this.getControlTitle(t);return n||e},e.prototype.getControlTitle=function(t){if(null==t?void 0:t.nativeElement){var e=this.getTitleAttribute(t.nativeElement);if(e)return e}},e.prototype.getTitleAttribute=function(t){var e,n,r,o,i,a,s;switch(t.tagName){case"KENDO-TIMEPICKER":case"KENDO-DATEPICKER":s=null===(o=null===(r=null===(n=null===(e=t.children[0])||void 0===e?void 0:e.children[0])||void 0===n?void 0:n.children[0])||void 0===r?void 0:r.children[0])||void 0===o?void 0:o.getAttribute("title");break;case"KENDO-NUMERICTEXTBOX":s=null===(a=null===(i=t.children[0])||void 0===i?void 0:i.children[0])||void 0===a?void 0:a.getAttribute("title");break;default:s=t.getAttribute("title")}return s},e}(H),W=function(t){function e(){var e=t.call(this)||this;return e.visible=!1,e.customerrors=[],e.viewtype=0,e}return x(e,t),e.prototype.getErrors=function(){if(1==this.viewtype)return this.customerrors;var t=this.getFormValidationMessages();if(0==this.viewtype)return t;var e=[];return t.length>0&&e.push.apply(e,E(t)),this.customerrors.length>0&&e.push.apply(e,E(this.customerrors)),e},e}(J);W.decorators=[{type:r.Component,args:[{selector:"anatoly-form-validation-summary",template:'<div class="callout callout-danger" *ngIf="visible">\r\n <h6 class="box-title">There are problems with the form</h6>\r\n <ul>\r\n <li *ngFor="let error of getErrors()"><span>{{error}}</span></li>\r\n </ul>\r\n</div>\r\n\r\n'}]}],W.ctorParameters=function(){return[]},W.propDecorators={visible:[{type:r.Input}],customerrors:[{type:r.Input}],viewtype:[{type:r.Input}]};var X=function(t){function e(){return t.call(this)||this}return x(e,t),e}(J);X.decorators=[{type:r.Component,args:[{selector:"anatoly-item-validation-summary",template:'<ul class="list-unstyled" *ngIf="isControlInvalid(controlName)">\r\n <li *ngFor="let error of getValidationMessages(formGroup.get(controlName), controlTitle)">\r\n <span class="help-block">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n'}]}],X.ctorParameters=function(){return[]},X.propDecorators={controlName:[{type:r.Input}],controlTitle:[{type:r.Input}]};var Z=function(){function t(t,e){this.el=t,this.control=e}return t.prototype.ngOnInit=function(){this.control.control.nativeElement=this.el.nativeElement},t}();Z.decorators=[{type:r.Directive,args:[{selector:"[formControl], [formControlName]"}]}],Z.ctorParameters=function(){return[{type:r.ElementRef},{type:l.NgControl}]};var tt=c.FroalaEditorModule.forRoot(),et=c.FroalaViewModule.forRoot(),nt=function(){};nt.decorators=[{type:r.NgModule,args:[{imports:[u.CommonModule,l.ReactiveFormsModule,l.FormsModule,tt,et],exports:[z,F,k,D,G,M,W,X,Q,Y,V,Z],declarations:[z,F,k,D,G,M,W,X,Q,Y,V,Z]}]}],t.Alerts=h,t.AnatolyCoreModule=q,t.AnatolyDataModule=R,t.AnatolyHttpInterceptor=O,t.AnatolyUIModule=nt,t.AppContextService=U,t.AppCoreSettings=d,t.BaseApiService=w,t.BaseComponent=L,t.BaseEditComponent=H,t.BaseGoService=v,t.BaseGridEditService=N,t.BaseGridReadService=B,t.BillingApiService=j,t.BuyAccessButtonComponent=k,t.ContentHeaderComponent=V,t.ContextInitState=p,t.FormValidationSummaryComponent=W,t.FormsHtmlEditorComponent=Y,t.GlobalErrorHandler=I,t.Guid=g,t.HtmlEditorComponent=Q,t.ItemValidationSummaryComponent=X,t.LoadingService=A,t.LoggingService=b,t.NativeElementDirective=Z,t.SignInButtonComponent=D,t.SignOutButtonComponent=M,t.SignUpButtonComponent=G,t.Subs=y,t.SubscribePlanButtonComponent=z,t.UpgradePlanButtonComponent=F,t.Utils=m,t.ValidationSummaryComponent=J,t.throwIfAlreadyLoaded=f,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
16
|
+
var b=function(t,e){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function I(t,e){function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;function S(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function C(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(x(arguments[e]));return t}Object.create;var w=function(){function t(){}return t.prototype.logError=function(t){console.error(t)},t.prototype.logInformation=function(t){console.info(t)},t}();w.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new w},token:w,providedIn:"root"}),w.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],w.ctorParameters=function(){return[]};var P=function(){function t(t){this.http=t,this.baseUrl=""}return t.prototype.serializeParams=function(t){return t?"?"+$.param(t):""},t.prototype.get=function(t,e,n){n||(n="json");var r=this.baseUrl+"/"+t+this.serializeParams(e);return this.http.get(r,{responseType:n}).pipe(u.map((function(t){return t})))},t.prototype.post=function(t,e,n){n||(n="text");var r=this.baseUrl+"/"+t;return this.http.post(r,e,{responseType:n})},t.prototype.postQS=function(t,e,n){n||(n="text");var r=this.baseUrl+"/"+t+this.serializeParams(e);return this.http.post(r,null,{responseType:n})},t.prototype.delete=function(t,e,n){n||(n="text");var r=this.baseUrl+"/"+t+this.serializeParams(e);return this.http.delete(r,{responseType:n})},t.prototype.getById=function(t){return this.get("getById",{id:t})},t.prototype.getAll=function(t){return this.get("getall",t).pipe(u.map((function(t){return t})))},t.prototype.getJsonFile=function(t,e,n){e||(e="/dist/jsons"),n||(n="1.0");var r=e+"/"+t+"?"+n;return this.http.get(r).pipe(u.map((function(t){return t})))},t.prototype.getNewGuid=function(){var t=this.baseUrl+"/getNewGuid";return this.http.get(t,{responseType:"text"})},t}();P.decorators=[{type:n.Injectable}],P.ctorParameters=function(){return[{type:s.HttpClient}]};var E=function(t){function e(e){var n=t.call(this,e)||this;return n.http=e,n.current=null,n.successes=[],n.subscription=null,n.baseUrl="/api/appContext",n}return I(e,t),e.prototype.getCurrent=function(t){var e=this;void 0!==t&&(null==this.current?(this.successes.push(t),null==this.subscription&&(this.subscription=this.get("GetCurrentContext",null).subscribe((function(t){e.dataReceived(t)}),(function(t){})))):t(this.current))},e.prototype.dataReceived=function(t){this.current=t;for(var e=0;e<this.successes.length;e++){(0,this.successes[e])(t)}this.successes=[],this.subscription.unsubscribe(),this.subscription=null,this.current=null},e.prototype.isUserSignedIn=function(){return h.isUserSignedIn},e.prototype.isUserAdmin=function(){return h.isUserAdmin},e}(P);E.decorators=[{type:n.Injectable}],E.ctorParameters=function(){return[{type:s.HttpClient}]};var U=function(t){function e(){var e=t.call(this,!1)||this;return e.counter=0,e.isFreezed=!1,e}return I(e,t),e.prototype.show=function(){this.counter++;var t=this;setTimeout((function(){t.counter>0&&t.next(!0)}),1e3)},e.prototype.hide=function(){this.counter<=0||(this.counter--,0==this.counter&&this.next(!1))},e.prototype.freeze=function(t){var e=this;void 0===t&&(t=1e3),this.isFreezed=!0;setTimeout((function(){e.isFreezed=!1}),t)},e}(l.BehaviorSubject);U.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new U},token:U,providedIn:"root"}),U.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],U.ctorParameters=function(){return[]};var T,O=[w,E,U],A=function(t,e){this.injector=t,m(e,"AnatolyCoreModule"),T=this.injector};A.decorators=[{type:n.NgModule,args:[{imports:[a.CommonModule],providers:C(O)}]}],A.ctorParameters=function(){return[{type:n.Injector},{type:A,decorators:[{type:n.Optional},{type:n.SkipSelf}]}]};var D=function(){function t(){}return t.getValueByNameInQS=function(e){return t.getValueByName(location.search,e)},t.getValueByName=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},t.copyToClipBoard=function(t,e){t.preventDefault();var n=document.createElement("textarea");n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.opacity="0",n.value=e,document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n)},t.downloadFile=function(t,e){var n=document.createElement("a");n.download=t,n.href=e,n.click()},Object.defineProperty(t,"localizationService",{get:function(){return T.get(v)},enumerable:!1,configurable:!0}),t.getLocalizedValue=function(t,e,n){return!t&&n?this.localizationService.getLocalizedValue(n):t?this.localizationService.getLocalizedValue(t,e):t},t.convertToLocalizedDateTime=function(t){return t?new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())):null},t.downloadBlobFile=function(e,n){if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(e,n);else{var r=window.URL.createObjectURL(e);t.downloadFile(n,r)}},t}(),B=function(){function t(){this.subs=[]}return t.prototype.add=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.subs=this.subs.concat(t)},Object.defineProperty(t.prototype,"sink",{set:function(t){this.subs.push(t)},enumerable:!1,configurable:!0}),t.prototype.unsubscribe=function(){this.subs.forEach((function(t){return t&&t.unsubscribe()})),this.subs=[]},t}(),j=function(){function t(){}return t.newGuid=function(){return c.v4()},t}(),q=function(){function t(t,e){this.route=t,this.router=e}return t.prototype.locationReload=function(){window.location.reload()},t}();q.decorators=[{type:n.Injectable}],q.ctorParameters=function(){return[{type:p.ActivatedRoute},{type:p.Router}]};var z=function(){function t(t){this.injector=t}return t.prototype.handleError=function(t){throw this.injector.get(w).logError(t),t},t}();z.decorators=[{type:n.Injectable}],z.ctorParameters=function(){return[{type:n.Injector}]};var L=function(){function t(t,e){this.loadingService=t,this.loggingService=e,this.longRunningExceptionsList=[],this.autoCDNSASTokenUrls=["chunks","resources"],this.externalSiteUrls=["azurewebsites.net"]}return t.prototype.intercept=function(t,e){var n,r,o,i,a,l,c=this,p=g.IsCDNEnabled,d=g.CDNSASToken,f=this.loadingService.isFreezed,h=!f,m=t.url.toLowerCase(),y=t.url;if(!f)try{for(var v=S(this.longRunningExceptionsList),b=v.next();!b.done;b=v.next()){var I=b.value;if(m.indexOf(this.longRunningExceptionsList[I])>=0){h=!1;break}}}catch(t){n={error:t}}finally{try{b&&!b.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}if(p)try{for(var x=S(this.autoCDNSASTokenUrls),C=x.next();!C.done;C=x.next()){I=C.value;if(m.indexOf(this.autoCDNSASTokenUrls[I])>=0){t=t.clone({url:y+d});break}}}catch(t){o={error:t}}finally{try{C&&!C.done&&(i=x.return)&&i.call(x)}finally{if(o)throw o.error}}try{for(var w=S(this.externalSiteUrls),P=w.next();!P.done;P=w.next()){I=P.value;if(m.indexOf(this.externalSiteUrls[I])>=0){!0;break}}}catch(t){a={error:t}}finally{try{P&&!P.done&&(l=w.return)&&l.call(w)}finally{if(a)throw a.error}}if(m.indexOf("/api/")>-1){var E="",U=(new Date).getTime().toString();E=m.indexOf("?")>-1?y+"&t="+U:y+"?t="+U,t=t.clone({url:E})}return t=t.clone({headers:t.headers.set("Accept","application/json")}),this.onRequestStart(h),e.handle(t).pipe(u.tap((function(t){t instanceof s.HttpResponse&&c.onRequestEnd(h)}),(function(t){c.onRequestEnd(h),c.loggingService.logError(t)})))},t.prototype.onRequestStart=function(t){t&&this.loadingService.show()},t.prototype.onRequestEnd=function(t){t&&this.loadingService.hide()},t}();L.decorators=[{type:n.Injectable}],L.ctorParameters=function(){return[{type:U},{type:w}]};var N=function(t){function e(e){var n=t.call(this,[])||this;return n.http=e,n.baseReadUrl="",n.data=[],n}return I(e,t),e.prototype.serializeParams=function(t){return t?"?"+$.param(t):""},e.prototype.read=function(e,n,r){var o=this;if(this.data.length)return t.prototype.next.call(this,this.data);var i=this.baseReadUrl;void 0===e&&(e=this.savedReadParams),e&&(i=this.baseReadUrl+""+this.serializeParams(e),this.savedReadParams=e),this.http.get(i).pipe(u.map((function(t){return t}))).subscribe((function(e){t.prototype.next.call(o,e),n&&n()}),(function(t){r&&r(t)}))},e}(l.BehaviorSubject);N.decorators=[{type:n.Injectable}],N.ctorParameters=function(){return[{type:s.HttpClient}]};var R=function(t){function e(e){var n=t.call(this,e)||this;return n.http=e,n.baseUrl="",n}return I(e,t),e.prototype.reset=function(){this.data=[]},e.prototype.resetItem=function(e){if(e){var n=this.data.find((function(t){return t.Id===e.Id}));Object.assign(n,e),t.prototype.next.call(this,this.data)}},e.prototype.save=function(t,e,n){var r=this,o=e?"add":"update";this.reset(),this.post(o,t).subscribe((function(){}),(function(){r.read()}),(function(){r.read(),n&&n()}))},e.prototype.remove=function(t,e){var n=this;this.reset(),this.post("remove",t).subscribe((function(){}),(function(){n.read()}),(function(){n.read(),e&&e()}))},e.prototype.post=function(t,e){var n=this.baseUrl+""+t+this.serializeParams(e);return this.http.post(n,e).pipe(u.map((function(t){return t})))},e}(N);R.decorators=[{type:n.Injectable}],R.ctorParameters=function(){return[{type:s.HttpClient}]};var F=function(t){function e(e){var n=t.call(this,e)||this;return n.http=e,n.baseUrl+="billing/",n}return I(e,t),e.prototype.requestNewSubscription=function(t,e,n){this.postQS("requestNewSubscription",{requestedPlan:t}).subscribe((function(t){}),(function(t){n&&n()}),(function(){e&&e()}))},e.prototype.cancelRequestedSubscription=function(t,e){this.postQS("cancelRequestedSubscription",null).subscribe((function(t){}),(function(t){e&&e()}),(function(){t&&t()}))},e.prototype.buyAccess=function(t,e,n){this.postQS("buyAccess",{requestedPlan:t}).subscribe((function(t){}),(function(t){n&&n()}),(function(){e&&e()}))},e}(P);F.decorators=[{type:n.Injectable}],F.ctorParameters=function(){return[{type:s.HttpClient}]};var k=function(){};k.decorators=[{type:n.NgModule,args:[{imports:[a.CommonModule],providers:[F]}]}];var V=function(){function t(t,e){this.appcontext=t,this.api=e,this.contextUpdated=!1,this.isUserSignedIn=!1,this.currentPlan=0,this.currentPlanTitle=""}return t.prototype.ngOnInit=function(){var t=this;this.appcontext.isUserSignedIn()?this.appcontext.getCurrent((function(e){t.isUserSignedIn=e.isUserSignedIn,t.isUserSignedIn&&(t.currentPlan=e.account.billingPlan,t.currentPlanTitle=e.account.billingPlanAsString),t.contextUpdated=!0})):this.contextUpdated=!0},t.prototype.onBuyPlan=function(){var t="Requested plan: "+this.plantitle+" ",e=this;y.AreYouSure(t,"Buying access","Confirm change","Cancel",(function(){e.api.buyAccess(e.plan,(function(){y.Success("Access Granted",null,(function(){window.location.reload()}))}))}))},t}();V.decorators=[{type:n.Component,args:[{selector:"anatoly-buyaccess-button",template:'<div *ngIf="contextUpdated">\r\n <div *ngIf="!isUserSignedIn">\r\n <anatoly-signup-button classbtn="btn btn-block btn-primary"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf="isUserSignedIn">\r\n <button class="btn btn-block btn-success selectPlan" *ngIf="plan == currentPlan">\r\n Your Plan\r\n </button>\r\n\r\n <button class="btn btn-block btn-warning selectPlan" *ngIf="plan != currentPlan && currentPlan == 1" (click)="onBuyPlan()">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n'}]}],V.ctorParameters=function(){return[{type:E},{type:F}]},V.propDecorators={plan:[{type:n.Input}],plantitle:[{type:n.Input}]};var M=function(){function t(t){this.appcontext=t,this.contextUpdated=!1,this.isUserSignedIn=!1,this.currentPlan=0,this.currentPlanTitle="",this.requestedPlan=0,this.requestedPlanTitle=""}return t.prototype.ngOnInit=function(){var t=this;this.appcontext.isUserSignedIn()?this.appcontext.getCurrent((function(e){t.isUserSignedIn=e.isUserSignedIn,t.isUserSignedIn&&(t.currentPlan=e.account.billingPlan,t.currentPlanTitle=e.account.billingPlanAsString,t.requestedPlan=e.account.requestedBillingPlan,t.requestedPlanTitle=e.account.requestedBillingPlanAsString),t.contextUpdated=!0})):this.contextUpdated=!0},t}();M.decorators=[{type:n.Component,args:[{selector:"anatoly-subscribe-plan-button",template:'<div *ngIf="contextUpdated">\r\n <div *ngIf="!isUserSignedIn">\r\n <anatoly-signup-button classbtn="btn btn-block btn-primary"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf="isUserSignedIn">\r\n <button class="btn btn-block btn-success selectPlan" *ngIf="plan == currentPlan">\r\n Your Plan\r\n </button>\r\n\r\n <button class="btn btn-block btn-warning selectPlan" *ngIf="requestedPlan != null && requestedPlan != 0 && plan == requestedPlan">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf="plan != currentPlan && plan != requestedPlan"\r\n [currentplantitle]="currentPlanTitle"\r\n [requestedplan]=plan\r\n [requestedplantitle]="plantitle">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n'}]}],M.ctorParameters=function(){return[{type:E}]},M.propDecorators={plan:[{type:n.Input}],plantitle:[{type:n.Input}]};var G=function(){function t(t){this.api=t}return t.prototype.onUpgradePlan=function(){var t="Current plan: "+this.currentplantitle+" New plan: "+this.requestedplantitle,e=this;y.AreYouSure(t,"Change billing plan","Confirm change","Cancel",(function(){e.api.requestNewSubscription(e.requestedplan,(function(){y.Success("Your request for changing plan has been sent.",null,(function(){window.location.reload()}))}))}))},t}();G.decorators=[{type:n.Component,args:[{selector:"anatoly-upgrade-plan-button",template:'<button class="btn btn-block btn-primary" (click)="onUpgradePlan()">\r\n Upgrade\r\n</button>\r\n'}]}],G.ctorParameters=function(){return[{type:F}]},G.propDecorators={currentplantitle:[{type:n.Input}],requestedplan:[{type:n.Input}],requestedplantitle:[{type:n.Input}]};var H=function(){};H.decorators=[{type:n.Component,args:[{selector:"anatoly-signin-button",template:'<a href="identity/signIn" class="{{classbtn}}">Sign In</a>\r\n'}]}],H.ctorParameters=function(){return[]},H.propDecorators={classbtn:[{type:n.Input}]};var K=function(){};K.decorators=[{type:n.Component,args:[{selector:"anatoly-signout-button",template:'<a href="identity/signOut" class="{{classbtn}}">Sign Out</a>\r\n'}]}],K.ctorParameters=function(){return[]},K.propDecorators={classbtn:[{type:n.Input}]};var _=function(){};_.decorators=[{type:n.Component,args:[{selector:"anatoly-signup-button",template:'<a href="identity/signup" class="{{classbtn}}">Sign Up</a>\r\n'}]}],_.propDecorators={classbtn:[{type:n.Input}]};var Q=function(){function t(){}return t.prototype.ngOnInit=function(){null==this.title&&(this.title="")},t}();Q.decorators=[{type:n.Component,args:[{selector:"anatoly-content-header",template:'<h2 class="page-header">\r\n {{title}}\r\n \x3c!--<small>Optional {{title}}</small>--\x3e\r\n</h2>\r\n'}]}],Q.propDecorators={title:[{type:n.Input}]};var Y=function(){function t(){}return t.prototype.getQSId=function(){var t=D.getValueByNameInQS("id");return void 0===t||""==t?null:t},t}(),W=function(t){function e(){var e=t.call(this)||this;return e.formSubmitted=!1,e}return I(e,t),e.prototype.isActionAdding=function(){var t=D.getValueByNameInQS("id");return void 0===t||""==t},e.prototype.getEntityId=function(){return this.getQSId()},e.prototype.isControlValid=function(t,e){return void 0===e&&(e=null),!this.isControlInvalid(t,e)},e.prototype.isControlInvalid=function(t,e){if(void 0===e&&(e=null),void 0===t||""==t)return!1;var n=e||this.formGroup;return!!n&&(!!n.get(t)&&(this.formSubmitted&&n.get(t).invalid||n.get(t).touched&&n.get(t).invalid))},e.prototype.getFormValue=function(t,e){return void 0===e&&(e=null),(e||this.formGroup).controls[t].value},e.prototype.setFormValue=function(t,e,n){void 0===n&&(n=null),(n||this.formGroup).controls[t].setValue(e)},e.prototype.getFormGroupValue=function(t,e,n){return void 0===n&&(n=null),(n||this.formGroup).controls[t].get(e).value},e.prototype.setFormGroupValue=function(t,e,n,r){void 0===r&&(r=null),(r||this.formGroup).controls[t].get(e).setValue(n)},e}(Y);W.propDecorators={formGroup:[{type:n.Input}],formSubmitted:[{type:n.Input}]};var J={placeholderText:"Edit Your Content Here",charCounterCount:!0,heightMin:100,toolbarInline:!1,toolbarButtons:{moreText:{buttons:["bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","backgroundColor","inlineClass","inlineStyle"]},moreParagraph:{buttons:["alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"]},moreRich:{buttons:["insertLink","insertImage","insertTable","emoticons","fontAwesome","specialCharacters","embedly"]},moreMisc:{buttons:["selectAll","clearFormatting","html","undo","redo","fullscreen"],align:"right"}},imageUploadURL:"/api/HtmlEditor/UploadImage",imageAllowedTypes:["jpeg","jpg","png"],imageUploadParams:{uploadType:"",uploadParentId:""}},X=function(t){function e(){var e=t.call(this)||this;return e.froalaEditorInitialized=!1,e.afterInitializedActions=[],e.editorLabelText="Html",e.editorOptions={},e}return I(e,t),e.prototype.ngOnInit=function(){var t=this.editorOptions;"string"==typeof this.editorOptions&&(t=JSON.parse(this.editorOptions));var e=$.extend({},J,t),n=g.froalaEditorKey;n&&(e=$.extend({},e,JSON.parse('{ "key": "'+n+'" }'))),e.events&&e.events.initialized&&(e.events.initialized.overridden=!1),this.options=e},e.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.froalaEditorInitialized=!0,t.onInitialized()}),300)},e.prototype.onInitialized=function(){var t=this.afterInitializedActions;if(this.afterInitializedActions=[],t)for(var e=0;e<t.length;e++)t[e]()},e.prototype.getEditor=function(){return this.froalaEditor?this.froalaEditor.getEditor():null},e.prototype.doAfterInitialized=function(t){var e=this;this.froalaEditorInitialized?t(e):this.afterInitializedActions.push((function(){t(e)}))},e.prototype.initializeControl=function(t){this.froalaEditor=t,this.froalaEditor.initialize()},e.prototype.setUploadParams=function(t,e){this.doAfterInitialized((function(n){var r=n.getEditor();void 0!==r&&null!=r&&(r.opts.imageUploadParams.uploadType=t,r.opts.imageUploadParams.uploadParentId=e)}))},e}(W);X.propDecorators={editorLabelText:[{type:n.Input}],editorOptions:[{type:n.Input}]};var Z=function(t){function e(){return t.call(this)||this}return I(e,t),e.prototype.setHtml=function(t){this.doAfterInitialized((function(e){var n=e.getEditor();void 0!==n&&null!=n&&n.html.set(t)}))},e.prototype.getHtml=function(){var t=this.getEditor();if(void 0!==t&&null!=t)return t.html.get(!1)},e}(X);Z.decorators=[{type:n.Component,args:[{selector:"anatoly-html-editor",template:'<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]="options" (froalaInit)="initializeControl($event)">\r\n </textarea>\r\n</div>'}]}],Z.ctorParameters=function(){return[]};var tt=function(t){function e(){var e=t.call(this)||this;return e.editorFormKey="html",e}return I(e,t),e.prototype.setFormValueAfterInitialized=function(t,e){this.doAfterInitialized((function(n){n.setFormValue(t,e)}))},e}(X);tt.decorators=[{type:n.Component,args:[{selector:"anatoly-forms-html-editor",template:'<div [formGroup]="formGroup">\r\n <div class="form-group" [ngClass]="{\'has-error\': isControlInvalid(editorFormKey) }">\r\n <label class="control-label">{{ editorLabelText }}</label>\r\n <textarea [formControlName]="editorFormKey"\r\n [froalaEditor]="options" (froalaInit)="initializeControl($event)">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]="formGroup"\r\n [formSubmitted]="formSubmitted"\r\n [controlName]="editorFormKey"\r\n [controlTitle]="editorLabelText">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n'}]}],tt.ctorParameters=function(){return[]},tt.propDecorators={editorFormKey:[{type:n.Input}]};var et=function(t){function e(){return t.call(this)||this}return I(e,t),e.prototype.getFormValidationMessages=function(){var t=this,e=[];return Object.keys(this.formGroup.controls).forEach((function(n){var r=t.formGroup.controls[n];null!=r.controls?Object.keys(r.controls).forEach((function(n){var o=r.controls[n];t.getValidationMessages(o,t.getControlName(o,n)).forEach((function(t){return e.push(t)}))})):t.getValidationMessages(r,t.getControlName(r,n)).forEach((function(t){return e.push(t)}))})),e},e.prototype.getValidationMessages=function(t,e){var n=t.path||e,r=[];if(t.errors)for(var o in t.errors)if(t.errors.hasOwnProperty(o))switch(o){case"required":r.push(n+" is required");break;case"minlength":r.push(n+" must be at least "+t.errors.minlength.requiredLength+" characters");break;case"pattern":r.push(n+" contains illegal characters");break;case"format":r.push(n+" format mismatch");break;case"maxlength":r.push(n+" must have maximum "+t.errors.maxlength.requiredLength+" characters");break;case"specialcharacters":r.push(n+" contains special characters")}return r},e.prototype.getControlName=function(t,e){var n=this.getControlTitle(t);return n||e},e.prototype.getControlTitle=function(t){if(null==t?void 0:t.nativeElement){var e=this.getTitleAttribute(t.nativeElement);if(e)return e}},e.prototype.getTitleAttribute=function(t){var e,n,r,o,i,a,s;switch(t.tagName){case"KENDO-TIMEPICKER":case"KENDO-DATEPICKER":s=null===(o=null===(r=null===(n=null===(e=t.children[0])||void 0===e?void 0:e.children[0])||void 0===n?void 0:n.children[0])||void 0===r?void 0:r.children[0])||void 0===o?void 0:o.getAttribute("title");break;case"KENDO-NUMERICTEXTBOX":s=null===(a=null===(i=t.children[0])||void 0===i?void 0:i.children[0])||void 0===a?void 0:a.getAttribute("title");break;default:s=t.getAttribute("title")}return s},e}(W),nt=function(t){function e(){var e=t.call(this)||this;return e.visible=!1,e.customerrors=[],e.viewtype=0,e}return I(e,t),e.prototype.getErrors=function(){if(1==this.viewtype)return this.customerrors;var t=this.getFormValidationMessages();if(0==this.viewtype)return t;var e=[];return t.length>0&&e.push.apply(e,C(t)),this.customerrors.length>0&&e.push.apply(e,C(this.customerrors)),e},e}(et);nt.decorators=[{type:n.Component,args:[{selector:"anatoly-form-validation-summary",template:'<div class="callout callout-danger" *ngIf="visible">\r\n <h6 class="box-title">There are problems with the form</h6>\r\n <ul>\r\n <li *ngFor="let error of getErrors()"><span>{{error}}</span></li>\r\n </ul>\r\n</div>\r\n\r\n'}]}],nt.ctorParameters=function(){return[]},nt.propDecorators={visible:[{type:n.Input}],customerrors:[{type:n.Input}],viewtype:[{type:n.Input}]};var rt=function(t){function e(){return t.call(this)||this}return I(e,t),e}(et);rt.decorators=[{type:n.Component,args:[{selector:"anatoly-item-validation-summary",template:'<ul class="list-unstyled" *ngIf="isControlInvalid(controlName)">\r\n <li *ngFor="let error of getValidationMessages(formGroup.get(controlName), controlTitle)">\r\n <span class="help-block">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n'}]}],rt.ctorParameters=function(){return[]},rt.propDecorators={controlName:[{type:n.Input}],controlTitle:[{type:n.Input}]};var ot=function(){function t(t,e){this.el=t,this.control=e}return t.prototype.ngOnInit=function(){this.control.control.nativeElement=this.el.nativeElement},t}();ot.decorators=[{type:n.Directive,args:[{selector:"[formControl], [formControlName]"}]}],ot.ctorParameters=function(){return[{type:n.ElementRef},{type:d.NgControl}]};var it=f.FroalaEditorModule.forRoot(),at=f.FroalaViewModule.forRoot(),st=function(){};st.decorators=[{type:n.NgModule,args:[{imports:[a.CommonModule,d.ReactiveFormsModule,d.FormsModule,it,at],exports:[M,G,V,H,_,K,nt,rt,Z,tt,Q,ot],declarations:[M,G,V,H,_,K,nt,rt,Z,tt,Q,ot]}]}],t.Alerts=y,t.AnatolyCoreModule=A,t.AnatolyDataModule=k,t.AnatolyHttpInterceptor=L,t.AnatolyUIModule=st,t.AppContextService=E,t.AppCoreSettings=g,t.BaseApiService=P,t.BaseComponent=Y,t.BaseEditComponent=W,t.BaseGoService=q,t.BaseGridEditService=R,t.BaseGridReadService=N,t.BillingApiService=F,t.BuyAccessButtonComponent=V,t.ContentHeaderComponent=Q,t.ContextInitState=h,t.FormValidationSummaryComponent=nt,t.FormsHtmlEditorComponent=tt,t.GlobalErrorHandler=z,t.Guid=j,t.HtmlEditorComponent=Z,t.ItemValidationSummaryComponent=rt,t.LoadingService=U,t.LoggingService=w,t.NativeElementDirective=ot,t.SignInButtonComponent=H,t.SignOutButtonComponent=K,t.SignUpButtonComponent=_,t.Subs=B,t.SubscribePlanButtonComponent=M,t.UpgradePlanButtonComponent=G,t.Utils=D,t.ValidationSummaryComponent=et,t.throwIfAlreadyLoaded=m,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
17
17
|
//# sourceMappingURL=osovitny-anatoly.umd.min.js.map
|