(()=>{function e(n,t,a){var i={name:"Basic",fields:["name","type","id"]},c=[],e=["assetParents","deviceParents","childAssets","childDevices","c8y_IsDevice","__children","c8y_ui","self","parent","c8y_DataPoint",/^c8y_Dashboard!\d+/];function o(e){e=e.data,c.length=0,c.push([i]),function i(c,o){_.forEach(c,function(e,n){var t;return!(!r(n)&&_.isObjectLike(e)&&!_.isEmpty(c[n])&&(t=a.humanizeFragment(n),e.parent={key:n,val:c.parent?c:void 0},o.push([{name:t,keyPath:s(c,n)}]),i(e,o[o.length-1]),1))})}(e,c),(n.config.options||[]).forEach(function(e){!function n(e,t){_.map(e,function(e){_.isArray(e)?n(e,t):e.keyPath===t.keyPath&&_.assign(e,t)})}(n.options,e)})}function r(n){return!!_.find(e,function(e){return e instanceof RegExp?e.test(n):e===n})}function s(e,n){return e&&e.parent?(n="".concat(e.parent.key,".").concat(n),s(e.parent.val,n)):n}n.options=c,n.updateFields=function(){var e=_.flattenDeep(n.options);n.config.options=_.filter(e,function(e){return e.selected}),n.forms.componentForm.fieldsControl.$setValidity("fields_selected",n.config.options.length)},n.$watch("config.device",function(e){e&&t.detail(e.id).then(o)})}e.$inject=["$scope","c8yDevices","c8yBase"],angular.module("c8y.parts.devicePropertyWidget").controller("devicePropertyWidgetConfigCtrl",e)})();