;
! function() {
    try {
        var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {},
            n = (new e.Error).stack;
        n && ((e._debugIds || (e._debugIds = {}))[n] = "736dcd71-8f36-e7b2-3686-34c95599e8fb")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 420022, t => {
    "use strict";
    t.s(["isPlainObject", 0, function(t) {
        return "object" === Object.prototype.toString.call(t).slice(8, -1).toLowerCase()
    }])
}, 343452, t => {
    "use strict";
    t.s(["isPlanEventEnabled", 0, function(t, n) {
        var e, i;
        return "boolean" == typeof(null == n ? void 0 : n.enabled) ? n.enabled : null == (i = null == (e = null == t ? void 0 : t.__default) ? void 0 : e.enabled) || i
    }])
}, 642617, t => {
    "use strict";
    var n = t.i(274466),
        e = t.i(618675),
        i = t.i(692143),
        r = t.i(811471),
        o = t.i(457923),
        a = t.i(846406),
        s = t.i(456849),
        u = t.i(343452),
        c = t.i(208482),
        l = t.i(783321),
        d = t.i(862156),
        h = t.i(829014),
        f = t.i(150722),
        v = t.i(605344),
        g = t.i(395936);

    function p(t) {
        return t.toLowerCase().replace(".", "").replace(/\s+/g, "-")
    }

    function _(t, n) {
        return void 0 === n && (n = !1), n ? btoa(t).replace(/=/g, "") : void 0
    }
    var y = t.i(420022),
        w = function(t, n) {
            var e, i = n.type,
                r = n.bundlingStatus,
                o = n.versionSettings,
                a = "unbundled" !== r && ("browser" === i || (null == (e = null == o ? void 0 : o.componentTypes) ? void 0 : e.includes("browser")));
            return "Customer.io Data Pipelines" !== t && "Iterable" !== t && a
        },
        m = function(t, n) {
            var e = !1 === n.All && void 0 === n[t];
            return !1 === n[t] || e
        },
        b = function() {
            function t(t, e, i, r, o) {
                void 0 === i && (i = {}), this.options = {}, this.type = "destination", this.middleware = [], this._ready = !1, this._initialized = !1, this.flushing = !1, this.name = t, this.version = e, this.settings = (0, n.__assign)({}, i), this.disableAutoISOConversion = r.disableAutoISOConversion || !1, this.integrationSource = o, this.settings.type && "browser" === this.settings.type && delete this.settings.type, this.options = r, this.buffer = r.disableClientPersistence ? new d.PriorityQueue(4, []) : new h.PersistedPriorityQueue(4, "dest-".concat(t)), this.scheduleFlush()
            }
            return t.prototype.isLoaded = function() {
                return this._ready
            }, t.prototype.ready = function() {
                var t;
                return null != (t = this.onReady) ? t : Promise.resolve()
            }, t.prototype.load = function(t, e) {
                var i;
                return (0, n.__awaiter)(this, void 0, void 0, function() {
                    var r, o, a = this;
                    return (0, n.__generator)(this, function(s) {
                        switch (s.label) {
                            case 0:
                                if (this._ready || void 0 !== this.onReady) return [2];
                                if (null == (i = this.integrationSource)) return [3, 1];
                                return o = i, [3, 3];
                            case 1:
                                return [4, function(t, e, i, r) {
                                    return (0, n.__awaiter)(this, void 0, void 0, function() {
                                        var o, a, s, u, c;
                                        return (0, n.__generator)(this, function(l) {
                                            switch (l.label) {
                                                case 0:
                                                    a = _(o = p(e), r), s = (0, v.getNextIntegrationsURL)(), u = "".concat(s, "/").concat(null != a ? a : o, ".js?version=").concat(i), l.label = 1;
                                                case 1:
                                                    return l.trys.push([1, 3, , 4]), [4, (0, g.loadScript)(u)];
                                                case 2:
                                                    l.sent();
                                                    var d, h, f = u;
                                                    try {
                                                        var y = (null != (h = null == (d = null == window ? void 0 : window.performance) ? void 0 : d.getEntriesByName(f, "resource")) ? h : [])[0];
                                                        y && t.stats.gauge("legacy_destination_time", Math.round(y.duration), (0, n.__spreadArray)([e], y.duration < 100 ? ["cached"] : [], !0))
                                                    } catch (t) {}
                                                    return [3, 4];
                                                case 3:
                                                    throw c = l.sent(), t.stats.gauge("legacy_destination_time", -1, ["plugin:".concat(e), "failed"]), c;
                                                case 4:
                                                    return [4, Promise.all(window["".concat(o, "Deps")].map(function(t) {
                                                        return (0, g.loadScript)(s + t + ".gz")
                                                    }))];
                                                case 5:
                                                    return l.sent(), window["".concat(o, "Loader")](), [2, window["".concat(o, "Integration")]]
                                            }
                                        })
                                    })
                                }(t, this.name, this.version, this.options.obfuscate)];
                            case 2:
                                o = s.sent(), s.label = 3;
                            case 3:
                                r = o, this.integration = function(t, n, e) {
                                    if ("Integration" in t) {
                                        var i;
                                        t({
                                            user: function() {
                                                return e.user()
                                            },
                                            addIntegration: function() {}
                                        }), i = t.Integration
                                    } else i = t;
                                    var r = new i(n);
                                    return r.analytics = e, r
                                }(r, this.settings, e), this.onReady = new Promise(function(t) {
                                    a.integration.once("ready", function() {
                                        a._ready = !0, t(!0)
                                    })
                                }), this.onInitialize = new Promise(function(t) {
                                    a.integration.on("initialize", function() {
                                        a._initialized = !0, t(!0)
                                    })
                                });
                                try {
                                    t.stats.increment("analytics_js.integration.invoke", 1, ["method:initialize", "integration_name:".concat(this.name)]), this.integration.initialize()
                                } catch (n) {
                                    throw t.stats.increment("analytics_js.integration.invoke.error", 1, ["method:initialize", "integration_name:".concat(this.name)]), n
                                }
                                return [2]
                        }
                    })
                })
            }, t.prototype.unload = function(t, e) {
                return function(t, e, i) {
                    return (0, n.__awaiter)(this, void 0, void 0, function() {
                        var r, o, a, s;
                        return (0, n.__generator)(this, function(n) {
                            return r = (0, v.getNextIntegrationsURL)(), o = p(t), a = _(t, i), s = "".concat(r, "/").concat(null != a ? a : o, ".js?version=").concat(e), [2, (0, g.unloadScript)(s)]
                        })
                    })
                }(this.name, this.version, this.options.obfuscate)
            }, t.prototype.addMiddleware = function() {
                for (var t, n = [], e = 0; e < arguments.length; e++) n[e] = arguments[e];
                this.middleware = (t = this.middleware).concat.apply(t, n)
            }, t.prototype.shouldBuffer = function(t) {
                return "page" !== t.event.type && ((0, i.isOffline)() || !1 === this._ready || !1 === this._initialized)
            }, t.prototype.send = function(t, e, i) {
                var r, a;
                return (0, n.__awaiter)(this, void 0, void 0, function() {
                    var s, c, l, d, h, v;
                    return (0, n.__generator)(this, function(g) {
                        switch (g.label) {
                            case 0:
                                if (this.shouldBuffer(t)) return this.buffer.push(t), this.scheduleFlush(), [2, t];
                                if (s = null == (a = null == (r = this.options) ? void 0 : r.plan) ? void 0 : a.track, c = t.event.event, s && c && "Customer.io Data Pipelines" !== this.name) {
                                    if (l = s[c], !(0, u.isPlanEventEnabled)(s, l)) return t.updateEvent("integrations", (0, n.__assign)((0, n.__assign)({}, t.event.integrations), {
                                        All: !1,
                                        "Customer.io Data Pipelines": !0
                                    })), t.cancel(new o.ContextCancelation({
                                        retry: !1,
                                        reason: "Event ".concat(c, " disabled for integration ").concat(this.name, " in tracking plan"),
                                        type: "Dropped by plan"
                                    })), [2, t];
                                    if (t.updateEvent("integrations", (0, n.__assign)((0, n.__assign)({}, t.event.integrations), null == l ? void 0 : l.integrations)), (null == l ? void 0 : l.enabled) && (null == l ? void 0 : l.integrations[this.name]) === !1) return t.cancel(new o.ContextCancelation({
                                        retry: !1,
                                        reason: "Event ".concat(c, " disabled for integration ").concat(this.name, " in tracking plan"),
                                        type: "Dropped by plan"
                                    })), [2, t]
                                }
                                return [4, (0, f.applyDestinationMiddleware)(this.name, t.event, this.middleware)];
                            case 1:
                                if (null === (d = g.sent())) return [2, t];
                                h = new e(d, {
                                    traverse: !this.disableAutoISOConversion
                                }), t.stats.increment("analytics_js.integration.invoke", 1, ["method:".concat(i), "integration_name:".concat(this.name)]), g.label = 2;
                            case 2:
                                if (g.trys.push([2, 5, , 6]), !this.integration) return [3, 4];
                                return [4, this.integration.invoke.call(this.integration, i, h)];
                            case 3:
                                g.sent(), g.label = 4;
                            case 4:
                                return [3, 6];
                            case 5:
                                throw v = g.sent(), t.stats.increment("analytics_js.integration.invoke.error", 1, ["method:".concat(i), "integration_name:".concat(this.name)]), v;
                            case 6:
                                return [2, t]
                        }
                    })
                })
            }, t.prototype.track = function(t) {
                return (0, n.__awaiter)(this, void 0, void 0, function() {
                    return (0, n.__generator)(this, function(n) {
                        return [2, this.send(t, e.Track, "track")]
                    })
                })
            }, t.prototype.page = function(t) {
                var i;
                return (0, n.__awaiter)(this, void 0, void 0, function() {
                    var r = this;
                    return (0, n.__generator)(this, function(n) {
                        return (null == (i = this.integration) ? void 0 : i._assumesPageview) && !this._initialized && this.integration.initialize(), [2, this.onInitialize.then(function() {
                            return r.send(t, e.Page, "page")
                        })]
                    })
                })
            }, t.prototype.identify = function(t) {
                return (0, n.__awaiter)(this, void 0, void 0, function() {
                    return (0, n.__generator)(this, function(n) {
                        return [2, this.send(t, e.Identify, "identify")]
                    })
                })
            }, t.prototype.alias = function(t) {
                return (0, n.__awaiter)(this, void 0, void 0, function() {
                    return (0, n.__generator)(this, function(n) {
                        return [2, this.send(t, e.Alias, "alias")]
                    })
                })
            }, t.prototype.group = function(t) {
                return (0, n.__awaiter)(this, void 0, void 0, function() {
                    return (0, n.__generator)(this, function(n) {
                        return [2, this.send(t, e.Group, "group")]
                    })
                })
            }, t.prototype.scheduleFlush = function() {
                var t = this;
                this.flushing || setTimeout(function() {
                    return (0, n.__awaiter)(t, void 0, void 0, function() {
                        var t;
                        return (0, n.__generator)(this, function(e) {
                            switch (e.label) {
                                case 0:
                                    return this.flushing = !0, t = this, [4, function(t, e) {
                                        return (0, n.__awaiter)(this, void 0, void 0, function() {
                                            var o, a = this;
                                            return (0, n.__generator)(this, function(u) {
                                                switch (u.label) {
                                                    case 0:
                                                        if (o = [], (0, i.isOffline)()) return [2, e];
                                                        return [4, (0, l.pWhile)(function() {
                                                            return e.length > 0 && (0, i.isOnline)()
                                                        }, function() {
                                                            return (0, n.__awaiter)(a, void 0, void 0, function() {
                                                                var i;
                                                                return (0, n.__generator)(this, function(n) {
                                                                    switch (n.label) {
                                                                        case 0:
                                                                            if (!(i = e.pop())) return [2];
                                                                            return [4, (0, s.attempt)(i, t)];
                                                                        case 1:
                                                                            return n.sent() instanceof r.Context || o.push(i), [2]
                                                                    }
                                                                })
                                                            })
                                                        })];
                                                    case 1:
                                                        return u.sent(), o.map(function(t) {
                                                            return e.pushWithBackoff(t)
                                                        }), [2, e]
                                                }
                                            })
                                        })
                                    }(this, this.buffer)];
                                case 1:
                                    return t.buffer = e.sent(), this.flushing = !1, this.buffer.todo > 0 && this.scheduleFlush(), [2]
                            }
                        })
                    })
                }, 5e3 * Math.random())
            }, t
        }();
    t.s(["LegacyDestination", 0, b, "ajsDestinations", 0, function(t, e, i, r, o) {
        if (void 0 === e && (e = {}), void 0 === i && (i = {}), (0, a.isServer)()) return [];
        t.plan && ((i = null != i ? i : {}).plan = t.plan);
        var s, u, l = null != (u = null == (s = t.middlewareSettings) ? void 0 : s.routingRules) ? u : [],
            d = t.integrations,
            h = i.integrations,
            f = (0, c.mergedOptions)(t, null != i ? i : {}),
            v = null == o ? void 0 : o.reduce(function(t, e) {
                var i;
                return (0, n.__assign)((0, n.__assign)({}, t), ((i = {})[("Integration" in e ? e.Integration : e).prototype.name] = e, i))
            }, {});
        return Array.from(new Set((0, n.__spreadArray)((0, n.__spreadArray)([], Object.keys(d).filter(function(t) {
            return w(t, d[t])
        }), !0), Object.keys(v || {}).filter(function(t) {
            return (0, y.isPlainObject)(d[t]) || (0, y.isPlainObject)(null == h ? void 0 : h[t])
        }), !0))).filter(function(t) {
            return !m(t, e)
        }).map(function(t) {
            var n, e, o, a, s, u = null != (s = null != (o = null == (e = null == (n = d[t]) ? void 0 : n.versionSettings) ? void 0 : e.override) ? o : null == (a = null == n ? void 0 : n.versionSettings) ? void 0 : a.version) ? s : "latest",
                c = new b(t, u, f[t], i, null == v ? void 0 : v[t]);
            return l.filter(function(n) {
                return n.destinationName === t
            }).length > 0 && r && c.addMiddleware(r), c
        })
    }], 642617)
}]);

//# debugId=736dcd71-8f36-e7b2-3686-34c95599e8fb