window.Modernizr=function(e,t,n){function i(e){m.cssText=e}function o(e,t){return typeof e===t}function s(e,t){return!!~(""+e).indexOf(t)}function r(e,t){for(var i in e){var o=e[i];if(!s(o,"-")&&m[o]!==n)return"pfx"!=t||o}return!1}function a(e,t,i){for(var s in e){var r=t[e[s]];if(r!==n)return!1===i?e[s]:o(r,"function")?r.bind(i||t):r}return!1}function c(e,t,n){var i=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+v.join(i+" ")+i).split(" ");return o(t,"string")||o(t,"undefined")?r(s,t):(s=(e+" "+g.join(i+" ")+i).split(" "),a(s,t,n))}var l,f,u={},d=t.documentElement,p=t.createElement("modernizr"),m=p.style,h="Webkit Moz O ms",v=h.split(" "),g=h.toLowerCase().split(" "),y={},w=[],b=w.slice,E={}.hasOwnProperty;f=o(E,"undefined")||o(E.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(e,t){return E.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError;var n=b.call(arguments,1),i=function(){if(this instanceof i){var o=function(){};o.prototype=t.prototype;var s=new o,r=t.apply(s,n.concat(b.call(arguments)));return Object(r)===r?r:s}return t.apply(e,n.concat(b.call(arguments)))};return i}),y.csstransitions=function(){return c("transition")};for(var C in y)f(y,C)&&(l=C.toLowerCase(),u[l]=y[C](),w.push((u[l]?"":"no-")+l));return u.addTest=function(e,t){if("object"==typeof e)for(var i in e)f(e,i)&&u.addTest(i,e[i]);else{if(e=e.toLowerCase(),u[e]!==n)return u;t="function"==typeof t?t():t,d.className+=" "+(t?"":"no-")+e,u[e]=t}return u},i(""),p=null,function(e,t){function n(e,t){var n=e.createElement("p"),i=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",i.insertBefore(n.lastChild,i.firstChild)}function i(){var e=v.elements;return"string"==typeof e?e.split(" "):e}function o(e){var t=h[e[p]];return t||(t={},m++,e[p]=m,h[m]=t),t}function s(e,n,i){if(n||(n=t),l)return n.createElement(e);i||(i=o(n));var s;return!(s=i.cache[e]?i.cache[e].cloneNode():d.test(e)?(i.cache[e]=i.createElem(e)).cloneNode():i.createElem(e)).canHaveChildren||u.test(e)||s.tagUrn?s:i.frag.appendChild(s)}function r(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return v.shivMethods?s(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/[\w\-]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(v,t.frag)}function a(e){e||(e=t);var i=o(e);return v.shivCSS&&!c&&!i.hasCSS&&(i.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||r(e,i),e}var c,l,f=e.html5||{},u=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,d=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,p="_html5shiv",m=0,h={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",c="hidden"in e,l=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return void 0===e.cloneNode||void 0===e.createDocumentFragment||void 0===e.createElement}()}catch(e){c=!0,l=!0}}();var v={elements:f.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==f.shivCSS,supportsUnknownElements:l,shivMethods:!1!==f.shivMethods,type:"default",shivDocument:a,createElement:s,createDocumentFragment:function(e,n){if(e||(e=t),l)return e.createDocumentFragment();for(var s=(n=n||o(e)).frag.cloneNode(),r=0,a=i(),c=a.length;r<c;r++)s.createElement(a[r]);return s}};e.html5=v,a(t)}(this,t),u._version="2.8.0",u._domPrefixes=g,u._cssomPrefixes=v,u.testProp=function(e){return r([e])},u.testAllProps=c,u.prefixed=function(e,t,n){return t?c(e,t,n):c(e,"pfx")},d.className=d.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+" js "+w.join(" "),u}(0,this.document),function(e,t,n){function i(e){return"[object Function]"==v.call(e)}function o(e){return"string"==typeof e}function s(){}function r(e){return!e||"loaded"==e||"complete"==e||"uninitialized"==e}function a(){var e=g.shift();y=1,e?e.t?m(function(){("c"==e.t?d.injectCss:d.injectJs)(e.s,0,e.a,e.x,e.e,1)},0):(e(),a()):y=0}function c(e,n,i,o,s,c,l){function f(t){if(!p&&r(u.readyState)&&(w.r=p=1,!y&&a(),u.onload=u.onreadystatechange=null,t)){"img"!=e&&m(function(){E.removeChild(u)},50);for(var i in k[n])k[n].hasOwnProperty(i)&&k[n][i].onload()}}var l=l||d.errorTimeout,u=t.createElement(e),p=0,v=0,w={t:i,s:n,e:s,a:c,x:l};1===k[n]&&(v=1,k[n]=[]),"object"==e?u.data=n:(u.src=n,u.type=e),u.width=u.height="0",u.onerror=u.onload=u.onreadystatechange=function(){f.call(this,v)},g.splice(o,0,w),"img"!=e&&(v||2===k[n]?(E.insertBefore(u,b?null:h),m(f,l)):k[n].push(u))}function l(e,t,n,i,s){return y=0,t=t||"j",o(e)?c("c"==t?x:C,e,t,this.i++,n,i,s):(g.splice(this.i++,0,e),1==g.length&&a()),this}function f(){var e=d;return e.loader={load:l,i:0},e}var u,d,p=t.documentElement,m=e.setTimeout,h=t.getElementsByTagName("script")[0],v={}.toString,g=[],y=0,w="MozAppearance"in p.style,b=w&&!!t.createRange().compareNode,E=b?p:h.parentNode,p=e.opera&&"[object Opera]"==v.call(e.opera),p=!!t.attachEvent&&!p,C=w?"object":p?"script":"img",x=p?"script":C,_=Array.isArray||function(e){return"[object Array]"==v.call(e)},S=[],k={},T={timeout:function(e,t){return t.length&&(e.timeout=t[0]),e}};(d=function(e){function t(e){var t,n,i,e=e.split("!"),o=S.length,s=e.pop(),r=e.length,s={url:s,origUrl:s,prefixes:e};for(n=0;n<r;n++)i=e[n].split("="),(t=T[i.shift()])&&(s=t(s,i));for(n=0;n<o;n++)s=S[n](s);return s}function r(e,o,s,r,a){var c=t(e),l=c.autoCallback;c.url.split(".").pop().split("?").shift(),c.bypass||(o&&(o=i(o)?o:o[e]||o[r]||o[e.split("/").pop().split("?")[0]]),c.instead?c.instead(e,o,s,r,a):(k[c.url]?c.noexec=!0:k[c.url]=1,s.load(c.url,c.forceCSS||!c.forceJS&&"css"==c.url.split(".").pop().split("?").shift()?"c":n,c.noexec,c.attrs,c.timeout),(i(o)||i(l))&&s.load(function(){f(),o&&o(c.origUrl,a,r),l&&l(c.origUrl,a,r),k[c.url]=2})))}function a(e,t){function n(e,n){if(e){if(o(e))n||(u=function(){var e=[].slice.call(arguments);d.apply(this,e),p()}),r(e,u,t,0,l);else if(Object(e)===e)for(c in a=function(){var t,n=0;for(t in e)e.hasOwnProperty(t)&&n++;return n}(),e)e.hasOwnProperty(c)&&(!n&&!--a&&(i(u)?u=function(){var e=[].slice.call(arguments);d.apply(this,e),p()}:u[c]=function(e){return function(){var t=[].slice.call(arguments);e&&e.apply(this,t),p()}}(d[c])),r(e[c],u,t,c,l))}else!n&&p()}var a,c,l=!!e.test,f=e.load||e.both,u=e.callback||s,d=u,p=e.complete||s;n(l?e.yep:e.nope,!!f),f&&n(f)}var c,l,u=this.yepnope.loader;if(o(e))r(e,0,u,0);else if(_(e))for(c=0;c<e.length;c++)l=e[c],o(l)?r(l,0,u,0):_(l)?d(l):Object(l)===l&&a(l,u);else Object(e)===e&&a(e,u)}).addPrefix=function(e,t){T[e]=t},d.addFilter=function(e){S.push(e)},d.errorTimeout=1e4,null==t.readyState&&t.addEventListener&&(t.readyState="loading",t.addEventListener("DOMContentLoaded",u=function(){t.removeEventListener("DOMContentLoaded",u,0),t.readyState="complete"},0)),e.yepnope=f(),e.yepnope.executeStack=a,e.yepnope.injectJs=function(e,n,i,o,c,l){var f,u,p=t.createElement("script"),o=o||d.errorTimeout;p.src=e;for(u in i)p.setAttribute(u,i[u]);n=l?a:n||s,p.onreadystatechange=p.onload=function(){!f&&r(p.readyState)&&(f=1,n(),p.onload=p.onreadystatechange=null)},m(function(){f||(f=1,n(1))},o),c?p.onload():h.parentNode.insertBefore(p,h)},e.yepnope.injectCss=function(e,n,i,o,r,c){var l,o=t.createElement("link"),n=c?a:n||s;o.href=e,o.rel="stylesheet",o.type="text/css";for(l in i)o.setAttribute(l,i[l]);r||(h.parentNode.insertBefore(o,h),m(n,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},function(e){"use strict";function t(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function n(e,t){(i(e,t)?s:o)(e,t)}var i,o,s;"classList"in document.documentElement?(i=function(e,t){return e.classList.contains(t)},o=function(e,t){e.classList.add(t)},s=function(e,t){e.classList.remove(t)}):(i=function(e,n){return t(n).test(e.className)},o=function(e,t){i(e,t)||(e.className=e.className+" "+t)},s=function(e,n){e.className=e.className.replace(t(n)," ")});var r={hasClass:i,addClass:o,removeClass:s,toggleClass:n,has:i,add:o,remove:s,toggle:n};"function"==typeof define&&define.amd?define(r):e.classie=r}(window),function(e){"use strict";function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function n(e,n){this.el=e,this.options=t({},this.options),t(this.options,n),this._init()}var i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"}[Modernizr.prefixed("transition")],o={transitions:Modernizr.csstransitions};n.prototype.options={closeEl:"",onBeforeOpen:function(){return!1},onAfterOpen:function(){return!1},onBeforeClose:function(){return!1},onAfterClose:function(){return!1}},n.prototype._init=function(){this.button=this.el.querySelector(".sf-settings"),this.expanded=!1,this.contentEl=this.el.querySelector(".morph-content"),this._initEvents()},n.prototype._initEvents=function(){var e=this;if(this.button.addEventListener("click",function(){e.toggle()}),""!==this.options.closeEl){var t=this.el.querySelector(this.options.closeEl);t&&t.addEventListener("click",function(){e.toggle()})}jQuery(this.contentEl).on("mousemove",function(e){$(e.srcElement).hasClass("iris-square-inner")||e.stopPropagation()}),jQuery(this.el).on("click",function(t){jQuery(t.target).closest(".morph-content").length||e.toggle()})},n.prototype.toggle=function(){if(this.isAnimating)return!1;this.expanded?this.options.onBeforeClose():(classie.addClass(this.el,"active"),this.options.onBeforeOpen()),this.isAnimating=!0;var e=this,t=function(n){if(n.target!==this)return!1;if(o.transitions){if(e.expanded&&"opacity"!==n.propertyName||!e.expanded&&"width"!==n.propertyName&&"height"!==n.propertyName&&"left"!==n.propertyName&&"top"!==n.propertyName)return!1;this.removeEventListener(i,t)}e.isAnimating=!1,e.expanded?(classie.removeClass(e.el,"active"),e.options.onAfterClose()):(e.options.onAfterOpen(),classie.addClass(e.el,"opened"),classie.addClass(document.body,"sf-modal-opened")),e.expanded=!e.expanded};o.transitions?this.contentEl.addEventListener(i,t):t();var n=this.button.getBoundingClientRect();classie.addClass(this.contentEl,"no-transition"),this.contentEl.style.left="auto",this.contentEl.style.top="auto",setTimeout(function(){e.contentEl.style.left=n.left+"px",e.contentEl.style.top=n.top+"px",e.expanded?(classie.removeClass(e.contentEl,"no-transition"),classie.removeClass(e.el,"open"),classie.removeClass(e.el,"opened"),classie.removeClass(document.body,"sf-modal-opened")):setTimeout(function(){classie.removeClass(e.contentEl,"no-transition"),classie.addClass(e.el,"open")},25)},25)},e.UIMorphingButton=n}(window),jQuery(function(e){"use strict";function t(){window.scrollTo(l?l.x:0,l?l.y:0)}function n(){window.removeEventListener("scroll",s),window.addEventListener("scroll",t)}function i(){window.addEventListener("scroll",s)}function o(){window.removeEventListener("scroll",t),i()}function s(){c||(c=!0,setTimeout(function(){r()},60))}function r(){l={x:window.pageXOffset||u.scrollLeft,y:window.pageYOffset||u.scrollTop},c=!1}function a(e){var t,n,i,o,s,r={};if("?"===e.slice(0,1)&&(e=e.slice(1)),""!==e)for(t=e.split("&"),n=0;n<t.length;n+=1)i=t[n].split("="),o=decodeURIComponent(i[0]),s=i.length>1?decodeURIComponent(i[1]):void 0,r[o]=s,"icon"!==o&&(r[o]=s.replace(/\+/g," "));return r}var c,l,f,u=window.document.documentElement,d='<div class="sf-settings-wrapper morph-button morph-button-fixed morph-button-modal morph-button-modal-2"><span title="Superfly Item Settings" class="sf-settings sf-anim"><i class="fa fa-gear"></i> SF</span><div class="morph-content" title="Test"><i class="fa fa-save" title="Save and close"></i><i class="fa fa-times" title="Close"></i><form class="sf-menu-item-form" action="" method="post" enctype="multipart/form-data"><div><h3>Attached image</h3><div class="sf-info sf-anim">Please choose image to show on the left side of item. Use square pics. Will be scaled to 40px height.</div><div class="sf-media"><span class="sf-image-cont"></span><span class="sf-choose-image">Select Image</span></div><input class="sf-media-input" type="hidden" name="img"/></div><div><h3>Or Custom Icon</h3><div id="sf_menu_icon_select_%ID%"></div><input id="sf_menu_icon_%ID%" name="icon" type="hidden" value="" style="" /></div><div><h3>Custom icon color</h3><div class="sf-info sf-anim">Icon color for panel with custom content</div><input class="sf-short" type="text" name="icon_color"/></div><div><h3>Second line</h3><div class="sf-info sf-anim">Brief description under menu item</div><input type="text" name="sline"/></div><div><h3>Section</h3><div class="sf-info sf-anim">Section heading that will be added above this menu item</div><input class="" type="text" name="chapter"/></div><div><h3>Custom HTML OR shortcode</h3><div class="sf-info sf-anim">That will be shown in panel when user clicks/mouseover according menu item</div><textarea class="" type="text" name="content"></textarea></div><div><h3>Custom panel color</h3><div class="sf-info sf-anim">Background color for panel with custom content</div><input class="sf-short" type="text" name="bg"/></div><div><h3>Custom panel width</h3><div class="sf-info sf-anim">If empty default level width will be applied</div><input class="sf-short" type="text" name="width"/></div><div><h3>Hide item and its custom content on mobiles</h3><label for="mob_%ID%"><input id="mob_%ID%" name="hidemob" class="switcher" type="checkbox" value="yes" /></label></div><p><button>Save & Close</button></p></form></div></div>';e("#menu-management .menu-item").each(function(){var t=e(this),n=this.id,i=e(d.replace(/%ID%/g,n));i.find(".morph-content").attr("title",t.find(".menu-item-title").text()),e(document).on("iconManagerCollectionLoaded",function(){window["la_icon_manager_select_"+n]=new LAIconManager(n,"#sf_menu_icon_select_"+n,window.la_icon_manager_collection,"#sf_menu_icon_"+n),window["la_icon_manager_select_"+n].showIconSelect()}),t.find(".item-title").append(i.attr("data-sf-item-id",n))}),e(".switcher").each(function(){e(this).after("<div><div></div></div>")}),i(),[].slice.call(document.querySelectorAll(".morph-button")).forEach(function(e){new UIMorphingButton(e,{closeEl:".fa-times",onBeforeOpen:function(){n()},onAfterOpen:function(){o()},onBeforeClose:function(){n()},onAfterClose:function(){o()}})}),e("#menu-management .sf-settings-wrapper form").each(function(){var t,n=e(this),i=n.closest(".sf-settings-wrapper").attr("data-sf-item-id").replace("menu-item-",""),o=sf_menus_data[i];if(!o)return n.find('[name="bg"]').wpColorPicker(),void n.find('[name="icon_color"]').wpColorPicker();o=a(o);for(var s in o)if((t=n.find("[name="+s+"]")).is(":checkbox")?"yes"===o[s]&&t.attr("checked",!0):n.find("[name="+s+"]").val(o[s]),"img"===s&&""!==o[s]&&n.find(".sf-image-cont").html('<img src="'+o[s]+'"/>'),"icon"===s){var r=o[s];r=r.indexOf("fa-")+1?"Font-Awesome_####_"+r.substr(3):r,n.find("[name="+s+"]").val(r)}n.find('[name="bg"]').wpColorPicker(),n.find('[name="icon_color"]').wpColorPicker()}),e(document).on("click",".sf-settings-wrapper .preview",function(){var t=e(this);t.html("").hide(),t.closest(".la-icon-manager").parent().next("input[name=icon]").val("")}),e("#menu-management .sf-settings-wrapper form").on("submit",function(t){t.preventDefault();var n=e(this),i=n.closest(".morph-content"),o=n.serialize(),s=e(this).closest(".sf-settings-wrapper").attr("data-sf-item-id");console.log("serialized: "+o);var r={action:"sf_save_item",settings:o,id:s.replace("menu-item-","")};return i.addClass("sf-loading sf-shrinking"),e.post(sf_menus_meta.ajax_url,r,function(e){console.log("Got this from the server: ",e),-1==e||(i.removeClass("sf-loading"),setTimeout(function(){i.removeClass("sf-shrinking")},500),i.find(".fa-times").trigger("click"))},"json").fail(function(e){console.log(e.responseText),console.log(e)}),!1}),e("#menu-management").on("click",".sf-settings-wrapper .fa-save",function(){e(this).siblings("form").trigger("submit")}),e(".sf-image-cont").on("click",function(t){var n=e(this),i=n.closest("form").find(" .sf-media-input ");n.has("img")&&(i.val(""),n.html(""))});var p,m,h;e("#menu-management .sf-choose-image").on("click",function(t){p=e(this),m=p.closest("form").find(" .sf-media-input "),f?f.open():((f=wp.media.frames.file_frame=wp.media({multiple:!1})).on("select",function(){h=f.state().get("selection").first().toJSON(),p.prev().html('<img src="'+h.url+'"/>'),m.val(h.sizes.full.url),p=null,h=null}),f.open())})});
var AwesomeAjax=function(e){"use strict";var a=jQuery,r=this,e=e+"_";r.result={},r.load_model=function(a,n,s,o){return r.ajax({action:e+"get_"+a,data:{id:n},success_handler:s,error_handler:o})},r.publish_model=function(a,n,s){return r.ajax({action:e+"publish_model",data:{id:a},success_handler:n,error_handler:s})},r.delete_model=function(a,n){return r.ajax({action:e+"delete_model",data:{id:a,model_name:n},success_handler:function(e){return e}})},r.ajax=function(r){return a.ajax({url:window[e+"localize"].ajaxurl,type:"post",data:{action:r.action,security:window[e+"localize"].ajax_nonce,data:r.data||{}},success:function(e){var a=wpAjax.parseAjaxResponse(e);if(a.errors){var n=a.responses[0].errors;r.success_error_handler(n)}else{var s=JSON.parse(a.responses[0].data);r.success_handler(s)}},error:function(e){r.error_handler(e)}})}};
var AwesomeUtil={detect_os:function(){var e="Unknown OS";return-1!=navigator.appVersion.indexOf("Win")&&(e="Windows"),-1!=navigator.appVersion.indexOf("Mac")&&(e="MacOS"),-1!=navigator.appVersion.indexOf("X11")&&(e="UNIX"),-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),e},toObject:function(e){for(var n={},t=0;t<e.length;++t)"object"==typeof e[t]?n[t]=AwesomeUtil.toObject(e[t]):n[t]=e[t];return n},find_in_array_of_objects:function(e,n,t){var i=!1;return jQuery.each(e,function(e,r){r.hasOwnProperty(n)&&r[n]==t&&(i=!0)}),i},hex_to_rgb:function(e){return[(e=parseInt(e,16))>>16,e>>8&255,255&e]},calc_size:function(e){return(e=""+e).endsWith("%")||e.endsWith("px")?e:e.replace("/[^0-9]/","")+"px"},clean_number:function(e){return parseInt(e.replace(/\D+/g,""))},get_keys:function(e){var n={},t=0;return _.each(e,function(e,i,r){n[t]="object"==typeof e?AwesomeUtil.get_keys(e):i,t++}),n},find_key_by_value:function(e,n){var t;return _.find(n,function(n,i){if("object"!=typeof n)return n===e&&(t=i,!0);t=AwesomeUtil.find_key_by_value(e,n)}),t},find_index_by_value:function(e,n){var t=AwesomeUtil.get_keys(n),i=AwesomeUtil.find_key_by_value(e,n);return AwesomeUtil.find_key_by_value(i,t)},removeClass:function(e,n){jQuery(e).removeClass(function(e,t){var i=new RegExp("(^|\\s)"+n+"\\S+","g");return(t.match(i)||[]).join(" ")})}};String.prototype.replace_all=function(e,n){return this.replace(new RegExp(e,"g"),n)},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)},String.prototype.endsWith=function(e){return-1!==this.indexOf(e,this.length-e.length)};var $=jQuery;$.fn.isVisible=function(e){var n=$("undefined"!==e?e:window).scrollTop();return $(this).height()>=n};
//# sourceMappingURL=admin_menu.min.js.map