import{h}from"../webmapgl.core.js";import{a as _t}from"./chunk-cf921ba9.js";import{a as createColorClasses}from"./chunk-c82b670d.js";var AttributeValues=function(){function t(){this.options=[],this.header=_t("webmapgl.attribute-values.header"),this.limit=1,this.valueMaxWidth="200px"}return t.prototype.componentWillLoad=function(){this.parseAttributeOptions()},t.prototype.parseAttributeOptions=function(){this.options="string"==typeof this.attributeOptions?JSON.parse(this.attributeOptions):this.attributeOptions},t.prototype.getItemsForFeature=function(t,e){var r=this;return e.filter(function(e){return e.name!=r.headerAttribute&&void 0!==t.properties[e.name]}).map(function(e){return h("ion-item",null,h("ion-label",{position:r.labelPosition},e.alias||e.name),h("ion-note",{slot:"stacked"!=r.labelPosition?"end":null,"text-wrap":!0,style:{"max-width":r.valueMaxWidth}},t.properties[e.name]))})},t.prototype.generateOptions=function(t){var e=[];for(var r in t.properties)e.push({name:r});return e},t.prototype.render=function(){if(!this.features||!this.features.length)return null;for(var t=[],e=0,r=this.features.slice(0,this.limit);e<r.length;e++){var i=r[e];t.push(h("ion-item-divider",null,h("ion-label",null,this.headerAttribute?i.properties[this.headerAttribute]:this.header)));var n=this.options||this.generateOptions(i);Array.prototype.push.apply(t,this.getItemsForFeature(i,n))}return h("ion-list",null,t)},Object.defineProperty(t,"is",{get:function(){return"gl-attribute-values"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{attributeOptions:{type:String,attr:"attribute-options",watchCallbacks:["parseAttributeOptions"]},el:{elementRef:!0},features:{type:"Any",attr:"features"},header:{type:String,attr:"header"},headerAttribute:{type:String,attr:"header-attribute"},labelPosition:{type:String,attr:"label-position"},limit:{type:Number,attr:"limit"},valueMaxWidth:{type:String,attr:"value-max-width"}}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"gl-attribute-values ion-note{font-size:14px;line-height:14px;padding-top:16px;text-align:right}"},enumerable:!0,configurable:!0}),t}(),Note=function(){function t(){}return t.prototype.hostData=function(){var t;return{class:Object.assign({},createColorClasses(this.color),(t={},t[""+this.mode]=!0,t))}},t.prototype.render=function(){return h("slot",null)},Object.defineProperty(t,"is",{get:function(){return"ion-note"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{color:{type:String,attr:"color"},mode:{type:String,attr:"mode"}}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{color:var(--color);font-family:var(--ion-font-family,inherit);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-350,#a6a6a6)}"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"styleMode",{get:function(){return"ios"},enumerable:!0,configurable:!0}),t}();export{AttributeValues as GlAttributeValues,Note as IonNote};