@eo-sdk/client 8.10.0-rc.1 → 8.11.0-rc.1
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/eo-sdk-client-projects-eo-sdk-core.umd.js +1 -1
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js.map +1 -1
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js +1 -1
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js.map +1 -1
- package/bundles/eo-sdk-client.umd.js +7 -5
- package/bundles/eo-sdk-client.umd.js.map +1 -1
- package/bundles/eo-sdk-client.umd.min.js +1 -1
- package/bundles/eo-sdk-client.umd.min.js.map +1 -1
- package/eo-sdk-client.metadata.json +1 -1
- package/esm2015/app/eo-client/about-state/about-state.component.js +3 -3
- package/esm2015/app/eo-framework/app-shell/app-bar/app-search/app-search.component.js +2 -1
- package/esm2015/app/eo-framework/form-elements/id-reference/id-reference.component.js +5 -4
- package/esm2015/projects/eo-sdk/core/lib/service/system/system.service.js +2 -2
- package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js +1 -1
- package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js.map +1 -1
- package/fesm2015/eo-sdk-client.js +7 -5
- package/fesm2015/eo-sdk-client.js.map +1 -1
- package/package.json +2 -2
- package/projects/eo-sdk/core/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ngx-translate/core"),require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/common/locales/de-CH"),require("@angular/common/locales/extra/de-CH"),require("@angular/common/locales/de"),require("@angular/common/locales/extra/de"),require("@angular/common/locales/ar"),require("@angular/common/locales/extra/ar"),require("@angular/common/locales/es"),require("@angular/common/locales/extra/es"),require("@angular/common/locales/pt"),require("@angular/common/locales/extra/pt"),require("@angular/common/locales/fr"),require("@angular/common/locales/extra/fr"),require("@angular/common/locales/zh"),require("@angular/common/locales/extra/zh"),require("@angular/common/locales/zh-Hant"),require("@angular/common/locales/extra/zh-Hant"),require("@angular/common/locales/lv"),require("@angular/common/locales/extra/lv"),require("@angular/common/locales/ru"),require("@angular/common/locales/extra/ru"),require("@angular/common/locales/it"),require("@angular/common/locales/extra/it"),require("@angular/common/locales/nl"),require("@angular/common/locales/extra/nl"),require("@angular/common/locales/sk"),require("@angular/common/locales/extra/sk"),require("@angular/common/locales/pl"),require("@angular/common/locales/extra/pl"),require("@angular/common/locales/uk"),require("@angular/common/locales/extra/uk"),require("@angular/common/locales/ja"),require("@angular/common/locales/extra/ja"),require("@angular/common/locales/ko"),require("@angular/common/locales/extra/ko"),require("@angular/common/locales/hi"),require("@angular/common/locales/extra/hi"),require("@angular/common/locales/bn"),require("@angular/common/locales/extra/bn"),require("@angular/common/locales/vi"),require("@angular/common/locales/extra/vi"),require("@angular/common/locales/th"),require("@angular/common/locales/extra/th"),require("@angular/common/locales/en-GB"),require("@angular/common/locales/extra/en-GB"),require("moment"),require("@ngx-pwa/local-storage"),require("file-saver"),require("lodash"),require("ngx-toastr")):"function"==typeof define&&define.amd?define("@eo-sdk/client/projects/eo-sdk/core",["exports","@ngx-translate/core","@angular/core","@angular/common/http","rxjs","rxjs/operators","@angular/common","@angular/common/locales/de-CH","@angular/common/locales/extra/de-CH","@angular/common/locales/de","@angular/common/locales/extra/de","@angular/common/locales/ar","@angular/common/locales/extra/ar","@angular/common/locales/es","@angular/common/locales/extra/es","@angular/common/locales/pt","@angular/common/locales/extra/pt","@angular/common/locales/fr","@angular/common/locales/extra/fr","@angular/common/locales/zh","@angular/common/locales/extra/zh","@angular/common/locales/zh-Hant","@angular/common/locales/extra/zh-Hant","@angular/common/locales/lv","@angular/common/locales/extra/lv","@angular/common/locales/ru","@angular/common/locales/extra/ru","@angular/common/locales/it","@angular/common/locales/extra/it","@angular/common/locales/nl","@angular/common/locales/extra/nl","@angular/common/locales/sk","@angular/common/locales/extra/sk","@angular/common/locales/pl","@angular/common/locales/extra/pl","@angular/common/locales/uk","@angular/common/locales/extra/uk","@angular/common/locales/ja","@angular/common/locales/extra/ja","@angular/common/locales/ko","@angular/common/locales/extra/ko","@angular/common/locales/hi","@angular/common/locales/extra/hi","@angular/common/locales/bn","@angular/common/locales/extra/bn","@angular/common/locales/vi","@angular/common/locales/extra/vi","@angular/common/locales/th","@angular/common/locales/extra/th","@angular/common/locales/en-GB","@angular/common/locales/extra/en-GB","moment","@ngx-pwa/local-storage","file-saver","lodash","ngx-toastr"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["eo-sdk"]=e["eo-sdk"]||{},e["eo-sdk"].client=e["eo-sdk"].client||{},e["eo-sdk"].client.projects=e["eo-sdk"].client.projects||{},e["eo-sdk"].client.projects["eo-sdk"]=e["eo-sdk"].client.projects["eo-sdk"]||{},e["eo-sdk"].client.projects["eo-sdk"].core={}),e.core,e.ng.core,e.ng.common.http,e.rxjs,e.rxjs.operators,e.ng.common,e.ng.common.locales.deCH,e.ng.common.locales.extra.deCH,e.ng.common.locales.de,e.ng.common.locales.extra.de,e.ng.common.locales.ar,e.ng.common.locales.extra.ar,e.ng.common.locales.es,e.ng.common.locales.extra.es,e.ng.common.locales.pt,e.ng.common.locales.extra.pt,e.ng.common.locales.fr,e.ng.common.locales.extra.fr,e.ng.common.locales.zh,e.ng.common.locales.extra.zh,e.ng.common.locales.zhHant,e.ng.common.locales.extra.zhHant,e.ng.common.locales.lv,e.ng.common.locales.extra.lv,e.ng.common.locales.ru,e.ng.common.locales.extra.ru,e.ng.common.locales.it,e.ng.common.locales.extra.it,e.ng.common.locales.nl,e.ng.common.locales.extra.nl,e.ng.common.locales.sk,e.ng.common.locales.extra.sk,e.ng.common.locales.pl,e.ng.common.locales.extra.pl,e.ng.common.locales.uk,e.ng.common.locales.extra.uk,e.ng.common.locales.ja,e.ng.common.locales.extra.ja,e.ng.common.locales.ko,e.ng.common.locales.extra.ko,e.ng.common.locales.hi,e.ng.common.locales.extra.hi,e.ng.common.locales.bn,e.ng.common.locales.extra.bn,e.ng.common.locales.vi,e.ng.common.locales.extra.vi,e.ng.common.locales.th,e.ng.common.locales.extra.th,e.ng.common.locales.enGB,e.ng.common.locales.extra.enGB,e.momentImported,e.localStorage,e.FileSaver,e._,e.ngxToastr)}(this,(function(e,t,r,n,o,i,s,a,c,u,p,l,h,f,d,m,g,y,b,v,S,E,T,O,I,k,C,x,_,A,R,w,D,j,P,N,F,U,L,M,B,H,q,Q,G,V,J,z,Y,K,$,W,Z,X,ee,te){"use strict";function re(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function ne(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var oe=re(a),ie=re(c),se=re(u),ae=re(p),ce=re(l),ue=re(h),pe=re(f),le=re(d),he=re(m),fe=re(g),de=re(y),me=re(b),ge=re(v),ye=re(S),be=re(E),ve=re(T),Se=re(O),Ee=re(I),Te=re(k),Oe=re(C),Ie=re(x),ke=re(_),Ce=re(A),xe=re(R),_e=re(w),Ae=re(D),Re=re(j),we=re(P),De=re(N),je=re(F),Pe=re(U),Ne=re(L),Fe=re(M),Ue=re(B),Le=re(H),Me=re(q),Be=re(Q),He=re(G),qe=re(V),Qe=re(J),Ge=re(z),Ve=re(Y),Je=re(K),ze=re($),Ye=ne(W),Ke=new r.InjectionToken("CUSTOM_CONFIG"),$e=new r.InjectionToken("CORE_CONFIG"),We=function(e){this.main=["assets/_default/config/main.json","assets/_default/config/extend.json"],this.translations=["assets/_default/i18n/"],this.environment={production:!0},Object.assign(this,e)};function Ze(e){return function(){return e.initialize()}}We.ctorParameters=function(){return[{type:We,decorators:[{type:r.Inject,args:[Ke]}]}]};var Xe=function(){function e(){}return e.prototype.handle=function(e){return"!missing key: "+e.key},e}(),et=function(){function e(e,t){this.http=e,this.config=t,s.registerLocaleData(se.default,"de",ae.default),s.registerLocaleData(ce.default,"ar",ue.default),s.registerLocaleData(pe.default,"es",le.default),s.registerLocaleData(he.default,"pt",fe.default),s.registerLocaleData(de.default,"fr",me.default),s.registerLocaleData(ge.default,"zh",ye.default),s.registerLocaleData(Se.default,"lv",Ee.default),s.registerLocaleData(Te.default,"ru",Oe.default),s.registerLocaleData(Ie.default,"it",ke.default),s.registerLocaleData(Ce.default,"nl",xe.default),s.registerLocaleData(_e.default,"sk",Ae.default),s.registerLocaleData(Re.default,"pl",we.default),s.registerLocaleData(De.default,"uk",je.default),s.registerLocaleData(Pe.default,"ja",Ne.default),s.registerLocaleData(Fe.default,"ko",Ue.default),s.registerLocaleData(Le.default,"hi",Me.default),s.registerLocaleData(Be.default,"bn",He.default),s.registerLocaleData(oe.default,"de-CH",ie.default),s.registerLocaleData(be.default,"zh-Hant",ve.default),s.registerLocaleData(Ge.default,"th",Ve.default),s.registerLocaleData(qe.default,"vi",Qe.default),s.registerLocaleData(Je.default,"en-GB",ze.default)}return e.prototype.getTranslation=function(e){var t=this;return o.forkJoin(this.config.translations.map((function(r){return t.loadTranslationFile(r,e)}))).pipe(i.map((function(e){return e.reduce((function(e,t){return Object.assign(e,t)}),{})})))},e.prototype.loadTranslationFile=function(e,t){var r=this;return this.http.get(""+e+t+".json").pipe(i.catchError((function(n){return t.length>2?r.loadTranslationFile(e,t.substring(0,2)):o.of({})})))},e}();et.ctorParameters=function(){return[{type:n.HttpClient},{type:We,decorators:[{type:r.Inject,args:[$e]}]}]};var tt=function(){function e(e,t,r,n){this.originalError=e,this._name=t,this._message=r,this._skipNotification=n}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name||this.originalError.name||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message||this.originalError.message||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stack",{get:function(){return this.originalError.stack},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.originalError.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this.originalError.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skipNotification",{get:function(){return void 0===this._skipNotification?!!this.originalError.skipNotification:this._skipNotification},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHttpErrorResponse",{get:function(){return this.originalError.isHttpErrorResponse||this.originalError instanceof n.HttpErrorResponse},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.originalError.toString()},e}(),rt=Ye,nt=function(){function e(){}return e.buildUri=function(e,t){var r=Object.keys(t).filter((function(e){return t[e]||0===t[e]||!1===t[e]})).map((function(e){return e+"="+encodeURIComponent(t[e])})).join("&");return e+(r?"?"+r:"")},e.uuid=function(){return e._p8()+e._p8(!0)+e._p8(!0)+e._p8()},e.encodeFileName=function(t){return"=?UTF-8?Q?"+e.encodeToQuotedPrintable(e.encodeToUtf8(t)).replace(/_/g,"=5F")+"?="},e._p8=function(e){var t=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+t.substr(0,4)+"-"+t.substr(4,4):t},e.encodeToUtf8=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},e.quotedPrintable=function(e){if(e>"ÿ")throw RangeError("`encodeToQuotedPrintable` expects extended ASCII input only. Missing prior UTF-8 encoding?");return"="+("0"+e.charCodeAt(0).toString(16).toUpperCase()).slice(-2)},e.encodeToQuotedPrintable=function(e){return e.replace(/[\0-\b\n-\x1F=\x7F-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/g,this.quotedPrintable)},e.sortValues=function(t,r,n,o){void 0===t&&(t=""),void 0===r&&(r="asc");return function(i,s){var a,c=e.getProperty(i,t),u=e.getProperty(s,t);if("number"==typeof c&&"number"==typeof u)a=c-u;else{var p=c||0===c?c.toString():"",l=u||0===u?u.toString():"";a=p.localeCompare(l,n,o)}return"desc"===r?-1*a:a}},e.getProperty=function(e,t){return void 0===t&&(t=""),t?t.split(".").reduce((function(e,t){return(e||{})[t]}),e):e},e.empty=function(e){return function(e){return o.EMPTY}},e.catchSkip=function(e,t,r,n){return function(i){var s=t&&t(i),a=e&&e(i);return o.throwError(new tt(s instanceof Error?s:i,r,n,a))}},e.catch=function(e,t,r,n){return function(i){var s=e&&e(i);return o.throwError(new tt(s instanceof Error?s:i,t,r,n))}},e.throw=function(e,t,r,n){return function(o){var i=e&&e(o);throw new tt(i instanceof Error?i:o,t,r,n)}},e.logError=function(t,r,n,o){return void 0===o&&(o=!0),e.throw(t,r,n,o)},e.isVisible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},e.getBaseHref=function(){return document.getElementsByTagName("base")[0].getAttribute("href")},e.truncateString=function(e,t,r){return void 0===r&&(r="..."),e.length>t&&(t>3&&(t-=3),e=""+e.substring(0,t)+r),e},e.getTimezoneOffset=function(){return rt().format("Z")},e.formatMailTo=function(e,t){return t&&e?Array.isArray(e)?e.join().replace(/,/g,"; "):e.replace(/,/g,"; "):e},e.arrayToObject=function(e,t,r){void 0===e&&(e=[]);var n="string"==typeof t?function(e){return e[t]}:t,o="string"==typeof r?function(e){return e[r]}:r;return e.reduce((function(e,t,r){return e[n?n(t):r]=o?o(t):t,e}),{})},e}(),ot=function(){function e(){this.eventSource=new o.Subject,this.event$=this.eventSource.asObservable()}return e.prototype.trigger=function(e,t){this.eventSource.next({type:e,data:t})},e.prototype.on=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.event$.pipe(i.filter((function(t){return t&&!!e.find((function(e){return e===t.type}))})))},e}();ot.decorators=[{type:r.Injectable}],ot.ctorParameters=function(){return[]};var it={LOGOUT:"eo.user.logout",CLIENT_LOCALE_CHANGED:"eo.user.locale.client.changed",SCHEMA_LOCALE_CHANGED:"eo.user.locale.schema.changed",DMS_OBJECT_LOADED:"eo.dms.object.loaded",DMS_OBJECT_DELETED:"eo.dms.object.deleted",DMS_OBJECT_VERSION_RESTORED:"eo.dms.object.version.restored",DMS_OBJECT_FAVORITE_ON:"eo.dms.object.favorite.on",DMS_OBJECT_FAVORITE_OFF:"eo.dms.object.favorite.off",DMS_OBJECT_UPDATED:"eo.dms.object.updated",DMS_OBJECT_PASTED:"eo.dms.object.pasted",INBOX_ITEM_CONFIRMED:"eo.inbox.item.confirmed",PROCESS_FILE_CHANGED:"eo.process.file.changed",EO_DIALOG_STACK_CHANGED:"eo.dialog.stack.changed",SYSTEM_STATUS_SCHEMA_CHANGED:"eo.status.schema",SYSTEM_STATUS_ORG_CHANGED:"eo.status.org",SYSTEM_STATUS_SEC_CHANGED:"eo.status.sec",SYSTEM_STATUS_ACL_CHANGED:"eo.status.acl",SYSTEM_STATUS_INBOX_CHANGED:"eo.status.inbox",EO_LICENSE_GRID:"eo_license_grid"},st=function(){function e(e,t){this.translate=e,this.event=t,this.cfg=null}return e.prototype.initializeGrid=function(){this.event.trigger(it.EO_LICENSE_GRID)},e.prototype.set=function(e){this.cfg=e;var t=this.getClientLocales().map((function(e){return e.iso}));this.translate.addLangs(t),this.translate.setDefaultLang(this.getDefaultClientLocale()),this.initializeGrid()},e.prototype.getLoginBase=function(){var e=this.getUri("loginBase");return e&&"/"!==e?e:""},e.prototype.getRaw=function(e){return e?nt.getProperty(this.cfg,e):this.cfg},e.prototype.getUri=function(e){return this.cfg.uri[e]},e.prototype.getClientLocales=function(){return this.cfg.languages},e.prototype.getDashboardBackgroundImage=function(){return this.cfg.dashboardBackgroundImage},e.prototype.getSideBarHeaderImage=function(){return this.cfg.sideBarHeaderImage},e.prototype.getNavigationBarImage=function(){var e=this.cfg.navBarLogo;return e=e.endsWith(".svg")?e:"<svg></svg>"},e.prototype.getDefaultClientLocale=function(){var e=this.getClientLocales().find((function(e){return e.fallback}));return e?e.iso:"en"},e.prototype.getAgentConfig=function(){return this.cfg.agent},e}();st.decorators=[{type:r.Injectable}],st.ctorParameters=function(){return[{type:t.TranslateService},{type:ot}]};var at=function(){function e(e,t){var r=this;this.storage=e,this.storageMap=t,this.SYSTEM_DEFINITION="eo.framework.cache.systemdefinition",this.HOSTS="eo.framework.cache.hosts",this.LOCATION_HISTORY="eo.framework.cache.locations.history",this.itemsMap=new Map,window._ngStorageRefresh=function(){return r.getStorage().subscribe((function(e){return r.setStorage(e).subscribe()&&console.log(e)}))}}return e.prototype.setItem=function(e,t,r){var n=this;if(void 0===r&&(r=500),r){if(!this.itemsMap.has(e)){var s=new o.Subject;s.pipe(i.debounceTime(r),i.switchMap((function(t){return n.storage.setItem(e,t)}))).subscribe(),this.itemsMap.set(e,s)}return this.itemsMap.get(e).next(t),o.of(!0)}return this.storage.setItem(e,t)},e.prototype.getItem=function(e){return this.storage.getItem(e).pipe(i.map((function(e){return"value"===Object.keys(e||{}).join()?e.value:e})))},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.clear=function(e){var t=this;return e?this.getStorageKeys().pipe(i.switchMap((function(r){var n=r.filter((function(t){return e(t)})).map((function(e){return t.removeItem(e)}));return n.length?o.forkJoin(n).pipe(i.map((function(){return!0}))):o.of(!0)}))):this.storage.clear()},e.prototype.getStorageKeys=function(){var e=this;return new o.Observable((function(t){var r=[];e.storageMap.keys().subscribe({next:function(e){return r.push(e)},complete:function(){return t.next(r)}})})).pipe(i.first())},e.prototype.getStorage=function(){var e=this;return this.getStorageKeys().pipe(i.switchMap((function(t){return t.length?o.forkJoin(nt.arrayToObject(t,(function(e){return e}),(function(t){return e.getItem(t)}))):o.of({})})))},e.prototype.setStorage=function(e){var t=this;return o.forkJoin(Object.keys(e||{}).map((function(r){return t.setItem(r,e[r])})))},e}();at.decorators=[{type:r.Injectable}],at.ctorParameters=function(){return[{type:Z.LocalStorage},{type:Z.StorageMap}]};var ct=function(){function e(e){var t=e.user,r=e.schema;this.id=t.id,this.name=t.name,this.firstname=t.firstname,this.lastname=t.lastname,this.title=t.title,this.email=t.email,this.present=t.present,!0===t.hasimage&&(this.imageUri="/organization/image/"+this.id),this.userSettings="object"==typeof e.usersettings?e.usersettings:{},this.schema={version:r.version,supportedLocales:r.supportedlocales},this.privileges=t.privileges,this.roles=t.effectiveroles,this.deputies=t.deputies||[],this.substitutesOf=t.substitutesOf||[],this.schemaLocale=t.locale||this.getClientLocale()}return e.prototype.hasPrivilege=function(e){var t=!1;if(this.privileges)for(var r=0;!t&&r<this.privileges.length;)t=this.privileges[r].name===e,r++;return t},e.prototype.hasRole=function(e){var t=!1;if(this.roles)for(var r=0;!t&&r<this.roles.length;)t=this.roles[r].name===e,r++;return t},e.prototype.setImageBase=function(e){this.imageUri&&(this.imageUri=e+this.imageUri)},e.prototype.getClientLocale=function(){return this.userSettings.clientlocale||"en"},e.prototype.getSchemaLocale=function(){return this.schemaLocale},e}(),ut=function(){function e(){}return e.prototype.assert=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.group=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.groupEnd=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e}();ut.decorators=[{type:r.Injectable}];var pt=function(){function e(e,t,r){this.http=e,this.logger=t,this.config=r,this.gridDataFilter=i.map((function(e){return null==e?void 0:e.filter((function(e){return!e.__removed}))})),this.cache=new Map,this.temp=new Map,this.headers=this.setDefaultHeaders(),this.authProfile={host:"",ntlm:!0}}return e.prototype.setAuthProfile=function(e){e&&(this.headers=this.setDefaultHeaders(),this.authProfile=e,this.authProfile.auth,this.headers.delete("Authorization"))},e.prototype.setHeader=function(e,t){t&&t.length&&(this.headers=this.headers.set(e,t))},e.prototype.getHeaders=function(){return this.headers},e.prototype.getHttpOptions=function(e){return Object.assign({headers:this.getHeaders()},e)},e.prototype.getServiceBase=function(){return this.getHost()+this.config.getUri("serviceBase")},e.prototype.getSearchBase=function(){return this.getHost()+this.config.getUri("searchBase")},e.prototype.getContextBase=function(){return this.getHost()+this.config.getUri("contextBase")},e.prototype.getInboxBase=function(){return this.getHost()+this.config.getUri("inboxBase")},e.prototype.getBpmBase=function(){return this.getHost()+this.config.getUri("bpmBase")},e.prototype.getAgentBase=function(){return this.getHost()+this.config.getUri("agentBase")},e.prototype.getStatusBase=function(){return this.getHost()+this.config.getUri("statusBase")},e.prototype.getIconBase=function(e){return void 0===e&&(e=""),this.getServiceBase()+"/ui/icon/"+e},e.prototype.getHost=function(){return this.authProfile.host||""},e.prototype.get=function(e,t,r){return this.http.get((t||this.getServiceBase())+e,this.getHttpOptions(r))},e.prototype.put=function(e,t,r,n){return this.http.put((r||this.getServiceBase())+e,t,this.getHttpOptions(n))},e.prototype.getJson=function(e,t){return this.get(e,t||this.getServiceBase(),{responseType:"json"})},e.prototype.post=function(e,t,r,n){var o=r||this.getServiceBase(),i=t?JSON.stringify(t):"";return this.http.post(""+o+e,i,this.getHttpOptions(n))},e.prototype.postMultiPart=function(e,t,r,n){var o=r||this.getServiceBase(),i=this.getHeaders();i.delete("Content-Type");var s=Object.assign({headers:i},n);return this.http.post(""+o+e,t,s)},e.prototype.del=function(e,t,r){return this.http.delete((t||this.getServiceBase())+e,this.getHttpOptions(r))},e.prototype.update=function(e,t){return t.forEach((function(t){var r=t.id,n=t.item;if(r){var o=e.find((function(e){return e.id===r}));Object.assign(o,n,n?{__updated:!0}:{__removed:!0})}else n&&e.unshift(Object.assign(n,{__added:!0}))})),e},e.prototype.getViaCache=function(e){var t=this;return this.cache.has(e)?o.of(this.cache.get(e)):this.getViaTempCache(e,(function(){return t.http.get(e,{responseType:"text"}).pipe(i.tap((function(r){return t.cache.set(e,r)})))}))},e.prototype.getViaTempCache=function(e,t){var r=this;if(this.temp.has(e))return this.temp.get(e);var n=(t?t():this.get(e)).pipe(i.finalize((function(){return r.temp.delete(e)})),i.shareReplay(1));return this.temp.set(e,n),n},e.prototype.downloadContent=function(e,t,r){var n=this;e.forEach((function(e){if(e.content){var o=n.getServiceBase()+"/dms/"+e.content.id+"/content?type="+e.content.type+"&asdownload=true";o+=t?"&rendition="+t+"&_intent=DOWNLOAD_"+t:"&_intent=DOWNLOAD",e.content.id===e.id&&(o+="&version="+e.version),n.download(o,r?e.version:null)}else n.logger.error("The provided dms object has no content",e)}))},e.prototype.download=function(e,t){var r=this;this.http.get(e,{observe:"response",responseType:"blob"}).subscribe((function(e){X.saveAs(e.body,r.getFileNameFromHttpResponse(e,t))}))},e.prototype.getFileNameFromHttpResponse=function(e,t){var r=e.headers.get("Content-Disposition")||"",n=r.match("filename\\*=UTF-8''(.*)")||r.match('filename="(.*)"'),o=n?n[1]:null,i=o?decodeURIComponent(o):"unknown",s=~i.lastIndexOf(".")?i.lastIndexOf("."):i.length;return t?i.slice(0,s)+"_v"+t+i.slice(s):i},e.prototype.setDefaultHeaders=function(){return new n.HttpHeaders({"Content-Type":"application/json","X-os-include-links":"false","X-os-include-actions":"false","X-os-sync-index":"true"})},e}();pt.decorators=[{type:r.Injectable}],pt.ctorParameters=function(){return[{type:n.HttpClient},{type:ut},{type:st}]};var lt,ht=function(){function e(e){this.id=e.id,this.implements=e.implements?e.implements:[],this.isFolder=e.folder,this.isContextFolder=e.iscontextfolder,this.isAbstract=e.abstract,this.iconId=e.icon?e.icon.id:null,this.maxFiles=e.maxfiles,this.minFiles=e.minfiles,this.name=e.name,this.qname=e.qname,this.label=e.label,this.description=e.description,this.group=e.group?e.group.label:"",this.elements=e.elements,this.allowedcontexttypes=e.allowedcontexttypes?e.allowedcontexttypes:[],this.supertypes=e.supertypes?e.supertypes.map((function(e){return e.name})):[],this.shareable=e.shareable,this.parenttypes=this.getParentTypes(e.allowedlocations)}return e.prototype.getParentTypes=function(e){return e?e.parenttypes.map((function(e){return e.name})):[]},e}(),ft=Ye,dt=function(){function e(e,t,r,n){var i=this;this.backend=e,this.logger=t,this.eventService=r,this.appCache=n,this.systemSource=new o.ReplaySubject,this.system$=this.systemSource.asObservable(),this.objectTypeForms=[],this.cachedRoles=[],this.eventService.on(it.SYSTEM_STATUS_SCHEMA_CHANGED).subscribe((function(){i.fetchSystemDefinition(i.user)}))}return Object.defineProperty(e.prototype,"system",{get:function(){return JSON.parse(JSON.stringify(this._system))},set:function(e){this._system=e},enumerable:!1,configurable:!0}),e.prototype.getObjectTypes=function(){return this.system.types},e.prototype.getObjectType=function(e){return this.system.types.find((function(t){return t.name===e}))},e.prototype.getFormElementsFromFormModel=function(e,t,r){var n=this;return this.getObjectTypeForm(e,t,r?"CONTEXT":null).pipe(i.switchMap((function(e){var t=[];return n.processFormModelElements(e,t),o.of(t)})))},e.prototype.processFormModelElements=function(e,t){var r=this;e.elements.forEach((function(e){"o2mGroup"!==e.type&&"o2mGroupStack"!==e.type?t.push(e):e.elements&&e.elements.length&&r.processFormModelElements(e,t)}))},e.prototype.implementsType=function(e,t){return e.name===t||e.implements&&-1!==e.implements.indexOf(t)},e.prototype.getCodesystem=function(e){return this.system.codesystems.find((function(t){return t.id===e||t.name===e}))},e.prototype.getObjectTypeForm=function(e,t,r){for(var n,s=this,a=0;!n&&a<this.objectTypeForms.length;)this.objectTypeForms[a].name===e&&this.objectTypeForms[a].mode===r&&this.objectTypeForms[a].situation===t&&(n=this.objectTypeForms[a]),a++;if(n)return o.of(ee.cloneDeep(n));var c="/ui/form/"+e+"?situation="+t;return c+=r?"&formmode="+r:"",this.backend.getViaTempCache(c,(function(){return s.backend.getJson(c).pipe(i.tap((function(e){return s.objectTypeForms.push(ee.cloneDeep(e))})))}))},e.prototype.getSystemDefinition=function(e){return this.user=e,this.fetchSystemDefinition(e)},e.prototype.getDefaultValue=function(e){var t;switch(e){case"CURRENT_USER":t=this.user.name;break;case"CURRENT_USER_NAME":t=this.user.title;break;case"CURRENT_DATETIME":t=new Date;break;case"CURRENT_DATE":t=ft().startOf("day").toDate();break;case"YEAR":t=ft().year();break;case"MONTH":t=ft().month()+1;break;case"DAY":t=ft().date();break;case"HOUR":t=ft().hour();break;case"MINUTE":t=ft().minute();break;case"SECOND":t=ft().second();break;case"WEEK_OF_YEAR":t=ft().isoWeek();break;case"FIRST_DAY_OF_WEEK":t=ft().startOf("isoWeek").toDate();break;case"FIRST_DAY_OF_MONTH":t=ft().startOf("month").toDate();break;case"FIRST_DAY_OF_YEAR":t=ft().startOf("year").toDate()}return t},e.prototype.fetchSystemDefinition=function(e){var t=this,r=[this.backend.getJson("/system/type/list?elements=true"),this.backend.getJson("/system/cs/list?elements=true")];return o.forkJoin(r).pipe(i.catchError(nt.catch((function(e){t.logger.error("Error fetching recent version of system definition from server.",e),t.systemSource.error("Error fetching recent version of system definition from server.")}))),i.map((function(r){t.objectTypeForms=[];var n={info:{user:e.id,locale:e.getSchemaLocale(),version:e.schema.version},locales:e.schema.supportedLocales,types:[],codesystems:[]},o=r[0];return n.types=o.map((function(e){return new ht(e)})),n.codesystems=r[1],t.system=n,t.systemSource.next(n),t.logger.debug("Fetched new version of system definition (user: "+e.id+", version: "+e.schema.version+")."),t.appCache.setItem(t.appCache.SYSTEM_DEFINITION,n).subscribe((function(){t.logger.debug("Cached recent version")}),nt.logError(null,"Error caching recent version of system definition.")),!0})))},e.prototype.getOrganizationObjectById=function(e){return this.backend.getJson("/organization/id/"+e)},e.prototype.getOrganizationObject=function(e){return this.getOrganizationObjects([e]).pipe(i.map((function(e){return e[0]})))},e.prototype.getOrganizationObjects=function(e){var t=this,r=e.map((function(e){return t.backend.getJson("/organization/name/"+e).pipe(i.catchError((function(t){return o.of({id:e,active:!1})})))}));return o.forkJoin(r)},e.prototype.getRoles=function(){var e=this;return this.cachedRoles.length?o.of(this.cachedRoles):this.backend.get("/organization/role").pipe(i.map((function(e){return e})),i.tap((function(t){return e.cachedRoles=t})))},e}();dt.decorators=[{type:r.Injectable}],dt.ctorParameters=function(){return[{type:pt},{type:ut},{type:ot},{type:at}]},(lt=e.Direction||(e.Direction={})).LTR="ltr",lt.RTL="rtl";var mt=function(){function t(e,t,r,n,s,a){this.backend=e,this.translate=t,this.logger=r,this.eventService=n,this.system=s,this.config=a,this.USER_FETCH_URI="/user?favorites=true&privileges=true&roles=true&deputies=true&substitutesOf=true",this.user=null,this.userSource=new o.BehaviorSubject(this.user),this.user$=this.userSource.asObservable(),this.favorites=null,this.favoritesSource=new o.BehaviorSubject(this.favorites),this.favoritesGridData$=this.favoritesSource.asObservable().pipe(i.debounceTime(100),i.filter((function(e){return e}))),this.favorites$=this.favoritesGridData$.pipe(this.backend.gridDataFilter),this.notifications=null,this.notificationsSource=new o.BehaviorSubject(this.notifications),this.notificationsGridData$=this.notificationsSource.asObservable().pipe(i.debounceTime(100),i.filter((function(e){return e}))),this.notifications$=this.notificationsGridData$.pipe(this.backend.gridDataFilter)}return t.prototype.getCurrentUser=function(){return this.user},t.prototype.setPresence=function(e){var t=this;return e!==this.user.present?this.backend.put("/user?presence="+e).pipe(i.tap((function(r){t.user.present=e,t.userSource.next(t.user)}))):o.of(null)},t.prototype.setDeputies=function(e){var t=this;return this.backend.put("/user/deputy?user="+e.join("&user=")).pipe(i.tap((function(){return t.refreshCurrentUser().subscribe()})))},t.prototype.changeClientLocale=function(t){var r=this;this.user.userSettings.clientlocale=t,this.backend.put("/user/config/web",this.user.userSettings).subscribe((function(){r.logger.debug("Changed client locale to '"+t+"'"),r.translate.use(t),r.user.uiDirection=(r.config.getClientLocales().find((function(e){return e.iso===t}))||{}).dir||e.Direction.LTR,r.userSource.next(r.user),r.eventService.trigger(it.CLIENT_LOCALE_CHANGED,t)}))},t.prototype.changeSchemaLocale=function(e){var t=this;return this.user.schemaLocale=e,this.backend.put("/user/locale/"+this.user.schemaLocale).pipe(i.tap((function(){t.logger.debug("Changed schema locale to '"+e+"'"),t.userSource.next(t.user),t.backend.setHeader("Accept-Language",t.user.getSchemaLocale()),t.logger.debug("Loading system definition for new locale."),t.system.getSystemDefinition(t.user).subscribe(),t.eventService.trigger(it.SCHEMA_LOCALE_CHANGED,e)})))},t.prototype.setCurrentUser=function(t){this.user=new ct(t),this.passwordValidationSettings=t.passwortvalidation,this.user.setImageBase(this.backend.getServiceBase()),this.backend.setHeader("Accept-Language",this.user.getSchemaLocale());var r=this.config.getClientLocales().map((function(e){return e.iso})),n=this.user.getClientLocale();-1===r.indexOf(n)&&(n=this.config.getDefaultClientLocale()),this.logger.debug("Setting client locale to '"+n+"'"),this.translate.use(n),this.user.uiDirection=(this.config.getClientLocales().find((function(e){return e.iso===n}))||{}).dir||e.Direction.LTR,this.userSource.next(this.user),this.favorites=null,this.favoritesSource.next(this.favorites),this.notifications=null,this.notificationsSource.next(this.notifications)},t.prototype.getFavorites=function(){var e=this;return this.backend.getJson("/user/favorites").pipe(i.map((function(e){return e&&e.filter((function(e){return"DMS_OBJECT"===e.favoritetype}))})),i.tap((function(t){e.favorites=t,e.favoritesSource.next(e.favorites)})))},t.prototype.updateFavorites=function(e,t,r){this.backend.update(this.favorites,r||[{id:e,item:t}])&&this.favoritesSource.next(this.favorites)},t.prototype.getNotifications=function(){var e=[this.getSubscription(),this.getResubmission()];return o.forkJoin(e)},t.prototype.getResubmission=function(){var e=this;return this.backend.getJson("/messageprovider/resubmission/list").pipe(i.tap((function(t){e.notifications=t,e.notificationsSource.next(e.notifications)})))},t.prototype.getSubscription=function(){var e=this;return this.backend.getJson("/messageprovider/subscription/list").pipe(i.tap((function(t){e.notifications=t,e.notificationsSource.next(e.notifications)})))},t.prototype.removeNotifications=function(e,t){var r,n=this;switch(t){case"SUBSCRIPTION":r="subscription";break;case"RESUBMISSION":r="resubmission";break;default:return}return this.backend.del("/messageprovider/"+r+"/"+e).pipe(i.tap((function(e){return n.updateNotifications("")})))},t.prototype.updateNotifications=function(e,t,r){this.backend.update(this.notifications,r||[{id:e,item:t}])&&this.notificationsSource.next(this.notifications)},t.prototype.getUserImageUri=function(e){return this.backend.getServiceBase()+"/organization/image/"+e},t.prototype.removeFavorite=function(e){var t=this;return this.backend.del("/user/favorite/"+e).pipe(i.tap((function(r){return t.updateFavorites(e)})))},t.prototype.createFavorite=function(e,t,r){var n=this,o=nt.buildUri("/dms/favorite/"+e,{type:t,title:r});return this.backend.post(o,{}).pipe(i.tap((function(e){return n.getFavorites().subscribe()})))},t.prototype.removeFavoritesForTarget=function(e){var t=this;return this.backend.del("/dms/favorite/"+e).pipe(i.tap((function(r){var n=t.favorites.filter((function(t){return t.target.id===e})).map((function(e){return Object.assign({id:e.id})}));t.updateFavorites(null,null,n)})))},t.prototype.changeLockSetting=function(e){var t=this;return this.user.userSettings.alwayslock=e,this.backend.put("/user/config/web",this.user.userSettings).pipe(i.map((function(){t.refreshCurrentUser().subscribe()})))},t.prototype.hasPrivilege=function(e){return!!this.user.privileges.find((function(t){return t.name===e}))},t.prototype.changePassword=function(e){return this.backend.put("/user/password",e)},t.prototype.refreshCurrentUser=function(){var e=this;return this.backend.get(this.USER_FETCH_URI).pipe(i.map((function(t){return e.setCurrentUser(t)})))},t.prototype.validatePassword=function(e){return e.length<this.passwordValidationSettings.minlength?{type:"short",amount:this.passwordValidationSettings.minlength}:e.replace(/[^0-9]/g,"").length<this.passwordValidationSettings.minnumber?{type:"number",amount:this.passwordValidationSettings.minnumber}:e.replace(/[a-zA-Z0-9ß ]/g,"").length<this.passwordValidationSettings.minspecialchars?{type:"specialchars",amount:this.passwordValidationSettings.minspecialchars}:{type:"valid",amount:null}},t}();mt.decorators=[{type:r.Injectable}],mt.ctorParameters=function(){return[{type:pt},{type:t.TranslateService},{type:ut},{type:ot},{type:dt},{type:st}]};var gt=function(){function e(e){Object.assign(this,e)}return Object.defineProperty(e.prototype,"title",{get:function(){return this.selectedtype?this.selectedtype.label:""},enumerable:!1,configurable:!0}),e.prototype.hasContent=function(){return!!this.template||this.contentcount>0},e.prototype.getSelectedTypeObject=function(){return this.types.find((function(e){return e.selected}))},e}(),yt=function(){function e(e,t){this.http=e,this.userService=t}return e.prototype.upload=function(e,t){var r=new FormData,o=new n.HttpHeaders({"Accept-Language":this.userService.getCurrentUser().getClientLocale()});return t.forEach((function(e){return r.append("files[]",e,nt.encodeFileName(e.name))})),this.http.post(e,r,{headers:o})},e}();yt.decorators=[{type:r.Injectable}],yt.ctorParameters=function(){return[{type:n.HttpClient},{type:mt}]};var bt=function(){function e(e,t){this.id=e,this.type=t}return e.prototype.onUploadSuccess=function(e){return e},e.prototype.onUploadFail=function(){return{}},e}();bt.ROOT="root",bt.CONTEXT="context",bt.CONTEXT_TREE="contexttree",bt.OBJECT="object",bt.CUSTOM="custom";var vt=function(){function e(e,t){this.backend=e,this.uploadService=t,this.preparedItemsSource=new o.ReplaySubject(1),this.preparedItems$=this.preparedItemsSource.asObservable(),this.preparedItemCountSource=new o.ReplaySubject(1),this.preparedItemCount$=this.preparedItemCountSource.asObservable()}return e.prototype.refreshPreparedItemsCount=function(){this.fetchPreparedItemsCount()},e.prototype.fetchPreparedItemsCount=function(){var e=this;this.backend.getJson("/prepare/state").pipe(i.map((function(e){return e.count}))).subscribe((function(t){e.preparedItemCount=t,e.preparedItemCountSource.next(e.preparedItemCount)}))},e.prototype.createPreparedItem=function(e,t){var r=this;return this.backend.post(this.createPreparedItemPostUrl({parentId:e,childType:t||null}),{}).pipe(i.tap((function(){return r.getPreparedItems$()})))},e.prototype.updatePreparedItemIndexData=function(e,t){var r=this;return this.backend.put("/prepare/"+e,t).pipe(i.tap((function(){return r.getPreparedItems$()})))},e.prototype.createPreparedItemPostUrl=function(e){var t=e.createMany?"/prepare/createmany":"/prepare/create";return e&&(t=nt.buildUri(t,e)),t},e.prototype.getPreparedItems$=function(e){return this.fetchPreparedItems(e).subscribe(),this.preparedItems$},e.prototype.fetchPreparedItems=function(e){var t=this,r=e?"/prepare":"/prepare?form=true";return this.backend.getJson(r).pipe(i.map((function(e){return e.map((function(e){return new gt(e)}))})),i.tap((function(){return t.fetchPreparedItemsCount()})),i.tap((function(e){return t.preparedItemsSource.next(e.sort(nt.sortValues("created","desc")))})))},e.prototype.deletePreparedItem=function(e){var t=this;return this.backend.del("/prepare/"+e).pipe(i.tap((function(){return t.getPreparedItems$()})))},e.prototype.getPrepareRootTypes=function(){return this.backend.getViaTempCache("/prepare/types").pipe(i.map((function(e){return e.types.map((function(e){return new ht(e)}))})))},e.prototype.getPrepareChildTypes=function(e,t){var r=e?{parentId:e,withcontent:t}:{withcontent:t},n=nt.buildUri("/prepare/types",r);return this.backend.getViaTempCache(n).pipe(i.map((function(e){return{parent:e.parent,types:e.types.map((function(e){return new ht(e)}))}})))},e.prototype.getPreviewUri=function(e,t,r){return nt.buildUri(this.backend.getServiceBase()+"/prepare/"+e+"/content",{rendition:r,index:t})},e.prototype.updateChildType=function(e,t){return this.backend.put("/prepare/"+t+"/"+e+"?form=true&contentmeta=true").pipe(i.map((function(e){return new gt(e)})))},e.prototype.addTemplate=function(e,t){return this.backend.put("/prepare/"+e+"/template?templateid="+t).pipe(i.map((function(e){return new gt(e)})))},e.prototype.getTemplates=function(e){return this.backend.getJson("/template/list?type="+e).pipe(i.map((function(e){return e})))},e.prototype.getTemplatePreviewUri=function(e,t){return nt.buildUri(this.backend.getServiceBase()+"/template/"+e+"/content",{rendition:t})},e.prototype.commitPreparedItem=function(e,t,r){var n=this;return this.backend.put("/prepare/"+e+"/"+t).pipe(i.mergeMap((function(){return n.backend.post("/prepare/commit/"+e,r)})),i.tap((function(){return n.getPreparedItems$()})),i.map((function(e){return e.id})))},e.prototype.uploadContent=function(e,t){var r=this.backend.getServiceBase()+"/prepare/"+e+"/content.json?form=true&contentmeta=true";return this.uploadService.upload(r,[t]).pipe()},e.prototype.uploadToTarget=function(e,t,r){var n=this,o=t.map((function(e){return e._file}));return this.uploadService.upload(this.getUploadTarget(e,r),o).pipe(i.tap((function(){return n.getPreparedItems$()})))},e.prototype.getUploadTarget=function(e,t){var r;if(e.type===bt.ROOT)r=this.backend.getServiceBase()+this.createPreparedItemPostUrl({parentId:null,createMany:!t});else if(e.type===bt.OBJECT){var n=e.referenceObject;r=this.backend.getServiceBase()+"/dms/"+n.id+"/contents?type="+n.type.name}else e.type!==bt.CONTEXT&&e.type!==bt.CONTEXT_TREE||(r=this.backend.getServiceBase()+this.createPreparedItemPostUrl({parentId:e.referenceObject.id,createMany:!t,childType:e.subFolder&&e.subFolder.data.type?e.subFolder.data.type:null}));return r},e.prototype.deletePreparedItemContent=function(e,t){var r="/prepare/"+e+"/content"+(void 0!==t?"?index="+t:"");return this.backend.del(r).pipe(i.map((function(e){return new gt(e)})))},e}();vt.decorators=[{type:r.Injectable}],vt.ctorParameters=function(){return[{type:pt},{type:yt}]};
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ngx-translate/core"),require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/common/locales/de-CH"),require("@angular/common/locales/extra/de-CH"),require("@angular/common/locales/de"),require("@angular/common/locales/extra/de"),require("@angular/common/locales/ar"),require("@angular/common/locales/extra/ar"),require("@angular/common/locales/es"),require("@angular/common/locales/extra/es"),require("@angular/common/locales/pt"),require("@angular/common/locales/extra/pt"),require("@angular/common/locales/fr"),require("@angular/common/locales/extra/fr"),require("@angular/common/locales/zh"),require("@angular/common/locales/extra/zh"),require("@angular/common/locales/zh-Hant"),require("@angular/common/locales/extra/zh-Hant"),require("@angular/common/locales/lv"),require("@angular/common/locales/extra/lv"),require("@angular/common/locales/ru"),require("@angular/common/locales/extra/ru"),require("@angular/common/locales/it"),require("@angular/common/locales/extra/it"),require("@angular/common/locales/nl"),require("@angular/common/locales/extra/nl"),require("@angular/common/locales/sk"),require("@angular/common/locales/extra/sk"),require("@angular/common/locales/pl"),require("@angular/common/locales/extra/pl"),require("@angular/common/locales/uk"),require("@angular/common/locales/extra/uk"),require("@angular/common/locales/ja"),require("@angular/common/locales/extra/ja"),require("@angular/common/locales/ko"),require("@angular/common/locales/extra/ko"),require("@angular/common/locales/hi"),require("@angular/common/locales/extra/hi"),require("@angular/common/locales/bn"),require("@angular/common/locales/extra/bn"),require("@angular/common/locales/vi"),require("@angular/common/locales/extra/vi"),require("@angular/common/locales/th"),require("@angular/common/locales/extra/th"),require("@angular/common/locales/en-GB"),require("@angular/common/locales/extra/en-GB"),require("moment"),require("@ngx-pwa/local-storage"),require("file-saver"),require("lodash"),require("ngx-toastr")):"function"==typeof define&&define.amd?define("@eo-sdk/client/projects/eo-sdk/core",["exports","@ngx-translate/core","@angular/core","@angular/common/http","rxjs","rxjs/operators","@angular/common","@angular/common/locales/de-CH","@angular/common/locales/extra/de-CH","@angular/common/locales/de","@angular/common/locales/extra/de","@angular/common/locales/ar","@angular/common/locales/extra/ar","@angular/common/locales/es","@angular/common/locales/extra/es","@angular/common/locales/pt","@angular/common/locales/extra/pt","@angular/common/locales/fr","@angular/common/locales/extra/fr","@angular/common/locales/zh","@angular/common/locales/extra/zh","@angular/common/locales/zh-Hant","@angular/common/locales/extra/zh-Hant","@angular/common/locales/lv","@angular/common/locales/extra/lv","@angular/common/locales/ru","@angular/common/locales/extra/ru","@angular/common/locales/it","@angular/common/locales/extra/it","@angular/common/locales/nl","@angular/common/locales/extra/nl","@angular/common/locales/sk","@angular/common/locales/extra/sk","@angular/common/locales/pl","@angular/common/locales/extra/pl","@angular/common/locales/uk","@angular/common/locales/extra/uk","@angular/common/locales/ja","@angular/common/locales/extra/ja","@angular/common/locales/ko","@angular/common/locales/extra/ko","@angular/common/locales/hi","@angular/common/locales/extra/hi","@angular/common/locales/bn","@angular/common/locales/extra/bn","@angular/common/locales/vi","@angular/common/locales/extra/vi","@angular/common/locales/th","@angular/common/locales/extra/th","@angular/common/locales/en-GB","@angular/common/locales/extra/en-GB","moment","@ngx-pwa/local-storage","file-saver","lodash","ngx-toastr"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["eo-sdk"]=e["eo-sdk"]||{},e["eo-sdk"].client=e["eo-sdk"].client||{},e["eo-sdk"].client.projects=e["eo-sdk"].client.projects||{},e["eo-sdk"].client.projects["eo-sdk"]=e["eo-sdk"].client.projects["eo-sdk"]||{},e["eo-sdk"].client.projects["eo-sdk"].core={}),e.core,e.ng.core,e.ng.common.http,e.rxjs,e.rxjs.operators,e.ng.common,e.ng.common.locales.deCH,e.ng.common.locales.extra.deCH,e.ng.common.locales.de,e.ng.common.locales.extra.de,e.ng.common.locales.ar,e.ng.common.locales.extra.ar,e.ng.common.locales.es,e.ng.common.locales.extra.es,e.ng.common.locales.pt,e.ng.common.locales.extra.pt,e.ng.common.locales.fr,e.ng.common.locales.extra.fr,e.ng.common.locales.zh,e.ng.common.locales.extra.zh,e.ng.common.locales.zhHant,e.ng.common.locales.extra.zhHant,e.ng.common.locales.lv,e.ng.common.locales.extra.lv,e.ng.common.locales.ru,e.ng.common.locales.extra.ru,e.ng.common.locales.it,e.ng.common.locales.extra.it,e.ng.common.locales.nl,e.ng.common.locales.extra.nl,e.ng.common.locales.sk,e.ng.common.locales.extra.sk,e.ng.common.locales.pl,e.ng.common.locales.extra.pl,e.ng.common.locales.uk,e.ng.common.locales.extra.uk,e.ng.common.locales.ja,e.ng.common.locales.extra.ja,e.ng.common.locales.ko,e.ng.common.locales.extra.ko,e.ng.common.locales.hi,e.ng.common.locales.extra.hi,e.ng.common.locales.bn,e.ng.common.locales.extra.bn,e.ng.common.locales.vi,e.ng.common.locales.extra.vi,e.ng.common.locales.th,e.ng.common.locales.extra.th,e.ng.common.locales.enGB,e.ng.common.locales.extra.enGB,e.momentImported,e.localStorage,e.FileSaver,e._,e.ngxToastr)}(this,(function(e,t,r,n,o,i,s,a,c,u,p,l,h,f,d,m,g,y,b,v,S,E,T,O,I,k,C,x,_,A,R,w,D,j,P,N,F,U,L,M,B,H,q,Q,G,V,J,z,Y,K,$,W,Z,X,ee,te){"use strict";function re(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function ne(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var oe=re(a),ie=re(c),se=re(u),ae=re(p),ce=re(l),ue=re(h),pe=re(f),le=re(d),he=re(m),fe=re(g),de=re(y),me=re(b),ge=re(v),ye=re(S),be=re(E),ve=re(T),Se=re(O),Ee=re(I),Te=re(k),Oe=re(C),Ie=re(x),ke=re(_),Ce=re(A),xe=re(R),_e=re(w),Ae=re(D),Re=re(j),we=re(P),De=re(N),je=re(F),Pe=re(U),Ne=re(L),Fe=re(M),Ue=re(B),Le=re(H),Me=re(q),Be=re(Q),He=re(G),qe=re(V),Qe=re(J),Ge=re(z),Ve=re(Y),Je=re(K),ze=re($),Ye=ne(W),Ke=new r.InjectionToken("CUSTOM_CONFIG"),$e=new r.InjectionToken("CORE_CONFIG"),We=function(e){this.main=["assets/_default/config/main.json","assets/_default/config/extend.json"],this.translations=["assets/_default/i18n/"],this.environment={production:!0},Object.assign(this,e)};function Ze(e){return function(){return e.initialize()}}We.ctorParameters=function(){return[{type:We,decorators:[{type:r.Inject,args:[Ke]}]}]};var Xe=function(){function e(){}return e.prototype.handle=function(e){return"!missing key: "+e.key},e}(),et=function(){function e(e,t){this.http=e,this.config=t,s.registerLocaleData(se.default,"de",ae.default),s.registerLocaleData(ce.default,"ar",ue.default),s.registerLocaleData(pe.default,"es",le.default),s.registerLocaleData(he.default,"pt",fe.default),s.registerLocaleData(de.default,"fr",me.default),s.registerLocaleData(ge.default,"zh",ye.default),s.registerLocaleData(Se.default,"lv",Ee.default),s.registerLocaleData(Te.default,"ru",Oe.default),s.registerLocaleData(Ie.default,"it",ke.default),s.registerLocaleData(Ce.default,"nl",xe.default),s.registerLocaleData(_e.default,"sk",Ae.default),s.registerLocaleData(Re.default,"pl",we.default),s.registerLocaleData(De.default,"uk",je.default),s.registerLocaleData(Pe.default,"ja",Ne.default),s.registerLocaleData(Fe.default,"ko",Ue.default),s.registerLocaleData(Le.default,"hi",Me.default),s.registerLocaleData(Be.default,"bn",He.default),s.registerLocaleData(oe.default,"de-CH",ie.default),s.registerLocaleData(be.default,"zh-Hant",ve.default),s.registerLocaleData(Ge.default,"th",Ve.default),s.registerLocaleData(qe.default,"vi",Qe.default),s.registerLocaleData(Je.default,"en-GB",ze.default)}return e.prototype.getTranslation=function(e){var t=this;return o.forkJoin(this.config.translations.map((function(r){return t.loadTranslationFile(r,e)}))).pipe(i.map((function(e){return e.reduce((function(e,t){return Object.assign(e,t)}),{})})))},e.prototype.loadTranslationFile=function(e,t){var r=this;return this.http.get(""+e+t+".json").pipe(i.catchError((function(n){return t.length>2?r.loadTranslationFile(e,t.substring(0,2)):o.of({})})))},e}();et.ctorParameters=function(){return[{type:n.HttpClient},{type:We,decorators:[{type:r.Inject,args:[$e]}]}]};var tt=function(){function e(e,t,r,n){this.originalError=e,this._name=t,this._message=r,this._skipNotification=n}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name||this.originalError.name||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message||this.originalError.message||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stack",{get:function(){return this.originalError.stack},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.originalError.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this.originalError.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skipNotification",{get:function(){return void 0===this._skipNotification?!!this.originalError.skipNotification:this._skipNotification},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHttpErrorResponse",{get:function(){return this.originalError.isHttpErrorResponse||this.originalError instanceof n.HttpErrorResponse},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.originalError.toString()},e}(),rt=Ye,nt=function(){function e(){}return e.buildUri=function(e,t){var r=Object.keys(t).filter((function(e){return t[e]||0===t[e]||!1===t[e]})).map((function(e){return e+"="+encodeURIComponent(t[e])})).join("&");return e+(r?"?"+r:"")},e.uuid=function(){return e._p8()+e._p8(!0)+e._p8(!0)+e._p8()},e.encodeFileName=function(t){return"=?UTF-8?Q?"+e.encodeToQuotedPrintable(e.encodeToUtf8(t)).replace(/_/g,"=5F")+"?="},e._p8=function(e){var t=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+t.substr(0,4)+"-"+t.substr(4,4):t},e.encodeToUtf8=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},e.quotedPrintable=function(e){if(e>"ÿ")throw RangeError("`encodeToQuotedPrintable` expects extended ASCII input only. Missing prior UTF-8 encoding?");return"="+("0"+e.charCodeAt(0).toString(16).toUpperCase()).slice(-2)},e.encodeToQuotedPrintable=function(e){return e.replace(/[\0-\b\n-\x1F=\x7F-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/g,this.quotedPrintable)},e.sortValues=function(t,r,n,o){void 0===t&&(t=""),void 0===r&&(r="asc");return function(i,s){var a,c=e.getProperty(i,t),u=e.getProperty(s,t);if("number"==typeof c&&"number"==typeof u)a=c-u;else{var p=c||0===c?c.toString():"",l=u||0===u?u.toString():"";a=p.localeCompare(l,n,o)}return"desc"===r?-1*a:a}},e.getProperty=function(e,t){return void 0===t&&(t=""),t?t.split(".").reduce((function(e,t){return(e||{})[t]}),e):e},e.empty=function(e){return function(e){return o.EMPTY}},e.catchSkip=function(e,t,r,n){return function(i){var s=t&&t(i),a=e&&e(i);return o.throwError(new tt(s instanceof Error?s:i,r,n,a))}},e.catch=function(e,t,r,n){return function(i){var s=e&&e(i);return o.throwError(new tt(s instanceof Error?s:i,t,r,n))}},e.throw=function(e,t,r,n){return function(o){var i=e&&e(o);throw new tt(i instanceof Error?i:o,t,r,n)}},e.logError=function(t,r,n,o){return void 0===o&&(o=!0),e.throw(t,r,n,o)},e.isVisible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},e.getBaseHref=function(){return document.getElementsByTagName("base")[0].getAttribute("href")},e.truncateString=function(e,t,r){return void 0===r&&(r="..."),e.length>t&&(t>3&&(t-=3),e=""+e.substring(0,t)+r),e},e.getTimezoneOffset=function(){return rt().format("Z")},e.formatMailTo=function(e,t){return t&&e?Array.isArray(e)?e.join().replace(/,/g,"; "):e.replace(/,/g,"; "):e},e.arrayToObject=function(e,t,r){void 0===e&&(e=[]);var n="string"==typeof t?function(e){return e[t]}:t,o="string"==typeof r?function(e){return e[r]}:r;return e.reduce((function(e,t,r){return e[n?n(t):r]=o?o(t):t,e}),{})},e}(),ot=function(){function e(){this.eventSource=new o.Subject,this.event$=this.eventSource.asObservable()}return e.prototype.trigger=function(e,t){this.eventSource.next({type:e,data:t})},e.prototype.on=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.event$.pipe(i.filter((function(t){return t&&!!e.find((function(e){return e===t.type}))})))},e}();ot.decorators=[{type:r.Injectable}],ot.ctorParameters=function(){return[]};var it={LOGOUT:"eo.user.logout",CLIENT_LOCALE_CHANGED:"eo.user.locale.client.changed",SCHEMA_LOCALE_CHANGED:"eo.user.locale.schema.changed",DMS_OBJECT_LOADED:"eo.dms.object.loaded",DMS_OBJECT_DELETED:"eo.dms.object.deleted",DMS_OBJECT_VERSION_RESTORED:"eo.dms.object.version.restored",DMS_OBJECT_FAVORITE_ON:"eo.dms.object.favorite.on",DMS_OBJECT_FAVORITE_OFF:"eo.dms.object.favorite.off",DMS_OBJECT_UPDATED:"eo.dms.object.updated",DMS_OBJECT_PASTED:"eo.dms.object.pasted",INBOX_ITEM_CONFIRMED:"eo.inbox.item.confirmed",PROCESS_FILE_CHANGED:"eo.process.file.changed",EO_DIALOG_STACK_CHANGED:"eo.dialog.stack.changed",SYSTEM_STATUS_SCHEMA_CHANGED:"eo.status.schema",SYSTEM_STATUS_ORG_CHANGED:"eo.status.org",SYSTEM_STATUS_SEC_CHANGED:"eo.status.sec",SYSTEM_STATUS_ACL_CHANGED:"eo.status.acl",SYSTEM_STATUS_INBOX_CHANGED:"eo.status.inbox",EO_LICENSE_GRID:"eo_license_grid"},st=function(){function e(e,t){this.translate=e,this.event=t,this.cfg=null}return e.prototype.initializeGrid=function(){this.event.trigger(it.EO_LICENSE_GRID)},e.prototype.set=function(e){this.cfg=e;var t=this.getClientLocales().map((function(e){return e.iso}));this.translate.addLangs(t),this.translate.setDefaultLang(this.getDefaultClientLocale()),this.initializeGrid()},e.prototype.getLoginBase=function(){var e=this.getUri("loginBase");return e&&"/"!==e?e:""},e.prototype.getRaw=function(e){return e?nt.getProperty(this.cfg,e):this.cfg},e.prototype.getUri=function(e){return this.cfg.uri[e]},e.prototype.getClientLocales=function(){return this.cfg.languages},e.prototype.getDashboardBackgroundImage=function(){return this.cfg.dashboardBackgroundImage},e.prototype.getSideBarHeaderImage=function(){return this.cfg.sideBarHeaderImage},e.prototype.getNavigationBarImage=function(){var e=this.cfg.navBarLogo;return e=e.endsWith(".svg")?e:"<svg></svg>"},e.prototype.getDefaultClientLocale=function(){var e=this.getClientLocales().find((function(e){return e.fallback}));return e?e.iso:"en"},e.prototype.getAgentConfig=function(){return this.cfg.agent},e}();st.decorators=[{type:r.Injectable}],st.ctorParameters=function(){return[{type:t.TranslateService},{type:ot}]};var at=function(){function e(e,t){var r=this;this.storage=e,this.storageMap=t,this.SYSTEM_DEFINITION="eo.framework.cache.systemdefinition",this.HOSTS="eo.framework.cache.hosts",this.LOCATION_HISTORY="eo.framework.cache.locations.history",this.itemsMap=new Map,window._ngStorageRefresh=function(){return r.getStorage().subscribe((function(e){return r.setStorage(e).subscribe()&&console.log(e)}))}}return e.prototype.setItem=function(e,t,r){var n=this;if(void 0===r&&(r=500),r){if(!this.itemsMap.has(e)){var s=new o.Subject;s.pipe(i.debounceTime(r),i.switchMap((function(t){return n.storage.setItem(e,t)}))).subscribe(),this.itemsMap.set(e,s)}return this.itemsMap.get(e).next(t),o.of(!0)}return this.storage.setItem(e,t)},e.prototype.getItem=function(e){return this.storage.getItem(e).pipe(i.map((function(e){return"value"===Object.keys(e||{}).join()?e.value:e})))},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.clear=function(e){var t=this;return e?this.getStorageKeys().pipe(i.switchMap((function(r){var n=r.filter((function(t){return e(t)})).map((function(e){return t.removeItem(e)}));return n.length?o.forkJoin(n).pipe(i.map((function(){return!0}))):o.of(!0)}))):this.storage.clear()},e.prototype.getStorageKeys=function(){var e=this;return new o.Observable((function(t){var r=[];e.storageMap.keys().subscribe({next:function(e){return r.push(e)},complete:function(){return t.next(r)}})})).pipe(i.first())},e.prototype.getStorage=function(){var e=this;return this.getStorageKeys().pipe(i.switchMap((function(t){return t.length?o.forkJoin(nt.arrayToObject(t,(function(e){return e}),(function(t){return e.getItem(t)}))):o.of({})})))},e.prototype.setStorage=function(e){var t=this;return o.forkJoin(Object.keys(e||{}).map((function(r){return t.setItem(r,e[r])})))},e}();at.decorators=[{type:r.Injectable}],at.ctorParameters=function(){return[{type:Z.LocalStorage},{type:Z.StorageMap}]};var ct=function(){function e(e){var t=e.user,r=e.schema;this.id=t.id,this.name=t.name,this.firstname=t.firstname,this.lastname=t.lastname,this.title=t.title,this.email=t.email,this.present=t.present,!0===t.hasimage&&(this.imageUri="/organization/image/"+this.id),this.userSettings="object"==typeof e.usersettings?e.usersettings:{},this.schema={version:r.version,supportedLocales:r.supportedlocales},this.privileges=t.privileges,this.roles=t.effectiveroles,this.deputies=t.deputies||[],this.substitutesOf=t.substitutesOf||[],this.schemaLocale=t.locale||this.getClientLocale()}return e.prototype.hasPrivilege=function(e){var t=!1;if(this.privileges)for(var r=0;!t&&r<this.privileges.length;)t=this.privileges[r].name===e,r++;return t},e.prototype.hasRole=function(e){var t=!1;if(this.roles)for(var r=0;!t&&r<this.roles.length;)t=this.roles[r].name===e,r++;return t},e.prototype.setImageBase=function(e){this.imageUri&&(this.imageUri=e+this.imageUri)},e.prototype.getClientLocale=function(){return this.userSettings.clientlocale||"en"},e.prototype.getSchemaLocale=function(){return this.schemaLocale},e}(),ut=function(){function e(){}return e.prototype.assert=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.group=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.groupEnd=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e}();ut.decorators=[{type:r.Injectable}];var pt=function(){function e(e,t,r){this.http=e,this.logger=t,this.config=r,this.gridDataFilter=i.map((function(e){return null==e?void 0:e.filter((function(e){return!e.__removed}))})),this.cache=new Map,this.temp=new Map,this.headers=this.setDefaultHeaders(),this.authProfile={host:"",ntlm:!0}}return e.prototype.setAuthProfile=function(e){e&&(this.headers=this.setDefaultHeaders(),this.authProfile=e,this.authProfile.auth,this.headers.delete("Authorization"))},e.prototype.setHeader=function(e,t){t&&t.length&&(this.headers=this.headers.set(e,t))},e.prototype.getHeaders=function(){return this.headers},e.prototype.getHttpOptions=function(e){return Object.assign({headers:this.getHeaders()},e)},e.prototype.getServiceBase=function(){return this.getHost()+this.config.getUri("serviceBase")},e.prototype.getSearchBase=function(){return this.getHost()+this.config.getUri("searchBase")},e.prototype.getContextBase=function(){return this.getHost()+this.config.getUri("contextBase")},e.prototype.getInboxBase=function(){return this.getHost()+this.config.getUri("inboxBase")},e.prototype.getBpmBase=function(){return this.getHost()+this.config.getUri("bpmBase")},e.prototype.getAgentBase=function(){return this.getHost()+this.config.getUri("agentBase")},e.prototype.getStatusBase=function(){return this.getHost()+this.config.getUri("statusBase")},e.prototype.getIconBase=function(e){return void 0===e&&(e=""),this.getServiceBase()+"/ui/icon/"+e},e.prototype.getHost=function(){return this.authProfile.host||""},e.prototype.get=function(e,t,r){return this.http.get((t||this.getServiceBase())+e,this.getHttpOptions(r))},e.prototype.put=function(e,t,r,n){return this.http.put((r||this.getServiceBase())+e,t,this.getHttpOptions(n))},e.prototype.getJson=function(e,t){return this.get(e,t||this.getServiceBase(),{responseType:"json"})},e.prototype.post=function(e,t,r,n){var o=r||this.getServiceBase(),i=t?JSON.stringify(t):"";return this.http.post(""+o+e,i,this.getHttpOptions(n))},e.prototype.postMultiPart=function(e,t,r,n){var o=r||this.getServiceBase(),i=this.getHeaders();i.delete("Content-Type");var s=Object.assign({headers:i},n);return this.http.post(""+o+e,t,s)},e.prototype.del=function(e,t,r){return this.http.delete((t||this.getServiceBase())+e,this.getHttpOptions(r))},e.prototype.update=function(e,t){return t.forEach((function(t){var r=t.id,n=t.item;if(r){var o=e.find((function(e){return e.id===r}));Object.assign(o,n,n?{__updated:!0}:{__removed:!0})}else n&&e.unshift(Object.assign(n,{__added:!0}))})),e},e.prototype.getViaCache=function(e){var t=this;return this.cache.has(e)?o.of(this.cache.get(e)):this.getViaTempCache(e,(function(){return t.http.get(e,{responseType:"text"}).pipe(i.tap((function(r){return t.cache.set(e,r)})))}))},e.prototype.getViaTempCache=function(e,t){var r=this;if(this.temp.has(e))return this.temp.get(e);var n=(t?t():this.get(e)).pipe(i.finalize((function(){return r.temp.delete(e)})),i.shareReplay(1));return this.temp.set(e,n),n},e.prototype.downloadContent=function(e,t,r){var n=this;e.forEach((function(e){if(e.content){var o=n.getServiceBase()+"/dms/"+e.content.id+"/content?type="+e.content.type+"&asdownload=true";o+=t?"&rendition="+t+"&_intent=DOWNLOAD_"+t:"&_intent=DOWNLOAD",e.content.id===e.id&&(o+="&version="+e.version),n.download(o,r?e.version:null)}else n.logger.error("The provided dms object has no content",e)}))},e.prototype.download=function(e,t){var r=this;this.http.get(e,{observe:"response",responseType:"blob"}).subscribe((function(e){X.saveAs(e.body,r.getFileNameFromHttpResponse(e,t))}))},e.prototype.getFileNameFromHttpResponse=function(e,t){var r=e.headers.get("Content-Disposition")||"",n=r.match("filename\\*=UTF-8''(.*)")||r.match('filename="(.*)"'),o=n?n[1]:null,i=o?decodeURIComponent(o):"unknown",s=~i.lastIndexOf(".")?i.lastIndexOf("."):i.length;return t?i.slice(0,s)+"_v"+t+i.slice(s):i},e.prototype.setDefaultHeaders=function(){return new n.HttpHeaders({"Content-Type":"application/json","X-os-include-links":"false","X-os-include-actions":"false","X-os-sync-index":"true"})},e}();pt.decorators=[{type:r.Injectable}],pt.ctorParameters=function(){return[{type:n.HttpClient},{type:ut},{type:st}]};var lt,ht=function(){function e(e){this.id=e.id,this.implements=e.implements?e.implements:[],this.isFolder=e.folder,this.isContextFolder=e.iscontextfolder,this.isAbstract=e.abstract,this.iconId=e.icon?e.icon.id:null,this.maxFiles=e.maxfiles,this.minFiles=e.minfiles,this.name=e.name,this.qname=e.qname,this.label=e.label,this.description=e.description,this.group=e.group?e.group.label:"",this.elements=e.elements,this.allowedcontexttypes=e.allowedcontexttypes?e.allowedcontexttypes:[],this.supertypes=e.supertypes?e.supertypes.map((function(e){return e.name})):[],this.shareable=e.shareable,this.parenttypes=this.getParentTypes(e.allowedlocations)}return e.prototype.getParentTypes=function(e){return e?e.parenttypes.map((function(e){return e.name})):[]},e}(),ft=Ye,dt=function(){function e(e,t,r,n){var i=this;this.backend=e,this.logger=t,this.eventService=r,this.appCache=n,this.systemSource=new o.ReplaySubject,this.system$=this.systemSource.asObservable(),this.objectTypeForms=[],this.cachedRoles=[],this.eventService.on(it.SYSTEM_STATUS_SCHEMA_CHANGED).subscribe((function(){i.fetchSystemDefinition(i.user)}))}return Object.defineProperty(e.prototype,"system",{get:function(){return JSON.parse(JSON.stringify(this._system))},set:function(e){this._system=e},enumerable:!1,configurable:!0}),e.prototype.getObjectTypes=function(){return this.system.types},e.prototype.getObjectType=function(e){return this.system.types.find((function(t){return t.name===e}))},e.prototype.getFormElementsFromFormModel=function(e,t,r){var n=this;return this.getObjectTypeForm(e,t,r?"CONTEXT":null).pipe(i.switchMap((function(e){var t=[];return n.processFormModelElements(e,t),o.of(t)})))},e.prototype.processFormModelElements=function(e,t){var r=this;e.elements.forEach((function(e){"o2mGroup"!==e.type&&"o2mGroupStack"!==e.type?t.push(e):e.elements&&e.elements.length&&r.processFormModelElements(e,t)}))},e.prototype.implementsType=function(e,t){return e.name===t||e.implements&&-1!==e.implements.indexOf(t)},e.prototype.getCodesystem=function(e){return this.system.codesystems.find((function(t){return t.id===e||t.name===e}))},e.prototype.getObjectTypeForm=function(e,t,r){for(var n,s=this,a=0;!n&&a<this.objectTypeForms.length;)this.objectTypeForms[a].name===e&&this.objectTypeForms[a].mode===r&&this.objectTypeForms[a].situation===t&&(n=this.objectTypeForms[a]),a++;if(n)return o.of(ee.cloneDeep(n));var c="/ui/form/"+e+"?situation="+t;return c+=r?"&formmode="+r:"",this.backend.getViaTempCache(c,(function(){return s.backend.getJson(c).pipe(i.tap((function(e){return s.objectTypeForms.push(ee.cloneDeep(e))})))}))},e.prototype.getSystemDefinition=function(e){return this.user=e,this.fetchSystemDefinition(e)},e.prototype.getDefaultValue=function(e){var t;switch(e){case"CURRENT_USER":t=this.user.name;break;case"CURRENT_USER_NAME":t=this.user.title;break;case"CURRENT_DATETIME":t=new Date;break;case"CURRENT_DATE":t=ft().startOf("day").toDate();break;case"YEAR":t=ft().year();break;case"MONTH":t=ft().month()+1;break;case"DAY":t=ft().date();break;case"HOUR":t=ft().hour();break;case"MINUTE":t=ft().minute();break;case"SECOND":t=ft().second();break;case"WEEK_OF_YEAR":t=ft().isoWeek();break;case"FIRST_DAY_OF_WEEK":t=ft().startOf("isoWeek").toDate();break;case"FIRST_DAY_OF_MONTH":t=ft().startOf("month").toDate();break;case"FIRST_DAY_OF_YEAR":t=ft().startOf("year").toDate()}return t},e.prototype.fetchSystemDefinition=function(e){var t=this,r=[this.backend.getJson("/system/type/list?elements=true&basetypes=true"),this.backend.getJson("/system/cs/list?elements=true")];return o.forkJoin(r).pipe(i.catchError(nt.catch((function(e){t.logger.error("Error fetching recent version of system definition from server.",e),t.systemSource.error("Error fetching recent version of system definition from server.")}))),i.map((function(r){t.objectTypeForms=[];var n={info:{user:e.id,locale:e.getSchemaLocale(),version:e.schema.version},locales:e.schema.supportedLocales,types:[],codesystems:[]},o=r[0];return n.types=o.map((function(e){return new ht(e)})),n.codesystems=r[1],t.system=n,t.systemSource.next(n),t.logger.debug("Fetched new version of system definition (user: "+e.id+", version: "+e.schema.version+")."),t.appCache.setItem(t.appCache.SYSTEM_DEFINITION,n).subscribe((function(){t.logger.debug("Cached recent version")}),nt.logError(null,"Error caching recent version of system definition.")),!0})))},e.prototype.getOrganizationObjectById=function(e){return this.backend.getJson("/organization/id/"+e)},e.prototype.getOrganizationObject=function(e){return this.getOrganizationObjects([e]).pipe(i.map((function(e){return e[0]})))},e.prototype.getOrganizationObjects=function(e){var t=this,r=e.map((function(e){return t.backend.getJson("/organization/name/"+e).pipe(i.catchError((function(t){return o.of({id:e,active:!1})})))}));return o.forkJoin(r)},e.prototype.getRoles=function(){var e=this;return this.cachedRoles.length?o.of(this.cachedRoles):this.backend.get("/organization/role").pipe(i.map((function(e){return e})),i.tap((function(t){return e.cachedRoles=t})))},e}();dt.decorators=[{type:r.Injectable}],dt.ctorParameters=function(){return[{type:pt},{type:ut},{type:ot},{type:at}]},(lt=e.Direction||(e.Direction={})).LTR="ltr",lt.RTL="rtl";var mt=function(){function t(e,t,r,n,s,a){this.backend=e,this.translate=t,this.logger=r,this.eventService=n,this.system=s,this.config=a,this.USER_FETCH_URI="/user?favorites=true&privileges=true&roles=true&deputies=true&substitutesOf=true",this.user=null,this.userSource=new o.BehaviorSubject(this.user),this.user$=this.userSource.asObservable(),this.favorites=null,this.favoritesSource=new o.BehaviorSubject(this.favorites),this.favoritesGridData$=this.favoritesSource.asObservable().pipe(i.debounceTime(100),i.filter((function(e){return e}))),this.favorites$=this.favoritesGridData$.pipe(this.backend.gridDataFilter),this.notifications=null,this.notificationsSource=new o.BehaviorSubject(this.notifications),this.notificationsGridData$=this.notificationsSource.asObservable().pipe(i.debounceTime(100),i.filter((function(e){return e}))),this.notifications$=this.notificationsGridData$.pipe(this.backend.gridDataFilter)}return t.prototype.getCurrentUser=function(){return this.user},t.prototype.setPresence=function(e){var t=this;return e!==this.user.present?this.backend.put("/user?presence="+e).pipe(i.tap((function(r){t.user.present=e,t.userSource.next(t.user)}))):o.of(null)},t.prototype.setDeputies=function(e){var t=this;return this.backend.put("/user/deputy?user="+e.join("&user=")).pipe(i.tap((function(){return t.refreshCurrentUser().subscribe()})))},t.prototype.changeClientLocale=function(t){var r=this;this.user.userSettings.clientlocale=t,this.backend.put("/user/config/web",this.user.userSettings).subscribe((function(){r.logger.debug("Changed client locale to '"+t+"'"),r.translate.use(t),r.user.uiDirection=(r.config.getClientLocales().find((function(e){return e.iso===t}))||{}).dir||e.Direction.LTR,r.userSource.next(r.user),r.eventService.trigger(it.CLIENT_LOCALE_CHANGED,t)}))},t.prototype.changeSchemaLocale=function(e){var t=this;return this.user.schemaLocale=e,this.backend.put("/user/locale/"+this.user.schemaLocale).pipe(i.tap((function(){t.logger.debug("Changed schema locale to '"+e+"'"),t.userSource.next(t.user),t.backend.setHeader("Accept-Language",t.user.getSchemaLocale()),t.logger.debug("Loading system definition for new locale."),t.system.getSystemDefinition(t.user).subscribe(),t.eventService.trigger(it.SCHEMA_LOCALE_CHANGED,e)})))},t.prototype.setCurrentUser=function(t){this.user=new ct(t),this.passwordValidationSettings=t.passwortvalidation,this.user.setImageBase(this.backend.getServiceBase()),this.backend.setHeader("Accept-Language",this.user.getSchemaLocale());var r=this.config.getClientLocales().map((function(e){return e.iso})),n=this.user.getClientLocale();-1===r.indexOf(n)&&(n=this.config.getDefaultClientLocale()),this.logger.debug("Setting client locale to '"+n+"'"),this.translate.use(n),this.user.uiDirection=(this.config.getClientLocales().find((function(e){return e.iso===n}))||{}).dir||e.Direction.LTR,this.userSource.next(this.user),this.favorites=null,this.favoritesSource.next(this.favorites),this.notifications=null,this.notificationsSource.next(this.notifications)},t.prototype.getFavorites=function(){var e=this;return this.backend.getJson("/user/favorites").pipe(i.map((function(e){return e&&e.filter((function(e){return"DMS_OBJECT"===e.favoritetype}))})),i.tap((function(t){e.favorites=t,e.favoritesSource.next(e.favorites)})))},t.prototype.updateFavorites=function(e,t,r){this.backend.update(this.favorites,r||[{id:e,item:t}])&&this.favoritesSource.next(this.favorites)},t.prototype.getNotifications=function(){var e=[this.getSubscription(),this.getResubmission()];return o.forkJoin(e)},t.prototype.getResubmission=function(){var e=this;return this.backend.getJson("/messageprovider/resubmission/list").pipe(i.tap((function(t){e.notifications=t,e.notificationsSource.next(e.notifications)})))},t.prototype.getSubscription=function(){var e=this;return this.backend.getJson("/messageprovider/subscription/list").pipe(i.tap((function(t){e.notifications=t,e.notificationsSource.next(e.notifications)})))},t.prototype.removeNotifications=function(e,t){var r,n=this;switch(t){case"SUBSCRIPTION":r="subscription";break;case"RESUBMISSION":r="resubmission";break;default:return}return this.backend.del("/messageprovider/"+r+"/"+e).pipe(i.tap((function(e){return n.updateNotifications("")})))},t.prototype.updateNotifications=function(e,t,r){this.backend.update(this.notifications,r||[{id:e,item:t}])&&this.notificationsSource.next(this.notifications)},t.prototype.getUserImageUri=function(e){return this.backend.getServiceBase()+"/organization/image/"+e},t.prototype.removeFavorite=function(e){var t=this;return this.backend.del("/user/favorite/"+e).pipe(i.tap((function(r){return t.updateFavorites(e)})))},t.prototype.createFavorite=function(e,t,r){var n=this,o=nt.buildUri("/dms/favorite/"+e,{type:t,title:r});return this.backend.post(o,{}).pipe(i.tap((function(e){return n.getFavorites().subscribe()})))},t.prototype.removeFavoritesForTarget=function(e){var t=this;return this.backend.del("/dms/favorite/"+e).pipe(i.tap((function(r){var n=t.favorites.filter((function(t){return t.target.id===e})).map((function(e){return Object.assign({id:e.id})}));t.updateFavorites(null,null,n)})))},t.prototype.changeLockSetting=function(e){var t=this;return this.user.userSettings.alwayslock=e,this.backend.put("/user/config/web",this.user.userSettings).pipe(i.map((function(){t.refreshCurrentUser().subscribe()})))},t.prototype.hasPrivilege=function(e){return!!this.user.privileges.find((function(t){return t.name===e}))},t.prototype.changePassword=function(e){return this.backend.put("/user/password",e)},t.prototype.refreshCurrentUser=function(){var e=this;return this.backend.get(this.USER_FETCH_URI).pipe(i.map((function(t){return e.setCurrentUser(t)})))},t.prototype.validatePassword=function(e){return e.length<this.passwordValidationSettings.minlength?{type:"short",amount:this.passwordValidationSettings.minlength}:e.replace(/[^0-9]/g,"").length<this.passwordValidationSettings.minnumber?{type:"number",amount:this.passwordValidationSettings.minnumber}:e.replace(/[a-zA-Z0-9ß ]/g,"").length<this.passwordValidationSettings.minspecialchars?{type:"specialchars",amount:this.passwordValidationSettings.minspecialchars}:{type:"valid",amount:null}},t}();mt.decorators=[{type:r.Injectable}],mt.ctorParameters=function(){return[{type:pt},{type:t.TranslateService},{type:ut},{type:ot},{type:dt},{type:st}]};var gt=function(){function e(e){Object.assign(this,e)}return Object.defineProperty(e.prototype,"title",{get:function(){return this.selectedtype?this.selectedtype.label:""},enumerable:!1,configurable:!0}),e.prototype.hasContent=function(){return!!this.template||this.contentcount>0},e.prototype.getSelectedTypeObject=function(){return this.types.find((function(e){return e.selected}))},e}(),yt=function(){function e(e,t){this.http=e,this.userService=t}return e.prototype.upload=function(e,t){var r=new FormData,o=new n.HttpHeaders({"Accept-Language":this.userService.getCurrentUser().getClientLocale()});return t.forEach((function(e){return r.append("files[]",e,nt.encodeFileName(e.name))})),this.http.post(e,r,{headers:o})},e}();yt.decorators=[{type:r.Injectable}],yt.ctorParameters=function(){return[{type:n.HttpClient},{type:mt}]};var bt=function(){function e(e,t){this.id=e,this.type=t}return e.prototype.onUploadSuccess=function(e){return e},e.prototype.onUploadFail=function(){return{}},e}();bt.ROOT="root",bt.CONTEXT="context",bt.CONTEXT_TREE="contexttree",bt.OBJECT="object",bt.CUSTOM="custom";var vt=function(){function e(e,t){this.backend=e,this.uploadService=t,this.preparedItemsSource=new o.ReplaySubject(1),this.preparedItems$=this.preparedItemsSource.asObservable(),this.preparedItemCountSource=new o.ReplaySubject(1),this.preparedItemCount$=this.preparedItemCountSource.asObservable()}return e.prototype.refreshPreparedItemsCount=function(){this.fetchPreparedItemsCount()},e.prototype.fetchPreparedItemsCount=function(){var e=this;this.backend.getJson("/prepare/state").pipe(i.map((function(e){return e.count}))).subscribe((function(t){e.preparedItemCount=t,e.preparedItemCountSource.next(e.preparedItemCount)}))},e.prototype.createPreparedItem=function(e,t){var r=this;return this.backend.post(this.createPreparedItemPostUrl({parentId:e,childType:t||null}),{}).pipe(i.tap((function(){return r.getPreparedItems$()})))},e.prototype.updatePreparedItemIndexData=function(e,t){var r=this;return this.backend.put("/prepare/"+e,t).pipe(i.tap((function(){return r.getPreparedItems$()})))},e.prototype.createPreparedItemPostUrl=function(e){var t=e.createMany?"/prepare/createmany":"/prepare/create";return e&&(t=nt.buildUri(t,e)),t},e.prototype.getPreparedItems$=function(e){return this.fetchPreparedItems(e).subscribe(),this.preparedItems$},e.prototype.fetchPreparedItems=function(e){var t=this,r=e?"/prepare":"/prepare?form=true";return this.backend.getJson(r).pipe(i.map((function(e){return e.map((function(e){return new gt(e)}))})),i.tap((function(){return t.fetchPreparedItemsCount()})),i.tap((function(e){return t.preparedItemsSource.next(e.sort(nt.sortValues("created","desc")))})))},e.prototype.deletePreparedItem=function(e){var t=this;return this.backend.del("/prepare/"+e).pipe(i.tap((function(){return t.getPreparedItems$()})))},e.prototype.getPrepareRootTypes=function(){return this.backend.getViaTempCache("/prepare/types").pipe(i.map((function(e){return e.types.map((function(e){return new ht(e)}))})))},e.prototype.getPrepareChildTypes=function(e,t){var r=e?{parentId:e,withcontent:t}:{withcontent:t},n=nt.buildUri("/prepare/types",r);return this.backend.getViaTempCache(n).pipe(i.map((function(e){return{parent:e.parent,types:e.types.map((function(e){return new ht(e)}))}})))},e.prototype.getPreviewUri=function(e,t,r){return nt.buildUri(this.backend.getServiceBase()+"/prepare/"+e+"/content",{rendition:r,index:t})},e.prototype.updateChildType=function(e,t){return this.backend.put("/prepare/"+t+"/"+e+"?form=true&contentmeta=true").pipe(i.map((function(e){return new gt(e)})))},e.prototype.addTemplate=function(e,t){return this.backend.put("/prepare/"+e+"/template?templateid="+t).pipe(i.map((function(e){return new gt(e)})))},e.prototype.getTemplates=function(e){return this.backend.getJson("/template/list?type="+e).pipe(i.map((function(e){return e})))},e.prototype.getTemplatePreviewUri=function(e,t){return nt.buildUri(this.backend.getServiceBase()+"/template/"+e+"/content",{rendition:t})},e.prototype.commitPreparedItem=function(e,t,r){var n=this;return this.backend.put("/prepare/"+e+"/"+t).pipe(i.mergeMap((function(){return n.backend.post("/prepare/commit/"+e,r)})),i.tap((function(){return n.getPreparedItems$()})),i.map((function(e){return e.id})))},e.prototype.uploadContent=function(e,t){var r=this.backend.getServiceBase()+"/prepare/"+e+"/content.json?form=true&contentmeta=true";return this.uploadService.upload(r,[t]).pipe()},e.prototype.uploadToTarget=function(e,t,r){var n=this,o=t.map((function(e){return e._file}));return this.uploadService.upload(this.getUploadTarget(e,r),o).pipe(i.tap((function(){return n.getPreparedItems$()})))},e.prototype.getUploadTarget=function(e,t){var r;if(e.type===bt.ROOT)r=this.backend.getServiceBase()+this.createPreparedItemPostUrl({parentId:null,createMany:!t});else if(e.type===bt.OBJECT){var n=e.referenceObject;r=this.backend.getServiceBase()+"/dms/"+n.id+"/contents?type="+n.type.name}else e.type!==bt.CONTEXT&&e.type!==bt.CONTEXT_TREE||(r=this.backend.getServiceBase()+this.createPreparedItemPostUrl({parentId:e.referenceObject.id,createMany:!t,childType:e.subFolder&&e.subFolder.data.type?e.subFolder.data.type:null}));return r},e.prototype.deletePreparedItemContent=function(e,t){var r="/prepare/"+e+"/content"+(void 0!==t?"?index="+t:"");return this.backend.del(r).pipe(i.map((function(e){return new gt(e)})))},e}();vt.decorators=[{type:r.Injectable}],vt.ctorParameters=function(){return[{type:pt},{type:yt}]};
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|