"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("react"),s=require("../common/helpers.js");exports.default=(p,r)=>{let o=e.useEditorMode(),{editorData:l}=p||{},{customLabel:i}=r||{},a=t.useMemo(()=>`
      <p class="gp-text-center gp-text-sm gp-py-4 gp-leading-6 gp-text-light-500 gp-flex gp-flex-col gp-gap-[4px]">
       <span>${i||"Custom Code"}</span>
       ${l?.css||l?.javascript||l?.html?'<span class="gp-text-[#676767] gp-text-12 gp-leading-5" data-test="publish-hint">Publish the page to see the content.</span>':""}
      </p>`,[i]),n=t.useMemo(()=>{if("edit"===o){let e=s.removeScriptTags(l?.html||""),t=s.checkIsEmpty(e);return t?a:e.trim()}return l?.html?.trim()},[o,l?.html,a]);return{mode:o,htmlPlainText:n,handleDoubleClickCustomCode:e=>{if(2===e.detail){let e=new CustomEvent("editor:toolbar:open-custom-code",{bubbles:!0});window.dispatchEvent(e)}}}};
