From 6b29e0dab0040c19db3da38541a8e184697df780 Mon Sep 17 00:00:00 2001
From: Carol Pettirossi <carolpettirossi@gmail.com>
Date: Thu, 20 Jul 2023 13:54:00 -0300
Subject: [PATCH] Issue #3362496: Fix missing js-cookie dependency.

---
 library/js/ahb.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/library/js/ahb.js b/library/js/ahb.js
index 4e1b45f..950866c 100644
--- a/library/js/ahb.js
+++ b/library/js/ahb.js
@@ -1,4 +1,4 @@
-(function ($, Drupal, drupalSettings) {
+(function ($, Drupal, drupalSettings, Cookies) {
     'use strict';
 
     Drupal.behaviors.youtubeModal = {
@@ -23,7 +23,7 @@
             });
 
             // Show/hide help blocks by cookie.
-            var hiddenArray = ($.cookie('AHB_hidden') !== undefined) ? $.parseJSON($.cookie('AHB_hidden')) : [];
+            var hiddenArray = (Cookies.get('AHB_hidden') !== undefined) ? $.parseJSON(Cookies.get('AHB_hidden')) : [];
             $('.block-help-item').each(function () {
               // Show if block is not in the hidden array.
               if ($.inArray($(this).data('block-id'), hiddenArray) === -1 || $.inArray($(this).data('block-id'), hiddenArray) === false) {
@@ -35,9 +35,9 @@
               var block = $(this).parent();
               hiddenArray.push($(block).data('block-id'));
               $(block).addClass('hidden');
-              $.cookie('AHB_hidden', JSON.stringify(hiddenArray), {'path': '/' + drupalSettings.path.currentPath});
+              Cookies.set('AHB_hidden', JSON.stringify(hiddenArray), {'path': '/' + drupalSettings.path.currentPath});
             });
         }
     };
 
-})(jQuery, Drupal, drupalSettings);
+})(jQuery, Drupal, drupalSettings, window.Cookies);
-- 
GitLab