File manager - Edit - /home/verseaumee/blueversion/wp-content/plugins/wpforms/assets/js/integrations/ai/modules/api.min.js
Back
export default function(){const t={mode:"",actions:{rate:"wpforms_rate_ai_response",choices:"wpforms_get_ai_choices"},async ajax(e){e.nonce||(e.nonce=wpforms_ai_chat_element.nonce);e={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(e).toString()},e=await fetch(wpforms_ai_chat_element.ajaxurl,e).catch(e=>{throw"Failed to fetch"===e.message?new Error(wpforms_ai_chat_element.errors.network):new Error(e.message)});if(!e.ok)throw new Error(wpforms_ai_chat_element.errors.network);e=await e.json();if(!e.success||e.data.error)throw new Error(e.data.error??wpforms_ai_chat_element.errors.default,{cause:e.data.code??400});return e.data},async prompt(e,r){e={action:t.actions[this.mode]??t.actions.choices,prompt:e};return r&&(e.session_id=r),t.ajax(e)},async rate(e,r){e={action:t.actions.rate,helpful:e,response_id:r};return t.ajax(e)},setMode(e){return this.mode=e,this}};return function(e){return{...t}.setMode(e)}}
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings