PageSourceSearch

https://gosaluni.com/wp-content/cache/wpfc-minified/988o55q7/9pzst.js

js gosaluni.com collected 2026-10-08 08:27:41 UTC 536,461 bytes, 8,173 lines download raw bytes

1jQuery.noConflict();
2function changeColInUri(data, colfrom, colto){
3var img=new Image();
4img.src=data;
5img.style.visibility="hidden";
6document.body.appendChild(img);
7var canvas=document.createElement("canvas");
8canvas.id='canvas';
9canvas.width=img.offsetWidth;
10canvas.height=img.offsetHeight;
11var ctx=canvas.getContext("2d");
12ctx.drawImage(img, 0, 0);
13img.parentNode.removeChild(img);
14if(canvas.width!=0&&canvas!=undefined){
15var imageData=ctx.getImageData(0, 0, canvas.width, canvas.height);
16var data=imageData.data;
17var rgbfrom=hexToRGB(colfrom);
18var rgbto=hexToRGB(colto);
19var r, g, b;
20for (var x=0, len=data.length; x < len; x +=4){
21r=data[x];
22g=data[x + 1];
23b=data[x + 2];
24data[x]=rgbto.r;
25data[x + 1]=rgbto.g;
26data[x + 2]=rgbto.b;
27}
28ctx.putImageData(imageData, 0, 0);
29}
30return canvas.toDataURL();
31}
32jQuery(document).ready(function($){
33jQuery('#input-dropdown').find('li').each(function(){
34var iconsrc=jQuery(this).find('img').attr('src');
35if(iconsrc!=''&&iconsrc!=undefined){
36var changecolor=changeColInUri(iconsrc, "#41A6DF", "#ffffff");
37jQuery(this).prepend('<img class="h-icon" alt="image" src="' + changecolor + '" />');
38}});
39jQuery('.listing-single-cat').find('li').each(function(){
40var iconsrc=jQuery(this).find('.base-icon').attr('src');
41if(iconsrc!=''&&iconsrc!=undefined){
42var changecolor=changeColInUri(iconsrc, "#41A6DF", "#ffffff");
43jQuery(this).find('.base-icon').attr("src", changecolor);
44}});
45jQuery('.user-portfolio ul.post-socials').find('li').each(function(){
46var iconsrc=jQuery(this).find('.icon').attr('src');
47if(iconsrc!=''&&iconsrc!=undefined){
48var changecolor=changeColInUri(iconsrc, "#ffffff", "#41A6DF");
49jQuery(this).find('.icon').attr("src", changecolor);
50}});
51jQuery('.blog-social ul.blog-social').find('li').each(function(){
52var iconsrc=jQuery(this).find('.icon').attr('src');
53if(iconsrc!=''&&iconsrc!=undefined){
54var changecolor=changeColInUri(iconsrc, "#ffffff", "#41A6DF");
55jQuery(this).find('.icon').attr("src", changecolor);
56}});
57jQuery('.user-info ul.social-icons').find('li').each(function(){
58var iconsrc=jQuery(this).find('.icon').attr('src');
59if(iconsrc!=''&&iconsrc!=undefined){
60var changecolor=changeColInUri(iconsrc, "#ffffff", "#6e6e6e");
61jQuery(this).find('.icon').attr("src", changecolor);
62}});
63jQuery('.popup-post-left-bottom ul.social-icons').find('li').each(function(){
64var iconsrc=jQuery(this).find('.icon').attr('src');
65if(iconsrc!=''&&iconsrc!=undefined){
66var changecolor=changeColInUri(iconsrc, "#ffffff", "#6e6e6e");
67jQuery(this).find('.icon').attr("src", changecolor);
68}});
69});
70var geocoderr;
71function lpGetGpsLocName(lpcalback){
72if(navigator.geolocation){
73navigator.geolocation.getCurrentPosition(function(position){
74var clat=position.coords.latitude;
75var clong=position.coords.longitude;
76jpCodeLatLng(clat,clong, function(citynamevalue){
77lpcalback(citynamevalue);
78});
79});
80}else{
81alert("Geolocation is not supported by this browser.");
82}}
83function lpgeocodeinitialize(){
84geocoderr=new google.maps.Geocoder();
85}
86function jpCodeLatLng(lat, lng, lpcitycallback){
87var geocoder, city, state, country;
88geocoder=new google.maps.Geocoder();
89var latlng=new google.maps.LatLng(lat, lng);
90geocoder.geocode({'latLng': latlng},
91function(results, status){
92if(status==google.maps.GeocoderStatus.OK){
93for (var ac=0; ac < results[0].address_components.length; ac++){
94var component=results[0].address_components[ac];
95switch(component.types[0]){
96case 'locality':
97city=component.long_name;
98break;
99case 'administrative_area_level_1':
100state=component.short_name;
101break;
102case 'country':
103country=component.short_name;
104break;
105}};
106lpcitycallback(city);
107}else{
108console.log("Geocoder failed due to: " + status);
109}}
110);
111}
112jQuery(document).ready(function(){
113lpgeocodeinitialize();
114});
115jQuery(document).ready(function (){
116jQuery(document).on('click', '.lp-hide-show-price-features', function (){
117var $this=jQuery(this);
118var showfeaures=jQuery(this).data('show');
119var hidefeaures=jQuery(this).data('hide');
120jQuery('.lp-hide-show-price-features').text(showfeaures);
121if(false==jQuery(this).next().is(':visible')){
122jQuery(".lp-hide-show-price-features").removeClass('expanded');
123}
124$this.toggleClass('MoreDetails');
125if($this.hasClass('MoreDetails')){
126$this.text(hidefeaures);
127jQuery(".lp-price-list").fadeIn('400');
128}else{
129$this.text(showfeaures);
130jQuery(".lp-price-list").fadeOut('400');
131}});
132});
133jQuery(document).ready(function (){
134jQuery('.lp-price-cats-with-icon li input[type=radio]').click(function (){
135jQuery('.lp-price-cats-with-icon li input[type=radio]:not(:checked)').parent().removeClass("active-category-radio");
136jQuery('.lp-price-cats-with-icon li input[type=radio]:checked').parent().addClass("active-category-radio");
137});
138});
139jQuery(document).ready(function (){
140jQuery('.lp-price-cats-with-icon-v2 li input[type=radio]').click(function (){
141jQuery('.lp-price-cats-with-icon-v2 li input[type=radio]:not(:checked)').parent().removeClass("active-category-radio-v2");
142jQuery('.lp-price-cats-with-icon-v2 li input[type=radio]:checked').parent().addClass("active-category-radio-v2");
143});
144});
145jQuery(document).ready(function (){
146jQuery(document).on('click', '.horizontal_view_list li input[type=radio]', function (){
147jQuery('.horizontal_view_list li input[type=radio]:not(:checked)').parent('label').removeClass("price_plan_active_disable");
148jQuery('.horizontal_view_list li input[type=radio]:checked').parent('label').addClass("price_plan_active_disable");
149jQuery('.lp_hori_view_plan_left_section').removeClass('horizontal_choose_button');
150jQuery(this).closest('.lp_hori_view_plan_left_section').addClass('horizontal_choose_button');
151jQuery(this).closest('.lp-horizontial-specific').addClass('lp-horizontial-specific-height');
152});
153jQuery(document).on('click', '.lp-standerd-exlusiv button', function (event){
154jQuery('.lp-horizontial-specific').removeClass('lp-horizontial-specific-height');
155});
156jQuery(document).on('click', '.lp_button_switcher span', function (event){
157jQuery('.lp-horizontial-specific').removeClass('lp-horizontial-specific-height');
158});
159jQuery('.horizontal_view_list li:nth(0) input[type=radio]').trigger('click').parent('label').addClass("price_plan_active_disable");
160});
161jQuery(document).ready(function (){
162var x=jQuery('.lp_category_list_slide').children();
163for (i=0; i < x.length; i +=1){
164x.slice(i, i + 1).wrapAll('<div class="' + i + '"></div>');
165}
166if(jQuery('.lp_category_list_slide').length!=0){
167jQuery('.lp_category_list_slide').slick({
168slidesToShow: 5,
169slidesToScroll: 1,
170prevNext: true,
171arrows: true,
172dots: false,
173responsive: [
174{
175breakpoint: 768,
176settings: {
177arrows: true,
178infinite: false,
179slidesToShow: 4,
180slidesToScroll: 1
181}},
182{
183breakpoint: 481,
184settings: {
185arrows: true,
186infinite: false,
187slidesToShow: 3,
188slidesToScroll: 1
189}},
190{
191breakpoint: 390,
192settings: {
193arrows: true,
194infinite: false,
195slidesToShow: 2,
196slidesToScroll: 1
197}}
198]
199});
200}});
201/*jQuery(document).ready(function(){
202jQuery('.slider_pricing_Plan').slick({
203slidesToShow: 3,
204slidesToScroll: 1,
205arrows: true,
206fade: true,
207dots: true,
208arrows:true
209});
210});*/
211jQuery(document).ready(function (){
212jQuery('#category_dropdown').on('select2:select', function (e){
213$this=jQuery(this);
214jQuery("body").addClass("listingpro-loading");
215jQuery('#cats-selected-plans').html('');
216var templatestyle=jQuery(this).closest('#select_style').data('style');
217jQuery.ajax({
218type: 'POST',
219dataType: 'json',
220url: ajax_term_object.ajaxurl,
221data: {
222'action': 'listingpro_select_plan_by_cat',
223'term_id': $this.val(),
224'templatestyle': templatestyle,
225},
226success: function (data){
227jQuery("body").removeClass("listingpro-loading");
228if(data.plans){
229jQuery('#cats-selected-plans').html(data.plans);
230var $hiddenField='<input type="hidden" name="lp_pre_selected_cats" value="' + $this.val() + '" />';
231jQuery($hiddenField).appendTo(".price-plan-button");
232}}
233});
234});
235});
236jQuery(document).ready(function (){
237jQuery('.tooltip_price_features span').on('mouseover', function (){
238var $this=jQuery(this);
239$this.closest('.tooltip_price_features').find('.lp_tooltip_text').css("visibility", "visible");
240});
241jQuery('.tooltip_price_features span').on('mouseout', function (){
242var $this=jQuery(this);
243$this.closest('.tooltip_price_features').find('.lp_tooltip_text').css("visibility", "hidden");
244});
245});
246jQuery(document).ready(function (){
247jQuery(document).on('mouseover', '.tooltip_price_features span', function (){
248var $this=jQuery(this);
249$this.closest('.tooltip_price_features').find('.lp_tooltip_text').css("visibility", "visible");
250});
251jQuery(document).on('mouseout', '.tooltip_price_features span', function (){
252var $this=jQuery(this);
253$this.closest('.tooltip_price_features').find('.lp_tooltip_text').css("visibility", "hidden");
254});
255});
256jQuery.noConflict();
257jQuery(window).on('resize load live', function (){
258jQuery(window).resize(function (){
259if(jQuery(window).width() <=768){
260jQuery('a.open-map-view').on('click', function (event){
261event.preventDefault();
262jQuery('.sidemap-container').addClass('open-map');
263jQuery('header').addClass('map-view-content');
264});
265jQuery('a.open-img-view').on('click', function (event){
266event.preventDefault();
267jQuery('.sidemap-container').removeClass('open-map');
268jQuery('header').removeClass('map-view-content');
269});
270if(jQuery('#wpadminbar').length > 0){
271jQuery('html body').css('margin-top', '-46px');
272}}else{
273jQuery('.sidemap-container').removeClass('open-map');
274if(jQuery('#wpadminbar').length > 0){
275jQuery('html body').css('margin-top', '0px');
276}
277jQuery('a.open-map-view').on('click', function (event){
278event.preventDefault();
279jQuery('.sidemap-container').addClass('open-map');
280jQuery('header').addClass('map-view-content');
281});
282jQuery('a.open-img-view').on('click', function (event){
283event.preventDefault();
284jQuery('.sidemap-container').removeClass('open-map');
285jQuery('header').removeClass('map-view-content');
286});
287}
288if(jQuery(window).width() <=480){
289jQuery('#more_filters').hide();
290}else{
291jQuery('#more_filters').show();
292}});
293});
294jQuery(document).ready(function (){
295jQuery('.lp_cancel_notic').click(function (e){
296e.preventDefault();
297jQuery('.lp_notification_wrapper').slideToggle(400);
298})
299jQuery('.claimformtrigger2').click(function (){
300jQuery('header').addClass('lp-head-zindex');
301var divHeight=jQuery('.leftside').height();
302jQuery('.rightside').css('height', divHeight + 'px');
303})
304jQuery('.lp-click-zindex').click(function (){
305jQuery('header').removeClass('lp-head-zindex');
306});
307jQuery('.lp-tagline-submit-tagline label input[type="checkbox"]').click(function (event){
308if(jQuery(this).prop("checked")==true){
309jQuery(".with-title-cond").fadeIn(700);
310}else if(jQuery(this).prop("checked")==false){
311jQuery(".with-title-cond").fadeOut(700);
312}});
313jQuery('.stickynavbar ul li').each(function (e){
314var tagetID=jQuery(this).find('a').attr('href');
315if(jQuery(tagetID).length==0){
316jQuery(this).remove();
317}});
318var hh=jQuery('header').outerHeight();
319var ab=jQuery('.absolute');
320ab.css('top', hh);
321if(jQuery('.chosen-container').length > 0){
322jQuery('.chosen-container').on('touchstart', function (e){
323e.stopPropagation();
324e.preventDefault();
325jQuery(this).trigger('mousedown');
326});
327}
328jQuery('#see_filter').on('click', function (event){
329event.preventDefault();
330var filter=jQuery('#more_filters');
331jQuery(this).next('#more_filters').toggleClass('open_filter');
332if(filter.hasClass('open_filter')){
333jQuery(this).next('#more_filters').slideDown(400);
334}else{
335jQuery(this).next('#more_filters').slideUp(400);
336}});
337});
338jQuery(document).ready(function ($){
339var loc=jQuery('.ui-widget').data('option');
340var apiType=jQuery('#page').data('ipapi');
341var currentlocationswitch='1';
342currentlocationswitch=jQuery('#page').data('lpcurrentloconhome');
343if(currentlocationswitch=="0"){
344loc='locationifoff';
345jQuery('.lp-location-search .ui-widget > i').fadeOut('fast');
346}
347if(loc=='yes'){
348if((jQuery('.form-group').is('.lp-location-search')||jQuery('.form-group').is('.lp-location-inner-search'))&&(jQuery('body').is('.home')||jQuery('body').is('.app-view-home'))){
349if(apiType==="geo_ip_db"){
350jQuery.getJSON('https://geolocation-db.com/json/geoip.php?jsonp=?')
351.done(function (location){
352var c_loc=location.city;
353var lp_s_loc=c_loc;
354if(jQuery('#page').data('lpattern')=='with_region'){
355c_loc=location.city + " " + location.state + ", " + location.country_name;
356lp_s_loc=location.city + " " + location.state;
357}
358jQuery("#searchlocation").prop('disabled', true).trigger('chosen:updated');
359jQuery('#searchlocation').find('#def_location').text(c_loc);
360jQuery('#searchlocation').find('#def_location').val(c_loc);
361jQuery('#cities').val(c_loc);
362jQuery('input[name=lp_s_loc]').val(lp_s_loc);
363jQuery("#searchlocation").prop('disabled', false).trigger('chosen:updated');
364jQuery('.select2-selection__rendered').parent('.select2-selection').addClass('slide-right');
365jQuery('.lp-location-search .ui-widget > i').fadeOut('slow');
366});
367}else if(apiType==="ip_api"){
368jQuery.get("https://ipapi.co/json", function (location){
369var c_loc=location.city;
370var lp_s_loc=c_loc;
371if(jQuery('#page').data('lpattern')=='with_region'){
372c_loc=location.city + " " + location.region_code + ", " + location.country_name;
373lp_s_loc=location.city + " " + location.region_code;
374}
375jQuery("#searchlocation").prop('disabled', true).trigger('chosen:updated');
376jQuery('#searchlocation').find('#def_location').text(c_loc);
377jQuery('#searchlocation').find('#def_location').val(c_loc);
378jQuery('#cities').val(c_loc);
379jQuery('input[name=lp_s_loc]').val(lp_s_loc);
380jQuery("#searchlocation").prop('disabled', false).trigger('chosen:updated');
381jQuery('.select2-selection__rendered').parent('.select2-selection').addClass('slide-right');
382jQuery('.lp-location-search .ui-widget > i').fadeOut('slow');
383}, "json");
384}else{
385lpGetGpsLocName(function (lpgetcurrentcityvalue){
386lpgpsclocation=lpgetcurrentcityvalue;
387jQuery("#searchlocation").prop('disabled', true).trigger('chosen:updated');
388jQuery('#searchlocation').find('#def_location').text(lpgpsclocation);
389jQuery('#searchlocation').find('#def_location').val(lpgpsclocation);
390jQuery('#cities').val(lpgpsclocation);
391jQuery('input[name=lp_s_loc]').val(lpgpsclocation);
392jQuery("#searchlocation").prop('disabled', false).trigger('chosen:updated');
393jQuery('.select2-selection__rendered').parent('.select2-selection').addClass('slide-right');
394jQuery('.lp-location-search .ui-widget > i').fadeOut('slow');
395});
396}
397jQuery('.chosen-select2').chosen({
398disable_search: true
399});
400jQuery('.chosen-select1').chosen({
401disable_search: true
402});
403jQuery('.chosen-select7').chosen({
404disable_search: true
405});
406jQuery('.chosen-select5').chosen({
407disable_search: true
408});
409}}else if(loc=='no'){
410jQuery('.lp-location-search .ui-widget > i').on('click', function (event){
411event.preventDefault();
412jQuery(this).addClass('fa-circle-o-notch fa-spin');
413jQuery(this).removeClass('fa-crosshairs');
414if(jQuery('.form-group').is('.lp-location-search')){
415if(apiType==="geo_ip_db"){
416jQuery.getJSON('https://geolocation-db.com/json/geoip.php?jsonp=?')
417.done(function (location){
418jQuery('.chosen-single').addClass('remove-margin');
419jQuery("#searchlocation").prop('disabled', true).trigger('chosen:updated');
420if(location.city==null){
421}else{
422jQuery('#select2-searchlocation-container').text(location.city);
423jQuery('#searchlocation').find('#def_location').val(location.city).text(location.city);
424jQuery('#cities').val(location.city);
425jQuery('input[name=lp_s_loc]').val(location.city);
426}
427jQuery("#searchlocation").prop('disabled', false).trigger('chosen:updated');
428jQuery('.select2-selection__rendered').parent('.select2-selection').addClass('slide-right');
429jQuery('.lp-location-search .ui-widget > i').fadeOut('slow');
430});
431}else if(apiType==="ip_api"){
432jQuery.get("https://ipapi.co/json", function (location){
433jQuery('.chosen-single').addClass('remove-margin');
434jQuery("#searchlocation").prop('disabled', true).trigger('chosen:updated');
435if(location.city==null){
436}else{
437jQuery('#select2-searchlocation-container').text(location.city);
438jQuery('#searchlocation').find('#def_location').val(location.city).text(location.city);
439jQuery('#cities').val(location.city);
440jQuery('input[name=lp_s_loc]').val(location.city);
441}
442jQuery("#searchlocation").prop('disabled', false).trigger('chosen:updated');
443jQuery('.select2-selection__rendered').parent('.select2-selection').addClass('slide-right');
444jQuery('.lp-location-search .ui-widget > i').fadeOut('slow');
445}, "json");
446}else{
447lpGetGpsLocName(function (lpgetcurrentcityvalue){
448lpgpsclocation=lpgetcurrentcityvalue;
449jQuery('.chosen-single').addClass('remove-margin');
450jQuery("#searchlocation").prop('disabled', true).trigger('chosen:updated');
451jQuery('#select2-searchlocation-container').text(lpgpsclocation);
452jQuery('#searchlocation').find('#def_location').val(lpgpsclocation).text(lpgpsclocation);
453jQuery('#cities').val(lpgpsclocation);
454jQuery('input[name=lp_s_loc]').val(lpgpsclocation);
455jQuery("#searchlocation").prop('disabled', false).trigger('chosen:updated');
456jQuery('.select2-selection__rendered').parent('.select2-selection').addClass('slide-right');
457jQuery('.lp-location-search .ui-widget > i').fadeOut('slow');
458});
459}
460jQuery('.chosen-select2').chosen({
461disable_search: true
462});
463jQuery('.chosen-select1').chosen({
464disable_search: true
465});
466jQuery('.chosen-select7').chosen({
467disable_search: true
468});
469jQuery('.chosen-select5').chosen({
470disable_search: true
471});
472}});
473}
474jQuery('#lp-new-ad-compaignForm').on('submit', function (e){
475var $this=jQuery(this);
476if($this.data('type')=="adsperclick"){
477totalPrice=jQuery('input[name="ads_price"]').val();
478var spotlight=0,
479topos=0,
480sidebar=0;
481if($this.find('#spotlightcmp').is(':checked')){
482spotlight=$this.find('#spotlightcmp').data('price');
483}
484if($this.find('#camp-for-search').is(':checked')){
485topos=$this.find('#camp-for-search').data('price');
486}
487if($this.find('#for-sidebar-camp').is(':checked')){
488sidebar=$this.find('#for-sidebar-camp').data('price');
489}
490var minbujet=spotlight + topos + sidebar;
491if(totalPrice < minbujet){
492e.preventDefault();
493e.stopPropagation();
494alert($this.data('string') + ' ' + minbujet);
495return false;
496}}else{
497totalPrice=jQuery('input[name="ads_price"]').val();
498}
499method=jQuery('input[name="method"]:checked').val();
500currency=$this.find('input[name="currency"]').val();
501listing_id=jQuery('input[name=lp_ads_for_listing]').val();
502listing_name=jQuery('input[name=lp_ads_title]').val();
503taxRate=$this.find('input[name="taxprice"]').val();
504if(listing_id===''||method===''){
505alert(jQuery('input#ad-blank-errorMsg').val());
506e.preventDefault();
507}else if(method==='stripe'){
508currency=$this.data('paid_currency');
509totalPrice=parseFloat(totalPrice) * 100;
510totalPrice=parseFloat(totalPrice).toFixed();
511handler.open({
512name: listing_name,
513description: "",
514zipCode: true,
515amount: totalPrice,
516currency: currency
517});
518e.preventDefault();
519}else if(method==='2checkout'){
520var packages=[];
521jQuery('input.checked_class[type="checkbox"]:checked').each(function (){
522packages.push($this.data('package'));
523});
524jQuery('#myCCForm #tprice').val(totalPrice);
525jQuery('#myCCForm #listing_id_2check').val(listing_id);
526jQuery('#myCCForm #packages').val(packages);
527jQuery('#myCCForm #taxprice').val($this.find('input[name="taxprice"]').val());
528jQuery("button.lp-2checkout-modal2").trigger('click');
529e.preventDefault();
530}});
531});
532jQuery(window).on('load', function (){
533jQuery('.lp-suggested-search').on('click', function (event){
534jQuery("#input-dropdown").niceScroll({
535cursorcolor: "#363F48",
536cursoropacitymax: 1,
537boxzoom: false,
538cursorwidth: "10px",
539cursorborderradius: "0px",
540cursorborder: "0px solid #fff",
541touchbehavior: true,
542preventmultitouchscrolling: false,
543cursordragontouch: true,
544background: "#f7f7f7",
545horizrailenabled: false,
546autohidemode: false,
547zindex: "999999",
548});
549});
550jQuery('.notice a.close').on('click', function (event){
551event.preventDefault();
552jQuery(this).parent('.notice').fadeOut('slow');
553});
554jQuery('.lp-header-full-width .lp-menu-bar .header-filter, .lp-menu-bar .header-filter.pos-relative.form-group').css('display', 'block');
555var logoH=jQuery('.lp-logo').outerHeight();
556var acHgt=jQuery('.header-right-panel.clearfix');
557var a=parseInt(logoH + 10);
558var b=jQuery('.header-right-panel').height();
559var c=a - b;
560var d=c / 2;
561acHgt.css({ 'padding-top': d + 'px' });
562jQuery('.rating-symbol:nth-child(1)').hover(function (){
563jQuery('.review.angry').css({
564'opacity': '1',
565'visibility': 'visible',
566});
567}, function (){
568jQuery('.review.angry').css({
569'opacity': '0',
570'visibility': 'hidden',
571});
572});
573jQuery('.rating-symbol:nth-child(2)').hover(function (){
574jQuery('.review.cry').css({
575'opacity': '1',
576'visibility': 'visible',
577});
578}, function (){
579jQuery('.review.cry').css({
580'opacity': '0',
581'visibility': 'hidden',
582});
583});
584jQuery('.rating-symbol:nth-child(3)').hover(function (){
585jQuery('.review.sleeping').css({
586'opacity': '1',
587'visibility': 'visible',
588});
589}, function (){
590jQuery('.review.sleeping').css({
591'opacity': '0',
592'visibility': 'hidden',
593});
594});
595jQuery('.rating-symbol:nth-child(4)').hover(function (){
596jQuery('.review.smily').css({
597'opacity': '1',
598'visibility': 'visible',
599});
600}, function (){
601jQuery('.review.smily').css({
602'opacity': '0',
603'visibility': 'hidden',
604});
605});
606jQuery('.rating-symbol:nth-child(5)').hover(function (){
607jQuery('.review.cool').css({
608'opacity': '1',
609'visibility': 'visible',
610});
611}, function (){
612jQuery('.review.cool').css({
613'opacity': '0',
614'visibility': 'hidden',
615});
616});
617var rtngSym=jQuery('.rating-symbol');
618var rtngTip=jQuery('input.rating-tooltip');
619jQuery('.rating-symbol:first-of-type').hover(function (){
620jQuery(this).closest('span').addClass('active-stars-wrap');
621jQuery('.active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span').css('color', '#de9147');
622}, function (){
623jQuery('.active-stars-wrap').removeClass('active-stars-wrap');
624});
625jQuery('.rating-symbol:nth-of-type(2)').hover(function (){
626jQuery(this).closest('span').addClass('active-stars-wrap');
627jQuery('.active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span').css('color', '#de9147');
628jQuery('.active-stars-wrap .rating-symbol:nth-of-type(2) .rating-symbol-foreground span').css('color', '#de9147');
629}, function (){
630jQuery('.active-stars-wrap').removeClass('active-stars-wrap');
631});
632jQuery('.rating-symbol:nth-of-type(3)').hover(function (){
633jQuery(this).closest('span').addClass('active-stars-wrap');
634jQuery('.active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span').css('color', '#dec435');
635jQuery('.active-stars-wrap .rating-symbol:nth-of-type(2) .rating-symbol-foreground span').css('color', '#dec435');
636jQuery('.active-stars-wrap .rating-symbol:nth-of-type(3) .rating-symbol-foreground span').css('color', '#dec435');
637}, function (){
638jQuery('.active-stars-wrap').removeClass('active-stars-wrap');
639});
640jQuery('.rating-symbol:nth-of-type(4)').hover(function (){
641jQuery(this).closest('span').addClass('active-stars-wrap');
642jQuery('.active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span').css('color', '#c5de35');
643jQuery('.active-stars-wrap .rating-symbol:nth-of-type(2) .rating-symbol-foreground span').css('color', '#c5de35');
644jQuery('.active-stars-wrap .rating-symbol:nth-of-type(3) .rating-symbol-foreground span').css('color', '#c5de35');
645jQuery('.active-stars-wrap .rating-symbol:nth-of-type(4) .rating-symbol-foreground span').css('color', '#c5de35');
646}, function (){
647jQuery('.active-stars-wrap').removeClass('active-stars-wrap');
648});
649jQuery('.rating-symbol:nth-of-type(5)').hover(function (){
650jQuery(this).closest('span').addClass('active-stars-wrap');
651jQuery('.active-stars-wrap .rating-symbol:first-of-type .rating-symbol-foreground span').css('color', '#73cf42');
652jQuery('.active-stars-wrap .rating-symbol:nth-of-type(2) .rating-symbol-foreground span').css('color', '#73cf42');
653jQuery('.active-stars-wrap .rating-symbol:nth-of-type(3) .rating-symbol-foreground span').css('color', '#73cf42');
654jQuery('.active-stars-wrap .rating-symbol:nth-of-type(4) .rating-symbol-foreground span').css('color', '#73cf42');
655jQuery('.active-stars-wrap .rating-symbol:nth-of-type(5) .rating-symbol-foreground span').css('color', '#73cf42');
656}, function (){
657jQuery('.active-stars-wrap').removeClass('active-stars-wrap');
658});
659rtngSym.on('click', function (event){
660event.preventDefault();
661var thsVal=jQuery('input.rating-tooltip').val();
662if(thsVal==1){
663jQuery('.review.angry').addClass('visible');
664jQuery('.rating-symbol:first-of-type').addClass('angry');
665jQuery('.rating-symbol').removeClass('cry');
666jQuery('.rating-symbol').removeClass('sleeping');
667jQuery('.rating-symbol').removeClass('smily');
668jQuery('.rating-symbol').removeClass('cool');
669}else{
670jQuery('.review.angry').removeClass('visible');
671}
672if(thsVal==2){
673jQuery('.review.cry').addClass('visible');
674jQuery('.rating-symbol:first-of-type').addClass('cry');
675jQuery('.rating-symbol:nth-of-type(2)').addClass('cry');
676jQuery('.rating-symbol').removeClass('angry');
677jQuery('.rating-symbol').removeClass('sleeping');
678jQuery('.rating-symbol').removeClass('smily');
679jQuery('.rating-symbol').removeClass('cool');
680}else{
681jQuery('.review.cry').removeClass('visible');
682}
683if(thsVal==3){
684jQuery('.review.sleeping').addClass('visible');
685jQuery('.rating-symbol:first-of-type').addClass('sleeping');
686jQuery('.rating-symbol:nth-of-type(2)').addClass('sleeping');
687jQuery('.rating-symbol:nth-of-type(3)').addClass('sleeping');
688jQuery('.rating-symbol').removeClass('angry');
689jQuery('.rating-symbol').removeClass('cry');
690jQuery('.rating-symbol').removeClass('smily');
691jQuery('.rating-symbol').removeClass('cool');
692}else{
693jQuery('.review.sleeping').removeClass('visible');
694}
695if(thsVal==4){
696jQuery('.review.smily').addClass('visible');
697jQuery('.rating-symbol:first-of-type').addClass('smily');
698jQuery('.rating-symbol:nth-of-type(2)').addClass('smily');
699jQuery('.rating-symbol:nth-of-type(3)').addClass('smily');
700jQuery('.rating-symbol:nth-of-type(4)').addClass('smily');
701jQuery('.rating-symbol').removeClass('angry');
702jQuery('.rating-symbol').removeClass('cry');
703jQuery('.rating-symbol').removeClass('sleeping');
704jQuery('.rating-symbol').removeClass('cool');
705}else{
706jQuery('.review.smily').removeClass('visible');
707}
708if(thsVal==5){
709jQuery('.review.cool').addClass('visible');
710jQuery('.rating-symbol:first-of-type').addClass('cool');
711jQuery('.rating-symbol:nth-of-type(2)').addClass('cool');
712jQuery('.rating-symbol:nth-of-type(3)').addClass('cool');
713jQuery('.rating-symbol:nth-of-type(4)').addClass('cool');
714jQuery('.rating-symbol:nth-of-type(5)').addClass('cool');
715jQuery('.rating-symbol').removeClass('angry');
716jQuery('.rating-symbol').removeClass('cry');
717jQuery('.rating-symbol').removeClass('sleeping');
718jQuery('.rating-symbol').removeClass('smily');
719}else{
720jQuery('.review.cool').removeClass('visible');
721}
722var CheckMultiRatingState=jQuery('#rewies_form').data('multi-rating');
723var ratingSumTotal=0;
724if(CheckMultiRatingState==1){
725var activeRatingLength=jQuery('.lp-multi-rating-val').length;
726jQuery('.lp-multi-rating-val').each(function (index){
727ratingSumTotal +=Number(jQuery(this).val());
728})
729var activeRatingClass=Math.round(ratingSumTotal / activeRatingLength);
730jQuery('.lp-review-stars').removeClass(function (index, css){
731return (css.match(/\bactive-rating-avg\S+/g)||[]).join(' ');
732});
733jQuery('.lp-review-stars').addClass('active-rating-avg' + activeRatingClass);
734jQuery('.lp-review-stars i.fa:nth-child(' + Number(activeRatingClass + 1) + ')').removeClass('fa-star-o').addClass('fa-star');
735jQuery('.lp-review-stars i.fa:nth-child(' + Number(activeRatingClass + 1) + ')').prevAll('.fa-star-o').removeClass('fa-star-o').addClass('fa-star');
736jQuery('.lp-review-stars i.fa:nth-child(' + Number(activeRatingClass + 1) + ')').nextAll('.fa-star').removeClass('fa-star-o').addClass('fa-star-o');
737}});
738});
739var siteurl=jQuery('#page').data('site-url');
740var sitelogo=jQuery('#page').data('sitelogo');
741var $menu=jQuery("#menu");
742if($menu.length > 0){
743$menu.css('visibility', 'visible');
744$menu.mmenu({
745"extensions": [
746"pagedim-black"
747],
748"iconPanels": true,
749navbar: {
750title: ""
751},
752navbars: {
753height: 3,
754content: [
755'<a href="' + siteurl + '" class="userimage"><img class="icon icons8-Contacts" src="' + sitelogo + '" alt="user"></a>',
756]
757}});
758jQuery('div#menu').removeClass('menu-height-0');
759var API=$menu.data("mmenu");
760jQuery(".lpl-button.md-trigger, .sign-login-wrap .md-trigger,.lpl-button.app-view-popup-style").click(function (){
761API.close();
762});
763}
764jQuery(document).on('click', '.footer-btn-right.map-view-btn, .v2-map-load .v2mapwrap, .listing-app-view-bar .right-icons a, .sidemap-fixed .sidemarpInside', function (e){
765if(jQuery('#map').is('.mapSidebar')){
766var defmaplat=jQuery('body').data('defaultmaplat');
767var defmaplong=jQuery('body').data('defaultmaplot');
768jQuery('.map-pop').empty();
769jQuery('.map-pop').html('<div class="mapSidebar" id="map"></div>');
770var map=null;
771$mtoken=jQuery('#page').data("mtoken");
772$mtype=jQuery('#page').data("mtype");
773$mapboxDesign=jQuery('#page').data("mstyle");
774if($mtoken!==''&&$mtype==='mapbox'){
775L.mapbox.accessToken=$mtoken;
776map=L.mapbox.map('map')
777.setView([defmaplat, defmaplong], 2);
778L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
779maxZoom: 18,
780id: jQuery('#page').data("mstyle"),
781accessToken: jQuery('#page').data("mtoken")
782}).addTo(map);
783var markers=new L.MarkerClusterGroup();
784initializeMap(markers);
785map.fitBounds(markers.getBounds(), { padding: [50, 50] });
786jQuery(document).on('click', '.open-map-view', function (){
787L.Util.requestAnimFrame(map.invalidateSize, map, !1, map._container);
788});
789}else{
790var map=new L.Map('map', {
791minZoom: 3,
792}).setView(new L.LatLng(defmaplat, defmaplong), 6);
793if($mtype=='google'){
794L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
795maxZoom: 6,
796subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
797noWrap: true,
798});
799var googleLayer=new L.Google('ROADMAP');
800map.addLayer(googleLayer);
801}else{
802L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
803}
804var markers=new L.MarkerClusterGroup();
805var resmarkers=initializeMap(markers);
806if(typeof resmarkers==='undefined'){
807}else{
808map.fitBounds(markers.getBounds(), { padding: [50, 50] });
809map.scrollWheelZoom.enable();
810map.invalidateSize();
811map.dragging.enable();
812jQuery(document).on('click', '.open-map-view', function (){
813L.Util.requestAnimFrame(map.invalidateSize, map, !1, map._container);
814});
815}}
816function initializeMap(markers){
817if(jQuery('.lp-grid-box-contianer').length!=0){
818markers.clearLayers();
819jQuery(".lp-grid-box-contianer").each(function (i){
820var LPtitle=jQuery(this).data("title");
821var LPposturl=jQuery(this).data("posturl");
822var LPlattitue=jQuery(this).data("lattitue");
823var LPlongitute=jQuery(this).data("longitute");
824var LPpostid=jQuery(this).data("postid");
825var LPiconSrc='';
826if(jQuery('.v2-map-load').length==1){
827if(jQuery('.v2-map-load').hasClass('v2_map_load_old')){
828var LPaddress=jQuery(this).find('.gaddress').text();
829var LPimageSrc=jQuery(this).find('.lp-grid-box-thumb').find('img').attr('src');
830if(typeof jQuery("body").data('deficon')!=='undefined'){
831LPiconSrc=jQuery("body").data('deficon');
832}else{
833LPiconSrc=jQuery(this).find('.cat-icon').find('img').attr('src');
834}}else{
835var LPaddress=jQuery(this).find('.lp-listing-location').find('a').text();
836var LPimageSrc=jQuery(this).find('.lp-listing-top-thumb').find('img').attr('src');
837if(typeof jQuery("body").data('deficon')!=='undefined'){
838LPiconSrc=jQuery("body").data('deficon');
839}else{
840LPiconSrc=jQuery(this).find('.cat-icon').find('img').attr('src');
841}}
842}else if(jQuery('.lp-compact-view-outer').length > 0){
843var LPaddress=jQuery(this).find('.lp_list_address').text();
844var LPimageSrc=jQuery(this).find('.lp-listing-top-thumb').find('img').attr('src');
845var LPiconSrc=jQuery(this).find('.cat-icon').find('img').attr('src');
846if(typeof jQuery("body").data('deficon')!=='undefined'){
847LPiconSrc=jQuery("body").data('deficon');
848}}else{
849var LPaddress=jQuery(this).find('.gaddress').text();
850var LPimageSrc=jQuery(this).find('.listing-app-view-new-wrap').find('img').attr('src');
851if(LPimageSrc===undefined){
852LPimageSrc=jQuery(this).data('feaimg');
853}
854if(LPimageSrc===undefined){
855if(jQuery('.lp-grid-box-thumb .show-img').length > 0){
856LPimageSrc=jQuery(this).find('.lp-grid-box-thumb .show-img img').attr('src');
857}else{
858LPimageSrc=jQuery(this).find('.lp-grid-box-thumb .show img').attr('src');
859}}
860if(typeof jQuery("body").data('deficon')!=='undefined'){
861LPiconSrc=jQuery("body").data('deficon');
862}else{
863LPiconSrc=jQuery(this).find('.cat-icon').find('img').attr('src');
864}}
865if(LPlattitue!=''&&LPlongitute!=''){
866var LPimage='';
867if(LPimageSrc!=''){
868LPimage=LPimageSrc;
869}
870var LPicon='';
871if(LPiconSrc!=''){
872LPicon=LPiconSrc;
873}
874var markerLocation=new L.LatLng(LPlattitue, LPlongitute);
875var CustomHtmlIcon=L.divIcon({
876html: "<div class='lpmap-icon-shape pin card" + LPpostid + "'><div class='lpmap-icon-contianer'><img alt='image' src='" + LPicon + "' /></div></div>",
877});
878var marker=new L.Marker(markerLocation, { icon: CustomHtmlIcon }).bindPopup('<div class="map-post"><div class="map-post-thumb"><a target="_blank" href="' + LPposturl + '"><img alt="image" src="' + LPimage + '" ></a></div><div class="map-post-des"><div class="map-post-title"><h5><a target="_blank" href="' + LPposturl + '">' + LPtitle + '</a></h5></div><div class="map-post-address"><p><i class="fa fa-map-marker"></i> ' + LPaddress + '</p></div></div></div>').addTo(map);
879markers.addLayer(marker);
880map.addLayer(markers);
881}});
882return true;
883}}
884}});
885jQuery(document).ready(function (){
886'use-strict';
887var checkdInput=jQuery('.checkboxx input.checked_class');
888checkdInput.on('change', function (event){
889event.preventDefault();
890if(checkdInput.is(':checked')){
891jQuery('a#lp-next').css('display', 'block');
892jQuery('a#lp-next').removeClass('hide');
893jQuery('span.show').removeClass('show');
894jQuery('.promotional-section > .lp-face.lp-pay-options.lp-dash-sec > span').addClass('hide');
895}else{
896jQuery('a#lp-next').addClass('hide');
897jQuery('.promotional-section > .lp-face.lp-pay-options.lp-dash-sec > span').addClass('show');
898}});
899var rdoInput=jQuery('.lp-method-wrap input.radio_checked');
900rdoInput.on('change', function (event){
901event.preventDefault();
902if(rdoInput.is(':checked')){
903jQuery('input.lp-next2.promotebtn').css('display', 'block');
904jQuery('input.lp-next2.promotebtn').removeClass('hide');
905jQuery('.promotional-section span.proceed-btn').removeClass('show');
906jQuery('.promotional-section span.proceed-btn').addClass('hide');
907}else{
908jQuery('input.lp-next2.promotebtn').addClass('hide');
909jQuery('.promotional-section span.proceed-btn').addClass('show');
910}});
911jQuery('.promotional-section a.lp-submit-btn').on('click', function (event){
912event.preventDefault();
913jQuery(this).parent('.promotional-section').slideUp(500);
914jQuery(this).parent('.promotional-section').next('.lp-card > form#ads_promotion').slideDown(1000);
915});
916var dash=jQuery('.dashboard-tabs.lp-main-tabs.text-center > ul > li.dropdown > a');
917var dashli=jQuery('.dashboard-tabs.lp-main-tabs.text-center > ul > li.dropdown');
918var dashul=jQuery('.dashboard-tabs.lp-main-tabs.text-center > ul > li.dropdown > ul');
919dash.on('click', function (event){
920event.preventDefault();
921if(dashli.hasClass('opened')){
922jQuery(dashli).removeClass('opened');
923jQuery(dashul).removeClass('opened');
924jQuery(this).parent('li').addClass('opened');
925jQuery(this).next('ul').addClass('opened');
926}else{
927jQuery(dashul).removeClass('opened');
928jQuery(dashli).removeClass('opened');
929jQuery(this).parent('li').addClass('opened');
930jQuery(this).next('ul').addClass('opened');
931}});
932jQuery('h3#reply-title').on('click', function (event){
933event.preventDefault();
934var thiss=jQuery(this);
935if(thiss.hasClass('active')){
936jQuery(this).removeClass('active');
937jQuery(this).next('#rewies_form').slideUp();
938jQuery(this).next('#rewies_formm').slideUp();
939}else{
940jQuery(this).addClass('active');
941jQuery(this).next('#rewies_form').slideDown();
942jQuery(this).next('#rewies_formm').slideDown();
943}});
944jQuery('#clicktoreview').on('click', function (event){
945event.preventDefault();
946var thiss=jQuery('#reply-title');
947thiss.addClass('active');
948thiss.next('#rewies_form').slideDown();
949thiss.next('#rewies_formm').slideDown();
950jQuery('html, body').animate({
951scrollTop: jQuery('#reply-title').offset().top
952}, 2000);
953});
954jQuery('.leadformtrigger').on('click', function (e){
955e.preventDefault();
956jQuery('.app-view-lead-form').slideToggle(500);
957});
958jQuery('.open-lead-form-app-view').on('click', function (e){
959if(jQuery('.app-view-lead-form')[0]){
960jQuery('.app-view-lead-form').slideToggle(500);
961jQuery('html, body').animate({
962scrollTop: jQuery('.leadformtrigger').offset().top
963}, 2000);
964}})
965jQuery('#rewies_form input[type=file]').change(function (e){
966$in=jQuery(this);
967$in.prev().prev().text($in.val());
968});
969jQuery('a.grid').on('click', function (event){
970event.preventDefault();
971jQuery('a.list').removeClass('active');
972jQuery(this).addClass('active');
973jQuery('.listing-simple').removeClass('listing_list_view');
974if(jQuery('#list-grid-view-v2').length!=0&&jQuery('#list-grid-view-v2').hasClass('swtch-ll')){
975jQuery('#list-grid-view-v2').attr('data-layout-class', 'grid');
976}
977if(jQuery('#content-grids').hasClass('v2-toggle')){
978jQuery('.loop-switch-class').removeClass('col-md-12');
979jQuery('.loop-switch-class').addClass('col-md-6');
980jQuery('.lp-listings.active-view').removeClass('list-style');
981jQuery('.lp-listings.active-view').addClass('grid-style');
982}else{
983jQuery('.post-with-map-container').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').removeClass('col-sm-12 list_view');
984jQuery('.post-with-map-container').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').addClass('col-md-6 col-sm-12 grid_view2');
985if(jQuery('#content-grids').hasClass('listing-with-header-filters-wrap')){
986jQuery('.listing-simple').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').removeClass('col-sm-12 list_view');
987jQuery('.listing-simple').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').addClass('col-md-6 col-sm-12 grid_view2');
988}else{
989jQuery('.listing-simple').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').removeClass('col-sm-12 list_view');
990jQuery('.listing-simple').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').addClass('col-md-4 col-sm-12 grid_view2');
991}
992jQuery('.listing-with-sidebar').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').removeClass('col-sm-12 list_view');
993jQuery('.listing-with-sidebar').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').addClass('col-md-6 col-sm-12 grid_view2');
994}});
995jQuery('a.list').on('click', function (event){
996event.preventDefault();
997jQuery('a.grid').removeClass('active');
998jQuery(this).addClass('active');
999jQuery('.listing-simple').addClass('listing_list_view');
1000if(jQuery('#list-grid-view-v2').length!=0&&jQuery('#list-grid-view-v2').hasClass('swtch-ll')){
1001jQuery('#list-grid-view-v2').attr('data-layout-class', 'list');
1002}
1003if(jQuery('#content-grids').hasClass('v2-toggle')){
1004jQuery('.loop-switch-class').removeClass('col-md-6');
1005jQuery('.loop-switch-class').addClass('col-md-12');
1006jQuery('.lp-listings.active-view').addClass('list-style');
1007jQuery('.lp-listings.active-view').removeClass('grid-style');
1008}else{
1009jQuery('.post-with-map-container').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').removeClass('col-md-6 col-sm-6 grid_view2');
1010jQuery('.post-with-map-container').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').addClass('col-sm-12 list_view');
1011if(jQuery('#content-grids').hasClass('listing-with-header-filters-wrap')){
1012jQuery('.listing-simple').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').removeClass('col-md-6 col-sm-6 grid_view2');
1013jQuery('.listing-simple').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').addClass('col-sm-12 list_view');
1014}else{
1015jQuery('.listing-simple').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').removeClass('col-md-4 col-sm-6 grid_view2');
1016jQuery('.listing-simple').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').addClass('col-sm-12 list_view');
1017}
1018jQuery('.listing-with-sidebar').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').removeClass('col-md-6 col-sm-6 grid_view3');
1019jQuery('.listing-with-sidebar').find('.lp-grid-box-contianer.card1.lp-grid-box-contianer1').addClass('col-sm-12 list_view');
1020}});
1021jQuery('a.show-all-timings').on('click', function (event){
1022event.preventDefault();
1023jQuery(this).toggleClass('opened');
1024jQuery(this).next('ul.hidding-timings').slideToggle(400);
1025});
1026jQuery(".detail-page2-tab-content .review-form h3").removeAttr("id");
1027jQuery('.listing-app-view .listing-app-view-bar .pricy-form-group #lp-find-near-me-outer ul > li > a').click(function (){
1028jQuery(this).toggleClass('margin-right-0 lp-remove-border');
1029});
1030var inputs=document.querySelectorAll('.inputfile');
1031Array.prototype.forEach.call(inputs, function (input){
1032var label=input.nextElementSibling,
1033labelVal=label.innerHTML;
1034input.addEventListener('change', function (e){
1035var fileName='';
1036if(this.files&&this.files.length > 1)
1037fileName=(this.getAttribute('data-multiple-caption')||'').replace('{count}', this.files.length);
1038else
1039fileName=e.target.value.split('\\').pop();
1040if(fileName)
1041label.querySelector('span').innerHTML=fileName;
1042else
1043label.innerHTML=labelVal;
1044});
1045input.addEventListener('focus', function (){
1046input.classList.add('has-focus');
1047});
1048input.addEventListener('blur', function (){
1049input.classList.remove('has-focus');
1050});
1051});
1052if(jQuery('body').hasClass('home')||jQuery('body').hasClass('app-view-home')){
1053jQuery('.listing-app-view.home .map-view-list-container2,.listing-app-view.app-view-home .map-view-list-container2').slick({
1054centerMode: false,
1055centerPadding: '0px',
1056infinite: true,
1057accesibility: false,
1058draggable: true,
1059swipe: true,
1060touchMove: false,
1061autoplaySpeed: 1400,
1062speed: 100,
1063slidesToShow: 2,
1064dots: true,
1065arrows: false
1066});
1067jQuery('.listing-app-view.home .lp-location-slider,.listing-app-view.app-view-home .lp-location-slider').slick({
1068centerMode: false,
1069centerPadding: '0px',
1070infinite: true,
1071accesibility: false,
1072draggable: true,
1073swipe: true,
1074touchMove: false,
1075autoplaySpeed: 1400,
1076speed: 100,
1077slidesToShow: 3,
1078dots: true,
1079arrows: false
1080});
1081}
1082if(jQuery('.listing-category-slider4').length > 0){
1083jQuery('.listing-category-slider4').slick({
1084centerMode: false,
1085centerPadding: '0px',
1086infinite: true,
1087accesibility: false,
1088draggable: true,
1089swipe: true,
1090touchMove: false,
1091autoplaySpeed: 1400,
1092speed: 100,
1093slidesToShow: 4,
1094dots: false,
1095arrows: true,
1096responsive: [{
1097breakpoint: 768,
1098settings: {
1099arrows: false,
1100centerMode: false,
1101centerPadding: '0px',
1102slidesToShow: 4
1103}},
1104{
1105breakpoint: 480,
1106settings: {
1107arrows: false,
1108centerMode: false,
1109centerPadding: '0px',
1110slidesToShow: 1
1111}}
1112]
1113});
1114}
1115jQuery('#map-view-icon2').click(function (){
1116jQuery("#search-filter-attr-filter").animate({ width: "toggle" }, 5);
1117});
1118jQuery('.listing-app-view .lp-search-toggle .user-menu').click(function (e){
1119jQuery(".lp-user-menu").toggleClass("main");
1120});
1121jQuery(document).mouseup(function (e){
1122var container=jQuery(".lp-user-menu");
1123if(!container.is(e.target)&&container.has(e.target).length===0){
1124jQuery('.lp-user-menu').removeClass('main');
1125}});
1126jQuery('.lp-detail-page-template-3 #clicktoreview2').on('click', function (event){
1127event.preventDefault();
1128jQuery(".single-tabber2 ul li").removeClass('active');
1129jQuery(".detail-page2-tab-content .tab-content .tab-pane").removeClass('active');
1130jQuery('.single-tabber2 ul .lpreviews').addClass('active');
1131jQuery('.detail-page2-tab-content .tab-content .lpreviews').addClass('active');
1132jQuery('html, body').animate({
1133scrollTop: jQuery('#review-section').offset().top
1134}, 200);
1135});
1136jQuery('[data-toggle="tooltip"]').tooltip();
1137jQuery('a.see_more_btn').on('click', function (event){
1138event.preventDefault();
1139var $this=jQuery(this);
1140if($this.hasClass('closedd')){
1141$this.removeClass('closedd');
1142$this.addClass('openedd');
1143jQuery(this).find('i').removeClass('fa-arrow-down');
1144jQuery(this).find('i').addClass('fa-arrow-up');
1145}else{
1146$this.removeClass('openedd');
1147$this.addClass('closedd');
1148jQuery(this).find('i').removeClass('fa-arrow-up');
1149jQuery(this).find('i').addClass('fa-arrow-down');
1150}
1151jQuery(this).next('.review-content').slideToggle(200);
1152});
1153jQuery('a.open-reply').on('click', function (event){
1154event.preventDefault();
1155var $this=jQuery(this);
1156if($this.hasClass('closeddd')){
1157$this.removeClass('closeddd');
1158$this.addClass('openeddd');
1159jQuery(this).find('i').removeClass('fa-arrow-down');
1160jQuery(this).find('i').addClass('fa-arrow-up');
1161}else{
1162$this.removeClass('openeddd');
1163$this.addClass('closeddd');
1164jQuery(this).find('i').removeClass('fa-arrow-up');
1165jQuery(this).find('i').addClass('fa-arrow-down');
1166}
1167jQuery(this).next('.post_response').slideToggle(200);
1168});
1169jQuery(document).ready(function (){
1170jQuery('select.hours-start2').prop("disabled", true);
1171jQuery('select.hours-end2').prop("disabled", true);
1172jQuery(".lp-check-doubletime .enable2ndday").change(function (){
1173if(this.checked){
1174jQuery('select.hours-start2').prop("disabled", false);
1175jQuery('select.hours-end2').prop("disabled", false);
1176jQuery('.hours-select.lp-slot2-time').slideToggle(300);
1177}else{
1178jQuery('select.hours-start2').prop("disabled", true);
1179jQuery('select.hours-end2').prop("disabled", true);
1180jQuery('.hours-select.lp-slot2-time').slideToggle(300);
1181}});
1182});
1183jQuery(document).on('click', 'a.remove-hours', function (event){
1184event.preventDefault();
1185jQuery(this).parent('.hours').remove();
1186});
1187jQuery('a.toggle-currencey-area').on('click', function (event){
1188event.preventDefault();
1189jQuery(this).next('.currency-area').slideToggle(400);
1190jQuery(this).toggleClass('active');
1191});
1192jQuery('.review-img-slider').magnificPopup({
1193delegate: 'a',
1194type: 'image',
1195tLoading: 'Loading image #%curr%...',
1196mainClass: 'mfp-img-mobile',
1197gallery: {
1198enabled: true,
1199navigateByImgClick: true,
1200preload: [0, 1]
1201},
1202image: {
1203tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
1204titleSrc: function (item){
1205return item.el.attr('title') + '<small>by Listingpro team</small>';
1206}}
1207});
1208jQuery(document).ready(function (){
1209jQuery(".fulldayopen").change(function (){
1210if(this.checked){
1211jQuery('select.hours-start').prop("disabled", true);
1212jQuery('select.hours-end').prop("disabled", true);
1213jQuery('select.hours-start2').prop("disabled", true);
1214jQuery('select.hours-end2').prop("disabled", true);
1215}else{
1216jQuery('select.hours-start').prop("disabled", false);
1217jQuery('select.hours-end').prop("disabled", false);
1218jQuery('select.hours-start2').prop("disabled", false);
1219jQuery('select.hours-end2').prop("disabled", false);
1220}});
1221});
1222jQuery(document).ready(function (){
1223jQuery(".add-more").click(function (){
1224jQuery("#lp_feature_panel").slideToggle("slow");
1225});
1226});
1227var hdrHeight=jQuery('header.header-normal').outerHeight();
1228jQuery('.top-section .absolute').css('top', hdrHeight);
1229if(jQuery('body').is('.single-listing')){
1230if(jQuery(window).width() >=768){
1231jQuery("a[rel^='prettyPhoto']").prettyPhoto({
1232animation_speed: 'fast',
1233theme: 'dark_rounded',
1234slideshow: 7000,
1235autoplay_slideshow: true,
1236social_tools: '',
1237deeplinking: false,
1238show_title: false,
1239});
1240}else{
1241jQuery("a[rel^='prettyPhoto']").prettyPhoto({
1242animation_speed: 'fast',
1243theme: 'dark_rounded',
1244slideshow: 7000,
1245autoplay_slideshow: true,
1246social_tools: '',
1247deeplinking: false,
1248show_title: false,
1249});
1250}}
1251jQuery('a.onlineform').on('click', function (event){
1252event.preventDefault();
1253jQuery(this).next('.booking-form').slideToggle(400);
1254jQuery(this).toggleClass('active');
1255});
1256jQuery('.listing-second-view .ask-question-area > a.ask_question_popup').on('click', function (event){
1257event.preventDefault();
1258jQuery(this).next('.faq-form').slideToggle(400);
1259});
1260if(jQuery('body').is('.single-listing')){
1261var sliderstyle=jQuery('body').data('sliderstyle');
1262if(sliderstyle=="style1"){
1263var images=jQuery(".listing-slide").data('images-num');
1264var center_mode=true;
1265if(images > 5){
1266images=5;
1267center_mode=true;
1268}else{
1269center_mode=false;
1270}
1271jQuery('.listing-slide').slick({
1272centerPadding: '10px',
1273slidesToShow: images,
1274autoplay: true,
1275draggable: false,
1276autoplaySpeed: 5000,
1277centerMode: center_mode,
1278focusOnSelect: true,
1279arrows: true,
1280responsive: [{
1281breakpoint: 768,
1282settings: {
1283arrows: false,
1284centerMode: false,
1285centerPadding: '0px',
1286slidesToShow: 5
1287}},
1288{
1289breakpoint: 480,
1290settings: {
1291arrows: true,
1292centerMode: false,
1293centerPadding: '0px',
1294slidesToShow: 1
1295}}
1296]
1297});
1298}else if(sliderstyle=="style2"){
1299var images=jQuery(".listing-slide").data('images-num');
1300var center_mode=true;
1301var variable=true;
1302if(images > 3){
1303center_mode=false;
1304}else if(images=3){
1305jQuery('.single-page-slider-container').addClass('three-imgs');
1306variable=false;
1307}else if(images=2){
1308jQuery('.single-page-slider-container').addClass('new-cls');
1309}else if(images=1){
1310jQuery('.single-page-slider-container').addClass('one-img');
1311}else{
1312center_mode=false;
1313variable=false;
1314}
1315jQuery('.listing-slide').slick({
1316slidesToShow: 2,
1317autoplay: true,
1318draggable: false,
1319autoplaySpeed: 5000,
1320centerMode: true,
1321focusOnSelect: true,
1322variableWidth: variable,
1323adaptiveHeight: true,
1324responsive: [{
1325breakpoint: 768,
1326settings: {
1327arrows: true,
1328centerMode: false,
1329centerPadding: '0px',
1330}},
1331{
1332breakpoint: 480,
1333settings: {
1334arrows: true,
1335centerMode: false,
1336centerPadding: '0px',
1337slidesToShow: 1
1338}}
1339]
1340});
1341}else if(sliderstyle=="style3"){
1342var images=jQuery(".listing-slide").data('images-num');
1343var slidestoshow=2;
1344if(images==1){
1345jQuery('.listing-slide img').css('width', '100%');
1346slidestoshow=1;
1347}else if(images==2){
1348slidestoshow=2;
1349}else if(images==3){
1350slidestoshow=2;
1351}else if(images==4){
1352slidestoshow=3;
1353}else if(images==6){
1354slidestoshow=4;
1355}else if(images==8){
1356slidestoshow=6;
1357}else if(images==10){
1358slidestoshow=8;
1359}else if(images >=12){
1360slidestoshow=10;
1361}
1362jQuery('.listing-slide').slick({
1363slidesToShow: 2,
1364autoplay: true,
1365draggable: false,
1366autoplaySpeed: 5000,
1367centerMode: true,
1368focusOnSelect: true,
1369variableWidth: true,
1370adaptiveHeight: true,
1371responsive: [{
1372breakpoint: 9999,
1373settings: {
1374slidesToShow: slidestoshow,
1375}},
1376{
1377breakpoint: 768,
1378settings: {
1379arrows: true,
1380centerMode: false,
1381centerPadding: '0px',
1382}},
1383{
1384breakpoint: 480,
1385settings: {
1386arrows: true,
1387centerMode: false,
1388centerPadding: '0px',
1389slidesToShow: 1
1390}}
1391]
1392});
1393}}
1394if(jQuery('.listing-slide2').length!=0){
1395jQuery('.listing-slide2').slick({
1396slidesToShow: 1,
1397autoplay: false,
1398draggable: false,
1399autoplaySpeed: 5000,
1400centerMode: true,
1401centerPadding: '0px',
1402focusOnSelect: true,
1403variableWidth: variable,
1404adaptiveHeight: true,
1405responsive: [{
1406breakpoint: 768,
1407settings: {
1408arrows: true,
1409centerMode: false,
1410centerPadding: '0px',
1411}},
1412{
1413breakpoint: 480,
1414settings: {
1415arrows: false,
1416centerMode: false,
1417centerPadding: '0px',
1418slidesToShow: 1
1419}}
1420]
1421})
1422}
1423jQuery(".select2").select2();
1424if(jQuery('body').is('.single-listing')){
1425jQuery('.review-img-slider').slick({
1426infinite: true,
1427slidesToShow: 3,
1428slidesToScroll: 1,
1429autoplay: false,
1430autoplaySpeed: 5000,
1431arrows: true,
1432dots: false,
1433responsive: [{
1434breakpoint: 790,
1435settings: {
1436arrows: false,
1437centerMode: true,
1438centerPadding: '40px',
1439slidesToShow: 2
1440}},
1441{
1442breakpoint: 480,
1443settings: {
1444slidesToShow: 1
1445}}
1446]
1447});
1448if(jQuery('.single-inner-container .single-tabber2 ul .lpreviews').length > 0){
1449jQuery(document).on('click' , '.single-inner-container .single-tabber2 ul .lpreviews' , function (){
1450if(jQuery('.review-img-slider').hasClass('slick-initialized')){
1451jQuery('.review-img-slider').slick('unslick');
1452jQuery('.review-img-slider').slick({
1453infinite: true,
1454slidesToShow: 3,
1455slidesToScroll: 1,
1456autoplay: false,
1457autoplaySpeed: 5000,
1458arrows: true,
1459dots: false,
1460responsive: [{
1461breakpoint: 790,
1462settings: {
1463arrows: false,
1464centerMode: true,
1465centerPadding: '40px',
1466slidesToShow: 2
1467}},
1468{
1469breakpoint: 480,
1470settings: {
1471slidesToShow: 1
1472}}
1473]
1474});
1475}});
1476}
1477jQuery('.post-slide').slick({
1478infinite: true,
1479slidesToShow: 2,
1480slidesToScroll: 1,
1481arrows: false,
1482dots: true,
1483responsive: [{
1484breakpoint: 2,
1485settings: {
1486arrows: false,
1487centerMode: true,
1488centerPadding: '40px',
1489slidesToShow: 3
1490}},
1491{
1492breakpoint: 480,
1493settings: {
1494slidesToShow: 1
1495}}
1496]
1497});
1498jQuery('.testimonial-slider').slick({
1499dots: true,
1500infinite: true,
1501autoplay: true,
1502autoplaySpeed: 1000,
1503speed: 1000,
1504arrows: false,
1505slidesToShow: 1
1506});
1507}
1508var icons={
1509header: "fa fa-plus",
1510activeHeader: "fa fa-minus"
1511};
1512jQuery("#accordion").accordion({
1513icons: icons,
1514heightStyle: "content",
1515});
1516jQuery("#toggle").button().on('click', function (){
1517if(jQuery("#accordion").accordion("option", "icons")){
1518jQuery("#accordion").accordion("option", "icons", null);
1519}else{
1520jQuery("#accordion").accordion("option", "icons", icons);
1521}});
1522jQuery('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
1523disableOn: 319,
1524type: 'iframe',
1525iframe: {
1526markup: '<div class="mfp-iframe-scaler">' +
1527'<div class="mfp-close"></div>' +
1528'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' +
1529'</div>',
1530patterns: {
1531youtube: {
1532index: 'youtube.com/',
1533id: 'v=',
1534src: '//www.youtube.com/embed/%id%?rel=0&autoplay=1'
1535}},
1536srcAction: 'iframe_src',
1537},
1538mainClass: 'mfp-fade',
1539removalDelay: 160,
1540preloader: false,
1541fixedContentPos: false
1542});
1543jQuery('.popup-gallery').magnificPopup({
1544delegate: '.image-popup',
1545type: 'image',
1546tLoading: 'Loading image #%curr%...',
1547mainClass: 'mfp-img-mobile',
1548gallery: {
1549enabled: true,
1550navigateByImgClick: true,
1551preload: [0, 1]
1552}});
1553jQuery('input.check').on('change', function (){
1554alert('Rating: ' + jQuery(this).val());
1555});
1556if(jQuery('body').is('.single-listing')){
1557jQuery('#programmatically-set').on('click', function (){
1558jQuery('#programmatically-rating').rating('rate', jQuery('#programmatically-value').val());
1559});
1560jQuery('#programmatically-get').on('click', function (){
1561alert(jQuery('#programmatically-rating').rating('rate'));
1562});
1563jQuery('.rating-tooltip-manual').rating({
1564extendSymbol: function (){
1565var title;
1566jQuery(this).tooltip({
1567container: 'body',
1568placement: 'bottom',
1569trigger: 'manual',
1570title: function (){
1571return title;
1572}});
1573jQuery(this).on('rating.rateenter', function (e, rate){
1574title=rate;
1575jQuery(this).tooltip('show');
1576})
1577.on('rating.rateleave', function (){
1578jQuery(this).tooltip('hide');
1579});
1580}});
1581jQuery('.rating').each(function (){
1582jQuery('<span class="label label-default"></span>')
1583.text(jQuery(this).val()||' ')
1584.insertAfter(this);
1585});
1586jQuery('.rating').on('change', function (){
1587jQuery(this).next('.label').text(jQuery(this).val());
1588});
1589}})
1590jQuery(window).on('load', function (){
1591if(jQuery(this).width() < 981){
1592jQuery(".claimformtrigger").on('click', function (){
1593if(jQuery('.claimform').hasClass('claimform-open')){
1594jQuery('.claimform').removeClass("claimform-open");
1595jQuery('.claimform').hide();
1596}else{
1597jQuery(this).closest('.post-row').addClass('rowopen');
1598jQuery('.claimform').addClass("claimform-open");
1599jQuery('.claimform').show();
1600}});
1601}
1602jQuery(window).resize(function (){
1603if(jQuery(this).width() < 781){
1604jQuery('.mobilemap').removeAttr('id');
1605jQuery('.mobilemap').removeClass('md-modal');
1606jQuery('.mobilemap').removeClass('md-effect-3');
1607jQuery('.mobilelink').removeClass('md-trigger');
1608jQuery('.mobile-map-space .md-overlayi').removeClass('md-overlay');
1609jQuery('.listing-container-right .md-overlayi').removeClass('md-overlay');
1610jQuery(".mobilelink").on('click', function (){
1611if(jQuery('.mobilemap').hasClass('map-open')){
1612jQuery('.mobilemap').removeClass("map-open");
1613jQuery('.mobilemap .mapbilemap-content').css({ "opacity": "0", "margin-top": "-520px" });
1614jQuery("a.mobilelink").text("View on map");
1615}else{
1616jQuery('.mobilemap').addClass("map-open");
1617jQuery('.mobilemap .mapbilemap-content').css({ "opacity": "1", "margin-top": "0px" });
1618jQuery("a.mobilelink").text("Close map");
1619}});
1620jQuery(".quickformtrigger").on('click', function (){
1621if(jQuery('.quickform').hasClass('quickform-open')){
1622jQuery('.quickform').removeClass("quickform-open");
1623jQuery('.quickform').slideUp(600);
1624}else{
1625jQuery('.quickform').addClass("quickform-open");
1626jQuery('.quickform').slideDown(600);
1627}});
1628}else{
1629var headertop=jQuery('header').height();
1630jQuery('.section-fixed').css('padding-top', headertop + 'px');
1631}}).resize();
1632jQuery('.listing-sidebar-left .form-inline').fadeTo(600, 1);
1633jQuery('.post-with-map-container .form-inline').fadeTo(600, 1);
1634jQuery('.spinner').css("display", "none");
1635L.Google=L.Class.extend({
1636includes: L.Mixin.Events,
1637options: {
1638minZoom: 0,
1639maxZoom: 18,
1640tileSize: 256,
1641subdomains: 'abc',
1642errorTileUrl: '',
1643attribution: '',
1644opacity: 1,
1645continuousWorld: false,
1646noWrap: false,
1647mapOptions: {
1648backgroundColor: '#dddddd'
1649}},
1650initialize: function (type, options){
1651L.Util.setOptions(this, options);
1652this._ready=google.maps.Map!=undefined;
1653if(!this._ready)
1654L.Google.asyncWait.push(this);
1655this._type=type||'SATELLITE';
1656},
1657onAdd: function (map, insertAtTheBottom){
1658this._map=map;
1659this._insertAtTheBottom=insertAtTheBottom;
1660this._initContainer();
1661this._initMapObject();
1662map.on('viewreset', this._resetCallback, this);
1663this._limitedUpdate=L.Util.limitExecByInterval(this._update, 150, this);
1664map.on('move', this._update, this);
1665map.on('zoomanim', this._handleZoomAnim, this);
1666map._controlCorners['bottomright'].style.marginBottom="20px";
1667this._reset();
1668this._update();
1669},
1670onRemove: function (map){
1671this._map._container.removeChild(this._container);
1672this._map.off('viewreset', this._resetCallback, this);
1673this._map.off('move', this._update, this);
1674this._map.off('zoomanim', this._handleZoomAnim, this);
1675map._controlCorners['bottomright'].style.marginBottom="0em";
1676},
1677getAttribution: function (){
1678return this.options.attribution;
1679},
1680setOpacity: function (opacity){
1681this.options.opacity=opacity;
1682if(opacity < 1){
1683L.DomUtil.setOpacity(this._container, opacity);
1684}},
1685setElementSize: function (e, size){
1686e.style.width=size.x + "px";
1687e.style.height=size.y + "px";
1688},
1689_initContainer: function (){
1690var tilePane=this._map._container,
1691first=tilePane.firstChild;
1692if(!this._container){
1693this._container=L.DomUtil.create('div', 'leaflet-google-layer leaflet-top leaflet-left');
1694this._container.id="_GMapContainer_" + L.Util.stamp(this);
1695this._container.style.zIndex="auto";
1696}
1697tilePane.insertBefore(this._container, first);
1698this.setOpacity(this.options.opacity);
1699this.setElementSize(this._container, this._map.getSize());
1700},
1701_initMapObject: function (){
1702if(!this._ready)
1703return;
1704this._google_center=new google.maps.LatLng(0, 0);
1705var map=new google.maps.Map(this._container, {
1706center: this._google_center,
1707zoom: 0,
1708tilt: 0,
1709mapTypeId: google.maps.MapTypeId[this._type],
1710disableDefaultUI: false,
1711keyboardShortcuts: false,
1712draggable: false,
1713disableDoubleClickZoom: true,
1714scrollwheel: false,
1715streetViewControl: true,
1716styles: this.options.mapOptions.styles,
1717backgroundColor: this.options.mapOptions.backgroundColor
1718});
1719var _this=this;
1720this._reposition=google.maps.event.addListenerOnce(map, "center_changed",
1721function (){
1722_this.onReposition();
1723});
1724this._google=map;
1725google.maps.event.addListenerOnce(map, "idle",
1726function (){
1727_this._checkZoomLevels();
1728});
1729},
1730_checkZoomLevels: function (){
1731if(this._google.getZoom()!==this._map.getZoom()){
1732this._map.setZoom(this._google.getZoom());
1733}},
1734_resetCallback: function (e){
1735this._reset(e.hard);
1736},
1737_reset: function (clearOldContainer){
1738this._initContainer();
1739},
1740_update: function (e){
1741if(!this._google)
1742return;
1743this._resize();
1744var center=e&&e.latlng ? e.latlng:this._map.getCenter();
1745var _center=new google.maps.LatLng(center.lat, center.lng);
1746this._google.setCenter(_center);
1747this._google.setZoom(this._map.getZoom());
1748this._checkZoomLevels();
1749},
1750_resize: function (){
1751var size=this._map.getSize();
1752if(this._container.style.width==size.x &&
1753this._container.style.height==size.y)
1754return;
1755this.setElementSize(this._container, size);
1756this.onReposition();
1757},
1758_handleZoomAnim: function (e){
1759var center=e.center;
1760var _center=new google.maps.LatLng(center.lat, center.lng);
1761this._google.setCenter(_center);
1762this._google.setZoom(e.zoom);
1763},
1764onReposition: function (){
1765if(!this._google)
1766return;
1767google.maps.event.trigger(this._google, "resize");
1768}});
1769L.Google.asyncWait=[];
1770L.Google.asyncInitialize=function (){
1771var i;
1772for (i=0; i < L.Google.asyncWait.length; i++){
1773var o=L.Google.asyncWait[i];
1774o._ready=true;
1775if(o._container){
1776o._initMapObject();
1777o._update();
1778}}
1779L.Google.asyncWait=[];
1780};
1781L.HtmlIcon=L.Icon.extend({
1782options: {
1783},
1784initialize: function (options){
1785L.Util.setOptions(this, options);
1786},
1787createIcon: function (){
1788var div=document.createElement('div');
1789div.innerHTML=this.options.html;
1790if(div.classList)
1791div.classList.add('leaflet-marker-icon');
1792else
1793div.className +=' ' + 'leaflet-marker-icon';
1794return div;
1795},
1796createShadow: function (){
1797return null;
1798}});
1799jQuery(".all-list-map").on('click', function (){
1800var defmaplat=jQuery('body').data('defaultmaplat');
1801var defmaplong=jQuery('body').data('defaultmaplot');
1802jQuery('.map-pop').empty();
1803if(jQuery('#map-section').is('.map-container3')){
1804jQuery('.map-pop').html('<div class="mapSidebar" id="map"></div>');
1805}else{
1806jQuery('.map-pop').html('<div class="listingmap" id="map"></div>');
1807}
1808var map=null
1809$mtoken=jQuery('#page').data("mtoken");
1810$mtype=jQuery('#page').data("mtype");
1811$mapboxDesign=jQuery('#page').data("mstyle");
1812if($mtoken!=''&&$mtype=='mapbox'){
1813L.mapbox.accessToken=$mtoken;
1814map=L.mapbox.map('map');
1815L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
1816maxZoom: 18,
1817attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
1818'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
1819'Imagery © <a href="http://mapbox.com">Mapbox</a>',
1820id: jQuery('#page').data("mstyle"),
1821accessToken: $mtoken
1822}).addTo(map);
1823var markers=new L.MarkerClusterGroup();
1824initializeMap(markers);
1825if(markers===undefined){
1826}else{
1827map.fitBounds(markers.getBounds());
1828map.scrollWheelZoom.disable();
1829}}else{
1830var map=new L.Map('map', {
1831minZoom: 3,
1832}
1832).setView(new L.LatLng(defmaplat, defmaplong), 18);
1833if($mtype=='google'){
1834L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
1835maxZoom: 6,
1836subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
1837noWrap: true,
1838});
1839var googleLayer=new L.Google('ROADMAP');
1840map.addLayer(googleLayer);
1841}else{
1842L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
1843}
1844var markers=new L.MarkerClusterGroup();
1845initializeMap(markers);
1846if(markers===undefined){
1847}else{
1848map.fitBounds(markers.getBounds(), { padding: [50, 50] });
1849}}
1850function initializeMap(markers){
1851markers.clearLayers();
1852jQuery(".lp-grid-box-contianer").each(function (i){
1853var LPtitle=jQuery(this).data("title");
1854var LPposturl=jQuery(this).data("posturl");
1855var LPlattitue=jQuery(this).data("lattitue");
1856var LPlongitute=jQuery(this).data("longitute");
1857var LPpostid=jQuery(this).data("postid");
1858if(jQuery('.v2-map-load').length==1){
1859var LPaddress=jQuery(this).find('.gaddress').text();
1860var LPimageSrc=jQuery(this).find('.lp-listing-top-thumb').find('img').attr('src');
1861var LPiconSrc=jQuery(this).find('.cat-icon').find('img').attr('src');
1862if(typeof jQuery("body").data('deficon')!=='undefined'){
1863LPiconSrc=jQuery("body").data('deficon');
1864}}else{
1865var LPaddress=jQuery(this).find('.gaddress').text();
1866var LPimageSrc=jQuery(this).find('.lp-grid-box-thumb').find('img').attr('src');
1867var LPiconSrc=jQuery(this).find('.cat-icon').find('img').attr('src');
1868if(typeof jQuery("body").data('deficon')!=='undefined'){
1869LPiconSrc=jQuery("body").data('deficon');
1870}}
1871if(LPlattitue!=''&&LPlongitute!=''){
1872var LPimage='';
1873if(LPimageSrc!=''){
1874LPimage=LPimageSrc;
1875}
1876var LPicon='';
1877if(LPiconSrc!=''){
1878LPicon=LPiconSrc;
1879}
1880var markerLocation=new L.LatLng(LPlattitue, LPlongitute);
1881var CustomHtmlIcon=L.HtmlIcon.extend({
1882options: {
1883html: "<div class='lpmap-icon-shape pin card" + LPpostid + "'><div class='lpmap-icon-contianer'><img alt='image' src='" + LPicon + "' /></div></div>",
1884}});
1885if(LPimage=='undefined'){
1886LPimage=jQuery(this).find('.lp-grid-box-thumb').find('img').attr('src');
1887}
1888var customHtmlIcon=new CustomHtmlIcon();
1889var marker=new L.Marker(markerLocation, { icon: customHtmlIcon }).bindPopup('<div class="map-post"><div class="map-post-thumb"><a href="' + LPposturl + '"><img alt="image" src="' + LPimage + '" ></a></div><div class="map-post-des"><div class="map-post-title"><h5><a href="' + LPposturl + '">' + LPtitle + '</a></h5></div><div class="map-post-address"><p><i class="fa fa-map-marker"></i> ' + LPaddress + '</p></div></div></div>').addTo(map);
1890markers.addLayer(marker);
1891map.addLayer(markers);
1892}});
1893}});
1894if(jQuery('#cpmap').is('.contactmap')){
1895jQuery('#cpmap').empty();
1896var map=null;
1897$mtoken=jQuery('#page').data("mtoken");
1898$mtype=jQuery('#page').data("mtype");
1899$siteURL=jQuery('#page').data("site-url");
1900$lat=jQuery('.cp-lat').data("lat");
1901$lan=jQuery('.cp-lan').data("lan");
1902if($mtoken!=''&&$mtype=='mapbox'){
1903L.mapbox.accessToken=$mtoken;
1904$mapboxDesign=jQuery('#page').data("mstyle");
1905var map=L.mapbox.map('cpmap')
1906.setView([$lat, $lan], 14);
1907L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
1908id: jQuery('#page').data("mstyle"),
1909accessToken: jQuery('#page').data("mtoken")
1910}).addTo(map);
1911map.scrollWheelZoom.disable();
1912}else{
1913var map=new L.Map('cpmap', '').setView(new L.LatLng($lat, $lan), 16);
1914if($mtype=='google'){
1915var googleLayer=new L.Google('ROADMAP');
1916map.addLayer(googleLayer);
1917}else{
1918L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
1919}
1920map.scrollWheelZoom.disable();
1921}
1922var markers=new L.MarkerClusterGroup();
1923var $pinicon=jQuery('#cpmap').data('pinicon');
1924if($pinicon===""){
1925$pinicon="<div class='lpmap-icon-shape pin'><div class='lpmap-icon-contianer'><img alt='image' src='" + $siteURL + "wp-content/themes/listingpro/assets/images/pins/lp-logo.png'  /></div></div>";
1926}else{
1927$pinicon="<div style='width:50px; height:50px; margin: -50px 0 0 -20px;'><img alt='image' src='" + $pinicon + "'  /></div>";
1928}
1929var markerLocation=new L.LatLng($lat, $lan);
1930var CustomHtmlIcon=L.HtmlIcon.extend({
1931options: {
1932html: $pinicon,
1933}});
1934var customHtmlIcon=new CustomHtmlIcon();
1935var marker=new L.Marker(markerLocation, { icon: customHtmlIcon }).bindPopup('').addTo(map);
1936markers.addLayer(marker);
1937}else if(jQuery('#map').is('.singlebigpost')){
1938jQuery(".singlebigmaptrigger").click(function (){
1939$mtoken=jQuery('#page').data("mtoken");
1940$siteURL=jQuery('#page').data("site-url");
1941$mtype=jQuery('#page').data("mtype");
1942$lat=jQuery('.singlebigmaptrigger').data("lat");
1943$lan=jQuery('.singlebigmaptrigger').data("lan");
1944if($mtoken!=''&&$mtype=='mapbox'){
1945L.mapbox.accessToken=$mtoken;
1946var map=L.mapbox.map('map')
1947.setView([$lat, $lan], 14);
1948L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
1949id: jQuery('#page').data("mstyle"),
1950accessToken: jQuery('#page').data("mtoken")
1951}).addTo(map);
1952var markers=new L.MarkerClusterGroup();
1953var markerLocation=new L.LatLng($lat, $lan);
1954var CustomHtmlIcon=L.HtmlIcon.extend({
1955options: {
1956html: "<div class='lpmap-icon-shape pin '><div class='lpmap-icon-contianer'><img alt='image' src='" + $siteURL + "wp-content/themes/listingpro/assets/images/pins/lp-logo.png'  /></div></div>",
1957}});
1958var customHtmlIcon=new CustomHtmlIcon();
1959var marker=new L.Marker(markerLocation, { icon: customHtmlIcon }).bindPopup('').addTo(map);
1960markers.addLayer(marker);
1961map.fitBounds(markers.getBounds());
1962map.scrollWheelZoom.disable();
1963map.invalidateSize();
1964}else{
1965var map=new L.Map('map', { center: new L.LatLng($lat, $lan), zoom: 14 });
1966if($mtype=='google'){
1967var googleLayer=new L.Google('ROADMAP');
1968map.addLayer(googleLayer);
1969}else{
1970L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
1971}
1972var markers=new L.MarkerClusterGroup();
1973var markerLocation=new L.LatLng($lat, $lan);
1974var CustomHtmlIcon=L.HtmlIcon.extend({
1975options: {
1976html: "<div class='lpmap-icon-shape pin '><div class='lpmap-icon-contianer'><img alt='image' src='" + $siteURL + "wp-content/themes/listingpro/assets/images/pins/lp-logo.png'  /></div></div>",
1977}});
1978var customHtmlIcon=new CustomHtmlIcon();
1979var marker=new L.Marker(markerLocation, { icon: customHtmlIcon }).bindPopup('').addTo(map);
1980markers.addLayer(marker);
1981map.fitBounds(markers.getBounds());
1982map.scrollWheelZoom.disable();
1983map.invalidateSize();
1984}});
1985}});
1986jQuery(document).ready(function (){
1987jQuery.widget("custom.combobox", {
1988_create: function (){
1989this.wrapper=jQuery("<span>")
1990.addClass("custom-combobox")
1991.insertAfter(this.element);
1992this.element.hide();
1993this._createAutocomplete();
1994this._createShowAllButton();
1995},
1996_createAutocomplete: function (){
1997var selected=this.element.children(":selected"),
1998value=selected.val() ? selected.text():"";
1999this.input=jQuery("<input>")
2000.appendTo(this.wrapper)
2001.val(value)
2002.attr("title", "")
2003.addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left lp-search-input location_input lp-home-locaton-input")
2004.autocomplete({
2005delay: 0,
2006minLength: 0,
2007source: $.proxy(this, "_source")
2008})
2009.tooltip({
2010tooltipClass: "ui-state-highlight"
2011});
2012},
2013_createShowAllButton: function (){
2014var input=this.input,
2015wasOpen=false;
2016jQuery("<a>")
2017.attr("tabIndex", -1)
2018.attr("title", "Show All Items")
2019.tooltip()
2020.appendTo(this.wrapper)
2021.button({
2022icons: {
2023primary: "ui-icon-triangle-1-s"
2024},
2025text: false
2026})
2027.removeClass("ui-corner-all")
2028.addClass("custom-combobox-toggle ui-corner-right")
2029.mousedown(function (){
2030wasOpen=input.autocomplete("widget").is(":visible");
2031})
2032.on('click', function (){
2033input.focus();
2034if(wasOpen){
2035return;
2036}
2037input.autocomplete("search", "");
2038});
2039},
2040_source: function (request, response){
2041var matcher=new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
2042response(this.element.children("option").map(function (){
2043var text=jQuery(this).text();
2044if(this.value&&(!request.term||matcher.test(text)))
2045return {
2046label: text,
2047value: text,
2048option: this
2049};}));
2050},
2051_removeIfInvalid: function (event, ui){
2052if(ui.item){
2053return;
2054}
2055var value=this.input.val(),
2056valueLowerCase=value.toLowerCase(),
2057valid=false;
2058this.element.children("option").each(function (){
2059if(jQuery(this).text().toLowerCase()===valueLowerCase){
2060this.selected=valid=true;
2061return false;
2062}});
2063if(valid){
2064return;
2065}
2066this.input
2067.val("")
2068.attr("title", value + " didn't match any item")
2069.tooltip("open");
2070this.element.val("");
2071this._delay(function (){
2072this.input.tooltip("close").attr("title", "");
2073}, 2500);
2074this.input.autocomplete("instance").term="";
2075},
2076_destroy: function (){
2077this.wrapper.remove();
2078this.element.show();
2079}});
2080jQuery(".comboboxs").combobox();
2081jQuery("#toggle").on('click', function (){
2082jQuery(".comboboxs").toggle();
2083});
2084jQuery("#toggle").on('click', function (){
2085jQuery("#searchcategory").toggle();
2086});
2087jQuery(".ui-autocomplete").autocomplete({
2088appendTo: ".input-group"
2089});
2090jQuery('.custom-combobox-input').autocomplete({ minLength: 0 });
2091jQuery('.custom-combobox-input').on("click", function (){
2092jQuery(this).autocomplete("search", "");
2093});
2094jQuery(".location_input").attr("placeholder", "Your Location");
2095jQuery(".comboboxCategory .location_input").attr("placeholder", "Food");
2096jQuery(".postSubmitCat .location_input").attr("placeholder", "Chose one or more than one categories");
2097jQuery(document).on('click', '.md-close', function (){
2098jQuery('.md-modal').modal('hide');
2099jQuery('.md-modal').removeClass('md-show');
2100jQuery('.modal-backdrop').remove();
2101});
2102jQuery(document).on('click', '.qickpopup', function (){
2103jQuery('.content-loading').removeAttr('style');
2104var LPtitle=jQuery(this).closest('.lp-grid-box-contianer').data("title");
2105var LPlattitue=jQuery(this).closest('.lp-grid-box-contianer').data("lattitue");
2106var LPlongitute=jQuery(this).closest('.lp-grid-box-contianer').data("longitute");
2107var LPpostID=jQuery(this).closest('.lp-grid-box-contianer').data("postid");
2108var feaImg=jQuery(this).closest('.lp-grid-box-contianer').data("feaimg");
2109var mapPin=jQuery(this).data('mappin');
2110jQuery('#listing-preview-popup .md-close').hide();
2111var docHeight=jQuery(document).height();
2112jQuery('#listing-preview-popup .popup-inner-left-padding').html('').css('min-hegiht', '300px');
2113if(jQuery('#listing-preview-popup').is('.md-show')){
2114}else{
2115jQuery('#listing-preview-popup').modal({
2116show: 'true'
2117});
2118jQuery('#listing-preview-popup').addClass('md-show');
2119}
2120jQuery.ajax({
2121url: ajax_search_term_object.ajaxurl,
2122dataType: "json",
2123data: {
2124'action': 'quick_preivew_cb',
2125'LPpostID': LPpostID,
2126'lpNonce': jQuery('#lpNonce').val()
2127},
2128success: function (data){
2129jQuery('#listing-preview-popup .md-close').show().children('i').css('right', '20px');
2130jQuery('#listing-preview-popup .popup-inner-left-padding').html(data);
2131var mapinSrc='';
2132mapinSrc=jQuery(data).find('span.cat-icon').find('img').attr('src');
2133if(mapinSrc!=''){
2134mapPin=mapinSrc;
2135}
2136var markers=false;
2137$mtoken=jQuery('#page').data("mtoken");
2138$siteURL=jQuery('#page').data("site-url");
2139$lat=LPlattitue;
2140$lan=LPlongitute;
2141$mapboxDesign=jQuery('#page').data("mstyle");
2142$mtype=jQuery('#page').data("mtype");
2143if($mtoken!=''&&$mtype=='mapbox'){
2144L.mapbox.accessToken=$mtoken;
2145map=L.mapbox.map('quickmap' + LPpostID);
2146L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
2147id: jQuery('#page').data("mstyle"),
2148accessToken: jQuery('#page').data("mtoken")
2149}).addTo(map);
2150}else{
2151var map=new L.Map('quickmap' + LPpostID, { center: new L.LatLng($lat, $lan), zoom: 14 });
2152if($mtype=='google'){
2153var googleLayer=new L.Google('ROADMAP');
2154map.addLayer(googleLayer);
2155}else{
2156L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
2157}}
2158map.setView([$lat, $lan], 14);
2159markers=new L.MarkerClusterGroup();
2160var markerLocation=new L.LatLng($lat, $lan);
2161var CustomHtmlIcon=L.HtmlIcon.extend({
2162options: {
2163html: '<div class="lpmap-icon-shape pin"><div class="lpmap-icon-contianer"><img alt="image" src="' + mapPin + '" /></div></div>',
2164}});
2165var customHtmlIcon=new CustomHtmlIcon();
2166var marker=new L.Marker(markerLocation, { icon: customHtmlIcon }).bindPopup('').addTo(map);
2167markers.addLayer(marker);
2168jQuery('.content-loading').css('background-image', 'none');
2169},
2170error: function (errorThrown){
2171alert(errorThrown);
2172}});
2173});
2174jQuery('.post-meta-right-box a.secondary-btn[href^="#"]').on('click', function (e){
2175e.preventDefault();
2176var target=this.hash;
2177var $target=jQuery(target);
2178jQuery('html, body').stop().animate({
2179'scrollTop': $target.offset().top
2180}, 900, 'swing', function (){
2181window.location.hash=target;
2182});
2183});
2184jQuery('.chosen-select2').chosen({
2185disable_search: true
2186});
2187jQuery('.chosen-select1').chosen({
2188disable_search: true
2189});
2190jQuery('.chosen-select7').chosen({
2191disable_search: true
2192});
2193jQuery('.chosen-select5').chosen({
2194disable_search: true
2195});
2196var $tags=jQuery('#searchtags').chosen(),
2197LPnewTags=function (){
2198jQuery('.LPtagsContainer').empty();
2199$tags.find(':selected').each(function (i, obj){
2200jQuery('<div class="active-tag">' + obj.value + '<div class="remove-tag"><i class="fa fa-times"></i></div></div>').appendTo('.LPtagsContainer').on('click', function (){
2201jQuery(this).remove();
2202jQuery(obj).attr('selected', false);
2203$tags.trigger("chosen:updated");
2204jQuery('.LPtagsContainer input[value="' + obj.value + '"]').remove();
2205});
2206jQuery('<input type="hidden" name="select_tag" value="' + obj.value + '" />').appendTo('.LPtagsContainer');
2207});
2208};
2209$tags.on('change', LPnewTags);
2210var social=jQuery('.post-stat li ul.social-icons.post-socials');
2211var socialOvrly=jQuery('.reviews.sbutton .md-overlay');
2212jQuery('.sbutton a.reviews-quantity').on('click', function (event){
2213event.preventDefault();
2214social.fadeIn(400);
2215if(socialOvrly.hasClass('hide')){
2216jQuery(socialOvrly).removeClass('hide');
2217jQuery(socialOvrly).addClass('show');
2218}else{
2219jQuery(socialOvrly).removeClass('show');
2220jQuery(socialOvrly).addClass('hide');
2221}});
2222socialOvrly.on('click', function (event){
2223event.preventDefault();
2224social.fadeOut(400);
2225if(socialOvrly.hasClass('show')){
2226jQuery(socialOvrly).removeClass('show');
2227jQuery(socialOvrly).addClass('hide');
2228}else{
2229jQuery(socialOvrly).removeClass('hide');
2230jQuery(socialOvrly).addClass('show');
2231}});
2232jQuery('a.make-reservation').on('click', function (event){
2233event.preventDefault();
2234jQuery('.ifram-reservation').fadeIn(400);
2235});
2236jQuery('a.close-btn').on('click', function (event){
2237event.preventDefault();
2238jQuery('.ifram-reservation').fadeOut(400);
2239});
2240if(jQuery(window).width() > 767){
2241jQuery('.widget-box a.open-modal, .menu-hotel a.open-modal').on('click', function (event){
2242event.preventDefault();
2243jQuery('.hotel-menu').fadeIn(400);
2244});
2245jQuery('a.close-menu-popup').on('click', function (event){
2246event.preventDefault();
2247jQuery('.hotel-menu').fadeOut(400);
2248});
2249}else if(jQuery(window).width() < 767){
2250jQuery('.widget-box a.open-modal, .menu-hotel a.open-modal').on('click', function (event){
2251event.preventDefault();
2252jQuery('.hotel-menu').slideToggle(400);
2253});
2254jQuery('.listing-app-view .hotel-menu a.close-menu-popup').on('click', function (event){
2255event.preventDefault();
2256jQuery('.hotel-menu').slideToggle(400);
2257});
2258}
2259jQuery('a.switch-fields').on('click', function (event){
2260event.preventDefault();
2261jQuery(this).toggleClass('active');
2262jQuery('.hidden-items').fadeToggle(400);
2263});
2264jQuery('a.dismiss').on('click', function (event){
2265event.preventDefault();
2266jQuery(this).parent('.panel-dash-dismiss').slideUp(400);
2267});
2268jQuery(document).on('mouseenter', '.lp-grid-box-contianer', function (){
2269var cardID=jQuery(this).data("postid");
2270var cardclass='.lpmap-icon-shape.card' + cardID;
2271if(jQuery(cardclass).hasClass('cardHighlight')){
2272jQuery(cardclass).removeClass("cardHighlight");
2273}else{
2274jQuery(cardclass).addClass("cardHighlight");
2275}});
2276jQuery(document).on('mouseleave', '.lp-grid-box-contianer', function (){
2277var cardID=jQuery(this).data("postid");
2278var cardclass='.lpmap-icon-shape.card' + cardID;
2279jQuery(cardclass).removeClass("cardHighlight");
2280});
2281jQuery('.postsubmitSelect').on('change', function (){
2282jQuery('.feature-fields-error-container').remove();
2283jQuery('.featuresDataRow').show();
2284var cvalue=jQuery(this).val();
2285jQuery('.featuresData').css({ 'opacity': '0', 'visibility': 'hidden', 'display': 'none' });
2286jQuery('.featuresDataContainer').find('.featuresData' + cvalue).css({
2287'opacity': '1',
2288'visibility': 'visible',
2289'display': 'block'
2290});
2291});
2292});
2293jQuery(document).on('change', '.btn-file :file', function (){
2294var input=jQuery(this),
2295numFiles=input.get(0).files ? input.get(0).files.length:1,
2296label=input.val().replace(/\\/g, '/').replace(/.*\//, '');
2297input.trigger('fileselect', [numFiles, label]);
2298});
2299jQuery(document).ready(function (){
2300if(jQuery('form').is('#lp-submit-formdf')){
2301var validator=new FormValidator('lp-submit-form', [{
2302name: 'postTitle',
2303display: 'Title',
2304rules: 'required'
2305}, {
2306name: 'category',
2307display: 'Category',
2308rules: 'required'
2309}, {
2310name: 'postContent',
2311display: 'Description',
2312rules: 'required'
2313}, {
2314name: 'location',
2315display: 'Location',
2316rules: 'required'
2317}, {
2318name: 'gAddress',
2319display: 'Google Address',
2320rules: 'required'
2321}, {
2322name: 'email',
2323rules: 'valid_email',
2324}, {
2325name: 'username',
2326display: 'UserName',
2327rules: 'required'
2328}, {
2329name: 'policycheck',
2330display: 'Terms and Conditions Check',
2331rules: 'required'
2332}], function (errors, evt){
2333var SELECTOR_ERRORS=jQuery('.error_box'),
2334SELECTOR_SUCCESS=jQuery('.success_box');
2335if(errors.length > 0){
2336SELECTOR_ERRORS.empty();
2337for (var i=0, errorLength=errors.length; i < errorLength; i++){
2338SELECTOR_ERRORS.append(errors[i].message + '<br />');
2339}
2340SELECTOR_SUCCESS.css({ display: 'none' });
2341SELECTOR_ERRORS.fadeIn(200);
2342}else{
2343SELECTOR_ERRORS.css({ display: 'none' });
2344SELECTOR_SUCCESS.fadeIn(200);
2345}});
2346}});
2347var image_custom_uploader;
2348var $thisItem='';
2349jQuery(document).on('click', '.upload-author-image', function (e){
2350e.preventDefault();
2351$thisItem=jQuery(this);
2352$form=jQuery('#profileupdate');
2353if(image_custom_uploader){
2354image_custom_uploader.open();
2355return;
2356}
2357image_custom_uploader=wp.media.frames.file_frame=wp.media({
2358title: 'Choose Image',
2359button: {
2360text: 'Choose Image'
2361},
2362multiple: false
2363});
2364image_custom_uploader.on('select', function (){
2365attachment=image_custom_uploader.state().get('selection').first().toJSON();
2366var url='';
2367url=attachment['url'];
2368var attachId='';
2369attachId=attachment['id'];
2370jQuery("img.author-avatar").attr({
2371src: url
2372});
2373$form.parent().parent().find(".criteria-image-url").attr({
2374value: url
2375});
2376$form.parent().parent().find(".criteria-image-id").attr({
2377value: attachId
2378});
2379});
2380image_custom_uploader.open();
2381});
2382jQuery(document).ready(function ($){
2383jQuery('#listings_checkout input[name=listing_id]').on('change', function (){
2384jQuery('#listings_checkout input[name=post_id]').val(jQuery(this, '#listings_checkout').val());
2385});
2386jQuery('#listings_checkout input[name=plan]').on('change', function (){
2387jQuery('#listings_checkout input[name=method]').val(jQuery(this, '#listings_checkout').val());
2388});
2389jQuery('.lp-promotebtn').on('click', function (){
2390var $this=jQuery(this);
2391jQuery('#ads_promotion input[name=listing_id]').val($this.data('listingnid'));
2392var listtitle=$this.data('listingtitle');
2393jQuery('input[name=cur_listing_title]').val(listtitle);
2394});
2395jQuery('#ads_promotion input[name=plan]').on('change', function (){
2396jQuery('#ads_promotion input[name=method]').val(jQuery(this, '#listings_checkout').val());
2397});
2398});
2399jQuery('.availableprice_options input').change(function ($){
2400var $total, taxrate='',
2401taxprice, taxTotal;
2402if(jQuery('span').hasClass('pricetax')){
2403taxrate=jQuery('span.pricetax').data('taxprice');
2404}
2405$oldtotal=jQuery('#totalprice').val();
2406oldTax=jQuery('input[name="taxprice"]').val();
2407if(jQuery(this).is(":checked")){
2408var $val=jQuery(this).val();
2409$total=parseFloat($val) + parseFloat($oldtotal);
2410taxprice=parseFloat((taxrate / 100) * $val);
2411taxTotal=parseFloat(oldTax) + parseFloat(taxprice);
2412$total=$total + taxprice;
2413$total=$total.toFixed(2);
2414taxTotal=taxTotal.toFixed(2);
2415jQuery('#totalprice').val($total);
2416jQuery('.pricetotal #price').html($total);
2417jQuery('input[name="lp_total_price"]').val($total);
2418jQuery('input[name="taxprice"]').val(taxTotal);
2419}else{
2420var $val=jQuery(this).val();
2421$total=parseFloat($oldtotal) - parseFloat($val);
2422taxprice=parseFloat((taxrate / 100) * $val);
2423taxTotal=parseFloat(oldTax) - parseFloat(taxprice);
2424$total=$total - taxprice;
2425$total=$total.toFixed(2);
2426taxTotal=taxTotal.toFixed(2);
2427if($total > 0){
2428jQuery('#totalprice').val($total);
2429jQuery('.pricetotal #price').html($total);
2430jQuery('input[name="lp_total_price"]').val($total);
2431jQuery('input[name="taxprice"]').val(taxTotal);
2432}else{
2433$total=0.00;
2434jQuery('#totalprice').val($total);
2435jQuery('.pricetotal #price').html($total);
2436jQuery('input[name="lp_total_price"]').val($total);
2437jQuery('input[name="taxprice"]').val(taxTotal);
2438}}
2439});
2440jQuery('.lp-front').on('click', '.lp-frontBtn', function (e){
2441e.preventDefault();
2442jQuery('.lp-front').slideUp(500);
2443jQuery('.lp-back1').slideDown(1000);
2444});
2445jQuery('.lp-back1').on('click', '#lp-back1', function (e){
2446e.preventDefault();
2447jQuery('.lp-back1').slideUp(500);
2448jQuery('.lp-front').slideDown(1000);
2449});
2450jQuery('.lp-back1').on('click', '#lp-next', function (e){
2451e.preventDefault();
2452jQuery('.lp-back1').slideUp(500);
2453jQuery('.lp-back2').slideDown(1000);
2454});
2455jQuery('.lp-back2').on('click', '#lp-back2', function (e){
2456e.preventDefault();
2457jQuery('.lp-back2').slideUp(500);
2458jQuery('.lp-back1').slideDown(1000);
2459});
2460jQuery(document).ready(function ($){
2461jQuery('.invoice-section a.showme').click(function (ev){
2462var $this=jQuery(this);
2463$this.after('<i class="lp-modal-spinn fa-li fa fa-spinner fa-spin"></i>');
2464ev.preventDefault();
2465var rowid=jQuery(this).data('id');
2466reqlink=jQuery(this).data('url');
2467var invoiceFor='';
2468invoiceFor=jQuery(this).data('lpinvoice');
2469jQuery.get(reqlink + '?lp_p_id=' + rowid + '&lp_invoice=' + invoiceFor, function (html){
2470jQuery('#modal-invoice .modal-body').html('');
2471jQuery('#modal-invoice .modal-body').html(html);
2472jQuery('#modal-invoice').modal('show', { backdrop: 'static' });
2473$this.next('.lp-modal-spinn').hide('');
2474$this.next('.lp-modal-spinn').remove('');
2475});
2476});
2477});
2478jQuery(function ($){
2479'use strict';
2480jQuery("#modal-invoice").find('.lp-print-list').on('click', function (){
2481var divToPrint=document.getElementById('modal-invoice');
2482var newWin=window.open('', 'Print-Window');
2483newWin.document.open();
2484newWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</body></html>');
2485newWin.document.close();
2486setTimeout(function (){
2487newWin.close();
2488}, 10);
2489});
2490});
2491jQuery(document).ready(function ($){
2492jQuery('.googleAddressbtn').on('click', function (e){
2493var dtype=jQuery(this).data('type');
2494if(dtype=="gaddress"){
2495if(jQuery(this).hasClass('events-dash')){
2496jQuery('.events-map-wrap #inputAddresss').slideUp(300);
2497jQuery('.lp-custom-lat').slideUp(300);
2498jQuery('.events-map-wrap #inputAddress').slideDown();
2499jQuery('.events-map-wrap .googlefulladdress').slideDown(300);
2500jQuery('.events-map-wrap #latitude').attr('type', 'hidden');
2501jQuery('.events-map-wrap #longitude').attr('type', 'hidden');
2502jQuery(this).next('.googleAddressbtn').removeClass('active');
2503jQuery(this).addClass('active');
2504}else{
2505jQuery('.post-submit #inputAddresss').slideUp(300);
2506jQuery('.lp-custom-lat').slideUp(300);
2507jQuery('.post-submit #inputAddress').slideDown();
2508jQuery('.post-submit .googlefulladdress').slideDown(300);
2509jQuery('.post-submit #latitude').attr('type', 'hidden');
2510jQuery('.post-submit #longitude').attr('type', 'hidden');
2511jQuery(this).next('.googleAddressbtn').removeClass('active');
2512jQuery(this).addClass('active');
2513}}else{
2514if(jQuery(this).hasClass('events-dash')){
2515jQuery('.events-map-wrap #inputAddress').slideUp();
2516jQuery('.events-map-wrap .googlefulladdress').slideUp(300);
2517jQuery('.events-map-wrap #inputAddresss').slideDown(300);
2518jQuery('.lp-custom-lat').slideDown(300);
2519jQuery('.events-map-wrap #latitude').attr('type', 'text');
2520jQuery('.events-map-wrap #longitude').attr('type', 'text');
2521jQuery(this).prev('.googleAddressbtn').removeClass('active');
2522jQuery(this).addClass('active');
2523}else{
2524jQuery('.post-submit #inputAddress').slideUp();
2525jQuery('.post-submit .googlefulladdress').slideUp(300);
2526jQuery('.post-submit #inputAddresss').slideDown(300);
2527jQuery('.lp-custom-lat').slideDown(300);
2528jQuery('.post-submit #latitude').attr('type', 'text');
2529jQuery('.post-submit #longitude').attr('type', 'text');
2530jQuery(this).prev('.googleAddressbtn').removeClass('active');
2531jQuery(this).addClass('active');
2532}}
2533e.preventDefault();
2534});
2535});
2536jQuery(document).ready(function ($){
2537jQuery('#slide-nav.navbar-inverse').after(jQuery('<div class="inverse" id="navbar-height-col"></div>'));
2538jQuery('#slide-nav.navbar-default').after(jQuery('<div id="navbar-height-col"></div>'));
2539var toggler='.navbar-toggle';
2540var pagewrapper='#page-content';
2541var navigationwrapper='.navbar-header';
2542var menuwidth='100%';
2543var slidewidth='80%';
2544var menuneg='-100%';
2545var slideneg='-80%';
2546jQuery("#slide-nav").on("click", toggler, function (e){
2547var selected=$(this).hasClass('slide-active');
2548jQuery('#slidemenu').stop().animate({
2549left: selected ? menuneg:'0px'
2550});
2551jQuery('#navbar-height-col').stop().animate({
2552left: selected ? slideneg:'0px'
2553});
2554jQuery(pagewrapper).stop().animate({
2555left: selected ? '0px':slidewidth
2556});
2557jQuery(navigationwrapper).stop().animate({
2558left: selected ? '0px':slidewidth
2559});
2560jQuery(this).toggleClass('slide-active', !selected);
2561jQuery('#slidemenu').toggleClass('slide-active');
2562jQuery('#page-content, .navbar, body, .navbar-header').toggleClass('slide-active');
2563});
2564var selected='#slidemenu, #page-content, body, .navbar, .navbar-header';
2565jQuery(window).on("resize", function (){
2566if(jQuery(window).width() > 767&&$('.navbar-toggle').is(':hidden')){
2567jQuery(selected).removeClass('slide-active');
2568}});
2569jQuery('.lp_price_trigger_checkout input').on('click', function ($){
2570var taxEnable=jQuery(this).data('taxenable');
2571plantitle=jQuery(this).data('title');
2572planprice=jQuery(this).data('planprice');
2573taxprice='';
2574totalprice='';
2575if(taxEnable=="1"){
2576taxrate=jQuery('.lp_price_trigger_checkout input').data('taxrate');
2577taxprice=(taxrate / 100) * planprice;
2578taxprice=taxprice.toFixed(2);
2579jQuery('input[name="listings_tax_price"]').attr('value', taxprice);
2580totalprice=parseFloat(planprice) + parseFloat(taxprice);
2581totalprice=totalprice.toFixed(2);
2582jQuery('span#lp_price_plan').text(plantitle);
2583jQuery('span#lp_price_plan_price').text(planprice);
2584jQuery('span#lp_tax_price').text(taxprice);
2585jQuery('span#lp_price_subtotal').text(totalprice);
2586jQuery('input#lp_paypal_price').val(totalprice);
2587jQuery('.lp_section_inner .lp_billing_total').show(400);
2588}else{
2589totalprice=parseFloat(planprice);
2590jQuery('span#lp_price_plan').text(plantitle);
2591jQuery('span#lp_price_plan_price').text(planprice);
2592jQuery('span#lp_price_subtotal').text(totalprice);
2593jQuery('input#lp_paypal_price').val(totalprice);
2594}});
2595if(jQuery('form#register .check_policy').is('.termpolicy')){
2596jQuery("input#lp_usr_reg_btn").prop('disabled', true);
2597jQuery('.check_policy').on('click', function (){
2598if(jQuery('#check_policy').is(':checked')){
2599jQuery("input#lp_usr_reg_btn").prop('disabled', false);
2600}else{
2601jQuery("input#lp_usr_reg_btn").prop('disabled', true);
2602}});
2603}
2604if(jQuery('.blue-section .check_policy').is('.termpolicy')){
2605jQuery("#listingsubmitBTN").prop('disabled', true);
2606jQuery("#listingsubmitBTN").addClass('dissablebutton');
2607jQuery('.check_policy').on('click', function (){
2608if(jQuery('#policycheck').is(':checked')){
2609jQuery("#listingsubmitBTN").prop('disabled', false);
2610jQuery("#listingsubmitBTN").removeClass('dissablebutton');
2611}else{
2612jQuery("#listingsubmitBTN").prop('disabled', true);
2613jQuery("#listingsubmitBTN").addClass('dissablebutton');
2614}});
2615}
2616if(jQuery('.white-section .check_policy').is('.termpolicy')){
2617jQuery("#listingsubmitBTN").prop('disabled', true);
2618jQuery("#listingsubmitBTN").addClass('dissablebutton');
2619jQuery('.check_policy').on('click', function (){
2620if(jQuery('#policycheck').is(':checked')){
2621jQuery("#listingsubmitBTN").prop('disabled', false);
2622jQuery("#listingsubmitBTN").removeClass('dissablebutton');
2623}else{
2624jQuery("#listingsubmitBTN").prop('disabled', true);
2625jQuery("#listingsubmitBTN").addClass('dissablebutton');
2626}});
2627}});
2628jQuery(window).ready(function (){
2629if(jQuery('.header-container').hasClass('.lp-vedio-bg')){
2630jQuery('#lp_vedio').play();
2631}
2632if(jQuery('input').is('.rating-tooltip')){
2633jQuery('.rating-tooltip').rating({
2634extendSymbol: function (rate){
2635jQuery(this).tooltip({
2636container: 'body',
2637placement: 'bottom',
2638title: 'Rate ' + rate
2639});
2640}});
2641}});
2642jQuery(document).ready(function ($){
2643if(jQuery('.lp-home-banner-contianer').is('.lp-home-banner-with-loc')){
2644var locType=jQuery('.lp_auto_loc_container h1,p.lp-app-view2-des').data('locnmethod');
2645var currentlocationswitch='1';
2646var currentlocationswitch=jQuery('#page').data('lpcurrentloconhome');
2647if(currentlocationswitch=="0"){
2648locType='locationifoff';
2649}
2650var apiType=jQuery('#page').data('ipapi');
2651if(locType=="withip"){
2652if(apiType==="geo_ip_db"){
2653$.getJSON('https://geolocation-db.com/json/geoip.php?jsonp=?')
2654.done(function (location){
2655var locc=location.city;
2656if(locc==null){
2657}else{
2658jQuery('.lp-dyn-city').text(location.city);
2659}});
2660}else if(apiType==="ip_api"){
2661jQuery.get("https://ipapi.co/json", function (location){
2662var locc=location.city;
2663if(locc==null){
2664}else{
2665jQuery('.lp-dyn-city').text(location.city);
2666}}, "json");
2667}else{
2668lpGetGpsLocName(function (lpgetcurrentcityvalue){
2669lpgpsclocation=lpgetcurrentcityvalue;
2670jQuery('.lp-dyn-city').text(lpgpsclocation);
2671});
2672}}
2673}
2674if(jQuery('.lp-header-search-tagline').length!=0){
2675var locType=jQuery('.lp_auto_loc_container .lp-header-search-tagline').data('locnmethod');
2676var currentlocationswitch='1';
2677var currentlocationswitch=jQuery('#page').data('lpcurrentloconhome');
2678if(currentlocationswitch=="0"){
2679locType='locationifoff';
2680}
2681var apiType=jQuery('#page').data('ipapi');
2682if(locType=="withip"){
2683if(apiType==="geo_ip_db"){
2684$.getJSON('https://geolocation-db.com/json/geoip.php?jsonp=?')
2685.done(function (location){
2686var locc=location.city;
2687if(locc==null){
2688}else{
2689jQuery('.lp-dyn-city').text(location.city);
2690}});
2691}else if(apiType==="ip_api"){
2692jQuery.get("https://ipapi.co/json", function (location){
2693var locc=location.city;
2694if(locc==null){
2695}else{
2696jQuery('.lp-dyn-city').text(location.city);
2697}}, "json");
2698}else{
2699lpGetGpsLocName(function (lpgetcurrentcityvalue){
2700lpgpsclocation=lpgetcurrentcityvalue;
2701jQuery('.lp-dyn-city').text(lpgpsclocation);
2702});
2703}}
2704}});
2705function hexToRGB(hexStr){
2706var col={};
2707col.r=parseInt(hexStr.substr(1, 2), 16);
2708col.g=parseInt(hexStr.substr(3, 2), 16);
2709col.b=parseInt(hexStr.substr(5, 2), 16);
2710return col;
2711}
2712jQuery(document).ready(function (){
2713var plantype='';
2714var recurringtext='';
2715var recurringhtml='';
2716var $thislisting='';
2717var $thisplan='';
2718var $recurringon='';
2719$recurringon=jQuery('form#listings_checkout').data('recurring');
2720if($recurringon==="yes"){
2721jQuery('#listings_checkout input[type=radio]').on('change', function ($){
2722if(jQuery('#listings_checkout input[name=listing_id]').is(':checked')&&jQuery('#listings_checkout input[name=plan]').is(':checked')){
2723$thislisting=jQuery('#listings_checkout input[name=listing_id]:checked');
2724$thisplan=jQuery('#listings_checkout input[name=plan]:checked').val();
2725plantype=$thislisting.closest('.lp-user-listings').data('plantype');
2726if(plantype==="Pay Per Listing"){
2727recurringtext=$thislisting.closest('.lp-user-listings').data('recurringtext');
2728recurringhtml='<div class="checkbox"><input type="checkbox" id="listing-recurring-recurrsive" name="lp-recurring-option" value="yes"><label for="listing-recurring-recurrsive">' + recurringtext + '</label></div>';
2729if($thisplan==="stripe"){
2730jQuery('div.lp-recurring-button-wrap').html(recurringhtml);
2731}else{
2732jQuery('div.lp-recurring-button-wrap').html('');
2733}}else{
2734jQuery('div.lp-recurring-button-wrap').html('');
2735}}else{
2736jQuery('div.lp-recurring-button-wrap').html('');
2737}});
2738}
2739if(jQuery('input#cities').length){
2740jQuery('input#cities').cityAutocomplete();
2741}
2742if(jQuery('input#citiess').length){
2743jQuery('input#citiess').cityAutocomplete();
2744}
2745if(jQuery('input#cities').length){
2746jQuery(document).on('click', '#cities', function (e){
2747jQuery('input#cities').cityAutocomplete();
2748});
2749}
2750if(jQuery('input#citiess').length){
2751jQuery(document).on('click', '#citiess', function (e){
2752jQuery('input#citiess').cityAutocomplete();
2753});
2754}
2755jQuery(document).on('click', '#citiess', function (e){
2756var target=e.target;
2757if(!jQuery(target).is('.help')){
2758if(jQuery('input#citiess').length){
2759var isseleted=jQuery('input#citiess').data('isseleted');
2760if(isseleted==false){
2761jQuery('input#citiess').val('');
2762}}
2763}});
2764if(jQuery('input#citiess').length){
2765jQuery('#citiess').on('input', function (){
2766jQuery(this).data('isseleted', false);
2767});
2768}})
2769jQuery(document).ready(function ($){
2770jQuery('#select-plan-form .select-plan-form input[name=plans-posts]').on('click', function (){
2771jQuery("a.lp_change_plan_action").hide('');
2772jQuery("div.lp-action-div form").hide('');
2773});
2774});
2775var nearmeunit=jQuery("#lp-find-near-me").data('nearmeunit');
2776if(jQuery('#distance_range').length!=0){
2777jQuery('#distance_range').bootstrapSlider({
2778formatter: function (value){
2779return value + ' ' + nearmeunit;
2780},
2781tooltip: 'always'
2782});
2783}
2784jQuery('li.lp-tooltip-outer').on('click', function (){
2785var $this=jQuery(this);
2786jQuery('.lp-tooltip-div').removeClass('active');
2787$this.find('.lp-tooltip-div').addClass('active');
2788});
2789jQuery(document).mouseup(function (e){
2790var container=jQuery(".lp-tooltip-div");
2791if(!container.is(e.target)&&container.has(e.target).length===0){
2792jQuery('.lp-tooltip-div').removeClass('active');
2793}
2794var containerr=jQuery(".lp-tooltip-div-hidden");
2795if(!containerr.is(e.target)&&containerr.has(e.target).length===0){
2796jQuery('.lp-tooltip-div-hidden').removeClass('active');
2797}
2798var foodmenucontainer=jQuery(".hotel-menu .inner-menu");
2799if(!foodmenucontainer.is(e.target)&&foodmenucontainer.has(e.target).length===0){
2800jQuery(".hotel-menu").fadeOut();
2801}});
2802jQuery("li.lp-tooltip-outer").hover(function (){
2803var $this=jQuery(this);
2804jQuery('.lp-tooltip-div').removeClass('active');
2805jQuery('.lp-tooltip-div-hidden').removeClass('active');
2806$this.find('.lp-tooltip-div').addClass('active');
2807if($this.find('a.near-me-btn, a.near-me-btn-style-3').hasClass('active')){
2808jQuery('.lp-tooltip-div-hidden').addClass('active');
2809}});
2810jQuery(document).ready(function ($){
2811jQuery('.lp-detail-page-template-3 #reply-title2 ul li').first().addClass('active');
2812jQuery('.lp-detail-page-template-3 .detail-page2-tab-content .tab-pane').first().addClass('active');
2813jQuery(document).on('click', '.listing-app-view .app-view-filters .close', function (){
2814var docHeight=jQuery(document).height();
2815jQuery("body").prepend('<div id="full-overlay"></div>');
2816jQuery('#full-overlay').css('height', docHeight + 'px');
2817jQuery('#full-overlay').addClass('content-loading');
2818var timer='';
2819function lpcloseloadnow(){
2820jQuery('#full-overlay').remove();
2821jQuery('#full-overlay').removeClass('content-loading');
2822clearTimeout(timer);
2823}
2824timer=setTimeout(lpcloseloadnow, 2000);
2825if(jQuery('div.promoted-listings div.app-view-new-ads-slider').length){
2826jQuery('div.app-view-new-ads-slider').slick({
2827arrows: false,
2828});
2829}
2830if(jQuery('div.promoted-listings div.app-view-new-ads-slider').length){
2831jQuery('div.app-view-new-ads-slider').slick({
2832arrows: false,
2833});
2834}});
2835jQuery(document).on('click', '.city-autocomplete .help', function (){
2836var $thisSelected=jQuery(this).text();
2837var $thisSelecteds=$thisSelected.split(",")[0];
2838var $selectLocationData='<div class="lpsinglelocselected ' + $thisSelected + '">' + $thisSelected + '<i class="fa fa-times lp-removethisloc"></i><input type="hidden" name="location[]" value="' + $thisSelecteds + '"></div>';
2839jQuery($selectLocationData).appendTo(".lp-selected-locs");
2840if(jQuery('div').hasClass('lp-selected-locs')){
2841jQuery("input#citiess").val('');
2842}});
2843jQuery(document).on('click', '.lp-removethisloc', function (){
2844jQuery(this).closest('.lpsinglelocselected').remove();
2845});
2846jQuery('.top-search-form .lp-search-btn-header .lp-search-btn').on('click', function (){
2847var locvals=$.trim($("input#cities").val());
2848if(locvals.length > 0){
2849}else{
2850jQuery('input[name="lp_s_loc"]').val('');
2851}});
2852jQuery('input#cities').on('change', function (){
2853jQuery('input[name=lp_s_loc]').val(jQuery(this).val());
2854});
2855jQuery(document).on('click', '.city-autocomplete .help', function (){
2856substrr=$(this).text();
2857substrr=substrr.split(",");
2858if(substrr[1]=='undefined'||substrr[1]==''||substrr[1]==null){
2859substrr=substrr[0];
2860}else{
2861substrr=substrr[0] + ',' + substrr[1];
2862}
2863jQuery('input[name=lp_s_loc]').val(substrr);
2864});
2865jQuery('.md-close.widget-map-click').on('click', function (e){
2866jQuery('#full-overlay').css('height', '0px');
2867});
2868});
2869function lpshowsidemap(){
2870if(jQuery('#map').is('.mapSidebar')){
2871if(jQuery('.v2-map-load').length==1){
2872jQuery("<div class='v2mapwrap'></div>").appendTo(jQuery(".v2-map-load"));
2873jQuery(".v2-map-load .v2mapwrap").trigger('click');
2874}
2875jQuery("<div class='sidemarpInside'></div>").appendTo(jQuery(".sidemap-fixed"));
2876jQuery(".sidemap-fixed .sidemarpInside").trigger('click');
2877}}
2878if(window.attachEvent){
2879window.attachEvent('onload', lpshowsidemap);
2880}else if(window.addEventListener){
2881window.addEventListener('load', lpshowsidemap, false);
2882}else{
2883document.addEventListener('load', lpshowsidemap, false);
2884}
2885jQuery(document).ready(function ($){
2886if(jQuery('form#registertmp .check_policyy').is('.termpolicy')){
2887jQuery("input#lp-template-registerbtn").prop('disabled', true);
2888jQuery('.check_policyy').on('click', function (){
2889if(jQuery('#check_policyy').is(':checked')){
2890jQuery("input#lp-template-registerbtn").prop('disabled', false);
2891}else{
2892jQuery("input#lp-template-registerbtn").prop('disabled', true);
2893}});
2894}
2895jQuery('.lp-qoute-butn a#freeQuoteForm').click(function (e){
2896e.preventDefault();
2897jQuery('html, body').animate({
2898scrollTop: jQuery('#freeQuoteFormWrap').offset().top
2899}, 1000);
2900});
2901jQuery('.contact-right #contactMSGForm').submit(function (e){
2902var uname=jQuery(this).find('input[name=uname]').val();
2903var uemail=jQuery(this).find('input[name=uemail]').val();
2904var umessage=jQuery(this).find('textarea[name=umessage]').val();
2905if(uname==''||uname==null){
2906jQuery(this).find('input[name=uname]').addClass('lp-required-field');
2907e.preventDefault();
2908}
2909if(uemail==''||uemail==null){
2910jQuery(this).find('input[name=uemail]').addClass('lp-required-field');
2911e.preventDefault();
2912}
2913if(lpisValidEmailAddress(uemail)){
2914}else{
2915jQuery(this).find('input[name=uemail]').addClass('lp-required-field');
2916e.preventDefault();
2917}
2918if(umessage==''||umessage==null){
2919jQuery(this).find('textarea[name=umessage]').addClass('lp-required-field');
2920e.preventDefault();
2921}});
2922jQuery("input#lp-featuredimage").change(function (){
2923lp_change_curerntImgUrl(this);
2924});
2925jQuery('.app-view-header .lp-search-toggle .user-menu i, .app-view-popup-style, .event-by-going-wrap .app-view-popup-style').click(function (){
2926jQuery('#app-view-login-popup').fadeIn(function (){
2927jQuery('#app-view-login-popup').css({
2928'top': '20%',
2929'transform': 'translateY(0%)',
2930'overflow': 'visible'
2931});
2932});
2933});
2934jQuery('.style2-popup-login .md-close').click(function (e){
2935jQuery('#app-view-login-popup').fadeOut(function (){
2936jQuery('#app-view-login-popup').css({
2937'display': 'none'
2938});
2939});
2940});
2941});
2942function lp_change_curerntImgUrl(input){
2943if(input.files&&input.files[0]){
2944jQuery('.submit_new_style-outer .lp-listing-featuredimage label').css({ "max-width": "189px" });
2945var reader=new FileReader();
2946reader.onload=function (e){
2947jQuery('.lpchangeinstantimg').attr('src', e.target.result);
2948jQuery('.lpchangeinstantimg').css({ "width": "63px", "height": "63px" });
2949}
2950reader.readAsDataURL(input.files[0]);
2951}}
2952jQuery(window).scroll(function (){
2953if(jQuery(window).scrollTop() > 790){
2954jQuery('.profile-sticky-bar').addClass('navbar-fixed');
2955jQuery('.profile-sticky-bar').fadeIn(500);
2956}
2957if(jQuery(window).scrollTop() < 790){
2958jQuery('.profile-sticky-bar').removeClass('navbar-fixed');
2959jQuery('.profile-sticky-bar').fadeOut(500);
2960}});
2961jQuery(document).on('click', '.stickynavbar ul li a', function (e){
2962e.preventDefault();
2963var targetID=jQuery(this).attr('href');
2964jQuery('html,body').animate({
2965scrollTop: jQuery(targetID).offset().top - 125
2966},
2967500);
2968});
2969function lpisValidEmailAddress(emailAddress){
2970var pattern=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
2971return pattern.test(emailAddress);
2972}
2973jQuery(document).ready(function (){
2974jQuery('#lp_delete_accountpopup input.lp_assign_data').on('click', function (){
2975jQuery('.lp_delte_user_confirm').removeAttr("disabled")
2976});
2977jQuery('.lp_privacy_policy_Wrap input.lpprivacycheckboxopt').on('click', function (){
2978if(jQuery(this).closest('#claimform').hasClass('lp-form-planclaim-st')){
2979var claimuserlogin=false,
2980ppolicy=false;
2981if(jQuery('body').hasClass('logged-in')){
2982claimuserlogin=true;
2983}
2984if(jQuery('#claimform .lpprivacycheckboxopt').length > 0){
2985ppolicy=true;
2986}
2987claimformvalidation(claimuserlogin, ppolicy);
2988}else{
2989if(jQuery(this).is(':checked')){
2990jQuery(this).closest('form').find('input[type=submit]').removeAttr("disabled");
2991}else{
2992jQuery(this).closest('form').find('input[type=submit]').attr("disabled", "disabled");
2993}}
2994});
2995});
2996jQuery(document).ready(function (){
2997jQuery('#claim_payment_checkout').on('submit', function (e){
2998var $this=jQuery(this);
2999claimerID=$this.find('input[name=claimerID]').val();
3000claimPost=$this.find('input[name=claimPost]').val();
3001claimPrice=$this.find('input[name=claimPrice]').val();
3002currency=$this.find('input[name=currency]').val();
3003claimPrice=parseFloat(claimPrice) * 100;
3004claimPrice=parseFloat(claimPrice).toFixed();
3005handler.open({
3006name: "For Claim",
3007description: "",
3008zipCode: true,
3009amount: claimPrice,
3010currency: currency,
3011});
3012e.preventDefault();
3013})
3014});
3015jQuery(document).ready(function (){
3016jQuery('.lp_add_more_filter a').on('mouseover', function (){
3017jQuery('.lp_more_filter_tooltip_outer').css("visibility", "visible");
3018});
3019jQuery('.lp_add_more_filter a').on('mouseout', function (){
3020jQuery('.lp_more_filter_tooltip_outer').css("visibility", "hidden");
3021});
3022});
3023jQuery(document).ready(function(){
3024jQuery('.lp_add_more_filter a').click(function(e){
3025e.preventDefault();
3026e.stopPropagation();
3027jQuery('.outer_all_page_overflow').toggleClass('hide-filters');
3028jQuery('.outer_all_page_overflow').css('display', 'block');
3029if(jQuery('.overlay_on_map_for_filter').is(':hidden')){
3030jQuery('.overlay_on_map_for_filter').css('display', 'block');
3031}else{
3032jQuery('.overlay_on_map_for_filter').css('display', 'none');
3033}});
3034jQuery('.outer_all_page_overflow').click(function(e){
3035});
3036jQuery('body').click(function(){
3037jQuery('.overlay_on_map_for_filter').css('display', 'none');
3038});
3039jQuery('#filter_cancel_all').on('click', function(){
3040jQuery('.outer_all_page_overflow').slideUp();
3041jQuery('.overlay_on_map_for_filter').css('display', 'none');
3042});
3043});
3044jQuery(document).on('click', '#filter_cancel_all', function (){
3045jQuery('.outer_all_page_overflow').slideUp();
3046jQuery('.overlay_on_map_for_filter').css('display', 'none');
3047jQuery('.outer_all_page_overflow').hide(500);
3048});
3049jQuery(document).ready(function (){
3050jQuery('#listings_checkout_form input[name=listing_id]').click(function (){
3051if(jQuery('#listings_checkout_form input[name=listing_id]').is(':checked')){
3052if(jQuery('#listings_checkout_form input[name=plan]').is(':checked')){
3053jQuery('.lp_payment_step_next.firstStep').addClass('active');
3054lp_make_checkout_step_active('firstStep');
3055jQuery('.lp_payment_step_next.firstStep').prop('disabled', false);
3056}else{
3057jQuery('.lp-checkout-steps .firstStep').removeClass('current');
3058jQuery('.lp_payment_step_next.firstStep').removeClass('active');
3059jQuery('.lp_payment_step_next.firstStep').prop('disabled', true);
3060}}
3061});
3062jQuery('#listings_checkout_form input[name=plan]').click(function (){
3063if(jQuery('#listings_checkout_form input[name=plan]').is(':checked')){
3064jQuery('input[name=method]').val(jQuery(this).val());
3065if(jQuery('#listings_checkout_form input[name=listing_id]').is(':checked')){
3066jQuery('.lp_payment_step_next.firstStep').addClass('active');
3067lp_make_checkout_step_active('firstStep');
3068jQuery('.lp_payment_step_next.firstStep').prop('disabled', false);
3069}else{
3070jQuery('.lp-checkout-steps .firstStep').removeClass('current');
3071jQuery('.lp_payment_step_next.firstStep').removeClass('active');
3072jQuery('.lp_payment_step_next.firstStep').prop('disabled', true);
3073}}
3074});
3075jQuery('.lp-user-listings .radio-danger').click(function (){
3076$this=jQuery(this);
3077jQuery('.lp-user-listings').removeClass('active-checkout-listing');
3078$this.closest('.lp-user-listings').addClass('active-checkout-listing');
3079});
3080jQuery(document).on('click', 'button.firstStep', function (){
3081if(jQuery('.inactive-payment-mode').length){
3082jQuery('.inactive-payment-mode').hide();
3083}
3084jQuery('#listings_checkout_form input[name=listing_id]').not(':checked').closest('.lp-user-listings').css('display', 'none');
3085jQuery('#listings_checkout_form input[name=plan]').not(':checked').closest('.lp-method-wrap').css('display', 'none');
3086lp_show_mini_subtotal();
3087lp_reset_mincart_checkout_form_data();
3088lp_show_recurring_switch();
3089jQuery('.lp-new-term-style').css('display', 'block');
3090jQuery('button.lp_payment_step_next.secondStep').css("display", "block");
3091jQuery(this).addClass('secondStep');
3092jQuery(this).removeClass('firstStep');
3093if(jQuery(".terms-checkbox-container input[type=checkbox]").length){
3094jQuery('.lp_payment_step_next.secondStep').prop('disabled', true);
3095}else{
3096lp_make_checkout_step_active('secondStep');
3097}});
3098jQuery(".terms-checkbox-container input[type=checkbox]").on('click', function (){
3099if(jQuery(this).is(':checked')){
3100jQuery('.lp_payment_step_next.secondStep').prop('disabled', false);
3101lp_make_checkout_step_active('secondStep');
3102var urloftermcond=jQuery(".lpcheckouttac").attr('href');
3103}else{
3104jQuery('.lp_payment_step_next.secondStep').prop('disabled', true);
3105lp_make_checkout_step_passive('secondStep');
3106}});
3107jQuery(document).on('click', 'button.lp_payment_step_next.secondStep', function (){
3108jQuery('.lp-checkout-steps .firstStep').addClass('completed');
3109jQuery('button.lp_payment_step_next.thirdStep').css("display", "block");
3110jQuery(this).addClass('thirdStep');
3111jQuery(this).removeClass('secondStep');
3112$planprice=jQuery('input[name=plan_price]').val();
3113if(jQuery('input[name="lp-recurring-option"]').is(':checked')){
3114jQuery(this).prop("type", "submit");
3115}else{
3116if(parseFloat($planprice)==0){
3117$listings_id=jQuery('input[name=listings_id]').val();
3118lp_make_this_listing_publish_withdiscount($listings_id);
3119}else{
3120jQuery(this).prop("type", "submit");
3121}}
3122});
3123jQuery(document).on('click', 'button.lp_payment_step_next.thirdStep', function (){
3124jQuery('.lp-checkout-steps .secondStep').addClass('completed');
3125});
3126jQuery('#print-section-receipt').click(function (){
3127var printContents=document.getElementById('printarea').innerHTML;
3128var originalContents=document.body.innerHTML;
3129document.body.innerHTML=printContents;
3130window.print();
3131document.body.innerHTML=originalContents;
3132location.reload();
3133});
3134jQuery('input[name=lp_checkbox_coupon]').on('click', function (){
3135jQuery(this).toggleClass('active');
3136if(jQuery(this).hasClass('active')){
3137lp_make_couponsfields_active();
3138}else{
3139lp_make_couponsfields_passive();
3140lp_reset_mincart_checkout_form_data();
3141jQuery('li.checkout_discount_val').remove();
3142}});
3143var $currHeight=jQuery(window).height();
3144var $currDivHeight=jQuery('.lp_notification_wrapper').height();
3145$currHeight=$currHeight - $currDivHeight;
3146var $currHeight=$currHeight + 'px';
3147jQuery('.lp_notification_wrapper').css({ "top": $currHeight });
3148jQuery(window).resize(function (){
3149var $currHeight=jQuery(window).height();
3150var $currDivHeight=jQuery('.lp_notification_wrapper').height();
3151$currHeight=$currHeight - $currDivHeight;
3152var $currHeight=$currHeight + 'px';
3153jQuery('.lp_notification_wrapper').css({ "top": $currHeight });
3154});
3155jQuery("#menu-toggle").click(function (e){
3156e.preventDefault();
3157if(jQuery(window).width() > 767){
3158jQuery("#wrapper").toggleClass("active");
3159}});
3160jQuery('p#reply-title').on('click', function (event){
3161event.preventDefault();
3162var thiss=jQuery(this);
3163if(thiss.hasClass('active')){
3164jQuery(this).removeClass('active');
3165jQuery(this).next('#lp-ad-click-inner').slideUp();
3166jQuery(this).next('#lp-ad-click-innerm').slideUp();
3167}else{
3168jQuery(this).addClass('active');
3169jQuery(this).next('#lp-ad-click-inner').slideDown();
3170jQuery(this).next('#lp-ad-click-innerm').slideDown();
3171}});
3172var TargetHeight=jQuery('.lp-inbox-outer').height();
3173jQuery('.user-recent-listings-inner .padding-0:first').height(TargetHeight + 'px');
3174var TargetHeight=jQuery('.lp-left-panel-height').height(),
3175TargetHeight=TargetHeight + 100;
3176jQuery('#click-search-view').on('click', function (){
3177$this=jQuery(this);
3178jQuery('.lp-search-section-header-view').toggleClass('active-section-header-view');
3179if(!$this.hasClass('alreadyInIt')){
3180$this.addClass('alreadyInIt');
3181setTimeout(function (){
3182jQuery('input#cities').cityAutocomplete();
3183}, 3500);
3184}});
3185jQuery('button.lp_see_more_activities').on('click', function (){
3186$this=jQuery(this);
3187$thisval=$this.text();
3188$thisReplace=$this.data('replacetext');
3189$this.toggleClass('active');
3190jQuery('div.lp_hid_this_activity').slideToggle();
3191$this.text($thisReplace);
3192$this.data('replacetext', $thisval);
3193});
3194var foldSettings={
3195easing: 'linear',
3196duration: 1000,
3197size: 5,
3198horizFirst: false,
3199}
3200jQuery('a.lp_preview_this_invoice, .lp_right_preview_this_invoice').on('click', function (e){
3201var $this=jQuery(this);
3202$inoviceno=$this.closest('.lp-listing-outer-container').data('inoviceno');
3203$date=$this.closest('.lp-listing-outer-container').data('date');
3204$amount=$this.closest('.lp-listing-outer-container').data('amount');
3205$amountOnly=$this.closest('.lp-listing-outer-container').data('orprice');
3206$tax=$this.closest('.lp-listing-outer-container').data('tax');
3207$method=$this.closest('.lp-listing-outer-container').data('method');
3208$plan=$this.closest('.lp-listing-outer-container').data('plan');
3209$duration=$this.closest('.lp-listing-outer-container').data('duration');
3210$status=$this.closest('.lp-listing-outer-container').data('status');
3211$listTitle=$this.closest('.lp-listing-outer-container').data('listtitle');
3212$fullAmount=$amount;
3213if($this.hasClass('lp_preview_this_invoice')){
3214jQuery('div.lp_popup_preview_invoice .lppopinvoice').text($inoviceno);
3215jQuery('div.lp_popup_preview_invoice .lppopdate').text($date);
3216jQuery('div.lp_popup_preview_invoice .lppopsubamount').text($amount);
3217jQuery('div.lp_popup_preview_invoice .lppopamount').text($amount);
3218jQuery('div.lp_popup_preview_invoice .lppoptaxprice').text($tax);
3219jQuery('div.lp_popup_preview_invoice .lppopplanprice').text($amountOnly);
3220jQuery('div.lp_popup_preview_invoice .lppoplist').text($listTitle);
3221jQuery('#lpinvoiceforpdf .lppopinvoice').text($inoviceno);
3222jQuery('#lpinvoiceforpdf .lppopdate').text($date);
3223jQuery('#lpinvoiceforpdf .lppopamount').text($amount);
3224jQuery('#lpinvoiceforpdf .lllistname').text($listTitle);
3225jQuery('#lpinvoiceforpdf .lppopamountqqq').text($tax);
3226jQuery('#lpinvoiceforpdf .lppopamountwww').text($fullAmount);
3227if($method=="wire"){
3228$imgSrc=jQuery('p.lp-pay-with img').data('srcwire');
3229jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3230}else if($method=="stripe"){
3231$imgSrc=jQuery('p.lp-pay-with img').data('srcstripe');
3232jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3233}else if($method=="paypal"){
3234$imgSrc=jQuery('p.lp-pay-with img').data('srcpaypal');
3235jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3236}else if($method=='paystack'){
3237$imgSrc=jQuery('p.lp-pay-with img').data('srcpaystack');
3238jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3239}else if($method=='razorpay'){
3240$imgSrc=jQuery('p.lp-pay-with img').data('srcrazorpay');
3241jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3242}else if($method=='payfast'){
3243$imgSrc=jQuery('p.lp-pay-with img').data('srcpayfast');
3244jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3245}else if($method=='payu'){
3246$imgSrc=jQuery('p.lp-pay-with img').data('srcpayu');
3247jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3248}else if($method=='eway'){
3249$imgSrc=jQuery('p.lp-pay-with img').data('srceway');
3250jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3251}else if($method=='mollie'){
3252$imgSrc=jQuery('p.lp-pay-with img').data('srcmollie');
3253jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3254}else if($method=='mercadopago'){
3255$imgSrc=jQuery('p.lp-pay-with img').data('srcmercadopago');
3256jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3257}else if($method=='stripe_ideal'){
3258$imgSrc=jQuery('p.lp-pay-with img').data('srcstripeideal');
3259jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3260}else if($method=='flutterwave'){
3261$imgSrc=jQuery('p.lp-pay-with img').data('srcflutterwave');
3262jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3263}else if($method=='mtn_momo'){
3264$imgSrc=jQuery('p.lp-pay-with img').data('srcmtn_momo');
3265jQuery('p.lp-pay-with img').attr('src', $imgSrc);
3266}
3267jQuery('div.lp_popup_preview_invoice .lppopmethod').text($method);
3268jQuery('div.lp_popup_preview_invoice .lppopplan').text($plan);
3269jQuery('div.lp_popup_preview_invoice .lppopduration').text($duration);
3270jQuery('#lpinvoiceforpdf .lppopmethod').text($method);
3271jQuery('#lpinvoiceforpdf .lppopplan').text($plan);
3272jQuery('#lpinvoiceforpdf .lppopduration').text($duration);
3273jQuery("div.lp_popup_preview_invoice").toggle("fold", foldSettings);
3274$this.closest('.lp-listing-outer-container').find('.lp_right_preview_this_invoice input').prop('checked', true);
3275e.preventDefault();
3276}
3277if($this.hasClass('lp_right_preview_this_invoice')||$this.hasClass('lp_preview_this_invoice')){
3278jQuery('div.lp_right_preview_invoice .lppopinvoice').text($inoviceno);
3279jQuery('div.lp_right_preview_invoice .lppopdate').text($date);
3280jQuery('div.lp_right_preview_invoice .lppopamount').text($amount);
3281jQuery('div.lp_right_preview_invoice .lppopplanprice').text($amountOnly);
3282jQuery('div.lp_right_preview_invoice .lppoptaxprice').text($tax);
3283jQuery('div.lp_right_preview_invoice .lppopmethod').text($method);
3284jQuery('div.lp_right_preview_invoice .lppopplan').text($plan);
3285jQuery('div.lp_right_preview_invoice .lppopduration').text($duration);
3286jQuery('div.lp_right_preview_invoice .lppopstatus').text($status);
3287jQuery('#lpinvoiceforpdf .lppopinvoice').text($inoviceno);
3288jQuery('#lpinvoiceforpdf .lppopdate').text($date);
3289jQuery('#lpinvoiceforpdf .lppopamount').text($amountOnly);
3290jQuery('#lpinvoiceforpdf .lppopmethod').text($method);
3291jQuery('#lpinvoiceforpdf .lppopplan').text($plan);
3292jQuery('#lpinvoiceforpdf .lppopduration').text($duration);
3293}});
3294jQuery(document).on('click', '.close_invoice_prev', function (e){
3295$this=jQuery(this);
3296jQuery("div.lp_popup_preview_invoice").toggle("fold", foldSettings);
3297e.preventDefault();
3298});
3299jQuery('button.lp-cancle-btn').on('click', function (e){
3300e.preventDefault();
3301jQuery('.lp-ad-step-two').fadeOut(function (){
3302jQuery('.lp_camp_invoice_wrp').fadeIn();
3303});
3304});
3305jQuery('input[name="lpadsoftype[]"]').on('click', function (){
3306$this=jQuery(this);
3307adsduration_pd='';
3308lp_make_campaign_paybutton_active();
3309$newprice=0;
3310$campType=lp_get_camp_type();
3311if($campType=='adsperduration'){
3312lp_set_camp_duration_price_in_preview(jQuery('input[name=adsduration_pd]').val());
3313}else if($campType=='adsperclick'){
3314lp_set_camp_budget_price_in_preview(jQuery('input[name=adsprice_pc]').val());
3315}
3316if($this.is(":checked")){
3317if($this.val()=="lp_random_ads"){
3318jQuery('.lp-invoices-all-stats li.spotlight span i.fa-check-circle').removeClass('lp-gray-this-ccircle');
3319jQuery('.lpcampain-spotlight .greencheck').removeClass('graycheck');
3320}
3321if($this.val()=="lp_top_in_search_page_ads"){
3322jQuery('.lp-invoices-all-stats li.searchpage span i.fa-check-circle').removeClass('lp-gray-this-ccircle');
3323jQuery('.lpcampain-topsearch .greencheck').removeClass('graycheck');
3324}
3325if($this.val()=="lp_detail_page_ads"){
3326jQuery('.lp-invoices-all-stats li.detailpage span i.fa-check-circle').removeClass('lp-gray-this-ccircle');
3327jQuery('.lpcampain-sidebar .greencheck').removeClass('graycheck');
3328}}else{
3329if($this.val()=="lp_random_ads"){
3330jQuery('.lp-invoices-all-stats li.spotlight span i.fa-check-circle').addClass('lp-gray-this-ccircle');
3331jQuery('.lpcampain-spotlight .greencheck').addClass('graycheck');
3332}
3333if($this.val()=="lp_top_in_search_page_ads"){
3334jQuery('.lp-invoices-all-stats li.searchpage span i.fa-check-circle').addClass('lp-gray-this-ccircle');
3335jQuery('.lpcampain-topsearch .greencheck').addClass('graycheck');
3336}
3337if($this.val()=="lp_detail_page_ads"){
3338jQuery('.lp-invoices-all-stats li.detailpage span i.fa-check-circle').addClass('lp-gray-this-ccircle');
3339jQuery('.lpcampain-sidebar .greencheck').addClass('graycheck');
3340}}
3341});
3342jQuery(document).on('input', "input[name=adsduration_pd]", function (){
3343jQuery(this).val(jQuery(this).val().replace(/[^\d].+/, ""));
3344$thisval=jQuery(this).val();
3345lp_set_camp_duration_price_in_preview($thisval);
3346lp_make_campaign_paybutton_active();
3347});
3348jQuery(document).on('click', ".lp-view-all-btn", function (){
3349location.reload();
3350});
3351jQuery('button.lp-exist-preview').on('click', function (){
3352jQuery('.lp_campaign_preview').hide(300);
3353jQuery('.lp_selected_active_ad').hide(300);
3354jQuery('.lp_campaign_invoice_pmethod').show(300);
3355});
3356jQuery('button.lp_campaign_paynow').on('click', function (){
3357jQuery('.lp_campaign_preview').hide(300);
3358jQuery('.lp_campaign_invoice_pmethod').show(300);
3359jQuery(this).addClass('startpayforcampaignsss');
3360});
3361jQuery("input[name=adsprice_pc]").keyup(function (){
3362$thisval=jQuery(this).val();
3363lp_set_camp_budget_price_in_preview($thisval);
3364lp_make_campaign_paybutton_active();
3365});
3366jQuery("input[name=adsduration_pd]").keyup(function (){
3367lp_make_campaign_paybutton_active();
3368});
3369jQuery('.lp-search-listing-camp').on('change', function (){
3370lp_make_campaign_paybutton_active();
3371});
3372jQuery('.lpadspreview').on('click', function (){
3373packeg='';
3374jQuery('.lploading').fadeIn();
3375clicks=jQuery(this).attr('data-clicks');
3376mode=jQuery(this).attr('data-mode');
3377budget=jQuery(this).attr('data-budget');
3378credit=jQuery(this).attr('data-credit');
3379duration=jQuery(this).attr('data-duration');
3380method=jQuery(this).attr('data-method');
3381currency=jQuery(this).attr('data-currency');
3382transid=jQuery(this).attr('data-transid');
3383packeg=jQuery(this).attr('data-packeg0');
3384packeg1=jQuery(this).attr('data-packeg1');
3385if(packeg1){
3386packeg +=packeg1;
3387}
3388packeg2=jQuery(this).attr('data-packeg2');
3389if(packeg2){
3390packeg +=packeg2;
3391}
3392if(mode=='perclick'){
3393jQuery('#lp-ad-click-inner').show();
3394jQuery('.adsremaining').html(credit);
3395jQuery('#lp-ad-click-inner').find('.lp-total-clicks-inner').find('h4').text(clicks);
3396taxPrice=jQuery(this).attr('data-taxPrice');
3397budgetwithTax=jQuery(this).attr('data-budgetwithTax');
3398jQuery('.lp-ad-payment-tax-price').html(taxPrice).show();
3399jQuery('.lp-ad-payment-with-tax').html(budgetwithTax).show();
3400}else{
3401jQuery('.lp-ad-payment-tax-price').hide();
3402jQuery('.lp-ad-payment-with-tax').hide();
3403jQuery('#lp-ad-click-inner').hide();
3404jQuery('.adsremaining').html(duration);
3405}
3406jQuery('.lp-ad-all-attached-packages').html(packeg);
3407jQuery('.lp-ad-payment-price').html(budget);
3408jQuery('.lp-ad-payment-method').html(method);
3409jQuery('.adstransid').html(transid);
3410jQuery('.lploading').fadeOut();
3411});
3412});
3413jQuery(document).ready(function (){
3414jQuery('.lp-claim-plan-btn').click(function (){
3415$sPlanID=jQuery('input[name=plan_id]:checked').val();
3416if(typeof $sPlanID!=='undefined'&&typeof $sPlanID!==undefined&&$sPlanID!==''){
3417jQuery('input[name=lp_claimed_plan]').val($sPlanID);
3418jQuery('.lp-claim-plan-container').addClass('active');
3419jQuery('.lp-claim-plans').addClass('active');
3420}});
3421});
3422jQuery(document).ready(function (){
3423jQuery('.lp-confi-bottom-bar').click(function (){
3424jQuery('.lp_confirmation').slideToggle(700);
3425jQuery('.unhidebar-section').slideToggle(700);
3426});
3427jQuery('.unhidebar-section').click(function (){
3428jQuery('.lp_confirmation').slideToggle(700);
3429jQuery('.unhidebar-section').slideToggle(700);
3430});
3431jQuery('.lp-filter-search-listing').click(function (){
3432jQuery('.lp-dash-search-stats-inner').slideToggle(400);
3433});
3434});
3435jQuery(window).resize(function (){
3436if(jQuery(window).width() < 768){
3437jQuery('.lp-dashboard-new').removeClass('active');
3438}});
3439jQuery(document).ready(function (){
3440jQuery('.lp-cross-suces-layout').click(function (){
3441jQuery('.lp-lead-success-msg-outer').fadeOut('700');
3442});
3443jQuery('.lp-lead-radio-container input[type=radio]').click(function (){
3444jQuery('.lp-lead-radio-container input[type=radio]:not(:checked)').parent().removeClass("active-radio");
3445jQuery('.lp-lead-radio-container input[type=radio]:checked').parent().addClass("active-radio");
3446});
3447jQuery('.lp-lead-check-container input[type=checkbox]').click(function (){
3448jQuery('.lp-lead-check-container input[type=checkbox]:not(:checked)').parent().removeClass("active-checkbox");
3449jQuery('.lp-lead-check-container input[type=checkbox]:checked').parent().addClass("active-checkbox");
3450});
3451jQuery('input[type="range"].lp-range-slide').change(function (){
3452var val=(jQuery(this).val() - jQuery(this).attr('min')) / (jQuery(this).attr('max') - jQuery(this).attr('min'));
3453jQuery(this).css('background-image',
3454'-webkit-gradient(linear, left top, right top, ' +
3455'color-stop(' + val + ', #b3c0ce), ' +
3456'color-stop(' + val + ', #eef2f4)' +
3457')'
3458);
3459});
3460if(jQuery('.datetimepicker1').length!=0){
3461var timeFormat='LT';
3462if(jQuery('#wp-timeformat').val()=='H:i'){
3463timeFormat='HH:mm';
3464}
3465jQuery('.datetimepicker1').datetimepicker({
3466format: timeFormat,
3467});
3468}
3469if(jQuery('.datetimepicker2').length!=0){
3470jQuery('.datetimepicker2').datetimepicker({
3471format: 'L'
3472});
3473}
3474if(jQuery('.datetimepicker3').length!=0){
3475jQuery('.datetimepicker3').datetimepicker();
3476}});
3477jQuery(document).ready(function (){
3478jQuery('#listings_checkout_form').on('submit', function (e){
3479var $this=jQuery(this);
3480var method=$this.find('input[name="plan"]:checked').val();
3481if(method==='paypal'){
3482if(jQuery('input[name="lp-recurring-option"]:checked').length > 0&&jQuery('input[name="plan_time"]').val()==''){
3483alert('Sorry! A plan should have a duration for recurring payment');
3484return false;
3485}}
3486});
3487jQuery('#listings_checkout_form').on('submit', function (e){
3488var $this=jQuery(this);
3489method=$this.find('input[name="plan"]:checked').val();
3490listing_id=$this.find('input[name="listing_id"]:checked').val();
3491post_title=$this.find('input[name="listing_id"]:checked').data('title');
3492errormsg=jQuery('input[name="errormsg"]').val();
3493plan_price=jQuery('span.lp-subtotal-total-price').data('subtotal');
3494currency=jQuery('input[name=currency]').val();
3495if(method==='stripe'){
3496if(jQuery('input[name="lp-recurring-option"]:checked').length > 0&&jQuery('input[name="plan_time"]').val()==''){
3497alert('Sorry! A plan should have a duration for recurring payment');
3498return false;
3499}else{
3500if(jQuery('#lp_stripe_sca').length==0){
3501plan_price=plan_price * 100;
3502handler.open({
3503name: post_title,
3504description: "",
3505zipCode: true,
3506amount: plan_price,
3507currency: currency,
3508});
3509e.preventDefault();
3510}}
3511}else if(method==='2checkout'){
3512plan_price=jQuery('span.lp-subtotal-total-price').data('subtotal');
3513listing_id=$this.find('input[name="listing_id"]:checked').val();
3514jQuery('#myCCForm input#tprice').val(plan_price);
3515jQuery('#myCCForm input#listing_id').val(listing_id);
3516jQuery("button.lp-2checkout-modal").trigger('click');
3517e.preventDefault();
3518}});
3519jQuery('.lp_payment_methods_ads .lp-payement-images').on('click', function (e){
3520$this=jQuery(this);
3521lp_make_campaign_paybutton_active();
3522});
3523jQuery('button.lp-add-new-btn').on('click', function (){
3524jQuery('.lp_camp_invoice_wrp').fadeOut(function (){
3525jQuery('.lp-ad-step-two').fadeIn();
3526});
3527});
3528jQuery('a.lp-all-camp-bck').on('click', function (e){
3529jQuery('.lp-ad-step-two').hide(300);
3530jQuery('.lp_camp_invoice_wrp').show(300);
3531e.preventDefault();
3532});
3533});
3534function lp_show_mini_subtotal(){
3535var $tax=jQuery('#listings_checkout_form input[name=listing_id]:checked').data('taxenable');
3536var $taxRate=jQuery('#listings_checkout_form input[name=listing_id]:checked').data('taxrate');
3537var $method=jQuery('#listings_checkout_form input[name=plan]:checked').val();
3538var $price=jQuery('#listings_checkout_form input[name=listing_id]:checked').data('planprice');
3539var $orgPrice=$price;
3540var $orgPrice=parseFloat($orgPrice).toFixed(2);
3541var $planID=jQuery('#listings_checkout_form input[name=listing_id]:checked').data('planid');
3542var $planTime=jQuery('#listings_checkout_form input[name=listing_id]:checked').data('plantime');
3543var $listingID=jQuery('#listings_checkout_form input[name=listing_id]:checked').val();
3544var $lpRecurring=jQuery('#listings_checkout_form .lp-onoff-switch-checkbox .switch-checkbox-label .switch-checkbox-label input:checked').val();
3545var $taxPrice='';
3546var $currencyPos=jQuery('#listings_checkout_form').data('currencypos');
3547var $currencySym=jQuery('#listings_checkout_form').data('currencysymbol');
3548if($tax=="1"){
3549$taxPrice=($taxRate / 100) * $price;
3550$price=parseFloat($price) + parseFloat($taxPrice);
3551$taxPrice=parseFloat($taxPrice).toFixed(2);
3552}
3553$price=parseFloat($price).toFixed(2);
3554jQuery('span.lp-subtotal-plan').text('');
3555jQuery('span.lp-subtotal-price').text('');
3556jQuery('span.lp-subtotal-taxamount').text('');
3557jQuery('span.lp-subtotal-price').text('');
3558jQuery('span.lp-subtotal-p-price').text('');
3559jQuery('span.lp-subtotal-total-price').text('');
3560jQuery('span.lp-subtotal-plan').text(jQuery('#listings_checkout_form input[name=listing_id]:checked').data('title'));
3561lp_add_checkout_data_fields($listingID, $planID, $price, $lpRecurring, $method, $planTime);
3562switch ($currencyPos){
3563case ('left'):
3564jQuery('span.lp-subtotal-p-price').text($currencySym + $orgPrice);
3565jQuery('span.lp-subtotal-price').text($currencySym + $price);
3566jQuery('span.lp-subtotal-taxamount').text($currencySym + $taxPrice);
3567jQuery('span.lp-subtotal-total-price').text($currencySym + $price);
3568jQuery('span.lp-subtotal-total-price').attr('data-subtotal', $price);
3569break;
3570case ('right'):
3571jQuery('span.lp-subtotal-p-price').text($orgPrice + $currencySym);
3572jQuery('span.lp-subtotal-price').text($price + $currencySym);
3573jQuery('span.lp-subtotal-taxamount').text($taxPrice + $currencySym);
3574jQuery('span.lp-subtotal-total-price').text($price + $currencySym);
3575jQuery('span.lp-subtotal-total-price').attr('subtotal', $price);
3576break;
3577default:
3578jQuery('span.lp-subtotal-p-price').text($currencySym + $orgPrice);
3579jQuery('span.lp-subtotal-price').text($currencySym + $price);
3580jQuery('span.lp-subtotal-taxamount').text($currencySym + $taxPrice);
3581jQuery('span.lp-subtotal-total-price').text($currencySym + $price);
3582jQuery('span.lp-subtotal-total-price').attr('datasubtotal', $price);
3583}
3584jQuery('.lp-checkout-coupon-outer').css('display', 'block');
3585jQuery('.active-checkout-listing').addClass('lp-checkout-wrapper-new-without-radius');
3586}
3587function lp_show_recurring_switch(){
3588var $sPlan=jQuery('input[name=plan]:checked').val();
3589if($sPlan=="stripe"||$sPlan=="paypal"){
3590jQuery('.lp-checkout-recurring-wrap').css('display', 'block');
3591}else if($sPlan=="wire"){
3592jQuery('.lp-checkout-recurring-wrap input[name="lp-recurring-option"]').prop("checked", false);
3593jQuery('.lp-checkout-recurring-wrap').css('display', 'none');
3594}}
3595function lp_add_checkout_data_fields(listingID, planID, price, recurring, method, $planTime){
3596var $tax=jQuery('#listings_checkout_form input[name=listing_id]:checked').data('taxenable');
3597jQuery('input[name=post_id]').val(listingID);
3598jQuery('input[name=method]').val(method);
3599if($tax=='1'){
3600jQuery('input[name=listings_tax_price]').val(price);
3601}
3602jQuery('input[name=prc_plan]').val(planID);
3603jQuery('input[name=lprecurring]').val(recurring);
3604jQuery('input[name=plan_time]').val($planTime);
3605}
3606function lp_make_couponsfields_active(){
3607jQuery('input.coupon-text-field').prop('disabled', false);
3608jQuery('button.coupon-apply-bt').prop('disabled', false);
3609}
3610function lp_make_couponsfields_passive(){
3611jQuery('input.coupon-text-field').prop('disabled', true);
3612jQuery('button.coupon-apply-bt').prop('disabled', true);
3613}
3614function lp_add_checkout_data_fields_in_form(listingID, post_title, planID, price, $tax, $taxRate){
3615jQuery('input[name=plan_price]').val(price);
3616jQuery('input[name=post_title]').val(post_title);
3617jQuery('input[name=listings_id]').val(listingID);
3618jQuery('input[name=post_id]').val(listingID);
3619jQuery('input[name=plan_id]').val(planID);
3620if($tax){
3621taxprice=($taxRate / 100) * price;
3622taxprice=taxprice.toFixed(2);
3623jQuery('input[name="listings_tax_price"]').val(taxprice);
3624}
3625lp_update_date_in_mini_cart(price, $tax, $taxRate);
3626}
3627function lp_update_date_in_mini_cart($price, $tax, $taxRate){
3628var $currencyPos=jQuery('#listings_checkout_form').data('currencypos');
3629var $currencySym=jQuery('#listings_checkout_form').data('currencysymbol');
3630var $orgPrice=$price;
3631var $orgPrice=parseFloat($orgPrice).toFixed(2);
3632var $taxPrice='';
3633var $currencyPos=jQuery('#listings_checkout_form').data('currencypos');
3634var $currencySym=jQuery('#listings_checkout_form').data('currencysymbol');
3635if($tax=="1"){
3636$taxPrice=($taxRate / 100) * $price;
3637$price=parseFloat($price) + parseFloat($taxPrice);
3638$price=parseFloat($price).toFixed(2);
3639$taxPrice=parseFloat($taxPrice).toFixed(2);
3640}
3641switch ($currencyPos){
3642case ('left'):
3643jQuery('span.lp-subtotal-price').text($currencySym + $price);
3644jQuery('span.lp-subtotal-taxamount').text($currencySym + $taxPrice);
3645jQuery('span.lp-subtotal-total-price').text($currencySym + $price);
3646jQuery('span.lp-subtotal-total-price').attr('data-subtotal', $price);
3647break;
3648case ('right'):
3649jQuery('span.lp-subtotal-price').text($price + $currencySym);
3650jQuery('span.lp-subtotal-taxamount').text($taxPrice + $currencySym);
3651jQuery('span.lp-subtotal-total-price').text($price + $currencySym);
3652jQuery('span.lp-subtotal-total-price').attr('data-subtotal', $price);
3653break;
3654default:
3655jQuery('span.lp-subtotal-p-price').text($currencySym + $orgPrice);
3656jQuery('span.lp-subtotal-price').text($currencySym + $price);
3657jQuery('span.lp-subtotal-taxamount').text($currencySym + $taxPrice);
3658jQuery('span.lp-subtotal-total-price').text($currencySym + $price);
3659jQuery('span.lp-subtotal-total-price').attr('data-subtotal', $price);
3660}}
3661function lp_reset_mincart_checkout_form_data(){
3662var $price=jQuery('input[name=listing_id]:checked').data('planprice');
3663var $listingID=jQuery('input[name=listing_id]:checked').val();
3664var $post_title=jQuery('input[name=listing_id]:checked').data('title');
3665var $planID=jQuery('input[name=listing_id]:checked').data('planid');
3666var $tax=jQuery('input[name=listing_id]:checked').data('taxenable');
3667var $taxRate=jQuery('input[name=listing_id]:checked').data('taxrate');
3668lp_add_checkout_data_fields_in_form($listingID, $post_title, $planID, $price, $tax, $taxRate);
3669}
3670function lp_make_checkout_step_active($stepname){
3671jQuery('.lp_payment_steps_area li.' + $stepname + '').addClass('current');
3672}
3673function lp_make_checkout_step_passive($stepname){
3674jQuery('.lp_payment_steps_area li.' + $stepname + '').removeClass('current');
3675}
3676function lp_make_campaign_paybutton_active(){
3677var selected_option=jQuery('.lp-search-listing-camp').val();
3678var atLeastOnePlaceAd=jQuery('input[name="lpadsoftype[]"]:checked').length > 0;
3679var atLeastOneMethodAd=jQuery('input[name="method"]:checked').length > 0;
3680var adsterms=jQuery('#lp-campaignTerms:checked').length > 0;
3681var listing_id=jQuery('select[name=lp_ads_for_listing]').val();
3682var adPriceField=1;
3683var adDurationField=1;
3684if(jQuery('input[name="adsduration_pd"]').length > 0){
3685adDurationField=jQuery('input[name="adsduration_pd"]').val();
3686}
3687if(jQuery('input[name="adsprice_pc"]').length > 0){
3688adPriceField=jQuery('input[name="adsprice_pc"]').val();
3689}
3690if(selected_option!=''&&selected_option!='0'&&listing_id!=''&&listing_id!='0'&&atLeastOnePlaceAd!=''&&adsterms!=''&&adsterms!='0'&&atLeastOnePlaceAd!='0'&&atLeastOneMethodAd!=''&&atLeastOneMethodAd!='0'&&adDurationField!=''&&adDurationField!='0'&&adPriceField!=''&&adPriceField!='0'){
3691jQuery('button.lp_campaign_paynow').attr('disabled', false);
3692jQuery('button.lp_campaign_paynow').attr('type', 'submit');
3693}else{
3694jQuery('button.lp_campaign_paynow').attr('disabled', true);
3695jQuery('button.lp_campaign_paynow').attr('type', 'button');
3696}}
3697jQuery(document).on('change', 'select[name=lp_ads_for_listing]', function (){
3698lp_make_campaign_paybutton_active();
3699});
3700jQuery(document).on('click', '#lp-campaignTerms', function (){
3701lp_make_campaign_paybutton_active();
3702});
3703jQuery(document).on('click', '.show-loop-map-popup', function (e){
3704e.preventDefault();
3705if(jQuery('#grid-show-popup').is('.md-show')){
3706}else{
3707jQuery('#grid-show-popup').modal({
3708show: 'true'
3709});
3710jQuery('#grid-show-popup').addClass('md-show');
3711}
3712var $this=jQuery(this),
3713LAT=$this.data('lat'),
3714LNG=$this.data('lng'),
3715LPpostID=$this.data('lid');
3716jQuery.ajax({
3717url: ajax_search_term_object.ajaxurl,
3718data: {
3719'action': 'show_map_pop_cb',
3720'LPpostID': LPpostID,
3721'lpNonce': jQuery('#lpNonce').val()
3722},
3723success: function (data){
3724jQuery('#grid-show-popup .grid-show-popup').html(data);
3725var markerSrc=jQuery('#grid-show-popup .grid-show-popup .quickmap').attr('data-marker-src');
3726var markers=false;
3727$mtoken=jQuery('#page').data("mtoken");
3728$mtype=jQuery('#page').data("mtype");
3729$siteURL=jQuery('#page').data("site-url");
3730$lat=LAT;
3731$lan=LNG;
3732if($mtoken!=''&&$mtype=='mapbox'){
3733L.mapbox.accessToken=$mtoken;
3734map=L.mapbox.map('quickmap' + LPpostID);
3735L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
3736id: jQuery('#page').data("mstyle"),
3737accessToken: jQuery('#page').data("mtoken")
3738}).addTo(map);
3739}else{
3740var map=new L.Map('quickmap' + LPpostID, { center: new L.LatLng($lat, $lan), zoom: 14 });
3741if($mtype=='google'){
3742var googleLayer=new L.Google('ROADMAP');
3743map.addLayer(googleLayer);
3744}else{
3745L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
3746}}
3747map.setView([$lat, $lan], 14);
3748markers=new L.MarkerClusterGroup();
3749var markerLocation=new L.LatLng($lat, $lan);
3750var CustomHtmlIcon=L.HtmlIcon.extend({
3751options: {
3752html: "<div class='lpmap-icon-shape pin '><div class='lpmap-icon-contianer'><img alt='image' src='" + markerSrc + "'  /></div></div>",
3753}});
3754var customHtmlIcon=new CustomHtmlIcon();
3755var marker=new L.Marker(markerLocation, { icon: customHtmlIcon }).bindPopup('').addTo(map);
3756markers.addLayer(marker);
3757jQuery('.md-close.widget-map-click').click(function (e){
3758var loaderImg=jQuery('#grid-show-popup .grid-show-popup').data('loader');
3759jQuery('#full-overlay').remove();
3760jQuery('#grid-show-popup .grid-show-popup').html('<img alt="image" src="' + loaderImg + '" />');
3761});
3762},
3763error: function (errorThrown){
3764alert(errorThrown);
3765}});
3766});
3767jQuery(document).on('click', '.open-multi-rate-box', function (e){
3768e.preventDefault();
3769var $this=jQuery(this),
3770targetBox='#' + $this.data('rate-box');
3771jQuery(targetBox).slideToggle(500);
3772});
3773jQuery('button.printthisinvoice').click(function (e){
3774var printContents=document.querySelector('#listing-invoices-popup .modal-body').innerHTML;
3775var originalContents=document.body.innerHTML;
3776document.body.innerHTML=printContents;
3777window.print();
3778document.body.innerHTML=originalContents;
3779location.reload();
3780e.preventDefault();
3781});
3782jQuery(document).ready(function (){
3783if(jQuery('.lp-user-listings.active-checkout-listing').length){
3784jQuery(".lp-user-listings").each(function (index){
3785if(jQuery(this).hasClass('active-checkout-listing')){
3786}else{
3787jQuery(this).remove();
3788}});
3789}});
3790jQuery(document).ready(function (){
3791jQuery('.lp-menu-type-heading').on('click', function (){
3792jQuery(this).toggleClass('active');
3793jQuery('.active-menu-toggle').slideUp('slow', function (){
3794jQuery('.active-menu-toggle').removeClass('active-menu-toggle')
3795});
3796var getmenutype='.' + jQuery(this).attr("data-target");
3797jQuery(getmenutype).slideToggle('slow');
3798});
3799jQuery('.lp-appview-group-heading').on('click', function (){
3800jQuery(this).toggleClass('active');
3801var getmenugroup='.' + jQuery(this).attr("data-target");
3802jQuery(this).next(getmenugroup).slideToggle('slow');
3803})
3804});
3805jQuery(document).ready(function (){
3806jQuery('.lp_stats_duration_filter li button').on('click', function (){
3807jQuery('.lp_stats_duratonBtn').removeClass('active');
3808jQuery(this).addClass('active');
3809});
3810if(jQuery(window).width() < 641){
3811jQuery('#main_icon').on('click', function (){
3812jQuery('#main_icon').toggleClass('fa fa-times');
3813jQuery('#sidebar').toggle(300);
3814});
3815}
3816jQuery('.lp-grid-two').on('click', function (){
3817jQuery('.lp-sidebar-filters-style').removeClass('lp-grid-width1');
3818jQuery('.lp-sidebar-filters-style').removeClass('lp-grid-width3');
3819jQuery('.lp-sidebar-filters-style').addClass('lp-grid-width2');
3820jQuery('.lp-grid-two').addClass('active');
3821jQuery('.lp-grid-one').removeClass('active');
3822jQuery('.lp-grid-three').removeClass('active');
3823});
3824jQuery('.lp-grid-one').on('click', function (){
3825jQuery('.lp-sidebar-filters-style').removeClass('lp-grid-width2');
3826jQuery('.lp-sidebar-filters-style').removeClass('lp-grid-width3');
3827jQuery('.lp-sidebar-filters-style').addClass('lp-grid-width1');
3828jQuery('.lp-grid-one').addClass('active');
3829jQuery('.lp-grid-two').removeClass('active');
3830jQuery('.lp-grid-three').removeClass('active');
3831});
3832jQuery('.lp-grid-three').on('click', function (){
3833jQuery('.lp-sidebar-filters-style').removeClass('lp-grid-width1');
3834jQuery('.lp-sidebar-filters-style').removeClass('lp-grid-width2');
3835jQuery('.lp-sidebar-filters-style').addClass('lp-grid-width3');
3836jQuery('.lp-grid-three').addClass('active');
3837jQuery('.lp-grid-two').removeClass('active');
3838jQuery('.lp-grid-one').removeClass('active');
3839});
3840});
3841jQuery(document).on('click', '.app-view-popup-style', function (){
3842jQuery('<div id="full-overlay-lp"></div>').insertBefore("#app-view-login-popup");
3843jQuery("#full-overlay-lp").css({
3844"width": "100vw",
3845"height": "100vh",
3846"position": "fixed",
3847"background": "#000000c7",
3848"z-index": 3,
3849"top": 0,
3850"left": 0
3851});
3852jQuery(".md-close i").click(function (){
3853jQuery('#full-overlay-lp').remove();
3854jQuery('#app-view-login-popup').fadeOut(function (){
3855jQuery('#app-view-login-popup').css({
3856'display': 'none'
3857});
3858});
3859});
3860});
3861function lp_get_currency_sysmbol(){
3862$code=jQuery('#lp-new-ad-compaignForm').data('camp-currency');
3863return $code;
3864}
3865function lp_get_tax_percent(){
3866$code=jQuery('#lp-new-ad-compaignForm').data('tax-percent');
3867return $code;
3868}
3869function lp_get_selected_camp_price(){
3870$totalCamPrice=0;
3871jQuery('input[name="lpadsoftype[]"]:checked').each(function (){
3872$thisAd=jQuery(this).data('orgprice');
3873$totalCamPrice=parseFloat($totalCamPrice) + parseFloat($thisAd);
3874});
3875return $totalCamPrice;
3876}
3877function lp_get_selected_camp_withtax_price(){
3878$totalCamPrice=0;
3879jQuery('input[name="lpadsoftype[]"]:checked').each(function (){
3880$thisAd=jQuery(this).data('price');
3881$totalCamPrice=parseFloat($totalCamPrice) + parseFloat($thisAd);
3882});
3883return $totalCamPrice;
3884}
3885function lp_get_selected_camp_onlytax_price(){
3886$totalCamPrice=0;
3887jQuery('input[name="lpadsoftype[]"]:checked').each(function (){
3888$thisAd=jQuery(this).data('taxprice');
3889$totalCamPrice=parseFloat($totalCamPrice) + parseFloat($thisAd);
3890});
3891return $totalCamPrice;
3892}
3893function lp_set_camp_duration_price_in_preview($thisval){
3894$daysString=jQuery('.lp-cmp-duration').data('days-text');
3895$taxPercent=lp_get_tax_percent();
3896$taxtotalPrice=lp_get_selected_camp_onlytax_price();
3897$taxtotalPrice=$thisval * $taxtotalPrice;
3898$taxtotalPrice=$taxtotalPrice.toFixed(2);
3899jQuery('input[name=taxprice]').val($taxtotalPrice);
3900jQuery('input[name=ads_days]').val($thisval);
3901$thisvalWithDays=$thisval + ' ' + $daysString;
3902jQuery('.lp-cmp-duration h6').text($thisvalWithDays);
3903$totalCamPrice=lp_get_selected_camp_price();
3904$totalCamPrice=parseFloat($thisval) * parseFloat($totalCamPrice);
3905console.log($totalCamPrice);
3906$totalCamPrice=$totalCamPrice.toFixed(2);
3907jQuery('.lp-cmp-subtotal h6').text(lp_get_currency_sysmbol() + '' + $totalCamPrice);
3908$totalCamPriceWithTax=lp_get_selected_camp_withtax_price();
3909$totalCamPriceWithTax=parseFloat($thisval) * parseFloat($totalCamPriceWithTax);
3910$totalCamPriceWithTax=$totalCamPriceWithTax.toFixed(2);
3911console.log($totalCamPriceWithTax);
3912jQuery('.lp-cmp-alltotal h5').text(lp_get_currency_sysmbol() + '' + $totalCamPriceWithTax);
3913jQuery('input[name=ads_price]').val($totalCamPriceWithTax);
3914jQuery('.lp-cmp-taxtotal h6').text($taxtotalPrice);
3915}
3916function lp_set_camp_budget_price_in_preview($thisval){
3917$taxPercent=lp_get_tax_percent();
3918$thisvalWithCurr=lp_get_currency_sysmbol() + '' + $thisval;
3919jQuery('.lp-cmp-budget h6').text($thisvalWithCurr);
3920jQuery('.lp-cmp-subtotal h6').text($thisvalWithCurr);
3921$taxPrice=0;
3922if($taxPercent){
3923$taxPrice=($taxPercent / 100) * $thisval;
3924$taxPrice=$taxPrice.toFixed(2);
3925jQuery('input[name=taxprice]').val($taxPrice);
3926$taxPriceWithCurr=lp_get_currency_sysmbol() + '' + $taxPrice;
3927jQuery('.lp-cmp-taxtotal h6').text($taxPriceWithCurr);
3928}
3929$totalAmount=parseFloat($thisval) + parseFloat($taxPrice);
3930jQuery('input[name=ads_price]').val($totalAmount);
3931jQuery('.lp-cmp-alltotal h5').text(lp_get_currency_sysmbol() + '' + $totalAmount);
3932}
3933function lp_get_camp_type(){
3934$camptype=jQuery('#lp-new-ad-compaignForm').data('type');
3935return $camptype;
3936}
3937jQuery(document).on('click', 'button.add-hours', function (event){
3938event.preventDefault();
3939var is_safari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);
3940var $this=jQuery(this);
3941var lp2times=$this.closest('#day-hours-BusinessHours').data('lpenabletwotimes');
3942var sorryMsg=jQuery(this).data('sorrymsg');
3943var alreadyadded=jQuery(this).data('alreadyadded');
3944var error=false;
3945var fullday='';
3946var fullhoursclass='';
3947var lpdash="~";
3948if(lp2times=="disable"){
3949var weekday=jQuery('select.weekday').val();
3950if(jQuery(".fulldayopen").is(":checked")){
3951jQuery('.fulldayopen').attr('checked', false);
3952jQuery('select.hours-start').prop("disabled", false);
3953jQuery('select.hours-end').prop("disabled", false);
3954var startVal='';
3955var endVal='';
3956var hrstart='';
3957var hrend='';
3958fullday=$this.data('fullday');
3959fullhoursclass='fullhours';
3960lpdash="";
3961}else{
3962var startVal=jQuery('select.hours-start').val();
3963var endVal=jQuery('select.hours-end').val();
3964var hrstart=jQuery('select.hours-start').find('option:selected').val();
3965var hrend=jQuery('select.hours-end').find('option:selected').val();
3966var startVal_digit=hrstart.replace(':', '');
3967var endVal_digit=hrend.replace(':', '');
3968if(startVal_digit.indexOf('am') > -1){
3969startVal_digit=startVal_digit.replace('am', '');
3970}else if(startVal_digit.indexOf('pm') > -1){
3971startVal_digit=startVal_digit.replace('pm', '');
3972if(startVal_digit!='1200'&&startVal_digit!='1230'){
3973startVal_digit=parseInt(startVal_digit) + 1200;
3974}}
3975if(endVal_digit.indexOf('am') > -1){
3976endVal_digit=endVal_digit.replace('am', '');
3977endVal_digit=parseInt(endVal_digit);
3978if(endVal_digit >=1200){
3979endVal_digit=parseInt(endVal_digit) - 1200;
3980}}else if(endVal_digit.indexOf('pm') > -1){
3981endVal_digit=endVal_digit.replace('pm', '');
3982endVal_digit=parseInt(endVal_digit) + 1200;
3983}
3984if(startVal_digit > endVal_digit){
3985nextWeekday=jQuery("select.weekday option:selected+option").val();
3986if(typeof nextWeekday==="undefined"){
3987nextWeekday=jQuery("select.weekday").find("option:first-child").val();
3988}
3989weekday=weekday + "~" + nextWeekday;
3990}}
3991if($this.hasClass('lp-add-hours-st')){
3992var remove='<i class="fa fa-times"></i>';
3993}else{
3994var remove=jQuery(this).data('remove');
3995}
3996jQuery('.hours-display .hours').each(function (index, element){
3997var weekdayTExt=jQuery(element).children('.weekday').text();
3998if(weekdayTExt==weekday){
3999alert(sorryMsg + '! ' + weekday + ' ' + alreadyadded);
4000error=true;
4001}});
4002if(error!=true){
4003jQuery('.hours-display').append("<div class='hours " + fullhoursclass + "'><span class='weekday'>" + weekday + "</span><span class='start-end fullday'>" + fullday + "</span><span class='start'>" + hrstart + "</span><span>" + lpdash + "</span><span class='end'>" + hrend + "</span><a class='remove-hours' href='#'>" + remove + "</a><input name='business_hours[" + weekday + "][open]' value='" + startVal + "' type='hidden'><input name='business_hours[" + weekday + "][close]' value='" + endVal + "' type='hidden'></div>");
4004if(is_safari){
4005}else{
4006var current=jQuery('select.weekday').find('option:selected');
4007var nextval=current.next();
4008current.removeAttr('selected');
4009nextval.attr('selected', 'selected');
4010jQuery('select.weekday').trigger('change.select2');
4011}}
4012}else{
4013var lptwentlyfourisopen='';
4014var weekday=jQuery('select.weekday').val();
4015var weekday1=weekday;
4016var weekday2=weekday;
4017if(jQuery(".fulldayopen").is(":checked")){
4018lptwentlyfourisopen='yes';
4019jQuery('.fulldayopen').attr('checked', false);
4020jQuery('select.hours-start').prop("disabled", false);
4021jQuery('select.hours-end').prop("disabled", false);
4022jQuery('select.hours-start2').prop("disabled", false);
4023jQuery('select.hours-end2').prop("disabled", false);
4024var startVal1='';
4025var endVal1='';
4026var hrstart1='';
4027var hrend1='';
4028var startVal2='';
4029var endVal2='';
4030var hrstart2='';
4031var hrend2='';
4032fullday=$this.data('fullday');
4033fullhoursclass='fullhours';
4034lpdash="";
4035}else{
4036var startVal1=jQuery('select.hours-start').val();
4037var endVal1=jQuery('select.hours-end').val();
4038var hrstart1=jQuery('select.hours-start').find('option:selected').val();
4039var hrend1=jQuery('select.hours-end').find('option:selected').val();
4040var startVal1_digit=hrstart1.replace(':', '');
4041var endVal1_digit=hrend1.replace(':', '');
4042if(startVal1_digit.indexOf('am') > -1){
4043startVal1_digit=startVal1_digit.replace('am', '');
4044}else if(startVal1_digit.indexOf('pm') > -1){
4045startVal1_digit=startVal1_digit.replace('pm', '');
4046if(startVal1_digit!='1200'&&startVal1_digit!='1230'){
4047startVal1_digit=parseInt(startVal1_digit) + 1200;
4048}}
4049if(endVal1_digit.indexOf('am') > -1){
4050endVal1_digit=endVal1_digit.replace('am', '');
4051endVal1_digit=parseInt(endVal1_digit);
4052if(endVal1_digit >=1200){
4053endVal1_digit=parseInt(endVal1_digit) - 1200;
4054}}else if(endVal1_digit.indexOf('pm') > -1){
4055endVal1_digit=endVal1_digit.replace('pm', '');
4056endVal1_digit=parseInt(endVal1_digit) + 1200;
4057}
4058if(startVal1_digit > endVal1_digit){
4059nextWeekday=jQuery("select.weekday option:selected+option").val();
4060if(typeof nextWeekday==="undefined"){
4061nextWeekday=jQuery("select.weekday").find("option:first-child").val();
4062}
4063weekday1=weekday + "~" + nextWeekday;
4064jQuery('.hours-display .hours').each(function (e){
4065var $this=jQuery(this);
4066if($this.find('span.weekday:contains("' + weekday1 + '")').length > 0){
4067alert(sorryMsg + '! ' + weekday1 + ' ' + alreadyadded);
4068error=true;
4069}});
4070}
4071var startVal2=jQuery('select.hours-start2').val();
4072var endVal2=jQuery('select.hours-end2').val();
4073var hrstart2=jQuery('select.hours-start2').find('option:selected').text();
4074var hrend2=jQuery('select.hours-end2').find('option:selected').text();
4075var startVal2_digit=hrstart2.replace(':', '');
4076var endVal2_digit=hrend2.replace(':', '');
4077if(startVal2_digit.indexOf(' AM') > -1){
4078startVal2_digit=parseInt(startVal2_digit.replace(' AM', ''));
4079}else if(startVal2_digit.indexOf(' PM') > -1){
4080startVal2_digit=parseInt(startVal2_digit.replace(' PM', ''));
4081if(startVal2_digit!='1200'&&startVal2_digit!='1230'){
4082startVal2_digit=parseInt(startVal2_digit) + 1200;
4083}}
4084if(endVal2_digit.indexOf(' AM') > -1){
4085endVal2_digit=endVal2_digit.replace(' AM', '');
4086endVal2_digit=parseInt(endVal2_digit);
4087if(endVal2_digit >=1200){
4088endVal2_digit=parseInt(endVal2_digit) - 1200;
4089}}else if(endVal2_digit.indexOf(' PM') > -1){
4090endVal2_digit=endVal2_digit.replace(' PM', '');
4091endVal2_digit=parseInt(endVal2_digit) + 1200;
4092}
4093nextWeekday=jQuery("select.weekday option:selected+option").val();
4094if(typeof nextWeekday==="undefined"){
4095nextWeekday=jQuery("select.weekday").find("option:first-child").val();
4096}
4097weekday2=weekday;
4098jQuery('.hours-display .hours').each(function (e){
4099var $this=jQuery(this);
4100if($this.find('span.weekday:contains("' + weekday2 + '")').length > 0){
4101alert(sorryMsg + '! ' + weekday2 + ' ' + alreadyadded);
4102error=true;
4103}});
4104}
4105if($this.hasClass('lp-add-hours-st')){
4106var remove='<i class="fa fa-times"></i>';
4107}else{
4108var remove=jQuery(this).data('remove');
4109}
4110jQuery('.hours-display .hours').each(function (index, element){
4111var weekdayTExt=jQuery(element).children('.weekday').text();
4112if(weekdayTExt==weekday){
4113alert(sorryMsg + '! ' + weekday + ' ' + alreadyadded);
4114error=true;
4115}});
4116if(error!=true){
4117if((jQuery(".lp-check-doubletime .enable2ndday").is(":checked"))&&(lptwentlyfourisopen==="")){
4118jQuery('.hours-display').append("<div class='hours " + fullhoursclass + "'><span class='weekday'>" + weekday + "</span><span class='start-end fullday'>" + fullday + "</span><span class='start'>" + hrstart1 + "</span><span>" + lpdash + "</span><span class='end'>" + hrend1 + "</span><a class='remove-hours' href='#'>" + remove + "</a><br><span class='weekday'>&nbsp;</span><span class='start'>" + hrstart2 + "</span><span>" + lpdash + "</span><span class='end'>" + hrend2 + "</span><input name='business_hours[" + weekday1 + "][open][0]' value='" + startVal1 + "' type='hidden'><input name='business_hours[" + weekday1 + "][close][0]' value='" + endVal1 + "' type='hidden'><input name='business_hours[" + weekday2 + "][open][1]' value='" + startVal2 + "' type='hidden'><input name='business_hours[" + weekday2 + "][close][1]' value='" + endVal2 + "' type='hidden'></div>");
4119}else{
4120jQuery('.hours-display').append("<div class='hours " + fullhoursclass + "'><span class='weekday'>" + weekday1 + "</span><span class='start-end fullday'>" + fullday + "</span><span class='start'>" + hrstart1 + "</span><span>" + lpdash + "</span><span class='end'>" + hrend1 + "</span><a class='remove-hours' href='#'>" + remove + "</a><input name='business_hours[" + weekday1 + "][open]' value='" + startVal1 + "' type='hidden'><input name='business_hours[" + weekday1 + "][close]' value='" + endVal1 + "' type='hidden'></div>");
4121}
4122if(is_safari){
4123}else{
4124var current=jQuery('select.weekday').find('option:selected');
4125var nextval=current.next();
4126current.removeAttr('selected');
4127nextval.attr('selected', 'selected');
4128jQuery('select.weekday').trigger('change.select2');
4129}}
4130}});
4131jQuery(document).on('click', '.lp-dot-extra-buttons', function (e){
4132jQuery(this).find(".lp-user-menu").toggleClass("main");
4133});
4134jQuery(document).ready(function (){
4135jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").attr("disabled", true);
4136jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").addClass("LPdisabled");
4137if(jQuery('.form-group.lp-claim-form-check-circle input').is(':checked')){
4138jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").attr("disabled", false);
4139jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").removeClass("LPdisabled");
4140}else{
4141jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").attr("disabled", true);
4142jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").addClass("LPdisabled");
4143}
4144jQuery('.form-group.lp-claim-form-check-circle input').click(function (){
4145if(jQuery('.form-group.lp-claim-form-check-circle input').is(':checked')){
4146jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").attr("disabled", false);
4147jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").removeClass("LPdisabled");
4148}else{
4149jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").attr("disabled", true);
4150jQuery(".lp-secondary-btn.btn-second-hover.lp-secondary-choose.lp-claim-plan-btn").addClass("LPdisabled");
4151}});
4152});
4153jQuery("#pop").on("click", function (e){
4154e.preventDefault();
4155jQuery('#imagemodal').modal('show');
4156var img_src=jQuery(this).data('imgsrc');
4157jQuery('#imagemodal').find('img').attr('src', img_src);
4158});
4159jQuery('#my_file').change(function (){
4160var i=jQuery(this).prev('label').clone();
4161var file=jQuery('#my_file')[0].files[0].name;
4162jQuery(this).prev('label').text(file);
4163});
4164jQuery(document).ready(function (){
4165if(jQuery('.payment-recurring-message').length > 0){
4166jQuery(document).on('change', '.lp-checkout-recurring-wrap', function (){
4167var checkboxVal=jQuery('.lp-checkout-recurring-wrap input[name="lp-recurring-option"]').is(':checked');
4168if(checkboxVal===false){
4169jQuery('.payment-recurring-message').fadeOut('slow');
4170}});
4171jQuery('.rec_alert_remove').click(function (){
4172jQuery('.payment-recurring-message').fadeOut('slow');
4173});
4174}});
4175jQuery(document).on('click', '.sidebar-filters-map-pop', function (e){
4176if(jQuery('.sidemap-container').hasClass('sidebar-filters-map-full')){
4177jQuery('.sidemap-container').removeClass('sidebar-filters-map-full');
4178jQuery(this).text(jQuery(this).attr('data-full-map'));
4179}else{
4180jQuery('.sidemap-container').addClass('sidebar-filters-map-full');
4181jQuery(this).text(jQuery(this).attr('data-close-map'));
4182setTimeout(function (){
4183jQuery(".all-list-map").trigger('click');
4184}, 1000);
4185}});
4186var Base=function(){};Base.extend=function(a,b){"use strict";var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(null!==arguments[0])return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return"object"==a?f:e.valueOf()},c.call(f,b),"function"==typeof f.init&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&"function"==typeof b&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;Base._prototyping||"function"==typeof this||(e=this.extend||e);for(var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a<arguments.length;a++)"function"==typeof arguments[a]?arguments[a](this.prototype):this.prototype.extend(arguments[a]);return this},toString:function(){return String(this.valueOf())}});var FlipClock;!function(a){"use strict";FlipClock=function(a,b,c){return b instanceof Object&&b instanceof Date==!1&&(c=b,b=0),new FlipClock.Factory(a,b,c)},FlipClock.Lang={},FlipClock.Base=Base.extend({buildDate:"2014-12-12",version:"0.7.7",constructor:function(b,c){"object"!=typeof b&&(b={}),"object"!=typeof c&&(c={}),this.setOptions(a.extend(!0,{},b,c))},callback:function(a){if("function"==typeof a){for(var b=[],c=1;c<=arguments.length;c++)arguments[c]&&b.push(arguments[c]);a.apply(this,b)}},log:function(a){window.console&&console.log&&console.log(a)},getOption:function(a){return this[a]?this[a]:!1},getOptions:function(){return this},setOption:function(a,b){this[a]=b},setOptions:function(a){for(var b in a)"undefined"!=typeof a[b]&&this.setOption(b,a[b])}})}(jQuery),function(a){"use strict";FlipClock.Face=FlipClock.Base.extend({autoStart:!0,dividers:[],factory:!1,lists:[],constructor:function(a,b){this.dividers=[],this.lists=[],this.base(b),this.factory=a},build:function(){this.autoStart&&this.start()},createDivider:function(b,c,d){"boolean"!=typeof c&&c||(d=c,c=b);var e=['<span class="'+this.factory.classes.dot+' top"></span>','<span class="'+this.factory.classes.dot+' bottom"></span>'].join("");d&&(e=""),b=this.factory.localize(b);var f=['<span class="'+this.factory.classes.divider+" "+(c?c:"").toLowerCase()+'">','<span class="'+this.factory.classes.label+'">'+(b?b:"")+"</span>",e,"</span>"],g=a(f.join(""));return this.dividers.push(g),g},createList:function(a,b){"object"==typeof a&&(b=a,a=0);var c=new FlipClock.List(this.factory,a,b);return this.lists.push(c),c},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0,{minimumDigits:this.factory.minimumDigits}),this.flip(this.factory.original,!1)},appendDigitToClock:function(a){a.$el.append(!1)},addDigit:function(a){var b=this.createList(a,{classes:{active:this.factory.classes.active,before:this.factory.classes.before,flip:this.factory.classes.flip}});this.appendDigitToClock(b)},start:function(){},stop:function(){}
4186,autoIncrement:function(){this.factory.countdown?this.decrement():this.increment()},increment:function(){this.factory.time.addSecond()},decrement:function(){0==this.factory.time.getTimeSeconds()?this.factory.stop():this.factory.time.subSecond()},flip:function(b,c){var d=this;a.each(b,function(a,b){var e=d.lists[a];e?(c||b==e.digit||e.play(),e.select(b)):d.addDigit(b)})}})}(jQuery),function(a){"use strict";FlipClock.Factory=FlipClock.Base.extend({animationRate:1e3,autoStart:!0,callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},classes:{active:"flip-clock-active",before:"flip-clock-before",divider:"flip-clock-divider",dot:"flip-clock-dot",label:"flip-clock-label",flip:"flip",play:"play",wrapper:"flip-clock-wrapper"},clockFace:"HourlyCounter",countdown:!1,defaultClockFace:"HourlyCounter",defaultLanguage:"english",$el:!1,face:!0,lang:!1,language:"english",minimumDigits:0,original:!1,running:!1,time:!1,timer:!1,$wrapper:!1,constructor:function(b,c,d){d||(d={}),this.lists=[],this.running=!1,this.base(d),this.$el=a(b).addClass(this.classes.wrapper),this.$wrapper=this.$el,this.original=c instanceof Date?c:c?Math.round(c):0,this.time=new FlipClock.Time(this,this.original,{minimumDigits:this.minimumDigits,animationRate:this.animationRate}),this.timer=new FlipClock.Timer(this,d),this.loadLanguage(this.language),this.loadClockFace(this.clockFace,d),this.autoStart&&this.start()},loadClockFace:function(a,b){var c,d="Face",e=!1;return a=a.ucfirst()+d,this.face.stop&&(this.stop(),e=!0),this.$el.html(""),this.time.minimumDigits=this.minimumDigits,c=FlipClock[a]?new FlipClock[a](this,b):new FlipClock[this.defaultClockFace+d](this,b),c.build(),this.face=c,e&&this.start(),this.face},loadLanguage:function(a){var b;return b=FlipClock.Lang[a.ucfirst()]?FlipClock.Lang[a.ucfirst()]:FlipClock.Lang[a]?FlipClock.Lang[a]:FlipClock.Lang[this.defaultLanguage],this.lang=b},localize:function(a,b){var c=this.lang;if(!a)return null;var d=a.toLowerCase();return"object"==typeof b&&(c=b),c&&c[d]?c[d]:a},start:function(a){var b=this;b.running||b.countdown&&!(b.countdown&&b.time.time>0)?b.log("Trying to start timer when countdown already at 0"):(b.face.start(b.time),b.timer.start(function(){b.flip(),"function"==typeof a&&a()}))},stop:function(a){this.face.stop(),this.timer.stop(a);for(var b in this.lists)this.lists.hasOwnProperty(b)&&this.lists[b].stop()},reset:function(a){this.timer.reset(a),this.face.reset()},setTime:function(a){this.time.time=a,this.flip(!0)},getTime:function(a){return this.time},setCountdown:function(a){var b=this.running;this.countdown=a?!0:!1,b&&(this.stop(),this.start())},flip:function(a){this.face.flip(!1,a)}})}(jQuery),function(a){"use strict";FlipClock.List=FlipClock.Base.extend({digit:0,classes:{active:"flip-clock-active",before:"flip-clock-before",flip:"flip"},factory:!1,$el:!1,$obj:!1,items:[],lastDigit:0,constructor:function(a,b,c){this.factory=a,this.digit=b,this.lastDigit=b,this.$el=this.createList(
4186),this.$obj=this.$el,b>0&&this.select(b),this.factory.$el.append(this.$el)},select:function(a){if("undefined"==typeof a?a=this.digit:this.digit=a,this.digit!=this.lastDigit){var b=this.$el.find("."+this.classes.before).removeClass(this.classes.before);this.$el.find("."+this.classes.active).removeClass(this.classes.active).addClass(this.classes.before),this.appendListItem(this.classes.active,this.digit),b.remove(),this.lastDigit=this.digit}},play:function(){this.$el.addClass(this.factory.classes.play)},stop:function(){var a=this;setTimeout(function(){a.$el.removeClass(a.factory.classes.play)},this.factory.timer.interval)},createListItem:function(a,b){return['<li class="'+(a?a:"")+'">','<a href="#">','<div class="up">','<div class="shadow"></div>','<div class="inn">'+(b?b:"")+"</div>","</div>",'<div class="down">','<div class="shadow"></div>','<div class="inn">'+(b?b:"")+"</div>","</div>","</a>","</li>"].join("")},appendListItem:function(a,b){var c=this.createListItem(a,b);this.$el.append(c)},createList:function(){var b=this.getPrevDigit()?this.getPrevDigit():this.digit,c=a(['<ul class="'+this.classes.flip+" "+(this.factory.running?this.factory.classes.play:"")+'">',this.createListItem(this.classes.before,b),this.createListItem(this.classes.active,this.digit),"</ul>"].join(""));return c},getNextDigit:function(){return 9==this.digit?0:this.digit+1},getPrevDigit:function(){return 0==this.digit?9:this.digit-1}})}(jQuery),function(a){"use strict";String.prototype.ucfirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1)},a.fn.FlipClock=function(b,c){return new FlipClock(a(this),b,c)},a.fn.flipClock=function(b,c){return a.fn.FlipClock(b,c)}}(jQuery),function(a){"use strict";FlipClock.Time=FlipClock.Base.extend({time:0,factory:!1,minimumDigits:0,constructor:function(a,b,c){"object"!=typeof c&&(c={}),c.minimumDigits||(c.minimumDigits=a.minimumDigits),this.base(c),this.factory=a,b&&(this.time=b)},convertDigitsToArray:function(a){var b=[];a=a.toString();for(var c=0;c<a.length;c++)a[c].match(/^\d*$/g)&&b.push(a[c]);return b},digit:function(a){var b=this.toString(),c=b.length;return b[c-a]?b[c-a]:!1},digitize:function(b){var c=[];if(a.each(b,function(a,b){b=b.toString(),1==b.length&&(b="0"+b);for(var d=0;d<b.length;d++)c.push(b.charAt(d))}),c.length>this.minimumDigits&&(this.minimumDigits=c.length),this.minimumDigits>c.length)for(var d=c.length;d<this.minimumDigits;d++)c.unshift("0");return c},getDateObject:function(){return this.time instanceof Date?this.time:new Date((new Date).getTime()+1e3*this.getTimeSeconds())},getDayCounter:function(a){var b=[this.getDays(),this.getHours(!0),this.getMinutes(!0)];return a&&b.push(this.getSeconds(!0)),this.digitize(b)},getDays:function(a){var b=this.getTimeSeconds()/60/60/24;return a&&(b%=7),Math.floor(b)},getHourCounter:function(){var a=this.digitize([this.getHours(),this.getMinutes(!0),this.get
4186Seconds(!0)]);return a},getHourly:function(){return this.getHourCounter()},getHours:function(a){var b=this.getTimeSeconds()/60/60;return a&&(b%=24),Math.floor(b)},getMilitaryTime:function(a,b){"undefined"==typeof b&&(b=!0),a||(a=this.getDateObject());var c=[a.getHours(),a.getMinutes()];return b===!0&&c.push(a.getSeconds()),this.digitize(c)},getMinutes:function(a){var b=this.getTimeSeconds()/60;return a&&(b%=60),Math.floor(b)},getMinuteCounter:function(){var a=this.digitize([this.getMinutes(),this.getSeconds(!0)]);return a},getTimeSeconds:function(a){return a||(a=new Date),this.time instanceof Date?this.factory.countdown?Math.max(this.time.getTime()/1e3-a.getTime()/1e3,0):a.getTime()/1e3-this.time.getTime()/1e3:this.time},getTime:function(a,b){"undefined"==typeof b&&(b=!0),a||(a=this.getDateObject()),console.log(a);var c=a.getHours(),d=[c>12?c-12:0===c?12:c,a.getMinutes()];return b===!0&&d.push(a.getSeconds()),this.digitize(d)},getSeconds:function(a){var b=this.getTimeSeconds();return a&&(60==b?b=0:b%=60),Math.ceil(b)},getWeeks:function(a){var b=this.getTimeSeconds()/60/60/24/7;return a&&(b%=52),Math.floor(b)},removeLeadingZeros:function(b,c){var d=0,e=[];return a.each(c,function(a,f){b>a?d+=parseInt(c[a],10):e.push(c[a])}),0===d?e:c},addSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()+a):this.time+=a},addSecond:function(){this.addSeconds(1)},subSeconds:function(a){this.time instanceof Date?this.time.setSeconds(this.time.getSeconds()-a):this.time-=a},subSecond:function(){this.subSeconds(1)},toString:function(){return this.getTimeSeconds().toString()}})}(jQuery),function(a){"use strict";FlipClock.Timer=FlipClock.Base.extend({callbacks:{destroy:!1,create:!1,init:!1,interval:!1,start:!1,stop:!1,reset:!1},count:0,factory:!1,interval:1e3,animationRate:1e3,constructor:function(a,b){this.base(b),this.factory=a,this.callback(this.callbacks.init),this.callback(this.callbacks.create)},getElapsed:function(){return this.count*this.interval},getElapsedTime:function(){return new Date(this.time+this.getElapsed())},reset:function(a){clearInterval(this.timer),this.count=0,this._setInterval(a),this.callback(this.callbacks.reset)},start:function(a){this.factory.running=!0,this._createTimer(a),this.callback(this.callbacks.start)},stop:function(a){this.factory.running=!1,this._clearInterval(a),this.callback(this.callbacks.stop),this.callback(a)},_clearInterval:function(){clearInterval(this.timer)},_createTimer:function(a){this._setInterval(a)},_destroyTimer:function(a){this._clearInterval(),this.timer=!1,this.callback(a),this.callback(this.callbacks.destroy)},_interval:function(a){this.callback(this.callbacks.interval),this.callback(a),this.count++},_setInterval:function(a){var b=this;b._interval(a),b.timer=setInterval(function(){b._interval(a)},this.interval)}})}(jQuery),function(a){FlipClock.TwentyFourHourClockFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b)},build:function(b){var c=this,d=this.factory.$el.find("ul");this.factory.time.time||(this.factory.original=new Date,this.factory.time=new FlipClock.Time(this.factory,this.factory.original));var b=b?b:this.factory.time.getMilitaryTime(!1,this.showSeconds);b.length>d.length&&a.each(b,function(a,b){c.createList(b)}),this.createDivider(),this.createDivider(),a(this.dividers[0]).insertBefore(this.lists[this.lists.length-2].$el),a(this.dividers[1]).insertBefore(this.lists[this.lists.length-4].$el),this.base()},flip:function(a,b){this.autoIncrement(),a=a?a:this.factory.time.getMilitaryTime(!1,this.showSeconds),this.base(a,b)}})}(jQuery),function(a){FlipClock.CounterFace=FlipClock.Face.extend({shouldAutoIncrement:!1,constructor:function(a,b){"object"!=typeof b&&(b={}),a.autoStart=b.autoStart?!0:!1,b.autoStart&&(this.shouldAutoIncrement=!0),a.increment=function(){a.countdown=!1,a.setTime(a.getTime().getTimeSeconds()+1)},a.decrement=function(){a.countdown=!0;var b=a.getTime().getTimeSeconds();b>0&&a.setTime(b-1)},a.setValue=function(b){a.setTime(b)},a.setCounter=function(b){a.setTime(b)},this.base(a,b)},build:function(){var b=this,c=this.factory.$el.find("ul"),d=this.factory.getTime().digitize([this.factory.getTime().time]);d.length>c.length&&a.each(d,function(a,c){var d=b.createList(c);d.select(c)}),a.each(this.lists,function(a,b){b.play()}),this.base()},flip:function(a,b){this.shouldAutoIncrement&&this.autoIncrement(),a||(a=this.factory.getTime().digitize([this.factory.getTime().time])),this.base(a,b)},reset:function(){this.factory.time=new FlipClock.Time(this.factory,this.factory.original?Math.round(this.factory.original):0),this.flip()}})}(jQuery),function(a){FlipClock.DailyCounterFace=FlipClock.Face.extend({showSeconds:!0,constructor:function(a,b){this.base(a,b)},build:function(b){var c=this,d=this.factory.$el.find("ul"),e=0;b=b?b:this.factory.time.getDayCounter(this.showSeconds),b.length>d.length&&a.each(b,function(a,b){c.createList(b)}),this.showSeconds?a(this.createDivider("Seconds")).insertBefore(this.lists[this.lists.length-2].$el):e=2,a(this.createDivider("Minutes")).insertBefore(this.lists[this.lists.length-4+e].$el),a(this.createDivider("Hours")).insertBefore(this.lists[this.lists.length-6+e].$el),a(this.createDivider("Days",!0)).insertBefore(this.lists[0].$el),this.base()},flip:function(a,b){a||(a=this.factory.time.getDayCounter(this.showSeconds)),this.autoIncrement(),this.base(a,b)}})}(jQuery),function(a){FlipClock.HourlyCounterFace=FlipClock.Face.extend({constructor:function(a,b){this.base(a,b)},build:function(b,c){var d=this,e=this.factory.$el.find("ul");c=c?c:this.factory.time.getHourCounter(),c.length>e.length&&a.each(c,function(a,b){d.createList(b)}),a(this.createDivider("Seconds")).insertBefore(this.lists[this.lists.length-2].$el),a(this.createDivider("Minutes")).insertBefore(this.lists[this.lists.length-4].$el),b||a(this.createDivider("Hours",!0)).insertBefore(this.lists[0].$el),this.base()},flip:function(a,b){a||(a=this.factory.time.getHourCounter()),this.autoIncrement(),this.base(a,b)},appendDigitToClock:function(a){this.base(a),this.dividers[0].insertAfter(this.dividers[0].next())}})}
4186(jQuery),function(a){FlipClock.MinuteCounterFace=FlipClock.HourlyCounterFace.extend({clearExcessDigits:!1,constructor:function(a,b){this.base(a,b)},build:function(){this.base(!0,this.factory.time.getMinuteCounter())},flip:function(a,b){a||(a=this.factory.time.getMinuteCounter()),this.base(a,b)}})}(jQuery),function(a){FlipClock.TwelveHourClockFace=FlipClock.TwentyFourHourClockFace.extend({meridium:!1,meridiumText:"AM",build:function(){var b=this.factory.time.getTime(!1,this.showSeconds);this.base(b),this.meridiumText=this.getMeridium(),this.meridium=a(['<ul class="flip-clock-meridium">',"<li>",'<a href="#">'+this.meridiumText+"</a>","</li>","</ul>"].join("")),this.meridium.insertAfter(this.lists[this.lists.length-1].$el)},flip:function(a,b){this.meridiumText!=this.getMeridium()&&(this.meridiumText=this.getMeridium(),this.meridium.find("a").html(this.meridiumText)),this.base(this.factory.time.getTime(!1,this.showSeconds),b)},getMeridium:function(){return(new Date).getHours()>=12?"PM":"AM"},isPM:function(){return"PM"==this.getMeridium()?!0:!1},isAM:function(){return"AM"==this.getMeridium()?!0:!1}})}(jQuery),function(a){FlipClock.Lang.Arabic={years:"سنوات",months:"شهور",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني"},FlipClock.Lang.ar=FlipClock.Lang.Arabic,FlipClock.Lang["ar-ar"]=FlipClock.Lang.Arabic,FlipClock.Lang.arabic=FlipClock.Lang.Arabic}(jQuery),function(a){FlipClock.Lang.Danish={years:"År",months:"Måneder",days:"Dage",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.da=FlipClock.Lang.Danish,FlipClock.Lang["da-dk"]=FlipClock.Lang.Danish,FlipClock.Lang.danish=FlipClock.Lang.Danish}(jQuery),function(a){FlipClock.Lang.German={years:"Jahre",months:"Monate",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden"},FlipClock.Lang.de=FlipClock.Lang.German,FlipClock.Lang["de-de"]=FlipClock.Lang.German,FlipClock.Lang.german=FlipClock.Lang.German}(jQuery),function(a){FlipClock.Lang.English={years:"Years",months:"Months",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},FlipClock.Lang.en=FlipClock.Lang.English,FlipClock.Lang["en-us"]=FlipClock.Lang.English,FlipClock.Lang.english=FlipClock.Lang.English}(jQuery),function(a){FlipClock.Lang.Spanish={years:"Años",months:"Meses",days:"Días",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.es=FlipClock.Lang.Spanish,FlipClock.Lang["es-es"]=FlipClock.Lang.Spanish,FlipClock.Lang.spanish=FlipClock.Lang.Spanish}(jQuery),function(a){FlipClock.Lang.Finnish={years:"Vuotta",months:"Kuukautta",days:"Päivää",hours:"Tuntia",minutes:"Minuuttia",seconds:"Sekuntia"},FlipClock.Lang.fi=FlipClock.Lang.Finnish,FlipClock.Lang["fi-fi"]=FlipClock.Lang.Finnish,FlipClock.Lang.finnish=FlipClock.Lang.Finnish}(jQuery),function(a){FlipClock.Lang.French={years:"Ans",months:"Mois",days:"Jours",hours:"Heures",minutes:"Minutes",seconds:"Secondes"},FlipClock.Lang.fr=FlipClock.Lang.French,FlipClock.Lang["fr-ca"]=FlipClock.Lang.French,FlipClock.Lang.french=FlipClock.Lang.French}(jQuery),function(a){FlipClock.Lang.Italian={years:"Anni",months:"Mesi",days:"Giorni",hours:"Ore",minutes:"Minuti",seconds:"Secondi"},FlipClock.Lang.it=FlipClock.Lang.Italian,FlipClock.Lang["it-it"]=FlipClock.Lang.Italian,FlipClock.Lang.italian=FlipClock.Lang.Italian}(jQuery),function(a){FlipClock.Lang.Latvian={years:"Gadi",months:"Mēneši",days:"Dienas",hours:"Stundas",minutes:"Minūtes",seconds:"Sekundes"},FlipClock.Lang.lv=FlipClock.Lang.Latvian,FlipClock.Lang["lv-lv"]=FlipClock.Lang.Latvian,FlipClock.Lang.latvian=FlipClock.Lang.Latvian}(jQuery),function(a){FlipClock.Lang.Dutch={years:"Jaren",months:"Maanden",days:"Dagen",hours:"Uren",minutes:"Minuten",seconds:"Seconden"},FlipClock.Lang.nl=FlipClock.Lang.Dutch,FlipClock.Lang["nl-be"]=FlipClock.Lang.Dutch,FlipClock.Lang.dutch=FlipClock.Lang.Dutch}(jQuery),function(a){FlipClock.Lang.Norwegian={years:"År",months:"Måneder",days:"Dager",hours:"Timer",minutes:"Minutter",seconds:"Sekunder"},FlipClock.Lang.no=FlipClock.Lang.Norwegian,FlipClock.Lang.nb=FlipClock.Lang.Norwegian,FlipClock.Lang["no-nb"]=FlipClock.Lang.Norweg
4186ian,FlipClock.Lang.norwegian=FlipClock.Lang.Norwegian}(jQuery),function(a){FlipClock.Lang.Portuguese={years:"Anos",months:"Meses",days:"Dias",hours:"Horas",minutes:"Minutos",seconds:"Segundos"},FlipClock.Lang.pt=FlipClock.Lang.Portuguese,FlipClock.Lang["pt-br"]=FlipClock.Lang.Portuguese,FlipClock.Lang.portuguese=FlipClock.Lang.Portuguese}(jQuery),function(a){FlipClock.Lang.Russian={years:"лет",months:"месяцев",days:"дней",hours:"часов",minutes:"минут",seconds:"секунд"},FlipClock.Lang.ru=FlipClock.Lang.Russian,FlipClock.Lang["ru-ru"]=FlipClock.Lang.Russian,FlipClock.Lang.russian=FlipClock.Lang.Russian}(jQuery),function(a){FlipClock.Lang.Swedish={years:"År",months:"Månader",days:"Dagar",hours:"Timmar",minutes:"Minuter",seconds:"Sekunder"},FlipClock.Lang.sv=FlipClock.Lang.Swedish,FlipClock.Lang["sv-se"]=FlipClock.Lang.Swedish,FlipClock.Lang.swedish=FlipClock.Lang.Swedish}(jQuery),function(a){FlipClock.Lang.Chinese={years:"年",months:"月",days:"日",hours:"时",minutes:"分",seconds:"秒"},FlipClock.Lang.zh=FlipClock.Lang.Chinese,FlipClock.Lang["zh-cn"]=FlipClock.Lang.Chinese,FlipClock.Lang.chinese=FlipClock.Lang.Chinese}(jQuery);
4187$siteURL=jQuery('#page').data("site-url");
4188$pinicon=jQuery('#singlepostmap').data('pinicon');
4189if($pinicon===""){
4190$pinicon=$siteURL + "wp-content/themes/listingpro/assets/images/pins/pin.png";
4191}
4192if(jQuery('#singlepostmap').length!=0){
4193$lat=jQuery('#singlepostmap').data("lat");
4194$lan=jQuery('#singlepostmap').data("lan");
4195"use strict";
4196$mtoken=jQuery('#page').data("mtoken");
4197$mtype=jQuery('#page').data("mtype");
4198if($mtype=='mapbox'||$mtype=='openstreet'){
4199var mapzoom_opn=17;
4200if(jQuery('body').is('.single-listing')){
4201mapzoom_opn=jQuery('body').data('mapzoom');
4202}
4203L.HtmlIcon=L.Icon.extend({
4204options: {
4205},
4206initialize: function(options){
4207L.Util.setOptions(this, options);
4208},
4209createIcon: function(){
4210var div=document.createElement('div');
4211div.innerHTML=this.options.html;
4212if(div.classList)
4213div.classList.add('leaflet-marker-icon');
4214else
4215div.className +=' ' + 'leaflet-marker-icon';
4216return div;
4217},
4218createShadow: function(){
4219return null;
4220}});
4221if($mtoken!=''&&$mtype=='mapbox'){
4222L.mapbox.accessToken=$mtoken;
4223var map=L.mapbox.map('singlepostmap')
4224.setView([$lat, $lan], mapzoom_opn);
4225L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
4226id: jQuery('#page').data("mstyle"),
4227accessToken: jQuery('#page').data("mtoken")
4228}).addTo(map);
4229}else if($mtype=='openstreet'){
4230var map=new L.Map('singlepostmap', '').setView(new L.LatLng($lat, $lan), mapzoom_opn);
4231L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
4232}
4233var markers=new L.MarkerClusterGroup();
4234var markerLocation=new L.LatLng($lat, $lan);
4235var CustomHtmlIcon=L.HtmlIcon.extend({
4236options: {
4237html: "<div class='lpmap-icon-shape pin '><div class='lpmap-icon-contianer'><img alt='image' src='" + $pinicon + "'  /></div></div>",
4238}});
4239var customHtmlIcon=new CustomHtmlIcon();
4240var marker=new L.Marker(markerLocation, { icon: customHtmlIcon }).bindPopup('').addTo(map);
4241markers.addLayer(marker);
4242map.fitBounds(markers.getBounds());
4243map.scrollWheelZoom.disable();
4244map.invalidateSize();
4245map.setZoom(mapzoom_opn);
4246}else{
4247if($lan!=''&&$lat!=''){
4248var mapzoom=17;
4249if(jQuery('body').is('.single-listing')){
4250mapzoom=jQuery('body').data('mapzoom');
4251}
4252function init(){
4253var e={ zoom: mapzoom, scrollwheel: !1, center: new google.maps.LatLng($lat, $lan), styles: [{ featureType: "administrative", elementType: "labels.text.fill", stylers: [{ color: "#444444" }] }, { featureType: "landscape", elementType: "all", stylers: [{ color: "#f2f2f2" }] }, { featureType: "poi", elementType: "all", stylers: [{ visibility: "off" }] }, { featureType: "road", elementType: "all", stylers: [{ saturation: -100 }, { lightness: 45 }] }, { featureType: "road.highway", elementType: "all", stylers: [{ visibility: "simplified" }] }, { featureType: "road.arterial", elementType: "labels.icon", stylers: [{ visibility: "off" }] }, { featureType: "transit", elementType: "all", stylers: [{ visibility: "off" }] }, { featureType: "water", elementType: "all", stylers: [{ color: "#b7ecf0" }, { visibility: "on" }] }] },
4254l=document.getElementById("singlepostmap"),
4255t=new google.maps.Map(l, e);
4256new google.maps.Marker({ position: new google.maps.LatLng($lat, $lan), icon: "" + $pinicon + "", map: t, title: "" })
4257}
4258google.maps.event.addDomListener(window, "load", init);
4259}}
4260}else{};
4261jQuery.noConflict();
4262setTimeout(function (){
4263if(jQuery('body').hasClass('home')){
4264var currentTOP=jQuery('.header-container header').height();
4265jQuery('.lp-header-search-wrap').css('top', '-' + currentTOP + 'px');
4266}
4267jQuery(".lp-header-search .lp-header-search-form form, .lp-header-search .lp-header-search-cats ul").show()
4268}, 600);
4269jQuery(function (){
4270var sidebarHeight=jQuery('.sidebar-top0').height(),
4271DesHeight=sidebarHeight - 200,
4272topHeader=jQuery('.lp-listing-top-title-header').height(),
4273minHeight=jQuery('.min-height-class').height(),
4274desHeightT=topHeader + minHeight,
4275minHeightT=sidebarHeight - DesHeight;
4276if(DesHeight >=sidebarHeight){
4277jQuery('.min-height-class').css('min-height', minHeightT);
4278}else{
4279minHeightT=sidebarHeight - topHeader + 140;
4280jQuery('.min-height-class').css('min-height', minHeightT);
4281}});
4282jQuery(document).ready(function (e){
4283if(jQuery('.list').hasClass('active')){
4284jQuery('.list').trigger('click');
4285}
4286if(jQuery('.lp-listing-top-title-header').length){
4287var top_title_header_height=jQuery('.lp-listing-top-title-header').height();
4288jQuery('.sidebar-top0').css('top', '-' + parseInt(top_title_header_height + 40) + 'px');
4289}
4290if(jQuery('#menu-placeholder-image').length){
4291var menu_placeholder_image=jQuery('#menu-placeholder-image').val();
4292var menu_chili_image=jQuery('#menu-chili-image').val();
4293if(menu_placeholder_image!=''){
4294jQuery('.lp-listing-menu-top').css('background', 'url(' + menu_placeholder_image + ')');
4295}
4296jQuery('.lp-listing-menuu-slide').each(function (index){
4297var $thisSlide=jQuery(this),
4298targetImg=$thisSlide.find('img'),
4299topImgSrc='';
4300jQuery(targetImg).each(function (imgIndex){
4301var loopImg=jQuery(this),
4302targetSrc=loopImg.attr('src');
4303if(targetSrc!=menu_placeholder_image&&targetSrc!=menu_chili_image){
4304topImgSrc=targetSrc;
4305}});
4306if(topImgSrc!=''){
4307$thisSlide.find('.lp-listing-menu-top').css('background', 'url(' + topImgSrc + ')');
4308}});
4309}
4310if(jQuery('#datepicker-lang').length){
4311var datepicker_lang=jQuery('#datepicker-lang').val();
4312jQuery.datepicker.regional[datepicker_lang];
4313}
4314if(jQuery('.loop-grid-clearfix').length > 0){
4315jQuery('.loop-grid-clearfix:nth-child(4)').after('<div class="clearfix"></div>');
4316}
4317jQuery('.claimformtrigger2').click(function (){
4318jQuery('.planclaim-page-popup').show();
4319})
4320jQuery('.lp-review-form-top-multi .lp-review-stars i').click(function (e){
4321if(jQuery('.lp-review-stars').hasClass('do-not-proceed')){
4322}else{
4323e.preventDefault();
4324jQuery('.lp-review-form-bottom').slideDown(500);
4325var ratingNum=jQuery(this).data('rating'),
4326colorCode='#de9147';
4327jQuery(this).closest('.lp-review-stars').addClass('do-not-proceed active-rating-avg' + ratingNum);
4328jQuery(this).removeClass('fa-star-o').addClass('fa-star');
4329jQuery(this).prevAll('.fa-star-o').removeClass('fa-star-o').addClass('fa-star');
4330jQuery(this).nextAll('.fa-star').removeClass('fa-star-o').addClass('fa-star-o');
4331if(ratingNum==2){
4332colorCode='#de9147';
4333}else if(ratingNum==3||ratingNum==4){
4334colorCode='#c5de35';
4335}else if(ratingNum==5){
4336colorCode='#73cf42';
4337}
4338jQuery('.lp-multi-rating-ui-wrap > .padding-left-0').each(function (){
4339jQuery(this).find('.lp-multi-rating-val').val(ratingNum);
4340jQuery(this).find('span:first').each(function (){
4341jQuery(this).addClass('active-stars-wrap');
4342jQuery(this).find('.rating-symbol').each(function (index){
4343if(index < ratingNum){
4344jQuery(this).find('.rating-symbol-foreground span').css('color', colorCode);
4345jQuery(this).find('.rating-symbol-foreground span').addClass('fa fa-star fa-2x');
4346jQuery(this).find('.rating-symbol-foreground').css('width', 'auto');
4347}});
4348});
4349});
4350}});
4351jQuery('.manage-group-types').click(function (e){
4352e.preventDefault();
4353window.location.replace(jQuery(this).data('url'));
4354});
4355jQuery('.show-more-event-content').click(function (e){
4356var showMore=jQuery(this).data('more'),
4357showLess=jQuery(this).data('less');
4358if(jQuery(this).hasClass('expanded')){
4359jQuery('.lp-evnt-content-container p').css('height', '31px');
4360jQuery(this).text(showMore);
4361jQuery(this).removeClass('expanded');
4362}else{
4363jQuery('.lp-evnt-content-container p').height('auto');
4364jQuery(this).addClass('expanded');
4365jQuery(this).text(showLess);
4366}});
4367jQuery(".header-cat-menu").hover(function (){
4368jQuery(this).find('#menu-category').addClass("show-cat-nav");
4369},
4370function (){
4371jQuery(this).find('#menu-category').removeClass("show-cat-nav");
4372}
4373);
4374if(jQuery('#lp-submit-form').length!=0){
4375var lp_custom_title='';
4376if(jQuery('#lp_custom_title').length!=0){
4377lp_custom_title=jQuery('#lp_custom_title').offset().top;
4378}
4379var inputAddress='';
4380if(jQuery('#inputAddress').length!=0){
4381inputAddress=jQuery('#inputAddress').offset().top;
4382}
4383var inputTagline='';
4384if(jQuery('#lptagline').length!=0){
4385inputTagline=jQuery('#lptagline').offset().top;
4386}
4387var inputCity='';
4388if(jQuery('#inputCity').length!=0){
4389inputCity=jQuery('#inputCity').offset().top;
4390}
4391if(jQuery('#citiess').length!=0){
4392inputCity=jQuery('#citiess').offset().top;
4393}
4394var inputPhone='';
4395if(jQuery('#inputPhone').length!=0){
4396inputPhone=jQuery('label[for="inputPhone"]').offset().top;
4397}
4398var inputWhatsapp='';
4399if(jQuery('#inputWhatsapp').length!=0){
4400inputWhatsapp=jQuery('label[for="inputWhatsapp"]').offset().top;
4401}
4402var inputWebsite='';
4403if(jQuery('#inputWebsite').length!=0){
4404inputWebsite=jQuery('#inputWebsite').offset().top;
4405}
4406var inputCategory='';
4407if(jQuery('label[for="inputCategory"]').length!=0){
4408inputCategory=jQuery('label[for="inputCategory"]').offset().top;
4409}
4410var price_status='';
4411if(jQuery('label[for="price_status"]').length!=0){
4412price_status=jQuery('label[for="price_status"]').offset().top;
4413}
4414var bussinTop='';
4415if(jQuery('.bussin-top').length!=0){
4416bussinTop=jQuery('.bussin-top').offset().top;
4417}
4418var socialMedia='';
4419if(jQuery('#socialMedia').length!=0){
4420socialMedia=jQuery('#socialMedia').offset().top;
4421}
4422if(jQuery('#get_media').length!=0){
4423socialMedia=jQuery('#get_media').offset().top;
4424}
4425var get_media_url='';
4426if(jQuery('#get_media_url').length!=0){
4427get_media_url=jQuery('#get_media_url').offset().top;
4428}
4429var inpuFaqsLp='';
4430if(jQuery('label[for="inpuFaqsLp"]').length!=0){
4431inpuFaqsLp=jQuery('label[for="inpuFaqsLp"]').offset().top;
4432}
4433var descTop='';
4434if(jQuery('.description-tip').length!=0){
4435descTop=jQuery('.description-tip').offset().top;
4436}
4437if(jQuery('label[for="inputDescription"]').length!=0){
4438descTop=jQuery('label[for="inputDescription"]').offset().top;
4439}
4440var postVideo='';
4441if(jQuery('#postVideo').length!=0){
4442postVideo=jQuery('#postVideo').offset().top;
4443}
4444var gallTop='';
4445if(jQuery('.lp-img-gall-upload-section').length!=0){
4446var gallTop=jQuery('.lp-img-gall-upload-section').offset().top;
4447}
4448var bLogoTop='';
4449if(jQuery('.b-logo-img-label').length!=0){
4450var bLogoTop=jQuery('.b-logo-img-label').offset().top;
4451}
4452var featTop='';
4453if(jQuery('.featured-img-label').length!=0){
4454featTop=jQuery('.featured-img-label').offset().top;
4455}
4456var quicktags='';
4457if(jQuery('#inputtagsquicktip').length > 0){
4458quicktags=jQuery('#inputtagsquicktip').offset().top;
4459}
4460if(jQuery('#inputTags').length > 0){
4461quicktags=jQuery('#inputTags').offset().top;
4462}
4463jQuery(window).scroll(function (e){
4464var scrollPos=jQuery(window).scrollTop() + 400;
4465if(scrollPos > lp_custom_title){
4466if(jQuery('#lptitle').length!=0){
4467jQuery('.quick-tip-inner').html(jQuery('#lptitle').data('quick-tip') + '<img alt="image" src="' + jQuery('#lptitle').data('img_src') + '" />');
4468}}
4469if(scrollPos > inputAddress){
4470if(jQuery('#inputAddress').length!=0){
4471jQuery('.quick-tip-inner').html(jQuery('#inputAddress').data('quick-tip') + '<img alt="image" src="' + jQuery('#inputAddress').data('img_addresssrc') + '" />');
4472}}
4473if(scrollPos > inputCity){
4474if(jQuery('#inputCity').length!=0){
4475jQuery('.quick-tip-inner').html(jQuery('#inputCity').data('quick-tip') + '<img alt="image" src="' + jQuery('#inputCity').data('cityimg') + '" />');
4476}else{
4477jQuery('.quick-tip-inner').html(jQuery('#citiess').data('quick-tip'));
4478}}
4479if(scrollPos > inputPhone){
4480if(jQuery('#inputPhone').length!=0){
4481jQuery('.quick-tip-inner').html(jQuery('#inputPhone').data('quick-tip') + '<img alt="image" src="' + jQuery('#inputPhone').data('phoneimg') + '" />');
4482}}
4483if(scrollPos > inputWebsite){
4484if(jQuery('#inputWebsite').length!=0){
4485jQuery('.quick-tip-inner').html(jQuery('#inputWebsite').data('quick-tip') + '<img alt="image" src="' + jQuery('#inputWebsite').data('webimg') + '" />');
4486}}
4487if(scrollPos > inputWhatsapp){
4488if(jQuery('#inputWhatsapp').length!=0){
4489jQuery('.quick-tip-inner').html(jQuery('#inputWhatsapp').data('quick-tip') + '<img alt="image" src="' + jQuery('#inputWhatsapp').data('whatsappimg') + '" />');
4490}}
4491if(scrollPos > inputCategory){
4492if(jQuery('#inputCategory').length!=0){
4493jQuery('.quick-tip-inner').html(jQuery('#inputCategory').data('quick-tip') + '<img alt="image" src="' + jQuery('#inputCategory').data('catimg') + '" />');
4494}}
4495if(scrollPos > price_status){
4496if(jQuery('#price_status').length!=0){
4497jQuery('.quick-tip-inner').html(jQuery('#price_status').data('quick-tip') + '<img alt="image" src="' + jQuery('#price_status').data('priceimg') + '" />');
4498}}
4499if(scrollPos > bussinTop){
4500if(jQuery('.bussin-top').length!=0){
4501jQuery('.quick-tip-inner').html(jQuery('.bussin-top').data('quick-tip') + '<img alt="image" src="' + jQuery('.bussin-top').data('hoursimg') + '" />');
4502}}
4503if(scrollPos > socialMedia){
4504if(jQuery('#socialMedia').length!=0){
4505jQuery('.quick-tip-inner').html(jQuery('#get_media').data('quick-tip') + '<img alt="image" src="' + jQuery('#socialMedia').data('socialimg') + '" />');
4506}}
4507if(scrollPos > inpuFaqsLp){
4508if(jQuery('#inpuFaqsLp').data('quick-tip')){
4509jQuery('.quick-tip-inner').html(jQuery('#inpuFaqsLp').data('quick-tip') + '<img alt="image" src="' + jQuery('#inpuFaqsLp').data('faqimg') + '" />');
4510}}
4511if(scrollPos > descTop){
4512if(jQuery('.description-tip').length > 0){
4513jQuery('.quick-tip-inner').html(jQuery('.description-tip').data('quick-tip') + '<img alt="image" src="' + jQuery('.description-tip').data('desimg') + '" />');
4514}}
4515if(scrollPos > quicktags){
4516if(jQuery('#inputTags').length > 0){
4517jQuery('.quick-tip-inner').html(jQuery('#inputTags').data('quick-tip'));
4518}else{
4519jQuery('.quick-tip-inner').html(jQuery('#inputtagsquicktip').data('quick-tip'));
4520}}
4521if(scrollPos > postVideo){
4522if(jQuery('#postVideo').length > 0){
4523jQuery('.quick-tip-inner').html(jQuery('#postVideo').data('quick-tip') + '<img alt="image" src="' + jQuery('#postVideo').data('videoimg') + '" />');
4524}}
4525if(scrollPos > gallTop){
4526if(jQuery('.lp-img-gall-upload-section').length > 0){
4527jQuery('.quick-tip-inner').html(jQuery('.lp-img-gall-upload-section').data('quick-tip') + '<img alt="image" src="' + jQuery('.lp-img-gall-upload-section').data('featureimg') + '" />');
4528}}
4529if(scrollPos > bLogoTop){
4530if(jQuery('.b-logo-img-label').length > 0){
4531jQuery('.quick-tip-inner').html(jQuery('.b-logo-img-label').data('quick-tip') + '<img alt="image" src="' + jQuery('.b-logo-img-label').data('blogoimg') + '" />');
4532}}
4533if(scrollPos > featTop){
4534if(jQuery('.featured-img-label').length > 0){
4535jQuery('.quick-tip-inner').html(jQuery('.featured-img-label').data('quick-tip') + '<img alt="image" src="' + jQuery('.featured-img-label').data('featureimg') + '" />');
4536}}
4537});
4538jQuery('#lp-submit-form input, #lp-submit-form textarea').on('focus', function (e){
4539var quickTip,
4540$this=jQuery(this);
4541if($this.attr('id')=='lptitle'){
4542quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#lptitle').data('img_src') + '" />';
4543jQuery('.quick-tip-inner').html(quickTip);
4544}
4545if($this.attr('id')=='inputAddress'){
4546quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#inputAddress').data('img_addresssrc') + '" />';
4547jQuery('.quick-tip-inner').html(quickTip);
4548}
4549if($this.attr('id')=='inputCity'){
4550quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#inputCity').data('cityimg') + '" />';
4551jQuery('.quick-tip-inner').html(quickTip);
4552}
4553if($this.attr('id')=='inputPhone'){
4554quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#inputPhone').data('phoneimg') + '" />';
4555jQuery('.quick-tip-inner').html(quickTip);
4556}
4557if($this.attr('id')=='inputWhatsapp'){
4558quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#inputWhatsapp').data('whatsappimg') + '" />';
4559jQuery('.quick-tip-inner').html(quickTip);
4560}
4561if($this.attr('id')=='inputWebsite'){
4562quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#inputWebsite').data('webimg') + '" />';
4563jQuery('.quick-tip-inner').html(quickTip);
4564}
4565if($this.attr('id')=='listingprice'){
4566quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#price_status').data('priceimg') + '" />';
4567jQuery('.quick-tip-inner').html(quickTip);
4568}
4569if($this.attr('id')=='listingptext'){
4570quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#price_status').data('priceimg') + '" />';
4571jQuery('.quick-tip-inner').html(quickTip);
4572}
4573if($this.attr('id')=='inpuFaqsLp'){
4574quickTip=$this.data('quick-tip');
4575if(quickTip=='undefined'||quickTip==''||quickTip==null){
4576jQuery('.quick-tip-inner').html('');
4577}else{
4578quickTip=quickTip + '<img alt="image" src="' + jQuery('#inpuFaqsLp').data('faqimg') + '" />';
4579jQuery('.quick-tip-inner').html(quickTip);
4580}}
4581if($this.attr('id')=='inputDescriptionFaq'){
4582quickTip=$this.data('quick-tip');
4583if(quickTip=='undefined'||quickTip==''||quickTip==null){
4584jQuery('.quick-tip-inner').html('');
4585}else{
4586quickTip=quickTip + '<img alt="image" src="' + jQuery('#inpuFaqsLp').data('faqimg') + '" />';
4587jQuery('.quick-tip-inner').html(quickTip);
4588}}
4589if($this.attr('id')=='postVideo'){
4590quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#postVideo').data('videoimg') + '" />';
4591jQuery('.quick-tip-inner').html(quickTip);
4592}});
4593jQuery('#price_status').on('chosen:showing_dropdown', function (){
4594var quickTip=jQuery(this).data('quick-tip') + '<img alt="image" src="' + jQuery('#price_status').data('priceimg') + '" />';
4595jQuery('.quick-tip-inner').html(quickTip);
4596});
4597jQuery('.b-logo-img-label, .featured-img-label, .lplistgallery').on('click', function (){
4598var $this=jQuery(this);
4599if($this.hasClass('lplistgallery')){
4600quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('.lp-img-gall-upload-section').data('featureimg') + '" />';
4601jQuery('.quick-tip-inner').html(quickTip);
4602}
4603if($this.hasClass('b-logo-img-label')){
4604quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('.b-logo-img-label').data('blogoimg') + '" />';
4605jQuery('.quick-tip-inner').html(quickTip);
4606}
4607if($this.hasClass('featured-img-label')){
4608quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('.featured-img-label').data('featureimg') + '" />';
4609jQuery('.quick-tip-inner').html(quickTip);
4610}});
4611jQuery('select.select2').on('select2:open', function (e){
4612var $this=jQuery(this);
4613if($this.attr('id')=='inputCategory'){
4614quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#inputCategory').data('catimg') + '" />';
4615jQuery('.quick-tip-inner').html(quickTip);
4616}
4617if($this.attr('id')=='get_media'){
4618quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#get_media').data('socialimg') + '" />';
4619jQuery('.quick-tip-inner').html(quickTip);
4620}
4621if($this.attr('id')=='socialMedia'){
4622quickTip=$this.data('quick-tip') + '<img alt="image" src="' + jQuery('#socialMedia').data('socialimg') + '" />';
4623jQuery('.quick-tip-inner').html(quickTip);
4624}});
4625}
4626if(jQuery('.page-style2-sidebar').length!=0){
4627var scrollState='';
4628var offset=jQuery('.page-style2-sidebar').offset().top - 50;
4629jQuery(window).scroll(function (event){
4630var scroll=jQuery(window).scrollTop();
4631if(offset >=scroll){
4632jQuery('.page-style2-sidebar').css({
4633'position': 'static',
4634'width': 'auto'
4635});
4636jQuery('.page-style2-sidebar').removeClass('style2-sidebar-fixed');
4637scrollState='scrolled';
4638}else{
4639var topMAr=10;
4640if(jQuery('.page-style2-sidebar').hasClass('logged-in')){
4641topMAr=50;
4642}
4643if(scrollState=='scrolled'){
4644jQuery('.page-style2-sidebar').addClass('style2-sidebar-fixed testClass');
4645scrollState='';
4646}}
4647});
4648}
4649var firstDay=jQuery('#start_of_weekk').val();
4650if(jQuery('#event-date-s').length){
4651var dateTodayy=new Date();
4652jQuery('#event-date-s').datepicker({
4653firstDay: firstDay,
4654minDate: dateTodayy,
4655dateFormat: 'mm/dd/yy',
4656onSelect: function (dateText, inst){
4657var inDate=new Date(jQuery(this).val());
4658jQuery("#event-date-e").datepicker('option', 'minDate', inDate);
4659}});
4660jQuery('#event-date-e').datepicker({
4661firstDay: firstDay,
4662minDate: dateTodayy,
4663dateFormat: 'mm/dd/yy'
4664});
4665}
4666var dateToday=new Date();
4667jQuery('.discount-date').datepicker({
4668firstDay: firstDay,
4669minDate: dateToday,
4670dateFormat: 'mm/dd/yy'
4671});
4672jQuery('.mobile-toggle-filters').click(function (e){
4673e.preventDefault();
4674jQuery('.filters-wrap-for-mobile').slideToggle(500);
4675});
4676jQuery('#lp-review-listing').on('select2:select', function (e){
4677var reviewStyle=jQuery('#reviews-nav-li').data('style'),
4678listID=jQuery('#lp-review-listing option:selected').val(),
4679authorID=jQuery('.lp-author-nav').data('author');
4680jQuery('#reviews').find('.author-inner-content-wrap').addClass('content-loading');
4681jQuery.ajax({
4682type: 'POST',
4683url: ajax_search_term_object.ajaxurl,
4684data: {
4685'action': 'author_review_tab_cb',
4686'reviewStyle': reviewStyle,
4687'listID': listID,
4688'authorID': authorID,
4689'lpNonce': jQuery('#lpNonce').val()
4690},
4691success: function (data){
4692jQuery('#reviews').find('.author-inner-content-wrap').removeClass('content-loading');
4693jQuery('#reviews').find('.author-inner-content-wrap').html(data);
4694}});
4695})
4696jQuery('.lp-author-nav li a').click(function (e){
4697e.preventDefault();
4698var $this=jQuery(this),
4699targetID=$this.attr('href'),
4700authorID=jQuery('.lp-author-nav').data('author'),
4701tabType='',
4702reviewStyle='',
4703listingLayout='';
4704if(targetID=='#reviews'){
4705tabType='reviews';
4706var reviewStyle=$this.data('style');
4707}else if(targetID=='#photos'){
4708tabType='photos';
4709}else if(targetID=='#aboutme'){
4710tabType='aboutme';
4711}else if(targetID=='#contact'){
4712tabType='contact';
4713}else if(targetID=='#mylistings'){
4714tabType='mylistings';
4715listingLayout=$this.data('listing-layout');
4716}
4717jQuery('.lp-author-nav li a.active').removeClass('active');
4718$this.addClass('active');
4719jQuery('.author-tab-content .active').removeClass('active').hide();
4720jQuery(targetID).addClass('active').show();
4721if($this.hasClass('data-available')){
4722return false;
4723}else{
4724jQuery(targetID).find('.author-inner-content-wrap').addClass('content-loading');
4725jQuery.ajax({
4726type: 'POST',
4727url: ajax_search_term_object.ajaxurl,
4728data: {
4729'action': 'author_archive_tabs_cb',
4730'tabType': tabType,
4731'reviewStyle': reviewStyle,
4732'authorID': authorID,
4733'listingLayout': listingLayout,
4734'lpNonce': jQuery('#lpNonce').val()
4735},
4736success: function (data){
4737jQuery(targetID).find('.author-inner-content-wrap').removeClass('content-loading');
4738jQuery(targetID).find('.author-inner-content-wrap').html(data);
4739$this.addClass('data-available');
4740jQuery('.author-contact-wrap').find('.lp-review-btn').attr('disabled', 'disabled');
4741jQuery('.author-contact-wrap input, .author-contact-wrap textarea').keyup(function (){
4742var name=jQuery('.author-contact-wrap input#name7').val();
4743var email=jQuery('.author-contact-wrap input#email7').val();
4744var phone=jQuery('.author-contact-wrap input#phone7').val();
4745var message=jQuery('.author-contact-wrap textarea#message7').val();
4746if(name.length > 0&&email.length > 0&&phone.length > 0&&message.length > 0){
4747jQuery('.author-contact-wrap').find('.lp-review-btn').removeAttr('disabled');
4748}else{
4749jQuery('.author-contact-wrap').find('.lp-review-btn').attr('disabled', 'disabled');
4750}});
4751jQuery('.author-contact-wrap .lp-review-btn').click(function (event){
4752event.preventDefault();
4753var $this=jQuery(this),
4754name=jQuery('.author-contact-wrap input#name7').val(),
4755email=jQuery('.author-contact-wrap input#email7').val(),
4756phone=jQuery('.author-contact-wrap input#phone7').val(),
4757message=jQuery('.author-contact-wrap textarea#message7').val(),
4758target_user_mail=jQuery('.mail_target_author').val();
4759jQuery('.author-contact-wrap').find('.lp-review-btn').attr('disabled', 'disabled');
4760jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').removeClass('fa-send');
4761jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').addClass('fa-spinner fa-spin');
4762jQuery('.author-contact-wrap input, .author-contact-wrap textarea').attr('disabled', 'disabled');
4763jQuery.ajax({
4764type: 'POST',
4765url: ajax_search_term_object.ajaxurl,
4766data: {
4767'action': 'send_author_mail',
4768'field-name': name,
4769'field-email': email,
4770'field-phone': phone,
4771'field-message': message,
4772'data-userMail': target_user_mail,
4773'lpNonce': jQuery('#lpNonce').val()
4774},
4775success: function (data){
4776jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').addClass('fa-check');
4777jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').removeClass('fa-spinner fa-spin');
4778setTimeout(function (){
4779jQuery('.author-contact-wrap').find('.lp-review-btn').removeAttr('disabled');
4780jQuery('.author-contact-wrap input, .author-contact-wrap textarea').removeAttr('disabled');
4781jQuery('.author-contact-wrap input#name7').val('');
4782jQuery('.author-contact-wrap input#email7').val('');
4783jQuery('.author-contact-wrap input#phone7').val('');
4784jQuery('.author-contact-wrap textarea#message7').val('');
4785jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').addClass('fa-send');
4786jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').removeClass('fa-check');
4787}, 2000);
4788},
4789});
4790return false;
4791});
4792}});
4793}});
4794jQuery('.author-inner-content-wrap .lp-pagination span').click(function (e){
4795var $this=jQuery(this);
4796var pageNum=jQuery(this).data('pageurl');
4797jQuery('span.current').removeClass('current');
4798jQuery('#content-grids').html('').addClass('content-loading');
4799jQuery.ajax({
4800type: 'POST',
4801url: ajax_search_term_object.ajaxurl,
4802data: {
4803'action': 'author_archive_listings_cb',
4804'pageNum': pageNum,
4805'lpNonce': jQuery('#lpNonce').val()
4806},
4807success: function (data){
4808$this.addClass('current');
4809jQuery('#content-grids').removeClass('content-loading').html(data);
4810}});
4811});
4812jQuery('.lp-header-nav-btn button').click(function (e){
4813if(jQuery('.lp-header-nav-btn').hasClass('active-can-menu')){
4814jQuery('.lp-header-nav-btn').removeClass('active-can-menu');
4815jQuery('#menu-categories-menu').css('opacity', '0');
4816jQuery('#menu-categories-menu').css('transform', 'scale(0)');
4817}else{
4818jQuery('#menu-categories-menu').css('opacity', '1');
4819jQuery('#menu-categories-menu').css('transform', 'scale(1)');
4820jQuery('.lp-header-nav-btn').addClass('active-can-menu');
4821}});
4822jQuery('.browse-imgs').click(function (e){
4823e.preventDefault();
4824jQuery('#filer_input2').trigger('click');
4825});
4826jQuery('.search-filter-response .loop-switch-class').last().find('.lp-listing').addClass('last');
4827jQuery('.lp-author-listings-wrap .loop-switch-class').last().find('.lp-listing').addClass('last');
4828jQuery('.lp-listing-announcement .announcement-wrap').last().addClass('last');
4829jQuery('.lp-review-form-top-multi .lp-listing-stars, .lp-review-images .browse-imgs, .lp-review-form-top-multi .lp-review-stars').click(function (e){
4830if(jQuery('.lp-review-form-bottom').hasClass('review-form-opened')){
4831}else{
4832jQuery('.lp-review-form-bottom').slideDown(500);
4833jQuery('.lp-review-form-bottom').addClass('review-form-opened');
4834}});
4835var topWidgetWrap=jQuery('.lp-widget-inner-wrap').first();
4836var lastWidgetWrap=jQuery('.lp-widget-inner-wrap').last();
4837if(topWidgetWrap.hasClass('lp-listing-timings')){
4838topWidgetWrap.find('.lp-today-timing').addClass('top-border-radius');
4839}else{
4840topWidgetWrap.addClass('top-border-radius');
4841}
4842if(lastWidgetWrap.hasClass('lp-listing-timings')){
4843lastWidgetWrap.find('.lp-today-timing').addClass('bottom-border-radius');
4844}else if(lastWidgetWrap.hasClass('singlemap')){
4845jQuery('.lp-widget-social-links').addClass('bottom-border-radius');
4846}else{
4847lastWidgetWrap.addClass('bottom-border-radius');
4848}
4849jQuery('.lp-dis-code-copy span').click(function (e){
4850var targetCodeEL=jQuery(this).data('target-code'),
4851targetCodeELC='.' + targetCodeEL;
4852var copyCode=jQuery(targetCodeELC).find('strong.copycode').text();
4853jQuery(targetCodeELC).find('input.codtopcopy').val(copyCode).select();
4854document.execCommand ("copy");
4855jQuery(this).html('<i class="fa fa-files-o" aria-hidden="true"></i> copied').delay(1000).show(500, function (e){
4856jQuery(targetCodeELC).fadeOut();
4857jQuery('.code-overlay').fadeOut();
4858});
4859});
4860jQuery('.close-copy-code').click(function (e){
4861e.preventDefault();
4862var targetCodeEL=jQuery(this).data('target-code'),
4863targetCodeELC='.' + targetCodeEL;
4864jQuery(targetCodeELC).fadeOut();
4865jQuery('.code-overlay').fadeOut();
4866});
4867jQuery('.header-more-filters .lp_all_page_overflow_after').click(function(){
4868jQuery('.lp-header-search-filters .header-more-filters').removeClass('hide-filters');
4869});
4870jQuery('.more-filters').click(function(){
4871jQuery('.lp-header-search-filters .header-more-filters').toggleClass('hide-filters');
4872});
4873function toggleIcon(e){
4874jQuery(e.target)
4875.prev('.faq-heading')
4876.find(".more-less")
4877.toggleClass('glyphicon-plus glyphicon-minus');
4878}
4879slickINIT();
4880if(jQuery('.listing-slider').length!=0){
4881jQuery('.listing-slider').slick({
4882infinite: true,
4883slidesToShow: 3,
4884slidesToScroll: 3,
4885prevArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
4886nextArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>",
4887responsive: [
4888{
4889breakpoint: 768,
4890settings: {
4891slidesToShow: 1,
4892slidesToScroll: 1,
4893infinite: true
4894}}
4895]
4896});
4897jQuery('.lp-listings .listing-slider').show();
4898}
4899if(jQuery('.lp-child-cats-tax-slider').length!=0){
4900var chilCatsLoc=jQuery('.lp-child-cats-tax-slider').data('child-loc'),
4901childCatNum=3;
4902if(chilCatsLoc=='fullwidth'){
4903childCatNum=5;
4904}
4905if(jQuery('.lp-child-cats-tax-wrap').length > childCatNum){
4906jQuery('.lp-child-cats-tax-slider').slick({
4907infinite: true,
4908slidesToShow: childCatNum,
4909slidesToScroll: 1,
4910prevArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
4911nextArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
4912});
4913}}
4914if(jQuery('.events-sidebar-wrap').length){
4915var eventsNum=jQuery('.events-sidebar-wrap').data('num');
4916if(eventsNum > 1){
4917jQuery('.events-sidebar-wrap').slick({
4918infinite: true,
4919slidesToShow: 1,
4920slidesToScroll: 1,
4921prevArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
4922nextArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>",
4923adaptiveHeight: true
4924});
4925}}
4926if(jQuery('.events-content-area-wrap').length){
4927function listingdetailpageevenslider(){
4928var eventsNum=jQuery('.events-content-area-wrap').data('num');
4929if(eventsNum > 2){
4930jQuery('.events-content-area-wrap').slick({
4931infinite: true,
4932slidesToShow: 2,
4933slidesToScroll: 1,
4934prevArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
4935nextArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
4936});
4937}}
4938listingdetailpageevenslider();
4939jQuery(document).on('click', '.lp-detailpage2-events-tab:not(.worked)', function (){
4940if(jQuery('.events-content-area-wrap').hasClass('slick-initialized')){
4941jQuery('.events-content-area-wrap').slick('destroy');
4942listingdetailpageevenslider();
4943}else{
4944listingdetailpageevenslider();
4945}
4946jQuery(this).addClass('worked');
4947});
4948}
4949if(jQuery('.events-element-content-area-wrap').length){
4950var eventsNum=jQuery('.events-element-content-area-wrap').data('num');
4951if(eventsNum > 3){
4952jQuery('.events-content-area-wrap').slick({
4953infinite: true,
4954slidesToShow: 3,
4955slidesToScroll: 1,
4956prevArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
4957nextArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
4958});
4959}}
4960if(jQuery('.app-view-new-ads-slider').length){
4961jQuery('.app-view-new-ads-slider').slick({
4962infinite: true,
4963slidesToShow: 1,
4964slidesToScroll: 1,
4965arrows: false,
4966autoplay: true
4967});
4968}
4969if(jQuery('.app-view2-banner-cat-slider').length){
4970jQuery('.app-view2-banner-cat-slider').slick({
4971infinite: true,
4972slidesToShow: 4,
4973slidesToScroll: 1,
4974arrows: false,
4975dots: false,
4976});
4977}
4978if(jQuery('.app-view2-location-container').length){
4979jQuery('.app-view2-location-container').slick({
4980infinite: true,
4981slidesToShow: 3,
4982slidesToScroll: 1,
4983arrows: false,
4984dots: false
4985});
4986}
4987if(jQuery('.lp-locations-slider').length!=0&&jQuery('.lp-locations-slider .lp-location-box').length > 6){
4988jQuery('.lp-locations-slider').slick({
4989infinite: true,
4990slidesToShow: 6,
4991slidesToScroll: 1,
4992nextArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
4993prevArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>",
4994responsive: [
4995{
4996breakpoint: 480,
4997settings: {
4998arrows: true,
4999centerMode: false,
5000centerPadding: '0px',
5001slidesToShow: 2
5002}}
5003]
5004});
5005}
5006jQuery('.sort-by-filter').hover(function (e){
5007e.preventDefault();
5008if(jQuery(this).hasClass('active-tooltip-filter')){
5009return false;
5010}
5011jQuery('.active-tooltip-filter').find('.sort-filter-inner').fadeOut(200);
5012jQuery('.active-tooltip-filter').removeClass('active-tooltip-filter');
5013jQuery(this).addClass('active-tooltip-filter');
5014jQuery(this).find('.sort-filter-inner').fadeIn(200);
5015})
5016jQuery('body').click(function (e){
5017if(e.target.id=="header-rated-filter"||e.target.id=="header-reviewed-filter"||e.target.id=="header-viewed-filter")
5018return;
5019if(jQuery('.sort-filter-inner').is(":visible")){
5020jQuery('.sort-filter-inner').fadeOut(200);
5021}
5022jQuery('.active-tooltip-filter').removeClass('active-tooltip-filter');
5023});
5024jQuery('.listing-view-layout ul li a').click(function (e){
5025e.preventDefault();
5026var $this=jQuery(this),
5027targetView='';
5028if($this.hasClass('list')){
5029targetView='list-style';
5030}
5031if($this.hasClass('grid')){
5032targetView='grid-style';
5033}
5034if(targetView=='grid-style'){
5035jQuery('.loop-switch-class').removeClass('col-md-12');
5036jQuery('.loop-switch-class').addClass('col-md-6');
5037jQuery('.loop-switch-class.listing-style-1').removeClass('col-md-6');
5038jQuery('.loop-switch-class.listing-style-1').addClass('col-md-4');
5039jQuery('.lp-listings.active-view').removeClass('list-style');
5040jQuery('.lp-listings.active-view').addClass('grid-style');
5041}
5042if(targetView=='list-style'){
5043jQuery('.loop-switch-class').removeClass('col-md-6');
5044jQuery('.loop-switch-class.listing-style-1').removeClass('col-md-4');
5045jQuery('.loop-switch-class').addClass('col-md-12');
5046jQuery('.lp-listings.active-view').addClass('list-style');
5047jQuery('.lp-listings.active-view').removeClass('grid-style');
5048}});
5049if(jQuery('.lp-listing-slider').length!=0){
5050var totalSlides=jQuery('.lp-listing-slider').attr('data-totalSlides'),
5051slidesToShow=3;
5052if(totalSlides==1){
5053slidesToShow=1;
5054}
5055if(totalSlides==2){
5056slidesToShow=2;
5057}
5058jQuery('.lp-listing-slider').slick({
5059infinite: true,
5060slidesToShow: slidesToShow,
5061slidesToScroll: 1,
5062prevArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>",
5063nextArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
5064responsive: [{
5065breakpoint: 480,
5066settings: {
5067arrows: true,
5068centerMode: false,
5069centerPadding: '0px',
5070slidesToShow: 2
5071}}]
5072});
5073jQuery('.lp-listing-slider').show();
5074}
5075if(jQuery('.listing-review-slider').length!=0){
5076var totalSlieds=jQuery('.listing-review-slider').attr('data-review-thumbs');
5077jQuery('.listing-review-slider').slick({
5078infinite: true,
5079slidesToShow: 4,
5080slidesToScroll: 1,
5081prevArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
5082nextArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
5083});
5084}
5085jQuery('.btn-link-field-toggle').click(function (e){
5086var dataTargetLink=jQuery(this).data('target-link');
5087jQuery('.btn-link-target').slideToggle(300);
5088jQuery(this).toggleClass('link-active');
5089var targetSwitch='input#' + dataTargetLink;
5090jQuery(targetSwitch).val('');
5091});
5092jQuery('.review-form-toggle, .lp-listing-review-form h2').click(function (e){
5093e.preventDefault();
5094jQuery('.lp-listing-review-form .lp-form-opener').hide();
5095jQuery('.lp-listing-review-form').find('i.fa-chevron-down, i.fa-chevron-up').toggleClass('fa-chevron-down fa-chevron-up');
5096jQuery('.lp-review-form-bottom').slideToggle(500);
5097jQuery('html,body').animate({
5098scrollTop: jQuery(".lp-listing-review-form").offset().top - 100
5099},
5100'slow');
5101});
5102jQuery('.lp-see-menu-btn').click(function (e){
5103e.preventDefault();
5104jQuery('html,body').animate({
5105scrollTop: jQuery(".lp-listing-menuu-wrap").offset().top - 120
5106},
5107'slow');
5108})
5109jQuery('.toggle-all-days').click(function (e){
5110e.preventDefault();
5111var leftColHeight=jQuery('.min-height-class').height(),
5112timingsIH=jQuery('.lp-listing-timings').height();
5113jQuery('.lp-today-timing.all-days-timings').slideToggle(200).toggleClass('days-opened');
5114var lessText=jQuery(this).data('contract');
5115var moreText=jQuery(this).data('expand');
5116setTimeout(function (){
5117var isOpened=jQuery('.lp-today-timing.all-days-timings').is('.days-opened');
5118if(isOpened===true){
5119var timingsOH=jQuery('.lp-listing-timings').height(),
5120leftColHeightN=leftColHeight + timingsOH;
5121jQuery('.min-height-class').css('min-height', leftColHeightN + 'px');
5122jQuery('.toggle-all-days').html('<i class="fa fa-minus" aria-hidden="true"></i> ' + lessText);
5123}else{
5124var leftColHeightN=leftColHeight - timingsIH;
5125jQuery('.min-height-class').css('min-height', leftColHeightN + 'px');
5126jQuery('.toggle-all-days').html('<i class="fa fa-plus" aria-hidden="true"></i> ' + moreText);
5127}}, 150);
5128});
5129jQuery('.toggle-all-days2').click(function (e){
5130e.preventDefault();
5131var leftColHeight=jQuery('.min-height-class').height(),
5132timingsIH=jQuery('.lp-listing-timings').height();
5133jQuery('.lp-today-timing.all-days-timings').slideToggle(200).toggleClass('days-opened');
5134setTimeout(function (){
5135var isOpened=jQuery('.lp-today-timing.all-days-timings').is('.days-opened');
5136if(isOpened===true){
5137var timingsOH=jQuery('.lp-listing-timings').height(),
5138leftColHeightN=leftColHeight + timingsOH;
5139jQuery('.min-height-class').css('min-height', leftColHeightN + 'px');
5140}else{
5141var leftColHeightN=leftColHeight - timingsIH;
5142jQuery('.min-height-class').css('min-height', leftColHeightN + 'px');
5143}}, 150);
5144});
5145jQuery('.toggle-additional-details').click(function (e){
5146e.preventDefault();
5147jQuery('.additional-detail-hidden').slideToggle(200).toggleClass('details-opened');
5148var lessText=jQuery(this).data('contract');
5149var moreText=jQuery(this).data('expand');
5150var leftColHeight=jQuery('.min-height-class').height(),
5151additoinalIH=jQuery('.lp-listing-additional-details').height();
5152setTimeout(function (){
5153var isOpened=jQuery('.additional-detail-hidden').is('.details-opened');
5154if(isOpened===true){
5155var additoinalOH=jQuery('.lp-listing-additional-details').height(),
5156leftColHeightN=(leftColHeight + additoinalOH) - 360;
5157jQuery('.min-height-class').css('min-height', leftColHeightN + 'px');
5158jQuery('.toggle-additional-details').html('<i class="fa fa-minus" aria-hidden="true"></i> ' + lessText);
5159}else{
5160var leftColHeightN=(leftColHeight - additoinalIH) + 360;
5161jQuery('.min-height-class').css('min-height', leftColHeightN + 'px');
5162jQuery('.toggle-additional-details').html('<i class="fa fa-plus" aria-hidden="true"></i> ' + moreText);
5163}}, 150);
5164});
5165jQuery('.lp-listing-faqs').on('hidden.bs.collapse', toggleIcon);
5166jQuery('.lp-listing-faqs').on('shown.bs.collapse', toggleIcon);
5167jQuery(document).on('click', '.add-to-fav-v2', function (e){
5168e.preventDefault()
5169$this=jQuery(this);
5170$this.find('i').addClass('fa-spin fa-spinner');
5171var val=jQuery(this).data('post-id');
5172var type=jQuery(this).data('post-type');
5173jQuery.ajax({
5174type: 'POST',
5175dataType: 'json',
5176url: ajax_search_term_object.ajaxurl,
5177data: {
5178'action': 'listingpro_add_favorite_v2',
5179'post-id': val,
5180'type': type,
5181'lpNonce': jQuery('#lpNonce').val()
5182},
5183success: function (data){
5184if(data){
5185if(data.active=='yes'){
5186$this.find('i').removeClass('fa-spin fa-spinner');
5187if(data.type=='grid'||data.type=='list'){
5188$this.find('i').removeClass('fa-heart-o');
5189$this.find('i').addClass('fa-heart');
5190}else{
5191var successText=$this.data('success-text');
5192$this.find('span').text(successText);
5193$this.html('<i class="fa fa-bookmark" aria-hidden="true"></i> ' + data.text);
5194}
5195$this.removeClass('add-to-fav-v2');
5196$this.addClass('remove-fav-v2');
5197}}
5198}});
5199});
5200jQuery(document).on('click', '.remove-fav-v2', function (e){
5201e.preventDefault();
5202var val=jQuery(this).data('post-id');
5203var type=jQuery(this).data('post-type');
5204jQuery(this).find('i').removeClass('fa-close');
5205jQuery(this).find('i').addClass('fa-spinner fa-spin');
5206$this=jQuery(this);
5207jQuery.ajax({
5208type: 'POST',
5209dataType: 'json',
5210url: ajax_search_term_object.ajaxurl,
5211data: {
5212'action': 'listingpro_remove_favorite_v2',
5213'post-id': val,
5214'type': type,
5215'lpNonce': jQuery('#lpNonce').val()
5216},
5217success: function (data){
5218if(data){
5219if(data.remove=='yes'){
5220$this.find('i').removeClass('fa-spin fa-spinner');
5221if(data.type=='grid'||data.type=='list'){
5222$this.find('i').addClass('fa-heart-o');
5223}else{
5224$this.html('<i class="fa-regular fa-bookmark-o" aria-hidden="true"></i> ' + data.text);
5225}
5226if(jQuery('.page-template-template-favourites').length!=0){
5227$this.closest(".lp-grid-box-contianer").fadeOut();
5228}
5229$this.removeClass('remove-fav-v2');
5230$this.addClass('add-to-fav-v2');
5231}}
5232}});
5233});
5234var social=jQuery('.lp-listing-action-btns ul li div.social-icons.post-socials');
5235var socialOvrly=jQuery('.lp-listing-action-btns ul li .md-overlay');
5236jQuery('.lp-single-sharing').on('click', function (event){
5237event.preventDefault();
5238social.fadeIn(400);
5239if(socialOvrly.hasClass('hide')){
5240jQuery(socialOvrly).removeClass('hide');
5241jQuery(socialOvrly).addClass('show');
5242}else{
5243jQuery(socialOvrly).removeClass('show');
5244jQuery(socialOvrly).addClass('hide');
5245}});
5246socialOvrly.on('click', function (event){
5247event.preventDefault();
5248social.hide();
5249if(socialOvrly.hasClass('show')){
5250jQuery(socialOvrly).removeClass('show');
5251jQuery(socialOvrly).addClass('hide');
5252}else{
5253jQuery(socialOvrly).removeClass('hide');
5254jQuery(socialOvrly).addClass('show');
5255}});
5256jQuery(document).on('click', '.lp-review-right-bottom .review-reaction, .lp-activity-description .review-reaction', function (e){
5257e.preventDefault();
5258if(jQuery(this).hasClass('active-now')){
5259return false;
5260}
5261reviewID='';
5262ajaxResErr='';
5263var $this=jQuery(this);
5264$this.addClass('active-now');
5265reviewID=$this.data('id'),
5266currentVal=$this.data('score'),
5267restype=$this.data('restype');
5268$this.find('span.react-count').html('<i class="fa fa-spinner fa-spin"></i>');
5269jQuery.ajax({
5270type: 'POST',
5271dataType: 'json',
5272url: ajax_review_object.ajaxurl,
5273data: {
5274action: 'lp_reviews_interests',
5275interest: currentVal,
5276restype: restype,
5277id: reviewID,
5278'lpNonce': jQuery('#lpNonce').val()
5279},
5280success: function (res){
5281if(res.errors=="no"){
5282ajaxResErr='no';
5283var newscore=res.newScore;
5284$this.data('score', newscore);
5285$this.find('span.react-count').html(newscore);
5286$this.find('span.react-msg').text(res.statuss).fadeIn(500).delay(2000).fadeOut(500);
5287if(restype=='interesting'){
5288$this.css({
5289'background-color': '#417cdf',
5290'color': '#fff'
5291});
5292$this.find('span.react-count').css({ 'color': '#fff' });
5293}else if(restype=='lol'){
5294$this.css({
5295'background-color': '#ff8e29',
5296'color': '#fff'
5297});
5298$this.find('span.react-count').css({ 'color': '#fff' });
5299}else if(restype=='love'){
5300$this.css({
5301'background-color': '#ff2357',
5302'color': '#fff'
5303});
5304$this.find('span.react-count').css({ 'color': '#fff' });
5305}
5306currentVal=false;
5307}else{
5308ajaxResErr='yes';
5309var newscore=res.newScore;
5310$this.find('span.react-count').text(newscore);
5311$this.find('span.react-msg').text(res.statuss).fadeIn(500).delay(2000).fadeOut(500);
5312}
5313$this.removeClass('active-now');
5314},
5315error: function (request, error){
5316alert(error);
5317}});
5318e.preventDefault();
5319});
5320jQuery(document).on('click', '#add-menu-image_btn', function (e){
5321e.preventDefault();
5322var $this=jQuery(this);
5323var userID=$this.data('uid'),
5324img_Url=jQuery(this).closest('.add-menu_image').find('#selected_image_menu_url').val(),
5325selected_list_Id=jQuery('#add_image_menu').val();
5326if((selected_list_Id=='0')||(img_Url=='')){
5327$this.closest('.add-menu_image').append('<p class="add_img_menu_error">Something Went Wrong</p>');
5328return false;
5329}
5330jQuery('#add-menu-img-spinner').show();
5331jQuery.ajax({
5332type: 'POST',
5333dataType: 'json',
5334url: ajax_search_term_object.ajaxurl,
5335data: {
5336'action': 'add_image_menu',
5337'userID': userID,
5338'img_Url': img_Url,
5339'selected_list_Id': selected_list_Id,
5340'lpNonce': jQuery('#lpNonce').val()
5341},
5342success: function (res){
5343jQuery('.add_img_menu_error').remove();
5344$this.closest('.ordering-service-wrap').find('ul.listing_append_img_menu').append('<li class="clearfix"><a class="pull-left online_ordring_list_title" target="_blank" href="' + res.selected_list_Link + '">' + res.selected_list_Title + '</a><span data-uid="' + userID + '" data-target="' + selected_list_Id + '" class="pull-right del_img_menu"><i class="fa fa-trash fa-spinner"></i></span></li>');
5345jQuery('.add-new-service_img_menu .jFiler-input-choose-btn').text('Browse File');
5346jQuery('#add-menu-img-spinner').hide();
5347$this.closest('.add-menu_image').find('#selected_image_menu_url').val('');
5348$this.closest('.add-menu_image').find('#selected_image_menu_url').text('Select Listing');
5349jQuery('#add_image_menu').val('');
5350jQuery('.no-img_menu').hide();
5351},
5352error: function (err){
5353alert(err);
5354jQuery('#add-menu-img-spinner').hide();
5355}});
5356});
5357jQuery(document).on('click', '.add-menu_image .jFiler-input-choose-btn', function (){
5358jQuery('#selected_image_menu_url').val('');
5359});
5360jQuery(document).on('click', '.del_img_menu', function (e){
5361e.preventDefault();
5362var $this=jQuery(this);
5363var userID=$this.data('uid'),
5364target=$this.data('target');
5365$this.find('i.fa-spinner').removeClass('fa-trash');
5366$this.find('i.fa-spinner').addClass('fa-spin');
5367jQuery.ajax({
5368type: 'POST',
5369dataType: 'json',
5370url: ajax_search_term_object.ajaxurl,
5371data: {
5372'action': 'del_add_image_menu',
5373'userID': userID,
5374'target': target,
5375'lpNonce': jQuery('#lpNonce').val()
5376},
5377success: function (res){
5378console.log(res);
5379$this.closest("li").remove();
5380},
5381error: function (err){
5382alert(err);
5383}});
5384});
5385jQuery(document).on('click', '.lp-edit-menu', function (e){
5386e.preventDefault();
5387var $this=jQuery(this),
5388userID=$this.data('uid'),
5389LID=$this.data('lid'),
5390menuID=$this.data('menuid'),
5391mTitle=jQuery('#menu-title-' + menuID).val(),
5392mDetail=jQuery('#menu-detail-' + menuID).val(),
5393mOldPrice=jQuery('#menu-old-price-' + menuID).val(),
5394mNewPrice=jQuery('#menu-new-price-' + menuID).val(),
5395mQuoteT=jQuery('#menu-quote-text-' + menuID).val(),
5396mQuoteL=jQuery('#menu-quote-link-' + menuID).val(),
5397mLink=jQuery('#menu-link-' + menuID).val(),
5398mGroup=jQuery('#menu-group-' + menuID).val(),
5399mType=jQuery('#menu-type-' + menuID).val(),
5400mImage=jQuery('.edit-upload-' + menuID + ' .frontend-input').val(),
5401multipleImage=jQuery('.upload-field.dashboard-upload-field.edit-upload-' + menuID).data('multiple');
5402sItem=jQuery('#lp-menus').data('sitem');
5403sPrice=jQuery('#lp-menus').data('sprice');
5404if(jQuery('.frontend-input-multiple').length > 0&&multipleImage===true){
5405mImage=jQuery('.edit-upload-' + menuID + ' .frontend-input-multiple').val();
5406}
5407popularItem='';
5408if(jQuery('.menu_Popular_Item-' + menuID).is(':checked')){
5409popularItem='mItemPopularTrue';
5410}else{
5411popularItem='mItemPopularfalse';
5412}
5413var spiceLVL=jQuery('.menuSpice-control-' + menuID + ' option:selected').data('level');
5414if(spiceLVL=='1'){
5415spiceLVL='spicelvl1';
5416}else if(spiceLVL=='2'){
5417spiceLVL='spicelvl2';
5418}else if(spiceLVL=='3'){
5419spiceLVL='spicelvl3';
5420}else if(spiceLVL=='4'){
5421spiceLVL='spicelvl4';
5422}else{
5423spiceLVL='spicelvlunset';
5424}
5425$this.append('<i class="fa fa-spin fa-spinner"></i>');
5426jQuery.ajax({
5427type: 'POST',
5428dataType: 'json',
5429url: ajax_search_term_object.ajaxurl,
5430data: {
5431'action': 'add_menu_cb',
5432'user_id': userID,
5433'LID': LID,
5434'menuID': menuID,
5435'mTitle': mTitle,
5436'mDetail': mDetail,
5437'mOldPrice': mOldPrice,
5438'mNewPrice': mNewPrice,
5439'mQuoteT': mQuoteT,
5440'mQuoteL': mQuoteL,
5441'mLink': mLink,
5442'mImage': mImage,
5443'mType': mType,
5444'mGroup': mGroup,
5445'popularItem': popularItem,
5446'spiceLVL': spiceLVL,
5447'menuUp': 'yes',
5448'lpNonce': jQuery('#lpNonce').val()
5449},
5450success: function (res){
5451var menu_id=$this.data('menuid');
5452console.log(res);
5453jQuery('.active-update-formm').slideUp();
5454$this.find('i').remove();
5455jQuery('#menu-update-' + menuID).closest('.lp-menu-close-outer').find('.lp-menu-closed').find('h4.lp-right-side-title').html('<span>' + sItem + '</span><br>
5455' + mTitle);
5456jQuery('#menu-update-' + menuID).closest('.lp-menu-close-outer').find('.lp-menu-closed').find('.col-md-2.price').html('<span>' + sPrice + '</span><br>' + mOldPrice);
5457},
5458error: function (err){
5459alert(err);
5460$this.find('i').remove();
5461}});
5462});
5463if(jQuery('#selected_image_menu_url').length!=0){
5464jQuery(document).on('click', function (e){
5465var jqhiddeninputfeild=jQuery('#selected_image_menu_url').val();
5466var jqtriggerforcheck=jQuery('#selected_image_menu_url').hasClass('.frontend-input-multiple');
5467if(jqtriggerforcheck=true){
5468var asd=jQuery('.add-new-service_img_menu .jFiler-input-choose-btn').text();
5469if(jqhiddeninputfeild!=''){
5470var lastFive=jqhiddeninputfeild.substr(jqhiddeninputfeild.length - 13);
5471var finalcom='...' + lastFive;
5472if(asd!=finalcom){
5473var string=finalcom.substr(0, 15);
5474jQuery('.add-new-service_img_menu .jFiler-input-choose-btn').text(string);
5475return false;
5476}}
5477}});
5478}
5479jQuery(function (){
5480jQuery(document).on('change', '.coupons-fields-switch input[type="checkbox"]', function (e){
5481var targetID=jQuery(this).data('target');
5482if(targetID=='quote-button'){
5483if(jQuery(this).is(':checked')){
5484jQuery('#menu-old-price').val('');
5485jQuery('#menu-new-price').val('');
5486jQuery('#menu-quote-text').val('');
5487jQuery('#menu-quote-link').val('');
5488}}
5489});
5490});
5491jQuery(document).on('click', '#lp-save-menu', function (e){
5492e.preventDefault();
5493var $this=jQuery(this),
5494userID=$this.data('uid'),
5495mTitle=jQuery('#menu-title').val(),
5496mDetail=jQuery('#menu-detail').val(),
5497mOldPrice=jQuery('#menu-old-price').val(),
5498mNewPrice=jQuery('#menu-new-price').val(),
5499mQuoteT=jQuery('#menu-quote-text').val(),
5500mQuoteL=jQuery('#menu-quote-link').val(),
5501mListing=jQuery('#menu-listing').val(),
5502mLink=jQuery('#menu-link').val(),
5503mImage=jQuery('.new-file-upload .frontend-input').val(),
5504mType=jQuery('#lp-menus .panel-heading li.active').text(),
5505mGroup=jQuery('#menu-group').val(),
5506orderP='',
5507orderU='',
5508calcPrice='',
5509popularItem='';
5510sItem=jQuery('#lp-menus').data('sitem');
5511sGroup=jQuery('#lp-menus').data('sgroup');
5512sPrice=jQuery('#lp-menus').data('sprice');
5513sEdit=jQuery('#lp-menus').data('sedit');
5514sDelete=jQuery('#lp-menus').data('sdelete');
5515sQuote=jQuery('#lp-menus').data('squote');
5516sLink=jQuery('#lp-menus').data('slink');
5517sRprice=jQuery('#lp-menus').data('srprice');
5518sSprice=jQuery('#lp-menus').data('ssprice');
5519sMitem=jQuery('#lp-menus').data('smitem');
5520sDesc=jQuery('#lp-menus').data('sdesc');
5521sPop=jQuery('#lp-menus').data('spop');
5522sSpice=jQuery('#lp-menus').data('sspice');
5523sCancel=jQuery('#lp-menus').data('scancel');
5524sSave=jQuery('#lp-menus').data('ssave');
5525sPexquote=jQuery('#lp-menus').data('spexquote');
5526sPprice=jQuery('#lp-menus').data('spprice');
5527sPtitle=jQuery('#lp-menus').data('sptitle');
5528sUrl=jQuery('#lp-menus').data('surl');
5529if(jQuery('.menu_Popular_Item').is(':checked')){
5530popularItem='mItemPopularTrue';
5531}else{
5532popularItem='mItemPopularfalse';
5533}
5534if(jQuery('.menu_Popular_Item').is(':checked')){
5535popularItem='mItemPopularTrue';
5536}else{
5537popularItem='mItemPopularfalse';
5538}
5539var spiceLVL=jQuery('.menuSpice-control option:selected').data('level');
5540if(spiceLVL=='1'){
5541spiceLVL='spicelvl1';
5542}else if(spiceLVL=='2'){
5543spiceLVL='spicelvl2';
5544}else if(spiceLVL=='3'){
5545spiceLVL='spicelvl3';
5546}else if(spiceLVL=='4'){
5547spiceLVL='spicelvl4';
5548}else{
5549spiceLVL='spicelvlunset';
5550}
5551if(mNewPrice.length > 0){
5552calcPrice=mNewPrice;
5553}else{
5554calcPrice=mOldPrice;
5555}
5556if(mImage==''&&jQuery('.new-file-upload .frontend-input-multiple').length!=0){
5557mImage=jQuery('.new-file-upload .frontend-input-multiple').val();
5558}
5559if(mListing==''||mListing==null||mListing==0){
5560jQuery('#select2-menu-listing-container').addClass('error');
5561jQuery('#menu-listing').addClass('error');
5562}else{
5563jQuery('#select2-menu-listing-container').removeClass('error');
5564jQuery('#menu-listing').removeClass('error');
5565}
5566if(mTitle==''){
5567jQuery('#menu-title').addClass('error');
5568}else{
5569jQuery('#menu-title').removeClass('error');
5570}
5571if(mDetail==''){
5572jQuery('#menu-detail').addClass('error');
5573}else{
5574jQuery('#menu-detail').removeClass('error');
5575}
5576if(mType==''||mType==0||mType==null){
5577jQuery('select#menu-type').next('.select2-container').addClass('error');
5578}else{
5579jQuery('select#menu-type').next('.select2-container').removeClass('error');
5580}
5581if(mGroup==''||mGroup==0||mGroup==null){
5582jQuery('select#menu-group').next('.select2-container').addClass('error');
5583}else{
5584jQuery('select#menu-group').next('.select2-container').removeClass('error');
5585}
5586if(mDetail==''||mTitle==''||(mType==''&&mType==0||mType==null)||(mGroup==''&&mGroup==0||mGroup==null)||mListing==''||mListing==null||mListing==0){
5587var dataError=[];
5588dataError.status='error';
5589dataError.msg=jQuery('.lp-notifaction-area').data('error-msg');
5590ajax_success_popup(dataError, $this);
5591return false;
5592}
5593var QpriceTog=false;
5594if(jQuery('.coupons-fields-switch input[type="checkbox"]').is(':checked')){
5595QpriceTog=true;
5596}
5597$this.append('<i class="fa fa-spin fa-spinner"></i>');
5598$this.attr('disabled', 'disabled');
5599jQuery.ajax({
5600type: 'POST',
5601dataType: 'json',
5602url: ajax_search_term_object.ajaxurl,
5603data: {
5604'action': 'add_menu_cb',
5605'user_id': userID,
5606'mTitle': mTitle,
5607'mDetail': mDetail,
5608'mOldPrice': mOldPrice,
5609'mNewPrice': mNewPrice,
5610'mQuoteT': mQuoteT,
5611'mQuoteL': mQuoteL,
5612'mListing': mListing,
5613'mLink': mLink,
5614'mImage': mImage,
5615'mType': mType,
5616'mGroup': mGroup,
5617'orderP': orderP,
5618'orderU': orderU,
5619'popularItem': popularItem,
5620'spiceLVL': spiceLVL,
5621'showQute': QpriceTog,
5622'lpNonce': jQuery('#lpNonce').val()
5623},
5624success: function (res){
5625jQuery('.lp-menu-close-outer').prepend('<input type="hidden" id="lp-showQOrP" value="' + QpriceTog + '">');
5626if(res.menu_after_update[mType][mGroup]){
5627var menuLength=parseInt(res.menu_after_update[mType][mGroup].length - 1);
5628}else{
5629location.reload(true);
5630}
5631jQuery('#menu-group').val(null).trigger('change');
5632var type_rep=mType.replace(/ /g, '-');
5633var grp_rep=mGroup[0].replace(/ /g, '-');
5634var listid=mListing;
5635var menu_id=type_rep + '_' + grp_rep + '_' + menuLength + '_' + listid;
5636var regmQuoteT='';
5637var mQuoteLinK='';
5638var $menu_price_check='';
5639if(jQuery('#lp-showQOrP').val()=='true'){
5640regmQuoteT='<div class="col-sm-6">' +
5641'<label class="lp-dashboard-top-label" for="menu-quote-text-' + menu_id + '">Quote Text</label>' +
5642'<input id="menu-quote-text-' + menu_id + '"     type="text"   class="form-control lp-dashboard-text-field"    value="' + mQuoteT + '"    placeholder="Ex: Quote">' +
5643'</div>';
5644mQuoteLinK='<div class="col-sm-6">' +
5645'<label class="lp-dashboard-top-label" for="menu-quote-link-' + menu_id + '">Quote Link</label>' +
5646'<input id="menu-quote-link-' + menu_id + '"           type="text"          class="form-control lp-dashboard-text-field"            value="' + mQuoteL + '"              placeholder="Ex: hht://yourweb.com/page">' +
5647'</div>';
5648}
5649if(jQuery('#lp-showQOrP').val()=='false'){
5650$menu_price_check='<div class="menu-price-wrap">' +
5651'<div class="col-sm-2 padding-left-0">' +
5652'<label class="lp-dashboard-top-label" for="menu-old-price-' + menu_id + '">Reg. Price</label>' +
5653'<input name="menu-old-price-' + menu_id + '"  id="menu-old-price-' + menu_id + '"  type="text" class="form-control lp-dashboard-text-field" placeholder="Ex: $10" value="' + mOldPrice + '">' +
5654'</div>' +
5655'<div class="col-sm-2 padding-left-0">' +
5656'<label class="lp-dashboard-top-label" for="menu-new-price-' + menu_id + '">Sale Price</label>' +
5657'<input id="menu-new-price-' + menu_id + '"  name="menu-new-price-' + menu_id + '"  type="text"  class="form-control lp-dashboard-text-field"  placeholder="Ex: $10"  value="' + mNewPrice + '">' +
5658'</div>' +
5659'</div>';
5660}
5661var checkedpoP='';
5662if(popularItem=='mItemPopularTrue'){
5663checkedpoP='checked';
5664}
5665var selected_spicelvl1='';
5666var selected_spicelvl2='';
5667var selected_spicelvl3='';
5668var selected_spicelvl4='';
5669if(spiceLVL=='spicelvl1'){
5670selected_spicelvl1='selected';
5671}else if(spiceLVL=='spicelvl2'){
5672selected_spicelvl2='selected';
5673}else if(spiceLVL=='spicelvl3'){
5674selected_spicelvl3='selected';
5675}else if(spiceLVL=='spicelvl4'){
5676selected_spicelvl4='selected';
5677}
5678var imagedivvar='';
5679if(mImage!=''){
5680imagedivvar='<div class="menu-edit-img-wrap gal-img-count-single">' +
5681'<span data-src="' + mImage + '" data-target="dis-old-img-' + menu_id + '" class="remove-menu-img"><i class="fa fa-close"></i></span>' +
5682'<img class="gal-img-count-single lp-uploaded-img event-old-img-' + menu_id + '" src="' + mImage + '" alt="image">' +
5683'</div>';
5684}
5685var html='<div class="lp-menu-close-outer">' +
5686'<div class="lp-menu-closed clearfix ">' +
5687'<div class="row">' +
5688'<div class="col-md-6"><i class="fa fa-check-circle fa-check-circle2" aria-hidden="true"></i><h4 class="lp-right-side-title"><span>' + sItem + '</span><br>' + mTitle + '</h4></div>' +
5689'<div class="col-md-2"><span>' + sGroup + '</span><br>' + mGroup + '</div>' +
5690'<div class="col-md-2 price"><span>' + sPrice + '</span><br>' + calcPrice + '</div>' +
5691'<div class="col-md-2"><span class="lp-dot-extra-buttons"><i class="fa fa-ellipsis-v" aria-hidden="true"></i>' +
5692'<ul class="lp-user-menu list-style-none">' +
5693'<li><a class="edit-menu-item" data-menuID="' + menu_id + '" data-uid="' + userID + '" href=""><i class="fa fa-pencil" aria-hidden="true"></i><span>' + sEdit + '</span></a></li>' +
5694'<li><a href="" class="menu-del del-this" data-LID="' + mListing + '" data-targetid="' + menu_id + '" data-uid="' + userID + '"><i class="fa fa-trash" aria-hidden="true"></i><span>' + sDelete + '</span></a></li>' +
5695'</ul>' +
5696'</span></div>' +
5697'</div>' +
5698'</div>' +
5699'<div id="menu-update-' + menu_id + '" class="lp-menu-form-outer background-white" style="display: none">' +
5700'<div class="lp-menu-form-inner">' +
5701'<form class="row">' +
5702'<input value="' + mType + '" type="hidden" id="menu-type-' + menu_id + '" name="menu-type-' + menu_id + '">' +
5703'<input type="hidden" value="' + mGroup + '" id="menu-group-' + menu_id + '" name="menu-group-' + menu_id + '">' +
5704'<div class="col-sm-12 margin-top-10">' +
5705'<div class="lp-menu-form-feilds">' +
5706'<div class="row clearfix">' +
5707'<div class="col-md-12">' +
5708'<div class="row">' +
5709'<div class="margin-bottom-10 col-md-8">' +
5710'<label class="lp-dashboard-top-label" for="menu-title-' + menu_id + '">' + sMitem + '</label>' +
5711'<input name="menu-title-' + menu_id + '"  id="menu-title-' + menu_id + '"  type="text"  class="form-control lp-dashboard-text-field" placeholder="' + sPtitle + '" value="' + mTitle + '">' +
5712'</div>' + $menu_price_check +
5713'<div class="menu-quote-wrap clearfix margin-bottom-20">' +
5714regmQuoteT +
5715mQuoteLinK +
5716'</div>' +
5717'</div>' +
5718'<div class="margin-bottom-30">' +
5719'<label class="lp-dashboard-top-label" for="menu-detail-' + menu_id + '">' + sDesc + '</label>' +
5720'<textarea name="menu-detail-' + menu_id + '" id="menu-detail-' + menu_id + '" type="text" class="form-control lp-dashboard-des-field" rows="3" placeholder="' + sPtitle + '">' + mDetail + '</textarea>' +
5721'</div>' +
5722'</div>' +
5723'<div class="lp-invoices-all-stats-on-off clearfix margin-bottom-10 Popular_item_container">' +
5724'<label class="switch">' +
5725'<input ' + checkedpoP + ' value="Yes" class="form-control switch-checkbox menu_Popular_Item-' + menu_id + '" type="checkbox" name="lp_form_fields_inn[235]">' +
5726'<div class="slider round"></div>' +
5727'</label>' +
5728'<span class="margin-left-10" style="font-size: 16px!important;font-weight: normal!important;">' + sPop + '</span>' +
5729'</div>' +
5730'<div class="clearfix margin-bottom-10 menuSpice-control_containter">' +
5731'<select style="width: 100%!important;margin-left: 0;" id="menuSpice-control" class="form-control menuSpice-control-' + menu_id + '">' +
5732'<option>' + sSpice + '</option>' +
5733'<option data-level="1" ' + selected_spicelvl1 + ' >🌶</option>' +
5734'<option data-level="2" ' + selected_spicelvl2 + ' >🌶🌶</option>' +
5735'<option data-level="3" ' + selected_spicelvl3 + ' >🌶🌶🌶</option>' +
5736'</select>' +
5737'</div>' +
5738'<div class="col-md-12">' +
5739'<div class="jFiler-input-dragDrop pos-relative event-featured-image-wrap-dash">' +
5740'<div class="upload-field dashboard-upload-field edit-upload-' + menu_id + '">' +
5741'<input class="frontend-input-multiple" type="hidden" id="dis-old-img-' + menu_id + '" value="' + mImage + '">' +
5742'<input type="hidden" value="' + mImage + '" class="frontend-input" name="frontend_input"><label><a class="jFiler-input-choose-btn blue">Browse File</a><input class="frontend-button" type="button" value="" style="position: relative; z-index: 1;"> </label><div class="clearfix"></div><img class="frontend-image" alt="image">    ' +
5743'<div class="menu-edit-imgs-wrap" >' +
5744imagedivvar +
5745'</div>' +
5746'</div>' +
5747'</div>' +
5748'</div>' +
5749'</div>' +
5750'</div>' +
5751'</div>' +
5752'<div class="clearfix"></div>' +
5753'<div class="lp-menu-save-btns clearfix col-md-12 margin-bottom-20">' +
5754'<button class="lp-cancle-btn cancel-update-menu">' + sCancel + '</button>' +
5755'<button data-LID="' + mListing + '" data-menuID="' + menu_id + '"  data-uid="' + userID + '"  class="lp-save-btn lp-edit-menu">' + sSave + '</button>' +
5756'</div>' +
5757'</form>' +
5758'</div>' +
5759'</div>' +
5760'<div>';
5761jQuery('.panel-body.lp-panel-body-outer.lp-menu-panel-body-outer .tab-content.lp-tab-content-outer .tab-pane.fade.in.active').append(html);
5762$this.find('i.fa.fa-spin.fa-spinner').remove();
5763$this.removeAttr('disabled');
5764jQuery('.menu-edit-imgs-wrap .frontend-input-multiple').val('');
5765$this.closest('#menu-form-toggle').find('.lp-menu-close-outer.lp-menu-open').slide
5765Up();
5766$this.attr('id', 'lp-save-menu-reopen');
5767jQuery('#menu-title').val('');
5768jQuery('#menu-detail').val('');
5769jQuery('#menu-old-price').val('');
5770jQuery('#menu-new-price').val('');
5771jQuery('#menu-quote-text').val('');
5772jQuery('#menu-quote-link').val('');
5773jQuery('#menu-link').val('');
5774jQuery('.new-file-upload .frontend-input').val('');
5775jQuery('.new-file-upload .frontend-image').hide('slow');
5776},
5777error: function (err){
5778console.log(err);
5779$this.find('i').remove();
5780$this.removeAttr('disabled');
5781var dataError=[];
5782dataError.status='error';
5783dataError.msg=jQuery('.lp-notifaction-area').data('error-msg');
5784ajax_success_popup(dataError, $this);
5785}});
5786});
5787jQuery('.add-new-open-form').click(function (e){
5788e.preventDefault();
5789var targetForm='#' + jQuery(this).data('form') + '-form-toggle';
5790jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-11').fadeOut("fast", function (){
5791jQuery(targetForm).fadeIn("fast", function (){
5792jQuery(".lp-blank-section").fadeOut();
5793});
5794});
5795});
5796jQuery('.lp-blank-section .add-new-open-form').click(function (e){
5797e.preventDefault();
5798var targetForm='#' + jQuery(this).data('form') + '-form-toggle';
5799jQuery(targetForm).fadeIn("fast", function (){
5800jQuery(".lp-blank-section").fadeOut();
5801});
5802});
5803var targetPlanMetaKey='menu';
5804if(jQuery('.select2-ajax').length!=0){
5805targetPlanMetaKey=jQuery('.select2-ajax').data('metakey');
5806var noResultsText=jQuery('#select2-ajax-noresutls').val(),
5807inputShortText=jQuery('#select2-ajax-tooshort').val(),
5808searchingText=jQuery('#select2-ajax-searching').val();
5809}
5810jQuery('.select2-ajax').select2({
5811ajax: {
5812url: ajax_search_term_object.ajaxurl,
5813dataType: 'json',
5814type: 'GET',
5815data: function (params){
5816return {
5817q: params.term,
5818targetPlanMetaKey: targetPlanMetaKey,
5819action: 'select2_ajax_dashbaord_listing'
5820};},
5821processResults: function (data){
5822var options=[];
5823var disabled_opts=false;
5824if(data){
5825jQuery.each(data, function (index, text){
5826var disabled_opts=false;
5827if(text[2]=='yes'){
5828disabled_opts=true;
5829}
5830options.push({ id: text[0], text: text[1], disabled: disabled_opts });
5831});
5832}
5833return {
5834results: options
5835};},
5836cache: true
5837},
5838minimumInputLength: 3,
5839language: {
5840inputTooShort: function (){
5841return inputShortText;
5842},
5843noResults: function (){
5844return noResultsText;
5845},
5846searching: function (){
5847return searchingText;
5848}}
5849});
5850if(jQuery('.select2-ajaxx').length!=0){
5851var noResultsText=jQuery('#select2-ajax-noresutls').val(),
5852inputShortText=jQuery('#select2-ajax-tooshort').val(),
5853searchingText=jQuery('#select2-ajax-searching').val();
5854}
5855jQuery('.lp-search-listing-camp').select2({
5856ajax: {
5857url: ajax_search_term_object.ajaxurl,
5858dataType: 'json',
5859type: 'GET',
5860data: function (params){
5861return {
5862q: params.term,
5863action: 'select2_ajax_dashbaord_listing_camp'
5864};
5865console.log(params);
5866},
5867processResults: function (data){
5868var options=[];
5869if(data){
5870jQuery.each(data, function (index, text){
5871options.push({ id: text[0], text: text[1] });
5872});
5873}
5874return {
5875results: options
5876};},
5877cache: true
5878},
5879minimumInputLength: 3,
5880language: {
5881inputTooShort: function (){
5882return inputShortText;
5883},
5884noResults: function (){
5885return noResultsText;
5886},
5887searching: function (){
5888return searchingText;
5889}}
5890});
5891var uniqueMetaKey='event_id';
5892var planmetakey='events';
5893if(jQuery('.select2-ajax-unique').length!=0){
5894uniqueMetaKey=jQuery('.select2-ajax-unique').data('metakey');
5895planmetakey=jQuery('.select2-ajax-unique').data('planmetakey');
5896var noResultsText=jQuery('#select2-ajax-noresutls').val(),
5897inputShortText=jQuery('#select2-ajax-tooshort').val(),
5898searchingText=jQuery('#select2-ajax-searching').val();
5899}
5900jQuery('.select2-ajax-unique').select2({
5901ajax: {
5902url: ajax_search_term_object.ajaxurl,
5903dataType: 'json',
5904type: 'GET',
5905data: function (params){
5906return {
5907q: params.term,
5908uniqueMetaKey: uniqueMetaKey,
5909planmetakey: planmetakey,
5910action: 'select2_ajax_dashbaord_listing_unique'
5911};},
5912processResults: function (data){
5913var options=[];
5914if(data){
5915jQuery.each(data, function (index, text){
5916var disabled_opts=false;
5917if(text[2]=='yes'){
5918disabled_opts=true;
5919}
5920options.push({ id: text[0], text: text[1], disabled: disabled_opts });
5921});
5922}
5923return {
5924results: options
5925};},
5926cache: true
5927},
5928minimumInputLength: 3,
5929language: {
5930inputTooShort: function (){
5931return inputShortText;
5932},
5933noResults: function (){
5934return noResultsText;
5935},
5936searching: function (){
5937return searchingText;
5938}}
5939});
5940jQuery('#ad-announcement-btn').on('click', function (e){
5941e.preventDefault();
5942var $this=jQuery(this),
5943userID=$this.data('uid'),
5944annMsg=jQuery('#announcements-message').val(),
5945annBT=jQuery('#announcements-btn-text').val(),
5946annBL=jQuery('#announcements-btn-link').val(),
5947annLI=jQuery('#announcements-listing').val(),
5948annSt=jQuery('#ann-style').find(':selected').val(),
5949annIC=jQuery('#announcements-icon').val(),
5950annType='',
5951annTI=jQuery('#announcements-title').val();
5952if(annIC!=''){
5953var annType=jQuery('#announcements-icon').attr('icon-type');
5954}
5955if(annLI==0||annLI==''||annLI==null){
5956jQuery('#select2-announcements-listing-container').addClass('error');
5957jQuery('#announcements-listing').addClass('error');
5958}else{
5959jQuery('#select2-announcements-listing-container').removeClass('error');
5960jQuery('#announcements-listing').removeClass('error');
5961}
5962if(annMsg==''){
5963jQuery('#announcements-message').addClass('error');
5964}else{
5965jQuery('#announcements-message').removeClass('error');
5966}
5967if(annTI==''){
5968jQuery('#announcements-title').addClass('error');
5969}else{
5970jQuery('#announcements-title').removeClass('error');
5971}
5972if(annLI==0||annLI==''||annTI==''||annMsg==''||annLI==0||annLI==''||annLI==null){
5973var dataError=[];
5974dataError.status='error';
5975dataError.msg=jQuery('.lp-notifaction-area').data('error-msg');
5976ajax_success_popup(dataError, $this);
5977$this.find('i').remove();
5978return false;
5979}
5980if($this.hasClass('processing-ann')){
5981}else{
5982$this.append('<i class="fa fa-spin fa-spinner"></i>');
5983$this.addClass('processing-ann');
5984jQuery.ajax({
5985type: 'POST',
5986dataType: 'json',
5987url: ajax_search_term_object.ajaxurl,
5988data: {
5989'action': 'add_announcements_cb',
5990'user_id': userID,
5991'annSt': annSt,
5992'annMsg': annMsg,
5993'annBT': annBT,
5994'annBL': annBL,
5995'annLI': annLI,
5996'annTI': annTI,
5997'annIC': annIC,
5998'annType': annType,
5999'lpNonce': jQuery('#lpNonce').val()
6000},
6001success: function (res){
6002ajax_success_popup(res, $this);
6003},
6004error: function (err){
6005$this.find('i').remove();
6006}});
6007}});
6008jQuery('#ann-style').on('change', function (e){
6009var $this=jQuery(this),
6010$thisDes=$this.find(':selected').attr('data-des'),
6011$thisTI=$this.find(':selected').attr('data-title'),
6012$thisIC=$this.find(':selected').attr('data-icon'),
6013$thisBT=$this.find(':selected').text(),
6014$thisST=$this.find(':selected').attr('data-st');
6015jQuery('.announcement-wrap span').text($thisDes);
6016jQuery('#announcements-message').val($thisDes);
6017jQuery('.announcement-wrap a').text($thisBT);
6018jQuery('.announcement-wrap strong').text($thisTI);
6019jQuery('#announcements-btn-text').val($thisBT);
6020jQuery('#announcements-title').val($thisTI);
6021jQuery('.announcement-wrap i').removeClass();
6022jQuery('.announcement-wrap i').addClass($thisIC);
6023jQuery('.field-desc strong').text($thisDes.length);
6024})
6025jQuery('.ann-style-wrap span').click(function (e){
6026var $this=jQuery(this),
6027$thisWrap=$this.closest('.ann-style-wrap'),
6028$thislabel=$this.closest('label'),
6029$thisDes=$this.data('des'),
6030$thisBT=$this.data('bt');
6031$thisWrap.find('input[name="ann-style"]:checked').removeAttr('checked');
6032$thisWrap.find('.ann-style-val').val($thislabel.find('input').val());
6033$thislabel.find('input').attr('checked', true);
6034jQuery('.announcement-wrap span, #announcements-message').text($thisDes);
6035jQuery('.announcement-wrap a').text($thisBT);
6036jQuery('#announcements-btn-text').val($thisBT);
6037});
6038jQuery(document).on('click', '#lp-save-dis', function (e){
6039e.preventDefault();
6040var $this=jQuery(this),
6041userID=$this.data('uid'),
6042disHea=jQuery('#dis-heading').val(),
6043disCod=jQuery('#dis-code').val(),
6044disExpE=jQuery('#dis-expiry-e').val(),
6045disExpS=jQuery('#dis-expiry-s').val(),
6046disTimeE=jQuery('#dis-time-e').val(),
6047disTimeS=jQuery('#dis-time-s').val(),
6048disBT=jQuery('#dis-btn-text').val(),
6049disBL=jQuery('#dis-btn-link').val(),
6050disLI=jQuery('#dis-listing').val(),
6051disImg=jQuery('.new-file-upload .frontend-input').val(),
6052disOff=jQuery('#dis-off').val(),
6053disDes=jQuery('#dis-description').val();
6054if(disOff==''||disOff==null){
6055disOff=jQuery('div#lp-percent #dis-off').val();
6056}
6057if(disLI==0||disLI==''||disLI==null){
6058jQuery('#select2-dis-listing-container').addClass('error');
6059jQuery('#dis-listing').addClass('error');
6060}else{
6061jQuery('#select2-dis-listing-container').removeClass('error');
6062jQuery('#dis-listing').removeClass('error');
6063}
6064if(disHea==''){
6065jQuery('#dis-heading').addClass('error');
6066}else{
6067jQuery('#dis-heading').removeClass('error');
6068}
6069if(disExpS==''){
6070jQuery('#dis-expiry-s').addClass('error');
6071}else{
6072jQuery('#dis-expiry-s').removeClass('error');
6073}
6074if(disTimeS==''){
6075jQuery('#dis-time-s').addClass('error');
6076}else{
6077jQuery('#dis-time-s').removeClass('error');
6078}
6079if(disLI==0||disLI==''||disLI==null||disHea==''||disExpS==''||disTimeS==''){
6080var dataError=[];
6081dataError.status='error';
6082dataError.msg=jQuery('.lp-notifaction-area').data('error-msg');
6083ajax_success_popup(dataError, $this);
6084$this.find('i').removeClass('fa-spin fa-spinner');
6085return false;
6086}
6087if($this.hasClass('processing-dis')){
6088}else{
6089$this.addClass('processing-dis');
6090$this.append('<i class="fa fa-spin fa-spinner"></i>');
6091jQuery.ajax({
6092type: 'POST',
6093dataType: 'json',
6094url: ajax_search_term_object.ajaxurl,
6095data: {
6096'action': 'add_discount_cb',
6097'user_id': userID,
6098'disHea': disHea,
6099'disCod': disCod,
6100'disExpE': disExpE,
6101'disExpS': disExpS,
6102'disTimeE': disTimeE,
6103'disTimeS': disTimeS,
6104'disBT': disBT,
6105'disBL': disBL,
6106'disLI': disLI,
6107'disDes': disDes,
6108'disOff': disOff,
6109'disImg': disImg,
6110'disSta': 'active',
6111'lpNonce': jQuery('#lpNonce').val()
6112},
6113success: function (res){
6114ajax_success_popup(res, $this);
6115},
6116error: function (err){
6117alert(err);
6118$this.find('i').remove();
6119}});
6120}});
6121jQuery(document).on('click', '#lp-save-offer', function (e){
6122e.preventDefault();
6123var $this=jQuery(this),
6124userID=$this.data('uid'),
6125offerTitle=jQuery('#offer-title').val(),
6126offerDes=jQuery('#offer-description').val(),
6127offerExp=jQuery('#offer-expriry').val(),
6128offerBT=jQuery('#offer-btn-text').val(),
6129offerBL=jQuery('#offer-btn-link').val(),
6130offerImg=jQuery('#frontend-input').val(),
6131offerLI=jQuery('#offer-listing').val();
6132if(!jQuery('.btn-link-field-toggle').hasClass('link-active')){
6133offerBL='';
6134}
6135$this.append('<i class="fa fa-spin fa-spinner"></i>');
6136if(offerLI==null||offerLI==''||offerTitle==''||offerExp==''){
6137jQuery('.ann-err-msg').fadeIn(500).delay(1500).fadeOut(500);
6138$this.find('i').remove();
6139return false;
6140}
6141jQuery.ajax({
6142type: 'POST',
6143dataType: 'json',
6144url: ajax_search_term_object.ajaxurl,
6145data: {
6146'action': 'add_offer_cb',
6147'user_id': userID,
6148'offerTitle': offerTitle,
6149'offerDes': offerDes,
6150'offerExp': offerExp,
6151'offerBT': offerBT,
6152'offerBL': offerBL,
6153'offerLI': offerLI,
6154'offerImg': offerImg,
6155'lpNonce': jQuery('#lpNonce').val()
6156},
6157success: function (res){
6158console.log(res);
6159$this.find('i').removeClass('fa-spin fa-spinner');
6160$this.find('i').addClass('fa fa-check');
6161location.reload();
6162},
6163error: function (err){
6164alert(err);
6165$this.find('i').remove();
6166}});
6167});
6168jQuery(document).on('click', '.del-this', function (e){
6169e.preventDefault();
6170jQuery('.remove-active').removeClass('remove-active');
6171jQuery(this).addClass('remove-active');
6172jQuery('#dashboard-delete-modal').modal('show');
6173jQuery('.modal-backdrop').hide();
6174});
6175jQuery(document).on('click', '.dashboard-confirm-del-btn', function (e){
6176var $this=jQuery('.remove-active');
6177if($this.hasClass('del-all-menu')){
6178var lid=$this.data('lid'),
6179user_id=$this.data('uid');
6180jQuery(this).append('<i class="fa fa-spin fa-spinner" style="margin-left: 5px;"></i>');
6181jQuery.ajax({
6182type: 'POST',
6183dataType: 'json',
6184url: ajax_search_term_object.ajaxurl,
6185data: {
6186'action': 'del_all_menu_cb',
6187'user_id': user_id,
6188'lid': lid,
6189'lpNonce': jQuery('#lpNonce').val()
6190},
6191success: function (res){
6192if(res.status=='success'){
6193location.reload();
6194}
6195$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
6196},
6197error: function (err){
6198console.log(err);
6199$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
6200}});
6201}else{
6202var targetID=$this.data('targetid'),
6203userID=$this.data('uid'),
6204delType='',
6205delIDS='',
6206dellAll='';
6207if($this.hasClass('dis-del')){
6208delType='dis';
6209}
6210if($this.hasClass('event-del')){
6211delType='event';
6212}
6213if($this.hasClass('ann-del')){
6214delType='ann';
6215}
6216if($this.hasClass('offer-del')){
6217delType='offer';
6218delIDS=$this.data('del-ids');
6219}
6220if($this.hasClass('menu-del')){
6221delType='menu';
6222delIDS=$this.data('lid');
6223}
6224if($this.hasClass('del-type')){
6225delType='type';
6226dellAll=jQuery('input[name="delete-group-type"]:checked').val();
6227}
6228if($this.hasClass('del-group')){
6229delType='group';
6230dellAll=jQuery('input[name="delete-group-type"]:checked').val();
6231}
6232jQuery(this).append('<i class="fa fa-spin fa-spinner" style="margin-left: 5px;"></i>');
6233jQuery.ajax({
6234type: 'POST',
6235dataType: 'json',
6236url: ajax_search_term_object.ajaxurl,
6237data: {
6238'action': 'del_ann_dis_menu_cb',
6239'user_id': userID,
6240'delType': delType,
6241'targetID': targetID,
6242'delIDS': delIDS,
6243'dellAll': dellAll,
6244'lpNonce': jQuery('#lpNonce').val()
6245},
6246success: function (res){
6247if(res.status=='success'){
6248if(delType=='menu'){
6249jQuery('.menu-del[data-targetid="' + targetID + '"]').closest('.lp-menu-close-outer').remove();
6250jQuery('#dashboard-delete-modal').modal('hide');
6251jQuery('.dashboard-confirm-del-btn').find('i').remove();
6252}else{
6253jQuery('#dashboard-delete-modal').modal('hide');
6254location.reload();
6255}}
6256$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
6257},
6258error: function (err){
6259console.log(err);
6260$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
6261}});
6262}});
6263jQuery(document).on('click', 'a.event-edit, a.menu-edit, a.ann-edit, a.dis-edit, a.offer-edit', function (e){
6264e.preventDefault();
6265var $this=jQuery(this),
6266targetID=$this.data('targetid'),
6267updateWrap='#update-wrap-' + targetID;
6268if(jQuery('.active-update-form').length!=0){
6269jQuery('.active-update-form').slideUp(500, function (e){
6270jQuery('.active-update-form').removeClass('active-ann-form');
6271jQuery(updateWrap).slideToggle('500', function (e){
6272jQuery(updateWrap).addClass('active-update-form');
6273jQuery('.cancel-update').click(function (e){
6274e.preventDefault();
6275jQuery('.active-update-form').slideUp(500, function (e){
6276jQuery('.active-update-form').removeClass('active-update-form');
6277})
6278})
6279});
6280});
6281}else{
6282jQuery(updateWrap).slideToggle('500', function (e){
6283jQuery(updateWrap).addClass('active-update-form');
6284jQuery('.cancel-update').click(function (e){
6285e.preventDefault();
6286jQuery('.active-update-form').slideUp(500, function (e){
6287jQuery('.active-update-form').removeClass('active-update-form');
6288})
6289})
6290});
6291}});
6292jQuery(document).on('click', '.edit-menu-item', function (e){
6293e.preventDefault();
6294var $this=jQuery(this),
6295targetID=$this.data('menuid'),
6296updateWrap='#menu-update-' + targetID;
6297if(jQuery('.active-update-formm').length!=0){
6298jQuery('.active-update-formm').slideUp(500, function (e){
6299jQuery('.active-update-formm').removeClass('active-ann-form');
6300jQuery(updateWrap).slideToggle('500', function (e){
6301jQuery(updateWrap).addClass('active-update-formm');
6302jQuery('.cancel-update-menu').click(function (e){
6303e.preventDefault();
6304jQuery('.active-update-formm').slideUp(500, function (e){
6305jQuery('.active-update-formm').removeClass('active-update-formm');
6306})
6307})
6308});
6309});
6310}else{
6311jQuery(updateWrap).slideToggle('500', function (e){
6312jQuery(updateWrap).addClass('active-update-formm');
6313jQuery('.cancel-update-menu').click(function (e){
6314e.preventDefault();
6315jQuery('.active-update-formm').slideUp(500, function (e){
6316jQuery('.active-update-formm').removeClass('active-update-formm');
6317})
6318})
6319});
6320}});
6321if(jQuery('.lp-countdown').length!=0){
6322jQuery('.lp-countdown').each(function (i, obj){
6323var selector='#' + jQuery(this).attr('id');
6324init_countdown(selector);
6325});
6326}});
6327jQuery(document).on('change', '#discount_displayin', function (e){
6328e.preventDefault();
6329var $this=jQuery(this),
6330thisval=$this.val(),
6331userID=$this.data('udi');
6332jQuery($this).after('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
6333jQuery.ajax({
6334type: 'POST',
6335dataType: 'json',
6336url: ajax_search_term_object.ajaxurl,
6337data: {
6338'action': 'discount_display_area',
6339'userID': userID,
6340'thisval': thisval,
6341'lpNonce': jQuery('#lpNonce').val()
6342},
6343success: function (res){
6344jQuery('#discount_displayin').next('i').remove();
6345},
6346error: function (err){
6347alert(err);
6348$this.find('i').remove();
6349}});
6350})
6351jQuery(document).on('change', '#event_displayin', function (e){
6352e.preventDefault();
6353var $this=jQuery(this),
6354thisval=$this.val(),
6355userID=$this.data('udi');
6356jQuery($this).after('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
6357jQuery.ajax({
6358type: 'POST',
6359dataType: 'json',
6360url: ajax_search_term_object.ajaxurl,
6361data: {
6362'action': 'event_display_area',
6363'userID': userID,
6364'thisval': thisval,
6365'lpNonce': jQuery('#lpNonce').val()
6366},
6367success: function (res){
6368jQuery('#event_displayin').next('i').remove();
6369},
6370error: function (err){
6371alert(err);
6372$this.find('i').remove();
6373}});
6374});
6375jQuery(document).on('click', '.lp-edit-offer', function (e){
6376e.preventDefault();
6377var $this=jQuery(this),
6378userID=$this.data('uid'),
6379offerID=$this.data('offerid'),
6380offerTitle=jQuery('#offer-title-' + offerID).val(),
6381offerDes=jQuery('#offer-description-' + offerID).val(),
6382offerExp=jQuery('#offer-expriry-' + offerID).val(),
6383offerBT=jQuery('#offer-btn-text-' + offerID).val(),
6384offerBL=jQuery('#offer-btn-link-' + offerID).val(),
6385offerLI=jQuery('#offer-listing-' + offerID).val();
6386if(!jQuery('.btn-link-field-toggle').hasClass('link-active')){
6387offerBL='';
6388}
6389$this.append('<i class="fa fa-spin fa-spinner"></i>');
6390if(offerLI==null||offerLI==''||offerTitle==''||offerExp==''){
6391jQuery('.ann-err-msg').fadeIn(500).delay(1500).fadeOut(500);
6392$this.find('i').remove();
6393return false;
6394}
6395jQuery.ajax({
6396type: 'POST',
6397dataType: 'json',
6398url: ajax_search_term_object.ajaxurl,
6399data: {
6400'action': 'add_offer_cb',
6401'user_id': userID,
6402'offerTitle': offerTitle,
6403'offerDes': offerDes,
6404'offerExp': offerExp,
6405'offerBT': offerBT,
6406'offerBL': offerBL,
6407'offerLI': offerLI,
6408'offerUP': 'yes',
6409'offerID': offerID,
6410'lpNonce': jQuery('#lpNonce').val()
6411},
6412success: function (res){
6413$this.find('i').removeClass('fa-spin fa-spinner');
6414$this.find('i').addClass('fa fa-check');
6415location.reload();
6416},
6417error: function (err){
6418alert(err);
6419$this.find('i').remove();
6420}});
6421});
6422jQuery(document).on('click', '.lp-edit-dis', function (e){
6423e.preventDefault();
6424var $this=jQuery(this),
6425disID=$this.data('disid'),
6426userID=$this.data('uid'),
6427disHea=jQuery('#dis-heading-' + disID).val(),
6428disCod=jQuery('#dis-code-' + disID).val(),
6429disExpE=jQuery('#dis-expiry-e-' + disID).val(),
6430disExpS=jQuery('#dis-expiry-s-' + disID).val(),
6431disTimeE=jQuery('#dis-time-e-' + disID).val(),
6432disTimeS=jQuery('#dis-time-s-' + disID).val(),
6433disBT=jQuery('#dis-btn-text-' + disID).val(),
6434disBL=jQuery('#dis-btn-link-' + disID).val(),
6435disLI=$this.data('listid'),
6436disOff=jQuery('#dis-off-' + disID).val(),
6437disImg=jQuery('.edit-upload-' + disID + ' .frontend-input').val();
6438disDes=jQuery('#dis-description-' + disID).val();
6439$this.append('<i class="fa fa-spin fa-spinner"></i>');
6440if(disLI==0||disLI==''){
6441jQuery('.ann-err-msg').fadeIn(500).delay(1500).fadeOut(500);
6442$this.find('i').remove();
6443return false;
6444}
6445if(disImg==''){
6446disImg=jQuery('#dis-old-img-' + disID).val();
6447}
6448jQuery.ajax({
6449type: 'POST',
6450dataType: 'json',
6451url: ajax_search_term_object.ajaxurl,
6452data: {
6453'action': 'add_discount_cb',
6454'user_id': userID,
6455'disID': disID,
6456'disHea': disHea,
6457'disCod': disCod,
6458'disExpE': disExpE,
6459'disExpS': disExpS,
6460'disTimeE': disTimeE,
6461'disTimeS': disTimeS,
6462'disBT': disBT,
6463'disBL': disBL,
6464'disLI': disLI,
6465'disDes': disDes,
6466'disOff': disOff,
6467'disImg': disImg,
6468'disUp': 'yes',
6469'lpNonce': jQuery('#lpNonce').val()
6470},
6471success: function (res){
6472ajax_success_popup(res, $this);
6473},
6474error: function (err){
6475}});
6476});
6477jQuery(document).on('click', '.lp-edit-announcements', function (e){
6478e.preventDefault();
6479var $this=jQuery(this),
6480annID=$this.data('annid'),
6481userID=$this.data('uid'),
6482annMsg=jQuery('#announcements-message-' + annID).val(),
6483annBT=jQuery('#announcements-btn-text-' + annID).val(),
6484annBL=jQuery('#announcements-btn-link-' + annID).val(),
6485annSt=jQuery('#ann-style-val-' + annID).val(),
6486annTI=jQuery('#announcements-title-' + annID).val(),
6487annIC=jQuery('#announcements-icon-' + annID).val(),
6488annLI=jQuery(this).data('lid');
6489$this.append('<i class="fa fa-spin fa-spinner"></i>');
6490if(annLI==0||annLI==''||annMsg==''){
6491jQuery('.ann-err-msg-' + annID).fadeIn(500).delay(1500).fadeOut(500);
6492$this.find('i').remove();
6493return false;
6494}
6495jQuery.ajax({
6496type: 'POST',
6497dataType: 'json',
6498url: ajax_search_term_object.ajaxurl,
6499data: {
6500'action': 'add_announcements_cb',
6501'user_id': userID,
6502'annMsg': annMsg,
6503'annSt': annSt,
6504'annBT': annBT,
6505'annBL': annBL,
6506'annLI': annLI,
6507'annTI': annTI,
6508'annIC': annIC,
6509'annUP': 'yes',
6510'annID': annID,
6511'lpNonce': jQuery('#lpNonce').val()
6512},
6513success: function (res){
6514ajax_success_popup(res, $this);
6515},
6516error: function (err){
6517}});
6518});
6519function init_countdown(selector){
6520var $this=jQuery(selector);
6521if(!$this.length) return false;
6522var clock;
6523var daysLabel=jQuery(selector).data('label-days'),
6524hoursLabel=jQuery(selector).data('label-hours'),
6525minsLabel=jQuery(selector).data('label-mints'),
6526cHour=jQuery(selector).data('hour'),
6527cMinute=jQuery(selector).data('minute'),
6528cDay=jQuery(selector).data('day'),
6529cMonth=jQuery(selector).data('month'),
6530cYear=jQuery(selector).data('year');
6531FlipClock.Lang.Custom={ days: daysLabel, hours: hoursLabel, minutes: minsLabel };
6532var startDate=new Date(cYear, cMonth, cDay, cHour, cMinute);
6533var now=Math.floor(Date.now() / 1000);
6534var clockStart=startDate.getTime() / 1000 - now;
6535var numDays=Math.floor(clockStart / 86400);
6536var minDigits=6;
6537if(numDays > 99){
6538minDigits=7;
6539}
6540clock=jQuery(selector).FlipClock({
6541clockFace: 'DailyCounter',
6542autoStart: true,
6543showSeconds: false,
6544language: 'Custom',
6545minimumDigits: minDigits
6546});
6547clock.setTime(clockStart);
6548clock.setCountdown(true);
6549}
6550jQuery(document).on('mouseleave', '#menu-categories-menu', function (e){
6551jQuery('.lp-header-nav-btn').removeClass('active-can-menu');
6552jQuery('#menu-categories-menu').css('opacity', '0');
6553jQuery('#menu-categories-menu').css('transform', 'scale(0)');
6554});
6555jQuery(document).on('click', '.lp-ann-btn', function (e){
6556e.preventDefault();
6557if(jQuery(this).hasClass('lp-no-review-btn')){
6558}else{
6559var targetANN='#' + jQuery(this).attr('data-ann');
6560jQuery(targetANN).show();
6561jQuery(targetANN).find('.lp-listing-announcement').fadeIn();
6562jQuery(targetANN).find('.lp-listing-announcement').addClass('active-ann');
6563jQuery('.code-overlay').fadeIn();
6564}});
6565jQuery(document).on('click', '.close-ann', function (e){
6566e.preventDefault();
6567jQuery('.active-ann').fadeOut();
6568jQuery('.active-ann').removeClass('active-ann');
6569jQuery('.code-overlay').fadeOut();
6570jQuery('.lp-listing-announcements').fadeOut();
6571});
6572jQuery(document).on('click', '.lp-coupon-btn', function (e){
6573e.preventDefault();
6574var targetCOUP='#' + jQuery(this).data('coupon');
6575jQuery(targetCOUP).fadeIn();
6576jQuery(targetCOUP).addClass('active-coupon');
6577jQuery('.code-overlay').fadeIn();
6578});
6579jQuery(document).on('click', '.close-coupon', function (e){
6580e.preventDefault();
6581jQuery('.active-coupon').fadeOut();
6582jQuery('.active-coupon').removeClass('active-coupon');
6583jQuery('.code-overlay').fadeOut();
6584});
6585jQuery(document).on('shown.bs.tab', 'a[href="#menu_tab"]', function (e){
6586jQuery('.lp-listing-menuu-slider').slick('refresh');
6587});
6588jQuery(document).on('click', '.ann-toggle-btn', function (e){
6589e.preventDefault();
6590var $this=jQuery(this),
6591status=$this.attr('data-status'),
6592annID=$this.data('annid'),
6593userID=$this.data('uid');
6594jQuery.ajax({
6595type: 'POST',
6596dataType: 'json',
6597url: ajax_search_term_object.ajaxurl,
6598data: {
6599'action': 'add_announcements_cb',
6600'user_id': userID,
6601'status': status,
6602'annID': annID,
6603'annUP': 'on-off',
6604'lpNonce': jQuery('#lpNonce').val()
6605},
6606success: function (res){
6607if(res.status==0){
6608status='inactive';
6609}else if(res.status==1){
6610status='active';
6611}
6612$this.attr('data-status', status);
6613},
6614error: function (err){
6615$this.find('i').remove();
6616}});
6617});
6618jQuery(document).on('change', '.on-off-ann', function (e){
6619e.preventDefault();
6620var $this=jQuery(this),
6621status=$this.attr('data-status'),
6622annID=$this.data('annid'),
6623userID=$this.data('uid');
6624jQuery.ajax({
6625type: 'POST',
6626dataType: 'json',
6627url: ajax_search_term_object.ajaxurl,
6628data: {
6629'action': 'add_announcements_cb',
6630'user_id': userID,
6631'status': status,
6632'annID': annID,
6633'annUP': 'on-off',
6634'lpNonce': jQuery('#lpNonce').val()
6635},
6636success: function (res){
6637if(res.status==0){
6638status='inactive';
6639}else if(res.status==1){
6640status='active';
6641}
6642$this.attr('data-status', status);
6643},
6644error: function (err){
6645$this.find('i').remove();
6646}});
6647});
6648jQuery(document).on('keyup', '#announcements-message', function (e){
6649var thisText=jQuery(this).val();
6650jQuery('.ann-preivew-wrap .announcement-wrap span').text(thisText);
6651jQuery('.field-desc strong').text(thisText.length);
6652});
6653jQuery(document).on('keyup', '#announcements-title', function (e){
6654var thisText=jQuery(this).val();
6655jQuery('.ann-preivew-wrap .announcement-wrap strong').text(thisText);
6656});
6657jQuery(document).on('keyup', '#announcements-btn-text', function (e){
6658var thisText=jQuery(this).val();
6659jQuery('.ann-preivew-wrap .announcement-wrap .announcement-btn').text(thisText);
6660});
6661jQuery(document).on('focusout', '#announcements-icon', function (e){
6662var thisText=jQuery(this).val();
6663if(thisText==''){
6664return false;
6665}
6666if(thisText.match("^fa")){
6667jQuery('.announcement-wrap img').hide();
6668jQuery('.announcement-wrap i').show();
6669jQuery(this).attr('icon-type', 'fa-icon');
6670jQuery('.announcement-wrap i').removeClass().addClass('fa ' + thisText);
6671}else{
6672jQuery('.announcement-wrap i').hide()
6673jQuery('.announcement-wrap img').show();
6674jQuery('.announcement-wrap img').attr('src', thisText);
6675jQuery(this).attr('icon-type', 'img-icon');
6676}});
6677function slickINIT(){
6678if(jQuery('.lp-listing-menuu-slider').length!=0){
6679jQuery('.lp-listing-menuu-slider').slick({
6680infinite: true,
6681slidesToShow: 1,
6682slidesToScroll: 1,
6683adaptiveHeight: true,
6684nextArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
6685prevArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
6686});
6687}}
6688jQuery(document).on('change', '.coupons-fields-switch input[type="checkbox"]', function (e){
6689e.preventDefault();
6690var targetID=jQuery(this).data('target');
6691if(targetID=='coupon-external'){
6692if(jQuery(this).is(':checked')){
6693jQuery('#btn-url-switch').slideDown(500);
6694}else{
6695jQuery('#btn-url-switch').slideUp(500);
6696}}else if(targetID=='quote-button'){
6697if(jQuery(this).is(':checked')){
6698jQuery('.menu-price-wrap').slideUp(500, function (){
6699jQuery('.menu-quote-wrap').slideDown(500);
6700});
6701}else{
6702jQuery('.menu-quote-wrap').slideUp(500, function (){
6703jQuery('.menu-price-wrap').slideDown(500);
6704});
6705}}else if(targetID=='coupon-end'){
6706if(jQuery(this).is(':checked')){
6707jQuery('.lp-cpn-end-container').slideDown(500);
6708}else{
6709jQuery('.lp-cpn-end-container').slideUp(500);
6710}}else{
6711jQuery('#' + targetID + '-switch').slideToggle(500, function (){
6712if(!jQuery('#date-switch').is(':visible')&&!jQuery('#time-switch').is(':visible')){
6713jQuery('.empty-row-check').slideToggle();
6714}});
6715}});
6716jQuery(document).on('click', '.del-all-menu', function (e){
6717e.preventDefault();
6718jQuery(this).addClass('remove-active');
6719jQuery('#dashboard-delete-modal').modal('show');
6720jQuery('.modal-backdrop').hide();
6721});
6722jQuery(document).on('click', '#lp-save-events', function (e){
6723e.preventDefault();
6724var $this=jQuery(this),
6725eTitle=jQuery('#event-title').val(),
6726eDesc=jQuery('#event-description').val(),
6727eDate=jQuery('#event-date-s').val(),
6728eDateE=jQuery('#event-date-e').val(),
6729eTime=jQuery('#event-time').val(),
6730eTimeE=jQuery('#event-time-e').val(),
6731eLoc='',
6732eLat=jQuery('#lp-events-form #latitude').val(),
6733eLon=jQuery('#lp-events-form #longitude').val(),
6734eTUrl=jQuery('#event-tickets-data').val(),
6735eLID=jQuery('#event-listing').val(),
6736eImg=jQuery('.new-file-upload .frontend-input').val(),
6737eUID=$this.data('uid'),
6738eUtils='';
6739if(jQuery('.events-map-wrap a[data-type="gaddresscustom"]').hasClass('active')){
6740eLoc=jQuery('#lp-events-form input[name="gAddresscustom"]').val();
6741}else{
6742eLoc=jQuery('#lp-events-form input[name="gAddress"]').val();
6743}
6744jQuery('.coupons-fields-switch').find('.switch-checkbox').each(function (){
6745var CheckboxX=jQuery(this),
6746target=CheckboxX.data('target'),
6747targetVal=''
6748if(CheckboxX.is(':checked')){
6749targetVal='yes';
6750}else{
6751targetVal='no';
6752}
6753eUtils +=target + '|' + targetVal + '*';
6754});
6755if(eLID==''||eLID==0||eLID==null){
6756if(jQuery('#event-listing').length){
6757jQuery('#event-listing').addClass('error');
6758}else{
6759jQuery('#select2-event-listing-container').addClass('error');
6760}}else{
6761if(jQuery('#event-listing').length){
6762jQuery('#event-listing').removeClass('error');
6763}else{
6764jQuery('#select2-event-listing-container').removeClass('error');
6765}}
6766if(eTitle==''){
6767jQuery('#event-title').addClass('error');
6768}else{
6769jQuery('#event-title').removeClass('error');
6770}
6771var checkEndDate=true;
6772if(jQuery('.lp-event-end-date-switch').is(':checked')){
6773checkEndDate=false;
6774if(eDateE==''||eTimeE==''){
6775if(eDateE==''){
6776jQuery('#event-date-e').addClass('error');
6777}
6778if(eTimeE==''){
6779jQuery('#event-time-e').addClass('error');
6780}
6781checkEndDate=true;
6782}else{
6783if(eDateE==''){
6784jQuery('#event-date-e').removeClass('error');
6785}
6786if(eTimeE==''){
6787jQuery('#event-time-e').removeClass('error');
6788}
6789checkEndDate=false;
6790}}else{
6791jQuery('#event-date-e').removeClass('error');
6792jQuery('#event-time-e').removeClass('error');
6793checkEndDate=false;
6794}
6795if(eDate==''){
6796jQuery('#event-date-s').addClass('error');
6797}else{
6798jQuery('#event-date-s').removeClass('error');
6799}
6800if(eTime==''){
6801jQuery('#event-time').addClass('error');
6802}else{
6803jQuery('#event-time').removeClass('error');
6804}
6805if(eLID==''||eLID==0||eLID==null||eTitle==''||eTime==''||eDate==''||checkEndDate){
6806var dataError=[];
6807dataError.status='error';
6808dataError.msg=jQuery('.lp-notifaction-area').data('error-msg');
6809ajax_success_popup(dataError, $this);
6810return false;
6811}
6812if(jQuery('a[data-type="gaddress"]').hasClass('active')){
6813if(eLoc==''){
6814jQuery('#lp-events-form input[name="gAddress"]').addClass('error');
6815var dataError=[];
6816dataError.status='error';
6817dataError.msg=jQuery('.lp-notifaction-area').data('error-msg');
6818ajax_success_popup(dataError, $this);
6819return false;
6820}else{
6821jQuery('#lp-events-form input[name="gAddress"]').removeClass('error');
6822}}else{
6823if(eLat==''||eLon==''||eLoc==''){
6824jQuery('#inputAddresss').addClass('error');
6825var dataError=[];
6826dataError.status='error';
6827dataError.msg=jQuery('.lp-notifaction-area').data('error-msg');
6828ajax_success_popup(dataError, $this);
6829return false;
6830}}
6831$this.append('<i class="fa fa-spin fa-spinner"></i>');
6832jQuery.ajax({
6833type: 'POST',
6834dataType: 'json',
6835url: ajax_search_term_object.ajaxurl,
6836data: {
6837'action': 'add_events_cb',
6838'eTitle': eTitle,
6839'eDesc': eDesc,
6840'eDate': eDate,
6841'eDateE': eDateE,
6842'eTime': eTime,
6843'eTimeE': eTimeE,
6844'eLoc': eLoc,
6845'eLat': eLat,
6846'eLon': eLon,
6847'eTUrl': eTUrl,
6848'eLID': eLID,
6849'eUID': eUID,
6850'eImg': eImg,
6851'eUtils': eUtils,
6852'lpNonce': jQuery('#lpNonce').val()
6853},
6854success: function (res){
6855ajax_success_popup(res, $this);
6856},
6857error: function (err){
6858console.log(err);
6859}});
6860});
6861jQuery(document).on('click', '.lp-save-events', function (e){
6862e.preventDefault();
6863var $this=jQuery(this),
6864eID=$this.data('eid'),
6865eTitle=jQuery('#event-title-' + eID).val(),
6866eDesc=jQuery('#event-description-' + eID).val(),
6867eDate=jQuery('#event-date-s-' + eID).val(),
6868eDateE=jQuery('#event-date-e-' + eID).val(),
6869eTime=jQuery('#event-time-' + eID).val(),
6870eTimeE=jQuery('#event-time-e-' + eID).val(),
6871eLoc=jQuery('#event-location-' + eID).val(),
6872eLat=$this.closest('.lp-coupons-form-inner').find('.latitude').val(),
6873eLong=$this.closest('.lp-coupons-form-inner').find('.longitude').val(),
6874eTUrl=jQuery('#event-tickets-data-' + eID).val(),
6875eImg=jQuery('.edit-upload-' + eID + ' .frontend-input').val(),
6876eUID=$this.data('uid');
6877if(eTitle==''){
6878jQuery('#event-title').addClass('error');
6879}else{
6880jQuery('#event-title').removeClass('error');
6881}
6882if(eTitle==''){
6883return false;
6884}
6885if(eImg==''){
6886eImg=jQuery('#event-old-img-' + eID).val();
6887}
6888if(eLoc==''){
6889jQuery('#event-location-' + eID).addClass('error');
6890var dataError=[];
6891dataError.status='error';
6892dataError.msg=jQuery('.lp-notifaction-area').data('error-msg');
6893ajax_success_popup(dataError, $this);
6894return false;
6895}else{
6896jQuery('#event-location-' + eID).removeClass('error');
6897}
6898$this.append('<i class="fa fa-spin fa-spinner"></i>');
6899jQuery.ajax({
6900type: 'POST',
6901dataType: 'json',
6902url: ajax_search_term_object.ajaxurl,
6903data: {
6904'action': 'add_events_cb',
6905'eTitle': eTitle,
6906'eDesc': eDesc,
6907'eDate': eDate,
6908'eDateE': eDateE,
6909'eTime': eTime,
6910'eTimeE': eTimeE,
6911'eLoc': eLoc,
6912'eLat': eLat,
6913'eLon': eLong,
6914'eTUrl': eTUrl,
6915'eUID': eUID,
6916'eID': eID,
6917'eImg': eImg,
6918'eUp': 'yes',
6919'lpNonce': jQuery('#lpNonce').val()
6920},
6921success: function (res){
6922ajax_success_popup(res, $this);
6923},
6924error: function (err){
6925console.log(err);
6926}});
6927});
6928jQuery(document).on('click', '.attend-event', function (e){
6929e.preventDefault();
6930var $this=jQuery(this),
6931eID=$this.data('event'),
6932eUID=$this.data('uid'),
6933notGoing='',
6934goingText=jQuery('.going-text').val(),
6935nGoingText=jQuery('.not-going-text').val();
6936if($this.hasClass('processing')){
6937}else{
6938if($this.hasClass('not-going')){
6939notGoing='yes';
6940}else{
6941}
6942if($this.hasClass('from-lpec')){
6943$this.find('i').removeClass('fa-plus').addClass('fa-spinner fa-spin');
6944}else{
6945$this.append('<i class="fa fa-spinner fa-spin"></i>');
6946}
6947$this.addClass('processing');
6948jQuery.ajax({
6949type: 'POST',
6950dataType: 'json',
6951url: ajax_search_term_object.ajaxurl,
6952data: {
6953'action': 'event_attending_cb',
6954'eID': eID,
6955'eUID': eUID,
6956'notGoing': notGoing,
6957'lpNonce': jQuery('#lpNonce').val()
6958},
6959success: function (res){
6960if($this.hasClass('from-lpec')){
6961jQuery('#lpec-attendee-count-' + eID).text(parseInt(res.total_attending));
6962}else{
6963jQuery('.total-going').text(res.total_attending);
6964$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-check');
6965}
6966$this.removeClass('processing');
6967if(notGoing=='yes'){
6968$this.removeClass('not-going');
6969if($this.hasClass('from-lpec')){
6970jQuery('ul#lpec-attendees-avatar-' + eID).find('li#lpec-attendee-avatar-' + eUID + '-' + eID).remove();
6971$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-plus');
6972}else{
6973$this.text(goingText);
6974}}else{
6975$this.addClass('not-going');
6976if($this.hasClass('from-lpec')){
6977jQuery('ul#lpec-attendees-avatar-' + eID).prepend(res.attendee_avatar);
6978$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-times');
6979}else{
6980$this.text(nGoingText);
6981}}
6982},
6983error: function (err){
6984console.log(err);
6985}});
6986}});
6987jQuery(document).on('click', '.cancel-ad-new-btn', function (e){
6988e.preventDefault();
6989var targetForm='#' + jQuery(this).data('cancel') + '-form-toggle';
6990jQuery(targetForm).fadeOut("fast", function (){
6991if(jQuery('body').find('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-11')){
6992jQuery(".lp-blank-section").fadeIn();
6993}
6994jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-11').fadeIn();
6995});
6996});
6997jQuery(document).on('click', '.menu-add-new', function (e){
6998jQuery('.panel.with-nav-tabs.panel-default.lp-dashboard-tabs').fadeOut("slow", function (){
6999jQuery('div.tab-pane.fade.in.active.clearfix.lp-dashboard-menu-container').fadeIn("fast", function (){
7000jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-12.lp-left-panel-height.lp-left-panel-height-outer.padding-bottom0').fadeIn("fast");
7001});
7002});
7003});
7004jQuery(document).on('click', '.lp-view-all-btn', function (e){
7005e.preventDefault();
7006if(jQuery(this).hasClass('all-with-refresh')){
7007location.reload();
7008}else{
7009jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-12.lp-left-panel-height.lp-left-panel-height-outer.padding-bottom0').fadeOut("fast", function (){
7010jQuery('div.tab-pane.fade.in.active.clearfix.lp-dashboard-menu-container').fadeOut("fast", function (){
7011jQuery('.panel.with-nav-tabs.panel-default.lp-dashboard-tabs').fadeIn("Slow");
7012});
7013});
7014}});
7015jQuery(document).on('click', '.cancel-add-menu', function (e){
7016e.preventDefault();
7017jQuery('#lp-save-menu').attr('id', 'lp-save-menu-reopen');
7018jQuery('.lp-menu-close-outer.lp-menu-open').slideUp();
7019});
7020jQuery(document).on('click', '#lp-save-menu-reopen', function (e){
7021e.preventDefault();
7022jQuery(this).attr('id', 'lp-save-menu');
7023jQuery('.lp-menu-close-outer.lp-menu-open').slideDown();
7024});
7025jQuery(document).on('click', '.lp-notifi-icons', function (e){
7026e.preventDefault();
7027jQuery(this).closest('.active-wrap').removeClass('active-wrap');
7028});
7029jQuery(document).ready(function (){
7030jQuery('#fill-o-bot-check').on('change', function (e){
7031if(jQuery(this).is(':checked')){
7032jQuery('#lptitle').attr('type', 'hidden');
7033jQuery('.lptitle').addClass('fill-o-bot-active');
7034jQuery('#lptitle').attr('name', '');
7035jQuery('#lptitleGoogle').attr('name', 'postTitle');
7036jQuery('#lptitleGoogle').attr('type', 'text');
7037}else{
7038jQuery('#lptitleGoogle').attr('type', 'hidden');
7039jQuery('.lptitle').removeClass('fill-o-bot-active');
7040jQuery('#lptitle').attr('name', 'postTitle');
7041jQuery('#lptitle').attr('type', 'text');
7042jQuery('#lptitleGoogle').attr('name', '');
7043}});
7044});
7045jQuery('html').click(function (e){
7046if(jQuery('.lp-multi-star-wrap').is(":visible")&&e.target.className!='open-multi-rate-box'){
7047if(jQuery('.lp-multi-star-wrap').hasClass('lp-multi-start-wrap-edit-review')){
7048}else{
7049jQuery('.lp-multi-star-wrap').slideUp();
7050}}
7051});
7052jQuery(document).ready(function (){
7053jQuery('#fill-o-bot-check').on('change', function (e){
7054if(jQuery(this).is(':checked')){
7055jQuery('#lptitle').attr('type', 'hidden');
7056jQuery('#lptitle').removeClass('lp-required-field');
7057jQuery('.lptitle').addClass('fill-o-bot-active');
7058jQuery('#lptitle').attr('name', '');
7059jQuery('#lptitleGoogle').attr('name', 'postTitle');
7060jQuery('#lptitleGoogle').attr('type', 'text');
7061jQuery('#lptitleGoogle').addClass('lp-required-field');
7062}else{
7063jQuery('#lptitleGoogle').attr('type', 'hidden');
7064jQuery('.lptitle').removeClass('fill-o-bot-active');
7065jQuery('#lptitleGoogle').removeClass('lp-required-field');
7066jQuery('#lptitle').attr('name', 'postTitle');
7067jQuery('#lptitle').attr('type', 'text');
7068jQuery('#lptitleGoogle').attr('name', '');
7069jQuery('#lptitle').addClass('lp-required-field');
7070}});
7071});
7072function ajax_success_popup(res, $this){
7073if(res.status=='success'){
7074if($this!=''){
7075$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-check');
7076}
7077jQuery('.lp-notifaction-area').find('h4').text(res.msg);
7078jQuery('.lp-notifaction-area').removeClass('lp-notifaction-error').addClass('lp-notifaction-success');
7079jQuery('.lp-notifaction-area').addClass('active-wrap');
7080location.reload();
7081}
7082if(res.status=='error'){
7083if($this!=''){
7084$this.find('i').remove();
7085}
7086jQuery('.lp-notifaction-area').find('h4').text(res.msg);
7087jQuery('.lp-notifaction-area').removeClass('lp-notifaction-success').addClass('lp-notifaction-error');
7088jQuery('.lp-notifaction-area').addClass('active-wrap');
7089}}
7090jQuery(document).on('keyup', '#menu-type-new, #menu-group-new', function (){
7091var typeGroupText=jQuery(this).val(),
7092errMsg=jQuery(this).data('err'),
7093re=/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi;
7094var isSplChar=re.test(typeGroupText);
7095if(isSplChar){
7096var no_spl_char=typeGroupText.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '');
7097jQuery(this).val(no_spl_char);
7098jQuery(this).after('<p>' + errMsg + '</p>');
7099}});
7100jQuery(document).ready(function (){
7101jQuery('.lp-event-view-less').click(function (e){
7102e.preventDefault();
7103var lessText=jQuery(this).data('contract');
7104var moreText=jQuery(this).data('expand');
7105if(jQuery(this).hasClass('event-shown')){
7106jQuery(this).removeClass('event-shown');
7107jQuery(this).html(moreText);
7108jQuery('.lp-attende-extra').removeClass('active');
7109}else{
7110jQuery(this).addClass('event-shown');
7111jQuery('.lp-attende-extra').addClass('active');
7112jQuery(this).html(lessText);
7113}});
7114function initializeEventAddr(){
7115if(jQuery('.event-addr').length > 0){
7116jQuery('.event-addr').each(function (index){
7117var input=document.getElementById(jQuery(this).attr('id'));
7118var autocomplete=new google.maps.places.Autocomplete(input);
7119google.maps.event.addListener(autocomplete, 'place_changed', function (){
7120var place=autocomplete.getPlace();
7121var lat=place.geometry.location.lat();
7122var lon=place.geometry.location.lng();
7123jQuery('input.latitude').val(lat);
7124jQuery('input.longitude').val(lon);
7125});
7126});
7127}}
7128google.maps.event.addDomListener(window, 'load', initializeEventAddr);
7129});
7130jQuery(document).on('click', 'span.remove-menu-img', function (e){
7131e.preventDefault();
7132var targetID=jQuery(this).data('target'),
7133targetSrc=jQuery(this).data('src') + ',',
7134targetImgs=jQuery('.active-upload').find('.frontend-input-multiple').val();
7135if(targetImgs==undefined){
7136targetImgs=jQuery('#' + targetID).val();
7137}
7138targetImgs=targetImgs.replace(targetSrc, '');
7139jQuery(this).closest('.menu-edit-img-wrap').remove();
7140jQuery('input#' + targetID).val(targetImgs);
7141});
7142jQuery(document).on('click', '.select2-results ul li', function (e){
7143jQuery('.lp-pp-noa-tip').fadeIn();
7144});
7145jQuery('.select2-ajax-unique').on('select2:select', function (e){
7146jQuery('.lp-pp-noa-tip').fadeOut();
7147});
7148jQuery('.select2-ajax').on('select2:select', function (e){
7149jQuery('.lp-pp-noa-tip').fadeOut();
7150});
7151jQuery(document).on('click', '.remove-event-old-img', function (e){
7152e.preventDefault();
7153e.stopPropagation();
7154e.stopImmediatePropagation();
7155var $this=jQuery(this),
7156targetID=$this.data('targetid');
7157$this.closest('.removeable-image').find('.lp-uploaded-img').remove();
7158jQuery('#' + targetID).val('');
7159$this.remove();
7160});
7161jQuery(document).on('click', '.remove-event-img', function (e){
7162e.preventDefault();
7163var $this=jQuery(this);
7164if($this.hasClass('remove-eei')){
7165var targetID=$this.data('targetid');
7166$this.closest('.removeable-image').find('.frontend-image').attr('src', '');
7167$this.closest('.removeable-image').find('.frontend-image').hide();
7168$this.closest('.removeable-image').find('.lp-uploaded-img').remove();
7169$this.closest('.removeable-image').find('.frontend-input').val('');
7170jQuery('#event-old-img-' + targetID).val('');
7171$this.remove();
7172}else{
7173$this.closest('.removeable-image').find('.frontend-image').attr('src', '');
7174$this.closest('.removeable-image').find('.frontend-image').hide();
7175$this.closest('.removeable-image').find('.frontend-input').val('');
7176$this.remove();
7177}});
7178jQuery(document).on('click', '.lp-copy-code', function (e){
7179e.preventDefault();
7180var $this=jQuery(this);
7181var targetCodeEL=jQuery(this).data('target-code'),
7182thisHtml=jQuery(this).data('html'),
7183targetCodeELC='.' + targetCodeEL;
7184if($this.hasClass('close-copy-pop')){
7185$this.closest('.lp-discount-widget').find(targetCodeELC).animate({
7186bottom: '-' + jQuery(targetCodeELC).height() + 'px'
7187}, 500, function (e){
7188$this.html(thisHtml);
7189$this.removeClass('close-copy-pop');
7190});
7191}else{
7192var bottomPlus=0;
7193if($this.hasClass('lp-discount-btn')){
7194bottomPlus=49;
7195}
7196var parent_class='.coupons-bottom-content-wrap';
7197if(jQuery(parent_class).length > 0){
7198parent_class='.coupons-bottom-content-wrap';
7199}else{
7200parent_class='.lp-deal';
7201if(jQuery(parent_class).length > 0){
7202parent_class='.lp-deal';
7203}else{
7204parent_class='.lp-discount-widget';
7205}}
7206if(jQuery(parent_class).length < 1){
7207parent_class='.lp-listing-offer';
7208}
7209$this.closest(parent_class).find(targetCodeELC).animate({
7210bottom: bottomPlus + 'px'
7211}, 500, function (e){
7212if($this.hasClass('lp-discount-btn')){
7213$this.addClass('close-copy-pop');
7214$this.html('<span><i class="fa fa-times"></i></span>');
7215}});
7216}});
7217jQuery(document).on('click', '.close-right-icon', function (e){
7218e.preventDefault();
7219var $this=jQuery(this),
7220target='.' + $this.data('target');
7221jQuery(target).animate({
7222bottom: '-' + jQuery(target).height() + 'px'
7223});
7224});
7225jQuery(document).on('click', '.copy-now', function (e){
7226e.preventDefault();
7227var targetCodeEL=jQuery(this).data('target-code'),
7228targetCodeELC='#' + targetCodeEL;
7229jQuery(targetCodeELC).find('input[type="text"]').select();
7230document.execCommand ("copy");
7231jQuery(targetCodeELC).find('.dis-code-copy-pop-inner-cell').find('p:first-child').text(jQuery('.copy-now').data('coppied-label'));
7232});
7233jQuery(document).on('click', '.lp-pagination.author-reviews-pagination span', function (e){
7234e.preventDefault();
7235var paginNo=jQuery(this).data('pageurl');
7236jQuery('.reviews-pagin-wrap').hide();
7237jQuery('.reviews-pagin-wrap.reviews-pagin-wrap-' + paginNo).show();
7238});
7239jQuery(document).on('click', '.lp-filter-pagination-ajx ul li span.author-haspaglink', function (e){
7240e.preventDefault();
7241var pageNo=jQuery(this).data('pageurl'),
7242authorID=jQuery('.lp-author-nav').data('author'),
7243authorPagin='yes',
7244listingLayout=jQuery('#mylistings').data('listing-layout');
7245jQuery('.lp-filter-pagination-ajx ul li span').removeClass('current');
7246jQuery(this).addClass('current');
7247jQuery('#mylistings').find('.author-inner-content-wrap').addClass('content-loading');
7248jQuery('#mylistings #content-grids').remove();
7249jQuery.ajax({
7250type: 'POST',
7251url: ajax_search_term_object.ajaxurl,
7252data: {
7253'action': 'author_archive_tabs_cb',
7254'pageNo': pageNo,
7255'authorID': authorID,
7256'authorPagin': authorPagin,
7257'listingLayout': listingLayout,
7258'lpNonce': jQuery('#lpNonce').val()
7259},
7260success: function (data){
7261jQuery('#mylistings').find('.author-inner-content-wrap').removeClass('content-loading');
7262jQuery('#mylistings').find('.author-inner-content-wrap').html(data);
7263console.log(data);
7264}});
7265});
7266jQuery(document).ready(function (){
7267if(jQuery('.featuresDataContainer.lp-check-custom-wrapp').length > 0){
7268jQuery('.featuresDataContainerOuterSubmit').show();
7269jQuery('.featuresDataContainer.lp-check-custom-wrapp').show();
7270}});
7271jQuery(document).ready(function (){
7272jQuery('.lp-review-form-top .lp-listing-stars').click(function (e){
7273e.preventDefault();
7274if(jQuery(this).hasClass('do-not-proceed')){
7275}else{
7276jQuery(this).addClass('do-not-proceed');
7277jQuery('.lp-review-form-bottom').slideToggle(500);
7278jQuery('html,body').animate({
7279scrollTop: jQuery(".lp-listing-review-form").offset().top - 100
7280}, 'slow');
7281}});
7282});
7283jQuery(document).on('change', '#toggle-attendees-check', function (){
7284if(jQuery(this).is(':checked')){
7285jQuery('.attendee-checkbox').attr('checked', 'checked');
7286}else{
7287jQuery('.attendee-checkbox').removeAttr('checked');
7288}});
7289jQuery(document).on('click', '.download-attendees', function (e){
7290e.preventDefault();
7291});
7292jQuery(document).on('click', '#lp-send-message', function (e){
7293e.preventDefault();
7294var $this=jQuery(this),
7295msgError=jQuery('#event-msg-error').val(),
7296msgSuccess=jQuery('#event-msg-success').val(),
7297uid=$this.data('uid'),
7298msgContent=jQuery('.attendeesmessage').val(),
7299attendees=jQuery(".attendee-checkbox:checked").map(function (){
7300return jQuery(this).val();
7301}).get();
7302var responseData=[];
7303if(msgContent==''||attendees==''){
7304responseData.status='error';
7305responseData.msg=msgError;
7306ajax_success_popup(responseData, $this);
7307return false;
7308}
7309if($this.hasClass('processing')){
7310}else{
7311$this.append('<i class="fa fa-spinner fa-spin"></i>');
7312$this.addClass('processing');
7313jQuery.ajax({
7314type: 'POST',
7315dataType: 'json',
7316url: ajax_search_term_object.ajaxurl,
7317data: {
7318'action': 'send_attendees_msg',
7319'msgContent': msgContent,
7320'attendees': attendees,
7321'uid': uid,
7322'lpNonce': jQuery('#lpNonce').val()
7323},
7324success: function (res){
7325responseData.status='success';
7326responseData.msg=msgSuccess;
7327ajax_success_popup(responseData, $this);
7328},
7329error: function (err){
7330console.log(err);
7331}});
7332}});
7333jQuery(document).on('click', '.open-send-msg-form, .cancel-send-mas-atten', function (e){
7334e.preventDefault();
7335jQuery('#notification-form').slideToggle('fast', function (){
7336jQuery("html, body").animate({ scrollTop: jQuery('#notification-form').offset().top }, 1000);
7337});
7338});
7339jQuery(document).on('click', '.attendees-pagination span', function (e){
7340e.preventDefault();
7341var $this=jQuery(this),
7342pageNo=$this.data('pageurl'),
7343targetC='.attendees-pagin-wrap-' + pageNo;
7344if(jQuery(this).hasClass('current')){
7345return false;
7346}
7347jQuery('.attendees-pagination span.current').removeClass('current');
7348$this.addClass('current');
7349jQuery('.current-pagin-wrap').fadeOut(500, function (){
7350jQuery('.current-pagin-wrap').removeClass('current-pagin-wrap');
7351jQuery(targetC).fadeIn(500, function (){
7352jQuery(targetC).addClass('current-pagin-wrap');
7353})
7354});
7355});
7356jQuery(document).on('click', '.listing-tabs-element li a', function (e){
7357e.preventDefault();
7358var $this=jQuery(this),
7359taxonomy=$this.attr('data-tax'),
7360term=$this.attr('data-term'),
7361numPost=$this.attr('data-num'),
7362layout=$this.attr('data-layout'),
7363list=$this.attr('data-list'),
7364grid=$this.attr('data-grid');
7365jQuery('.listing-tabs-element li.active').removeClass('active');
7366$this.closest('li').addClass('active');
7367jQuery('#listing-tabs-inner-container').html();
7368jQuery('#listing-tabs-inner-container').closest('.wpb_wrapper').find('.listingcampaings').remove();
7369jQuery.ajax({
7370type: 'POST',
7371dataType: 'json',
7372url: ajax_search_term_object.ajaxurl,
7373data: {
7374'action': 'listing_tabs_get_listings',
7375'taxonomy': taxonomy,
7376'term': term,
7377'numPost': numPost,
7378'layout': layout,
7379'list': list,
7380'grid': grid,
7381'lpNonce': jQuery('#lpNonce').val()
7382},
7383success: function (res){
7384jQuery('#listing-tabs-inner-container').html(res);
7385jQuery('#listing-tabs-inner-container').find('.listingcampaings').remove();
7386jQuery('#listing-tabs-inner-container').find('.app-view-new-ads-slider').slick({
7387infinite: true,
7388slidesToShow: 1,
7389slidesToScroll: 1,
7390arrows: false
7391});
7392},
7393error: function (err){
7394console.log(err);
7395}});
7396})
7397jQuery(document).on('click', '.calender-header-switcher ul li', function (){
7398var $this=jQuery(this);
7399jQuery('.calender-header-switcher ul li.active').removeClass('active');
7400$this.addClass('active');
7401var calanderType='event-calender-list-view';
7402if(jQuery('.calender-type-wrap').length > 0){
7403calanderType=jQuery('.calender-type-wrap').data('ctype');
7404}
7405getCalanderMapView(calanderType, $this);
7406});
7407jQuery(document).on('click', '.close-active-box', function (e){
7408e.preventDefault();
7409jQuery('.current-active-box').removeClass('current-active-box');
7410jQuery('.active-event-for-map').removeClass('active-event-for-map');
7411jQuery('.caew-box').removeClass('caew-box').fadeOut(500);
7412jQuery('.event-calander-classic2').fadeOut(500);
7413jQuery('.calender-header-switcher ul li').removeClass('active');
7414jQuery('.calender-header-switcher ul li.show-calader-list').addClass('active');
7415jQuery('.calender-type-wrap').attr('data-activetoggle', 'calander');
7416if(jQuery('.event-calander-classic2').length){
7417jQuery('.event-by-day-wrap').fadeOut();
7418}});
7419jQuery(document).on('click', '.week-day-date-box.has-events', function (e){
7420e.preventDefault();
7421var $this=jQuery(this),
7422ewtTarget=$this.data('ewt'),
7423targetDate=$this.data('todaytime'),
7424targetDateA=targetDate.split('-');
7425jQuery('.current-active-box').removeClass('current-active-box');
7426if($this.hasClass('current-active-box')){
7427$this.removeClass('current-active-box');
7428jQuery('.active-event-for-map').removeClass('active-event-for-map');
7429jQuery('.caew-box').removeClass('caew-box').fadeOut(500);
7430jQuery('.event-calander-classic2').fadeOut(500);
7431return false;
7432}else{
7433$this.addClass('current-active-box');
7434}
7435if(jQuery('.modern-calender-inner-left').length > 0){
7436if(jQuery('.events-by-day-wrap.caew-box').length > 0){
7437if(jQuery('.calender-type-wrap').attr('data-activetoggle')=='map'){
7438jQuery('.active-event-for-map').removeClass('active-event-for-map');
7439jQuery('.events-by-day-wrap[data-ebdt="' + ewtTarget + '"]').addClass('caew-box active-event-for-map');
7440jQuery('.calender-header-switcher ul li.show-calander-map').trigger('click');
7441}else{
7442jQuery('.active-event-for-map').removeClass('active-event-for-map');
7443jQuery('.caew-box').removeClass('caew-box').fadeOut(500, function (){
7444jQuery('.events-by-day-wrap[data-ebdt="' + ewtTarget + '"]').addClass('caew-box active-event-for-map').fadeIn();
7445});
7446}}else{
7447jQuery('.events-by-day-wrap[data-ebdt="' + ewtTarget + '"]').addClass('caew-box active-event-for-map').fadeIn();
7448}
7449jQuery('.calender-header-moderen-date2 .today-event-date-container p').html(targetDateA[1] + ' ' + targetDateA[0] + '<span>' + targetDateA[2] + '</span>');
7450}else{
7451if(j
7451Query('.event-calander-classic2').length > 0){
7452showClassic2CalEvents(ewtTarget, targetDate);
7453}else{
7454showClassicCalEvents(ewtTarget);
7455}}
7456});
7457jQuery(document).on('click', '.get-npm', function (e){
7458e.preventDefault();
7459if(jQuery(this).hasClass('disabled')){
7460return false;
7461}
7462var $this=jQuery(this),
7463targetDate=$this.data('npmnum'),
7464currentCMN=jQuery('.cc-month').data('cmn'),
7465cTypClass=jQuery('.calender-type-wrap').data('ctype'),
7466cTypee='classic',
7467targetAction='nm',
7468currentMN='',
7469currentYN='',
7470per_page='';
7471if(jQuery('#event_per_page').length > 0){
7472per_page=jQuery('#event_per_page').val();
7473}
7474if(cTypee=='classic'&&jQuery('#ec_classic2_check').length > 0){
7475cTypee=jQuery('#ec_classic2_check').val();
7476}
7477if(cTypClass=='event-calender-modern'){
7478cTypee='modern';
7479}
7480if(cTypClass=='event-calender-list-view'){
7481cTypee='list'
7482}
7483if(cTypClass=='event-calender-classic-weekly'){
7484cTypee='weekly';
7485}
7486if(currentCMN.indexOf(',') > -1){
7487var currentCMNArr=currentCMN.split(','),
7488currentMN=currentCMNArr[0],
7489currentYN=currentCMNArr[1];
7490}
7491if($this.hasClass('btn-pm')){
7492targetAction='pm';
7493}
7494if(targetDate.indexOf(',') > -1){
7495var targetDateArr=targetDate.split(','),
7496targetDateM=targetDateArr[0],
7497targetDateY=targetDateArr[1];
7498jQuery('.' + cTypClass).fadeOut(500, function (){
7499jQuery('.event-spinner').fadeIn();
7500});
7501jQuery.ajax({
7502type: 'POST',
7503dataType: 'json',
7504url: ajax_search_term_object.ajaxurl,
7505data: {
7506'action': 'get_event_calender_data',
7507'targetDateM': targetDateM,
7508'targetDateY': targetDateY,
7509'targetAction': targetAction,
7510'currentMN': currentMN,
7511'currentYN': currentYN,
7512'cTypee': cTypee,
7513'per_page': per_page,
7514'lpNonce': jQuery('#lpNonce').val()
7515},
7516success: function (res){
7517if(res.status=='success'){
7518jQuery('.prev-mon-markup').html(res.prev_mon_markup);
7519jQuery('.next-mon-markup').html(res.next_mon_markup);
7520jQuery('.curr-mon-markup').html(res.curr_mon_markup);
7521if(cTypee=='weekly'){
7522jQuery('.event-calender-weekly').html(res.calender_markup);
7523jQuery('.event-calender-weekly').addClass('events-after-ajax');
7524var weekFirstDate=jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:first .week-day-date').text();
7525var weekLastDate=jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:last .week-day-date').text();
7526if(weekFirstDate==''){
7527weekFirstDate='1';
7528}
7529if(weekLastDate==''){
7530weekLastDate='31';
7531}
7532getActiveWeekEvents(weekFirstDate, weekLastDate);
7533}else{
7534jQuery('.event-calender-monthly').html(res.calender_markup);
7535if(cTypee=='modern'){
7536if(jQuery('.month-dates-wrap .week-day-date-box.has-events').length){
7537var target_first_event=jQuery('.month-dates-wrap .week-day-date-box.has-events:first').attr('data-ewt'),
7538target_daytime=jQuery('.month-dates-wrap .week-day-date-box.has-events:first').attr('data-todaytime');
7539}else{
7540var target_first_event=jQuery('.month-dates-wrap .week-day-date-box.has-no-events:first').attr('data-ewt'),
7541target_daytime=jQuery('.month-dates-wrap .week-day-date-box.has-no-events:first').attr('data-todaytime');
7542}
7543var target_daytime_arr=target_daytime.split('-');
7544var target_day_markup=target_daytime_arr[1] + ' ' + target_daytime_arr[0] + ' <span>' + target_daytime_arr[2] + '</span>';
7545jQuery('.events-by-day-wrap[data-ebdt=' + target_first_event + ']').addClass('caew-box active-event-for-map').fadeIn();
7546jQuery('.today-event-date-container p').html(target_day_markup);
7547}}
7548jQuery('.event-spinner').fadeOut(500, function (){
7549jQuery('.' + cTypClass).fadeIn();
7550});
7551}},
7552error: function (err){
7553console.log(err);
7554}});
7555}});
7556jQuery(document).on('click', '.event-pager ul li span', function (e){
7557var $this=jQuery(this),
7558pageNo=$this.data('pageno');
7559if($this.hasClass('current')){
7560return false;
7561}
7562jQuery('.event-pager ul li .current').removeClass('current');
7563$this.addClass('current');
7564jQuery('.list-calendar-pager-wrap.current-event-page-active').fadeOut(500, function (){
7565jQuery('.list-calendar-pager-wrap.current-event-page-active').removeClass('current-event-page-active');
7566jQuery('.list-calendar-pager-wrap .active-event-for-map').removeClass('active-event-for-map');
7567if(jQuery('.calender-type-wrap').attr('data-activetoggle')=='map'){
7568jQuery('.list-calendar-pager-wrap:eq(' + pageNo + ')').addClass('current-event-page-active');
7569jQuery('.current-event-page-active .events-by-day-wrap').addClass('active-event-for-map');
7570jQuery('.calender-header-switcher ul li.show-calander-map').trigger('click');
7571}else{
7572jQuery('.list-calendar-pager-wrap:eq(' + pageNo + ')').fadeIn(500, function (){
7573jQuery('.list-calendar-pager-wrap:eq(' + pageNo + ')').addClass('current-event-page-active');
7574jQuery('.current-event-page-active .events-by-day-wrap').addClass('active-event-for-map');
7575});
7576}});
7577});
7578jQuery(document).on('click', '.event-npw', function (){
7579var $this=jQuery(this),
7580targetWeek=$this.data('targetweek');
7581var maxWeeks=jQuery('.event-calender-weekly .week-days-wrap').length;
7582if(targetWeek > 0&&targetWeek <=maxWeeks){
7583jQuery('.week-days-wrap.active-week').removeClass('active-week');
7584jQuery('.week-days-wrap').hide();
7585jQuery('.event-week-' + targetWeek).show();
7586jQuery('.week-days-wrap.event-week-' + targetWeek).addClass('active-week');
7587var weekFirstDate=jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:first .week-day-date').text();
7588var weekLastDate=jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:last .week-day-date').text();
7589if(weekFirstDate==''){
7590weekFirstDate='1';
7591}
7592if(weekLastDate==''){
7593weekLastDate='31';
7594}
7595getActiveWeekEvents(weekFirstDate, weekLastDate);
7596}});
7597jQuery(document).on('click', '.week-days-wrap .week-day-box.has-events', function (){
7598var $this=jQuery(this),
7599targetE=$this.data('ewt');
7600jQuery('.events-for-day:visible').slideUp('fast', function (){
7601jQuery('.' + targetE).slideDown('fast');
7602});
7603});
7604jQuery(document).ready(function (){
7605jQuery('.active-week').removeClass('active-week');
7606jQuery('.week-day-box.has-events:first').closest('.week-days-wrap').addClass('active-week');
7607var weekFirstDate=jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:first .week-day-date').text();
7608var weekLastDate=jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:last .week-day-date').text();
7609getActiveWeekEvents(weekFirstDate, weekLastDate);
7610if(jQuery('.event-calender-modern').length > 0){
7611jQuery('.week-day-date-box.has-events:first').trigger('click');
7612}});
7613function showClassicCalEvents(ewtTarget){
7614jQuery('.event-calender-classic-map').empty();
7615if(jQuery('.events-by-day-wrap.caew-box').length > 0){
7616jQuery('.active-event-for-map').removeClass('active-event-for-map');
7617jQuery('.caew-box').removeClass('caew-box').fadeOut(500, function (){
7618jQuery('.events-by-day-wrap[data-ebdt="' + ewtTarget + '"]').addClass('caew-box').fadeIn();
7619jQuery('.events-by-day-wrap[data-ebdt="' + ewtTarget + '"]').find('.event-by-day-wrap').addClass('active-event-for-map');
7620if(jQuery('.calender-type-wrap').attr('data-activetoggle')=='map'){
7621jQuery('.active-event-for-map').hide();
7622jQuery('.calender-header-switcher ul li.show-calander-map.show-calander-map-' + ewtTarget).trigger('click');
7623}else{
7624jQuery('.calender-header-switcher ul li.show-calader-list').addClass('active');
7625jQuery('.active-event-for-map').show();
7626}});
7627}else{
7628jQuery('.active-event-for-map').removeClass('active-event-for-map');
7629jQuery('.events-by-day-wrap[data-ebdt="' + ewtTarget + '"]').addClass('caew-box').fadeIn();
7630jQuery('.events-by-day-wrap[data-ebdt="' + ewtTarget + '"]').find('.event-by-day-wrap').addClass('active-event-for-map');
7631if(jQuery('.calender-type-wrap').attr('data-activetoggle')!='map'){
7632jQuery('.events-by-day-wrap[data-ebdt="' + ewtTarget + '"]').find('.event-by-day-wrap').fadeIn();
7633}}
7634}
7635function showClassic2CalEvents(ewtTarget, targetDate){
7636var TargetDate=targetDate.split('-');
7637jQuery('.event-calander-classic2 .today-event-date-container span').text(TargetDate[1] + ' ' + TargetDate[0]);
7638jQuery('.event-calender-classic-map').empty();
7639jQuery('.active-event-for-map').hide().removeClass('active-event-for-map');
7640jQuery('.event-calander-classic2').fadeIn(500);
7641if(jQuery('.calender-type-wrap').attr('data-activetoggle')=='map'){
7642jQuery('.event-calander-classic2 .event-by-day-wrap[data-ebdt="' + ewtTarget + '"]').addClass('active-event-for-map');
7643jQuery('.event-calander-classic2 .calender-header-switcher .show-calander-map').trigger('click');
7644}else{
7645jQuery('.event-calander-classic2 .event-by-day-wrap[data-ebdt="' + ewtTarget + '"]').addClass('active-event-for-map').fadeIn();
7646}}
7647function getActiveWeekEvents(weekFirstDate, weekLastDate){
7648jQuery('.event-calender-weekly .event-by-day-wrap-inner.events-for-day').each(function (){
7649var $this=jQuery(this),
7650targetDate=$this.data('targetdate');
7651$this.removeClass('active-event-for-map');
7652$this.fadeOut(500);
7653if(targetDate >=weekFirstDate&&targetDate <=weekLastDate){
7654$this.addClass('active-event-for-map');
7655if(jQuery('.calender-type-wrap').attr('data-activetoggle')=='calander' ||
7656jQuery('.calender-type-wrap').attr('data-activetoggle')==undefined
7657){
7658$this.fadeIn(500);
7659}}
7660});
7661if(jQuery('.calender-type-wrap').attr('data-activetoggle')=='map'){
7662jQuery('.calender-header-switcher ul li.show-calander-map').trigger('click');
7663}}
7664function getCalanderMapView(cType, $this){
7665var mapWrapTartget='.event-calender-weekly-map',
7666eventWrapTarget='.event-by-day-wrap-inner',
7667mapContainer='map';
7668if(cType=='event-calender-list-view'){
7669mapWrapTartget='.event-calander-list-map';
7670eventWrapTarget='.current-event-page-active';
7671}
7672if(cType=='event-calender-modern'){
7673mapWrapTartget='.event-calander-moder-map';
7674eventWrapTarget='.events-by-day-wrap.active-event-for-map';
7675}
7676if(cType=='event-calender-classic'){
7677eventWrapTarget='.event-by-day-wrap.active-event-for-map';
7678if(jQuery('.event-calander-classic2').length==0){
7679var mapDate=$this.data('targetdate');
7680mapWrapTartget='.event-calender-classic-map.classic-map-' + mapDate;
7681}else{
7682mapWrapTartget='.event-calender-classic-map';
7683}}
7684if($this.hasClass('show-calander-map')){
7685jQuery('div[data-ctype="' + cType + '"]').attr('data-activetoggle', 'map');
7686jQuery(eventWrapTarget).fadeOut(500, function (){
7687jQuery(mapWrapTartget).empty();
7688jQuery(mapWrapTartget).html('<div id="map" class="event-calander-map"></div>');
7689jQuery(mapWrapTartget).fadeIn();
7690loadCalanderMap(mapContainer);
7691});
7692}
7693if($this.hasClass('show-calader-list')){
7694jQuery('div[data-ctype="' + cType + '"]').attr('data-activetoggle', 'calander');
7695jQuery(mapWrapTartget).fadeOut(500, function (){
7696if(cType=='event-calender-classic-weekly'){
7697var weekFirstDate=jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:first .week-day-date').text();
7698var weekLastDate=jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:last .week-day-date').text();
7699getActiveWeekEvents(weekFirstDate, weekLastDate);
7700}
7701if(cType=='event-calender-list-view'||cType=='event-calender-modern'||cType=='event-calender-classic'){
7702jQuery(eventWrapTarget).fadeIn(500);
7703}});
7704}}
7705function loadCalanderMap(mapContainer){
7706var defmaplat=jQuery('body').data('defaultmaplat');
7707var defmaplong=jQuery('body').data('defaultmaplot');
7708var map=null
7709$mtoken=jQuery('#page').data("mtoken");
7710$mtype=jQuery('#page').data("mtype");
7711$mapboxDesign=jQuery('#page').data("mstyle");
7712if($mtoken!=''&&$mtype=='mapbox'){
7713L.mapbox.accessToken=$mtoken;
7714map=L.mapbox.map(mapContainer);
7715L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
7716id: jQuery('#page').data("mstyle"),
7717accessToken: jQuery('#page').data("mtoken")
7718}).addTo(map);
7719var markers=new L.MarkerClusterGroup();
7720initializeMap(markers);
7721if(markers===undefined){
7722}else{
7723map.fitBounds(markers.getBounds());
7724map.scrollWheelZoom.disable();
7725}}else{
7726var map=new L.Map('map', {
7727minZoom: 3,
7728}
7728).setView(new L.LatLng(defmaplat, defmaplong), 18);
7729if($mtype=='google'){
7730L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
7731maxZoom: 18,
7732subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
7733noWrap: true,
7734});
7735var googleLayer=new L.Google('ROADMAP');
7736map.addLayer(googleLayer);
7737}else{
7738L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
7739}
7740var markers=new L.MarkerClusterGroup();
7741initializeMap(markers);
7742if(markers===undefined){
7743}else{
7744map.fitBounds(markers.getBounds(), { padding: [50, 50] });
7745}}
7746function initializeMap(markers){
7747markers.clearLayers();
7748if(jQuery('.active-event-for-map').length > 0){
7749jQuery('.active-event-for-map').each(function (){
7750var LPtitle=jQuery(this).data("title"),
7751siteURL=jQuery('#page').data("site-url");
7752LPposturl=jQuery(this).data("posturl"),
7753LPlattitue=jQuery(this).data("lattitue"),
7754LPlongitute=jQuery(this).data("longitute"),
7755LPpostid=jQuery(this).data("postid"),
7756LPimageSrc=jQuery(this).find('.event-img').find('img').attr('src'),
7757LPaddress=jQuery(this).data('address');
7758if(LPlattitue!=''&&LPlongitute!=''){
7759var LPimage='';
7760if(LPimageSrc!=''){
7761LPimage=LPimageSrc;
7762}
7763var markerLocation=new L.LatLng(LPlattitue, LPlongitute);
7764var CustomHtmlIcon=L.HtmlIcon.extend({
7765options: {
7766html: "<div class='lpmap-icon-shape pin card" + LPpostid + "'><div class='lpmap-icon-contianer'><img alt='image' src='" + siteURL + "/wp-content/themes/listingpro/assets/images/pins/lp-logo.png' /></div></div>",
7767}});
7768var customHtmlIcon=new CustomHtmlIcon();
7769var marker=new L.Marker(markerLocation, { icon: customHtmlIcon }).bindPopup('<div class="map-post"><div class="map-post-thumb"><a href="' + LPposturl + '"><img alt="image" src="' + LPimage + '" ></a></div><div class="map-post-des"><div class="map-post-title"><h5><a href="' + LPposturl + '">' + LPtitle + '</a></h5></div><div class="map-post-address"><p><i class="fa fa-map-marker"></i> ' + LPaddress + '</p></div></div></div>').addTo(map);
7770markers.addLayer(marker);
7771map.addLayer(markers);
7772}});
7773}else{
7774alert('no listing foound');
7775}}
7776}
7777jQuery(document).on('click', '.event-tickets-list-dash i', function (e){
7778var $this=jQuery(this),
7779$thisWrap=$this.closest('.event-tickets-list-dash'),
7780currentUrls=$thisWrap.find('input[type="hidden"]').val(),
7781ticketPlatform=$this.attr('data-ticket-platform'),
7782ticketUrl=$this.attr('data-ticket-url'),
7783newUrls='';
7784if(currentUrls.indexOf(',') > -1){
7785if(currentUrls.indexOf(',' + ticketPlatform) > -1){
7786var findStr=',' + ticketPlatform + '|' + ticketUrl;
7787}else{
7788var findStr=ticketPlatform + '|' + ticketUrl;
7789}
7790newUrls=currentUrls.replace(findStr, '');
7791}else{
7792var findStr=ticketPlatform + '|' + ticketUrl;
7793newUrls=currentUrls.replace(findStr, '');
7794}
7795$thisWrap.find('input[type="hidden"]').val(newUrls);
7796jQuery(this).closest('li').remove();
7797});
7798jQuery(document).on('click', '#add-event-ticket-platform', function (e){
7799var thisWrap=jQuery(this).closest('.lp-coupon-box-row'),
7800ticketPlatform=thisWrap.find('.event-tickets-platforms').val(),
7801ticketUrl=thisWrap.find('.event-ticket-url').val(),
7802currentUrls=thisWrap.find('input[type="hidden"]').val();
7803if(ticketUrl==''){
7804thisWrap.find('.event-ticket-url').addClass('error');
7805return false;
7806}else{
7807thisWrap.find('.event-ticket-url').removeClass('error');
7808}
7809if(ticketPlatform==''){
7810thisWrap.find('.event-tickets-platforms').addClass('error');
7811return false;
7812}else{
7813thisWrap.find('.event-tickets-platforms').removeClass('error');
7814}
7815var embedMarkup='<li><strong>' + ticketPlatform + '</strong> ' + ticketUrl + ' <i class="fa fa-times" data-ticket-platform="' + ticketPlatform + '" data-ticket-url="' + ticketUrl + '"></i></li>';
7816thisWrap.find('.event-tickets-list-dash ul').append(embedMarkup);
7817if(currentUrls==''){
7818thisWrap.find('input[type="hidden"]').val(ticketPlatform + '|' + ticketUrl);
7819}else{
7820thisWrap.find('input[type="hidden"]').val(currentUrls + ',' + ticketPlatform + '|' + ticketUrl);
7821}});
7822jQuery(document).on('click', '#add-new-service', function (e){
7823var $this=jQuery(this),
7824uid=$this.attr('data-uid'),
7825$thisWrap=$this.closest('.ordering-service-wrap'),
7826serviceVal=$thisWrap.find('select').val(),
7827serviceUrl=$thisWrap.find('input#service_url').val();
7828if($thisWrap.find('li:contains("' + serviceVal + '")').length){
7829$thisWrap.find('li:contains("' + serviceVal + '")').css('color', 'red');
7830return false;
7831}
7832if(jQuery('#service_url').val().length < 1){
7833jQuery('.form-group.menu_online_order_url').addClass('with_error');
7834return false;
7835}else{
7836jQuery('.form-group.menu_online_order_url').removeClass('with_error');
7837if(/^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i.test(jQuery("#service_url").val())){
7838jQuery('.form-group.menu_online_order_url').removeClass('with_error');
7839}else{
7840jQuery('.form-group.menu_online_order_url').addClass('with_error');
7841return false;
7842}}
7843jQuery('#add-new-service-spinner').fadeIn();
7844jQuery.ajax({
7845type: 'POST',
7846dataType: 'json',
7847url: ajax_search_term_object.ajaxurl,
7848data: {
7849'action': 'add_menu_service_cb',
7850'serviceVal': serviceVal,
7851'serviceUrl': serviceUrl,
7852'user_id': uid,
7853'lpNonce': jQuery('#lpNonce').val()
7854},
7855success: function (res){
7856jQuery('.form-group.menu_online_order_url').removeClass('with_error');
7857if(res.status=='success'){
7858jQuery('#add-new-service-spinner').fadeOut();
7859$thisWrap.find('li.no-services').remove();
7860$thisWrap.find('ul').append(res.msg);
7861}
7862console.log(res);
7863},
7864error: function (err){
7865alert(err);
7866$this.find('i').remove();
7867}});
7868});
7869jQuery(document).on('click', '#add-new-type', function (e){
7870e.preventDefault();
7871var $this=jQuery(this),
7872$thisWrap=$this.closest('#manage-types-content'),
7873newType=$thisWrap.find('input[type="text"]').val(),
7874uid=$this.data('uid');
7875if(newType==''){
7876$thisWrap.find('input[type="text"]').addClass('error');
7877return false;
7878}else{
7879$thisWrap.find('input[type="text"]').removeClass('error');
7880$this.addClass('processing');
7881}
7882if($thisWrap.find('li:contains("' + newType + '")').length){
7883$thisWrap.find('li:contains("' + newType + '")').css('color', 'red');
7884return false;
7885}
7886jQuery('#add-new-type-spinner').fadeIn();
7887$this.hide();
7888jQuery.ajax({
7889type: 'POST',
7890dataType: 'json',
7891url: ajax_search_term_object.ajaxurl,
7892data: {
7893'action': 'add_menu_type_cb',
7894'user_id': uid,
7895'type': newType,
7896'lpNonce': jQuery('#lpNonce').val()
7897},
7898success: function (res){
7899jQuery('#add-new-type-spinner').fadeOut();
7900$this.removeClass('processing');
7901$this.show();
7902$thisWrap.find('input[type="text"]').val('');
7903jQuery('.lp-menu-step-one .panel-heading .nav-tabs li.active').removeClass('active');
7904jQuery('.lp-menu-step-one .panel-body .tab-content .tab-pane.active').removeClass('in active');
7905var embed_markup='<li>' + newType + ' <span class="del-group-type del-type del-this" data-uid="' + uid + '" data-targetid="' + res.data_index + '"><i class="fa fa-trash"></i></span></li>';
7906var embed_tab='<li class="active"><a href="#type-' + newType + '" data-toggle="tab">' + newType + '</a></li>';
7907var embed_tab_cn='<div class="tab-pane fade in active" id="type-' + newType + '"></div>';
7908$thisWrap.find('ul').append(embed_markup);
7909jQuery('.lp-menu-step-one .panel-heading .nav-tabs').append(embed_tab);
7910jQuery('.lp-menu-step-one .panel-body .tab-content').append(embed_tab_cn);
7911},
7912error: function (err){
7913alert(err);
7914$this.find('i').remove();
7915$this.show();
7916}});
7917});
7918jQuery(document).on('click', '#add-new-group', function (e){
7919e.preventDefault();
7920var $this=jQuery(this),
7921$thisWrap=$this.closest('#manage-groups-content'),
7922newGroup=$thisWrap.find('input[type="text"]').val(),
7923uid=$this.data('uid');
7924if(newGroup==''){
7925$thisWrap.find('input[type="text"]').addClass('error');
7926return false;
7927}else{
7928$thisWrap.find('input[type="text"]').removeClass('error');
7929$this.addClass('processing');
7930}
7931if($thisWrap.find('li:contains("' + newGroup + '")').length){
7932$thisWrap.find('li:contains("' + newGroup + '")').css('color', 'red');
7933return false;
7934}
7935jQuery('#add-new-group-spinner').fadeIn();
7936$this.hide();
7937jQuery.ajax({
7938type: 'POST',
7939dataType: 'json',
7940url: ajax_search_term_object.ajaxurl,
7941data: {
7942'action': 'add_menu_group_cb',
7943'user_id': uid,
7944'group': newGroup,
7945'lpNonce': jQuery('#lpNonce').val()
7946},
7947success: function (res){
7948jQuery('#add-new-group-spinner').fadeOut();
7949$this.removeClass('processing');
7950$this.show();
7951$thisWrap.find('input[type="text"]').val('');
7952var embed_markup='<li>' + newGroup + ' <span class="del-group-type del-group del-this" data-uid="' + uid + '" data-targetid="' + res.data_index + '"><i class="fa fa-trash"></i></span></li>';
7953$thisWrap.find('ul').append(embed_markup);
7954var optData={
7955id: newGroup,
7956text: newGroup
7957};
7958var newOption=new Option(optData.text, optData.id, false, false);
7959jQuery('#menu-group').append(newOption).trigger('change');
7960var currentGroups=jQuery('#menu-group').val();
7961if(currentGroups==null){
7962jQuery('#menu-group').val(group).trigger('change');
7963}else{
7964currentGroups.push(group);
7965jQuery('#menu-group').val(currentGroups).trigger('change');
7966}},
7967error: function (err){
7968$this.show();
7969alert(err);
7970$this.find('i').remove();
7971}});
7972});
7973jQuery(document).on('click', '.manange-typs-groups-tabs li', function (e){
7974e.preventDefault();
7975jQuery('.manange-typs-groups-tabs li.active').removeClass('active');
7976jQuery(this).addClass('active');
7977var targetID=jQuery(this).attr('id');
7978if(targetID=='manage-types-tab'){
7979jQuery('#manage-groups-content').removeClass('active-content');
7980jQuery('#manage-types-content').addClass('active-content');
7981}else{
7982jQuery('#manage-types-content').removeClass('active-content');
7983jQuery('#manage-groups-content').addClass('active-content');
7984}});
7985jQuery('#menu-group').on('select2:select', function (e){
7986jQuery('#menu-form-toggle').slideDown();
7987});
7988function myFuction(el){
7989jQuery(el).find('.show-number').css('display', 'none');
7990jQuery(el).find('.grind-number').css('display', 'inline-block');
7991}
7992jQuery(document).on('click', '.listing-app-view-new-discount', function (){
7993var $this=jQuery(this),
7994target=$this.closest('.app-view2-first-recent');
7995jQuery('.app-view2-first-recent').find('.popover_overlay.active_popover_overlay').removeClass('active_popover_overlay');
7996if($this.hasClass('current-active-pop')){
7997$this.removeClass('current-active-pop')
7998}else{
7999$this.addClass('current-active-pop');
8000target.find('.popover_overlay').addClass('active_popover_overlay');
8001}});
8002jQuery(document).on('change', '#lp-menus #menu-listing', function (){
8003var selectedListingID=jQuery(this).find(":selected").val();
8004jQuery.ajax({
8005dataType: 'html',
8006url: ajax_search_term_object.ajaxurl,
8007data: {
8008'action': 'listingpro_dashboard_menu_of_listing',
8009'selectedListingID': selectedListingID,
8010'lpNonce': jQuery('#lpNonce').val()
8011},
8012success: function (res){
8013jQuery('.lp-compaignForm-leftside .lp-menu-panel-body-outer').html(res);
8014},
8015error: function (err){
8016console.log(err);
8017},
8018});
8019});
8020jQuery(document).on('click', '.del-this-menu', function (e){
8021e.preventDefault();
8022jQuery('.remove-active-menu').removeClass('remove-active-menu');
8023jQuery(this).addClass('remove-active-menu');
8024jQuery('#dashboard-delete-modal3').modal('show');
8025jQuery('.modal-backdrop').hide();
8026});
8027jQuery(document).on('click', '.dashboard-confirm-del-menu-btn', function (e){
8028var $this=jQuery('.remove-active-menu'),
8029lid=$this.data('targetid'),
8030user_id=$this.data('uid');
8031jQuery(this).append('<i class="fa fa-spin fa-spinner" style="margin-left: 5px;"></i>');
8032jQuery.ajax({
8033type: 'POST',
8034dataType: 'json',
8035url: ajax_search_term_object.ajaxurl,
8036data: {
8037'action': 'del_assigned_menu_to_listing',
8038'user_id': user_id,
8039'lid': lid,
8040'lpNonce': jQuery('#lpNonce').val()
8041},
8042success: function (res){
8043if(res.status=='success'){
8044location.reload();
8045}
8046$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
8047},
8048error: function (err){
8049console.log(err);
8050$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
8051}});
8052});
8053jQuery(document).on('click', '.open-edit-this-menu', function (e){
8054e.preventDefault();
8055var targetID=jQuery(this).data('targetid'),
8056listingTitle=jQuery(this).data('targettitle');
8057jQuery('.panel.with-nav-tabs.panel-default.lp-dashboard-tabs').fadeOut("slow", function (){
8058jQuery('div.tab-pane.fade.in.active.clearfix.lp-dashboard-menu-container').fadeIn("fast", function (){
8059jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.lp-left-panel-height.lp-left-panel-height-outer').fadeIn("fast");
8060});
8061});
8062if(jQuery('#menu-listing').hasClass('select2-ajax')){
8063if(jQuery('#menu-listing').find("option[value='" + targetID + "']").length){
8064jQuery('#menu-listing').val(targetID).trigger('change');
8065}else{
8066var newOption=new Option(listingTitle, targetID, true, true);
8067jQuery('#menu-listing').append(newOption).trigger('change');
8068}}else{
8069jQuery('#menu-listing').val(targetID);
8070jQuery('#menu-listing').trigger('change');
8071}});
8072jQuery(document).on('click', '.discount-bar', function (e){
8073var $this=jQuery(this),
8074thisWrap=$this.closest('.lp-listing-bottom-right');
8075$this.toggleClass('active-discount-bar');
8076if($this.hasClass('active-discount-bar')){
8077$this.find('i.pull-right').removeClass('fa-chevron-down').addClass('fa-chevron-up');
8078}else{
8079$this.find('i.pull-right').removeClass('fa-chevron-up').addClass('fa-chevron-down');
8080}
8081thisWrap.find('.coupons-bottom-content-wrap').slideToggle(function (){
8082$this.closest('.lp-listing-bottom-right').toggleClass('active');
8083});
8084});
8085jQuery(document).on('click', '.del-order-service', function (e){
8086var $this=jQuery(this),
8087uid=$this.attr('data-uid'),
8088target=$this.attr('data-target');
8089if($this.hasClass('active-ajax')){
8090}else{
8091$this.addClass('active-ajax');
8092$this.find('i').removeClass('fa-trash').addClass('fa-spinner fa-spin');
8093jQuery.ajax({
8094type: 'POST',
8095dataType: 'json',
8096url: ajax_search_term_object.ajaxurl,
8097data: {
8098'action': 'del_ordering_service',
8099'uid': uid,
8100'target': target,
8101'lpNonce': jQuery('#lpNonce').val()
8102},
8103success: function (res){
8104if(res.status=='success'){
8105$this.closest('li').remove();
8106}},
8107error: function (err){
8108console.log(err);
8109$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
8110}});
8111}});
8112jQuery(document).on('click', '.delete-my-review', function (e){
8113e.preventDefault();
8114var $this=jQuery(this),
8115reviewID=$this.attr('data-reviewid');
8116if($this.hasClass('active-ajax')){
8117}else{
8118$this.addClass('active-ajax');
8119$this.append('<i class="fa fa-spinner fa-spin" style="margin-left: 5px;"></i>');
8120jQuery.ajax({
8121type: 'POST',
8122dataType: 'json',
8123url: ajax_search_term_object.ajaxurl,
8124data: {
8125'action': 'delete_own_review',
8126'reviewID': reviewID,
8127'lpNonce': jQuery('#lpNonce').val()
8128},
8129success: function (res){
8130location.reload();
8131},
8132error: function (err){
8133console.log(err);
8134$this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
8135}});
8136}});
8137jQuery(document).ready(function (){
8138jQuery('.lp-ad-location-image').click(function (e){
8139e.preventDefault();
8140var img_src=jQuery(this).find('img').data('model_img_src_ad');
8141jQuery('#ad_preview').find('img#imgsrc').attr('src', img_src);
8142});
8143});
8144jQuery(document).on('click', '.app-view2-show-search', function (e){
8145e.preventDefault();
8146var inputField=jQuery('.dropdown_fields');
8147inputField.trigger('click');
8148});
8149jQuery(document).ready(function(){
8150function checkDivHeight(){
8151var divHeight=jQuery('header').height();
8152if(jQuery('#wpadminbar').length > 0){
8153divHeight=divHeight + 32;
8154}
8155jQuery('.page-container:not(.lp-sidebar-filters-style) .outer_all_page_overflow').css({
8156"padding-top": divHeight
8157});
8158jQuery('.header-more-filters .lp_all_page_overflow').css({
8159"padding-top": divHeight + 45
8160});
8161}
8162jQuery(window).resize(function(){
8163checkDivHeight();
8164});
8165jQuery('.lp_all_page_overflow_after').click(function(){
8166jQuery(this).closest('.outer_all_page_overflow').removeClass('hide-filters');
8167});
8168});
8169(()=>{var t={724:(t,e,a)=>{var n,c,i;function o(){"use strict";o=function(){return t};var t={},e=Object.prototype,a=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},c=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function h(t,e,a){return Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,a){return t[e]=a}}function l(t,e,a,n){var c=e&&e.prototype instanceof g?e:g,i=Object.create(c.prototype),o=new j(n||[]);return i._invoke=function(t,e,a){var n="suspendedStart";return function(c,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===c)throw i;return S()}for(a.method=c,a.arg=i;;){var o=a.delegate;if(o){var s=C(o,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===n)throw n="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);n="executing";var h=d(t,e,a);if("normal"===h.type){if(n=a.done?"completed":"suspendedYield",h.arg===y)continue;return{value:h.arg,done:a.done}}"throw"===h.type&&(n="completed",a.method="throw",a.arg=h.arg)}}}(t,a,o),i}function d(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var y={};function g(){}function p(){}function f(){}var u={};h(u,c,(function(){return this}));var v=Object.getPrototypeOf,w=v&&v(v(I([])));w&&w!==e&&a.call(w,c)&&(u=w);var m=f.prototype=g.prototype=Object.create(u);function _(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function n(c,i,o,s){var h=d(t[c],t,i);if("throw"!==h.type){var l=h.arg,y=l.value;return y&&"object"==r(y)&&a.call(y,"__await")?e.resolve(y.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(y).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,s)}))}s(h.arg)}var c;this._invoke=function(t,a){function i(){return new e((function(e,c){n(t,a,e,c)}))}return c=c?c.then(i,i):i()}}function C(t,e){var a=t.iterator[e.method];if(void 0===a){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&
vendor: 6,844 bytes, line 8169
8169(e.method="return",e.arg=void 0,C(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var n=d(a,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,y;var c=n.arg;return c?c.done?(e[t.resultName]=c.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,y):c:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(a.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=f,h(m,"constructor",f),h(f,"constructor",p),p.displayName=h(f,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,h(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},_(b.prototype),h(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,a,n,c,i){void 0===i&&(i=Promise);var o=new b(l(e,a,n,c),i);return t.isGeneratorFunction(a)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},_(m),h(m,s,"Generator"),h(m,c,(function(){return this})),h(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var a in t)e.push(a);return e.reverse(),function a(){for(;e.length;){var n=e.pop();if(n in t)return a.value=n,a.done=!1,a}return a.done=!0,a}},t.values=I,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(a,n){return o.type="throw",o.arg=t,e.next=a,n&&(e.method="next",e.arg=void 0),!!n}for(var c=this.tryEntries.length-1;c>=0;--c){var i=this.tryEntries[c],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),h=a.call(i,"finallyLoc");if(s&&h){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var c=this.tryEntries[n];if(c.tryLoc<=this.prev&&a.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var i=c;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),k(a),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var n=a.completion;if("throw"===n.type){var c=n.arg;k(a)}return c}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,a){return this.delegate={iterator:I(t),resultName:e,nextLoc:a},"next"===this.method&&(this.arg=void 0),y}},t}function s(t,e,a,n,c,i,o){try{var s=t[i](o),h=s.value}catch(t){return void a(t)}s.done?e(h):Promise.resolve(h).then(n,c)}function h(t){return function(){var e=this,a=arguments;return new Promise((function(n,c){var i=t.apply(e,a);function o(t){s(i,n,c,o,h,"next",t)}function h(t){s(i,n,c,o,h,"throw",t)}o(void 0)}))}}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}!function(){"use strict";c=[a(311)],n=function(t,e){var a,n,c=[],i="",s=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
8169substr(0,4))?1:0,y=["System Stack","Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia","-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"],g=!0,p=!1,f=0,u=!1,v=!1,w=[],m=0,_=0,b="",C=0,x="";function k(){chatyInterval=setInterval((function(){"object"==("undefined"==typeof chaty_settings?"undefined":r(chaty_settings))&&(clearInterval(chatyInterval),"object"!=("undefined"==typeof chaty_settings?"undefined":r(chaty_settings))||"on"==chaty_settings.data_analytics_settings&&"off"!=chaty_settings.data_analytics_settings||(g=!0),yt(chaty_settings.has_chatway)&&t("body").addClass("csaas-has-chatway"),c=chaty_settings.chaty_widgets,I())}),1e3)}function j(a){if(t("#chaty-widget-"+a).data("animation")!=e&&"none"!=t("#chaty-widget-"+a).data("animation")){var n="chaty-animation-"+t("#chaty-widget-"+a).data("animation");t("#chaty-widget-"+a+" ."+n).removeClass(n)}t("#chaty-widget-"+a+" .ch-pending-msg").remove()}function I(){var e=!1;c.length&&t.each(c,(function(t,a){yt(a.triggers.has_countries)&&!R(a.triggers.countries)&&a.triggers.countries.length&&(e=!0)})),e?""!=(i=ut())?L():S():L()}function S(){var e="https://www.cloudflare.com/cdn-cgi/trace";t.get(e,(function(t){var e=t.match("loc=(.*)");e.length>1&&(e=e[1])&&(""==(e=e.toUpperCase())&&(e="-"),vt(e),L())}))}function L(){c.length&&(t("body").append('<svg width="39" height="39" viewBox="0 0 39 39" class="hide-cht-svg-bg" fill="none" xmlns="http://www.w3.org/2000/svg"><defs> <linearGradient id="linear-gradient" x1="0.892" y1="0.192" x2="0.128" y2="0.85" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="#4a64d5"/> <stop offset="0.322" stop-color="#9737bd"/> <stop offset="0.636" stop-color="#f15540"/> <stop offset="1" stop-color="#fecc69"/> </linearGradient> <linearGradient id="linear-gradient-insta-dm" x1="0.892" y1="0.192" x2="0.128" y2="0.85" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="#4A64D5"></stop> <stop offset="0.322" stop-color="#9737BD"></stop> <stop offset="0.636" stop-color="#F15540"></stop> <stop offset="1" stop-color="#FECC69"></stop> </linearGradient></defs>'),t.each(c,(function(e,a){var n="",i="",o=0,s=[],h={},r=ft(a);r=(r=r&&pt(a))&&dt(a);var l=null,d=0,g=null,w=!1;t.each(a.channels,(function(t,e){T(e)&&("Chatway"===e.channel?(d=!0,g=e.chatway_position,l=e,"inside-chaty"!==g&&"chat-view"!==a.settings.cta_type||(w=!0,o++,s.push(e))):(h=e,s.push(e),o++))})),"open"==a.settings.default_state&&1==o&&"chat-view"!=a.settings.cta_type&&(a.settings.default_state="click",c[e].settings.default_state="click");var m="";if(d&&(m="has-chatway-channel"),(1!=o||!w)&&r&&o>0&&!t("#chaty-widget-"+a.id).length){var _=Q(a.settings);_="right"==_?"right":"left";var C=J(a);if("chat-view"==a.settings.cta_type){var x="<div style='display: none' class='chaty chaty-has-chat-view chaty-id-"+a.id+" chaty-widget-"+a.id+" chaty-key-"+e+"' id='chaty-widget-"+a.id+"' data-key='"+e+"' data-id='"+a.id+"' data-identifier='"+a.identifier+"' data-nonce='"+a.settings.widget_token+"' ><div class='chaty-widget "+_+"-position'><div class='chaty-channels'><div class='chaty-channel-list' id='csaas-channels-"+a.id+"'></div><div class='chaty-i-trigger csaas-widget-trigger "+m+"'></div></div></div></div>";t("body").append(x),E(a)}else{x="<div style='display: none' class='chaty chaty-id-"+a.id+" chaty-widget-"+a.id+" chaty-key-"+e+"' id='chaty-widget-"+a.id+"' data-key='"+e+"' data-id='"+a.id+"' data-identifier='"+a.identifier+"' data-nonce='"+a.settings.widget_token+"' ><div class='chaty-widget "+_+"-position'><div class='chaty-channels'><div class='chaty-channel-list' id='csaas-channels-"+a.id+"'></div><div class='chaty-i-trigger csaas-widget-trigger "+m+"'></div></div></div></div>";t("body").append(x)}yt(a.triggers.auto_hide_widget)&&parseInt(a.triggers.hide_after)>0&&(t("#chaty-widget-"+a.id).addClass("auto-hide-chaty"),t("#chaty-widget-"+a.id).attr("data-time",a.triggers.hide_after));var k=xt(a.id,"c-widget");if(t("#chaty-widget-"+a.id).addClass(a.settings.show_cta),1==o&&"chat-view"!=a.settings.cta_type){"vertical"!=a.settings.icon_view&&(C="right"!=_?"right":"left");var j=A(h,a.id,C);t("#chaty-widget-"+a.id+" .chaty-i-trigger").append(j),t("#chaty-widget-"+a.id+" .chaty-i-trigger").addClass("single-channel"),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel").addClass("single"),t("#chaty-widget-"+a.id+" .chaty-widget").addClass("has-single");var I=a.settings.cta_text;"first_click"==a.settings.show_cta&&(k?(t("#chaty-widget-"+a.id+" .chaty-tooltip").removeClass("chaty-tooltip"),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel").addClass("active").addClass("chaty-tooltip").addClass("pos-"+C),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel").append("<span class='on-hover-text'>"+I+"</span>").addClass("active").addClass("has-on-hover"),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel a").append("<span class='on-hover-text'>"+I+"</span>").addClass("has-on-hover"),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel a").attr("data-text",I)):t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel a").append("<span class='on-hover-text'>"+I+"</span>").removeClass("active").addClass("has-on-hover")),"all_time"==a.settings.show_cta&&(t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-tooltip").append("<span class='on-hover-text'>"+I+"</span>").addClass("active").addClass("has-on-hover"),t("#chaty-widget-"+a.id+" .chaty-i-trigger.single-channel .chaty-channel a").attr("data-text",I));var S=h;("Instagram"!=S.channel_type||"#ffffff"!=S.icon_color&&"#fff"!=S.icon_color)&&(n+="#chaty-widget-"+a.id+" ."+S.channel+"-channel .color-element{ fill: "+S.icon_color+"; color: "+S.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+S.channel+" .color-element{ fill: "+S.icon_color+"; color: "+S.icon_color+";}"),n+="#chaty-widget-"+a.id+" ."+S.channel+"-channel .chaty-custom-icon { background-color: "+S.icon_color+"; }",n+="#chaty-widget-"+a.id+" ."+S.channel+"-channel .chaty-svg { background-color: "+S.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+S.channel+" .chaty-svg { background-color: "+S.icon_color+";}","Contact_Us"==S.channel_type&&(n+=".chaty-contact-form-box #chaty-submit-button-"+a.id+" {background-color: "+S.contact_form_settings.button_bg_color+"; color: "+S.contact_form_settings.button_text_color+";} ",n+="#chaty-form-"+a.id+"-Contact_Us .chaty-contact-form-title {background-color: "+S.contact_form_settings.title_bg_color+"; } ");var L='<div class="chaty-channel chaty-cta-close chaty-tooltip pos-'+C+'" data-hover="'+a.settings.close_text+'"><div class="chaty-cta-button"><button type="button"><span class="chaty-svg"><svg viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg"><ellipse cx="26" cy="26" rx="26" ry="26" fill="'+a.settings.widget_color+'"></ellipse><rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(18.35 15.6599) scale(0.998038 1.00196) rotate(45)" fill="'+a.settings.widget_icon_color+'"></rect><rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(37.5056 18.422) scale(0.998038 1.00196) rotate(135)" fill="'+a.settings.widget_icon_color+'"></rect></svg></span><span class="sr-only">Hide chaty</span></button></div></div>';t("#chaty-widget-"+a.id+" .chaty-i-trigger").append(L)}
8169else{t.each(a.channels,(function(e,c){if(T(c)&&("Chatway"!==c.channel||"inside-chaty"===g||"chat-view"===a.settings.cta_type)){if(Z(c.channel_type)&&(c.channel_type=c.channel),"chat-view"==a.settings.cta_type){var i=A(c,a.id,"top");t(".chaty-chat-view-"+a.id+" .chaty-view-channels").append(i)}else{i=A(c,a.id,C);t("#chaty-widget-"+a.id+" .chaty-channel-list").append(i)}("Instagram"!=c.channel_type&&"Instagram_DM"!=c.channel_type||"#ffffff"!=c.icon_color&&"#fff"!=c.icon_color)&&(n+="#chaty-widget-"+a.id+" ."+c.channel+"-channel .color-element{ fill: "+c.icon_color+"; color: "+c.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+c.channel+" .color-element{ fill: "+c.icon_color+"; color: "+c.icon_color+";}"),n+="#chaty-widget-"+a.id+" ."+c.channel+"-channel .chaty-custom-icon { background-color: "+c.icon_color+"; }",n+="#chaty-widget-"+a.id+" ."+c.channel+"-channel .chaty-svg { background-color: "+c.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+c.channel+" .chaty-svg { background-color: "+c.icon_color+";}",n+=".chaty-chat-view-"+a.id+" ."+c.channel+"-channel .chaty-custom-icon { background-color: "+c.icon_color+"; }",n+=".chaty-chat-view-"+a.id+" ."+c.channel+"-channel .chaty-svg { background-color: "+c.icon_color+";}",n+=".chaty-chat-view-"+a.id+" .channel-icon-"+c.channel+" .chaty-svg { background-color: "+c.icon_color+";}","Contact_Us"==c.channel_type&&(n+=".chaty-contact-form-box #chaty-submit-button-"+a.id+" {background-color: "+c.contact_form_settings.button_bg_color+"; color: "+c.contact_form_settings.button_text_color+";} ",n+="#chaty-form-"+a.id+"-Contact_Us .chaty-contact-form-title {background-color: "+c.contact_form_settings.title_bg_color+"; } ")}}));var D=st(a.settings,a.id);I=a.settings.cta_text;"first_click"==a.settings.show_cta&&(k||(I=""));var U=C;"horizontal"==a.settings.icon_view&&(U="left"==_?"right":"left");var W='<div class="chaty-channel chaty-cta-main chaty-tooltip has-on-hover pos-'+U+' active" data-widget="'+a.id+'" ><span class="on-hover-text">'+I+'</span><div class="chaty-cta-button"><button type="button" class="open-chaty">'+D+'<span class="sr-only">Open chaty</span></button><button type="button" class="open-chaty-channel"><span class="sr-only">chaty buttons</span></button></div></div>';t("#chaty-widget-"+a.id+" .chaty-i-trigger").html(W);L='<div class="chaty-channel chaty-cta-close chaty-tooltip pos-'+C+'" data-hover="'+a.settings.close_text+'"><div class="chaty-cta-button"><button type="button"><span class="chaty-svg"><svg viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg"><ellipse cx="26" cy="26" rx="26" ry="26" fill="'+a.settings.widget_color+'"></ellipse><rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(18.35 15.6599) scale(0.998038 1.00196) rotate(45)" fill="'+a.settings.widget_icon_color+'"></rect><rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(37.5056 18.422) scale(0.998038 1.00196) rotate(135)" fill="'+a.settings.widget_icon_color+'"></rect></svg></span><span class="sr-only">Hide chaty</span></button></div></div>';t("#chaty-widget-"+a.id+" .chaty-i-trigger").append(L)}t.each(a.channels,(function(t,e){"Contact_Us"==e.channel_type&&"yes"==e.hide_recaptcha_badge&&(n+=".grecaptcha-badge {visibility: hidden;}")})),"chat-view"==a.settings.cta_type&&a.settings.show_close_button,!(k=xt(a.id,"c-widget"))||"open"==a.settings.default_state&&1!=o||(rt(a.settings,a.id),ht(a.settings,a.id));var O=0;if("open"!=a.settings.default_state||yt(a.settings.show_close_button)||(t("#chaty-widget-"+a.id+" .chaty-widget").addClass("chaty-no-close-button").addClass("chaty-open"),O=1),d&&(t("#chaty-widget-"+a.id+" .chaty-widget").addClass(g),"above-chaty"===g)){t("#chaty-widget-"+a.id+" .chaty-widget").addClass("has-chatway");var P=J(a),N=A(l,a.id,P,e,a.settings);t("#chaty-widget-"+a.id).length&&(t("#chaty-widget-"+a.id+" .chaty-channel-list").prepend(N),b+="#chaty-widget-"+a.id+" ."+l.channel_type+"-channel .color-element{ fill: "+l.icon_color+"; color: "+l.icon_color+";}",b+="#chaty-widget-"+a.id+" ."+l.channel_type+"-channel .csaas-svg { background-color: "+l.icon_color+";}",b+=".channel-"+a.id+"-"+l.channel_type+" .csaas-svg { background-color: "+l.icon_color+";}",n+="#chaty-widget-"+a.id+" ."+l.channel_type+"-channel .chaty-custom-icon { background-color: "+l.icon_color+"; }",n+="#chaty-widget-"+a.id+" ."+l.channel_type+"-channel .chaty-svg { background-color: "+l.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+l.channel_type+" .chaty-svg { background-color: "+l.icon_color+";}")}yt(a.settings.is_google_analytics_enabled)&&(t("#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel > a").addClass("has-gae"),t("#chaty-form-"+a.id+"-chaty-chat-view .chaty-channel > a").addClass("has-gae"),t("#chaty-widget-"+a.id+" .chaty-i-trigger.single-channel .chaty-channel > a").addClass("has-gae"),t(".chaty-outer-forms.chaty-whatsapp-btn-form.chaty-form-"+a.id+" form.add-analytics").addClass("form-google-analytics"),t(".whatsapp-chaty-form-"+a.id).addClass("has-form-gae")),yt(a.settings.has_custom_css)&&!R(a.settings.custom_css)&&(i+=a.settings.custom_css),"hover"==a.settings.default_state?t("#chaty-widget-"+a.id).addClass("open-on-hover"):"open"==a.settings.default_state&&(t("#chaty-widget-"+a.id+" .chaty-widget").addClass("default-open"),!k&&yt(a.settings.show_close_button)||t("#chaty-widget-"+a.id+" .chaty-widget:not(.has-single)").addClass("chaty-open"),k||t("#chaty-widget-"+a.id+" .chaty-widget").removeClass("default-open")),t("#chaty-widget-"+a.id+" .chaty-widget:not(.has-single):not(.chaty-no-close-button)").hasClass("default-open")?yt(a.settings.bg_blur_effect)&&t("body").addClass("add-bg-blur-effect"):t("body").removeClass("add-bg-blur-effect"),yt(a.settings.bg_blur_effect)&&t("#chaty-widget-"+a.id+" .chaty-widget:not(.chaty-no-close-button)").addClass("has-bg-blur-effect");var H=z(a.settings.widget_size,a.settings.custom_widget_size);if(H=parseInt(H),n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel > a {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel > a .chaty-custom-icon {display:block; width: "+H+"px; height: "+H+"px; line-height: "+H+"px; font-size: "+parseInt(H/2)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel button {width: "+H+"px; height: "+H+"px; margin: 0; padding:0; outline: none; border-radius: 50%;}",n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel .chaty-svg {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel .chaty-svg img {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel span.chaty-icon {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel a {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel .chaty-svg .chaty-custom-c
8169hannel-icon {width: "+H+"px; height: "+H+"px; line-height: "+H+"px; display: block; font-size:"+parseInt(H/2)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-cta-button {background-color: "+a.settings.widget_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-cta-button button {background-color: "+a.settings.widget_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel > a {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel > a .chaty-custom-icon {display:block; width: "+H+"px; height: "+H+"px; line-height: "+H+"px; font-size: "+parseInt(H/2)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel button {width: "+H+"px; height: "+H+"px; margin: 0; padding:0; outline: none; border-radius: 50%;}",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel .chaty-svg {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel .chaty-svg img {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel span.chaty-icon {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel a {width: "+H+"px; height: "+H+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel .chaty-svg .chaty-custom-channel-icon {width: "+H+"px; height: "+H+"px; line-height: "+H+"px; display: block; font-size:"+parseInt(H/2)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .ch-pending-msg {background-color: "+a.settings.pending_mesg_count_bgcolor+"; color: "+a.settings.pending_mesg_count_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel .chaty-svg .widget-fa-icon {line-height: "+H+"px; font-size:"+parseInt(H/2)+"px; }","vertical"==a.settings.icon_view){n+="#chaty-widget-"+a.id+" .chaty-channel-list {height: "+o*(H+8)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list {width: "+(H+8)+"px; }";for(var q=0;q<=o;q++)n+="#chaty-widget-"+a.id+" .chaty-open .chaty-channel-list .chaty-channel:nth-child("+(q+1)+"){-webkit-transform: translateY(-"+(H+8)*(o-q-O)+"px); transform: translateY(-"+(H+8)*(o-q-O)+"px);}",n+="#chaty-widget-"+a.id+" .chaty-open.above-chaty.has-chatway .chaty-channel-list .chaty-channel:nth-child("+(q+1)+"){-webkit-transform: translateY(-"+(H+8)*(o-q-O+1)+"px); transform: translateY(-"+(H+8)*(o-q-O+1)+"px);}";if(d&&"inside-chaty"==g)for(var G=0,F=1,Y=0;Y<s.length;Y++)S=s[Y],n+="body.chatway--active #chaty-widget-"+a.id+" .chaty-open .chaty-channel-list .chaty-channel."+S.channel+"-link {-webkit-transform: translateY(-"+(H+8)*(o-G-O)+"px); transform: translateY(-"+(H+8)*(o-G-O)+"px);}","Chatway"!=S.channel?n+="body:not(.chatway--active) #chaty-widget-"+a.id+" .chaty-open .chaty-channel-list .chaty-channel."+S.channel+"-channel-link {-webkit-transform: translateY(-"+(H+8)*(o-G-F-O)+"px); transform: translateY(-"+(H+8)*(o-G-F-O)+"px);}":F=0,G++;else{var X=0;for(X=0;X<=o;X++)n+="#chaty-widget-"+a.id+" .chaty-open .chaty-channel-list .chaty-channel:nth-child("+(X+1)+"){-webkit-transform: translateY(-"+(H+8)*(o-X-O)+"px); transform: translateY(-"+(H+8)*(o-X-O)+"px);}";"above-chaty"==g&&(n+="#chaty-widget-"+a.id+" .chaty-channel-list .Chatway-channel-link {-webkit-transform: translateY(-"+(H+8)*O+"px); transform: translateY(-"+(H+8)*(1-O)+"px);}")}}else{t("#chaty-widget-"+a.id+" .chaty-widget").addClass("hor-mode"),n+="#chaty-widget-"+a.id+" .chaty-channel-list {width: "+o*(H+8)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list {height: "+H+"px; }";var V=0;if(d&&"inside-chaty"==g)for(var $=0,K=1,tt=0;tt<s.length;tt++){var et=s[tt];n+="body.chatway--active .chaty-widget-"+a.id+" .chaty-widget.left-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+($+1)+"){-webkit-transform: translateX("+(H+8)*(o-$-O)+"px); transform: translateX("+(H+8)*(o-$-O)+"px);}",n+="body.chatway--active .chaty-widget-"+a.id+" .chaty-widget.right-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+($+1)+"){-webkit-transform: translateX(-"+(H+8)*(o-$-O)+"px); transform: translateX(-"+(H+8)*(o-$-O)+"px);}","Chatway"!=et.channel?(n+="body:not(.chatway--active) #chaty-widget-"+a.id+" .chaty-widget.left-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+($+1)+"){-webkit-transform: translateX("+(H+8)*(o-$-K-O)+"px); transform: translateX("+(H+8)*(o-$-K-O)+"px);}",n+="body:not(.chatway--active) #chaty-widget-"+a.id+" .chaty-widget.right-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+($+1)+"){-webkit-transform: translateX(-"+(H+8)*(o-$-K-O)+"px); transform: translateX(-"+(H+8)*(o-$-K-O)+"px);}"):K=0,$++}else{for(V=0;V<=o;V++)n+="#chaty-widget-"+a.id+" .chaty-widget.left-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+(V+1)+"){-webkit-transform: translateX("+(H+8)*(o-V-O)+"px); transform: translateX("+(H+8)*(o-V-O)+"px);}",n+="#chaty-widget-"+a.id+" .chaty-widget.right-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+(V+1)+"){-webkit-transform: translateX(-"+(H+8)*(o-V-O)+"px); transform: translateX(-"+(H+8)*(o-V-O)+"px);}";"above-chaty"==g&&(n+="#chaty-widget-"+a.id+" .chaty-widget.left-position.hor-mode .chaty-channel-list .Chatway-channel-link {-webkit-transform: translateX("+(H+8)*(1-O)+"px); transform: translateX("+(H+8)*(1-O)+"px);}",n+="#chaty-widget-"+a.id+" .chaty-widget.right-position.hor-mode .chaty-channel-list .Chatway-channel-link {-webkit-transform: translateX(-"+(H+8)*(1-O)+"px); transform: translateX(-"+(H+8)*(1-O)+"px);}")}}var at=a.settings.bottom_spacing,ct=a.settings.side_spacing;n+="#chaty-widget-"+a.id+" .chaty-widget {bottom: "+at+"px}","left"==_?(n+="#chaty-widget-"+a.id+" .chaty-widget {left: "+ct+"px; right: auto;}",n+=".chaty-outer-forms.pos-left.chaty-form-"+a.id+" {left: "+ct+"px}",t(".chaty-form-"+a.id).addClass("pos-left")):(n+="#chaty-widget-"+a.id+" .chaty-widget {right: "+ct+"px; left:auto;}",t(".chaty-form-"+a.id).addClass("pos-right"),n+=".chaty-outer-forms.pos-right.chaty-form-"+a.id+" {right: "+ct+"px; left:auto;}"),t(".chaty-form-"+a.id).show();var it=H+15+parseInt(at);n+=".chaty-outer-forms.active.chaty-form-"+a.id+" {-webkit-transform: translateY(-"+it+"px); transform: translateY(-"+it+"px)} ",n+="#chaty-widget-"+a.id+".chaty:not(.form-open) .chaty-widget.chaty-open + .chaty-chat-view {-webkit-transform: translateY(-"+it+"px); transform: translateY(-"+it+"px)} ",n+="#chaty-widget-"+a.id+" .chaty-tooltip:after {background-color: "+a.settings.cta_bg_color+"; color: "+a.settings.cta_text_color+"}",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-top:before {border-top-color: "+a.settings.cta_bg_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-left:before {border-left-color: "+a.settings.cta_bg_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-right:before {border-right-color: "+a.settings.cta_bg_color+";}",n+="#chaty-widget-"+a.id+" .on-hover-text {background-color: "+a.settings.cta_bg_color+"; color: "+a.settings.cta_text_color+"}",n+="#chaty-widget-"+a.id+" .on-hover-text p{background-color: "+a.settings.cta_bg_color+"; color: "+a.settings.cta_text_color+"}",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-top .on-hover-text:before {border-top-color: "+a.settings.cta_bg_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-left .on-hover-text:before {border-left-color: "+a.settings.cta_bg_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-right .on-hover-text:before {border-right-color: "+a.settings.cta_bg_color+";}";var ot=it+72+H;ot>0&&(n+=".chaty-outer-forms.chaty-form-"+a.id+" .chaty-agent-body {max-height: calc(100vh - "+ot+"px); overflow-y: auto; } "),n+="#chaty-form-"+a.id+"-chaty-chat-view .chaty-view-header {background-color: "+a.settings.cta_head_bg_color+";}",n+="#chaty-form-"+a.id+"-chaty-chat-view .chaty-view-header {color: "+a.settings.cta_head_text_color+";}",n+="#chaty-form-"+a.id+"-chaty-chat-view .chaty-view-header svg {fill:"+a.settings.cta_head_text_color+";}";var lt=it+82+H;lt>0&&(n+=".chaty-outer-forms.chaty-contact-form-box.chaty-form-"+a.id+" .chaty-contact-inputs {max-height: calc(100vh - "+lt+"px); overflow-y: auto; } "),25==at&&25==ct||(t(".chaty-outer-forms.chaty-form-"+a.id).addClass("custom-cht-pos"),t("#chaty-widget-"+a.id).addClass("has-custom-pos"));var gt=parseInt(t("#chaty-form-"+a.id+"-Whatsapp .chaty-whatsapp-header").outerHeight())+parseInt(t("#chaty-form-"+a.id+"-Whatsapp .chaty-whatsapp-footer").outerHeight())+parseInt(H)+parseInt(at)+20;if(n+="#chaty-form-"+a.id+"-Whatsapp .chaty-whatsapp-body { max-height: calc(100vh - "+gt+"px); overflow-y: auto; }",xt(a.id,"v-widget")&&(yt(a.triggers.exit_intent)||yt(a.triggers.has_time_delay)||yt(a.triggers.has_display_after_page_scroll)>0)?(yt(a.triggers.has_time_delay)&&0==parseInt(a.triggers.time_delay)?(B(a.id),t("#chaty-widget-"+a.id).addClass("active")):yt(a.triggers.has_time_delay)&&parseInt(a.triggers.time_delay)>0&&(p=!0,parseInt(a.triggers.time_delay)>f&&(f=a.triggers.time_delay),t("#chaty-widget-"+a.id).addClass("on-chaty-delay"),t("#chaty-widget-"+a.id).addClass("delay-time-"+parseInt(a.triggers.time_delay)),t("#chaty-widget-"+a.id).attr("data-time",parseInt(a.triggers.time_delay))),yt(a.triggers.has_display_after_page_scroll)&&0==parseInt(a.triggers.display_after_page_scroll)?(B(a.id),t("#chaty-widget-"+a.id).addClass("active")):yt(a.triggers.has_display_after_page_scroll)&&parseInt(a.triggers.display_after_page_scroll)>0&&(u=!0,t("#chaty-widget-"+a.id).addClass("on-chaty-scroll"),t("#chaty-widget-"+a.id).addClass("page-scroll-"+parseInt(a.triggers.display_after_page_scroll)),t("#chaty-widget-"+a.id).attr("data-scroll",parseInt(a.triggers.display_after_page_scroll))),yt(a.triggers.exit_intent)&&(v=!0,t("#chaty-widget-"+a.id).addClass("on-chaty-exit-intent"))):(B(a.id),t("#chaty-widget-"+a.id).addClass("active")),!R(a.settings.font_family)&&"none"!=a.settings.font_family){var ut=a.settings.font_family;-1!=t.inArray(ut,y)?"System Stack"==ut&&(ut="-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"):(t("head").append('<link rel="preload" as="style" href="https://fonts.googleapis.com/css?family='+ut+'&display=swap">'),t("head").append('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family='+ut+'&display=swap">')),n+="#chaty-widget-"+a.id+", #chaty-widget-"+a.id+" .chaty-tooltip:after {font-family: "+ut+"}"}}v&&nt(),""!=n&&(t("#custom-chaty-css").length||t("head").append("<style id='custom-chaty-css'></style>"),t("#custom-chaty-css").append(n)),""!=i&&(t("#custom-advance-chaty-css").length||t("head").append("<style id='custom-advance-chaty-css'></style>"),t("#custom-advance-chaty-css").append(i)),c.length,t(".chaty-sms-channel").length&&t(".chaty-sms-channel").each((function(){var e=t(this).attr("href");e=(e=e.replace(/{title}/g,M())).replace(/{url}/g,window.location.href),t(this).attr("href",e)})),t(document).on("click","#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel",(function(){t(this).closest(".chaty-widget").hasClass("has-single")?t(this).closest(".chaty").hasClass("form-open")&&(yt(a.settings.bg_blur_effect)?t("body").addClass("add-bg-blur-effect"):t("body").removeClass("add-bg-blur-effect")):t(this).closest(".chaty-widget").hasClass("chaty-open")?t("body").removeClass("add-bg-blur-effect"):t(this).closest(".chaty-widget").hasClass("chaty-no-close-button")||yt
8169(a.settings.bg_blur_effect)&&t("body").addClass("add-bg-blur-effect")}))})),t("#custom-advance-chaty-css").length||t("head").append("<style id='custom-advance-chaty-css'></style>"),t("#custom-advance-chaty-css").append(b),(t(".v3_site_key").length&&!R(t(".v3_site_key").val())||t(".v2_site_key").length&&!R(t(".v2_site_key").val()))&&$()),ot(),V()}function M(){return t("title").length?t("title").text():""}function E(e){var a=e.id,n=F(a);null==n&&(n=-1);var c=e.settings.cta_body,i=e.settings.cta_head,o=t("title").text();R(o)?(c=c.replace(/{title}/g,""),i=i.replace(/{title}/g,"")):(c=c.replace(/{title}/g,o),i=i.replace(/{title}/g,o)),c=c.replace(/{url}/g,"<a target='_blank' href='"+window.location.href+"'>"+window.location.href+"</a>");var s="";s+="<div style='display:none;' class='chaty-chat-view chaty-chat-view-"+a+" chaty-form-"+a+"' data-channel='chaty-chat-view' id='chaty-form-"+a+"-chaty-chat-view' data-widget='"+a+"' data-index='"+n+"'>",s+="<div class='chaty-view-body'>",s+="<div class='chaty-view-header'>"+(i=i.replace(/{url}/g,"<a target='_blank' href='"+window.location.href+"'>"+window.location.href+"</a>")),s+="<div role='button' class='chaty-close-view-list'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 330 330'><path d='M325.607 79.393c-5.857-5.857-15.355-5.858-21.213.001l-139.39 139.393L25.607 79.393c-5.857-5.857-15.355-5.858-21.213.001s-5.858 15.355 0 21.213l150.004 150a15 15 0 0 0 21.212-.001l149.996-150c5.859-5.857 5.859-15.355.001-21.213z'/></svg></div>",s+="</div>",s+="<div class='chaty-view-content'>",s+="<div class='chaty-top-content'>",s+=c,s+="</div>",s+="<div class='chaty-view-channels'>",s+="</div>",s+="</div>",s+="</div>",s+="</div>",t("#chaty-widget-"+a).append(s)}function T(t){if(yt(t.is_agent)){if(t.agent_data.length&&(!s&&yt(t.is_agent_desktop)||s&&yt(t.is_agent_mobile)))return!0}else if((!s&&yt(t.is_desktop)||s&&yt(t.is_mobile))&&(""!=t.value||"Contact_Us"==t.channel||"Chatway"==t.channel))return!0;return!1}function B(a){if(t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open").length){var n=t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open a.chaty-whatsapp-btn-form").data("form");if(!R(n)){var i=xt(a,"c-"+t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open").data("channel"));if(i&&(t("#"+n).addClass("is-active"),t("#"+n).length)){var o=t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open a.chaty-whatsapp-btn-form").html()+"<span class='hide-cht-svg-bg'>"+chaty_settings.lang.hide_whatsapp_form+"</span>";if(j(a),t("#chaty-widget-"+a).find(".ch-pending-msg").remove(),t("#chaty-widget-"+a+" .chaty-widget").removeClass("chaty-open"),t("#chaty-widget-"+a).addClass("form-open"),t("#"+n).addClass("active"),t("#chaty-widget-"+a+" .chaty-widget:not(.chaty-no-close-button)").hasClass("has-bg-blur-effect")&&t("body").addClass("add-bg-blur-effect"),setTimeout((function(){t(".chaty-whatsapp-btn-form.active .chaty-whatsapp-input").focus()}),100),t("#chaty-widget-"+a+" .open-chaty-channel").html(o),t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).hasClass("auto-hide-chaty"))(y=parseInt(t("#chaty-widget-"+a).data("time")))>0&&(y+=C,t("#chaty-widget-"+a).addClass("hide-after-"+y));if("on"==chaty_settings.data_analytics_settings){var h=[],l=t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open").data("channel");if(xt(a,"v-"+l)&&void 0!==l&&(Ct(a,"v-"+l),h.push(l)),!g&&h.length){var d=t("#chaty-widget-"+a).data("nonce");t.ajax({url:chaty_settings.ajax_url,data:{widgetId:a,channels:h,userId:a,isMobile:s,widgetNonce:d,action:"update_chaty_channel_views"},type:"post",dataType:"json",success:function(t){},error:function(t,e,a){D(t,e,a)}})}}return}}}var y;(t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).hasClass("auto-hide-chaty"))&&((y=parseInt(t("#chaty-widget-"+a).data("time")))>0&&(y+=C,t("#chaty-widget-"+a).addClass("hide-after-"+y)));_t("hide-bg-blur-effect")&&t("body").removeClass("add-bg-blur-effect");var p=xt(a,"v-widget");if(p){Ct(a,"v-widget");t("#chaty-widget-"+a).data("user"),h=[];var f=0,u=0,v=t("#chaty-widget-"+a).data("key");if(r(c[v])!=e){var w=_t("activechatyWidgets");null!=w&&"string"==typeof w?(w=w.split(","),-1==t.inArray(a,w)&&(w.push(a),mt("activechatyWidgets",
8169w=w.join(","),1))):mt("activechatyWidgets",w=a,1)}if(t("#chaty-widget-"+a+" .chaty-widget").hasClass("has-single"))f=1,l=t("#chaty-widget-"+a+" .chaty-channel").data("channel"),xt(a,"v-"+l)&&void 0!==l&&(Ct(a,"v-"+l),h.push(l));else t("#chaty-widget-"+a+" .chaty-widget").hasClass("chaty-open")&&(u=1,t("#chaty-widget-"+a).hasClass("chaty-has-chat-view")?t(".chaty-chat-view.chaty-chat-view-"+a+" .chaty-view-channels").find(".chaty-channel").each((function(){chatyChannel=t(this).data("channel"),(i=xt(a,"v-"+chatyChannel))&&"undefined"!=typeof chatyChannel&&(Ct(a,"v-"+chatyChannel),h.push(chatyChannel))})):t("#chaty-widget-"+a+" .chaty-channel-list .chaty-channel").each((function(){l=t(this).data("channel"),xt(a,"v-"+l)&&void 0!==l&&(Ct(a,"v-"+l),h.push(l))})));if(p&&!g){d=t("#chaty-widget-"+a).data("nonce");g||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:a,channels:h,userId:a,isMobile:s,isOpen:u,isSingle:f,widgetNonce:d,action:"update_chaty_widget_views"},type:"post",dataType:"json",success:function(t){},error:function(t,e,a){D(t,e,a)}})}}}function D(t,e,a){}function z(t,e){return t}function U(t,e,a,n){switch(t){case"chat-smile":return'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="-496.8 507.1 54 54" xml:space="preserve"><style type="text/css">.chaty-sts1-'+n+"{fill:"+a+';} .chaty-sts2{fill:none;stroke:#808080;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;}</style><g><circle cx="-469.8" cy="534.1" r="27" fill="'+e+'"/></g><path class="chaty-sts1-'+n+'" d="M-459.5,523.5H-482c-2.1,0-3.7,1.7-3.7,3.7v13.1c0,2.1,1.7,3.7,3.7,3.7h19.3l5.4,5.4c0.2,0.2,0.4,0.2,0.7,0.2c0.2,0,0.2,0,0.4,0c0.4-0.2,0.6-0.6,0.6-0.9v-21.5C-455.8,525.2-457.5,523.5-459.5,523.5z"/><path class="chaty-sts2" d="M-476.5,537.3c2.5,1.1,8.5,2.1,13-2.7"/><path class="chaty-sts2" d="M-460.8,534.5c-0.1-1.2-0.8-3.4-3.3-2.8"/></svg>';case"chat-bubble":return'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="-496.9 507.1 54 54" xml:space="preserve"><style type="text/css">.chaty-sts2-'+n+"{fill:"+a+';}</style><g><circle  cx="-469.9" cy="534.1" r="27" fill="'+e+'"/></g><path class="chaty-sts2-'+n+'" d="M-472.6,522.1h5.3c3,0,6,1.2,8.1,3.4c2.1,2.1,3.4,5.1,3.4,8.1c0,6-4.6,11-10.6,11.5v4.4c0,0.4-0.2,0.7-0.5,0.9   c-0.2,0-0.2,0-0.4,0c-0.2,0-0.5-0.2-0.7-0.4l-4.6-5c-3,0-6-1.2-8.1-3.4s-3.4-5.1-3.4-8.1C-484.1,527.2-478.9,522.1-472.6,522.1z   M-462.9,535.3c1.1,0,1.8-0.7,1.8-1.8c0-1.1-0.7-1.8-1.8-1.8c-1.1,0-1.8,0.7-1.8,1.8C-464.6,534.6-463.9,535.3-462.9,535.3z   M-469.9,535.3c1.1,0,1.8-0.7,1.8-1.8c0-1.1-0.7-1.8-1.8-1.8c-1.1,0-1.8,0.7-1.8,1.8C-471.7,534.6-471,535.3-469.9,535.3z   M-477,535.3c1.1,0,1.8-0.7,1.8-1.8c0-1.1-0.7-1.8-1.8-1.8c-1.1,0-1.8,0.7-1.8,1.8C-478.8,534.6-478.1,535.3-477,535.3z"/></svg>';case"chat-db":return'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="-496 507.1 54 54" xml:space="preserve"><style type="text/css">.chaty-sts3-'+n+"{fill:"+a+';}</style><g><circle  cx="-469" cy="534.1" r="27" fill="'+e+'"/></g><path class="chaty-sts3-'+n+'" d="M-464.6,527.7h-15.6c-1.9,0-3.5,1.6-3.5,3.5v10.4c0,1.9,1.6,3.5,3.5,3.5h12.6l5,5c0.2,0.2,0.3,0.2,0.7,0.2c0.2,0,0.2,0,0.3,0c0.3-0.2,0.5-0.5,0.5-0.9v-18.2C-461.1,529.3-462.7,527.7-464.6,527.7z"/><path class="chaty-sts3-'+n+'" d="M-459.4,522.5H-475c-1.9,0-3.5,1.6-3.5,3.5h13.9c2.9,0,5.2,2.3,5.2,5.2v11.6l1.9,1.9c0.2,0.2,0.3,0.2,0.7,0.2c0.2,0,0.2,0,0.3,0c0.3-0.2,0.5-0.5,0.5-0.9v-18C-455.9,524.1-457.5,522.5-459.4,522.5z"/></svg>';default:return'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="-496 507.7 54 54" xml:space="preserve"><style type="text/css">.chaty-sts4-'+n+"{fill: "+a+';}.chaty-st0{fill: #808080;}</style><g><circle cx="-469" cy="534.7" r="27" fill="'+e+'"/></g><path class="chaty-sts4-'+n+'" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/><path class="chaty-st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0C-478.6,530.8-478.2,530.5-477.7,530.5z"/><path class="chaty-st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0C-478.6,533.9-478.2,533.5-477.7,533.5z"/></svg>'}}function A(e,a,n){var c="";if(!yt(e.is_agent)){Z(e.channel_type)&&(e.channel_type=e.channel);o=H(e,X(e,a),n,a);if("Contact_Us"==e.channel_type)c+=" has-chaty-box chaty-contact-form";else if("Whatsapp"==e.channel_type){if(yt(e.is_default_open))xt(a,"c-"+e.channel_type)&&(c+=" chaty-default-open")}return"<div class='chaty-channel "+e.channel+"-channel-link"+c+"' id='"+e.channel+"-"+a+"-channel' data-id='"+e.channel_type+"-"+a+"' data-widget='"+a+"' data-channel='"+e.channel+"'>"+o+"</div>"}if(e.agent_data.length){var i=0;if(t.each(e.agent_data,(function(t,e){""!=e.value&&(i++,e)})),i>0){var o,s=F(a);return null==s&&(s=-1),W(e,a),o=H(e,X(e,a),n,a),("Instagram"!=e.channel_type&&"Instagram_DM"!=e.channel_type||"#ffffff"!=e.icon_color&&"#fff"!=e.icon_color)&&(b+=".chaty-agent-"+a+"-"+e.channel+" .color-element {fill: "+e.icon_color+"; color: "+e.icon_color+";}"),b+=".chaty-agent-"+a+"-"+e.channel+" .chaty-custom-icon { background-color: "+e.icon_color+";}",b+=".chaty-agent-"+a+"-"+e.channel+" .chaty-svg-img { background-color: "+e.icon_color+";}","<div data-form='chaty-form-"+a+"-"+e.channel+"' class='chaty-channel chaty-agent-button chaty-agent-"+a+"-"+e.channel+" "+e.channel+"-channel"+c+"' id='"+e.channel+"-"+a+"-channel' data-id='"+e.channel_type+"-"+a+"' data-widget='"+a+"' data-channel='"+e.channel+"'>"+o+"</div>"}}}function W(e,a){var n="",c=F(a);null==c&&(c=-1),n+="<div style='display:none;' class='chaty-outer-forms chaty-agent-data chaty-agent-data-"+a+" chaty-form-"+a+"' data-channel='"+e.channel_type+"' id='chaty-form-"+a+"-"+e.channel_type+"' data-widget='"+a+"' data-index='"+c+"'>",n+="<div class='chaty-form'>",n+="<div class='chaty-form-body'>",n+="<div role='button' class='chaty-close-agent-list'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 330 330'><path d='M325.607 79.393c-5.857-5.857-15.355-5.858-21.213.001l-139.39 139.393L25.607 79.393c-5.857-5.857-15.355-5.858-21.213.001s-5.858 15.355 0 21.213l150.004 150a15 15 0 0 0 21.212-.001l149.99
81696-150c5.859-5.857 5.859-15.355.001-21.213z'/></svg></div>",n+="<div class='chaty-agent-header agent-info-"+a+"-"+e.channel+"'>",R(e.header_text)||(n+="<div class='agent-main-header'>"+e.header_text+"</div>"),R(e.header_sub_text)||(n+="<div class='agent-sub-header'>"+e.header_sub_text+"</div>"),n+="</div>",n+="<div class='chaty-agent-body agents-body-"+a+" agent-body-"+a+"-"+e.channel+"'>",t.each(e.agent_data,(function(t,c){if(""!=c.value){var i=c.svg_icon;R(c.agent_image)||(i="<img class='chaty-agent-img' src='"+c.agent_image+"' alt='"+c.agent_title+"' />");var o=O(c,e,a,t,i,c.agent_title);n+="<div class='chaty-agent agent-info-"+a+"-"+e.channel+" agent-info-"+t+"'>"+o+"</div>"}b+=".agent-info-"+a+"-"+e.channel+".agent-info-"+t+" .chaty-agent-icon img { background-color: "+c.agent_bg_color+"; } ",("Instagram"!=e.channel_type&&"Instagram_DM"!=e.channel_type||"#ffffff"!=c.agent_bg_color&&"#fff"!=c.agent_bg_color)&&(b+=".agent-info-"+a+"-"+e.channel+".agent-info-"+t+" .chaty-agent-icon .color-element { fill: "+c.agent_bg_color+"; } "),b+=".agent-info-"+a+"-"+e.channel+".agent-info-"+t+" .chaty-custom-icon { background-color: "+c.agent_bg_color+"; } "})),n+="</div>",n+="</div>",n+="</div>",n+="</div>",b+=".chaty-agent-header.agent-info-"+a+"-"+e.channel+" { background-color: "+e.header_bg_color+"; color: "+e.header_text_color+" } ",b+=".agent-info-"+a+"-"+e.channel+" .chaty-close-agent-list svg { fill: "+e.header_text_color+" } ",t("body").append(n)}function O(e,a,n,c,i,o){var h=e.value,r="_blank";if("Whatsapp"==a.channel_type){var l=P(e.value),d="";if(!R(e.pre_set_message)){d=decodeURI(e.pre_set_message);var y=t("title").text();d=(d=R(y)?d.replace(/{title}/g,""):d.replace(/{title}/g,y)).replace(/{url}/g,window.location),d=encodeURIComponent(d)}s?(r="",h="https://wa.me/"+l+"?text="+d):(r="_blank",h=yt(e.use_whatsapp_web)?"https://web.whatsapp.com/send?phone="+l+"&text="+d:"https://wa.me/"+l+"?text="+d)}else"WeChat"==a.channel_type?(r="",h="#"):"Email"==a.channel_type?(r="",h="mailto:"+e.value):"Facebook_Messenger"==a.channel_type?r=s?"":"_blank":"SMS"==a.channel_type?(r="",h="sms:"+e.value):"Telegram"==a.channel_type?(h="https://telegram.me/"+(h=N(e.value,"@")),r="_blank"):"Twitter"==a.channel_type?h="https://twitter.com/"+t.trim(e.value):"Instagram"==a.channel_type?h="https://www.instagram.com/"+N(e.value,"@"):"Instagram_DM"==a.channel_type?h="https://ig.me/m/"+N(e.value,"@"):"Phone"==a.channel_type?(r="",h="tel:"+t.trim(e.value)):"Skype"==a.channel_type?(r="",h="skype:"+t.trim(e.value)+"?chat"):"Snapchat"==a.channel_type?h="https://www.snapchat.com/add/"+t.trim(e.value):"Vkontakte"==a.channel_type?h="https://vk.me/"+t.trim(e.value):"Linkedin"==a.channel_type?h="personal"==e.link_type?"https://www.linkedin.com/in/"+t.trim(e.value):"https://www.linkedin.com/company/"+t.trim(e.value):"Viber"==a.channel_type?(""!=e.viber_url?h="viber://pa?chatURI="+e.value:(h=N(e.value,"+"),isNaN(h)||(h=h.replace("+",""),navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(h="+"+h),h="viber://chat?number="+h)),r=""):"TikTok"==a.channel_type&&(h="https://www.tiktok.com/@"+(h=N(t.trim(e.value),"@")),r="");return""!=r&&(r='target="_blank"'),"<a href='"+h+"' "+r+"><span class='chaty-agent-icon'>"+i+"</span><span class='chaty-agent-title'>"+o+"</span></a>"}function P(t){return t=(t=(t=(t=N(t,"+")).replace(/ /g,"")).replace(/-/g,"")).replace(/_/g,"")}function N(e,a){for(e=t.trim(e);e.charAt(0)==a;)e=e.substring(1);for(;e.charAt(e.length-1)==a;)e=e.substring(0,e.length-1);return e}function H(e,a,n,c){var i="";if(yt(e.is_agent))e.url="#",e.target="";else if("Whatsapp"==e.channel_type)if(yt(e.has_welcome_message))e.url="#",e.target="",i+=" has-chaty-box chaty-whatsapp-btn-form",G(e,c);else{var o="";if(!R(e.pre_set_message))o=decodeURI(e.pre_set_message),o=(o=R(h=t("title").text())?o.replace(/{title}/g,""):o.replace(/{title}/g,h)).replace(/{url}/g,window.location),o=encodeURIComponent(o);s?(e.target="",e.url="https://wa.me/"+e.value+"?text="+o):(e.target="_blank",yt(e.is_use_web_version)?e.url="https://web.whatsapp.com/send?phone="+e.value+"&text="+o:e.url="https://wa.me/"+e.value+"?text="+o)}else if("WeChat"==e.channel_type)R(e.qr_code_image_url)?i+=" copy-wechat-id":(Y(e,c),e.url="#",e.target="",i+=" has-chaty-box chaty-qr-code-form");else if("Contact_Us"==e.channel_type)q(e,c),e.url="#",e.target="",i+=" has-chaty-box chaty-contact-us-form";else if("Email"==e.channel_type){if(!R(e.mail_subject)){var h,r=decodeURI(e.mail_subject);r=(r=R(h=t("title").text())?r.replace(/{title}/g,""):r.replace(/{title}/g,h)).replace(/{url}/g,window.location),r=encodeURIComponent(r),e.url+="?subject="+r}}else"Viber"==e.channel_type?(""!=e.viber_url?e.url="viber://pa?chatURI="+e.value:(e.value=N(e.value,"+"),s&&
8169!isNaN(e.value)&&navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(e.value="+"+e.value),e.url="viber://chat?number="+e.value),e.target=""):"Vkontakte"==e.channel_type?e.url="https://vk.me/"+t.trim(e.value):"Waze"==e.channel_type&&(e.url=decodeURI(t.trim(e.value)));x="Link"==e.channel||"Custom_Link"==e.channel||"Custom_Link_3"==e.channel||"Custom_Link_4"==e.channel||"Custom_Link_5"==e.channel?R(e.hover_text)?e.channel:e.hover_text:e.channel;var l="";R(e.click_event)||(l='onclick="'+e.click_event+'"',e.target="",e.url="#");var d="";return""!=e.target&&(d='target="_blank"'),"<a data-value='"+e.value+"' href='"+e.url+"' "+l+" "+d+" rel='nofollow noopener' aria-label='"+x+"' class='chaty-tooltip "+e.channel_type+"-channel chaty-link chaty-"+e.channel_type.toLowerCase()+"-channel pos-"+n+i+"' data-form='chaty-form-"+c+"-"+e.channel_type+"' data-hover='"+e.hover_text+"'>"+a+"</a>"}function q(e,a){var n="",c=F(a);null==c&&(c=-1),n+="<div style='display:none;' class='chaty-outer-forms chaty-contact-form-box chaty-form-"+a+"' data-channel='"+e.channel_type+"' id='chaty-form-"+a+"-"+e.channel_type+"' data-widget='"+a+"' data-index='"+c+"'>",n+="<div class='chaty-form'>",n+="<div class='chaty-form-body'>",n+="<div role='button' class='close-chaty-form'><div aria-hidden='true' class='chaty-close-button'></div><span class='hide-cht-svg-bg'>"+chaty_settings.lang.hide_whatsapp_form+"</span></div>",n+="<form class='chaty-ajax-contact-form' id='chaty-ajax-contact-form-"+c+"' method='post' data-channel='"+e.channel_type+"' data-widget='"+a+"' data-token='"+e.widget_token+"' data-index='"+e.widget_index+"' enctype='multipart/form-data'>",n+="<div class='chaty-contact-form-body'>",n+="<div class='chaty-contact-form-title'><div class='form-title'>"+e.contact_form_settings.contact_form_title+"</div><div aria-hidden='true' class='chaty-close-button'><span class='hide-cht-svg-bg'>"+chaty_settings.lang.hide_whatsapp_form+"</span><svg width='15' height='9' viewBox='0 0 15 9' fill='none' xmlns='http://www.w3.org/2000/svg'> <path d='M1 1L7.31429 8L14 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'></path></svg></div></div>",n+="<div class='chaty-contact-inputs'>",t.each(e.contact_fields,(function(e,c){n+="<div class='chaty-contact-input'>";var i=yt(c.is_required)?"is-required":"",o="";yt(c.is_required)&&(o="<span class='required_indicate'>*</span>"),yt(c.is_custom)?(n+="<label class='chaty-form-label' for='"+c.field_dropdown+"-"+e+"'>"+c.field_label+" "+o+"</label>",n+="<input type='hidden' name='custom_fields["+e+"][label_"+c.field_dropdown+"]' value='"+c.field_label+"'>",n+="<input type='hidden' name='custom_fields["+e+"][slug]' value='"+c.field_dropdown+"'>","text"==c.field_dropdown||"url"==c.field_dropdown||"date"==c.field_dropdown?n+="<input type='"+c.field_dropdown+"' class='chaty-input-field "+i+" field-"+c.field_dropdown+"' placeholder='"+c.placeholder+"' name='custom_fields["+e+"]["+c.field_dropdown+"]' id='"+c.field_dropdown+"-"+e+"' />":"file"==c.field_dropdown?n+="<input type='file' class='chaty-input-field "+i+" field-"+c.field_dropdown+"' name='custom_fields["+e+"]["+c.field_dropdown+"]' id='"+c.field_dropdown+"-"+e+"' accept='.jpg,.jpeg,.png,.gif,.pdf,.doc,.docx,.ppt,.pptx,.pps,.ppsx,.odt,.xls,.xlsx,.mp3,.mp4,.wav,.mpg,.avi,.mov,.wmv,.3gp,.ogv' multiple/>":"textarea"==c.field_dropdown?n+="<textarea class='chaty-textarea-field "+i+" field-"+c.field_dropdown+"' placeholder='"+c.placeholder+"' name='custom_fields["+e+"]["+c.field_dropdown+"]' id='"+c.field_dropdown+"-"+e+"' ></textarea>":"dropdown"==c.field_dropdown?(n+="<select name='custom_fields["+e+"]["+c.field_dropdown+"]' class='chaty-input-field "+i+"'>",c.dropdown_placeholder&&(n+="<option value=''>"+c.dropdown_placeholder+"</option>"),t.each(c.dropdown_option,(function(t,e){e&&(n+="<option value='"+e+"'>"+e+"</option>")})),n+="</select>"):"textblock"==c.field_dropdown?n+=c.placeholder:"number"==c.field_dropdown&&(n+="<input type='tel' class='chaty-input-field "+i+" field-"+c.field_dropdown+"' placeholder='"+c.placeholder+"' name='custom_fields["+e+"]["+c.field_dropdown+"]' id='"+c.field_dropdown+"-"+e+"' />")):"textarea"==c.type?(R(c.title)?n+="<label class='sr-only' for='"+c.field+"-"+a+"'>"+c.field+"</label>":n+="<label class='chaty-form-label' for='"+c.field+"-"+a+"'>"+c.title+" "+o+"</label>",n+="<textarea type='"+c.type+"' class='chaty-textarea-field "+i+" field-"+c.field+"' placeholder='"+c.placeholder+"' name='"+c.field+"' id='"+c.field+"-"+a+"' ></textarea>"):(R(c.title)?n+="<label class='sr-only' for='"+c.field+"-"+a+"'>"+c.field+"</label>":n+="<label class='chaty-form-label' for='"+c.field+"-"+a+"'>"+c.title+" "+o+"</label>",n+="<input type='"+c.type+"' class='chaty-input-field "+i+" field-"+c.field+"' placeholder='"+c.placeholder+"' name='"+c.field+"' id='"+c.field+"-"+a+"' />","email"==c.field&&(n+='<p id="email_suggestion'+a+'" class="email_suggestion"></p>
8169')),n+="</div>"})),yt(e.enable_recaptcha)&&(R(e.v2_site_key)||(n+="<div class='chaty-contact-input'>",n+="<div class='front-google-captcha' id='front_recaptcha_"+c+"'></div>",n+="</div>"),R(e.v3_site_key)||(n+="<div class='chaty-contact-input'>",n+="<div class='front-google-captcha' id='front_recaptcha_"+c+"'></div>",n+="</div>")),n+="</div>",n+="<div class='chaty-contact-form-button'><button type='submit' id='chaty-submit-button-"+a+"' class='chaty-submit-button'>"+e.contact_form_settings.button_text+"<span class='chaty-loader'><span class='dashicons dashicons-update'></span></span></button></div>",n+="</div>",n+="<input type='hidden' name='nonce' value='"+e.widget_token+"'>",n+="<input type='hidden' name='action' value='chaty_front_form_save_data'>",n+='<input type="hidden" name="channel" value="'+e.channel_type+'">',n+='<input type="hidden" name="widget" value="'+a+'">',n+='<input type="hidden" id="chaty-ref-url-'+a+'" name="ref_url" >',n+='<input type="hidden" name="token" value="'+l+'">',n+='<input type="hidden" name="page_id" value="'+chaty_settings.page_id+'">',n+='<input type="hidden" id="chaty-page-title-'+a+'" name="page_title" >';var i=t(".g-recaptcha-response").length?t(".g-recaptcha-response").val():"";n+='<input type="hidden" name="v2token" value="'+i+'">',yt(e.enable_recaptcha)&&(R(e.v2_site_key)||(n+="<input type='hidden' id='v2_site_key' class='v2_site_key' value='"+e.v2_site_key+"'>"),R(e.v3_site_key)||(n+="<input type='hidden' id='v3_site_key' class='v3_site_key' value='"+e.v3_site_key+"'>")),n+="</form>",n+="</div>",n+="</div>",n+="</div>",t("body").append(n);var o=t("#chaty-form-"+a+"-"+e.channel_type+" .field-email");o.length&&"function"==typeof o.emailautocomplete&&o.emailautocomplete({domains:["protonmail.com","yahoo.com","gmail.com"]}),t("#chaty-page-title-"+a).val(M()),t("#chaty-ref-url-"+a).val(window.location.href)}function G(e,a){var n=new Date,c=n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),i=(n.getHours()<10?"0"+n.getHours():n.getHours())+":"+c,o="",h=F(a);null==h&&(h=-1);var r="https://web.whatsapp.com/send",l="";if(s?r="https://wa.me/"+e.value:(r=yt(e.is_use_web_version)?"https://web.whatsapp.com/send":"https://wa.me/"+e.value,l="_blank"),o+="<div style='display:none;' class='chaty-outer-forms chaty-popup-whatsapp-form chaty-whatsapp-btn-form chaty-form-"+a+"' data-channel='"+e.channel_type+"' id='chaty-form-"+a+"-"+e.channel_type+"' data-widget='"+a+"' data-index='"+h+"'>",o+="<div class='chaty-whatsapp-form'>",o+="<div class='chaty-whatsapp-header'>",o+="<div class='header-wp-icon'>",o+='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="33" viewBox="0 0 32 33" fill="none"> <g filter="url(#filter0_f_9477_7201)"> <path d="M9.95924 25.2858L10.3674 25.5276C12.0818 26.545 14.0475 27.0833 16.052 27.0842H16.0562C22.2122 27.0842 27.2221 22.0753 27.2247 15.919C27.2258 12.9357 26.0652 10.1303 23.9565 8.01998C22.9223 6.97924 21.6919 6.15397 20.3365 5.59195C18.9812 5.02992 17.5278 4.74231 16.0606 4.74576C9.89989 4.74576 4.88975 9.75407 4.88756 15.91C4.88453 18.0121 5.47648 20.0722 6.59498 21.852L6.86071 22.2742L5.73223 26.394L9.95924 25.2858ZM2.50586 29.5857L4.41235 22.6249C3.23657 20.5878 2.618 18.2768 2.61873 15.9091C2.62183 8.50231 8.64941 2.47656 16.0564 2.47656C19.6508 2.47839 23.0245 3.87717 25.5618 6.41629C28.0991 8.95542 29.4952 12.3305 29.4939 15.9199C29.4906 23.3262 23.4621 29.353 16.0562 29.353H16.0504C13.8016 29.3521 11.592 28.788 9.62923 27.7177L2.50586 29.5857Z" fill="#B3B3B3"/> </g> <path d="M2.36719 29.447L4.27368 22.4862C3.09587 20.4442 2.47721 18.1278 2.48005 15.7705C2.48316 8.36364 8.51074 2.33789 15.9177 2.33789C19.5121 2.33972 22.8859 3.73849 25.4232 6.27762C27.9605 8.81675 29.3565 12.1918 29.3552 15.7812C29.3519 23.1875 23.3234 29.2143 15.9175 29.2143H15.9117C13.663 29.2134 11.4533 28.6493 9.49056 27.5791L2.36719 29.447Z" fill="white"/> <path d="M15.715 3.84769C9.17146 3.84769 3.85 9.16696 3.84767 15.7051C3.84445 17.9377 4.47318 20.1257 5.66119 22.016L5.94343 22.4646L4.48888 27.2525L9.23469 25.663L9.66824 25.9199C11.4891 27.0005 13.5769 27.5719 15.7061 27.5731H15.7105C22.249 27.5731 27.5705 22.2532 27.573 15.7146C27.5779 14.1562 27.2737 12.6123 26.6778 11.1722C26.082 9.73214 25.2064 8.42458 24.1017 7.3252C23.0032 6.21981 21.6963 5.34329 20.2567 4.74637C18.8171 4.14946 17.2734 3.844 15.715 3.84769Z" fill="#25D366"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M12.0858 9.60401C11.8138 9.00922 11.5276 8.99717 11.2692 8.98687L10.5736 8.97852C10.3316 8.97852 9.93846 9.0679 9.60608 9.42544C9.27369 9.78297 8.33594 10.6471 8.33594 12.4046C8.33594 14.1622 9.63628 15.8605 9.81747 16.0991C9.99866 16.3377 12.3277 20.0594 16.
81690162 21.4913C19.0813 22.6813 19.705 22.4446 20.3706 22.3852C21.0361 22.3257 22.5175 21.521 22.8197 20.6869C23.1219 19.8527 23.1221 19.138 23.0315 18.9886C22.9409 18.8391 22.6989 18.7503 22.3357 18.5716C21.9725 18.3928 20.1888 17.5287 19.8562 17.4094C19.5236 17.2901 19.2818 17.2308 19.0396 17.5883C18.7975 17.9459 18.1029 18.7501 17.8911 18.9886C17.6793 19.227 17.4679 19.2569 17.1047 19.0783C16.7416 18.8998 15.5731 18.5224 14.1867 17.3054C13.108 16.3585 12.3799 15.1892 12.1679 14.8318C11.9559 14.4745 12.1454 14.2809 12.3274 14.1029C12.4902 13.9428 12.6901 13.6858 12.8719 13.4773C13.0537 13.2688 13.1135 13.1197 13.2343 12.8817C13.3551 12.6437 13.2949 12.4346 13.2041 12.256C13.1133 12.0774 12.4083 10.3105 12.0858 9.60401Z" fill="white"/> <defs> <filter id="filter0_f_9477_7201" x="1.21611" y="1.18682" width="29.5678" height="29.6889" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> <feGaussianBlur stdDeviation="0.644873" result="effect1_foregroundBlur_9477_7201"/> </filter> </defs> </svg>',o+="</div>",o+="<div class='header-wp-title'>",o+=R(e.wp_popup_headline)?"":e.wp_popup_headline,o+="</div>",o+="<div class='whatsapp-form-close-btn'>",o+='<svg width="15" height="9" viewBox="0 0 15 9" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1 1L7.31429 8L14 1" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </svg>',o+="</div>",o+="</div>",o+="<div class='chaty-whatsapp-body'>",R(e.chat_welcome_message)||(""!=e.wp_popup_profile?(o+="<div class='chaty-whatsapp-content has-content'>",o+="<div class='wp-profile-img'>",o+="<img src='"+e.wp_popup_profile+"'>",o+="</div>"):o+="<div class='chaty-whatsapp-content'>",o+="<div class='chaty-whatsapp-message'>",o+="<div class='chaty-whatsapp-message-nickname'>"+e.wp_popup_nickname+"</div>",o+="<div class='chaty-whatsapp-message-content'></div>",o+="<div class='chaty-whatsapp-message-time'>"+i+"</div>",o+="</div>",o+="</div>"),o+="</div>",o+="<div class='chaty-whatsapp-footer'>",o+="<form action='"+r+"' target='"+l+"' class='whatsapp-chaty-form-"+a+" whatsapp-chaty-form "+(yt(e.is_default_open)?"add-analytics":"")+"' data-widget='"+a+"' data-channel='"+e.channel_type+"' autocomplete='off'>",o+="<div class='chaty-whatsapp-data'>",o+="<div class='chaty-whatsapp-field ".concat(yt(e.emoji_picker)?"has_emoji":"","'>"),yt(e.emoji_picker)&&(o+='<button type="button" class="chaty-wp-emoji-input"><span class="hide-cht-svg-bg">"+chaty_settings.lang.emoji_picker+"</span><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12 2C6.47 2 2 6.5 2 12C2 14.6522 3.05357 17.1957 4.92893 19.0711C5.85752 19.9997 6.95991 20.7362 8.17317 21.2388C9.38642 21.7413 10.6868 22 12 22C14.6522 22 17.1957 20.9464 19.0711 19.0711C20.9464 17.1957 22 14.6522 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM15.5 8C15.8978 8 16.2794 8.15804 16.5607 8.43934C16.842 8.72064 17 9.10218 17 9.5C17 9.89782 16.842 10.2794 16.5607 10.5607C16.2794 10.842 15.8978 11 15.5 11C15.1022 11 14.7206 10.842 14.4393 10.5607C14.158 10.2794 14 9.89782 14 9.5C14 9.10218 14.158 8.72064 14.4393 8.43934C14.7206 8.15804 15.1022 8 15.5 8ZM8.5 8C8.89782 8 9.27936 8.15804 9.56066 8.43934C9.84196 8.72064 10 9.10218 10 9.5C10 9.89782 9.84196 10.2794 9.56066 10.5607C9.27936 10.842 8.89782 11 8.5 11C8.10218 11 7.72064 10.842 7.43934 10.5607C7.15804 10.2794 7 9.89782 7 9.5C7 9.10218 7.15804 8.72064 7.43934 8.43934C7.72064 8.15804 8.10218 8 8.5 8ZM12 17.5C9.67 17.5 7.69 16.04 6.89 14H17.11C16.3 16.04 14.33 17.5 12 17.5Z" fill="#CDD9E2"/> </svg></button>'),o+="<label class='sr-only' for='chaty_whatsapp_input'>WhatsApp Message</label>",o+="<input name='text' type='text' id='chaty_whatsapp_input' class='chaty-whatsapp-input' />",o+="<button type='submit' class='chaty-whatsapp-button-button' >",o+="<span class='hide-cht-svg-bg'>"+chaty_settings.lang.whatsapp_button+"</span>",o+='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><g clip-path="url(#clip0_9452_6982)"><path d="M18.5703 9.99996L2.66037 17.6603L5.60665 9.99996L2.66037 2.33963L18.5703 9.99996Z" fill="white" stroke="white" stroke-width="1.6625" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.24069 9.99947L3.07723 9.99992" stroke="#C6D7E3" stroke-width="1.6625" stroke-linecap="round" stroke-linejoin="round"></path></g><defs><clipPath id="clip0_9452_6982"><rect width="20" height="20" fill="white"></rect></clipPath></defs></svg>',o+="</button>",o+="</div>",o+="</div>",!s&&yt(e.is_use_web_version)&&(o+="<input type='hidden' name='phone' value='"+e.value+"' />"),o+="</form>",o+="</div>",o+="</div>",o+="</div>",t("body").append(o),t("#chaty-form-"+a+"-"+e.channel_type+" .chaty-whatsapp-message .chaty-whatsapp-message-content").html(e.chat_welcome_message),!R(e.pre_set_message)){var d=e.pre_set_message,y=t("title").text();d=(d=R(y)?d.replace(/{title}/g,""):d.replace(/{title}/g,y)).replace(/{url}/g,window.location),t("#chaty-form-"+a+"-"+e.channel_type+" .chaty-whatsapp-input").val(d)}t("#chaty-form-"+a+"-"+e.channel_type+" .chaty-whatsapp-input").attr("placeholder",e.input_placeholder),t("#chaty-form-"+a+"-"+e.channel_type).show(),t("#chaty-form-"+a+"-"+e.channel_type+" .chaty-whatsapp-header").css("background-color",e.wp_popup_head_bg_color)}function F(e){var a=null;return c.length&&t.each(c,(function(t,n){n.id==e&&(a=t)})),a}function Y(e,a){var n="",c=F(a);null==c&&(c=-1);var i=R(e.wechat_header)?"":e.wechat_header+": ";i+=e.value,n+="<div style='display:none;' class='chaty-outer-forms chaty-wechat-form chaty-form-"+a+"' data-channel='"+e.channel_type+"' id='chaty-form-"+a+"-"+e.channel_type+"' data-widget='"+a+"' data-index='"+c+"'>",n+="<div class='chaty-form'>",n+="<div class='chaty-form-body qr-code-body'>",n+='<div class="qr-code-header"><div class="qr-code-head-title"><svg width="25" height="22" viewBox="0 0 25 22" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M17.2315 6.81844C17.6918 6.81844 18.1403 6.85385 18.5769 6.91286C17.7744 3.40752 14.092 0.751953 9.66605 0.751953C4.64999 0.751953 0.578125 4.15108 0.578125 8.34096C0.578125 10.7605 1.93541 12.8967 4.04806 14.2894L2.85601 16.6853L6.1135 15.2808C6.80985 15.5287 7.5416 15.7293 8.32057 15.8356C8.21435 15.3753 8.15533 14.9032 8.15533 14.4075C8.14353 10.2294 12.2154 6.81844 17.2315 6.81844ZM12.6875 4.16288C12.8363 4.16288 12.9836 4.19218 13.1211 4.24912C13.2586 4.30607 13.3835 4.38952 13.4887 4.49474C13.5939 4.59995 13.6773 4.72486 13.7343 4.86232C13.7912 4.99979 
816913.8205 5.14712 13.8205 5.29592C13.8205 5.44471 13.7912 5.59205 13.7343 5.72951C13.6773 5.86698 13.5939 5.99189 13.4887 6.0971C13.3835 6.20231 13.2586 6.28577 13.1211 6.34271C12.9836 6.39965 12.8363 6.42896 12.6875 6.42896C12.387 6.42896 12.0988 6.30958 11.8863 6.0971C11.6738 5.88461 11.5545 5.59642 11.5545 5.29592C11.5545 4.99542 11.6738 4.70722 11.8863 4.49474C12.0988 4.28225 12.387 4.16288 12.6875 4.16288ZM6.63281 6.44076C6.33231 6.44076 6.04412 6.32139 5.83163 6.1089C5.61914 5.89641 5.49977 5.60822 5.49977 5.30772C5.49977 5.00722 5.61914 4.71903 5.83163 4.50654C6.04412 4.29405 6.33231 4.17468 6.63281 4.17468C6.93331 4.17468 7.2215 4.29405 7.43399 4.50654C7.64648 4.71903 7.76585 5.00722 7.76585 5.30772C7.76585 5.60822 7.64648 5.89641 7.43399 6.1089C7.2215 6.32139 6.93331 6.44076 6.63281 6.44076Z" fill="white"/> <path d="M24.7978 14.4102C24.7978 11.0583 21.4105 8.34375 17.2324 8.34375C13.0543 8.34375 9.66699 11.0583 9.66699 14.4102C9.66699 17.7621 13.0543 20.4767 17.2324 20.4767C17.9169 20.4767 18.5779 20.3823 19.2034 20.2407L23.2871 21.9992L21.8708 19.1666C23.6412 18.0572 24.7978 16.3577 24.7978 14.4102ZM14.9545 14.0326C14.7304 14.0326 14.5114 13.9661 14.325 13.8416C14.1387 13.7171 13.9935 13.5401 13.9077 13.3331C13.822 13.1261 13.7995 12.8983 13.8432 12.6785C13.887 12.4587 13.9949 12.2568 14.1533 12.0983C14.3118 11.9399 14.5137 11.832 14.7335 11.7882C14.9533 11.7445 15.1811 11.767 15.3881 11.8527C15.5951 11.9385 15.7721 12.0837 15.8966 12.27C16.0211 12.4564 16.0876 12.6754 16.0876 12.8995C16.0994 13.525 15.58 14.0326 14.9545 14.0326ZM19.4985 14.0326C19.198 14.0326 18.9098 13.9132 18.6973 13.7007C18.4848 13.4882 18.3654 13.2 18.3654 12.8995C18.3654 12.599 18.4848 12.3108 18.6973 12.0983C18.9098 11.8858 19.198 11.7665 19.4985 11.7665C19.799 11.7665 20.0872 11.8858 20.2997 12.0983C20.5121 12.3108 20.6315 12.599 20.6315 12.8995C20.6315 13.2 20.5121 13.4882 20.2997 13.7007C20.0872 13.9132 19.799 14.0326 19.4985 14.0326Z" fill="white"/> </svg>'+i+'</div><div class="qr-code-hide-btn chaty-close-button"><svg width="15" height="9" viewBox="0 0 15 9" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1 1L7.31429 8L14 1" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </svg></div></div>',R(e.wechat_qr_code_title)||(n+='<div class="qr-code-title">'+e.wechat_qr_code_title+":</div>"),n+="<div role='button' class='close-chaty-form is-whatsapp-btn'><div aria-hidden='true' class='chaty-close-button'></div><span class='hide-cht-svg-bg'>"+chaty_settings.lang.hide_whatsapp_form+"</span></div></div>",n+="<div class='qr-code-box'><div class='qr-code-image'><img src='"+e.qr_code_image_url+"' alt='"+e.title+"' /></div>",n+="</div>",n+="</div>",n+="</div>",t("body").append(n),t("#chaty-form-"+a+"-"+e.channel_type+" .qr-code-header").css("background-color",e.wechat_header_color)}function R(e){return null==e||""==e||""==t.trim(e)}function X(t){return""!=t.custom_image_url&&"null"!=t.custom_image_url?"<span class='chaty-icon channel-icon-"+t.channel+"'><span class='chaty-svg chaty-svg-img'><img src='"+t.custom_image_url+"' alt='"+t.hover_text+"' /></span></span>":"<span class='chaty-icon channel-icon-"+t.channel+"'><span class='chaty-svg'>"+t.svg_icon+"</span></span>"}function Z(e){return""==e||""==t.trim(e)||null==e||"null"==e}function Q(t){return"custom"==t.position?t.custom_position:t.position}function J(t){return"vertical"!=t.settings.icon_view?"top":"right"==Q(t.settings)?"left":"right"}function V(){if(t(".chaty.auto-hide-chaty").length&&(n=setInterval((function(){var e=++C;if(t(".chaty.auto-hide-chaty.hide-after-"+C).length){var a=t(".chaty.auto-hide-chaty.hide-after-"+e).data("id");t(".chaty-form-"+a).removeClass("active"),t(".chaty.auto-hide-chaty.hide-after-"+e).removeClass("active"),t("#chaty-widget-"+a).removeClass("auto-hide-chaty"),t("body").removeClass("add-bg-blur-effect")}0==t(".chaty.auto-hide-chaty").length&&clearInterval(n)}),1e3)),p&&(a=setInterval((function(){(m++,t(".chaty.delay-time-"+m).length)&&it(t(".chaty.delay-time-"+m).data("id"))}),1e3)),u){t(window).on("scroll",(function(){if(u){var e=t(document).height()-t(window).height(),a=t(window).scrollTop();
8169if(0!=e){var n=parseInt(a/e*100);if(_<=n){var c=_;_=n;for(var i=c;i<=n;i++)-1==t.inArray(i,w)&&t(".chaty.on-chaty-scroll.page-scroll-"+i).length&&t(".chaty.on-chaty-scroll.page-scroll-"+i).each((function(){var e=t(this).data("id");t(this).removeClass("on-chaty-scroll"),it(e)}));_=n}}}}));window.innerWidth,document.documentElement.clientWidth}}function $(){if(jQuery(".v2_site_key").length&&""!=jQuery(".v2_site_key").val()){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://www.google.com/recaptcha/api.js?onload=onloadChatyCallback&render=explicit&hl=en",(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(t)}jQuery(".v3_site_key").length&&""!=jQuery(".v3_site_key").val()&&jQuery(".v3_site_key").length&&""!=jQuery(".v3_site_key").val()&&jQuery(".front-google-captcha").length&&jQuery(".front-google-captcha:not(.loaded)").each((function(){jQuery(this).addClass("loaded");var t=jQuery(".v3_site_key").val(),e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://www.google.com/recaptcha/api.js?onload=onloadCallbackChatyV3&render="+t,(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(e),e.loadEventEnd=function(){}}))}function K(){if(window.history&&window.history.pushState&&v){var e=function(){v&&(""!==location.hash.split("#!/")[1]&&""===window.location.hash&&ct())},a=100;window.history.state&&window.history.state.page&&(a=window.history.state.page),window.history.pushState({page:a+1},""),window.history.pushState({page:a+2},""),window.onpopstate=function(){e()},window.history.onpopstate=function(){e()},window.addEventListener("popstate",(function(){e()})),document.addEventListener("backbutton",(function(){e()})),window.addEventListener("backbutton",(function(){e()})),t(window).on("popstate",(function(){e()}))}}function tt(t){return et.apply(this,arguments)}function et(){return(et=h(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!navigator.clipboard||!window.isSecureContext){t.next=13;break}return t.prev=1,t.next=4,navigator.clipboard.writeText(e);case 4:return t.abrupt("return",!0);case 7:return t.prev=7,t.t0=t.catch(1),console.error("Clipboard API failed:",t.t0),t.abrupt("return",at(e));case 11:t.next=14;break;case 13:return t.abrupt("return",at(e));case 14:case"end":return t.stop()}}),t,null,[[1,7]])})))).apply(this,arguments)}function at(t){var e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="-9999px",e.style.left="-9999px",document.body.appendChild(e),e.focus(),e.select();var a=!1;try{a=document.execCommand ("copy")}catch(t){console.error("Fallback copy failed:",t)}return document.body.removeChild(e),a}function nt(){s?K():t(document).mouseleave((function(t){function e(t,e,a){t.addEventListener?(t.addEventListener(e,a,!1),ct()):t.attachEvent&&t.attachEvent("on"+e,a)}e(document,"mouseout",(function(t){null==t.toElement&&null==t.relatedTarget&&ct()}))}))}function ct(){v&&t(".on-chaty-exit-intent").length&&t(".on-chaty-exit-intent").each((function(){var e=t(this).data("id");t(this).removeClass("on-chaty-exit-intent"),it(e),t("#chaty-widget-"+e+" .chaty-widget").append("<div class='chaty-exit-intent'></div>"),setTimeout((function(){t(".chaty-exit-intent").addClass("animate"),setTimeout((function(){t(".chaty-exit-intent").removeClass("animate")}),2500)}),500)}))}function it(e){B(e),t(".chaty-widget-"+e).removeClass("on-chaty-delay"),t(".chaty-widget-"+e).removeClass("on-chaty-exit-intent"),t(".chaty-widget-"+e).removeClass("on-chaty-scroll"),t(".chaty.on-chaty-delay").length||(clearInterval(a),p=!1),t(".chaty.on-chaty-exit-intent").length||(v=!1),t(".chaty.on-chaty-scroll").length||(u=!1)}function ot(){t(".chaty-tooltip").each((function(){""==t(this).data("hover")&&t(this).removeClass("left").removeClass("right").removeClass("top").removeClass("chaty-tooltip")}))}function st(t,e){return(""==t.widget_icon||"chat-image"==t.widget_icon&&R(t.widget_icon_url)||"chat-fa-icon"==t.widget_icon&&R(t.widget_fa_icon))&&(t.widget_icon="chat-base"),"chat-image"==t.widget_icon?"<span class='chaty-svg' style='background-color: "+t.widget_color+"'><img src='"+t.widget_icon_url+"' alt='Chaty Widget' /></span>
8169":"chat-fa-icon"==t.widget_icon?"<span class='chaty-svg' style='background-color: "+t.widget_color+"'><i class='"+t.widget_fa_icon+" widget-fa-icon' style='color: "+t.widget_icon_color+"'></i></span>":'<span class="chaty-svg">'+U(t.widget_icon,t.widget_color,t.widget_icon_color,e)+"</span>"}function ht(e,a){xt(a,"c-widget")&&"none"!=e.attention_effect&&""!=e.attention_effect&&(t("#chaty-widget-"+a).attr("data-animation",e.attention_effect),t("#chaty-widget-"+a+" .chaty-widget").hasClass("has-single")?t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-channel .chaty-svg").addClass("chaty-animation-"+e.attention_effect):t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-cta-main .chaty-cta-button").addClass("chaty-animation-"+e.attention_effect))}function rt(e,a){xt(a,"c-widget")&&yt(e.is_pending_mesg_enabled)&&parseInt(e.pending_mesg_count)>0&&(t("#chaty-widget-"+a+" .chaty-widget").hasClass("has-single")?"sheen"==e.attention_effect||"spin"==e.attention_effect||"pulse"==e.attention_effect?t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-channel").append("<span class='ch-pending-msg'>"+e.pending_mesg_count+"</span>"):t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-channel .chaty-svg").append("<span class='ch-pending-msg'>"+e.pending_mesg_count+"</span>"):"jump"==e.attention_effect||"waggle"==e.attention_effect||"blink"==e.attention_effect||"pulse-icon"==e.attention_effect||"floating"==e.attention_effect?t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-cta-main .chaty-cta-button").append("<span class='ch-pending-msg'>"+e.pending_mesg_count+"</span>"):t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-cta-main").append("<span class='ch-pending-msg'>"+e.pending_mesg_count+"</span>"))}function lt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function dt(t){var e=!0;if(yt(t.triggers.has_day_hours_scheduling_rules)&&t.triggers.day_hours_scheduling_rules.length>0){var a=t.triggers.day_hours_scheduling_rules;if(a.length>0){e=!1;for(var n=new Date,c=(n=gt(n,t.triggers.day_time_diff)).getHours(),i=n.getMinutes(),o=n.getDay(),s=0;s<a.length;s++){var h=0,r=0;-1==a[s].days?r=1:a[s].days>=0&&a[s].days<=6?a[s].days==o&&(r=1):7==a[s].days?o>=0&&o<=4&&(r=1):8==a[s].days?o>=1&&o<=5&&(r=1):9==a[s].days&&(6!=o&&0!=o||(r=1)),1==r&&(c>a[s].start_hours&&c<a[s].end_hours?h=1:c==a[s].start_hours&&c<a[s].end_hours?i>=a[s].start_min&&(h=1):c>a[s].start_hours&&c==a[s].end_hours?i<=a[s].end_min&&(h=1):c==a[s].start_hours&&c==a[s].end_hours&&i>=a[s].start_min&&i<=a[s].end_min&&(h=1),1==h&&i>=a[s].start_min&&i<=a[s].end_min&&1),1==h&&1==r&&(e=1),1==e&&(s=a.length+1)}}}return e}function yt(t){return"1"==t||1==t||1==t||"true"==t||"yes"==t||"on"==t}function gt(t,e){if(isNaN(e)){var a=new Date(t.toLocaleString("en-US",{timeZone:e})),n=t.getTime()-a.getTime();return new Date(t.getTime()-n)}var c=new Date;if(c=c.toLocaleString("en-US",{timeZone:"UTC"}),c=new Date(c),-1!=e.indexOf("+")){var i=e.replace("+",""),o=parseInt(i),s=60*parseFloat(i%o);(s=c.getUTCMinutes()+s)>59&&(o+=parseInt(s/60),s%=60),c.setUTCHours(c.getUTCHours()+o,s)}else if(-1!=e.indexOf("-")){i=e.replace("-",""),o=parseInt(i),s=60*parseFloat(i%o);(s=c.getUTCMinutes()-s)<0&&(o-=parseInt(s/60),s%=60),c.setUTCHours(c.getUTCHours()-o,-s)}n=t.getTime()-c.getTime();return new Date(t.getTime()-n)}function pt(t){if(t.triggers.has_date_scheduling_rules){var e=t.triggers.date_scheduling_rules.start_date_time,a=t.triggers.date_scheduling_rules.end_date_time,n=new Date,c=(n=gt(n,t.triggers.time_diff)).getFullYear()+"-"+lt(n.getMonth()+1)+"-"+lt(n.getDate())+" "+lt(n.getHours())+":"+lt(n.getMinutes())+":"+lt(n.getSeconds());return""==a&&e<=c||(""==e&&a>=c||""!=e&&""!=a&&e<=c&&a>=c)}return!0}function ft(e){return!(yt(e.triggers.has_countries)&&!R(e.triggers.countries)&&e.triggers.countries.length&&"-"!=(i=ut())&&-1==t.inArray(i,e.triggers.countries))}function ut(){return i="","undefined"!=typeof Storage&&null!=window.sessionStorage.getItem("chaty_user_country_code")?i=window.sessionStorage.getItem("chaty_user_country_code"):kt("chaty_user_country_code")&&(i=_t("chaty_user_country_code")),i}function vt(t){"undefined"!=typeof Storage?null==window.sessionStorage.getItem("chaty_user_country_code")&&window.sessionStorage.setItem("chaty_user_country_code",t):kt("chaty_user_country_code")||mt("chaty_user_country_code",t,365)}function wt(){t(".chaty-widget.default-open.has-bg-blur-effect").length&&t(".chaty-widget.default-open.has-bg-blur-effect").each((function(){Ct(t(this).closest(".chaty").data("id"),"c-widget")}))}function mt(t,e,a){if(a){var n=Date.now()+24*a*60*60*1e3;localStorage.setItem(t,JSON.stringify({value:e,expiry:n}))}else localStorage.setItem(t,e)}function _t(t){var e=localStorage.getItem(t);if(!e)return null;try{var a=JSON.parse(e);return a&&"object"===r(a)&&"expiry"in a?Date.now()>a.expiry?(localStorage.removeItem(t),null):a.value:a}catch(t){return e}}function bt(t,e){var a=_t("chatyWidget_"+t),n=[];if(null!=a&&""!=a&&(n=JSON.parse(a)),n.length>0)for(var c=0;c<n.length;c++)if(n[c].k==e)return n[c].v;return null}function Ct(t,e){var a=_t("chatyWidget_"+t),n=[];null!=a&&""!=a&&(n=JSON.parse(a));var c=!1;if(n.length>0)for(var i=0;i<n.length;i++)n[i].k==e&&(c=!0,n[i].v=new Date);c||n.push({k:e,v:new Date}),mt("chatyWidget_"+t,a=JSON.stringify(n),"7")}function xt(t,e){var a=bt(t,e);if(null!=a&&""!=a){a=new Date(a);var n=Math.abs(new Date-a);return Math.floor(n/864e5)>=2}return!0}function kt(t){var e=localStorage.getItem(t);if(!e)return!1;try{var a=JSON.parse(e);return!a||"object"!==r(a)||!("expiry"in a)||Date.now()>a.expiry}catch(t){return!0}}t(document).ready((function(){var a=new RegExp("(googlebot/|bot|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)","i"),n=navigator.userAgent;a.test(n)&&(g=!0),s?t("body").addClass("cht-in-mobile"):t("body").addClass("cht-in-desktop"),yt(chaty_settings.has_chatway)&&t("body").addClass("csaas-has-chatway"),"undefined"==typeof chaty_settings?(console.log("Chaty settings doesn't exists"),k()):0==chaty_settings.chaty_widgets.length?console.log("Chaty widget doesn't exists"):(c=chaty_settings.chaty_widgets,I(),("object"==("undefined"==typeof chaty_settings?"undefined":r(chaty_settings))&&"on"!=chaty_settings.data_analytics_settings||"off"==chaty_settings.data_analytics_settings)&&(g=!0)),t(window).height()>t(window).width()?t("body").addClass("cht-portrait").removeClass("cht-landscape"):t("body").addClass("cht-landscape").removeClass("cht-portrait"),t(document).on("click",".copy-wechat-id",(function(e){var a=this;if(e.preventDefault(),tt(t(this).data("value")))if(t(this).hasClass("cta-inside"))t(this).addClass("copied"),t(this).append('<span class="copied-tooltip"><span class="chaty-svg">&#x2713;</span>Copied!</span>'),setTimeout((function(){t(a).removeClass("copied"),t(a).find(".copied-tooltip").remove()}),2e3);else if(t(this).closest(".chaty-widget").hasClass("has-single")){t(this).data("hover");t(this).addClass("cta-copied"),t(this).find(".on-hover-text").text("✓ Copied!"),setTimeout((function(){t(".has-single .cta-copied").find(".on-hover-text").each((function(){t(this).text(t(this).closest(".chaty-link").data("hover"))}))}),2e3)}else{var n=t(this).data("hover");t(this).addClass("cta-copied"),t(this).attr("data-default",n),t(this).attr("data-hover","✓ Copied!"),setTimeout((function(){t(".cta-copied").attr("data-hover",(function(){return t(this).attr("data-default")}))}),2e3)}})),t(document).on("click","html, body",(function(e){t(".chaty-popup-whatsapp-form.active").length&&t(".chaty-popup-whatsapp-form.active").each((function(){var e=t(this).data("widget"),a=xt(e,"c-Whatsapp");R(e)&&0!=e||!a||Ct(e,"c-Whatsapp")})),t(".form-open").removeClass("form-open"),t(".chaty-outer-forms").removeClass("active"),t(".chaty .chaty-widget.chaty-no-close-button:not(.has-single)").addClass("chaty-open"),t(".chaty .chaty-widget").hasClass("chaty-open")&&(t(".chaty .chaty-widget:not(.chaty-no-close-button)").removeClass("chaty-open"),t("body").removeClass("add-bg-blur-effect")),t("body").removeClass("add-bg-blur-effect"),mt("hide-bg-blur-effect",!0,365),wt()})),t(document).on("click",".chaty, .chaty-outer-forms",(function(t){t.stopPropagation()})),t(document).on("click",".chaty.form-open .chaty-i-trigger.single-channel a",(function(e){t("body").removeClass("add-bg-blur-effect")})),t(document).on("click",".chaty.form-open .chaty-i-trigger.single-channel .chaty-cta-close",(function(e){t("body").removeClass("add-bg-blur-effect")})),t(document).on("click",".chaty-close-view-list",(function(){t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t("body").removeClass("add-bg-blur-effect"),mt("hide-bg-blur-effect",!0,365),wt()})),t(document).on("submit",".whatsapp-chaty-form",(function(){if(t(this).hasClass("form-google-analytics")){var e="Whatsapp";if(window.hasOwnProperty("gtag")&&gtag("event","chaty_"+e,{eventCategory:"chaty_"+e,event_action:"chaty_"+e,method:"chaty_"+e}),window.hasOwnProperty("ga")){var a=window.ga.getAll()[0];a&&a.send("event","click",{eventCategory:"chaty_"+e,eventAction:"chaty_"+e,method:"chaty_"+e})}}var n=t(this).data("widget"),c=t(this).data("channel"),i=xt(n,"c-"+c);if((!R(n)||0==n)&&i){Ct(n,"c-"+c);var o=t("#chaty-widget-"+n).data("nonce");g||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:n,userId:n,isMobile:s,channel:c,nonce:o,action:"update_chaty_channel_click"},dataType:"json",method:"post"})}t("#chaty-widget-"+n).length&&(t("#chaty-widget-"+n).removeClass("form-open"),t(this).closest(".chaty-outer-forms").removeClass("active"),t("#chaty-widget-"+n).find(".chaty-widget").hasClass("cssas-no-close-button")&&t("#chaty-widget-"+n).find(".chaty-widget:not(.has-single)").addClass("chaty-open")),t("body").hasClass("add-bg-blur-effect")&&(t("body").removeClass("add-bg-blur-effect"),wt())}
8169)),t(document).on("click",".chaty-close-button, .chaty-close-agent-list, .whatsapp-form-close-btn",(function(e){e.preventDefault(),e.stopPropagation();var a=t(this).closest(".chaty-outer-forms").data("widget");if(!R(a)||0==a){if(t("#chaty-widget-"+a).length&&(t("#chaty-widget-"+a).removeClass("form-open"),t(this).closest(".chaty-outer-forms").removeClass("active"),t("#chaty-widget-"+a).find(".chaty-widget").hasClass("chaty-no-close-button")&&t("#chaty-widget-"+a).find(".chaty-widget:not(.has-single)").addClass("chaty-open")),t(this).closest(".chaty-whatsapp-btn-form").length){var n=t(this).closest(".chaty-outer-forms").data("channel");if(!R(n)){var c=xt(a,"c-"+n);c&&Ct(a,"c-"+n)}xt(a,"v-widget")&&B(a)}t(this).hasClass("whatsapp-form-close-btn")&&(c=xt(a,"c-Whatsapp"),R(a)&&0!=a||!c||Ct(a,"c-Whatsapp"))}t("body").removeClass("add-bg-blur-effect")})),t(document).on("keypress",'.chaty-contact-input input[type="tel"]',(function(e){var a=e.which?e.which:e.keyCode;return 43==a&&""==t(this).val()||a>=48&&a<=57})),t(document).on("change",'.chaty-contact-input input[type="tel"]',(function(){var e=new RegExp(/^(\+)?\d*$/),a=t(this).val();e.test(a)||t(this).val("")}
8169)),t(document).on("click","a.chaty-qr-code-form",(function(e){e.preventDefault();var a=t(this).data("form");if(!R(a)&&t("#"+a).length){var n=t(this).html();t("#"+a).hasClass("active")?(t(this).closest(".chaty").find(".chaty-widget:not(.has-single)").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+a).removeClass("active"),t("body").removeClass("add-bg-blur-effect")):(t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+a).addClass("active"),n=t(this).closest(".chaty").find(".chaty-widget .chaty-cta-close").find("button").html(),t(this).closest(".chaty").find(".open-chaty-channel").html(n))}})),t(document).on("click","a.chaty-contact-us-form",(function(e){e.preventDefault();var a=t(this).data("form");R(a)||t("#"+a).length&&(""!=l&&(l="",d()),t("#"+a).hasClass("active")?(t(this).closest(".chaty").find(".chaty-widget:not(.has-single)").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+a).removeClass("active"),t("body").removeClass("add-bg-blur-effect")):(t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+a).addClass("active"),t("#"+a).find(".chaty-ajax-success-message").remove(),t("#"+a).find(".chaty-ajax-error-message").remove(),t("#"+a).find(".has-chaty-error").removeClass("has-chaty-error"),buttonHtml=t(this).closest(".chaty").find(".chaty-widget .chaty-cta-close").find("button").html(),t(this).closest(".chaty").find(".open-chaty-channel").html(buttonHtml)))})),t(document).on("click","a.chaty-whatsapp-btn-form",(function(e){e.preventDefault();var a=t(this).data("form");if(!R(a)&&t("#"+a).length){if(t("#"+a).hasClass("active"))t(this).closest(".chaty").find(".chaty-widget:not(.has-single)").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+a).removeClass("active"),t("body").removeClass("add-bg-blur-effect"),setTimeout((function(){t("body").removeClass("add-bg-blur-effect")}),100);else{t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+a).addClass("active");var n=t(this).closest(".chaty").find(".chaty-widget .chaty-cta-close").find("button").html();t(this).closest(".chaty").find(".chaty-widget").find(".open-chaty-channel").html(n)}setTimeout((function(){t(".chaty-whatsapp-btn-form.active .chaty-whatsapp-input").focus()}),100)}})),t(document).on("click",".chaty-channel.chaty-agent-button",(function(e){e.preventDefault();var a=t(this).data("form");if(!R(a)&&t("#"+a).length)if(t(this).closest(".chaty").find(".chaty-widget").hasClass("has-single"))t(this).closest(".chaty").hasClass("form-open")?(t(this).closest(".chaty").find(".chaty-widget:not(.has-single)").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+a).removeClass("active"),t("body").removeClass("add-bg-blur-effect")):(n=t(this).closest(".chaty").find(".chaty-widget .chaty-cta-close").find("button").html(),t("#"+a).addClass("is-active"),t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+a).addClass("active"),t(this).closest(".chaty").find(".open-chaty-channel").html(n));else{var n=t(this).html();t("#"+a).addClass("is-active"),t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+a).addClass("active"),n=t(this).closest(".chaty").find(".chaty-widget .chaty-cta-close").find("button").html(),t(this).closest(".chaty").find(".open-chaty-channel").html(n)}})),t(document).on("click",".chaty-channel a.has-gae",(function(a){var n=t(this).closest(".chaty-channel").data("channel");if(n!==e&&""!=n&&null!=n&&(window.hasOwnProperty("gtag")&&gtag("event","chaty_"+n,{eventCategory:"chaty_"+n,event_action:"chaty_"+n,method:"chaty_"+n}),window.hasOwnProperty("ga"))){var c=window.ga.getAll()[0];c&&c.send("event","click",{eventCategory:"chaty_"+n,eventAction:"chaty_"+n,method:"chaty_"+n})}})),t(document).on("mouseover",".chaty-widget.has-single .chaty-channel a.has-on-hover[data-hover]",(function(){t(this).find(".on-hover-text").text(t(this).data("hover"))})).on("mouseleave",".chaty-widget.has-single .chaty-channel a.has-on-hover[data-text]",(function(){t(this).find(".on-hover-text").html(t(this).data("text"))})),t(document).on("submit",".whatsapp-chaty-form.has-form-gae",(function(){var a=t(this).data("widget"),n=t("#Whatsapp-"+a+"-channel").data("channel");
8169if(n!==e&&""!=n&&null!=n&&(window.hasOwnProperty("gtag")&&gtag("event","chaty_whatsapp_redirect",{eventCategory:"chaty_whatsapp_redirect",event_action:"chaty_whatsapp_redirect",method:"chaty_whatsapp_redirect"}),window.hasOwnProperty("ga"))){var c=window.ga.getAll()[0];c&&c.send("event","click",{eventCategory:"chaty_whatsapp_redirect",eventAction:"chaty_whatsapp_redirect",method:"chaty_whatsapp_redirect"})}})),t(document).on("click",".chaty-i-trigger:not(.single-channel)",(function(){t(this).closest(".chaty").hasClass("form-open")?(t(this).closest(".chaty").removeClass("form-open"),t(this).closest(".chaty-widget:not(.has-single)").addClass("chaty-open")):t(this).closest(".chaty-widget").toggleClass("chaty-open"),t(".chaty-outer-forms.active").each((function(){t(this).removeClass("active");var e=t(this).data("widget");t("#chaty-widget-"+e).removeClass("form-open")})),t(this).closest(".chaty").find(".chaty-widget").hasClass("chaty-no-close-button")&&t(this).closest(".chaty").find(".chaty-widget:not(.has-single)").addClass("chaty-open")})),t(document).on("click",".chaty-i-trigger.single-channel .chaty-cta-close",(function(){if(t(this).closest(".chaty").hasClass("form-open")){t(this).closest(".chaty").removeClass("form-open");var e=t(this).closest(".chaty").data("id");t("#chaty-form-"+e+"-Whatsapp").length&&t("#chaty-form-"+e+"-Whatsapp").hasClass("active")&&(clickStatus=xt(e,"c-Whatsapp"),R(e)&&0!=e||!clickStatus||Ct(e,"c-Whatsapp"))}t(".chaty-outer-forms.active").each((function(){t(this).removeClass("active");var e=t(this).data("widget");t("#chaty-widget-"+e).removeClass("form-open")}))}
8169)),s||t(document).on("mouseover","body:not(.chaty-in-mobile) .chaty.open-on-hover .chaty-i-trigger:not(.single-channel)",(function(){t(this).closest(".chaty-widget").hasClass("chaty-open")||t(this).closest(".chaty-widget").hasClass("on-chaty-widget")||(t(this).closest(".chaty-widget").addClass("on-chaty-widget"),t(this).find(".chaty-cta-main").trigger("click"))})).on("mouseleave","body:not(.chaty-in-mobile) .chaty.open-on-hover .chaty-i-trigger:not(.single-channel)",(function(){t(this).closest(".chaty-widget").hasClass("chaty-open")||t(this).closest(".chaty-widget").removeClass("on-chaty-widget")})),t(document).on("click",".chaty-channel.single a",(function(){var e=t(this).closest(".chaty").data("id");t(this).closest(".chaty").hasClass("first_click")&&t(this).closest(".chaty-channel").removeClass("active"),j(e)})),t(document).on("click",".chaty-chatway-channel",(function(){"object"==r(window.$chatway)&&window.$chatway.openChatwayWidget()})),t(document).on("click",".chaty-channel a, .chaty-channel button",(function(e){var a,n;t(this).is("a")&&"#"==t(this).attr("href")&&e.preventDefault();var c=[],i=0,o=t(this).closest(".chaty").data("id");if(void 0!==o&&void 0!==t("#chaty-widget-"+o).data("identifier")){var h=t("#chaty-widget-"+o).data("user");if(j(o),t(this).closest(".chaty-channel").hasClass("chaty-cta-main")||t(this).closest(".chaty-channel").hasClass("chaty-cta-close")){if(t("#chaty-form-"+o+"-Whatsapp").length&&t("#chaty-form-"+o+"-Whatsapp").hasClass("active")&&(a=xt(o,"c-Whatsapp"),R(o)&&0!=o||!a||Ct(o,"c-Whatsapp")),a=xt(o,"c-widget"),t("#chaty-widget-"+o).find(".ch-pending-msg").remove(),a&&(Ct(o,"c-widget"),t(this).closest(".chaty-channel").hasClass("chaty-cta-main"))){c=[],t("#chaty-widget-"+o).hasClass("chaty-has-chat-view")?t(".chaty-chat-view.chaty-chat-view-"+o+" .chaty-view-channels").find(".chaty-channel").each((function(){n=t(this).data("channel"),(a=xt(o,"v-"+n))&&void 0!==n&&(Ct(o,"v-"+n),c.push(n))})):t("#chaty-widget-"+o+" .chaty-channel-list").find(".chaty-channel").each((function(){n=t(this).data("channel"),(a=xt(o,"v-"+n))&&void 0!==n&&(Ct(o,"v-"+n),c.push(n))}));var r=t("#chaty-widget-"+o).data("nonce");g||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:o,userId:h,isMobile:s,channels:c,isSingle:0,nonce:r,action:"update_chaty_widget_click"},dataType:"json",method:"post"})}t("#chaty-widget-"+o).hasClass("first_click")&&(t("#chaty-widget-"+o+" .chaty-cta-main").removeClass("active"),t("#chaty-widget-"+o+" .chaty-cta-main").removeClass("chaty-tooltip"))}else if(t(this).closest(".chaty-channel").hasClass("single")){t("#chaty-widget-"+o).find(".ch-pending-msg").remove(),a=xt(o,"c-widget");r=t("#chaty-widget-"+o).data("nonce");a&&(Ct(o,"c-widget"),i=0,c=[],n=t(this).closest(".chaty-channel").data("channel"),(a=xt(o,"c-"+n))&&(c.push(n),i=1),g||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:o,userId:h,isMobile:s,channels:c,isSingle:i,nonce:r,action:"update_chaty_widget_click"},dataType:"json",method:"post"})),t("#chaty-widget-"+o).hasClass("first_click")&&(t("#chaty-widget-"+o+" .chaty-tooltip").removeClass("chaty-tooltip"),t("#chaty-widget-"+o+" .single-channel a").addClass("chaty-tooltip"))}else if(t(this).hasClass("chaty-link")&&(n=t(this).closest(".chaty-channel").data("channel"),a=xt(o,"c-"+n))){Ct(o,"c-"+n);r=t("#chaty-widget-"+o).data("nonce");g||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:o,userId:h,isMobile:s,channel:n,nonce:r,action:"update_chaty_channel_click"},dataType:"json",method:"post"})}}})),t(document).on("submit",".chaty-ajax-contact-form",(function(e){e.preventDefault();var a=0;if(t(this).find(".has-chaty-error").each((function(){t(this).removeClass("has-chaty-error")})),t(this).find(".chaty-error-msg").remove(),t(this).find(".chaty-ajax-error-message").remove(),t(this).find(".chaty-ajax-success-message").remove(),t(this).find(".is-required").each((function(){""==jQuery.trim(t(this).val())&&(a++,t(this).addClass("has-chaty-error"),t(this).hasClass("chaty-text-block")&&t(this).closest(".chaty-contact-input").find(".mce-tinymce").addClass("mce-error"))})),0==a){var n=t(this),c=n[0],i=new FormData(c);t(".chaty-submit-button").attr("disabled",!0),t("#chaty-submit-button-"+n.data("index")+" .chaty-loader").addClass("active"),jQuery.ajax({url:chaty_settings.ajax_url,enctype:"multipart/form-data",data:i,type:"post",dataType:"json",cache:!1,contentType:!1,processData:!1,success:function(e){if(""!=l&&(l="",d()),t(".chaty-ajax-error-message").remove(),t(".chaty-ajax-success-message").remove(),t(".chaty-submit-button").attr("disabled",!1),1==e.status){if(t("#chaty-submit-button-"+n.data("index")+" .chaty-loader").removeClass("active"),t(".chaty-contact-inputs").append("<div class='chaty-ajax-success-message'>"+e.message+"</div>"),t(".chaty-ajax-contact-form").find(".chaty-contact-input .mce-tinymce").removeClass("mce-error"),t(".field-name, .field-email, .field-message, .field-phone").val(""),t(".chaty-ajax-contact-form").find(".chaty-input-field").val(""),t(".chaty-ajax-contact-form").find(".chaty-textarea-field").val(""),t("#"+n.find(".chaty-text-block").attr("id")+"_ifr").contents().find("body").html(""),"yes"==e.redirect_action)if("yes"==e.link_in_new_tab)null==window.open(e.redirect_link,"_blank")&&window.open(e.redirect_link);else window.location=e.redirect_link;"yes"==e.close_form_after&&setTimeout((function(){if(t(".chaty-outer-forms.active").length){var e=t(".chaty-outer-forms.active").data("widget");R(e)&&0!=e||t("#chaty-widget-"+e).length&&(t("#chaty-widget-"+e).removeClass("form-open"),t("body").removeClass("add-bg-blur-effect"),t(".chaty-outer-forms.active").removeClass("active"),t("#chaty-widget-"+e).find(".chaty-widget").hasClass("chaty-no-close-button")&&t("#chaty-widget-"+e).find(".chaty-widget:not(.has-single)").addClass("chaty-open"))}}),1e3*parseInt(e.close_form_after_seconds))}else if(1==e.error){if(e.errors.length)for(var a=0;a<e.errors.length;a++)t("."+e.errors[a].field).addClass("has-chaty-error"),t("."+e.errors[a].field).after("<span class='chaty-error-msg'>"+e.errors[a].message+"</span>");t(".chaty-loader").removeClass("active")}else 0==e.status&&(t(".chaty-contact-inputs").append("<div class='chaty-ajax-error-message'>"+e.message+"</div>"),t(".chaty-loader").removeClass("active"));t(".email_suggestion").html("")}})}else t(".has-chaty-error:first").focus();return!1})),t(document).on("blur",".chaty-contact-form-box .field-email",(function(e){if("function"==typeof t(this).mailcheck){var a=t(this).closest(".chaty-contact-form-box").data("widget");t(this).mailcheck({suggested:function(e,n){t("#email_suggestion"+a).html("Did you mean <b><i>"+n.full+"</b></i>?")},empty:function(e){t("#email_suggestion"+a).html("")}})}})),t(document).on("click",".email_suggestion i",(function(){t(this).closest(".chaty-contact-form-box").find(".field-email").val(t(this).text()).focus(),jQuery(this).closest(".email_suggestion").html("")})),t(document).on("click",".chaty-widget.has-single .chaty-i-trigger .chaty-channel:not(.chaty-agent-button).Phone-channel",(function(){window.location=t(this).find("a").prop("href")})),t(document).on("click",".chaty-widget.has-single .chaty-i-trigger .chaty-channel:not(.chaty-agent-button).Phone-channel a, .picmo__popupContainer",(function(t){t.stopPropagation(),t.stopImmediatePropagation()})),t(document).on("click",".chaty-wp-emoji-input",(function(){if(t(".picmo__popupContainer").length);else{var e=window.picmoPopup.createPopup,a=document.querySelector("#chaty_whatsapp_input"),n=e({},{referenceElement:a,triggerElement:a,position:"top",hideOnEmojiSelect:!1});n.toggle(),n.addEventListener("emoji:select",(function(e){t(".chaty-whatsapp-input").val(t(".chaty-whatsapp-input").val()+e.emoji)}))}})),t(document).on("click","#chaty_whatsapp_input",(function(){t(".picmo__popupContainer").length&&t(".picmo__popupContainer").remove()}))})),t(window).resize((function(){t(window).height()>t(window).width()?t("body").addClass("cht-portrait").removeClass("cht-landscape"):t("body").addClass("cht-landscape").removeClass("cht-portrait")}))},void 0===(i="function"==typeof n?n.apply(e,c):n)||(t.exports=i)}();var l="";function d(){if("function"==typeof grecaptcha||"object"===("undefined"==typeof grecaptcha?"undefined":r(grecaptcha))){var t=jQuery(".v3_site_key").val();
8169t&&""==l&&grecaptcha.ready((function(){grecaptcha.execute(t,{action:"contact_form"}).then((function(t){l=t}))}))}}},311:t=>{"use strict";t.exports=jQuery}},e={};(function a(n){var c=e[n];if(void 0!==c)return c.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,a),i.exports})(724)})();
8170var Mailcheck={domainThreshold:2,secondLevelThreshold:2,topLevelThreshold:2,defaultDomains:["msn.com","bellsouth.net","telus.net","comcast.net","optusnet.com.au","earthlink.net","qq.com","sky.com","icloud.com","mac.com","sympatico.ca","googlemail.com","att.net","xtra.co.nz","web.de","cox.net","gmail.com","ymail.com","aim.com","rogers.com","verizon.net","rocketmail.com","google.com","optonline.net","sbcglobal.net","aol.com","me.com","btinternet.com","charter.net","shaw.ca","premio.io"],defaultSecondLevelDomains:["yahoo","hotmail","mail","live","outlook","gmx"],defaultTopLevelDomains:["com","com.au","com.tw","ca","co.nz","co.uk","de","fr","it","ru","net","org","edu","gov","jp","nl","kr","se","eu","ie","co.il","us","at","be","dk","hk","es","gr","ch","no","cz","in","net","net.au","info","biz","mil","co.jp","sg","hu","uk","io"],run:function(e){e.domains=e.domains||Mailcheck.defaultDomains,e.secondLevelDomains=e.secondLevelDomains||Mailcheck.defaultSecondLevelDomains,e.topLevelDomains=e.topLevelDomains||Mailcheck.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||Mailcheck.sift4Distance;var t=function(e){return e},i=e.suggested||t,s=e.empty||t,o=Mailcheck.suggest(Mailcheck.encodeEmail(e.email),e.domains,e.secondLevelDomains,e.topLevelDomains,e.distanceFunction);return o?i(o):s()},suggest:function(e,t,i,s,o){e=e.toLowerCase();var n=this.splitEmail(e);if(i&&s&&-1!==i.indexOf(n.secondLevelDomain)&&-1!==s.indexOf(n.topLevelDomain))return!1;var a=this.findClosestDomain(n.domain,t,o,this.domainThreshold);if(a)return a!=n.domain&&{address:n.address,domain:a,full:n.address+"@"+a};var l=this.findClosestDomain(n.secondLevelDomain,i,o,this.secondLevelThreshold),c=this.findClosestDomain(n.topLevelDomain,s,o,this.topLevelThreshold);if(n.domain){a=n.domain;var h=!1;if(l&&l!=n.secondLevelDomain&&(a=a.replace(n.secondLevelDomain,l),h=!0),c&&c!=n.topLevelDomain&&""!==n.secondLevelDomain&&(a=a.replace(new RegExp(n.topLevelDomain+"$"),c),h=!0),h)return{address:n.address,domain:a,full:n.address+"@"+a}}return!1},findClosestDomain:function(e,t,i,s){var o;s=s||this.topLevelThreshold;var n=1/0,a=null;if(!e||!t)return!1;i||(i=this.sift4Distance);for(var l=0;l<t.length;l++){if(e===t[l])return e;(o=i(e,t[l]))<n&&(n=o,a=t[l])}return n<=s&&null!==a&&a},sift4Distance:function(e,t,i){if(void 0===i&&(i=5),!e||!e.length)return t?t.length:0;if(!t||!t.length)return e.length;for(var s=e.length,o=t.length,n=0,a=0,l=0,c=0,h=0,r=[];n<s&&a<o;){if(e.charAt(n)==t.charAt(a)){c++;for(var d=!1,f=0;f<r.length;){var u=r[f];if(n<=u.c1||a<=u.c2){(d=Math.abs(a-n)>=Math.abs(u.c2-u.c1))?h++:u.trans||(u.trans=!0,h++);break}n>u.c2&&a>u.c1?r.splice(f,1):f++}r.push({c1:n,c2:a,trans:d})}else{l+=c,c=0,n!=a&&(n=a=Math.min(n,a));for(var m=0;m<i&&(n+m<s||a+m<o);m++){if(n+m<s&&e.charAt(n+m)==t.charAt(a)){n+=m-1,a--;break}if(a+m<o&&e.charAt(n)==t.charAt(a+m)){n--,a+=m-1;break}}}a++,(++n>=s||a>=o)&&(l+=c,c=0,n=a=Math.min(n,a))}return l+=c,Math.round(Math.max(s,o)-l+h)},splitEmail:function(e){var t=(e=null!==e?e.replace(/^\s*/,"").replace(/\s*$/,""):null).split("@");if(t.length<2)return!1;for(var i=0;i<t.length;i++)if(""===t[i])return!1;var s=t.pop(),o=s.split("."),n="",a="";if(0===o.length)return!1;if(1==o.length)a=o[0];else{n=o[0];for(var l=1;l<o.length;l++)a+=o[l]+".";a=a.substring(0,a.length-1)}return{topLevelDomain:a,secondLevelDomain:n,domain:s,address:t.join("@")}},encodeEmail:function(e){var t=encodeURI(e);return t=t.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};"undefined"!=typeof module&&module.exports&&(module.exports=Mailcheck),"function"==typeof define&&define.amd&&define("mailcheck",[],(function(){return Mailcheck})),"undefined"!=typeof window&&window.jQuery&&(jQuery.fn.mailcheck=function(e){var t=this;if(e.suggested){var i=e.suggested;e.suggested=function(e){i(t,e)}}if(e.empty){var s=e.empty;
8170e.empty=function(){s.call(null,t)}}e.email=this.val(),Mailcheck.run(e)}),function(e,t,i,s){var o="emailautocomplete",n={suggClass:"eac-sugg",domains:["yahoo.com","hotmail.com","gmail.com","me.com","aol.com","mac.com","live.com","comcast.net","googlemail.com","msn.com","hotmail.co.uk","yahoo.co.uk","facebook.com","verizon.net","sbcglobal.net","att.net","gmx.com","outlook.com","icloud.com"]};function a(t,i){this.$field=e(t),this.options=e.extend(!0,{},n,i),this._defaults=n,this._domains=this.options.domains,this.init()}a.prototype={init:function(){Array.prototype.indexOf||this.doIndexOf(),this.fieldLeftOffset=null;var t=e("<div class='eac-input-wrap' />").css({display:this.$field.css("display"),position:"static"===this.$field.css("position")?"relative":this.$field.css("position"),fontSize:this.$field.css("fontSize")});this.$field.wrap(t),this.$cval=e("<span class='eac-cval' />").css({visibility:"hidden",position:"absolute",display:"inline-block",fontFamily:this.$field.css("fontFamily"),fontWeight:this.$field.css("fontWeight"),letterSpacing:this.$field.css("letterSpacing")}).insertAfter(this.$field);var i=(this.$field.outerHeight(!0)-this.$field.height())/2;this.$suggOverlay=e("<span class='"+this.options.suggClass+"' />").css({display:"block","box-sizing":"content-box",lineHeight:this.$field.css("lineHeight"),paddingTop:i+"px",paddingBottom:i+"px",fontFamily:this.$field.css("fontFamily"),fontWeight:this.$field.css("fontWeight"),letterSpacing:this.$field.css("letterSpacing"),position:"absolute",top:0,left:0}).insertAfter(this.$field),this.$field.on("keyup.eac",e.proxy(this.displaySuggestion,this)),this.$field.on("blur.eac",e.proxy(this.autocomplete,this)),this.$field.on("keydown.eac",e.proxy((function(e){39!==e.which&&9!==e.which&&32!==e.which&&13!==e.which||this.autocomplete(),9!==e.which||this.$field.hasClass("email-focus")?(32===e.which&&e.preventDefault(),this.$field.removeClass("email-focus")):this.$field.addClass("email-focus")}),this)),this.$field.on("click",e.proxy((function(e){this.autocomplete()}),this)),this.$suggOverlay.on("mousedown.eac touchstart.eac",e.proxy(this.autocomplete,this))},suggest:function(t){var i=(t=e.trim(t.toLowerCase())).split("@");return i.length>1&&(t=i.pop()).length?(this._domains.filter((function(e){return 0===e.indexOf(t)})).shift()||"").replace(t,""):""},autocomplete:function(){if(void 0===this.suggestion||this.suggestion.length<1)return!1;this.$field.val(this.val+this.suggestion),this.$suggOverlay.text(""),this.$cval.text("")},displaySuggestion:function(e){this.val=this.$field.val(),this.suggestion=this.suggest(this.val),this.suggestion.length?e.preventDefault():this.$suggOverlay.text(""),this.$suggOverlay.text(this.suggestion),this.$cval.text(this.val),null===this.fieldLeftOffset&&(this.fieldLeftOffset=(this.$field.outerWidth(!0)-this.$field.width())/2);var t=this.$cval.width();this.$field.outerWidth()>t&&this.$suggOverlay.css("left",this.fieldLeftOffset+t+"px")},doIndexOf:function(){Array.prototype.indexOf=function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var i=this.length>>>0;for(t=+t||0,Math.abs(t)===1/0&&(t=0),t<0&&(t+=i)<0&&(t=0);t<i;t++)if(this[t]===e)return t;return-1}}},e.fn[o]=function(t){return this.each((function(){e.data(this,"yz_"+o)||e.data(this,"yz_"+o,new a(this,t))}))}}(jQuery,window,document);
8171var ye=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},w=(e,t,o)=>(ye(e,t,"read from private field"),o?o.call(e):t.get(e)),b=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},J=(e,t,o,i)=>(ye(e,t,"write to private field"),i?i.call(e,o):t.set(e,o),o),v=(e,t,o)=>(ye(e,t,"access private method"),o);!function(e,t){"object"==typeof exports&&typeof module<"u"?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).picmo={})}(this,(function(e){var t,o,i,s,r,a,n,c,l,h,d,m,u,p;async function g(e,t={}){const{local:o=!1,version:i="latest",cdnUrl:s,...r}=t,a=function(e,t,o){let i=`https://cdn.jsdelivr.net/npm/emojibase-data@${t}/${e}`;return"function"==typeof o?i=o(e,t):"string"==typeof o&&(i=`${o}/${e}`),i}(e,i,s),n=o?localStorage:sessionStorage,c=`emojibase/${i}/${e}`,l=n.getItem(c);if(l)return Promise.resolve(JSON.parse(l));const h=await fetch(a,{credentials:"omit",mode:"cors",redirect:"error",...r});if(!h.ok)throw new Error("Failed to load Emojibase dataset.");const d=await h.json();try{n.setItem(c,JSON.stringify(d))}catch{}return d}const y={discord:"joypixels",slack:"iamcal"};async function f(e,t,o){var i;return g(`${e}/shortcodes/${null!==(i=y[t])&&void 0!==i?i:t}.json`,o)}function j(e,t){if(0===t.length)return e;const o=new Set(e.shortcodes);return t.forEach((t=>{const i=t[e.hexcode];
8171Array.isArray(i)?i.forEach((e=>o.add(e))):i&&o.add(i)})),e.shortcodes=[...o],e.skins&&e.skins.forEach((e=>{j(e,t)})),e}async function C(e,t={}){const{compact:o=!1,flat:i=!1,shortcodes:s=[],...r}=t,a=await g(`${e}/${o?"compact":"data"}.json`,r);let n=[];return s.length>0&&(n=await Promise.all(s.map((t=>{let o;if(t.includes("/")){const[e,i]=t.split("/");o=f(e,i,r)}else o=f(e,t,r);return o.catch((()=>({})))})))),i?function(e,t=[]){const o=[];return e.forEach((e=>{if(e.skins){const{skins:i,...s}=e;o.push(j(s,t)),i.forEach((e=>{const i={...e};s.tags&&(i.tags=[...s.tags]),o.push(j(i,t))}))}else o.push(j(e,t))})),o}(a,n):function(e,t){return 0===t.length||e.forEach((e=>{j(e,t)})),e}(a,n)}async function k(e,t){return g(`${e}/messages.json`,t)}function _(e,t){const o=e.target.closest("[data-emoji]");if(o){const e=t.find((e=>e.emoji===o.dataset.emoji));if(e)return e}return null}function x(e){var t;const o=null==(t=window.matchMedia)?void 0:t.call(window,"(prefers-reduced-motion: reduce)");return e.animate&&!(null!=o&&o.matches)}function E(e,t){return e.toLowerCase().includes(t.toLowerCase())}function S(e,t){let o=null;return()=>{o||(o=window.setTimeout((()=>{e(),o=null}),t))}}function z(e,t){let o=null;return(...i)=>{o&&window.clearTimeout(o),o=window.setTimeout((()=>{e(...i),o=null}),t)}}function P(e,t,o,i){if(x(i)&&e.animate)return e.animate(t,o).finished;const s="normal"===o.direction?1:0,r=Object.entries(t).reduce(((e,[t,o])=>({...e,[t]:o[s]})),{});return Object.assign(e.style,r),Promise.resolve()}function L(e){var t;const o=document.createElement("template");return o.innerHTML=e,null==(t=o.content)?void 0:t.firstElementChild}async function F(e){const t=(new TextEncoder).encode(e),o=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(o)).map((e=>e.toString(16).padStart(2,"0"))).join("")}function $(...e){return e.reduce(((e,t)=>({...e,[t]:A(t)})),{})}function A(e){return`picmo__${e}`}function I(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function T(e,...t){I(e).append(...t)}function M(e){try{return window[e].length,!0}catch{return!1}}function V(){return M("sessionStorage")}function R(){return M("localStorage")}function D(e){var t;return{emoji:e.emoji,label:e.label,tags:e.tags,skins:null==(t=e.skins)?void 0:t.map((e=>D(e))),order:e.order,custom:!1,hexcode:e.hexcode,version:e.version}}function B(e,t,o){var i;return!(o&&!o.some((t=>t.order===e.group)))&&(E(e.label,t)||(null==(i=e.tags)?void 0:i.some((e=>E(e,t)))))}class N{constructor(e="en"){this.locale=e}}const H=[(e,t)=>("1F91D"===e.hexcode&&t<14&&(e.skins=[]),e),(e,t)=>(e.skins&&(e.skins=e.skins.filter((e=>!e.version||e.version<=t))),e)];function O(e,t){return e.filter((e=>null!==function(e,t){return H.some((o=>null===o(e,t)))?null:e}(e,t)))}const K={};function U(e){return K[e]||(K[e]=new W(e)),K[e]}U.deleteDatabase=e=>{};class W extends N{open(){return Promise.resolve()}delete(){return Promise.resolve()}close(){}isPopulated(){return Promise.resolve(!1)}getEmojiCount(){return Promise.resolve(this.emojis.length)}getEtags(){return Promise.resolve({foo:"bar"})}getHash(){return Promise.resolve("")}populate(e){return this.categories=e.groups,this.emojis=e.emojis,Promise.resolve()}getCategories(e){var t;let o=this.categories.filter((e=>"component"!==e.key));if(e.showRecents&&o.unshift({key:"recents",order:-1}),null!=(t=e.custom)&&t.length&&o.push({key:"custom",order:10}),e.categories){const t=e.categories;o=o.filter((e=>t.includes(e.key))),o.sort(((e,o)=>t.indexOf(e.key)-t.indexOf(o.key)))}else o.sort(((e,t)=>e.order-t.order));return Promise.resolve(o)}getEmojis(e,t){const o=this.emojis.filter((t=>t.group===e.order)).filter((e=>e.version<=t)).sort(((e,t)=>null!=e.order&&null!=t.order?e.order-t.order:0)).map(D);return Promise.resolve(O(o,t))}searchEmojis(e,t,o,i){const s=this.emojis.filter((t=>B(t,e,i)&&t.version<=o)).map(D),r=t.filter((t=>B(t,e,i))),a=[...O(s,o),...r];return Promise.resolve(a)}setMeta(e){this.meta=e}}async function q(e){try{return(await fetch(e,{method:"HEAD"})).headers.get("etag")}catch{return null}}async function G(e,t,o){let i=o||t(e);try{await i.open()}catch{console.warn("[picmo] IndexedDB not available, falling back to InMemoryStoreFactory"),i=U(e)}return i}async function Z(e,t,o){if(!V()&&typeof window<"u")throw new Error("Session storage is required to use CDN emoji data.");const i=await G(e,t,o),[s,r]=await function(e){const{emojisUrl:t,messagesUrl:o}=function(e,t){const o=`https://cdn.jsdelivr.net/npm/emojibase-data@${"latest"}/${t}`;return{emojisUrl:`${o}/data.json`,messagesUrl:`${o}/messages.json`}}(0,e);try{return Promise.all([q(t),q(o)])}
8171catch{return Promise.all([null,null])}}(e);if(await i.isPopulated())s&&r&&await async function(e,t,o){let i;try{i=await e.getEtags()}catch{i={}}const{storedEmojisEtag:s,storedMessagesEtag:r}=i;if(o!==r||t!==s){const[i,s]=await Promise.all([k(e.locale),C(e.locale)]);await e.populate({groups:i.groups,emojis:s,emojisEtag:t,messagesEtag:o})}}(i,s,r);else{const[t,o]=await Promise.all([k(e),C(e)]);await i.populate({groups:t.groups,emojis:o,emojisEtag:s,messagesEtag:r})}return i}async function Y(e,t,o,i,s){return o&&i?async function(e,t,o,i,s){const r=await G(e,t,s),a=await F(i);return(!await r.isPopulated()||await async function(e,t){return t!==await e.getHash()}(r,a))&&await r.populate({groups:o.groups,emojis:i,hash:a}),r}(e,t,o,i,s):Z(e,t,s)}class Q{constructor(){this.handleKeyDown=this.handleKeyDown.bind(this)}activate(e){this.rootElement=e,this.rootElement.addEventListener("keydown",this.handleKeyDown)}deactivate(){var e;null==(e=this.rootElement)||e.removeEventListener("keydown",this.handleKeyDown)}get focusableElements(){return this.rootElement.querySelectorAll('input, [tabindex="0"]')}get lastFocusableElement(){return this.focusableElements[this.focusableElements.length-1]}get firstFocusableElement(){return this.focusableElements[0]}checkFocus(e,t,o){e.target===t&&(o.focus(),e.preventDefault())}handleKeyDown(e){"Tab"===e.key&&this.checkFocus(e,e.shiftKey?this.firstFocusableElement:this.lastFocusableElement,e.shiftKey?this.lastFocusableElement:this.firstFocusableElement)}}const{light:X,dark:ee,auto:te}=$("light","dark","auto");class oe{constructor({template:e,classes:t,parent:o}){this.isDestroyed=!1,this.appEvents={},this.uiEvents=[],this.uiElements={},this.ui={},this.template=e,this.classes=t,this.parent=o,this.keyBindingHandler=this.keyBindingHandler.bind(this)}initialize(){this.bindAppEvents()}setCustomEmojis(e){this.customEmojis=e}setEvents(e){this.events=e}setPickerId(e){this.pickerId=e}emit(e,...t){this.events.emit(e,...t)}setI18n(e){this.i18n=e}setRenderer(e){this.renderer=e}setEmojiData(e){this.emojiDataPromise=e,e.then((e=>{this.emojiData=e}))}updateEmojiData(e){this.emojiData=e,this.emojiDataPromise=Promise.resolve(e)}setOptions(e){this.options=e}renderSync(e={}){return this.el=this.template.renderSync({classes:this.classes,i18n:this.i18n,pickerId:this.pickerId,...e}),this.postRender(),this.el}async render(e={}){return await this.emojiDataPromise,this.el=await this.template.renderAsync({classes:this.classes,i18n:this.i18n,pickerId:this.pickerId,...e}),this.postRender(),this.el}postRender(){this.bindUIElements(),this.bindKeyBindings(),this.bindUIEvents(),this.scheduleShowAnimation()}bindAppEvents(){Object.keys(this.appEvents).forEach((e=>{this.events.on(e,this.appEvents[e],this)})),this.events.on("data:ready",this.updateEmojiData,this)}unbindAppEvents(){Object.keys(this.appEvents).forEach((e=>{this.events.off(e,this.appEvents[e])})),this.events.off("data:ready",this.updateEmojiData)}keyBindingHandler(e){const t=this.keyBindings[e.key];t&&t.call(this,e)}bindKeyBindings(){this.keyBindings&&this.el.addEventListener("keydown",this.keyBindingHandler)}unbindKeyBindings(){this.keyBindings&&this.el.removeEventListener("keydown",this.keyBindingHandler)}bindUIElements(){this.ui=Object.keys(this.uiElements).reduce(((e,t)=>({...e,[t]:this.el.querySelector(this.uiElements[t])})),{})}bindUIEvents(){this.uiEvents.forEach((e=>{e.handler=e.handler.bind(this),(e.target?this.ui[e.target]:this.el).addEventListener(e.event,e.handler,e.options)}))}unbindUIEvents(){this.uiEvents.forEach((e=>{(e.target?this.ui[e.target]:this.el).removeEventListener(e.event,e.handler)}))}destroy(){this.unbindAppEvents(),this.unbindUIEvents(),this.unbindKeyBindings(),this.el.remove(),this.isDestroyed=!0}scheduleShowAnimation(){if(this.parent){const e=new MutationObserver((t=>{const[o]=t;"childList"===o.type&&o.addedNodes[0]===this.el&&(x(this.options)&&this.animateShow&&this.animateShow(),e.disconnect)}));e.observe(this.parent,{childList:!0})}}static childEvent(e,t,o,i={}){return{target:e,event:t,handler:o,options:i}}static uiEvent(e,t,o={}){return{event:e,handler:t,options:o}}static byClass(e){return`.${e}`}}const ie={clock:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"/></svg>',flag:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"/></svg>',frown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM176.4 240C194 240 208.4 225.7 208.4 208C208.4 190.3 194 176 176.4 176C158.7 176 144.4 190.3 144.4 208C144.4 225.7 158.7 240 176.4 240zM336.4 176C318.7 176 304.4 190.3 304.4 208C304.4 225.7 318.7 240 336.4 240C354 240 368.4 225.7 368.4 208C368.4 
8171190.3 354 176 336.4 176zM259.9 369.4C288.8 369.4 316.2 375.2 340.6 385.5C352.9 390.7 366.7 381.3 361.4 369.1C344.8 330.9 305.6 303.1 259.9 303.1C214.3 303.1 175.1 330.8 158.4 369.1C153.1 381.3 166.1 390.6 179.3 385.4C203.7 375.1 231 369.4 259.9 369.4L259.9 369.4z"/></svg>',gamepad:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M448 64H192C85.96 64 0 149.1 0 256s85.96 192 192 192h256c106 0 192-85.96 192-192S554 64 448 64zM247.1 280h-32v32c0 13.2-10.78 24-23.98 24c-13.2 0-24.02-10.8-24.02-24v-32L136 279.1C122.8 279.1 111.1 269.2 111.1 256c0-13.2 10.85-24.01 24.05-24.01L167.1 232v-32c0-13.2 10.82-24 24.02-24c13.2 0 23.98 10.8 23.98 24v32h32c13.2 0 24.02 10.8 24.02 24C271.1 269.2 261.2 280 247.1 280zM431.1 344c-22.12 0-39.1-17.87-39.1-39.1s17.87-40 39.1-40s39.1 17.88 39.1 40S454.1 344 431.1 344zM495.1 248c-22.12 0-39.1-17.87-39.1-39.1s17.87-40 39.1-40c22.12 0 39.1 17.88 39.1 40S518.1 248 495.1 248z"/></svg>',lightbulb:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"/></svg>',mug:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M512 32H120c-13.25 0-24 10.75-24 24L96.01 288c0 53 43 96 96 96h192C437 384 480 341 480 288h32c70.63 0 128-57.38 128-128S582.6 32 512 32zM512 224h-32V96h32c35.25 0 64 28.75 64 64S547.3 224 512 224zM560 416h-544C7.164 416 0 423.2 0 432C0 458.5 21.49 480 48 480h480c26.51 0 48-21.49 48-48C576 423.2 568.8 416 560 416z"/></svg>',plane:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M482.3 192C516.5 192 576 221 576 256C576 292 516.5 320 482.3 320H365.7L265.2 495.9C259.5 505.8 248.9 512 237.4 512H181.2C170.6 512 162.9 501.8 165.8 491.6L214.9 320H112L68.8 377.6C65.78 381.6 61.04 384 56 384H14.03C6.284 384 0 377.7 0 369.1C0 368.7 .1818 367.4 .5398 366.1L32 256L.5398 145.9C.1818 144.6 0 143.3 0 142C0 134.3 6.284 128 14.03 128H56C61.04 128 65.78 130.4 68.8 134.4L112 192H214.9L165.8 20.4C162.9 10.17 170.6 0 181.2 0H237.4C248.9 0 259.5 6.153 265.2 16.12L365.7 192H482.3z"/></svg>',robot:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M9.375 233.4C3.375 239.4 0 247.5 0 256v128c0 8.5 3.375 16.62 9.375 22.62S23.5 416 32 416h32V224H32C23.5 224 15.38 227.4 9.375 233.4zM464 96H352V32c0-17.62-14.38-32-32-32S288 14.38 288 32v64H176C131.8 96 96 131.8 96 176V448c0 35.38 28.62 64 64 64h320c35.38 0 64-28.62 64-64V176C544 131.8 508.3 96 464 96zM256 416H192v-32h64V416zM224 296C201.9 296 184 278.1 184 256S201.9 216 224 216S264 233.9 264 256S246.1 296 224 296zM352 416H288v-32h64V416zM448 416h-64v-32h64V416zM416 296c-22.12 0-40-17.88-40-40S393.9 216 416 216S456 233.9 456 256S438.1 296 416 296zM630.6 233.4C624.6 227.4 616.5 224 608 224h-32v192h32c8.5 0 16.62-3.375 22.62-9.375S640 392.5 640 384V256C640 247.5 636.6 239.4 630.6 233.4z"/></svg>',sad:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\n  <defs>\n    <radialGradient gradientUnits="userSpaceOnUse" cy="10%" id="gradient-0">\n      <stop offset="0" stop-color="hsl(50, 100%, 50%)" />\n      <stop offset="1" stop-color="hsl(50, 100%, 60%)" />\n    </radialGradient>\n  </defs>\n  \x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e\n  <ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="172.586" cy="207.006" rx="39.974" ry="39.974"/>\n  <ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="334.523" cy="207.481" rx="39.974" ry="39.974"/>\n  <ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="313.325" cy="356.208" rx="91.497" ry="59.893"/>\n  <path fill="#55a7ff" d="M 159.427 274.06 L 102.158 363.286 L 124.366 417.011 L 160.476 423.338 L 196.937 414.736 L 218.502 375.214"></path>\n  <path fill="url(#gradient-0)" d="M256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0zM256 352C290.9 352 323.2 367.8 348.3 394.9C354.3 401.4 364.4 401.7 370.9 395.7C377.4 389.7 377.7 379.6 371.7 373.1C341.6 340.5 301 320 256 320C247.2 320 240 327.2 240 336C240 344.8 247.2 352 256 352H256zM208 369C208 349 179.6 308.6 166.4 291.3C163.2 286.9 156.8 286.9 153.6 291.3C140.6 308.6 112 349 112 369C112 395 133.5 416 160 416C186.5 416 208 395 208 369H208zM303.6 208C303.6 225.7 317.1 240 335.6 240C353.3 240 367.6 225.7 367.6 208C367.6 190.3 353.3 176 335.6 176C317.1 176 303.6 190.3 303.6 208zM207.6 208C207.6 190.3 193.3 176 175.6 176C157.1 176 143.6 190.3 143.6 208C143.6 225.7 157.1 240 175.6 240C193.3 240 207.6 225.7 207.6 208z" />\n</svg>',search:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/></svg>',smiley:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256.3 331.8C208.9 331.8 164.1 324.9 124.5 312.8C112.2 309 100.2 319.7 105.2 331.5C130.1 390.6 188.4 432 256.3 432C324.2 432 382.4 390.6 407.4 331.5C412.4 319.7 400.4 309 388.1 312.8C348.4 324.9 303.7 331.8 256.3 331.8H256.3zM176.4 176C158.7 176 144.4 190.3 144.4 208C144.4 225.7 158.7 240 176.4 240C194 240 208.4 225.7 208.4 208C208.4 190.3 194 176 176.4 176zM336.4 240C354 240 368.4 225.7 368.4 208C368.4 
8171190.3 354 176 336.4 176C318.7 176 304.4 190.3 304.4 208C304.4 225.7 318.7 240 336.4 240z"/></svg>',symbols:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"/></svg>',tree:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M413.8 447.1L256 448l0 31.99C256 497.7 241.8 512 224.1 512c-17.67 0-32.1-14.32-32.1-31.99l0-31.99l-158.9-.0099c-28.5 0-43.69-34.49-24.69-56.4l68.98-79.59H62.22c-25.41 0-39.15-29.8-22.67-49.13l60.41-70.85H89.21c-21.28 0-32.87-22.5-19.28-37.31l134.8-146.5c10.4-11.3 28.22-11.3 38.62-.0033l134.9 146.5c13.62 14.81 2.001 37.31-19.28 37.31h-10.77l60.35 70.86c16.46 19.34 2.716 49.12-22.68 49.12h-15.2l68.98 79.59C458.7 413.7 443.1 447.1 413.8 447.1z"/></svg>',users:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M224 256c70.7 0 128-57.31 128-128S294.7 0 224 0C153.3 0 96 57.31 96 128S153.3 256 224 256zM274.7 304H173.3c-95.73 0-173.3 77.6-173.3 173.3C0 496.5 15.52 512 34.66 512H413.3C432.5 512 448 496.5 448 477.3C448 381.6 370.4 304 274.7 304zM479.1 320h-73.85C451.2 357.7 480 414.1 480 477.3C480 490.1 476.2 501.9 470 512h138C625.7 512 640 497.6 640 479.1C640 391.6 568.4 320 479.1 320zM432 256C493.9 256 544 205.9 544 144S493.9 32 432 32c-25.11 0-48.04 8.555-66.72 22.51C376.8 76.63 384 101.4 384 128c0 35.52-11.93 68.14-31.59 94.71C372.7 243.2 400.8 256 432 256z"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\n  <defs>\n    <radialGradient id="radial" cy="85%">\n      <stop offset="20%" stop-color="var(--color-secondary)" />\n      <stop offset="100%" stop-color="var(--color-primary)" />\n    </radialGradient>\n  </defs>\n  \x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e\n  <path fill="url(\'#radial\')" d="M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z" />\n</svg>',xmark:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>'},se={recents:"clock","smileys-emotion":"smiley","people-body":"users","animals-nature":"tree","food-drink":"mug",activities:"gamepad","travel-places":"plane",objects:"lightbulb",symbols:"symbols",flags:"flag",custom:"robot"};function re(e,t){if(!(e in ie))return console.warn(`Unknown icon: "${e}"`),document.createElement("div");const o=function(e,t){const o=L(t);return o.dataset.icon=e,o.classList.add(A("icon")),o}(e,ie[e]);return t&&o.classList.add(A(`icon-${t}`)),o}const ae="sync";class ne{constructor(e,s={}){b(this,i),b(this,r),b(this,n),b(this,t,void 0),b(this,o,void 0),J(this,t,e),J(this,o,s.mode||ae)}renderSync(e={}
8171){const o=L(w(this,t).call(this,e));return v(this,n,c).call(this,o,e),v(this,r,a).call(this,o),v(this,i,s).call(this,o,e),o}async renderAsync(e={}){const o=L(w(this,t).call(this,e));return v(this,n,c).call(this,o,e),v(this,r,a).call(this,o),await v(this,i,s).call(this,o,e),o}render(e){return"sync"===w(this,o)?this.renderSync(e):this.renderAsync(e)}}t=new WeakMap,o=new WeakMap,i=new WeakSet,s=async function(e,t){const o=e.querySelectorAll("[data-view]"),i=[];for(const e of o){const o=t[e.dataset.view];o?"sync"!==e.dataset.render?i.push(o.render().then((t=>(e.replaceWith(t),t)))):e.replaceWith(o.renderSync()):e.remove()}return Promise.all(i)},r=new WeakSet,a=function(e){e.querySelectorAll("i[data-icon]").forEach((e=>{const{icon:t,size:o}=e.dataset;e.replaceWith(re(t,o))}))},n=new WeakSet,c=function(e,t){return e.querySelectorAll("[data-placeholder]").forEach((e=>{const o=e.dataset.placeholder;if(o&&t[o]){const i=t[o];e.replaceWith(...[i].flat())}else console.warn(`Missing placeholder element for key "${o}"`)})),e};const ce=$("imagePlaceholder","placeholder"),le=new ne((({classes:e})=>`\n  <div class="${e.placeholder} ${e.imagePlaceholder}"></div>\n`));class he extends oe{constructor({classNames:e}={}){super({template:le,classes:ce}),this.classNames=e}load(e){const t=document.createElement("img");this.classNames&&(t.className=this.classNames),t.addEventListener("load",(()=>{this.el.replaceWith(t)}),{once:!0}),Promise.resolve(e).then((e=>t.src=e))}renderSync(){return super.renderSync(),this.classNames&&this.classNames.split(" ").forEach((e=>this.el.classList.add(e))),this.el}}const de=$("customEmoji");class me{renderElement(e){return{content:e}}renderImage(e="",t){const o=new he({classNames:e});return o.renderSync(),{content:o,resolver:()=>(o.load(t()),o.el)}}doRender(e,t,o){if(e.custom)return this.renderCustom(e,t,o);const{content:i,resolver:s}=this.render(e,o),r=i instanceof Element?i:i.el;return s&&s(),r}doEmit(e){return e.custom?this.emitCustom(e):this.emit(e)}emitCustom({url:e,label:t,emoji:o,data:i}){return{url:e,label:t,emoji:o,data:i}}renderCustom(e,t,o=""){const i=[de.customEmoji,o].join(" ").trim(),{content:s,resolver:r}=this.renderImage(i,(()=>e.url)),a=s instanceof Element?s:s.el;return r&&r(),a}}const ue=new ne((({emoji:e})=>`<span>${e}</span>`));class pe extends me{render(e){return this.renderElement(ue.renderSync({emoji:e.emoji}))}emit({emoji:e,hexcode:t,label:o}){return{emoji:e,hexcode:t,label:o}}}const ge={"categories.activities":"Activities","categories.animals-nature":"Animals & Nature","categories.custom":"Custom","categories.flags":"Flags","categories.food-drink":"Food & Drink","categories.objects":"Objects","categories.people-body":"People & Body","categories.recents":"Recently Used","categories.smileys-emotion":"Smileys & Emotion","categories.symbols":"Symbols","categories.travel-places":"Travel & Places","error.load":"Failed to load emojis","recents.clear":"Clear recent emojis","recents.none":"You haven't selected any emojis yet.",retry:"Try again","search.clear":"Clear search","search.error":"Failed to search emojis","search.notFound":"No results found",search:"Search emojis..."},ye="PicMo";function ve(e){return new fe(e)}ve.deleteDatabase=e=>new Promise(((t,o)=>{const i=indexedDB.deleteDatabase(`${ye}-${e}`);i.addEventListener("success",t),i.addEventListener("error",o)}));class fe extends N{async open(){const e=indexedDB.open(`${ye}-${this.locale}`);return new Promise(((t,o)=>{e.addEventListener("success",(e=>{var o;this.db=null==(o=e.target)?void 0:o.result,t()})),e.addEventListener("error",o),e.addEventListener("upgradeneeded",(async e=>{var t;this.db=null==(t=e.target)?void 0:t.result,this.db.createObjectStore("category",{keyPath:"order"});const o=this.db.createObjectStore("emoji",{keyPath:"emoji"});o.createIndex("category","group"),o.createIndex("version","version"),this.db.createObjectStore("meta")}))}))}async delete(){this.close();const e=indexedDB.deleteDatabase(`${ye}-${this.locale}`);await this.waitForRequest(e)}close(){this.db.close()}async getEmojiCount(){const e=this.db.transaction("emoji","readonly").objectStore("emoji");return(await this.waitForRequest(e.count())).target.result}async getEtags(){const e=this.db.transaction("meta","readonly").objectStore("meta"),[t,o]=await Promise.all([this.waitForRequest(e.get("emojisEtag")),this.waitForRequest(e.get("messagesEtag"))]);return{storedEmojisEtag:t.target.result,storedMessagesEtag:o.target.result}}async setMeta(e){const t=this.db.transaction("meta","readwrite"),o=t.objectStore("meta");return new Promise((i=>
8171{t.oncomplete=i,Object.keys(e).filter(Boolean).forEach((t=>{o.put(e[t],t)}))}))}async getHash(){const e=this.db.transaction("meta","readonly").objectStore("meta");return(await this.waitForRequest(e.get("hash"))).target.result}async isPopulated(){const e=this.db.transaction("category","readonly").objectStore("category");return(await this.waitForRequest(e.count())).target.result>0}async populate({groups:e,emojis:t,emojisEtag:o,messagesEtag:i,hash:s}){await this.removeAllObjects("category","emoji");const r=[this.addObjects("category",e),this.addObjects("emoji",t),this.setMeta({emojisEtag:o,messagesEtag:i,hash:s})];await Promise.all(r)}async getCategories(e){var t;const o=this.db.transaction("category","readonly").objectStore("category");let i=(await this.waitForRequest(o.getAll())).target.result.filter((e=>"component"!==e.key));if(e.showRecents&&i.unshift({key:"recents",order:-1}),null!=(t=e.custom)&&t.length&&i.push({key:"custom",order:10}),e.categories){const t=e.categories;i=i.filter((e=>t.includes(e.key))),i.sort(((e,o)=>t.indexOf(e.key)-t.indexOf(o.key)))}else i.sort(((e,t)=>e.order-t.order));return i}async getEmojis(e,t){const o=this.db.transaction("emoji","readonly").objectStore("emoji").index("category");return O((await this.waitForRequest(o.getAll(e.order))).target.result.filter((e=>e.version<=t)).sort(((e,t)=>null!=e.order&&null!=t.order?e.order-t.order:0)).map(D),t)}async searchEmojis(e,t,o,i){const s=[];return new Promise(((r,a)=>{const n=this.db.transaction("emoji","readonly").objectStore("emoji").openCursor();n.addEventListener("success",(a=>{var n;const c=null==(n=a.target)?void 0:n.result;if(!c)return r([...O(s,o),...t.filter((t=>B(t,e)))]);const l=c.value;B(l,e,i)&&l.version<=o&&s.push(D(l)),c.continue()})),n.addEventListener("error",(e=>{a(e)}))}))}async waitForRequest(e){return new Promise(((t,o)=>{e.onsuccess=t,e.onerror=o}))}withTransaction(e,t="readwrite",o){return new Promise(((i,s)=>{const r=this.db.transaction(e,t);r.oncomplete=i,r.onerror=s,o(r)}))}async removeAllObjects(...e){const t=this.db.transaction(e,"readwrite"),o=e.map((e=>t.objectStore(e)));await Promise.all(o.map((e=>this.waitForRequest(e.clear()))))}async addObjects(e,t){return this.withTransaction(e,"readwrite",(o=>{const i=o.objectStore(e);t.forEach((e=>{i.add(e)}))}))}}function we(){let e={};return{getItem:t=>e[t],setItem:(t,o)=>e[t]=o,length:Object.keys(e).length,clear:()=>e={},key:t=>Object.keys(e)[t],removeItem:t=>delete e[t]}}class be{}const je="PicMo:recents";class Ce extends be{constructor(e){super(),this.storage=e}clear(){this.storage.removeItem(je)}getRecents(e){var t;try{return JSON.parse(null!=(t=this.storage.getItem(je))?t:"[]").slice(0,e)}catch{return[]}}addOrUpdateRecent(e,t){const o=[e,...this.getRecents(t).filter((t=>t.hexcode!==e.hexcode))].slice(0,t);try{this.storage.setItem(je,JSON.stringify(o))}catch{console.warn("storage is not available, recent emojis will not be saved")}}}class ke extends Ce{constructor(){super(R()?localStorage:we())}}const _e={dataStore:ve,theme:X,animate:!0,showCategoryTabs:!0,showPreview:!0,showRecents:!0,showSearch:!0,showVariants:!0,emojisPerRow:8,visibleRows:6,emojiVersion:"auto",i18n:ge,locale:"en",maxRecents:50,custom:[]};function xe(e={}){return{..._e,...e,renderer:e.renderer||new pe,recentsProvider:e.recentsProvider||new ke}}class Ee{constructor(){b(this,h),b(this,m),b(this,l,new Map)}on(e,t,o){v(this,m,u).call(this,e,t,o)}once(e,t,o){v(this,m,u).call(this,e,t,o,!0)}off(e,t){const o=v(this,h,d).call(this,e);w(this,l).set(e,o.filter((e=>e.handler!==t)))}emit(e,...t){v(this,h,d).call(this,e).forEach((o=>{o.handler.apply(o.context,t),o.once&&this.off(e,o.handler)}))}removeAll(){w(this,l).clear()}}l=new WeakMap,h=new WeakSet,d=function(e){return w(this,l).has(e)||w(this,l).set(e,[]),w(this,l).get(e)},m=new WeakSet,u=function(e,t,o,i=!1){v(this,h,d).call(this,e).push({context:o,handler:t,once:i})};const Se={injectStyles:!0};class ze extends Ee{}class Pe extends Ee{}const Le=$("emojiCategory","categoryName","noRecents","recentEmojis");class Fe extends oe{constructor({template:e,category:t,showVariants:o,lazyLoader:i}){super({template:e,classes:Le}),this.baseUIElements={categoryName:oe.byClass(Le.categoryName)},this.category=t,this.showVariants=o,this.lazyLoader=i}setActive(e,t,o){this.emojiContainer.setActive(e,t,o)}}const $e=new ne((({classes:e,emoji:t})=>`\n  <button\n    type="button"\n    class="${e.emojiButton}"\n    title="${t.label}"\n    data-emoji="${t.emoji}"\n    tabindex="-1">\n    <div data-placeholder="emojiContent"></div>\n  </button>\n`)),Ae=$("emojiButton");class Ie extends oe{constructor({emoji:e,lazyLoader:t,category:o}){super({template:$e,classes:Ae}),this.emoji=e,this.lazyLoader=t,this.category=o}initialize(){this.uiEvents=[oe.uiEvent("focus",this.handleFocus)],super.initialize()}handleFocus(){this.category&&this.events.emit("focus:change",this.category)}activateFocus(e){this.el.tabIndex=0,e&&this.el.focus()}deactivateFocus(){this.el.tabIndex=-1}renderSync(){return super.renderSync({emoji:this.emoji,emojiContent:this.renderer.doRender(this.emoji,this.lazyLoader)})}}class Te{constructor(e,t,o=0,i=0,s=!1){this.events=new Ee,this.keyHandlers={ArrowLeft:this.focusPrevious.bind(this),ArrowRight:this.focusNext.bind(this),ArrowUp:this.focusUp.bind(this),ArrowDown:this.focusDown.bind(this)},this.rowCount=Math.ceil(t/e),this.columnCount=e,this.focusedRow=o,this.focusedColumn=i,this.emojiCount=t,this.wrap=s,this.handleKeyDown=this.handleKeyDown.bind(this)}destroy(){this.events.removeAll()}on(e,t){this.events.on(e,t)}handleKeyDown(e){e.key in this.keyHandlers&&(e.preventDefault(),this.keyHandlers[e.key]())}setCell(e,t,o=!0){const i=this.getIndex();this.focusedRow=e,void 0!==t&&(this.focusedColumn=Math.min(this.columnCount,t)),(this.focusedRow>=this.rowCount||this.getIndex()>=this.emojiCount)&&(this.focusedRow=this.rowCount-1,this.focusedColumn=this.emojiCount%this.columnCount-1),this.events.emit("focus:change",{from:i,to:this.getIndex(),performFocus:o})}setFocusedIndex(e,t=!0){const o=Math.floor(e/this.columnCount),i=e%this.columnCount;this.setCell(o,i,t)}focusNext(){this.focusedColumn<this.columnCount-1&&this.getIndex()<this.emojiCount-1?this.setCell(this.focusedRow,this.focusedColumn+1):this.focusedRow<this.rowCount-1?this.setCell(this.focusedRow+1,0):this.wrap?this.setCell(0,0):this.events.emit("focus:overflow",0)}focusPrevious(){this.focusedColumn>0?this.setCell(this.focusedRow,this.focusedColumn-1):this.focusedRow>0?this.setCell(this.focusedRow-1,this.columnCount-1):this.wrap?this.setCell(this.rowCount-1,this.columnCount-1):this.events.emit("focus:underflow",this.columnCount-1)}focusUp(){this.focusedRow>0?this.setCell(this.focusedRow-1,this.focusedColumn):this.events.emit("focus:underflow",this.focusedColumn)}focusDown(){this.focusedRow<this.rowCount-1?this.setCell(this.focusedRow+1,this.focusedColumn):this.events.emit("focus:overflow",this.focusedColumn)}focusToIndex(e){this.setCell(Math.floor(e/this.columnCount),e%this.columnCount)}getIndex(){return this.focusedRow*this.columnCount+this.focusedColumn}getCell(){return{row:this.focusedRow,column:this.focusedColumn}}getRowCount(){return this.rowCount}}const Me=new ne((({classes:e})=>`\n  <div class="${e.emojiContainer}">\n    <div data-placeholder="emojis"></div>\n  </div>\n`)),Ve=$("emojiContainer");class Re extends oe{constructor({emojis:e,showVariants:t,preview:o=!0,lazyLoader:i,category:s,fullHeight:r=!1}){super({template:Me,classes:Ve}),this.fullHeight=!1,this.showVariants=t,this.lazyLoader=i,this.preview=o,this.emojis=e,this.category=s,this.fullHeight=r,this.setFocus=this.setFocus.bind(this),this.triggerNextCategory=this.triggerNextCategory.bind(this),this.triggerPreviousCategory=this.triggerPreviousCategory.bind(this)}initialize(){this.grid=new Te(this.options.emojisPerRow,this.emojiCount,0,0,!this.category),this.grid.on("focus:change",this.setFocus),this.grid.on("focus:overflow",this.triggerNextCategory),this.grid.on("focus:underflow",this.triggerPreviousCategory),this.uiEvents=[oe.uiEvent("click",this.selectEmoji),oe.uiEvent("keydown",this.grid.handleKeyDown)],this.preview&&this.uiEvents.push(oe.uiEvent("mouseover",this.showPreview),oe.uiEvent("mouseout",this.hidePreview),oe.uiEvent("focus",this.showPreview,{capture:!0}),oe.uiEvent("blur",this.hidePreview,{capture:!0})),super.initialize()}setFocusedView(e,t){if(e)if("string"==typeof e){const t=this.emojis.findIndex((t=>t.emoji===e));this.grid.setFocusedIndex(t,!1),setTimeout((()=>{var e,o,i,s;const r=this.emojiViews[t].el;r.scrollIntoView();const a=null==(e=r.parentElement)?void 0:e.previousElementSibling;(null==(i=null==(o=r.parentElement)?void 0:o.parentElement)?void 0:i.parentElement).scrollTop-=null!=(s=null==a?void 0:a.offsetHeight)?s:0}))}else"first"===e.row||0===e.row?this.grid.setCell(0,e.offset,t):"last"===e.row&&this.grid.setCell(this.grid.getRowCount()-1,e.offset,t)}setActive(e,t,o){var i;e?this.setFocusedView(t,o):null==(i=this.emojiViews[this.grid.getIndex()])||i.deactivateFocus()}renderSync(){return this.emojiViews=this.emojis.map((e=>this.viewFactory.create(Ie,{emoji:e,category:this.category,lazyLoader:this.lazyLoader,renderer:this.renderer}))),this.emojiElements=this.emojiViews.map((e=>e.renderSync())),super.renderSync({emojis:this.emojiElements,i18n:this.i18n})}destroy(){super.destroy(),this.emojiViews.forEach((e=>e.destroy())),this.grid.destroy()}triggerPreviousCategory(e){this.events.emit("category:previous",e)}triggerNextCategory(e){this.category&&this.events.emit("category:next",e)}setFocus({from:e,to:t,performFocus:o}){var i,s;null==(i=this.emojiViews[e])||i.deactivateFocus(),null==(s=this.emojiViews[t])||s.activateFocus(o)}selectEmoji(e){e.stopPropagation();const t=_(e,this.emojis);t&&this.events.emit("emoji:select",{emoji:t,showVariants:this.showVariants})}showPreview(e){const t=e.target.closest("button"),o=null==t?void 0:t.firstElementChild,i=_(e,this.emojis);i&&this.events.emit("preview:show",i,null==o?void 0:o.cloneNode(!0))}hidePreview(e){_(e,this.emojis)&&this.events.emit("preview:hide")}get emojiCount(){return this.emojis.length}}const De=new ne((({classes:e,category:t,pickerId:o,icon:i,i18n:s})=>`\n  <section class="${e.emojiCategory}" role="tabpanel" aria-labelledby="${o}-category-${t.key}">\n    <h3 data-category="${t.key}" class="${e.categoryName}">\n      <i data-icon="${i}"></i>\n      ${s.get(`categories.${t.key}`,t.message||t.key)}\n    </h3>\n    <div data-view="emojis" data-render="sync"></div>\n  </section>\n`));class Be extends Fe{constructor({category:e,showVariants:t,lazyLoader:o,emojiVersion:i}){super({category:e,showVariants:t,lazyLoader:o,template:De}),this.showVariants=t,this.lazyLoader=o,this.emojiVersion=i}initialize(){this.uiElements={...this.baseUIElements},super.initialize()}async render(){await this.emojiDataPromise;const e=await this.emojiData.getEmojis(this.category,this.emojiVersion);return this.emojiContainer=this.viewFactory.create(Re,{emojis:e,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),super.render({category:this.category,emojis:this.emojiContainer,emojiCount:e.length,icon:se[this.category.key]})}}class Ne extends Re{constructor({category:e,emojis:t,preview:o=!0,lazyLoader:i}){super({category:e,emojis:t,showVariants:!1,preview:o,lazyLoader:i})}async addOrUpdate(e){const t=this.el.querySelector(`[data-emoji="${e.emoji}"]`);t&&(this.el.removeChild(t),this.emojis=this.emojis.filter((t=>t!==e)));const o=this.viewFactory.create(Ie,{emoji:e});
8171if(this.el.insertBefore(o.renderSync(),this.el.firstChild),this.emojis=[e,...this.emojis.filter((t=>t!==e))],this.emojis.length>this.options.maxRecents){this.emojis=this.emojis.slice(0,this.options.maxRecents);const e=this.el.childElementCount-this.options.maxRecents;for(let t=0;t<e;t++)this.el.lastElementChild&&this.el.removeChild(this.el.lastElementChild)}}}const He=new ne((({emojiCount:e,classes:t,category:o,pickerId:i,icon:s,i18n:r})=>`\n  <section class="${t.emojiCategory}" role="tabpanel" aria-labelledby="${i}-category-${o.key}">\n    <h3 data-category="${o.key}" class="${t.categoryName}">\n      <i data-icon="${s}"></i>\n      ${r.get(`categories.${o.key}`,o.message||o.key)}\n    </h3>\n    <div data-empty="${0===e}" class="${t.recentEmojis}">\n      <div data-view="emojis" data-render="sync"></div>\n    </div>\n    <div class="${t.noRecents}">\n      ${r.get("recents.none")}\n    </div>\n  </section>\n`),{mode:"async"});const Oe=new ne((({classes:e,category:t,pickerId:o,icon:i,i18n:s})=>`\n  <section class="${e.emojiCategory}" role="tabpanel" aria-labelledby="${o}-category-${t.key}">\n    <h3 data-category="${t.key}" class="${e.categoryName}">\n      <i data-icon="${i}"></i>\n      ${s.get(`categories.${t.key}`,t.message||t.key)}\n    </h3>\n    <div data-view="emojis" data-render="sync"></div>\n  </section>\n`));class Ke{constructor(){this.elements=new Map}lazyLoad(e,t){return this.elements.set(e,t),e}observe(e){if(window.IntersectionObserver){const t=new IntersectionObserver((e=>{e.filter((e=>e.intersectionRatio>0)).map((e=>e.target)).forEach((e=>{const o=this.elements.get(e);null==o||o(),t.unobserve(e)}))}),{root:e});this.elements.forEach(((e,o)=>{t.observe(o)}))}else this.elements.forEach((e=>{e()}))}}const Ue=$("emojiArea"),We=new ne((({classes:e})=>`\n  <div class="${e.emojiArea}">\n    <div data-placeholder="emojis"></div>\n  </div>\n`),{mode:"async"}),qe={recents:class extends Fe{constructor({category:e,lazyLoader:t,provider:o}){super({category:e,showVariants:!1,lazyLoader:t,template:He}),this.provider=o}initialize(){this.uiElements={...this.baseUIElements,recents:oe.byClass(Le.recentEmojis)},this.appEvents={"recent:add":this.addRecent},super.initialize()}async addRecent(e){await this.emojiContainer.addOrUpdate(e),this.ui.recents.dataset.empty="false"}async render(){var e;const t=null==(e=this.provider)?void 0:e.getRecents(this.options.maxRecents);return this.emojiContainer=this.viewFactory.create(Ne,{emojis:t,showVariants:!1,lazyLoader:this.lazyLoader,category:this.category.key}),await super.render({category:this.category,emojis:this.emojiContainer,emojiCount:t.length,icon:se[this.category.key]}),this.el}},custom:class extends Fe{constructor({category:e,lazyLoader:t}){super({template:Oe,showVariants:!1,lazyLoader:t,category:e})}initialize(){this.uiElements={...this.baseUIElements},super.initialize()}async render(){return this.emojiContainer=this.viewFactory.create(Re,{emojis:this.customEmojis,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),super.render({category:this.category,emojis:this.emojiContainer,emojiCount:this.customEmojis.length,icon:se[this.category.key]})}}};class Ge extends oe{constructor({categoryTabs:e,categories:t,emojiVersion:o}){super({template:We,classes:Ue}),this.selectedCategory=0,this.scrollListenerState="active",this.lazyLoader=new Ke,this.categoryTabs=e,this.categories=t,this.emojiVersion=o,this.handleScroll=S(this.handleScroll.bind(this),100)}initialize(){this.appEvents={"category:select":this.handleCategorySelect,"category:previous":this.focusPreviousCategory,"category:next":this.focusNextCategory,"focus:change":this.updateFocusedCategory},this.uiElements={emojis:oe.byClass(Ue.emojiArea)},this.uiEvents=[oe.uiEvent("scroll",this.handleScroll)],super.initialize()}get focusableEmoji(){return this.el.querySelector('[tabindex="0"]')}async render(){this.emojiCategories=this.categories.map(this.createCategory,this);const e={};return this.categories.forEach(((t,o)=>{e[`emojis-${t.key}`]=this.emojiCategories[o]})),await super.render({emojis:await Promise.all(this.emojiCategories.map((e=>e.render())))}),this.lazyLoader.observe(this.el),this.el}
8171destroy(){super.destroy(),this.emojiCategories.forEach((e=>{var t;null==(t=this.observer)||t.unobserve(e.el),e.destroy()}))}handleCategorySelect(e,t){this.el.style.overflow="hidden",this.selectCategory(e,t),this.el.style.overflow="auto"}createCategory(e){const t=qe[e.key]||Be;return this.viewFactory.create(t,{category:e,showVariants:!0,lazyLoader:this.lazyLoader,emojiVersion:this.emojiVersion,provider:this.options.recentsProvider})}determineInitialCategory(){var e;return this.options.initialCategory&&this.categories.find((e=>e.key===this.options.initialCategory))?this.options.initialCategory:null==(e=this.categories.find((e=>"recents"!==e.key)))?void 0:e.key}determineFocusTarget(e){const t=this.emojiCategories.find((t=>t.category.key===e));return this.options.initialEmoji&&(null==t?void 0:t.el.querySelector(`[data-emoji="${this.options.initialEmoji}"]`))?this.options.initialEmoji:"button"}reset(e=!0){this.events.emit("preview:hide");const t=this.determineInitialCategory();t&&(this.selectCategory(t,{focus:this.determineFocusTarget(t),performFocus:e,scroll:"jump"}),this.selectedCategory=this.getCategoryIndex(t))}getCategoryIndex(e){return this.categories.findIndex((t=>t.key===e))}focusPreviousCategory(e){this.selectedCategory>0&&this.focusCategory(this.selectedCategory-1,{row:"last",offset:null!=e?e:this.options.emojisPerRow})}focusNextCategory(e){this.selectedCategory<this.categories.length-1&&this.focusCategory(this.selectedCategory+1,{row:"first",offset:null!=e?e:0})}focusCategory(e,t){this.selectCategory(e,{focus:t,performFocus:!0})}async selectCategory(e,t={}){var o;this.scrollListenerState="suspend";const{focus:i,performFocus:s,scroll:r}={performFocus:!1,...t};this.emojiCategories[this.selectedCategory].setActive(!1);const a=this.selectedCategory="number"==typeof e?e:this.getCategoryIndex(e);null==(o=this.categoryTabs)||o.setActiveTab(this.selectedCategory,{performFocus:s,scroll:"button"===i});const n=this.emojiCategories[a].el.offsetTop;var c;this.emojiCategories[a].setActive(!0,(c=i)&&"button"!==c?c:{row:"first",offset:0},"button"!==i&&s),r&&(this.el.scrollTop=n),this.scrollListenerState="resume"}updateFocusedCategory(e){var t;this.categories[this.selectedCategory].key!==e&&(this.scrollListenerState="suspend",this.selectedCategory=this.getCategoryIndex(e),null==(t=this.categoryTabs)||t.setActiveTab(this.selectedCategory,{changeFocusable:!1,performFocus:!1}),this.scrollListenerState="resume")}handleScroll(){if("suspend"===this.scrollListenerState||!this.categoryTabs)return;if("resume"===this.scrollListenerState)return void(this.scrollListenerState="active");const e=this.el.scrollTop,t=this.el.scrollHeight-this.el.offsetHeight,o=this.emojiCategories.findIndex(((t,o)=>{var i;return e<(null==(i=this.emojiCategories[o+1])?void 0:i.el.offsetTop)})),i={changeFocusable:!1,performFocus:!1,scroll:!1};0===e?this.categoryTabs.setActiveTab(0,i):Math.floor(e)===Math.floor(t)||o<0?this.categoryTabs.setActiveTab(this.categories.length-1,i):this.categoryTabs.setActiveTab(o,i)}}const Je=new ne((({classList:e,classes:t,icon:o,message:i})=>`\n<div class="${e}" role="alert">\n  <div class="${t.iconContainer}"><i data-size="10x" data-icon="${o}"></i></div>\n  <h3 class="${t.title}">${i}</h3>\n</div>\n`)),Ze=$("error","iconContainer","title");class Ye extends oe{constructor({message:e,icon:t="warning",template:o=Je,className:i}){super({template:o,classes:Ze}),this.message=e,this.icon=t,this.className=i}renderSync(){const e=[Ze.error,this.className].join(" ").trim();return super.renderSync({message:this.message,icon:this.icon,classList:e})}}const Qe=new ne((({classList:e,classes:t,icon:o,i18n:i,message:s})=>`\n  <div class="${e}" role="alert">\n    <div class="${t.icon}"><i data-size="10x" data-icon="${o}"></i></div>\n    <h3 class="${t.title}">${s}</h3>\n    <button type="button">${i.get("retry")}</button>\n  </div>\n`)),Xe=$("dataError");class et extends Ye{constructor({message:e}){super({message:e,template:Qe,className:Xe.dataError})}initialize(){this.uiElements={retryButton:"button"},this.uiEvents=[oe.childEvent("retryButton","click",this.onRetry)],super.initialize()}async onRetry(){this.emojiData?await this.emojiData.delete():await this.options.dataStore.deleteDatabase(this.options.locale),this.events.emit("reinitialize");const e=await Y(this.options.locale,this.options.dataStore,this.options.messages,this.options.emojiData,this.emojiData);this.viewFactory.setEmojiData(e),this.events.emit("data:ready",e)}}const tt=$("preview","previewEmoji","previewName","tagList","tag"),ot=new ne((({classes:e,tag:t})=>`\n  <li class="${e.tag}">${t}</li>\n`)),it=new ne((({classes:e})=>`\n  <div class="${e.preview}">\n    <div class="${e.previewEmoji}"></div>\n    <div class="${e.previewName}"></div>\n    <ul class="${e.tagList}"></ul>\n  </div>\n`));class st extends oe{constructor(){super({template:it,classes:tt})}initialize(){this.uiElements={emoji:oe.byClass(tt.previewEmoji),name:oe.byClass(tt.previewName),tagList:oe.byClass(tt.tagList)},this.appEvents={"preview:show":this.showPreview,"preview:hide":this.hidePreview},super.initialize()}
8171showPreview(e,t){if(T(this.ui.emoji,t),this.ui.name.textContent=e.label,e.tags){this.ui.tagList.style.display="flex";const t=e.tags.map((e=>ot.renderSync({tag:e,classes:tt})));T(this.ui.tagList,...t)}}hidePreview(){I(this.ui.emoji),I(this.ui.name),I(this.ui.tagList)}}const rt=new ne((({classes:e,i18n:t})=>`\n  <button title="${t.get("search.clear")}" class="${e.clearSearchButton}">\n    <i data-icon="xmark"></i>\n  </button>\n`)),at=new ne((({classes:e,i18n:t})=>`\n<div class="${e.searchContainer}">\n  <input class="${e.searchField}" placeholder="${t.get("search")}">\n  <span class="${e.searchAccessory}"></span>\n</div>\n`),{mode:"async"}),nt=$("searchContainer","searchField","clearButton","searchAccessory","clearSearchButton","notFound");class ct extends oe{constructor({categories:e,emojiVersion:t}){super({template:at,classes:nt}),this.categories=e.filter((e=>"recents"!==e.key)),this.emojiVersion=t,this.search=z(this.search.bind(this),100)}initialize(){this.uiElements={searchField:oe.byClass(nt.searchField),searchAccessory:oe.byClass(nt.searchAccessory)},this.uiEvents=[oe.childEvent("searchField","keydown",this.onKeyDown),oe.childEvent("searchField","input",this.onSearchInput)],super.initialize()}async render(){return await super.render(),this.searchIcon=re("search"),this.notFoundMessage=this.viewFactory.create(Ye,{message:this.i18n.get("search.notFound"),className:nt.notFound,icon:"sad"}
8171),this.notFoundMessage.renderSync(),this.errorMessage=this.viewFactory.create(Ye,{message:this.i18n.get("search.error")}),this.errorMessage.renderSync(),this.clearSearchButton=rt.render({classes:nt,i18n:this.i18n}),this.clearSearchButton.addEventListener("click",(e=>this.onClearSearch(e))),this.searchField=this.ui.searchField,this.showSearchIcon(),this.el}showSearchIcon(){this.showSearchAccessory(this.searchIcon)}showClearSearchButton(){this.showSearchAccessory(this.clearSearchButton)}showSearchAccessory(e){T(this.ui.searchAccessory,e)}clear(){this.searchField.value="",this.showSearchIcon()}focus(){this.searchField.focus()}onClearSearch(e){var t;e.stopPropagation(),this.searchField.value="",null==(t=this.resultsContainer)||t.destroy(),this.resultsContainer=null,this.showSearchIcon(),this.events.emit("content:show"),this.searchField.focus()}handleResultsKeydown(e){this.resultsContainer&&"Escape"===e.key&&this.onClearSearch(e)}onKeyDown(e){var t;"Escape"===e.key&&this.searchField.value?this.onClearSearch(e):("Enter"===e.key||"ArrowDown"===e.key)&&this.resultsContainer&&(e.preventDefault(),null==(t=this.resultsContainer.el.querySelector('[tabindex="0"]'))||t.focus())}onSearchInput(e){this.searchField.value?(this.showClearSearchButton(),this.search()):this.onClearSearch(e)}async search(){var e;if(this.searchField.value)try{const t=await this.emojiData.searchEmojis(this.searchField.value,this.customEmojis,this.emojiVersion,this.categories);if(this.events.emit("preview:hide"),t.length){const o=new Ke;this.resultsContainer=this.viewFactory.create(Re,{emojis:t,fullHeight:!0,showVariants:!0,lazyLoader:o}),this.resultsContainer.renderSync(),null!=(e=this.resultsContainer)&&e.el&&(o.observe(this.resultsContainer.el),this.resultsContainer.setActive(!0,{row:0,offset:0},!1),this.resultsContainer.el.addEventListener("keydown",(e=>this.handleResultsKeydown(e))),this.events.emit("content:show",this.resultsContainer))}else this.events.emit("content:show",this.notFoundMessage)}catch{this.events.emit("content:show",this.errorMessage)}}}const lt=new ne((({classes:e})=>`\n  <div class="${e.variantOverlay}">\n    <div class="${e.variantPopup}">\n      <div data-view="emojis" data-render="sync"></div>\n    </div>\n  </div>\n`)),ht=$("variantOverlay","variantPopup"),dt={easing:"ease-in-out",duration:250,fill:"both"},mt={opacity:[0,1]},ut={opacity:[0,1],transform:["scale3d(0.8, 0.8, 0.8)","scale3d(1, 1, 1)"]};class pt extends oe{constructor({emoji:e,parent:t}){super({template:lt,classes:ht,parent:t}),this.focusedEmojiIndex=0,this.focusTrap=new Q,this.animateShow=()=>Promise.all([P(this.el,mt,dt,this.options),P(this.ui.popup,ut,dt,this.options)]),this.emoji=e}initialize(){this.uiElements={popup:oe.byClass(ht.variantPopup)},this.uiEvents=[oe.uiEvent("click",this.handleClick),oe.uiEvent("keydown",this.handleKeydown)],super.initialize()}animateHide(){const e={...dt,direction:"reverse"};return Promise.all([P(this.el,mt,e,this.options),P(this.ui.popup,ut,e,this.options)])}async hide(){await this.animateHide(),this.events.emit("variantPopup:hide")}handleKeydown(e){"Escape"===e.key&&(this.hide(),e.stopPropagation())}handleClick(e){this.ui.popup.contains(e.target)||this.hide()}getEmoji(e){return this.renderedEmojis[e]}setFocusedEmoji(e){this.getEmoji(this.focusedEmojiIndex).tabIndex=-1,this.focusedEmojiIndex=e;const t=this.getEmoji(this.focusedEmojiIndex);t.tabIndex=0,t.focus()}destroy(){this.emojiContainer.destroy(),this.focusTrap.deactivate(),super.destroy()}renderSync(){const e=[{...this.emoji,skins:null},...(this.emoji.skins||[]).map((e=>({...e,label:this.emoji.label,tags:this.emoji.tags})))];return this.emojiContainer=this.viewFactory.create(Re,{emojis:e,preview:!1}),super.renderSync({emojis:this.emojiContainer}),e.length<this.options.emojisPerRow&&this.el.style.setProperty("--emojis-per-row",e.length.toString()),this.el}activate(){this.emojiContainer.setActive(!0,{row:0,offset:0},!0),this.focusTrap.activate(this.el)}}const gt=new ne((({classes:e,i18n:t,category:o,pickerId:i,icon:s})=>`\n<li class="${e.categoryTab}">\n  <button\n    aria-selected="false"\n    role="tab"\n    class="${e.categoryButton}"\n    tabindex="-1"\n    title="${t.get(`categories.${o.key}`,o.message||o.key)}"\n    type="button"\n    data-category="${o.key}"\n    id="${i}-category-${o.key}"\n  >\n    <i data-icon="${s}"></i>\n</li>\n`)),yt=$("categoryTab","categoryTabActive","categoryButton");class vt extends oe{constructor({category:e,icon:t}){super({template:gt,classes:yt}),this.isActive=!1,this.category=e,this.icon=t}initialize(){this.uiElements={button:oe.byClass(yt.categoryButton)},this.uiEvents=[oe.childEvent("button","click",this.selectCategory),oe.childEvent("button","focus",this.selectCategory)],super.initialize()}renderSync(){return super.renderSync({category:this.category,icon:this.icon}),this.ui.button.ariaSelected="false",this.el}setActive(e,t={}){const{changeFocusable:o,performFocus:i,scroll:s}={changeFocusable:!0,performFocus:!0,scroll:!0,...t};this.el.classList.toggle(yt.categoryTabActive,e),o&&(this.ui.button.tabIndex=e?0:-1,this.ui.button.ariaSelected=e.toString()),e&&i&&(this.ui.button.focus(),s&&this.events.emit("category:select",this.category.key,{scroll:"animate",focus:"button",performFocus:!1})),this.isActive=e}selectCategory(){this.isActive||this.events.emit("category:select",this.category.key,{scroll:"animate",focus:"button",performFocus:!0})}}const ft=new ne((({classes:e})=>`\n  <div class="${e.categoryButtonsContainer}">\n    <ul role="tablist" class="${e.categoryButtons}">\n      <div data-placeholder="tabs"></div>\n    </ul>\n  </div>\n`)),wt=$("categoryButtons","categoryButtonsContainer");class bt extends oe{constructor({categories:e}){super({template:ft,classes:wt}),this.activeCategoryIndex=0,this.categories=e}initialize(){this.keyBindings={ArrowLeft:this.stepSelectedTab(-1),ArrowRight:this.stepSelectedTab(1)},this.uiEvents=[oe.uiEvent("scroll",this.checkOverflow)],super.initialize()}checkOverflow(){const e=Math.abs(this.el.scrollLeft-(this.el.scrollWidth-this.el.offsetWidth))>1,t=this.el.scrollLeft>0;
8171this.el.className="categoryButtonsContainer",t&&e?this.el.classList.add("has-overflow-both"):t?this.el.classList.add("has-overflow-left"):e&&this.el.classList.add("has-overflow-right")}renderSync(){return this.tabViews=this.categories.map((e=>this.viewFactory.create(vt,{category:e,icon:se[e.key]}))),super.renderSync({tabs:this.tabViews.map((e=>e.renderSync()))}),this.el}get currentCategory(){return this.categories[this.activeCategoryIndex]}get currentTabView(){return this.tabViews[this.activeCategoryIndex]}setActiveTab(e,t={}){this.checkOverflow();const o=this.currentTabView,i=this.tabViews[e];o.setActive(!1,t),i.setActive(!0,t),this.activeCategoryIndex=e}getTargetCategory(e){return e<0?this.categories.length-1:e>=this.categories.length?0:e}stepSelectedTab(e){return()=>{const t=this.activeCategoryIndex+e;this.setActiveTab(this.getTargetCategory(t),{changeFocusable:!0,performFocus:!0})}}}const jt=[{version:15,emoji:String.fromCodePoint(129768)},{version:14,emoji:String.fromCodePoint(128733)},{version:13,emoji:String.fromCodePoint(129729)},{version:12,emoji:String.fromCodePoint(129449)},{version:11,emoji:String.fromCodePoint(129463)},{version:5,emoji:String.fromCodePoint(129322)},{version:4,emoji:String.fromCodePoint(9877)},{version:3,emoji:String.fromCodePoint(129314)},{version:2,emoji:String.fromCodePoint(128488)},{version:1,emoji:String.fromCodePoint(128512)}];function Ct(){var e;const t=jt.find((e=>function(e){const t=document.createElement("canvas").getContext("2d");if(t)return t.textBaseline="top",t.font="32px Arial",t.fillText(e,0,0),0!==t.getImageData(16,16,1,1).data[0]}(e.emoji)));return null!=(e=null==t?void 0:t.version)?e:1}function kt(e,t){return Array.from({length:e},(()=>t)).join("")}function _t(e){const{emojiCount:t,classes:o,theme:i,className:s,categoryCount:r}=e;return`\n    <div class="picmo__picker ${o.skeleton} ${o.picker} ${i} ${s}">\n      ${(({showHeader:t,classes:o})=>t?`\n    <header class="${o.headerSkeleton}">\n      ${(({showSearch:e,classes:t})=>e?`\n    <div class="${t.searchSkeleton}">\n      <div class="${t.searchInput} ${t.placeholder}"></div>\n    </div>\n  `:"")(e)}\n      ${(({showCategoryTabs:e,classes:t})=>e?`\n    <div class="${t.categoryTabsSkeleton}">\n      ${kt(r,`<div class="${t.placeholder} ${t.categoryTab}"></div>`)}\n    </div>\n  `:"")(e)}\n    </header>\n  `:"")(e)}\n      <div class="${o.contentSkeleton}">\n        <div class="${o.placeholder} ${o.categoryName}"></div>\n        <div class="${o.emojiGrid}">\n          ${kt(t,`<div class="${o.placeholder} ${o.emoji}"></div>`)}\n        </div>\n      </div>\n      ${(({showPreview:e,classes:t})=>e?`\n    <div class="${t.previewSkeleton}">\n      <div class="${t.placeholder} ${t.previewEmoji}"></div>\n      <div class="${t.placeholder} ${t.previewName}"></div>\n      <ul class="${t.tagList}">\n        ${kt(3,`<li class="${t.placeholder} ${t.tag}"></li>`)}\n      </ul>\n    </div>\n  `:"")(e)}\n    </div>\n  `}const xt=new ne((e=>e.isLoaded?function(e){const{classes:t,theme:o,className:i=""}=e;return`\n    <div class="picmo__picker ${t.picker} ${o} ${i}">\n      ${function({showHeader:e,classes:t}){return e?`\n    <header class="${t.header}">\n      <div data-view="search"></div>\n      <div data-view="categoryTabs" data-render="sync"></div>\n    </header>\n  `:""}(e)}\n      <div class="${t.content}">\n        <div data-view="emojiArea"></div>\n      </div>\n      <div data-view="preview"></div>\n    </div>\n  `}(e):_t(e))),Et=$("picker","skeleton","placeholder","searchSkeleton","searchInput","categoryTabsSkeleton","headerSkeleton","categoryTab","contentSkeleton","categoryName","emojiGrid","emoji","previewSkeleton","previewEmoji","previewName","tagList","tag","overlay","content","fullHeight","pluginContainer","header"),St={emojisPerRow:"--emojis-per-row",visibleRows:"--row-count",emojiSize:"--emoji-size"};class zt extends oe{constructor(){super({template:xt,classes:Et}),this.pickerReady=!1,this.externalEvents=new Pe,this.updaters={styleProperty:e=>t=>this.el.style.setProperty(St[e],t.toString()),theme:e=>{const t=this.options.theme,o=this.el.closest(`.${t}`);this.el.classList.remove(t),null==o||o.classList.remove(t),this.el.classList.add(e),null==o||o.classList.add(e)},className:e=>{this.options.className&&this.el.classList.remove(this.options.className),this.el.classList.add(e)},emojisPerRow:this.updateStyleProperty.bind(this,"emojisPerRow"),emojiSize:this.updateStyleProperty.bind(this,"emojiSize"),visibleRows:this.updateStyleProperty.bind(this,"visibleRows")}}initialize(){this.uiElements={pickerContent:oe.byClass(Et.content),header:oe.byClass(Et.header)},this.uiEvents=[oe.uiEvent("keydown",this.handleKeyDown)],this.appEvents={error:this.onError,reinitialize:this.reinitialize,"data:ready":this.onDataReady,"content:show":this.showContent,"variantPopup:hide":this.hideVariantPopup,"emoji:select":this.selectEmoji},super.initialize(),this.options.recentsProvider}destroy(){var e,t;super.destroy(),null==(e=this.search)||e.destroy(),this.emojiArea.destroy(),null==(t=this.categoryTabs)||t.destroy(),this.events.removeAll(),this.externalEvents.removeAll()}clearRecents(){this.options.recentsProvider.clear()}addEventListener(e,t){this.externalEvents.on(e,t)}removeEventListener(e,t){this.externalEvents.off(e,t)}initializePickerView(){this.pickerReady&&(this.showContent(),this.emojiArea.reset(!1))}handleKeyDown(e){const t=e.ctrlKey||e.metaKey;"s"===e.key&&t&&this.search&&(e.preventDefault(),this.search.focus())}buildChildViews(){return this.options.showPreview&&(this.preview=this.viewFactory.create(st)),this.options.showSearch&&(this.search=this.viewFactory.create(ct,{categories:this.categories,emojiVersion:this.emojiVersion})),this.options.showCategoryTabs&&(this.categoryTabs=this.viewFactory.create(bt,{categories:this.categories})),this.currentView=this.emojiArea=this.viewFactory.create(Ge,{categoryTabs:this.categoryTabs,categories:this.categories,emojiVersion:this.emojiVersion}),[this.preview,this.search,this.emojiArea,this.categoryTabs]}setStyleProperties(){this.options.showSearch||this.el.style.setProperty("--search-height-full","0p
8171x"),this.options.showCategoryTabs||(this.el.style.setProperty("--category-tabs-height","0px"),this.el.style.setProperty("--category-tabs-offset","0px")),this.options.showPreview||this.el.style.setProperty("--emoji-preview-height-full","0px"),Object.keys(St).forEach((e=>{this.options[e]&&this.el.style.setProperty(St[e],this.options[e].toString())}))}updateStyleProperty(e,t){this.el.style.setProperty(St[e],t.toString())}reinitialize(){this.renderSync()}onError(e){const t=this.viewFactory.createWithOptions({data:!1},et,{message:this.i18n.get("error.load")}),o=this.el.offsetHeight||375;throw this.el.style.height=`${o}px`,T(this.el,t.renderSync()),e}async onDataReady(e){const t=this.el;try{e?this.emojiData=e:await this.emojiDataPromise,"auto"===this.options.emojiVersion?this.emojiVersion=Ct()||parseFloat("14.0"):this.emojiVersion=this.options.emojiVersion,this.categories=await this.emojiData.getCategories(this.options);const[o,i,s,r]=this.buildChildViews();await super.render({isLoaded:!0,search:i,categoryTabs:r,emojiArea:s,preview:o,showHeader:Boolean(this.search||this.categoryTabs),theme:this.options.theme,className:this.options.className}),this.el.style.setProperty("--category-count",this.categories.length.toString()),this.pickerReady=!0,t.replaceWith(this.el),this.setStyleProperties(),this.initializePickerView(),this.setInitialFocus(),this.externalEvents.emit("data:ready")}catch(e){this.events.emit("error",e)}}renderSync(){var e;let t=(null==(e=this.options.categories)?void 0:e.length)||10;if(this.options.showRecents&&(t+=1),super.renderSync({isLoaded:!1,theme:this.options.theme,className:this.options.className,showSearch:this.options.showSearch,showPreview:this.options.showPreview,showCategoryTabs:this.options.showCategoryTabs,showHeader:this.options.showSearch||this.options.showCategoryTabs,emojiCount:this.options.emojisPerRow*this.options.visibleRows,categoryCount:t}),this.el.style.setProperty("--category-count",t.toString()),!this.options.rootElement)throw new Error("Picker must be given a root element via the rootElement option");return T(this.options.rootElement,this.el),this.setStyleProperties(),this.pickerReady&&this.initializePickerView(),this.el}getInitialFocusTarget(){if(typeof this.options.autoFocus<"u")switch(this.options.autoFocus){case"emojis":return this.emojiArea.focusableEmoji;case"search":return this.search;case"auto":return this.search||this.emojiArea.focusableEmoji;default:return null}if(!0===this.options.autoFocusSearch)return console.warn("options.autoFocusSearch is deprecated, please use options.focusTarget instead"),this.search}setInitialFocus(){var e;!this.pickerReady||null==(e=this.getInitialFocusTarget())||e.focus()}reset(e=!0){var t;this.pickerReady&&(this.emojiArea.reset(e),this.showContent(this.emojiArea)),null==(t=this.search)||t.clear(),this.hideVariantPopup()}showContent(e=this.emojiArea){var t,o;e!==this.currentView&&(this.currentView!==this.emojiArea&&(null==(t=this.currentView)||t.destroy()),this.ui.pickerContent.classList.toggle(Et.fullHeight,e!==this.emojiArea),T(this.ui.pickerContent,e.el),this.currentView=e,e===this.emojiArea?(this.emojiArea.reset(),this.categoryTabs&&this.ui.header.appendChild(this.categoryTabs.el)):null==(o=this.categoryTabs)||o.el.remove())}hideVariantPopup(){var e;null==(e=this.variantPopup)||e.destroy()}isPickerClick(e){var t,o;const i=e.target,s=this.el.contains(i),r=null==(o=null==(t=this.variantPopup)?void 0:t.el)?void 0:o.contains(i);return s||r}async selectEmoji({emoji:e}){var t,o;(null==(t=e.skins)?void 0:t.length)&&this.options.showVariants&&!this.isVariantPopupOpen?this.showVariantPopup(e):(await(null==(o=this.variantPopup)?void 0:o.animateHide()),this.events.emit("variantPopup:hide"),await this.emitEmoji(e))}get isVariantPopupOpen(){return this.variantPopup&&!this.variantPopup.isDestroyed}async showVariantPopup(e){const t=document.activeElement;this.events.once("variantPopup:hide",(()=>{null==t||t.focus()})),this.variantPopup=this.viewFactory.create(pt,{emoji:e,parent:this.el}),this.el.appendChild(this.variantPopup.renderSync()),this.variantPopup.activate()}async emitEmoji(e){this.externalEvents.emit("emoji:select",await this.renderer.doEmit(e)),this.options.recentsProvider.addOrUpdateRecent(e,this.options.maxRecents),this.events.emit("recent:add",e)}updateOptions(e){Object.keys(e).forEach((t=>{this.updaters[t](e[t])})),Object.assign(this.options,e)}}class Pt{constructor({events:e,i18n:t,renderer:o,emojiData:i,options:s,customEmojis:r=[],pickerId:a}){this.events=e,this.i18n=t,this.renderer=o,this.emojiData=i,this.options=s,this.customEmojis=r,this.pickerId=a}
8171setEmojiData(e){this.emojiData=Promise.resolve(e)}createWithOptions(e={},t,...o){const i=new t(...o);return i.setPickerId(this.pickerId),i.setEvents(this.events),i.setI18n(this.i18n),i.setRenderer(this.renderer),!1!==e.data&&i.setEmojiData(this.emojiData),i.setOptions(this.options),i.setCustomEmojis(this.customEmojis),i.viewFactory=this,i.initialize(),i}create(e,...t){return this.createWithOptions({},e,...t)}}class Lt{constructor(e={}){b(this,p,void 0),J(this,p,new Map(Object.entries(e)))}get(e,t=e){return w(this,p).get(e)||t}}function Ft(){let e=!1;return function(t){Se.injectStyles&&!e&&(function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===o&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}(t),e=!0)}}p=new WeakMap;let $t,At=0;const It=Ft();const Tt=Object.freeze(Object.defineProperty({__proto__:null,de:{"categories.activities":"Aktivitäten","categories.animals-nature":"Tiere & Natur","categories.custom":"Benutzerdefiniert","categories.flags":"Flaggen","categories.food-drink":"Essen & Trinken","categories.objects":"Gegenstände","categories.people-body":"Mensch & Körper","categories.recents":"Zuletzt genutzt","categories.smileys-emotion":"Smileys & Emotionen","categories.symbols":"Symbole","categories.travel-places":"Reisen & Orte","error.load":"Emojis wurden nicht geladen","recents.clear":"Zuletzt genutzte Emojis löschen","recents.none":"Kein Emoji ausgewählt.",retry:"Erneut versuchen","search.clear":"Suche löschen","search.error":"Suche erfolglos","search.notFound":"Kein Emoji gefunden",search:"Emojis durchsuchen ..."},en:ge,fi:{"categories.activities":"Aktiviteetit","categories.animals-nature":"Eläimet & luonto","categories.custom":"Mukautettu","categories.flags":"Liput","categories.food-drink":"Ruoka & juoma","categories.objects":"Esineet","categories.people-body":"Ihmiset & keho","categories.recents":"Viimeksi käytetty","categories.smileys-emotion":"Hymiöt & tunne","categories.symbols":"Symbolit","categories.travel-places":"Matkustus & paikat","error.load":"Emojie
8171n lataaminen epäonnistui","recents.clear":"Tyhjennä viimeksi käytetyt emojit","recents.none":"Et ole valinnut vielä emojia.",retry:"Kokeile uudestaan","search.clear":"Tyhjennä haku","search.error":"Emojien etsiminen epäonnistui","search.notFound":"Emojia ei löytynyt",search:"Etsi emojia..."},fr:{"categories.activities":"Activités","categories.animals-nature":"Animaux et nature","categories.custom":"Personnalisé","categories.flags":"Drapeaux","categories.food-drink":"Nourriture et boissons","categories.objects":"Objets","categories.people-body":"Personnes et corps","categories.recents":"Récemment utilisé","categories.smileys-emotion":"Visages et émotions","categories.symbols":"Symboles","categories.travel-places":"Voyages et lieux","error.load":"Échec du chargement des émojis","recents.clear":"Effacez les émojis récents","recents.none":"Vous n'avez pas encore sélectionné d'émojis.",retry:"Essayez à nouveau","search.clear":"Effacer la recherche","search.error":"Échec de la recherche d'émojis","search.notFound":"Aucun émoji trouvé",search:"Rechercher des émojis..."},nl:{"categories.activities":"Activiteiten","categories.animals-nature":"Dieren & Natuur","categories.custom":"Aangepast","categories.flags":"Vlaggen","categories.food-drink":"Eten & Drinken","categories.objects":"Voorwerpen","categories.people-body":"Mens & Lichaam","categories.recents":"Laatst gebruikt","categories.smileys-emotion":"Smileys en emoties","categories.symbols":"Symbolen","categories.travel-places":"Reizen & Plaatsen","error.load":"Kan emoji's niet laden","recents.clear":"Wis recente emoji's","recents.none":"Geen emoji geselecteerd.",retry:"Probeer het nog eens","search.clear":"Zoekopdracht wissen","search.error":"Zoeken mislukt","search.notFound":"Geen emoji gevonden",search:"Zoek emoji..."},no:{"categories.activities":"Aktiviteter","categories.animals-nature":"Dyr & natur","categories.custom":"Tilpasset","categories.flags":"Flagg","categories.food-drink":"Mat & drikke","categories.objects":"Objekter","categories.people-body":"Mennesker & kropp","categories.recents":"Nylig brukte","categories.smileys-emotion":"Smilefjes & følelser","categories.symbols":"Symboler","categories.travel-places":"Reise & steder","error.load":"Klarte ikke laste inn emojis","recents.clear":"Fjern nylige emojis","recents.none":"Du har ikke valgt noen emojis enda.",retry:"Prøv igjen","search.clear":"Tøm søk","search.error":"Klarte ikke å søke etter emojis","search.notFound":"Ingen emojis funnet",search:"Søk etter emojis..."},sv:{"categories.activities":"Aktiviteter","categories.animals-nature":"Djur & natur","categories.custom":"Anpassad","categories.flags":"Flagga","categories.food-drink":"Mat & dryck","categories.objects":"Objekt","categories.people-body":"Människor & kropp","categories.recents":"Nyligen använd","categories.smileys-emotion":"Humör & känslor","categories.symbols":"Symboler","categories.travel-places":"Resor & platser","error.load":"Det gick inte att ladda emojis","recents.clear":"Ta bort de senaste emojis","recents.none":"Du har inte valt några emojis än",retry:"Försök igen","search.clear":"Tom sökning","search.error":"Det gick inte att söka efter emojis","search.notFound":"Inga emojis hittades",search:"Sök efter emojis..."}},Symbol.toStringTag,{value:"Module"}));e.EmojiPicker=zt,e.Events=Ee,e.FocusTrap=Q,e.InMemoryProvider=class extends be{constructor(){super(...arguments),this.recents=[]}clear(){this.recents=[]}getRecents(e){return this.recents.slice(0,e)}addOrUpdateRecent(e,t){this.recents=[e,...this.getRecents(t).filter((t=>t.hexcode!==e.hexcode))].slice(0,t)}},e.InMemoryStoreFactory=U,e.IndexedDbStoreFactory=ve,e.LocalStorageProvider=ke,e.NativeRenderer=pe,e.RecentsProvider=be,e.Renderer=me,e.SessionStorageProvider=class extends Ce{constructor(){super(V()?sessionStorage:we())}},e.animate=P,e.autoTheme=te,e.caseInsensitiveIncludes=E,e.computeHash=F,e.createDatabase=async function(e,t,o,i){(await Y(e,t,o,i)).close()},e.createPicker=function(e){It('.picmo__picker .picmo__icon{width:1.25em;height:1em;fill:currentColor}.picmo__icon-small{font-size:.8em}.picmo__icon-medium{font-size:1em}.picmo__icon-large{font-size:1.25em}.picmo__icon-2x{font-size:2em}.picmo__icon-3x{font-size:3em}.picmo__icon-4x{font-size:4em}.picmo__icon-5x{font-size:5em}.picmo__icon-8x{font-size:8em}.picmo__icon-10x{font-size:10em}.picmo__light,.picmo__auto{color-scheme:light;--accent-color: #4f46e5;--background-color: #f9fafb;--border-color: #cccccc;--category-name-background-color: #f9fafb;--category-name-button-color: #999999;--category-name-text-color: hsl(214, 30%, 50%);--category-tab-active-background-color: rgba(255, 255, 255, .6);--category-tab-active-color: var(--accent-color);--category-tab-color: #666;--category-tab-highlight-background-color: rgba(0, 0, 0, .15);--error-color-dark: hsl(0, 100%, 45%);--error-color: hsl(0, 100%, 40%);--focus-indicator-background-color: hsl(198, 65%, 85%);--focus-indicator-color: #333333;--hover-background-color: #c7d2fe;--placeholder-background-color: #cccccc;--search-background-color: #f9fafb;--search-focus-background-color: #ffffff;--search-icon-color: #999999;--search-placeholder-color: #71717a;--secondary-background-color: #e2e8f0;--secondary-text-color: #666666;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #000000;--variant-popup-background-color: #ffffff}.picmo__dark{color-scheme:dark;--accent-color: #A580F9;--background-color: #333333;--border-color: #666666;--category-name-background-color: #333333;--category-name-button-color: #eeeeee;--category-name-text-color: #ffffff;--category-tab-active-background-color: #000000;--category-tab-active-color: var(--accent-color);--category-tab-color: #cccccc;--category-tab-highlight-background-color: #4A4A4A;--error-color-dark: hsl(0, 7%, 3%);--error-color: hsl(0, 30%, 60%);--focus-indicator-background-color: hsl(0, 0%, 50%);--focus-indicator-color: #999999;--hover-background-color: hsla(0, 0%, 40%, .85);--image-placeholder-color: #ffffff;--placeholder-background-color: #666666;--search-background-color: #71717a;--search-focus-background-color: #52525b;--search-icon-color: #cccccc;--search-placeholder-color: #d4d4d8;--secondary-background-color: #000000;--secondary-text-color: #999999;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #ffffff;--variant-popup-background-color: #333333}@media (prefers-color-scheme: dark){.picmo__auto{color-scheme:dark;--accent-color: #A580F9;--background-color: #333333;--border-color: #666666;--category-name-background-color: #333333;--category-name-button-color: #eeeeee;--category-name-text-color: #ffffff;--category-tab-active-background-color: #000000;--category-tab-active-color: var(--accent-color);--category-tab-color: #cccccc;--category-tab-highlight-background-color: #4A4A4A;--error-color-dark: hsl(0, 7%, 3%);--error-color: hsl(0, 30%, 60%);--focus-indicator-background-color: hsl(0, 0%, 50%);--focus-indicator-color: #999999;--hover-background-color: hsla(0, 0%, 40%, .85);--image-placeholder-color: #ffffff;--placeholder-background-color: #666666;--search-background-color: #71717a;--search-focus-background-color: #52525b;--search-icon-color: #cccccc;--search-placeholder-color: #d4d4d8;--secondary-background-color: #000000;--secondary-text-color: #999999;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #ffffff;--variant-popup-background-color: #333333}}.picmo__picker .picmo__categoryButtonsContainer{overflow:auto;padding:2px 0}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-right{mask-image:linear-gradient(270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%);-webkit-mask-image:linear-gradient(270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%)}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-left{mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%);-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%)}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-both{mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%,rgba(255,255,255,1) 90%,rgba(255,255,255,0) 100%);-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%,rgba(255,255,255,1) 90%,rgba(255,255,255,0) 100%)}.picmo__picker .picmo__categoryButtons{display:flex;flex-direction:row;gap:var(--tab-gap);margin:0;padding:0 .5em;align-items:center;height:var(--category-tabs-height);box-sizing:border-box;width:100%;justify-content:space-between;position:relative;list-style-type:none;justify-self:center;max-width:min(23.55rem,calc(var(--category-count, 1) * 2.5rem))}.picmo__picker .picmo__categoryButtons .picmo__categoryTab{display:flex;align-items:center;transition:all .1s;
8171width:2em}.picmo__picker .picmo__categoryButtons .picmo__categoryTab.picmo__categoryTabActive .picmo__categoryButton{color:var(--category-tab-active-color);background:linear-gradient(rgba(255,255,255,.75) 0%,rgba(255,255,255,.75) 100%),linear-gradient(var(--category-tab-active-color) 0%,var(--category-tab-active-color) 100%);border:2px solid var(--category-tab-active-color)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab.picmo__categoryTabActive .picmo__categoryButton:hover{background-color:var(--category-tab-active-background-color)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton{border-radius:5px;background:transparent;border:2px solid transparent;color:var(--category-tab-color);cursor:pointer;padding:2px;vertical-align:middle;display:flex;align-items:center;justify-content:center;font-size:1.2rem;width:1.6em;height:1.6em;transition:all .1s}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton:is(img){width:var(--category-tab-size);height:var(--category-tab-size)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton:hover{background:var(--category-tab-highlight-background-color)}.picmo__dataError [data-icon]{opacity:.8}@keyframes appear{0%{opacity:0}to{opacity:.8}}@keyframes appear-grow{0%{opacity:0;transform:scale(.8)}to{opacity:.8;transform:scale(1)}}.picmo__picker .picmo__error{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--secondary-text-color)}.picmo__picker .picmo__error .picmo__iconContainer{opacity:.8;animation:appear-grow .25s cubic-bezier(.175,.885,.32,1.275);--color-primary: var(--error-color);--color-secondary: var(--error-color-dark)}.picmo__picker .picmo__error .picmo__title{animation:appear .25s;animation-delay:50ms;animation-fill-mode:both}.picmo__picker .picmo__error button{padding:8px 16px;cursor:pointer;background:var(--background-color);border:1px solid var(--text-color);border-radius:5px;color:var(--text-color)}.picmo__picker .picmo__error button:hover{background:var(--text-color);color:var(--background-color)}.picmo__emojiButton{background:transparent;border:none;border-radius:15px;cursor:pointer;display:flex;font-family:var(--emoji-font);font-size:var(--emoji-size);height:100%;justify-content:center;align-items:center;margin:0;overflow:hidden;padding:0;width:100%}.picmo__emojiButton:hover{background:var(--hover-background-color)}.picmo__emojiButton:focus{border-radius:0;background:var(--focus-indicator-background-color);outline:1px solid var(--focus-indicator-color)}.picmo__picker .picmo__emojiArea{height:var(--emoji-area-height);overflow-y:auto;position:relative}.picmo__picker .picmo__emojiCategory{position:relative}.picmo__picker .picmo__emojiCategory .picmo__categoryName{font-size:.9em;padding:.5rem;margin:0;background:var(--category-name-background-color);color:var(--category-name-text-color);top:0;z-index:1;display:grid;gap:4px;grid-template-columns:auto 1fr auto;align-items:center;line-height:1;box-sizing:border-box;height:var(--category-name-height);justify-content:flex-start;text-transform:uppercase}.picmo__picker .picmo__emojiCategory .picmo__categoryName button{background:transparent;border:none;display:flex;align-items:center;cursor:pointer;color:var(--category-name-button-color)}.picmo__picker .picmo__emojiCategory .picmo__categoryName button:hover{opacity:1}.picmo__picker .picmo__emojiCategory .picmo__noRecents{color:var(--secondary-text-color);grid-column:1 / span var(--emojis-per-row);font-size:.9em;text-align:center;display:flex;align-items:center;justify-content:center;min-height:calc(var(--emoji-size) * var(--emoji-size-multiplier))}.picmo__picker .picmo__emojiCategory .picmo__recentEmojis[data-empty=true]{display:none}:is(.picmo__picker .picmo__emojiCategory) .picmo__recentEmojis[data-empty=false]+div{display:none}.picmo__picker .picmo__emojiContainer{display:grid;justify-content:space-between;gap:1px;padding:0 .5em;grid-template-columns:repeat(var(--emojis-per-row),calc(var(--emoji-size) * var(--emoji-size-multiplier)));grid-auto-rows:calc(var(--emoji-size) * var(--emoji-size-multiplier));align-items:center;justify-items:center}.picmo__picker.picmo__picker{--border-radius: 5px;--emoji-area-height: calc((var(--row-count) * var(--emoji-size) * var(--emoji-size-multiplier)) + var(--category-name-height)
vendor: 8,878 bytes, line 8171
8171);--content-height: var(--emoji-area-height);--emojis-per-row: 8;--row-count: 6;--emoji-preview-margin: 4px;--emoji-preview-height: calc(var(--emoji-preview-size) + 1em + 1px);--emoji-preview-height-full: calc(var(--emoji-preview-height) + var(--emoji-preview-margin));--emoji-preview-size: 2.75em;--emoji-size: 2rem;--emoji-size-multiplier: 1.3;--content-margin: 8px;--category-tabs-height:calc(1.5em + 9px);--category-tabs-offset: 8px;--category-tab-size: 1.2rem;--category-name-height: 2rem;--category-name-padding-y: 6px;--search-height: 2em;--search-margin: .5em;--search-margin-bottom: 4px;--search-height-full: calc(var(--search-height) + var(--search-margin) + var(--search-margin-bottom));--overlay-background-color: rgba(0, 0, 0, .8);--emoji-font: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji";--ui-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;--ui-font-size: 16px;--picker-width: calc(var(--emojis-per-row) * var(--emoji-size) * var(--emoji-size-multiplier) + 2.75rem);--preview-background-color: var(--secondary-background-color);background:var(--background-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-family:var(--ui-font);font-size:var(--ui-font-size);overflow:hidden;position:relative;width:var(--picker-width);display:grid;gap:8px}.picmo__picker.picmo__picker>*{font-family:var(--ui-font)}.picmo__picker.picmo__skeleton{background:var(--background-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-family:var(--ui-font);width:var(--picker-width);color:var(--secondary-text-color)}.picmo__picker.picmo__skeleton *{box-sizing:border-box}.picmo__picker.picmo__skeleton .picmo__placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo__picker.picmo__skeleton .picmo__placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0) 100%);animation:shine 2s infinite;content:""}.picmo__picker.picmo__skeleton .picmo__headerSkeleton{background-color:var(--secondary-background-color);padding-top:8px;padding-bottom:8px;display:flex;flex-direction:column;overflow:hidden;gap:8px;border-bottom:1px solid var(--border-color);width:var(--picker-width)}.picmo__picker.picmo__skeleton .picmo__searchSkeleton{padding:0 8px;height:var(--search-height)}.picmo__picker.picmo__skeleton .picmo__searchSkeleton .picmo__searchInput{width:100%;height:28px;border-radius:3px}.picmo__picker.picmo__skeleton .picmo__categoryTabsSkeleton{height:var(--category-tabs-height);display:flex;flex-direction:row;align-items:center;justify-self:center;width:calc(2rem * var(--category-count, 1))}.picmo__picker.picmo__skeleton .picmo__categoryTabsSkeleton .picmo__categoryTab{width:25px;height:25px;padding:2px;border-radius:5px;margin:.25em}.picmo__picker.picmo__skeleton .picmo__contentSkeleton{height:var(--content-height);padding-right:8px;opacity:.7}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__categoryName{width:50%;height:1rem;margin:.5rem;box-sizing:border-box}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__emojiGrid{display:grid;justify-content:space-between;gap:1px;padding:0 .5em;grid-template-columns:repeat(var(--emojis-per-row),calc(var(--emoji-size) * var(--emoji-size-multiplier)));grid-auto-rows:calc(var(--emoji-size) * var(--emoji-size-multiplier));align-items:center;justify-items:center;width:var(--picker-width)}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__emojiGrid .picmo__emoji{width:var(--emoji-size);height:var(--emoji-size);border-radius:50%}.picmo__picker.picmo__skeleton .picmo__previewSkeleton{height:var(--emoji-preview-height);border-top:1px solid var(--border-color);display:grid;align-items:center;padding:.5em;gap:6px;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"emoji name" "emoji tags"}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__previewEmoji{grid-area:emoji;border-radius:50%;width:var(--emoji-preview-size);height:var(--emoji-preview-size)}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__previewName{grid-area:name;height:.8em;width:80%}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__tagList .picmo__tag{border-radius:3px;padding:2px 8px;margin-right:.25em;height:1em;width:20%}.picmo__overlay{background:rgba(0,0,0,.75);height:100%;left:0;position:fixed;top:0;width:100%;z-index:1000}.picmo__content{position:relative;overflow:hidden;height:var(--content-height)}.picmo__content.picmo__fullHeight{height:calc(var(--content-height) + var(--category-tabs-height) + var(--category-tabs-offset));overflow-y:auto}.picmo__pluginContainer{margin:.5em;display:flex;flex-direction:row}.picmo__header{background-color:var(--secondary-background-color);padding-top:8px;padding-bottom:8px;display:grid;gap:8px;border-bottom:1px solid var(--border-color)}@media (prefers-reduced-motion: reduce){.picmo__placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo__placeholder:after{display:none}}.picmo__picker .picmo__preview{border-top:1px solid var(--border-color);display:grid;align-items:center;gap:6px;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"emoji name" "emoji tags";height:var(--emoji-preview-height);box-sizing:border-box;padding:.5em;position:relative;background:var(--preview-background-color)}.picmo__picker .picmo__preview .picmo__previewEmoji{grid-area:emoji;font-size:var(--emoji-preview-size);font-family:var(--emoji-font);width:1.25em;display:flex;align-items:center;justify-content:center}.picmo__picker .picmo__preview .picmo__previewName{grid-area:name;color:var(--text-color);font-size:.8em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}.picmo__picker .picmo__preview .picmo__tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0;font-size:.75em;overflow:hidden}.picmo__picker .picmo__preview .picmo__tag{border-radius:3px;background:var(--tag-background-color);color:var(--text-color);padding:2px 8px;margin-right:.25em;white-space:nowrap}.picmo__picker .picmo__preview .picmo__tag:last-child{margin-right:0}.picmo__picker .picmo__searchContainer{display:flex;height:var(--search-height);box-sizing:border-box;padding:0 8px;position:relative}.picmo__picker .picmo__searchContainer .picmo__searchField{background:var(--search-background-color);border-radius:3px;border:none;box-sizing:border-box;color:var(--text-color);font-size:.9em;outline:none;padding:.5em 2.25em .5em .5em;width:100%}.picmo__picker .picmo__searchContainer .picmo__searchField:focus{background:var(--search-focus-background-color)}.picmo__picker .picmo__searchContainer .picmo__searchField::placeholder{color:var(--search-placeholder-color)}.picmo__picker .picmo__searchContainer .picmo__searchAccessory{color:var(--search-icon-color);height:100%;position:absolute;right:1em;top:0;width:1.25rem;display:flex;align-items:center}.picmo__picker .picmo__searchContainer .picmo__searchAccessory svg{fill:var(--search-icon-color)}.picmo__picker .picmo__searchContainer .picmo__clearButton{border:0;color:var(--search-icon-color);background:transparent;cursor:pointer}.picmo__picker .picmo__searchContainer .picmo__clearSearchButton{cursor:pointer;border:none;background:transparent;color:var(--search-icon-color);font-size:1em;width:100%;height:100%;display:flex;align-items:center;padding:0}.picmo__picker .picmo__searchContainer .picmo__notFound [data-icon]{fill:#f3e265}.picmo__picker .picmo__variantOverlay{background:var(--overlay-background-color);border-radius:5px;display:flex;flex-direction:column;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.picmo__picker .picmo__variantOverlay .picmo__variantPopup{background:var(--variant-popup-background-color);border-radius:5px;margin:.5em;padding:.5em;text-align:center;user-select:none;display:flex;align-items:center;justify-content:center}.picmo__customEmoji{width:1em;height:1em}@keyframes shine{to{transform:translate(100%)}}.picmo__picker .picmo__imagePlaceholder{width:2rem;height:2rem;border-radius:50%}.picmo__placeholder{background:#DDDBDD;position:relative}.picmo__placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0) 100%);animation:shine 2s infinite;content:""}
vendor: 19,163 bytes, lines 8171-8172
8171\n');const t=xe(e),o=((null==t?void 0:t.custom)||[]).map((e=>({...e,custom:!0,tags:["custom",...e.tags||[]]}))),i=new ze;$t||($t=function(e){return Y(e.locale,e.dataStore,e.messages,e.emojiData)}(t));const s=new Lt(t.i18n);$t.then((e=>{i.emit("data:ready",e)})).catch((e=>{i.emit("error",e)}));const r=new Pt({events:i,i18n:s,customEmojis:o,renderer:t.renderer,options:t,emojiData:$t,pickerId:`picmo-${Date.now()}-${At++}`}).create(zt);return r.renderSync(),r},e.createStyleInjector=Ft,e.darkTheme=ee,e.debounce=z,e.deleteDatabase=function(e,t){e.deleteDatabase(t)},e.empty=I,e.en=ge,e.getEmojiForEvent=_,e.getOptions=xe,e.getPrefixedClasses=$,e.globalConfig=Se,e.i18n=Tt,e.isLocalStorageAvailable=R,e.isSessionStorageAvailable=V,e.lightTheme=X,e.prefixClassName=A,e.replaceChildren=T,e.shouldAnimate=x,e.throttle=S,e.toElement=L,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
8172(function(T,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("picmo")):typeof define=="function"&&define.amd?define(["exports","picmo"],b):(T=typeof globalThis<"u"?globalThis:T||self,b(T.picmoPopup={},T.picmo))})(this,function(T,b){"use strict";function _(t){return t.split("-")[0]}function F(t){return t.split("-")[1]}function H(t){return["top","bottom"].includes(_(t))?"x":"y"}function et(t){return t==="y"?"height":"width"}function nt(t,e,n){let{reference:i,floating:o}=t;const c=i.x+i.width/2-o.width/2,r=i.y+i.height/2-o.height/2,s=H(e),l=et(s),a=i[l]/2-o[l]/2,d=_(e),f=s==="x";let u;switch(d){case"top":u={x:c,y:i.y-o.height};break;case"bottom":u={x:c,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:r};break;case"left":u={x:i.x-o.width,y:r};break;default:u={x:i.x,y:i.y}}switch(F(e)){case"start":u[s]-=a*(n&&f?-1:1);break;case"end":u[s]+=a*(n&&f?-1:1);break}return u}const vt=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:c=[],platform:r}=n,s=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:a,y:d}=nt(l,i,s),f=i,u={},h=0;for(let m=0;m<c.length;m++){const{name:p,fn:w}=c[m],{x:y,y:g,data:v,reset:x}=await w({x:a,y:d,initialPlacement:i,placement:f,strategy:o,middlewareData:u,rects:l,platform:r,elements:{reference:t,floating:e}});if(a=y!=null?y:a,d=g!=null?g:d,u={...u,[p]:{...u[p],...v}},x&&h<=50){h++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):x.rects),{x:a,y:d}=nt(l,f,s)),m=-1;continue}}return{x:a,y:d,placement:f,strategy:o,middlewareData:u}};function bt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ct(t){return typeof t!="number"?bt(t):{top:t,right:t,bottom:t,left:t}}function I(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function Q(t,e){var n;e===void 0&&(e={});const{x:i,y:o,platform:c,rects:r,elements:s,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:u=!1,padding:h=0}=e,m=Ct(h),w=s[u?f==="floating"?"reference":"floating":f],y=I(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(w)))==null||n?w:w.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(s.floating)),boundary:a,rootBoundary:d,strategy:l})),g=I(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...r.floating,x:i,y:o}:r.reference,offsetParent:await(c.getOffsetParent==null?void 0:c.getOffsetParent(s.floating)),strategy:l}):r[f]);return{top:y.top-g.top+m.top,bottom:g.bottom-y.bottom+m.bottom,left:y.left-g.left+m.left,right:g.right-y.right+m.right}}const Et=Math.min,Pt=Math.max;function ot(t,e,n){return Pt(t,Et(e,n))}const At={left:"right",right:"left",bottom:"top",top:"bottom"};function z(t){return t.replace(/left|right|bottom|top/g,e=>At[e])}function it(t,e,n){n===void 0&&(n=!1);const i=F(t),o=H(t),c=et(o);let r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(r=z(r)),{main:r,cross:z(r)}}const Lt={start:"end",end:"start"};function Z(t){return t.replace(/start|end/g,e=>Lt[e])}const Ot=["top","right","bottom","left"].reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);function Rt(t,e,n){return(t?[...n.filter(o=>F(o)===t),...n.filter(o=>F(o)!==t)]:n.filter(o=>_(o)===o)).filter(o=>t?F(o)===t||(e?Z(o)!==o:!1):!0)}const kt=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,i,o,c,r;const{x:s,y:l,rects:a,middlewareData:d,placement:f,platform:u,elements:h}=e,{alignment:m=null,allowedPlacements:p=Ot,autoAlignment:w=!0,...y}=t,g=Rt(m,w,p),v=await Q(e,y),x=(n=(i=d.autoPlacement)==null?void 0:i.index)!=null?n:0,P=g[x];if(P==null)return{};const{main:U,cross:G}=it(P,a,await(u.isRTL==null?void 0:u.isRTL(h.floating)));if(f!==P)return{x:s,y:l,reset:{placement:g[0]}};const J=[v[_(P)],v[U],v[G]],A=[...(o=(c=d.autoPlacement)==null?void 0:c.overflows)!=null?o:[],{placement:P,overflows:J}],D=g[x+1];if(D)return{data:{index:x+1,overflows:A},reset:{placement:D}};const V=A.slice().sort((k,j)=>k.overflows[0]-j.overflows[0]),$=(r=V.find(k=>{let{overflows:j}=k;return j.every(re=>re<=0)}))==null?void 0:r.placement,N=$!=null?$:V[0].placement;return N!==f?{data:{index:x+1,overflows:A},reset:{placement:N}}:{}}}};function Tt(t){const e=z(t);return[Z(t),e,Z(e)]}const Bt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:o,rects:c,initialPlacement:r,platform:s,elements:l}=e,{mainAxis:a=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",flipAlignment:h=!0,...m}=t,p=_(i),y=f||(p===r||!h?[z(r)]:Tt(r)),g=[r,...y],v=await Q(e,m),x=[];let P=((n=o.flip)==null?void 0:n.overflows)||[];if(a&&x.push(v[p]),d){const{main:A,cross:D}=it(i,c,await(s.isRTL==null?void 0:s.isRTL(l.floating)));x.push(v[A],v[D])}if(P=[...P,{placement:i,overflows:x}],!x.every(A=>A<=0)){var U,G;const A=((U=(G=o.flip)==null?void 0:G.index)!=null?U:0)+1,D=g[A];if(D)return{data:{index:A,overflows:P},reset:{placement:D}};let V="bottom";switch(u){case"bestFit":{var J;const $=(J=P.map(N=>[N,N.overflows.filter(k=>k>0).reduce((k,j)=>k+j,0)]).sort((N,k)=>N[1]-k[1])[0])==null?void 0:J[0].placement;$&&(V=$);break}case"initialPlacement":V=r;break}if(i!==V)return{reset:{placement:V}}}return{}}}};async function St(t,e){const{placement:n,platform:i,elements:o}=t,c=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=_(n),s=F(n),l=H(n)==="x",a=["left","top"].includes(r)?-1:1,d=c&&l?-1:1,f=typeof e=="function"?e(t):e;let{mainAxis:u,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof m=="number"&&(h=s==="end"?m*-1:m),l?{x:h*d,y:u*a}:{x:u*a,y:h*d}}const st=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,o=await St(e,t);return{x:n+o.x,y:i+o.y,data:o}}}};function _t(t){return t==="x"?"y":"x"}const rt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:c=!0,crossAxis:r=!1,limiter:s={fn:w=>{let{x:y,y:g}=w;return{x:y,y:g}}},...l}=t,a={x:n,y:i},d=await Q(e,l),f=H(_(o)),u=_t(f);let h=a[f],m=a[u];if(c){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",g=h+d[w],v=h-d[y];h=ot(g,h,v)}if(r){const w=u==="y"?"top":"left",y=u==="y"?"bottom":"right",g=m+d[w],v=m-d[y];m=ot(g,m,v)}const p=s.fn({...e,[f]:h,[u]:m});return{...p,data:{x:p.x-n,y:p.y-i}}}}};function ct(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function L(t){if(t==null)return window;if(!ct(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function C(t){return L(t).getComputedStyle(t)}function O(t){return ct(t)?"":t?(t.nodeName||"").toLowerCase():""}function lt(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function E(t){return t instanceof L(t).HTMLElement}function B(t){return t instanceof L(t).Element}function Dt(t){return t instanceof L(t).Node}function M(t){if(typeof ShadowRoot>"u")return!1;const e=L(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function X(t){const{overflow:e,overflowX:n,overflowY:i}=C(t);return/auto|scroll|overlay|hidden/.test(e+i+n)}function Vt(t){return["table","td","th"].includes(O(t))}function at(t){const e=/firefox/i.test(lt()),n=C(t);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||e&&n.willChange==="filter"||e&&(n.filter?n.filter!=="none":!1)}function ft(){return!/^((?!chrome|android).)*safari/i.test(lt())}const ut=Math.min,W=Math.max,Y=Math.round;function R(t,e,n){var i,o,c,r;e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect();let l=1,a=1;e&&E(t)&&(l=t.offsetWidth>0&&Y(s.width)/t.offsetWidth||1,a=t.offsetHeight>0&&Y(s.height)/t.offsetHeight||1);const d=B(t)?L(t):window,f=!ft()&&n,u=(s.left+(f&&(i=(o=d.visualViewport)==null?void 0:o.offsetLeft)!=null?i:0))/l,h=(s.top+(f&&(c=(r=d.visualViewport)==null?void 0:r.offsetTop)!=null?c:0))/a,m=s.width/l,p=s.height/a;return{width:m,height:p,top:h,right:u+m,bottom:h+p,left:u,x:u,y:h}}function S(t){return((Dt(t)?t.ownerDocument:t.document)||window.document).documentElement}function K(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function dt(t){return R(S(t)).left+K(t).scrollLeft}function Nt(t){const e=R(t);return Y(e.width)!==t.offsetWidth||Y(e.height)!==t.offsetHeight}function Ft(t,e,n){const i=E(e),o=S(e),c=R(t,i&&Nt(e),n==="fixed");let r={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(i||!i&&n!=="fixed")if((O(e)!=="body"||X(o))&&(r=K(e)),E(e)){const l=R(e,!0);s.x=l.x+e.clientLeft,s.y=l.y+e.clientTop}else o&&(s.x=dt(o));return{x:c.left+r.scrollLeft-s.x,y:c.top+r.scrollTop-s.y,width:c.width,height:c.height}}function pt(t){return O(t)==="html"?t:t.assignedSlot||t.parentNode||(M(t)?t.host:null)||S(t)}function ht(t){return!E(t)||C(t).position==="fixed"?null:Mt(t)}function Mt(t){let{offsetParent:e}=t,n=t,i=!1;for(;n&&n!==e;){const{assignedSlot:o}=n;if(o){let c=o.offsetParent;if(C(o).display==="contents"){const r=o.hasAttribute("style"),s=o.style.display;o.style.display=C(n).display,c=o.offsetParent,o.style.display=s,r||o.removeAttribute("style")}n=o,e!==c&&(e=c,i=!0)}else if(M(n)&&n.host&&i)break;n=M(n)&&n.host||n.parentNode}return e}function Wt(t){let e=pt(t);for(M(e)&&(e=e.host);E(e)&&!["html","body"].includes(O(e));){if(at(e))return e;{const n=e.parentNode;e=M(n)?n.host:n}}return null}function tt(t){const e=L(t);let n=ht(t);for(;n&&Vt(n)&&C(n).position==="static";)n=ht(n);return n&&(O(n)==="html"||O(n)==="body"&&C(n).position==="static"&&!at(n))?e:n||Wt(t)||e}function mt(t){if(E(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=R(t);return{width:e.width,height:e.height}}function $t(t){let{rect:e,offsetParent:n,strategy:i}=t;const o=E(n),c=S(n);if(n===c)return e;let r={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((o||!o&&i!=="fixed")&&((O(n)!=="body"||X(c))&&(r=K(n)),E(n))){const l=R(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...e,x:e.x-r.scrollLeft+s.x,y:e.y-r.scrollTop+s.y}}function jt(t,e){const n=L(t),i=S(t),o=n.visualViewport;let c=i.clientWidth,r=i.clientHeight,s=0,l=0;if(o){c=o.width,r=o.height;const a=ft();(a||!a&&e==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:c,height:r,x:s,y:l}}function Ht(t){var e;const n=S(t),i=K(t),o=(e=t.ownerDocument)==null?void 0:e.body,c=W(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),r=W(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-i.scrollLeft+dt(t);const l=-i.scrollTop;return C(o||n).direction==="rtl"&&(s+=W(n.clientWidth,o?o.clientWidth:0)-c),{width:c,height:r,x:s,y:l}}function gt(t){const e=pt(t);return["html","body","#document"].includes(O(e))?t.ownerDocument.body:E(e)&&X(e)?e:gt(e)}function q(t,e){var n;e===void 0&&(e=[]);const i=gt(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),c=L(i),r=o?[c].concat(c.visualViewport||[],X(i)?i:[]):i,s=e.concat(r);return o?s:s.concat(q(r))}function It(t,e){const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&M(n)){let i=e;do{if(i&&t===i)return!0;i=i.parentNode||i.host}while(i)}return!1}function zt(t,e){const n=R(t,!1,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft;return{top:i,left:o,x:o,y:i,right:o+t.clientWidth,bottom:i+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function wt(t,e,n){return e==="viewport"?I(jt(t,n)):B(e)?zt(e,n):I(Ht(S(t)))}function Xt(t){const e=q(t),i=["absolute","fixed"].includes(C(t).position)&&E(t)?tt(t):t;return B(i)?e.filter(o=>B(o)&&It(o,i)&&O(o)!=="body"):[]}function Yt(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[...n==="clippingAncestors"?Xt(e):[].concat(n),i],s=r[0],l=r.reduce((a,d)=>{const f=wt(e,d,o);return a.top=W(f.top,a.top),a.right=ut(f.right,a.right),a.bottom=ut(f.bottom,a.bottom),a.left=W(f.left,a.left),a},wt(e,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const Kt={getClippingRect:Yt,convertOffsetParentRelativeRectToViewportRelativeRect:$t,isElement:B,getDimensions:mt,getOffsetParent:tt,getDocumentElement:S,getElementRects:t=>{let{reference:e,floating:n,strategy:i}=t;return{reference:Ft(e,tt(n),i),floating:{...mt(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>C(t).direction==="rtl"};function qt(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:c=!0,elementResize:r=!0,animationFrame:s=!1}=i,l=o&&!s,a=c&&!s,d=l||a?[...B(t)?q(t):[],...q(e)]:[];d.forEach(p=>{l&&p.addEventListener("scroll",n,{passive:!0}),a&&p.addEventListener("resize",n)});let f=null;if(r){let p=!0;f=new ResizeObserver(()=>{p||n(),p=!1}),B(t)&&!s&&f.observe(t),f.observe(e)}let u,h=s?R(t):null;s&&m();function m(){const p=R(t);h&&(p.x!==h.x||p.y!==h.y||p.width!==h.width||p.height!==h.height)&&n(),h=p,u=requestAnimationFrame(m)}return n(),()=>{var p;d.forEach(w=>{l&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),(p=f)==null||p.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const Ut=(t,e,n)=>vt(t,e,{platform:Kt,...n});async function Gt(t,e,n,i){if(!i)throw new Error("Must provide a positioning option");return await(typeof i=="string"?Jt(t,e,n,i):Qt(e,i))}async function Jt(t,e,n,i){if(!n)throw new Error("Reference element is required for relative positioning");let o;return i==="auto"?o={middleware:[kt(),rt(),st({mainAxis:5,crossAxis:12})]}:o={placement:i,middleware:[Bt(),rt(),st(5)]},qt(n,e,async()=>{if((!n.isConnected||!n.offsetParent)&&Zt(t))return;const{x:c,y:r}=await Ut(n,e,o);Object.assign(e.style,{position:"absolute",left:`${c}px`,top:`${r}px`})})}function Qt(t,e){return t.style.position="fixed",Object.entries(e).forEach(([n,i])=>{t.style[n]=i}),()=>{}}function Zt(t){switch(t.options.onPositionLost){case"close":return t.close(),!0;case"destroy":return t.destroy(),!0;case"hold":return!0}}const te={hideOnClickOutside:!0,hideOnEmojiSelect:!0,hideOnEscape:!0,position:"auto",showCloseButton:!0,onPositionLost:"none"};function ee(t={}){return{...te,rootElement:document.body,...t}}const ne='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>',yt=b.getPrefixedClasses("popupContainer","closeButton");class xt{constructor(e,n){this.isOpen=!1,this.externalEvents=new b.Events,this.options={...ee(n),...b.getOptions(e)},this.popupEl=document.createElement("div"),this.popupEl.classList.add(yt.popupContainer),this.popupEl.classList.add(this.options.theme),n.className&&this.popupEl.classList.add(n.className),this.options.showCloseButton&&(this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.classList.add(yt.closeButton),this.closeButton.innerHTML=ne,this.closeButton.addEventListener("click",()=>{this.close()}),this.popupEl.appendChild(this.closeButton));const i=document.createElement("div");this.popupEl.appendChild(i),this.picker=b.createPicker({...this.options,rootElement:i}),this.focusTrap=new b.FocusTrap,this.picker.addEventListener("data:ready",()=>{this.focusTrap.activate(this.picker.el),this.picker.setInitialFocus()}),this.options.hideOnEmojiSelect&&this.picker.addEventListener("emoji:select",()=>{var o;this.close(),(o=this.triggerElement)==null||o.focus()}),this.options.hideOnClickOutside&&(this.onDocumentClick=this.onDocumentClick.bind(this),document.addEventListener("click",this.onDocumentClick)),this.options.hideOnEscape&&(this.handleKeydown=this.handleKeydown.bind(this),this.popupEl.addEventListener("keydown",this.handleKeydown)),this.referenceElement=this.options.referenceElement,this.triggerElement=this.options.triggerElement}addEventListener(e,n){this.externalEvents.on(e,n),this.picker.addEventListener(e,n)}removeEventListener(e,n){this.externalEvents.off(e,n),this.picker.removeEventListener(e,n)}handleKeydown(e){var n;e.key==="Escape"&&(this.close(),(n=this.triggerElement)==null||n.focus())}async destroy(){this.isOpen&&await this.close(),document.removeEventListener("click",this.onDocumentClick),this.picker.destroy(),this.externalEvents.removeAll()}toggle(e){return this.isOpen?this.close():this.open(e)}async open({triggerElement:e,referenceElement:n}={}){this.isOpen||(e&&(this.triggerElement=e),n&&(this.referenceElement=n),await this.initiateOpenStateChange(!0),this.popupEl.style.opacity="0",this.options.rootElement.appendChild(this.popupEl),await this.setPosition(),this.picker.reset(!1),await this.animatePopup(!0),await this.animateCloseButton(!0),this.picker.setInitialFocus(),this.externalEvents.emit("picker:open"))}async close(){var e;!this.isOpen||(await this.initiateOpenStateChange(!1),await this.animateCloseButton(!1),await this.animatePopup(!1),this.popupEl.remove(),this.picker.reset(),(e=this.positionCleanup)==null||e.call(this),this.focusTrap.deactivate(),this.externalEvents.emit("picker:close"))}getRunningAnimations(){return this.picker.el.getAnimations().filter(e=>e.playState==="running")}async setPosition(){var e;(e=this.positionCleanup)==null||e.call(this),this.positionCleanup=await Gt(this,this.popupEl,this.referenceElement,this.options.position)}awaitPendingAnimations(){return Promise.all(this.getRunningAnimations().map(e=>e.finished))}onDocumentClick(e){var o;const n=e.target,i=(o=this.triggerElement)==null?void 0:o.contains(n);this.isOpen&&!this.picker.isPickerClick(e)&&!i&&this.close()}animatePopup(e){return b.animate(this.popupEl,{opacity:[0,1],transform:["scale(0.9)","
8172scale(1)"]},{duration:150,id:e?"show-picker":"hide-picker",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}animateCloseButton(e){if(this.closeButton)return b.animate(this.closeButton,{opacity:[0,1]},{duration:25,id:e?"show-close":"hide-close",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}async initiateOpenStateChange(e){this.isOpen=e,await this.awaitPendingAnimations()}}const oe=`.picmo__popupContainer{display:flex;flex-direction:column;position:absolute}.picmo__popupContainer .picmo__closeButton{position:absolute;opacity:0;background:transparent;border:none;z-index:1;right:0;top:0;cursor:pointer;padding:4px;align-self:flex-end;transform:translate(50%,-50%);background:#999999;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%}.picmo__popupContainer .picmo__closeButton:hover{background:var(--accent-color)}.picmo__popupContainer .picmo__closeButton svg{fill:#fff;width:1.25rem;height:1.25rem}
8173`,ie=b.createStyleInjector();function se(t,e){return ie(oe),new xt({autoFocus:"auto",...t},e)}T.PopupPickerController=xt,T.createPopup=se,Object.defineProperties(T,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.