
<script>
  document.addEventListener('DOMContentLoaded', () => {
    const settings = {"links":[{"is-hidden":1,"name":"Ch\u00e2n \u0111\u1ebf","url":"https:\/\/shopee.vn\/2-Ch%C3%A2n-%C4%90%E1%BA%BF-Laptop-Mini-C%C3%B3-Th%E1%BB%83-G%E1%BA%ADp-L%E1%BA%A1i-B%C3%A0n-Ph%C3%ADm-M%C3%A1y-T%C3%ADnh-Di-%C4%90%E1%BB%99ng-N%C3%A2ng-V%E1%BB%9Bi-2-G%C3%B3c-C%C3%B3-Th%E1%BB%83-%C4%90i%E1%BB%81u-Ch%E1%BB%89nh-Ch%C3%A2n-%C4%90%E1%BA%BF-Notebook-V%C3%B4-H%C3%AC-i.1599975350.43064048319?extraParams=%7B%22display_model_id%22%3A296158020286%2C%22model_selection_logic%22%3A3%7D","show-once":1},{"is-hidden":0,"name":"Tai nghe","url":"https:\/\/shopee.vn\/%F0%9F%94%A5Unico-A%F0%9F%94%A5Tai-Nghe-Gaming-bass-m%E1%BA%A1nh-C%C3%B3-D%C3%A2y-Nh%C3%A9t-Tai-Ch%C6%A1i-Game-Ch%E1%BB%91ng-%E1%BB%92n-C%C3%B3-Mic-In-Ear-Cho-PC-IPPlus-v%C3%A0-c%C3%A1c-d%C3%B2ng-%C4%91i%E1%BB%87n-tho%E1%BA%A1i-i.363074756.11416869736?extraParams=%7B%22display_model_id%22%3A125582720337%2C%22model_selection_logic%22%3A3%7D","show-once":0},{"is-hidden":0,"name":"D\u00e2y c\u00e1p","url":"https:\/\/shopee.vn\/-S106-D%C3%A2y-C%C3%A1p-Ngu%E1%BB%93n-Usb-5v-Sang-9v-12v-ch%C3%A2n-5-5mm-2.1mm-d%C3%B9ng-Wifi-khi-m%E1%BA%A5t-%C4%91i%E1%BB%87n-i.78218608.4768661849?extraParams=%7B%22display_model_id%22%3A167682102501%2C%22model_selection_logic%22%3A3%7D","show-once":1}],"select-link-type":"random-select-link"};

    // console.log(settings);

    document.body.classList.add('u-relative');

    const input = document.createElement('input');
    input.type = 'checkbox';
    input.classList.add('u-hidden');
    input.id = 'is-open-link';

    const sourceLinks = settings['links'];

    const updateLinkNamesOpened = (linkNamesOpened) => {
      localStorage.setItem('link-names-opened', JSON.stringify(linkNamesOpened));
    }

    const debugLinkNamesOpened = (linkNamesOpened) => {
      linkNamesOpened.forEach(link => {
        console.log('Link:', link.name, link.count, link['show-once'] === 1 ? 'Show Once' : 'Not Show Once');
      });
    }

    let linkNamesOpened = localStorage.getItem('link-names-opened');

    if (!linkNamesOpened) linkNamesOpened = [];
    else linkNamesOpened = JSON.parse(linkNamesOpened);

    sourceLinks.forEach((sourceLink, index) => {
      const foundOpenedLink = linkNamesOpened.find(openedLink =>
        openedLink.name === sourceLink.name
      );

      if (foundOpenedLink) {
        // const { url, ...rest } = sourceLink;
        const { ...rest } = sourceLink;
        linkNamesOpened[index] = { ...rest, count: foundOpenedLink.count };
      } else {
        // const { url, ...rest } = sourceLink;
        const { ...rest } = sourceLink;
        linkNamesOpened.push({ ...rest, count: 0 });
      }
    });

    updateLinkNamesOpened(linkNamesOpened);

    const unopenedAndShowOnceLinks = linkNamesOpened.filter(link =>
      link['is-hidden'] === 0 && link.count === 0 && link['show-once'] === 1
    );

    const notShowOnceLinks = linkNamesOpened.filter(link =>
      link['is-hidden'] === 0 && link['show-once'] === 0
    );

    const availableLinks = [...unopenedAndShowOnceLinks, ...notShowOnceLinks];

    if (availableLinks.length === 0) {
      input.checked = true;
    }

    // Handle clicking the link overlay.
    input.addEventListener('change', function() {
      let resultLink;

      if (settings['select-link-type'] === 'random-select-link') {
        const randomAvailableLink = availableLinks[
          Math.floor(Math.random() * availableLinks.length)
        ];

        const foundAvailableLinkInListLinkIndex = linkNamesOpened.findIndex(
          link => link.name === randomAvailableLink.name
        );

        linkNamesOpened[foundAvailableLinkInListLinkIndex].count++;

        updateLinkNamesOpened(linkNamesOpened);

        resultLink = randomAvailableLink;
      } else {
        const leastOpenedLink = availableLinks.reduce((leastOpenedLink, currentLink) => {
          return currentLink.count < leastOpenedLink.count ? currentLink : leastOpenedLink;
        }, availableLinks[0]);

        const foundLeastOpenedLinkInListLinkIndex = linkNamesOpened.findIndex(
          link => link.name === leastOpenedLink.name
        );

        linkNamesOpened[foundLeastOpenedLinkInListLinkIndex].count++;

        updateLinkNamesOpened(linkNamesOpened);

        resultLink = leastOpenedLink;
      }

      window.open(resultLink['url'], '_blank');
    });

    document.body.appendChild(input);

    const label = document.createElement('label');
    label.classList.add('u-fullscreen');
    label.setAttribute('for', 'is-open-link');

    document.body.appendChild(label);
  });
