{"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\\routes\\Page.js","dependencies":[{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\resources\\assets\\scripts\\routes\\Page.js","mtime":1725006057000},{"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 { Renderer } from '@unseenco/taxi';\nimport blockList from '../blocks/blockList';\nimport store from '../util/store';\nimport ParallaxEffect from '../util/ParallaxEffect';\nimport TitleReveal from '../util/TitleReveal';\nexport default class Page extends Renderer {\n  initialLoad() {\n    this.onEnter();\n    this.onEnterCompleted();\n  }\n  onEnter() {\n    this.view = this.content;\n    this.startBlocksEnterCompleted = this.startBlocksEnterCompleted.bind(this);\n    store.isFirstLoaded && this.preload();\n    this.blockList = blockList;\n    this.blocks = [];\n    if (this.blockList && this.blockList.length) this.initBlocks();\n    this.initEffects();\n  }\n  preload() {\n    const links = this.view.querySelectorAll('a');\n    for (let i = 0; i < links.length; i++) {\n      !store.router.cache.has(links[i].href) && store.router.preload(links[i].href);\n    }\n  }\n  initBlocks() {\n    store.detect.isMobile && (this.blockList = this.blockList.filter(e => e.mobile !== false));\n    let totalBlocks = 0;\n    let loadedBlocks = 0;\n    for (let i = 0; i < this.blockList.length; i++) {\n      const foundBlocks = this.view.querySelectorAll('.' + this.blockList[i].name);\n      totalBlocks += foundBlocks.length;\n    }\n    if (!store.isFirstLoaded && totalBlocks === 0) store.loader.play();\n    for (let i = 0; i < this.blockList.length; i++) {\n      const foundBlocks = this.view.querySelectorAll('.' + this.blockList[i].name);\n      const block = {\n        name: this.blockList[i].name,\n        instances: []\n      };\n      for (let j = 0; j < foundBlocks.length; j++) {\n        const {\n          fileName,\n          hasMobileBlock\n        } = this.blockList[i];\n        const file = store.detect.isMobile && hasMobileBlock ? 'mobile/' + fileName : fileName;\n\n        // eslint-disable-next-line no-loop-func\n        import('../blocks/' + file).then(_ref => {\n          let {\n            default: BlockInstance\n          } = _ref;\n          loadedBlocks++;\n          block.instances.push({\n            el: foundBlocks[j],\n            class: new BlockInstance(foundBlocks[j])\n          });\n          if (loadedBlocks === totalBlocks) {\n            if (store.isFirstLoaded) {\n              store.transitionComplete = true;\n              window.dispatchEvent(new CustomEvent('transitionComplete'));\n            } else store.loader.play();\n          }\n        });\n      }\n      this.blocks.push(block);\n    }\n  }\n  initEffects() {\n    this.parallaxEffect = new ParallaxEffect();\n    this.titleReveal = new TitleReveal();\n  }\n  onEnterCompleted() {\n    if (store.isFirstLoaded) this.startBlocksEnterCompleted();else window.addEventListener('loaderComplete', this.startBlocksEnterCompleted);\n  }\n  startBlocksEnterCompleted() {\n    if (store.scrollEngine === 'lenis' || !store.scrollEngine) store.observer && store.observer.on();\n    store.modules.parallax && store.modules.parallax.on();\n    for (let i = 0; i < this.blocks.length; i++) {\n      for (let j = 0; j < this.blocks[i].instances.length; j++) {\n        const {\n          el,\n          once\n        } = this.blocks[i].instances[j].class;\n        this.blocks[i].instances[j].class.onEnterCompleted();\n        store.observer.observe({\n          el,\n          repeat: true,\n          once,\n          cb: e => {\n            this.blocks[i].instances[j].class.isInView = e;\n            this.blocks[i].instances[j].class.inView(e);\n          }\n        });\n      }\n    }\n  }\n  onLeave() {\n    if (store.scrollEngine === 'lenis' || !store.scrollEngine) store.observer.off();\n    for (let i = 0; i < this.blocks.length; i++) {\n      for (let j = 0; j < this.blocks[i].instances.length; j++) {\n        if (!this.blocks[i].instances[j].class.destroyLast) this.blocks[i].instances[j].class.destroy();\n      }\n    }\n  }\n  onLeaveCompleted() {\n    store.observer && store.observer.off();\n\n    // Destroy blocks with `destroyLast` property set to `true`\n    for (let i = 0; i < this.blocks.length; i++) {\n      for (let j = 0; j < this.blocks[i].instances.length; j++) {\n        if (this.blocks[i].instances[j].class.destroyLast) this.blocks[i].instances[j].class.destroy();\n      }\n    }\n  }\n  resize() {\n    for (let i = 0; i < this.blocks.length; i++) {\n      for (let j = 0; j < this.blocks[i].instances.length; j++) {\n        this.blocks[i].instances[j].class.resize();\n      }\n    }\n  }\n  scroll(e) {\n    store.modules.parallax && store.modules.parallax.scroll(e);\n    for (let i = 0; i < this.blocks.length; i++) {\n      for (let j = 0; j < this.blocks[i].instances.length; j++) {\n        this.blocks[i].instances[j].class.scroll(e);\n      }\n    }\n  }\n\n  // Useful with LocomotiveScroll\n  // inView(value, way, object) {\n  //   for (let i = 0; i < this.blocks.length; i++) {\n  //     for (let j = 0; j < this.blocks[i].instances.length; j++) {\n  //       if (this.blocks[i].instances[j].el === object.el) this.blocks[i].instances[j].class.inView(value, way, object)\n  //     }\n  //   }\n  // }\n\n  loop() {\n    if (this.blocks) {\n      for (let i = 0; i < this.blocks.length; i++) {\n        for (let j = 0; j < this.blocks[i].instances.length; j++) {\n          this.blocks[i].instances[j].class.isInView && this.blocks[i].instances[j].class.update();\n        }\n      }\n    }\n  }\n}",null]}