{"roots":["0:3"],"nodeById":{"0:3":{"type":"WEBPAGE","id":"0:3","name":"/","absoluteBoundingBox":{"x":0.0,"y":0.0,"width":1408.0,"height":1244.0},"isolatedAbsoluteRenderBounds":{"x":0.0,"y":0.0,"width":1408.0,"height":1244.0},"relativeTransform":[[1.0,0.0,0.0],[0.0,1.0,0.0]],"size":{"x":1408.0,"y":1244.0},"fills":[{"opacity":0.0470588244497776,"blendMode":"NORMAL","type":"SOLID","color":{"r":1.0,"g":1.0,"b":1.0,"a":1.0},"visible":true}],"strokeAlign":"INSIDE","strokes":[],"accessibleHTMLTag":"AUTO","isDecorativeImage":false,"ariaAttributes":{},"interactions":[],"children":["0:4"]},"0:4":{"type":"FRAME","id":"0:4","name":"Desktop","absoluteBoundingBox":{"x":64.0,"y":100.0,"width":1280.0,"height":1080.0},"isolatedAbsoluteRenderBounds":{"x":64.0,"y":100.0,"width":1280.0,"height":1080.0},"relativeTransform":[[1.0,0.0,64.0],[0.0,1.0,100.0]],"size":{"x":1280.0,"y":1080.0},"fills":[{"blendMode":"NORMAL","type":"SOLID","color":{"r":1.0,"g":1.0,"b":1.0,"a":1.0},"visible":true,"opacity":1.0}],"strokeAlign":"INSIDE","strokes":[],"effects":[],"accessibleHTMLTag":"AUTO","isDecorativeImage":false,"ariaAttributes":{},"interactions":[],"clipsContent":true,"overflowDirection":"VERTICAL_SCROLLING","layoutMode":"VERTICAL","counterAxisSizingMode":"FIXED","isBreakpointFrame":true,"children":["0:7"]},"0:7":{"type":"CODE_INSTANCE","id":"0:7","name":"App","absoluteBoundingBox":{"x":64.0,"y":100.0,"width":1280.0,"height":1080.0},"isolatedAbsoluteRenderBounds":{"x":64.0,"y":100.0,"width":1280.0,"height":1080.0},"relativeTransform":[[1.0,0.0,0.0],[0.0,1.0,0.0]],"size":{"x":1280.0,"y":1080.0},"fills":[],"strokeAlign":"INSIDE","layoutAlign":"STRETCH","layoutGrow":1.0,"strokes":[],"accessibleHTMLTag":"AUTO","isDecorativeImage":false,"ariaAttributes":{},"interactions":[],"codeExportName":"Code0_8.default","componentProperties":{}}},"assetIdToGuid":{},"guidToUrl":{"0:3":"/"},"fonts":{},"assets":{"a2a4cb6d0c63bb017067b5f1751c3abc678c1bb4":{"type":"PAINT_ASSET","url":"a2a4cb6d0c63bb017067b5f1751c3abc678c1bb4.png","size":{"x":0.0,"y":0.0}},"973e611faed0120643c60685e96bbe3cd3b54f9a":{"type":"PAINT_ASSET","url":"973e611faed0120643c60685e96bbe3cd3b54f9a.png","size":{"x":0.0,"y":0.0}},"8fc70bfa1561f91a4e59359ce31805552e233bbb":{"type":"PAINT_ASSET","url":"8fc70bfa1561f91a4e59359ce31805552e233bbb.png","size":{"x":0.0,"y":0.0}},"5c2ffa7357ca954f4789f62aa67a062564d4d2fb":{"type":"PAINT_ASSET","url":"5c2ffa7357ca954f4789f62aa67a062564d4d2fb.png","size":{"x":0.0,"y":0.0}},"ea069ae02c64b545ef3431a21fc9d836a1d66e91":{"type":"PAINT_ASSET","url":"ea069ae02c64b545ef3431a21fc9d836a1d66e91.png","size":{"x":0.0,"y":0.0}},"4ec4c6baa418ed98087b9743b5ede9ab00b3386d":{"type":"PAINT_ASSET","url":"4ec4c6baa418ed98087b9743b5ede9ab00b3386d.png","size":{"x":0.0,"y":0.0}},"0b6ae337336e83091b49c86ad967e0194f344223":{"type":"PAINT_ASSET","url":"0b6ae337336e83091b49c86ad967e0194f344223.png","size":{"x":0.0,"y":0.0}},"41ae7913bf04c4949c652f9da48f33a0a06e1ddd":{"type":"PAINT_ASSET","url":"41ae7913bf04c4949c652f9da48f33a0a06e1ddd.png","size":{"x":0.0,"y":0.0}},"6af2017f891e4f62b4af065527c3fc67ea0fbc5c":{"type":"PAINT_ASSET","url":"6af2017f891e4f62b4af065527c3fc67ea0fbc5c.png","size":{"x":0.0,"y":0.0}},"e100976ae3c8f239769bf5943736a5b2d41fb674":{"type":"PAINT_ASSET","url":"e100976ae3c8f239769bf5943736a5b2d41fb674.png","size":{"x":0.0,"y":0.0}},"3ec24330241bfcb564640e61fca49c938d1100a0":{"type":"PAINT_ASSET","url":"3ec24330241bfcb564640e61fca49c938d1100a0.png","size":{"x":0.0,"y":0.0}},"1a0d845ab45814f634b9c33a189fcd6e436d0096":{"type":"PAINT_ASSET","url":"1a0d845ab45814f634b9c33a189fcd6e436d0096.png","size":{"x":0.0,"y":0.0}},"ecd50d759cccc7694a435f1bd84e49723acdcb40":{"type":"PAINT_ASSET","url":"ecd50d759cccc7694a435f1bd84e49723acdcb40.png","size":{"x":0.0,"y":0.0}},"459555f0504c2c409aebd88890ce6523f7a838f0":{"type":"PAINT_ASSET","url":"459555f0504c2c409aebd88890ce6523f7a838f0.png","size":{"x":0.0,"y":0.0}}},"stablePathToAssetInfo":{},"animateRootIds":[],"siteSettings":{"title":"KAIZARI L&D INTERNATIONAL","description":"Kaizari L&D offers corporate trainings: open-courses, in-house | customized trainings | virtual trainings | team building activities in Kenya and East Africa","scalingMode":"REFLOW","blockSearchIndexing":true,"googleAnalyticsID":"G-VCQTRKGLKV","customCodeHeadStart":"<script type=\"text/javascript\">\n    (function(c,l,a,r,i,t,y){\n        c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n        t=l.createElement(r);t.async=1;t.src=\"https://www.clarity.ms/tag/\"+i;\n        y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n    })(window, document, \"clarity\", \"script\", \"vf4385gv2b\");\n</script>","customCodeHeadEnd":"<script>function initApollo(){var n=Math.random().toString(36).substring(7),o=document.createElement(\"script\");\no.src=\"https://assets.apollo.io/micro/website-tracker/tracker.iife.js?nocache=\"+n,o.async=!0,o.defer=!0,\no.onload=function(){window.trackingFunctions.onLoad({appId:\"68ced61e28d0e10015bde2a6\"})},\ndocument.head.appendChild(o)}initApollo();</script>","customCodeBodyEnd":"<!-- Load Supabase library -->\n<script src=\"https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2\"></script>\n\n<script>\n  // ✅ 1. Supabase connection\n  const SUPABASE_URL = 'https://nurmozhzovpwrcjhlzoa.supabase.co';\n  const SUPABASE_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im51cm1vemh6b3Zwd3Jjamhsem9hIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjkxMDU3ODEsImV4cCI6MjA4NDY4MTc4MX0.L0poLQBppymW9mJtPbs9dhfclOQOU9FgERaoTv44jfM';\n  const supabase = supabase.createClient(SUPABASE_URL, SUPABASE_KEY);\n\n  // ✅ 2. Generalized form handler\n  async function handleForm(formSelector, table, emailSubject) {\n    const form = document.querySelector(formSelector);\n    if (!form) {\n      console.warn(`Form ${formSelector} not found.`);\n      return;\n    }\n\n    form.addEventListener('submit', async (e) => {\n      e.preventDefault();\n\n      // Gather form data\n      const formData = Object.fromEntries(new FormData(form).entries());\n      console.log(\"Submitting form data:\", formData);\n\n      // ✅ 3. Save data in Supabase\n      const { error } = await supabase.from(table).insert([formData]);\n      if (error) {\n        console.error('Supabase error:', error.message);\n        alert('❌ Error saving your submission. Please try again.');\n        return;\n      }\n\n      // ✅ 4. Send data to Zapier (email + HubSpot flow)\n      try {\n        const zapierResponse = await fetch('https://hooks.zapier.com/hooks/catch/24564789/uqp4rwx/', {\n          method: 'POST',\n          headers: { 'Content-Type': 'application/json' },\n          body: JSON.stringify({\n            formType: table,\n            subject: emailSubject,\n            recipient: 'admin@kaizarildinternational.com',\n            ...formData\n          })\n        });\n\n        if (!zapierResponse.ok) {\n          throw new Error(`Zapier webhook error: ${zapierResponse.statusText}`);\n        }\n\n        console.log(\"Zapier request sent successfully!\");\n        alert('✅ Your message has been sent successfully!');\n        form.reset();\n\n      } catch (err) {\n        console.error('Error sending to Zapier:', err);\n        alert('⚠️ Your submission was saved, but the email alert failed.');\n      }\n    });\n  }\n\n  // ✅ 5. Attach handlers once page loads\n  document.addEventListener('DOMContentLoaded', () => {\n    handleForm('#contact-form', 'contacts', 'New Contact/Consultation Request');\n    handleForm('#demo-form', 'demos', 'New Demo Request');\n    handleForm('#trainer-form', 'trainers', 'New Trainer Application');\n    handleForm('#course-form', 'course_registrations', 'New Course Registration');\n  });\n</script>\n","labs":{"E5FBBA911B2B7A09E649D4BE6CDF8591EAEFC881":false}},"sourceCodeHash":"2c35330fd88bf772e6a45b9a06c3991c189aa29e"}