Your IP : 3.140.197.10


Current Path : /proc/self/root/home/sudancam/public_html3/host/wp-content/plugins/wpforms-lite/assets/js/
Upload File :
Current File : //proc/self/root/home/sudancam/public_html3/host/wp-content/plugins/wpforms-lite/assets/js/admin-utils.min.js

var wpf={cachedFields:{},savedState:!1,initialSave:!0,orders:{fields:[],choices:{}},init:function(){wpf.bindUIActions(),wpf.initRadioGroupForCheckboxes(),jQuery(wpf.ready)},ready:function(){wpf.savedState=wpf.getFormState("#wpforms-builder-form"),wpf.setFieldOrders(),wpf.setChoicesOrders()},bindUIActions:function(){jQuery(document).on("wpformsFieldAdd",wpf.setFieldOrders),jQuery(document).on("wpformsFieldDelete",wpf.setFieldOrders),jQuery(document).on("wpformsFieldMove",wpf.setFieldOrders),jQuery(document).on("wpformsFieldAdd",wpf.setChoicesOrders),jQuery(document).on("wpformsFieldChoiceAdd",wpf.setChoicesOrders),jQuery(document).on("wpformsFieldChoiceDelete",wpf.setChoicesOrders),jQuery(document).on("wpformsFieldChoiceMove",wpf.setChoicesOrders),jQuery(document).on("wpformsFieldAdd",wpf.fieldUpdate),jQuery(document).on("wpformsFieldDelete",wpf.fieldUpdate),jQuery(document).on("wpformsFieldMove",wpf.fieldUpdate),jQuery(document).on("focusout",".wpforms-field-option-row-label input",wpf.fieldUpdate),jQuery(document).on("wpformsFieldChoiceAdd",wpf.fieldUpdate),jQuery(document).on("wpformsFieldChoiceDelete",wpf.fieldUpdate),jQuery(document).on("wpformsFieldChoiceMove",wpf.fieldUpdate),jQuery(document).on("wpformsFieldDynamicChoiceToggle",wpf.fieldUpdate),jQuery(document).on("focusout",".wpforms-field-option-row-choices input.label",wpf.fieldUpdate)},setFieldOrders:function(){wpf.orders.fields=[],jQuery(".wpforms-field-option").each(function(){wpf.orders.fields.push(jQuery(this).data("field-id"))})},setChoicesOrders:function(){wpf.orders.choices={},jQuery(".choices-list").each(function(){var e=jQuery(this).data("field-id");wpf.orders.choices["field_"+e]=[],jQuery(this).find("li").each(function(){wpf.orders.choices["field_"+e].push(jQuery(this).data("key"))})})},getChoicesOrder:function(e){var r=[];return jQuery("#wpforms-field-option-"+e).find(".choices-list li").each(function(){r.push(jQuery(this).data("key"))}),r},fieldUpdate:function(){var e=wpf.getFields();jQuery(document).trigger("wpformsFieldUpdate",[e]),wpf.debug("fieldUpdate triggered")},getFields:function(e,r){if((r=r||!1)&&!jQuery.isEmptyObject(wpf.cachedFields)){var t=jQuery.extend({},wpf.cachedFields);wpf.debug("getFields triggered (cached)")}else{var i=["entry-preview","html","pagebreak"];if(!(t=wpf.formObject("#wpforms-field-options").fields))return!1;for(o in t)(!t[o].type||-1<jQuery.inArray(t[o].type,i))&&delete t[o];wpf.cachedFields=jQuery.extend({},t),wpf.debug("getFields triggered")}if(e&&e.constructor===Array)for(var o in t)-1===jQuery.inArray(t[o].type,e)&&delete t[o];return t},getField:function(e){e=wpf.formObject("#wpforms-field-option-"+e);return e.fields[Object.keys(e.fields)[0]]},fieldOptionLoading:function(e,r){var e=jQuery(e),t=e.find("label");(r=void 0!==r)?(t.find(".wpforms-loading-spinner").remove(),t.find(".wpforms-help-tooltip").show(),e.find("input,select,textarea").prop("disabled",!1)):(t.append('<i class="wpforms-loading-spinner wpforms-loading-inline"></i>'),t.find(".wpforms-help-tooltip").hide(),e.find("input,select,textarea").prop("disabled",!0))},getFormState:function(e){return jQuery(e).serialize()},removeArrayItem:function(e,r){for(var t=0,i=0;i<e.length;i++)e[i]===r&&(e.splice(i,1),t++,i--);return t},sanitizeString:function(e){return"string"==typeof e||e instanceof String?e.trim():e},updateQueryString:function(e,r,t){t=t||window.location.href;var i,o=new RegExp("([?&])"+e+"=.*?(&|#|$)(.*)","gi");return o.test(t)?null!=r?t.replace(o,"$1"+e+"="+r+"$2$3"):(t=(i=t.split("#"))[0].replace(o,"$1$3").replace(/(&|\?)$/,""),void 0!==i[1]&&null!==i[1]&&(t+="#"+i[1]),t):(null!=r&&(o=-1!==t.indexOf("?")?"&":"?",t=(i=t.split("#"))[0]+o+e+"="+r,void 0!==i[1]&&null!==i[1]&&(t+="#"+i[1])),t)},getQueryString:function(e){e=new RegExp("[?&]"+e+"=([^&]*)").exec(window.location.search);return e&&decodeURIComponent(e[1].replace(/\+/g," "))},removeQueryParam:function(e){wpf.getQueryString(e)&&(e=new RegExp("[\\?&]"+e+"=[^&]+"),history.replaceState&&history.replaceState(null,"",location.pathname+location.search.replace(e,"").replace(/^&/,"?")+location.hash))},isNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},amountSanitize:function(e){return e=String(e).replace(/[^0-9.,]/g,""),","===wpforms_builder.currency_decimal?("."===wpforms_builder.currency_thousands&&-1!==e.indexOf(wpforms_builder.currency_thousands)?e=e.replace(new RegExp("\\"+wpforms_builder.currency_thousands,"g"),""):""===wpforms_builder.currency_thousands&&-1!==e.indexOf(".")&&(e=e.replace(/\./g,"")),e=e.replace(wpforms_builder.currency_decimal,".")):","===wpforms_builder.currency_thousands&&-1!==e.indexOf(wpforms_builder.currency_thousands)&&(e=e.replace(new RegExp("\\"+wpforms_builder.currency_thousands,"g"),"")),wpf.numberFormat(e,wpforms_builder.currency_decimals,".","")},amountFormat:function(e){var r;return e=String(e),","===wpforms_builder.currency_decimal&&-1!==e.indexOf(wpforms_builder.currency_decimal)&&(r=e.indexOf(wpforms_builder.currency_decimal),e=e.substr(0,r)+"."+e.substr(r+1,e.length-1)),","===wpforms_builder.currency_thousands&&-1!==e.indexOf(wpforms_builder.currency_thousands)&&(e=e.replace(/,/g,"")),wpf.empty(e)&&(e=0),wpf.numberFormat(e,wpforms_builder.currency_decimals,wpforms_builder.currency_decimal,wpforms_builder.currency_thousands)},amountFormatCurrency:function(e){e=wpf.amountSanitize(e),e=wpf.amountFormat(e),e="right"===wpforms_builder.currency_symbol_pos?e+" "+wpforms_builder.currency_symbol:wpforms_builder.currency_symbol+" "+e;return e},numberFormat:function(e,r,t,i){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var o,n,d,e=isFinite(+e)?+e:0,r=isFinite(+r)?Math.abs(r):0,i=void 0===i?",":i,t=void 0===t?".":t,s="";return 3<(s=(r?(o=e,n=r,d=Math.pow(10,n),""+(Math.round(o*d)/d).toFixed(n)):""+Math.round(e)).split("."))[0].length&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(s[1]||"").length<r&&(s[1]=s[1]||"",s[1]+=new Array(r-s[1].length+1).join("0")),s.join(t)},empty:function(e){for(var r,t=[void 0,null,!1,0,"","0"],i=0,o=t.length;i<o;i++)if(e===t[i])return!0;if("object"!=typeof e)return!1;for(r in e)if(e.hasOwnProperty(r))return!1;return!0},debug:function(e){wpf.isDebug()&&("object"==typeof e||e.constructor===Array?(console.log("WPForms Debug:"),console.log(e)):console.log("WPForms Debug: "+e))},isDebug:function(){return window.location.hash&&"#wpformsdebug"===window.location.hash||wpforms_builder.debug},focusCaretToEnd:function(e){e.focus();var r=e.val();e.val("").val(r)},formObject:function(e){for(var r=jQuery(e).find("[name]"),t={},i={},o=0;o<r.length;o++){var n=jQuery(r[o]),d=n.prop("name").replace(/\]/gi,"").split("["),s=n.val(),u={};if(!n.is(":radio")&&!n.is(":checkbox")||n.is(":checked")){for(var c=d.length-1;0<=c;c--){var f=d[c];if(0===(f=void 0===f?"":f).length&&(u=[],void 0===i[d[c-1]]?i[d[c-1]]=0:i[d[c-1]]+=1,f=i[d[c-1]]),c===d.length-1){if(s)if("true"===s)s=!0;else if("false"===s)s=!1;else if(isNaN(parseFloat(s))||parseFloat(s).toString()!==s)if("string"!=typeof s||"{"!==s.substr(0,1)&&"["!==s.substr(0,1)){if("object"==typeof s&&s.length&&n.is("select")){for(var p={},c=0;c<s.length;c++)p["n"+c]=s[c];s=p}}else try{s=JSON.parse(s)}catch(e){}else s=parseFloat(s);u[f]=s}else{var l=u;(u={})[f]=l}}jQuery.extend(!0,t,u)}}return t},initTooltips:function(){void 0!==jQuery.fn.tooltipster&&jQuery(".wpforms-help-tooltip").tooltipster({contentAsHTML:!0,position:"right",maxWidth:300,multiple:!0,interactive:!0,debug:!1,IEmin:11})},restoreTooltips:function(e){(e=void 0!==e&&e&&0<e.length?e.find(".wpforms-help-tooltip"):jQuery(".wpforms-help-tooltip")).each(function(){var e=jQuery(this);0!==jQuery.tooltipster.instances(this).length&&e.attr("title",e.tooltipster("content"))})},isURL:function(e){if("string"!=typeof e)return!1;e=e.match(/^(?:http(?:s?):)?\/\/(\S+)/);if(!e)return!1;e=e[1];return!!e&&!(!/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/.test(e)&&!/^[^\s\.]+\.\S{2,}$/.test(e))},sanitizeHTML:function(e){var r=window.DOMPurify;return void 0===r?e:("string"!=typeof e&&(e=e.toString()),r.sanitize(e))},encodeHTMLEntities:function(e){return(e="string"!=typeof e?e.toString():e).replace(/[\u00A0-\u9999<>&]/gim,function(e){return"&#"+e.charCodeAt(0)+";"})},initRadioGroupForCheckboxes:function(){var i=jQuery;i(document).on("change",'input[type="checkbox"].wpforms-radio-group',function(){var e,r=i(this),t=r.attr("id");r.prop("checked")&&(r=r.data("radio-group"),i(".wpforms-radio-group-"+r).each(function(){(e=i(this)).attr("id")!==t&&e.prop("checked",!1)}))})},listPluck:function(e,r){return e.map(function(e){return void 0!==e?e[r]:e})}};wpf.init();