Smart Floating / Sticky Buttons – Call, Sharing, Chat Widgets & More – Buttonizer - Version 3.3.1

Version Description

Release date: October 27, 2022

Changelog: - New: Spanish translation for the editor. Help us translating Buttonizer - Fix: Fixed issue editor not loading in translations when WordPress language is supported - Fix: Workaround for when /wp-json/ API path is not available when permalink is set to 'plain'

If you experience bugs, problems or you just have some feedback, let us know on our Buttonizer community!

Download this release

Release Info

Developer buttonizer
Plugin Icon wp plugin Smart Floating / Sticky Buttons – Call, Sharing, Chat Widgets & More – Buttonizer
Version 3.3.1
Comparing to
See all releases

Code changes from version 3.3.0 to 3.3.1

app/Admin/Admin.php CHANGED
@@ -113,6 +113,7 @@ class Admin
113
  'assetsPath' => plugins_url('/assets', BUTTONIZER_PLUGIN_DIR),
114
  'api' => get_rest_url(),
115
  'nonce' => wp_create_nonce('wp_rest'),
 
116
  'version' => BUTTONIZER_VERSION,
117
  'locale' => Editor::getEditorLanguage(),
118
  'actionLock' => $this->getActionLock(),
113
  'assetsPath' => plugins_url('/assets', BUTTONIZER_PLUGIN_DIR),
114
  'api' => get_rest_url(),
115
  'nonce' => wp_create_nonce('wp_rest'),
116
+ 'isPlain' => get_option('permalink_structure') === "",
117
  'version' => BUTTONIZER_VERSION,
118
  'locale' => Editor::getEditorLanguage(),
119
  'actionLock' => $this->getActionLock(),
