`;
formContainer.addEventListener('input', function () {
const fields = ['street', 'number', 'neighborhood', 'city', 'state', 'cep'];
fields.forEach(field => {
const input = formContainer.querySelector(`.${field}`);
if (input.checkValidity()) input.classList.remove('invalid');
});
});
formContainer.addEventListener('submit', function (event) {
event.preventDefault();
const fields = ['street', 'number', 'neighborhood', 'city', 'state', 'cep'];
let isValid = true;
fields.forEach(field => {
const input = formContainer.querySelector(`.${field}`);
if (!input.checkValidity()) {
input.classList.add('invalid');
isValid = false;
}
});
if (!isValid) return;
formContainer.querySelector('.submit').remove();
const payload = fields.reduce((acc, field) => {
acc[field] = formContainer.querySelector(`.${field}`).value;
return acc;
}, {});
window.voiceflow.chat.interact({
type: 'complete',
payload: payload,
});
});
element.appendChild(formContainer);
},
};
staticwidget = false;
if (staticwidget === true) {
var run = 0;
function excludeDots(){
const shadowHost = document.querySelector('#voiceflow-chat');
const shadowRoot = shadowHost.shadowRoot;
const launcher = shadowRoot.querySelector('.vfrc-widget--launcher.c-PJLV');
if (launcher && run === 0) {
launcher.addEventListener('click', () => {
setTimeout(() => {
const dots = shadowRoot.querySelectorAll('.dot');
dots[0].classList.add('highlight');
run = run + 1;
}, 100); // 1 segundo de atraso antes de esconder as bolinhas
});
}
}
setTimeout(excludeDots, 1000);
(function (d, t) {
var v = d.createElement(t), s = d.getElementsByTagName(t)[0];
v.onload = function () {
window.voiceflow.chat.load({"verify":{"projectID":"682e0de3054e3b475c467695"},"url":"https://general-runtime.voiceflow.com","versionID":"production","assistant":{"title":"Mel","description":"Oi, otaku! 💖 Como posso te ajudar hoje? Você pode perguntar sobre seu pedido, troca, envio ou produto!","image":"https://d2h6cfhq6tgb2e.cloudfront.net/store/80cc56d4-e47e-4df4-a101-05be5bc3ca3b/logo.png","avatar":"https://d2h6cfhq6tgb2e.cloudfront.net/store/80cc56d4-e47e-4df4-a101-05be5bc3ca3b/avatar.png","color":"#25d366","extensions":[FormExtension]},"launch":{"event":{"type":"launch","payload":{"language":"português","bot_name":"Mel","nome_ecommerce":"Mundo Otaku","email_ecommerce":"contato@lojamundootaku.com.br","telefone_ecommerce":"22998311403","rastreio_link":"https://lojamundootaku.com.br/apps/rastreio","nicho_ecommerce":"Geek, Nerd e Kawaii","url_site":"youranimationstore.myshopify.com","url_atual":window.location.href,"prazo_rastreio":"7","minDias":14,"maxDias":30,"tituloBotao1":"ajuda_para_comprar","tituloBotao2":" Minha Compra","tituloBotao3":"Cupom de Desconto","tituloBotao4":"Fantasias Infantis","tituloBotao5":"Tabela de Tamanhos","respBotao1":"Oi, otaku! 💖 Tá pensando em levar algo? A gente entrega em todo o Brasil com prazo médio de 14 a 20 dias após o envio. Todos os nossos produtos são importados ou personalizados com carinho! 💫 Se tiver dúvida sobre tamanhos, cores ou formas de pagamento, me chama aqui que eu te ajudo.","respBotao2":"Vamos conferir sua compra! 🧾 Me manda seu número do pedido ou o nome completo usado na compra, que eu consulto pra você. Se já tiver rastreio disponível, vou te enviar aqui mesmo 🛰️","respBotao3":"🛍️ Tá caçando um descontinho, né? hehe Se for sua primeira compra, use o cupom: 🎁 OTAKU15 E de vez em quando a gente solta promoções-relâmpago lá no nosso Instagram também! Segue a gente lá: @lojamundootakuoficial","respBotao4":"🧒✨ Sim, temos opções de fantasias infantis! No momento, você encontra elas disponíveis aqui: https://lojamundootaku.com.br/collections/fantasias-e-cosplay","respBotao5":"📏 Dúvida no tamanho? Você pode conferir as medidas de cada produto na própria página dele! Mas se quiser ver nosso guia geral, clique aqui: 👉 https://lojamundootaku.com.br/pages/tamanhos Se mesmo assim tiver dúvida, me chama aqui que te oriento 🥰"}}}})
setTimeout(() => {
const iframe = document.querySelector('#voiceflow-chat');
if (iframe) {
iframe.style.display = 'block';
iframe.style.visibility = 'visible';
iframe.style.opacity = '1';
}
}, 500);
};
v.src = "https://d2h6cfhq6tgb2e.cloudfront.net/bundle.mjs";
v.type = "text/javascript";
window.addEventListener('message', (event) => {
var data = typeof event.data === 'string' ? JSON.parse(event.data) : event.data;
if (setCookieMessage < 1 && data['type'] === 'voiceflow:interact') {
setCookie("chatfy", true, 1);
setCookieMessage++;
}
}, false);
s.parentNode.insertBefore(v, s);
})(document, 'script');
} else {
var run = 0;
function excludeDots(){
const shadowHost = document.querySelector('#voiceflow-chat');
const shadowRoot = shadowHost.shadowRoot;
const launcher = shadowRoot.querySelector('.vfrc-widget--launcher.c-PJLV');
if (launcher && run === 0) {
launcher.addEventListener('click', () => {
setTimeout(() => {
const dots = shadowRoot.querySelectorAll('.dot');
dots[0].classList.add('highlight');
run = run + 1;
}, 100); // 1 segundo de atraso antes de esconder as bolinhas
});
}
}
setTimeout(excludeDots, 1000);
function waitForElement(selector, callback) {
const interval = setInterval(() => {
const element = document.querySelector(selector);
if (element) {
clearInterval(interval);
callback(element);
}
}, 100); // Verifica a cada 100ms
}
waitForElement('#voiceflow-chat', (shadowHost) => {
const shadowRoot = shadowHost.shadowRoot;
var loading = document.getElementById('loading')
if (loading) {
loading.remove();
}
const interval = setInterval(() => {
const targetElement = shadowRoot.querySelector('.vfrc-launcher.c-bQoszf');
const dot_element = shadowRoot.querySelector('.green-dot');
const img = shadowRoot.querySelector('.chatfy-img');
if (targetElement) {
targetElement.classList.add('animated');
}
if (dot_element) {
setTimeout(() => {
clearInterval(interval);
dot_element.classList.add('animated');
}, 1200);
}
if (img) {
setTimeout(() => {
clearInterval(interval);
img.classList.add('animated');
}, 1200);
}
}, 100);
});
//endregion
(function (d, t) {
var v = d.createElement(t), s = d.getElementsByTagName(t)[0];
v.onload = function () {
window.voiceflow.chat.load({"verify":{"projectID":"682e0de3054e3b475c467695"},"url":"https://general-runtime.voiceflow.com","versionID":"production","assistant":{"title":"Mel","description":"Oi, otaku! 💖 Como posso te ajudar hoje? Você pode perguntar sobre seu pedido, troca, envio ou produto!","image":"https://d2h6cfhq6tgb2e.cloudfront.net/store/80cc56d4-e47e-4df4-a101-05be5bc3ca3b/logo.png","avatar":"https://d2h6cfhq6tgb2e.cloudfront.net/store/80cc56d4-e47e-4df4-a101-05be5bc3ca3b/avatar.png","color":"#25d366","extensions":[FormExtension]},"launch":{"event":{"type":"launch","payload":{"language":"português","bot_name":"Mel","nome_ecommerce":"Mundo Otaku","email_ecommerce":"contato@lojamundootaku.com.br","telefone_ecommerce":"22998311403","rastreio_link":"https://lojamundootaku.com.br/apps/rastreio","nicho_ecommerce":"Geek, Nerd e Kawaii","url_site":"youranimationstore.myshopify.com","url_atual":window.location.href,"prazo_rastreio":"7","minDias":14,"maxDias":30,"tituloBotao1":"ajuda_para_comprar","tituloBotao2":" Minha Compra","tituloBotao3":"Cupom de Desconto","tituloBotao4":"Fantasias Infantis","tituloBotao5":"Tabela de Tamanhos","respBotao1":"Oi, otaku! 💖 Tá pensando em levar algo? A gente entrega em todo o Brasil com prazo médio de 14 a 20 dias após o envio. Todos os nossos produtos são importados ou personalizados com carinho! 💫 Se tiver dúvida sobre tamanhos, cores ou formas de pagamento, me chama aqui que eu te ajudo.","respBotao2":"Vamos conferir sua compra! 🧾 Me manda seu número do pedido ou o nome completo usado na compra, que eu consulto pra você. Se já tiver rastreio disponível, vou te enviar aqui mesmo 🛰️","respBotao3":"🛍️ Tá caçando um descontinho, né? hehe Se for sua primeira compra, use o cupom: 🎁 OTAKU15 E de vez em quando a gente solta promoções-relâmpago lá no nosso Instagram também! Segue a gente lá: @lojamundootakuoficial","respBotao4":"🧒✨ Sim, temos opções de fantasias infantis! No momento, você encontra elas disponíveis aqui: https://lojamundootaku.com.br/collections/fantasias-e-cosplay","respBotao5":"📏 Dúvida no tamanho? Você pode conferir as medidas de cada produto na própria página dele! Mas se quiser ver nosso guia geral, clique aqui: 👉 https://lojamundootaku.com.br/pages/tamanhos Se mesmo assim tiver dúvida, me chama aqui que te oriento 🥰"}}}})
setTimeout(() => {
const iframe = document.querySelector('#voiceflow-chat');
if (iframe) {
iframe.style.display = 'block';
iframe.style.visibility = 'visible';
iframe.style.opacity = '1';
}
}, 500);
};
v.src = "https://d2h6cfhq6tgb2e.cloudfront.net/bundle.mjs";
v.type = "text/javascript";
window.addEventListener('message', (event) => {
var data = typeof event.data === 'string' ? JSON.parse(event.data) : event.data;
if (setCookieMessage < 1 && data['type'] === 'voiceflow:interact') {
setCookie("chatfy", true, 1);
setCookieMessage++
}
}, false);
s.parentNode.insertBefore(v, s);
})(document, 'script');
}