{"version":3,"file":"ractive.min.js","sources":["../src/view/Fragment.js","../src/Ractive/prototype/reset.js","../src/Ractive/prototype/reverse.js","../src/Ractive/prototype/shift.js","../src/Ractive/prototype/sort.js","../src/Ractive/prototype/splice.js","../src/Ractive/prototype/unshift.js","../src/Ractive/prototype.js","../src/Ractive/static/styles.js","../src/extend/_extend.js","../src/Ractive.js","../src/view/items/component/Mapping.js","../src/view/items/element/specials/Option.js","../src/view/items/Partial.js","../src/model/specials/KeyModel.js","../src/view/RepeatedFragment.js","../src/view/items/Section.js","../src/view/items/element/specials/Select.js","../src/view/items/element/specials/Textarea.js","../src/view/items/Text.js","../src/config/visibility.js","../src/view/items/element/transitions/prefix.js","../src/view/items/element/transitions/createTransitions.js","../src/view/items/element/transitions/hyphenate.js","../src/view/items/element/Transition.js","../src/view/items/triple/insertHtml.js","../src/view/items/Triple.js","../src/view/items/createItem.js","../src/view/resolvers/ExpressionProxy.js","../src/view/items/element/Decorator.js","../src/view/items/Doctype.js","../src/view/items/element/binding/Binding.js","../src/view/items/element/binding/CheckboxBinding.js","../src/view/items/element/binding/getBindingGroup.js","../src/view/items/element/binding/CheckboxNameBinding.js","../src/view/items/element/binding/ContentEditableBinding.js","../src/view/items/element/binding/GenericBinding.js","../src/view/items/element/binding/FileBinding.js","../src/view/items/element/binding/MultipleSelectBinding.js","../src/view/items/element/binding/NumericBinding.js","../src/view/items/element/binding/RadioBinding.js","../src/view/items/element/binding/RadioNameBinding.js","../src/view/items/element/binding/SingleSelectBinding.js","../src/view/items/Element.js","../src/view/items/element/specials/Form.js","../src/view/items/element/ElementEvents.js","../src/view/items/component/RactiveEvent.js","../src/view/items/shared/EventDirective.js","../src/view/resolvers/ReferenceExpressionProxy.js","../src/view/items/shared/Mustache.js","../src/view/items/Interpolator.js","../src/view/items/element/specials/Input.js","../src/utils/parseJSON.js","../src/shared/Context.js","../src/Ractive/static/getContext.js","../src/utils/dom.js","../src/config/namespaces.js","../src/Ractive/prototype/observe/Observer.js","../src/Ractive/prototype/observe/Pattern.js","../src/Ractive/prototype/observe/Array.js","../src/Ractive/prototype/observeOnce.js","../src/Ractive/prototype/shared/trim.js","../src/Ractive/prototype/shared/notEmptyString.js","../src/Ractive/prototype/pop.js","../src/Ractive/prototype/push.js","../src/global/css.js","../src/Ractive/config/custom/adapt.js","../src/utils/cleanCss.js","../src/Ractive/config/custom/css/transform.js","../src/model/specials/CSSModel.js","../src/Ractive/config/custom/css/css.js","../src/Ractive/config/custom/data.js","../src/Ractive/config/custom/template.js","../src/Ractive/config/registries.js","../src/Ractive/config/config.js","../src/view/items/shared/Item.js","../src/view/helpers/specialAttrs.js","../src/view/items/element/attribute/getUpdateDelegate.js","../src/view/items/element/attribute/propertyNames.js","../src/view/items/element/ConditionalAttribute.js","../src/view/items/element/Attribute.js","../src/view/items/element/BindingFlag.js","../src/view/items/Comment.js","../src/model/specials/RactiveModel.js","../src/model/RootModel.js","../src/Ractive/construct.js","../src/view/items/Component.js","../src/model/ComputationChild.js","../src/model/Computation.js","../src/utils/log.js","../src/config/errors.js","../src/Ractive/static/interpolators.js","../src/shared/keypaths.js","../src/utils/bind.js","../src/model/ModelBase.js","../src/global/capture.js","../src/model/LinkModel.js","../src/shared/getFunction.js","../src/config/template.js","../src/parse/Parser.js","../src/config/types.js","../src/parse/converters/expressions/readTypeof.js","../src/parse/converters/mustache/readDelimiterChange.js","../src/parse/converters/expressions/primary/literal/readRegexpLiteral.js","../src/utils/escapeRegExp.js","../src/parse/converters/utils/getLowestIndex.js","../src/utils/html.js","../src/parse/converters/expressions/shared/errors.js","../src/parse/converters/expressions/primary/literal/readNumberLiteral.js","../src/parse/converters/expressions/primary/literal/stringLiteral/makeQuotedStringMatcher.js","../src/parse/converters/expressions/primary/literal/readStringLiteral.js","../src/parse/converters/expressions/primary/literal/readTemplateStringLiteral.js","../src/parse/converters/expressions/shared/patterns.js","../src/parse/converters/expressions/shared/readKey.js","../src/parse/converters/expressions/primary/readReference.js","../src/parse/converters/expressions/readLogicalOr.js","../src/parse/converters/element/readAttribute.js","../src/parse/converters/readMustache.js","../src/parse/converters/mustache/readAliases.js","../src/parse/converters/mustache/section/readInlineBlock.js","../src/parse/converters/mustache/handlebarsBlockCodes.js","../src/parse/converters/mustache/readSection.js","../src/parse/converters/readHtmlComment.js","../src/parse/utils/stripStandalones.js","../src/parse/utils/cleanup.js","../src/parse/converters/element/readClosingTag.js","../src/parse/converters/readElement.js","../src/parse/converters/readPartialDefinitionSection.js","../src/Ractive/shared.js","../src/parse/_parse.js","../src/Ractive/config/runtime-parser.js","../src/global/TransitionManager.js","../src/global/runloop.js","../src/shared/Ticker.js","../src/model/helpers/getPrefixer.js","../src/model/Model.js","../src/model/specials/SharedModel.js","../src/shared/getRactiveContext.js","../src/shared/set.js","../src/Ractive/prototype/shared/add.js","../src/Ractive/prototype/animate.js","../src/events/fireEvent.js","../src/events/Hook.js","../src/Ractive/prototype/shared/makeArrayMethod.js","../src/Ractive/prototype/teardown.js","../src/Ractive/helpers/subscribe.js","../src/view/items/shared/directiveArgs.js","../src/view/items/element/binding/handleDomEvent.js","../src/utils/getSelectedOptions.js","../src/view/items/element/binding/selectBinding.js","../src/view/items/shared/progressiveText.js","../src/view/resolvers/resolve.js","../src/view/items/partial/getPartialTemplate.js","../src/view/items/component/getComponentConstructor.js","../src/view/items/asyncProxy.js","../src/view/items/Await.js","../src/view/helpers/processItems.js","../src/Ractive/initialise.js","../src/Ractive/render.js","../src/Ractive/prototype/render.js","../src/Ractive/prototype/resetPartial.js","../src/Ractive/prototype/resetTemplate.js","../src/Ractive/prototype/set.js","../src/Ractive/prototype/subtract.js","../src/Ractive/prototype/toggle.js","../src/Ractive/prototype/toCSS.js","../src/Ractive/prototype/toHTML.js","../src/Ractive/prototype/toText.js","../src/Ractive/prototype/transition.js","../src/Ractive/prototype/unlink.js","../src/Ractive/prototype/unrender.js","../src/Ractive/prototype/updateModel.js","../src/Ractive/prototype/use.js","../src/Ractive/static/isInstance.js","../src/Ractive/static/styleGet.js","../src/Ractive/static/sharedSet.js","../src/Ractive/static/sharedGet.js","../src/Ractive/static/use.js","../src/extend/_macro.js","../src/Ractive/static/findPlugin.js","../src/polyfills/Object.assign.js","../src/utils/object.js","../src/utils/is.js","../src/polyfills/performance.now.js","../src/polyfills/array.find.js","../src/polyfills/node.contains.js","../src/config/environment.js","../src/polyfills/Promise.js","../src/polyfills/requestAnimationFrame.js","../src/Ractive/config/defaults.js","../src/Ractive/static/easing.js","../src/view/resolvers/resolveReference.js","../src/Ractive/prototype/add.js","../src/events/eventStack.js","../src/shared/anchors.js","../src/Ractive/prototype/attachChild.js","../src/Ractive/prototype/compute.js","../src/Ractive/prototype/detach.js","../src/Ractive/prototype/detachChild.js","../src/Ractive/prototype/find.js","../src/Ractive/prototype/findAll.js","../src/Ractive/prototype/findAllComponents.js","../src/Ractive/prototype/findComponent.js","../src/Ractive/prototype/findContainer.js","../src/Ractive/prototype/findParent.js","../src/view/items/shared/findElement.js","../src/shared/getNewIndices.js","../src/Ractive/prototype/update.js","../src/Ractive/prototype/fire.js","../src/Ractive/prototype/get.js","../src/Ractive/prototype/getLocalContext.js","../src/Ractive/prototype/getContext.js","../src/Ractive/prototype/insert.js","../src/Ractive/prototype/link.js","../src/Ractive/static/keypaths.js","../src/Ractive/prototype/observe.js","../src/Ractive/prototype/off.js","../src/Ractive/prototype/on.js","../src/Ractive/prototype/once.js","../src/Ractive/prototype/readLink.js","../src/utils/id.js","../src/Ractive/static/styleSet.js","../src/Ractive/config/wrapPrototypeMethod.js","../src/Ractive/config/deprecate.js","../src/utils/noop.js","../src/shared/registry.js","../src/shared/interpolate.js","../src/utils/array.js","../src/shared/methodCallers.js","../src/shared/rebind.js","../src/parse/utils/createFunction.js","../src/parse/converters/expressions/primary/literal/readBooleanLiteral.js","../src/parse/converters/expressions/primary/literal/objectLiteral/keyValuePair.js","../src/parse/converters/expressions/primary/literal/objectLiteral/keyValuePairs.js","../src/parse/converters/expressions/primary/literal/readObjectLiteral.js","../src/parse/converters/expressions/primary/literal/readArrayLiteral.js","../src/parse/converters/expressions/primary/readLiteral.js","../src/parse/converters/expressions/primary/readBracketedExpression.js","../src/parse/converters/expressions/readPrimary.js","../src/parse/converters/expressions/shared/readRefinement.js","../src/parse/converters/expressions/readMemberOrInvocation.js","../src/parse/converters/expressions/readConditional.js","../src/parse/converters/readExpression.js","../src/parse/converters/expressions/shared/readExpressionList.js","../src/parse/converters/readExpressionOrReference.js","../src/parse/utils/flattenExpression.js","../src/parse/utils/refineExpression.js","../src/parse/converters/mustache/readTriple.js","../src/parse/converters/mustache/readUnescaped.js","../src/parse/converters/mustache/readPartial.js","../src/parse/converters/mustache/readMustacheComment.js","../src/parse/converters/mustache/readInterpolator.js","../src/parse/converters/mustache/section/readClosing.js","../src/parse/utils/trimWhitespace.js","../src/utils/hyphenateCamel.js","../src/parse/converters/readText.js","../src/parse/converters/readTemplate.js","../src/parse/utils/insertExpressions.js","../src/Ractive/helpers/getComputationSignature.js"],"sourcesContent":["import { ELEMENT, YIELDER } from 'config/types';\nimport runloop from 'src/global/runloop';\nimport { findMap } from 'utils/array';\nimport { getContext, findParentWithContext } from 'shared/getRactiveContext';\nimport { shuffled, toEscapedString, toString } from 'shared/methodCallers';\nimport createItem from './items/createItem';\nimport processItems from './helpers/processItems';\nimport parseJSON from 'utils/parseJSON';\nimport { createDocumentFragment } from 'utils/dom';\nimport KeyModel from 'src/model/specials/KeyModel';\nimport resolve from './resolvers/resolve';\n\nfunction resolveAliases(aliases, fragment, dest = {}) {\n for (let i = 0; i < aliases.length; i++) {\n if (!dest[aliases[i].n]) {\n const m = resolve(fragment, aliases[i].x);\n dest[aliases[i].n] = m;\n m.reference();\n }\n }\n\n return dest;\n}\n\nexport default class Fragment {\n constructor(options) {\n this.owner = options.owner; // The item that owns this fragment - an element, section, partial, or attribute\n\n this.isRoot = !options.owner.up;\n this.parent = this.isRoot ? null : this.owner.up;\n this.ractive = options.ractive || (this.isRoot ? options.owner : this.parent.ractive);\n\n this.componentParent =\n this.isRoot && this.ractive.component\n ? this.ractive.component.up\n : this.owner.containerFragment || null;\n if (!this.isRoot || this.ractive.delegate) {\n this.delegate = this.owner.containerFragment\n ? this.owner.containerFragment && this.owner.containerFragment.delegate\n : (this.componentParent && this.componentParent.delegate) ||\n (this.parent && this.parent.delegate);\n } else {\n this.delegate = false;\n }\n\n this.context = null;\n this.rendered = false;\n\n // encapsulated styles should be inherited until they get applied by an element\n if ('cssIds' in options) {\n this.cssIds = options.cssIds && options.cssIds.length && options.cssIds;\n } else {\n this.cssIds = this.parent ? this.parent.cssIds : null;\n }\n\n this.dirty = false;\n this.dirtyValue = true; // used for attribute values\n\n this.template = options.template || [];\n this.createItems();\n }\n\n bind(context) {\n this.context = context;\n\n if (this.owner.template.z) {\n this.aliases = resolveAliases(\n this.owner.template.z,\n this.owner.containerFragment || this.parent\n );\n }\n\n const len = this.items.length;\n for (let i = 0; i < len; i++) this.items[i].bind();\n this.bound = true;\n\n // in rare cases, a forced resolution (or similar) will cause the\n // fragment to be dirty before it's even finished binding. In those\n // cases we update immediately\n if (this.dirty) this.update();\n\n return this;\n }\n\n bubble() {\n this.dirtyValue = true;\n\n if (!this.dirty) {\n this.dirty = true;\n\n if (this.isRoot) {\n // TODO encapsulate 'is component root, but not overall root' check?\n if (this.ractive.component) {\n this.ractive.component.bubble();\n } else if (this.bound) {\n runloop.addFragment(this);\n }\n } else {\n this.owner.bubble(this.index);\n }\n }\n }\n\n createItems() {\n // this is a hot code path\n const max = this.template.length;\n this.items = [];\n for (let i = 0; i < max; i++) {\n this.items[i] = createItem({\n up: this,\n template: this.template[i],\n index: i\n });\n }\n }\n\n destroyed() {\n const len = this.items.length;\n for (let i = 0; i < len; i++) this.items[i].destroyed();\n if (this.pathModel) this.pathModel.destroyed();\n if (this.rootModel) this.rootModel.destroyed();\n }\n\n detach() {\n const docFrag = createDocumentFragment();\n const xs = this.items;\n const len = xs.length;\n for (let i = 0; i < len; i++) {\n docFrag.appendChild(xs[i].detach());\n }\n return docFrag;\n }\n\n find(selector, options) {\n return findMap(this.items, i => i.find(selector, options));\n }\n\n findAll(selector, options) {\n if (this.items) {\n this.items.forEach(i => i.findAll && i.findAll(selector, options));\n }\n }\n\n findComponent(name, options) {\n return findMap(this.items, i => i.findComponent(name, options));\n }\n\n findAllComponents(name, options) {\n if (this.items) {\n this.items.forEach(i => i.findAllComponents && i.findAllComponents(name, options));\n }\n }\n\n findContext() {\n const base = findParentWithContext(this);\n if (!base || !base.context) return this.ractive.viewmodel;\n else return base.context;\n }\n\n findNextNode(item) {\n // search for the next node going forward\n if (item) {\n let it;\n for (let i = item.index + 1; i < this.items.length; i++) {\n it = this.items[i];\n if (!it || !it.firstNode) continue;\n\n const node = it.firstNode(true);\n if (node) return node;\n }\n }\n\n // if this is the root fragment, and there are no more items,\n // it means we're at the end...\n if (this.isRoot) {\n if (this.ractive.component) {\n return this.ractive.component.up.findNextNode(this.ractive.component);\n }\n\n // TODO possible edge case with other content\n // appended to this.ractive.el?\n return null;\n }\n\n if (this.parent) return this.owner.findNextNode(this); // the argument is in case the parent is a RepeatedFragment\n }\n\n findParentNode() {\n let fragment = this;\n\n do {\n if (fragment.owner.type === ELEMENT) {\n return fragment.owner.node;\n }\n\n if (fragment.isRoot && !fragment.ractive.component) {\n // TODO encapsulate check\n return fragment.ractive.el;\n }\n\n if (fragment.owner.type === YIELDER) {\n fragment = fragment.owner.containerFragment;\n } else {\n fragment = fragment.componentParent || fragment.parent; // TODO ugh\n }\n } while (fragment);\n\n throw new Error('Could not find parent node'); // TODO link to issue tracker\n }\n\n firstNode(skipParent) {\n const node = findMap(this.items, i => i.firstNode(true));\n if (node) return node;\n if (skipParent) return null;\n\n return this.parent.findNextNode(this.owner);\n }\n\n getKey() {\n return this.keyModel || (this.keyModel = new KeyModel(this.key));\n }\n\n getIndex() {\n return this.idxModel || (this.idxModel = new KeyModel(this.index));\n }\n\n rebind(next) {\n this.context = next;\n if (this.rootModel) this.rootModel.context = this.context;\n if (this.pathModel) this.pathModel.context = this.context;\n }\n\n rebound(update) {\n if (this.owner.template.z) {\n const aliases = this.aliases;\n for (const k in aliases) {\n if (aliases[k].rebound) aliases[k].rebound(update);\n else {\n aliases[k].unreference();\n aliases[k] = 0;\n }\n }\n\n resolveAliases(this.owner.template.z, this.owner.containerFragment || this.parent, aliases);\n }\n\n this.items.forEach(x => x.rebound(update));\n if (update) {\n if (this.rootModel) this.rootModel.applyValue(this.context.getKeypath(this.ractive.root));\n if (this.pathModel) this.pathModel.applyValue(this.context.getKeypath());\n }\n }\n\n render(target, occupants) {\n if (this.rendered) throw new Error('Fragment is already rendered!');\n this.rendered = true;\n\n const xs = this.items;\n const len = xs.length;\n for (let i = 0; i < len; i++) {\n xs[i].render(target, occupants);\n }\n }\n\n resetTemplate(template) {\n const wasBound = this.bound;\n const wasRendered = this.rendered;\n\n // TODO ensure transitions are disabled globally during reset\n\n if (wasBound) {\n if (wasRendered) this.unrender(true);\n this.unbind();\n }\n\n this.template = template;\n this.createItems();\n\n if (wasBound) {\n this.bind(this.context);\n\n if (wasRendered) {\n const parentNode = this.findParentNode();\n const anchor = this.findNextNode();\n\n if (anchor) {\n const docFrag = createDocumentFragment();\n this.render(docFrag);\n parentNode.insertBefore(docFrag, anchor);\n } else {\n this.render(parentNode);\n }\n }\n }\n }\n\n shuffled() {\n this.items.forEach(shuffled);\n if (this.rootModel) this.rootModel.applyValue(this.context.getKeypath(this.ractive.root));\n if (this.pathModel) this.pathModel.applyValue(this.context.getKeypath());\n }\n\n toString(escape) {\n return this.items.map(escape ? toEscapedString : toString).join('');\n }\n\n unbind(view) {\n if (this.owner.template.z && !this.owner.yielder) {\n for (const k in this.aliases) {\n this.aliases[k].unreference();\n }\n\n this.aliases = {};\n }\n\n this.context = null;\n const len = this.items.length;\n for (let i = 0; i < len; i++) this.items[i].unbind(view);\n this.bound = false;\n\n return this;\n }\n\n unrender(shouldDestroy) {\n const len = this.items.length;\n for (let i = 0; i < len; i++) this.items[i].unrender(shouldDestroy);\n this.rendered = false;\n }\n\n update() {\n if (this.dirty) {\n if (!this.updating) {\n this.dirty = false;\n this.updating = true;\n const len = this.items.length;\n for (let i = 0; i < len; i++) this.items[i].update();\n this.updating = false;\n } else if (this.isRoot) {\n runloop.addFragmentToRoot(this);\n }\n }\n }\n\n valueOf() {\n if (this.items.length === 1) {\n return this.items[0].valueOf();\n }\n\n if (this.dirtyValue) {\n const values = {};\n const source = processItems(this.items, values, this.ractive._guid);\n const parsed = parseJSON(source, values);\n\n this.value = parsed ? parsed.value : this.toString();\n\n this.dirtyValue = false;\n }\n\n return this.value;\n }\n}\nFragment.prototype.getContext = getContext;\nFragment.prototype.getKeypath = getKeypath;\n\nexport function getKeypath(root) {\n const base = findParentWithContext(this);\n let model;\n if (root) {\n if (!this.rootModel) {\n this.rootModel = new KeyModel(\n this.context.getKeypath(this.ractive.root),\n this.context,\n this.ractive.root\n );\n model = this.rootModel;\n } else return this.rootModel;\n } else {\n if (!this.pathModel) {\n this.pathModel = new KeyModel(this.context.getKeypath(), this.context);\n model = this.pathModel;\n } else return this.pathModel;\n }\n\n if (base && base.context) base.getKeypath(root).registerChild(model);\n\n return model;\n}\n","import runloop from 'src/global/runloop';\nimport config from '../config/config';\nimport hooks from '../../events/Hook';\nimport dataConfigurator from '../config/custom/data';\nimport { isObjectType } from 'utils/is';\n\nconst shouldRerender = ['template', 'partials', 'components', 'decorators', 'events'];\n\nexport default function Ractive$reset(data) {\n data = data || {};\n\n if (!isObjectType(data)) {\n throw new Error('The reset method takes either no arguments, or an object containing new data');\n }\n\n // TEMP need to tidy this up\n data = dataConfigurator.init(this.constructor, this, { data });\n\n const promise = runloop.start();\n\n // If the root object is wrapped, try and use the wrapper's reset value\n const wrapper = this.viewmodel.wrapper;\n if (wrapper && wrapper.reset) {\n if (wrapper.reset(data) === false) {\n // reset was rejected, we need to replace the object\n this.viewmodel.set(data);\n }\n } else {\n this.viewmodel.set(data);\n }\n\n // reset config items and track if need to rerender\n const changes = config.reset(this);\n let rerender;\n\n let i = changes.length;\n while (i--) {\n if (shouldRerender.indexOf(changes[i]) > -1) {\n rerender = true;\n break;\n }\n }\n\n if (rerender) {\n hooks.unrender.fire(this);\n this.fragment.resetTemplate(this.template);\n hooks.render.fire(this);\n hooks.complete.fire(this);\n }\n\n runloop.end();\n\n hooks.reset.fire(this, data);\n\n return promise;\n}\n","import makeArrayMethod from './shared/makeArrayMethod';\nexport default makeArrayMethod('reverse').path;\n","import makeArrayMethod from './shared/makeArrayMethod';\nexport default makeArrayMethod('shift').path;\n","import makeArrayMethod from './shared/makeArrayMethod';\nexport default makeArrayMethod('sort').path;\n","import makeArrayMethod from './shared/makeArrayMethod';\nexport default makeArrayMethod('splice').path;\n","import makeArrayMethod from './shared/makeArrayMethod';\nexport default makeArrayMethod('unshift').path;\n","import add from './prototype/add';\nimport animate from './prototype/animate';\nimport attachChild from './prototype/attachChild';\nimport compute from './prototype/compute';\nimport detach from './prototype/detach';\nimport detachChild from './prototype/detachChild';\nimport find from './prototype/find';\nimport findAll from './prototype/findAll';\nimport findAllComponents from './prototype/findAllComponents';\nimport findComponent from './prototype/findComponent';\nimport findContainer from './prototype/findContainer';\nimport findParent from './prototype/findParent';\nimport fire from './prototype/fire';\nimport get from './prototype/get';\nimport getLocalContext from './prototype/getLocalContext';\nimport getContext from './prototype/getContext';\nimport insert from './prototype/insert';\nimport link from './prototype/link';\nimport observe from './prototype/observe';\nimport observeOnce from './prototype/observeOnce';\nimport off from './prototype/off';\nimport on from './prototype/on';\nimport once from './prototype/once';\nimport pop from './prototype/pop';\nimport push from './prototype/push';\nimport readLink from './prototype/readLink';\nimport render from './prototype/render';\nimport reset from './prototype/reset';\nimport resetPartial from './prototype/resetPartial';\nimport resetTemplate from './prototype/resetTemplate';\nimport reverse from './prototype/reverse';\nimport set from './prototype/set';\nimport shift from './prototype/shift';\nimport sort from './prototype/sort';\nimport splice from './prototype/splice';\nimport subtract from './prototype/subtract';\nimport teardown from './prototype/teardown';\nimport toggle from './prototype/toggle';\nimport toCSS from './prototype/toCSS';\nimport toHTML from './prototype/toHTML';\nimport toText from './prototype/toText';\nimport transition from './prototype/transition';\nimport unlink from './prototype/unlink';\nimport unrender from './prototype/unrender';\nimport unshift from './prototype/unshift';\nimport update from './prototype/update';\nimport updateModel from './prototype/updateModel';\nimport use from './prototype/use';\n\nconst proto = {\n add,\n animate,\n attachChild,\n compute,\n detach,\n detachChild,\n find,\n findAll,\n findAllComponents,\n findComponent,\n findContainer,\n findParent,\n fire,\n get,\n getLocalContext,\n getContext,\n insert,\n link,\n observe,\n observeOnce,\n off,\n on,\n once,\n pop,\n push,\n readLink,\n render,\n reset,\n resetPartial,\n resetTemplate,\n reverse,\n set,\n shift,\n sort,\n splice,\n subtract,\n teardown,\n toggle,\n toCSS,\n toCss: toCSS,\n toHTML,\n toHtml: toHTML,\n toText,\n transition,\n unlink,\n unrender,\n unshift,\n update,\n updateModel,\n use\n};\n\nexport default proto;\n","import { isFunction } from 'utils/is';\nimport { addCSS, applyCSS } from 'src/global/css';\nimport { recomputeCSS } from './styleSet';\n\nconst styles = [];\n\nexport function addStyle(id, css) {\n if (styles.find(s => s.id === id))\n throw new Error(`Extra styles with the id '${id}' have already been added.`);\n styles.push({ id, css });\n\n if (!this.css) {\n Object.defineProperty(this, 'css', { configurable: false, writable: false, value: buildCSS });\n }\n\n if (!this._cssDef) {\n Object.defineProperty(this, '_cssDef', {\n configurable: true,\n writable: false,\n value: {\n transform: false,\n id: 'Ractive.addStyle'\n }\n });\n\n addCSS(this._cssDef);\n }\n\n recomputeCSS(this);\n applyCSS(true);\n}\n\nfunction buildCSS(data) {\n return styles\n .map(s => `\\n/* ---- extra style ${s.id} */\\n` + (isFunction(s.css) ? s.css(data) : s.css))\n .join('');\n}\n\nexport function hasStyle(id) {\n return !!styles.find(s => s.id === id);\n}\n","import config from '../Ractive/config/config';\nimport dataConfigurator from '../Ractive/config/custom/data';\nimport construct from '../Ractive/construct';\nimport initialise from '../Ractive/initialise';\nimport Ractive from '../Ractive';\nimport isInstance from '../Ractive/static/isInstance';\nimport styleSet from '../Ractive/static/styleSet';\nimport styleGet from '../Ractive/static/styleGet';\nimport { addStyle, hasStyle } from '../Ractive/static/styles';\nimport sharedSet from '../Ractive/static/sharedSet';\nimport sharedGet from '../Ractive/static/sharedGet';\nimport use from '../Ractive/static/use';\nimport { create, defineProperties, toPairs, defineProperty } from 'utils/object';\nimport { isArray, isFunction } from 'utils/is';\n\nconst callsSuper = /super\\s*\\(|\\.call\\s*\\(\\s*this/;\n\nexport function extend(...options) {\n if (!options.length) {\n return extendOne(this);\n } else {\n return options.reduce(extendOne, this);\n }\n}\n\nexport function extendWith(Class, options = {}) {\n return extendOne(this, options, Class);\n}\n\nfunction extendOne(Parent, options = {}, Target) {\n let proto;\n let Child = isFunction(Target) && Target;\n\n if (options.prototype instanceof Ractive) {\n throw new Error(`Ractive no longer supports multiple inheritance.`);\n }\n\n if (Child) {\n if (!(Child.prototype instanceof Parent)) {\n throw new Error(\n `Only classes that inherit the appropriate prototype may be used with extend`\n );\n }\n if (!callsSuper.test(Child.toString())) {\n throw new Error(`Only classes that call super in their constructor may be used with extend`);\n }\n\n proto = Child.prototype;\n } else {\n Child = function(options) {\n if (!(this instanceof Child)) return new Child(options);\n if (options && options.component === true) return;\n\n construct(this, options || {});\n initialise(this, options || {}, {});\n };\n\n proto = create(Parent.prototype);\n proto.constructor = Child;\n\n Child.prototype = proto;\n }\n\n // Static properties\n defineProperties(Child, {\n // alias prototype as defaults\n defaults: { value: proto },\n\n extend: { value: extend, writable: true, configurable: true },\n extendWith: { value: extendWith, writable: true, configurable: true },\n extensions: { value: [] },\n use: { value: use },\n\n isInstance: { value: isInstance },\n\n Parent: { value: Parent },\n Ractive: { value: Ractive },\n\n styleGet: { value: styleGet.bind(Child), configurable: true },\n styleSet: { value: styleSet.bind(Child), configurable: true }\n });\n\n // extend configuration\n config.extend(Parent, proto, options, Child);\n\n // store event and observer registries on the constructor when extending\n Child._on = (Parent._on || []).concat(toPairs(options.on));\n Child._observe = (Parent._observe || []).concat(toPairs(options.observe));\n\n Parent.extensions.push(Child);\n\n // attribute defs are not inherited, but they need to be stored\n if (options.attributes) {\n let attrs;\n\n // allow an array of optional props or an object with arrays for optional and required props\n if (isArray(options.attributes)) {\n attrs = { optional: options.attributes, required: [] };\n } else {\n attrs = options.attributes;\n }\n\n // make sure the requisite keys actually store arrays\n if (!isArray(attrs.required)) attrs.required = [];\n if (!isArray(attrs.optional)) attrs.optional = [];\n\n Child.attributes = attrs;\n }\n\n dataConfigurator.extend(Parent, proto, options, Child);\n\n defineProperty(Child, 'helpers', { writable: true, value: proto.helpers });\n\n if (isArray(options.use)) Child.use.apply(Child, options.use);\n\n return Child;\n}\n\ndefineProperties(Ractive, {\n sharedGet: { value: sharedGet },\n sharedSet: { value: sharedSet },\n styleGet: { configurable: true, value: styleGet.bind(Ractive) },\n styleSet: { configurable: true, value: styleSet.bind(Ractive) },\n addCSS: { configurable: false, value: addStyle.bind(Ractive) },\n hasCSS: { configurable: false, value: hasStyle.bind(Ractive) }\n});\n","import './polyfills/Object.assign';\nimport './polyfills/array.find';\nimport './polyfills/node.contains';\nimport './polyfills/performance.now';\nimport './polyfills/Promise';\nimport './polyfills/requestAnimationFrame';\n\nimport defaults from './Ractive/config/defaults';\nimport easing from './Ractive/static/easing';\nimport interpolators from './Ractive/static/interpolators';\nimport { svg, win } from './config/environment';\nimport proto from './Ractive/prototype';\nimport { extend, extendWith } from './extend/_extend';\nimport macro from './extend/_macro';\nimport parse from './parse/_parse';\nimport getContext from './Ractive/static/getContext';\nimport isInstance from './Ractive/static/isInstance';\nimport use from './Ractive/static/use';\nimport construct from './Ractive/construct';\nimport initialise from './Ractive/initialise';\nimport { getCSS, splitTag } from './global/css';\nimport { escapeKey, unescapeKey, normalise } from './shared/keypaths';\nimport { joinKeys, splitKeypath } from './Ractive/static/keypaths';\nimport shared from './Ractive/shared';\nimport { findPlugin } from './Ractive/static/findPlugin';\nimport parseJSON from './utils/parseJSON';\nimport CSSModel from './model/specials/CSSModel';\nimport { data as sharedData } from './model/specials/SharedModel';\nimport { extern } from './shared/getRactiveContext';\nimport { warn } from 'utils/log';\n\nimport { batch } from './global/runloop';\n\nimport { assign, defineProperty, defineProperties } from 'utils/object';\n\nexport default function Ractive(options) {\n if (!(this instanceof Ractive)) return new Ractive(options);\n if (options && options.component) return;\n\n construct(this, options || {});\n initialise(this, options || {}, {});\n}\n\n// check to see if we're being asked to force Ractive as a global for some weird environments\nif (win && !win.Ractive) {\n let opts = '';\n const script =\n document.currentScript ||\n /* istanbul ignore next */ document.querySelector('script[data-ractive-options]');\n\n if (script) opts = script.getAttribute('data-ractive-options') || '';\n\n /* istanbul ignore next */\n if (~opts.indexOf('ForceGlobal')) win.Ractive = Ractive;\n} else if (win) {\n warn(`Ractive already appears to be loaded while loading BUILD_PLACEHOLDER_VERSION.`);\n}\n\nassign(Ractive.prototype, proto, defaults);\nRactive.prototype.constructor = Ractive;\n\n// alias prototype as `defaults`\nRactive.defaults = Ractive.prototype;\n\n// share defaults with the parser\nshared.defaults = Ractive.defaults;\nshared.Ractive = Ractive;\n\n// static properties\ndefineProperties(Ractive, {\n // debug flag\n DEBUG: { writable: true, value: true },\n DEBUG_PROMISES: { writable: true, value: true },\n\n // static methods:\n extend: { value: extend },\n extendWith: { value: extendWith },\n escapeKey: { value: escapeKey },\n evalObjectString: { value: parseJSON },\n findPlugin: { value: findPlugin },\n getContext: { value: getContext },\n getCSS: { value: getCSS },\n isInstance: { value: isInstance },\n joinKeys: { value: joinKeys },\n macro: { value: macro },\n normaliseKeypath: { value: normalise },\n parse: { value: parse },\n splitKeypath: { value: splitKeypath },\n // sharedSet and styleSet are in _extend because circular refs\n unescapeKey: { value: unescapeKey },\n use: { value: use },\n\n // support\n enhance: { writable: true, value: false },\n svg: { value: svg },\n tick: {\n get() {\n return batch && batch.promise;\n }\n },\n\n // version\n VERSION: { value: 'BUILD_PLACEHOLDER_VERSION' },\n\n // plugins\n adaptors: { writable: true, value: {} },\n components: { writable: true, value: {} },\n decorators: { writable: true, value: {} },\n easing: { writable: true, value: easing },\n events: { writable: true, value: {} },\n extensions: { value: [] },\n helpers: { writable: true, value: defaults.helpers },\n interpolators: { writable: true, value: interpolators },\n partials: { writable: true, value: {} },\n transitions: { writable: true, value: {} },\n\n // CSS variables\n cssData: { configurable: true, value: {} },\n perComponentStyleElements: { get: splitTag, set: splitTag },\n\n // access to @shared without an instance\n sharedData: { value: sharedData },\n\n // for getting the source Ractive lib from a constructor\n Ractive: { value: Ractive },\n\n // to allow extending contexts\n Context: { value: extern.Context.prototype }\n});\n\n// cssData must already be in place\ndefineProperty(Ractive, '_cssModel', {\n configurable: true,\n value: new CSSModel(Ractive)\n});\n\ndefineProperty(Ractive.prototype, 'rendered', {\n get() {\n return this.fragment && this.fragment.rendered;\n }\n});\n","import { INTERPOLATOR } from '../../../config/types';\nimport Item from '../shared/Item';\nimport Fragment from '../../Fragment';\nimport findElement from '../shared/findElement';\nimport parseJSON from '../../../utils/parseJSON';\nimport resolve from '../../resolvers/resolve';\nimport runloop from '../../../global/runloop';\nimport { warnIfDebug } from 'utils/log';\nimport { splitKeypath } from 'shared/keypaths';\nimport { isArray, isObjectType, isString, isUndefined } from 'utils/is';\n\nexport default class Mapping extends Item {\n constructor(options) {\n super(options);\n\n this.name = options.template.n;\n\n this.owner = options.owner || options.up.owner || options.element || findElement(options.up);\n this.element =\n options.element || (this.owner.attributeByName ? this.owner : findElement(options.up));\n this.up = this.element.up; // shared\n this.ractive = this.up.ractive;\n\n this.element.attributeByName[this.name] = this;\n\n this.value = options.template.f;\n }\n\n bind() {\n const template = this.template.f;\n const viewmodel = this.element.instance.viewmodel;\n\n if (template === 0) {\n // empty attributes are `true`\n viewmodel.joinKey(this.name).set(true);\n } else if (isString(template)) {\n const parsed = parseJSON(template);\n viewmodel.joinKey(this.name).set(parsed ? parsed.value : template);\n } else if (isArray(template)) {\n createMapping(this, true);\n }\n }\n\n rebound(update) {\n if (this.boundFragment) this.boundFragment.rebound(update);\n if (this.link) {\n this.model = resolve(this.up, this.template.f[0]);\n const model = this.element.instance.viewmodel.joinAll(splitKeypath(this.name));\n model.link(this.model, this.name, { mapping: true });\n }\n }\n\n render() {}\n\n unbind(view) {\n if (this.model) this.model.unregister(this);\n if (this.boundFragment) this.boundFragment.unbind(view);\n\n if (this.element.bound) {\n if (this.link.target === this.model) this.link.owner.unlink();\n }\n }\n\n unrender() {}\n\n update() {\n if (this.dirty) {\n this.dirty = false;\n if (this.boundFragment) this.boundFragment.update();\n }\n }\n}\n\nfunction createMapping(item) {\n const template = item.template.f;\n const viewmodel = item.element.instance.viewmodel;\n const childData = viewmodel.value;\n\n if (template.length === 1 && template[0].t === INTERPOLATOR) {\n const model = resolve(item.up, template[0]);\n const val = model.get(false);\n\n // if the interpolator is not static\n if (!template[0].s) {\n item.model = model;\n item.link = viewmodel.createLink(item.name, model, template[0].r, {\n mapping: true\n });\n\n // initialize parent side of the mapping from child data\n if (isUndefined(val) && !model.isReadonly && item.name in childData) {\n model.set(childData[item.name]);\n }\n } else if (!isObjectType(val) || template[0].x) {\n // copy non-object, non-computed vals through\n viewmodel.joinKey(splitKeypath(item.name)).set(val);\n } else {\n // warn about trying to copy an object\n warnIfDebug(`Cannot copy non-computed object value from static mapping '${item.name}'`);\n }\n\n // if the item isn't going to manage the model, give it a change to tear down if it's computed\n if (model !== item.model) model.unregister();\n } else {\n item.boundFragment = new Fragment({\n owner: item,\n template\n }).bind();\n\n item.model = viewmodel.joinKey(splitKeypath(item.name));\n item.model.set(item.boundFragment.valueOf());\n\n // item is a *bit* of a hack\n item.boundFragment.bubble = () => {\n Fragment.prototype.bubble.call(item.boundFragment);\n // defer this to avoid mucking around model deps if there happens to be an expression involved\n runloop.scheduleTask(() => {\n item.boundFragment.update();\n item.model.set(item.boundFragment.valueOf());\n });\n };\n }\n}\n","import { removeFromArray } from 'utils/array';\nimport Element from '../../Element';\nimport findElement from '../../shared/findElement';\nimport { isArray, isUndefined } from 'utils/is';\n\nexport default class Option extends Element {\n constructor(options) {\n const template = options.template;\n if (!template.a) template.a = {};\n\n // If the value attribute is missing, use the element's content,\n // as long as it isn't disabled\n if (isUndefined(template.a.value) && !('disabled' in template.a)) {\n template.a.value = template.f || '';\n }\n\n super(options);\n\n this.select = findElement(this.parent || this.up, false, 'select');\n }\n\n bind() {\n if (!this.select) {\n super.bind();\n return;\n }\n\n // If the select has a value, it overrides the `selected` attribute on\n // this option - so we delete the attribute\n const selectedAttribute = this.attributeByName.selected;\n if (selectedAttribute && this.select.getAttribute('value') !== undefined) {\n const index = this.attributes.indexOf(selectedAttribute);\n this.attributes.splice(index, 1);\n delete this.attributeByName.selected;\n }\n\n super.bind();\n this.select.options.push(this);\n }\n\n bubble() {\n // if we're using content as value, may need to update here\n const value = this.getAttribute('value');\n if (this.node && this.node.value !== value) {\n this.node._ractive.value = value;\n }\n super.bubble();\n }\n\n getAttribute(name) {\n const attribute = this.attributeByName[name];\n return attribute\n ? attribute.getValue()\n : name === 'value' && this.fragment\n ? this.fragment.valueOf()\n : undefined;\n }\n\n isSelected() {\n const optionValue = this.getAttribute('value');\n\n if (isUndefined(optionValue) || !this.select) {\n return false;\n }\n\n const selectValue = this.select.getAttribute('value');\n\n if (this.select.compare(selectValue, optionValue)) {\n return true;\n }\n\n if (this.select.getAttribute('multiple') && isArray(selectValue)) {\n let i = selectValue.length;\n while (i--) {\n if (this.select.compare(selectValue[i], optionValue)) {\n return true;\n }\n }\n }\n }\n\n render(target, occupants) {\n super.render(target, occupants);\n\n if (!this.attributeByName.value) {\n this.node._ractive.value = this.getAttribute('value');\n }\n }\n\n unbind(view) {\n super.unbind(view);\n\n if (this.select) {\n removeFromArray(this.select.options, this);\n }\n }\n}\n","import { ELEMENT, PARTIAL, SECTION, SECTION_WITH, YIELDER } from 'config/types';\nimport { assign, create, hasOwn, keys } from 'utils/object';\nimport { isArray, isFunction, isObjectType, isString } from 'utils/is';\nimport noop from 'utils/noop';\nimport { MustacheContainer } from './shared/Mustache';\nimport Fragment from '../Fragment';\nimport getPartialTemplate from './partial/getPartialTemplate';\nimport { warnOnceIfDebug, warnIfDebug } from 'utils/log';\nimport parser from 'src/Ractive/config/runtime-parser';\nimport runloop from 'src/global/runloop';\nimport { applyCSS } from 'src/global/css';\nimport { splitKeypath } from 'shared/keypaths';\n\nexport default function Partial(options) {\n MustacheContainer.call(this, options);\n\n const tpl = options.template;\n\n // yielder is a special form of partial that will later require special handling\n if (tpl.t === YIELDER) {\n this.yielder = 1;\n } else if (tpl.t === ELEMENT) {\n // this is a macro partial, complete with macro constructor\n // leaving this as an element will confuse up-template searches\n this.type = PARTIAL;\n this.macro = options.macro;\n }\n}\n\nconst proto = (Partial.prototype = create(MustacheContainer.prototype));\n\nassign(proto, {\n constructor: Partial,\n\n bind() {\n const template = this.template;\n\n if (this.yielder) {\n // the container is the instance that owns this node\n this.container = this.up.ractive;\n this.component = this.container.component;\n this.containerFragment = this.up;\n\n // normal component\n if (this.component) {\n // yields skip the owning instance and go straight to the surrounding context\n this.up = this.component.up;\n\n // {{yield}} is equivalent to {{yield content}}\n if (!template.r && !template.x && !template.rx) this.refName = 'content';\n } else {\n // plain-ish instance that may be attached to a parent later\n this.fragment = new Fragment({\n owner: this,\n template: []\n });\n this.fragment.bind();\n return;\n }\n }\n\n // this is a macro/super partial\n if (this.macro) {\n this.fn = this.macro;\n } else {\n // this is a plain partial or yielder\n if (!this.refName) this.refName = template.r;\n\n // if the refName exists as a partial, this is a plain old partial reference where no model binding will happen\n if (this.refName) {\n partialFromValue(this, this.refName);\n }\n\n // this is a dynamic/inline partial\n if (!this.partial && !this.fn) {\n MustacheContainer.prototype.bind.call(this);\n if (this.model) partialFromValue(this, this.model.get());\n }\n }\n\n if (!this.partial && !this.fn) {\n warnOnceIfDebug(`Could not find template for partial '${this.name}'`);\n }\n\n createFragment(this, this.partial || []);\n\n // macro/super partial\n if (this.fn) initMacro(this);\n\n this.fragment.bind();\n },\n\n bubble() {\n if (!this.dirty) {\n this.dirty = true;\n\n if (this.yielder) {\n this.containerFragment.bubble();\n } else {\n this.up.bubble();\n }\n }\n },\n\n findNextNode() {\n return (this.containerFragment || this.up).findNextNode(this);\n },\n\n handleChange() {\n this.dirtyTemplate = true;\n this.externalChange = true;\n this.bubble();\n },\n\n rebound(update) {\n if (this._attrs) {\n keys(this._attrs).forEach(k => this._attrs[k].rebound(update));\n }\n MustacheContainer.prototype.rebound.call(this, update);\n },\n\n refreshAttrs() {\n keys(this._attrs).forEach(k => {\n this.handle.attributes[k] = !this._attrs[k].items.length || this._attrs[k].valueOf();\n });\n },\n\n resetTemplate() {\n if (this.fn && this.proxy) {\n this.last = 0;\n if (this.externalChange) {\n if (isFunction(this.proxy.teardown)) this.proxy.teardown();\n this.fn = this.proxy = null;\n } else {\n this.partial = this.fnTemplate;\n return true;\n }\n }\n\n this.partial = null;\n\n if (this.refName) {\n this.partial = getPartialTemplate(this.ractive, this.refName, this.up);\n }\n\n if (!this.partial && this.model) {\n partialFromValue(this, this.model.get());\n }\n\n if (!this.fn) {\n if (this.last && this.partial === this.last) return false;\n else if (this.partial) {\n this.last = this.partial;\n contextifyTemplate(this);\n }\n }\n\n this.unbindAttrs();\n\n if (this.fn) {\n initMacro(this);\n if (isFunction(this.proxy.render)) runloop.scheduleTask(() => this.proxy.render());\n } else if (!this.partial) {\n warnOnceIfDebug(`Could not find template for partial '${this.name}'`);\n }\n\n return true;\n },\n\n render(target, occupants) {\n if (this.fn && this.fn._cssDef && !this.fn._cssDef.applied) applyCSS();\n\n this.fragment.render(target, occupants);\n\n if (this.proxy && isFunction(this.proxy.render)) this.proxy.render();\n },\n\n unbind(view) {\n this.fragment.unbind(view);\n\n this.unbindAttrs(view);\n\n MustacheContainer.prototype.unbind.call(this, view);\n },\n\n unbindAttrs(view) {\n if (this._attrs) {\n keys(this._attrs).forEach(k => {\n this._attrs[k].unbind(view);\n });\n }\n },\n\n unrender(shouldDestroy) {\n if (this.proxy && isFunction(this.proxy.teardown)) this.proxy.teardown();\n\n this.fragment.unrender(shouldDestroy);\n },\n\n update() {\n const proxy = this.proxy;\n this.updating = 1;\n\n if (this.dirtyAttrs) {\n this.dirtyAttrs = false;\n keys(this._attrs).forEach(k => this._attrs[k].update());\n this.refreshAttrs();\n if (isFunction(proxy.update)) proxy.update(this.handle.attributes);\n }\n\n if (this.dirtyTemplate) {\n this.dirtyTemplate = false;\n this.resetTemplate() && this.fragment.resetTemplate(this.partial || []);\n }\n\n if (this.dirty) {\n this.dirty = false;\n if (proxy && isFunction(proxy.invalidate)) proxy.invalidate();\n this.fragment.update();\n }\n\n this.externalChange = false;\n this.updating = 0;\n }\n});\n\nfunction createFragment(self, partial) {\n self.partial = self.last = partial;\n contextifyTemplate(self);\n\n const options = {\n owner: self,\n template: self.partial\n };\n\n if (self.yielder) options.ractive = self.container.parent;\n\n if (self.fn) options.cssIds = self.fn._cssIds;\n\n self.fragment = new Fragment(options);\n}\n\nfunction contextifyTemplate(self) {\n if (self.template.c) {\n self.partial = [{ t: SECTION, n: SECTION_WITH, f: self.partial }];\n assign(self.partial[0], self.template.c);\n if (self.yielder) self.partial[0].y = self;\n else self.partial[0].z = self.template.z;\n }\n}\n\nfunction partialFromValue(self, value, okToParse) {\n let tpl = value;\n\n if (isArray(tpl)) {\n self.partial = tpl;\n } else if (tpl && isObjectType(tpl)) {\n if (isArray(tpl.t)) self.partial = tpl.t;\n else if (isString(tpl.template))\n self.partial = parsePartial(tpl.template, tpl.template, self.ractive).t;\n } else if (isFunction(tpl) && tpl.styleSet) {\n self.fn = tpl;\n if (self.fragment) self.fragment.cssIds = tpl._cssIds;\n } else if (tpl != null) {\n tpl = getPartialTemplate(self.ractive, '' + tpl, self.containerFragment || self.up);\n if (tpl) {\n self.name = value;\n if (tpl.styleSet) {\n self.fn = tpl;\n if (self.fragment) self.fragment.cssIds = tpl._cssIds;\n } else self.partial = tpl;\n } else if (okToParse) {\n self.partial = parsePartial('' + value, '' + value, self.ractive).t;\n } else {\n self.name = value;\n }\n }\n\n return self.partial;\n}\n\nfunction setTemplate(template) {\n partialFromValue(this, template, true);\n\n if (!this.initing) {\n this.dirtyTemplate = true;\n this.fnTemplate = this.partial;\n\n if (this.updating) {\n this.bubble();\n runloop.promise();\n } else {\n const promise = runloop.start();\n\n this.bubble();\n runloop.end();\n\n return promise;\n }\n }\n}\n\nfunction aliasLocal(ref, name) {\n const aliases = this.fragment.aliases || (this.fragment.aliases = {});\n if (!name) {\n aliases[ref] = this._data;\n } else {\n aliases[name] = this._data.joinAll(splitKeypath(ref));\n }\n}\n\nconst extras = 'extra-attributes';\n\nfunction initMacro(self) {\n const fn = self.fn;\n const fragment = self.fragment;\n\n // defensively copy the template in case it changes\n const template = (self.template = assign({}, self.template));\n const handle = (self.handle = fragment.getContext({\n proxy: self,\n aliasLocal,\n name: self.template.e || self.name,\n attributes: {},\n setTemplate: setTemplate.bind(self),\n template,\n macro: fn\n }));\n\n if (!template.p) template.p = {};\n template.p = handle.partials = assign({}, template.p);\n if (!hasOwn(template.p, 'content')) template.p.content = template.f || [];\n\n if (isArray(fn.attributes)) {\n self._attrs = {};\n\n const invalidate = function() {\n this.dirty = true;\n self.dirtyAttrs = true;\n self.bubble();\n };\n\n if (isArray(template.m)) {\n const attrs = template.m;\n template.p[extras] = template.m = attrs.filter(a => !~fn.attributes.indexOf(a.n));\n attrs\n .filter(a => ~fn.attributes.indexOf(a.n))\n .forEach(a => {\n const fragment = new Fragment({\n template: a.f,\n owner: self\n });\n fragment.bubble = invalidate;\n fragment.findFirstNode = noop;\n self._attrs[a.n] = fragment;\n });\n } else {\n template.p[extras] = [];\n }\n } else {\n template.p[extras] = template.m;\n }\n\n if (self._attrs) {\n keys(self._attrs).forEach(k => {\n self._attrs[k].bind();\n });\n self.refreshAttrs();\n }\n\n self.initing = 1;\n self.proxy = fn.call(self.ractive, handle, handle.attributes) || {};\n if (!self.partial) self.partial = [];\n self.fnTemplate = self.partial;\n self.initing = 0;\n\n contextifyTemplate(self);\n fragment.resetTemplate(self.partial);\n}\n\nfunction parsePartial(name, partial, ractive) {\n let parsed;\n\n try {\n parsed = parser.parse(partial, parser.getParseOptions(ractive));\n } catch (e) {\n warnIfDebug(`Could not parse partial from expression '${name}'\\n${e.message}`);\n }\n\n return parsed || { t: [] };\n}\n","import { addToArray, removeFromArray } from 'utils/array';\nimport { unescapeKey } from 'shared/keypaths';\nimport { capture } from 'src/global/capture';\nimport { handleChange } from 'src/shared/methodCallers';\nimport noop from 'utils/noop';\n\nexport default class KeyModel {\n constructor(value, context, instance) {\n this.value = this.key = value;\n this.context = context;\n this.isReadonly = this.isKey = true;\n this.deps = [];\n this.links = [];\n this.children = [];\n this.instance = instance;\n }\n\n applyValue(value) {\n if (value !== this.value) {\n this.value = this.key = value;\n this.deps.forEach(handleChange);\n this.links.forEach(handleChange);\n this.children.forEach(c => {\n c.applyValue(c.context.getKeypath(c.instance));\n });\n }\n }\n\n destroyed() {\n if (this.upstream) this.upstream.unregisterChild(this);\n }\n\n get(shouldCapture) {\n if (shouldCapture) capture(this);\n return unescapeKey(this.value);\n }\n\n getKeypath() {\n return unescapeKey(this.value);\n }\n\n has() {\n return false;\n }\n\n rebind(next, previous) {\n let i = this.deps.length;\n while (i--) this.deps[i].rebind(next, previous, false);\n\n i = this.links.length;\n while (i--) this.links[i].relinking(next, false);\n }\n\n register(dependant) {\n this.deps.push(dependant);\n }\n\n registerChild(child) {\n addToArray(this.children, child);\n child.upstream = this;\n }\n\n registerLink(link) {\n addToArray(this.links, link);\n }\n\n unregister(dependant) {\n removeFromArray(this.deps, dependant);\n }\n\n unregisterChild(child) {\n removeFromArray(this.children, child);\n }\n\n unregisterLink(link) {\n removeFromArray(this.links, link);\n }\n}\n\nKeyModel.prototype.reference = noop;\nKeyModel.prototype.unreference = noop;\n","import { createDocumentFragment } from 'utils/dom';\nimport { isArray, isObject, isObjectType, isUndefined } from 'utils/is';\nimport { findMap, buildNewIndices } from 'utils/array';\nimport { toEscapedString, toString, shuffled, update } from 'shared/methodCallers';\nimport Fragment, { getKeypath } from './Fragment';\nimport { ELEMENT } from 'config/types';\nimport { getContext } from 'shared/getRactiveContext';\nimport { keys } from 'utils/object';\nimport KeyModel from 'src/model/specials/KeyModel';\nimport { splitKeypath } from '../shared/keypaths';\nimport resolve from './resolvers/resolve';\n\nconst keypathString = /^\"(\\\\\"|[^\"])+\"$/;\n\nexport default class RepeatedFragment {\n constructor(options) {\n this.parent = options.owner.up;\n\n // bit of a hack, so reference resolution works without another\n // layer of indirection\n this.up = this;\n this.owner = options.owner;\n this.ractive = this.parent.ractive;\n this.delegate =\n this.ractive.delegate !== false && (this.parent.delegate || findDelegate(this.parent));\n // delegation disabled by directive\n if (this.delegate && this.delegate.delegate === false) this.delegate = false;\n // let the element know it's a delegate handler\n if (this.delegate) this.delegate.delegate = this.delegate;\n\n // encapsulated styles should be inherited until they get applied by an element\n this.cssIds = 'cssIds' in options ? options.cssIds : this.parent ? this.parent.cssIds : null;\n\n this.context = null;\n this.rendered = false;\n this.iterations = [];\n\n this.template = options.template;\n\n this.indexRef = options.indexRef;\n this.keyRef = options.keyRef;\n\n this.pendingNewIndices = null;\n this.previousIterations = null;\n\n // track array versus object so updates of type rest\n this.isArray = false;\n }\n\n bind(context) {\n this.context = context;\n this.bound = true;\n const value = context.get();\n\n const aliases = (this.aliases = this.owner.template.z && this.owner.template.z.slice());\n\n const shuffler = aliases && aliases.find(a => a.n === 'shuffle');\n if (shuffler && shuffler.x && shuffler.x.x) {\n if (shuffler.x.x.s === 'true') this.shuffler = true;\n else if (keypathString.test(shuffler.x.x.s))\n this.shuffler = splitKeypath(shuffler.x.x.s.slice(1, -1));\n }\n\n if (this.shuffler) this.values = shuffleValues(this, this.shuffler);\n\n if (this.source) this.source.model.unbind(this.source);\n const source = context.isComputed && aliases && aliases.find(a => a.n === 'source');\n if (source && source.x && source.x.r) {\n const model = resolve(this, source.x);\n this.source = {\n handleChange() {},\n rebind(next) {\n this.model.unregister(this);\n this.model = next;\n next.register(this);\n }\n };\n this.source.model = model;\n model.register(this.source);\n }\n\n // {{#each array}}...\n if ((this.isArray = isArray(value))) {\n // we can't use map, because of sparse arrays\n this.iterations = [];\n const max = (this.length = value.length);\n for (let i = 0; i < max; i += 1) {\n this.iterations[i] = this.createIteration(i, i);\n }\n } else if (isObject(value)) {\n // {{#each object}}...\n this.isArray = false;\n\n // TODO this is a dreadful hack. There must be a neater way\n if (this.indexRef) {\n const refs = this.indexRef.split(',');\n this.keyRef = refs[0];\n this.indexRef = refs[1];\n }\n\n const ks = keys(value);\n this.length = ks.length;\n\n this.iterations = ks.map((key, index) => {\n return this.createIteration(key, index);\n });\n }\n\n return this;\n }\n\n bubble(index) {\n if (!this.bubbled) this.bubbled = [];\n this.bubbled.push(index);\n\n if (!this.rebounding) this.owner.bubble();\n }\n\n createIteration(key, index) {\n const fragment = new Fragment({\n owner: this,\n template: this.template\n });\n\n fragment.isIteration = true;\n fragment.delegate = this.delegate;\n\n if (this.aliases) fragment.aliases = {};\n swizzleFragment(this, fragment, key, index);\n\n return fragment.bind(fragment.context);\n }\n\n destroyed() {\n const len = this.iterations.length;\n for (let i = 0; i < len; i++) this.iterations[i].destroyed();\n if (this.pathModel) this.pathModel.destroyed();\n if (this.rootModel) this.rootModel.destroyed();\n }\n\n detach() {\n const docFrag = createDocumentFragment();\n this.iterations.forEach(fragment => docFrag.appendChild(fragment.detach()));\n return docFrag;\n }\n\n find(selector, options) {\n return findMap(this.iterations, i => i.find(selector, options));\n }\n\n findAll(selector, options) {\n return this.iterations.forEach(i => i.findAll(selector, options));\n }\n\n findAllComponents(name, options) {\n return this.iterations.forEach(i => i.findAllComponents(name, options));\n }\n\n findComponent(name, options) {\n return findMap(this.iterations, i => i.findComponent(name, options));\n }\n\n findContext() {\n return this.context;\n }\n\n findNextNode(iteration) {\n if (iteration.index < this.iterations.length - 1) {\n for (let i = iteration.index + 1; i < this.iterations.length; i++) {\n const node = this.iterations[i].firstNode(true);\n if (node) return node;\n }\n }\n\n return this.owner.findNextNode();\n }\n\n firstNode(skipParent) {\n return this.iterations[0] ? this.iterations[0].firstNode(skipParent) : null;\n }\n\n getLast() {\n return this.lastModel || (this.lastModel = new KeyModel(this.length - 1));\n }\n\n rebind(next) {\n this.context = next;\n if (this.source) return;\n if (next) {\n this.iterations.forEach(fragment => {\n swizzleFragment(this, fragment, fragment.key, fragment.index);\n });\n }\n }\n\n rebound(update) {\n this.context = this.owner.model;\n this.iterations.forEach((f, i) => {\n f.context = contextFor(this, f, i);\n f.rebound(update);\n });\n }\n\n render(target, occupants) {\n const xs = this.iterations;\n if (xs) {\n const len = xs.length;\n for (let i = 0; i < len; i++) {\n xs[i].render(target, occupants);\n }\n }\n\n this.rendered = true;\n }\n\n shuffle(newIndices, merge) {\n if (!this.pendingNewIndices) this.previousIterations = this.iterations.slice();\n\n if (!this.pendingNewIndices) this.pendingNewIndices = [];\n\n this.pendingNewIndices.push(newIndices);\n\n const iterations = [];\n\n newIndices.forEach((newIndex, oldIndex) => {\n if (newIndex === -1) return;\n\n const fragment = this.iterations[oldIndex];\n iterations[newIndex] = fragment;\n\n if (newIndex !== oldIndex && fragment) {\n fragment.dirty = true;\n if (merge) fragment.shouldRebind = 1;\n }\n });\n\n this.iterations = iterations;\n\n // if merging, we're in the midst of an update already\n if (!merge) this.bubble();\n }\n\n shuffled() {\n this.iterations.forEach(shuffled);\n }\n\n toString(escape) {\n return this.iterations ? this.iterations.map(escape ? toEscapedString : toString).join('') : '';\n }\n\n unbind(view) {\n this.bound = false;\n if (this.source) this.source.model.unregister(this.source);\n const iterations = this.pendingNewIndices ? this.previousIterations : this.iterations;\n const len = iterations.length;\n for (let i = 0; i < len; i++) iterations[i].unbind(view);\n return this;\n }\n\n unrender(shouldDestroy) {\n let len = this.iterations.length;\n for (let i = 0; i < len; i++) this.iterations[i].unrender(shouldDestroy);\n if (this.pendingNewIndices && this.previousIterations) {\n len = this.previousIterations.length;\n for (let i = 0; i < len; i++) this.previousIterations[i].unrender(shouldDestroy);\n }\n this.rendered = false;\n }\n\n update() {\n if (this.pendingNewIndices) {\n this.bubbled.length = 0;\n this.updatePostShuffle();\n return;\n }\n\n if (this.updating) return;\n this.updating = true;\n\n if (this.shuffler) {\n const values = shuffleValues(this, this.shuffler);\n const newIndices = buildNewIndices(this.values, values);\n if (!newIndices.same) {\n this.shuffle(newIndices, true);\n this.updatePostShuffle();\n } else {\n this.iterations.forEach(update);\n }\n } else {\n let len = this.iterations.length;\n for (let i = 0; i < len; i++) {\n const f = this.iterations[i];\n f && f.idxModel && f.idxModel.applyValue(i);\n }\n\n const value = this.context.get();\n const wasArray = this.isArray;\n\n let toRemove;\n let oldKeys;\n let reset = true;\n let i;\n\n if ((this.isArray = isArray(value))) {\n // if there's a source to map back to, make sure everything stays bound correctly\n if (this.source) {\n this.rebounding = 1;\n const source = this.source.model.get();\n this.iterations.forEach((f, c) => {\n if (c < value.length && f.lastValue !== value[c] && ~(i = source.indexOf(value[c]))) {\n swizzleFragment(this, f, c, c);\n f.rebound(true);\n }\n });\n this.rebounding = 0;\n }\n\n if (wasArray) {\n reset = false;\n if (this.iterations.length > value.length) {\n toRemove = this.iterations.splice(value.length);\n }\n }\n } else if (isObject(value) && !wasArray) {\n reset = false;\n toRemove = [];\n oldKeys = {};\n i = this.iterations.length;\n\n while (i--) {\n const fragment = this.iterations[i];\n if (fragment.key in value) {\n oldKeys[fragment.key] = true;\n } else {\n this.iterations.splice(i, 1);\n toRemove.push(fragment);\n }\n }\n }\n\n const newLength = isArray(value) ? value.length : isObject(value) ? keys(value).length : 0;\n this.length = newLength;\n this.updateLast();\n\n if (reset) {\n toRemove = this.iterations;\n this.iterations = [];\n }\n\n if (toRemove) {\n len = toRemove.length;\n for (let i = 0; i < len; i++) toRemove[i].unbind().unrender(true);\n }\n\n // update the remaining ones\n if (!reset && this.isArray && this.bubbled && this.bubbled.length) {\n const bubbled = this.bubbled;\n this.bubbled = [];\n len = bubbled.length;\n for (let i = 0; i < len; i++)\n this.iterations[bubbled[i]] && this.iterations[bubbled[i]].update();\n } else {\n len = this.iterations.length;\n for (let i = 0; i < len; i++) this.iterations[i].update();\n }\n\n // add new iterations\n let docFrag;\n let fragment;\n\n if (newLength > this.iterations.length) {\n docFrag = this.rendered ? createDocumentFragment() : null;\n i = this.iterations.length;\n\n if (isArray(value)) {\n while (i < value.length) {\n fragment = this.createIteration(i, i);\n\n this.iterations.push(fragment);\n if (this.rendered) fragment.render(docFrag);\n\n i += 1;\n }\n } else if (isObject(value)) {\n // TODO this is a dreadful hack. There must be a neater way\n if (this.indexRef && !this.keyRef) {\n const refs = this.indexRef.split(',');\n this.keyRef = refs[0];\n this.indexRef = refs[1];\n }\n\n keys(value).forEach(key => {\n if (!oldKeys || !(key in oldKeys)) {\n fragment = this.createIteration(key, i);\n\n this.iterations.push(fragment);\n if (this.rendered) fragment.render(docFrag);\n\n i += 1;\n }\n });\n }\n\n if (this.rendered) {\n const parentNode = this.parent.findParentNode();\n const anchor = this.parent.findNextNode(this.owner);\n\n parentNode.insertBefore(docFrag, anchor);\n }\n }\n }\n\n this.updating = false;\n }\n\n updateLast() {\n if (this.lastModel) this.lastModel.applyValue(this.length - 1);\n }\n\n updatePostShuffle() {\n const newIndices = this.pendingNewIndices[0];\n const parentNode = this.rendered ? this.parent.findParentNode() : null;\n const nextNode = parentNode && this.owner.findNextNode();\n const docFrag = parentNode ? createDocumentFragment() : null;\n\n // map first shuffle through\n this.pendingNewIndices.slice(1).forEach(indices => {\n newIndices.forEach((newIndex, oldIndex) => {\n newIndices[oldIndex] = indices[newIndex];\n });\n });\n\n const len = (this.length = this.context.get().length);\n const prev = this.previousIterations;\n const iters = this.iterations;\n const value = this.context.get();\n const stash = {};\n let idx, dest, pos, next, anchor, rebound;\n\n const map = new Array(newIndices.length);\n newIndices.forEach((e, i) => (map[e] = i));\n\n this.updateLast();\n\n idx = pos = 0;\n while (idx < len) {\n // if there's not an existing thing to shuffle, handle that\n if (isUndefined(map[idx])) {\n next = iters[idx] = this.createIteration(idx, idx);\n if (parentNode) {\n anchor = prev[pos];\n anchor = (anchor && parentNode && anchor.firstNode()) || nextNode;\n\n next.render(docFrag);\n parentNode.insertBefore(docFrag, anchor);\n }\n\n idx++;\n } else {\n dest = newIndices[pos];\n\n if (dest === -1) {\n // if it needs to be dropped, drop it\n prev[pos] && prev[pos].unbind().unrender(true);\n prev[pos++] = 0;\n } else if (dest > idx) {\n // if it needs to move down, stash it\n stash[dest] = prev[pos];\n prev[pos++] = null;\n } else {\n // get the fragment that goes for this idx\n iters[idx] = next = iters[idx] || stash[idx] || this.createIteration(idx, idx);\n\n // if it's an existing fragment, swizzle\n if (stash[idx] || pos !== idx) {\n rebound = this.source && next.lastValue !== value[idx];\n swizzleFragment(this, next, idx, idx);\n }\n\n // does next need to be moved?\n if (parentNode && (stash[idx] || !prev[pos])) {\n anchor = prev[pos + 1];\n anchor = (anchor && parentNode && anchor.firstNode()) || nextNode;\n\n if (stash[idx]) {\n parentNode.insertBefore(next.detach(), anchor);\n } else {\n next.render(docFrag);\n parentNode.insertBefore(docFrag, anchor);\n }\n }\n\n prev[pos++] = 0;\n idx++;\n }\n\n if (next && isObjectType(next)) {\n if (next.shouldRebind || rebound) {\n next.rebound(rebound);\n next.shouldRebind = 0;\n }\n next.update();\n next.shuffled();\n }\n }\n }\n\n // clean up any stragglers\n const plen = prev.length;\n for (let i = 0; i < plen; i++) prev[i] && prev[i].unbind().unrender(true);\n\n if (this.shuffler) this.values = shuffleValues(this, this.shuffler);\n\n this.pendingNewIndices = null;\n this.previousIterations = null;\n }\n}\n\nRepeatedFragment.prototype.getContext = getContext;\nRepeatedFragment.prototype.getKeypath = getKeypath;\n\n// find the topmost delegate\nfunction findDelegate(start) {\n let frag = start;\n let delegate, el;\n\n out: while (frag) {\n // find next element\n el = 0;\n while (!el && frag) {\n if (frag.owner.type === ELEMENT) el = frag.owner;\n if (frag.owner.ractive && frag.owner.ractive.delegate === false) break out;\n frag = frag.parent || frag.componentParent;\n }\n\n if (el.delegate === false) break out;\n delegate = el.delegate || el;\n\n // find next repeated fragment\n while (frag) {\n if (frag.iterations) break;\n if (frag.owner.ractive && frag.owner.ractive.delegate === false) break out;\n frag = frag.parent || frag.componentParent;\n }\n }\n\n return delegate;\n}\n\nfunction swizzleFragment(section, fragment, key, idx) {\n const model = section.context ? contextFor(section, fragment, key) : undefined;\n\n fragment.key = key;\n fragment.index = idx;\n fragment.context = model;\n if (section.source) fragment.lastValue = model && model.get();\n\n if (fragment.idxModel) fragment.idxModel.applyValue(idx);\n if (fragment.keyModel) fragment.keyModel.applyValue(key);\n if (fragment.pathModel) {\n fragment.pathModel.context = model;\n fragment.pathModel.applyValue(model.getKeypath());\n }\n if (fragment.rootModel) {\n fragment.rootModel.context = model;\n fragment.rootModel.applyValue(model.getKeypath(fragment.ractive.root));\n }\n\n // handle any aliases\n const aliases = fragment.aliases;\n section.aliases &&\n section.aliases.forEach(a => {\n if (a.x.r === '.') aliases[a.n] = model;\n else if (a.x.r === '@index') aliases[a.n] = fragment.getIndex();\n else if (a.x.r === '@key') aliases[a.n] = fragment.getKey();\n else if (a.x.r === '@keypath') aliases[a.n] = fragment.getKeypath();\n else if (a.x.r === '@rootpath') aliases[a.n] = fragment.getKeypath(true);\n });\n}\n\nfunction shuffleValues(section, shuffler) {\n const array = section.context.get() || [];\n if (shuffler === true) {\n return array.slice();\n } else {\n return array.map(v => shuffler.reduce((a, c) => a && a[c], v));\n }\n}\n\nfunction contextFor(section, fragment, key) {\n if (section.source) {\n let idx;\n const source = section.source.model.get();\n if (source.indexOf && ~(idx = source.indexOf(section.context.joinKey(key).get())))\n return section.source.model.joinKey(idx);\n }\n\n return section.context.joinKey(key);\n}\n","import {\n ALIAS,\n SECTION_EACH,\n SECTION_IF,\n SECTION_IF_WITH,\n SECTION_UNLESS,\n SECTION_WITH\n} from 'config/types';\nimport { createDocumentFragment } from 'utils/dom';\nimport { isArray, isObject, isObjectLike, isUndefined } from 'utils/is';\nimport { keep } from 'shared/set';\nimport runloop from 'src/global/runloop';\nimport Fragment from '../Fragment';\nimport RepeatedFragment from '../RepeatedFragment';\nimport { MustacheContainer } from './shared/Mustache';\nimport { keys } from 'utils/object';\nimport Context from 'src/shared/Context';\n\nfunction isEmpty(value) {\n return (\n !value ||\n (isArray(value) && value.length === 0) ||\n (isObject(value) && keys(value).length === 0)\n );\n}\n\nfunction getType(value, hasIndexRef) {\n if (hasIndexRef || isArray(value)) return SECTION_EACH;\n if (isObjectLike(value)) return SECTION_IF_WITH;\n if (isUndefined(value)) return null;\n return SECTION_IF;\n}\n\nexport default class Section extends MustacheContainer {\n constructor(options) {\n super(options);\n\n this.isAlias = options.template.t === ALIAS;\n this.sectionType = options.template.n || (this.isAlias && SECTION_WITH) || null;\n this.templateSectionType = this.sectionType;\n this.subordinate = options.template.l === 1;\n this.fragment = null;\n }\n\n bind() {\n super.bind();\n\n if (this.subordinate) {\n this.sibling = this.up.items[this.up.items.indexOf(this) - 1];\n this.sibling.nextSibling = this;\n }\n\n // if we managed to bind, we need to create children\n if (this.model || this.isAlias) {\n this.dirty = true;\n this.update();\n } else if (\n this.sectionType &&\n this.sectionType === SECTION_UNLESS &&\n (!this.sibling || !this.sibling.isTruthy())\n ) {\n this.fragment = new Fragment({\n owner: this,\n template: this.template.f\n }).bind();\n }\n }\n\n bubble() {\n if (!this.dirty && this.yield) {\n this.dirty = true;\n this.containerFragment.bubble();\n } else super.bubble();\n }\n\n detach() {\n const frag = this.fragment || this.detached;\n return frag ? frag.detach() : super.detach();\n }\n\n findNextNode() {\n return (this.containerFragment || this.up).findNextNode(this);\n }\n\n isTruthy() {\n if (this.subordinate && this.sibling.isTruthy()) return true;\n const value = !this.model ? undefined : this.model.isRoot ? this.model.value : this.model.get();\n return !!value && (this.templateSectionType === SECTION_IF_WITH || !isEmpty(value));\n }\n\n rebind(next, previous, safe) {\n if (super.rebind(next, previous, safe)) {\n if (this.fragment && this.sectionType !== SECTION_IF && this.sectionType !== SECTION_UNLESS) {\n this.fragment.rebind(next);\n }\n }\n }\n\n rebound(update) {\n if (this.model) {\n if (this.model.rebound) this.model.rebound(update);\n else {\n super.unbind();\n super.bind();\n if (\n this.sectionType === SECTION_WITH ||\n this.sectionType === SECTION_IF_WITH ||\n this.sectionType === SECTION_EACH\n ) {\n if (this.fragment) this.fragment.rebind(this.model);\n }\n\n if (update) this.bubble();\n }\n }\n if (this.fragment) this.fragment.rebound(update);\n }\n\n render(target, occupants) {\n this.rendered = true;\n if (this.fragment) this.fragment.render(target, occupants);\n }\n\n shuffle(newIndices) {\n if (this.fragment && this.sectionType === SECTION_EACH) {\n this.fragment.shuffle(newIndices);\n }\n }\n\n unbind(view) {\n super.unbind(view);\n if (this.fragment) this.fragment.unbind(view);\n }\n\n unrender(shouldDestroy) {\n if (this.rendered && this.fragment) this.fragment.unrender(shouldDestroy);\n this.rendered = false;\n }\n\n update() {\n if (!this.dirty) return;\n\n if (this.fragment && this.sectionType !== SECTION_IF && this.sectionType !== SECTION_UNLESS) {\n this.fragment.context = this.model;\n }\n\n if (!this.model && this.sectionType !== SECTION_UNLESS && !this.isAlias) return;\n\n this.dirty = false;\n\n const value = !this.model ? undefined : this.model.isRoot ? this.model.value : this.model.get();\n const siblingFalsey = !this.subordinate || !this.sibling.isTruthy();\n const lastType = this.sectionType;\n\n if (this.yield && this.yield !== value) {\n this.up = this.containerFragment;\n this.container = null;\n this.yield = null;\n if (this.rendered) this.fragment.unbind().unrender(true);\n this.fragment = null;\n } else if (this.rendered && !this.yield && value instanceof Context) {\n if (this.rendered && this.fragment) this.fragment.unbind().unrender(true);\n this.fragment = null;\n }\n\n // watch for switching section types\n if (this.sectionType === null || this.templateSectionType === null)\n this.sectionType = getType(value, this.template.i);\n if (lastType && lastType !== this.sectionType && this.fragment) {\n if (this.rendered) {\n this.fragment.unbind().unrender(true);\n }\n\n this.fragment = null;\n }\n\n let newFragment;\n\n const fragmentShouldExist =\n this.sectionType === SECTION_EACH || // each always gets a fragment, which may have no iterations\n this.sectionType === SECTION_WITH || // with (partial context) always gets a fragment\n (siblingFalsey &&\n (this.sectionType === SECTION_UNLESS ? !this.isTruthy() : this.isTruthy())) || // if, unless, and if-with depend on siblings and the condition\n this.isAlias;\n\n if (fragmentShouldExist) {\n if (!this.fragment) this.fragment = this.detached;\n\n if (this.fragment) {\n // check for detached fragment\n if (this.detached) {\n attach(this, this.fragment);\n this.detached = false;\n this.rendered = true;\n }\n\n if (!this.fragment.bound) this.fragment.bind(this.model);\n this.fragment.update();\n } else {\n if (this.sectionType === SECTION_EACH) {\n newFragment = new RepeatedFragment({\n owner: this,\n template: this.template.f,\n indexRef: this.template.i\n }).bind(this.model);\n } else {\n // only with and if-with provide context - if and unless do not\n let context =\n this.sectionType !== SECTION_IF && this.sectionType !== SECTION_UNLESS\n ? this.model\n : null;\n\n if (value instanceof Context) {\n this.yield = value;\n this.containerFragment = this.up;\n this.up = value.fragment;\n this.container = value.ractive;\n context = undefined;\n }\n\n newFragment = new Fragment({\n owner: this,\n template: this.template.f\n }).bind(context);\n }\n }\n } else {\n if (this.fragment && this.rendered) {\n if (keep !== true) {\n this.fragment.unbind().unrender(true);\n } else {\n this.unrender(false);\n this.detached = this.fragment;\n runloop.promise().then(() => {\n if (this.detached) this.detach();\n });\n }\n } else if (this.fragment) {\n this.fragment.unbind();\n }\n\n this.fragment = null;\n }\n\n if (newFragment) {\n if (this.rendered) {\n attach(this, newFragment);\n }\n\n this.fragment = newFragment;\n }\n\n if (this.nextSibling) {\n this.nextSibling.dirty = true;\n this.nextSibling.update();\n }\n }\n}\n\nfunction attach(section, fragment) {\n const anchor = (section.containerFragment || section.up).findNextNode(section);\n\n if (anchor) {\n const docFrag = createDocumentFragment();\n fragment.render(docFrag);\n\n anchor.parentNode.insertBefore(docFrag, anchor);\n } else {\n fragment.render(section.up.findParentNode());\n }\n}\n","import { toArray } from 'utils/array';\nimport getSelectedOptions from 'utils/getSelectedOptions';\nimport Element from '../../Element';\nimport { isArray, isFunction } from 'utils/is';\n\nexport default class Select extends Element {\n constructor(options) {\n super(options);\n this.options = [];\n }\n\n foundNode(node) {\n if (this.binding) {\n const selectedOptions = getSelectedOptions(node);\n\n if (selectedOptions.length > 0) {\n this.selectedOptions = selectedOptions;\n }\n }\n }\n\n render(target, occupants) {\n super.render(target, occupants);\n this.sync();\n\n const node = this.node;\n\n let i = node.options.length;\n while (i--) {\n node.options[i].defaultSelected = node.options[i].selected;\n }\n\n this.rendered = true;\n }\n\n sync() {\n const selectNode = this.node;\n\n if (!selectNode) return;\n\n const options = toArray(selectNode.options);\n\n if (this.selectedOptions) {\n options.forEach(o => {\n if (this.selectedOptions.indexOf(o) >= 0) o.selected = true;\n else o.selected = false;\n });\n this.binding.setFromNode(selectNode);\n delete this.selectedOptions;\n return;\n }\n\n const selectValue = this.getAttribute('value');\n const isMultiple = this.getAttribute('multiple');\n const array = isMultiple && isArray(selectValue);\n\n // If the <select> has a specified value, that should override\n // these options\n if (selectValue !== undefined) {\n let optionWasSelected;\n\n options.forEach(o => {\n const optionValue = o._ractive ? o._ractive.value : o.value;\n const shouldSelect = isMultiple\n ? array && this.valueContains(selectValue, optionValue)\n : this.compare(selectValue, optionValue);\n\n if (shouldSelect) {\n optionWasSelected = true;\n }\n\n o.selected = shouldSelect;\n });\n\n if (!optionWasSelected && !isMultiple) {\n if (this.binding) {\n this.binding.forceUpdate();\n }\n }\n } else if (this.binding && this.binding.forceUpdate) {\n // Otherwise the value should be initialised according to which\n // <option> element is selected, if twoway binding is in effect\n this.binding.forceUpdate();\n }\n }\n valueContains(selectValue, optionValue) {\n let i = selectValue.length;\n while (i--) {\n if (this.compare(optionValue, selectValue[i])) return true;\n }\n }\n compare(optionValue, selectValue) {\n const comparator = this.getAttribute('value-comparator');\n if (comparator) {\n if (isFunction(comparator)) {\n return comparator(selectValue, optionValue);\n }\n if (selectValue && optionValue) {\n return selectValue[comparator] == optionValue[comparator];\n }\n }\n return selectValue == optionValue;\n }\n update() {\n const dirty = this.dirty;\n super.update();\n if (dirty) {\n this.sync();\n }\n }\n}\n","import { ATTRIBUTE } from 'config/types';\nimport runloop from 'src/global/runloop';\nimport Input from './Input';\nimport { isBindable } from '../binding/selectBinding';\nimport createItem from '../../createItem';\nimport Fragment from '../../../Fragment';\n\nexport default class Textarea extends Input {\n constructor(options) {\n const template = options.template;\n\n options.deferContent = true;\n\n super(options);\n\n // check for single interpolator binding\n if (!this.attributeByName.value) {\n if (template.f && isBindable({ template })) {\n (this.attributes || (this.attributes = [])).push(\n createItem({\n owner: this,\n template: { t: ATTRIBUTE, f: template.f, n: 'value' },\n up: this.up\n })\n );\n } else {\n this.fragment = new Fragment({\n owner: this,\n cssIds: null,\n template: template.f\n });\n }\n }\n }\n\n bubble() {\n if (!this.dirty) {\n this.dirty = true;\n\n if (this.rendered && !this.binding && this.fragment) {\n runloop.scheduleTask(() => {\n this.dirty = false;\n this.node.value = this.fragment.toString();\n });\n }\n\n this.up.bubble(); // default behaviour\n }\n }\n}\n","import { TEXT } from 'config/types';\nimport { escapeHtml } from 'utils/html';\nimport { detachNode } from 'utils/dom';\nimport noop from 'utils/noop';\nimport Item from './shared/Item';\nimport progressiveText from './shared/progressiveText';\nimport { inAttributes } from './element/ConditionalAttribute';\n\nexport default class Text extends Item {\n constructor(options) {\n super(options);\n this.type = TEXT;\n }\n\n detach() {\n return detachNode(this.node);\n }\n\n firstNode() {\n return this.node;\n }\n\n render(target, occupants) {\n if (inAttributes()) return;\n this.rendered = true;\n\n progressiveText(this, target, occupants, this.template);\n }\n\n toString(escape) {\n return escape ? escapeHtml(this.template) : this.template;\n }\n\n unrender(shouldDestroy) {\n if (this.rendered && shouldDestroy) this.detach();\n this.rendered = false;\n }\n\n valueOf() {\n return this.template;\n }\n}\n\nconst proto = Text.prototype;\nproto.bind = proto.unbind = proto.update = noop;\n","import { win, doc, vendors } from './environment';\n\nexport let visible;\nlet hidden = 'hidden';\n\nif (doc) {\n let prefix;\n\n /* istanbul ignore next */\n if (hidden in doc) {\n prefix = '';\n } else {\n let i = vendors.length;\n while (i--) {\n const vendor = vendors[i];\n hidden = vendor + 'Hidden';\n\n if (hidden in doc) {\n prefix = vendor;\n break;\n }\n }\n }\n\n /* istanbul ignore else */\n if (prefix !== undefined) {\n doc.addEventListener(prefix + 'visibilitychange', onChange);\n onChange();\n } else {\n // gah, we're in an old browser\n if ('onfocusout' in doc) {\n doc.addEventListener('focusout', onHide);\n doc.addEventListener('focusin', onShow);\n } else {\n win.addEventListener('pagehide', onHide);\n win.addEventListener('blur', onHide);\n\n win.addEventListener('pageshow', onShow);\n win.addEventListener('focus', onShow);\n }\n\n visible = true; // until proven otherwise. Not ideal but hey\n }\n}\n\nfunction onChange() {\n visible = !doc[hidden];\n}\n\n/* istanbul ignore next */\nfunction onHide() {\n visible = false;\n}\n\n/* istanbul ignore next */\nfunction onShow() {\n visible = true;\n}\n","import { isClient, vendors } from 'config/environment';\nimport { createElement } from 'utils/dom';\nimport hyphenateCamel from 'utils/hyphenateCamel';\n\nlet prefix;\n\n/* istanbul ignore next */\nif (!isClient) {\n prefix = null;\n} else {\n const prefixCache = {};\n const testStyle = createElement('div').style;\n\n // technically this also normalizes on hyphenated styles as well\n prefix = function(prop) {\n if (!prefixCache[prop]) {\n const name = hyphenateCamel(prop);\n\n if (testStyle[prop] !== undefined) {\n prefixCache[prop] = name;\n } else {\n /* istanbul ignore next */\n // test vendors...\n let i = vendors.length;\n while (i--) {\n const vendor = `-${vendors[i]}-${name}`;\n if (testStyle[vendor] !== undefined) {\n prefixCache[prop] = vendor;\n break;\n }\n }\n }\n }\n\n return prefixCache[prop];\n };\n}\n\nexport default prefix;\n","import { missingPlugin } from 'config/errors';\nimport { isClient } from 'config/environment';\nimport { warnIfDebug, warnOnceIfDebug } from 'utils/log';\nimport { createElement } from 'utils/dom';\nimport interpolate from 'shared/interpolate';\nimport Ticker from 'shared/Ticker';\nimport hyphenate from './hyphenate';\nimport { isFunction, isString } from 'utils/is';\n\nlet createTransitions;\n\nif (!isClient) {\n createTransitions = null;\n} else {\n const testStyle = createElement('div').style;\n const linear = x => x;\n\n const canUseCssTransitions = {};\n const cannotUseCssTransitions = {};\n\n // determine some facts about our environment\n let TRANSITION;\n let TRANSITIONEND;\n let CSS_TRANSITIONS_ENABLED;\n let TRANSITION_DURATION;\n let TRANSITION_PROPERTY;\n let TRANSITION_TIMING_FUNCTION;\n\n if (testStyle.transition !== undefined) {\n TRANSITION = 'transition';\n TRANSITIONEND = 'transitionend';\n CSS_TRANSITIONS_ENABLED = true;\n } else if (testStyle.webkitTransition !== undefined) {\n TRANSITION = 'webkitTransition';\n TRANSITIONEND = 'webkitTransitionEnd';\n CSS_TRANSITIONS_ENABLED = true;\n } else {\n CSS_TRANSITIONS_ENABLED = false;\n }\n\n if (TRANSITION) {\n TRANSITION_DURATION = TRANSITION + 'Duration';\n TRANSITION_PROPERTY = TRANSITION + 'Property';\n TRANSITION_TIMING_FUNCTION = TRANSITION + 'TimingFunction';\n }\n\n createTransitions = function(t, to, options, changedProperties, resolve) {\n // Wait a beat (otherwise the target styles will be applied immediately)\n // TODO use a fastdom-style mechanism?\n setTimeout(() => {\n let jsTransitionsComplete;\n let cssTransitionsComplete;\n let cssTimeout; // eslint-disable-line prefer-const\n\n function transitionDone() {\n clearTimeout(cssTimeout);\n }\n\n function checkComplete() {\n if (jsTransitionsComplete && cssTransitionsComplete) {\n t.unregisterCompleteHandler(transitionDone);\n // will changes to events and fire have an unexpected consequence here?\n t.ractive.fire(t.name + ':end', t.node, t.isIntro);\n resolve();\n }\n }\n\n // this is used to keep track of which elements can use CSS to animate\n // which properties\n const hashPrefix = (t.node.namespaceURI || '') + t.node.tagName;\n\n // need to reset transition properties\n const style = t.node.style;\n const previous = {\n property: style[TRANSITION_PROPERTY],\n timing: style[TRANSITION_TIMING_FUNCTION],\n duration: style[TRANSITION_DURATION]\n };\n\n function transitionEndHandler(event) {\n if (event.target !== t.node) return;\n const index = changedProperties.indexOf(event.propertyName);\n\n if (index !== -1) {\n changedProperties.splice(index, 1);\n }\n\n if (changedProperties.length) {\n // still transitioning...\n return;\n }\n\n clearTimeout(cssTimeout);\n cssTransitionsDone();\n }\n\n function cssTransitionsDone() {\n style[TRANSITION_PROPERTY] = previous.property;\n style[TRANSITION_TIMING_FUNCTION] = previous.duration;\n style[TRANSITION_DURATION] = previous.timing;\n\n t.node.removeEventListener(TRANSITIONEND, transitionEndHandler, false);\n\n cssTransitionsComplete = true;\n checkComplete();\n }\n\n t.node.addEventListener(TRANSITIONEND, transitionEndHandler, false);\n\n // safety net in case transitionend never fires\n cssTimeout = setTimeout(() => {\n changedProperties = [];\n cssTransitionsDone();\n }, options.duration + (options.delay || 0) + 50);\n t.registerCompleteHandler(transitionDone);\n\n style[TRANSITION_PROPERTY] = changedProperties.join(',');\n const easingName = hyphenate(options.easing || 'linear');\n style[TRANSITION_TIMING_FUNCTION] = easingName;\n const cssTiming = style[TRANSITION_TIMING_FUNCTION] === easingName;\n style[TRANSITION_DURATION] = options.duration / 1000 + 's';\n\n setTimeout(() => {\n let i = changedProperties.length;\n let hash;\n let originalValue = null;\n let index;\n const propertiesToTransitionInJs = [];\n let prop;\n let suffix;\n let interpolator;\n\n while (i--) {\n prop = changedProperties[i];\n hash = hashPrefix + prop;\n\n if (cssTiming && CSS_TRANSITIONS_ENABLED && !cannotUseCssTransitions[hash]) {\n const initial = style[prop];\n style[prop] = to[prop];\n\n // If we're not sure if CSS transitions are supported for\n // this tag/property combo, find out now\n if (!(hash in canUseCssTransitions)) {\n originalValue = t.getStyle(prop);\n\n // if this property is transitionable in this browser,\n // the current style will be different from the target style\n canUseCssTransitions[hash] = t.getStyle(prop) != to[prop];\n cannotUseCssTransitions[hash] = !canUseCssTransitions[hash];\n\n // Reset, if we're going to use timers after all\n if (cannotUseCssTransitions[hash]) {\n style[prop] = initial;\n }\n }\n }\n\n if (!cssTiming || !CSS_TRANSITIONS_ENABLED || cannotUseCssTransitions[hash]) {\n // we need to fall back to timer-based stuff\n if (originalValue === null) originalValue = t.getStyle(prop);\n\n // need to remove this from changedProperties, otherwise transitionEndHandler\n // will get confused\n index = changedProperties.indexOf(prop);\n if (index === -1) {\n warnIfDebug(\n 'Something very strange happened with transitions. Please raise an issue at https://github.com/ractivejs/ractive/issues - thanks!',\n { node: t.node }\n );\n } else {\n changedProperties.splice(index, 1);\n }\n\n // TODO Determine whether this property is animatable at all\n\n suffix = /[^\\d]*$/.exec(originalValue)[0];\n interpolator = interpolate(parseFloat(originalValue), parseFloat(to[prop]));\n\n // ...then kick off a timer-based transition\n if (interpolator) {\n propertiesToTransitionInJs.push({\n name: prop,\n interpolator,\n suffix\n });\n } else {\n style[prop] = to[prop];\n }\n\n originalValue = null;\n }\n }\n\n // javascript transitions\n if (propertiesToTransitionInJs.length) {\n let easing;\n\n if (isString(options.easing)) {\n easing = t.ractive.easing[options.easing];\n\n if (!easing) {\n warnOnceIfDebug(missingPlugin(options.easing, 'easing'));\n easing = linear;\n }\n } else if (isFunction(options.easing)) {\n easing = options.easing;\n } else {\n easing = linear;\n }\n\n new Ticker({\n duration: options.duration,\n easing,\n step(pos) {\n let i = propertiesToTransitionInJs.length;\n while (i--) {\n const prop = propertiesToTransitionInJs[i];\n style[prop.name] = prop.interpolator(pos) + prop.suffix;\n }\n },\n complete() {\n jsTransitionsComplete = true;\n checkComplete();\n }\n });\n } else {\n jsTransitionsComplete = true;\n }\n\n if (changedProperties.length) {\n style[TRANSITION_PROPERTY] = changedProperties.join(',');\n } else {\n style[TRANSITION_PROPERTY] = 'none';\n\n // We need to cancel the transitionEndHandler, and deal with\n // the fact that it will never fire\n t.node.removeEventListener(TRANSITIONEND, transitionEndHandler, false);\n cssTransitionsComplete = true;\n checkComplete();\n }\n }, 0);\n }, options.delay || 0);\n };\n}\n\nexport default createTransitions;\n","import { vendors } from 'config/environment';\n\nconst vendorPattern = new RegExp('^(?:' + vendors.join('|') + ')([A-Z])');\n\nexport default function(str) {\n /* istanbul ignore next */\n if (!str) return ''; // edge case\n\n /* istanbul ignore next */\n if (vendorPattern.test(str)) str = '-' + str;\n\n return str.replace(/[A-Z]/g, match => '-' + match.toLowerCase());\n}\n","import { win } from 'config/environment';\nimport { addToArray, removeFromArray } from 'utils/array';\nimport { isArray, isObject, isFunction, isNumber, isString, isUndefined } from 'utils/is';\nimport noop from 'utils/noop';\nimport { warnOnceIfDebug } from 'utils/log';\nimport { missingPlugin } from 'config/errors';\nimport { findInViewHierarchy } from 'shared/registry';\nimport { visible } from 'config/visibility';\nimport findElement from '../shared/findElement';\nimport prefix from './transitions/prefix';\nimport createTransitions from './transitions/createTransitions';\nimport { resolveArgs, setupArgsFn } from '../shared/directiveArgs';\nimport { assign, hasOwn, keys } from 'utils/object';\n\nconst getComputedStyle = win && win.getComputedStyle;\nconst resolved = Promise.resolve();\n\nconst names = {\n t0: 'intro-outro',\n t1: 'intro',\n t2: 'outro'\n};\n\nexport default class Transition {\n constructor(options) {\n this.owner = options.owner || options.up.owner || findElement(options.up);\n this.element = this.owner.attributeByName ? this.owner : findElement(options.up);\n this.ractive = this.owner.ractive;\n this.template = options.template;\n this.up = options.up;\n this.options = options;\n this.onComplete = [];\n }\n\n animateStyle(style, value, options) {\n if (arguments.length === 4) {\n throw new Error(\n 't.animateStyle() returns a promise - use .then() instead of passing a callback'\n );\n }\n\n // Special case - page isn't visible. Don't animate anything, because\n // that way you'll never get CSS transitionend events\n if (!visible) {\n this.setStyle(style, value);\n return resolved;\n }\n\n let to;\n\n if (isString(style)) {\n to = {};\n to[style] = value;\n } else {\n to = style;\n\n // shuffle arguments\n options = value;\n }\n\n return new Promise(fulfil => {\n // Edge case - if duration is zero, set style synchronously and complete\n if (!options.duration) {\n this.setStyle(to);\n fulfil();\n return;\n }\n\n // Get a list of the properties we're animating\n const propertyNames = keys(to);\n const changedProperties = [];\n\n // Store the current styles\n const computedStyle = getComputedStyle(this.node);\n\n let i = propertyNames.length;\n while (i--) {\n const prop = propertyNames[i];\n const name = prefix(prop);\n\n const current = computedStyle[prefix(prop)];\n\n // record the starting points\n const init = this.node.style[name];\n if (!(name in this.originals)) this.originals[name] = this.node.style[name];\n this.node.style[name] = to[prop];\n this.targets[name] = this.node.style[name];\n this.node.style[name] = init;\n\n // we need to know if we're actually changing anything\n if (current != to[prop]) {\n // use != instead of !==, so we can compare strings with numbers\n changedProperties.push(name);\n\n // if we happened to prefix, make sure there is a properly prefixed value\n to[name] = to[prop];\n\n // make the computed style explicit, so we can animate where\n // e.g. height='auto'\n this.node.style[name] = current;\n }\n }\n\n // If we're not actually changing anything, the transitionend event\n // will never fire! So we complete early\n if (!changedProperties.length) {\n fulfil();\n return;\n }\n\n createTransitions(this, to, options, changedProperties, fulfil);\n });\n }\n\n bind() {\n const options = this.options;\n const type = options.template && options.template.v;\n if (type) {\n if (type === 't0' || type === 't1') this.element.intro = this;\n if (type === 't0' || type === 't2') this.element.outro = this;\n this.eventName = names[type];\n }\n\n const ractive = this.owner.ractive;\n\n this.name = options.name || options.template.n;\n\n if (options.params) {\n this.params = options.params;\n }\n\n if (isFunction(this.name)) {\n this._fn = this.name;\n this.name = this._fn.name;\n } else {\n this._fn = findInViewHierarchy('transitions', ractive, this.name);\n }\n\n if (!this._fn) {\n warnOnceIfDebug(missingPlugin(this.name, 'transition'), { ractive });\n }\n\n setupArgsFn(this, options.template);\n }\n\n getParams() {\n if (this.params) return this.params;\n\n // get expression args if supplied\n if (this.fn) {\n const values = resolveArgs(this, this.template, this.up).map(model => {\n if (!model) return undefined;\n\n return model.get();\n });\n return this.fn.apply(this.ractive, values);\n }\n }\n\n getStyle(props) {\n const computedStyle = getComputedStyle(this.node);\n\n if (isString(props)) {\n return computedStyle[prefix(props)];\n }\n\n if (!isArray(props)) {\n throw new Error(\n 'Transition$getStyle must be passed a string, or an array of strings representing CSS properties'\n );\n }\n\n const styles = {};\n\n let i = props.length;\n while (i--) {\n const prop = props[i];\n let value = computedStyle[prefix(prop)];\n\n if (value === '0px') value = 0;\n styles[prop] = value;\n }\n\n return styles;\n }\n\n processParams(params, defaults) {\n if (isNumber(params)) {\n params = { duration: params };\n } else if (isString(params)) {\n if (params === 'slow') {\n params = { duration: 600 };\n } else if (params === 'fast') {\n params = { duration: 200 };\n } else {\n params = { duration: 400 };\n }\n } else if (!params) {\n params = {};\n }\n\n return assign({}, defaults, params);\n }\n\n registerCompleteHandler(fn) {\n addToArray(this.onComplete, fn);\n }\n\n setStyle(style, value) {\n if (isString(style)) {\n const name = prefix(style);\n if (!hasOwn(this.originals, name)) this.originals[name] = this.node.style[name];\n this.node.style[name] = value;\n this.targets[name] = this.node.style[name];\n } else {\n let prop;\n for (prop in style) {\n if (hasOwn(style, prop)) {\n this.setStyle(prop, style[prop]);\n }\n }\n }\n\n return this;\n }\n\n shouldFire(type) {\n if (!this.ractive.transitionsEnabled) return false;\n\n // check for noIntro and noOutro cases, which only apply when the owner ractive is rendering and unrendering, respectively\n if (type === 'intro' && this.ractive.rendering && nearestProp('noIntro', this.ractive, true))\n return false;\n if (type === 'outro' && this.ractive.unrendering && nearestProp('noOutro', this.ractive, false))\n return false;\n\n const params = this.getParams(); // this is an array, the params object should be the first member\n // if there's not a parent element, this can't be nested, so roll on\n if (!this.element.parent) return true;\n\n // if there is a local param, it takes precedent\n if (params && params[0] && isObject(params[0]) && 'nested' in params[0]) {\n if (params[0].nested !== false) return true;\n } else {\n // use the nearest instance setting\n // find the nearest instance that actually has a nested setting\n if (nearestProp('nestedTransitions', this.ractive) !== false) return true;\n }\n\n // check to see if this is actually a nested transition\n let el = this.element.parent;\n while (el) {\n if (el[type] && el[type].starting) return false;\n el = el.parent;\n }\n\n return true;\n }\n\n start() {\n const node = (this.node = this.element.node);\n const originals = (this.originals = {}); //= node.getAttribute( 'style' );\n const targets = (this.targets = {});\n\n let completed;\n const args = this.getParams();\n\n // create t.complete() - we don't want this on the prototype,\n // because we don't want `this` silliness when passing it as\n // an argument\n this.complete = noReset => {\n this.starting = false;\n if (completed) {\n return;\n }\n\n this.onComplete.forEach(fn => fn());\n if (!noReset && this.isIntro) {\n for (const k in targets) {\n if (node.style[k] === targets[k]) node.style[k] = originals[k];\n }\n }\n\n this._manager.remove(this);\n\n completed = true;\n };\n\n // If the transition function doesn't exist, abort\n if (!this._fn) {\n this.complete();\n return;\n }\n\n const promise = this._fn.apply(this.ractive, [this].concat(args));\n if (promise) promise.then(this.complete);\n }\n\n toString() {\n return '';\n }\n\n unbind() {\n if (!this.element.attributes || !this.element.attributes.unbinding) {\n const type = this.options && this.options.template && this.options.template.v;\n if (type === 't0' || type === 't1') this.element.intro = null;\n if (type === 't0' || type === 't2') this.element.outro = null;\n }\n }\n\n unregisterCompleteHandler(fn) {\n removeFromArray(this.onComplete, fn);\n }\n}\n\nconst proto = Transition.prototype;\nproto.destroyed = proto.firstNode = proto.rebound = proto.render = proto.unrender = proto.update = noop;\n\nfunction nearestProp(prop, ractive, rendering) {\n let instance = ractive;\n while (instance) {\n if (\n hasOwn(instance, prop) &&\n (isUndefined(rendering) || rendering ? instance.rendering : instance.unrendering)\n )\n return instance[prop];\n instance = instance.component && instance.component.ractive;\n }\n\n return ractive[prop];\n}\n","import { svg } from 'config/namespaces';\nimport { createElement } from 'utils/dom';\n\nconst elementCache = {};\n\nlet ieBug;\nlet ieBlacklist;\n\ntry {\n createElement('table').innerHTML = 'foo';\n} catch (/* istanbul ignore next */ err) {\n ieBug = true;\n\n ieBlacklist = {\n TABLE: ['<table class=\"x\">', '</table>'],\n THEAD: ['<table><thead class=\"x\">', '</thead></table>'],\n TBODY: ['<table><tbody class=\"x\">', '</tbody></table>'],\n TR: ['<table><tr class=\"x\">', '</tr></table>'],\n SELECT: ['<select class=\"x\">', '</select>']\n };\n}\n\nexport default function(html, node) {\n const nodes = [];\n\n // render 0 and false\n if (html == null || html === '') return nodes;\n\n let container;\n let wrapper;\n let selectedOption;\n\n /* istanbul ignore if */\n if (ieBug && (wrapper = ieBlacklist[node.tagName])) {\n container = element('DIV');\n container.innerHTML = wrapper[0] + html + wrapper[1];\n container = container.querySelector('.x');\n\n if (container.tagName === 'SELECT') {\n selectedOption = container.options[container.selectedIndex];\n }\n } else if (node.namespaceURI === svg) {\n container = element('DIV');\n container.innerHTML = '<svg class=\"x\">' + html + '</svg>';\n container = container.querySelector('.x');\n } else if (node.tagName === 'TEXTAREA') {\n container = createElement('div');\n\n if (typeof container.textContent !== 'undefined') {\n container.textContent = html;\n } else {\n container.innerHTML = html;\n }\n } else {\n container = element(node.tagName);\n container.innerHTML = html;\n\n if (container.tagName === 'SELECT') {\n selectedOption = container.options[container.selectedIndex];\n }\n }\n\n let child;\n while ((child = container.firstChild)) {\n nodes.push(child);\n container.removeChild(child);\n }\n\n // This is really annoying. Extracting <option> nodes from the\n // temporary container <select> causes the remaining ones to\n // become selected. So now we have to deselect them. IE8, you\n // amaze me. You really do\n // ...and now Chrome too\n let i;\n if (node.tagName === 'SELECT') {\n i = nodes.length;\n while (i--) {\n if (nodes[i] !== selectedOption) {\n nodes[i].selected = false;\n }\n }\n }\n\n return nodes;\n}\n\nfunction element(tagName) {\n return elementCache[tagName] || (elementCache[tagName] = createElement(tagName));\n}\n","import { createDocumentFragment, matches } from 'utils/dom';\nimport { detachNode } from 'utils/dom';\nimport { decodeCharacterReferences } from 'utils/html';\nimport runloop from 'src/global/runloop';\nimport Mustache from './shared/Mustache';\nimport insertHtml from './triple/insertHtml';\nimport { inAttribute } from './element/Attribute';\n\nexport default class Triple extends Mustache {\n constructor(options) {\n super(options);\n }\n\n detach() {\n const docFrag = createDocumentFragment();\n if (this.nodes) this.nodes.forEach(node => docFrag.appendChild(node));\n return docFrag;\n }\n\n find(selector) {\n const len = this.nodes.length;\n let i;\n\n for (i = 0; i < len; i += 1) {\n const node = this.nodes[i];\n\n if (node.nodeType !== 1) continue;\n\n if (matches(node, selector)) return node;\n\n const queryResult = node.querySelector(selector);\n if (queryResult) return queryResult;\n }\n\n return null;\n }\n\n findAll(selector, options) {\n const { result } = options;\n const len = this.nodes.length;\n let i;\n\n for (i = 0; i < len; i += 1) {\n const node = this.nodes[i];\n\n if (node.nodeType !== 1) continue;\n\n if (matches(node, selector)) result.push(node);\n\n const queryAllResult = node.querySelectorAll(selector);\n if (queryAllResult) {\n result.push.apply(result, queryAllResult);\n }\n }\n }\n\n findComponent() {\n return null;\n }\n\n firstNode() {\n return this.rendered && this.nodes[0];\n }\n\n render(target, occupants, anchor) {\n if (!this.nodes) {\n const html = this.model ? this.model.get() : '';\n this.nodes = insertHtml(html, target);\n }\n\n let nodes = this.nodes;\n\n // progressive enhancement\n if (occupants) {\n let i = -1;\n let next;\n\n // start with the first node that should be rendered\n while (occupants.length && (next = this.nodes[i + 1])) {\n let n;\n // look through the occupants until a matching node is found\n while ((n = occupants.shift())) {\n const t = n.nodeType;\n\n if (\n t === next.nodeType &&\n ((t === 1 && n.outerHTML === next.outerHTML) ||\n ((t === 3 || t === 8) && n.nodeValue === next.nodeValue))\n ) {\n this.nodes.splice(++i, 1, n); // replace the generated node with the existing one\n break;\n } else {\n target.removeChild(n); // remove the non-matching existing node\n }\n }\n }\n\n if (i >= 0) {\n // update the list of remaining nodes to attach, excluding any that were replaced by existing nodes\n nodes = this.nodes.slice(i);\n }\n\n // update the anchor to be the next occupant\n if (occupants.length) anchor = occupants[0];\n }\n\n // attach any remainging nodes to the parent\n if (nodes.length) {\n const frag = createDocumentFragment();\n nodes.forEach(n => frag.appendChild(n));\n\n if (anchor) {\n target.insertBefore(frag, anchor);\n } else {\n target.appendChild(frag);\n }\n }\n\n this.rendered = true;\n }\n\n toString() {\n let value = this.model && this.model.get();\n value = value != null ? '' + value : '';\n\n return inAttribute() ? decodeCharacterReferences(value) : value;\n }\n\n unrender() {\n if (this.nodes)\n this.nodes.forEach(node => {\n // defer detachment until all relevant outros are done\n runloop.detachWhenReady({\n node,\n detach() {\n detachNode(node);\n }\n });\n });\n this.rendered = false;\n this.nodes = null;\n }\n\n update() {\n if (this.rendered && this.dirty) {\n this.dirty = false;\n\n this.unrender();\n this.render(this.up.findParentNode(), null, this.up.findNextNode(this));\n } else {\n // make sure to reset the dirty flag even if not rendered\n this.dirty = false;\n }\n }\n}\n","import {\n ALIAS,\n ANCHOR,\n AWAIT,\n COMMENT,\n COMPONENT,\n DOCTYPE,\n ELEMENT,\n INTERPOLATOR,\n PARTIAL,\n SECTION,\n TRIPLE,\n YIELDER\n} from 'config/types';\nimport { ATTRIBUTE, BINDING_FLAG, DECORATOR, EVENT, TRANSITION } from 'config/types';\nimport Attribute from './element/Attribute';\nimport BindingFlag from './element/BindingFlag';\nimport Comment from './Comment';\nimport Component from './Component';\nimport Decorator from './element/Decorator';\nimport Doctype from './Doctype';\nimport Form from './element/specials/Form';\nimport Element from './Element';\nimport EventDirective from './shared/EventDirective';\nimport Interpolator from './Interpolator';\nimport Input from './element/specials/Input';\nimport Mapping from './component/Mapping';\nimport Option from './element/specials/Option';\nimport Partial from './Partial';\nimport Section from './Section';\nimport Select from './element/specials/Select';\nimport Textarea from './element/specials/Textarea';\nimport Text from './Text';\nimport Transition from './element/Transition';\nimport Triple from './Triple';\nimport getComponentConstructor from './component/getComponentConstructor';\nimport findElement from './shared/findElement';\nimport { findInstance } from 'shared/registry';\nimport asyncProxy from './asyncProxy';\nimport Await from './Await';\nimport { isString, isFunction } from 'utils/is';\n\nconst constructors = {};\nconstructors[ALIAS] = Section;\nconstructors[ANCHOR] = Component;\nconstructors[AWAIT] = Await;\nconstructors[DOCTYPE] = Doctype;\nconstructors[INTERPOLATOR] = Interpolator;\nconstructors[PARTIAL] = Partial;\nconstructors[SECTION] = Section;\nconstructors[TRIPLE] = Triple;\nconstructors[YIELDER] = Partial;\n\nconstructors[ATTRIBUTE] = Attribute;\nconstructors[BINDING_FLAG] = BindingFlag;\nconstructors[DECORATOR] = Decorator;\nconstructors[EVENT] = EventDirective;\nconstructors[TRANSITION] = Transition;\nconstructors[COMMENT] = Comment;\n\nconst specialElements = {\n doctype: Doctype,\n form: Form,\n input: Input,\n option: Option,\n select: Select,\n textarea: Textarea\n};\n\nexport default function createItem(options) {\n if (isString(options.template)) {\n return new Text(options);\n }\n\n let ctor;\n let name;\n const type = options.template.t;\n\n if (type === ELEMENT) {\n name = options.template.e;\n\n // could be a macro partial\n ctor = findInstance('partials', options.up.ractive, name);\n if (ctor) {\n ctor = ctor.partials[name];\n if (ctor.styleSet) {\n options.macro = ctor;\n return new Partial(options);\n }\n }\n\n // could be component or element\n ctor = getComponentConstructor(options.up.ractive, name);\n if (ctor) {\n if (isFunction(ctor.then)) {\n return asyncProxy(ctor, options);\n } else if (isFunction(ctor)) {\n return new Component(options, ctor);\n }\n }\n\n ctor = specialElements[name.toLowerCase()] || Element;\n return new ctor(options);\n }\n\n let Item;\n\n // component mappings are a special case of attribute\n if (type === ATTRIBUTE) {\n let el = options.owner;\n if (!el || (el.type !== ANCHOR && el.type !== COMPONENT && el.type !== ELEMENT)) {\n el = findElement(options.up);\n }\n options.element = el;\n\n Item = el.type === COMPONENT || el.type === ANCHOR ? Mapping : Attribute;\n } else {\n Item = constructors[type];\n }\n\n if (!Item) throw new Error(`Unrecognised item type ${type}`);\n\n return new Item(options);\n}\n","import { removeFromArray } from 'utils/array';\nimport noop from 'utils/noop';\nimport { warnIfDebug } from 'utils/log';\nimport Model from 'src/model/Model';\nimport Computation from 'src/model/Computation';\nimport { startCapturing, stopCapturing } from 'src/global/capture';\nimport getFunction from 'shared/getFunction';\nimport { rebindMatch } from 'shared/rebind';\nimport resolveReference from './resolveReference';\n\nexport default class ExpressionProxy extends Model {\n constructor(fragment, template) {\n super(fragment.ractive.viewmodel, null);\n\n this.fragment = fragment;\n this.template = template;\n\n this.isReadonly = true;\n this.isComputed = true;\n this.dirty = true;\n\n this.fn =\n fragment.ractive.allowExpressions === false\n ? noop\n : getFunction(template.s, template.r.length);\n\n this.models = this.template.r.map(ref => {\n return resolveReference(this.fragment, ref);\n });\n this.dependencies = [];\n\n this.shuffle = undefined;\n\n this.bubble();\n }\n\n bubble(actuallyChanged = true) {\n // refresh the keypath\n this.keypath = undefined;\n\n if (actuallyChanged) {\n this.handleChange();\n }\n }\n\n getKeypath() {\n if (!this.template) return '@undefined';\n if (!this.keypath) {\n this.keypath =\n '@' +\n this.template.s.replace(/_(\\d+)/g, (match, i) => {\n if (i >= this.models.length) return match;\n\n const model = this.models[i];\n return model ? model.getKeypath() : '@undefined';\n });\n }\n\n return this.keypath;\n }\n\n getValue() {\n startCapturing();\n let result;\n\n try {\n const params = this.models.map(m => (m ? m.get(true) : undefined));\n result = this.fn.apply(this.fragment.ractive, params);\n } catch (err) {\n warnIfDebug(`Failed to compute ${this.getKeypath()}: ${err.message || err}`);\n }\n\n const dependencies = stopCapturing();\n // remove missing deps\n this.dependencies\n .filter(d => !~dependencies.indexOf(d))\n .forEach(d => {\n d.unregister(this);\n removeFromArray(this.dependencies, d);\n });\n // register new deps\n dependencies\n .filter(d => !~this.dependencies.indexOf(d))\n .forEach(d => {\n d.register(this);\n this.dependencies.push(d);\n });\n\n return result;\n }\n\n notifyUpstream() {}\n\n rebind(next, previous, safe) {\n const idx = this.models.indexOf(previous);\n\n if (~idx) {\n next = rebindMatch(this.template.r[idx], next, previous);\n if (next !== previous) {\n previous.unregister(this);\n this.models.splice(idx, 1, next);\n if (next) next.addShuffleRegister(this, 'mark');\n }\n }\n this.bubble(!safe);\n }\n\n rebound(update) {\n this.models = this.template.r.map(ref => resolveReference(this.fragment, ref));\n if (update) this.bubble(true);\n }\n\n retrieve() {\n return this.get();\n }\n\n teardown() {\n this.fragment = undefined;\n if (this.dependencies) this.dependencies.forEach(d => d.unregister(this));\n super.teardown();\n }\n\n unreference() {\n super.unreference();\n collect(this);\n }\n\n unregister(dep) {\n super.unregister(dep);\n collect(this);\n }\n\n unregisterLink(link) {\n super.unregisterLink(link);\n collect(this);\n }\n}\n\nconst prototype = ExpressionProxy.prototype;\nconst computation = Computation.prototype;\nprototype.get = computation.get;\nprototype.handleChange = computation.handleChange;\nprototype.joinKey = computation.joinKey;\nprototype.mark = computation.mark;\nprototype.unbind = noop;\n\nfunction collect(model) {\n if (!model.deps.length && !model.refs && !model.links.length) model.teardown();\n}\n","import { findInViewHierarchy } from 'shared/registry';\nimport { warnOnce } from 'utils/log';\nimport { missingPlugin } from 'config/errors';\nimport noop from 'utils/noop';\nimport runloop from 'src/global/runloop';\nimport findElement from '../shared/findElement';\nimport { setupArgsFn, teardownArgsFn } from '../shared/directiveArgs';\nimport Fragment from '../../Fragment';\nimport { localFragment } from 'src/shared/Context';\n\nconst missingDecorator = {\n update: noop,\n teardown: noop\n};\n\nexport default class Decorator {\n constructor(options) {\n this.owner = options.owner || options.up.owner || findElement(options.up);\n this.element = this.owner.attributeByName ? this.owner : findElement(options.up);\n this.up = options.up || this.owner.up;\n this.ractive = this.up.ractive || this.owner.ractive;\n const template = (this.template = options.template);\n\n this.name = template.n;\n\n this.node = null;\n this.handle = null;\n\n this.element.decorators.push(this);\n }\n\n bind() {\n // if the owner is the elment, make sure the context includes the element\n const frag = this.element === this.owner ? new Fragment({ owner: this.owner }) : this.up;\n setupArgsFn(this, this.template, frag, { register: true });\n }\n\n bubble() {\n if (!this.dirty) {\n this.dirty = true;\n // decorators may be owned directly by an element or by a fragment if conditional\n this.owner.bubble();\n this.up.bubble();\n }\n }\n\n destroyed() {\n if (this.handle) {\n this.handle.teardown();\n this.handle = null;\n }\n this.shouldDestroy = true;\n }\n\n handleChange() {\n this.bubble();\n }\n\n rebound(update) {\n if (this.model) this.model.rebound(update);\n }\n\n render() {\n this.shouldDestroy = false;\n if (this.handle) this.unrender();\n const ractive = this.ractive;\n runloop.scheduleTask(() => {\n // bail if the host element has managed to become unrendered\n if (!this.element.rendered) return;\n\n const fn = findInViewHierarchy('decorators', ractive, this.name);\n\n if (!fn) {\n warnOnce(missingPlugin(this.name, 'decorator'));\n this.handle = missingDecorator;\n return;\n }\n\n this.node = this.element.node;\n\n const args = this.model ? this.model.get() : [];\n localFragment.f = this.up;\n this.handle = fn.apply(ractive, [this.node].concat(args));\n localFragment.f = null;\n\n if (!this.handle || !this.handle.teardown) {\n throw new Error(\n `The '${this.name}' decorator must return an object with a teardown method`\n );\n }\n\n // watch out for decorators that cause their host element to be unrendered\n if (this.shouldDestroy) this.destroyed();\n }, true);\n }\n\n shuffled() {\n if (this.handle && this.handle.shuffled) this.handle.shuffled();\n }\n\n toString() {\n return '';\n }\n\n unbind() {\n teardownArgsFn(this, this.template);\n }\n\n unrender(shouldDestroy) {\n if ((!shouldDestroy || this.element.rendered) && this.handle) {\n this.handle.teardown();\n this.handle = null;\n }\n }\n\n update() {\n const instance = this.handle;\n\n if (!this.dirty) {\n if (instance && instance.invalidate) {\n runloop.scheduleTask(() => instance.invalidate(), true);\n }\n return;\n }\n\n this.dirty = false;\n\n if (instance) {\n if (!instance.update) {\n this.unrender();\n this.render();\n } else {\n const args = this.model ? this.model.get() : [];\n instance.update.apply(this.ractive, args);\n }\n }\n }\n}\n\nDecorator.prototype.firstNode = noop;\n","import noop from 'utils/noop';\nimport Item from './shared/Item';\n\nexport default class Doctype extends Item {\n toString() {\n return '<!DOCTYPE' + this.template.a + '>';\n }\n}\n\nconst proto = Doctype.prototype;\nproto.bind = proto.render = proto.teardown = proto.unbind = proto.unrender = proto.update = noop;\n","import runloop from 'src/global/runloop';\nimport { warnOnceIfDebug } from 'utils/log';\nimport noop from 'utils/noop';\nimport findElement from '../../shared/findElement';\nimport { isUndefined } from 'utils/is';\n\nexport default class Binding {\n constructor(element, name = 'value') {\n this.element = element;\n this.ractive = element.ractive;\n this.attribute = element.attributeByName[name];\n\n const interpolator = this.attribute.interpolator;\n interpolator.twowayBinding = this;\n\n const model = interpolator.model;\n\n if (model.isReadonly && !model.setRoot) {\n const keypath = model.getKeypath().replace(/^@/, '');\n warnOnceIfDebug(\n `Cannot use two-way binding on <${\n element.name\n }> element: ${keypath} is read-only. To suppress this warning use <${\n element.name\n } twoway='false'...>`,\n { ractive: this.ractive }\n );\n return false;\n }\n\n this.attribute.isTwoway = true;\n this.model = model;\n\n // initialise value, if it's undefined\n let value = model.get();\n this.wasUndefined = isUndefined(value);\n\n if (isUndefined(value) && this.getInitialValue) {\n value = this.getInitialValue();\n model.set(value);\n }\n this.lastVal(true, value);\n\n const parentForm = findElement(this.element, false, 'form');\n if (parentForm) {\n this.resetValue = value;\n parentForm.formBindings.push(this);\n }\n }\n\n bind() {\n this.model.registerTwowayBinding(this);\n }\n\n handleChange() {\n const value = this.getValue();\n if (this.lastVal() === value) return;\n\n runloop.start();\n this.attribute.locked = true;\n this.model.set(value);\n this.lastVal(true, value);\n\n // if the value changes before observers fire, unlock to be updatable cause something weird and potentially freezy is up\n if (this.model.get() !== value) this.attribute.locked = false;\n else runloop.scheduleTask(() => (this.attribute.locked = false));\n\n runloop.end();\n }\n\n lastVal(setting, value) {\n if (setting) this.lastValue = value;\n else return this.lastValue;\n }\n\n rebind(next, previous) {\n if (this.model && this.model === previous) previous.unregisterTwowayBinding(this);\n if (next) {\n this.model = next;\n runloop.scheduleTask(() => next.registerTwowayBinding(this));\n }\n }\n\n rebound() {\n if (this.model) this.model.unregisterTwowayBinding(this);\n this.model = this.attribute.interpolator.model;\n this.model && this.model.registerTwowayBinding(this);\n }\n\n render() {\n this.node = this.element.node;\n this.node._ractive.binding = this;\n this.rendered = true; // TODO is this used anywhere?\n }\n\n setFromNode(node) {\n this.model.set(node.value);\n }\n\n unbind() {\n this.model && this.model.unregisterTwowayBinding(this);\n }\n}\n\nBinding.prototype.unrender = noop;\n","import Binding from './Binding';\nimport handleDomEvent from './handleDomEvent';\n\nexport default class CheckboxBinding extends Binding {\n constructor(element) {\n super(element, 'checked');\n }\n\n render() {\n super.render();\n\n this.element.on('change', handleDomEvent);\n\n if (this.node.attachEvent) {\n this.element.on('click', handleDomEvent);\n }\n }\n\n unrender() {\n this.element.off('change', handleDomEvent);\n\n if (this.node.attachEvent) {\n this.element.off('click', handleDomEvent);\n }\n }\n\n getInitialValue() {\n return !!this.element.getAttribute('checked');\n }\n\n getValue() {\n return this.node.checked;\n }\n\n setFromNode(node) {\n this.model.set(node.checked);\n }\n}\n","import { removeFromArray } from 'utils/array';\nimport Binding from './Binding';\n\nexport default function getBindingGroup(group, model, getValue) {\n const hash = `${group}-bindingGroup`;\n return model[hash] || (model[hash] = new BindingGroup(hash, model, getValue));\n}\n\nclass BindingGroup {\n constructor(hash, model, getValue) {\n this.model = model;\n this.hash = hash;\n this.getValue = () => {\n this.value = getValue.call(this);\n return this.value;\n };\n\n this.bindings = [];\n }\n\n add(binding) {\n this.bindings.push(binding);\n }\n\n bind() {\n this.value = this.model.get();\n this.bindings.forEach(b => b.lastVal(true, this.value));\n this.model.registerTwowayBinding(this);\n this.bound = true;\n }\n\n remove(binding) {\n removeFromArray(this.bindings, binding);\n if (!this.bindings.length) {\n this.unbind();\n }\n }\n\n unbind() {\n this.model.unregisterTwowayBinding(this);\n this.bound = false;\n delete this.model[this.hash];\n }\n}\n\nBindingGroup.prototype.rebind = Binding.prototype.rebind;\n","import Binding from './Binding';\nimport getBindingGroup from './getBindingGroup';\nimport handleDomEvent from './handleDomEvent';\nimport { isArray } from 'utils/is';\n\nconst push = [].push;\n\nfunction getValue() {\n const all = this.bindings\n .filter(b => b.node && b.node.checked)\n .map(b => b.element.getAttribute('value'));\n const res = [];\n all.forEach(v => {\n if (!this.bindings[0].arrayContains(res, v)) res.push(v);\n });\n return res;\n}\n\nexport default class CheckboxNameBinding extends Binding {\n constructor(element) {\n super(element, 'name');\n\n this.checkboxName = true; // so that ractive.updateModel() knows what to do with this\n\n // Each input has a reference to an array containing it and its\n // group, as two-way binding depends on being able to ascertain\n // the status of all inputs within the group\n this.group = getBindingGroup('checkboxes', this.model, getValue);\n this.group.add(this);\n\n if (this.noInitialValue) {\n this.group.noInitialValue = true;\n }\n\n // If no initial value was set, and this input is checked, we\n // update the model\n if (this.group.noInitialValue && this.element.getAttribute('checked')) {\n const existingValue = this.model.get();\n const bindingValue = this.element.getAttribute('value');\n\n if (!this.arrayContains(existingValue, bindingValue)) {\n push.call(existingValue, bindingValue); // to avoid triggering runloop with array adaptor\n }\n }\n }\n\n bind() {\n if (!this.group.bound) {\n this.group.bind();\n }\n }\n\n getInitialValue() {\n // This only gets called once per group (of inputs that\n // share a name), because it only gets called if there\n // isn't an initial value. By the same token, we can make\n // a note of that fact that there was no initial value,\n // and populate it using any `checked` attributes that\n // exist (which users should avoid, but which we should\n // support anyway to avoid breaking expectations)\n this.noInitialValue = true; // TODO are noInitialValue and wasUndefined the same thing?\n return [];\n }\n\n getValue() {\n return this.group.value;\n }\n\n handleChange() {\n this.isChecked = this.element.node.checked;\n const mval = this.model.get();\n this.group.value = mval === undefined ? [] : mval.slice();\n const value = this.element.getAttribute('value');\n if (this.isChecked && !this.arrayContains(this.group.value, value)) {\n this.group.value.push(value);\n } else if (!this.isChecked && this.arrayContains(this.group.value, value)) {\n this.removeFromArray(this.group.value, value);\n }\n // make sure super knows there's a change\n this.lastValue = null;\n super.handleChange();\n }\n\n render() {\n super.render();\n\n const node = this.node;\n\n const existingValue = this.model.get();\n const bindingValue = this.element.getAttribute('value');\n\n if (isArray(existingValue)) {\n this.isChecked = this.arrayContains(existingValue, bindingValue);\n } else {\n this.isChecked = this.element.compare(existingValue, bindingValue);\n }\n node.name = '{{' + this.model.getKeypath() + '}}';\n node.checked = this.isChecked;\n\n this.element.on('change', handleDomEvent);\n\n // in case of IE emergency, bind to click event as well\n if (this.node.attachEvent) {\n this.element.on('click', handleDomEvent);\n }\n }\n\n setFromNode(node) {\n this.group.bindings.forEach(binding => (binding.wasUndefined = true));\n\n if (node.checked) {\n const valueSoFar = this.group.getValue();\n valueSoFar.push(this.element.getAttribute('value'));\n\n this.group.model.set(valueSoFar);\n }\n }\n\n unbind() {\n this.group.remove(this);\n }\n\n unrender() {\n const el = this.element;\n\n el.off('change', handleDomEvent);\n\n if (this.node.attachEvent) {\n el.off('click', handleDomEvent);\n }\n }\n\n arrayContains(selectValue, optionValue) {\n let i = selectValue.length;\n while (i--) {\n if (this.element.compare(optionValue, selectValue[i])) return true;\n }\n return false;\n }\n\n removeFromArray(array, item) {\n if (!array) return;\n let i = array.length;\n while (i--) {\n if (this.element.compare(item, array[i])) {\n array.splice(i, 1);\n }\n }\n }\n}\n","import Binding from './Binding';\nimport handleDomEvent from './handleDomEvent';\n\nexport default class ContentEditableBinding extends Binding {\n getInitialValue() {\n return this.element.fragment ? this.element.fragment.toString() : '';\n }\n\n getValue() {\n return this.element.node.innerHTML;\n }\n\n render() {\n super.render();\n\n const el = this.element;\n\n el.on('change', handleDomEvent);\n el.on('blur', handleDomEvent);\n\n if (!this.ractive.lazy) {\n el.on('input', handleDomEvent);\n\n if (this.node.attachEvent) {\n el.on('keyup', handleDomEvent);\n }\n }\n }\n\n setFromNode(node) {\n this.model.set(node.innerHTML);\n }\n\n unrender() {\n const el = this.element;\n\n el.off('blur', handleDomEvent);\n el.off('change', handleDomEvent);\n el.off('input', handleDomEvent);\n el.off('keyup', handleDomEvent);\n }\n}\n","import { isNumeric } from 'utils/is';\nimport Binding from './Binding';\nimport handleDomEvent from './handleDomEvent';\n\nfunction handleBlur() {\n handleDomEvent.call(this);\n\n const value = this._ractive.binding.model.get();\n this.value = value == undefined ? '' : value;\n}\n\nfunction handleDelay(delay) {\n let timeout;\n\n return function() {\n if (timeout) clearTimeout(timeout);\n\n timeout = setTimeout(() => {\n const binding = this._ractive.binding;\n if (binding.rendered) handleDomEvent.call(this);\n timeout = null;\n }, delay);\n };\n}\n\nexport default class GenericBinding extends Binding {\n getInitialValue() {\n return '';\n }\n\n getValue() {\n return this.node.value;\n }\n\n render() {\n super.render();\n\n // any lazy setting for this element overrides the root\n // if the value is a number, it's a timeout\n let lazy = this.ractive.lazy;\n let timeout = false;\n const el = this.element;\n\n if ('lazy' in this.element) {\n lazy = this.element.lazy;\n }\n\n if (isNumeric(lazy)) {\n timeout = +lazy;\n lazy = false;\n }\n\n this.handler = timeout ? handleDelay(timeout) : handleDomEvent;\n\n const node = this.node;\n\n el.on('change', handleDomEvent);\n\n if (node.type !== 'file') {\n if (!lazy) {\n el.on('input', this.handler);\n\n // IE is a special snowflake\n if (node.attachEvent) {\n el.on('keyup', this.handler);\n }\n }\n\n el.on('blur', handleBlur);\n }\n }\n\n unrender() {\n const el = this.element;\n this.rendered = false;\n\n el.off('change', handleDomEvent);\n el.off('input', this.handler);\n el.off('keyup', this.handler);\n el.off('blur', handleBlur);\n }\n}\n","import GenericBinding from './GenericBinding';\n\nexport default class FileBinding extends GenericBinding {\n getInitialValue() {\n /* istanbul ignore next */\n return undefined;\n }\n\n getValue() {\n /* istanbul ignore next */\n return this.node.files;\n }\n\n render() {\n /* istanbul ignore next */\n this.element.lazy = false;\n /* istanbul ignore next */\n super.render();\n }\n\n setFromNode(node) {\n /* istanbul ignore next */\n this.model.set(node.files);\n }\n}\n","import { arrayContentsMatch } from 'utils/array';\nimport getSelectedOptions from 'utils/getSelectedOptions';\nimport Binding from './Binding';\nimport handleDomEvent from './handleDomEvent';\nimport { isUndefined } from 'utils/is';\n\nexport default class MultipleSelectBinding extends Binding {\n getInitialValue() {\n return this.element.options\n .filter(option => option.getAttribute('selected'))\n .map(option => option.getAttribute('value'));\n }\n\n getValue() {\n const options = this.element.node.options;\n const len = options.length;\n\n const selectedValues = [];\n\n for (let i = 0; i < len; i += 1) {\n const option = options[i];\n\n if (option.selected) {\n const optionValue = option._ractive ? option._ractive.value : option.value;\n selectedValues.push(optionValue);\n }\n }\n\n return selectedValues;\n }\n\n handleChange() {\n const attribute = this.attribute;\n const previousValue = attribute.getValue();\n\n const value = this.getValue();\n\n if (isUndefined(previousValue) || !arrayContentsMatch(value, previousValue)) {\n super.handleChange();\n }\n\n return this;\n }\n\n render() {\n super.render();\n\n this.element.on('change', handleDomEvent);\n\n if (isUndefined(this.model.get())) {\n // get value from DOM, if possible\n this.handleChange();\n }\n }\n\n setFromNode(node) {\n const selectedOptions = getSelectedOptions(node);\n let i = selectedOptions.length;\n const result = new Array(i);\n\n while (i--) {\n const option = selectedOptions[i];\n result[i] = option._ractive ? option._ractive.value : option.value;\n }\n\n this.model.set(result);\n }\n\n unrender() {\n this.element.off('change', handleDomEvent);\n }\n}\n","import GenericBinding from './GenericBinding';\n\nexport default class NumericBinding extends GenericBinding {\n getInitialValue() {\n return undefined;\n }\n\n getValue() {\n const value = parseFloat(this.node.value);\n return isNaN(value) ? undefined : value;\n }\n\n setFromNode(node) {\n const value = parseFloat(node.value);\n if (!isNaN(value)) this.model.set(value);\n }\n}\n","import runloop from 'src/global/runloop';\nimport { removeFromArray } from 'utils/array';\nimport Binding from './Binding';\nimport handleDomEvent from './handleDomEvent';\n\nconst siblings = {};\n\nfunction getSiblings(hash) {\n return siblings[hash] || (siblings[hash] = []);\n}\n\nexport default class RadioBinding extends Binding {\n constructor(element) {\n super(element, 'checked');\n\n this.siblings = getSiblings(this.ractive._guid + this.element.getAttribute('name'));\n this.siblings.push(this);\n }\n\n getValue() {\n return this.node.checked;\n }\n\n handleChange() {\n runloop.start();\n\n this.siblings.forEach(binding => {\n binding.model.set(binding.getValue());\n });\n\n runloop.end();\n }\n\n render() {\n super.render();\n\n this.element.on('change', handleDomEvent);\n\n if (this.node.attachEvent) {\n this.element.on('click', handleDomEvent);\n }\n }\n\n setFromNode(node) {\n this.model.set(node.checked);\n }\n\n unbind() {\n removeFromArray(this.siblings, this);\n }\n\n unrender() {\n this.element.off('change', handleDomEvent);\n\n if (this.node.attachEvent) {\n this.element.off('click', handleDomEvent);\n }\n }\n}\n","import Binding from './Binding';\nimport getBindingGroup from './getBindingGroup';\nimport handleDomEvent from './handleDomEvent';\n\nfunction getValue() {\n const checked = this.bindings.filter(b => b.node.checked);\n if (checked.length > 0) {\n return checked[0].element.getAttribute('value');\n }\n}\n\nexport default class RadioNameBinding extends Binding {\n constructor(element) {\n super(element, 'name');\n\n this.group = getBindingGroup('radioname', this.model, getValue);\n this.group.add(this);\n\n if (element.checked) {\n this.group.value = this.getValue();\n }\n\n this.attribute.interpolator.pathChanged = () => this.updateName();\n }\n\n bind() {\n if (!this.group.bound) {\n this.group.bind();\n }\n }\n\n getInitialValue() {\n if (this.element.getAttribute('checked')) {\n return this.element.getAttribute('value');\n }\n }\n\n getValue() {\n return this.element.getAttribute('value');\n }\n\n handleChange() {\n // If this <input> is the one that's checked, then the value of its\n // `name` model gets set to its value\n if (this.node.checked) {\n this.group.value = this.getValue();\n super.handleChange();\n }\n\n this.updateName();\n }\n\n lastVal(setting, value) {\n if (!this.group) return;\n if (setting) this.group.lastValue = value;\n else return this.group.lastValue;\n }\n\n rebind(next, previous) {\n super.rebind(next, previous);\n this.updateName();\n }\n\n rebound(update) {\n super.rebound(update);\n this.updateName();\n }\n\n render() {\n super.render();\n\n const node = this.node;\n\n this.updateName();\n node.checked = this.element.compare(this.model.get(), this.element.getAttribute('value'));\n\n this.element.on('change', handleDomEvent);\n\n if (node.attachEvent) {\n this.element.on('click', handleDomEvent);\n }\n }\n\n setFromNode(node) {\n if (node.checked) {\n this.group.model.set(this.element.getAttribute('value'));\n }\n }\n\n unbind() {\n this.group.remove(this);\n }\n\n unrender() {\n const el = this.element;\n\n el.off('change', handleDomEvent);\n\n if (this.node.attachEvent) {\n el.off('click', handleDomEvent);\n }\n }\n\n updateName() {\n if (this.node) this.node.name = `{{${this.model.getKeypath()}}}`;\n }\n}\n","import runloop from 'src/global/runloop';\nimport getSelectedOptions from 'utils/getSelectedOptions';\nimport Binding from './Binding';\nimport handleDomEvent from './handleDomEvent';\n\nexport default class SingleSelectBinding extends Binding {\n forceUpdate() {\n const value = this.getValue();\n\n if (value !== undefined) {\n this.attribute.locked = true;\n runloop.scheduleTask(() => (this.attribute.locked = false));\n this.model.set(value);\n }\n }\n\n getInitialValue() {\n if (this.element.getAttribute('value') !== undefined) {\n return;\n }\n\n const options = this.element.options;\n const len = options.length;\n\n if (!len) return;\n\n let value;\n let optionWasSelected;\n let i = len;\n\n // take the final selected option...\n while (i--) {\n const option = options[i];\n\n if (option.getAttribute('selected')) {\n if (!option.getAttribute('disabled')) {\n value = option.getAttribute('value');\n }\n\n optionWasSelected = true;\n break;\n }\n }\n\n // or the first non-disabled option, if none are selected\n if (!optionWasSelected) {\n while (++i < len) {\n if (!options[i].getAttribute('disabled')) {\n value = options[i].getAttribute('value');\n break;\n }\n }\n }\n\n // This is an optimisation (aka hack) that allows us to forgo some\n // other more expensive work\n // TODO does it still work? seems at odds with new architecture\n if (value !== undefined) {\n this.element.attributeByName.value.value = value;\n }\n\n return value;\n }\n\n getValue() {\n const options = this.node.options;\n const len = options.length;\n\n let i;\n for (i = 0; i < len; i += 1) {\n const option = options[i];\n\n if (options[i].selected && !options[i].disabled) {\n return option._ractive ? option._ractive.value : option.value;\n }\n }\n }\n\n render() {\n super.render();\n this.element.on('change', handleDomEvent);\n }\n\n setFromNode(node) {\n const option = getSelectedOptions(node)[0];\n this.model.set(option._ractive ? option._ractive.value : option.value);\n }\n\n unrender() {\n this.element.off('change', handleDomEvent);\n }\n}\n","import { ATTRIBUTE, BINDING_FLAG, DECORATOR, DELEGATE_FLAG, EVENT, TRANSITION } from 'config/types';\nimport { win } from 'config/environment';\nimport { html, svg } from 'config/namespaces';\nimport { toArray, addToArray, removeFromArray } from 'utils/array';\nimport { escapeHtml, voidElements } from 'utils/html';\nimport { createElement, detachNode, matches, safeAttributeString } from 'utils/dom';\nimport runloop from 'src/global/runloop';\nimport Context from 'shared/Context';\nimport { destroyed, shuffled } from 'shared/methodCallers';\nimport { ContainerItem } from './shared/Item';\nimport Fragment from '../Fragment';\nimport ConditionalAttribute from './element/ConditionalAttribute';\nimport createItem from './createItem';\nimport findElement from './shared/findElement';\nimport selectBinding from './element/binding/selectBinding';\nimport { assign, create, defineProperty, keys } from 'utils/object';\nimport { isString } from 'utils/is';\n\nconst endsWithSemi = /;\\s*$/;\n\nexport default class Element extends ContainerItem {\n constructor(options) {\n super(options);\n\n this.name = options.template.e.toLowerCase();\n\n // find parent element\n this.parent = findElement(this.up, false);\n\n if (this.parent && this.parent.name === 'option') {\n throw new Error(\n `An <option> element cannot contain other elements (encountered <${this.name}>)`\n );\n }\n\n this.decorators = [];\n\n // create attributes\n this.attributeByName = {};\n\n let attrs;\n let n, attr, val, cls, name, template, leftovers;\n\n const m = this.template.m;\n const len = (m && m.length) || 0;\n\n for (let i = 0; i < len; i++) {\n template = m[i];\n if (template.g) {\n (this.statics || (this.statics = {}))[template.n] = isString(template.f)\n ? template.f\n : template.n;\n } else {\n switch (template.t) {\n case ATTRIBUTE:\n case BINDING_FLAG:\n case DECORATOR:\n case EVENT:\n case TRANSITION:\n attr = createItem({\n owner: this,\n up: this.up,\n template\n });\n\n n = template.n;\n\n attrs = attrs || (attrs = this.attributes = []);\n\n if (n === 'value') val = attr;\n else if (n === 'name') name = attr;\n else if (n === 'class') cls = attr;\n else attrs.push(attr);\n\n break;\n\n case DELEGATE_FLAG:\n this.delegate = false;\n break;\n\n default:\n (leftovers || (leftovers = [])).push(template);\n break;\n }\n }\n }\n\n if (val) attrs.push(val);\n if (name) attrs.push(name);\n if (cls) attrs.unshift(cls);\n\n if (leftovers) {\n (attrs || (this.attributes = [])).push(\n new ConditionalAttribute({\n owner: this,\n up: this.up,\n template: leftovers\n })\n );\n\n // empty leftovers array\n leftovers = [];\n }\n\n // create children\n if (options.template.f && !options.deferContent) {\n this.fragment = new Fragment({\n template: options.template.f,\n owner: this,\n cssIds: null\n });\n }\n\n this.binding = null; // filled in later\n }\n\n bind() {\n const attrs = this.attributes;\n if (attrs) {\n attrs.binding = true;\n const len = attrs.length;\n for (let i = 0; i < len; i++) attrs[i].bind();\n attrs.binding = false;\n }\n\n if (this.fragment) this.fragment.bind();\n\n // create two-way binding if necessary\n if (!this.binding) this.recreateTwowayBinding();\n else this.binding.bind();\n }\n\n createTwowayBinding() {\n if ('twoway' in this ? this.twoway : this.ractive.twoway) {\n const Binding = selectBinding(this);\n if (Binding) {\n const binding = new Binding(this);\n if (binding && binding.model) return binding;\n }\n }\n }\n\n destroyed() {\n if (this.attributes) this.attributes.forEach(destroyed);\n if (this.fragment) this.fragment.destroyed();\n }\n\n detach() {\n // if this element is no longer rendered, the transitions are complete and the attributes can be torn down\n if (!this.rendered) this.destroyed();\n\n return detachNode(this.node);\n }\n\n find(selector, options) {\n if (this.node && matches(this.node, selector)) return this.node;\n if (this.fragment) {\n return this.fragment.find(selector, options);\n }\n }\n\n findAll(selector, options) {\n const { result } = options;\n\n if (matches(this.node, selector)) {\n result.push(this.node);\n }\n\n if (this.fragment) {\n this.fragment.findAll(selector, options);\n }\n }\n\n findNextNode() {\n return null;\n }\n\n firstNode() {\n return this.node;\n }\n\n getAttribute(name) {\n if (this.statics && name in this.statics) return this.statics[name];\n const attribute = this.attributeByName[name];\n return attribute ? attribute.getValue() : undefined;\n }\n\n getContext(...assigns) {\n if (this.fragment) return this.fragment.getContext(...assigns);\n\n if (!this.ctx) this.ctx = new Context(this.up, this);\n assigns.unshift(create(this.ctx));\n return assign.apply(null, assigns);\n }\n\n off(event, callback, capture = false) {\n const delegate = this.up.delegate;\n const ref = this.listeners && this.listeners[event];\n\n if (!ref) return;\n removeFromArray(ref, callback);\n\n if (delegate) {\n const listeners =\n (delegate.listeners || (delegate.listeners = [])) &&\n (delegate.listeners[event] || (delegate.listeners[event] = []));\n if (listeners.refs && !--listeners.refs) delegate.off(event, delegateHandler, true);\n } else if (this.rendered) {\n const n = this.node;\n const add = n.addEventListener;\n const rem = n.removeEventListener;\n\n if (!ref.length) {\n rem.call(n, event, handler, capture);\n } else if (ref.length && !ref.refs && capture) {\n rem.call(n, event, handler, true);\n add.call(n, event, handler, false);\n }\n }\n }\n\n on(event, callback, capture = false) {\n const delegate = this.up.delegate;\n const ref = (this.listeners || (this.listeners = {}))[event] || (this.listeners[event] = []);\n\n if (delegate) {\n const listeners =\n ((delegate.listeners || (delegate.listeners = [])) && delegate.listeners[event]) ||\n (delegate.listeners[event] = []);\n if (!listeners.refs) {\n listeners.refs = 0;\n delegate.on(event, delegateHandler, true);\n listeners.refs++;\n } else {\n listeners.refs++;\n }\n } else if (this.rendered) {\n const n = this.node;\n const add = n.addEventListener;\n const rem = n.removeEventListener;\n\n if (!ref.length) {\n add.call(n, event, handler, capture);\n } else if (ref.length && !ref.refs && capture) {\n rem.call(n, event, handler, false);\n add.call(n, event, handler, true);\n }\n }\n\n addToArray(this.listeners[event], callback);\n }\n\n recreateTwowayBinding() {\n if (this.binding) {\n this.binding.unbind();\n this.binding.unrender();\n }\n\n if ((this.binding = this.createTwowayBinding())) {\n this.binding.bind();\n if (this.rendered) this.binding.render();\n }\n }\n\n rebound(update) {\n super.rebound(update);\n if (this.attributes) this.attributes.forEach(x => x.rebound(update));\n if (this.binding) this.binding.rebound(update);\n }\n\n render(target, occupants) {\n // TODO determine correct namespace\n this.namespace = getNamespace(this);\n\n let node;\n let existing = false;\n\n if (occupants) {\n let n;\n while ((n = occupants.shift())) {\n if (\n n.nodeName.toUpperCase() === this.template.e.toUpperCase() &&\n n.namespaceURI === this.namespace\n ) {\n this.node = node = n;\n existing = true;\n break;\n } else {\n detachNode(n);\n }\n }\n }\n\n if (!existing && this.node) {\n node = this.node;\n target.appendChild(node);\n existing = true;\n }\n\n if (!node) {\n const name = this.template.e;\n node = createElement(\n this.namespace === html ? name.toLowerCase() : name,\n this.namespace,\n this.getAttribute('is')\n );\n this.node = node;\n }\n\n // tie the node to this vdom element\n defineProperty(node, '_ractive', {\n value: {\n proxy: this\n },\n configurable: true\n });\n\n if (this.statics) {\n keys(this.statics).forEach(k => {\n node.setAttribute(k, this.statics[k]);\n });\n }\n\n if (existing && this.foundNode) this.foundNode(node);\n\n // register intro before rendering content so children can find the intro\n const intro = this.intro;\n if (intro && intro.shouldFire('intro')) {\n intro.isIntro = true;\n intro.isOutro = false;\n runloop.registerTransition(intro);\n }\n\n if (this.fragment) {\n const children = existing ? toArray(node.childNodes) : undefined;\n\n this.fragment.render(node, children);\n\n // clean up leftover children\n if (children) {\n children.forEach(detachNode);\n }\n }\n\n if (existing) {\n // store initial values for two-way binding\n if (this.binding && this.binding.wasUndefined) this.binding.setFromNode(node);\n // remove unused attributes\n let i = node.attributes.length;\n while (i--) {\n const name = node.attributes[i].name;\n if (!(name in this.attributeByName) && (!this.statics || !(name in this.statics)))\n node.removeAttribute(name);\n }\n }\n\n // Is this a top-level node of a component? If so, we may need to add\n // a data-ractive-css attribute, for CSS encapsulation\n if (this.up.cssIds) {\n node.setAttribute('data-ractive-css', this.up.cssIds.map(x => `{${x}}`).join(' '));\n }\n\n if (this.attributes) {\n const len = this.attributes.length;\n for (let i = 0; i < len; i++) this.attributes[i].render();\n }\n if (this.binding) this.binding.render();\n\n if (!this.up.delegate && this.listeners) {\n const ls = this.listeners;\n for (const k in ls) {\n if (ls[k] && ls[k].length) this.node.addEventListener(k, handler, !!ls[k].refs);\n }\n }\n\n if (!existing) {\n target.appendChild(node);\n }\n\n this.rendered = true;\n }\n\n shuffled() {\n super.shuffled();\n this.decorators.forEach(shuffled);\n }\n\n toString() {\n const tagName = this.template.e;\n\n let attrs = (this.attributes && this.attributes.map(stringifyAttribute).join('')) || '';\n\n if (this.statics)\n keys(this.statics).forEach(\n k =>\n k !== 'class' &&\n k !== 'style' &&\n (attrs = ` ${k}=\"${safeAttributeString(this.statics[k])}\"` + attrs)\n );\n\n // Special case - selected options\n if (this.name === 'option' && this.isSelected()) {\n attrs += ' selected';\n }\n\n // Special case - two-way radio name bindings\n if (this.name === 'input' && inputIsCheckedRadio(this)) {\n attrs += ' checked';\n }\n\n // Special case style and class attributes and directives\n let style = this.statics ? this.statics.style : undefined;\n let cls = this.statics ? this.statics.class : undefined;\n this.attributes &&\n this.attributes.forEach(attr => {\n if (attr.name === 'class') {\n cls = (cls || '') + (cls ? ' ' : '') + safeAttributeString(attr.getString());\n } else if (attr.name === 'style') {\n style = (style || '') + (style ? ' ' : '') + safeAttributeString(attr.getString());\n if (style && !endsWithSemi.test(style)) style += ';';\n } else if (attr.style) {\n style =\n (style || '') +\n (style ? ' ' : '') +\n `${attr.style}: ${safeAttributeString(attr.getString())};`;\n } else if (attr.inlineClass && attr.getValue()) {\n cls = (cls || '') + (cls ? ' ' : '') + attr.inlineClass;\n }\n });\n // put classes first, then inline style\n if (style !== undefined) attrs = ' style' + (style ? `=\"${style}\"` : '') + attrs;\n if (cls !== undefined) attrs = ' class' + (cls ? `=\"${cls}\"` : '') + attrs;\n\n if (this.up.cssIds) {\n attrs += ` data-ractive-css=\"${this.up.cssIds.map(x => `{${x}}`).join(' ')}\"`;\n }\n\n let str = `<${tagName}${attrs}>`;\n\n if (voidElements[this.name.toLowerCase()]) return str;\n\n // Special case - textarea\n if (this.name === 'textarea' && this.getAttribute('value') !== undefined) {\n str += escapeHtml(this.getAttribute('value'));\n } else if (this.getAttribute('contenteditable') !== undefined) {\n // Special case - contenteditable\n str += this.getAttribute('value') || '';\n }\n\n if (this.fragment) {\n str += this.fragment.toString(!/^(?:script|style)$/i.test(this.template.e)); // escape text unless script/style\n }\n\n str += `</${tagName}>`;\n return str;\n }\n\n unbind(view) {\n const attrs = this.attributes;\n if (attrs) {\n attrs.unbinding = true;\n const len = attrs.length;\n for (let i = 0; i < len; i++) attrs[i].unbind(view);\n attrs.unbinding = false;\n }\n\n if (this.binding) this.binding.unbind(view);\n if (this.fragment) this.fragment.unbind(view);\n }\n\n unrender(shouldDestroy) {\n if (!this.rendered) return;\n this.rendered = false;\n\n // unrendering before intro completed? complete it now\n // TODO should be an API for aborting transitions\n const transition = this.intro;\n if (transition && transition.complete) transition.complete();\n\n // Detach as soon as we can\n if (this.name === 'option') {\n // <option> elements detach immediately, so that\n // their parent <select> element syncs correctly, and\n // since option elements can't have transitions anyway\n this.detach();\n } else if (shouldDestroy) {\n runloop.detachWhenReady(this);\n }\n\n // outro transition\n const outro = this.outro;\n if (outro && outro.shouldFire('outro')) {\n outro.isIntro = false;\n outro.isOutro = true;\n runloop.registerTransition(outro);\n }\n\n if (this.fragment) this.fragment.unrender();\n\n if (this.binding) this.binding.unrender();\n }\n\n update() {\n if (this.dirty) {\n this.dirty = false;\n\n const attrs = this.attributes;\n if (attrs) {\n const len = attrs.length;\n for (let i = 0; i < len; i++) attrs[i].update();\n }\n\n if (this.fragment) this.fragment.update();\n }\n }\n}\n\nfunction inputIsCheckedRadio(element) {\n const nameAttr = element.attributeByName.name;\n return (\n element.getAttribute('type') === 'radio' &&\n (nameAttr || {}).interpolator &&\n element.getAttribute('value') === nameAttr.interpolator.model.get()\n );\n}\n\nfunction stringifyAttribute(attribute) {\n const str = attribute.toString();\n return str ? ' ' + str : '';\n}\n\nfunction getNamespace(element) {\n // Use specified namespace...\n const xmlns = element.getAttribute('xmlns');\n if (xmlns) return xmlns;\n\n // ...or SVG namespace, if this is an <svg> element\n if (element.name === 'svg') return svg;\n\n const parent = element.parent;\n\n if (parent) {\n // ...or HTML, if the parent is a <foreignObject>\n if (parent.name === 'foreignobject') return html;\n\n // ...or inherit from the parent node\n return parent.node.namespaceURI;\n }\n\n return element.ractive.el.namespaceURI;\n}\n\nlet stop = false;\nfunction stopPropagation() {\n stop = true;\n}\nlet immediate = false;\nfunction stopImmediatePropagation() {\n immediate = true;\n}\nlet prevent = false;\nfunction preventDefault() {\n prevent = true;\n}\n\nfunction delegateHandler(ev) {\n const name = ev.type;\n const end = ev.currentTarget;\n const endEl = end._ractive && end._ractive.proxy;\n let node = ev.target;\n let bubble = true;\n let listeners;\n let prevented = false;\n\n stop = immediate = prevent = false;\n const oldStop = ev.stopPropagation;\n const oldImmediate = ev.stopImmediatePropagation;\n const oldPrevent = ev.preventDefault;\n ev.stopPropagation = stopPropagation;\n ev.stopImmediatePropagation = stopImmediatePropagation;\n ev.preventDefault = preventDefault;\n\n // starting with the origin node, walk up the DOM looking for ractive nodes with a matching event listener\n while (bubble && node && node !== end) {\n const proxy = node._ractive && node._ractive.proxy;\n if (proxy && proxy.up.delegate === endEl && shouldFire(ev, node, end)) {\n listeners = proxy.listeners && proxy.listeners[name];\n\n if (listeners) {\n const len = listeners.length;\n for (let i = 0; i < len; i++) {\n bubble = listeners[i].call(node, ev) !== false && bubble;\n if (immediate) {\n bubble = false;\n break;\n }\n if (stop) bubble = false;\n if (prevent && !prevented) {\n prevented = true;\n oldPrevent.call(ev);\n }\n }\n }\n }\n\n node = node.parentNode || node.correspondingUseElement; // SVG with a <use> element in certain environments\n }\n\n if (bubble) bubble = !stop && !immediate;\n\n if (stop) oldStop.call(ev);\n if (immediate) oldImmediate.call(ev);\n\n ev.stopPropagation = oldStop;\n ev.stopImmediaitePropagation = oldImmediate;\n ev.preventDefault = oldPrevent;\n\n return bubble;\n}\n\nconst UIEvent = win !== null ? win.UIEvent : null;\nfunction shouldFire(event, start, end) {\n if (UIEvent && event instanceof UIEvent) {\n let node = start;\n while (node && node !== end) {\n if (node.disabled) return false;\n node = node.parentNode || node.correspondingUseElement;\n }\n }\n\n return true;\n}\n\nfunction handler(ev) {\n const el = this._ractive.proxy;\n let listeners;\n if (el.listeners && (listeners = el.listeners[ev.type])) {\n const len = listeners.length;\n for (let i = 0; i < len; i++) listeners[i] && listeners[i].call(this, ev);\n }\n}\n","import runloop from 'src/global/runloop';\nimport Element from '../../Element';\n\nexport default class Form extends Element {\n constructor(options) {\n super(options);\n this.formBindings = [];\n }\n\n render(target, occupants) {\n super.render(target, occupants);\n this.on('reset', handleReset);\n }\n\n unrender(shouldDestroy) {\n this.off('reset', handleReset);\n super.unrender(shouldDestroy);\n }\n}\n\nfunction handleReset() {\n const element = this._ractive.proxy;\n\n runloop.start();\n element.formBindings.forEach(updateModel);\n runloop.end();\n}\n\nfunction updateModel(binding) {\n binding.model.set(binding.resetValue);\n}\n","import { fatal } from 'utils/log';\nimport runloop from 'src/global/runloop';\nimport { localFragment } from 'src/shared/Context';\n\nclass DOMEvent {\n constructor(name, owner) {\n if (name.indexOf('*') !== -1) {\n fatal(\n `Only component proxy-events may contain \"*\" wildcards, <${\n owner.name\n } on-${name}=\"...\"/> is not valid`\n );\n }\n\n this.name = name;\n this.owner = owner;\n this.handler = null;\n }\n\n bind() {}\n\n render(directive) {\n const name = this.name;\n\n const register = () => {\n const node = this.owner.node;\n\n this.owner.on(\n name,\n (this.handler = event => {\n return directive.fire({\n node,\n original: event,\n event,\n name\n });\n })\n );\n };\n\n if (name !== 'load') {\n // schedule events so that they take place after twoway binding\n runloop.scheduleTask(register, true);\n } else {\n // unless its a load event\n register();\n }\n }\n\n unbind() {}\n\n unrender() {\n if (this.handler) this.owner.off(this.name, this.handler);\n }\n}\n\nclass CustomEvent {\n constructor(eventPlugin, owner, name, args) {\n this.eventPlugin = eventPlugin;\n this.owner = owner;\n this.name = name;\n this.handler = null;\n this.args = args;\n }\n\n bind() {}\n\n render(directive) {\n runloop.scheduleTask(() => {\n const node = this.owner.node;\n\n localFragment.f = directive.up;\n this.handler = this.eventPlugin.apply(\n this.owner.ractive,\n [\n node,\n (event = {}) => {\n if (event.original) event.event = event.original;\n else event.original = event.event;\n\n event.name = this.name;\n event.node = event.node || node;\n return directive.fire(event);\n }\n ].concat(this.args || [])\n );\n localFragment.f = null;\n });\n }\n\n unbind() {}\n\n unrender() {\n if (this.handler) this.handler.teardown();\n else runloop.scheduleTask(() => this.handler && this.handler.teardown());\n }\n}\n\nexport { DOMEvent, CustomEvent };\n","import Context from '../../../shared/Context';\n\nexport default class RactiveEvent {\n constructor(component, name) {\n this.component = component;\n this.name = name;\n this.handler = null;\n }\n\n bind(directive) {\n const ractive = this.component.instance;\n\n this.handler = ractive.on(this.name, (...args) => {\n // watch for reproxy\n if (args[0] instanceof Context) {\n const ctx = args.shift();\n ctx.component = ractive;\n directive.fire(ctx, args);\n } else {\n directive.fire({}, args);\n }\n\n // cancel bubbling\n return false;\n });\n }\n\n render() {}\n\n unbind() {\n this.handler.cancel();\n }\n\n unrender() {}\n}\n","import { ANCHOR, COMPONENT } from 'config/types';\nimport { warnIfDebug, warnOnceIfDebug } from 'utils/log';\nimport { addToArray, removeFromArray } from 'utils/array';\nimport noop from 'utils/noop';\nimport fireEvent from 'src/events/fireEvent';\nimport { splitKeypath } from 'shared/keypaths';\nimport { findInViewHierarchy } from 'shared/registry';\nimport findElement from './findElement';\nimport { DOMEvent, CustomEvent } from '../element/ElementEvents';\nimport RactiveEvent from '../component/RactiveEvent';\nimport { resolveArgs, setupArgsFn } from '../shared/directiveArgs';\nimport Context from 'src/shared/Context';\nimport { isArray, isString } from 'utils/is';\nimport getFunction from 'shared/getFunction';\nimport resolveReference from '../../resolvers/resolveReference';\n\nconst specialPattern = /^(event|arguments|@node|@event|@context)(\\..+)?$/;\nconst dollarArgsPattern = /^\\$(\\d+)(\\..+)?$/;\n\nexport default class EventDirective {\n constructor(options) {\n this.owner = options.owner || options.up.owner || findElement(options.up);\n this.element = this.owner.attributeByName ? this.owner : findElement(options.up, true);\n this.template = options.template;\n this.up = options.up;\n this.ractive = options.up.ractive;\n this.events = [];\n }\n\n bind() {\n // sometimes anchors will cause an unbind without unrender\n if (this.events.length) {\n this.events.forEach(e => e.unrender());\n this.events = [];\n }\n\n if (this.element.type === COMPONENT || this.element.type === ANCHOR) {\n this.template.n.forEach(n => {\n this.events.push(new RactiveEvent(this.element, n));\n });\n } else {\n let args;\n if ((args = this.template.a)) {\n const rs = args.r.map(r => {\n const model = resolveReference(this.up, r);\n return model ? model.get() : undefined;\n });\n try {\n args = getFunction(args.s, rs.length).apply(null, rs);\n } catch (err) {\n args = null;\n warnIfDebug(\n `Failed to compute args for event on-${this.template.n.join('- ')}: ${err.message ||\n err}`\n );\n }\n }\n\n this.template.n.forEach(n => {\n const fn = findInViewHierarchy('events', this.ractive, n);\n if (fn) {\n this.events.push(new CustomEvent(fn, this.element, n, args));\n } else {\n this.events.push(new DOMEvent(n, this.element));\n }\n });\n }\n\n // method calls\n this.models = null;\n\n addToArray(this.element.events || (this.element.events = []), this);\n\n setupArgsFn(this, this.template);\n if (!this.fn) this.action = this.template.f;\n\n this.events.forEach(e => e.bind(this));\n }\n\n destroyed() {\n this.events.forEach(e => e.unrender());\n }\n\n fire(event, args = []) {\n const context =\n event instanceof Context && event.refire ? event : this.element.getContext(event);\n\n if (this.fn) {\n const values = [];\n\n const models = resolveArgs(this, this.template, this.up, {\n specialRef(ref) {\n const specialMatch = specialPattern.exec(ref);\n if (specialMatch) {\n // on-click=\"foo(event.node)\"\n return {\n special: specialMatch[1],\n keys: specialMatch[2] ? splitKeypath(specialMatch[2].substr(1)) : []\n };\n }\n\n const dollarMatch = dollarArgsPattern.exec(ref);\n if (dollarMatch) {\n // on-click=\"foo($1)\"\n return {\n special: 'arguments',\n keys: [dollarMatch[1] - 1].concat(\n dollarMatch[2] ? splitKeypath(dollarMatch[2].substr(1)) : []\n )\n };\n }\n }\n });\n\n if (models) {\n models.forEach(model => {\n if (!model) return values.push(undefined);\n\n if (model.special) {\n const which = model.special;\n let obj;\n\n if (which === '@node') {\n obj = this.element.node;\n } else if (which === '@event') {\n obj = event && event.event;\n } else if (which === 'event') {\n warnOnceIfDebug(\n `The event reference available to event directives is deprecated and should be replaced with @context and @event`\n );\n obj = context;\n } else if (which === '@context') {\n obj = context;\n } else {\n obj = args;\n }\n\n const keys = model.keys.slice();\n\n while (obj && keys.length) obj = obj[keys.shift()];\n return values.push(obj);\n }\n\n if (model.wrapper) {\n return values.push(model.wrapperValue);\n }\n\n values.push(model.get());\n });\n }\n\n // make event available as `this.event`\n const ractive = this.ractive;\n const oldEvent = ractive.event;\n\n ractive.event = context;\n const returned = this.fn.apply(ractive, values);\n let result = returned.pop();\n\n // Auto prevent and stop if return is explicitly false\n if (result === false) {\n const original = event ? event.original : undefined;\n if (original) {\n original.preventDefault && original.preventDefault();\n original.stopPropagation && original.stopPropagation();\n } else {\n warnOnceIfDebug(\n `handler '${this.template.n.join(\n ' '\n )}' returned false, but there is no event available to cancel`\n );\n }\n } else if (!returned.length && isArray(result) && isString(result[0])) {\n // watch for proxy events\n result = fireEvent(this.ractive, result.shift(), context, result);\n }\n\n ractive.event = oldEvent;\n\n return result;\n } else {\n return fireEvent(this.ractive, this.action, context, args);\n }\n }\n\n handleChange() {}\n\n render() {\n this.events.forEach(e => e.render(this));\n }\n\n toString() {\n return '';\n }\n\n unbind(view) {\n removeFromArray(this.element.events, this);\n this.events.forEach(e => e.unbind(view));\n }\n\n unrender() {\n this.events.forEach(e => e.unrender());\n }\n}\n\nconst proto = EventDirective.prototype;\nproto.firstNode = proto.rebound = proto.update = noop;\n","import { fireShuffleTasks } from 'src/model/ModelBase';\nimport { REFERENCE } from 'config/types';\nimport { rebindMatch } from 'shared/rebind';\nimport { isArray, isString } from 'utils/is';\nimport { escapeKey } from 'shared/keypaths';\nimport ExpressionProxy from './ExpressionProxy';\nimport resolveReference from './resolveReference';\nimport resolve from './resolve';\n\nimport LinkModel, { Missing } from 'src/model/LinkModel';\n\nexport default class ReferenceExpressionProxy extends LinkModel {\n constructor(fragment, template) {\n super(null, null, null, '@undefined');\n this.root = fragment.ractive.viewmodel;\n this.template = template;\n this.rootLink = true;\n this.template = template;\n this.fragment = fragment;\n\n this.rebound();\n }\n\n getKeypath() {\n return this.model ? this.model.getKeypath() : '@undefined';\n }\n\n rebound() {\n const fragment = this.fragment;\n const template = this.template;\n\n let base = (this.base = resolve(fragment, template));\n let idx;\n\n if (this.proxy) {\n teardown(this);\n }\n\n const proxy = (this.proxy = {\n rebind: (next, previous) => {\n if (previous === base) {\n next = rebindMatch(template, next, previous);\n if (next !== base) {\n this.base = base = next;\n }\n } else if (~(idx = members.indexOf(previous))) {\n next = rebindMatch(template.m[idx].n, next, previous);\n if (next !== members[idx]) {\n members.splice(idx, 1, next || Missing);\n }\n }\n\n if (next !== previous) {\n previous.unregister(proxy);\n if (next) next.addShuffleTask(() => next.register(proxy));\n }\n },\n handleChange: () => {\n pathChanged();\n }\n });\n\n base.register(proxy);\n\n const members = (this.members = template.m.map(tpl => {\n if (isString(tpl)) {\n return { get: () => tpl };\n }\n\n let model;\n\n if (tpl.t === REFERENCE) {\n model = resolveReference(fragment, tpl.n);\n model.register(proxy);\n\n return model;\n }\n\n model = new ExpressionProxy(fragment, tpl);\n model.register(proxy);\n return model;\n }));\n\n const pathChanged = () => {\n const model =\n base &&\n base.joinAll(\n members.reduce((list, m) => {\n const k = m.get();\n if (isArray(k)) return list.concat(k);\n else list.push(escapeKey(String(k)));\n return list;\n }, [])\n );\n\n if (model !== this.model) {\n this.model = model;\n this.relinking(model);\n fireShuffleTasks();\n refreshPathDeps(this);\n this.fragment.shuffled();\n }\n };\n\n pathChanged();\n }\n\n teardown() {\n teardown(this);\n super.teardown();\n }\n\n unreference() {\n super.unreference();\n if (!this.deps.length && !this.refs) this.teardown();\n }\n\n unregister(dep) {\n super.unregister(dep);\n if (!this.deps.length && !this.refs) this.teardown();\n }\n}\n\nfunction teardown(proxy) {\n if (proxy.base) proxy.base.unregister(proxy.proxy);\n if (proxy.models) {\n proxy.models.forEach(m => {\n if (m.unregister) m.unregister(proxy);\n });\n }\n}\n\nfunction refreshPathDeps(proxy) {\n let len = proxy.deps.length;\n let i, v;\n\n for (i = 0; i < len; i++) {\n v = proxy.deps[i];\n if (v.pathChanged) v.pathChanged();\n if (v.fragment && v.fragment.pathModel) v.fragment.pathModel.applyValue(proxy.getKeypath());\n }\n\n len = proxy.children.length;\n for (i = 0; i < len; i++) {\n refreshPathDeps(proxy.children[i]);\n }\n}\n\nconst eproto = ExpressionProxy.prototype;\nconst proto = ReferenceExpressionProxy.prototype;\n\nproto.unreference = eproto.unreference;\nproto.unregister = eproto.unregister;\nproto.unregisterLink = eproto.unregisterLink;\n","import { rebindMatch } from 'shared/rebind';\nimport Item, { ContainerItem } from './Item';\nimport resolve from '../../resolvers/resolve';\nimport { assign } from 'utils/object';\n\nexport default class Mustache extends Item {\n constructor(options) {\n super(options);\n\n if (options.owner) this.parent = options.owner;\n\n this.isStatic = !!options.template.s;\n\n this.model = null;\n this.dirty = false;\n }\n\n bind(pre) {\n // yield mustaches and inner contexts should resolve in container context\n const start = this.template.y\n ? this.template.y.containerFragment\n : this.containerFragment || this.up;\n // try to find a model for this view\n const model = pre || resolve(start, this.template);\n\n if (model) {\n const value = model.get();\n\n if (this.isStatic) {\n this.model = { get: () => value };\n model.unreference();\n return;\n }\n\n model.register(this);\n this.model = model;\n }\n }\n\n handleChange() {\n this.bubble();\n }\n\n rebind(next, previous, safe) {\n if (this.isStatic) return;\n\n next = rebindMatch(this.template, next, previous, this.up);\n if (next === this.model) return false;\n\n if (this.model) {\n this.model.unregister(this);\n }\n if (next) next.addShuffleRegister(this, 'mark');\n this.model = next;\n if (!safe) this.handleChange();\n return true;\n }\n\n rebound(update) {\n if (this.model) {\n if (this.model.rebound) this.model.rebound(update);\n else {\n // check to see if the model actually changed...\n // yield mustaches and inner contexts should resolve in container context\n const start = this.template.y\n ? this.template.y.containerFragment\n : this.containerFragment || this.up;\n // try to find a model for this view\n const model = resolve(start, this.template);\n if (model !== this.model) {\n this.model.unregister(this);\n this.bind(model);\n }\n }\n\n if (update) this.bubble();\n }\n if (this.fragment) this.fragment.rebound(update);\n }\n\n unbind() {\n if (!this.isStatic) {\n this.model && this.model.unregister(this);\n this.model = undefined;\n }\n }\n}\n\nexport function MustacheContainer(options) {\n Mustache.call(this, options);\n}\n\nconst proto = (MustacheContainer.prototype = Object.create(ContainerItem.prototype));\n\nassign(proto, Mustache.prototype, { constructor: MustacheContainer });\n","import progressiveText from './shared/progressiveText';\nimport { escapeHtml } from 'utils/html';\nimport { safeToStringValue } from 'utils/dom';\nimport { detachNode } from 'utils/dom';\nimport Mustache from './shared/Mustache';\nimport { inAttributes } from './element/ConditionalAttribute';\n\nexport default class Interpolator extends Mustache {\n bubble() {\n if (this.owner) this.owner.bubble();\n super.bubble();\n }\n\n detach() {\n return detachNode(this.node);\n }\n\n firstNode() {\n return this.node;\n }\n\n getString() {\n return this.model ? safeToStringValue(this.model.get()) : '';\n }\n\n render(target, occupants) {\n if (inAttributes()) return;\n const value = (this.value = this.getString());\n\n this.rendered = true;\n\n progressiveText(this, target, occupants, value);\n }\n\n toString(escape) {\n const string = this.getString();\n return escape ? escapeHtml(string) : string;\n }\n\n unrender(shouldDestroy) {\n if (shouldDestroy) this.detach();\n this.rendered = false;\n }\n\n update() {\n if (this.dirty) {\n this.dirty = false;\n if (this.rendered) {\n const value = this.getString();\n if (value !== this.value) this.node.data = this.value = value;\n }\n }\n }\n\n valueOf() {\n return this.model ? this.model.get() : undefined;\n }\n}\n","import Element from '../../Element';\nimport { isFunction } from 'utils/is';\n\nexport default class Input extends Element {\n render(target, occupants) {\n super.render(target, occupants);\n this.node.defaultValue = this.node.value;\n }\n compare(value, attrValue) {\n const comparator = this.getAttribute('value-comparator');\n if (comparator) {\n if (isFunction(comparator)) {\n return comparator(value, attrValue);\n }\n if (value && attrValue) {\n return value[comparator] == attrValue[comparator];\n }\n }\n return value == attrValue;\n }\n}\n","import Parser from 'parse/Parser';\nimport readStringLiteral from 'parse/converters/expressions/primary/literal/readStringLiteral';\nimport readKey from 'parse/converters/expressions/shared/readKey';\nimport { hasOwn, keys } from 'utils/object';\n\n// simple JSON parser, without the restrictions of JSON parse\n// (i.e. having to double-quote keys).\n//\n// If passed a hash of values as the second argument, ${placeholders}\n// will be replaced with those values\n\nconst specials = {\n true: true,\n false: false,\n null: null,\n undefined\n};\n\nconst specialsPattern = new RegExp('^(?:' + keys(specials).join('|') + ')');\nconst numberPattern = /^(?:[+-]?)(?:(?:(?:0|[1-9]\\d*)?\\.\\d+)|(?:(?:0|[1-9]\\d*)\\.)|(?:0|[1-9]\\d*))(?:[eE][+-]?\\d+)?/;\nconst placeholderPattern = /\\$\\{([^\\}]+)\\}/g;\nconst placeholderAtStartPattern = /^\\$\\{([^\\}]+)\\}/;\nconst onlyWhitespace = /^\\s*$/;\n\nconst JsonParser = Parser.extend({\n init(str, options) {\n this.values = options.values;\n this.sp();\n },\n\n postProcess(result) {\n if (result.length !== 1 || !onlyWhitespace.test(this.leftover)) {\n return null;\n }\n\n return { value: result[0].v };\n },\n\n converters: [\n function getPlaceholder(parser) {\n if (!parser.values) return null;\n\n const placeholder = parser.matchPattern(placeholderAtStartPattern);\n\n if (placeholder && hasOwn(parser.values, placeholder)) {\n return { v: parser.values[placeholder] };\n }\n },\n\n function getSpecial(parser) {\n const special = parser.matchPattern(specialsPattern);\n if (special) return { v: specials[special] };\n },\n\n function getNumber(parser) {\n const number = parser.matchPattern(numberPattern);\n if (number) return { v: +number };\n },\n\n function getString(parser) {\n const stringLiteral = readStringLiteral(parser);\n const values = parser.values;\n\n if (stringLiteral && values) {\n return {\n v: stringLiteral.v.replace(placeholderPattern, (match, $1) =>\n $1 in values ? values[$1] : $1\n )\n };\n }\n\n return stringLiteral;\n },\n\n function getObject(parser) {\n if (!parser.matchString('{')) return null;\n\n const result = {};\n\n parser.sp();\n\n if (parser.matchString('}')) {\n return { v: result };\n }\n\n let pair;\n while ((pair = getKeyValuePair(parser))) {\n result[pair.key] = pair.value;\n\n parser.sp();\n\n if (parser.matchString('}')) {\n return { v: result };\n }\n\n if (!parser.matchString(',')) {\n return null;\n }\n }\n\n return null;\n },\n\n function getArray(parser) {\n if (!parser.matchString('[')) return null;\n\n const result = [];\n\n parser.sp();\n\n if (parser.matchString(']')) {\n return { v: result };\n }\n\n let valueToken;\n while ((valueToken = parser.read())) {\n result.push(valueToken.v);\n\n parser.sp();\n\n if (parser.matchString(']')) {\n return { v: result };\n }\n\n if (!parser.matchString(',')) {\n return null;\n }\n\n parser.sp();\n }\n\n return null;\n }\n ]\n});\n\nfunction getKeyValuePair(parser) {\n parser.sp();\n\n const key = readKey(parser);\n\n if (!key) return null;\n\n const pair = { key };\n\n parser.sp();\n if (!parser.matchString(':')) {\n return null;\n }\n parser.sp();\n\n const valueToken = parser.read();\n\n if (!valueToken) return null;\n\n pair.value = valueToken.v;\n return pair;\n}\n\nexport default function(str, values) {\n const parser = new JsonParser(str, { values });\n return parser.result;\n}\n","import resolveReference from 'src/view/resolvers/resolveReference';\nimport Model from 'src/model/Model';\nimport { isNumeric, isObject, isNumber, isObjectType, isString } from 'utils/is';\nimport runloop from 'src/global/runloop';\nimport findElement from 'src/view/items/shared/findElement';\nimport { set as sharedSet } from './set';\nimport makeArrayMethod from '../Ractive/prototype/shared/makeArrayMethod';\nimport { animate as protoAnimate } from '../Ractive/prototype/animate';\nimport { update as protoUpdate } from '../Ractive/prototype/update';\nimport getRactiveContext, { extern, findParentWithContext } from './getRactiveContext';\nimport { hasOwn } from 'utils/object';\nimport { ELEMENT } from 'config/types';\n\nconst modelPush = makeArrayMethod('push').model;\nconst modelPop = makeArrayMethod('pop').model;\nconst modelShift = makeArrayMethod('shift').model;\nconst modelUnshift = makeArrayMethod('unshift').model;\nconst modelSort = makeArrayMethod('sort').model;\nconst modelSplice = makeArrayMethod('splice').model;\nconst modelReverse = makeArrayMethod('reverse').model;\n\nexport const localFragment = {};\n\nclass ContextData extends Model {\n constructor(options) {\n super(null, null);\n\n this.isRoot = true;\n this.root = this;\n this.value = {};\n this.ractive = options.ractive;\n this.adaptors = [];\n this.context = options.context;\n }\n\n getKeypath() {\n return '@context.data';\n }\n\n rebound() {}\n}\n\nexport default class Context {\n constructor(fragment, element) {\n this.fragment = fragment;\n this.element = element || findElement(fragment);\n this.node = this.element && this.element.node;\n this.ractive = fragment.ractive;\n this.root = this;\n }\n\n get decorators() {\n const items = {};\n if (!this.element) return items;\n this.element.decorators.forEach(d => (items[d.name] = d.handle));\n return items;\n }\n\n get _data() {\n return (\n this.model ||\n (this.root.model = new ContextData({\n ractive: this.ractive,\n context: this.root\n }))\n );\n }\n\n // the usual mutation suspects\n add(keypath, d, options) {\n const num = isNumber(d) ? +d : 1;\n const opts = isObjectType(d) ? d : options;\n return sharedSet(\n build(this, keypath, num).map(pair => {\n const [model, val] = pair;\n const value = model.get();\n if (!isNumeric(val) || !isNumeric(value)) throw new Error('Cannot add non-numeric value');\n return [model, value + val];\n }),\n opts\n );\n }\n\n animate(keypath, value, options) {\n const model = findModel(this, keypath).model;\n return protoAnimate(this.ractive, model, value, options);\n }\n\n find(selector, opts) {\n return this.fragment.find(selector, opts);\n }\n\n findAll(selector, opts) {\n const result = [];\n opts = opts || {};\n opts.result = result;\n this.fragment.findAll(selector, opts);\n return result;\n }\n\n findAllComponents(selector, opts) {\n const result = [];\n opts = opts || {};\n opts.result = result;\n this.fragment.findAllComponents(selector, opts);\n return result;\n }\n\n findComponent(selector, opts) {\n return this.fragment.findComponent(selector, opts);\n }\n\n // get relative keypaths and values\n get(keypath) {\n if (!keypath) return this.fragment.findContext().get(true);\n\n const { model } = findModel(this, keypath);\n\n return model ? model.get(true) : undefined;\n }\n\n getParent(component) {\n let fragment = this.fragment;\n\n if (!fragment.parent && component) fragment = fragment.componentParent;\n else {\n if (fragment.context) fragment = findParentWithContext(fragment.parent);\n else {\n fragment = findParentWithContext(fragment.parent);\n if (fragment) {\n if (!fragment.parent && component) fragment = fragment.componentParent;\n else fragment = findParentWithContext(fragment.parent);\n }\n }\n }\n\n if (!fragment || fragment === this.fragment) return;\n else return fragment.getContext();\n }\n\n hasListener(name, bubble) {\n // if the owner is a component, start there because the nearest element\n // may exist outside of the immediate context (yield)\n let el = this.fragment.owner.component\n ? this.fragment.owner\n : this.element || this.fragment.owner;\n let base;\n\n do {\n base = el.component || el;\n if (base.template.t === ELEMENT) {\n if (findEvent(base, name)) return true;\n }\n el = el.up && el.up.owner;\n if (el && el.component) el = el.component;\n } while (el && bubble);\n }\n\n link(source, dest) {\n const there = findModel(this, source).model;\n const here = findModel(this, dest).model;\n const promise = runloop.start();\n here.link(there, source);\n runloop.end();\n return promise;\n }\n\n listen(event, handler) {\n const el = this.element;\n el.on(event, handler);\n return {\n cancel() {\n el.off(event, handler);\n }\n };\n }\n\n observe(keypath, callback, options = {}) {\n if (isObject(keypath)) options = callback || {};\n options.fragment = this.fragment;\n return this.ractive.observe(keypath, callback, options);\n }\n\n observeOnce(keypath, callback, options = {}) {\n if (isObject(keypath)) options = callback || {};\n options.fragment = this.fragment;\n return this.ractive.observeOnce(keypath, callback, options);\n }\n\n pop(keypath) {\n return modelPop(findModel(this, keypath).model, []);\n }\n\n push(keypath, ...values) {\n return modelPush(findModel(this, keypath).model, values);\n }\n\n raise(name, event, ...args) {\n let el = this.element;\n let ev;\n\n while (el) {\n if (el.component) el = el.component;\n ev = findEvent(el, name);\n if (ev) {\n return ev.fire(\n ev.element.getContext(\n event || {},\n event && !('original' in event) ? { original: {} } : {}\n ),\n args\n );\n }\n\n el = el.up && el.up.owner;\n }\n }\n\n readLink(keypath, options) {\n return this.ractive.readLink(this.resolve(keypath), options);\n }\n\n resolve(path, ractive) {\n const { model, instance } = findModel(this, path);\n return model ? model.getKeypath(ractive || instance) : path;\n }\n\n reverse(keypath) {\n return modelReverse(findModel(this, keypath).model, []);\n }\n\n set(keypath, value, options) {\n return sharedSet(build(this, keypath, value), options);\n }\n\n shift(keypath) {\n return modelShift(findModel(this, keypath).model, []);\n }\n\n splice(keypath, index, drop, ...add) {\n add.unshift(index, drop);\n return modelSplice(findModel(this, keypath).model, add);\n }\n\n sort(keypath) {\n return modelSort(findModel(this, keypath).model, []);\n }\n\n subtract(keypath, d, options) {\n const num = isNumber(d) ? d : 1;\n const opts = isObjectType(d) ? d : options;\n return sharedSet(\n build(this, keypath, num).map(pair => {\n const [model, val] = pair;\n const value = model.get();\n if (!isNumeric(val) || !isNumeric(value)) throw new Error('Cannot add non-numeric value');\n return [model, value - val];\n }),\n opts\n );\n }\n\n toggle(keypath, options) {\n const { model } = findModel(this, keypath);\n return sharedSet([[model, !model.get()]], options);\n }\n\n unlink(dest) {\n const here = findModel(this, dest).model;\n const promise = runloop.start();\n if (here.owner && here.owner._link) here.owner.unlink();\n runloop.end();\n return promise;\n }\n\n unlisten(event, handler) {\n this.element.off(event, handler);\n }\n\n unshift(keypath, ...add) {\n return modelUnshift(findModel(this, keypath).model, add);\n }\n\n update(keypath, options) {\n return protoUpdate(this.ractive, findModel(this, keypath).model, options);\n }\n\n updateModel(keypath, cascade) {\n const { model } = findModel(this, keypath);\n const promise = runloop.start();\n model.updateFromBindings(cascade);\n runloop.end();\n return promise;\n }\n\n // two-way binding related helpers\n isBound() {\n const { model } = this.getBindingModel(this);\n return !!model;\n }\n\n getBindingPath(ractive) {\n const { model, instance } = this.getBindingModel(this);\n if (model) return model.getKeypath(ractive || instance);\n }\n\n getBinding() {\n const { model } = this.getBindingModel(this);\n if (model) return model.get(true);\n }\n\n getBindingModel(ctx) {\n const el = ctx.element;\n return { model: el.binding && el.binding.model, instance: el.up.ractive };\n }\n\n setBinding(value) {\n const { model } = this.getBindingModel(this);\n return sharedSet([[model, value]]);\n }\n}\n\nContext.forRactive = getRactiveContext;\n// circular deps are fun\nextern.Context = Context;\n\n// TODO: at some point perhaps this could support relative * keypaths?\nfunction build(ctx, keypath, value) {\n const sets = [];\n\n // set multiple keypaths in one go\n if (isObject(keypath)) {\n for (const k in keypath) {\n if (hasOwn(keypath, k)) {\n sets.push([findModel(ctx, k).model, keypath[k]]);\n }\n }\n } else {\n // set a single keypath\n sets.push([findModel(ctx, keypath).model, value]);\n }\n\n return sets;\n}\n\nfunction findModel(ctx, path) {\n const frag = ctx.fragment;\n\n if (!isString(path)) {\n return { model: frag.findContext(), instance: path };\n }\n\n return { model: resolveReference(frag, path), instance: frag.ractive };\n}\n\nfunction findEvent(el, name) {\n return el.events && el.events.find && el.events.find(e => ~e.template.n.indexOf(name));\n}\n","import { doc } from 'config/environment';\nimport getRactiveContext from 'shared/getRactiveContext';\nimport { isString } from 'utils/is';\n\nconst query = doc && doc.querySelector;\n\nexport default function getContext(node) {\n if (isString(node) && query) {\n node = query.call(document, node);\n }\n\n let instances;\n if (node) {\n if (node._ractive) {\n return node._ractive.proxy.getContext();\n } else if ((instances = node.__ractive_instances__)) {\n if (instances.length === 1) return getRactiveContext(instances[0]);\n } else return getContext(node.parentNode);\n }\n}\n","import { isClient, svg, vendors, win, doc } from 'config/environment';\nimport { html } from 'config/namespaces';\nimport { isString, isNumber } from 'utils/is';\n\nlet createElement, matches, div, methodNames, unprefixed, prefixed, i, j, makeFunction;\n\nconst customStr = isClient && 'registerElement' in doc;\nfunction wrap(is) {\n return customStr ? is : { is };\n}\n\n// Test for SVG support\nif (!svg) {\n /* istanbul ignore next */\n createElement = (type, ns, is) => {\n if (ns && ns !== html) {\n throw \"This browser does not support namespaces other than http://www.w3.org/1999/xhtml. The most likely cause of this error is that you're trying to render SVG in an older browser. See http://ractive.js.org/support/#svgs for more information\";\n }\n\n return is ? doc.createElement(type, wrap(is)) : doc.createElement(type);\n };\n} else {\n createElement = (type, ns, is) => {\n if (!ns || ns === html) {\n return is ? doc.createElement(type, wrap(is)) : doc.createElement(type);\n }\n\n return is ? doc.createElementNS(ns, type, wrap(is)) : doc.createElementNS(ns, type);\n };\n}\n\nexport function createDocumentFragment() {\n return doc.createDocumentFragment();\n}\n\nfunction getElement(input) {\n let output;\n\n if (!input || typeof input === 'boolean') {\n return;\n }\n\n /* istanbul ignore next */\n if (!win || !doc || !input) {\n return null;\n }\n\n // We already have a DOM node - no work to do. (Duck typing alert!)\n if (input.nodeType) {\n return input;\n }\n\n // Get node from string\n if (isString(input)) {\n // try ID first\n output = doc.getElementById(input);\n\n // then as selector, if possible\n if (!output && doc.querySelector) {\n try {\n output = doc.querySelector(input);\n } catch (e) {\n /* this space intentionally left blank */\n }\n }\n\n // did it work?\n if (output && output.nodeType) {\n return output;\n }\n }\n\n // If we've been given a collection (jQuery, Zepto etc), extract the first item\n if (input[0] && input[0].nodeType) {\n return input[0];\n }\n\n return null;\n}\n\nif (!isClient) {\n matches = null;\n} else {\n div = createElement('div');\n methodNames = ['matches', 'matchesSelector'];\n\n makeFunction = function(methodName) {\n return function(node, selector) {\n return node[methodName](selector);\n };\n };\n\n i = methodNames.length;\n\n while (i-- && !matches) {\n unprefixed = methodNames[i];\n\n if (div[unprefixed]) {\n matches = makeFunction(unprefixed);\n } else {\n j = vendors.length;\n while (j--) {\n prefixed = vendors[i] + unprefixed.substr(0, 1).toUpperCase() + unprefixed.substring(1);\n\n if (div[prefixed]) {\n matches = makeFunction(prefixed);\n break;\n }\n }\n }\n }\n\n // IE8... and apparently phantom some?\n /* istanbul ignore next */\n if (!matches) {\n matches = function(node, selector) {\n let parentNode, i;\n\n parentNode = node.parentNode;\n\n if (!parentNode) {\n // empty dummy <div>\n div.innerHTML = '';\n\n parentNode = div;\n node = node.cloneNode();\n\n div.appendChild(node);\n }\n\n const nodes = parentNode.querySelectorAll(selector);\n\n i = nodes.length;\n while (i--) {\n if (nodes[i] === node) {\n return true;\n }\n }\n\n return false;\n };\n }\n}\n\nfunction detachNode(node) {\n // stupid ie\n // eslint-disable-next-line valid-typeof\n if (node && typeof node.parentNode !== 'unknown' && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n\n return node;\n}\n\nfunction safeToStringValue(value) {\n return value == null || (isNumber(value) && isNaN(value)) || !value.toString ? '' : '' + value;\n}\n\nfunction safeAttributeString(string) {\n return safeToStringValue(string)\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\nexport { createElement, detachNode, getElement, matches, safeToStringValue, safeAttributeString };\n","export const html = 'http://www.w3.org/1999/xhtml';\nexport const mathml = 'http://www.w3.org/1998/Math/MathML';\nexport const svg = 'http://www.w3.org/2000/svg';\nexport const xlink = 'http://www.w3.org/1999/xlink';\nexport const xml = 'http://www.w3.org/XML/1998/namespace';\nexport const xmlns = 'http://www.w3.org/2000/xmlns';\n\nexport default { html, mathml, svg, xlink, xml, xmlns };\n","import { isEqual, isFunction } from 'utils/is';\nimport { removeFromArray } from 'utils/array';\nimport runloop from 'src/global/runloop';\nimport { rebindMatch } from 'shared/rebind';\nimport { create } from 'utils/object';\nimport { warnIfDebug } from 'utils/log';\n\nexport default class Observer {\n constructor(ractive, model, callback, options) {\n this.context = options.context || ractive;\n this.callback = callback;\n this.ractive = ractive;\n this.keypath = options.keypath;\n this.options = options;\n\n if (model) this.resolved(model);\n\n if (isFunction(options.old)) {\n this.oldContext = create(ractive);\n this.oldFn = options.old;\n }\n\n if (options.init !== false) {\n this.dirty = true;\n this.dispatch();\n } else {\n updateOld(this);\n }\n\n this.dirty = false;\n }\n\n cancel() {\n this.cancelled = true;\n if (this.model) {\n this.model.unregister(this);\n } else {\n this.resolver.unbind();\n }\n removeFromArray(this.ractive._observers, this);\n }\n\n dispatch() {\n if (!this.cancelled) {\n try {\n this.callback.call(this.context, this.newValue, this.oldValue, this.keypath);\n } catch (err) {\n warnIfDebug(\n `Failed to execute observer callback for '${this.keypath}': ${err.message || err}`\n );\n }\n updateOld(this, true);\n this.dirty = false;\n }\n }\n\n handleChange() {\n if (!this.dirty) {\n const newValue = this.model.get();\n if (isEqual(newValue, this.oldValue)) return;\n\n this.newValue = newValue;\n\n if (this.options.strict && this.newValue === this.oldValue) return;\n\n runloop.addObserver(this, this.options.defer);\n this.dirty = true;\n\n if (this.options.once) runloop.scheduleTask(() => this.cancel());\n } else {\n // make sure the newValue stays updated in case this observer gets touched multiple times in one loop\n this.newValue = this.model.get();\n }\n }\n\n rebind(next, previous) {\n next = rebindMatch(this.keypath, next, previous);\n if (next === this.model) return false;\n\n if (this.model) this.model.unregister(this);\n if (next) next.addShuffleTask(() => this.resolved(next));\n }\n\n resolved(model) {\n this.model = model;\n\n this.oldValue = undefined;\n this.newValue = model.get();\n\n model.register(this);\n }\n}\n\nfunction updateOld(observer, fresh) {\n const next = fresh\n ? observer.model\n ? observer.model.get()\n : observer.newValue\n : observer.newValue;\n try {\n observer.oldValue = observer.oldFn\n ? observer.oldFn.call(observer.oldContext, undefined, next, observer.keypath)\n : next;\n } catch (err) {\n warnIfDebug(\n `Failed to execute observer oldValue callback for '${this.keypath}': ${err.message || err}`\n );\n observer.oldValue = next;\n }\n}\n","import { escapeKey } from 'shared/keypaths';\nimport { removeFromArray } from 'utils/array';\nimport { isArray, isEqual } from 'utils/is';\nimport runloop from 'src/global/runloop';\nimport { create, keys } from 'utils/object';\nimport { warnIfDebug } from 'utils/log';\nimport { joinKeys } from 'src/Ractive/static/keypaths';\n\nconst star = /\\*+/g;\n\nexport default class PatternObserver {\n constructor(ractive, baseModel, keys, callback, options) {\n this.context = options.context || ractive;\n this.ractive = ractive;\n this.baseModel = baseModel;\n this.keys = keys;\n this.callback = callback;\n\n const pattern = keys.join('\\\\.').replace(star, '(.+)');\n const baseKeypath = (this.baseKeypath = baseModel.getKeypath(ractive));\n this.pattern = new RegExp(`^${baseKeypath ? baseKeypath + '\\\\.' : ''}${pattern}$`);\n this.recursive = keys.length === 1 && keys[0] === '**';\n if (this.recursive) this.keys = ['*'];\n if (options.old) {\n this.oldContext = create(ractive);\n this.oldFn = options.old;\n }\n\n this.oldValues = {};\n this.newValues = {};\n\n this.defer = options.defer;\n this.once = options.once;\n this.strict = options.strict;\n\n this.dirty = false;\n this.changed = [];\n this.cache = [];\n this.partial = false;\n this.links = options.links;\n\n const models = baseModel.findMatches(this.keys);\n\n models.forEach(model => {\n this.newValues[model.getKeypath(this.ractive)] = model.get();\n });\n\n if (options.init !== false) {\n this.dispatch();\n } else {\n updateOld(this, this.newValues);\n }\n\n baseModel.registerPatternObserver(this);\n }\n\n cancel() {\n this.baseModel.unregisterPatternObserver(this);\n removeFromArray(this.ractive._observers, this);\n }\n\n dispatch() {\n const newValues = this.newValues;\n this.newValues = {};\n keys(newValues).forEach(keypath => {\n const newValue = newValues[keypath];\n const oldValue = this.oldValues[keypath];\n\n if (this.strict && newValue === oldValue) return;\n if (isEqual(newValue, oldValue)) return;\n\n let args = [newValue, oldValue, keypath];\n if (keypath) {\n const wildcards = this.pattern.exec(keypath);\n if (wildcards) {\n args = args.concat(wildcards.slice(1));\n }\n }\n\n try {\n this.callback.apply(this.context, args);\n } catch (err) {\n warnIfDebug(\n `Failed to execute pattern observer callback for '${this.keypath}': ${err.message || err}`\n );\n }\n });\n\n updateOld(this, newValues, this.partial);\n\n this.dirty = false;\n }\n\n notify(keys) {\n const path = joinKeys(keys);\n if (!~this.cache.indexOf(path)) {\n this.cache.push(path);\n this.changed.push(keys);\n }\n }\n\n shuffle(newIndices) {\n if (!isArray(this.baseModel.value)) return;\n\n const max = this.baseModel.value.length;\n\n for (let i = 0; i < newIndices.length; i++) {\n if (newIndices[i] === -1 || newIndices[i] === i) continue;\n this.changed.push([i]);\n }\n\n for (let i = newIndices.touchedFrom; i < max; i++) {\n this.changed.push([i]);\n }\n }\n\n handleChange() {\n if (!this.dirty || this.changed.length) {\n if (!this.dirty) this.newValues = {};\n\n if (!this.changed.length) {\n this.baseModel.findMatches(this.keys).forEach(model => {\n const keypath = model.getKeypath(this.ractive);\n this.newValues[keypath] = model.get();\n });\n this.partial = false;\n } else {\n let count = 0;\n\n if (this.recursive) {\n const changed = this.changed.slice();\n this.changed.length = 0;\n this.dirty = true;\n changed.forEach(keys => {\n const model = this.baseModel.joinAll(keys);\n if (model.isLink && !this.links) return;\n count++;\n this.newValues[model.getKeypath(this.ractive)] = model.get();\n });\n this.dirty = false;\n } else {\n const ok = this.baseModel.isRoot\n ? this.changed.map(keys => keys.map(escapeKey).join('.'))\n : this.changed.map(keys => this.baseKeypath + '.' + keys.map(escapeKey).join('.'));\n\n this.baseModel.findMatches(this.keys).forEach(model => {\n const keypath = model.getKeypath(this.ractive);\n const check = k => {\n return (\n (k.indexOf(keypath) === 0 &&\n (k.length === keypath.length || k[keypath.length] === '.')) ||\n (keypath.indexOf(k) === 0 &&\n (k.length === keypath.length || keypath[k.length] === '.'))\n );\n };\n\n // is this model on a changed keypath?\n if (ok.filter(check).length) {\n count++;\n this.newValues[keypath] = model.get();\n }\n });\n }\n\n // no valid change triggered, so bail to avoid breakage\n if (!count) return;\n\n this.partial = true;\n }\n\n runloop.addObserver(this, this.defer);\n this.dirty = true;\n this.changed.length = 0;\n this.cache = [];\n\n if (this.once) this.cancel();\n }\n }\n}\n\nfunction updateOld(observer, vals, partial) {\n const olds = observer.oldValues;\n\n if (observer.oldFn) {\n if (!partial) observer.oldValues = {};\n\n keys(vals).forEach(k => {\n const args = [olds[k], vals[k], k];\n const parts = observer.pattern.exec(k);\n if (parts) {\n args.push.apply(args, parts.slice(1));\n }\n observer.oldValues[k] = observer.oldFn.apply(observer.oldContext, args);\n });\n } else {\n if (partial) {\n keys(vals).forEach(k => (olds[k] = vals[k]));\n } else {\n observer.oldValues = vals;\n }\n }\n}\n","import { removeFromArray } from 'utils/array';\nimport { isArray, isUndefined } from 'utils/is';\nimport runloop from 'src/global/runloop';\nimport { warnIfDebug } from 'utils/log';\n\nfunction negativeOne() {\n return -1;\n}\n\nexport default class ArrayObserver {\n constructor(ractive, model, callback, options) {\n this.ractive = ractive;\n this.model = model;\n this.keypath = model.getKeypath();\n this.callback = callback;\n this.options = options;\n\n this.pending = null;\n\n model.register(this);\n\n if (options.init !== false) {\n this.sliced = [];\n this.shuffle([]);\n this.dispatch();\n } else {\n this.sliced = this.slice();\n }\n }\n\n cancel() {\n this.model.unregister(this);\n removeFromArray(this.ractive._observers, this);\n }\n\n dispatch() {\n try {\n this.callback(this.pending);\n } catch (err) {\n warnIfDebug(\n `Failed to execute array observer callback for '${this.keypath}': ${err.message || err}`\n );\n }\n this.pending = null;\n if (this.options.once) this.cancel();\n }\n\n handleChange(path) {\n if (this.pending) {\n // post-shuffle\n runloop.addObserver(this, this.options.defer);\n } else if (!path) {\n // entire array changed\n this.shuffle(this.sliced.map(negativeOne));\n this.handleChange();\n }\n }\n\n shuffle(newIndices) {\n const newValue = this.slice();\n\n const inserted = [];\n const deleted = [];\n let start;\n\n const hadIndex = {};\n\n newIndices.forEach((newIndex, oldIndex) => {\n hadIndex[newIndex] = true;\n\n if (newIndex !== oldIndex && isUndefined(start)) {\n start = oldIndex;\n }\n\n if (newIndex === -1) {\n deleted.push(this.sliced[oldIndex]);\n }\n });\n\n if (isUndefined(start)) start = newIndices.length;\n\n const len = newValue.length;\n for (let i = 0; i < len; i += 1) {\n if (!hadIndex[i]) inserted.push(newValue[i]);\n }\n\n this.pending = { inserted, deleted, start };\n this.sliced = newValue;\n }\n\n slice() {\n const value = this.model.get();\n return isArray(value) ? value.slice() : [];\n }\n}\n","import { isObject, isFunction } from 'utils/is';\nimport { assign } from 'utils/object';\n\nconst onceOptions = { init: false, once: true };\n\nexport default function observeOnce(keypath, callback, options) {\n if (isObject(keypath) || isFunction(keypath)) {\n options = assign(callback || {}, onceOptions);\n return this.observe(keypath, options);\n }\n\n options = assign(options || {}, onceOptions);\n return this.observe(keypath, callback, options);\n}\n","export default str => str.trim();\n","export default str => str !== '';\n","import makeArrayMethod from './shared/makeArrayMethod';\nexport default makeArrayMethod('pop').path;\n","import makeArrayMethod from './shared/makeArrayMethod';\nexport default makeArrayMethod('push').path;\n","import { doc } from '../config/environment';\nimport { isArray } from '../utils/is';\n\nconst PREFIX = '/* Ractive.js component styles */';\n\n// Holds current definitions of styles.\nconst styleDefinitions = [];\n\n// Flag to tell if we need to update the CSS\nlet isDirty = false;\n\n// These only make sense on the browser. See additional setup below.\nlet styleElement = null;\nlet useCssText = null;\n\n// flag to use multiple style tags\nlet _splitTag = false;\nexport function splitTag(v) {\n return v === undefined ? _splitTag : (_splitTag = v);\n}\n\nexport function addCSS(styleDefinition) {\n styleDefinitions.push(styleDefinition);\n isDirty = true;\n}\n\nexport function applyCSS(force) {\n const styleElement = style();\n\n // Apply only seems to make sense when we're in the DOM. Server-side renders\n // can call toCSS to get the updated CSS.\n if (!styleElement || (!force && !isDirty)) return;\n\n if (_splitTag) {\n styleDefinitions.forEach(s => {\n const el = getStyle(s.id);\n if (el) {\n const css = getCSS(s.id);\n if (useCssText) {\n el.styleSheet.cssText !== css && (el.styleSheet.cssText = css);\n } else {\n el.innerHTML !== css && (el.innerHTML = css);\n }\n }\n });\n } else {\n if (useCssText) {\n styleElement.styleSheet.cssText = getCSS(null);\n } else {\n styleElement.innerHTML = getCSS(null);\n }\n }\n\n isDirty = false;\n}\n\nexport function getCSS(cssIds) {\n if (cssIds && !isArray(cssIds)) cssIds = [cssIds];\n const filteredStyleDefinitions = cssIds\n ? styleDefinitions.filter(style => ~cssIds.indexOf(style.id))\n : styleDefinitions;\n\n filteredStyleDefinitions.forEach(d => (d.applied = true));\n\n return filteredStyleDefinitions.reduce(\n (styles, style) => `${styles ? `${styles}\\n\\n/* {${style.id}} */\\n${style.styles}` : ''}`,\n PREFIX\n );\n}\n\nfunction getStyle(id) {\n return doc && (doc.querySelector(`[data-ractive-css=\"${id}\"]`) || makeStyle(id));\n}\n\nfunction makeStyle(id) {\n if (doc) {\n const el = doc.createElement('style');\n el.type = 'text/css';\n el.setAttribute('data-ractive-css', id || '');\n\n doc.getElementsByTagName('head')[0].appendChild(el);\n\n if (useCssText === null) useCssText = !!el.styleSheet;\n\n return el;\n }\n}\n\nfunction style() {\n if (!styleElement) styleElement = makeStyle();\n\n return styleElement;\n}\n","import { ensureArray, combine } from 'utils/array';\n\nexport default {\n extend: (Parent, proto, options) => {\n proto.adapt = combine(proto.adapt, ensureArray(options.adapt));\n },\n\n init() {}\n};\n","const remove = /\\/\\*(?:[\\s\\S]*?)\\*\\//g;\nconst escape = /url\\(\\s*(['\"])(?:\\\\[\\s\\S]|(?!\\1).)*\\1\\s*\\)|url\\((?:\\\\[\\s\\S]|[^)])*\\)|(['\"])(?:\\\\[\\s\\S]|(?!\\2).)*\\2/gi;\nconst value = /\\0(\\d+)/g;\n\n// Removes comments and strings from the given CSS to make it easier to parse.\n// Callback receives the cleaned CSS and a function which can be used to put\n// the removed strings back in place after parsing is done.\nexport default function(css, callback, additionalReplaceRules = []) {\n const values = [];\n const reconstruct = css => css.replace(value, (match, n) => values[n]);\n css = css.replace(escape, match => `\\0${values.push(match) - 1}`).replace(remove, '');\n\n additionalReplaceRules.forEach(pattern => {\n css = css.replace(pattern, match => `\\0${values.push(match) - 1}`);\n });\n\n return callback(css, reconstruct);\n}\n","import cleanCss from 'utils/cleanCss';\n\nconst selectorsPattern = /(?:^|\\}|\\{|\\x01)\\s*([^\\{\\}\\0\\x01]+)\\s*(?=\\{)/g;\nconst importPattern = /@import\\s*\\([^)]*\\)\\s*;?/gi;\nconst importEndPattern = /\\x01/g;\nconst keyframesDeclarationPattern = /@keyframes\\s+[^\\{\\}]+\\s*\\{(?:[^{}]+|\\{[^{}]+})*}/gi;\nconst selectorUnitPattern = /((?:(?:\\[[^\\]]+\\])|(?:[^\\s\\+\\>~:]))+)((?:::?[^\\s\\+\\>\\~\\(:]+(?:\\([^\\)]+\\))?)*\\s*[\\s\\+\\>\\~]?)\\s*/g;\nconst excludePattern = /^(?:@|\\d+%)/;\nconst dataRvcGuidPattern = /\\[data-ractive-css~=\"\\{[a-z0-9-]+\\}\"]/g;\n\nfunction trim(str) {\n return str.trim();\n}\n\nfunction extractString(unit) {\n return unit.str;\n}\n\nfunction transformSelector(selector, parent) {\n const selectorUnits = [];\n let match;\n\n while ((match = selectorUnitPattern.exec(selector))) {\n selectorUnits.push({\n str: match[0],\n base: match[1],\n modifiers: match[2]\n });\n }\n\n // For each simple selector within the selector, we need to create a version\n // that a) combines with the id, and b) is inside the id\n const base = selectorUnits.map(extractString);\n\n const transformed = [];\n let i = selectorUnits.length;\n\n while (i--) {\n const appended = base.slice();\n\n // Pseudo-selectors should go after the attribute selector\n const unit = selectorUnits[i];\n appended[i] = unit.base + parent + unit.modifiers || '';\n\n const prepended = base.slice();\n prepended[i] = parent + ' ' + prepended[i];\n\n transformed.push(appended.join(' '), prepended.join(' '));\n }\n\n return transformed.join(', ');\n}\n\nexport default function transformCss(css, id) {\n const dataAttr = `[data-ractive-css~=\"{${id}}\"]`;\n\n let transformed;\n\n if (dataRvcGuidPattern.test(css)) {\n transformed = css.replace(dataRvcGuidPattern, dataAttr);\n } else {\n transformed = cleanCss(\n css,\n (css, reconstruct) => {\n css = css\n .replace(importPattern, '$&\\x01')\n .replace(selectorsPattern, (match, $1) => {\n // don't transform at-rules and keyframe declarations\n if (excludePattern.test($1)) return match;\n\n const selectors = $1.split(',').map(trim);\n const transformed =\n selectors.map(selector => transformSelector(selector, dataAttr)).join(', ') + ' ';\n\n return match.replace($1, transformed);\n })\n .replace(importEndPattern, '');\n\n return reconstruct(css);\n },\n [keyframesDeclarationPattern]\n );\n }\n\n return transformed;\n}\n","import { SharedModel } from './SharedModel';\nimport { applyChanges } from '../../Ractive/static/styleSet';\n\nexport default class CSSModel extends SharedModel {\n constructor(component) {\n super(component.cssData, '@style');\n this.component = component;\n }\n\n downstreamChanged(path, depth) {\n if (this.locked) return;\n\n const component = this.component;\n\n component.extensions.forEach(e => {\n const model = e._cssModel;\n model.mark();\n model.downstreamChanged(path, depth || 1);\n });\n\n if (!depth) {\n applyChanges(component, true);\n }\n }\n}\n","import { addCSS, applyCSS } from 'src/global/css';\nimport transformCss from './transform';\nimport { uuid } from 'utils/id';\nimport { warnIfDebug } from 'utils/log';\nimport { getElement } from 'utils/dom';\nimport { splitKeypath } from 'shared/keypaths';\nimport CSSModel from 'src/model/specials/CSSModel';\nimport { assign, create, defineProperty } from 'utils/object';\nimport { isString, isFunction, isObjectType } from 'utils/is';\n\nconst hasCurly = /\\{/;\nexport default {\n name: 'css',\n\n // Called when creating a new component definition\n extend: (Parent, proto, options, Child) => {\n Child._cssIds = gatherIds(Parent);\n\n defineProperty(Child, 'cssData', {\n configurable: true,\n value: assign(create(Parent.cssData), options.cssData || {})\n });\n\n defineProperty(Child, '_cssModel', {\n configurable: true,\n value: new CSSModel(Child)\n });\n\n if (options.css) initCSS(options, Child, proto);\n },\n\n // Called when creating a new component instance\n init: (Parent, target, options) => {\n if (!options.css) return;\n\n warnIfDebug(`\nThe css option is currently not supported on a per-instance basis and will be discarded. Instead, we recommend instantiating from a component definition with a css option.\n\nconst Component = Ractive.extend({\n\t...\n\tcss: '/* your css */',\n\t...\n});\n\nconst componentInstance = new Component({ ... })\n\t\t`);\n }\n};\n\nfunction gatherIds(start) {\n let cmp = start;\n const ids = [];\n\n while (cmp) {\n if (cmp.prototype.cssId) ids.push(cmp.prototype.cssId);\n cmp = cmp.Parent;\n }\n\n return ids;\n}\n\nexport function evalCSS(component, css) {\n if (isString(css)) return css;\n\n const cssData = component.cssData;\n const model = component._cssModel;\n const data = function data(path) {\n return model.joinAll(splitKeypath(path)).get();\n };\n data.__proto__ = cssData;\n\n const result = css.call(component, data);\n return isString(result) ? result : '';\n}\n\nexport function initCSS(options, target, proto) {\n let css =\n options.css === true\n ? ''\n : isString(options.css) && !hasCurly.test(options.css)\n ? getElement(options.css) || options.css\n : options.css;\n let cssProp = css;\n\n const id = options.cssId || uuid();\n\n if (isObjectType(css)) {\n css = 'textContent' in css ? css.textContent : css.innerHTML;\n cssProp = css;\n } else if (isFunction(css)) {\n cssProp = css;\n css = evalCSS(target, css);\n }\n\n const def = {\n transform: 'noCSSTransform' in options ? !options.noCSSTransform : !options.noCssTransform\n };\n\n defineProperty(target, '_cssDef', { configurable: true, value: def });\n\n defineProperty(target, 'css', {\n get() {\n return cssProp;\n },\n set(next) {\n cssProp = next;\n const css = evalCSS(target, cssProp);\n const styles = def.styles;\n def.styles = def.transform ? transformCss(css, id) : css;\n if (def.applied && styles !== def.styles) applyCSS(true);\n }\n });\n\n def.styles = def.transform ? transformCss(css, id) : css;\n def.id = proto.cssId = id;\n target._cssIds.push(id);\n\n addCSS(target._cssDef);\n}\n","import { fatal, warnIfDebug, warnOnceIfDebug } from 'utils/log';\nimport { isArray, isObject, isFunction, isObjectType } from 'utils/is';\nimport bind from 'utils/bind';\n\nfunction validate(data) {\n // Warn if userOptions.data is a non-POJO\n if (data && data.constructor !== Object) {\n if (isFunction(data)) {\n // TODO do we need to support this in the new Ractive() case?\n } else if (!isObjectType(data)) {\n fatal(`data option must be an object or a function, \\`${data}\\` is not valid`);\n } else {\n warnIfDebug(\n 'If supplied, options.data should be a plain JavaScript object - using a non-POJO as the root object may work, but is discouraged'\n );\n }\n }\n}\n\nexport default {\n name: 'data',\n\n extend: (Parent, proto, options) => {\n let key;\n let value;\n\n // check for non-primitives, which could cause mutation-related bugs\n if (options.data && isObject(options.data)) {\n for (key in options.data) {\n value = options.data[key];\n\n if (value && isObjectType(value)) {\n if (isObject(value) || isArray(value)) {\n warnIfDebug(`Passing a \\`data\\` option with object and array properties to Ractive.extend() is discouraged, as mutating them is likely to cause bugs. Consider using a data function instead:\n\n // this...\n data: function () {\n return {\n myObject: {}\n };\n })\n\n // instead of this:\n data: {\n myObject: {}\n }`);\n }\n }\n }\n }\n\n proto.data = combine(proto.data, options.data);\n },\n\n init: (Parent, ractive, options) => {\n let result = combine(Parent.prototype.data, options.data);\n\n if (isFunction(result)) result = result.call(ractive);\n\n // bind functions to the ractive instance at the top level,\n // unless it's a non-POJO (in which case alarm bells should ring)\n if (result && result.constructor === Object) {\n for (const prop in result) {\n if (isFunction(result[prop])) {\n const value = result[prop];\n result[prop] = bind(value, ractive);\n result[prop]._r_unbound = value;\n }\n }\n }\n\n return result || {};\n },\n\n reset(ractive) {\n const result = this.init(ractive.constructor, ractive, ractive.viewmodel);\n ractive.viewmodel.root.set(result);\n return true;\n }\n};\n\nfunction emptyData() {\n return {};\n}\n\nfunction combine(parentValue, childValue) {\n validate(childValue);\n\n const parentIsFn = isFunction(parentValue);\n\n // Very important, otherwise child instance can become\n // the default data object on Ractive or a component.\n // then ractive.set() ends up setting on the prototype!\n if (!childValue && !parentIsFn) {\n // this needs to be a function so that it can still inherit parent defaults\n childValue = emptyData;\n }\n\n const childIsFn = isFunction(childValue);\n\n // Fast path, where we just need to copy properties from\n // parent to child\n if (!parentIsFn && !childIsFn) {\n return fromProperties(childValue, parentValue);\n }\n\n return function() {\n const child = childIsFn ? callDataFunction(childValue, this) : childValue;\n const parent = parentIsFn ? callDataFunction(parentValue, this) : parentValue;\n\n return fromProperties(child, parent);\n };\n}\n\nfunction callDataFunction(fn, context) {\n const data = fn.call(context);\n\n if (!data) return;\n\n if (!isObjectType(data)) {\n fatal('Data function must return an object');\n }\n\n if (data.constructor !== Object) {\n warnOnceIfDebug(\n 'Data function returned something other than a plain JavaScript object. This might work, but is strongly discouraged'\n );\n }\n\n return data;\n}\n\nfunction fromProperties(primary, secondary) {\n if (primary && secondary) {\n for (const key in secondary) {\n if (!(key in primary)) {\n primary[key] = secondary[key];\n }\n }\n\n return primary;\n }\n\n return primary || secondary;\n}\n","import { TEMPLATE_VERSION } from 'config/template';\nimport { addFunctions } from 'shared/getFunction';\nimport parser from '../runtime-parser';\nimport { hasOwn } from 'utils/object';\nimport { isFunction, isNumber, isString } from 'utils/is';\n\nexport default {\n name: 'template',\n\n extend(Parent, proto, options) {\n // only assign if exists\n if ('template' in options) {\n const template = options.template;\n\n if (isFunction(template)) {\n proto.template = template;\n } else {\n proto.template = parseTemplate(template, proto);\n }\n }\n },\n\n init(Parent, ractive, options) {\n // TODO because of prototypal inheritance, we might just be able to use\n // ractive.template, and not bother passing through the Parent object.\n // At present that breaks the test mocks' expectations\n let template = 'template' in options ? options.template : Parent.prototype.template;\n template = template || { v: TEMPLATE_VERSION, t: [] };\n\n if (isFunction(template)) {\n const fn = template;\n template = getDynamicTemplate(ractive, fn);\n\n ractive._config.template = {\n fn,\n result: template\n };\n }\n\n template = parseTemplate(template, ractive);\n\n // TODO the naming of this is confusing - ractive.template refers to [...],\n // but Component.prototype.template refers to {v:1,t:[],p:[]}...\n // it's unnecessary, because the developer never needs to access\n // ractive.template\n ractive.template = template.t;\n\n if (template.p) {\n extendPartials(ractive.partials, template.p);\n }\n },\n\n reset(ractive) {\n const result = resetValue(ractive);\n\n if (result) {\n const parsed = parseTemplate(result, ractive);\n\n ractive.template = parsed.t;\n extendPartials(ractive.partials, parsed.p, true);\n\n return true;\n }\n }\n};\n\nfunction resetValue(ractive) {\n const initial = ractive._config.template;\n\n // If this isn't a dynamic template, there's nothing to do\n if (!initial || !initial.fn) {\n return;\n }\n\n const result = getDynamicTemplate(ractive, initial.fn);\n\n // TODO deep equality check to prevent unnecessary re-rendering\n // in the case of already-parsed templates\n if (result !== initial.result) {\n initial.result = result;\n return result;\n }\n}\n\nfunction getDynamicTemplate(ractive, fn) {\n return fn.call(ractive, {\n fromId: parser.fromId,\n isParsed: parser.isParsed,\n parse(template, options = parser.getParseOptions(ractive)) {\n return parser.parse(template, options);\n }\n });\n}\n\nfunction parseTemplate(template, ractive) {\n if (isString(template)) {\n // parse will validate and add expression functions\n template = parseAsString(template, ractive);\n } else {\n // need to validate and add exp for already parsed template\n validate(template);\n addFunctions(template);\n }\n\n return template;\n}\n\nfunction parseAsString(template, ractive) {\n // ID of an element containing the template?\n if (template[0] === '#') {\n template = parser.fromId(template);\n }\n\n return parser.parseFor(template, ractive);\n}\n\nfunction validate(template) {\n // Check that the template even exists\n if (template == undefined) {\n throw new Error(`The template cannot be ${template}.`);\n } else if (!isNumber(template.v)) {\n // Check the parsed template has a version at all\n throw new Error(\n \"The template parser was passed a non-string template, but the template doesn't have a version. Make sure you're passing in the template you think you are.\"\n );\n } else if (template.v !== TEMPLATE_VERSION) {\n // Check we're using the correct version\n throw new Error(\n `Mismatched template version (expected ${TEMPLATE_VERSION}, got ${\n template.v\n }) Please ensure you are using the latest version of Ractive.js in your build process as well as in your app`\n );\n }\n}\n\nfunction extendPartials(existingPartials, newPartials, overwrite) {\n if (!newPartials) return;\n\n // TODO there's an ambiguity here - we need to overwrite in the `reset()`\n // case, but not initially...\n\n for (const key in newPartials) {\n if (overwrite || !hasOwn(existingPartials, key)) {\n existingPartials[key] = newPartials[key];\n }\n }\n}\n","import { assign, create, keys } from 'utils/object';\nimport { addFunctions } from 'shared/getFunction';\n\nconst registryNames = [\n 'adaptors',\n 'components',\n 'computed',\n 'decorators',\n 'easing',\n 'events',\n 'helpers',\n 'interpolators',\n 'partials',\n 'transitions'\n];\n\nconst registriesOnDefaults = ['computed', 'helpers'];\n\nclass Registry {\n constructor(name, useDefaults) {\n this.name = name;\n this.useDefaults = useDefaults;\n }\n\n extend(Parent, proto, options) {\n const parent = this.useDefaults ? Parent.defaults : Parent;\n const target = this.useDefaults ? proto : proto.constructor;\n this.configure(parent, target, options);\n }\n\n init() {\n // noop\n }\n\n configure(Parent, target, options) {\n const name = this.name;\n const option = options[name];\n\n const registry = create(Parent[name]);\n\n assign(registry, option);\n\n target[name] = registry;\n\n if (name === 'partials' && target[name]) {\n keys(target[name]).forEach(key => {\n addFunctions(target[name][key]);\n });\n }\n }\n\n reset(ractive) {\n const registry = ractive[this.name];\n let changed = false;\n\n keys(registry).forEach(key => {\n const item = registry[key];\n\n if (item._fn) {\n if (item._fn.isOwner) {\n registry[key] = item._fn;\n } else {\n delete registry[key];\n }\n changed = true;\n }\n });\n\n return changed;\n }\n}\n\nconst registries = registryNames.map(name => {\n const putInDefaults = registriesOnDefaults.indexOf(name) > -1;\n return new Registry(name, putInDefaults);\n});\n\nexport default registries;\n","import { warnIfDebug } from 'utils/log';\nimport adaptConfigurator from './custom/adapt';\nimport cssConfigurator from './custom/css/css';\nimport dataConfigurator from './custom/data';\nimport templateConfigurator from './custom/template';\nimport defaults from './defaults';\nimport registries from './registries';\nimport wrapPrototype from './wrapPrototypeMethod';\nimport deprecate from './deprecate';\nimport RactiveProto from '../prototype';\nimport { hasOwn, keys } from 'utils/object';\nimport { isFunction } from 'utils/is';\nimport hooks from 'src/events/Hook';\n\nconst config = {\n extend: (Parent, proto, options, Child) => configure('extend', Parent, proto, options, Child),\n init: (Parent, ractive, options) => configure('init', Parent, ractive, options),\n reset: ractive => order.filter(c => c.reset && c.reset(ractive)).map(c => c.name)\n};\n\nconst custom = {\n adapt: adaptConfigurator,\n computed: config,\n css: cssConfigurator,\n data: dataConfigurator,\n helpers: config,\n template: templateConfigurator\n};\n\nconst defaultKeys = keys(defaults);\n\nconst isStandardKey = makeObj(defaultKeys.filter(key => !custom[key]));\n\n// blacklisted keys that we don't double extend\nconst isBlacklisted = makeObj(\n defaultKeys.concat(registries.map(r => r.name), ['on', 'observe', 'attributes', 'cssData', 'use'])\n);\n\nconst order = [].concat(\n defaultKeys.filter(key => !registries[key] && !custom[key]),\n registries,\n //custom.data,\n custom.template,\n custom.css\n);\n\nfunction configure(method, Parent, target, options, Child) {\n deprecate(options);\n\n for (const key in options) {\n if (hasOwn(isStandardKey, key)) {\n const value = options[key];\n\n // warn the developer if they passed a function and ignore its value\n\n // NOTE: we allow some functions on \"el\" because we duck type element lists\n // and some libraries or ef'ed-up virtual browsers (phantomJS) return a\n // function object as the result of querySelector methods\n if (key !== 'el' && isFunction(value)) {\n warnIfDebug(\n `${key} is a Ractive option that does not expect a function and will be ignored`,\n method === 'init' ? target : null\n );\n } else {\n target[key] = value;\n }\n }\n }\n\n // disallow combination of `append` and `enhance`\n if (target.append && target.enhance) {\n throw new Error('Cannot use append and enhance at the same time');\n }\n\n registries.forEach(registry => {\n registry[method](Parent, target, options, Child);\n });\n\n adaptConfigurator[method](Parent, target, options, Child);\n templateConfigurator[method](Parent, target, options, Child);\n cssConfigurator[method](Parent, target, options, Child);\n\n extendOtherMethods(Parent.prototype, target, options);\n}\n\nconst _super = /\\b_super\\b/;\nfunction extendOtherMethods(parent, target, options) {\n for (const key in options) {\n if (!isBlacklisted[key] && hasOwn(options, key)) {\n let member = options[key];\n\n // if this is a method that overwrites a method, wrap it:\n if (isFunction(member)) {\n if (\n (key in RactiveProto ||\n (key.slice(0, 2) === 'on' && key.slice(2) in hooks && key in target)) &&\n !_super.test(member.toString())\n ) {\n warnIfDebug(\n `Overriding Ractive prototype function '${key}' without calling the '${_super}' method can be very dangerous.`\n );\n }\n member = wrapPrototype(parent, key, member);\n }\n\n target[key] = member;\n }\n }\n}\n\nfunction makeObj(array) {\n const obj = {};\n array.forEach(x => (obj[x] = true));\n return obj;\n}\n\nexport default config;\n","import { createDocumentFragment } from 'utils/dom';\nimport noop from 'utils/noop';\n\nexport default class Item {\n constructor(options) {\n this.up = options.up;\n this.ractive = options.up.ractive;\n\n this.template = options.template;\n this.index = options.index;\n this.type = options.template.t;\n\n this.dirty = false;\n }\n\n bubble() {\n if (!this.dirty) {\n this.dirty = true;\n this.up.bubble();\n }\n }\n\n destroyed() {\n if (this.fragment) this.fragment.destroyed();\n }\n\n find() {\n return null;\n }\n\n findComponent() {\n return null;\n }\n\n findNextNode() {\n return this.up.findNextNode(this);\n }\n\n rebound(update) {\n if (this.fragment) this.fragment.rebound(update);\n }\n\n shuffled() {\n if (this.fragment) this.fragment.shuffled();\n }\n\n valueOf() {\n return this.toString();\n }\n}\n\nItem.prototype.findAll = noop;\nItem.prototype.findAllComponents = noop;\n\nexport class ContainerItem extends Item {\n constructor(options) {\n super(options);\n }\n\n detach() {\n return this.fragment ? this.fragment.detach() : createDocumentFragment();\n }\n\n find(selector) {\n if (this.fragment) {\n return this.fragment.find(selector);\n }\n }\n\n findAll(selector, options) {\n if (this.fragment) {\n this.fragment.findAll(selector, options);\n }\n }\n\n findComponent(name) {\n if (this.fragment) {\n return this.fragment.findComponent(name);\n }\n }\n\n findAllComponents(name, options) {\n if (this.fragment) {\n this.fragment.findAllComponents(name, options);\n }\n }\n\n firstNode(skipParent) {\n return this.fragment && this.fragment.firstNode(skipParent);\n }\n\n toString(escape) {\n return this.fragment ? this.fragment.toString(escape) : '';\n }\n}\n","import cleanCss from 'utils/cleanCss';\nimport { isString } from 'utils/is';\n\nconst space = /\\s+/;\n\nexport function readStyle(css) {\n if (!isString(css)) return {};\n\n return cleanCss(css, (css, reconstruct) => {\n return css\n .split(';')\n .filter(rule => !!rule.trim())\n .map(reconstruct)\n .reduce((rules, rule) => {\n const i = rule.indexOf(':');\n const name = rule.substr(0, i).trim();\n rules[name] = rule.substr(i + 1).trim();\n return rules;\n }, {});\n });\n}\n\nexport function readClass(str) {\n const list = str.split(space);\n\n // remove any empty entries\n let i = list.length;\n while (i--) {\n if (!list[i]) list.splice(i, 1);\n }\n\n return list;\n}\n","import { html } from 'config/namespaces';\nimport { safeToStringValue } from 'utils/dom';\nimport { arrayContains } from 'utils/array';\nimport noop from 'utils/noop';\nimport hyphenateCamel from 'utils/hyphenateCamel';\nimport { readStyle, readClass } from 'src/view/helpers/specialAttrs';\nimport { keys as objectKeys } from 'utils/object';\nimport { isArray, isString, isUndefined } from 'utils/is';\n\nconst textTypes = [\n undefined,\n 'text',\n 'search',\n 'url',\n 'email',\n 'hidden',\n 'password',\n 'search',\n 'reset',\n 'submit'\n];\n\nexport default function getUpdateDelegate(attribute) {\n const { element, name } = attribute;\n\n if (name === 'value') {\n if (attribute.interpolator) attribute.interpolator.bound = true;\n\n // special case - selects\n if (element.name === 'select' && name === 'value') {\n return element.getAttribute('multiple') ? updateMultipleSelectValue : updateSelectValue;\n }\n\n if (element.name === 'textarea') return updateStringValue;\n\n // special case - contenteditable\n if (element.getAttribute('contenteditable') != null) return updateContentEditableValue;\n\n // special case - <input>\n if (element.name === 'input') {\n const type = element.getAttribute('type');\n\n // type='file' value='{{fileList}}'>\n if (type === 'file') return noop; // read-only\n\n // type='radio' name='{{twoway}}'\n if (type === 'radio' && element.binding && element.binding.attribute.name === 'name')\n return updateRadioValue;\n\n if (~textTypes.indexOf(type)) return updateStringValue;\n }\n\n return updateValue;\n }\n\n const node = element.node;\n\n // special case - <input type='radio' name='{{twoway}}' value='foo'>\n if (attribute.isTwoway && name === 'name') {\n if (node.type === 'radio') return updateRadioName;\n if (node.type === 'checkbox') return updateCheckboxName;\n }\n\n if (name === 'style') return updateStyleAttribute;\n\n if (name.indexOf('style-') === 0) return updateInlineStyle;\n\n // special case - class names. IE fucks things up, again\n if (name === 'class' && (!node.namespaceURI || node.namespaceURI === html))\n return updateClassName;\n\n if (name.indexOf('class-') === 0) return updateInlineClass;\n\n if (attribute.isBoolean) {\n const type = element.getAttribute('type');\n if (attribute.interpolator && name === 'checked' && (type === 'checkbox' || type === 'radio'))\n attribute.interpolator.bound = true;\n return updateBoolean;\n }\n\n if (attribute.namespace && attribute.namespace !== attribute.node.namespaceURI)\n return updateNamespacedAttribute;\n\n return updateAttribute;\n}\n\nfunction updateMultipleSelectValue(reset) {\n let value = this.getValue();\n\n if (!isArray(value)) value = [value];\n\n const options = this.node.options;\n let i = options.length;\n\n if (reset) {\n while (i--) options[i].selected = false;\n } else {\n while (i--) {\n const option = options[i];\n const optionValue = option._ractive ? option._ractive.value : option.value; // options inserted via a triple don't have _ractive\n\n option.selected = arrayContains(value, optionValue);\n }\n }\n}\n\nfunction updateSelectValue(reset) {\n const value = this.getValue();\n\n if (!this.locked) {\n // TODO is locked still a thing?\n this.node._ractive.value = value;\n\n const options = this.node.options;\n let i = options.length;\n let wasSelected = false;\n\n if (reset) {\n while (i--) options[i].selected = false;\n } else {\n while (i--) {\n const option = options[i];\n const optionValue = option._ractive ? option._ractive.value : option.value; // options inserted via a triple don't have _ractive\n if (option.disabled && option.selected) wasSelected = true;\n\n if (optionValue == value) {\n // double equals as we may be comparing numbers with strings\n option.selected = true;\n return;\n }\n }\n }\n\n if (!wasSelected) this.node.selectedIndex = -1;\n }\n}\n\nfunction updateContentEditableValue(reset) {\n const value = this.getValue();\n\n if (!this.locked) {\n if (reset) this.node.innerHTML = '';\n else this.node.innerHTML = isUndefined(value) ? '' : value;\n }\n}\n\nfunction updateRadioValue(reset) {\n const node = this.node;\n const wasChecked = node.checked;\n\n const value = this.getValue();\n\n if (reset) return (node.checked = false);\n\n //node.value = this.element.getAttribute( 'value' );\n node.value = this.node._ractive.value = value;\n node.checked = this.element.compare(value, this.element.getAttribute('name'));\n\n // This is a special case - if the input was checked, and the value\n // changed so that it's no longer checked, the twoway binding is\n // most likely out of date. To fix it we have to jump through some\n // hoops... this is a little kludgy but it works\n if (wasChecked && !node.checked && this.element.binding && this.element.binding.rendered) {\n this.element.binding.group.model.set(this.element.binding.group.getValue());\n }\n}\n\nfunction updateValue(reset) {\n if (!this.locked) {\n if (reset) {\n this.node.removeAttribute('value');\n this.node.value = this.node._ractive.value = null;\n } else {\n const value = this.getValue();\n\n this.node.value = this.node._ractive.value = value;\n this.node.setAttribute('value', safeToStringValue(value));\n }\n }\n}\n\nfunction updateStringValue(reset) {\n if (!this.locked) {\n if (reset) {\n this.node._ractive.value = '';\n this.node.removeAttribute('value');\n } else {\n const value = this.getValue();\n\n this.node._ractive.value = value;\n\n const safeValue = safeToStringValue(value);\n\n // fixes #3281 – Safari moves caret position when setting an input value to the same value\n if (this.node.value !== safeValue) {\n this.node.value = safeValue;\n }\n\n this.node.setAttribute('value', safeValue);\n }\n }\n}\n\nfunction updateRadioName(reset) {\n if (reset) this.node.checked = false;\n else this.node.checked = this.element.compare(this.getValue(), this.element.binding.getValue());\n}\n\nfunction updateCheckboxName(reset) {\n const { element, node } = this;\n const binding = element.binding;\n\n const value = this.getValue();\n const valueAttribute = element.getAttribute('value');\n\n if (reset) {\n // TODO: WAT?\n }\n\n if (!isArray(value)) {\n binding.isChecked = node.checked = element.compare(value, valueAttribute);\n } else {\n let i = value.length;\n while (i--) {\n if (element.compare(valueAttribute, value[i])) {\n binding.isChecked = node.checked = true;\n return;\n }\n }\n binding.isChecked = node.checked = false;\n }\n}\n\nfunction updateStyleAttribute(reset) {\n const props = reset ? {} : readStyle(this.getValue() || '');\n const style = this.node.style;\n const keys = objectKeys(props);\n const prev = this.previous || [];\n\n let i = 0;\n while (i < keys.length) {\n if (keys[i] in style) {\n const safe = props[keys[i]].replace('!important', '');\n style.setProperty(keys[i], safe, safe.length !== props[keys[i]].length ? 'important' : '');\n }\n i++;\n }\n\n // remove now-missing attrs\n i = prev.length;\n while (i--) {\n if (!~keys.indexOf(prev[i]) && prev[i] in style) style.setProperty(prev[i], '', '');\n }\n\n this.previous = keys;\n}\n\nfunction updateInlineStyle(reset) {\n if (!this.style) {\n this.style = hyphenateCamel(this.name.substr(6));\n }\n\n if (reset && this.node.style.getPropertyValue(this.style) !== this.last) return;\n\n const value = reset ? '' : safeToStringValue(this.getValue());\n const safe = value.replace('!important', '');\n this.node.style.setProperty(this.style, safe, safe.length !== value.length ? 'important' : '');\n this.last = this.node.style.getPropertyValue(this.style);\n}\n\nfunction updateClassName(reset) {\n const value = reset ? [] : readClass(safeToStringValue(this.getValue()));\n\n // watch out for weirdo svg elements\n let cls = this.node.className;\n cls = cls.baseVal !== undefined ? cls.baseVal : cls;\n\n const attr = readClass(cls);\n const prev = this.previous || [];\n\n const className = value.concat(attr.filter(c => !~prev.indexOf(c))).join(' ');\n\n if (className !== cls) {\n if (!isString(this.node.className)) {\n this.node.className.baseVal = className;\n } else {\n this.node.className = className;\n }\n }\n\n this.previous = value;\n}\n\nfunction updateInlineClass(reset) {\n const name = this.name.substr(6);\n\n // watch out for weirdo svg elements\n let cls = this.node.className;\n cls = cls.baseVal !== undefined ? cls.baseVal : cls;\n\n const attr = readClass(cls);\n const value = reset ? false : this.getValue();\n\n if (!this.inlineClass) this.inlineClass = name;\n\n if (value && !~attr.indexOf(name)) attr.push(name);\n else if (!value && ~attr.indexOf(name)) attr.splice(attr.indexOf(name), 1);\n\n if (!isString(this.node.className)) {\n this.node.className.baseVal = attr.join(' ');\n } else {\n this.node.className = attr.join(' ');\n }\n}\n\nfunction updateBoolean(reset) {\n // with two-way binding, only update if the change wasn't initiated by the user\n // otherwise the cursor will often be sent to the wrong place\n if (!this.locked) {\n if (reset) {\n if (this.useProperty) this.node[this.propertyName] = false;\n this.node.removeAttribute(this.propertyName);\n } else {\n if (this.useProperty) {\n this.node[this.propertyName] = this.getValue();\n } else {\n const val = this.getValue();\n if (val) {\n this.node.setAttribute(this.propertyName, isString(val) ? val : '');\n } else {\n this.node.removeAttribute(this.propertyName);\n }\n }\n }\n }\n}\n\nexport function updateAttribute(reset) {\n if (reset) {\n if (this.node.getAttribute(this.name) === this.value) {\n this.node.removeAttribute(this.name);\n }\n } else {\n this.value = safeToStringValue(this.getString());\n this.node.setAttribute(this.name, this.value);\n }\n}\n\nexport function updateNamespacedAttribute(reset) {\n if (reset) {\n if (\n this.value ===\n this.node.getAttributeNS(this.namespace, this.name.slice(this.name.indexOf(':') + 1))\n ) {\n this.node.removeAttributeNS(this.namespace, this.name.slice(this.name.indexOf(':') + 1));\n }\n } else {\n this.value = safeToStringValue(this.getString());\n this.node.setAttributeNS(\n this.namespace,\n this.name.slice(this.name.indexOf(':') + 1),\n this.value\n );\n }\n}\n","export default {\n 'accept-charset': 'acceptCharset',\n accesskey: 'accessKey',\n bgcolor: 'bgColor',\n class: 'className',\n codebase: 'codeBase',\n colspan: 'colSpan',\n contenteditable: 'contentEditable',\n datetime: 'dateTime',\n dirname: 'dirName',\n for: 'htmlFor',\n 'http-equiv': 'httpEquiv',\n ismap: 'isMap',\n maxlength: 'maxLength',\n novalidate: 'noValidate',\n pubdate: 'pubDate',\n readonly: 'readOnly',\n rowspan: 'rowSpan',\n tabindex: 'tabIndex',\n usemap: 'useMap'\n};\n","import { doc } from 'config/environment';\nimport { svg } from 'config/namespaces';\nimport { createElement } from 'utils/dom';\nimport { toArray } from 'utils/array';\nimport noop from 'utils/noop';\nimport Fragment from '../../Fragment';\nimport Item from '../shared/Item';\n\nconst div = doc ? createElement('div') : null;\n\nlet attributes = false;\nexport function inAttributes() {\n return attributes;\n}\n\nexport default class ConditionalAttribute extends Item {\n constructor(options) {\n super(options);\n\n this.attributes = [];\n\n this.owner = options.owner;\n\n this.fragment = new Fragment({\n ractive: this.ractive,\n owner: this,\n template: this.template\n });\n\n // this fragment can't participate in node-y things\n this.fragment.findNextNode = noop;\n\n this.dirty = false;\n }\n\n bind() {\n this.fragment.bind();\n }\n\n bubble() {\n if (!this.dirty) {\n this.dirty = true;\n this.owner.bubble();\n }\n }\n\n destroyed() {\n this.unrender();\n }\n\n render() {\n this.node = this.owner.node;\n if (this.node) {\n this.isSvg = this.node.namespaceURI === svg;\n }\n\n attributes = true;\n if (!this.rendered) this.fragment.render();\n\n this.rendered = true;\n this.dirty = true; // TODO this seems hacky, but necessary for tests to pass in browser AND node.js\n this.update();\n attributes = false;\n }\n\n toString() {\n return this.fragment.toString();\n }\n\n unbind(view) {\n this.fragment.unbind(view);\n }\n\n unrender() {\n this.rendered = false;\n this.fragment.unrender();\n }\n\n update() {\n let str;\n let attrs;\n\n if (this.dirty) {\n this.dirty = false;\n\n const current = attributes;\n attributes = true;\n this.fragment.update();\n\n if (this.rendered && this.node) {\n str = this.fragment.toString();\n\n attrs = parseAttributes(str, this.isSvg);\n\n // any attributes that previously existed but no longer do\n // must be removed\n this.attributes\n .filter(a => notIn(attrs, a))\n .forEach(a => {\n this.node.removeAttribute(a.name);\n });\n\n attrs.forEach(a => {\n this.node.setAttribute(a.name, a.value);\n });\n\n this.attributes = attrs;\n }\n\n attributes = current || false;\n }\n }\n}\n\nconst onlyWhitespace = /^\\s*$/;\nfunction parseAttributes(str, isSvg) {\n if (onlyWhitespace.test(str)) return [];\n const tagName = isSvg ? 'svg' : 'div';\n return str\n ? (div.innerHTML = `<${tagName} ${str}></${tagName}>`) && toArray(div.childNodes[0].attributes)\n : [];\n}\n\nfunction notIn(haystack, needle) {\n let i = haystack.length;\n\n while (i--) {\n if (haystack[i].name === needle.name) {\n return false;\n }\n }\n\n return true;\n}\n","import { INTERPOLATOR } from 'config/types';\nimport namespaces from 'config/namespaces';\nimport { safeAttributeString } from 'utils/dom';\nimport { booleanAttributes } from 'utils/html';\nimport hyphenateCamel from 'utils/hyphenateCamel';\nimport Fragment from '../../Fragment';\nimport Item from '../shared/Item';\nimport findElement from '../shared/findElement';\nimport getUpdateDelegate from './attribute/getUpdateDelegate';\nimport propertyNames from './attribute/propertyNames';\nimport { inAttributes } from './ConditionalAttribute';\nimport { isArray, isString, isUndefined } from 'utils/is';\n\nfunction lookupNamespace(node, prefix) {\n const qualified = `xmlns:${prefix}`;\n\n while (node) {\n if (node.hasAttribute && node.hasAttribute(qualified)) return node.getAttribute(qualified);\n node = node.parentNode;\n }\n\n return namespaces[prefix];\n}\n\nlet attribute = false;\nexport function inAttribute() {\n return attribute;\n}\n\nexport default class Attribute extends Item {\n constructor(options) {\n super(options);\n\n this.name = options.template.n;\n this.namespace = null;\n\n this.owner = options.owner || options.up.owner || options.element || findElement(options.up);\n this.element =\n options.element || (this.owner.attributeByName ? this.owner : findElement(options.up));\n this.up = options.up; // shared\n this.ractive = this.up.ractive;\n\n this.rendered = false;\n this.updateDelegate = null;\n this.fragment = null;\n\n this.element.attributeByName[this.name] = this;\n\n if (!isArray(options.template.f)) {\n this.value = options.template.f;\n if (this.value === 0) {\n this.value = '';\n } else if (isUndefined(this.value)) {\n this.value = true;\n }\n return;\n } else {\n this.fragment = new Fragment({\n owner: this,\n template: options.template.f\n });\n }\n\n this.interpolator =\n this.fragment &&\n this.fragment.items.length === 1 &&\n this.fragment.items[0].type === INTERPOLATOR &&\n this.fragment.items[0];\n\n if (this.interpolator) this.interpolator.owner = this;\n }\n\n bind() {\n if (this.fragment) {\n this.fragment.bind();\n }\n }\n\n bubble() {\n if (!this.dirty) {\n this.up.bubble();\n this.element.bubble();\n this.dirty = true;\n }\n }\n\n firstNode() {}\n\n getString() {\n attribute = true;\n const value = this.fragment\n ? this.fragment.toString()\n : this.value != null\n ? '' + this.value\n : '';\n attribute = false;\n return value;\n }\n\n // TODO could getValue ever be called for a static attribute,\n // or can we assume that this.fragment exists?\n getValue() {\n attribute = true;\n const value = this.fragment\n ? this.fragment.valueOf()\n : booleanAttributes[this.name.toLowerCase()]\n ? true\n : this.value;\n attribute = false;\n return value;\n }\n\n render() {\n const node = this.element.node;\n this.node = node;\n\n // should we use direct property access, or setAttribute?\n if (!node.namespaceURI || node.namespaceURI === namespaces.html) {\n this.propertyName = propertyNames[this.name] || this.name;\n\n if (node[this.propertyName] !== undefined) {\n this.useProperty = true;\n }\n\n // is attribute a boolean attribute or 'value'? If so we're better off doing e.g.\n // node.selected = true rather than node.setAttribute( 'selected', '' )\n if (booleanAttributes[this.name.toLowerCase()] || this.isTwoway) {\n this.isBoolean = true;\n }\n\n if (this.propertyName === 'value') {\n node._ractive.value = this.value;\n }\n }\n\n if (node.namespaceURI) {\n const index = this.name.indexOf(':');\n if (index !== -1) {\n this.namespace = lookupNamespace(node, this.name.slice(0, index));\n } else {\n this.namespace = node.namespaceURI;\n }\n }\n\n this.rendered = true;\n this.updateDelegate = getUpdateDelegate(this);\n this.updateDelegate();\n }\n\n toString() {\n if (inAttributes()) return '';\n attribute = true;\n\n const value = this.getValue();\n\n // Special case - select and textarea values (should not be stringified)\n if (\n this.name === 'value' &&\n (this.element.getAttribute('contenteditable') !== undefined ||\n (this.element.name === 'select' || this.element.name === 'textarea'))\n ) {\n return;\n }\n\n // Special case – bound radio `name` attributes\n if (\n this.name === 'name' &&\n this.element.name === 'input' &&\n this.interpolator &&\n this.element.getAttribute('type') === 'radio'\n ) {\n return `name=\"{{${this.interpolator.model.getKeypath()}}}\"`;\n }\n\n // Special case - style and class attributes and directives\n if (\n this.owner === this.element &&\n (this.name === 'style' || this.name === 'class' || this.style || this.inlineClass)\n ) {\n return;\n }\n\n if (\n !this.rendered &&\n this.owner === this.element &&\n (!this.name.indexOf('style-') || !this.name.indexOf('class-'))\n ) {\n if (!this.name.indexOf('style-')) {\n this.style = hyphenateCamel(this.name.substr(6));\n } else {\n this.inlineClass = this.name.substr(6);\n }\n\n return;\n }\n\n if (booleanAttributes[this.name.toLowerCase()])\n return value\n ? isString(value)\n ? `${this.name}=\"${safeAttributeString(value)}\"`\n : this.name\n : '';\n if (value == null) return '';\n\n const str = safeAttributeString(this.getString());\n attribute = false;\n\n return str ? `${this.name}=\"${str}\"` : this.name;\n }\n\n unbind(view) {\n if (this.fragment) this.fragment.unbind(view);\n }\n\n unrender() {\n this.updateDelegate(true);\n\n this.rendered = false;\n }\n\n update() {\n if (this.dirty) {\n let binding;\n this.dirty = false;\n if (this.fragment) this.fragment.update();\n if (this.rendered) this.updateDelegate();\n if (this.isTwoway && !this.locked) {\n this.interpolator.twowayBinding.lastVal(true, this.interpolator.model.get());\n } else if (this.name === 'value' && (binding = this.element.binding)) {\n // special case: name bound element with dynamic value\n const attr = binding.attribute;\n if (attr && !attr.dirty && attr.rendered) {\n this.element.binding.attribute.updateDelegate();\n }\n }\n }\n }\n}\n","import { INTERPOLATOR, ELEMENT } from 'config/types';\nimport Item from '../shared/Item';\nimport Fragment from '../../Fragment';\nimport findElement from '../shared/findElement';\nimport { isArray } from 'utils/is';\n\nexport default class BindingFlag extends Item {\n constructor(options) {\n super(options);\n\n this.owner = options.owner || options.up.owner || findElement(options.up);\n this.element = this.owner.attributeByName ? this.owner : findElement(options.up);\n this.flag = options.template.v === 'l' ? 'lazy' : 'twoway';\n this.bubbler = this.owner === this.element ? this.element : this.up;\n\n if (this.element.type === ELEMENT) {\n if (isArray(options.template.f)) {\n this.fragment = new Fragment({\n owner: this,\n template: options.template.f\n });\n }\n\n this.interpolator =\n this.fragment &&\n this.fragment.items.length === 1 &&\n this.fragment.items[0].type === INTERPOLATOR &&\n this.fragment.items[0];\n }\n }\n\n bind() {\n if (this.fragment) this.fragment.bind();\n set(this, this.getValue(), true);\n }\n\n bubble() {\n if (!this.dirty) {\n this.bubbler.bubble();\n this.dirty = true;\n }\n }\n\n getValue() {\n if (this.fragment) return this.fragment.valueOf();\n else if ('value' in this) return this.value;\n else if ('f' in this.template) return this.template.f;\n else return true;\n }\n\n render() {\n set(this, this.getValue(), true);\n }\n\n toString() {\n return '';\n }\n\n unbind(view) {\n if (this.fragment) this.fragment.unbind(view);\n\n delete this.element[this.flag];\n }\n\n unrender() {\n if (this.element.rendered) this.element.recreateTwowayBinding();\n }\n\n update() {\n if (this.dirty) {\n this.dirty = false;\n if (this.fragment) this.fragment.update();\n set(this, this.getValue(), true);\n }\n }\n}\n\nfunction set(flag, value, update) {\n if (value === 0) {\n flag.value = true;\n } else if (value === 'true') {\n flag.value = true;\n } else if (value === 'false' || value === '0') {\n flag.value = false;\n } else {\n flag.value = value;\n }\n\n const current = flag.element[flag.flag];\n flag.element[flag.flag] = flag.value;\n if (update && !flag.element.attributes.binding && current !== flag.value) {\n flag.element.recreateTwowayBinding();\n }\n\n return flag.value;\n}\n","import Item from './shared/Item';\nimport noop from 'utils/noop';\nimport { detachNode } from 'utils/dom';\nimport { doc } from 'config/environment';\nimport { assign, create } from 'utils/object';\n\nexport default function Comment(options) {\n Item.call(this, options);\n}\n\nconst proto = create(Item.prototype);\n\nassign(proto, {\n bind: noop,\n unbind: noop,\n update: noop,\n\n detach() {\n return detachNode(this.node);\n },\n\n firstNode() {\n return this.node;\n },\n\n render(target) {\n this.rendered = true;\n\n this.node = doc.createComment(this.template.c);\n target.appendChild(this.node);\n },\n\n toString() {\n return `<!-- ${this.template.c} -->`;\n },\n\n unrender(shouldDestroy) {\n if (this.rendered && shouldDestroy) this.detach();\n this.rendered = false;\n }\n});\n\nComment.prototype = proto;\n","import { SharedModel } from './SharedModel';\nimport { Missing } from '../LinkModel';\nimport { create } from 'utils/object';\n\nexport default class RactiveModel extends SharedModel {\n constructor(ractive) {\n super(ractive, '@this');\n this.ractive = ractive;\n }\n\n joinKey(key) {\n const model = super.joinKey(key);\n\n if ((key === 'root' || key === 'parent') && !model.isLink) return initLink(model, key);\n else if (key === 'data') return this.ractive.viewmodel;\n else if (key === 'cssData') return this.ractive.constructor._cssModel;\n\n return model;\n }\n}\n\nfunction initLink(model, key) {\n model.applyValue = function(value) {\n this.parent.value[key] = value;\n if (value && value.viewmodel) {\n this.link(value.viewmodel.getRactiveModel(), key);\n this._link.markedAll();\n } else {\n this.link(create(Missing), key);\n this._link.markedAll();\n }\n };\n\n if (key === 'root') {\n const mark = model.mark;\n model.mark = function(force) {\n if (this._marking) return;\n this._marking = true;\n mark.apply(this, force);\n this._marking = false;\n };\n }\n\n model.applyValue(model.parent.ractive[key], key);\n model._link.set = v => model.applyValue(v);\n model._link.applyValue = v => model.applyValue(v);\n\n return model._link;\n}\n","import { capture } from 'src/global/capture';\nimport Model from './Model';\nimport { handleChange, mark } from 'shared/methodCallers';\nimport RactiveModel from './specials/RactiveModel';\nimport SharedModel, { GlobalModel, SharedModel as SharedBase } from './specials/SharedModel';\nimport { splitKeypath, unescapeKey } from 'shared/keypaths';\nimport resolveReference from 'src/view/resolvers/resolveReference';\nimport noop from 'utils/noop';\n\nconst specialModels = {\n '@this'(root) {\n return root.getRactiveModel();\n },\n '@global'() {\n return GlobalModel;\n },\n '@shared'() {\n return SharedModel;\n },\n '@style'(root) {\n return root.getRactiveModel().joinKey('cssData');\n },\n '@helpers'(root) {\n return root.getHelpers();\n }\n};\nspecialModels['@'] = specialModels['@this'];\n\nexport default class RootModel extends Model {\n constructor(options) {\n super(null, null);\n\n this.isRoot = true;\n this.root = this;\n this.ractive = options.ractive; // TODO sever this link\n\n this.value = options.data;\n this.adaptors = options.adapt;\n this.adapt();\n }\n\n attached(fragment) {\n attachImplicits(this, fragment);\n }\n\n createLink(keypath, target, targetPath, options) {\n const keys = splitKeypath(keypath);\n\n let model = this;\n while (keys.length) {\n const key = keys.shift();\n model = model.childByKey[key] || model.joinKey(key);\n }\n\n return model.link(target, targetPath, options);\n }\n\n detached() {\n detachImplicits(this);\n }\n\n get(shouldCapture, options) {\n if (shouldCapture) capture(this);\n\n if (!options || options.virtual !== false) {\n return this.getVirtual();\n } else {\n return this.value;\n }\n }\n\n getHelpers() {\n if (!this.helpers) this.helpers = new SharedBase(this.ractive.helpers, 'helpers', this.ractive);\n return this.helpers;\n }\n\n getKeypath() {\n return '';\n }\n\n getRactiveModel() {\n return this.ractiveModel || (this.ractiveModel = new RactiveModel(this.ractive));\n }\n\n getValueChildren() {\n const children = super.getValueChildren(this.value);\n\n this.children.forEach(child => {\n if (child._link) {\n const idx = children.indexOf(child);\n if (~idx) children.splice(idx, 1, child._link);\n else children.push(child._link);\n }\n });\n\n return children;\n }\n\n has(key) {\n if (key[0] === '~' && key[1] === '/') key = key.slice(2);\n if (specialModels[key] || key === '') return true;\n\n if (super.has(key)) {\n return true;\n } else {\n const unescapedKey = unescapeKey(key);\n\n // mappings/links and computations\n if (this.childByKey[unescapedKey] && this.childByKey[unescapedKey]._link) return true;\n }\n }\n\n joinKey(key, opts) {\n if (key[0] === '~' && key[1] === '/') key = key.slice(2);\n\n if (key[0] === '@') {\n const fn = specialModels[key];\n if (fn) return fn(this);\n } else {\n return super.joinKey(key, opts);\n }\n }\n\n set(value) {\n // TODO wrapping root node is a baaaad idea. We should prevent this\n const wrapper = this.wrapper;\n if (wrapper) {\n const shouldTeardown = !wrapper.reset || wrapper.reset(value) === false;\n\n if (shouldTeardown) {\n wrapper.teardown();\n this.wrapper = null;\n this.value = value;\n this.adapt();\n }\n } else {\n this.value = value;\n this.adapt();\n }\n\n this.deps.forEach(handleChange);\n this.children.forEach(mark);\n }\n\n retrieve() {\n return this.wrapper ? this.wrapper.get() : this.value;\n }\n\n teardown() {\n super.teardown();\n this.ractiveModel && this.ractiveModel.teardown();\n }\n}\nRootModel.prototype.update = noop;\n\nfunction attachImplicits(model, fragment) {\n if (model._link && model._link.implicit && model._link.isDetached()) {\n model.attach(fragment);\n }\n\n // look for virtual children to relink and cascade\n for (const k in model.childByKey) {\n if (model.value) {\n if (k in model.value) {\n attachImplicits(model.childByKey[k], fragment);\n } else if (!model.childByKey[k]._link || model.childByKey[k]._link.isDetached()) {\n const mdl = resolveReference(fragment, k);\n if (mdl) {\n model.childByKey[k].link(mdl, k, { implicit: true });\n }\n }\n }\n }\n}\n\nfunction detachImplicits(model) {\n if (model._link && model._link.implicit) {\n model.unlink();\n }\n\n for (const k in model.childByKey) {\n detachImplicits(model.childByKey[k]);\n }\n}\n","import { fatal, warnIfDebug, welcome } from 'utils/log';\nimport { missingPlugin } from 'config/errors';\nimport { ensureArray, combine } from 'utils/array';\nimport { findInViewHierarchy } from 'shared/registry';\nimport dataConfigurator from './config/custom/data';\nimport RootModel from 'src/model/RootModel';\nimport hooks from 'src/events/Hook';\nimport subscribe from './helpers/subscribe';\nimport Ractive from '../Ractive';\nimport { ATTRIBUTE, BINDING_FLAG, DECORATOR, INTERPOLATOR, TRANSITION } from 'config/types';\nimport { assign, create, hasOwn } from 'utils/object';\nimport { isArray, isString } from 'utils/is';\nimport { compute } from 'src/Ractive/prototype/compute';\nimport getRactiveContext from '../shared/getRactiveContext';\n\nconst registryNames = [\n 'adaptors',\n 'components',\n 'decorators',\n 'easing',\n 'events',\n 'interpolators',\n 'partials',\n 'transitions'\n];\n\nconst protoRegistries = ['computed', 'helpers'];\n\nlet uid = 0;\n\nexport default function construct(ractive, options) {\n if (Ractive.DEBUG) welcome();\n\n initialiseProperties(ractive);\n handleAttributes(ractive);\n\n // set up event subscribers\n subscribe(ractive, options, 'on');\n\n // if there's not a delegation setting, inherit from parent if it's not default\n if (\n !hasOwn(options, 'delegate') &&\n ractive.parent &&\n ractive.parent.delegate !== ractive.delegate\n ) {\n ractive.delegate = false;\n }\n\n // plugins that need to run at construct\n if (isArray(options.use)) {\n ractive.use.apply(ractive, options.use.filter(p => p.construct));\n }\n\n hooks.construct.fire(ractive, options);\n if (options.onconstruct) options.onconstruct.call(ractive, getRactiveContext(ractive), options);\n\n // Add registries\n let i = registryNames.length;\n while (i--) {\n const name = registryNames[i];\n ractive[name] = assign(create(ractive.constructor[name] || null), options[name]);\n }\n\n i = protoRegistries.length;\n while (i--) {\n const name = protoRegistries[i];\n ractive[name] = assign(create(ractive.constructor.prototype[name]), options[name]);\n }\n\n if (ractive._attributePartial) {\n ractive.partials['extra-attributes'] = ractive._attributePartial;\n delete ractive._attributePartial;\n }\n\n // Create a viewmodel\n const viewmodel = new RootModel({\n adapt: getAdaptors(ractive, ractive.adapt, options),\n data: dataConfigurator.init(ractive.constructor, ractive, options),\n ractive\n });\n\n // once resolved, share the adaptors array between the root model and instance\n ractive.adapt = viewmodel.adaptors;\n\n ractive.viewmodel = viewmodel;\n\n for (const k in ractive.computed) {\n compute.call(ractive, k, ractive.computed[k]);\n }\n}\n\nfunction getAdaptors(ractive, protoAdapt, options) {\n protoAdapt = protoAdapt.map(lookup);\n const adapt = ensureArray(options.adapt).map(lookup);\n\n const srcs = [protoAdapt, adapt];\n if (ractive.parent && !ractive.isolated) {\n srcs.push(ractive.parent.viewmodel.adaptors);\n }\n\n return combine.apply(null, srcs);\n\n function lookup(adaptor) {\n if (isString(adaptor)) {\n adaptor = findInViewHierarchy('adaptors', ractive, adaptor);\n\n if (!adaptor) {\n fatal(missingPlugin(adaptor, 'adaptor'));\n }\n }\n\n return adaptor;\n }\n}\n\nfunction initialiseProperties(ractive) {\n // Generate a unique identifier, for places where you'd use a weak map if it\n // existed\n ractive._guid = 'r-' + uid++;\n\n // events\n ractive._subs = create(null);\n ractive._nsSubs = 0;\n\n // storage for item configuration from instantiation to reset,\n // like dynamic functions or original values\n ractive._config = {};\n\n // events\n ractive.event = null;\n ractive._eventQueue = [];\n\n // observers\n ractive._observers = [];\n\n // external children\n ractive._children = [];\n ractive._children.byName = {};\n ractive.children = ractive._children;\n\n if (!ractive.component) {\n ractive.root = ractive;\n ractive.parent = ractive.container = null; // TODO container still applicable?\n }\n}\n\nfunction handleAttributes(ractive) {\n const component = ractive.component;\n const attributes = ractive.constructor.attributes;\n\n if (attributes && component) {\n const tpl = component.template;\n const attrs = tpl.m ? tpl.m.slice() : [];\n\n // grab all of the passed attribute names\n const props = attrs.filter(a => a.t === ATTRIBUTE).map(a => a.n);\n\n // warn about missing requireds\n attributes.required.forEach(p => {\n if (!~props.indexOf(p)) {\n warnIfDebug(`Component '${component.name}' requires attribute '${p}' to be provided`);\n }\n });\n\n // set up a partial containing non-property attributes\n const all = attributes.optional.concat(attributes.required);\n const partial = [];\n let i = attrs.length;\n while (i--) {\n const a = attrs[i];\n if (a.t === ATTRIBUTE && !~all.indexOf(a.n)) {\n if (attributes.mapAll) {\n // map the attribute if requested and make the extra attribute in the partial refer to the mapping\n partial.unshift({\n t: ATTRIBUTE,\n n: a.n,\n f: [{ t: INTERPOLATOR, r: `~/${a.n}` }]\n });\n } else {\n // transfer the attribute to the extra attributes partal\n partial.unshift(attrs.splice(i, 1)[0]);\n }\n } else if (\n !attributes.mapAll &&\n (a.t === DECORATOR || a.t === TRANSITION || a.t === BINDING_FLAG)\n ) {\n partial.unshift(attrs.splice(i, 1)[0]);\n }\n }\n\n if (partial.length) component.template = { t: tpl.t, e: tpl.e, f: tpl.f, m: attrs, p: tpl.p };\n ractive._attributePartial = partial;\n }\n}\n","import runloop from 'src/global/runloop';\nimport { updateAnchors } from 'shared/anchors';\nimport { bind, render as callRender, unbind, unrender, update } from 'shared/methodCallers';\nimport { teardown } from 'src/Ractive/prototype/teardown';\nimport getRactiveContext from 'shared/getRactiveContext';\nimport { warnIfDebug } from 'utils/log';\nimport { createDocumentFragment } from 'utils/dom';\nimport {\n ANCHOR,\n ATTRIBUTE,\n BINDING_FLAG,\n COMPONENT,\n DECORATOR,\n EVENT,\n TRANSITION,\n YIELDER\n} from 'config/types';\nimport construct from 'src/Ractive/construct';\nimport initialise from 'src/Ractive/initialise';\nimport render from 'src/Ractive/render';\nimport Item from './shared/Item';\nimport ConditionalAttribute from './element/ConditionalAttribute';\nimport createItem from './createItem';\nimport parser from 'src/Ractive/config/runtime-parser';\nimport { assign, create } from 'utils/object';\nimport { isArray, isString } from 'utils/is';\n\nexport default class Component extends Item {\n constructor(options, ComponentConstructor) {\n super(options);\n let template = options.template;\n this.isAnchor = template.t === ANCHOR;\n this.type = this.isAnchor ? ANCHOR : COMPONENT; // override ELEMENT from super\n let attrs = template.m;\n\n const partials = template.p || {};\n if (!('content' in partials)) partials.content = template.f || [];\n this._partials = partials; // TEMP\n\n if (this.isAnchor) {\n this.name = template.n;\n\n this.addChild = addChild;\n this.removeChild = removeChild;\n } else {\n const instance = new ComponentConstructor({ component: true });\n\n this.instance = instance;\n this.name = template.e;\n\n if (instance.el || instance.target) {\n warnIfDebug(\n `The <${this.name}> component has a default '${\n instance.el ? 'el' : 'target'\n }' property; it has been disregarded`\n );\n instance.el = instance.target = null;\n }\n\n // find container\n let fragment = options.up;\n let container;\n while (fragment) {\n if (fragment.owner.type === YIELDER) {\n container = fragment.owner.container;\n break;\n }\n\n fragment = fragment.parent;\n }\n\n // add component-instance-specific properties\n instance.parent = this.up.ractive;\n instance.container = container || null;\n instance.root = instance.parent.root;\n instance.component = this;\n\n construct(this.instance, { partials }, ComponentConstructor);\n\n // these can be modified during construction\n template = this.template;\n attrs = template.m;\n\n // allow components that are so inclined to add programmatic mappings\n if (isArray(this.mappings)) {\n attrs = (attrs || []).concat(this.mappings);\n } else if (isString(this.mappings)) {\n attrs = (attrs || []).concat(parser.parse(this.mappings, { attributes: true }).t);\n }\n\n // for hackability, this could be an open option\n // for any ractive instance, but for now, just\n // for components and just for ractive...\n instance._inlinePartials = partials;\n }\n\n this.attributeByName = {};\n this.attributes = [];\n\n if (attrs) {\n const leftovers = [];\n attrs.forEach(template => {\n switch (template.t) {\n case ATTRIBUTE:\n case EVENT:\n this.attributes.push(\n createItem({\n owner: this,\n up: this.up,\n template\n })\n );\n break;\n\n case TRANSITION:\n case BINDING_FLAG:\n case DECORATOR:\n break;\n\n default:\n leftovers.push(template);\n break;\n }\n });\n\n if (leftovers.length) {\n this.attributes.push(\n new ConditionalAttribute({\n owner: this,\n up: this.up,\n template: leftovers\n })\n );\n }\n }\n\n this.eventHandlers = [];\n }\n\n bind() {\n if (!this.isAnchor) {\n this.attributes.forEach(bind);\n this.eventHandlers.forEach(bind);\n\n initialise(\n this.instance,\n {\n partials: this._partials\n },\n {\n cssIds: this.up.cssIds\n }\n );\n\n if (this.instance.target || this.instance.el) this.extern = true;\n\n this.bound = true;\n }\n }\n\n bubble() {\n if (!this.dirty) {\n this.dirty = true;\n this.up.bubble();\n }\n }\n\n destroyed() {\n if (!this.isAnchor && this.instance.fragment) this.instance.fragment.destroyed();\n }\n\n detach() {\n if (this.isAnchor) {\n if (this.instance) return this.instance.fragment.detach();\n return createDocumentFragment();\n }\n\n return this.instance.fragment.detach();\n }\n\n find(selector, options) {\n if (this.instance) return this.instance.fragment.find(selector, options);\n }\n\n findAll(selector, options) {\n if (this.instance) this.instance.fragment.findAll(selector, options);\n }\n\n findComponent(name, options) {\n if (!name || this.name === name) return this.instance;\n\n if (this.instance.fragment) {\n return this.instance.fragment.findComponent(name, options);\n }\n }\n\n findAllComponents(name, options) {\n const { result } = options;\n\n if (this.instance && (!name || this.name === name)) {\n result.push(this.instance);\n }\n\n if (this.instance) this.instance.findAllComponents(name, options);\n }\n\n firstNode(skipParent) {\n if (this.instance) return this.instance.fragment.firstNode(skipParent);\n }\n\n getContext(...assigns) {\n assigns.unshift(this.instance);\n return getRactiveContext.apply(null, assigns);\n }\n\n rebound(update) {\n this.attributes.forEach(x => x.rebound(update));\n }\n\n render(target, occupants) {\n if (this.isAnchor) {\n this.rendered = true;\n this.target = target;\n\n if (!checking.length) {\n checking.push(this.ractive);\n if (occupants) {\n this.occupants = occupants;\n checkAnchors();\n this.occupants = null;\n } else {\n runloop.scheduleTask(checkAnchors, true);\n }\n }\n } else {\n this.attributes.forEach(callRender);\n this.eventHandlers.forEach(callRender);\n\n if (this.extern) {\n this.instance.delegate = false;\n this.instance.render();\n } else {\n render(this.instance, target, null, occupants);\n }\n\n this.rendered = true;\n }\n }\n\n shuffled() {\n super.shuffled();\n this.instance &&\n !this.instance.isolated &&\n this.instance.fragment &&\n this.instance.fragment.shuffled();\n }\n\n toString() {\n if (this.instance) return this.instance.toHTML();\n }\n\n unbind(view) {\n if (!this.isAnchor) {\n this.bound = false;\n\n this.attributes.forEach(unbind);\n\n if (view) this.instance.fragment.unbind();\n else teardown(this.instance, () => runloop.promise());\n }\n }\n\n unrender(shouldDestroy) {\n this.shouldDestroy = shouldDestroy;\n\n if (this.isAnchor) {\n if (this.item) unrenderItem(this, this.item);\n this.target = null;\n if (!checking.length) {\n checking.push(this.ractive);\n runloop.scheduleTask(checkAnchors, true);\n }\n } else {\n this.instance.unrender();\n this.instance.el = this.instance.target = null;\n this.attributes.forEach(unrender);\n this.eventHandlers.forEach(unrender);\n }\n\n this.rendered = false;\n }\n\n update() {\n this.dirty = false;\n if (this.instance) {\n this.instance.fragment.update();\n this.attributes.forEach(update);\n this.eventHandlers.forEach(update);\n }\n }\n}\n\nfunction addChild(meta) {\n if (this.item) this.removeChild(this.item);\n\n const child = meta.instance;\n meta.anchor = this;\n\n meta.up = this.up;\n meta.name = meta.nameOption || this.name;\n this.name = meta.name;\n\n if (!child.isolated) child.viewmodel.attached(this.up);\n\n // render as necessary\n if (this.rendered) {\n renderItem(this, meta);\n }\n}\n\nfunction removeChild(meta) {\n // unrender as necessary\n if (this.item === meta) {\n unrenderItem(this, meta);\n this.name = this.template.n;\n }\n}\n\nfunction renderItem(anchor, meta) {\n if (!anchor.rendered) return;\n\n meta.shouldDestroy = false;\n meta.up = anchor.up;\n\n anchor.item = meta;\n anchor.instance = meta.instance;\n const nextNode = anchor.up.findNextNode(anchor);\n\n if (meta.instance.fragment.rendered) {\n meta.instance.unrender();\n }\n\n meta.partials = meta.instance.partials;\n meta.instance.partials = assign(create(meta.partials), meta.partials, anchor._partials);\n\n meta.instance.fragment.unbind(true);\n meta.instance.fragment.componentParent = anchor.up;\n meta.instance.fragment.bind(meta.instance.viewmodel);\n\n anchor.attributes.forEach(bind);\n anchor.eventHandlers.forEach(bind);\n anchor.attributes.forEach(callRender);\n anchor.eventHandlers.forEach(callRender);\n\n const target = anchor.up.findParentNode();\n render(meta.instance, target, target.contains(nextNode) ? nextNode : null, anchor.occupants);\n\n if (meta.lastBound !== anchor) {\n meta.lastBound = anchor;\n }\n}\n\nfunction unrenderItem(anchor, meta) {\n if (!anchor.rendered) return;\n\n meta.shouldDestroy = true;\n meta.instance.unrender();\n\n anchor.eventHandlers.forEach(unrender);\n anchor.attributes.forEach(unrender);\n anchor.eventHandlers.forEach(unbind);\n anchor.attributes.forEach(unbind);\n\n meta.instance.el = meta.instance.anchor = null;\n meta.instance.fragment.componentParent = null;\n meta.up = null;\n meta.anchor = null;\n anchor.item = null;\n anchor.instance = null;\n}\n\nlet checking = [];\nexport function checkAnchors() {\n const list = checking;\n checking = [];\n\n list.forEach(updateAnchors);\n}\n","import { capture } from 'src/global/capture';\nimport Model from './Model';\nimport { handleChange, mark, marked } from 'shared/methodCallers';\nimport { hasOwn } from 'utils/object';\nimport { isUndefined } from 'utils/is';\n\nexport default class ComputationChild extends Model {\n constructor(parent, key) {\n super(parent, key);\n\n this.isReadonly = !this.root.ractive.syncComputedChildren;\n this.dirty = true;\n this.isComputed = true;\n }\n\n get setRoot() {\n return this.parent.setRoot;\n }\n\n applyValue(value) {\n super.applyValue(value);\n\n if (!this.isReadonly) {\n let source = this.parent;\n // computed models don't have a shuffle method\n while (source && source.shuffle) {\n source = source.parent;\n }\n\n if (source) {\n source.dependencies.forEach(mark);\n }\n }\n\n if (this.setRoot) {\n this.setRoot.set(this.setRoot.value);\n }\n }\n\n get(shouldCapture, opts) {\n if (shouldCapture) capture(this);\n\n if (this.dirty) {\n const parentValue = this.parent.get();\n this.value = parentValue ? parentValue[this.key] : undefined;\n if (this.wrapper) this.newWrapperValue = this.value;\n this.adapt();\n }\n\n this.dirty = false;\n\n return (opts && 'unwrap' in opts ? opts.unwrap !== false : shouldCapture) && this.wrapper\n ? this.wrapperValue\n : this.value;\n }\n\n handleChange() {\n if (this.dirty) {\n this.deps.forEach(handleChange);\n return;\n }\n\n this.dirty = true;\n\n if (this.boundValue) this.boundValue = null;\n\n this.links.forEach(marked);\n this.deps.forEach(handleChange);\n this.children.forEach(handleChange);\n }\n\n joinKey(key) {\n if (isUndefined(key) || key === '') return this;\n\n if (!hasOwn(this.childByKey, key)) {\n const child = new ComputationChild(this, key);\n this.children.push(child);\n this.childByKey[key] = child;\n }\n\n return this.childByKey[key];\n }\n}\n","/* global console */\n/* eslint no-console:\"off\" */\n\nimport { capture, startCapturing, stopCapturing } from 'src/global/capture';\nimport { warnIfDebug } from 'utils/log';\nimport Model, { shared } from './Model';\nimport { maybeBind, noVirtual } from './ModelBase';\nimport ComputationChild from './ComputationChild';\nimport { hasConsole } from 'config/environment';\nimport { isEqual } from 'utils/is';\nimport runloop from 'src/global/runloop';\n\nexport default class Computation extends Model {\n constructor(parent, signature, key) {\n super(parent, key);\n\n this.signature = signature;\n\n this.isReadonly = !this.signature.setter;\n this.isComputed = true;\n\n this.dependencies = [];\n\n this.children = [];\n this.childByKey = {};\n\n this.deps = [];\n\n this.dirty = true;\n\n // TODO: is there a less hackish way to do this?\n this.shuffle = undefined;\n }\n\n get setRoot() {\n if (this.signature.setter) return this;\n }\n\n get(shouldCapture, opts) {\n if (shouldCapture) capture(this);\n\n if (this.dirty) {\n const old = this.value;\n this.value = this.getValue();\n // this may cause a view somewhere to update, so it must be in a runloop\n if (!runloop.active()) {\n runloop.start();\n if (!isEqual(old, this.value)) this.notifyUpstream();\n runloop.end();\n } else {\n if (!isEqual(old, this.value)) this.notifyUpstream();\n }\n if (this.wrapper) this.newWrapperValue = this.value;\n this.adapt();\n this.dirty = false;\n }\n\n // if capturing, this value needs to be unwrapped because it's for external use\n return maybeBind(\n this,\n // if unwrap is supplied, it overrides capture\n this.wrapper && (opts && 'unwrap' in opts ? opts.unwrap !== false : shouldCapture)\n ? this.wrapperValue\n : this.value,\n !opts || opts.shouldBind !== false\n );\n }\n\n getContext() {\n return this.parent.isRoot ? this.root.ractive : this.parent.get(false, noVirtual);\n }\n\n getValue() {\n startCapturing();\n let result;\n\n try {\n result = this.signature.getter.call(this.root.ractive, this.getContext(), this.getKeypath());\n } catch (err) {\n warnIfDebug(`Failed to compute ${this.getKeypath()}: ${err.message || err}`);\n\n // TODO this is all well and good in Chrome, but...\n // ...also, should encapsulate this stuff better, and only\n // show it if Ractive.DEBUG\n if (hasConsole) {\n if (console.groupCollapsed)\n console.groupCollapsed(\n '%cshow details',\n 'color: rgb(82, 140, 224); font-weight: normal; text-decoration: underline;'\n );\n const sig = this.signature;\n console.error(\n `${err.name}: ${err.message}\\n\\n${sig.getterString}${\n sig.getterUseStack ? '\\n\\n' + err.stack : ''\n }`\n );\n if (console.groupCollapsed) console.groupEnd();\n }\n }\n\n const dependencies = stopCapturing();\n if (this.parent.keypath && !~dependencies.indexOf(this.parent)) dependencies.push(this.parent);\n this.setDependencies(dependencies);\n\n return result;\n }\n\n mark() {\n this.handleChange();\n }\n\n rebind(next, previous) {\n // computations will grab all of their deps again automagically\n if (next !== previous) this.handleChange();\n }\n\n set(value) {\n if (this.isReadonly) {\n throw new Error(`Cannot set read-only computed value '${this.key}'`);\n }\n\n this.signature.setter(value, this.getContext(), this.getKeypath());\n this.mark();\n }\n\n setDependencies(dependencies) {\n // unregister any soft dependencies we no longer have\n let i = this.dependencies.length;\n while (i--) {\n const model = this.dependencies[i];\n if (!~dependencies.indexOf(model)) model.unregister(this);\n }\n\n // and add any new ones\n i = dependencies.length;\n while (i--) {\n const model = dependencies[i];\n if (!~this.dependencies.indexOf(model)) model.register(this);\n }\n\n this.dependencies = dependencies;\n }\n\n teardown() {\n let i = this.dependencies.length;\n while (i--) {\n if (this.dependencies[i]) this.dependencies[i].unregister(this);\n }\n if (this.parent.computed[this.key] === this) delete this.parent.computed[this.key];\n super.teardown();\n }\n}\n\nconst prototype = Computation.prototype;\nconst child = ComputationChild.prototype;\nprototype.handleChange = child.handleChange;\nprototype.joinKey = child.joinKey;\n\nshared.Computation = Computation;\n","/* global console */\n/* eslint no-console:\"off\" */\n\nimport { hasConsole } from '../config/environment';\nimport Ractive from '../Ractive';\nimport noop from './noop';\nimport { isObjectType } from 'utils/is';\n\nconst alreadyWarned = {};\nlet log, printWarning, welcome;\n\nif (hasConsole) {\n const welcomeIntro = [\n `%cRactive.js %cBUILD_PLACEHOLDER_VERSION %cin debug mode, %cmore...`,\n 'color: rgb(114, 157, 52); font-weight: normal;',\n 'color: rgb(85, 85, 85); font-weight: normal;',\n 'color: rgb(85, 85, 85); font-weight: normal;',\n 'color: rgb(82, 140, 224); font-weight: normal; text-decoration: underline;'\n ];\n const welcomeMessage = `You're running Ractive BUILD_PLACEHOLDER_VERSION in debug mode - messages will be printed to the console to help you fix problems and optimise your application.\n\nTo disable debug mode, add this line at the start of your app:\n Ractive.DEBUG = false;\n\nTo disable debug mode when your app is minified, add this snippet:\n Ractive.DEBUG = /unminified/.test(function(){/*unminified*/});\n\nGet help and support:\n http://ractive.js.org\n http://stackoverflow.com/questions/tagged/ractivejs\n http://groups.google.com/forum/#!forum/ractive-js\n http://twitter.com/ractivejs\n\nFound a bug? Raise an issue:\n https://github.com/ractivejs/ractive/issues\n\n`;\n\n welcome = () => {\n if (Ractive.WELCOME_MESSAGE === false) {\n welcome = noop;\n return;\n }\n const message = 'WELCOME_MESSAGE' in Ractive ? Ractive.WELCOME_MESSAGE : welcomeMessage;\n const hasGroup = !!console.groupCollapsed;\n if (hasGroup) console.groupCollapsed.apply(console, welcomeIntro);\n console.log(message);\n if (hasGroup) {\n console.groupEnd(welcomeIntro);\n }\n\n welcome = noop;\n };\n\n printWarning = (message, args) => {\n welcome();\n\n // extract information about the instance this message pertains to, if applicable\n if (isObjectType(args[args.length - 1])) {\n const options = args.pop();\n const ractive = options ? options.ractive : null;\n\n if (ractive) {\n // if this is an instance of a component that we know the name of, add\n // it to the message\n let name;\n if (ractive.component && (name = ractive.component.name)) {\n message = `<${name}> ${message}`;\n }\n\n let node;\n if (\n (node =\n options.node || (ractive.fragment && ractive.fragment.rendered && ractive.find('*')))\n ) {\n args.push(node);\n }\n }\n }\n\n console.warn.apply(\n console,\n ['%cRactive.js: %c' + message, 'color: rgb(114, 157, 52);', 'color: rgb(85, 85, 85);'].concat(\n args\n )\n );\n };\n\n log = function() {\n console.log.apply(console, arguments);\n };\n} else {\n printWarning = log = welcome = noop;\n}\n\nfunction format(message, args) {\n return message.replace(/%s/g, () => args.shift());\n}\n\nfunction fatal(message, ...args) {\n message = format(message, args);\n throw new Error(message);\n}\n\nfunction logIfDebug() {\n if (Ractive.DEBUG) {\n log.apply(null, arguments);\n }\n}\n\nfunction warn(message, ...args) {\n message = format(message, args);\n printWarning(message, args);\n}\n\nfunction warnOnce(message, ...args) {\n message = format(message, args);\n\n if (alreadyWarned[message]) {\n return;\n }\n\n alreadyWarned[message] = true;\n printWarning(message, args);\n}\n\nfunction warnIfDebug() {\n if (Ractive.DEBUG) {\n warn.apply(null, arguments);\n }\n}\n\nfunction warnOnceIfDebug() {\n if (Ractive.DEBUG) {\n warnOnce.apply(null, arguments);\n }\n}\n\nexport { fatal, log, logIfDebug, warn, warnOnce, warnIfDebug, warnOnceIfDebug, welcome };\n","// Error messages that are used (or could be) in multiple places\nexport const badArguments = 'Bad arguments';\nexport const noRegistryFunctionReturn =\n 'A function was specified for \"%s\" %s, but no %s was returned';\nexport const missingPlugin = (name, type) =>\n `Missing \"${name}\" ${type} plugin. You may need to download a plugin via http://ractive.js.org/integrations/#${type}s`;\n","import { isArray, isObject, isNumeric } from 'utils/is';\nimport interpolate from 'shared/interpolate';\nimport { hasOwn } from 'utils/object';\n\nconst interpolators = {\n number(from, to) {\n if (!isNumeric(from) || !isNumeric(to)) {\n return null;\n }\n\n from = +from;\n to = +to;\n\n const delta = to - from;\n\n if (!delta) {\n return function() {\n return from;\n };\n }\n\n return function(t) {\n return from + t * delta;\n };\n },\n\n array(from, to) {\n let len, i;\n\n if (!isArray(from) || !isArray(to)) {\n return null;\n }\n\n const intermediate = [];\n const interpolators = [];\n\n i = len = Math.min(from.length, to.length);\n while (i--) {\n interpolators[i] = interpolate(from[i], to[i]);\n }\n\n // surplus values - don't interpolate, but don't exclude them either\n for (i = len; i < from.length; i += 1) {\n intermediate[i] = from[i];\n }\n\n for (i = len; i < to.length; i += 1) {\n intermediate[i] = to[i];\n }\n\n return function(t) {\n let i = len;\n\n while (i--) {\n intermediate[i] = interpolators[i](t);\n }\n\n return intermediate;\n };\n },\n\n object(from, to) {\n if (!isObject(from) || !isObject(to)) {\n return null;\n }\n\n const properties = [];\n const intermediate = {};\n const interpolators = {};\n\n for (const prop in from) {\n if (hasOwn(from, prop)) {\n if (hasOwn(to, prop)) {\n properties.push(prop);\n interpolators[prop] = interpolate(from[prop], to[prop]) || (() => to[prop]);\n } else {\n intermediate[prop] = from[prop];\n }\n }\n }\n\n for (const prop in to) {\n if (hasOwn(to, prop) && !hasOwn(from, prop)) {\n intermediate[prop] = to[prop];\n }\n }\n\n const len = properties.length;\n\n return function(t) {\n let i = len;\n\n while (i--) {\n const prop = properties[i];\n\n intermediate[prop] = interpolators[prop](t);\n }\n\n return intermediate;\n };\n }\n};\n\nexport default interpolators;\n","import { isString } from 'utils/is';\n\nconst refPattern = /\\[\\s*(\\*|[0-9]|[1-9][0-9]+)\\s*\\]/g;\nconst splitPattern = /([^\\\\](?:\\\\\\\\)*)\\./;\nconst escapeKeyPattern = /\\\\|\\./g;\nconst unescapeKeyPattern = /((?:\\\\)+)\\1|\\\\(\\.)/g;\n\nexport function escapeKey(key) {\n if (isString(key)) {\n return key.replace(escapeKeyPattern, '\\\\$&');\n }\n\n return key;\n}\n\nexport function normalise(ref) {\n return ref ? ref.replace(refPattern, '.$1') : '';\n}\n\nexport function splitKeypath(keypath) {\n const result = [];\n let match;\n\n keypath = normalise(keypath);\n\n while ((match = splitPattern.exec(keypath))) {\n const index = match.index + match[1].length;\n result.push(keypath.substr(0, index));\n keypath = keypath.substr(index + 1);\n }\n\n result.push(keypath);\n\n return result;\n}\n\nexport function unescapeKey(key) {\n if (isString(key)) {\n return key.replace(unescapeKeyPattern, '$1$2');\n }\n\n return key;\n}\n","const fnBind = Function.prototype.bind;\n\nexport default function bind(fn, context) {\n if (!/this/.test(fn.toString())) return fn;\n\n const bound = fnBind.call(fn, context);\n for (const prop in fn) bound[prop] = fn[prop];\n\n return bound;\n}\n","import { escapeKey, unescapeKey } from 'shared/keypaths';\nimport { addToArray, removeFromArray } from 'utils/array';\nimport { isArray, isObject, isObjectLike, isFunction } from 'utils/is';\nimport bind from 'utils/bind';\nimport { create, keys as objectKeys } from 'utils/object';\n\nconst shuffleTasks = { early: [], mark: [] };\nconst registerQueue = { early: [], mark: [] };\nexport const noVirtual = { virtual: false };\n\nexport default class ModelBase {\n constructor(parent) {\n this.deps = [];\n\n this.children = [];\n this.childByKey = {};\n this.links = [];\n\n this.bindings = [];\n\n if (parent) {\n this.parent = parent;\n this.root = parent.root;\n }\n }\n\n addShuffleTask(task, stage = 'early') {\n shuffleTasks[stage].push(task);\n }\n addShuffleRegister(item, stage = 'early') {\n registerQueue[stage].push({ model: this, item });\n }\n\n downstreamChanged() {}\n\n findMatches(keys) {\n const len = keys.length;\n\n let existingMatches = [this];\n let matches;\n let i;\n\n for (i = 0; i < len; i += 1) {\n const key = keys[i];\n\n if (key === '*') {\n matches = [];\n existingMatches.forEach(model => {\n matches.push.apply(matches, model.getValueChildren(model.get()));\n });\n } else {\n matches = existingMatches.map(model => model.joinKey(key));\n }\n\n existingMatches = matches;\n }\n\n return matches;\n }\n\n getKeypath(ractive) {\n if (ractive !== this.ractive && this._link) return this._link.target.getKeypath(ractive);\n\n if (!this.keypath) {\n const parent = this.parent && this.parent.getKeypath(ractive);\n this.keypath = parent\n ? `${this.parent.getKeypath(ractive)}.${escapeKey(this.key)}`\n : escapeKey(this.key);\n }\n\n return this.keypath;\n }\n\n getValueChildren(value) {\n let children;\n if (isArray(value)) {\n children = [];\n if ('length' in this && this.length !== value.length) {\n children.push(this.joinKey('length'));\n }\n value.forEach((m, i) => {\n children.push(this.joinKey(i));\n });\n } else if (isObject(value) || isFunction(value)) {\n children = objectKeys(value).map(key => this.joinKey(escapeKey(key)));\n } else if (value != null) {\n children = [];\n }\n\n const computed = this.computed;\n if (computed) {\n children.push.apply(children, objectKeys(computed).map(k => this.joinKey(k)));\n }\n\n return children;\n }\n\n getVirtual(shouldCapture) {\n const value = this.get(shouldCapture, { virtual: false });\n if (isObjectLike(value)) {\n const result = isArray(value) ? [] : create(null);\n\n let keys = objectKeys(value);\n let i = keys.length;\n while (i--) {\n const child = this.childByKey[keys[i]];\n if (!child) result[keys[i]] = value[keys[i]];\n else if (child._link) result[keys[i]] = child._link.getVirtual();\n else result[keys[i]] = child.getVirtual();\n }\n\n i = this.children.length;\n while (i--) {\n const child = this.children[i];\n if (!(child.key in result) && child._link) {\n result[child.key] = child._link.getVirtual();\n }\n }\n\n if (this.computed) {\n keys = objectKeys(this.computed);\n i = keys.length;\n while (i--) {\n result[keys[i]] = this.computed[keys[i]].get();\n }\n }\n\n return result;\n } else return value;\n }\n\n has(key) {\n if (this._link) return this._link.has(key);\n\n const value = this.get(false, noVirtual);\n if (!value) return false;\n\n key = unescapeKey(key);\n if ((isFunction(value) || isObject(value)) && key in value) return true;\n\n let computed = this.computed;\n if (computed && key in this.computed) return true;\n\n computed = this.root.ractive && this.root.ractive.computed;\n if (computed) {\n objectKeys(computed).forEach(k => {\n if (computed[k].pattern && computed[k].pattern.test(this.getKeypath())) return true;\n });\n }\n\n return false;\n }\n\n joinAll(keys, opts) {\n let model = this;\n for (let i = 0; i < keys.length; i += 1) {\n if (\n opts &&\n opts.lastLink === false &&\n i + 1 === keys.length &&\n model.childByKey[keys[i]] &&\n model.childByKey[keys[i]]._link\n )\n return model.childByKey[keys[i]];\n model = model.joinKey(keys[i], opts);\n }\n\n return model;\n }\n\n notifyUpstream(startPath) {\n let parent = this.parent;\n const path = startPath || [this.key];\n while (parent) {\n if (parent.patterns) parent.patterns.forEach(o => o.notify(path.slice()));\n path.unshift(parent.key);\n parent.links.forEach(l => l.notifiedUpstream(path, this.root));\n parent.deps.forEach(d => d.handleChange(path));\n parent.downstreamChanged(startPath);\n parent = parent.parent;\n }\n }\n\n rebind(next, previous, safe) {\n if (this._link) {\n this._link.rebind(next, previous, false);\n }\n\n if (next === this) return;\n\n // tell the deps to move to the new target\n let i = this.deps.length;\n while (i--) {\n if (this.deps[i].rebind) this.deps[i].rebind(next, previous, safe);\n }\n\n i = this.links.length;\n while (i--) {\n const link = this.links[i];\n // only relink the root of the link tree\n if (link.owner && link.owner._link) link.relinking(next, safe);\n }\n\n i = this.children.length;\n while (i--) {\n const child = this.children[i];\n child.rebind(next ? next.joinKey(child.key) : undefined, child._link || child, safe);\n if (this.dataModel) {\n this.addShuffleTask(() => checkDataLink(this, this.retrieve()), 'early');\n }\n }\n\n i = this.bindings.length;\n while (i--) {\n this.bindings[i].rebind(next, previous, safe);\n }\n }\n\n reference() {\n 'refs' in this ? this.refs++ : (this.refs = 1);\n }\n\n register(dep) {\n this.deps.push(dep);\n }\n\n registerLink(link) {\n addToArray(this.links, link);\n }\n\n registerPatternObserver(observer) {\n (this.patterns || (this.patterns = [])).push(observer);\n this.register(observer);\n }\n\n registerTwowayBinding(binding) {\n this.bindings.push(binding);\n }\n\n unreference() {\n if ('refs' in this) this.refs--;\n }\n\n unregister(dep) {\n removeFromArray(this.deps, dep);\n }\n\n unregisterLink(link) {\n removeFromArray(this.links, link);\n }\n\n unregisterPatternObserver(observer) {\n removeFromArray(this.patterns, observer);\n this.unregister(observer);\n }\n\n unregisterTwowayBinding(binding) {\n removeFromArray(this.bindings, binding);\n }\n\n updateFromBindings(cascade) {\n let i = this.bindings.length;\n while (i--) {\n const value = this.bindings[i].getValue();\n if (value !== this.value) this.set(value);\n }\n\n // check for one-way bindings if there are no two-ways\n if (!this.bindings.length) {\n const oneway = findBoundValue(this.deps);\n if (oneway && oneway.value !== this.value) this.set(oneway.value);\n }\n\n if (cascade) {\n this.children.forEach(updateFromBindings);\n this.links.forEach(updateFromBindings);\n if (this._link) this._link.updateFromBindings(cascade);\n }\n }\n}\n\n// TODO: this may be better handled by overriding `get` on models with a parent that isRoot\nexport function maybeBind(model, value, shouldBind) {\n if (shouldBind && isFunction(value) && model.parent && model.parent.isRoot) {\n if (!model.boundValue) {\n model.boundValue = bind(value._r_unbound || value, model.parent.ractive);\n }\n\n return model.boundValue;\n }\n\n return value;\n}\n\nfunction updateFromBindings(model) {\n model.updateFromBindings(true);\n}\n\nexport function findBoundValue(list) {\n let i = list.length;\n while (i--) {\n if (list[i].bound) {\n const owner = list[i].owner;\n if (owner) {\n const value = owner.name === 'checked' ? owner.node.checked : owner.node.value;\n return { value };\n }\n }\n }\n}\n\nexport function fireShuffleTasks(stage) {\n if (!stage) {\n fireShuffleTasks('early');\n fireShuffleTasks('mark');\n } else {\n const tasks = shuffleTasks[stage];\n shuffleTasks[stage] = [];\n let i = tasks.length;\n while (i--) tasks[i]();\n\n const register = registerQueue[stage];\n registerQueue[stage] = [];\n i = register.length;\n while (i--) register[i].model.register(register[i].item);\n }\n}\n\nexport function shuffle(model, newIndices, link, unsafe) {\n model.shuffling = true;\n\n let upstream = model.source().length !== model.source().value.length;\n let i = newIndices.length;\n while (i--) {\n const idx = newIndices[i];\n // nothing is actually changing, so move in the index and roll on\n if (i === idx) {\n continue;\n }\n\n upstream = true;\n\n // rebind the children on i to idx\n if (i in model.childByKey)\n model.childByKey[i].rebind(\n !~idx ? undefined : model.joinKey(idx),\n model.childByKey[i],\n !unsafe\n );\n }\n\n model.links.forEach(l => l.shuffle(newIndices));\n if (!link) fireShuffleTasks('early');\n\n i = model.deps.length;\n while (i--) {\n if (model.deps[i].shuffle) model.deps[i].shuffle(newIndices);\n }\n\n model[link ? 'marked' : 'mark']();\n if (!link) fireShuffleTasks('mark');\n\n if (upstream) model.notifyUpstream();\n\n model.shuffling = false;\n}\n\nexport function checkDataLink(model, value) {\n if (value !== model.dataModel) {\n if (value && value.viewmodel && value.viewmodel.isRoot && model.childByKey.data) {\n model.childByKey.data.link(value.viewmodel, 'data');\n model.dataModel = value;\n } else if (model.dataModel) {\n model.childByKey.data.unlink();\n model.dataModel = true;\n }\n }\n}\n","import { addToArray } from '../utils/array';\n\nconst stack = [];\nlet captureGroup;\n\nexport function startCapturing() {\n stack.push((captureGroup = []));\n}\n\nexport function stopCapturing() {\n const dependencies = stack.pop();\n captureGroup = stack[stack.length - 1];\n return dependencies;\n}\n\nexport function capture(model) {\n if (captureGroup) {\n addToArray(captureGroup, model);\n }\n}\n","import ModelBase, { fireShuffleTasks, maybeBind, shuffle } from './ModelBase';\nimport { capture } from '../global/capture';\nimport { handleChange, marked, markedAll, teardown } from 'shared/methodCallers';\nimport { rebindMatch } from 'shared/rebind';\nimport resolveReference from 'src/view/resolvers/resolveReference';\nimport noop from 'utils/noop';\nimport { hasOwn } from 'utils/object';\nimport { isUndefined } from 'utils/is';\n\n// temporary placeholder target for detached implicit links\nexport const Missing = {\n key: '@missing',\n animate: noop,\n applyValue: noop,\n get: noop,\n getKeypath() {\n return this.key;\n },\n joinAll() {\n return this;\n },\n joinKey() {\n return this;\n },\n mark: noop,\n registerLink: noop,\n shufle: noop,\n set: noop,\n unregisterLink: noop\n};\nMissing.parent = Missing;\n\nexport default class LinkModel extends ModelBase {\n constructor(parent, owner, target, key) {\n super(parent);\n\n this.owner = owner;\n this.target = target;\n this.key = isUndefined(key) ? owner.key : key;\n if (owner && owner.isLink) this.sourcePath = `${owner.sourcePath}.${this.key}`;\n\n if (target) target.registerLink(this);\n\n if (parent) this.isReadonly = parent.isReadonly;\n\n this.isLink = true;\n }\n\n animate(from, to, options, interpolator) {\n return this.target.animate(from, to, options, interpolator);\n }\n\n applyValue(value) {\n if (this.boundValue) this.boundValue = null;\n this.target.applyValue(value);\n }\n\n attach(fragment) {\n const model = resolveReference(fragment, this.key);\n if (model) {\n this.relinking(model, false);\n } else {\n // if there is no link available, move everything here to real models\n this.owner.unlink();\n }\n }\n\n detach() {\n this.relinking(Missing, false);\n }\n\n get(shouldCapture, opts = {}) {\n if (shouldCapture) {\n capture(this);\n\n // may need to tell the target to unwrap\n opts.unwrap = 'unwrap' in opts ? opts.unwrap : true;\n }\n\n const bind = 'shouldBind' in opts ? opts.shouldBind : true;\n opts.shouldBind = this.mapping && this.target.parent && this.target.parent.isRoot;\n\n return maybeBind(this, this.target.get(false, opts), bind);\n }\n\n getKeypath(ractive) {\n if (ractive && ractive !== this.root.ractive) return this.target.getKeypath(ractive);\n\n return super.getKeypath(ractive);\n }\n\n handleChange() {\n this.deps.forEach(handleChange);\n this.links.forEach(handleChange);\n this.notifyUpstream();\n }\n\n isDetached() {\n return this.virtual && this.target === Missing;\n }\n\n joinKey(key) {\n // TODO: handle nested links\n if (isUndefined(key) || key === '') return this;\n\n if (!hasOwn(this.childByKey, key)) {\n const child = new LinkModel(this, this, this.target.joinKey(key), key);\n this.children.push(child);\n this.childByKey[key] = child;\n }\n\n return this.childByKey[key];\n }\n\n mark(force) {\n this.target.mark(force);\n }\n\n marked() {\n if (this.boundValue) this.boundValue = null;\n\n this.links.forEach(marked);\n\n this.deps.forEach(handleChange);\n }\n\n markedAll() {\n this.children.forEach(markedAll);\n this.marked();\n }\n\n notifiedUpstream(startPath, root) {\n this.links.forEach(l => l.notifiedUpstream(startPath, this.root));\n this.deps.forEach(handleChange);\n if (startPath && this.rootLink) {\n const parent = this.parent;\n if (this.root !== root) {\n const path = startPath.slice(1);\n path.unshift(this.key);\n this.notifyUpstream(path);\n } else if (parent && parent !== this.target) {\n const path = [parent.key, this.key];\n parent.links.forEach(l => l.notifiedUpstream(path, parent.root));\n parent.deps.forEach(d => d.handleChange(path));\n parent.notifyUpstream(path);\n }\n }\n }\n\n relinked() {\n this.target.registerLink(this);\n this.children.forEach(c => c.relinked());\n }\n\n relinking(target, safe) {\n if (this.rootLink && this.sourcePath)\n target = rebindMatch(this.sourcePath, target, this.target);\n if (!target || this.target === target) return;\n\n this.target && this.target.unregisterLink(this);\n\n this.target = target;\n this.children.forEach(c => {\n c.relinking(target.joinKey(c.key), safe);\n });\n\n if (!safe) this.keypath = undefined;\n\n if (this.rootLink)\n this.addShuffleTask(() => {\n this.relinked();\n if (!safe) {\n this.markedAll();\n this.notifyUpstream();\n }\n });\n }\n\n set(value) {\n if (this.boundValue) this.boundValue = null;\n this.target.set(value);\n }\n\n shuffle(newIndices) {\n // watch for extra shuffles caused by a shuffle in a downstream link\n if (this.shuffling) return;\n\n // let the real model handle firing off shuffles\n if (!this.target.shuffling) {\n if (this.target.shuffle) {\n this.target.shuffle(newIndices);\n } else {\n // the target is a computation, which can't shuffle\n this.target.mark();\n }\n } else {\n shuffle(this, newIndices, true);\n }\n }\n\n source() {\n if (this.target.source) return this.target.source();\n else return this.target;\n }\n\n teardown() {\n if (this._link) this._link.teardown();\n this.target.unregisterLink(this);\n this.children.forEach(teardown);\n }\n}\n\nModelBase.prototype.link = function link(model, keypath, options) {\n const lnk = this._link || new LinkModel(this.parent, this, model, this.key);\n lnk.implicit = options && options.implicit;\n lnk.mapping = options && options.mapping;\n lnk.sourcePath = keypath;\n lnk.rootLink = true;\n if (this._link) this._link.relinking(model, false);\n this._link = lnk;\n this.rebind(lnk, this, false);\n fireShuffleTasks();\n\n lnk.markedAll();\n\n this.notifyUpstream();\n return lnk;\n};\n\nModelBase.prototype.unlink = function unlink() {\n if (this._link) {\n const ln = this._link;\n this._link = undefined;\n ln.rebind(this, ln, false);\n fireShuffleTasks();\n ln.teardown();\n this.notifyUpstream();\n }\n};\n","import { createFunction } from '../Ractive/config/runtime-parser';\nimport { create, keys } from 'utils/object';\n\nconst functions = create(null);\n\nexport default function getFunction(str, i) {\n if (functions[str]) return functions[str];\n return (functions[str] = createFunction(str, i));\n}\n\nexport function addFunctions(template) {\n if (!template) return;\n\n const exp = template.e;\n\n if (!exp) return;\n\n keys(exp).forEach(str => {\n if (functions[str]) return;\n functions[str] = exp[str];\n });\n}\n","export const TEMPLATE_VERSION = 4;\n","import { warnIfDebug } from 'utils/log';\nimport { create, hasOwn } from 'utils/object';\n\nconst leadingWhitespace = /^\\s+/;\n\nconst ParseError = function(message) {\n this.name = 'ParseError';\n this.message = message;\n try {\n throw new Error(message);\n } catch (e) {\n this.stack = e.stack;\n }\n};\n\nParseError.prototype = Error.prototype;\n\nconst Parser = function(str, options) {\n let item;\n let lineStart = 0;\n\n this.str = str;\n this.options = options || {};\n this.pos = 0;\n\n this.lines = this.str.split('\\n');\n this.lineEnds = this.lines.map(line => {\n const lineEnd = lineStart + line.length + 1; // +1 for the newline\n\n lineStart = lineEnd;\n return lineEnd;\n }, 0);\n\n // Custom init logic\n if (this.init) this.init(str, options);\n\n const items = [];\n\n while (this.pos < this.str.length && (item = this.read())) {\n items.push(item);\n }\n\n this.leftover = this.remaining();\n this.result = this.postProcess ? this.postProcess(items, options) : items;\n};\n\nParser.prototype = {\n read(converters) {\n let i, item;\n\n if (!converters) converters = this.converters;\n\n const pos = this.pos;\n\n const len = converters.length;\n for (i = 0; i < len; i += 1) {\n this.pos = pos; // reset for each attempt\n\n if ((item = converters[i](this))) {\n return item;\n }\n }\n\n return null;\n },\n\n getContextMessage(pos, message) {\n const [lineNum, columnNum] = this.getLinePos(pos);\n if (this.options.contextLines === -1) {\n return [lineNum, columnNum, `${message} at line ${lineNum} character ${columnNum}`];\n }\n\n const line = this.lines[lineNum - 1];\n\n let contextUp = '';\n let contextDown = '';\n if (this.options.contextLines) {\n const start =\n lineNum - 1 - this.options.contextLines < 0 ? 0 : lineNum - 1 - this.options.contextLines;\n contextUp = this.lines\n .slice(start, lineNum - 1 - start)\n .join('\\n')\n .replace(/\\t/g, ' ');\n contextDown = this.lines\n .slice(lineNum, lineNum + this.options.contextLines)\n .join('\\n')\n .replace(/\\t/g, ' ');\n if (contextUp) {\n contextUp += '\\n';\n }\n if (contextDown) {\n contextDown = '\\n' + contextDown;\n }\n }\n\n let numTabs = 0;\n const annotation =\n contextUp +\n line.replace(/\\t/g, (match, char) => {\n if (char < columnNum) {\n numTabs += 1;\n }\n\n return ' ';\n }) +\n '\\n' +\n new Array(columnNum + numTabs).join(' ') +\n '^----' +\n contextDown;\n\n return [\n lineNum,\n columnNum,\n `${message} at line ${lineNum} character ${columnNum}:\\n${annotation}`\n ];\n },\n\n getLinePos(char) {\n let lineNum = 0;\n let lineStart = 0;\n\n while (char >= this.lineEnds[lineNum]) {\n lineStart = this.lineEnds[lineNum];\n lineNum += 1;\n }\n\n const columnNum = char - lineStart;\n return [lineNum + 1, columnNum + 1, char]; // line/col should be one-based, not zero-based!\n },\n\n error(message) {\n const [lineNum, columnNum, msg] = this.getContextMessage(this.pos, message);\n\n const error = new ParseError(msg);\n\n error.line = lineNum;\n error.character = columnNum;\n error.shortMessage = message;\n\n throw error;\n },\n\n matchString(string) {\n if (this.str.substr(this.pos, string.length) === string) {\n this.pos += string.length;\n return string;\n }\n },\n\n matchPattern(pattern) {\n let match;\n\n if ((match = pattern.exec(this.remaining()))) {\n this.pos += match[0].length;\n return match[1] || match[0];\n }\n },\n\n sp() {\n this.matchPattern(leadingWhitespace);\n },\n\n remaining() {\n return this.str.substring(this.pos);\n },\n\n nextChar() {\n return this.str.charAt(this.pos);\n },\n\n warn(message) {\n const msg = this.getContextMessage(this.pos, message)[2];\n\n warnIfDebug(msg);\n }\n};\n\nParser.extend = function(proto) {\n const Parent = this;\n const Child = function(str, options) {\n Parser.call(this, str, options);\n };\n\n Child.prototype = create(Parent.prototype);\n\n for (const key in proto) {\n if (hasOwn(proto, key)) {\n Child.prototype[key] = proto[key];\n }\n }\n\n Child.extend = Parser.extend;\n return Child;\n};\n\nexport default Parser;\n","export const TEXT = 1;\nexport const INTERPOLATOR = 2;\nexport const TRIPLE = 3;\nexport const SECTION = 4;\nexport const INVERTED = 5;\nexport const CLOSING = 6;\nexport const ELEMENT = 7;\nexport const PARTIAL = 8;\nexport const COMMENT = 9;\nexport const DELIMCHANGE = 10;\nexport const ANCHOR = 11;\nexport const ATTRIBUTE = 13;\nexport const CLOSING_TAG = 14;\nexport const COMPONENT = 15;\nexport const YIELDER = 16;\nexport const INLINE_PARTIAL = 17;\nexport const DOCTYPE = 18;\nexport const ALIAS = 19;\n\nexport const AWAIT = 55;\n\nexport const NUMBER_LITERAL = 20;\nexport const STRING_LITERAL = 21;\nexport const ARRAY_LITERAL = 22;\nexport const OBJECT_LITERAL = 23;\nexport const BOOLEAN_LITERAL = 24;\nexport const REGEXP_LITERAL = 25;\n\nexport const GLOBAL = 26;\nexport const KEY_VALUE_PAIR = 27;\n\nexport const REFERENCE = 30;\nexport const REFINEMENT = 31;\nexport const MEMBER = 32;\nexport const PREFIX_OPERATOR = 33;\nexport const BRACKETED = 34;\nexport const CONDITIONAL = 35;\nexport const INFIX_OPERATOR = 36;\n\nexport const INVOCATION = 40;\n\nexport const SECTION_IF = 50;\nexport const SECTION_UNLESS = 51;\nexport const SECTION_EACH = 52;\nexport const SECTION_WITH = 53;\nexport const SECTION_IF_WITH = 54;\n\nexport const ELSE = 60;\nexport const ELSEIF = 61;\nexport const THEN = 62;\nexport const CATCH = 63;\n\nexport const EVENT = 70;\nexport const DECORATOR = 71;\nexport const TRANSITION = 72;\nexport const BINDING_FLAG = 73;\nexport const DELEGATE_FLAG = 74;\n","import { PREFIX_OPERATOR } from 'config/types';\nimport { expectedExpression } from './shared/errors';\nimport readMemberOrInvocation from './readMemberOrInvocation';\nimport readExpression from '../readExpression';\n\nlet readTypeOf;\n\nconst makePrefixSequenceMatcher = function(symbol, fallthrough) {\n return function(parser) {\n let expression;\n\n if ((expression = fallthrough(parser))) {\n return expression;\n }\n\n if (!parser.matchString(symbol)) {\n return null;\n }\n\n parser.sp();\n\n expression = readExpression(parser);\n if (!expression) {\n parser.error(expectedExpression);\n }\n\n return {\n s: symbol,\n o: expression,\n t: PREFIX_OPERATOR\n };\n };\n};\n\n// create all prefix sequence matchers, return readTypeOf\n(function() {\n let i, len, matcher, fallthrough;\n\n const prefixOperators = '! ~ + - typeof'.split(' ');\n\n fallthrough = readMemberOrInvocation;\n for (i = 0, len = prefixOperators.length; i < len; i += 1) {\n matcher = makePrefixSequenceMatcher(prefixOperators[i], fallthrough);\n fallthrough = matcher;\n }\n\n // typeof operator is higher precedence than multiplication, so provides the\n // fallthrough for the multiplication sequence matcher we're about to create\n // (we're skipping void and delete)\n readTypeOf = fallthrough;\n})();\n\nexport default readTypeOf;\n","const delimiterChangePattern = /^[^\\s=]+/;\nconst whitespacePattern = /^\\s+/;\n\nexport default function readDelimiterChange(parser) {\n if (!parser.matchString('=')) {\n return null;\n }\n\n const start = parser.pos;\n\n // allow whitespace before new opening delimiter\n parser.sp();\n\n const opening = parser.matchPattern(delimiterChangePattern);\n if (!opening) {\n parser.pos = start;\n return null;\n }\n\n // allow whitespace (in fact, it's necessary...)\n if (!parser.matchPattern(whitespacePattern)) {\n return null;\n }\n\n const closing = parser.matchPattern(delimiterChangePattern);\n if (!closing) {\n parser.pos = start;\n return null;\n }\n\n // allow whitespace before closing '='\n parser.sp();\n\n if (!parser.matchString('=')) {\n parser.pos = start;\n return null;\n }\n\n return [opening, closing];\n}\n","import { REGEXP_LITERAL } from '../../../../../config/types';\n\nconst regexpPattern = /^(\\/(?:[^\\n\\r\\u2028\\u2029/\\\\[]|\\\\.|\\[(?:[^\\n\\r\\u2028\\u2029\\]\\\\]|\\\\.)*])+\\/(?:([gimuy])(?![a-z]*\\2))*(?![a-zA-Z_$0-9]))/;\n\nexport default function readNumberLiteral(parser) {\n let result;\n\n if ((result = parser.matchPattern(regexpPattern))) {\n return {\n t: REGEXP_LITERAL,\n v: result\n };\n }\n\n return null;\n}\n","const pattern = /[-/\\\\^$*+?.()|[\\]{}]/g;\n\nexport default function escapeRegExp(str) {\n return str.replace(pattern, '\\\\$&');\n}\n","import escapeRegExp from 'utils/escapeRegExp';\n\nconst regExpCache = {};\n\nexport default function(haystack, needles) {\n return haystack.search(\n regExpCache[needles.join()] ||\n (regExpCache[needles.join()] = new RegExp(needles.map(escapeRegExp).join('|')))\n );\n}\n","import { keys } from 'utils/object';\nimport { isFunction } from 'utils/is';\n\n// https://github.com/kangax/html-minifier/issues/63#issuecomment-37763316\n//export const booleanAttributes = /^(allowFullscreen|async|autofocus|autoplay|checked|compact|controls|declare|default|defaultChecked|defaultMuted|defaultSelected|defer|disabled|enabled|formNoValidate|hidden|indeterminate|inert|isMap|itemScope|loop|multiple|muted|noHref|noResize|noShade|noValidate|noWrap|open|pauseOnExit|readOnly|required|reversed|scoped|seamless|selected|sortable|translate|trueSpeed|typeMustMatch|visible)$/i;\nexport const booleanAttributes = {\n allowfullscreen: 1,\n async: 1,\n autofocus: 1,\n autoplay: 1,\n checked: 1,\n compact: 1,\n controls: 1,\n declare: 1,\n default: 1,\n defaultchecked: 1,\n defaultmuted: 1,\n defaultselected: 1,\n defer: 1,\n disabled: 1,\n enabled: 1,\n formnovalidate: 1,\n hidden: 1,\n indeterminate: 1,\n inert: 1,\n ismap: 1,\n itemscope: 1,\n loop: 1,\n multiple: 1,\n muted: 1,\n nohref: 1,\n noresize: 1,\n noshade: 1,\n novalidate: 1,\n nowrap: 1,\n open: 1,\n pauseonexit: 1,\n readonly: 1,\n required: 1,\n reversed: 1,\n scoped: 1,\n seamless: 1,\n selected: 1,\n sortable: 1,\n translate: 1,\n truespeed: 1,\n typemustmatch: 1,\n visible: 1\n};\nexport const voidElements = {\n area: 1,\n base: 1,\n br: 1,\n col: 1,\n command: 1,\n doctype: 1,\n embed: 1,\n hr: 1,\n img: 1,\n input: 1,\n keygen: 1,\n link: 1,\n meta: 1,\n param: 1,\n source: 1,\n track: 1,\n wbr: 1\n};\n\nconst htmlEntities = {\n quot: 34,\n amp: 38,\n apos: 39,\n lt: 60,\n gt: 62,\n nbsp: 160,\n iexcl: 161,\n cent: 162,\n pound: 163,\n curren: 164,\n yen: 165,\n brvbar: 166,\n sect: 167,\n uml: 168,\n copy: 169,\n ordf: 170,\n laquo: 171,\n not: 172,\n shy: 173,\n reg: 174,\n macr: 175,\n deg: 176,\n plusmn: 177,\n sup2: 178,\n sup3: 179,\n acute: 180,\n micro: 181,\n para: 182,\n middot: 183,\n cedil: 184,\n sup1: 185,\n ordm: 186,\n raquo: 187,\n frac14: 188,\n frac12: 189,\n frac34: 190,\n iquest: 191,\n Agrave: 192,\n Aacute: 193,\n Acirc: 194,\n Atilde: 195,\n Auml: 196,\n Aring: 197,\n AElig: 198,\n Ccedil: 199,\n Egrave: 200,\n Eacute: 201,\n Ecirc: 202,\n Euml: 203,\n Igrave: 204,\n Iacute: 205,\n Icirc: 206,\n Iuml: 207,\n ETH: 208,\n Ntilde: 209,\n Ograve: 210,\n Oacute: 211,\n Ocirc: 212,\n Otilde: 213,\n Ouml: 214,\n times: 215,\n Oslash: 216,\n Ugrave: 217,\n Uacute: 218,\n Ucirc: 219,\n Uuml: 220,\n Yacute: 221,\n THORN: 222,\n szlig: 223,\n agrave: 224,\n aacute: 225,\n acirc: 226,\n atilde: 227,\n auml: 228,\n aring: 229,\n aelig: 230,\n ccedil: 231,\n egrave: 232,\n eacute: 233,\n ecirc: 234,\n euml: 235,\n igrave: 236,\n iacute: 237,\n icirc: 238,\n iuml: 239,\n eth: 240,\n ntilde: 241,\n ograve: 242,\n oacute: 243,\n ocirc: 244,\n otilde: 245,\n ouml: 246,\n divide: 247,\n oslash: 248,\n ugrave: 249,\n uacute: 250,\n ucirc: 251,\n uuml: 252,\n yacute: 253,\n thorn: 254,\n yuml: 255,\n OElig: 338,\n oelig: 339,\n Scaron: 352,\n scaron: 353,\n Yuml: 376,\n fnof: 402,\n circ: 710,\n tilde: 732,\n Alpha: 913,\n Beta: 914,\n Gamma: 915,\n Delta: 916,\n Epsilon: 917,\n Zeta: 918,\n Eta: 919,\n Theta: 920,\n Iota: 921,\n Kappa: 922,\n Lambda: 923,\n Mu: 924,\n Nu: 925,\n Xi: 926,\n Omicron: 927,\n Pi: 928,\n Rho: 929,\n Sigma: 931,\n Tau: 932,\n Upsilon: 933,\n Phi: 934,\n Chi: 935,\n Psi: 936,\n Omega: 937,\n alpha: 945,\n beta: 946,\n gamma: 947,\n delta: 948,\n epsilon: 949,\n zeta: 950,\n eta: 951,\n theta: 952,\n iota: 953,\n kappa: 954,\n lambda: 955,\n mu: 956,\n nu: 957,\n xi: 958,\n omicron: 959,\n pi: 960,\n rho: 961,\n sigmaf: 962,\n sigma: 963,\n tau: 964,\n upsilon: 965,\n phi: 966,\n chi: 967,\n psi: 968,\n omega: 969,\n thetasym: 977,\n upsih: 978,\n piv: 982,\n ensp: 8194,\n emsp: 8195,\n thinsp: 8201,\n zwnj: 8204,\n zwj: 8205,\n lrm: 8206,\n rlm: 8207,\n ndash: 8211,\n mdash: 8212,\n lsquo: 8216,\n rsquo: 8217,\n sbquo: 8218,\n ldquo: 8220,\n rdquo: 8221,\n bdquo: 8222,\n dagger: 8224,\n Dagger: 8225,\n bull: 8226,\n hellip: 8230,\n permil: 8240,\n prime: 8242,\n Prime: 8243,\n lsaquo: 8249,\n rsaquo: 8250,\n oline: 8254,\n frasl: 8260,\n euro: 8364,\n image: 8465,\n weierp: 8472,\n real: 8476,\n trade: 8482,\n alefsym: 8501,\n larr: 8592,\n uarr: 8593,\n rarr: 8594,\n darr: 8595,\n harr: 8596,\n crarr: 8629,\n lArr: 8656,\n uArr: 8657,\n rArr: 8658,\n dArr: 8659,\n hArr: 8660,\n forall: 8704,\n part: 8706,\n exist: 8707,\n empty: 8709,\n nabla: 8711,\n isin: 8712,\n notin: 8713,\n ni: 8715,\n prod: 8719,\n sum: 8721,\n minus: 8722,\n lowast: 8727,\n radic: 8730,\n prop: 8733,\n infin: 8734,\n ang: 8736,\n and: 8743,\n or: 8744,\n cap: 8745,\n cup: 8746,\n int: 8747,\n there4: 8756,\n sim: 8764,\n cong: 8773,\n asymp: 8776,\n ne: 8800,\n equiv: 8801,\n le: 8804,\n ge: 8805,\n sub: 8834,\n sup: 8835,\n nsub: 8836,\n sube: 8838,\n supe: 8839,\n oplus: 8853,\n otimes: 8855,\n perp: 8869,\n sdot: 8901,\n lceil: 8968,\n rceil: 8969,\n lfloor: 8970,\n rfloor: 8971,\n lang: 9001,\n rang: 9002,\n loz: 9674,\n spades: 9824,\n clubs: 9827,\n hearts: 9829,\n diams: 9830\n};\nconst controlCharacters = [\n 8364,\n 129,\n 8218,\n 402,\n 8222,\n 8230,\n 8224,\n 8225,\n 710,\n 8240,\n 352,\n 8249,\n 338,\n 141,\n 381,\n 143,\n 144,\n 8216,\n 8217,\n 8220,\n 8221,\n 8226,\n 8211,\n 8212,\n 732,\n 8482,\n 353,\n 8250,\n 339,\n 157,\n 382,\n 376\n];\nconst entityPattern = new RegExp(\n '&(#?(?:x[\\\\w\\\\d]+|\\\\d+|' + keys(htmlEntities).join('|') + '));?',\n 'g'\n);\nconst codePointSupport = isFunction(String.fromCodePoint);\nconst codeToChar = codePointSupport ? String.fromCodePoint : String.fromCharCode;\n\nexport function decodeCharacterReferences(html) {\n return html.replace(entityPattern, (match, entity) => {\n let code;\n\n // Handle named entities\n if (entity[0] !== '#') {\n code = htmlEntities[entity];\n } else if (entity[1] === 'x') {\n code = parseInt(entity.substring(2), 16);\n } else {\n code = parseInt(entity.substring(1), 10);\n }\n\n if (!code) {\n return match;\n }\n\n return codeToChar(validateCode(code));\n });\n}\n\nconst lessThan = /</g;\nconst greaterThan = />/g;\nconst amp = /&/g;\nconst invalid = 65533;\n\nexport function escapeHtml(str) {\n return str\n .replace(amp, '&')\n .replace(lessThan, '<')\n .replace(greaterThan, '>');\n}\n\n// some code points are verboten. If we were inserting HTML, the browser would replace the illegal\n// code points with alternatives in some cases - since we're bypassing that mechanism, we need\n// to replace them ourselves\n//\n// Source: http://en.wikipedia.org/wiki/Character_encodings_in_HTML#Illegal_characters\n/* istanbul ignore next */\nfunction validateCode(code) {\n if (!code) {\n return invalid;\n }\n\n // line feed becomes generic whitespace\n if (code === 10) {\n return 32;\n }\n\n // ASCII range. (Why someone would use HTML entities for ASCII characters I don't know, but...)\n if (code < 128) {\n return code;\n }\n\n // code points 128-159 are dealt with leniently by browsers, but they're incorrect. We need\n // to correct the mistake or we'll end up with missing € signs and so on\n if (code <= 159) {\n return controlCharacters[code - 128];\n }\n\n // basic multilingual plane\n if (code < 55296) {\n return code;\n }\n\n // UTF-16 surrogate halves\n if (code <= 57343) {\n return invalid;\n }\n\n // rest of the basic multilingual plane\n if (code <= 65535) {\n return code;\n } else if (!codePointSupport) {\n return invalid;\n }\n\n // supplementary multilingual plane 0x10000 - 0x1ffff\n if (code >= 65536 && code <= 131071) {\n return code;\n }\n\n // supplementary ideographic plane 0x20000 - 0x2ffff\n if (code >= 131072 && code <= 196607) {\n return code;\n }\n\n return invalid;\n}\n","export const expectedExpression = 'Expected a JavaScript expression';\nexport const expectedParen = 'Expected closing paren';\n","import { NUMBER_LITERAL } from '../../../../../config/types';\n\n// bulletproof number regex from https://gist.github.com/Rich-Harris/7544330\nconst numberPattern = /^(?:[+-]?)0*(?:(?:(?:[1-9]\\d*)?\\.\\d+)|(?:(?:0|[1-9]\\d*)\\.)|(?:0|[1-9]\\d*))(?:[eE][+-]?\\d+)?/;\n\nexport default function readNumberLiteral(parser) {\n let result;\n\n if ((result = parser.matchPattern(numberPattern))) {\n return {\n t: NUMBER_LITERAL,\n v: result\n };\n }\n\n return null;\n}\n","// Match one or more characters until: \", ', \\, or EOL/EOF.\n// EOL/EOF is written as (?!.) (meaning there's no non-newline char next).\nconst stringMiddlePattern = /^(?=.)[^\"'\\\\]+?(?:(?!.)|(?=[\"'\\\\]))/;\n\n// Match one escape sequence, including the backslash.\nexport const escapeSequencePattern = /^\\\\(?:[`'\"\\\\bfnrt]|0(?![0-9])|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|(?=.)[^ux0-9])/;\n\n// Match one ES5 line continuation (backslash + line terminator).\nexport const lineContinuationPattern = /^\\\\(?:\\r\\n|[\\u000A\\u000D\\u2028\\u2029])/;\n\n// Helper for defining getDoubleQuotedString and getSingleQuotedString.\nexport default function(okQuote) {\n return function(parser) {\n let literal = '\"';\n let done = false;\n let next;\n\n while (!done) {\n next =\n parser.matchPattern(stringMiddlePattern) ||\n parser.matchPattern(escapeSequencePattern) ||\n parser.matchString(okQuote);\n if (next) {\n if (next === `\"`) {\n literal += `\\\\\"`;\n } else if (next === `\\\\'`) {\n literal += `'`;\n } else {\n literal += next;\n }\n } else {\n next = parser.matchPattern(lineContinuationPattern);\n if (next) {\n // convert \\(newline-like) into a \\u escape, which is allowed in JSON\n literal += '\\\\u' + ('000' + next.charCodeAt(1).toString(16)).slice(-4);\n } else {\n done = true;\n }\n }\n }\n\n literal += '\"';\n\n // use JSON.parse to interpret escapes\n return JSON.parse(literal);\n };\n}\n","import { STRING_LITERAL } from '../../../../../config/types';\nimport makeQuotedStringMatcher from './stringLiteral/makeQuotedStringMatcher';\n\nconst singleMatcher = makeQuotedStringMatcher(`\"`);\nconst doubleMatcher = makeQuotedStringMatcher(`'`);\n\nexport default function(parser) {\n const start = parser.pos;\n const quote = parser.matchString(`'`) || parser.matchString(`\"`);\n\n if (quote) {\n const string = (quote === `'` ? singleMatcher : doubleMatcher)(parser);\n\n if (!parser.matchString(quote)) {\n parser.pos = start;\n return null;\n }\n\n return {\n t: STRING_LITERAL,\n v: string\n };\n }\n\n return null;\n}\n","import readExpression from '../../../readExpression';\nimport { STRING_LITERAL, BRACKETED, INFIX_OPERATOR } from '../../../../../config/types';\nimport {\n escapeSequencePattern,\n lineContinuationPattern\n} from './stringLiteral/makeQuotedStringMatcher';\n\n// Match one or more characters until: \", ', or \\\nconst stringMiddlePattern = /^[^`\"\\\\\\$]+?(?:(?=[`\"\\\\\\$]))/;\n\nconst escapes = /[\\r\\n\\t\\b\\f]/g;\nfunction getString(literal) {\n return JSON.parse(`\"${literal.replace(escapes, escapeChar)}\"`);\n}\n\nfunction escapeChar(c) {\n switch (c) {\n case '\\n':\n return '\\\\n';\n case '\\r':\n return '\\\\r';\n case '\\t':\n return '\\\\t';\n case '\\b':\n return '\\\\b';\n case '\\f':\n return '\\\\f';\n }\n}\n\nexport default function readTemplateStringLiteral(parser) {\n if (!parser.matchString('`')) return null;\n\n let literal = '';\n let done = false;\n let next;\n const parts = [];\n\n while (!done) {\n next =\n parser.matchPattern(stringMiddlePattern) ||\n parser.matchPattern(escapeSequencePattern) ||\n parser.matchString('$') ||\n parser.matchString('\"');\n if (next) {\n if (next === `\"`) {\n literal += `\\\\\"`;\n } else if (next === '\\\\`') {\n literal += '`';\n } else if (next === '$') {\n if (parser.matchString('{')) {\n parts.push({ t: STRING_LITERAL, v: getString(literal) });\n literal = '';\n\n parser.sp();\n const expr = readExpression(parser);\n\n if (!expr) parser.error('Expected valid expression');\n\n parts.push({ t: BRACKETED, x: expr });\n\n parser.sp();\n if (!parser.matchString('}'))\n parser.error(`Expected closing '}' after interpolated expression`);\n } else {\n literal += '$';\n }\n } else {\n literal += next;\n }\n } else {\n next = parser.matchPattern(lineContinuationPattern);\n if (next) {\n // convert \\(newline-like) into a \\u escape, which is allowed in JSON\n literal += '\\\\u' + ('000' + next.charCodeAt(1).toString(16)).slice(-4);\n } else {\n done = true;\n }\n }\n }\n\n if (literal.length) parts.push({ t: STRING_LITERAL, v: getString(literal) });\n\n if (!parser.matchString('`')) parser.error(\"Expected closing '`'\");\n\n if (!parts.length) {\n // empty string literal\n return { t: STRING_LITERAL, v: '' };\n } else if (parts.length === 1) {\n return parts[0];\n } else {\n let result = parts.pop();\n let part;\n\n while ((part = parts.pop())) {\n result = {\n t: INFIX_OPERATOR,\n s: '+',\n o: [part, result]\n };\n }\n\n return {\n t: BRACKETED,\n x: result\n };\n }\n}\n","export const name = /^[a-zA-Z_$][a-zA-Z_$0-9]*/;\nexport const spreadPattern = /^\\s*\\.{3}/;\nexport const legalReference = /^(?:[a-zA-Z$_0-9]|\\\\\\.)+(?:(?:\\.(?:[a-zA-Z$_0-9]|\\\\\\.)+)|(?:\\[[0-9]+\\]))*/;\nexport const relaxedName = /^[a-zA-Z_$][-\\/a-zA-Z_$0-9]*(?:\\.(?:[a-zA-Z_$][-\\/a-zA-Z_$0-9]*))*/;\n","import readStringLiteral from '../primary/literal/readStringLiteral';\nimport readNumberLiteral from '../primary/literal/readNumberLiteral';\nimport { name as namePattern } from './patterns';\n\nconst identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n// http://mathiasbynens.be/notes/javascript-properties\n// can be any name, string literal, or number literal\nexport default function readKey(parser) {\n let token;\n\n if ((token = readStringLiteral(parser))) {\n return identifier.test(token.v) ? token.v : '\"' + token.v.replace(/\"/g, '\\\\\"') + '\"';\n }\n\n if ((token = readNumberLiteral(parser))) {\n return token.v;\n }\n\n if ((token = parser.matchPattern(namePattern))) {\n return token;\n }\n\n return null;\n}\n","import { BRACKETED, GLOBAL, REFERENCE } from 'src/config/types';\nimport { normalise } from 'src/shared/keypaths';\nimport { legalReference, relaxedName } from '../shared/patterns';\n\n// if a reference is a browser global, we don't deference it later, so it needs special treatment\nconst globals = /^(?:Array|console|Date|RegExp|decodeURIComponent|decodeURI|encodeURIComponent|encodeURI|isFinite|isNaN|parseFloat|parseInt|JSON|Math|NaN|undefined|null|Object|Number|String|Boolean)\\b/;\n\n// keywords are not valid references, with the exception of `this`\nconst keywords = /^(?:break|case|catch|continue|debugger|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|void|while|with)$/;\n\nconst prefixPattern = /^(?:\\@\\.|\\@|~\\/|(?:\\^\\^\\/(?:\\^\\^\\/)*(?:\\.\\.\\/)*)|(?:\\.\\.\\/)+|\\.\\/(?:\\.\\.\\/)*|\\.)/;\nconst specials = /^(key|index|keypath|rootpath|this|global|shared|context|event|node|local|style|helpers|last|macro)/;\n\nexport default function readReference(parser) {\n let prefix, name, global, reference, lastDotIndex;\n\n const startPos = parser.pos;\n\n prefix = parser.matchPattern(prefixPattern) || '';\n name =\n (!prefix && parser.relaxedNames && parser.matchPattern(relaxedName)) ||\n parser.matchPattern(legalReference);\n const actual = prefix.length + ((name && name.length) || 0);\n\n if (prefix === '@.') {\n prefix = '@';\n if (name) name = 'this.' + name;\n else name = 'this';\n }\n\n if (!name && prefix) {\n name = prefix;\n prefix = '';\n }\n\n if (!name) {\n return null;\n }\n\n if (prefix === '@') {\n if (!specials.test(name)) {\n parser.error(`Unrecognized special reference @${name}`);\n } else if ((!name.indexOf('event') || !name.indexOf('node')) && !parser.inEvent) {\n parser.error(`@event and @node are only valid references within an event directive`);\n } else if (!name.indexOf('context')) {\n parser.pos = parser.pos - (name.length - 7);\n return {\n t: BRACKETED,\n x: {\n t: REFERENCE,\n n: '@context'\n }\n };\n }\n }\n\n // bug out if it's a keyword (exception for ancestor/restricted refs - see https://github.com/ractivejs/ractive/issues/1497)\n if (!prefix && !parser.relaxedNames && keywords.test(name)) {\n parser.pos = startPos;\n return null;\n }\n\n // if this is a browser global, stop here\n if (!prefix && globals.test(name)) {\n global = globals.exec(name)[0];\n parser.pos = startPos + global.length;\n\n return {\n t: GLOBAL,\n v: global\n };\n }\n\n reference = (prefix || '') + normalise(name);\n\n if (parser.matchString('(')) {\n // if this is a method invocation (as opposed to a function) we need\n // to strip the method name from the reference combo, else the context\n // will be wrong\n // but only if the reference was actually a member and not a refinement\n lastDotIndex = reference.lastIndexOf('.');\n if (lastDotIndex !== -1 && name[name.length - 1] !== ']') {\n if (lastDotIndex === 0) {\n reference = '.';\n parser.pos = startPos;\n } else {\n const refLength = reference.length;\n reference = reference.substr(0, lastDotIndex);\n parser.pos = startPos + (actual - (refLength - lastDotIndex));\n }\n } else {\n parser.pos -= 1;\n }\n }\n\n return {\n t: REFERENCE,\n n: reference.replace(/^this\\./, './').replace(/^this$/, '.')\n };\n}\n","import { INFIX_OPERATOR } from 'config/types';\nimport readTypeof from './readTypeof';\n\nlet readLogicalOr;\n\nconst makeInfixSequenceMatcher = function(symbol, fallthrough) {\n return function(parser) {\n // > and / have to be quoted\n if (parser.inUnquotedAttribute && (symbol === '>' || symbol === '/'))\n return fallthrough(parser);\n\n let start, left, right;\n\n left = fallthrough(parser);\n if (!left) {\n return null;\n }\n\n // Loop to handle left-recursion in a case like `a * b * c` and produce\n // left association, i.e. `(a * b) * c`. The matcher can't call itself\n // to parse `left` because that would be infinite regress.\n while (true) {\n start = parser.pos;\n\n parser.sp();\n\n if (!parser.matchString(symbol)) {\n parser.pos = start;\n return left;\n }\n\n // special case - in operator must not be followed by [a-zA-Z_$0-9]\n if (symbol === 'in' && /[a-zA-Z_$0-9]/.test(parser.remaining().charAt(0))) {\n parser.pos = start;\n return left;\n }\n\n parser.sp();\n\n // right operand must also consist of only higher-precedence operators\n right = fallthrough(parser);\n if (!right) {\n parser.pos = start;\n return left;\n }\n\n left = {\n t: INFIX_OPERATOR,\n s: symbol,\n o: [left, right]\n };\n\n // Loop back around. If we don't see another occurrence of the symbol,\n // we'll return left.\n }\n };\n};\n\n// create all infix sequence matchers, and return readLogicalOr\n(function() {\n let i, len, matcher, fallthrough;\n\n // All the infix operators on order of precedence (source: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Operator_Precedence)\n // Each sequence matcher will initially fall through to its higher precedence\n // neighbour, and only attempt to match if one of the higher precedence operators\n // (or, ultimately, a literal, reference, or bracketed expression) already matched\n const infixOperators = '* / % + - << >> >>> < <= > >= in instanceof == != === !== & ^ | && ||'.split(\n ' '\n );\n\n // A typeof operator is higher precedence than multiplication\n fallthrough = readTypeof;\n for (i = 0, len = infixOperators.length; i < len; i += 1) {\n matcher = makeInfixSequenceMatcher(infixOperators[i], fallthrough);\n fallthrough = matcher;\n }\n\n // Logical OR is the fallthrough for the conditional matcher\n readLogicalOr = fallthrough;\n})();\n\nexport default readLogicalOr;\n","import {\n ARRAY_LITERAL,\n ATTRIBUTE,\n DECORATOR,\n DELEGATE_FLAG,\n BINDING_FLAG,\n INTERPOLATOR,\n TRANSITION,\n EVENT\n} from '../../../config/types';\nimport getLowestIndex from '../utils/getLowestIndex';\nimport readMustache from '../readMustache';\nimport { decodeCharacterReferences } from 'src/utils/html';\nimport readExpressionList from '../expressions/shared/readExpressionList';\nimport readExpressionOrReference from '../readExpressionOrReference';\nimport flattenExpression from 'parse/utils/flattenExpression';\nimport refineExpression from 'parse/utils/refineExpression';\nimport { isString } from 'utils/is';\n\nconst attributeNamePattern = /^[^\\s\"'>\\/=(]+/;\nconst onPattern = /^on/;\nconst eventPattern = /^on-([a-zA-Z\\*\\.$_]((?:[a-zA-Z\\*\\.$_0-9\\-]|\\\\-)+))$/;\nconst reservedEventNames = /^(?:change|reset|teardown|update|construct|config|init|render|complete|unrender|detach|insert|destruct|attachchild|detachchild)$/;\nconst decoratorPattern = /^as-([a-z-A-Z][-a-zA-Z_0-9]*)$/;\nconst transitionPattern = /^([a-zA-Z](?:(?!-in-out)[-a-zA-Z_0-9])*)-(in|out|in-out)$/;\nconst boundPattern = /^((bind|class)-(([-a-zA-Z0-9_])+))$/;\nconst directives = {\n lazy: { t: BINDING_FLAG, v: 'l' },\n twoway: { t: BINDING_FLAG, v: 't' },\n 'no-delegation': { t: DELEGATE_FLAG }\n};\nconst unquotedAttributeValueTextPattern = /^[^\\s\"'=<>\\/`]+/;\nconst proxyEvent = /^[^\\s\"'=<>@\\[\\]()]*/;\nconst whitespace = /^\\s+/;\n\nconst slashes = /\\\\/g;\nfunction splitEvent(str) {\n const result = [];\n let s = 0;\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '-' && str[i - 1] !== '\\\\') {\n result.push(str.substring(s, i).replace(slashes, ''));\n s = i + 1;\n }\n }\n\n result.push(str.substring(s).replace(slashes, ''));\n\n return result;\n}\n\nexport default function readAttribute(parser) {\n let name, i, nearest, idx;\n\n parser.sp();\n\n name = parser.matchPattern(attributeNamePattern);\n if (!name) {\n return null;\n }\n\n // check for accidental delimiter consumption e.g. <tag bool{{>attrs}} />\n nearest = name.length;\n for (i = 0; i < parser.tags.length; i++) {\n if (~(idx = name.indexOf(parser.tags[i].open))) {\n if (idx < nearest) nearest = idx;\n }\n }\n if (nearest < name.length) {\n parser.pos -= name.length - nearest;\n name = name.substr(0, nearest);\n if (!name) return null;\n }\n\n return { n: name };\n}\n\nfunction readAttributeValue(parser) {\n const start = parser.pos;\n\n // next character must be `=`, `/`, `>` or whitespace\n if (!/[=\\/>\\s]/.test(parser.nextChar())) {\n parser.error('Expected `=`, `/`, `>` or whitespace');\n }\n\n parser.sp();\n\n if (!parser.matchString('=')) {\n parser.pos = start;\n return null;\n }\n\n parser.sp();\n\n const valueStart = parser.pos;\n const startDepth = parser.sectionDepth;\n\n const value =\n readQuotedAttributeValue(parser, `'`) ||\n readQuotedAttributeValue(parser, `\"`) ||\n readUnquotedAttributeValue(parser);\n\n if (value === null) {\n parser.error('Expected valid attribute value');\n }\n\n if (parser.sectionDepth !== startDepth) {\n parser.pos = valueStart;\n parser.error(\n 'An attribute value must contain as many opening section tags as closing section tags'\n );\n }\n\n if (!value.length) {\n return '';\n }\n\n if (value.length === 1 && isString(value[0])) {\n return decodeCharacterReferences(value[0]);\n }\n\n return value;\n}\n\nfunction readUnquotedAttributeValueToken(parser) {\n let text, index;\n\n const start = parser.pos;\n\n text = parser.matchPattern(unquotedAttributeValueTextPattern);\n\n if (!text) {\n return null;\n }\n\n const haystack = text;\n const needles = parser.tags.map(t => t.open); // TODO refactor... we do this in readText.js as well\n\n if ((index = getLowestIndex(haystack, needles)) !== -1) {\n text = text.substr(0, index);\n parser.pos = start + text.length;\n }\n\n return text;\n}\n\nfunction readUnquotedAttributeValue(parser) {\n parser.inAttribute = true;\n\n const tokens = [];\n\n let token = readMustache(parser) || readUnquotedAttributeValueToken(parser);\n while (token) {\n tokens.push(token);\n token = readMustache(parser) || readUnquotedAttributeValueToken(parser);\n }\n\n if (!tokens.length) {\n return null;\n }\n\n parser.inAttribute = false;\n return tokens;\n}\n\nfunction readQuotedAttributeValue(parser, quoteMark) {\n const start = parser.pos;\n\n if (!parser.matchString(quoteMark)) {\n return null;\n }\n\n parser.inAttribute = quoteMark;\n\n const tokens = [];\n\n let token = readMustache(parser) || readQuotedStringToken(parser, quoteMark);\n while (token !== null) {\n tokens.push(token);\n token = readMustache(parser) || readQuotedStringToken(parser, quoteMark);\n }\n\n if (!parser.matchString(quoteMark)) {\n parser.pos = start;\n return null;\n }\n\n parser.inAttribute = false;\n\n return tokens;\n}\n\nfunction readQuotedStringToken(parser, quoteMark) {\n const haystack = parser.remaining();\n\n const needles = parser.tags.map(t => t.open); // TODO refactor... we do this in readText.js as well\n needles.push(quoteMark);\n\n const index = getLowestIndex(haystack, needles);\n\n if (index === -1) {\n parser.error('Quoted attribute value must have a closing quote');\n }\n\n if (!index) {\n return null;\n }\n\n parser.pos += index;\n return haystack.substr(0, index);\n}\n\nexport function readAttributeOrDirective(parser) {\n let match, directive;\n\n const attribute = readAttribute(parser, false);\n\n if (!attribute) return null;\n\n // lazy, twoway\n if ((directive = directives[attribute.n])) {\n attribute.t = directive.t;\n if (directive.v) attribute.v = directive.v;\n delete attribute.n; // no name necessary\n parser.sp();\n if (parser.nextChar() === '=') attribute.f = readAttributeValue(parser);\n } else if ((match = decoratorPattern.exec(attribute.n))) {\n // decorators\n attribute.n = match[1];\n attribute.t = DECORATOR;\n readArguments(parser, attribute);\n } else if ((match = transitionPattern.exec(attribute.n))) {\n // transitions\n attribute.n = match[1];\n attribute.t = TRANSITION;\n readArguments(parser, attribute);\n attribute.v = match[2] === 'in-out' ? 't0' : match[2] === 'in' ? 't1' : 't2';\n } else if ((match = eventPattern.exec(attribute.n))) {\n // on-click etc\n attribute.n = splitEvent(match[1]);\n attribute.t = EVENT;\n\n if (parser.matchString('(')) {\n attribute.a = flattenExpression({\n t: ARRAY_LITERAL,\n m: readExpressionList(parser)\n });\n if (!parser.matchString(')')) parser.error(`Expected closing ')'`);\n }\n\n parser.inEvent = true;\n\n // check for a proxy event\n if (!readProxyEvent(parser, attribute)) {\n // otherwise, it's an expression\n readArguments(parser, attribute, true);\n } else if (reservedEventNames.test(attribute.f)) {\n parser.pos -= attribute.f.length;\n parser.error(\n 'Cannot use reserved event names (change, reset, teardown, update, construct, config, init, render, unrender, complete, detach, insert, destruct, attachchild, detachchild)'\n );\n }\n\n parser.inEvent = false;\n } else if ((match = boundPattern.exec(attribute.n))) {\n // bound directives\n const bind = match[2] === 'bind';\n attribute.n = bind ? match[3] : match[1];\n attribute.t = ATTRIBUTE;\n readArguments(parser, attribute, false, true);\n\n if (!attribute.f && bind) {\n attribute.f = [{ t: INTERPOLATOR, r: match[3] }];\n }\n } else {\n parser.sp();\n const value = parser.nextChar() === '=' ? readAttributeValue(parser) : null;\n attribute.f = value != null ? value : attribute.f;\n\n if (parser.sanitizeEventAttributes && onPattern.test(attribute.n)) {\n return { exclude: true };\n } else {\n attribute.f = attribute.f || (attribute.f === '' ? '' : 0);\n attribute.t = ATTRIBUTE;\n }\n }\n\n return attribute;\n}\n\nfunction readProxyEvent(parser, attribute) {\n const start = parser.pos;\n if (!parser.matchString('=')) parser.error(`Missing required directive arguments`);\n\n const quote = parser.matchString(`'`) || parser.matchString(`\"`);\n parser.sp();\n const proxy = parser.matchPattern(proxyEvent);\n\n if (proxy !== undefined) {\n if (quote) {\n parser.sp();\n if (!parser.matchString(quote)) parser.pos = start;\n else return (attribute.f = proxy) || true;\n } else if (!parser.matchPattern(whitespace)) {\n parser.pos = start;\n } else {\n return (attribute.f = proxy) || true;\n }\n } else {\n parser.pos = start;\n }\n}\n\nfunction readArguments(parser, attribute, required = false, single = false) {\n parser.sp();\n if (!parser.matchString('=')) {\n if (required) parser.error(`Missing required directive arguments`);\n return;\n }\n parser.sp();\n\n const quote = parser.matchString('\"') || parser.matchString(\"'\");\n const spread = parser.spreadArgs;\n parser.spreadArgs = true;\n parser.inUnquotedAttribute = !quote;\n const expr = single\n ? readExpressionOrReference(parser, [quote || ' ', '/', '>'])\n : { m: readExpressionList(parser), t: ARRAY_LITERAL };\n parser.inUnquotedAttribute = false;\n parser.spreadArgs = spread;\n\n if (quote) {\n parser.sp();\n if (parser.matchString(quote) !== quote) parser.error(`Expected matching quote '${quote}'`);\n }\n\n if (single) {\n const interpolator = { t: INTERPOLATOR };\n refineExpression(expr, interpolator);\n attribute.f = [interpolator];\n } else {\n attribute.f = flattenExpression(expr);\n }\n}\n","import { DELIMCHANGE } from 'config/types';\nimport readDelimiterChange from './mustache/readDelimiterChange';\nimport readRegexpLiteral from './expressions/primary/literal/readRegexpLiteral';\nimport { readAttributeOrDirective } from './element/readAttribute';\n\nconst delimiterChangeToken = { t: DELIMCHANGE, exclude: true };\n\nexport default function readMustache(parser) {\n let mustache, i;\n\n // If we're inside a <script> or <style> tag, and we're not\n // interpolating, bug out\n if (parser.interpolate[parser.inside] === false) {\n return null;\n }\n\n for (i = 0; i < parser.tags.length; i += 1) {\n if ((mustache = readMustacheOfType(parser, parser.tags[i]))) {\n return mustache;\n }\n }\n\n if (parser.inTag && !parser.inAttribute) {\n mustache = readAttributeOrDirective(parser);\n if (mustache) {\n parser.sp();\n return mustache;\n }\n }\n}\n\nfunction readMustacheOfType(parser, tag) {\n let mustache, reader, i;\n\n const start = parser.pos;\n\n if (parser.matchString('\\\\' + tag.open)) {\n if (start === 0 || parser.str[start - 1] !== '\\\\') {\n return tag.open;\n }\n } else if (!parser.matchString(tag.open)) {\n return null;\n }\n\n // delimiter change?\n if ((mustache = readDelimiterChange(parser))) {\n // find closing delimiter or abort...\n if (!parser.matchString(tag.close)) {\n return null;\n }\n\n // ...then make the switch\n tag.open = mustache[0];\n tag.close = mustache[1];\n parser.sortMustacheTags();\n\n return delimiterChangeToken;\n }\n\n parser.sp();\n\n // illegal section closer\n if (parser.matchString('/')) {\n parser.pos -= 1;\n const rewind = parser.pos;\n if (!readRegexpLiteral(parser)) {\n parser.pos = rewind - tag.close.length;\n if (parser.inAttribute) {\n parser.pos = start;\n return null;\n } else {\n parser.error(\"Attempted to close a section that wasn't open\");\n }\n } else {\n parser.pos = rewind;\n }\n }\n\n for (i = 0; i < tag.readers.length; i += 1) {\n reader = tag.readers[i];\n\n if ((mustache = reader(parser, tag))) {\n if (tag.isStatic) {\n mustache.s = 1;\n }\n\n if (parser.includeLinePositions) {\n mustache.q = parser.getLinePos(start);\n }\n\n return mustache;\n }\n }\n\n parser.pos = start;\n return null;\n}\n","import readExpression from '../readExpression';\nimport refineExpression from '../../utils/refineExpression';\n\nconst legalAlias = /^(?:[a-zA-Z$_0-9]|\\\\\\.)+(?:(?:(?:[a-zA-Z$_0-9]|\\\\\\.)+)|(?:\\[[0-9]+\\]))*/;\nconst asRE = /^as/i;\n\nexport function readAliases(parser) {\n const aliases = [];\n let alias;\n const start = parser.pos;\n\n parser.sp();\n\n alias = readAlias(parser);\n\n if (alias) {\n alias.x = refineExpression(alias.x, {});\n aliases.push(alias);\n\n parser.sp();\n\n while (parser.matchString(',')) {\n alias = readAlias(parser);\n\n if (!alias) {\n parser.error('Expected another alias.');\n }\n\n alias.x = refineExpression(alias.x, {});\n aliases.push(alias);\n\n parser.sp();\n }\n\n return aliases;\n }\n\n parser.pos = start;\n return null;\n}\n\nexport function readAlias(parser) {\n const start = parser.pos;\n\n parser.sp();\n\n const expr = readExpression(parser, []);\n\n if (!expr) {\n parser.pos = start;\n return null;\n }\n\n parser.sp();\n parser.matchPattern(asRE);\n parser.sp();\n\n const alias = parser.matchPattern(legalAlias);\n\n if (!alias) {\n parser.pos = start;\n return null;\n }\n\n return { n: alias, x: expr };\n}\n","import { CATCH, ELSE, ELSEIF, THEN } from 'config/types';\nimport readExpression from '../../readExpression';\nimport { name } from '../../expressions/shared/patterns';\n\nconst patterns = {\n else: /^\\s*else\\s*/,\n elseif: /^\\s*elseif\\s+/,\n then: /^\\s*then\\s*/,\n catch: /^\\s*catch\\s*/\n};\n\nconst types = {\n else: ELSE,\n elseif: ELSEIF,\n then: THEN,\n catch: CATCH\n};\n\nexport default function readInlineBlock(parser, tag, type) {\n const start = parser.pos;\n\n if (!parser.matchString(tag.open)) {\n return null;\n }\n\n if (!parser.matchPattern(patterns[type])) {\n parser.pos = start;\n return null;\n }\n\n const res = { t: types[type] };\n\n if (type === 'elseif') {\n res.x = readExpression(parser);\n } else if (type === 'catch' || type === 'then') {\n const nm = parser.matchPattern(name);\n if (nm) res.n = nm;\n }\n\n if (!parser.matchString(tag.close)) {\n parser.error(`Expected closing delimiter '${tag.close}'`);\n }\n\n return res;\n}\n","import { SECTION_EACH, SECTION_IF, SECTION_IF_WITH, SECTION_UNLESS } from 'config/types';\n\nexport default {\n each: SECTION_EACH,\n if: SECTION_IF,\n with: SECTION_IF_WITH,\n unless: SECTION_UNLESS\n};\n","import {\n ALIAS,\n AWAIT,\n CATCH,\n ELSE,\n ELSEIF,\n SECTION,\n SECTION_IF,\n SECTION_UNLESS,\n THEN\n} from 'config/types';\nimport { READERS } from 'parse/_parse';\nimport readClosing from './section/readClosing';\nimport readInlineBlock from './section/readInlineBlock';\nimport handlebarsBlockCodes from './handlebarsBlockCodes';\nimport readExpression from '../readExpression';\nimport refineExpression from 'parse/utils/refineExpression';\nimport { readAlias, readAliases } from './readAliases';\nimport { keys } from 'utils/object';\nimport { name } from '../expressions/shared/patterns';\n\nconst indexRefPattern = /^\\s*:\\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/;\nconst keyIndexRefPattern = /^\\s*,\\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/;\nconst handlebarsBlockPattern = new RegExp('^(' + keys(handlebarsBlockCodes).join('|') + ')\\\\b');\n\nexport default function readSection(parser, tag) {\n let expression,\n section,\n child,\n children,\n hasElse,\n block,\n unlessBlock,\n closed,\n i,\n expectedClose,\n hasThen,\n hasCatch,\n inlineThen;\n let aliasOnly = false;\n\n const start = parser.pos;\n\n if (parser.matchString('^')) {\n // watch out for parent context refs - {{^^/^^/foo}}\n if (parser.matchString('^/')) {\n parser.pos = start;\n return null;\n }\n section = { t: SECTION, f: [], n: SECTION_UNLESS };\n } else if (parser.matchString('#')) {\n section = { t: SECTION, f: [] };\n\n if (parser.matchString('partial')) {\n parser.pos = start - parser.standardDelimiters[0].length;\n parser.error(\n 'Partial definitions can only be at the top level of the template, or immediately inside components'\n );\n }\n\n if ((block = parser.matchString('await'))) {\n expectedClose = block;\n section.t = AWAIT;\n } else if ((block = parser.matchPattern(handlebarsBlockPattern))) {\n expectedClose = block;\n section.n = handlebarsBlockCodes[block];\n }\n } else {\n return null;\n }\n\n parser.sp();\n\n if (block === 'with') {\n const aliases = readAliases(parser);\n if (aliases) {\n aliasOnly = true;\n section.z = aliases;\n section.t = ALIAS;\n }\n } else if (block === 'each') {\n const alias = readAlias(parser);\n if (alias) {\n section.z = [{ n: alias.n, x: { r: '.' } }];\n expression = alias.x;\n }\n }\n\n if (!aliasOnly) {\n if (!expression) expression = readExpression(parser);\n\n if (!expression) {\n parser.error('Expected expression');\n }\n\n // extra each aliases\n if (block === 'each' && parser.matchString(',')) {\n const aliases = readAliases(parser);\n if (aliases) {\n if (section.z) aliases.unshift(section.z[0]);\n section.z = aliases;\n }\n }\n\n // optional index and key references\n if ((block === 'each' || !block) && (i = parser.matchPattern(indexRefPattern))) {\n let extra;\n\n if ((extra = parser.matchPattern(keyIndexRefPattern))) {\n section.i = i + ',' + extra;\n } else {\n section.i = i;\n }\n } else if (block === 'await' && parser.matchString('then')) {\n parser.sp();\n hasThen = true;\n inlineThen = parser.matchPattern(name);\n if (!inlineThen) inlineThen = true;\n }\n\n if (!block && expression.n) {\n expectedClose = expression.n;\n }\n }\n\n parser.sp();\n\n if (parser.matchString('-')) section.w = 1;\n\n if (!parser.matchString(tag.close)) {\n parser.error(`Expected closing delimiter '${tag.close}'`);\n }\n\n parser.sectionDepth += 1;\n children = section.f;\n\n let pos;\n do {\n pos = parser.pos;\n if ((child = readClosing(parser, tag))) {\n if (expectedClose && child.r !== expectedClose) {\n if (!block) {\n if (child.r)\n parser.warn(\n `Expected ${tag.open}/${expectedClose}${tag.close} but found ${tag.open}/${child.r}${\n tag.close\n }`\n );\n } else {\n parser.pos = pos;\n parser.error(`Expected ${tag.open}/${expectedClose}${tag.close}`);\n }\n }\n\n parser.sectionDepth -= 1;\n closed = true;\n } else if (\n !aliasOnly &&\n ((child = readInlineBlock(parser, tag, 'elseif')) ||\n (child = readInlineBlock(parser, tag, 'else')) ||\n (block === 'await' &&\n ((child = readInlineBlock(parser, tag, 'then')) ||\n (child = readInlineBlock(parser, tag, 'catch')))))\n ) {\n if (section.n === SECTION_UNLESS) {\n parser.error('{{else}} not allowed in {{#unless}}');\n }\n\n if (hasElse) {\n if (child.t === ELSE) {\n parser.error('there can only be one {{else}} block, at the end of a section');\n } else if (child.t === ELSEIF) {\n parser.error('illegal {{elseif...}} after {{else}}');\n }\n }\n\n if (!unlessBlock && (inlineThen || !hasThen) && !hasCatch) {\n if (block === 'await') {\n const s = { f: children };\n section.f = [s];\n if (inlineThen) {\n s.t = THEN;\n inlineThen !== true && (s.n = inlineThen);\n } else {\n s.t = SECTION;\n }\n } else {\n unlessBlock = [];\n }\n }\n\n const mustache = {\n t: SECTION,\n f: (children = [])\n };\n\n if (child.t === ELSE) {\n if (block === 'await') {\n section.f.push(mustache);\n mustache.t = ELSE;\n } else {\n mustache.n = SECTION_UNLESS;\n unlessBlock.push(mustache);\n }\n hasElse = true;\n } else if (child.t === ELSEIF) {\n mustache.n = SECTION_IF;\n refineExpression(child.x, mustache);\n unlessBlock.push(mustache);\n } else if (child.t === THEN) {\n if (hasElse) parser.error('{{then}} block must appear before any {{else}} block');\n if (hasCatch) parser.error('{{then}} block must appear before any {{catch}} block');\n if (hasThen) parser.error('there can only be one {{then}} block per {{#await}}');\n mustache.t = THEN;\n hasThen = true;\n child.n && (mustache.n = child.n);\n section.f.push(mustache);\n } else if (child.t === CATCH) {\n if (hasElse) parser.error('{{catch}} block must appear before any {{else}} block');\n if (hasCatch) parser.error('there can only be one {{catch}} block per {{#await}}');\n mustache.t = CATCH;\n hasCatch = true;\n mustache.n = child.n;\n section.f.push(mustache);\n }\n } else {\n child = parser.read(READERS);\n\n if (!child) {\n break;\n }\n\n children.push(child);\n }\n } while (!closed);\n\n if (unlessBlock) {\n section.l = unlessBlock;\n }\n\n if (!aliasOnly) {\n refineExpression(expression, section);\n }\n\n if (block === 'await' && (inlineThen || !hasThen) && !hasCatch && !hasElse) {\n const s = { f: section.f };\n section.f = [s];\n if (inlineThen) {\n s.t = THEN;\n inlineThen !== true && (s.n = inlineThen);\n } else {\n s.t = SECTION;\n }\n }\n\n // TODO if a section is empty it should be discarded. Don't do\n // that here though - we need to clean everything up first, as\n // it may contain removeable whitespace. As a temporary measure,\n // to pass the existing tests, remove empty `f` arrays\n if (!section.f.length) {\n delete section.f;\n }\n\n return section;\n}\n","import { COMMENT } from 'config/types';\n\nconst OPEN_COMMENT = '<!--';\nconst CLOSE_COMMENT = '-->';\n\nexport default function readHtmlComment(parser) {\n const start = parser.pos;\n\n if (parser.textOnlyMode || !parser.matchString(OPEN_COMMENT)) {\n return null;\n }\n\n const remaining = parser.remaining();\n const endIndex = remaining.indexOf(CLOSE_COMMENT);\n\n if (endIndex === -1) {\n parser.error(\"Illegal HTML - expected closing comment sequence ('-->')\");\n }\n\n const content = remaining.substr(0, endIndex);\n parser.pos += endIndex + 3;\n\n const comment = {\n t: COMMENT,\n c: content\n };\n\n if (parser.includeLinePositions) {\n comment.q = parser.getLinePos(start);\n }\n\n return comment;\n}\n","import { COMMENT, DELIMCHANGE, SECTION, INVERTED } from 'config/types';\nimport { lastItem } from 'utils/array';\nimport { isString } from 'utils/is';\n\nconst leadingLinebreak = /^[ \\t\\f\\r\\n]*\\r?\\n/;\nconst trailingLinebreak = /\\r?\\n[ \\t\\f\\r\\n]*$/;\n\nexport default function(items, preserveStandaloneSections) {\n let i, current, backOne, backTwo, lastSectionItem;\n\n for (i = 1; i < items.length; i += 1) {\n current = items[i];\n backOne = items[i - 1];\n backTwo = items[i - 2];\n\n // if we're at the end of a [text][comment][text] sequence...\n if (isString(current) && isComment(backOne) && isString(backTwo)) {\n // ... and the comment is a standalone (i.e. line breaks either side)...\n if (trailingLinebreak.test(backTwo) && leadingLinebreak.test(current)) {\n // ... then we want to remove the whitespace after the first line break\n items[i - 2] = backTwo.replace(trailingLinebreak, '\\n');\n\n // and the leading line break of the second text token\n items[i] = current.replace(leadingLinebreak, '');\n }\n }\n\n if (!preserveStandaloneSections) {\n // if the current item is a section, and it is preceded by a linebreak, and\n // its first item is a linebreak...\n if (isSection(current) && isString(backOne)) {\n if (\n trailingLinebreak.test(backOne) &&\n isString(current.f[0]) &&\n leadingLinebreak.test(current.f[0])\n ) {\n items[i - 1] = backOne.replace(trailingLinebreak, '\\n');\n current.f[0] = current.f[0].replace(leadingLinebreak, '');\n }\n }\n\n // if the last item was a section, and it is followed by a linebreak, and\n // its last item is a linebreak...\n if (isString(current) && isSection(backOne)) {\n lastSectionItem = lastItem(backOne.f);\n\n if (\n isString(lastSectionItem) &&\n trailingLinebreak.test(lastSectionItem) &&\n leadingLinebreak.test(current)\n ) {\n backOne.f[backOne.f.length - 1] = lastSectionItem.replace(trailingLinebreak, '\\n');\n items[i] = current.replace(leadingLinebreak, '');\n }\n }\n }\n }\n\n return items;\n}\n\nfunction isComment(item) {\n return item.t === COMMENT || item.t === DELIMCHANGE;\n}\n\nfunction isSection(item) {\n return (item.t === SECTION || item.t === INVERTED) && item.f;\n}\n","import { COMMENT, ELEMENT } from 'config/types';\nimport stripStandalones from './stripStandalones';\nimport trimWhitespace from './trimWhitespace';\nimport { isString } from 'utils/is';\n\nconst contiguousWhitespace = /[ \\t\\f\\r\\n]+/g;\nconst leadingWhitespace = /^[ \\t\\f\\r\\n]+/;\nconst trailingWhitespace = /[ \\t\\f\\r\\n]+$/;\nconst leadingNewLine = /^(?:\\r\\n|\\r|\\n)/;\nconst trailingNewLine = /(?:\\r\\n|\\r|\\n)$/;\nconst trailingIndent = /(\\n)?[ \\t]*$/;\nconst leadingLine = /[ \\t]*\\n/;\n\nexport default function cleanup(\n items,\n stripComments,\n preserveWhitespace,\n removeLeadingWhitespace,\n removeTrailingWhitespace,\n whiteSpaceElements,\n preserveStandaloneSections\n) {\n if (isString(items)) return;\n\n let i,\n item,\n previousItem,\n nextItem,\n preserveWhitespaceInsideFragment,\n removeLeadingWhitespaceInsideFragment,\n removeTrailingWhitespaceInsideFragment;\n\n // First pass - remove standalones and comments etc\n stripStandalones(items, preserveStandaloneSections);\n\n i = items.length;\n while (i--) {\n item = items[i];\n\n // Remove delimiter changes, unsafe elements etc\n if (item.exclude) {\n items.splice(i, 1);\n } else if (stripComments && item.t === COMMENT) {\n // Remove comments, unless we want to keep them\n items.splice(i, 1);\n }\n }\n\n // If necessary, remove leading and trailing whitespace\n trimWhitespace(\n items,\n removeLeadingWhitespace ? leadingWhitespace : null,\n removeTrailingWhitespace ? trailingWhitespace : null\n );\n\n i = items.length;\n while (i--) {\n item = items[i];\n removeLeadingWhitespaceInsideFragment = removeTrailingWhitespaceInsideFragment = false;\n\n if (item.w) {\n const prev = items[i - 1];\n let hitLast = true;\n if (typeof prev === 'string') items[i - 1] = prev.replace(trailingIndent, '$1');\n if (item.f) {\n if (typeof item.f[0] === 'string') item.f[0] = item.f[0].replace(leadingLine, '');\n const last = item.f.length - 1;\n if (typeof item.f[last] === 'string') {\n item.f[last] = item.f[last].replace(trailingIndent, (_m, str) => {\n hitLast = str;\n return str || '';\n });\n }\n }\n const next = items[i + 1];\n if (hitLast && typeof next === 'string') items[i + 1] = next.replace(leadingLine, '');\n }\n\n // Recurse\n if (item.f) {\n const isPreserveWhitespaceElement =\n item.t === ELEMENT &&\n (whiteSpaceElements[item.e.toLowerCase()] || whiteSpaceElements[item.e]);\n preserveWhitespaceInsideFragment = preserveWhitespace || isPreserveWhitespaceElement;\n\n if (!preserveWhitespace && isPreserveWhitespaceElement) {\n trimWhitespace(item.f, leadingNewLine, trailingNewLine);\n }\n\n if (!preserveWhitespaceInsideFragment) {\n previousItem = items[i - 1];\n nextItem = items[i + 1];\n\n // if the previous item was a text item with trailing whitespace,\n // remove leading whitespace inside the fragment\n if (!previousItem || (isString(previousItem) && trailingWhitespace.test(previousItem))) {\n removeLeadingWhitespaceInsideFragment = true;\n }\n\n // and vice versa\n if (!nextItem || (isString(nextItem) && leadingWhitespace.test(nextItem))) {\n removeTrailingWhitespaceInsideFragment = true;\n }\n }\n\n cleanup(\n item.f,\n stripComments,\n preserveWhitespaceInsideFragment,\n removeLeadingWhitespaceInsideFragment,\n removeTrailingWhitespaceInsideFragment,\n whiteSpaceElements\n );\n }\n\n // Split if-else blocks into two (an if, and an unless)\n if (item.l) {\n if (item.w) item.l.forEach(l => (l.w = 1));\n cleanup(\n item.l,\n stripComments,\n preserveWhitespace,\n removeLeadingWhitespaceInsideFragment,\n removeTrailingWhitespaceInsideFragment,\n whiteSpaceElements\n );\n\n item.l.forEach(s => (s.l = 1));\n item.l.unshift(i + 1, 0);\n items.splice.apply(items, item.l);\n delete item.l; // TODO would be nice if there was a way around this\n }\n\n // Clean up conditional attributes\n if (item.m) {\n cleanup(\n item.m,\n stripComments,\n preserveWhitespace,\n removeLeadingWhitespaceInsideFragment,\n removeTrailingWhitespaceInsideFragment,\n whiteSpaceElements\n );\n if (item.m.length < 1) delete item.m;\n }\n\n delete item.w;\n }\n\n // final pass - fuse text nodes together\n i = items.length;\n while (i--) {\n if (isString(items[i])) {\n if (isString(items[i + 1])) {\n items[i] = items[i] + items[i + 1];\n items.splice(i + 1, 1);\n }\n\n if (!preserveWhitespace) {\n items[i] = items[i].replace(contiguousWhitespace, ' ');\n }\n\n if (items[i] === '') {\n items.splice(i, 1);\n }\n }\n }\n}\n","import { CLOSING_TAG } from 'src/config/types';\n\nconst closingTagPattern = /^([a-zA-Z]{1,}:?[a-zA-Z0-9\\-]*)\\s*\\>/;\n\nexport default function readClosingTag(parser) {\n let tag;\n\n const start = parser.pos;\n\n // are we looking at a closing tag?\n if (!parser.matchString('</')) {\n return null;\n }\n\n if ((tag = parser.matchPattern(closingTagPattern))) {\n if (parser.inside && tag !== parser.inside) {\n parser.pos = start;\n return null;\n }\n\n return {\n t: CLOSING_TAG,\n e: tag\n };\n }\n\n // We have an illegal closing tag, report it\n parser.pos -= 2;\n parser.error('Illegal closing tag');\n}\n","import { ANCHOR, DOCTYPE, ELEMENT, ATTRIBUTE } from 'config/types';\nimport { voidElements } from 'utils/html';\nimport { READERS, PARTIAL_READERS } from '../_parse';\nimport cleanup from 'parse/utils/cleanup';\nimport readMustache from './readMustache';\nimport readClosingTag from './element/readClosingTag';\nimport readClosing from './mustache/section/readClosing';\nimport { create } from 'utils/object';\nimport { isString } from 'utils/is';\nimport hyphenateCamel from 'utils/hyphenateCamel';\n\nconst tagNamePattern = /^[a-zA-Z]{1,}:?[a-zA-Z0-9\\-]*/;\nconst anchorPattern = /^[a-zA-Z_$][-a-zA-Z0-9_$]*/;\nconst validTagNameFollower = /^[\\s\\n\\/>]/;\nconst semiEnd = /;\\s*$/;\nconst exclude = { exclude: true };\n\n// based on http://developers.whatwg.org/syntax.html#syntax-tag-omission\nconst disallowedContents = {\n li: ['li'],\n dt: ['dt', 'dd'],\n dd: ['dt', 'dd'],\n p: 'address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul'.split(\n ' '\n ),\n rt: ['rt', 'rp'],\n rp: ['rt', 'rp'],\n optgroup: ['optgroup'],\n option: ['option', 'optgroup'],\n thead: ['tbody', 'tfoot'],\n tbody: ['tbody', 'tfoot'],\n tfoot: ['tbody'],\n tr: ['tr', 'tbody'],\n td: ['td', 'th', 'tr'],\n th: ['td', 'th', 'tr']\n};\n\nexport default readElement;\n\nfunction readElement(parser) {\n let attribute,\n selfClosing,\n children,\n partials,\n hasPartials,\n child,\n closed,\n pos,\n remaining,\n closingTag,\n anchor;\n\n const start = parser.pos;\n\n if (parser.inside || parser.inAttribute || parser.textOnlyMode) {\n return null;\n }\n\n if (!parser.matchString('<')) {\n return null;\n }\n\n // if this is a closing tag, abort straight away\n if (parser.nextChar() === '/') {\n return null;\n }\n\n const element = {};\n if (parser.includeLinePositions) {\n element.q = parser.getLinePos(start);\n }\n\n // check for doctype decl\n if (parser.matchString('!')) {\n element.t = DOCTYPE;\n if (!parser.matchPattern(/^doctype/i)) {\n parser.error('Expected DOCTYPE declaration');\n }\n\n element.a = parser.matchPattern(/^(.+?)>/);\n return element;\n } else if ((anchor = parser.matchString('#'))) {\n // check for anchor\n parser.sp();\n element.t = ANCHOR;\n element.n = parser.matchPattern(anchorPattern);\n } else {\n // otherwise, it's an element/component\n element.t = ELEMENT;\n\n // element name\n element.e = parser.matchPattern(tagNamePattern);\n if (!element.e) {\n return null;\n }\n }\n\n // next character must be whitespace, closing solidus or '>'\n if (!validTagNameFollower.test(parser.nextChar())) {\n parser.error('Illegal tag name');\n }\n\n parser.sp();\n\n parser.inTag = true;\n\n // directives and attributes\n while ((attribute = readMustache(parser))) {\n if (attribute !== false) {\n if (!element.m) element.m = [];\n element.m.push(attribute);\n }\n\n parser.sp();\n }\n\n parser.inTag = false;\n\n // allow whitespace before closing solidus\n parser.sp();\n\n // self-closing solidus?\n if (parser.matchString('/')) {\n selfClosing = true;\n }\n\n // closing angle bracket\n if (!parser.matchString('>')) {\n return null;\n }\n\n const lowerCaseName = (element.e || element.n).toLowerCase();\n const preserveWhitespace = parser.preserveWhitespace;\n\n if (!selfClosing && (anchor || !voidElements[element.e.toLowerCase()])) {\n if (!anchor) {\n parser.elementStack.push(lowerCaseName);\n\n // Special case - if we open a script element, further tags should\n // be ignored unless they're a closing script element\n if (lowerCaseName in parser.interpolate) {\n parser.inside = lowerCaseName;\n }\n }\n\n children = [];\n partials = create(null);\n\n do {\n pos = parser.pos;\n remaining = parser.remaining();\n\n if (!remaining) {\n // if this happens to be a script tag and there's no content left, it's because\n // a closing script tag can't appear in a script\n if (parser.inside === 'script') {\n closed = true;\n break;\n }\n\n parser.error(\n `Missing end ${parser.elementStack.length > 1 ? 'tags' : 'tag'} (${parser.elementStack\n .reverse()\n .map(x => `</${x}>`)\n .join('')})`\n );\n }\n\n // if for example we're in an <li> element, and we see another\n // <li> tag, close the first so they become siblings\n if (!anchor && !canContain(lowerCaseName, remaining)) {\n closed = true;\n } else if (!anchor && (closingTag = readClosingTag(parser))) {\n // closing tag\n closed = true;\n\n const closingTagName = closingTag.e.toLowerCase();\n\n // if this *isn't* the closing tag for the current element...\n if (closingTagName !== lowerCaseName) {\n // rewind parser\n parser.pos = pos;\n\n // if it doesn't close a parent tag, error\n if (!~parser.elementStack.indexOf(closingTagName)) {\n let errorMessage = 'Unexpected closing tag';\n\n // add additional help for void elements, since component names\n // might clash with them\n if (voidElements[closingTagName.toLowerCase()]) {\n errorMessage += ` (<${closingTagName}> is a void element - it cannot contain children)`;\n }\n\n parser.error(errorMessage);\n }\n }\n } else if (anchor && readAnchorClose(parser, element.n)) {\n closed = true;\n } else {\n // implicit close by closing section tag. TODO clean this up\n const tag = {\n open: parser.standardDelimiters[0],\n close: parser.standardDelimiters[1]\n };\n if (readClosing(parser, tag) || readInline(parser, tag)) {\n closed = true;\n parser.pos = pos;\n } else if ((child = parser.read(PARTIAL_READERS))) {\n if (partials[child.n]) {\n parser.pos = pos;\n parser.error('Duplicate partial definition');\n }\n\n cleanup(\n child.f,\n parser.stripComments,\n preserveWhitespace,\n !preserveWhitespace,\n !preserveWhitespace,\n parser.whiteSpaceElements\n );\n\n partials[child.n] = child.f;\n hasPartials = true;\n } else {\n if ((child = parser.read(READERS))) {\n children.push(child);\n } else {\n closed = true;\n }\n }\n }\n } while (!closed);\n\n if (children.length) {\n element.f = children;\n }\n\n if (hasPartials) {\n element.p = partials;\n }\n\n parser.elementStack.pop();\n }\n\n parser.inside = null;\n\n if (parser.sanitizeElements && parser.sanitizeElements.indexOf(lowerCaseName) !== -1) {\n return exclude;\n }\n\n if (\n element.m &&\n lowerCaseName !== 'input' &&\n lowerCaseName !== 'select' &&\n lowerCaseName !== 'textarea' &&\n lowerCaseName !== 'option'\n ) {\n const attrs = element.m;\n let classes, styles, cls, style;\n let i = 0;\n let a;\n while (i < attrs.length) {\n a = attrs[i];\n\n if (a.t !== ATTRIBUTE) {\n i++;\n continue;\n }\n\n if (a.n.indexOf('class-') === 0 && !a.f) {\n // static class directives\n (classes || (classes = [])).push(a.n.slice(6));\n attrs.splice(i, 1);\n } else if (a.n.indexOf('style-') === 0 && isString(a.f)) {\n // static style directives\n (styles || (styles = [])).push(`${hyphenateCamel(a.n.slice(6))}: ${a.f};`);\n attrs.splice(i, 1);\n } else if (a.n === 'class' && isString(a.f)) {\n // static class attrs\n (classes || (classes = [])).push(a.f);\n attrs.splice(i, 1);\n } else if (a.n === 'style' && isString(a.f)) {\n // static style attrs\n (styles || (styles = [])).push(a.f + (semiEnd.test(a.f) ? '' : ';'));\n attrs.splice(i, 1);\n } else if (a.n === 'class') {\n cls = a;\n i++;\n } else if (a.n === 'style') {\n style = a;\n i++;\n } else if (\n !~a.n.indexOf(':') &&\n a.n !== 'value' &&\n a.n !== 'contenteditable' &&\n isString(a.f)\n ) {\n a.g = 1;\n i++;\n } else {\n i++;\n }\n }\n\n if (classes) {\n if (!cls || !isString(cls.f))\n attrs.unshift({ t: ATTRIBUTE, n: 'class', f: classes.join(' '), g: 1 });\n else cls.f += ' ' + classes.join(' ');\n } else if (cls && isString(cls.f)) cls.g = 1;\n\n if (styles) {\n if (!style || !isString(style.f))\n attrs.unshift({ t: ATTRIBUTE, n: 'style', f: styles.join(' '), g: 1 });\n else style.f += '; ' + styles.join(' ');\n } else if (style && isString(style.f)) style.g = 1;\n }\n\n return element;\n}\n\nfunction canContain(name, remaining) {\n const match = /^<([a-zA-Z][a-zA-Z0-9]*)/.exec(remaining);\n const disallowed = disallowedContents[name];\n\n if (!match || !disallowed) {\n return true;\n }\n\n return !~disallowed.indexOf(match[1].toLowerCase());\n}\n\nfunction readAnchorClose(parser, name) {\n const pos = parser.pos;\n if (!parser.matchString('</')) {\n return null;\n }\n\n parser.matchString('#');\n parser.sp();\n\n if (!parser.matchString(name)) {\n parser.pos = pos;\n return null;\n }\n\n parser.sp();\n\n if (!parser.matchString('>')) {\n parser.pos = pos;\n return null;\n }\n\n return true;\n}\n\nconst inlines = /^\\s*(elseif|else|then|catch)\\s*/;\nfunction readInline(parser, tag) {\n const pos = parser.pos;\n if (!parser.matchString(tag.open)) return;\n if (parser.matchPattern(inlines)) {\n return true;\n } else {\n parser.pos = pos;\n }\n}\n","import { INLINE_PARTIAL } from 'config/types';\nimport { READERS } from '../_parse';\nimport readClosing from './mustache/section/readClosing';\n\nconst partialDefinitionSectionPattern = /^\\s*#\\s*partial\\s+/;\n\nexport default function readPartialDefinitionSection(parser) {\n let child, closed;\n\n const start = parser.pos;\n\n const delimiters = parser.standardDelimiters;\n\n if (!parser.matchString(delimiters[0])) {\n return null;\n }\n\n if (!parser.matchPattern(partialDefinitionSectionPattern)) {\n parser.pos = start;\n return null;\n }\n\n const name = parser.matchPattern(/^[a-zA-Z_$][a-zA-Z_$0-9\\-\\/]*/);\n\n if (!name) {\n parser.error('expected legal partial name');\n }\n\n parser.sp();\n if (!parser.matchString(delimiters[1])) {\n parser.error(`Expected closing delimiter '${delimiters[1]}'`);\n }\n\n const content = [];\n\n const [open, close] = delimiters;\n\n do {\n if ((child = readClosing(parser, { open, close }))) {\n if (child.r !== 'partial') {\n parser.error(`Expected ${open}/partial${close}`);\n }\n\n closed = true;\n } else {\n child = parser.read(READERS);\n\n if (!child) {\n parser.error(`Expected ${open}/partial${close}`);\n }\n\n content.push(child);\n }\n } while (!closed);\n\n return {\n t: INLINE_PARTIAL,\n n: name,\n f: content\n };\n}\n","export default {};\n","import { TEMPLATE_VERSION } from 'config/template';\nimport Parser from './Parser';\nimport readMustache from './converters/readMustache';\nimport readTriple from './converters/mustache/readTriple';\nimport readUnescaped from './converters/mustache/readUnescaped';\nimport readPartial from './converters/mustache/readPartial';\nimport readMustacheComment from './converters/mustache/readMustacheComment';\nimport readInterpolator from './converters/mustache/readInterpolator';\nimport readSection from './converters/mustache/readSection';\nimport readHtmlComment from './converters/readHtmlComment';\nimport readElement from './converters/readElement';\nimport readText from './converters/readText';\nimport readPartialDefinitionSection from './converters/readPartialDefinitionSection';\nimport readTemplate from './converters/readTemplate';\nimport readExpression from './converters/readExpression';\nimport { fromExpression } from './utils/createFunction';\nimport cleanup from './utils/cleanup';\nimport insertExpressions from './utils/insertExpressions';\nimport flattenExpression from './utils/flattenExpression';\nimport shared from '../Ractive/shared';\nimport { assign, keys } from 'utils/object';\nimport { isObjectType } from 'utils/is';\n\n// See https://github.com/ractivejs/template-spec for information\n// about the Ractive template specification\n\nconst STANDARD_READERS = [\n readPartial,\n readUnescaped,\n readSection,\n readInterpolator,\n readMustacheComment\n];\nconst TRIPLE_READERS = [readTriple];\n\nexport const READERS = [readMustache, readHtmlComment, readElement, readText];\nexport const PARTIAL_READERS = [readPartialDefinitionSection];\n\nconst preserveWhitespaceElements = { pre: 1, script: 1, style: 1, textarea: 1 };\n\nconst defaultInterpolate = { textarea: true, script: true, style: true, template: true };\n\nconst StandardParser = Parser.extend({\n init(str, options) {\n const tripleDelimiters = options.tripleDelimiters || shared.defaults.tripleDelimiters;\n const staticDelimiters = options.staticDelimiters || shared.defaults.staticDelimiters;\n const staticTripleDelimiters =\n options.staticTripleDelimiters || shared.defaults.staticTripleDelimiters;\n\n this.standardDelimiters = options.delimiters || shared.defaults.delimiters;\n\n this.tags = [\n {\n isStatic: false,\n isTriple: false,\n open: this.standardDelimiters[0],\n close: this.standardDelimiters[1],\n readers: STANDARD_READERS\n },\n {\n isStatic: false,\n isTriple: true,\n open: tripleDelimiters[0],\n close: tripleDelimiters[1],\n readers: TRIPLE_READERS\n },\n {\n isStatic: true,\n isTriple: false,\n open: staticDelimiters[0],\n close: staticDelimiters[1],\n readers: STANDARD_READERS\n },\n {\n isStatic: true,\n isTriple: true,\n open: staticTripleDelimiters[0],\n close: staticTripleDelimiters[1],\n readers: TRIPLE_READERS\n }\n ];\n\n this.contextLines = options.contextLines || shared.defaults.contextLines;\n\n this.sortMustacheTags();\n\n this.sectionDepth = 0;\n this.elementStack = [];\n\n this.interpolate = assign(\n {},\n defaultInterpolate,\n shared.defaults.interpolate,\n options.interpolate\n );\n\n if (options.sanitize === true) {\n options.sanitize = {\n // blacklist from https://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/lang/html/html4-elements-whitelist.json\n elements: 'applet base basefont body frame frameset head html isindex link meta noframes noscript object param script style title'.split(\n ' '\n ),\n eventAttributes: true\n };\n }\n\n this.stripComments = options.stripComments !== false;\n this.preserveWhitespace = isObjectType(options.preserveWhitespace)\n ? false\n : options.preserveWhitespace;\n this.sanitizeElements = options.sanitize && options.sanitize.elements;\n this.sanitizeEventAttributes = options.sanitize && options.sanitize.eventAttributes;\n this.includeLinePositions = options.includeLinePositions;\n this.textOnlyMode = options.textOnlyMode;\n this.csp = options.csp;\n this.allowExpressions = options.allowExpressions;\n\n this.preserveStandaloneSections = this.preserveWhitespace && options.preserveStandaloneSections;\n\n if (options.expression) this.converters = [readExpression];\n\n if (options.attributes) this.inTag = true;\n\n // special whitespace handling requested for certain elements\n this.whiteSpaceElements = assign({}, options.preserveWhitespace, preserveWhitespaceElements);\n },\n\n postProcess(result, options) {\n const [parserResult] = result;\n\n if (options.expression) {\n const expr = flattenExpression(parserResult);\n expr.e = fromExpression(expr.s, expr.r.length);\n return expr;\n } else {\n // special case - empty string\n if (!result.length) {\n return { t: [], v: TEMPLATE_VERSION };\n }\n\n if (this.sectionDepth > 0) {\n this.error('A section was left open');\n }\n\n cleanup(\n parserResult.t,\n this.stripComments,\n this.preserveWhitespace,\n !this.preserveWhitespace,\n !this.preserveWhitespace,\n this.whiteSpaceElements,\n this.preserveStandaloneSections\n );\n\n if (this.csp !== false) {\n const expr = {};\n\n insertExpressions(parserResult.t, expr);\n insertExpressions(parserResult.p || {}, expr);\n\n if (keys(expr).length) parserResult.e = expr;\n }\n\n return parserResult;\n }\n },\n\n converters: [readTemplate],\n\n sortMustacheTags() {\n // Sort in order of descending opening delimiter length (longer first),\n // to protect against opening delimiters being substrings of each other\n this.tags.sort((a, b) => {\n return b.open.length - a.open.length;\n });\n }\n});\n\nexport default function parse(template, options) {\n return new StandardParser(template, options || {}).result;\n}\n","import { fromExpression } from 'parse/utils/createFunction';\nimport { doc } from 'config/environment';\nimport { fatal } from 'utils/log';\nimport { addFunctions } from 'shared/getFunction';\nimport parse from 'parse/_parse';\nimport { isString } from 'utils/is';\n\nconst parseOptions = [\n 'delimiters',\n 'tripleDelimiters',\n 'staticDelimiters',\n 'staticTripleDelimiters',\n 'csp',\n 'interpolate',\n 'preserveWhitespace',\n 'preserveStandaloneSections',\n 'sanitize',\n 'stripComments',\n 'contextLines',\n 'allowExpressions',\n 'attributes'\n];\n\nconst TEMPLATE_INSTRUCTIONS = `Either preparse or use a ractive runtime source that includes the parser. `;\n\nconst COMPUTATION_INSTRUCTIONS = `Either include a version of Ractive that can parse or convert your computation strings to functions.`;\n\nfunction throwNoParse(method, error, instructions) {\n if (!method) {\n fatal(`Missing Ractive.parse - cannot parse ${error}. ${instructions}`);\n }\n}\n\nexport function createFunction(body, length) {\n throwNoParse(fromExpression, 'new expression function', TEMPLATE_INSTRUCTIONS);\n return fromExpression(body, length);\n}\n\nexport function createFunctionFromString(str, bindTo) {\n throwNoParse(parse, 'compution string \"${str}\"', COMPUTATION_INSTRUCTIONS);\n const tpl = parse(str, { expression: true });\n return function() {\n return tpl.e.apply(bindTo, tpl.r.map(r => bindTo.get(r)));\n };\n}\n\nconst parser = {\n fromId(id, options) {\n if (!doc) {\n if (options && options.noThrow) {\n return;\n }\n throw new Error(`Cannot retrieve template #${id} as Ractive is not running in a browser.`);\n }\n\n if (id) id = id.replace(/^#/, '');\n\n let template;\n\n if (!(template = doc.getElementById(id))) {\n if (options && options.noThrow) {\n return;\n }\n throw new Error(`Could not find template element with id #${id}`);\n }\n\n if (template.tagName.toUpperCase() !== 'SCRIPT') {\n if (options && options.noThrow) {\n return;\n }\n throw new Error(`Template element with id #${id}, must be a <script> element`);\n }\n\n return 'textContent' in template ? template.textContent : template.innerHTML;\n },\n\n isParsed(template) {\n return !isString(template);\n },\n\n getParseOptions(ractive) {\n // Could be Ractive or a Component\n if (ractive.defaults) {\n ractive = ractive.defaults;\n }\n\n return parseOptions.reduce((val, key) => {\n val[key] = ractive[key];\n return val;\n }, {});\n },\n\n parse(template, options) {\n throwNoParse(parse, 'template', TEMPLATE_INSTRUCTIONS);\n const parsed = parse(template, options);\n addFunctions(parsed);\n return parsed;\n },\n\n parseFor(template, ractive) {\n return this.parse(template, this.getParseOptions(ractive));\n }\n};\n\nexport default parser;\n","import { removeFromArray } from 'utils/array';\nimport { isFunction } from 'utils/is';\n\nlet id = 0;\n\nexport default class TransitionManager {\n constructor(callback, parent) {\n this.callback = callback;\n this.parent = parent;\n\n this.intros = [];\n this.outros = [];\n\n this.children = [];\n this.totalChildren = this.outroChildren = 0;\n\n this.detachQueue = [];\n this.outrosComplete = false;\n\n this.id = id++;\n\n if (parent) {\n parent.addChild(this);\n }\n }\n\n add(transition) {\n const list = transition.isIntro ? this.intros : this.outros;\n transition.starting = true;\n list.push(transition);\n }\n\n addChild(child) {\n this.children.push(child);\n\n this.totalChildren += 1;\n this.outroChildren += 1;\n }\n\n checkStart() {\n if (this.parent && this.parent.started) this.start();\n }\n\n decrementOutros() {\n this.outroChildren -= 1;\n check(this);\n }\n\n decrementTotal() {\n this.totalChildren -= 1;\n check(this);\n }\n\n detachNodes() {\n let len = this.detachQueue.length;\n for (let i = 0; i < len; i++) this.detachQueue[i].detach();\n len = this.children.length;\n for (let i = 0; i < len; i++) this.children[i].detachNodes();\n this.detachQueue = [];\n }\n\n ready() {\n if (this.detachQueue.length) detachImmediate(this);\n }\n\n remove(transition) {\n const list = transition.isIntro ? this.intros : this.outros;\n removeFromArray(list, transition);\n check(this);\n }\n\n start() {\n this.started = true;\n this.children.forEach(c => c.start());\n this.intros.concat(this.outros).forEach(t => t.start());\n check(this);\n }\n}\n\nfunction check(tm) {\n if (!tm.started || tm.outros.length || tm.outroChildren) return;\n\n // If all outros are complete, and we haven't already done this,\n // we notify the parent if there is one, otherwise\n // start detaching nodes\n if (!tm.outrosComplete) {\n tm.outrosComplete = true;\n\n if (tm.parent) tm.parent.decrementOutros(tm);\n\n if (allOutrosComplete(tm)) {\n tm.detachNodes();\n }\n }\n\n // Once everything is done, we can notify parent transition\n // manager and call the callback\n if (!tm.intros.length && !tm.totalChildren) {\n if (isFunction(tm.callback)) {\n tm.callback();\n }\n\n if (tm.parent && !tm.notifiedTotal) {\n tm.notifiedTotal = true;\n tm.parent.decrementTotal();\n }\n }\n}\n\nfunction allOutrosComplete(manager) {\n return !manager || (manager.outrosComplete && allOutrosComplete(manager.parent));\n}\n\n// check through the detach queue to see if a node is up or downstream from a\n// transition and if not, go ahead and detach it\nfunction detachImmediate(manager) {\n const queue = manager.detachQueue;\n const outros = collectAllOutros(manager);\n\n if (!outros.length) {\n manager.detachNodes();\n } else {\n let i = queue.length;\n let j = 0;\n let node, trans;\n const nqueue = (manager.detachQueue = []);\n\n start: while (i--) {\n node = queue[i].node;\n j = outros.length;\n while (j--) {\n trans = outros[j].element.node;\n // check to see if the node is, contains, or is contained by the transitioning node\n if (trans === node || trans.contains(node) || node.contains(trans)) {\n nqueue.push(queue[i]);\n continue start;\n }\n }\n\n // no match, we can drop it\n queue[i].detach();\n }\n }\n}\n\nfunction collectAllOutros(manager, _list) {\n let list = _list;\n\n // if there's no list, we're starting at the root to build one\n if (!list) {\n list = [];\n let parent = manager;\n while (parent.parent) parent = parent.parent;\n return collectAllOutros(parent, list);\n } else {\n // grab all outros from child managers\n let i = manager.children.length;\n while (i--) {\n list = collectAllOutros(manager.children[i], list);\n }\n\n // grab any from this manager if there are any\n if (manager.outros.length) list = list.concat(manager.outros);\n\n return list;\n }\n}\n","import { addToArray } from 'utils/array';\nimport TransitionManager from './TransitionManager';\n\nexport let batch;\n\nconst runloop = {\n active() {\n return !!batch;\n },\n\n start() {\n let fulfilPromise;\n const promise = new Promise(f => (fulfilPromise = f));\n\n batch = {\n previousBatch: batch,\n transitionManager: new TransitionManager(fulfilPromise, batch && batch.transitionManager),\n fragments: [],\n tasks: [],\n immediateObservers: [],\n deferredObservers: [],\n promise\n };\n\n return promise;\n },\n\n end() {\n flushChanges();\n\n if (!batch.previousBatch) batch.transitionManager.start();\n else batch.transitionManager.checkStart();\n\n batch = batch.previousBatch;\n },\n\n addFragment(fragment) {\n addToArray(batch.fragments, fragment);\n },\n\n // TODO: come up with a better way to handle fragments that trigger their own update\n addFragmentToRoot(fragment) {\n if (!batch) return;\n\n let b = batch;\n while (b.previousBatch) {\n b = b.previousBatch;\n }\n\n addToArray(b.fragments, fragment);\n },\n\n addObserver(observer, defer) {\n if (!batch) {\n observer.dispatch();\n } else {\n addToArray(defer ? batch.deferredObservers : batch.immediateObservers, observer);\n }\n },\n\n registerTransition(transition) {\n transition._manager = batch.transitionManager;\n batch.transitionManager.add(transition);\n },\n\n // synchronise node detachments with transition ends\n detachWhenReady(thing) {\n batch.transitionManager.detachQueue.push(thing);\n },\n\n scheduleTask(task, postRender) {\n let _batch;\n\n if (!batch) {\n task();\n } else {\n _batch = batch;\n while (postRender && _batch.previousBatch) {\n // this can't happen until the DOM has been fully updated\n // otherwise in some situations (with components inside elements)\n // transitions and decorators will initialise prematurely\n _batch = _batch.previousBatch;\n }\n\n _batch.tasks.push(task);\n }\n },\n\n promise() {\n if (!batch) return Promise.resolve();\n\n let target = batch;\n while (target.previousBatch) {\n target = target.previousBatch;\n }\n\n return target.promise || Promise.resolve();\n }\n};\n\nexport default runloop;\n\nfunction dispatch(observer) {\n observer.dispatch();\n}\n\nfunction flushChanges() {\n let which = batch.immediateObservers;\n batch.immediateObservers = [];\n which.forEach(dispatch);\n\n // Now that changes have been fully propagated, we can update the DOM\n // and complete other tasks\n let i = batch.fragments.length;\n let fragment;\n\n which = batch.fragments;\n batch.fragments = [];\n\n while (i--) {\n fragment = which[i];\n fragment.update();\n }\n\n batch.transitionManager.ready();\n\n which = batch.deferredObservers;\n batch.deferredObservers = [];\n which.forEach(dispatch);\n\n const tasks = batch.tasks;\n batch.tasks = [];\n\n for (i = 0; i < tasks.length; i += 1) {\n tasks[i]();\n }\n\n // If updating the view caused some model blowback - e.g. a triple\n // containing <option> elements caused the binding on the <select>\n // to update - then we start over\n if (\n batch.fragments.length ||\n batch.immediateObservers.length ||\n batch.deferredObservers.length ||\n batch.tasks.length\n )\n return flushChanges();\n}\n","import runloop from 'src/global/runloop';\n\n// TODO what happens if a transition is aborted?\n\nconst tickers = [];\nlet running = false;\n\nfunction tick() {\n runloop.start();\n\n const now = performance.now();\n\n let i;\n let ticker;\n\n for (i = 0; i < tickers.length; i += 1) {\n ticker = tickers[i];\n\n if (!ticker.tick(now)) {\n // ticker is complete, remove it from the stack, and decrement i so we don't miss one\n tickers.splice(i--, 1);\n }\n }\n\n runloop.end();\n\n if (tickers.length) {\n requestAnimationFrame(tick);\n } else {\n running = false;\n }\n}\n\nexport default class Ticker {\n constructor(options) {\n this.duration = options.duration;\n this.step = options.step;\n this.complete = options.complete;\n this.easing = options.easing;\n\n this.start = performance.now();\n this.end = this.start + this.duration;\n\n this.running = true;\n\n tickers.push(this);\n if (!running) requestAnimationFrame(tick);\n }\n\n tick(now) {\n if (!this.running) return false;\n\n if (now > this.end) {\n if (this.step) this.step(1);\n if (this.complete) this.complete(1);\n\n return false;\n }\n\n const elapsed = now - this.start;\n const eased = this.easing(elapsed / this.duration);\n\n if (this.step) this.step(eased);\n\n return true;\n }\n\n stop() {\n if (this.abort) this.abort();\n this.running = false;\n }\n}\n","import { hasOwn } from 'utils/object';\nimport { isString, isObjectType } from 'utils/is';\n\nconst prefixers = {};\n\n// TODO this is legacy. sooner we can replace the old adaptor API the better\n/* istanbul ignore next */\nfunction prefixKeypath(obj, prefix) {\n const prefixed = {};\n\n if (!prefix) {\n return obj;\n }\n\n prefix += '.';\n\n for (const key in obj) {\n if (hasOwn(obj, key)) {\n prefixed[prefix + key] = obj[key];\n }\n }\n\n return prefixed;\n}\n\nexport default function getPrefixer(rootKeypath) {\n let rootDot;\n\n if (!prefixers[rootKeypath]) {\n rootDot = rootKeypath ? rootKeypath + '.' : '';\n\n /* istanbul ignore next */\n prefixers[rootKeypath] = function(relativeKeypath, value) {\n let obj;\n\n if (isString(relativeKeypath)) {\n obj = {};\n obj[rootDot + relativeKeypath] = value;\n return obj;\n }\n\n if (isObjectType(relativeKeypath)) {\n // 'relativeKeypath' is in fact a hash, not a keypath\n return rootDot ? prefixKeypath(relativeKeypath, rootKeypath) : relativeKeypath;\n }\n };\n }\n\n return prefixers[rootKeypath];\n}\n","import ModelBase, { checkDataLink, maybeBind, shuffle } from './ModelBase';\nimport LinkModel from './LinkModel'; // eslint-disable-line no-unused-vars\nimport getComputationSignature from 'src/Ractive/helpers/getComputationSignature';\nimport { capture } from 'src/global/capture';\nimport { isArray, isEqual, isNumeric, isObjectLike, isUndefined } from 'utils/is';\nimport { handleChange, mark, markForce, marked, teardown } from 'shared/methodCallers';\nimport Ticker from 'shared/Ticker';\nimport getPrefixer from './helpers/getPrefixer';\nimport { unescapeKey } from 'shared/keypaths';\nimport { warnIfDebug } from 'utils/log';\nimport { hasOwn, keys } from 'utils/object';\nimport { buildNewIndices } from 'utils/array';\n\nexport const shared = {};\n\nexport default class Model extends ModelBase {\n constructor(parent, key) {\n super(parent);\n\n this.ticker = null;\n\n if (parent) {\n this.key = unescapeKey(key);\n this.isReadonly = parent.isReadonly;\n\n if (parent.value) {\n this.value = parent.value[this.key];\n if (isArray(this.value)) this.length = this.value.length;\n this.adapt();\n }\n }\n }\n\n adapt() {\n const adaptors = this.root.adaptors;\n const len = adaptors.length;\n\n this.rewrap = false;\n\n // Exit early if no adaptors\n if (len === 0) return;\n\n const value = this.wrapper\n ? 'newWrapperValue' in this\n ? this.newWrapperValue\n : this.wrapperValue\n : this.value;\n\n // TODO remove this legacy nonsense\n const ractive = this.root.ractive;\n const keypath = this.getKeypath();\n\n // tear previous adaptor down if present\n if (this.wrapper) {\n const shouldTeardown =\n this.wrapperValue === value\n ? false\n : !this.wrapper.reset || this.wrapper.reset(value) === false;\n\n if (shouldTeardown) {\n this.wrapper.teardown();\n delete this.wrapper;\n delete this.wrapperValue;\n delete this.newWrapperValue;\n\n // don't branch for undefined values\n if (this.value !== undefined) {\n const parentValue = this.parent.value || this.parent.createBranch(this.key);\n if (parentValue[this.key] !== value) parentValue[this.key] = value;\n this.value = value;\n }\n } else {\n delete this.newWrapperValue;\n this.value = this.wrapper.get();\n return;\n }\n }\n\n let i;\n\n for (i = 0; i < len; i += 1) {\n const adaptor = adaptors[i];\n if (adaptor.filter(value, keypath, ractive)) {\n this.wrapper = adaptor.wrap(ractive, value, keypath, getPrefixer(keypath));\n this.wrapperValue = value;\n this.wrapper.__model = this; // massive temporary hack to enable array adaptor\n\n this.value = this.wrapper.get();\n\n break;\n }\n }\n }\n\n animate(from, to, options, interpolator) {\n if (this.ticker) this.ticker.stop();\n\n let fulfilPromise;\n const promise = new Promise(fulfil => (fulfilPromise = fulfil));\n\n this.ticker = new Ticker({\n duration: options.duration,\n easing: options.easing,\n step: t => {\n const value = interpolator(t);\n this.applyValue(value);\n if (options.step) options.step(t, value);\n },\n complete: () => {\n this.applyValue(to);\n if (options.complete) options.complete(to);\n\n this.ticker = null;\n fulfilPromise(to);\n }\n });\n\n promise.stop = this.ticker.stop;\n return promise;\n }\n\n applyValue(value, notify = true) {\n if (isEqual(value, this.value)) return;\n if (this.boundValue) this.boundValue = null;\n\n if (this.parent.wrapper && this.parent.wrapper.set) {\n this.parent.wrapper.set(this.key, value);\n this.parent.value = this.parent.wrapper.get();\n\n this.value = this.parent.value[this.key];\n if (this.wrapper) this.newWrapperValue = this.value;\n this.adapt();\n } else if (this.wrapper) {\n this.newWrapperValue = value;\n this.adapt();\n } else {\n const parentValue = this.parent.value || this.parent.createBranch(this.key);\n if (isObjectLike(parentValue)) {\n parentValue[this.key] = value;\n } else {\n warnIfDebug(`Attempted to set a property of a non-object '${this.getKeypath()}'`);\n return;\n }\n\n this.value = value;\n this.adapt();\n }\n\n if (this.dataModel || (value && value.viewmodel && value.viewmodel.isRoot)) {\n checkDataLink(this, value);\n }\n\n // keep track of array stuff\n if (isArray(value)) {\n this.length = value.length;\n this.isArray = true;\n } else {\n this.isArray = false;\n }\n\n // notify dependants\n this.links.forEach(handleChange);\n this.children.forEach(mark);\n this.deps.forEach(handleChange);\n\n if (notify) this.notifyUpstream();\n\n if (this.parent.isArray) {\n if (this.key === 'length') this.parent.length = value;\n else this.parent.joinKey('length').mark();\n }\n }\n\n compute(key, computed) {\n const registry = this.computed || (this.computed = {});\n\n if (registry[key]) {\n registry[key].signature = getComputationSignature(this.root.ractive, key, computed);\n registry[key].mark();\n } else {\n registry[key] = new shared.Computation(\n this,\n getComputationSignature(this.root.ractive, key, computed),\n key\n );\n }\n\n return registry[key];\n }\n\n createBranch(key) {\n const branch = isNumeric(key) ? [] : {};\n this.applyValue(branch, false);\n\n return branch;\n }\n\n get(shouldCapture, opts) {\n if (this._link) return this._link.get(shouldCapture, opts);\n if (shouldCapture) capture(this);\n // if capturing, this value needs to be unwrapped because it's for external use\n if (opts && opts.virtual) return this.getVirtual(false);\n return maybeBind(\n this,\n (opts && 'unwrap' in opts ? opts.unwrap !== false : shouldCapture) && this.wrapper\n ? this.wrapperValue\n : this.value,\n !opts || opts.shouldBind !== false\n );\n }\n\n joinKey(key, opts) {\n if (this._link) {\n if (opts && opts.lastLink !== false && (isUndefined(key) || key === '')) return this;\n return this._link.joinKey(key);\n }\n\n if (isUndefined(key) || key === '') return this;\n\n let child;\n if (hasOwn(this.childByKey, key)) child = this.childByKey[key];\n else child = this.computed && this.computed[key];\n\n if (!child) {\n let computed;\n if (this.isRoot && this.ractive && (computed = this.ractive.computed[key])) {\n child = this.compute(key, computed);\n } else if (!this.isRoot && this.root.ractive) {\n const registry = this.root.ractive.computed;\n for (const k in registry) {\n computed = registry[k];\n if (computed.pattern && computed.pattern.test(this.getKeypath() + '.' + key)) {\n child = this.compute(key, computed);\n }\n }\n }\n }\n\n if (!child) {\n child = new Model(this, key);\n this.children.push(child);\n this.childByKey[key] = child;\n\n if (key === 'data') {\n const val = this.retrieve();\n if (val && val.viewmodel && val.viewmodel.isRoot) {\n child.link(val.viewmodel, 'data');\n this.dataModel = val;\n }\n }\n }\n\n if (child._link && (!opts || opts.lastLink !== false)) return child._link;\n\n return child;\n }\n\n mark(force) {\n if (this._link) return this._link.mark(force);\n\n const old = this.value;\n const value = this.retrieve();\n\n if (this.dataModel || (value && value.viewmodel && value.viewmodel.isRoot)) {\n checkDataLink(this, value);\n }\n\n if (force || !isEqual(value, old)) {\n this.value = value;\n if (this.boundValue) this.boundValue = null;\n\n // make sure the wrapper stays in sync\n if (old !== value || this.rewrap) {\n if (this.wrapper) this.newWrapperValue = value;\n this.adapt();\n }\n\n // keep track of array stuff\n if (isArray(value)) {\n this.length = value.length;\n this.isArray = true;\n } else {\n this.isArray = false;\n }\n\n this.children.forEach(force ? markForce : mark);\n this.links.forEach(marked);\n\n this.deps.forEach(handleChange);\n }\n }\n\n merge(array, comparator) {\n const newIndices = buildNewIndices(\n this.value === array ? recreateArray(this) : this.value,\n array,\n comparator\n );\n this.parent.value[this.key] = array;\n this.shuffle(newIndices, true);\n }\n\n retrieve() {\n return this.parent.value ? this.parent.value[this.key] : undefined;\n }\n\n set(value) {\n if (this.ticker) this.ticker.stop();\n this.applyValue(value);\n }\n\n shuffle(newIndices, unsafe) {\n shuffle(this, newIndices, false, unsafe);\n }\n\n source() {\n return this;\n }\n\n teardown() {\n if (this._link) {\n this._link.teardown();\n this._link = null;\n }\n this.children.forEach(teardown);\n if (this.wrapper) this.wrapper.teardown();\n if (this.computed) keys(this.computed).forEach(k => this.computed[k].teardown());\n }\n}\n\nfunction recreateArray(model) {\n const array = [];\n\n for (let i = 0; i < model.length; i++) {\n array[i] = (model.childByKey[i] || {}).value;\n }\n\n return array;\n}\n","/* global global */\nimport Model from '../Model';\nimport { base } from 'config/environment';\n\nexport const data = {};\n\nexport class SharedModel extends Model {\n constructor(value, name, ractive) {\n super(null, `@${name}`);\n this.key = `@${name}`;\n this.value = value;\n this.isRoot = true;\n this.root = this;\n this.adaptors = [];\n this.ractive = ractive;\n }\n\n getKeypath() {\n return this.key;\n }\n\n retrieve() {\n return this.value;\n }\n}\n\nexport default new SharedModel(data, 'shared');\n\nexport const GlobalModel = new SharedModel(base, 'global');\n","import noop from 'utils/noop';\nimport { assign, create } from 'utils/object';\n\nexport const extern = {};\n\nexport default function getRactiveContext(ractive, ...assigns) {\n const fragment =\n ractive.fragment ||\n ractive._fakeFragment ||\n (ractive._fakeFragment = new FakeFragment(ractive));\n return fragment.getContext.apply(fragment, assigns);\n}\n\nexport function getContext(...assigns) {\n if (!this.ctx) this.ctx = new extern.Context(this);\n assigns.unshift(create(this.ctx));\n return assign.apply(null, assigns);\n}\n\nexport class FakeFragment {\n constructor(ractive) {\n this.ractive = ractive;\n }\n\n findContext() {\n return this.ractive.viewmodel;\n }\n}\nconst proto = FakeFragment.prototype;\nproto.getContext = getContext;\nproto.find = proto.findComponent = proto.findAll = proto.findAllComponents = noop;\n\nexport function findParentWithContext(fragment) {\n let frag = fragment;\n while (frag && !frag.context) frag = frag.parent;\n if (!frag) return fragment && fragment.ractive.fragment;\n else return frag;\n}\n","import {\n isArray,\n isDate,\n isObject,\n isObjectType,\n isFunction,\n isString,\n isUndefined\n} from 'utils/is';\nimport { warnIfDebug } from 'utils/log';\nimport resolveReference from 'src/view/resolvers/resolveReference';\nimport runloop from '../global/runloop';\nimport { splitKeypath } from './keypaths';\nimport { FakeFragment } from './getRactiveContext';\nimport { hasOwn } from 'utils/object';\n\nexport let keep = false;\n\nexport function set(pairs, options) {\n const k = keep;\n\n const deep = options && options.deep;\n const shuffle = options && options.shuffle;\n const promise = runloop.start();\n if (options && 'keep' in options) keep = options.keep;\n\n let i = pairs.length;\n while (i--) {\n const model = pairs[i][0];\n const value = pairs[i][1];\n const keypath = pairs[i][2];\n\n if (!model) {\n runloop.end();\n throw new Error(`Failed to set invalid keypath '${keypath}'`);\n }\n\n if (deep) deepSet(model, value);\n else if (shuffle) {\n let array = value;\n const target = model.get();\n // shuffle target array with itself\n if (!array) array = target;\n\n // if there's not an array there yet, go ahead and set\n if (isUndefined(target)) {\n model.set(array);\n } else {\n if (!isArray(target) || !isArray(array)) {\n runloop.end();\n throw new Error('You cannot merge an array with a non-array');\n }\n\n const comparator = getComparator(shuffle);\n model.merge(array, comparator);\n }\n } else model.set(value);\n }\n\n runloop.end();\n\n keep = k;\n\n if (pairs.length === 1) return promise.then(() => pairs[0][1]);\n else return promise;\n}\n\nconst star = /\\*/;\nexport function gather(ractive, keypath, base, isolated) {\n if (!base && (keypath[0] === '.' || keypath[1] === '^')) {\n warnIfDebug(\n `Attempted to set a relative keypath from a non-relative context. You can use a context object to set relative keypaths.`\n );\n return [];\n }\n\n const keys = splitKeypath(keypath);\n const model = base || ractive.viewmodel;\n\n if (star.test(keypath)) {\n return model.findMatches(keys);\n } else {\n if (model === ractive.viewmodel) {\n // allow implicit mappings\n if (\n ractive.component &&\n !ractive.isolated &&\n !model.has(keys[0]) &&\n keypath[0] !== '@' &&\n keypath[0] &&\n !isolated\n ) {\n return [resolveReference(ractive.fragment || new FakeFragment(ractive), keypath)];\n } else {\n return [model.joinAll(keys)];\n }\n } else {\n return [model.joinAll(keys)];\n }\n }\n}\n\nexport function build(ractive, keypath, value, isolated) {\n const sets = [];\n\n // set multiple keypaths in one go\n if (isObject(keypath)) {\n for (const k in keypath) {\n if (hasOwn(keypath, k)) {\n sets.push.apply(sets, gather(ractive, k, null, isolated).map(m => [m, keypath[k], k]));\n }\n }\n } else {\n // set a single keypath\n sets.push.apply(sets, gather(ractive, keypath, null, isolated).map(m => [m, value, keypath]));\n }\n\n return sets;\n}\n\nconst deepOpts = { virtual: false };\nfunction deepSet(model, value) {\n const dest = model.get(false, deepOpts);\n\n // if dest doesn't exist, just set it\n if (dest == null || !isObjectType(value) || isDate(value)) return model.set(value);\n if (!isObjectType(dest)) return model.set(value);\n\n for (const k in value) {\n if (hasOwn(value, k)) {\n deepSet(model.joinKey(k), value[k]);\n }\n }\n}\n\nconst comparators = {};\nfunction getComparator(option) {\n if (option === true) return null; // use existing arrays\n if (isFunction(option)) return option;\n\n if (isString(option)) {\n return comparators[option] || (comparators[option] = thing => thing[option]);\n }\n\n throw new Error('If supplied, options.compare must be a string, function, or true'); // TODO link to docs\n}\n","import { isNumeric, isString } from 'utils/is';\nimport { build, set } from 'shared/set';\n\nconst errorMessage = 'Cannot add to a non-numeric value';\n\nexport default function add(ractive, keypath, d, options) {\n if (!isString(keypath) || !isNumeric(d)) {\n throw new Error('Bad arguments');\n }\n\n const sets = build(ractive, keypath, d, options && options.isolated);\n\n return set(\n sets.map(pair => {\n const [model, add] = pair;\n const value = model.get();\n if (!isNumeric(add) || !isNumeric(value)) throw new Error(errorMessage);\n return [model, value + add];\n })\n );\n}\n","import runloop from 'src/global/runloop';\nimport easing from 'src/Ractive/static/easing';\nimport interpolate from 'shared/interpolate';\nimport { isEqual, isFunction, isObjectType } from 'utils/is';\nimport noop from 'utils/noop';\nimport { splitKeypath } from 'shared/keypaths';\nimport { defineProperty, keys as objectKeys } from 'utils/object';\n\nfunction immediate(value) {\n const result = Promise.resolve(value);\n defineProperty(result, 'stop', { value: noop });\n return result;\n}\n\nconst linear = easing.linear;\n\nfunction getOptions(options, instance) {\n options = options || {};\n\n let easing;\n if (options.easing) {\n easing = isFunction(options.easing) ? options.easing : instance.easing[options.easing];\n }\n\n return {\n easing: easing || linear,\n duration: 'duration' in options ? options.duration : 400,\n complete: options.complete || noop,\n step: options.step || noop,\n interpolator: options.interpolator\n };\n}\n\nexport function animate(ractive, model, to, options) {\n options = getOptions(options, ractive);\n const from = model.get();\n\n // don't bother animating values that stay the same\n if (isEqual(from, to)) {\n options.complete(options.to);\n return immediate(to);\n }\n\n const interpolator = interpolate(from, to, ractive, options.interpolator);\n\n // if we can't interpolate the value, set it immediately\n if (!interpolator) {\n runloop.start();\n model.set(to);\n runloop.end();\n\n return immediate(to);\n }\n\n return model.animate(from, to, options, interpolator);\n}\n\nexport default function Ractive$animate(keypath, to, options) {\n if (isObjectType(keypath)) {\n const keys = objectKeys(keypath);\n\n throw new Error(`ractive.animate(...) no longer supports objects. Instead of ractive.animate({\n ${keys.map(key => `'${key}': ${keypath[key]}`).join('\\n ')}\n}, {...}), do\n\n${keys.map(key => `ractive.animate('${key}', ${keypath[key]}, {...});`).join('\\n')}\n`);\n }\n\n return animate(this, this.viewmodel.joinAll(splitKeypath(keypath)), to, options);\n}\n","import { enqueue, dequeue } from './eventStack';\n\nconst initStars = {};\nconst bubbleStars = {};\n\n// cartesian product of name parts and stars\n// adjusted appropriately for special cases\nfunction variants(name, initial) {\n const map = initial ? initStars : bubbleStars;\n if (map[name]) return map[name];\n\n const parts = name.split('.');\n const result = [];\n let base = false;\n\n // initial events the implicit namespace of 'this'\n if (initial) {\n parts.unshift('this');\n base = true;\n }\n\n // use max - 1 bits as a bitmap to pick a part or a *\n // need to skip the full star case if the namespace is synthetic\n const max = Math.pow(2, parts.length) - (initial ? 1 : 0);\n for (let i = 0; i < max; i++) {\n const join = [];\n for (let j = 0; j < parts.length; j++) {\n join.push(1 & (i >> j) ? '*' : parts[j]);\n }\n result.unshift(join.join('.'));\n }\n\n if (base) {\n // include non-this-namespaced versions\n if (parts.length > 2) {\n result.push.apply(result, variants(name, false));\n } else {\n result.push('*');\n result.push(name);\n }\n }\n\n map[name] = result;\n return result;\n}\n\nexport default function fireEvent(ractive, eventName, context, args = []) {\n if (!eventName) {\n return;\n }\n\n context.name = eventName;\n args.unshift(context);\n\n const eventNames = ractive._nsSubs ? variants(eventName, true) : ['*', eventName];\n\n return fireEventAs(ractive, eventNames, context, args, true);\n}\n\nfunction fireEventAs(ractive, eventNames, context, args, initialFire = false) {\n let bubble = true;\n\n if (initialFire || ractive._nsSubs) {\n enqueue(ractive, context);\n\n let i = eventNames.length;\n while (i--) {\n if (eventNames[i] in ractive._subs) {\n bubble = notifySubscribers(ractive, ractive._subs[eventNames[i]], context, args) && bubble;\n }\n }\n\n dequeue(ractive);\n }\n\n if (ractive.parent && bubble) {\n if (initialFire && ractive.component) {\n const fullName = ractive.component.name + '.' + eventNames[eventNames.length - 1];\n eventNames = variants(fullName, false);\n\n if (context && !context.component) {\n context.component = ractive;\n }\n }\n\n bubble = fireEventAs(ractive.parent, eventNames, context, args);\n }\n\n return bubble;\n}\n\nfunction notifySubscribers(ractive, subscribers, context, args) {\n let originalEvent = null;\n let stopEvent = false;\n\n // subscribers can be modified inflight, e.g. \"once\" functionality\n // so we need to copy to make sure everyone gets called\n subscribers = subscribers.slice();\n\n for (let i = 0, len = subscribers.length; i < len; i += 1) {\n if (!subscribers[i].off && subscribers[i].handler.apply(ractive, args) === false) {\n stopEvent = true;\n }\n }\n\n if (context && stopEvent && (originalEvent = context.event)) {\n originalEvent.preventDefault && originalEvent.preventDefault();\n originalEvent.stopPropagation && originalEvent.stopPropagation();\n }\n\n return !stopEvent;\n}\n","import fireEvent from './fireEvent';\nimport getRactiveContext from '../shared/getRactiveContext';\n\nexport class Hook {\n constructor(event) {\n this.event = event;\n this.method = 'on' + event;\n }\n\n fire(ractive, arg) {\n const context = getRactiveContext(ractive);\n const method = this.method;\n\n if (ractive[method]) {\n arg ? ractive[method](context, arg) : ractive[method](context);\n }\n\n fireEvent(ractive, this.event, context, arg ? [arg, ractive] : [ractive]);\n }\n}\n\nfunction getChildQueue(queue, ractive) {\n return queue[ractive._guid] || (queue[ractive._guid] = []);\n}\n\nfunction fire(hookQueue, ractive) {\n const childQueue = getChildQueue(hookQueue.queue, ractive);\n\n hookQueue.hook.fire(ractive);\n\n // queue is \"live\" because components can end up being\n // added while hooks fire on parents that modify data values.\n while (childQueue.length) {\n fire(hookQueue, childQueue.shift());\n }\n\n delete hookQueue.queue[ractive._guid];\n}\n\nexport class HookQueue {\n constructor(event) {\n this.hook = new Hook(event);\n this.inProcess = {};\n this.queue = {};\n }\n\n begin(ractive) {\n this.inProcess[ractive._guid] = true;\n }\n\n end(ractive) {\n const parent = ractive.parent;\n\n // If this is *isn't* a child of a component that's in process,\n // it should call methods or fire at this point\n if (!parent || !this.inProcess[parent._guid]) {\n fire(this, ractive);\n } else {\n // elsewise, handoff to parent to fire when ready\n getChildQueue(this.queue, parent).push(ractive);\n }\n\n delete this.inProcess[ractive._guid];\n }\n}\n\nconst hooks = {};\n[\n 'construct',\n 'config',\n 'attachchild',\n 'detach',\n 'detachchild',\n 'insert',\n 'complete',\n 'reset',\n 'render',\n 'unrendering',\n 'unrender',\n 'teardown',\n 'destruct',\n 'update'\n].forEach(hook => {\n hooks[hook] = new Hook(hook);\n});\nhooks.init = new HookQueue('init');\n\nexport default hooks;\n","import { splitKeypath } from 'shared/keypaths';\nimport runloop from 'src/global/runloop';\nimport getNewIndices from 'shared/getNewIndices';\nimport { isArray, isUndefined } from 'utils/is';\n\nconst arrayProto = Array.prototype;\n\nexport default function(methodName) {\n function path(keypath, ...args) {\n return model(this.viewmodel.joinAll(splitKeypath(keypath)), args);\n }\n\n function model(mdl, args) {\n let array = mdl.get();\n\n if (!isArray(array)) {\n if (isUndefined(array)) {\n array = [];\n const result = arrayProto[methodName].apply(array, args);\n const promise = runloop.start().then(() => result);\n mdl.set(array);\n runloop.end();\n return promise;\n } else {\n throw new Error(\n `shuffle array method ${methodName} called on non-array at ${mdl.getKeypath()}`\n );\n }\n }\n\n const newIndices = getNewIndices(array.length, methodName, args);\n const result = arrayProto[methodName].apply(array, args);\n\n const promise = runloop.start().then(() => result);\n promise.result = result;\n\n if (newIndices) {\n if (mdl.shuffle) {\n mdl.shuffle(newIndices);\n } else {\n // it's a computation, which don't have a shuffle, so just invalidate\n mdl.mark();\n }\n } else {\n mdl.set(result);\n }\n\n runloop.end();\n\n return promise;\n }\n\n return { path, model };\n}\n","import hooks from 'src/events/Hook';\nimport { removeFromArray } from 'utils/array';\nimport { cancel } from 'shared/methodCallers';\nimport { warnIfDebug } from 'utils/log';\n\n// Teardown. This goes through the root fragment and all its children, removing observers\n// and generally cleaning up after itself\n\nexport default function Ractive$teardown() {\n if (this.torndown) {\n warnIfDebug('ractive.teardown() was called on a Ractive instance that was already torn down');\n return Promise.resolve();\n }\n\n this.shouldDestroy = true;\n return teardown(this, () => (this.fragment.rendered ? this.unrender() : Promise.resolve()));\n}\n\nexport function teardown(instance, getPromise) {\n instance.torndown = true;\n instance.fragment.unbind();\n instance._observers.slice().forEach(cancel);\n\n if (instance.el && instance.el.__ractive_instances__) {\n removeFromArray(instance.el.__ractive_instances__, instance);\n }\n\n const promise = getPromise();\n\n hooks.teardown.fire(instance);\n\n promise.then(() => {\n hooks.destruct.fire(instance);\n instance.viewmodel.teardown();\n });\n\n return promise;\n}\n","import { create, toPairs } from 'utils/object';\nimport { isFunction, isObjectType } from 'utils/is';\n\nexport default function subscribe(instance, options, type) {\n const subs = (instance.constructor[`_${type}`] || []).concat(toPairs(options[type] || []));\n const single = type === 'on' ? 'once' : `${type}Once`;\n\n subs.forEach(([target, config]) => {\n if (isFunction(config)) {\n instance[type](target, config);\n } else if (isObjectType(config) && isFunction(config.handler)) {\n instance[config.once ? single : type](target, config.handler, create(config));\n }\n });\n}\n","import getFunction from 'shared/getFunction';\nimport ExpressionProxy from 'src/view/resolvers/ExpressionProxy';\nimport resolveReference from '../../resolvers/resolveReference';\n\nexport function setupArgsFn(item, template, fragment, opts = {}) {\n if (template && template.f && template.f.s) {\n if (opts.register) {\n item.model = new ExpressionProxy(fragment, template.f);\n item.model.register(item);\n } else {\n item.fn = getFunction(template.f.s, template.f.r.length);\n }\n }\n}\n\nexport function resolveArgs(item, template, fragment, opts = {}) {\n return template.f.r.map((ref, i) => {\n let model;\n\n if (opts.specialRef && (model = opts.specialRef(ref, i))) return model;\n\n model = resolveReference(fragment, ref);\n\n return model;\n });\n}\n\nexport function teardownArgsFn(item) {\n if (item.model) item.model.unregister(item);\n}\n","// This is the handler for DOM events that would lead to a change in the model\n// (i.e. change, sometimes, input, and occasionally click and keyup)\nexport default function handleDomEvent() {\n this._ractive.binding.handleChange();\n}\n","import { toArray } from './array';\n\nexport default function getSelectedOptions(select) {\n /* istanbul ignore next */\n return select.selectedOptions\n ? toArray(select.selectedOptions)\n : select.options\n ? toArray(select.options).filter(option => option.selected)\n : [];\n}\n","import { INTERPOLATOR, TRIPLE } from 'config/types';\nimport { warnIfDebug } from 'utils/log';\nimport CheckboxBinding from './CheckboxBinding';\nimport CheckboxNameBinding from './CheckboxNameBinding';\nimport ContentEditableBinding from './ContentEditableBinding';\nimport FileBinding from './FileBinding';\nimport GenericBinding from './GenericBinding';\nimport MultipleSelectBinding from './MultipleSelectBinding';\nimport NumericBinding from './NumericBinding';\nimport RadioBinding from './RadioBinding';\nimport RadioNameBinding from './RadioNameBinding';\nimport SingleSelectBinding from './SingleSelectBinding';\n\nexport function isBindable(attribute) {\n // The fragment must be a single non-string fragment\n if (\n !attribute ||\n !attribute.template.f ||\n attribute.template.f.length !== 1 ||\n attribute.template.f[0].s\n )\n return false;\n\n // A binding is an interpolator `{{ }}`, yey.\n if (attribute.template.f[0].t === INTERPOLATOR) return true;\n\n // The above is probably the only true case. For the rest, show an appropriate\n // warning before returning false.\n\n // You can't bind a triple curly. HTML values on an attribute makes no sense.\n if (attribute.template.f[0].t === TRIPLE)\n warnIfDebug('It is not possible create a binding using a triple mustache.');\n\n return false;\n}\n\nexport default function selectBinding(element) {\n const name = element.name;\n const attributes = element.attributeByName;\n if (name !== 'input' && name !== 'textarea' && name !== 'select' && !attributes.contenteditable)\n return;\n const isBindableByValue = isBindable(attributes.value);\n const isBindableByContentEditable = isBindable(attributes.contenteditable);\n const isContentEditable = element.getAttribute('contenteditable');\n\n // contenteditable\n // Bind if the contenteditable is true or a binding that may become true.\n if ((isContentEditable || isBindableByContentEditable) && isBindableByValue)\n return ContentEditableBinding;\n\n // <input>\n if (name === 'input') {\n const type = element.getAttribute('type');\n\n if (type === 'radio') {\n const isBindableByName = isBindable(attributes.name);\n const isBindableByChecked = isBindable(attributes.checked);\n\n // For radios we can either bind the name or checked, but not both.\n // Name binding is handed instead.\n if (isBindableByName && isBindableByChecked) {\n warnIfDebug(\n 'A radio input can have two-way binding on its name attribute, or its checked attribute - not both',\n { ractive: element.root }\n );\n return RadioNameBinding;\n }\n\n if (isBindableByName) return RadioNameBinding;\n\n if (isBindableByChecked) return RadioBinding;\n\n // Dead end. Unknown binding on radio input.\n return null;\n }\n\n if (type === 'checkbox') {\n const isBindableByName = isBindable(attributes.name);\n const isBindableByChecked = isBindable(attributes.checked);\n\n // A checkbox with bindings for both name and checked. Checked treated as\n // the checkbox value, name is treated as a regular binding.\n //\n // See https://github.com/ractivejs/ractive/issues/1749\n if (isBindableByName && isBindableByChecked) return CheckboxBinding;\n\n if (isBindableByName) return CheckboxNameBinding;\n\n if (isBindableByChecked) return CheckboxBinding;\n\n // Dead end. Unknown binding on checkbox input.\n return null;\n }\n\n if (type === 'file' && isBindableByValue) return FileBinding;\n\n if (type === 'number' && isBindableByValue) return NumericBinding;\n\n if (type === 'range' && isBindableByValue) return NumericBinding;\n\n // Some input of unknown type (browser usually falls back to text).\n if (isBindableByValue) return GenericBinding;\n\n // Dead end. Some unknown input and an unbindable.\n return null;\n }\n\n // <select>\n if (name === 'select' && isBindableByValue) {\n return element.getAttribute('multiple') ? MultipleSelectBinding : SingleSelectBinding;\n }\n\n // <textarea>\n if (name === 'textarea' && isBindableByValue) return GenericBinding;\n\n // Dead end. Some unbindable element.\n return null;\n}\n","import { doc } from 'config/environment';\n\nexport default function progressiveText(item, target, occupants, text) {\n if (occupants) {\n let n = occupants[0];\n if (n && n.nodeType === 3) {\n const idx = n.nodeValue.indexOf(text);\n occupants.shift();\n\n if (idx === 0) {\n if (n.nodeValue.length !== text.length) {\n occupants.unshift(n.splitText(text.length));\n }\n } else {\n n.nodeValue = text;\n }\n } else {\n n = item.node = doc.createTextNode(text);\n if (occupants[0]) {\n target.insertBefore(n, occupants[0]);\n } else {\n target.appendChild(n);\n }\n }\n\n item.node = n;\n } else {\n if (!item.node) item.node = doc.createTextNode(text);\n target.appendChild(item.node);\n }\n}\n","import resolveReference from './resolveReference';\nimport ExpressionProxy from './ExpressionProxy';\nimport ReferenceExpressionProxy from './ReferenceExpressionProxy';\n\nexport default function resolve(fragment, template) {\n if (template.r) {\n return resolveReference(fragment, template.r);\n } else if (template.x) {\n return new ExpressionProxy(fragment, template.x);\n } else if (template.rx) {\n return new ReferenceExpressionProxy(fragment, template.rx);\n }\n}\n","import { noRegistryFunctionReturn } from 'config/errors';\nimport { warnIfDebug } from 'utils/log';\nimport { fillGaps, hasOwn } from 'utils/object';\nimport parser from 'src/Ractive/config/runtime-parser';\nimport { findInstance } from 'shared/registry';\nimport { isArray, isFunction } from 'utils/is';\nimport { addFunctions } from 'shared/getFunction';\n\nexport default function getPartialTemplate(ractive, name, up) {\n // If the partial in instance or view heirarchy instances, great\n let partial = getPartialFromRegistry(ractive, name, up || {});\n if (partial) return partial;\n\n // Does it exist on the page as a script tag?\n partial = parser.fromId(name, { noThrow: true });\n if (partial) {\n // parse and register to this ractive instance\n const parsed = parser.parseFor(partial, ractive);\n\n // register extra partials on the ractive instance if they don't already exist\n if (parsed.p) fillGaps(ractive.partials, parsed.p);\n\n // register (and return main partial if there are others in the template)\n return (ractive.partials[name] = parsed.t);\n }\n}\n\nfunction getPartialFromRegistry(ractive, name, up) {\n // if there was an instance up-hierarchy, cool\n let partial = findParentPartial(name, up.owner);\n if (partial) return partial;\n\n // find first instance in the ractive or view hierarchy that has this partial\n const instance = findInstance('partials', ractive, name);\n\n if (!instance) {\n return;\n }\n\n partial = instance.partials[name];\n\n // partial is a function?\n let fn;\n if (isFunction(partial)) {\n fn = partial;\n // super partial\n if (fn.styleSet) return fn;\n\n fn = partial.bind(instance);\n fn.isOwner = hasOwn(instance.partials, name);\n partial = fn.call(ractive, parser);\n }\n\n if (!partial && partial !== '') {\n warnIfDebug(noRegistryFunctionReturn, name, 'partial', 'partial', {\n ractive\n });\n return;\n }\n\n // If this was added manually to the registry,\n // but hasn't been parsed, parse it now\n if (!parser.isParsed(partial)) {\n // use the parseOptions of the ractive instance on which it was found\n const parsed = parser.parseFor(partial, instance);\n\n // Partials cannot contain nested partials!\n // TODO add a test for this\n if (parsed.p) {\n warnIfDebug('Partials ({{>%s}}) cannot contain nested inline partials', name, { ractive });\n }\n\n // if fn, use instance to store result, otherwise needs to go\n // in the correct point in prototype chain on instance or constructor\n const target = fn ? instance : findOwner(instance, name);\n\n // may be a template with partials, which need to be registered and main template extracted\n target.partials[name] = partial = parsed.t;\n }\n\n // store for reset\n if (fn) partial._fn = fn;\n\n // if the partial is a pre-parsed template object, import any expressions and update the registry\n if (partial.v) {\n addFunctions(partial);\n return (instance.partials[name] = partial.t);\n } else {\n return partial;\n }\n}\n\nfunction findOwner(ractive, key) {\n return hasOwn(ractive.partials, key) ? ractive : findConstructor(ractive.constructor, key);\n}\n\nfunction findConstructor(constructor, key) {\n if (!constructor) {\n return;\n }\n return hasOwn(constructor.partials, key) ? constructor : findConstructor(constructor.Parent, key);\n}\n\nfunction findParentPartial(name, parent) {\n if (parent) {\n if (\n parent.template &&\n parent.template.p &&\n !isArray(parent.template.p) &&\n hasOwn(parent.template.p, name)\n ) {\n return parent.template.p[name];\n } else if (parent.up && parent.up.owner) {\n return findParentPartial(name, parent.up.owner);\n }\n }\n}\n","import { noRegistryFunctionReturn } from 'config/errors';\nimport { warnIfDebug } from 'utils/log';\nimport { findInstance } from 'shared/registry';\nimport { hasOwn } from 'utils/object';\nimport { isFunction, isString } from 'utils/is';\n\n// finds the component constructor in the registry or view hierarchy registries\nexport default function getComponentConstructor(ractive, name) {\n const instance = findInstance('components', ractive, name);\n let Component;\n\n if (instance) {\n Component = instance.components[name];\n\n if (Component && !Component.isInstance) {\n if (Component.default && Component.default.isInstance) Component = Component.default;\n else if (!Component.then && isFunction(Component)) {\n // function option, execute and store for reset\n const fn = Component.bind(instance);\n fn.isOwner = hasOwn(instance.components, name);\n Component = fn();\n\n if (!Component) {\n warnIfDebug(noRegistryFunctionReturn, name, 'component', 'component', {\n ractive\n });\n return;\n }\n\n if (isString(Component)) {\n // allow string lookup\n Component = getComponentConstructor(ractive, Component);\n }\n\n Component._fn = fn;\n instance.components[name] = Component;\n }\n }\n }\n\n return Component;\n}\n","import Partial from './Partial';\nimport { ELEMENT } from 'config/types';\nimport { assign } from 'utils/object';\n\nexport default function asyncProxy(promise, options) {\n const partials = options.template.p || {};\n const name = options.template.e;\n\n const opts = assign({}, options, {\n template: { t: ELEMENT, e: name },\n macro(handle) {\n handle.setTemplate(partials['async-loading'] || []);\n promise.then(\n cmp => {\n options.up.ractive.components[name] = cmp;\n if (partials['async-loaded']) {\n handle.partials.component = [options.template];\n handle.setTemplate(partials['async-loaded']);\n } else {\n handle.setTemplate([options.template]);\n }\n },\n err => {\n if (partials['async-failed']) {\n handle.aliasLocal('error', 'error');\n handle.set('@local.error', err);\n handle.setTemplate(partials['async-failed']);\n } else {\n handle.setTemplate([]);\n }\n }\n );\n }\n });\n return new Partial(opts);\n}\n","import { ATTRIBUTE, CATCH, ELEMENT, ELSE, INTERPOLATOR, SECTION, THEN } from 'src/config/types';\nimport Partial from './Partial';\nimport { assign } from 'utils/object';\nimport { isFunction, isUndefined } from 'utils/is';\n\nfunction extract(tpl, type, name) {\n const p = tpl.f.find(s => s.t === type);\n if (p) {\n if (p.n)\n return [\n {\n t: 19,\n n: 54,\n f: p.f || [],\n z: [{ n: p.n, x: { r: `__await.${name}` } }]\n }\n ];\n else return p.f || [];\n } else return [];\n}\n\nexport default function Await(options) {\n const tpl = options.template;\n\n const success = extract(tpl, THEN, 'value');\n const error = extract(tpl, CATCH, 'error');\n const pending = extract(tpl, SECTION);\n const undef = extract(tpl, ELSE);\n\n const opts = assign({}, options, {\n template: {\n t: ELEMENT,\n m: [\n {\n t: ATTRIBUTE,\n n: 'for',\n f: [{ t: INTERPOLATOR, r: tpl.r, rx: tpl.rx, x: tpl.x }]\n }\n ]\n },\n macro(handle, attrs) {\n handle.aliasLocal('__await');\n\n function update(attrs) {\n if (attrs.for && isFunction(attrs.for.then)) {\n handle.setTemplate(pending);\n\n attrs.for.then(\n v => {\n handle.set('@local.value', v);\n handle.setTemplate(success);\n },\n e => {\n handle.set('@local.error', e);\n handle.setTemplate(error);\n }\n );\n } else if (isUndefined(attrs.for)) {\n handle.setTemplate(undef);\n } else {\n handle.set('@local.value', attrs.for);\n handle.setTemplate(success);\n }\n }\n\n update(attrs);\n\n return {\n update\n };\n }\n });\n\n opts.macro.attributes = ['for'];\n\n return new Partial(opts);\n}\n","import { TEXT } from 'config/types';\n\n// TODO all this code needs to die\nexport default function processItems(items, values, guid, counter = 0) {\n return items\n .map(item => {\n if (item.type === TEXT) {\n return item.template;\n }\n\n if (item.fragment) {\n if (item.fragment.iterations) {\n return item.fragment.iterations\n .map(fragment => {\n return processItems(fragment.items, values, guid, counter);\n })\n .join('');\n } else {\n return processItems(item.fragment.items, values, guid, counter);\n }\n }\n\n const placeholderId = `${guid}-${counter++}`;\n const model = item.model || item.newModel;\n\n values[placeholderId] = model\n ? model.wrapper\n ? model.wrapperValue\n : model.get()\n : undefined;\n\n return '${' + placeholderId + '}';\n })\n .join('');\n}\n","import { logIfDebug, warnIfDebug, warnOnceIfDebug } from 'utils/log';\nimport { getElement } from 'utils/dom';\nimport { isArray } from 'utils/is';\nimport config from './config/config';\nimport Fragment from 'src/view/Fragment';\nimport hooks from 'src/events/Hook';\nimport Ractive from '../Ractive';\nimport subscribe from './helpers/subscribe';\n\nexport default function initialise(ractive, userOptions, options) {\n // initialize settable computeds\n const computed = ractive.viewmodel.computed;\n if (computed) {\n for (const k in computed) {\n if (k in ractive.viewmodel.value && computed[k] && !computed[k].isReadonly) {\n computed[k].set(ractive.viewmodel.value[k]);\n }\n }\n }\n\n // init config from Parent and options\n config.init(ractive.constructor, ractive, userOptions);\n\n // call any passed in plugins\n if (isArray(userOptions.use))\n ractive.use.apply(ractive, userOptions.use.filter(p => !p.construct));\n\n hooks.config.fire(ractive);\n\n hooks.init.begin(ractive);\n\n const fragment = (ractive.fragment = createFragment(ractive, options));\n if (fragment) fragment.bind(ractive.viewmodel);\n\n hooks.init.end(ractive);\n\n // general config done, set up observers\n subscribe(ractive, userOptions, 'observe');\n\n if (fragment) {\n // render automatically ( if `el` is specified )\n const el = (ractive.el = ractive.target = getElement(ractive.el || ractive.target));\n if (el && !ractive.component) {\n const promise = ractive.render(el, ractive.append);\n\n if (Ractive.DEBUG_PROMISES) {\n promise.catch(err => {\n warnOnceIfDebug(\n 'Promise debugging is enabled, to help solve errors that happen asynchronously. Some browsers will log unhandled promise rejections, in which case you can safely disable promise debugging:\\n Ractive.DEBUG_PROMISES = false;'\n );\n warnIfDebug('An error happened during rendering', { ractive });\n logIfDebug(err);\n\n throw err;\n });\n }\n }\n }\n}\n\nexport function createFragment(ractive, options = {}) {\n if (ractive.template) {\n const cssIds = [].concat(ractive.constructor._cssIds || [], options.cssIds || []);\n\n return new Fragment({\n owner: ractive,\n template: ractive.template,\n cssIds\n });\n }\n}\n","import { doc } from 'config/environment';\nimport { applyCSS } from 'src/global/css';\nimport hooks from 'src/events/Hook';\nimport { getElement } from 'utils/dom';\nimport runloop from 'src/global/runloop';\nimport { createFragment } from './initialise';\n\nexport default function render(ractive, target, anchor, occupants) {\n // set a flag to let any transitions know that this instance is currently rendering\n ractive.rendering = true;\n\n const promise = runloop.start();\n runloop.scheduleTask(() => hooks.render.fire(ractive), true);\n\n if (ractive.fragment.rendered) {\n throw new Error(\n 'You cannot call ractive.render() on an already rendered instance! Call ractive.unrender() first'\n );\n }\n\n if (ractive.destroyed) {\n ractive.destroyed = false;\n ractive.fragment = createFragment(ractive).bind(ractive.viewmodel);\n }\n\n anchor = getElement(anchor) || ractive.anchor;\n\n ractive.el = ractive.target = target;\n ractive.anchor = anchor;\n\n // ensure encapsulated CSS is up-to-date\n if (ractive.cssId) applyCSS();\n\n if (target) {\n (target.__ractive_instances__ || (target.__ractive_instances__ = [])).push(ractive);\n\n if (anchor) {\n const docFrag = doc.createDocumentFragment();\n ractive.fragment.render(docFrag);\n target.insertBefore(docFrag, anchor);\n } else {\n ractive.fragment.render(target, occupants);\n }\n }\n\n runloop.end();\n ractive.rendering = false;\n\n return promise.then(() => {\n if (ractive.torndown) return;\n\n hooks.complete.fire(ractive);\n });\n}\n","import { getElement } from 'utils/dom';\nimport { toArray } from 'utils/array';\nimport { warnIfDebug } from 'utils/log';\nimport render from '../render';\nimport { teardown } from 'shared/methodCallers';\n\nexport default function Ractive$render(target, anchor) {\n if (this.torndown) {\n warnIfDebug('ractive.render() was called on a Ractive instance that was already torn down');\n return Promise.resolve();\n }\n\n target = getElement(target) || this.el;\n\n if (!this.append && target) {\n // Teardown any existing instances *before* trying to set up the new one -\n // avoids certain weird bugs\n const others = target.__ractive_instances__;\n if (others) others.forEach(teardown);\n\n // make sure we are the only occupants\n if (!this.enhance) {\n target.innerHTML = ''; // TODO is this quicker than removeChild? Initial research inconclusive\n }\n }\n\n const occupants = this.enhance ? toArray(target.childNodes) : null;\n const promise = render(this, target, anchor, occupants);\n\n if (occupants) {\n while (occupants.length) target.removeChild(occupants.pop());\n }\n\n return promise;\n}\n","import runloop from 'src/global/runloop';\nimport { PARTIAL, COMPONENT, ELEMENT } from 'config/types';\nimport { isArray } from 'utils/is';\nimport { handleChange } from 'shared/methodCallers';\n\nfunction collect(source, name, attr, dest) {\n source.forEach(item => {\n // queue to rerender if the item is a partial and the current name matches\n if (item.type === PARTIAL && (item.refName === name || item.name === name)) {\n item.inAttribute = attr;\n dest.push(item);\n return; // go no further\n }\n\n // if it has a fragment, process its items\n if (item.fragment) {\n collect(item.fragment.iterations || item.fragment.items, name, attr, dest);\n } else if (isArray(item.items)) {\n // or if it is itself a fragment, process its items\n collect(item.items, name, attr, dest);\n } else if (item.type === COMPONENT && item.instance) {\n // or if it is a component, step in and process its items\n // ...unless the partial is shadowed\n if (item.instance.partials[name]) return;\n collect(item.instance.fragment.items, name, attr, dest);\n }\n\n // if the item is an element, process its attributes too\n if (item.type === ELEMENT) {\n if (isArray(item.attributes)) {\n collect(item.attributes, name, true, dest);\n }\n }\n });\n}\n\nexport default function(name, partial) {\n const collection = [];\n collect(this.fragment.items, name, false, collection);\n\n const promise = runloop.start();\n\n this.partials[name] = partial;\n collection.forEach(handleChange);\n\n runloop.end();\n\n return promise;\n}\n","import { createDocumentFragment } from 'utils/dom';\nimport Fragment from 'src/view/Fragment';\nimport runloop from 'src/global/runloop';\nimport { default as templateConfigurator } from '../config/custom/template';\n\n// TODO should resetTemplate be asynchronous? i.e. should it be a case\n// of outro, update template, intro? I reckon probably not, since that\n// could be achieved with unrender-resetTemplate-render. Also, it should\n// conceptually be similar to resetPartial, which couldn't be async\n\nexport default function Ractive$resetTemplate(template) {\n templateConfigurator.init(null, this, { template });\n\n const transitionsEnabled = this.transitionsEnabled;\n this.transitionsEnabled = false;\n\n // Is this is a component, we need to set the `shouldDestroy`\n // flag, otherwise it will assume by default that a parent node\n // will be detached, and therefore it doesn't need to bother\n // detaching its own nodes\n const component = this.component;\n if (component) component.shouldDestroy = true;\n this.unrender();\n if (component) component.shouldDestroy = false;\n\n const promise = runloop.start();\n\n // remove existing fragment and create new one\n this.fragment.unbind().unrender(true);\n\n this.fragment = new Fragment({\n template: this.template,\n root: this,\n owner: this\n });\n\n const docFrag = createDocumentFragment();\n this.fragment.bind(this.viewmodel).render(docFrag);\n\n // if this is a component, its el may not be valid, so find a\n // target based on the component container\n if (component && !component.external) {\n this.fragment.findParentNode().insertBefore(docFrag, component.findNextNode());\n } else {\n this.el.insertBefore(docFrag, this.anchor);\n }\n\n runloop.end();\n\n this.transitionsEnabled = transitionsEnabled;\n\n return promise;\n}\n","import { build, set } from 'shared/set';\nimport { isObjectType } from 'utils/is';\n\nexport default function Ractive$set(keypath, value, options) {\n const ractive = this;\n\n const opts = isObjectType(keypath) ? value : options;\n\n return set(build(ractive, keypath, value, opts && opts.isolated), opts);\n}\n","import add from './shared/add';\nimport { isNumber, isObjectType } from 'utils/is';\n\nexport default function Ractive$subtract(keypath, d, options) {\n const num = isNumber(d) ? -d : -1;\n const opts = isObjectType(d) ? d : options;\n return add(this, keypath, num, opts);\n}\n","import { badArguments } from 'config/errors';\nimport { gather, set } from 'shared/set';\nimport { isString } from 'utils/is';\n\nexport default function Ractive$toggle(keypath, options) {\n if (!isString(keypath)) {\n throw new TypeError(badArguments);\n }\n\n return set(\n gather(this, keypath, null, options && options.isolated).map(m => [m, !m.get()]),\n options\n );\n}\n","import { getCSS } from 'src/global/css';\nimport { keys } from 'utils/object';\n\nexport default function Ractive$toCSS() {\n const cssIds = [this.cssId, ...this.findAllComponents().map(c => c.cssId)];\n const uniqueCssIds = keys(cssIds.reduce((ids, id) => ((ids[id] = true), ids), {}));\n return getCSS(uniqueCssIds);\n}\n","export default function Ractive$toHTML() {\n return this.fragment.toString(true);\n}\n","export default function toText() {\n return this.fragment.toString(false);\n}\n","import runloop from 'src/global/runloop';\nimport Transition from '../../view/items/element/Transition';\nimport { fatal } from 'utils/log';\nimport { isObject } from 'utils/is';\n\nexport default function Ractive$transition(name, node, params) {\n if (node instanceof HTMLElement) {\n // good to go\n } else if (isObject(node)) {\n // omitted, use event node\n params = node;\n }\n\n // if we allow query selector, then it won't work\n // simple params like \"fast\"\n\n // else if ( typeof node === 'string' ) {\n // \t// query selector\n // \tnode = this.find( node )\n // }\n\n node = node || this.event.node;\n\n if (!node || !node._ractive) {\n fatal(`No node was supplied for transition ${name}`);\n }\n\n params = params || {};\n const owner = node._ractive.proxy;\n const transition = new Transition({ owner, up: owner.up, name, params });\n transition.bind();\n\n const promise = runloop.start();\n runloop.registerTransition(transition);\n runloop.end();\n\n promise.then(() => transition.unbind());\n return promise;\n}\n","import { splitKeypath } from 'shared/keypaths';\nimport runloop from 'src/global/runloop';\n\nexport default function unlink(here) {\n const promise = runloop.start();\n this.viewmodel.joinAll(splitKeypath(here), { lastLink: false }).unlink();\n runloop.end();\n return promise;\n}\n","import hooks from 'src/events/Hook';\nimport { warnIfDebug } from 'utils/log';\nimport { removeFromArray } from 'utils/array';\nimport runloop from 'src/global/runloop';\n\nexport default function Ractive$unrender() {\n if (!this.fragment.rendered) {\n warnIfDebug('ractive.unrender() was called on a Ractive instance that was not rendered');\n return Promise.resolve();\n }\n\n this.unrendering = true;\n const promise = runloop.start();\n\n hooks.unrendering.fire(this);\n\n // If this is a component, and the component isn't marked for destruction,\n // don't detach nodes from the DOM unnecessarily\n const shouldDestroy =\n !this.component ||\n (this.component.anchor || {}).shouldDestroy ||\n this.component.shouldDestroy ||\n this.shouldDestroy;\n this.fragment.unrender(shouldDestroy);\n if (shouldDestroy) this.destroyed = true;\n\n removeFromArray(this.el.__ractive_instances__, this);\n\n hooks.unrender.fire(this);\n\n runloop.end();\n this.unrendering = false;\n\n return promise;\n}\n","import { splitKeypath } from 'shared/keypaths';\nimport runloop from 'src/global/runloop';\n\nexport default function Ractive$updateModel(keypath, cascade) {\n const promise = runloop.start();\n\n if (!keypath) {\n this.viewmodel.updateFromBindings(true);\n } else {\n this.viewmodel.joinAll(splitKeypath(keypath)).updateFromBindings(cascade !== false);\n }\n\n runloop.end();\n\n return promise;\n}\n","export default function use(...plugins) {\n plugins.forEach(p => {\n p({\n proto: this,\n Ractive: this.constructor.Ractive,\n instance: this\n });\n });\n return this;\n}\n","export default function isInstance(object) {\n return object && object instanceof this;\n}\n","import { splitKeypath } from 'shared/keypaths';\n\nexport default function styleGet(keypath, opts) {\n return this._cssModel.joinAll(splitKeypath(keypath)).get(true, opts);\n}\n","import { build, set } from '../../shared/set';\nimport SharedModel from '../../model/specials/SharedModel';\nimport { isObjectType } from 'utils/is';\n\nexport default function sharedSet(keypath, value, options) {\n const opts = isObjectType(keypath) ? value : options;\n const model = SharedModel;\n\n return set(build({ viewmodel: model }, keypath, value, true), opts);\n}\n","import SharedModel from '../../model/specials/SharedModel';\nimport { splitKeypath } from 'shared/keypaths';\n\nexport default function sharedGet(keypath, opts) {\n return SharedModel.joinAll(splitKeypath(keypath)).get(true, opts);\n}\n","import { isFunction } from 'utils/is';\n\nexport default function use(...plugins) {\n plugins.forEach(p => {\n isFunction(p) &&\n p({\n proto: this.prototype,\n Ractive: this.Ractive,\n instance: this\n });\n });\n return this;\n}\n","import styleGet from '../Ractive/static/styleGet';\nimport styleSet from '../Ractive/static/styleSet';\nimport CSSModel from 'src/model/specials/CSSModel';\nimport { assign, create, defineProperties, defineProperty } from 'utils/object';\nimport { isFunction } from 'utils/is';\n\nimport { initCSS } from 'src/Ractive/config/custom/css/css';\n\nexport default function macro(fn, opts) {\n if (!isFunction(fn)) throw new Error(`The macro must be a function`);\n\n assign(fn, opts);\n\n defineProperties(fn, {\n extensions: { value: [] },\n _cssIds: { value: [] },\n cssData: { value: assign(create(this.cssData), fn.cssData || {}) },\n\n styleGet: { value: styleGet.bind(fn) },\n styleSet: { value: styleSet.bind(fn) }\n });\n\n defineProperty(fn, '_cssModel', { value: new CSSModel(fn) });\n\n if (fn.css) initCSS(fn, fn, fn);\n\n this.extensions.push(fn);\n\n return fn;\n}\n","import { findInViewHierarchy } from 'shared/registry';\n\nexport function findPlugin(name, type, instance) {\n return findInViewHierarchy(type, instance, name);\n}\n","/* istanbul ignore if */\nif (!Object.assign) {\n Object.assign = function(target, ...sources) {\n if (target == null) throw new TypeError('Cannot convert undefined or null to object');\n\n const to = Object(target);\n const sourcesLength = sources.length;\n\n for (let index = 0; index < sourcesLength; index++) {\n const nextSource = sources[index];\n for (const nextKey in nextSource) {\n if (!Object.prototype.hasOwnProperty.call(nextSource, nextKey)) continue;\n to[nextKey] = nextSource[nextKey];\n }\n }\n\n return to;\n };\n}\n","export function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function fillGaps(target, ...sources) {\n for (let i = 0; i < sources.length; i++) {\n const source = sources[i];\n for (const key in source) {\n // Source can be a prototype-less object.\n if (key in target || !hasOwn(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nexport function toPairs(obj = {}) {\n const pairs = [];\n for (const key in obj) {\n // Source can be a prototype-less object.\n if (!hasOwn(obj, key)) continue;\n pairs.push([key, obj[key]]);\n }\n return pairs;\n}\n\nconst obj = Object;\n\nexport const assign = obj.assign;\n\nexport const create = obj.create;\n\nexport const defineProperty = obj.defineProperty;\n\nexport const defineProperties = obj.defineProperties;\n\nexport const keys = obj.keys;\n","const toString = Object.prototype.toString;\nconst arrayLikePattern = /^\\[object (?:Array|FileList)\\]$/;\n\nexport function isArrayLike(obj) {\n return arrayLikePattern.test(toString.call(obj));\n}\n\nexport const isArray = Array.isArray;\n\nexport function isEqual(a, b) {\n if (a === null && b === null) {\n return true;\n }\n\n if (isObjectType(a) || isObjectType(b)) {\n return false;\n }\n\n return a === b;\n}\n\n// http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric\nexport function isNumeric(thing) {\n return !isNaN(parseFloat(thing)) && isFinite(thing);\n}\n\nexport function isObject(thing) {\n return thing && toString.call(thing) === '[object Object]';\n}\n\nexport function isObjectLike(thing) {\n return !!(thing && (isObjectType(thing) || isFunction(thing))) && !isDate(thing);\n}\n\nexport function isDate(thing) {\n return thing instanceof Date;\n}\n\nexport function isObjectType(thing) {\n return typeof thing === 'object';\n}\n\nexport function isFunction(thing) {\n return typeof thing === 'function';\n}\n\nexport function isString(thing) {\n return typeof thing === 'string';\n}\n\nexport function isNumber(thing) {\n return typeof thing === 'number';\n}\n\nexport function isUndefined(thing) {\n return thing === undefined;\n}\n","/* istanbul ignore if */\nif (typeof window !== 'undefined' && window.performance && !window.performance.now) {\n window.performance = window.performance || {};\n\n const nowOffset = Date.now();\n\n window.performance.now = function() {\n return Date.now() - nowOffset;\n };\n}\n","import { hasOwn, defineProperty } from 'utils/object';\nimport { isFunction, isUndefined } from 'utils/is';\n\n/* istanbul ignore if */\nif (!Array.prototype.find) {\n defineProperty(Array.prototype, 'find', {\n value(callback, thisArg) {\n if (this === null || isUndefined(this))\n throw new TypeError('Array.prototype.find called on null or undefined');\n\n if (!isFunction(callback)) throw new TypeError(`${callback} is not a function`);\n\n const array = Object(this);\n const arrayLength = array.length >>> 0;\n\n for (let index = 0; index < arrayLength; index++) {\n if (!hasOwn(array, index)) continue;\n if (!callback.call(thisArg, array[index], index, array)) continue;\n return array[index];\n }\n\n return undefined;\n },\n configurable: true,\n writable: true\n });\n}\n","// NOTE: Node doesn't exist in IE8. Nothing can be done.\n/* istanbul ignore if */\nif (\n typeof window !== 'undefined' &&\n window.Node &&\n window.Node.prototype &&\n !window.Node.prototype.contains\n) {\n Node.prototype.contains = function(node) {\n if (!node) throw new TypeError('node required');\n\n do {\n if (this === node) return true;\n } while ((node = node && node.parentNode));\n\n return false;\n };\n}\n","/* eslint no-console:\"off\" */\nimport { isFunction } from 'utils/is';\n\nconst win = typeof window !== 'undefined' ? window : null;\nconst doc = win ? document : null;\nconst isClient = !!doc;\nconst base = typeof global !== 'undefined' ? global : win;\nconst hasConsole =\n typeof console !== 'undefined' && isFunction(console.warn) && isFunction(console.warn.apply);\n\nconst svg = doc\n ? doc.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1')\n : false;\n\nconst vendors = ['o', 'ms', 'moz', 'webkit'];\n\nexport { win, doc, isClient, hasConsole, svg, vendors, base };\n","import { isFunction, isObjectType } from 'utils/is';\nimport { base } from 'config/environment';\n\n/* istanbul ignore if */\nif (!base.Promise) {\n const PENDING = {};\n const FULFILLED = {};\n const REJECTED = {};\n\n const Promise = (base.Promise = function(callback) {\n const fulfilledHandlers = [];\n const rejectedHandlers = [];\n let state = PENDING;\n let result;\n let dispatchHandlers;\n\n const makeResolver = newState => {\n return function(value) {\n if (state !== PENDING) return;\n result = value;\n state = newState;\n dispatchHandlers = makeDispatcher(\n state === FULFILLED ? fulfilledHandlers : rejectedHandlers,\n result\n );\n wait(dispatchHandlers);\n };\n };\n\n const fulfill = makeResolver(FULFILLED);\n const reject = makeResolver(REJECTED);\n\n try {\n callback(fulfill, reject);\n } catch (err) {\n reject(err);\n }\n\n return {\n // `then()` returns a Promise - 2.2.7\n then(onFulfilled, onRejected) {\n const promise2 = new Promise((fulfill, reject) => {\n const processResolutionHandler = (handler, handlers, forward) => {\n if (isFunction(handler)) {\n handlers.push(p1result => {\n try {\n resolve(promise2, handler(p1result), fulfill, reject);\n } catch (err) {\n reject(err);\n }\n });\n } else {\n handlers.push(forward);\n }\n };\n\n processResolutionHandler(onFulfilled, fulfilledHandlers, fulfill);\n processResolutionHandler(onRejected, rejectedHandlers, reject);\n\n if (state !== PENDING) {\n wait(dispatchHandlers);\n }\n });\n return promise2;\n },\n catch(onRejected) {\n return this.then(null, onRejected);\n },\n finally(callback) {\n return this.then(\n v => {\n callback();\n return v;\n },\n e => {\n callback();\n throw e;\n }\n );\n }\n };\n });\n\n Promise.all = function(promises) {\n return new Promise((fulfill, reject) => {\n const result = [];\n let pending;\n let i;\n\n if (!promises.length) {\n fulfill(result);\n return;\n }\n\n const processPromise = (promise, i) => {\n if (promise && isFunction(promise.then)) {\n promise.then(value => {\n result[i] = value;\n --pending || fulfill(result);\n }, reject);\n } else {\n result[i] = promise;\n --pending || fulfill(result);\n }\n };\n\n pending = i = promises.length;\n\n while (i--) {\n processPromise(promises[i], i);\n }\n });\n };\n\n Promise.race = function(promises) {\n return new Promise((fulfill, reject) => {\n let pending = true;\n function ok(v) {\n if (!pending) return;\n pending = false;\n fulfill(v);\n }\n function fail(e) {\n if (!pending) return;\n pending = false;\n reject(e);\n }\n for (let i = 0; i < promises.length; i++) {\n if (promises[i] && isFunction(promises[i].then)) {\n promises[i].then(ok, fail);\n }\n }\n });\n };\n\n Promise.resolve = function(value) {\n if (value && isFunction(value.then)) return value;\n return new Promise(fulfill => {\n fulfill(value);\n });\n };\n\n Promise.reject = function(reason) {\n if (reason && isFunction(reason.then)) return reason;\n return new Promise((fulfill, reject) => {\n reject(reason);\n });\n };\n\n // TODO use MutationObservers or something to simulate setImmediate\n const wait = function(callback) {\n setTimeout(callback, 0);\n };\n\n const makeDispatcher = function(handlers, result) {\n return function() {\n for (let handler; (handler = handlers.shift()); ) {\n handler(result);\n }\n };\n };\n\n const resolve = function(promise, x, fulfil, reject) {\n let then;\n if (x === promise) {\n throw new TypeError(`A promise's fulfillment handler cannot return the same promise`);\n }\n if (x instanceof Promise) {\n x.then(fulfil, reject);\n } else if (x && (isObjectType(x) || isFunction(x))) {\n try {\n then = x.then;\n } catch (e) {\n reject(e);\n return;\n }\n if (isFunction(then)) {\n let called;\n\n const resolvePromise = function(y) {\n if (called) return;\n called = true;\n resolve(promise, y, fulfil, reject);\n };\n const rejectPromise = function(r) {\n if (called) return;\n called = true;\n reject(r);\n };\n\n try {\n then.call(x, resolvePromise, rejectPromise);\n } catch (e) {\n if (!called) {\n reject(e);\n called = true;\n return;\n }\n }\n } else {\n fulfil(x);\n }\n } else {\n fulfil(x);\n }\n };\n}\n","/* istanbul ignore if */\nif (\n typeof window !== 'undefined' &&\n !(window.requestAnimationFrame && window.cancelAnimationFrame)\n) {\n let lastTime = 0;\n window.requestAnimationFrame = function(callback) {\n const currentTime = Date.now();\n const timeToNextCall = Math.max(0, 16 - (currentTime - lastTime));\n const id = window.setTimeout(() => {\n callback(currentTime + timeToNextCall);\n }, timeToNextCall);\n lastTime = currentTime + timeToNextCall;\n return id;\n };\n window.cancelAnimationFrame = function(id) {\n clearTimeout(id);\n };\n}\n","import { create } from 'utils/object';\n\nexport default {\n // render placement:\n el: void 0,\n append: false,\n delegate: true,\n enhance: false,\n\n // template:\n template: null,\n\n // parse:\n allowExpressions: true,\n delimiters: ['{{', '}}'],\n tripleDelimiters: ['{{{', '}}}'],\n staticDelimiters: ['[[', ']]'],\n staticTripleDelimiters: ['[[[', ']]]'],\n csp: true,\n interpolate: false,\n preserveWhitespace: false,\n preserveStandaloneSections: false,\n sanitize: false,\n stripComments: true,\n contextLines: 0,\n\n // data & binding:\n data: create(null),\n helpers: create(null),\n computed: create(null),\n syncComputedChildren: false,\n resolveInstanceMembers: false,\n warnAboutAmbiguity: false,\n adapt: [],\n isolated: true,\n twoway: true,\n lazy: false,\n\n // transitions:\n noIntro: false,\n noOutro: false,\n transitionsEnabled: true,\n complete: void 0,\n nestedTransitions: true,\n\n // css:\n css: null,\n noCSSTransform: false\n};\n","// These are a subset of the easing equations found at\n// https://raw.github.com/danro/easing-js - license info\n// follows:\n\n// --------------------------------------------------\n// easing.js v0.5.4\n// Generic set of easing functions with AMD support\n// https://github.com/danro/easing-js\n// This code may be freely distributed under the MIT license\n// http://danro.mit-license.org/\n// --------------------------------------------------\n// All functions adapted from Thomas Fuchs & Jeremy Kahn\n// Easing Equations (c) 2003 Robert Penner, BSD license\n// https://raw.github.com/danro/easing-js/master/LICENSE\n// --------------------------------------------------\n\n// In that library, the functions named easeIn, easeOut, and\n// easeInOut below are named easeInCubic, easeOutCubic, and\n// (you guessed it) easeInOutCubic.\n//\n// You can add additional easing functions to this list, and they\n// will be globally available.\n\nexport default {\n linear(pos) {\n return pos;\n },\n easeIn(pos) {\n /* istanbul ignore next */\n return Math.pow(pos, 3);\n },\n easeOut(pos) {\n return Math.pow(pos - 1, 3) + 1;\n },\n easeInOut(pos) {\n /* istanbul ignore next */\n if ((pos /= 0.5) < 1) {\n return 0.5 * Math.pow(pos, 3);\n }\n /* istanbul ignore next */\n return 0.5 * (Math.pow(pos - 2, 3) + 2);\n }\n};\n","import { splitKeypath } from 'shared/keypaths';\nimport SharedModel, {\n GlobalModel,\n SharedModel as ContextModel\n} from 'src/model/specials/SharedModel';\nimport { warnIfDebug } from 'utils/log';\nimport { hasOwn } from 'utils/object';\nimport { isFunction } from 'utils/is';\n\nfunction findContext(fragment) {\n let frag = fragment;\n while (frag && !frag.context && !frag.aliases) frag = frag.parent;\n return frag;\n}\n\nexport default function resolveReference(fragment, ref) {\n const initialFragment = fragment;\n // current context ref\n if (ref === '.') return fragment.findContext();\n\n // ancestor references\n if (ref[0] === '~') return fragment.ractive.viewmodel.joinAll(splitKeypath(ref.slice(2)));\n\n // scoped references\n if (ref[0] === '.' || ref[0] === '^') {\n let frag = fragment;\n const parts = ref.split('/');\n const explicitContext = parts[0] === '^^';\n\n // find nearest context node\n while (frag && !frag.context) {\n frag = up(frag);\n }\n let context = frag && frag.context;\n\n // walk up the context chain\n while (frag && parts[0] === '^^') {\n parts.shift();\n\n // the current fragment should always be a context,\n // and if it happens to be an iteration, jump above the each block\n if (frag.isIteration) {\n frag = frag.parent.parent;\n } else {\n // otherwise jump above the current fragment\n frag = up(frag);\n }\n\n // walk to the next contexted fragment\n while (frag && !frag.context) {\n frag = up(frag);\n }\n context = frag && frag.context;\n }\n\n if (!context && explicitContext) {\n throw new Error(\n `Invalid context parent reference ('${ref}'). There is not context at that level.`\n );\n }\n\n // walk up the context path\n while (parts[0] === '.' || parts[0] === '..') {\n const part = parts.shift();\n\n if (part === '..') {\n context = context.parent;\n }\n }\n\n ref = parts.join('/');\n\n // special case - `{{.foo}}` means the same as `{{./foo}}`\n if (ref[0] === '.') ref = ref.slice(1);\n return context.joinAll(splitKeypath(ref));\n }\n\n const keys = splitKeypath(ref);\n if (!keys.length) return;\n const base = keys.shift();\n\n // special refs\n if (base[0] === '@') {\n // shorthand from outside the template\n // @this referring to local ractive instance\n if (base === '@this' || base === '@') {\n return fragment.ractive.viewmodel.getRactiveModel().joinAll(keys);\n } else if (base === '@index' || base === '@key') {\n // @index or @key referring to the nearest repeating index or key\n if (keys.length) badReference(base);\n const repeater = findIter(fragment);\n return repeater && repeater[`get${base[1] === 'i' ? 'Index' : 'Key'}`]();\n } else if (base === '@last') {\n const repeater = findIter(fragment);\n return repeater && repeater.parent.getLast();\n } else if (base === '@global') {\n // @global referring to window or global\n return GlobalModel.joinAll(keys);\n } else if (base === '@shared') {\n // @global referring to window or global\n return SharedModel.joinAll(keys);\n } else if (base === '@keypath' || base === '@rootpath') {\n // @keypath or @rootpath, the current keypath string\n const root = ref[1] === 'r' ? fragment.ractive.root : null;\n let f = fragment;\n\n while (\n f &&\n (!f.context || (f.isRoot && f.ractive.component && (root || !f.ractive.isolated)))\n ) {\n f = f.isRoot ? f.componentParent : f.parent;\n }\n\n return f.getKeypath(root);\n } else if (base === '@context') {\n return new ContextModel(fragment.getContext(), 'context').joinAll(keys);\n } else if (base === '@local') {\n // @context-local data\n return fragment.getContext()._data.joinAll(keys);\n } else if (base === '@style') {\n // @style shared model\n return fragment.ractive.constructor._cssModel.joinAll(keys);\n } else if (base === '@helpers') {\n // @helpers instance model\n return fragment.ractive.viewmodel.getHelpers().joinAll(keys);\n } else if (base === '@macro') {\n const handle = findMacro(fragment);\n if (handle) return new ContextModel(handle, 'macro').joinAll(keys);\n else return;\n } else {\n // nope\n throw new Error(`Invalid special reference '${base}'`);\n }\n }\n\n // helpers\n if (base && !keys.length) {\n const helpers = fragment.ractive.viewmodel.getHelpers();\n if (helpers.has(base)) return helpers.joinKey(base);\n }\n\n let context = findContext(fragment);\n\n // check immediate context for a match\n if (context) {\n if (context.context) {\n context = context.context;\n } else {\n // alias block, so get next full context for later\n context = fragment.findContext();\n }\n } else {\n context = fragment.findContext();\n }\n\n // walk up the fragment hierarchy looking for a matching ref, alias, or key in a context\n let createMapping = false;\n const shouldWarn = fragment.ractive.warnAboutAmbiguity;\n let crossed = 0;\n let model;\n\n while (fragment) {\n // repeated fragments\n if (fragment.isIteration) {\n if (base === fragment.parent.keyRef) {\n model = fragment.getKey();\n } else if (base === fragment.parent.indexRef) {\n model = fragment.getIndex();\n }\n\n if (model && keys.length) badReference(base);\n }\n\n // alias node or iteration\n if (!model && fragment.aliases && hasOwn(fragment.aliases, base)) {\n model = fragment.aliases[base];\n }\n\n // check fragment context to see if it has the key we need\n if (!model && fragment.context && fragment.context.has(base)) {\n model = fragment.context.joinKey(base);\n\n // this is an implicit mapping\n if (createMapping) {\n if (shouldWarn)\n warnIfDebug(\n `'${ref}' resolved but is ambiguous and will create a mapping to a parent component.`\n );\n } else if (shouldWarn && crossed) warnIfDebug(`'${ref}' resolved but is ambiguous.`);\n }\n\n if (model) {\n if (createMapping) {\n model = initialFragment.ractive.viewmodel.createLink(base, model, base, { implicit: true });\n }\n\n if (keys.length > 0 && isFunction(model.joinAll)) {\n model = model.joinAll(keys);\n }\n\n return model;\n }\n\n // don't consider alias blocks when checking for ambiguity\n if (fragment.context && !fragment.aliases) crossed = 1;\n\n if (\n !fragment.ractive.isolated &&\n !(fragment.owner && fragment.owner.containerFragment) &&\n (fragment.componentParent || (!fragment.parent && fragment.ractive.component))\n ) {\n // ascend through component boundary\n fragment = fragment.componentParent || fragment.ractive.component.up;\n createMapping = true;\n } else {\n fragment = fragment.parent;\n }\n }\n\n // if enabled, check the instance for a match\n const instance = initialFragment.ractive;\n if (instance.resolveInstanceMembers && base !== 'data' && base in instance) {\n return instance.viewmodel\n .getRactiveModel()\n .joinKey(base)\n .joinAll(keys);\n }\n\n if (shouldWarn) {\n warnIfDebug(`'${ref}' is ambiguous and did not resolve.`);\n }\n\n // didn't find anything, so go ahead and create the key on the local model\n return context.joinKey(base).joinAll(keys);\n}\n\nfunction up(fragment) {\n return (\n fragment &&\n ((!fragment.ractive.isolated &&\n !(fragment.owner && fragment.owner.containerFragment) &&\n (fragment.componentParent || (!fragment.parent && fragment.ractive.component))) ||\n fragment.parent)\n );\n}\n\nfunction findIter(start) {\n let fragment = start;\n let next;\n while (!fragment.isIteration && (next = up(fragment))) {\n fragment = next;\n }\n\n return fragment.isIteration && fragment;\n}\n\nfunction findMacro(start) {\n let fragment = start;\n while (fragment) {\n if (fragment.owner.handle) return fragment.owner.handle;\n fragment = up(fragment);\n }\n}\n\nfunction badReference(key) {\n throw new Error(`An index or key reference (${key}) cannot have child properties`);\n}\n","import add from './shared/add';\nimport { isNumber, isObjectType } from 'utils/is';\n\nexport default function Ractive$add(keypath, d, options) {\n const num = isNumber(d) ? d : 1;\n const opts = isObjectType(d) ? d : options;\n return add(this, keypath, num, opts);\n}\n","export function enqueue(ractive, event) {\n if (ractive.event) {\n ractive._eventQueue.push(ractive.event);\n }\n\n ractive.event = event;\n}\n\nexport function dequeue(ractive) {\n if (ractive._eventQueue.length) {\n ractive.event = ractive._eventQueue.pop();\n } else {\n ractive.event = null;\n }\n}\n","export function findAnchors(fragment, name = null) {\n const res = [];\n\n findAnchorsIn(fragment, name, res, fragment.ractive);\n\n return res;\n}\n\nfunction findAnchorsIn(item, name, result, instance) {\n if (item.isAnchor) {\n if (!name || item.name === name) {\n result.push(item);\n }\n } else if (item.items) {\n item.items.forEach(i => findAnchorsIn(i, name, result, instance));\n } else if (item.iterations) {\n item.iterations.forEach(i => findAnchorsIn(i, name, result, instance));\n } else if (item.fragment && (!item.component || item.fragment.ractive === instance)) {\n findAnchorsIn(item.fragment, name, result, instance);\n } else if (item.instance && item.instance.fragment) {\n const anchors = [];\n findAnchorsIn(item.instance.fragment, name, anchors, instance);\n anchors.forEach(a => a.ractive === instance && result.push(a));\n }\n}\n\nexport function updateAnchors(instance, name = null) {\n const anchors = findAnchors(instance.fragment, name);\n const idxs = {};\n const children = instance._children.byName;\n\n anchors.forEach(a => {\n const name = a.name;\n if (!(name in idxs)) idxs[name] = 0;\n const idx = idxs[name];\n const child = (children[name] || [])[idx];\n\n if (child && child.lastBound !== a) {\n if (child.lastBound) child.lastBound.removeChild(child);\n a.addChild(child);\n }\n\n idxs[name]++;\n });\n}\n\nexport function unrenderChild(meta) {\n if (meta.instance.fragment.rendered) {\n meta.shouldDestroy = true;\n meta.instance.unrender();\n }\n meta.instance.el = null;\n}\n","import hooks from 'src/events/Hook';\nimport runloop from 'src/global/runloop';\nimport { unrenderChild, updateAnchors } from 'shared/anchors';\n\nexport default function attachChild(child, options = {}) {\n const children = this._children;\n let idx;\n\n if (child.parent && child.parent !== this)\n throw new Error(\n `Instance ${child._guid} is already attached to a different instance ${\n child.parent._guid\n }. Please detach it from the other instance using detachChild first.`\n );\n else if (child.parent)\n throw new Error(`Instance ${child._guid} is already attached to this instance.`);\n\n const meta = {\n instance: child,\n ractive: this,\n name: options.name || child.constructor.name || 'Ractive',\n target: options.target || false,\n bubble,\n findNextNode\n };\n meta.nameOption = options.name;\n\n // child is managing itself\n if (!meta.target) {\n meta.up = this.fragment;\n meta.external = true;\n } else {\n let list;\n if (!(list = children.byName[meta.target])) {\n list = [];\n this.set(`@this.children.byName.${meta.target}`, list);\n }\n idx = options.prepend ? 0 : options.insertAt !== undefined ? options.insertAt : list.length;\n }\n\n child.parent = this;\n child.root = this.root;\n child.component = meta;\n children.push(meta);\n\n const promise = runloop.start();\n\n const rm = child.viewmodel.getRactiveModel();\n rm.joinKey('parent', { lastLink: false }).link(this.viewmodel.getRactiveModel());\n rm.joinKey('root', { lastLink: false }).link(this.root.viewmodel.getRactiveModel());\n\n hooks.attachchild.fire(child);\n\n if (meta.target) {\n unrenderChild(meta);\n this.splice(`@this.children.byName.${meta.target}`, idx, 0, meta);\n updateAnchors(this, meta.target);\n } else {\n if (!child.isolated) child.viewmodel.attached(this.fragment);\n }\n\n runloop.end();\n\n promise.ractive = child;\n return promise.then(() => child);\n}\n\nfunction bubble() {\n runloop.addFragment(this.instance.fragment);\n}\n\nfunction findNextNode() {\n if (this.anchor) return this.anchor.findNextNode();\n}\n","import { splitKeypath } from 'shared/keypaths';\nimport { isString, isFunction } from 'utils/is';\nimport runloop from 'src/global/runloop';\nimport { fireShuffleTasks } from 'src/model/ModelBase';\n\nexport function compute(path, computed) {\n this.computed[path] = computed;\n if (isString(computed) || isFunction(computed))\n computed = this.computed[path] = { get: computed };\n\n const keys = splitKeypath(path);\n if (!~path.indexOf('*')) {\n const last = keys.pop();\n return this.viewmodel.joinAll(keys).compute(last, computed);\n } else {\n computed.pattern = new RegExp(\n '^' +\n keys\n .map(k => k.replace(/\\*\\*/g, '(.+)').replace(/\\*/g, '((?:\\\\\\\\.|[^\\\\.])+)'))\n .join('\\\\.') +\n '$'\n );\n }\n}\n\nexport default function Ractive$compute(path, computed) {\n const promise = runloop.start();\n const comp = compute.call(this, path, computed);\n\n if (comp) {\n const keys = splitKeypath(path);\n if (keys.length === 1 && !comp.isReadonly) {\n comp.set(this.viewmodel.value[keys[0]]);\n }\n\n const first = keys.reduce((a, c) => a && a.childByKey[c], this.viewmodel);\n if (first) {\n first.rebind(comp, first, false);\n if (first.parent) delete first.parent.childByKey[first.key];\n fireShuffleTasks();\n }\n }\n\n runloop.end();\n\n return promise;\n}\n","import hooks from 'src/events/Hook';\nimport { removeFromArray } from 'utils/array';\n\nexport default function Ractive$detach() {\n if (this.isDetached) {\n return this.el;\n }\n\n if (this.el) {\n removeFromArray(this.el.__ractive_instances__, this);\n }\n\n this.el = this.fragment.detach();\n this.isDetached = true;\n\n hooks.detach.fire(this);\n return this.el;\n}\n","import hooks from 'src/events/Hook';\nimport runloop from 'src/global/runloop';\nimport { updateAnchors } from 'shared/anchors';\n\nexport default function detachChild(child) {\n const children = this._children;\n let meta, index;\n\n let i = children.length;\n while (i--) {\n if (children[i].instance === child) {\n index = i;\n meta = children[i];\n break;\n }\n }\n\n if (!meta || child.parent !== this)\n throw new Error(`Instance ${child._guid} is not attached to this instance.`);\n\n const promise = runloop.start();\n\n if (meta.anchor) meta.anchor.removeChild(meta);\n if (!child.isolated) child.viewmodel.detached();\n\n children.splice(index, 1);\n if (meta.target) {\n this.splice(\n `@this.children.byName.${meta.target}`,\n children.byName[meta.target].indexOf(meta),\n 1\n );\n updateAnchors(this, meta.target);\n }\n const rm = child.viewmodel.getRactiveModel();\n rm.joinKey('parent', { lastLink: false }).unlink();\n rm.joinKey('root', { lastLink: false }).link(rm);\n child.root = child;\n child.parent = null;\n child.component = null;\n\n hooks.detachchild.fire(child);\n\n runloop.end();\n\n promise.ractive = child;\n return promise.then(() => child);\n}\n","export default function Ractive$find(selector, options = {}) {\n if (!this.rendered)\n throw new Error(\n `Cannot call ractive.find('${selector}') unless instance is rendered to the DOM`\n );\n\n let node = this.fragment.find(selector, options);\n if (node) return node;\n\n if (options.remote) {\n for (let i = 0; i < this._children.length; i++) {\n if (!this._children[i].instance.fragment.rendered) continue;\n node = this._children[i].instance.find(selector, options);\n if (node) return node;\n }\n }\n}\n","import { isArray } from 'utils/is';\n\nexport default function Ractive$findAll(selector, options = {}) {\n if (!this.rendered)\n throw new Error(\n `Cannot call ractive.findAll('${selector}', ...) unless instance is rendered to the DOM`\n );\n\n if (!isArray(options.result)) options.result = [];\n\n this.fragment.findAll(selector, options);\n\n if (options.remote) {\n // seach non-fragment children\n this._children.forEach(c => {\n if (!c.target && c.instance.fragment && c.instance.fragment.rendered) {\n c.instance.findAll(selector, options);\n }\n });\n }\n\n return options.result;\n}\n","import { isArray, isObjectType } from 'utils/is';\n\nexport default function Ractive$findAllComponents(selector, options) {\n if (!options && isObjectType(selector)) {\n options = selector;\n selector = '';\n }\n\n options = options || {};\n\n if (!isArray(options.result)) options.result = [];\n\n this.fragment.findAllComponents(selector, options);\n\n if (options.remote) {\n // search non-fragment children\n this._children.forEach(c => {\n if (!c.target && c.instance.fragment && c.instance.fragment.rendered) {\n if (!selector || c.name === selector) {\n options.result.push(c.instance);\n }\n\n c.instance.findAllComponents(selector, options);\n }\n });\n }\n\n return options.result;\n}\n","import { isObjectType } from 'utils/is';\n\nexport default function Ractive$findComponent(selector, options = {}) {\n if (isObjectType(selector)) {\n options = selector;\n selector = '';\n }\n\n let child = this.fragment.findComponent(selector, options);\n if (child) return child;\n\n if (options.remote) {\n if (!selector && this._children.length) return this._children[0].instance;\n for (let i = 0; i < this._children.length; i++) {\n // skip children that are or should be in an anchor\n if (this._children[i].target) continue;\n if (this._children[i].name === selector) return this._children[i].instance;\n child = this._children[i].instance.findComponent(selector, options);\n if (child) return child;\n }\n }\n}\n","export default function Ractive$findContainer(selector) {\n if (this.container) {\n if (this.container.component && this.container.component.name === selector) {\n return this.container;\n } else {\n return this.container.findContainer(selector);\n }\n }\n\n return null;\n}\n","export default function Ractive$findParent(selector) {\n if (this.parent) {\n if (this.parent.component && this.parent.component.name === selector) {\n return this.parent;\n } else {\n return this.parent.findParent(selector);\n }\n }\n\n return null;\n}\n","import { ANCHOR, COMPONENT, ELEMENT } from 'config/types';\n\nexport default function findElement(start, orComponent = true, name) {\n while (\n start &&\n (start.type !== ELEMENT || (name && start.name !== name)) &&\n (!orComponent || (start.type !== COMPONENT && start.type !== ANCHOR))\n ) {\n // start is a fragment - look at the owner\n if (start.owner) start = start.owner;\n else if (start.component || start.yield)\n // start is a component or yielder - look at the container\n start = start.containerFragment || start.component.up;\n else if (start.parent)\n // start is an item - look at the parent\n start = start.parent;\n else if (start.up)\n // start is an item without a parent - look at the parent fragment\n start = start.up;\n else start = undefined;\n }\n\n return start;\n}\n","import { isNumber, isUndefined } from 'utils/is';\n\n// This function takes an array, the name of a mutator method, and the\n// arguments to call that mutator method with, and returns an array that\n// maps the old indices to their new indices.\n\n// So if you had something like this...\n//\n// array = [ 'a', 'b', 'c', 'd' ];\n// array.push( 'e' );\n//\n// ...you'd get `[ 0, 1, 2, 3 ]` - in other words, none of the old indices\n// have changed. If you then did this...\n//\n// array.unshift( 'z' );\n//\n// ...the indices would be `[ 1, 2, 3, 4, 5 ]` - every item has been moved\n// one higher to make room for the 'z'. If you removed an item, the new index\n// would be -1...\n//\n// array.splice( 2, 2 );\n//\n// ...this would result in [ 0, 1, -1, -1, 2, 3 ].\n//\n// This information is used to enable fast, non-destructive shuffling of list\n// sections when you do e.g. `ractive.splice( 'items', 2, 2 );\n\nexport default function getNewIndices(length, methodName, args) {\n const newIndices = [];\n\n const spliceArguments = getSpliceEquivalent(length, methodName, args);\n\n if (!spliceArguments) {\n return null; // TODO support reverse and sort?\n }\n\n const balance = spliceArguments.length - 2 - spliceArguments[1];\n\n const removeStart = Math.min(length, spliceArguments[0]);\n const removeEnd = removeStart + spliceArguments[1];\n newIndices.startIndex = removeStart;\n\n let i;\n for (i = 0; i < removeStart; i += 1) {\n newIndices.push(i);\n }\n\n for (; i < removeEnd; i += 1) {\n newIndices.push(-1);\n }\n\n for (; i < length; i += 1) {\n newIndices.push(i + balance);\n }\n\n // there is a net shift for the rest of the array starting with index + balance\n if (balance !== 0) {\n newIndices.touchedFrom = spliceArguments[0];\n } else {\n newIndices.touchedFrom = length;\n }\n\n return newIndices;\n}\n\n// The pop, push, shift an unshift methods can all be represented\n// as an equivalent splice\nfunction getSpliceEquivalent(length, methodName, args) {\n switch (methodName) {\n case 'splice':\n if (args[0] !== undefined && args[0] < 0) {\n args[0] = length + Math.max(args[0], -length);\n }\n\n if (isUndefined(args[0])) args[0] = 0;\n\n while (args.length < 2) {\n args.push(length - args[0]);\n }\n\n if (!isNumber(args[1])) {\n args[1] = length - args[0];\n }\n\n // ensure we only remove elements that exist\n args[1] = Math.min(args[1], length - args[0]);\n\n return args;\n\n case 'sort':\n case 'reverse':\n return null;\n\n case 'pop':\n if (length) {\n return [length - 1, 1];\n }\n return [0, 0];\n\n case 'push':\n return [length, 0].concat(args);\n\n case 'shift':\n return [0, length ? 1 : 0];\n\n case 'unshift':\n return [0, 0].concat(args);\n }\n}\n","import hooks from 'src/events/Hook';\nimport runloop from 'src/global/runloop';\nimport { splitKeypath } from 'shared/keypaths';\nimport { isString } from 'utils/is';\n\nexport function update(ractive, model, options) {\n // if the parent is wrapped, the adaptor will need to be updated before\n // updating on this keypath\n if (model.parent && model.parent.wrapper) {\n model.parent.adapt();\n }\n\n const promise = runloop.start();\n\n model.mark(options && options.force);\n\n // notify upstream of changes\n model.notifyUpstream();\n\n runloop.end();\n\n hooks.update.fire(ractive, model);\n\n return promise;\n}\n\nexport default function Ractive$update(keypath, options) {\n let opts, path;\n\n if (isString(keypath)) {\n path = splitKeypath(keypath);\n opts = options;\n } else {\n opts = keypath;\n }\n\n return update(this, path ? this.viewmodel.joinAll(path) : this.viewmodel, opts);\n}\n","import fireEvent from 'src/events/fireEvent';\nimport Context from 'shared/Context';\nimport { assign, create } from 'utils/object';\nimport { isObjectType } from 'utils/is';\n\nexport default function Ractive$fire(eventName, ...args) {\n let ctx;\n\n // watch for reproxy\n if (args[0] instanceof Context) {\n const proto = args.shift();\n ctx = create(proto);\n assign(ctx, proto);\n } else if (isObjectType(args[0]) && (args[0] === null || args[0].constructor === Object)) {\n ctx = Context.forRactive(this, args.shift());\n } else {\n ctx = Context.forRactive(this);\n }\n\n return fireEvent(this, eventName, ctx, args);\n}\n","import { splitKeypath } from 'shared/keypaths';\nimport resolveReference from 'src/view/resolvers/resolveReference';\nimport { FakeFragment } from 'shared/getRactiveContext';\nimport { isString } from 'utils/is';\n\nexport default function Ractive$get(keypath, opts) {\n if (!isString(keypath)) return this.viewmodel.get(true, keypath);\n\n const keys = splitKeypath(keypath);\n const key = keys[0];\n\n let model;\n\n if (!this.viewmodel.has(key)) {\n // if this is an inline component, we may need to create\n // an implicit mapping\n if (this.component && !this.isolated) {\n model = resolveReference(this.fragment || new FakeFragment(this), key);\n }\n }\n\n model = this.viewmodel.joinAll(keys);\n return model.get(true, opts);\n}\n","import { localFragment } from '../../shared/Context';\nexport default function getLocalContext() {\n if (localFragment.f) return localFragment.f.getContext();\n}\n","import staticContext from '../static/getContext';\nimport getRactiveContext from 'src/shared/getRactiveContext';\nimport { isString } from 'utils/is';\n\nexport default function getContext(node, options) {\n if (!node) return getRactiveContext(this);\n\n if (isString(node)) {\n node = this.find(node, options);\n }\n\n return staticContext(node);\n}\n","import hooks from 'src/events/Hook';\nimport { getElement } from 'utils/dom';\n\nexport default function Ractive$insert(target, anchor) {\n if (!this.fragment.rendered) {\n // TODO create, and link to, documentation explaining this\n throw new Error(\n 'The API has changed - you must call `ractive.render(target[, anchor])` to render your Ractive instance. Once rendered you can use `ractive.insert()`.'\n );\n }\n\n target = getElement(target);\n anchor = getElement(anchor) || null;\n\n if (!target) {\n throw new Error('You must specify a valid target to insert into');\n }\n\n target.insertBefore(this.detach(), anchor);\n this.el = target;\n\n (target.__ractive_instances__ || (target.__ractive_instances__ = [])).push(this);\n this.isDetached = false;\n\n fireInsertHook(this);\n}\n\nfunction fireInsertHook(ractive) {\n hooks.insert.fire(ractive);\n\n ractive.findAllComponents('*').forEach(child => {\n fireInsertHook(child.instance);\n });\n}\n","import { splitKeypath } from 'shared/keypaths';\nimport resolveReference from 'src/view/resolvers/resolveReference';\nimport runloop from 'src/global/runloop';\n\nexport default function link(there, here, options) {\n let model;\n const target = (options && (options.ractive || options.instance)) || this;\n\n // may need to allow a mapping to resolve implicitly\n const sourcePath = splitKeypath(there);\n if (!target.viewmodel.has(sourcePath[0]) && target.component) {\n model = resolveReference(target.component.up, sourcePath[0]);\n model = model.joinAll(sourcePath.slice(1));\n }\n\n const src = model || target.viewmodel.joinAll(sourcePath);\n const dest = this.viewmodel.joinAll(splitKeypath(here), { lastLink: false });\n\n if (isUpstream(src, dest) || isUpstream(dest, src)) {\n throw new Error('A keypath cannot be linked to itself.');\n }\n\n const promise = runloop.start();\n\n dest.link(src, (options && options.keypath) || there);\n\n runloop.end();\n\n return promise;\n}\n\nfunction isUpstream(check, start) {\n let model = start;\n while (model) {\n if (model === check || model.owner === check) return true;\n model = model.target || model.parent;\n }\n}\n","import { escapeKey, splitKeypath as splitKeypathI, unescapeKey } from 'shared/keypaths';\n\nexport function joinKeys(...keys) {\n return keys.map(escapeKey).join('.');\n}\n\nexport function splitKeypath(keypath) {\n return splitKeypathI(keypath).map(unescapeKey);\n}\n","import { isObject, isFunction } from 'utils/is';\nimport { warnOnceIfDebug } from 'utils/log';\nimport { splitKeypath } from 'shared/keypaths';\nimport resolveReference from 'src/view/resolvers/resolveReference';\nimport Observer from './observe/Observer';\nimport PatternObserver from './observe/Pattern';\nimport ArrayObserver from './observe/Array';\nimport { keys } from 'utils/object';\n\nexport default function observe(keypath, callback, options) {\n const observers = [];\n let map;\n let opts;\n\n if (isObject(keypath)) {\n map = keypath;\n opts = callback || {};\n } else {\n if (isFunction(keypath)) {\n map = { '': keypath };\n opts = callback || {};\n } else {\n map = {};\n map[keypath] = callback;\n opts = options || {};\n }\n }\n\n let silent = false;\n keys(map).forEach(keypath => {\n const callback = map[keypath];\n const caller = function(...args) {\n if (silent) return;\n return callback.apply(this, args);\n };\n\n let keypaths = keypath.split(' ');\n if (keypaths.length > 1) keypaths = keypaths.filter(k => k);\n\n keypaths.forEach(keypath => {\n opts.keypath = keypath;\n const observer = createObserver(this, keypath, caller, opts);\n if (observer) observers.push(observer);\n });\n });\n\n // add observers to the Ractive instance, so they can be\n // cancelled on ractive.teardown()\n this._observers.push.apply(this._observers, observers);\n\n return {\n cancel: () => observers.forEach(o => o.cancel()),\n isSilenced: () => silent,\n silence: () => (silent = true),\n resume: () => (silent = false)\n };\n}\n\nfunction createObserver(ractive, keypath, callback, options) {\n const keys = splitKeypath(keypath);\n let wildcardIndex = keys.indexOf('*');\n if (!~wildcardIndex) wildcardIndex = keys.indexOf('**');\n\n options.fragment = options.fragment || ractive.fragment;\n\n let model;\n if (!options.fragment) {\n model = ractive.viewmodel.joinKey(keys[0]);\n } else {\n // .*.whatever relative wildcard is a special case because splitkeypath doesn't handle the leading .\n if (~keys[0].indexOf('.*')) {\n model = options.fragment.findContext();\n wildcardIndex = 0;\n keys[0] = keys[0].slice(1);\n } else {\n model =\n wildcardIndex === 0\n ? options.fragment.findContext()\n : resolveReference(options.fragment, keys[0]);\n }\n }\n\n // the model may not exist key\n if (!model) model = ractive.viewmodel.joinKey(keys[0]);\n\n if (!~wildcardIndex) {\n model = model.joinAll(keys.slice(1));\n if (options.array) {\n return new ArrayObserver(ractive, model, callback, options);\n } else {\n return new Observer(ractive, model, callback, options);\n }\n } else {\n const double = keys.indexOf('**');\n if (~double) {\n if (double + 1 !== keys.length || ~keys.indexOf('*')) {\n warnOnceIfDebug(\n `Recursive observers may only specify a single '**' at the end of the path.`\n );\n return;\n }\n }\n\n model = model.joinAll(keys.slice(1, wildcardIndex));\n\n return new PatternObserver(ractive, model, keys.slice(wildcardIndex), callback, options);\n }\n}\n","import { removeFromArray } from 'utils/array';\nimport trim from './shared/trim';\nimport notEmptyString from './shared/notEmptyString';\n\nexport default function Ractive$off(eventName, callback) {\n // if no event is specified, remove _all_ event listeners\n if (!eventName) {\n this._subs = {};\n } else {\n // Handle multiple space-separated event names\n const eventNames = eventName\n .split(' ')\n .map(trim)\n .filter(notEmptyString);\n\n eventNames.forEach(event => {\n const subs = this._subs[event];\n // if given a specific callback to remove, remove only it\n if (subs && callback) {\n const entry = subs.find(s => s.callback === callback);\n if (entry) {\n removeFromArray(subs, entry);\n entry.off = true;\n\n if (event.indexOf('.')) this._nsSubs--;\n }\n } else if (subs) {\n // otherwise, remove all listeners for this event\n if (event.indexOf('.')) this._nsSubs -= subs.length;\n subs.length = 0;\n }\n });\n }\n\n return this;\n}\n","import trim from './shared/trim';\nimport notEmptyString from './shared/notEmptyString';\nimport { hasOwn } from 'utils/object';\nimport { isObjectType, isString } from 'utils/is';\n\nexport default function Ractive$on(eventName, callback) {\n // eventName may already be a map\n const map = isObjectType(eventName) ? eventName : {};\n // or it may be a string along with a callback\n if (isString(eventName)) map[eventName] = callback;\n\n let silent = false;\n const events = [];\n\n for (const k in map) {\n const callback = map[k];\n const caller = function(...args) {\n if (!silent) return callback.apply(this, args);\n };\n const entry = {\n callback,\n handler: caller\n };\n\n if (hasOwn(map, k)) {\n const names = k\n .split(' ')\n .map(trim)\n .filter(notEmptyString);\n names.forEach(n => {\n (this._subs[n] || (this._subs[n] = [])).push(entry);\n if (n.indexOf('.')) this._nsSubs++;\n events.push([n, entry]);\n });\n }\n }\n\n return {\n cancel: () => events.forEach(e => this.off(e[0], e[1].callback)),\n isSilenced: () => silent,\n silence: () => (silent = true),\n resume: () => (silent = false)\n };\n}\n","export default function Ractive$once(eventName, handler) {\n const listener = this.on(eventName, function() {\n handler.apply(this, arguments);\n listener.cancel();\n });\n\n // so we can still do listener.cancel() manually\n return listener;\n}\n","import { splitKeypath } from 'shared/keypaths';\n\nexport default function readLink(keypath, options = {}) {\n const path = splitKeypath(keypath);\n\n if (this.viewmodel.has(path[0])) {\n let model = this.viewmodel.joinAll(path);\n\n if (!model.isLink) return;\n\n while ((model = model.target) && options.canonical !== false) {\n if (!model.isLink) break;\n }\n\n if (model) return { ractive: model.root.ractive, keypath: model.getKeypath() };\n }\n}\n","function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n}\n\nexport function uuid() {\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}\n","import { applyCSS } from '../../global/css';\nimport transformCSS from '../config/custom/css/transform';\nimport { evalCSS } from '../config/custom/css/css';\nimport { build, set } from '../../shared/set';\nimport runloop from '../../global/runloop';\nimport { isObjectType, isFunction } from 'utils/is';\n\nexport default function setCSSData(keypath, value, options) {\n const opts = isObjectType(keypath) ? value : options;\n const model = this._cssModel;\n\n model.locked = true;\n const promise = set(build({ viewmodel: model }, keypath, value, true), opts);\n model.locked = false;\n\n const cascade = runloop.start();\n this.extensions.forEach(e => {\n const model = e._cssModel;\n model.mark();\n model.downstreamChanged('', 1);\n });\n runloop.end();\n\n applyChanges(this, !opts || opts.apply !== false);\n\n return promise.then(() => cascade);\n}\n\nexport function applyChanges(component, apply) {\n const local = recomputeCSS(component);\n const child = component.extensions\n .map(e => applyChanges(e, false))\n .reduce((a, c) => c || a, false);\n\n if (apply && (local || child)) {\n const def = component._cssDef;\n if (!def || (def && def.applied)) applyCSS(true);\n }\n\n return local || child;\n}\n\nexport function recomputeCSS(component) {\n const css = component.css;\n\n if (!isFunction(css)) return;\n\n const def = component._cssDef;\n const result = evalCSS(component, css);\n const styles = def.transform ? transformCSS(result, def.id) : result;\n\n if (def.styles === styles) return;\n\n def.styles = styles;\n\n return true;\n}\n","import noop from 'utils/noop';\nimport { isFunction } from 'utils/is';\n\nexport default function wrap(parent, name, method) {\n if (!/_super/.test(method)) return method;\n\n function wrapper() {\n const superMethod = getSuperMethod(wrapper._parent, name);\n const hasSuper = '_super' in this;\n const oldSuper = this._super;\n\n this._super = superMethod;\n\n const result = method.apply(this, arguments);\n\n if (hasSuper) {\n this._super = oldSuper;\n } else {\n delete this._super;\n }\n\n return result;\n }\n\n wrapper._parent = parent;\n wrapper._method = method;\n\n return wrapper;\n}\n\nfunction getSuperMethod(parent, name) {\n if (name in parent) {\n const value = parent[name];\n\n return isFunction(value) ? value : () => value;\n }\n\n return noop;\n}\n","import { warnIfDebug } from 'utils/log';\nimport { isArray } from 'utils/is';\n\nfunction getMessage(deprecated, correct, isError) {\n return (\n `options.${deprecated} has been deprecated in favour of options.${correct}.` +\n (isError ? ` You cannot specify both options, please use options.${correct}.` : '')\n );\n}\n\nfunction deprecateOption(options, deprecatedOption, correct) {\n if (deprecatedOption in options) {\n if (!(correct in options)) {\n warnIfDebug(getMessage(deprecatedOption, correct));\n options[correct] = options[deprecatedOption];\n } else {\n throw new Error(getMessage(deprecatedOption, correct, true));\n }\n }\n}\n\nexport default function deprecate(options) {\n deprecateOption(options, 'beforeInit', 'onconstruct');\n deprecateOption(options, 'init', 'onrender');\n deprecateOption(options, 'complete', 'oncomplete');\n deprecateOption(options, 'eventDefinitions', 'events');\n\n // Using extend with Component instead of options,\n // like Human.extend( Spider ) means adaptors as a registry\n // gets copied to options. So we have to check if actually an array\n if (isArray(options.adaptors)) {\n deprecateOption(options, 'adaptors', 'adapt');\n }\n}\n","export default function() {}\n","export function findInViewHierarchy(registryName, ractive, name) {\n const instance = findInstance(registryName, ractive, name);\n return instance ? instance[registryName][name] : null;\n}\n\nexport function findInstance(registryName, ractive, name) {\n while (ractive) {\n if (name in ractive[registryName]) {\n return ractive;\n }\n\n if (ractive.isolated) {\n return null;\n }\n\n ractive = ractive.parent;\n }\n}\n","import { fatal } from 'utils/log';\nimport { missingPlugin } from 'config/errors';\nimport interpolators from '../Ractive/static/interpolators';\nimport { findInViewHierarchy } from './registry';\n\nexport default function interpolate(from, to, ractive, type) {\n if (from === to) return null;\n\n if (type) {\n const interpol = findInViewHierarchy('interpolators', ractive, type);\n if (interpol) return interpol(from, to) || null;\n\n fatal(missingPlugin(type, 'interpolator'));\n }\n\n return (\n interpolators.number(from, to) ||\n interpolators.array(from, to) ||\n interpolators.object(from, to) ||\n null\n );\n}\n","import { isArray, isString, isUndefined } from './is';\n\nexport function addToArray(array, value) {\n const index = array.indexOf(value);\n\n if (index === -1) {\n array.push(value);\n }\n}\n\nexport function arrayContains(array, value) {\n for (let i = 0, c = array.length; i < c; i++) {\n if (array[i] == value) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function arrayContentsMatch(a, b) {\n let i;\n\n if (!isArray(a) || !isArray(b)) {\n return false;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n i = a.length;\n while (i--) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function ensureArray(x) {\n if (isString(x)) {\n return [x];\n }\n\n if (isUndefined(x)) {\n return [];\n }\n\n return x;\n}\n\nexport function lastItem(array) {\n return array[array.length - 1];\n}\n\nexport function removeFromArray(array, member) {\n if (!array) {\n return;\n }\n\n const index = array.indexOf(member);\n\n if (index !== -1) {\n array.splice(index, 1);\n }\n}\n\nexport function combine(...arrays) {\n const res = arrays.concat.apply([], arrays);\n let i = res.length;\n while (i--) {\n const idx = res.indexOf(res[i]);\n if (~idx && idx < i) res.splice(i, 1);\n }\n\n return res;\n}\n\nexport function toArray(arrayLike) {\n const array = [];\n let i = arrayLike.length;\n while (i--) {\n array[i] = arrayLike[i];\n }\n\n return array;\n}\n\nexport function findMap(array, fn) {\n const len = array.length;\n for (let i = 0; i < len; i++) {\n const result = fn(array[i]);\n if (result) return result;\n }\n}\n\nexport function buildNewIndices(one, two, comparator) {\n let oldArray = one;\n let newArray = two;\n if (comparator) {\n oldArray = oldArray.map(comparator);\n newArray = newArray.map(comparator);\n }\n\n const oldLength = oldArray.length;\n\n const usedIndices = {};\n let firstUnusedIndex = 0;\n\n const result = oldArray.map(item => {\n let index;\n let start = firstUnusedIndex;\n\n do {\n index = newArray.indexOf(item, start);\n\n if (index === -1) {\n return -1;\n }\n\n start = index + 1;\n } while (usedIndices[index] === true && start < oldLength);\n\n // keep track of the first unused index, so we don't search\n // the whole of newArray for each item in oldArray unnecessarily\n if (index === firstUnusedIndex) {\n firstUnusedIndex += 1;\n }\n // allow next instance of next \"equal\" to be found item\n usedIndices[index] = true;\n return index;\n });\n\n const len = (result.oldLen = oldArray.length);\n result.newLen = newArray.length;\n\n if (len === result.newLen) {\n let i = 0;\n for (i; i < len; i++) {\n if (result[i] !== i) break;\n }\n\n if (i === len) result.same = true;\n }\n\n return result;\n}\n","export function bind(x) {\n x.bind();\n}\nexport function cancel(x) {\n x.cancel();\n}\nexport function destroyed(x) {\n x.destroyed();\n}\nexport function handleChange(x) {\n x.handleChange();\n}\nexport function mark(x) {\n x.mark();\n}\nexport function markForce(x) {\n x.mark(true);\n}\nexport function marked(x) {\n x.marked();\n}\nexport function markedAll(x) {\n x.markedAll();\n}\nexport function render(x) {\n x.render();\n}\nexport function shuffled(x) {\n x.shuffled();\n}\nexport function teardown(x) {\n x.teardown();\n}\nexport function unbind(x) {\n x.unbind();\n}\nexport function unrender(x) {\n x.unrender();\n}\nexport function unrenderAndDestroy(x) {\n x.unrender(true);\n}\nexport function update(x) {\n x.update();\n}\nexport function toString(x) {\n return x.toString();\n}\nexport function toEscapedString(x) {\n return x.toString(true);\n}\n","import { splitKeypath } from './keypaths';\nimport { isString } from 'utils/is';\n\n// this is the dry method of checking to see if a rebind applies to\n// a particular keypath because in some cases, a dep may be bound\n// directly to a particular keypath e.g. foo.bars.0.baz and need\n// to avoid getting kicked to foo.bars.1.baz if foo.bars is unshifted\nexport function rebindMatch(template, next, previous, fragment) {\n const keypath = template.r || template;\n\n // no valid keypath, go with next\n if (!keypath || !isString(keypath)) return next;\n\n // completely contextual ref, go with next\n if (\n keypath === '.' ||\n keypath[0] === '@' ||\n (next || previous).isKey ||\n (next || previous).isKeypath\n )\n return next;\n\n const parts = keypath.split('/');\n let keys = splitKeypath(parts[parts.length - 1]);\n const last = keys[keys.length - 1];\n\n // check the keypath against the model keypath to see if it matches\n let model = next || previous;\n\n // check to see if this was an alias\n if (model && keys.length === 1 && last !== model.key && fragment) {\n keys = findAlias(last, fragment) || keys;\n }\n\n let i = keys.length;\n let match = true;\n let shuffling = false;\n\n while (model && i--) {\n if (model.shuffling) shuffling = true;\n // non-strict comparison to account for indices in keypaths\n if (keys[i] != model.key) match = false;\n model = model.parent;\n }\n\n // next is undefined, but keypath is shuffling and previous matches\n if (!next && match && shuffling) return previous;\n else if (next && !match && shuffling)\n // next is defined, but doesn't match the keypath\n return previous;\n else return next;\n}\n\nfunction findAlias(name, fragment) {\n while (fragment) {\n const z = fragment.aliases;\n if (z && z[name]) {\n const aliases = (fragment.owner.iterations ? fragment.owner : fragment).owner.template.z;\n for (let i = 0; i < aliases.length; i++) {\n if (aliases[i].n === name) {\n const alias = aliases[i].x;\n if (!alias.r) return false;\n const parts = alias.r.split('/');\n return splitKeypath(parts[parts.length - 1]);\n }\n }\n return;\n }\n\n fragment = fragment.componentParent || fragment.parent;\n }\n}\n","export function fromExpression(body, length = 0) {\n const args = new Array(length);\n\n while (length--) {\n args[length] = `_${length}`;\n }\n\n // Functions created directly with new Function() look like this:\n // function anonymous (_0 /**/) { return _0*2 }\n //\n // With this workaround, we get a little more compact:\n // function (_0){return _0*2}\n return new Function([], `return function (${args.join(',')}){return(${body});};`)();\n}\n","import { BOOLEAN_LITERAL } from '../../../../../config/types';\n\nexport default function readBooleanLiteral(parser) {\n const remaining = parser.remaining();\n\n if (remaining.substr(0, 4) === 'true') {\n parser.pos += 4;\n return {\n t: BOOLEAN_LITERAL,\n v: 'true'\n };\n }\n\n if (remaining.substr(0, 5) === 'false') {\n parser.pos += 5;\n return {\n t: BOOLEAN_LITERAL,\n v: 'false'\n };\n }\n\n return null;\n}\n","import { KEY_VALUE_PAIR, REFERENCE } from 'src/config/types';\nimport readKey from '../../../shared/readKey';\nimport readExpression from '../../../../readExpression';\nimport { name as namePattern, spreadPattern } from '../../../shared/patterns';\n\nexport default function readKeyValuePair(parser) {\n let spread;\n const start = parser.pos;\n\n // allow whitespace between '{' and key\n parser.sp();\n\n const refKey = parser.nextChar() !== \"'\" && parser.nextChar() !== '\"';\n if (refKey) spread = parser.matchPattern(spreadPattern);\n\n const key = spread ? readExpression(parser) : readKey(parser);\n if (key === null) {\n parser.pos = start;\n return null;\n }\n\n // allow whitespace between key and ':'\n parser.sp();\n\n // es2015 shorthand property\n if (refKey && (parser.nextChar() === ',' || parser.nextChar() === '}')) {\n if (!spread && !namePattern.test(key)) {\n parser.error(`Expected a valid reference, but found '${key}' instead.`);\n }\n\n const pair = {\n t: KEY_VALUE_PAIR,\n k: key,\n v: {\n t: REFERENCE,\n n: key\n }\n };\n\n if (spread) {\n pair.p = true;\n }\n\n return pair;\n }\n\n // next character must be ':'\n if (!parser.matchString(':')) {\n parser.pos = start;\n return null;\n }\n\n // allow whitespace between ':' and value\n parser.sp();\n\n // next expression must be a, well... expression\n const value = readExpression(parser);\n if (value === null) {\n parser.pos = start;\n return null;\n }\n\n return {\n t: KEY_VALUE_PAIR,\n k: key,\n v: value\n };\n}\n","import getKeyValuePair from './keyValuePair';\n\nexport default function readKeyValuePairs(parser) {\n const start = parser.pos;\n\n const pair = getKeyValuePair(parser);\n if (pair === null) {\n return null;\n }\n\n const pairs = [pair];\n\n if (parser.matchString(',')) {\n const keyValuePairs = readKeyValuePairs(parser);\n\n if (!keyValuePairs) {\n parser.pos = start;\n return null;\n }\n\n return pairs.concat(keyValuePairs);\n }\n\n return pairs;\n}\n","import { OBJECT_LITERAL } from '../../../../../config/types';\nimport readKeyValuePairs from './objectLiteral/keyValuePairs';\n\nexport default function(parser) {\n const start = parser.pos;\n\n // allow whitespace\n parser.sp();\n\n if (!parser.matchString('{')) {\n parser.pos = start;\n return null;\n }\n\n const keyValuePairs = readKeyValuePairs(parser);\n\n // allow whitespace between final value and '}'\n parser.sp();\n\n if (!parser.matchString('}')) {\n parser.pos = start;\n return null;\n }\n\n return {\n t: OBJECT_LITERAL,\n m: keyValuePairs\n };\n}\n","import { ARRAY_LITERAL } from 'src/config/types';\nimport readExpressionList from '../../shared/readExpressionList';\n\nexport default function(parser) {\n const start = parser.pos;\n\n // allow whitespace before '['\n parser.sp();\n\n if (!parser.matchString('[')) {\n parser.pos = start;\n return null;\n }\n\n const expressionList = readExpressionList(parser, true);\n\n if (!parser.matchString(']')) {\n parser.pos = start;\n return null;\n }\n\n return {\n t: ARRAY_LITERAL,\n m: expressionList\n };\n}\n","import readNumberLiteral from './literal/readNumberLiteral';\nimport readBooleanLiteral from './literal/readBooleanLiteral';\nimport readStringLiteral from './literal/readStringLiteral';\nimport readTemplateStringLiteral from './literal/readTemplateStringLiteral';\nimport readObjectLiteral from './literal/readObjectLiteral';\nimport readArrayLiteral from './literal/readArrayLiteral';\nimport readRegexpLiteral from './literal/readRegexpLiteral';\n\nexport default function readLiteral(parser) {\n return (\n readNumberLiteral(parser) ||\n readBooleanLiteral(parser) ||\n readStringLiteral(parser) ||\n readTemplateStringLiteral(parser) ||\n readObjectLiteral(parser) ||\n readArrayLiteral(parser) ||\n readRegexpLiteral(parser)\n );\n}\n","import { BRACKETED } from 'src/config/types';\nimport { expectedExpression, expectedParen } from '../shared/errors';\nimport readExpression from '../../readExpression';\n\nexport default function readBracketedExpression(parser) {\n if (!parser.matchString('(')) return null;\n\n parser.sp();\n\n const expr = readExpression(parser);\n\n if (!expr) parser.error(expectedExpression);\n\n parser.sp();\n\n if (!parser.matchString(')')) parser.error(expectedParen);\n\n return {\n t: BRACKETED,\n x: expr\n };\n}\n","import readLiteral from './primary/readLiteral';\nimport readReference from './primary/readReference';\nimport readBracketedExpression from './primary/readBracketedExpression';\n\nexport default function(parser) {\n return readLiteral(parser) || readReference(parser) || readBracketedExpression(parser);\n}\n","import { REFINEMENT } from 'config/types';\nimport { expectedExpression } from './errors';\nimport { name as namePattern } from './patterns';\nimport readExpression from '../../readExpression';\n\nexport default function readRefinement(parser) {\n // some things call for strict refinement (partial names), meaning no space between reference and refinement\n if (!parser.strictRefinement) {\n parser.sp();\n }\n\n // \".\" name\n if (parser.matchString('.')) {\n parser.sp();\n\n const name = parser.matchPattern(namePattern);\n if (name) {\n return {\n t: REFINEMENT,\n n: name\n };\n }\n\n parser.error('Expected a property name');\n }\n\n // \"[\" expression \"]\"\n if (parser.matchString('[')) {\n parser.sp();\n\n const expr = readExpression(parser);\n if (!expr) parser.error(expectedExpression);\n\n parser.sp();\n\n if (!parser.matchString(']')) parser.error(`Expected ']'`);\n\n return {\n t: REFINEMENT,\n x: expr\n };\n }\n\n return null;\n}\n","import { MEMBER, INVOCATION } from 'config/types';\nimport readPrimary from './readPrimary';\nimport readExpressionList from './shared/readExpressionList';\nimport readRefinement from './shared/readRefinement';\nimport { expectedParen } from './shared/errors';\n\nexport default function(parser) {\n let expression = readPrimary(parser);\n\n if (!expression) return null;\n\n while (expression) {\n const refinement = readRefinement(parser);\n if (refinement) {\n expression = {\n t: MEMBER,\n x: expression,\n r: refinement\n };\n } else if (parser.matchString('(')) {\n parser.sp();\n const expressionList = readExpressionList(parser, true);\n\n parser.sp();\n\n if (!parser.matchString(')')) {\n parser.error(expectedParen);\n }\n\n expression = {\n t: INVOCATION,\n x: expression\n };\n\n if (expressionList) expression.o = expressionList;\n } else {\n break;\n }\n }\n\n return expression;\n}\n","import { CONDITIONAL } from 'config/types';\nimport readLogicalOr from './readLogicalOr';\nimport { expectedExpression } from './shared/errors';\nimport readExpression from '../readExpression';\n\n// The conditional operator is the lowest precedence operator, so we start here\nexport default function getConditional(parser) {\n const expression = readLogicalOr(parser);\n if (!expression) {\n return null;\n }\n\n const start = parser.pos;\n\n parser.sp();\n\n if (!parser.matchString('?')) {\n parser.pos = start;\n return expression;\n }\n\n parser.sp();\n\n const ifTrue = readExpression(parser);\n if (!ifTrue) {\n parser.error(expectedExpression);\n }\n\n parser.sp();\n\n if (!parser.matchString(':')) {\n parser.error('Expected \":\"');\n }\n\n parser.sp();\n\n const ifFalse = readExpression(parser);\n if (!ifFalse) {\n parser.error(expectedExpression);\n }\n\n return {\n t: CONDITIONAL,\n o: [expression, ifTrue, ifFalse]\n };\n}\n","import readConditional from './expressions/readConditional';\nimport readReference from './expressions/primary/readReference';\n\nexport default function readExpression(parser) {\n // if eval is false, no expressions\n if (parser.allowExpressions === false) {\n const ref = readReference(parser);\n parser.sp();\n return ref;\n }\n\n // The conditional operator is the lowest precedence operator (except yield,\n // assignment operators, and commas, none of which are supported), so we\n // start there. If it doesn't match, it 'falls through' to progressively\n // higher precedence operators, until it eventually matches (or fails to\n // match) a 'primary' - a literal or a reference. This way, the abstract syntax\n // tree has everything in its proper place, i.e. 2 + 3 * 4 === 14, not 20.\n return readConditional(parser);\n}\n","import { expectedExpression } from './errors';\nimport readExpression from '../../readExpression';\nimport { spreadPattern } from './patterns';\n\nexport default function readExpressionList(parser, spread) {\n let isSpread;\n const expressions = [];\n\n const pos = parser.pos;\n\n do {\n parser.sp();\n\n if (spread) {\n isSpread = parser.matchPattern(spreadPattern);\n }\n\n const expr = readExpression(parser);\n\n if (expr === null && expressions.length) {\n parser.error(expectedExpression);\n } else if (expr === null) {\n parser.pos = pos;\n return null;\n }\n\n if (isSpread) {\n expr.p = true;\n }\n\n expressions.push(expr);\n\n parser.sp();\n } while (parser.matchString(','));\n\n return expressions;\n}\n","import { REFERENCE } from 'config/types';\nimport readExpression from './readExpression';\nimport readReference from './expressions/primary/readReference';\n\nexport default function readExpressionOrReference(parser, expectedFollowers) {\n const start = parser.pos;\n const expression = readExpression(parser);\n\n if (!expression) {\n // valid reference but invalid expression e.g. `{{new}}`?\n const ref = parser.matchPattern(/^(\\w+)/);\n if (ref) {\n return {\n t: REFERENCE,\n n: ref\n };\n }\n\n return null;\n }\n\n for (let i = 0; i < expectedFollowers.length; i += 1) {\n if (parser.remaining().substr(0, expectedFollowers[i].length) === expectedFollowers[i]) {\n return expression;\n }\n }\n\n parser.pos = start;\n return readReference(parser);\n}\n","import {\n REFERENCE,\n BOOLEAN_LITERAL,\n GLOBAL,\n NUMBER_LITERAL,\n REGEXP_LITERAL,\n STRING_LITERAL,\n ARRAY_LITERAL,\n OBJECT_LITERAL,\n KEY_VALUE_PAIR,\n PREFIX_OPERATOR,\n INFIX_OPERATOR,\n INVOCATION,\n BRACKETED,\n MEMBER,\n REFINEMENT,\n CONDITIONAL\n} from 'config/types';\nimport { isObject, isString } from 'utils/is';\n\nexport default function flattenExpression(expression) {\n let refs;\n let count = 0;\n\n extractRefs(expression, (refs = []));\n const stringified = stringify(expression);\n\n return {\n r: refs,\n s: getVars(stringified)\n };\n\n function getVars(expr) {\n const vars = [];\n for (let i = count - 1; i >= 0; i--) {\n vars.push(`x$${i}`);\n }\n return vars.length ? `(function(){var ${vars.join(',')};return(${expr});})()` : expr;\n }\n\n function stringify(node) {\n if (isString(node)) {\n return node;\n }\n\n switch (node.t) {\n case BOOLEAN_LITERAL:\n case GLOBAL:\n case NUMBER_LITERAL:\n case REGEXP_LITERAL:\n return node.v;\n\n case STRING_LITERAL:\n return JSON.stringify(String(node.v));\n\n case ARRAY_LITERAL:\n if (node.m && hasSpread(node.m)) {\n return `[].concat(${makeSpread(node.m, '[', ']', stringify)})`;\n } else {\n return '[' + (node.m ? node.m.map(stringify).join(',') : '') + ']';\n }\n\n case OBJECT_LITERAL:\n if (node.m && hasSpread(node.m)) {\n return `Object.assign({},${makeSpread(node.m, '{', '}', stringifyPair)})`;\n } else {\n return '{' + (node.m ? node.m.map(n => `${n.k}:${stringify(n.v)}`).join(',') : '') + '}';\n }\n\n case PREFIX_OPERATOR:\n return (node.s === 'typeof' ? 'typeof ' : node.s) + stringify(node.o);\n\n case INFIX_OPERATOR:\n return (\n stringify(node.o[0]) +\n (node.s.substr(0, 2) === 'in' ? ' ' + node.s + ' ' : node.s) +\n stringify(node.o[1])\n );\n\n case INVOCATION:\n if (node.o && hasSpread(node.o)) {\n const id = count++;\n return `(x$${id}=${stringify(node.x)}).apply(x$${id},${stringify({\n t: ARRAY_LITERAL,\n m: node.o\n })})`;\n } else {\n return stringify(node.x) + '(' + (node.o ? node.o.map(stringify).join(',') : '') + ')';\n }\n\n case BRACKETED:\n return '(' + stringify(node.x) + ')';\n\n case MEMBER:\n return stringify(node.x) + stringify(node.r);\n\n case REFINEMENT:\n return node.n ? '.' + node.n : '[' + stringify(node.x) + ']';\n\n case CONDITIONAL:\n return stringify(node.o[0]) + '?' + stringify(node.o[1]) + ':' + stringify(node.o[2]);\n\n case REFERENCE:\n return '_' + refs.indexOf(node.n);\n\n default:\n throw new Error('Expected legal JavaScript');\n }\n }\n\n function stringifyPair(node) {\n return node.p ? stringify(node.k) : `${node.k}:${stringify(node.v)}`;\n }\n\n function makeSpread(list, open, close, fn) {\n const out = list.reduce(\n (a, c) => {\n if (c.p) {\n a.str += `${a.open ? close + ',' : a.str.length ? ',' : ''}${fn(c)}`;\n } else {\n a.str += `${!a.str.length ? open : !a.open ? ',' + open : ','}${fn(c)}`;\n }\n a.open = !c.p;\n return a;\n },\n { open: false, str: '' }\n );\n if (out.open) out.str += close;\n return out.str;\n }\n}\n\nfunction hasSpread(list) {\n for (let i = 0; i < list.length; i++) {\n if (list[i].p) return true;\n }\n\n return false;\n}\n\n// TODO maybe refactor this?\nfunction extractRefs(node, refs) {\n if (node.t === REFERENCE && isString(node.n)) {\n if (!~refs.indexOf(node.n)) {\n refs.unshift(node.n);\n }\n }\n\n const list = node.o || node.m;\n if (list) {\n if (isObject(list)) {\n extractRefs(list, refs);\n } else {\n let i = list.length;\n while (i--) {\n extractRefs(list[i], refs);\n }\n }\n }\n\n if (node.k && node.t === KEY_VALUE_PAIR && !isString(node.k)) {\n extractRefs(node.k, refs);\n }\n\n if (node.x) {\n extractRefs(node.x, refs);\n }\n\n if (node.r) {\n extractRefs(node.r, refs);\n }\n\n if (node.v) {\n extractRefs(node.v, refs);\n }\n}\n","import { REFERENCE, BRACKETED, MEMBER, REFINEMENT } from 'config/types';\nimport flattenExpression from './flattenExpression';\n\nexport default function refineExpression(expression, mustache) {\n let referenceExpression;\n\n if (expression) {\n while (expression.t === BRACKETED && expression.x) {\n expression = expression.x;\n }\n\n if (expression.t === REFERENCE) {\n const n = expression.n;\n if (!~n.indexOf('@context')) {\n mustache.r = expression.n;\n } else {\n mustache.x = flattenExpression(expression);\n }\n } else {\n if ((referenceExpression = getReferenceExpression(expression))) {\n mustache.rx = referenceExpression;\n } else {\n mustache.x = flattenExpression(expression);\n }\n }\n\n return mustache;\n }\n}\n\n// TODO refactor this! it's bewildering\nfunction getReferenceExpression(expression) {\n const members = [];\n let refinement;\n\n while (expression.t === MEMBER && expression.r.t === REFINEMENT) {\n refinement = expression.r;\n\n if (refinement.x) {\n if (refinement.x.t === REFERENCE) {\n members.unshift(refinement.x);\n } else {\n members.unshift(flattenExpression(refinement.x));\n }\n } else {\n members.unshift(refinement.n);\n }\n\n expression = expression.x;\n }\n\n if (expression.t !== REFERENCE) {\n return null;\n }\n\n return {\n r: expression.n,\n m: members\n };\n}\n","import { TRIPLE } from 'config/types';\nimport readExpression from '../readExpression';\nimport refineExpression from 'parse/utils/refineExpression';\n\nexport default function readTriple(parser, tag) {\n const expression = readExpression(parser);\n\n if (!expression) {\n return null;\n }\n\n if (!parser.matchString(tag.close)) {\n parser.error(`Expected closing delimiter '${tag.close}'`);\n }\n\n const triple = { t: TRIPLE };\n refineExpression(expression, triple); // TODO handle this differently - it's mysterious\n\n return triple;\n}\n","import { TRIPLE } from 'config/types';\nimport readExpression from '../readExpression';\nimport refineExpression from 'parse/utils/refineExpression';\n\nexport default function readUnescaped(parser, tag) {\n if (!parser.matchString('&')) {\n return null;\n }\n\n parser.sp();\n\n const expression = readExpression(parser);\n\n if (!expression) {\n return null;\n }\n\n if (!parser.matchString(tag.close)) {\n parser.error(`Expected closing delimiter '${tag.close}'`);\n }\n\n const triple = { t: TRIPLE };\n refineExpression(expression, triple); // TODO handle this differently - it's mysterious\n\n return triple;\n}\n","import { PARTIAL, YIELDER } from 'src/config/types';\nimport readExpression from '../readExpression';\nimport refineExpression from 'parse/utils/refineExpression';\nimport { readAliases } from './readAliases';\n\nexport default function readPartial(parser, tag) {\n const type = parser.matchString('>') || parser.matchString('yield');\n const partial = { t: type === '>' ? PARTIAL : YIELDER };\n let aliases;\n\n if (!type) return null;\n\n parser.sp();\n\n if (type === '>' || !(aliases = parser.matchString('with'))) {\n // Partial names can include hyphens, so we can't use readExpression\n // blindly. Instead, we use the `relaxedNames` flag to indicate that\n // `foo-bar` should be read as a single name, rather than 'subtract\n // bar from foo'\n parser.relaxedNames = parser.strictRefinement = true;\n const expression = readExpression(parser);\n parser.relaxedNames = parser.strictRefinement = false;\n\n if (!expression && type === '>') return null;\n\n if (expression) {\n refineExpression(expression, partial); // TODO...\n parser.sp();\n if (type !== '>') aliases = parser.matchString('with');\n }\n }\n\n parser.sp();\n\n // check for alias context e.g. `{{>foo bar as bat, bip as bop}}`\n if (aliases || type === '>') {\n aliases = readAliases(parser);\n if (aliases && aliases.length) {\n partial.z = aliases;\n } else {\n // otherwise check for literal context e.g. `{{>foo bar}}` then\n // turn it into `{{#with bar}}{{>foo}}{{/with}}`\n const context = readExpression(parser);\n if (context) {\n partial.c = {};\n refineExpression(context, partial.c);\n }\n\n // allow aliases after context\n if (parser.matchString(',')) {\n aliases = readAliases(parser);\n if (aliases && aliases.length) {\n partial.z = aliases;\n }\n }\n }\n\n if (type !== '>' && (!partial.c && !partial.z)) {\n // {{yield with}} requires some aliases\n parser.error(`Expected a context or one or more aliases`);\n }\n }\n\n parser.sp();\n\n if (!parser.matchString(tag.close)) {\n parser.error(`Expected closing delimiter '${tag.close}'`);\n }\n\n return partial;\n}\n","import { COMMENT } from 'src/config/types';\n\nexport default function readComment(parser, tag) {\n if (!parser.matchString('!')) {\n return null;\n }\n\n const index = parser.remaining().indexOf(tag.close);\n\n if (index !== -1) {\n parser.pos += index + tag.close.length;\n return { t: COMMENT };\n }\n}\n","import { INTERPOLATOR } from 'config/types';\nimport readExpressionOrReference from '../readExpressionOrReference';\nimport refineExpression from 'parse/utils/refineExpression';\n\nexport default function readInterpolator(parser, tag) {\n let expression, err;\n\n const start = parser.pos;\n\n // TODO would be good for perf if we could do away with the try-catch\n try {\n expression = readExpressionOrReference(parser, [tag.close]);\n } catch (e) {\n err = e;\n }\n\n if (!expression) {\n if (parser.str.charAt(start) === '!') {\n // special case - comment\n parser.pos = start;\n return null;\n }\n\n if (err) {\n throw err;\n }\n }\n\n if (!parser.matchString(tag.close)) {\n parser.error(`Expected closing delimiter '${tag.close}' after reference`);\n\n if (!expression) {\n // special case - comment\n if (parser.nextChar() === '!') {\n return null;\n }\n\n parser.error(`Expected expression or legal reference`);\n }\n }\n\n const interpolator = { t: INTERPOLATOR };\n refineExpression(expression, interpolator); // TODO handle this differently - it's mysterious\n\n return interpolator;\n}\n","import { CLOSING } from 'config/types';\n\nexport default function readClosing(parser, tag) {\n const start = parser.pos;\n\n if (!parser.matchString(tag.open)) {\n return null;\n }\n\n parser.sp();\n\n if (!parser.matchString('/')) {\n parser.pos = start;\n return null;\n }\n\n parser.sp();\n\n const remaining = parser.remaining();\n const index = remaining.indexOf(tag.close);\n\n if (index !== -1) {\n const closing = {\n t: CLOSING,\n r: remaining.substr(0, index).split(' ')[0]\n };\n\n parser.pos += index;\n\n if (!parser.matchString(tag.close)) {\n parser.error(`Expected closing delimiter '${tag.close}'`);\n }\n\n return closing;\n }\n\n parser.pos = start;\n return null;\n}\n","import { lastItem } from 'utils/array';\nimport { isString } from 'utils/is';\n\nexport default function(items, leadingPattern, trailingPattern) {\n let item;\n\n if (leadingPattern) {\n item = items[0];\n if (isString(item)) {\n item = item.replace(leadingPattern, '');\n\n if (!item) {\n items.shift();\n } else {\n items[0] = item;\n }\n }\n }\n\n if (trailingPattern) {\n item = lastItem(items);\n if (isString(item)) {\n item = item.replace(trailingPattern, '');\n\n if (!item) {\n items.pop();\n } else {\n items[items.length - 1] = item;\n }\n }\n }\n}\n","export default function(camelCaseStr) {\n return camelCaseStr.replace(/([A-Z])/g, (match, $1) => {\n return '-' + $1.toLowerCase();\n });\n}\n","import getLowestIndex from './utils/getLowestIndex';\nimport { decodeCharacterReferences } from 'utils/html';\n\nexport default function readText(parser) {\n let index, disallowed, barrier;\n\n const remaining = parser.remaining();\n\n if (parser.textOnlyMode) {\n disallowed = parser.tags.map(t => t.open);\n disallowed = disallowed.concat(parser.tags.map(t => '\\\\' + t.open));\n\n index = getLowestIndex(remaining, disallowed);\n } else {\n barrier = parser.inside ? '</' + parser.inside : '<';\n\n if (parser.inside && !parser.interpolate[parser.inside]) {\n index = remaining.indexOf(barrier);\n } else {\n disallowed = parser.tags.map(t => t.open);\n disallowed = disallowed.concat(parser.tags.map(t => '\\\\' + t.open));\n\n // http://developers.whatwg.org/syntax.html#syntax-attributes\n if (parser.inAttribute === true) {\n // we're inside an unquoted attribute value\n disallowed.push(`\"`, `'`, `=`, `<`, `>`, '`');\n } else if (parser.inAttribute) {\n // quoted attribute value\n disallowed.push(parser.inAttribute);\n } else {\n disallowed.push(barrier);\n }\n\n index = getLowestIndex(remaining, disallowed);\n }\n }\n\n if (!index) {\n return null;\n }\n\n if (index === -1) {\n index = remaining.length;\n }\n\n parser.pos += index;\n\n if ((parser.inside && parser.inside !== 'textarea') || parser.textOnlyMode) {\n return remaining.substr(0, index);\n } else {\n return decodeCharacterReferences(remaining.substr(0, index));\n }\n}\n","import { TEMPLATE_VERSION } from 'config/template';\nimport { READERS, PARTIAL_READERS } from 'parse/_parse';\nimport cleanup from 'parse/utils/cleanup';\nimport { create } from 'utils/object';\n\nexport default function readTemplate(parser) {\n const fragment = [];\n const partials = create(null);\n let hasPartials = false;\n\n const preserveWhitespace = parser.preserveWhitespace;\n\n while (parser.pos < parser.str.length) {\n const pos = parser.pos;\n let item, partial;\n\n if ((partial = parser.read(PARTIAL_READERS))) {\n if (partials[partial.n]) {\n parser.pos = pos;\n parser.error('Duplicated partial definition');\n }\n\n cleanup(\n partial.f,\n parser.stripComments,\n preserveWhitespace,\n !preserveWhitespace,\n !preserveWhitespace,\n parser.whiteSpaceElements\n );\n\n partials[partial.n] = partial.f;\n hasPartials = true;\n } else if ((item = parser.read(READERS))) {\n fragment.push(item);\n } else {\n parser.error('Unexpected template content');\n }\n }\n\n const result = {\n v: TEMPLATE_VERSION,\n t: fragment\n };\n\n if (hasPartials) {\n result.p = partials;\n }\n\n return result;\n}\n","import { fromExpression } from './createFunction';\nimport { isArray, isObject } from 'utils/is';\nimport { keys } from 'utils/object';\n\nexport default function insertExpressions(obj, expr) {\n keys(obj).forEach(key => {\n if (isExpression(key, obj)) return addTo(obj, expr);\n\n const ref = obj[key];\n if (hasChildren(ref)) insertExpressions(ref, expr);\n });\n}\n\nfunction isExpression(key, obj) {\n return key === 's' && isArray(obj.r);\n}\n\nfunction addTo(obj, expr) {\n const { s, r } = obj;\n if (!expr[s]) expr[s] = fromExpression(s, r.length);\n}\n\nfunction hasChildren(ref) {\n return isArray(ref) || isObject(ref);\n}\n","import { fatal } from 'utils/log';\nimport bind from 'utils/bind';\nimport { createFunctionFromString } from '../config/runtime-parser';\nimport { isFunction, isString, isObjectType } from 'utils/is';\n\nexport default function getComputationSignature(ractive, key, signature) {\n let getter;\n let setter;\n\n // useful for debugging\n let getterString;\n let getterUseStack;\n let setterString;\n\n if (isFunction(signature)) {\n getter = bind(signature, ractive);\n getterString = signature.toString();\n getterUseStack = true;\n }\n\n if (isString(signature)) {\n getter = createFunctionFromString(signature, ractive);\n getterString = signature;\n }\n\n if (isObjectType(signature)) {\n if (isString(signature.get)) {\n getter = createFunctionFromString(signature.get, ractive);\n getterString = signature.get;\n } else if (isFunction(signature.get)) {\n getter = bind(signature.get, ractive);\n getterString = signature.get.toString();\n getterUseStack = true;\n } else {\n fatal('`%s` computation must have a `get()` method', key);\n }\n\n if (isFunction(signature.set)) {\n setter = bind(signature.set, ractive);\n setterString = signature.set.toString();\n }\n }\n\n return {\n getter,\n setter,\n getterString,\n setterString,\n getterUseStack\n };\n}\n"],"names":["Fragment__proto__","getKey","this","keyModel","KeyModel","key","getIndex","idxModel","index","rebind","next","context","rootModel","pathModel","rebound","update","owner","template","z","aliases","const","k","unreference","resolveAliases","containerFragment","parent","items","forEach","x","applyValue","getKeypath","ractive","root","render","target","occupants","rendered","Error","let","xs","len","length","i","resetTemplate","wasBound","bound","wasRendered","unrender","unbind","createItems","bind","parentNode","findParentNode","anchor","findNextNode","docFrag","createDocumentFragment","insertBefore","shuffled","toString","escape","map","toEscapedString","join","view","yielder","this$1","shouldDestroy","dirty","updating","isRoot","runloop","addFragmentToRoot","valueOf","dirtyValue","values","source","processItems","_guid","parsed","parseJSON","value","Fragment","prototype","getContext","shouldRerender","reverse","makeArrayMethod","path","shift","sort","splice","unshift","proto","add","animate","attachChild","compute","detach","detachChild","find","findAll","findAllComponents","findComponent","findContainer","findParent","fire","get","getLocalContext","insert","link","observe","observeOnce","off","on","once","pop","push","readLink","reset","resetPartial","set","subtract","teardown","toggle","toCSS","toCss","toHTML","toHtml","toText","transition","unlink","updateModel","use","styles","callsSuper","defineProperties","Ractive","sharedGet","sharedSet","styleGet","configurable","styleSet","addCSS","addStyle","hasCSS","hasStyle","win","opts","script","document","currentScript","querySelector","getAttribute","indexOf","warn","assign","defaults","constructor","shared","DEBUG","writable","DEBUG_PROMISES","extend","extendWith","escapeKey","evalObjectString","findPlugin","getCSS","isInstance","joinKeys","macro","normaliseKeypath","normalise","parse","splitKeypath","unescapeKey","enhance","svg","tick","batch","promise","VERSION","adaptors","components","decorators","easing","events","extensions","helpers","interpolators","partials","transitions","cssData","perComponentStyleElements","splitTag","sharedData","Context","extern","defineProperty","CSSModel","fragment","options","up","element","findElement","attributeByName","name","f","Mapping__proto__","Mapping","viewmodel","instance","joinKey","isString","isArray","createMapping","boundFragment","model","resolve","joinAll","mapping","unregister","Item","Option","Element","a","isUndefined","super","select","Option__proto__","selectedAttribute","selected","undefined","attributes","bubble","node","_ractive","attribute","getValue","isSelected","optionValue","selectValue","compare","removeFromArray","Partial","create","MustacheContainer","container","component","r","rx","refName","fn","partialFromValue","partial","call","warnOnceIfDebug","createFragment","initMacro","handleChange","dirtyTemplate","externalChange","_attrs","keys","refreshAttrs","handle","proxy","last","fnTemplate","isFunction","getPartialTemplate","contextifyTemplate","unbindAttrs","scheduleTask","_cssDef","applied","applyCSS","dirtyAttrs","invalidate","extras","isReadonly","isKey","deps","links","children","KeyModel__proto__","c","destroyed","upstream","unregisterChild","shouldCapture","capture","has","previous","relinking","register","dependant","registerChild","child","addToArray","registerLink","unregisterLink","reference","noop","keypathString","RepeatedFragment","delegate","findDelegate","cssIds","iterations","indexRef","keyRef","pendingNewIndices","previousIterations","RepeatedFragment__proto__","slice","shuffler","n","s","test","shuffleValues","isComputed","max","createIteration","isObject","refs","split","ks","bubbled","rebounding","isIteration","swizzleFragment","appendChild","selector","findMap","findContext","iteration","firstNode","skipParent","getLast","lastModel","contextFor","shuffle","newIndices","merge","newIndex","oldIndex","shouldRebind","updatePostShuffle","buildNewIndices","same","toRemove","oldKeys","wasArray","lastValue","i$1","newLength","updateLast","fragment$1","nextNode","indices","idx","dest","pos","prev","iters","stash","Array","e","isObjectType","plen","Section","isAlias","t","ALIAS","sectionType","SECTION_WITH","templateSectionType","subordinate","l","Section__proto__","sibling","nextSibling","SECTION_UNLESS","isTruthy","frag","detached","SECTION_IF_WITH","isEmpty","safe","SECTION_IF","SECTION_EACH","siblingFalsey","lastType","getType","newFragment","fragmentShouldExist","attach","keep","then","Select","Select__proto__","foundNode","binding","selectedOptions","getSelectedOptions","sync","defaultSelected","selectNode","toArray","o","setFromNode","isMultiple","array","optionWasSelected","shouldSelect","valueContains","forceUpdate","comparator","Textarea","Input","deferContent","isBindable","createItem","ATTRIBUTE","Textarea__proto__","Text","type","TEXT","Text__proto__","detachNode","inAttributes","progressiveText","escapeHtml","visible","hidden","doc","prefix","vendors","vendor","addEventListener","onChange","onHide","onShow","isClient","prefixCache","testStyle","createElement","style","prop","hyphenateCamel","createTransitions","prefix$1","vendorPattern","RegExp","TRANSITION","TRANSITIONEND","CSS_TRANSITIONS_ENABLED","TRANSITION_DURATION","TRANSITION_PROPERTY","TRANSITION_TIMING_FUNCTION","linear","canUseCssTransitions","cannotUseCssTransitions","webkitTransition","to","changedProperties","setTimeout","transitionDone","clearTimeout","cssTimeout","checkComplete","jsTransitionsComplete","cssTransitionsComplete","unregisterCompleteHandler","isIntro","transitionEndHandler","event","propertyName","cssTransitionsDone","property","duration","timing","removeEventListener","hashPrefix","namespaceURI","tagName","delay","registerCompleteHandler","easingName","hyphenate","cssTiming","hash","suffix","interpolator","originalValue","propertiesToTransitionInJs","initial","getStyle","warnIfDebug","exec","interpolate","parseFloat","missingPlugin","Ticker","step","complete","createTransitions$1","getComputedStyle","resolved","Promise","names","t0","t1","t2","Transition","onComplete","Transition__proto__","animateStyle","arguments","setStyle","fulfil","propertyNames","computedStyle","current","init","originals","targets","v","intro","outro","eventName","params","_fn","findInViewHierarchy","setupArgsFn","getParams","resolveArgs","apply","props","processParams","isNumber","hasOwn","shouldFire","transitionsEnabled","rendering","nearestProp","unrendering","nested","el","starting","start","completed","args","noReset","_manager","remove","concat","unbinding","ieBug","ieBlacklist","elementCache","innerHTML","err","TABLE","THEAD","TBODY","TR","SELECT","Triple","Mustache","Triple__proto__","nodes","nodeType","matches","queryResult","result","queryAllResult","querySelectorAll","html","insertHtml","outerHTML","nodeValue","removeChild","inAttribute","decodeCharacterReferences","detachWhenReady","constructors","ANCHOR","Component","AWAIT","Await","DOCTYPE","Doctype","INTERPOLATOR","Interpolator","PARTIAL","SECTION","TRIPLE","YIELDER","Attribute","BINDING_FLAG","BindingFlag","DECORATOR","Decorator","EVENT","EventDirective","COMMENT","Comment","specialElements","doctype","form","Form","input","option","textarea","componentParent","addFragment","base","findParentWithContext","item","it","ELEMENT","ExpressionProxy__proto__","ExpressionProxy","actuallyChanged","keypath","replace","match","models","startCapturing","m","message","dependencies","stopCapturing","filter","d","notifyUpstream","rebindMatch","addShuffleRegister","ref","resolveReference","retrieve","collect","dep","Model","computation","Computation","mark","missingDecorator","Decorator__proto__","warnOnce","localFragment","teardownArgsFn","Doctype__proto__","Binding","twowayBinding","setRoot","isTwoway","wasUndefined","getInitialValue","lastVal","parentForm","resetValue","formBindings","Binding__proto__","registerTwowayBinding","locked","end","setting","unregisterTwowayBinding","CheckboxBinding","CheckboxBinding__proto__","handleDomEvent","attachEvent","checked","BindingGroup","bindings","BindingGroup__proto__","b","CheckboxNameBinding","checkboxName","group","getBindingGroup","noInitialValue","existingValue","bindingValue","arrayContains","CheckboxNameBinding__proto__","isChecked","mval","valueSoFar","ContentEditableBinding","ContentEditableBinding__proto__","lazy","GenericBinding","GenericBinding__proto__","timeout","isNumeric","handler","handleDelay","handleBlur","FileBinding","FileBinding__proto__","files","MultipleSelectBinding","MultipleSelectBinding__proto__","selectedValues","previousValue","arrayContentsMatch","NumericBinding","NumericBinding__proto__","isNaN","siblings","RadioBinding","getSiblings","RadioBinding__proto__","RadioNameBinding","pathChanged","updateName","RadioNameBinding__proto__","SingleSelectBinding","SingleSelectBinding__proto__","disabled","endsWithSemi","ContainerItem","toLowerCase","attrs","attr","val","cls","leftovers","g","statics","DELEGATE_FLAG","ConditionalAttribute","Element__proto__","recreateTwowayBinding","createTwowayBinding","twoway","selectBinding","assigns","ctx","callback","listeners","delegateHandler","rem","namespace","getNamespace","existing","nodeName","toUpperCase","setAttribute","isOutro","registerTransition","childNodes","removeAttribute","ls","stringifyAttribute","safeAttributeString","inputIsCheckedRadio","getString","inlineClass","str","voidElements","stop","immediate","prevent","UIEvent","Form__proto__","handleReset","DOMEvent","fatal","DOMEvent__proto__","directive","original","CustomEvent","eventPlugin","CustomEvent__proto__","RactiveEvent","RactiveEvent__proto__","cancel","specialPattern","dollarArgsPattern","EventDirective__proto__","COMPONENT","rs","getFunction","action","refire","specialRef","specialMatch","special","substr","dollarMatch","obj","which","wrapper","wrapperValue","oldEvent","returned","preventDefault","stopPropagation","fireEvent","ReferenceExpressionProxy","LinkModel","rootLink","ReferenceExpressionProxy__proto__","members","Missing","addShuffleTask","tpl","REFERENCE","reduce","list","String","fireShuffleTasks","refreshPathDeps","eproto","isStatic","Mustache__proto__","pre","y","Object","Interpolator__proto__","safeToStringValue","string","data","Input__proto__","defaultValue","attrValue","specials","true","false","null","specialsPattern","numberPattern","placeholderPattern","placeholderAtStartPattern","onlyWhitespace","JsonParser","Parser","sp","postProcess","leftover","converters","parser","placeholder","matchPattern","number","stringLiteral","readStringLiteral","$1","matchString","pair","getKeyValuePair","valueToken","read","Context__proto__","findModel","protoAnimate","getParent","hasListener","findEvent","there","here","listen","modelPop","modelPush","raise","ev","modelReverse","build","modelShift","drop","modelSplice","modelSort","num","_link","unlisten","modelUnshift","protoUpdate","cascade","updateFromBindings","isBound","getBindingModel","getBindingPath","getBinding","setBinding","prototypeAccessors","forRactive","getRactiveContext","div","methodNames","unprefixed","prefixed","j","makeFunction","query","mathml","xlink","xml","xmlns","namespaces","customStr","ns","is","createElementNS","wrap","methodName","substring","cloneNode","Observer","old","oldContext","oldFn","dispatch","updateOld","Observer__proto__","cancelled","resolver","_observers","newValue","oldValue","isEqual","strict","addObserver","defer","star","PatternObserver","baseModel","pattern","baseKeypath","recursive","oldValues","newValues","changed","cache","findMatches","registerPatternObserver","PatternObserver__proto__","unregisterPatternObserver","wildcards","notify","touchedFrom","count","isLink","ok","check","ArrayObserver","pending","sliced","ArrayObserver__proto__","negativeOne","inserted","deleted","hadIndex","onceOptions","trim","notEmptyString","PREFIX","styleDefinitions","isDirty","styleElement","useCssText","_splitTag","adaptConfigurator","Parent","adapt","combine","ensureArray","selectorsPattern","importPattern","importEndPattern","keyframesDeclarationPattern","selectorUnitPattern","excludePattern","dataRvcGuidPattern","SharedModel","CSSModel__proto__","downstreamChanged","depth","_cssModel","applyChanges","hasCurly","cssConfigurator","Child","_cssIds","gatherIds","css","initCSS","dataConfigurator","_r_unbound","templateConfigurator","parseTemplate","TEMPLATE_VERSION","getDynamicTemplate","_config","p","extendPartials","registryNames","registriesOnDefaults","Registry","useDefaults","Registry__proto__","configure","registry","addFunctions","isOwner","registries","putInDefaults","config","order","custom","computed","defaultKeys","isStandardKey","makeObj","isBlacklisted","_super","Item__proto__","ContainerItem__proto__","space","textTypes","accept-charset","accesskey","bgcolor","class","codebase","colspan","contenteditable","datetime","dirname","for","http-equiv","ismap","maxlength","novalidate","pubdate","readonly","rowspan","tabindex","usemap","ConditionalAttribute__proto__","isSvg","parseAttributes","notIn","updateDelegate","Attribute__proto__","booleanAttributes","useProperty","isBoolean","lookupNamespace","getUpdateDelegate","flag","bubbler","BindingFlag__proto__","createComment","RactiveModel","RactiveModel__proto__","initLink","specialModels","@this","getRactiveModel","@global","GlobalModel","@shared","@style","@helpers","getHelpers","RootModel","RootModel__proto__","attached","attachImplicits","createLink","targetPath","childByKey","detachImplicits","virtual","getVirtual","SharedBase","ractiveModel","getValueChildren","unescapedKey","shouldTeardown","protoRegistries","uid","ComponentConstructor","isAnchor","content","_partials","addChild","construct","mappings","_inlinePartials","eventHandlers","Component__proto__","initialise","checking","checkAnchors","callRender","isolated","unrenderItem","ComputationChild","syncComputedChildren","prototypeAccessors$1","ComputationChild__proto__","parentValue","newWrapperValue","unwrap","boundValue","marked","signature","setter","prototypeAccessors$2","Computation__proto__","active","maybeBind","shouldBind","noVirtual","getter","hasConsole","console","groupCollapsed","sig","error","getterUseStack","stack","groupEnd","setDependencies","allowExpressions","welcome","WELCOME_MESSAGE","welcomeMessage","hasGroup","welcomeIntro","log","printWarning","badArguments","noRegistryFunctionReturn","from","delta","intermediate","Math","min","object","properties","loop","refPattern","splitPattern","escapeKeyPattern","unescapeKeyPattern","fnBind","Function","shuffleTasks","early","registerQueue","ModelBase","ModelBase__proto__","task","stage","existingMatches","objectKeys","isObjectLike","lastLink","startPath","patterns","notifiedUpstream","dataModel","checkDataLink","observer","oneway","findBoundValue","captureGroup","shufle","sourcePath","LinkModel__proto__","isDetached","force","markedAll","relinked","shuffling","lnk","implicit","ln","functions","leadingWhitespace","ParseError","lineStart","lines","lineEnds","line","lineEnd","remaining","getContextMessage","getLinePos","lineNum","columnNum","contextLines","contextUp","contextDown","numTabs","annotation","char","msg","character","shortMessage","nextChar","charAt","readTypeOf","INVERTED","CLOSING","DELIMCHANGE","CLOSING_TAG","INLINE_PARTIAL","NUMBER_LITERAL","STRING_LITERAL","ARRAY_LITERAL","OBJECT_LITERAL","BOOLEAN_LITERAL","REGEXP_LITERAL","GLOBAL","KEY_VALUE_PAIR","REFINEMENT","MEMBER","PREFIX_OPERATOR","BRACKETED","CONDITIONAL","INFIX_OPERATOR","INVOCATION","ELSE","ELSEIF","THEN","CATCH","delimiterChangePattern","whitespacePattern","regexpPattern","regExpCache","allowfullscreen","async","autofocus","autoplay","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","enabled","formnovalidate","indeterminate","inert","itemscope","multiple","muted","nohref","noresize","noshade","nowrap","open","pauseonexit","required","reversed","scoped","seamless","sortable","translate","truespeed","typemustmatch","area","br","col","command","embed","hr","img","keygen","meta","param","track","wbr","htmlEntities","quot","amp","apos","lt","gt","nbsp","iexcl","cent","pound","curren","yen","brvbar","sect","uml","copy","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34","iquest","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","times","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","szlig","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","divide","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","OElig","oelig","Scaron","scaron","Yuml","fnof","circ","tilde","Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega","alpha","beta","gamma","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigmaf","sigma","tau","upsilon","phi","chi","psi","omega","thetasym","upsih","piv","ensp","emsp","thinsp","zwnj","zwj","lrm","rlm","ndash","mdash","lsquo","rsquo","sbquo","ldquo","rdquo","bdquo","dagger","Dagger","bull","hellip","permil","prime","Prime","lsaquo","rsaquo","oline","frasl","euro","image","weierp","real","trade","alefsym","larr","uarr","rarr","darr","harr","crarr","lArr","uArr","rArr","dArr","hArr","forall","part","exist","empty","nabla","isin","notin","ni","prod","sum","minus","lowast","radic","infin","ang","and","or","cap","cup","int","there4","sim","cong","asymp","ne","equiv","le","ge","sub","sup","nsub","sube","supe","oplus","otimes","perp","sdot","lceil","rceil","lfloor","rfloor","lang","rang","loz","spades","clubs","hearts","diams","controlCharacters","entityPattern","codePointSupport","fromCodePoint","codeToChar","fromCharCode","lessThan","greaterThan","invalid","expectedExpression","expectedParen","stringMiddlePattern","escapeSequencePattern","lineContinuationPattern","singleMatcher","makeQuotedStringMatcher","doubleMatcher","escapes","spreadPattern","legalReference","relaxedName","identifier","globals","keywords","prefixPattern","makePrefixSequenceMatcher","symbol","fallthrough","expression","readExpression","matcher","prefixOperators","readMemberOrInvocation","readLogicalOr","readTypeof","makeInfixSequenceMatcher","inUnquotedAttribute","left","right","infixOperators","readLogicalOr$1","attributeNamePattern","onPattern","eventPattern","reservedEventNames","decoratorPattern","transitionPattern","boundPattern","directives","no-delegation","unquotedAttributeValueTextPattern","proxyEvent","whitespace","slashes","delimiterChangeToken","exclude","legalAlias","asRE","else","elseif","catch","types","handlebarsBlockCodes","each","if","with","unless","indexRefPattern","keyIndexRefPattern","handlebarsBlockPattern","OPEN_COMMENT","CLOSE_COMMENT","leadingLinebreak","trailingLinebreak","contiguousWhitespace","trailingWhitespace","leadingNewLine","trailingNewLine","trailingIndent","leadingLine","closingTagPattern","tagNamePattern","anchorPattern","validTagNameFollower","semiEnd","disallowedContents","li","dt","dd","rt","rp","optgroup","thead","tbody","tfoot","tr","td","th","inlines","partialDefinitionSectionPattern","STANDARD_READERS","readPartial","readUnescaped","readSection","readInterpolator","readMustacheComment","TRIPLE_READERS","readTriple","READERS","readMustache","readHtmlComment","readElement","readText","PARTIAL_READERS","readPartialDefinitionSection","preserveWhitespaceElements","defaultInterpolate","StandardParser","tripleDelimiters","staticDelimiters","staticTripleDelimiters","standardDelimiters","delimiters","tags","isTriple","close","readers","sortMustacheTags","sectionDepth","elementStack","sanitize","elements","eventAttributes","stripComments","preserveWhitespace","sanitizeElements","sanitizeEventAttributes","includeLinePositions","textOnlyMode","csp","preserveStandaloneSections","inTag","whiteSpaceElements","parserResult","expr","flattenExpression","fromExpression","cleanup","insertExpressions","readTemplate","parseOptions","TEMPLATE_INSTRUCTIONS","COMPUTATION_INSTRUCTIONS","fromId","id","noThrow","getElementById","textContent","isParsed","getParseOptions","throwNoParse","parseFor","TransitionManager","intros","outros","totalChildren","outroChildren","detachQueue","outrosComplete","TransitionManager__proto__","checkStart","started","decrementOutros","decrementTotal","detachNodes","ready","detachImmediate","fulfilPromise","previousBatch","transitionManager","fragments","tasks","immediateObservers","deferredObservers","flushChanges","thing","postRender","_batch","tickers","running","performance","now","requestAnimationFrame","Ticker__proto__","elapsed","eased","abort","prefixers","ticker","Model__proto__","rewrap","createBranch","adaptor","getPrefixer","__model","getComputationSignature","branch","markForce","recreateArray","unsafe","SharedModel__proto__","SharedModel$1","FakeFragment","deepOpts","comparators","errorMessage","initStars","bubbleStars","Hook","method","arg","HookQueue","hook","inProcess","queue","HookQueue__proto__","begin","getChildQueue","hooks","arrayProto","ContextData","ContextData__proto__","_data","qualified","hasAttribute","Ractive$teardown","torndown","getPromise","__ractive_instances__","destruct","_marking","mdl","subscribe","subs","toPairs","single","initialiseProperties","handleAttributes","onconstruct","_attributePartial","getAdaptors","protoAdapt","lookup","srcs","_subs","_nsSubs","_eventQueue","_children","byName","all","optional","mapAll","nameOption","renderItem","contains","lastBound","updateAnchors","res","isBindableByValue","isBindableByContentEditable","isContentEditable","isBindableByName","isBindableByChecked","nameAttr","stopImmediatePropagation","currentTarget","endEl","prevented","oldStop","oldImmediate","oldPrevent","correspondingUseElement","stopImmediaitePropagation","text","splitText","createTextNode","readKey","childData","getPartialFromRegistry","fillGaps","findParentPartial","findInstance","findOwner","findConstructor","self","okToParse","parsePartial","setTemplate","initing","aliasLocal","findFirstNode","out","section","hasIndexRef","selectedOption","selectedIndex","firstChild","getComponentConstructor","asyncProxy","cmp","extract","success","undef","ctor","guid","counter","placeholderId","newModel","userOptions","getElement","append","logIfDebug","cssId","Ractive$render","others","Ractive$reset","rerender","changes","collection","Ractive$resetTemplate","external","Ractive$set","Ractive$subtract","Ractive$toggle","TypeError","gather","Ractive$toCSS","uniqueCssIds","ids","Ractive$toHTML","Ractive$transition","HTMLElement","Ractive$unrender","Ractive$updateModel","plugins","buildCSS","transform","recomputeCSS","extendOne","Class","Target","_on","_observe","sourcesLength","sources","nextSource","nextKey","hasOwnProperty","thisArg","arrayLength","window","Node","nowOffset","Date","global","implementation","hasFeature","PENDING","FULFILLED","REJECTED","dispatchHandlers","fulfilledHandlers","rejectedHandlers","state","makeResolver","newState","makeDispatcher","wait","fulfill","reject","onFulfilled","onRejected","promise2","processResolutionHandler","handlers","forward","p1result","finally","promises","processPromise","race","fail","reason","called","resolvePromise","rejectPromise","cancelAnimationFrame","lastTime","currentTime","timeToNextCall","resolveInstanceMembers","warnAboutAmbiguity","noIntro","noOutro","nestedTransitions","noCSSTransform","easeIn","pow","easeOut","easeInOut","alreadyWarned","initialFragment","parts","explicitContext","badReference","repeater","findIter","ContextModel","findMacro","shouldWarn","crossed","_fakeFragment","pairs","deep","deepSet","getComparator","sets","isDate","Ractive$add","getOptions","Ractive$animate","enqueue","dequeue","variants","eventNames","fireEventAs","initialFire","notifySubscribers","fullName","subscribers","originalEvent","stopEvent","hookQueue","childQueue","findAnchors","findAnchorsIn","anchors","idxs","unrenderChild","prepend","insertAt","rm","attachchild","Ractive$compute","comp","first","Ractive$detach","detachchild","Ractive$find","remote","Ractive$findAll","Ractive$findAllComponents","Ractive$findComponent","Ractive$findContainer","Ractive$findParent","orComponent","getNewIndices","spliceArguments","getSpliceEquivalent","balance","removeStart","removeEnd","startIndex","Ractive$update","Ractive$fire","Ractive$get","instances","staticContext","output","Ractive$insert","fireInsertHook","src","isUpstream","fresh","splitKeypathI","vals","olds","observers","silent","caller","keypaths","createObserver","isSilenced","silence","resume","wildcardIndex","double","Ractive$off","entry","Ractive$on","Ractive$once","listener","canonical","styleDefinition","styleSheet","cssText","filteredStyleDefinitions","makeStyle","getElementsByTagName","cleanCss","additionalReplaceRules","reconstruct","extractString","unit","transformSelector","selectorUnits","modifiers","transformed","appended","prepended","transformCss","dataAttr","selectors","s4","floor","random","uuid","setCSSData","local","def","evalCSS","transformCSS","__proto__","cssProp","noCssTransform","validate","emptyData","childValue","parentIsFn","childIsFn","callDataFunction","fromProperties","primary","secondary","parseAsString","existingPartials","newPartials","overwrite","superMethod","getSuperMethod","_parent","hasSuper","oldSuper","_method","getMessage","deprecated","correct","isError","deprecateOption","deprecatedOption","deprecate","extendOtherMethods","member","RactiveProto","wrapPrototype","readStyle","rule","rules","readClass","updateMultipleSelectValue","updateSelectValue","updateStringValue","updateContentEditableValue","updateRadioValue","updateValue","updateRadioName","updateCheckboxName","updateStyleAttribute","updateInlineStyle","updateClassName","updateInlineClass","updateBoolean","updateNamespacedAttribute","updateAttribute","wasSelected","wasChecked","safeValue","valueAttribute","setProperty","getPropertyValue","className","baseVal","getAttributeNS","removeAttributeNS","setAttributeNS","haystack","needle","isFinite","format","registryName","interpol","lastItem","arrays","arrayLike","one","two","oldArray","newArray","oldLength","usedIndices","firstUnusedIndex","oldLen","newLen","isKeypath","findAlias","alias","body","createFunction","exp","readDelimiterChange","opening","closing","readNumberLiteral","escapeRegExp","getLowestIndex","needles","search","entity","code","parseInt","validateCode","readBooleanLiteral","okQuote","literal","done","charCodeAt","JSON","quote","escapeChar","readTemplateStringLiteral","token","namePattern","readKeyValuePair","spread","refKey","readKeyValuePairs","keyValuePairs","readObjectLiteral","readArrayLiteral","expressionList","readExpressionList","readLiteral","readRegexpLiteral","readReference","lastDotIndex","startPos","relaxedNames","actual","inEvent","lastIndexOf","refLength","readBracketedExpression","readPrimary","readRefinement","strictRefinement","refinement","getConditional","ifTrue","ifFalse","readConditional","isSpread","expressions","readExpressionOrReference","expectedFollowers","getVars","vars","stringify","hasSpread","makeSpread","stringifyPair","extractRefs","stringified","refineExpression","mustache","referenceExpression","getReferenceExpression","splitEvent","readAttribute","nearest","readAttributeValue","valueStart","startDepth","readQuotedAttributeValue","readUnquotedAttributeValue","readUnquotedAttributeValueToken","tokens","quoteMark","readQuotedStringToken","readAttributeOrDirective","readArguments","readProxyEvent","spreadArgs","inside","readMustacheOfType","tag","reader","rewind","q","triple","readAliases","readAlias","readComment","readClosing","readInlineBlock","nm","hasElse","block","unlessBlock","closed","expectedClose","hasThen","hasCatch","inlineThen","aliasOnly","extra","w","endIndex","comment","stripStandalones","backOne","backTwo","lastSectionItem","isComment","isSection","trimWhitespace","leadingPattern","trailingPattern","removeLeadingWhitespace","removeTrailingWhitespace","previousItem","nextItem","preserveWhitespaceInsideFragment","removeLeadingWhitespaceInsideFragment","removeTrailingWhitespaceInsideFragment","hitLast","_m","isPreserveWhitespaceElement","readClosingTag","camelCaseStr","selfClosing","hasPartials","closingTag","lowerCaseName","canContain","closingTagName","readAnchorClose","readInline","classes","disallowed","barrier","isExpression","addTo","hasChildren","instructions","createFunctionFromString","bindTo","getterString","setterString","tm","allOutrosComplete","notifiedTotal","manager","collectAllOutros","trans","nqueue","_list","prefixKeypath","rootKeypath","rootDot","relativeKeypath"],"mappings":"kQqLAO,SAAS+hB,GAAO6P,EAAK1V,GAC1B,MAAOsX,QAAOruB,UAAUixD,eAAepmD,KAAK4hB,EAAK1V,GAGnD,QAAgB81C,GAAS9vD,+DACvB,KAAKI,GAAII,GAAI,EAAGA,EAAIuzD,EAAQxzD,OAAQC,IAAK,CACvCtB,GAAMwD,GAASqxD,EAAQvzD,EACvB,KAAKtB,GAAMf,KAAOuE,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