﻿
(() => {
    const __ds_ns = (window.IMANIFESTDesignSystem_b05d13 = window.IMANIFESTDesignSystem_b05d13 || {});
    const __ds_scope = {};
    (__ds_ns.__errors = __ds_ns.__errors || []);

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        const MODULE_FILES = {
            wordmark: ['imanifest_logo_light.svg', 7.93],
            ams: ['imanifest_ams_light.svg', 7.08],
            'ams-modern': ['imanifest_ams_modern_light.svg', 10.65],
            isf: ['imanifest_isf_light.svg', 6.54],
            aci: ['imanifest_aci_light.svg', 6.65],
            emanifest: ['imanifest_aci_emanifest_light.svg', 11.15],
            inbond: ['imanifest_inbond_light.svg', 8.46],
            aes: ['imanifest_aes_light.svg', 6.88],
        };

        /**
         * iMANIFEST brand lockup. Renders the delivered artwork (never typeset).
         *
         * variant="wordmark" → the iMANIFEST™ wordmark.
         * variant="module"   → the "iMANIFEST / <MODULE>" lockup selected by `module`.
         */
        function Logo({
            variant = 'wordmark',
            module = 'ams',
            height = 24,
            basePath = '/Content/New_Index',
            alt,
            className = '',
            style = {},
            ...rest
        }) {
            const key = variant === 'module' ? module : 'wordmark';
            const [file] = MODULE_FILES[key] || MODULE_FILES.wordmark;
            const R = typeof window !== 'undefined' && window.__DS_ASSET ? window.__DS_ASSET : x => x;
            const label = alt || (variant === 'module' ? `iMANIFEST / ${module}` : 'iMANIFEST');
            const imgStyle = {
                height,
                width: 'auto',
                display: 'block'
            };
            return React.createElement("span", _extends({
                className: className,
                style: {
                    display: 'inline-flex',
                    alignItems: 'center',
                    lineHeight: 0,
                    ...style
                }
            }, rest), React.createElement("img", {
                src: R(`${basePath}/${file}`),
                alt: label,
                style: imgStyle
            }));
        }
        Object.assign(__ds_scope, { Logo });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        const TONES = {
            new: {
                bg: 'var(--brand-soft)',
                color: 'var(--brand)',
                border: 'var(--brand-border)'
            },
            info: {
                bg: 'var(--info-soft)',
                color: 'var(--info-500)',
                border: 'rgba(52,84,209,0.32)'
            },
            success: {
                bg: 'var(--success-soft)',
                color: 'var(--success-500)',
                border: 'var(--brand-border)'
            },
            warning: {
                bg: 'var(--warning-soft)',
                color: 'var(--warning-500)',
                border: 'rgba(183,121,31,0.35)'
            },
            danger: {
                bg: 'var(--danger-soft)',
                color: 'var(--danger-500)',
                border: 'rgba(207,44,38,0.35)'
            },
            neutral: {
                bg: 'var(--surface-inset)',
                color: 'var(--text-mid)',
                border: 'var(--divider)'
            }
        };

        /**
         * Small status pill. Default tone "new" is the brand-green "New" marker
         * used on the portal's newly-launched modules.
         */
        function Badge({
            tone = 'new',
            children = 'New',
            style = {},
            ...rest
        }) {
            const t = TONES[tone] || TONES.neutral;
            return React.createElement("span", _extends({
                style: {
                    display: 'inline-flex',
                    alignItems: 'center',
                    fontFamily: 'var(--font-sans)',
                    fontSize: '9.5px',
                    fontWeight: 'var(--weight-bold)',
                    letterSpacing: 'var(--tracking-wide)',
                    textTransform: 'uppercase',
                    color: t.color,
                    background: t.bg,
                    border: `1px solid ${t.border}`,
                    padding: '2px 7px',
                    borderRadius: 'var(--radius-pill)',
                    ...style
                }
            }, rest), children);
        }
        Object.assign(__ds_scope, { Badge });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        /**
         * Primary action button. Brand-green filled by default, with calm
         * secondary / ghost / danger variants for the filing consoles.
         */
        function Button({
            variant = 'brand',
            size = 'md',
            block = false,
            disabled = false,
            iconLeft = null,
            iconRight = null,
            children,
            style = {},
            ...rest
        }) {
            const sizes = {
                sm: {
                    padding: '0 12px',
                    height: 32,
                    fontSize: 'var(--text-sm)',
                    gap: 6
                },
                md: {
                    padding: '0 16px',
                    height: 38,
                    fontSize: 'var(--text-md)',
                    gap: 8
                },
                lg: {
                    padding: '0 22px',
                    height: 44,
                    fontSize: 'var(--text-base)',
                    gap: 8
                }
            }[size];
            const variants = {
                brand: {
                    background: 'var(--brand-solid)',
                    color: 'var(--brand-contrast)',
                    border: '1px solid transparent'
                },
                secondary: {
                    background: 'var(--surface-solid)',
                    color: 'var(--text-hi)',
                    border: '1px solid var(--border-strong)'
                },
                ghost: {
                    background: 'transparent',
                    color: 'var(--text-mid)',
                    border: '1px solid transparent'
                },
                danger: {
                    background: 'var(--danger-soft)',
                    color: 'var(--danger-500)',
                    border: '1px solid var(--danger-500)'
                }
            }[variant];
            return React.createElement("button", _extends({
                disabled: disabled,
                style: {
                    display: block ? 'flex' : 'inline-flex',
                    width: block ? '100%' : undefined,
                    alignItems: 'center',
                    justifyContent: 'center',
                    gap: sizes.gap,
                    height: sizes.height,
                    padding: sizes.padding,
                    fontFamily: 'var(--font-sans)',
                    fontSize: sizes.fontSize,
                    fontWeight: 'var(--weight-semibold)',
                    letterSpacing: '0.01em',
                    borderRadius: 'var(--radius-md)',
                    cursor: disabled ? 'not-allowed' : 'pointer',
                    opacity: disabled ? 0.5 : 1,
                    transition: 'background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), filter var(--dur-fast) var(--ease-standard)',
                    ...variants,
                    ...style
                },
                onMouseEnter: e => {
                    if (!disabled) e.currentTarget.style.filter = 'brightness(0.94)';
                },
                onMouseLeave: e => {
                    e.currentTarget.style.filter = 'none';
                }
            }, rest), iconLeft, children, iconRight);
        }
        Object.assign(__ds_scope, { Button });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        /**
         * Uppercase, wide-tracked label — the brand's signature "eyebrow" used
         * above titles and as system tags. tone: brand | muted.
         */
        function Eyebrow({
            tone = 'brand',
            as = 'div',
            children,
            style = {},
            ...rest
        }) {
            const Tag = as;
            return React.createElement(Tag, _extends({
                style: {
                    fontFamily: 'var(--font-sans)',
                    fontSize: 'var(--type-eyebrow-size)',
                    fontWeight: 'var(--type-eyebrow-weight)',
                    letterSpacing: 'var(--type-eyebrow-tracking)',
                    textTransform: 'uppercase',
                    color: tone === 'brand' ? 'var(--brand)' : 'var(--text-lo)',
                    ...style
                }
            }, rest), children);
        }
        Object.assign(__ds_scope, { Eyebrow });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        const REGIONS = {
            usa: {
                label: 'US',
                bg: 'var(--flag-usa-bg)',
                color: 'var(--flag-usa-text)'
            },
            kor: {
                label: 'KR',
                bg: 'var(--flag-kor-bg)',
                color: 'var(--flag-kor-text)'
            }
        };

        /**
         * Region chip used in the portal to mark a filing site's country
         * (US / Korea). Renders the two-letter region code, not a national flag.
         */
        function FlagChip({
            region = 'usa',
            style = {},
            ...rest
        }) {
            const r = REGIONS[region] || REGIONS.usa;
            return React.createElement("span", _extends({
                style: {
                    minWidth: 34,
                    height: 24,
                    flex: '0 0 auto',
                    padding: '0 8px',
                    display: 'inline-flex',
                    alignItems: 'center',
                    justifyContent: 'center',
                    borderRadius: 7,
                    fontFamily: 'var(--font-sans)',
                    fontSize: '12px',
                    fontWeight: 500,
                    letterSpacing: '0.05em',
                    background: r.bg,
                    color: r.color,
                    transition: 'background var(--dur-mid) var(--ease-standard), color var(--dur-mid) var(--ease-standard)',
                    ...style
                }
            }, rest), r.label);
        }
        Object.assign(__ds_scope, { FlagChip });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        /** Circular national flag icons from the Circle Flags library (hatscripts). */
        const FLAG_URLS = {
            usa: 'https://hatscripts.github.io/circle-flags/flags/us.svg',
            kor: 'https://hatscripts.github.io/circle-flags/flags/kr.svg'
        };

        /**
         * Circular national flag icon. region="usa" | "kor". Loads a purpose-built
         * circular SVG from the Circle Flags library (no distortion). Site-header
         * emblem; not a brand asset.
         */
        function FlagIcon({
            region = 'usa',
            size = 18,
            style = {},
            ...rest
        }) {
            const src = FLAG_URLS[region] || FLAG_URLS.usa;
            return React.createElement("img", _extends({
                src: src,
                width: size,
                height: size,
                alt: region === 'usa' ? 'United States' : 'South Korea',
                style: {
                    display: 'block',
                    flex: '0 0 auto',
                    width: size,
                    height: size,
                    borderRadius: '50%',
                    ...style
                }
            }, rest));
        }
        Object.assign(__ds_scope, { FLAG_URLS, FlagIcon });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        /**
         * Floating glass panel — the primary content container that sits over the
         * page gradient. variant="glass" (blurred translucent) or "solid".
         */
        function Panel({
            variant = 'glass',
            padding = 44,
            children,
            style = {},
            ...rest
        }) {
            const glass = variant === 'glass';
            return React.createElement("div", _extends({
                style: {
                    background: glass ? 'var(--surface-glass)' : 'var(--surface-solid)',
                    border: `1px solid ${glass ? 'var(--border-glass)' : 'var(--border-subtle)'}`,
                    borderRadius: 'var(--radius-xl)',
                    padding,
                    boxShadow: 'var(--shadow-panel)',
                    backdropFilter: glass ? 'blur(var(--blur-panel))' : undefined,
                    WebkitBackdropFilter: glass ? 'blur(var(--blur-panel))' : undefined,
                    transition: 'background var(--dur-mid) var(--ease-standard), border-color var(--dur-mid) var(--ease-standard)',
                    ...style
                }
            }, rest), children);
        }
        Object.assign(__ds_scope, { Panel });
    })();

    (() => {
        /**
         * Built-in abstract "bright architecture" backgrounds, expressed with theme
         * tokens so they adapt to light/dark automatically. Used as a placeholder
         * pool until real photos are supplied via the `images` prop.
         */
        const BACKGROUND_PRESETS = [
            // bright atrium light wash
            'radial-gradient(1300px 950px at 72% -12%, var(--surface-page-0) 0%, transparent 62%), linear-gradient(155deg, var(--surface-page-1) 0%, var(--surface-page-2) 100%)',
            // curved facade with brand light
            'radial-gradient(1000px 1300px at 92% 45%, var(--brand-soft), transparent 60%), radial-gradient(1100px 820px at 18% -12%, var(--surface-page-0), transparent 56%), linear-gradient(150deg, var(--surface-page-1), var(--surface-page-2))',
            // glass-dome soft skylight
            'radial-gradient(760px 760px at 78% 12%, var(--surface-page-0) 0%, transparent 64%), radial-gradient(900px 620px at 8% 92%, var(--surface-page-1), transparent 60%), linear-gradient(120deg, var(--surface-page-1), var(--surface-page-2))',
            // diagonal skylight beam
            'radial-gradient(1300px 520px at 60% -4%, var(--surface-tint), transparent 62%), linear-gradient(115deg, var(--surface-page-0) 0%, var(--surface-page-1) 46%, var(--surface-page-2) 100%)'];

        /**
         * Full-bleed background layer that picks ONE image at random on each load.
         * Supply `images` (an array of photo URLs — e.g. minimal modern architecture)
         * to use real photos; when empty it falls back to the token-driven
         * BACKGROUND_PRESETS pool so it still varies on refresh.
         *
         * `overlay="left"` lays a readability scrim fading from the left so a panel
         * placed over the left half stays legible. Generic across products.
         */
        function RandomBackground({
            images = [],
            overlay = 'left',
            seed,
            zIndex = 0,
            noise = true,
            positions = [],
            children
        }) {
            const pool = images.length ? images : BACKGROUND_PRESETS;
            const [idx] = React.useState(() => {
                if (seed != null) return (seed % pool.length + pool.length) % pool.length;
                if (pool.length <= 1) return 0;
                try {
                    const key = 'imanifest-last-bg';
                    const raw = sessionStorage.getItem(key);
                    const last = raw != null ? parseInt(raw, 10) : -1;
                    const candidates = [];
                    for (let i = 0; i < pool.length; i++) if (i !== last) candidates.push(i);
                    const picked = candidates[Math.floor(Math.random() * candidates.length)];
                    sessionStorage.setItem(key, String(picked));
                    return picked;
                } catch (e) {
                    return Math.floor(Math.random() * pool.length);
                }
            });
            // If a real photo fails to load (e.g. bg files not added yet), fall back to a preset.
            const [failed, setFailed] = React.useState(false);
            const [presetIdx] = React.useState(() => Math.floor(Math.random() * BACKGROUND_PRESETS.length));
            const useImage = images.length > 0 && !failed;
            React.useEffect(() => {
                if (!images.length) return;
                const im = new Image();
                im.onerror = () => setFailed(true);
                im.src = pool[idx];
            }, [images.length, pool, idx]);
            const bgStyle = useImage ? {
                backgroundImage: `url("${pool[idx]}")`,
                backgroundSize: 'cover',
                backgroundPosition: positions[idx] || 'center'
            } : {
                background: BACKGROUND_PRESETS[presetIdx]
            };
            const scrim = {
                left: 'linear-gradient(100deg, color-mix(in srgb, var(--surface-page-0) 90%, transparent) 0%, color-mix(in srgb, var(--surface-page-0) 66%, transparent) 40%, color-mix(in srgb, var(--surface-page-0) 12%, transparent) 74%, transparent 100%)',
                full: 'linear-gradient(0deg, color-mix(in srgb, var(--surface-page-0) 72%, transparent), color-mix(in srgb, var(--surface-page-0) 52%, transparent))',
                none: 'none'
            }[overlay] || 'none';
            return React.createElement(React.Fragment, null, React.createElement("div", {
                "aria-hidden": "true",
                style: {
                    position: 'fixed',
                    inset: 0,
                    zIndex,
                    ...bgStyle
                }
            }), noise && React.createElement("div", {
                "aria-hidden": "true",
                style: {
                    position: 'fixed',
                    inset: 0,
                    zIndex: zIndex + 1,
                    pointerEvents: 'none',
                    opacity: 0.5,
                    backgroundImage: "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E\")"
                }
            }), overlay !== 'none' && React.createElement("div", {
                "aria-hidden": "true",
                style: {
                    position: 'fixed',
                    inset: 0,
                    zIndex: zIndex + 2,
                    pointerEvents: 'none',
                    background: scrim
                }
            }), children);
        }
        Object.assign(__ds_scope, { BACKGROUND_PRESETS, RandomBackground });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        /**
         * Small uppercase, wide-tracked tagline — the product/system descriptor
         * shown top-right (e.g. "GLOBAL MANIFEST / SECURITY FILING"). Generic across
         * products.
         */
        function Tagline({
            children,
            tone = 'muted',
            style = {},
            ...rest
        }) {
            return React.createElement("span", _extends({
                style: {
                    fontFamily: 'var(--font-sans)',
                    fontSize: 'var(--text-xs)',
                    fontWeight: 'var(--weight-medium)',
                    letterSpacing: 'var(--tracking-widest)',
                    textTransform: 'uppercase',
                    color: tone === 'brand' ? 'var(--brand)' : 'var(--text-lo)',
                    ...style
                }
            }, rest), children);
        }
        Object.assign(__ds_scope, { Tagline });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        /** Module metadata: display code, description, artwork file stem, Phosphor icon, New flag. */
        const AMS_MODERN_SVG = '<svg width="19" height="19" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M25 28H7C6.73478 28 6.48043 27.8946 6.29289 27.7071C6.10536 27.5196 6 27.2652 6 27V5C6 4.73478 6.10536 4.48043 6.29289 4.29289C6.48043 4.10536 6.73478 4 7 4H19L26 11V27C26 27.2652 25.8946 27.5196 25.7071 27.7071C25.5196 27.8946 25.2652 28 25 28Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M19 4V11H26" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.1668 20.2332L10.7236 18.9644C10.6287 18.9293 10.5468 18.866 10.4889 18.783C10.431 18.7 10.4 18.6012 10.4 18.5C10.4 18.3988 10.431 18.3 10.4889 18.217C10.5468 18.134 10.6287 18.0707 10.7236 18.0356L14.1668 16.7668L15.4356 13.3236C15.4707 13.2287 15.534 13.1467 15.617 13.0889C15.7 13.031 15.7988 13 15.9 13C16.0012 13 16.1 13.031 16.183 13.0889C16.2661 13.1467 16.3294 13.2287 16.3644 13.3236L17.6332 16.7668L21.0764 18.0356C21.1714 18.0707 21.2533 18.134 21.3111 18.217C21.369 18.3 21.4 18.3988 21.4 18.5C21.4 18.6012 21.369 18.7 21.3111 18.783C21.2533 18.866 21.1714 18.9293 21.0764 18.9644L17.6332 20.2332L16.3644 23.6764C16.3294 23.7713 16.2661 23.8533 16.183 23.9111C16.1 23.969 16.0012 24 15.9 24C15.7988 24 15.7 23.969 15.617 23.9111C15.534 23.8533 15.4707 23.7713 15.4356 23.6764L14.1668 20.2332Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>';
        /* Single source of truth for module-icon fills — change here to reflavor all 7 icons. */
        const BRAND_GREEN = '#43b02a';
        const recolorArt = (s) => s.split('#58B531').join(BRAND_GREEN).split('#58b531').join(BRAND_GREEN).split('#3F8F22').join('#2a8813').split('#3f8f22').join('#2a8813');
        const ART_AMS = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"8\" width=\"32\" height=\"32\" rx=\"6\" fill=\"#43B02A\"></rect><rect x=\"13\" y=\"13\" width=\"22\" height=\"22\" rx=\"3\" fill=\"white\"></rect><path d=\"M30.023 20.7895L26.0855 16.852C26.0332 16.7998 25.9711 16.7584 25.9029 16.7302C25.8346 16.7019 25.7614 16.6874 25.6875 16.6875H18.9375C18.6391 16.6875 18.353 16.806 18.142 17.017C17.931 17.228 17.8125 17.5141 17.8125 17.8125V30.1875C17.8125 30.4859 17.931 30.772 18.142 30.983C18.353 31.194 18.6391 31.3125 18.9375 31.3125H29.0625C29.3609 31.3125 29.647 31.194 29.858 30.983C30.069 30.772 30.1875 30.4859 30.1875 30.1875V21.1875C30.1876 21.1136 30.1731 21.0404 30.1448 20.9722C30.1166 20.9039 30.0752 20.8418 30.023 20.7895ZM26.25 27.375H21.75C21.6008 27.375 21.4577 27.3157 21.3523 27.2103C21.2468 27.1048 21.1875 26.9617 21.1875 26.8125C21.1875 26.6633 21.2468 26.5202 21.3523 26.4148C21.4577 26.3093 21.6008 26.25 21.75 26.25H26.25C26.3992 26.25 26.5423 26.3093 26.6477 26.4148C26.7532 26.5202 26.8125 26.6633 26.8125 26.8125C26.8125 26.9617 26.7532 27.1048 26.6477 27.2103C26.5423 27.3157 26.3992 27.375 26.25 27.375ZM26.25 25.125H21.75C21.6008 25.125 21.4577 25.0657 21.3523 24.9603C21.2468 24.8548 21.1875 24.7117 21.1875 24.5625C21.1875 24.4133 21.2468 24.2702 21.3523 24.1648C21.4577 24.0593 21.6008 24 21.75 24H26.25C26.3992 24 26.5423 24.0593 26.6477 24.1648C26.7532 24.2702 26.8125 24.4133 26.8125 24.5625C26.8125 24.7117 26.7532 24.8548 26.6477 24.9603C26.5423 25.0657 26.3992 25.125 26.25 25.125ZM25.6875 21.1875V18.0938L28.7812 21.1875H25.6875Z\" fill=\"#43B02A\"></path></svg>";
        const ART_AMS_MODERN = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"8\" width=\"32\" height=\"32\" rx=\"6\" fill=\"#43B02A\"></rect><rect x=\"13\" y=\"13\" width=\"22\" height=\"22\" rx=\"3\" fill=\"white\"></rect><path d=\"M30.023 20.7895L26.0855 16.852C26.0332 16.7998 25.9711 16.7584 25.9029 16.7302C25.8346 16.7019 25.7614 16.6874 25.6875 16.6875H18.9375C18.6391 16.6875 18.353 16.806 18.142 17.017C17.931 17.228 17.8125 17.5141 17.8125 17.8125V30.1875C17.8125 30.4859 17.931 30.772 18.142 30.983C18.353 31.194 18.6391 31.3125 18.9375 31.3125H29.0625C29.3609 31.3125 29.647 31.194 29.858 30.983C30.069 30.772 30.1875 30.4859 30.1875 30.1875V21.1875C30.1876 21.1136 30.1731 21.0404 30.1448 20.9721C30.1166 20.9039 30.0752 20.8418 30.023 20.7895ZM25.6875 21.1875V18.0938L28.7812 21.1875H25.6875Z\" fill=\"#43B02A\"></path>\n<path d=\"M27 25C27.0006 25.1019 26.9696 25.2015 26.9113 25.285C26.853 25.3686 26.7703 25.4321 26.6744 25.4667L25.0629 26.062L24.4693 27.6745C24.4341 27.77 24.3705 27.8524 24.287 27.9106C24.2036 27.9688 24.1043 28 24.0025 28C23.9007 28 23.8014 27.9688 23.7179 27.9106C23.6345 27.8524 23.5709 27.77 23.5357 27.6745L22.9384 26.062L21.3256 25.4686C21.2301 25.4334 21.1477 25.3698 21.0894 25.2864C21.0312 25.2029 21 25.1036 21 25.0019C21 24.9001 21.0312 24.8008 21.0894 24.7174C21.1477 24.6339 21.2301 24.5703 21.3256 24.5352L22.9384 23.9379L23.532 22.3255C23.5671 22.23 23.6307 22.1476 23.7142 22.0894C23.7977 22.0312 23.897 22 23.9987 22C24.1005 22 24.1998 22.0312 24.2833 22.0894C24.3668 22.1476 24.4304 22.23 24.4655 22.3255L25.0629 23.9379L26.6757 24.5314C26.7716 24.5664 26.8543 24.6302 26.9124 24.7141C26.9705 24.7981 27.0011 24.8979 27 25Z\" fill=\"white\"></path></svg>";
        const ART_ISF = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"8\" width=\"32\" height=\"32\" rx=\"6\" fill=\"#43B02A\"></rect><rect x=\"13\" y=\"13\" width=\"22\" height=\"22\" rx=\"3\" fill=\"white\"></rect><path d=\"M29.625 17.8125H18.375C18.0766 17.8125 17.7905 17.931 17.5795 18.142C17.3685 18.353 17.25 18.6391 17.25 18.9375V22.875C17.25 26.5819 19.0444 28.8284 20.5498 30.0602C22.1712 31.3863 23.7841 31.8363 23.8545 31.8553C23.9511 31.8816 24.0531 31.8816 24.1498 31.8553C24.2201 31.8363 25.8309 31.3863 27.4545 30.0602C28.9556 28.8284 30.75 26.5819 30.75 22.875V18.9375C30.75 18.6391 30.6315 18.353 30.4205 18.142C30.2095 17.931 29.9234 17.8125 29.625 17.8125ZM27.2119 22.7105L23.2744 26.648C23.2221 26.7003 23.1601 26.7418 23.0918 26.7701C23.0235 26.7984 22.9503 26.8129 22.8764 26.8129C22.8025 26.8129 22.7293 26.7984 22.661 26.7701C22.5927 26.7418 22.5307 26.7003 22.4784 26.648L20.7909 24.9605C20.6854 24.8549 20.6261 24.7118 20.6261 24.5625C20.6261 24.4132 20.6854 24.2701 20.7909 24.1645C20.8965 24.059 21.0396 23.9997 21.1889 23.9997C21.3382 23.9997 21.4813 24.059 21.5869 24.1645L22.875 25.4548L26.4145 21.9145C26.4668 21.8623 26.5288 21.8208 26.5971 21.7925C26.6654 21.7642 26.7386 21.7497 26.8125 21.7497C26.8864 21.7497 26.9596 21.7642 27.0279 21.7925C27.0962 21.8208 27.1582 21.8623 27.2105 21.9145C27.2627 21.9668 27.3042 22.0288 27.3325 22.0971C27.3608 22.1654 27.3753 22.2386 27.3753 22.3125C27.3753 22.3864 27.3608 22.4596 27.3325 22.5279C27.3042 22.5962 27.2627 22.6582 27.2105 22.7105H27.2119Z\" fill=\"#43B02A\"></path></svg>";
        const ART_ACI = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"8\" width=\"32\" height=\"32\" rx=\"6\" fill=\"#43B02A\"></rect><rect x=\"13\" y=\"13\" width=\"22\" height=\"22\" rx=\"3\" fill=\"white\"></rect><path d=\"M29.0625 17.25H26.513C26.1969 16.8961 25.8097 16.613 25.3766 16.4192C24.9436 16.2253 24.4745 16.1251 24 16.1251C23.5255 16.1251 23.0564 16.2253 22.6234 16.4192C22.1903 16.613 21.8031 16.8961 21.487 17.25H18.9375C18.6391 17.25 18.353 17.3685 18.142 17.5795C17.931 17.7905 17.8125 18.0766 17.8125 18.375V30.1875C17.8125 30.4859 17.931 30.772 18.142 30.983C18.353 31.194 18.6391 31.3125 18.9375 31.3125H29.0625C29.3609 31.3125 29.647 31.194 29.858 30.983C30.069 30.772 30.1875 30.4859 30.1875 30.1875V18.375C30.1875 18.0766 30.069 17.7905 29.858 17.5795C29.647 17.3685 29.3609 17.25 29.0625 17.25ZM24 17.25C24.5967 17.25 25.169 17.4871 25.591 17.909C26.0129 18.331 26.25 18.9033 26.25 19.5H21.75C21.75 18.9033 21.9871 18.331 22.409 17.909C22.831 17.4871 23.4033 17.25 24 17.25ZM26.25 26.25H21.75C21.6008 26.25 21.4577 26.1907 21.3523 26.0852C21.2468 25.9798 21.1875 25.8367 21.1875 25.6875C21.1875 25.5383 21.2468 25.3952 21.3523 25.2898C21.4577 25.1843 21.6008 25.125 21.75 25.125H26.25C26.3992 25.125 26.5423 25.1843 26.6477 25.2898C26.7532 25.3952 26.8125 25.5383 26.8125 25.6875C26.8125 25.8367 26.7532 25.9798 26.6477 26.0852C26.5423 26.1907 26.3992 26.25 26.25 26.25ZM26.25 24H21.75C21.6008 24 21.4577 23.9407 21.3523 23.8352C21.2468 23.7298 21.1875 23.5867 21.1875 23.4375C21.1875 23.2883 21.2468 23.1452 21.3523 23.0398C21.4577 22.9343 21.6008 22.875 21.75 22.875H26.25C26.3992 22.875 26.5423 22.9343 26.6477 23.0398C26.7532 23.1452 26.8125 23.2883 26.8125 23.4375C26.8125 23.5867 26.7532 23.7298 26.6477 23.8352C26.5423 23.9407 26.3992 24 26.25 24Z\" fill=\"#43B02A\"></path></svg>";
        const ART_EMANIFEST = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"8\" width=\"32\" height=\"32\" rx=\"6\" fill=\"#43B02A\"></rect><rect x=\"13\" y=\"13\" width=\"22\" height=\"22\" rx=\"3\" fill=\"white\"></rect><path d=\"M16.826 23.8334L16 24.1241L19.8433 27.5975C20.1339 28.4901 19.7423 28.7533 19.4927 29.2215L23.6651 28.6762L23.5565 33L24.4206 32.9745L24.2321 28.6865L28.4086 29.1963C28.1501 28.6342 27.9201 28.3357 28.1592 27.4369L32 24.1462L31.3279 23.8956C30.7783 23.4589 31.5653 21.7924 31.684 20.7407C31.684 20.7407 29.4415 21.5349 29.2945 21.1193L28.7233 19.9896L26.6832 22.2974C26.4602 22.3525 26.3653 22.2612 26.313 22.0672L27.2556 17.2443L25.763 18.1087C25.6381 18.1637 25.5131 18.1163 25.4308 17.9663L23.9952 15L22.515 18.0806C22.4035 18.191 22.2917 18.2038 22.199 18.1288L20.7779 17.3077L21.631 22.0931C21.5631 22.2829 21.4006 22.3364 21.2095 22.2336L19.2592 19.9518C19.004 20.3728 18.8311 21.0605 18.4939 21.2146C18.1567 21.359 17.0272 20.923 16.2702 20.7529C16.5288 21.714 17.3374 23.3106 16.8256 23.8339L16.826 23.8334Z\" fill=\"#43B02A\"></path></svg>";
        const ART_INBOND = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"8\" width=\"32\" height=\"32\" rx=\"6\" fill=\"#43B02A\"></rect><rect x=\"13\" y=\"13\" width=\"22\" height=\"22\" rx=\"3\" fill=\"white\"></rect><path d=\"M32.9599 22.2266L31.9755 19.7656C31.892 19.5573 31.7478 19.3789 31.5616 19.2535C31.3754 19.1281 31.1559 19.0616 30.9314 19.0625H28.5V18.5C28.5 18.3508 28.4407 18.2077 28.3352 18.1023C28.2298 17.9968 28.0867 17.9375 27.9375 17.9375H17.25C16.9516 17.9375 16.6655 18.056 16.4545 18.267C16.2435 18.478 16.125 18.7641 16.125 19.0625V26.9375C16.125 27.2359 16.2435 27.522 16.4545 27.733C16.6655 27.944 16.9516 28.0625 17.25 28.0625H18.4453C18.5692 28.5465 18.8507 28.9755 19.2454 29.2818C19.64 29.5881 20.1254 29.7544 20.625 29.7544C21.1246 29.7544 21.61 29.5881 22.0046 29.2818C22.3993 28.9755 22.6808 28.5465 22.8047 28.0625H26.3203C26.4442 28.5465 26.7257 28.9755 27.1204 29.2818C27.515 29.5881 28.0004 29.7544 28.5 29.7544C28.9996 29.7544 29.485 29.5881 29.8796 29.2818C30.2743 28.9755 30.5558 28.5465 30.6797 28.0625H31.875C32.1734 28.0625 32.4595 27.944 32.6705 27.733C32.8815 27.522 33 27.2359 33 26.9375V22.4375C33.0001 22.3653 32.9865 22.2937 32.9599 22.2266ZM20.625 28.625C20.4025 28.625 20.185 28.559 20 28.4354C19.815 28.3118 19.6708 28.1361 19.5856 27.9305C19.5005 27.725 19.4782 27.4988 19.5216 27.2805C19.565 27.0623 19.6722 26.8618 19.8295 26.7045C19.9868 26.5472 20.1873 26.44 20.4055 26.3966C20.6238 26.3532 20.85 26.3755 21.0555 26.4606C21.2611 26.5458 21.4368 26.69 21.5604 26.875C21.684 27.06 21.75 27.2775 21.75 27.5C21.75 27.7984 21.6315 28.0845 21.4205 28.2955C21.2095 28.5065 20.9234 28.625 20.625 28.625ZM17.25 23.5625V19.0625H27.375V23.5625H17.25ZM28.5 28.625C28.2775 28.625 28.06 28.559 27.875 28.4354C27.69 28.3118 27.5458 28.1361 27.4606 27.9305C27.3755 27.725 27.3532 27.4988 27.3966 27.2805C27.44 27.0623 27.5472 26.8618 27.7045 26.7045C27.8618 26.5472 28.0623 26.44 28.2805 26.3966C28.4988 26.3532 28.725 26.3755 28.9305 26.4606C29.1361 26.5458 29.3118 26.69 29.4354 26.875C29.559 27.06 29.625 27.2775 29.625 27.5C29.625 27.7984 29.5065 28.0845 29.2955 28.2955C29.0845 28.5065 28.7984 28.625 28.5 28.625ZM28.5 21.875V20.1875H30.9314L31.6064 21.875H28.5Z\" fill=\"#43B02A\"></path></svg>";
        const ART_AES = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"8\" width=\"32\" height=\"32\" rx=\"6\" fill=\"#43B02A\"></rect><rect x=\"13\" y=\"13\" width=\"22\" height=\"22\" rx=\"3\" fill=\"white\"></rect><path d=\"M30.1875 22.875V29.625C30.1875 29.9234 30.069 30.2095 29.858 30.4205C29.647 30.6315 29.3609 30.75 29.0625 30.75H18.9375C18.6391 30.75 18.353 30.6315 18.142 30.4205C17.931 30.2095 17.8125 29.9234 17.8125 29.625V22.875C17.8125 22.5766 17.931 22.2905 18.142 22.0795C18.353 21.8685 18.6391 21.75 18.9375 21.75H23.4375V25.125C23.4375 25.2742 23.4968 25.4173 23.6023 25.5227C23.7077 25.6282 23.8508 25.6875 24 25.6875C24.1492 25.6875 24.2923 25.6282 24.3977 25.5227C24.5032 25.4173 24.5625 25.2742 24.5625 25.125V21.75H29.0625C29.3609 21.75 29.647 21.8685 29.858 22.0795C30.069 22.2905 30.1875 22.5766 30.1875 22.875ZM24.5625 18.0452L26.4145 19.898C26.5201 20.0035 26.6632 20.0628 26.8125 20.0628C26.9618 20.0628 27.1049 20.0035 27.2105 19.898C27.316 19.7924 27.3753 19.6493 27.3753 19.5C27.3753 19.3507 27.316 19.2076 27.2105 19.102L24.398 16.2895C24.3457 16.2372 24.2837 16.1957 24.2154 16.1674C24.1471 16.1391 24.0739 16.1246 24 16.1246C23.9261 16.1246 23.8529 16.1391 23.7846 16.1674C23.7163 16.1957 23.6543 16.2372 23.602 16.2895L20.7895 19.102C20.684 19.2076 20.6247 19.3507 20.6247 19.5C20.6247 19.6493 20.684 19.7924 20.7895 19.898C20.8951 20.0035 21.0382 20.0628 21.1875 20.0628C21.3368 20.0628 21.4799 20.0035 21.5855 19.898L23.4375 18.0452V21.75H24.5625V18.0452Z\" fill=\"#43B02A\"></path></svg>";
        const MODULE_META = {
            ams: {
                code: 'AMS',
                desc: 'Automated Manifest System',
                file: 'ams',
                art: recolorArt(ART_AMS)
            },
            'ams-modern': {
                code: 'AMS (Modern)',
                desc: 'Modernized AMS Filing Interface',
                file: 'ams_modern',
                art: recolorArt(ART_AMS_MODERN)
            },
            isf: {
                code: 'ISF',
                desc: 'Importer Security Filing (10+2)',
                file: 'isf',
                art: recolorArt(ART_ISF)
            },
            aci: {
                code: 'ACI',
                desc: 'Advance Commercial Information',
                file: 'aci',
                art: recolorArt(ART_ACI)
            },
            emanifest: {
                code: 'ACI eManifest',
                desc: 'Canada eManifest Filing',
                file: 'aci_emanifest',
                art: recolorArt(ART_EMANIFEST)
            },
            inbond: {
                code: 'Inbond',
                desc: 'In-Bond Transit Filing',
                file: 'inbond',
                art: recolorArt(ART_INBOND),
                isNew: false
            },
            aes: {
                code: 'AES',
                desc: 'Automated Export System',
                file: 'aes',
                art: recolorArt(ART_AES),
                isNew: false
            }
        };

        /**
         * A launch row for the module-select portal. Renders the delivered module
         * LOCKUP ARTWORK (e.g. "iMANIFEST / AMS") as an image — never typeset — and
         * swaps the light/dark artwork automatically with [data-theme]. Ends with a
         * "New" badge or a hover-revealed chevron.
         *
         * Reusable across products (iFMS / iCHB / iFULFILL): pass explicit
         * `logoLight`/`logoDark`, or `logo` (a path stem → `_light.png` / `_dark.png`).
         */
        function ModuleRow({
            module = 'ams',
            basePath = '/Content/New_Index',
            logo,
            // path stem, appends _light.png / _dark.png
            logoLight,
            // explicit light artwork src
            logoDark,
            // explicit dark artwork src
            logoHeight = 19,
            href = '#',
            isNew,
            chevron = true,
            alt,
            onClick,
            style = {},
            ...rest
        }) {
            const meta = MODULE_META[module] || {};
            const showNew = isNew ?? meta.isNew ?? false;
            const [hover, setHover] = React.useState(false);
            const light = logoLight || (logo ? `${logo}_light.svg` : `${basePath}/Content/New_Index/imanifest_${meta.file || module}_light.svg`);
            const dark = logoDark || (logo ? `${logo}_dark.svg` : `${basePath}/Content/New_Index/imanifest_${meta.file || module}_dark.svg`);
            const R = typeof window !== 'undefined' && window.__DS_ASSET ? window.__DS_ASSET : x => x;
            const label = alt || (meta.code ? `iMANIFEST / ${meta.code}` : 'iMANIFEST module');
            const imgStyle = {
                height: logoHeight,
                width: 'auto',
                display: 'block',
                objectFit: 'contain'
            };
            return React.createElement("a", _extends({
                href: href,
                onClick: onClick,
                onMouseEnter: () => setHover(true),
                onMouseLeave: () => setHover(false),
                title: meta.desc || label,
                style: {
                    display: 'flex',
                    alignItems: 'center',
                    gap: 12,
                    padding: '10px 18px',
                    paddingLeft: hover ? 24 : 18,
                    minHeight: 44,
                    textDecoration: 'none',
                    color: 'inherit',
                    cursor: 'pointer',
                    borderRadius: 'var(--radius-md)',
                    background: hover ? 'var(--surface-hover)' : 'transparent',
                    transition: 'background var(--dur-fast) var(--ease-standard), padding-left var(--dur-fast) var(--ease-standard)',
                    ...style
                }
            }, rest), React.createElement("span", {
                "aria-hidden": "true",
                style: {
                    flex: '0 0 auto',
                    width: 40,
                    height: 40,
                    display: 'flex',
                    alignItems: 'center',
                    justifyContent: 'center',
                    position: 'relative',
                    transform: hover ? 'scale(1.05)' : 'scale(1)',
                    filter: hover ? 'drop-shadow(0 4px 10px rgba(67,176,42,0.28))' : 'drop-shadow(0 0 0 rgba(0,0,0,0))',
                    transition: 'transform 0.2s ease, filter 0.2s ease'
                }
            }, meta.art ? React.createElement("span", {
                "aria-hidden": "true",
                style: { display: 'inline-flex', width: 40, height: 40 },
                dangerouslySetInnerHTML: { __html: meta.art }
            }) : meta.svg ? React.createElement("span", {
                "aria-hidden": "true",
                style: { display: 'inline-flex', color: 'var(--chip-symbol, var(--green-600))' },
                dangerouslySetInnerHTML: { __html: meta.svg }
            }) : React.createElement("i", {
                className: `ph ph-${meta.icon || 'file-text'}`,
                style: { fontSize: 19, lineHeight: 1, color: 'var(--chip-symbol, var(--green-600))' }
            })), React.createElement("span", {
                style: {
                    flex: 1,
                    minWidth: 0,
                    display: 'flex',
                    flexDirection: 'column',
                    gap: 4
                }
            }, React.createElement("span", {
                style: {
                    display: 'flex',
                    alignItems: 'center',
                    lineHeight: 0
                }
            }, React.createElement("img", {
                src: R(light),
                alt: label,
                style: {
                    ...imgStyle,
                    display: 'var(--logo-variant-light, block)'
                }
            }), React.createElement("img", {
                src: R(dark),
                alt: label,
                "aria-hidden": "true",
                style: {
                    ...imgStyle,
                    display: 'var(--logo-variant-dark, none)'
                }
            })), meta.desc && React.createElement("span", {
                style: {
                    fontSize: '12px',
                    color: 'rgba(255,255,255,0.6)',
                    letterSpacing: '0.01em',
                    lineHeight: 1.3
                }
            }, meta.desc)), React.createElement("span", {
                style: {
                    flex: '0 0 auto',
                    display: 'inline-flex',
                    alignItems: 'center'
                }
            }, React.createElement("i", {
                className: "ph ph-arrow-right",
                "aria-hidden": "true",
                style: {
                    fontSize: 18,
                    lineHeight: 1,
                    color: 'var(--chip-border, var(--green-500))',
                    opacity: hover ? 1 : 0,
                    transform: hover ? 'translateX(0)' : 'translateX(-4px)',
                    transition: 'opacity var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard)'
                }
            })));
        }
        Object.assign(__ds_scope, { MODULE_META, ModuleRow });
    })();

    (() => {
        function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
        /**
         * A site card grouping the filing systems available on one server site
         * (e.g. USA = .com, Korea = .co.kr — a hosting location, NOT a nationality).
         * Compose ModuleRow children inside. Generic across products.
         */
        function SiteCard({
            title,
            domain,
            count,
            flag,
            children,
            style = {},
            ...rest
        }) {
            const n = count ?? (React.Children.count(children) || undefined);
            return React.createElement("section", _extends({
                style: {
                    background: 'var(--surface-inset)',
                    borderRadius: 'var(--radius-lg)',
                    border: '1px solid var(--border-subtle)',
                    overflow: 'hidden',
                    display: 'flex',
                    flexDirection: 'column',
                    transition: 'background var(--dur-mid) var(--ease-standard)',
                    ...style
                }
            }, rest), React.createElement("div", {
                style: {
                    display: 'flex',
                    flexDirection: 'column',
                    gap: 4,
                    padding: '16px 18px 10px',
                    marginBottom: 0
                }
            }, React.createElement("div", {
                style: {
                    display: 'flex',
                    alignItems: 'center',
                    gap: 10
                }
            }, flag && React.createElement(__ds_scope.FlagChip, {
                region: flag
            }), React.createElement("h2", {
                style: {
                    margin: 0,
                    fontSize: '12.5px',
                    fontWeight: 600,
                    letterSpacing: '0.08em',
                    textTransform: 'uppercase',
                    whiteSpace: 'nowrap',
                    color: 'rgba(255,255,255,0.6)'
                }
            }, title), n != null && React.createElement("span", {
                style: {
                    marginLeft: 'auto',
                    fontSize: 'var(--text-xs)',
                    color: 'rgba(255,255,255,0.5)',
                    fontVariantNumeric: 'tabular-nums'
                }
            }, n, " systems")), domain && React.createElement("p", {
                style: {
                    margin: 0,
                    fontSize: '11.5px',
                    color: 'rgba(255,255,255,0.5)',
                    letterSpacing: '0.02em'
                }
            }, domain)), React.createElement("div", {
                "aria-hidden": true,
                style: {
                    height: 1,
                    background: 'var(--divider)',
                    marginLeft: 22,
                    marginRight: 18,
                    marginTop: 6,
                    marginBottom: 18
                }
            }), React.createElement("div", {
                style: {
                    display: 'flex',
                    flexDirection: 'column',
                    padding: '2px 4px 6px'
                }
            }, children));
        }
        Object.assign(__ds_scope, { SiteCard });
    })();

    __ds_ns.Logo = __ds_scope.Logo;

    __ds_ns.Badge = __ds_scope.Badge;

    __ds_ns.Button = __ds_scope.Button;

    __ds_ns.Eyebrow = __ds_scope.Eyebrow;

    __ds_ns.FlagChip = __ds_scope.FlagChip;

    __ds_ns.FLAG_URLS = __ds_scope.FLAG_URLS;

    __ds_ns.FlagIcon = __ds_scope.FlagIcon;

    __ds_ns.Panel = __ds_scope.Panel;

    __ds_ns.BACKGROUND_PRESETS = __ds_scope.BACKGROUND_PRESETS;

    __ds_ns.RandomBackground = __ds_scope.RandomBackground;

    __ds_ns.Tagline = __ds_scope.Tagline;

    __ds_ns.MODULE_META = __ds_scope.MODULE_META;

    __ds_ns.ModuleRow = __ds_scope.ModuleRow;

    __ds_ns.SiteCard = __ds_scope.SiteCard;

    window.IMANIFESTDesignSystem = __ds_ns;
})();

