{"version":3,"sources":["webpack:///./node_modules/aurelia-task-queue/dist/native-modules/aurelia-task-queue.js","webpack:///./node_modules/aurelia-templating-binding/dist/native-modules/aurelia-templating-binding.js","webpack:///./node_modules/aurelia-templating-resources/dist/native-modules/aurelia-templating-resources.js","webpack:///./node_modules/aurelia-templating-router/dist/native-modules/aurelia-templating-router.js"],"names":["_typeof","Symbol","iterator","obj","constructor","prototype","makeRequestFlushFromTimer","flush","timeoutHandle","setTimeout","handleFlushTimer","intervalHandle","setInterval","clearTimeout","clearInterval","TaskQueue","observer","val","node","values","_this","this","flushing","longStacks","microTaskQueue","microTaskQueueCapacity","taskQueue","mutationObserver","requestFlushMicroTaskQueue","flushMicroTaskQueue","createMutationObserver","createTextNode","Object","create","a","b","observe","characterData","data","requestFlushTaskQueue","flushTaskQueue","_flushQueue","queue","capacity","index","task","length","stack","undefined","call","scan","newLength","error","filterFlushStack","onError","queueMicroTask","prepareQueueStack","push","queueTask","Number","MAX_VALUE","separator","replace","filterQueueStack","Error","e","captureStack","lastIndexOf","substr","_class","_temp","_class2","_class3","_class4","_temp2","_class5","_temp3","AttributeMap","svg","elements","allElements","registerUniversal","register","elementName","attributeName","propertyName","toLowerCase","map","isStandardSvgAttribute","element","test","inject","InterpolationBindingExpression","observerLocator","targetProperty","parts","mode","lookupFunctions","attribute","attrToRemove","discrete","createBinding","target","ChildInterpolationBinding","InterpolationBinding","validateTarget","info","parentElement","nodeName","targetAccessor","getAccessor","interpolate","isBound","value","i","ii","setValue","updateOneTimeBindings","child","oneTime","bind","source","unbind","binding","_dec","sourceExpression","left","right","parent","updateTarget","toString","rawValue","evaluate","_version","connect","Array","observeArray","unobserve","oneWay","LetExpression","toBindingContext","LetBinding","_dec2","context","bindingContext","overrideContext","LetInterpolationBindingExpression","LetInterpolationBinding","interpolationBinding","createInterpolationBinding","SyntaxInterpreter","parser","eventManager","attributeMap","interpret","resources","existingInstruction","command","handleUnknownCommand","warn","determineDefaultBindingMode","attrName","tagName","type","contentEditable","twoWay","attributes","defaultBindingMode","instruction","parse","attrValue","trigger","none","capture","capturing","delegate","bubbling","options","language","name","current","inString","inEscape","foundName","trim","_getPrimaryPropertyName","inspectAttribute","createAttributeInstruction","getAttribute","primaryProperty","isDestructuring","keyValue","match","split","key","local","items","toView","fromView","TemplatingBindingLanguage","_BindingLanguage","syntaxInterpreter","self","ReferenceError","_possibleConstructorReturn","emptyStringExpression","toBindingContextAttr","subClass","superClass","TypeError","enumerable","writable","configurable","setPrototypeOf","__proto__","_inherits","expression","interpolationParts","parseInterpolation","theInfo","createLetExpressions","letElement","expressions","attr","hasAttribute","nodeValue","inspectTextContent","indexOf","char","pos","open","quote","interpolationStart","partIndex","substring","configure","config","container","registerSingleton","registerAlias","extendStatics","d","p","hasOwnProperty","__extends","__","__decorate","decorators","desc","c","arguments","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","Compose","compositionEngine","viewSlot","viewResources","currentController","currentViewModel","changes","Element","created","owningView","view","viewModel","model","pendingTask","processChanges","removeAll","modelChanged","newValue","oldValue","requestUpdate","viewChanged","viewModelChanged","composer","assign","host","swapOrder","createInstruction","compose","then","controller","vm","activate","Promise","resolve","tryActivateViewModel","completeCompositionTask","reason","_","isEmpty","updateRequested","IfCore","viewFactory","showing","cache","isCaching","remove","returnToCache","_show","add","_hide","removed","_unbindView","If","_super","apply","condition","conditionChanged","_update","show","promise","animating","elseVm","_swap","all","Else","_registerInIf","ifVm","previous","anchor","previousSibling","au","if","With","parentOverrideContext","valueChanged","updateOverrideContexts","views","startIndex","updateOverrideContext","createFullOverrideContext","repeat","scope","first","last","even","$index","$first","$last","$middle","$odd","$even","updateOneTimeBinding","array","item","matcher","ArrayRepeatStrategy","getCollectionObserver","getArrayObserver","instanceChanged","itemsLength","children","viewsLength","viewsRequireLifecycle","childrenSnapshot","slice","itemNameInBindingContext","matcher_1","itemsPreviouslyInViews_1","viewsToRemove","oldItem","updateViews","removePromise","removeViews","indexOfView","insertView","splice","moveView","_inPlaceProcessItems","removeAllViews","_standardProcessInstanceChanged","addView","viewCount","removeView","middle","updateBindings","instanceMutated","splices","__queuedSplices","_a","addedCount","__array","maybePromise","_runSplices","queuedSplices_1","runQueuedSplices_1","nextPromise","removeDelta","rmPromises","j","jj","viewOrPromise","spliceIndexLow","_handleAddedSplices","spliceIndex","arrayLength","addIndex","end","MapRepeatStrategy","getMapObserver","_standardProcessItems","forEach","size","records","removeIndex","record","_getViewIndexByKey","get","NullRepeatStrategy","NumberRepeatStrategy","childrenLength","Math","floor","SetRepeatStrategy","getSetObserver","set","max","_getViewIndexByValue","RepeatStrategyLocator","matchers","strategies","addStrategy","Map","Set","strategy","getStrategy","lifecycleOptionalBehaviors","behaviorRequiresLifecycle","t","handlesAttached","handlesBind","handlesCreated","handlesDetached","handlesUnbind","targetRequiresLifecycle","behaviors","behaviorInstructions","_viewsRequireLifecycle","template","querySelector","id","instructions","Repeat","strategyLocator","ignoreMutation","filter","bi","originalAttrName","getItemsSourceExpression","isOneTime","matcherBinding","_captureAndRemoveMatcherBinding","itemsChanged","_unsubscribeCollection","collectionObserver","unsubscribe","callContext","_observeInnerCollection","_observeCollection","_getInnerCollection","unwrapped","unwrapExpression","handleCollectionMutated","collection","handleInnerCollectionMutated","newItems","subscribe","instructionIds","keys","insert","sourceIndex","targetIndex","move","skipAnimation","removeMany","removeAt","$view","bindings","controllers","k","boundProperties","AbstractRepeater","aureliaHideClass","injectAureliaHideStyleAtBoundary","domBoundary","shadowDOM","hasAureliaHideStyle","injectStyles","Show","animator","of","boundary","removeClass","addClass","Hide","SCRIPT_REGEX","needsToWarn","HTMLSanitizer","sanitize","input","SanitizeHTMLValueConverter","sanitizer","untrustedMarkup","Replaceable","Focus","isAttached","needsApply","_apply","focus","blur","attached","addEventListener","detached","removeEventListener","handleEvent","activeElement","cssUrlMatcher","CSSResource","address","_scoped","_global","_alreadyGloballyInjected","initialize","Target","registry","registerViewEngineHooks","load","loadText","catch","err","text","css","p1","charAt","fixupCSSUrls","CSSViewEngineHooks","owner","beforeCompile","content","targetShadowDOM","scopedCSS","setAttribute","AttrBindingBehavior","targetObserver","modeBindingBehavior","originalMode","OneTimeBindingBehavior","OneWayBindingBehavior","ToViewBindingBehavior","FromViewBindingBehavior","TwoWayBindingBehavior","throttle","state","throttleState","elapsed","Date","delay","timeoutId","throttledMethod","ThrottleBindingBehavior","methodToThrottle","callSource","updateSource","originalName","unset","debounceCallSource","event","debounceState","debouncedMethod","debounceCall","callContextToDebounce","_oldValue","DebounceBindingBehavior","isCallSource","methodToDebounce","debouncer","handleSelfEvent","path","deepPath","findOriginalEventTarget","selfEventCallSource","SelfBindingBehavior","targetEvent","BindingSignaler","signals","signal","SignalBindingBehavior","bindingSignaler","names","_i","name_1","signalName","name_2","isArray","eventNamesRequired","notApplicableMessage","UpdateTriggerBindingBehavior","events","getObserver","handler","originalHandler","dispose","viewEngine","loader","aurelia","addResourcePlugin","viewUrl","loadTemplate","registryEntry","bindableNames","useShadowDOMmode","exec","x","removeAttribute","DynamicElement","$parent","_createDynamicElement","configure$1","globalResources","styleResourcePlugin","fetch","ViewCSS","_createCSSResource","ext","EmptyLayoutViewModel","RouterView","router","viewLocator","compositionTransaction","registerViewPort","initialComposition","compositionTransactionNotifier","enlist","process","$viewPortInstruction","waitToSwap","viewPortInstruction","component","childContainer","viewModelResource","metadata","currentInstruction","viewPortConfig","viewPorts","RouterViewLocator","_notify","layoutInstruction","layoutViewModel","layoutView","layoutModel","viewStrategy","getViewStrategy","makeRelativeTo","moduleId","compositionTransactionOwnershipToken","tryCapture","viewPortComponentBehaviorInstruction","dynamic","swap","viewPortController","previousView","work","swapStrategy","after","ready","owningView_or_layoutView","automate","transactionOwnerShipToken","waitForCompositionComplete","createController","layoutController","distributeView","slots","newView","notifier","done","$resource","bindables","findNearest","routerView","EmptyClass","TemplatingRouteLoader","resolveViewModel","reject","DynamicClass","createDynamicClass","createChildContainer","createChild","getChildRouter","childRouter","registerHandler","loadRoute","_navInstruction","ensureViewModel","logger","RouteHref","isActive","processChange","attributeChanged","ensureConfigured","href","generate","route","params","changeHandler","singleton"],"mappings":"4FAAA,gDAAIA,EAA4B,mBAAXC,QAAoD,iBAApBA,OAAOC,SAAwB,SAAUC,GAAO,cAAcA,GAAS,SAAUA,GAAO,OAAOA,GAAyB,mBAAXF,QAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,gBAAkBF,GAsBtQ,SAASG,EAA0BC,GACjC,OAAO,WACL,IAAIC,EAAgBC,WAAWC,EAAkB,GAE7CC,EAAiBC,YAAYF,EAAkB,IACnD,SAASA,IACPG,aAAaL,GACbM,cAAcH,GACdJ,MAmBC,IAAIQ,EAAY,WACrB,SAASA,IACP,IA1C0CR,EACxCS,EACAC,EACAC,EACAC,EAsCEC,EAAQC,KAIZA,KAAKC,UAAW,EAChBD,KAAKE,YAAa,EAElBF,KAAKG,eAAiB,GACtBH,KAAKI,uBAAyB,KAC9BJ,KAAKK,UAAY,GAEb,IAAQC,iBACVN,KAAKO,4BAtDmCrB,EAsD+B,WACrE,OAAOa,EAAMS,uBAtDfb,EAAW,IAAIc,uBAAuBvB,GACtCU,EAAM,IACNC,EAAO,IAAIa,eAAe,MAC1BZ,EAASa,OAAOC,OAAO,OACpBC,EAAI,IACXf,EAAOgB,EAAI,IACXnB,EAASoB,QAAQlB,EAAM,CAAEmB,eAAe,IACjC,WACLnB,EAAKoB,KAAOrB,EAAME,EAAOF,KAiDvBI,KAAKO,2BAA6BtB,EAA0B,WAC1D,OAAOc,EAAMS,wBAIjBR,KAAKkB,sBAAwBjC,EAA0B,WACrD,OAAOc,EAAMoB,mBAgFjB,OA5EAzB,EAAUV,UAAUoC,YAAc,SAAqBC,EAAOC,GAC5D,IAAIC,EAAQ,EACRC,OAAO,EAEX,IAEE,IADAxB,KAAKC,UAAW,EACTsB,EAAQF,EAAMI,QAQnB,GAPAD,EAAOH,EAAME,GACTvB,KAAKE,aACPF,KAAK0B,MAA8B,iBAAfF,EAAKE,MAAqBF,EAAKE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e,gBAAiBxgB,iBAAiB,GAClE,CAAEV,KAAM,SAAUkhB,cAAe,iBACjC,cAGDT,EA3DmB,GA8D9B,SAASjd,EAAUC,GACfA,EACK0d,UAAU,IAAaxB,GACvBwB,UAAU,IAAQ,KAClBvF,gBAAgBO,EAAYsE,GACjChd,EAAOC,UAAUE,cAAc,IAAQ,Q","file":"vendors~8c2f086c.2e38a4faf48702dc4ca6.chunk.js","sourcesContent":["var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n\n\nimport { DOM, FEATURE } from 'aurelia-pal';\n\nvar stackSeparator = '\\nEnqueued in TaskQueue by:\\n';\nvar microStackSeparator = '\\nEnqueued in MicroTaskQueue by:\\n';\n\nfunction makeRequestFlushFromMutationObserver(flush) {\n var observer = DOM.createMutationObserver(flush);\n var val = 'a';\n var node = DOM.createTextNode('a');\n var values = Object.create(null);\n values.a = 'b';\n values.b = 'a';\n observer.observe(node, { characterData: true });\n return function requestFlush() {\n node.data = val = values[val];\n };\n}\n\nfunction makeRequestFlushFromTimer(flush) {\n return function requestFlush() {\n var timeoutHandle = setTimeout(handleFlushTimer, 0);\n\n var intervalHandle = setInterval(handleFlushTimer, 50);\n function handleFlushTimer() {\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n flush();\n }\n };\n}\n\nfunction onError(error, task, longStacks) {\n if (longStacks && task.stack && (typeof error === 'undefined' ? 'undefined' : _typeof(error)) === 'object' && error !== null) {\n error.stack = filterFlushStack(error.stack) + task.stack;\n }\n\n if ('onError' in task) {\n task.onError(error);\n } else {\n setTimeout(function () {\n throw error;\n }, 0);\n }\n}\n\nexport var TaskQueue = function () {\n function TaskQueue() {\n var _this = this;\n\n \n\n this.flushing = false;\n this.longStacks = false;\n\n this.microTaskQueue = [];\n this.microTaskQueueCapacity = 1024;\n this.taskQueue = [];\n\n if (FEATURE.mutationObserver) {\n this.requestFlushMicroTaskQueue = makeRequestFlushFromMutationObserver(function () {\n return _this.flushMicroTaskQueue();\n });\n } else {\n this.requestFlushMicroTaskQueue = makeRequestFlushFromTimer(function () {\n return _this.flushMicroTaskQueue();\n });\n }\n\n this.requestFlushTaskQueue = makeRequestFlushFromTimer(function () {\n return _this.flushTaskQueue();\n });\n }\n\n TaskQueue.prototype._flushQueue = function _flushQueue(queue, capacity) {\n var index = 0;\n var task = void 0;\n\n try {\n this.flushing = true;\n while (index < queue.length) {\n task = queue[index];\n if (this.longStacks) {\n this.stack = typeof task.stack === 'string' ? task.stack : undefined;\n }\n task.call();\n index++;\n\n if (index > capacity) {\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n\n queue.length -= index;\n index = 0;\n }\n }\n } catch (error) {\n onError(error, task, this.longStacks);\n } finally {\n this.flushing = false;\n }\n };\n\n TaskQueue.prototype.queueMicroTask = function queueMicroTask(task) {\n if (this.microTaskQueue.length < 1) {\n this.requestFlushMicroTaskQueue();\n }\n\n if (this.longStacks) {\n task.stack = this.prepareQueueStack(microStackSeparator);\n }\n\n this.microTaskQueue.push(task);\n };\n\n TaskQueue.prototype.queueTask = function queueTask(task) {\n if (this.taskQueue.length < 1) {\n this.requestFlushTaskQueue();\n }\n\n if (this.longStacks) {\n task.stack = this.prepareQueueStack(stackSeparator);\n }\n\n this.taskQueue.push(task);\n };\n\n TaskQueue.prototype.flushTaskQueue = function flushTaskQueue() {\n var queue = this.taskQueue;\n this.taskQueue = [];\n this._flushQueue(queue, Number.MAX_VALUE);\n };\n\n TaskQueue.prototype.flushMicroTaskQueue = function flushMicroTaskQueue() {\n var queue = this.microTaskQueue;\n this._flushQueue(queue, this.microTaskQueueCapacity);\n queue.length = 0;\n };\n\n TaskQueue.prototype.prepareQueueStack = function prepareQueueStack(separator) {\n var stack = separator + filterQueueStack(captureStack());\n\n if (typeof this.stack === 'string') {\n stack = filterFlushStack(stack) + this.stack;\n }\n\n return stack;\n };\n\n return TaskQueue;\n}();\n\nfunction captureStack() {\n var error = new Error();\n\n if (error.stack) {\n return error.stack;\n }\n\n try {\n throw error;\n } catch (e) {\n return e.stack;\n }\n}\n\nfunction filterQueueStack(stack) {\n return stack.replace(/^[\\s\\S]*?\\bqueue(Micro)?Task\\b[^\\n]*\\n/, '');\n}\n\nfunction filterFlushStack(stack) {\n var index = stack.lastIndexOf('flushMicroTaskQueue');\n\n if (index < 0) {\n index = stack.lastIndexOf('flushTaskQueue');\n if (index < 0) {\n return stack;\n }\n }\n\n index = stack.lastIndexOf('\\n', index);\n\n return index < 0 ? stack : stack.substr(0, index);\n}","var _class, _temp, _dec, _class2, _dec2, _class3, _class4, _temp2, _class5, _temp3;\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nimport * as LogManager from 'aurelia-logging';\nimport { camelCase, SVGAnalyzer, bindingMode, connectable, enqueueBindingConnect, sourceContext, Parser, ObserverLocator, EventManager, ListenerExpression, BindingExpression, CallExpression, delegationStrategy, NameExpression, LiteralString } from 'aurelia-binding';\nimport { BehaviorInstruction, BindingLanguage } from 'aurelia-templating';\n\nexport var AttributeMap = (_temp = _class = function () {\n function AttributeMap(svg) {\n \n\n this.elements = Object.create(null);\n this.allElements = Object.create(null);\n\n this.svg = svg;\n\n this.registerUniversal('accesskey', 'accessKey');\n this.registerUniversal('contenteditable', 'contentEditable');\n this.registerUniversal('tabindex', 'tabIndex');\n this.registerUniversal('textcontent', 'textContent');\n this.registerUniversal('innerhtml', 'innerHTML');\n this.registerUniversal('scrolltop', 'scrollTop');\n this.registerUniversal('scrollleft', 'scrollLeft');\n this.registerUniversal('readonly', 'readOnly');\n\n this.register('label', 'for', 'htmlFor');\n\n this.register('img', 'usemap', 'useMap');\n\n this.register('input', 'maxlength', 'maxLength');\n this.register('input', 'minlength', 'minLength');\n this.register('input', 'formaction', 'formAction');\n this.register('input', 'formenctype', 'formEncType');\n this.register('input', 'formmethod', 'formMethod');\n this.register('input', 'formnovalidate', 'formNoValidate');\n this.register('input', 'formtarget', 'formTarget');\n\n this.register('textarea', 'maxlength', 'maxLength');\n\n this.register('td', 'rowspan', 'rowSpan');\n this.register('td', 'colspan', 'colSpan');\n this.register('th', 'rowspan', 'rowSpan');\n this.register('th', 'colspan', 'colSpan');\n }\n\n AttributeMap.prototype.register = function register(elementName, attributeName, propertyName) {\n elementName = elementName.toLowerCase();\n attributeName = attributeName.toLowerCase();\n var element = this.elements[elementName] = this.elements[elementName] || Object.create(null);\n element[attributeName] = propertyName;\n };\n\n AttributeMap.prototype.registerUniversal = function registerUniversal(attributeName, propertyName) {\n attributeName = attributeName.toLowerCase();\n this.allElements[attributeName] = propertyName;\n };\n\n AttributeMap.prototype.map = function map(elementName, attributeName) {\n if (this.svg.isStandardSvgAttribute(elementName, attributeName)) {\n return attributeName;\n }\n elementName = elementName.toLowerCase();\n attributeName = attributeName.toLowerCase();\n var element = this.elements[elementName];\n if (element !== undefined && attributeName in element) {\n return element[attributeName];\n }\n if (attributeName in this.allElements) {\n return this.allElements[attributeName];\n }\n\n if (/(?:^data-)|(?:^aria-)|:/.test(attributeName)) {\n return attributeName;\n }\n return camelCase(attributeName);\n };\n\n return AttributeMap;\n}(), _class.inject = [SVGAnalyzer], _temp);\n\nexport var InterpolationBindingExpression = function () {\n function InterpolationBindingExpression(observerLocator, targetProperty, parts, mode, lookupFunctions, attribute) {\n \n\n this.observerLocator = observerLocator;\n this.targetProperty = targetProperty;\n this.parts = parts;\n this.mode = mode;\n this.lookupFunctions = lookupFunctions;\n this.attribute = this.attrToRemove = attribute;\n this.discrete = false;\n }\n\n InterpolationBindingExpression.prototype.createBinding = function createBinding(target) {\n if (this.parts.length === 3) {\n return new ChildInterpolationBinding(target, this.observerLocator, this.parts[1], this.mode, this.lookupFunctions, this.targetProperty, this.parts[0], this.parts[2]);\n }\n return new InterpolationBinding(this.observerLocator, this.parts, target, this.targetProperty, this.mode, this.lookupFunctions);\n };\n\n return InterpolationBindingExpression;\n}();\n\nfunction validateTarget(target, propertyName) {\n if (propertyName === 'style') {\n LogManager.getLogger('templating-binding').info('Internet Explorer does not support interpolation in \"style\" attributes. Use the style attribute\\'s alias, \"css\" instead.');\n } else if (target.parentElement && target.parentElement.nodeName === 'TEXTAREA' && propertyName === 'textContent') {\n throw new Error('Interpolation binding cannot be used in the content of a textarea element. Use instead.');\n }\n}\n\nexport var InterpolationBinding = function () {\n function InterpolationBinding(observerLocator, parts, target, targetProperty, mode, lookupFunctions) {\n \n\n validateTarget(target, targetProperty);\n this.observerLocator = observerLocator;\n this.parts = parts;\n this.target = target;\n this.targetProperty = targetProperty;\n this.targetAccessor = observerLocator.getAccessor(target, targetProperty);\n this.mode = mode;\n this.lookupFunctions = lookupFunctions;\n }\n\n InterpolationBinding.prototype.interpolate = function interpolate() {\n if (this.isBound) {\n var value = '';\n var parts = this.parts;\n for (var i = 0, ii = parts.length; i < ii; i++) {\n value += i % 2 === 0 ? parts[i] : this['childBinding' + i].value;\n }\n this.targetAccessor.setValue(value, this.target, this.targetProperty);\n }\n };\n\n InterpolationBinding.prototype.updateOneTimeBindings = function updateOneTimeBindings() {\n for (var i = 1, ii = this.parts.length; i < ii; i += 2) {\n var child = this['childBinding' + i];\n if (child.mode === bindingMode.oneTime) {\n child.call();\n }\n }\n };\n\n InterpolationBinding.prototype.bind = function bind(source) {\n if (this.isBound) {\n if (this.source === source) {\n return;\n }\n this.unbind();\n }\n this.source = source;\n\n var parts = this.parts;\n for (var i = 1, ii = parts.length; i < ii; i += 2) {\n var binding = new ChildInterpolationBinding(this, this.observerLocator, parts[i], this.mode, this.lookupFunctions);\n binding.bind(source);\n this['childBinding' + i] = binding;\n }\n\n this.isBound = true;\n this.interpolate();\n };\n\n InterpolationBinding.prototype.unbind = function unbind() {\n if (!this.isBound) {\n return;\n }\n this.isBound = false;\n this.source = null;\n var parts = this.parts;\n for (var i = 1, ii = parts.length; i < ii; i += 2) {\n var name = 'childBinding' + i;\n this[name].unbind();\n }\n };\n\n return InterpolationBinding;\n}();\n\nexport var ChildInterpolationBinding = (_dec = connectable(), _dec(_class2 = function () {\n function ChildInterpolationBinding(target, observerLocator, sourceExpression, mode, lookupFunctions, targetProperty, left, right) {\n \n\n if (target instanceof InterpolationBinding) {\n this.parent = target;\n } else {\n validateTarget(target, targetProperty);\n this.target = target;\n this.targetProperty = targetProperty;\n this.targetAccessor = observerLocator.getAccessor(target, targetProperty);\n }\n this.observerLocator = observerLocator;\n this.sourceExpression = sourceExpression;\n this.mode = mode;\n this.lookupFunctions = lookupFunctions;\n this.left = left;\n this.right = right;\n }\n\n ChildInterpolationBinding.prototype.updateTarget = function updateTarget(value) {\n value = value === null || value === undefined ? '' : value.toString();\n if (value !== this.value) {\n this.value = value;\n if (this.parent) {\n this.parent.interpolate();\n } else {\n this.targetAccessor.setValue(this.left + value + this.right, this.target, this.targetProperty);\n }\n }\n };\n\n ChildInterpolationBinding.prototype.call = function call() {\n if (!this.isBound) {\n return;\n }\n\n this.rawValue = this.sourceExpression.evaluate(this.source, this.lookupFunctions);\n this.updateTarget(this.rawValue);\n\n if (this.mode !== bindingMode.oneTime) {\n this._version++;\n this.sourceExpression.connect(this, this.source);\n if (this.rawValue instanceof Array) {\n this.observeArray(this.rawValue);\n }\n this.unobserve(false);\n }\n };\n\n ChildInterpolationBinding.prototype.bind = function bind(source) {\n if (this.isBound) {\n if (this.source === source) {\n return;\n }\n this.unbind();\n }\n this.isBound = true;\n this.source = source;\n\n var sourceExpression = this.sourceExpression;\n if (sourceExpression.bind) {\n sourceExpression.bind(this, source, this.lookupFunctions);\n }\n\n this.rawValue = sourceExpression.evaluate(source, this.lookupFunctions);\n this.updateTarget(this.rawValue);\n\n if (this.mode === bindingMode.oneWay) {\n enqueueBindingConnect(this);\n }\n };\n\n ChildInterpolationBinding.prototype.unbind = function unbind() {\n if (!this.isBound) {\n return;\n }\n this.isBound = false;\n var sourceExpression = this.sourceExpression;\n if (sourceExpression.unbind) {\n sourceExpression.unbind(this, this.source);\n }\n this.source = null;\n this.value = null;\n this.rawValue = null;\n this.unobserve(true);\n };\n\n ChildInterpolationBinding.prototype.connect = function connect(evaluate) {\n if (!this.isBound) {\n return;\n }\n if (evaluate) {\n this.rawValue = this.sourceExpression.evaluate(this.source, this.lookupFunctions);\n this.updateTarget(this.rawValue);\n }\n this.sourceExpression.connect(this, this.source);\n if (this.rawValue instanceof Array) {\n this.observeArray(this.rawValue);\n }\n };\n\n return ChildInterpolationBinding;\n}()) || _class2);\n\nexport var LetExpression = function () {\n function LetExpression(observerLocator, targetProperty, sourceExpression, lookupFunctions, toBindingContext) {\n \n\n this.observerLocator = observerLocator;\n this.sourceExpression = sourceExpression;\n this.targetProperty = targetProperty;\n this.lookupFunctions = lookupFunctions;\n this.toBindingContext = toBindingContext;\n }\n\n LetExpression.prototype.createBinding = function createBinding() {\n return new LetBinding(this.observerLocator, this.sourceExpression, this.targetProperty, this.lookupFunctions, this.toBindingContext);\n };\n\n return LetExpression;\n}();\n\nexport var LetBinding = (_dec2 = connectable(), _dec2(_class3 = function () {\n function LetBinding(observerLocator, sourceExpression, targetProperty, lookupFunctions, toBindingContext) {\n \n\n this.observerLocator = observerLocator;\n this.sourceExpression = sourceExpression;\n this.targetProperty = targetProperty;\n this.lookupFunctions = lookupFunctions;\n this.source = null;\n this.target = null;\n this.toBindingContext = toBindingContext;\n }\n\n LetBinding.prototype.updateTarget = function updateTarget() {\n var value = this.sourceExpression.evaluate(this.source, this.lookupFunctions);\n this.target[this.targetProperty] = value;\n };\n\n LetBinding.prototype.call = function call(context) {\n if (!this.isBound) {\n return;\n }\n if (context === sourceContext) {\n this.updateTarget();\n return;\n }\n throw new Error('Unexpected call context ' + context);\n };\n\n LetBinding.prototype.bind = function bind(source) {\n if (this.isBound) {\n if (this.source === source) {\n return;\n }\n this.unbind();\n }\n\n this.isBound = true;\n this.source = source;\n this.target = this.toBindingContext ? source.bindingContext : source.overrideContext;\n\n if (this.sourceExpression.bind) {\n this.sourceExpression.bind(this, source, this.lookupFunctions);\n }\n\n enqueueBindingConnect(this);\n };\n\n LetBinding.prototype.unbind = function unbind() {\n if (!this.isBound) {\n return;\n }\n this.isBound = false;\n if (this.sourceExpression.unbind) {\n this.sourceExpression.unbind(this, this.source);\n }\n this.source = null;\n this.target = null;\n this.unobserve(true);\n };\n\n LetBinding.prototype.connect = function connect() {\n if (!this.isBound) {\n return;\n }\n this.updateTarget();\n this.sourceExpression.connect(this, this.source);\n };\n\n return LetBinding;\n}()) || _class3);\n\nexport var LetInterpolationBindingExpression = function () {\n function LetInterpolationBindingExpression(observerLocator, targetProperty, parts, lookupFunctions, toBindingContext) {\n \n\n this.observerLocator = observerLocator;\n this.targetProperty = targetProperty;\n this.parts = parts;\n this.lookupFunctions = lookupFunctions;\n this.toBindingContext = toBindingContext;\n }\n\n LetInterpolationBindingExpression.prototype.createBinding = function createBinding() {\n return new LetInterpolationBinding(this.observerLocator, this.targetProperty, this.parts, this.lookupFunctions, this.toBindingContext);\n };\n\n return LetInterpolationBindingExpression;\n}();\n\nexport var LetInterpolationBinding = function () {\n function LetInterpolationBinding(observerLocator, targetProperty, parts, lookupFunctions, toBindingContext) {\n \n\n this.observerLocator = observerLocator;\n this.parts = parts;\n this.targetProperty = targetProperty;\n this.lookupFunctions = lookupFunctions;\n this.toBindingContext = toBindingContext;\n this.target = null;\n }\n\n LetInterpolationBinding.prototype.bind = function bind(source) {\n if (this.isBound) {\n if (this.source === source) {\n return;\n }\n this.unbind();\n }\n\n this.isBound = true;\n this.source = source;\n this.target = this.toBindingContext ? source.bindingContext : source.overrideContext;\n\n this.interpolationBinding = this.createInterpolationBinding();\n this.interpolationBinding.bind(source);\n };\n\n LetInterpolationBinding.prototype.unbind = function unbind() {\n if (!this.isBound) {\n return;\n }\n this.isBound = false;\n this.source = null;\n this.target = null;\n this.interpolationBinding.unbind();\n this.interpolationBinding = null;\n };\n\n LetInterpolationBinding.prototype.createInterpolationBinding = function createInterpolationBinding() {\n if (this.parts.length === 3) {\n return new ChildInterpolationBinding(this.target, this.observerLocator, this.parts[1], bindingMode.oneWay, this.lookupFunctions, this.targetProperty, this.parts[0], this.parts[2]);\n }\n return new InterpolationBinding(this.observerLocator, this.parts, this.target, this.targetProperty, bindingMode.oneWay, this.lookupFunctions);\n };\n\n return LetInterpolationBinding;\n}();\n\nexport var SyntaxInterpreter = (_temp2 = _class4 = function () {\n function SyntaxInterpreter(parser, observerLocator, eventManager, attributeMap) {\n \n\n this.parser = parser;\n this.observerLocator = observerLocator;\n this.eventManager = eventManager;\n this.attributeMap = attributeMap;\n }\n\n SyntaxInterpreter.prototype.interpret = function interpret(resources, element, info, existingInstruction, context) {\n if (info.command in this) {\n return this[info.command](resources, element, info, existingInstruction, context);\n }\n\n return this.handleUnknownCommand(resources, element, info, existingInstruction, context);\n };\n\n SyntaxInterpreter.prototype.handleUnknownCommand = function handleUnknownCommand(resources, element, info, existingInstruction, context) {\n LogManager.getLogger('templating-binding').warn('Unknown binding command.', info);\n return existingInstruction;\n };\n\n SyntaxInterpreter.prototype.determineDefaultBindingMode = function determineDefaultBindingMode(element, attrName, context) {\n var tagName = element.tagName.toLowerCase();\n\n if (tagName === 'input' && (attrName === 'value' || attrName === 'files') && element.type !== 'checkbox' && element.type !== 'radio' || tagName === 'input' && attrName === 'checked' && (element.type === 'checkbox' || element.type === 'radio') || (tagName === 'textarea' || tagName === 'select') && attrName === 'value' || (attrName === 'textcontent' || attrName === 'innerhtml') && element.contentEditable === 'true' || attrName === 'scrolltop' || attrName === 'scrollleft') {\n return bindingMode.twoWay;\n }\n\n if (context && attrName in context.attributes && context.attributes[attrName] && context.attributes[attrName].defaultBindingMode >= bindingMode.oneTime) {\n return context.attributes[attrName].defaultBindingMode;\n }\n\n return bindingMode.oneWay;\n };\n\n SyntaxInterpreter.prototype.bind = function bind(resources, element, info, existingInstruction, context) {\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\n\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), info.defaultBindingMode === undefined || info.defaultBindingMode === null ? this.determineDefaultBindingMode(element, info.attrName, context) : info.defaultBindingMode, resources.lookupFunctions);\n\n return instruction;\n };\n\n SyntaxInterpreter.prototype.trigger = function trigger(resources, element, info) {\n return new ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), delegationStrategy.none, true, resources.lookupFunctions);\n };\n\n SyntaxInterpreter.prototype.capture = function capture(resources, element, info) {\n return new ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), delegationStrategy.capturing, true, resources.lookupFunctions);\n };\n\n SyntaxInterpreter.prototype.delegate = function delegate(resources, element, info) {\n return new ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), delegationStrategy.bubbling, true, resources.lookupFunctions);\n };\n\n SyntaxInterpreter.prototype.call = function call(resources, element, info, existingInstruction) {\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\n\n instruction.attributes[info.attrName] = new CallExpression(this.observerLocator, info.attrName, this.parser.parse(info.attrValue), resources.lookupFunctions);\n\n return instruction;\n };\n\n SyntaxInterpreter.prototype.options = function options(resources, element, info, existingInstruction, context) {\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\n var attrValue = info.attrValue;\n var language = this.language;\n var name = null;\n var target = '';\n var current = void 0;\n var i = void 0;\n var ii = void 0;\n var inString = false;\n var inEscape = false;\n var foundName = false;\n\n for (i = 0, ii = attrValue.length; i < ii; ++i) {\n current = attrValue[i];\n\n if (current === ';' && !inString) {\n if (!foundName) {\n name = this._getPrimaryPropertyName(resources, context);\n }\n info = language.inspectAttribute(resources, '?', name, target.trim());\n language.createAttributeInstruction(resources, element, info, instruction, context);\n\n if (!instruction.attributes[info.attrName]) {\n instruction.attributes[info.attrName] = info.attrValue;\n }\n\n target = '';\n name = null;\n } else if (current === ':' && name === null) {\n foundName = true;\n name = target.trim();\n target = '';\n } else if (current === '\\\\') {\n target += current;\n inEscape = true;\n continue;\n } else {\n target += current;\n\n if (name !== null && inEscape === false && current === '\\'') {\n inString = !inString;\n }\n }\n\n inEscape = false;\n }\n\n if (!foundName) {\n name = this._getPrimaryPropertyName(resources, context);\n }\n\n if (name !== null) {\n info = language.inspectAttribute(resources, '?', name, target.trim());\n language.createAttributeInstruction(resources, element, info, instruction, context);\n\n if (!instruction.attributes[info.attrName]) {\n instruction.attributes[info.attrName] = info.attrValue;\n }\n }\n\n return instruction;\n };\n\n SyntaxInterpreter.prototype._getPrimaryPropertyName = function _getPrimaryPropertyName(resources, context) {\n var type = resources.getAttribute(context.attributeName);\n if (type && type.primaryProperty) {\n return type.primaryProperty.attribute;\n }\n return null;\n };\n\n SyntaxInterpreter.prototype['for'] = function _for(resources, element, info, existingInstruction) {\n var parts = void 0;\n var keyValue = void 0;\n var instruction = void 0;\n var attrValue = void 0;\n var isDestructuring = void 0;\n\n attrValue = info.attrValue;\n isDestructuring = attrValue.match(/^ *[[].+[\\]]/);\n parts = isDestructuring ? attrValue.split('of ') : attrValue.split(' of ');\n\n if (parts.length !== 2) {\n throw new Error('Incorrect syntax for \"for\". The form is: \"$local of $items\" or \"[$key, $value] of $items\".');\n }\n\n instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\n\n if (isDestructuring) {\n keyValue = parts[0].replace(/[[\\]]/g, '').replace(/,/g, ' ').replace(/\\s+/g, ' ').trim().split(' ');\n instruction.attributes.key = keyValue[0];\n instruction.attributes.value = keyValue[1];\n } else {\n instruction.attributes.local = parts[0];\n }\n\n instruction.attributes.items = new BindingExpression(this.observerLocator, 'items', this.parser.parse(parts[1]), bindingMode.oneWay, resources.lookupFunctions);\n\n return instruction;\n };\n\n SyntaxInterpreter.prototype['two-way'] = function twoWay(resources, element, info, existingInstruction) {\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\n\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), bindingMode.twoWay, resources.lookupFunctions);\n\n return instruction;\n };\n\n SyntaxInterpreter.prototype['to-view'] = function toView(resources, element, info, existingInstruction) {\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\n\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), bindingMode.toView, resources.lookupFunctions);\n\n return instruction;\n };\n\n SyntaxInterpreter.prototype['from-view'] = function fromView(resources, element, info, existingInstruction) {\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\n\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), bindingMode.fromView, resources.lookupFunctions);\n\n return instruction;\n };\n\n SyntaxInterpreter.prototype['one-time'] = function oneTime(resources, element, info, existingInstruction) {\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\n\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), bindingMode.oneTime, resources.lookupFunctions);\n\n return instruction;\n };\n\n return SyntaxInterpreter;\n}(), _class4.inject = [Parser, ObserverLocator, EventManager, AttributeMap], _temp2);\n\nSyntaxInterpreter.prototype['one-way'] = SyntaxInterpreter.prototype['to-view'];\n\nvar info = {};\n\nexport var TemplatingBindingLanguage = (_temp3 = _class5 = function (_BindingLanguage) {\n _inherits(TemplatingBindingLanguage, _BindingLanguage);\n\n function TemplatingBindingLanguage(parser, observerLocator, syntaxInterpreter, attributeMap) {\n \n\n var _this = _possibleConstructorReturn(this, _BindingLanguage.call(this));\n\n _this.parser = parser;\n _this.observerLocator = observerLocator;\n _this.syntaxInterpreter = syntaxInterpreter;\n _this.emptyStringExpression = _this.parser.parse('\\'\\'');\n syntaxInterpreter.language = _this;\n _this.attributeMap = attributeMap;\n _this.toBindingContextAttr = 'to-binding-context';\n return _this;\n }\n\n TemplatingBindingLanguage.prototype.inspectAttribute = function inspectAttribute(resources, elementName, attrName, attrValue) {\n var parts = attrName.split('.');\n\n info.defaultBindingMode = null;\n\n if (parts.length === 2) {\n info.attrName = parts[0].trim();\n info.attrValue = attrValue;\n info.command = parts[1].trim();\n\n if (info.command === 'ref') {\n info.expression = new NameExpression(this.parser.parse(attrValue), info.attrName, resources.lookupFunctions);\n info.command = null;\n info.attrName = 'ref';\n } else {\n info.expression = null;\n }\n } else if (attrName === 'ref') {\n info.attrName = attrName;\n info.attrValue = attrValue;\n info.command = null;\n info.expression = new NameExpression(this.parser.parse(attrValue), 'element', resources.lookupFunctions);\n } else {\n info.attrName = attrName;\n info.attrValue = attrValue;\n info.command = null;\n var interpolationParts = this.parseInterpolation(resources, attrValue);\n if (interpolationParts === null) {\n info.expression = null;\n } else {\n info.expression = new InterpolationBindingExpression(this.observerLocator, this.attributeMap.map(elementName, attrName), interpolationParts, bindingMode.oneWay, resources.lookupFunctions, attrName);\n }\n }\n\n return info;\n };\n\n TemplatingBindingLanguage.prototype.createAttributeInstruction = function createAttributeInstruction(resources, element, theInfo, existingInstruction, context) {\n var instruction = void 0;\n\n if (theInfo.expression) {\n if (theInfo.attrName === 'ref') {\n return theInfo.expression;\n }\n\n instruction = existingInstruction || BehaviorInstruction.attribute(theInfo.attrName);\n instruction.attributes[theInfo.attrName] = theInfo.expression;\n } else if (theInfo.command) {\n instruction = this.syntaxInterpreter.interpret(resources, element, theInfo, existingInstruction, context);\n }\n\n return instruction;\n };\n\n TemplatingBindingLanguage.prototype.createLetExpressions = function createLetExpressions(resources, letElement) {\n var expressions = [];\n var attributes = letElement.attributes;\n\n var attr = void 0;\n\n var parts = void 0;\n var attrName = void 0;\n var attrValue = void 0;\n var command = void 0;\n var toBindingContextAttr = this.toBindingContextAttr;\n var toBindingContext = letElement.hasAttribute(toBindingContextAttr);\n for (var i = 0, ii = attributes.length; ii > i; ++i) {\n attr = attributes[i];\n attrName = attr.name;\n attrValue = attr.nodeValue;\n parts = attrName.split('.');\n\n if (attrName === toBindingContextAttr) {\n continue;\n }\n\n if (parts.length === 2) {\n command = parts[1];\n if (command !== 'bind') {\n LogManager.getLogger('templating-binding-language').warn('Detected invalid let command. Expected \"' + parts[0] + '.bind\", given \"' + attrName + '\"');\n continue;\n }\n expressions.push(new LetExpression(this.observerLocator, camelCase(parts[0]), this.parser.parse(attrValue), resources.lookupFunctions, toBindingContext));\n } else {\n attrName = camelCase(attrName);\n parts = this.parseInterpolation(resources, attrValue);\n if (parts === null) {\n LogManager.getLogger('templating-binding-language').warn('Detected string literal in let bindings. Did you mean \"' + attrName + '.bind=' + attrValue + '\" or \"' + attrName + '=${' + attrValue + '}\" ?');\n }\n if (parts) {\n expressions.push(new LetInterpolationBindingExpression(this.observerLocator, attrName, parts, resources.lookupFunctions, toBindingContext));\n } else {\n expressions.push(new LetExpression(this.observerLocator, attrName, new LiteralString(attrValue), resources.lookupFunctions, toBindingContext));\n }\n }\n }\n return expressions;\n };\n\n TemplatingBindingLanguage.prototype.inspectTextContent = function inspectTextContent(resources, value) {\n var parts = this.parseInterpolation(resources, value);\n if (parts === null) {\n return null;\n }\n return new InterpolationBindingExpression(this.observerLocator, 'textContent', parts, bindingMode.oneWay, resources.lookupFunctions, 'textContent');\n };\n\n TemplatingBindingLanguage.prototype.parseInterpolation = function parseInterpolation(resources, value) {\n var i = value.indexOf('${', 0);\n var ii = value.length;\n var char = void 0;\n var pos = 0;\n var open = 0;\n var quote = null;\n var interpolationStart = void 0;\n var parts = void 0;\n var partIndex = 0;\n\n while (i >= 0 && i < ii - 2) {\n open = 1;\n interpolationStart = i;\n i += 2;\n\n do {\n char = value[i];\n i++;\n\n if (char === \"'\" || char === '\"') {\n if (quote === null) {\n quote = char;\n } else if (quote === char) {\n quote = null;\n }\n continue;\n }\n\n if (char === '\\\\') {\n i++;\n continue;\n }\n\n if (quote !== null) {\n continue;\n }\n\n if (char === '{') {\n open++;\n } else if (char === '}') {\n open--;\n }\n } while (open > 0 && i < ii);\n\n if (open === 0) {\n parts = parts || [];\n if (value[interpolationStart - 1] === '\\\\' && value[interpolationStart - 2] !== '\\\\') {\n parts[partIndex] = value.substring(pos, interpolationStart - 1) + value.substring(interpolationStart, i);\n partIndex++;\n parts[partIndex] = this.emptyStringExpression;\n partIndex++;\n } else {\n parts[partIndex] = value.substring(pos, interpolationStart);\n partIndex++;\n parts[partIndex] = this.parser.parse(value.substring(interpolationStart + 2, i - 1));\n partIndex++;\n }\n pos = i;\n i = value.indexOf('${', i);\n } else {\n break;\n }\n }\n\n if (partIndex === 0) {\n return null;\n }\n\n parts[partIndex] = value.substr(pos);\n return parts;\n };\n\n return TemplatingBindingLanguage;\n}(BindingLanguage), _class5.inject = [Parser, ObserverLocator, SyntaxInterpreter, AttributeMap], _temp3);\n\nexport function configure(config) {\n config.container.registerSingleton(BindingLanguage, TemplatingBindingLanguage);\n config.container.registerAlias(BindingLanguage, TemplatingBindingLanguage);\n}","import { Container, inject, Optional } from 'aurelia-dependency-injection';\nimport { DOM, FEATURE } from 'aurelia-pal';\nimport { TaskQueue } from 'aurelia-task-queue';\nimport { CompositionEngine, ViewSlot, ViewResources, bindable, noView, customElement, customAttribute, templateController, BoundViewFactory, TargetInstruction, Animator, resource, useView, useShadowDOM, ViewEngine } from 'aurelia-templating';\nimport { createOverrideContext, bindingMode, BindingBehavior, ValueConverter, sourceContext, mergeSplice, ObserverLocator, valueConverter, DataAttributeObserver, bindingBehavior, targetContext, EventSubscriber } from 'aurelia-binding';\nimport { getLogger } from 'aurelia-logging';\nimport { Loader } from 'aurelia-loader';\nimport { relativeToFile } from 'aurelia-path';\nimport { mixin } from 'aurelia-metadata';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\n\nvar Compose = (function () {\r\n function Compose(element, container, compositionEngine, viewSlot, viewResources, taskQueue) {\r\n this.element = element;\r\n this.container = container;\r\n this.compositionEngine = compositionEngine;\r\n this.viewSlot = viewSlot;\r\n this.viewResources = viewResources;\r\n this.taskQueue = taskQueue;\r\n this.currentController = null;\r\n this.currentViewModel = null;\r\n this.changes = Object.create(null);\r\n }\r\n Compose.inject = function () {\r\n return [DOM.Element, Container, CompositionEngine, ViewSlot, ViewResources, TaskQueue];\r\n };\r\n Compose.prototype.created = function (owningView) {\r\n this.owningView = owningView;\r\n };\r\n Compose.prototype.bind = function (bindingContext, overrideContext) {\r\n this.bindingContext = bindingContext;\r\n this.overrideContext = overrideContext;\r\n var changes = this.changes;\r\n changes.view = this.view;\r\n changes.viewModel = this.viewModel;\r\n changes.model = this.model;\r\n if (!this.pendingTask) {\r\n processChanges(this);\r\n }\r\n };\r\n Compose.prototype.unbind = function () {\r\n this.changes = Object.create(null);\r\n this.bindingContext = null;\r\n this.overrideContext = null;\r\n var returnToCache = true;\r\n var skipAnimation = true;\r\n this.viewSlot.removeAll(returnToCache, skipAnimation);\r\n };\r\n Compose.prototype.modelChanged = function (newValue, oldValue) {\r\n this.changes.model = newValue;\r\n requestUpdate(this);\r\n };\r\n Compose.prototype.viewChanged = function (newValue, oldValue) {\r\n this.changes.view = newValue;\r\n requestUpdate(this);\r\n };\r\n Compose.prototype.viewModelChanged = function (newValue, oldValue) {\r\n this.changes.viewModel = newValue;\r\n requestUpdate(this);\r\n };\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"model\", void 0);\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"view\", void 0);\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"viewModel\", void 0);\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"swapOrder\", void 0);\r\n Compose = __decorate([\r\n noView,\r\n customElement('compose')\r\n ], Compose);\r\n return Compose;\r\n}());\r\nfunction isEmpty(obj) {\r\n for (var _ in obj) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction tryActivateViewModel(vm, model) {\r\n if (vm && typeof vm.activate === 'function') {\r\n return Promise.resolve(vm.activate(model));\r\n }\r\n}\r\nfunction createInstruction(composer, instruction) {\r\n return Object.assign(instruction, {\r\n bindingContext: composer.bindingContext,\r\n overrideContext: composer.overrideContext,\r\n owningView: composer.owningView,\r\n container: composer.container,\r\n viewSlot: composer.viewSlot,\r\n viewResources: composer.viewResources,\r\n currentController: composer.currentController,\r\n host: composer.element,\r\n swapOrder: composer.swapOrder\r\n });\r\n}\r\nfunction processChanges(composer) {\r\n var changes = composer.changes;\r\n composer.changes = Object.create(null);\r\n if (!('view' in changes) && !('viewModel' in changes) && ('model' in changes)) {\r\n composer.pendingTask = tryActivateViewModel(composer.currentViewModel, changes.model);\r\n if (!composer.pendingTask) {\r\n return;\r\n }\r\n }\r\n else {\r\n var instruction = {\r\n view: composer.view,\r\n viewModel: composer.currentViewModel || composer.viewModel,\r\n model: composer.model\r\n };\r\n instruction = Object.assign(instruction, changes);\r\n instruction = createInstruction(composer, instruction);\r\n composer.pendingTask = composer.compositionEngine.compose(instruction).then(function (controller) {\r\n composer.currentController = controller;\r\n composer.currentViewModel = controller ? controller.viewModel : null;\r\n });\r\n }\r\n composer.pendingTask = composer.pendingTask\r\n .then(function () {\r\n completeCompositionTask(composer);\r\n }, function (reason) {\r\n completeCompositionTask(composer);\r\n throw reason;\r\n });\r\n}\r\nfunction completeCompositionTask(composer) {\r\n composer.pendingTask = null;\r\n if (!isEmpty(composer.changes)) {\r\n processChanges(composer);\r\n }\r\n}\r\nfunction requestUpdate(composer) {\r\n if (composer.pendingTask || composer.updateRequested) {\r\n return;\r\n }\r\n composer.updateRequested = true;\r\n composer.taskQueue.queueMicroTask(function () {\r\n composer.updateRequested = false;\r\n processChanges(composer);\r\n });\r\n}\n\nvar IfCore = (function () {\r\n function IfCore(viewFactory, viewSlot) {\r\n this.viewFactory = viewFactory;\r\n this.viewSlot = viewSlot;\r\n this.view = null;\r\n this.bindingContext = null;\r\n this.overrideContext = null;\r\n this.showing = false;\r\n this.cache = true;\r\n }\r\n IfCore.prototype.bind = function (bindingContext, overrideContext) {\r\n this.bindingContext = bindingContext;\r\n this.overrideContext = overrideContext;\r\n };\r\n IfCore.prototype.unbind = function () {\r\n if (this.view === null) {\r\n return;\r\n }\r\n this.view.unbind();\r\n if (!this.viewFactory.isCaching) {\r\n return;\r\n }\r\n if (this.showing) {\r\n this.showing = false;\r\n this.viewSlot.remove(this.view, true, true);\r\n }\r\n else {\r\n this.view.returnToCache();\r\n }\r\n this.view = null;\r\n };\r\n IfCore.prototype._show = function () {\r\n if (this.showing) {\r\n if (!this.view.isBound) {\r\n this.view.bind(this.bindingContext, this.overrideContext);\r\n }\r\n return;\r\n }\r\n if (this.view === null) {\r\n this.view = this.viewFactory.create();\r\n }\r\n if (!this.view.isBound) {\r\n this.view.bind(this.bindingContext, this.overrideContext);\r\n }\r\n this.showing = true;\r\n return this.viewSlot.add(this.view);\r\n };\r\n IfCore.prototype._hide = function () {\r\n var _this = this;\r\n if (!this.showing) {\r\n return;\r\n }\r\n this.showing = false;\r\n var removed = this.viewSlot.remove(this.view);\r\n if (removed instanceof Promise) {\r\n return removed.then(function () {\r\n _this._unbindView();\r\n });\r\n }\r\n this._unbindView();\r\n };\r\n IfCore.prototype._unbindView = function () {\r\n var cache = this.cache === 'false' ? false : !!this.cache;\r\n this.view.unbind();\r\n if (!cache) {\r\n this.view = null;\r\n }\r\n };\r\n return IfCore;\r\n}());\n\nvar If = (function (_super) {\r\n __extends(If, _super);\r\n function If() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.cache = true;\r\n return _this;\r\n }\r\n If.prototype.bind = function (bindingContext, overrideContext) {\r\n _super.prototype.bind.call(this, bindingContext, overrideContext);\r\n if (this.condition) {\r\n this._show();\r\n }\r\n else {\r\n this._hide();\r\n }\r\n };\r\n If.prototype.conditionChanged = function (newValue) {\r\n this._update(newValue);\r\n };\r\n If.prototype._update = function (show) {\r\n var _this = this;\r\n if (this.animating) {\r\n return;\r\n }\r\n var promise;\r\n if (this.elseVm) {\r\n promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);\r\n }\r\n else {\r\n promise = show ? this._show() : this._hide();\r\n }\r\n if (promise) {\r\n this.animating = true;\r\n promise.then(function () {\r\n _this.animating = false;\r\n if (_this.condition !== _this.showing) {\r\n _this._update(_this.condition);\r\n }\r\n });\r\n }\r\n };\r\n If.prototype._swap = function (remove, add) {\r\n switch (this.swapOrder) {\r\n case 'before':\r\n return Promise.resolve(add._show()).then(function () { return remove._hide(); });\r\n case 'with':\r\n return Promise.all([remove._hide(), add._show()]);\r\n default:\r\n var promise = remove._hide();\r\n return promise ? promise.then(function () { return add._show(); }) : add._show();\r\n }\r\n };\r\n __decorate([\r\n bindable({ primaryProperty: true })\r\n ], If.prototype, \"condition\", void 0);\r\n __decorate([\r\n bindable\r\n ], If.prototype, \"swapOrder\", void 0);\r\n __decorate([\r\n bindable\r\n ], If.prototype, \"cache\", void 0);\r\n If = __decorate([\r\n customAttribute('if'),\r\n templateController,\r\n inject(BoundViewFactory, ViewSlot)\r\n ], If);\r\n return If;\r\n}(IfCore));\n\nvar Else = (function (_super) {\r\n __extends(Else, _super);\r\n function Else(viewFactory, viewSlot) {\r\n var _this = _super.call(this, viewFactory, viewSlot) || this;\r\n _this._registerInIf();\r\n return _this;\r\n }\r\n Else.prototype.bind = function (bindingContext, overrideContext) {\r\n _super.prototype.bind.call(this, bindingContext, overrideContext);\r\n if (this.ifVm.condition) {\r\n this._hide();\r\n }\r\n else {\r\n this._show();\r\n }\r\n };\r\n Else.prototype._registerInIf = function () {\r\n var previous = this.viewSlot.anchor.previousSibling;\r\n while (previous && !previous.au) {\r\n previous = previous.previousSibling;\r\n }\r\n if (!previous || !previous.au.if) {\r\n throw new Error(\"Can't find matching If for Else custom attribute.\");\r\n }\r\n this.ifVm = previous.au.if.viewModel;\r\n this.ifVm.elseVm = this;\r\n };\r\n Else = __decorate([\r\n customAttribute('else'),\r\n templateController,\r\n inject(BoundViewFactory, ViewSlot)\r\n ], Else);\r\n return Else;\r\n}(IfCore));\n\nvar With = (function () {\r\n function With(viewFactory, viewSlot) {\r\n this.viewFactory = viewFactory;\r\n this.viewSlot = viewSlot;\r\n this.parentOverrideContext = null;\r\n this.view = null;\r\n }\r\n With.prototype.bind = function (bindingContext, overrideContext) {\r\n this.parentOverrideContext = overrideContext;\r\n this.valueChanged(this.value);\r\n };\r\n With.prototype.valueChanged = function (newValue) {\r\n var overrideContext = createOverrideContext(newValue, this.parentOverrideContext);\r\n var view = this.view;\r\n if (!view) {\r\n view = this.view = this.viewFactory.create();\r\n view.bind(newValue, overrideContext);\r\n this.viewSlot.add(view);\r\n }\r\n else {\r\n view.bind(newValue, overrideContext);\r\n }\r\n };\r\n With.prototype.unbind = function () {\r\n var view = this.view;\r\n this.parentOverrideContext = null;\r\n if (view) {\r\n view.unbind();\r\n }\r\n };\r\n With = __decorate([\r\n customAttribute('with'),\r\n templateController,\r\n inject(BoundViewFactory, ViewSlot)\r\n ], With);\r\n return With;\r\n}());\n\nvar oneTime = bindingMode.oneTime;\r\nfunction updateOverrideContexts(views, startIndex) {\r\n var length = views.length;\r\n if (startIndex > 0) {\r\n startIndex = startIndex - 1;\r\n }\r\n for (; startIndex < length; ++startIndex) {\r\n updateOverrideContext(views[startIndex].overrideContext, startIndex, length);\r\n }\r\n}\r\nfunction createFullOverrideContext(repeat, data, index, length, key) {\r\n var bindingContext = {};\r\n var overrideContext = createOverrideContext(bindingContext, repeat.scope.overrideContext);\r\n if (typeof key !== 'undefined') {\r\n bindingContext[repeat.key] = key;\r\n bindingContext[repeat.value] = data;\r\n }\r\n else {\r\n bindingContext[repeat.local] = data;\r\n }\r\n updateOverrideContext(overrideContext, index, length);\r\n return overrideContext;\r\n}\r\nfunction updateOverrideContext(overrideContext, index, length) {\r\n var first = (index === 0);\r\n var last = (index === length - 1);\r\n var even = index % 2 === 0;\r\n overrideContext.$index = index;\r\n overrideContext.$first = first;\r\n overrideContext.$last = last;\r\n overrideContext.$middle = !(first || last);\r\n overrideContext.$odd = !even;\r\n overrideContext.$even = even;\r\n}\r\nfunction getItemsSourceExpression(instruction, attrName) {\r\n return instruction.behaviorInstructions\r\n .filter(function (bi) { return bi.originalAttrName === attrName; })[0]\r\n .attributes\r\n .items\r\n .sourceExpression;\r\n}\r\nfunction unwrapExpression(expression) {\r\n var unwrapped = false;\r\n while (expression instanceof BindingBehavior) {\r\n expression = expression.expression;\r\n }\r\n while (expression instanceof ValueConverter) {\r\n expression = expression.expression;\r\n unwrapped = true;\r\n }\r\n return unwrapped ? expression : null;\r\n}\r\nfunction isOneTime(expression) {\r\n while (expression instanceof BindingBehavior) {\r\n if (expression.name === 'oneTime') {\r\n return true;\r\n }\r\n expression = expression.expression;\r\n }\r\n return false;\r\n}\r\nfunction updateOneTimeBinding(binding) {\r\n if (binding.call && binding.mode === oneTime) {\r\n binding.call(sourceContext);\r\n }\r\n else if (binding.updateOneTimeBindings) {\r\n binding.updateOneTimeBindings();\r\n }\r\n}\r\nfunction indexOf(array, item, matcher, startIndex) {\r\n if (!matcher) {\r\n return array.indexOf(item);\r\n }\r\n var length = array.length;\r\n for (var index = startIndex || 0; index < length; index++) {\r\n if (matcher(array[index], item)) {\r\n return index;\r\n }\r\n }\r\n return -1;\r\n}\n\nvar ArrayRepeatStrategy = (function () {\r\n function ArrayRepeatStrategy() {\r\n }\r\n ArrayRepeatStrategy.prototype.getCollectionObserver = function (observerLocator, items) {\r\n return observerLocator.getArrayObserver(items);\r\n };\r\n ArrayRepeatStrategy.prototype.instanceChanged = function (repeat, items) {\r\n var _this = this;\r\n var itemsLength = items.length;\r\n if (!items || itemsLength === 0) {\r\n repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n return;\r\n }\r\n var children = repeat.views();\r\n var viewsLength = children.length;\r\n if (viewsLength === 0) {\r\n this._standardProcessInstanceChanged(repeat, items);\r\n return;\r\n }\r\n if (repeat.viewsRequireLifecycle) {\r\n var childrenSnapshot = children.slice(0);\r\n var itemNameInBindingContext = repeat.local;\r\n var matcher_1 = repeat.matcher();\r\n var itemsPreviouslyInViews_1 = [];\r\n var viewsToRemove = [];\r\n for (var index = 0; index < viewsLength; index++) {\r\n var view = childrenSnapshot[index];\r\n var oldItem = view.bindingContext[itemNameInBindingContext];\r\n if (indexOf(items, oldItem, matcher_1) === -1) {\r\n viewsToRemove.push(view);\r\n }\r\n else {\r\n itemsPreviouslyInViews_1.push(oldItem);\r\n }\r\n }\r\n var updateViews = void 0;\r\n var removePromise = void 0;\r\n if (itemsPreviouslyInViews_1.length > 0) {\r\n removePromise = repeat.removeViews(viewsToRemove, true, !repeat.viewsRequireLifecycle);\r\n updateViews = function () {\r\n for (var index = 0; index < itemsLength; index++) {\r\n var item = items[index];\r\n var indexOfView = indexOf(itemsPreviouslyInViews_1, item, matcher_1, index);\r\n var view = void 0;\r\n if (indexOfView === -1) {\r\n var overrideContext = createFullOverrideContext(repeat, items[index], index, itemsLength);\r\n repeat.insertView(index, overrideContext.bindingContext, overrideContext);\r\n itemsPreviouslyInViews_1.splice(index, 0, undefined);\r\n }\r\n else if (indexOfView === index) {\r\n view = children[indexOfView];\r\n itemsPreviouslyInViews_1[indexOfView] = undefined;\r\n }\r\n else {\r\n view = children[indexOfView];\r\n repeat.moveView(indexOfView, index);\r\n itemsPreviouslyInViews_1.splice(indexOfView, 1);\r\n itemsPreviouslyInViews_1.splice(index, 0, undefined);\r\n }\r\n if (view) {\r\n updateOverrideContext(view.overrideContext, index, itemsLength);\r\n }\r\n }\r\n _this._inPlaceProcessItems(repeat, items);\r\n };\r\n }\r\n else {\r\n removePromise = repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n updateViews = function () { return _this._standardProcessInstanceChanged(repeat, items); };\r\n }\r\n if (removePromise instanceof Promise) {\r\n removePromise.then(updateViews);\r\n }\r\n else {\r\n updateViews();\r\n }\r\n }\r\n else {\r\n this._inPlaceProcessItems(repeat, items);\r\n }\r\n };\r\n ArrayRepeatStrategy.prototype._standardProcessInstanceChanged = function (repeat, items) {\r\n for (var i = 0, ii = items.length; i < ii; i++) {\r\n var overrideContext = createFullOverrideContext(repeat, items[i], i, ii);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n }\r\n };\r\n ArrayRepeatStrategy.prototype._inPlaceProcessItems = function (repeat, items) {\r\n var itemsLength = items.length;\r\n var viewsLength = repeat.viewCount();\r\n while (viewsLength > itemsLength) {\r\n viewsLength--;\r\n repeat.removeView(viewsLength, true, !repeat.viewsRequireLifecycle);\r\n }\r\n var local = repeat.local;\r\n for (var i = 0; i < viewsLength; i++) {\r\n var view = repeat.view(i);\r\n var last = i === itemsLength - 1;\r\n var middle = i !== 0 && !last;\r\n var bindingContext = view.bindingContext;\r\n var overrideContext = view.overrideContext;\r\n if (bindingContext[local] === items[i]\r\n && overrideContext.$middle === middle\r\n && overrideContext.$last === last) {\r\n continue;\r\n }\r\n bindingContext[local] = items[i];\r\n overrideContext.$middle = middle;\r\n overrideContext.$last = last;\r\n repeat.updateBindings(view);\r\n }\r\n for (var i = viewsLength; i < itemsLength; i++) {\r\n var overrideContext = createFullOverrideContext(repeat, items[i], i, itemsLength);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n }\r\n };\r\n ArrayRepeatStrategy.prototype.instanceMutated = function (repeat, array, splices) {\r\n var _this = this;\r\n if (repeat.__queuedSplices) {\r\n for (var i = 0, ii = splices.length; i < ii; ++i) {\r\n var _a = splices[i], index = _a.index, removed = _a.removed, addedCount = _a.addedCount;\r\n mergeSplice(repeat.__queuedSplices, index, removed, addedCount);\r\n }\r\n repeat.__array = array.slice(0);\r\n return;\r\n }\r\n var maybePromise = this._runSplices(repeat, array.slice(0), splices);\r\n if (maybePromise instanceof Promise) {\r\n var queuedSplices_1 = repeat.__queuedSplices = [];\r\n var runQueuedSplices_1 = function () {\r\n if (!queuedSplices_1.length) {\r\n repeat.__queuedSplices = undefined;\r\n repeat.__array = undefined;\r\n return;\r\n }\r\n var nextPromise = _this._runSplices(repeat, repeat.__array, queuedSplices_1) || Promise.resolve();\r\n queuedSplices_1 = repeat.__queuedSplices = [];\r\n nextPromise.then(runQueuedSplices_1);\r\n };\r\n maybePromise.then(runQueuedSplices_1);\r\n }\r\n };\r\n ArrayRepeatStrategy.prototype._runSplices = function (repeat, array, splices) {\r\n var _this = this;\r\n var removeDelta = 0;\r\n var rmPromises = [];\r\n for (var i = 0, ii = splices.length; i < ii; ++i) {\r\n var splice = splices[i];\r\n var removed = splice.removed;\r\n for (var j = 0, jj = removed.length; j < jj; ++j) {\r\n var viewOrPromise = repeat.removeView(splice.index + removeDelta + rmPromises.length, true);\r\n if (viewOrPromise instanceof Promise) {\r\n rmPromises.push(viewOrPromise);\r\n }\r\n }\r\n removeDelta -= splice.addedCount;\r\n }\r\n if (rmPromises.length > 0) {\r\n return Promise.all(rmPromises).then(function () {\r\n var spliceIndexLow = _this._handleAddedSplices(repeat, array, splices);\r\n updateOverrideContexts(repeat.views(), spliceIndexLow);\r\n });\r\n }\r\n var spliceIndexLow = this._handleAddedSplices(repeat, array, splices);\r\n updateOverrideContexts(repeat.views(), spliceIndexLow);\r\n return undefined;\r\n };\r\n ArrayRepeatStrategy.prototype._handleAddedSplices = function (repeat, array, splices) {\r\n var spliceIndex;\r\n var spliceIndexLow;\r\n var arrayLength = array.length;\r\n for (var i = 0, ii = splices.length; i < ii; ++i) {\r\n var splice = splices[i];\r\n var addIndex = spliceIndex = splice.index;\r\n var end = splice.index + splice.addedCount;\r\n if (typeof spliceIndexLow === 'undefined' || spliceIndexLow === null || spliceIndexLow > splice.index) {\r\n spliceIndexLow = spliceIndex;\r\n }\r\n for (; addIndex < end; ++addIndex) {\r\n var overrideContext = createFullOverrideContext(repeat, array[addIndex], addIndex, arrayLength);\r\n repeat.insertView(addIndex, overrideContext.bindingContext, overrideContext);\r\n }\r\n }\r\n return spliceIndexLow;\r\n };\r\n return ArrayRepeatStrategy;\r\n}());\n\nvar MapRepeatStrategy = (function () {\r\n function MapRepeatStrategy() {\r\n }\r\n MapRepeatStrategy.prototype.getCollectionObserver = function (observerLocator, items) {\r\n return observerLocator.getMapObserver(items);\r\n };\r\n MapRepeatStrategy.prototype.instanceChanged = function (repeat, items) {\r\n var _this = this;\r\n var removePromise = repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n if (removePromise instanceof Promise) {\r\n removePromise.then(function () { return _this._standardProcessItems(repeat, items); });\r\n return;\r\n }\r\n this._standardProcessItems(repeat, items);\r\n };\r\n MapRepeatStrategy.prototype._standardProcessItems = function (repeat, items) {\r\n var index = 0;\r\n var overrideContext;\r\n items.forEach(function (value, key) {\r\n overrideContext = createFullOverrideContext(repeat, value, index, items.size, key);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n ++index;\r\n });\r\n };\r\n MapRepeatStrategy.prototype.instanceMutated = function (repeat, map, records) {\r\n var key;\r\n var i;\r\n var ii;\r\n var overrideContext;\r\n var removeIndex;\r\n var addIndex;\r\n var record;\r\n var rmPromises = [];\r\n var viewOrPromise;\r\n for (i = 0, ii = records.length; i < ii; ++i) {\r\n record = records[i];\r\n key = record.key;\r\n switch (record.type) {\r\n case 'update':\r\n removeIndex = this._getViewIndexByKey(repeat, key);\r\n viewOrPromise = repeat.removeView(removeIndex, true, !repeat.viewsRequireLifecycle);\r\n if (viewOrPromise instanceof Promise) {\r\n rmPromises.push(viewOrPromise);\r\n }\r\n overrideContext = createFullOverrideContext(repeat, map.get(key), removeIndex, map.size, key);\r\n repeat.insertView(removeIndex, overrideContext.bindingContext, overrideContext);\r\n break;\r\n case 'add':\r\n addIndex = repeat.viewCount() <= map.size - 1 ? repeat.viewCount() : map.size - 1;\r\n overrideContext = createFullOverrideContext(repeat, map.get(key), addIndex, map.size, key);\r\n repeat.insertView(map.size - 1, overrideContext.bindingContext, overrideContext);\r\n break;\r\n case 'delete':\r\n if (record.oldValue === undefined) {\r\n return;\r\n }\r\n removeIndex = this._getViewIndexByKey(repeat, key);\r\n viewOrPromise = repeat.removeView(removeIndex, true, !repeat.viewsRequireLifecycle);\r\n if (viewOrPromise instanceof Promise) {\r\n rmPromises.push(viewOrPromise);\r\n }\r\n break;\r\n case 'clear':\r\n repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n break;\r\n default:\r\n continue;\r\n }\r\n }\r\n if (rmPromises.length > 0) {\r\n Promise.all(rmPromises).then(function () {\r\n updateOverrideContexts(repeat.views(), 0);\r\n });\r\n }\r\n else {\r\n updateOverrideContexts(repeat.views(), 0);\r\n }\r\n };\r\n MapRepeatStrategy.prototype._getViewIndexByKey = function (repeat, key) {\r\n var i;\r\n var ii;\r\n var child;\r\n for (i = 0, ii = repeat.viewCount(); i < ii; ++i) {\r\n child = repeat.view(i);\r\n if (child.bindingContext[repeat.key] === key) {\r\n return i;\r\n }\r\n }\r\n return undefined;\r\n };\r\n return MapRepeatStrategy;\r\n}());\n\nvar NullRepeatStrategy = (function () {\r\n function NullRepeatStrategy() {\r\n }\r\n NullRepeatStrategy.prototype.instanceChanged = function (repeat, items) {\r\n repeat.removeAllViews(true);\r\n };\r\n NullRepeatStrategy.prototype.getCollectionObserver = function (observerLocator, items) {\r\n };\r\n return NullRepeatStrategy;\r\n}());\n\nvar NumberRepeatStrategy = (function () {\r\n function NumberRepeatStrategy() {\r\n }\r\n NumberRepeatStrategy.prototype.getCollectionObserver = function () {\r\n return null;\r\n };\r\n NumberRepeatStrategy.prototype.instanceChanged = function (repeat, value) {\r\n var _this = this;\r\n var removePromise = repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n if (removePromise instanceof Promise) {\r\n removePromise.then(function () { return _this._standardProcessItems(repeat, value); });\r\n return;\r\n }\r\n this._standardProcessItems(repeat, value);\r\n };\r\n NumberRepeatStrategy.prototype._standardProcessItems = function (repeat, value) {\r\n var childrenLength = repeat.viewCount();\r\n var i;\r\n var ii;\r\n var overrideContext;\r\n var viewsToRemove;\r\n value = Math.floor(value);\r\n viewsToRemove = childrenLength - value;\r\n if (viewsToRemove > 0) {\r\n if (viewsToRemove > childrenLength) {\r\n viewsToRemove = childrenLength;\r\n }\r\n for (i = 0, ii = viewsToRemove; i < ii; ++i) {\r\n repeat.removeView(childrenLength - (i + 1), true, !repeat.viewsRequireLifecycle);\r\n }\r\n return;\r\n }\r\n for (i = childrenLength, ii = value; i < ii; ++i) {\r\n overrideContext = createFullOverrideContext(repeat, i, i, ii);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n }\r\n updateOverrideContexts(repeat.views(), 0);\r\n };\r\n return NumberRepeatStrategy;\r\n}());\n\nvar SetRepeatStrategy = (function () {\r\n function SetRepeatStrategy() {\r\n }\r\n SetRepeatStrategy.prototype.getCollectionObserver = function (observerLocator, items) {\r\n return observerLocator.getSetObserver(items);\r\n };\r\n SetRepeatStrategy.prototype.instanceChanged = function (repeat, items) {\r\n var _this = this;\r\n var removePromise = repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n if (removePromise instanceof Promise) {\r\n removePromise.then(function () { return _this._standardProcessItems(repeat, items); });\r\n return;\r\n }\r\n this._standardProcessItems(repeat, items);\r\n };\r\n SetRepeatStrategy.prototype._standardProcessItems = function (repeat, items) {\r\n var index = 0;\r\n var overrideContext;\r\n items.forEach(function (value) {\r\n overrideContext = createFullOverrideContext(repeat, value, index, items.size);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n ++index;\r\n });\r\n };\r\n SetRepeatStrategy.prototype.instanceMutated = function (repeat, set, records) {\r\n var value;\r\n var i;\r\n var ii;\r\n var overrideContext;\r\n var removeIndex;\r\n var record;\r\n var rmPromises = [];\r\n var viewOrPromise;\r\n for (i = 0, ii = records.length; i < ii; ++i) {\r\n record = records[i];\r\n value = record.value;\r\n switch (record.type) {\r\n case 'add':\r\n var size = Math.max(set.size - 1, 0);\r\n overrideContext = createFullOverrideContext(repeat, value, size, set.size);\r\n repeat.insertView(size, overrideContext.bindingContext, overrideContext);\r\n break;\r\n case 'delete':\r\n removeIndex = this._getViewIndexByValue(repeat, value);\r\n viewOrPromise = repeat.removeView(removeIndex, true, !repeat.viewsRequireLifecycle);\r\n if (viewOrPromise instanceof Promise) {\r\n rmPromises.push(viewOrPromise);\r\n }\r\n break;\r\n case 'clear':\r\n repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n break;\r\n default:\r\n continue;\r\n }\r\n }\r\n if (rmPromises.length > 0) {\r\n Promise.all(rmPromises).then(function () {\r\n updateOverrideContexts(repeat.views(), 0);\r\n });\r\n }\r\n else {\r\n updateOverrideContexts(repeat.views(), 0);\r\n }\r\n };\r\n SetRepeatStrategy.prototype._getViewIndexByValue = function (repeat, value) {\r\n var i;\r\n var ii;\r\n var child;\r\n for (i = 0, ii = repeat.viewCount(); i < ii; ++i) {\r\n child = repeat.view(i);\r\n if (child.bindingContext[repeat.local] === value) {\r\n return i;\r\n }\r\n }\r\n return undefined;\r\n };\r\n return SetRepeatStrategy;\r\n}());\n\nvar RepeatStrategyLocator = (function () {\r\n function RepeatStrategyLocator() {\r\n this.matchers = [];\r\n this.strategies = [];\r\n this.addStrategy(function (items) { return items === null || items === undefined; }, new NullRepeatStrategy());\r\n this.addStrategy(function (items) { return items instanceof Array; }, new ArrayRepeatStrategy());\r\n this.addStrategy(function (items) { return items instanceof Map; }, new MapRepeatStrategy());\r\n this.addStrategy(function (items) { return items instanceof Set; }, new SetRepeatStrategy());\r\n this.addStrategy(function (items) { return typeof items === 'number'; }, new NumberRepeatStrategy());\r\n }\r\n RepeatStrategyLocator.prototype.addStrategy = function (matcher, strategy) {\r\n this.matchers.push(matcher);\r\n this.strategies.push(strategy);\r\n };\r\n RepeatStrategyLocator.prototype.getStrategy = function (items) {\r\n var matchers = this.matchers;\r\n for (var i = 0, ii = matchers.length; i < ii; ++i) {\r\n if (matchers[i](items)) {\r\n return this.strategies[i];\r\n }\r\n }\r\n return null;\r\n };\r\n return RepeatStrategyLocator;\r\n}());\n\nvar lifecycleOptionalBehaviors = ['focus', 'if', 'else', 'repeat', 'show', 'hide', 'with'];\r\nfunction behaviorRequiresLifecycle(instruction) {\r\n var t = instruction.type;\r\n var name = t.elementName !== null ? t.elementName : t.attributeName;\r\n return lifecycleOptionalBehaviors.indexOf(name) === -1 && (t.handlesAttached || t.handlesBind || t.handlesCreated || t.handlesDetached || t.handlesUnbind)\r\n || t.viewFactory && viewsRequireLifecycle(t.viewFactory)\r\n || instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory);\r\n}\r\nfunction targetRequiresLifecycle(instruction) {\r\n var behaviors = instruction.behaviorInstructions;\r\n if (behaviors) {\r\n var i = behaviors.length;\r\n while (i--) {\r\n if (behaviorRequiresLifecycle(behaviors[i])) {\r\n return true;\r\n }\r\n }\r\n }\r\n return instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory);\r\n}\r\nfunction viewsRequireLifecycle(viewFactory) {\r\n if ('_viewsRequireLifecycle' in viewFactory) {\r\n return viewFactory._viewsRequireLifecycle;\r\n }\r\n viewFactory._viewsRequireLifecycle = false;\r\n if (viewFactory.viewFactory) {\r\n viewFactory._viewsRequireLifecycle = viewsRequireLifecycle(viewFactory.viewFactory);\r\n return viewFactory._viewsRequireLifecycle;\r\n }\r\n if (viewFactory.template.querySelector('.au-animate')) {\r\n viewFactory._viewsRequireLifecycle = true;\r\n return true;\r\n }\r\n for (var id in viewFactory.instructions) {\r\n if (targetRequiresLifecycle(viewFactory.instructions[id])) {\r\n viewFactory._viewsRequireLifecycle = true;\r\n return true;\r\n }\r\n }\r\n viewFactory._viewsRequireLifecycle = false;\r\n return false;\r\n}\n\nvar AbstractRepeater = (function () {\r\n function AbstractRepeater(options) {\r\n Object.assign(this, {\r\n local: 'items',\r\n viewsRequireLifecycle: true\r\n }, options);\r\n }\r\n AbstractRepeater.prototype.viewCount = function () {\r\n throw new Error('subclass must implement `viewCount`');\r\n };\r\n AbstractRepeater.prototype.views = function () {\r\n throw new Error('subclass must implement `views`');\r\n };\r\n AbstractRepeater.prototype.view = function (index) {\r\n throw new Error('subclass must implement `view`');\r\n };\r\n AbstractRepeater.prototype.matcher = function () {\r\n throw new Error('subclass must implement `matcher`');\r\n };\r\n AbstractRepeater.prototype.addView = function (bindingContext, overrideContext) {\r\n throw new Error('subclass must implement `addView`');\r\n };\r\n AbstractRepeater.prototype.insertView = function (index, bindingContext, overrideContext) {\r\n throw new Error('subclass must implement `insertView`');\r\n };\r\n AbstractRepeater.prototype.moveView = function (sourceIndex, targetIndex) {\r\n throw new Error('subclass must implement `moveView`');\r\n };\r\n AbstractRepeater.prototype.removeAllViews = function (returnToCache, skipAnimation) {\r\n throw new Error('subclass must implement `removeAllViews`');\r\n };\r\n AbstractRepeater.prototype.removeViews = function (viewsToRemove, returnToCache, skipAnimation) {\r\n throw new Error('subclass must implement `removeView`');\r\n };\r\n AbstractRepeater.prototype.removeView = function (index, returnToCache, skipAnimation) {\r\n throw new Error('subclass must implement `removeView`');\r\n };\r\n AbstractRepeater.prototype.updateBindings = function (view) {\r\n throw new Error('subclass must implement `updateBindings`');\r\n };\r\n return AbstractRepeater;\r\n}());\n\nvar Repeat = (function (_super) {\r\n __extends(Repeat, _super);\r\n function Repeat(viewFactory, instruction, viewSlot, viewResources, observerLocator, strategyLocator) {\r\n var _this = _super.call(this, {\r\n local: 'item',\r\n viewsRequireLifecycle: viewsRequireLifecycle(viewFactory)\r\n }) || this;\r\n _this.viewFactory = viewFactory;\r\n _this.instruction = instruction;\r\n _this.viewSlot = viewSlot;\r\n _this.lookupFunctions = viewResources.lookupFunctions;\r\n _this.observerLocator = observerLocator;\r\n _this.key = 'key';\r\n _this.value = 'value';\r\n _this.strategyLocator = strategyLocator;\r\n _this.ignoreMutation = false;\r\n _this.sourceExpression = getItemsSourceExpression(_this.instruction, 'repeat.for');\r\n _this.isOneTime = isOneTime(_this.sourceExpression);\r\n _this.viewsRequireLifecycle = viewsRequireLifecycle(viewFactory);\r\n return _this;\r\n }\r\n Repeat.prototype.call = function (context, changes) {\r\n this[context](this.items, changes);\r\n };\r\n Repeat.prototype.bind = function (bindingContext, overrideContext) {\r\n this.scope = { bindingContext: bindingContext, overrideContext: overrideContext };\r\n this.matcherBinding = this._captureAndRemoveMatcherBinding();\r\n this.itemsChanged();\r\n };\r\n Repeat.prototype.unbind = function () {\r\n this.scope = null;\r\n this.items = null;\r\n this.matcherBinding = null;\r\n this.viewSlot.removeAll(true, true);\r\n this._unsubscribeCollection();\r\n };\r\n Repeat.prototype._unsubscribeCollection = function () {\r\n if (this.collectionObserver) {\r\n this.collectionObserver.unsubscribe(this.callContext, this);\r\n this.collectionObserver = null;\r\n this.callContext = null;\r\n }\r\n };\r\n Repeat.prototype.itemsChanged = function () {\r\n var _this = this;\r\n this._unsubscribeCollection();\r\n if (!this.scope) {\r\n return;\r\n }\r\n var items = this.items;\r\n this.strategy = this.strategyLocator.getStrategy(items);\r\n if (!this.strategy) {\r\n throw new Error(\"Value for '\" + this.sourceExpression + \"' is non-repeatable\");\r\n }\r\n if (!this.isOneTime && !this._observeInnerCollection()) {\r\n this._observeCollection();\r\n }\r\n this.ignoreMutation = true;\r\n this.strategy.instanceChanged(this, items);\r\n this.observerLocator.taskQueue.queueMicroTask(function () {\r\n _this.ignoreMutation = false;\r\n });\r\n };\r\n Repeat.prototype._getInnerCollection = function () {\r\n var expression = unwrapExpression(this.sourceExpression);\r\n if (!expression) {\r\n return null;\r\n }\r\n return expression.evaluate(this.scope, null);\r\n };\r\n Repeat.prototype.handleCollectionMutated = function (collection, changes) {\r\n if (!this.collectionObserver) {\r\n return;\r\n }\r\n if (this.ignoreMutation) {\r\n return;\r\n }\r\n this.strategy.instanceMutated(this, collection, changes);\r\n };\r\n Repeat.prototype.handleInnerCollectionMutated = function (collection, changes) {\r\n var _this = this;\r\n if (!this.collectionObserver) {\r\n return;\r\n }\r\n if (this.ignoreMutation) {\r\n return;\r\n }\r\n this.ignoreMutation = true;\r\n var newItems = this.sourceExpression.evaluate(this.scope, this.lookupFunctions);\r\n this.observerLocator.taskQueue.queueMicroTask(function () { return _this.ignoreMutation = false; });\r\n if (newItems === this.items) {\r\n this.itemsChanged();\r\n }\r\n else {\r\n this.items = newItems;\r\n }\r\n };\r\n Repeat.prototype._observeInnerCollection = function () {\r\n var items = this._getInnerCollection();\r\n var strategy = this.strategyLocator.getStrategy(items);\r\n if (!strategy) {\r\n return false;\r\n }\r\n this.collectionObserver = strategy.getCollectionObserver(this.observerLocator, items);\r\n if (!this.collectionObserver) {\r\n return false;\r\n }\r\n this.callContext = 'handleInnerCollectionMutated';\r\n this.collectionObserver.subscribe(this.callContext, this);\r\n return true;\r\n };\r\n Repeat.prototype._observeCollection = function () {\r\n var items = this.items;\r\n this.collectionObserver = this.strategy.getCollectionObserver(this.observerLocator, items);\r\n if (this.collectionObserver) {\r\n this.callContext = 'handleCollectionMutated';\r\n this.collectionObserver.subscribe(this.callContext, this);\r\n }\r\n };\r\n Repeat.prototype._captureAndRemoveMatcherBinding = function () {\r\n if (this.viewFactory.viewFactory) {\r\n var instructions = this.viewFactory.viewFactory.instructions;\r\n var instructionIds = Object.keys(instructions);\r\n for (var i = 0; i < instructionIds.length; i++) {\r\n var expressions = instructions[instructionIds[i]].expressions;\r\n if (expressions) {\r\n for (var ii = 0; ii < expressions.length; ii++) {\r\n if (expressions[ii].targetProperty === 'matcher') {\r\n var matcherBinding = expressions[ii];\r\n expressions.splice(ii, 1);\r\n return matcherBinding;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n };\r\n Repeat.prototype.viewCount = function () { return this.viewSlot.children.length; };\r\n Repeat.prototype.views = function () { return this.viewSlot.children; };\r\n Repeat.prototype.view = function (index) { return this.viewSlot.children[index]; };\r\n Repeat.prototype.matcher = function () { return this.matcherBinding ? this.matcherBinding.sourceExpression.evaluate(this.scope, this.matcherBinding.lookupFunctions) : null; };\r\n Repeat.prototype.addView = function (bindingContext, overrideContext) {\r\n var view = this.viewFactory.create();\r\n view.bind(bindingContext, overrideContext);\r\n this.viewSlot.add(view);\r\n };\r\n Repeat.prototype.insertView = function (index, bindingContext, overrideContext) {\r\n var view = this.viewFactory.create();\r\n view.bind(bindingContext, overrideContext);\r\n this.viewSlot.insert(index, view);\r\n };\r\n Repeat.prototype.moveView = function (sourceIndex, targetIndex) {\r\n this.viewSlot.move(sourceIndex, targetIndex);\r\n };\r\n Repeat.prototype.removeAllViews = function (returnToCache, skipAnimation) {\r\n return this.viewSlot.removeAll(returnToCache, skipAnimation);\r\n };\r\n Repeat.prototype.removeViews = function (viewsToRemove, returnToCache, skipAnimation) {\r\n return this.viewSlot.removeMany(viewsToRemove, returnToCache, skipAnimation);\r\n };\r\n Repeat.prototype.removeView = function (index, returnToCache, skipAnimation) {\r\n return this.viewSlot.removeAt(index, returnToCache, skipAnimation);\r\n };\r\n Repeat.prototype.updateBindings = function (view) {\r\n var $view = view;\r\n var j = $view.bindings.length;\r\n while (j--) {\r\n updateOneTimeBinding($view.bindings[j]);\r\n }\r\n j = $view.controllers.length;\r\n while (j--) {\r\n var k = $view.controllers[j].boundProperties.length;\r\n while (k--) {\r\n var binding = $view.controllers[j].boundProperties[k].binding;\r\n updateOneTimeBinding(binding);\r\n }\r\n }\r\n };\r\n __decorate([\r\n bindable\r\n ], Repeat.prototype, \"items\", void 0);\r\n __decorate([\r\n bindable\r\n ], Repeat.prototype, \"local\", void 0);\r\n __decorate([\r\n bindable\r\n ], Repeat.prototype, \"key\", void 0);\r\n __decorate([\r\n bindable\r\n ], Repeat.prototype, \"value\", void 0);\r\n Repeat = __decorate([\r\n customAttribute('repeat'),\r\n templateController,\r\n inject(BoundViewFactory, TargetInstruction, ViewSlot, ViewResources, ObserverLocator, RepeatStrategyLocator)\r\n ], Repeat);\r\n return Repeat;\r\n}(AbstractRepeater));\n\nvar aureliaHideClassName = 'aurelia-hide';\r\nvar aureliaHideClass = \".\" + aureliaHideClassName + \" { display:none !important; }\";\r\nfunction injectAureliaHideStyleAtHead() {\r\n DOM.injectStyles(aureliaHideClass);\r\n}\r\nfunction injectAureliaHideStyleAtBoundary(domBoundary) {\r\n if (FEATURE.shadowDOM && domBoundary && !domBoundary.hasAureliaHideStyle) {\r\n domBoundary.hasAureliaHideStyle = true;\r\n DOM.injectStyles(aureliaHideClass, domBoundary);\r\n }\r\n}\n\nvar Show = (function () {\r\n function Show(element, animator, domBoundary) {\r\n this.element = element;\r\n this.animator = animator;\r\n this.domBoundary = domBoundary;\r\n }\r\n Show.inject = function () {\r\n return [DOM.Element, Animator, Optional.of(DOM.boundary, true)];\r\n };\r\n Show.prototype.created = function () {\r\n injectAureliaHideStyleAtBoundary(this.domBoundary);\r\n };\r\n Show.prototype.valueChanged = function (newValue) {\r\n var element = this.element;\r\n var animator = this.animator;\r\n if (newValue) {\r\n animator.removeClass(element, aureliaHideClassName);\r\n }\r\n else {\r\n animator.addClass(element, aureliaHideClassName);\r\n }\r\n };\r\n Show.prototype.bind = function (bindingContext) {\r\n this.valueChanged(this.value);\r\n };\r\n Show = __decorate([\r\n customAttribute('show')\r\n ], Show);\r\n return Show;\r\n}());\n\nvar Hide = (function () {\r\n function Hide(element, animator, domBoundary) {\r\n this.element = element;\r\n this.animator = animator;\r\n this.domBoundary = domBoundary;\r\n }\r\n Hide.inject = function () {\r\n return [DOM.Element, Animator, Optional.of(DOM.boundary, true)];\r\n };\r\n Hide.prototype.created = function () {\r\n injectAureliaHideStyleAtBoundary(this.domBoundary);\r\n };\r\n Hide.prototype.valueChanged = function (newValue) {\r\n if (newValue) {\r\n this.animator.addClass(this.element, aureliaHideClassName);\r\n }\r\n else {\r\n this.animator.removeClass(this.element, aureliaHideClassName);\r\n }\r\n };\r\n Hide.prototype.bind = function (bindingContext) {\r\n this.valueChanged(this.value);\r\n };\r\n Hide.prototype.value = function (value) {\r\n throw new Error('Method not implemented.');\r\n };\r\n Hide = __decorate([\r\n customAttribute('hide')\r\n ], Hide);\r\n return Hide;\r\n}());\n\nvar SCRIPT_REGEX = /)<[^<]*)*<\\/script>/gi;\r\nvar needsToWarn = true;\r\nvar HTMLSanitizer = (function () {\r\n function HTMLSanitizer() {\r\n }\r\n HTMLSanitizer.prototype.sanitize = function (input) {\r\n if (needsToWarn) {\r\n needsToWarn = false;\r\n getLogger('html-sanitizer')\r\n .warn(\"CAUTION: The default HTMLSanitizer does NOT provide security against a wide variety of sophisticated XSS attacks,\\nand should not be relied on for sanitizing input from unknown sources.\\nPlease see https://aurelia.io/docs/binding/basics#element-content for instructions on how to use a secure solution like DOMPurify or sanitize-html.\");\r\n }\r\n return input.replace(SCRIPT_REGEX, '');\r\n };\r\n return HTMLSanitizer;\r\n}());\n\nvar SanitizeHTMLValueConverter = (function () {\r\n function SanitizeHTMLValueConverter(sanitizer) {\r\n this.sanitizer = sanitizer;\r\n }\r\n SanitizeHTMLValueConverter.prototype.toView = function (untrustedMarkup) {\r\n if (untrustedMarkup === null || untrustedMarkup === undefined) {\r\n return null;\r\n }\r\n return this.sanitizer.sanitize(untrustedMarkup);\r\n };\r\n SanitizeHTMLValueConverter = __decorate([\r\n valueConverter('sanitizeHTML'),\r\n inject(HTMLSanitizer)\r\n ], SanitizeHTMLValueConverter);\r\n return SanitizeHTMLValueConverter;\r\n}());\n\nvar Replaceable = (function () {\r\n function Replaceable(viewFactory, viewSlot) {\r\n this.viewFactory = viewFactory;\r\n this.viewSlot = viewSlot;\r\n this.view = null;\r\n }\r\n Replaceable.prototype.bind = function (bindingContext, overrideContext) {\r\n if (this.view === null) {\r\n this.view = this.viewFactory.create();\r\n this.viewSlot.add(this.view);\r\n }\r\n this.view.bind(bindingContext, overrideContext);\r\n };\r\n Replaceable.prototype.unbind = function () {\r\n this.view.unbind();\r\n };\r\n Replaceable = __decorate([\r\n customAttribute('replaceable'),\r\n templateController,\r\n inject(BoundViewFactory, ViewSlot)\r\n ], Replaceable);\r\n return Replaceable;\r\n}());\n\nvar Focus = (function () {\r\n function Focus(element, taskQueue) {\r\n this.element = element;\r\n this.taskQueue = taskQueue;\r\n this.isAttached = false;\r\n this.needsApply = false;\r\n }\r\n Focus.inject = function () {\r\n return [DOM.Element, TaskQueue];\r\n };\r\n Focus.prototype.valueChanged = function (newValue) {\r\n if (this.isAttached) {\r\n this._apply();\r\n }\r\n else {\r\n this.needsApply = true;\r\n }\r\n };\r\n Focus.prototype._apply = function () {\r\n var _this = this;\r\n if (this.value) {\r\n this.taskQueue.queueMicroTask(function () {\r\n if (_this.value) {\r\n _this.element.focus();\r\n }\r\n });\r\n }\r\n else {\r\n this.element.blur();\r\n }\r\n };\r\n Focus.prototype.attached = function () {\r\n this.isAttached = true;\r\n if (this.needsApply) {\r\n this.needsApply = false;\r\n this._apply();\r\n }\r\n this.element.addEventListener('focus', this);\r\n this.element.addEventListener('blur', this);\r\n };\r\n Focus.prototype.detached = function () {\r\n this.isAttached = false;\r\n this.element.removeEventListener('focus', this);\r\n this.element.removeEventListener('blur', this);\r\n };\r\n Focus.prototype.handleEvent = function (e) {\r\n if (e.type === 'focus') {\r\n this.value = true;\r\n }\r\n else if (DOM.activeElement !== this.element) {\r\n this.value = false;\r\n }\r\n };\r\n Focus = __decorate([\r\n customAttribute('focus', bindingMode.twoWay)\r\n ], Focus);\r\n return Focus;\r\n}());\n\nvar cssUrlMatcher = /url\\((?!['\"]data)([^)]+)\\)/gi;\r\nfunction fixupCSSUrls(address, css) {\r\n if (typeof css !== 'string') {\r\n throw new Error(\"Failed loading required CSS file: \" + address);\r\n }\r\n return css.replace(cssUrlMatcher, function (match, p1) {\r\n var quote = p1.charAt(0);\r\n if (quote === '\\'' || quote === '\"') {\r\n p1 = p1.substr(1, p1.length - 2);\r\n }\r\n return 'url(\\'' + relativeToFile(p1, address) + '\\')';\r\n });\r\n}\r\nvar CSSResource = (function () {\r\n function CSSResource(address) {\r\n this.address = address;\r\n this._scoped = null;\r\n this._global = false;\r\n this._alreadyGloballyInjected = false;\r\n }\r\n CSSResource.prototype.initialize = function (container, Target) {\r\n this._scoped = new Target(this);\r\n };\r\n CSSResource.prototype.register = function (registry, name) {\r\n if (name === 'scoped') {\r\n registry.registerViewEngineHooks(this._scoped);\r\n }\r\n else {\r\n this._global = true;\r\n }\r\n };\r\n CSSResource.prototype.load = function (container) {\r\n var _this = this;\r\n return container.get(Loader)\r\n .loadText(this.address)\r\n .catch(function (err) { return null; })\r\n .then(function (text) {\r\n text = fixupCSSUrls(_this.address, text);\r\n _this._scoped.css = text;\r\n if (_this._global) {\r\n _this._alreadyGloballyInjected = true;\r\n DOM.injectStyles(text);\r\n }\r\n });\r\n };\r\n return CSSResource;\r\n}());\r\nvar CSSViewEngineHooks = (function () {\r\n function CSSViewEngineHooks(owner) {\r\n this.owner = owner;\r\n this.css = null;\r\n }\r\n CSSViewEngineHooks.prototype.beforeCompile = function (content, resources, instruction) {\r\n if (instruction.targetShadowDOM) {\r\n DOM.injectStyles(this.css, content, true);\r\n }\r\n else if (FEATURE.scopedCSS) {\r\n var styleNode = DOM.injectStyles(this.css, content, true);\r\n styleNode.setAttribute('scoped', 'scoped');\r\n }\r\n else if (this._global && !this.owner._alreadyGloballyInjected) {\r\n DOM.injectStyles(this.css);\r\n this.owner._alreadyGloballyInjected = true;\r\n }\r\n };\r\n return CSSViewEngineHooks;\r\n}());\r\nfunction _createCSSResource(address) {\r\n var ViewCSS = (function (_super) {\r\n __extends(ViewCSS, _super);\r\n function ViewCSS() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ViewCSS = __decorate([\r\n resource(new CSSResource(address))\r\n ], ViewCSS);\r\n return ViewCSS;\r\n }(CSSViewEngineHooks));\r\n return ViewCSS;\r\n}\n\nvar AttrBindingBehavior = (function () {\r\n function AttrBindingBehavior() {\r\n }\r\n AttrBindingBehavior.prototype.bind = function (binding, source) {\r\n binding.targetObserver = new DataAttributeObserver(binding.target, binding.targetProperty);\r\n };\r\n AttrBindingBehavior.prototype.unbind = function (binding, source) {\r\n };\r\n AttrBindingBehavior = __decorate([\r\n bindingBehavior('attr')\r\n ], AttrBindingBehavior);\r\n return AttrBindingBehavior;\r\n}());\n\nvar modeBindingBehavior = {\r\n bind: function (binding, source, lookupFunctions) {\r\n binding.originalMode = binding.mode;\r\n binding.mode = this.mode;\r\n },\r\n unbind: function (binding, source) {\r\n binding.mode = binding.originalMode;\r\n binding.originalMode = null;\r\n }\r\n};\r\nvar OneTimeBindingBehavior = (function () {\r\n function OneTimeBindingBehavior() {\r\n this.mode = bindingMode.oneTime;\r\n }\r\n OneTimeBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('oneTime')\r\n ], OneTimeBindingBehavior);\r\n return OneTimeBindingBehavior;\r\n}());\r\nvar OneWayBindingBehavior = (function () {\r\n function OneWayBindingBehavior() {\r\n this.mode = bindingMode.toView;\r\n }\r\n OneWayBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('oneWay')\r\n ], OneWayBindingBehavior);\r\n return OneWayBindingBehavior;\r\n}());\r\nvar ToViewBindingBehavior = (function () {\r\n function ToViewBindingBehavior() {\r\n this.mode = bindingMode.toView;\r\n }\r\n ToViewBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('toView')\r\n ], ToViewBindingBehavior);\r\n return ToViewBindingBehavior;\r\n}());\r\nvar FromViewBindingBehavior = (function () {\r\n function FromViewBindingBehavior() {\r\n this.mode = bindingMode.fromView;\r\n }\r\n FromViewBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('fromView')\r\n ], FromViewBindingBehavior);\r\n return FromViewBindingBehavior;\r\n}());\r\nvar TwoWayBindingBehavior = (function () {\r\n function TwoWayBindingBehavior() {\r\n this.mode = bindingMode.twoWay;\r\n }\r\n TwoWayBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('twoWay')\r\n ], TwoWayBindingBehavior);\r\n return TwoWayBindingBehavior;\r\n}());\n\nfunction throttle(newValue) {\r\n var _this = this;\r\n var state = this.throttleState;\r\n var elapsed = +new Date() - state.last;\r\n if (elapsed >= state.delay) {\r\n clearTimeout(state.timeoutId);\r\n state.timeoutId = null;\r\n state.last = +new Date();\r\n this.throttledMethod(newValue);\r\n return;\r\n }\r\n state.newValue = newValue;\r\n if (state.timeoutId === null) {\r\n state.timeoutId = setTimeout(function () {\r\n state.timeoutId = null;\r\n state.last = +new Date();\r\n _this.throttledMethod(state.newValue);\r\n }, state.delay - elapsed);\r\n }\r\n}\r\nvar ThrottleBindingBehavior = (function () {\r\n function ThrottleBindingBehavior() {\r\n }\r\n ThrottleBindingBehavior.prototype.bind = function (binding, source, delay) {\r\n if (delay === void 0) { delay = 200; }\r\n var methodToThrottle = 'updateTarget';\r\n if (binding.callSource) {\r\n methodToThrottle = 'callSource';\r\n }\r\n else if (binding.updateSource && binding.mode === bindingMode.twoWay) {\r\n methodToThrottle = 'updateSource';\r\n }\r\n binding.throttledMethod = binding[methodToThrottle];\r\n binding.throttledMethod.originalName = methodToThrottle;\r\n binding[methodToThrottle] = throttle;\r\n binding.throttleState = {\r\n delay: delay,\r\n last: 0,\r\n timeoutId: null\r\n };\r\n };\r\n ThrottleBindingBehavior.prototype.unbind = function (binding, source) {\r\n var methodToRestore = binding.throttledMethod.originalName;\r\n binding[methodToRestore] = binding.throttledMethod;\r\n binding.throttledMethod = null;\r\n clearTimeout(binding.throttleState.timeoutId);\r\n binding.throttleState = null;\r\n };\r\n ThrottleBindingBehavior = __decorate([\r\n bindingBehavior('throttle')\r\n ], ThrottleBindingBehavior);\r\n return ThrottleBindingBehavior;\r\n}());\n\nvar unset = {};\r\nfunction debounceCallSource(event) {\r\n var _this = this;\r\n var state = this.debounceState;\r\n clearTimeout(state.timeoutId);\r\n state.timeoutId = setTimeout(function () { return _this.debouncedMethod(event); }, state.delay);\r\n}\r\nfunction debounceCall(context, newValue, oldValue) {\r\n var _this = this;\r\n var state = this.debounceState;\r\n clearTimeout(state.timeoutId);\r\n if (context !== state.callContextToDebounce) {\r\n state.oldValue = unset;\r\n this.debouncedMethod(context, newValue, oldValue);\r\n return;\r\n }\r\n if (state.oldValue === unset) {\r\n state.oldValue = oldValue;\r\n }\r\n state.timeoutId = setTimeout(function () {\r\n var _oldValue = state.oldValue;\r\n state.oldValue = unset;\r\n _this.debouncedMethod(context, newValue, _oldValue);\r\n }, state.delay);\r\n}\r\nvar DebounceBindingBehavior = (function () {\r\n function DebounceBindingBehavior() {\r\n }\r\n DebounceBindingBehavior.prototype.bind = function (binding, source, delay) {\r\n if (delay === void 0) { delay = 200; }\r\n var isCallSource = binding.callSource !== undefined;\r\n var methodToDebounce = isCallSource ? 'callSource' : 'call';\r\n var debouncer = isCallSource ? debounceCallSource : debounceCall;\r\n var mode = binding.mode;\r\n var callContextToDebounce = mode === bindingMode.twoWay || mode === bindingMode.fromView ? targetContext : sourceContext;\r\n binding.debouncedMethod = binding[methodToDebounce];\r\n binding.debouncedMethod.originalName = methodToDebounce;\r\n binding[methodToDebounce] = debouncer;\r\n binding.debounceState = {\r\n callContextToDebounce: callContextToDebounce,\r\n delay: delay,\r\n timeoutId: 0,\r\n oldValue: unset\r\n };\r\n };\r\n DebounceBindingBehavior.prototype.unbind = function (binding, source) {\r\n var methodToRestore = binding.debouncedMethod.originalName;\r\n binding[methodToRestore] = binding.debouncedMethod;\r\n binding.debouncedMethod = null;\r\n clearTimeout(binding.debounceState.timeoutId);\r\n binding.debounceState = null;\r\n };\r\n DebounceBindingBehavior = __decorate([\r\n bindingBehavior('debounce')\r\n ], DebounceBindingBehavior);\r\n return DebounceBindingBehavior;\r\n}());\n\nfunction findOriginalEventTarget(event) {\r\n return (event.path && event.path[0]) || (event.deepPath && event.deepPath[0]) || event.target;\r\n}\r\nfunction handleSelfEvent(event) {\r\n var target = findOriginalEventTarget(event);\r\n if (this.target !== target) {\r\n return;\r\n }\r\n this.selfEventCallSource(event);\r\n}\r\nvar SelfBindingBehavior = (function () {\r\n function SelfBindingBehavior() {\r\n }\r\n SelfBindingBehavior.prototype.bind = function (binding, source) {\r\n if (!binding.callSource || !binding.targetEvent) {\r\n throw new Error('Self binding behavior only supports event.');\r\n }\r\n binding.selfEventCallSource = binding.callSource;\r\n binding.callSource = handleSelfEvent;\r\n };\r\n SelfBindingBehavior.prototype.unbind = function (binding, source) {\r\n binding.callSource = binding.selfEventCallSource;\r\n binding.selfEventCallSource = null;\r\n };\r\n SelfBindingBehavior = __decorate([\r\n bindingBehavior('self')\r\n ], SelfBindingBehavior);\r\n return SelfBindingBehavior;\r\n}());\n\nvar BindingSignaler = (function () {\r\n function BindingSignaler() {\r\n this.signals = {};\r\n }\r\n BindingSignaler.prototype.signal = function (name) {\r\n var bindings = this.signals[name];\r\n if (!bindings) {\r\n return;\r\n }\r\n var i = bindings.length;\r\n while (i--) {\r\n bindings[i].call(sourceContext);\r\n }\r\n };\r\n return BindingSignaler;\r\n}());\n\nvar SignalBindingBehavior = (function () {\r\n function SignalBindingBehavior(bindingSignaler) {\r\n this.signals = bindingSignaler.signals;\r\n }\r\n SignalBindingBehavior.inject = function () { return [BindingSignaler]; };\r\n SignalBindingBehavior.prototype.bind = function (binding, source) {\r\n var names = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n names[_i - 2] = arguments[_i];\r\n }\r\n if (!binding.updateTarget) {\r\n throw new Error('Only property bindings and string interpolation bindings can be signaled. Trigger, delegate and call bindings cannot be signaled.');\r\n }\r\n var signals = this.signals;\r\n if (names.length === 1) {\r\n var name_1 = names[0];\r\n var bindings = signals[name_1] || (signals[name_1] = []);\r\n bindings.push(binding);\r\n binding.signalName = name_1;\r\n }\r\n else if (names.length > 1) {\r\n var i = names.length;\r\n while (i--) {\r\n var name_2 = names[i];\r\n var bindings = signals[name_2] || (signals[name_2] = []);\r\n bindings.push(binding);\r\n }\r\n binding.signalName = names;\r\n }\r\n else {\r\n throw new Error('Signal name is required.');\r\n }\r\n };\r\n SignalBindingBehavior.prototype.unbind = function (binding, source) {\r\n var signals = this.signals;\r\n var name = binding.signalName;\r\n binding.signalName = null;\r\n if (Array.isArray(name)) {\r\n var names = name;\r\n var i = names.length;\r\n while (i--) {\r\n var n = names[i];\r\n var bindings = signals[n];\r\n bindings.splice(bindings.indexOf(binding), 1);\r\n }\r\n }\r\n else {\r\n var bindings = signals[name];\r\n bindings.splice(bindings.indexOf(binding), 1);\r\n }\r\n };\r\n SignalBindingBehavior = __decorate([\r\n bindingBehavior('signal')\r\n ], SignalBindingBehavior);\r\n return SignalBindingBehavior;\r\n}());\n\nvar eventNamesRequired = 'The updateTrigger binding behavior requires at least one event name argument: eg ';\r\nvar notApplicableMessage = 'The updateTrigger binding behavior can only be applied to two-way/ from-view bindings on input/select elements.';\r\nvar UpdateTriggerBindingBehavior = (function () {\r\n function UpdateTriggerBindingBehavior() {\r\n }\r\n UpdateTriggerBindingBehavior.prototype.bind = function (binding, source) {\r\n var events = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n events[_i - 2] = arguments[_i];\r\n }\r\n if (events.length === 0) {\r\n throw new Error(eventNamesRequired);\r\n }\r\n if (binding.mode !== bindingMode.twoWay && binding.mode !== bindingMode.fromView) {\r\n throw new Error(notApplicableMessage);\r\n }\r\n var targetObserver = binding.observerLocator.getObserver(binding.target, binding.targetProperty);\r\n if (!targetObserver.handler) {\r\n throw new Error(notApplicableMessage);\r\n }\r\n binding.targetObserver = targetObserver;\r\n targetObserver.originalHandler = binding.targetObserver.handler;\r\n var handler = new EventSubscriber(events);\r\n targetObserver.handler = handler;\r\n };\r\n UpdateTriggerBindingBehavior.prototype.unbind = function (binding, source) {\r\n var targetObserver = binding.targetObserver;\r\n targetObserver.handler.dispose();\r\n targetObserver.handler = targetObserver.originalHandler;\r\n targetObserver.originalHandler = null;\r\n };\r\n UpdateTriggerBindingBehavior = __decorate([\r\n bindingBehavior('updateTrigger')\r\n ], UpdateTriggerBindingBehavior);\r\n return UpdateTriggerBindingBehavior;\r\n}());\n\nfunction _createDynamicElement(_a) {\r\n var name = _a.name, viewUrl = _a.viewUrl, bindableNames = _a.bindableNames, useShadowDOMmode = _a.useShadowDOMmode;\r\n var DynamicElement = (function () {\r\n function DynamicElement() {\r\n }\r\n DynamicElement.prototype.bind = function (bindingContext) {\r\n this.$parent = bindingContext;\r\n };\r\n DynamicElement = __decorate([\r\n customElement(name),\r\n useView(viewUrl)\r\n ], DynamicElement);\r\n return DynamicElement;\r\n }());\r\n for (var i = 0, ii = bindableNames.length; i < ii; ++i) {\r\n bindable(bindableNames[i])(DynamicElement);\r\n }\r\n switch (useShadowDOMmode) {\r\n case 'open':\r\n useShadowDOM({ mode: 'open' })(DynamicElement);\r\n break;\r\n case 'closed':\r\n useShadowDOM({ mode: 'closed' })(DynamicElement);\r\n break;\r\n case '':\r\n useShadowDOM(DynamicElement);\r\n break;\r\n case null:\r\n break;\r\n default:\r\n getLogger('aurelia-html-only-element')\r\n .warn(\"Expected 'use-shadow-dom' value to be \\\"close\\\", \\\"open\\\" or \\\"\\\", received \" + useShadowDOMmode);\r\n break;\r\n }\r\n return DynamicElement;\r\n}\n\nfunction getElementName(address) {\r\n return /([^\\/^\\?]+)\\.html/i.exec(address)[1].toLowerCase();\r\n}\r\nfunction configure(config) {\r\n var viewEngine = config.container.get(ViewEngine);\r\n var loader = config.aurelia.loader;\r\n viewEngine.addResourcePlugin('.html', {\r\n 'fetch': function (viewUrl) {\r\n return loader.loadTemplate(viewUrl).then(function (registryEntry) {\r\n var _a;\r\n var bindableNames = registryEntry.template.getAttribute('bindable');\r\n var useShadowDOMmode = registryEntry.template.getAttribute('use-shadow-dom');\r\n var name = getElementName(viewUrl);\r\n if (bindableNames) {\r\n bindableNames = bindableNames.split(',').map(function (x) { return x.trim(); });\r\n registryEntry.template.removeAttribute('bindable');\r\n }\r\n else {\r\n bindableNames = [];\r\n }\r\n return _a = {}, _a[name] = _createDynamicElement({ name: name, viewUrl: viewUrl, bindableNames: bindableNames, useShadowDOMmode: useShadowDOMmode }), _a;\r\n });\r\n }\r\n });\r\n}\n\nfunction configure$1(config) {\r\n injectAureliaHideStyleAtHead();\r\n config.globalResources(Compose, If, Else, With, Repeat, Show, Hide, Replaceable, Focus, SanitizeHTMLValueConverter, OneTimeBindingBehavior, OneWayBindingBehavior, ToViewBindingBehavior, FromViewBindingBehavior, TwoWayBindingBehavior, ThrottleBindingBehavior, DebounceBindingBehavior, SelfBindingBehavior, SignalBindingBehavior, UpdateTriggerBindingBehavior, AttrBindingBehavior);\r\n configure(config);\r\n var viewEngine = config.container.get(ViewEngine);\r\n var styleResourcePlugin = {\r\n fetch: function (address) {\r\n var _a;\r\n return _a = {}, _a[address] = _createCSSResource(address), _a;\r\n }\r\n };\r\n ['.css', '.less', '.sass', '.scss', '.styl'].forEach(function (ext) { return viewEngine.addResourcePlugin(ext, styleResourcePlugin); });\r\n}\n\nexport { AbstractRepeater, ArrayRepeatStrategy, AttrBindingBehavior, BindingSignaler, Compose, DebounceBindingBehavior, Else, Focus, FromViewBindingBehavior, HTMLSanitizer, Hide, If, MapRepeatStrategy, NullRepeatStrategy, NumberRepeatStrategy, OneTimeBindingBehavior, OneWayBindingBehavior, Repeat, RepeatStrategyLocator, Replaceable, SanitizeHTMLValueConverter, SelfBindingBehavior, SetRepeatStrategy, Show, SignalBindingBehavior, ThrottleBindingBehavior, ToViewBindingBehavior, TwoWayBindingBehavior, UpdateTriggerBindingBehavior, With, configure$1 as configure, createFullOverrideContext, getItemsSourceExpression, isOneTime, unwrapExpression, updateOneTimeBinding, updateOverrideContext, viewsRequireLifecycle };\n//# sourceMappingURL=aurelia-templating-resources.js.map\n","import { Router, RouteLoader, AppRouter } from 'aurelia-router';\nimport { Origin } from 'aurelia-metadata';\nimport { relativeToFile } from 'aurelia-path';\nimport { BehaviorInstruction, ShadowDOM, ViewSlot, ViewLocator, CompositionTransaction, CompositionEngine, SwapStrategies, inlineView, customElement, useView } from 'aurelia-templating';\nimport { Container } from 'aurelia-dependency-injection';\nimport { createOverrideContext } from 'aurelia-binding';\nimport { DOM } from 'aurelia-pal';\nimport { getLogger } from 'aurelia-logging';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar EmptyLayoutViewModel = /** @class */ (function () {\r\n function EmptyLayoutViewModel() {\r\n }\r\n return EmptyLayoutViewModel;\r\n}());\r\n/**\r\n * Implementation of Aurelia Router ViewPort. Responsible for loading route, composing and swapping routes views\r\n */\r\nvar RouterView = /** @class */ (function () {\r\n function RouterView(element, container, viewSlot, router, viewLocator, compositionTransaction, compositionEngine) {\r\n this.element = element;\r\n this.container = container;\r\n this.viewSlot = viewSlot;\r\n this.router = router;\r\n this.viewLocator = viewLocator;\r\n this.compositionTransaction = compositionTransaction;\r\n this.compositionEngine = compositionEngine;\r\n // add this to router view ports lookup based on name attribute\r\n // when this router is the root router-view\r\n // also trigger AppRouter registerViewPort extra flow\r\n this.router.registerViewPort(this, this.element.getAttribute('name'));\r\n // Each process its instruction as a composition transaction\r\n // there are differences between intial composition and subsequent compositions\r\n // also there are differences between root composition and child composition\r\n // mark the first composition transaction with a property initialComposition to distinguish it\r\n // when the root gets new instruction for the first time\r\n if (!('initialComposition' in compositionTransaction)) {\r\n compositionTransaction.initialComposition = true;\r\n this.compositionTransactionNotifier = compositionTransaction.enlist();\r\n }\r\n }\r\n /**@internal */\r\n RouterView.inject = function () {\r\n return [DOM.Element, Container, ViewSlot, Router, ViewLocator, CompositionTransaction, CompositionEngine];\r\n };\r\n RouterView.prototype.created = function (owningView) {\r\n this.owningView = owningView;\r\n };\r\n RouterView.prototype.bind = function (bindingContext, overrideContext) {\r\n // router needs to get access to view model of current route parent\r\n // doing it in generic way via viewModel property on container\r\n this.container.viewModel = bindingContext;\r\n this.overrideContext = overrideContext;\r\n };\r\n /**\r\n * Implementation of `aurelia-router` ViewPort interface, responsible for templating related part in routing Pipeline\r\n */\r\n RouterView.prototype.process = function ($viewPortInstruction, waitToSwap) {\r\n var _this = this;\r\n // have strong typings without exposing it in public typings, this is to ensure maximum backward compat\r\n var viewPortInstruction = $viewPortInstruction;\r\n var component = viewPortInstruction.component;\r\n var childContainer = component.childContainer;\r\n var viewModel = component.viewModel;\r\n var viewModelResource = component.viewModelResource;\r\n var metadata = viewModelResource.metadata;\r\n var config = component.router.currentInstruction.config;\r\n var viewPortConfig = config.viewPorts ? (config.viewPorts[viewPortInstruction.name] || {}) : {};\r\n childContainer.get(RouterViewLocator)._notify(this);\r\n // layoutInstruction is our layout viewModel\r\n var layoutInstruction = {\r\n viewModel: viewPortConfig.layoutViewModel || config.layoutViewModel || this.layoutViewModel,\r\n view: viewPortConfig.layoutView || config.layoutView || this.layoutView,\r\n model: viewPortConfig.layoutModel || config.layoutModel || this.layoutModel,\r\n router: viewPortInstruction.component.router,\r\n childContainer: childContainer,\r\n viewSlot: this.viewSlot\r\n };\r\n // viewport will be a thin wrapper around composition engine\r\n // to process instruction/configuration from users\r\n // preparing all information related to a composition process\r\n // first by getting view strategy of a ViewPortComponent View\r\n var viewStrategy = this.viewLocator.getViewStrategy(component.view || viewModel);\r\n if (viewStrategy && component.view) {\r\n viewStrategy.makeRelativeTo(Origin.get(component.router.container.viewModel.constructor).moduleId);\r\n }\r\n // using metadata of a custom element view model to load appropriate view-factory instance\r\n return metadata\r\n .load(childContainer, viewModelResource.value, null, viewStrategy, true)\r\n // for custom element, viewFactory typing is always ViewFactory\r\n // for custom attribute, it will be HtmlBehaviorResource\r\n .then(function (viewFactory) {\r\n // if this is not the first time that this is composing its instruction\r\n // try to capture ownership of the composition transaction\r\n // child will not be able to capture, since root typically captures\r\n // the ownership token\r\n if (!_this.compositionTransactionNotifier) {\r\n _this.compositionTransactionOwnershipToken = _this.compositionTransaction.tryCapture();\r\n }\r\n if (layoutInstruction.viewModel || layoutInstruction.view) {\r\n viewPortInstruction.layoutInstruction = layoutInstruction;\r\n }\r\n var viewPortComponentBehaviorInstruction = BehaviorInstruction.dynamic(_this.element, viewModel, viewFactory);\r\n viewPortInstruction.controller = metadata.create(childContainer, viewPortComponentBehaviorInstruction);\r\n if (waitToSwap) {\r\n return null;\r\n }\r\n _this.swap(viewPortInstruction);\r\n });\r\n };\r\n RouterView.prototype.swap = function ($viewPortInstruction) {\r\n var _this = this;\r\n // have strong typings without exposing it in public typings, this is to ensure maximum backward compat\r\n var viewPortInstruction = $viewPortInstruction;\r\n var viewPortController = viewPortInstruction.controller;\r\n var layoutInstruction = viewPortInstruction.layoutInstruction;\r\n var previousView = this.view;\r\n // Final step of swapping a ViewPortComponent\r\n var work = function () {\r\n var swapStrategy = SwapStrategies[_this.swapOrder] || SwapStrategies.after;\r\n var viewSlot = _this.viewSlot;\r\n swapStrategy(viewSlot, previousView, function () { return Promise.resolve(viewSlot.add(_this.view)); }).then(function () {\r\n _this._notify();\r\n });\r\n };\r\n // Ensure all users setups have been completed\r\n var ready = function (owningView_or_layoutView) {\r\n viewPortController.automate(_this.overrideContext, owningView_or_layoutView);\r\n var transactionOwnerShipToken = _this.compositionTransactionOwnershipToken;\r\n // if this router-view is the root of a normal startup via aurelia.setRoot\r\n // attemp to take control of the transaction\r\n // if ownership can be taken\r\n // wait for transaction to complete before swapping\r\n if (transactionOwnerShipToken) {\r\n return transactionOwnerShipToken\r\n .waitForCompositionComplete()\r\n .then(function () {\r\n _this.compositionTransactionOwnershipToken = null;\r\n return work();\r\n });\r\n }\r\n // otherwise, just swap\r\n return work();\r\n };\r\n // If there is layout instruction, new to compose layout before processing ViewPortComponent\r\n // layout controller/view/view-model is composed using composition engine APIs\r\n if (layoutInstruction) {\r\n if (!layoutInstruction.viewModel) {\r\n // createController chokes if there's no viewmodel, so create a dummy one\r\n // but avoid using a POJO as it creates unwanted metadata in Object constructor\r\n layoutInstruction.viewModel = new EmptyLayoutViewModel();\r\n }\r\n // using composition engine to create compose layout\r\n return this.compositionEngine\r\n // first create controller from layoutInstruction\r\n // and treat it as CompositionContext\r\n // then emulate slot projection with ViewPortComponent view\r\n .createController(layoutInstruction)\r\n .then(function (layoutController) {\r\n var layoutView = layoutController.view;\r\n ShadowDOM.distributeView(viewPortController.view, layoutController.slots || layoutView.slots);\r\n // when there is a layout\r\n // view hierarchy is: owner view -> layout view -> ViewPortComponent view\r\n layoutController.automate(createOverrideContext(layoutInstruction.viewModel), _this.owningView);\r\n layoutView.children.push(viewPortController.view);\r\n return layoutView || layoutController;\r\n })\r\n .then(function (newView) {\r\n _this.view = newView;\r\n return ready(newView);\r\n });\r\n }\r\n // if there is no layout, then get ViewPortComponent view ready as view property\r\n // and process controller/swapping\r\n // when there is no layout\r\n // view hierarchy is: owner view -> ViewPortComponent view\r\n this.view = viewPortController.view;\r\n return ready(this.owningView);\r\n };\r\n /**\r\n * Notify composition transaction that this router has finished processing\r\n * Happens when this is the root router-view\r\n * @internal\r\n */\r\n RouterView.prototype._notify = function () {\r\n var notifier = this.compositionTransactionNotifier;\r\n if (notifier) {\r\n notifier.done();\r\n this.compositionTransactionNotifier = null;\r\n }\r\n };\r\n /**\r\n * @internal Actively avoid using decorator to reduce the amount of code generated\r\n *\r\n * There is no view to compose by default in a router view\r\n * This custom element is responsible for composing its own view, based on current config\r\n */\r\n RouterView.$view = null;\r\n /**\r\n * @internal Actively avoid using decorator to reduce the amount of code generated\r\n */\r\n RouterView.$resource = {\r\n name: 'router-view',\r\n bindables: ['swapOrder', 'layoutView', 'layoutViewModel', 'layoutModel', 'inherit-binding-context']\r\n };\r\n return RouterView;\r\n}());\r\n/**\r\n* Locator which finds the nearest RouterView, relative to the current dependency injection container.\r\n*/\r\nvar RouterViewLocator = /** @class */ (function () {\r\n /**\r\n * Creates an instance of the RouterViewLocator class.\r\n */\r\n function RouterViewLocator() {\r\n var _this = this;\r\n this.promise = new Promise(function (resolve) { return _this.resolve = resolve; });\r\n }\r\n /**\r\n * Finds the nearest RouterView instance.\r\n * @returns A promise that will be resolved with the located RouterView instance.\r\n */\r\n RouterViewLocator.prototype.findNearest = function () {\r\n return this.promise;\r\n };\r\n /**@internal */\r\n RouterViewLocator.prototype._notify = function (routerView) {\r\n this.resolve(routerView);\r\n };\r\n return RouterViewLocator;\r\n}());\n\n/**@internal exported for unit testing */\r\nvar EmptyClass = /** @class */ (function () {\r\n function EmptyClass() {\r\n }\r\n return EmptyClass;\r\n}());\r\ninlineView('')(EmptyClass);\r\n/**\r\n * Default implementation of `RouteLoader` used for loading component based on a route config\r\n */\r\nvar TemplatingRouteLoader = /** @class */ (function (_super) {\r\n __extends(TemplatingRouteLoader, _super);\r\n function TemplatingRouteLoader(compositionEngine) {\r\n var _this = _super.call(this) || this;\r\n _this.compositionEngine = compositionEngine;\r\n return _this;\r\n }\r\n /**\r\n * Resolve a view model from a RouteConfig\r\n * Throws when there is neither \"moduleId\" nor \"viewModel\" property\r\n * @internal\r\n */\r\n TemplatingRouteLoader.prototype.resolveViewModel = function (router, config) {\r\n return new Promise(function (resolve, reject) {\r\n var viewModel;\r\n if ('moduleId' in config) {\r\n var moduleId = config.moduleId;\r\n if (moduleId === null) {\r\n viewModel = EmptyClass;\r\n }\r\n else {\r\n // this requires container of router has passes a certain point\r\n // where a view model has been setup on the container\r\n // it will fail in enhance scenario because no viewport has been registered\r\n moduleId = relativeToFile(moduleId, Origin.get(router.container.viewModel.constructor).moduleId);\r\n if (/\\.html/i.test(moduleId)) {\r\n viewModel = createDynamicClass(moduleId);\r\n }\r\n else {\r\n viewModel = moduleId;\r\n }\r\n }\r\n return resolve(viewModel);\r\n }\r\n // todo: add if ('viewModel' in config) to support static view model resolution\r\n reject(new Error('Invalid route config. No \"moduleId\" found.'));\r\n });\r\n };\r\n /**\r\n * Create child container based on a router container\r\n * Also ensures that child router are properly constructed in the newly created child container\r\n * @internal\r\n */\r\n TemplatingRouteLoader.prototype.createChildContainer = function (router) {\r\n var childContainer = router.container.createChild();\r\n childContainer.registerSingleton(RouterViewLocator);\r\n childContainer.getChildRouter = function () {\r\n var childRouter;\r\n childContainer.registerHandler(Router, function () { return childRouter || (childRouter = router.createChild(childContainer)); });\r\n return childContainer.get(Router);\r\n };\r\n return childContainer;\r\n };\r\n /**\r\n * Load corresponding component of a route config of a navigation instruction\r\n */\r\n TemplatingRouteLoader.prototype.loadRoute = function (router, config, _navInstruction) {\r\n var _this = this;\r\n return this\r\n .resolveViewModel(router, config)\r\n .then(function (viewModel) { return _this.compositionEngine.ensureViewModel({\r\n viewModel: viewModel,\r\n childContainer: _this.createChildContainer(router),\r\n view: config.view || config.viewStrategy,\r\n router: router\r\n }); });\r\n };\r\n /**@internal */\r\n TemplatingRouteLoader.inject = [CompositionEngine];\r\n return TemplatingRouteLoader;\r\n}(RouteLoader));\r\n/**@internal exported for unit testing */\r\nfunction createDynamicClass(moduleId) {\r\n var name = /([^\\/^\\?]+)\\.html/i.exec(moduleId)[1];\r\n var DynamicClass = /** @class */ (function () {\r\n function DynamicClass() {\r\n }\r\n DynamicClass.prototype.bind = function (bindingContext) {\r\n this.$parent = bindingContext;\r\n };\r\n return DynamicClass;\r\n }());\r\n customElement(name)(DynamicClass);\r\n useView(moduleId)(DynamicClass);\r\n return DynamicClass;\r\n}\n\nvar logger = getLogger('route-href');\r\n/**\r\n * Helper custom attribute to help associate an element with a route by name\r\n */\r\nvar RouteHref = /** @class */ (function () {\r\n function RouteHref(router, element) {\r\n this.router = router;\r\n this.element = element;\r\n this.attribute = 'href';\r\n }\r\n /*@internal */\r\n RouteHref.inject = function () {\r\n return [Router, DOM.Element];\r\n };\r\n RouteHref.prototype.bind = function () {\r\n this.isActive = true;\r\n this.processChange();\r\n };\r\n RouteHref.prototype.unbind = function () {\r\n this.isActive = false;\r\n };\r\n RouteHref.prototype.attributeChanged = function (value, previous) {\r\n if (previous) {\r\n this.element.removeAttribute(previous);\r\n }\r\n return this.processChange();\r\n };\r\n RouteHref.prototype.processChange = function () {\r\n var _this = this;\r\n return this.router\r\n .ensureConfigured()\r\n .then(function () {\r\n if (!_this.isActive) {\r\n // returning null to avoid Bluebird warning\r\n return null;\r\n }\r\n var element = _this.element;\r\n var href = _this.router.generate(_this.route, _this.params);\r\n if (element.au.controller) {\r\n element.au.controller.viewModel[_this.attribute] = href;\r\n }\r\n else {\r\n element.setAttribute(_this.attribute, href);\r\n }\r\n // returning null to avoid Bluebird warning\r\n return null;\r\n })\r\n .catch(function (reason) {\r\n logger.error(reason);\r\n });\r\n };\r\n /**\r\n * @internal Actively avoid using decorator to reduce the amount of code generated\r\n */\r\n RouteHref.$resource = {\r\n type: 'attribute',\r\n name: 'route-href',\r\n bindables: [\r\n { name: 'route', changeHandler: 'processChange', primaryProperty: true },\r\n { name: 'params', changeHandler: 'processChange' },\r\n 'attribute'\r\n ] // type definition of Aurelia templating is wrong\r\n };\r\n return RouteHref;\r\n}());\n\nfunction configure(config) {\r\n config\r\n .singleton(RouteLoader, TemplatingRouteLoader)\r\n .singleton(Router, AppRouter)\r\n .globalResources(RouterView, RouteHref);\r\n config.container.registerAlias(Router, AppRouter);\r\n}\n\nexport { RouteHref, RouterView, TemplatingRouteLoader, configure };\n//# sourceMappingURL=aurelia-templating-router.js.map\n"],"sourceRoot":""}