/**
 * Structure Viewer — Shared utilities
 *
 * Small helpers used by the file viewer modal and the exporter.
 * All Explorer-specific UI logic lives in sv-app.js.
 */
(function ($) {
    'use strict';

    window.StructureViewerUtils = {
        /** Return true if the filename has an image extension. */
        isImageFile: function (fileName) {
            var imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'svg', 'webp', 'bmp', 'ico'];
            var ext = String(fileName || '').split('.').pop().toLowerCase();
            return imageExtensions.indexOf(ext) !== -1;
        },

        /** Show the global loading overlay. */
        showLoading: function () { $('#sv-loading').fadeIn(200); },

        /** Hide the global loading overlay. */
        hideLoading: function () { $('#sv-loading').fadeOut(200); }
    };

})(jQuery);
