%PDF- %PDF-
Direktori : /var/www/projetos/spanish.ongrace.com/wp-content/plugins/wp-maintenance-mode/assets/js/ |
Current File : /var/www/projetos/spanish.ongrace.com/wp-content/plugins/wp-maintenance-mode/assets/js/bot.min.js |
!function(){var n,t={};function e(){}function r(n){return n}function i(n){return!!n}function o(n){return!n}var u="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;function c(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function a(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}null!=u&&(n=u.async),t.noConflict=function(){return u.async=n,t};var s=Object.prototype.toString,l=Array.isArray||function(n){return"[object Array]"===s.call(n)};function f(n){return l(n)||"number"==typeof n.length&&n.length>=0&&n.length%1==0}function p(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function h(n,t){for(var e=-1,r=n.length,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}function y(n){return h(Array(n),function(n,t){return t})}function m(n,t){p(v(n),function(e){t(n[e],e)})}function d(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}var v=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t};function g(n){var t,e,r=-1;return f(n)?(t=n.length,function(){return++r<t?r:null}):(e=v(n),t=e.length,function(){return++r<t?e[r]:null})}function b(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),i=0;i<e;i++)r[i]=arguments[i+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r);case 2:return n.call(this,arguments[0],arguments[1],r)}}}function j(n){return function(t,e,r){return n(t,r)}}var w="function"==typeof setImmediate&&setImmediate,k=w?function(n){w(n)}:function(n){setTimeout(n,0)};function Q(n){return function(t,r,i){i=a(i||e);var o=g(t=t||[]);if(n<=0)return i(null);var u=!1,s=0,l=!1;!function e(){if(u&&s<=0)return i(null);for(;s<n&&!l;){var a=o();if(null===a)return u=!0,void(s<=0&&i(null));s+=1,r(t[a],a,c(function(n){s-=1,n?(i(n),l=!0):e()}))}}()}}function x(n){return function(e,r,i){return n(t.eachOf,e,r,i)}}function S(n){return function(t,e,r,i){return n(Q(e),t,r,i)}}function T(n){return function(e,r,i){return n(t.eachOfSeries,e,r,i)}}function O(n,t,r,i){i=a(i||e);var o=[];n(t,function(n,t,e){r(n,function(n,r){o[t]=r,e(n)})},function(n){i(n,o)})}function E(n,t,e,r){var i=[];n(t,function(n,t,r){e(n,function(e){e&&i.push({index:t,value:n}),r()})},function(){r(h(i.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function L(n,t,e,r){E(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function I(n,t,e){return function(r,i,o,u){function c(){u&&u(e(!1,void 0))}function a(n,r,i){if(!u)return i();o(n,function(r){u&&t(r)&&(u(e(!0,n)),u=o=!1),i()})}arguments.length>3?n(r,i,a,c):(u=o,o=i,n(r,a,c))}}function A(n,t){return t}function C(n,t,r){r=r||e;var i=f(t)?[]:{};n(t,function(n,t,e){n(b(function(n,r){r.length<=1&&(r=r[0]),i[t]=r,e(n)}))},function(n){r(n,i)})}function z(n,t,e,r){var i=[];n(t,function(n,t,r){e(n,function(n,t){i=i.concat(t||[]),r(n)})},function(n){r(n,i)})}function V(n,r,i){if(null==r)r=1;else if(0===r)throw new Error("Concurrency must not be zero");function o(n,r,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");if(n.started=!0,l(r)||(r=[r]),0===r.length&&n.idle())return t.setImmediate(function(){n.drain()});p(r,function(t){var r={data:t,callback:o||e};i?n.tasks.unshift(r):n.tasks.push(r),n.tasks.length===n.concurrency&&n.saturated()}),t.setImmediate(n.process)}function u(n,t){return function(){a-=1;var e=arguments;p(t,function(n){n.callback.apply(n,e)}),n.tasks.length+a===0&&n.drain(),n.process()}}var a=0,s={tasks:[],concurrency:r,payload:i,saturated:e,empty:e,drain:e,started:!1,paused:!1,push:function(n,t){o(s,n,!1,t)},kill:function(){s.drain=e,s.tasks=[]},unshift:function(n,t){o(s,n,!0,t)},process:function(){if(!s.paused&&a<s.concurrency&&s.tasks.length)for(;a<s.concurrency&&s.tasks.length;){var t=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=h(t,function(n){return n.data});0===s.tasks.length&&s.empty(),a+=1;var r=c(u(s,t));n(e,r)}},length:function(){return s.tasks.length},running:function(){return a},idle:function(){return s.tasks.length+a===0},pause:function(){s.paused=!0},resume:function(){if(!1!==s.paused){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),e=1;e<=n;e++)t.setImmediate(s.process)}}};return s}function _(n){return b(function(t,e){t.apply(null,e.concat([b(function(t,e){"undefined"!=typeof console&&(t?console.error&&console.error(t):console[n]&&p(e,function(t){console[n](t)}))})]))})}function q(n){return function(t,e,r){n(y(t),e,r)}}function B(n){return b(function(t,e){var r=b(function(e){var r=this,i=e.pop();return n(t,function(n,t,i){n.apply(r,e.concat([i]))},i)});return e.length?r.apply(this,e):r})}function N(n){return b(function(e){var r=e.pop();e.push(function(){var n=arguments;i?t.setImmediate(function(){r.apply(null,n)}):r.apply(null,n)});var i=!0;n.apply(this,e),i=!1})}"object"==typeof process&&"function"==typeof process.nextTick?t.nextTick=process.nextTick:t.nextTick=k,t.setImmediate=w?k:t.nextTick,t.forEach=t.each=function(n,e,r){return t.eachOf(n,j(e),r)},t.forEachSeries=t.eachSeries=function(n,e,r){return t.eachOfSeries(n,j(e),r)},t.forEachLimit=t.eachLimit=function(n,t,e,r){return Q(t)(n,j(e),r)},t.forEachOf=t.eachOf=function(n,t,r){r=a(r||e);var i=f(n=n||[])?n.length:v(n).length,o=0;if(!i)return r(null);function u(n){n?r(n):(o+=1)>=i&&r(null)}!function(n,t){f(n)?p(n,t):m(n,t)}(n,function(e,r){t(n[r],r,c(u))})},t.forEachOfSeries=t.eachOfSeries=function(n,r,i){i=a(i||e);var o=g(n=n||[]),u=o();!function e(){var a=!0;if(null===u)return i(null);r(n[u],u,c(function(n){if(n)i(n);else{if(null===(u=o()))return i(null);a?t.nextTick(e):e()}})),a=!1}()},t.forEachOfLimit=t.eachOfLimit=function(n,t,e,r){Q(t)(n,e,r)},t.map=x(O),t.mapSeries=T(O),t.mapLimit=S(O),t.inject=t.foldl=t.reduce=function(n,e,r,i){t.eachOfSeries(n,function(n,t,i){r(e,n,function(n,t){e=t,i(n)})},function(n){i(n||null,e)})},t.foldr=t.reduceRight=function(n,e,r,i){var o=h(n,function(n){return n}).reverse();t.reduce(o,e,r,i)},t.select=t.filter=x(E),t.selectLimit=t.filterLimit=S(E),t.selectSeries=t.filterSeries=T(E),t.reject=x(L),t.rejectLimit=S(L),t.rejectSeries=T(L),t.any=t.some=I(t.eachOf,i,r),t.someLimit=I(t.eachOfLimit,i,r),t.all=t.every=I(t.eachOf,o,o),t.everyLimit=I(t.eachOfLimit,o,o),t.detect=I(t.eachOf,r,A),t.detectSeries=I(t.eachOfSeries,r,A),t.sortBy=function(n,e,r){function i(n,t){var e=n.criteria,r=t.criteria;return e<r?-1:e>r?1:0}t.map(n,function(n,t){e(n,function(e,r){e?t(e):t(null,{value:n,criteria:r})})},function(n,t){if(n)return r(n);r(null,h(t.sort(i),function(n){return n.value}))})},t.auto=function(n,r){r=a(r||e);var i=v(n),o=i.length;if(!o)return r(null);var u={},c=[];function s(n){c.unshift(n)}function f(){o--,p(c.slice(0),function(n){n()})}s(function(){o||r(null,u)}),p(i,function(e){for(var i,o=l(n[e])?n[e]:[n[e]],a=b(function(n,i){if(i.length<=1&&(i=i[0]),n){var o={};m(u,function(n,t){o[t]=n}),o[e]=i,r(n,o)}else u[e]=i,t.setImmediate(f)}),h=o.slice(0,o.length-1),y=h.length;y--;){if(!(i=n[h[y]]))throw new Error("Has inexistant dependency");if(l(i)&&d(i,e)>=0)throw new Error("Has cyclic dependencies")}function v(){return n=function(n,t){return n&&u.hasOwnProperty(t)},t=!0,p(h,function(e,r,i){t=n(t,e,r,i)}),t&&!u.hasOwnProperty(e);var n,t}v()?o[o.length-1](a,u):s(function n(){v()&&((t=d(c,n))>=0&&c.splice(t,1),o[o.length-1](a,u));var t})})},t.retry=function(n,e,r){var i=5,o=0,u=[],c={times:i,interval:o};var a=arguments.length;if(a<1||a>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");function s(n,e){function r(n,t){return function(r){n(function(n,e){r(!n||t,{err:n,result:e})},e)}}function i(n){return function(t){setTimeout(function(){t(null)},n)}}for(;c.times;){var o=!(c.times-=1);u.push(r(c.task,o)),!o&&c.interval>0&&u.push(i(c.interval))}t.series(u,function(t,e){e=e[e.length-1],(n||c.callback)(e.err,e.result)})}return a<=2&&"function"==typeof n&&(r=e,e=n),"function"!=typeof n&&function(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}(c,n),c.callback=r,c.task=e,c.callback?s():s},t.waterfall=function(n,r){if(r=a(r||e),!l(n)){var i=new Error("First argument to waterfall must be an array of functions");return r(i)}if(!n.length)return r();!function n(t){return b(function(e,i){if(e)r.apply(null,[e].concat(i));else{var o=t.next();o?i.push(n(o)):i.push(r),N(t).apply(null,i)}})}(t.iterator(n))()},t.parallel=function(n,e){C(t.eachOf,n,e)},t.parallelLimit=function(n,t,e){C(Q(t),n,e)},t.series=function(n,e){C(t.eachOfSeries,n,e)},t.iterator=function(n){return function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}(0)},t.apply=b(function(n,t){return b(function(e){return n.apply(null,t.concat(e))})}),t.concat=x(z),t.concatSeries=T(z),t.whilst=function(n,t,r){if(r=r||e,n()){var i=b(function(e,o){e?r(e):n.apply(this,o)?t(i):r(null)});t(i)}else r(null)},t.doWhilst=function(n,e,r){var i=0;return t.whilst(function(){return++i<=1||e.apply(this,arguments)},n,r)},t.until=function(n,e,r){return t.whilst(function(){return!n.apply(this,arguments)},e,r)},t.doUntil=function(n,e,r){return t.doWhilst(n,function(){return!e.apply(this,arguments)},r)},t.during=function(n,t,r){r=r||e;var i=b(function(t,e){t?r(t):(e.push(o),n.apply(this,e))}),o=function(n,e){n?r(n):e?t(i):r(null)};n(o)},t.doDuring=function(n,e,r){var i=0;t.during(function(n){i++<1?n(null,!0):e.apply(this,arguments)},n,r)},t.queue=function(n,t){return V(function(t,e){n(t[0],e)},t,1)},t.priorityQueue=function(n,r){function i(n,t){return n.priority-t.priority}var o=t.queue(n,r);return o.push=function(n,r,u){!function(n,r,o,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");if(n.started=!0,l(r)||(r=[r]),0===r.length)return t.setImmediate(function(){n.drain()});p(r,function(r){var c={data:r,priority:o,callback:"function"==typeof u?u:e};n.tasks.splice(function(n,t,e){for(var r=-1,i=n.length-1;r<i;){var o=r+(i-r+1>>>1);e(t,n[o])>=0?r=o:i=o-1}return r}(n.tasks,c,i)+1,0,c),n.tasks.length===n.concurrency&&n.saturated(),t.setImmediate(n.process)})}(o,n,r,u)},delete o.unshift,o},t.cargo=function(n,t){return V(n,1,t)},t.log=_("log"),t.dir=_("dir"),t.memoize=function(n,e){var r={},i={};e=e||function(n){return n};var o=b(function(o){var u=o.pop(),c=e.apply(null,o);c in r?t.nextTick(function(){u.apply(null,r[c])}):c in i?i[c].push(u):(i[c]=[u],n.apply(null,o.concat([b(function(n){r[c]=n;var t=i[c];delete i[c];for(var e=0,o=t.length;e<o;e++)t[e].apply(null,n)})])))});return o.memo=r,o.unmemoized=n,o},t.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},t.times=q(t.map),t.timesSeries=q(t.mapSeries),t.timesLimit=function(n,e,r,i){return t.mapLimit(y(n),e,r,i)},t.seq=function(){var n=arguments;return b(function(r){var i=this,o=r[r.length-1];"function"==typeof o?r.pop():o=e,t.reduce(n,r,function(n,t,e){t.apply(i,n.concat([b(function(n,t){e(n,t)})]))},function(n,t){o.apply(i,[n].concat(t))})})},t.compose=function(){return t.seq.apply(null,Array.prototype.reverse.call(arguments))},t.applyEach=B(t.eachOf),t.applyEachSeries=B(t.eachOfSeries),t.forever=function(n,t){var r=c(t||e),i=N(n);!function n(t){if(t)return r(t);i(n)}()},t.ensureAsync=N,t.constant=b(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),t.wrapSync=t.asyncify=function(n){return b(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(n){return r(n)}r(null,e)})},"undefined"!=typeof module&&module.exports?module.exports=t:"undefined"!=typeof define&&define.amd?define([],function(){return t}):u.async=t}();const DEBUG=!1,context={};let conversationPos,conversationStarted=!1;function _phpCastString(n){switch(typeof n){case"boolean":return n?"1":"";case"string":return n;case"number":return isNaN(n)?"NAN":isFinite(n)?n+"":(n<0?"-":"")+"INF";case"undefined":return"";case"object":return Array.isArray(n)?"Array":null!==n?"Object":"";case"function":default:throw new Error("Unsupported value type")}}function stripTags(n,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");const e=/<\/?([a-z0-9]*)\b[^>]*>?/gi,r=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;let i=_phpCastString(n);for(i="<"===i.substring(i.length-1)?i.substring(0,i.length-1):i;;){if(i===(i=i.replace(r,"").replace(e,function(n,e){return t.indexOf("<"+e.toLowerCase()+">")>-1?n:""})))return i}}function renderStatement(n){n=stripTags(n),jQuery(".chat-container").append('<div class="chat-message-wrapper"><p class="chat-message">'+n+"</p></div>")}function showTyping(){jQuery(".chat-container").append('<div class="typing-wrapper"><p class="chat-message typing"><span class="dot"></span><span class="dot"></span><span class="dot"></span></p></div>')}function hideTyping(){jQuery(".typing-wrapper").remove()}const chatWrapper=jQuery(".bot-chat-wrapper");function scrollToBottom(){chatWrapper.animate({scrollTop:600},"slow")}function inputError(n){jQuery(".bot-error p").text(n),jQuery(".bot-error").animate({bottom:"20px"},500).delay(3e3).animate({bottom:"-70px"},500)}function checkInput(n){let t=jQuery(".bot-container input[type=text]").val();return(t=stripTags(t)).length>2?showResponse(n):inputError(botVars.validationName),!1}function checkEmail(n){const t=jQuery(".bot-container input[type=email]").val(),e=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t.toLowerCase()));if(t.length>7&&!0===e){const t="action=wpmm_add_subscriber&"+jQuery(".bot_subscribe_form").serialize();jQuery.post(wpmmVars.ajaxURL,t,function(n){if(!n.success)return alert(n.data),!1},"json"),showResponse(n)}else inputError(botVars.validationEmail);return!1}function clearChat(){jQuery(".chat-container").empty()}function clearFooter(){jQuery(".choices").empty(),jQuery(".input").empty()}function startConversation(n,t){if(conversationStarted)return!1;conversationStarted=!0,clearFooter(),clearChat(),conversationPos=n,jQuery.getScript(botVars.uploadsBaseUrl+"data.js",function(n){showStatement(t)})}function showStatement(n){const t=conversationData[conversationPos][n];let e;"sideeffect"in t&&jQuery.type("function"===t.sideeffect)&&t.sideeffect(context),"array"===jQuery.type(t.statement)?e=t.statement:"string"===jQuery.type(t.statement)?e=[t.statement]:"function"===jQuery.type(t.statement)&&(e=t.statement(context)),1.5!==n&&1.6!==n||jQuery(".avatar-notice").remove(),async.eachSeries(e,function(n,t){showTyping(),scrollToBottom();let e=900;!DEBUG&&jQuery(".bot-chat-wrapper")[0]||(e=0),setTimeout(function(){hideTyping(),renderStatement(n),scrollToBottom(),t()},e)},function(n){if("options"in t){jQuery(".input").hide(),jQuery(".choices").show();const n=t.options;n.length>0&&setTimeout(function(){for(let e=0;e<n.length;e++){const r=n[e];var t;null===r.consequence?(t=null,"disabled"):(t=function(n){showResponse(n)}.bind(null,r),"");jQuery("<p/>",{text:r.choice,class:"chat-message user",click:t}).appendTo(".choices")}},750)}else if("input"in t){jQuery(".input").show(),jQuery(".choices").hide();var e=t.input,r=jQuery("<form/>",{submit:checkInput.bind(null,e)}),i=jQuery("<p/>",{class:"chat-message user"}).appendTo(r),o=jQuery("<input/>",{type:"text",placeholder:botVars.typeName,name:e.name,autocomplete:"off",required:!0}).appendTo(i);jQuery("<a/>",{text:botVars.send,click:checkInput.bind(null,e)}).appendTo(i);r.appendTo(".input"),async.nextTick(function(){o.focus()})}else if("email"in t){jQuery(".input").show(),jQuery(".choices").hide();e=t.email,r=jQuery("<form/>",{class:"bot_subscribe_form",submit:checkEmail.bind(null,e)}),i=jQuery("<p/>",{class:"chat-message user"}).appendTo(r),o=jQuery("<input/>",{type:"hidden",name:"_wpnonce",value:botVars.wpnonce}).appendTo(i),o=jQuery("<input/>",{type:"email",placeholder:botVars.typeEmail,name:e.email,autocomplete:"off"}).appendTo(i),jQuery("<a/>",{text:botVars.send,click:checkEmail.bind(null,e)}).appendTo(i);r.appendTo(".input"),async.nextTick(function(){o.focus()})}scrollToBottom()})}function showResponse(n){let t="";"name"in n?(context[n.name]=jQuery(".bot-container input[type=text]").val(),t=context[n.name]):"email"in n?(context[n.email]=jQuery(".bot-container input[type=email]").val(),t=context[n.email]):t=n.choice,clearFooter(),t=stripTags(t),jQuery(".chat-container").append('<p class="chat-message user">'+t+"</p>"),"consequence"in n&&showStatement(n.consequence)}let isOpen=!1;jQuery(".bot-avatar").on("click",function(){const n=jQuery(".bot-chat-wrapper")[0];isOpen||(isOpen=!0,startConversation("homepage",1)),"none"!==n.style.display?(jQuery(".avatar-notice").show(),jQuery(".bot-chat-wrapper").hide()):(jQuery(".bot-chat-wrapper").show(),jQuery(".avatar-notice").hide())});