"use strict";var core=require("@gem-sdk/core"),React=require("react");const useDispatchAfterSubmitEvent=e=>{let{trigger:t}=core.useInteraction();return React.useCallback(()=>{let r=document.querySelector(`[data-id="${e}"]`);if(!r)return;let a=JSON.parse(r?.getAttribute("gp-interaction-after-submit")??"{}");Object.keys(a).length<=0||Object.entries(a).forEach(([a])=>{t({event:"gp:after-submit",selector:`[data-id="${e}"]`,data:Number(a),element:r})})},[e,t])};exports.useDispatchAfterSubmitEvent=useDispatchAfterSubmitEvent;
