(function($) { try { new Function('$', '$(document).ready(function()\r\n{\r\n const controlsHTML = `\r\n
\r\n
Scroll to View Table
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
`;\r\n\r\n function parsePad(padValue, naturalWidth)\r\n {\r\n const padStr = String(padValue || \'0\');\r\n if (padStr.includes(\'%\'))\r\n {\r\n return naturalWidth * (parseFloat(padStr) / 100);\r\n }\r\n else\r\n {\r\n return parseFloat(padStr) || 0;\r\n }\r\n }\r\n\r\n function measureAndApply(table, cols, callback)\r\n {\r\n const $table = $(table);\r\n\r\n $table.css({\'table-layout\': \'auto\', \'width\': \'auto\'});\r\n\r\n const headers = table.querySelectorAll(\'tr:first-child th\');\r\n $(headers).css(\'white-space\', \'nowrap\');\r\n\r\n setTimeout(function()\r\n {\r\n const colgroup = document.createElement(\'colgroup\');\r\n\r\n cols.forEach(function(col, i)\r\n {\r\n const colEl = document.createElement(\'col\');\r\n if (headers[i])\r\n {\r\n const naturalWidth = headers[i].offsetWidth;\r\n const padding = parsePad(col.pad, naturalWidth);\r\n colEl.style.width = Math.round(naturalWidth + padding) + \'px\';\r\n }\r\n else\r\n {\r\n colEl.style.width = \'100px\';\r\n }\r\n colgroup.appendChild(colEl);\r\n });\r\n\r\n $table.css({\'table-layout\': \'fixed\'});\r\n\r\n let totalWidth = 0;\r\n colgroup.querySelectorAll(\'col\').forEach(function(col)\r\n {\r\n totalWidth += parseInt(col.style.width);\r\n });\r\n $table.css(\'width\', totalWidth + \'px\');\r\n\r\n table.insertBefore(colgroup, table.firstChild);\r\n\r\n if (callback) callback(totalWidth);\r\n\r\n }, 50);\r\n }\r\n\r\n function initTable(table)\r\n {\r\n const $table = $(table);\r\n const wrap = $table.closest(\'.hscroll_table_wrap\');\r\n const cols = wrap.data(\'cols\');\r\n\r\n // Inject controls if not already present\r\n if (wrap.find(\'.hscroll_table_controls\').length === 0)\r\n {\r\n wrap.prepend(controlsHTML);\r\n }\r\n\r\n const controls = wrap.find(\'.hscroll_table_controls\');\r\n\r\n // Destroy existing draggable if present\r\n if ($table.data(\'draggable-instance\'))\r\n {\r\n $table.data(\'draggable-instance\').kill();\r\n $table.data(\'draggable-instance\', null);\r\n }\r\n\r\n // Remove existing colgroup and reset styles\r\n $table.find(\'colgroup\').remove();\r\n $table.css({\'table-layout\': \'fixed\', \'width\': \'100%\'});\r\n gsap.set(table, {x: 0});\r\n\r\n const firstColCells = table.querySelectorAll(\'th:first-child, td:first-child\');\r\n gsap.set(firstColCells, {x: 0});\r\n\r\n // Hide controls on reset\r\n controls.hide();\r\n\r\n if (!cols || !cols.length) return;\r\n\r\n measureAndApply(table, cols, function(totalWidth)\r\n {\r\n const containerWidth = wrap[0].offsetWidth;\r\n\r\n if (totalWidth > containerWidth)\r\n {\r\n // Show controls only when scroll is needed\r\n controls.css(\'display\', \'flex\');\r\n initDraggable();\r\n }\r\n else\r\n {\r\n $table.css(\'width\', \'100%\');\r\n }\r\n });\r\n\r\n function initDraggable()\r\n {\r\n const firstCol = table.querySelectorAll(\'th:first-child, td:first-child\');\r\n const lastColWidth = table.querySelector(\'.hscroll_table_last_column\').offsetWidth;\r\n const containerWidth = wrap[0].offsetWidth;\r\n\r\n let minx_offset = (table.offsetWidth - containerWidth) * -1;\r\n\r\n gsap.registerPlugin(Draggable);\r\n\r\n const draggable = Draggable.create(table, {\r\n type: \"x\",\r\n bounds: { minX: minx_offset, maxX: 0 },\r\n onDrag: updateStickyColumn,\r\n onThrowUpdate: updateStickyColumn,\r\n onPress: function() { this.cursor = \'grabbing\'; },\r\n onRelease: function() { this.cursor = \'grab\'; }\r\n })[0];\r\n\r\n $table.data(\'draggable-instance\', draggable);\r\n\r\n function scrollTable(amount)\r\n {\r\n let newX = draggable.x + amount;\r\n newX = Math.max(draggable.vars.bounds.minX, Math.min(newX, draggable.vars.bounds.maxX));\r\n gsap.to(table, {\r\n x: newX,\r\n duration: 0.5,\r\n onUpdate: () => gsap.set(firstCol, { x: -gsap.getProperty(table, \"x\") }),\r\n onComplete: () => draggable.update()\r\n });\r\n }\r\n\r\n function updateStickyColumn()\r\n {\r\n gsap.set(firstCol, { x: -draggable.x });\r\n }\r\n\r\n controls.find(\'.hscroll_table_control_right\').off(\'click\').on(\'click\', function()\r\n {\r\n scrollTable(-lastColWidth);\r\n });\r\n\r\n controls.find(\'.hscroll_table_control_left\').off(\'click\').on(\'click\', function()\r\n {\r\n scrollTable(lastColWidth);\r\n });\r\n }\r\n }\r\n\r\n // Init all tables on load\r\n $(\'.hscroll_table\').each(function()\r\n {\r\n initTable(this);\r\n });\r\n\r\n // Reinit on resize with debounce\r\n let resizeTimer;\r\n $(window).on(\'resize\', function()\r\n {\r\n clearTimeout(resizeTimer);\r\n resizeTimer = setTimeout(function()\r\n {\r\n $(\'.hscroll_table\').each(function()\r\n {\r\n initTable(this);\r\n });\r\n }, 150);\r\n });\r\n});')($); } catch(e) { console.error('[Table horizontal scroller..]', e); } })(sugjquery); (function($) { try { new Function('$', '$(document).ready(function() {\r\n\r\n$(\'.lazyload\').lazy({\r\neffect: \'fadeIn\',\r\neffectTime: 2000,\r\nthreshold: 0,\r\nvisibleOnly: true,\r\n\r\nonLoad: function(element) {\r\nvar imageSrc = element.data(\'src\');\r\nvar prop_id = element.attr(\'id\');\r\nconsole.log(\'div id \"\' + prop_id + \'\" scrolled to\');\r\nconsole.dir(element.data());\r\n},\r\n\r\nafterLoad: function(element) {\r\nvar imageSrc = element.data(\'src\');\r\nvar prop_id = element.attr(\'id\');\r\n},\r\n\r\nonError: function(element) {\r\nvar imageSrc = element.data(\'src\');\r\nconsole.log(\'image \"\' + imageSrc + \'\" could not be loaded\');\r\n},\r\n\r\nonFinishedAll: function() {}\r\n}); // .lazy\r\n\r\n}); // document.ready')($); } catch(e) { console.error('[Lazy Load]', e); } })(sugjquery); (function($) { try { new Function('$', '$(document).ready(function() {\r\n\r\n function applyClamp($el, lines) {\r\n $el[0].style.display = \'-webkit-box\';\r\n $el[0].style.webkitBoxOrient = \'vertical\';\r\n $el[0].style.webkitLineClamp = lines;\r\n $el[0].style.overflow = \'hidden\';\r\n $el[0].style.height = \'\';\r\n }\r\n\r\n function removeClamp($el) {\r\n $el[0].style.display = \'block\';\r\n $el[0].style.webkitBoxOrient = \'\';\r\n $el[0].style.webkitLineClamp = \'\';\r\n $el[0].style.overflow = \'visible\';\r\n }\r\n\r\n function initTruncation() {\r\n $(\'.truncate-text\').each(function() {\r\n var $el = $(this);\r\n var lines = parseInt($el.data(\'lines\')) || 3;\r\n\r\n $el.removeClass(\'expanded\');\r\n applyClamp($el, lines);\r\n\r\n // Force reflow\r\n $el[0].offsetHeight;\r\n\r\n var clampedHeight = $el[0].offsetHeight;\r\n var fullHeight = $el[0].scrollHeight;\r\n\r\n $el.data(\'clamped-height\', clampedHeight);\r\n\r\n $el.next(\'.read-more\').remove();\r\n\r\n if (fullHeight > clampedHeight + 2) {\r\n $el.after(\'Read more\');\r\n }\r\n });\r\n }\r\n\r\n $(document).on(\'click\', \'.read-more\', function() {\r\n var $this = $(this);\r\n var $text = $this.prev(\'.truncate-text\');\r\n var lines = parseInt($text.data(\'lines\')) || 3;\r\n var clampedHeight = $text.data(\'clamped-height\');\r\n\r\n if ($text.hasClass(\'expanded\')) {\r\n // COLLAPSING\r\n var startHeight = $text[0].offsetHeight;\r\n\r\n // Apply clamp via DOM first\r\n applyClamp($text, lines);\r\n $text[0].style.height = startHeight + \'px\';\r\n\r\n // Force reflow\r\n $text[0].offsetHeight;\r\n\r\n $text.animate({ height: clampedHeight }, 300, function() {\r\n $text.removeClass(\'expanded\');\r\n $text[0].style.height = \'\';\r\n });\r\n\r\n $this.text(\'Read more\');\r\n\r\n } else {\r\n // EXPANDING\r\n var startHeight = $text[0].offsetHeight;\r\n\r\n removeClamp($text);\r\n $text[0].style.height = startHeight + \'px\';\r\n\r\n var fullHeight = $text[0].scrollHeight;\r\n\r\n $text.animate({ height: fullHeight }, 300, function() {\r\n $text.addClass(\'expanded\');\r\n $text[0].style.height = \'auto\';\r\n });\r\n\r\n $this.text(\'Read less\');\r\n }\r\n });\r\n\r\n initTruncation();\r\n\r\n $(window).on(\'resize\', function() {\r\n $(\'.truncate-text\').each(function() {\r\n var $el = $(this);\r\n $el.removeClass(\'expanded\');\r\n applyClamp($el, parseInt($el.data(\'lines\')) || 3);\r\n });\r\n initTruncation();\r\n });\r\n\r\n});')($); } catch(e) { console.error('[Read More (Truncate content)]', e); } })(sugjquery); (function($) { try { new Function('$', 'window.c_match_size = function(parentId, sourceSelector, targets, mode)\r\n{\r\n mode = mode || \'height\';\r\n\r\n if (typeof targets === \'string\') targets = [targets];\r\n if (targets && !Array.isArray(targets)) targets = [targets];\r\n\r\n var sourceMode = \'selector\';\r\n var candidateSelector = null;\r\n\r\n if (sourceSelector.indexOf(\'highest:\') === 0) {\r\n sourceMode = \'highest\';\r\n candidateSelector = sourceSelector.substring(8);\r\n }\r\n\r\n // Determine if this call involves any height measurement\r\n var needsDefer = (sourceMode === \'highest\') ||\r\n (mode === \'height\') ||\r\n (mode === \'both\') ||\r\n (Array.isArray(targets) && targets.some(function(t) {\r\n return typeof t === \'object\' && (t.mode === \'height\' || t.mode === \'both\');\r\n }));\r\n\r\n function resolve_source($parent) {\r\n if (sourceMode === \'highest\') {\r\n var $source = $parent.find(candidateSelector).sort(function(a, b) {\r\n return $(b).outerHeight() - $(a).outerHeight();\r\n }).first();\r\n return $source;\r\n }\r\n return $parent.find(sourceSelector).first();\r\n }\r\n\r\n function set_size() {\r\n var $parent = $(\'#\' + parentId);\r\n if (!$parent.length) return;\r\n\r\n var $source = resolve_source($parent);\r\n if (!$source.length) return;\r\n\r\n var targetHeight = $source.outerHeight();\r\n var targetWidth = $source.outerWidth();\r\n\r\n if (!targets) {\r\n if (mode === \'height\' || mode === \'both\') $parent.find(\'div\').css(\'height\', targetHeight + \'px\');\r\n if (mode === \'width\' || mode === \'both\') $parent.find(\'div\').css(\'width\', targetWidth + \'px\');\r\n return;\r\n }\r\n\r\n $.each(targets, function(i, target) {\r\n var selector, targetMode;\r\n\r\n if (typeof target === \'object\' && target.selector) {\r\n selector = target.selector;\r\n targetMode = target.mode || mode;\r\n } else {\r\n selector = target;\r\n targetMode = mode;\r\n }\r\n\r\n var $matched = $parent.find(selector);\r\n\r\n if (targetMode === \'height\' || targetMode === \'both\') $matched.css(\'height\', targetHeight + \'px\');\r\n if (targetMode === \'width\' || targetMode === \'both\') $matched.css(\'width\', targetWidth + \'px\');\r\n });\r\n }\r\n\r\n var resizeTimer;\r\n\r\n // Width-only calls fire immediately; anything involving height defers to after reflow\r\n if (needsDefer) {\r\n setTimeout(set_size, 50);\r\n } else {\r\n set_size();\r\n }\r\n\r\n $(window).on(\'resize\', function() {\r\n clearTimeout(resizeTimer);\r\n resizeTimer = setTimeout(set_size, 100);\r\n });\r\n}')($); } catch(e) { console.error('[Match - Height/width]', e); } })(sugjquery); (function($) { try { new Function('$', 'jQuery(function ($) {\r\n\r\n console.log(\'Lightbox hash script loaded\');\r\n console.log(\'jQuery type:\', typeof $);\r\n console.log(\'$.fancybox type:\', typeof $.fancybox);\r\n console.log(\'$.fancybox.open type:\', $.fancybox ? typeof $.fancybox.open : \'undefined\');\r\n\r\n function openLightboxFromHash(hash) {\r\n console.log(\'openLightboxFromHash called with:\', hash);\r\n\r\n var match = hash.match(/^#lightbox-([a-zA-Z0-9_-]+)-(\\d+)$/);\r\n console.log(\'Regex match:\', match);\r\n\r\n if (!match) {\r\n console.log(\'No regex match, aborting\');\r\n return false;\r\n }\r\n\r\n if (typeof $.fancybox === \'undefined\' || typeof $.fancybox.open !== \'function\') {\r\n console.log(\'$.fancybox.open is not available\');\r\n return false;\r\n }\r\n\r\n var group = match[1];\r\n var index = parseInt(match[2], 10) - 1;\r\n var items = [];\r\n\r\n console.log(\'Parsed group:\', group);\r\n console.log(\'Parsed index:\', index);\r\n\r\n $(\'[data-fancybox=\"\' + group + \'\"]\').each(function (i) {\r\n var item = {\r\n src: $(this).attr(\'href\'),\r\n type: \'image\',\r\n opts: {\r\n caption: $(this).attr(\'data-caption\') || \'\'\r\n }\r\n };\r\n\r\n console.log(\'Found gallery item\', i, item);\r\n items.push(item);\r\n });\r\n\r\n console.log(\'Final items array:\', items);\r\n\r\n if (!items.length) {\r\n console.log(\'No items found for group:\', group);\r\n return false;\r\n }\r\n\r\n if (index < 0 || index >= items.length) {\r\n console.log(\'Index out of range:\', index, \'items length:\', items.length);\r\n return false;\r\n }\r\n\r\n console.log(\'Opening fancybox at index:\', index);\r\n\r\n $.fancybox.open(items, {\r\n loop: true,\r\n buttons: [\'close\']\r\n }, index);\r\n\r\n return true;\r\n }\r\n\r\n $(document).on(\'click\', \'a[href^=\"#lightbox-\"]\', function (e) {\r\n var hash = $(this).attr(\'href\');\r\n console.log(\'Trigger clicked:\', hash);\r\n\r\n if (openLightboxFromHash(hash)) {\r\n console.log(\'Preventing default click behavior\');\r\n e.preventDefault();\r\n } else {\r\n console.log(\'Did not open lightbox\');\r\n }\r\n });\r\n\r\n window.triggerLightboxHash = function(hash) {\r\n console.log(\'triggerLightboxHash called with:\', hash);\r\n\r\n var $tmp = $(\'\', {\r\n href: hash,\r\n style: \'display:none;\'\r\n });\r\n\r\n $(\'body\').append($tmp);\r\n $tmp.trigger(\'click\');\r\n $tmp.remove();\r\n\r\n return false;\r\n };\r\n\r\n if (window.location.hash) {\r\n console.log(\'Page loaded with hash:\', window.location.hash);\r\n openLightboxFromHash(window.location.hash);\r\n } else {\r\n console.log(\'No hash on page load\');\r\n }\r\n\r\n});')($); } catch(e) { console.error('[Lightbox - Auto Link]', e); } })(sugjquery); (function($) { try { new Function('$', 'var matchButtonWidthRegistry = [];\r\nvar matchButtonWidthResizeTimer = null;\r\nvar matchButtonWidthsBound = false;\r\n\r\nwindow.match_button_widths = function(blockSelector, btn1Selector, btn2Selector) {\r\n matchButtonWidthRegistry.push({\r\n blockSelector: blockSelector,\r\n btn1Selector: btn1Selector,\r\n btn2Selector: btn2Selector\r\n });\r\n\r\n apply_match_button_widths();\r\n\r\n if (!matchButtonWidthsBound) {\r\n matchButtonWidthsBound = true;\r\n\r\n $(window).on(\'resize.match_button_widths\', function () {\r\n clearTimeout(matchButtonWidthResizeTimer);\r\n matchButtonWidthResizeTimer = setTimeout(apply_match_button_widths, 100);\r\n });\r\n }\r\n};\r\n\r\nfunction apply_match_button_widths() {\r\n $.each(matchButtonWidthRegistry, function (_, config) {\r\n $(config.blockSelector).each(function () {\r\n var $block = $(this);\r\n var $btn1 = $block.find(config.btn1Selector);\r\n var $btn2 = $block.find(config.btn2Selector);\r\n\r\n if (!$btn1.length || !$btn2.length) {\r\n return;\r\n }\r\n\r\n $btn1.css(\'width\', \'\');\r\n $btn2.css(\'width\', \'\');\r\n\r\n var width1 = $btn1.outerWidth();\r\n var width2 = $btn2.outerWidth();\r\n var maxWidth = Math.max(width1, width2);\r\n\r\n $btn1.css(\'width\', maxWidth + \'px\');\r\n $btn2.css(\'width\', maxWidth + \'px\');\r\n });\r\n });\r\n}')($); } catch(e) { console.error('[Buttons Match Width]', e); } })(sugjquery); (function($) { try { new Function('$', 'jQuery(document).ready(function ($) {\r\n $(document).on(\'click\', \'.swap_01\', function (e) {\r\n e.preventDefault();\r\n\r\n var hideTarget = $(this).data(\'swap-hide\');\r\n var showTarget = $(this).data(\'swap-show\');\r\n var showClass = $(this).data(\'swap-show-class\') || \'is-block\';\r\n var useParent = $(this).data(\'swap-parent\');\r\n\r\n // default to true unless explicitly false\r\n if (useParent !== false) {\r\n useParent = true;\r\n }\r\n\r\n var $hideEl = hideTarget ? $(hideTarget) : $();\r\n var $showEl = showTarget ? $(showTarget) : $();\r\n\r\n if (useParent) {\r\n $hideEl = $hideEl.parent();\r\n $showEl = $showEl.parent();\r\n }\r\n\r\n if ($hideEl.length) {\r\n $hideEl.removeClass(\'is-block is-flex\').css(\'display\', \'none\');\r\n }\r\n\r\n if ($showEl.length) {\r\n $showEl.css(\'display\', \'\')\r\n .removeClass(\'is-block is-flex\')\r\n .addClass(showClass);\r\n }\r\n });\r\n});')($); } catch(e) { console.error('[Element Swap - onclick]', e); } })(sugjquery); (function($) { try { new Function('$', '')($); } catch(e) { console.error('[Table Row widths (css)]', e); } })(sugjquery);