app/Utils/Editor.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
- /*
3
  * SOFTWARE LICENSE INFORMATION
4
- *
5
  * Copyright (c) 2017 Buttonizer, all rights reserved.
6
- *
7
  * This file is part of Buttonizer
8
- *
9
  * For detailed information regarding to the licensing of
10
  * this software, please review the license.txt or visit:
11
  * https://buttonizer.pro/license/
@@ -19,6 +19,7 @@ class Editor
19
  {
20
  switch (get_locale()) {
21
  case "nl_NL":
 
22
  return "nl";
23
 
24
  case "it_IT":
@@ -33,6 +34,9 @@ class Editor
33
  case "tr_TR":
34
  return "tr_tr";
35
 
 
 
 
36
  default:
37
  return 'en';
38
  }
1
  <?php
2
+ /*
3
  * SOFTWARE LICENSE INFORMATION
4
+ *
5
  * Copyright (c) 2017 Buttonizer, all rights reserved.
6
+ *
7
  * This file is part of Buttonizer
8
+ *
9
  * For detailed information regarding to the licensing of
10
  * this software, please review the license.txt or visit:
11
  * https://buttonizer.pro/license/
19
  {
20
  switch (get_locale()) {
21
  case "nl_NL":
22
+ case "nl_BE":
23
  return "nl";
24
 
25
  case "it_IT":
34
  case "tr_TR":
35
  return "tr_tr";
36
 
37
+ case "es_ES":
38
+ return "es";
39
+
40
  default:
41
  return 'en';
42
  }
assets/app/index.200e7634.js DELETED
@@ -1,3 +0,0 @@
1
- var wt=Object.defineProperty,Ct=Object.defineProperties;var kt=Object.getOwnPropertyDescriptors;var ce=Object.getOwnPropertySymbols;var Ue=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable;var qe=(t,i,r)=>i in t?wt(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r,x=(t,i)=>{for(var r in i||(i={}))Ue.call(i,r)&&qe(t,r,i[r]);if(ce)for(var r of ce(i))Ge.call(i,r)&&qe(t,r,i[r]);return t},q=(t,i)=>Ct(t,kt(i));var je=(t,i)=>{var r={};for(var o in t)Ue.call(t,o)&&i.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&ce)for(var o of ce(t))i.indexOf(o)<0&&Ge.call(t,o)&&(r[o]=t[o]);return r};import{c as rt,a as Ye,b as Se,R as Te,u as oe,r as s,j as e,d as n,J as xt,e as Be,F as v,L as zt,C as Y,B as g,E as St,T as it,S as Tt,H as Bt,A as re,I as Le,f as ot,g as K,h as u,i as Lt,k as It,l as L,m as $t,n as Nt,P as Ie,G as b,o as At,p as Pt,q as Mt,M as Rt,s as de,t as ie,v as F,w as Dt,x as A,y as Et,z as J,D as Ft,K as Wt,N as Ot,O as ne,Q as Ht,U as qt,V as Ut,W as Gt,X as jt,Y as pe,Z as me,_ as ge,$ as fe,a0 as Q,a1 as ye,a2 as at,a3 as $e,a4 as j,a5 as st,a6 as lt,a7 as Ne,a8 as Ae,a9 as Pe,aa as Me,ab as Re,ac as De,ad as Ee,ae as Fe,af as We,ag as Yt,ah as Vt,ai as Jt,aj as Kt,ak as Qt,al as Xt,am as Zt,an as en,ao as tn,ap as ve,aq as nn,ar as rn,as as on,at as an,au as sn,av as ln,aw as cn,ax as Ve,ay as dn,az as he,aA as un,aB as hn,aC as pn,aD as mn,aE as gn,aF as fn,aG as yn,aH as _e,aI as bn,aJ as vn,aK as _n,aL as wn,aM as Cn,aN as kn,aO as xn,aP as zn,aQ as Sn,aR as U,aS as Tn,aT as Bn,aU as Ln,aV as In,aW as $n}from"./vendor.9a5cb22f.js";const Nn=function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function r(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerpolicy&&(l.referrerPolicy=a.referrerpolicy),a.crossorigin==="use-credentials"?l.credentials="include":a.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(a){if(a.ep)return;a.ep=!0;const l=r(a);fetch(a.href,l)}};Nn();let T=rt({palette:{primary:{main:"#2D7789",contrastText:"#FFFFFF"},secondary:{main:"#f08419",contrastText:"#FFFFFF"},white:{main:"#FFFFFF",contrastText:"#2D7789"},black:{main:"#111111",contrastText:"#2D7789"}},typography:{fontFamily:["BlinkMacSystemFont","Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue","sans-serif"].join(",")},breakpoints:{values:{xs:0,sm:600,md:900,lg:1200,xl:1536,navigation:1090}}});T=rt(T,{components:{MuiListItemButton:{styleOverrides:{root:{"&.Mui-selected":{color:T.palette.secondary.main,backgroundColor:Ye(T.palette.secondary.main,.08),"&:hover":{backgroundColor:Ye(T.palette.secondary.main,.12)},"& .MuiListItemIcon-root":{color:T.palette.secondary.main}}}}},MuiLink:{styleOverrides:{root:{textDecoration:"none","&:hover":{textDecoration:"underline"}}}},MuiButton:{styleOverrides:{root:{borderRadius:50,padding:"8px 18px"}},variants:[{props:{type:"link"},style:({ownerState:t})=>x({},t.variant==="contained"?{color:T.palette[t.color].contrastText,"&:focus":{outline:"unset",boxShadow:"unset",color:T.palette[t.color].contrastText},"&:hover":{color:T.palette[t.color].contrastText}}:{color:T.palette[t.color].main,"&:focus":{outline:"unset",boxShadow:"unset",color:T.palette[t.color].main},"&:hover":{color:T.palette[t.color].main}})},{props:{type:"link-small"},style:{padding:"5px 5px",textTransform:"none",minWidth:35,color:T.palette.primary.main,"&:focus":{outline:"unset",boxShadow:"unset",color:T.palette.primary.main},"&:hover":{color:T.palette.primary.main}}}]},MuiPaper:{styleOverrides:{root:{borderRadius:10,position:"relative"}},variants:[{props:{type:"wrapper"},style:{padding:"15px 30px"}}]},MuiTypography:{variants:[{props:{type:"header"},style:{fontSize:"1rem",fontWeight:600}},{props:{type:"content"},style:{fontSize:"1em"}}]},MuiTab:{variants:[{props:{size:"small"},style:{textTransform:"unset",minHeight:42}}]},MuiList:{variants:[{props:{size:"large"},style:{"& .MuiListItem-root":{padding:"5px 16px"},"& .MuiAvatar-root":{width:30,height:30},"& .MuiTypography-root":{fontSize:"1.2rem"}}}]}}});var ct=T;function P(t,i={},r="POST"){return Se({url:`${buttonizer_admin.api}buttonizer${t}?nonce=${buttonizer_admin.nonce}`,method:r,data:i,headers:{"X-WP-Nonce":buttonizer_admin.nonce}})}const dt=Te.createContext(),An=t=>{const i=oe(),[r,o]=s.exports.useState("no-lock"),[a,l]=s.exports.useState(!1),[c,h]=s.exports.useState(!1),[m,d]=s.exports.useState(!1),[p,y]=s.exports.useState(!1),[_,M]=s.exports.useState({}),[z,I]=s.exports.useState({}),[B,k]=s.exports.useState({}),[X,W]=s.exports.useState(!1);s.exports.useState(null);const[V,ae]=s.exports.useState(null),[D,R]=s.exports.useState(!1),[$,se]=s.exports.useState(null),[le,gt]=s.exports.useState("weekly"),Oe=f=>{M({name:f==null?void 0:f.name,id:f==null?void 0:f.uid}),I({id:f==null?void 0:f.site_id,timezone:f==null?void 0:f.site_timezone,isPremium:f==null?void 0:f.site_licensed}),k({name:f==null?void 0:f.plan_name,id:f==null?void 0:f.plan_id,hasPlan:(f==null?void 0:f.plan_id)!==null,cancelled:f==null?void 0:f.plan_cancelled})},ft=()=>{X||(V!==null&&i("/editor"),W(!0),P("/editor_start_session").then(({data:f})=>{ae(f),i("/editor")}).catch(()=>{}).then(()=>W(!1)))},yt=()=>{$===null&&He()},He=(f=null)=>{f||(f=le),R(!0),P("/analytics/overview",{type:f}).then(({data:_t})=>{se(_t.data),gt(f)}).catch(()=>{}).then(()=>R(!1))};s.exports.useEffect(()=>{o(window.buttonizer_admin.actionLock),l(!!window.buttonizer_admin.hasMigrated),d(!!window.buttonizer_admin.requestReview),Oe(window.buttonizer_admin.account)},[]);const bt={actionLock:r,hasMigrated:a,legacyBackupDeleted:c,connectionSuccesfull:p,isPremium:z.isPremium,accountData:_,siteInfo:z,planInfo:B,sessionStarting:X,cachedEditorSession:V,requestReview:m,isLoadingAnalytics:D,analyticsData:$,analyticsChosenRange:le},vt={setActionLock:o,setHasMigrated:l,setLegacyBackupDeleted:h,parseAccountData:Oe,setConnectionSuccessfull:y,setCachedEditorSession:ae,setRequestReview:d,startSession:ft,getAnalytics:yt,updateAnalyticsByTimeRange:He};return e(dt.Provider,x({value:x(x({},bt),vt)},t))},w=()=>{const t=Te.useContext(dt);if(t===void 0)throw new Error("useApp must be used within a AppProvider");return t},Pn="https://app.buttonizer.io",Mn="https://editor.buttonizer.io/site/";function N(t="/"){return Pn+t}function Rn(t){return`${Mn}${t.redirect_id}#auth-token=${t.token}`}function be({text:t="Loading..."}){return n("div",{className:"buzzy-animation",children:[e("img",{src:`${buttonizer_admin.assetsPath}/images/icon-animated.svg`})," ",e("span",{children:t})]})}const ut=new xt;let we=null,E=null;function ht({buttonProps:t,buttonText:i="Connect",onConnect:r,onLoading:o=()=>{},reconnect:a=!1}){const{enqueueSnackbar:l,closeSnackbar:c}=Be(),[h,m]=s.exports.useState(!1),[d,p]=s.exports.useState(!1),[y,_]=s.exports.useState(!1),M=buttonizer_admin.site,z=()=>{if(h&&E){E.focus();return}m(!0),p(!1);const I=N(`/apps/onboard?app_origin=wordpress&site_name=${encodeURIComponent(M.name)}&domain=${encodeURIComponent(M.domain)}&email=${encodeURIComponent(M.user.email)}&first_name=${encodeURIComponent(M.user.firstName)}&last_name=${encodeURIComponent(M.user.lastName)}`);E=window.open(I,"connectPopup",`width=500,height=580,top=${window.innerHeight/2-580/2},left=${window.innerWidth/2-500/2},status=no,scrollbars=yes,resizable=no`);try{E.focus()}catch{l("Could not open authorization popup. Your browser might have blocked it. Please add this site to your exception list.",{anchorOrigin:{vertical:"bottom",horizontal:"center",autoHideDuration:1e4},action:k=>[e(g,{href:"https://community.buttonizer.pro/knowledgebase/1208",target:"_blank",color:"secondary",children:"More information"}),e(g,{onClick:()=>c(k),children:"Close"})]})}we=setInterval(()=>{if(!E){clearInterval(we);return}E.closed&&(clearInterval(we),E=null,m(!1))})};return s.exports.useEffect(()=>{const I=B=>{!B.isTrusted||B.origin!==N("")||B.data.messageType==="connect-info"&&(E&&E.close(),_(!0),o(!0),P("/connect",{siteId:B.data.id,authorization:B.data.authorization,reconnect:a}).then(({data:k})=>{ut.addConfetti(),r(k)}).catch(()=>{_(!1),o(!1),p(!0)}))};return window.addEventListener("message",I),function(){window.removeEventListener("message",I)}},[]),e(v,{children:e(zt,q(x({onClick:z,loading:y,loadingIndicator:e(Y,{size:20,style:{color:"white"}})},t),{children:i}))})}function Dn({children:t}){const{parseAccountData:i,setConnectionSuccessfull:r}=w(),{enqueueSnackbar:o,closeSnackbar:a}=Be();return s.exports.useEffect(()=>{Se.interceptors.response.use(l=>l,l=>{let c=`Oops, something went wrong. Error status ${l.response.status} (${l.response.statusText}). Your webserver might be unable to handle this request, there's an issue with your WordPress instance or you have insufficient permissions to execute this request.`,h=!0,m=!1,d=1207,p=null;return l.response.data&&(l.response.data.code==="buttonizer_api_server_error"?d=1213:h=!1,l.response.data.code==="buttonizer_token_expired"&&(m=!0),l.response.data.data&&l.response.data.data.message&&l.response.data.data.message!==""&&(p=l.response.data.data.message),c=`${l.response.data.message} (Error code: ${l.response.data.code})`),o(c,{anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:null,action:y=>[h&&e(g,{href:`https://community.buttonizer.pro/knowledgebase/${d}`,target:"_blank",color:"secondary",children:"More information"}),m&&e(ht,{onConnect:_=>{a(y),i(_.data),r(!0)},reconnect:!0,buttonProps:{color:"secondary"},buttonText:"Reconnect"}),p!==null&&e(g,{color:"secondary",onClick:()=>alert(`The response message we received was:
2
-
3
- ${p}`),children:"Debug"}),e(g,{onClick:()=>a(y),children:"Close"})]}),Promise.reject(l)})},[]),t}function En({children:t}){return e(Te.StrictMode,{children:e(St,{fallback:n("p",{children:["We're sorry! Our dashboard has crashed, we have been notified about the error. Please refresh the page"," ",e("a",{href:"./admin.php?page=Buttonizer",children:"or start from the beginning"}),"."]}),showDialog:!0,children:e(it,{theme:ct,children:e(Tt,{maxSnack:3,children:e(Bt,{children:e(An,{children:e(Dn,{children:t})})})})})})})}const Fn="_logoLink_1f0it_1",Wn="_title_1f0it_7",On="_logo_1f0it_1",Hn="_navLinks_1f0it_19",qn="_dropdownMenu_1f0it_23",Un="_pluginMenuListIcon_1f0it_27",Gn="_divider_1f0it_31",jn="_dropdownMenuItem_1f0it_36",Yn="_dropdownMenuItemSelected_1f0it_41",Vn="_externalIcon_1f0it_44";var C={logoLink:Fn,title:Wn,logo:On,navLinks:Hn,dropdownMenu:qn,pluginMenuListIcon:Un,divider:Gn,dropdownMenuItem:jn,dropdownMenuItemSelected:Yn,externalIcon:Vn};function Jn(){const{connectionSuccesfull:t,setConnectionSuccessfull:i,hasMigrated:r}=w(),o=()=>{i(!1)};return t?n(re,{severity:"success",variant:"outlined",action:e(Le,{"aria-label":"close",color:"inherit",size:"small",onClick:o,children:e(ot,{fontSize:"inherit"})}),style:{marginTop:15,background:"#edf7ed"},children:[!r&&n(v,{children:[e(K,{children:"Buttonizer has been set up. Happy conversion \u{1F680}"}),n(u,{variant:"body1",children:["Start building by clicking the '",e("b",{children:"Edit buttons"}),"' button in the section below."]})]}),r&&n(v,{children:[e(K,{children:"Your Buttonizer account has been connected. Happy conversion \u{1F680}"}),n(u,{variant:"body1",children:["Buttonizer should now be visible on your WordPress website. Manage your buttons by clicking the '",e("b",{children:"Edit buttons"}),"' button in the section below."]}),n(u,{variant:"body1",style:{marginTop:15},children:[e("b",{children:"Tip:"})," If you have a caching plugin active, we recommend to clear your site's cache."]})]})]}):null}function Je(t){return P("/settings",{data:t})}function Kn(){const{requestReview:t,setRequestReview:i}=w(),[r,o]=s.exports.useState(!1),[a,l]=s.exports.useState(!1),[c,h]=s.exports.useState(!1),m=()=>{i(!1)},d=()=>{c||(h(!0),Je({remindForReview:!0}).then(()=>m()).catch(()=>{}).then(()=>h(!1)))},p=()=>{c||(h(!0),Je({markAsReviewed:!0}).then(()=>m()).catch(()=>{}).then(()=>h(!1)))};return t?n(re,{severity:"info",variant:"outlined",style:{marginTop:15,background:"#e5f6fd"},children:[!r&&!a&&n(v,{children:[e(K,{children:"Are you enjoying Buttonizer? We really hope you do!"}),e(u,{variant:"body1",children:"Would you like to review us on WordPress and share your experience? This way you support us developing new features for Buttonizer and spread the love!"}),n("div",{style:{marginTop:15},children:[e(g,{variant:"outlined",href:"https://r.buttonizer.io/review/wordpress",target:"_blank",startIcon:e(Lt,{}),style:{marginRight:15},onClick:()=>o(!0),disabled:c,children:"Yes, I like Buttonizer"}),e(g,{startIcon:e(It,{}),style:{marginRight:15},href:"https://r.buttonizer.io/feedback",target:"_blank",disabled:c,onClick:()=>l(!0),children:"No, send feedback"}),e("div",{style:{float:"right"},children:e(g,{disabled:c,onClick:d,children:"Remind me later"})})]})]}),(r||a)&&n(v,{children:[e(K,{children:r?"We're really happy to hear that \u{1F389}":"We'll do better! We promise"}),r&&n(v,{children:[n(u,{variant:"body1",children:["If we can help you with anything, or you have cool idea's or great feedback,"," ",e(L,{href:"https://r.buttonizer.io/feedback",target:"_blank",color:"secondary",children:"just reach out to us"}),"! We always reply :)"]}),n(u,{variant:"body1",style:{marginTop:15},children:["If you have closed the window that just opened and you still like to review us,"," ",e(L,{href:"https://r.buttonizer.io/review/wordpress",target:"_blank",color:"secondary",children:"click this link"}),"!"]})]}),!r&&n(u,{variant:"body1",children:["If there's anything else what we can help you with,"," ",e(L,{href:"https://r.buttonizer.io/feedback",target:"_blank",color:"secondary",children:"just reach out to us"}),"! We always reply :)"]}),e("div",{style:{marginTop:15},children:e(g,{startIcon:e($t,{}),onClick:()=>{ut.addConfetti(),i(!1),p()},disabled:c,children:r?"Celebrate in silence":"Close with confetti"})})]})]}):null}function Qn(){const{siteInfo:t,startSession:i,sessionStarting:r}=w();let o=oe(),a=Nt();const[l,c]=s.exports.useState(!1),h=s.exports.useRef();return n("div",{style:{marginBottom:40},children:[e(Ie,{type:"wrapper",children:n(b,{container:!0,alignItems:"center",children:[e(b,{item:!0,navigation:!0,children:n("div",{className:C.logoLink,onClick:()=>o("/overview"),children:[e("img",{src:`${buttonizer_admin.assetsPath}/images/buttonizer-logo.png`,alt:"buttonizerlogo",className:C.logo,draggable:!1}),e(u,{className:C.title,color:"primary",children:"Buttonizer for WordPress"})]})}),n(b,{item:!0,container:!0,justifyContent:"space-between",navigation:"auto",className:C.navLinks,children:[e(g,{onClick:()=>{o("/overview")},color:a.pathname==="/overview"?"secondary":"primary",children:"Home"}),e(g,{onClick:()=>{o("/support")},color:a.pathname==="/support"?"secondary":"primary",children:"Support"}),e(g,{onClick:()=>{c(!0)},ref:h,endIcon:l?e(At,{}):e(Pt,{}),color:a.pathname==="/settings"?"secondary":"primary",children:"Settings"}),e(g,{variant:"contained",onClick:i,endIcon:r&&e(Y,{size:20,style:{marginLeft:8}}),disabled:r,children:"Edit buttons"})]})]})}),e(Jn,{}),e(Kn,{}),e(Mt,{open:l&&h.current,anchorEl:h.current,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:()=>{c(!1)},onClick:()=>c(!1),children:n(Rt,{className:C.dropdownMenu,children:[n(de,{onClick:()=>{o("/settings")},selected:a.pathname==="/settings",className:ie(C.dropdownMenuItem,a.pathname==="/settings"&&C.dropdownMenuItemSelected),children:[e(F,{className:C.pluginMenuListIcon,children:e(Dt,{fontSize:"small"})}),e(A,{primary:"Plugin settings",secondary:"Preferences"})]}),n(de,{href:N(`/sites/${t.id}/settings`),target:"_blank",className:C.dropdownMenuItem,children:[e(F,{className:C.pluginMenuListIcon,children:e(Et,{fontSize:"small"})}),e(A,{primary:n(v,{children:["Site Settings",e(J,{className:C.externalIcon})]}),secondary:"Update site settings"})]}),n(de,{href:N(`/sites/${t.id}/plan`),target:"_blank",className:C.dropdownMenuItem,children:[e(F,{className:C.pluginMenuListIcon,children:e(Ft,{fontSize:"small"})}),e(A,{primary:n(v,{children:["Site plan",e(J,{className:C.externalIcon})]}),secondary:"Manage subscription"})]}),e(Wt,{className:C.divider}),n(de,{href:N("/account"),target:"_blank",className:C.dropdownMenuItem,children:[e(F,{className:C.pluginMenuListIcon,children:e(Ot,{fontSize:"small"})}),e(A,{primary:n(v,{children:["Account Settings",e(J,{className:C.externalIcon})]}),secondary:"Account settings"})]})]})})]})}const Xn="_footer_zmvmt_1",Zn="_subfooter_zmvmt_7",er="_dutchFlag_zmvmt_13",tr="_loveIcon_zmvmt_23",nr="_coffeeIcon_zmvmt_24";var Z={footer:Xn,subfooter:Zn,dutchFlag:er,loveIcon:tr,coffeeIcon:nr};function pt(){return n("div",{className:Z.footer,children:["Need some assistance? Get free support via our"," ",e(L,{href:"https://r.buttonizer.io/support/community?utm_source=wp-plugin-footer",target:"_blank",color:"secondary",children:"Buttonizer Community"}),". Do you have feedback?"," ",e(L,{href:"https://r.buttonizer.io/feedback?utm_source=wp-plugin-footer",target:"_blank",color:"secondary",children:"Give feedback"}),".",n("div",{className:Z.subfooter,children:["Built with"," ",e(ne,{title:"much love",children:e(Ht,{className:Z.loveIcon})})," ","and"," ",e(ne,{title:"lots and lots of coffee",children:e(qt,{className:Z.coffeeIcon})})," ","in The Netherlands"," ",e(ne,{title:"Buttonizer HQ in Zoetermeer",children:e("img",{src:`${buttonizer_admin.assetsPath}/images/dutch-flag.svg`,className:Z.dutchFlag})})]})]})}function rr(){return n(Ut,{style:{maxWidth:1100},children:[n("div",{style:{padding:"50px 0 0",height:"100%"},children:[e(Qn,{}),e(Gt,{})]}),e(pt,{})]})}const ir="_avatar_1ciu2_5",or="_listItem_1ciu2_9",ar="_secondaryInfo_1ciu2_13",sr="_knowledgebase_1ciu2_17",lr="_knowledgebaseText_1ciu2_24";var ee={"migratePage-container":"_migratePage-container_1ciu2_1",avatar:ir,listItem:or,secondaryInfo:ar,knowledgebase:sr,knowledgebaseText:lr};const cr="_buttonizerPaper_131bh_1";var dr={buttonizerPaper:cr};function mt({children:t,containerProps:i}){return e(v,{children:n(jt,q(x({className:"migratePage-container",style:{marginTop:50,maxWidth:1130}},i),{children:[e("div",{style:{alignItems:"center",justifyContent:"center",display:"flex",marginBottom:30},children:e("img",{src:`${buttonizer_admin.assetsPath}/images/logo.png`,alt:"buttonizerlogo",style:{height:70}})}),e(Ie,{className:dr.buttonizerPaper,sx:{"&::before":{background:`url(${buttonizer_admin.assetsPath}/images/waves.svg)`}},children:t})]}))})}const ur="_code_1iwn6_1";var hr={code:ur};const pr=s.exports.forwardRef(function(i,r){return e(pe,x({direction:"up",ref:r},i))});function mr({open:t,onClose:i=()=>{},onConfirm:r=()=>{}}){const o=s.exports.useRef(),a=()=>{o.current.focus(),o.current.select(),navigator.clipboard&&navigator.clipboard.writeText(o.current.value)};return n(me,{open:t,onClose:close,TransitionComponent:pr,"aria-labelledby":"migrate-title","aria-describedby":"migrate-description",children:[e(ge,{id:"migrate-title",children:"Before you migrate"}),n(fe,{children:[n(Q,{id:"migrate-description",children:["It seems that you're currently using a deprecated custom JavaScript feature of Buttonizer which is not supported on Buttonizer 3.0 in favour of the advanced"," ",e(L,{href:"https://community.buttonizer.pro/knowledgebase/435",target:"_blank",color:"secondary",children:"Buttonizer JavaScript API"}),"."]}),n(Q,{style:{margin:"15px 0"},children:["Please copy all the code from the block below and add it to a"," ",e(L,{href:"https://community.buttonizer.pro/knowledgebase/1011",target:"_blank",color:"secondary",children:"Headers Footers"})," ","plugin of your choice. Your click actions will stay working as they are now."]}),e("textarea",{className:hr.code,onClick:a,ref:o,readOnly:!0,children:buttonizer_admin.beforeMigrate})]}),n(ye,{children:[e(g,{onClick:i,children:"Cancel"}),e(g,{color:"secondary",onClick:()=>r(!0),autoFocus:!0,children:"I am ready"})]})]})}let Ce=null,O=null;function gr(){const t=oe(),{enqueueSnackbar:i,closeSnackbar:r}=Be(),{setActionLock:o,parseAccountData:a,setConnectionSuccessfull:l,setHasMigrated:c}=w(),[h,m]=s.exports.useState(!1),[d,p]=s.exports.useState(!1),[y,_]=s.exports.useState(!1),[M,z]=s.exports.useState(!1),[I,B]=s.exports.useState(null),[k,X]=s.exports.useState(!0),W=buttonizer_admin.site,V=(R=!1)=>{if((buttonizer_admin==null?void 0:buttonizer_admin.beforeMigrate)!==null&&R!==!0){p(!0);return}if(h&&O){O.focus();return}m(!0),z(!1);const $=N(`/apps/onboard?app_origin=wordpress&site_name=${encodeURIComponent(W.name)}&domain=${encodeURIComponent(W.domain)}&email=${encodeURIComponent(W.user.email)}&first_name=${encodeURIComponent(W.user.firstName)}&last_name=${encodeURIComponent(W.user.lastName)}`);O=window.open($,"connectPopup",`width=500,height=580,top=${window.innerHeight/2-580/2},left=${window.innerWidth/2-500/2},status=no,scrollbars=yes,resizable=no`),Ce=setInterval(()=>{if(!O){clearInterval(Ce);return}O.closed&&(clearInterval(Ce),O=null,m(!1))});try{O.focus()}catch{i("Could not open authorization popup. Your browser might have blocked it. Please add this site to your exception list.",{anchorOrigin:{vertical:"bottom",horizontal:"center",autoHideDuration:1e4},action:le=>[e(g,{href:"https://community.buttonizer.pro/knowledgebase/1208",target:"_blank",color:"secondary",children:"More information"}),e(g,{onClick:()=>r(le),children:"Close"})]})}},ae=()=>{y||(_(!0),B("skipping"),P("/migrate",{skip:!0}).then(({data:R})=>{document.location.href=`${buttonizer_admin.admin}?page=Buttonizer`}).catch(()=>{z(!0),_(!1)}))};if(s.exports.useEffect(()=>{const R=$=>{!$.isTrusted||$.origin!==N("")||$.data.messageType==="connect-info"&&(O.close(),B("connecting"),P("/migrate",{siteId:$.data.id,authorization:$.data.authorization,shouldMigrate:k}).then(({data:se})=>{o("no-lock"),a(se.data),l(!0),c(!0),t("/")}).catch(()=>{B(null),z(!0)}))};return window.addEventListener("message",R),function(){window.removeEventListener("message",R)}},[k]),I!==null)return e(be,{text:fr(I)});const D=(R,$)=>n(j,{className:ee.listItem,children:[e(st,{children:e(lt,{className:ee.avatar,children:e(Ne,{})})}),e(A,{secondary:$,secondaryTypographyProps:{className:ee.secondaryInfo},primary:R})]});return n(mt,{children:[n(g,{href:"https://community.buttonizer.pro/knowledgebase/1122-standalone-vs-wordpress",target:"_blank",type:"link-small",className:ee.knowledgebase,children:[e(at,{}),e("span",{className:ee.knowledgebaseText,children:"Learn more about Buttonizer Standalone"})]}),n(b,{container:!0,style:{height:"100%"},direction:"row",children:[e(b,{item:!0,container:!0,justifyContent:"center",direction:"column",alignContent:"center",md:6,sm:12,sx:{margin:"20px 0"},children:n("div",{children:[e("img",{src:`${buttonizer_admin.assetsPath}/images/buttonizer-logo.png`,alt:"buttonizerlogo",style:{height:50}}),e(u,{style:{fontSize:27,fontWeight:600,marginTop:30},children:"Buttonizer just got an upgrade!"}),e(u,{style:{fontSize:"1.2rem",maxWidth:"fit-content",marginTop:10},component:"div",children:"Easier to manage, faster and more features."}),e("div",{style:{marginTop:30,maxWidth:300},children:n(g,{variant:"contained",onClick:()=>{X(!0),V()},color:"secondary",size:"small",sx:{padding:"15px 30px"},children:["Start migrating",e(J,{style:{marginLeft:15}})]})}),e(u,{style:{marginTop:20,fontSize:"0.875rem",maxWidth:"fit-content"},component:"div",children:"Already using Buttonizer Standalone? Connect without migrating your buttons."}),n("div",{style:{marginTop:20,marginBottom:100,alignItems:"center",display:"flex"},children:[e(g,{variant:"outlined",size:"small",onClick:()=>{X(!1),V()},color:"secondary",sx:{padding:"10px 20px",marginRight:"10px"},children:"Connect now"}),e(g,{size:"small",onClick:ae,disabled:h,children:"Stay in old version"})]})]})}),n(b,{item:!0,md:6,sm:12,container:!0,justifyContent:"center",alignContent:"center",direction:"column",sx:{margin:"20px 0"},children:[e(u,{style:{fontSize:27,fontWeight:600,paddingLeft:15},children:"New in 3.0"}),n($e,{size:"large",children:[D("More free styling options","Imagine what you can do now"),D("Conversion analytics","Privacy focused conversion analytics"),D("Now available on any platform","Try out on WordPress, Shopify, Wix and more"),D("Manage multiple sites with one account","Great for agencies & businesses with multiple sites"),D("Content Delivery Network (CDN)","Lightning fast around the world \u{1F680}"),D("GDPR-Compliant","Buttonizer is fully GDPR-compliant"),D("And much more!")]})]})]}),e(mr,{open:d,onClose:()=>p(!1),onConfirm:V})]})}function fr(t){switch(t){case"initializing":return"Initializing...";case"skipping":return"Skipping...";case"migrating":return"Migrating data..."}}function H(o){var a=o,{children:t,paperStyle:i}=a,r=je(a,["children","paperStyle"]);return e("div",{style:{margin:"20px 0"},children:e(Ie,q(x({sx:x({"& > *":{marginTop:"20px !important",marginBottom:"20px !important"},"& > *:first-child":{marginTop:"10px !important",marginBottom:"20px !important"}},i),type:"wrapper"},r),{children:t}))})}const yr="_analyticsContainer_1q32b_1",br="_analyticsLoading_1q32b_5",vr="_tabsContainer_1q32b_10",_r="_tabs_1q32b_10",wr="_pieTitle_1q32b_17";var te={analyticsContainer:yr,analyticsLoading:br,tabsContainer:vr,tabs:_r,pieTitle:wr};function Ke(t){for(var i=0,r=0;r<t.length;r++)i=t.charCodeAt(r)+((i<<5)-i);for(var o="#",r=0;r<3;r++){var a=i>>r*8&255;const c="00"+a.toString(16);o+=c.substring(c.length-2,c.length)}return o}const Cr="_legend_17qwt_1",kr="_marginTop_17qwt_5",xr="_legendItem_17qwt_10",zr="_legendColor_17qwt_15",Sr="_legendHidden_17qwt_19",Tr="_legendLabel_17qwt_37",Br="_loading_17qwt_41";var G={legend:Cr,marginTop:kr,legendItem:xr,legendColor:zr,legendHidden:Sr,legendLabel:Tr,loading:Br};function Lr({chart:t=null,isLoading:i=!1,onForceUpdate:r,showClicks:o=!1,isPieChart:a=!1}){if(s.exports.useEffect(()=>{},[]),!t)return null;const l=t.options.plugins.legend.labels.generateLabels(t),c=h=>{var m=h.datasetIndex,d=t;if(a){const p=t.getDatasetMeta(0).data[h.index].hidden;t.getDatasetMeta(0).data[h.index].hidden=!p,t.update()}else d.setDatasetVisibility(m,!d.isDatasetVisible(m)),d.update();r()};return e("div",{className:ie(G.legend,G.marginTop,i&&G.loading),children:l.map((h,m)=>{const d=h.strokeStyle,p=h.hidden;return e(ne,{title:o?`Total clicks this period: ${t.data.datasets[m].totalClicks}`:"",children:n("span",{className:ie(G.legendItem,p&&G.legendHidden),onClick:()=>c(h),children:[e("span",{className:G.legendColor,style:{color:d}}),e("span",{className:G.legendLabel,children:h.text})]})},m)})})}const Ir="_lineChart_hik2f_1",$r="_loading_hik2f_6";var Qe={lineChart:Ir,loading:$r};Ae.register(Pe,Me,Re,De,Ee,Fe,We,Yt);const Xe=["#F08419","#2D95EC"];function Nr(t,i){return t<2?{borderColor:Xe[t],backgroundColor:Xe[t]}:{borderColor:Ke(i),backgroundColor:Ke(i)}}function Ar({data:t}){const{isLoadingAnalytics:i,analyticsChosenRange:r}=w(),[o,a]=s.exports.useState(!0),[l,c]=s.exports.useState(!1),h=s.exports.useRef(null),[,m]=s.exports.useState();return s.exports.useEffect(()=>{h.current&&(l||c(!0))},[o]),n(v,{children:[e("div",{className:ie(Qe.lineChart,i&&Qe.loading),children:e(Vt,{height:400,options:{maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0,min:0,grid:{drawBorder:!1,drawOnChartArea:!0,borderColor:"#ECECEC"},title:{display:!0,text:"Clicks"},ticks:{padding:15,backdropPadding:0}},x:{grid:{drawBorder:!1,drawOnChartArea:!1,borderColor:"#ECECEC"},ticks:{padding:5}}},interaction:{intersect:!1}},ref:h,data:{labels:t.line.labels.map(d=>Jt.unix(d).format(["weekly","monthly"].indexOf(r)>=0?"MMMM Do":"H:mm")),datasets:t.line.datasets.filter(d=>!d.unknown||d.unknown&&!o).map((d,p)=>x({label:d.name,data:d.values,totalClicks:d.totalClicks,tension:.5,pointRadius:5,pointHoverRadius:8},Nr(p,d.id)))}})}),e(Lr,{chart:h.current,onForceUpdate:()=>m({}),isLoading:i,showClicks:!0}),e("div",{style:{paddingTop:15},children:e(Kt,{control:e(Qt,{checked:o,size:"small"}),label:"Hide unknown (or deleted) buttons",onChange:()=>{a(!o),setTimeout(()=>{m({})},1)}})})]})}const Pr="_controls_a553e_1";var Mr={controls:Pr};function Rr(){const{analyticsChosenRange:t,updateAnalyticsByTimeRange:i,isLoadingAnalytics:r}=w(),[o,a]=s.exports.useState(t);return n("div",{className:Mr.controls,children:["Time controls:",n(Xt,{size:"small",style:{verticalAlign:"middle",marginLeft:15},children:[e(Zt,{id:"demo-multiple-name-label",children:"Time range"}),n(en,{labelId:"demo-multiple-name-label",id:"demo-multiple-name",value:o,onChange:l=>{const{target:{value:c}}=l;a(c),i(c)},input:e(tn,{label:"Time range"}),disabled:r,children:[e(ve,{value:"today",children:"Today"},"today"),e(ve,{value:"yesterday",children:"Yesterday"},"yesterday"),e(ve,{value:"weekly",children:"This week (last 7 days)"},"weekly")]})]}),r&&e(Y,{size:25,style:{verticalAlign:"middle",marginLeft:15}})]})}const Dr="_title_zfqz7_1",Er="_cardContainer_zfqz7_5",Fr="_chartContainer_zfqz7_9",Wr="_percentageContainer_zfqz7_14",Or="_percentageColor_zfqz7_17",Hr="_percentage_zfqz7_14",qr="_percentageLabel_zfqz7_28";var S={title:Dr,cardContainer:Er,chartContainer:Fr,percentageContainer:Wr,percentageColor:Or,percentage:Hr,percentageLabel:qr};Ae.register(Pe,Me,Re,De,Ee,Fe,We);function Ur({data:t}){const{isLoadingAnalytics:i}=w(),[r,o]=s.exports.useState(!0),[a,l]=s.exports.useState(!1),c=s.exports.useRef(null);return s.exports.useState(),s.exports.useEffect(()=>{c.current&&(a||l(!0))},[r]),e(v,{children:n("div",{className:ie(S.cardContainer,i&&S.loading),children:[e(u,{variant:"body1",className:S.title,children:"Devices"}),e("div",{className:S.chartContainer,children:e(nn,{options:{cutout:"70%",plugins:{legend:{display:!1}}},data:{labels:["Desktop","Phone","Tablet"],datasets:[{label:"# of clicks",data:[t.devices.desktop,t.devices.phone,t.devices.tablet],backgroundColor:["#F08419","#F4A557","#F7BF87"],borderColor:["#F08419","#F4A557","#F7BF87"],borderWidth:1}]}})}),n(b,{container:!0,style:{padding:"0 13px"},children:[n(b,{item:!0,xs:4,className:S.percentageContainer,children:[e("div",{className:S.percentageColor,style:{backgroundColor:"#f4a557"}}),n(u,{className:S.percentage,children:[Math.round(t.devices.phone/t.total*100),"%"]}),e(u,{className:S.percentageLabel,children:"Mobile"})]}),n(b,{item:!0,xs:4,className:S.percentageContainer,children:[e("div",{className:S.percentageColor,style:{backgroundColor:"#F08419"}}),n(u,{className:S.percentage,children:[Math.round(t.devices.desktop/t.total*100),"%"]}),e(u,{className:S.percentageLabel,children:"Desktop"})]}),n(b,{item:!0,xs:4,className:S.percentageContainer,children:[e("div",{className:S.percentageColor,style:{backgroundColor:"#F7BF87"}}),n(u,{className:S.percentage,children:[Math.round(t.devices.tablet/t.total*100),"%"]}),e(u,{className:S.percentageLabel,children:"Tablet"})]})]})]})})}const Gr="_title_va1ni_1",jr="_gridHeight_va1ni_5",Yr="_barHeight_va1ni_12";var ke={title:Gr,gridHeight:jr,barHeight:Yr};Ae.register(Pe,Me,Re,De,rn,Ee,Fe,We);function Vr({data:t,siteInfo:i}){w();const[r,o]=s.exports.useState(!0),[a,l]=s.exports.useState(!1),c=s.exports.useRef(null);s.exports.useState(),s.exports.useEffect(()=>{c.current&&(a||l(!0))},[r]);const h=t&&t.countries.list.sort((d,p)=>{const y=t.countries.data[t.countries.list.indexOf(d)];return t.countries.data[t.countries.list.indexOf(p)]-y}).slice(0,5),m=t.countries.data.sort((d,p)=>p-d).slice(0,5);return n(v,{children:[n(b,{container:!0,children:[e(b,{item:!0,md:6,children:e(u,{variant:"body1",className:ke.title,children:"Countries"})}),e(b,{item:!0,md:6,style:{textAlign:"right"},children:e(g,{startIcon:e(on,{}),href:N(`/analytics/${i.id}`),target:"_blank",children:"View worldmap"})})]}),e("div",{className:ke.gridHeight,children:e("div",{className:ke.barHeight,children:e(an,{width:400,options:{maintainAspectRatio:!1,barThickness:22,indexAxis:"y",plugins:{legend:{display:!1}},scales:{y:{grid:{display:!1}},x:{ticks:{callback:function(d){return d+"%"}}}}},data:{labels:h.map(d=>sn[d.toUpperCase()].name),datasets:[{axis:"y",label:"% of total clicks",data:m.map(d=>Math.round(d/t.total*100)),backgroundColor:["#F08419"],borderColor:["#F08419"]}]}})})})]})}const Jr="_styledContainer_u39ug_1",Kr="_paragraph_u39ug_8",Qr="_button_u39ug_14";var xe={styledContainer:Jr,paragraph:Kr,button:Qr};function Xr({siteInfo:t}){return n("div",{className:xe.styledContainer,children:[e(u,{variant:"body1",color:"primary",className:xe.paragraph,children:"Dive deeper into your Buttonizer Analytics"}),e(g,{variant:"contained",color:"primary",startIcon:e(ln,{}),href:N(`/analytics/${t.id}`),target:"_blank",className:xe.button,children:"Open analytics dashboard"})]})}function Zr(){const{siteInfo:t,getAnalytics:i,analyticsData:r,isLoadingAnalytics:o}=w();return s.exports.useEffect(()=>{i()},[]),n(H,{className:te.analytics,children:[n("div",{className:te.tabsContainer,children:[n(cn,{value:0,className:te.tabs,children:[e(Ve,{value:0,icon:e(dn,{}),iconPosition:"start",label:e(v,{children:"Button clicks"}),size:"small"}),e(Ve,{value:1,icon:e(he,{size:"small",label:"Coming soon"}),iconPosition:"end",label:"Conversions",size:"small",disabled:!0})]}),e(Rr,{}),e("div",{children:e(ne,{title:"How do analytics work",placement:"left",children:e(Le,{href:"https://community.buttonizer.pro/knowledgebase/1280",target:"_blank",size:"small",children:e(at,{})})})})]}),n("div",{className:r&&r.line.datasets.length>=1&&te.analyticsContainer,children:[o&&r===null&&e("div",{className:te.analyticsLoading,children:e(Y,{size:50})}),!o&&!r&&e(re,{severity:"warning",children:"Woops, something went wrong loading analytics of your site."}),r&&r.line.datasets.length>=1&&n(v,{children:[e(Ar,{data:r,loading:o}),n(b,{container:!0,spacing:3,style:{marginTop:0},children:[e(b,{item:!0,style:{maxWidth:365},children:e(Ur,{data:r,loading:o})}),e(b,{item:!0,md:!0,children:e(Vr,{data:r,siteInfo:t,loading:o})})]})]}),r&&r.line.datasets.length===0&&n(re,{severity:"info",icon:e(un,{}),style:{marginTop:15},children:[e(K,{children:"Waiting for data..."}),n("div",{children:[e(u,{variant:"body1",fontSize:15,children:"Currently we don't have any click data to show you. As soon someone clicked one of your buttons, analytics will become visible here."}),e(u,{variant:"body1",fontSize:15,style:{marginTop:15},children:"Check back later \u{1F680}"})]})]})]}),e(Xr,{siteInfo:t})]})}function ei(){const{siteInfo:t,startSession:i,sessionStarting:r}=w();return n(v,{children:[n(H,{children:[e(u,{type:"header",color:"primary",children:"Manage your Buttonizer instance"}),e(u,{type:"body1",color:"primary",children:"Welcome to your Buttonizer for WordPress dashboard. Here are a few quick-tools to manage your Buttonizer."}),e(g,{variant:"outlined",onClick:i,endIcon:r&&e(Y,{size:20,style:{marginLeft:8}}),disabled:r,children:"Edit buttons"})]}),e(Zr,{})]})}const ti=s.exports.forwardRef(function(i,r){return e(pe,x({direction:"up",ref:r},i))});function ni({open:t,onClose:i=()=>{}}){var h;const{setActionLock:r}=w(),[o,a]=s.exports.useState(!1),l=()=>{o||i()},c=()=>{o||(a(!0),P("/disconnect").then(({data:m})=>{r("setup"),i()}).catch(()=>a(!1)))};return n(me,{open:t,onClose:l,TransitionComponent:ti,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e(ge,{id:"alert-dialog-title",children:"Are you sure you want to disconnect?"}),n(fe,{children:[n(Q,{id:"alert-dialog-description",children:["You will disconnect your Buttonizer instance from your site"," ",e("b",{children:(h=buttonizer_admin==null?void 0:buttonizer_admin.site)==null?void 0:h.domain}),". You will be able to sign in with another account."]}),e(Q,{id:"alert-dialog-description-p2",style:{marginTop:15},children:"Are you sure you want to disconnect?"})]}),n(ye,{children:[e(g,{disabled:o,onClick:l,children:"Cancel"}),e(g,{disabled:o,color:"secondary",onClick:c,autoFocus:!0,children:"Disconnect"})]})]})}function ri(){const[t,i]=s.exports.useState(!1);return n(v,{children:[n(H,{children:[e(u,{type:"header",color:"primary",children:"Disconnect Buttonizer"}),e(u,{variant:"body1",color:"primary",children:"Did you create a new instance or do you want to sign in with a different account? Disconnect Buttonizer from your WordPress site."}),e(g,{variant:"outlined",onClick:()=>i(!0),children:"Disconnect"})]}),e(ni,{open:t,onClose:()=>i(!1)})]})}const ii="_table_13k7q_1";var Ze={table:ii};function oi(){const{parseAccountData:t,isPremium:i,accountData:r,siteInfo:o,planInfo:a}=w(),[l,c]=s.exports.useState(!1),[h,m]=s.exports.useState(!1),d=()=>{l||(c(!0),P("/sync").then(({data:y})=>{t(y.data),m(!0),setTimeout(()=>{m(!1)},5e3)}).catch(()=>{}).then(()=>c(!1)))},p=()=>i?e(he,{label:"PRO",color:"secondary"}):e(he,{label:"FREE"});return n(H,{children:[n(b,{container:!0,children:[e(b,{item:!0,md:6,children:n("table",{className:Ze.table,children:[e("tr",{colspan:"2",children:e("th",{children:e(u,{variant:"body1",color:"primary",style:{fontWeight:600},children:"Site information:"})})}),n("tr",{children:[e("td",{children:e(u,{variant:"body2",color:"primary",children:"Account name:"})}),e("td",{children:e(u,{variant:"body2",color:"primary",children:r.name})})]}),n("tr",{children:[e("td",{children:e(u,{variant:"body2",color:"primary",children:"Site ID:"})}),e("td",{children:e(u,{variant:"body2",color:"primary",children:o.id})})]}),n("tr",{children:[e("td",{children:e(u,{variant:"body2",color:"primary",children:"Timezone:"})}),e("td",{children:n(u,{variant:"body2",color:"primary",children:[o.timezone," (",e(L,{href:N(`/sites/${o.id}/settings`),target:"_blank",color:"secondary",children:"Change"}),")"]})})]})]})}),e(b,{item:!0,md:6,children:n("table",{className:Ze.table,children:[e("tr",{colspan:"2",children:e("th",{children:e(u,{variant:"body1",color:"primary",style:{fontWeight:600},children:"License information:"})})}),n("tr",{children:[e("td",{children:e(u,{variant:"body2",color:"primary",children:"Plan:"})}),e("td",{children:n(u,{variant:"body2",color:"primary",children:[a.name," (",e(L,{href:N(`/sites/${o.id}/plan`),target:"_blank",color:"secondary",children:"Change"}),")"]})})]}),a.hasPlan&&n(v,{children:[n("tr",{children:[e("td",{children:e(u,{variant:"body2",color:"primary",children:"Subscription status:"})}),e("td",{children:e(u,{variant:"body2",color:"primary",children:a.cancelled?"Cancelled":"Active"})})]}),n("tr",{children:[e("td",{children:e(u,{variant:"body2",color:"primary",children:"License status:"})}),e("td",{children:p()})]})]})]})})]}),e(u,{variant:"body2",color:"primary",children:"Did you change a button or account information in the Buttonizer dashboard and do not see the changes in the Buttonizer for WordPress plugin?"}),e(u,{variant:"body2",color:"primary",children:"Click the sync button below to retrieve the data from the Buttonizer dashboard."}),n(b,{container:!0,justifyContent:"space-between",children:[e(g,{variant:"outlined",onClick:d,disabled:l||h,endIcon:l&&e(Y,{size:20,style:{marginLeft:8}})||h&&e(Ne,{}),children:"Sync with dashboard"}),e(g,{color:"secondary",endIcon:e(J,{}),href:N(`/sites/${o.id}`),target:"_blank",type:"link",children:"View more site info"})]})]})}const ai=s.exports.forwardRef(function(i,r){return e(pe,x({direction:"up",ref:r},i))});function si({open:t,onClose:i=()=>{}}){const{setHasMigrated:r,setLegacyBackupDeleted:o}=w(),[a,l]=s.exports.useState(!1),c=()=>{a||i()};return n(me,{open:t,onClose:c,TransitionComponent:ai,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e(ge,{id:"alert-dialog-title",children:"Happy with the upgrade?"}),e(fe,{children:e(Q,{id:"alert-dialog-description",children:"Are you satiesfied with the 3.0 update? If so then you can remove the old Buttonizer data to clean up unused data in your database."})}),n(ye,{children:[e(g,{disabled:a,onClick:c,children:"Cancel"}),e(g,{disabled:a,color:"secondary",onClick:()=>{a||(l(!0),P("/delete_legacy_backup").then(()=>{o(!0),r(!1),i()}).catch(()=>l(!1)))},autoFocus:!0,children:"Confirm"})]})]})}const li=s.exports.forwardRef(function(i,r){return e(pe,x({direction:"up",ref:r},i))});function ci({open:t,onClose:i=()=>{}}){const[r,o]=s.exports.useState(!1),a=()=>{r||i()},l=()=>{r||(o(!0),P("/revert_legacy").then(()=>{document.location.href=`${buttonizer_admin.admin}?page=Buttonizer`}).catch(()=>o(!1)))};return r&&t?n(hn,{open:t,sx:{background:"#f0f0f1"},children:[e(pn,{styles:{body:{overflow:"hidden"}}}),e(be,{text:"Reverting..."})]}):n(me,{open:t,onClose:a,TransitionComponent:li,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e(ge,{id:"alert-dialog-title",children:"Go back Buttonizer version 2.x"}),e(fe,{children:n(Q,{id:"alert-dialog-description",children:["Don't like the changes in the 3.0 update? Did you perhaps encounter any issues or have any feedback? Please let us know so that we may improve it in the future."," ",e(L,{color:"secondary",href:"mailto:contact@buttonizer.pro",children:"contact@buttonizer.pro"})]})}),n(ye,{children:[e(g,{disabled:r,onClick:a,children:"Cancel"}),e(g,{disabled:r,color:"secondary",onClick:l,autoFocus:!0,children:"I am sure"})]})]})}function di(){const[t,i]=s.exports.useState(!1),[r,o]=s.exports.useState(!1);return n(v,{children:[n(H,{children:[e(u,{type:"header",color:"primary",children:"Remove unused 2.x data"}),e(u,{variant:"body1",color:"primary",children:"Remove the old Buttonizer data in your database."}),e(g,{variant:"outlined",onClick:()=>i(!0),children:"Remove 2.x data"}),e(u,{type:"header",color:"primary",children:"Go back to Buttonizer version 2.x"}),e(u,{variant:"body1",color:"primary",children:"Don't like the changes in the new version?"}),e(g,{variant:"outlined",onClick:()=>o(!0),children:"Return to 2.x"})]}),e(si,{open:t,onClose:()=>i(!1)}),e(ci,{open:r,onClose:()=>o(!1)})]})}const ui="_listItem_8c466_1",hi="_selectContainer_8c466_5";var et={listItem:ui,selectContainer:hi};function pi(t,i){const r=[];return t||(t=[]),i.forEach(o=>{(t.indexOf(o.id)!==-1||o.id==="administrator")&&r.push(o)}),r}function mi({additionalPermissions:t,setAdditionalPermissions:i,saving:r=!1}){const o=window.buttonizer_admin.available_roles,[a,l]=s.exports.useState(pi(t,o)),[c,h]=s.exports.useState(!1),m=d=>{const p=[];d.forEach(y=>{y.id!=="administrator"&&p.push(y.id)}),i(p)};return n(j,{disableGutters:!0,className:et.listItem,children:[e(F,{children:e(mn,{})}),e(A,{primary:"Permissions",secondary:"You can grant more roles to access the Buttonizer settings who are not an administrator."}),e("div",{className:et.selectContainer,children:e(gn,{multiple:!0,size:"small",disableCloseOnSelect:!0,disableClearable:!0,options:o.filter(d=>d.id!=="guest"),filterSelectedOptions:!0,getOptionLabel:d=>d.name,value:a,style:{marginTop:10},fullWidth:!0,onOpen:()=>h(!0),onClose:()=>{h(!1),m(a)},loading:r,onChange:(d,p)=>{p.length!=0&&(l(p),c||m(p))},renderTags:(d,p)=>d.map((y,_)=>e(he,q(x({label:y.name},p({index:_})),{disabled:y.id==="administrator"}))),noOptionsText:"Role not found",renderInput:d=>e(fn,q(x({},d),{variant:"outlined",label:"Select roles",placeholder:"Select one or more items",disabled:r,InputProps:q(x({},d.InputProps),{"data-testid":"pagerule:autocomplete-input"}),helperText:e(L,{href:"https://community.buttonizer.pro/knowledgebase/507",target:"_blank",children:"Need help? Learn how to use Permissions."})}))})})]})}function gi(){const[t,i]=s.exports.useState(window.buttonizer_admin.settings),[r,o]=s.exports.useState(!1),[a,l]=s.exports.useState(!1),[c,h]=s.exports.useState(window.buttonizer_admin.settings.adminTopBarButtonEnabled),[m,d]=s.exports.useState(window.buttonizer_admin.settings.canSendErrors),[p,y]=s.exports.useState(window.buttonizer_admin.settings.waitUntilConsent),[_,M]=s.exports.useState(window.buttonizer_admin.settings.accessRoles),[z,I]=s.exports.useState(window.buttonizer_admin.settings.googleAnalytics),B=()=>{a||(l(!0),P("/settings",{data:{admin_top_bar_show_button:c,can_send_errors:m,additional_permissions:_,google_analytics:z,wait_until_consent:p}}).then(()=>{}).catch(()=>{}).then(()=>{const k={adminTopBarButtonEnabled:c,canSendErrors:m,accessRoles:_,waitUntilConsent:p,googleAnalytics:z==="unset"?null:z};i(k),window.buttonizer_admin.settings=k,o(!1),l(!1)}))};return s.exports.useEffect(()=>{o(t.adminTopBarButtonEnabled!==c||t.canSendErrors!==m||t.waitUntilConsent!==p||t.accessRoles!==_||t.googleAnalytics!==z)},[c,m,p,_,z]),n(H,{children:[e(u,{type:"header",color:"primary",children:"Preferences"}),n($e,{disablePadding:!0,dense:!0,children:[n(j,{disableGutters:!0,children:[e(F,{children:e(yn,{})}),e(A,{primary:"Show admin top bar",secondary:"Hide Buttonizer in the admin top bar by disabling this setting.",onClick:()=>{a||h(!c)}}),e(_e,{edge:"end",color:"primary",checked:c,onChange:k=>h(k.target.checked),disabled:a})]}),n(j,{disableGutters:!0,children:[e(F,{children:e(bn,{})}),e(A,{primary:"Automatic error logging and crash reporting",secondary:"Enable automatic error logging and crash reporting in order to help us solve issues within Buttonizer! All data is anonymized automatically.",onClick:()=>{a||d(!m)}}),e(_e,{edge:"end",color:"primary",checked:m,onChange:k=>d(k.target.checked),disabled:a})]}),n(j,{disableGutters:!0,children:[e(F,{children:e(vn,{})}),e(A,{primary:"GPDR: Wait on consent",secondary:n(v,{children:[e("div",{style:{marginBottom:5},children:"Buttonizer is fully GDPR-compliant. When you enable this setting, Buttonizer-scripts will not load until a JavaScript function is called."}),e(L,{href:"https://community.buttonizer.pro/knowledgebase/1426",target:"_blank",children:"Read how to setup"})," ","or"," ",e(L,{href:"https://buttonizer.pro/gdpr/",target:"_blank",children:"how we comply with GDPR-laws"}),"."]})}),e(_e,{edge:"end",color:"primary",checked:p,onChange:k=>y(k.target.checked),disabled:a})]}),e(mi,{saving:a,additionalPermissions:_,setAdditionalPermissions:M}),t.googleAnalytics&&n(j,{disableGutters:!0,children:[e(F,{children:e(_n,{})}),e(A,{primary:"Deprecated: Add Google Analytics tracking code",secondary:`Previously you were able to add Google Analytics tracking code via Buttonizer, ${t.googleAnalytics} is the current value. We will still add the shortcode until you found an alternative way.`,onClick:()=>{(!a||z!=="unset")&&I("unset")}}),e(g,{onClick:()=>I("unset"),disabled:a||z==="unset",style:{marginTop:15,minWidth:"fit-content"},children:"Remove Google Analytics"})]}),e(g,{variant:"contained",onClick:B,disabled:!r||a,endIcon:a&&e(Y,{size:20,style:{marginLeft:8}}),style:{marginTop:15},children:"Save changes"})]})]})}function fi(){const{setLegacyBackupDeleted:t}=w();return n(re,{severity:"success",variant:"outlined",action:e(Le,{"aria-label":"close",color:"inherit",size:"small",onClick:()=>{t(!1)},children:e(ot,{fontSize:"inherit"})}),style:{marginTop:15,background:"#edf7ed"},children:[e(K,{children:"You have deleted your old data."}),"Have fun with the new version of Buttonizer! :)"]})}function yi(){const{hasMigrated:t,legacyBackupDeleted:i}=w();return n(v,{children:[e(gi,{}),e(oi,{}),e(ri,{}),t&&window.buttonizer_admin.isAdmin==="1"&&e(di,{}),i&&e(fi,{})]})}const bi="_avatar_yq9q0_1",vi="_listItem_yq9q0_5",_i="_secondaryInfo_yq9q0_9";var ze={avatar:bi,listItem:vi,secondaryInfo:_i};function wi(){const t=oe(),{parseAccountData:i,setConnectionSuccessfull:r,setActionLock:o}=w(),[a,l]=s.exports.useState(!1);if(a)return e(be,{text:"Connecting..."});const c=(h,m)=>n(j,{className:ze.listItem,children:[e(st,{children:e(lt,{className:ze.avatar,children:e(Ne,{})})}),e(A,{secondary:m,secondaryTypographyProps:{className:ze.secondaryInfo},primary:h})]});return n(v,{children:[e(mt,{children:n(b,{container:!0,style:{height:"100%"},direction:"row",children:[e(b,{item:!0,container:!0,justifyContent:"center",direction:"column",alignContent:"center",md:6,sm:12,sx:{margin:"20px 0"},children:n("div",{children:[e("img",{src:`${buttonizer_admin.assetsPath}/images/buttonizer-logo.png`,alt:"buttonizerlogo",style:{height:50}}),e(u,{style:{fontSize:27,fontWeight:600,marginTop:30},children:"Buttonizer has been installed,"}),e(u,{style:{fontSize:25},children:"you are ready to make some buttons!"}),n("div",{style:{marginTop:30,maxWidth:300},children:[e(ht,{buttonProps:{variant:"contained",size:"large",color:"secondary",endIcon:e(J,{}),sx:{padding:"15px 30px"}},buttonText:"Start using Buttonizer",onConnect:h=>{l(!1),o("no-lock"),i(h.data),r(!0),t("/")},onLoading:h=>l(h)}),e(u,{style:{fontSize:15,marginTop:20,marginBottom:60},children:"Go to your dashboard to create, manage and edit your buttons."})]})]})}),n(b,{container:!0,justifyContent:"center",alignContent:"center",direction:"column",item:!0,md:6,sm:12,sx:{margin:"20px 0"},children:[e(u,{style:{fontSize:27,fontWeight:600},children:"This is Buttonizer"}),n($e,{size:"large",children:[c("Widgets","WhatsApp, Messenger and contact form"),c("Navigate with URL"),c("Open pop up"),c("Social media sharing"),c("Fully customizable","Style your floating content"),c("Over 40+ actions","And much more")]})]})]})}),e(pt,{})]})}const Ci="_helpContainer_jsvok_1",ki="_cardButton_jsvok_5",xi="_helpContainerText_jsvok_33";var ue={helpContainer:Ci,cardButton:ki,helpContainerText:xi};function zi(){const t=({imgSrc:i,href:r,title:o,description:a,button:l="Learn more"})=>e(wn,{children:e(Cn,{href:`${r}?utm_source=wp-plugin-support`,type:"link",target:"_blank",className:ue.cardButton,children:n(kn,{className:ue.cardContent,children:[e("img",{src:i,alt:"Knowledge base",draggable:!1}),e(u,{variant:"h5",children:o}),e(u,{className:ue.helpContainerText,color:"textSecondary",component:"div",children:a}),e(g,{endIcon:e(xn,{}),color:"secondary",children:l})]})})});return n("div",{children:[n(H,{children:[e(u,{color:"primary",type:"header",children:"Need some help?"}),e(u,{type:"content",color:"primary",children:"Do you need some help? We can help you with everything! Check out our Buttonizer Community, knowledge base or we can help you with our support."})]}),n("div",{className:ue.helpContainer,children:[e(t,{imgSrc:`${buttonizer_admin.assetsPath}/images/support/knowledge-base.svg`,title:"Knowledge base",description:"Learn how to use our application like a pro",href:"https://r.buttonizer.io/support/knowledgebase"}),e(t,{imgSrc:`${buttonizer_admin.assetsPath}/images/support/community.svg`,title:"Forums",description:"Give and Get help from your peers and our team",href:"https://r.buttonizer.io/support/community"}),e(t,{imgSrc:`${buttonizer_admin.assetsPath}/images/support/tickets.svg`,title:"Tickets",description:"Need support that requires privacy? Submit a private ticket",href:"https://r.buttonizer.io/support/tickets"})]})]})}function Si(){return n(H,{children:[e(u,{type:"header",color:"primary",children:"Oh no! Page not found :("}),n(u,{type:"body1",color:"primary",children:["Sorry about that. If we linked to something wrong in our plugin, please let us know by giving us feedback"," ",e(L,{href:"https://community.buttonizer.pro/",target:"_blank",color:"secondary",children:"on our Buttonizer Community!"})]}),e(g,{component:zn,to:"/",variant:"outlined",type:"link",children:"Back to overview"})]})}const Ti={blogs:"wp/v2/posts?_fields[]=title&_fields[]=id",pages:"wp/v2/pages?_fields[]=title&_fields[]=id",categories:"wp/v2/categories?_fields[]=name&_fields[]=id"};function Bi(t,i){if(t==="roles"){i(window.buttonizer_admin.available_roles);return}return Se({url:`${buttonizer_admin.api}${Ti[t]}&per_page=100`,method:"GET",headers:{"X-WP-Nonce":buttonizer_admin.nonce}}).then(({data:r})=>{i(r.map(({id:o,title:a,name:l=null})=>{var c;return{id:o,name:(c=a==null?void 0:a.rendered)!=null?c:l}}))}).catch(()=>{})}const Li="_iframe_13azj_1";var Ii={iframe:Li};const tt=(t,i,r,o={})=>{t.contentWindow.postMessage({eventType:"buttonizer",messageType:r,message:o},i)};function nt(){const t=oe(),i=s.exports.useRef(),{cachedEditorSession:r,setCachedEditorSession:o,sessionStarting:a,startSession:l}=w();return s.exports.useEffect(()=>{r===null&&!a&&l()},[r]),s.exports.useEffect(()=>{const c=({data:h,origin:m})=>{const{eventType:d,messageType:p,message:y}=h;d==="buttonizer"&&(p==="connection"&&y==="ready"&&tt(i.current,m,"platform","wordpress"),p==="close_editor"&&t("/"),p==="request_data"&&Bi(y,_=>{tt(i.current,m,`reply_${y}`,_)}))};return window.addEventListener("message",c,!1),()=>{window.removeEventListener("message",c),o(null)}},[]),!r||a?e(be,{text:"Starting editor session..."}):e("iframe",{src:Rn(r),className:Ii.iframe,ref:i,referrerPolicy:"origin"})}function $i(){const{actionLock:t}=w();return t==="editor"?e(nt,{}):t==="migration"?e(gr,{}):t==="setup"?e(wi,{}):e(Sn,{children:n(U,{path:"/",element:e(rr,{}),children:[e(U,{path:"/",element:e(Tn,{to:"/overview",replace:!0})}),e(U,{path:"/overview",element:e(ei,{})}),e(U,{path:"/settings",element:e(yi,{})}),e(U,{path:"/support",element:e(zi,{})}),e(U,{path:"/editor",element:e(nt,{})}),e(U,{path:"*",element:e(Si,{})})]})})}const Ni="https://84c09e1dec414d9aa9a7663511fb3027@tracker.buttonizer.pro/7",Ai={}.VITE_APP_VERSION;Bn({dsn:Ni,integrations:[new Ln],release:Ai,environment:"development",tracesSampleRate:1,beforeSend:t=>{var i;return(i=buttonizer_admin==null?void 0:buttonizer_admin.settings)!=null&&i.canSendErrors?t:null}});In.createRoot(document.getElementById("root")).render(e($n,{injectFirst:!0,children:e(it,{theme:ct,children:e(En,{children:e($i,{})})})}));
 
 
 
assets/app/index.fe8002a5.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ var kt=Object.defineProperty,zt=Object.defineProperties;var xt=Object.getOwnPropertyDescriptors;var ce=Object.getOwnPropertySymbols;var qe=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable;var Ue=(t,i,r)=>i in t?kt(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r,z=(t,i)=>{for(var r in i||(i={}))qe.call(i,r)&&Ue(t,r,i[r]);if(ce)for(var r of ce(i))Ge.call(i,r)&&Ue(t,r,i[r]);return t},U=(t,i)=>zt(t,xt(i));var je=(t,i)=>{var r={};for(var o in t)qe.call(t,o)&&i.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&ce)for(var o of ce(t))i.indexOf(o)<0&&Ge.call(t,o)&&(r[o]=t[o]);return r};import{c as ot,a as Ye,b as Se,R as Te,u as oe,r as s,j as e,d as n,J as St,e as Be,F as v,L as Tt,C as Y,B as g,E as Bt,T as at,S as It,H as Lt,A as re,I as Ie,f as st,g as K,h,i as $t,k as Nt,l as I,m as At,n as Pt,P as Le,G as b,o as Rt,p as Mt,q as Dt,M as Et,s as de,t as ie,v as F,w as Ft,x as A,y as Wt,z as J,D as Ot,K as Ht,N as Ut,O as ne,Q as qt,U as Gt,V as jt,W as Yt,X as Vt,Y as pe,Z as me,_ as ge,$ as fe,a0 as Q,a1 as ye,a2 as lt,a3 as $e,a4 as j,a5 as ct,a6 as dt,a7 as Ne,a8 as Ae,a9 as Pe,aa as Re,ab as Me,ac as De,ad as Ee,ae as Fe,af as We,ag as Jt,ah as Kt,ai as Qt,aj as Xt,ak as Zt,al as en,am as tn,an as nn,ao as rn,ap as ve,aq as on,ar as an,as as sn,at as ln,au as cn,av as dn,aw as un,ax as Ve,ay as hn,az as he,aA as pn,aB as mn,aC as gn,aD as fn,aE as yn,aF as bn,aG as vn,aH as _e,aI as _n,aJ as wn,aK as Cn,aL as kn,aM as zn,aN as xn,aO as Sn,aP as Tn,aQ as Bn,aR as q,aS as In,aT as Ln,aU as $n,aV as Nn,aW as An}from"./vendor.9a5cb22f.js";const Pn=function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function r(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerpolicy&&(l.referrerPolicy=a.referrerpolicy),a.crossorigin==="use-credentials"?l.credentials="include":a.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(a){if(a.ep)return;a.ep=!0;const l=r(a);fetch(a.href,l)}};Pn();let T=ot({palette:{primary:{main:"#2D7789",contrastText:"#FFFFFF"},secondary:{main:"#f08419",contrastText:"#FFFFFF"},white:{main:"#FFFFFF",contrastText:"#2D7789"},black:{main:"#111111",contrastText:"#2D7789"}},typography:{fontFamily:["BlinkMacSystemFont","Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue","sans-serif"].join(",")},breakpoints:{values:{xs:0,sm:600,md:900,lg:1200,xl:1536,navigation:1090}}});T=ot(T,{components:{MuiListItemButton:{styleOverrides:{root:{"&.Mui-selected":{color:T.palette.secondary.main,backgroundColor:Ye(T.palette.secondary.main,.08),"&:hover":{backgroundColor:Ye(T.palette.secondary.main,.12)},"& .MuiListItemIcon-root":{color:T.palette.secondary.main}}}}},MuiLink:{styleOverrides:{root:{textDecoration:"none","&:hover":{textDecoration:"underline"}}}},MuiButton:{styleOverrides:{root:{borderRadius:50,padding:"8px 18px"}},variants:[{props:{type:"link"},style:({ownerState:t})=>z({},t.variant==="contained"?{color:T.palette[t.color].contrastText,"&:focus":{outline:"unset",boxShadow:"unset",color:T.palette[t.color].contrastText},"&:hover":{color:T.palette[t.color].contrastText}}:{color:T.palette[t.color].main,"&:focus":{outline:"unset",boxShadow:"unset",color:T.palette[t.color].main},"&:hover":{color:T.palette[t.color].main}})},{props:{type:"link-small"},style:{padding:"5px 5px",textTransform:"none",minWidth:35,color:T.palette.primary.main,"&:focus":{outline:"unset",boxShadow:"unset",color:T.palette.primary.main},"&:hover":{color:T.palette.primary.main}}}]},MuiPaper:{styleOverrides:{root:{borderRadius:10,position:"relative"}},variants:[{props:{type:"wrapper"},style:{padding:"15px 30px"}}]},MuiTypography:{variants:[{props:{type:"header"},style:{fontSize:"1rem",fontWeight:600}},{props:{type:"content"},style:{fontSize:"1em"}}]},MuiTab:{variants:[{props:{size:"small"},style:{textTransform:"unset",minHeight:42}}]},MuiList:{variants:[{props:{size:"large"},style:{"& .MuiListItem-root":{padding:"5px 16px"},"& .MuiAvatar-root":{width:30,height:30},"& .MuiTypography-root":{fontSize:"1.2rem"}}}]}}});var ut=T;function P(t,i={},r="POST"){let o=`${buttonizer_admin.api}buttonizer${t}?nonce=${buttonizer_admin.nonce}`;return buttonizer_admin.isPlain==!0&&(o=buttonizer_admin.api.slice(0,-1)+encodeURIComponent(`/buttonizer${t}`)+`&nonce=${buttonizer_admin.nonce}`),Se({url:o,method:r,data:i,headers:{"X-WP-Nonce":buttonizer_admin.nonce}})}const ht=Te.createContext(),Rn=t=>{const i=oe(),[r,o]=s.exports.useState("no-lock"),[a,l]=s.exports.useState(!1),[c,d]=s.exports.useState(!1),[m,u]=s.exports.useState(!1),[p,y]=s.exports.useState(!1),[_,R]=s.exports.useState({}),[x,L]=s.exports.useState({}),[B,k]=s.exports.useState({}),[X,W]=s.exports.useState(!1);s.exports.useState(null);const[V,ae]=s.exports.useState(null),[D,M]=s.exports.useState(!1),[$,se]=s.exports.useState(null),[le,yt]=s.exports.useState("weekly"),Oe=f=>{R({name:f==null?void 0:f.name,id:f==null?void 0:f.uid}),L({id:f==null?void 0:f.site_id,timezone:f==null?void 0:f.site_timezone,isPremium:f==null?void 0:f.site_licensed}),k({name:f==null?void 0:f.plan_name,id:f==null?void 0:f.plan_id,hasPlan:(f==null?void 0:f.plan_id)!==null,cancelled:f==null?void 0:f.plan_cancelled})},bt=()=>{X||(V!==null&&i("/editor"),W(!0),P("/editor_start_session").then(({data:f})=>{ae(f),i("/editor")}).catch(()=>{}).then(()=>W(!1)))},vt=()=>{$===null&&He()},He=(f=null)=>{f||(f=le),M(!0),P("/analytics/overview",{type:f}).then(({data:Ct})=>{se(Ct.data),yt(f)}).catch(()=>{}).then(()=>M(!1))};s.exports.useEffect(()=>{o(window.buttonizer_admin.actionLock),l(!!window.buttonizer_admin.hasMigrated),u(!!window.buttonizer_admin.requestReview),Oe(window.buttonizer_admin.account)},[]);const _t={actionLock:r,hasMigrated:a,legacyBackupDeleted:c,connectionSuccesfull:p,isPremium:x.isPremium,accountData:_,siteInfo:x,planInfo:B,sessionStarting:X,cachedEditorSession:V,requestReview:m,isLoadingAnalytics:D,analyticsData:$,analyticsChosenRange:le},wt={setActionLock:o,setHasMigrated:l,setLegacyBackupDeleted:d,parseAccountData:Oe,setConnectionSuccessfull:y,setCachedEditorSession:ae,setRequestReview:u,startSession:bt,getAnalytics:vt,updateAnalyticsByTimeRange:He};return e(ht.Provider,z({value:z(z({},_t),wt)},t))},w=()=>{const t=Te.useContext(ht);if(t===void 0)throw new Error("useApp must be used within a AppProvider");return t},Mn="https://app.buttonizer.io",Dn="https://editor.buttonizer.io/site/";function N(t="/"){return Mn+t}function En(t){const i=`?language=${buttonizer_admin.locale}`;return`${Dn}${t.redirect_id}${i}#auth-token=${t.token}`}function be({text:t="Loading..."}){return n("div",{className:"buzzy-animation",children:[e("img",{src:`${buttonizer_admin.assetsPath}/images/icon-animated.svg`})," ",e("span",{children:t})]})}const pt=new St;let we=null,E=null;function mt({buttonProps:t,buttonText:i="Connect",onConnect:r,onLoading:o=()=>{},reconnect:a=!1}){const{enqueueSnackbar:l,closeSnackbar:c}=Be(),[d,m]=s.exports.useState(!1),[u,p]=s.exports.useState(!1),[y,_]=s.exports.useState(!1),R=buttonizer_admin.site,x=()=>{if(d&&E){E.focus();return}m(!0),p(!1);const L=N(`/apps/onboard?app_origin=wordpress&site_name=${encodeURIComponent(R.name)}&domain=${encodeURIComponent(R.domain)}&email=${encodeURIComponent(R.user.email)}&first_name=${encodeURIComponent(R.user.firstName)}&last_name=${encodeURIComponent(R.user.lastName)}`);E=window.open(L,"connectPopup",`width=500,height=580,top=${window.innerHeight/2-580/2},left=${window.innerWidth/2-500/2},status=no,scrollbars=yes,resizable=no`);try{E.focus()}catch{l("Could not open authorization popup. Your browser might have blocked it. Please add this site to your exception list.",{anchorOrigin:{vertical:"bottom",horizontal:"center",autoHideDuration:1e4},action:k=>[e(g,{href:"https://community.buttonizer.pro/knowledgebase/1208",target:"_blank",color:"secondary",children:"More information"}),e(g,{onClick:()=>c(k),children:"Close"})]})}we=setInterval(()=>{if(!E){clearInterval(we);return}E.closed&&(clearInterval(we),E=null,m(!1))})};return s.exports.useEffect(()=>{const L=B=>{!B.isTrusted||B.origin!==N("")||B.data.messageType==="connect-info"&&(E&&E.close(),_(!0),o(!0),P("/connect",{siteId:B.data.id,authorization:B.data.authorization,reconnect:a}).then(({data:k})=>{pt.addConfetti(),r(k)}).catch(()=>{_(!1),o(!1),p(!0)}))};return window.addEventListener("message",L),function(){window.removeEventListener("message",L)}},[]),e(v,{children:e(Tt,U(z({onClick:x,loading:y,loadingIndicator:e(Y,{size:20,style:{color:"white"}})},t),{children:i}))})}function Fn({children:t}){const{parseAccountData:i,setConnectionSuccessfull:r}=w(),{enqueueSnackbar:o,closeSnackbar:a}=Be();return s.exports.useEffect(()=>{Se.interceptors.response.use(l=>l,l=>{let c=`Oops, something went wrong. Error status ${l.response.status} (${l.response.statusText}). Your webserver might be unable to handle this request, there's an issue with your WordPress instance or you have insufficient permissions to execute this request.`,d=!0,m=!1,u=1207,p=null;return l.response.data&&(l.response.data.code==="buttonizer_api_server_error"?u=1213:d=!1,l.response.data.code==="buttonizer_token_expired"&&(m=!0),l.response.data.data&&l.response.data.data.message&&l.response.data.data.message!==""&&(p=l.response.data.data.message),c=`${l.response.data.message} (Error code: ${l.response.data.code})`),o(c,{anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:null,action:y=>[d&&e(g,{href:`https://community.buttonizer.pro/knowledgebase/${u}`,target:"_blank",color:"secondary",children:"More information"}),m&&e(mt,{onConnect:_=>{a(y),i(_.data),r(!0)},reconnect:!0,buttonProps:{color:"secondary"},buttonText:"Reconnect"}),p!==null&&e(g,{color:"secondary",onClick:()=>alert(`The response message we received was:
2
+
3
+ ${p}`),children:"Debug"}),e(g,{onClick:()=>a(y),children:"Close"})]}),Promise.reject(l)})},[]),t}function Wn({children:t}){return e(Te.StrictMode,{children:e(Bt,{fallback:n("p",{children:["We're sorry! Our dashboard has crashed, we have been notified about the error. Please refresh the page"," ",e("a",{href:"./admin.php?page=Buttonizer",children:"or start from the beginning"}),"."]}),showDialog:!0,children:e(at,{theme:ut,children:e(It,{maxSnack:3,children:e(Lt,{children:e(Rn,{children:e(Fn,{children:t})})})})})})})}const On="_logoLink_1f0it_1",Hn="_title_1f0it_7",Un="_logo_1f0it_1",qn="_navLinks_1f0it_19",Gn="_dropdownMenu_1f0it_23",jn="_pluginMenuListIcon_1f0it_27",Yn="_divider_1f0it_31",Vn="_dropdownMenuItem_1f0it_36",Jn="_dropdownMenuItemSelected_1f0it_41",Kn="_externalIcon_1f0it_44";var C={logoLink:On,title:Hn,logo:Un,navLinks:qn,dropdownMenu:Gn,pluginMenuListIcon:jn,divider:Yn,dropdownMenuItem:Vn,dropdownMenuItemSelected:Jn,externalIcon:Kn};function Qn(){const{connectionSuccesfull:t,setConnectionSuccessfull:i,hasMigrated:r}=w(),o=()=>{i(!1)};return t?n(re,{severity:"success",variant:"outlined",action:e(Ie,{"aria-label":"close",color:"inherit",size:"small",onClick:o,children:e(st,{fontSize:"inherit"})}),style:{marginTop:15,background:"#edf7ed"},children:[!r&&n(v,{children:[e(K,{children:"Buttonizer has been set up. Happy conversion \u{1F680}"}),n(h,{variant:"body1",children:["Start building by clicking the '",e("b",{children:"Edit buttons"}),"' button in the section below."]})]}),r&&n(v,{children:[e(K,{children:"Your Buttonizer account has been connected. Happy conversion \u{1F680}"}),n(h,{variant:"body1",children:["Buttonizer should now be visible on your WordPress website. Manage your buttons by clicking the '",e("b",{children:"Edit buttons"}),"' button in the section below."]}),n(h,{variant:"body1",style:{marginTop:15},children:[e("b",{children:"Tip:"})," If you have a caching plugin active, we recommend to clear your site's cache."]})]})]}):null}function Je(t){return P("/settings",{data:t})}function Xn(){const{requestReview:t,setRequestReview:i}=w(),[r,o]=s.exports.useState(!1),[a,l]=s.exports.useState(!1),[c,d]=s.exports.useState(!1),m=()=>{i(!1)},u=()=>{c||(d(!0),Je({remindForReview:!0}).then(()=>m()).catch(()=>{}).then(()=>d(!1)))},p=()=>{c||(d(!0),Je({markAsReviewed:!0}).then(()=>m()).catch(()=>{}).then(()=>d(!1)))};return t?n(re,{severity:"info",variant:"outlined",style:{marginTop:15,background:"#e5f6fd"},children:[!r&&!a&&n(v,{children:[e(K,{children:"Are you enjoying Buttonizer? We really hope you do!"}),e(h,{variant:"body1",children:"Would you like to review us on WordPress and share your experience? This way you support us developing new features for Buttonizer and spread the love!"}),n("div",{style:{marginTop:15},children:[e(g,{variant:"outlined",href:"https://r.buttonizer.io/review/wordpress",target:"_blank",startIcon:e($t,{}),style:{marginRight:15},onClick:()=>o(!0),disabled:c,children:"Yes, I like Buttonizer"}),e(g,{startIcon:e(Nt,{}),style:{marginRight:15},href:"https://r.buttonizer.io/feedback",target:"_blank",disabled:c,onClick:()=>l(!0),children:"No, send feedback"}),e("div",{style:{float:"right"},children:e(g,{disabled:c,onClick:u,children:"Remind me later"})})]})]}),(r||a)&&n(v,{children:[e(K,{children:r?"We're really happy to hear that \u{1F389}":"We'll do better! We promise"}),r&&n(v,{children:[n(h,{variant:"body1",children:["If we can help you with anything, or you have cool idea's or great feedback,"," ",e(I,{href:"https://r.buttonizer.io/feedback",target:"_blank",color:"secondary",children:"just reach out to us"}),"! We always reply :)"]}),n(h,{variant:"body1",style:{marginTop:15},children:["If you have closed the window that just opened and you still like to review us,"," ",e(I,{href:"https://r.buttonizer.io/review/wordpress",target:"_blank",color:"secondary",children:"click this link"}),"!"]})]}),!r&&n(h,{variant:"body1",children:["If there's anything else what we can help you with,"," ",e(I,{href:"https://r.buttonizer.io/feedback",target:"_blank",color:"secondary",children:"just reach out to us"}),"! We always reply :)"]}),e("div",{style:{marginTop:15},children:e(g,{startIcon:e(At,{}),onClick:()=>{pt.addConfetti(),i(!1),p()},disabled:c,children:r?"Celebrate in silence":"Close with confetti"})})]})]}):null}function Zn(){const{siteInfo:t,startSession:i,sessionStarting:r}=w();let o=oe(),a=Pt();const[l,c]=s.exports.useState(!1),d=s.exports.useRef();return n("div",{style:{marginBottom:40},children:[e(Le,{type:"wrapper",children:n(b,{container:!0,alignItems:"center",children:[e(b,{item:!0,navigation:!0,children:n("div",{className:C.logoLink,onClick:()=>o("/overview"),children:[e("img",{src:`${buttonizer_admin.assetsPath}/images/buttonizer-logo.png`,alt:"buttonizerlogo",className:C.logo,draggable:!1}),e(h,{className:C.title,color:"primary",children:"Buttonizer for WordPress"})]})}),n(b,{item:!0,container:!0,justifyContent:"space-between",navigation:"auto",className:C.navLinks,children:[e(g,{onClick:()=>{o("/overview")},color:a.pathname==="/overview"?"secondary":"primary",children:"Home"}),e(g,{onClick:()=>{o("/support")},color:a.pathname==="/support"?"secondary":"primary",children:"Support"}),e(g,{onClick:()=>{c(!0)},ref:d,endIcon:l?e(Rt,{}):e(Mt,{}),color:a.pathname==="/settings"?"secondary":"primary",children:"Settings"}),e(g,{variant:"contained",onClick:i,endIcon:r&&e(Y,{size:20,style:{marginLeft:8}}),disabled:r,children:"Edit buttons"})]})]})}),e(Qn,{}),e(Xn,{}),e(Dt,{open:l&&d.current,anchorEl:d.current,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:()=>{c(!1)},onClick:()=>c(!1),children:n(Et,{className:C.dropdownMenu,children:[n(de,{onClick:()=>{o("/settings")},selected:a.pathname==="/settings",className:ie(C.dropdownMenuItem,a.pathname==="/settings"&&C.dropdownMenuItemSelected),children:[e(F,{className:C.pluginMenuListIcon,children:e(Ft,{fontSize:"small"})}),e(A,{primary:"Plugin settings",secondary:"Preferences"})]}),n(de,{href:N(`/sites/${t.id}/settings`),target:"_blank",className:C.dropdownMenuItem,children:[e(F,{className:C.pluginMenuListIcon,children:e(Wt,{fontSize:"small"})}),e(A,{primary:n(v,{children:["Site Settings",e(J,{className:C.externalIcon})]}),secondary:"Update site settings"})]}),n(de,{href:N(`/sites/${t.id}/plan`),target:"_blank",className:C.dropdownMenuItem,children:[e(F,{className:C.pluginMenuListIcon,children:e(Ot,{fontSize:"small"})}),e(A,{primary:n(v,{children:["Site plan",e(J,{className:C.externalIcon})]}),secondary:"Manage subscription"})]}),e(Ht,{className:C.divider}),n(de,{href:N("/account"),target:"_blank",className:C.dropdownMenuItem,children:[e(F,{className:C.pluginMenuListIcon,children:e(Ut,{fontSize:"small"})}),e(A,{primary:n(v,{children:["Account Settings",e(J,{className:C.externalIcon})]}),secondary:"Account settings"})]})]})})]})}const er="_footer_zmvmt_1",tr="_subfooter_zmvmt_7",nr="_dutchFlag_zmvmt_13",rr="_loveIcon_zmvmt_23",ir="_coffeeIcon_zmvmt_24";var Z={footer:er,subfooter:tr,dutchFlag:nr,loveIcon:rr,coffeeIcon:ir};function gt(){return n("div",{className:Z.footer,children:["Need some assistance? Get free support via our"," ",e(I,{href:"https://r.buttonizer.io/support/community?utm_source=wp-plugin-footer",target:"_blank",color:"secondary",children:"Buttonizer Community"}),". Do you have feedback?"," ",e(I,{href:"https://r.buttonizer.io/feedback?utm_source=wp-plugin-footer",target:"_blank",color:"secondary",children:"Give feedback"}),".",n("div",{className:Z.subfooter,children:["Built with"," ",e(ne,{title:"much love",children:e(qt,{className:Z.loveIcon})})," ","and"," ",e(ne,{title:"lots and lots of coffee",children:e(Gt,{className:Z.coffeeIcon})})," ","in The Netherlands"," ",e(ne,{title:"Buttonizer HQ in Zoetermeer",children:e("img",{src:`${buttonizer_admin.assetsPath}/images/dutch-flag.svg`,className:Z.dutchFlag})})]})]})}function or(){return n(jt,{style:{maxWidth:1100},children:[n("div",{style:{padding:"50px 0 0",height:"100%"},children:[e(Zn,{}),e(Yt,{})]}),e(gt,{})]})}const ar="_avatar_1ciu2_5",sr="_listItem_1ciu2_9",lr="_secondaryInfo_1ciu2_13",cr="_knowledgebase_1ciu2_17",dr="_knowledgebaseText_1ciu2_24";var ee={"migratePage-container":"_migratePage-container_1ciu2_1",avatar:ar,listItem:sr,secondaryInfo:lr,knowledgebase:cr,knowledgebaseText:dr};const ur="_buttonizerPaper_131bh_1";var hr={buttonizerPaper:ur};function ft({children:t,containerProps:i}){return e(v,{children:n(Vt,U(z({className:"migratePage-container",style:{marginTop:50,maxWidth:1130}},i),{children:[e("div",{style:{alignItems:"center",justifyContent:"center",display:"flex",marginBottom:30},children:e("img",{src:`${buttonizer_admin.assetsPath}/images/logo.png`,alt:"buttonizerlogo",style:{height:70}})}),e(Le,{className:hr.buttonizerPaper,sx:{"&::before":{background:`url(${buttonizer_admin.assetsPath}/images/waves.svg)`}},children:t})]}))})}const pr="_code_1iwn6_1";var mr={code:pr};const gr=s.exports.forwardRef(function(i,r){return e(pe,z({direction:"up",ref:r},i))});function fr({open:t,onClose:i=()=>{},onConfirm:r=()=>{}}){const o=s.exports.useRef(),a=()=>{o.current.focus(),o.current.select(),navigator.clipboard&&navigator.clipboard.writeText(o.current.value)};return n(me,{open:t,onClose:close,TransitionComponent:gr,"aria-labelledby":"migrate-title","aria-describedby":"migrate-description",children:[e(ge,{id:"migrate-title",children:"Before you migrate"}),n(fe,{children:[n(Q,{id:"migrate-description",children:["It seems that you're currently using a deprecated custom JavaScript feature of Buttonizer which is not supported on Buttonizer 3.0 in favour of the advanced"," ",e(I,{href:"https://community.buttonizer.pro/knowledgebase/435",target:"_blank",color:"secondary",children:"Buttonizer JavaScript API"}),"."]}),n(Q,{style:{margin:"15px 0"},children:["Please copy all the code from the block below and add it to a"," ",e(I,{href:"https://community.buttonizer.pro/knowledgebase/1011",target:"_blank",color:"secondary",children:"Headers Footers"})," ","plugin of your choice. Your click actions will stay working as they are now."]}),e("textarea",{className:mr.code,onClick:a,ref:o,readOnly:!0,children:buttonizer_admin.beforeMigrate})]}),n(ye,{children:[e(g,{onClick:i,children:"Cancel"}),e(g,{color:"secondary",onClick:()=>r(!0),autoFocus:!0,children:"I am ready"})]})]})}let Ce=null,O=null;function yr(){const t=oe(),{enqueueSnackbar:i,closeSnackbar:r}=Be(),{setActionLock:o,parseAccountData:a,setConnectionSuccessfull:l,setHasMigrated:c}=w(),[d,m]=s.exports.useState(!1),[u,p]=s.exports.useState(!1),[y,_]=s.exports.useState(!1),[R,x]=s.exports.useState(!1),[L,B]=s.exports.useState(null),[k,X]=s.exports.useState(!0),W=buttonizer_admin.site,V=(M=!1)=>{if((buttonizer_admin==null?void 0:buttonizer_admin.beforeMigrate)!==null&&M!==!0){p(!0);return}if(d&&O){O.focus();return}m(!0),x(!1);const $=N(`/apps/onboard?app_origin=wordpress&site_name=${encodeURIComponent(W.name)}&domain=${encodeURIComponent(W.domain)}&email=${encodeURIComponent(W.user.email)}&first_name=${encodeURIComponent(W.user.firstName)}&last_name=${encodeURIComponent(W.user.lastName)}`);O=window.open($,"connectPopup",`width=500,height=580,top=${window.innerHeight/2-580/2},left=${window.innerWidth/2-500/2},status=no,scrollbars=yes,resizable=no`),Ce=setInterval(()=>{if(!O){clearInterval(Ce);return}O.closed&&(clearInterval(Ce),O=null,m(!1))});try{O.focus()}catch{i("Could not open authorization popup. Your browser might have blocked it. Please add this site to your exception list.",{anchorOrigin:{vertical:"bottom",horizontal:"center",autoHideDuration:1e4},action:le=>[e(g,{href:"https://community.buttonizer.pro/knowledgebase/1208",target:"_blank",color:"secondary",children:"More information"}),e(g,{onClick:()=>r(le),children:"Close"})]})}},ae=()=>{y||(_(!0),B("skipping"),P("/migrate",{skip:!0}).then(({data:M})=>{document.location.href=`${buttonizer_admin.admin}?page=Buttonizer`}).catch(()=>{x(!0),_(!1)}))};if(s.exports.useEffect(()=>{const M=$=>{!$.isTrusted||$.origin!==N("")||$.data.messageType==="connect-info"&&(O.close(),B("connecting"),P("/migrate",{siteId:$.data.id,authorization:$.data.authorization,shouldMigrate:k}).then(({data:se})=>{o("no-lock"),a(se.data),l(!0),c(!0),t("/")}).catch(()=>{B(null),x(!0)}))};return window.addEventListener("message",M),function(){window.removeEventListener("message",M)}},[k]),L!==null)return e(be,{text:br(L)});const D=(M,$)=>n(j,{className:ee.listItem,children:[e(ct,{children:e(dt,{className:ee.avatar,children:e(Ne,{})})}),e(A,{secondary:$,secondaryTypographyProps:{className:ee.secondaryInfo},primary:M})]});return n(ft,{children:[n(g,{href:"https://community.buttonizer.pro/knowledgebase/1122-standalone-vs-wordpress",target:"_blank",type:"link-small",className:ee.knowledgebase,children:[e(lt,{}),e("span",{className:ee.knowledgebaseText,children:"Learn more about Buttonizer Standalone"})]}),n(b,{container:!0,style:{height:"100%"},direction:"row",children:[e(b,{item:!0,container:!0,justifyContent:"center",direction:"column",alignContent:"center",md:6,sm:12,sx:{margin:"20px 0"},children:n("div",{children:[e("img",{src:`${buttonizer_admin.assetsPath}/images/buttonizer-logo.png`,alt:"buttonizerlogo",style:{height:50}}),e(h,{style:{fontSize:27,fontWeight:600,marginTop:30},children:"Buttonizer just got an upgrade!"}),e(h,{style:{fontSize:"1.2rem",maxWidth:"fit-content",marginTop:10},component:"div",children:"Easier to manage, faster and more features."}),e("div",{style:{marginTop:30,maxWidth:300},children:n(g,{variant:"contained",onClick:()=>{X(!0),V()},color:"secondary",size:"small",sx:{padding:"15px 30px"},children:["Start migrating",e(J,{style:{marginLeft:15}})]})}),e(h,{style:{marginTop:20,fontSize:"0.875rem",maxWidth:"fit-content"},component:"div",children:"Already using Buttonizer Standalone? Connect without migrating your buttons."}),n("div",{style:{marginTop:20,marginBottom:100,alignItems:"center",display:"flex"},children:[e(g,{variant:"outlined",size:"small",onClick:()=>{X(!1),V()},color:"secondary",sx:{padding:"10px 20px",marginRight:"10px"},children:"Connect now"}),e(g,{size:"small",onClick:ae,disabled:d,children:"Stay in old version"})]})]})}),n(b,{item:!0,md:6,sm:12,container:!0,justifyContent:"center",alignContent:"center",direction:"column",sx:{margin:"20px 0"},children:[e(h,{style:{fontSize:27,fontWeight:600,paddingLeft:15},children:"New in 3.0"}),n($e,{size:"large",children:[D("More free styling options","Imagine what you can do now"),D("Conversion analytics","Privacy focused conversion analytics"),D("Now available on any platform","Try out on WordPress, Shopify, Wix and more"),D("Manage multiple sites with one account","Great for agencies & businesses with multiple sites"),D("Content Delivery Network (CDN)","Lightning fast around the world \u{1F680}"),D("GDPR-Compliant","Buttonizer is fully GDPR-compliant"),D("And much more!")]})]})]}),e(fr,{open:u,onClose:()=>p(!1),onConfirm:V})]})}function br(t){switch(t){case"initializing":return"Initializing...";case"skipping":return"Skipping...";case"migrating":return"Migrating data..."}}function H(o){var a=o,{children:t,paperStyle:i}=a,r=je(a,["children","paperStyle"]);return e("div",{style:{margin:"20px 0"},children:e(Le,U(z({sx:z({"& > *":{marginTop:"20px !important",marginBottom:"20px !important"},"& > *:first-child":{marginTop:"10px !important",marginBottom:"20px !important"}},i),type:"wrapper"},r),{children:t}))})}const vr="_analyticsContainer_1q32b_1",_r="_analyticsLoading_1q32b_5",wr="_tabsContainer_1q32b_10",Cr="_tabs_1q32b_10",kr="_pieTitle_1q32b_17";var te={analyticsContainer:vr,analyticsLoading:_r,tabsContainer:wr,tabs:Cr,pieTitle:kr};function Ke(t){for(var i=0,r=0;r<t.length;r++)i=t.charCodeAt(r)+((i<<5)-i);for(var o="#",r=0;r<3;r++){var a=i>>r*8&255;const c="00"+a.toString(16);o+=c.substring(c.length-2,c.length)}return o}const zr="_legend_17qwt_1",xr="_marginTop_17qwt_5",Sr="_legendItem_17qwt_10",Tr="_legendColor_17qwt_15",Br="_legendHidden_17qwt_19",Ir="_legendLabel_17qwt_37",Lr="_loading_17qwt_41";var G={legend:zr,marginTop:xr,legendItem:Sr,legendColor:Tr,legendHidden:Br,legendLabel:Ir,loading:Lr};function $r({chart:t=null,isLoading:i=!1,onForceUpdate:r,showClicks:o=!1,isPieChart:a=!1}){if(s.exports.useEffect(()=>{},[]),!t)return null;const l=t.options.plugins.legend.labels.generateLabels(t),c=d=>{var m=d.datasetIndex,u=t;if(a){const p=t.getDatasetMeta(0).data[d.index].hidden;t.getDatasetMeta(0).data[d.index].hidden=!p,t.update()}else u.setDatasetVisibility(m,!u.isDatasetVisible(m)),u.update();r()};return e("div",{className:ie(G.legend,G.marginTop,i&&G.loading),children:l.map((d,m)=>{const u=d.strokeStyle,p=d.hidden;return e(ne,{title:o?`Total clicks this period: ${t.data.datasets[m].totalClicks}`:"",children:n("span",{className:ie(G.legendItem,p&&G.legendHidden),onClick:()=>c(d),children:[e("span",{className:G.legendColor,style:{color:u}}),e("span",{className:G.legendLabel,children:d.text})]})},m)})})}const Nr="_lineChart_hik2f_1",Ar="_loading_hik2f_6";var Qe={lineChart:Nr,loading:Ar};Ae.register(Pe,Re,Me,De,Ee,Fe,We,Jt);const Xe=["#F08419","#2D95EC"];function Pr(t,i){return t<2?{borderColor:Xe[t],backgroundColor:Xe[t]}:{borderColor:Ke(i),backgroundColor:Ke(i)}}function Rr({data:t}){const{isLoadingAnalytics:i,analyticsChosenRange:r}=w(),[o,a]=s.exports.useState(!0),[l,c]=s.exports.useState(!1),d=s.exports.useRef(null),[,m]=s.exports.useState();return s.exports.useEffect(()=>{d.current&&(l||c(!0))},[o]),n(v,{children:[e("div",{className:ie(Qe.lineChart,i&&Qe.loading),children:e(Kt,{height:400,options:{maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0,min:0,grid:{drawBorder:!1,drawOnChartArea:!0,borderColor:"#ECECEC"},title:{display:!0,text:"Clicks"},ticks:{padding:15,backdropPadding:0}},x:{grid:{drawBorder:!1,drawOnChartArea:!1,borderColor:"#ECECEC"},ticks:{padding:5}}},interaction:{intersect:!1}},ref:d,data:{labels:t.line.labels.map(u=>Qt.unix(u).format(["weekly","monthly"].indexOf(r)>=0?"MMMM Do":"H:mm")),datasets:t.line.datasets.filter(u=>!u.unknown||u.unknown&&!o).map((u,p)=>z({label:u.name,data:u.values,totalClicks:u.totalClicks,tension:.5,pointRadius:5,pointHoverRadius:8},Pr(p,u.id)))}})}),e($r,{chart:d.current,onForceUpdate:()=>m({}),isLoading:i,showClicks:!0}),e("div",{style:{paddingTop:15},children:e(Xt,{control:e(Zt,{checked:o,size:"small"}),label:"Hide unknown (or deleted) buttons",onChange:()=>{a(!o),setTimeout(()=>{m({})},1)}})})]})}const Mr="_controls_a553e_1";var Dr={controls:Mr};function Er(){const{analyticsChosenRange:t,updateAnalyticsByTimeRange:i,isLoadingAnalytics:r}=w(),[o,a]=s.exports.useState(t);return n("div",{className:Dr.controls,children:["Time controls:",n(en,{size:"small",style:{verticalAlign:"middle",marginLeft:15},children:[e(tn,{id:"demo-multiple-name-label",children:"Time range"}),n(nn,{labelId:"demo-multiple-name-label",id:"demo-multiple-name",value:o,onChange:l=>{const{target:{value:c}}=l;a(c),i(c)},input:e(rn,{label:"Time range"}),disabled:r,children:[e(ve,{value:"today",children:"Today"},"today"),e(ve,{value:"yesterday",children:"Yesterday"},"yesterday"),e(ve,{value:"weekly",children:"This week (last 7 days)"},"weekly")]})]}),r&&e(Y,{size:25,style:{verticalAlign:"middle",marginLeft:15}})]})}const Fr="_title_zfqz7_1",Wr="_cardContainer_zfqz7_5",Or="_chartContainer_zfqz7_9",Hr="_percentageContainer_zfqz7_14",Ur="_percentageColor_zfqz7_17",qr="_percentage_zfqz7_14",Gr="_percentageLabel_zfqz7_28";var S={title:Fr,cardContainer:Wr,chartContainer:Or,percentageContainer:Hr,percentageColor:Ur,percentage:qr,percentageLabel:Gr};Ae.register(Pe,Re,Me,De,Ee,Fe,We);function jr({data:t}){const{isLoadingAnalytics:i}=w(),[r,o]=s.exports.useState(!0),[a,l]=s.exports.useState(!1),c=s.exports.useRef(null);return s.exports.useState(),s.exports.useEffect(()=>{c.current&&(a||l(!0))},[r]),e(v,{children:n("div",{className:ie(S.cardContainer,i&&S.loading),children:[e(h,{variant:"body1",className:S.title,children:"Devices"}),e("div",{className:S.chartContainer,children:e(on,{options:{cutout:"70%",plugins:{legend:{display:!1}}},data:{labels:["Desktop","Phone","Tablet"],datasets:[{label:"# of clicks",data:[t.devices.desktop,t.devices.phone,t.devices.tablet],backgroundColor:["#F08419","#F4A557","#F7BF87"],borderColor:["#F08419","#F4A557","#F7BF87"],borderWidth:1}]}})}),n(b,{container:!0,style:{padding:"0 13px"},children:[n(b,{item:!0,xs:4,className:S.percentageContainer,children:[e("div",{className:S.percentageColor,style:{backgroundColor:"#f4a557"}}),n(h,{className:S.percentage,children:[Math.round(t.devices.phone/t.total*100),"%"]}),e(h,{className:S.percentageLabel,children:"Mobile"})]}),n(b,{item:!0,xs:4,className:S.percentageContainer,children:[e("div",{className:S.percentageColor,style:{backgroundColor:"#F08419"}}),n(h,{className:S.percentage,children:[Math.round(t.devices.desktop/t.total*100),"%"]}),e(h,{className:S.percentageLabel,children:"Desktop"})]}),n(b,{item:!0,xs:4,className:S.percentageContainer,children:[e("div",{className:S.percentageColor,style:{backgroundColor:"#F7BF87"}}),n(h,{className:S.percentage,children:[Math.round(t.devices.tablet/t.total*100),"%"]}),e(h,{className:S.percentageLabel,children:"Tablet"})]})]})]})})}const Yr="_title_va1ni_1",Vr="_gridHeight_va1ni_5",Jr="_barHeight_va1ni_12";var ke={title:Yr,gridHeight:Vr,barHeight:Jr};Ae.register(Pe,Re,Me,De,an,Ee,Fe,We);function Kr({data:t,siteInfo:i}){w();const[r,o]=s.exports.useState(!0),[a,l]=s.exports.useState(!1),c=s.exports.useRef(null);s.exports.useState(),s.exports.useEffect(()=>{c.current&&(a||l(!0))},[r]);const d=t&&t.countries.list.sort((u,p)=>{const y=t.countries.data[t.countries.list.indexOf(u)];return t.countries.data[t.countries.list.indexOf(p)]-y}).slice(0,5),m=t.countries.data.sort((u,p)=>p-u).slice(0,5);return n(v,{children:[n(b,{container:!0,children:[e(b,{item:!0,md:6,children:e(h,{variant:"body1",className:ke.title,children:"Countries"})}),e(b,{item:!0,md:6,style:{textAlign:"right"},children:e(g,{startIcon:e(sn,{}),href:N(`/analytics/${i.id}`),target:"_blank",children:"View worldmap"})})]}),e("div",{className:ke.gridHeight,children:e("div",{className:ke.barHeight,children:e(ln,{width:400,options:{maintainAspectRatio:!1,barThickness:22,indexAxis:"y",plugins:{legend:{display:!1}},scales:{y:{grid:{display:!1}},x:{ticks:{callback:function(u){return u+"%"}}}}},data:{labels:d.map(u=>cn[u.toUpperCase()].name),datasets:[{axis:"y",label:"% of total clicks",data:m.map(u=>Math.round(u/t.total*100)),backgroundColor:["#F08419"],borderColor:["#F08419"]}]}})})})]})}const Qr="_styledContainer_u39ug_1",Xr="_paragraph_u39ug_8",Zr="_button_u39ug_14";var ze={styledContainer:Qr,paragraph:Xr,button:Zr};function ei({siteInfo:t}){return n("div",{className:ze.styledContainer,children:[e(h,{variant:"body1",color:"primary",className:ze.paragraph,children:"Dive deeper into your Buttonizer Analytics"}),e(g,{variant:"contained",color:"primary",startIcon:e(dn,{}),href:N(`/analytics/${t.id}`),target:"_blank",className:ze.button,children:"Open analytics dashboard"})]})}function ti(){const{siteInfo:t,getAnalytics:i,analyticsData:r,isLoadingAnalytics:o}=w();return s.exports.useEffect(()=>{i()},[]),n(H,{className:te.analytics,children:[n("div",{className:te.tabsContainer,children:[n(un,{value:0,className:te.tabs,children:[e(Ve,{value:0,icon:e(hn,{}),iconPosition:"start",label:e(v,{children:"Button clicks"}),size:"small"}),e(Ve,{value:1,icon:e(he,{size:"small",label:"Coming soon"}),iconPosition:"end",label:"Conversions",size:"small",disabled:!0})]}),e(Er,{}),e("div",{children:e(ne,{title:"How do analytics work",placement:"left",children:e(Ie,{href:"https://community.buttonizer.pro/knowledgebase/1280",target:"_blank",size:"small",children:e(lt,{})})})})]}),n("div",{className:r&&r.line.datasets.length>=1&&te.analyticsContainer,children:[o&&r===null&&e("div",{className:te.analyticsLoading,children:e(Y,{size:50})}),!o&&!r&&e(re,{severity:"warning",children:"Woops, something went wrong loading analytics of your site."}),r&&r.line.datasets.length>=1&&n(v,{children:[e(Rr,{data:r,loading:o}),n(b,{container:!0,spacing:3,style:{marginTop:0},children:[e(b,{item:!0,style:{maxWidth:365},children:e(jr,{data:r,loading:o})}),e(b,{item:!0,md:!0,children:e(Kr,{data:r,siteInfo:t,loading:o})})]})]}),r&&r.line.datasets.length===0&&n(re,{severity:"info",icon:e(pn,{}),style:{marginTop:15},children:[e(K,{children:"Waiting for data..."}),n("div",{children:[e(h,{variant:"body1",fontSize:15,children:"Currently we don't have any click data to show you. As soon someone clicked one of your buttons, analytics will become visible here."}),e(h,{variant:"body1",fontSize:15,style:{marginTop:15},children:"Check back later \u{1F680}"})]})]})]}),e(ei,{siteInfo:t})]})}function ni(){const{siteInfo:t,startSession:i,sessionStarting:r}=w();return n(v,{children:[n(H,{children:[e(h,{type:"header",color:"primary",children:"Manage your Buttonizer instance"}),e(h,{type:"body1",color:"primary",children:"Welcome to your Buttonizer for WordPress dashboard. Here are a few quick-tools to manage your Buttonizer."}),e(g,{variant:"outlined",onClick:i,endIcon:r&&e(Y,{size:20,style:{marginLeft:8}}),disabled:r,children:"Edit buttons"})]}),e(ti,{})]})}const ri=s.exports.forwardRef(function(i,r){return e(pe,z({direction:"up",ref:r},i))});function ii({open:t,onClose:i=()=>{}}){var d;const{setActionLock:r}=w(),[o,a]=s.exports.useState(!1),l=()=>{o||i()},c=()=>{o||(a(!0),P("/disconnect").then(({data:m})=>{r("setup"),i()}).catch(()=>a(!1)))};return n(me,{open:t,onClose:l,TransitionComponent:ri,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e(ge,{id:"alert-dialog-title",children:"Are you sure you want to disconnect?"}),n(fe,{children:[n(Q,{id:"alert-dialog-description",children:["You will disconnect your Buttonizer instance from your site"," ",e("b",{children:(d=buttonizer_admin==null?void 0:buttonizer_admin.site)==null?void 0:d.domain}),". You will be able to sign in with another account."]}),e(Q,{id:"alert-dialog-description-p2",style:{marginTop:15},children:"Are you sure you want to disconnect?"})]}),n(ye,{children:[e(g,{disabled:o,onClick:l,children:"Cancel"}),e(g,{disabled:o,color:"secondary",onClick:c,autoFocus:!0,children:"Disconnect"})]})]})}function oi(){const[t,i]=s.exports.useState(!1);return n(v,{children:[n(H,{children:[e(h,{type:"header",color:"primary",children:"Disconnect Buttonizer"}),e(h,{variant:"body1",color:"primary",children:"Did you create a new instance or do you want to sign in with a different account? Disconnect Buttonizer from your WordPress site."}),e(g,{variant:"outlined",onClick:()=>i(!0),children:"Disconnect"})]}),e(ii,{open:t,onClose:()=>i(!1)})]})}const ai="_table_13k7q_1";var Ze={table:ai};function si(){const{parseAccountData:t,isPremium:i,accountData:r,siteInfo:o,planInfo:a}=w(),[l,c]=s.exports.useState(!1),[d,m]=s.exports.useState(!1),u=()=>{l||(c(!0),P("/sync").then(({data:y})=>{t(y.data),m(!0),setTimeout(()=>{m(!1)},5e3)}).catch(()=>{}).then(()=>c(!1)))},p=()=>i?e(he,{label:"PRO",color:"secondary"}):e(he,{label:"FREE"});return n(H,{children:[n(b,{container:!0,children:[e(b,{item:!0,md:6,children:n("table",{className:Ze.table,children:[e("tr",{colspan:"2",children:e("th",{children:e(h,{variant:"body1",color:"primary",style:{fontWeight:600},children:"Site information:"})})}),n("tr",{children:[e("td",{children:e(h,{variant:"body2",color:"primary",children:"Account name:"})}),e("td",{children:e(h,{variant:"body2",color:"primary",children:r.name})})]}),n("tr",{children:[e("td",{children:e(h,{variant:"body2",color:"primary",children:"Site ID:"})}),e("td",{children:e(h,{variant:"body2",color:"primary",children:o.id})})]}),n("tr",{children:[e("td",{children:e(h,{variant:"body2",color:"primary",children:"Timezone:"})}),e("td",{children:n(h,{variant:"body2",color:"primary",children:[o.timezone," (",e(I,{href:N(`/sites/${o.id}/settings`),target:"_blank",color:"secondary",children:"Change"}),")"]})})]})]})}),e(b,{item:!0,md:6,children:n("table",{className:Ze.table,children:[e("tr",{colspan:"2",children:e("th",{children:e(h,{variant:"body1",color:"primary",style:{fontWeight:600},children:"License information:"})})}),n("tr",{children:[e("td",{children:e(h,{variant:"body2",color:"primary",children:"Plan:"})}),e("td",{children:n(h,{variant:"body2",color:"primary",children:[a.name," (",e(I,{href:N(`/sites/${o.id}/plan`),target:"_blank",color:"secondary",children:"Change"}),")"]})})]}),a.hasPlan&&n(v,{children:[n("tr",{children:[e("td",{children:e(h,{variant:"body2",color:"primary",children:"Subscription status:"})}),e("td",{children:e(h,{variant:"body2",color:"primary",children:a.cancelled?"Cancelled":"Active"})})]}),n("tr",{children:[e("td",{children:e(h,{variant:"body2",color:"primary",children:"License status:"})}),e("td",{children:p()})]})]})]})})]}),e(h,{variant:"body2",color:"primary",children:"Did you change a button or account information in the Buttonizer dashboard and do not see the changes in the Buttonizer for WordPress plugin?"}),e(h,{variant:"body2",color:"primary",children:"Click the sync button below to retrieve the data from the Buttonizer dashboard."}),n(b,{container:!0,justifyContent:"space-between",children:[e(g,{variant:"outlined",onClick:u,disabled:l||d,endIcon:l&&e(Y,{size:20,style:{marginLeft:8}})||d&&e(Ne,{}),children:"Sync with dashboard"}),e(g,{color:"secondary",endIcon:e(J,{}),href:N(`/sites/${o.id}`),target:"_blank",type:"link",children:"View more site info"})]})]})}const li=s.exports.forwardRef(function(i,r){return e(pe,z({direction:"up",ref:r},i))});function ci({open:t,onClose:i=()=>{}}){const{setHasMigrated:r,setLegacyBackupDeleted:o}=w(),[a,l]=s.exports.useState(!1),c=()=>{a||i()};return n(me,{open:t,onClose:c,TransitionComponent:li,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e(ge,{id:"alert-dialog-title",children:"Happy with the upgrade?"}),e(fe,{children:e(Q,{id:"alert-dialog-description",children:"Are you satiesfied with the 3.0 update? If so then you can remove the old Buttonizer data to clean up unused data in your database."})}),n(ye,{children:[e(g,{disabled:a,onClick:c,children:"Cancel"}),e(g,{disabled:a,color:"secondary",onClick:()=>{a||(l(!0),P("/delete_legacy_backup").then(()=>{o(!0),r(!1),i()}).catch(()=>l(!1)))},autoFocus:!0,children:"Confirm"})]})]})}const di=s.exports.forwardRef(function(i,r){return e(pe,z({direction:"up",ref:r},i))});function ui({open:t,onClose:i=()=>{}}){const[r,o]=s.exports.useState(!1),a=()=>{r||i()},l=()=>{r||(o(!0),P("/revert_legacy").then(()=>{document.location.href=`${buttonizer_admin.admin}?page=Buttonizer`}).catch(()=>o(!1)))};return r&&t?n(mn,{open:t,sx:{background:"#f0f0f1"},children:[e(gn,{styles:{body:{overflow:"hidden"}}}),e(be,{text:"Reverting..."})]}):n(me,{open:t,onClose:a,TransitionComponent:di,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e(ge,{id:"alert-dialog-title",children:"Go back Buttonizer version 2.x"}),e(fe,{children:n(Q,{id:"alert-dialog-description",children:["Don't like the changes in the 3.0 update? Did you perhaps encounter any issues or have any feedback? Please let us know so that we may improve it in the future."," ",e(I,{color:"secondary",href:"mailto:contact@buttonizer.pro",children:"contact@buttonizer.pro"})]})}),n(ye,{children:[e(g,{disabled:r,onClick:a,children:"Cancel"}),e(g,{disabled:r,color:"secondary",onClick:l,autoFocus:!0,children:"I am sure"})]})]})}function hi(){const[t,i]=s.exports.useState(!1),[r,o]=s.exports.useState(!1);return n(v,{children:[n(H,{children:[e(h,{type:"header",color:"primary",children:"Remove unused 2.x data"}),e(h,{variant:"body1",color:"primary",children:"Remove the old Buttonizer data in your database."}),e(g,{variant:"outlined",onClick:()=>i(!0),children:"Remove 2.x data"}),e(h,{type:"header",color:"primary",children:"Go back to Buttonizer version 2.x"}),e(h,{variant:"body1",color:"primary",children:"Don't like the changes in the new version?"}),e(g,{variant:"outlined",onClick:()=>o(!0),children:"Return to 2.x"})]}),e(ci,{open:t,onClose:()=>i(!1)}),e(ui,{open:r,onClose:()=>o(!1)})]})}const pi="_listItem_8c466_1",mi="_selectContainer_8c466_5";var et={listItem:pi,selectContainer:mi};function gi(t,i){const r=[];return t||(t=[]),i.forEach(o=>{(t.indexOf(o.id)!==-1||o.id==="administrator")&&r.push(o)}),r}function fi({additionalPermissions:t,setAdditionalPermissions:i,saving:r=!1}){const o=window.buttonizer_admin.available_roles,[a,l]=s.exports.useState(gi(t,o)),[c,d]=s.exports.useState(!1),m=u=>{const p=[];u.forEach(y=>{y.id!=="administrator"&&p.push(y.id)}),i(p)};return n(j,{disableGutters:!0,className:et.listItem,children:[e(F,{children:e(fn,{})}),e(A,{primary:"Permissions",secondary:"You can grant more roles to access the Buttonizer settings who are not an administrator."}),e("div",{className:et.selectContainer,children:e(yn,{multiple:!0,size:"small",disableCloseOnSelect:!0,disableClearable:!0,options:o.filter(u=>u.id!=="guest"),filterSelectedOptions:!0,getOptionLabel:u=>u.name,value:a,style:{marginTop:10},fullWidth:!0,onOpen:()=>d(!0),onClose:()=>{d(!1),m(a)},loading:r,onChange:(u,p)=>{p.length!=0&&(l(p),c||m(p))},renderTags:(u,p)=>u.map((y,_)=>e(he,U(z({label:y.name},p({index:_})),{disabled:y.id==="administrator"}))),noOptionsText:"Role not found",renderInput:u=>e(bn,U(z({},u),{variant:"outlined",label:"Select roles",placeholder:"Select one or more items",disabled:r,InputProps:U(z({},u.InputProps),{"data-testid":"pagerule:autocomplete-input"}),helperText:e(I,{href:"https://community.buttonizer.pro/knowledgebase/507",target:"_blank",children:"Need help? Learn how to use Permissions."})}))})})]})}function yi(){const[t,i]=s.exports.useState(window.buttonizer_admin.settings),[r,o]=s.exports.useState(!1),[a,l]=s.exports.useState(!1),[c,d]=s.exports.useState(window.buttonizer_admin.settings.adminTopBarButtonEnabled),[m,u]=s.exports.useState(window.buttonizer_admin.settings.canSendErrors),[p,y]=s.exports.useState(window.buttonizer_admin.settings.waitUntilConsent),[_,R]=s.exports.useState(window.buttonizer_admin.settings.accessRoles),[x,L]=s.exports.useState(window.buttonizer_admin.settings.googleAnalytics),B=()=>{a||(l(!0),P("/settings",{data:{admin_top_bar_show_button:c,can_send_errors:m,additional_permissions:_,google_analytics:x,wait_until_consent:p}}).then(()=>{}).catch(()=>{}).then(()=>{const k={adminTopBarButtonEnabled:c,canSendErrors:m,accessRoles:_,waitUntilConsent:p,googleAnalytics:x==="unset"?null:x};i(k),window.buttonizer_admin.settings=k,o(!1),l(!1)}))};return s.exports.useEffect(()=>{o(t.adminTopBarButtonEnabled!==c||t.canSendErrors!==m||t.waitUntilConsent!==p||t.accessRoles!==_||t.googleAnalytics!==x)},[c,m,p,_,x]),n(H,{children:[e(h,{type:"header",color:"primary",children:"Preferences"}),n($e,{disablePadding:!0,dense:!0,children:[n(j,{disableGutters:!0,children:[e(F,{children:e(vn,{})}),e(A,{primary:"Show admin top bar",secondary:"Hide Buttonizer in the admin top bar by disabling this setting.",onClick:()=>{a||d(!c)}}),e(_e,{edge:"end",color:"primary",checked:c,onChange:k=>d(k.target.checked),disabled:a})]}),n(j,{disableGutters:!0,children:[e(F,{children:e(_n,{})}),e(A,{primary:"Automatic error logging and crash reporting",secondary:"Enable automatic error logging and crash reporting in order to help us solve issues within Buttonizer! All data is anonymized automatically.",onClick:()=>{a||u(!m)}}),e(_e,{edge:"end",color:"primary",checked:m,onChange:k=>u(k.target.checked),disabled:a})]}),n(j,{disableGutters:!0,children:[e(F,{children:e(wn,{})}),e(A,{primary:"GPDR: Wait on consent",secondary:n(v,{children:[e("div",{style:{marginBottom:5},children:"Buttonizer is fully GDPR-compliant. When you enable this setting, Buttonizer-scripts will not load until a JavaScript function is called."}),e(I,{href:"https://community.buttonizer.pro/knowledgebase/1426",target:"_blank",children:"Read how to setup"})," ","or"," ",e(I,{href:"https://buttonizer.pro/gdpr/",target:"_blank",children:"how we comply with GDPR-laws"}),"."]})}),e(_e,{edge:"end",color:"primary",checked:p,onChange:k=>y(k.target.checked),disabled:a})]}),e(fi,{saving:a,additionalPermissions:_,setAdditionalPermissions:R}),t.googleAnalytics&&n(j,{disableGutters:!0,children:[e(F,{children:e(Cn,{})}),e(A,{primary:"Deprecated: Add Google Analytics tracking code",secondary:`Previously you were able to add Google Analytics tracking code via Buttonizer, ${t.googleAnalytics} is the current value. We will still add the shortcode until you found an alternative way.`,onClick:()=>{(!a||x!=="unset")&&L("unset")}}),e(g,{onClick:()=>L("unset"),disabled:a||x==="unset",style:{marginTop:15,minWidth:"fit-content"},children:"Remove Google Analytics"})]}),e(g,{variant:"contained",onClick:B,disabled:!r||a,endIcon:a&&e(Y,{size:20,style:{marginLeft:8}}),style:{marginTop:15},children:"Save changes"})]})]})}function bi(){const{setLegacyBackupDeleted:t}=w();return n(re,{severity:"success",variant:"outlined",action:e(Ie,{"aria-label":"close",color:"inherit",size:"small",onClick:()=>{t(!1)},children:e(st,{fontSize:"inherit"})}),style:{marginTop:15,background:"#edf7ed"},children:[e(K,{children:"You have deleted your old data."}),"Have fun with the new version of Buttonizer! :)"]})}function vi(){const{hasMigrated:t,legacyBackupDeleted:i}=w();return n(v,{children:[e(yi,{}),e(si,{}),e(oi,{}),t&&window.buttonizer_admin.isAdmin==="1"&&e(hi,{}),i&&e(bi,{})]})}const _i="_avatar_yq9q0_1",wi="_listItem_yq9q0_5",Ci="_secondaryInfo_yq9q0_9";var xe={avatar:_i,listItem:wi,secondaryInfo:Ci};function ki(){const t=oe(),{parseAccountData:i,setConnectionSuccessfull:r,setActionLock:o}=w(),[a,l]=s.exports.useState(!1);if(a)return e(be,{text:"Connecting..."});const c=(d,m)=>n(j,{className:xe.listItem,children:[e(ct,{children:e(dt,{className:xe.avatar,children:e(Ne,{})})}),e(A,{secondary:m,secondaryTypographyProps:{className:xe.secondaryInfo},primary:d})]});return n(v,{children:[e(ft,{children:n(b,{container:!0,style:{height:"100%"},direction:"row",children:[e(b,{item:!0,container:!0,justifyContent:"center",direction:"column",alignContent:"center",md:6,sm:12,sx:{margin:"20px 0"},children:n("div",{children:[e("img",{src:`${buttonizer_admin.assetsPath}/images/buttonizer-logo.png`,alt:"buttonizerlogo",style:{height:50}}),e(h,{style:{fontSize:27,fontWeight:600,marginTop:30},children:"Buttonizer has been installed,"}),e(h,{style:{fontSize:25},children:"you are ready to make some buttons!"}),n("div",{style:{marginTop:30,maxWidth:300},children:[e(mt,{buttonProps:{variant:"contained",size:"large",color:"secondary",endIcon:e(J,{}),sx:{padding:"15px 30px"}},buttonText:"Start using Buttonizer",onConnect:d=>{l(!1),o("no-lock"),i(d.data),r(!0),t("/")},onLoading:d=>l(d)}),e(h,{style:{fontSize:15,marginTop:20,marginBottom:60},children:"Go to your dashboard to create, manage and edit your buttons."})]})]})}),n(b,{container:!0,justifyContent:"center",alignContent:"center",direction:"column",item:!0,md:6,sm:12,sx:{margin:"20px 0"},children:[e(h,{style:{fontSize:27,fontWeight:600},children:"This is Buttonizer"}),n($e,{size:"large",children:[c("Widgets","WhatsApp, Messenger and contact form"),c("Navigate with URL"),c("Open pop up"),c("Social media sharing"),c("Fully customizable","Style your floating content"),c("Over 40+ actions","And much more")]})]})]})}),e(gt,{})]})}const zi="_helpContainer_jsvok_1",xi="_cardButton_jsvok_5",Si="_helpContainerText_jsvok_33";var ue={helpContainer:zi,cardButton:xi,helpContainerText:Si};function Ti(){const t=({imgSrc:i,href:r,title:o,description:a,button:l="Learn more"})=>e(kn,{children:e(zn,{href:`${r}?utm_source=wp-plugin-support`,type:"link",target:"_blank",className:ue.cardButton,children:n(xn,{className:ue.cardContent,children:[e("img",{src:i,alt:"Knowledge base",draggable:!1}),e(h,{variant:"h5",children:o}),e(h,{className:ue.helpContainerText,color:"textSecondary",component:"div",children:a}),e(g,{endIcon:e(Sn,{}),color:"secondary",children:l})]})})});return n("div",{children:[n(H,{children:[e(h,{color:"primary",type:"header",children:"Need some help?"}),e(h,{type:"content",color:"primary",children:"Do you need some help? We can help you with everything! Check out our Buttonizer Community, knowledge base or we can help you with our support."})]}),n("div",{className:ue.helpContainer,children:[e(t,{imgSrc:`${buttonizer_admin.assetsPath}/images/support/knowledge-base.svg`,title:"Knowledge base",description:"Learn how to use our application like a pro",href:"https://r.buttonizer.io/support/knowledgebase"}),e(t,{imgSrc:`${buttonizer_admin.assetsPath}/images/support/community.svg`,title:"Forums",description:"Give and Get help from your peers and our team",href:"https://r.buttonizer.io/support/community"}),e(t,{imgSrc:`${buttonizer_admin.assetsPath}/images/support/tickets.svg`,title:"Tickets",description:"Need support that requires privacy? Submit a private ticket",href:"https://r.buttonizer.io/support/tickets"})]})]})}function Bi(){return n(H,{children:[e(h,{type:"header",color:"primary",children:"Oh no! Page not found :("}),n(h,{type:"body1",color:"primary",children:["Sorry about that. If we linked to something wrong in our plugin, please let us know by giving us feedback"," ",e(I,{href:"https://community.buttonizer.pro/",target:"_blank",color:"secondary",children:"on our Buttonizer Community!"})]}),e(g,{component:Tn,to:"/",variant:"outlined",type:"link",children:"Back to overview"})]})}const tt={blogs:"wp/v2/posts",pages:"wp/v2/pages",categories:"wp/v2/categories"},nt={blogs:"_fields[]=title&_fields[]=id",pages:"_fields[]=title&_fields[]=id",categories:"_fields[]=name&_fields[]=id"};function Ii(t,i){if(t==="roles"){i(window.buttonizer_admin.available_roles);return}let r=`${buttonizer_admin.api}${tt[t]}?${nt[t]}&per_page=100`;return buttonizer_admin.isPlain==!0&&(r=`${buttonizer_admin.api.slice(0,-1)}${encodeURIComponent("/"+tt[t])}&${nt[t]}&per_page=100`),Se({url:r,method:"GET",headers:{"X-WP-Nonce":buttonizer_admin.nonce}}).then(({data:o})=>{i(o.map(({id:a,title:l,name:c=null})=>{var d;return{id:a,name:(d=l==null?void 0:l.rendered)!=null?d:c}}))}).catch(()=>{})}const Li="_iframe_13azj_1";var $i={iframe:Li};const rt=(t,i,r,o={})=>{t.contentWindow.postMessage({eventType:"buttonizer",messageType:r,message:o},i)};function it(){const t=oe(),i=s.exports.useRef(),{cachedEditorSession:r,setCachedEditorSession:o,sessionStarting:a,startSession:l}=w();return s.exports.useEffect(()=>{r===null&&!a&&l()},[r]),s.exports.useEffect(()=>{const c=({data:d,origin:m})=>{const{eventType:u,messageType:p,message:y}=d;u==="buttonizer"&&(p==="connection"&&y==="ready"&&rt(i.current,m,"platform","wordpress"),p==="close_editor"&&t("/"),p==="request_data"&&Ii(y,_=>{rt(i.current,m,`reply_${y}`,_)}))};return window.addEventListener("message",c,!1),()=>{window.removeEventListener("message",c),o(null)}},[]),!r||a?e(be,{text:"Starting editor session..."}):e("iframe",{src:En(r),className:$i.iframe,ref:i,referrerPolicy:"origin"})}function Ni(){const{actionLock:t}=w();return t==="editor"?e(it,{}):t==="migration"?e(yr,{}):t==="setup"?e(ki,{}):e(Bn,{children:n(q,{path:"/",element:e(or,{}),children:[e(q,{path:"/",element:e(In,{to:"/overview",replace:!0})}),e(q,{path:"/overview",element:e(ni,{})}),e(q,{path:"/settings",element:e(vi,{})}),e(q,{path:"/support",element:e(Ti,{})}),e(q,{path:"/editor",element:e(it,{})}),e(q,{path:"*",element:e(Bi,{})})]})})}const Ai="https://84c09e1dec414d9aa9a7663511fb3027@tracker.buttonizer.pro/7",Pi={}.VITE_APP_VERSION;Ln({dsn:Ai,integrations:[new $n],release:Pi,environment:"production",tracesSampleRate:1,beforeSend:t=>{var i;return(i=buttonizer_admin==null?void 0:buttonizer_admin.settings)!=null&&i.canSendErrors?t:null}});Nn.createRoot(document.getElementById("root")).render(e(An,{injectFirst:!0,children:e(at,{theme:ut,children:e(Wn,{children:e(Ni,{})})})}));
assets/app/index.html CHANGED
@@ -5,7 +5,7 @@
5
  <link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Vite App</title>
8
- <script type="module" crossorigin src="/index.200e7634.js"></script>
9
  <link rel="modulepreload" href="/vendor.9a5cb22f.js">
10
  <link rel="stylesheet" href="/index.8d4900f2.css">
11
  </head>
5
  <link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Vite App</title>
8
+ <script type="module" crossorigin src="/index.fe8002a5.js"></script>
9
  <link rel="modulepreload" href="/vendor.9a5cb22f.js">
10
  <link rel="stylesheet" href="/index.8d4900f2.css">
11
  </head>
assets/app/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "index.html": {
3
- "file": "index.200e7634.js",
4
  "src": "index.html",
5
  "isEntry": true,
6
  "imports": [
1
  {
2
  "index.html": {
3
+ "file": "index.fe8002a5.js",
4
  "src": "index.html",
5
  "isEntry": true,
6
  "imports": [
buttonizer.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Buttonizer - Smart Floating Action Button
4
  * Plugin URI: https://buttonizer.io
5
  * Description: The Buttonizer is a new way to give a boost to your number of interactions, actions and conversions from your website visitor by adding one or multiple Customizable Smart Floating Button in the corner of your website.
6
- * Version: 3.3.0
7
  * Author: Buttonizer
8
  * Author URI: https://buttonizer.pro
9
  * License: GPLv3
@@ -24,7 +24,7 @@
24
  */
