MAJOR FIX - Pages were missing Header and Footer components: ✅ Added Header import to all pages ✅ Added Footer import to all pages ✅ Added <Header /> and <Footer /> components ✅ Changed custom colors to standard Tailwind (green-600, gray-*) ✅ Fixed: about-us, services, products, blog pages COLOR SCHEME: - primary-600 → green-600 (trust, growth) - secondary-900 → gray-900 (professional) - secondary-800 → gray-800 - secondary-600 → gray-600 - secondary-200 → gray-200 All pages now show proper Header navigation and Footer with links!
156 lines
18 KiB
JavaScript
156 lines
18 KiB
JavaScript
import 'piccolore';
|
|
import { N as NOOP_MIDDLEWARE_HEADER, k as decodeKey } from './chunks/astro/server_i-dTRwm2.mjs';
|
|
import 'clsx';
|
|
import 'es-module-lexer';
|
|
import 'html-escaper';
|
|
|
|
const NOOP_MIDDLEWARE_FN = async (_ctx, next) => {
|
|
const response = await next();
|
|
response.headers.set(NOOP_MIDDLEWARE_HEADER, "true");
|
|
return response;
|
|
};
|
|
|
|
const codeToStatusMap = {
|
|
// Implemented from IANA HTTP Status Code Registry
|
|
// https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
|
|
BAD_REQUEST: 400,
|
|
UNAUTHORIZED: 401,
|
|
PAYMENT_REQUIRED: 402,
|
|
FORBIDDEN: 403,
|
|
NOT_FOUND: 404,
|
|
METHOD_NOT_ALLOWED: 405,
|
|
NOT_ACCEPTABLE: 406,
|
|
PROXY_AUTHENTICATION_REQUIRED: 407,
|
|
REQUEST_TIMEOUT: 408,
|
|
CONFLICT: 409,
|
|
GONE: 410,
|
|
LENGTH_REQUIRED: 411,
|
|
PRECONDITION_FAILED: 412,
|
|
CONTENT_TOO_LARGE: 413,
|
|
URI_TOO_LONG: 414,
|
|
UNSUPPORTED_MEDIA_TYPE: 415,
|
|
RANGE_NOT_SATISFIABLE: 416,
|
|
EXPECTATION_FAILED: 417,
|
|
MISDIRECTED_REQUEST: 421,
|
|
UNPROCESSABLE_CONTENT: 422,
|
|
LOCKED: 423,
|
|
FAILED_DEPENDENCY: 424,
|
|
TOO_EARLY: 425,
|
|
UPGRADE_REQUIRED: 426,
|
|
PRECONDITION_REQUIRED: 428,
|
|
TOO_MANY_REQUESTS: 429,
|
|
REQUEST_HEADER_FIELDS_TOO_LARGE: 431,
|
|
UNAVAILABLE_FOR_LEGAL_REASONS: 451,
|
|
INTERNAL_SERVER_ERROR: 500,
|
|
NOT_IMPLEMENTED: 501,
|
|
BAD_GATEWAY: 502,
|
|
SERVICE_UNAVAILABLE: 503,
|
|
GATEWAY_TIMEOUT: 504,
|
|
HTTP_VERSION_NOT_SUPPORTED: 505,
|
|
VARIANT_ALSO_NEGOTIATES: 506,
|
|
INSUFFICIENT_STORAGE: 507,
|
|
LOOP_DETECTED: 508,
|
|
NETWORK_AUTHENTICATION_REQUIRED: 511
|
|
};
|
|
Object.entries(codeToStatusMap).reduce(
|
|
// reverse the key-value pairs
|
|
(acc, [key, value]) => ({ ...acc, [value]: key }),
|
|
{}
|
|
);
|
|
|
|
function sanitizeParams(params) {
|
|
return Object.fromEntries(
|
|
Object.entries(params).map(([key, value]) => {
|
|
if (typeof value === "string") {
|
|
return [key, value.normalize().replace(/#/g, "%23").replace(/\?/g, "%3F")];
|
|
}
|
|
return [key, value];
|
|
})
|
|
);
|
|
}
|
|
function getParameter(part, params) {
|
|
if (part.spread) {
|
|
return params[part.content.slice(3)] || "";
|
|
}
|
|
if (part.dynamic) {
|
|
if (!params[part.content]) {
|
|
throw new TypeError(`Missing parameter: ${part.content}`);
|
|
}
|
|
return params[part.content];
|
|
}
|
|
return part.content.normalize().replace(/\?/g, "%3F").replace(/#/g, "%23").replace(/%5B/g, "[").replace(/%5D/g, "]");
|
|
}
|
|
function getSegment(segment, params) {
|
|
const segmentPath = segment.map((part) => getParameter(part, params)).join("");
|
|
return segmentPath ? "/" + segmentPath : "";
|
|
}
|
|
function getRouteGenerator(segments, addTrailingSlash) {
|
|
return (params) => {
|
|
const sanitizedParams = sanitizeParams(params);
|
|
let trailing = "";
|
|
if (addTrailingSlash === "always" && segments.length) {
|
|
trailing = "/";
|
|
}
|
|
const path = segments.map((segment) => getSegment(segment, sanitizedParams)).join("") + trailing;
|
|
return path || "/";
|
|
};
|
|
}
|
|
|
|
function deserializeRouteData(rawRouteData) {
|
|
return {
|
|
route: rawRouteData.route,
|
|
type: rawRouteData.type,
|
|
pattern: new RegExp(rawRouteData.pattern),
|
|
params: rawRouteData.params,
|
|
component: rawRouteData.component,
|
|
generate: getRouteGenerator(rawRouteData.segments, rawRouteData._meta.trailingSlash),
|
|
pathname: rawRouteData.pathname || void 0,
|
|
segments: rawRouteData.segments,
|
|
prerender: rawRouteData.prerender,
|
|
redirect: rawRouteData.redirect,
|
|
redirectRoute: rawRouteData.redirectRoute ? deserializeRouteData(rawRouteData.redirectRoute) : void 0,
|
|
fallbackRoutes: rawRouteData.fallbackRoutes.map((fallback) => {
|
|
return deserializeRouteData(fallback);
|
|
}),
|
|
isIndex: rawRouteData.isIndex,
|
|
origin: rawRouteData.origin
|
|
};
|
|
}
|
|
|
|
function deserializeManifest(serializedManifest) {
|
|
const routes = [];
|
|
for (const serializedRoute of serializedManifest.routes) {
|
|
routes.push({
|
|
...serializedRoute,
|
|
routeData: deserializeRouteData(serializedRoute.routeData)
|
|
});
|
|
const route = serializedRoute;
|
|
route.routeData = deserializeRouteData(serializedRoute.routeData);
|
|
}
|
|
const assets = new Set(serializedManifest.assets);
|
|
const componentMetadata = new Map(serializedManifest.componentMetadata);
|
|
const inlinedScripts = new Map(serializedManifest.inlinedScripts);
|
|
const clientDirectives = new Map(serializedManifest.clientDirectives);
|
|
const serverIslandNameMap = new Map(serializedManifest.serverIslandNameMap);
|
|
const key = decodeKey(serializedManifest.key);
|
|
return {
|
|
// in case user middleware exists, this no-op middleware will be reassigned (see plugin-ssr.ts)
|
|
middleware() {
|
|
return { onRequest: NOOP_MIDDLEWARE_FN };
|
|
},
|
|
...serializedManifest,
|
|
assets,
|
|
componentMetadata,
|
|
inlinedScripts,
|
|
clientDirectives,
|
|
routes,
|
|
serverIslandNameMap,
|
|
key
|
|
};
|
|
}
|
|
|
|
const manifest = deserializeManifest({"hrefRoot":"file:///Users/kunthawatgreethong/Gitea/dealplustech/","cacheDir":"file:///Users/kunthawatgreethong/Gitea/dealplustech/node_modules/.astro/","outDir":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/","srcDir":"file:///Users/kunthawatgreethong/Gitea/dealplustech/src/","publicDir":"file:///Users/kunthawatgreethong/Gitea/dealplustech/public/","buildClientDir":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/client/","buildServerDir":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/server/","adapterName":"","routes":[{"file":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/about-us/index.html","links":[],"scripts":[],"styles":[],"routeData":{"route":"/about-us","isIndex":true,"type":"page","pattern":"^\\/about-us\\/?$","segments":[[{"content":"about-us","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/about-us/index.astro","pathname":"/about-us","prerender":true,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/blog/index.html","links":[],"scripts":[],"styles":[],"routeData":{"route":"/blog","isIndex":true,"type":"page","pattern":"^\\/blog\\/?$","segments":[[{"content":"blog","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/blog/index.astro","pathname":"/blog","prerender":true,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/cookie-policy/index.html","links":[],"scripts":[],"styles":[],"routeData":{"route":"/cookie-policy","isIndex":false,"type":"page","pattern":"^\\/cookie-policy\\/?$","segments":[[{"content":"cookie-policy","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/cookie-policy.astro","pathname":"/cookie-policy","prerender":true,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/privacy-policy/index.html","links":[],"scripts":[],"styles":[],"routeData":{"route":"/privacy-policy","isIndex":false,"type":"page","pattern":"^\\/privacy-policy\\/?$","segments":[[{"content":"privacy-policy","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/privacy-policy.astro","pathname":"/privacy-policy","prerender":true,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/products/index.html","links":[],"scripts":[],"styles":[],"routeData":{"route":"/products","isIndex":true,"type":"page","pattern":"^\\/products\\/?$","segments":[[{"content":"products","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/products/index.astro","pathname":"/products","prerender":true,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/services/index.html","links":[],"scripts":[],"styles":[],"routeData":{"route":"/services","isIndex":true,"type":"page","pattern":"^\\/services\\/?$","segments":[[{"content":"services","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/services/index.astro","pathname":"/services","prerender":true,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/terms-and-conditions/index.html","links":[],"scripts":[],"styles":[],"routeData":{"route":"/terms-and-conditions","isIndex":false,"type":"page","pattern":"^\\/terms-and-conditions\\/?$","segments":[[{"content":"terms-and-conditions","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/terms-and-conditions.astro","pathname":"/terms-and-conditions","prerender":true,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/index.html","links":[],"scripts":[],"styles":[],"routeData":{"route":"/","isIndex":true,"type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":true,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}}],"base":"/","trailingSlash":"ignore","compressHTML":true,"componentMetadata":[["\u0000astro:content",{"propagation":"in-tree","containsHead":false}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/blog/[slug].astro",{"propagation":"in-tree","containsHead":true}],["\u0000@astro-page:src/pages/blog/[slug]@_@astro",{"propagation":"in-tree","containsHead":false}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/blog/index.astro",{"propagation":"in-tree","containsHead":true}],["\u0000@astro-page:src/pages/blog/index@_@astro",{"propagation":"in-tree","containsHead":false}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/about-us/index.astro",{"propagation":"none","containsHead":true}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/cookie-policy.astro",{"propagation":"none","containsHead":true}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/index.astro",{"propagation":"none","containsHead":true}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/privacy-policy.astro",{"propagation":"none","containsHead":true}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/products/index.astro",{"propagation":"none","containsHead":true}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/services/index.astro",{"propagation":"none","containsHead":true}],["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/terms-and-conditions.astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var l=(n,t)=>{let i=async()=>{await(await n())()},e=typeof t.value==\"object\"?t.value:void 0,s={timeout:e==null?void 0:e.timeout};\"requestIdleCallback\"in window?window.requestIdleCallback(i,s):setTimeout(i,s.timeout||200)};(self.Astro||(self.Astro={})).idle=l;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var n=(a,t)=>{let i=async()=>{await(await a())()};if(t.value){let e=matchMedia(t.value);e.matches?i():e.addEventListener(\"change\",i,{once:!0})}};(self.Astro||(self.Astro={})).media=n;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var a=(s,i,o)=>{let r=async()=>{await(await s())()},t=typeof i.value==\"object\"?i.value:void 0,c={rootMargin:t==null?void 0:t.rootMargin},n=new IntersectionObserver(e=>{for(let l of e)if(l.isIntersecting){n.disconnect(),r();break}},c);for(let e of o.children)n.observe(e)};(self.Astro||(self.Astro={})).visible=a;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000noop-middleware":"_noop-middleware.mjs","\u0000virtual:astro:actions/noop-entrypoint":"noop-entrypoint.mjs","\u0000@astro-page:src/pages/about-us/index@_@astro":"pages/about-us.astro.mjs","\u0000@astro-page:src/pages/blog/[slug]@_@astro":"pages/blog/_slug_.astro.mjs","\u0000@astro-page:src/pages/blog/index@_@astro":"pages/blog.astro.mjs","\u0000@astro-page:src/pages/cookie-policy@_@astro":"pages/cookie-policy.astro.mjs","\u0000@astro-page:src/pages/privacy-policy@_@astro":"pages/privacy-policy.astro.mjs","\u0000@astro-page:src/pages/products/index@_@astro":"pages/products.astro.mjs","\u0000@astro-page:src/pages/services/index@_@astro":"pages/services.astro.mjs","\u0000@astro-page:src/pages/terms-and-conditions@_@astro":"pages/terms-and-conditions.astro.mjs","\u0000@astro-page:src/pages/index@_@astro":"pages/index.astro.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000@astrojs-manifest":"manifest_Cbx7IQvp.mjs","/Users/kunthawatgreethong/Gitea/dealplustech/.astro/content-assets.mjs":"chunks/content-assets_DleWbedO.mjs","/Users/kunthawatgreethong/Gitea/dealplustech/.astro/content-modules.mjs":"chunks/content-modules_Dz-S_Wwv.mjs","\u0000astro:data-layer-content":"chunks/_astro_data-layer-content_BioYrs-L.mjs","/Users/kunthawatgreethong/Gitea/dealplustech/node_modules/astro/dist/assets/services/sharp.js":"chunks/sharp_DEdYiB4E.mjs","/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/cookie-policy.astro?astro&type=script&index=0&lang.ts":"_astro/cookie-policy.astro_astro_type_script_index_0_lang.BkVFWQnL.js","/Users/kunthawatgreethong/Gitea/dealplustech/src/layouts/BaseLayout.astro?astro&type=script&index=0&lang.ts":"_astro/BaseLayout.astro_astro_type_script_index_0_lang.BxCzM0lH.js","/Users/kunthawatgreethong/Gitea/dealplustech/src/components/Header.astro?astro&type=script&index=0&lang.ts":"_astro/Header.astro_astro_type_script_index_0_lang.DgkU4xKA.js","astro:scripts/before-hydration.js":""},"inlinedScripts":[["/Users/kunthawatgreethong/Gitea/dealplustech/src/pages/cookie-policy.astro?astro&type=script&index=0&lang.ts","document.getElementById(\"openPreferences\")?.addEventListener(\"click\",e=>{e.preventDefault(),window.dispatchEvent(new CustomEvent(\"open-cookie-preferences\"))});"],["/Users/kunthawatgreethong/Gitea/dealplustech/src/layouts/BaseLayout.astro?astro&type=script&index=0&lang.ts","const t=JSON.parse(localStorage.getItem(\"consent-preferences\")||\"null\");if(!t){const e=document.createElement(\"div\");e.id=\"cookie-banner\",e.className=\"fixed bottom-0 left-0 right-0 bg-secondary-900 text-white p-6 z-50 shadow-lg\",e.innerHTML=`\n <div class=\"container mx-auto max-w-4xl\">\n <p class=\"text-lg mb-4\">เราใช้คุกกี้เพื่อปรับปรุงประสบการณ์การใช้งานเว็บไซต์ โดยคลิกยอมรับเพื่อใช้งานคุกกี้ทุกประเภท หรือคลิกปรับแต่งเพื่อเลือกคุกกี้ที่ต้องการ</p>\n <div class=\"flex flex-wrap gap-3\">\n <button id=\"accept-all\" class=\"px-6 py-2 bg-primary-600 text-white font-semibold rounded-md hover:bg-primary-700\">ยอมรับ</button>\n <button id=\"reject-all\" class=\"px-6 py-2 bg-secondary-700 text-white font-semibold rounded-md hover:bg-secondary-600\">ปฏิเสธ</button>\n <button id=\"customize\" class=\"px-6 py-2 border border-white text-white font-semibold rounded-md hover:bg-white hover:text-secondary-900\">ปรับแต่ง</button>\n </div>\n </div>\n `,document.body.appendChild(e),document.getElementById(\"accept-all\")?.addEventListener(\"click\",()=>{localStorage.setItem(\"consent-preferences\",JSON.stringify({essential:!0,analytics:!0,marketing:!0,timestamp:new Date().toISOString()})),e.remove()}),document.getElementById(\"reject-all\")?.addEventListener(\"click\",()=>{localStorage.setItem(\"consent-preferences\",JSON.stringify({essential:!0,analytics:!1,marketing:!1,timestamp:new Date().toISOString()})),e.remove()}),document.getElementById(\"customize\")?.addEventListener(\"click\",()=>{localStorage.setItem(\"consent-preferences\",JSON.stringify({essential:!0,analytics:!1,marketing:!1,timestamp:new Date().toISOString()})),e.remove()})}"],["/Users/kunthawatgreethong/Gitea/dealplustech/src/components/Header.astro?astro&type=script&index=0&lang.ts","const e=document.getElementById(\"mobile-menu-button\"),o=document.getElementById(\"mobile-menu\");let n=!1;e?.addEventListener(\"click\",()=>{n=!n,n?(o?.classList.remove(\"hidden\"),e.innerHTML=`\n <svg class=\"w-6 h-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n `):(o?.classList.add(\"hidden\"),e.innerHTML=`\n <svg class=\"w-6 h-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width={2} d=\"M4 6h16M4 12h16M4 18h16\" />\n </svg>\n `)});document.querySelectorAll(\".mobile-link\").forEach(t=>{t.addEventListener(\"click\",()=>{n=!1,o?.classList.add(\"hidden\"),e.innerHTML=`\n <svg class=\"w-6 h-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width={2} d=\"M4 6h16M4 12h16M4 18h16\" />\n </svg>\n `})});"]],"assets":["/file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/about-us/index.html","/file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/blog/index.html","/file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/cookie-policy/index.html","/file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/privacy-policy/index.html","/file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/products/index.html","/file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/services/index.html","/file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/terms-and-conditions/index.html","/file:///Users/kunthawatgreethong/Gitea/dealplustech/dist/index.html"],"buildFormat":"directory","checkOrigin":false,"allowedDomains":[],"actionBodySizeLimit":1048576,"serverIslandNameMap":[],"key":"KlWZjqdLOqh/p56Gwiv4DWcH22i/VJ/yaPhM3Etf8Mw="});
|
|
if (manifest.sessionConfig) manifest.sessionConfig.driverModule = null;
|
|
|
|
export { manifest };
|