DmitrMakeev commited on
Commit
eda52e2
·
verified ·
1 Parent(s): 50ed214

Update js/senler_btn_v1.js

Browse files
Files changed (1) hide show
  1. js/senler_btn_v1.js +1 -1
js/senler_btn_v1.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){const n=window.w_url.replace(/\/+$/,"")+"/add_user_senler",a=Number(window.vk_grup),r=window.vk_grup,o=window.s_grup,i=window.red_on,c=window.on_url,s=window.clarity_on,d=window.clarity_id,u=window.clarity_ses,l=window.clarity_tar,p=window.funnel,m=window.clarity_ev,w=window.ups;let y,_,f,g,h,b,P;const v=new URL(window.location.href),k=v.searchParams.get("vk_user_id");P=window.location.hash.substring(1);const B=new URLSearchParams(P);y=B.get("gcpc")||"",_=B.get("utm_source")||"",f=B.get("utm_medium")||"",g=B.get("utm_campaign")||"",h=B.get("utm_content")||"",b=B.get("utm_term")||"";const S=k.toString();v.searchParams.get("vk_app_id");let E;function j(){document.getElementById("notLoyalty").style.display="block",s&&(window.clarity?window.clarity("set","loyalty","not"):console.log("Clarity is not initialized"))}function L(){document.getElementById("registrationForm").style.display="none",document.getElementById("notLoyalty").style.display="none";const e=new URLSearchParams;e.append("vk_user_id",E),e.append("vk_group_id",r),e.append("sub_id",o),e.append("utm_source",_),e.append("utm_medium",f),e.append("utm_campaign",g),e.append("utm_content",h),e.append("utm_term",b),fetch(n,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{if(e&&e.success){if(i){s&&(O(m),T());let e=new URL(c);e.searchParams.append("ups",w),e.searchParams.append("uid",E),e.searchParams.append("gcpc",y),e.searchParams.append("utm_source",_),e.searchParams.append("utm_medium",f),e.searchParams.append("utm_campaign",g),e.searchParams.append("utm_content",h),e.searchParams.append("utm_term",b),window.open(e.toString(),"_blank")}else s&&(O(m),T());document.getElementById("thankYouBlock").style.display="block"}else j()}).catch(e=>{console.error("Error:",e),j()})}function O(e){window.clarity?window.clarity("event",e):console.log("Clarity is not initialized")}function T(){window.clarity?window.clarity("set","loyalty","yes"):console.log("Clarity is not initialized")}var I,U,x,z,C,M,R;vkBridge.send("VKWebAppInit"),document.getElementById("contactForm").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:a,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{E=e.id,setTimeout(L,1e3)}).catch(e=>{j()}):j()}).catch(e=>{j()})})),s&&(I=window,U=document,z="script",C=d,I[x="clarity"]=I[x]||function(){(I[x].q=I[x].q||[]).push(arguments)},(M=U.createElement(z)).async=1,M.src="https://www.clarity.ms/tag/"+C,(R=U.getElementsByTagName(z)[0]).parentNode.insertBefore(M,R),function(e,t,n){window.clarity?window.clarity("identify",e,t,n):console.log("Clarity is not initialized")}(S,u,l),function(e,t,n,a,r,o){window.clarity?(window.clarity("set","utm_source",e),window.clarity("set","utm_medium",t),window.clarity("set","utm_campaign",n),window.clarity("set","utm_content",a),window.clarity("set","utm_term",r),window.clarity("set","funnel",o)):console.log("Clarity is not initialized")}(_,f,g,h,b,p)),$(document).ready((function(){$("#linkThank").on("click",(function(e){if(e.preventDefault(),i){let e=new URL($(this).attr("href"));e.searchParams.append("ups",w),e.searchParams.append("uid",E),e.searchParams.append("gcpc",y),e.searchParams.append("utm_source",_),e.searchParams.append("utm_medium",f),e.searchParams.append("utm_campaign",g),e.searchParams.append("utm_content",h),e.searchParams.append("utm_term",b),window.open(e.toString(),"_blank")}else window.open($(this).attr("href"),"_blank")}))}))}]);
 
