import * as serviceworker from '@api.global/typedserver/web_serviceworker_client';
import * as domtools from '@design.estate/dees-domtools';

import { html, render } from '@design.estate/dees-element';
import { DefaultHeader } from './elements/header.js';

export { DefaultHeader };

const run = async () => {
  const domtoolsInstance = await domtools.DomTools.setupDomTools();
  domtools.elementBasic.setup();
  domtoolsInstance.setWebsiteInfo({
    metaObject: {
      title: '{{website.title}}',
      description:
        '{{website.description}}',
      canonicalDomain: 'https://{{module.domain}}',
      ldCompany: {
        name: '{{company.name}}',
        status: 'active',
        contact: {
          address: {
            name: '{{company.name}}',
            city: '{{company.city}}',
            country: 'Germany',
            houseNumber: '{{company.houseNumber}}',
            postalCode: '{{company.postalCode}}',
            streetName: '{{company.streetName}}',
          },
          description: 'work',
          name: 'Task Venture Capital GmbH',
          type: 'company',
          facebookUrl: 'https://www.facebook.com/{{author.facebookHandle}}',
          twitterUrl: 'https://twitter.com/{{authro.twitterHandle}}',
          website: 'https://{{author.website}}',
          phone: '+49 421 16767 548',
        },
        closedDate: null,
        foundedDate: {
          day: 1,
          month: 1,
          year: 2014,
        },
      },
    },
  });

  const serviceWorker = serviceworker.getServiceWorker();

  const mainTemplate = html`
    <style>
      body {
        margin: 0px;
        --background-accent: #303f9f;
      }
    </style>
    <default-header></default-header>
  `;

  render(mainTemplate, document.body);
};

run();