import{useEditorMode as t}from"@gem-sdk/core";import{useMemo as e}from"react";import{removeScriptTags as p,checkIsEmpty as o}from"../common/helpers.js";let s=(s,l)=>{let r=t(),{editorData:a}=s||{},{customLabel:i}=l||{},m=e(()=>`
      <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>
       ${a?.css||a?.javascript||a?.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=e(()=>{if("edit"===r){let t=p(a?.html||""),e=o(t);return e?m:t.trim()}return a?.html?.trim()},[r,a?.html,m]);return{mode:r,htmlPlainText:n,handleDoubleClickCustomCode:t=>{if(2===t.detail){let t=new CustomEvent("editor:toolbar:open-custom-code",{bubbles:!0});window.dispatchEvent(t)}}}};export{s as default};