1
+ !function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){const n=window.w_url.replace(/\/+$/,"")+"/add_user_senler",a=Number(window.vk_grup),r=window.vk_grup,o=window.s_grup,i=window.red_on,c=window.on_url,s=window.clarity_on,d=window.clarity_id,l=window.clarity_ses,u=window.clarity_tar,p=window.funnel,m=window.clarity_ev,w=window.ups;let y,_,f,g,h,b,P;const v=new URL(window.location.href),k=v.searchParams.get("vk_user_id");P=window.location.hash.substring(1);const B=new URLSearchParams(P);y=B.get("gcpc")||"",_=B.get("utm_source")||"",f=B.get("utm_medium")||"",g=B.get("utm_campaign")||"",h=B.get("utm_content")||"",b=B.get("utm_term")||"";const E=k.toString();v.searchParams.get("vk_app_id");let S;function j(){document.getElementById("notLoyalty").style.display="block",document.getElementById("contactForm").style.display="none",s&&(window.clarity?window.clarity("set","loyalty","not"):console.log("Clarity is not initialized"))}function I(){document.getElementById("contactForm").style.display="none",document.getElementById("notLoyalty").style.display="none";const e=new URLSearchParams;e.append("vk_user_id",S),e.append("vk_group_id",r),e.append("sub_id",o),e.append("utm_source",_),e.append("utm_medium",f),e.append("utm_campaign",g),e.append("utm_content",h),e.append("utm_term",b),fetch(n,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{if(e&&e.success){if(i){s&&(L(m),O());let e=new URL(c);e.searchParams.append("ups",w),e.searchParams.append("uid",S),e.searchParams.append("gcpc",y),e.searchParams.append("utm_source",_),e.searchParams.append("utm_medium",f),e.searchParams.append("utm_campaign",g),e.searchParams.append("utm_content",h),e.searchParams.append("utm_term",b),window.open(e.toString(),"_blank")}else s&&(L(m),O());document.getElementById("thankYouBlock").style.display="block"}else j()}).catch(e=>{console.error("Error:",e),j()})}function L(e){window.clarity?window.clarity("event",e):console.log("Clarity is not initialized")}function O(){window.clarity?window.clarity("set","loyalty","yes"):console.log("Clarity is not initialized")}var T,U,x,z,C,M,R;vkBridge.send("VKWebAppInit"),document.getElementById("contactForm").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:a,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{S=e.id,setTimeout(I,1e3)}).catch(e=>{j()}):j()}).catch(e=>{j()})})),s&&(T=window,U=document,z="script",C=d,T[x="clarity"]=T[x]||function(){(T[x].q=T[x].q||[]).push(arguments)},(M=U.createElement(z)).async=1,M.src="https://www.clarity.ms/tag/"+C,(R=U.getElementsByTagName(z)[0]).parentNode.insertBefore(M,R),function(e,t,n){window.clarity?window.clarity("identify",e,t,n):console.log("Clarity is not initialized")}(E,l,u),function(e,t,n,a,r,o){window.clarity?(window.clarity("set","utm_source",e),window.clarity("set","utm_medium",t),window.clarity("set","utm_campaign",n),window.clarity("set","utm_content",a),window.clarity("set","utm_term",r),window.clarity("set","funnel",o)):console.log("Clarity is not initialized")}(_,f,g,h,b,p)),$(document).ready((function(){$("#linkThank").on("click",(function(e){if(e.preventDefault(),i){let e=new URL($(this).attr("href"));e.searchParams.append("ups",w),e.searchParams.append("uid",S),e.searchParams.append("gcpc",y),e.searchParams.append("utm_source",_),e.searchParams.append("utm_medium",f),e.searchParams.append("utm_campaign",g),e.searchParams.append("utm_content",h),e.searchParams.append("utm_term",b),window.open(e.toString(),"_blank")}else window.open($(this).attr("href"),"_blank")}))}))}]);