(function () {
    const { Logo, Panel, Button, MODULE_META } = window.IMANIFESTDesignSystem_b05d13;

    const getModules = (site) => {
        const tld = site === 'usa' ? '.com' : '.co.kr';

        const modules = [
            {
                module: 'ams',
                // href: '/Home/Login?product=AMS'
                href: `https://ams.suntekscm${tld}/login_2017.aspx`
            }, {
                module: 'ams-modern',
                // href: '/Home/Login?product=AMS'
                href: `https://ams1.suntekscm${tld}/login_2017.aspx`
            }, {
                module: 'isf',
                //href: '/Home/Login?product=ISF'
                href: `https://isf.suntekscm${tld}/Home/Login?product=ISF`
            }, {
                module: 'aci',
                // href: '/Home/Login?product=ACI'
                href: `https://aci.suntekscm${tld}/login_2017.aspx`
            }, {
                module: 'emanifest',
                //href: '/Home/Login?product=ACI'
                href: `https://imanifest.suntekscm${tld}/Home/Login?product=ACI`
            }
        ];

        if (site === 'usa') {
            modules.push(
                {
                    module: 'inbond',
                    href: 'https://inbond.suntekscm.com'
                }, {
                    module: 'aes',
                    href: 'https://aes.suntekscm.com'
                }
            );
        }

        return modules;
    };

    const USA_MODULES = getModules('usa');
    const KOR_MODULES = getModules('kor');

    const MODULE_NAME_B = { ams: 'AMS', 'ams-modern': 'AMS Modern', isf: 'ISF', aci: 'ACI', emanifest: 'ACI eManifest', inbond: 'Inbond', aes: 'AES' };

    function randomPastel() {
        const h = Math.floor(Math.random() * 360);
        return { tint: `hsl(${h} 72% 96%)`, accent: `hsl(${h} 46% 52%)` };
    }

    function shufflePastels(n) {
        return Array.from({ length: n }, () => ({ tint: '#EAF7E6', accent: '#43B02A' }));
    }

    function ModuleCard({ m, site, basePath, onPick, color }) {
        const meta = MODULE_META[m.module] || {};
        const _rand = React.useMemo(() => randomPastel(), []);
        const s = color || _rand;
        return (
            <a href={m.href} onClick={onPick} className="mcB"
                aria-label={`iMANIFEST ${MODULE_NAME_B[m.module]}, ${meta.desc}`}
                style={{ ['--mc-tint']: s.tint, ['--mc-accent']: s.accent }}>
                <span className="mc-icon" aria-hidden="true" dangerouslySetInnerHTML={{ __html: meta.art || '' }} />
                <span className="mc-body">
                    <Logo variant="module" module={m.module} height={18} basePath={basePath} alt={`iMANIFEST ${MODULE_NAME_B[m.module]}`} />
                    <span className="mc-desc">{meta.desc}</span>
                </span>
            </a>
        );
    }

    function SiteSection({ flag, label, desc, modules, site, basePath, pick, pairLast }) {
        const main = pairLast ? modules.slice(0, -2) : modules;
        const pair = pairLast ? modules.slice(-2) : [];
        const pastels = React.useMemo(() => shufflePastels(modules.length), [modules.length]);
        const card = (m, i) => <ModuleCard key={m.module} m={m} site={site} basePath={basePath} onPick={pick(site)(m)} color={pastels[i]} />;
        return (
            <section className="sec">
                <div className="sec-head"><span className="site-badge">{flag === 'usa' ? 'US' : 'KR'}</span><span className="sec-label">{label}</span><hr className="sec-rule" /></div>
                <p className="sec-desc">{desc}</p>
                <div className="modgrid">{main.map(card)}</div>
                {pair.length > 0 ? <div className="modgrid modgrid--pair">{pair.map((m, i) => card(m, main.length + i))}</div> : null}
            </section>
        );
    }

    function PortalScreen({ basePath = '/Content/New_Index', onSelect, onHome }) {
        const pick = (site) => (m) => (e) => { e.preventDefault(); onSelect && onSelect({ ...m, site }); };
        return (
            <React.Fragment>
                <div className="bgrain" aria-hidden="true"></div>
                <div style={{ position: 'relative', zIndex: 3, minHeight: '100vh', display: 'flex', flexDirection: 'column' }}>
                    <header style={{ position: 'relative', zIndex: 1, display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 20, padding: '18px 48px 0' }}>
                        <span style={{ display: 'inline-flex', alignItems: 'center', gap: 10, cursor: 'pointer' }} onClick={onHome}>
                            <img src={(typeof window !== 'undefined' && window.__DS_ASSET) ? window.__DS_ASSET(`${basePath}/imanifest_symbol.svg`) : `${basePath}/imanifest_symbol.svg`} alt="" aria-hidden="true" style={{ width: 34, height: 34, display: 'block' }} />
                            <Logo variant="wordmark" height={22} basePath={basePath} />
                        </span>
                    </header>

                    <main style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 48px 16px' }}>
                        <Panel variant="glass" style={{ width: '100%', maxWidth: 980, padding: '26px 32px 24px', background: 'rgba(255,255,255,0.55)', border: '1px solid rgba(255,255,255,0.7)', boxShadow: '0 20px 50px -28px rgba(30,50,90,0.24)' }}>
                            <div>
                                <p className="hero-eyebrow">Global Manifest · Security Filing</p>
                                <h1 className="hero-title">Choose Your Module</h1>
                                <p className="hero-sub">Both sites offer the same modules. Choose your site, then the module.</p>
                            </div>
                            <SiteSection flag="usa" label="US Site" desc="Filing systems hosted in the United States." modules={USA_MODULES} site="usa" basePath={basePath} pick={pick} pairLast />
                            <SiteSection flag="kor" label="KR Site" desc="Filing systems hosted in South Korea." modules={KOR_MODULES} site="kor" basePath={basePath} pick={pick} />
                        </Panel>
                    </main>

                    <footer className="site-footer">
                        <img src={(typeof window !== 'undefined' && window.__DS_ASSET) ? window.__DS_ASSET(`${basePath}/powered_by_suntek.svg`) : `${basePath}/powered_by_suntek.svg`} alt="Powered by Suntek" style={{ height: 30, display: 'block' }} />
                    </footer>
                </div>
            </React.Fragment>
        );
    }

    function DestinationScreen({ selection, basePath = '/Content/New_Index', onBack }) {
        const { product, module, site } = selection;
        const isEmail = module === 'inbond' || module === 'aes';
        const firstFieldLabel = isEmail ? 'Email' : 'User ID';
        const firstFieldEmptyMsg = isEmail
            ? 'Please enter your email address using the format name@example.com'
            : 'Please enter your User ID.';
        const passwordEmptyMsg = 'Please enter your Password.';

        const [userId, setUserId] = React.useState('');
        const [password, setPassword] = React.useState('');
        const [showPw, setShowPw] = React.useState(false);
        const [errors, setErrors] = React.useState({});
        const [focused, setFocused] = React.useState(null);
        const [touched, setTouched] = React.useState({});
        const userIdRef = React.useRef(null);
        const passwordRef = React.useRef(null);
        const canSubmit = userId.trim() !== '' && password !== '';

        const serverData = window.__SERVER_DATA__ || {};
        const [generalError, setGeneralError] = React.useState(!!serverData.errorMessage);
        const authFailedMsg = serverData.errorMessage || 'Invalid credentials. Please try again.';

        const fieldStyle = (name) => ({
            height: 44, padding: '0 12px', borderRadius: 'var(--radius-md)', width: '100%', boxSizing: 'border-box',
            border: errors[name] ? '1.5px solid var(--danger-500)' : focused === name ? '1.5px solid var(--brand)' : '1px solid var(--border-strong)',
            background: 'var(--surface-field)', color: 'var(--text-hi)',
            boxShadow: errors[name] ? '0 0 0 3px var(--danger-soft)' : focused === name ? '0 0 0 3px var(--brand-soft)' : 'none',
            fontFamily: 'var(--font-sans)', fontSize: 'var(--text-md)', outline: 'none',
            transition: 'border-color 0.15s ease, box-shadow 0.15s ease',
        });

        const isDebug = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';

        const formAction = isDebug
            ? `/Home/Login?product=${product}&module=${module}&site=${site}`
            : `/Home/Login?product=${product}`;

        const csrfToken = document.querySelector('input[name="__RequestVerificationToken"]')?.value || '';

        const handleSubmit = (e) => {
            if (!canSubmit) {
                e.preventDefault();
            }
        };

        return (
            <div style={{ position: 'relative', zIndex: 3, minHeight: '100vh', display: 'flex', flexDirection: 'column' }}>
                <main className="login-main" style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '44px 48px 40px' }}>
                    <Panel style={{ width: '100%', maxWidth: 455, padding: '36px 34px 34px' }}>
                        <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 10, marginBottom: 22 }}>
                            <span className="login-symbol" aria-hidden="true" dangerouslySetInnerHTML={{ __html: (MODULE_META[module] || {}).art || '' }} />
                            <div className="login-lockup" style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10, maxWidth: '100%', minWidth: 0 }}>
                                <Logo variant="module" module={module} height={32} basePath={basePath} style={{ maxWidth: '100%' }} />
                                <span className="site-badge">{site === 'usa' ? 'US' : 'KR'}</span>
                            </div>
                        </div>
                        <h1 style={{ margin: '0 0 28px', fontSize: '21px', fontWeight: 500, letterSpacing: '-0.01em', color: 'var(--text-hi)', textAlign: 'center' }}>Welcome back</h1>
                        <form action={formAction} method="POST" onSubmit={handleSubmit} noValidate style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
                            <input type="hidden" name="__RequestVerificationToken" value={csrfToken} />
                            <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
                                <input id="login-userid" ref={userIdRef} type={isEmail ? 'email' : 'text'} name="tbxEmail" value={userId}
                                    placeholder={firstFieldLabel} aria-label={firstFieldLabel}
                                    onChange={e => { const v = e.target.value; setUserId(v); setGeneralError(false); if (touched.userId) setErrors(er => ({ ...er, userId: v.trim() ? null : firstFieldEmptyMsg })); }}
                                    onFocus={() => setFocused('userId')}
                                    onBlur={() => { setFocused(null); setTouched(t => ({ ...t, userId: true })); setErrors(er => ({ ...er, userId: userId.trim() ? null : firstFieldEmptyMsg })); }}
                                    style={fieldStyle('userId')} aria-invalid={!!errors.userId}
                                    aria-describedby={errors.userId ? 'err-userid' : undefined} />
                                {errors.userId && <span id="err-userid" role="alert" style={{ display: 'flex', alignItems: 'center', gap: 6, fontSize: 'var(--text-xs)', color: 'var(--danger-500)', marginTop: 2 }}><span aria-hidden="true" style={{ width: 14, height: 14, borderRadius: '50%', background: 'var(--danger-500)', color: '#fff', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', fontSize: 9, fontWeight: 700, flexShrink: 0 }}>!</span>{errors.userId}</span>}
                            </div>
                            <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
                                <div style={{ position: 'relative', display: 'flex', alignItems: 'center' }}>
                                    <input id="login-password" ref={passwordRef} type={showPw ? 'text' : 'password'} name="tbxPassword" value={password}
                                        placeholder="Password" aria-label="Password"
                                        onChange={e => { const v = e.target.value; setPassword(v); setGeneralError(false); if (touched.password) setErrors(er => ({ ...er, password: v ? null : passwordEmptyMsg })); }}
                                        onFocus={() => setFocused('password')}
                                        onBlur={() => { setFocused(null); setTouched(t => ({ ...t, password: true })); setErrors(er => ({ ...er, password: password ? null : passwordEmptyMsg })); }}
                                        style={{ ...fieldStyle('password'), paddingRight: 40 }} aria-invalid={!!errors.password}
                                        aria-describedby={errors.password ? 'err-password' : undefined} />
                                    <button type="button" onClick={() => setShowPw(v => !v)}
                                        aria-label={showPw ? 'Hide password' : 'Show password'} aria-pressed={showPw}
                                        style={{ position: 'absolute', right: 10, top: '50%', transform: 'translateY(-50%)', background: 'none', border: 'none', cursor: 'pointer', color: 'var(--text-lo)', padding: 2, display: 'flex', alignItems: 'center', lineHeight: 0 }}>
                                        <i className={showPw ? 'ph ph-eye-slash' : 'ph ph-eye'} style={{ fontSize: 18 }} />
                                    </button>
                                </div>
                                {errors.password && <span id="err-password" role="alert" style={{ display: 'flex', alignItems: 'center', gap: 6, fontSize: 'var(--text-xs)', color: 'var(--danger-500)', marginTop: 2 }}><span aria-hidden="true" style={{ width: 14, height: 14, borderRadius: '50%', background: 'var(--danger-500)', color: '#fff', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', fontSize: 9, fontWeight: 700, flexShrink: 0 }}>!</span>{errors.password}</span>}
                            </div>
                            {generalError && (
                                <div role="alert" style={{ display: 'flex', alignItems: 'flex-start', gap: 8, fontSize: 'var(--text-xs)', color: 'var(--danger-500)', background: 'var(--danger-soft)', borderRadius: 'var(--radius-md)', padding: '9px 11px' }}>
                                    <span aria-hidden="true" style={{ width: 14, height: 14, borderRadius: '50%', background: 'var(--danger-500)', color: '#fff', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', fontSize: 9, fontWeight: 700, flexShrink: 0, marginTop: 1 }}>!</span>
                                    <span>{authFailedMsg}</span>
                                </div>
                            )}
                            <Button variant="brand" block type="submit" style={{ marginTop: 8, opacity: 1, cursor: 'pointer' }}>Sign in</Button>
                        </form>
                        <div style={{ marginTop: 24, textAlign: 'center' }}>
                            <button onClick={onBack} style={{ display: 'inline-flex', alignItems: 'center', gap: 6, background: 'none', border: 'none', cursor: 'pointer', fontSize: 'var(--text-sm)', lineHeight: 1.4, color: 'var(--text-mid)', fontFamily: 'var(--font-sans)', padding: 0 }}><span aria-hidden="true" style={{ fontSize: '14px', lineHeight: 1 }}>&#8592;</span><span style={{ textDecoration: 'underline' }}>Back to iMANIFEST Home</span></button>
                        </div>
                    </Panel>
                </main>
                <footer className="site-footer">
                    <img src={(typeof window !== 'undefined' && window.__DS_ASSET) ? window.__DS_ASSET(`${basePath}/powered_by_suntek.svg`) : `${basePath}/powered_by_suntek.svg`} alt="Powered by Suntek" style={{ height: 30, display: 'block' }} />
                </footer>
            </div>
        );
    }

    window.PortalScreen = PortalScreen;
    window.DestinationScreen = DestinationScreen;
})();