</script><?xml version="1.0" encoding="UTF-8"?>
<!-- This sitemap was dynamically generated on April 4, 2026 at 5:35 AM by All in One SEO v4.3.6.1 - the original SEO plugin for WordPress. -->

<?xml-stylesheet type="text/xsl" href="https://thanhhung.puramu.dev/default.xsl"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Civil Engineering Outsourcing and CAD Drafting Services</title>
		<link><![CDATA[https://thanhhung.puramu.dev]]></link>
		<description><![CDATA[Civil Engineering Outsourcing and CAD Drafting Services]]></description>
		<lastBuildDate><![CDATA[Tue, 27 May 2025 15:30:02 +0000]]></lastBuildDate>
		<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
		<atom:link href="https://thanhhung.puramu.dev/sitemap.rss" rel="self" type="application/rss+xml" />
		<ttl><![CDATA[60]]></ttl>

		<item>
			<guid><![CDATA[https://thanhhung.puramu.dev/contact/]]></guid>
			<link><![CDATA[https://thanhhung.puramu.dev/contact/]]></link>
			<title>Contact</title>
			<pubDate><![CDATA[Tue, 27 May 2025 15:30:02 +0000]]></pubDate>
		</item>
					<item>
			<guid><![CDATA[https://thanhhung.puramu.dev/civil-engineering/]]></guid>
			<link><![CDATA[https://thanhhung.puramu.dev/civil-engineering/]]></link>
			<title>Civil Engineering</title>
			<pubDate><![CDATA[Tue, 16 Jul 2024 10:32:42 +0000]]></pubDate>
		</item>
					<item>
			<guid><![CDATA[https://thanhhung.puramu.dev/cad-drafting/]]></guid>
			<link><![CDATA[https://thanhhung.puramu.dev/cad-drafting/]]></link>
			<title>CAD Drafting</title>
			<pubDate><![CDATA[Tue, 16 Jul 2024 10:30:12 +0000]]></pubDate>
		</item>
					<item>
			<guid><![CDATA[https://thanhhung.puramu.dev/]]></guid>
			<link><![CDATA[https://thanhhung.puramu.dev/]]></link>
			<title>Home</title>
			<pubDate><![CDATA[Tue, 16 Jul 2024 10:28:09 +0000]]></pubDate>
		</item>
					<item>
			<guid><![CDATA[https://thanhhung.puramu.dev/elementor-hf/a2zce-civil-outsourcing/]]></guid>
			<link><![CDATA[https://thanhhung.puramu.dev/elementor-hf/a2zce-civil-outsourcing/]]></link>
			<title>Footer</title>
			<pubDate><![CDATA[Tue, 15 Apr 2025 10:45:57 +0000]]></pubDate>
		</item>
					<item>
			<guid><![CDATA[https://thanhhung.puramu.dev/about/]]></guid>
			<link><![CDATA[https://thanhhung.puramu.dev/about/]]></link>
			<title>About</title>
			<pubDate><![CDATA[Mon, 16 Sep 2024 04:50:47 +0000]]></pubDate>
		</item>
					<item>
			<guid><![CDATA[https://thanhhung.puramu.dev/elementor-hf/elementor-638/]]></guid>
			<link><![CDATA[https://thanhhung.puramu.dev/elementor-hf/elementor-638/]]></link>
			<title>Header</title>
			<pubDate><![CDATA[Mon, 15 Apr 2024 11:02:04 +0000]]></pubDate>
		</item>
				</channel>
</rss>
