{"version":3,"sources":["jsdelivr-header.js","/npm/sidewind@8.0.0/src/get-parents.ts","/npm/sidewind@8.0.0/src/get-state.ts","/npm/sidewind@8.0.0/src/utils.ts","/npm/sidewind@8.0.0/src/set-state.ts","/npm/sidewind@8.0.0/node_modules/regenerator-runtime/runtime.js","/npm/sidewind@8.0.0/src/evaluate.ts","/npm/sidewind@8.0.0/src/evaluate-directives.ts","/npm/sidewind@8.0.0/src/async-evaluate.ts","/npm/sidewind@8.0.0/src/directives/attribute.ts","/npm/sidewind@8.0.0/src/directives/cloak.ts","/npm/sidewind@8.0.0/src/directives/closest.ts","/npm/sidewind@8.0.0/src/directives/each.ts","/npm/sidewind@8.0.0/src/directives/if.ts","/npm/sidewind@8.0.0/src/directives/intersect.ts","/npm/sidewind@8.0.0/src/directives/interval.ts","/npm/sidewind@8.0.0/src/directives/recurse.ts","/npm/sidewind@8.0.0/src/directives/promise.ts","/npm/sidewind@8.0.0/src/directives/scroll.ts","/npm/sidewind@8.0.0/src/directives/ssr.ts","/npm/sidewind@8.0.0/src/directives/value.ts","/npm/sidewind@8.0.0/src/directives/state.ts","/npm/sidewind@8.0.0/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,2FCJA,SAAS,EACP,EACA,GAMA,IAJA,IAAM,EAAM,GACR,EAAqC,EACtC,cAGI,GAID,EAAO,aAAa,IACtB,EAAI,KAAK,GAGX,EAAS,EAAO,cAGlB,OAAO,CACR,CCpBD,SAAS,EACP,GAEA,IAAM,EAAwB,EAAQ,aAAa,WAC/C,EACC,EAAQ,QAAQ,aAErB,GAAK,EAAL,CAKA,IAAQ,EAA4B,EAA5B,MACF,EAMR,SAAyB,EAA8B,GAMrD,IALA,IAAM,EAAyB,EAAW,EAAS,GAAU,OAC3D,EAAQ,aAAa,WAAa,EAAU,IAExC,EAAiB,GAEd,EAAI,EAAuB,OAAQ,KAAO,CACjD,IAAM,EAAwB,EAC5B,GAEI,EAAQ,EAAsB,aAAa,GA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,QAAS,UAAW,GAC5B,CAAE,KAAM,SAAU,UAAW,GAC7B,CAAE,KAAM,SAAU,UAAW,GAC7B,CAAE,KAAM,IAAK,UAAW,GACxB,CAAE,KAAM,WAAY,UAAW,GAC/B,CAAE,KAAM,YAAa,UAAW,GAChC,CAAE,KAAM,YAAa,UAAW,GAChC,CAAE,KAAM,YAAa,UAAW,GAChC,CAAE,KAAM,aAAc,UAAW,GACjC,CAAE,KAAM,cAAe,UAAW,IAEpC,EAEH,CZ1CD,EAAe,gBAAiB,EEmHhC,EAAc,aAAe,MEjE7B,EAAmB,gBAAiB,ECpCpC,EAAkB,gBAAiB,EEMnC,EAAiB,gBAAiB,EEUlC,EAAa,aAAe,MEuC5B,EAAe,aAAe,MCzB9B,KAAK,iBAAiB,QAAQ,kBAAM,GAAN,IAE9B,KAAK,sBAAwB,EAC7B,KAAK,SAAW,EAChB,KAAK,SAAW,C","file":"/npm/sidewind@8.0.0/dist/sidewind.umd.development.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.19.2.\n * Original file: /npm/sidewind@8.0.0/dist/sidewind.umd.development.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { ExtendedHTMLElement } from \"./types\";\n\nfunction getParents(\n  element: ExtendedHTMLElement,\n  attribute: string,\n): ExtendedHTMLElement[] {\n  const ret = [];\n  let parent: ExtendedHTMLElement | null = element\n    .parentElement as ExtendedHTMLElement;\n\n  while (true) {\n    if (!parent) {\n      break;\n    }\n\n    if (parent.hasAttribute(attribute)) {\n      ret.push(parent);\n    }\n\n    parent = parent.parentElement as ExtendedHTMLElement;\n  }\n\n  return ret;\n}\n\nexport default getParents;\n","import { BindState, ExtendedHTMLElement } from \"./types\";\nimport getParents from \"./get-parents\";\n\nfunction getState<State = Record<string, unknown>>(\n  element: ExtendedHTMLElement\n): State | undefined {\n  const closestStateContainer = element.hasAttribute(\"x-state\")\n    ? element\n    : (element.closest(\"[x-state]\") as ExtendedHTMLElement);\n\n  if (!closestStateContainer) {\n    return;\n  }\n\n  // @ts-ignore How to type this?\n  const { state }: { state: State } = closestStateContainer;\n  const labeledState = getLabeledState(element, \"x-label\");\n\n  // @ts-ignore How to type this? Likely labels need more definition\n  return Object.assign({}, labeledState, { state });\n}\n\nfunction getLabeledState(element: ExtendedHTMLElement, labelKey: string) {\n  const labeledStateContainers = getParents(element, labelKey).concat(\n    element.hasAttribute(\"x-label\") ? element : []\n  );\n  const ret: BindState = {};\n\n  for (let i = labeledStateContainers.length; i--; ) {\n    const labeledStateContainer = labeledStateContainers[\n      i\n    ] as ExtendedHTMLElement;\n    const label = labeledStateContainer.getAttribute(labelKey);\n\n    if (label) {\n      ret[label] = labeledStateContainer.state;\n    }\n  }\n\n  return ret;\n}\n\nexport default getState;\n","import type { BindState, ExtendedHTMLElement } from \"./types\";\nimport getParents from \"./get-parents\";\n\nfunction get(object: BindState, keyString: string) {\n  const keys = keyString.split(\".\");\n  let ret = object;\n\n  keys.forEach((key) => {\n    // @ts-ignore TODO: Improve the type here\n    ret = ret[key];\n  });\n\n  return ret;\n}\n\nfunction getLevel(element: ExtendedHTMLElement) {\n  return (\n    getParents(element, \"x-recurse\").length +\n    (element.hasAttribute(\"x-recurse\") ? 1 : 0)\n  );\n}\n\nfunction getTemplates(element: ExtendedHTMLElement) {\n  return element.querySelectorAll(\":scope > *[x-template]\");\n}\n\nfunction getValues(data: BindState, getter: string | null): BindState {\n  if (!getter) {\n    return {};\n  }\n\n  const value = data[getter];\n\n  if (!value) {\n    console.error(\"Failed to get value\", data, getter);\n\n    return {};\n  }\n\n  return {\n    [getter]: value,\n  };\n}\n\nfunction isObject(obj: unknown) {\n  // @ts-ignore nodeName is ok check to do\n  return typeof obj === \"object\" && obj && !obj.nodeName;\n}\n\nexport { get, getLevel, getTemplates, getValues, isObject };\n","import { ExtendedHTMLElement } from \"./types\";\nimport getParents from \"./get-parents\";\nimport { isObject } from \"./utils\";\n\nfunction setState<State = unknown, Parent extends string = string>(\n  newValue: State,\n  {\n    element,\n    parent,\n  }: {\n    element?: ExtendedHTMLElement;\n    parent?: Parent;\n  } = {}\n) {\n  if (!element) {\n    element = window.event && (window.event.target as ExtendedHTMLElement);\n\n    if (!element) {\n      return;\n    }\n  }\n\n  const stateContainer = element.hasAttribute(\"x-state\")\n    ? element\n    : (element.closest(\"[x-state]\") as ExtendedHTMLElement);\n\n  if (!stateContainer) {\n    return;\n  }\n\n  if (parent) {\n    const labelName = \"x-label\";\n    const labeledStateContainers = getParents(element, labelName).concat(\n      element.hasAttribute(\"x-label\") ? element : []\n    );\n    const matchingParents = labeledStateContainers.filter(\n      (elem: ExtendedHTMLElement) => elem.getAttribute(labelName) === parent\n    );\n\n    if (matchingParents.length) {\n      const matchingParent = matchingParents[0];\n\n      // Signal to the state container that state was updated with a parent\n      element.setAttribute(\"x-updated\", parent);\n\n      setState(newValue, { element: matchingParent as ExtendedHTMLElement });\n    } else {\n      console.warn(\n        \"Failed to find matching parents for\",\n        parent,\n        \"in\",\n        labeledStateContainers,\n        \"for\",\n        element,\n        \"using\",\n        labelName\n      );\n    }\n  } else {\n    const state = stateContainer.state;\n\n    // @ts-ignore Figure out how to type this\n    const evaluatedValue = isFunction(newValue) ? newValue(state) : newValue;\n    const updatedState = isObject(evaluatedValue)\n      ? Object.assign({}, state, evaluatedValue)\n      : evaluatedValue;\n\n    stateContainer.setAttribute(\"x-state\", \"\");\n    stateContainer.state = updatedState;\n\n    // Signal to the state container that state was updated within. x-state\n    // will notice the update thanks to a mutation observer\n    element.setAttribute(\"x-updated\", \"\");\n  }\n}\n\nfunction isFunction(obj: unknown) {\n  return typeof obj === \"function\";\n}\n\nexport default setState;\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n  \"use strict\";\n\n  var Op = Object.prototype;\n  var hasOwn = Op.hasOwnProperty;\n  var undefined; // More compressible than void 0.\n  var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n  var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n  var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n  var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n  function define(obj, key, value) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n    return obj[key];\n  }\n  try {\n    // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n    define({}, \"\");\n  } catch (err) {\n    define = function(obj, key, value) {\n      return obj[key] = value;\n    };\n  }\n\n  function wrap(innerFn, outerFn, self, tryLocsList) {\n    // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n    var generator = Object.create(protoGenerator.prototype);\n    var context = new Context(tryLocsList || []);\n\n    // The ._invoke method unifies the implementations of the .next,\n    // .throw, and .return methods.\n    generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n    return generator;\n  }\n  exports.wrap = wrap;\n\n  // Try/catch helper to minimize deoptimizations. Returns a completion\n  // record like context.tryEntries[i].completion. This interface could\n  // have been (and was previously) designed to take a closure to be\n  // invoked without arguments, but in all the cases we care about we\n  // already have an existing method we want to call, so there's no need\n  // to create a new function object. We can even get away with assuming\n  // the method takes exactly one argument, since that happens to be true\n  // in every case, so we don't have to touch the arguments object. The\n  // only additional allocation required is the completion record, which\n  // has a stable shape and so hopefully should be cheap to allocate.\n  function tryCatch(fn, obj, arg) {\n    try {\n      return { type: \"normal\", arg: fn.call(obj, arg) };\n    } catch (err) {\n      return { type: \"throw\", arg: err };\n    }\n  }\n\n  var GenStateSuspendedStart = \"suspendedStart\";\n  var GenStateSuspendedYield = \"suspendedYield\";\n  var GenStateExecuting = \"executing\";\n  var GenStateCompleted = \"completed\";\n\n  // Returning this object from the innerFn has the same effect as\n  // breaking out of the dispatch switch statement.\n  var ContinueSentinel = {};\n\n  // Dummy constructor functions that we use as the .constructor and\n  // .constructor.prototype properties for functions that return Generator\n  // objects. For full spec compliance, you may wish to configure your\n  // minifier not to mangle the names of these two functions.\n  function Generator() {}\n  function GeneratorFunction() {}\n  function GeneratorFunctionPrototype() {}\n\n  // This is a polyfill for %IteratorPrototype% for environments that\n  // don't natively support it.\n  var IteratorPrototype = {};\n  define(IteratorPrototype, iteratorSymbol, function () {\n    return this;\n  });\n\n  var getProto = Object.getPrototypeOf;\n  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n  if (NativeIteratorPrototype &&\n      NativeIteratorPrototype !== Op &&\n      hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n    // This environment has a native %IteratorPrototype%; use it instead\n    // of the polyfill.\n    IteratorPrototype = NativeIteratorPrototype;\n  }\n\n  var Gp = GeneratorFunctionPrototype.prototype =\n    Generator.prototype = Object.create(IteratorPrototype);\n  GeneratorFunction.prototype = GeneratorFunctionPrototype;\n  define(Gp, \"constructor\", GeneratorFunctionPrototype);\n  define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n  GeneratorFunction.displayName = define(\n    GeneratorFunctionPrototype,\n    toStringTagSymbol,\n    \"GeneratorFunction\"\n  );\n\n  // Helper for defining the .next, .throw, and .return methods of the\n  // Iterator interface in terms of a single ._invoke method.\n  function defineIteratorMethods(prototype) {\n    [\"next\", \"throw\", \"return\"].forEach(function(method) {\n      define(prototype, method, function(arg) {\n        return this._invoke(method, arg);\n      });\n    });\n  }\n\n  exports.isGeneratorFunction = function(genFun) {\n    var ctor = typeof genFun === \"function\" && genFun.constructor;\n    return ctor\n      ? ctor === GeneratorFunction ||\n        // For the native GeneratorFunction constructor, the best we can\n        // do is to check its .name property.\n        (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n      : false;\n  };\n\n  exports.mark = function(genFun) {\n    if (Object.setPrototypeOf) {\n      Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n    } else {\n      genFun.__proto__ = GeneratorFunctionPrototype;\n      define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n    }\n    genFun.prototype = Object.create(Gp);\n    return genFun;\n  };\n\n  // Within the body of any async function, `await x` is transformed to\n  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n  // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n  // meant to be awaited.\n  exports.awrap = function(arg) {\n    return { __await: arg };\n  };\n\n  function AsyncIterator(generator, PromiseImpl) {\n    function invoke(method, arg, resolve, reject) {\n      var record = tryCatch(generator[method], generator, arg);\n      if (record.type === \"throw\") {\n        reject(record.arg);\n      } else {\n        var result = record.arg;\n        var value = result.value;\n        if (value &&\n            typeof value === \"object\" &&\n            hasOwn.call(value, \"__await\")) {\n          return PromiseImpl.resolve(value.__await).then(function(value) {\n            invoke(\"next\", value, resolve, reject);\n          }, function(err) {\n            invoke(\"throw\", err, resolve, reject);\n          });\n        }\n\n        return PromiseImpl.resolve(value).then(function(unwrapped) {\n          // When a yielded Promise is resolved, its final value becomes\n          // the .value of the Promise<{value,done}> result for the\n          // current iteration.\n          result.value = unwrapped;\n          resolve(result);\n        }, function(error) {\n          // If a rejected Promise was yielded, throw the rejection back\n          // into the async generator function so it can be handled there.\n          return invoke(\"throw\", error, resolve, reject);\n        });\n      }\n    }\n\n    var previousPromise;\n\n    function enqueue(method, arg) {\n      function callInvokeWithMethodAndArg() {\n        return new PromiseImpl(function(resolve, reject) {\n          invoke(method, arg, resolve, reject);\n        });\n      }\n\n      return previousPromise =\n        // If enqueue has been called before, then we want to wait until\n        // all previous Promises have been resolved before calling invoke,\n        // so that results are always delivered in the correct order. If\n        // enqueue has not been called before, then it is important to\n        // call invoke immediately, without waiting on a callback to fire,\n        // so that the async generator function has the opportunity to do\n        // any necessary setup in a predictable way. This predictability\n        // is why the Promise constructor synchronously invokes its\n        // executor callback, and why async functions synchronously\n        // execute code before the first await. Since we implement simple\n        // async functions in terms of async generators, it is especially\n        // important to get this right, even though it requires care.\n        previousPromise ? previousPromise.then(\n          callInvokeWithMethodAndArg,\n          // Avoid propagating failures to Promises returned by later\n          // invocations of the iterator.\n          callInvokeWithMethodAndArg\n        ) : callInvokeWithMethodAndArg();\n    }\n\n    // Define the unified helper method that is used to implement .next,\n    // .throw, and .return (see defineIteratorMethods).\n    this._invoke = enqueue;\n  }\n\n  defineIteratorMethods(AsyncIterator.prototype);\n  define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n    return this;\n  });\n  exports.AsyncIterator = AsyncIterator;\n\n  // Note that simple async functions are implemented on top of\n  // AsyncIterator objects; they just return a Promise for the value of\n  // the final result produced by the iterator.\n  exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n    if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n    var iter = new AsyncIterator(\n      wrap(innerFn, outerFn, self, tryLocsList),\n      PromiseImpl\n    );\n\n    return exports.isGeneratorFunction(outerFn)\n      ? iter // If outerFn is a generator, return the full iterator.\n      : iter.next().then(function(result) {\n          return result.done ? result.value : iter.next();\n        });\n  };\n\n  function makeInvokeMethod(innerFn, self, context) {\n    var state = GenStateSuspendedStart;\n\n    return function invoke(method, arg) {\n      if (state === GenStateExecuting) {\n        throw new Error(\"Generator is already running\");\n      }\n\n      if (state === GenStateCompleted) {\n        if (method === \"throw\") {\n          throw arg;\n        }\n\n        // Be forgiving, per 25.3.3.3.3 of the spec:\n        // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n        return doneResult();\n      }\n\n      context.method = method;\n      context.arg = arg;\n\n      while (true) {\n        var delegate = context.delegate;\n        if (delegate) {\n          var delegateResult = maybeInvokeDelegate(delegate, context);\n          if (delegateResult) {\n            if (delegateResult === ContinueSentinel) continue;\n            return delegateResult;\n          }\n        }\n\n        if (context.method === \"next\") {\n          // Setting context._sent for legacy support of Babel's\n          // function.sent implementation.\n          context.sent = context._sent = context.arg;\n\n        } else if (context.method === \"throw\") {\n          if (state === GenStateSuspendedStart) {\n            state = GenStateCompleted;\n            throw context.arg;\n          }\n\n          context.dispatchException(context.arg);\n\n        } else if (context.method === \"return\") {\n          context.abrupt(\"return\", context.arg);\n        }\n\n        state = GenStateExecuting;\n\n        var record = tryCatch(innerFn, self, context);\n        if (record.type === \"normal\") {\n          // If an exception is thrown from innerFn, we leave state ===\n          // GenStateExecuting and loop back for another invocation.\n          state = context.done\n            ? GenStateCompleted\n            : GenStateSuspendedYield;\n\n          if (record.arg === ContinueSentinel) {\n            continue;\n          }\n\n          return {\n            value: record.arg,\n            done: context.done\n          };\n\n        } else if (record.type === \"throw\") {\n          state = GenStateCompleted;\n          // Dispatch the exception by looping back around to the\n          // context.dispatchException(context.arg) call above.\n          context.method = \"throw\";\n          context.arg = record.arg;\n        }\n      }\n    };\n  }\n\n  // Call delegate.iterator[context.method](context.arg) and handle the\n  // result, either by returning a { value, done } result from the\n  // delegate iterator, or by modifying context.method and context.arg,\n  // setting context.delegate to null, and returning the ContinueSentinel.\n  function maybeInvokeDelegate(delegate, context) {\n    var method = delegate.iterator[context.method];\n    if (method === undefined) {\n      // A .throw or .return when the delegate iterator has no .throw\n      // method always terminates the yield* loop.\n      context.delegate = null;\n\n      if (context.method === \"throw\") {\n        // Note: [\"return\"] must be used for ES3 parsing compatibility.\n        if (delegate.iterator[\"return\"]) {\n          // If the delegate iterator has a return method, give it a\n          // chance to clean up.\n          context.method = \"return\";\n          context.arg = undefined;\n          maybeInvokeDelegate(delegate, context);\n\n          if (context.method === \"throw\") {\n            // If maybeInvokeDelegate(context) changed context.method from\n            // \"return\" to \"throw\", let that override the TypeError below.\n            return ContinueSentinel;\n          }\n        }\n\n        context.method = \"throw\";\n        context.arg = new TypeError(\n          \"The iterator does not provide a 'throw' method\");\n      }\n\n      return ContinueSentinel;\n    }\n\n    var record = tryCatch(method, delegate.iterator, context.arg);\n\n    if (record.type === \"throw\") {\n      context.method = \"throw\";\n      context.arg = record.arg;\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    var info = record.arg;\n\n    if (! info) {\n      context.method = \"throw\";\n      context.arg = new TypeError(\"iterator result is not an object\");\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    if (info.done) {\n      // Assign the result of the finished delegate to the temporary\n      // variable specified by delegate.resultName (see delegateYield).\n      context[delegate.resultName] = info.value;\n\n      // Resume execution at the desired location (see delegateYield).\n      context.next = delegate.nextLoc;\n\n      // If context.method was \"throw\" but the delegate handled the\n      // exception, let the outer generator proceed normally. If\n      // context.method was \"next\", forget context.arg since it has been\n      // \"consumed\" by the delegate iterator. If context.method was\n      // \"return\", allow the original .return call to continue in the\n      // outer generator.\n      if (context.method !== \"return\") {\n        context.method = \"next\";\n        context.arg = undefined;\n      }\n\n    } else {\n      // Re-yield the result returned by the delegate method.\n      return info;\n    }\n\n    // The delegate iterator is finished, so forget it and continue with\n    // the outer generator.\n    context.delegate = null;\n    return ContinueSentinel;\n  }\n\n  // Define Generator.prototype.{next,throw,return} in terms of the\n  // unified ._invoke helper method.\n  defineIteratorMethods(Gp);\n\n  define(Gp, toStringTagSymbol, \"Generator\");\n\n  // A Generator should always return itself as the iterator object when the\n  // @@iterator function is called on it. Some browsers' implementations of the\n  // iterator prototype chain incorrectly implement this, causing the Generator\n  // object to not be returned from this call. This ensures that doesn't happen.\n  // See https://github.com/facebook/regenerator/issues/274 for more details.\n  define(Gp, iteratorSymbol, function() {\n    return this;\n  });\n\n  define(Gp, \"toString\", function() {\n    return \"[object Generator]\";\n  });\n\n  function pushTryEntry(locs) {\n    var entry = { tryLoc: locs[0] };\n\n    if (1 in locs) {\n      entry.catchLoc = locs[1];\n    }\n\n    if (2 in locs) {\n      entry.finallyLoc = locs[2];\n      entry.afterLoc = locs[3];\n    }\n\n    this.tryEntries.push(entry);\n  }\n\n  function resetTryEntry(entry) {\n    var record = entry.completion || {};\n    record.type = \"normal\";\n    delete record.arg;\n    entry.completion = record;\n  }\n\n  function Context(tryLocsList) {\n    // The root entry object (effectively a try statement without a catch\n    // or a finally block) gives us a place to store values thrown from\n    // locations where there is no enclosing try statement.\n    this.tryEntries = [{ tryLoc: \"root\" }];\n    tryLocsList.forEach(pushTryEntry, this);\n    this.reset(true);\n  }\n\n  exports.keys = function(object) {\n    var keys = [];\n    for (var key in object) {\n      keys.push(key);\n    }\n    keys.reverse();\n\n    // Rather than returning an object with a next method, we keep\n    // things simple and return the next function itself.\n    return function next() {\n      while (keys.length) {\n        var key = keys.pop();\n        if (key in object) {\n          next.value = key;\n          next.done = false;\n          return next;\n        }\n      }\n\n      // To avoid creating an additional object, we just hang the .value\n      // and .done properties off the next function object itself. This\n      // also ensures that the minifier will not anonymize the function.\n      next.done = true;\n      return next;\n    };\n  };\n\n  function values(iterable) {\n    if (iterable) {\n      var iteratorMethod = iterable[iteratorSymbol];\n      if (iteratorMethod) {\n        return iteratorMethod.call(iterable);\n      }\n\n      if (typeof iterable.next === \"function\") {\n        return iterable;\n      }\n\n      if (!isNaN(iterable.length)) {\n        var i = -1, next = function next() {\n          while (++i < iterable.length) {\n            if (hasOwn.call(iterable, i)) {\n              next.value = iterable[i];\n              next.done = false;\n              return next;\n            }\n          }\n\n          next.value = undefined;\n          next.done = true;\n\n          return next;\n        };\n\n        return next.next = next;\n      }\n    }\n\n    // Return an iterator with no values.\n    return { next: doneResult };\n  }\n  exports.values = values;\n\n  function doneResult() {\n    return { value: undefined, done: true };\n  }\n\n  Context.prototype = {\n    constructor: Context,\n\n    reset: function(skipTempReset) {\n      this.prev = 0;\n      this.next = 0;\n      // Resetting context._sent for legacy support of Babel's\n      // function.sent implementation.\n      this.sent = this._sent = undefined;\n      this.done = false;\n      this.delegate = null;\n\n      this.method = \"next\";\n      this.arg = undefined;\n\n      this.tryEntries.forEach(resetTryEntry);\n\n      if (!skipTempReset) {\n        for (var name in this) {\n          // Not sure about the optimal order of these conditions:\n          if (name.charAt(0) === \"t\" &&\n              hasOwn.call(this, name) &&\n              !isNaN(+name.slice(1))) {\n            this[name] = undefined;\n          }\n        }\n      }\n    },\n\n    stop: function() {\n      this.done = true;\n\n      var rootEntry = this.tryEntries[0];\n      var rootRecord = rootEntry.completion;\n      if (rootRecord.type === \"throw\") {\n        throw rootRecord.arg;\n      }\n\n      return this.rval;\n    },\n\n    dispatchException: function(exception) {\n      if (this.done) {\n        throw exception;\n      }\n\n      var context = this;\n      function handle(loc, caught) {\n        record.type = \"throw\";\n        record.arg = exception;\n        context.next = loc;\n\n        if (caught) {\n          // If the dispatched exception was caught by a catch block,\n          // then let that catch block handle the exception normally.\n          context.method = \"next\";\n          context.arg = undefined;\n        }\n\n        return !! caught;\n      }\n\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        var record = entry.completion;\n\n        if (entry.tryLoc === \"root\") {\n          // Exception thrown outside of any try block that could handle\n          // it, so set the completion value of the entire function to\n          // throw the exception.\n          return handle(\"end\");\n        }\n\n        if (entry.tryLoc <= this.prev) {\n          var hasCatch = hasOwn.call(entry, \"catchLoc\");\n          var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n          if (hasCatch && hasFinally) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            } else if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else if (hasCatch) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            }\n\n          } else if (hasFinally) {\n            if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else {\n            throw new Error(\"try statement without catch or finally\");\n          }\n        }\n      }\n    },\n\n    abrupt: function(type, arg) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc <= this.prev &&\n            hasOwn.call(entry, \"finallyLoc\") &&\n            this.prev < entry.finallyLoc) {\n          var finallyEntry = entry;\n          break;\n        }\n      }\n\n      if (finallyEntry &&\n          (type === \"break\" ||\n           type === \"continue\") &&\n          finallyEntry.tryLoc <= arg &&\n          arg <= finallyEntry.finallyLoc) {\n        // Ignore the finally entry if control is not jumping to a\n        // location outside the try/catch block.\n        finallyEntry = null;\n      }\n\n      var record = finallyEntry ? finallyEntry.completion : {};\n      record.type = type;\n      record.arg = arg;\n\n      if (finallyEntry) {\n        this.method = \"next\";\n        this.next = finallyEntry.finallyLoc;\n        return ContinueSentinel;\n      }\n\n      return this.complete(record);\n    },\n\n    complete: function(record, afterLoc) {\n      if (record.type === \"throw\") {\n        throw record.arg;\n      }\n\n      if (record.type === \"break\" ||\n          record.type === \"continue\") {\n        this.next = record.arg;\n      } else if (record.type === \"return\") {\n        this.rval = this.arg = record.arg;\n        this.method = \"return\";\n        this.next = \"end\";\n      } else if (record.type === \"normal\" && afterLoc) {\n        this.next = afterLoc;\n      }\n\n      return ContinueSentinel;\n    },\n\n    finish: function(finallyLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.finallyLoc === finallyLoc) {\n          this.complete(entry.completion, entry.afterLoc);\n          resetTryEntry(entry);\n          return ContinueSentinel;\n        }\n      }\n    },\n\n    \"catch\": function(tryLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc === tryLoc) {\n          var record = entry.completion;\n          if (record.type === \"throw\") {\n            var thrown = record.arg;\n            resetTryEntry(entry);\n          }\n          return thrown;\n        }\n      }\n\n      // The context.catch method must only be called with a location\n      // argument that corresponds to a known catch block.\n      throw new Error(\"illegal catch attempt\");\n    },\n\n    delegateYield: function(iterable, resultName, nextLoc) {\n      this.delegate = {\n        iterator: values(iterable),\n        resultName: resultName,\n        nextLoc: nextLoc\n      };\n\n      if (this.method === \"next\") {\n        // Deliberately forget the last sent value so that we don't\n        // accidentally pass it on to the delegate.\n        this.arg = undefined;\n      }\n\n      return ContinueSentinel;\n    }\n  };\n\n  // Regardless of whether this script is executing as a CommonJS module\n  // or not, return the runtime object so that we can declare the variable\n  // regeneratorRuntime in the outer scope, which allows this module to be\n  // injected easily by `bin/regenerator --include-runtime script.js`.\n  return exports;\n\n}(\n  // If this script is executing as a CommonJS module, use module.exports\n  // as the regeneratorRuntime namespace. Otherwise create a new empty\n  // object. Either way, the resulting object will be used to initialize\n  // the regeneratorRuntime variable at the top of this file.\n  typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n  regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n  // This module should not be running in strict mode, so the above\n  // assignment should always work unless something is misconfigured. Just\n  // in case runtime.js accidentally runs in strict mode, in modern engines\n  // we can explicitly access globalThis. In older engines we can escape\n  // strict mode using a global Function call. This could conceivably fail\n  // if a Content Security Policy forbids using Function, but in that case\n  // the proper solution is to fix the accidental strict mode problem. If\n  // you've misconfigured your bundler to force strict mode and applied a\n  // CSP to forbid Function, and you're not willing to fix either of those\n  // problems, please detail your unique predicament in a GitHub issue.\n  if (typeof globalThis === \"object\") {\n    globalThis.regeneratorRuntime = runtime;\n  } else {\n    Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n  }\n}\n","/* eslint no-new-func: 0 */\nimport { BindState } from \"./types\";\n\nfunction evaluate(expression: string, value: BindState = {}, element: unknown) {\n  try {\n    value.element = element;\n\n    return Function.apply(\n      null,\n      Object.keys(value).concat(`return ${expression}`)\n    )(...Object.values(value));\n  } catch (err) {\n    console.error(\"Failed to evaluate\", expression, value, err);\n  }\n}\n\nexport default evaluate;\n","import {\n  Directive,\n  DirectiveFunction,\n  EvaluateFrom,\n  ExtendedHTMLElement,\n} from \"./types\";\nimport getParents from \"./get-parents\";\nimport evaluate from \"./evaluate\";\nimport getState from \"./get-state\";\nimport setState from \"./set-state\";\n\nasync function evaluateDirectives(\n  directives: Directive[],\n  parent?: ExtendedHTMLElement\n) {\n  // Evaluate directives in series while resolving their values to avoid\n  // race conditions.\n  for await (const { name, directive } of directives) {\n    await evaluateDirective(\n      directives,\n      name,\n      directive,\n      parent,\n      directive.evaluateFrom\n    );\n  }\n}\n\nfunction evaluateDirective(\n  directives: Directive[],\n  name: string,\n  directive: DirectiveFunction,\n  parent?: ExtendedHTMLElement,\n  evaluateFrom: EvaluateFrom = \"bottom\"\n) {\n  const elements = (parent || document.body).querySelectorAll(`[${name}]`);\n\n  if (evaluateFrom === \"top\") {\n    for (let i = 0; i < elements.length; i++) {\n      evaluateOne(elements[i] as ExtendedHTMLElement);\n    }\n  } else {\n    for (let i = elements.length; i--; ) {\n      evaluateOne(elements[i] as ExtendedHTMLElement);\n    }\n  }\n\n  function evaluateOne(element: ExtendedHTMLElement) {\n    if (element.closest(\"[x-template]\")) {\n      return;\n    }\n\n    // x-if logic\n    const hiddenParents = getParents(element, \"hidden\");\n    if (hiddenParents.length > 0) {\n      return;\n    }\n\n    const closestEach = name !== \"x-each\" && element.closest(\"[x-each]\");\n\n    // TODO: Simplify this logic somehow\n    // If scope isn't ready, skip until a later evaluation\n    if (\n      name !== \"x-ssr\" &&\n      closestEach &&\n      !closestEach.getAttribute(\"_x-init\")\n    ) {\n      return;\n    }\n\n    directive({\n      directives,\n      element: element as ExtendedHTMLElement,\n      expression: element.getAttribute(name) || \"\",\n      evaluate,\n      getState,\n      setState,\n      evaluateDirectives,\n    });\n  }\n}\n\nexport default evaluateDirectives;\n","import { BindState } from \"./types\";\n\nfunction asyncEvaluate(\n  expression: string,\n  value: BindState = {},\n  element: unknown\n) {\n  try {\n    value.element = element;\n\n    return Promise.resolve(\n      Function.apply(\n        null,\n        Object.keys(value).concat(`return ${expression}`)\n      )(...Object.values(value))\n    );\n  } catch (err) {\n    console.error(\"Failed to evaluate\", expression, value, err);\n\n    return undefined;\n  }\n}\n\nexport { asyncEvaluate };\n","import { asyncEvaluate } from \"../async-evaluate\";\nimport { DirectiveParameters, ExtendedHTMLElement } from \"../types\";\n\nconst X_INITIAL_CLASS = \"x-initial-class\";\n\nfunction attributeDirective({ element, getState }: DirectiveParameters) {\n  const attributes = Array.from(element.attributes);\n\n  return Promise.all(\n    attributes.map(async (attribute) => {\n      // @ts-ignore TODO: Fix the type\n      const attributeName = attribute.nodeName;\n\n      if (attributeName.startsWith(\"@\")) {\n        const state = await asyncEvaluate(\n          // @ts-ignore TODO: Fix the type\n          attribute.value,\n          getState(element),\n          element\n        );\n\n        setAttribute(element, attributeName.slice(1), state);\n      }\n    })\n  );\n}\n\nfunction setAttribute(\n  element: ExtendedHTMLElement,\n  targetName: string,\n  evaluatedValue: any\n) {\n  let extraValues: string[] = [];\n\n  if (targetName === \"class\") {\n    const initialClass = element.getAttribute(X_INITIAL_CLASS);\n\n    if (typeof initialClass === \"string\") {\n      extraValues = initialClass.split(\" \");\n    } else {\n      const classValue = element.getAttribute(\"class\") || \"\";\n\n      element.setAttribute(X_INITIAL_CLASS, classValue);\n      extraValues = classValue.split(\" \");\n    }\n  }\n\n  const initialValues = Array.isArray(evaluatedValue)\n    ? evaluatedValue.filter(Boolean)\n    : [evaluatedValue];\n\n  element.setAttribute(targetName, initialValues.concat(extraValues).join(\" \"));\n}\n\nexport default attributeDirective;\n","import { DirectiveParameters } from \"../types\";\n\nfunction cloakDirective({ element }: DirectiveParameters) {\n  element.removeAttribute(\"hidden\");\n}\ncloakDirective.skipEvaluation = true;\n\nexport default cloakDirective;\n","import { BindState, DirectiveParameters, ExtendedHTMLElement } from \"../types\";\nimport { getValues } from \"../utils\";\n\n// TODO: Communicate somehow this should be evaluated after value directive\n// -> dependency declaration\nfunction closestDirective({\n  element,\n  expression,\n  evaluate,\n  setState,\n}: DirectiveParameters) {\n  // @ts-ignore TODO: Fix the type\n  const { state } = evaluate(expression, {}, element);\n  const key = Object.keys(state)[0];\n  const evaluateValue = () =>\n    // @ts-ignore TODO: Fix the type\n    evaluateClosestValue(\n      element,\n      // @ts-ignore TODO: Fix the type\n      evaluate(expression, {}, element).state,\n      key,\n      setState\n    );\n\n  window.addEventListener(\"scroll\", evaluateValue);\n\n  evaluateValue();\n}\n\nfunction evaluateClosestValue(\n  closestContainer: ExtendedHTMLElement,\n  closestState: BindState,\n  key: string,\n  setState: DirectiveParameters[\"setState\"]\n) {\n  // @ts-ignore TODO: Fix the type\n  const elements = Array.from(getValues(closestState, key)[key]).map(\n    (value) => {\n      const element = value as HTMLElement;\n      const { top } = element.getBoundingClientRect();\n\n      return {\n        element,\n        top,\n      };\n    }\n  );\n\n  if (!elements || elements.length < 1) {\n    return;\n  }\n\n  const closest = elements.reduce((a, b) =>\n    Math.abs(a.top) < Math.abs(b.top) ? a : b\n  );\n\n  setState({ [key]: closest.element }, { element: closestContainer });\n}\n\nexport default closestDirective;\n","import { getLevel, getTemplates } from \"../utils\";\nimport type { DirectiveParameters, ExtendedHTMLElement } from \"../types\";\n\nfunction eachDirective({\n  element,\n  expression,\n  evaluate,\n  getState,\n  evaluateDirectives,\n  directives,\n}: DirectiveParameters) {\n  const elementState = getState(element);\n  // @ts-ignore TODO: Fix the type\n  const state = evaluate(expression, elementState, element) || [];\n\n  if (!Array.isArray(state)) {\n    console.error(\n      \"x-each - Evaluated expression does not yield an array\",\n      expression,\n      element\n    );\n\n    return;\n  }\n\n  // @ts-ignore TODO: Fix the type. Probably some type above is wrong\n  if (state === element.state) {\n    return;\n  }\n\n  const level = getLevel(element);\n  const amountOfTemplates = element.templates?.length || 0;\n\n  if (amountOfTemplates > 0) {\n    const amountOfItems = state.length * amountOfTemplates;\n    const amountOfChildren = element.children.length;\n    const amountOfExtraNodes = amountOfItems - amountOfChildren;\n\n    // Remove extra nodes\n    if (amountOfExtraNodes < 0) {\n      for (let i = 0; i < -amountOfExtraNodes; i++) {\n        element.lastElementChild?.remove();\n      }\n    }\n\n    let child = element.firstElementChild as ExtendedHTMLElement;\n\n    state.forEach((value: unknown) => {\n      for (let i = 0; i < amountOfTemplates; i++) {\n        if (child) {\n          // The actual state is stored to the object\n          child.state = { value, level };\n\n          child = child.nextElementSibling as ExtendedHTMLElement;\n        }\n      }\n    });\n\n    if (child && state.length === 0) {\n      child.remove();\n    }\n\n    // Create missing nodes\n    if (amountOfExtraNodes > 0) {\n      const renderTemplate = getTemplateRenderer(\n        element,\n        element.templates,\n        level\n      );\n      const missingState = state.slice(amountOfChildren / amountOfTemplates);\n\n      for (let i = 0; i < amountOfExtraNodes / amountOfTemplates; i++) {\n        renderTemplate(missingState[i]);\n      }\n    }\n\n    // Set the changed state\n    // @ts-ignore TODO: Fix the type\n    element.state = state;\n  } else {\n    const hasParentEach = !!element.closest(\"[x-has-each]\");\n\n    // Stash state so it can be compared later to avoid work.\n    // In case state is derived from another x-each, use getState(element) here.\n    // @ts-ignore TODO: Fix the type\n    element.state = hasParentEach ? elementState.state : state;\n\n    let templates = getTemplates(element);\n\n    if (!templates.length) {\n      console.error(\"x-each - x-template was not found\", element);\n\n      return;\n    }\n\n    // If x-template isn't meant to be a group, pick only the first one\n    if (templates[0].getAttribute(\"x-template\") !== \"group\") {\n      // @ts-ignore Figure out the right way to type this (should be a NodeList)\n      templates = [templates[0]];\n    }\n\n    // Stash template for future use\n    element.templates = templates;\n\n    // Mark element as initialized (needed by state evaluation)\n    element.setAttribute(\"_x-init\", \"1\");\n    element.setAttribute(\"x-has-each\", \"\");\n\n    // Empty contents as they'll be replaced by applying the template\n    while (element.firstChild) {\n      element.lastChild && element.removeChild(element.lastChild);\n    }\n\n    const renderTemplate = getTemplateRenderer(element, templates, level);\n\n    state.forEach(renderTemplate);\n  }\n\n  evaluateDirectives(directives, element);\n}\neachDirective.evaluateFrom = \"top\";\n\nfunction getTemplateRenderer(\n  element: ExtendedHTMLElement,\n  templates: ExtendedHTMLElement[\"templates\"],\n  level: number\n) {\n  const renderTemplate = (value: unknown) => {\n    if (!templates) {\n      return;\n    }\n\n    for (let i = 0; i < templates.length; i++) {\n      const template = templates[i];\n      const templateClone = template.cloneNode(true) as ExtendedHTMLElement;\n\n      // Remote template mark\n      templateClone.removeAttribute(\"x-template\");\n\n      // The element should be a state container itself so that children can\n      // access its data.\n      templateClone.setAttribute(\"x-state\", \"\");\n\n      // Mark as a former template so that recursion (x-recurse) can find it\n      templateClone.setAttribute(\"_x-template\", \"\");\n\n      // The actual state is stored to the object\n      templateClone.state = { value, level };\n\n      element.appendChild(templateClone);\n    }\n  };\n\n  return renderTemplate;\n}\n\nexport default eachDirective;\n","import { DirectiveParameters } from \"../types\";\n\nfunction ifDirective({\n  element,\n  expression,\n  evaluate,\n  getState,\n}: DirectiveParameters) {\n  // @ts-ignore TODO: Fix the type\n  element.hidden = !evaluate(expression, getState(element), element);\n}\n\nexport default ifDirective;\n","import { DirectiveParameters } from \"../types\";\n\nfunction intersectDirective({\n  element,\n  expression,\n  evaluateDirectives,\n  directives,\n  evaluate,\n  setState,\n}: DirectiveParameters) {\n  // @ts-ignore TODO: Fix the type\n  const { options = {} } = evaluate(expression, {}, element);\n\n  let triggered = false;\n  const observer = new IntersectionObserver(\n    (entries) => {\n      if (options.once && triggered) {\n        return;\n      }\n\n      // https://stackoverflow.com/questions/53214116/intersectionobserver-callback-firing-immediately-on-page-load\n      const intersected = entries.some((entry) => {\n        return entry.intersectionRatio > 0;\n      });\n\n      if (!intersected) {\n        return;\n      }\n\n      triggered = true;\n\n      // @ts-ignore TODO: Fix the type\n      setState(evaluate(expression).state, { element }, element);\n\n      // Evaluate directives from the element parent to allow setting state to\n      // x-intersected element itself.\n      // Most likely this should be solved in another way at a higher level.\n      const directivesWithoutSkipping = directives.filter(\n        ({ directive }) => !directive.skipEvaluation\n      );\n\n      // @ts-ignore\n      evaluateDirectives(directivesWithoutSkipping, element.parentElement);\n    },\n    Object.assign(\n      {},\n      {\n        rootMargin: \"0px\",\n        threshold: 1.0,\n      },\n      options\n    )\n  );\n  observer.observe(element);\n}\nintersectDirective.skipEvaluation = true;\n\nexport default intersectDirective;\n","import { DirectiveParameters } from \"../types\";\n\nfunction intervalDirective({\n  element,\n  expression,\n  evaluate,\n  setState,\n}: DirectiveParameters) {\n  // @ts-ignore TODO: Fix the type\n  const { options = {} } = evaluate(expression, {}, element);\n  // @ts-ignore TODO: Fix the type\n  const evaluateValue = () =>\n    // @ts-ignore TODO: Fix the type\n    setState(evaluate(expression, {}, element).state, { element });\n\n  setInterval(evaluateValue, options.delay || 1000);\n\n  evaluateValue();\n}\nintervalDirective.skipEvaluation = true;\n\nexport default intervalDirective;\n","import { DirectiveParameters, ExtendedHTMLElement } from \"../types\";\nimport getParents from \"../get-parents\";\n\nfunction recurseDirective({\n  element,\n  expression,\n  evaluate,\n  getState,\n  evaluateDirectives,\n  directives,\n}: DirectiveParameters) {\n  // @ts-ignore TODO: Fix the type\n  const state = evaluate(expression, getState(element), element);\n  let parentIndex = 0;\n  let value = expression;\n\n  if (state.parentIndex && state.value) {\n    parentIndex = state.parentIndex;\n    value = state.value;\n  } else if (!Array.isArray(state)) {\n    return;\n  }\n\n  const hasEachAlready = element.getAttribute(\"x-each\");\n\n  if (hasEachAlready) {\n    return;\n  }\n\n  const parents = getParents(element, \"_x-template\");\n  const template = parents[parentIndex];\n\n  if (!template) {\n    console.error(\"x-recurse - Parent x-template was not found\");\n\n    return;\n  }\n\n  const templateClone = template.cloneNode(true) as ExtendedHTMLElement;\n  templateClone.setAttribute(\"x-template\", \"\");\n\n  element.appendChild(templateClone);\n\n  // @ts-ignore TODO: Fix the type\n  element.setAttribute(\"x-each\", value);\n\n  // Evaluate against parent since the element itself contains x-each\n  evaluateDirectives(directives, element.parentElement as ExtendedHTMLElement);\n}\n\nexport default recurseDirective;\n","import { BindState, DirectiveParameters } from \"../types\";\n\nfunction promiseDirective({\n  element,\n  expression,\n  evaluate,\n  setState,\n}: DirectiveParameters) {\n  // @ts-ignore TODO: Fix the type\n  const { state } = evaluate(expression, {}, element);\n\n  Promise.all(Object.values(state))\n    .then((values) => {\n      const newState: BindState = {};\n\n      Object.keys(state).forEach((key, i) => {\n        newState[key] = values[i];\n      });\n\n      setState(newState, { element });\n    })\n    .catch((error) => {\n      setState({ error }, { element });\n    });\n}\npromiseDirective.skipEvaluation = true;\n\nexport default promiseDirective;\n","import { BindState, DirectiveParameters, ExtendedHTMLElement } from \"../types\";\n\n// TODO: Communicate somehow this should be evaluated after value directive\n// -> dependency declaration\nfunction scrollDirective({\n  element,\n  expression,\n  evaluate,\n  setState,\n}: DirectiveParameters) {\n  const evaluateValue = () =>\n    // @ts-ignore TODO: Fix the type\n    evaluateScroll(\n      element,\n      // @ts-ignore TODO: Fix the type\n      evaluate(expression, {}, element).state,\n      setState\n    );\n\n  window.addEventListener(\"scroll\", evaluateValue);\n\n  evaluateValue();\n}\n\nfunction evaluateScroll(\n  scrollContainer: ExtendedHTMLElement,\n  scrollState: BindState,\n  setState: DirectiveParameters[\"setState\"]\n) {\n  setState(scrollState, { element: scrollContainer });\n}\n\nexport default scrollDirective;\n","import { getLevel, getTemplates, isObject } from \"../utils\";\nimport type { DirectiveParameters, ExtendedHTMLElement } from \"../types\";\n\nfunction ssrDirective({ element }: DirectiveParameters) {\n  // @ts-ignore TODO: Fix the type\n  element.state = extractValuesFromTemplates(\n    element,\n    getTemplates(element),\n    getLevel(element)\n  );\n\n  // Find the closest state container and update its internal state\n  const parentStateElement: ExtendedHTMLElement | null =\n    element.closest(\"[x-state]\");\n\n  if (parentStateElement) {\n    const expression = element.getAttribute(\"x-each\");\n\n    if (!expression) {\n      console.error(\"x-ssr - adjacent x-each was not found\");\n\n      return;\n    }\n\n    const parentKey = expression.split(\"state.\")[1];\n\n    parentStateElement.state = {\n      ...parentStateElement.state,\n      [parentKey]: element.state,\n    };\n  }\n\n  // Now that the state has been captured, go back to normal flow\n  element.removeAttribute(\"x-ssr\");\n}\nssrDirective.evaluateFrom = \"top\";\n\nfunction extractValuesFromTemplates(\n  element: ExtendedHTMLElement,\n  xTemplates: ExtendedHTMLElement[\"templates\"],\n  level: number\n) {\n  const ret = [];\n\n  if (!xTemplates) {\n    return [];\n  }\n\n  for (let i = 0; i < xTemplates.length; i++) {\n    const xTemplate = xTemplates[i] as ExtendedHTMLElement;\n    const newState = getValues(element, xTemplate);\n    const xEachContainers = xTemplate.querySelectorAll(\"[x-each]\");\n\n    // The element should be a state container itself so that children can\n    // access its data.\n    xTemplate.setAttribute(\"x-state\", \"\");\n\n    for (let j = 0; j < xEachContainers.length; j++) {\n      const xEachContainer = xEachContainers[j] as ExtendedHTMLElement;\n\n      // Pick only elements that have the x-each as their parent.\n      // The gotcha here is that since the element itself is x-each,\n      // closest() matches to itself so you should traverse starting from\n      // the immediate parent.\n      if (xEachContainer.parentElement?.closest(\"[x-each]\") === element) {\n        const xEachValue = xEachContainer.getAttribute(\"x-each\") || \"\";\n        const k = xEachValue.split(\"state.value.\")[1];\n\n        if (k) {\n          const kParts = k.split(\".\");\n          const v = extractValuesFromTemplates(\n            xEachContainer,\n            getTemplates(xEachContainer),\n            level + 1\n          );\n\n          // TODO: Can unpacking be avoided for arrays?\n          // @ts-ignore How to type this?\n          const value = Array.isArray(v) ? v.map((i) => i[0]) : v;\n\n          // @ts-ignore How to type this?\n          set(newState, kParts, value);\n\n          // The actual state is stored to the object\n          xTemplate.state = { value, level };\n        }\n      }\n    }\n\n    ret.push(newState);\n  }\n\n  return ret;\n}\n\nfunction set(o: Record<string, unknown>, keys: string[], value: unknown) {\n  let previousO = o;\n\n  keys.forEach((k, i) => {\n    // Set the value to the last part\n    if (i === keys.length - 1) {\n      previousO[k] = value;\n    } else {\n      // Construct objects if they don't exist yet\n      if (!isObject(o[k])) {\n        o[k] = {};\n      }\n\n      // @ts-ignore Figure out how to type this\n      previousO = o[k];\n    }\n  });\n}\n\nfunction getValues(\n  element: ExtendedHTMLElement,\n  xTemplate: ExtendedHTMLElement\n) {\n  const xValues = xTemplate.hasAttribute(\"x\")\n    ? [xTemplate]\n    : xTemplate.querySelectorAll(\"[x]\");\n  const newObjectState: Record<string, unknown> = {};\n  const newArrayState = [];\n\n  for (let j = 0; j < xValues.length; j++) {\n    const xValue = xValues[j];\n\n    // Pick only elements that have the x-each as their parent\n    if (xValue.closest(\"[x-each]\") === element) {\n      const xProperty = xValue.getAttribute(\"x\") || \"\";\n      const v = xValue.textContent;\n\n      if (xProperty === \"state.value\") {\n        newArrayState.push(v);\n      } else {\n        const k = xProperty.split(\"state.value.\")[1];\n\n        if (k) {\n          newObjectState[k] = v;\n        }\n      }\n    }\n  }\n\n  return newArrayState.length > 0 ? newArrayState : newObjectState;\n}\n\nexport default ssrDirective;\n","import { asyncEvaluate } from \"../async-evaluate\";\nimport { DirectiveParameters } from \"../types\";\n\nasync function valueDirective({\n  element,\n  expression,\n  getState,\n  evaluateDirectives,\n  directives,\n}: DirectiveParameters) {\n  // @ts-ignore TODO: Fix the type\n  const state = await asyncEvaluate(expression, getState(element), element);\n\n  if (element.localName === \"input\") {\n    element.value = state;\n  } else {\n    element.innerHTML = state;\n\n    const firstChild = element.children[0];\n    const closestState = firstChild && firstChild.closest(\"[x-state]\");\n\n    if (closestState) {\n      evaluateDirectives(directives, element);\n    }\n  }\n}\n\nexport default valueDirective;\n","import valueDirective from \"./value\";\nimport { DirectiveParameters, ExtendedHTMLElement } from \"../types\";\n\nfunction stateDirective({\n  element,\n  expression,\n  evaluate,\n  evaluateDirectives,\n  directives,\n  getState,\n}: DirectiveParameters) {\n  // State has to be evaluated regardless for derivations to work.\n  //\n  // x-each is a special case as it maintains state directly. Potentially\n  // this could be changed to break the coupling.\n  if (expression || typeof element.state === \"undefined\") {\n    // @ts-ignore TODO: Fix the type\n    element.state = evaluate(expression, getState(element), element);\n  }\n\n  if (element.observer) {\n    return;\n  }\n\n  element.observer = new MutationObserver((mutations) => {\n    const { target } = mutations[0];\n    // @ts-ignore\n    const hasStateItself = target.hasAttribute(\"x-state\");\n\n    // @ts-ignore\n    const updatedTarget = target.attributes.getNamedItem(\"x-updated\").value;\n    const closestStateContainer = updatedTarget\n      ? (target as ExtendedHTMLElement).closest(`[x-label=\"${updatedTarget}\"]`)\n      : hasStateItself\n      ? target\n      : (target as ExtendedHTMLElement).closest(`[x-state]`);\n\n    if (!closestStateContainer) {\n      console.warn(\"x-state - No state container was found\", updatedTarget);\n      return;\n    }\n\n    // Avoid recursion by not evaluating all directives\n    const directivesWithoutSkipping = directives.filter(\n      ({ directive }) => !directive.skipEvaluation\n    );\n\n    // Handle case where x-state has value as well separately\n    // as evaluateDirectives doesn't evaluate parent itself\n    // to avoid recursion.\n    // @ts-ignore\n    if (hasStateItself && target.hasAttribute(\"x\")) {\n      // @ts-ignore\n      valueDirective({\n        // @ts-ignore\n        element: closestStateContainer,\n        // @ts-ignore\n        expression: closestStateContainer.getAttribute(\"x\"),\n        getState,\n        evaluateDirectives,\n        directives: directivesWithoutSkipping,\n      });\n    } else {\n      // @ts-ignore\n      evaluateDirectives(directivesWithoutSkipping, closestStateContainer);\n    }\n  });\n\n  element.observer.observe(element, {\n    attributeFilter: [\"x-updated\"],\n    attributes: true,\n    subtree: true,\n  });\n}\nstateDirective.evaluateFrom = \"top\";\n\nexport default stateDirective;\n","import getState from \"./get-state\";\nimport setState from \"./set-state\";\nimport evaluateDirectives from \"./evaluate-directives\";\nimport {\n  attributeDirective,\n  cloakDirective,\n  closestDirective,\n  eachDirective,\n  ifDirective,\n  intersectDirective,\n  intervalDirective,\n  promiseDirective,\n  recurseDirective,\n  scrollDirective,\n  ssrDirective,\n  stateDirective,\n  valueDirective,\n} from \"./directives\";\nimport { ExtendedHTMLElement } from \"./types\";\n\ndeclare global {\n  interface Window {\n    evaluateAllDirectives: typeof evaluateAllDirectives;\n    getState: typeof getState;\n    setState: typeof setState;\n  }\n}\n\nfunction evaluateAllDirectives(parent?: ExtendedHTMLElement) {\n  evaluateDirectives(\n    [\n      { name: \"x-state\", directive: stateDirective },\n      { name: \"x-cloak\", directive: cloakDirective },\n      { name: \"x-if\", directive: ifDirective },\n      { name: \"x-ssr\", directive: ssrDirective },\n      { name: \"x-each\", directive: eachDirective },\n      { name: \"x-attr\", directive: attributeDirective },\n      { name: \"x\", directive: valueDirective },\n      { name: \"x-scroll\", directive: scrollDirective },\n      { name: \"x-closest\", directive: closestDirective },\n      { name: \"x-recurse\", directive: recurseDirective },\n      { name: \"x-promise\", directive: promiseDirective },\n      { name: \"x-interval\", directive: intervalDirective },\n      { name: \"x-intersect\", directive: intersectDirective },\n    ],\n    parent\n  );\n}\n\nself.addEventListener(\"load\", () => evaluateAllDirectives());\n\nself.evaluateAllDirectives = evaluateAllDirectives;\nself.getState = getState;\nself.setState = setState;\n"]}