| Server IP : 159.69.118.108 / Your IP : 216.73.216.200 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu-4gb-fsn1-1 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 13:53:54 UTC 2025 aarch64 User : root ( 0) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/lauthiamkok.net/prototype.lauthiamkok.net.sensewithdata/assets/ |
Upload File : |
import{h as m,r as p,j as S,f as b,u as i,k as u,m as f,l as E}from"./vuelidate.a8eab91a.js";import{u as L,_ as R}from"./vendors.2bf68b2a.js";import{u as $}from"./use-fetch.c391a8ae.js";const x={props:{recaptchaElement:{type:String,default:""},api:{type:String,default:""},postId:{type:Number,default:""}},setup(g){const o=g,h=L(),v=m(()=>h.getters["recaptcha/getWidgetIds"]),e=p({name:"",email:"",comment:"",token:""}),t=p({status:"",message:""}),y=m(()=>({name:{required:u,minLength:f(6)},email:{required:u,isEmail:E},comment:{required:u,minLength:f(120)}})),r=S(y,e);async function k(){if(!await r.value.$validate())return;const c=R.find(v.value,{elementId:o.recaptchaElement}).widgetId,l=grecaptcha.getResponse(c);if(l&&(t.status=null,e.token=l),!e.token){t.status="!token";return}const d=document.getElementById("wait");d.classList.remove("hidden"),e.post_id=o.postId,e.parent_id=0;const{data:n}=await $(o.api,{method:"POST",body:JSON.stringify(e),headers:{"Content-type":"application/json; charset=UTF-8"}});d.classList.add("hidden"),grecaptcha.reset(c),n.status==="error"&&(e.token=""),n.status==="ok"&&(r.value.$reset(),Object.entries(e).forEach(([w,F])=>{e[w]=""}),e.parent_id=0),n&&(t.status=n.status,t.message=n.message)}function I(s){t.status=null,t.message=null}function _(s){const a=s.target;a.style.height="",a.style.height=a.scrollHeight+10+"px"}return(s,a)=>b(s.$slots,"default",{v$:i(r),form:i(e),response:i(t),submitForm:k,resetResponse:I,autosize:_})}};export{x as _};