{"remainingRequest":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[0].use[1]!C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\resources\\assets\\scripts\\blocks\\StepsForm.js","dependencies":[{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\resources\\assets\\scripts\\blocks\\StepsForm.js","mtime":1725363417000},{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1726651497274},{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\babel-loader\\lib\\index.js","mtime":1726651482652}],"contextDependencies":[],"result":["import Block from './Block';\nimport { gsap } from 'gsap';\nexport default class StepsForm extends Block {\n  init() {\n    this.transformButtons();\n    this.handlePages();\n  }\n  getElems() {\n    this.$showBtn = document.querySelector('#show-steps-form');\n    this.$dialog = this.el.querySelector('#steps-form');\n    this.$close = this.el.querySelector('#hide-steps-form');\n    this.$nextButtons = this.el.querySelectorAll('.gform_next_button');\n    this.$prevButtons = this.el.querySelectorAll('.gform_previous_button');\n    this.$submitButton = this.el.querySelector('.gform_button');\n    this.$pages = this.el.querySelectorAll('.gform_page');\n  }\n  createSVG(paths) {\n    const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n    svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n    svg.setAttribute('width', '30');\n    svg.setAttribute('height', '29');\n    svg.setAttribute('viewBox', '0 0 30 29');\n    svg.setAttribute('fill', 'none');\n    paths.forEach(pathData => {\n      const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n      path.setAttribute('fill-rule', 'evenodd');\n      path.setAttribute('clip-rule', 'evenodd');\n      path.setAttribute('d', pathData.d);\n      path.setAttribute('fill', pathData.fill);\n      svg.appendChild(path);\n    });\n    return svg;\n  }\n  transformButtons() {\n    const inputs = this.el.querySelectorAll('input[type=\"submit\"], input[type=\"button\"]');\n    inputs.forEach(input => {\n      const button = document.createElement('button');\n      button.className = 'gform_button';\n      button.setAttribute('aria-label', 'Form submit button');\n      button.innerHTML = input.value;\n      Array.from(input.attributes).forEach(attr => {\n        if (attr.name !== 'type' && attr.name !== 'value') button.setAttribute(attr.name, attr.value);\n      });\n      if (input.classList.contains('gform_next_button') || input.classList.contains('gform_button')) {\n        const paths = [{\n          d: 'M14.6948 9.05897C15.0369 8.69534 15.6091 8.6779 15.9727 9.02001L20.5797 13.3544C21.245 13.9804 21.245 15.0194 20.5797 15.6453L15.9727 19.9797C15.6091 20.3218 15.0369 20.3044 14.6948 19.9408C14.3527 19.5771 14.3701 19.005 14.7338 18.6629L19.1586 14.4999L14.7338 10.3369C14.3701 9.99474 14.3527 9.42261 14.6948 9.05897Z',\n          fill: 'white'\n        }, {\n          d: 'M9.02539 14.5C9.02539 14.0007 9.43013 13.5959 9.92941 13.5959H18.9696C19.4689 13.5959 19.8736 14.0007 19.8736 14.5C19.8736 14.9992 19.4689 15.404 18.9696 15.404H9.92941C9.43013 15.404 9.02539 14.9992 9.02539 14.5Z',\n          fill: 'white'\n        }];\n        button.appendChild(this.createSVG(paths));\n      }\n      if (input.classList.contains('gform_previous_button')) {\n        const paths = [{\n          d: 'M14.8062 19.9408C14.464 20.3044 13.8919 20.3219 13.5283 19.9797L8.92127 15.6454C8.25596 15.0194 8.25597 13.9804 8.92128 13.3544L13.5283 9.02004C13.8919 8.67793 14.464 8.69537 14.8062 9.05901C15.1483 9.42264 15.1308 9.99477 14.7672 10.3369L10.3424 14.4999L14.7672 18.6629C15.1308 19.005 15.1483 19.5771 14.8062 19.9408Z',\n          fill: '#20485a'\n        }, {\n          d: 'M20.4756 14.4998C20.4756 14.9991 20.0708 15.4038 19.5716 15.4038L10.5314 15.4038C10.0321 15.4038 9.62737 14.9991 9.62737 14.4998C9.62737 14.0005 10.0321 13.5958 10.5314 13.5958L19.5716 13.5958C20.0708 13.5958 20.4756 14.0005 20.4756 14.4998Z',\n          fill: '#20485a'\n        }];\n        button.appendChild(this.createSVG(paths));\n      }\n      input.parentNode.replaceChild(button, input);\n    });\n  }\n  handlePages() {\n    this.$pages.forEach(page => {\n      gsap.set(page, {\n        opacity: 0,\n        x: -20\n      });\n      if (page.style.display !== 'none') {\n        gsap.to(page, {\n          opacity: 1,\n          x: 0,\n          ease: 'sine.out'\n        });\n      }\n    });\n  }\n}",null]}