'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),Head=require("next/head"),useCSSCode=require("../hooks/useCSSCode.js"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js");const CSSCode=({setting:e,style:s,advanced:r,builderAttrs:t,builderProps:a,children:i,pageContext:d})=>{let{editorData:l}=r,{handleDoubleClickCustomCode:n,htmlPlainText:u,mode:m}=useCSSCode.default(r,e),o=system.createStyle(styles.getCodeStyle({setting:e,style:s,isLiquid:!1,uid:a?.uid,pageContext:d??{},type:"React"})),c=system.createClass(classes.getCodeClasses(a?.uid,"edit"!==m&&!l?.html,r?.cssClass));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Head,{children:!!e?.preloadBgImage&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!!e?.background?.desktop?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:e.background.desktop.image.src,as:"image"}),!!e?.background?.tablet?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:e.background.tablet.image.src,as:"image"}),!!e?.background?.mobile?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:e.background.mobile.image.src,as:"image"})]})}),jsxRuntime.jsxs("div",{onClick:n,"aria-hidden":"true",style:o,...t,className:c,children:[jsxRuntime.jsx("div",{dangerouslySetInnerHTML:{__html:u||""}}),i]})]})};exports.default=CSSCode;
