<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

function aieo_consent_known_cookies() {
	return array(
		
		array( 'PHPSESSID', 'exact', 'PHP session', 'necessary', __( 'Preserves the user session state across page requests.', 'ai-eshop-optimizer' ) ),
		array( 'wordpress_logged_in_', 'prefix', 'WordPress', 'necessary', __( 'Keeps you signed in to WordPress.', 'ai-eshop-optimizer' ) ),
		array( 'wordpress_sec_', 'prefix', 'WordPress', 'necessary', __( 'Secure authentication token for the WordPress admin.', 'ai-eshop-optimizer' ) ),
		array( 'wordpress_', 'prefix', 'WordPress', 'necessary', __( 'Authentication for logged-in users.', 'ai-eshop-optimizer' ) ),
		array( 'wp-settings-', 'prefix', 'WordPress', 'necessary', __( 'Stores your WordPress admin screen preferences.', 'ai-eshop-optimizer' ) ),
		array( 'wp_woocommerce_session_', 'prefix', 'WooCommerce', 'necessary', __( 'Maintains the cart and checkout session.', 'ai-eshop-optimizer' ) ),
		array( 'woocommerce_cart_hash', 'exact', 'WooCommerce', 'necessary', __( 'Tracks changes to the cart contents.', 'ai-eshop-optimizer' ) ),
		array( 'woocommerce_items_in_cart', 'exact', 'WooCommerce', 'necessary', __( 'Indicates whether the cart has items.', 'ai-eshop-optimizer' ) ),
		array( 'woocommerce_recently_viewed', 'exact', 'WooCommerce', 'functional', __( 'Remembers the products you viewed recently.', 'ai-eshop-optimizer' ) ),
		array( 'aieo_consent', 'exact', 'AIEO Consent', 'necessary', __( 'Stores your cookie preferences.', 'ai-eshop-optimizer' ) ),

		
		array( '_grecaptcha', 'exact', 'Google reCAPTCHA', 'functional', __( 'Spam and bot protection on forms.', 'ai-eshop-optimizer' ) ),
		array( 'pll_language', 'exact', 'Polylang', 'functional', __( 'Remembers your selected language.', 'ai-eshop-optimizer' ) ),
		array( 'wp-wpml_current_language', 'exact', 'WPML', 'functional', __( 'Remembers your selected language.', 'ai-eshop-optimizer' ) ),

		
		array( '_ga_', 'prefix', 'Google Analytics 4', 'analytics', __( 'Per-stream session state for Google Analytics.', 'ai-eshop-optimizer' ) ),
		array( '_ga', 'exact', 'Google Analytics', 'analytics', __( 'Distinguishes unique visitors.', 'ai-eshop-optimizer' ) ),
		array( '_gid', 'exact', 'Google Analytics', 'analytics', __( 'Distinguishes unique visitors (24 hours).', 'ai-eshop-optimizer' ) ),
		array( '_gat_', 'prefix', 'Google Analytics', 'analytics', __( 'Throttles the request rate.', 'ai-eshop-optimizer' ) ),
		array( '_gat', 'exact', 'Google Analytics', 'analytics', __( 'Throttles the request rate.', 'ai-eshop-optimizer' ) ),
		array( '_hjSessionUser_', 'prefix', 'Hotjar', 'analytics', __( 'Hotjar user identifier across sessions.', 'ai-eshop-optimizer' ) ),
		array( '_hjSession_', 'prefix', 'Hotjar', 'analytics', __( 'Hotjar behaviour and heatmap session.', 'ai-eshop-optimizer' ) ),
		array( '_clck', 'exact', 'Microsoft Clarity', 'analytics', __( 'Microsoft Clarity behaviour analytics.', 'ai-eshop-optimizer' ) ),
		array( '_clsk', 'exact', 'Microsoft Clarity', 'analytics', __( 'Microsoft Clarity session replay.', 'ai-eshop-optimizer' ) ),

		
		array( '_fbp', 'exact', 'Meta (Facebook) Pixel', 'marketing', __( 'Identifies browsers for ad delivery and measurement.', 'ai-eshop-optimizer' ) ),
		array( '_fbc', 'exact', 'Meta (Facebook)', 'marketing', __( 'Stores the ad-click identifier (fbclid).', 'ai-eshop-optimizer' ) ),
		array( '_gcl_', 'prefix', 'Google Ads', 'marketing', __( 'Stores ad-click info for conversion attribution.', 'ai-eshop-optimizer' ) ),
		array( 'IDE', 'exact', 'Google DoubleClick', 'marketing', __( 'Cross-site ad targeting and measurement.', 'ai-eshop-optimizer' ) ),
		array( 'DSID', 'exact', 'Google DoubleClick', 'marketing', __( 'Cross-device ad measurement.', 'ai-eshop-optimizer' ) ),
		array( '_ttp', 'exact', 'TikTok Pixel', 'marketing', __( 'TikTok ad measurement and retargeting.', 'ai-eshop-optimizer' ) ),
		array( '_tt_enable_cookie', 'exact', 'TikTok Pixel', 'marketing', __( 'Enables TikTok pixel measurement.', 'ai-eshop-optimizer' ) ),
		array( '_uetsid', 'exact', 'Microsoft Advertising', 'marketing', __( 'Bing / Microsoft ad measurement.', 'ai-eshop-optimizer' ) ),
		array( '_uetvid', 'exact', 'Microsoft Advertising', 'marketing', __( 'Bing / Microsoft ad measurement (persistent).', 'ai-eshop-optimizer' ) ),
		array( 'lidc', 'exact', 'LinkedIn', 'marketing', __( 'LinkedIn routing for ad measurement.', 'ai-eshop-optimizer' ) ),
		array( 'bcookie', 'exact', 'LinkedIn', 'marketing', __( 'LinkedIn browser identifier for ads.', 'ai-eshop-optimizer' ) ),
	);
}

