diff --git a/assets/admin/wizard.asset.php b/assets/admin/wizard.asset.php index bfe2025..5bca259 100644 --- a/assets/admin/wizard.asset.php +++ b/assets/admin/wizard.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '69452a2e9cdb5c173b9e'); + array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'dbb3932ddfcb8fb8a6d5'); diff --git a/assets/admin/wizard.js b/assets/admin/wizard.js index a4a38b1..e4196a5 100644 --- a/assets/admin/wizard.js +++ b/assets/admin/wizard.js @@ -1 +1 @@ -(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.ReactDOM,a=window.wp.element,n=window.wp.components,i=window.lodash,r=window.wp.apiFetch;var s=t.n(r);s().use(s().createNonceMiddleware(window.gtmkitSettings.nonce)),s().use(s().createRootURLMiddleware(window.gtmkitSettings.root));const o=async(t,e,a=null,n=!1)=>{let i={};try{i=await s()({path:t,method:e,...a&&{data:a}})}catch(a){return{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===n?i:!0===i.success?i.data:{}},l=window.wp.i18n,c=(t,e)=>{const a={...t};switch(e.type){case"FETCH_SETTINGS":a.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},a.stateSettings=e.payload.stateSettings,a.siteData=e.payload.siteData,a.notifications=e.payload.notifications,a.installData=e.payload.installData,a.isPending=!1,a.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(a.notice=(0,l.__)("An error occurred.","gtm-kit"),a.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":a.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":a.fetchedSettings=e.payload.fetchedSettings,a.stateSettings=e.payload.stateSettings,a.isPending=!1,a.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,a.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,l.__)("An error occurred.","gtm-kit"):(0,l.__)("Saved Successfully.","gtm-kit"),a.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":a.fetchedSettings=e.payload.fetchedSettings||a.fetchedSettings,a.stateSettings=e.payload.stateSettings||a.stateSettings,a.isPending=e.payload.isPending||a.isPending,a.notice=e.payload.notice||a.notice,a.hasError=e.payload.hasError||a.hasError,a.canSave=e.payload.canSave||a.canSave,a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData,a.supportTicket=e.payload.supportTicket||a.supportTicket,a.isSendingLicenseKey=e.payload.isSendingLicenseKey||a.isSendingLicenseKey,a.licenseKey=e.payload.licenseKey||a.licenseKey;break;case"SEND_SUPPORT_DATA_BEFORE":a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData;break;case"SEND_SUPPORT_DATA":a.isSendingSystemData=!1,a.isSystemDataSent=e.payload.isSystemDataSent||a.isSystemDataSent,a.systemDataMessage=e.payload.systemDataMessage||a.systemDataMessage;break;case"SEND_LICENSE_KEY_BEFORE":a.isSendingLicenseKey=e.payload.isSendingLicenseKey||a.isSendingLicenseKey;break;case"SEND_LICENSE_KEY":a.isSendingLicenseKey=!1,a.isLicenseKeySent=e.payload.isLicenseKeySent||a.isLicenseKeySent,a.licenseKeyMessage=e.payload.licenseKeyMessage||a.licenseKeyMessage;break;case"SEND_NOTIFICATION_STATUS_BEFORE":a.isUpdatingNotifications=e.payload.isUpdatingNotifications||a.isUpdatingNotifications;break;case"SEND_NOTIFICATION_STATUS":a.isUpdatingNotifications=!1,a.isNotificationStatusSent=e.payload.isNotificationStatusSent||a.isNotificationStatusSent,a.notifications=e.payload.notifications||a.Notifications}return a},m=window.ReactJSXRuntime,g=(0,a.createContext)(),u=t=>{const[e,n]=(0,a.useReducer)(c,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:"",licenseKey:"",isLicensenKeySent:!1,licenseKeyMessage:"",notifications:{}}),r=async()=>{const t=window.gtmkitSettings.settings?window.gtmkitSettings.settings:{},e=window.gtmkitSettings.site_data?window.gtmkitSettings.site_data:{},a=window.gtmkitSettings.notifications?window.gtmkitSettings.notifications:{metrics:{total:1}},i="wizard"===window.gtmkitSettings.currentPage?window.gtmkitSettings.install_data:{};n({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,notifications:a,installData:i}})},s=async t=>{n({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{r()}),[]);const l={useDispatch:t=>{n(t)},useUpdateSettings:async()=>{n({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(a=e.stateSettings,o("gtmkit/v1/set-options","POST",a));var a;n({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:r,useUpdateState:s,useUpdateStateSettings:async(t,a,n)=>{const r=JSON.parse(JSON.stringify(e.stateSettings));let o;r[t][a]=n,o=!(0,i.isEqual)(r,e.fetchedSettings),s({stateSettings:r,canSave:o})},useImportSettings:async(t,a)=>{const n=JSON.parse(JSON.stringify(e.stateSettings));let r;const o={};o.general={...n.general,...a.general},"integrations"in a&&(o.integrations={...n.integrations,...a.integrations}),r=!(0,i.isEqual)(o,e.fetchedSettings),s({stateSettings:o,canSave:r})},useUpdateSupportTicket:async t=>{s({supportTicket:t})},useSendSystemData:async()=>{n({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(a=e.supportTicket,o("gtmkit/v1/send-support-data","POST",a,!0));var a;n({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useUpdateLicenseKey:async t=>{s({licenseKey:t})},useSendLicenseKey:async()=>{n({type:"SEND_LICENSE_KEY_BEFORE",payload:{isSendingLicenseKey:!0}});const t=await(a=e.licenseKey,o("gtmkit/v1/send-license-key","POST",a,!0));var a;n({type:"SEND_LICENSE_KEY",payload:{isSendingLicenseKey:!1,isLicenseKeySent:t.success,licenseKeyMessage:t.data}})},useSetNotificationStatus:async(t,e)=>{n({type:"SEND_NOTIFICATION_STATUS_BEFORE",payload:{isUpdatingNotifications:!0}});const a={"notification-id":t,action:e},i=await(t=>o("gtmkit/v1/set-notification-status","POST",t,!0))(a);n({type:"SEND_NOTIFICATION_STATUS",payload:{isUpdatingNotifications:!1,isNotificationStatusSent:i.success,notifications:i.data}})},useSettings:e.stateSettings,useIsPending:e.isPending,useNotice:e.notice,useHasError:e.hasError,useCanSave:e.canSave,useSiteData:e.siteData,useInstallData:e.installData,useIsSending:e.isSendingSystemData,useSupportTicket:e.supportTicket,useIsSystemDataSent:e.isSystemDataSent,useSystemDataMessage:e.systemDataMessage,useIsSendingLicenseKey:e.isSendingLicenseKey,useLicenseKey:e.licenseKey,useIsLicenseKeySent:e.isLicenseKeySent,useLicenseKeyMessage:e.licenseKeyMessage,useNotifications:e.notifications,useIsUpdatingNotifications:e.isUpdatingNotifications,useUserRoles:window.gtmkitSettings.user_roles?window.gtmkitSettings.user_roles:[],isPremium:!!window.gtmkitSettings.isPremium&&window.gtmkitSettings.isPremium};return(0,m.jsx)(g.Provider,{value:l,children:t.children})},d=window.React;function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0&&(e.hash=t.substr(a),t=t.substr(0,a));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}var M;function v(t,e,a){return void 0===a&&(a="/"),function(t,e,a,n){let i=P(("string"==typeof e?E(e):e).pathname||"/",a);if(null==i)return null;let r=j(t);!function(t){t.sort(((t,e)=>t.score!==e.score?e.score-t.score:function(t,e){return t.length===e.length&&t.slice(0,-1).every(((t,a)=>t===e[a]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(r);let s=null;for(let t=0;null==s&&t{let s={relativePath:void 0===r?t.path||"":r,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};s.relativePath.startsWith("/")&&(y(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(n.length));let o=K([n,s.relativePath]),l=a.concat(s);t.children&&t.children.length>0&&(y(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),j(t.children,e,l,o)),(null!=t.path||t.index)&&e.push({path:o,score:O(o,t.index),routesMeta:l})};return t.forEach(((t,e)=>{var a;if(""!==t.path&&null!=(a=t.path)&&a.includes("?"))for(let a of w(t.path))i(t,e,a);else i(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[a,...n]=e,i=a.endsWith("?"),r=a.replace(/\?$/,"");if(0===n.length)return i?[r,""]:[r];let s=w(n.join("/")),o=[];return o.push(...s.map((t=>""===t?r:[r,t].join("/")))),i&&o.push(...s),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(M||(M={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const _=/^:[\w-]+$/,T=3,b=2,L=1,D=10,I=-2,C=t=>"*"===t;function O(t,e){let a=t.split("/"),n=a.length;return a.some(C)&&(n+=I),e&&(n+=b),a.filter((t=>!C(t))).reduce(((t,e)=>t+(_.test(e)?T:""===e?L:D)),n)}function U(t,e,a){void 0===a&&(a=!1);let{routesMeta:n}=t,i={},r="/",s=[];for(let t=0;t(n.push({paramName:e,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(n.push({paramName:"*"}),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}(t.path,t.caseSensitive,t.end),i=e.match(a);if(!i)return null;let r=i[0],s=r.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:n.reduce(((t,e,a)=>{let{paramName:n,isOptional:i}=e;if("*"===n){let t=o[a]||"";s=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}const l=o[a];return t[n]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),t}),{}),pathname:r,pathnameBase:s,pattern:t}}function z(t){try{return t.split("/").map((t=>decodeURIComponent(t).replace(/\//g,"%2F"))).join("/")}catch(e){return S(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+e+")."),t}}function P(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,n=t.charAt(a);return n&&"/"!==n?null:t.slice(a)||"/"}function R(t,e,a,n){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function B(t,e){let a=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?a.map(((t,e)=>e===a.length-1?t.pathname:t.pathnameBase)):a.map((t=>t.pathnameBase))}function G(t,e,a,n){let i;void 0===n&&(n=!1),"string"==typeof t?i=E(t):(i=p({},t),y(!i.pathname||!i.pathname.includes("?"),R("?","pathname","search",i)),y(!i.pathname||!i.pathname.includes("#"),R("#","pathname","hash",i)),y(!i.search||!i.search.includes("#"),R("#","search","hash",i)));let r,s=""===t||""===i.pathname,o=s?"/":i.pathname;if(null==o)r=a;else{let t=e.length-1;if(!n&&o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t-=1;i.pathname=e.join("/")}r=t>=0?e[t]:"/"}let l=function(t,e){void 0===e&&(e="/");let{pathname:a,search:n="",hash:i=""}="string"==typeof t?E(t):t,r=a?a.startsWith("/")?a:function(t,e){let a=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?a.length>1&&a.pop():"."!==t&&a.push(t)})),a.length>1?a.join("/"):"/"}(a,e):e;return{pathname:r,search:F(n),hash:W(i)}}(i,r),c=o&&"/"!==o&&o.endsWith("/"),m=(s||"."===o)&&a.endsWith("/");return l.pathname.endsWith("/")||!c&&!m||(l.pathname+="/"),l}const K=t=>t.join("/").replace(/\/\/+/g,"/"),Y=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),F=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",W=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const Q=["post","put","patch","delete"],$=(new Set(Q),["get",...Q]);function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0})),d.useCallback((function(n,i){void 0===i&&(i={}),a.current&&("number"==typeof n?t.navigate(n):t.navigate(n,J({fromRouteId:e},i)))}),[t,e])}():function(){et()||y(!1);let t=d.useContext(H),{basename:e,future:a,navigator:n}=d.useContext(V),{matches:i}=d.useContext(q),{pathname:r}=at(),s=JSON.stringify(B(i,a.v7_relativeSplatPath)),o=d.useRef(!1);return nt((()=>{o.current=!0})),d.useCallback((function(a,i){if(void 0===i&&(i={}),!o.current)return;if("number"==typeof a)return void n.go(a);let l=G(a,JSON.parse(s),r,"path"===i.relative);null==t&&"/"!==e&&(l.pathname="/"===l.pathname?e:K([e,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[e,n,s,r,t])}()}function rt(t,e,a,n){et()||y(!1);let{navigator:i}=d.useContext(V),{matches:r}=d.useContext(q),s=r[r.length-1],o=s?s.params:{},l=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let c,m=at();if(e){var g;let t="string"==typeof e?E(e):e;"/"===l||(null==(g=t.pathname)?void 0:g.startsWith(l))||y(!1),c=t}else c=m;let u=c.pathname||"/",p=u;if("/"!==l){let t=l.replace(/^\//,"").split("/");p="/"+u.replace(/^\//,"").split("/").slice(t.length).join("/")}let k=v(t,{pathname:p}),S=function(t,e,a,n){var i;if(void 0===e&&(e=[]),void 0===a&&(a=null),void 0===n&&(n=null),null==t){var r;if(!a)return null;if(a.errors)t=a.matches;else{if(!(null!=(r=n)&&r.v7_partialHydration&&0===e.length&&!a.initialized&&a.matches.length>0))return null;t=a.matches}}let s=t,o=null==(i=a)?void 0:i.errors;if(null!=o){let t=s.findIndex((t=>t.route.id&&void 0!==(null==o?void 0:o[t.route.id])));t>=0||y(!1),s=s.slice(0,Math.min(s.length,t+1))}let l=!1,c=-1;if(a&&n&&n.v7_partialHydration)for(let t=0;t=0?s.slice(0,c+1):[s[0]];break}}}return s.reduceRight(((t,n,i)=>{let r,m=!1,g=null,u=null;var p;a&&(r=o&&n.route.id?o[n.route.id]:void 0,g=n.route.errorElement||ot,l&&(c<0&&0===i?(dt[p="route-fallback"]||(dt[p]=!0),m=!0,u=null):c===i&&(m=!0,u=n.route.hydrateFallbackElement||null)));let h=e.concat(s.slice(0,i+1)),k=()=>{let e;return e=r?g:m?u:n.route.Component?d.createElement(n.route.Component,null):n.route.element?n.route.element:t,d.createElement(ct,{match:n,routeContext:{outlet:t,matches:h,isDataRoute:null!=a},children:e})};return a&&(n.route.ErrorBoundary||n.route.errorElement||0===i)?d.createElement(lt,{location:a.location,revalidation:a.revalidation,component:g,error:r,children:k(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):k()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},o,t.params),pathname:K([l,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?l:K([l,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),r,a,n);return e&&S?d.createElement(X.Provider,{value:{location:J({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:h.Pop}},S):S}function st(){let t=function(){var t;let e=d.useContext(tt),a=function(){let t=d.useContext(Z);return t||y(!1),t}(gt.UseRouteError),n=ut(gt.UseRouteError);return void 0!==e?e:null==(t=a.errors)?void 0:t[n]}(),e=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},e),a?d.createElement("pre",{style:n},a):null,null)}const ot=d.createElement(st,null);class lt extends d.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||"idle"!==e.revalidation&&"idle"===t.revalidation?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:void 0!==t.error?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){console.error("React Router caught the following error during render",t,e)}render(){return void 0!==this.state.error?d.createElement(q.Provider,{value:this.props.routeContext},d.createElement(tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:e,match:a,children:n}=t,i=d.useContext(H);return i&&i.static&&i.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=a.route.id),d.createElement(q.Provider,{value:e},n)}var mt=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(mt||{}),gt=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(gt||{});function ut(t){let e=function(){let t=d.useContext(q);return t||y(!1),t}(),a=e.matches[e.matches.length-1];return a.route.id||y(!1),a.route.id}const dt={};function pt(t){let{to:e,replace:a,state:n,relative:i}=t;et()||y(!1);let{future:r,static:s}=d.useContext(V),{matches:o}=d.useContext(q),{pathname:l}=at(),c=it(),m=G(e,B(o,r.v7_relativeSplatPath),l,"path"===i),g=JSON.stringify(m);return d.useEffect((()=>c(JSON.parse(g),{replace:a,state:n,relative:i})),[c,g,i,a,n]),null}function ht(t){y(!1)}function kt(t){let{basename:e="/",children:a=null,location:n,navigationType:i=h.Pop,navigator:r,static:s=!1,future:o}=t;et()&&y(!1);let l=e.replace(/^\/*/,"/"),c=d.useMemo((()=>({basename:l,navigator:r,static:s,future:J({v7_relativeSplatPath:!1},o)})),[l,o,r,s]);"string"==typeof n&&(n=E(n));let{pathname:m="/",search:g="",hash:u="",state:p=null,key:k="default"}=n,S=d.useMemo((()=>{let t=P(m,l);return null==t?null:{location:{pathname:t,search:g,hash:u,state:p,key:k},navigationType:i}}),[l,m,g,u,p,k,i]);return null==S?null:d.createElement(V.Provider,{value:c},d.createElement(X.Provider,{children:a,value:S}))}function yt(t){let{children:e,location:a}=t;return rt(St(e),a)}function St(t,e){void 0===e&&(e=[]);let a=[];return d.Children.forEach(t,((t,n)=>{if(!d.isValidElement(t))return;let i=[...e,n];if(t.type===d.Fragment)return void a.push.apply(a,St(t.props.children,i));t.type!==ht&&y(!1),t.props.index&&t.props.children&&y(!1);let r={id:t.props.id||i.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(r.children=St(t.props.children,i)),a.push(r)})),a}d.startTransition,new Promise((()=>{})),d.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(t){}new Map;const ft=d.startTransition;function xt(t){let{basename:e,children:a,future:n,window:i}=t,r=d.useRef();var s;null==r.current&&(r.current=(void 0===(s={window:i,v5Compat:!0})&&(s={}),function(t,e,a,n){void 0===n&&(n={});let{window:i=document.defaultView,v5Compat:r=!1}=n,s=i.history,o=h.Pop,l=null,c=m();function m(){return(s.state||{idx:null}).idx}function g(){o=h.Pop;let t=m(),e=null==t?null:t-c;c=t,l&&l({action:o,location:d.location,delta:e})}function u(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,a="string"==typeof t?t:N(t);return a=a.replace(/ $/,"%20"),y(e,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,e)}null==c&&(c=0,s.replaceState(p({},s.state,{idx:c}),""));let d={get action(){return o},get location(){return t(i,s)},listen(t){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(k,g),l=t,()=>{i.removeEventListener(k,g),l=null}},createHref:t=>e(i,t),createURL:u,encodeLocation(t){let e=u(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){o=h.Push;let n=x(d.location,t,e);a&&a(n,t),c=m()+1;let g=f(n,c),u=d.createHref(n);try{s.pushState(g,"",u)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(u)}r&&l&&l({action:o,location:d.location,delta:1})},replace:function(t,e){o=h.Replace;let n=x(d.location,t,e);a&&a(n,t),c=m();let i=f(n,c),g=d.createHref(n);s.replaceState(i,"",g),r&&l&&l({action:o,location:d.location,delta:0})},go:t=>s.go(t)};return d}((function(t,e){let{pathname:a="/",search:n="",hash:i=""}=E(t.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),x("",{pathname:a,search:n,hash:i},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let a=t.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let e=t.location.href,a=e.indexOf("#");n=-1===a?e:e.slice(0,a)}return n+"#"+("string"==typeof e?e:N(e))}),(function(t,e){S("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),s)));let o=r.current,[l,c]=d.useState({action:o.action,location:o.location}),{v7_startTransition:m}=n||{},g=d.useCallback((t=>{m&&ft?ft((()=>c(t))):c(t)}),[c,m]);return d.useLayoutEffect((()=>o.listen(g)),[o,g]),d.createElement(kt,{basename:e,children:a,location:l.location,navigationType:l.action,navigator:o,future:n})}var Nt,Et;e.flushSync,d.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"}(Nt||(Nt={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Et||(Et={}));const Mt=(t="general",e="")=>{const a=window.gtmkitSettings.adminPageUrl;return e?`${a}${t}#/${e}`:`${a}${t}`},vt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:i,useIsPending:r}=(0,a.useContext)(g),s=it();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"md:gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-16 gtmkit-mb-20",children:[(0,m.jsxs)("div",{className:"",children:[(0,m.jsx)("div",{className:"gtmkit-settings-field-wrap gtmkit-w-full !gtmkit-px-8 ",children:(0,m.jsx)(n.TextControl,{label:(0,l.__)("Container ID","gtm-kit"),placeholder:(0,l.__)("Enter Container ID","gtm-kit"),value:t&&t.general.gtm_id,className:"gtmkit-text-center",onChange:t=>e("general","gtm_id",t)})}),(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsxs)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),s("/essential-settings",{replace:!0})},disabled:r||!t.general.gtm_id.includes("-"),children:[(0,l.__)("Save and continue","gtm-kit"),r?(0,m.jsx)(n.Spinner,{}):""]})})]}),(0,m.jsxs)("div",{className:"gtmkit-mt-8 gtmkit-border gtmkit-p-6 gtmkit-text-left gtmkit-text-color-grey gtmkit-text-center",children:[(0,m.jsx)("h2",{className:"gtmkit-font-bold gtmkit-text-base gtmkit-mb-4",children:"Need help?"}),(0,m.jsxs)("p",{className:"gtmkit-mb-6",children:[(0,l.__)("Find your GTM container ID on","gtm-kit"),(0,m.jsx)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-underline",href:"https://tagmanager.google.com/",target:"_blank",rel:"noreferrer",children:"Google Tag Manager"})]}),(0,m.jsxs)("p",{children:[(0,l.__)("It should look something like this:","gtm-kit")," ","GTM-12ZM7SF4"]})]})]}),(0,m.jsxs)("div",{className:"gtmkit-mt-3 md:gtmkit-mt-10 gtmkit-text-color-grey gtmkit-text-base",children:[(0,m.jsx)("span",{className:"gtmkit-block",children:(0,l.__)("No thanks. I know what I'm doing.","gtm-kit")}),(0,m.jsx)("a",{className:"gtmkit-underline gtmkit-ml-4",href:Mt(),children:(0,l.__)("Go to the dashboard.","gtm-kit")})]})]})},jt=()=>{const{useImportSettings:t,useIsPending:e,useInstallData:i}=(0,a.useContext)(g),[r,s]=(0,a.useState)(!0),o=Object.keys(i.import_data)[0],[c,m]=(0,a.useState)(o),u=[];return Object.keys(i.import_data).forEach((t=>{u.push({value:t,label:i.import_data[t].name})})),r?(0,d.createElement)(d.Fragment,null,(0,d.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto gtmkit-border gtmkit-p-8 gtmkit-my-8"},(0,d.createElement)("h2",{className:"gtmkit-text-lg gtmkit-text-color-heading gtmkit-font-bold"},(0,l.__)("Would you like to import plugin settings?","gtm-kit")),(0,d.createElement)("p",{className:"gtmkit-text-base gtmkit-my-4 gtmkit-text-color-grey"},(0,l.__)("We have found the configuration of other plugins in the database.","gtm-kit")," ",(0,l.__)("Would you like to import your settings to GTM Kit?","gtm-kit")),(0,d.createElement)(n.RadioControl,{help:(0,l.__)("Select the plugin you want to import settings from.","gtm-kit"),selected:c,options:u,onChange:t=>m(t)}),(0,d.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,d.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{t(c,i.import_data[c]),s(!1)}},(0,d.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,l.__)("Yes","gtm-kit")),e?(0,d.createElement)(n.Spinner,null):""),(0,d.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{s(!1)}},(0,d.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,l.__)("No","gtm-kit")),e?(0,d.createElement)(n.Spinner,null):"")))):(0,d.createElement)(vt,null)},wt=()=>{const{useInstallData:t}=(0,a.useContext)(g),{firstInstall:e}=t,{importAvailable:n}=t;return(0,d.createElement)("div",{className:"gtmkit-text-center"},(0,d.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,l.__)("You've successfully installed GTM Kit!","gtm-kit")),(0,d.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,l.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit"))),e&&n?(0,d.createElement)(jt,null):(0,d.createElement)(vt,null))},_t=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:i,useIsPending:r,useInstallData:s}=(0,a.useContext)(g),o=it();return(0,d.createElement)("div",{className:"gtmkit-text-center"},(0,d.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,l.__)("Essential Settings","gtm-kit")),(0,d.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,l.__)("There are a lot of settings in GTM Kit and we recommend that you uses our recommended settings but you can also choose to use the default settings and go through the settings at your convenience.","gtm-kit"))),(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Page type","gtm-kit"),id:"page-type"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("Include the page type i.e. page, product, category, cart, checkout etc in the datalayer?","gtm-kit"),checked:t&&t.general.datalayer_page_type,onChange:()=>{e("general","datalayer_page_type",!(t&&t.general.datalayer_page_type))}}))),s.woocommerce_integration?(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Track WooCommerce","gtm-kit"),id:"track-wooCommerce"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("Would you like to track e-commerce data from WooCommerce?","gtm-kit"),checked:t&&t.integrations.woocommerce_integration,onChange:()=>{e("integrations","woocommerce_integration",!(t&&t.integrations.woocommerce_integration))}}))):null,s.cf7_integration?(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Track Contact Form 7","gtm-kit"),id:"track-cf7"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("Would you like to track form submissions from Contact Form 7?","gtm-kit"),checked:t&&t.integrations.cf7_integration,onChange:()=>{e("integrations","cf7_integration",!(t&&t.integrations.cf7_integration))}}))):null,s.edd_integration?(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap"},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Track Easy Digital Downloads","gtm-kit"),id:"track-edd"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("Would you like to track e-commerce data from Easy Digital Downloads?","gtm-kit"),checked:t&&t.integrations.edd_integration,onChange:()=>{e("integrations","edd_integration",!(t&&t.integrations.edd_integration))}}))):null,(0,d.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,d.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),o("/share-anonymous-data",{replace:!0})},disabled:r},(0,l.__)("Save and continue","gtm-kit"),r?(0,d.createElement)(n.Spinner,null):"")))},Tt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:i,useIsPending:r,useSiteData:s}=(0,a.useContext)(g),o=it();return(0,d.createElement)(d.Fragment,null,(0,d.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,l.__)("Help improve GTM Kit","gtm-kit")),(0,d.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-4 gtmkit-text-color-grey"},(0,l.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,d.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-8 gtmkit-text-color-grey"},(0,l.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,d.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm"},(0,d.createElement)("tbody",null,(0,d.createElement)("tr",{className:""},(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Server type:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.web_server))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"PHP version number:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.php_version))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"WordPress version number:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.wordpress_version))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"WordPress multisite:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.multisite?(0,l.__)("Yes","gtm-kit"):(0,l.__)("No","gtm-kit")))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Current theme:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.current_theme))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Current site language:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.locale))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Active plugins:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("em",null,"Plugin names of all active plugins"))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Anonymized GTM Kit settings:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("em",null,"Which GTM Kit settings are active"))))),(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-max !gtmkit-px-8 gtmkit-mx-auto "},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Share anonymous data","gtm-kit"),id:"share-anonymous-data"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("I agree to share anonymous data with the development team to help improve GTM Kit. ","gtm-kit"),checked:t&&t.general.analytics_active,onChange:()=>{e("general","analytics_active",!(t&&t.general.analytics_active))}}))),(0,d.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,d.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),o("/getting-started",{replace:!0})},disabled:r},(0,l.__)("Save and continue","gtm-kit"),r?(0,d.createElement)(n.Spinner,null):"")))},bt=()=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center",children:(0,l.__)("You are ready to use GTM Kit!","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey gtmkit-text-center",children:(0,l.__)("Your Google Tag Manager Container is now sending data to Google Tag Manager.","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-mb-12 gtmkit-text-color-grey gtmkit-text-center",children:[(0,l.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit")," "]}),(0,m.jsxs)("div",{className:"gtmkit-border-2 gtmkit-max-w-lg gtmkit-mx-auto gtmkit-mb-8",children:[(0,m.jsx)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2",children:(0,l.__)("Getting Started","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4",children:[(0,l.__)("The next step is to configure your Google Tag Manager container. You will find templates for this in the GTM Templates section.","gtm-kit")," ",(0,m.jsx)("a",{className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:Mt("templates"),rel:"noreferrer",children:(0,l.__)("Go to GTM Templates","gtm-kit")})]}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4",children:[(0,l.__)("To get the most out of Google Tag Manager with GTM Kit, you should also review the tutorials.","gtm-kit")," ",(0,m.jsx)("a",{className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:Mt("help","help"),rel:"noreferrer",children:(0,l.__)("Go to Tutorials","gtm-kit")})]})]}),(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsx)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=Mt("general")},children:(0,l.__)("Go to the dashboard","gtm-kit")})})]}),Lt=[{step:1,path:"/welcome",element:"Welcome",title:(0,l.__)("Welcome","gtm-kit")},{step:2,path:"/essential-settings",element:"EssentialSettings",title:(0,l.__)("Essential Settings","gtm-kit")},{step:3,path:"/share-anonymous-data",element:"ShareAnonymousData",title:(0,l.__)("Help improve GTM Kit","gtm-kit")},{step:4,path:"/getting-started",element:"GettingStarted",title:(0,l.__)("Getting Started","gtm-kit")}],Dt=({step:t,currentStep:e,totalSteps:a})=>{if(t===a)return;let n="gtmkit-h-0.5 gtmkit-w-full";return n+=tt{if(0===t)return;let n="gtmkit-transition-opacity gtmkit-duration-500 gtmkit-absolute gtmkit-inset-0 gtmkit-border-2 gtmkit-flex gtmkit-items-center gtmkit-justify-center gtmkit-rounded-full gtmkit-opacity-100";return n+=te?" gtmkit-border-color-border":" gtmkit-border-color-primary",(0,d.createElement)(d.Fragment,null,(0,d.createElement)("span",{className:"gtmkit-relative gtmkit-shrink-0 gtmkit-z-10 gtmkit-w-8 gtmkit-h-8 gtmkit-rounded-full"},(0,d.createElement)("span",{className:n},(0,d.createElement)(It,{step:t,currentStep:e,totalSteps:a}))),(0,d.createElement)(Dt,{step:t,currentStep:e,totalSteps:a}))},Ot=()=>{const t=Lt.length-1+Lt[0].step;let e=((t,e)=>{const a=Object.keys(e);return t.filter((function(t){for(let n=0;n(0,d.createElement)(d.Fragment,null,(0,d.createElement)("header",{className:"gtmkit-text-center gtmkit-px-3"},(0,d.createElement)("h1",{className:"gtmkit-mt-3 md:gtmkit-mt-8 gtmkit-mb-4 gtmkit-w-[225px] gtmkit-inline-block"},(0,d.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNDY3LjEgMTU4Ni40IiBoZWlnaHQ9IjU0IiB2aWV3Qm94PSIwIDAgMTYwIDU0IiB3aWR0aD0iMTYwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IGZpbGw9IiM4ODgiIGhlaWdodD0iNTQiIHJ4PSI0LjI2NSIgd2lkdGg9IjE2MCIvPjxwYXRoIGQ9Im04OC42NTkgNy4wMDJoLTQ5LjI2NmMtMi45MTUgMC01LjM3OC0uMTg0LTkuMjMgMi41OTZsLTE4Ljc0MyAxMi43NTJjLTQuNTQ5IDMuMjkyLTQuNTcxIDYuMDAxIDAgOS4zMDJsMTguNzQzIDEyLjc1MWMzLjY1MiAyLjY0NiA2LjI5OSAyLjU5NyA5LjIzIDIuNTk3aDE1LjY4NiAzMy41OGMyLjkzMS0uMDU3IDUuMzk0LTEuNzg0IDUuMzQtMy45MjN2LTMyLjIxYy0uMDEyLTIuMTM0LTIuNDA5LTMuODY1LTUuMzQtMy44NjV6IiBmaWxsPSIjMzk2OWJiIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgLTEgMTAxLjk5OTg2NyA1My45OTk1NDcpIi8+PGcgZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJtYXRyaXgoMS40NjUyMDIgMCAwIDEuNDY1MjAyIC00LjU4MjQzNiAtNy41NTMxMjYpIj48cGF0aCBkPSJtMTguMzE2IDIzLjA4Nmg0LjYzMnY2LjA1MmMtLjc1LjI0NS0xLjQ1OS40MTUtMi4xMjEuNTE0LS42NjMuMDk4LTEuMzQxLjE0OC0yLjAzMy4xNDgtMS43NjQgMC0zLjEwNi0uNTE3LTQuMDM1LTEuNTU0LS45MjktMS4wMzQtMS4zOTUtMi41MTktMS4zOTUtNC40NTcgMC0xLjg4Ni41MzgtMy4zNTYgMS42MTctNC40MSAxLjA3OC0xLjA1NCAyLjU3My0xLjU3OSA0LjQ4MS0xLjU3OSAxLjIgMCAyLjM1Ny4yMzkgMy40NjkuNzE4bC0uODIzIDEuOTc5Yy0uODUtLjQyNS0xLjczNy0uNjM3LTIuNjU3LS42MzctMS4wNzEgMC0xLjkzMi4zNTgtMi41NzIgMS4wNzctLjY0NS43MTgtLjk2OCAxLjY4NS0uOTY4IDIuODk5IDAgMS4yNjcuMjYgMi4yMzMuNzggMi45MDQuNTE2LjY2NyAxLjI3MS45OTkgMi4yNjIuOTk5LjUxNyAwIDEuMDQxLS4wNTIgMS41NzItLjE1OHYtMi40MzVoLTIuMjA5em0xMS45MTIgNi41NTVoLTIuNDc0di05LjYxNGgtMy4xNzN2LTIuMDZoOC44MTZ2Mi4wNmgtMy4xNjl6bTkuOTA4IDAtMi44MTEtOS4xNThoLS4wNzJjLjEwMyAxLjg2My4xNTQgMy4xMDUuMTU0IDMuNzI4djUuNDNoLTIuMjEzdi0xMS42NzRoMy4zNjhsMi43NjQgOC45MjdoLjA0OGwyLjkzNC04LjkyN2gzLjM2OXYxMS42NzRoLTIuMzA4di01LjUyNWMwLS4yNjEgMC0uNTYxLjAwOS0uOTAzLjAwOS0uMzQxLjA0OC0xLjI0Ni4xMTItMi43MTZoLS4wNzRsLTMuMDExIDkuMTQ0eiIvPjxwYXRoIGQ9Im04OC44ODMgMzEuODk4aC0zLjgxMWwtNC4xNDctNi42Ny0xLjQxNyAxLjAxOHY1LjY1MmgtMy4zNTd2LTE1LjgzaDMuMzU3djcuMjQybDEuMzE4LTEuODYxIDQuMjkzLTUuMzgxaDMuNzI0bC01LjUyMyA3LjAwNnptMS41ODktMTUuMjMzYzAtMS4wNzUuNi0xLjYxNCAxLjgtMS42MTQgMS4xOTkgMCAxLjc5OC41MzkgMS43OTggMS42MTQgMCAuNTEyLS4xNDguOTEtLjQ1IDEuMTk2LS4yOTcuMjg0LS43NDkuNDI5LTEuMzQ4LjQyOS0xLjIgMC0xLjgtLjU0My0xLjgtMS42MjV6bTMuNDQ5IDE1LjIzM2gtMy4zMDJ2LTEyLjEwNGgzLjMwMnptOC41NjMtMi40MTNjLjU3OCAwIDEuMjcxLS4xMjggMi4wNzctLjM4djIuNDU2Yy0uODIuMzctMS44MzEuNTUyLTMuMDMxLjU1Mi0xLjMyNCAwLTIuMjgtLjMzMy0yLjg4NS0xLjAwMS0uNjAyLS42NjctLjkwMi0xLjY2OC0uOTAyLTMuMDAzdi01LjgzNWgtMS41ODV2LTEuMzk5bDEuODIzLTEuMTAzLjk0OS0yLjU1N2gyLjExNXYyLjU3OWgzLjM4OHYyLjQ4aC0zLjM4OHY1LjgzNWMwIC40NjcuMTI5LjgxNS4zOTMgMS4wNDEuMjY0LjIyMi42MTQuMzM1IDEuMDQ2LjMzNXoiLz48L2c+PC9zdmc+",alt:(0,l.__)("GTM Kit","gtm-kit"),className:"gtmkit-w-full"}))),(0,d.createElement)(Ot,null)),At=()=>(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("footer",{className:"gtm-kit-settings-footer gtmkit-my-8 gtmkit-text-color-grey",children:(0,m.jsx)("p",{className:"gtmkit-mx-auto gtmkit-max-w-max",children:(0,m.jsx)("a",{className:"gtmkit-underline",href:Mt(),children:(0,l.__)("Go to the dashboard.","gtm-kit")})})})}),zt=()=>{const{useSettings:t}=(0,a.useContext)(g);return Object.keys(t).length?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Ut,{}),(0,m.jsx)("main",{className:"gtmkit-max-w-3xl gtmkit-bg-white gtmkit-border-1 gtmkit-border-color-border gtmkit-rounded-md gtmkit-mx-auto gtmkit-py-12 gtmkit-px-16 gtmkit-text-base",children:(0,m.jsxs)(yt,{children:[(0,m.jsx)(ht,{exact:!0,path:"/welcome",element:(0,m.jsx)(wt,{})}),(0,m.jsx)(ht,{exact:!0,path:"/essential-settings",element:(0,m.jsx)(_t,{})}),(0,m.jsx)(ht,{exact:!0,path:"/share-anonymous-data",element:(0,m.jsx)(Tt,{})}),(0,m.jsx)(ht,{exact:!0,path:"/getting-started",element:(0,m.jsx)(bt,{})}),(0,m.jsx)(ht,{path:"/",element:(0,m.jsx)(pt,{replace:!0,to:"/welcome"})})]})}),(0,m.jsx)(At,{})]}):(0,m.jsx)(n.Spinner,{className:"gtm-kit-settings-page-loader"})},Pt=()=>(0,m.jsx)(xt,{basename:"/",children:(0,m.jsx)(u,{children:(0,m.jsx)(zt,{})})});document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById(window.gtmkitSettings.rootId);null!=t&&(0,e.createRoot)(t).render((0,m.jsx)(Pt,{}))}))})(); \ No newline at end of file +(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.ReactDOM,a=window.wp.element,n=window.wp.components,i=window.lodash,r=window.wp.apiFetch;var s=t.n(r);s().use(s().createNonceMiddleware(window.gtmkitSettings.nonce)),s().use(s().createRootURLMiddleware(window.gtmkitSettings.root));const o=async(t,e,a=null,n=!1)=>{let i={};try{i=await s()({path:t,method:e,...a&&{data:a}})}catch(a){return{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===n?i:!0===i.success?i.data:{}},l=window.wp.i18n,c=(t,e)=>{const a={...t};switch(e.type){case"FETCH_SETTINGS":a.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},a.stateSettings=e.payload.stateSettings,a.siteData=e.payload.siteData,a.notifications=e.payload.notifications,a.installData=e.payload.installData,a.isPending=!1,a.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(a.notice=(0,l.__)("An error occurred.","gtm-kit"),a.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":a.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":a.fetchedSettings=e.payload.fetchedSettings,a.stateSettings=e.payload.stateSettings,a.isPending=!1,a.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,a.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,l.__)("An error occurred.","gtm-kit"):(0,l.__)("Saved Successfully.","gtm-kit"),a.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":a.fetchedSettings=e.payload.fetchedSettings||a.fetchedSettings,a.stateSettings=e.payload.stateSettings||a.stateSettings,a.isPending=e.payload.isPending||a.isPending,a.notice=e.payload.notice||a.notice,a.hasError=e.payload.hasError||a.hasError,a.canSave=e.payload.canSave||a.canSave,a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData,a.supportTicket=e.payload.supportTicket||a.supportTicket,a.isSendingLicenseKey=e.payload.isSendingLicenseKey||a.isSendingLicenseKey,a.licenseKey=e.payload.licenseKey||a.licenseKey;break;case"SEND_SUPPORT_DATA_BEFORE":a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData;break;case"SEND_SUPPORT_DATA":a.isSendingSystemData=!1,a.isSystemDataSent=e.payload.isSystemDataSent||a.isSystemDataSent,a.systemDataMessage=e.payload.systemDataMessage||a.systemDataMessage;break;case"SEND_LICENSE_KEY_BEFORE":a.isSendingLicenseKey=e.payload.isSendingLicenseKey||a.isSendingLicenseKey;break;case"SEND_LICENSE_KEY":a.isSendingLicenseKey=!1,a.isLicenseKeySent=e.payload.isLicenseKeySent||a.isLicenseKeySent,a.licenseKeyMessage=e.payload.licenseKeyMessage||a.licenseKeyMessage;break;case"SEND_NOTIFICATION_STATUS_BEFORE":a.isUpdatingNotifications=e.payload.isUpdatingNotifications||a.isUpdatingNotifications;break;case"SEND_NOTIFICATION_STATUS":a.isUpdatingNotifications=!1,a.isNotificationStatusSent=e.payload.isNotificationStatusSent||a.isNotificationStatusSent,a.notifications=e.payload.notifications||a.Notifications}return a},m=window.ReactJSXRuntime,g=(0,a.createContext)(),u=t=>{const[e,n]=(0,a.useReducer)(c,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:"",licenseKey:"",isLicensenKeySent:!1,licenseKeyMessage:"",notifications:{}}),r=async()=>{const t=window.gtmkitSettings.settings?window.gtmkitSettings.settings:{},e=window.gtmkitSettings.site_data?window.gtmkitSettings.site_data:{},a=window.gtmkitSettings.notifications?window.gtmkitSettings.notifications:{metrics:{total:1}},i="wizard"===window.gtmkitSettings.currentPage?window.gtmkitSettings.install_data:{};n({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,notifications:a,installData:i}})},s=async t=>{n({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{r()}),[]);const l={useDispatch:t=>{n(t)},useUpdateSettings:async()=>{n({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(a=e.stateSettings,o("gtmkit/v1/set-options","POST",a));var a;n({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:r,useUpdateState:s,useUpdateStateSettings:async(t,a,n)=>{const r=JSON.parse(JSON.stringify(e.stateSettings));let o;r[t][a]=n,o=!(0,i.isEqual)(r,e.fetchedSettings),s({stateSettings:r,canSave:o})},useImportSettings:async(t,a)=>{const n=JSON.parse(JSON.stringify(e.stateSettings));let r;const o={};o.general={...n.general,...a.general},"integrations"in a&&(o.integrations={...n.integrations,...a.integrations}),r=!(0,i.isEqual)(o,e.fetchedSettings),s({stateSettings:o,canSave:r})},useUpdateSupportTicket:async t=>{s({supportTicket:t})},useSendSystemData:async()=>{n({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(a=e.supportTicket,o("gtmkit/v1/send-support-data","POST",a,!0));var a;n({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useUpdateLicenseKey:async t=>{s({licenseKey:t})},useSendLicenseKey:async()=>{n({type:"SEND_LICENSE_KEY_BEFORE",payload:{isSendingLicenseKey:!0}});const t=await(a=e.licenseKey,o("gtmkit/v1/send-license-key","POST",a,!0));var a;n({type:"SEND_LICENSE_KEY",payload:{isSendingLicenseKey:!1,isLicenseKeySent:t.success,licenseKeyMessage:t.data}})},useSetNotificationStatus:async(t,e)=>{n({type:"SEND_NOTIFICATION_STATUS_BEFORE",payload:{isUpdatingNotifications:!0}});const a={"notification-id":t,action:e},i=await(t=>o("gtmkit/v1/set-notification-status","POST",t,!0))(a);n({type:"SEND_NOTIFICATION_STATUS",payload:{isUpdatingNotifications:!1,isNotificationStatusSent:i.success,notifications:i.data}})},useSettings:e.stateSettings,useIsPending:e.isPending,useNotice:e.notice,useHasError:e.hasError,useCanSave:e.canSave,useSiteData:e.siteData,useInstallData:e.installData,useIsSending:e.isSendingSystemData,useSupportTicket:e.supportTicket,useIsSystemDataSent:e.isSystemDataSent,useSystemDataMessage:e.systemDataMessage,useIsSendingLicenseKey:e.isSendingLicenseKey,useLicenseKey:e.licenseKey,useIsLicenseKeySent:e.isLicenseKeySent,useLicenseKeyMessage:e.licenseKeyMessage,useNotifications:e.notifications,useIsUpdatingNotifications:e.isUpdatingNotifications,useUserRoles:window.gtmkitSettings.user_roles?window.gtmkitSettings.user_roles:[],isPremium:!!window.gtmkitSettings.isPremium&&window.gtmkitSettings.isPremium};return(0,m.jsx)(g.Provider,{value:l,children:t.children})},d=window.React;function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0&&(e.hash=t.substr(a),t=t.substr(0,a));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}var M;function v(t,e,a){return void 0===a&&(a="/"),function(t,e,a,n){let i=P(("string"==typeof e?E(e):e).pathname||"/",a);if(null==i)return null;let r=j(t);!function(t){t.sort(((t,e)=>t.score!==e.score?e.score-t.score:function(t,e){return t.length===e.length&&t.slice(0,-1).every(((t,a)=>t===e[a]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(r);let s=null;for(let t=0;null==s&&t{let s={relativePath:void 0===r?t.path||"":r,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};s.relativePath.startsWith("/")&&(y(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(n.length));let o=K([n,s.relativePath]),l=a.concat(s);t.children&&t.children.length>0&&(y(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),j(t.children,e,l,o)),(null!=t.path||t.index)&&e.push({path:o,score:O(o,t.index),routesMeta:l})};return t.forEach(((t,e)=>{var a;if(""!==t.path&&null!=(a=t.path)&&a.includes("?"))for(let a of w(t.path))i(t,e,a);else i(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[a,...n]=e,i=a.endsWith("?"),r=a.replace(/\?$/,"");if(0===n.length)return i?[r,""]:[r];let s=w(n.join("/")),o=[];return o.push(...s.map((t=>""===t?r:[r,t].join("/")))),i&&o.push(...s),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(M||(M={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const T=/^:[\w-]+$/,_=3,b=2,L=1,D=10,I=-2,C=t=>"*"===t;function O(t,e){let a=t.split("/"),n=a.length;return a.some(C)&&(n+=I),e&&(n+=b),a.filter((t=>!C(t))).reduce(((t,e)=>t+(T.test(e)?_:""===e?L:D)),n)}function U(t,e,a){void 0===a&&(a=!1);let{routesMeta:n}=t,i={},r="/",s=[];for(let t=0;t(n.push({paramName:e,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(n.push({paramName:"*"}),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}(t.path,t.caseSensitive,t.end),i=e.match(a);if(!i)return null;let r=i[0],s=r.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:n.reduce(((t,e,a)=>{let{paramName:n,isOptional:i}=e;if("*"===n){let t=o[a]||"";s=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}const l=o[a];return t[n]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),t}),{}),pathname:r,pathnameBase:s,pattern:t}}function z(t){try{return t.split("/").map((t=>decodeURIComponent(t).replace(/\//g,"%2F"))).join("/")}catch(e){return S(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+e+")."),t}}function P(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,n=t.charAt(a);return n&&"/"!==n?null:t.slice(a)||"/"}function R(t,e,a,n){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function B(t,e){let a=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?a.map(((t,e)=>e===a.length-1?t.pathname:t.pathnameBase)):a.map((t=>t.pathnameBase))}function G(t,e,a,n){let i;void 0===n&&(n=!1),"string"==typeof t?i=E(t):(i=p({},t),y(!i.pathname||!i.pathname.includes("?"),R("?","pathname","search",i)),y(!i.pathname||!i.pathname.includes("#"),R("#","pathname","hash",i)),y(!i.search||!i.search.includes("#"),R("#","search","hash",i)));let r,s=""===t||""===i.pathname,o=s?"/":i.pathname;if(null==o)r=a;else{let t=e.length-1;if(!n&&o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t-=1;i.pathname=e.join("/")}r=t>=0?e[t]:"/"}let l=function(t,e){void 0===e&&(e="/");let{pathname:a,search:n="",hash:i=""}="string"==typeof t?E(t):t,r=a?a.startsWith("/")?a:function(t,e){let a=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?a.length>1&&a.pop():"."!==t&&a.push(t)})),a.length>1?a.join("/"):"/"}(a,e):e;return{pathname:r,search:F(n),hash:W(i)}}(i,r),c=o&&"/"!==o&&o.endsWith("/"),m=(s||"."===o)&&a.endsWith("/");return l.pathname.endsWith("/")||!c&&!m||(l.pathname+="/"),l}const K=t=>t.join("/").replace(/\/\/+/g,"/"),Y=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),F=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",W=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const Q=["post","put","patch","delete"],$=(new Set(Q),["get",...Q]);function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0})),d.useCallback((function(n,i){void 0===i&&(i={}),a.current&&("number"==typeof n?t.navigate(n):t.navigate(n,J({fromRouteId:e},i)))}),[t,e])}():function(){et()||y(!1);let t=d.useContext(H),{basename:e,future:a,navigator:n}=d.useContext(V),{matches:i}=d.useContext(q),{pathname:r}=at(),s=JSON.stringify(B(i,a.v7_relativeSplatPath)),o=d.useRef(!1);return nt((()=>{o.current=!0})),d.useCallback((function(a,i){if(void 0===i&&(i={}),!o.current)return;if("number"==typeof a)return void n.go(a);let l=G(a,JSON.parse(s),r,"path"===i.relative);null==t&&"/"!==e&&(l.pathname="/"===l.pathname?e:K([e,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[e,n,s,r,t])}()}function rt(t,e,a,n){et()||y(!1);let{navigator:i}=d.useContext(V),{matches:r}=d.useContext(q),s=r[r.length-1],o=s?s.params:{},l=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let c,m=at();if(e){var g;let t="string"==typeof e?E(e):e;"/"===l||(null==(g=t.pathname)?void 0:g.startsWith(l))||y(!1),c=t}else c=m;let u=c.pathname||"/",p=u;if("/"!==l){let t=l.replace(/^\//,"").split("/");p="/"+u.replace(/^\//,"").split("/").slice(t.length).join("/")}let k=v(t,{pathname:p}),S=function(t,e,a,n){var i;if(void 0===e&&(e=[]),void 0===a&&(a=null),void 0===n&&(n=null),null==t){var r;if(!a)return null;if(a.errors)t=a.matches;else{if(!(null!=(r=n)&&r.v7_partialHydration&&0===e.length&&!a.initialized&&a.matches.length>0))return null;t=a.matches}}let s=t,o=null==(i=a)?void 0:i.errors;if(null!=o){let t=s.findIndex((t=>t.route.id&&void 0!==(null==o?void 0:o[t.route.id])));t>=0||y(!1),s=s.slice(0,Math.min(s.length,t+1))}let l=!1,c=-1;if(a&&n&&n.v7_partialHydration)for(let t=0;t=0?s.slice(0,c+1):[s[0]];break}}}return s.reduceRight(((t,n,i)=>{let r,m=!1,g=null,u=null;var p;a&&(r=o&&n.route.id?o[n.route.id]:void 0,g=n.route.errorElement||ot,l&&(c<0&&0===i?(dt[p="route-fallback"]||(dt[p]=!0),m=!0,u=null):c===i&&(m=!0,u=n.route.hydrateFallbackElement||null)));let h=e.concat(s.slice(0,i+1)),k=()=>{let e;return e=r?g:m?u:n.route.Component?d.createElement(n.route.Component,null):n.route.element?n.route.element:t,d.createElement(ct,{match:n,routeContext:{outlet:t,matches:h,isDataRoute:null!=a},children:e})};return a&&(n.route.ErrorBoundary||n.route.errorElement||0===i)?d.createElement(lt,{location:a.location,revalidation:a.revalidation,component:g,error:r,children:k(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):k()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},o,t.params),pathname:K([l,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?l:K([l,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),r,a,n);return e&&S?d.createElement(X.Provider,{value:{location:J({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:h.Pop}},S):S}function st(){let t=function(){var t;let e=d.useContext(tt),a=function(){let t=d.useContext(Z);return t||y(!1),t}(gt.UseRouteError),n=ut(gt.UseRouteError);return void 0!==e?e:null==(t=a.errors)?void 0:t[n]}(),e=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},e),a?d.createElement("pre",{style:n},a):null,null)}const ot=d.createElement(st,null);class lt extends d.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||"idle"!==e.revalidation&&"idle"===t.revalidation?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:void 0!==t.error?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){console.error("React Router caught the following error during render",t,e)}render(){return void 0!==this.state.error?d.createElement(q.Provider,{value:this.props.routeContext},d.createElement(tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:e,match:a,children:n}=t,i=d.useContext(H);return i&&i.static&&i.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=a.route.id),d.createElement(q.Provider,{value:e},n)}var mt=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(mt||{}),gt=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(gt||{});function ut(t){let e=function(){let t=d.useContext(q);return t||y(!1),t}(),a=e.matches[e.matches.length-1];return a.route.id||y(!1),a.route.id}const dt={};function pt(t){let{to:e,replace:a,state:n,relative:i}=t;et()||y(!1);let{future:r,static:s}=d.useContext(V),{matches:o}=d.useContext(q),{pathname:l}=at(),c=it(),m=G(e,B(o,r.v7_relativeSplatPath),l,"path"===i),g=JSON.stringify(m);return d.useEffect((()=>c(JSON.parse(g),{replace:a,state:n,relative:i})),[c,g,i,a,n]),null}function ht(t){y(!1)}function kt(t){let{basename:e="/",children:a=null,location:n,navigationType:i=h.Pop,navigator:r,static:s=!1,future:o}=t;et()&&y(!1);let l=e.replace(/^\/*/,"/"),c=d.useMemo((()=>({basename:l,navigator:r,static:s,future:J({v7_relativeSplatPath:!1},o)})),[l,o,r,s]);"string"==typeof n&&(n=E(n));let{pathname:m="/",search:g="",hash:u="",state:p=null,key:k="default"}=n,S=d.useMemo((()=>{let t=P(m,l);return null==t?null:{location:{pathname:t,search:g,hash:u,state:p,key:k},navigationType:i}}),[l,m,g,u,p,k,i]);return null==S?null:d.createElement(V.Provider,{value:c},d.createElement(X.Provider,{children:a,value:S}))}function yt(t){let{children:e,location:a}=t;return rt(St(e),a)}function St(t,e){void 0===e&&(e=[]);let a=[];return d.Children.forEach(t,((t,n)=>{if(!d.isValidElement(t))return;let i=[...e,n];if(t.type===d.Fragment)return void a.push.apply(a,St(t.props.children,i));t.type!==ht&&y(!1),t.props.index&&t.props.children&&y(!1);let r={id:t.props.id||i.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(r.children=St(t.props.children,i)),a.push(r)})),a}d.startTransition,new Promise((()=>{})),d.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(t){}new Map;const ft=d.startTransition;function xt(t){let{basename:e,children:a,future:n,window:i}=t,r=d.useRef();var s;null==r.current&&(r.current=(void 0===(s={window:i,v5Compat:!0})&&(s={}),function(t,e,a,n){void 0===n&&(n={});let{window:i=document.defaultView,v5Compat:r=!1}=n,s=i.history,o=h.Pop,l=null,c=m();function m(){return(s.state||{idx:null}).idx}function g(){o=h.Pop;let t=m(),e=null==t?null:t-c;c=t,l&&l({action:o,location:d.location,delta:e})}function u(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,a="string"==typeof t?t:N(t);return a=a.replace(/ $/,"%20"),y(e,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,e)}null==c&&(c=0,s.replaceState(p({},s.state,{idx:c}),""));let d={get action(){return o},get location(){return t(i,s)},listen(t){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(k,g),l=t,()=>{i.removeEventListener(k,g),l=null}},createHref:t=>e(i,t),createURL:u,encodeLocation(t){let e=u(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){o=h.Push;let n=x(d.location,t,e);a&&a(n,t),c=m()+1;let g=f(n,c),u=d.createHref(n);try{s.pushState(g,"",u)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(u)}r&&l&&l({action:o,location:d.location,delta:1})},replace:function(t,e){o=h.Replace;let n=x(d.location,t,e);a&&a(n,t),c=m();let i=f(n,c),g=d.createHref(n);s.replaceState(i,"",g),r&&l&&l({action:o,location:d.location,delta:0})},go:t=>s.go(t)};return d}((function(t,e){let{pathname:a="/",search:n="",hash:i=""}=E(t.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),x("",{pathname:a,search:n,hash:i},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let a=t.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let e=t.location.href,a=e.indexOf("#");n=-1===a?e:e.slice(0,a)}return n+"#"+("string"==typeof e?e:N(e))}),(function(t,e){S("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),s)));let o=r.current,[l,c]=d.useState({action:o.action,location:o.location}),{v7_startTransition:m}=n||{},g=d.useCallback((t=>{m&&ft?ft((()=>c(t))):c(t)}),[c,m]);return d.useLayoutEffect((()=>o.listen(g)),[o,g]),d.createElement(kt,{basename:e,children:a,location:l.location,navigationType:l.action,navigator:o,future:n})}var Nt,Et;e.flushSync,d.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"}(Nt||(Nt={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Et||(Et={}));const Mt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:i,useIsPending:r}=(0,a.useContext)(g),s=it();return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"md:gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-16 gtmkit-mb-8",children:[(0,m.jsxs)("div",{className:"",children:[(0,m.jsx)("div",{className:"gtmkit-settings-field-wrap gtmkit-w-full !gtmkit-px-8 ",children:(0,m.jsx)(n.TextControl,{label:(0,l.__)("Container ID","gtm-kit"),placeholder:(0,l.__)("Enter Container ID","gtm-kit"),value:t&&t.general.gtm_id,className:"gtmkit-text-center",onChange:t=>e("general","gtm_id",t)})}),(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsxs)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),s("/essential-settings",{replace:!0})},disabled:r||!t.general.gtm_id.includes("-"),children:[(0,l.__)("Save and continue","gtm-kit"),r?(0,m.jsx)(n.Spinner,{}):""]})})]}),(0,m.jsxs)("div",{className:"gtmkit-mt-8 gtmkit-border gtmkit-p-6 gtmkit-text-color-grey gtmkit-text-center",children:[(0,m.jsx)("h2",{className:"gtmkit-font-bold gtmkit-text-base gtmkit-mb-4",children:"Need help?"}),(0,m.jsxs)("p",{className:"gtmkit-mb-6",children:[(0,l.__)("Find your GTM container ID on","gtm-kit"),(0,m.jsx)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-underline",href:"https://tagmanager.google.com/",target:"_blank",rel:"noreferrer",children:"Google Tag Manager"})]}),(0,m.jsxs)("p",{children:[(0,l.__)("It should look something like this:","gtm-kit")," ","GTM-12ZM7SF4"]})]})]})})},vt=()=>{const{useImportSettings:t,useIsPending:e,useInstallData:i}=(0,a.useContext)(g),[r,s]=(0,a.useState)(!0),o=Object.keys(i.import_data)[0],[c,m]=(0,a.useState)(o),u=[];return Object.keys(i.import_data).forEach((t=>{u.push({value:t,label:i.import_data[t].name})})),r?(0,d.createElement)(d.Fragment,null,(0,d.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto gtmkit-border gtmkit-p-8 gtmkit-my-8"},(0,d.createElement)("h2",{className:"gtmkit-text-lg gtmkit-text-color-heading gtmkit-font-bold"},(0,l.__)("Would you like to import plugin settings?","gtm-kit")),(0,d.createElement)("p",{className:"gtmkit-text-base gtmkit-my-4 gtmkit-text-color-grey"},(0,l.__)("We have found the configuration of other plugins in the database.","gtm-kit")," ",(0,l.__)("Would you like to import your settings to GTM Kit?","gtm-kit")),(0,d.createElement)(n.RadioControl,{help:(0,l.__)("Select the plugin you want to import settings from.","gtm-kit"),selected:c,options:u,onChange:t=>m(t)}),(0,d.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,d.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{t(c,i.import_data[c]),s(!1)}},(0,d.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,l.__)("Yes","gtm-kit")),e?(0,d.createElement)(n.Spinner,null):""),(0,d.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{s(!1)}},(0,d.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,l.__)("No","gtm-kit")),e?(0,d.createElement)(n.Spinner,null):"")))):(0,d.createElement)(Mt,null)},jt=()=>{const{useInstallData:t}=(0,a.useContext)(g),{firstInstall:e}=t,{importAvailable:n}=t;return(0,d.createElement)("div",{className:"gtmkit-text-center"},(0,d.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,l.__)("You've successfully installed GTM Kit!","gtm-kit")),(0,d.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,l.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit"))),e&&n?(0,d.createElement)(vt,null):(0,d.createElement)(Mt,null))},wt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:i,useIsPending:r,useInstallData:s}=(0,a.useContext)(g),o=it();return(0,d.createElement)("div",{className:"gtmkit-text-center"},(0,d.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,l.__)("Essential Settings","gtm-kit")),(0,d.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,l.__)("There are a lot of settings in GTM Kit and we recommend that you uses our recommended settings but you can also choose to use the default settings and go through the settings at your convenience.","gtm-kit"))),(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Page type","gtm-kit"),id:"page-type"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("Include the page type i.e. page, product, category, cart, checkout etc in the datalayer?","gtm-kit"),checked:t&&t.general.datalayer_page_type,onChange:()=>{e("general","datalayer_page_type",!(t&&t.general.datalayer_page_type))}}))),s.woocommerce_integration?(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Track WooCommerce","gtm-kit"),id:"track-wooCommerce"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("Would you like to track e-commerce data from WooCommerce?","gtm-kit"),checked:t&&t.integrations.woocommerce_integration,onChange:()=>{e("integrations","woocommerce_integration",!(t&&t.integrations.woocommerce_integration))}}))):null,s.cf7_integration?(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Track Contact Form 7","gtm-kit"),id:"track-cf7"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("Would you like to track form submissions from Contact Form 7?","gtm-kit"),checked:t&&t.integrations.cf7_integration,onChange:()=>{e("integrations","cf7_integration",!(t&&t.integrations.cf7_integration))}}))):null,s.edd_integration?(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap"},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Track Easy Digital Downloads","gtm-kit"),id:"track-edd"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("Would you like to track e-commerce data from Easy Digital Downloads?","gtm-kit"),checked:t&&t.integrations.edd_integration,onChange:()=>{e("integrations","edd_integration",!(t&&t.integrations.edd_integration))}}))):null,(0,d.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,d.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),o("/share-anonymous-data",{replace:!0})},disabled:r},(0,l.__)("Save and continue","gtm-kit"),r?(0,d.createElement)(n.Spinner,null):"")))},Tt=()=>{const{useSettings:t,useUpdateStateSettings:e,useUpdateSettings:i,useIsPending:r,useSiteData:s}=(0,a.useContext)(g),o=it();return(0,d.createElement)(d.Fragment,null,(0,d.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,l.__)("Help improve GTM Kit","gtm-kit")),(0,d.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-4 gtmkit-text-color-grey"},(0,l.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,d.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-8 gtmkit-text-color-grey"},(0,l.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,d.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm"},(0,d.createElement)("tbody",null,(0,d.createElement)("tr",{className:""},(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Server type:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.web_server))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"PHP version number:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.php_version))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"WordPress version number:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.wordpress_version))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"WordPress multisite:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.multisite?(0,l.__)("Yes","gtm-kit"):(0,l.__)("No","gtm-kit")))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Current theme:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.current_theme))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Current site language:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("code",{className:"gtmkit-text-sm"},s.locale))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Active plugins:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("em",null,"Plugin names of all active plugins"))),(0,d.createElement)("tr",null,(0,d.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("strong",null,"Anonymized GTM Kit settings:")),(0,d.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,d.createElement)("em",null,"Which GTM Kit settings are active"))))),(0,d.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-max !gtmkit-px-8 gtmkit-mx-auto "},(0,d.createElement)(n.BaseControl,{label:(0,l.__)("Share anonymous data","gtm-kit"),id:"share-anonymous-data"},(0,d.createElement)(n.ToggleControl,{label:(0,l.__)("I agree to share anonymous data with the development team to help improve GTM Kit. ","gtm-kit"),checked:t&&t.general.analytics_active,onChange:()=>{e("general","analytics_active",!(t&&t.general.analytics_active))}}))),(0,d.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,d.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),o("/getting-started",{replace:!0})},disabled:r},(0,l.__)("Save and continue","gtm-kit"),r?(0,d.createElement)(n.Spinner,null):"")))},_t=(t="general",e="")=>{const a=window.gtmkitSettings.adminPageUrl;return e?`${a}${t}#/${e}`:`${a}${t}`},bt=()=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center",children:(0,l.__)("You are ready to use GTM Kit!","gtm-kit")}),(0,m.jsx)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey gtmkit-text-center",children:(0,l.__)("Your Google Tag Manager Container is now sending data to Google Tag Manager.","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-mb-12 gtmkit-text-color-grey gtmkit-text-center",children:[(0,l.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit")," "]}),(0,m.jsxs)("div",{className:"gtmkit-border-2 gtmkit-max-w-lg gtmkit-mx-auto gtmkit-mb-8",children:[(0,m.jsx)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2",children:(0,l.__)("Getting Started","gtm-kit")}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4",children:[(0,l.__)("The next step is to configure your Google Tag Manager container. You will find templates for this in the GTM Templates section.","gtm-kit")," ",(0,m.jsx)("a",{className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:_t("templates"),rel:"noreferrer",children:(0,l.__)("Go to GTM Templates","gtm-kit")})]}),(0,m.jsxs)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4",children:[(0,l.__)("To get the most out of Google Tag Manager with GTM Kit, you should also review the tutorials.","gtm-kit")," ",(0,m.jsx)("a",{className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:_t("help","help"),rel:"noreferrer",children:(0,l.__)("Go to Tutorials","gtm-kit")})]})]}),(0,m.jsx)("div",{className:"gtmkit-flex gtmkit-mt-12",children:(0,m.jsx)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=_t("general")},children:(0,l.__)("Go to the dashboard","gtm-kit")})})]}),Lt=[{step:1,path:"/welcome",element:"Welcome",title:(0,l.__)("Welcome","gtm-kit")},{step:2,path:"/essential-settings",element:"EssentialSettings",title:(0,l.__)("Essential Settings","gtm-kit")},{step:3,path:"/share-anonymous-data",element:"ShareAnonymousData",title:(0,l.__)("Help improve GTM Kit","gtm-kit")},{step:4,path:"/getting-started",element:"GettingStarted",title:(0,l.__)("Getting Started","gtm-kit")}],Dt=({step:t,currentStep:e,totalSteps:a})=>{if(t===a)return;let n="gtmkit-h-0.5 gtmkit-w-full";return n+=tt{if(0===t)return;let n="gtmkit-transition-opacity gtmkit-duration-500 gtmkit-absolute gtmkit-inset-0 gtmkit-border-2 gtmkit-flex gtmkit-items-center gtmkit-justify-center gtmkit-rounded-full gtmkit-opacity-100";return n+=te?" gtmkit-border-color-border":" gtmkit-border-color-primary",(0,d.createElement)(d.Fragment,null,(0,d.createElement)("span",{className:"gtmkit-relative gtmkit-shrink-0 gtmkit-z-10 gtmkit-w-8 gtmkit-h-8 gtmkit-rounded-full"},(0,d.createElement)("span",{className:n},(0,d.createElement)(It,{step:t,currentStep:e,totalSteps:a}))),(0,d.createElement)(Dt,{step:t,currentStep:e,totalSteps:a}))},Ot=()=>{const t=Lt.length-1+Lt[0].step;let e=((t,e)=>{const a=Object.keys(e);return t.filter((function(t){for(let n=0;n(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("header",{className:"gtmkit-text-center gtmkit-px-3",children:(0,m.jsx)("h1",{className:"gtmkit-mt-3 md:gtmkit-mt-8 gtmkit-mb-4 gtmkit-w-[200px] gtmkit-inline-block",children:(0,m.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNDY3LjEgMTU4Ni40IiBoZWlnaHQ9IjU0IiB2aWV3Qm94PSIwIDAgMTYwIDU0IiB3aWR0aD0iMTYwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IGZpbGw9IiM4ODgiIGhlaWdodD0iNTQiIHJ4PSI0LjI2NSIgd2lkdGg9IjE2MCIvPjxwYXRoIGQ9Im04OC42NTkgNy4wMDJoLTQ5LjI2NmMtMi45MTUgMC01LjM3OC0uMTg0LTkuMjMgMi41OTZsLTE4Ljc0MyAxMi43NTJjLTQuNTQ5IDMuMjkyLTQuNTcxIDYuMDAxIDAgOS4zMDJsMTguNzQzIDEyLjc1MWMzLjY1MiAyLjY0NiA2LjI5OSAyLjU5NyA5LjIzIDIuNTk3aDE1LjY4NiAzMy41OGMyLjkzMS0uMDU3IDUuMzk0LTEuNzg0IDUuMzQtMy45MjN2LTMyLjIxYy0uMDEyLTIuMTM0LTIuNDA5LTMuODY1LTUuMzQtMy44NjV6IiBmaWxsPSIjMzk2OWJiIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgLTEgMTAxLjk5OTg2NyA1My45OTk1NDcpIi8+PGcgZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJtYXRyaXgoMS40NjUyMDIgMCAwIDEuNDY1MjAyIC00LjU4MjQzNiAtNy41NTMxMjYpIj48cGF0aCBkPSJtMTguMzE2IDIzLjA4Nmg0LjYzMnY2LjA1MmMtLjc1LjI0NS0xLjQ1OS40MTUtMi4xMjEuNTE0LS42NjMuMDk4LTEuMzQxLjE0OC0yLjAzMy4xNDgtMS43NjQgMC0zLjEwNi0uNTE3LTQuMDM1LTEuNTU0LS45MjktMS4wMzQtMS4zOTUtMi41MTktMS4zOTUtNC40NTcgMC0xLjg4Ni41MzgtMy4zNTYgMS42MTctNC40MSAxLjA3OC0xLjA1NCAyLjU3My0xLjU3OSA0LjQ4MS0xLjU3OSAxLjIgMCAyLjM1Ny4yMzkgMy40NjkuNzE4bC0uODIzIDEuOTc5Yy0uODUtLjQyNS0xLjczNy0uNjM3LTIuNjU3LS42MzctMS4wNzEgMC0xLjkzMi4zNTgtMi41NzIgMS4wNzctLjY0NS43MTgtLjk2OCAxLjY4NS0uOTY4IDIuODk5IDAgMS4yNjcuMjYgMi4yMzMuNzggMi45MDQuNTE2LjY2NyAxLjI3MS45OTkgMi4yNjIuOTk5LjUxNyAwIDEuMDQxLS4wNTIgMS41NzItLjE1OHYtMi40MzVoLTIuMjA5em0xMS45MTIgNi41NTVoLTIuNDc0di05LjYxNGgtMy4xNzN2LTIuMDZoOC44MTZ2Mi4wNmgtMy4xNjl6bTkuOTA4IDAtMi44MTEtOS4xNThoLS4wNzJjLjEwMyAxLjg2My4xNTQgMy4xMDUuMTU0IDMuNzI4djUuNDNoLTIuMjEzdi0xMS42NzRoMy4zNjhsMi43NjQgOC45MjdoLjA0OGwyLjkzNC04LjkyN2gzLjM2OXYxMS42NzRoLTIuMzA4di01LjUyNWMwLS4yNjEgMC0uNTYxLjAwOS0uOTAzLjAwOS0uMzQxLjA0OC0xLjI0Ni4xMTItMi43MTZoLS4wNzRsLTMuMDExIDkuMTQ0eiIvPjxwYXRoIGQ9Im04OC44ODMgMzEuODk4aC0zLjgxMWwtNC4xNDctNi42Ny0xLjQxNyAxLjAxOHY1LjY1MmgtMy4zNTd2LTE1LjgzaDMuMzU3djcuMjQybDEuMzE4LTEuODYxIDQuMjkzLTUuMzgxaDMuNzI0bC01LjUyMyA3LjAwNnptMS41ODktMTUuMjMzYzAtMS4wNzUuNi0xLjYxNCAxLjgtMS42MTQgMS4xOTkgMCAxLjc5OC41MzkgMS43OTggMS42MTQgMCAuNTEyLS4xNDguOTEtLjQ1IDEuMTk2LS4yOTcuMjg0LS43NDkuNDI5LTEuMzQ4LjQyOS0xLjIgMC0xLjgtLjU0My0xLjgtMS42MjV6bTMuNDQ5IDE1LjIzM2gtMy4zMDJ2LTEyLjEwNGgzLjMwMnptOC41NjMtMi40MTNjLjU3OCAwIDEuMjcxLS4xMjggMi4wNzctLjM4djIuNDU2Yy0uODIuMzctMS44MzEuNTUyLTMuMDMxLjU1Mi0xLjMyNCAwLTIuMjgtLjMzMy0yLjg4NS0xLjAwMS0uNjAyLS42NjctLjkwMi0xLjY2OC0uOTAyLTMuMDAzdi01LjgzNWgtMS41ODV2LTEuMzk5bDEuODIzLTEuMTAzLjk0OS0yLjU1N2gyLjExNXYyLjU3OWgzLjM4OHYyLjQ4aC0zLjM4OHY1LjgzNWMwIC40NjcuMTI5LjgxNS4zOTMgMS4wNDEuMjY0LjIyMi42MTQuMzM1IDEuMDQ2LjMzNXoiLz48L2c+PC9zdmc+",alt:(0,l.__)("GTM Kit","gtm-kit"),className:"gtmkit-w-full"})})}),(0,m.jsx)(Ot,{})]}),At=()=>(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("footer",{className:"gtm-kit-settings-footer gtmkit-my-8 gtmkit-text-color-grey",children:(0,m.jsx)("p",{className:"gtmkit-mx-auto gtmkit-max-w-max",children:(0,m.jsx)("a",{className:"gtmkit-underline",href:_t(),children:(0,l.__)("Go to the dashboard.","gtm-kit")})})})}),zt=()=>{const{useSettings:t}=(0,a.useContext)(g);return Object.keys(t).length?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Ut,{}),(0,m.jsx)("main",{className:"gtmkit-max-w-3xl gtmkit-bg-white gtmkit-border-1 gtmkit-border-color-border gtmkit-rounded-md gtmkit-mx-auto gtmkit-py-12 gtmkit-px-16 gtmkit-text-base",children:(0,m.jsxs)(yt,{children:[(0,m.jsx)(ht,{exact:!0,path:"/welcome",element:(0,m.jsx)(jt,{})}),(0,m.jsx)(ht,{exact:!0,path:"/essential-settings",element:(0,m.jsx)(wt,{})}),(0,m.jsx)(ht,{exact:!0,path:"/share-anonymous-data",element:(0,m.jsx)(Tt,{})}),(0,m.jsx)(ht,{exact:!0,path:"/getting-started",element:(0,m.jsx)(bt,{})}),(0,m.jsx)(ht,{path:"/",element:(0,m.jsx)(pt,{replace:!0,to:"/welcome"})})]})}),(0,m.jsx)(At,{})]}):(0,m.jsx)(n.Spinner,{className:"gtm-kit-settings-page-loader"})},Pt=()=>(0,m.jsx)(xt,{basename:"/",children:(0,m.jsx)(u,{children:(0,m.jsx)(zt,{})})});document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById(window.gtmkitSettings.rootId);null!=t&&(0,e.createRoot)(t).render((0,m.jsx)(Pt,{}))}))})(); \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 1def320..fda241a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ *** GTM Kit *** +2024-10-01 - version 2.1.0 +* Add: Added support for the Bricks theme builder. +* Fix: In some cases other plugins or a theme could block GTM Kit from firing JS event like the one that fires the add_to_cart GTM event. + 2024-09-23 - version 2.0.1 * Fix: * Fix an edge case that could cause a fatal error in admin_body_class(). diff --git a/composer.lock b/composer.lock index dcb1426..4488e0c 100644 --- a/composer.lock +++ b/composer.lock @@ -361,16 +361,16 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v9.3.1", + "version": "v9.3.3", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "3705959c37f0d79feaa6a13f8e296b155aa4bce8" + "reference": "1995245b3ebfd82eeaf3a8e9d3ec962f00ab3b73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/3705959c37f0d79feaa6a13f8e296b155aa4bce8", - "reference": "3705959c37f0d79feaa6a13f8e296b155aa4bce8", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/1995245b3ebfd82eeaf3a8e9d3ec962f00ab3b73", + "reference": "1995245b3ebfd82eeaf3a8e9d3ec962f00ab3b73", "shasum": "" }, "require": { @@ -399,22 +399,22 @@ ], "support": { "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", - "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v9.3.1" + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v9.3.3" }, - "time": "2024-09-16T14:57:37+00:00" + "time": "2024-09-25T17:38:08+00:00" }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.6.0", + "version": "v6.6.2", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "86e8753e89d59849276dcdd91b9a7dd78bb4abe2" + "reference": "f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/86e8753e89d59849276dcdd91b9a7dd78bb4abe2", - "reference": "86e8753e89d59849276dcdd91b9a7dd78bb4abe2", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc", + "reference": "f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc", "shasum": "" }, "require-dev": { @@ -447,9 +447,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.6.0" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.6.2" }, - "time": "2024-07-17T08:50:38+00:00" + "time": "2024-09-30T07:10:48+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -871,16 +871,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.4", + "version": "1.12.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "ffa517cb918591b93acc9b95c0bebdcd0e4538bd" + "reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ffa517cb918591b93acc9b95c0bebdcd0e4538bd", - "reference": "ffa517cb918591b93acc9b95c0bebdcd0e4538bd", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17", + "reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17", "shasum": "" }, "require": { @@ -925,7 +925,7 @@ "type": "github" } ], - "time": "2024-09-19T07:58:01+00:00" + "time": "2024-09-26T12:45:22+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", diff --git a/gtm-kit.php b/gtm-kit.php index e3eeea1..445f14d 100644 --- a/gtm-kit.php +++ b/gtm-kit.php @@ -3,7 +3,7 @@ * GTM Kit Plugin * * Plugin Name: GTM Kit - * Version: 2.0.1 + * Version: 2.1.0 * Plugin URI: https://gtmkit.com/ * Description: Google Tag Manager implementation focusing on flexibility and pagespeed. * Author: GTM Kit @@ -27,7 +27,7 @@ exit(); } -const GTMKIT_VERSION = '2.0.1'; +const GTMKIT_VERSION = '2.1.0'; if ( ! defined( 'GTMKIT_FILE' ) ) { define( 'GTMKIT_FILE', __FILE__ ); diff --git a/languages/gtm-kit.pot b/languages/gtm-kit.pot index a1de027..337e133 100644 --- a/languages/gtm-kit.pot +++ b/languages/gtm-kit.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPLv3. msgid "" msgstr "" -"Project-Id-Version: GTM Kit 2.0.1\n" +"Project-Id-Version: GTM Kit 2.1.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gtm-kit\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-09-22T11:44:20+00:00\n" +"POT-Creation-Date: 2024-09-30T14:37:39+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.9.0\n" "X-Domain: gtm-kit\n" @@ -140,37 +140,37 @@ msgid "It seems that you have installed the %1$s theme." msgstr "" #. translators: %1$s is a link with the text 'GTM Kit Woo Add-On'. -#: src/Admin/PluginSuggestions.php:251 +#: src/Admin/PluginSuggestions.php:252 msgid "With the %1$s, you can track the add_to_wishlist event and leverage server-side tracking for enhanced accuracy and deeper insights into customer behavior." msgstr "" -#: src/Admin/PluginSuggestions.php:258 +#: src/Admin/PluginSuggestions.php:259 msgid "Upgrade:" msgstr "" -#: src/Admin/PluginSuggestions.php:271 +#: src/Admin/PluginSuggestions.php:272 msgid "It appears that you are not currently using a supported SEO plugin. By installing either WordPress SEO or Rank Math, you can assign a primary category to each product. This primary category will then be used in the data layer if the product is associated with multiple categories." msgstr "" -#: src/Admin/PluginSuggestions.php:276 +#: src/Admin/PluginSuggestions.php:277 msgid "Plugin suggestion:" msgstr "" #. translators: %s is the name of the plugin. -#: src/Admin/PluginSuggestions.php:294 +#: src/Admin/PluginSuggestions.php:295 msgid "It seems that you have installed the Google Tag Manager plugin called %1$s. Running two different GTM plugins simultaneously can lead to unexpected results, significantly impact data accuracy, and slow down page speed. Please consider deactivating %2$s unless you have carefully considered and addressed the potential challenges." msgstr "" -#: src/Admin/PluginSuggestions.php:302 +#: src/Admin/PluginSuggestions.php:303 msgid "Possible Conflict:" msgstr "" #. translators: %1$s and %2$s are links with the text 'GTM Kit Woo Add-On' and 'Grandfathered Wishlist Functionality' respectively. -#: src/Admin/PluginSuggestions.php:323 +#: src/Admin/PluginSuggestions.php:324 msgid "Starting with GTM Kit version 2.0, the add_to_wishlist event is no longer supported in the free version of GTM Kit. To continue tracking the add_to_wishlist event, you must either purchase the %1$s or download the free %2$s plugin." msgstr "" -#: src/Admin/PluginSuggestions.php:331 +#: src/Admin/PluginSuggestions.php:332 msgid "Breaking change:" msgstr "" @@ -240,63 +240,63 @@ msgid "Which GTM Kit settings are active" msgstr "" #: src/Integration/EasyDigitalDownloads.php:104 -#: src/Integration/WooCommerce.php:257 +#: src/Integration/WooCommerce.php:259 msgid "Payment method not found" msgstr "" -#: src/Integration/WooCommerce.php:248 +#: src/Integration/WooCommerce.php:250 msgid "Handpicked Products" msgstr "" -#: src/Integration/WooCommerce.php:249 +#: src/Integration/WooCommerce.php:251 msgid "Best Sellers" msgstr "" -#: src/Integration/WooCommerce.php:250 -#: src/Integration/WooCommerce.php:975 +#: src/Integration/WooCommerce.php:252 +#: src/Integration/WooCommerce.php:995 msgid "Product Category" msgstr "" -#: src/Integration/WooCommerce.php:251 +#: src/Integration/WooCommerce.php:253 msgid "New Products" msgstr "" -#: src/Integration/WooCommerce.php:252 +#: src/Integration/WooCommerce.php:254 msgid "Products On Sale" msgstr "" -#: src/Integration/WooCommerce.php:253 +#: src/Integration/WooCommerce.php:255 msgid "Products By Attribute" msgstr "" -#: src/Integration/WooCommerce.php:254 -#: src/Integration/WooCommerce.php:977 +#: src/Integration/WooCommerce.php:256 +#: src/Integration/WooCommerce.php:997 msgid "Product Tag" msgstr "" -#: src/Integration/WooCommerce.php:255 +#: src/Integration/WooCommerce.php:257 msgid "Top Rated Products" msgstr "" -#: src/Integration/WooCommerce.php:256 +#: src/Integration/WooCommerce.php:258 msgid "Shipping tier not found" msgstr "" -#: src/Integration/WooCommerce.php:834 +#: src/Integration/WooCommerce.php:854 msgid "Grouped Product" msgstr "" -#: src/Integration/WooCommerce.php:868 +#: src/Integration/WooCommerce.php:888 msgid "Search Results" msgstr "" -#: src/Integration/WooCommerce.php:868 -#: src/Integration/WooCommerce.php:909 -#: src/Integration/WooCommerce.php:942 +#: src/Integration/WooCommerce.php:888 +#: src/Integration/WooCommerce.php:929 +#: src/Integration/WooCommerce.php:962 msgid "General Product List" msgstr "" -#: src/Integration/WooCommerce.php:1107 +#: src/Integration/WooCommerce.php:1127 msgid "GTM Kit data." msgstr "" @@ -951,6 +951,26 @@ msgstr "" msgid "Log the \"purchase\" event to the debug log." msgstr "" +#: assets/admin/settings.js:1 +msgid "About GTM Kit" +msgstr "" + +#: assets/admin/settings.js:1 +msgid "Version:" +msgstr "" + +#: assets/admin/settings.js:1 +msgid "Learn about changes and follow the development of GTM Kit:" +msgstr "" + +#: assets/admin/settings.js:1 +msgid "The changelog" +msgstr "" + +#: assets/admin/settings.js:1 +msgid "The GitHub repository" +msgstr "" + #. translators: %s is the name of the plugin. #: assets/admin/settings.js:4 msgid "%s is not active" @@ -1030,7 +1050,7 @@ msgid "WooCommerce" msgstr "" #: assets/admin/settings.js:19 -msgid "Basic settings" +msgid "Basic Settings" msgstr "" #: assets/admin/settings.js:19 @@ -1078,7 +1098,7 @@ msgid "The user data is available in the datalayer in 'ecommerce.customer' and a msgstr "" #: assets/admin/settings.js:19 -msgid "Webhooks for server-side tracking" +msgid "Webhooks for Server-side Tracking" msgstr "" #: assets/admin/settings.js:19 @@ -1103,27 +1123,35 @@ msgid "Send webhooks to server GTM container" msgstr "" #: assets/admin/settings.js:19 -msgid "This option will allow webhooks to be sent to your server GTM container." +msgid "This option will allow you to send GTM events using webhooks to your server GTM container." msgstr "" #: assets/admin/settings.js:19 -msgid "Purchase webhook" +msgid "GTM Events Send by Server-Side Webhooks:" msgstr "" #: assets/admin/settings.js:19 -msgid "Enable this option to include the permalink structure of the product base, category base, tag base and attribute base." +msgid "Send an 'purchase' event from the server side when an order is created." msgstr "" #: assets/admin/settings.js:19 -msgid "Refund webhook" +msgid "Send 'purchase' event when an order is created.'" msgstr "" #: assets/admin/settings.js:19 -msgid "Enable this option to include the path of cart, checkout, order received and my account page." +msgid "Send 'purchase' event when the order has been paid and order status is 'Processing'." +msgstr "" + +#: assets/admin/settings.js:19 +msgid "Send an 'order_paid' event from the server side when an order has 'Processing' status." msgstr "" #: assets/admin/settings.js:19 -msgid "Event customization" +msgid "Send an 'refund' event from the server side when an order has been refunded or cancelled." +msgstr "" + +#: assets/admin/settings.js:19 +msgid "Event Customization" msgstr "" #: assets/admin/settings.js:19 @@ -1135,7 +1163,7 @@ msgid "Only only push view_item_list once per per page for each list." msgstr "" #: assets/admin/settings.js:19 -msgid "Do you what to push the view_item_list event if the list is updated using a filter or just once per page view." +msgid "Do you what to push the view_item_list event if the list is updated using a filter or just once per page view?" msgstr "" #: assets/admin/settings.js:19 @@ -1182,6 +1210,10 @@ msgstr "" msgid "When do you want to fire the \"add_payment_info\" event?" msgstr "" +#: assets/admin/settings.js:19 +msgid "Disable the 'purchase' event in frontend an rely on server-side webhook." +msgstr "" + #: assets/admin/settings.js:19 msgid "Google Ads Settings" msgstr "" @@ -1254,16 +1286,20 @@ msgstr "" msgid "Include permalink structure" msgstr "" +#: assets/admin/settings.js:19 +msgid "Enable this option to include the permalink structure of the product base, category base, tag base and attribute base." +msgstr "" + #: assets/admin/settings.js:19 msgid "Include path of pages" msgstr "" #: assets/admin/settings.js:19 -msgid "Contact Form 7" +msgid "Enable this option to include the path of cart, checkout, order received and my account page." msgstr "" #: assets/admin/settings.js:19 -msgid "Basic Settings" +msgid "Contact Form 7" msgstr "" #: assets/admin/settings.js:19 @@ -1290,10 +1326,6 @@ msgstr "" msgid "Advanced settings" msgstr "" -#: assets/admin/settings.js:19 -msgid "Get template" -msgstr "" - #: assets/admin/settings.js:19 #: assets/admin/wizard.js:1 msgid "Getting Started" @@ -1385,23 +1417,11 @@ msgid "Send system data" msgstr "" #: assets/admin/settings.js:19 -msgid "About GTM Kit" -msgstr "" - -#: assets/admin/settings.js:19 -msgid "Version:" -msgstr "" - -#: assets/admin/settings.js:19 -msgid "Learn about changes and follow the development of GTM Kit:" +msgid "Restore" msgstr "" #: assets/admin/settings.js:19 -msgid "The changelog" -msgstr "" - -#: assets/admin/settings.js:19 -msgid "The GitHub repository" +msgid "Dismiss" msgstr "" #. translators: %d is number %s can be either 'problem' or 'notification'. diff --git a/package-lock.json b/package-lock.json index c3a7391..c9a932e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gtm-kit", - "version": "2.0.1", + "version": "2.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gtm-kit", - "version": "2.0.1", + "version": "2.1.0", "dependencies": { "@wordpress/api-fetch": "^7.0.1", "@wordpress/components": "^28.0.3", diff --git a/package.json b/package.json index a804a30..fe3b661 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gtm-kit", - "version": "2.0.1", + "version": "2.1.0", "description": "Development files for the GTM Kit", "author": "GTM Kit", "keywords": [ diff --git a/readme.txt b/readme.txt index 4b4ba16..b32281b 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: tlamedia, torbenlundsgaard, gtmkit Donate link: https://github.com/tlamedia/gtm-kit Tags: google tag manager, gtm, woocommerce, analytics, ga4 Tested up to: 6.6 -Stable tag: 2.0.1 +Stable tag: 2.1.0 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -91,9 +91,9 @@ Yes! Pagespeed is one of our main focus points, and we strive to make the plugin == Changelog == -= 2.X = += 2.1.0 = -Release date: 2024-MM-DD +Release date: 2024-10-01 Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-2-1/). @@ -101,9 +101,7 @@ Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-2 * Added support for the Bricks theme builder. #### Bugfixes: -* In some cases other plugins or a theme could block GTM Kit from firing JS event like the one the fires the add_to_cart GTM event. - -#### Other: +* In some cases other plugins or a theme could block GTM Kit from firing JS event like the one that fires the add_to_cart GTM event. = 2.0.1 = diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 2a9810a..1e1c907 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'tlamedia/gtm-kit', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'c6e57338f099840ebaf09e6c6adb8df7c2fa34fe', + 'reference' => 'b6b02ba90945d4cc8fce3dc4758ed323eae57e49', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'tlamedia/gtm-kit' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'c6e57338f099840ebaf09e6c6adb8df7c2fa34fe', + 'reference' => 'b6b02ba90945d4cc8fce3dc4758ed323eae57e49', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),