1import{h as s,V as n}from"./vue.00f7c436.js";import{_ as a,be as i}from"./index.b39fe1b1.js";import"./sentry.09480738.js";const h={name:"TmlStages",props:{stage:[Number,String],code:String,historyMode:Boolean},data(){return{currentStageIndex:null,slideDirection:"right",history:[]}},computed:{currentStage:{get(){return this.currentStageIndex},set(t){this.stages.length&&(this.currentStageIndex=t,this.$emit("stage-change",{index:t,name:this.stages[this.currentStageIndex-1]?this.stages[this.currentStageIndex-1].name:this.stages[0].name,title:this.stages[this.currentStageIndex-1]?this.stages[this.currentStageIndex-1].title:this.stages[0].title,firstStage:this.firstStage,lastStage:this.lastStage}))}},stages(){return i(this.$slots.default()).map((t,e)=>({index:e,name:t.props?t.props.name:t.slotIndex,title:t.props?t.props.title:null}))},firstStage(){return this.currentStage===1},lastStage(){return this.currentStage+1>this.stages.length}},watch:{stage:{immediate:!0,handler(t){const e=this.getStage(t);e!==null&&(this.currentStage=e)}},currentStageIndex(t,e){t>e?this.slideDirection="right":t<e&&(this.slideDirection="left"),this.$emit("stageChanged",t)}},created(){this.getStage(this.stage),this.code&&(this.$eventBus.on(`stages-${this.code}:next`,this.next),this.$eventBus.on(`stages-${this.code}:back`,this.back),this.$eventBus.on(`stages-${this.code}:go`,this.go)),this.historyMode&&(window.addEventListener("popstate",this._onPopState,!1),this.$eventBus.on("onHeaderBackAction",this.onHeaderBack))},beforeUnmount(){this.historyMode&&(window.removeEventListener("popstate",this._onPopState),this.$eventBus.off("onHeaderBackAction",this.onHeaderBack)),this.code&&(this.$eventBus.off(`stages-${this.code}:next`,this.next),this.$eventBus.off(`stages-${this.code}:back`,this.back),this.$eventBus.off(`stages-${this.code}:go`,this.go))},methods:{next(){this.historyMode&&this.$router.push({query:Object.assign({},this.$route.query,{[`stage-${this.code}`]:this.currentStageIndex})}),this.lastStage||(this.history.push(this.currentStage),this.currentStage=this.currentStage+1,this.$emit("next",{to:this.currentStage,from:this.currentStage-1}))},prev(){this.history.length?(this.currentStage=this.history.pop(),this.$emit("prev",{to:this.currentStage,from:this.currentStage+1})):this.$emit("no-previous")},back(){this.firstStage||(this.history.push(this.currentStage),this.currentStage=this.currentStage-1,this.$emit("back",{to:this.currentStage,from:this.currentStage+1}))},go(t){this.history.push(this.currentStage),t=this.getStage(t);const e=this.currentStage?this.currentStage:null;this.currentStage=t,this.$emit("go",{to:this.currentStage,from:e})},isInStageRange(t){return t>0&&t<=this.stages.length},findIndexFromName(t){const e=this.stages.findIndex(r=>r.name===t);return e!=null?e+1:this.currentStage},getStage(t){return typeof t=="string"?this.findIndexFromName(t):typeof t=="number"&&this.isInStageRange(t)?t:null},onTransitionAfterEnter(){this.$emit("after-stage-transition-enter")},onHeaderBack(t){this.historyMode&&this.currentStageIndex>1&&(t.preventDefault(),this.prev())}},render(){const t=i(this.$slots.default());return s("div",{class:"tml-stages"},[s(n,{name:`slide-fade-${this.slideDirection}`,mode:"out-in",onAfterEnter:this.onTransitionAfterEnter},()=>[s("div",{class:"stage",key:this.currentStage},[this.stages&&this.stages.length&&t?t[this.stages[this.currentStage-1]?this.stages[this.currentStage-1].index:this.stages[0].index]:[]])])])}},u=a(h,[["__scopeId","data-v-94ee7358"]]);export{u as default}; 2//# sourceMappingURL=TmlStages.9d3c9f6f.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.