ngx-freshchat
Advanced tools
Comparing version 0.0.3 to 0.0.4
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators')) : | ||
typeof define === 'function' && define.amd ? define('ngx-freshchat', ['exports', '@angular/core', 'rxjs', 'rxjs/operators'], factory) : | ||
(factory((global['ngx-freshchat'] = {}),global.ng.core,global.rxjs,global.rxjs.operators)); | ||
}(this, (function (exports,i0,rxjs,operators) { 'use strict'; | ||
(global = global || self, factory(global['ngx-freshchat'] = {}, global.ng.core, global.rxjs, global.rxjs.operators)); | ||
}(this, function (exports, core, rxjs, operators) { 'use strict'; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
var NgxFreshChatService = (function () { | ||
var NgxFreshChatService = /** @class */ (function () { | ||
function NgxFreshChatService() { | ||
@@ -22,8 +22,13 @@ } | ||
*/ | ||
function (data) { | ||
var _this = this; | ||
return this.loadScript('https://wchat.freshchat.com/js/widget.js') | ||
.pipe(operators.first(), operators.flatMap(function (res) { return _this.initWidget(data); })); | ||
}; | ||
function (data) { | ||
var _this = this; | ||
return this.loadScript('https://wchat.freshchat.com/js/widget.js') | ||
.pipe(operators.first(), operators.flatMap((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { return _this.initWidget(data); }))); | ||
}; | ||
/** | ||
* @private | ||
* @param {?} data | ||
@@ -33,12 +38,21 @@ * @return {?} | ||
NgxFreshChatService.prototype.initWidget = /** | ||
* @private | ||
* @param {?} data | ||
* @return {?} | ||
*/ | ||
function (data) { | ||
var _this = this; | ||
return rxjs.Observable.create(function (observer) { | ||
_this.getWidget().on('widget:loaded', function (res) { return observer.next(res); }); | ||
_this.getWidget().init(data); | ||
}); | ||
}; | ||
function (data) { | ||
var _this = this; | ||
return rxjs.Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().on('widget:loaded', (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { return observer.next(res); })); | ||
_this.getWidget().init(data); | ||
})); | ||
}; | ||
/** | ||
@@ -50,15 +64,23 @@ * @return {?} | ||
*/ | ||
function () { | ||
var _this = this; | ||
return rxjs.Observable.create(function (observer) { | ||
_this.getWidget().user.get(function (res) { | ||
if (res.status !== 200) { | ||
observer.error(res.status); | ||
} | ||
else { | ||
observer.next(res.data); | ||
} | ||
}); | ||
}); | ||
}; | ||
function () { | ||
var _this = this; | ||
return rxjs.Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.get((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
observer.error(res.status); | ||
} | ||
else { | ||
observer.next(res.data); | ||
} | ||
})); | ||
})); | ||
}; | ||
/** | ||
@@ -72,15 +94,23 @@ * @param {?} user | ||
*/ | ||
function (user) { | ||
var _this = this; | ||
return rxjs.Observable.create(function (observer) { | ||
_this.getWidget().user.setProperties(user, function (res) { | ||
if (res.status !== 200) { | ||
observer.error(res.status); | ||
} | ||
else { | ||
observer.next(res.data || null); | ||
} | ||
}); | ||
}); | ||
}; | ||
function (user) { | ||
var _this = this; | ||
return rxjs.Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.setProperties(user, (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
observer.error(res.status); | ||
} | ||
else { | ||
observer.next(res.data || null); | ||
} | ||
})); | ||
})); | ||
}; | ||
/** | ||
@@ -94,5 +124,5 @@ * @param {?} user | ||
*/ | ||
function (user) { | ||
this.getWidget().user.update(user); | ||
}; | ||
function (user) { | ||
this.getWidget().user.update(user); | ||
}; | ||
/** | ||
@@ -104,15 +134,23 @@ * @return {?} | ||
*/ | ||
function () { | ||
var _this = this; | ||
return rxjs.Observable.create(function (observer) { | ||
_this.getWidget().user.clear(function (res) { | ||
if (res.status !== 200) { | ||
observer.error(res.status); | ||
} | ||
else { | ||
observer.next(res.data || null); | ||
} | ||
}); | ||
}); | ||
}; | ||
function () { | ||
var _this = this; | ||
return rxjs.Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.clear((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
observer.error(res.status); | ||
} | ||
else { | ||
observer.next(res.data || null); | ||
} | ||
})); | ||
})); | ||
}; | ||
/** | ||
@@ -128,5 +166,5 @@ * @param {?} eventName | ||
*/ | ||
function (eventName, payload) { | ||
this.getWidget().track(eventName, payload); | ||
}; | ||
function (eventName, payload) { | ||
this.getWidget().track(eventName, payload); | ||
}; | ||
/** | ||
@@ -140,5 +178,5 @@ * @param {?} tags | ||
*/ | ||
function (tags) { | ||
this.getWidget().setTags(tags); | ||
}; | ||
function (tags) { | ||
this.getWidget().setTags(tags); | ||
}; | ||
/** | ||
@@ -152,5 +190,5 @@ * @param {?} locale | ||
*/ | ||
function (locale) { | ||
this.getWidget().setLocale(locale); | ||
}; | ||
function (locale) { | ||
this.getWidget().setLocale(locale); | ||
}; | ||
/** | ||
@@ -162,5 +200,5 @@ * @return {?} | ||
*/ | ||
function () { | ||
this.getWidget().destroy(); | ||
}; | ||
function () { | ||
this.getWidget().destroy(); | ||
}; | ||
/** | ||
@@ -172,15 +210,18 @@ * @return {?} | ||
*/ | ||
function () { | ||
return this.getWidget().isInitialized(); | ||
}; | ||
function () { | ||
return this.getWidget().isInitialized(); | ||
}; | ||
/** | ||
* @private | ||
* @return {?} | ||
*/ | ||
NgxFreshChatService.prototype.getWidget = /** | ||
* @private | ||
* @return {?} | ||
*/ | ||
function () { | ||
return ((window)).fcWidget; | ||
}; | ||
function () { | ||
return ((/** @type {?} */ (window))).fcWidget; | ||
}; | ||
/** | ||
* @private | ||
* @param {?} src | ||
@@ -190,41 +231,50 @@ * @return {?} | ||
NgxFreshChatService.prototype.loadScript = /** | ||
* @private | ||
* @param {?} src | ||
* @return {?} | ||
*/ | ||
function (src) { | ||
return new rxjs.Observable(function (observer) { | ||
/** @type {?} */ | ||
var scriptElement = document.createElement('script'); | ||
scriptElement.type = 'text/javascript'; | ||
scriptElement.src = src; | ||
scriptElement.onload = function () { | ||
observer.next(src); | ||
observer.complete(); | ||
}; | ||
scriptElement.onerror = function () { return observer.error('Couldn\'t load ' + src); }; | ||
document.getElementsByTagName('body')[0].appendChild(scriptElement); | ||
function (src) { | ||
return new rxjs.Observable((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
/** @type {?} */ | ||
var scriptElement = document.createElement('script'); | ||
scriptElement.type = 'text/javascript'; | ||
scriptElement.src = src; | ||
scriptElement.onload = (/** | ||
* @return {?} | ||
*/ | ||
function () { | ||
observer.next(src); | ||
observer.complete(); | ||
}); | ||
}; | ||
scriptElement.onerror = (/** | ||
* @return {?} | ||
*/ | ||
function () { return observer.error('Couldn\'t load ' + src); }); | ||
document.getElementsByTagName('body')[0].appendChild(scriptElement); | ||
})); | ||
}; | ||
NgxFreshChatService.decorators = [ | ||
{ type: i0.Injectable, args: [{ | ||
{ type: core.Injectable, args: [{ | ||
providedIn: 'root' | ||
},] }, | ||
},] } | ||
]; | ||
/** @nocollapse */ | ||
NgxFreshChatService.ctorParameters = function () { return []; }; | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = i0.defineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
return NgxFreshChatService; | ||
}()); | ||
// TODO: events | ||
// TODO: messenger API | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
var NgxFreshChatModule = (function () { | ||
var NgxFreshChatModule = /** @class */ (function () { | ||
function NgxFreshChatModule() { | ||
} | ||
NgxFreshChatModule.decorators = [ | ||
{ type: i0.NgModule, args: [{ | ||
{ type: core.NgModule, args: [{ | ||
imports: [], | ||
@@ -234,3 +284,3 @@ providers: [NgxFreshChatService], | ||
exports: [] | ||
},] }, | ||
},] } | ||
]; | ||
@@ -240,19 +290,8 @@ return NgxFreshChatModule; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
*/ | ||
exports.NgxFreshChatModule = NgxFreshChatModule; | ||
exports.NgxFreshChatService = NgxFreshChatService; | ||
exports.NgxFreshChatModule = NgxFreshChatModule; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC51bWQuanMubWFwIiwic291cmNlcyI6WyJuZzovL25neC1mcmVzaGNoYXQvbGliL25neC1mcmVzaGNoYXQtbGliLnNlcnZpY2UudHMiLCJuZzovL25neC1mcmVzaGNoYXQvbGliL25neC1mcmVzaGNoYXQtbGliLm1vZHVsZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3RhYmxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBGQ0luaXRPYmplY3QsIEZDVXNlciB9IGZyb20gJy4vbW9kZW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LEdBQUcsQ0FBQztvQkFDeEIsYUFBYSxDQUFDLE1BQU0sR0FBRzt3QkFDbkIsUUFBUSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQzt3QkFDbkIsUUFBUSxDQUFDLFFBQVEsRUFBRSxDQUFDO3FCQUN2QixDQUFDO29CQUNGLGFBQWEsQ0FBQyxPQUFPLEdBQUcsY0FBTSxPQUFBLFFBQVEsQ0FBQyxLQUFLLENBQUMsaUJBQWlCLEdBQUcsR0FBRyxDQUFDLEdBQUEsQ0FBQztvQkFDdEUsUUFBUSxDQUFDLG9CQUFvQixDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFdBQVcsQ0FBQyxhQUFhLENBQUMsQ0FBQztpQkFDckUsQ0FBQyxDQUFDOzs7b0JBdkdOQyxhQUFVLFNBQUM7d0JBQ1YsVUFBVSxFQUFFLE1BQU07cUJBQ25COzs7OztrQ0FsQkQ7Ozs7Ozs7OztBQ0FBOzs7O29CQUlDQyxXQUFRLFNBQUM7d0JBQ1IsT0FBTyxFQUFFLEVBQUU7d0JBQ1gsU0FBUyxFQUFFLENBQUUsbUJBQW1CLENBQUU7d0JBQ2xDLFlBQVksRUFBRSxFQUFFO3dCQUNoQixPQUFPLEVBQUUsRUFBRTtxQkFDWjs7aUNBVEQ7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ== | ||
})); | ||
//# sourceMappingURL=ngx-freshchat.umd.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("ngx-freshchat",["exports","@angular/core","rxjs","rxjs/operators"],e):e(t["ngx-freshchat"]={},t.ng.core,t.rxjs,t.rxjs.operators)}(this,function(t,e,n,o){"use strict";var r=function(){function t(){}return t.prototype.init=function(e){var r=this;return this.loadScript("https://wchat.freshchat.com/js/widget.js").pipe(o.first(),o.flatMap(function(t){return r.initWidget(e)}))},t.prototype.initWidget=function(t){var r=this;return n.Observable.create(function(e){r.getWidget().on("widget:loaded",function(t){return e.next(t)}),r.getWidget().init(t)})},t.prototype.getUser=function(){var t=this;return n.Observable.create(function(e){t.getWidget().user.get(function(t){200!==t.status?e.error(t.status):e.next(t.data)})})},t.prototype.setUserProperties=function(t){var r=this;return n.Observable.create(function(e){r.getWidget().user.setProperties(t,function(t){200!==t.status?e.error(t.status):e.next(t.data||null)})})},t.prototype.updateUser=function(t){this.getWidget().user.update(t)},t.prototype.clearUser=function(){var t=this;return n.Observable.create(function(e){t.getWidget().user.clear(function(t){200!==t.status?e.error(t.status):e.next(t.data||null)})})},t.prototype.track=function(t,e){this.getWidget().track(t,e)},t.prototype.setTags=function(t){this.getWidget().setTags(t)},t.prototype.setLocale=function(t){this.getWidget().setLocale(t)},t.prototype.destroy=function(){this.getWidget().destroy()},t.prototype.isInitialized=function(){return this.getWidget().isInitialized()},t.prototype.getWidget=function(){return window.fcWidget},t.prototype.loadScript=function(r){return new n.Observable(function(t){var e=document.createElement("script");e.type="text/javascript",e.src=r,e.onload=function(){t.next(r),t.complete()},e.onerror=function(){return t.error("Couldn't load "+r)},document.getElementsByTagName("body")[0].appendChild(e)})},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=e.defineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),i=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[],providers:[r],declarations:[],exports:[]}]}],t}();t.NgxFreshChatService=r,t.NgxFreshChatModule=i,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("ngx-freshchat",["exports","@angular/core","rxjs","rxjs/operators"],e):e((t=t||self)["ngx-freshchat"]={},t.ng.core,t.rxjs,t.rxjs.operators)}(this,function(t,e,r,n){"use strict";var o=function(){function t(){}return t.prototype.init=function(t){var e=this;return this.loadScript("https://wchat.freshchat.com/js/widget.js").pipe(n.first(),n.flatMap(function(r){return e.initWidget(t)}))},t.prototype.initWidget=function(t){var e=this;return r.Observable.create(function(r){e.getWidget().on("widget:loaded",function(t){return r.next(t)}),e.getWidget().init(t)})},t.prototype.getUser=function(){var t=this;return r.Observable.create(function(e){t.getWidget().user.get(function(t){200!==t.status?e.error(t.status):e.next(t.data)})})},t.prototype.setUserProperties=function(t){var e=this;return r.Observable.create(function(r){e.getWidget().user.setProperties(t,function(t){200!==t.status?r.error(t.status):r.next(t.data||null)})})},t.prototype.updateUser=function(t){this.getWidget().user.update(t)},t.prototype.clearUser=function(){var t=this;return r.Observable.create(function(e){t.getWidget().user.clear(function(t){200!==t.status?e.error(t.status):e.next(t.data||null)})})},t.prototype.track=function(t,e){this.getWidget().track(t,e)},t.prototype.setTags=function(t){this.getWidget().setTags(t)},t.prototype.setLocale=function(t){this.getWidget().setLocale(t)},t.prototype.destroy=function(){this.getWidget().destroy()},t.prototype.isInitialized=function(){return this.getWidget().isInitialized()},t.prototype.getWidget=function(){return window.fcWidget},t.prototype.loadScript=function(t){return new r.Observable(function(e){var r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=function(){e.next(t),e.complete()},r.onerror=function(){return e.error("Couldn't load "+t)},document.getElementsByTagName("body")[0].appendChild(r)})},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),i=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[],providers:[o],declarations:[],exports:[]}]}],t}();t.NgxFreshChatModule=i,t.NgxFreshChatService=o,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ngx-freshchat.umd.min.js.map |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -9,32 +9,34 @@ /** | ||
export function FCInitObject() { } | ||
/** @type {?} */ | ||
FCInitObject.prototype.token; | ||
/** @type {?} */ | ||
FCInitObject.prototype.host; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.siteId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.restoreId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.externalId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.firstName; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.lastName; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.email; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.phone; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.phoneCountryCode; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.config; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.open; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.tags; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.faqTags; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.locale; | ||
if (false) { | ||
/** @type {?} */ | ||
FCInitObject.prototype.token; | ||
/** @type {?} */ | ||
FCInitObject.prototype.host; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.siteId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.restoreId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.externalId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.firstName; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.lastName; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.email; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.phone; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.phoneCountryCode; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.config; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.open; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.tags; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.faqTags; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.locale; | ||
} | ||
/** | ||
@@ -44,15 +46,16 @@ * @record | ||
export function FCUser() { } | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.firstName; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.lastName; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.email; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.phone; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.phoneCountryCode; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.externalId; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kZWxzLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWZyZXNoY2hhdC8iLCJzb3VyY2VzIjpbImxpYi9tb2RlbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgRkNJbml0T2JqZWN0IHtcbiAgICB0b2tlbjogc3RyaW5nO1xuICAgIGhvc3Q6IHN0cmluZztcbiAgICBzaXRlSWQ/OiBzdHJpbmc7XG4gICAgcmVzdG9yZUlkPzogc3RyaW5nO1xuICAgIGV4dGVybmFsSWQ/OiBzdHJpbmc7XG4gICAgZmlyc3ROYW1lPzogc3RyaW5nO1xuICAgIGxhc3ROYW1lPzogc3RyaW5nO1xuICAgIGVtYWlsPzogc3RyaW5nO1xuICAgIHBob25lPzogc3RyaW5nO1xuICAgIHBob25lQ291bnRyeUNvZGU/OiBzdHJpbmc7XG4gICAgY29uZmlnPzogYW55O1xuICAgIG9wZW4/OiBib29sZWFuO1xuICAgIHRhZ3M/OiBbc3RyaW5nXTtcbiAgICBmYXFUYWdzPzogYW55O1xuICAgIGxvY2FsZT86IHN0cmluZztcbn1cblxuZXhwb3J0IGludGVyZmFjZSBGQ1VzZXIge1xuICAgIGZpcnN0TmFtZT86IHN0cmluZztcbiAgICBsYXN0TmFtZT86IHN0cmluZztcbiAgICBlbWFpbD86IHN0cmluZztcbiAgICBwaG9uZT86IHN0cmluZztcbiAgICBwaG9uZUNvdW50cnlDb2RlPzogc3RyaW5nO1xuICAgIGV4dGVybmFsSWQ/OiBzdHJpbmc7XG59XG4iXX0= | ||
if (false) { | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.firstName; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.lastName; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.email; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.phone; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.phoneCountryCode; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.externalId; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kZWxzLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWZyZXNoY2hhdC8iLCJzb3VyY2VzIjpbImxpYi9tb2RlbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUFBLGtDQWdCQzs7O0lBZkcsNkJBQWM7O0lBQ2QsNEJBQWE7O0lBQ2IsOEJBQWdCOztJQUNoQixpQ0FBbUI7O0lBQ25CLGtDQUFvQjs7SUFDcEIsaUNBQW1COztJQUNuQixnQ0FBa0I7O0lBQ2xCLDZCQUFlOztJQUNmLDZCQUFlOztJQUNmLHdDQUEwQjs7SUFDMUIsOEJBQWE7O0lBQ2IsNEJBQWU7O0lBQ2YsNEJBQWdCOztJQUNoQiwrQkFBYzs7SUFDZCw4QkFBZ0I7Ozs7O0FBR3BCLDRCQU9DOzs7SUFORywyQkFBbUI7O0lBQ25CLDBCQUFrQjs7SUFDbEIsdUJBQWU7O0lBQ2YsdUJBQWU7O0lBQ2Ysa0NBQTBCOztJQUMxQiw0QkFBb0IiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZDSW5pdE9iamVjdCB7XG4gICAgdG9rZW46IHN0cmluZztcbiAgICBob3N0OiBzdHJpbmc7XG4gICAgc2l0ZUlkPzogc3RyaW5nO1xuICAgIHJlc3RvcmVJZD86IHN0cmluZztcbiAgICBleHRlcm5hbElkPzogc3RyaW5nO1xuICAgIGZpcnN0TmFtZT86IHN0cmluZztcbiAgICBsYXN0TmFtZT86IHN0cmluZztcbiAgICBlbWFpbD86IHN0cmluZztcbiAgICBwaG9uZT86IHN0cmluZztcbiAgICBwaG9uZUNvdW50cnlDb2RlPzogc3RyaW5nO1xuICAgIGNvbmZpZz86IGFueTtcbiAgICBvcGVuPzogYm9vbGVhbjtcbiAgICB0YWdzPzogW3N0cmluZ107XG4gICAgZmFxVGFncz86IGFueTtcbiAgICBsb2NhbGU/OiBzdHJpbmc7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgRkNVc2VyIHtcbiAgICBmaXJzdE5hbWU/OiBzdHJpbmc7XG4gICAgbGFzdE5hbWU/OiBzdHJpbmc7XG4gICAgZW1haWw/OiBzdHJpbmc7XG4gICAgcGhvbmU/OiBzdHJpbmc7XG4gICAgcGhvbmVDb3VudHJ5Q29kZT86IHN0cmluZztcbiAgICBleHRlcm5hbElkPzogc3RyaW5nO1xufVxuIl19 |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -15,5 +15,4 @@ import { NgModule } from '@angular/core'; | ||
exports: [] | ||
},] }, | ||
},] } | ||
]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC1saWIubW9kdW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BQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFTbEUsTUFBTSxPQUFPLGtCQUFrQjs7O1lBTjlCLFFBQVEsU0FBQztnQkFDUixPQUFPLEVBQUUsRUFBRTtnQkFDWCxTQUFTLEVBQUUsQ0FBRSxtQkFBbUIsQ0FBRTtnQkFDbEMsWUFBWSxFQUFFLEVBQUU7Z0JBQ2hCLE9BQU8sRUFBRSxFQUFFO2FBQ1oiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgTmd4RnJlc2hDaGF0U2VydmljZSB9IGZyb20gJy4vbmd4LWZyZXNoY2hhdC1saWIuc2VydmljZSc7XG5cblxuQE5nTW9kdWxlKHtcbiAgaW1wb3J0czogW10sXG4gIHByb3ZpZGVyczogWyBOZ3hGcmVzaENoYXRTZXJ2aWNlIF0sXG4gIGRlY2xhcmF0aW9uczogW10sXG4gIGV4cG9ydHM6IFtdXG59KVxuZXhwb3J0IGNsYXNzIE5neEZyZXNoQ2hhdE1vZHVsZSB7IH1cbiJdfQ== |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -13,18 +13,20 @@ import { Injectable } from '@angular/core'; | ||
function FCWidget() { } | ||
/** @type {?} */ | ||
FCWidget.prototype.init; | ||
/** @type {?} */ | ||
FCWidget.prototype.user; | ||
/** @type {?} */ | ||
FCWidget.prototype.track; | ||
/** @type {?} */ | ||
FCWidget.prototype.setTags; | ||
/** @type {?} */ | ||
FCWidget.prototype.setLocale; | ||
/** @type {?} */ | ||
FCWidget.prototype.destroy; | ||
/** @type {?} */ | ||
FCWidget.prototype.isInitialized; | ||
/** @type {?} */ | ||
FCWidget.prototype.on; | ||
if (false) { | ||
/** @type {?} */ | ||
FCWidget.prototype.init; | ||
/** @type {?} */ | ||
FCWidget.prototype.user; | ||
/** @type {?} */ | ||
FCWidget.prototype.track; | ||
/** @type {?} */ | ||
FCWidget.prototype.setTags; | ||
/** @type {?} */ | ||
FCWidget.prototype.setLocale; | ||
/** @type {?} */ | ||
FCWidget.prototype.destroy; | ||
/** @type {?} */ | ||
FCWidget.prototype.isInitialized; | ||
/** @type {?} */ | ||
FCWidget.prototype.on; | ||
} | ||
export class NgxFreshChatService { | ||
@@ -38,5 +40,10 @@ constructor() { } | ||
return this.loadScript('https://wchat.freshchat.com/js/widget.js') | ||
.pipe(first(), flatMap(res => this.initWidget(data))); | ||
.pipe(first(), flatMap((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => this.initWidget(data)))); | ||
} | ||
/** | ||
* @private | ||
* @param {?} data | ||
@@ -46,6 +53,14 @@ * @return {?} | ||
initWidget(data) { | ||
return Observable.create(observer => { | ||
this.getWidget().on('widget:loaded', res => observer.next(res)); | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
observer => { | ||
this.getWidget().on('widget:loaded', (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => observer.next(res))); | ||
this.getWidget().init(data); | ||
}); | ||
})); | ||
} | ||
@@ -56,4 +71,12 @@ /** | ||
getUser() { | ||
return Observable.create(observer => { | ||
this.getWidget().user.get(res => { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
observer => { | ||
this.getWidget().user.get((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => { | ||
if (res.status !== 200) { | ||
@@ -65,4 +88,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
} | ||
@@ -74,4 +97,12 @@ /** | ||
setUserProperties(user) { | ||
return Observable.create(observer => { | ||
this.getWidget().user.setProperties(user, res => { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
observer => { | ||
this.getWidget().user.setProperties(user, (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => { | ||
if (res.status !== 200) { | ||
@@ -83,4 +114,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
} | ||
@@ -98,4 +129,12 @@ /** | ||
clearUser() { | ||
return Observable.create(observer => { | ||
this.getWidget().user.clear(res => { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
observer => { | ||
this.getWidget().user.clear((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => { | ||
if (res.status !== 200) { | ||
@@ -107,4 +146,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
} | ||
@@ -146,8 +185,10 @@ /** | ||
/** | ||
* @private | ||
* @return {?} | ||
*/ | ||
getWidget() { | ||
return (/** @type {?} */ (window)).fcWidget; | ||
return ((/** @type {?} */ (window))).fcWidget; | ||
} | ||
/** | ||
* @private | ||
* @param {?} src | ||
@@ -157,3 +198,7 @@ * @return {?} | ||
loadScript(src) { | ||
return new Observable((observer) => { | ||
return new Observable((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
(observer) => { | ||
/** @type {?} */ | ||
@@ -163,9 +208,15 @@ const scriptElement = document.createElement('script'); | ||
scriptElement.src = src; | ||
scriptElement.onload = () => { | ||
scriptElement.onload = (/** | ||
* @return {?} | ||
*/ | ||
() => { | ||
observer.next(src); | ||
observer.complete(); | ||
}; | ||
scriptElement.onerror = () => observer.error('Couldn\'t load ' + src); | ||
}); | ||
scriptElement.onerror = (/** | ||
* @return {?} | ||
*/ | ||
() => observer.error('Couldn\'t load ' + src)); | ||
document.getElementsByTagName('body')[0].appendChild(scriptElement); | ||
}); | ||
})); | ||
} | ||
@@ -176,10 +227,7 @@ } | ||
providedIn: 'root' | ||
},] }, | ||
},] } | ||
]; | ||
/** @nocollapse */ | ||
NgxFreshChatService.ctorParameters = () => []; | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = i0.defineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
// TODO: events | ||
// TODO: messenger API | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC1saWIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1mcmVzaGNoYXQvIiwic291cmNlcyI6WyJsaWIvbmd4LWZyZXNoY2hhdC1saWIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUzQyxPQUFPLEVBQUUsVUFBVSxFQUFZLE1BQU0sTUFBTSxDQUFDO0FBQzVDLE9BQU8sRUFBRSxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFnQmhELE1BQU07SUFFSixpQkFBZ0I7Ozs7O0lBRWhCLElBQUksQ0FBQyxJQUFrQjtRQUNyQixNQUFNLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQywwQ0FBMEMsQ0FBQzthQUMvRCxJQUFJLENBQ0gsS0FBSyxFQUFFLEVBQ1AsT0FBTyxDQUFFLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUN2QyxDQUFDO0tBQ0w7Ozs7O0lBRU8sVUFBVSxDQUFDLElBQUk7UUFDckIsTUFBTSxDQUFDLFVBQVUsQ0FBQyxNQUFNLENBQUUsUUFBUSxDQUFDLEVBQUU7WUFDbkMsSUF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YXRlIGdldFdpZGdldCgpOiBGQ1dpZGdldCB7XG4gICAgcmV0dXJuICh3aW5kb3cgYXMgYW55KS5mY1dpZGdldDtcbiAgfVxuXG4gIHByaXZhdGUgbG9hZFNjcmlwdChzcmM6IHN0cmluZyk6IE9ic2VydmFibGUgPGFueT4ge1xuICAgIHJldHVybiBuZXcgT2JzZXJ2YWJsZTxhbnk+KChvYnNlcnZlcjogT2JzZXJ2ZXI8YW55PikgPT4ge1xuICAgICAgY29uc3Qgc2NyaXB0RWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ3NjcmlwdCcpO1xuICAgICAgc2NyaXB0RWxlbWVudC50eXBlID0gJ3RleHQvamF2YXNjcmlwdCc7XG4gICAgICBzY3JpcHRFbGVtZW50LnNyYyA9IHNyYztcbiAgICAgIHNjcmlwdEVsZW1lbnQub25sb2FkID0gKCkgPT4ge1xuICAgICAgICAgIG9ic2VydmVyLm5leHQoc3JjKTtcbiAgICAgICAgICBvYnNlcnZlci5jb21wbGV0ZSgpO1xuICAgICAgfTtcbiAgICAgIHNjcmlwdEVsZW1lbnQub25lcnJvciA9ICgpID0+IG9ic2VydmVyLmVycm9yKCdDb3VsZG5cXCd0IGxvYWQgJyArIHNyYyk7XG4gICAgICBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgnYm9keScpWzBdLmFwcGVuZENoaWxkKHNjcmlwdEVsZW1lbnQpO1xuICAgIH0pO1xuICB9XG5cbn1cblxuLy8gVE9ETzogZXZlbnRzXG4vLyBUT0RPOiBtZXNzZW5nZXIgQVBJXG5cbiJdfQ== | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC1saWIuc2VydmljZS5qcyI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IubmV4dChyZXMpICk7XG4gICAgICB0aGlzLmdldFdpZGdldCgpLmluaXQoZGF0YSk7XG4gICAgfSk7XG4gIH1cblxuICBnZXRVc2VyKCk6IE9ic2VydmFibGU8YW55PiB7XG4gICAgcmV0dXJuIE9ic2VydmFibGUuY3JlYXRlKCBvYnNlcnZlciA9PiB7XG4gICAgICB0aGlzLmdldFdpZGdldCgpLnVzZXIuZ2V0KFxuICAgICAgICByZXMgPT4ge1xuICAgICAgICAgIGlmIChyZXMuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgIG9ic2VydmVyLmVycm9yKHJlcy5zdGF0dXMpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYnNlcnZlci5uZXh0KHJlcy5kYXRhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICk7XG4gICAgfSk7XG4gIH1cblxuICBzZXRVc2VyUHJvcGVydGllcyh1c2VyOiBGQ1VzZXIpOiBPYnNlcnZhYmxlPGFueT4ge1xuICAgIHJldHVybiBPYnNlcnZhYmxlLmNyZWF0ZSggb2JzZXJ2ZXIgPT4ge1xuICAgICAgdGhpcy5nZXRXaWRnZXQoKS51c2VyLnNldFByb3BlcnRpZXModXNlcixcbiAgICAgICAgcmVzID0+IHtcbiAgICAgICAgICBpZiAocmVzLnN0YXR1cyAhPT0gMjAwKSB7XG4gICAgICAgICAgICBvYnNlcnZlci5lcnJvcihyZXMuc3RhdHVzKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb2JzZXJ2ZXIubmV4dChyZXMuZGF0YSB8fCBudWxsKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICk7XG4gICAgfSk7XG4gIH1cblxuICB1cGRhdGVVc2VyKHVzZXI6IEZDVXNlcikge1xuICAgIHRoaXMuZ2V0V2lkZ2V0KCkudXNlci51cGRhdGUodXNlcik7XG4gIH1cblxuICBjbGVhclVzZXIoKTogT2JzZXJ2YWJsZTx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ICByZXR1cm4gbmV3IE9ic2VydmFibGU8YW55Pigob2JzZXJ2ZXI6IE9ic2VydmVyPGFueT4pID0+IHtcbiAgICAgIGNvbnN0IHNjcmlwdEVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzY3JpcHQnKTtcbiAgICAgIHNjcmlwdEVsZW1lbnQudHlwZSA9ICd0ZXh0L2phdmFzY3JpcHQnO1xuICAgICAgc2NyaXB0RWxlbWVudC5zcmMgPSBzcmM7XG4gICAgICBzY3JpcHRFbGVtZW50Lm9ubG9hZCA9ICgpID0+IHtcbiAgICAgICAgICBvYnNlcnZlci5uZXh0KHNyYyk7XG4gICAgICAgICAgb2JzZXJ2ZXIuY29tcGxldGUoKTtcbiAgICAgIH07XG4gICAgICBzY3JpcHRFbGVtZW50Lm9uZXJyb3IgPSAoKSA9PiBvYnNlcnZlci5lcnJvcignQ291bGRuXFwndCBsb2FkICcgKyBzcmMpO1xuICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2JvZHknKVswXS5hcHBlbmRDaGlsZChzY3JpcHRFbGVtZW50KTtcbiAgICB9KTtcbiAgfVxuXG59XG5cbi8vIFRPRE86IGV2ZW50c1xuLy8gVE9ETzogbWVzc2VuZ2VyIEFQSVxuXG4iXX0= |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -9,3 +9,2 @@ /** | ||
export { NgxFreshChatService, NgxFreshChatModule } from './public_api'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1mcmVzaGNoYXQvIiwic291cmNlcyI6WyJuZ3gtZnJlc2hjaGF0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSx3REFBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljX2FwaSc7XG4iXX0= |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -10,3 +10,3 @@ /* | ||
export { NgxFreshChatModule } from './lib/ngx-freshchat-lib.module'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1mcmVzaGNoYXQvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxvQ0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxtQ0FBYyxnQ0FBZ0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygbmd4LWZyZXNoY2hhdC1saWJcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9uZ3gtZnJlc2hjaGF0LWxpYi5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL25neC1mcmVzaGNoYXQtbGliLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tb2RlbHMnO1xuIl19 | ||
export {} from './lib/models'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1mcmVzaGNoYXQvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxvQ0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxtQ0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxlQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygbmd4LWZyZXNoY2hhdC1saWJcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9uZ3gtZnJlc2hjaGF0LWxpYi5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL25neC1mcmVzaGNoYXQtbGliLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tb2RlbHMnO1xuIl19 |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -9,32 +9,34 @@ /** | ||
export function FCInitObject() { } | ||
/** @type {?} */ | ||
FCInitObject.prototype.token; | ||
/** @type {?} */ | ||
FCInitObject.prototype.host; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.siteId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.restoreId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.externalId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.firstName; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.lastName; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.email; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.phone; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.phoneCountryCode; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.config; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.open; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.tags; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.faqTags; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.locale; | ||
if (false) { | ||
/** @type {?} */ | ||
FCInitObject.prototype.token; | ||
/** @type {?} */ | ||
FCInitObject.prototype.host; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.siteId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.restoreId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.externalId; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.firstName; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.lastName; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.email; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.phone; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.phoneCountryCode; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.config; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.open; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.tags; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.faqTags; | ||
/** @type {?|undefined} */ | ||
FCInitObject.prototype.locale; | ||
} | ||
/** | ||
@@ -44,15 +46,16 @@ * @record | ||
export function FCUser() { } | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.firstName; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.lastName; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.email; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.phone; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.phoneCountryCode; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.externalId; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kZWxzLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWZyZXNoY2hhdC8iLCJzb3VyY2VzIjpbImxpYi9tb2RlbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgRkNJbml0T2JqZWN0IHtcbiAgICB0b2tlbjogc3RyaW5nO1xuICAgIGhvc3Q6IHN0cmluZztcbiAgICBzaXRlSWQ/OiBzdHJpbmc7XG4gICAgcmVzdG9yZUlkPzogc3RyaW5nO1xuICAgIGV4dGVybmFsSWQ/OiBzdHJpbmc7XG4gICAgZmlyc3ROYW1lPzogc3RyaW5nO1xuICAgIGxhc3ROYW1lPzogc3RyaW5nO1xuICAgIGVtYWlsPzogc3RyaW5nO1xuICAgIHBob25lPzogc3RyaW5nO1xuICAgIHBob25lQ291bnRyeUNvZGU/OiBzdHJpbmc7XG4gICAgY29uZmlnPzogYW55O1xuICAgIG9wZW4/OiBib29sZWFuO1xuICAgIHRhZ3M/OiBbc3RyaW5nXTtcbiAgICBmYXFUYWdzPzogYW55O1xuICAgIGxvY2FsZT86IHN0cmluZztcbn1cblxuZXhwb3J0IGludGVyZmFjZSBGQ1VzZXIge1xuICAgIGZpcnN0TmFtZT86IHN0cmluZztcbiAgICBsYXN0TmFtZT86IHN0cmluZztcbiAgICBlbWFpbD86IHN0cmluZztcbiAgICBwaG9uZT86IHN0cmluZztcbiAgICBwaG9uZUNvdW50cnlDb2RlPzogc3RyaW5nO1xuICAgIGV4dGVybmFsSWQ/OiBzdHJpbmc7XG59XG4iXX0= | ||
if (false) { | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.firstName; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.lastName; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.email; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.phone; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.phoneCountryCode; | ||
/** @type {?|undefined} */ | ||
FCUser.prototype.externalId; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kZWxzLmpzIiwic291c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c2VyIHtcbiAgICBmaXJzdE5hbWU/OiBzdHJpbmc7XG4gICAgbGFzdE5hbWU/OiBzdHJpbmc7XG4gICAgZW1haWw/OiBzdHJpbmc7XG4gICAgcGhvbmU/OiBzdHJpbmc7XG4gICAgcGhvbmVDb3VudHJ5Q29kZT86IHN0cmluZztcbiAgICBleHRlcm5hbElkPzogc3RyaW5nO1xufVxuIl19 |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -16,3 +16,3 @@ import { NgModule } from '@angular/core'; | ||
exports: [] | ||
},] }, | ||
},] } | ||
]; | ||
@@ -22,3 +22,2 @@ return NgxFreshChatModule; | ||
export { NgxFreshChatModule }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC1saWIubW9kdWxlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWZyZXNoY2hhdC8iLCJzb3VyY2VzIjpbImxpYi9uZ3gtZnJlc2hjaGF0LWxpYi5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7Ozs7O2dCQUdqRSxRQUFRLFNBQUM7b0JBQ1IsT0FBTyxFQUFFLEVBQUU7b0JBQ1gsU0FBUyxFQUFFLENBQUUsbUJBQW1CLENBQUU7b0JBQ2xDLFlBQVksRUFBRSxFQUFFO29CQUNoQixPQUFPLEVBQUUsRUFBRTtpQkFDWjs7NkJBVEQ7O1NBVWEsa0JBQWtCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICd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QtbGliLnNlcnZpY2UnO1xuXG5cbkBOZ01vZHVsZSh7XG4gIGltcG9ydHM6IFtdLFxuICBwcm92aWRlcnM6IFsgTmd4RnJlc2hDaGF0U2VydmljZSBdLFxuICBkZWNsYXJhdGlvbnM6IFtdLFxuICBleHBvcnRzOiBbXVxufSlcbmV4cG9ydCBjbGFzcyBOZ3hGcmVzaENoYXRNb2R1bGUgeyB9XG4iXX0= |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -13,18 +13,20 @@ import { Injectable } from '@angular/core'; | ||
function FCWidget() { } | ||
/** @type {?} */ | ||
FCWidget.prototype.init; | ||
/** @type {?} */ | ||
FCWidget.prototype.user; | ||
/** @type {?} */ | ||
FCWidget.prototype.track; | ||
/** @type {?} */ | ||
FCWidget.prototype.setTags; | ||
/** @type {?} */ | ||
FCWidget.prototype.setLocale; | ||
/** @type {?} */ | ||
FCWidget.prototype.destroy; | ||
/** @type {?} */ | ||
FCWidget.prototype.isInitialized; | ||
/** @type {?} */ | ||
FCWidget.prototype.on; | ||
if (false) { | ||
/** @type {?} */ | ||
FCWidget.prototype.init; | ||
/** @type {?} */ | ||
FCWidget.prototype.user; | ||
/** @type {?} */ | ||
FCWidget.prototype.track; | ||
/** @type {?} */ | ||
FCWidget.prototype.setTags; | ||
/** @type {?} */ | ||
FCWidget.prototype.setLocale; | ||
/** @type {?} */ | ||
FCWidget.prototype.destroy; | ||
/** @type {?} */ | ||
FCWidget.prototype.isInitialized; | ||
/** @type {?} */ | ||
FCWidget.prototype.on; | ||
} | ||
var NgxFreshChatService = /** @class */ (function () { | ||
@@ -44,5 +46,10 @@ function NgxFreshChatService() { | ||
return this.loadScript('https://wchat.freshchat.com/js/widget.js') | ||
.pipe(first(), flatMap(function (res) { return _this.initWidget(data); })); | ||
.pipe(first(), flatMap((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { return _this.initWidget(data); }))); | ||
}; | ||
/** | ||
* @private | ||
* @param {?} data | ||
@@ -52,2 +59,3 @@ * @return {?} | ||
NgxFreshChatService.prototype.initWidget = /** | ||
* @private | ||
* @param {?} data | ||
@@ -58,6 +66,14 @@ * @return {?} | ||
var _this = this; | ||
return Observable.create(function (observer) { | ||
_this.getWidget().on('widget:loaded', function (res) { return observer.next(res); }); | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().on('widget:loaded', (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { return observer.next(res); })); | ||
_this.getWidget().init(data); | ||
}); | ||
})); | ||
}; | ||
@@ -72,4 +88,12 @@ /** | ||
var _this = this; | ||
return Observable.create(function (observer) { | ||
_this.getWidget().user.get(function (res) { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.get((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
@@ -81,4 +105,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
}; | ||
@@ -95,4 +119,12 @@ /** | ||
var _this = this; | ||
return Observable.create(function (observer) { | ||
_this.getWidget().user.setProperties(user, function (res) { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.setProperties(user, (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
@@ -104,4 +136,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
}; | ||
@@ -127,4 +159,12 @@ /** | ||
var _this = this; | ||
return Observable.create(function (observer) { | ||
_this.getWidget().user.clear(function (res) { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.clear((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
@@ -136,4 +176,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
}; | ||
@@ -194,11 +234,14 @@ /** | ||
/** | ||
* @private | ||
* @return {?} | ||
*/ | ||
NgxFreshChatService.prototype.getWidget = /** | ||
* @private | ||
* @return {?} | ||
*/ | ||
function () { | ||
return (/** @type {?} */ (window)).fcWidget; | ||
return ((/** @type {?} */ (window))).fcWidget; | ||
}; | ||
/** | ||
* @private | ||
* @param {?} src | ||
@@ -208,2 +251,3 @@ * @return {?} | ||
NgxFreshChatService.prototype.loadScript = /** | ||
* @private | ||
* @param {?} src | ||
@@ -213,3 +257,7 @@ * @return {?} | ||
function (src) { | ||
return new Observable(function (observer) { | ||
return new Observable((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
/** @type {?} */ | ||
@@ -219,9 +267,15 @@ var scriptElement = document.createElement('script'); | ||
scriptElement.src = src; | ||
scriptElement.onload = function () { | ||
scriptElement.onload = (/** | ||
* @return {?} | ||
*/ | ||
function () { | ||
observer.next(src); | ||
observer.complete(); | ||
}; | ||
scriptElement.onerror = function () { return observer.error('Couldn\'t load ' + src); }; | ||
}); | ||
scriptElement.onerror = (/** | ||
* @return {?} | ||
*/ | ||
function () { return observer.error('Couldn\'t load ' + src); }); | ||
document.getElementsByTagName('body')[0].appendChild(scriptElement); | ||
}); | ||
})); | ||
}; | ||
@@ -231,13 +285,10 @@ NgxFreshChatService.decorators = [ | ||
providedIn: 'root' | ||
},] }, | ||
},] } | ||
]; | ||
/** @nocollapse */ | ||
NgxFreshChatService.ctorParameters = function () { return []; }; | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = i0.defineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
return NgxFreshChatService; | ||
}()); | ||
export { NgxFreshChatService }; | ||
// TODO: events | ||
// TODO: messenger API | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC1saWIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1mcmVzaGNoYXQvIiwic291cmNlcyI6WyJsaWIvbmd4LWZyZXNoY2hhdC1saWIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUzQyxPQUFPLEVBQUUsVUFBVSxFQUFZLE1BQU0sTUFBTSxDQUFDO0FBQzVDLE9BQU8sRUFBRSxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBa0I5QztLQUFnQjs7Ozs7SUFFaEIsa0NBQUk7Ozs7SUFBSixVQUFLLElBQWtCO1FBQXZCLGlCQU1DO1FBTEMsTUFBTSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsMENBQTBDLENBQUM7YUFDL0QsSUFBSSxDQUNILEtBQUssRUFBRSxFQUNQLE9BQU8sQ0FBRSxVQUFBLEdBQUcsSUFBSSxPQUFBLEtBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLEVBQXJCLENBQXFCLENBQUMsQ0FDdkMsQ0FBQztLQUNMOzs7OztJQUVPLHdDQUFVOzs7O2NBQUMsSUFBSTs7UUFDckIsTUFBTSxDQUFDLFVBQVUsQ0FBQyxNQUFNLENBQUUsVUFBQSxRQUFRO1lBQ2hDLEtBQU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W5pdGlhbGl6ZWQoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMuZ2V0V2lkZ2V0KCkuaXNJbml0aWFsaXplZCgpO1xuICB9XG5cbiAgcHJpdmF0ZSBnZXRXaWRnZXQoKTogRkNXaWRnZXQge1xuICAgIHJldHVybiAod2luZG93IGFzIGFueSkuZmNXaWRnZXQ7XG4gIH1cblxuICBwcml2YXRlIGxvYWRTY3JpcHQoc3JjOiBzdHJpbmcpOiBPYnNlcnZhYmxlIDxhbnk+IHtcbiAgICByZXR1cm4gbmV3IE9ic2VydmFibGU8YW55Pigob2JzZXJ2ZXI6IE9ic2VydmVyPGFueT4pID0+IHtcbiAgICAgIGNvbnN0IHNjcmlwdEVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzY3JpcHQnKTtcbiAgICAgIHNjcmlwdEVsZW1lbnQudHlwZSA9ICd0ZXh0L2phdmFzY3JpcHQnO1xuICAgICAgc2NyaXB0RWxlbWVudC5zcmMgPSBzcmM7XG4gICAgICBzY3JpcHRFbGVtZW50Lm9ubG9hZCA9ICgpID0+IHtcbiAgICAgICAgICBvYnNlcnZlci5uZXh0KHNyYyk7XG4gICAgICAgICAgb2JzZXJ2ZXIuY29tcGxldGUoKTtcbiAgICAgIH07XG4gICAgICBzY3JpcHRFbGVtZW50Lm9uZXJyb3IgPSAoKSA9PiBvYnNlcnZlci5lcnJvcignQ291bGRuXFwndCBsb2FkICcgKyBzcmMpO1xuICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2JvZHknKVswXS5hcHBlbmRDaGlsZChzY3JpcHRFbGVtZW50KTtcbiAgICB9KTtcbiAgfVxuXG59XG5cbi8vIFRPRE86IGV2ZW50c1xuLy8gVE9ETzogbWVzc2VuZ2VyIEFQSVxuXG4iXX0= |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -9,3 +9,2 @@ /** | ||
export { NgxFreshChatService, NgxFreshChatModule } from './public_api'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1mcmVzaGNoYXQvIiwic291cmNlcyI6WyJuZ3gtZnJlc2hjaGF0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSx3REFBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljX2FwaSc7XG4iXX0= |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -10,3 +10,3 @@ /* | ||
export { NgxFreshChatModule } from './lib/ngx-freshchat-lib.module'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1mcmVzaGNoYXQvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxvQ0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxtQ0FBYyxnQ0FBZ0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygbmd4LWZyZXNoY2hhdC1saWJcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9uZ3gtZnJlc2hjaGF0LWxpYi5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL25neC1mcmVzaGNoYXQtbGliLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tb2RlbHMnO1xuIl19 | ||
export {} from './lib/models'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1mcmVzaGNoYXQvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxvQ0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxtQ0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxlQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygbmd4LWZyZXNoY2hhdC1saWJcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9uZ3gtZnJlc2hjaGF0LWxpYi5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL25neC1mcmVzaGNoYXQtbGliLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tb2RlbHMnO1xuIl19 |
@@ -1,2 +0,2 @@ | ||
import { Injectable, NgModule, defineInjectable } from '@angular/core'; | ||
import { Injectable, ɵɵdefineInjectable, NgModule } from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
@@ -7,3 +7,3 @@ import { first, flatMap } from 'rxjs/operators'; | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -18,5 +18,10 @@ class NgxFreshChatService { | ||
return this.loadScript('https://wchat.freshchat.com/js/widget.js') | ||
.pipe(first(), flatMap(res => this.initWidget(data))); | ||
.pipe(first(), flatMap((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => this.initWidget(data)))); | ||
} | ||
/** | ||
* @private | ||
* @param {?} data | ||
@@ -26,6 +31,14 @@ * @return {?} | ||
initWidget(data) { | ||
return Observable.create(observer => { | ||
this.getWidget().on('widget:loaded', res => observer.next(res)); | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
observer => { | ||
this.getWidget().on('widget:loaded', (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => observer.next(res))); | ||
this.getWidget().init(data); | ||
}); | ||
})); | ||
} | ||
@@ -36,4 +49,12 @@ /** | ||
getUser() { | ||
return Observable.create(observer => { | ||
this.getWidget().user.get(res => { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
observer => { | ||
this.getWidget().user.get((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => { | ||
if (res.status !== 200) { | ||
@@ -45,4 +66,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
} | ||
@@ -54,4 +75,12 @@ /** | ||
setUserProperties(user) { | ||
return Observable.create(observer => { | ||
this.getWidget().user.setProperties(user, res => { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
observer => { | ||
this.getWidget().user.setProperties(user, (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => { | ||
if (res.status !== 200) { | ||
@@ -63,4 +92,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
} | ||
@@ -78,4 +107,12 @@ /** | ||
clearUser() { | ||
return Observable.create(observer => { | ||
this.getWidget().user.clear(res => { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
observer => { | ||
this.getWidget().user.clear((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
res => { | ||
if (res.status !== 200) { | ||
@@ -87,4 +124,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
} | ||
@@ -126,8 +163,10 @@ /** | ||
/** | ||
* @private | ||
* @return {?} | ||
*/ | ||
getWidget() { | ||
return (/** @type {?} */ (window)).fcWidget; | ||
return ((/** @type {?} */ (window))).fcWidget; | ||
} | ||
/** | ||
* @private | ||
* @param {?} src | ||
@@ -137,3 +176,7 @@ * @return {?} | ||
loadScript(src) { | ||
return new Observable((observer) => { | ||
return new Observable((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
(observer) => { | ||
/** @type {?} */ | ||
@@ -143,9 +186,15 @@ const scriptElement = document.createElement('script'); | ||
scriptElement.src = src; | ||
scriptElement.onload = () => { | ||
scriptElement.onload = (/** | ||
* @return {?} | ||
*/ | ||
() => { | ||
observer.next(src); | ||
observer.complete(); | ||
}; | ||
scriptElement.onerror = () => observer.error('Couldn\'t load ' + src); | ||
}); | ||
scriptElement.onerror = (/** | ||
* @return {?} | ||
*/ | ||
() => observer.error('Couldn\'t load ' + src)); | ||
document.getElementsByTagName('body')[0].appendChild(scriptElement); | ||
}); | ||
})); | ||
} | ||
@@ -156,13 +205,11 @@ } | ||
providedIn: 'root' | ||
},] }, | ||
},] } | ||
]; | ||
/** @nocollapse */ | ||
NgxFreshChatService.ctorParameters = () => []; | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = defineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
// TODO: events | ||
// TODO: messenger API | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -177,3 +224,3 @@ class NgxFreshChatModule { | ||
exports: [] | ||
},] }, | ||
},] } | ||
]; | ||
@@ -183,3 +230,3 @@ | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -189,7 +236,11 @@ | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
export { NgxFreshChatService, NgxFreshChatModule }; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC5qcy5tYXAiLCJzb3VyY2VzIjpbIm5nOi8vbmd4LWZyZXNoY2hhdC9saWIvbmd4LWZyZXNoY2hhdC1saWIuc2VydmljZS50cyIsIm5nOi8vbmd4LWZyZXNoY2hhdC9saWIvbmd4LWZyZXNoY2hhdC1saWIubW9kdWxlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEZDSW5pdE9iamVjdCwgRkNVc2VyIH0gZnJvbSAnLi9tb2RlbHMnO1xuaW1wb3J0IHsgT2JzZXJ2YWJsZSwgT2JzZXJ2ZXIgfSBmcm9tICdyeGpzJztcbmltcG9ydCB7IGZpcnN0LCBmbGF0TWFwIH0gZnJvbSAncnhqcy9vcGVyYXRvcnMnO1xuXG5pbnRlcmZhY2UgRkNXaWRnZXQge1xuICBp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UFBRTtnQkFDaEIsT0FBTyxFQUFFLEVBQUU7YUFDWjs7Ozs7Ozs7Ozs7Ozs7OyJ9 | ||
export { NgxFreshChatModule, NgxFreshChatService }; | ||
//# sourceMappingURL=ngx-freshchat.js.map |
@@ -1,2 +0,2 @@ | ||
import { Injectable, NgModule, defineInjectable } from '@angular/core'; | ||
import { Injectable, ɵɵdefineInjectable, NgModule } from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
@@ -7,3 +7,3 @@ import { first, flatMap } from 'rxjs/operators'; | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -24,5 +24,10 @@ var NgxFreshChatService = /** @class */ (function () { | ||
return this.loadScript('https://wchat.freshchat.com/js/widget.js') | ||
.pipe(first(), flatMap(function (res) { return _this.initWidget(data); })); | ||
.pipe(first(), flatMap((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { return _this.initWidget(data); }))); | ||
}; | ||
/** | ||
* @private | ||
* @param {?} data | ||
@@ -32,2 +37,3 @@ * @return {?} | ||
NgxFreshChatService.prototype.initWidget = /** | ||
* @private | ||
* @param {?} data | ||
@@ -38,6 +44,14 @@ * @return {?} | ||
var _this = this; | ||
return Observable.create(function (observer) { | ||
_this.getWidget().on('widget:loaded', function (res) { return observer.next(res); }); | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().on('widget:loaded', (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { return observer.next(res); })); | ||
_this.getWidget().init(data); | ||
}); | ||
})); | ||
}; | ||
@@ -52,4 +66,12 @@ /** | ||
var _this = this; | ||
return Observable.create(function (observer) { | ||
_this.getWidget().user.get(function (res) { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.get((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
@@ -61,4 +83,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
}; | ||
@@ -75,4 +97,12 @@ /** | ||
var _this = this; | ||
return Observable.create(function (observer) { | ||
_this.getWidget().user.setProperties(user, function (res) { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.setProperties(user, (/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
@@ -84,4 +114,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
}; | ||
@@ -107,4 +137,12 @@ /** | ||
var _this = this; | ||
return Observable.create(function (observer) { | ||
_this.getWidget().user.clear(function (res) { | ||
return Observable.create((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
_this.getWidget().user.clear((/** | ||
* @param {?} res | ||
* @return {?} | ||
*/ | ||
function (res) { | ||
if (res.status !== 200) { | ||
@@ -116,4 +154,4 @@ observer.error(res.status); | ||
} | ||
}); | ||
}); | ||
})); | ||
})); | ||
}; | ||
@@ -174,11 +212,14 @@ /** | ||
/** | ||
* @private | ||
* @return {?} | ||
*/ | ||
NgxFreshChatService.prototype.getWidget = /** | ||
* @private | ||
* @return {?} | ||
*/ | ||
function () { | ||
return (/** @type {?} */ (window)).fcWidget; | ||
return ((/** @type {?} */ (window))).fcWidget; | ||
}; | ||
/** | ||
* @private | ||
* @param {?} src | ||
@@ -188,2 +229,3 @@ * @return {?} | ||
NgxFreshChatService.prototype.loadScript = /** | ||
* @private | ||
* @param {?} src | ||
@@ -193,3 +235,7 @@ * @return {?} | ||
function (src) { | ||
return new Observable(function (observer) { | ||
return new Observable((/** | ||
* @param {?} observer | ||
* @return {?} | ||
*/ | ||
function (observer) { | ||
/** @type {?} */ | ||
@@ -199,9 +245,15 @@ var scriptElement = document.createElement('script'); | ||
scriptElement.src = src; | ||
scriptElement.onload = function () { | ||
scriptElement.onload = (/** | ||
* @return {?} | ||
*/ | ||
function () { | ||
observer.next(src); | ||
observer.complete(); | ||
}; | ||
scriptElement.onerror = function () { return observer.error('Couldn\'t load ' + src); }; | ||
}); | ||
scriptElement.onerror = (/** | ||
* @return {?} | ||
*/ | ||
function () { return observer.error('Couldn\'t load ' + src); }); | ||
document.getElementsByTagName('body')[0].appendChild(scriptElement); | ||
}); | ||
})); | ||
}; | ||
@@ -211,15 +263,13 @@ NgxFreshChatService.decorators = [ | ||
providedIn: 'root' | ||
},] }, | ||
},] } | ||
]; | ||
/** @nocollapse */ | ||
NgxFreshChatService.ctorParameters = function () { return []; }; | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = defineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
/** @nocollapse */ NgxFreshChatService.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgxFreshChatService_Factory() { return new NgxFreshChatService(); }, token: NgxFreshChatService, providedIn: "root" }); | ||
return NgxFreshChatService; | ||
}()); | ||
// TODO: events | ||
// TODO: messenger API | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -235,3 +285,3 @@ var NgxFreshChatModule = /** @class */ (function () { | ||
exports: [] | ||
},] }, | ||
},] } | ||
]; | ||
@@ -243,3 +293,3 @@ return NgxFreshChatModule; | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -249,7 +299,11 @@ | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
export { NgxFreshChatService, NgxFreshChatModule }; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZyZXNoY2hhdC5qcy5tYXAiLCJzb3VyY2VzIjpbIm5nOi8vbmd4LWZyZXNoY2hhdC9saWIvbmd4LWZyZXNoY2hhdC1saWIuc2VydmljZS50cyIsIm5nOi8vbmd4LWZyZXNoY2hhdC9saWIvbmd4LWZyZXNoY2hhdC1saWIubW9kdWxlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEZDSW5pdE9iamVjdCwgRkNVc2VyIH0gZnJvbSAnLi9tb2RlbHMnO1xuaW1wb3J0IHsgT2JzZXJ2YWJsZSwgT2JzZXJ2ZXIgfSBmcm9tICdyeGpzJztcbmltcG9ydCB7IGZpcnN0LCBmbGF0TWFwIH0gZnJvbSAncnhqcy9vcGVyYXRvcnMnO1xuXG5pbnRlcmZhY2UgRkNXaWRnZXQge1xuICBpbml0O1xuICB1c2VyO1xuICB0cmFjaztcbiAgc2V0VGFncztcbiAgc2V0TG9jYWxlO1xuICBkZXN0cm95O1xuICBpc0luaXRpYWxpemVkO1xuICBvbjtcbn1cblxuQEluamVjdGFibGUoe1xuICBwcm92aWRlZEluOiAncm9vdCdcbn0pXG5leHBvcnQgY2xhc3MgTmd4RnJlc2hDaGF0U2VydmljZSB7XG5cbiAgY29uc3RydWN0b3IoKSB7fVxuXG4gIGluaXQoZGF0YTogRkNJbml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AgICAgdGhpcy5nZXRXaWRnZXQoKS51c2VyLnNldFByb3BlcnRpZXModXNlcixcbiAgICAgICAgcmVzID0+IHtcbiAgICAgICAgICBpZiAocmVzLnN0YXR1cyAhPT0gMjAwKSB7XG4gICAgICAgICAgICBvYnNlcnZlci5lcnJvcihyZXMuc3RhdHVzKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb2JzZXJ2ZXIubmV4dChyZXMuZGF0YSB8fCBudWxsKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICk7XG4gICAgfSk7XG4gIH1cblxuICB1cGRhdGVVc2VyKHVzZXI6IEZDVXNlcikge1xuICAgIHRoaXMuZ2V0V2lkZ2V0KCkudXNlci51cGRhdGUodXNlcik7XG4gIH1cblxuICBjbGVhclVzZXIoKTogT2JzZXJ2YWJsZTxhbnk+IHtcbiAgICByZXR1cm4gT2JzZXJ2YWJsZS5jcmVhdGUoIG9ic2VydmVyID0+IHtcbiAgICAgIHRoaXMuZ2V0V2lkZ2V0KCkudXNlci5jbGVhcihcbiAgICAgICAgcmVzID0+IHtcbiAgICAgICAgICBpZiAocmVzLnN0YXR1cyAhPT0gMjAwKSB7XG4gICAgICAgICAgICBvYnNlcnZlci5lcnJvcihyZXMuc3RhdHVzKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb2JzZXJ2ZXIubmV4dChyZXMuZGF0YSB8fCBudWxsKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICk7XG4gICAgfSk7XG4gIH1cblxuICB0cmFjayhldmVudE5hbWU6IHN0cmluZywgcGF5bG9hZD86IGFueSkge1xuICAgIHRoaXMuZ2V0V2lkZ2V0KCkudHJhY2soZXZlbnROYW1lLCBwYXlsb2FkKTtcbiAgfVxuXG4gIHNldFRhZ3ModGFnczogW3N0cmluZ10pIHtcbiAgICB0aGlzLmdldFdpZGdldCgpLnNldFRhZ3ModGFncyk7XG4gIH1cblxuICBzZXRMb2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0FBRTtvQkFDbEMsWUFBWSxFQUFFLEVBQUU7b0JBQ2hCLE9BQU8sRUFBRSxFQUFFO2lCQUNaOzs2QkFURDs7Ozs7Ozs7Ozs7Ozs7OyJ9 | ||
export { NgxFreshChatModule, NgxFreshChatService }; | ||
//# sourceMappingURL=ngx-freshchat.js.map |
@@ -6,3 +6,3 @@ import { FCInitObject, FCUser } from './models'; | ||
init(data: FCInitObject): Observable<any>; | ||
private initWidget(data); | ||
private initWidget; | ||
getUser(): Observable<any>; | ||
@@ -17,4 +17,4 @@ setUserProperties(user: FCUser): Observable<any>; | ||
isInitialized(): boolean; | ||
private getWidget(); | ||
private loadScript(src); | ||
private getWidget; | ||
private loadScript; | ||
} |
{ | ||
"name": "ngx-freshchat", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"peerDependencies": { | ||
"@angular/common": "^6.0.0-rc.0 || ^6.0.0 || ^7.0.0", | ||
"@angular/core": "^6.0.0-rc.0 || ^6.0.0 || ^7.0.0" | ||
"@angular/common": "^6.0.0-rc.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", | ||
"@angular/core": "^6.0.0-rc.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" | ||
}, | ||
@@ -8,0 +8,0 @@ "main": "bundles/ngx-freshchat.umd.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
197680
38
2201
1