{"version":3,"sources":["webpack:///./assets/src/js/parts/image-with-caption.js"],"names":["console","log","document","querySelectorAll","forEach","figure","img","querySelector","aspectRatio","naturalWidth","naturalHeight","classList","remove","add"],"mappings":";;;;;;;;;;;;;;;;;oHAAA,OAAe,qBACdA,QAAQC,IAAI,sBAGIC,SAASC,iBAAiB,0BAElCC,SAAQ,SAACC,GAChB,IAAMC,EAAMD,EAAOE,cAAc,OACjC,GAAKD,EAAL,CAGA,IAIME,EAJQF,EAAIG,aACHH,EAAII,cAMnBL,EAAOM,UAAUC,OAAO,iCAAkC,gCAGtDJ,EAAc,EACjBH,EAAOM,UAAUE,IAAI,kCAErBR,EAAOM,UAAUE,IAAI","file":"main/parts/image-with-caption-0dd979f7.js","sourcesContent":["export default () => {\n\tconsole.log(\"image-with-caption\");\n\n\t// Find all figure elements within editor-content\n\tconst figures = document.querySelectorAll(\".editor-content figure\");\n\n\tfigures.forEach((figure) => {\n\t\tconst img = figure.querySelector(\"img\");\n\t\tif (!img) return;\n\n\t\t// Get image dimensions\n\t\tconst width = img.naturalWidth;\n\t\tconst height = img.naturalHeight;\n\n\t\t// Calculate aspect ratio\n\t\tconst aspectRatio = width / height;\n\n\t\t// Remove existing classes if any\n\t\tfigure.classList.remove(\"image-with-caption__horizontal\", \"image-with-caption__vertical\");\n\n\t\t// Add appropriate class based on aspect ratio\n\t\tif (aspectRatio > 1) {\n\t\t\tfigure.classList.add(\"image-with-caption__horizontal\");\n\t\t} else {\n\t\t\tfigure.classList.add(\"image-with-caption__vertical\");\n\t\t}\n\t});\n};\n"],"sourceRoot":""}