(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(a,'__esModule',{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&'object'==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,'default',{enumerable:!0,value:a}),2&c&&'string'!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='view/public/',b(b.s=565)})({565:function(){function a(a){1==a?($('.js-status-started').removeClass('hidden'),$('select[name="processo_venda_order_status_started"]').attr('disabled',!1)):($('.js-status-started').addClass('hidden'),$('select[name="processo_venda_order_status_started"]').attr('disabled',!0))}$(document).ready(function(){$('body').data('token');a(window.processo_venda_status),$('.js-process-status').change(function(){a($(this).val())}),$('.js-submit-proccess-form').on('click',function(){var a=$('.js-submit-proccess-form');$('.error, .success, .warning, .error-proccess').remove(),$('.field-entry-error').removeClass('field-entry-error'),$('.js-field-entry-group select').removeClass('background-error border-error'),$.ajax({url:$('.js-proccess-form').attr('action'),type:'POST',data:$('.js-proccess-form').serializeObject(),dataType:'json',beforeSend:function(){a.addClass('btn-loading'),a.attr('disabled',!0)},complete:function(){a.removeClass('btn-loading'),a.attr('disabled',!1)},success:function(a){$('.js-notify').remove(),$('.text-error').remove(),a.error&&(a.error.warning&&($('.js-warning').before('<div class="text-small full-width background-error text-error padding-medium bottom-margin-medium rounded-x-small">'+a.error.warning+'</div>'),delete a.error.warning),a.error.proccess_count&&($.each(a.error.proccess_count,function(b,c){var d=$('#'+b).next();d.removeClass('hidden'),d.find('[data-tipo-status='+c+']').after('<div class="text-small error-proccess full-width background-error text-error padding-small bottom-margin-medium rounded-x-small js-notify">'+a.error.proccess_count_msg+'</div>')}),delete a.error.proccess_count),$.each(a.error,function(b,c){if('proccess_status_started'==b||'proccess_status_venda'==b){var d=b;$.each(c,function(b,c){var e=$('#'+b).next();e.removeClass('hidden'),$.each(c,function(b,c){var f=e.find('[data-tipo-status='+b+']');f.after('<div class="text-small error-proccess full-width background-error text-error padding-small bottom-margin-medium rounded-x-small js-notify">'+a.error[d+'_msg']+'</div>'),$.each(c,function(a){var b=f.parent().find('.field-group .js-field-entry-group').eq(a).find('select');b.addClass('background-error border-error')})})})}else $('[name="'+b+'"]').addClass('field-entry-error').after('<span class="text-x-small text-error">'+c+'</span>')})),a.success&&$('.js-warning').before('<div class="text-small full-width background-success text-success padding-medium bottom-margin-medium rounded-x-small js-notify">'+a.success+'</div>')},error:function(a){console.log(a.responseText)}})})})}});