(()=>{function e(e,a,t){var l=e.createEnum([{name:"REQUIRED",value:"required",label:t("Required")},{name:"MINIMUM",value:"minimum",label:t("Minimum")},{name:"MAXIMUM",value:"maximum",label:t("Maximum")},{name:"MIN_LENGTH",value:"minLength",label:t("Minimum length")},{name:"MAX_LENGTH",value:"maxLength",label:t("Maximum length")},{name:"PATTERN",value:"pattern",label:t("Regular expression")},{name:"DEFAULT",value:"default",label:t("Default value")}]),n=e.createEnum([{name:"STRING",value:"string",label:t("String"),validations:[l.REQUIRED,l.DEFAULT,l.MIN_LENGTH,l.MAX_LENGTH,l.PATTERN],filteringKey:"filteringByPattern"},{name:"NUMBER",value:"number",label:t("Number"),validations:[l.REQUIRED,l.MINIMUM,l.MAXIMUM],filteringKey:"filteringByMinMax"},{name:"INTEGER",value:"integer",label:t("Integer"),validations:[l.REQUIRED,l.MINIMUM,l.MAXIMUM],filteringKey:"filteringByMinMax"},{name:"BOOLEAN",value:"boolean",label:t("Boolean"),validations:[],filteringKey:"filteringByBoolean"},{name:"DATETIME",value:"datetime",label:t("Date/time"),validations:[l.REQUIRED],filteringKey:"filteringByMinMaxDate"}]);return{Types:n,Validations:l,openSelector:function(e){return _.defaults(e,{includeTree:!1,type:"ManagedObjects",showComputed:!0,showRootPropertiesOnly:!1}),a({templateUrl:":::PLUGIN_PATH:::/ui/properties/schemaPropertySelector.html",controller:"schemaPropertySelectorCtrl",resolve:{modalParams:function(){return e}}})},getType:function(e){var e=e.schema;e="string"===e.type&&"datetime"===e.format?n.DATETIME:_.find(n.values(),{value:e.type});return e},setType:function(e,a){e=e.schema;a===n.DATETIME?(e.type="string",e.format="datetime"):(e.type=a.value,e.format=void 0)}}}e.$inject=["c8yBase","c8yModal","gettext"],angular.module("c8y.ui").service("SchemaPropertiesSvc",e)})();