@c8y/ng1-modules 1018.266.0 → 1018.267.0

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.
Files changed (47) hide show
  1. package/app-logs/app-logs.service.js +1 -1
  2. package/assetPropertyWidget/main.controller.js +1 -1
  3. package/cell-id-information-activator/cell-id-information-activator.config.js +1 -1
  4. package/core/core/services/alarms.js +1 -1
  5. package/core/core/services/application.js +1 -1
  6. package/core/core/services/base.js +1 -1
  7. package/core/core/services/dynamicGroups.js +1 -1
  8. package/core/core/services/groups.js +1 -1
  9. package/core/core/services/inventory.js +1 -1
  10. package/core/core/services/kpi.js +1 -1
  11. package/core/core/services/settings.js +1 -1
  12. package/core/core/services/tenant.js +1 -1
  13. package/core/core/services/user.js +1 -1
  14. package/core/core/services/util.js +1 -1
  15. package/core/ui/configurable-device-list-columns/configurable-columns.service.js +1 -1
  16. package/core/ui/configurable-device-list-columns/modal-columns-configure.component.js +1 -1
  17. package/core/ui/controllers/deviceList.js +1 -1
  18. package/core/ui/csvExporter/csvExporter.controller.js +1 -1
  19. package/core/ui/directives/alarmList.js +1 -1
  20. package/core/ui/directives/map2.js +1 -1
  21. package/core/ui/properties/lastDeviceMessage.computedProperty.js +1 -1
  22. package/device-protocol-actility/actility-device.provider.js +1 -1
  23. package/device-protocol-canbus/canbus-device.provider.js +1 -1
  24. package/device-protocol-canopen/canopen-device.provider.js +1 -1
  25. package/device-protocol-deviceDatabase4/device-type-protocol-base.provider.js +1 -1
  26. package/device-protocol-lora/lora-device.provider.js +1 -1
  27. package/device-protocol-lpwan/lpwan-device.provider.js +1 -1
  28. package/device-protocol-modbus/modbus-device.provider.js +1 -1
  29. package/device-protocol-opcua/opcua-device.provider.js +1 -1
  30. package/device-protocol-profibus/profibus-device.provider.js +1 -1
  31. package/device-protocol-sigfox/sigfox-device.provider.js +1 -1
  32. package/device-protocol-snmp/snmp-device.provider.js +1 -1
  33. package/deviceDatabase4/device-database.service.js +1 -1
  34. package/deviceSelector/controllers/deviceSelectorComboCtrl.js +1 -1
  35. package/devicemanagement-alarmList/controllers/alarmList.js +1 -1
  36. package/devicemanagement-eventList/controllers/eventList.js +1 -1
  37. package/enterpriseEdition/customBranding/brandingConfigurationUi.provider.js +1 -1
  38. package/eventList/eventList.controller.js +1 -1
  39. package/groupsHierarchy/controllers/groupsListCtrl.js +1 -1
  40. package/kpi/controllers/pieChart.js +1 -1
  41. package/modbusWidget4/modbus-widget.service.js +1 -1
  42. package/package.json +1 -1
  43. package/remoteAccess/remoteAccess.service.js +1 -1
  44. package/remoteAccess/remoteAccessSettings/remoteAccessSettings.component.js +1 -1
  45. package/scada/mapping.directive.js +1 -1
  46. package/tenantStatistics/tenant-statistics.component.js +1 -1
  47. package/userRoles/inventoryRolesTab/inventoryRolesTab.component.js +1 -1
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?Object(arguments[e]):{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.forEach(function(e){_defineProperty(r,e,t[e])})}return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(e){var r=_toPrimitive(e,"string");return"symbol"===_typeof(r)?r:String(r)}function _toPrimitive(e,r){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===r?String:Number)(e);var n=t.call(e,r||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(n,o,i,u,a,e,c,r){var l=r.ALL_DEVICES_COLUMNS_META_USER_PREFERENCES_KEY_PREFIX,f=r.FILTERING_MODE;return{popupModalColumnsConfigure:function(e){var r=e.dynamicGroupId,t=e.columnOptions;return a({component:"c8yModalDeviceListColumnsConfigure",resolve:{dynamicGroupId:function(){return r},columnOptions:function(){return t}}})},getConfigurableColumns:function(e){var r=e.dynamicGroupId,t=e.options;return(_.isString(r)?o.getConfigurableColumnsMeta(r):n.get(l)).then(function(e){return _.isEmpty(e)?function(e){return _.map(i.getParentDeviceColumns(e),function(e){return _objectSpread({},e,{meta:{key:e.name,headerName:e.header,active:!0}})})}(t):_.map(e,function(e){return y({meta:e,options:t})})}).then(d)},createConfigurableColumn:y,moveRemovalColumnToTheEnd:d,saveConfigurableColumnsMeta:function(e){var r=e.dynamicGroupId,t=e.configurableColumns;return _.isString(r)?o.saveConfigurableColumnsMeta(r,t):n.set(l,_.map(t,"meta"))}};function y(e){var r=e.meta,t=e.options;if(r.custom){var n,o=(_defineProperty(n={},f.EQUALITY,m),_defineProperty(n,f.EXISTENCE,s),n)[r.filteringMode];if(!_.isFunction(o))throw new Error("Invalid filtering mode.");return _objectSpread({},o(r),{meta:r})}var a=i.getParentDeviceColumns(t);return _objectSpread({},_.find(a,{name:r.key}),{meta:r})}function m(e){var r=e.key,t=e.headerName,n=e.fragmentPath,o=_.lowerCase(t),a="".concat(r,"s");return _objectSpread({},p(e),{filtering:{schema:{type:"object",properties:_defineProperty({},a,{type:"array",items:{type:"string"}})},form:[{key:a,title:c.getString('Show devices where "{{headerName}}" contains:',{headerName:t}),add:c.getString("Or"),items:[{key:"".concat(a,"[]"),notitle:!0,placeholder:c.getString("e.g. value, you can use an asterisk (*) as wildcard character",{lowerCasedName:o})}]}],getFilter:function(e){return u.getInFilterFromModel(a,n,e)}},sorting:{path:n}})}function s(e){var r=e.key,t=e.fragmentPath,n=r;return _objectSpread({},p(e),{filtering:{schema:{type:"object",properties:_defineProperty({},n,{type:"boolean",default:!1,title:c.getString('Check for the existence of "{{fragmentPath}}" fragment',{fragmentPath:t})})},form:["*"],getFilter:function(e){return e[n]?{__has:t}:{}}}})}function p(e){var r=e.key,t=e.headerName,n=e.fragmentPath,o="getFragmentPathValue_".concat(function(e){return _toConsumableArray(e).map(function(e){return e.charCodeAt(0).toString(36)}).join("_")}(r)),a=_.property(n);return{name:r,header:t,cell:{template:'<span ng-bind="'.concat(o,'(item)"></span>'),scopeExtensions:_defineProperty({},o,a)}}}function d(e){var r=_.find(e,{name:"removalColumn"});return[].concat(_toConsumableArray(_.without(e,r)),[r])}}e.$inject=["c8yUserPreferences","c8yDynamicGroups","c8yDeviceListColumns","c8yFilteringSortingInventoryQueries","c8yModal","c8yAlert","gettextCatalog","c8yConfigurableDeviceListColumnsConstants"],angular.module("c8y.ui").factory("c8yConfigurableDeviceListColumns",e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ownKeys(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)}return t}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(e){_defineProperty(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(e){var r=_toPrimitive(e,"string");return"symbol"===_typeof(r)?r:String(r)}function _toPrimitive(e,r){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===r?String:Number)(e);var n=t.call(e,r||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(n,o,i,u,a,e,c,r){var l=r.ALL_DEVICES_COLUMNS_META_USER_PREFERENCES_KEY_PREFIX,y=r.FILTERING_MODE;return{popupModalColumnsConfigure:function(e){var r=e.dynamicGroupId,t=e.columnOptions;return a({component:"c8yModalDeviceListColumnsConfigure",resolve:{dynamicGroupId:function(){return r},columnOptions:function(){return t}}})},getConfigurableColumns:function(e){var r=e.dynamicGroupId,t=e.options;return(_.isString(r)?o.getConfigurableColumnsMeta(r):n.get(l)).then(function(e){return _.isEmpty(e)?function(e){return _.map(i.getParentDeviceColumns(e),function(e){return _objectSpread(_objectSpread({},e),{},{meta:{key:e.name,headerName:e.header,active:!0}})})}(t):_.map(e,function(e){return f({meta:e,options:t})})}).then(b)},createConfigurableColumn:f,moveRemovalColumnToTheEnd:b,saveConfigurableColumnsMeta:function(e){var r=e.dynamicGroupId,t=e.configurableColumns;return _.isString(r)?o.saveConfigurableColumnsMeta(r,t):n.set(l,_.map(t,"meta"))}};function f(e){var r=e.meta,t=e.options;if(r.custom){var n,o=(_defineProperty(n={},y.EQUALITY,p),_defineProperty(n,y.EXISTENCE,s),n)[r.filteringMode];if(!_.isFunction(o))throw new Error("Invalid filtering mode.");return _objectSpread(_objectSpread({},o(r)),{},{meta:r})}var a=i.getParentDeviceColumns(t);return _objectSpread(_objectSpread({},_.find(a,{name:r.key})),{},{meta:r})}function p(e){var r=e.key,t=e.headerName,n=e.fragmentPath,o=_.lowerCase(t),a="".concat(r,"s");return _objectSpread(_objectSpread({},m(e)),{},{filtering:{schema:{type:"object",properties:_defineProperty({},a,{type:"array",items:{type:"string"}})},form:[{key:a,title:c.getString('Show devices where "{{headerName}}" contains:',{headerName:t}),add:c.getString("Or"),items:[{key:"".concat(a,"[]"),notitle:!0,placeholder:c.getString("e.g. value, you can use an asterisk (*) as wildcard character",{lowerCasedName:o})}]}],getFilter:function(e){return u.getInFilterFromModel(a,n,e)}},sorting:{path:n}})}function s(e){var r=e.key,t=e.fragmentPath,n=r;return _objectSpread(_objectSpread({},m(e)),{},{filtering:{schema:{type:"object",properties:_defineProperty({},n,{type:"boolean",default:!1,title:c.getString('Check for the existence of "{{fragmentPath}}" fragment',{fragmentPath:t})})},form:["*"],getFilter:function(e){return e[n]?{__has:t}:{}}}})}function m(e){var r=e.key,t=e.headerName,n=e.fragmentPath,o="getFragmentPathValue_".concat(function(e){return _toConsumableArray(e).map(function(e){return e.charCodeAt(0).toString(36)}).join("_")}(r)),a=_.property(n);return{name:r,header:t,cell:{template:'<span ng-bind="'.concat(o,'(item)"></span>'),scopeExtensions:_defineProperty({},o,a)}}}function b(e){var r=_.find(e,{name:"removalColumn"});return[].concat(_toConsumableArray(_.without(e,r)),[r])}}e.$inject=["c8yUserPreferences","c8yDynamicGroups","c8yDeviceListColumns","c8yFilteringSortingInventoryQueries","c8yModal","c8yAlert","gettextCatalog","c8yConfigurableDeviceListColumnsConstants"],angular.module("c8y.ui").factory("c8yConfigurableDeviceListColumns",e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?Object(arguments[e]):{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.forEach(function(e){_defineProperty(r,e,t[e])})}return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(e){var r=_toPrimitive(e,"string");return"symbol"===_typeof(r)?r:String(r)}function _toPrimitive(e,r){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===r?String:Number)(e);var o=t.call(e,r||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,n,a,i,u=[],l=!0,c=!1;try{if(a=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;l=!1}else for(;!(l=(o=a.call(t)).done)&&(u.push(o.value),u.length!==r);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw n}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(e,r,o){var t=r.FILTERING_MODE,n=r.SIMPLE_JSON_PATH_REGEX,a=this,i=[];function u(){var t=RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(a.filterText),"i");a.filteredConfigurableColumns=_(a.configurableColumns).filter("header").filter(function(e){var r=e.name;return(e.header||r||"").match(t)}).value()}function l(e){a.addingCustomColumn=e,a.customColumnMetaToAdd={key:"",headerName:"",fragmentPath:"",filteringMode:t.EQUALITY,custom:!0,active:!0}}_.assign(a,{$onInit:function(){var e=_slicedToArray(_.at(a.resolve,["dynamicGroupId","columnOptions"]),2),r=e[0],t=e[1];o.getConfigurableColumns({dynamicGroupId:r,options:t}).then(function(e){a.configurableColumns=e,i=_.cloneDeep(e)})},FILTERING_MODE:t,SIMPLE_JSON_PATH_REGEX:n,configurableColumns:[],filterText:"",updateFilteredConfigurableColumns:u,addCustomColumn:function(){l(!0)},addingCustomColumn:!1,customColumnMetaToAdd:{},cancelCustomColumnAdd:function(){l(!1)},confirmCustomColumnAdd:function(){a.configurableColumns=[].concat(_toConsumableArray(a.configurableColumns),[o.createConfigurableColumn({meta:_objectSpread({},a.customColumnMetaToAdd,{key:_.camelCase(a.customColumnMetaToAdd.headerName)}),options:_.get(a.resolve,"columnOptions")})]),a.configurableColumns=o.moveRemovalColumnToTheEnd(a.configurableColumns),l(!1)},removeCustomColumn:function(e){a.configurableColumns=_.without(a.configurableColumns,e)},getActiveConfigurableColumns:function(){return _.filter(a.configurableColumns,"meta.active")},formatColumnName:function(e){return _.capitalize(_.startCase(e))},columnHeaderUniquenessComparator:function(e,r){return _.camelCase(e)===_.camelCase(r)},areConfigurableColumnsChanged:function(){return!_.isEqual(a.configurableColumns,i)}}),e.$watchCollection("vm.configurableColumns",u)}e.$inject=["$scope","c8yConfigurableDeviceListColumnsConstants","c8yConfigurableDeviceListColumns"],angular.module("c8y.ui").component("c8yModalDeviceListColumnsConfigure",{templateUrl:":::PLUGIN_PATH:::/ui/configurable-device-list-columns/modal-columns-configure.component.html",bindings:{close:"&",dismiss:"&",resolve:"<"},controllerAs:"vm",controller:e})}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(e){_defineProperty(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(e){var r=_toPrimitive(e,"string");return"symbol"===_typeof(r)?r:String(r)}function _toPrimitive(e,r){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===r?String:Number)(e);var o=t.call(e,r||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,n,i,a,u=[],l=!0,c=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;l=!1}else for(;!(l=(o=i.call(t)).done)&&(u.push(o.value),u.length!==r);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw n}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(e,r,o){var t=r.FILTERING_MODE,n=r.SIMPLE_JSON_PATH_REGEX,i=this,a=[];function u(){var t=RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(i.filterText),"i");i.filteredConfigurableColumns=_(i.configurableColumns).filter("header").filter(function(e){var r=e.name;return(e.header||r||"").match(t)}).value()}function l(e){i.addingCustomColumn=e,i.customColumnMetaToAdd={key:"",headerName:"",fragmentPath:"",filteringMode:t.EQUALITY,custom:!0,active:!0}}_.assign(i,{$onInit:function(){var e=_slicedToArray(_.at(i.resolve,["dynamicGroupId","columnOptions"]),2),r=e[0],t=e[1];o.getConfigurableColumns({dynamicGroupId:r,options:t}).then(function(e){i.configurableColumns=e,a=_.cloneDeep(e)})},FILTERING_MODE:t,SIMPLE_JSON_PATH_REGEX:n,configurableColumns:[],filterText:"",updateFilteredConfigurableColumns:u,addCustomColumn:function(){l(!0)},addingCustomColumn:!1,customColumnMetaToAdd:{},cancelCustomColumnAdd:function(){l(!1)},confirmCustomColumnAdd:function(){i.configurableColumns=[].concat(_toConsumableArray(i.configurableColumns),[o.createConfigurableColumn({meta:_objectSpread(_objectSpread({},i.customColumnMetaToAdd),{},{key:_.camelCase(i.customColumnMetaToAdd.headerName)}),options:_.get(i.resolve,"columnOptions")})]),i.configurableColumns=o.moveRemovalColumnToTheEnd(i.configurableColumns),l(!1)},removeCustomColumn:function(e){i.configurableColumns=_.without(i.configurableColumns,e)},getActiveConfigurableColumns:function(){return _.filter(i.configurableColumns,"meta.active")},formatColumnName:function(e){return _.capitalize(_.startCase(e))},columnHeaderUniquenessComparator:function(e,r){return _.camelCase(e)===_.camelCase(r)},areConfigurableColumnsChanged:function(){return!_.isEqual(i.configurableColumns,a)}}),e.$watchCollection("vm.configurableColumns",u)}e.$inject=["$scope","c8yConfigurableDeviceListColumnsConstants","c8yConfigurableDeviceListColumns"],angular.module("c8y.ui").component("c8yModalDeviceListColumnsConfigure",{templateUrl:":::PLUGIN_PATH:::/ui/configurable-device-list-columns/modal-columns-configure.component.html",bindings:{close:"&",dismiss:"&",resolve:"<"},controllerAs:"vm",controller:e})}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?Object(arguments[e]):{},i=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.forEach(function(e){_defineProperty(n,e,t[e])})}return n}function _defineProperty(e,n,t){return(n=_toPropertyKey(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _toPropertyKey(e){var n=_toPrimitive(e,"string");return"symbol"===_typeof(n)?n:String(n)}function _toPrimitive(e,n){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);var i=t.call(e,n||"default");if("object"!==_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(i,e,r,o,c,a,n,t,u,l,s,d,f,g,m,p,v,h){var y,C="all-devices-columns-config",b=40,D=this,I=f("No devices to display."),S=_.throttle(function(){i.parentDeviceId()&&(D.realtimeAnimation=!1,D.realtimeChannel="/managedobjects/*",t.addListener(i.$id,D.realtimeChannel,t.realtimeActions().CREATE,E),t.addListener(i.$id,D.realtimeChannel,t.realtimeActions().UPDATE,N),t.addListener(i.$id,D.realtimeChannel,t.realtimeActions().DELETE,R),D.rtState=function(){return t.getStatus(i.$id,D.realtimeChannel)},D.rtStart=function(){t.start(i.$id,D.realtimeChannel)},D.rtStop=function(){t.stop(i.$id,D.realtimeChannel)});return r.when().then(G).then(P).then($).then(k).then(U)},500,{leading:!1,trailing:!0}),w={clickDeleteCallback:function(e){return m.deleteDeviceWithConfirmation(e).then(function(){_.pull(D.devices,e),D.totalDevices-=1})}};function G(){return(i.parentDeviceId()?r.resolve(p.getChildDeviceColumns(w)):v.getConfigurableColumns({dynamicGroupId:i.dynamicGroupId(),options:w}).then(function(e){return A(y=e)})).then(function(e){D.columns=e||D.columns})}function P(){return(i.parentDeviceId()?r.when({}):i.dynamicGroupId()?s.getColumnsConfig(i.dynamicGroupId()):d.get(C)).then(function(e){D.columnsConfig=e||D.columnsConfig})}function $(e){var n=e||{};return void 0===n.pageSize&&(n.pageSize=b),(i.parentDeviceId()?(D.rtStop&&D.rtStop(),L({pageSize:b})):i.dynamicGroupId()?s.getGroupItems(i.dynamicGroupId(),n):function(e){var n=l.getQuery(D.columns,D.columnsConfig);return o.listQuery(n,_objectSpread({withGroups:!0,withChildren:!1},e))}(n)).then(function(e){return j(e,!0)})}function L(e){var n={params:_objectSpread({},e,{withChildren:!1,withTotalPages:!0}),skipDetail:!0},t=i.parentDeviceId();return c.children(t,"childDevices",n).then(function(e){var n=e.data;return i.paging=a.createPaging(n,L),c.onChildren(e)})}function j(e,n){D.devices||(D.devices=[]),n&&(D.devices.length=0),e.forEach(function(e){_.assign(e,{properName:o.properName(e)}),D.devices.push(e)}),D.devices=function(e){var n=e,t=D.columnsConfig.systemId;if(t&&0!==t.sorting.order){var i=1===t.sorting.order?"asc":"desc";n=_.orderBy(e,function(e){return _.toNumber(e.id)},i)}return n}(D.devices),e.paging&&(i.paging=e.paging)}function A(e){return _.filter(e,"meta.active")}function O(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:i.dynamicGroupId();return v.saveConfigurableColumnsMeta({dynamicGroupId:e,configurableColumns:y})}function T(e){D.columnsConfig=e||D.columnsConfig,function(){var e;e=i.parentDeviceId()?r.when():i.dynamicGroupId()?s.saveColumnsConfig(i.dynamicGroupId(),D.columns,D.columnsConfig):d.set(C,D.columnsConfig);return e}().then(function(){return $()})}function E(e,n){var t=!n.c8y_IsDevice,i=!1;D.realtimeAnimation=!0,_.forOwn(D.devices,function(e){return e.id!==n.id||!(i=!0)}),t||i||(_.assign(n,{properName:o.properName(n)}),D.devices.push(n),D.totalDevices+=1)}function N(e,n){D.realtimeAnimation=!0,_.forOwn(D.devices,function(e){e.id===n.id&&(_.assign(n,{properName:o.properName(n)}),_.assign(e,n))})}function R(e,n){D.devices=_.reject(D.devices,{id:n.id})}function U(){if(i.setTitles()&&D.devices){var t={title:void 0,subtitle:void 0};return i.parentDeviceId()?o.detailCached(i.parentDeviceId()).then(a.getResData).then(function(e){return t.subtitle=g.getPlural(D.devices.length,"Showing 1 child device","Showing {{$count}} child devices",{}),t.title=e.name,h.changeTitle(r.when(t))}):i.dynamicGroupId()?c.detailCached(i.dynamicGroupId()).then(a.getResData).then(function(e){t.title=e.name;var n=D.devices.length;return t.subtitle=g.getString("Showing {{length}} items",{length:n}),h.changeTitle(r.when(t))}):(t.title=f("All devices"),t.subtitle=_.isUndefined(D.totalDevices)?g.getString("Showing {{devices.length}}",D):g.getString("Showing {{devices.length}} of {{totalDevices}}",D),h.changeTitle(r.when(t)))}return!1}function k(){i.parentDeviceId()?D.totalDevices=D.devices.length:i.dynamicGroupId()||o.getCount().then(function(e){D.totalDevices=e})}_.assign(D,{columnsConfig:{},noItemsMessage:I,clearColumnsConfig:function(){T({})},createSmartGroup:function(){return s.createWithUI({columns:D.columns,columnsConfig:D.columnsConfig,configurableColumns:y})},onLoadMore:function(e){D.realtimeAnimation=!1,i.paging.loading=!0,(e?$({pageSize:e}):i.paging.next().then(j)).finally(function(){i.paging.loading=!1})},onColumnsConfigChanged:T,parentDeviceId:function(){return i.parentDeviceId()},configureColumns:function(){return v.popupModalColumnsConfigure({dynamicGroupId:i.dynamicGroupId(),columnOptions:w}).then(function(e){y=e,D.columns=A(e)}).then(O).then(function(){return n.success(f("Columns definitions saved."))}).then($)}}),i.refresh=function(){return D.realtimeAnimation=!1,D.refreshLoading=!0,i.paging?(i.paging.refresh().then(_.partialRight(j,!0)).then(k).finally(function(){D.refreshLoading=!1}),i.paging=null,!1):$().finally(function(){D.refreshLoading=!1})},i.$watch("parentDeviceId()",S),i.$watch("dynamicGroupId()",S),i.$watch("ctrl.devices.length",U),i.$watch("ctrl.totalDevices",U),e.$on("deviceList.getLoadedDevicesList",function(){e.$emit("deviceList.loadedDevicesList",D.devices)})}e.$inject=["$scope","$rootScope","$q","c8yDevices","c8yInventory","c8yBase","c8yAlert","c8yRealtime","c8yQueriesUtil","c8yFilteringSortingInventoryQueries","c8yDynamicGroups","c8yUserPreferences","gettext","gettextCatalog","groupsHierarchySvc","c8yDeviceListColumns","c8yConfigurableDeviceListColumns","c8yTitle"],angular.module("c8y.ui").controller("c8yDeviceListCtrl",e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),t.push.apply(t,i)}return t}function _objectSpread(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(e){_defineProperty(n,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})}return n}function _defineProperty(e,n,t){return(n=_toPropertyKey(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _toPropertyKey(e){var n=_toPrimitive(e,"string");return"symbol"===_typeof(n)?n:String(n)}function _toPrimitive(e,n){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);var i=t.call(e,n||"default");if("object"!==_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(i,e,r,o,c,a,n,t,u,l,s,d,f,g,p,m,v,h){var y,C="all-devices-columns-config",b=40,D=this,S=f("No devices to display."),I=_.throttle(function(){i.parentDeviceId()&&(D.realtimeAnimation=!1,D.realtimeChannel="/managedobjects/*",t.addListener(i.$id,D.realtimeChannel,t.realtimeActions().CREATE,T),t.addListener(i.$id,D.realtimeChannel,t.realtimeActions().UPDATE,N),t.addListener(i.$id,D.realtimeChannel,t.realtimeActions().DELETE,K),D.rtState=function(){return t.getStatus(i.$id,D.realtimeChannel)},D.rtStart=function(){t.start(i.$id,D.realtimeChannel)},D.rtStop=function(){t.stop(i.$id,D.realtimeChannel)});return r.when().then(P).then(j).then(O).then(U).then(R)},500,{leading:!1,trailing:!0}),w={clickDeleteCallback:function(e){return p.deleteDeviceWithConfirmation(e).then(function(){_.pull(D.devices,e),D.totalDevices-=1})}};function P(){return(i.parentDeviceId()?r.resolve(m.getChildDeviceColumns(w)):v.getConfigurableColumns({dynamicGroupId:i.dynamicGroupId(),options:w}).then(function(e){return L(y=e)})).then(function(e){D.columns=e||D.columns})}function j(){return(i.parentDeviceId()?r.when({}):i.dynamicGroupId()?s.getColumnsConfig(i.dynamicGroupId()):d.get(C)).then(function(e){D.columnsConfig=e||D.columnsConfig})}function O(e){var n=e||{};return void 0===n.pageSize&&(n.pageSize=b),(i.parentDeviceId()?(D.rtStop&&D.rtStop(),G({pageSize:b})):i.dynamicGroupId()?s.getGroupItems(i.dynamicGroupId(),n):function(e){var n=l.getQuery(D.columns,D.columnsConfig);return o.listQuery(n,_objectSpread({withGroups:!0,withChildren:!1},e))}(n)).then(function(e){return $(e,!0)})}function G(e){var n={params:_objectSpread(_objectSpread({},e),{},{withChildren:!1,withTotalPages:!0}),skipDetail:!0},t=i.parentDeviceId();return c.children(t,"childDevices",n).then(function(e){var n=e.data;return i.paging=a.createPaging(n,G),c.onChildren(e)})}function $(e,n){D.devices||(D.devices=[]),n&&(D.devices.length=0),e.forEach(function(e){_.assign(e,{properName:o.properName(e)}),D.devices.push(e)}),D.devices=function(e){var n=e,t=D.columnsConfig.systemId;if(t&&0!==t.sorting.order){var i=1===t.sorting.order?"asc":"desc";n=_.orderBy(e,function(e){return _.toNumber(e.id)},i)}return n}(D.devices),e.paging&&(i.paging=e.paging)}function L(e){return _.filter(e,"meta.active")}function A(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:i.dynamicGroupId();return v.saveConfigurableColumnsMeta({dynamicGroupId:e,configurableColumns:y})}function E(e){D.columnsConfig=e||D.columnsConfig,function(){var e;e=i.parentDeviceId()?r.when():i.dynamicGroupId()?s.saveColumnsConfig(i.dynamicGroupId(),D.columns,D.columnsConfig):d.set(C,D.columnsConfig);return e}().then(function(){return O()})}function T(e,n){var t=!n.c8y_IsDevice,i=!1;D.realtimeAnimation=!0,_.forOwn(D.devices,function(e){return e.id!==n.id||!(i=!0)}),t||i||(_.assign(n,{properName:o.properName(n)}),D.devices.push(n),D.totalDevices+=1)}function N(e,n){D.realtimeAnimation=!0,_.forOwn(D.devices,function(e){e.id===n.id&&(_.assign(n,{properName:o.properName(n)}),_.assign(e,n))})}function K(e,n){D.devices=_.reject(D.devices,{id:n.id})}function R(){if(i.setTitles()&&D.devices){var t={title:void 0,subtitle:void 0};return i.parentDeviceId()?o.detailCached(i.parentDeviceId()).then(a.getResData).then(function(e){return t.subtitle=g.getPlural(D.devices.length,"Showing 1 child device","Showing {{$count}} child devices",{}),t.title=e.name,h.changeTitle(r.when(t))}):i.dynamicGroupId()?c.detailCached(i.dynamicGroupId()).then(a.getResData).then(function(e){t.title=e.name;var n=D.devices.length;return t.subtitle=g.getString("Showing {{length}} items",{length:n}),h.changeTitle(r.when(t))}):(t.title=f("All devices"),t.subtitle=_.isUndefined(D.totalDevices)?g.getString("Showing {{devices.length}}",D):g.getString("Showing {{devices.length}} of {{totalDevices}}",D),h.changeTitle(r.when(t)))}return!1}function U(){i.parentDeviceId()?D.totalDevices=D.devices.length:i.dynamicGroupId()||o.getCount().then(function(e){D.totalDevices=e})}_.assign(D,{columnsConfig:{},noItemsMessage:S,clearColumnsConfig:function(){E({})},createSmartGroup:function(){return s.createWithUI({columns:D.columns,columnsConfig:D.columnsConfig,configurableColumns:y})},onLoadMore:function(e){D.realtimeAnimation=!1,i.paging.loading=!0,(e?O({pageSize:e}):i.paging.next().then($)).finally(function(){i.paging.loading=!1})},onColumnsConfigChanged:E,parentDeviceId:function(){return i.parentDeviceId()},configureColumns:function(){return v.popupModalColumnsConfigure({dynamicGroupId:i.dynamicGroupId(),columnOptions:w}).then(function(e){y=e,D.columns=L(e)}).then(A).then(function(){return n.success(f("Columns definitions saved."))}).then(O)}}),i.refresh=function(){return D.realtimeAnimation=!1,D.refreshLoading=!0,i.paging?(i.paging.refresh().then(_.partialRight($,!0)).then(U).finally(function(){D.refreshLoading=!1}),i.paging=null,!1):O().finally(function(){D.refreshLoading=!1})},i.$watch("parentDeviceId()",I),i.$watch("dynamicGroupId()",I),i.$watch("ctrl.devices.length",R),i.$watch("ctrl.totalDevices",R),e.$on("deviceList.getLoadedDevicesList",function(){e.$emit("deviceList.loadedDevicesList",D.devices)})}e.$inject=["$scope","$rootScope","$q","c8yDevices","c8yInventory","c8yBase","c8yAlert","c8yRealtime","c8yQueriesUtil","c8yFilteringSortingInventoryQueries","c8yDynamicGroups","c8yUserPreferences","gettext","gettextCatalog","groupsHierarchySvc","c8yDeviceListColumns","c8yConfigurableDeviceListColumns","c8yTitle"],angular.module("c8y.ui").controller("c8yDeviceListCtrl",e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),o.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);var o=r.call(t,e||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(r,o,n,i,t){var e,c=i.configKey,a=_.defaults({escapeFormulas:!0},i.defaultConfig);r.csvExporter={},e=n.getLocal(c),r.csvExporter.config=_.defaults(e,a),r.title=t("Export as CSV"),r.download=function(){var t=r.csvExporter.config,e=_objectSpread({},t,{header:r.headers()});i.getCsv(r.data(),e).then(function(t){var e=new Blob([t],{type:"text/csv"});o.saveAs(e,r.fileName)}).then(function(){return function(t){n.setLocal(c,t),r.$close()}(t)})},r.dismiss=function(){r.$dismiss()},r.charsets=i.charsets,r.fieldSeparators=i.fieldSeparators,r.decimalSeparators=i.decimalSeparators}t.$inject=["$scope","$window","c8yUtil","csvExporterSvc","gettext"],angular.module("c8y.ui").controller("csvExporterCtrl",t)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,o)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var o=r.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(r,o,n,i,e){var t,c=i.configKey,a=_.defaults({escapeFormulas:!0},i.defaultConfig);r.csvExporter={},t=n.getLocal(c),r.csvExporter.config=_.defaults(t,a),r.title=e("Export as CSV"),r.download=function(){var e=r.csvExporter.config,t=_objectSpread(_objectSpread({},e),{},{header:r.headers()});i.getCsv(r.data(),t).then(function(e){var t=new Blob([e],{type:"text/csv"});o.saveAs(t,r.fileName)}).then(function(){return function(e){n.setLocal(c,e),r.$close()}(e)})},r.dismiss=function(){r.$dismiss()},r.charsets=i.charsets,r.fieldSeparators=i.fieldSeparators,r.decimalSeparators=i.decimalSeparators}e.$inject=["$scope","$window","c8yUtil","csvExporterSvc","gettext"],angular.module("c8y.ui").controller("csvExporterCtrl",e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),r.forEach(function(t){_defineProperty(e,t,n[t])})}return e}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);var r=n.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){t.$inject=["$q","$injector","$window","c8yAlarms","c8yAlert","c8yInventory","c8yBase","c8yRealtime","c8yUser","c8yConfig","c8ySmartRulesAvailability","gettextCatalog"];var X="c8yAlarmList";function t(F,K,U,z,B,G,V,M,q,H,J,Q){return{restrict:"EA",scope:{severities:"=?activeSeverities",options:"=?filter",realtime:"=?",hideHeaderActions:"=?",title:"=?",unresolved:"=?",paginate:"=?",refreshLoading:"=?",hideDevice:"=?"},templateUrl:":::PLUGIN_PATH:::/ui/views/alarmList.html",link:function(a,t,i){var r={};function o(t){z.detail(t).then(_.partial(e,t))}function e(t,e){var n=F.when(t);return r[t.id]&&(n=n.then(a.auditRefresh[t.id])),n.then(function(){_.assign(t,e.data)})}function n(t){if(!a.auditList||!a.auditList[t.id])return Q.getString("ACKNOWLEDGED`alarm`");var e=a.auditList[t.id],n=z.ackTime(t,e),r={ackBy:z.acknowledgedBy(t,e),ackTimeFromNow:moment(n).fromNow()};return Q.getString("ACKNOWLEDGED`alarm` by: {{ackBy}} {{ackTimeFromNow}}",r)}function s(t){if(!a.auditList||!a.auditList[t.id])return Q.getString("CLEARED`alarm`");var e={alarmDuration:z.alarmDuration(t,a.auditList[t.id])};return Q.getString("CLEARED`alarm`: was active for {{alarmDuration}}",e)}function u(t){var e={alarmTimeFromNow:moment(t.time).fromNow()};return Q.getString("ACTIVE`alarm`: triggered {{alarmTimeFromNow}}",e)}function c(t){var e=!0;return i.activeSeverities&&(e=_.isEmpty(a.severities)||a.severities[t.severity]),e&&!((a.unresolved||!1===(a.options&&a.options.resolved))&&"CLEARED"===t.status)}function f(t){var e=!0,n=_.get(a.options,"status");return _.isUndefined(n)||(e=Boolean(n[t.status])),e}function l(){return a.refreshLoading?F.resolve():(a.refreshLoading=!0,a.alarms=[],a.auditList={},r={},a.options=a.options||{},a.options.type&&(a.options.types=[a.options.type]),function(){if(!A(a.options).byDevices())return F.reject();var t=I();if(t.length<=0)return F.reject();var e=_.map(t,function(t){return z.list(_objectSpread({source:t,withSourceDevices:!0,withSourceAssets:!0,pageSize:$()},v(a.severities,"severity"),v(a.options.status,"status"),v(a.options.types,"type"),g(),function(t){var e=["severity asc","time.date desc","text asc"];return"ACTIVE_FIRST"===t&&(e=["status asc","severity asc","time.date desc","text asc"]),{query:"$orderby=".concat(e.join(","))}}(a.options.orderMode)))});return F.all(e).then(V.combineLists)}().catch(h).catch(y).catch(p).catch(d).then(b).finally(function(){a.refreshLoading=!1}))}function d(){var t={pageSize:$()};return z.list(t)}a.refreshLoading=!1;var m=_.throttle(function(){a.refreshLoading||(a.paging.loading=!0,a.refreshLoading=!0,a.realtimeAnimation=!1,a.paging.next().then(function(t){_.forEach(t,function(t){L("nextPage",t)}),a.paging.loading=!1,a.refreshLoading=!1,a.paging=t.paging}))},300,{trailing:!0});function p(){if(!A(a.options).bySeverity())return F.reject();var t=_objectSpread({severity:a.options.severity,pageSize:$()},g());return V.timeOrderFilter(t),z.list(t)}function y(){return A(a.options).byStatus()?z.listByStatus(a.options.status,_objectSpread({pageSize:$()},v(a.severities,"severity"),g())):F.reject()}function v(e,t){return e?_.isArray(e)?_defineProperty({},t,e.join(",")):_defineProperty({},t,Object.keys(e).filter(function(t){return e[t]}).join(",")):{}}function g(){return"resolved"in a.options&&a.options.resolved?{}:_.isUndefined(a.options.resolved)?{resolved:void 0}:{resolved:!1}}function h(){if(!A(a.options).byType())return F.reject();var e=a.options.types,t=_objectSpread({pageSize:$()},g(),v(a.severities,"severity"),v(a.options.status,"status"),v(a.options.types,"type"));return z.list(t).then(function(t){return _.filter(t,function(t){return _.includes(e,t.type)})})}function b(t){var e=t;i.paginate&&!a.paginate||(a.paging=e.paging);var n=a.options;if(n){var r=A(n);e=_.filter(e,function(t){return(!r.byType()||_.includes(n.types,t.type))&&(!r.byStatus()||n.status[t.status])&&(!r.bySeverity()||n.severity===t.severity)})}return a.alarms=e}function S(t){var e=[["severity","time","text"],["asc","desc","asc"]];if("ACTIVE_FIRST"===a.options.orderMode){var n={ACTIVE:1,ACKNOWLEDGED:0,CLEARED:-1};e=[[function(t){return n[t.status]},"severity","time","text"],["desc","asc","desc","asc"]]}var r=_(t).filter(c).filter(f).orderBy(e[0],e[1]).value(),i=_.get(a,"options.displayFilter");return i&&(r=_.filter(r,i)),a.filteredAlarms=r}function A(e){function t(t){return function(){return e&&!!t}}var n=e||{};return{byType:t(!_.isEmpty(n.types)),byStatus:t(n.status&&!_.isEmpty(n.status)&&function(t){return _.some(t,function(t){return!0===t})}(n.status)),bySeverity:t(n.severity),byDevices:function(){return t(!_.isEmpty(I()))}}}function E(){a.realtimeAnimation=!1,l()}function L(t,e){if(a.realtimeAnimation=!0,P(e,a.options)){var n=_.find(a.alarms,{id:e.id});n?D(e,n):w(e,t)}}function w(t,e){var n=w._executing;if(n&&"nextPage"!==e)return n.creating=!0,F.reject(n);var r=T(t).then(function(t){a.alarms.unshift(t)}).finally(function(){w._executing=null});return w._executing=r}function D(e,t){var n=T(e,t.source.name);return r[e.id]&&(n=n.then(a.auditRefresh[e.id])),n.then(function(){a.realtimeAnimation=!0;var t=_.findIndex(a.alarms,{id:e.id});a.alarms[t]=e})}function j(t){_.remove(a.alarms,{id:t.id}),delete a.auditList[t.id],delete r[t.id]}function R(t,n){a.realtimeAnimation=!0,!_.some(a.alarms,function(t){var e;return t.id===n.id&&(P(n,a.options)?D(n,t):j(n),e=!0),e})&&P(n,a.options)&&w(n).catch(function(e,n){return function(t){return t&&t.creating&&_.isFunction(t.then)?t.then(_.partial(R,e,n)):F.reject(t)}}(t,n))}function C(t,e){var n;return a.realtimeAnimation=!0,_.forEach(a.alarms,function(t){t.id===e.id&&(j(e),n=!1)}),n}function T(e,t){var n=F.resolve(e);return _.defaultsDeep(e,{source:{name:t}}),!e.source.name&&e.source.id&&(n=function(t){return G.detail(t).then(V.getResData).then(function(t){return t.name})}(e.source.id).then(function(t){e.source.name=t}).then(function(){return e})),n}function P(t,e){return function(n,t){return!t||_.some(t,function(t,e){return t&&e===n.status})}(t,e.status)&&function(t,e){return _.isEmpty(e)||_.includes(e,t.type)}(t,e.types)&&function(t,e){return!e||e===t.severity}(t,e.severity)}function $(){return a.options&&Number(a.options.pageSize)||20}function N(){M.switchRealtime(a.$id,a.realtimeChannel)}function k(){return M.getStatus(a.$id,a.realtimeChannel)}function x(t,e){M.addListener(a.$id,a.realtimeChannel,t,e)}function O(){var t=a.realtimeChannel,e=function(){var t=I();return"/alarmsWithChildren/".concat(t.length?t.join(","):"*")}();if(t){if(e===t)return;M.removeSubscriber(a.$id,t),a.cancelDestroyRemoveSubscriber(),a.stopWatchingRealtime()}a.realtimeChannel=e,x("".concat(a.$id,"-subscribed"),E),x("CREATE",L),x("UPDATE",R),x("DELETE",C),a.cancelDestroyRemoveSubscriber=a.$on("$destroy",function(){return M.removeSubscriber(a.$id,a.realtimeChannel)}),a.stopWatchingRealtime=a.$watch("realtime",W),a.realtime&&N()}function I(){var t=a.options,e=t.source,n=t.sources,r=_.concat(n,e);return _(r).map(function(t){return V.hasId(t)&&V.getId(t)}).compact().value()}function W(){a.realtime&&l(),a.realtime!==k()&&N()}a.auditRefresh={},a.statusText=function(t){var e;switch((t.status||"").toUpperCase()){case z.status.ACKNOWLEDGED:e=n;break;case z.status.CLEARED:e=s;break;case z.status.ACTIVE:e=u;break;default:e=function(){return""}}return e(t)},a.isActive=function(t){return t.status===z.status.ACTIVE},a.toggle=function(t){r[t.id]=!r[t.id]},a.isOpen=function(t){return!0===r[t.id]},a.isNarrow=function(){return a.containerWidth<=991},a.changeStatus=function(t,e){a.changingStatus=!0;var n=Q.getString('Alarm status changed to "{{status | translate}}".',{status:e}),r=z.update({id:t.id,status:e});return k()||(r=r.then(_.partial(o,t))),(r=r.then(function(){B.success(n)})).finally(function(){a.changingStatus=!1})},a.isFitSeverity=c,a.icon=z.icon,a.getStandardKeys=z.getStandardKeys.bind(z),a.getNonStandardKeys=z.getNonStandardKeys.bind(z),a.alarmDuration=function(t){return a.auditList&&a.auditList[t.id]?z.alarmDuration(t,a.auditList[t.id]):""},a.refresh=l,a.loadNext=m,a.createSmartRule=function(e){var t;return a.smartRules&&(t=q.current().then(function(t){return a.smartRulesSvc.addNewForInputAlarmAndOutputUserWithUI(e,t)})),t},a.translateAlarmText=function(t){return Q.getString(t.text)},a.getDeviceLinkFromAlarm=_.memoize(function(t){var e=H[X]||{};return e.getDeviceLinkFromAlarm?e.getDeviceLinkFromAlarm(t):["#","device",t.source.id].join("/")},function(t){return t.id}),a.$watch(function(){return{containerWidth:t.parent().width(),windowWidth:U.innerWidth}},function(t){a.containerWidth=t.containerWidth||t.windowWidth},!0),a.$watch("alarms",S,!0),a.$watch("severities",function(){l().then(function(){return S(a.alarms)})},!0),a.$on("alarmListRefresh",l),i.filter?a.$watch("options",function(){l().then(O)},!0):a.realtime||l(),J.shouldShowGlobalSmartRules().then(function(t){a.smartRules=t&&V.checkIfModulesExist(["c8y.cockpit.config"])}).then(function(){a.smartRules&&(a.smartRulesSvc=K.get("smartRulesSvc"))})}}}angular.module("c8y.ui").directive(X,t)}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);var r=n.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){t.$inject=["$q","$injector","$window","c8yAlarms","c8yAlert","c8yInventory","c8yBase","c8yRealtime","c8yUser","c8yConfig","c8ySmartRulesAvailability","gettextCatalog"];var X="c8yAlarmList";function t(F,K,U,z,B,G,V,M,q,H,J,Q){return{restrict:"EA",scope:{severities:"=?activeSeverities",options:"=?filter",realtime:"=?",hideHeaderActions:"=?",title:"=?",unresolved:"=?",paginate:"=?",refreshLoading:"=?",hideDevice:"=?"},templateUrl:":::PLUGIN_PATH:::/ui/views/alarmList.html",link:function(o,t,i){var r={};function a(t){z.detail(t).then(_.partial(e,t))}function e(t,e){var n=F.when(t);return r[t.id]&&(n=n.then(o.auditRefresh[t.id])),n.then(function(){_.assign(t,e.data)})}function n(t){if(!o.auditList||!o.auditList[t.id])return Q.getString("ACKNOWLEDGED`alarm`");var e=o.auditList[t.id],n=z.ackTime(t,e),r={ackBy:z.acknowledgedBy(t,e),ackTimeFromNow:moment(n).fromNow()};return Q.getString("ACKNOWLEDGED`alarm` by: {{ackBy}} {{ackTimeFromNow}}",r)}function s(t){if(!o.auditList||!o.auditList[t.id])return Q.getString("CLEARED`alarm`");var e={alarmDuration:z.alarmDuration(t,o.auditList[t.id])};return Q.getString("CLEARED`alarm`: was active for {{alarmDuration}}",e)}function u(t){var e={alarmTimeFromNow:moment(t.time).fromNow()};return Q.getString("ACTIVE`alarm`: triggered {{alarmTimeFromNow}}",e)}function c(t){var e=!0;return i.activeSeverities&&(e=_.isEmpty(o.severities)||o.severities[t.severity]),e&&!((o.unresolved||!1===(o.options&&o.options.resolved))&&"CLEARED"===t.status)}function f(t){var e=!0,n=_.get(o.options,"status");return _.isUndefined(n)||(e=Boolean(n[t.status])),e}function l(){return o.refreshLoading?F.resolve():(o.refreshLoading=!0,o.alarms=[],o.auditList={},r={},o.options=o.options||{},o.options.type&&(o.options.types=[o.options.type]),function(){if(!j(o.options).byDevices())return F.reject();var t=I();if(t.length<=0)return F.reject();var e=_.map(t,function(t){return z.list(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({source:t,withSourceDevices:!0,withSourceAssets:!0,pageSize:T()},v(o.severities,"severity")),v(o.options.status,"status")),v(o.options.types,"type")),g()),function(t){var e=["severity asc","time.date desc","text asc"];return"ACTIVE_FIRST"===t&&(e=["status asc","severity asc","time.date desc","text asc"]),{query:"$orderby=".concat(e.join(","))}}(o.options.orderMode)))});return F.all(e).then(V.combineLists)}().catch(h).catch(y).catch(p).catch(d).then(b).finally(function(){o.refreshLoading=!1}))}function d(){var t={pageSize:T()};return z.list(t)}o.refreshLoading=!1;var m=_.throttle(function(){o.refreshLoading||(o.paging.loading=!0,o.refreshLoading=!0,o.realtimeAnimation=!1,o.paging.next().then(function(t){_.forEach(t,function(t){w("nextPage",t)}),o.paging.loading=!1,o.refreshLoading=!1,o.paging=t.paging}))},300,{trailing:!0});function p(){if(!j(o.options).bySeverity())return F.reject();var t=_objectSpread({severity:o.options.severity,pageSize:T()},g());return V.timeOrderFilter(t),z.list(t)}function y(){return j(o.options).byStatus()?z.listByStatus(o.options.status,_objectSpread(_objectSpread({pageSize:T()},v(o.severities,"severity")),g())):F.reject()}function v(e,t){return e?_.isArray(e)?_defineProperty({},t,e.join(",")):_defineProperty({},t,Object.keys(e).filter(function(t){return e[t]}).join(",")):{}}function g(){return"resolved"in o.options&&o.options.resolved?{}:_.isUndefined(o.options.resolved)?{resolved:void 0}:{resolved:!1}}function h(){if(!j(o.options).byType())return F.reject();var e=o.options.types,t=_objectSpread(_objectSpread(_objectSpread(_objectSpread({pageSize:T()},g()),v(o.severities,"severity")),v(o.options.status,"status")),v(o.options.types,"type"));return z.list(t).then(function(t){return _.filter(t,function(t){return _.includes(e,t.type)})})}function b(t){var e=t;i.paginate&&!o.paginate||(o.paging=e.paging);var n=o.options;if(n){var r=j(n);e=_.filter(e,function(t){return(!r.byType()||_.includes(n.types,t.type))&&(!r.byStatus()||n.status[t.status])&&(!r.bySeverity()||n.severity===t.severity)})}return o.alarms=e}function S(t){var e=[["severity","time","text"],["asc","desc","asc"]];if("ACTIVE_FIRST"===o.options.orderMode){var n={ACTIVE:1,ACKNOWLEDGED:0,CLEARED:-1};e=[[function(t){return n[t.status]},"severity","time","text"],["desc","asc","desc","asc"]]}var r=_(t).filter(c).filter(f).orderBy(e[0],e[1]).value(),i=_.get(o,"options.displayFilter");return i&&(r=_.filter(r,i)),o.filteredAlarms=r}function j(e){function t(t){return function(){return e&&!!t}}var n=e||{};return{byType:t(!_.isEmpty(n.types)),byStatus:t(n.status&&!_.isEmpty(n.status)&&function(t){return _.some(t,function(t){return!0===t})}(n.status)),bySeverity:t(n.severity),byDevices:function(){return t(!_.isEmpty(I()))}}}function E(){o.realtimeAnimation=!1,l()}function w(t,e){if(o.realtimeAnimation=!0,P(e,o.options)){var n=_.find(o.alarms,{id:e.id});n?L(e,n):A(e,t)}}function A(t,e){var n=A._executing;if(n&&"nextPage"!==e)return n.creating=!0,F.reject(n);var r=O(t).then(function(t){o.alarms.unshift(t)}).finally(function(){A._executing=null});return A._executing=r}function L(e,t){var n=O(e,t.source.name);return r[e.id]&&(n=n.then(o.auditRefresh[e.id])),n.then(function(){o.realtimeAnimation=!0;var t=_.findIndex(o.alarms,{id:e.id});o.alarms[t]=e})}function D(t){_.remove(o.alarms,{id:t.id}),delete o.auditList[t.id],delete r[t.id]}function R(t,n){o.realtimeAnimation=!0,!_.some(o.alarms,function(t){var e;return t.id===n.id&&(P(n,o.options)?L(n,t):D(n),e=!0),e})&&P(n,o.options)&&A(n).catch(function(e,n){return function(t){return t&&t.creating&&_.isFunction(t.then)?t.then(_.partial(R,e,n)):F.reject(t)}}(t,n))}function C(t,e){var n;return o.realtimeAnimation=!0,_.forEach(o.alarms,function(t){t.id===e.id&&(D(e),n=!1)}),n}function O(e,t){var n=F.resolve(e);return _.defaultsDeep(e,{source:{name:t}}),!e.source.name&&e.source.id&&(n=function(t){return G.detail(t).then(V.getResData).then(function(t){return t.name})}(e.source.id).then(function(t){e.source.name=t}).then(function(){return e})),n}function P(t,e){return function(n,t){return!t||_.some(t,function(t,e){return t&&e===n.status})}(t,e.status)&&function(t,e){return _.isEmpty(e)||_.includes(e,t.type)}(t,e.types)&&function(t,e){return!e||e===t.severity}(t,e.severity)}function T(){return o.options&&Number(o.options.pageSize)||20}function $(){M.switchRealtime(o.$id,o.realtimeChannel)}function N(){return M.getStatus(o.$id,o.realtimeChannel)}function k(t,e){M.addListener(o.$id,o.realtimeChannel,t,e)}function x(){var t=o.realtimeChannel,e=function(){var t=I();return"/alarmsWithChildren/".concat(t.length?t.join(","):"*")}();if(t){if(e===t)return;M.removeSubscriber(o.$id,t),o.cancelDestroyRemoveSubscriber(),o.stopWatchingRealtime()}o.realtimeChannel=e,k("".concat(o.$id,"-subscribed"),E),k("CREATE",w),k("UPDATE",R),k("DELETE",C),o.cancelDestroyRemoveSubscriber=o.$on("$destroy",function(){return M.removeSubscriber(o.$id,o.realtimeChannel)}),o.stopWatchingRealtime=o.$watch("realtime",W),o.realtime&&$()}function I(){var t=o.options,e=t.source,n=t.sources,r=_.concat(n,e);return _(r).map(function(t){return V.hasId(t)&&V.getId(t)}).compact().value()}function W(){o.realtime&&l(),o.realtime!==N()&&$()}o.auditRefresh={},o.statusText=function(t){var e;switch((t.status||"").toUpperCase()){case z.status.ACKNOWLEDGED:e=n;break;case z.status.CLEARED:e=s;break;case z.status.ACTIVE:e=u;break;default:e=function(){return""}}return e(t)},o.isActive=function(t){return t.status===z.status.ACTIVE},o.toggle=function(t){r[t.id]=!r[t.id]},o.isOpen=function(t){return!0===r[t.id]},o.isNarrow=function(){return o.containerWidth<=991},o.changeStatus=function(t,e){o.changingStatus=!0;var n=Q.getString('Alarm status changed to "{{status | translate}}".',{status:e}),r=z.update({id:t.id,status:e});return N()||(r=r.then(_.partial(a,t))),(r=r.then(function(){B.success(n)})).finally(function(){o.changingStatus=!1})},o.isFitSeverity=c,o.icon=z.icon,o.getStandardKeys=z.getStandardKeys.bind(z),o.getNonStandardKeys=z.getNonStandardKeys.bind(z),o.alarmDuration=function(t){return o.auditList&&o.auditList[t.id]?z.alarmDuration(t,o.auditList[t.id]):""},o.refresh=l,o.loadNext=m,o.createSmartRule=function(e){var t;return o.smartRules&&(t=q.current().then(function(t){return o.smartRulesSvc.addNewForInputAlarmAndOutputUserWithUI(e,t)})),t},o.translateAlarmText=function(t){return Q.getString(t.text)},o.getDeviceLinkFromAlarm=_.memoize(function(t){var e=H[X]||{};return e.getDeviceLinkFromAlarm?e.getDeviceLinkFromAlarm(t):["#","device",t.source.id].join("/")},function(t){return t.id}),o.$watch(function(){return{containerWidth:t.parent().width(),windowWidth:U.innerWidth}},function(t){o.containerWidth=t.containerWidth||t.windowWidth},!0),o.$watch("alarms",S,!0),o.$watch("severities",function(){l().then(function(){return S(o.alarms)})},!0),o.$on("alarmListRefresh",l),i.filter?o.$watch("options",function(){l().then(x)},!0):o.realtime||l(),J.shouldShowGlobalSmartRules().then(function(t){o.smartRules=t&&V.checkIfModulesExist(["c8y.cockpit.config"])}).then(function(){o.smartRules&&(o.smartRulesSvc=K.get("smartRulesSvc"))})}}}angular.module("c8y.ui").directive(X,t)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),r.forEach(function(e){_defineProperty(t,e,n[e])})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(w,C,E,e,t,n,T,D,j,A,M,O,r,$,R,U,B,I,z){return a.$inject=["$scope","$element"],{restrict:"EA",templateUrl:":::PLUGIN_PATH:::/ui/views/map2.html",scope:{multipleDevices:"&",realtime:"&",cssClass:"@",deviceId:"&",config:"&",markerTemplate:"&",controlButtons:"&",noDataFetch:"&",map:"=?",c8yLegend:"&"},link:function(e){e.$on("dashboard-change",function(){e.map&&e.map.leafletMap&&e.map.leafletMap.invalidateSize()})},controller:a};function a(o,e){var n,t={padding:[50,50]},c=[],s=!1,l=U("The map widget displays up to {{count}} devices."),u={mapCustomBaseLayers:j.getPluginService("mapCustomBaseLayers"),ecbPositionSelector:j.getPluginService("ecbPositionSelector"),mapMarkerClusterer:j.getPluginService("mapMarkerClusterer")};o.map=this,e.addClass(o.cssClass);var p=L.map(e.find(".c8y-map-internal").get(0),{attributionControl:!1}).fitBounds(L.latLngBounds(L.latLng(14,-130.3),L.latLng(53.9,112.3)));if(o.map.leafletMap=p,L.Browser.mobile){var r=U("Use two fingers to move the map.");p.dragging.disable(),p._container.setAttribute("data-touch-warning-content",B.getString(r)),p._container.addEventListener("touchstart",f),p._container.addEventListener("touchmove",f),p._container.addEventListener("touchend",f),p._container.addEventListener("touchcancel",f),p._container.addEventListener("click",f)}o.map.event=o.$new(!0),o.map.markers=c;var a=L.tileLayer("//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{noWrap:!0});a.addTo(p),u.mapMarkerClusterer&&u.mapMarkerClusterer.applyClustering({mapInternalScope:o}),o.map.tracker=new M.Tracker(o),o.tracker=o.map.tracker,o.tracker.onPaths(function(e,t){n&&p.removeLayer(n);(n=e).addTo(p),t&&v(n.getBounds())}),o.$on("$destroy",function(){o.cleanRealtime&&o.cleanRealtime(),s=!0,L.Browser.mobile&&(p._container.removeEventListener("touchstart",f),p._container.removeEventListener("touchmove",f),p._container.removeEventListener("touchend",f),p._container.removeEventListener("touchcancel",f),p._container.removeEventListener("click",f))});var i=L.Control.extend({options:{position:"topright"},onAdd:function(){var e=L.DomUtil.create("div");return angular.element(e).html('\n <c8y-realtime-switch\n ng-if="!realtime()"\n get-state="state()"\n on-start="startRt()"\n on-stop="stopRt()"\n ></c8y-realtime-switch>\n <c8y-refresh-btn></c8y-refresh-btn>\n '),C(e)(o),e}}),m=L.Control.extend({options:{position:"bottomright"},onAdd:function(){var e=L.DomUtil.create("div");return angular.element(e).html("<div c8y-map-legend></div>"),C(e)(o),e}}),d=L.control.layers({OSM:a});function f(e){for(var t=["leaflet-control-minimap","leaflet-interactive","leaflet-popup-content","leaflet-popup-content-wrapper","leaflet-popup-close-button","leaflet-control-zoom-in","leaflet-control-zoom-out"],n=!1,r=0;r<t.length;r++)L.DomUtil.hasClass(e.target,t[r])&&(n=!0);n?L.DomUtil.hasClass(e.target,"leaflet-interactive")&&"touchmove"===e.type&&1===e.touches.length?(L.DomUtil.addClass(p._container,"touch-warning"),p.dragging.disable()):L.DomUtil.removeClass(p._container,"touch-warning"):"touchmove"===e.type||"touchstart"===e.type?1===e.touches.length?(L.DomUtil.addClass(p._container,"touch-warning"),p.dragging.disable()):(p.dragging.enable(),L.DomUtil.removeClass(p._container,"touch-warning")):L.DomUtil.removeClass(p._container,"touch-warning")}function g(){var e=o.deviceId();return(e?function(n){var e;if(_.isArray(n))e=y(n);else{var r=[];e=T.detail(n).then(j.getResData).then(function(e){r.push(e);var t=w.when([]);return o.multipleDevices()&&(t=w.all([T.childDevices(n),T.childAssets(n)]).then(_.flattenDeep)),t}).then(function(e){r=_.union(r,e);var t=_(r).filter(function(e){return!A.isGroup(e)}).map("id").value();return _.isEmpty(t)?(h(),w.when(new L.featureGroup)):y(t)})}return e}(e):y()).then(function(e){o.tracker.getActiveDeviceIds().length||v(e.getBounds())})}function v(e){e&&e.isValid()&&p.fitBounds(e,t)}function h(){o.devices=[],_.forEach(c,function(e){p.removeLayer(e)}),c.length=0}function y(n){var e,i={};if(o.noDataFetch())return w.reject();if(delete o.filterIds,u.ecbPositionSelector)e=u.ecbPositionSelector.getPositionedDevicesByEvents();else if(n&&n.length){var t=_.uniq(n);e=function t(e){var n=j.PAGESIZE;var r=_.take(e,n);var a=_.drop(e,n);return T.list({ids:r.join(","),pageSize:n}).then(function(e){return a.length&&(e.paging.next=function(){return t(a)}),e})}(o.filterIds=t),S()}else{var r={__or:[{__and:[{__has:"".concat(O.c8y_Position,".lat")},{__has:"".concat(O.c8y_Position,".lng")}]},{__and:[{__has:"".concat(O.v4e_Position,".lat")},{__has:"".concat(O.v4e_Position,".lng")}]}]};e=T.listQuery(r,{pageSize:function(){var e=G("mapWidgetPageSize");return!e||_.isNaN(e)?100:e}()}),S()}return function t(e){var r,a;return e.then(function(e){var t=e.statistics,n=e.paging;return r=n.next,a=t.pageSize,e}).then(function(e){return _(e).filter(function(e){var t=O.getLocationFragment(e);return!(!t||180<Math.abs(t.lng)||90<Math.abs(t.lat))||(console.warn("Device ".concat(e.name," has an invalid position!")),!1)}).reduce(function(e,t){return e[t.id]=t,e},{})}).then(function(e){return i=function(e,t,n){var r=_objectSpread({},e),a=Object.keys(r).length;if(a+Object.keys(t).length<=n)r=_objectSpread({},r,t);else{F()||I.info(B.getString(l,{count:n}));var i=Object.entries(t).filter(function(e,t){return void 0!==e&&t+a<n}).reduce(function(e,t){return e[t[0]]=t[1],e},{});r=_objectSpread({},r,i)}return r}(i,e,a),Object.keys(i).length<a&&r&&!s&&t(r()),Object.keys(i).length>=a&&r&&!F()&&I.info(B.getString(l,{count:a})),i}).then(function(e){h(),o.devices=e,_.forEach(e,function(e){var t=b(e),n=O.getLocationFragment(e),r=L.marker(L.latLng(n.lat,n.lng),{icon:t});r.on("click",function(){r.isPopupOpen()&&r.getPopup()||k(e,r)}),r.id=e.id,c.push(r)});var t=new L.featureGroup(c);return t.addTo(p),t}).then(function(e){return o.map.event.$broadcast("refresh",n),e}).then(function(e){o.tracker.getActiveDeviceIds().length||v(e.getBounds())})}(e)}function b(e){var t=e.c8y_ActiveAlarmsStatus||{},n=_.find(["critical","major","minor","warning"],function(e){return t[e]})||"normal";return L.divIcon({className:"".concat(n,"-marker-icon"),iconSize:[25,41],iconAnchor:[12.5,41]})}function k(e,t){return function(n){var e={fragmentType:"c8y_Position",dateFrom:"1970-01-01",dateTo:moment().add(1,"days").format("YYYY-MM-DD"),pageSize:1,source:n.id};return $.list(e).then(function(e){var t=e.length?e[0].time:void 0;return function(e,t){o.markerTemplate()||(o.markerTemplate=P);var n=E("absoluteDate")(t),r='\n <div\n c8y-map-marker\n i-mo="devices['.concat(e.id,']"\n i-template="markerTemplate()"\n i-tracker="tracker"\n last-updated="\'').concat(n,"'\"\n ></div>\n "),a=angular.element(r);return C(a)(o),a.get(0)}(n,t)})}(e).then(function(e){return function(e,t){var n=e.getPopup(),r=n||L.popup({minWidth:120});e.bindPopup(r,{offset:L.point(0,-20)}),r.setContent(t),n||e.openPopup();return r}(t,e)})}function P(){return"<div ng-include=\"'".concat(z,"'\"></div>")}function S(){var e=o.realtimeChannel,t="/managedobjects/*",n=o.filterIds,r=o.deviceId();if(r&&!n&&(n=[r]),n&&(t="/managedobjects/".concat(n.join(","))),e){if(e===t)return;o.cleanRealtime()}e=t,o.realtimeChannel=e,D.addListener.bind(D,o.$id,e)("UPDATE",function(e,t){var n=O.getLocationFragment(t);if(n){var r=_.find(c,{id:t.id});if(r){r.setLatLng(L.latLng(n.lat,n.lng)),r.setIcon(b(t));var a=r.getPopup();a&&a._isOpen&&k(t,r)}o.devices&&o.devices[t.id]&&(o.devices[t.id]=t),o.map.event.$broadcast("realtime",t)}}),o.cleanRealtime=function(){D.removeSubscriber(o.$id,e)},o.map.state=function(){return D.getStatus(o.$id,e)},o.map.startRt=function(){o.noDataFetch()||(D.start(o.$id,e),o.tracker.state||o.tracker.start())},o.map.stopRt=function(){D.stop(o.$id,e),o.tracker.state&&o.tracker.stop()},_.assign(o,{state:o.map.state,startRt:o.map.startRt,stopRt:o.map.stopRt}),o.realtime()&&(x()||o.startRt())}(function(r,a){var e=R.getBaseLayers(o.map),t=R.getOverlays(o.map),n=w.reject();u.mapCustomBaseLayers&&(n=u.mapCustomBaseLayers.create({google:!0,here:!0,bing:!0,googleSatellite:!0,hereSatellite:!0,bingSatellite:!0}));w.any(_.values(e).concat(n,_.values(t))).then(function(e){_.isEmpty(e)||r.addTo(a)}),_.forEach(e,function(e,t){e.then(function(e){r.addBaseLayer(e,t)})}),n.then(function(e){_.forEach(e,function(e){r.addBaseLayer(e.layer,e.name)})}),R.getUserOverlayPreferences().then(function(n){_.forEach(t,function(e,t){e.then(function(e){r.addOverlay(e,t),n[t]&&a.addLayer(e)})})})})(o.map.layersControl=d,p),p.on("overlayadd",function(e){R.setUserOverlayPreference(e,!0)}),p.on("overlayremove",function(e){R.setUserOverlayPreference(e,!1)}),o.controlButtons()&&p.addControl(new i),o.c8yLegend()&&p.addControl(new m),o.paging={refresh:!0},o.refresh=g,S(),o.$watch("deviceId()",g),o.$watch("noDataFetch()",function(e){e?o.stopRt():x()||o.startRt()})}}function G(e){return _.get(window,"C8Y_APP.".concat(e))}function x(){return!!G("mapWidgetRealtimeDisabled")}function F(){return!!G("mapWidgetHideMaxDeviceOnMapHint")}function t(n,e,r){return{restrict:"EA",scope:{iMo:"&",iTemplate:"&",iTracker:"&",lastUpdated:"="},link:function(t,e){_.assign(t,{mo:t.iMo(),tracker:_.defaults(t.iTracker(),{__gps:!1,__gsm:!1}),onTrackingChange:function(e){t.tracker.__gps||t.tracker.__gsm?t.tracker.activate(e,{gps:t.tracker.__gps,gsm:t.tracker.__gsm}):t.tracker.deactivate(e)}}),t.showTrackingOptions=!1,r.gsmTrackingAvailable(t.mo).then(function(e){t.showTrackingOptions=e}),e.html(t.iTemplate()),n(e.contents())(t)}}}t.$inject=["$compile","c8yApplication","c8yCombain"],e.$inject=["$q","$compile","$filter","$http","$timeout","$injector","c8yInventory","c8yRealtime","c8yBase","c8yGroups","c8yTracker","c8yGeo","c8yApplication","c8yEvents","c8yMapConfig","gettext","gettextCatalog","c8yAlert","MARKER_TEMPLATE"],angular.module("c8y.ui").constant("MARKER_TEMPLATE",":::PLUGIN_PATH:::/ui/views/map2-markerTemplate.html").directive("c8yMapInternal",e).directive("c8yMapMarker",t).directive("c8yMapLegend",function(){return{restrict:"EA",templateUrl:":::PLUGIN_PATH:::/ui/views/map2-legend.html"}})}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(S,j,E,e,t,n,O,C,D,T,A,M,r,$,R,U,B,I,z){return a.$inject=["$scope","$element"],{restrict:"EA",templateUrl:":::PLUGIN_PATH:::/ui/views/map2.html",scope:{multipleDevices:"&",realtime:"&",cssClass:"@",deviceId:"&",config:"&",markerTemplate:"&",controlButtons:"&",noDataFetch:"&",map:"=?",c8yLegend:"&"},link:function(e){e.$on("dashboard-change",function(){e.map&&e.map.leafletMap&&e.map.leafletMap.invalidateSize()})},controller:a};function a(i,e){var n,t={padding:[50,50]},c=[],s=!1,l=U("The map widget displays up to {{count}} devices."),u={mapCustomBaseLayers:D.getPluginService("mapCustomBaseLayers"),ecbPositionSelector:D.getPluginService("ecbPositionSelector"),mapMarkerClusterer:D.getPluginService("mapMarkerClusterer")};i.map=this,e.addClass(i.cssClass);var p=L.map(e.find(".c8y-map-internal").get(0),{attributionControl:!1}).fitBounds(L.latLngBounds(L.latLng(14,-130.3),L.latLng(53.9,112.3)));if(i.map.leafletMap=p,L.Browser.mobile){var r=U("Use two fingers to move the map.");p.dragging.disable(),p._container.setAttribute("data-touch-warning-content",B.getString(r)),p._container.addEventListener("touchstart",f),p._container.addEventListener("touchmove",f),p._container.addEventListener("touchend",f),p._container.addEventListener("touchcancel",f),p._container.addEventListener("click",f)}i.map.event=i.$new(!0),i.map.markers=c;var a=L.tileLayer("//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{noWrap:!0});a.addTo(p),u.mapMarkerClusterer&&u.mapMarkerClusterer.applyClustering({mapInternalScope:i}),i.map.tracker=new A.Tracker(i),i.tracker=i.map.tracker,i.tracker.onPaths(function(e,t){n&&p.removeLayer(n);(n=e).addTo(p),t&&v(n.getBounds())}),i.$on("$destroy",function(){i.cleanRealtime&&i.cleanRealtime(),s=!0,L.Browser.mobile&&(p._container.removeEventListener("touchstart",f),p._container.removeEventListener("touchmove",f),p._container.removeEventListener("touchend",f),p._container.removeEventListener("touchcancel",f),p._container.removeEventListener("click",f))});var o=L.Control.extend({options:{position:"topright"},onAdd:function(){var e=L.DomUtil.create("div");return angular.element(e).html('\n <c8y-realtime-switch\n ng-if="!realtime()"\n get-state="state()"\n on-start="startRt()"\n on-stop="stopRt()"\n ></c8y-realtime-switch>\n <c8y-refresh-btn></c8y-refresh-btn>\n '),j(e)(i),e}}),m=L.Control.extend({options:{position:"bottomright"},onAdd:function(){var e=L.DomUtil.create("div");return angular.element(e).html("<div c8y-map-legend></div>"),j(e)(i),e}}),d=L.control.layers({OSM:a});function f(e){for(var t=["leaflet-control-minimap","leaflet-interactive","leaflet-popup-content","leaflet-popup-content-wrapper","leaflet-popup-close-button","leaflet-control-zoom-in","leaflet-control-zoom-out"],n=!1,r=0;r<t.length;r++)L.DomUtil.hasClass(e.target,t[r])&&(n=!0);n?L.DomUtil.hasClass(e.target,"leaflet-interactive")&&"touchmove"===e.type&&1===e.touches.length?(L.DomUtil.addClass(p._container,"touch-warning"),p.dragging.disable()):L.DomUtil.removeClass(p._container,"touch-warning"):"touchmove"===e.type||"touchstart"===e.type?1===e.touches.length?(L.DomUtil.addClass(p._container,"touch-warning"),p.dragging.disable()):(p.dragging.enable(),L.DomUtil.removeClass(p._container,"touch-warning")):L.DomUtil.removeClass(p._container,"touch-warning")}function g(){var e=i.deviceId();return(e?function(n){var e;if(_.isArray(n))e=y(n);else{var r=[];e=O.detail(n).then(D.getResData).then(function(e){r.push(e);var t=S.when([]);return i.multipleDevices()&&(t=S.all([O.childDevices(n),O.childAssets(n)]).then(_.flattenDeep)),t}).then(function(e){r=_.union(r,e);var t=_(r).filter(function(e){return!T.isGroup(e)}).map("id").value();return _.isEmpty(t)?(h(),S.when(new L.featureGroup)):y(t)})}return e}(e):y()).then(function(e){i.tracker.getActiveDeviceIds().length||v(e.getBounds())})}function v(e){e&&e.isValid()&&p.fitBounds(e,t)}function h(){i.devices=[],_.forEach(c,function(e){p.removeLayer(e)}),c.length=0}function y(n){var e,o={};if(i.noDataFetch())return S.reject();if(delete i.filterIds,u.ecbPositionSelector)e=u.ecbPositionSelector.getPositionedDevicesByEvents();else if(n&&n.length){var t=_.uniq(n);e=function t(e){var n=D.PAGESIZE;var r=_.take(e,n);var a=_.drop(e,n);return O.list({ids:r.join(","),pageSize:n}).then(function(e){return a.length&&(e.paging.next=function(){return t(a)}),e})}(i.filterIds=t),w()}else{var r={__or:[{__and:[{__has:"".concat(M.c8y_Position,".lat")},{__has:"".concat(M.c8y_Position,".lng")}]},{__and:[{__has:"".concat(M.v4e_Position,".lat")},{__has:"".concat(M.v4e_Position,".lng")}]}]};e=O.listQuery(r,{pageSize:function(){var e=G("mapWidgetPageSize");return!e||_.isNaN(e)?100:e}()}),w()}return function t(e){var r,a;return e.then(function(e){var t=e.statistics,n=e.paging;return r=n.next,a=t.pageSize,e}).then(function(e){return _(e).filter(function(e){var t=M.getLocationFragment(e);return!(!t||180<Math.abs(t.lng)||90<Math.abs(t.lat))||(console.warn("Device ".concat(e.name," has an invalid position!")),!1)}).reduce(function(e,t){return e[t.id]=t,e},{})}).then(function(e){return o=function(e,t,n){var r=_objectSpread({},e),a=Object.keys(r).length;if(a+Object.keys(t).length<=n)r=_objectSpread(_objectSpread({},r),t);else{F()||I.info(B.getString(l,{count:n}));var o=Object.entries(t).filter(function(e,t){return void 0!==e&&t+a<n}).reduce(function(e,t){return e[t[0]]=t[1],e},{});r=_objectSpread(_objectSpread({},r),o)}return r}(o,e,a),Object.keys(o).length<a&&r&&!s&&t(r()),Object.keys(o).length>=a&&r&&!F()&&I.info(B.getString(l,{count:a})),o}).then(function(e){h(),i.devices=e,_.forEach(e,function(e){var t=b(e),n=M.getLocationFragment(e),r=L.marker(L.latLng(n.lat,n.lng),{icon:t});r.on("click",function(){r.isPopupOpen()&&r.getPopup()||P(e,r)}),r.id=e.id,c.push(r)});var t=new L.featureGroup(c);return t.addTo(p),t}).then(function(e){return i.map.event.$broadcast("refresh",n),e}).then(function(e){i.tracker.getActiveDeviceIds().length||v(e.getBounds())})}(e)}function b(e){var t=e.c8y_ActiveAlarmsStatus||{},n=_.find(["critical","major","minor","warning"],function(e){return t[e]})||"normal";return L.divIcon({className:"".concat(n,"-marker-icon"),iconSize:[25,41],iconAnchor:[12.5,41]})}function P(e,t){return function(n){var e={fragmentType:"c8y_Position",dateFrom:"1970-01-01",dateTo:moment().add(1,"days").format("YYYY-MM-DD"),pageSize:1,source:n.id};return $.list(e).then(function(e){var t=e.length?e[0].time:void 0;return function(e,t){i.markerTemplate()||(i.markerTemplate=k);var n=E("absoluteDate")(t),r='\n <div\n c8y-map-marker\n i-mo="devices['.concat(e.id,']"\n i-template="markerTemplate()"\n i-tracker="tracker"\n last-updated="\'').concat(n,"'\"\n ></div>\n "),a=angular.element(r);return j(a)(i),a.get(0)}(n,t)})}(e).then(function(e){return function(e,t){var n=e.getPopup(),r=n||L.popup({minWidth:120});e.bindPopup(r,{offset:L.point(0,-20)}),r.setContent(t),n||e.openPopup();return r}(t,e)})}function k(){return"<div ng-include=\"'".concat(z,"'\"></div>")}function w(){var e=i.realtimeChannel,t="/managedobjects/*",n=i.filterIds,r=i.deviceId();if(r&&!n&&(n=[r]),n&&(t="/managedobjects/".concat(n.join(","))),e){if(e===t)return;i.cleanRealtime()}e=t,i.realtimeChannel=e,C.addListener.bind(C,i.$id,e)("UPDATE",function(e,t){var n=M.getLocationFragment(t);if(n){var r=_.find(c,{id:t.id});if(r){r.setLatLng(L.latLng(n.lat,n.lng)),r.setIcon(b(t));var a=r.getPopup();a&&a._isOpen&&P(t,r)}i.devices&&i.devices[t.id]&&(i.devices[t.id]=t),i.map.event.$broadcast("realtime",t)}}),i.cleanRealtime=function(){C.removeSubscriber(i.$id,e)},i.map.state=function(){return C.getStatus(i.$id,e)},i.map.startRt=function(){i.noDataFetch()||(C.start(i.$id,e),i.tracker.state||i.tracker.start())},i.map.stopRt=function(){C.stop(i.$id,e),i.tracker.state&&i.tracker.stop()},_.assign(i,{state:i.map.state,startRt:i.map.startRt,stopRt:i.map.stopRt}),i.realtime()&&(x()||i.startRt())}(function(r,a){var e=R.getBaseLayers(i.map),t=R.getOverlays(i.map),n=S.reject();u.mapCustomBaseLayers&&(n=u.mapCustomBaseLayers.create({google:!0,here:!0,bing:!0,googleSatellite:!0,hereSatellite:!0,bingSatellite:!0}));S.any(_.values(e).concat(n,_.values(t))).then(function(e){_.isEmpty(e)||r.addTo(a)}),_.forEach(e,function(e,t){e.then(function(e){r.addBaseLayer(e,t)})}),n.then(function(e){_.forEach(e,function(e){r.addBaseLayer(e.layer,e.name)})}),R.getUserOverlayPreferences().then(function(n){_.forEach(t,function(e,t){e.then(function(e){r.addOverlay(e,t),n[t]&&a.addLayer(e)})})})})(i.map.layersControl=d,p),p.on("overlayadd",function(e){R.setUserOverlayPreference(e,!0)}),p.on("overlayremove",function(e){R.setUserOverlayPreference(e,!1)}),i.controlButtons()&&p.addControl(new o),i.c8yLegend()&&p.addControl(new m),i.paging={refresh:!0},i.refresh=g,w(),i.$watch("deviceId()",g),i.$watch("noDataFetch()",function(e){e?i.stopRt():x()||i.startRt()})}}function G(e){return _.get(window,"C8Y_APP.".concat(e))}function x(){return!!G("mapWidgetRealtimeDisabled")}function F(){return!!G("mapWidgetHideMaxDeviceOnMapHint")}function t(n,e,r){return{restrict:"EA",scope:{iMo:"&",iTemplate:"&",iTracker:"&",lastUpdated:"="},link:function(t,e){_.assign(t,{mo:t.iMo(),tracker:_.defaults(t.iTracker(),{__gps:!1,__gsm:!1}),onTrackingChange:function(e){t.tracker.__gps||t.tracker.__gsm?t.tracker.activate(e,{gps:t.tracker.__gps,gsm:t.tracker.__gsm}):t.tracker.deactivate(e)}}),t.showTrackingOptions=!1,r.gsmTrackingAvailable(t.mo).then(function(e){t.showTrackingOptions=e}),e.html(t.iTemplate()),n(e.contents())(t)}}}t.$inject=["$compile","c8yApplication","c8yCombain"],e.$inject=["$q","$compile","$filter","$http","$timeout","$injector","c8yInventory","c8yRealtime","c8yBase","c8yGroups","c8yTracker","c8yGeo","c8yApplication","c8yEvents","c8yMapConfig","gettext","gettextCatalog","c8yAlert","MARKER_TEMPLATE"],angular.module("c8y.ui").constant("MARKER_TEMPLATE",":::PLUGIN_PATH:::/ui/views/map2-markerTemplate.html").directive("c8yMapInternal",e).directive("c8yMapMarker",t).directive("c8yMapLegend",function(){return{restrict:"EA",templateUrl:":::PLUGIN_PATH:::/ui/views/map2-legend.html"}})}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),r.forEach(function(t){_defineProperty(e,t,i[t])})}return e}function _defineProperty(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);var r=i.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(t){t.register("lastDeviceMessage",e)}function e(n,t,e,o,c,a,i){var r={};function u(t){return i.list({source:t,pageSize:50})}function s(t,e){var i=this;i.device=t,i.service=e.service,i.check_audit=e.check_audit,i.rt_channel="/".concat(e.rt_channel,"/").concat(t.id),i.filter_prop=e.filter_prop||"source",i.time_prop=e.time_prop||"time",i.ops=e.ops,i.list(e.listFilters).then(_.bind(i.onList,i))}function p(i){var r=this;r.device=i,r.dateObj=[function(e){var t={};return Object.defineProperty(t,"timestamp",{get:function(){var t=e.device||{};return t.c8y_Availability&&t.c8y_Availability.lastMessage}}),t}(r)],r.devices=new Set,_.forEach([{service:t,rt_channel:"alarms",check_audit:!0},{service:e,rt_channel:"events",ops:["CREATE"],time_prop:"creationTime"},{service:o,rt_channel:"measurements",ops:["CREATE"],listFilters:{revert:!0}},{service:c,rt_channel:"operations",ops:["UPDATE"],filter_prop:"deviceId",check_audit:!0,listFilters:{dateFrom:new Date(0).toISOString(),dateTo:new Date(Date.now()).toISOString(),revert:!0}}],function(t){var e=new s(i,t);r.dateObj.push(e)})}function l(t){r[t.id]=r[t.id]||new p(t);var e=r[t.id];return e.device=t,e.add(t),e.get()}return s.prototype.list=function(){var t=this,e=_objectSpread({pageSize:1},0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return e[t.filter_prop]=t.device.id,t.service.list(e)},s.prototype.updateValue=function(t){var e=this;e.timestamp||(e.timestamp=t),moment(e.timestamp).isBefore(t)&&(e.timestamp=t)},s.prototype.onList=function(t){var e=this,i=_(t),r=e.check_audit?"id":e.time_prop,n=_.bind(e.updateValue,e),o=e.check_audit?function(t){u(t).then(_.bind(e.onAudit,e))}:n;i.map(r).forEach(o),e.startRealtime()},s.prototype.onRealtime=function(t,e){var i=this;i.check_audit?u(e.id).then(_.bind(i.onAudit,i)):i.updateValue(e[i.time_prop])},s.prototype.onAudit=function(t){_(t).filter(_.bind(this.byOwner,this)).map("creationTime").forEach(_.bind(this.updateValue,this))},s.prototype.byOwner=function(t){var e=this.device;return t.user===e.owner},s.prototype.startRealtime=function(){var e=this;a.createLocalId(e,"rtId");var i=e.rtId,r=e.rt_channel,t=e.ops||["CREATE","UPDATE","DELETE"];_.forEach(t,function(t){n.addListener(i,r,t,_.bind(e.onRealtime,e))}),n.start(i,r)},s.prototype.stopRealtime=function(){n.removeSubscriber(this.rtId,this.rt_channel)},p.prototype.detach=function(t){var e=this.devices;e.delete(t),e.size||(_(this.dateObj).filter("stopRealtime").forEach(function(t){return t.stopRealtime()}),delete r[t.id])},p.prototype.add=function(t){this.devices.has(t)||this.devices.add(t)},p.prototype.get=function(){return function(t){var e=_(t).map(function(t){return t&&moment(t)}).filter(_.identity).value();return e.length?moment.max(e).format("YYYY-MM-DDTHH:mm:ssZ"):void 0}(_.map(this.dateObj,"timestamp"))},l.detach=function(t){var e=r[t.id];e&&e.detach(t)},l}e.$inject=["c8yRealtime","c8yAlarms","c8yEvents","c8yMeasurements","c8yDeviceControl","c8yBase","c8yAudits"],t.$inject=["c8yComputedPropertiesProvider"],angular.module("c8y.ui").config(t)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var i=r.call(e,t||"default");if("object"!==_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e){e.register("lastDeviceMessage",t)}function t(n,e,t,o,c,a,r){var i={};function s(e){return r.list({source:e,pageSize:50})}function u(e,t){var r=this;r.device=e,r.service=t.service,r.check_audit=t.check_audit,r.rt_channel="/".concat(t.rt_channel,"/").concat(e.id),r.filter_prop=t.filter_prop||"source",r.time_prop=t.time_prop||"time",r.ops=t.ops,r.list(t.listFilters).then(_.bind(r.onList,r))}function p(r){var i=this;i.device=r,i.dateObj=[function(t){var e={};return Object.defineProperty(e,"timestamp",{get:function(){var e=t.device||{};return e.c8y_Availability&&e.c8y_Availability.lastMessage}}),e}(i)],i.devices=new Set,_.forEach([{service:e,rt_channel:"alarms",check_audit:!0},{service:t,rt_channel:"events",ops:["CREATE"],time_prop:"creationTime"},{service:o,rt_channel:"measurements",ops:["CREATE"],listFilters:{revert:!0}},{service:c,rt_channel:"operations",ops:["UPDATE"],filter_prop:"deviceId",check_audit:!0,listFilters:{dateFrom:new Date(0).toISOString(),dateTo:new Date(Date.now()).toISOString(),revert:!0}}],function(e){var t=new u(r,e);i.dateObj.push(t)})}function d(e){i[e.id]=i[e.id]||new p(e);var t=i[e.id];return t.device=e,t.add(e),t.get()}return u.prototype.list=function(){var e=this,t=_objectSpread({pageSize:1},0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return t[e.filter_prop]=e.device.id,e.service.list(t)},u.prototype.updateValue=function(e){var t=this;t.timestamp||(t.timestamp=e),moment(t.timestamp).isBefore(e)&&(t.timestamp=e)},u.prototype.onList=function(e){var t=this,r=_(e),i=t.check_audit?"id":t.time_prop,n=_.bind(t.updateValue,t),o=t.check_audit?function(e){s(e).then(_.bind(t.onAudit,t))}:n;r.map(i).forEach(o),t.startRealtime()},u.prototype.onRealtime=function(e,t){var r=this;r.check_audit?s(t.id).then(_.bind(r.onAudit,r)):r.updateValue(t[r.time_prop])},u.prototype.onAudit=function(e){_(e).filter(_.bind(this.byOwner,this)).map("creationTime").forEach(_.bind(this.updateValue,this))},u.prototype.byOwner=function(e){var t=this.device;return e.user===t.owner},u.prototype.startRealtime=function(){var t=this;a.createLocalId(t,"rtId");var r=t.rtId,i=t.rt_channel,e=t.ops||["CREATE","UPDATE","DELETE"];_.forEach(e,function(e){n.addListener(r,i,e,_.bind(t.onRealtime,t))}),n.start(r,i)},u.prototype.stopRealtime=function(){n.removeSubscriber(this.rtId,this.rt_channel)},p.prototype.detach=function(e){var t=this.devices;t.delete(e),t.size||(_(this.dateObj).filter("stopRealtime").forEach(function(e){return e.stopRealtime()}),delete i[e.id])},p.prototype.add=function(e){this.devices.has(e)||this.devices.add(e)},p.prototype.get=function(){return function(e){var t=_(e).map(function(e){return e&&moment(e)}).filter(_.identity).value();return t.length?moment.max(t).format("YYYY-MM-DDTHH:mm:ssZ"):void 0}(_.map(this.dateObj,"timestamp"))},d.detach=function(e){var t=i[e.id];t&&t.detach(e)},d}t.$inject=["c8yRealtime","c8yAlarms","c8yEvents","c8yMeasurements","c8yDeviceControl","c8yBase","c8yAudits"],e.$inject=["c8yComputedPropertiesProvider"],angular.module("c8y.ui").config(e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?Object(arguments[e]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.forEach(function(e){_defineProperty(t,e,r[e])})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yActilityDevice";function e(e,l){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var s={label:l("LoRa"),fieldbusType:"actility",serviceName:r};return e.getDeviceTypeProtocolProvider(s,t);function t(e,t,r){var n={name:"actility"},i={name:"loriot-agent"},o=[t.MessageIdSources.FPORT,t.MessageIdSources.PAYLOAD],a=_objectSpread({},s,{type:"c8y_ActilityDeviceType",noNewProtocolInstances:!0,configuration:{messageIdConfiguration:o},discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:l("Values"),noRegistersDefinedMessage:l("No values defined."),newRegisterModalTitle:l("New value"),editRegisterModalTitle:l('Edit value: "{{name}}"'),addRegisterButtonLabel:l("Add value"),validation:{invalidName:l("Name must be unique among values."),invalidMeasurement:l("Selected measurement type and series are already used by another value in the same message type.")},messageTypeId:{label:l("Message type ID")},startBit:!0,noBits:!0,multiplier:!0,offset:!0,decimalPlaces:!1,options:{signed:!0,bcd:!0,littleEndian:!0},functionalities:{showStatus:!1,updateStatus:!1,sendMeasurement:!0,raiseAlarm:{alarmStatus:!0},sendEvent:{fragmentType:!0,innerType:!0},sendManagedObjectUpdate:!0},unit:{requiredForSendMeasurement:!0}},inputRegisters:!1,options:!1});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(u().then(function(e){return e&&a}))},isSubscribed:u};function u(){return e.all([r.isSubscribed(n),r.isSubscribed(i)]).then(function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];return r||n})}}}angular.module("c8y.actility").provider(r,e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){l=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yActilityDevice";function e(e,s){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var l={label:s("LoRa"),fieldbusType:"actility",serviceName:r};return e.getDeviceTypeProtocolProvider(l,t);function t(e,t,r){var n={name:"actility"},i={name:"loriot-agent"},o=[t.MessageIdSources.FPORT,t.MessageIdSources.PAYLOAD],a=_objectSpread(_objectSpread({},l),{},{type:"c8y_ActilityDeviceType",noNewProtocolInstances:!0,configuration:{messageIdConfiguration:o},discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:s("Values"),noRegistersDefinedMessage:s("No values defined."),newRegisterModalTitle:s("New value"),editRegisterModalTitle:s('Edit value: "{{name}}"'),addRegisterButtonLabel:s("Add value"),validation:{invalidName:s("Name must be unique among values."),invalidMeasurement:s("Selected measurement type and series are already used by another value in the same message type.")},messageTypeId:{label:s("Message type ID")},startBit:!0,noBits:!0,multiplier:!0,offset:!0,decimalPlaces:!1,options:{signed:!0,bcd:!0,littleEndian:!0},functionalities:{showStatus:!1,updateStatus:!1,sendMeasurement:!0,raiseAlarm:{alarmStatus:!0},sendEvent:{fragmentType:!0,innerType:!0},sendManagedObjectUpdate:!0},unit:{requiredForSendMeasurement:!0}},inputRegisters:!1,options:!1});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(u().then(function(e){return e&&a}))},isSubscribed:u};function u(){return e.all([r.isSubscribed(n),r.isSubscribed(i)]).then(function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];return r||n})}}}angular.module("c8y.actility").provider(r,e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},t=Object.prototype,f=t.hasOwnProperty,c=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,i=Object.create(o.prototype),a=new L(n||[]);return c(i,"_invoke",{value:function(i,a,c){var u="suspendedStart";return function(t,e){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===t)throw e;return O()}for(c.method=t,c.arg=e;;){var r=c.delegate;if(r){var n=_(r,c);if(n){if(n===s)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===u)throw u="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u="executing";var o=l(i,a,c);if("normal"===o.type){if(u=c.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u="completed",c.method="throw",c.arg=o.arg)}}}(t,r,a)}),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function p(){}function h(){}function y(){}var v={};i(v,o,function(){return this});var d=Object.getPrototypeOf,m=d&&d(d(j([])));m&&m!==t&&f.call(m,o)&&(v=m);var g=y.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,s){var e;c(this,"_invoke",{value:function(r,n){function t(){return new s(function(t,e){!function e(t,r,n,o){var i=l(u[t],u,r);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==_typeof(c)&&f.call(c,"__await")?s.resolve(c.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):s.resolve(c).then(function(t){a.value=t,n(a)},function(t){return e("throw",t,n,o)})}o(i.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),s;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,s;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(f.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return c(g,"constructor",{value:h.prototype=y,configurable:!0}),c(y,"constructor",{value:h,configurable:!0}),h.displayName=i(y,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},b(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},b(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(t){var r=Object(t),n=[];for(var e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=j,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&f.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=f.call(o,"catchLoc"),c=f.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&f.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,s):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);var n=r.call(t,e||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){t.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yCanbusDevice";function t(t,c){e.$inject=["c8yDeviceDatabase","c8yDeviceControl","gettextCatalog","c8yDevices","c8yBase","c8yUser"];var p={label:c("CAN Bus"),fieldbusType:"canbus",serviceName:r};return t.getDeviceTypeProtocolProvider(p,e);function e(t,u,e,s,f,o){var r=_objectSpread({},p,{discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{number:{label:c("Message ID"),useHex:!0,min:0,max:536870911},startBit:{max:63},noBits:{max:64},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,offset:{min:Number.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),max:Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1},options:{signed:!0,enumType:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_CanDevice"],deviceConfiguration:{fragment:"c8y_CanConfiguration",icon:"share-alt"}});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(n().then(function(t){return t&&r}))},isAvailable:n,create:function(t,e){return i.apply(this,arguments)}};function n(){return t.isFeatureFieldbus4Available()}function i(){return(i=_asyncToGenerator(_regeneratorRuntime().mark(function t(o,i){var a,c;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l(o,i);case 2:return a=t.sent,t.t0=f,t.next=6,s.createConfirm(a);case 6:return t.t1=t.sent,c=t.t0.getResData.call(t.t0,t.t1),t.next=10,s.addChildDevice(o,c);case 10:return c.owner=o.owner,t.next=13,s.save(c);case 13:return t.abrupt("return",u.create((e=o,r=i.deviceType,n=c,{deviceId:e.id,description:'Added new child device to "'.concat(e.name,'" (ID: ').concat(e.id,")."),c8y_CanDevice:{id:n.id,name:n.name,type:"/inventory/managedObjects/".concat(r.id)}})));case 14:case"end":return t.stop()}var e,r,n},t)}))).apply(this,arguments)}function l(t,e){return a.apply(this,arguments)}function a(){return(a=_asyncToGenerator(_regeneratorRuntime().mark(function t(e,r){var n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.current();case 2:return n=t.sent,t.abrupt("return",{name:"".concat(e.name," - ").concat(r.deviceType.name),type:r.deviceType.name,c8y_CanDevice:{type:"/inventory/managedObjects/".concat(r.deviceType.id)},owner:n.id});case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}}}angular.module("c8y.canbus").provider(r,t)}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},t=Object.prototype,f=t.hasOwnProperty,c=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,i=Object.create(o.prototype),a=new j(n||[]);return c(i,"_invoke",{value:function(i,a,c){var u="suspendedStart";return function(t,e){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===t)throw e;return P()}for(c.method=t,c.arg=e;;){var r=c.delegate;if(r){var n=_(r,c);if(n){if(n===s)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===u)throw u="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u="executing";var o=l(i,a,c);if("normal"===o.type){if(u=c.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u="completed",c.method="throw",c.arg=o.arg)}}}(t,r,a)}),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s={};function p(){}function y(){}function h(){}var v={};i(v,o,function(){return this});var d=Object.getPrototypeOf,m=d&&d(d(E([])));m&&m!==t&&f.call(m,o)&&(v=m);var g=h.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,s){var e;c(this,"_invoke",{value:function(r,n){function t(){return new s(function(t,e){!function e(t,r,n,o){var i=l(u[t],u,r);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==_typeof(c)&&f.call(c,"__await")?s.resolve(c.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):s.resolve(c).then(function(t){a.value=t,n(a)},function(t){return e("throw",t,n,o)})}o(i.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),s;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,s;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(f.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:P}}function P(){return{value:void 0,done:!0}}return c(g,"constructor",{value:y.prototype=h,configurable:!0}),c(h,"constructor",{value:y,configurable:!0}),y.displayName=i(h,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,i(t,n,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},b(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},b(g),i(g,n,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(t){var r=Object(t),n=[];for(var e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=E,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&f.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=f.call(o,"catchLoc"),c=f.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&f.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,s):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);var n=r.call(t,e||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){t.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yCanbusDevice";function t(t,c){e.$inject=["c8yDeviceDatabase","c8yDeviceControl","gettextCatalog","c8yDevices","c8yBase","c8yUser"];var p={label:c("CAN Bus"),fieldbusType:"canbus",serviceName:r};return t.getDeviceTypeProtocolProvider(p,e);function e(t,u,e,s,f,o){var r=_objectSpread(_objectSpread({},p),{},{discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{number:{label:c("Message ID"),useHex:!0,min:0,max:536870911},startBit:{max:63},noBits:{max:64},multiplier:{min:1,step:1},divisor:!0,decimalPlaces:!0,unit:!0,offset:{min:Number.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),max:Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1},options:{signed:!0,enumType:!0},functionalities:{showStatus:!0,updateStatus:!0,sendMeasurement:!0,raiseAlarm:!0,sendEvent:!0}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_CanDevice"],deviceConfiguration:{fragment:"c8y_CanConfiguration",icon:"share-alt"}});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(n().then(function(t){return t&&r}))},isAvailable:n,create:function(t,e){return i.apply(this,arguments)}};function n(){return t.isFeatureFieldbus4Available()}function i(){return(i=_asyncToGenerator(_regeneratorRuntime().mark(function t(o,i){var a,c;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l(o,i);case 2:return a=t.sent,t.t0=f,t.next=6,s.createConfirm(a);case 6:return t.t1=t.sent,c=t.t0.getResData.call(t.t0,t.t1),t.next=10,s.addChildDevice(o,c);case 10:return c.owner=o.owner,t.next=13,s.save(c);case 13:return t.abrupt("return",u.create((e=o,r=i.deviceType,n=c,{deviceId:e.id,description:'Added new child device to "'.concat(e.name,'" (ID: ').concat(e.id,")."),c8y_CanDevice:{id:n.id,name:n.name,type:"/inventory/managedObjects/".concat(r.id)}})));case 14:case"end":return t.stop()}var e,r,n},t)}))).apply(this,arguments)}function l(t,e){return a.apply(this,arguments)}function a(){return(a=_asyncToGenerator(_regeneratorRuntime().mark(function t(e,r){var n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.current();case 2:return n=t.sent,t.abrupt("return",{name:"".concat(e.name," - ").concat(r.deviceType.name),type:r.deviceType.name,c8y_CanDevice:{type:"/inventory/managedObjects/".concat(r.deviceType.id)},owner:n.id});case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}}}angular.module("c8y.canbus").provider(r,t)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return o};var o={},e=Object.prototype,l=e.hasOwnProperty,c=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},i=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),o=new N(r||[]);return c(a,"_invoke",{value:function(a,o,c){var s="suspendedStart";return function(e,t){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===e)throw t;return I()}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){var r=E(n,c);if(r){if(r===u)continue;return r}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===s)throw s="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);s="executing";var i=d(a,o,c);if("normal"===i.type){if(s=c.done?"completed":"suspendedYield",i.arg===u)continue;return{value:i.arg,done:c.done}}"throw"===i.type&&(s="completed",c.method="throw",c.arg=i.arg)}}}(e,n,o)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}o.wrap=s;var u={};function p(){}function f(){}function v(){}var y={};a(y,i,function(){return this});var g=Object.getPrototypeOf,h=g&&g(g(R([])));h&&h!==e&&l.call(h,i)&&(y=h);var m=v.prototype=p.prototype=Object.create(y);function _(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(s,u){var t;c(this,"_invoke",{value:function(n,r){function e(){return new u(function(e,t){!function t(e,n,r,i){var a=d(s[e],s,n);if("throw"!==a.type){var o=a.arg,c=o.value;return c&&"object"==_typeof(c)&&l.call(c,"__await")?u.resolve(c.__await).then(function(e){t("next",e,r,i)},function(e){t("throw",e,r,i)}):u.resolve(c).then(function(e){o.value=e,r(o)},function(e){return t("throw",e,r,i)})}i(a.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}})}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function R(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(l.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:I}}function I(){return{value:void 0,done:!0}}return c(m,"constructor",{value:f.prototype=v,configurable:!0}),c(v,"constructor",{value:f,configurable:!0}),f.displayName=a(v,r,"GeneratorFunction"),o.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,a(e,r,"GeneratorFunction")),e.prototype=Object.create(m),e},o.awrap=function(e){return{__await:e}},_(b.prototype),a(b.prototype,n,function(){return this}),o.AsyncIterator=b,o.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var a=new b(s(e,t,n,r),i);return o.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},_(m),a(m,r,"Generator"),a(m,i,function(){return this}),a(m,"toString",function(){return"[object Generator]"}),o.keys=function(e){var n=Object(e),r=[];for(var t in n)r.push(t);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},o.values=R,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return a.type="throw",a.arg=n,r.next=e,t&&(r.method="next",r.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(o&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},o}function asyncGeneratorStep(e,t,n,r,i,a,o){try{var c=e[a](o),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,i)}function _asyncToGenerator(c){return function(){var e=this,o=arguments;return new Promise(function(t,n){var r=c.apply(e,o);function i(e){asyncGeneratorStep(r,t,n,i,a,"next",e)}function a(e){asyncGeneratorStep(r,t,n,i,a,"throw",e)}i(void 0)})}}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),r.forEach(function(e){_defineProperty(t,e,n[e])})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var i="c8yCanopenDevice";function e(e,t,n,b){r.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yModbusDevice","gettextCatalog","c8yInventory","c8yDevices","c8yBase","c8yUser","$q"];var E={label:b("CANopen"),fieldbusType:"canopen",serviceName:i};return e.getDeviceTypeProtocolProvider(E,r);function r(e,f,v,t,n,s,u,i,y){var r=u.createEnum(_.flatten([{name:"BOOLEAN",label:b("Boolean"),value:"boolean",edsValue:1,noBits:1},{name:"SIGNED_8",label:b("Signed (8-bits)"),value:"signed8",edsValue:2,noBits:8,signed:!0},{name:"SIGNED_16",label:b("Signed (16-bits)"),value:"signed16",edsValue:3,noBits:16,signed:!0},{name:"SIGNED_24",label:b("Signed (24-bits)"),value:"signed24",edsValue:16,noBits:24,signed:!0},{name:"SIGNED_32",label:b("Signed (32-bits)"),value:"signed32",edsValue:4,noBits:32,signed:!0},{name:"SIGNED_40",label:b("Signed (40-bits)"),value:"signed40",edsValue:18,noBits:40,signed:!0},{name:"SIGNED_48",label:b("Signed (48-bits)"),value:"signed48",edsValue:19,noBits:48,signed:!0},{name:"SIGNED_56",label:b("Signed (56-bits)"),value:"signed56",edsValue:20,noBits:56,signed:!0},{name:"SIGNED_64",label:b("Signed (64-bits)"),value:"signed64",edsValue:21,noBits:64,signed:!0},{name:"UNSIGNED_8",label:b("Unsigned (8-bits)"),value:"unsigned8",edsValue:5,noBits:8,signed:!1},{name:"UNSIGNED_16",label:b("Unsigned (16-bits)"),value:"unsigned16",edsValue:6,noBits:16,signed:!1},{name:"UNSIGNED_24",label:b("Unsigned (24-bits)"),value:"unsigned24",edsValue:22,noBits:24,signed:!1},{name:"UNSIGNED_32",label:b("Unsigned (32-bits)"),value:"unsigned32",edsValue:7,noBits:32,signed:!1},{name:"UNSIGNED_40",label:b("Unsigned (40-bits)"),value:"unsigned40",edsValue:24,noBits:40,signed:!1},{name:"UNSIGNED_48",label:b("Unsigned (48-bits)"),value:"unsigned48",edsValue:25,noBits:48,signed:!1},{name:"UNSIGNED_56",label:b("Unsigned (56-bits)"),value:"unsigned56",edsValue:26,noBits:56,signed:!1},{name:"UNSIGNED_64",label:b("Unsigned (64-bits)"),value:"unsigned64",edsValue:27,noBits:64,signed:!1},{name:"REAL_32",label:b("Real (32-bits)"),value:"real32",edsValue:8,noBits:32,decimalPlaces:null,baseValuesRange:{min:-3.4*Math.pow(10,38),max:3.4*Math.pow(10,38)}},{name:"REAL_64",label:b("Real (64-bits)"),value:"real64",edsValue:17,noBits:64,decimalPlaces:null,baseValuesRange:{min:-Number.MAX_VALUE,max:Number.MAX_VALUE}}])),a=u.createEnum([{name:"READ_ONLY",label:b("Read-only"),value:"ro"},{name:"WRITE_ONLY",label:b("Write-only"),value:"wo"},{name:"READ_WRITE",label:b("Read-write"),value:"rw"},{name:"READ_WRITE_ON_PROCESS_INPUT",label:b("Read-write on process input"),value:"rwr"},{name:"READ_WRITE_ON_PROCESS_OUTPUT",label:b("Read-write on process output"),value:"rww"},{name:"CONSTANT",label:b("Constant"),value:"const"}]),o=_objectSpread({},E,{type:"c8y_CANopenDeviceType",deviceType:!0,discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:b("Variables"),noRegistersDefinedMessage:b("No variables defined."),elementTypeLabel:b("Variable"),newRegisterModalTitle:b("New variable"),editRegisterModalTitle:b('Edit variable: "{{name}}"'),addRegisterButtonLabel:b("Add variable"),unit:!0,validation:{invalidName:b("Name must be unique among variables."),invalidMeasurement:b("Selected measurement type and series are already used by another variable.")},index:{min:0,max:Math.pow(2,16)-1},subIndex:{min:0,max:Math.pow(2,8)-1},dataType:{choices:r},accessType:{choices:a},functionalities:{showStatus:{showIf:function(e){return _.includes([a.READ_ONLY,a.READ_WRITE,a.READ_WRITE_ON_PROCESS_INPUT,a.READ_WRITE_ON_PROCESS_OUTPUT,a.CONSTANT],_.get(e.meta,"accessType"))}},updateStatus:{showIf:function(e){return _.includes([a.READ_WRITE,a.READ_WRITE_ON_PROCESS_INPUT,a.READ_WRITE_ON_PROCESS_OUTPUT,a.WRITE_ONLY],_.get(e.meta,"accessType"))}},sendMeasurement:{showIf:c},raiseAlarm:{showIf:c,mask:!0},sendEvent:{showIf:c}}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_CANopenDevice"],deviceConfiguration:{fragment:"c8y_CANopenConfiguration",icon:"cloud-network"},getRegisterSource:function(e){return{key:"c8y_CANopenSource",value:{index:e.index,subIndex:e.subIndex}}},customizeSmartRestTemplates:function(e){return m(e.responseTemplates,{msgId:201,condition:"$.c8y_SetRegister",pattern:["$.id","$.c8y_SetRegister.nodeId","$.c8y_SetRegister.index","$.c8y_SetRegister.subIndex","$.c8y_SetRegister.dataType","$.c8y_SetRegister.value"]}),m(e.responseTemplates,{msgId:202,condition:"$.c8y_CANopenAddDevice",pattern:["$.id","$.deviceId","$.c8y_CANopenAddDevice.id","$.c8y_CANopenAddDevice.nodeId","$.c8y_CANopenAddDevice.type"]}),m(e.responseTemplates,{msgId:204,condition:"$.c8y_CANopenRemoveDevice",pattern:["$.id","$.deviceId","$.c8y_CANopenDevice.nodeId"]}),e}});function c(e){return _.includes([a.READ_ONLY,a.READ_WRITE,a.READ_WRITE_ON_PROCESS_INPUT,a.READ_WRITE_ON_PROCESS_OUTPUT],_.get(e.meta,"accessType"))}return{registerFeaturesManifest:function(){e.registerFeaturesManifest(l().then(function(e){return e&&o}))},isAvailable:l,create:function(e,t){return d.apply(this,arguments)},updateElement:function(e,t,n){return h.apply(this,arguments)},onRemove:function(e,t){var n=t.id,r=t.name,i=t.nodeId;return f.create({deviceId:e.id,description:'Removed child device "'.concat(r,'" (ID: ').concat(n,")."),c8y_CANopenRemoveDevice:{id:n,name:r,nodeId:i}})}};function l(){return e.isFeatureFieldbus4Available()}function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark(function e(i,a){var o,c;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p(i,a);case 2:return o=e.sent,e.t0=u,e.next=6,s.createConfirm(o);case 6:return e.t1=e.sent,c=e.t0.getResData.call(e.t0,e.t1),e.next=10,s.addChildDevice(i,c);case 10:return c.owner=i.owner,e.next=13,s.save(c);case 13:return e.abrupt("return",f.create((t=i,n=a.deviceType,r=c,{deviceId:t.id,description:'Added child device "'.concat(r.name,'" (ID: ').concat(r.id,")."),c8y_CANopenAddDevice:{id:r.id,name:r.name,type:"/inventory/managedObjects/".concat(n.id),nodeId:r.c8y_CANopenDevice.nodeId}})));case 14:case"end":return e.stop()}var t,n,r},e)}))).apply(this,arguments)}function p(e,t){return g.apply(this,arguments)}function g(){return(g=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,n){var r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.current();case 2:return r=e.sent,e.abrupt("return",{name:n.name,type:n.deviceType.name,c8y_CANopenDevice:{type:"/inventory/managedObjects/".concat(n.deviceType.id),nodeId:n.nodeId},c8y_SupportedOperations:["c8y_Command"],owner:r.id});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function e(c,s,u){var l,d,p;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(v.canUpdateElement(c,s)){e.next=2;break}return e.abrupt("return",y.reject());case 2:return void 0,n=(t={device:c,register:s,valueMap:u}).device,r=t.register,i=t.valueMap,a=i.label||i.value,o=!i.label&&r.unit?" ".concat(r.unit):"",l={deviceId:n.id,description:'Change value of "'.concat(r.name,'" to ').concat(a).concat(o,"."),c8y_SetRegister:{nodeId:n.c8y_CANopenDevice.nodeId,index:r.index,subIndex:r.subIndex,dataType:r.dataType,value:i.value}},s.changePending=!0,d=v.getAlertMessagesFns(s,u),e.next=7,v.sendOperationAndGetResult(l,d);case 7:return(p=e.sent).status===f.status.SUCCESSFUL?(_.set(c,["c8y_RegisterStatus",s.name],u.value),s.changePending=!1):p.status===f.status.FAILED&&(s.changePending=!1),e.abrupt("return",p);case 10:case"end":return e.stop()}var t,n,r,i,a,o},e)}))).apply(this,arguments)}function m(e,t){var n=_.findIndex(e,{msgId:t.msgId});-1<n?e[n]=t:e.push(t)}}}angular.module("c8y.canopen").provider(i,e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,l=e.hasOwnProperty,c=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},i=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),a=new N(r||[]);return c(o,"_invoke",{value:function(o,a,c){var s="suspendedStart";return function(e,t){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===e)throw t;return I()}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){var r=E(n,c);if(r){if(r===u)continue;return r}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===s)throw s="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);s="executing";var i=d(o,a,c);if("normal"===i.type){if(s=c.done?"completed":"suspendedYield",i.arg===u)continue;return{value:i.arg,done:c.done}}"throw"===i.type&&(s="completed",c.method="throw",c.arg=i.arg)}}}(e,n,a)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var u={};function p(){}function f(){}function v(){}var y={};o(y,i,function(){return this});var g=Object.getPrototypeOf,h=g&&g(g(R([])));h&&h!==e&&l.call(h,i)&&(y=h);var m=v.prototype=p.prototype=Object.create(y);function b(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function _(s,u){var t;c(this,"_invoke",{value:function(n,r){function e(){return new u(function(e,t){!function t(e,n,r,i){var o=d(s[e],s,n);if("throw"!==o.type){var a=o.arg,c=a.value;return c&&"object"==_typeof(c)&&l.call(c,"__await")?u.resolve(c.__await).then(function(e){t("next",e,r,i)},function(e){t("throw",e,r,i)}):u.resolve(c).then(function(e){a.value=e,r(a)},function(e){return t("throw",e,r,i)})}i(o.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}})}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function R(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(l.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:I}}function I(){return{value:void 0,done:!0}}return c(m,"constructor",{value:f.prototype=v,configurable:!0}),c(v,"constructor",{value:f,configurable:!0}),f.displayName=o(v,r,"GeneratorFunction"),a.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,o(e,r,"GeneratorFunction")),e.prototype=Object.create(m),e},a.awrap=function(e){return{__await:e}},b(_.prototype),o(_.prototype,n,function(){return this}),a.AsyncIterator=_,a.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var o=new _(s(e,t,n,r),i);return a.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},b(m),o(m,r,"Generator"),o(m,i,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),a.keys=function(e){var n=Object(e),r=[];for(var t in n)r.push(t);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=R,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return o.type="throw",o.arg=n,r.next=e,t&&(r.method="next",r.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=l.call(i,"catchLoc"),c=l.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},a}function asyncGeneratorStep(e,t,n,r,i,o,a){try{var c=e[o](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,i)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=c.apply(e,a);function i(e){asyncGeneratorStep(r,t,n,i,o,"next",e)}function o(e){asyncGeneratorStep(r,t,n,i,o,"throw",e)}i(void 0)})}}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var i="c8yCanopenDevice";function e(e,t,n,b){r.$inject=["c8yDeviceDatabase","c8yDeviceControl","c8yModbusDevice","gettextCatalog","c8yInventory","c8yDevices","c8yBase","c8yUser","$q"];var E={label:b("CANopen"),fieldbusType:"canopen",serviceName:i};return e.getDeviceTypeProtocolProvider(E,r);function r(e,f,v,t,n,s,u,i,y){var r=u.createEnum(_.flatten([{name:"BOOLEAN",label:b("Boolean"),value:"boolean",edsValue:1,noBits:1},{name:"SIGNED_8",label:b("Signed (8-bits)"),value:"signed8",edsValue:2,noBits:8,signed:!0},{name:"SIGNED_16",label:b("Signed (16-bits)"),value:"signed16",edsValue:3,noBits:16,signed:!0},{name:"SIGNED_24",label:b("Signed (24-bits)"),value:"signed24",edsValue:16,noBits:24,signed:!0},{name:"SIGNED_32",label:b("Signed (32-bits)"),value:"signed32",edsValue:4,noBits:32,signed:!0},{name:"SIGNED_40",label:b("Signed (40-bits)"),value:"signed40",edsValue:18,noBits:40,signed:!0},{name:"SIGNED_48",label:b("Signed (48-bits)"),value:"signed48",edsValue:19,noBits:48,signed:!0},{name:"SIGNED_56",label:b("Signed (56-bits)"),value:"signed56",edsValue:20,noBits:56,signed:!0},{name:"SIGNED_64",label:b("Signed (64-bits)"),value:"signed64",edsValue:21,noBits:64,signed:!0},{name:"UNSIGNED_8",label:b("Unsigned (8-bits)"),value:"unsigned8",edsValue:5,noBits:8,signed:!1},{name:"UNSIGNED_16",label:b("Unsigned (16-bits)"),value:"unsigned16",edsValue:6,noBits:16,signed:!1},{name:"UNSIGNED_24",label:b("Unsigned (24-bits)"),value:"unsigned24",edsValue:22,noBits:24,signed:!1},{name:"UNSIGNED_32",label:b("Unsigned (32-bits)"),value:"unsigned32",edsValue:7,noBits:32,signed:!1},{name:"UNSIGNED_40",label:b("Unsigned (40-bits)"),value:"unsigned40",edsValue:24,noBits:40,signed:!1},{name:"UNSIGNED_48",label:b("Unsigned (48-bits)"),value:"unsigned48",edsValue:25,noBits:48,signed:!1},{name:"UNSIGNED_56",label:b("Unsigned (56-bits)"),value:"unsigned56",edsValue:26,noBits:56,signed:!1},{name:"UNSIGNED_64",label:b("Unsigned (64-bits)"),value:"unsigned64",edsValue:27,noBits:64,signed:!1},{name:"REAL_32",label:b("Real (32-bits)"),value:"real32",edsValue:8,noBits:32,decimalPlaces:null,baseValuesRange:{min:-3.4*Math.pow(10,38),max:3.4*Math.pow(10,38)}},{name:"REAL_64",label:b("Real (64-bits)"),value:"real64",edsValue:17,noBits:64,decimalPlaces:null,baseValuesRange:{min:-Number.MAX_VALUE,max:Number.MAX_VALUE}}])),o=u.createEnum([{name:"READ_ONLY",label:b("Read-only"),value:"ro"},{name:"WRITE_ONLY",label:b("Write-only"),value:"wo"},{name:"READ_WRITE",label:b("Read-write"),value:"rw"},{name:"READ_WRITE_ON_PROCESS_INPUT",label:b("Read-write on process input"),value:"rwr"},{name:"READ_WRITE_ON_PROCESS_OUTPUT",label:b("Read-write on process output"),value:"rww"},{name:"CONSTANT",label:b("Constant"),value:"const"}]),a=_objectSpread(_objectSpread({},E),{},{type:"c8y_CANopenDeviceType",deviceType:!0,discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:b("Variables"),noRegistersDefinedMessage:b("No variables defined."),elementTypeLabel:b("Variable"),newRegisterModalTitle:b("New variable"),editRegisterModalTitle:b('Edit variable: "{{name}}"'),addRegisterButtonLabel:b("Add variable"),unit:!0,validation:{invalidName:b("Name must be unique among variables."),invalidMeasurement:b("Selected measurement type and series are already used by another variable.")},index:{min:0,max:Math.pow(2,16)-1},subIndex:{min:0,max:Math.pow(2,8)-1},dataType:{choices:r},accessType:{choices:o},functionalities:{showStatus:{showIf:function(e){return _.includes([o.READ_ONLY,o.READ_WRITE,o.READ_WRITE_ON_PROCESS_INPUT,o.READ_WRITE_ON_PROCESS_OUTPUT,o.CONSTANT],_.get(e.meta,"accessType"))}},updateStatus:{showIf:function(e){return _.includes([o.READ_WRITE,o.READ_WRITE_ON_PROCESS_INPUT,o.READ_WRITE_ON_PROCESS_OUTPUT,o.WRITE_ONLY],_.get(e.meta,"accessType"))}},sendMeasurement:{showIf:c},raiseAlarm:{showIf:c,mask:!0},sendEvent:{showIf:c}}},inputRegisters:!1,options:{serverTime:!0},deviceFragments:["c8y_CANopenDevice"],deviceConfiguration:{fragment:"c8y_CANopenConfiguration",icon:"cloud-network"},getRegisterSource:function(e){return{key:"c8y_CANopenSource",value:{index:e.index,subIndex:e.subIndex}}},customizeSmartRestTemplates:function(e){return m(e.responseTemplates,{msgId:201,condition:"$.c8y_SetRegister",pattern:["$.id","$.c8y_SetRegister.nodeId","$.c8y_SetRegister.index","$.c8y_SetRegister.subIndex","$.c8y_SetRegister.dataType","$.c8y_SetRegister.value"]}),m(e.responseTemplates,{msgId:202,condition:"$.c8y_CANopenAddDevice",pattern:["$.id","$.deviceId","$.c8y_CANopenAddDevice.id","$.c8y_CANopenAddDevice.nodeId","$.c8y_CANopenAddDevice.type"]}),m(e.responseTemplates,{msgId:204,condition:"$.c8y_CANopenRemoveDevice",pattern:["$.id","$.deviceId","$.c8y_CANopenDevice.nodeId"]}),e}});function c(e){return _.includes([o.READ_ONLY,o.READ_WRITE,o.READ_WRITE_ON_PROCESS_INPUT,o.READ_WRITE_ON_PROCESS_OUTPUT],_.get(e.meta,"accessType"))}return{registerFeaturesManifest:function(){e.registerFeaturesManifest(l().then(function(e){return e&&a}))},isAvailable:l,create:function(e,t){return d.apply(this,arguments)},updateElement:function(e,t,n){return h.apply(this,arguments)},onRemove:function(e,t){var n=t.id,r=t.name,i=t.nodeId;return f.create({deviceId:e.id,description:'Removed child device "'.concat(r,'" (ID: ').concat(n,")."),c8y_CANopenRemoveDevice:{id:n,name:r,nodeId:i}})}};function l(){return e.isFeatureFieldbus4Available()}function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark(function e(i,o){var a,c;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p(i,o);case 2:return a=e.sent,e.t0=u,e.next=6,s.createConfirm(a);case 6:return e.t1=e.sent,c=e.t0.getResData.call(e.t0,e.t1),e.next=10,s.addChildDevice(i,c);case 10:return c.owner=i.owner,e.next=13,s.save(c);case 13:return e.abrupt("return",f.create((t=i,n=o.deviceType,r=c,{deviceId:t.id,description:'Added child device "'.concat(r.name,'" (ID: ').concat(r.id,")."),c8y_CANopenAddDevice:{id:r.id,name:r.name,type:"/inventory/managedObjects/".concat(n.id),nodeId:r.c8y_CANopenDevice.nodeId}})));case 14:case"end":return e.stop()}var t,n,r},e)}))).apply(this,arguments)}function p(e,t){return g.apply(this,arguments)}function g(){return(g=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,n){var r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.current();case 2:return r=e.sent,e.abrupt("return",{name:n.name,type:n.deviceType.name,c8y_CANopenDevice:{type:"/inventory/managedObjects/".concat(n.deviceType.id),nodeId:n.nodeId},c8y_SupportedOperations:["c8y_Command"],owner:r.id});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function e(c,s,u){var l,d,p;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(v.canUpdateElement(c,s)){e.next=2;break}return e.abrupt("return",y.reject());case 2:return void 0,n=(t={device:c,register:s,valueMap:u}).device,r=t.register,i=t.valueMap,o=i.label||i.value,a=!i.label&&r.unit?" ".concat(r.unit):"",l={deviceId:n.id,description:'Change value of "'.concat(r.name,'" to ').concat(o).concat(a,"."),c8y_SetRegister:{nodeId:n.c8y_CANopenDevice.nodeId,index:r.index,subIndex:r.subIndex,dataType:r.dataType,value:i.value}},s.changePending=!0,d=v.getAlertMessagesFns(s,u),e.next=7,v.sendOperationAndGetResult(l,d);case 7:return(p=e.sent).status===f.status.SUCCESSFUL?(_.set(c,["c8y_RegisterStatus",s.name],u.value),s.changePending=!1):p.status===f.status.FAILED&&(s.changePending=!1),e.abrupt("return",p);case 10:case"end":return e.stop()}var t,n,r,i,o,a},e)}))).apply(this,arguments)}function m(e,t){var n=_.findIndex(e,{msgId:t.msgId});-1<n?e[n]=t:e.push(t)}}}angular.module("c8y.canopen").provider(i,e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?Object(arguments[e]):{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),o.forEach(function(e){_defineProperty(t,e,r[e])})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var o=r.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(t,o,c){return{getDeviceTypeProtocolProvider:function(r,e){return{initUi:function(){(function(){var e={id:r.fieldbusType,name:r.label,service:r.serviceName};t.register(e)})(),function(){t.$inject=["$routeParams"];var e={path:u(r),template:'<c8y-device-type-detail id="vm.id"></c8y-device-type-detail>',controller:t,controllerAs:"vm"};function t(e){_.assign(this,e)}o.when(e.path,e)}()},$get:function(n,i){return["$injector","c8yBase","c8yInventory","c8yDeviceDatabase",function(e,r,t,o){return _objectSpread({flow:_.constant(["c8yDeviceTypeCreateStep"]),list:function(){return o.getAvailableDeviceTypes({fieldbusType:n.fieldbusType})},showIf:function(){return o.isDeviceTypeSupportedAsync({fieldbusType:n.fieldbusType})},detailPath:function(e){var t=r.getId(e);return u(n).replace(/:id$/,t)},getName:function(e){return e.name},listRowInfoComponent:"c8yDeviceTypeRowInfo",getListActions:function(){return[{label:c("Export"),icon:"download",execute:function(e){return o.exportDeviceTypeAndSaveAs(e.data)}}]},remove:t.remove},e.invoke(i))}]}(r,e)}},$get:function(){}};function u(e){return"/deviceprotocols/".concat(e.fieldbusType,"/:id")}}e.$inject=["c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"],angular.module("c8y.deviceProtocolForDeviceDatabase4").provider("c8yDeviceTypeProtocolBase",e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,o)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var o=r.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(t,o,c){return{getDeviceTypeProtocolProvider:function(r,e){return{initUi:function(){(function(){var e={id:r.fieldbusType,name:r.label,service:r.serviceName};t.register(e)})(),function(){t.$inject=["$routeParams"];var e={path:u(r),template:'<c8y-device-type-detail id="vm.id"></c8y-device-type-detail>',controller:t,controllerAs:"vm"};function t(e){_.assign(this,e)}o.when(e.path,e)}()},$get:function(n,i){return["$injector","c8yBase","c8yInventory","c8yDeviceDatabase",function(e,r,t,o){return _objectSpread({flow:_.constant(["c8yDeviceTypeCreateStep"]),list:function(){return o.getAvailableDeviceTypes({fieldbusType:n.fieldbusType})},showIf:function(){return o.isDeviceTypeSupportedAsync({fieldbusType:n.fieldbusType})},detailPath:function(e){var t=r.getId(e);return u(n).replace(/:id$/,t)},getName:function(e){return e.name},listRowInfoComponent:"c8yDeviceTypeRowInfo",getListActions:function(){return[{label:c("Export"),icon:"download",execute:function(e){return o.exportDeviceTypeAndSaveAs(e.data)}}]},remove:t.remove},e.invoke(i))}]}(r,e)}},$get:function(){}};function u(e){return"/deviceprotocols/".concat(e.fieldbusType,"/:id")}}e.$inject=["c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"],angular.module("c8y.deviceProtocolForDeviceDatabase4").provider("c8yDeviceTypeProtocolBase",e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw i}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?Object(arguments[e]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.forEach(function(e){_defineProperty(t,e,r[e])})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yLoraDevice";function e(e,u){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var l={label:u("LoRa"),fieldbusType:"lora",serviceName:r};return e.getDeviceTypeProtocolProvider(l,t);function t(e,t,r){var n={name:"loriot-agent"},i=[t.MessageIdSources.FPORT,t.MessageIdSources.PAYLOAD],o=_objectSpread({},l,{type:"c8y_LoraDeviceType",configuration:{messageIdConfiguration:i},discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:u("Values"),noRegistersDefinedMessage:u("No values defined."),newRegisterModalTitle:u("New value"),editRegisterModalTitle:u('Edit value: "{{name}}"'),addRegisterButtonLabel:u("Add value"),validation:{invalidName:u("Name must be unique among values."),invalidMeasurement:u("Selected measurement type and series are already used by another value in the same message type.")},messageTypeId:{label:u("Message type ID")},startBit:!0,noBits:!0,multiplier:!0,offset:!0,decimalPlaces:!1,options:{signed:!0,bcd:!0,littleEndian:!0},functionalities:{showStatus:!1,updateStatus:!1,sendMeasurement:!0,raiseAlarm:{alarmStatus:!0},sendEvent:{fragmentType:!0,innerType:!0},sendManagedObjectUpdate:!0},unit:{requiredForSendMeasurement:!0}},inputRegisters:!1,options:!1});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(a().then(function(e){return e&&o}))},isSubscribed:a};function a(){return e.all([r.isSubscribed({name:"actility"}),r.isSubscribed(n)]).then(function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];return r||n})}}}angular.module("c8y.lora").provider(r,e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var r="c8yLoraDevice";function e(e,u){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var s={label:u("LoRa"),fieldbusType:"lora",serviceName:r};return e.getDeviceTypeProtocolProvider(s,t);function t(e,t,r){var n={name:"loriot-agent"},o=[t.MessageIdSources.FPORT,t.MessageIdSources.PAYLOAD],i=_objectSpread(_objectSpread({},s),{},{type:"c8y_LoraDeviceType",configuration:{messageIdConfiguration:o},discreteOutputs:!1,discreteInputs:!1,holdingRegisters:{sectionTitle:u("Values"),noRegistersDefinedMessage:u("No values defined."),newRegisterModalTitle:u("New value"),editRegisterModalTitle:u('Edit value: "{{name}}"'),addRegisterButtonLabel:u("Add value"),validation:{invalidName:u("Name must be unique among values."),invalidMeasurement:u("Selected measurement type and series are already used by another value in the same message type.")},messageTypeId:{label:u("Message type ID")},startBit:!0,noBits:!0,multiplier:!0,offset:!0,decimalPlaces:!1,options:{signed:!0,bcd:!0,littleEndian:!0},functionalities:{showStatus:!1,updateStatus:!1,sendMeasurement:!0,raiseAlarm:{alarmStatus:!0},sendEvent:{fragmentType:!0,innerType:!0},sendManagedObjectUpdate:!0},unit:{requiredForSendMeasurement:!0}},inputRegisters:!1,options:!1});return{registerFeaturesManifest:function(){t.registerFeaturesManifest(a().then(function(e){return e&&i}))},isSubscribed:a};function a(){return e.all([r.isSubscribed({name:"actility"}),r.isSubscribed(n)]).then(function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];return r||n})}}}angular.module("c8y.lora").provider(r,e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=i.call(t)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?Object(arguments[e]):{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.forEach(function(e){_defineProperty(r,e,t[e])})}return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(e){var r=_toPrimitive(e,"string");return"symbol"===_typeof(r)?r:String(r)}function _toPrimitive(e,r){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===r?String:Number)(e);var n=t.call(e,r||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var n="c8yLpwanDevice";function e(e,r){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var c={label:r("LPWAN"),fieldbusType:"lpwan",serviceName:n};return e.getDeviceTypeProtocolProvider(c,t);function t(e,r,t){var n={name:"loriot-agent"},o={name:"sigfox-agent"},i={name:"actility"},a=_objectSpread({},c,{type:"c8y_LpwanDeviceType",noNewProtocolInstances:!0});return{registerFeaturesManifest:function(){r.registerFeaturesManifest(u().then(function(e){return e&&a}))},isSubscribed:u};function u(){return e.all([t.isSubscribed(i),t.isSubscribed(n),t.isSubscribed(o)]).then(function(e){var r=_slicedToArray(e,3),t=r[0],n=r[1],o=r[2];return t||n||o})}}}angular.module("c8y.lpwan").provider(n,e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i,a,c=[],u=!0,y=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(e){y=!0,o=e}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(y)throw o}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function ownKeys(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)}return t}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(e){_defineProperty(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(e){var r=_toPrimitive(e,"string");return"symbol"===_typeof(r)?r:String(r)}function _toPrimitive(e,r){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===r?String:Number)(e);var n=t.call(e,r||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["c8yDeviceTypeProtocolBaseProvider","gettext"];var n="c8yLpwanDevice";function e(e,r){t.$inject=["$q","c8yDeviceDatabase","c8yTenant"];var u={label:r("LPWAN"),fieldbusType:"lpwan",serviceName:n};return e.getDeviceTypeProtocolProvider(u,t);function t(e,r,t){var n={name:"loriot-agent"},o={name:"sigfox-agent"},i={name:"actility"},a=_objectSpread(_objectSpread({},u),{},{type:"c8y_LpwanDeviceType",noNewProtocolInstances:!0});return{registerFeaturesManifest:function(){r.registerFeaturesManifest(c().then(function(e){return e&&a}))},isSubscribed:c};function c(){return e.all([t.isSubscribed(i),t.isSubscribed(n),t.isSubscribed(o)]).then(function(e){var r=_slicedToArray(e,3),t=r[0],n=r[1],o=r[2];return t||n||o})}}}angular.module("c8y.lpwan").provider(n,e)}();