// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("require ../chunks/tslib.es6 ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ../chunks/componentsUtils ./support/globalCss ./support/widgetUtils ./support/decorators/messageBundle ./support/decorators/vmEvent ./support/jsxFactory ./ValuePicker/ValuePickerCollection ./ValuePicker/ValuePickerCombobox ./ValuePicker/ValuePickerLabel ./ValuePicker/ValuePickerSlider ./ValuePicker/ValuePickerViewModel ./ValuePicker/ValuePickerVisibleElements".split(" "), function(p,c,n,d,q,M,N,u,b,v,w,O,r,x,e,y,z,A,B,C,t){q={base:null,key:"type",typeMap:{collection:y,combobox:z,label:A,slider:B}};b=class extends b{constructor(a,g){super(a,g);this.messagesCommon=this.messages=this.caption=null;this.viewModel=new C;this.visibleElements=new t}initialize(){this.addHandles([n.on(()=>this.viewModel,"animate",({first:a})=>{this.component?.animate(a)}),n.on(()=>this.viewModel,"next",()=>{this.component?.next()}),n.on(()=>this.viewModel,"previous",()=>{this.component?.previous()})])}loadDependencies(){return v.loadCalciteComponents({action:()=> new Promise((a,g)=>p(["../chunks/calcite-action"],a,g)),"action-bar":()=>new Promise((a,g)=>p(["../chunks/calcite-action-bar"],a,g))})}get canNext(){return this.component?.canNext??!0}get canPlay(){return this.component?.canPlay??!0}get canPrevious(){return this.component?.canPrevious??!0}set component(a){a&&(a.viewModel??(a.viewModel=this.viewModel));this._set("component",a)}get disabled(){return this.viewModel.disabled}set disabled(a){this.viewModel.disabled=a}get icon(){return"list-rectangle"}set icon(a){this._overrideIfSome("icon", a)}get label(){return this.messages?.widgetLabel??""}set label(a){this._overrideIfSome("label",a)}get layout(){return this.viewModel.layout}set layout(a){this.viewModel.layout=a}get loop(){return this.viewModel.loop}set loop(a){this.viewModel.loop=a}get playRate(){return this.viewModel.playRate}set playRate(a){this.viewModel.playRate=a}get values(){return this.viewModel.values}set values(a){this.viewModel.values=a}next(){this.viewModel.next()}pause(){this.viewModel.pause()}play(){this.viewModel.play()}previous(){this.viewModel.previous()}render(){const {disabled:a, state:g}=this.viewModel;var f="playing"===g,h="horizontal"===this.layout;const {control:D,pagination:E}=this.messagesCommon,{pause:F,play:G}=D,{previous:H,up:I,next:J,down:K}=E;var l=f?F:G;l=this.visibleElements.playButton&&e.tsx("calcite-action",{active:f,alignment:"center",bind:this,disabled:a||!this.canPlay,icon:f?"pause":"play",key:"play",onclick:f?this.pause:this.play,text:l,title:l});var m=h?H:I;m=this.visibleElements.previousButton&&e.tsx("calcite-action",{alignment:"center",bind:this,disabled:a|| f||!this.canPrevious,icon:h?"chevron-left":"chevron-up",key:"previous",onclick:this.previous,text:m,title:m});var k=h?J:K;f=this.visibleElements.nextButton&&e.tsx("calcite-action",{alignment:"center",bind:this,disabled:a||f||!this.canNext,icon:h?"chevron-right":"chevron-down",key:"next",onclick:this.next,text:k,title:k});h=this.caption&&e.tsx("div",{class:"esri-value-picker__caption"},e.tsx("div",{class:"esri-value-picker__caption-border"},e.tsx("div",{class:"esri-value-picker__caption-text"},this.caption))); k="combobox"===this.component?.type||"label"===this.component?.type||"slider"===this.component?.type;k=(l||m||f)&&(h||k)&&e.tsx("div",{class:"esri-value-picker__separator"});const L=this.component?.render();return e.tsx("div",{"aria-label":this.label,class:this.classes("esri-value-picker",w.globalCss.widget,`${"esri-value-picker"}__layout--${this.layout}`,`${"esri-value-picker"}__type--${this.component?.type}`)},e.tsx("calcite-action-bar",{class:"esri-value-picker__action-bar",expandDisabled:!0,layout:this.layout}, [l,m,f,k,h,L]))}};c.__decorate([d.property()],b.prototype,"canNext",null);c.__decorate([d.property()],b.prototype,"canPlay",null);c.__decorate([d.property()],b.prototype,"canPrevious",null);c.__decorate([d.property()],b.prototype,"caption",void 0);c.__decorate([d.property({types:q,value:null})],b.prototype,"component",null);c.__decorate([d.property()],b.prototype,"disabled",null);c.__decorate([d.property()],b.prototype,"icon",null);c.__decorate([d.property()],b.prototype,"label",null);c.__decorate([d.property()], b.prototype,"layout",null);c.__decorate([d.property()],b.prototype,"loop",null);c.__decorate([d.property(),r.messageBundle("esri/widgets/ValuePicker/t9n/ValuePicker")],b.prototype,"messages",void 0);c.__decorate([d.property(),r.messageBundle("esri/t9n/common")],b.prototype,"messagesCommon",void 0);c.__decorate([d.property()],b.prototype,"playRate",null);c.__decorate([d.property()],b.prototype,"values",null);c.__decorate([d.property(),x.vmEvent(["animate","next","pause","play","previous"])],b.prototype, "viewModel",void 0);c.__decorate([d.property({type:t,nonNullable:!0})],b.prototype,"visibleElements",void 0);return b=c.__decorate([u.subclass("esri.widgets.ValuePicker")],b)});