/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import{LitElement as f,html as a,nothing as m}from"lit";import{property as d,state as l,customElement as y}from"lit/decorators.js";import{classMap as S}from"lit/directives/class-map.js";import{createRef as b,ref as v}from"lit/directives/ref.js";import{KeyTypesEnum as g}from"@typo3/backend/enum/key-types.js";import k from"@typo3/backend/modal.js";import"@typo3/backend/element/alert-element.js";import"@typo3/backend/element/icon-element.js";import"@typo3/backend/element/progress-tracker-element.js";import"@typo3/backend/element/spinner-element.js";import w from"@typo3/backend/wizard/steps/confirm-step.js";import x from"@typo3/backend/wizard/steps/finisher-step.js";import c from"~labels/backend.wizards.general";import{BeforeNextStepEvent as T}from"@typo3/backend/wizard/events/before-next-step-event.js";var o=function(p,t,e,r){var s=arguments.length,i=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(p,t,e,r);else for(var h=p.length-1;h>=0;h--)(u=p[h])&&(i=(s<3?u(i):s>3?u(t,e,i):u(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i};let n=class extends f{constructor(){super(...arguments),this.steps=[],this.skipSummary=!1,this.currentStepIndex=0,this.dataStore={},this.allSteps=[],this.progressTracker=null,this.primaryButtonRef=b(),this.focusPendingStep=null,this.handleAutoAdvance=()=>{this.tryAutoAdvance()},this.handleContentKeydown=t=>{if(t.key!==g.ENTER)return;const e=t.target;!(e instanceof HTMLInputElement)||e.form||e.type==="search"||e.type==="checkbox"||(t.preventDefault(),this.handleNext())}}connectedCallback(){super.connectedCallback(),this.addEventListener("auto-advance",this.handleAutoAdvance),this.progressTracker=document.createElement("typo3-backend-progress-tracker")}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("auto-advance",this.handleAutoAdvance),this.progressTracker=null}getStepSummaries(){const t=[];for(const e of this.allSteps)if(this.hasSummary(e)){const r=e.getSummaryData();t.push(...r)}return t}getStoreData(t){return this.dataStore[t]??null}setStoreData(t,e){this.dataStore={...this.dataStore,[t]:e}}getDataStore(){return this.dataStore}clearStoreData(t){const e={...this.dataStore};delete e[t],this.dataStore=e}tryAutoAdvance(){const t=this.getCurrentStep();t.autoAdvance&&t.isComplete()&&this.goToNextStep()}dismissWizard(){k.dismiss()}renderLoader(t){return a`