peryl 1.5.13 → 1.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-esmodule/hsml-app.js +7 -7
- package/dist/browser-esmodule/hsml-app.js.map +1 -1
- package/dist/browser-esmodule/index.js +7 -7
- package/dist/browser-esmodule/index.js.map +1 -1
- package/dist/browser-umd/hsml-app.js +1 -1
- package/dist/browser-umd/hsml-app.js.map +1 -1
- package/dist/browser-umd/index.js +1 -1
- package/dist/browser-umd/index.js.map +1 -1
- package/dist/demo/hsml-app-form-validation_demo.1ef7fa68.js +2 -0
- package/dist/demo/hsml-app-form-validation_demo.1ef7fa68.js.map +1 -0
- package/dist/demo/hsml-app-form-validation_demo.81fb94b2.js +2 -0
- package/dist/demo/hsml-app-form-validation_demo.81fb94b2.js.map +1 -0
- package/dist/demo/hsml-app-form-validation_demo.html +1 -1
- package/dist/demo/hsml-app-form_demo.html +1 -1
- package/dist/demo/hsml-app-test_demo.html +1 -1
- package/dist/demo/hsml-app-tictactoe_demo.html +1 -1
- package/dist/demo/hsml-app_demo.html +1 -1
- package/dist/demo/hsml-appel_demo.html +1 -1
- package/dist/demo/hsml-appi_demo.html +1 -1
- package/dist/hsml-app.js +8 -8
- package/dist/hsml-app.js.map +1 -1
- package/package.json +1 -1
- package/src/hsml-app.ts +7 -7
- package/dist/demo/hsml-app-form-validation_demo.97679c59.js +0 -2
- package/dist/demo/hsml-app-form-validation_demo.97679c59.js.map +0 -1
- package/dist/demo/hsml-app-form-validation_demo.eea04196.js +0 -2
- package/dist/demo/hsml-app-form-validation_demo.eea04196.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AE0PO,MAAM,4CAAO;AAEd,SAAU,0CACR,GAA6B,EAC7B,OAAoC,EACpC,GAAO,EAHf;IAKI,IAAI,QAAQ,aAAa,QAAQ,IAAI,EACjC;IAEJ,OAAQ,IAAI,WAAW;Q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jC,OAAO,IAAI,QAAQ,CAAC,KAAK;YAC5B;YAEL,KAAM;QACV,KAAK;YACD,MAAM,MAAM;YACZ,OAAO;gBACH,MAAM,IAAI,IAAI;gBACd,OAAO,IAAI,KAAK;gBAChB,YAAY,IAAI,iBAAiB;gBACjC,OAAO,IAAI,QAAQ,CAAC,KAAK;YAC5B;YACD,KAAM;QACV,KAAK;YACD,MAAM,MAAM;YACZ,OAAO;gBACH,MAAM,IAAI,IAAI;gBACd,OAAO,IAAI,KAAK;gBAChB,YAAY,IAAI,iBAAiB;gBACjC,OAAO,IAAI,QAAQ,CAAC,KAAK;YAC5B;YACD,KAAM;IACb;IACD,OAAO;AACX","sources":["src/hsml-app.ts","src/hsml-idom.ts","src/hsml.ts","src/incremental-dom/index.ts","src/incremental-dom/attributes.ts","src/incremental-dom/assertions.ts","src/incremental-dom/global.ts","src/incremental-dom/debug.ts","src/incremental-dom/util.ts","src/incremental-dom/symbols.ts","src/incremental-dom/core.ts","src/incremental-dom/context.ts","src/incremental-dom/notifications.ts","src/incremental-dom/dom_util.ts","src/incremental-dom/node_data.ts","src/incremental-dom/nodes.ts","src/incremental-dom/virtual_elements.ts","src/incremental-dom/diff.ts","src/incremental-dom/changes.ts","src/incremental-dom/types.ts"],"sourcesContent":["import { HAttrOnData, HAttrOnDataFnc, HElement, HElements, HHandlerCtx } from \"./hsml\";\nimport { hsmls2idomPatch } from \"./hsml-idom\";\n\nconst log = console.log;\nconst error = console.error;\nconst warn = console.warn;\n\nexport type HState<State> = () => State;\n\nexport type HView<State, HActionType extends string> = (\n state: State\n) => HElements<HActionType>;\n\nexport type HView1<State, HActionType extends string> = (\n state: State\n) => HElement<HActionType>;\n\nexport type HAppAction =\n | \"happ-init\"\n | \"happ-mount\"\n | \"happ-umount\"\n | \"happ-action\"\n | \"happ-attribute\";\n\nexport enum HAppActions {\n init = \"happ-init\",\n mount = \"happ-mount\",\n umount = \"happ-umount\",\n action = \"happ-action\",\n attribute = \"happ-attribute\"\n}\n\nexport interface HAction<HActionType extends string> {\n type: HActionType;\n data?: any;\n event?: Event;\n}\n\nexport type HDispatchScope =\n | \"element\"\n | \"window\";\n\nexport enum HDispatchScopes {\n element = \"element\",\n window = \"window\"\n}\n\nexport type HDispatch<HActionType extends string> = (\n type: HAction<HActionType>[\"type\"],\n data?: HAction<HActionType>[\"data\"],\n scope?: HDispatchScope | HDispatchScopes\n) => Promise<void>;\n\nexport type HDispatcher<State, HActionType extends string> = (\n // this: HApp<State, HActionType>,\n action: HAction<HActionType | HAppAction | HAppActions>,\n state: State,\n dispatch: HDispatch<HActionType>\n) => Promise<void>;\n\nconst schedule = window.requestAnimationFrame ||\n // window.webkitRequestAnimationFrame ||\n // (window as any).mozRequestAnimationFrame ||\n // (window as any).oRequestAnimationFrame ||\n // (window as any).msRequestAnimationFrame ||\n function (callback: Function) { window.setTimeout(callback, 1000 / 60); };\n\nconst unschedule = window.cancelAnimationFrame ||\n // window.webkitCancelAnimationFrame ||\n // (window as any).mozCancelAnimationFrame ||\n // (window as any).oCancelAnimationFrame ||\n // (window as any).msCancelAnimationFrame ||\n function (handle: number) { window.clearTimeout(handle); };\n\nconst msgAction = \"action:\";\nconst msgDispatch = \"dispatch:\";\nconst msgRender = \"render:\";\nconst msgUpdate = \"update:\";\n\nconst HAPP = \"happ\";\n\nexport interface HAppI<State, HActionType extends string> {\n state: HState<State>;\n view: HView<State, HActionType>;\n dispatcher: HDispatcher<State, HActionType>;\n element?: Element | string | null;\n debug?: boolean;\n name?: string;\n attributes?: string[];\n}\n\n/**\n * HApp definition\n *\n * @param hAppI HApp definition\n * @returns HApp instance\n */\nexport function happ<State, HActionType extends string>(hAppI: {\n state: HState<State>;\n view: HView<State, HActionType>;\n dispatcher: HDispatcher<State, HActionType>;\n element: Element | string | null;\n debug?: boolean;\n name?: string;\n // attributes?: string[];\n}) {\n return new HApp<State, HActionType>(\n hAppI.state,\n hAppI.view,\n hAppI.dispatcher,\n hAppI.element,\n hAppI.debug,\n hAppI.name\n // hAppI!.attributes\n );\n}\n\n// export type Class<T = object> = new (...args: any[]) => T;\n\n// export function happi<State, HActionType extends string>(\n// hAppI: Class<HAppI<State, HActionType>>,\n// element?: Element | string | null,\n// debug? boolean,\n// name?: string,\n// attributes: string[]\n// ) {\n// const hapi = new hAppI();\n// return new HApp<State, HActionType>(\n// hapi.state,\n// hapi.view,\n// hapi.dispatcher,\n// element,\n// debug\n// );\n// }\n\n// HAppEl\n\n/**\n * HApp custom HTML element definition.\n *\n * @param hAppI HApp definition\n */\nexport function happel<State, HActionType extends string>(hAppI: {\n state: HState<State>;\n view: HView<State, HActionType>;\n dispatcher: HDispatcher<State, HActionType>;\n /** Element suffix name, element name patern is `happ-${name}` */\n name: string;\n /** Element attribute list */\n attributes: string[];\n debug?: boolean;\n}): void {\n customElements.define(\n `${HAPP}-${hAppI.name}`,\n class HAppElement extends HTMLElement {\n static get observedAttributes() {\n return hAppI.attributes;\n }\n\n private _happel: HApp<State, HActionType>;\n\n constructor() {\n super();\n this._happel = new HApp<State, HActionType>(\n hAppI.state,\n hAppI.view,\n hAppI.dispatcher,\n undefined,\n hAppI.debug,\n hAppI.name,\n hAppI.attributes\n );\n (this._happel as any).customElement = this;\n }\n\n connectedCallback() {\n // this._happel.mount(this);\n this.attachShadow({ mode: \"open\" });\n this._happel.mount(this.shadowRoot as any);\n }\n\n disconnectedCallback() {\n this._happel.umount();\n }\n\n adoptedCallback() {\n this._happel.update();\n }\n\n attributeChangedCallback(\n attrName: string,\n oldVal: string | null,\n newVal: string | null\n ) {\n this._happel.dispatch(\n HAppActions.attribute as any,\n { attrName, oldVal, newVal });\n }\n }\n );\n}\n\n/**\n * HSML App\n */\nexport class HApp<State, HActionType extends string> implements HHandlerCtx<HActionType> {\n\n readonly state: State;\n readonly view: HView<State, HActionType>;\n readonly dispatcher: HDispatcher<State, HActionType>;\n\n debug: boolean;\n\n readonly name: string;\n readonly attributes: string[];\n\n readonly element?: HTMLElement;\n readonly refs: { [key: string]: HTMLElement } = {};\n\n readonly customElement?: HTMLElement; // happ custom html element\n\n private _updateSched?: number;\n\n // private _onDispatch?: HDispatcher<State>;\n\n private _windowActionListener?: (event: Event) => void;\n\n constructor(\n state: HState<State>,\n view: HView<State, HActionType>,\n dispatcher?: HDispatcher<State, HActionType>,\n element?: Element | string | null,\n debug?: boolean ,\n name?: string,\n attributes?: string[]\n ) {\n this.debug = debug ?? false;\n this.name = name ?? HAPP;\n this.attributes = attributes ?? [];\n this.state = state();\n this.view = view;\n this.dispatcher = dispatcher ?? (async (a) => log(this.name, msgAction, a.type, a.data));\n this._dispatchAction(HAppActions.init, this).then(() => element && this.mount(element));\n }\n\n /**\n * Dispatch app action.\n */\n dispatch: HDispatch<HActionType> = async (\n type: HActionType,\n data?: any,\n scope?: HDispatchScope\n ): Promise<void> => {\n return this._dispatchAction(type, data, undefined, scope);\n }\n\n // onDispatch = (dispatcher: HDispatcher<State>): this => {\n // this._onDispatch = dispatcher;\n // return this;\n // }\n\n private async _dispatchAction(\n type: HActionType | HAppAction | HAppActions,\n data?: any,\n event?: Event,\n scope?: HDispatchScope\n ): Promise<void> {\n if (this.debug) {\n log(this.name, msgAction, { type, data, event });\n const t0 = performance.now();\n await this._dispatch(type, data, event, scope);\n const t1 = performance.now();\n log(this.name, msgDispatch, `${t1 - t0} ms`, this.state);\n } else {\n await this._dispatch(type, data, event, scope);\n }\n }\n\n private async _dispatch(\n type: HActionType | HAppAction | HAppActions,\n data: any,\n event?: Event,\n scope?: HDispatchScope\n ): Promise<void> {\n try {\n if (!scope) {\n await this.dispatcher(\n { type: type as HActionType, data, event },\n this.state,\n this.dispatch\n );\n this.update();\n }\n scope === \"element\" && this._dispatchElement(type, data);\n scope === \"window\" && this._dispatchWindow(type, data);\n } catch (e) {\n error(this.name, msgDispatch, e);\n }\n }\n\n private async _dispatchElement(\n type: HActionType | HAppAction | HAppActions,\n data?: any\n ): Promise<void> {\n this.customElement && elementDispatchCustomEvent(this.customElement, HAppActions.action, { type, data });\n !this.customElement && this.element && elementDispatchCustomEvent(this.element, HAppActions.action, { type, data });\n // this._onDispatch?.({ type, data, event }, this.state, this.dispatch);\n }\n\n private async _dispatchWindow(\n type: HActionType | HAppAction | HAppActions,\n data?: any): Promise<void> {\n window.dispatchEvent(new CustomEvent(HAppActions.action, { detail: { type, data } }));\n }\n\n /**\n * Window action listen and route actions to dispatcher.\n * Call this method on app mount action.\n * Listening will be stopped on app umount automatically.\n */\n windowActionListen() {\n if (!this._windowActionListener) {\n this._windowActionListener = (event: Event) => {\n const action = (event as CustomEvent).detail as HAction<HActionType>;\n this._dispatchAction(HAppActions.action, action);\n };\n window.addEventListener(HAppActions.action, this._windowActionListener);\n } else {\n warn(\"windowEventListener already added\");\n }\n }\n\n /**\n * Render HSML based on app state.\n */\n render = (): HElements<HActionType> => {\n if (this.debug) {\n const t0 = performance.now();\n let hsmls;\n try {\n hsmls = this.view(this.state);\n } catch (e) {\n error(this.name, msgRender, e);\n }\n const t1 = performance.now();\n log(this.name, msgRender, `${t1 - t0} ms`, hsmls);\n return hsmls ?? [];\n } else {\n let hsmls;\n try {\n hsmls = this.view(this.state);\n } catch (e) {\n error(this.name, msgRender, e);\n }\n return hsmls ?? [];\n }\n }\n\n /**\n * HSML action callback.\n */\n actionCb = (actionType: HActionType, data: HAttrOnData, event: Event): void => {\n data = (data?.constructor === Function)\n ? (data as HAttrOnDataFnc)(event)\n : data;\n if (data === undefined && event) {\n if (event instanceof CustomEvent) {\n data = event.detail;\n } else {\n data = formData(event) as any;\n // TODO middlewares for data processing\n // const middlewares: ((data: any, event: Event) => any)[] = [];\n // data = middlewares.reduce(\n // (data, middleware) => middleware(data, event),\n // data\n // );\n }\n }\n this._dispatchAction(actionType, data, event);\n }\n\n private _updateDom<HActionType extends string>(\n el: Element,\n hsml: HElements<HActionType>,\n ctx: HHandlerCtx<HActionType>\n ): void {\n if (this.debug) {\n const t0 = performance.now();\n hsmls2idomPatch(el, hsml, ctx);\n const t1 = performance.now();\n log(this.name, msgUpdate, `${t1 - t0} ms`, el);\n } else {\n hsmls2idomPatch(el, hsml, ctx);\n }\n }\n\n /**\n * Mount app to DOM element.\n *\n * @param e DOM element\n */\n mount = (e: Element | string | null): this => {\n const el = (typeof e === \"string\") ? document.getElementById(e) : e;\n if (el && (el as any)[HAPP]) {\n const a = (el as any)[HAPP] as HApp<State, HActionType>;\n a.umount();\n }\n if (el && !this.element) {\n (this as any).element = el;\n (el as any)[HAPP] = this;\n const hsmls = (this as any).render();\n this._updateDom<HActionType>(el, hsmls, this);\n this._dispatchAction(HAppActions.mount, this.element);\n }\n return this;\n }\n\n /**\n * Umount app to DOM element.\n */\n umount = (): this => {\n if (this.element) {\n this._dispatchAction(HAppActions.umount, this.element);\n if (this.element.hasAttribute(HAPP)) {\n this.element.removeAttribute(HAPP);\n }\n const aNodes = this.element.querySelectorAll(`[${HAPP}]`);\n for (let i = 0; i < aNodes.length; i++) {\n const a = (aNodes[i] as any).happ as HApp<State, HActionType>;\n a?.umount();\n }\n while (this.element.firstChild /*.hasChildNodes()*/) {\n this.element.removeChild(this.element.firstChild);\n }\n delete (this.element as any).happ;\n (this as any).element = undefined;\n }\n if (this._windowActionListener) {\n window.removeEventListener(HAppActions.action, this._windowActionListener);\n }\n return this;\n }\n\n /**\n * Update DOM element based on app state.\n */\n update = (): this => {\n if (this.element && !this._updateSched) {\n this._updateSched = schedule(() => {\n if (this.element) {\n const hsmls = this.render();\n this._updateDom<HActionType>(this.element, hsmls, this);\n }\n this._updateSched = undefined;\n });\n }\n return this;\n }\n\n toHsml = (): HElement<HActionType> => {\n if (this.element) {\n if (this._updateSched) {\n unschedule(this._updateSched);\n this._updateSched = undefined;\n } else {\n return [\"div\", { skip: true }];\n }\n }\n const hsmls = this.render();\n hsmls.push(\n (e: Element) => {\n if (!this.element) {\n (this as any).element = e;\n (e as any).happ = this;\n this._dispatchAction(HAppActions.mount, this.element);\n }\n });\n return [\"div\", hsmls];\n }\n\n toHtml = (): string => {\n return this.element ? this.element.outerHTML : \"\";\n }\n\n}\n\nfunction elementDispatchCustomEvent<HActionType extends string>(\n el: HTMLElement,\n type: HActionType,\n data: any\n) {\n el?.dispatchEvent(new CustomEvent(type, { detail: data }));\n (el as any)[`on${type}`]?.(new CustomEvent(type, { detail: data }));\n}\n\ntype FormDataInputValue = string | number | boolean | null | Array<string | number | boolean | null>;\n\ntype FormInputData = {\n name?: string;\n value: FormDataInputValue;\n valueString?: string;\n valueNumber?: number | null;\n valueDate?: Date | null;\n validation: string;\n valid: boolean;\n};\n\ntype FormData = {\n data: {\n [name: string]: FormDataInputValue;\n };\n validation: { [name: string]: string };\n valid: boolean;\n};\n\nexport type HFormInputData<Value = FormDataInputValue> = {\n name?: string;\n value: Value;\n valueString?: string | null;\n valueNumber?: number | null;\n valueDate?: Date | null;\n validation: string;\n valid: boolean;\n};\n\nexport type HFormData<Data> = {\n data: Data;\n validation: { [name in keyof Data]?: string };\n valid?: boolean;\n};\n\nfunction formData(e: Event): FormData | FormInputData | undefined {\n const el = e.target as HTMLElement;\n switch (el.nodeName) {\n case \"FORM\":\n (e as Event).preventDefault();\n const form: FormData = {\n data: {},\n validation: {},\n valid: true\n };\n const els = (el as HTMLFormElement).elements;\n for (let i = 0; i < els.length; i++) {\n const inputData = formInputData(els[i]);\n if (inputData && inputData.name) {\n const formData = form.data;\n const name = inputData.name;\n const value = inputData.value;\n if (formData[name] === undefined) {\n formData[name] = value;\n } else if (typeof formData[name] === \"string\" || formData[name] instanceof String) {\n if (value instanceof Array) {\n formData[name] = [formData[name] as string, ...value];\n } else {\n formData[name] = [formData[name] as string, value as string];\n }\n } else if (formData[name] instanceof Array) {\n if (value instanceof Array) {\n formData[name] = (formData[name] as Array<any>).concat(value);\n } else {\n (formData[name] as Array<any>).push(value);\n }\n } else {\n if (value instanceof Array) {\n formData[name] = [formData[name] as string, ...value];\n } else {\n formData[name] = [formData[name] as string, value];\n }\n }\n if (formData[name] instanceof Array) {\n formData[name] = (formData[name] as Array<any>)\n .filter(d => d !== null);\n if ((els[i] as HTMLInputElement).type === \"radio\") {\n formData[name] = (formData[name] as Array<any>).length\n ? (formData[name] as Array<any>)[0]\n : null;\n }\n }\n if (inputData.validation) {\n form.validation[name] = inputData.validation;\n }\n if (!inputData.valid) {\n form.valid = false;\n }\n }\n }\n return form;\n default:\n return formInputData(el);\n }\n}\n\nfunction formInputData(el: Element): FormInputData | undefined {\n // Client-side form validation\n // https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation\n const vel = el as HTMLInputElement;\n if (vel.willValidate) {\n let valid = true;\n for (const key in vel.validity) {\n if (key !== \"customError\" && key !== \"valid\") {\n if ((vel.validity as any)[key]) {\n const msgs = (vel as any)[\"validation\"];\n if (msgs) {\n const msg = (msgs as any)[key];\n if (msg) {\n vel.setCustomValidity(msg);\n // vel.reportValidity();\n valid = false;\n break;\n } else {\n vel.setCustomValidity(\"\");\n // vel.reportValidity();\n break;\n }\n }\n }\n }\n }\n if (valid) {\n vel.setCustomValidity(\"\");\n // vel.reportValidity();\n }\n }\n\n let data: FormInputData | undefined;\n switch (el.nodeName) {\n case \"INPUT\":\n const iel = el as HTMLInputElement;\n switch (iel.type) {\n case \"text\":\n case \"hidden\":\n case \"password\":\n case \"email\":\n case \"search\":\n case \"url\":\n case \"tel\":\n case \"color\":\n case \"submit\":\n case \"button\":\n data = {\n name: iel.name,\n value: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"number\":\n case \"range\":\n data = {\n name: iel.name,\n value: iel.valueAsNumber,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"datetime-local\":\n data = {\n name: iel.name,\n value: iel.value,\n valueNumber: isNaN(iel.valueAsNumber)\n ? null\n : iel.valueAsNumber,\n valueDate: isNaN(iel.valueAsNumber)\n ? null\n : new Date(iel.valueAsNumber),\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"date\":\n case \"month\":\n case \"time\":\n case \"week\":\n data = {\n name: iel.name,\n value: iel.value,\n valueNumber: isNaN(iel.valueAsNumber)\n ? null\n : iel.valueAsNumber,\n valueDate: iel.valueAsDate,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"radio\":\n data = {\n name: iel.name,\n value: iel.checked ? iel.value : null,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"checkbox\":\n if (iel.value === \"on\") { // value not set in element\n data = {\n name: iel.name,\n value: iel.checked,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n } else {\n data = {\n name: iel.name,\n value: iel.checked ? String(iel.value) : null,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n }\n break;\n case \"file\":\n const files = (iel as any).files as FileList;\n const value: any = files.length === 1 ? files[0] : files;\n data = {\n name: iel.name,\n value,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n }\n break;\n case \"SELECT\":\n const sel = el as HTMLSelectElement;\n if (sel.multiple) {\n const values = Array.from(sel.selectedOptions).map(o => o.value);\n data = {\n name: sel.name,\n value: values,\n valueString: sel.value,\n validation: sel.validationMessage,\n valid: sel.validity.valid\n };\n } else {\n data = {\n name: sel.name,\n value: sel.value,\n validation: sel.validationMessage,\n valid: sel.validity.valid\n };\n }\n break;\n case \"TEXTAREA\":\n const tel = el as HTMLTextAreaElement;\n data = {\n name: tel.name,\n value: tel.value,\n validation: tel.validationMessage,\n valid: tel.validity.valid\n };\n break;\n case \"BUTTON\":\n const bel = el as HTMLButtonElement;\n data = {\n name: bel.name,\n value: bel.value,\n validation: bel.validationMessage,\n valid: bel.validity.valid\n };\n break;\n }\n return data;\n}\n","import {\n HAttrClasses,\n HAttrData, HAttrOn, HAttrOnAct,\n HAttrOnCb, HAttrOnData, HAttrStyles, HElement,\n HElements, HFnc, HHandler,\n HHandlerCtx, HObj, hsml, HTagAttrs, HTagHeadName\n} from \"./hsml\";\nimport { currentElement, elementClose, elementOpen, patch, skip, text } from \"./incremental-dom\";\n\n// function setBoolAttrProp(el: any, attr: string, value: any) {\n// // console.log(\"idom.attributes\", attr, value, typeof value, el);\n// if (typeof value === \"string\") {\n// let b;\n// switch (value) {\n// case \"true\":\n// case \"1\":\n// case \"on\":\n// case \"yes\":\n// b = true;\n// break;\n// default:\n// b = false;\n// }\n// if (b) {\n// el.setAttribute(attr, value);\n// } else {\n// el.removeAttribute(attr);\n// }\n// el[attr] = b;\n// } else if (typeof value === \"boolean\") {\n// if (value) {\n// el.setAttribute(attr, \"\");\n// } else {\n// el.removeAttribute(attr);\n// }\n// el[attr] = value;\n// } else {\n// if (value) {\n// el.setAttribute(attr, value ? value : \"\");\n// } else {\n// el.removeAttribute(attr);\n// }\n// }\n// }\n\n// const boolAttrProps = [\n// \"readonly\",\n// \"disabled\",\n// \"checked\",\n// \"value\"\n// ];\n\n// boolAttrProps.forEach(a => idom.attributes[a] = setBoolAttrProp);\n\nfunction ctxActionCb<HAttrOnActType extends string>(ctx: HHandlerCtx<HAttrOnActType> | undefined, attrOn: HAttrOn<HAttrOnActType>, e: Event) {\n ctx &&\n ctx.actionCb &&\n typeof ctx.actionCb === \"function\" &&\n ctx.actionCb(attrOn[1] as HAttrOnActType, attrOn[2] as HAttrOnData, e);\n}\n\nclass HsmlIDomHandler<HAttrOnActType extends string> implements HHandler<HAttrOnActType, HHandlerCtx<HAttrOnActType>> {\n\n open(tag: HTagHeadName, attrs: HTagAttrs<HAttrOnActType>, children: HElements<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): boolean {\n const props: any[] = [];\n let id = attrs._id;\n let classes: string[] = attrs._classes ? attrs._classes : [];\n let ref = attrs._ref;\n let hObj: any = attrs._hObj;\n for (const a in attrs) {\n if (attrs.hasOwnProperty(a)) {\n switch (a) {\n case \"_id\":\n case \"_classes\":\n case \"_ref\":\n case \"_hObj\":\n case \"key\":\n case \"skip\":\n break;\n case \"id\":\n id = attrs[a] as string;\n break;\n case \"ref\":\n ref = attrs[a] as string;\n break;\n case \"classes\":\n const attrClasses = attrs[a] as HAttrClasses;\n classes = classes.concat(attrClasses\n ? attrClasses\n .map(c =>\n c.constructor === String\n ? c as string\n : (c[1] ? c[0] as string : undefined))\n .filter((c): c is string => c !== undefined)\n : [] as string[]);\n break;\n case \"class\":\n classes = classes.concat((attrs[a] as string).split(\" \"));\n break;\n case \"data\":\n const attrData = attrs[a] as HAttrData;\n for (const d in attrData) {\n if (attrData.hasOwnProperty(d)) {\n if (attrData[d].constructor === String) {\n props.push(\"data-\" + d, attrData[d]);\n } else {\n props.push(\"data-\" + d, JSON.stringify(attrData[d]));\n }\n }\n }\n break;\n case \"styles\":\n props.push(\"style\", attrs[a] as HAttrStyles);\n break;\n case \"on\":\n const attrOn = attrs[a] as HAttrOn<HAttrOnActType>;\n if (typeof attrOn[0] === \"string\") {\n if (typeof attrOn[1] === \"function\") {\n props.push(\"on\" + attrOn[0], attrOn[1]);\n } else {\n props.push(\"on\" + attrOn[0],\n (e: Event) => ctxActionCb(ctx, attrOn, e));\n }\n } else {\n (attrOn as Array<HAttrOnCb | HAttrOnAct<HAttrOnActType>>)\n .forEach(attr => {\n if (typeof attr[1] === \"function\") {\n props.push(\"on\" + attr[0], attr[1]);\n } else {\n props.push(\"on\" + attr[0],\n (e: Event) => ctxActionCb(ctx, attr, e));\n }\n });\n }\n break;\n default:\n // http://google.github.io/incremental-dom/#attributes-and-properties\n switch (typeof attrs[a]) {\n case \"function\":\n props.push(\"on\" + a, attrs[a]);\n break;\n case \"object\":\n // console.log(\"---\", a, typeof attrs[a], attrs[a]);\n // console.log(\"---String \", attrs[a] instanceof String);\n // console.log(\"---Boolean\", attrs[a] instanceof Boolean);\n // console.log(\"---Number \", attrs[a] instanceof Number);\n props.push(a, attrs[a]);\n break;\n // case \"boolean\":\n // if (boolAttrProps.includes(a)) {\n // props.push(a, attrs[a]);\n // } else {\n // attrs[a] && props.push(a, a);\n // }\n // break;\n case \"boolean\":\n attrs[a] && props.push(a, a);\n break;\n default:\n props.push(a, attrs[a]);\n break;\n }\n }\n }\n }\n if (classes.length) {\n props.unshift(\"class\", classes.join(\" \"));\n }\n if (id) {\n props.unshift(\"id\", id);\n }\n if (ref) {\n props.unshift(\"ref\", ref);\n }\n elementOpen(tag, attrs.key, undefined, ...props);\n if (attrs.skip) {\n skip();\n }\n if (ctx && ref) {\n ctx.refs[ref] = currentElement();\n }\n if (hObj && hObj.mount && hObj.mount.constructor === Function) {\n hObj.mount(currentElement());\n skip();\n }\n return attrs.skip ? true : false;\n }\n\n close(tag: HTagHeadName, children: HElements<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n elementClose(tag);\n }\n\n text(txt: string, ctx?: HHandlerCtx<HAttrOnActType>): void {\n text(txt);\n }\n\n fnc(fnc: HFnc, ctx?: HHandlerCtx<HAttrOnActType>): void {\n const skipFnc = fnc(currentElement());\n skipFnc && skip();\n }\n\n obj(obj: HObj<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n if (\"toHsml\" in obj) {\n obj.toHsml && hsml(obj.toHsml(), this, obj as HHandlerCtx<HAttrOnActType>);\n } else {\n this.text(\"\" + obj, ctx);\n }\n }\n\n}\n\nfunction hsml2idom<HAttrOnActType extends string>(hml: HElement<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n hsml(hml, new HsmlIDomHandler(), ctx);\n}\n\nfunction hsmls2idom<HAttrOnActType extends string>(hmls: HElements<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n for (const hml of hmls) {\n if (hml === undefined || hml === null) {\n continue;\n }\n if (hml.constructor === String) {\n text(hml as string);\n } else if (\"toHsml\" in (hml as any)) {\n const obj = hml as HHandlerCtx<HAttrOnActType>;\n obj.toHsml && hsml2idom(obj.toHsml(), obj);\n } else {\n hsml2idom(hml as HElement<HAttrOnActType>, ctx);\n }\n }\n}\n\nexport function hsml2idomPatch<HAttrOnActType extends string>(node: Element, hsmlEl: HElement<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n patch(node,\n (data?: HElement<HAttrOnActType>) => (data && hsml2idom(data, ctx)), hsmlEl);\n}\n\nexport function hsmls2idomPatch<HAttrOnActType extends string>(node: Element, hsmlFr: HElements<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n patch(node,\n (data?: HElements<HAttrOnActType>) => (data && hsmls2idom(data, ctx)), hsmlFr);\n}\n","// HSML tag head format \"tag#id.class1.class2~handler\"\n\nexport type HTagHeadName = keyof HTMLElementTagNameMap | `${string}${\"-\"}${string}`;\nexport type HTagHeadAttr = \".\" | \"#\" | \"~\";\n\nexport type HTagHead<T extends string = string> = `${HTagHeadName}` | `${HTagHeadName}${HTagHeadAttr}${T}`;\n\nexport type HAttrClasses = Array<string | [string, boolean]>;\n\n// export type HAttrStyles = { [key: string]: string };\nexport type HAttrStyles = Partial<CSSStyleDeclaration>;\n\nexport type HAttrData = {\n [key: string]:\n | string\n | String\n | number\n | Number\n | boolean\n | Boolean\n | Date\n | Array<any>\n | Object;\n};\n\nexport type HAttrOnDataFnc = (e: Event) => any;\n\nexport type HAttrOnData =\n | string\n | String\n | number\n | Number\n | boolean\n | Boolean\n | Date\n | Array<any>\n | Object\n | HAttrOnDataFnc\n | null;\n\nexport type HAttrOnCb = [keyof HTMLElementEventMap, EventListener];\n\nexport type HAttrOnAct<HAttrOnActType extends string> = [\n keyof HTMLElementEventMap | string,\n HAttrOnActType,\n HAttrOnData?\n];\n\nexport type HAttrOn<HAttrOnActType extends string> = HAttrOnCb | HAttrOnAct<HAttrOnActType> | Array<HAttrOnCb | HAttrOnAct<HAttrOnActType>>;\n\nexport interface HTagAttrs<HAttrOnActType extends string> {\n readonly _id?: string;\n readonly _classes?: string[];\n readonly _ref?: string;\n readonly _hObj?: HObj<HAttrOnActType>;\n readonly key?: string;\n readonly skip?: boolean;\n readonly id?: string;\n readonly ref?: string;\n readonly classes?: HAttrClasses;\n readonly class?: string;\n readonly data?: HAttrData;\n readonly styles?: HAttrStyles;\n readonly style?: string;\n /** Event mapping to action, on: [event, action_type, action_data] */\n readonly on?: HAttrOn<HAttrOnActType>;\n /** Custom validation error message that is displayed when a form is submitted. */\n readonly validation?: {\n badInput?: string;\n patternMismatch?: string;\n rangeOverflow?: string;\n rangeUnderflow?: string;\n stepMismatch?: string;\n tooLong?: string;\n tooShort?: string;\n typeMismatch?: string;\n valueMissing?: string;\n };\n // HTMLElement\n readonly title?: string;\n readonly lang?: string;\n readonly accessKey?: string;\n readonly href?: string;\n readonly target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n // HTMLFormElement\n readonly novalidate?: boolean | Boolean;\n // HTMLInputElement\n readonly type?:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n | \"text\"\n | \"hidden\"\n | \"password\"\n | \"email\"\n | \"number\"\n | \"search\"\n | \"url\"\n | \"tel\"\n | \"color\"\n | \"date\"\n | \"datetime-local\"\n | \"month\"\n | \"range\"\n | \"time\"\n | \"week\"\n | \"submit\"\n | \"button\"\n | \"radio\"\n | \"checkbox\"\n | \"file\"\n | \"image\"\n | \"reset\"\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types\n | \"text/plain\"\n | \"text/html\"\n | \"text/css\"\n | \"text/javascript\" // (.js)\"\n | \"text/csv\"\n | \"text/xml\"\n | \"image/png\"\n | \"image/jpeg\" // (.jpg, .jpeg, .jfif, .pjpeg, .pjp)\"\n | \"image/svg+xml\" // (.svg)\"\n | \"audio/mp3\"\n | \"audio/ogg\"\n | \"video/mp4\"\n | \"video/ogg\"\n | \"application/json\"\n // | \"application/ld+json\" // (JSON-LD)\n // | \"application/msword\" // (.doc)\n | \"application/pdf\"\n // | \"application/sql\"\n // | \"application/vnd.api+json\"\n // | \"application/vnd.ms-excel\" // (.xls)\n // | \"application/vnd.ms-powerpoint\" // (.ppt)\"\n // | \"application/vnd.oasis.opendocument.text\" // (.odt)\"\n // | \"application/vnd.oasis.opendocument.spreadsheet\" // (.ods)\"\n // | \"application/vnd.oasis.opendocument.presentation\" // (.odp)\"\n // | \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" // (.pptx)\"\n // | \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" // (.xlsx)\"\n // | \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" // (.docx)\"\n | \"application/x-www-form-urlencoded\"\n | \"application/xml\"\n // | \"application/zip\"\n // | \"application/gzip\"\n | \"multipart/form-data\"\n // | `text/${string}`\n // | `image/${string}`\n // | `audio/${string}`\n // | `video/${string}`\n // | `application/${string}`\n // | `message/${string}`\n // | `multipart/${string}`\n // | `${string}/${string}`\n // | string\n ;\n readonly name?: string;\n readonly value?: string | number | Number | String;\n readonly autocomplete?: string;\n readonly checked?: boolean | Boolean;\n readonly disabled?: boolean | Boolean;\n readonly list?: string;\n readonly max?: number | string;\n readonly maxlength?: number | string;\n readonly min?: number | string;\n readonly minlength?: number | string;\n readonly multiple?: boolean | Boolean;\n readonly pattern?: string;\n readonly placeholder?: string;\n readonly readonly?: boolean | Boolean;\n readonly required?: boolean | Boolean;\n readonly size?: number | string;\n readonly step?: number | string;\n // HTMLImageElement\n readonly src?: string;\n readonly alt?: string;\n readonly height?: number | string;\n readonly width?: number | string;\n // Generic attributes\n readonly [key: string]:\n | string\n | String\n | string[]\n | String[]\n | number\n | Number\n | boolean\n | Boolean\n | Date\n | HAttrClasses\n | HAttrStyles\n // | HsmlAttrData\n | HAttrOn<HAttrOnActType>\n | EventListener\n | HObj<HAttrOnActType>\n | undefined;\n}\n\nexport type HFnc = (e: Element) => boolean | void;\n\nexport interface HObj<HAttrOnActType extends string> {\n toHsml?(): HElement<HAttrOnActType>;\n}\n\nexport interface HElements<HAttrOnActType extends string> extends Array<HElement<HAttrOnActType>> {}\n\nexport type HTagChildren<HAttrOnActType extends string> =\n | HElements<HAttrOnActType>\n | HFnc\n | HObj<HAttrOnActType>\n | string\n | String\n | boolean\n | Boolean\n | number\n | Number\n | Date\n | undefined\n | null;\n\nexport type HTagNoAttr<HAttrOnActType extends string> = [HTagHead, HTagChildren<HAttrOnActType>?];\nexport type HTagWithAttr<HAttrOnActType extends string> = [HTagHead, HTagAttrs<HAttrOnActType>, HTagChildren<HAttrOnActType>?];\n\nexport type HTag<HAttrOnActType extends string> = HTagNoAttr<HAttrOnActType> | HTagWithAttr<HAttrOnActType>;\n\nexport type HElement<HAttrOnActType extends string> =\n | HFnc\n | HObj<HAttrOnActType>\n | HTag<HAttrOnActType>\n | string\n | String\n | boolean\n | Boolean\n | number\n | Number\n | Date\n | undefined\n | null;\n\nexport interface HHandlerCtx<HAttrOnActType extends string> extends HObj<HAttrOnActType> {\n refs: { [name: string]: Element };\n actionCb(action: HAttrOnActType, data: HAttrOnData, e: Event): void;\n}\n\nexport interface HHandler<HAttrOnActType extends string, C extends HHandlerCtx<HAttrOnActType>> {\n open(tag: HTagHeadName, attrs: HTagAttrs<HAttrOnActType>, children: HElements<HAttrOnActType>, ctx?: C): boolean;\n close(tag: HTagHeadName, children: HElements<HAttrOnActType>, ctx?: C): void;\n text(text: string, ctx?: C): void;\n fnc(fnc: HFnc, ctx?: C): void;\n obj(obj: HObj<HAttrOnActType>, ctx?: C): void;\n}\n\nexport const NBSP = \"\\u00a0 \";\n\nexport function hsml<HAttrOnActType extends string, C extends HHandlerCtx<HAttrOnActType>>(\n hml: HElement<HAttrOnActType>,\n handler: HHandler<HAttrOnActType, C>,\n ctx?: C): void {\n // console.log(\"hsml\", hsml);\n if (hml === undefined || hml === null) {\n return;\n }\n switch (hml.constructor) {\n case Array:\n // const tag = hml as HTag;\n // if (\n // (\n // tag.length === 1 &&\n // tag[0].constructor === String\n // ) ||\n // (\n // tag.length === 2 &&\n // (\n // tag[0].constructor === String &&\n // (tag[1]!.constructor === Array || tag[1]!.constructor === Function)\n // ) ||\n // (\n // tag[0].constructor === String &&\n // tag[1]!.constructor === Object\n // )\n // ) ||\n // (\n // tag.length === 3 &&\n // tag[0].constructor === String &&\n // tag[1].constructor === Object &&\n // tag[2]!.constructor === Array\n // )\n // ) {\n // hsmlTag(hml as HTag, handler, ctx);\n // } else {\n // console.error(\"hsml parse error:\", hml);\n // // console.error(\"hsml parse error:\", JSON.stringify(hml, null, 4));\n // // throw Error(`hsml parse error: ${JSON.stringify(hml)}`);\n // }\n hsmlTag(hml as HTag<HAttrOnActType>, handler, ctx);\n break;\n case Function:\n handler.fnc(hml as HFnc, ctx);\n break;\n case String:\n handler.text(hml as string, ctx);\n break;\n case Boolean:\n handler.text(\"\" + hml, ctx);\n break;\n case Number:\n const n = hml as number;\n const ns = n.toLocaleString ? n.toLocaleString() : n.toString();\n handler.text(ns, ctx);\n break;\n case Date:\n const d = hml as Date;\n const ds = d.toLocaleString ? d.toLocaleString() : d.toString();\n handler.text(ds, ctx);\n break;\n default: // HObj\n handler.obj(hml as HObj<HAttrOnActType>, ctx);\n }\n\n function hsmlTag(hmlTag: HTag<HAttrOnActType>, handler: HHandler<HAttrOnActType, C>, ctx?: C): void {\n // console.log(\"hsml tag\", hmlTag);\n\n if (typeof hmlTag[0] !== \"string\") {\n console.error(\"HSML tag head not string:\", hmlTag);\n return;\n }\n\n const head = hmlTag[0] as HTagHead;\n const attrsObj = hmlTag[1] as any;\n const hasAttrs = attrsObj && attrsObj.constructor === Object;\n const childIdx = hasAttrs ? 2 : 1;\n\n let children: HElements<HAttrOnActType> = [];\n let hFnc: HFnc | undefined;\n let hObj: HObj<HAttrOnActType> | undefined;\n\n const htc = hmlTag[childIdx];\n switch (htc != null && htc.constructor) { // switch ((typeof htc !== \"undefined\" || htc !== null) && htc.constructor) {\n case Array:\n children = htc as HElements<HAttrOnActType>;\n break;\n case Function:\n hFnc = htc as HFnc;\n break;\n case String:\n case Boolean:\n case Number:\n case Date:\n children = [htc as string | boolean | number | Date];\n break;\n default: // HObj\n hObj = htc as HObj<HAttrOnActType>;\n break;\n }\n\n const refSplit = head.split(\"~\");\n const ref = refSplit[1];\n const dotSplit = refSplit[0].split(\".\");\n const hashSplit = dotSplit[0].split(\"#\");\n const tag = (hashSplit[0] ?? \"div\") as HTagHeadName;\n const id = hashSplit[1];\n const classes = dotSplit.slice(1);\n\n let attrs: HTagAttrs<HAttrOnActType>;\n if (hasAttrs) {\n attrs = attrsObj as HTagAttrs<HAttrOnActType>;\n } else {\n attrs = {} as HTagAttrs<HAttrOnActType>;\n }\n\n if (id) {\n (attrs as any)._id = id;\n }\n if (classes.length) {\n (attrs as any)._classes = classes;\n }\n if (ref) {\n (attrs as any)._ref = ref;\n }\n if (hObj) {\n (attrs as any)._hObj = hObj;\n }\n\n const skip = handler.open(tag, attrs, children, ctx);\n\n if (hFnc) {\n handler.fnc(hFnc, ctx);\n }\n\n if (!skip) {\n children.forEach(jml => hsml(jml, handler, ctx));\n }\n\n handler.close(tag, children, ctx);\n }\n}\n\nexport function hjoin<HAttrOnActType extends string>(hsmls: HElements<HAttrOnActType>, sep: string | HElement<HAttrOnActType>): HElements<HAttrOnActType> {\n const r = hsmls.reduce<HElements<HAttrOnActType>>(\n (p, c) => (p.push(c, sep), p),\n [] as HElements<HAttrOnActType>\n );\n r.splice(-1);\n return r;\n}\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nexport {applyAttr, applyProp, attributes, createAttributeMap} from './attributes';\nexport {alignWithDOM, alwaysDiffAttributes, close, createPatchInner, createPatchOuter, currentElement, currentContext, currentPointer, open, patchInner as patch, patchInner, patchOuter, skip, skipNode, tryGetCurrentElement} from './core';\nexport {setKeyAttributeName} from './global';\nexport {clearCache, getKey, importNode, isDataInitialized} from './node_data';\nexport {notifications} from './notifications';\nexport {symbols} from './symbols';\nexport {applyAttrs, applyStatics, attr, elementClose, elementOpen, elementOpenEnd, elementOpenStart, elementVoid, key, text} from './virtual_elements';\nexport * from './types';\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { AttrMutatorConfig } from \"./types\";\nimport { assert } from \"./assertions\";\nimport { createMap, has } from \"./util\";\nimport { symbols } from \"./symbols\";\n\n/**\n * @param name The name of the attribute. For example \"tabindex\" or\n * \"xlink:href\".\n * @returns The namespace to use for the attribute, or null if there is\n * no namespace.\n */\nfunction getNamespace(name: string): string | null {\n if (name.lastIndexOf(\"xml:\", 0) === 0) {\n return \"http://www.w3.org/XML/1998/namespace\";\n }\n\n if (name.lastIndexOf(\"xlink:\", 0) === 0) {\n return \"http://www.w3.org/1999/xlink\";\n }\n\n return null;\n}\n\n/**\n * Applies an attribute or property to a given Element. If the value is null\n * or undefined, it is removed from the Element. Otherwise, the value is set\n * as an attribute.\n * @param el The element to apply the attribute to.\n * @param name The attribute's name.\n * @param value The attribute's value.\n */\nfunction applyAttr(el: Element, name: string, value: unknown) {\n if (value == null) {\n el.removeAttribute(name);\n } else {\n const attrNS = getNamespace(name);\n if (attrNS) {\n el.setAttributeNS(attrNS, name, value as string);\n } else {\n el.setAttribute(name, value as string);\n }\n }\n}\n\n/**\n * Applies a property to a given Element.\n * @param el The element to apply the property to.\n * @param name The property's name.\n * @param value The property's value.\n */\nfunction applyProp(el: Element, name: string, value: unknown) {\n // (el as any)[name] = value;\n // rybar replaced\n if (value instanceof Boolean) {\n // tslint:disable-next-line: triple-equals\n (el as any)[name] = (value == true);\n } else {\n (el as any)[name] = value;\n }\n}\n\n/**\n * Applies a value to a style declaration. Supports CSS custom properties by\n * setting properties containing a dash using CSSStyleDeclaration.setProperty.\n * @param style A style declaration.\n * @param prop The property to apply. This can be either camelcase or dash\n * separated. For example: \"backgroundColor\" and \"background-color\" are both\n * supported.\n * @param value The value of the property.\n */\nfunction setStyleValue(\n style: CSSStyleDeclaration,\n prop: string,\n value: string\n) {\n if (prop.indexOf(\"-\") >= 0) {\n style.setProperty(prop, value);\n } else {\n (style as any)[prop] = value;\n }\n}\n\n/**\n * Applies a style to an Element. No vendor prefix expansion is done for\n * property names/values.\n * @param el The Element to apply the style for.\n * @param name The attribute's name.\n * @param style The style to set. Either a string of css or an object\n * containing property-value pairs.\n */\nfunction applyStyle(\n el: Element,\n name: string,\n style: string | { [k: string]: string }\n) {\n // MathML elements inherit from Element, which does not have style. We cannot\n // do `instanceof HTMLElement` / `instanceof SVGElement`, since el can belong\n // to a different document, so just check that it has a style.\n assert(\"style\" in el);\n const elStyle = (<HTMLElement | SVGElement>el).style;\n\n if (typeof style === \"string\") {\n elStyle.cssText = style;\n } else {\n elStyle.cssText = \"\";\n\n for (const prop in style) {\n if (has(style, prop)) {\n setStyleValue(elStyle, prop, style[prop]);\n }\n }\n }\n}\n\n/**\n * Updates a single attribute on an Element.\n * @param el The Element to apply the attribute to.\n * @param name The attribute's name.\n * @param value The attribute's value. If the value is an object or\n * function it is set on the Element, otherwise, it is set as an HTML\n * attribute.\n */\nfunction applyAttributeTyped(el: Element, name: string, value: unknown) {\n const type = typeof value;\n if (type === \"object\" || type === \"function\") {\n // rybar, was removed\n // if (value instanceof Boolean) {\n // // tslint:disable-next-line: triple-equals\n // applyAttr(el, name, value == true ? \"\" : null);\n // } else {\n // applyAttr(el, name, value);\n // }\n applyProp(el, name, value);\n } else {\n applyAttr(el, name, value);\n }\n}\n\nfunction createAttributeMap() {\n const attributes: AttrMutatorConfig = createMap() as AttrMutatorConfig;\n // Special generic mutator that's called for any attribute that does not\n // have a specific mutator.\n attributes[symbols.default] = applyAttributeTyped;\n\n attributes[\"style\"] = applyStyle;\n return attributes;\n}\n\n/**\n * A publicly mutable object to provide custom mutators for attributes.\n * NB: The result of createMap() has to be recast since closure compiler\n * will just assume attributes is \"any\" otherwise and throws away\n * the type annotation set by tsickle.\n */\nconst attributes = createAttributeMap();\n\n/**\n * Calls the appropriate attribute mutator for this attribute.\n * @param el The Element to apply the attribute to.\n * @param name The attribute's name.\n * @param value The attribute's value. If the value is an object or\n * function it is set on the Element, otherwise, it is set as an HTML\n * attribute.\n * @param attrs The attribute map of mutators.\n */\nfunction updateAttribute(\n el: Element,\n name: string,\n value: unknown,\n attrs: AttrMutatorConfig\n) {\n const mutator = attrs[name] || attrs[symbols.default];\n mutator(el, name, value);\n}\n\nexport {\n createAttributeMap,\n updateAttribute,\n applyProp,\n applyAttr,\n attributes\n};\n","// Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { DEBUG } from \"./global\";\nimport { NameOrCtorDef } from \"./types\";\n\n/**\n * Keeps track whether or not we are in an attributes declaration (after\n * elementOpenStart, but before elementOpenEnd).\n */\nlet inAttributes = false;\n\n/**\n * Keeps track whether or not we are in an element that should not have its\n * children cleared.\n */\nlet inSkip = false;\n\n/**\n * Keeps track of whether or not we are in a patch.\n */\nlet inPatch = false;\n\n/**\n * Asserts that a value exists and is not null or undefined. goog.asserts\n * is not used in order to avoid dependencies on external code.\n * @param val The value to assert is truthy.\n * @returns The value.\n */\nfunction assert<T extends {}>(val: T | null | undefined): T {\n if (DEBUG && !val) {\n throw new Error(\"Expected value to be defined\");\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return val!;\n}\n\n/**\n * Makes sure that there is a current patch context.\n * @param functionName The name of the caller, for the error message.\n */\nfunction assertInPatch(functionName: string) {\n if (!inPatch) {\n throw new Error(\"Cannot call \" + functionName + \"() unless in patch.\");\n }\n}\n\n/**\n * Makes sure that a patch closes every node that it opened.\n * @param openElement\n * @param root\n */\nfunction assertNoUnclosedTags(\n openElement: Node | null,\n root: Node | DocumentFragment\n) {\n if (openElement === root) {\n return;\n }\n\n let currentElement = openElement;\n const openTags: Array<string> = [];\n while (currentElement && currentElement !== root) {\n openTags.push(currentElement.nodeName.toLowerCase());\n currentElement = currentElement.parentNode;\n }\n\n throw new Error(\"One or more tags were not closed:\\n\" + openTags.join(\"\\n\"));\n}\n\n/**\n * Makes sure that node being outer patched has a parent node.\n * @param parent\n */\nfunction assertPatchOuterHasParentNode(parent: Node | null) {\n if (!parent) {\n console.warn(\n \"patchOuter requires the node have a parent if there is a key.\"\n );\n }\n}\n\n/**\n * Makes sure that the caller is not where attributes are expected.\n * @param functionName The name of the caller, for the error message.\n */\nfunction assertNotInAttributes(functionName: string) {\n if (inAttributes) {\n throw new Error(\n functionName +\n \"() can not be called between \" +\n \"elementOpenStart() and elementOpenEnd().\"\n );\n }\n}\n\n/**\n * Makes sure that the caller is not inside an element that has declared skip.\n * @param functionName The name of the caller, for the error message.\n */\nfunction assertNotInSkip(functionName: string) {\n if (inSkip) {\n throw new Error(\n functionName +\n \"() may not be called inside an element \" +\n \"that has called skip().\"\n );\n }\n}\n\n/**\n * Makes sure that the caller is where attributes are expected.\n * @param functionName The name of the caller, for the error message.\n */\nfunction assertInAttributes(functionName: string) {\n if (!inAttributes) {\n throw new Error(\n functionName +\n \"() can only be called after calling \" +\n \"elementOpenStart().\"\n );\n }\n}\n\n/**\n * Makes sure the patch closes virtual attributes call\n */\nfunction assertVirtualAttributesClosed() {\n if (inAttributes) {\n throw new Error(\n \"elementOpenEnd() must be called after calling \" + \"elementOpenStart().\"\n );\n }\n}\n\n/**\n * Makes sure that tags are correctly nested.\n * @param currentNameOrCtor\n * @param nameOrCtor\n */\nfunction assertCloseMatchesOpenTag(\n currentNameOrCtor: NameOrCtorDef,\n nameOrCtor: NameOrCtorDef\n) {\n if (currentNameOrCtor !== nameOrCtor) {\n throw new Error(\n 'Received a call to close \"' +\n nameOrCtor +\n '\" but \"' +\n currentNameOrCtor +\n '\" was open.'\n );\n }\n}\n\n/**\n * Makes sure that no children elements have been declared yet in the current\n * element.\n * @param functionName The name of the caller, for the error message.\n * @param previousNode\n */\nfunction assertNoChildrenDeclaredYet(\n functionName: string,\n previousNode: Node | null\n) {\n if (previousNode !== null) {\n throw new Error(\n functionName +\n \"() must come before any child \" +\n \"declarations inside the current element.\"\n );\n }\n}\n\n/**\n * Checks that a call to patchOuter actually patched the element.\n * @param maybeStartNode The value for the currentNode when the patch\n * started.\n * @param maybeCurrentNode The currentNode when the patch finished.\n * @param expectedNextNode The Node that is expected to follow the\n * currentNode after the patch;\n * @param expectedPrevNode The Node that is expected to preceed the\n * currentNode after the patch.\n */\nfunction assertPatchElementNoExtras(\n maybeStartNode: Node | null,\n maybeCurrentNode: Node | null,\n expectedNextNode: Node | null,\n expectedPrevNode: Node | null\n) {\n const startNode = assert(maybeStartNode);\n const currentNode = assert(maybeCurrentNode);\n const wasUpdated =\n currentNode.nextSibling === expectedNextNode &&\n currentNode.previousSibling === expectedPrevNode;\n const wasChanged =\n currentNode.nextSibling === startNode.nextSibling &&\n currentNode.previousSibling === expectedPrevNode;\n const wasRemoved = currentNode === startNode;\n\n if (!wasUpdated && !wasChanged && !wasRemoved) {\n throw new Error(\n \"There must be exactly one top level call corresponding \" +\n \"to the patched element.\"\n );\n }\n}\n\n/**\n * @param newContext The current patch context.\n */\nfunction updatePatchContext(newContext: {} | null) {\n inPatch = newContext != null;\n}\n\n/**\n * Updates the state of being in an attribute declaration.\n * @param value Whether or not the patch is in an attribute declaration.\n * @return the previous value.\n */\nfunction setInAttributes(value: boolean) {\n const previous = inAttributes;\n inAttributes = value;\n return previous;\n}\n\n/**\n * Updates the state of being in a skip element.\n * @param value Whether or not the patch is skipping the children of a\n * parent node.\n * @return the previous value.\n */\nfunction setInSkip(value: boolean) {\n const previous = inSkip;\n inSkip = value;\n return previous;\n}\n\nexport {\n assert,\n assertInPatch,\n assertNoUnclosedTags,\n assertNotInAttributes,\n assertInAttributes,\n assertCloseMatchesOpenTag,\n assertVirtualAttributesClosed,\n assertNoChildrenDeclaredYet,\n assertNotInSkip,\n assertPatchElementNoExtras,\n assertPatchOuterHasParentNode,\n setInAttributes,\n setInSkip,\n updatePatchContext\n};\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\n/**\n * The name of the HTML attribute that holds the element key\n * (e.g. `<div key=\"foo\">`). The attribute value, if it exists, is then used\n * as the default key when importing an element.\n * If null, no attribute value is used as the default key.\n */\nlet keyAttributeName: string | null = \"key\";\n\nfunction getKeyAttributeName() {\n return keyAttributeName;\n}\n\nfunction setKeyAttributeName(name: string | null) {\n keyAttributeName = name;\n}\n\nexport { DEBUG } from \"./debug\";\nexport { getKeyAttributeName, setKeyAttributeName };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nexport const DEBUG = true;\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\n/**\n * A cached reference to the hasOwnProperty function.\n */\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * A constructor function that will create blank objects.\n */\nfunction Blank() {}\n\nBlank.prototype = Object.create(null);\n\n/**\n * Used to prevent property collisions between our \"map\" and its prototype.\n * @param map The map to check.\n * @param property The property to check.\n * @return Whether map has property.\n */\nfunction has(map: object, property: string): boolean {\n return hasOwnProperty.call(map, property);\n}\n\n/**\n * Creates an map object without a prototype.\n * @returns An Object that can be used as a map.\n */\nfunction createMap(): any {\n return new (Blank as any)();\n}\n\n/**\n * Truncates an array, removing items up until length.\n * @param arr The array to truncate.\n * @param length The new length of the array.\n */\nfunction truncateArray(arr: Array<{} | null | undefined>, length: number) {\n while (arr.length > length) {\n arr.pop();\n }\n}\n\n/**\n * Creates an array for a desired initial size. Note that the array will still\n * be empty.\n * @param initialAllocationSize The initial size to allocate.\n * @returns An empty array, with an initial allocation for the desired size.\n */\nfunction createArray<T>(initialAllocationSize: number): Array<T> {\n const arr = new Array(initialAllocationSize);\n truncateArray(arr, 0);\n return arr;\n}\n\nexport { createArray, createMap, has, truncateArray };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nconst symbols = {\n default: \"__default\"\n};\n\nexport { symbols };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport {\n assertInPatch,\n assertNoChildrenDeclaredYet,\n assertNotInAttributes,\n assertNoUnclosedTags,\n assertPatchElementNoExtras,\n assertPatchOuterHasParentNode,\n assertVirtualAttributesClosed,\n setInAttributes,\n setInSkip,\n updatePatchContext\n} from \"./assertions\";\nimport { Context } from \"./context\";\nimport { getFocusedPath, moveBefore } from \"./dom_util\";\nimport { DEBUG } from \"./global\";\nimport { getData } from \"./node_data\";\nimport { createElement, createText } from \"./nodes\";\nimport {\n Key,\n MatchFnDef,\n NameOrCtorDef,\n PatchConfig,\n PatchFunction\n} from \"./types\";\n\n/**\n * The default match function to use, if one was not specified when creating\n * the patcher.\n * @param matchNode The node to match against, unused.\n * @param nameOrCtor The name or constructor as declared.\n * @param expectedNameOrCtor The name or constructor of the existing node.\n * @param key The key as declared.\n * @param expectedKey The key of the existing node.\n * @returns True if the node matches, false otherwise.\n */\nfunction defaultMatchFn(\n matchNode: Node,\n nameOrCtor: NameOrCtorDef,\n expectedNameOrCtor: NameOrCtorDef,\n key: Key,\n expectedKey: Key\n): boolean {\n // Key check is done using double equals as we want to treat a null key the\n // same as undefined. This should be okay as the only values allowed are\n // strings, null and undefined so the == semantics are not too weird.\n return nameOrCtor == expectedNameOrCtor && key == expectedKey;\n}\n\nlet context: Context | null = null;\n\nlet currentNode: Node | null = null;\n\nlet currentParent: Node | null = null;\n\nlet doc: Document | null = null;\n\nlet focusPath: Array<Node> = [];\n\nlet matchFn: MatchFnDef = defaultMatchFn;\n\n/**\n * Used to build up call arguments. Each patch call gets a separate copy, so\n * this works with nested calls to patch.\n */\nlet argsBuilder: Array<{} | null | undefined> = [];\n\n/**\n * Used to build up attrs for the an element.\n */\nlet attrsBuilder: Array<any> = [];\n\n/**\n * TODO(sparhami) We should just export argsBuilder directly when Closure\n * Compiler supports ES6 directly.\n * @returns The Array used for building arguments.\n */\nfunction getArgsBuilder(): Array<any> {\n return argsBuilder;\n}\n\n/**\n * TODO(sparhami) We should just export attrsBuilder directly when Closure\n * Compiler supports ES6 directly.\n * @returns The Array used for building arguments.\n */\nfunction getAttrsBuilder(): Array<any> {\n return attrsBuilder;\n}\n\n/**\n * Checks whether or not the current node matches the specified nameOrCtor and\n * key. This uses the specified match function when creating the patcher.\n * @param matchNode A node to match the data to.\n * @param nameOrCtor The name or constructor to check for.\n * @param key The key used to identify the Node.\n * @return True if the node matches, false otherwise.\n */\nfunction matches(\n matchNode: Node,\n nameOrCtor: NameOrCtorDef,\n key: Key\n): boolean {\n const data = getData(matchNode, key);\n\n return matchFn(matchNode, nameOrCtor, data.nameOrCtor, key, data.key);\n}\n\n/**\n * Finds the matching node, starting at `node` and looking at the subsequent\n * siblings if a key is used.\n * @param matchNode The node to start looking at.\n * @param nameOrCtor The name or constructor for the Node.\n * @param key The key used to identify the Node.\n * @returns The matching Node, if any exists.\n */\nfunction getMatchingNode(\n matchNode: Node | null,\n nameOrCtor: NameOrCtorDef,\n key: Key\n): Node | null {\n if (!matchNode) {\n return null;\n }\n\n let cur: Node | null = matchNode;\n\n do {\n if (matches(cur, nameOrCtor, key)) {\n return cur;\n }\n } while (key && (cur = cur.nextSibling));\n\n return null;\n}\n\n/**\n * Updates the internal structure of a DOM node in the case that an external\n * framework tries to modify a DOM element.\n * @param el The DOM node to update.\n */\nfunction alwaysDiffAttributes(el: Element) {\n getData(el).alwaysDiffAttributes = true;\n}\n\n/**\n * Clears out any unvisited Nodes in a given range.\n * @param maybeParentNode\n * @param startNode The node to start clearing from, inclusive.\n * @param endNode The node to clear until, exclusive.\n */\nfunction clearUnvisitedDOM(\n maybeParentNode: Node | null,\n startNode: Node | null,\n endNode: Node | null\n) {\n const parentNode = maybeParentNode!;\n let child = startNode;\n\n while (child !== endNode) {\n const next = child!.nextSibling;\n parentNode.removeChild(child!);\n context!.markDeleted(child!);\n child = next;\n }\n}\n\n/**\n * @return The next Node to be patched.\n */\nfunction getNextNode(): Node | null {\n if (currentNode) {\n return currentNode.nextSibling;\n } else {\n return currentParent!.firstChild;\n }\n}\n\n/**\n * Changes to the first child of the current node.\n */\nfunction enterNode() {\n currentParent = currentNode;\n currentNode = null;\n}\n\n/**\n * Changes to the parent of the current node, removing any unvisited children.\n */\nfunction exitNode() {\n clearUnvisitedDOM(currentParent, getNextNode(), null);\n\n currentNode = currentParent;\n currentParent = currentParent!.parentNode;\n}\n\n/**\n * Changes to the next sibling of the current node.\n */\nfunction nextNode() {\n currentNode = getNextNode();\n}\n\n/**\n * Creates a Node and marking it as created.\n * @param nameOrCtor The name or constructor for the Node.\n * @param key The key used to identify the Node.\n * @param nonce The nonce attribute for the element.\n * @return The newly created node.\n */\nfunction createNode(nameOrCtor: NameOrCtorDef, key: Key, nonce?: string): Node {\n let node;\n\n if (nameOrCtor === \"#text\") {\n node = createText(doc!);\n } else {\n node = createElement(doc!, currentParent!, nameOrCtor, key);\n if (nonce) {\n node.setAttribute(\"nonce\", nonce);\n }\n }\n\n context!.markCreated(node);\n\n return node;\n}\n\n/**\n * Aligns the virtual Node definition with the actual DOM, moving the\n * corresponding DOM node to the correct location or creating it if necessary.\n * @param nameOrCtor The name or constructor for the Node.\n * @param key The key used to identify the Node.\n * @param nonce The nonce attribute for the element.\n */\nfunction alignWithDOM(nameOrCtor: NameOrCtorDef, key: Key, nonce?: string) {\n nextNode();\n const existingNode = getMatchingNode(currentNode, nameOrCtor, key);\n const node = existingNode || createNode(nameOrCtor, key, nonce);\n\n // If we are at the matching node, then we are done.\n if (node === currentNode) {\n return;\n }\n\n // Re-order the node into the right position, preserving focus if either\n // node or currentNode are focused by making sure that they are not detached\n // from the DOM.\n if (focusPath.indexOf(node) >= 0) {\n // Move everything else before the node.\n moveBefore(currentParent!, node, currentNode);\n } else {\n currentParent!.insertBefore(node, currentNode);\n }\n\n currentNode = node;\n}\n\n/**\n * Makes sure that the current node is an Element with a matching nameOrCtor and\n * key.\n *\n * @param nameOrCtor The tag or constructor for the Element.\n * @param key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param nonce The nonce attribute for the element.\n * @return The corresponding Element.\n */\nfunction open(\n nameOrCtor: NameOrCtorDef,\n key?: Key,\n nonce?: string\n): HTMLElement {\n alignWithDOM(nameOrCtor, key, nonce);\n enterNode();\n return currentParent as HTMLElement;\n}\n\n/**\n * Closes the currently open Element, removing any unvisited children if\n * necessary.\n * @returns The Element that was just closed.\n */\nfunction close(): Element {\n if (DEBUG) {\n setInSkip(false);\n }\n\n exitNode();\n return currentNode as Element;\n}\n\n/**\n * Makes sure the current node is a Text node and creates a Text node if it is\n * not.\n * @returns The Text node that was aligned or created.\n */\nfunction text(): Text {\n alignWithDOM(\"#text\", null);\n return currentNode as Text;\n}\n\n/**\n * @returns The current Element being patched.\n */\nfunction currentElement(): Element {\n if (DEBUG) {\n assertInPatch(\"currentElement\");\n assertNotInAttributes(\"currentElement\");\n }\n return currentParent as Element;\n}\n\n/**\n * @returns The current Element being patched, or null if no patch is in progress.\n */\nfunction tryGetCurrentElement(): Element | null {\n return currentParent as Element | null;\n}\n\n/**\n * @return The Node that will be evaluated for the next instruction.\n */\nfunction currentPointer(): Node {\n if (DEBUG) {\n assertInPatch(\"currentPointer\");\n assertNotInAttributes(\"currentPointer\");\n }\n // TODO(tomnguyen): assert that this is not null\n return getNextNode()!;\n}\n\nfunction currentContext() {\n return context;\n}\n\n/**\n * Skips the children in a subtree, allowing an Element to be closed without\n * clearing out the children.\n */\nfunction skip() {\n if (DEBUG) {\n assertNoChildrenDeclaredYet(\"skip\", currentNode);\n setInSkip(true);\n }\n currentNode = currentParent!.lastChild;\n}\n\n/**\n * Returns a patcher function that sets up and restores a patch context,\n * running the run function with the provided data.\n * @param run The function that will run the patch.\n * @param patchConfig The configuration to use for the patch.\n * @returns The created patch function.\n */\nfunction createPatcher<T, R>(\n run: PatchFunction<T, R>,\n patchConfig: PatchConfig = {}\n): PatchFunction<T, R> {\n const { matches = defaultMatchFn } = patchConfig;\n\n const f: PatchFunction<T, R> = (node, fn, data) => {\n const prevContext = context;\n const prevDoc = doc;\n const prevFocusPath = focusPath;\n const prevArgsBuilder = argsBuilder;\n const prevAttrsBuilder = attrsBuilder;\n const prevCurrentNode = currentNode;\n const prevCurrentParent = currentParent;\n const prevMatchFn = matchFn;\n let previousInAttributes = false;\n let previousInSkip = false;\n\n doc = node.ownerDocument;\n context = new Context(node);\n matchFn = matches;\n argsBuilder = [];\n attrsBuilder = [];\n currentNode = null;\n currentParent = node.parentNode;\n focusPath = getFocusedPath(node, currentParent);\n\n if (DEBUG) {\n previousInAttributes = setInAttributes(false);\n previousInSkip = setInSkip(false);\n updatePatchContext(context);\n }\n\n try {\n const retVal = run(node, fn, data);\n if (DEBUG) {\n assertVirtualAttributesClosed();\n }\n\n return retVal;\n } finally {\n context.notifyChanges();\n\n doc = prevDoc;\n context = prevContext;\n matchFn = prevMatchFn;\n argsBuilder = prevArgsBuilder;\n attrsBuilder = prevAttrsBuilder;\n currentNode = prevCurrentNode;\n currentParent = prevCurrentParent;\n focusPath = prevFocusPath;\n\n // Needs to be done after assertions because assertions rely on state\n // from these methods.\n if (DEBUG) {\n setInAttributes(previousInAttributes);\n setInSkip(previousInSkip);\n updatePatchContext(context);\n }\n }\n };\n return f;\n}\n\n/**\n * Creates a patcher that patches the document starting at node with a\n * provided function. This function may be called during an existing patch operation.\n * @param patchConfig The config to use for the patch.\n * @returns The created function for patching an Element's children.\n */\nfunction createPatchInner<T>(\n patchConfig?: PatchConfig\n): PatchFunction<T, Node> {\n return createPatcher((node, fn, data) => {\n currentNode = node;\n\n enterNode();\n fn(data);\n exitNode();\n\n if (DEBUG) {\n assertNoUnclosedTags(currentNode, node);\n }\n\n return node;\n }, patchConfig);\n}\n\n/**\n * Creates a patcher that patches an Element with the the provided function.\n * Exactly one top level element call should be made corresponding to `node`.\n * @param patchConfig The config to use for the patch.\n * @returns The created function for patching an Element.\n */\nfunction createPatchOuter<T>(\n patchConfig?: PatchConfig\n): PatchFunction<T, Node | null> {\n return createPatcher((node, fn, data) => {\n const startNode = ({ nextSibling: node } as any) as Element;\n let expectedNextNode: Node | null = null;\n let expectedPrevNode: Node | null = null;\n\n if (DEBUG) {\n expectedNextNode = node.nextSibling;\n expectedPrevNode = node.previousSibling;\n }\n\n currentNode = startNode;\n fn(data);\n\n if (DEBUG) {\n if (getData(node).key) {\n assertPatchOuterHasParentNode(currentParent);\n }\n assertPatchElementNoExtras(\n startNode,\n currentNode,\n expectedNextNode,\n expectedPrevNode\n );\n }\n\n if (currentParent) {\n clearUnvisitedDOM(currentParent, getNextNode(), node.nextSibling);\n }\n\n return startNode === currentNode ? null : currentNode;\n }, patchConfig);\n}\n\nconst patchInner: <T>(\n node: Element | DocumentFragment,\n template: (a: T | undefined) => void,\n data?: T | undefined\n) => Node = createPatchInner();\nconst patchOuter: <T>(\n node: Element | DocumentFragment,\n template: (a: T | undefined) => void,\n data?: T | undefined\n) => Node | null = createPatchOuter();\n\nexport {\n alignWithDOM,\n alwaysDiffAttributes,\n getArgsBuilder,\n getAttrsBuilder,\n text,\n createPatchInner,\n createPatchOuter,\n patchInner,\n patchOuter,\n open,\n close,\n currentElement,\n currentContext,\n currentPointer,\n skip,\n nextNode as skipNode,\n tryGetCurrentElement\n};\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { notifications } from \"./notifications\";\n\n/**\n * A context object keeps track of the state of a patch.\n */\nclass Context {\n private created: Array<Node> = [];\n private deleted: Array<Node> = [];\n public readonly node: Element | DocumentFragment;\n\n public constructor(node: Element | DocumentFragment) {\n this.node = node;\n }\n\n public markCreated(node: Node) {\n this.created.push(node);\n }\n\n public markDeleted(node: Node) {\n this.deleted.push(node);\n }\n\n /**\n * Notifies about nodes that were created during the patch operation.\n */\n public notifyChanges() {\n if (notifications.nodesCreated && this.created.length > 0) {\n notifications.nodesCreated(this.created);\n }\n\n if (notifications.nodesDeleted && this.deleted.length > 0) {\n notifications.nodesDeleted(this.deleted);\n }\n }\n}\n\nexport { Context };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nexport type NodeFunction = (n: Array<Node>) => void;\n\nexport interface Notifications {\n /**\n * Called after patch has completed with any Nodes that have been created\n * and added to the DOM.\n */\n nodesCreated: NodeFunction | null;\n /**\n * Called after patch has completed with any Nodes that have been removed\n * from the DOM.\n * Note it's an application's responsibility to handle any childNodes.\n */\n nodesDeleted: NodeFunction | null;\n}\n\nexport const notifications: Notifications = {\n nodesCreated: null,\n nodesDeleted: null\n};\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { assert } from \"./assertions\";\n\n/**\n * Checks if the node is the root of a document. This is either a Document\n * or ShadowRoot. DocumentFragments are included for simplicity of the\n * implementation, though we only want to consider Documents or ShadowRoots.\n * @param node The node to check.\n * @return True if the node the root of a document, false otherwise.\n */\nfunction isDocumentRoot(node: Node): node is Document | ShadowRoot {\n return node.nodeType === 11 || node.nodeType === 9;\n}\n\n/**\n * Checks if the node is an Element. This is faster than an instanceof check.\n * @param node The node to check.\n * @return Whether or not the node is an Element.\n */\nfunction isElement(node: Node): node is Element {\n return node.nodeType === 1;\n}\n\n/**\n * Checks if the node is a text node. This is faster than an instanceof check.\n * @param node The node to check.\n * @return Whether or not the node is a Text.\n */\nfunction isText(node: Node): node is Text {\n return node.nodeType === 3;\n}\n\n/**\n * @param node The node to start at, inclusive.\n * @param root The root ancestor to get until, exclusive.\n * @return The ancestry of DOM nodes.\n */\nfunction getAncestry(node: Node, root: Node | null) {\n const ancestry: Array<Node> = [];\n let cur: Node | null = node;\n\n while (cur !== root) {\n const n: Node = assert(cur);\n ancestry.push(n);\n // If `node` is inside of a ShadowRoot, then it needs to pierce the\n // ShadowRoot boundary in order to reach `root`.\n cur = n.parentNode || (root ? (n as ShadowRoot).host : null);\n }\n\n return ancestry;\n}\n\n/**\n * @param this\n * @returns The root node of the DOM tree that contains this node.\n */\nconst getRootNode =\n (typeof Node !== \"undefined\" && (Node as any).prototype.getRootNode) ||\n function(this: Node) {\n let cur: Node | null = this as Node;\n let prev = cur;\n\n while (cur) {\n prev = cur;\n cur = cur.parentNode;\n }\n\n return prev;\n };\n\n/**\n * @param node The node to get the activeElement for.\n * @returns The activeElement in the Document or ShadowRoot\n * corresponding to node, if present.\n */\nfunction getActiveElement(node: Node): Element | null {\n const root = getRootNode.call(node);\n return isDocumentRoot(root) ? root.activeElement : null;\n}\n\n/**\n * Gets the path of nodes that contain the focused node in the same document as\n * a reference node, up until the root.\n * @param node The reference node to get the activeElement for.\n * @param root The root to get the focused path until.\n * @returns The path of focused parents, if any exist.\n */\nfunction getFocusedPath(node: Node, root: Node | null): Array<Node> {\n const activeElement = getActiveElement(node);\n\n if (!activeElement || !node.contains(activeElement)) {\n return [];\n }\n\n return getAncestry(activeElement, root);\n}\n\n/**\n * Like insertBefore, but instead of moving the desired node, it moves all the\n * other nodes after.\n * @param parentNode\n * @param node\n * @param referenceNode\n */\nfunction moveBefore(parentNode: Node, node: Node, referenceNode: Node | null) {\n const insertReferenceNode = node.nextSibling;\n let cur = referenceNode;\n\n while (cur !== null && cur !== node) {\n const next = cur.nextSibling;\n parentNode.insertBefore(cur, insertReferenceNode);\n cur = next;\n }\n}\n\nexport { isElement, isText, getFocusedPath, moveBefore };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { Key, NameOrCtorDef } from \"./types\";\nimport { assert } from \"./assertions\";\nimport { createArray } from \"./util\";\nimport { isElement } from \"./dom_util\";\nimport { getKeyAttributeName } from \"./global\";\n\ndeclare global {\n interface Node {\n __incrementalDOMData: NodeData | null;\n }\n}\n\n/**\n * Keeps track of information needed to perform diffs for a given DOM node.\n */\nexport class NodeData {\n /**\n * An array of attribute name/value pairs, used for quickly diffing the\n * incomming attributes to see if the DOM node's attributes need to be\n * updated.\n */\n private _attrsArr: Array<any> | null = null;\n\n /**\n * Whether or not the statics have been applied for the node yet.\n */\n public staticsApplied = false;\n\n /**\n * The key used to identify this node, used to preserve DOM nodes when they\n * move within their parent.\n */\n public readonly key: Key;\n\n /**\n * The previous text value, for Text nodes.\n */\n public text: string | undefined;\n\n /**\n * The nodeName or contructor for the Node.\n */\n public readonly nameOrCtor: NameOrCtorDef;\n\n public alwaysDiffAttributes = false;\n\n public constructor(\n nameOrCtor: NameOrCtorDef,\n key: Key,\n text: string | undefined\n ) {\n this.nameOrCtor = nameOrCtor;\n this.key = key;\n this.text = text;\n }\n\n public hasEmptyAttrsArr(): boolean {\n const attrs = this._attrsArr;\n return !attrs || !attrs.length;\n }\n\n public getAttrsArr(length: number): Array<any> {\n return this._attrsArr || (this._attrsArr = createArray(length));\n }\n}\n\n/**\n * Initializes a NodeData object for a Node.\n * @param node The Node to initialized data for.\n * @param nameOrCtor The NameOrCtorDef to use when diffing.\n * @param key The Key for the Node.\n * @param text The data of a Text node, if importing a Text node.\n * @returns A NodeData object with the existing attributes initialized.\n */\nfunction initData(\n node: Node,\n nameOrCtor: NameOrCtorDef,\n key: Key,\n text?: string | undefined\n): NodeData {\n const data = new NodeData(nameOrCtor, key, text);\n node[\"__incrementalDOMData\"] = data;\n return data;\n}\n\n/**\n * @param node The node to check.\n * @returns True if the NodeData already exists, false otherwise.\n */\nfunction isDataInitialized(node: Node): boolean {\n return Boolean(node[\"__incrementalDOMData\"]);\n}\n\n/**\n * Records the element's attributes.\n * @param node The Element that may have attributes\n * @param data The Element's data\n */\nfunction recordAttributes(node: Element, data: NodeData) {\n const attributes = node.attributes;\n const length = attributes.length;\n if (!length) {\n return;\n }\n\n const attrsArr = data.getAttrsArr(length);\n\n // Use a cached length. The attributes array is really a live NamedNodeMap,\n // which exists as a DOM \"Host Object\" (probably as C++ code). This makes the\n // usual constant length iteration very difficult to optimize in JITs.\n for (let i = 0, j = 0; i < length; i += 1, j += 2) {\n const attr = attributes[i];\n const name = attr.name;\n const value = attr.value;\n\n attrsArr[j] = name;\n attrsArr[j + 1] = value;\n }\n}\n\n/**\n * Imports single node and its subtree, initializing caches, if it has not\n * already been imported.\n * @param node The node to import.\n * @param fallbackKey A key to use if importing and no key was specified.\n * Useful when not transmitting keys from serverside render and doing an\n * immediate no-op diff.\n * @returns The NodeData for the node.\n */\nfunction importSingleNode(node: Node, fallbackKey?: Key): NodeData {\n if (node[\"__incrementalDOMData\"]) {\n return node[\"__incrementalDOMData\"];\n }\n\n const nodeName = isElement(node) ? node.localName : node.nodeName;\n const keyAttrName = getKeyAttributeName();\n const keyAttr =\n isElement(node) && keyAttrName != null\n ? node.getAttribute(keyAttrName)\n : null;\n const key = isElement(node) ? keyAttr || fallbackKey : null;\n const data = initData(node, nodeName, key);\n\n if (isElement(node)) {\n recordAttributes(node, data);\n }\n\n return data;\n}\n\n/**\n * Imports node and its subtree, initializing caches.\n * @param node The Node to import.\n */\nfunction importNode(node: Node) {\n importSingleNode(node);\n\n for (\n let child: Node | null = node.firstChild;\n child;\n child = child.nextSibling\n ) {\n importNode(child);\n }\n}\n\n/**\n * Retrieves the NodeData object for a Node, creating it if necessary.\n * @param node The node to get data for.\n * @param fallbackKey A key to use if importing and no key was specified.\n * Useful when not transmitting keys from serverside render and doing an\n * immediate no-op diff.\n * @returns The NodeData for the node.\n */\nfunction getData(node: Node, fallbackKey?: Key) {\n return importSingleNode(node, fallbackKey);\n}\n\n/**\n * Gets the key for a Node. note that the Node should have been imported\n * by now.\n * @param node The node to check.\n * @returns The key used to create the node.\n */\nfunction getKey(node: Node) {\n assert(node[\"__incrementalDOMData\"]);\n return getData(node).key;\n}\n\n/**\n * Clears all caches from a node and all of its children.\n * @param node The Node to clear the cache for.\n */\nfunction clearCache(node: Node) {\n node[\"__incrementalDOMData\"] = null;\n\n for (\n let child: Node | null = node.firstChild;\n child;\n child = child.nextSibling\n ) {\n clearCache(child);\n }\n}\n\nexport { getData, getKey, initData, importNode, isDataInitialized, clearCache };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { getData, initData } from \"./node_data\";\nimport { Key, NameOrCtorDef } from \"./types\";\n\n/**\n * Gets the namespace to create an element (of a given tag) in.\n * @param tag The tag to get the namespace for.\n * @param parent The current parent Node, if any.\n * @returns The namespace to use.\n */\nfunction getNamespaceForTag(tag: string, parent: Node | null) {\n if (tag === \"svg\") {\n return \"http://www.w3.org/2000/svg\";\n }\n\n if (tag === \"math\") {\n return \"http://www.w3.org/1998/Math/MathML\";\n }\n\n if (parent == null) {\n return null;\n }\n\n if (getData(parent).nameOrCtor === \"foreignObject\") {\n return null;\n }\n\n // Since TypeScript 4.4 namespaceURI is only defined for Attr and Element\n // nodes. Checking for Element nodes here seems reasonable but breaks SVG\n // rendering in Chrome in certain cases. The cast to any should be removed\n // once we know why this happens.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (parent as any).namespaceURI;\n}\n\n/**\n * Creates an Element and initializes the NodeData.\n * @param doc The document with which to create the Element.\n * @param parent The parent of new Element.\n * @param nameOrCtor The tag or constructor for the Element.\n * @param key A key to identify the Element.\n * @returns The newly created Element.\n */\nfunction createElement(\n doc: Document,\n parent: Node | null,\n nameOrCtor: NameOrCtorDef,\n key: Key\n): Element {\n let el;\n\n if (typeof nameOrCtor === \"function\") {\n el = new nameOrCtor();\n } else {\n const namespace = getNamespaceForTag(nameOrCtor, parent);\n\n if (namespace) {\n el = doc.createElementNS(namespace, nameOrCtor);\n } else {\n el = doc.createElement(nameOrCtor);\n }\n }\n\n initData(el, nameOrCtor, key);\n\n return el;\n}\n\n/**\n * Creates a Text Node.\n * @param doc The document with which to create the Element.\n * @returns The newly created Text.\n */\nfunction createText(doc: Document): Text {\n const node = doc.createTextNode(\"\");\n initData(node, \"#text\", null);\n return node;\n}\n\nexport { createElement, createText };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport {\n assert,\n assertCloseMatchesOpenTag,\n assertInAttributes,\n assertInPatch,\n assertNotInAttributes,\n assertNotInSkip,\n setInAttributes\n} from \"./assertions\";\nimport { attributes, updateAttribute } from \"./attributes\";\nimport {\n getArgsBuilder,\n getAttrsBuilder,\n close,\n open,\n text as coreText,\n currentElement\n} from \"./core\";\nimport { DEBUG } from \"./global\";\nimport { getData, NodeData } from \"./node_data\";\nimport { AttrMutatorConfig, Key, NameOrCtorDef, Statics } from \"./types\";\nimport { createMap, truncateArray } from \"./util\";\nimport { calculateDiff } from \"./diff\";\n\n/**\n * The offset in the virtual element declaration where the attributes are\n * specified.\n */\nconst ATTRIBUTES_OFFSET = 3;\n\n/**\n * Used to keep track of the previous values when a 2-way diff is necessary.\n * This object is reused.\n * TODO(sparhamI) Scope this to a patch so you can call patch from an attribute\n * update.\n */\nconst prevAttrsMap = createMap();\n\n/**\n * @param element The Element to diff the attrs for.\n * @param data The NodeData associated with the Element.\n * @param attrs The attribute map of mutators\n */\nfunction diffAttrs(element: Element, data: NodeData, attrs: AttrMutatorConfig) {\n const attrsBuilder = getAttrsBuilder();\n const prevAttrsArr = data.getAttrsArr(attrsBuilder.length);\n\n calculateDiff(\n prevAttrsArr,\n attrsBuilder,\n element,\n updateAttribute,\n attrs,\n data.alwaysDiffAttributes\n );\n truncateArray(attrsBuilder, 0);\n}\n\n/**\n * Applies the statics. When importing an Element, any existing attributes that\n * match a static are converted into a static attribute.\n * @param node The Element to apply statics for.\n * @param data The NodeData associated with the Element.\n * @param statics The statics array.\n * @param attrs The attribute map of mutators.\n */\nfunction diffStatics(\n node: Element,\n data: NodeData,\n statics: Statics,\n attrs: AttrMutatorConfig\n) {\n if (data.staticsApplied) {\n return;\n }\n\n data.staticsApplied = true;\n\n if (!statics || !statics.length) {\n return;\n }\n\n if (data.hasEmptyAttrsArr()) {\n for (let i = 0; i < statics.length; i += 2) {\n updateAttribute(node, statics[i] as string, statics[i + 1], attrs);\n }\n return;\n }\n\n for (let i = 0; i < statics.length; i += 2) {\n prevAttrsMap[statics[i] as string] = i + 1;\n }\n\n const attrsArr = data.getAttrsArr(0);\n let j = 0;\n for (let i = 0; i < attrsArr.length; i += 2) {\n const name = attrsArr[i];\n const value = attrsArr[i + 1];\n const staticsIndex = prevAttrsMap[name];\n\n if (staticsIndex) {\n // For any attrs that are static and have the same value, make sure we do\n // not set them again.\n if (statics[staticsIndex] === value) {\n delete prevAttrsMap[name];\n }\n\n continue;\n }\n\n // For any attrs that are dynamic, move them up to the right place.\n attrsArr[j] = name;\n attrsArr[j + 1] = value;\n j += 2;\n }\n // Anything after `j` was either moved up already or static.\n truncateArray(attrsArr, j);\n\n for (const name in prevAttrsMap) {\n updateAttribute(node, name, statics[prevAttrsMap[name]], attrs);\n delete prevAttrsMap[name];\n }\n}\n\n/**\n * Declares a virtual Element at the current location in the document. This\n * corresponds to an opening tag and a elementClose tag is required. This is\n * like elementOpen, but the attributes are defined using the attr function\n * rather than being passed as arguments. Must be folllowed by 0 or more calls\n * to attr, then a call to elementOpenEnd.\n * @param nameOrCtor The Element's tag or constructor.\n * @param key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param statics An array of attribute name/value pairs of the static\n * attributes for the Element. Attributes will only be set once when the\n * Element is created.\n */\nfunction elementOpenStart(\n nameOrCtor: NameOrCtorDef,\n key?: Key,\n statics?: Statics\n) {\n const argsBuilder = getArgsBuilder();\n\n if (DEBUG) {\n assertNotInAttributes(\"elementOpenStart\");\n setInAttributes(true);\n }\n\n argsBuilder[0] = nameOrCtor;\n argsBuilder[1] = key;\n argsBuilder[2] = statics;\n}\n\n/**\n * Allows you to define a key after an elementOpenStart. This is useful in\n * templates that define key after an element has been opened ie\n * `<div key('foo')></div>`.\n * @param key The key to use for the next call.\n */\nfunction key(key: string) {\n const argsBuilder = getArgsBuilder();\n\n if (DEBUG) {\n assertInAttributes(\"key\");\n assert(argsBuilder);\n }\n argsBuilder[1] = key;\n}\n\n/**\n * Buffers an attribute, which will get applied during the next call to\n * `elementOpen`, `elementOpenEnd` or `applyAttrs`.\n * @param name The of the attribute to buffer.\n * @param value The value of the attribute to buffer.\n */\nfunction attr(name: string, value: any) {\n const attrsBuilder = getAttrsBuilder();\n\n if (DEBUG) {\n assertInPatch(\"attr\");\n }\n\n attrsBuilder.push(name);\n attrsBuilder.push(value);\n}\n\n/** @return The value of the nonce attribute. */\nfunction getNonce(): string {\n const argsBuilder = getArgsBuilder();\n const statics = <Statics>argsBuilder[2];\n if (statics) {\n for (let i = 0; i < statics.length; i += 2) {\n if (statics[i] === \"nonce\") {\n return statics[i + 1] as string;\n }\n }\n }\n return \"\";\n}\n\n/**\n * Closes an open tag started with elementOpenStart.\n * @return The corresponding Element.\n */\nfunction elementOpenEnd(): HTMLElement {\n const argsBuilder = getArgsBuilder();\n\n if (DEBUG) {\n assertInAttributes(\"elementOpenEnd\");\n setInAttributes(false);\n }\n\n const node = open(\n <NameOrCtorDef>argsBuilder[0],\n <Key>argsBuilder[1],\n getNonce()\n );\n const data = getData(node);\n\n diffStatics(node, data, <Statics>argsBuilder[2], attributes);\n diffAttrs(node, data, attributes);\n truncateArray(argsBuilder, 0);\n\n return node;\n}\n\n/**\n * @param nameOrCtor The Element's tag or constructor.\n * @param key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param statics An array of attribute name/value pairs of the static\n * attributes for the Element. Attributes will only be set once when the\n * Element is created.\n * @param varArgs, Attribute name/value pairs of the dynamic attributes\n * for the Element.\n * @return The corresponding Element.\n */\nfunction elementOpen(\n nameOrCtor: NameOrCtorDef,\n key?: Key,\n // Ideally we could tag statics and varArgs as an array where every odd\n // element is a string and every even element is any, but this is hard.\n statics?: Statics,\n ...varArgs: Array<any>\n) {\n if (DEBUG) {\n assertNotInAttributes(\"elementOpen\");\n assertNotInSkip(\"elementOpen\");\n }\n\n elementOpenStart(nameOrCtor, key, statics);\n\n for (let i = ATTRIBUTES_OFFSET; i < arguments.length; i += 2) {\n attr(arguments[i], arguments[i + 1]);\n }\n\n return elementOpenEnd();\n}\n\n/**\n * Applies the currently buffered attrs to the currently open element. This\n * clears the buffered attributes.\n * @param attrs The attributes.\n */\nfunction applyAttrs(attrs = attributes) {\n const node = currentElement();\n const data = getData(node);\n\n diffAttrs(node, data, attrs);\n}\n\n/**\n * Applies the current static attributes to the currently open element. Note:\n * statics should be applied before calling `applyAtrs`.\n * @param statics The statics to apply to the current element.\n * @param attrs The attributes.\n */\nfunction applyStatics(statics: Statics, attrs = attributes) {\n const node = currentElement();\n const data = getData(node);\n\n diffStatics(node, data, statics, attrs);\n}\n\n/**\n * Closes an open virtual Element.\n *\n * @param nameOrCtor The Element's tag or constructor.\n * @return The corresponding Element.\n */\nfunction elementClose(nameOrCtor: NameOrCtorDef): Element {\n if (DEBUG) {\n assertNotInAttributes(\"elementClose\");\n }\n\n const node = close();\n\n if (DEBUG) {\n assertCloseMatchesOpenTag(getData(node).nameOrCtor, nameOrCtor);\n }\n\n return node;\n}\n\n/**\n * Declares a virtual Element at the current location in the document that has\n * no children.\n * @param nameOrCtor The Element's tag or constructor.\n * @param key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param statics An array of attribute name/value pairs of the static\n * attributes for the Element. Attributes will only be set once when the\n * Element is created.\n * @param varArgs Attribute name/value pairs of the dynamic attributes\n * for the Element.\n * @return The corresponding Element.\n */\nfunction elementVoid(\n nameOrCtor: NameOrCtorDef,\n key?: Key,\n // Ideally we could tag statics and varArgs as an array where every odd\n // element is a string and every even element is any, but this is hard.\n statics?: Statics,\n ...varArgs: Array<any>\n) {\n elementOpen.apply(null, arguments as any);\n return elementClose(nameOrCtor);\n}\n\n/**\n * Declares a virtual Text at this point in the document.\n *\n * @param value The value of the Text.\n * @param varArgs\n * Functions to format the value which are called only when the value has\n * changed.\n * @return The corresponding text node.\n */\nfunction text(\n value: string | number | boolean,\n ...varArgs: Array<(a: {}) => string>\n) {\n if (DEBUG) {\n assertNotInAttributes(\"text\");\n assertNotInSkip(\"text\");\n }\n\n const node = coreText();\n const data = getData(node);\n\n if (data.text !== value) {\n data.text = value as string;\n\n let formatted = value;\n for (let i = 1; i < arguments.length; i += 1) {\n /*\n * Call the formatter function directly to prevent leaking arguments.\n * https://github.com/google/incremental-dom/pull/204#issuecomment-178223574\n */\n const fn = arguments[i];\n formatted = fn(formatted);\n }\n\n // Setting node.data resets the cursor in IE/Edge.\n if (node.data !== formatted) {\n node.data = formatted as string;\n }\n }\n\n return node;\n}\n\n/** */\nexport {\n applyAttrs,\n applyStatics,\n elementOpenStart,\n elementOpenEnd,\n elementOpen,\n elementVoid,\n elementClose,\n text,\n attr,\n key\n};\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { AttrMutatorConfig } from \"./types\";\nimport { createMap, truncateArray } from \"./util\";\nimport { flush, queueChange } from \"./changes\";\n\n/**\n * Used to keep track of the previous values when a 2-way diff is necessary.\n * This object is cleared out and reused.\n */\nconst prevValuesMap = createMap();\n\n/**\n * Calculates the diff between previous and next values, calling the update\n * function when an item has changed value. If an item from the previous values\n * is not present in the the next values, the update function is called with a\n * value of `undefined`.\n * @param prev The previous values, alternating name, value pairs.\n * @param next The next values, alternating name, value pairs.\n * @param updateCtx The context for the updateFn.\n * @param updateFn A function to call when a value has changed.\n * @param attrs Attribute map for mutators\n * @param alwaysDiffAttributes Whether to diff attributes unconditionally\n */\nfunction calculateDiff<T>(\n prev: Array<string>,\n next: Array<string>,\n updateCtx: T,\n updateFn: (\n ctx: T,\n x: string,\n y: {} | undefined,\n attrs: AttrMutatorConfig\n ) => void,\n attrs: AttrMutatorConfig,\n alwaysDiffAttributes: boolean = false\n) {\n const isNew = !prev.length || alwaysDiffAttributes;\n let i = 0;\n\n for (; i < next.length; i += 2) {\n const name = next[i];\n if (isNew) {\n prev[i] = name;\n } else if (prev[i] !== name) {\n break;\n }\n\n const value = next[i + 1];\n if (isNew || prev[i + 1] !== value) {\n prev[i + 1] = value;\n queueChange(updateFn, updateCtx, name, value, attrs);\n }\n }\n\n // Items did not line up exactly as before, need to make sure old items are\n // removed. This should be a rare case.\n if (i < next.length || i < prev.length) {\n const startIndex = i;\n\n for (i = startIndex; i < prev.length; i += 2) {\n prevValuesMap[prev[i]] = prev[i + 1];\n }\n\n for (i = startIndex; i < next.length; i += 2) {\n const name = next[i] as string;\n const value = next[i + 1];\n\n if (prevValuesMap[name] !== value) {\n queueChange(updateFn, updateCtx, name, value, attrs);\n }\n\n prev[i] = name;\n prev[i + 1] = value;\n\n delete prevValuesMap[name];\n }\n\n truncateArray(prev, next.length);\n\n for (const name in prevValuesMap) {\n queueChange(updateFn, updateCtx, name, undefined, attrs);\n delete prevValuesMap[name];\n }\n }\n\n flush();\n}\n\nexport { calculateDiff };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { truncateArray } from \"./util\";\n\nconst buffer: Array<any> = [];\n\nlet bufferStart = 0;\n\n/**\n * TODO(tomnguyen): This is a bit silly and really needs to be better typed.\n * @param fn A function to call.\n * @param a The first argument to the function.\n * @param b The second argument to the function.\n * @param c The third argument to the function.\n * @param d The fourth argument to the function\n */\nfunction queueChange<A, B, C, D>(\n fn: (a: A, b: B, c: C, d: D) => void,\n a: A,\n b: B,\n c: C,\n d: D\n) {\n buffer.push(fn);\n buffer.push(a);\n buffer.push(b);\n buffer.push(c);\n buffer.push(d);\n}\n\n/**\n * Flushes the changes buffer, calling the functions for each change.\n */\nfunction flush() {\n // A change may cause this function to be called re-entrantly. Keep track of\n // the portion of the buffer we are consuming. Updates the start pointer so\n // that the next call knows where to start from.\n const start = bufferStart;\n const end = buffer.length;\n\n bufferStart = end;\n\n for (let i = start; i < end; i += 5) {\n const fn = buffer[i] as (a: any, b: any, c: any, d: any) => undefined;\n fn(buffer[i + 1], buffer[i + 2], buffer[i + 3], buffer[i + 4]);\n }\n\n bufferStart = start;\n truncateArray(buffer, start);\n}\n\nexport { queueChange, flush };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nexport interface ElementConstructor {\n new (): Element;\n}\n\nexport type AttrMutator = (a: Element, b: string, c: any) => void;\n\nexport interface AttrMutatorConfig {\n [x: string]: AttrMutator;\n}\n\nexport type NameOrCtorDef = string | ElementConstructor;\n\nexport type Key = string | number | null | undefined;\n\nexport type Statics = Array<{}> | null | undefined;\n\nexport type PatchFunction<T, R> = (\n node: Element | DocumentFragment,\n template: (a: T | undefined) => void,\n data?: T | undefined\n) => R;\n\nexport type MatchFnDef = (\n matchNode: Node,\n nameOrCtor: NameOrCtorDef,\n expectedNameOrCtor: NameOrCtorDef,\n key: Key,\n expectedKey: Key\n) => boolean;\n\nexport interface PatchConfig {\n matches?: MatchFnDef;\n}\n"],"names":[],"version":3,"file":"hsml-app.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AE0PO,MAAM,4CAAO;AAEd,SAAU,0CACR,GAA6B,EAC7B,OAAoC,EACpC,GAAO,EAHf;IAKI,IAAI,QAAQ,aAAa,QAAQ,IAAI,EACjC;IAEJ,OAAQ,IAAI,WAAW;QACnB,KAAK;YA+BD,QAAQ,KAA6B,SAAS;YAC9C,KAAM;QACV,KAAK;YACD,QAAQ,GAAG,CAAC,KAAa;YACzB,KAAM;QACV,KAAK;YACD,QAAQ,IAAI,CAAC,KAAe;YAC5B,KAAM;QACV,KAAK;YACD,QAAQ,IAAI,CAAC,KAAK,KAAK;YACvB,KAAM;QACV,KAAK;YACD,MAAM,IAAI;YACV,MAAM,KAAK,EAAE,cAAc,GAAG,EAAE,cAAc,KAAK,EAAE,QAAQ,EAAE;YAC/D,QAAQ,IAAI,CAAC,IAAI;YACjB,KAAM;QACV,KAAK;YACD,MAAM,IAAI;YACV,MAAM,KAAK,EAAE,cAAc,GAAG,EAAE,cAAc,KAAK,EAAE,QAAQ,EAAE;YAC/D,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om/index.ts","src/incremental-dom/attributes.ts","src/incremental-dom/assertions.ts","src/incremental-dom/global.ts","src/incremental-dom/debug.ts","src/incremental-dom/util.ts","src/incremental-dom/symbols.ts","src/incremental-dom/core.ts","src/incremental-dom/context.ts","src/incremental-dom/notifications.ts","src/incremental-dom/dom_util.ts","src/incremental-dom/node_data.ts","src/incremental-dom/nodes.ts","src/incremental-dom/virtual_elements.ts","src/incremental-dom/diff.ts","src/incremental-dom/changes.ts","src/incremental-dom/types.ts"],"sourcesContent":["import { HAttrOnData, HAttrOnDataFnc, HElement, HElements, HHandlerCtx } from \"./hsml\";\nimport { hsmls2idomPatch } from \"./hsml-idom\";\n\nconst log = console.log;\nconst error = console.error;\nconst warn = console.warn;\n\nexport type HState<State> = () => State;\n\nexport type HView<State, HActionType extends string> = (\n state: State\n) => HElements<HActionType>;\n\nexport type HView1<State, HActionType extends string> = (\n state: State\n) => HElement<HActionType>;\n\nexport type HAppAction =\n | \"happ-init\"\n | \"happ-mount\"\n | \"happ-umount\"\n | \"happ-action\"\n | \"happ-attribute\";\n\nexport enum HAppActions {\n init = \"happ-init\",\n mount = \"happ-mount\",\n umount = \"happ-umount\",\n action = \"happ-action\",\n attribute = \"happ-attribute\"\n}\n\nexport interface HAction<HActionType extends string> {\n type: HActionType;\n data?: any;\n event?: Event;\n}\n\nexport type HDispatchScope =\n | \"element\"\n | \"window\";\n\nexport enum HDispatchScopes {\n element = \"element\",\n window = \"window\"\n}\n\nexport type HDispatch<HActionType extends string> = (\n type: HAction<HActionType>[\"type\"],\n data?: HAction<HActionType>[\"data\"],\n scope?: HDispatchScope | HDispatchScopes\n) => Promise<void>;\n\nexport type HDispatcher<State, HActionType extends string> = (\n // this: HApp<State, HActionType>,\n action: HAction<HActionType | HAppAction | HAppActions>,\n state: State,\n dispatch: HDispatch<HActionType>\n) => Promise<void>;\n\nconst schedule = window.requestAnimationFrame ||\n // window.webkitRequestAnimationFrame ||\n // (window as any).mozRequestAnimationFrame ||\n // (window as any).oRequestAnimationFrame ||\n // (window as any).msRequestAnimationFrame ||\n function (callback: Function) { window.setTimeout(callback, 1000 / 60); };\n\nconst unschedule = window.cancelAnimationFrame ||\n // window.webkitCancelAnimationFrame ||\n // (window as any).mozCancelAnimationFrame ||\n // (window as any).oCancelAnimationFrame ||\n // (window as any).msCancelAnimationFrame ||\n function (handle: number) { window.clearTimeout(handle); };\n\nconst msgAction = \"action:\";\nconst msgDispatch = \"dispatch:\";\nconst msgRender = \"render:\";\nconst msgUpdate = \"update:\";\n\nconst HAPP = \"happ\";\n\nexport interface HAppI<State, HActionType extends string> {\n state: HState<State>;\n view: HView<State, HActionType>;\n dispatcher: HDispatcher<State, HActionType>;\n element?: Element | string | null;\n debug?: boolean;\n name?: string;\n attributes?: string[];\n}\n\n/**\n * HApp definition\n *\n * @param hAppI HApp definition\n * @returns HApp instance\n */\nexport function happ<State, HActionType extends string>(hAppI: {\n state: HState<State>;\n view: HView<State, HActionType>;\n dispatcher: HDispatcher<State, HActionType>;\n element: Element | string | null;\n debug?: boolean;\n name?: string;\n // attributes?: string[];\n}) {\n return new HApp<State, HActionType>(\n hAppI.state,\n hAppI.view,\n hAppI.dispatcher,\n hAppI.element,\n hAppI.debug,\n hAppI.name\n // hAppI!.attributes\n );\n}\n\n// export type Class<T = object> = new (...args: any[]) => T;\n\n// export function happi<State, HActionType extends string>(\n// hAppI: Class<HAppI<State, HActionType>>,\n// element?: Element | string | null,\n// debug? boolean,\n// name?: string,\n// attributes: string[]\n// ) {\n// const hapi = new hAppI();\n// return new HApp<State, HActionType>(\n// hapi.state,\n// hapi.view,\n// hapi.dispatcher,\n// element,\n// debug\n// );\n// }\n\n// HAppEl\n\n/**\n * HApp custom HTML element definition.\n *\n * @param hAppI HApp definition\n */\nexport function happel<State, HActionType extends string>(hAppI: {\n state: HState<State>;\n view: HView<State, HActionType>;\n dispatcher: HDispatcher<State, HActionType>;\n /** Element suffix name, element name patern is `happ-${name}` */\n name: string;\n /** Element attribute list */\n attributes: string[];\n debug?: boolean;\n}): void {\n customElements.define(\n `${HAPP}-${hAppI.name}`,\n class HAppElement extends HTMLElement {\n static get observedAttributes() {\n return hAppI.attributes;\n }\n\n private _happel: HApp<State, HActionType>;\n\n constructor() {\n super();\n this._happel = new HApp<State, HActionType>(\n hAppI.state,\n hAppI.view,\n hAppI.dispatcher,\n undefined,\n hAppI.debug,\n hAppI.name,\n hAppI.attributes\n );\n (this._happel as any).customElement = this;\n }\n\n connectedCallback() {\n // this._happel.mount(this);\n this.attachShadow({ mode: \"open\" });\n this._happel.mount(this.shadowRoot as any);\n }\n\n disconnectedCallback() {\n this._happel.umount();\n }\n\n adoptedCallback() {\n this._happel.update();\n }\n\n attributeChangedCallback(\n attrName: string,\n oldVal: string | null,\n newVal: string | null\n ) {\n this._happel.dispatch(\n HAppActions.attribute as any,\n { attrName, oldVal, newVal });\n }\n }\n );\n}\n\n/**\n * HSML App\n */\nexport class HApp<State, HActionType extends string> implements HHandlerCtx<HActionType> {\n\n readonly state: State;\n readonly view: HView<State, HActionType>;\n readonly dispatcher: HDispatcher<State, HActionType>;\n\n debug: boolean;\n\n readonly name: string;\n readonly attributes: string[];\n\n readonly element?: HTMLElement;\n readonly refs: { [key: string]: HTMLElement } = {};\n\n readonly customElement?: HTMLElement; // happ custom html element\n\n private _updateSched?: number;\n\n // private _onDispatch?: HDispatcher<State>;\n\n private _windowActionListener?: (event: Event) => void;\n\n constructor(\n state: HState<State>,\n view: HView<State, HActionType>,\n dispatcher?: HDispatcher<State, HActionType>,\n element?: Element | string | null,\n debug?: boolean ,\n name?: string,\n attributes?: string[]\n ) {\n this.debug = debug ?? false;\n this.name = name ?? HAPP;\n this.attributes = attributes ?? [];\n this.state = state();\n this.view = view;\n this.dispatcher = dispatcher ?? (async (a) => log(this.name, msgAction, a.type, a.data));\n this._dispatchAction(HAppActions.init, this).then(() => element && this.mount(element));\n }\n\n /**\n * Dispatch app action.\n */\n dispatch: HDispatch<HActionType> = async (\n type: HActionType,\n data?: any,\n scope?: HDispatchScope\n ): Promise<void> => {\n return this._dispatchAction(type, data, undefined, scope);\n }\n\n // onDispatch = (dispatcher: HDispatcher<State>): this => {\n // this._onDispatch = dispatcher;\n // return this;\n // }\n\n private async _dispatchAction(\n type: HActionType | HAppAction | HAppActions,\n data?: any,\n event?: Event,\n scope?: HDispatchScope\n ): Promise<void> {\n if (this.debug) {\n log(this.name, msgAction, { type, data, event });\n const t0 = performance.now();\n await this._dispatch(type, data, event, scope);\n const t1 = performance.now();\n log(this.name, msgDispatch, `${t1 - t0} ms`, this.state);\n } else {\n await this._dispatch(type, data, event, scope);\n }\n }\n\n private async _dispatch(\n type: HActionType | HAppAction | HAppActions,\n data: any,\n event?: Event,\n scope?: HDispatchScope\n ): Promise<void> {\n if (!scope) {\n try {\n await this.dispatcher(\n { type: type as HActionType, data, event },\n this.state,\n this.dispatch\n );\n } catch (e) {\n error(this.name, msgDispatch, e);\n }\n this.update();\n }\n scope === \"element\" && this._dispatchElement(type, data);\n scope === \"window\" && this._dispatchWindow(type, data);\n }\n\n private async _dispatchElement(\n type: HActionType | HAppAction | HAppActions,\n data?: any\n ): Promise<void> {\n this.customElement && elementDispatchCustomEvent(this.customElement, HAppActions.action, { type, data });\n !this.customElement && this.element && elementDispatchCustomEvent(this.element, HAppActions.action, { type, data });\n // this._onDispatch?.({ type, data, event }, this.state, this.dispatch);\n }\n\n private async _dispatchWindow(\n type: HActionType | HAppAction | HAppActions,\n data?: any): Promise<void> {\n window.dispatchEvent(new CustomEvent(HAppActions.action, { detail: { type, data } }));\n }\n\n /**\n * Window action listen and route actions to dispatcher.\n * Call this method on app mount action.\n * Listening will be stopped on app umount automatically.\n */\n windowActionListen() {\n if (!this._windowActionListener) {\n this._windowActionListener = (event: Event) => {\n const action = (event as CustomEvent).detail as HAction<HActionType>;\n this._dispatchAction(HAppActions.action, action);\n };\n window.addEventListener(HAppActions.action, this._windowActionListener);\n } else {\n warn(\"windowEventListener already added\");\n }\n }\n\n /**\n * Render HSML based on app state.\n */\n render = (): HElements<HActionType> => {\n if (this.debug) {\n const t0 = performance.now();\n let hsmls;\n try {\n hsmls = this.view(this.state);\n } catch (e) {\n error(this.name, msgRender, e);\n }\n const t1 = performance.now();\n log(this.name, msgRender, `${t1 - t0} ms`, hsmls);\n return hsmls ?? [];\n } else {\n let hsmls;\n try {\n hsmls = this.view(this.state);\n } catch (e) {\n error(this.name, msgRender, e);\n }\n return hsmls ?? [];\n }\n }\n\n /**\n * HSML action callback.\n */\n actionCb = (actionType: HActionType, data: HAttrOnData, event: Event): void => {\n data = (data?.constructor === Function)\n ? (data as HAttrOnDataFnc)(event)\n : data;\n if (data === undefined && event) {\n if (event instanceof CustomEvent) {\n data = event.detail;\n } else {\n data = formData(event) as any;\n // TODO middlewares for data processing\n // const middlewares: ((data: any, event: Event) => any)[] = [];\n // data = middlewares.reduce(\n // (data, middleware) => middleware(data, event),\n // data\n // );\n }\n }\n this._dispatchAction(actionType, data, event);\n }\n\n private _updateDom<HActionType extends string>(\n el: Element,\n hsml: HElements<HActionType>,\n ctx: HHandlerCtx<HActionType>\n ): void {\n if (this.debug) {\n const t0 = performance.now();\n hsmls2idomPatch(el, hsml, ctx);\n const t1 = performance.now();\n log(this.name, msgUpdate, `${t1 - t0} ms`, el);\n } else {\n hsmls2idomPatch(el, hsml, ctx);\n }\n }\n\n /**\n * Mount app to DOM element.\n *\n * @param e DOM element\n */\n mount = (e: Element | string | null): this => {\n const el = (typeof e === \"string\") ? document.getElementById(e) : e;\n if (el && (el as any)[HAPP]) {\n const a = (el as any)[HAPP] as HApp<State, HActionType>;\n a.umount();\n }\n if (el && !this.element) {\n (this as any).element = el;\n (el as any)[HAPP] = this;\n const hsmls = (this as any).render();\n this._updateDom<HActionType>(el, hsmls, this);\n this._dispatchAction(HAppActions.mount, this.element);\n }\n return this;\n }\n\n /**\n * Umount app to DOM element.\n */\n umount = (): this => {\n if (this.element) {\n this._dispatchAction(HAppActions.umount, this.element);\n if (this.element.hasAttribute(HAPP)) {\n this.element.removeAttribute(HAPP);\n }\n const aNodes = this.element.querySelectorAll(`[${HAPP}]`);\n for (let i = 0; i < aNodes.length; i++) {\n const a = (aNodes[i] as any).happ as HApp<State, HActionType>;\n a?.umount();\n }\n while (this.element.firstChild /*.hasChildNodes()*/) {\n this.element.removeChild(this.element.firstChild);\n }\n delete (this.element as any).happ;\n (this as any).element = undefined;\n }\n if (this._windowActionListener) {\n window.removeEventListener(HAppActions.action, this._windowActionListener);\n }\n return this;\n }\n\n /**\n * Update DOM element based on app state.\n */\n update = (): this => {\n if (this.element && !this._updateSched) {\n this._updateSched = schedule(() => {\n if (this.element) {\n const hsmls = this.render();\n this._updateDom<HActionType>(this.element, hsmls, this);\n }\n this._updateSched = undefined;\n });\n }\n return this;\n }\n\n toHsml = (): HElement<HActionType> => {\n if (this.element) {\n if (this._updateSched) {\n unschedule(this._updateSched);\n this._updateSched = undefined;\n } else {\n return [\"div\", { skip: true }];\n }\n }\n const hsmls = this.render();\n hsmls.push(\n (e: Element) => {\n if (!this.element) {\n (this as any).element = e;\n (e as any).happ = this;\n this._dispatchAction(HAppActions.mount, this.element);\n }\n });\n return [\"div\", hsmls];\n }\n\n toHtml = (): string => {\n return this.element ? this.element.outerHTML : \"\";\n }\n\n}\n\nfunction elementDispatchCustomEvent<HActionType extends string>(\n el: HTMLElement,\n type: HActionType,\n data: any\n) {\n el?.dispatchEvent(new CustomEvent(type, { detail: data }));\n (el as any)[`on${type}`]?.(new CustomEvent(type, { detail: data }));\n}\n\ntype FormDataInputValue = string | number | boolean | null | Array<string | number | boolean | null>;\n\ntype FormInputData = {\n name?: string;\n value: FormDataInputValue;\n valueString?: string;\n valueNumber?: number | null;\n valueDate?: Date | null;\n validation: string;\n valid: boolean;\n};\n\ntype FormData = {\n data: {\n [name: string]: FormDataInputValue;\n };\n validation: { [name: string]: string };\n valid: boolean;\n};\n\nexport type HFormInputData<Value = FormDataInputValue> = {\n name?: string;\n value: Value;\n valueString?: string | null;\n valueNumber?: number | null;\n valueDate?: Date | null;\n validation: string;\n valid: boolean;\n};\n\nexport type HFormData<Data> = {\n data: Data;\n validation: { [name in keyof Data]?: string };\n valid?: boolean;\n};\n\nfunction formData(e: Event): FormData | FormInputData | undefined {\n const el = e.target as HTMLElement;\n switch (el.nodeName) {\n case \"FORM\":\n (e as Event).preventDefault();\n const form: FormData = {\n data: {},\n validation: {},\n valid: true\n };\n const els = (el as HTMLFormElement).elements;\n for (let i = 0; i < els.length; i++) {\n const inputData = formInputData(els[i]);\n if (inputData && inputData.name) {\n const formData = form.data;\n const name = inputData.name;\n const value = inputData.value;\n if (formData[name] === undefined) {\n formData[name] = value;\n } else if (typeof formData[name] === \"string\" || formData[name] instanceof String) {\n if (value instanceof Array) {\n formData[name] = [formData[name] as string, ...value];\n } else {\n formData[name] = [formData[name] as string, value as string];\n }\n } else if (formData[name] instanceof Array) {\n if (value instanceof Array) {\n formData[name] = (formData[name] as Array<any>).concat(value);\n } else {\n (formData[name] as Array<any>).push(value);\n }\n } else {\n if (value instanceof Array) {\n formData[name] = [formData[name] as string, ...value];\n } else {\n formData[name] = [formData[name] as string, value];\n }\n }\n if (formData[name] instanceof Array) {\n formData[name] = (formData[name] as Array<any>)\n .filter(d => d !== null);\n if ((els[i] as HTMLInputElement).type === \"radio\") {\n formData[name] = (formData[name] as Array<any>).length\n ? (formData[name] as Array<any>)[0]\n : null;\n }\n }\n if (inputData.validation) {\n form.validation[name] = inputData.validation;\n }\n if (!inputData.valid) {\n form.valid = false;\n }\n }\n }\n return form;\n default:\n return formInputData(el);\n }\n}\n\nfunction formInputData(el: Element): FormInputData | undefined {\n // Client-side form validation\n // https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation\n const vel = el as HTMLInputElement;\n if (vel.willValidate) {\n let valid = true;\n for (const key in vel.validity) {\n if (key !== \"customError\" && key !== \"valid\") {\n if ((vel.validity as any)[key]) {\n const msgs = (vel as any)[\"validation\"];\n if (msgs) {\n const msg = (msgs as any)[key];\n if (msg) {\n vel.setCustomValidity(msg);\n // vel.reportValidity();\n valid = false;\n break;\n } else {\n vel.setCustomValidity(\"\");\n // vel.reportValidity();\n break;\n }\n }\n }\n }\n }\n if (valid) {\n vel.setCustomValidity(\"\");\n // vel.reportValidity();\n }\n }\n\n let data: FormInputData | undefined;\n switch (el.nodeName) {\n case \"INPUT\":\n const iel = el as HTMLInputElement;\n switch (iel.type) {\n case \"text\":\n case \"hidden\":\n case \"password\":\n case \"email\":\n case \"search\":\n case \"url\":\n case \"tel\":\n case \"color\":\n case \"submit\":\n case \"button\":\n data = {\n name: iel.name,\n value: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"number\":\n case \"range\":\n data = {\n name: iel.name,\n value: iel.valueAsNumber,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"datetime-local\":\n data = {\n name: iel.name,\n value: iel.value,\n valueNumber: isNaN(iel.valueAsNumber)\n ? null\n : iel.valueAsNumber,\n valueDate: isNaN(iel.valueAsNumber)\n ? null\n : new Date(iel.valueAsNumber),\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"date\":\n case \"month\":\n case \"time\":\n case \"week\":\n data = {\n name: iel.name,\n value: iel.value,\n valueNumber: isNaN(iel.valueAsNumber)\n ? null\n : iel.valueAsNumber,\n valueDate: iel.valueAsDate,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"radio\":\n data = {\n name: iel.name,\n value: iel.checked ? iel.value : null,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n case \"checkbox\":\n if (iel.value === \"on\") { // value not set in element\n data = {\n name: iel.name,\n value: iel.checked,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n } else {\n data = {\n name: iel.name,\n value: iel.checked ? String(iel.value) : null,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n }\n break;\n case \"file\":\n const files = (iel as any).files as FileList;\n const value: any = files.length === 1 ? files[0] : files;\n data = {\n name: iel.name,\n value,\n valueString: iel.value,\n validation: iel.validationMessage,\n valid: iel.validity.valid\n };\n break;\n }\n break;\n case \"SELECT\":\n const sel = el as HTMLSelectElement;\n if (sel.multiple) {\n const values = Array.from(sel.selectedOptions).map(o => o.value);\n data = {\n name: sel.name,\n value: values,\n valueString: sel.value,\n validation: sel.validationMessage,\n valid: sel.validity.valid\n };\n } else {\n data = {\n name: sel.name,\n value: sel.value,\n validation: sel.validationMessage,\n valid: sel.validity.valid\n };\n }\n break;\n case \"TEXTAREA\":\n const tel = el as HTMLTextAreaElement;\n data = {\n name: tel.name,\n value: tel.value,\n validation: tel.validationMessage,\n valid: tel.validity.valid\n };\n break;\n case \"BUTTON\":\n const bel = el as HTMLButtonElement;\n data = {\n name: bel.name,\n value: bel.value,\n validation: bel.validationMessage,\n valid: bel.validity.valid\n };\n break;\n }\n return data;\n}\n","import {\n HAttrClasses,\n HAttrData, HAttrOn, HAttrOnAct,\n HAttrOnCb, HAttrOnData, HAttrStyles, HElement,\n HElements, HFnc, HHandler,\n HHandlerCtx, HObj, hsml, HTagAttrs, HTagHeadName\n} from \"./hsml\";\nimport { currentElement, elementClose, elementOpen, patch, skip, text } from \"./incremental-dom\";\n\n// function setBoolAttrProp(el: any, attr: string, value: any) {\n// // console.log(\"idom.attributes\", attr, value, typeof value, el);\n// if (typeof value === \"string\") {\n// let b;\n// switch (value) {\n// case \"true\":\n// case \"1\":\n// case \"on\":\n// case \"yes\":\n// b = true;\n// break;\n// default:\n// b = false;\n// }\n// if (b) {\n// el.setAttribute(attr, value);\n// } else {\n// el.removeAttribute(attr);\n// }\n// el[attr] = b;\n// } else if (typeof value === \"boolean\") {\n// if (value) {\n// el.setAttribute(attr, \"\");\n// } else {\n// el.removeAttribute(attr);\n// }\n// el[attr] = value;\n// } else {\n// if (value) {\n// el.setAttribute(attr, value ? value : \"\");\n// } else {\n// el.removeAttribute(attr);\n// }\n// }\n// }\n\n// const boolAttrProps = [\n// \"readonly\",\n// \"disabled\",\n// \"checked\",\n// \"value\"\n// ];\n\n// boolAttrProps.forEach(a => idom.attributes[a] = setBoolAttrProp);\n\nfunction ctxActionCb<HAttrOnActType extends string>(ctx: HHandlerCtx<HAttrOnActType> | undefined, attrOn: HAttrOn<HAttrOnActType>, e: Event) {\n ctx &&\n ctx.actionCb &&\n typeof ctx.actionCb === \"function\" &&\n ctx.actionCb(attrOn[1] as HAttrOnActType, attrOn[2] as HAttrOnData, e);\n}\n\nclass HsmlIDomHandler<HAttrOnActType extends string> implements HHandler<HAttrOnActType, HHandlerCtx<HAttrOnActType>> {\n\n open(tag: HTagHeadName, attrs: HTagAttrs<HAttrOnActType>, children: HElements<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): boolean {\n const props: any[] = [];\n let id = attrs._id;\n let classes: string[] = attrs._classes ? attrs._classes : [];\n let ref = attrs._ref;\n let hObj: any = attrs._hObj;\n for (const a in attrs) {\n if (attrs.hasOwnProperty(a)) {\n switch (a) {\n case \"_id\":\n case \"_classes\":\n case \"_ref\":\n case \"_hObj\":\n case \"key\":\n case \"skip\":\n break;\n case \"id\":\n id = attrs[a] as string;\n break;\n case \"ref\":\n ref = attrs[a] as string;\n break;\n case \"classes\":\n const attrClasses = attrs[a] as HAttrClasses;\n classes = classes.concat(attrClasses\n ? attrClasses\n .map(c =>\n c.constructor === String\n ? c as string\n : (c[1] ? c[0] as string : undefined))\n .filter((c): c is string => c !== undefined)\n : [] as string[]);\n break;\n case \"class\":\n classes = classes.concat((attrs[a] as string).split(\" \"));\n break;\n case \"data\":\n const attrData = attrs[a] as HAttrData;\n for (const d in attrData) {\n if (attrData.hasOwnProperty(d)) {\n if (attrData[d].constructor === String) {\n props.push(\"data-\" + d, attrData[d]);\n } else {\n props.push(\"data-\" + d, JSON.stringify(attrData[d]));\n }\n }\n }\n break;\n case \"styles\":\n props.push(\"style\", attrs[a] as HAttrStyles);\n break;\n case \"on\":\n const attrOn = attrs[a] as HAttrOn<HAttrOnActType>;\n if (typeof attrOn[0] === \"string\") {\n if (typeof attrOn[1] === \"function\") {\n props.push(\"on\" + attrOn[0], attrOn[1]);\n } else {\n props.push(\"on\" + attrOn[0],\n (e: Event) => ctxActionCb(ctx, attrOn, e));\n }\n } else {\n (attrOn as Array<HAttrOnCb | HAttrOnAct<HAttrOnActType>>)\n .forEach(attr => {\n if (typeof attr[1] === \"function\") {\n props.push(\"on\" + attr[0], attr[1]);\n } else {\n props.push(\"on\" + attr[0],\n (e: Event) => ctxActionCb(ctx, attr, e));\n }\n });\n }\n break;\n default:\n // http://google.github.io/incremental-dom/#attributes-and-properties\n switch (typeof attrs[a]) {\n case \"function\":\n props.push(\"on\" + a, attrs[a]);\n break;\n case \"object\":\n // console.log(\"---\", a, typeof attrs[a], attrs[a]);\n // console.log(\"---String \", attrs[a] instanceof String);\n // console.log(\"---Boolean\", attrs[a] instanceof Boolean);\n // console.log(\"---Number \", attrs[a] instanceof Number);\n props.push(a, attrs[a]);\n break;\n // case \"boolean\":\n // if (boolAttrProps.includes(a)) {\n // props.push(a, attrs[a]);\n // } else {\n // attrs[a] && props.push(a, a);\n // }\n // break;\n case \"boolean\":\n attrs[a] && props.push(a, a);\n break;\n default:\n props.push(a, attrs[a]);\n break;\n }\n }\n }\n }\n if (classes.length) {\n props.unshift(\"class\", classes.join(\" \"));\n }\n if (id) {\n props.unshift(\"id\", id);\n }\n if (ref) {\n props.unshift(\"ref\", ref);\n }\n elementOpen(tag, attrs.key, undefined, ...props);\n if (attrs.skip) {\n skip();\n }\n if (ctx && ref) {\n ctx.refs[ref] = currentElement();\n }\n if (hObj && hObj.mount && hObj.mount.constructor === Function) {\n hObj.mount(currentElement());\n skip();\n }\n return attrs.skip ? true : false;\n }\n\n close(tag: HTagHeadName, children: HElements<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n elementClose(tag);\n }\n\n text(txt: string, ctx?: HHandlerCtx<HAttrOnActType>): void {\n text(txt);\n }\n\n fnc(fnc: HFnc, ctx?: HHandlerCtx<HAttrOnActType>): void {\n const skipFnc = fnc(currentElement());\n skipFnc && skip();\n }\n\n obj(obj: HObj<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n if (\"toHsml\" in obj) {\n obj.toHsml && hsml(obj.toHsml(), this, obj as HHandlerCtx<HAttrOnActType>);\n } else {\n this.text(\"\" + obj, ctx);\n }\n }\n\n}\n\nfunction hsml2idom<HAttrOnActType extends string>(hml: HElement<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n hsml(hml, new HsmlIDomHandler(), ctx);\n}\n\nfunction hsmls2idom<HAttrOnActType extends string>(hmls: HElements<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n for (const hml of hmls) {\n if (hml === undefined || hml === null) {\n continue;\n }\n if (hml.constructor === String) {\n text(hml as string);\n } else if (\"toHsml\" in (hml as any)) {\n const obj = hml as HHandlerCtx<HAttrOnActType>;\n obj.toHsml && hsml2idom(obj.toHsml(), obj);\n } else {\n hsml2idom(hml as HElement<HAttrOnActType>, ctx);\n }\n }\n}\n\nexport function hsml2idomPatch<HAttrOnActType extends string>(node: Element, hsmlEl: HElement<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n patch(node,\n (data?: HElement<HAttrOnActType>) => (data && hsml2idom(data, ctx)), hsmlEl);\n}\n\nexport function hsmls2idomPatch<HAttrOnActType extends string>(node: Element, hsmlFr: HElements<HAttrOnActType>, ctx?: HHandlerCtx<HAttrOnActType>): void {\n patch(node,\n (data?: HElements<HAttrOnActType>) => (data && hsmls2idom(data, ctx)), hsmlFr);\n}\n","// HSML tag head format \"tag#id.class1.class2~handler\"\n\nexport type HTagHeadName = keyof HTMLElementTagNameMap | `${string}${\"-\"}${string}`;\nexport type HTagHeadAttr = \".\" | \"#\" | \"~\";\n\nexport type HTagHead<T extends string = string> = `${HTagHeadName}` | `${HTagHeadName}${HTagHeadAttr}${T}`;\n\nexport type HAttrClasses = Array<string | [string, boolean]>;\n\n// export type HAttrStyles = { [key: string]: string };\nexport type HAttrStyles = Partial<CSSStyleDeclaration>;\n\nexport type HAttrData = {\n [key: string]:\n | string\n | String\n | number\n | Number\n | boolean\n | Boolean\n | Date\n | Array<any>\n | Object;\n};\n\nexport type HAttrOnDataFnc = (e: Event) => any;\n\nexport type HAttrOnData =\n | string\n | String\n | number\n | Number\n | boolean\n | Boolean\n | Date\n | Array<any>\n | Object\n | HAttrOnDataFnc\n | null;\n\nexport type HAttrOnCb = [keyof HTMLElementEventMap, EventListener];\n\nexport type HAttrOnAct<HAttrOnActType extends string> = [\n keyof HTMLElementEventMap | string,\n HAttrOnActType,\n HAttrOnData?\n];\n\nexport type HAttrOn<HAttrOnActType extends string> = HAttrOnCb | HAttrOnAct<HAttrOnActType> | Array<HAttrOnCb | HAttrOnAct<HAttrOnActType>>;\n\nexport interface HTagAttrs<HAttrOnActType extends string> {\n readonly _id?: string;\n readonly _classes?: string[];\n readonly _ref?: string;\n readonly _hObj?: HObj<HAttrOnActType>;\n readonly key?: string;\n readonly skip?: boolean;\n readonly id?: string;\n readonly ref?: string;\n readonly classes?: HAttrClasses;\n readonly class?: string;\n readonly data?: HAttrData;\n readonly styles?: HAttrStyles;\n readonly style?: string;\n /** Event mapping to action, on: [event, action_type, action_data] */\n readonly on?: HAttrOn<HAttrOnActType>;\n /** Custom validation error message that is displayed when a form is submitted. */\n readonly validation?: {\n badInput?: string;\n patternMismatch?: string;\n rangeOverflow?: string;\n rangeUnderflow?: string;\n stepMismatch?: string;\n tooLong?: string;\n tooShort?: string;\n typeMismatch?: string;\n valueMissing?: string;\n };\n // HTMLElement\n readonly title?: string;\n readonly lang?: string;\n readonly accessKey?: string;\n readonly href?: string;\n readonly target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n // HTMLFormElement\n readonly novalidate?: boolean | Boolean;\n // HTMLInputElement\n readonly type?:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n | \"text\"\n | \"hidden\"\n | \"password\"\n | \"email\"\n | \"number\"\n | \"search\"\n | \"url\"\n | \"tel\"\n | \"color\"\n | \"date\"\n | \"datetime-local\"\n | \"month\"\n | \"range\"\n | \"time\"\n | \"week\"\n | \"submit\"\n | \"button\"\n | \"radio\"\n | \"checkbox\"\n | \"file\"\n | \"image\"\n | \"reset\"\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types\n | \"text/plain\"\n | \"text/html\"\n | \"text/css\"\n | \"text/javascript\" // (.js)\"\n | \"text/csv\"\n | \"text/xml\"\n | \"image/png\"\n | \"image/jpeg\" // (.jpg, .jpeg, .jfif, .pjpeg, .pjp)\"\n | \"image/svg+xml\" // (.svg)\"\n | \"audio/mp3\"\n | \"audio/ogg\"\n | \"video/mp4\"\n | \"video/ogg\"\n | \"application/json\"\n // | \"application/ld+json\" // (JSON-LD)\n // | \"application/msword\" // (.doc)\n | \"application/pdf\"\n // | \"application/sql\"\n // | \"application/vnd.api+json\"\n // | \"application/vnd.ms-excel\" // (.xls)\n // | \"application/vnd.ms-powerpoint\" // (.ppt)\"\n // | \"application/vnd.oasis.opendocument.text\" // (.odt)\"\n // | \"application/vnd.oasis.opendocument.spreadsheet\" // (.ods)\"\n // | \"application/vnd.oasis.opendocument.presentation\" // (.odp)\"\n // | \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" // (.pptx)\"\n // | \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" // (.xlsx)\"\n // | \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" // (.docx)\"\n | \"application/x-www-form-urlencoded\"\n | \"application/xml\"\n // | \"application/zip\"\n // | \"application/gzip\"\n | \"multipart/form-data\"\n // | `text/${string}`\n // | `image/${string}`\n // | `audio/${string}`\n // | `video/${string}`\n // | `application/${string}`\n // | `message/${string}`\n // | `multipart/${string}`\n // | `${string}/${string}`\n // | string\n ;\n readonly name?: string;\n readonly value?: string | number | Number | String;\n readonly autocomplete?: string;\n readonly checked?: boolean | Boolean;\n readonly disabled?: boolean | Boolean;\n readonly list?: string;\n readonly max?: number | string;\n readonly maxlength?: number | string;\n readonly min?: number | string;\n readonly minlength?: number | string;\n readonly multiple?: boolean | Boolean;\n readonly pattern?: string;\n readonly placeholder?: string;\n readonly readonly?: boolean | Boolean;\n readonly required?: boolean | Boolean;\n readonly size?: number | string;\n readonly step?: number | string;\n // HTMLImageElement\n readonly src?: string;\n readonly alt?: string;\n readonly height?: number | string;\n readonly width?: number | string;\n // Generic attributes\n readonly [key: string]:\n | string\n | String\n | string[]\n | String[]\n | number\n | Number\n | boolean\n | Boolean\n | Date\n | HAttrClasses\n | HAttrStyles\n // | HsmlAttrData\n | HAttrOn<HAttrOnActType>\n | EventListener\n | HObj<HAttrOnActType>\n | undefined;\n}\n\nexport type HFnc = (e: Element) => boolean | void;\n\nexport interface HObj<HAttrOnActType extends string> {\n toHsml?(): HElement<HAttrOnActType>;\n}\n\nexport interface HElements<HAttrOnActType extends string> extends Array<HElement<HAttrOnActType>> {}\n\nexport type HTagChildren<HAttrOnActType extends string> =\n | HElements<HAttrOnActType>\n | HFnc\n | HObj<HAttrOnActType>\n | string\n | String\n | boolean\n | Boolean\n | number\n | Number\n | Date\n | undefined\n | null;\n\nexport type HTagNoAttr<HAttrOnActType extends string> = [HTagHead, HTagChildren<HAttrOnActType>?];\nexport type HTagWithAttr<HAttrOnActType extends string> = [HTagHead, HTagAttrs<HAttrOnActType>, HTagChildren<HAttrOnActType>?];\n\nexport type HTag<HAttrOnActType extends string> = HTagNoAttr<HAttrOnActType> | HTagWithAttr<HAttrOnActType>;\n\nexport type HElement<HAttrOnActType extends string> =\n | HFnc\n | HObj<HAttrOnActType>\n | HTag<HAttrOnActType>\n | string\n | String\n | boolean\n | Boolean\n | number\n | Number\n | Date\n | undefined\n | null;\n\nexport interface HHandlerCtx<HAttrOnActType extends string> extends HObj<HAttrOnActType> {\n refs: { [name: string]: Element };\n actionCb(action: HAttrOnActType, data: HAttrOnData, e: Event): void;\n}\n\nexport interface HHandler<HAttrOnActType extends string, C extends HHandlerCtx<HAttrOnActType>> {\n open(tag: HTagHeadName, attrs: HTagAttrs<HAttrOnActType>, children: HElements<HAttrOnActType>, ctx?: C): boolean;\n close(tag: HTagHeadName, children: HElements<HAttrOnActType>, ctx?: C): void;\n text(text: string, ctx?: C): void;\n fnc(fnc: HFnc, ctx?: C): void;\n obj(obj: HObj<HAttrOnActType>, ctx?: C): void;\n}\n\nexport const NBSP = \"\\u00a0 \";\n\nexport function hsml<HAttrOnActType extends string, C extends HHandlerCtx<HAttrOnActType>>(\n hml: HElement<HAttrOnActType>,\n handler: HHandler<HAttrOnActType, C>,\n ctx?: C): void {\n // console.log(\"hsml\", hsml);\n if (hml === undefined || hml === null) {\n return;\n }\n switch (hml.constructor) {\n case Array:\n // const tag = hml as HTag;\n // if (\n // (\n // tag.length === 1 &&\n // tag[0].constructor === String\n // ) ||\n // (\n // tag.length === 2 &&\n // (\n // tag[0].constructor === String &&\n // (tag[1]!.constructor === Array || tag[1]!.constructor === Function)\n // ) ||\n // (\n // tag[0].constructor === String &&\n // tag[1]!.constructor === Object\n // )\n // ) ||\n // (\n // tag.length === 3 &&\n // tag[0].constructor === String &&\n // tag[1].constructor === Object &&\n // tag[2]!.constructor === Array\n // )\n // ) {\n // hsmlTag(hml as HTag, handler, ctx);\n // } else {\n // console.error(\"hsml parse error:\", hml);\n // // console.error(\"hsml parse error:\", JSON.stringify(hml, null, 4));\n // // throw Error(`hsml parse error: ${JSON.stringify(hml)}`);\n // }\n hsmlTag(hml as HTag<HAttrOnActType>, handler, ctx);\n break;\n case Function:\n handler.fnc(hml as HFnc, ctx);\n break;\n case String:\n handler.text(hml as string, ctx);\n break;\n case Boolean:\n handler.text(\"\" + hml, ctx);\n break;\n case Number:\n const n = hml as number;\n const ns = n.toLocaleString ? n.toLocaleString() : n.toString();\n handler.text(ns, ctx);\n break;\n case Date:\n const d = hml as Date;\n const ds = d.toLocaleString ? d.toLocaleString() : d.toString();\n handler.text(ds, ctx);\n break;\n default: // HObj\n handler.obj(hml as HObj<HAttrOnActType>, ctx);\n }\n\n function hsmlTag(hmlTag: HTag<HAttrOnActType>, handler: HHandler<HAttrOnActType, C>, ctx?: C): void {\n // console.log(\"hsml tag\", hmlTag);\n\n if (typeof hmlTag[0] !== \"string\") {\n console.error(\"HSML tag head not string:\", hmlTag);\n return;\n }\n\n const head = hmlTag[0] as HTagHead;\n const attrsObj = hmlTag[1] as any;\n const hasAttrs = attrsObj && attrsObj.constructor === Object;\n const childIdx = hasAttrs ? 2 : 1;\n\n let children: HElements<HAttrOnActType> = [];\n let hFnc: HFnc | undefined;\n let hObj: HObj<HAttrOnActType> | undefined;\n\n const htc = hmlTag[childIdx];\n switch (htc != null && htc.constructor) { // switch ((typeof htc !== \"undefined\" || htc !== null) && htc.constructor) {\n case Array:\n children = htc as HElements<HAttrOnActType>;\n break;\n case Function:\n hFnc = htc as HFnc;\n break;\n case String:\n case Boolean:\n case Number:\n case Date:\n children = [htc as string | boolean | number | Date];\n break;\n default: // HObj\n hObj = htc as HObj<HAttrOnActType>;\n break;\n }\n\n const refSplit = head.split(\"~\");\n const ref = refSplit[1];\n const dotSplit = refSplit[0].split(\".\");\n const hashSplit = dotSplit[0].split(\"#\");\n const tag = (hashSplit[0] ?? \"div\") as HTagHeadName;\n const id = hashSplit[1];\n const classes = dotSplit.slice(1);\n\n let attrs: HTagAttrs<HAttrOnActType>;\n if (hasAttrs) {\n attrs = attrsObj as HTagAttrs<HAttrOnActType>;\n } else {\n attrs = {} as HTagAttrs<HAttrOnActType>;\n }\n\n if (id) {\n (attrs as any)._id = id;\n }\n if (classes.length) {\n (attrs as any)._classes = classes;\n }\n if (ref) {\n (attrs as any)._ref = ref;\n }\n if (hObj) {\n (attrs as any)._hObj = hObj;\n }\n\n const skip = handler.open(tag, attrs, children, ctx);\n\n if (hFnc) {\n handler.fnc(hFnc, ctx);\n }\n\n if (!skip) {\n children.forEach(jml => hsml(jml, handler, ctx));\n }\n\n handler.close(tag, children, ctx);\n }\n}\n\nexport function hjoin<HAttrOnActType extends string>(hsmls: HElements<HAttrOnActType>, sep: string | HElement<HAttrOnActType>): HElements<HAttrOnActType> {\n const r = hsmls.reduce<HElements<HAttrOnActType>>(\n (p, c) => (p.push(c, sep), p),\n [] as HElements<HAttrOnActType>\n );\n r.splice(-1);\n return r;\n}\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nexport {applyAttr, applyProp, attributes, createAttributeMap} from './attributes';\nexport {alignWithDOM, alwaysDiffAttributes, close, createPatchInner, createPatchOuter, currentElement, currentContext, currentPointer, open, patchInner as patch, patchInner, patchOuter, skip, skipNode, tryGetCurrentElement} from './core';\nexport {setKeyAttributeName} from './global';\nexport {clearCache, getKey, importNode, isDataInitialized} from './node_data';\nexport {notifications} from './notifications';\nexport {symbols} from './symbols';\nexport {applyAttrs, applyStatics, attr, elementClose, elementOpen, elementOpenEnd, elementOpenStart, elementVoid, key, text} from './virtual_elements';\nexport * from './types';\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { AttrMutatorConfig } from \"./types\";\nimport { assert } from \"./assertions\";\nimport { createMap, has } from \"./util\";\nimport { symbols } from \"./symbols\";\n\n/**\n * @param name The name of the attribute. For example \"tabindex\" or\n * \"xlink:href\".\n * @returns The namespace to use for the attribute, or null if there is\n * no namespace.\n */\nfunction getNamespace(name: string): string | null {\n if (name.lastIndexOf(\"xml:\", 0) === 0) {\n return \"http://www.w3.org/XML/1998/namespace\";\n }\n\n if (name.lastIndexOf(\"xlink:\", 0) === 0) {\n return \"http://www.w3.org/1999/xlink\";\n }\n\n return null;\n}\n\n/**\n * Applies an attribute or property to a given Element. If the value is null\n * or undefined, it is removed from the Element. Otherwise, the value is set\n * as an attribute.\n * @param el The element to apply the attribute to.\n * @param name The attribute's name.\n * @param value The attribute's value.\n */\nfunction applyAttr(el: Element, name: string, value: unknown) {\n if (value == null) {\n el.removeAttribute(name);\n } else {\n const attrNS = getNamespace(name);\n if (attrNS) {\n el.setAttributeNS(attrNS, name, value as string);\n } else {\n el.setAttribute(name, value as string);\n }\n }\n}\n\n/**\n * Applies a property to a given Element.\n * @param el The element to apply the property to.\n * @param name The property's name.\n * @param value The property's value.\n */\nfunction applyProp(el: Element, name: string, value: unknown) {\n // (el as any)[name] = value;\n // rybar replaced\n if (value instanceof Boolean) {\n // tslint:disable-next-line: triple-equals\n (el as any)[name] = (value == true);\n } else {\n (el as any)[name] = value;\n }\n}\n\n/**\n * Applies a value to a style declaration. Supports CSS custom properties by\n * setting properties containing a dash using CSSStyleDeclaration.setProperty.\n * @param style A style declaration.\n * @param prop The property to apply. This can be either camelcase or dash\n * separated. For example: \"backgroundColor\" and \"background-color\" are both\n * supported.\n * @param value The value of the property.\n */\nfunction setStyleValue(\n style: CSSStyleDeclaration,\n prop: string,\n value: string\n) {\n if (prop.indexOf(\"-\") >= 0) {\n style.setProperty(prop, value);\n } else {\n (style as any)[prop] = value;\n }\n}\n\n/**\n * Applies a style to an Element. No vendor prefix expansion is done for\n * property names/values.\n * @param el The Element to apply the style for.\n * @param name The attribute's name.\n * @param style The style to set. Either a string of css or an object\n * containing property-value pairs.\n */\nfunction applyStyle(\n el: Element,\n name: string,\n style: string | { [k: string]: string }\n) {\n // MathML elements inherit from Element, which does not have style. We cannot\n // do `instanceof HTMLElement` / `instanceof SVGElement`, since el can belong\n // to a different document, so just check that it has a style.\n assert(\"style\" in el);\n const elStyle = (<HTMLElement | SVGElement>el).style;\n\n if (typeof style === \"string\") {\n elStyle.cssText = style;\n } else {\n elStyle.cssText = \"\";\n\n for (const prop in style) {\n if (has(style, prop)) {\n setStyleValue(elStyle, prop, style[prop]);\n }\n }\n }\n}\n\n/**\n * Updates a single attribute on an Element.\n * @param el The Element to apply the attribute to.\n * @param name The attribute's name.\n * @param value The attribute's value. If the value is an object or\n * function it is set on the Element, otherwise, it is set as an HTML\n * attribute.\n */\nfunction applyAttributeTyped(el: Element, name: string, value: unknown) {\n const type = typeof value;\n if (type === \"object\" || type === \"function\") {\n // rybar, was removed\n // if (value instanceof Boolean) {\n // // tslint:disable-next-line: triple-equals\n // applyAttr(el, name, value == true ? \"\" : null);\n // } else {\n // applyAttr(el, name, value);\n // }\n applyProp(el, name, value);\n } else {\n applyAttr(el, name, value);\n }\n}\n\nfunction createAttributeMap() {\n const attributes: AttrMutatorConfig = createMap() as AttrMutatorConfig;\n // Special generic mutator that's called for any attribute that does not\n // have a specific mutator.\n attributes[symbols.default] = applyAttributeTyped;\n\n attributes[\"style\"] = applyStyle;\n return attributes;\n}\n\n/**\n * A publicly mutable object to provide custom mutators for attributes.\n * NB: The result of createMap() has to be recast since closure compiler\n * will just assume attributes is \"any\" otherwise and throws away\n * the type annotation set by tsickle.\n */\nconst attributes = createAttributeMap();\n\n/**\n * Calls the appropriate attribute mutator for this attribute.\n * @param el The Element to apply the attribute to.\n * @param name The attribute's name.\n * @param value The attribute's value. If the value is an object or\n * function it is set on the Element, otherwise, it is set as an HTML\n * attribute.\n * @param attrs The attribute map of mutators.\n */\nfunction updateAttribute(\n el: Element,\n name: string,\n value: unknown,\n attrs: AttrMutatorConfig\n) {\n const mutator = attrs[name] || attrs[symbols.default];\n mutator(el, name, value);\n}\n\nexport {\n createAttributeMap,\n updateAttribute,\n applyProp,\n applyAttr,\n attributes\n};\n","// Copyright 2015 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { DEBUG } from \"./global\";\nimport { NameOrCtorDef } from \"./types\";\n\n/**\n * Keeps track whether or not we are in an attributes declaration (after\n * elementOpenStart, but before elementOpenEnd).\n */\nlet inAttributes = false;\n\n/**\n * Keeps track whether or not we are in an element that should not have its\n * children cleared.\n */\nlet inSkip = false;\n\n/**\n * Keeps track of whether or not we are in a patch.\n */\nlet inPatch = false;\n\n/**\n * Asserts that a value exists and is not null or undefined. goog.asserts\n * is not used in order to avoid dependencies on external code.\n * @param val The value to assert is truthy.\n * @returns The value.\n */\nfunction assert<T extends {}>(val: T | null | undefined): T {\n if (DEBUG && !val) {\n throw new Error(\"Expected value to be defined\");\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return val!;\n}\n\n/**\n * Makes sure that there is a current patch context.\n * @param functionName The name of the caller, for the error message.\n */\nfunction assertInPatch(functionName: string) {\n if (!inPatch) {\n throw new Error(\"Cannot call \" + functionName + \"() unless in patch.\");\n }\n}\n\n/**\n * Makes sure that a patch closes every node that it opened.\n * @param openElement\n * @param root\n */\nfunction assertNoUnclosedTags(\n openElement: Node | null,\n root: Node | DocumentFragment\n) {\n if (openElement === root) {\n return;\n }\n\n let currentElement = openElement;\n const openTags: Array<string> = [];\n while (currentElement && currentElement !== root) {\n openTags.push(currentElement.nodeName.toLowerCase());\n currentElement = currentElement.parentNode;\n }\n\n throw new Error(\"One or more tags were not closed:\\n\" + openTags.join(\"\\n\"));\n}\n\n/**\n * Makes sure that node being outer patched has a parent node.\n * @param parent\n */\nfunction assertPatchOuterHasParentNode(parent: Node | null) {\n if (!parent) {\n console.warn(\n \"patchOuter requires the node have a parent if there is a key.\"\n );\n }\n}\n\n/**\n * Makes sure that the caller is not where attributes are expected.\n * @param functionName The name of the caller, for the error message.\n */\nfunction assertNotInAttributes(functionName: string) {\n if (inAttributes) {\n throw new Error(\n functionName +\n \"() can not be called between \" +\n \"elementOpenStart() and elementOpenEnd().\"\n );\n }\n}\n\n/**\n * Makes sure that the caller is not inside an element that has declared skip.\n * @param functionName The name of the caller, for the error message.\n */\nfunction assertNotInSkip(functionName: string) {\n if (inSkip) {\n throw new Error(\n functionName +\n \"() may not be called inside an element \" +\n \"that has called skip().\"\n );\n }\n}\n\n/**\n * Makes sure that the caller is where attributes are expected.\n * @param functionName The name of the caller, for the error message.\n */\nfunction assertInAttributes(functionName: string) {\n if (!inAttributes) {\n throw new Error(\n functionName +\n \"() can only be called after calling \" +\n \"elementOpenStart().\"\n );\n }\n}\n\n/**\n * Makes sure the patch closes virtual attributes call\n */\nfunction assertVirtualAttributesClosed() {\n if (inAttributes) {\n throw new Error(\n \"elementOpenEnd() must be called after calling \" + \"elementOpenStart().\"\n );\n }\n}\n\n/**\n * Makes sure that tags are correctly nested.\n * @param currentNameOrCtor\n * @param nameOrCtor\n */\nfunction assertCloseMatchesOpenTag(\n currentNameOrCtor: NameOrCtorDef,\n nameOrCtor: NameOrCtorDef\n) {\n if (currentNameOrCtor !== nameOrCtor) {\n throw new Error(\n 'Received a call to close \"' +\n nameOrCtor +\n '\" but \"' +\n currentNameOrCtor +\n '\" was open.'\n );\n }\n}\n\n/**\n * Makes sure that no children elements have been declared yet in the current\n * element.\n * @param functionName The name of the caller, for the error message.\n * @param previousNode\n */\nfunction assertNoChildrenDeclaredYet(\n functionName: string,\n previousNode: Node | null\n) {\n if (previousNode !== null) {\n throw new Error(\n functionName +\n \"() must come before any child \" +\n \"declarations inside the current element.\"\n );\n }\n}\n\n/**\n * Checks that a call to patchOuter actually patched the element.\n * @param maybeStartNode The value for the currentNode when the patch\n * started.\n * @param maybeCurrentNode The currentNode when the patch finished.\n * @param expectedNextNode The Node that is expected to follow the\n * currentNode after the patch;\n * @param expectedPrevNode The Node that is expected to preceed the\n * currentNode after the patch.\n */\nfunction assertPatchElementNoExtras(\n maybeStartNode: Node | null,\n maybeCurrentNode: Node | null,\n expectedNextNode: Node | null,\n expectedPrevNode: Node | null\n) {\n const startNode = assert(maybeStartNode);\n const currentNode = assert(maybeCurrentNode);\n const wasUpdated =\n currentNode.nextSibling === expectedNextNode &&\n currentNode.previousSibling === expectedPrevNode;\n const wasChanged =\n currentNode.nextSibling === startNode.nextSibling &&\n currentNode.previousSibling === expectedPrevNode;\n const wasRemoved = currentNode === startNode;\n\n if (!wasUpdated && !wasChanged && !wasRemoved) {\n throw new Error(\n \"There must be exactly one top level call corresponding \" +\n \"to the patched element.\"\n );\n }\n}\n\n/**\n * @param newContext The current patch context.\n */\nfunction updatePatchContext(newContext: {} | null) {\n inPatch = newContext != null;\n}\n\n/**\n * Updates the state of being in an attribute declaration.\n * @param value Whether or not the patch is in an attribute declaration.\n * @return the previous value.\n */\nfunction setInAttributes(value: boolean) {\n const previous = inAttributes;\n inAttributes = value;\n return previous;\n}\n\n/**\n * Updates the state of being in a skip element.\n * @param value Whether or not the patch is skipping the children of a\n * parent node.\n * @return the previous value.\n */\nfunction setInSkip(value: boolean) {\n const previous = inSkip;\n inSkip = value;\n return previous;\n}\n\nexport {\n assert,\n assertInPatch,\n assertNoUnclosedTags,\n assertNotInAttributes,\n assertInAttributes,\n assertCloseMatchesOpenTag,\n assertVirtualAttributesClosed,\n assertNoChildrenDeclaredYet,\n assertNotInSkip,\n assertPatchElementNoExtras,\n assertPatchOuterHasParentNode,\n setInAttributes,\n setInSkip,\n updatePatchContext\n};\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\n/**\n * The name of the HTML attribute that holds the element key\n * (e.g. `<div key=\"foo\">`). The attribute value, if it exists, is then used\n * as the default key when importing an element.\n * If null, no attribute value is used as the default key.\n */\nlet keyAttributeName: string | null = \"key\";\n\nfunction getKeyAttributeName() {\n return keyAttributeName;\n}\n\nfunction setKeyAttributeName(name: string | null) {\n keyAttributeName = name;\n}\n\nexport { DEBUG } from \"./debug\";\nexport { getKeyAttributeName, setKeyAttributeName };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nexport const DEBUG = true;\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\n/**\n * A cached reference to the hasOwnProperty function.\n */\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * A constructor function that will create blank objects.\n */\nfunction Blank() {}\n\nBlank.prototype = Object.create(null);\n\n/**\n * Used to prevent property collisions between our \"map\" and its prototype.\n * @param map The map to check.\n * @param property The property to check.\n * @return Whether map has property.\n */\nfunction has(map: object, property: string): boolean {\n return hasOwnProperty.call(map, property);\n}\n\n/**\n * Creates an map object without a prototype.\n * @returns An Object that can be used as a map.\n */\nfunction createMap(): any {\n return new (Blank as any)();\n}\n\n/**\n * Truncates an array, removing items up until length.\n * @param arr The array to truncate.\n * @param length The new length of the array.\n */\nfunction truncateArray(arr: Array<{} | null | undefined>, length: number) {\n while (arr.length > length) {\n arr.pop();\n }\n}\n\n/**\n * Creates an array for a desired initial size. Note that the array will still\n * be empty.\n * @param initialAllocationSize The initial size to allocate.\n * @returns An empty array, with an initial allocation for the desired size.\n */\nfunction createArray<T>(initialAllocationSize: number): Array<T> {\n const arr = new Array(initialAllocationSize);\n truncateArray(arr, 0);\n return arr;\n}\n\nexport { createArray, createMap, has, truncateArray };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nconst symbols = {\n default: \"__default\"\n};\n\nexport { symbols };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport {\n assertInPatch,\n assertNoChildrenDeclaredYet,\n assertNotInAttributes,\n assertNoUnclosedTags,\n assertPatchElementNoExtras,\n assertPatchOuterHasParentNode,\n assertVirtualAttributesClosed,\n setInAttributes,\n setInSkip,\n updatePatchContext\n} from \"./assertions\";\nimport { Context } from \"./context\";\nimport { getFocusedPath, moveBefore } from \"./dom_util\";\nimport { DEBUG } from \"./global\";\nimport { getData } from \"./node_data\";\nimport { createElement, createText } from \"./nodes\";\nimport {\n Key,\n MatchFnDef,\n NameOrCtorDef,\n PatchConfig,\n PatchFunction\n} from \"./types\";\n\n/**\n * The default match function to use, if one was not specified when creating\n * the patcher.\n * @param matchNode The node to match against, unused.\n * @param nameOrCtor The name or constructor as declared.\n * @param expectedNameOrCtor The name or constructor of the existing node.\n * @param key The key as declared.\n * @param expectedKey The key of the existing node.\n * @returns True if the node matches, false otherwise.\n */\nfunction defaultMatchFn(\n matchNode: Node,\n nameOrCtor: NameOrCtorDef,\n expectedNameOrCtor: NameOrCtorDef,\n key: Key,\n expectedKey: Key\n): boolean {\n // Key check is done using double equals as we want to treat a null key the\n // same as undefined. This should be okay as the only values allowed are\n // strings, null and undefined so the == semantics are not too weird.\n return nameOrCtor == expectedNameOrCtor && key == expectedKey;\n}\n\nlet context: Context | null = null;\n\nlet currentNode: Node | null = null;\n\nlet currentParent: Node | null = null;\n\nlet doc: Document | null = null;\n\nlet focusPath: Array<Node> = [];\n\nlet matchFn: MatchFnDef = defaultMatchFn;\n\n/**\n * Used to build up call arguments. Each patch call gets a separate copy, so\n * this works with nested calls to patch.\n */\nlet argsBuilder: Array<{} | null | undefined> = [];\n\n/**\n * Used to build up attrs for the an element.\n */\nlet attrsBuilder: Array<any> = [];\n\n/**\n * TODO(sparhami) We should just export argsBuilder directly when Closure\n * Compiler supports ES6 directly.\n * @returns The Array used for building arguments.\n */\nfunction getArgsBuilder(): Array<any> {\n return argsBuilder;\n}\n\n/**\n * TODO(sparhami) We should just export attrsBuilder directly when Closure\n * Compiler supports ES6 directly.\n * @returns The Array used for building arguments.\n */\nfunction getAttrsBuilder(): Array<any> {\n return attrsBuilder;\n}\n\n/**\n * Checks whether or not the current node matches the specified nameOrCtor and\n * key. This uses the specified match function when creating the patcher.\n * @param matchNode A node to match the data to.\n * @param nameOrCtor The name or constructor to check for.\n * @param key The key used to identify the Node.\n * @return True if the node matches, false otherwise.\n */\nfunction matches(\n matchNode: Node,\n nameOrCtor: NameOrCtorDef,\n key: Key\n): boolean {\n const data = getData(matchNode, key);\n\n return matchFn(matchNode, nameOrCtor, data.nameOrCtor, key, data.key);\n}\n\n/**\n * Finds the matching node, starting at `node` and looking at the subsequent\n * siblings if a key is used.\n * @param matchNode The node to start looking at.\n * @param nameOrCtor The name or constructor for the Node.\n * @param key The key used to identify the Node.\n * @returns The matching Node, if any exists.\n */\nfunction getMatchingNode(\n matchNode: Node | null,\n nameOrCtor: NameOrCtorDef,\n key: Key\n): Node | null {\n if (!matchNode) {\n return null;\n }\n\n let cur: Node | null = matchNode;\n\n do {\n if (matches(cur, nameOrCtor, key)) {\n return cur;\n }\n } while (key && (cur = cur.nextSibling));\n\n return null;\n}\n\n/**\n * Updates the internal structure of a DOM node in the case that an external\n * framework tries to modify a DOM element.\n * @param el The DOM node to update.\n */\nfunction alwaysDiffAttributes(el: Element) {\n getData(el).alwaysDiffAttributes = true;\n}\n\n/**\n * Clears out any unvisited Nodes in a given range.\n * @param maybeParentNode\n * @param startNode The node to start clearing from, inclusive.\n * @param endNode The node to clear until, exclusive.\n */\nfunction clearUnvisitedDOM(\n maybeParentNode: Node | null,\n startNode: Node | null,\n endNode: Node | null\n) {\n const parentNode = maybeParentNode!;\n let child = startNode;\n\n while (child !== endNode) {\n const next = child!.nextSibling;\n parentNode.removeChild(child!);\n context!.markDeleted(child!);\n child = next;\n }\n}\n\n/**\n * @return The next Node to be patched.\n */\nfunction getNextNode(): Node | null {\n if (currentNode) {\n return currentNode.nextSibling;\n } else {\n return currentParent!.firstChild;\n }\n}\n\n/**\n * Changes to the first child of the current node.\n */\nfunction enterNode() {\n currentParent = currentNode;\n currentNode = null;\n}\n\n/**\n * Changes to the parent of the current node, removing any unvisited children.\n */\nfunction exitNode() {\n clearUnvisitedDOM(currentParent, getNextNode(), null);\n\n currentNode = currentParent;\n currentParent = currentParent!.parentNode;\n}\n\n/**\n * Changes to the next sibling of the current node.\n */\nfunction nextNode() {\n currentNode = getNextNode();\n}\n\n/**\n * Creates a Node and marking it as created.\n * @param nameOrCtor The name or constructor for the Node.\n * @param key The key used to identify the Node.\n * @param nonce The nonce attribute for the element.\n * @return The newly created node.\n */\nfunction createNode(nameOrCtor: NameOrCtorDef, key: Key, nonce?: string): Node {\n let node;\n\n if (nameOrCtor === \"#text\") {\n node = createText(doc!);\n } else {\n node = createElement(doc!, currentParent!, nameOrCtor, key);\n if (nonce) {\n node.setAttribute(\"nonce\", nonce);\n }\n }\n\n context!.markCreated(node);\n\n return node;\n}\n\n/**\n * Aligns the virtual Node definition with the actual DOM, moving the\n * corresponding DOM node to the correct location or creating it if necessary.\n * @param nameOrCtor The name or constructor for the Node.\n * @param key The key used to identify the Node.\n * @param nonce The nonce attribute for the element.\n */\nfunction alignWithDOM(nameOrCtor: NameOrCtorDef, key: Key, nonce?: string) {\n nextNode();\n const existingNode = getMatchingNode(currentNode, nameOrCtor, key);\n const node = existingNode || createNode(nameOrCtor, key, nonce);\n\n // If we are at the matching node, then we are done.\n if (node === currentNode) {\n return;\n }\n\n // Re-order the node into the right position, preserving focus if either\n // node or currentNode are focused by making sure that they are not detached\n // from the DOM.\n if (focusPath.indexOf(node) >= 0) {\n // Move everything else before the node.\n moveBefore(currentParent!, node, currentNode);\n } else {\n currentParent!.insertBefore(node, currentNode);\n }\n\n currentNode = node;\n}\n\n/**\n * Makes sure that the current node is an Element with a matching nameOrCtor and\n * key.\n *\n * @param nameOrCtor The tag or constructor for the Element.\n * @param key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param nonce The nonce attribute for the element.\n * @return The corresponding Element.\n */\nfunction open(\n nameOrCtor: NameOrCtorDef,\n key?: Key,\n nonce?: string\n): HTMLElement {\n alignWithDOM(nameOrCtor, key, nonce);\n enterNode();\n return currentParent as HTMLElement;\n}\n\n/**\n * Closes the currently open Element, removing any unvisited children if\n * necessary.\n * @returns The Element that was just closed.\n */\nfunction close(): Element {\n if (DEBUG) {\n setInSkip(false);\n }\n\n exitNode();\n return currentNode as Element;\n}\n\n/**\n * Makes sure the current node is a Text node and creates a Text node if it is\n * not.\n * @returns The Text node that was aligned or created.\n */\nfunction text(): Text {\n alignWithDOM(\"#text\", null);\n return currentNode as Text;\n}\n\n/**\n * @returns The current Element being patched.\n */\nfunction currentElement(): Element {\n if (DEBUG) {\n assertInPatch(\"currentElement\");\n assertNotInAttributes(\"currentElement\");\n }\n return currentParent as Element;\n}\n\n/**\n * @returns The current Element being patched, or null if no patch is in progress.\n */\nfunction tryGetCurrentElement(): Element | null {\n return currentParent as Element | null;\n}\n\n/**\n * @return The Node that will be evaluated for the next instruction.\n */\nfunction currentPointer(): Node {\n if (DEBUG) {\n assertInPatch(\"currentPointer\");\n assertNotInAttributes(\"currentPointer\");\n }\n // TODO(tomnguyen): assert that this is not null\n return getNextNode()!;\n}\n\nfunction currentContext() {\n return context;\n}\n\n/**\n * Skips the children in a subtree, allowing an Element to be closed without\n * clearing out the children.\n */\nfunction skip() {\n if (DEBUG) {\n assertNoChildrenDeclaredYet(\"skip\", currentNode);\n setInSkip(true);\n }\n currentNode = currentParent!.lastChild;\n}\n\n/**\n * Returns a patcher function that sets up and restores a patch context,\n * running the run function with the provided data.\n * @param run The function that will run the patch.\n * @param patchConfig The configuration to use for the patch.\n * @returns The created patch function.\n */\nfunction createPatcher<T, R>(\n run: PatchFunction<T, R>,\n patchConfig: PatchConfig = {}\n): PatchFunction<T, R> {\n const { matches = defaultMatchFn } = patchConfig;\n\n const f: PatchFunction<T, R> = (node, fn, data) => {\n const prevContext = context;\n const prevDoc = doc;\n const prevFocusPath = focusPath;\n const prevArgsBuilder = argsBuilder;\n const prevAttrsBuilder = attrsBuilder;\n const prevCurrentNode = currentNode;\n const prevCurrentParent = currentParent;\n const prevMatchFn = matchFn;\n let previousInAttributes = false;\n let previousInSkip = false;\n\n doc = node.ownerDocument;\n context = new Context(node);\n matchFn = matches;\n argsBuilder = [];\n attrsBuilder = [];\n currentNode = null;\n currentParent = node.parentNode;\n focusPath = getFocusedPath(node, currentParent);\n\n if (DEBUG) {\n previousInAttributes = setInAttributes(false);\n previousInSkip = setInSkip(false);\n updatePatchContext(context);\n }\n\n try {\n const retVal = run(node, fn, data);\n if (DEBUG) {\n assertVirtualAttributesClosed();\n }\n\n return retVal;\n } finally {\n context.notifyChanges();\n\n doc = prevDoc;\n context = prevContext;\n matchFn = prevMatchFn;\n argsBuilder = prevArgsBuilder;\n attrsBuilder = prevAttrsBuilder;\n currentNode = prevCurrentNode;\n currentParent = prevCurrentParent;\n focusPath = prevFocusPath;\n\n // Needs to be done after assertions because assertions rely on state\n // from these methods.\n if (DEBUG) {\n setInAttributes(previousInAttributes);\n setInSkip(previousInSkip);\n updatePatchContext(context);\n }\n }\n };\n return f;\n}\n\n/**\n * Creates a patcher that patches the document starting at node with a\n * provided function. This function may be called during an existing patch operation.\n * @param patchConfig The config to use for the patch.\n * @returns The created function for patching an Element's children.\n */\nfunction createPatchInner<T>(\n patchConfig?: PatchConfig\n): PatchFunction<T, Node> {\n return createPatcher((node, fn, data) => {\n currentNode = node;\n\n enterNode();\n fn(data);\n exitNode();\n\n if (DEBUG) {\n assertNoUnclosedTags(currentNode, node);\n }\n\n return node;\n }, patchConfig);\n}\n\n/**\n * Creates a patcher that patches an Element with the the provided function.\n * Exactly one top level element call should be made corresponding to `node`.\n * @param patchConfig The config to use for the patch.\n * @returns The created function for patching an Element.\n */\nfunction createPatchOuter<T>(\n patchConfig?: PatchConfig\n): PatchFunction<T, Node | null> {\n return createPatcher((node, fn, data) => {\n const startNode = ({ nextSibling: node } as any) as Element;\n let expectedNextNode: Node | null = null;\n let expectedPrevNode: Node | null = null;\n\n if (DEBUG) {\n expectedNextNode = node.nextSibling;\n expectedPrevNode = node.previousSibling;\n }\n\n currentNode = startNode;\n fn(data);\n\n if (DEBUG) {\n if (getData(node).key) {\n assertPatchOuterHasParentNode(currentParent);\n }\n assertPatchElementNoExtras(\n startNode,\n currentNode,\n expectedNextNode,\n expectedPrevNode\n );\n }\n\n if (currentParent) {\n clearUnvisitedDOM(currentParent, getNextNode(), node.nextSibling);\n }\n\n return startNode === currentNode ? null : currentNode;\n }, patchConfig);\n}\n\nconst patchInner: <T>(\n node: Element | DocumentFragment,\n template: (a: T | undefined) => void,\n data?: T | undefined\n) => Node = createPatchInner();\nconst patchOuter: <T>(\n node: Element | DocumentFragment,\n template: (a: T | undefined) => void,\n data?: T | undefined\n) => Node | null = createPatchOuter();\n\nexport {\n alignWithDOM,\n alwaysDiffAttributes,\n getArgsBuilder,\n getAttrsBuilder,\n text,\n createPatchInner,\n createPatchOuter,\n patchInner,\n patchOuter,\n open,\n close,\n currentElement,\n currentContext,\n currentPointer,\n skip,\n nextNode as skipNode,\n tryGetCurrentElement\n};\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { notifications } from \"./notifications\";\n\n/**\n * A context object keeps track of the state of a patch.\n */\nclass Context {\n private created: Array<Node> = [];\n private deleted: Array<Node> = [];\n public readonly node: Element | DocumentFragment;\n\n public constructor(node: Element | DocumentFragment) {\n this.node = node;\n }\n\n public markCreated(node: Node) {\n this.created.push(node);\n }\n\n public markDeleted(node: Node) {\n this.deleted.push(node);\n }\n\n /**\n * Notifies about nodes that were created during the patch operation.\n */\n public notifyChanges() {\n if (notifications.nodesCreated && this.created.length > 0) {\n notifications.nodesCreated(this.created);\n }\n\n if (notifications.nodesDeleted && this.deleted.length > 0) {\n notifications.nodesDeleted(this.deleted);\n }\n }\n}\n\nexport { Context };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nexport type NodeFunction = (n: Array<Node>) => void;\n\nexport interface Notifications {\n /**\n * Called after patch has completed with any Nodes that have been created\n * and added to the DOM.\n */\n nodesCreated: NodeFunction | null;\n /**\n * Called after patch has completed with any Nodes that have been removed\n * from the DOM.\n * Note it's an application's responsibility to handle any childNodes.\n */\n nodesDeleted: NodeFunction | null;\n}\n\nexport const notifications: Notifications = {\n nodesCreated: null,\n nodesDeleted: null\n};\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { assert } from \"./assertions\";\n\n/**\n * Checks if the node is the root of a document. This is either a Document\n * or ShadowRoot. DocumentFragments are included for simplicity of the\n * implementation, though we only want to consider Documents or ShadowRoots.\n * @param node The node to check.\n * @return True if the node the root of a document, false otherwise.\n */\nfunction isDocumentRoot(node: Node): node is Document | ShadowRoot {\n return node.nodeType === 11 || node.nodeType === 9;\n}\n\n/**\n * Checks if the node is an Element. This is faster than an instanceof check.\n * @param node The node to check.\n * @return Whether or not the node is an Element.\n */\nfunction isElement(node: Node): node is Element {\n return node.nodeType === 1;\n}\n\n/**\n * Checks if the node is a text node. This is faster than an instanceof check.\n * @param node The node to check.\n * @return Whether or not the node is a Text.\n */\nfunction isText(node: Node): node is Text {\n return node.nodeType === 3;\n}\n\n/**\n * @param node The node to start at, inclusive.\n * @param root The root ancestor to get until, exclusive.\n * @return The ancestry of DOM nodes.\n */\nfunction getAncestry(node: Node, root: Node | null) {\n const ancestry: Array<Node> = [];\n let cur: Node | null = node;\n\n while (cur !== root) {\n const n: Node = assert(cur);\n ancestry.push(n);\n // If `node` is inside of a ShadowRoot, then it needs to pierce the\n // ShadowRoot boundary in order to reach `root`.\n cur = n.parentNode || (root ? (n as ShadowRoot).host : null);\n }\n\n return ancestry;\n}\n\n/**\n * @param this\n * @returns The root node of the DOM tree that contains this node.\n */\nconst getRootNode =\n (typeof Node !== \"undefined\" && (Node as any).prototype.getRootNode) ||\n function(this: Node) {\n let cur: Node | null = this as Node;\n let prev = cur;\n\n while (cur) {\n prev = cur;\n cur = cur.parentNode;\n }\n\n return prev;\n };\n\n/**\n * @param node The node to get the activeElement for.\n * @returns The activeElement in the Document or ShadowRoot\n * corresponding to node, if present.\n */\nfunction getActiveElement(node: Node): Element | null {\n const root = getRootNode.call(node);\n return isDocumentRoot(root) ? root.activeElement : null;\n}\n\n/**\n * Gets the path of nodes that contain the focused node in the same document as\n * a reference node, up until the root.\n * @param node The reference node to get the activeElement for.\n * @param root The root to get the focused path until.\n * @returns The path of focused parents, if any exist.\n */\nfunction getFocusedPath(node: Node, root: Node | null): Array<Node> {\n const activeElement = getActiveElement(node);\n\n if (!activeElement || !node.contains(activeElement)) {\n return [];\n }\n\n return getAncestry(activeElement, root);\n}\n\n/**\n * Like insertBefore, but instead of moving the desired node, it moves all the\n * other nodes after.\n * @param parentNode\n * @param node\n * @param referenceNode\n */\nfunction moveBefore(parentNode: Node, node: Node, referenceNode: Node | null) {\n const insertReferenceNode = node.nextSibling;\n let cur = referenceNode;\n\n while (cur !== null && cur !== node) {\n const next = cur.nextSibling;\n parentNode.insertBefore(cur, insertReferenceNode);\n cur = next;\n }\n}\n\nexport { isElement, isText, getFocusedPath, moveBefore };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { Key, NameOrCtorDef } from \"./types\";\nimport { assert } from \"./assertions\";\nimport { createArray } from \"./util\";\nimport { isElement } from \"./dom_util\";\nimport { getKeyAttributeName } from \"./global\";\n\ndeclare global {\n interface Node {\n __incrementalDOMData: NodeData | null;\n }\n}\n\n/**\n * Keeps track of information needed to perform diffs for a given DOM node.\n */\nexport class NodeData {\n /**\n * An array of attribute name/value pairs, used for quickly diffing the\n * incomming attributes to see if the DOM node's attributes need to be\n * updated.\n */\n private _attrsArr: Array<any> | null = null;\n\n /**\n * Whether or not the statics have been applied for the node yet.\n */\n public staticsApplied = false;\n\n /**\n * The key used to identify this node, used to preserve DOM nodes when they\n * move within their parent.\n */\n public readonly key: Key;\n\n /**\n * The previous text value, for Text nodes.\n */\n public text: string | undefined;\n\n /**\n * The nodeName or contructor for the Node.\n */\n public readonly nameOrCtor: NameOrCtorDef;\n\n public alwaysDiffAttributes = false;\n\n public constructor(\n nameOrCtor: NameOrCtorDef,\n key: Key,\n text: string | undefined\n ) {\n this.nameOrCtor = nameOrCtor;\n this.key = key;\n this.text = text;\n }\n\n public hasEmptyAttrsArr(): boolean {\n const attrs = this._attrsArr;\n return !attrs || !attrs.length;\n }\n\n public getAttrsArr(length: number): Array<any> {\n return this._attrsArr || (this._attrsArr = createArray(length));\n }\n}\n\n/**\n * Initializes a NodeData object for a Node.\n * @param node The Node to initialized data for.\n * @param nameOrCtor The NameOrCtorDef to use when diffing.\n * @param key The Key for the Node.\n * @param text The data of a Text node, if importing a Text node.\n * @returns A NodeData object with the existing attributes initialized.\n */\nfunction initData(\n node: Node,\n nameOrCtor: NameOrCtorDef,\n key: Key,\n text?: string | undefined\n): NodeData {\n const data = new NodeData(nameOrCtor, key, text);\n node[\"__incrementalDOMData\"] = data;\n return data;\n}\n\n/**\n * @param node The node to check.\n * @returns True if the NodeData already exists, false otherwise.\n */\nfunction isDataInitialized(node: Node): boolean {\n return Boolean(node[\"__incrementalDOMData\"]);\n}\n\n/**\n * Records the element's attributes.\n * @param node The Element that may have attributes\n * @param data The Element's data\n */\nfunction recordAttributes(node: Element, data: NodeData) {\n const attributes = node.attributes;\n const length = attributes.length;\n if (!length) {\n return;\n }\n\n const attrsArr = data.getAttrsArr(length);\n\n // Use a cached length. The attributes array is really a live NamedNodeMap,\n // which exists as a DOM \"Host Object\" (probably as C++ code). This makes the\n // usual constant length iteration very difficult to optimize in JITs.\n for (let i = 0, j = 0; i < length; i += 1, j += 2) {\n const attr = attributes[i];\n const name = attr.name;\n const value = attr.value;\n\n attrsArr[j] = name;\n attrsArr[j + 1] = value;\n }\n}\n\n/**\n * Imports single node and its subtree, initializing caches, if it has not\n * already been imported.\n * @param node The node to import.\n * @param fallbackKey A key to use if importing and no key was specified.\n * Useful when not transmitting keys from serverside render and doing an\n * immediate no-op diff.\n * @returns The NodeData for the node.\n */\nfunction importSingleNode(node: Node, fallbackKey?: Key): NodeData {\n if (node[\"__incrementalDOMData\"]) {\n return node[\"__incrementalDOMData\"];\n }\n\n const nodeName = isElement(node) ? node.localName : node.nodeName;\n const keyAttrName = getKeyAttributeName();\n const keyAttr =\n isElement(node) && keyAttrName != null\n ? node.getAttribute(keyAttrName)\n : null;\n const key = isElement(node) ? keyAttr || fallbackKey : null;\n const data = initData(node, nodeName, key);\n\n if (isElement(node)) {\n recordAttributes(node, data);\n }\n\n return data;\n}\n\n/**\n * Imports node and its subtree, initializing caches.\n * @param node The Node to import.\n */\nfunction importNode(node: Node) {\n importSingleNode(node);\n\n for (\n let child: Node | null = node.firstChild;\n child;\n child = child.nextSibling\n ) {\n importNode(child);\n }\n}\n\n/**\n * Retrieves the NodeData object for a Node, creating it if necessary.\n * @param node The node to get data for.\n * @param fallbackKey A key to use if importing and no key was specified.\n * Useful when not transmitting keys from serverside render and doing an\n * immediate no-op diff.\n * @returns The NodeData for the node.\n */\nfunction getData(node: Node, fallbackKey?: Key) {\n return importSingleNode(node, fallbackKey);\n}\n\n/**\n * Gets the key for a Node. note that the Node should have been imported\n * by now.\n * @param node The node to check.\n * @returns The key used to create the node.\n */\nfunction getKey(node: Node) {\n assert(node[\"__incrementalDOMData\"]);\n return getData(node).key;\n}\n\n/**\n * Clears all caches from a node and all of its children.\n * @param node The Node to clear the cache for.\n */\nfunction clearCache(node: Node) {\n node[\"__incrementalDOMData\"] = null;\n\n for (\n let child: Node | null = node.firstChild;\n child;\n child = child.nextSibling\n ) {\n clearCache(child);\n }\n}\n\nexport { getData, getKey, initData, importNode, isDataInitialized, clearCache };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { getData, initData } from \"./node_data\";\nimport { Key, NameOrCtorDef } from \"./types\";\n\n/**\n * Gets the namespace to create an element (of a given tag) in.\n * @param tag The tag to get the namespace for.\n * @param parent The current parent Node, if any.\n * @returns The namespace to use.\n */\nfunction getNamespaceForTag(tag: string, parent: Node | null) {\n if (tag === \"svg\") {\n return \"http://www.w3.org/2000/svg\";\n }\n\n if (tag === \"math\") {\n return \"http://www.w3.org/1998/Math/MathML\";\n }\n\n if (parent == null) {\n return null;\n }\n\n if (getData(parent).nameOrCtor === \"foreignObject\") {\n return null;\n }\n\n // Since TypeScript 4.4 namespaceURI is only defined for Attr and Element\n // nodes. Checking for Element nodes here seems reasonable but breaks SVG\n // rendering in Chrome in certain cases. The cast to any should be removed\n // once we know why this happens.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (parent as any).namespaceURI;\n}\n\n/**\n * Creates an Element and initializes the NodeData.\n * @param doc The document with which to create the Element.\n * @param parent The parent of new Element.\n * @param nameOrCtor The tag or constructor for the Element.\n * @param key A key to identify the Element.\n * @returns The newly created Element.\n */\nfunction createElement(\n doc: Document,\n parent: Node | null,\n nameOrCtor: NameOrCtorDef,\n key: Key\n): Element {\n let el;\n\n if (typeof nameOrCtor === \"function\") {\n el = new nameOrCtor();\n } else {\n const namespace = getNamespaceForTag(nameOrCtor, parent);\n\n if (namespace) {\n el = doc.createElementNS(namespace, nameOrCtor);\n } else {\n el = doc.createElement(nameOrCtor);\n }\n }\n\n initData(el, nameOrCtor, key);\n\n return el;\n}\n\n/**\n * Creates a Text Node.\n * @param doc The document with which to create the Element.\n * @returns The newly created Text.\n */\nfunction createText(doc: Document): Text {\n const node = doc.createTextNode(\"\");\n initData(node, \"#text\", null);\n return node;\n}\n\nexport { createElement, createText };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport {\n assert,\n assertCloseMatchesOpenTag,\n assertInAttributes,\n assertInPatch,\n assertNotInAttributes,\n assertNotInSkip,\n setInAttributes\n} from \"./assertions\";\nimport { attributes, updateAttribute } from \"./attributes\";\nimport {\n getArgsBuilder,\n getAttrsBuilder,\n close,\n open,\n text as coreText,\n currentElement\n} from \"./core\";\nimport { DEBUG } from \"./global\";\nimport { getData, NodeData } from \"./node_data\";\nimport { AttrMutatorConfig, Key, NameOrCtorDef, Statics } from \"./types\";\nimport { createMap, truncateArray } from \"./util\";\nimport { calculateDiff } from \"./diff\";\n\n/**\n * The offset in the virtual element declaration where the attributes are\n * specified.\n */\nconst ATTRIBUTES_OFFSET = 3;\n\n/**\n * Used to keep track of the previous values when a 2-way diff is necessary.\n * This object is reused.\n * TODO(sparhamI) Scope this to a patch so you can call patch from an attribute\n * update.\n */\nconst prevAttrsMap = createMap();\n\n/**\n * @param element The Element to diff the attrs for.\n * @param data The NodeData associated with the Element.\n * @param attrs The attribute map of mutators\n */\nfunction diffAttrs(element: Element, data: NodeData, attrs: AttrMutatorConfig) {\n const attrsBuilder = getAttrsBuilder();\n const prevAttrsArr = data.getAttrsArr(attrsBuilder.length);\n\n calculateDiff(\n prevAttrsArr,\n attrsBuilder,\n element,\n updateAttribute,\n attrs,\n data.alwaysDiffAttributes\n );\n truncateArray(attrsBuilder, 0);\n}\n\n/**\n * Applies the statics. When importing an Element, any existing attributes that\n * match a static are converted into a static attribute.\n * @param node The Element to apply statics for.\n * @param data The NodeData associated with the Element.\n * @param statics The statics array.\n * @param attrs The attribute map of mutators.\n */\nfunction diffStatics(\n node: Element,\n data: NodeData,\n statics: Statics,\n attrs: AttrMutatorConfig\n) {\n if (data.staticsApplied) {\n return;\n }\n\n data.staticsApplied = true;\n\n if (!statics || !statics.length) {\n return;\n }\n\n if (data.hasEmptyAttrsArr()) {\n for (let i = 0; i < statics.length; i += 2) {\n updateAttribute(node, statics[i] as string, statics[i + 1], attrs);\n }\n return;\n }\n\n for (let i = 0; i < statics.length; i += 2) {\n prevAttrsMap[statics[i] as string] = i + 1;\n }\n\n const attrsArr = data.getAttrsArr(0);\n let j = 0;\n for (let i = 0; i < attrsArr.length; i += 2) {\n const name = attrsArr[i];\n const value = attrsArr[i + 1];\n const staticsIndex = prevAttrsMap[name];\n\n if (staticsIndex) {\n // For any attrs that are static and have the same value, make sure we do\n // not set them again.\n if (statics[staticsIndex] === value) {\n delete prevAttrsMap[name];\n }\n\n continue;\n }\n\n // For any attrs that are dynamic, move them up to the right place.\n attrsArr[j] = name;\n attrsArr[j + 1] = value;\n j += 2;\n }\n // Anything after `j` was either moved up already or static.\n truncateArray(attrsArr, j);\n\n for (const name in prevAttrsMap) {\n updateAttribute(node, name, statics[prevAttrsMap[name]], attrs);\n delete prevAttrsMap[name];\n }\n}\n\n/**\n * Declares a virtual Element at the current location in the document. This\n * corresponds to an opening tag and a elementClose tag is required. This is\n * like elementOpen, but the attributes are defined using the attr function\n * rather than being passed as arguments. Must be folllowed by 0 or more calls\n * to attr, then a call to elementOpenEnd.\n * @param nameOrCtor The Element's tag or constructor.\n * @param key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param statics An array of attribute name/value pairs of the static\n * attributes for the Element. Attributes will only be set once when the\n * Element is created.\n */\nfunction elementOpenStart(\n nameOrCtor: NameOrCtorDef,\n key?: Key,\n statics?: Statics\n) {\n const argsBuilder = getArgsBuilder();\n\n if (DEBUG) {\n assertNotInAttributes(\"elementOpenStart\");\n setInAttributes(true);\n }\n\n argsBuilder[0] = nameOrCtor;\n argsBuilder[1] = key;\n argsBuilder[2] = statics;\n}\n\n/**\n * Allows you to define a key after an elementOpenStart. This is useful in\n * templates that define key after an element has been opened ie\n * `<div key('foo')></div>`.\n * @param key The key to use for the next call.\n */\nfunction key(key: string) {\n const argsBuilder = getArgsBuilder();\n\n if (DEBUG) {\n assertInAttributes(\"key\");\n assert(argsBuilder);\n }\n argsBuilder[1] = key;\n}\n\n/**\n * Buffers an attribute, which will get applied during the next call to\n * `elementOpen`, `elementOpenEnd` or `applyAttrs`.\n * @param name The of the attribute to buffer.\n * @param value The value of the attribute to buffer.\n */\nfunction attr(name: string, value: any) {\n const attrsBuilder = getAttrsBuilder();\n\n if (DEBUG) {\n assertInPatch(\"attr\");\n }\n\n attrsBuilder.push(name);\n attrsBuilder.push(value);\n}\n\n/** @return The value of the nonce attribute. */\nfunction getNonce(): string {\n const argsBuilder = getArgsBuilder();\n const statics = <Statics>argsBuilder[2];\n if (statics) {\n for (let i = 0; i < statics.length; i += 2) {\n if (statics[i] === \"nonce\") {\n return statics[i + 1] as string;\n }\n }\n }\n return \"\";\n}\n\n/**\n * Closes an open tag started with elementOpenStart.\n * @return The corresponding Element.\n */\nfunction elementOpenEnd(): HTMLElement {\n const argsBuilder = getArgsBuilder();\n\n if (DEBUG) {\n assertInAttributes(\"elementOpenEnd\");\n setInAttributes(false);\n }\n\n const node = open(\n <NameOrCtorDef>argsBuilder[0],\n <Key>argsBuilder[1],\n getNonce()\n );\n const data = getData(node);\n\n diffStatics(node, data, <Statics>argsBuilder[2], attributes);\n diffAttrs(node, data, attributes);\n truncateArray(argsBuilder, 0);\n\n return node;\n}\n\n/**\n * @param nameOrCtor The Element's tag or constructor.\n * @param key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param statics An array of attribute name/value pairs of the static\n * attributes for the Element. Attributes will only be set once when the\n * Element is created.\n * @param varArgs, Attribute name/value pairs of the dynamic attributes\n * for the Element.\n * @return The corresponding Element.\n */\nfunction elementOpen(\n nameOrCtor: NameOrCtorDef,\n key?: Key,\n // Ideally we could tag statics and varArgs as an array where every odd\n // element is a string and every even element is any, but this is hard.\n statics?: Statics,\n ...varArgs: Array<any>\n) {\n if (DEBUG) {\n assertNotInAttributes(\"elementOpen\");\n assertNotInSkip(\"elementOpen\");\n }\n\n elementOpenStart(nameOrCtor, key, statics);\n\n for (let i = ATTRIBUTES_OFFSET; i < arguments.length; i += 2) {\n attr(arguments[i], arguments[i + 1]);\n }\n\n return elementOpenEnd();\n}\n\n/**\n * Applies the currently buffered attrs to the currently open element. This\n * clears the buffered attributes.\n * @param attrs The attributes.\n */\nfunction applyAttrs(attrs = attributes) {\n const node = currentElement();\n const data = getData(node);\n\n diffAttrs(node, data, attrs);\n}\n\n/**\n * Applies the current static attributes to the currently open element. Note:\n * statics should be applied before calling `applyAtrs`.\n * @param statics The statics to apply to the current element.\n * @param attrs The attributes.\n */\nfunction applyStatics(statics: Statics, attrs = attributes) {\n const node = currentElement();\n const data = getData(node);\n\n diffStatics(node, data, statics, attrs);\n}\n\n/**\n * Closes an open virtual Element.\n *\n * @param nameOrCtor The Element's tag or constructor.\n * @return The corresponding Element.\n */\nfunction elementClose(nameOrCtor: NameOrCtorDef): Element {\n if (DEBUG) {\n assertNotInAttributes(\"elementClose\");\n }\n\n const node = close();\n\n if (DEBUG) {\n assertCloseMatchesOpenTag(getData(node).nameOrCtor, nameOrCtor);\n }\n\n return node;\n}\n\n/**\n * Declares a virtual Element at the current location in the document that has\n * no children.\n * @param nameOrCtor The Element's tag or constructor.\n * @param key The key used to identify this element. This can be an\n * empty string, but performance may be better if a unique value is used\n * when iterating over an array of items.\n * @param statics An array of attribute name/value pairs of the static\n * attributes for the Element. Attributes will only be set once when the\n * Element is created.\n * @param varArgs Attribute name/value pairs of the dynamic attributes\n * for the Element.\n * @return The corresponding Element.\n */\nfunction elementVoid(\n nameOrCtor: NameOrCtorDef,\n key?: Key,\n // Ideally we could tag statics and varArgs as an array where every odd\n // element is a string and every even element is any, but this is hard.\n statics?: Statics,\n ...varArgs: Array<any>\n) {\n elementOpen.apply(null, arguments as any);\n return elementClose(nameOrCtor);\n}\n\n/**\n * Declares a virtual Text at this point in the document.\n *\n * @param value The value of the Text.\n * @param varArgs\n * Functions to format the value which are called only when the value has\n * changed.\n * @return The corresponding text node.\n */\nfunction text(\n value: string | number | boolean,\n ...varArgs: Array<(a: {}) => string>\n) {\n if (DEBUG) {\n assertNotInAttributes(\"text\");\n assertNotInSkip(\"text\");\n }\n\n const node = coreText();\n const data = getData(node);\n\n if (data.text !== value) {\n data.text = value as string;\n\n let formatted = value;\n for (let i = 1; i < arguments.length; i += 1) {\n /*\n * Call the formatter function directly to prevent leaking arguments.\n * https://github.com/google/incremental-dom/pull/204#issuecomment-178223574\n */\n const fn = arguments[i];\n formatted = fn(formatted);\n }\n\n // Setting node.data resets the cursor in IE/Edge.\n if (node.data !== formatted) {\n node.data = formatted as string;\n }\n }\n\n return node;\n}\n\n/** */\nexport {\n applyAttrs,\n applyStatics,\n elementOpenStart,\n elementOpenEnd,\n elementOpen,\n elementVoid,\n elementClose,\n text,\n attr,\n key\n};\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { AttrMutatorConfig } from \"./types\";\nimport { createMap, truncateArray } from \"./util\";\nimport { flush, queueChange } from \"./changes\";\n\n/**\n * Used to keep track of the previous values when a 2-way diff is necessary.\n * This object is cleared out and reused.\n */\nconst prevValuesMap = createMap();\n\n/**\n * Calculates the diff between previous and next values, calling the update\n * function when an item has changed value. If an item from the previous values\n * is not present in the the next values, the update function is called with a\n * value of `undefined`.\n * @param prev The previous values, alternating name, value pairs.\n * @param next The next values, alternating name, value pairs.\n * @param updateCtx The context for the updateFn.\n * @param updateFn A function to call when a value has changed.\n * @param attrs Attribute map for mutators\n * @param alwaysDiffAttributes Whether to diff attributes unconditionally\n */\nfunction calculateDiff<T>(\n prev: Array<string>,\n next: Array<string>,\n updateCtx: T,\n updateFn: (\n ctx: T,\n x: string,\n y: {} | undefined,\n attrs: AttrMutatorConfig\n ) => void,\n attrs: AttrMutatorConfig,\n alwaysDiffAttributes: boolean = false\n) {\n const isNew = !prev.length || alwaysDiffAttributes;\n let i = 0;\n\n for (; i < next.length; i += 2) {\n const name = next[i];\n if (isNew) {\n prev[i] = name;\n } else if (prev[i] !== name) {\n break;\n }\n\n const value = next[i + 1];\n if (isNew || prev[i + 1] !== value) {\n prev[i + 1] = value;\n queueChange(updateFn, updateCtx, name, value, attrs);\n }\n }\n\n // Items did not line up exactly as before, need to make sure old items are\n // removed. This should be a rare case.\n if (i < next.length || i < prev.length) {\n const startIndex = i;\n\n for (i = startIndex; i < prev.length; i += 2) {\n prevValuesMap[prev[i]] = prev[i + 1];\n }\n\n for (i = startIndex; i < next.length; i += 2) {\n const name = next[i] as string;\n const value = next[i + 1];\n\n if (prevValuesMap[name] !== value) {\n queueChange(updateFn, updateCtx, name, value, attrs);\n }\n\n prev[i] = name;\n prev[i + 1] = value;\n\n delete prevValuesMap[name];\n }\n\n truncateArray(prev, next.length);\n\n for (const name in prevValuesMap) {\n queueChange(updateFn, updateCtx, name, undefined, attrs);\n delete prevValuesMap[name];\n }\n }\n\n flush();\n}\n\nexport { calculateDiff };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nimport { truncateArray } from \"./util\";\n\nconst buffer: Array<any> = [];\n\nlet bufferStart = 0;\n\n/**\n * TODO(tomnguyen): This is a bit silly and really needs to be better typed.\n * @param fn A function to call.\n * @param a The first argument to the function.\n * @param b The second argument to the function.\n * @param c The third argument to the function.\n * @param d The fourth argument to the function\n */\nfunction queueChange<A, B, C, D>(\n fn: (a: A, b: B, c: C, d: D) => void,\n a: A,\n b: B,\n c: C,\n d: D\n) {\n buffer.push(fn);\n buffer.push(a);\n buffer.push(b);\n buffer.push(c);\n buffer.push(d);\n}\n\n/**\n * Flushes the changes buffer, calling the functions for each change.\n */\nfunction flush() {\n // A change may cause this function to be called re-entrantly. Keep track of\n // the portion of the buffer we are consuming. Updates the start pointer so\n // that the next call knows where to start from.\n const start = bufferStart;\n const end = buffer.length;\n\n bufferStart = end;\n\n for (let i = start; i < end; i += 5) {\n const fn = buffer[i] as (a: any, b: any, c: any, d: any) => undefined;\n fn(buffer[i + 1], buffer[i + 2], buffer[i + 3], buffer[i + 4]);\n }\n\n bufferStart = start;\n truncateArray(buffer, start);\n}\n\nexport { queueChange, flush };\n","// Copyright 2018 The Incremental DOM Authors. All Rights Reserved.\n/** @license SPDX-License-Identifier: Apache-2.0 */\n\nexport interface ElementConstructor {\n new (): Element;\n}\n\nexport type AttrMutator = (a: Element, b: string, c: any) => void;\n\nexport interface AttrMutatorConfig {\n [x: string]: AttrMutator;\n}\n\nexport type NameOrCtorDef = string | ElementConstructor;\n\nexport type Key = string | number | null | undefined;\n\nexport type Statics = Array<{}> | null | undefined;\n\nexport type PatchFunction<T, R> = (\n node: Element | DocumentFragment,\n template: (a: T | undefined) => void,\n data?: T | undefined\n) => R;\n\nexport type MatchFnDef = (\n matchNode: Node,\n nameOrCtor: NameOrCtorDef,\n expectedNameOrCtor: NameOrCtorDef,\n key: Key,\n expectedKey: Key\n) => boolean;\n\nexport interface PatchConfig {\n matches?: MatchFnDef;\n}\n"],"names":[],"version":3,"file":"hsml-app.js.map"}
|