25
 
26
  // Define current Buttonizer version
27
- define('BUTTONIZER_VERSION', '3.3.0');
28
  define('BUTTONIZER_PLUGIN_FILE', __FILE__);
29
 
30
  // Get environment vars
3
  * Plugin Name: Buttonizer - Smart Floating Action Button
4
  * Plugin URI: https://buttonizer.io
5
  * Description: The Buttonizer is a new way to give a boost to your number of interactions, actions and conversions from your website visitor by adding one or multiple Customizable Smart Floating Button in the corner of your website.
6
+ * Version: 3.3.1
7
  * Author: Buttonizer
8
  * Author URI: https://buttonizer.pro
9
  * License: GPLv3
24
  */
25
 
26
  // Define current Buttonizer version
27
+ define('BUTTONIZER_VERSION', '3.3.1');
28
  define('BUTTONIZER_PLUGIN_FILE', __FILE__);
29
 
30
  // Get environment vars
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Buttonizer, freemius
3
  Buy plugin: https://buttonizer.io
4
  Tags: Conversion, action button, call, marketing, Social Sharing
5
  Requires at least: 4.7
6
- Tested up to: 6.0
7
- Stable tag: 3.3.0
8
  Requires PHP: 7.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -236,6 +236,16 @@ Languages can have a different direction of writing and reading? While languages
236
 
237
  == Changelog ==
238
 
 
 
 
 
 
 
 
 
 
 
239
  = 3.3.0 =
240
  Release date: October 25, 2022
241
 
3
  Buy plugin: https://buttonizer.io
4
  Tags: Conversion, action button, call, marketing, Social Sharing
5
  Requires at least: 4.7
6
+ Tested up to: 6.1
7
+ Stable tag: 3.3.1
8
  Requires PHP: 7.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
236
 
237
  == Changelog ==
238
 
239
+ = 3.3.1 =
240
+ Release date: October 27, 2022
241
+
242
+ **Changelog:**
243
+ - New: Spanish translation for the editor. [Help us translating Buttonizer](https://r.buttonizer.io/translate)
244
+ - Fix: Fixed issue editor not loading in translations when WordPress language is supported
245
+ - Fix: Workaround for when `/wp-json/` API path is not available when permalink is set to 'plain'
246
+
247
+ If you experience bugs, problems or you just have some feedback, let us know on our [Buttonizer community](https://community.buttonizer.pro/)!
248
+
249
  = 3.3.0 =
250
  Release date: October 25, 2022
251