UNPKG

i18n-element

Version:

I18N Base Element for lit-html and Polymer

1 lines 93 kB
const directives=new WeakMap,directive=f=>(...args)=>{const d=f(...args);directives.set(d,!0);return d},isDirective=o=>{return"function"===typeof o&&directives.has(o)};var directive$1={directive:directive,isDirective:isDirective};const isCEPolyfill=window.customElements!==void 0&&window.customElements.polyfillWrapFlushCallback!==void 0,reparentNodes=(container,start,end=null,before=null)=>{let node=start;while(node!==end){const n=node.nextSibling;container.insertBefore(node,before);node=n}},removeNodes=(container,startNode,endNode=null)=>{let node=startNode;while(node!==endNode){const n=node.nextSibling;container.removeChild(node);node=n}};var dom={isCEPolyfill:isCEPolyfill,reparentNodes:reparentNodes,removeNodes:removeNodes};const noChange={},nothing={};var part={noChange:noChange,nothing:nothing};const marker=`{{lit-${(Math.random()+"").slice(2)}}}`,nodeMarker=`<!--${marker}-->`,markerRegex=new RegExp(`${marker}|${nodeMarker}`),boundAttributeSuffix="$lit$";class Template{constructor(result,element){this.parts=[];this.element=element;let index=-1,partIndex=0;const nodesToRemove=[],_prepareTemplate=template=>{const content=template.content,walker=document.createTreeWalker(content,133,null,!1);let lastPartIndex=0;while(walker.nextNode()){index++;const node=walker.currentNode;if(1===node.nodeType){if(node.hasAttributes()){const attributes=node.attributes;let count=0;for(let i=0;i<attributes.length;i++){if(0<=attributes[i].value.indexOf(marker)){count++}}while(0<count--){const stringForPart=result.strings[partIndex],name=lastAttributeNameRegex.exec(stringForPart)[2],attributeLookupName=name.toLowerCase()+boundAttributeSuffix,attributeValue=node.getAttribute(attributeLookupName),strings=attributeValue.split(markerRegex);this.parts.push({type:"attribute",index,name,strings});node.removeAttribute(attributeLookupName);partIndex+=strings.length-1}}if("TEMPLATE"===node.tagName){_prepareTemplate(node)}}else if(3===node.nodeType){const data=node.data;if(0<=data.indexOf(marker)){const parent=node.parentNode,strings=data.split(markerRegex),lastIndex=strings.length-1;for(let i=0;i<lastIndex;i++){parent.insertBefore(""===strings[i]?createMarker():document.createTextNode(strings[i]),node);this.parts.push({type:"node",index:++index})}if(""===strings[lastIndex]){parent.insertBefore(createMarker(),node);nodesToRemove.push(node)}else{node.data=strings[lastIndex]}partIndex+=lastIndex}}else if(8===node.nodeType){if(node.data===marker){const parent=node.parentNode;if(null===node.previousSibling||index===lastPartIndex){index++;parent.insertBefore(createMarker(),node)}lastPartIndex=index;this.parts.push({type:"node",index});if(null===node.nextSibling){node.data=""}else{nodesToRemove.push(node);index--}partIndex++}else{let i=-1;while(-1!==(i=node.data.indexOf(marker,i+1))){this.parts.push({type:"node",index:-1})}}}}};_prepareTemplate(element);for(const n of nodesToRemove){n.parentNode.removeChild(n)}}}const isTemplatePartActive=part=>-1!==part.index,createMarker=()=>document.createComment(""),lastAttributeNameRegex=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;var template={marker:marker,nodeMarker:nodeMarker,markerRegex:markerRegex,boundAttributeSuffix:boundAttributeSuffix,Template:Template,isTemplatePartActive:isTemplatePartActive,createMarker:createMarker,lastAttributeNameRegex:lastAttributeNameRegex};class TemplateInstance{constructor(template,processor,options){this._parts=[];this.template=template;this.processor=processor;this.options=options}update(values){let i=0;for(const part of this._parts){if(part!==void 0){part.setValue(values[i])}i++}for(const part of this._parts){if(part!==void 0){part.commit()}}}_clone(){const fragment=isCEPolyfill?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),parts=this.template.parts;let partIndex=0,nodeIndex=0;const _prepareInstance=fragment=>{const walker=document.createTreeWalker(fragment,133,null,!1);let node=walker.nextNode();while(partIndex<parts.length&&null!==node){const part=parts[partIndex];if(!isTemplatePartActive(part)){this._parts.push(void 0);partIndex++}else if(nodeIndex===part.index){if("node"===part.type){const part=this.processor.handleTextExpression(this.options);part.insertAfterNode(node.previousSibling);this._parts.push(part)}else{this._parts.push(...this.processor.handleAttributeExpressions(node,part.name,part.strings,this.options))}partIndex++}else{nodeIndex++;if("TEMPLATE"===node.nodeName){_prepareInstance(node.content)}node=walker.nextNode()}}};_prepareInstance(fragment);if(isCEPolyfill){document.adoptNode(fragment);customElements.upgrade(fragment)}return fragment}}var templateInstance={TemplateInstance:TemplateInstance};class TemplateResult{constructor(strings,values,type,processor){this.strings=strings;this.values=values;this.type=type;this.processor=processor}getHTML(){const endIndex=this.strings.length-1;let html="";for(let i=0;i<endIndex;i++){const s=this.strings[i],match=lastAttributeNameRegex.exec(s);if(match){html+=s.substr(0,match.index)+match[1]+match[2]+boundAttributeSuffix+match[3]+marker}else{html+=s+nodeMarker}}return html+this.strings[endIndex]}getTemplateElement(){const template=document.createElement("template");template.innerHTML=this.getHTML();return template}}class SVGTemplateResult extends TemplateResult{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const template=super.getTemplateElement(),content=template.content,svgElement=content.firstChild;content.removeChild(svgElement);reparentNodes(content,svgElement.firstChild);return template}}var templateResult={TemplateResult:TemplateResult,SVGTemplateResult:SVGTemplateResult};const isPrimitive=value=>{return null===value||!("object"===typeof value||"function"===typeof value)};class AttributeCommitter{constructor(element,name,strings){this.dirty=!0;this.element=element;this.name=name;this.strings=strings;this.parts=[];for(let i=0;i<strings.length-1;i++){this.parts[i]=this._createPart()}}_createPart(){return new AttributePart(this)}_getValue(){const strings=this.strings,l=strings.length-1;let text="";for(let i=0;i<l;i++){text+=strings[i];const part=this.parts[i];if(part!==void 0){const v=part.value;if(null!=v&&(Array.isArray(v)||"string"!==typeof v&&v[Symbol.iterator])){for(const t of v){text+="string"===typeof t?t:t+""}}else{text+="string"===typeof v?v:v+""}}}text+=strings[l];return text}commit(){if(this.dirty){this.dirty=!1;this.element.setAttribute(this.name,this._getValue())}}}class AttributePart{constructor(comitter){this.value=void 0;this.committer=comitter}setValue(value){if(value!==noChange&&(!isPrimitive(value)||value!==this.value)){this.value=value;if(!isDirective(value)){this.committer.dirty=!0}}}commit(){while(isDirective(this.value)){const directive$$1=this.value;this.value=noChange;directive$$1(this)}if(this.value===noChange){return}this.committer.commit()}}class NodePart{constructor(options){this.value=void 0;this._pendingValue=void 0;this.options=options}appendInto(container){this.startNode=container.appendChild(createMarker());this.endNode=container.appendChild(createMarker())}insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}appendIntoPart(part){part._insert(this.startNode=createMarker());part._insert(this.endNode=createMarker())}insertAfterPart(ref){ref._insert(this.startNode=createMarker());this.endNode=ref.endNode;ref.endNode=this.startNode}setValue(value){this._pendingValue=value}commit(){while(isDirective(this._pendingValue)){const directive$$1=this._pendingValue;this._pendingValue=noChange;directive$$1(this)}const value=this._pendingValue;if(value===noChange){return}if(isPrimitive(value)){if(value!==this.value){this._commitText(value)}}else if(value instanceof TemplateResult){this._commitTemplateResult(value)}else if(value instanceof Node){this._commitNode(value)}else if(Array.isArray(value)||value[Symbol.iterator]){this._commitIterable(value)}else if(value===nothing){this.value=nothing;this.clear()}else{this._commitText(value)}}_insert(node){this.endNode.parentNode.insertBefore(node,this.endNode)}_commitNode(value){if(this.value===value){return}this.clear();this._insert(value);this.value=value}_commitText(value){const node=this.startNode.nextSibling;value=null==value?"":value;if(node===this.endNode.previousSibling&&3===node.nodeType){node.data=value}else{this._commitNode(document.createTextNode("string"===typeof value?value:value+""))}this.value=value}_commitTemplateResult(value){const template=this.options.templateFactory(value);if(this.value instanceof TemplateInstance&&this.value.template===template){this.value.update(value.values)}else{const instance=new TemplateInstance(template,value.processor,this.options),fragment=instance._clone();instance.update(value.values);this._commitNode(fragment);this.value=instance}}_commitIterable(value){if(!Array.isArray(this.value)){this.value=[];this.clear()}const itemParts=this.value;let partIndex=0,itemPart;for(const item of value){itemPart=itemParts[partIndex];if(itemPart===void 0){itemPart=new NodePart(this.options);itemParts.push(itemPart);if(0===partIndex){itemPart.appendIntoPart(this)}else{itemPart.insertAfterPart(itemParts[partIndex-1])}}itemPart.setValue(item);itemPart.commit();partIndex++}if(partIndex<itemParts.length){itemParts.length=partIndex;this.clear(itemPart&&itemPart.endNode)}}clear(startNode=this.startNode){removeNodes(this.startNode.parentNode,startNode.nextSibling,this.endNode)}}class BooleanAttributePart{constructor(element,name,strings){this.value=void 0;this._pendingValue=void 0;if(2!==strings.length||""!==strings[0]||""!==strings[1]){throw new Error("Boolean attributes can only contain a single expression")}this.element=element;this.name=name;this.strings=strings}setValue(value){this._pendingValue=value}commit(){while(isDirective(this._pendingValue)){const directive$$1=this._pendingValue;this._pendingValue=noChange;directive$$1(this)}if(this._pendingValue===noChange){return}const value=!!this._pendingValue;if(this.value!==value){if(value){this.element.setAttribute(this.name,"")}else{this.element.removeAttribute(this.name)}}this.value=value;this._pendingValue=noChange}}class PropertyCommitter extends AttributeCommitter{constructor(element,name,strings){super(element,name,strings);this.single=2===strings.length&&""===strings[0]&&""===strings[1]}_createPart(){return new PropertyPart(this)}_getValue(){if(this.single){return this.parts[0].value}return super._getValue()}commit(){if(this.dirty){this.dirty=!1;this.element[this.name]=this._getValue()}}}class PropertyPart extends AttributePart{}let eventOptionsSupported=!1;try{const options={get capture(){eventOptionsSupported=!0;return!1}};window.addEventListener("test",options,options);window.removeEventListener("test",options,options)}catch(_e){}class EventPart{constructor(element,eventName,eventContext){this.value=void 0;this._pendingValue=void 0;this.element=element;this.eventName=eventName;this.eventContext=eventContext;this._boundHandleEvent=e=>this.handleEvent(e)}setValue(value){this._pendingValue=value}commit(){while(isDirective(this._pendingValue)){const directive$$1=this._pendingValue;this._pendingValue=noChange;directive$$1(this)}if(this._pendingValue===noChange){return}const newListener=this._pendingValue,oldListener=this.value,shouldRemoveListener=null==newListener||null!=oldListener&&(newListener.capture!==oldListener.capture||newListener.once!==oldListener.once||newListener.passive!==oldListener.passive),shouldAddListener=null!=newListener&&(null==oldListener||shouldRemoveListener);if(shouldRemoveListener){this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options)}if(shouldAddListener){this._options=getOptions(newListener);this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)}this.value=newListener;this._pendingValue=noChange}handleEvent(event){if("function"===typeof this.value){this.value.call(this.eventContext||this.element,event)}else{this.value.handleEvent(event)}}}const getOptions=o=>o&&(eventOptionsSupported?{capture:o.capture,passive:o.passive,once:o.once}:o.capture);var parts={isPrimitive:isPrimitive,AttributeCommitter:AttributeCommitter,AttributePart:AttributePart,NodePart:NodePart,BooleanAttributePart:BooleanAttributePart,PropertyCommitter:PropertyCommitter,PropertyPart:PropertyPart,EventPart:EventPart};class DefaultTemplateProcessor{handleAttributeExpressions(element,name,strings,options){const prefix=name[0];if("."===prefix){const comitter=new PropertyCommitter(element,name.slice(1),strings);return comitter.parts}if("@"===prefix){return[new EventPart(element,name.slice(1),options.eventContext)]}if("?"===prefix){return[new BooleanAttributePart(element,name.slice(1),strings)]}const comitter=new AttributeCommitter(element,name,strings);return comitter.parts}handleTextExpression(options){return new NodePart(options)}}const defaultTemplateProcessor=new DefaultTemplateProcessor;var defaultTemplateProcessor$1={DefaultTemplateProcessor:DefaultTemplateProcessor,defaultTemplateProcessor:defaultTemplateProcessor};function templateFactory(result){let templateCache=templateCaches.get(result.type);if(templateCache===void 0){templateCache={stringsArray:new WeakMap,keyString:new Map};templateCaches.set(result.type,templateCache)}let template=templateCache.stringsArray.get(result.strings);if(template!==void 0){return template}const key=result.strings.join(marker);template=templateCache.keyString.get(key);if(template===void 0){template=new Template(result,result.getTemplateElement());templateCache.keyString.set(key,template)}templateCache.stringsArray.set(result.strings,template);return template}const templateCaches=new Map;var templateFactory$1={templateFactory:templateFactory,templateCaches:templateCaches};const parts$1=new WeakMap,render=(result,container,options)=>{let part=parts$1.get(container);if(part===void 0){removeNodes(container,container.firstChild);parts$1.set(container,part=new NodePart(Object.assign({templateFactory},options)));part.appendInto(container)}part.setValue(result);part.commit()};var render$1={parts:parts$1,render:render};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const html=(strings,...values)=>new TemplateResult(strings,values,"html",defaultTemplateProcessor),svg=(strings,...values)=>new SVGTemplateResult(strings,values,"svg",defaultTemplateProcessor);var litHtml={html:html,svg:svg,DefaultTemplateProcessor:DefaultTemplateProcessor,defaultTemplateProcessor:defaultTemplateProcessor,directive:directive,isDirective:isDirective,removeNodes:removeNodes,reparentNodes:reparentNodes,noChange:noChange,nothing:nothing,AttributeCommitter:AttributeCommitter,AttributePart:AttributePart,BooleanAttributePart:BooleanAttributePart,EventPart:EventPart,isPrimitive:isPrimitive,NodePart:NodePart,PropertyCommitter:PropertyCommitter,PropertyPart:PropertyPart,parts:parts$1,render:render,templateCaches:templateCaches,templateFactory:templateFactory,TemplateInstance:TemplateInstance,SVGTemplateResult:SVGTemplateResult,TemplateResult:TemplateResult,createMarker:createMarker,isTemplatePartActive:isTemplatePartActive,Template:Template};if(!Object.getOwnPropertyDescriptor(DocumentFragment.prototype,"children")){Object.defineProperty(DocumentFragment.prototype,"children",{enumerable:!0,configurable:!0,get:function(){var childNodes=this.childNodes,children=Array.prototype.filter.call(childNodes,function(node){return node.nodeType===node.ELEMENT_NODE});return children}})}if(!Object.getOwnPropertyDescriptor(Element.prototype,"children")){Object.defineProperty(SVGElement.prototype,"children",{enumerable:!0,configurable:!0,get:function(){var childNodes=this.childNodes,children=Array.prototype.filter.call(childNodes,function(node){return node.nodeType===node.ELEMENT_NODE});return children}})}if(0===Array.from(function*(){yield 1}()).length){const from=Array.from;Array.from=function(iterable){if("function"===typeof iterable[Symbol.iterator]){let array=[];for(let value of iterable){array.push(value)}return array}else{return from(iterable)}};if(2!==Array.from(function*(){yield*[1,2]}())[1]){throw new Error("Cannot polyfill Array.from()")}}if(0===new Set([1]).size){const _Set=window.Set,Set=function Set(iterable=[]){let obj=new _Set;obj.constructor=Set;Object.setPrototypeOf(obj,_Set.prototype);for(let value of iterable){obj.add(value)}return obj};Object.defineProperty(Set,Symbol.species,{get:function(){return Set},set:void 0,enumerable:!1,configurable:!0});_Set.prototype[Symbol.iterator]=function*(){let values=[];this.forEach(value=>values.push(value));yield*values};_Set.prototype.values=_Set.prototype.entries=function*(){for(let value of this){yield value}};const setMinus0=new _Set;setMinus0.add(-0);if(setMinus0.has(0)){setMinus0.clear()}_Set.prototype._add=_Set.prototype.add;_Set.prototype._has=_Set.prototype.has;_Set.prototype.add=function(value){if(0===value&&setMinus0._has(value)){value=0}this._add(value);return this};_Set.prototype.has=function(value){if(0===value&&setMinus0._has(value)){value=0}return this._has(value)};Set.prototype=_Set.prototype;window.Set=Set;let set=new Set([1,2]);if(!(2===set.size&&set.has(1)&&set.has(2)&&!set.has(3)&&1===set.values().next().value&&set instanceof Set&&Set[Symbol.species]===Set&&set.add(3)===set&&set.has(3)&&1===new Set([0,-0]).size&&new Set([-0]).has(0)&&new Set([0]).has(-0))){throw new Error("Cannot polyfill Set class")}}if(0===new Map([[1,"a"]]).size){const _Map=window.Map,Map=function Map(iterable=[]){let obj=new _Map;obj.constructor=Map;Object.setPrototypeOf(obj,_Map.prototype);for(let[key,value]of iterable){obj.set(key,value)}return obj};Object.defineProperty(Map,Symbol.species,{get:function(){return Map},set:void 0,enumerable:!1,configurable:!0});_Map.prototype[Symbol.iterator]=function*(){let keyValuePairs=[];this.forEach((value,key)=>keyValuePairs.push([key,value]));yield*keyValuePairs};_Map.prototype.keys=function*(){for(let[key,value]of this){yield key}};_Map.prototype.values=function*(){for(let[key,value]of this){yield value}};_Map.prototype.entries=function*(){for(let _entry of this){yield _entry}};const mapMinus0=new _Map;mapMinus0.set(-0,1);if(mapMinus0.has(0)){mapMinus0.clear()}_Map.prototype._set=_Map.prototype.set;_Map.prototype._has=_Map.prototype.has;_Map.prototype.set=function(key,value){if(0===key&&mapMinus0._has(key)){key=0}this._set(key,value);return this};_Map.prototype.has=function(key){if(0===key&&mapMinus0._has(key)){key=0}return this._has(key)};Map.prototype=_Map.prototype;window.Map=Map;let map=new Map([[1,"a"],[2,"b"]]);if(!(2===map.size&&map.has(1)&&map.has(2)&&!map.has(3)&&1===map.keys().next().value&&"a"===map.values().next().value&&1===map.entries().next().value[0]&&map instanceof Map&&Map[Symbol.species]===Map&&map.set(3,"c")===map&&map.has(3)&&1===new Map([[0,"a"],[-0,"b"]]).size&&new Map([[-0,"b"]]).has(0)&&new Map([[0,"a"]]).has(-0))){throw new Error("Cannot polyfill Map class")}}const isAttributeChangedPolyfillRequired=function(){class DummyCustomElementToCheckAttributeChangedCallbackCapability extends HTMLElement{static get observedAttributes(){return["lang"]}attributeChangedCallback(name,oldValue,newValue){this.attributeChangedCallbackCalled=!0}}customElements.define("dummy-custom-element-to-check-attribute-changed-callback-capability",DummyCustomElementToCheckAttributeChangedCallbackCapability);const dummyElement=document.createElement("dummy-custom-element-to-check-attribute-changed-callback-capability");dummyElement.lang="en";return!dummyElement.attributeChangedCallbackCalled}(),polyfill=base=>!isAttributeChangedPolyfillRequired?base:class PolyfilledElement extends base{constructor(){super();this._polyfillAttributeChangedCallback()}_polyfillAttributeChangedCallback(){this._selfObserver=this._selfObserver||new MutationObserver(this._handleSelfAttributeChange.bind(this));this._selfObserver.observe(this,{attributes:!0,attributeOldValue:!0,attributeFilter:this.constructor.observedAttributes})}setAttribute(name,value){if(!this._observedAttributes){let observedAttributes=this.constructor.observedAttributes;this.__proto__._observedAttributes=new Set;for(let attr of observedAttributes){this._observedAttributes.add(attr)}}if(this._observedAttributes.has(name)){this._lastSetAttributeCall=this._lastSetAttributeCall||Object.create(null);this._inSetAttributeCall=!0;if(Object.prototype.hasOwnProperty.call(this._lastSetAttributeCall,name)){delete this._lastSetAttributeCall[name]}super.setAttribute(name,value);this._inSetAttributeCall=!1;if(Object.prototype.hasOwnProperty.call(this._lastSetAttributeCall,name)){delete this._lastSetAttributeCall[name]}else{this._lastSetAttributeCall[name]=value}}else{super.setAttribute(name,value)}}_handleSelfAttributeChange(mutations){mutations.forEach(function(mutation){switch(mutation.type){case"attributes":let name=mutation.attributeName,oldValue=mutation.oldValue,newValue=this.getAttribute(name);this._lastSetAttributeCall=this._lastSetAttributeCall||Object.create(null);if(!this._inSetAttributeCall&&(!Object.prototype.hasOwnProperty.call(this._lastSetAttributeCall,name)||this._lastSetAttributeCall[name]!==newValue)){if(this.attributeChangedCallback){this.attributeChangedCallback(name,oldValue,newValue)}}if(Object.prototype.hasOwnProperty.call(this._lastSetAttributeCall,name)){delete this._lastSetAttributeCall[name]}else{this._lastSetAttributeCall[name]=newValue}break;default:break;}},this)}};var polyfill$1={polyfill:polyfill};const formatCache=new Map;class I18nNumber extends polyfill(HTMLElement){static get is(){return"i18n-number"}static get observedAttributes(){return["lang","options","offset"]}__render(){return html`<span id="number">${this.formatted||""}</span>`}constructor(){super();this.DEFAULT_LANG="en";this.offset=0}attributeChangedCallback(name,oldValue,newValue){switch(name){case"lang":this._langChanged(newValue);break;case"options":try{this.options=JSON.parse(newValue)}catch(ex){this.options=void 0}break;case"offset":this.offset=parseInt(newValue);break;default:break;}}get root(){return this.shadowRoot}get options(){return this._options}set options(value){this._optionsChanged(this._options=value)}get raw(){return this._raw}set raw(value){this._rawChanged(this._raw=value)}get offset(){return this._offset}set offset(value){this._offsetChanged(this._offset=value)}connectedCallback(){if(!this.lang){this.lang=this.DEFAULT_LANG}if(!this.observer){this._setupObservers()}this.raw=this.textNode.data;this.invalidate()}_setupObservers(){let i=0;do{this.textNode=this.childNodes[i++];if(!this.textNode){this.textNode=this.childNodes[0];break}}while(this.textNode.nodeType!==this.textNode.TEXT_NODE);if(!this.textNode){this.appendChild(document.createTextNode(""));this.textNode=this.childNodes[0]}this.observer=new MutationObserver(this._textMutated.bind(this));this.observer.observe(this.textNode,{characterData:!0});this.nodeObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){switch(mutation.type){case"childList":let i=0;do{if(mutation.addedNodes[i]&&mutation.addedNodes[i].nodeType===mutation.addedNodes[i].TEXT_NODE){this.textNode=mutation.addedNodes[i];this.raw=this.textNode.data;this.observer.observe(this.textNode,{characterData:!0});break}i++}while(i<mutation.addedNodes.length);break;default:break;}},this)}.bind(this));this.nodeObserver.observe(this,{childList:!0})}_textMutated(mutations){mutations.forEach(function(mutation){switch(mutation.type){case"characterData":if(this.raw!==mutation.target.data){this.raw=mutation.target.data}break;default:break;}},this)}_rawChanged(raw){if(this.textNode){if(raw!==this.textNode.data){this.textNode.data=raw}this._render(this.lang,this.options,raw,this.offset)}}_langChanged(lang){if(!lang||"null"===lang){this.lang=this.DEFAULT_LANG;lang=this.lang}if(this.textNode){this._render(lang,this.options,this.raw,this.offset)}}_optionsChanged(options){if(this.textNode){this._render(this.lang,options,this.raw,this.offset)}}notifyPath(path,value){this._onOptionsPropertyChanged()}_onOptionsPropertyChanged(){if(this.textNode){this._render(this.lang,this.options,this.raw,this.offset)}}_offsetChanged(offset){if(this.textNode){this._render(this.lang,this.options,this.raw,offset)}}_getNumberFormatObject(lang,options){if(!lang||"null"===lang){lang=this.DEFAULT_LANG}let formatId=lang+JSON.stringify(options),formatObject=formatCache.get(formatId);if(!formatObject){formatObject=new Intl.NumberFormat(lang,options);formatCache.set(formatId,formatObject)}return formatObject}_formatNumber(lang,options,number){if(!lang){lang=this.DEFAULT_LANG}try{return this._getNumberFormatObject(lang,options).format(number)}catch(e){return number.toString()}}_render(lang,options,raw,offset){raw=raw.trim();if(!raw&&!this.formatted){return}if(raw){this.rawNumber=+raw;this.number=this.rawNumber-offset;this.formatted=this._formatNumber(lang,options,this.number)}else{this.rawNumber=void 0;this.number=void 0;this.formatted=""}this.invalidate()}invalidate(){if(!this.needsRender){this.needsRender=!0;Promise.resolve().then(()=>{this.needsRender=!1;if(!this.shadowRoot){this.attachShadow({mode:"open"})}render(this.__render(),this.shadowRoot);if("undefined"!==typeof this.formatted){this.dispatchEvent(new Event("rendered",{bubbles:!0,cancelable:!1,composed:!0}))}})}}render(){this._render(this.lang,this.options,this.raw,this.offset)}}customElements.define(I18nNumber.is,I18nNumber);var i18nNumber={I18nNumber:I18nNumber};const _cp=[function(n,ord){if(ord)return"other";return"other"},function(n,ord){if(ord)return"other";return 1==n?"one":"other"},function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"}];var plurals={af:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ak:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},am:function(n,ord){if(ord)return"other";return 0<=n&&1>=n?"one":"other"},ar:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return 0==n?"zero":1==n?"one":2==n?"two":3<=n100&&10>=n100?"few":11<=n100&&99>=n100?"many":"other"},ars:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return 0==n?"zero":1==n?"one":2==n?"two":3<=n100&&10>=n100?"few":11<=n100&&99>=n100?"many":"other"},as:function(n,ord){if(ord)return 1==n||5==n||7==n||8==n||9==n||10==n?"one":2==n||3==n?"two":4==n?"few":6==n?"many":"other";return 0<=n&&1>=n?"one":"other"},asa:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ast:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},az:function(n,ord){var s=(n+"").split("."),i=s[0],i10=i.slice(-1),i100=i.slice(-2),i1000=i.slice(-3);if(ord)return 1==i10||2==i10||5==i10||7==i10||8==i10||20==i100||50==i100||70==i100||80==i100?"one":3==i10||4==i10||100==i1000||200==i1000||300==i1000||400==i1000||500==i1000||600==i1000||700==i1000||800==i1000||900==i1000?"few":0==i||6==i10||40==i100||60==i100||90==i100?"many":"other";return 1==n?"one":"other"},be:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return(2==n10||3==n10)&&12!=n100&&13!=n100?"few":"other";return 1==n10&&11!=n100?"one":2<=n10&&4>=n10&&(12>n100||14<n100)?"few":t0&&0==n10||5<=n10&&9>=n10||11<=n100&&14>=n100?"many":"other"},bem:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},bez:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},bg:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},bh:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},bm:function(n,ord){if(ord)return"other";return"other"},bn:function(n,ord){if(ord)return 1==n||5==n||7==n||8==n||9==n||10==n?"one":2==n||3==n?"two":4==n?"few":6==n?"many":"other";return 0<=n&&1>=n?"one":"other"},bo:function(n,ord){if(ord)return"other";return"other"},br:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),n1000000=t0&&s[0].slice(-6);if(ord)return"other";return 1==n10&&11!=n100&&71!=n100&&91!=n100?"one":2==n10&&12!=n100&&72!=n100&&92!=n100?"two":(3==n10||4==n10||9==n10)&&(10>n100||19<n100)&&(70>n100||79<n100)&&(90>n100||99<n100)?"few":0!=n&&t0&&0==n1000000?"many":"other"},brx:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},bs:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&1==i10&&11!=i100||1==f10&&11!=f100?"one":v0&&2<=i10&&4>=i10&&(12>i100||14<i100)||2<=f10&&4>=f10&&(12>f100||14<f100)?"few":"other"},ca:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return 1==n||3==n?"one":2==n?"two":4==n?"few":"other";return 1==n&&v0?"one":"other"},ce:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},cgg:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},chr:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ckb:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},cs:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":2<=i&&4>=i&&v0?"few":!v0?"many":"other"},cy:function(n,ord){if(ord)return 0==n||7==n||8==n||9==n?"zero":1==n?"one":2==n?"two":3==n||4==n?"few":5==n||6==n?"many":"other";return 0==n?"zero":1==n?"one":2==n?"two":3==n?"few":6==n?"many":"other"},da:function(n,ord){var s=(n+"").split("."),i=s[0],t0=+s[0]==n;if(ord)return"other";return 1==n||!t0&&(0==i||1==i)?"one":"other"},de:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},dsb:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i100=i.slice(-2),f100=f.slice(-2);if(ord)return"other";return v0&&1==i100||1==f100?"one":v0&&2==i100||2==f100?"two":v0&&(3==i100||4==i100)||3==f100||4==f100?"few":"other"},dv:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},dz:function(n,ord){if(ord)return"other";return"other"},ee:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},el:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},en:function(n,ord){var s=(n+"").split("."),v0=!s[1],t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return 1==n10&&11!=n100?"one":2==n10&&12!=n100?"two":3==n10&&13!=n100?"few":"other";return 1==n&&v0?"one":"other"},eo:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},es:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},et:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},eu:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},fa:function(n,ord){if(ord)return"other";return 0<=n&&1>=n?"one":"other"},ff:function(n,ord){if(ord)return"other";return 0<=n&&2>n?"one":"other"},fi:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},fil:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),f10=f.slice(-1);if(ord)return 1==n?"one":"other";return v0&&(1==i||2==i||3==i)||v0&&4!=i10&&6!=i10&&9!=i10||!v0&&4!=f10&&6!=f10&&9!=f10?"one":"other"},fo:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},fr:function(n,ord){if(ord)return 1==n?"one":"other";return 0<=n&&2>n?"one":"other"},fur:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},fy:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},ga:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n;if(ord)return 1==n?"one":"other";return 1==n?"one":2==n?"two":t0&&3<=n&&6>=n?"few":t0&&7<=n&&10>=n?"many":"other"},gd:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n;if(ord)return 1==n||11==n?"one":2==n||12==n?"two":3==n||13==n?"few":"other";return 1==n||11==n?"one":2==n||12==n?"two":t0&&3<=n&&10>=n||t0&&13<=n&&19>=n?"few":"other"},gl:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},gsw:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},gu:function(n,ord){if(ord)return 1==n?"one":2==n||3==n?"two":4==n?"few":6==n?"many":"other";return 0<=n&&1>=n?"one":"other"},guw:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},gv:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return v0&&1==i10?"one":v0&&2==i10?"two":v0&&(0==i100||20==i100||40==i100||60==i100||80==i100)?"few":!v0?"many":"other"},ha:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},haw:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},he:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1],t0=+s[0]==n,n10=t0&&s[0].slice(-1);if(ord)return"other";return 1==n&&v0?"one":2==i&&v0?"two":v0&&(0>n||10<n)&&t0&&0==n10?"many":"other"},hi:function(n,ord){if(ord)return 1==n?"one":2==n||3==n?"two":4==n?"few":6==n?"many":"other";return 0<=n&&1>=n?"one":"other"},hr:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&1==i10&&11!=i100||1==f10&&11!=f100?"one":v0&&2<=i10&&4>=i10&&(12>i100||14<i100)||2<=f10&&4>=f10&&(12>f100||14<f100)?"few":"other"},hsb:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i100=i.slice(-2),f100=f.slice(-2);if(ord)return"other";return v0&&1==i100||1==f100?"one":v0&&2==i100||2==f100?"two":v0&&(3==i100||4==i100)||3==f100||4==f100?"few":"other"},hu:function(n,ord){if(ord)return 1==n||5==n?"one":"other";return 1==n?"one":"other"},hy:function(n,ord){if(ord)return 1==n?"one":"other";return 0<=n&&2>n?"one":"other"},ia:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},id:function(n,ord){if(ord)return"other";return"other"},ig:function(n,ord){if(ord)return"other";return"other"},ii:function(n,ord){if(ord)return"other";return"other"},in:function(n,ord){if(ord)return"other";return"other"},io:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},is:function(n,ord){var s=(n+"").split("."),i=s[0],t0=+s[0]==n,i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return t0&&1==i10&&11!=i100||!t0?"one":"other"},it:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return 11==n||8==n||80==n||800==n?"many":"other";return 1==n&&v0?"one":"other"},iu:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},iw:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1],t0=+s[0]==n,n10=t0&&s[0].slice(-1);if(ord)return"other";return 1==n&&v0?"one":2==i&&v0?"two":v0&&(0>n||10<n)&&t0&&0==n10?"many":"other"},ja:function(n,ord){if(ord)return"other";return"other"},jbo:function(n,ord){if(ord)return"other";return"other"},jgo:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ji:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},jmc:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},jv:function(n,ord){if(ord)return"other";return"other"},jw:function(n,ord){if(ord)return"other";return"other"},ka:function(n,ord){var s=(n+"").split("."),i=s[0],i100=i.slice(-2);if(ord)return 1==i?"one":0==i||2<=i100&&20>=i100||40==i100||60==i100||80==i100?"many":"other";return 1==n?"one":"other"},kab:function(n,ord){if(ord)return"other";return 0<=n&&2>n?"one":"other"},kaj:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},kcg:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},kde:function(n,ord){if(ord)return"other";return"other"},kea:function(n,ord){if(ord)return"other";return"other"},kk:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n,n10=t0&&s[0].slice(-1);if(ord)return 6==n10||9==n10||t0&&0==n10&&0!=n?"many":"other";return 1==n?"one":"other"},kkj:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},kl:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},km:function(n,ord){if(ord)return"other";return"other"},kn:function(n,ord){if(ord)return"other";return 0<=n&&1>=n?"one":"other"},ko:function(n,ord){if(ord)return"other";return"other"},ks:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ksb:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ksh:function(n,ord){if(ord)return"other";return 0==n?"zero":1==n?"one":"other"},ku:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},kw:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},ky:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},lag:function(n,ord){var s=(n+"").split("."),i=s[0];if(ord)return"other";return 0==n?"zero":(0==i||1==i)&&0!=n?"one":"other"},lb:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},lg:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},lkt:function(n,ord){if(ord)return"other";return"other"},ln:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},lo:function(n,ord){if(ord)return 1==n?"one":"other";return"other"},lt:function(n,ord){var s=(n+"").split("."),f=s[1]||"",t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return"other";return 1==n10&&(11>n100||19<n100)?"one":2<=n10&&9>=n10&&(11>n100||19<n100)?"few":0!=f?"many":"other"},lv:function(n,ord){var s=(n+"").split("."),f=s[1]||"",v=f.length,t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),f100=f.slice(-2),f10=f.slice(-1);if(ord)return"other";return t0&&0==n10||11<=n100&&19>=n100||2==v&&11<=f100&&19>=f100?"zero":1==n10&&11!=n100||2==v&&1==f10&&11!=f100||2!=v&&1==f10?"one":"other"},mas:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},mg:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},mgo:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},mk:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return 1==i10&&11!=i100?"one":2==i10&&12!=i100?"two":(7==i10||8==i10)&&17!=i100&&18!=i100?"many":"other";return v0&&1==i10&&11!=i100||1==f10&&11!=f100?"one":"other"},ml:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},mn:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},mo:function(n,ord){var s=(n+"").split("."),v0=!s[1],t0=+s[0]==n,n100=t0&&s[0].slice(-2);if(ord)return 1==n?"one":"other";return 1==n&&v0?"one":!v0||0==n||1!=n&&1<=n100&&19>=n100?"few":"other"},mr:function(n,ord){if(ord)return 1==n?"one":2==n||3==n?"two":4==n?"few":"other";return 0<=n&&1>=n?"one":"other"},ms:function(n,ord){if(ord)return 1==n?"one":"other";return"other"},mt:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return 1==n?"one":0==n||2<=n100&&10>=n100?"few":11<=n100&&19>=n100?"many":"other"},my:function(n,ord){if(ord)return"other";return"other"},nah:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},naq:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},nb:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},nd:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ne:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n;if(ord)return t0&&1<=n&&4>=n?"one":"other";return 1==n?"one":"other"},nl:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},nn:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},nnh:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},no:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},nqo:function(n,ord){if(ord)return"other";return"other"},nr:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},nso:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},ny:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},nyn:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},om:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},or:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n;if(ord)return 1==n||5==n||t0&&7<=n&&9>=n?"one":2==n||3==n?"two":4==n?"few":6==n?"many":"other";return 1==n?"one":"other"},os:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},pa:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},pap:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},pl:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return 1==n&&v0?"one":v0&&2<=i10&&4>=i10&&(12>i100||14<i100)?"few":v0&&1!=i&&(0==i10||1==i10)||v0&&5<=i10&&9>=i10||v0&&12<=i100&&14>=i100?"many":"other"},prg:function(n,ord){var s=(n+"").split("."),f=s[1]||"",v=f.length,t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),f100=f.slice(-2),f10=f.slice(-1);if(ord)return"other";return t0&&0==n10||11<=n100&&19>=n100||2==v&&11<=f100&&19>=f100?"zero":1==n10&&11!=n100||2==v&&1==f10&&11!=f100||2!=v&&1==f10?"one":"other"},ps:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},pt:function(n,ord){var s=(n+"").split("."),i=s[0];if(ord)return"other";return 0==i||1==i?"one":"other"},"pt-PT":function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},rm:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ro:function(n,ord){var s=(n+"").split("."),v0=!s[1],t0=+s[0]==n,n100=t0&&s[0].slice(-2);if(ord)return 1==n?"one":"other";return 1==n&&v0?"one":!v0||0==n||1!=n&&1<=n100&&19>=n100?"few":"other"},rof:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},root:function(n,ord){if(ord)return"other";return"other"},ru:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return v0&&1==i10&&11!=i100?"one":v0&&2<=i10&&4>=i10&&(12>i100||14<i100)?"few":v0&&0==i10||v0&&5<=i10&&9>=i10||v0&&11<=i100&&14>=i100?"many":"other"},rwk:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},sah:function(n,ord){if(ord)return"other";return"other"},saq:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},sc:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return 11==n||8==n||80==n||800==n?"many":"other";return 1==n&&v0?"one":"other"},scn:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return 11==n||8==n||80==n||800==n?"many":"other";return 1==n&&v0?"one":"other"},sd:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},sdh:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},se:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},seh:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ses:function(n,ord){if(ord)return"other";return"other"},sg:function(n,ord){if(ord)return"other";return"other"},sh:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&1==i10&&11!=i100||1==f10&&11!=f100?"one":v0&&2<=i10&&4>=i10&&(12>i100||14<i100)||2<=f10&&4>=f10&&(12>f100||14<f100)?"few":"other"},shi:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n;if(ord)return"other";return 0<=n&&1>=n?"one":t0&&2<=n&&10>=n?"few":"other"},si:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"";if(ord)return"other";return 0==n||1==n||0==i&&1==f?"one":"other"},sk:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":2<=i&&4>=i&&v0?"few":!v0?"many":"other"},sl:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1],i100=i.slice(-2);if(ord)return"other";return v0&&1==i100?"one":v0&&2==i100?"two":v0&&(3==i100||4==i100)||!v0?"few":"other"},sma:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},smi:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},smj:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},smn:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},sms:function(n,ord){if(ord)return"other";return 1==n?"one":2==n?"two":"other"},sn:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},so:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},sq:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return 1==n?"one":4==n10&&14!=n100?"many":"other";return 1==n?"one":"other"},sr:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&1==i10&&11!=i100||1==f10&&11!=f100?"one":v0&&2<=i10&&4>=i10&&(12>i100||14<i100)||2<=f10&&4>=f10&&(12>f100||14<f100)?"few":"other"},ss:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ssy:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},st:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},sv:function(n,ord){var s=(n+"").split("."),v0=!s[1],t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return(1==n10||2==n10)&&11!=n100&&12!=n100?"one":"other";return 1==n&&v0?"one":"other"},sw:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},syr:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ta:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},te:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},teo:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},th:function(n,ord){if(ord)return"other";return"other"},ti:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},tig:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},tk:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n,n10=t0&&s[0].slice(-1);if(ord)return 6==n10||9==n10||10==n?"few":"other";return 1==n?"one":"other"},tl:function(n,ord){var s=(n+"").split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),f10=f.slice(-1);if(ord)return 1==n?"one":"other";return v0&&(1==i||2==i||3==i)||v0&&4!=i10&&6!=i10&&9!=i10||!v0&&4!=f10&&6!=f10&&9!=f10?"one":"other"},tn:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},to:function(n,ord){if(ord)return"other";return"other"},tr:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ts:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},tzm:function(n,ord){var s=(n+"").split("."),t0=+s[0]==n;if(ord)return"other";return 0==n||1==n||t0&&11<=n&&99>=n?"one":"other"},ug:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},uk:function(n,ord){var s=(n+"").split("."),i=s[0],v0=!s[1],t0=+s[0]==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),i10=i.slice(-1),i100=i.slice(-2);if(ord)return 3==n10&&13!=n100?"few":"other";return v0&&1==i10&&11!=i100?"one":v0&&2<=i10&&4>=i10&&(12>i100||14<i100)?"few":v0&&0==i10||v0&&5<=i10&&9>=i10||v0&&11<=i100&&14>=i100?"many":"other"},ur:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},uz:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},ve:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},vi:function(n,ord){if(ord)return 1==n?"one":"other";return"other"},vo:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},vun:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},wa:function(n,ord){if(ord)return"other";return 0==n||1==n?"one":"other"},wae:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},wo:function(n,ord){if(ord)return"other";return"other"},xh:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},xog:function(n,ord){if(ord)return"other";return 1==n?"one":"other"},yi:function(n,ord){var s=(n+"").split("."),v0=!s[1];if(ord)return"other";return 1==n&&v0?"one":"other"},yo:function(n,ord){if(ord)return"other";return"other"},yue:function(n,ord){if(ord)return"other";return"other"},zh:function(n,ord){if(ord)return"other";return"other"},zu:function(n,ord){if(ord)return"other";return 0<=n&&1>=n?"one":"other"}},plurals$1={default:plurals};const templateCache=new Map,jsonCache=new Map;class I18nFormat extends polyfill(HTMLElement){static get is(){return"i18n-format"}static get observedAttributes(){return["lang"]}__render(){return html([this._preprocessedTemplateText||""])}constructor(){super();this._preprocessedTemplateText=""}attributeChangedCallback(name,oldValue,newValue){switch(name){case"lang":this._langChanged(newValue);break;default:break;}}get root(){return this.shadowRoot}get DEFAULT_LANG(){return"en"}get paramAttribute(){return"slot"}get paramFormat(){return"{n}"}get observeParams(){return!0}set observeParams(value){if(!this.constructor._observeParamsWarned){console.warn(`${this.is}: observeParams is deprecated and has a read-only dummy value true.`);this.constructor._observeParamsWarned=!0}}get data(){return this._data}set data(value){this._data=value;if(this._preprocessed){this.render()}}connectedCallback(){if(!this.lang||this.lang.match(/^{{.*}}$/)||this.lang.match(/^\[\[.*\]\]$/)){this.lang=this.DEFAULT_LANG}if(!this.observer){this._setupParams()}this.render()}_setupParams(){let n;this.elements=Array.prototype.filter.call(this.childNodes,function(node){return node.nodeType===node.ELEMENT_NODE});let needParamObservation=0<this.elements.length&&"json-data"===this.elements[0].tagName.toLowerCase();this.observer=new MutationObserver(this._templateMutated.bind(this));for(n=0;n<this.elements.length;n++){if(0===n){this.templateElement=this.elements[n];this._preprocessed=needParamObservation&&this.templateElement.hasAttribute("preprocessed");if(!this._preprocessed){let i=0;do{this.templateTextNode=this.templateElement.childNodes[i++];if(!this.templateTextNode){this.templateTextNode=this.templateElement.childNodes[0];break}}while(this.templateTextNode.nodeType!==this.templateTextNode.TEXT_NODE);this.observer.observe(this.templateTextNode,{characterData:!0})}}else{if(!this.elements[n].hasAttribute(this.paramAttribute)){this.elements[n].setAttribute(this.paramAttri