function aieo_consent_service_hosts() {
	return array(
		'fonts.googleapis.com'    => array( 'service' => 'Google Fonts', 'category' => 'functional', 'description' => __( 'Loads web fonts; transmits the visitor IP to Google.', 'ai-eshop-optimizer' ) ),
		'fonts.gstatic.com'       => array( 'service' => 'Google Fonts', 'category' => 'functional', 'description' => __( 'Serves web-font files from Google.', 'ai-eshop-optimizer' ) ),
		'www.googletagmanager.com' => array( 'service' => 'Google Tag Manager', 'category' => 'analytics', 'description' => __( 'Loads analytics and marketing tags.', 'ai-eshop-optimizer' ) ),
		'www.google-analytics.com' => array( 'service' => 'Google Analytics', 'category' => 'analytics', 'description' => __( 'Website usage analytics.', 'ai-eshop-optimizer' ) ),
		'connect.facebook.net'    => array( 'service' => 'Meta (Facebook) Pixel', 'category' => 'marketing', 'description' => __( 'Facebook advertising pixel.', 'ai-eshop-optimizer' ) ),
		'www.youtube.com'         => array( 'service' => 'YouTube', 'category' => 'marketing', 'description' => __( 'Embedded YouTube video player.', 'ai-eshop-optimizer' ) ),
		'www.youtube-nocookie.com' => array( 'service' => 'YouTube (no-cookie)', 'category' => 'functional', 'description' => __( 'Embedded YouTube player in privacy-enhanced mode.', 'ai-eshop-optimizer' ) ),
		'player.vimeo.com'        => array( 'service' => 'Vimeo', 'category' => 'marketing', 'description' => __( 'Embedded Vimeo video player.', 'ai-eshop-optimizer' ) ),
		'maps.googleapis.com'     => array( 'service' => 'Google Maps', 'category' => 'functional', 'description' => __( 'Embedded Google Maps.', 'ai-eshop-optimizer' ) ),
		'www.google.com/recaptcha' => array( 'service' => 'Google reCAPTCHA', 'category' => 'functional', 'description' => __( 'Spam and bot protection.', 'ai-eshop-optimizer' ) ),
		'static.hotjar.com'       => array( 'service' => 'Hotjar', 'category' => 'analytics', 'description' => __( 'Behaviour analytics and heatmaps.', 'ai-eshop-optimizer' ) ),
		'analytics.tiktok.com'    => array( 'service' => 'TikTok Pixel', 'category' => 'marketing', 'description' => __( 'TikTok advertising pixel.', 'ai-eshop-optimizer' ) ),
	);
}
