'use strict'; function ownKeys(e, t) { var n, r = Object.keys(e); return ( Object.getOwnPropertySymbols && ((n = Object.getOwnPropertySymbols(e)), t && (n = n.filter(function (t) { return Object.getOwnPropertyDescriptor(e, t).enumerable; })), r.push.apply(r, n)), r ); } function _objectSpread(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? arguments[t] : {}; t % 2 ? ownKeys(Object(n), !0).forEach(function (t) { _defineProperty(e, t, n[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ownKeys(Object(n)).forEach(function (t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t)); }); } return e; } function _defineProperty(t, e, n) { return ( e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (t[e] = n), t ); } var fbtip, sendData; function clearForm() { $('#in-name').val(''), $('#in-email').val(''), $('#in-content').val(''), $('#in-phone').val(''), $('#in-title').val(''), $('#in-company').val(''); localStorage.clear('productCachePC'); } function sendInquiry() { var t = formValidated(); if (($(this).attr('disabled', 'disabled'), t)) { var e, n = { email: $.trim($('#in-email').val()), name: $.trim($('#in-name').val()), phone: $.trim($('#in-phone').val()), content: $.trim($('#in-content').val()), title: $.trim($('#in-title').val()), proId: $.trim($('#productID').val()), company: $.trim($('#in-company').val()), }; for (e in n) { n[e] = escape(n[e]); } var r = [], t = localStorage.getItem('productCachePC'); '[]' != t && null != t && (r = JSON.parse(t)); var a = ''; r.forEach(function (t) { a = '' == a ? t.id : a + ',' + t.id; }), $.ajax({ type: 'POST', url: '/OutOpen/AddInquiry', data: _objectSpread( _objectSpread({}, n), {}, { pageUrl: document.URL, proidlist: a, } ), dataType: 'json', error: function error() { toastr.error($lang.msgSendFailed); }, success: function success(t) { $(this).removeAttr('disabled', 'disabled'), '1' == t ? (toastr.success($lang.msgSendSucess), clearForm(), location.href = '/thanks') : '2' == t ? toastr.info($lang.msgSameContent) : '3' == t ? (location.href = '/Code') : '4' == t ? toastr.info($lang.msgSensitiveContent) : '5' == t ? toastr.info($lang.msgtoolongcontent) : '-1' == t ? toastr.info($lang.msgFrequentlyContent) : toastr.info($lang.msgSendFailed); }, async: !1, }); } return !1; } function showAlert(t) { 768 < $(window).width() ? (clearInterval(fbtip), $('#feedback-title').text(window.location.host), $('#feedback-text').text(t), $('.feedback-tips').fadeIn(200), (fbtip = setInterval(closefeedbackTips, 3e3))) : alert(t); } function closefeedbackTips() { $('.feedback-tips').fadeOut(200); } function formValidated() { var t = !0; return ( $('.inquiry-form input, .inquiry-form textarea').each(function () { $(this).validate() || (t = !1); }), t ); } var defaultreplyUrl = ""; var defaultlang = "af"; function getDefaultreplyKey() { $.ajax({ url: '/OutOpen/GetInquiryReturn', type: 'get', dataType: 'json', success: function (data) { defaultlang = data.languagekey; var IsPersonal = data.IsPersonal; var cussiteid = data.cussiteid; if (IsPersonal == true) { defaultreplyUrl = "/js/" + cussiteid + "/defaultreply.json"; } else { defaultreplyUrl = "/js/Inquiry/defaultreply.json"; } getDefaultreplyList(); }, error: function () { $('#feedbackForm .select-menu').remove(); console.log('error'); } }); } function getDefaultreplyList() { $.ajax({ url: defaultreplyUrl, type: 'get', dataType: 'json', success: function (data) { var wmkcdefaultreply = data; var contentValue = null; for (var i = 0; i < wmkcdefaultreply.length; i++) { if (wmkcdefaultreply[i].lang === defaultlang) { contentValue = wmkcdefaultreply[i]; break; } } $('#feedbackForm .select-menu-input').attr('placeholder', contentValue.DefaultPrompt); $("#in-select").empty(); if (contentValue.content.length === 0) { $('#feedbackForm .select-menu').remove(); } else { $.each(contentValue.content, function (index, value) { var listItem = "