web-interface.assets.07ba022f-8940.5ca1eb6661869012f879.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["07ba022f-8940"],{"6bzBY7Xo":(Q,A,m)=>{m.d(A,{Go:()=>r,Oi:()=>u,uA:()=>D,zB:()=>v});var z=m("ii0bleBb"),d=m.n(z);const e=d().exact({max_index_retention_period:d().string}),c=d().exact({type:d().string,max_size:d().number}),C=d().exact({type:d().string,max_docs_per_index:d().number}),T=d().exact({type:d().string,rotation_period:d().string,max_rotation_period:d().string,rotate_empty_index_set:d().bool}),b=d().exact({type:d().string,index_lifetime_max:d().string,index_lifetime_min:d().string}),D=d().oneOfType([c,C,T,b]),_=d().string,v=d().shape({type:d().string.isRequired,max_number_of_indices:d().number,index_action:d().string}),h=d().exact({type:d().string.isRequired}),y=d().exact({type:d().string.isRequired,enum:d().arrayOf(d().string).isRequired}),p=d().exact({rotation_period:h,max_rotation_period:h,type:h.isRequired,max_size:h,max_docs_per_index:h,rotate_empty_index_set:h,index_lifetime_max:h,index_lifetime_min:h}),i=d().exact({type:d().string.isRequired,id:d().string,properties:p.isRequired}),t=d().exact({max_number_of_indices:h.isRequired,type:h.isRequired,index_action:y}),a=d().exact({type:d().string.isRequired,id:d().string,properties:t}),u=d().exact({type:d().string.isRequired,default_config:D.isRequired,json_schema:i.isRequired}),r=d().exact({type:d().string.isRequired,default_config:v.isRequired,json_schema:a.isRequired})},"6Wzh2oiG":(Q,A,m)=>{m.d(A,{fd:()=>v,Zp:()=>F,gb:()=>le,r_:()=>it,RE:()=>Pe,qS:()=>Ie,EA:()=>ft,vJ:()=>Be,t1:()=>ue,eJ:()=>Ue,bP:()=>Ct,YD:()=>_t,bG:()=>pe,lG:()=>We,_L:()=>He});var z=m("ii0bleBb"),d=m.n(z),e=m("Z7aTuO5B"),c=m("uZqmR+ju"),C=m("aHNeFNVd"),T=Object.defineProperty,b=(s,n,o)=>n in s?T(s,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[n]=o,D=(s,n,o)=>(b(s,typeof n!="symbol"?n+"":n,o),o);class _ extends e.Component{constructor(){super(...arguments),D(this,"_onReopen",()=>{C.$F.reopen(this.props.indexName)}),D(this,"_onDeleteIndex",()=>{window.confirm(`Really delete index ${this.props.indexName}?`)&&C.$F.delete(this.props.indexName)})}render(){const{indexRange:n}=this.props;return e.createElement("div",{className:"index-info"},e.createElement(le,{indexRange:n}),e.createElement(c.Alert,{bsStyle:"info"},"This index is closed. Index information is not available"," ","at the moment, please reopen the index and try again."),e.createElement("hr",{style:{marginBottom:"5",marginTop:"10"}}),e.createElement(c.Button,{bsStyle:"warning",bsSize:"xs",onClick:this._onReopen},"Reopen index")," ",e.createElement(c.Button,{bsStyle:"danger",bsSize:"xs",onClick:this._onDeleteIndex},"Delete index"))}}D(_,"propTypes",{indexName:d().string.isRequired,indexRange:d().object});const v=_;var h=m("8wYeYPUw"),y=m("zkmy/ViL"),p=m("/GOzvPf6"),i=m("JnTtTRmZ"),t=m.n(i),a=m("jAGDuYSC"),u=m("MdYBRjRJ"),r=m("U1Iufsob"),l=m("eFxcQyPT"),f=m("IA3Ku5lS");const E=(0,f.ei)("core.IndexRanges",()=>t().createActions({list:{asyncResult:!0},recalculate:{asyncResult:!0},recalculateIndex:{asyncResult:!0}})),S=(0,f.dS)("core.IndexRanges",()=>t().createStore({listenables:[E],indexRanges:void 0,getInitialState(){return{indexRanges:this.indexRanges}},init(){E.list()},list(){const s=u.DC(r.Z.IndexRangesApiController.list().url),n=(0,l.ZP)("GET",s).then(o=>{this.indexRanges=o.ranges,this.trigger(this.getInitialState())});E.list.promise(n)},recalculate(s){const n=u.DC(r.Z.IndexRangesApiController.rebuild(s).url),o=(0,l.ZP)("POST",n);o.then(a.Z.success("Index ranges will be recalculated shortly")).catch(x=>{a.Z.error(`Could not create a job to start index ranges recalculation, reason: ${x}`,"Error starting index ranges recalculation")}),E.recalculate.promise(o)},recalculateIndex(s){const n=u.DC(r.Z.IndexRangesApiController.rebuildSingle(s).url),o=(0,l.ZP)("POST",n);o.then(a.Z.success(`Index ranges for ${s} will be recalculated shortly`)).catch(x=>{a.Z.error(`Could not create a job to start index ranges recalculation for ${s}, reason: ${x}`,`Error starting index ranges recalculation for ${s}`)}),E.recalculateIndex.promise(o)}})),R=({index:s,indexName:n,indexRange:o,indexSetId:x,isDeflector:P})=>{(0,e.useEffect)(()=>(C.$F.subscribe(n),()=>{C.$F.unsubscribe(n)}),[n]);const L=(0,e.useCallback)(()=>{window.confirm(`Really recalculate the index ranges for index ${n}?`)&&E.recalculateIndex(n).then(()=>{C.$F.list(x)})},[n,x]),V=(0,e.useCallback)(()=>{window.confirm(`Really close index ${n}?`)&&C.$F.close(n).then(()=>{C.$F.list(x)})},[n,x]),K=(0,e.useCallback)(()=>{window.confirm(`Really delete index ${n}?`)&&C.$F.delete(n).then(()=>{C.$F.list(x)})},[n,x]),$=(0,e.useMemo)(()=>P?e.createElement("span",null,e.createElement(c.Button,{bsStyle:"warning",bsSize:"xs",disabled:!0},"Active write index cannot be closed")," ",e.createElement(c.Button,{bsStyle:"danger",bsSize:"xs",disabled:!0},"Active write index cannot be deleted")):e.createElement("span",null,e.createElement(c.Button,{bsStyle:"warning",bsSize:"xs",onClick:L},"Recalculate index ranges")," ",e.createElement(c.Button,{bsStyle:"warning",bsSize:"xs",onClick:V},"Close index")," ",e.createElement(c.Button,{bsStyle:"danger",bsSize:"xs",onClick:K},"Delete index")),[P,V,K,L]);return!s||!s.all_shards?e.createElement(p.$j,null):e.createElement("div",{className:"index-info"},e.createElement(le,{indexRange:o})," ",e.createElement(h.Z,null,y.Z.formatNumber(s.all_shards.segments)," segments,"," ",y.Z.formatNumber(s.all_shards.open_search_contexts)," open search contexts,"," ",y.Z.formatNumber(s.all_shards.documents.deleted)," deleted messages",e.createElement(c.Row,{style:{marginBottom:"10"}},e.createElement(c.Col,{md:4,className:"shard-meters"},e.createElement(pe,{title:"Primary shard operations",shardMeter:s.primary_shards})),e.createElement(c.Col,{md:4,className:"shard-meters"},e.createElement(pe,{title:"Total shard operations",shardMeter:s.all_shards}))),e.createElement(He,{routing:s.routing,indexName:n})),e.createElement("hr",{style:{marginBottom:"5",marginTop:"10"}}),$)};R.propTypes={index:d().object.isRequired,indexName:d().string.isRequired,indexRange:d().object.isRequired,indexSetId:d().string.isRequired,isDeflector:d().bool.isRequired};const F=R;var Y=m("4IfE3Ihm"),X=Object.defineProperty,I=(s,n,o)=>n in s?X(s,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[n]=o,N=(s,n,o)=>(I(s,typeof n!="symbol"?n+"":n,o),o);class ve extends e.Component{render(){const{indexRange:n}=this.props;return n?e.createElement("span",null,"Range re-calculated"," ",e.createElement(Y.Z,{dateTime:n.calculated_at})," ","in ",n.took_ms,"ms."):e.createElement("span",null,e.createElement("i",null,"No index range available."))}}N(ve,"propTypes",{indexRange:d().object});const le=ve;var ke=m("9oVghaOd"),ee=m.n(ke),ce=m("UiXZqrDE"),w=m("J6y4/h8P"),te=m("QL8i6bcz"),Re=m("hVkUd7xY"),jt=m("g0VYa/Z8"),Wt=m("aozvvWC3"),qe=m("N6x7vnl1"),U=m("PhRf2fIG"),Qe=m("zJwTQ5+g");const et=(0,w.default)(p.Ow)`
margin-left: 0;
`,tt=s=>{let n;return(s==null?void 0:s.length)===0?n="Invalid index prefix: cannot be empty":(s==null?void 0:s.indexOf("_"))===0||(s==null?void 0:s.indexOf("-"))===0||(s==null?void 0:s.indexOf("+"))===0?n="Invalid index prefix: must start with a letter or number":(s==null?void 0:s.toLocaleLowerCase())!==s?n="Invalid index prefix: must be lower case":s!=null&&s.match(/^[a-z0-9][a-z0-9_\-+]*$/)||(n="Invalid index prefix: must only contain letters, numbers, '_', '-' and '+'"),n},nt=(s,n)=>({rotation_strategy_class:s,rotation_strategy:n}),st=(s,n)=>({retention_strategy_class:s,retention_strategy:n});class de extends e.Component{constructor(n){super(n),this._saveConfiguration=x=>{const{onUpdate:P}=this.props;return P(x)};const{indexSet:o}=this.props;this.state={indexSet:o,fieldTypeRefreshIntervalUnit:"seconds"}}render(){const{indexSet:n,fieldTypeRefreshIntervalUnit:o}=this.state,{rotationStrategies:x,retentionStrategies:P,create:L,cancelLink:V,history:K,indexSet:{rotation_strategy:$,rotation_strategy_class:ne,retention_strategy:se,retention_strategy_class:M},retentionStrategiesContext:me,submitButtonText:H,submitLoadingText:q}=this.props;let G;if(x){const B={config:$,strategy:ne};G=e.createElement(Re.Z,{title:"Index Rotation Configuration",name:"rotation",description:"Graylog uses multiple indices to store documents in. You can configure the strategy it uses to determine when to rotate the currently active write index.",selectPlaceholder:"Select rotation strategy",pluginExports:te.G.exports("indexRotationConfig"),strategies:x,activeConfig:B,getState:nt})}else G=e.createElement(p.$j,null);let j;if(P){const B={config:se,strategy:M};j=e.createElement(Re.Z,{title:"Index Retention Configuration",name:"retention",description:"Graylog uses a retention strategy to clean up old indices.",selectPlaceholder:"Select retention strategy",pluginExports:te.G.exports("indexRetentionConfig"),strategies:P,retentionStrategiesContext:me,activeConfig:B,getState:st})}else j=e.createElement(p.$j,null);let ie;if(L){const B=e.createElement("span",null,"A ",e.createElement("strong",null,"unique")," prefix used in Elasticsearch indices belonging to this index set. The prefix must start with a letter or number, and can only contain letters, numbers, '_', '-' and '+'.");ie=e.createElement("span",null,e.createElement(p.Fe,{type:"text",label:"Index prefix",name:"index_prefix",help:B,validate:tt,required:!0}),e.createElement(p.Fe,{type:"text",label:"Analyzer",name:"index_analyzer",help:"Elasticsearch analyzer for this index set.",required:!0}))}const he=()=>K.push(V);return e.createElement(c.Row,null,e.createElement(c.Col,{md:8},e.createElement(ce.Formik,{onSubmit:this._saveConfiguration,initialValues:n},({isValid:B,setFieldValue:fe,isSubmitting:ge})=>e.createElement(Qe.Z,null,e.createElement(ce.Form,null,e.createElement(c.Row,null,e.createElement(c.Col,{md:12},e.createElement(p.Fe,{type:"text",label:"Title",name:"title",help:"Descriptive name of the index set.",required:!0}),e.createElement(p.Fe,{type:"text",label:"Description",name:"description",help:"Add a description of this index set.",required:!0}),ie,e.createElement(h.Z,null,e.createElement(p.Fe,{type:"number",label:"Index shards",name:"shards",help:"Number of Elasticsearch shards used per index in this index set.",required:!0}),e.createElement(p.Fe,{type:"number",label:"Index replicas",name:"replicas",help:"Number of Elasticsearch replicas used per index in this index set.",required:!0}),e.createElement(p.Fe,{type:"number",label:"Max. number of segments",name:"index_optimization_max_num_segments",minLength:1,help:"Maximum number of segments per Elasticsearch index after optimization (force merge).",required:!0}),e.createElement(c.Input,{id:"roles-selector-input",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Index optimization after rotation"},e.createElement(p.jc,{type:"checkbox",id:"index_optimization_disabled",label:"Disable index optimization after rotation",name:"index_optimization_disabled",help:"Disable Elasticsearch index optimization (force merge) after rotation."}))),e.createElement(ce.Field,{name:"field_type_refresh_interval"},({field:{name:re,value:ae,onChange:xe}})=>{const Ee=(oe,J)=>{xe(re,ee().duration(oe,J).asMilliseconds()),fe(re,ee().duration(oe,J).asMilliseconds()),this.setState({fieldTypeRefreshIntervalUnit:J})};return e.createElement(c.Input,{id:"roles-selector-input",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Field type refresh interval"},e.createElement(p.AX,{id:"field-type-refresh-interval",type:"number",help:"How often the field type information for the active write index will be updated.",value:ee().duration(ae,"milliseconds").as(o),unit:o.toUpperCase(),units:["SECONDS","MINUTES"],required:!0,update:Ee}))}))),n.writable&&G,n.writable&&j,e.createElement(c.Row,null,e.createElement(c.Col,{md:9,mdOffset:3},e.createElement(et,{disabledSubmit:!B,submitButtonText:H,submitLoadingText:q,isSubmitting:ge,isAsyncSubmit:!0,displayCancel:!0,onCancel:he}))))))))}}de.propTypes={indexSet:U.wv.isRequired,rotationStrategies:d().array.isRequired,retentionStrategies:d().array.isRequired,retentionStrategiesContext:d().shape({max_index_retention_period:d().string}).isRequired,create:d().bool,onUpdate:d().func.isRequired,cancelLink:d().string.isRequired,submitButtonText:d().string.isRequired,submitLoadingText:d().string.isRequired},de.defaultProps={create:!1};const it=(0,qe.Z)(de);var Ce=m("4E3oowBb"),rt=m("gTexEe+8"),at=m("pUKP3+Pg"),ot=Object.defineProperty,lt=(s,n,o)=>n in s?ot(s,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[n]=o,Z=(s,n,o)=>(lt(s,typeof n!="symbol"?n+"":n,o),o);class De extends e.Component{constructor(n){super(n),Z(this,"_onModalOpen",()=>{at.sH.load(o=>{const x=[];o.forEach(P=>{P.index_set_id===this.props.indexSet.id&&x.push({id:P.id,title:P.title})}),this.setState({assignedStreams:x})})}),Z(this,"open",()=>{this.setState({showModal:!0},this._onModalOpen)}),Z(this,"close",()=>{this.setState({showModal:!1})}),Z(this,"_onRemoveClick",o=>{this.setState({deleteIndices:o.target.checked})}),Z(this,"_isLoading",()=>!this.state.assignedStreams),Z(this,"_isDeletable",()=>!this._isLoading()&&this.state.assignedStreams.length<1&&!this.props.indexSet.default),Z(this,"_modalContent",()=>{if(this._isLoading())return e.createElement(p.$j,{text:"Loading assigned streams..."});if(this.props.indexSet.default)return e.createElement(c.Row,null,e.createElement(c.Col,{md:12},e.createElement(c.Alert,{bsStyle:"danger"},"Unable to delete the index set because it is the default index set!")));if(!this._isDeletable()){const o=this.state.assignedStreams.sort((x,P)=>(0,Ce.S)(x.title,P.title)).map(x=>e.createElement("li",{key:`stream-id-${x.id}`},x.title));return e.createElement("div",null,e.createElement(c.Row,null,e.createElement(c.Col,{md:12},e.createElement(c.Alert,{bsStyle:"danger"},"Unable to delete the index set because it has assigned streams. Remove stream assignments to be able to delete this index set."))),e.createElement(c.Row,null,e.createElement(c.Col,{md:12},e.createElement("h4",null,"Assigned streams:"),e.createElement("ul",null,o))))}return e.createElement(c.Row,null,e.createElement(c.Col,{md:12},e.createElement(c.Input,{id:"remove-data-checkbox",type:"checkbox",label:"Remove all data for this index set?",help:e.createElement("span",null,"All indices related to this index set will be deleted from Elasticsearch."),checked:this.state.deleteIndices,onChange:this._onRemoveClick})))}),Z(this,"_onDelete",o=>{o.preventDefault(),this._isDeletable()&&this.props.onDelete(this.props.indexSet,this.state.deleteIndices)}),this.state={showModal:!1,assignedStreams:void 0,deleteIndices:!0}}render(){return e.createElement(rt.Z,{show:this.state.showModal,title:`Delete index set "${this.props.indexSet.title}"?`,"data-telemetry-title":"Delete index set",onCancel:this.close,onSubmitForm:this._onDelete,submitButtonText:"Delete",submitButtonDisabled:!this._isDeletable()},this._modalContent())}}Z(De,"propTypes",{indexSet:d().object.isRequired,onDelete:d().func.isRequired});const Pe=De,ct=(0,w.default)(c.Row)`
dl {
margin-bottom: 0;
dt {
float: left;
width: 190px;
overflow: hidden;
clear: left;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
}
dd {
margin-left: 180px;
}
}
`,_e=({indexSet:s})=>e.createElement(ct,null,e.createElement(c.Col,{lg:3},e.createElement("dl",null,e.createElement("dt",null,"Index prefix:"),e.createElement("dd",null,s.index_prefix),e.createElement(h.Z,null,e.createElement("dt",null,"Shards:"),e.createElement("dd",null,s.shards),e.createElement("dt",null,"Replicas:"),e.createElement("dd",null,s.replicas)),e.createElement("dt",null,"Field type refresh interval:"),e.createElement("dd",null,s.field_type_refresh_interval/1e3," seconds"))),e.createElement(c.Col,{lg:6},e.createElement(Ue,{indexSet:s})));_e.propTypes={indexSet:d().object.isRequired};const Ie=_e;var dt=m("CrIFpfDF"),Te=m("ty2gyrHp"),Me=m("d4kzUuQm"),we=m("TJOheZRu"),ut=m("8fnsnG21"),pt=m("rVdVsuGH"),mt=m("8OvTct/Z"),ht=m("0t7Ye+61"),Oe=m("v4GbOr/o");const ft=()=>{const{indexSetsCount:x,indexSets:P,indexSetStats:L,globalIndexSetStats:V}=(0,ut.o)(U.Fp),{page:K,resetPage:$}=(0,pt.ZP)(),ne=(0,mt.Z)(),{pathname:se}=(0,ht.Z)(),[M,me]=(0,e.useState)(!1),[H,q]=(0,e.useState)(void 0),G=(0,e.useRef)(),j=(0,e.useCallback)((g=1,O=10)=>{H?U.p1.searchPaginated(H,(g-1)*O,O,M):U.p1.listPaginated((g-1)*O,O,M)},[M,H]);(0,e.useEffect)(()=>{j(K)},[j,K]),(0,e.useEffect)(()=>{M&&U.p1.stats()},[M]);const ie=g=>{(g&&g.length>=3||!g||g.length===0)&&(q(g),$())},he=()=>{q(void 0),$()},B=()=>{me(!M)},fe=g=>()=>{ne(Oe.A.INDICES.INDEX_SET_DEFAULT_SET,{app_pathname:(0,u.av)(se),app_section:"index-sets",app_action_value:"set-default-index-set"}),U.p1.setDefault(g).then(()=>j())},ge=g=>()=>{G.current[`index-set-deletion-form-${g.id}`].open()},re=(g,O)=>{ne(Oe.A.INDICES.INDEX_SET_DELETED,{app_pathname:(0,u.av)(se),app_section:"index-sets",app_action_value:"delete-index-set"}),U.p1.delete(g,O).then(()=>{$()})},ae=g=>{if(!g)return"N/A";const O=`${y.Z.formatNumber(g.indices)} ${we.Z.pluralize(g.indices,"index","indices")}`,ye=`${y.Z.formatNumber(g.documents)} ${we.Z.pluralize(g.documents,"document","documents")}`,Se=y.Z.formatBytes(g.size);return`${O}, ${ye}, ${Se}`},xe=(0,w.default)(c.Row)(({theme:g})=>(0,w.css)`
border-bottom: 1px solid ${g.colors.gray[90]};
padding-bottom: 15px;
`),Ee=(0,w.default)(c.Col)`
display: flex;
align-items: center;
gap: 10px;
`,oe=w.default.p`
margin-bottom: 0;
`,J=w.default.span(({theme:g})=>(0,w.css)`
color: ${g.colors.global.textAlt};
font-style: italic;
`),Je="Stats are disabled by default",$t=g=>{const O=e.createElement(dt.Z,null,e.createElement(Te.J,{to:Me.ZP.SYSTEM.INDEX_SETS.CONFIGURATION(g.id)},e.createElement(c.Button,null,"Edit")),e.createElement(c.DropdownButton,{title:"More Actions",id:`index-set-dropdown-${g.id}`,pullRight:!0},e.createElement(c.MenuItem,{onSelect:fe(g),disabled:!g.can_be_default||g.default},"Set as default"),e.createElement(c.MenuItem,{divider:!0}),e.createElement(c.MenuItem,{onSelect:ge(g)},"Delete"))),ye=e.createElement(c.Col,{md:12},e.createElement(Ie,{indexSet:g}),e.createElement(Pe,{ref:Gt=>{G.current={...G.current,[`index-set-deletion-form-${g.id}`]:Gt}},indexSet:g,onDelete:re})),Se=e.createElement(Te.r,{to:Me.ZP.SYSTEM.INDEX_SETS.SHOW(g.id)},g.title),Ut=g.default?e.createElement(c.Label,{key:`index-set-${g.id}-default-label`,bsStyle:"primary"},"default"):"",Kt=g.writable?"":e.createElement(c.Label,{key:`index-set-${g.id}-readOnly-label`,bsStyle:"info"},"read only");let{description:be}=g;g.default&&(be+=`${be.endsWith(".")?"":"."} Graylog will use this index set by default.`);let Ye;const Xe=L[g.id];return Xe&&(Ye=ae(Xe)),e.createElement(p.S6,{key:`index-set-${g.id}`,title:Se,titleSuffix:e.createElement("span",null,M?Ye:e.createElement(J,null,Je)," ",Ut," ",Kt),description:be,actions:O,contentRow:ye})},Nt=!P;return e.createElement(e.Fragment,null,e.createElement(c.Row,null,e.createElement(c.Col,{md:12},e.createElement(p.UI,{onSearch:ie,queryWidth:300,wrapperClass:"has-bm",onReset:he,query:H,placeholder:"Find index sets"}))),e.createElement(xe,null,e.createElement(Ee,{md:3},e.createElement(oe,null,e.createElement("strong",null,"Stats for all indices:")," ",M?ae(V):e.createElement(J,null,Je)),e.createElement(c.Button,{onClick:B},M?"Disable stats":"Enable stats"))),e.createElement(c.Row,null,e.createElement(c.Col,{md:12},Nt?e.createElement(p.$j,null):e.createElement(p.l9,{pageSize:10,totalItems:x,showPageSizeSelect:!1},e.createElement(p.XO,{bsNoItemsStyle:"info",noItemsText:"There are no index sets to display",items:P.map(g=>$t(g))})))))};var gt=Object.defineProperty,xt=(s,n,o)=>n in s?gt(s,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[n]=o,W=(s,n,o)=>(xt(s,typeof n!="symbol"?n+"":n,o),o);class Ae extends e.Component{constructor(){super(...arguments),W(this,"state",{showDetails:this.props.isDeflector}),W(this,"_formatLabels",n=>{const o=[];return n.is_deflector&&o.push(e.createElement(c.Label,{key:`${this.props.name}-deflector-label`,bsStyle:"primary"},"active write index")),n.is_closed&&o.push(e.createElement(c.Label,{key:`${this.props.name}-closed-label`,bsStyle:"warning"},"closed")),n.is_reopened&&o.push(e.createElement(c.Label,{key:`${this.props.name}-reopened-label`,bsStyle:"success"},"reopened")),e.createElement("span",{className:"index-label"},o)}),W(this,"_formatIndexRange",()=>{if(this.props.isDeflector)return e.createElement("span",null,"Contains messages up to ",e.createElement(p.ij,{dateTime:new Date}));const n=this.props.index.size;if(n){const o=n.events,{deleted:x}=n;if(o===0||o-x===0)return"Index does not contain any messages."}return this.props.indexRange?this.props.indexRange.begin===0?e.createElement("span",null,"Contains messages up to ",e.createElement(p.ij,{dateTime:this.props.indexRange.end})):e.createElement("span",null,"Contains messages from ",e.createElement(p.ij,{dateTime:this.props.indexRange.begin})," up to"," ",e.createElement(p.ij,{dateTime:this.props.indexRange.end})):"Time range of index is unknown, because index range is not available. Please recalculate index ranges manually."}),W(this,"_formatShowDetailsLink",()=>this.state.showDetails?e.createElement("span",{className:"index-more-actions"},e.createElement(p.JO,{name:"caret-down"})," Hide Details / Actions"):e.createElement("span",{className:"index-more-actions"},e.createElement(p.JO,{name:"caret-right"})," Show Details / Actions")),W(this,"_toggleShowDetails",n=>{n.preventDefault(),this.setState({showDetails:!this.state.showDetails})})}render(){const{index:n}=this.props;return e.createElement("span",null,e.createElement("h2",null,this.props.name," ",e.createElement("small",null,this._formatLabels(n)," ",this._formatIndexRange(n)," ",e.createElement(Be,{index:n}),e.createElement("a",{onClick:this._toggleShowDetails,href:"#"},this._formatShowDetailsLink()))),e.createElement("div",{className:"index-info-holder"},this.state.showDetails&&this.props.children))}}W(Ae,"propTypes",{children:d().node.isRequired,index:d().object.isRequired,indexRange:d().object,isDeflector:d().bool.isRequired,name:d().string.isRequired});const ue=Ae;var Et=m("9pdI12pI"),ze=m.n(Et),yt=Object.defineProperty,St=(s,n,o)=>n in s?yt(s,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[n]=o,bt=(s,n,o)=>(St(s,typeof n!="symbol"?n+"":n,o),o);class Ze extends e.Component{render(){const{index:n}=this.props;return n.size?e.createElement("span",null,"(",y.Z.formatBytes(n.size.bytes)," ","/ ",ze()(n.size.events).format("0,0")," messages)"," "):e.createElement("span",null)}}bt(Ze,"propTypes",{index:d().object.isRequired});const Be=Ze,k=(0,f.ei)("core.Deflector",()=>t().createActions({cycle:{asyncResult:!0},list:{asyncResult:!0}})),Jt=(0,f.dS)("core.Deflector",()=>t().createStore({listenables:[k],deflector:{info:void 0},getInitialState(){return{deflector:this.deflector}},cycle(s){const n=u.DC(r.Z.DeflectorApiController.cycle(s).url),o=(0,l.ZP)("POST",n);k.cycle.promise(o)},list(s){const n=u.DC(r.Z.DeflectorApiController.list(s).url),o=(0,l.ZP)("GET",n).then(x=>{this.deflector.info=x,this.trigger({deflector:this.deflector})});k.list.promise(o)}})),vt=s=>{window.confirm("This will recalculate index ranges for this index set using a background system job. Do you want to proceed?")&&E.recalculate(s)},Rt=s=>{window.confirm("This will manually cycle the current active write index on this index set. Do you want to proceed?")&&k.cycle(s).then(()=>{k.list(s)})},Fe=({indexSet:s,indexSetId:n})=>{const o=(0,e.useCallback)(()=>Rt(n),[n]),x=(0,e.useCallback)(()=>vt(n),[n]),P=(0,e.useMemo)(()=>s!=null&&s.writable?e.createElement(c.MenuItem,{eventKey:"2",onClick:o},"Rotate active write index"):null,[s==null?void 0:s.writable,o]);return e.createElement(c.ButtonGroup,null,e.createElement(c.DropdownButton,{bsStyle:"info",title:"Maintenance",id:"indices-maintenance-actions",pullRight:!0},e.createElement(c.MenuItem,{eventKey:"1",onClick:x},"Recalculate index ranges"),P))};Fe.propTypes={indexSetId:d().string.isRequired,indexSet:d().object.isRequired};const Ct=Fe,Dt=({index:s,indexDetails:n,indexSetId:o})=>{const x=s&&s.range?s.range:null,P=n.find(({index_name:L})=>L===s.index_name);return e.createElement(c.Row,{className:"content index-description"},e.createElement(c.Col,{md:12},e.createElement(ue,{index:s,name:s.index_name,count:s.size,indexRange:x,isDeflector:s.is_deflector},e.createElement("span",null,e.createElement(F,{index:P,indexName:s.index_name,indexRange:x,indexSetId:o,isDeflector:s.is_deflector})))))},Pt=({index:s})=>{const n=s.range;return e.createElement(c.Row,{className:"content index-description"},e.createElement(c.Col,{md:12},e.createElement(ue,{index:s,name:s.index_name,indexRange:n,isDeflector:s.is_deflector},e.createElement("span",null,e.createElement(v,{indexName:s.index_name,indexRange:n})))))},Le=({indexDetails:s,indices:n,indexSetId:o})=>e.createElement("span",null,n.map(x=>x.is_closed?e.createElement(Pt,{index:x,key:`index-summary-${x.index_name}`}):e.createElement(Dt,{index:x,indexDetails:s,indexSetId:o,key:`index-summary-${x.index_name}`})));Le.propTypes={indexDetails:d().array.isRequired,indices:d().array.isRequired,indexSetId:d().string.isRequired};const _t=Le;var $e=m("PSa/+Uus"),It=Object.defineProperty,Tt=(s,n,o)=>n in s?It(s,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[n]=o,Mt=(s,n,o)=>(Tt(s,typeof n!="symbol"?n+"":n,o),o);class Ne extends e.Component{render(){const{indexSet:n}=this.props;if(!n.writable)return e.createElement(c.Row,null,e.createElement(c.Col,{md:12},"Index set is not writable and will not be included in index rotation and retention. It is also not possible to assign it to a stream."));const o={strategy:n.rotation_strategy_class,config:n.rotation_strategy},x={strategy:n.retention_strategy_class,config:n.retention_strategy};return e.createElement(c.Row,null,e.createElement(c.Col,{md:6},e.createElement($e.Z,{config:o,pluginExports:te.G.exports("indexRotationConfig")})),e.createElement(c.Col,{md:6},e.createElement($e.Z,{config:x,pluginExports:te.G.exports("indexRetentionConfig")})))}}Mt(Ne,"propTypes",{indexSet:d().object.isRequired});const Ue=Ne;var wt=Object.defineProperty,Ot=(s,n,o)=>n in s?wt(s,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[n]=o,Ke=(s,n,o)=>(Ot(s,typeof n!="symbol"?n+"":n,o),o);class Ge extends e.Component{constructor(){super(...arguments),Ke(this,"_formatMeter",n=>{const o=e.createElement("span",null,ze()(n.total).format("0,0")," ops");return n.total>0?e.createElement("span",null,o," ",e.createElement("span",{title:`${n.time_seconds}s`},"(took ",ee().duration(n.time_seconds,"seconds").humanize(),")")):o})}render(){const n=this.props.shardMeter;return e.createElement("span",null,e.createElement("h3",{style:{display:"inline"}},this.props.title),e.createElement("dl",null,e.createElement("dt",null,"Index:"),e.createElement("dd",null,this._formatMeter(n.index)),e.createElement("dt",null,"Flush:"),e.createElement("dd",null,this._formatMeter(n.flush)),e.createElement("dt",null,"Merge:"),e.createElement("dd",null,this._formatMeter(n.merge)),e.createElement("dt",null,"Query:"),e.createElement("dd",null,this._formatMeter(n.search_query)),e.createElement("dt",null,"Fetch:"),e.createElement("dd",null,this._formatMeter(n.search_fetch)),e.createElement("dt",null,"Get:"),e.createElement("dd",null,this._formatMeter(n.get)),e.createElement("dt",null,"Refresh:"),e.createElement("dd",null,this._formatMeter(n.refresh))))}}Ke(Ge,"propTypes",{title:d().string.isRequired,shardMeter:d().object.isRequired});const pe=Ge;var At=m("uRLsxEc6"),zt=m.n(At),Zt=Object.defineProperty,Bt=(s,n,o)=>n in s?Zt(s,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[n]=o,Ft=(s,n,o)=>(Bt(s,typeof n!="symbol"?n+"":n,o),o);class je extends e.Component{render(){const{route:n}=this.props,o=e.createElement(c.Tooltip,{id:"shard-route-state-tooltip"},"State: ",e.createElement("i",null,n.state)," on ",n.node_hostname," (",n.node_name,")");return e.createElement("li",{className:zt()("shard",`shard-${n.state}`,{"shard-primary":n.primary})},e.createElement(p.Ox,{placement:"top",overlay:o},e.createElement("span",{className:"id"},"S",n.id)))}}Ft(je,"propTypes",{route:d().object.isRequired});const We=je,Lt=w.default.div(({theme:s})=>(0,w.css)`
.shards {
.shard {
padding: 10px;
margin: 5px;
width: 50px;
float: left;
text-align: center;
}
.shard-started {
background-color: ${s.utils.colorLevel(s.colors.variant.light.success,-2)};
}
.shard-relocating {
background-color: ${s.utils.colorLevel(s.colors.variant.light.primary,-2)};
}
.shard-initializing {
background-color: ${s.utils.colorLevel(s.colors.variant.light.warning,-5)};
}
.shard-unassigned {
background-color: ${s.utils.colorLevel(s.colors.variant.light.default,-2)};
}
.shard-primary .id {
font-weight: bold;
margin-bottom: 3px;
border-bottom: 1px solid ${s.colors.gray[10]};
}
}
.description {
font-size: ${s.fonts.size.small};
margin-top: 2px;
margin-left: 6px;
}
`),Ve=({indexName:s,routing:n})=>e.createElement(Lt,null,e.createElement("h3",null,"Shard routing"),e.createElement("ul",{className:"shards"},n.sort((o,x)=>(0,Ce.S)(o.id,x.id)).map(o=>e.createElement(We,{key:`${s}-shard-route-${o.node_id}-${o.id}`,route:o}))),e.createElement("br",{style:{clear:"both"}}),e.createElement("div",{className:"description"},"Bold shards are primaries, others are replicas. Replicas are elected to primaries automatically when primaries leave the cluster. Size and document counts only reflect primary shards and no possible replica duplication."));Ve.propTypes={routing:d().array.isRequired,indexName:d().string.isRequired};const He=Ve},N6x7vnl1:(Q,A,m)=>{m.d(A,{Z:()=>c});var z=m("Z7aTuO5B"),d=m("/7OuCFNo");const c=C=>T=>{const b=(0,d.Z)();return z.createElement(C,{...T,history:b})}},PhRf2fIG:(Q,A,m)=>{m.d(A,{Fp:()=>t,p1:()=>i,wv:()=>p});var z=m("JnTtTRmZ"),d=m.n(z),e=m("ii0bleBb"),c=m.n(e),C=m("8u9vblRK"),T=m.n(C),b=m("U1Iufsob"),D=m("eFxcQyPT"),_=m("MdYBRjRJ"),v=m("jAGDuYSC"),h=m("IA3Ku5lS"),y=m("6bzBY7Xo");const p=c().shape({can_be_default:c().bool,id:c().string,title:c().string,description:c().string.isRequired,index_prefix:c().string.isRequired,shards:c().number.isRequired,replicas:c().number.isRequired,rotation_strategy_class:c().string.isRequired,rotation_strategy:y.uA.isRequired,retention_strategy_class:c().string.isRequired,retention_strategy:y.zB.isRequired,creation_date:c().string,index_analyzer:c().string.isRequired,index_optimization_max_num_segments:c().number.isRequired,index_optimization_disabled:c().bool.isRequired,field_type_refresh_interval:c().number.isRequired,index_template_type:c().string,writable:c().bool.isRequired,default:c().bool.isRequired}),i=(0,h.ei)("core.IndexSets",()=>d().createActions({list:{asyncResult:!0},listPaginated:{asyncResult:!0},get:{asyncResult:!0},update:{asyncResult:!0},create:{asyncResult:!0},delete:{asyncResult:!0},searchPaginated:{asyncResult:!0},setDefault:{asyncResult:!0},stats:{asyncResult:!0}})),t=(0,h.dS)("core.IndexSets",()=>d().createStore({listenables:[i],indexSetsCount:void 0,indexSets:void 0,indexSetStats:void 0,indexSet:void 0,globalIndexSetStats:void 0,getInitialState(){return this.getState()},getState(){return{indexSetsCount:this.indexSetsCount,indexSets:this.indexSets,indexSetStats:this.indexSetStats,indexSet:this.indexSet,globalIndexSetStats:this.globalIndexSetStats}},propagateChanges(){this.trigger(this.getState())},list(a){const u=(0,_.DC)(b.Z.IndexSetsApiController.list(a).url),r=(0,D.ZP)("GET",u);r.then(l=>(this.indexSetsCount=l.total,this.indexSets=l.index_sets,this.indexSetStats=l.stats,this.propagateChanges(),l),l=>{v.Z.error(`Fetching index sets list failed: ${l.message}`,"Could not retrieve index sets.")}),i.list.promise(r)},listPaginated(a,u,r){const l=(0,_.DC)(b.Z.IndexSetsApiController.listPaginated(a,u,r).url),f=(0,D.ZP)("GET",l);f.then(E=>(this.indexSetsCount=E.total,this.indexSets=E.index_sets,this.indexSetStats=E.stats,this.propagateChanges(),E),E=>{v.Z.error(`Fetching index sets list failed: ${this._errorMessage(E)}`,"Could not retrieve index sets.")}),i.listPaginated.promise(f)},searchPaginated(a,u,r,l){const f=(0,_.DC)(b.Z.IndexSetsApiController.searchPaginated(a,u,r,l).url),E=(0,D.ZP)("GET",f);E.then(S=>(this.indexSetsCount=S.total,this.indexSets=S.index_sets,this.indexSetStats=S.stats,this.propagateChanges(),S),S=>{v.Z.error(`Fetching index sets list failed: ${this._errorMessage(S)}`,"Could not retrieve index sets.")}),i.searchPaginated.promise(E)},get(a){const u=(0,_.DC)(b.Z.IndexSetsApiController.get(a).url),r=(0,D.ZP)("GET",u);r.then(l=>(this.indexSet=l,this.propagateChanges(),l),l=>{v.Z.error(`Fetching index set '${a}' failed with status: ${this._errorMessage(l)}`,"Could not retrieve index set.")}),i.get.promise(r)},update(a){const u=(0,_.DC)(b.Z.IndexSetsApiController.get(a.id).url),r=(0,D.ZP)("PUT",u,a);r.then(l=>(v.Z.success(`Successfully updated index set '${a.title}'`,"Success"),this.indexSet=l,this.propagateChanges(),l),l=>{v.Z.error(`Updating index set '${a.title}' failed with status: ${this._errorMessage(l)}`,"Could not update index set.")}),i.update.promise(r)},create(a){const u=(0,_.DC)(b.Z.IndexSetsApiController.create().url),r=(0,D.ZP)("POST",u,a);r.then(l=>(v.Z.success(`Successfully created index set '${a.title}'`,"Success"),this.indexSet=l,this.propagateChanges(),l),l=>{v.Z.error(`Creating index set '${a.title}' failed with status: ${this._errorMessage(l)}`,"Could not create index set.")}),i.create.promise(r)},delete(a,u){const r=(0,_.DC)(b.Z.IndexSetsApiController.delete(a.id,u).url),l=(0,D.ZP)("DELETE",r);l.then(()=>{v.Z.success(`Successfully deleted index set '${a.title}'`,"Success")},f=>{v.Z.error(`Deleting index set '${a.title}' failed with status: ${this._errorMessage(f)}`,"Could not delete index set.")}),i.delete.promise(l)},setDefault(a){const u=(0,_.DC)(b.Z.IndexSetsApiController.setDefault(a.id).url),r=(0,D.ZP)("PUT",u);r.then(()=>{v.Z.success(`Successfully set index set '${a.title}' as default`,"Success")},l=>{v.Z.error(`Setting index set '${a.title}' as default failed with status: ${this._errorMessage(l)}`,"Could not set default index set.")}),i.setDefault.promise(r)},stats(){const a=(0,_.DC)(b.Z.IndexSetsApiController.stats().url),u=(0,D.ZP)("GET",a);u.then(r=>(this.globalIndexSetStats={indices:r.indices,documents:r.documents,size:r.size},this.propagateChanges(),r),r=>{v.Z.error(`Fetching global index stats failed: ${r.message}`,"Could not retrieve global index stats.")}),i.stats.promise(u)},_errorMessage(a){try{return T()(a.additional.body)?a.additional.body.map(({message:u,path:r})=>`${r!=null?r:""} ${u}.`).join(" "):a.additional.body.message}catch{return a.message}}}))},"+tRdaXwG":(Q,A,m)=>{m.d(A,{Z:()=>v});var z=m("WZJ4lp+S"),d=m("Z7aTuO5B");function e(h){return h&&h.stopPropagation&&h.stopPropagation(),h&&h.preventDefault&&h.preventDefault(),!1}function c(h){return h==null?[]:Array.isArray(h)?h.slice():[h]}function C(h){return h!==null&&h.length===1?h[0]:h.slice()}function T(h){Object.keys(h).forEach(y=>{typeof document<"u"&&document.addEventListener(y,h[y],!1)})}function b(h,y){return D(function(p,i){let t=p;return t<=i.min&&(t=i.min),t>=i.max&&(t=i.max),t}(h,y),y)}function D(h,y){const p=(h-y.min)%y.step;let i=h-p;return 2*Math.abs(p)>=y.step&&(i+=p>0?y.step:-y.step),parseFloat(i.toFixed(5))}let _=function(h){function y(i){var t;(t=h.call(this,i)||this).onKeyUp=()=>{t.onEnd()},t.onMouseUp=()=>{t.onEnd(t.getMouseEventMap())},t.onTouchEnd=r=>{r.preventDefault(),t.onEnd(t.getTouchEventMap())},t.onBlur=()=>{t.setState({index:-1},t.onEnd(t.getKeyDownEventMap()))},t.onMouseMove=r=>{t.setState({pending:!0});const l=t.getMousePosition(r),f=t.getDiffPosition(l[0]),E=t.getValueFromPosition(f);t.move(E)},t.onTouchMove=r=>{if(r.touches.length>1)return;t.setState({pending:!0});const l=t.getTouchPosition(r);if(t.isScrolling===void 0){const S=l[0]-t.startPosition[0],R=l[1]-t.startPosition[1];t.isScrolling=Math.abs(R)>Math.abs(S)}if(t.isScrolling)return void t.setState({index:-1});const f=t.getDiffPosition(l[0]),E=t.getValueFromPosition(f);t.move(E)},t.onKeyDown=r=>{if(!(r.ctrlKey||r.shiftKey||r.altKey||r.metaKey))switch(t.setState({pending:!0}),r.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":r.preventDefault(),t.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":r.preventDefault(),t.moveUpByStep();break;case"Home":r.preventDefault(),t.move(t.props.min);break;case"End":r.preventDefault(),t.move(t.props.max);break;case"PageDown":r.preventDefault(),t.moveDownByStep(t.props.pageFn(t.props.step));break;case"PageUp":r.preventDefault(),t.moveUpByStep(t.props.pageFn(t.props.step))}},t.onSliderMouseDown=r=>{if(!t.props.disabled&&r.button!==2){if(t.setState({pending:!0}),!t.props.snapDragDisabled){const l=t.getMousePosition(r);t.forceValueFromPosition(l[0],f=>{t.start(f,l[0]),T(t.getMouseEventMap())})}e(r)}},t.onSliderClick=r=>{if(!t.props.disabled&&t.props.onSliderClick&&!t.hasMoved){const l=t.getMousePosition(r),f=b(t.calcValue(t.calcOffsetFromPosition(l[0])),t.props);t.props.onSliderClick(f)}},t.createOnKeyDown=r=>l=>{t.props.disabled||(t.start(r),T(t.getKeyDownEventMap()),e(l))},t.createOnMouseDown=r=>l=>{if(t.props.disabled||l.button===2)return;t.setState({pending:!0});const f=t.getMousePosition(l);t.start(r,f[0]),T(t.getMouseEventMap()),e(l)},t.createOnTouchStart=r=>l=>{if(t.props.disabled||l.touches.length>1)return;t.setState({pending:!0});const f=t.getTouchPosition(l);t.startPosition=f,t.isScrolling=void 0,t.start(r,f[0]),T(t.getTouchEventMap()),function(E){E.stopPropagation&&E.stopPropagation()}(l)},t.handleResize=()=>{const r=window.setTimeout(()=>{t.pendingResizeTimeouts.shift(),t.resize()},0);t.pendingResizeTimeouts.push(r)},t.renderThumb=(r,l)=>{const f=t.props.thumbClassName+" "+t.props.thumbClassName+"-"+l+" "+(t.state.index===l?t.props.thumbActiveClassName:""),E={ref:R=>{t["thumb"+l]=R},key:t.props.thumbClassName+"-"+l,className:f,style:r,onMouseDown:t.createOnMouseDown(l),onTouchStart:t.createOnTouchStart(l),onFocus:t.createOnKeyDown(l),tabIndex:0,role:"slider","aria-orientation":t.props.orientation,"aria-valuenow":t.state.value[l],"aria-valuemin":t.props.min,"aria-valuemax":t.props.max,"aria-label":Array.isArray(t.props.ariaLabel)?t.props.ariaLabel[l]:t.props.ariaLabel,"aria-labelledby":Array.isArray(t.props.ariaLabelledby)?t.props.ariaLabelledby[l]:t.props.ariaLabelledby,"aria-disabled":t.props.disabled},S={index:l,value:C(t.state.value),valueNow:t.state.value[l]};return t.props.ariaValuetext&&(E["aria-valuetext"]=typeof t.props.ariaValuetext=="string"?t.props.ariaValuetext:t.props.ariaValuetext(S)),t.props.renderThumb(E,S)},t.renderTrack=(r,l,f)=>{const E={key:t.props.trackClassName+"-"+r,className:t.props.trackClassName+" "+t.props.trackClassName+"-"+r,style:t.buildTrackStyle(l,t.state.upperBound-f)},S={index:r,value:C(t.state.value)};return t.props.renderTrack(E,S)};let a=c(i.value);a.length||(a=c(i.defaultValue)),t.pendingResizeTimeouts=[];const u=[];for(let r=0;rb(u,i))}:null},p.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},p.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},p.onEnd=function(i){i&&function(t){Object.keys(t).forEach(a=>{typeof document<"u"&&document.removeEventListener(a,t[a],!1)})}(i),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},p.getValue=function(){return C(this.state.value)},p.getClosestIndex=function(i){let t=Number.MAX_VALUE,a=-1;const{value:u}=this.state,r=u.length;for(let l=0;l{t(u),this.fireChangeEvent("onChange")})},p.clearPendingResizeTimeouts=function(){do{const i=this.pendingResizeTimeouts.shift();clearTimeout(i)}while(this.pendingResizeTimeouts.length)},p.start=function(i,t){const a=this["thumb"+i];a&&a.focus();const{zIndices:u}=this.state;u.splice(u.indexOf(i),1),u.push(i),this.setState(r=>({startValue:r.value[i],startPosition:t!==void 0?t:r.startPosition,index:i,zIndices:u}))},p.moveUpByStep=function(i){i===void 0&&(i=this.props.step);const t=this.state.value[this.state.index],a=b(this.props.invert&&this.props.orientation==="horizontal"?t-i:t+i,this.props);this.move(Math.min(a,this.props.max))},p.moveDownByStep=function(i){i===void 0&&(i=this.props.step);const t=this.state.value[this.state.index],a=b(this.props.invert&&this.props.orientation==="horizontal"?t+i:t-i,this.props);this.move(Math.max(a,this.props.min))},p.move=function(i){const t=this.state.value.slice(),{index:a}=this.state,{length:u}=t,r=t[a];if(i===r)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;const{pearling:l,max:f,min:E,minDistance:S}=this.props;if(!l){if(a>0){const R=t[a-1];iR-S&&(i=R-S)}}t[a]=i,l&&u>1&&(i>r?(this.pushSucceeding(t,S,a),function(R,F,Y,X){for(let I=0;IN&&(F[R-1-I]=N)}}(u,t,S,f)):ii[u+1];u+=1,r=i[u]+t)i[u+1]=D(r,this.props)},p.pushPreceding=function(i,t,a){for(let u=a,r=i[u]-t;i[u-1]!==null&&r=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(t)+1};return a[this.posMinKey()]=i+"px",a},p.buildTrackStyle=function(i,t){const a={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return a[this.posMinKey()]=i,a[this.posMaxKey()]=t,a},p.buildMarkStyle=function(i){var t;return(t={position:"absolute"})[this.posMinKey()]=i,t},p.renderThumbs=function(i){const{length:t}=i,a=[];for(let r=0;ru):typeof i=="number"&&(i=Array.from({length:t}).map((a,u)=>u).filter(a=>a%i==0)),i.map(parseFloat).sort((a,u)=>a-u).map(a=>{const u=this.calcOffset(a),r={key:a,className:this.props.markClassName,style:this.buildMarkStyle(u)};return this.props.renderMark(r)})},p.render=function(){const i=[],{value:t}=this.state,a=t.length;for(let f=0;f{this.slider=f,this.resizeElementRef.current=f},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},u,r,l)},y}(d.Component);_.displayName="ReactSlider",_.defaultProps={min:0,max:100,step:1,pageFn:h=>10*h,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:h=>d.createElement("div",h),renderTrack:h=>d.createElement("div",h),renderMark:h=>d.createElement("span",h)};var v=_}}]);})();
//# sourceMappingURL=07ba022f-8940.5ca1eb6661869012f879.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy