{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": [
    {
      "kind": "javascript-module",
      "path": "src/defs-react.js",
      "declarations": [],
      "exports": []
    },
    {
      "kind": "javascript-module",
      "path": "src/defs.js",
      "declarations": [
        {
          "kind": "variable",
          "name": "Language",
          "type": {
            "text": "{\n    readonly [key: string]: string;\n}"
          },
          "default": "{ BULGARIAN: 'bg', CATALAN: 'ca', DANISH: 'da', DUTCH: 'nl', ENGLISH: 'en', FRENCH: 'fr', GERMAN: 'de', HEBREW: 'he', ITALIAN: 'it', POLISH: 'pl', SLOVAK: 'sk', SPANISH: 'es', }"
        },
        {
          "kind": "variable",
          "name": "Country",
          "type": {
            "text": "{\n    readonly [key: string]: string;\n}"
          },
          "default": "{ AUSTRALIA: 'au', AUSTRIA: 'at', BELGIUM: 'be', BULGARIA: 'bg', CANADA: 'ca', DENMARK: 'dk', FRANCE: 'fr', GERMANY: 'de', GREAT_BRITAIN: 'gb', IRELAND: 'ie', ISRAEL: 'il', ITALY: 'it', LUXEMBOURG: 'lu', NETHERLANDS: 'nl', POLAND: 'pl', SLOVAKIA: 'sk', SPAIN: 'es', SWITZERLAND: 'ch', }"
        },
        {
          "kind": "variable",
          "name": "ON_COOKIE_BANNER_ACCEPT_ALL",
          "type": {
            "text": "string"
          },
          "default": "'pie-cookie-banner-accept-all'",
          "description": "Event name for when all cookies are accepted."
        },
        {
          "kind": "variable",
          "name": "ON_COOKIE_BANNER_NECESSARY_ONLY",
          "type": {
            "text": "string"
          },
          "default": "'pie-cookie-banner-necessary-only'",
          "description": "Event name for when all only necessary cookies are accepted."
        },
        {
          "kind": "variable",
          "name": "ON_COOKIE_BANNER_MANAGE_PREFS",
          "type": {
            "text": "string"
          },
          "default": "'pie-cookie-banner-manage-prefs'",
          "description": "Event name for when a user clicks manage preferences."
        },
        {
          "kind": "variable",
          "name": "ON_COOKIE_BANNER_PREFS_SAVED",
          "type": {
            "text": "string"
          },
          "default": "'pie-cookie-banner-prefs-saved'",
          "description": "Event name for when a user clicks save preferences."
        },
        {
          "kind": "variable",
          "name": "preferences",
          "type": {
            "text": "Preference[]"
          },
          "default": "[ { id: 'all', hasDivider: true, hasDescription: false, }, { id: 'necessary', checked: true, disabled: true, hasDescription: true, }, { id: 'functional', hasDescription: true, }, { id: 'analytical', hasDescription: true, }, { id: 'personalized', hasDescription: true, } ]"
        },
        {
          "kind": "variable",
          "name": "defaultProps",
          "type": {
            "text": "DefaultProps"
          },
          "default": "{ hasPrimaryActionsOnly: false, defaultPreferences: {}, country: Country.GREAT_BRITAIN, language: Language.ENGLISH, cookieStatementLink: '', personalizedLabel: '', personalizedDescription: '', cookieTechnologiesLink: '', openLinksInSameTab: false, }"
        },
        {
          "kind": "variable",
          "name": "availableLocales",
          "default": "new Set([ `${Language.BULGARIAN}`, `${Language.ENGLISH}-${Country.CANADA}`, `${Language.FRENCH}-${Country.CANADA}`, `${Language.DANISH}`, `${Language.ENGLISH}-${Country.FRANCE}`, `${Language.FRENCH}-${Country.FRANCE}`, `${Language.FRENCH}`, `${Language.GERMAN}`, `${Language.ENGLISH}`, `${Language.HEBREW}`, `${Language.ITALIAN}`, `${Language.DUTCH}`, `${Language.POLISH}`, `${Language.SLOVAK}`, `${Language.CATALAN}`, `${Language.SPANISH}`, ])"
        },
        {
          "kind": "variable",
          "name": "defaultLocaleForCountry",
          "default": "new Map<CountryCode, string>([ [Country.AUSTRALIA, `${Language.ENGLISH}`], [Country.AUSTRIA, `${Language.GERMAN}`], [Country.BELGIUM, `${Language.DUTCH}`], [Country.BULGARIA, `${Language.BULGARIAN}`], [Country.CANADA, `${Language.ENGLISH}`], [Country.DENMARK, `${Language.DANISH}`], [Country.FRANCE, `${Language.FRENCH}-${Country.FRANCE}`], [Country.GERMANY, `${Language.GERMAN}`], [Country.GREAT_BRITAIN, `${Language.ENGLISH}`], [Country.IRELAND, `${Language.ENGLISH}`], [Country.ISRAEL, `${Language.HEBREW}`], [Country.ITALY, `${Language.ITALIAN}`], [Country.LUXEMBOURG, `${Language.FRENCH}`], [Country.NETHERLANDS, `${Language.DUTCH}`], [Country.POLAND, `${Language.POLISH}`], [Country.SLOVAKIA, `${Language.SLOVAK}`], [Country.SPAIN, `${Language.SPANISH}`], [Country.SWITZERLAND, `${Language.GERMAN}`], ])"
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "Language",
          "declaration": {
            "name": "Language",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "Country",
          "declaration": {
            "name": "Country",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "ON_COOKIE_BANNER_ACCEPT_ALL",
          "declaration": {
            "name": "ON_COOKIE_BANNER_ACCEPT_ALL",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "ON_COOKIE_BANNER_NECESSARY_ONLY",
          "declaration": {
            "name": "ON_COOKIE_BANNER_NECESSARY_ONLY",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "ON_COOKIE_BANNER_MANAGE_PREFS",
          "declaration": {
            "name": "ON_COOKIE_BANNER_MANAGE_PREFS",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "ON_COOKIE_BANNER_PREFS_SAVED",
          "declaration": {
            "name": "ON_COOKIE_BANNER_PREFS_SAVED",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "preferences",
          "declaration": {
            "name": "preferences",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "defaultProps",
          "declaration": {
            "name": "defaultProps",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "availableLocales",
          "declaration": {
            "name": "availableLocales",
            "module": "src/defs.js"
          }
        },
        {
          "kind": "js",
          "name": "defaultLocaleForCountry",
          "declaration": {
            "name": "defaultLocaleForCountry",
            "module": "src/defs.js"
          }
        }
      ]
    },
    {
      "kind": "javascript-module",
      "path": "src/index.js",
      "declarations": [
        {
          "kind": "class",
          "description": "",
          "name": "PieCookieBanner",
          "members": [
            {
              "kind": "field",
              "name": "_isCookieBannerHidden",
              "type": {
                "text": "boolean"
              },
              "privacy": "private",
              "default": "false"
            },
            {
              "kind": "field",
              "name": "_isModalOpen",
              "type": {
                "text": "boolean"
              },
              "privacy": "private",
              "default": "false"
            },
            {
              "kind": "field",
              "name": "_locale",
              "type": {
                "text": "CookieBannerLocale"
              },
              "privacy": "private",
              "default": "defaultLocale"
            },
            {
              "kind": "field",
              "name": "hasPrimaryActionsOnly",
              "privacy": "public",
              "attribute": "hasPrimaryActionsOnly"
            },
            {
              "kind": "field",
              "name": "defaultPreferences",
              "privacy": "public",
              "attribute": "defaultPreferences"
            },
            {
              "kind": "field",
              "name": "cookieStatementLink",
              "privacy": "public",
              "attribute": "cookieStatementLink"
            },
            {
              "kind": "field",
              "name": "personalizedLabel",
              "privacy": "public",
              "attribute": "personalizedLabel"
            },
            {
              "kind": "field",
              "name": "personalizedDescription",
              "privacy": "public",
              "attribute": "personalizedDescription"
            },
            {
              "kind": "field",
              "name": "cookieTechnologiesLink",
              "privacy": "public",
              "attribute": "cookieTechnologiesLink"
            },
            {
              "kind": "field",
              "name": "country",
              "privacy": "public",
              "attribute": "country"
            },
            {
              "kind": "field",
              "name": "language",
              "privacy": "public",
              "attribute": "language"
            },
            {
              "kind": "field",
              "name": "openLinksInSameTab",
              "privacy": "public",
              "attribute": "openLinksInSameTab"
            },
            {
              "kind": "field",
              "name": "_preferencesNodes",
              "type": {
                "text": "NodeListOf<PieSwitch>"
              }
            },
            {
              "kind": "field",
              "name": "_linkTargetAttribute",
              "privacy": "private",
              "description": "Returns the target attribute value for external links based on the openLinksInSameTab prop.\n- false (default): returns '_blank' (new tab)\n- true: returns '_self' (same tab)",
              "readonly": true
            },
            {
              "kind": "method",
              "name": "_setLocaleBasedOnCountryAndLanguage",
              "privacy": "private",
              "return": {
                "type": {
                  "text": "Promise<void>"
                }
              },
              "parameters": [
                {
                  "name": "language",
                  "type": {
                    "text": "LanguageCode"
                  }
                },
                {
                  "name": "country",
                  "type": {
                    "text": "CountryCode"
                  }
                }
              ]
            },
            {
              "kind": "field",
              "name": "_getLocaleString",
              "privacy": "private",
              "description": "Gets the locale string for the requested language and country.",
              "parameters": [
                {
                  "description": "The requested language code (e.g., 'es').",
                  "name": "languageCode"
                },
                {
                  "description": "The requested country code (e.g., 'ch').",
                  "name": "countryCode"
                }
              ],
              "return": {
                "type": {
                  "text": ""
                }
              }
            },
            {
              "kind": "field",
              "name": "_customTagEnhancers",
              "type": {
                "text": "CustomTagEnhancers"
              },
              "privacy": "private",
              "default": "{ linkStatement: (tagContent: string) => html`<pie-link href=\"${this.cookieStatementLink}\" variant=\"inverse\" target=\"${this._linkTargetAttribute}\" data-test-id=\"cookie-statement-link\">${tagContent}</pie-link>`, linkNecessaryOnly: (tagContent: string) => html`<pie-link data-test-id=\"body-necessary-only\" tag=\"button\" variant=\"inverse\" @click=\"${this._onNecessaryOnly}\">${tagContent}</pie-link>`, linkManagePreferences: (tagContent: string) => html`<pie-link data-test-id=\"body-manage-prefs\" tag=\"button\" variant=\"inverse\" @click=\"${this._openManagePreferencesModal}\">${tagContent}</pie-link>`, linkAcceptAll: (tagContent: string) => html`<pie-link data-test-id=\"body-accept-all\" tag=\"button\" variant=\"inverse\" @click=\"${this._onAcceptAll}\">${tagContent}</pie-link>`, linkCookieStatement: (tagContent: string) => html`<pie-link href=\"${this.cookieStatementLink}\" size=\"small\" target=\"${this._linkTargetAttribute}\" data-test-id=\"cookie-statement-link\">${tagContent}</pie-link>`, linkCookieTechList: (tagContent: string) => html`<pie-link href=\"${this.cookieTechnologiesLink}\" size=\"small\" target=\"${this._linkTargetAttribute}\" data-test-id=\"cookie-technology-link\">${tagContent}</pie-link>`, }"
            },
            {
              "kind": "method",
              "name": "_localiseText",
              "privacy": "private",
              "parameters": [
                {
                  "name": "key",
                  "type": {
                    "text": "string"
                  }
                }
              ]
            },
            {
              "kind": "method",
              "name": "_localiseRichText",
              "privacy": "private",
              "parameters": [
                {
                  "name": "key",
                  "type": {
                    "text": "string"
                  }
                }
              ]
            },
            {
              "kind": "method",
              "name": "_renderPreferenceLabel",
              "privacy": "private",
              "parameters": [
                {
                  "name": "id",
                  "type": {
                    "text": "PreferenceIds"
                  }
                }
              ],
              "description": "Renders a preference label.\nFor the personalised preference, uses the consumer-supplied `personalizedLabel`\nprop when provided as plain text, and falls back to the built-in locale string otherwise."
            },
            {
              "kind": "method",
              "name": "_renderPreferenceDescription",
              "privacy": "private",
              "parameters": [
                {
                  "name": "id",
                  "type": {
                    "text": "PreferenceIds"
                  }
                },
                {
                  "name": "description",
                  "type": {
                    "text": "string"
                  }
                }
              ],
              "description": "Renders a preference description.\nFor the personalised preference, uses the consumer-supplied `personalizedDescription`\nprop when provided (allowing consumers to embed their own privacy policy link using\nplain HTML `<a>` or `<pie-link>` tags), and falls back to the built-in locale string otherwise.\nAll other preferences use the plain locale text with HTML sanitisation."
            },
            {
              "kind": "method",
              "name": "_displayCookieBanner",
              "privacy": "private",
              "return": {
                "type": {
                  "text": "void"
                }
              },
              "description": "Handles closing the modal and re-displaying the cookie banner\nand making the cookie banner visible"
            },
            {
              "kind": "method",
              "name": "_handlePreferencesSaved",
              "privacy": "private",
              "return": {
                "type": {
                  "text": "void"
                }
              },
              "description": "Handles saving the user cookie preferences, closing the modal and the cookie banner\nCreates a state object for the save event, indicating the checked status\nof each preference except for the `all` preference."
            },
            {
              "kind": "field",
              "name": "_onNecessaryOnly",
              "privacy": "private",
              "description": "Hides the cookie banner and emits the necessary only event"
            },
            {
              "kind": "field",
              "name": "_onAcceptAll",
              "privacy": "private",
              "description": "Hides the cookie banner and emits the accept all event"
            },
            {
              "kind": "field",
              "name": "_openManagePreferencesModal",
              "privacy": "private",
              "description": "Opens the manage preferences modal and emits an event letting users know"
            },
            {
              "kind": "field",
              "name": "_handleSwitchStates",
              "privacy": "private",
              "description": "Handles the logic of the switch nodes (preferences).\nClicking the “all” switch should turn on all preferences.\nWhen the “all” switch is checked, and one of the other preferences is clicked,\nthen the “all” switch should be unchecked.\nif all switches are checked, the `all` switch should\nbe turned on automatically"
            },
            {
              "kind": "method",
              "name": "renderPreference",
              "privacy": "private",
              "parameters": [
                {
                  "name": "{\n        id, checked, disabled, hasDivider, hasDescription,\n    }",
                  "type": {
                    "text": "Preference"
                  }
                }
              ],
              "description": "Renders the content of the preference item."
            },
            {
              "kind": "method",
              "name": "renderModalContent",
              "privacy": "private",
              "description": "Renders the modal content."
            }
          ],
          "events": [
            {
              "type": {
                "text": "CustomEvent"
              },
              "description": "when all cookies are accepted.",
              "name": "pie-cookie-banner-accept-all"
            },
            {
              "type": {
                "text": "CustomEvent"
              },
              "description": "when all only necessary cookies are accepted.",
              "name": "pie-cookie-banner-necessary-only"
            },
            {
              "type": {
                "text": "CustomEvent"
              },
              "description": "when a user clicks manage preferences.",
              "name": "pie-cookie-banner-manage-prefs"
            },
            {
              "type": {
                "text": "CustomEvent"
              },
              "description": "when a user clicks save preferences.",
              "name": "pie-cookie-banner-prefs-saved"
            }
          ],
          "attributes": [
            {
              "name": "hasPrimaryActionsOnly",
              "fieldName": "hasPrimaryActionsOnly"
            },
            {
              "name": "defaultPreferences",
              "fieldName": "defaultPreferences"
            },
            {
              "name": "cookieStatementLink",
              "fieldName": "cookieStatementLink"
            },
            {
              "name": "personalizedLabel",
              "fieldName": "personalizedLabel"
            },
            {
              "name": "personalizedDescription",
              "fieldName": "personalizedDescription"
            },
            {
              "name": "cookieTechnologiesLink",
              "fieldName": "cookieTechnologiesLink"
            },
            {
              "name": "country",
              "fieldName": "country"
            },
            {
              "name": "language",
              "fieldName": "language"
            },
            {
              "name": "openLinksInSameTab",
              "fieldName": "openLinksInSameTab"
            }
          ],
          "superclass": {
            "name": "PieElement",
            "package": "@justeattakeaway/pie-webc-core/src/internals/PieElement"
          },
          "tagName": "pie-cookie-banner",
          "customElement": true
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "*",
          "declaration": {
            "name": "*",
            "module": "src/defs"
          }
        },
        {
          "kind": "js",
          "name": "PieCookieBanner",
          "declaration": {
            "name": "PieCookieBanner",
            "module": "src/index.js"
          }
        }
      ]
    },
    {
      "kind": "javascript-module",
      "path": "src/localisation-utils.js",
      "declarations": [
        {
          "kind": "function",
          "name": "localiseText",
          "return": {
            "type": {
              "text": "string"
            }
          },
          "parameters": [
            {
              "name": "locale",
              "type": {
                "text": "CookieBannerLocale"
              },
              "description": "locale data object"
            },
            {
              "name": "key",
              "type": {
                "text": "string"
              },
              "description": "path to the key in the locale object"
            }
          ],
          "description": "Localises a plain text string\nIf the key is not found, it will be used as fallback"
        },
        {
          "kind": "function",
          "name": "sanitiseDescriptionHtml",
          "return": {
            "type": {
              "text": "string"
            }
          },
          "parameters": [
            {
              "name": "input",
              "type": {
                "text": "string"
              }
            },
            {
              "name": "linkTarget",
              "default": "'_blank'"
            }
          ],
          "description": "Sanitises an HTML string to allow only safe <a> and <pie-link> tags, and normalises link\nattributes to respect the component's link-target behaviour.\n\nUses DOMPurify for the core sanitisation:\n- Strips all non-link elements (keeping their text content).\n- Removes unsafe href protocols (javascript:, data:, vbscript:).\n- Removes non-allowlisted attributes (only href, rel, target survive).\n\nA post-sanitisation hook then enforces target/rel:\n- Sets target to linkTarget (overrides any existing target).\n- Ensures rel contains \"noopener noreferrer\" when target=\"_blank\"\n  (prevents reverse-tabnabbing).\n\nIn SSR / non-browser environments (no `window`), all HTML is stripped and\nonly the text content is returned — the client will re-render with the full\nsanitisation pass after hydration."
        },
        {
          "kind": "function",
          "name": "localiseRichText",
          "return": {
            "type": {
              "text": "Array<string|TemplateResult>"
            }
          },
          "parameters": [
            {
              "name": "locale",
              "type": {
                "text": "CookieBannerLocale"
              },
              "description": "locale data object"
            },
            {
              "name": "key",
              "type": {
                "text": "string"
              },
              "description": "path to the key in the locale object"
            },
            {
              "name": "customTagEnhancers",
              "type": {
                "text": "CustomTagEnhancers"
              },
              "description": "object containing the custom tag names and their respective enhancer functions"
            }
          ],
          "description": "Localises a rich text string by replacing custom tags with their respective enhancer functions content\nIf the key is not found, it will be used as fallback"
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "localiseText",
          "declaration": {
            "name": "localiseText",
            "module": "src/localisation-utils.js"
          }
        },
        {
          "kind": "js",
          "name": "sanitiseDescriptionHtml",
          "declaration": {
            "name": "sanitiseDescriptionHtml",
            "module": "src/localisation-utils.js"
          }
        },
        {
          "kind": "js",
          "name": "localiseRichText",
          "declaration": {
            "name": "localiseRichText",
            "module": "src/localisation-utils.js"
          }
        }
      ]
    }
  ]
}
